| @@ -353,7 +353,7 @@ public class OrderExpiringSchedule { | |||||
| wxOrderMapper.updateById(updateOrder); | wxOrderMapper.updateById(updateOrder); | ||||
| logger.info("券订单: " + order.getId() + " create at " + order.getCreateDate() + " expired at " + new Date()); | logger.info("券订单: " + order.getId() + " create at " + order.getCreateDate() + " expired at " + new Date()); | ||||
| sendInsideOrderPushMsg(order,order.getComposeOrderId()); | |||||
| wxOrderService.sendInsideOrderPushMsg(order,order.getComposeOrderId()); | |||||
| } | } | ||||
| @@ -466,19 +466,4 @@ public class OrderExpiringSchedule { | |||||
| } | } | ||||
| } | } | ||||
| public void sendInsideOrderPushMsg(TenantEntity tenantEntity, Long mainOrderId) { | |||||
| try{ | |||||
| FmInsideOrderPushMsg orderPush = new FmInsideOrderPushMsg(); | |||||
| orderPush.setDelayTimeLevel(5); | |||||
| orderPush.setMsgType(EnumMsgRecordType.INSIDE_ORDER_PUSH.getCode()); | |||||
| orderPush.updateTenantInfo(tenantEntity); | |||||
| orderPush.setBatchOrderId(mainOrderId); | |||||
| logger.info(">>>>>>>>>>>send sendInsideOrderPushMsg :"+orderPush); | |||||
| mqBaseProducer.sendMessage(orderPush, EnumMsgMqTopic.DEFAULT.getCode(), EnumMsgMqTag.DEFAULT.getCode(), EnumMsgMqKey.DEFAULT.getCode()); | |||||
| }catch(Exception e){ | |||||
| logger.info(">>>>>>>>>>>send sendInsideOrderPushMsg : error"+e.getMessage()); | |||||
| } | |||||
| } | |||||
| } | } | ||||
| @@ -46,7 +46,7 @@ public class WxBatchOrder extends TenantEntity { | |||||
| if(EnumAppPlat.WX.equals(appPlat)){ | if(EnumAppPlat.WX.equals(appPlat)){ | ||||
| }else if (EnumAppPlat.TOUTIAO.equals(appPlat)){ | }else if (EnumAppPlat.TOUTIAO.equals(appPlat)){ | ||||
| return Constant.mainPageUrl + "?type=dd&couponOrderId=" + id; | |||||
| return Constant.mainPageUrl + "?type=dt&couponOrderId=" + id; | |||||
| } | } | ||||
| return null; | return null; | ||||
| } | } | ||||
| @@ -243,7 +243,7 @@ public interface WxOrderService { | |||||
| ResultData composeSaveOrder(boolean allowUnPayOrder,EnumComposeOrder composeOrderType,List<OrderComposeSaveDto> composeOrderSaveDto,Long cUserId,EnumPayWay payWay,TenantEntity tenantEntity); | ResultData composeSaveOrder(boolean allowUnPayOrder,EnumComposeOrder composeOrderType,List<OrderComposeSaveDto> composeOrderSaveDto,Long cUserId,EnumPayWay payWay,TenantEntity tenantEntity); | ||||
| void sendInsideOrderPushMsg(WxComposeOrder composeOrder); | |||||
| void sendInsideOrderPushMsg(TenantEntity tenantEntity,Long composeOrderId); | |||||
| PageInfo<WxOrderCouponVo> listGoodsCAsPage(WxOrder wxOrder, Integer pageNum, Integer pageSize); | PageInfo<WxOrderCouponVo> listGoodsCAsPage(WxOrder wxOrder, Integer pageNum, Integer pageSize); | ||||
| @@ -2060,10 +2060,7 @@ public class WxOrderServiceImpl implements WxOrderService { | |||||
| } | } | ||||
| if(ret == 1){ | if(ret == 1){ | ||||
| //订单同步 | //订单同步 | ||||
| WxComposeOrder composeOrder = new WxComposeOrder(); | |||||
| composeOrder.updateTenantInfo(oldOrder); | |||||
| composeOrder.setMainOrderId(oldOrder.getComposeOrderId()); | |||||
| sendInsideOrderPushMsg(composeOrder); | |||||
| sendInsideOrderPushMsg(oldOrder,oldOrder.getComposeOrderId()); | |||||
| } | } | ||||
| return ret; | return ret; | ||||
| @@ -3064,7 +3061,7 @@ public class WxOrderServiceImpl implements WxOrderService { | |||||
| try { | try { | ||||
| WxComposeOrder order = proxy.saveOrderForCoupon(tenantEntity,allowUnPayOrder,composeOrderType,wxCUserBasicInfo, composeOrderSaveDto, payWay); | WxComposeOrder order = proxy.saveOrderForCoupon(tenantEntity,allowUnPayOrder,composeOrderType,wxCUserBasicInfo, composeOrderSaveDto, payWay); | ||||
| //订单同步消息 | //订单同步消息 | ||||
| sendInsideOrderPushMsg(order); | |||||
| sendInsideOrderPushMsg(order,order.getMainOrderId()); | |||||
| return new ResultData(order); | return new ResultData(order); | ||||
| } catch (MallinkException e) { | } catch (MallinkException e) { | ||||
| logger.error("saveOrderForCoupon error.",e); | logger.error("saveOrderForCoupon error.",e); | ||||
| @@ -3084,13 +3081,13 @@ public class WxOrderServiceImpl implements WxOrderService { | |||||
| } | } | ||||
| @Override | @Override | ||||
| public void sendInsideOrderPushMsg(WxComposeOrder composeOrder) { | |||||
| public void sendInsideOrderPushMsg(TenantEntity tenantEntity,Long composeOrderId) { | |||||
| try{ | try{ | ||||
| FmInsideOrderPushMsg orderPush = new FmInsideOrderPushMsg(); | FmInsideOrderPushMsg orderPush = new FmInsideOrderPushMsg(); | ||||
| orderPush.setDelayTimeLevel(5); | orderPush.setDelayTimeLevel(5); | ||||
| orderPush.setMsgType(EnumMsgRecordType.INSIDE_ORDER_PUSH.getCode()); | orderPush.setMsgType(EnumMsgRecordType.INSIDE_ORDER_PUSH.getCode()); | ||||
| orderPush.updateTenantInfo(composeOrder); | |||||
| orderPush.setBatchOrderId(composeOrder.getMainOrderId()); | |||||
| orderPush.updateTenantInfo(tenantEntity); | |||||
| orderPush.setBatchOrderId(composeOrderId); | |||||
| logger.info(">>>>>>>>>>>send sendInsideOrderPushMsg :"+orderPush); | logger.info(">>>>>>>>>>>send sendInsideOrderPushMsg :"+orderPush); | ||||
| mqBaseProducer.sendMessage(orderPush, EnumMsgMqTopic.DEFAULT.getCode(), EnumMsgMqTag.DEFAULT.getCode(), EnumMsgMqKey.DEFAULT.getCode()); | mqBaseProducer.sendMessage(orderPush, EnumMsgMqTopic.DEFAULT.getCode(), EnumMsgMqTag.DEFAULT.getCode(), EnumMsgMqKey.DEFAULT.getCode()); | ||||
| }catch(Exception e){ | }catch(Exception e){ | ||||
| @@ -173,7 +173,7 @@ public class WxPayOrderServiceImpl implements WxPayOrderService { | |||||
| } | } | ||||
| } | } | ||||
| //订单同步消息 | //订单同步消息 | ||||
| wxOrderService.sendInsideOrderPushMsg(composeOrder); | |||||
| wxOrderService.sendInsideOrderPushMsg(composeOrder,composeOrder.getMainOrderId()); | |||||
| } | } | ||||
| } | } | ||||
| @@ -25,6 +25,9 @@ public class FmInsideCouponVerifyMsgServiceImpl implements MsgSendService { | |||||
| @Autowired | @Autowired | ||||
| private WxCouponOrderService couponOrderService; | private WxCouponOrderService couponOrderService; | ||||
| @Autowired | |||||
| private WxOrderService orderService; | |||||
| @Autowired | @Autowired | ||||
| private WxMerchantBUserService merchantBUserService; | private WxMerchantBUserService merchantBUserService; | ||||
| @@ -46,6 +49,8 @@ public class FmInsideCouponVerifyMsgServiceImpl implements MsgSendService { | |||||
| throw new MallinkException(ErrorCode.USER_IS_EMPTY.getCode(), "门店未找到" + msg.getMerchantId()); | throw new MallinkException(ErrorCode.USER_IS_EMPTY.getCode(), "门店未找到" + msg.getMerchantId()); | ||||
| } | } | ||||
| orderService.sendInsideOrderPushMsg(couponOrder,couponOrder.getComposeOrderId()); | |||||
| couponOrderService.actionAfterVerify(couponOrder, merchant); | couponOrderService.actionAfterVerify(couponOrder, merchant); | ||||
| } | } | ||||
| } | } | ||||
| @@ -5,6 +5,7 @@ import com.iformall.domain.po.*; | |||||
| import com.iformall.domain.po.msg.BaseMsg; | import com.iformall.domain.po.msg.BaseMsg; | ||||
| import com.iformall.domain.po.msg.FmInsideOrderPushMsg; | import com.iformall.domain.po.msg.FmInsideOrderPushMsg; | ||||
| import com.iformall.domain.po.msg.FmInsideOrderRefundMsg; | import com.iformall.domain.po.msg.FmInsideOrderRefundMsg; | ||||
| import com.iformall.enums.EnumComposeOrder; | |||||
| import com.iformall.enums.EnumPayWay; | import com.iformall.enums.EnumPayWay; | ||||
| import com.iformall.exception.MallinkException; | import com.iformall.exception.MallinkException; | ||||
| import com.iformall.mapper.TtCUserMapper; | import com.iformall.mapper.TtCUserMapper; | ||||
| @@ -58,7 +59,8 @@ public class FmInsideOrderPushMsgServiceImpl implements MsgSendService { | |||||
| logger.error("主订单未找到: " + msg.getBatchOrderId()); | logger.error("主订单未找到: " + msg.getBatchOrderId()); | ||||
| throw new MallinkException(ErrorCode.ORDER_IS_NOT_FIND.getCode(), "主订单未找到" + msg.getBatchOrderId()); | throw new MallinkException(ErrorCode.ORDER_IS_NOT_FIND.getCode(), "主订单未找到" + msg.getBatchOrderId()); | ||||
| } | } | ||||
| if(EnumPayWay.PAY_WAY_TT.getCode().equals(batchOrder.getPayVendor())){ | |||||
| if(EnumPayWay.PAY_WAY_TT.getCode().equals(batchOrder.getPayVendor()) | |||||
| && EnumComposeOrder.SINGLE.getCode().equals(batchOrder.getOrderType())){ | |||||
| WxAppinfo appinfo = wxAppinfoService.getCAppInfo(batchOrder,EnumPayWay.PAY_WAY_TT.getPlat()); | WxAppinfo appinfo = wxAppinfoService.getCAppInfo(batchOrder,EnumPayWay.PAY_WAY_TT.getPlat()); | ||||
| WxPayOrder orderq = new WxPayOrder(); | WxPayOrder orderq = new WxPayOrder(); | ||||
| @@ -9,6 +9,7 @@ import com.iformall.douyin.pay.DouYinPayHelper; | |||||
| import com.iformall.douyin.pay.preOrder.CreatePreOrderResult; | import com.iformall.douyin.pay.preOrder.CreatePreOrderResult; | ||||
| import com.iformall.douyin.pay.preOrder.DouYinCreatePreOrder; | import com.iformall.douyin.pay.preOrder.DouYinCreatePreOrder; | ||||
| import com.iformall.enums.EnumAppPlat; | import com.iformall.enums.EnumAppPlat; | ||||
| import com.iformall.enums.EnumCouponOrderStatus; | |||||
| import com.iformall.enums.EnumOrderStatus; | import com.iformall.enums.EnumOrderStatus; | ||||
| import com.iformall.enums.EnumPayShare; | import com.iformall.enums.EnumPayShare; | ||||
| import com.iformall.service.order.entity.WxComposeOrder; | import com.iformall.service.order.entity.WxComposeOrder; | ||||
| @@ -103,7 +104,7 @@ public class TtMiniAppPayAdapterService extends BaseTtPayAdapterService implemen | |||||
| Map<String,Object> orderDetail = new HashMap<>(); | Map<String,Object> orderDetail = new HashMap<>(); | ||||
| orderDetail.put("order_id",batchOrder.getId().toString()); | orderDetail.put("order_id",batchOrder.getId().toString()); | ||||
| orderDetail.put("create_time",batchOrder.getCreateDate().getTime()); | orderDetail.put("create_time",batchOrder.getCreateDate().getTime()); | ||||
| orderDetail.put("status", getTtOrderStatus(wxOrderCouponVo.getOrderStatus()).getMessage()); | |||||
| orderDetail.put("status", getTtOrderStatus(wxOrderCouponVo.getOrderStatus(),wxOrderCouponVo.getCouponOrderStatus()).getMessage()); | |||||
| orderDetail.put("total_price",batchOrder.getPayment()); | orderDetail.put("total_price",batchOrder.getPayment()); | ||||
| orderDetail.put("detail_url",batchOrder.getWeappOrderPath(EnumAppPlat.TOUTIAO)); | orderDetail.put("detail_url",batchOrder.getWeappOrderPath(EnumAppPlat.TOUTIAO)); | ||||
| @@ -125,7 +126,7 @@ public class TtMiniAppPayAdapterService extends BaseTtPayAdapterService implemen | |||||
| // map.put("scene","");//小程序场景值 | // map.put("scene","");//小程序场景值 | ||||
| // map.put("location","");//小程序场景值 | // map.put("location","");//小程序场景值 | ||||
| // map.put("launch_from","");//小程序场景值 | // map.put("launch_from","");//小程序场景值 | ||||
| map.put("order_status", getTtOrderStatus(wxOrderCouponVo.getOrderStatus()).getCode()); | |||||
| map.put("order_status", getTtOrderStatus(wxOrderCouponVo.getOrderStatus(),wxOrderCouponVo.getCouponOrderStatus()).getCode()); | |||||
| map.put("payment_order_no", payOrder.getTransactionId()); | map.put("payment_order_no", payOrder.getTransactionId()); | ||||
| try { | try { | ||||
| @@ -145,23 +146,29 @@ public class TtMiniAppPayAdapterService extends BaseTtPayAdapterService implemen | |||||
| } | } | ||||
| } | } | ||||
| private EnumTtOrderStatus getTtOrderStatus(Integer code) throws Exception { | |||||
| if(EnumOrderStatus.getEnum(code).equals(EnumOrderStatus.ORDER_STATUS_PENDING_PAYMENT)){ | |||||
| private EnumTtOrderStatus getTtOrderStatus(Integer orderStatus,Integer couponOrderStatus) throws Exception { | |||||
| if(EnumOrderStatus.getEnum(orderStatus).equals(EnumOrderStatus.ORDER_STATUS_PENDING_PAYMENT)){ | |||||
| return EnumTtOrderStatus.ORDER_STATUS_0; | return EnumTtOrderStatus.ORDER_STATUS_0; | ||||
| } | } | ||||
| else if(EnumOrderStatus.getEnum(code).equals(EnumOrderStatus.ORDER_STATUS_PAYMENT_SUCCESS)){ | |||||
| else if(EnumOrderStatus.getEnum(orderStatus).equals(EnumOrderStatus.ORDER_STATUS_PAYMENT_SUCCESS)){ | |||||
| if(EnumCouponOrderStatus.getEnum(couponOrderStatus).equals(EnumCouponOrderStatus.COUPON_ORDER_USED)){ | |||||
| return EnumTtOrderStatus.ORDER_STATUS_4; | |||||
| } | |||||
| if(EnumCouponOrderStatus.getEnum(couponOrderStatus).equals(EnumCouponOrderStatus.COUPON_ORDER_OVER_TIME)){ | |||||
| return EnumTtOrderStatus.ORDER_STATUS_3; | |||||
| } | |||||
| return EnumTtOrderStatus.ORDER_STATUS_1; | return EnumTtOrderStatus.ORDER_STATUS_1; | ||||
| } | } | ||||
| else if(EnumOrderStatus.getEnum(code).equals(EnumOrderStatus.ORDER_STATUS_OVERTIME_CANCEL)){ | |||||
| else if(EnumOrderStatus.getEnum(orderStatus).equals(EnumOrderStatus.ORDER_STATUS_OVERTIME_CANCEL)){ | |||||
| return EnumTtOrderStatus.ORDER_STATUS_2; | return EnumTtOrderStatus.ORDER_STATUS_2; | ||||
| } | } | ||||
| else if(EnumOrderStatus.getEnum(code).equals(EnumOrderStatus.ORDER_STATUS_PENDING_REFUND)){ | |||||
| else if(EnumOrderStatus.getEnum(orderStatus).equals(EnumOrderStatus.ORDER_STATUS_PENDING_REFUND)){ | |||||
| return EnumTtOrderStatus.ORDER_STATUS_5; | return EnumTtOrderStatus.ORDER_STATUS_5; | ||||
| } | } | ||||
| else if(EnumOrderStatus.getEnum(code).equals(EnumOrderStatus.ORDER_STATUS_REFUND_SUCCESS)){ | |||||
| else if(EnumOrderStatus.getEnum(orderStatus).equals(EnumOrderStatus.ORDER_STATUS_REFUND_SUCCESS)){ | |||||
| return EnumTtOrderStatus.ORDER_STATUS_6; | return EnumTtOrderStatus.ORDER_STATUS_6; | ||||
| } | } | ||||
| else if(EnumOrderStatus.getEnum(code).equals(EnumOrderStatus.ORDER_STATUS_REFUND_FAILD)){ | |||||
| else if(EnumOrderStatus.getEnum(orderStatus).equals(EnumOrderStatus.ORDER_STATUS_REFUND_FAILD)){ | |||||
| return EnumTtOrderStatus.ORDER_STATUS_8; | return EnumTtOrderStatus.ORDER_STATUS_8; | ||||
| } | } | ||||
| log.error("订单状态异常 。。。"); | log.error("订单状态异常 。。。"); | ||||
| @@ -343,7 +343,7 @@ | |||||
| <select id="findSimpleDetail" parameterType="com.iformall.domain.po.WxCoupon" resultMap="BaseResultMap"> | <select id="findSimpleDetail" parameterType="com.iformall.domain.po.WxCoupon" resultMap="BaseResultMap"> | ||||
| select c.id,c.type,c.cover_img,c.title,c.sub_title,c.sale_price,c.use_price,c.price,c.tail_price,c.orig_price,c.unit,c.detail,c.remark,c.valid_type,c.valid_start_date, | select c.id,c.type,c.cover_img,c.title,c.sub_title,c.sale_price,c.use_price,c.price,c.tail_price,c.orig_price,c.unit,c.detail,c.remark,c.valid_type,c.valid_start_date, | ||||
| c.valid_end_date,c.pick_start_date,c.pick_end_date,c.auto_refund,c.business,c.subsidy_type,c.source_type,c.gift_list,c.support_transfer,c.subsidy_num | |||||
| c.valid_end_date,c.pick_start_date,c.pick_end_date,c.auto_refund,c.business,c.subsidy_type,c.source_type,c.content_type,c.gift_list,c.support_transfer,c.subsidy_num | |||||
| from wx_coupon c where c.id = #{id} and c.`tenant_id` = #{tenantId} | from wx_coupon c where c.id = #{id} and c.`tenant_id` = #{tenantId} | ||||
| </select> | </select> | ||||
| @@ -359,7 +359,7 @@ | |||||
| <select id="findSimpleDetailList" parameterType="com.iformall.domain.po.WxCoupon" resultMap="BaseResultMap"> | <select id="findSimpleDetailList" parameterType="com.iformall.domain.po.WxCoupon" resultMap="BaseResultMap"> | ||||
| select c.id,c.type,c.cover_img,c.title,c.sub_title,c.sale_price,c.use_price,c.price,c.tail_price,c.orig_price,c.unit,c.detail,c.remark,c.valid_type,c.valid_start_date, | select c.id,c.type,c.cover_img,c.title,c.sub_title,c.sale_price,c.use_price,c.price,c.tail_price,c.orig_price,c.unit,c.detail,c.remark,c.valid_type,c.valid_start_date, | ||||
| c.valid_end_date,c.pick_start_date,c.pick_end_date,c.auto_refund,c.business,c.subsidy_type,c.source_type | |||||
| c.valid_end_date,c.pick_start_date,c.pick_end_date,c.auto_refund,c.business,c.subsidy_type,c.source_type,c.content_type | |||||
| from wx_coupon c | from wx_coupon c | ||||
| <include refid="dynamicWhereConditions"/> | <include refid="dynamicWhereConditions"/> | ||||
| </select> | </select> | ||||