Commit dd7a4232 authored by 廖旭伟's avatar 廖旭伟

bug修改

parent b2344164
......@@ -17,4 +17,6 @@ import java.util.List;
public class RetainLogVo extends BaseEntityLong {
/** 查询条件 */
private String query;
/** 子证联报状态 已联报数/子证总数 */
private String processStatus;
}
\ No newline at end of file
......@@ -4,12 +4,22 @@ import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Context;
import com.mortals.framework.model.PageInfo;
import com.mortals.framework.service.impl.AbstractCRUDServiceImpl;
import com.mortals.xhx.common.code.ProcessStatusEnum;
import com.mortals.xhx.common.code.StatusEnum;
import com.mortals.xhx.common.utils.StringUtils;
import com.mortals.xhx.module.certificate.model.CertificateDocumentEntity;
import com.mortals.xhx.module.certificate.model.vo.CertificateDocumentPdu;
import com.mortals.xhx.module.child.model.ChildLicenseEntity;
import com.mortals.xhx.module.child.model.ChildLicenseQuery;
import com.mortals.xhx.module.child.service.ChildLicenseService;
import com.mortals.xhx.module.record.dao.RetainLogDao;
import com.mortals.xhx.module.record.model.ApplyLogEntity;
import com.mortals.xhx.module.record.model.RetainLogEntity;
import com.mortals.xhx.module.record.model.RetainLogQuery;
import com.mortals.xhx.module.record.service.RetainLogService;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
......@@ -25,6 +35,9 @@ import java.util.List;
@Service("retainLogService")
public class RetainLogServiceImpl extends AbstractCRUDServiceImpl<RetainLogDao, RetainLogEntity, Long> implements RetainLogService {
@Autowired
private ChildLicenseService childLicenseService;
@Override
protected RetainLogEntity findBefore(RetainLogEntity entity, PageInfo pageInfo, Context context) throws AppException {
RetainLogQuery query = new RetainLogQuery();
......@@ -44,4 +57,39 @@ public class RetainLogServiceImpl extends AbstractCRUDServiceImpl<RetainLogDao,
return query;
}
@Override
protected void findAfter(RetainLogEntity params, PageInfo pageInfo, Context context, List<RetainLogEntity> list) throws AppException {
if(CollectionUtils.isNotEmpty(list)){
for(RetainLogEntity entity:list){
List<ChildLicenseEntity> childLicenseList = childLicenseService.find(new ChildLicenseQuery().applyId(entity.getApplyId()));
// if(CollectionUtils.isEmpty(childLicenseList)){
// entity.setProcessStatus("0/0");
// }else {
// Map<Integer, List<ChildLicenseEntity>> group = childLicenseList.stream().collect(Collectors.groupingBy(x -> x.getProcessStatus()));
// int pCount = CollectionUtils.isEmpty(group.get(1)) ? 0 : group.get(1).size();
// entity.setProcessStatus(pCount + "/" + childLicenseList.size());
// }
int childSum = 0;
int pCount = 0;
List<CertificateDocumentPdu> documentEntityList = new ArrayList<>();
for(ChildLicenseEntity item:childLicenseList){
CertificateDocumentEntity documentEntity = new CertificateDocumentEntity();
BeanUtils.copyProperties(item,documentEntity);
documentEntity.setId(item.getDocumentId());
documentEntity.setStatus(StatusEnum.DISABLE.getValue());
if(item.getChildStatus()==StatusEnum.ENABLE.getValue()){
documentEntity.setStatus(StatusEnum.ENABLE.getValue());
childSum++;
if(item.getProcessStatus()== ProcessStatusEnum.已处理.getValue().intValue()){
pCount++;
}
}
CertificateDocumentPdu pdu = new CertificateDocumentPdu();
BeanUtils.copyProperties(documentEntity, pdu);
documentEntityList.add(pdu);
}
entity.setProcessStatus(pCount + "/" + childSum);
}
}
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment