repairStatus逻辑
authorXia Kaixiang <kaixiang.xia@supwisdom.com>
Thu, 15 Aug 2019 07:53:51 +0000 (15:53 +0800)
committerXia Kaixiang <kaixiang.xia@supwisdom.com>
Thu, 24 Oct 2019 07:59:48 +0000 (15:59 +0800)
payapi/src/main/kotlin/com/supwisdom/dlpay/api/scheduler_sourcetype_chk.kt
payapi/src/main/kotlin/com/supwisdom/dlpay/api/service/impl/transaction_reconciliation_service_impl.kt

index 4b01a8e..f6416e0 100644 (file)
@@ -365,7 +365,7 @@ class SourceTypeCheckExecutor {
         transactionReconciliationService.doFinishChkfileStatus(chkfile, checkStatus)
 
         //补账, result为equal或unequal时补帐,error跳过
-        if (chkfile.result in setOf(ConstantUtil.CHKFILE_RESULT_EQUAL, ConstantUtil.CHKFILE_RESULT_UNEQUAL)) {
+        if (checkStatus.repairStatus) {
             transactionReconciliationService.getNeedRepairChkdtls(chkfile).forEach { chkdtl ->
                 try {
                     transactionReconciliationService.doRepairTransactionChkdtl(chkdtl) //补账
index ad35776..3becb42 100644 (file)
@@ -243,9 +243,7 @@ class TransactionReconciliationServiceImpl : TransactionReconciliationService {
             chkfile.result = ConstantUtil.CHKFILE_RESULT_ERROR
             chkfile.remark = "校对完成,明细存在对比异常"
             transactionChkdtlDao.getCountByChkresult(chkfile.id, ConstantUtil.CHKDTL_CHKRESULT_SURPLUS).existed.also {
-                if (null != it && it > 0) {
-                    chkfile.remark = "本地有<${it}>条流水不在对账文件中,请联系管理员检查"
-                }
+                if (null != it && it > 0) chkfile.remark = "本地有<$it>条流水不在对账文件中,请联系管理员检查"
             }
         } else {
             //仅存在一致或需补账的记录
@@ -257,6 +255,8 @@ class TransactionReconciliationServiceImpl : TransactionReconciliationService {
                 chkfile.result = ConstantUtil.CHKFILE_RESULT_EQUAL //一致
                 chkfile.remark = "校对完成,双方交易一致"
             }
+            checkStatus.repairStatus = true
+            checkStatus.remark = chkfile.remark
         }
         transactionChkfileDao.save(chkfile)
         sourceTypeService.saveOrUpdateSourceTypeCheckStatus(checkStatus)
@@ -282,7 +282,6 @@ class TransactionReconciliationServiceImpl : TransactionReconciliationService {
         chkfile.localcnt = personSumInfo.totalcnt ?: 0
         chkfile.localamt = personSumInfo.totalamt ?: 0.00
 
-        checkStatus.repairStatus = false
         checkStatus.settleStatus = false
         checkStatus.remark = chkfile.remark
         if (chkfile.result in setOf(ConstantUtil.CHKFILE_RESULT_EQUAL, ConstantUtil.CHKFILE_RESULT_UNEQUAL)) {
@@ -293,7 +292,6 @@ class TransactionReconciliationServiceImpl : TransactionReconciliationService {
                     true -> "对账完成,双方交易一致"
                     else -> "对账完成,补账后双方交易一致"
                 }
-                checkStatus.repairStatus = true
                 checkStatus.settleStatus = true
                 checkStatus.remark = chkfile.remark
             }else{