From 5c8ea097a69d7a3b46d39a1b6908d999398c415d Mon Sep 17 00:00:00 2001
From: java110 <928255095@qq.com>
Date: 星期三, 13 十月 2021 09:50:14 +0800
Subject: [PATCH] Merge branch 'master' of http://git.homecommunity.cn/supervip/MicroCommunity

---
 service-fee/src/main/java/com/java110/fee/cmd/payFeeBatch/UpdatePayFeeBatchCmd.java |   28 +++++++++++++++++++++++++++-
 1 files changed, 27 insertions(+), 1 deletions(-)

diff --git a/service-fee/src/main/java/com/java110/fee/cmd/payFeeBatch/UpdatePayFeeBatchCmd.java b/service-fee/src/main/java/com/java110/fee/cmd/payFeeBatch/UpdatePayFeeBatchCmd.java
index 04e7518..918c15f 100644
--- a/service-fee/src/main/java/com/java110/fee/cmd/payFeeBatch/UpdatePayFeeBatchCmd.java
+++ b/service-fee/src/main/java/com/java110/fee/cmd/payFeeBatch/UpdatePayFeeBatchCmd.java
@@ -21,8 +21,12 @@
 import com.java110.core.context.ICmdDataFlowContext;
 import com.java110.core.event.cmd.AbstractServiceCmdListener;
 import com.java110.core.event.cmd.CmdEvent;
+import com.java110.dto.payFeeBatch.PayFeeBatchDto;
+import com.java110.intf.fee.IFeeInnerServiceSMO;
 import com.java110.intf.fee.IPayFeeBatchV1InnerServiceSMO;
+import com.java110.po.fee.PayFeePo;
 import com.java110.po.payFeeBatch.PayFeeBatchPo;
+import com.java110.utils.constant.StateConstant;
 import com.java110.utils.exception.CmdException;
 import com.java110.utils.util.Assert;
 import com.java110.utils.util.BeanConvertUtil;
@@ -51,23 +55,45 @@
     @Autowired
     private IPayFeeBatchV1InnerServiceSMO payFeeBatchV1InnerServiceSMOImpl;
 
+    @Autowired
+    private IFeeInnerServiceSMO feeInnerServiceSMOImpl;
+
     @Override
     public void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) {
         Assert.hasKeyAndValue(reqJson, "batchId", "batchId涓嶈兘涓虹┖");
         Assert.hasKeyAndValue(reqJson, "communityId", "communityId涓嶈兘涓虹┖");
+        Assert.hasKeyAndValue(reqJson, "state", "鐘舵�佷笉鑳戒负绌�");
+        Assert.hasKeyAndValue(reqJson, "msg", "娑堟伅涓嶈兘涓虹┖");
     }
 
     @Override
-    @Java110Transactional
+    //@Java110Transactional
+    //杩欓噷涓嶅紑鍚簨鍔★紝鍒犻櫎鍙兘鍑犲崈鏉� 浜嬪姟鍘嬪姏澶ぇ
+
     public void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException {
 
         PayFeeBatchPo payFeeBatchPo = BeanConvertUtil.covertBean(reqJson, PayFeeBatchPo.class);
+        if (StateConstant.AGREE_AUDIT.equals(reqJson.getString("state"))) {
+            payFeeBatchPo.setState(PayFeeBatchDto.STATE_SUCCESS);
+        } else {
+            payFeeBatchPo.setState(PayFeeBatchDto.STATE_FAIL);
+        }
         int flag = payFeeBatchV1InnerServiceSMOImpl.updatePayFeeBatch(payFeeBatchPo);
 
         if (flag < 1) {
             throw new CmdException("鏇存柊鏁版嵁澶辫触");
         }
 
+        if (PayFeeBatchDto.STATE_FAIL.equals(payFeeBatchPo.getState())) {
+            cmdDataFlowContext.setResponseEntity(ResultVo.success());
+            return;
+        }
+
+        PayFeePo feePo = new PayFeePo();
+        feePo.setBatchId(payFeeBatchPo.getBatchId());
+        feePo.setCommunityId(payFeeBatchPo.getCommunityId());
+        feeInnerServiceSMOImpl.deleteFeesByBatch(feePo);
+
         cmdDataFlowContext.setResponseEntity(ResultVo.success());
     }
 }

--
Gitblit v1.8.0