| @@ -84,7 +84,6 @@ public class WxBusinessOrderController extends BaseController { | |||||
| wxBusinessCircleOrder.setNoticeId(notifyData.getId()); | wxBusinessCircleOrder.setNoticeId(notifyData.getId()); | ||||
| wxBusinessCircleOrder.setNoticeCreateTime(sdf.parse(notifyData.getCreateTime())); | wxBusinessCircleOrder.setNoticeCreateTime(sdf.parse(notifyData.getCreateTime())); | ||||
| wxBusinessCircleOrder.setNoticeEventType(notifyData.getEventType()); | wxBusinessCircleOrder.setNoticeEventType(notifyData.getEventType()); | ||||
| wxBusinessCircleOrder.setNoticeResourceType(notifyData.getResourceType()); | |||||
| wxBusinessCircleOrder.setSummary(notifyData.getSummary()); | wxBusinessCircleOrder.setSummary(notifyData.getSummary()); | ||||
| //解密 | //解密 | ||||
| @@ -26,9 +26,6 @@ public class BusinessCircleBase extends TenantEntity { | |||||
| @io.swagger.annotations.ApiModelProperty(value="商圈支付结果通知类型:MALL_TRANSACTION.SUCCESS",name="noticeEventType") | @io.swagger.annotations.ApiModelProperty(value="商圈支付结果通知类型:MALL_TRANSACTION.SUCCESS",name="noticeEventType") | ||||
| private String noticeEventType; | private String noticeEventType; | ||||
| @io.swagger.annotations.ApiModelProperty(value="商圈支付结果通知资源数据类型:encrypt-resource",name="noticeResourceType") | |||||
| private String noticeResourceType; | |||||
| @io.swagger.annotations.ApiModelProperty(value="商圈支付结果通知回调摘要",name="summary") | @io.swagger.annotations.ApiModelProperty(value="商圈支付结果通知回调摘要",name="summary") | ||||
| private String summary; | private String summary; | ||||
| @@ -84,6 +81,9 @@ public class BusinessCircleBase extends TenantEntity { | |||||
| @io.swagger.annotations.ApiModelProperty(value="是否退款(1:是,0:否)",name="isRefund") | @io.swagger.annotations.ApiModelProperty(value="是否退款(1:是,0:否)",name="isRefund") | ||||
| private Integer isRefund; | private Integer isRefund; | ||||
| @io.swagger.annotations.ApiModelProperty(value="正常订单状态(is_refund=0时)1:部分退款2:订单关闭",name="orderStatus") | |||||
| private Integer orderStatus; | |||||
| @io.swagger.annotations.ApiModelProperty(value="微信支付退款单号",name="refundId") | @io.swagger.annotations.ApiModelProperty(value="微信支付退款单号",name="refundId") | ||||
| private String refundId; | private String refundId; | ||||
| @@ -35,4 +35,10 @@ public interface AliBusinessCircleOrderMapper extends CommonMapper<AliBusinessCi | |||||
| */ | */ | ||||
| void insertRefundNoticeOrder(AliBusinessCircleOrder record); | void insertRefundNoticeOrder(AliBusinessCircleOrder record); | ||||
| /** | |||||
| * 修改正常订单状态 | |||||
| * @param record | |||||
| */ | |||||
| void updateOrderStatus(AliBusinessCircleOrder record); | |||||
| } | } | ||||
| @@ -38,4 +38,10 @@ public interface WxBusinessCircleOrderMapper extends CommonMapper<WxBusinessCirc | |||||
| */ | */ | ||||
| void insertRefundNoticeOrder(WxBusinessCircleOrder record); | void insertRefundNoticeOrder(WxBusinessCircleOrder record); | ||||
| /** | |||||
| * 修改正常订单状态 | |||||
| * @param record | |||||
| */ | |||||
| void updateOrderStatus(WxBusinessCircleOrder record); | |||||
| } | } | ||||
| @@ -35,4 +35,10 @@ public interface WxThirdPartyOrdersMapper extends CommonMapper<WxThirdPartyOrder | |||||
| */ | */ | ||||
| void insertRefundNoticeOrder(WxThirdPartyOrders record); | void insertRefundNoticeOrder(WxThirdPartyOrders record); | ||||
| /** | |||||
| * 修改正常订单状态 | |||||
| * @param record | |||||
| */ | |||||
| void updateOrderStatus(WxThirdPartyOrders record); | |||||
| } | } | ||||
| @@ -224,6 +224,10 @@ public class AliBusinessCircleOrderServiceImpl implements AliBusinessCircleOrder | |||||
| record.setMerchantId(order.getMerchantId()); | record.setMerchantId(order.getMerchantId()); | ||||
| aliBusinessCircleOrderMapper.insertRefundNoticeOrder(record); | aliBusinessCircleOrderMapper.insertRefundNoticeOrder(record); | ||||
| order.setOrderStatus(2);//全额退款 订单关闭 | |||||
| order.setUpdateTime(now); | |||||
| aliBusinessCircleOrderMapper.updateOrderStatus(order); | |||||
| if(order.getEarnPoints().equals(EnumYesOrNo.YES.getCode())){ | if(order.getEarnPoints().equals(EnumYesOrNo.YES.getCode())){ | ||||
| WxCreditHistory creditHistory = new WxCreditHistory(); | WxCreditHistory creditHistory = new WxCreditHistory(); | ||||
| creditHistory.setTenantId(record.getFinalTenantId()); | creditHistory.setTenantId(record.getFinalTenantId()); | ||||
| @@ -211,6 +211,14 @@ public class WxBusinessCircleOrderServiceImpl implements WxBusinessCircleOrderSe | |||||
| record.setMerchantId(order.getMerchantId()); | record.setMerchantId(order.getMerchantId()); | ||||
| wxBusinessCircleOrderMapper.insertRefundNoticeOrder(record); | wxBusinessCircleOrderMapper.insertRefundNoticeOrder(record); | ||||
| if((refundAmount + record.getRefundAmount()) == amount){ | |||||
| order.setOrderStatus(2);//全额退款 | |||||
| }else{ | |||||
| order.setOrderStatus(1);//部分退款 | |||||
| } | |||||
| order.setUpdateTime(now); | |||||
| wxBusinessCircleOrderMapper.updateOrderStatus(order); | |||||
| if(order.getEarnPoints().equals(EnumYesOrNo.YES.getCode())){ | if(order.getEarnPoints().equals(EnumYesOrNo.YES.getCode())){ | ||||
| WxCreditHistory creditHistory = new WxCreditHistory(); | WxCreditHistory creditHistory = new WxCreditHistory(); | ||||
| creditHistory.setTenantId(record.getFinalTenantId()); | creditHistory.setTenantId(record.getFinalTenantId()); | ||||
| @@ -234,6 +234,14 @@ public class WxThirdPartyOrdersServiceImpl implements WxThirdPartyOrdersService | |||||
| record.setMerchantId(order.getMerchantId()); | record.setMerchantId(order.getMerchantId()); | ||||
| wxThirdPartyOrdersMapper.insertRefundNoticeOrder(record); | wxThirdPartyOrdersMapper.insertRefundNoticeOrder(record); | ||||
| if((refundAmount + record.getRefundAmount()) == amount){ | |||||
| order.setOrderStatus(2);//全额退款 | |||||
| }else{ | |||||
| order.setOrderStatus(1);//部分退款 | |||||
| } | |||||
| order.setUpdateTime(now); | |||||
| wxThirdPartyOrdersMapper.updateOrderStatus(order); | |||||
| if(order.getEarnPoints().equals(EnumYesOrNo.YES.getCode())){ | if(order.getEarnPoints().equals(EnumYesOrNo.YES.getCode())){ | ||||
| WxCreditHistory creditHistory = new WxCreditHistory(); | WxCreditHistory creditHistory = new WxCreditHistory(); | ||||
| creditHistory.setTenantId(record.getFinalTenantId()); | creditHistory.setTenantId(record.getFinalTenantId()); | ||||
| @@ -9,7 +9,6 @@ | |||||
| <result column="notice_id" jdbcType="VARCHAR" property="noticeId" /> | <result column="notice_id" jdbcType="VARCHAR" property="noticeId" /> | ||||
| <result column="notice_create_time" jdbcType="TIMESTAMP" property="noticeCreateTime"/> | <result column="notice_create_time" jdbcType="TIMESTAMP" property="noticeCreateTime"/> | ||||
| <result column="notice_event_type" jdbcType="VARCHAR" property="noticeEventType" /> | <result column="notice_event_type" jdbcType="VARCHAR" property="noticeEventType" /> | ||||
| <result column="notice_resource_type" jdbcType="VARCHAR" property="noticeResourceType" /> | |||||
| <result column="summary" jdbcType="VARCHAR" property="summary" /> | <result column="summary" jdbcType="VARCHAR" property="summary" /> | ||||
| <result column="mall_id" jdbcType="VARCHAR" property="mallId" /> | <result column="mall_id" jdbcType="VARCHAR" property="mallId" /> | ||||
| @@ -34,6 +33,7 @@ | |||||
| <result column="is_refund" jdbcType="TINYINT" property="isRefund"/> | <result column="is_refund" jdbcType="TINYINT" property="isRefund"/> | ||||
| <result column="order_status" jdbcType="TINYINT" property="orderStatus"/> | |||||
| <result column="refund_id" jdbcType="VARCHAR" property="refundId" /> | <result column="refund_id" jdbcType="VARCHAR" property="refundId" /> | ||||
| <result column="refund_amount" jdbcType="INTEGER" property="refundAmount"/> | <result column="refund_amount" jdbcType="INTEGER" property="refundAmount"/> | ||||
| @@ -42,10 +42,10 @@ | |||||
| <sql id="allColumns"> | <sql id="allColumns"> | ||||
| `id`, `tenant_id`, `parent_tenant_id`, `notice_id`, `notice_create_time`, `notice_event_type`, | `id`, `tenant_id`, `parent_tenant_id`, `notice_id`, `notice_create_time`, `notice_event_type`, | ||||
| `notice_resource_type`, `summary`,`mall_id`, `mall_name`, `mall_store_id`, `buyer_id`, | |||||
| `time_end`, `amount`, `pay_amount`, `transaction_id`, `create_time`, `update_time`, | |||||
| `summary`,`mall_id`, `mall_name`, `mall_store_id`, `buyer_id`, | |||||
| `time_end`, `amount`, `pay_amount`, `transaction_id`, `create_time`, `update_time`, | |||||
| `merchant_id`, `c_user_id`, `earn_points`, `increased_points`, `points_update_time`, | `merchant_id`, `c_user_id`, `earn_points`, `increased_points`, `points_update_time`, | ||||
| `is_refund`, `refund_id`, `refund_amount` | |||||
| `is_refund`, `order_status`, `refund_id`, `refund_amount` | |||||
| </sql> | </sql> | ||||
| <sql id="dynamicWhereConditions"> | <sql id="dynamicWhereConditions"> | ||||
| @@ -101,6 +101,10 @@ | |||||
| and `is_refund` = #{isRefund} | and `is_refund` = #{isRefund} | ||||
| </if> | </if> | ||||
| <if test=" null != orderStatus "> | |||||
| and `order_status` = #{orderStatus} | |||||
| </if> | |||||
| <if test=" null != refundId and '' != refundId"> | <if test=" null != refundId and '' != refundId"> | ||||
| and `refund_id` = #{refundId} | and `refund_id` = #{refundId} | ||||
| </if> | </if> | ||||
| @@ -114,14 +118,14 @@ | |||||
| <if test=" null != sortColumns">order by ${sortColumns}</if> | <if test=" null != sortColumns">order by ${sortColumns}</if> | ||||
| </sql> | </sql> | ||||
| <select id="findList" parameterType="com.iformall.domain.po.WxThirdPartyOrders" resultMap="BaseResultMap"> | |||||
| <select id="findList" parameterType="com.iformall.domain.po.AliBusinessCircleOrder" resultMap="BaseResultMap"> | |||||
| select | select | ||||
| <include refid="allColumns"/> | <include refid="allColumns"/> | ||||
| from ali_business_circle_order | from ali_business_circle_order | ||||
| <include refid="dynamicWhereConditions"/> | <include refid="dynamicWhereConditions"/> | ||||
| </select> | </select> | ||||
| <select id="getById" parameterType="com.iformall.domain.po.WxThirdPartyOrders" resultMap="BaseResultMap"> | |||||
| <select id="getById" parameterType="com.iformall.domain.po.AliBusinessCircleOrder" resultMap="BaseResultMap"> | |||||
| select | select | ||||
| <include refid="allColumns"/> | <include refid="allColumns"/> | ||||
| from ali_business_circle_order | from ali_business_circle_order | ||||
| @@ -129,7 +133,7 @@ | |||||
| and tenant_id=#{tenantId} | and tenant_id=#{tenantId} | ||||
| </select> | </select> | ||||
| <select id="getOrderByTransactionId" parameterType="com.iformall.domain.po.WxThirdPartyOrders" resultMap="BaseResultMap"> | |||||
| <select id="getOrderByTransactionId" parameterType="com.iformall.domain.po.AliBusinessCircleOrder" resultMap="BaseResultMap"> | |||||
| select | select | ||||
| <include refid="allColumns"/> | <include refid="allColumns"/> | ||||
| from ali_business_circle_order | from ali_business_circle_order | ||||
| @@ -138,7 +142,7 @@ | |||||
| and `transaction_id` = #{transactionId} | and `transaction_id` = #{transactionId} | ||||
| </select> | </select> | ||||
| <select id="getRefundOrderByRefundId" parameterType="com.iformall.domain.po.WxThirdPartyOrders" resultMap="BaseResultMap"> | |||||
| <select id="getRefundOrderByRefundId" parameterType="com.iformall.domain.po.AliBusinessCircleOrder" resultMap="BaseResultMap"> | |||||
| select | select | ||||
| <include refid="allColumns"/> | <include refid="allColumns"/> | ||||
| from ali_business_circle_order | from ali_business_circle_order | ||||
| @@ -147,7 +151,7 @@ | |||||
| and `refund_id` = #{refundId} | and `refund_id` = #{refundId} | ||||
| </select> | </select> | ||||
| <select id="getRefundOrderByTransactionId" parameterType="com.iformall.domain.po.WxThirdPartyOrders" resultMap="BaseResultMap"> | |||||
| <select id="getRefundOrderByTransactionId" parameterType="com.iformall.domain.po.AliBusinessCircleOrder" resultMap="BaseResultMap"> | |||||
| select | select | ||||
| <include refid="allColumns"/> | <include refid="allColumns"/> | ||||
| from ali_business_circle_order | from ali_business_circle_order | ||||
| @@ -156,37 +160,44 @@ | |||||
| and `transaction_id` = #{transactionId} | and `transaction_id` = #{transactionId} | ||||
| </select> | </select> | ||||
| <insert id="insertNoticeOrder" parameterType="com.iformall.domain.po.WxThirdPartyOrders" > | |||||
| <insert id="insertNoticeOrder" parameterType="com.iformall.domain.po.AliBusinessCircleOrder" > | |||||
| INSERT INTO ali_business_circle_order ( | INSERT INTO ali_business_circle_order ( | ||||
| `id`, `tenant_id`, `parent_tenant_id`, `notice_id`, `notice_create_time`, `notice_event_type`, | `id`, `tenant_id`, `parent_tenant_id`, `notice_id`, `notice_create_time`, `notice_event_type`, | ||||
| `notice_resource_type`, `summary`, `mall_id`, `mall_name`, `mall_store_id`, `buyer_id`,`time_end`, `amount`, `pay_amount`, `transaction_id`, `create_time`, `update_time`, | |||||
| `summary`, `mall_id`, `mall_name`, `mall_store_id`, `buyer_id`,`time_end`, `amount`, `pay_amount`, `transaction_id`, `create_time`, `update_time`, | |||||
| `merchant_id`, `c_user_id`, `earn_points`, `is_refund` | `merchant_id`, `c_user_id`, `earn_points`, `is_refund` | ||||
| ) | ) | ||||
| VALUES( | VALUES( | ||||
| #{id},#{tenantId},#{parentTenantId},#{noticeId},#{noticeCreateTime},#{noticeEventType}, | #{id},#{tenantId},#{parentTenantId},#{noticeId},#{noticeCreateTime},#{noticeEventType}, | ||||
| #{noticeResourceType},#{summary},#{mallId},#{mallName},#{mallStoreId},#{buyerId},#{timeEnd},#{amount},#{payAmount},#{transactionId},#{createTime},#{updateTime}, | |||||
| #{summary},#{mallId},#{mallName},#{mallStoreId},#{buyerId},#{timeEnd},#{amount},#{payAmount},#{transactionId},#{createTime},#{updateTime}, | |||||
| #{merchantId},#{cUserId},0,0 | #{merchantId},#{cUserId},0,0 | ||||
| ); | ); | ||||
| </insert> | </insert> | ||||
| <update id="updatePoints" parameterType="com.iformall.domain.po.WxThirdPartyOrders"> | |||||
| <update id="updatePoints" parameterType="com.iformall.domain.po.AliBusinessCircleOrder"> | |||||
| update ali_business_circle_order set | update ali_business_circle_order set | ||||
| `earn_points` = 1, `increased_points` = #{increasedPoints}, `points_update_time` = #{pointsUpdateTime}, | `earn_points` = 1, `increased_points` = #{increasedPoints}, `points_update_time` = #{pointsUpdateTime}, | ||||
| `update_time` = #{updateTime} | `update_time` = #{updateTime} | ||||
| where `id` = #{id} and `tenant_id` = #{tenantId} | where `id` = #{id} and `tenant_id` = #{tenantId} | ||||
| </update> | </update> | ||||
| <insert id="insertRefundNoticeOrder" parameterType="com.iformall.domain.po.WxThirdPartyOrders" > | |||||
| <insert id="insertRefundNoticeOrder" parameterType="com.iformall.domain.po.AliBusinessCircleOrder" > | |||||
| INSERT INTO ali_business_circle_order ( | INSERT INTO ali_business_circle_order ( | ||||
| `id`, `tenant_id`, `parent_tenant_id`,`notice_id`, `notice_create_time`, `notice_event_type`, | `id`, `tenant_id`, `parent_tenant_id`,`notice_id`, `notice_create_time`, `notice_event_type`, | ||||
| `notice_resource_type`, `summary`,`mall_id`, `mall_name`, `mall_store_id`, `buyer_id`, `time_end`, `amount`,`pay_amount`, `transaction_id`, `create_time`, `update_time`, | |||||
| `summary`,`mall_id`, `mall_name`, `mall_store_id`, `buyer_id`, `time_end`, `amount`,`pay_amount`, `transaction_id`, `create_time`, `update_time`, | |||||
| `merchant_id`, `c_user_id`, `earn_points`, `is_refund`, `refund_id`, `refund_amount` | `merchant_id`, `c_user_id`, `earn_points`, `is_refund`, `refund_id`, `refund_amount` | ||||
| ) | ) | ||||
| VALUES( | VALUES( | ||||
| #{id},#{tenantId},#{parentTenantId},#{noticeId},#{noticeCreateTime},#{noticeEventType}, | #{id},#{tenantId},#{parentTenantId},#{noticeId},#{noticeCreateTime},#{noticeEventType}, | ||||
| #{noticeResourceType},#{summary},#{mallId},#{mallName},#{mallStoreId},#{buyerId},#{timeEnd},#{amount},#{payAmount},#{transactionId},#{createTime},#{updateTime}, | |||||
| #{summary},#{mallId},#{mallName},#{mallStoreId},#{buyerId},#{timeEnd},#{amount},#{payAmount},#{transactionId},#{createTime},#{updateTime}, | |||||
| #{merchantId},#{cUserId},0,1,#{refundId},#{refundAmount} | #{merchantId},#{cUserId},0,1,#{refundId},#{refundAmount} | ||||
| ); | ); | ||||
| </insert> | </insert> | ||||
| <update id="updateOrderStatus" parameterType="com.iformall.domain.po.AliBusinessCircleOrder"> | |||||
| update ali_business_circle_order set | |||||
| `order_status` = #{orderStatus}, | |||||
| `update_time` = #{updateTime} | |||||
| where `id` = #{id} and `tenant_id` = #{tenantId} | |||||
| </update> | |||||
| </mapper> | </mapper> | ||||
| @@ -8,7 +8,6 @@ | |||||
| <result column="notice_id" jdbcType="VARCHAR" property="noticeId" /> | <result column="notice_id" jdbcType="VARCHAR" property="noticeId" /> | ||||
| <result column="notice_create_time" jdbcType="TIMESTAMP" property="noticeCreateTime"/> | <result column="notice_create_time" jdbcType="TIMESTAMP" property="noticeCreateTime"/> | ||||
| <result column="notice_event_type" jdbcType="VARCHAR" property="noticeEventType" /> | <result column="notice_event_type" jdbcType="VARCHAR" property="noticeEventType" /> | ||||
| <result column="notice_resource_type" jdbcType="VARCHAR" property="noticeResourceType" /> | |||||
| <result column="summary" jdbcType="VARCHAR" property="summary" /> | <result column="summary" jdbcType="VARCHAR" property="summary" /> | ||||
| <result column="wx_mchid" jdbcType="VARCHAR" property="wxMchid" /> | <result column="wx_mchid" jdbcType="VARCHAR" property="wxMchid" /> | ||||
| <result column="wx_merchant_name" jdbcType="VARCHAR" property="wxMerchantName" /> | <result column="wx_merchant_name" jdbcType="VARCHAR" property="wxMerchantName" /> | ||||
| @@ -35,6 +34,7 @@ | |||||
| <result column="is_points_notify" jdbcType="TINYINT" property="isPointsNotify"/> | <result column="is_points_notify" jdbcType="TINYINT" property="isPointsNotify"/> | ||||
| <result column="is_refund" jdbcType="TINYINT" property="isRefund"/> | <result column="is_refund" jdbcType="TINYINT" property="isRefund"/> | ||||
| <result column="order_status" jdbcType="TINYINT" property="orderStatus"/> | |||||
| <result column="refund_id" jdbcType="VARCHAR" property="refundId" /> | <result column="refund_id" jdbcType="VARCHAR" property="refundId" /> | ||||
| <result column="refund_amount" jdbcType="INTEGER" property="refundAmount"/> | <result column="refund_amount" jdbcType="INTEGER" property="refundAmount"/> | ||||
| @@ -43,10 +43,10 @@ | |||||
| <sql id="allColumns"> | <sql id="allColumns"> | ||||
| `id`, `tenant_id`, `parent_tenant_id`, `notice_id`, `notice_create_time`, `notice_event_type`, | `id`, `tenant_id`, `parent_tenant_id`, `notice_id`, `notice_create_time`, `notice_event_type`, | ||||
| `notice_resource_type`, `summary`, `wx_mchid`, `wx_merchant_name`, `wx_shop_name`, `wx_shop_number`, | |||||
| `summary`, `wx_mchid`, `wx_merchant_name`, `wx_shop_name`, `wx_shop_number`, | |||||
| `appid`, `openid`, `time_end`, `amount`, `pay_amount`, `transaction_id`, `commit_tag`, `create_time`, `update_time`, | `appid`, `openid`, `time_end`, `amount`, `pay_amount`, `transaction_id`, `commit_tag`, `create_time`, `update_time`, | ||||
| `merchant_id`, `c_user_id`, `earn_points`, `increased_points`, `points_update_time`, `is_points_notify`, | `merchant_id`, `c_user_id`, `earn_points`, `increased_points`, `points_update_time`, `is_points_notify`, | ||||
| `is_refund`, `refund_id`, `refund_amount` | |||||
| `is_refund`, `order_status`, `refund_id`, `refund_amount` | |||||
| </sql> | </sql> | ||||
| <sql id="dynamicWhereConditions"> | <sql id="dynamicWhereConditions"> | ||||
| @@ -122,6 +122,10 @@ | |||||
| and `is_refund` = #{isRefund} | and `is_refund` = #{isRefund} | ||||
| </if> | </if> | ||||
| <if test=" null != orderStatus "> | |||||
| and `order_status` = #{orderStatus} | |||||
| </if> | |||||
| <if test=" null != refundId and '' != refundId"> | <if test=" null != refundId and '' != refundId"> | ||||
| and `refund_id` = #{refundId} | and `refund_id` = #{refundId} | ||||
| </if> | </if> | ||||
| @@ -180,13 +184,13 @@ | |||||
| <insert id="insertNoticeOrder" parameterType="com.iformall.domain.po.WxBusinessCircleOrder" > | <insert id="insertNoticeOrder" parameterType="com.iformall.domain.po.WxBusinessCircleOrder" > | ||||
| INSERT INTO wx_business_circle_order ( | INSERT INTO wx_business_circle_order ( | ||||
| `id`, `tenant_id`, `parent_tenant_id`, `notice_id`, `notice_create_time`, `notice_event_type`, | `id`, `tenant_id`, `parent_tenant_id`, `notice_id`, `notice_create_time`, `notice_event_type`, | ||||
| `notice_resource_type`, `summary`, `wx_mchid`, `wx_merchant_name`, `wx_shop_name`, `wx_shop_number`, | |||||
| `summary`, `wx_mchid`, `wx_merchant_name`, `wx_shop_name`, `wx_shop_number`, | |||||
| `appid`, `openid`, `time_end`, `amount`, `pay_amount`, `transaction_id`, `commit_tag`, `create_time`, `update_time`, | `appid`, `openid`, `time_end`, `amount`, `pay_amount`, `transaction_id`, `commit_tag`, `create_time`, `update_time`, | ||||
| `merchant_id`, `c_user_id`, `earn_points`, `is_points_notify`, `is_refund` | `merchant_id`, `c_user_id`, `earn_points`, `is_points_notify`, `is_refund` | ||||
| ) | ) | ||||
| VALUES( | VALUES( | ||||
| #{id},#{tenantId},#{parentTenantId},#{noticeId},#{noticeCreateTime},#{noticeEventType}, | #{id},#{tenantId},#{parentTenantId},#{noticeId},#{noticeCreateTime},#{noticeEventType}, | ||||
| #{noticeResourceType},#{summary},#{wxMchid},#{wxMerchantName},#{wxShopName},#{wxShopNumber}, | |||||
| #{summary},#{wxMchid},#{wxMerchantName},#{wxShopName},#{wxShopNumber}, | |||||
| #{appid},#{openid},#{timeEnd},#{amount},#{payAmount},#{transactionId},#{commitTag},#{createTime},#{updateTime}, | #{appid},#{openid},#{timeEnd},#{amount},#{payAmount},#{transactionId},#{commitTag},#{createTime},#{updateTime}, | ||||
| #{merchantId},#{cUserId},0,0,0 | #{merchantId},#{cUserId},0,0,0 | ||||
| ); | ); | ||||
| @@ -209,16 +213,23 @@ | |||||
| <insert id="insertRefundNoticeOrder" parameterType="com.iformall.domain.po.WxBusinessCircleOrder" > | <insert id="insertRefundNoticeOrder" parameterType="com.iformall.domain.po.WxBusinessCircleOrder" > | ||||
| INSERT INTO wx_business_circle_order ( | INSERT INTO wx_business_circle_order ( | ||||
| `id`, `tenant_id`, `parent_tenant_id`, `notice_id`, `notice_create_time`, `notice_event_type`, | `id`, `tenant_id`, `parent_tenant_id`, `notice_id`, `notice_create_time`, `notice_event_type`, | ||||
| `notice_resource_type`, `summary`, `wx_mchid`, `wx_merchant_name`, `wx_shop_name`, `wx_shop_number`, | |||||
| `summary`, `wx_mchid`, `wx_merchant_name`, `wx_shop_name`, `wx_shop_number`, | |||||
| `appid`, `openid`, `time_end`, `amount`,`pay_amount`, `transaction_id`, `commit_tag`, `create_time`, `update_time`, | `appid`, `openid`, `time_end`, `amount`,`pay_amount`, `transaction_id`, `commit_tag`, `create_time`, `update_time`, | ||||
| `merchant_id`, `c_user_id`, `earn_points`, `is_refund`, `refund_id`, `refund_amount` | `merchant_id`, `c_user_id`, `earn_points`, `is_refund`, `refund_id`, `refund_amount` | ||||
| ) | ) | ||||
| VALUES( | VALUES( | ||||
| #{id},#{tenantId},#{parentTenantId},#{noticeId},#{noticeCreateTime},#{noticeEventType}, | #{id},#{tenantId},#{parentTenantId},#{noticeId},#{noticeCreateTime},#{noticeEventType}, | ||||
| #{noticeResourceType},#{summary},#{wxMchid},#{wxMerchantName},#{wxShopName},#{wxShopNumber}, | |||||
| #{summary},#{wxMchid},#{wxMerchantName},#{wxShopName},#{wxShopNumber}, | |||||
| #{appid},#{openid},#{timeEnd},#{amount},#{payAmount},#{transactionId},#{commitTag},#{createTime},#{updateTime}, | #{appid},#{openid},#{timeEnd},#{amount},#{payAmount},#{transactionId},#{commitTag},#{createTime},#{updateTime}, | ||||
| #{merchantId},#{cUserId},0,1,#{refundId},#{refundAmount} | #{merchantId},#{cUserId},0,1,#{refundId},#{refundAmount} | ||||
| ); | ); | ||||
| </insert> | </insert> | ||||
| <update id="updateOrderStatus" parameterType="com.iformall.domain.po.WxBusinessCircleOrder"> | |||||
| update wx_business_circle_order set | |||||
| `order_status` = #{orderStatus}, | |||||
| `update_time` = #{updateTime} | |||||
| where `id` = #{id} and `tenant_id` = #{tenantId} | |||||
| </update> | |||||
| </mapper> | </mapper> | ||||
| @@ -12,7 +12,6 @@ | |||||
| <result column="notice_id" jdbcType="VARCHAR" property="noticeId" /> | <result column="notice_id" jdbcType="VARCHAR" property="noticeId" /> | ||||
| <result column="notice_create_time" jdbcType="TIMESTAMP" property="noticeCreateTime"/> | <result column="notice_create_time" jdbcType="TIMESTAMP" property="noticeCreateTime"/> | ||||
| <result column="notice_event_type" jdbcType="VARCHAR" property="noticeEventType" /> | <result column="notice_event_type" jdbcType="VARCHAR" property="noticeEventType" /> | ||||
| <result column="notice_resource_type" jdbcType="VARCHAR" property="noticeResourceType" /> | |||||
| <result column="summary" jdbcType="VARCHAR" property="summary" /> | <result column="summary" jdbcType="VARCHAR" property="summary" /> | ||||
| <result column="shop_name" jdbcType="VARCHAR" property="shopName" /> | <result column="shop_name" jdbcType="VARCHAR" property="shopName" /> | ||||
| @@ -38,6 +37,7 @@ | |||||
| <result column="is_refund" jdbcType="TINYINT" property="isRefund"/> | <result column="is_refund" jdbcType="TINYINT" property="isRefund"/> | ||||
| <result column="order_status" jdbcType="TINYINT" property="orderStatus"/> | |||||
| <result column="refund_id" jdbcType="VARCHAR" property="refundId" /> | <result column="refund_id" jdbcType="VARCHAR" property="refundId" /> | ||||
| <result column="refund_amount" jdbcType="INTEGER" property="refundAmount"/> | <result column="refund_amount" jdbcType="INTEGER" property="refundAmount"/> | ||||
| @@ -46,10 +46,10 @@ | |||||
| <sql id="allColumns"> | <sql id="allColumns"> | ||||
| `id`, `tenant_id`, `parent_tenant_id`, `source_app_id`, `source_type`,`notice_id`, `notice_create_time`, `notice_event_type`, | `id`, `tenant_id`, `parent_tenant_id`, `source_app_id`, `source_type`,`notice_id`, `notice_create_time`, `notice_event_type`, | ||||
| `notice_resource_type`, `summary`,`shop_name`, `shop_number`, `user_phone`, `user_number`, | |||||
| `time_end`, `amount`, `pay_amount`, `transaction_id`, `create_time`, `update_time`, | |||||
| `summary`,`shop_name`, `shop_number`, `user_phone`, `user_number`, | |||||
| `time_end`, `amount`, `pay_amount`, `transaction_id`, `create_time`, `update_time`, | |||||
| `merchant_id`, `c_user_id`, `earn_points`, `increased_points`, `points_update_time`, | `merchant_id`, `c_user_id`, `earn_points`, `increased_points`, `points_update_time`, | ||||
| `is_refund`, `refund_id`, `refund_amount` | |||||
| `is_refund`, `order_status`, `refund_id`, `refund_amount` | |||||
| </sql> | </sql> | ||||
| <sql id="dynamicWhereConditions"> | <sql id="dynamicWhereConditions"> | ||||
| @@ -121,6 +121,10 @@ | |||||
| and `is_refund` = #{isRefund} | and `is_refund` = #{isRefund} | ||||
| </if> | </if> | ||||
| <if test=" null != orderStatus "> | |||||
| and `order_status` = #{orderStatus} | |||||
| </if> | |||||
| <if test=" null != refundId and '' != refundId"> | <if test=" null != refundId and '' != refundId"> | ||||
| and `refund_id` = #{refundId} | and `refund_id` = #{refundId} | ||||
| </if> | </if> | ||||
| @@ -181,12 +185,12 @@ | |||||
| <insert id="insertNoticeOrder" parameterType="com.iformall.domain.po.WxThirdPartyOrders" > | <insert id="insertNoticeOrder" parameterType="com.iformall.domain.po.WxThirdPartyOrders" > | ||||
| INSERT INTO wx_third_party_orders ( | INSERT INTO wx_third_party_orders ( | ||||
| `id`, `tenant_id`, `parent_tenant_id`,`source_app_id`, `source_type`, `notice_id`, `notice_create_time`, `notice_event_type`, | `id`, `tenant_id`, `parent_tenant_id`,`source_app_id`, `source_type`, `notice_id`, `notice_create_time`, `notice_event_type`, | ||||
| `notice_resource_type`, `summary`, `shop_name`, `shop_number`, `user_phone`, `user_number`,`time_end`, `amount`, `pay_amount`, `transaction_id`, `create_time`, `update_time`, | |||||
| `summary`, `shop_name`, `shop_number`, `user_phone`, `user_number`,`time_end`, `amount`, `pay_amount`, `transaction_id`, `create_time`, `update_time`, | |||||
| `merchant_id`, `c_user_id`, `earn_points`, `is_refund` | `merchant_id`, `c_user_id`, `earn_points`, `is_refund` | ||||
| ) | ) | ||||
| VALUES( | VALUES( | ||||
| #{id},#{tenantId},#{parentTenantId},#{sourceAppId},#{sourceType},#{noticeId},#{noticeCreateTime},#{noticeEventType}, | #{id},#{tenantId},#{parentTenantId},#{sourceAppId},#{sourceType},#{noticeId},#{noticeCreateTime},#{noticeEventType}, | ||||
| #{noticeResourceType},#{summary},#{shopName},#{shopNumber},#{userPhone},#{userNumber},#{timeEnd},#{amount},#{payAmount},#{transactionId},#{createTime},#{updateTime}, | |||||
| #{summary},#{shopName},#{shopNumber},#{userPhone},#{userNumber},#{timeEnd},#{amount},#{payAmount},#{transactionId},#{createTime},#{updateTime}, | |||||
| #{merchantId},#{cUserId},0,0 | #{merchantId},#{cUserId},0,0 | ||||
| ); | ); | ||||
| </insert> | </insert> | ||||
| @@ -201,14 +205,21 @@ | |||||
| <insert id="insertRefundNoticeOrder" parameterType="com.iformall.domain.po.WxThirdPartyOrders" > | <insert id="insertRefundNoticeOrder" parameterType="com.iformall.domain.po.WxThirdPartyOrders" > | ||||
| INSERT INTO wx_third_party_orders ( | INSERT INTO wx_third_party_orders ( | ||||
| `id`, `tenant_id`, `parent_tenant_id`,`source_app_id`, `source_type`, `notice_id`, `notice_create_time`, `notice_event_type`, | `id`, `tenant_id`, `parent_tenant_id`,`source_app_id`, `source_type`, `notice_id`, `notice_create_time`, `notice_event_type`, | ||||
| `notice_resource_type`, `summary`,`shop_name`, `shop_number`, `user_phone`, `user_number`, `time_end`, `amount`,`pay_amount`, `transaction_id`, `create_time`, `update_time`, | |||||
| `summary`,`shop_name`, `shop_number`, `user_phone`, `user_number`, `time_end`, `amount`,`pay_amount`, `transaction_id`, `create_time`, `update_time`, | |||||
| `merchant_id`, `c_user_id`, `earn_points`, `is_refund`, `refund_id`, `refund_amount` | `merchant_id`, `c_user_id`, `earn_points`, `is_refund`, `refund_id`, `refund_amount` | ||||
| ) | ) | ||||
| VALUES( | VALUES( | ||||
| #{id},#{tenantId},#{parentTenantId},#{sourceAppId},#{sourceType},#{noticeId},#{noticeCreateTime},#{noticeEventType}, | #{id},#{tenantId},#{parentTenantId},#{sourceAppId},#{sourceType},#{noticeId},#{noticeCreateTime},#{noticeEventType}, | ||||
| #{noticeResourceType},#{summary},#{shopName},#{shopNumber},#{userPhone},#{userNumber},#{timeEnd},#{amount},#{payAmount},#{transactionId},#{createTime},#{updateTime}, | |||||
| #{summary},#{shopName},#{shopNumber},#{userPhone},#{userNumber},#{timeEnd},#{amount},#{payAmount},#{transactionId},#{createTime},#{updateTime}, | |||||
| #{merchantId},#{cUserId},0,1,#{refundId},#{refundAmount} | #{merchantId},#{cUserId},0,1,#{refundId},#{refundAmount} | ||||
| ); | ); | ||||
| </insert> | </insert> | ||||
| <update id="updateOrderStatus" parameterType="com.iformall.domain.po.WxThirdPartyOrders"> | |||||
| update wx_third_party_orders set | |||||
| `order_status` = #{orderStatus}, | |||||
| `update_time` = #{updateTime} | |||||
| where `id` = #{id} and `tenant_id` = #{tenantId} | |||||
| </update> | |||||
| </mapper> | </mapper> | ||||