Explorar el Código

Merge branch 'master' of hyq/ccnet-wx-mp3.0 into master

黄亚琴 hace 5 años
padre
commit
5e1fef630f

+ 10 - 0
src/main/java/com/emato/ccnet/wx/dao/entity/ccnet/WxOrder.java

@@ -149,6 +149,8 @@ public class WxOrder implements Serializable {
 
     private String placeOrderlTimeStr;
 
+    private String failMsg;
+
     private static final long serialVersionUID = 1L;
 
     public WxOrder() {
@@ -731,4 +733,12 @@ public class WxOrder implements Serializable {
     public void setExField5(String exField5) {
         this.exField5 = exField5 == null ? null : exField5.trim();
     }
+
+    public String getFailMsg() {
+        return failMsg;
+    }
+
+    public void setFailMsg(String failMsg) {
+        this.failMsg = failMsg;
+    }
 }

+ 145 - 16
src/main/resources/mybatis/mapper/ccnet/biz/WxOrderBizMapper.xml

@@ -488,21 +488,150 @@
         where order_sn = #{orderSn,jdbcType=VARCHAR}
     </select>
 
-
-    <select id="getResendWxOrder" resultMap="BaseResultMap" parameterType="java.lang.String" >
-        select
-        <include refid="Base_Column_List" />
-        from wx_order where 1 = 1
-        <if test="wxOrderDetail != null">
-            and wx_order_detail = #{wxOrderDetail,jdbcType=CHAR}
-        </if>
-        <if test="buyerPayCheck != null">
-            and buyer_pay_check = #{buyerPayCheck,jdbcType=CHAR}
-        </if>
-        <if test="clecOrderStatus != null and wayOrderStatus != null and playOrderStatus != null and projectCheckStatus != null">
-            and (clec_order_status = #{clecOrderStatus,jdbcType=CHAR} or way_order_status = #{wayOrderStatus,jdbcType=CHAR}
-            or play_order_status = #{playOrderStatus,jdbcType=CHAR} or project_check_status = #{projectCheckStatus,jdbcType=CHAR})
-        </if>
-        ORDER BY wx_order_sn
+    <resultMap id="BaseResultMap2" type="com.emato.ccnet.wx.dao.entity.ccnet.WxOrder" >
+        <id column="wx_order_sn" property="wxOrderSn" jdbcType="VARCHAR" />
+        <result column="merch_order_id" property="merchOrderId" jdbcType="VARCHAR" />
+        <result column="order_sn" property="orderSn" jdbcType="VARCHAR" />
+        <result column="wx_order_id" property="wxOrderId" jdbcType="VARCHAR" />
+        <result column="merch_sn" property="merchSn" jdbcType="VARCHAR" />
+        <result column="merch_name" property="merchName" jdbcType="VARCHAR" />
+        <result column="plat_sn" property="platSn" jdbcType="VARCHAR" />
+        <result column="plat_name" property="platName" jdbcType="VARCHAR" />
+        <result column="third_party_merch_code" property="thirdPartyMerchCode" jdbcType="VARCHAR" />
+        <result column="third_party_merch_name" property="thirdPartyMerchName" jdbcType="VARCHAR" />
+        <result column="place_orderl_time" property="placeOrderlTime" jdbcType="TIMESTAMP" />
+        <result column="auto_send" property="autoSend" jdbcType="CHAR" />
+        <result column="buyer_reg_no" property="buyerRegNo" jdbcType="VARCHAR" />
+        <result column="buyer_bill_time" property="buyerBillTime" jdbcType="TIMESTAMP" />
+        <result column="buyer_id_type" property="buyerIdType" jdbcType="VARCHAR" />
+        <result column="buyer_id_code" property="buyerIdCode" jdbcType="VARCHAR" />
+        <result column="buyer_name" property="buyerName" jdbcType="VARCHAR" />
+        <result column="buyer_tel" property="buyerTel" jdbcType="VARCHAR" />
+        <result column="consignee_id_type" property="consigneeIdType" jdbcType="VARCHAR" />
+        <result column="consignee_id_code" property="consigneeIdCode" jdbcType="VARCHAR" />
+        <result column="consignee_name" property="consigneeName" jdbcType="VARCHAR" />
+        <result column="consignee_mob" property="consigneeMob" jdbcType="VARCHAR" />
+        <result column="consignee_tel" property="consigneeTel" jdbcType="VARCHAR" />
+        <result column="consignee_country_code" property="consigneeCountryCode" jdbcType="VARCHAR" />
+        <result column="consignee_province_code" property="consigneeProvinceCode" jdbcType="VARCHAR" />
+        <result column="consignee_province" property="consigneeProvince" jdbcType="VARCHAR" />
+        <result column="consignee_city_code" property="consigneeCityCode" jdbcType="VARCHAR" />
+        <result column="consignee_city" property="consigneeCity" jdbcType="VARCHAR" />
+        <result column="consignee_district_code" property="consigneeDistrictCode" jdbcType="VARCHAR" />
+        <result column="consignee_district" property="consigneeDistrict" jdbcType="VARCHAR" />
+        <result column="consignee_address" property="consigneeAddress" jdbcType="VARCHAR" />
+        <result column="consignee_zip_code" property="consigneeZipCode" jdbcType="VARCHAR" />
+        <result column="payer_name" property="payerName" jdbcType="VARCHAR" />
+        <result column="payer_id_type" property="payerIdType" jdbcType="VARCHAR" />
+        <result column="payer_id_code" property="payerIdCode" jdbcType="VARCHAR" />
+        <result column="payer_mob" property="payerMob" jdbcType="VARCHAR" />
+        <result column="pay_ent_cus_code" property="payEntCusCode" jdbcType="VARCHAR" />
+        <result column="pay_no" property="payNo" jdbcType="VARCHAR" />
+        <result column="goods_value" property="goodsValue" jdbcType="DECIMAL" />
+        <result column="freight" property="freight" jdbcType="DECIMAL" />
+        <result column="discount" property="discount" jdbcType="DECIMAL" />
+        <result column="tax_total" property="taxTotal" jdbcType="DECIMAL" />
+        <result column="actural_paid" property="acturalPaid" jdbcType="DECIMAL" />
+        <result column="pay_time" property="payTime" jdbcType="TIMESTAMP" />
+        <result column="expr_type" property="exprType" jdbcType="CHAR" />
+        <result column="expr_comp_id" property="exprCompId" jdbcType="VARCHAR" />
+        <result column="expr_agreement_type" property="exprAgreementType" jdbcType="CHAR" />
+        <result column="decl_expr_fee" property="declExprFee" jdbcType="DECIMAL" />
+        <result column="batch_numbers" property="batchNumbers" jdbcType="VARCHAR" />
+        <result column="decl_post_tax" property="declPostTax" jdbcType="DECIMAL" />
+        <result column="shop_id" property="shopId" jdbcType="VARCHAR" />
+        <result column="extra_tag" property="extraTag" jdbcType="VARCHAR" />
+        <result column="currency_code" property="currencyCode" jdbcType="VARCHAR" />
+        <result column="ws_flag" property="wsFlag" jdbcType="CHAR" />
+        <result column="buyer_pay_check" property="buyerPayCheck" jdbcType="CHAR" />
+        <result column="wx_order_detail" property="wxOrderDetail" jdbcType="CHAR" />
+        <result column="clec_order_status" property="clecOrderStatus" jdbcType="CHAR" />
+        <result column="way_order_status" property="wayOrderStatus" jdbcType="CHAR" />
+        <result column="project_check_status" property="projectCheckStatus" jdbcType="CHAR" />
+        <result column="play_order_status" property="playOrderStatus" jdbcType="CHAR" />
+        <result column="remark" property="remark" jdbcType="VARCHAR" />
+        <result column="creater_sn" property="createrSn" jdbcType="VARCHAR" />
+        <result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
+        <result column="moder_sn" property="moderSn" jdbcType="VARCHAR" />
+        <result column="mod_time" property="modTime" jdbcType="TIMESTAMP" />
+        <result column="tstm" property="tstm" jdbcType="TIMESTAMP" />
+        <result column="ex_field" property="exField" jdbcType="VARCHAR" />
+        <result column="ex_field2" property="exField2" jdbcType="VARCHAR" />
+        <result column="ex_field3" property="exField3" jdbcType="VARCHAR" />
+        <result column="ex_field4" property="exField4" jdbcType="VARCHAR" />
+        <result column="ex_field5" property="exField5" jdbcType="VARCHAR" />
+    </resultMap>
+    <select id="getResendWxOrder" resultMap="BaseResultMap2" parameterType="java.lang.String" >
+        SELECT DISTINCT
+            '支付单' AS 'name',
+                oo.wx_order_sn, oo.merch_order_id, oo.order_sn, oo.wx_order_id, oo.merch_sn, oo.merch_name, oo.plat_sn,
+            oo.plat_name, oo.third_party_merch_code, oo.third_party_merch_name, oo.place_orderl_time, oo.auto_send,
+            oo.buyer_reg_no, oo.buyer_bill_time, oo.buyer_id_type, oo.buyer_id_code, oo.buyer_name, oo.buyer_tel,
+            oo.consignee_id_type, oo.consignee_id_code, oo.consignee_name, oo.consignee_mob, oo.consignee_tel,
+            oo.consignee_country_code, oo.consignee_province_code, oo.consignee_province, oo.consignee_city_code,
+            oo.consignee_city, oo.consignee_district_code, oo.consignee_district, oo.consignee_address, oo.consignee_zip_code,
+            oo.payer_name, oo.payer_id_type, oo.payer_id_code, oo.payer_mob, oo.pay_ent_cus_code, oo.pay_no, oo.goods_value,
+            oo.freight, oo.discount, oo.tax_total, oo.actural_paid, oo.pay_time, oo.expr_type, oo.expr_comp_id, oo.decl_expr_fee,
+            oo.batch_numbers, oo.decl_post_tax, oo.shop_id, oo.extra_tag, oo.currency_code, oo.ws_flag, oo.buyer_pay_check, oo.wx_order_detail, oo.clec_order_status,oo.expr_agreement_type,
+            oo.way_order_status, oo.project_check_status, oo.play_order_status, oo.remark, oo.creater_sn, oo.create_time,
+            oo.moder_sn, oo.mod_time,
+                ww.wx_cuspay_sn 'sn',
+                ww.CODE 'failCode',
+                ww.msg 'failMsg'
+        FROM
+            wx_cuspay_resp ww
+            INNER JOIN wx_pay_doc d ON ww.wx_cuspay_sn = d.wx_cuspay_sn
+            INNER JOIN wx_order oo ON d.out_trade_no = oo.merch_order_id
+        WHERE
+            ( play_order_status = 3 OR project_check_status = 3 )
+            AND cus_decl_status = 13 UNION ALL
+            (
+        SELECT DISTINCT
+            '运单' AS 'name',
+                oo.wx_order_sn, oo.merch_order_id, oo.order_sn, oo.wx_order_id, oo.merch_sn, oo.merch_name, oo.plat_sn,
+            oo.plat_name, oo.third_party_merch_code, oo.third_party_merch_name, oo.place_orderl_time, oo.auto_send,
+            oo.buyer_reg_no, oo.buyer_bill_time, oo.buyer_id_type, oo.buyer_id_code, oo.buyer_name, oo.buyer_tel,
+            oo.consignee_id_type, oo.consignee_id_code, oo.consignee_name, oo.consignee_mob, oo.consignee_tel,
+            oo.consignee_country_code, oo.consignee_province_code, oo.consignee_province, oo.consignee_city_code,
+            oo.consignee_city, oo.consignee_district_code, oo.consignee_district, oo.consignee_address, oo.consignee_zip_code,
+            oo.payer_name, oo.payer_id_type, oo.payer_id_code, oo.payer_mob, oo.pay_ent_cus_code, oo.pay_no, oo.goods_value,
+            oo.freight, oo.discount, oo.tax_total, oo.actural_paid, oo.pay_time, oo.expr_type, oo.expr_comp_id, oo.decl_expr_fee,
+            oo.batch_numbers, oo.decl_post_tax, oo.shop_id, oo.extra_tag, oo.currency_code, oo.ws_flag, oo.buyer_pay_check, oo.wx_order_detail, oo.clec_order_status,oo.expr_agreement_type,
+            oo.way_order_status, oo.project_check_status, oo.play_order_status, oo.remark, oo.creater_sn, oo.create_time,
+            oo.moder_sn, oo.mod_time,
+            ww.cus_waybill_sn 'sn',
+            ww.biz_info_code 'failCode',
+            ww.biz_info_desc 'failMsg'
+        FROM
+            cus_waybill_resp ww
+            INNER JOIN cus_waybill w ON ww.cus_waybill_sn = w.cus_waybill_sn
+            INNER JOIN wx_order oo ON w.merch_order_id = oo.order_sn
+        WHERE
+            way_order_status = 3
+            ) UNION ALL
+            (
+        SELECT DISTINCT
+            '电子订单' AS 'name',
+                oo.wx_order_sn, oo.merch_order_id, oo.order_sn, oo.wx_order_id, oo.merch_sn, oo.merch_name, oo.plat_sn,
+            oo.plat_name, oo.third_party_merch_code, oo.third_party_merch_name, oo.place_orderl_time, oo.auto_send,
+            oo.buyer_reg_no, oo.buyer_bill_time, oo.buyer_id_type, oo.buyer_id_code, oo.buyer_name, oo.buyer_tel,
+            oo.consignee_id_type, oo.consignee_id_code, oo.consignee_name, oo.consignee_mob, oo.consignee_tel,
+            oo.consignee_country_code, oo.consignee_province_code, oo.consignee_province, oo.consignee_city_code,
+            oo.consignee_city, oo.consignee_district_code, oo.consignee_district, oo.consignee_address, oo.consignee_zip_code,
+            oo.payer_name, oo.payer_id_type, oo.payer_id_code, oo.payer_mob, oo.pay_ent_cus_code, oo.pay_no, oo.goods_value,
+            oo.freight, oo.discount, oo.tax_total, oo.actural_paid, oo.pay_time, oo.expr_type, oo.expr_comp_id, oo.decl_expr_fee,
+            oo.batch_numbers, oo.decl_post_tax, oo.shop_id, oo.extra_tag, oo.currency_code, oo.ws_flag, oo.buyer_pay_check, oo.wx_order_detail, oo.clec_order_status,oo.expr_agreement_type,
+            oo.way_order_status, oo.project_check_status, oo.play_order_status, oo.remark, oo.creater_sn, oo.create_time,
+            oo.moder_sn, oo.mod_time,
+            ww.cus_order_sn 'sn',
+            ww.cus_resp_code 'failCode',
+            ww.cus_resp_desc 'failMsg'
+        FROM
+            cus_order_resp ww
+            INNER JOIN cus_order w ON ww.cus_order_sn = w.cus_order_sn
+            INNER JOIN wx_order oo ON w.merch_order_sn = oo.order_sn
+        WHERE
+            clec_order_status = 3
+            )
     </select>
 </mapper>