Browse Source

项目经理查询不显示调整

wangqiang 1 year ago
parent
commit
514bee70d0

+ 2 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/invoice/controller/CwFinanceInvoiceController.java

@@ -70,6 +70,7 @@ public class CwFinanceInvoiceController {
     public ResponseEntity<IPage<CwFinanceInvoiceDTO>> data(CwFinanceInvoiceDTO cwFinanceInvoiceDTO, Page<CwFinanceInvoiceDTO> page) throws Exception {
         IPage<CwFinanceInvoiceDTO> result = new Page<CwFinanceInvoiceDTO>();
         result = cwFinanceInvoiceService.findList (page, cwFinanceInvoiceDTO);
+        System.out.println("当前时间1:"+System.currentTimeMillis());
         result.getRecords().stream().forEach(i -> {
             // 发票申请
             if (StringUtils.isNotBlank(i.getTaskId()) && StringUtils.isNotBlank(i.getStatus())) {
@@ -84,6 +85,7 @@ public class CwFinanceInvoiceController {
                 }
             }
         });
+        System.out.println("当前时间2:"+System.currentTimeMillis());
         return ResponseEntity.ok (result);
     }
 

+ 15 - 21
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/projectRecords/service/CwProjectRecordsService.java

@@ -89,30 +89,16 @@ public class CwProjectRecordsService extends ServiceImpl<CwProjectRecordsMapper,
     public IPage<CwProjectRecordsDTO> findList(Page<CwProjectRecordsDTO> page, CwProjectRecordsDTO cwProjectRecordsDTO) throws Exception{
         QueryWrapper<CwProjectRecords> queryWrapper = QueryWrapperGenerator.buildQueryCondition ( CwProjectRecordsWrapper.INSTANCE.toEntity(cwProjectRecordsDTO), CwProjectRecords.class );
         queryWrapper.eq("a.del_flag","0");
-//        queryWrapper.orderByDesc("a.create_date");
         if (ObjectUtil.isNotEmpty(cwProjectRecordsDTO)) {
             if (ArrayUtil.isNotEmpty(cwProjectRecordsDTO.getCreateDates())) {
                 queryWrapper.between("a.create_time", cwProjectRecordsDTO.getCreateDates()[0], cwProjectRecordsDTO.getCreateDates()[1]);
             }
             if (StringUtils.isNotBlank(cwProjectRecordsDTO.getProjectMasterName())) {
                 queryWrapper.in("a.project_master_id", cwProjectRecordsDTO.getProjectMasterName());
-//                UserDTO user = SpringUtil.getBean ( IUserApi.class ).getById(cwProjectRecordsDTO.getProjectMasterName());
-//                List<User> userList = userMapper.selectList(new QueryWrapper<User>().lambda().like(User::getName, cwProjectRecordsDTO.getProjectMasterName()));
-//                if (CollectionUtils.isNotEmpty(userList)){
-//                    List<String> ids = userList.stream().distinct().map(User::getId).collect(Collectors.toList());
-//                    if (CollectionUtil.isNotEmpty(ids)) {
-//                        queryWrapper.in("a.project_master_id", ids);
-//                    } else {
-//                        return new Page<>();
-//                    }
-//                } else {
-//                    queryWrapper.in("a.project_master_id", cwProjectRecordsDTO.getProjectMasterName());
-//                }
 
             }
             if (StringUtils.isNotBlank(cwProjectRecordsDTO.getProjectMasterName2())) {
                 List<User> userList = SpringUtil.getBean ( IUserApi.class ).selectListByName(cwProjectRecordsDTO.getProjectMasterName2());
-//                List<User> userList = userMapper.selectList(new QueryWrapper<User>().lambda().like(User::getName, cwProjectRecordsDTO.getProjectMasterName()));
                 if (CollectionUtils.isNotEmpty(userList)){
                     List<String> ids = userList.stream().distinct().map(User::getId).collect(Collectors.toList());
                     if (CollectionUtil.isNotEmpty(ids)) {
@@ -126,13 +112,6 @@ public class CwProjectRecordsService extends ServiceImpl<CwProjectRecordsMapper,
             }
             if (StringUtils.isNotBlank(cwProjectRecordsDTO.getRealHeaderName())) {
                 queryWrapper.in("a.real_header", cwProjectRecordsDTO.getRealHeaderName());
-//                List<User> userList = SpringUtil.getBean ( IUserApi.class ).selectListByName(cwProjectRecordsDTO.getRealHeaderName());
-//                List<String> ids = userList.stream().distinct().map(User::getId).collect(Collectors.toList());
-//                if (CollectionUtil.isNotEmpty(ids)) {
-//                    queryWrapper.in("a.real_header", ids);
-//                } else {
-//                    return new Page<>();
-//                }
             }
             if (StringUtils.isNotBlank(cwProjectRecordsDTO.getCreateId())){
                 queryWrapper.eq("a.create_by_id", cwProjectRecordsDTO.getCreateId());
@@ -140,6 +119,21 @@ public class CwProjectRecordsService extends ServiceImpl<CwProjectRecordsMapper,
         }
 
         IPage<CwProjectRecordsDTO> list = cwProjectRecordsMapper.findList(page, queryWrapper);
+        list.getRecords().forEach(li->{
+            if (StringUtils.isBlank(li.getProjectMasterName())){
+                //根据项目经理1的id去查项目经理去名称
+                if (StringUtils.isNotBlank(li.getProjectMasterId())){
+                    UserDTO byId = SpringUtil.getBean(IUserApi.class).getById(li.getProjectMasterId());
+                    li.setProjectMasterName(byId.getName());
+                }
+            } else if (StringUtils.isBlank(li.getRealHeaderName())){
+                //根据项目经理1的id去查项目经理去名称
+                if (StringUtils.isNotBlank(li.getRealHeader())){
+                    UserDTO byId = SpringUtil.getBean(IUserApi.class).getById(li.getRealHeader());
+                    li.setRealHeaderName(byId.getName());
+                }
+            }
+        });
         return list;
     }
     /**

+ 1 - 1
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/projectReport/mapper/xml/CwProofreadDetailMapper.xml

@@ -45,7 +45,7 @@
 		select a.*,b.`name` AS type_name,b.sort from cw_proofread_detail a
 		left join cw_proofread_type b on a.type_id = b.id
 		where info_id = #{id}
-		ORDER BY a.create_time DESC
+		ORDER BY b.sort asc
 	</select>
 	<select id="getByTypeIdAndInfoId" resultType="com.jeeplus.finance.projectReport.domain.CwProofreadDetail">
 		select * from cw_proofread_detail where type_id = #{typeId} and info_id = #{infoId}

+ 15 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/projectReport/service/CwProjectReportService.java

@@ -521,6 +521,21 @@ public class CwProjectReportService extends ServiceImpl<CwProjectReportMapper, C
 
 
         IPage<CwProjectReportData> list = reportMapper.findList(page,userDTO,isBmzr, officeIds.toString(), queryWrapper);
+        list.getRecords().forEach(li->{
+            if (StringUtils.isBlank(li.getProjectMasterName())){
+                //根据项目经理1的id去查项目经理去名称
+                if (StringUtils.isNotBlank(li.getProjectMasterId())){
+                    UserDTO byId = SpringUtil.getBean(IUserApi.class).getById(li.getProjectMasterId());
+                    li.setProjectMasterName(byId.getName());
+                }
+            } else if (StringUtils.isBlank(li.getRealHeaderName())){
+                //根据项目经理1的id去查项目经理去名称
+                if (StringUtils.isNotBlank(li.getProjectMaster2Id())){
+                    UserDTO byId = SpringUtil.getBean(IUserApi.class).getById(li.getProjectMaster2Id());
+                    li.setProjectMaster2Name(byId.getName());
+                }
+            }
+        });
         return list;
 
     }

+ 1 - 1
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/projectReportAuditSheet/mapper/CwProofreadTypeMapper.xml

@@ -50,6 +50,6 @@
 		WHERE
 			del_flag = 0
 			AND `type` = #{type}
-		ORDER BY sort
+		ORDER BY sort asc
 	</select>
 </mapper>