Forráskód Böngészése

Merge remote-tracking branch 'origin/master'

lizhenhao 2 éve
szülő
commit
ec14fb7a46

+ 13 - 1
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectReport/domain/CwProjectInfoData.java

@@ -25,9 +25,21 @@ public class CwProjectInfoData extends BaseEntity {
      */
     private String deleteSign;
 
-    //报告文号(字典值)
+    //报告文号(字典值) 基字
     public static final String BIZ_CODE = "23";
 
+    //报告文号(字典值) 咨字
+    public static final String CONSULT_BIZ_CODE = "24";
+
+    //报告文号(字典值) 审字
+    public static final String EXAMINE_BIZ_CODE = "25";
+
+    //报告文号(字典值) 验字
+    public static final String CHECK_BIZ_CODE = "26";
+
+    //报告文号(字典值) 特字
+    public static final String SPECIAL_BIZ_CODE = "27";
+
     /**
      * 被服务单位id
      */

+ 9 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectReport/mapper/CwProjectReportReviewMapper.java

@@ -1,8 +1,10 @@
 package com.jeeplus.test.cw.projectReport.mapper;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.jeeplus.test.cw.projectReport.domain.CwProjectReport;
 import com.jeeplus.test.cw.projectReport.domain.CwProjectReportData;
 import com.jeeplus.test.cw.projectReport.domain.CwProjectReview;
+import com.jeeplus.test.cw.reimbursementApproval.approvalInfo.service.dto.ReportNoDto;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
 
@@ -33,4 +35,11 @@ public interface CwProjectReportReviewMapper extends BaseMapper<CwProjectReview>
      */
     String getProjectIdByReportId(String id);
 
+    /**
+     * 根据报告号查询报告信息
+     * @param number
+     * @return
+     */
+    ReportNoDto getProjectReportByNumber(String number);
+
 }

+ 8 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectReport/mapper/xml/CwProjectReportReviewMapper.xml

@@ -26,4 +26,12 @@
         WHERE cw_p.id = #{id}
     </select>
 
+    <select id="getProjectReportByNumber" resultType="com.jeeplus.test.cw.reimbursementApproval.approvalInfo.service.dto.ReportNoDto">
+        SELECT
+        *
+        FROM cw_project_report_new_line a
+        where a.report_no = #{number}
+        limit 1
+    </select>
+
 </mapper>

+ 43 - 2
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectReport/service/CwProjectReportReviewService.java

@@ -16,6 +16,7 @@ import com.jeeplus.test.cw.projectReport.mapper.CwProofreadDetailMapper;
 import com.jeeplus.flowable.service.FlowTaskService;
 import com.jeeplus.test.cw.projectReportArchive.domain.CwProjectReportArchive;
 import com.jeeplus.test.cw.projectReportArchive.mapper.CwProjectReportArchiveMapper;
+import com.jeeplus.test.cw.reimbursementApproval.approvalInfo.service.dto.ReportNoDto;
 import com.jeeplus.test.mould.service.SerialnumTplService;
 import com.jeeplus.test.cw.projectReportArchive.service.dto.CwProjectReportArchiveDTO;
 import org.flowable.bpmn.model.FlowNode;
