Explorar el Código

统计分析六个指标

buzhanyi hace 1 año
padre
commit
79b512593c

+ 2 - 0
purchase-system/src/main/java/com/ozs/plan/mapper/ProvisionalPlanMapper.java

@@ -21,6 +21,8 @@ public interface ProvisionalPlanMapper extends BaseMapper<ProvisionalPlan> {
 
     ProvisionalPlan seletById(@Param("planPracticalId") Long planPracticalId);
 
+    ProvisionalPlan seletByPlanid(@Param("planPracticalId") Long planPracticalId);
+
     List<ProvisionalPlan> selectProvisionalPlan(ProvisionalPlanVo provisionalPlanVo);
 
     List<ProvisionalPlan> selectProvisionalPlanAudit(ProvisionalPlanVo provisionalPlanVo);

+ 8 - 9
purchase-system/src/main/java/com/ozs/plan/service/impl/ProvisionalPlanServiceImpl.java

@@ -760,26 +760,25 @@ public class ProvisionalPlanServiceImpl extends ServiceImpl<ProvisionalPlanMappe
             String organDivision = provisionalPlan.getOrganDivision();
             if (!ObjectUtils.isEmpty(organDivision)) {
                 int length = organDivision.split(",").length;
-                SysDept sysDept = new SysDept();
+                SysDeptOrgan deptOrgan = new SysDeptOrgan();
                 if (length > 1) {
                     StringBuilder builder = new StringBuilder();
                     String[] split = organDivision.split(",");
                     for (String s : split) {
-
-                        sysDept = deptService.selectById(Long.valueOf(s));
-                        if (!ObjectUtils.isEmpty(sysDept)) {
+                        deptOrgan = sysDeptOrganMapper.selectById(Long.valueOf(s));
+                        if (!ObjectUtils.isEmpty(deptOrgan)) {
                             if (!organDivision.endsWith(s)) {
-                                builder.append(sysDept.getDeptName() + ",");
+                                builder.append(deptOrgan.getOrganName() + ",");
                             } else {
-                                builder.append(sysDept.getDeptName());
+                                builder.append(deptOrgan.getOrganName());
                             }
                         }
                     }
                     provisionalPlan.setOrganDivisionStr(builder.toString());
                 } else if (length == 1) {
-                    sysDept = deptService.selectById(Long.valueOf(organDivision));
-                    if (!ObjectUtils.isEmpty(sysDept)) {
-                        provisionalPlan.setOrganDivisionStr(sysDept.getDeptName());
+                    deptOrgan = sysDeptOrganMapper.selectById(Long.valueOf(organDivision));
+                    if (!ObjectUtils.isEmpty(deptOrgan)) {
+                        provisionalPlan.setOrganDivisionStr(deptOrgan.getOrganName());
                     }
                 }
             }

+ 45 - 2
purchase-system/src/main/java/com/ozs/pm/service/impl/PmDemandServiceImpl.java

@@ -106,11 +106,13 @@ import com.ozs.pm.service.PmExpertFeedbackService;
 import com.ozs.pm.service.PmProcurementDocumentsReviewService;
 import com.ozs.pm.service.PmProjectConstructionService;
 import com.ozs.pm.service.PmReleaseAnnouncementService;
+import com.ozs.system.domain.SysDeptOrgan;
 import com.ozs.system.domain.SysFileInfo;
 import com.ozs.system.domain.SysFileRef;
 import com.ozs.system.domain.vo.SysRegionVO;
 import com.ozs.system.domain.vo.responseVo.SysDeptResponseVo;
 import com.ozs.system.mapper.SysDeptMapper;
+import com.ozs.system.mapper.SysDeptOrganMapper;
 import com.ozs.system.mapper.SysFileRefMapper;
 import com.ozs.system.mapper.SysRoleMapper;
 import com.ozs.system.service.ISysDeptService;
@@ -229,6 +231,8 @@ public class PmDemandServiceImpl extends ServiceImpl<PmDemandMapper, PmDemand> i
     @Autowired
     private ProvisionalPlanMapper provisionalPlanMapper;
     @Autowired
+    private SysDeptOrganMapper sysDeptOrganMapper;
+    @Autowired
     private PmExpertFeedbackService pmExpertFeedbackService;
     @Autowired
     private PmProcurementDocumentsReviewService pmProcurementDocumentsReviewService;
@@ -244,18 +248,56 @@ public class PmDemandServiceImpl extends ServiceImpl<PmDemandMapper, PmDemand> i
      */
     @Override
     public PmDemandResVo selectPmDemandByDemandId(Long demandId, String detailType) {
+        //获取字典数据
+        HashMap<String, HashMap<String, String>> planEnums = dictTypeService.getAboutEnums();
+        HashMap<String, String> budgetAccountMap = planEnums.get("budgetAccount");
+
         PmDemand pmDemand = this.getById(demandId);
         if (pmDemand != null) {
             PmDemandResVo vo = new PmDemandResVo();
             vo.setProjectName(pmDemand.getProjectName());
             vo.setDemandId(demandId);
             BeanUtils.copyProperties(pmDemand, vo);
-            if ("1".equals(detailType)) { //项目计划
+            //项目计划
+            if ("1".equals(detailType)) {
                 //project_type,evaluation 从原来计划里取
-                ProvisionalPlan provisionalPlan = provisionalPlanMapper.seletById(pmDemand.getPlanId());
+                ProvisionalPlan provisionalPlan = provisionalPlanMapper.seletByPlanid(pmDemand.getPlanId());
                 if (provisionalPlan != null) {
                     vo.setProjectType(provisionalPlan.getProjectType());
                     vo.setEvaluation(provisionalPlan.getEvaluation().doubleValue());
+                    //机关业务指导处(科)为id拼接
+                    String organDivision = provisionalPlan.getOrganDivision();
+                    if (!ObjectUtils.isEmpty(organDivision)) {
+                        int length = organDivision.split(",").length;
+                        SysDeptOrgan deptOrgan = new SysDeptOrgan();
+                        if (length > 1) {
+                            StringBuilder builder = new StringBuilder();
+                            String[] split = organDivision.split(",");
+                            for (String s : split) {
+                                deptOrgan = sysDeptOrganMapper.selectById(Long.valueOf(s));
+                                if (!ObjectUtils.isEmpty(deptOrgan)) {
+                                    if (!organDivision.endsWith(s)) {
+                                        builder.append(deptOrgan.getOrganName() + ",");
+                                    } else {
+                                        builder.append(deptOrgan.getOrganName());
+                                    }
+                                }
+                            }
+                            vo.setOrganDivisionStr(builder.toString());
+                        } else if (length == 1) {
+                            deptOrgan = sysDeptOrganMapper.selectById(Long.valueOf(organDivision));
+                            if (!ObjectUtils.isEmpty(deptOrgan)) {
+                                vo.setOrganDivisionStr(deptOrgan.getOrganName());
+                            }
+                        }
+                    }
+                    //预算科目
+                    for (Map.Entry<String, String> entry : budgetAccountMap.entrySet()) {
+                        if (!ObjectUtils.isEmpty(provisionalPlan.getBudgetAccount()) && provisionalPlan.getBudgetAccount().equals(entry.getValue())) {
+                            vo.setBudgetAccountStr(entry.getKey());
+                            break;
+                        }
+                    }
                 }
 
                 SysDeptResponseVo sysDeptResponseVo = (SysDeptResponseVo) deptService.selectDeptById(vo.getPurchaseDeptId()).get("sysDept");
@@ -383,6 +425,7 @@ public class PmDemandServiceImpl extends ServiceImpl<PmDemandMapper, PmDemand> i
                     break;
                 }
             }
+
             return vo;
         } else {
             return null;

+ 6 - 0
purchase-system/src/main/resources/mapper/plan/ProvisionalPlanMapper.xml

@@ -132,6 +132,12 @@
           and plan_practical_id = #{planPracticalId}
     </select>
 
+    <select id="seletByPlanid" resultType="com.ozs.plan.doman.ProvisionalPlan" parameterType="java.lang.Long">
+        select *
+        from plan_practical
+        where plan_practical_id = #{planPracticalId}
+    </select>
+
     <select id="selectProvisionalPlan" resultType="com.ozs.plan.doman.ProvisionalPlan"
             parameterType="com.ozs.plan.doman.vo.requestVo.ProvisionalPlanVo">
         select * from plan_practical