|
@@ -763,6 +763,181 @@ public class CwProjectReportService extends ServiceImpl<CwProjectReportMapper, C
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
|
|
+ * 查询报告列表信息(发票选择)
|
|
|
|
+ * @param page
|
|
|
|
+ * @param projectReportData
|
|
|
|
+ * @return
|
|
|
|
+ * @throws Exception
|
|
|
|
+ */
|
|
|
|
+ public IPage<CwProjectReportData> findList2(Page<CwProjectReportData> page, CwProjectReportData projectReportData) throws Exception{
|
|
|
|
+ QueryWrapper<CwProjectReportData> queryWrapper = QueryWrapperGenerator.buildQueryCondition (projectReportData,CwProjectReportData.class);
|
|
|
|
+ queryWrapper.eq("a.del_flag","0");
|
|
|
|
+ queryWrapper.isNull("a.invoice_number");
|
|
|
|
+// 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.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.getReviewStatus())) {
|
|
|
|
+ queryWrapper.eq("cw_rev.review_status", projectReportData.getReviewStatus());
|
|
|
|
+ }
|
|
|
|
+ //报告号签章状态
|
|
|
|
+ if (StringUtils.isNotEmpty(projectReportData.getApplyStatus())) {
|
|
|
|
+ if("0".equals(projectReportData.getApplyStatus())){
|
|
|
|
+ queryWrapper.isNull("cw_na.review_status");
|
|
|
|
+ if(StringUtils.isBlank(projectReportData.getReviewStatus())){
|
|
|
|
+ queryWrapper.eq("cw_rev.review_status","0");
|
|
|
|
+ }
|
|
|
|
+ }else{
|
|
|
|
+ queryWrapper.eq("cw_na.review_status", projectReportData.getApplyStatus());
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ 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]);
|
|
|
|
+ }
|
|
|
|
+ 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.findList2(page,isBmzr, officeIds.toString(), queryWrapper);
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if(null == list){
|
|
|
|
+ list = reportMapper.findList(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.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());
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //如果质控审核已经完成且审核通过时间存在,则判断审核时间是否已经超过一天,若不超过,则可以重复发起质控审核
|
|
|
|
+ if (null != li.getAuditTime() && "5".equals(li.getReviewStatus())){
|
|
|
|
+ li.setRepetitionReviewFlag(getRepetitionReviewFlag(li.getAuditTime()));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ });
|
|
|
|
+ return list;
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ /**
|
|
* 差选项目列表信息(移动端)
|
|
* 差选项目列表信息(移动端)
|
|
* @param page
|
|
* @param page
|
|
* @param projectReportData
|
|
* @param projectReportData
|