wuxw 3 éve%!(EXTRA string=óta)
szülő
commit
5333b8e709

+ 10 - 0
java110-bean/src/main/java/com/java110/dto/payment/PaymentOrderDto.java

@@ -19,6 +19,8 @@ public class PaymentOrderDto implements Serializable{
 
     private String appId;
 
+    private String openId;
+
 
     private ResponseEntity<String> responseEntity;
 
@@ -63,4 +65,12 @@ public class PaymentOrderDto implements Serializable{
     public void setAppId(String appId) {
         this.appId = appId;
     }
+
+    public String getOpenId() {
+        return openId;
+    }
+
+    public void setOpenId(String openId) {
+        this.openId = openId;
+    }
 }

+ 1 - 1
service-acct/src/main/java/com/java110/acct/cmd/payment/UnifiedPaymentCmd.java

@@ -96,7 +96,7 @@ public class UnifiedPaymentCmd extends Cmd{
         }
 
         //2.0 相应业务 下单 返回 单号 ,金额,
-        PaymentOrderDto paymentOrderDto =  paymentBusiness.unified(reqJson);
+        PaymentOrderDto paymentOrderDto =  paymentBusiness.unified(context,reqJson);
 
         logger.debug(">>>>>>>>>>>>>>>>支付业务下单返回,{}",JSONObject.toJSONString(paymentOrderDto));
 

+ 2 - 1
service-acct/src/main/java/com/java110/acct/payment/IPaymentBusiness.java

@@ -1,6 +1,7 @@
 package com.java110.acct.payment;
 
 import com.alibaba.fastjson.JSONObject;
+import com.java110.core.context.ICmdDataFlowContext;
 import com.java110.dto.payment.PaymentOrderDto;
 
 /**
@@ -14,7 +15,7 @@ public interface IPaymentBusiness {
      * @param reqJson
      * @return
      */
-    PaymentOrderDto unified(JSONObject reqJson);
+    PaymentOrderDto unified(ICmdDataFlowContext context,JSONObject reqJson);
 
     /**
      * 支付完通知接口

+ 2 - 1
service-acct/src/main/java/com/java110/acct/payment/business/oweFee/OweFeePaymentBusiness.java

@@ -3,6 +3,7 @@ package com.java110.acct.payment.business.oweFee;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.java110.acct.payment.IPaymentBusiness;
+import com.java110.core.context.ICmdDataFlowContext;
 import com.java110.core.factory.CallApiServiceFactory;
 import com.java110.core.factory.CommunitySettingFactory;
 import com.java110.core.factory.GenerateCodeFactory;
@@ -73,7 +74,7 @@ public class OweFeePaymentBusiness implements IPaymentBusiness{
 
 
     @Override
-    public PaymentOrderDto unified(JSONObject reqJson) {
+    public PaymentOrderDto unified(ICmdDataFlowContext context,JSONObject reqJson) {
 
         String ownerId = reqJson.getString("ownerId");
         String roomId = reqJson.getString("roomId");

+ 52 - 0
service-acct/src/main/java/com/java110/acct/payment/business/payFee/PayFeePaymentBusiness.java

@@ -0,0 +1,52 @@
+package com.java110.acct.payment.business.payFee;
+
+import com.alibaba.fastjson.JSONObject;
+import com.java110.acct.payment.IPaymentBusiness;
+import com.java110.core.context.ICmdDataFlowContext;
+import com.java110.core.factory.CallApiServiceFactory;
+import com.java110.core.log.LoggerFactory;
+import com.java110.dto.fee.FeeDto;
+import com.java110.dto.payment.PaymentOrderDto;
+import com.java110.utils.cache.CommonCache;
+import org.slf4j.Logger;
+import org.springframework.stereotype.Service;
+
+
+/**
+ * 房屋费 停车费缴费
+ */
+@Service("payFee")
+public class PayFeePaymentBusiness implements IPaymentBusiness {
+
+
+    private final static Logger logger = LoggerFactory.getLogger(PayFeePaymentBusiness.class);
+
+
+    @Override
+    public PaymentOrderDto unified(ICmdDataFlowContext context, JSONObject reqJson) {
+
+        String appId = context.getReqHeaders().get("app-id");
+        String userId = context.getReqHeaders().get("user-id");
+        JSONObject orderInfo = CallApiServiceFactory.postForApi(appId, reqJson, "fee.payFeePre", JSONObject.class, userId);
+        String orderId = orderInfo.getString("oId");
+        String feeName = orderInfo.getString("feeName");
+        double money = Double.parseDouble(orderInfo.getString("receivedAmount"));
+
+        PaymentOrderDto paymentOrderDto = new PaymentOrderDto();
+        paymentOrderDto.setOrderId(orderId);
+        paymentOrderDto.setMoney(money);
+        paymentOrderDto.setName(feeName);
+        return paymentOrderDto;
+    }
+
+    @Override
+    public void notifyPayment(PaymentOrderDto paymentOrderDto, JSONObject reqJson) {
+
+
+        JSONObject paramIn = new JSONObject();
+        paramIn.put("oId", paymentOrderDto.getOrderId());
+        JSONObject paramOut = CallApiServiceFactory.postForApi(paymentOrderDto.getAppId(), reqJson, "fee.payFeeConfirm", JSONObject.class, "-1");
+
+    }
+
+}

+ 99 - 0
service-acct/src/main/java/com/java110/acct/payment/business/tempCarFee/TempCarFeePaymentBusiness.java

@@ -0,0 +1,99 @@
+package com.java110.acct.payment.business.tempCarFee;
+
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.java110.acct.payment.IPaymentBusiness;
+import com.java110.core.context.ICmdDataFlowContext;
+import com.java110.core.factory.CallApiServiceFactory;
+import com.java110.core.factory.GenerateCodeFactory;
+import com.java110.core.log.LoggerFactory;
+import com.java110.dto.fee.FeeDto;
+import com.java110.dto.ownerCarOpenUser.OwnerCarOpenUserDto;
+import com.java110.dto.payment.PaymentOrderDto;
+import com.java110.intf.user.IOwnerCarOpenUserV1InnerServiceSMO;
+import com.java110.po.ownerCarOpenUser.OwnerCarOpenUserPo;
+import com.java110.utils.cache.CommonCache;
+import com.java110.utils.util.Assert;
+import org.apache.commons.lang.StringUtils;
+import org.slf4j.Logger;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.ArrayList;
+import java.util.List;
+
+
+/**
+ * 房屋费 停车费缴费
+ */
+@Service("tempCarFee")
+public class TempCarFeePaymentBusiness implements IPaymentBusiness {
+
+
+    private final static Logger logger = LoggerFactory.getLogger(TempCarFeePaymentBusiness.class);
+
+    @Autowired
+    private IOwnerCarOpenUserV1InnerServiceSMO ownerCarOpenUserV1InnerServiceSMOImpl;
+
+
+
+
+    @Override
+    public PaymentOrderDto unified(ICmdDataFlowContext context, JSONObject reqJson) {
+
+        Assert.jsonObjectHaveKey(reqJson, "carNum", "请求报文中未包含房屋信息节点");
+        Assert.jsonObjectHaveKey(reqJson, "appId", "请求报文中未包含appId节点");
+        Assert.jsonObjectHaveKey(reqJson, "openId", "请求报文中未包含openId节点");
+        Assert.jsonObjectHaveKey(reqJson, "paId", "请求报文中未包含paId节点");
+        Assert.jsonObjectHaveKey(reqJson, "inoutId", "请求报文中未包含inoutId节点");
+        Assert.jsonObjectHaveKey(reqJson, "couponList", "请求报文中未包含couponList节点");
+
+        JSONArray couponList = reqJson.getJSONArray("couponList");
+        List<String> couponIds = new ArrayList<String>();
+        if (couponList != null && couponList.size() > 0) {
+            for (int couponIndex = 0; couponIndex < couponList.size(); couponIndex++) {
+                couponIds.add(couponList.getJSONObject(couponIndex).getString("couponId"));
+            }
+        }
+
+        String appId = context.getReqHeaders().get("app-id");
+        String userId = context.getReqHeaders().get("user-id");
+        String url = "tempCarFee.queryTempCarFeeOrder?paId=" + reqJson.getString("paId")
+                + "&carNum=" + reqJson.getString("carNum")
+                + "&machineId=" + reqJson.getString("machineId")
+                +"&couponIds="+ StringUtils.join(couponIds,",");
+        JSONObject fee = CallApiServiceFactory.getForApi(appId, null, url, JSONObject.class);
+        double money = fee.getDouble("receivedAmount");
+        String orderId = fee.getString("oId");
+        String feeName = reqJson.getString("carNum");
+
+        PaymentOrderDto paymentOrderDto = new PaymentOrderDto();
+        paymentOrderDto.setOrderId(orderId);
+        paymentOrderDto.setMoney(money);
+        paymentOrderDto.setName(feeName+"停车费");
+
+
+        OwnerCarOpenUserPo ownerCarOpenUserPo = new OwnerCarOpenUserPo();
+        ownerCarOpenUserPo.setCarNum(reqJson.getString("carNum"));
+        ownerCarOpenUserPo.setNickname("未获取");
+        ownerCarOpenUserPo.setHeadimgurl("未获取");
+        ownerCarOpenUserPo.setOpenId(reqJson.getString("openId"));
+        ownerCarOpenUserPo.setOpenType(OwnerCarOpenUserDto.OPEN_TYPE_WECHAT);
+        ownerCarOpenUserPo.setOpenUserId(GenerateCodeFactory.getGeneratorId("10"));
+        ownerCarOpenUserV1InnerServiceSMOImpl.saveOwnerCarOpenUser(ownerCarOpenUserPo);
+
+
+        return paymentOrderDto;
+    }
+
+    @Override
+    public void notifyPayment(PaymentOrderDto paymentOrderDto, JSONObject reqJson) {
+
+        JSONObject paramIn = new JSONObject();
+        paramIn.put("oId", paymentOrderDto.getOrderId());
+        JSONObject paramOut = CallApiServiceFactory.postForApi(paymentOrderDto.getAppId(), reqJson, "tempCarFee.notifyTempCarFeeOrder", JSONObject.class, "-1");
+
+
+    }
+
+}

+ 2 - 1
service-acct/src/main/java/com/java110/acct/payment/business/venue/VenueReservationPaymentBusiness.java

@@ -3,6 +3,7 @@ package com.java110.acct.payment.business.venue;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.java110.acct.payment.IPaymentBusiness;
+import com.java110.core.context.ICmdDataFlowContext;
 import com.java110.core.factory.GenerateCodeFactory;
 import com.java110.dto.communitySpace.CommunitySpaceDto;
 import com.java110.dto.communitySpacePerson.CommunitySpacePersonDto;
@@ -43,7 +44,7 @@ public class VenueReservationPaymentBusiness implements IPaymentBusiness{
     private ICommunitySpacePersonTimeV1InnerServiceSMO communitySpacePersonTimeV1InnerServiceSMOImpl;
 
     @Override
-    public PaymentOrderDto unified(JSONObject reqJson) {
+    public PaymentOrderDto unified(ICmdDataFlowContext context,JSONObject reqJson) {
 
         Assert.hasKeyAndValue(reqJson, "spaceId", "请求报文中未包含spaceId");
         Assert.hasKeyAndValue(reqJson, "personName", "请求报文中未包含personName");