|
@@ -672,11 +672,11 @@ public class CwProjectReportService extends ServiceImpl<CwProjectReportMapper, C
|
|
queryWrapper.le("a.audit_fees", contractAmounts[1]);
|
|
queryWrapper.le("a.audit_fees", contractAmounts[1]);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- if (StringUtils.isNotEmpty(projectReportData.getReviewStatus())) {
|
|
|
|
|
|
+ if (StringUtils.isNotEmpty(projectReportData.getReviewStatus()) && !"-1".equals(projectReportData.getReviewStatus())){
|
|
queryWrapper.eq("cw_rev.review_status", projectReportData.getReviewStatus());
|
|
queryWrapper.eq("cw_rev.review_status", projectReportData.getReviewStatus());
|
|
}
|
|
}
|
|
//报告号签章状态
|
|
//报告号签章状态
|
|
- if (StringUtils.isNotEmpty(projectReportData.getApplyStatus())) {
|
|
|
|
|
|
+ if (StringUtils.isNotEmpty(projectReportData.getApplyStatus()) && !"-1".equals(projectReportData.getApplyStatus()) ) {
|
|
if("0".equals(projectReportData.getApplyStatus())){
|
|
if("0".equals(projectReportData.getApplyStatus())){
|
|
queryWrapper.isNull("cw_na.review_status");
|
|
queryWrapper.isNull("cw_na.review_status");
|
|
if(StringUtils.isBlank(projectReportData.getReviewStatus())){
|
|
if(StringUtils.isBlank(projectReportData.getReviewStatus())){
|
|
@@ -686,6 +686,15 @@ public class CwProjectReportService extends ServiceImpl<CwProjectReportMapper, C
|
|
queryWrapper.eq("cw_na.review_status", projectReportData.getApplyStatus());
|
|
queryWrapper.eq("cw_na.review_status", projectReportData.getApplyStatus());
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+// if(StringUtils.isNotEmpty(projectReportData.getApplyStatus()) && StringUtils.isNotEmpty(projectReportData.getReviewStatus())){
|
|
|
|
+// if("-1".equals(projectReportData.getApplyStatus()) && "-1".equals(projectReportData.getReviewStatus())){
|
|
|
|
+// queryWrapper.and(wrapper ->
|
|
|
|
+// wrapper.ne("cw_na.review_status", "5")
|
|
|
|
+// .or()
|
|
|
|
+// .ne("cw_rev.review_status", "5")
|
|
|
|
+// );
|
|
|
|
+// }
|
|
|
|
+// }
|
|
if (StringUtils.isNotEmpty(projectReportData.getStatus1())) {
|
|
if (StringUtils.isNotEmpty(projectReportData.getStatus1())) {
|
|
queryWrapper.eq("cw_prs1.status", projectReportData.getStatus1());
|
|
queryWrapper.eq("cw_prs1.status", projectReportData.getStatus1());
|
|
}
|
|
}
|
|
@@ -5234,4 +5243,218 @@ public class CwProjectReportService extends ServiceImpl<CwProjectReportMapper, C
|
|
}
|
|
}
|
|
return false;
|
|
return false;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 查询近1个月完成的财务报告和所有未完成的财务报告信息
|
|
|
|
+ * @param projectReportData
|
|
|
|
+ * @return
|
|
|
|
+ * @throws Exception
|
|
|
|
+ */
|
|
|
|
+ public IPage<CwProjectReportData> findNotCompletedList( Page<CwProjectReportData> page, CwProjectReportData projectReportData) throws Exception{
|
|
|
|
+ QueryWrapper<CwProjectReportData> queryWrapper = QueryWrapperGenerator.buildQueryCondition (projectReportData,CwProjectReportData.class);
|
|
|
|
+ queryWrapper.eq("a.del_flag","0");
|
|
|
|
+// queryWrapper.orderByDesc("a.create_date");
|
|
|
|
+ //条件
|
|
|
|
+ if (StringUtils.isNotEmpty(projectReportData.getProjectNumber())) {
|
|
|
|
+ queryWrapper.like("b.project_number", projectReportData.getProjectNumber());
|
|
|
|
+ }
|
|
|
|
+ if (StringUtils.isNotEmpty(projectReportData.getProjectName())) {
|
|
|
|
+ queryWrapper.like("b.project_name", projectReportData.getProjectName());
|
|
|
|
+ }
|
|
|
|
+ if (StringUtils.isNotEmpty(projectReportData.getReportName())) {
|
|
|
|
+ queryWrapper.like("a.report_name", projectReportData.getReportName());
|
|
|
|
+ }
|
|
|
|
+ if (StringUtils.isNotEmpty(projectReportData.getProjectMasterId())) {
|
|
|
|
+ queryWrapper.eq("b.project_master_id", projectReportData.getProjectMasterId());
|
|
|
|
+ }
|
|
|
|
+ if (StringUtils.isNotEmpty(projectReportData.getProjectMaster2Id())) {
|
|
|
|
+ queryWrapper.eq("b.real_header", projectReportData.getProjectMaster2Id());
|
|
|
|
+ }
|
|
|
|
+ if (StringUtils.isNotEmpty(projectReportData.getProjectMasterName())) { // 项目经理1筛选
|
|
|
|
+ queryWrapper.like("e.id", projectReportData.getProjectMasterName()).or().like("e.name", projectReportData.getProjectMasterName());
|
|
|
|
+ }
|
|
|
|
+ if (StringUtils.isNotEmpty(projectReportData.getRealHeaderName())) { // 项目经理2筛选
|
|
|
|
+ queryWrapper.like("f.id", projectReportData.getRealHeaderName()).or().like("f.name", projectReportData.getRealHeaderName());
|
|
|
|
+ }
|
|
|
|
+ if (StringUtils.isNotEmpty(projectReportData.getCreateBy().getId())) {
|
|
|
|
+ queryWrapper.and(wrapper -> wrapper.like("a.create_by_id", projectReportData.getCreateBy().getId())
|
|
|
|
+ .or()
|
|
|
|
+ .like("d.name", projectReportData.getCreateBy().getId()));
|
|
|
|
+ }
|
|
|
|
+ //4、签约时间(区间)
|
|
|
|
+ String[] contractDates = projectReportData.getContractDates();
|
|
|
|
+ if (contractDates != null) {
|
|
|
|
+
|
|
|
|
+ queryWrapper.between("a.create_time", contractDates[0], contractDates[1]);
|
|
|
|
+ }
|
|
|
|
+ //5、报告文号
|
|
|
|
+ if (StringUtils.isNotEmpty(projectReportData.getReportNo())) {
|
|
|
|
+ queryWrapper.like("new_line.report_no", projectReportData.getReportNo());
|
|
|
|
+ }
|
|
|
|
+ //6、审计收费
|
|
|
|
+ String[] contractAmounts = projectReportData.getContractAmounts();
|
|
|
|
+ if (contractAmounts != null) {
|
|
|
|
+ if (StringUtils.isNotEmpty(contractAmounts[0])) {
|
|
|
|
+ queryWrapper.ge("a.audit_fees",contractAmounts[0]);
|
|
|
|
+ }
|
|
|
|
+ if (contractAmounts.length>1 && StringUtils.isNotEmpty(contractAmounts[1])) {
|
|
|
|
+ queryWrapper.le("a.audit_fees", contractAmounts[1]);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if(StringUtils.isNotEmpty(projectReportData.getApplyStatus()) && StringUtils.isNotEmpty(projectReportData.getReviewStatus())){
|
|
|
|
+ if("-1".equals(projectReportData.getApplyStatus()) && "-1".equals(projectReportData.getReviewStatus())){
|
|
|
|
+ queryWrapper.and(wrapper ->
|
|
|
|
+ wrapper.ne("cw_na.review_status", "5")
|
|
|
|
+ .or()
|
|
|
|
+ .ne("cw_rev.review_status", "5")
|
|
|
|
+ );
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+// if(StringUtils.isNotEmpty(projectReportData.getApplyStatus()) && StringUtils.isNotEmpty(projectReportData.getReviewStatus())){
|
|
|
|
+// if("-1".equals(projectReportData.getApplyStatus()) && "-1".equals(projectReportData.getReviewStatus())){
|
|
|
|
+// queryWrapper.and(wrapper ->
|
|
|
|
+// wrapper.ne("cw_na.review_status", "5")
|
|
|
|
+// .or()
|
|
|
|
+// .ne("cw_rev.review_status", "5")
|
|
|
|
+// );
|
|
|
|
+// }
|
|
|
|
+// }
|
|
|
|
+ if (StringUtils.isNotEmpty(projectReportData.getStatus1())) {
|
|
|
|
+ queryWrapper.eq("cw_prs1.status", projectReportData.getStatus1());
|
|
|
|
+ }
|
|
|
|
+ if (StringUtils.isNotBlank(projectReportData.getFilingType())) {
|
|
|
|
+ List<CwProjectRecords> projectList = cwProjectRecordsService.list(new LambdaQueryWrapper<CwProjectRecords>().eq(CwProjectRecords::getReportType, projectReportData.getFilingType()));
|
|
|
|
+ List<String> projectIdList = projectList.stream().map(CwProjectRecords::getId).collect(Collectors.toList());
|
|
|
|
+ if (CollectionUtil.isNotEmpty(projectIdList)) {
|
|
|
|
+ queryWrapper.in("b.id", projectIdList);
|
|
|
|
+ } else {
|
|
|
|
+ return new Page<>();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if (ArrayUtil.isNotEmpty(projectReportData.getCreateDates())) {
|
|
|
|
+ queryWrapper.between("a.create_time", projectReportData.getCreateDates()[0], projectReportData.getCreateDates()[1]);
|
|
|
|
+ }
|
|
|
|
+ //报告日期
|
|
|
|
+ if (ArrayUtil.isNotEmpty(projectReportData.getReportDates())) {
|
|
|
|
+ queryWrapper.between("new_line.report_date", projectReportData.getReportDates()[0], projectReportData.getReportDates()[1]);
|
|
|
|
+ }
|
|
|
|
+ //项目分类
|
|
|
|
+ if (StringUtils.isNotEmpty(projectReportData.getProjectClassification())) {
|
|
|
|
+ queryWrapper.eq("b.project_classification", projectReportData.getProjectClassification());
|
|
|
|
+ }
|
|
|
|
+ //报告类型
|
|
|
|
+ if (StringUtils.isNotEmpty(projectReportData.getReportType())) {
|
|
|
|
+ queryWrapper.eq("new_line.report_type", projectReportData.getReportType());
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ String isBmzr = "0";
|
|
|
|
+ StringBuilder officeIds = new StringBuilder();
|
|
|
|
+ //UserDTO userDTO = SpringUtil.getBean ( IUserApi.class ).getByToken(TokenProvider.getCurrentToken ( ));
|
|
|
|
+// UserDTO userDTO = UserUtils.getCurrentUserDTO();
|
|
|
|
+ List<String> manageOfficeIdList= Lists.newArrayList();
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ long l1 = System.currentTimeMillis();
|
|
|
|
+ IPage<CwProjectReportData> list = null;
|
|
|
|
+ long l2 = System.currentTimeMillis();
|
|
|
|
+ System.out.println("报告列表查询service方法消耗时间:" + (l2-l1));
|
|
|
|
+
|
|
|
|
+ //获取当前登录人角色是否是苏州报告签字盖章代办
|
|
|
|
+ UserDTO userDTO = SpringUtil.getBean(IUserApi.class).getByToken(TokenProvider.getCurrentToken());
|
|
|
|
+ if (CollectionUtil.isNotEmpty(userDTO.getRoleDTOList())){
|
|
|
|
+ for (RoleDTO roleDTO : userDTO.getRoleDTOList()) {
|
|
|
|
+ RoleDTO dtoById = SpringUtil.getBean(IRoleApi.class).getRoleDTOById(roleDTO.getId());
|
|
|
|
+ if ("szbgqzgzdb".equals(dtoById.getEnName())){
|
|
|
|
+ list = reportMapper.findNotCompletedList2(page,isBmzr, officeIds.toString(), queryWrapper);
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if(null == list){
|
|
|
|
+ list = reportMapper.findNotCompletedList(page,isBmzr, officeIds.toString(), queryWrapper);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ List<UserDTO> allUserInfo = (List<UserDTO>) RedisUtils.getInstance().get(CacheNames.USER_CACHE_USER_ALL_INFO);
|
|
|
|
+ if (null == allUserInfo || allUserInfo.size() == 0) {
|
|
|
|
+ allUserInfo = SpringUtil.getBean(IUserApi.class).getAllUserInfo();
|
|
|
|
+ }
|
|
|
|
+ ArrayList<User> users = new ArrayList<>();
|
|
|
|
+ List<UserDTO> finalAllUserInfo = allUserInfo;
|
|
|
|
+
|
|
|
|
+ List<CwProjectReportData> records = list.getRecords();
|
|
|
|
+ //获取查询的所有报告id
|
|
|
|
+ List<String> reportIdList = Lists.newArrayList();
|
|
|
|
+
|
|
|
|
+ for (CwProjectReportData record : records) {
|
|
|
|
+ reportIdList.add(record.getId());
|
|
|
|
+ }
|
|
|
|
+ //根据报告id查询修改签字注师记录表信息
|
|
|
|
+ List<CwSignatureAnnotator> sigByIdList = new ArrayList<CwSignatureAnnotator>();
|
|
|
|
+ if(reportIdList.size()>0){
|
|
|
|
+ sigByIdList = cwSignatureAnnotatorMapper.getSigByIdList(reportIdList);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ List<CwSignatureAnnotator> finalSigByIdList = sigByIdList;
|
|
|
|
+ list.getRecords().forEach(li->{
|
|
|
|
+ if (StringUtils.isBlank(li.getProjectMasterName())){
|
|
|
|
+ //根据项目经理1的id去查项目经理去名称
|
|
|
|
+ if (StringUtils.isNotBlank(li.getProjectMasterId())){
|
|
|
|
+ UserDTO matchingUser = null;
|
|
|
|
+ for (UserDTO user : finalAllUserInfo) {
|
|
|
|
+ if (li.getProjectMasterId().equals(user.getId())) {
|
|
|
|
+ matchingUser = user;
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if (matchingUser != null) {
|
|
|
|
+ String projectMasterName = matchingUser.getName(); // Assuming the property name is "userName"
|
|
|
|
+ li.setProjectMasterName(projectMasterName);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (StringUtils.isBlank(li.getRealHeaderName())) {
|
|
|
|
+ if (StringUtils.isNotBlank(li.getProjectMaster2Id())){
|
|
|
|
+ UserDTO matchingUser = null;
|
|
|
|
+ for (UserDTO user : finalAllUserInfo) {
|
|
|
|
+ if (li.getProjectMaster2Id().equals(user.getId())) {
|
|
|
|
+ matchingUser = user;
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if (matchingUser != null) {
|
|
|
|
+ String projectMasterName = matchingUser.getName(); // Assuming the property name is "userName"
|
|
|
|
+ li.setProjectMaster2Name(projectMasterName);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if(StringUtils.isEmpty(li.getSignatureAnnotatorStatus())){
|
|
|
|
+ li.setSignatureAnnotatorStatus("0");
|
|
|
|
+ }
|
|
|
|
+ /*CwSignatureAnnotator sigById = cwSignatureAnnotatorMapper.getSigById(li.getId());
|
|
|
|
+ if (ObjectUtil.isNotEmpty(sigById)){
|
|
|
|
+ li.setProcInsSigId(sigById.getProcInsId());
|
|
|
|
+ li.setSigReason(sigById.getReason());
|
|
|
|
+ li.setTaskSigId(sigById.getTaskId());
|
|
|
|
+ }*/
|
|
|
|
+ for (CwSignatureAnnotator annotator : finalSigByIdList) {
|
|
|
|
+ if(li.getId().equals(annotator.getReportId())){
|
|
|
|
+ li.setProcInsSigId(annotator.getProcInsId());
|
|
|
|
+ li.setSigReason(annotator.getReason());
|
|
|
|
+ li.setTaskSigId(annotator.getTaskId());
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //如果质控审核已经完成且审核通过时间存在,则判断审核时间是否已经超过一天,若不超过,则可以重复发起质控审核
|
|
|
|
+ if (null != li.getAuditTime() && "5".equals(li.getReviewStatus())){
|
|
|
|
+ li.setRepetitionReviewFlag(getRepetitionReviewFlag(li.getAuditTime()));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ });
|
|
|
|
+ return list;
|
|
|
|
+
|
|
|
|
+ }
|
|
}
|
|
}
|