This commit is contained in:
mx 2024-11-29 18:04:08 +08:00
parent aba87556be
commit 54f8a71d8a

View File

@ -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<PsCompanyInfoVo> 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);
}
}
}