瀏覽代碼

fix: 打回删除审批中的节点

JieZ 2 年之前
父節點
當前提交
24adcf3737
共有 1 個文件被更改,包括 274 次插入138 次删除
  1. 274 138
      bpm-core/src/main/java/com/srm/bpm/logic/service/impl/BillLogicImpl.java

+ 274 - 138
bpm-core/src/main/java/com/srm/bpm/logic/service/impl/BillLogicImpl.java

@@ -199,7 +199,8 @@ public class BillLogicImpl implements BillLogic {
199
         final List<BillOpinionVO> opinionVOS = Lists.newArrayList();
199
         final List<BillOpinionVO> opinionVOS = Lists.newArrayList();
200
         String firstNodeId = StringPool.EMPTY;
200
         String firstNodeId = StringPool.EMPTY;
201
 
201
 
202
-        final List<ProcessNodeExtendEntity> taskNodes = nodeExtendService.findTaskNodeByProcess(processId);
202
+        final List<ProcessNodeExtendEntity> taskNodes =
203
+                nodeExtendService.findTaskNodeByProcess(processId);
203
         if (CollectionUtil.isNotEmpty(taskNodes)) {
204
         if (CollectionUtil.isNotEmpty(taskNodes)) {
204
             for (ProcessNodeExtendEntity taskNode : taskNodes) {
205
             for (ProcessNodeExtendEntity taskNode : taskNodes) {
205
                 final String linkType = taskNode.getLinkType();
206
                 final String linkType = taskNode.getLinkType();
@@ -214,14 +215,17 @@ public class BillLogicImpl implements BillLogic {
214
             }
215
             }
215
         }
216
         }
216
         // 获取授权信息
217
         // 获取授权信息
217
-        final List<FormPermissionVO> permissionVOS =
218
-                formBasicConvert.formPermissionPOtoVO(nodeFieldPermission.nodeFieldPermission(processId, firstNodeId));
218
+        final List<FormPermissionVO> permissionVOS = formBasicConvert.formPermissionPOtoVO(
219
+                nodeFieldPermission.nodeFieldPermission(processId, firstNodeId));
219
         // 获取标题字段
220
         // 获取标题字段
220
         final ToaProcessEntity byId = processService.getById(processId);
221
         final ToaProcessEntity byId = processService.getById(processId);
221
-        final String code = DateTimeUtil.format(LocalDateTime.now(), "yyyyMMddHHmm") + RandomUtil.randomNumbers(6);
222
+        final String code =
223
+                DateTimeUtil.format(LocalDateTime.now(), "yyyyMMddHHmm") + RandomUtil.randomNumbers(
224
+                        6);
222
         // 获取标题字段
225
         // 获取标题字段
223
 
226
 
224
-        final UserInfoDTO userInfoByCode = userCenterlogic.getUserInfoByCode(loginUserHolder.getUserCode());
227
+        final UserInfoDTO userInfoByCode =
228
+                userCenterlogic.getUserInfoByCode(loginUserHolder.getUserCode());
225
         final String title = billTitleLogic.getTitle(processId, userInfoByCode.getNickname());
229
         final String title = billTitleLogic.getTitle(processId, userInfoByCode.getNickname());
226
         final Map<String, Object> formData = bizFormData(process, userInfoByCode, title);
230
         final Map<String, Object> formData = bizFormData(process, userInfoByCode, title);
227
         // 按钮控制
231
         // 按钮控制
@@ -251,8 +255,9 @@ public class BillLogicImpl implements BillLogic {
251
         if (bill == null) {
255
         if (bill == null) {
252
             throw new RbException(StringPool.EMPTY, BillCode.BILL_NOT_FOUND);
256
             throw new RbException(StringPool.EMPTY, BillCode.BILL_NOT_FOUND);
253
         }
257
         }
254
-        final BillDataJsonEntity billDataJson =
255
-                billDataJsonService.getOne(Wrappers.lambdaQuery(BillDataJsonEntity.class).eq(BillDataJsonEntity::getBillId, billId));
258
+        final BillDataJsonEntity billDataJson = billDataJsonService.getOne(
259
+                Wrappers.lambdaQuery(BillDataJsonEntity.class)
260
+                        .eq(BillDataJsonEntity::getBillId, billId));
256
         if (null == billDataJson) {
261
         if (null == billDataJson) {
257
             throw new RbException(StringPool.EMPTY, BillCode.BILL_NOT_FOUND);
262
             throw new RbException(StringPool.EMPTY, BillCode.BILL_NOT_FOUND);
258
         }
263
         }
@@ -270,17 +275,28 @@ public class BillLogicImpl implements BillLogic {
270
         detailBuilder.selfTaskNames(getSelfNodeName(billId, loginUserHolder.getUserCode(), page));
275
         detailBuilder.selfTaskNames(getSelfNodeName(billId, loginUserHolder.getUserCode(), page));
271
         final List<BillOpinionVO> opinionVOS = billOpinions(bill);
276
         final List<BillOpinionVO> opinionVOS = billOpinions(bill);
272
         final String formSchema = billDataJson.getFormSchema();
277
         final String formSchema = billDataJson.getFormSchema();
273
-        return detailBuilder.form(formSchema).opinions(opinionVOS).title(bill.getTitle()).code(bill.getCode()).mode("edit").build();
278
+        return detailBuilder.form(formSchema)
279
+                .opinions(opinionVOS)
280
+                .title(bill.getTitle())
281
+                .code(bill.getCode())
282
+                .mode("edit")
283
+                .build();
274
     }
284
     }
275
 
285
 
276
     private Set<String> getSelfNodeName(long billId, String user, String page) {
286
     private Set<String> getSelfNodeName(long billId, String user, String page) {
277
         if (page.equals("view")) {
287
         if (page.equals("view")) {
278
-            List<BillTaskEntity> billTaskEntities = billTaskService.findApprovedByBillAndUser(billId, user);
279
-            final Set<String> nodeNames = billTaskEntities.stream().map(BillTaskEntity::getNodeName).collect(Collectors.toSet());
288
+            List<BillTaskEntity> billTaskEntities =
289
+                    billTaskService.findApprovedByBillAndUser(billId, user);
290
+            final Set<String> nodeNames = billTaskEntities.stream()
291
+                    .map(BillTaskEntity::getNodeName)
292
+                    .collect(Collectors.toSet());
280
             return nodeNames;
293
             return nodeNames;
281
         } else {
294
         } else {
282
-            List<BillTaskEntity> billTaskEntities = billTaskService.findApprovingByBillAndUser(billId, user);
283
-            final Set<String> nodeNames = billTaskEntities.stream().map(BillTaskEntity::getNodeName).collect(Collectors.toSet());
295
+            List<BillTaskEntity> billTaskEntities =
296
+                    billTaskService.findApprovingByBillAndUser(billId, user);
297
+            final Set<String> nodeNames = billTaskEntities.stream()
298
+                    .map(BillTaskEntity::getNodeName)
299
+                    .collect(Collectors.toSet());
284
             return nodeNames;
300
             return nodeNames;
285
         }
301
         }
286
     }
302
     }
@@ -294,7 +310,9 @@ public class BillLogicImpl implements BillLogic {
294
         if (bill == null) {
310
         if (bill == null) {
295
             throw new RbException(StringPool.EMPTY, BillCode.BILL_NOT_FOUND);
311
             throw new RbException(StringPool.EMPTY, BillCode.BILL_NOT_FOUND);
296
         }
312
         }
297
-        final BillDataJsonEntity billDataJson = billDataJsonService.getOne(Wrappers.lambdaQuery(BillDataJsonEntity.class).eq(BillDataJsonEntity::getBillId, billId));
313
+        final BillDataJsonEntity billDataJson = billDataJsonService.getOne(
314
+                Wrappers.lambdaQuery(BillDataJsonEntity.class)
315
+                        .eq(BillDataJsonEntity::getBillId, billId));
298
         if (null == billDataJson) {
316
         if (null == billDataJson) {
299
             throw new RbException(StringPool.EMPTY, BillCode.BILL_NOT_FOUND);
317
             throw new RbException(StringPool.EMPTY, BillCode.BILL_NOT_FOUND);
300
         }
318
         }
@@ -312,7 +330,11 @@ public class BillLogicImpl implements BillLogic {
312
         detailBuilder.selfTaskNames(getSelfNodeName(billId, loginUserHolder.getUserCode(), page));
330
         detailBuilder.selfTaskNames(getSelfNodeName(billId, loginUserHolder.getUserCode(), page));
313
         final List<BillOpinionVO> opinionVOS = billOpinions(bill);
331
         final List<BillOpinionVO> opinionVOS = billOpinions(bill);
314
         final String formSchema = billDataJson.getFormSchema();
332
         final String formSchema = billDataJson.getFormSchema();
315
-        return detailBuilder.form(formSchema).code(bill.getCode()).opinions(opinionVOS).mode("view").build();
333
+        return detailBuilder.form(formSchema)
334
+                .code(bill.getCode())
335
+                .opinions(opinionVOS)
336
+                .mode("view")
337
+                .build();
316
     }
338
     }
317
 
339
 
318
     /**
340
     /**
@@ -331,8 +353,8 @@ public class BillLogicImpl implements BillLogic {
331
         final String userCode = loginUserHolder.getUserCode();
353
         final String userCode = loginUserHolder.getUserCode();
332
         // 不是自己发起的,记录读取
354
         // 不是自己发起的,记录读取
333
         final String sender = bill.getSender();
355
         final String sender = bill.getSender();
334
-        return sender.equals(userCode)
335
-                || billReadRecordService.readBillByUserCode(billId, userCode);
356
+        return sender.equals(userCode) || billReadRecordService.readBillByUserCode(billId,
357
+                userCode);
336
     }
358
     }
337
 
359
 
338
     /**
360
     /**
@@ -347,7 +369,8 @@ public class BillLogicImpl implements BillLogic {
347
     public BillItemVO saveDrafts(long processId, long billId, String formDataJson) {
369
     public BillItemVO saveDrafts(long processId, long billId, String formDataJson) {
348
         Preconditions.checkNotNull(formDataJson);
370
         Preconditions.checkNotNull(formDataJson);
349
         final ProcessDetailPO processDetail = this.processService.findDetailById(processId);
371
         final ProcessDetailPO processDetail = this.processService.findDetailById(processId);
350
-        final Map<String, Object> dataMap = JSON.parseObject(formDataJson, FastJsonType.MAP_OBJECT_TR);
372
+        final Map<String, Object> dataMap =
373
+                JSON.parseObject(formDataJson, FastJsonType.MAP_OBJECT_TR);
351
         final BillDataContext billDataValue;
374
         final BillDataContext billDataValue;
352
         billDataValue = this.resolveFormData(billId, processDetail, dataMap);
375
         billDataValue = this.resolveFormData(billId, processDetail, dataMap);
353
         final ToaBillEntity bill;
376
         final ToaBillEntity bill;
@@ -384,7 +407,9 @@ public class BillLogicImpl implements BillLogic {
384
      * @return 数据和总数
407
      * @return 数据和总数
385
      */
408
      */
386
     @Override
409
     @Override
387
-    public Pair<List<BillItemVO>, Long> findApproved(Integer pageNo, Integer pageSize, ApprovedBillQuery query) {
410
+    public Pair<List<BillItemVO>, Long> findApproved(
411
+            Integer pageNo, Integer pageSize, ApprovedBillQuery query
412
+    ) {
388
         Page page = new Page<>(pageNo, pageSize);
413
         Page page = new Page<>(pageNo, pageSize);
389
         final List<BillItemPO> billItemDtos;
414
         final List<BillItemPO> billItemDtos;
390
         final String userCode = loginUserHolder.getUserCode();
415
         final String userCode = loginUserHolder.getUserCode();
@@ -402,13 +427,15 @@ public class BillLogicImpl implements BillLogic {
402
      * @return 数据和总数
427
      * @return 数据和总数
403
      */
428
      */
404
     @Override
429
     @Override
405
-    public Pair<List<BillItemVO>, Long> findTodo(Integer pageNo, Integer pageSize, TodoBillQuery query) {
430
+    public Pair<List<BillItemVO>, Long> findTodo(
431
+            Integer pageNo, Integer pageSize, TodoBillQuery query
432
+    ) {
406
         Page page = new Page(pageNo, pageSize);
433
         Page page = new Page(pageNo, pageSize);
407
-        List<Integer> statusList = Lists.newArrayList(
408
-                BillStatus.APPROVAL.getStatus(), BillStatus.REFUSE.getStatus()
409
-        );
434
+        List<Integer> statusList =
435
+                Lists.newArrayList(BillStatus.APPROVAL.getStatus(), BillStatus.REFUSE.getStatus());
410
         final String userCode = loginUserHolder.getUserCode();
436
         final String userCode = loginUserHolder.getUserCode();
411
-        final List<BillItemPO> billDatas = this.billService.findTodoByStatus(page, userCode, query, statusList);
437
+        final List<BillItemPO> billDatas =
438
+                this.billService.findTodoByStatus(page, userCode, query, statusList);
412
         final Page<BillItemVO> billItemVOPage = toItemVOList(page, billDatas, userCode);
439
         final Page<BillItemVO> billItemVOPage = toItemVOList(page, billDatas, userCode);
413
         return Pair.of(billItemVOPage.getRecords(), billItemVOPage.getTotal());
440
         return Pair.of(billItemVOPage.getRecords(), billItemVOPage.getTotal());
414
     }
441
     }
@@ -422,10 +449,13 @@ public class BillLogicImpl implements BillLogic {
422
      * @return 数据和总数
449
      * @return 数据和总数
423
      */
450
      */
424
     @Override
451
     @Override
425
-    public Pair<List<BillItemVO>, Long> findMeCreate(Integer pageNo, Integer pageSize, MeCreateBillQuery query) {
452
+    public Pair<List<BillItemVO>, Long> findMeCreate(
453
+            Integer pageNo, Integer pageSize, MeCreateBillQuery query
454
+    ) {
426
         Page page = new Page(pageNo, pageSize);
455
         Page page = new Page(pageNo, pageSize);
427
         final String userCode = loginUserHolder.getUserCode();
456
         final String userCode = loginUserHolder.getUserCode();
428
-        final List<BillItemPO> billDatas = this.billService.findCreateByEmployee(page, userCode, query);
457
+        final List<BillItemPO> billDatas =
458
+                this.billService.findCreateByEmployee(page, userCode, query);
429
         final Page<BillItemVO> billItemVOPage = toItemVOList(page, billDatas, userCode);
459
         final Page<BillItemVO> billItemVOPage = toItemVOList(page, billDatas, userCode);
430
         return Pair.of(billItemVOPage.getRecords(), billItemVOPage.getTotal());
460
         return Pair.of(billItemVOPage.getRecords(), billItemVOPage.getTotal());
431
     }
461
     }
@@ -439,10 +469,13 @@ public class BillLogicImpl implements BillLogic {
439
      * @return 数据和总数
469
      * @return 数据和总数
440
      */
470
      */
441
     @Override
471
     @Override
442
-    public Pair<List<BillItemVO>, Long> findDraft(Integer pageNo, Integer pageSize, DraftBillQuery query) {
472
+    public Pair<List<BillItemVO>, Long> findDraft(
473
+            Integer pageNo, Integer pageSize, DraftBillQuery query
474
+    ) {
443
         Page page = new Page(pageNo, pageSize);
475
         Page page = new Page(pageNo, pageSize);
444
         final String userCode = loginUserHolder.getUserCode();
476
         final String userCode = loginUserHolder.getUserCode();
445
-        final List<BillItemPO> billDatas = this.billService.findDraftsBySender(page, userCode, query);
477
+        final List<BillItemPO> billDatas =
478
+                this.billService.findDraftsBySender(page, userCode, query);
446
         final Page<BillItemVO> billItemVOPage = toItemVOList(page, billDatas, userCode);
479
         final Page<BillItemVO> billItemVOPage = toItemVOList(page, billDatas, userCode);
447
         return Pair.of(billItemVOPage.getRecords(), billItemVOPage.getTotal());
480
         return Pair.of(billItemVOPage.getRecords(), billItemVOPage.getTotal());
448
     }
481
     }
@@ -456,7 +489,9 @@ public class BillLogicImpl implements BillLogic {
456
      * @return 数据和总数
489
      * @return 数据和总数
457
      */
490
      */
458
     @Override
491
     @Override
459
-    public Pair<List<BillItemVO>, Long> findCc(Integer pageNo, Integer pageSize, CcBillQuery query) {
492
+    public Pair<List<BillItemVO>, Long> findCc(
493
+            Integer pageNo, Integer pageSize, CcBillQuery query
494
+    ) {
460
         Page page = new Page(pageNo, pageSize);
495
         Page page = new Page(pageNo, pageSize);
461
         final String userCode = loginUserHolder.getUserCode();
496
         final String userCode = loginUserHolder.getUserCode();
462
         final List<BillItemPO> cc = this.billService.findCc(page, userCode, query);
497
         final List<BillItemPO> cc = this.billService.findCc(page, userCode, query);
@@ -474,11 +509,13 @@ public class BillLogicImpl implements BillLogic {
474
      */
509
      */
475
     @Override
510
     @Override
476
     @Transactional(rollbackFor = Exception.class)
511
     @Transactional(rollbackFor = Exception.class)
477
-    public BillItemVO startFlow(long processId, long billId, String formDataJson,
478
-                                String nextApprover, String billCode) {
512
+    public BillItemVO startFlow(
513
+            long processId, long billId, String formDataJson, String nextApprover, String billCode
514
+    ) {
479
         Preconditions.checkNotNull(formDataJson);
515
         Preconditions.checkNotNull(formDataJson);
480
         final ProcessDetailPO processDetail = processService.findDetailById(processId);
516
         final ProcessDetailPO processDetail = processService.findDetailById(processId);
481
-        final Map<String, Object> dataMap = JSON.parseObject(formDataJson, FastJsonType.MAP_OBJECT_TR);
517
+        final Map<String, Object> dataMap =
518
+                JSON.parseObject(formDataJson, FastJsonType.MAP_OBJECT_TR);
482
         final String userCode = loginUserHolder.getUserCode();
519
         final String userCode = loginUserHolder.getUserCode();
483
         final UserInfoDTO userInfoDTO = userCenterlogic.getUserInfoByCode(userCode);
520
         final UserInfoDTO userInfoDTO = userCenterlogic.getUserInfoByCode(userCode);
484
         final BillDataContext billDataValue;
521
         final BillDataContext billDataValue;
@@ -546,11 +583,12 @@ public class BillLogicImpl implements BillLogic {
546
                     //找到审批中的节点,然后把排序前移
583
                     //找到审批中的节点,然后把排序前移
547
                     final BillTaskEntity byId = billTaskService.getById(sourceTaskId);
584
                     final BillTaskEntity byId = billTaskService.getById(sourceTaskId);
548
                     final String taskId = byId.getTaskId();
585
                     final String taskId = byId.getTaskId();
549
-                    final List<BillTaskEntity> approvingByBillAndTaskId = billTaskService.findApprovingByBillAndTaskId(billId, taskId);
586
+                    final List<BillTaskEntity> approvingByBillAndTaskId =
587
+                            billTaskService.findApprovingByBillAndTaskId(billId, taskId);
550
                     for (BillTaskEntity billTaskEntity : approvingByBillAndTaskId) {
588
                     for (BillTaskEntity billTaskEntity : approvingByBillAndTaskId) {
551
                         billTaskEntity.setSort(DateTimeUtil.timeMills());
589
                         billTaskEntity.setSort(DateTimeUtil.timeMills());
552
                     }
590
                     }
553
-//                    approvingByBillAndTaskId.add(createTaskByBill);
591
+                    //                    approvingByBillAndTaskId.add(createTaskByBill);
554
                     byId.setId(null);
592
                     byId.setId(null);
555
                     byId.setOpinion(null);
593
                     byId.setOpinion(null);
556
                     byId.setNodeStatus(BillTaskStatus.APPROVAL.getStatus());
594
                     byId.setNodeStatus(BillTaskStatus.APPROVAL.getStatus());
@@ -571,7 +609,8 @@ public class BillLogicImpl implements BillLogic {
571
         }
609
         }
572
         // 先发起流程
610
         // 先发起流程
573
         final Optional<ProcessInstance> processInstanceOpt;
611
         final Optional<ProcessInstance> processInstanceOpt;
574
-        processInstanceOpt = billBpmnLogic.startFlow(billDataValue, processDetail, userInfoDTO, nextApprover);
612
+        processInstanceOpt =
613
+                billBpmnLogic.startFlow(billDataValue, processDetail, userInfoDTO, nextApprover);
575
         if (processInstanceOpt.isPresent()) {
614
         if (processInstanceOpt.isPresent()) {
576
             final ProcessInstance processInstance = processInstanceOpt.get();
615
             final ProcessInstance processInstance = processInstanceOpt.get();
577
             final boolean state;
616
             final boolean state;
@@ -603,7 +642,7 @@ public class BillLogicImpl implements BillLogic {
603
                         bill.setStatus(BillStatus.APPROVAL.getStatus());
642
                         bill.setStatus(BillStatus.APPROVAL.getStatus());
604
                         state = billService.updateById(bill);
643
                         state = billService.updateById(bill);
605
                         // 取得审批任务信息进行更新
644
                         // 取得审批任务信息进行更新
606
-//                        billTaskService.updateByReFullIn(billId, userInfoDTO.getCode());
645
+                        //                        billTaskService.updateByReFullIn(billId, userInfoDTO.getCode());
607
                         break;
646
                         break;
608
                     }
647
                     }
609
                     default:
648
                     default:
@@ -622,7 +661,9 @@ public class BillLogicImpl implements BillLogic {
622
         }
661
         }
623
     }
662
     }
624
 
663
 
625
-    private ValidationResultDTO validationBySubmitFlow(ProcessDetailPO processDetail, BillDataContext billDataValue, String userCode) {
664
+    private ValidationResultDTO validationBySubmitFlow(
665
+            ProcessDetailPO processDetail, BillDataContext billDataValue, String userCode
666
+    ) {
626
         final BillValidationLogic validationService = getValidationService(processDetail.getId());
667
         final BillValidationLogic validationService = getValidationService(processDetail.getId());
627
         return validataionWithResult(billDataValue, userCode, validationService);
668
         return validataionWithResult(billDataValue, userCode, validationService);
628
     }
669
     }
@@ -635,15 +676,18 @@ public class BillLogicImpl implements BillLogic {
635
      * @return 审批单
676
      * @return 审批单
636
      */
677
      */
637
     @Override
678
     @Override
638
-    public BillItemVO sendProcess(long billId, long processId,
639
-                                  String nextApprover) {
679
+    public BillItemVO sendProcess(
680
+            long billId, long processId, String nextApprover
681
+    ) {
640
         final ToaBillEntity bill = billService.getById(billId);
682
         final ToaBillEntity bill = billService.getById(billId);
641
         if (bill == null) {
683
         if (bill == null) {
642
             throw new RbException(BillCode.BILL_NOT_FOUND);
684
             throw new RbException(BillCode.BILL_NOT_FOUND);
643
         }
685
         }
644
         //  去掉草稿箱的判断,通过具体执行函数来判断
686
         //  去掉草稿箱的判断,通过具体执行函数来判断
645
 
687
 
646
-        final BillDataJsonEntity billDataJson = billDataJsonService.getOne(Wrappers.lambdaQuery(BillDataJsonEntity.class).eq(BillDataJsonEntity::getBillId, billId));
688
+        final BillDataJsonEntity billDataJson = billDataJsonService.getOne(
689
+                Wrappers.lambdaQuery(BillDataJsonEntity.class)
690
+                        .eq(BillDataJsonEntity::getBillId, billId));
647
         final String formData = billDataJson.getFormData();
691
         final String formData = billDataJson.getFormData();
648
         return this.startFlow(processId, billId, formData, nextApprover, StrUtil.EMPTY);
692
         return this.startFlow(processId, billId, formData, nextApprover, StrUtil.EMPTY);
649
     }
693
     }
@@ -674,7 +718,8 @@ public class BillLogicImpl implements BillLogic {
674
                 eventBus.post(billAgreeEvent);
718
                 eventBus.post(billAgreeEvent);
675
             case APPROVAL: {
719
             case APPROVAL: {
676
                 final Optional<BillTaskEntity> taskOpt;
720
                 final Optional<BillTaskEntity> taskOpt;
677
-                taskOpt = billBpmnLogic.findTaskBybillAndEmployeeAndTaskId(billId, taskId, userCode);
721
+                taskOpt =
722
+                        billBpmnLogic.findTaskBybillAndEmployeeAndTaskId(billId, taskId, userCode);
678
                 if (taskOpt.isPresent()) {
723
                 if (taskOpt.isPresent()) {
679
                     BillTaskEntity billTask = taskOpt.get();
724
                     BillTaskEntity billTask = taskOpt.get();
680
                     billTask.setOpinion(opinion);
725
                     billTask.setOpinion(opinion);
@@ -692,14 +737,21 @@ public class BillLogicImpl implements BillLogic {
692
                                     final boolean goFlag = agreeIsGoOn(billTask);
737
                                     final boolean goFlag = agreeIsGoOn(billTask);
693
                                     flowMsgLogic.sendMsg(Lists.newArrayList(billTask));
738
                                     flowMsgLogic.sendMsg(Lists.newArrayList(billTask));
694
                                     if (goFlag) {
739
                                     if (goFlag) {
695
-                                        this.billTaskService.agreeTask(billTask, userCode, actionParam);
696
-                                        this.billItemLogic.updateByFormDataByBill(billId, actionParam.getFormData());
740
+                                        this.billTaskService.agreeTask(billTask, userCode,
741
+                                                actionParam);
742
+                                        this.billItemLogic.updateByFormDataByBill(billId,
743
+                                                actionParam.getFormData());
697
                                         //删除待审批的信息
744
                                         //删除待审批的信息
698
-                                        this.billTaskService.deleteApproval(billTask.getBillId(), billTask.getTaskId(), BillTaskStatus.APPROVAL.getStatus());
699
-                                        this.billBpmnLogic.complete(bill, taskId, opinion, userCode, nextApprover, actionParam.getFormData(), billTask.getTaskNodeKey(), billTask.getTaskId());
745
+                                        this.billTaskService.deleteApproval(billTask.getBillId(),
746
+                                                billTask.getTaskId(),
747
+                                                BillTaskStatus.APPROVAL.getStatus());
748
+                                        this.billBpmnLogic.complete(bill, taskId, opinion, userCode,
749
+                                                nextApprover, actionParam.getFormData(),
750
+                                                billTask.getTaskNodeKey(), billTask.getTaskId());
700
 
751
 
701
                                     } else {
752
                                     } else {
702
-                                        this.billTaskService.agreeTask(billTask, userCode, actionParam);
753
+                                        this.billTaskService.agreeTask(billTask, userCode,
754
+                                                actionParam);
703
                                     }
755
                                     }
704
                                     break;
756
                                     break;
705
                                 case AGREE:
757
                                 case AGREE:
@@ -713,12 +765,17 @@ public class BillLogicImpl implements BillLogic {
713
                             switch (billTaskStatus) {
765
                             switch (billTaskStatus) {
714
                                 case APPROVAL:
766
                                 case APPROVAL:
715
                                     //加签处理,需要把当前审批人在当前节点的所有加签任务都审批通过
767
                                     //加签处理,需要把当前审批人在当前节点的所有加签任务都审批通过
716
-                                    List<BillTaskEntity> billTaskEntities = billTaskService.findEndorseByUserAndTaskId(billId, taskId, userCode);
768
+                                    List<BillTaskEntity> billTaskEntities =
769
+                                            billTaskService.findEndorseByUserAndTaskId(billId,
770
+                                                    taskId, userCode);
717
                                     List<BillTaskEntity> updates = Lists.newArrayList();
771
                                     List<BillTaskEntity> updates = Lists.newArrayList();
718
                                     List<BillTaskEntity> inserts = Lists.newArrayList();
772
                                     List<BillTaskEntity> inserts = Lists.newArrayList();
719
                                     for (BillTaskEntity billTaskEntity : billTaskEntities) {
773
                                     for (BillTaskEntity billTaskEntity : billTaskEntities) {
720
-                                        final BillTaskEntity newBillTask = BeanUtil.sourceToTarget(billTask, BillTaskEntity.class);
721
-                                        billTaskEntity.setNodeStatus(BillTaskStatus.AGREE.getStatus());
774
+                                        final BillTaskEntity newBillTask =
775
+                                                BeanUtil.sourceToTarget(billTask,
776
+                                                        BillTaskEntity.class);
777
+                                        billTaskEntity.setNodeStatus(
778
+                                                BillTaskStatus.AGREE.getStatus());
722
                                         billTaskEntity.setDateline(DateTimeUtil.unixTime());
779
                                         billTaskEntity.setDateline(DateTimeUtil.unixTime());
723
                                         billTaskEntity.setUpdateTime(LocalDateTime.now());
780
                                         billTaskEntity.setUpdateTime(LocalDateTime.now());
724
                                         billTaskEntity.setOpinion(actionParam.getOpinion());
781
                                         billTaskEntity.setOpinion(actionParam.getOpinion());
@@ -787,15 +844,16 @@ public class BillLogicImpl implements BillLogic {
787
         final int status = MoreObjects.firstNonNull(bill.getStatus(), 0);
844
         final int status = MoreObjects.firstNonNull(bill.getStatus(), 0);
788
         BillStatus billStatus = BillStatus.valueTo(status);
845
         BillStatus billStatus = BillStatus.valueTo(status);
789
         switch (billStatus) {
846
         switch (billStatus) {
790
-//            case REFUSE:
791
-//                //当前审批单是拒绝状态才会走这里
792
-//                BillRefuseEvent billAgreeEvent = new BillRefuseEvent();
793
-//                billAgreeEvent.setBillId(billId);
794
-//                billAgreeEvent.setProcessId(bill.getProcessId());
795
-//                eventBus.post(billAgreeEvent);
847
+            //            case REFUSE:
848
+            //                //当前审批单是拒绝状态才会走这里
849
+            //                BillRefuseEvent billAgreeEvent = new BillRefuseEvent();
850
+            //                billAgreeEvent.setBillId(billId);
851
+            //                billAgreeEvent.setProcessId(bill.getProcessId());
852
+            //                eventBus.post(billAgreeEvent);
796
             case APPROVAL: {
853
             case APPROVAL: {
797
                 final Optional<BillTaskEntity> taskOpt;
854
                 final Optional<BillTaskEntity> taskOpt;
798
-                taskOpt = billBpmnLogic.findTaskBybillAndEmployeeAndTaskId(billId, taskId, userCode);
855
+                taskOpt =
856
+                        billBpmnLogic.findTaskBybillAndEmployeeAndTaskId(billId, taskId, userCode);
799
                 if (taskOpt.isPresent()) {
857
                 if (taskOpt.isPresent()) {
800
                     BillTaskEntity task = taskOpt.get();
858
                     BillTaskEntity task = taskOpt.get();
801
                     final int taskNodeStatus = task.getNodeStatus();
859
                     final int taskNodeStatus = task.getNodeStatus();
@@ -805,10 +863,13 @@ public class BillLogicImpl implements BillLogic {
805
                             refuseApproval(taskId, opinion, bill, userCode, task);
863
                             refuseApproval(taskId, opinion, bill, userCode, task);
806
                             // 更新提交的formdata
864
                             // 更新提交的formdata
807
                             final String formData = actionParam.getFormData();
865
                             final String formData = actionParam.getFormData();
808
-                            if (!Strings.isNullOrEmpty(formData) && !org.apache.commons.lang3.StringUtils.equals("{}", formData)) {
866
+                            if (!Strings.isNullOrEmpty(
867
+                                    formData) && !org.apache.commons.lang3.StringUtils.equals("{}",
868
+                                    formData)) {
809
                                 this.billItemLogic.updateByFormDataByBill(billId, formData);
869
                                 this.billItemLogic.updateByFormDataByBill(billId, formData);
810
                             }
870
                             }
811
-                            billTaskService.deleteApproval(task.getBillId(), task.getTaskId(), BillTaskStatus.APPROVAL.getStatus());
871
+                            billTaskService.deleteApproval(task.getBillId(), task.getTaskId(),
872
+                                    BillTaskStatus.APPROVAL.getStatus());
812
                             break;
873
                             break;
813
                         case AGREE:
874
                         case AGREE:
814
                         case REFUSE:
875
                         case REFUSE:
@@ -850,9 +911,11 @@ public class BillLogicImpl implements BillLogic {
850
                 final ToaBillEntity byId = billService.getById(billId);
911
                 final ToaBillEntity byId = billService.getById(billId);
851
                 billService.upldate(bill);
912
                 billService.upldate(bill);
852
                 if (action.equals(BillAction.refuse.name())) {
913
                 if (action.equals(BillAction.refuse.name())) {
853
-                    callBackLogic.callBack(byId.getProcessId(), billId, BillTaskStatus.REFUSE.getStatus());
914
+                    callBackLogic.callBack(byId.getProcessId(), billId,
915
+                            BillTaskStatus.REFUSE.getStatus());
854
                 } else {
916
                 } else {
855
-                    callBackLogic.callBack(byId.getProcessId(), billId, BillStatus.COMPLETE.getStatus());
917
+                    callBackLogic.callBack(byId.getProcessId(), billId,
918
+                            BillStatus.COMPLETE.getStatus());
856
                 }
919
                 }
857
             }
920
             }
858
         };
921
         };
@@ -872,15 +935,20 @@ public class BillLogicImpl implements BillLogic {
872
             throw new RbException(BillCode.BILL_NOT_FOUND);
935
             throw new RbException(BillCode.BILL_NOT_FOUND);
873
         }
936
         }
874
         final List<BillApprovalHistoryPO> byBill = billTaskService.findByBill(bill);
937
         final List<BillApprovalHistoryPO> byBill = billTaskService.findByBill(bill);
875
-        final Set<String> userCodes = byBill.stream().map(BillApprovalHistoryPO::getUserCode).collect(Collectors.toSet());
876
-        final Set<String> userCodes1 = byBill.stream().map(BillApprovalHistoryPO::getSourceUserCode).collect(Collectors.toSet());
877
-        final Set<String> userCodes2 = byBill.stream().map(BillApprovalHistoryPO::getTargetUserCode).collect(Collectors.toSet());
938
+        final Set<String> userCodes =
939
+                byBill.stream().map(BillApprovalHistoryPO::getUserCode).collect(Collectors.toSet());
940
+        final Set<String> userCodes1 = byBill.stream()
941
+                .map(BillApprovalHistoryPO::getSourceUserCode)
942
+                .collect(Collectors.toSet());
943
+        final Set<String> userCodes2 = byBill.stream()
944
+                .map(BillApprovalHistoryPO::getTargetUserCode)
945
+                .collect(Collectors.toSet());
878
         userCodes.addAll(userCodes1);
946
         userCodes.addAll(userCodes1);
879
         userCodes.addAll(userCodes2);
947
         userCodes.addAll(userCodes2);
880
         final List<UserInfoDTO> userInfoDTOS = userCenterlogic.getUserByCodes(userCodes);
948
         final List<UserInfoDTO> userInfoDTOS = userCenterlogic.getUserByCodes(userCodes);
881
         if (CollectionUtil.isNotEmpty(userInfoDTOS)) {
949
         if (CollectionUtil.isNotEmpty(userInfoDTOS)) {
882
-            final Map<String, String> codeNameMap =
883
-                    userInfoDTOS.stream().collect(Collectors.toMap(UserInfoDTO::getCode, UserInfoDTO::getNickname));
950
+            final Map<String, String> codeNameMap = userInfoDTOS.stream()
951
+                    .collect(Collectors.toMap(UserInfoDTO::getCode, UserInfoDTO::getNickname));
884
             for (BillApprovalHistoryPO billApprovalHistoryPO : byBill) {
952
             for (BillApprovalHistoryPO billApprovalHistoryPO : byBill) {
885
                 final String userCode = billApprovalHistoryPO.getUserCode();
953
                 final String userCode = billApprovalHistoryPO.getUserCode();
886
                 final String name = codeNameMap.get(userCode);
954
                 final String name = codeNameMap.get(userCode);
@@ -893,19 +961,21 @@ public class BillLogicImpl implements BillLogic {
893
                 if (!Strings.isNullOrEmpty(targetUserCode)) {
961
                 if (!Strings.isNullOrEmpty(targetUserCode)) {
894
                     billApprovalHistoryPO.setTargetUserName(codeNameMap.get(targetUserCode));
962
                     billApprovalHistoryPO.setTargetUserName(codeNameMap.get(targetUserCode));
895
                 }
963
                 }
896
-                if (billApprovalHistoryPO.getTaskType().compareTo(BillTaskType.SKIP.getValue()) == 0) {
964
+                if (billApprovalHistoryPO.getTaskType()
965
+                        .compareTo(BillTaskType.SKIP.getValue()) == 0) {
897
                     billApprovalHistoryPO.setUserName(Const.SKIP_OPTION);
966
                     billApprovalHistoryPO.setUserName(Const.SKIP_OPTION);
898
                 }
967
                 }
899
             }
968
             }
900
         }
969
         }
901
-        final List<BillApprovalHistoryPO> result =
902
-                byBill.stream().sorted(Comparator.comparing(BillApprovalHistoryPO::getSort, (x, y) -> {
970
+        final List<BillApprovalHistoryPO> result = byBill.stream()
971
+                .sorted(Comparator.comparing(BillApprovalHistoryPO::getSort, (x, y) -> {
903
                     if (x <= y) {
972
                     if (x <= y) {
904
                         return -1;
973
                         return -1;
905
                     } else {
974
                     } else {
906
                         return 1;
975
                         return 1;
907
                     }
976
                     }
908
-                })).collect(Collectors.toList());
977
+                }))
978
+                .collect(Collectors.toList());
909
         return billBasicConvert.billApprovalHistoryPOToVO(result);
979
         return billBasicConvert.billApprovalHistoryPOToVO(result);
910
     }
980
     }
911
 
981
 
@@ -932,7 +1002,9 @@ public class BillLogicImpl implements BillLogic {
932
         billBpmnLogic.recall(bill, taskId, opinion, userCode);
1002
         billBpmnLogic.recall(bill, taskId, opinion, userCode);
933
     }
1003
     }
934
 
1004
 
935
-    private void refuseApproval(String taskId, String opinion, ToaBillEntity bill, String userCode, BillTaskEntity task) {
1005
+    private void refuseApproval(
1006
+            String taskId, String opinion, ToaBillEntity bill, String userCode, BillTaskEntity task
1007
+    ) {
936
         final Optional<ProcessNodeExtendEntity> nodeExtendOpt;
1008
         final Optional<ProcessNodeExtendEntity> nodeExtendOpt;
937
         final Long processId = bill.getProcessId();
1009
         final Long processId = bill.getProcessId();
938
         final String taskNodeKey = task.getTaskNodeKey();
1010
         final String taskNodeKey = task.getTaskNodeKey();
@@ -955,14 +1027,14 @@ public class BillLogicImpl implements BillLogic {
955
                     task.setOpinion(opinion);
1027
                     task.setOpinion(opinion);
956
                     task.setDateline(dateline);
1028
                     task.setDateline(dateline);
957
                     task.setAction(BillAction.refuse.name());
1029
                     task.setAction(BillAction.refuse.name());
958
-//                    bill.setStatus(BillStatus.REFUSE.getStatus());
959
-//                    bill.setUpdateTime(LocalDateTime.now());
1030
+                    //                    bill.setStatus(BillStatus.REFUSE.getStatus());
1031
+                    //                    bill.setUpdateTime(LocalDateTime.now());
960
                     //推送消息
1032
                     //推送消息
961
                     List<BillTaskEntity> sends = Lists.newArrayList();
1033
                     List<BillTaskEntity> sends = Lists.newArrayList();
962
                     sends.add(task);
1034
                     sends.add(task);
963
                     flowMsgLogic.sendMsg(sends);
1035
                     flowMsgLogic.sendMsg(sends);
964
                     billTaskService.updateById(task);
1036
                     billTaskService.updateById(task);
965
-//                    billService.updateById(bill);
1037
+                    //                    billService.updateById(bill);
966
                     billReadRecordService.deleteByBillAndEmployeeId(bill.getId(), userCode);
1038
                     billReadRecordService.deleteByBillAndEmployeeId(bill.getId(), userCode);
967
                     billBpmnLogic.refuse(bill, taskId, opinion, userCode);
1039
                     billBpmnLogic.refuse(bill, taskId, opinion, userCode);
968
                     break;
1040
                     break;
@@ -980,7 +1052,8 @@ public class BillLogicImpl implements BillLogic {
980
         final String taskId = billTask.getTaskId();
1052
         final String taskId = billTask.getTaskId();
981
         final Long billId = billTask.getBillId();
1053
         final Long billId = billTask.getBillId();
982
         final Long approverId = billTask.getNodeApproverId();
1054
         final Long approverId = billTask.getNodeApproverId();
983
-        final ProcessNodeApproverEntity nodeApprover = nodeApproverService.getByIdExludDel(approverId);
1055
+        final ProcessNodeApproverEntity nodeApprover =
1056
+                nodeApproverService.getByIdExludDel(approverId);
984
         if (Objects.isNull(nodeApprover)) {
1057
         if (Objects.isNull(nodeApprover)) {
985
             //默认全部审批通过才能往下走
1058
             //默认全部审批通过才能往下走
986
             final int percentage = 100;
1059
             final int percentage = 100;
@@ -988,7 +1061,8 @@ public class BillLogicImpl implements BillLogic {
988
             int total = billTaskService.findTotalCount(billId, taskId, billTask.getTaskType());
1061
             int total = billTaskService.findTotalCount(billId, taskId, billTask.getTaskType());
989
             final BigDecimal val1 = BigDecimal.valueOf(countActive + 1);
1062
             final BigDecimal val1 = BigDecimal.valueOf(countActive + 1);
990
             final BigDecimal val2 = BigDecimal.valueOf(total);
1063
             final BigDecimal val2 = BigDecimal.valueOf(total);
991
-            final BigDecimal val3 = val1.divide(val2, 4, BigDecimal.ROUND_DOWN).multiply(BigDecimal.valueOf(100));
1064
+            final BigDecimal val3 =
1065
+                    val1.divide(val2, 4, BigDecimal.ROUND_DOWN).multiply(BigDecimal.valueOf(100));
992
             final BigDecimal val4 = BigDecimal.valueOf(percentage);
1066
             final BigDecimal val4 = BigDecimal.valueOf(percentage);
993
             return val3.compareTo(val4) >= 0 ? true : false;
1067
             return val3.compareTo(val4) >= 0 ? true : false;
994
         }
1068
         }
@@ -1011,7 +1085,8 @@ public class BillLogicImpl implements BillLogic {
1011
             int total = billTaskService.findTotalCount(billId, taskId, billTask.getTaskType());
1085
             int total = billTaskService.findTotalCount(billId, taskId, billTask.getTaskType());
1012
             final BigDecimal val1 = BigDecimal.valueOf(countActive + 1);
1086
             final BigDecimal val1 = BigDecimal.valueOf(countActive + 1);
1013
             final BigDecimal val2 = BigDecimal.valueOf(total);
1087
             final BigDecimal val2 = BigDecimal.valueOf(total);
1014
-            final BigDecimal val3 = val1.divide(val2, 4, BigDecimal.ROUND_DOWN).multiply(BigDecimal.valueOf(100));
1088
+            final BigDecimal val3 =
1089
+                    val1.divide(val2, 4, BigDecimal.ROUND_DOWN).multiply(BigDecimal.valueOf(100));
1015
             final BigDecimal val4 = BigDecimal.valueOf(percentage);
1090
             final BigDecimal val4 = BigDecimal.valueOf(percentage);
1016
             return val3.compareTo(val4) >= 0 ? true : false;
1091
             return val3.compareTo(val4) >= 0 ? true : false;
1017
         }
1092
         }
@@ -1025,7 +1100,8 @@ public class BillLogicImpl implements BillLogic {
1025
             final Set<String> userCodes =
1100
             final Set<String> userCodes =
1026
                     billDatas.stream().map(BillItemPO::getSender).collect(Collectors.toSet());
1101
                     billDatas.stream().map(BillItemPO::getSender).collect(Collectors.toSet());
1027
             final List<UserInfoDTO> userInfoDTOS = userCenterlogic.getUserByCodes(userCodes);
1102
             final List<UserInfoDTO> userInfoDTOS = userCenterlogic.getUserByCodes(userCodes);
1028
-            final Map<String, String> codeNameMap = userInfoDTOS.stream().collect(Collectors.toMap(UserInfoDTO::getCode, a -> a.getNickname()));
1103
+            final Map<String, String> codeNameMap = userInfoDTOS.stream()
1104
+                    .collect(Collectors.toMap(UserInfoDTO::getCode, a -> a.getNickname()));
1029
             if (CollectionUtil.isNotEmpty(userInfoDTOS)) {
1105
             if (CollectionUtil.isNotEmpty(userInfoDTOS)) {
1030
                 for (BillItemPO billData : billDatas) {
1106
                 for (BillItemPO billData : billDatas) {
1031
                     final String sender = billData.getSender();
1107
                     final String sender = billData.getSender();
@@ -1045,7 +1121,10 @@ public class BillLogicImpl implements BillLogic {
1045
         return resultPage;
1121
         return resultPage;
1046
     }
1122
     }
1047
 
1123
 
1048
-    private ToaBillEntity createBill(ProcessDetailPO processDetail, BillStatus billStatus, BillDataContext billDataValue, UserInfoDTO userInfoDTO) {
1124
+    private ToaBillEntity createBill(
1125
+            ProcessDetailPO processDetail, BillStatus billStatus, BillDataContext billDataValue,
1126
+            UserInfoDTO userInfoDTO
1127
+    ) {
1049
         ToaBillEntity bill = new ToaBillEntity();
1128
         ToaBillEntity bill = new ToaBillEntity();
1050
         bill.setId(billDataValue.getId());
1129
         bill.setId(billDataValue.getId());
1051
         bill.setProcessId(processDetail.getId());
1130
         bill.setProcessId(processDetail.getId());
@@ -1075,7 +1154,7 @@ public class BillLogicImpl implements BillLogic {
1075
             final String username = userInfoDTO.getNickname();
1154
             final String username = userInfoDTO.getNickname();
1076
             // 生成默认流水号
1155
             // 生成默认流水号
1077
             final String billCode = serialNumberLogic.dayPolling("bill_default_sn", 6);
1156
             final String billCode = serialNumberLogic.dayPolling("bill_default_sn", 6);
1078
-//            String codeText = StrUtil.format("{}-{}-{}-{}", processName, username, day, billCode);
1157
+            //            String codeText = StrUtil.format("{}-{}-{}-{}", processName, username, day, billCode);
1079
             String codeText = StrUtil.format("{}", billCode);
1158
             String codeText = StrUtil.format("{}", billCode);
1080
             bill.setCode(codeText);
1159
             bill.setCode(codeText);
1081
         } else {
1160
         } else {
@@ -1095,7 +1174,9 @@ public class BillLogicImpl implements BillLogic {
1095
      * @return 解析后的表单数据
1174
      * @return 解析后的表单数据
1096
      */
1175
      */
1097
     @Override
1176
     @Override
1098
-    public BillDataContext resolveFormData(long billId, ProcessDetailPO processDetail, Map<String, Object> formDataMap) {
1177
+    public BillDataContext resolveFormData(
1178
+            long billId, ProcessDetailPO processDetail, Map<String, Object> formDataMap
1179
+    ) {
1099
 
1180
 
1100
         long processId = processDetail.getId();
1181
         long processId = processDetail.getId();
1101
 
1182
 
@@ -1135,7 +1216,8 @@ public class BillLogicImpl implements BillLogic {
1135
             switch (formXtype) {
1216
             switch (formXtype) {
1136
                 case triggerselect: {
1217
                 case triggerselect: {
1137
                     final Pair<List<BillAssociatedVO>, List<BillBizDataEntity>> selectVal;
1218
                     final Pair<List<BillAssociatedVO>, List<BillBizDataEntity>> selectVal;
1138
-                    selectVal = billItemLogic.formTriggerselectValue(formDataMap, formFieldVO, newBillId);
1219
+                    selectVal = billItemLogic.formTriggerselectValue(formDataMap, formFieldVO,
1220
+                            newBillId);
1139
                     associateds.addAll(selectVal.getKey());
1221
                     associateds.addAll(selectVal.getKey());
1140
                     bizDataList.addAll(selectVal.getValue());
1222
                     bizDataList.addAll(selectVal.getValue());
1141
                     break;
1223
                     break;
@@ -1176,8 +1258,10 @@ public class BillLogicImpl implements BillLogic {
1176
                         continue;
1258
                         continue;
1177
                     }
1259
                     }
1178
 
1260
 
1179
-                    final Triple<Boolean, List<BillAssociatedVO>, List<BillBizDataEntity>> detailItemTriple;
1180
-                    detailItemTriple = billItemLogic.detailFormFileds(newBillId, detailgroupDatas, detailFields);
1261
+                    final Triple<Boolean, List<BillAssociatedVO>, List<BillBizDataEntity>>
1262
+                            detailItemTriple;
1263
+                    detailItemTriple = billItemLogic.detailFormFileds(newBillId, detailgroupDatas,
1264
+                            detailFields);
1181
                     final Boolean attachment = detailItemTriple.getLeft();
1265
                     final Boolean attachment = detailItemTriple.getLeft();
1182
                     if (attachment) {
1266
                     if (attachment) {
1183
                         dataValueBuilder.attachment(true);
1267
                         dataValueBuilder.attachment(true);
@@ -1215,8 +1299,11 @@ public class BillLogicImpl implements BillLogic {
1215
         final long billId = actionParam.getBillId();
1299
         final long billId = actionParam.getBillId();
1216
         final String userCode = actionParam.getUserCode();
1300
         final String userCode = actionParam.getUserCode();
1217
 
1301
 
1218
-        List<BillTaskEntity> billTaskEntities = billTaskService.findApprovingByBillAndTaskId(billId, taskId);
1219
-        final Set<String> collect = billTaskEntities.stream().map(BillTaskEntity::getUserCode).collect(Collectors.toSet());
1302
+        List<BillTaskEntity> billTaskEntities =
1303
+                billTaskService.findApprovingByBillAndTaskId(billId, taskId);
1304
+        final Set<String> collect = billTaskEntities.stream()
1305
+                .map(BillTaskEntity::getUserCode)
1306
+                .collect(Collectors.toSet());
1220
         if (collect.contains(actionParam.getEndorseApprover())) {
1307
         if (collect.contains(actionParam.getEndorseApprover())) {
1221
             throw new RbException(ENDORSE_CANNOT_IN_NODE);
1308
             throw new RbException(ENDORSE_CANNOT_IN_NODE);
1222
         }
1309
         }
@@ -1233,7 +1320,8 @@ public class BillLogicImpl implements BillLogic {
1233
             case APPROVAL:
1320
             case APPROVAL:
1234
                 // 更新提交的formdata
1321
                 // 更新提交的formdata
1235
                 final String formData = actionParam.getFormData();
1322
                 final String formData = actionParam.getFormData();
1236
-                if (!Strings.isNullOrEmpty(formData) && !org.apache.commons.lang3.StringUtils.equals("{}", formData)) {
1323
+                if (!Strings.isNullOrEmpty(
1324
+                        formData) && !org.apache.commons.lang3.StringUtils.equals("{}", formData)) {
1237
                     this.billItemLogic.updateByFormDataByBill(billId, formData);
1325
                     this.billItemLogic.updateByFormDataByBill(billId, formData);
1238
                 }
1326
                 }
1239
                 break;
1327
                 break;
@@ -1287,7 +1375,8 @@ public class BillLogicImpl implements BillLogic {
1287
             case APPROVAL:
1375
             case APPROVAL:
1288
                 // 更新提交的formdata
1376
                 // 更新提交的formdata
1289
                 final String formData = actionParam.getFormData();
1377
                 final String formData = actionParam.getFormData();
1290
-                if (!Strings.isNullOrEmpty(formData) && !org.apache.commons.lang3.StringUtils.equals("{}", formData)) {
1378
+                if (!Strings.isNullOrEmpty(
1379
+                        formData) && !org.apache.commons.lang3.StringUtils.equals("{}", formData)) {
1291
                     this.billItemLogic.updateByFormDataByBill(billId, formData);
1380
                     this.billItemLogic.updateByFormDataByBill(billId, formData);
1292
                 }
1381
                 }
1293
                 break;
1382
                 break;
@@ -1304,29 +1393,37 @@ public class BillLogicImpl implements BillLogic {
1304
         task.setOpinion(opinion);
1393
         task.setOpinion(opinion);
1305
         task.setDateline(DateTimeUtil.unixTime());
1394
         task.setDateline(DateTimeUtil.unixTime());
1306
         billTaskService.upldate(task);
1395
         billTaskService.upldate(task);
1307
-        final BillTaskEntity targetTask = billTaskService.getOne(Wrappers.lambdaQuery(BillTaskEntity.class)
1308
-                .eq(BillTaskEntity::getId, targetTaskId));
1396
+        final BillTaskEntity targetTask = billTaskService.getOne(
1397
+                Wrappers.lambdaQuery(BillTaskEntity.class).eq(BillTaskEntity::getId, targetTaskId));
1309
         if (Objects.isNull(targetTask)) {
1398
         if (Objects.isNull(targetTask)) {
1310
             throw new RbException(TARGET_TASK_NULL);
1399
             throw new RbException(TARGET_TASK_NULL);
1311
         }
1400
         }
1312
         final String taskNodeKey = targetTask.getTaskNodeKey();
1401
         final String taskNodeKey = targetTask.getTaskNodeKey();
1313
-        final ProcessNodeExtendEntity extendEntity = nodeExtendService
1314
-                .getOne(Wrappers.lambdaQuery(ProcessNodeExtendEntity.class)
1402
+        final ProcessNodeExtendEntity extendEntity = nodeExtendService.getOne(
1403
+                Wrappers.lambdaQuery(ProcessNodeExtendEntity.class)
1315
                         .eq(ProcessNodeExtendEntity::getProcessId, byId.getProcessId())
1404
                         .eq(ProcessNodeExtendEntity::getProcessId, byId.getProcessId())
1316
                         .eq(ProcessNodeExtendEntity::getNodeId, taskNodeKey));
1405
                         .eq(ProcessNodeExtendEntity::getNodeId, taskNodeKey));
1317
         List<BillTaskEntity> sends = Lists.newArrayList();
1406
         List<BillTaskEntity> sends = Lists.newArrayList();
1407
+        //退回需要删除当前节点审批中的数据
1408
+        billTaskService.remove(Wrappers.lambdaQuery(BillTaskEntity.class)
1409
+                .eq(BillTaskEntity::getBillId, billId)
1410
+                .eq(BillTaskEntity::getTaskNodeKey, task.getTaskNodeKey()).ne(BillTaskEntity::getId,task.getId()));
1318
         if (!extendEntity.getLinkType().equals(NodeLinkType.create.name())) {
1411
         if (!extendEntity.getLinkType().equals(NodeLinkType.create.name())) {
1319
-            billBpmnLogic.returnToTargetTask(task, targetTask, userCode, opinion, actionParam.getNextApprover());
1412
+            billBpmnLogic.returnToTargetTask(task, targetTask, userCode, opinion,
1413
+                    actionParam.getNextApprover());
1320
         } else {
1414
         } else {
1321
             /**
1415
             /**
1322
              *表示是退回到发起节点需要进行操作需要找到当前审批的最新的创建节点,然后找到任务taskId和用户然后重新创建一个节点任务
1416
              *表示是退回到发起节点需要进行操作需要找到当前审批的最新的创建节点,然后找到任务taskId和用户然后重新创建一个节点任务
1323
              */
1417
              */
1324
-            billService.update(Wrappers.lambdaUpdate(ToaBillEntity.class).set(ToaBillEntity::getStatus, BillStatus.REPULSE.getStatus()).eq(ToaBillEntity::getId, billId));
1418
+            billService.update(Wrappers.lambdaUpdate(ToaBillEntity.class)
1419
+                    .set(ToaBillEntity::getStatus, BillStatus.REPULSE.getStatus())
1420
+                    .eq(ToaBillEntity::getId, billId));
1325
             BillTaskEntity createTask = billTaskService.findCreateTaskByBill(billId);
1421
             BillTaskEntity createTask = billTaskService.findCreateTaskByBill(billId);
1326
             if (Objects.isNull(createTask)) {
1422
             if (Objects.isNull(createTask)) {
1327
                 throw new RbException(StringPool.EMPTY, ProcessCode.PROCESS_ACTIVITI_ERROR);
1423
                 throw new RbException(StringPool.EMPTY, ProcessCode.PROCESS_ACTIVITI_ERROR);
1328
             }
1424
             }
1329
-            final BillTaskEntity newBillTask = BeanUtil.sourceToTarget(createTask, BillTaskEntity.class);
1425
+            final BillTaskEntity newBillTask =
1426
+                    BeanUtil.sourceToTarget(createTask, BillTaskEntity.class);
1330
             newBillTask.setId(IdWorker.getId());
1427
             newBillTask.setId(IdWorker.getId());
1331
             newBillTask.setSourceTaskId(task.getId());
1428
             newBillTask.setSourceTaskId(task.getId());
1332
             newBillTask.setSourceUserCode(userCode);
1429
             newBillTask.setSourceUserCode(userCode);
@@ -1353,9 +1450,14 @@ public class BillLogicImpl implements BillLogic {
1353
      * @param turnUser 移交用户
1450
      * @param turnUser 移交用户
1354
      */
1451
      */
1355
     @Override
1452
     @Override
1356
-    public void turnUser(long billId, String taskId, String turnUser, String userCode, String opinion) {
1357
-        List<BillTaskEntity> billTaskEntities = billTaskService.findApprovingByBillAndTaskId(billId, taskId);
1358
-        Set<String> collect = billTaskEntities.stream().map(BillTaskEntity::getUserCode).collect(Collectors.toSet());
1453
+    public void turnUser(
1454
+            long billId, String taskId, String turnUser, String userCode, String opinion
1455
+    ) {
1456
+        List<BillTaskEntity> billTaskEntities =
1457
+                billTaskService.findApprovingByBillAndTaskId(billId, taskId);
1458
+        Set<String> collect = billTaskEntities.stream()
1459
+                .map(BillTaskEntity::getUserCode)
1460
+                .collect(Collectors.toSet());
1359
         // 更新移交
1461
         // 更新移交
1360
         final List<String> split = StrUtil.split(turnUser, ',');
1462
         final List<String> split = StrUtil.split(turnUser, ',');
1361
         final Set<String> hashSet = new HashSet(split);
1463
         final Set<String> hashSet = new HashSet(split);
@@ -1376,7 +1478,8 @@ public class BillLogicImpl implements BillLogic {
1376
 
1478
 
1377
                 List<BillTaskEntity> insertLists = Lists.newArrayList();
1479
                 List<BillTaskEntity> insertLists = Lists.newArrayList();
1378
                 for (String s : hashSet) {
1480
                 for (String s : hashSet) {
1379
-                    final BillTaskEntity turnTask = BeanUtil.sourceToTarget(task, BillTaskEntity.class);
1481
+                    final BillTaskEntity turnTask =
1482
+                            BeanUtil.sourceToTarget(task, BillTaskEntity.class);
1380
                     turnTask.setSourceTaskId(task.getId());
1483
                     turnTask.setSourceTaskId(task.getId());
1381
                     turnTask.setSourceUserCode(userCode);
1484
                     turnTask.setSourceUserCode(userCode);
1382
                     turnTask.setTaskType(BillTaskType.TURN.getValue());
1485
                     turnTask.setTaskType(BillTaskType.TURN.getValue());
@@ -1412,9 +1515,11 @@ public class BillLogicImpl implements BillLogic {
1412
     @Override
1515
     @Override
1413
     public BillDetailVO<List<FormFieldVO>> createByApp(long processId) {
1516
     public BillDetailVO<List<FormFieldVO>> createByApp(long processId) {
1414
         ProcessDetailDTO process = checkProcess(processId);
1517
         ProcessDetailDTO process = checkProcess(processId);
1415
-        final List<FormFieldVO> fieldVOS = formBasicConvert.FormFieldPOToVO(formFieldService.findVoByProcessId(processId));
1518
+        final List<FormFieldVO> fieldVOS =
1519
+                formBasicConvert.FormFieldPOToVO(formFieldService.findVoByProcessId(processId));
1416
         List<BillOpinionVO> opinionVOS = Lists.newArrayList();
1520
         List<BillOpinionVO> opinionVOS = Lists.newArrayList();
1417
-        String firstNodeId = nodeExtendService.findTaskNodeIdByProcessAndLinkType(processId, NodeLinkType.create);
1521
+        String firstNodeId = nodeExtendService.findTaskNodeIdByProcessAndLinkType(processId,
1522
+                NodeLinkType.create);
1418
         // 获取授权信息
1523
         // 获取授权信息
1419
         final List<FormPermissionVO> permissionVOS;
1524
         final List<FormPermissionVO> permissionVOS;
1420
         permissionVOS = billBpmnLogic.nodeFieldPermission(processId, firstNodeId);
1525
         permissionVOS = billBpmnLogic.nodeFieldPermission(processId, firstNodeId);
@@ -1445,8 +1550,11 @@ public class BillLogicImpl implements BillLogic {
1445
      * @return 验证结果
1550
      * @return 验证结果
1446
      */
1551
      */
1447
     @Override
1552
     @Override
1448
-    public ValidationResultDTO validation(long processId, long billId, String formDataJson, String userCode) {
1449
-        final Map<String, Object> dataMap = JSON.parseObject(formDataJson, FastJsonType.MAP_OBJECT_TR);
1553
+    public ValidationResultDTO validation(
1554
+            long processId, long billId, String formDataJson, String userCode
1555
+    ) {
1556
+        final Map<String, Object> dataMap =
1557
+                JSON.parseObject(formDataJson, FastJsonType.MAP_OBJECT_TR);
1450
         final BillDataContext billDataValue;
1558
         final BillDataContext billDataValue;
1451
         final ProcessDetailPO processDetail = this.processService.findDetailById(processId);
1559
         final ProcessDetailPO processDetail = this.processService.findDetailById(processId);
1452
         billDataValue = this.resolveFormDataByValidation(billId, processDetail, dataMap);
1560
         billDataValue = this.resolveFormDataByValidation(billId, processDetail, dataMap);
@@ -1464,19 +1572,24 @@ public class BillLogicImpl implements BillLogic {
1464
      */
1572
      */
1465
     @Override
1573
     @Override
1466
     public List<String> getNodeCondition(long processId, long billId, String taskId) {
1574
     public List<String> getNodeCondition(long processId, long billId, String taskId) {
1467
-        final List<BillTaskEntity> list = billTaskService.list(Wrappers.lambdaQuery(BillTaskEntity.class)
1468
-                .eq(BillTaskEntity::getBillId, billId).eq(BillTaskEntity::getTaskId, taskId));
1469
-        final Set<String> nodeKeys = list.stream().map(BillTaskEntity::getTaskNodeKey).collect(Collectors.toSet());
1575
+        final List<BillTaskEntity> list = billTaskService.list(
1576
+                Wrappers.lambdaQuery(BillTaskEntity.class)
1577
+                        .eq(BillTaskEntity::getBillId, billId)
1578
+                        .eq(BillTaskEntity::getTaskId, taskId));
1579
+        final Set<String> nodeKeys =
1580
+                list.stream().map(BillTaskEntity::getTaskNodeKey).collect(Collectors.toSet());
1470
         if (CollectionUtil.isEmpty(nodeKeys)) {
1581
         if (CollectionUtil.isEmpty(nodeKeys)) {
1471
             return Collections.emptyList();
1582
             return Collections.emptyList();
1472
         }
1583
         }
1473
-        final List<ProcessNodeApproverEntity> list1 = nodeApproverService
1474
-                .list(Wrappers.lambdaQuery(ProcessNodeApproverEntity.class)
1584
+        final List<ProcessNodeApproverEntity> list1 = nodeApproverService.list(
1585
+                Wrappers.lambdaQuery(ProcessNodeApproverEntity.class)
1475
                         .eq(ProcessNodeApproverEntity::getProcessId, processId)
1586
                         .eq(ProcessNodeApproverEntity::getProcessId, processId)
1476
                         .in(ProcessNodeApproverEntity::getNodeId, nodeKeys));
1587
                         .in(ProcessNodeApproverEntity::getNodeId, nodeKeys));
1477
-        final List<String> params =
1478
-                list1.stream().filter(a -> !Strings.isNullOrEmpty(a.getExpress()) && a.getExpress().indexOf("implication") != -1)
1479
-                        .map(ProcessNodeApproverEntity::getExpressParams).collect(Collectors.toList());
1588
+        final List<String> params = list1.stream()
1589
+                .filter(a -> !Strings.isNullOrEmpty(a.getExpress()) && a.getExpress()
1590
+                        .indexOf("implication") != -1)
1591
+                .map(ProcessNodeApproverEntity::getExpressParams)
1592
+                .collect(Collectors.toList());
1480
         List<String> result = Lists.newArrayList();
1593
         List<String> result = Lists.newArrayList();
1481
         for (String param : params) {
1594
         for (String param : params) {
1482
             final JSONObject jsonObject = JSON.parseObject(param);
1595
             final JSONObject jsonObject = JSON.parseObject(param);
@@ -1500,23 +1613,26 @@ public class BillLogicImpl implements BillLogic {
1500
      */
1613
      */
1501
     @Override
1614
     @Override
1502
     public String findTodoSize() {
1615
     public String findTodoSize() {
1503
-        List<Integer> statusList = Lists.newArrayList(
1504
-                BillStatus.APPROVAL.getStatus(), BillStatus.REFUSE.getStatus()
1505
-        );
1616
+        List<Integer> statusList =
1617
+                Lists.newArrayList(BillStatus.APPROVAL.getStatus(), BillStatus.REFUSE.getStatus());
1506
         final String userCode = loginUserHolder.getUserCode();
1618
         final String userCode = loginUserHolder.getUserCode();
1507
         final String todoSize = this.billService.findTodoSizeByStatus(userCode, statusList);
1619
         final String todoSize = this.billService.findTodoSizeByStatus(userCode, statusList);
1508
         return todoSize;
1620
         return todoSize;
1509
     }
1621
     }
1510
 
1622
 
1511
     @Override
1623
     @Override
1512
-    public Pair<List<BillItemVO>, Long> findAllByQuery(Integer pageNo, Integer pageSize, DraftBillQuery query) {
1624
+    public Pair<List<BillItemVO>, Long> findAllByQuery(
1625
+            Integer pageNo, Integer pageSize, DraftBillQuery query
1626
+    ) {
1513
         Page page = new Page(pageNo, pageSize);
1627
         Page page = new Page(pageNo, pageSize);
1514
         final List<BillItemPO> billDatas = this.billService.findAllByQuery(page, query);
1628
         final List<BillItemPO> billDatas = this.billService.findAllByQuery(page, query);
1515
         final Page<BillItemVO> billItemVOPage = toItemVOList(page, billDatas, null);
1629
         final Page<BillItemVO> billItemVOPage = toItemVOList(page, billDatas, null);
1516
         return Pair.of(billItemVOPage.getRecords(), billItemVOPage.getTotal());
1630
         return Pair.of(billItemVOPage.getRecords(), billItemVOPage.getTotal());
1517
     }
1631
     }
1518
 
1632
 
1519
-    private ValidationResultDTO validataionWithResult(BillDataContext billDataValue, String userCode, BillValidationLogic validationService) {
1633
+    private ValidationResultDTO validataionWithResult(
1634
+            BillDataContext billDataValue, String userCode, BillValidationLogic validationService
1635
+    ) {
1520
 
1636
 
1521
         if (null != validationService) {
1637
         if (null != validationService) {
1522
             return validationService.validation(billDataValue, userCode);
1638
             return validationService.validation(billDataValue, userCode);
@@ -1539,9 +1655,7 @@ public class BillLogicImpl implements BillLogic {
1539
 
1655
 
1540
     @Transactional(readOnly = true, rollbackFor = Exception.class)
1656
     @Transactional(readOnly = true, rollbackFor = Exception.class)
1541
     public BillDataContext resolveFormDataByValidation(
1657
     public BillDataContext resolveFormDataByValidation(
1542
-            long billId,
1543
-            ProcessDetailPO processDetail,
1544
-            Map<String, Object> formDataMap
1658
+            long billId, ProcessDetailPO processDetail, Map<String, Object> formDataMap
1545
     ) {
1659
     ) {
1546
         long processId = processDetail.getId();
1660
         long processId = processDetail.getId();
1547
 
1661
 
@@ -1613,8 +1727,10 @@ public class BillLogicImpl implements BillLogic {
1613
                         continue;
1727
                         continue;
1614
                     }
1728
                     }
1615
 
1729
 
1616
-                    final Triple<Boolean, List<BillAssociatedVO>, List<BillBizDataEntity>> detailItemTriple;
1617
-                    detailItemTriple = billItemLogic.detailFormFileds(newBillId, detailgroupDatas, detailFields);
1730
+                    final Triple<Boolean, List<BillAssociatedVO>, List<BillBizDataEntity>>
1731
+                            detailItemTriple;
1732
+                    detailItemTriple = billItemLogic.detailFormFileds(newBillId, detailgroupDatas,
1733
+                            detailFields);
1618
                     final Boolean attachment = detailItemTriple.getLeft();
1734
                     final Boolean attachment = detailItemTriple.getLeft();
1619
                     if (attachment) {
1735
                     if (attachment) {
1620
                         dataValueBuilder.attachment(true);
1736
                         dataValueBuilder.attachment(true);
@@ -1638,11 +1754,13 @@ public class BillLogicImpl implements BillLogic {
1638
     private List<BillOpinionVO> billOpinions(ToaBillEntity bill) {
1754
     private List<BillOpinionVO> billOpinions(ToaBillEntity bill) {
1639
         long processId = MoreObjects.firstNonNull(bill.getProcessId(), 0L);
1755
         long processId = MoreObjects.firstNonNull(bill.getProcessId(), 0L);
1640
         final List<BillOpinionVO> opinionVOS = Lists.newArrayList();
1756
         final List<BillOpinionVO> opinionVOS = Lists.newArrayList();
1641
-        final List<ProcessNodeExtendEntity> taskNodes = nodeExtendService.findTaskNodeByProcess(processId);
1757
+        final List<ProcessNodeExtendEntity> taskNodes =
1758
+                nodeExtendService.findTaskNodeByProcess(processId);
1642
         if (CollectionUtil.isNotEmpty(taskNodes)) {
1759
         if (CollectionUtil.isNotEmpty(taskNodes)) {
1643
             for (ProcessNodeExtendEntity taskNode : taskNodes) {
1760
             for (ProcessNodeExtendEntity taskNode : taskNodes) {
1644
                 final String linkType = taskNode.getLinkType();
1761
                 final String linkType = taskNode.getLinkType();
1645
-                if (org.apache.commons.lang3.StringUtils.equals(linkType, NodeLinkType.approvl.name())) {
1762
+                if (org.apache.commons.lang3.StringUtils.equals(linkType,
1763
+                        NodeLinkType.approvl.name())) {
1646
                     BillOpinionVO billOpinionVO = new BillOpinionVO();
1764
                     BillOpinionVO billOpinionVO = new BillOpinionVO();
1647
                     billOpinionVO.setTitle(taskNode.getNodeName());
1765
                     billOpinionVO.setTitle(taskNode.getNodeName());
1648
                     opinionVOS.add(billOpinionVO);
1766
                     opinionVOS.add(billOpinionVO);
@@ -1652,11 +1770,15 @@ public class BillLogicImpl implements BillLogic {
1652
         return opinionVOS;
1770
         return opinionVOS;
1653
     }
1771
     }
1654
 
1772
 
1655
-    private <T> BillDetailVO.BillDetailVOBuilder<T> billDetailBuilder(BillDataJsonEntity billDataJson, ToaBillEntity bill) {
1773
+    private <T> BillDetailVO.BillDetailVOBuilder<T> billDetailBuilder(
1774
+            BillDataJsonEntity billDataJson, ToaBillEntity bill
1775
+    ) {
1656
         return billDetailBuilder(billDataJson, bill, StringPool.EMPTY);
1776
         return billDetailBuilder(billDataJson, bill, StringPool.EMPTY);
1657
     }
1777
     }
1658
 
1778
 
1659
-    private <T> BillDetailVO.BillDetailVOBuilder<T> billDetailBuilder(BillDataJsonEntity billDataJson, ToaBillEntity bill, String page) {
1779
+    private <T> BillDetailVO.BillDetailVOBuilder<T> billDetailBuilder(
1780
+            BillDataJsonEntity billDataJson, ToaBillEntity bill, String page
1781
+    ) {
1660
         long billId = bill.getId();
1782
         long billId = bill.getId();
1661
         long processId = bill.getProcessId();
1783
         long processId = bill.getProcessId();
1662
         final String userCode = loginUserHolder.getUserCode();
1784
         final String userCode = loginUserHolder.getUserCode();
@@ -1710,8 +1832,9 @@ public class BillLogicImpl implements BillLogic {
1710
                             for (FormPermissionVO permission : permissions) {
1832
                             for (FormPermissionVO permission : permissions) {
1711
                                 permission.setEdit(false);
1833
                                 permission.setEdit(false);
1712
                             }
1834
                             }
1713
-                        } else if (!Strings.isNullOrEmpty(page)
1714
-                                && org.apache.commons.lang3.StringUtils.equalsAny(page, "cc", "approved")) {
1835
+                        } else if (!Strings.isNullOrEmpty(
1836
+                                page) && org.apache.commons.lang3.StringUtils.equalsAny(page, "cc",
1837
+                                "approved")) {
1715
                             // 来自我发起的列表和抄送我的列表,这个时候,所有的按钮权限应该都是不可编辑的
1838
                             // 来自我发起的列表和抄送我的列表,这个时候,所有的按钮权限应该都是不可编辑的
1716
                             for (FormPermissionVO permission : permissions) {
1839
                             for (FormPermissionVO permission : permissions) {
1717
                                 permission.setEdit(false);
1840
                                 permission.setEdit(false);
@@ -1722,7 +1845,8 @@ public class BillLogicImpl implements BillLogic {
1722
                 }
1845
                 }
1723
                 case REFUSE_FILL_IN:
1846
                 case REFUSE_FILL_IN:
1724
                     permissions = billBpmnLogic.findPermissionByProcessStartNode(processId);
1847
                     permissions = billBpmnLogic.findPermissionByProcessStartNode(processId);
1725
-                    if (CollectionUtil.isNotEmpty(permissions) && billStatus == BillStatus.COMPLETE) {
1848
+                    if (CollectionUtil.isNotEmpty(
1849
+                            permissions) && billStatus == BillStatus.COMPLETE) {
1726
                         for (FormPermissionVO permission : permissions) {
1850
                         for (FormPermissionVO permission : permissions) {
1727
                             permission.setEdit(false);
1851
                             permission.setEdit(false);
1728
                         }
1852
                         }
@@ -1742,7 +1866,8 @@ public class BillLogicImpl implements BillLogic {
1742
                 }
1866
                 }
1743
             }
1867
             }
1744
         }
1868
         }
1745
-        Map<String, Object> formData = JSON.parseObject(billDataJson.getFormData(), FastJsonType.MAP_OBJECT_TR);
1869
+        Map<String, Object> formData =
1870
+                JSON.parseObject(billDataJson.getFormData(), FastJsonType.MAP_OBJECT_TR);
1746
         String title = StringPool.EMPTY;
1871
         String title = StringPool.EMPTY;
1747
         if (!Strings.isNullOrEmpty(bill.getTitle())) {
1872
         if (!Strings.isNullOrEmpty(bill.getTitle())) {
1748
             title = bill.getTitle();
1873
             title = bill.getTitle();
@@ -1759,7 +1884,9 @@ public class BillLogicImpl implements BillLogic {
1759
          * 需要对按钮进行过滤
1884
          * 需要对按钮进行过滤
1760
          */
1885
          */
1761
         List<String> newBtns = billBtnLogic.filterByNode(billTask, btns);
1886
         List<String> newBtns = billBtnLogic.filterByNode(billTask, btns);
1762
-        detailBuilder.title(title).formData(formData).processId(processId)
1887
+        detailBuilder.title(title)
1888
+                .formData(formData)
1889
+                .processId(processId)
1763
                 .billId(billId)
1890
                 .billId(billId)
1764
                 .permission(permissions)
1891
                 .permission(permissions)
1765
                 .btns(newBtns);
1892
                 .btns(newBtns);
@@ -1791,10 +1918,13 @@ public class BillLogicImpl implements BillLogic {
1791
      * @param title   审批标题
1918
      * @param title   审批标题
1792
      * @return 封装后的表单字段信息
1919
      * @return 封装后的表单字段信息
1793
      */
1920
      */
1794
-    private Map<String, Object> bizFormData(ProcessDetailDTO process, UserInfoDTO userInfoDTO, String title) {
1921
+    private Map<String, Object> bizFormData(
1922
+            ProcessDetailDTO process, UserInfoDTO userInfoDTO, String title
1923
+    ) {
1795
         final long processId = process.getId();
1924
         final long processId = process.getId();
1796
         final long processCodeId = Objects.isNull(process.getCodeId()) ? 0 : process.getCodeId();
1925
         final long processCodeId = Objects.isNull(process.getCodeId()) ? 0 : process.getCodeId();
1797
-        final List<FormFieldEntity> bizFields = this.formFieldService.findBizFiled(processId, FormXtype.biz);
1926
+        final List<FormFieldEntity> bizFields =
1927
+                this.formFieldService.findBizFiled(processId, FormXtype.biz);
1798
         if (CollectionUtil.isEmpty(bizFields)) {
1928
         if (CollectionUtil.isEmpty(bizFields)) {
1799
             return Collections.emptyMap();
1929
             return Collections.emptyMap();
1800
         }
1930
         }
@@ -1824,7 +1954,8 @@ public class BillLogicImpl implements BillLogic {
1824
                     if (!Objects.isNull(userInfoDTO)) {
1954
                     if (!Objects.isNull(userInfoDTO)) {
1825
                         final List<UserOrgDTO> orgs = userInfoDTO.getOrgs();
1955
                         final List<UserOrgDTO> orgs = userInfoDTO.getOrgs();
1826
                         if (CollectionUtil.isNotEmpty(orgs)) {
1956
                         if (CollectionUtil.isNotEmpty(orgs)) {
1827
-                            final List<String> orgNames = orgs.stream().map(UserOrgDTO::getOrgName)
1957
+                            final List<String> orgNames = orgs.stream()
1958
+                                    .map(UserOrgDTO::getOrgName)
1828
                                     .collect(Collectors.toList());
1959
                                     .collect(Collectors.toList());
1829
                             organizationName = StrUtil.join(",", orgNames);
1960
                             organizationName = StrUtil.join(",", orgNames);
1830
                         }
1961
                         }
@@ -1846,23 +1977,28 @@ public class BillLogicImpl implements BillLogic {
1846
 
1977
 
1847
     @Override
1978
     @Override
1848
     public List<ProcessTypeVO> findTodoCateSize() {
1979
     public List<ProcessTypeVO> findTodoCateSize() {
1849
-        LambdaQueryWrapper<ProcessTypeEntity> wrapper = Wrappers.lambdaQuery(ProcessTypeEntity.class);
1980
+        LambdaQueryWrapper<ProcessTypeEntity> wrapper =
1981
+                Wrappers.lambdaQuery(ProcessTypeEntity.class);
1850
 
1982
 
1851
         List<ProcessTypeEntity> processTypes = this.processTypeService.list(wrapper);
1983
         List<ProcessTypeEntity> processTypes = this.processTypeService.list(wrapper);
1852
         if (CollectionUtil.isNotEmpty(processTypes)) {
1984
         if (CollectionUtil.isNotEmpty(processTypes)) {
1853
             int processTypeSize = processTypes.size();
1985
             int processTypeSize = processTypes.size();
1854
             List<ProcessTypeVO> types = Lists.newArrayListWithCapacity(processTypeSize);
1986
             List<ProcessTypeVO> types = Lists.newArrayListWithCapacity(processTypeSize);
1855
-            List<Integer> statusList = Lists.newArrayList(new Integer[]{BillStatus.APPROVAL.getStatus(), BillStatus.REFUSE.getStatus()});
1987
+            List<Integer> statusList = Lists.newArrayList(
1988
+                    new Integer[]{BillStatus.APPROVAL.getStatus(), BillStatus.REFUSE.getStatus()});
1856
             String userCode = this.loginUserHolder.getUserCode();
1989
             String userCode = this.loginUserHolder.getUserCode();
1857
-            List<ProcessGridPO> todoCateSize = this.billService.findTodoCateSize(userCode, statusList);
1990
+            List<ProcessGridPO> todoCateSize =
1991
+                    this.billService.findTodoCateSize(userCode, statusList);
1858
             List<ProcessVO> processVOS = this.processBasicConvert.processGridPOToVO(todoCateSize);
1992
             List<ProcessVO> processVOS = this.processBasicConvert.processGridPOToVO(todoCateSize);
1859
-            Map<Long, List<ProcessVO>> collect = (Map)processVOS.stream().collect(Collectors.groupingBy(ProcessVO::getTypeId));
1993
+            Map<Long, List<ProcessVO>> collect =
1994
+                    (Map) processVOS.stream().collect(Collectors.groupingBy(ProcessVO::getTypeId));
1860
 
1995
 
1861
             ProcessTypeVO processTypeVO;
1996
             ProcessTypeVO processTypeVO;
1862
-            for(Iterator var10 = processTypes.iterator(); var10.hasNext(); types.add(processTypeVO)) {
1863
-                ProcessTypeEntity processType = (ProcessTypeEntity)var10.next();
1997
+            for (Iterator var10 = processTypes.iterator(); var10.hasNext(); types.add(
1998
+                    processTypeVO)) {
1999
+                ProcessTypeEntity processType = (ProcessTypeEntity) var10.next();
1864
                 Long id = processType.getId();
2000
                 Long id = processType.getId();
1865
-                List<ProcessVO> processVOS1 = (List)collect.get(id);
2001
+                List<ProcessVO> processVOS1 = (List) collect.get(id);
1866
                 processTypeVO = new ProcessTypeVO();
2002
                 processTypeVO = new ProcessTypeVO();
1867
                 processTypeVO.setName(processType.getName());
2003
                 processTypeVO.setName(processType.getName());
1868
                 processTypeVO.setId(processType.getId());
2004
                 processTypeVO.setId(processType.getId());