Переглянути джерело

Merge branch 'master' of http://47.110.251.215:3000/java_org/bladex

huangtf 2 роки тому
батько
коміт
66c0af4d27

+ 11 - 1
blade-service/blade-control/src/main/java/org/springblade/control/controller/AnnualBudgetController.java

@@ -119,11 +119,21 @@ public class AnnualBudgetController {
      */
     @GetMapping("/getSecondSubject")
     @ApiOperationSupport(order = 8)
-    @ApiOperation(value = "获取二级科目")
+    @ApiOperation(value = "获取财务费用二级科目")
     public R<List<DictInfoVO>> getSecondSubject() {
         return R.data(budgetService.getSecondSubject());
     }
 
+    /**
+     * 获取二级科目
+     */
+    @GetMapping("/getSecondSubject2")
+    @ApiOperationSupport(order = 8)
+    @ApiOperation(value = "获取成本测算二级科目")
+    public R<List<DictInfoVO>> getSecondSubject2() {
+        return R.data(budgetService.getSecondSubject2());
+    }
+
     /**
      * 门户-年度指标统计
      */

+ 2 - 0
blade-service/blade-control/src/main/java/org/springblade/control/mapper/AnnualBudgetMapper.java

@@ -31,8 +31,10 @@ public interface AnnualBudgetMapper extends BaseMapper<AnnualBudget> {
 
 
     List<DictInfoVO> getAllBudgetSubject();
+    List<DictInfoVO> getAllBudgetSubject2();
 
     List<DictInfoVO> getAllSecondSubject();
+    List<DictInfoVO> getAllSecondSubject2();
 
     AnnualBudget getThisYearBudget(@Param("year") int year);
 

+ 9 - 0
blade-service/blade-control/src/main/java/org/springblade/control/mapper/AnnualBudgetMapper.xml

@@ -62,6 +62,15 @@
         select *
         from c_dict_info di WHERE di.`type` = 1 AND di.is_deleted = 0 and di.parent_id > 0
     </select>
+
+    <select id="getAllBudgetSubject2" resultType="org.springblade.control.vo.DictInfoVO">
+        select *
+        from c_dict_info di WHERE di.`type` = 5 AND di.parent_id = 0 and di.is_deleted = 0 ORDER BY sort
+    </select>
+    <select id="getAllSecondSubject2" resultType="org.springblade.control.vo.DictInfoVO">
+        select *
+        from c_dict_info di WHERE di.`type` = 5 AND di.is_deleted = 0 and di.parent_id > 0
+    </select>
     <select id="getThisYearBudget" resultType="org.springblade.control.entity.AnnualBudget">
         select   <include refid="budget_column" />
         from c_annual_budget where is_deleted = 0

+ 20 - 20
blade-service/blade-control/src/main/java/org/springblade/control/mapper/ProjectCostBudgetMapper.xml

@@ -34,9 +34,9 @@
             pcb.*,
             (select di.dict_name from c_dict_info di where di.code = 'cost_type' and di.dict_value = pcb.cost_type) as costTypeValue,
             (select cpp.name from c_project_process cpp where cpp.id = pcb.project_process) as projectProcessValue,
-            (select di.dict_name from c_dict_info di where di.type = 1 and di.dict_value = pcb.budget_type and di.parent_id = 0) as budgetTypeValue,
-            (select di.dict_name from c_dict_info di where di.type = 1 and di.dict_value = pcb.task_detail and di.parent_id =
-                (select di.id from c_dict_info di where di.type = 1 and di.dict_value = pcb.budget_type and di.parent_id = 0)) as taskDetailValue,
+            (select di.dict_name from c_dict_info di where di.type = 5 and di.dict_value = pcb.budget_type and di.parent_id = 0 and di.is_deleted = 0) as budgetTypeValue,
+            (select di.dict_name from c_dict_info di where di.type = 5 and and di.is_deleted = 0 di.dict_value = pcb.task_detail and di.parent_id =
+                (select di.id from c_dict_info di where di.type = 5 and di.dict_value = pcb.budget_type and di.parent_id = 0 and di.is_deleted = 0)) as taskDetailValue,
             (select di.dict_name from c_dict_info di where di.type = 3 and di.id = pcb.post_type) as postTypeValue
         from c_project_cost_budget pcb
         where pcb.project_id = #{budget.projectId} and pcb.parent_id = 0
@@ -83,12 +83,12 @@
         SELECT
             pcb.*,
             (select cpp.name from c_project_process cpp where cpp.id = pcb.project_process) as projectProcessValue,
-            (select di.dict_name from c_dict_info di where di.type = 1 and di.dict_value = pcb.budget_type and di.parent_id = 0) as budgetTypeValue,
-            (select di.dict_name from c_dict_info di where di.type = 1 and di.dict_value = pcb.task_detail and di.parent_id =
-            (select di.id from c_dict_info di where di.type = 1 and di.dict_value = pcb.budget_type and di.parent_id = 0)) as taskDetailValue,
+            (select di.dict_name from c_dict_info di where di.type = 5 and di.dict_value = pcb.budget_type and di.parent_id = 0 and di.is_deleted = 0) as budgetTypeValue,
+            (select di.dict_name from c_dict_info di where di.type = 5 and di.dict_value = pcb.task_detail and di.is_deleted = 0 and di.parent_id =
+            (select di.id from c_dict_info di where di.type = 5 and di.dict_value = pcb.budget_type and di.parent_id = 0 and di.is_deleted = 0)) as taskDetailValue,
             (select cri.returned_condition from c_contract_returned_info cri where cri.id = pcb.contract_returned_id) as returnedValue,
-            (select di.dict_name from c_dict_info di where di.type = 3 and di.id = pcb.post_type) as postTypeValue,
-            (select di.dict_name from c_dict_info di where di.type = 2 and di.id = pcb.plan_task_type) as planTaskTypeValue
+            (select di.dict_name from c_dict_info di where di.type = 3 and di.id = pcb.post_type and di.is_deleted = 0) as postTypeValue,
+            (select di.dict_name from c_dict_info di where di.type = 2 and di.id = pcb.plan_task_type and di.is_deleted = 0) as planTaskTypeValue
         FROM c_project_cost_budget pcb WHERE pcb.project_id = #{id} AND pcb.approve = 1
     </select>
 
@@ -101,9 +101,9 @@
                    when 4 then '已完成'
                    end  as statusValue,
                (select cpi.name from c_control_project_info cpi WHERE cpi.id = pcb.project_id) as projectName,
-               (select di.dict_name from c_dict_info di where di.type = 1 and di.dict_value = pcb.budget_type and di.parent_id = 0) as budgetTypeValue,
-               (select di.dict_name from c_dict_info di where di.type = 1 and di.dict_value = pcb.task_detail and di.parent_id =
-                   (select di.id from c_dict_info di where di.type = 1 and di.dict_value = pcb.budget_type and di.parent_id = 0)) as taskDetailValue,
+               (select di.dict_name from c_dict_info di where di.type = 5 and di.dict_value = pcb.budget_type and di.parent_id = 0 and di.is_deleted = 0) as budgetTypeValue,
+               (select di.dict_name from c_dict_info di where di.type = 5 and di.dict_value = pcb.task_detail and di.is_deleted = 0 and di.parent_id =
+                   (select di.id from c_dict_info di where di.type = 5 and di.dict_value = pcb.budget_type and di.parent_id = 0 and di.is_deleted = 0)) as taskDetailValue,
                (select cpp.name from c_project_process cpp WHERE cpp.id = pcb.project_process) as projectProcessValue,
                (select di.dict_name from c_dict_info di where di.type = 2 and di.id = pcb.plan_task_type) as planTaskTypeValue
         from c_project_cost_budget pcb
@@ -183,9 +183,9 @@
     <select id="getAllChildrenPlan" resultType="org.springblade.control.vo.ProjectCostBudgetVO2">
         SELECT pcb.*,
                (select cpp.name from c_project_process cpp where cpp.id = pcb.project_process) as projectProcessValue,
-               (select di.dict_name from c_dict_info di where di.type = 1 and di.dict_value = pcb.budget_type and di.parent_id = 0) as budgetTypeValue,
-               (select di.dict_name from c_dict_info di where di.type = 1 and di.dict_value = pcb.task_detail and di.parent_id =
-                       (select di.id from c_dict_info di where di.type = 1 and di.dict_value = pcb.budget_type and di.parent_id = 0)) as taskDetailValue,
+               (select di.dict_name from c_dict_info di where di.type = 5 and di.dict_value = pcb.budget_type and di.parent_id = 0 and di.is_deleted = 0) as budgetTypeValue,
+               (select di.dict_name from c_dict_info di where di.type = 5 and di.dict_value = pcb.task_detail and di.is_deleted = 0 and di.parent_id =
+                       (select di.id from c_dict_info di where di.type = 5 and di.dict_value = pcb.budget_type and di.parent_id = 0 and di.is_deleted = 0)) as taskDetailValue,
                (select di.dict_name from c_dict_info di where di.type = 2 and di.id = pcb.plan_task_type) as planTaskTypeValue
         FROM c_project_cost_budget pcb WHERE pcb.project_id = #{id} AND pcb.parent_id > 0
     </select>
@@ -324,9 +324,9 @@
                    when 4 then '已完成'
                    end  as statusValue,
                (select cpi.name from c_control_project_info cpi WHERE cpi.id = pcb.project_id) as projectName,
-               (select di.dict_name from c_dict_info di where di.type = 1 and di.dict_value = pcb.budget_type and di.parent_id = 0) as budgetTypeValue,
-               (select di.dict_name from c_dict_info di where di.type = 1 and di.dict_value = pcb.task_detail and di.parent_id =
-                                                                                                                  (select di.id from c_dict_info di where di.type = 1 and di.dict_value = pcb.budget_type and di.parent_id = 0)) as taskDetailValue,
+               (select di.dict_name from c_dict_info di where di.type = 5 and di.dict_value = pcb.budget_type and di.parent_id = 0 and di.is_deleted = 0) as budgetTypeValue,
+               (select di.dict_name from c_dict_info di where di.type = 5 and di.dict_value = pcb.task_detail and di.is_deleted = 0 and di.parent_id =
+                              (select di.id from c_dict_info di where di.type = 5 and di.dict_value = pcb.budget_type and di.parent_id = 0 and di.is_deleted = 0)) as taskDetailValue,
                (select cpp.name from c_project_process cpp WHERE cpp.id = pcb.project_process) as projectProcessValue,
                (select di.dict_name from c_dict_info di where di.type = 2 and di.id = pcb.plan_task_type) as planTaskTypeValue
         from c_project_cost_budget pcb
@@ -340,9 +340,9 @@
                    when 4 then '已完成'
                    end  as statusValue,
                (select cpi.name from c_control_project_info cpi WHERE cpi.id = pcb.project_id) as projectName,
-               (select di.dict_name from c_dict_info di where di.type = 1 and di.dict_value = pcb.budget_type and di.parent_id = 0) as budgetTypeValue,
-               (select di.dict_name from c_dict_info di where di.type = 1 and di.dict_value = pcb.task_detail and di.parent_id =
-                                                                                                                  (select di.id from c_dict_info di where di.type = 1 and di.dict_value = pcb.budget_type and di.parent_id = 0)) as taskDetailValue,
+               (select di.dict_name from c_dict_info di where di.type = 5 and di.dict_value = pcb.budget_type and di.parent_id = 0 and di.is_deleted = 0) as budgetTypeValue,
+               (select di.dict_name from c_dict_info di where di.type = 5 and di.dict_value = pcb.task_detail and di.is_deleted = 0 and di.parent_id =
+                         (select di.id from c_dict_info di where di.type = 5 and di.dict_value = pcb.budget_type and di.parent_id = 0 and di.is_deleted = 0)) as taskDetailValue,
                (select cpp.name from c_project_process cpp WHERE cpp.id = pcb.project_process) as projectProcessValue,
                (select di.dict_name from c_dict_info di where di.type = 2 and di.id = pcb.plan_task_type) as planTaskTypeValue
         from c_project_cost_budget pcb

+ 2 - 0
blade-service/blade-control/src/main/java/org/springblade/control/service/IAnnualBudgetService.java

@@ -33,6 +33,8 @@ public interface IAnnualBudgetService extends BaseService<AnnualBudget> {
 
     List<DictInfoVO> getSecondSubject();
 
+    List<DictInfoVO> getSecondSubject2();
+
     AnnualBudgetVO3 portalAnnualTarget();
 
     Map<String, BigDecimal> portalAnnualCost(String year);

+ 29 - 2
blade-service/blade-control/src/main/java/org/springblade/control/service/impl/AnnualBudgetServiceImpl.java

@@ -348,6 +348,33 @@ public class AnnualBudgetServiceImpl extends BaseServiceImpl<AnnualBudgetMapper,
         return allBudgetSubject;
     }
 
+    /**
+     * 获取二级科目
+     */
+    @Override
+    public List<DictInfoVO> getSecondSubject2() {
+        List<DictInfoVO> allBudgetSubject = baseMapper.getAllBudgetSubject2();
+        List<DictInfoVO> allSecondSubject =baseMapper.getAllSecondSubject2();
+        for (DictInfoVO vo : allBudgetSubject) {
+            List<DictInfoVO> list = new ArrayList<>();
+            for (DictInfoVO v02 : allSecondSubject) {
+                if (vo.getId().equals(v02.getParentId())){
+                    list.add(v02);
+                }
+            }
+            if (list != null && list.size() > 0) {
+                for (DictInfoVO infoVO : list) {
+                    if (infoVO.getSort() == null){
+                        infoVO.setSort(1);
+                    }
+                }
+                list = list.stream().sorted(Comparator.comparing(DictInfo::getSort)).collect(Collectors.toList());
+            }
+            vo.setChildren(list);
+        }
+        return allBudgetSubject;
+    }
+
     /**
      * 门户-年度指标统计 ,统计今年的
      */
@@ -1091,8 +1118,8 @@ public class AnnualBudgetServiceImpl extends BaseServiceImpl<AnnualBudgetMapper,
             }else {
                 isFinished = false;
             }
-            //维护支出
-
+            //维护支出,返回null证明没有
+            budgetService.getAllMaintainCost9(y);
             //报销支出
 
             BigDecimal c1 = new BigDecimal(0);

+ 15 - 13
blade-service/blade-control/src/main/java/org/springblade/control/service/impl/TaskProcessServiceImpl.java

@@ -219,7 +219,20 @@ public class TaskProcessServiceImpl extends BaseServiceImpl<TaskProcessMapper, T
                                 data = jdbcTemplate.query("select * from c_expense_financial_reimbursement_info where id = " + record.getExpenseInfoId(), new BeanPropertyRowMapper<>(EMFinancialReimbursementInfo.class)).stream().findAny().orElse(null);
                                 EMFinancialReimbursementInfoVO voCW = BeanUtil.copyProperties(data, EMFinancialReimbursementInfoVO.class);
                                 if (voCW != null) {
-                                    //pdf转jpg
+                                    //获取当前用户是否为财务人员,财务人员修改是否支付状态
+                                    if (ObjectUtil.isEmpty(SecureUtil.getUser())) {
+                                        throw new ServiceException("获取当前用户信息失败,请联系管理员");
+                                    }
+                                    voCW.setUserNameVesting(userMap.get(voCW.getCreateUser()));
+                                    R<Dept> dept = iSysClient.getDept(Long.parseLong(SecureUtil.getDeptId()));
+                                    if (dept != null && dept.getData() != null) {
+                                        Dept deptObj = dept.getData();
+                                        if (deptObj != null && (deptObj.getDeptName().contains("财务") || deptObj.getDeptName().contains("人事"))) {
+                                            voCW.setIsFinancialPersonnel(1); //财务人员
+                                        }
+                                    }
+
+                                    //预览发票、附件,把PDF转为JPG格式
                                     if (ObjectUtil.isNotEmpty(voCW.getFrAttachmentUrl()) && ObjectUtil.isEmpty(voCW.getFrAttachmentUrlJpg())) {
                                         InputStream ossInputStream = CommonUtil.getOSSInputStream(voCW.getFrAttachmentUrl());
                                         byte[] bytes = PDFConverter.convertToJPG(ossInputStream);
@@ -264,18 +277,7 @@ public class TaskProcessServiceImpl extends BaseServiceImpl<TaskProcessMapper, T
                                             break;
                                         }
                                     }
-                                    voCW.setUserNameVesting(userMap.get(voCW.getCreateUser()));
-                                    //获取当前用户是否为财务人员,财务人员修改是否支付状态
-                                    if (ObjectUtil.isEmpty(SecureUtil.getUser())) {
-                                        throw new ServiceException("获取当前用户信息失败,请联系管理员");
-                                    }
-                                    R<Dept> dept = iSysClient.getDept(Long.parseLong(SecureUtil.getDeptId()));
-                                    if (dept != null && dept.getData() != null) {
-                                        Dept deptObj = dept.getData();
-                                        if (deptObj != null && (deptObj.getDeptName().contains("财务") || deptObj.getDeptName().contains("人事"))) {
-                                            voCW.setIsFinancialPersonnel(1); //财务人员
-                                        }
-                                    }
+
                                     data = voCW;
                                 }
                                 break;