Browse Source

用款增加总监和板块领导非自己项目

yewc 1 năm trước cách đây
mục cha
commit
7818c9f34a

+ 1 - 1
zjugis-business/src/main/java/com/zjugis/business/flow/commoncost/service/CommonCostServiceImpl.java

@@ -177,7 +177,7 @@ public class CommonCostServiceImpl implements CommonCostService {
         map.put("z_work_flow", workflowUrl);
         List<AssetProcureDO> lists=assetProcureDao.getAssetByCostId(flowInstanceId);
         List<OutsourcePurchaseDO> lists1=outsourcePurchaseDao.getAssetByCostId(flowInstanceId);
-        map.put("glcg", lists!=null||lists1!=null?1:0);//关联采购
+        map.put("glcg", lists.size()>0||lists1.size()>0?1:0);//关联采购
         if(lists!=null&&lists.size()>0){
             map.put("glcglist", JSON.toJSONString(lists));//关联采购
         }else{

+ 39 - 2
zjugis-business/src/main/java/com/zjugis/business/flow/usemoney/event/UseMoneyEvent.java

@@ -16,6 +16,7 @@ import com.zjugis.business.flow.usemoney.service.UseMoneyDetailService;
 import com.zjugis.business.flow.usemoney.service.UseMoneyService;
 import com.zjugis.business.service.ProjectService;
 import com.zjugis.framework.common.pojo.CommonResult;
+import com.zjugis.framework.common.util.date.LocalDateTimeUtils;
 import com.zjugis.framework.workflow.exception.BusinessException;
 import com.zjugis.framework.workflow.model.BaseController;
 import com.zjugis.framework.workflow.rpc.remote.WorkflowClient;
@@ -102,8 +103,8 @@ public class UseMoneyEvent extends BaseController {
                 if (!Strings.isNullOrEmpty(entity.getUserNickname())) {
                     flowDesc += "/" + entity.getUserNickname();
                 }
-                if (entity.getApplyTime()!=null) {
-                    flowDesc += "/" + entity.getApplyTime();
+                if (entity.getCreateTime()!=null) {
+                    flowDesc += "/" + LocalDateTimeUtils.format(entity.getCreateTime(), null);
                 }
                 if (entity.getTotalAmount()!=null) {
                     flowDesc += "/" + entity.getTotalAmount();
@@ -761,4 +762,40 @@ public class UseMoneyEvent extends BaseController {
             throw new BusinessException("执行事件出错,请联系管理员!");
         }
     }
+    @PostMapping("/toCTO")
+    public String toCTO(@ParamModel Map flowInstance, @ParamModel Map flowDirectionInstance, @ParamModel Map previousActivityInstance, @ParamModel Map previousGatewayInstance, @ParamModel Map nextActivityTemplate, @ParamModel Map nextGatewayInstance) {
+        try {
+            String flowInstanceId = flowInstance.get("id").toString();
+            UseMoneyDO entity = useMoneyService.findByInstanceId(flowInstanceId);
+            List<PostRespDTO> postList = postApi.getPostByUser(entity.getUserId()).getCheckedData();
+            Set<String> postCodes = convertSet(postList, PostRespDTO::getCode);
+            if (entity != null && CollectionUtil.contains(postCodes, "jszj")) {
+                return "true";
+            }
+            return "false";
+        } catch (Exception ex) {
+            return error(ex.getMessage(), ErrorCode.DEFAULT);
+        }
+    }
+    @PostMapping("/toNotLeaderProject")
+    public String toNotLeaderProject(@ParamModel Map flowInstance, @ParamModel Map flowDirectionInstance, @ParamModel Map previousActivityInstance, @ParamModel Map previousGatewayInstance, @ParamModel Map nextActivityTemplate, @ParamModel Map nextGatewayInstance) {
+        try {
+            String flowInstanceId = flowInstance.get("id").toString();
+            UseMoneyDO entity = useMoneyService.findByInstanceId(flowInstanceId);
+            Project project = projectService.selectById(entity.getProjectId());
+            String xmjlId = project.getXmjlId();
+            String userId = entity.getUserId();
+            List<PostRespDTO> postList = postApi.getPostByUser(userId).getCheckedData();
+            Set<String> postCodes = convertSet(postList, PostRespDTO::getCode);
+            List<DeptRespDTO> deptChildList = deptApi.getChildDeptList(entity.getDeptId()).getCheckedData();
+            Set<String> depts = convertSet(deptChildList, DeptRespDTO::getId);
+            depts.add(entity.getDeptId());
+            if (entity != null && CollectionUtil.contains(postCodes, "fgslz") && userId.equals(xmjlId) && !CollectionUtil.contains(depts, project.getZrbmId())) {
+                return "true";
+            }
+            return "false";
+        } catch (Exception ex) {
+            return error(ex.getMessage(), ErrorCode.DEFAULT);
+        }
+    }
 }

+ 1 - 1
zjugis-business/src/main/java/com/zjugis/business/flow/usemoney/service/UseMoneyServiceImpl.java

@@ -307,7 +307,7 @@ public class UseMoneyServiceImpl implements UseMoneyService {
         map.put("z_work_flow", workflowUrl);
         List<AssetProcureDO> lists=assetProcureDao.getAssetByCostId(flowInstanceId);
         List<OutsourcePurchaseDO> lists1=outsourcePurchaseDao.getAssetByCostId(flowInstanceId);
-        map.put("glcg", lists!=null||lists1!=null?1:0);//关联采购
+        map.put("glcg", lists.size()>0||lists1.size()>0?1:0);//关联采购
         if(lists!=null&&lists.size()>0){
             map.put("glcglist", JSON.toJSONString(lists));//关联采购
         }else{

+ 1 - 1
zjugis-business/src/main/resources/templates/UseMoney/agentIndex.ftl

@@ -239,7 +239,7 @@
             <td style="width: 300px;">项目名称</td>
             <td>责任部门</td>
             <td style="width: 200px;">实际所属类型</td>
-            <td>用途(按发票内容填写)</td>
+            <td style="width: 250px;">用途(按发票内容填写)</td>
             <td style="width: 130px;">单据张数</td>
             <td style="width: 130px;">金额</td>
             <td>备注</td>

+ 2 - 2
zjugis-business/src/main/resources/templates/UseMoney/index.ftl

@@ -278,8 +278,8 @@
           <tr style="height: 37px;">
             <td style="width: 80px;">序号</td>
             <td style="width: 300px;">实际所属类型</td>
-            <td>用途(按发票内容填写)</td>
-            <td style="width: 150px;">单据张数</td>
+            <td style="width: 300px;">用途(按发票内容填写)</td>
+            <td style="width: 120px;">单据张数</td>
             <td style="width: 150px;">金额</td>
             <td style="width: 400px;">备注</td>
           </tr>