Browse Source

支付单信息入库接口代码逻辑修改,以及商户支付单配置信息接口逻辑修改

hyq 7 years ago
parent
commit
552cee2c7d

+ 10 - 0
src/main/java/com/emato/cuspay/dto/wx/WxCbPayDoc.java

@@ -84,12 +84,22 @@ public class WxCbPayDoc implements Serializable {
 
     private String exField5;
 
+    private String platNo;
+
     private static final long serialVersionUID = 1L;
 
     public WxCbPayDoc() {
         super();
     }
 
+    public String getPlatNo() {
+        return platNo;
+    }
+
+    public void setPlatNo(String platNo) {
+        this.platNo = platNo == null ? null : platNo.trim();
+    }
+
     public String getWxPaySn() {
         return wxPaySn;
     }

+ 1 - 1
src/main/java/com/emato/cuspay/service/merch/impl/MerchPaymentServiceImpl.java

@@ -23,7 +23,7 @@ public class MerchPaymentServiceImpl implements MerchPaymentService{
     private MerchPayCfgMapper merchPayCfgMapper;
 
     public ResponseMessage addMerchPayCfg(MerchPayCfg merchPayCfg) {
-        merchPayCfg.setMerchSn(TablePrimaryKeyPrefix.merch_pay_cfg_type + IdWorkerAide.nextId());
+        merchPayCfg.setPayCfgSn(TablePrimaryKeyPrefix.merch_pay_cfg_type + IdWorkerAide.nextId());
         int result = merchPayCfgMapper.insertSelective(merchPayCfg);
         if (result > 0) {
             return ResponseMessage.builder(ResponseStatus.SUCCESS.getItem(), "添加成功").build();

+ 3 - 3
src/main/java/com/emato/cuspay/service/wx/impl/WxCbPayDocServiceImpl.java

@@ -4,6 +4,7 @@ import com.emato.cuspay.common.contant.Dict;
 import com.emato.cuspay.common.contant.TablePrimaryKeyPrefix;
 import com.emato.cuspay.common.core.db.IdWorkerAide;
 import com.emato.cuspay.dao.mapper.merch.MerchCusCfgMapper;
+import com.emato.cuspay.dao.mapper.merch.MerchPayCfgMapper;
 import com.emato.cuspay.dao.mapper.wx.WxCbPayDocMapper;
 import com.emato.cuspay.dto.merch.MerchCusCfg;
 import com.emato.cuspay.dto.wx.WxCbPayDoc;
@@ -29,7 +30,7 @@ public class WxCbPayDocServiceImpl implements WxCbPayDocService{
     private WxCbPayDocMapper wxCbPayDocMapper;
 
     @Autowired
-    private MerchCusCfgMapper merchCusCfgMapper;
+    private MerchPayCfgMapper merchPayCfgMapper;
 
     /**
      * 支付单信息入库
@@ -42,8 +43,7 @@ public class WxCbPayDocServiceImpl implements WxCbPayDocService{
         wxCbPayDoc.setDocStatus(Dict.PaymentDocStatus.i_00.getItem());
         String merchSn = wxCbPayDoc.getMerchSn();
 
-        List<MerchCusCfg> list = merchCusCfgMapper.getMerchCusCfgByMerchSn(merchSn);
-        if(list.size() == 0){
+        if(merchPayCfgMapper.selectByWxMercherSn(merchSn) == null){
             return  new ResponseMessage.Builder().setCode(ResponseStatus.ERROR.getItem()).setMsg("商户编号为"+merchSn+"的支付配置信息不存在")
                     .build();
         }

+ 1 - 2
src/main/java/com/emato/cuspay/web/controller/merch/MerchPaymentController.java

@@ -40,9 +40,8 @@ public class MerchPaymentController {
         Map<String, Object> beVerified = Maps.newHashMap();
 
         beVerified.put("merchSn", "商户编号");
-        beVerified.put("appKey","api密钥");
+        beVerified.put("merchWxApiKey","api密钥");
         beVerified.put("notifyUrl","商户通知回调接口");
-        beVerified.put("sign","签名");
         beVerified.put("payChnlFlag", "支付通道标识(weixin:微信,alipay:蚂蚁金服)");
 
         ResponseMessage rst = Validator.isEmpty(beVerified, validate);

+ 1 - 0
src/main/java/com/emato/cuspay/web/controller/wx/WxCusController.java

@@ -93,6 +93,7 @@ public class WxCusController {
         beVerified.put("transactionId","微信支付订单号");
         beVerified.put("customs","报送海关");
         beVerified.put("mchCustomsNo","商户海关备案号");
+        beVerified.put("platNo","接入平台内部编号");
 
         ResponseMessage rst = Validator.isEmpty(beVerified, validate);
         if (ResponseStatus.ERROR.getItem().equals(rst.getCode())) {

+ 15 - 5
src/main/resources/mybatis/mapper/MerchPayCfgMapper.xml

@@ -4,6 +4,7 @@
   <resultMap id="BaseResultMap" type="com.emato.cuspay.dto.merch.MerchPayCfg" >
     <id column="pay_cfg_sn" property="payCfgSn" jdbcType="VARCHAR" />
     <result column="merch_sn" property="merchSn" jdbcType="VARCHAR" />
+    <result column="merch_wx_api_key" property="merchWxApiKey" jdbcType="VARCHAR" />
     <result column="notify_url" property="notifyUrl" jdbcType="VARCHAR" />
     <result column="pay_chnl_flag" property="payChnlFlag" jdbcType="VARCHAR" />
     <result column="is_valid" property="isValid" jdbcType="CHAR" />
@@ -15,12 +16,12 @@
     <result column="tstm" property="tstm" jdbcType="TIMESTAMP" />
   </resultMap>
   <sql id="Base_Column_List" >
-    pay_cfg_sn, merch_sn,  notify_url, pay_chnl_flag, is_valid, remark, creater_sn, create_time, moder_sn,
+    pay_cfg_sn, merch_sn, merch_wx_api_key, notify_url, pay_chnl_flag, is_valid, remark, creater_sn, create_time, moder_sn,
     mod_time, tstm
   </sql>
 
   <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
-    select 
+    select
     <include refid="Base_Column_List" />
     from merch_pay_cfg
     where pay_cfg_sn = #{payCfgSn,jdbcType=VARCHAR}
@@ -38,6 +39,9 @@
       <if test="merchSn != null" >
         merch_sn,
       </if>
+      <if test="merchWxApiKey != null" >
+        merch_wx_api_key,
+      </if>
       <if test="notifyUrl != null">
         notify_url,
       </if>
@@ -73,6 +77,9 @@
       <if test="merchSn != null" >
         #{merchSn,jdbcType=VARCHAR},
       </if>
+      <if test="merchWxApiKey != null" >
+        #{merchWxApiKey,jdbcType=VARCHAR},
+      </if>
       <if test="notifyUrl != null">
         #{notifyUrl,jdbcType=VARCHAR},
       </if>
@@ -108,6 +115,9 @@
       <if test="merchSn != null" >
         merch_sn = #{merchSn,jdbcType=VARCHAR},
       </if>
+      <if test="merchWxApiKey != null" >
+        merch_wx_api_key = #{merchWxApiKey,jdbcType=VARCHAR},
+      </if>
       <if test="notify_url != null">
         notify_url = #{notifyUrl, jdbcType=VARCHAR},
       </if>
@@ -140,8 +150,8 @@
   </update>
 
   <select id="selectByWxMercherSn" resultMap="BaseResultMap" parameterType="java.lang.String">
-      SELECT
-      <include refid="Base_Column_List" />
-      FROM merch_pay_cfg WHERE merch_sn = #{merchSn} AND pay_chnl_flag = "weixin"
+    SELECT
+    <include refid="Base_Column_List" />
+    FROM merch_pay_cfg WHERE merch_sn = #{merchSn} AND pay_chnl_flag = "weixin"
   </select>
 </mapper>

+ 13 - 1
src/main/resources/mybatis/mapper/wx/WxCbPayDocMapper.xml

@@ -42,9 +42,10 @@
     <result column="ex_field3" property="exField3" jdbcType="VARCHAR" />
     <result column="ex_field4" property="exField4" jdbcType="VARCHAR" />
     <result column="ex_field5" property="exField5" jdbcType="VARCHAR" />
+    <result column="plat_no" property="platNo" jdbcType="VARCHAR" />
   </resultMap>
   <sql id="Base_Column_List" >
-    wx_pay_sn, merch_sn, merch_name, plat_sn, plat_name, third_party_merch_code, third_party_merch_name, 
+    wx_pay_sn, merch_sn, merch_name, plat_no, plat_sn, plat_name, third_party_merch_code, third_party_merch_name,
     appid, mch_id, out_trade_no, transaction_id, customs, mch_customs_no, duty, action_type,
     sub_order_no, fee_type, order_fee, transport_fee, product_fee, cert_type, cert_id, 
     name, doc_status, remark, return_code, return_msg, result_code, err_code, err_code_des,
@@ -75,6 +76,9 @@
       <if test="merchName != null" >
         merch_name,
       </if>
+      <if test="platNo != null" >
+        plat_no,
+      </if>
       <if test="platSn != null" >
         plat_sn,
       </if>
@@ -197,6 +201,9 @@
       <if test="merchName != null" >
         #{merchName,jdbcType=VARCHAR},
       </if>
+      <if test="platNo != null" >
+        #{platNo,jdbcType=VARCHAR},
+      </if>
       <if test="platSn != null" >
         #{platSn,jdbcType=VARCHAR},
       </if>
@@ -320,6 +327,9 @@
       <if test="merchName != null" >
         merch_name = #{merchName,jdbcType=VARCHAR},
       </if>
+      <if test="platNo != null" >
+        plat_no = #{platNo,jdbcType=VARCHAR},
+      </if>
       <if test="platSn != null" >
         plat_sn = #{platSn,jdbcType=VARCHAR},
       </if>
@@ -455,6 +465,7 @@
       wx_pay_sn,
       merch_sn,
       merch_name,
+      plat_no,
       plat_sn,
       plat_name,
       third_party_merch_code,
@@ -498,6 +509,7 @@
           #{wxPaySn,jdbcType=VARCHAR},
           #{merchSn,jdbcType=VARCHAR},
           #{merchName,jdbcType=VARCHAR},
+          #{platNo,jdbcType=VARCHAR}
           #{platSn,jdbcType=VARCHAR},
           #{platName,jdbcType=VARCHAR},
           #{thirdPartyMerchCode,jdbcType=VARCHAR},