@@ -175,7 +176,47 @@ public class CwProjectReportReviewService extends ServiceImpl<CwProjectReportRev
                     if(StringUtils.isNotBlank(reportData.getReportNo())){
                         infoData.setReportNo(reportData.getReportNo());
                     }else{
-                        try {
+                        if(StringUtils.isNotBlank(reportData.getReportType())) {
+                            ReportNoDto projectReportByNumber = new ReportNoDto();
+                            switch (reportData.getReportType()) {
+                                case "1":   //基字
+                                    do{
+                                        documentNo = serialnumTplService.genSerialNumNoSort(userDTO.getCompanyDTO().getId(), CwProjectInfoData.BIZ_CODE);
+                                        //根据报告号查询诗剧苦中是否存在
+                                        projectReportByNumber = mapper.getProjectReportByNumber(documentNo);
+                                    }while (null != projectReportByNumber && StringUtils.isNotBlank(projectReportByNumber.getReportNo()));
+                                    break;
+                                case "2":   //咨字
+                                    do{
+                                        documentNo = serialnumTplService.genSerialNumNoSort(userDTO.getCompanyDTO().getId(), CwProjectInfoData.CONSULT_BIZ_CODE);
+                                        //根据报告号查询诗剧苦中是否存在
+                                        projectReportByNumber = mapper.getProjectReportByNumber(documentNo);
+                                    }while (null != projectReportByNumber && StringUtils.isNotBlank(projectReportByNumber.getReportNo()));
+                                    break;
+                                case "3":   //审字
+                                    do{
+                                        documentNo = serialnumTplService.genSerialNumNoSort(userDTO.getCompanyDTO().getId(), CwProjectInfoData.EXAMINE_BIZ_CODE);
+                                        //根据报告号查询诗剧苦中是否存在
+                                        projectReportByNumber = mapper.getProjectReportByNumber(documentNo);
+                                    }while (null != projectReportByNumber && StringUtils.isNotBlank(projectReportByNumber.getReportNo()));
+                                    break;
+                                case "4":   //验字
+                                    do{
+                                        documentNo = serialnumTplService.genSerialNumNoSort(userDTO.getCompanyDTO().getId(), CwProjectInfoData.CHECK_BIZ_CODE);
+                                        //根据报告号查询诗剧苦中是否存在
+                                        projectReportByNumber = mapper.getProjectReportByNumber(documentNo);
+                                    }while (null != projectReportByNumber && StringUtils.isNotBlank(projectReportByNumber.getReportNo()));
+                                    break;
+                                case "5":   //特字
+                                    do{
+                                        documentNo = serialnumTplService.genSerialNumNoSort(userDTO.getCompanyDTO().getId(), CwProjectInfoData.SPECIAL_BIZ_CODE);
+                                        //根据报告号查询诗剧苦中是否存在
+                                        projectReportByNumber = mapper.getProjectReportByNumber(documentNo);
+                                    }while (null != projectReportByNumber && StringUtils.isNotBlank(projectReportByNumber.getReportNo()));
+                                    break;
+                            }
+                        }
+                        /*try {
                             documentNo = serialnumTplService.genSerialNumNoSort(userDTO.getCompanyDTO().getId(), CwProjectInfoData.BIZ_CODE);
                             if(documentNo.contains("{replacement}")){
                                 if(StringUtils.isNotBlank(reportData.getReportType())){
@@ -200,7 +241,7 @@ public class CwProjectReportReviewService extends ServiceImpl<CwProjectReportRev
                             }
                         } catch (Exception e) {
                             e.printStackTrace();
-                        }
+                        }*/
                         infoData.setReportId(review.getReportId());
                         infoData.setReportNo(documentNo);
                         // 如果数据已经生成报告文号,则不重复生成

+ 2 - 2
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectReport/service/CwProjectReportService.java

@@ -394,7 +394,7 @@ public class CwProjectReportService extends ServiceImpl<CwProjectReportMapper, C
         BeanUtils.copyProperties(reportData, info);
         //报告编号生成
         String documentNo = "";
-        if (info.getReportType().equals("1")){
+        /*if (info.getReportType().equals("1")){
             documentNo = serialnumTplService.genSerialReviewNum(userDTO.getCompanyDTO().getId(), CwProjectReview.BIZ_CODE1);
         } else if (info.getReportType().equals("2")){
             documentNo = serialnumTplService.genSerialReviewNum(userDTO.getCompanyDTO().getId(), CwProjectReview.BIZ_CODE2);
@@ -404,7 +404,7 @@ public class CwProjectReportService extends ServiceImpl<CwProjectReportMapper, C
             documentNo = serialnumTplService.genSerialReviewNum(userDTO.getCompanyDTO().getId(), CwProjectReview.BIZ_CODE4);
         } else if (info.getReportType().equals("5")){
             documentNo = serialnumTplService.genSerialReviewNum(userDTO.getCompanyDTO().getId(), CwProjectReview.BIZ_CODE5);
-        }
+        }*/
         info.setId(id);
         info.setReportReviewNo(documentNo);
         info.setCreateBy(userDTO.getId());

+ 44 - 35
jeeplus-platform/jeeplus-admin/src/main/java/com/jeeplus/sys/controller/UserController.java

@@ -52,6 +52,7 @@ import javax.servlet.http.HttpServletResponse;
 import javax.validation.ConstraintViolationException;
 import javax.validation.Valid;
 import javax.validation.Validator;
+import javax.validation.constraints.NotNull;
 import java.io.File;
 import java.io.IOException;
 import java.util.*;
@@ -167,44 +168,52 @@ public class UserController {
             queryWrapper.isNull("a.is_admin");
             if (ObjectUtil.isNotEmpty(userDTO)){
                 if (ObjectUtil.isNotEmpty(userDTO.getCompanyDTO()) && ObjectUtil.isNotEmpty(userDTO.getOfficeDTO())) {
-                    // 当不是精确的部门查询时,再添加下面的筛选条件
-                    if ((StringUtils.isNotBlank(userDTO.getCompanyDTO().getId()) && StringUtils.isBlank(userDTO.getOfficeDTO().getId()))
-                            || "true".equals(userDTO.getSelectAll())) {
-                        // officeDTO.id是空,companyDTO.id不是空的话,说明前端组件点击的集团来进行查询
-                        // selectAll为‘true’的话,说明前端没有选择集团或者部门查询,这个时候要展示全部人员
-                        // 根据当前用户的部门id找到此部门的ids
-                        String ids = officeService.getById(UserUtils.getCurrentUserDTO().getOfficeDTO().getId()).getParentIds();
-                        // 根据ids分隔后的index[2],找到当前用户的所属公司id
-                        String companyId = null;
-                        String[] split = ids.split(",");
-                        // split.length大于2,说明当前登录人所属部门是普通部门,展示部分人员信息
-                        // 否则,当前登录人所属公共类部门(忘了叫什么类部门了,就是总经办那种部门),展示全部人员信息
-                        if(split.length>2){
-                            companyId = split[2];
-                            // 根据公司id,找到此公司下的所有部门
-                            List<Office> officeList = officeService.list(new QueryWrapper<Office>().lambda().eq(Office::getParentId, companyId));
-                            Set officeIdSet = new HashSet();
-                            for (Office office : officeList) {
-                                if(StringUtils.isNotBlank(office.getId())){
-                                    officeIdSet.add(office.getId());
+                    OfficeDTO officeDTO = UserUtils.getCurrentUserDTO().getOfficeDTO();
+                    if (StringUtils.isNotBlank(userDTO.getCertType())) {
+                        //获取当前登陆人是否事中审公司人员
+                        if(officeDTO.getParentIds().contains("1615171302381182978")){
+
+                        }
+                    }else{
+                        // 当不是精确的部门查询时,再添加下面的筛选条件
+                        if ((StringUtils.isNotBlank(userDTO.getCompanyDTO().getId()) && StringUtils.isBlank(userDTO.getOfficeDTO().getId()))
+                                || "true".equals(userDTO.getSelectAll())) {
+                            // officeDTO.id是空,companyDTO.id不是空的话,说明前端组件点击的集团来进行查询
+                            // selectAll为‘true’的话,说明前端没有选择集团或者部门查询,这个时候要展示全部人员
+                            // 根据当前用户的部门id找到此部门的ids
+                            String ids = officeService.getById(UserUtils.getCurrentUserDTO().getOfficeDTO().getId()).getParentIds();
+                            // 根据ids分隔后的index[2],找到当前用户的所属公司id
+                            String companyId = null;
+                            String[] split = ids.split(",");
+                            // split.length大于2,说明当前登录人所属部门是普通部门,展示部分人员信息
+                            // 否则,当前登录人所属公共类部门(忘了叫什么类部门了,就是总经办那种部门),展示全部人员信息
+                            if(split.length>2){
+                                companyId = split[2];
+                                // 根据公司id,找到此公司下的所有部门
+                                List<Office> officeList = officeService.list(new QueryWrapper<Office>().lambda().eq(Office::getParentId, companyId));
+                                Set officeIdSet = new HashSet();
+                                for (Office office : officeList) {
+                                    if(StringUtils.isNotBlank(office.getId())){
+                                        officeIdSet.add(office.getId());
+                                    }
                                 }
+                                List<String> officeIdList = Lists.newArrayList(officeIdSet);
+                                // 拿到这些部门的id
+                                //List<String> officeIdList = officeList.stream().distinct().map(Office::getId).collect(Collectors.toList());
+                                // 拿到所有公有部门的id
+                                List<String> officePublicIdList = officeService.list(new LambdaQueryWrapper<Office>().eq(Office::getIsPublic,"1")).stream().map(Office::getId).collect(Collectors.toList());
+                                // 拿到直属公司的id
+                                officeIdList.add(companyId);
+                                // 最后得到的所有部门的id
+                                officeIdList.addAll(officePublicIdList);
+                                List<String> lastIds = officeIdList.stream().distinct().collect(Collectors.toList());
+                                // 添加筛选条件为这些部门的id
+                                queryWrapper.in("a.office_id",lastIds);
                             }
-                            List<String> officeIdList = Lists.newArrayList(officeIdSet);
-                            // 拿到这些部门的id
-                            //List<String> officeIdList = officeList.stream().distinct().map(Office::getId).collect(Collectors.toList());
-                            // 拿到所有公有部门的id
-                            List<String> officePublicIdList = officeService.list(new LambdaQueryWrapper<Office>().eq(Office::getIsPublic,"1")).stream().map(Office::getId).collect(Collectors.toList());
-                            // 拿到直属公司的id
-                            officeIdList.add(companyId);
-                            // 最后得到的所有部门的id
-                            officeIdList.addAll(officePublicIdList);
-                            List<String> lastIds = officeIdList.stream().distinct().collect(Collectors.toList());
-                            // 添加筛选条件为这些部门的id
-                            queryWrapper.in("a.office_id",lastIds);
+                        } else if(StringUtils.isBlank(userDTO.getCompanyDTO().getId()) && StringUtils.isNotBlank(userDTO.getOfficeDTO().getId())) {
+                            // officeDTO.id不是空,companyDTO.id是空的话,说明前端组件点击的部门查询
+                            queryWrapper.eq("a.office_id",userDTO.getOfficeDTO().getId());
                         }
-                    } else if(StringUtils.isBlank(userDTO.getCompanyDTO().getId()) && StringUtils.isNotBlank(userDTO.getOfficeDTO().getId())) {
-                        // officeDTO.id不是空,companyDTO.id是空的话,说明前端组件点击的部门查询
-                        queryWrapper.eq("a.office_id",userDTO.getOfficeDTO().getId());
                     }
                 }
             }