From 2b919980a8c70554a64cb3d03cc95679af4d817f Mon Sep 17 00:00:00 2001
From: Your Name <you@example.com>
Date: 星期一, 03 七月 2023 00:22:16 +0800
Subject: [PATCH] Merge branch 'master' of http://git.homecommunity.cn/supervip/MicroCommunity
---
service-api/src/main/java/com/java110/api/smo/payment/impl/ToPaySMOImpl.java | 158 +++++++++++++++++++++++++++++++++++++++++++++++++++-
1 files changed, 154 insertions(+), 4 deletions(-)
diff --git a/service-api/src/main/java/com/java110/api/smo/payment/impl/ToPaySMOImpl.java b/service-api/src/main/java/com/java110/api/smo/payment/impl/ToPaySMOImpl.java
index 0dcd98c..99ec966 100644
--- a/service-api/src/main/java/com/java110/api/smo/payment/impl/ToPaySMOImpl.java
+++ b/service-api/src/main/java/com/java110/api/smo/payment/impl/ToPaySMOImpl.java
@@ -11,7 +11,10 @@
import com.java110.core.log.LoggerFactory;
import com.java110.dto.app.AppDto;
import com.java110.dto.owner.OwnerAppUserDto;
-import com.java110.dto.smallWeChat.SmallWeChatDto;
+import com.java110.dto.wechat.SmallWeChatDto;
+import com.java110.intf.acct.IAccountDetailInnerServiceSMO;
+import com.java110.intf.acct.IAccountInnerServiceSMO;
+import com.java110.intf.fee.IFeeAccountDetailServiceSMO;
import com.java110.utils.cache.MappingCache;
import com.java110.utils.constant.CommonConstant;
import com.java110.utils.constant.WechatConstant;
@@ -36,8 +39,8 @@
@Service("toPaySMOImpl")
public class ToPaySMOImpl extends AppAbstractComponentSMO implements IToPaySMO {
- private static final Logger logger = LoggerFactory.getLogger(AppAbstractComponentSMO.class);
+ private static final Logger logger = LoggerFactory.getLogger(AppAbstractComponentSMO.class);
@Autowired
private RestTemplate restTemplate;
@@ -45,9 +48,17 @@
@Autowired
private RestTemplate outRestTemplate;
-
@Autowired
private WechatAuthProperties wechatAuthProperties;
+
+ @Autowired
+ private IAccountInnerServiceSMO accountInnerServiceSMOImpl;
+
+ @Autowired
+ private IAccountDetailInnerServiceSMO accountDetailInnerServiceSMOImpl;
+
+ @Autowired
+ private IFeeAccountDetailServiceSMO feeAccountDetailServiceSMOImpl;
@Override
public ResponseEntity<String> toPay(IPageData pd) {
@@ -93,7 +104,7 @@
String orderId = orderInfo.getString("oId");
String feeName = orderInfo.getString("feeName");
double money = Double.parseDouble(orderInfo.getString("receivedAmount"));
- //闇�瑕佸垽鏂噾棰濇槸鍚� == 0 绛変簬0 鐩存帴鎺夌即璐归�氱煡鎺ュ彛
+ //闇�瑕佸垽鏂噾棰濇槸鍚� == 0 绛変簬0 鐩存帴璋冪即璐归�氱煡鎺ュ彛
if (money <= 0) {
JSONObject paramOut = new JSONObject();
paramOut.put("oId", orderId);
@@ -109,6 +120,145 @@
if (ResultVo.CODE_OK != result.getInteger("code")) {
return responseEntity;
}
+ // 鍚村鏂� 杩欎釜浠g爜鍐欑殑鏈夐棶棰� 宸茬粡鍦� payFeeConfirm 杩欓噷澶勭悊杩囩幇閲戜簡 杩欓噷杩樺鐞嗕竴閬� 閫昏緫涓婃湁闂 锛岃绉绘鍒� fee.payFeeConfirm 涓鐞�
+// if (paramIn.containsKey("selectUserAccount") && !StringUtil.isEmpty(paramIn.getString("selectUserAccount"))) {
+// String selectUserAccount = paramIn.getString("selectUserAccount");
+// JSONArray params = JSONArray.parseArray(selectUserAccount);
+// for (int paramIndex = 0; paramIndex < params.size(); paramIndex++) {
+// JSONObject paramObj = params.getJSONObject(paramIndex);
+// if (!StringUtil.isEmpty(paramObj.getString("acctType")) && paramObj.getString("acctType").equals("2004")) { //绉垎璐︽埛
+// //璐︽埛閲戦
+// BigDecimal amount = new BigDecimal(paramObj.getString("amount"));
+// //鑾峰彇鏈�澶ф姷鎵gН鍒�
+// BigDecimal maximumNumber = new BigDecimal(paramObj.getString("maximumNumber"));
+// //鑾峰彇绉垎鎶垫墸姣斾緥
+// BigDecimal deductionProportion = new BigDecimal(paramObj.getString("deductionProportion"));
+// int flag = amount.compareTo(maximumNumber);
+// BigDecimal redepositAmount = new BigDecimal("0.00");
+// BigDecimal integralAmount = new BigDecimal("0.00");
+// if (flag == 1) { //璐︽埛绉垎澶т簬鏈�澶т娇鐢ㄧН鍒嗭紝灏辩敤鏈�澶т娇鐢ㄧН鍒嗘姷鎵�
+// redepositAmount = maximumNumber;
+// integralAmount = amount.subtract(maximumNumber);
+// }
+// if (flag > -1) { //璐︽埛绉垎澶т簬绛変簬鏈�澶т娇鐢ㄧН鍒嗭紝灏辩敤鏈�澶т娇鐢ㄧН鍒嗘姷鎵�
+// redepositAmount = maximumNumber;
+// integralAmount = amount.subtract(maximumNumber);
+// }
+// if (flag == -1) { //璐︽埛绉垎灏忎簬鏈�澶т娇鐢ㄧН鍒嗭紝灏辩敤璐︽埛绉垎鎶垫墸
+// redepositAmount = amount;
+// }
+// if (flag < 1) { //璐︽埛绉垎灏忎簬绛変簬鏈�澶т娇鐢ㄧН鍒嗭紝灏辩敤璐︽埛绉垎鎶垫墸
+// redepositAmount = amount;
+// }
+// if (flag == 0) { //璐︽埛绉垎绛変簬鏈�澶т娇鐢ㄧН鍒�
+// redepositAmount = amount;
+// }
+// //鏇存柊璐︽埛淇℃伅
+// AccountPo accountPo = new AccountPo();
+// accountPo.setAcctId(paramObj.getString("acctId"));
+// accountPo.setAmount(integralAmount.toString());
+// accountInnerServiceSMOImpl.updateAccount(accountPo);
+// //鐢熸垚璐︽埛璇︽儏
+// AccountDetailPo accountDetailPo = new AccountDetailPo();
+// accountDetailPo.setDetailId(GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_detailId));
+// accountDetailPo.setAcctId(paramObj.getString("acctId"));
+// accountDetailPo.setDetailType("2002"); //1001 杞叆 2002 杞嚭
+// accountDetailPo.setRelAcctId("-1");
+// accountDetailPo.setAmount(redepositAmount.toString());
+// accountDetailPo.setObjType("6006"); //6006 涓汉 7007 鍟嗘埛
+// accountDetailPo.setObjId(paramObj.getString("objId"));
+// accountDetailPo.setOrderId("-1");
+// accountDetailPo.setbId("-1");
+// accountDetailPo.setRemark("鎵嬫満绔Н鍒嗘姷鎵�");
+// accountDetailPo.setCreateTime(new Date());
+// accountDetailInnerServiceSMOImpl.saveAccountDetails(accountDetailPo);
+// //璁$畻绉垎鎹㈢畻鐨勯噾棰�
+// BigDecimal divide = redepositAmount.divide(deductionProportion);
+// BigDecimal deductionAmount = new BigDecimal(paramIn.getString("deductionAmount"));
+// //璁$畻瀹炰粯閲戦
+// int flag2 = divide.compareTo(deductionAmount);
+// BigDecimal subtract = new BigDecimal("0.00");
+// //鐢熸垚鎶垫墸鏄庣粏璁板綍
+// FeeAccountDetailPo feeAccountDetailPo = new FeeAccountDetailPo();
+// if (flag2 == -1) { //绉垎鎹㈢畻閲戦灏忎簬搴斾粯閲戦
+// subtract = deductionAmount.subtract(divide);
+// BigDecimal multiply = divide.multiply(deductionProportion);
+// feeAccountDetailPo.setAmount(multiply.toString()); //绉垎鎶垫墸閲戦
+// } else if (flag < 1) { //绉垎鎹㈢畻閲戦灏忎簬绛変簬搴斾粯閲戦
+// subtract = deductionAmount.subtract(divide);
+// BigDecimal multiply = divide.multiply(deductionProportion);
+// feeAccountDetailPo.setAmount(multiply.toString()); //绉垎鎶垫墸閲戦
+// } else {
+// BigDecimal multiply = deductionAmount.multiply(deductionProportion);
+// feeAccountDetailPo.setAmount(multiply.toString()); //绉垎鎶垫墸閲戦
+// }
+// paramIn.put("receivedMoney", subtract);
+//// payFeeDetailPo.setReceivedAmount(subtract.toString());
+// feeAccountDetailPo.setFadId(GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_fadId));
+// feeAccountDetailPo.setDetailId(accountDetailPo.getDetailId());
+// feeAccountDetailPo.setCommunityId(paramObj.getString("communityId"));
+// feeAccountDetailPo.setState("1003"); //1001 鏃犳姷鎵� 1002 鐜伴噾璐︽埛鎶垫墸 1003 绉垎璐︽埛鎶垫墸 1004 浼樻儬鍒告姷鎵�
+// feeAccountDetailServiceSMOImpl.saveFeeAccountDetail(feeAccountDetailPo);
+// } else if (!StringUtil.isEmpty(paramObj.getString("acctType")) && paramObj.getString("acctType").equals("2003")) { //鐜伴噾璐︽埛
+// //璐︽埛閲戦
+// BigDecimal amount = new BigDecimal(paramObj.getString("amount"));
+// //鑾峰彇搴旀敹閲戦
+// BigDecimal deductionAmount = new BigDecimal("0.00");
+// if (paramIn.containsKey("receivedMoney") && !StringUtil.isEmpty(paramIn.getString("receivedMoney"))) {
+// deductionAmount = new BigDecimal(paramIn.getString("receivedMoney"));
+// } else {
+// deductionAmount = new BigDecimal(paramIn.getString("deductionAmount"));
+// }
+// int flag = amount.compareTo(deductionAmount);
+// BigDecimal redepositAmount = new BigDecimal("0.00");
+// BigDecimal integralAmount = new BigDecimal("0.00");
+// if (flag == 1) { //鐜伴噾璐︽埛澶т簬搴旀敹閲戦锛屽氨鐢ㄥ簲鏀堕噾棰濇姷鎵�
+// redepositAmount = deductionAmount;
+// integralAmount = amount.subtract(deductionAmount);
+// }
+// if (flag > -1) { //鐜伴噾璐︽埛澶т簬绛変簬搴旀敹閲戦锛屽氨鐢ㄥ簲鏀堕噾棰濇姷鎵�
+// redepositAmount = deductionAmount;
+// integralAmount = amount.subtract(deductionAmount);
+// }
+// if (flag == -1) { //鐜伴噾璐︽埛灏忎簬瀹炴敹閲戦锛屽氨鐢ㄧ幇閲戣处鎴锋姷鎵�
+// redepositAmount = amount;
+// }
+// if (flag < 1) { //鐜伴噾璐︽埛灏忎簬绛変簬搴旀敹閲戦锛屽氨鐢ㄧ幇閲戣处鎴锋姷鎵�
+// redepositAmount = amount;
+// }
+// if (flag == 0) { //鐜伴噾璐︽埛绛変簬搴旀敹閲戦
+// redepositAmount = amount;
+// }
+// //鏇存柊璐︽埛淇℃伅
+// AccountPo accountPo = new AccountPo();
+// accountPo.setAcctId(paramObj.getString("acctId"));
+// accountPo.setAmount(integralAmount.toString());
+// accountInnerServiceSMOImpl.updateAccount(accountPo);
+// //鐢熸垚璐︽埛璇︽儏
+// AccountDetailPo accountDetailPo = new AccountDetailPo();
+// accountDetailPo.setDetailId(GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_detailId));
+// accountDetailPo.setAcctId(paramObj.getString("acctId"));
+// accountDetailPo.setDetailType("2002"); //1001 杞叆 2002 杞嚭
+// accountDetailPo.setRelAcctId("-1");
+// accountDetailPo.setAmount(redepositAmount.toString());
+// accountDetailPo.setObjType("6006"); //6006 涓汉 7007 鍟嗘埛
+// accountDetailPo.setObjId(paramObj.getString("objId"));
+// accountDetailPo.setOrderId("-1");
+// accountDetailPo.setbId("-1");
+// accountDetailPo.setRemark("鎵嬫満绔幇閲戣处鎴锋姷鎵�");
+// accountDetailPo.setCreateTime(new Date());
+// accountDetailInnerServiceSMOImpl.saveAccountDetails(accountDetailPo);
+// //鐢熸垚鎶垫墸鏄庣粏璁板綍
+// FeeAccountDetailPo feeAccountDetailPo = new FeeAccountDetailPo();
+// feeAccountDetailPo.setFadId(GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_fadId));
+// feeAccountDetailPo.setDetailId(accountDetailPo.getDetailId());
+// feeAccountDetailPo.setCommunityId(paramIn.getString("communityId"));
+// feeAccountDetailPo.setState("1002"); //1001 鏃犳姷鎵� 1002 鐜伴噾璐︽埛鎶垫墸 1003 绉垎璐︽埛鎶垫墸 1004 浼樻儬鍒告姷鎵�
+// feeAccountDetailPo.setAmount(redepositAmount.toString()); //绉垎鎶垫墸閲戦
+// feeAccountDetailServiceSMOImpl.saveFeeAccountDetail(feeAccountDetailPo);
+// }
+// }
+// }
param.put("code", "100");
param.put("msg", "鎵h垂涓�0鍥炶皟鎴愬姛");
return new ResponseEntity(JSONObject.toJSONString(param), HttpStatus.OK);
--
Gitblit v1.8.0