Browse Source

人员额度同步调度任务:
1.来源类型调整成getKey
2.如果额度存在也创建个人额度

lisheng 1 day ago
parent
commit
bb432c95d2

+ 12 - 12
code/jyyy/nckd-jimin-jyyy-fi/src/main/java/nckd/jimin/jyyy/fi/plugin/operate/Helper/PersonReimQuotaHelper.java

@@ -86,7 +86,7 @@ public class PersonReimQuotaHelper {
         }
         personAmountBill.set("totalamount", totalAmount);
         personAmountBill.set("auditstatus", "0");
-        personAmountBill.set("nckd_sourcetype",quotaVO.getSourcetype().getValue());
+        personAmountBill.set("nckd_sourcetype",quotaVO.getSourcetype().getKey());
         personAmountBill.set("nckd_sourcebillid",quotaVO.getSourcebillid());
         personAmountBill.set("nckd_limitrelaset",quotaVO.getLimitRelasetId());
 
@@ -187,18 +187,18 @@ public class PersonReimQuotaHelper {
     protected boolean copyModifyPersonReim(DynamicObject personAmountBill, Long copyPersonAmountBillId,BigDecimal amount, int startMonth) {
         DynamicObject oriPersonAmount = BusinessDataServiceHelper.loadSingle(copyPersonAmountBillId, BillTypeConstants.ER_REIMBURSEAMOUNT);
 
+// 不同职级、相同额度时,如果没有新创建的,会作废掉现有的数据。因此调整逻辑,都需要创建
         // 如果月份之后的额度与需要更新的额度相同,则不保存
-        Boolean isNeedUpdate = false;
-        for(int i = startMonth; i <= 12; i++) {
-            if( amount != null && amount.compareTo(oriPersonAmount.getBigDecimal("month" + i)) != 0){
-                isNeedUpdate = true;
-                break;
-            }
-        }
-
-        if(!isNeedUpdate){
-            return false;
-        }
+//        Boolean isNeedUpdate = false;
+//        for(int i = startMonth; i <= 12; i++) {
+//            if( amount != null && amount.compareTo(oriPersonAmount.getBigDecimal("month" + i)) != 0){
+//                isNeedUpdate = true;
+//                break;
+//            }
+//        }
+//        if(!isNeedUpdate){
+//            return false;
+//        }
 
         Set<String> ignoreSet = new HashSet<>(Arrays.asList("id","creator","createtime","modifier","modifytime","auditor","auditdate","nckd_sourcetype","nckd_sourcebillid","nckd_limitrelaset"));
         DynamicObjectUtils.copy(oriPersonAmount,personAmountBill,ignoreSet);

+ 2 - 2
code/jyyy/nckd-jimin-jyyy-fi/src/main/java/nckd/jimin/jyyy/fi/task/PersonReimYearQuotaCopyTask.java

@@ -63,7 +63,7 @@ public class PersonReimYearQuotaCopyTask extends AbstractTask implements StopTas
             // 查询已经生成的数据
             Set<Object> hasCreateIdSet = QueryServiceHelper.query(BillTypeConstants.ER_REIMBURSEAMOUNT, "nckd_sourcebillid", new QFilter[]{
                     new QFilter("dateyear", QCP.equals, String.valueOf(copyYear)),
-                    new QFilter("nckd_sourcetype", QCP.equals, ReimAmountSourceTypeEnum.YEARCOPY.getValue()),
+                    new QFilter("nckd_sourcetype", QCP.equals, ReimAmountSourceTypeEnum.YEARCOPY.getKey()),
                     new QFilter("nckd_sourcebillid", QCP.in, patchIdList),
             }).stream().map(r -> r.get("nckd_sourcebillid")).collect(Collectors.toSet());
 
@@ -115,7 +115,7 @@ public class PersonReimYearQuotaCopyTask extends AbstractTask implements StopTas
         remiQuota.set("modifier", currentUserId);
         remiQuota.set("wbsrcbilltype", "er_reimctl_new");
 
-        remiQuota.set("nckd_sourcetype", ReimAmountSourceTypeEnum.YEARCOPY.getValue());
+        remiQuota.set("nckd_sourcetype", ReimAmountSourceTypeEnum.YEARCOPY.getKey());
         remiQuota.set("nckd_sourcebillid", reimburseQuota.getPkValue());
 
         // 调用保存