|
1
|
1
|
package com.lframework.xingyun.sc.procurement.impl.credit;
|
|
2
|
2
|
|
|
|
3
|
+import cn.hutool.json.JSONArray;
|
|
|
4
|
+import cn.hutool.json.JSONObject;
|
|
3
|
5
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
4
|
6
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
5
|
7
|
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
|
...
|
...
|
@@ -344,8 +346,46 @@ public class ProcurementDomesticCustomerCreditServiceImpl |
|
344
|
346
|
if (StringUtils.isBlank(id)) {
|
|
345
|
347
|
return new DomesticReviewerDto();
|
|
346
|
348
|
}
|
|
347
|
|
- DomesticReviewerDto reviewer = getBaseMapper().getReviewerById(id);
|
|
348
|
|
- return reviewer == null ? new DomesticReviewerDto() : reviewer;
|
|
|
349
|
+ DomesticReviewerDto reviewer = new DomesticReviewerDto();
|
|
|
350
|
+ reviewer.setId(id);
|
|
|
351
|
+
|
|
|
352
|
+ String defJson = getBaseMapper().getLatestFlowDefJson(id);
|
|
|
353
|
+ if (StringUtils.isBlank(defJson)) {
|
|
|
354
|
+ return reviewer;
|
|
|
355
|
+ }
|
|
|
356
|
+
|
|
|
357
|
+ JSONObject flowJson = JsonUtil.parseObj(defJson);
|
|
|
358
|
+ Object nodeListObj = flowJson.get("nodeList");
|
|
|
359
|
+ if (ObjectUtil.isNull(nodeListObj)) {
|
|
|
360
|
+ return reviewer;
|
|
|
361
|
+ }
|
|
|
362
|
+
|
|
|
363
|
+ JSONArray nodeList = JsonUtil.parseArray(nodeListObj);
|
|
|
364
|
+ for (Object nodeObj : nodeList) {
|
|
|
365
|
+ if (ObjectUtil.isNull(nodeObj)) {
|
|
|
366
|
+ continue;
|
|
|
367
|
+ }
|
|
|
368
|
+
|
|
|
369
|
+ JSONObject nodeJson = JsonUtil.parseObj(nodeObj);
|
|
|
370
|
+ String nodeCode = nodeJson.getStr("nodeCode");
|
|
|
371
|
+ if (StringUtils.isBlank(nodeCode)) {
|
|
|
372
|
+ continue;
|
|
|
373
|
+ }
|
|
|
374
|
+
|
|
|
375
|
+ String approverName = getFirstApproverName(nodeJson);
|
|
|
376
|
+ if (StringUtils.isBlank(approverName)) {
|
|
|
377
|
+ continue;
|
|
|
378
|
+ }
|
|
|
379
|
+
|
|
|
380
|
+ if (isProcurementOfficeNode(nodeCode)) {
|
|
|
381
|
+ reviewer.setProcurementOffice(approverName);
|
|
|
382
|
+ } else if ("domestic_customer_credit_gyglk".equals(nodeCode)) {
|
|
|
383
|
+ reviewer.setSupplyManagementSection(approverName);
|
|
|
384
|
+ } else if ("domestic_customer_credit_gybzg".equals(nodeCode)) {
|
|
|
385
|
+ reviewer.setSupplyDepartment(approverName);
|
|
|
386
|
+ }
|
|
|
387
|
+ }
|
|
|
388
|
+ return reviewer;
|
|
349
|
389
|
}
|
|
350
|
390
|
|
|
351
|
391
|
/**
|
|
...
|
...
|
@@ -417,6 +457,49 @@ public class ProcurementDomesticCustomerCreditServiceImpl |
|
417
|
457
|
}
|
|
418
|
458
|
|
|
419
|
459
|
/**
|
|
|
460
|
+ * 获取节点首个审批人名称
|
|
|
461
|
+ *
|
|
|
462
|
+ * @param nodeJson 流程节点JSON
|
|
|
463
|
+ * @return 审批人名称
|
|
|
464
|
+ */
|
|
|
465
|
+ private String getFirstApproverName(JSONObject nodeJson) {
|
|
|
466
|
+ if (nodeJson == null) {
|
|
|
467
|
+ return null;
|
|
|
468
|
+ }
|
|
|
469
|
+
|
|
|
470
|
+ JSONObject extMap = nodeJson.getJSONObject("extMap");
|
|
|
471
|
+ if (extMap == null) {
|
|
|
472
|
+ return null;
|
|
|
473
|
+ }
|
|
|
474
|
+
|
|
|
475
|
+ Object handleInfosObj = extMap.get("handleInfos");
|
|
|
476
|
+ if (ObjectUtil.isNull(handleInfosObj)) {
|
|
|
477
|
+ return null;
|
|
|
478
|
+ }
|
|
|
479
|
+
|
|
|
480
|
+ JSONArray handleInfos = JsonUtil.parseArray(handleInfosObj);
|
|
|
481
|
+ if (handleInfos.isEmpty()) {
|
|
|
482
|
+ return null;
|
|
|
483
|
+ }
|
|
|
484
|
+
|
|
|
485
|
+ JSONObject firstHandleInfo = JsonUtil.parseObj(handleInfos.get(0));
|
|
|
486
|
+ return firstHandleInfo.getStr("createBy");
|
|
|
487
|
+ }
|
|
|
488
|
+
|
|
|
489
|
+ /**
|
|
|
490
|
+ * 判断是否为采购处主管节点
|
|
|
491
|
+ *
|
|
|
492
|
+ * @param nodeCode 节点编码
|
|
|
493
|
+ * @return 是否为采购处主管节点
|
|
|
494
|
+ */
|
|
|
495
|
+ private boolean isProcurementOfficeNode(String nodeCode) {
|
|
|
496
|
+ return "domestic_customer_credit_cgczg_1".equals(nodeCode)
|
|
|
497
|
+ || "domestic_customer_credit_cgczg_2".equals(nodeCode)
|
|
|
498
|
+ || "domestic_customer_credit_cgczg_3".equals(nodeCode)
|
|
|
499
|
+ || "domestic_customer_credit_cgczg_4".equals(nodeCode);
|
|
|
500
|
+ }
|
|
|
501
|
+
|
|
|
502
|
+ /**
|
|
420
|
503
|
* 发送评审有效期提醒消息。
|
|
421
|
504
|
*
|
|
422
|
505
|
* @param customerCredit 内贸资信
|
...
|
...
|
|