diff --git a/pusong-modules/pusong-business/src/main/java/com/pusong/business/service/impl/PsCompanyInfoServiceImpl.java b/pusong-modules/pusong-business/src/main/java/com/pusong/business/service/impl/PsCompanyInfoServiceImpl.java index 4601579..ed00567 100644 --- a/pusong-modules/pusong-business/src/main/java/com/pusong/business/service/impl/PsCompanyInfoServiceImpl.java +++ b/pusong-modules/pusong-business/src/main/java/com/pusong/business/service/impl/PsCompanyInfoServiceImpl.java @@ -186,7 +186,7 @@ public class PsCompanyInfoServiceImpl implements IPsCompanyInfoService { sql.append("and business_type = '2' and is_proxy = '2'"); } lqw.exists(bo.getType() != 1, sql.toString()); - lqw.orderByAsc("CASE WHEN bus.min_end_date IS NULL THEN 1 ELSE 0 END"); + lqw.orderByAsc("CASE WHEN bus.min_end_date IS NULL THEN 1 ELSE 0 END, bus.min_end_date"); lqw.orderByDesc("finish_date"); // lqw.groupBy("com.id"); Page result = baseMapper.selectPageList2(pageQuery.build(), lqw); @@ -208,20 +208,20 @@ public class PsCompanyInfoServiceImpl implements IPsCompanyInfoService { } for (PsCompanyInfoVo record : result.getRecords()) { record.setFollowUsers(userMap.get(record.getId())); - + record.setBusinessVoList(contractBusinessVoMap.get(record.getId())); if (record.getBusinessVoList() == null){ continue; } - boolean hasDate = false; + boolean hasData = false; for (PsContractBusinessVo psContractBusinessVo : record.getBusinessVoList()) { - if (psContractBusinessVo.getEndDate() != null){ - hasDate = true; - } int diffDay = DateUtils.diffDay(new Date(), psContractBusinessVo.getEndDate()); psContractBusinessVo.setRemainingDay(diffDay); + if (psContractBusinessVo.getEndDate() != null){ + hasData = true; + } } - if (hasDate){ - record.setBusinessVoList(contractBusinessVoMap.get(record.getId())); + if (!hasData){ + record.setBusinessVoList(null); } } }