Ver Fonte

2024 7 2 号

zhuwei há 1 ano atrás
pai
commit
67d1790aa1

+ 6 - 5
blade-service-api/blade-business-api/src/main/java/org/springblade/business/feign/TaskClient.java

@@ -164,16 +164,17 @@ public interface TaskClient {
     @PostMapping(value = "/saveFixedFlowLink")
     void saveFixedFlowLink(@RequestParam Long fixedFlowId, @RequestParam String name, @RequestParam Integer type,
                            @RequestParam String userIds, @RequestParam Long projectId,
-                           @RequestParam Long contractId, @RequestParam Integer sort);
+                           @RequestParam Long contractId, @RequestParam Integer linkSort,
+                           @RequestParam Integer userSort);
 
     @PostMapping(value = "/updateFixedFlow")
     boolean updateFixedFlow(@RequestParam Long fixedFlowId, @RequestParam String fixedName);
 
     @PostMapping(value = "/updateFixedFlowLink")
-    void updateFixedFlowLink(@RequestParam Long fixedFlowId, @RequestParam String name, @RequestParam Integer type,
-                             @RequestParam String userIds, @RequestParam Long projectId,
-                             @RequestParam Long contractId, @RequestParam Integer sort);
-
+    void updateFixedFlowLink(@RequestParam Long fixedFlowId, @RequestParam String name,
+                             @RequestParam Integer type,@RequestParam String userIds,
+                             @RequestParam Long projectId, @RequestParam Long contractId,
+                             @RequestParam Integer linkSort,@RequestParam Integer userSort);
     @PostMapping(value = "/getFixedFlowPage")
     List<Map<String, Object>> getFixedFlowPage(@RequestBody org.springblade.meter.dto.PageFixedFlowDTO dto);
 

+ 3 - 3
blade-service/blade-business/src/main/java/org/springblade/business/controller/FixedFlowController.java

@@ -215,8 +215,9 @@ public class FixedFlowController extends BladeController {
         List<Task> tasks = jdbcTemplate
                 .query("SELECT * FROM u_task WHERE contract_id = ? and is_deleted = 0 and status != 3 AND fixed_flow_id = ? ",
                         new Object[]{vo.getContractId(),vo.getId()}, new BeanPropertyRowMapper<>(Task.class));
-        if (tasks.size() > 0){
-            return R.fail("当前流程已经使用,不能修改");
+        if (tasks.size() > 0){ //流程已被使用,可以修改名称,不能修改流程里面的内容
+            this.fixedFlowService.update(Wrappers.<FixedFlow>lambdaUpdate().set(FixedFlow::getFixedFlowName, vo.getFixedFlowName()).eq(FixedFlow::getId, vo.getId()));
+            return R.success("当前流程已经使用,名称已修改,内容无法变更");
         }
 
         //获取环节处理人顺序
@@ -224,7 +225,6 @@ public class FixedFlowController extends BladeController {
         if (StringUtils.isNotEmpty(linkUserJoinString)) {
             //清空原本环节
             this.fixedFlowLinkService.update(Wrappers.<FixedFlowLink>lambdaUpdate().set(FixedFlowLink::getIsDeleted, 1).eq(FixedFlowLink::getFixedFlowId, vo.getId()));
-
             //新增环节集合
             List<FixedFlowLink> linkList = new ArrayList<>();
 

+ 5 - 8
blade-service/blade-business/src/main/java/org/springblade/business/feignClient/TaskClientImpl.java

@@ -219,9 +219,8 @@ public class TaskClientImpl implements TaskClient {
     }
 
     @Override
-    public void saveFixedFlowLink(Long fixedFlowId, String name, Integer type, String userIds, Long projectId, Long contractId, Integer sort) {
+    public void saveFixedFlowLink(Long fixedFlowId, String name, Integer type, String userIds, Long projectId, Long contractId, Integer linkSort,Integer userSort) {
         Map<Long, String> userMap = iUserClient.selectUserAll().stream().filter(f -> ObjectUtil.isNotEmpty(f.getRealName())).collect(Collectors.toMap(User::getId, User::getRealName));
-        int sortLink = 1;
         for (String userId : userIds.split(",")) {
             FixedFlowLink fixedFlowLink = new FixedFlowLink();
             fixedFlowLink.setFixedFlowId(fixedFlowId);
@@ -229,12 +228,10 @@ public class TaskClientImpl implements TaskClient {
             fixedFlowLink.setFixedFlowLinkType(type);
             fixedFlowLink.setFixedFlowLinkUser(Long.parseLong(userId));
             fixedFlowLink.setFixedFlowLinkUserName(userMap.get(Long.parseLong(userId)));
-            if (type.equals(1)) {
-                fixedFlowLink.setFixedFlowLinkSort(sortLink++);
-            }
+            fixedFlowLink.setFixedFlowLinkSort(linkSort);
             fixedFlowLink.setProjectId(projectId);
             fixedFlowLink.setContractId(contractId);
-            fixedFlowLink.setFixedFlowBranchSort(sort);
+            fixedFlowLink.setFixedFlowBranchSort(userSort+=1);
             fixedFlowLinkServiceImpl.save(fixedFlowLink);
         }
     }
@@ -245,8 +242,8 @@ public class TaskClientImpl implements TaskClient {
     }
 
     @Override
-    public void updateFixedFlowLink(Long fixedFlowId, String name, Integer type, String userIds, Long projectId, Long contractId, Integer sort) {
-        this.saveFixedFlowLink(fixedFlowId, name, type, userIds, projectId, contractId, sort);
+    public void updateFixedFlowLink(Long fixedFlowId, String name, Integer type, String userIds, Long projectId, Long contractId, Integer linkSort,Integer userSort) {
+        this.saveFixedFlowLink(fixedFlowId, name, type, userIds, projectId, contractId, linkSort,userSort);
     }
 
     @Override

Diff do ficheiro suprimidas por serem muito extensas
+ 152 - 325
blade-service/blade-meter/src/main/java/org/springblade/meter/controller/TaskController.java


+ 7 - 11
blade-service/blade-meter/src/main/java/org/springblade/meter/mapper/StartPayMeterFormMapper.xml

@@ -23,17 +23,13 @@
         <result column="sort" property="sort"/>
     </resultMap>
     <select id="meterPage" resultType="org.springblade.meter.vo.StartPayMeterFormVO">
-        SELECT IF(c.taskUserInfo is NULL,c.approveStatusName,CONCAT(c.approveStatusName,'',c.taskUserInfo))  as approveStatusName,c.* from (
-        select *,(select period_number from s_meter_period smp where smp.id = spmf.meter_period_id) as periodNumber,
-        CASE when approve_status = 0 then '未上报' when approve_status = 1 then '待审批' when approve_status = 2 then '已审批'
-        else '已废除' end as approveStatusName,
-        (
-        SELECT CONCAT('(',GROUP_CONCAT( CONCAT(a.task_user_name, ',', DATEDIFF(CURDATE(), a.create_time))),')') as taskUserInfo from u_task_parallel a ,u_task b where a.process_instance_id=b.process_instance_id and b.form_data_id=spmf.meter_period_id
-        and e_visa_status is null and e_visa_content is NULL
-        )	as taskUserInfo,
-        (SELECT max(id) from u_task c where spmf.meter_period_id=c.form_data_id) as task_id
-        from s_start_pay_meter_form spmf
-        ) c
+        select *,(select period_number from s_meter_period smp where smp.id = c.meter_period_id) as periodNumber,
+                   CASE when approve_status = 0 then '未上报'  when approve_status = 1 then CONCAT('待审批',
+                          (SELECT CONCAT('(',GROUP_CONCAT( CONCAT(a.task_user_name, ',', DATEDIFF(CURDATE(), a.create_time))),')') as taskUserInfo from u_task_parallel a ,u_task b where b.status in(1,2) and a.process_instance_id=b.process_instance_id and b.form_data_id=c.meter_period_id
+                          and e_visa_status is null and e_visa_content is NULL))
+                     when approve_status = 2 then '已审批'else '已废除' end as approveStatusName,
+              (SELECT max(id) from u_task c where c.meter_period_id=c.form_data_id) as task_id
+        from s_start_pay_meter_form c
         where c.contract_id = #{contractId} and c.is_deleted = 0
         <if test="meterPeriodId!=null and meterPeriodId!=''">
             and c.meter_period_id = #{meterPeriodId}

Alguns ficheiros não foram mostrados porque muitos ficheiros mudaram neste diff