| @@ -0,0 +1,2 @@ | |||||
| ALTER TABLE `wx_order` | |||||
| ADD COLUMN `form_id` VARCHAR(64) NULL COMMENT 'formId' AFTER `order_group_id`; | |||||
| @@ -39,13 +39,14 @@ public class WxOrderController extends BaseController { | |||||
| @Autowired | @Autowired | ||||
| private WxOrderService wxOrderService; | private WxOrderService wxOrderService; | ||||
| @ApiOperation(value = "免费领取", notes = "{\"couponChannelId\":\"String\",\"couponId\":\"String\"}") | |||||
| @ApiOperation(value = "免费领取", notes = "{\"couponChannelId\":\"String\",\"couponId\":\"String\",\"formId\":\"String\"}") | |||||
| @PostMapping("freeCoupon") | @PostMapping("freeCoupon") | ||||
| public ResultData freeCoupon(@RequestBody Map<String, String> paramMap) { | public ResultData freeCoupon(@RequestBody Map<String, String> paramMap) { | ||||
| //Assert.notNull(wxOrders.getName(), "角色名不能为空"); | //Assert.notNull(wxOrders.getName(), "角色名不能为空"); | ||||
| //Assert.isTrue(!checkUnique(sysRole.getName(), null), "重复的角色名"); | //Assert.isTrue(!checkUnique(sysRole.getName(), null), "重复的角色名"); | ||||
| String couponChannelIdStr = paramMap.get("couponChannelId"); | String couponChannelIdStr = paramMap.get("couponChannelId"); | ||||
| String couponIdStr = paramMap.get("couponId"); | String couponIdStr = paramMap.get("couponId"); | ||||
| String formId = paramMap.get("formId"); | |||||
| if (StringUtils.isBlank(couponChannelIdStr)) { | if (StringUtils.isBlank(couponChannelIdStr)) { | ||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "couponChannelId不能为空"); | return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "couponChannelId不能为空"); | ||||
| } | } | ||||
| @@ -72,7 +73,7 @@ public class WxOrderController extends BaseController { | |||||
| WxOrder order = null; | WxOrder order = null; | ||||
| try { | try { | ||||
| order = wxOrderService.saveFreeCouponOrder(getUserId(), couponChannelId, couponId); | |||||
| order = wxOrderService.saveFreeCouponOrder(getUserId(), couponChannelId, couponId, formId); | |||||
| return new ResultData(order); | return new ResultData(order); | ||||
| } catch (MallinkException e) { | } catch (MallinkException e) { | ||||
| logger.error(e.getMessage()); | logger.error(e.getMessage()); | ||||
| @@ -83,7 +84,7 @@ public class WxOrderController extends BaseController { | |||||
| } | } | ||||
| } | } | ||||
| @ApiOperation(value = "下订单", notes = "{\"couponChannelId\":\"String\",\"couponId\":\"String\",\"press\":\"String\",\"orderGroupId\":\"String\"}") | |||||
| @ApiOperation(value = "下订单", notes = "{\"couponChannelId\":\"String\",\"couponId\":\"String\",\"press\":\"String\",\"orderGroupId\":\"String\",\"formId\":\"String\"}") | |||||
| @PostMapping("save") | @PostMapping("save") | ||||
| public ResultData saveOrder(@RequestBody Map<String, String> paramMap) { | public ResultData saveOrder(@RequestBody Map<String, String> paramMap) { | ||||
| logger.info("OrderSave: " + paramMap.toString()); | logger.info("OrderSave: " + paramMap.toString()); | ||||
| @@ -93,6 +94,7 @@ public class WxOrderController extends BaseController { | |||||
| String couponIdStr = paramMap.get("couponId"); | String couponIdStr = paramMap.get("couponId"); | ||||
| String pressStr = paramMap.get("press"); | String pressStr = paramMap.get("press"); | ||||
| String orderGroupIdStr = paramMap.get("orderGroupId"); | String orderGroupIdStr = paramMap.get("orderGroupId"); | ||||
| String formId = paramMap.get("formId"); | |||||
| if (StringUtils.isBlank(couponChannelIdStr)) { | if (StringUtils.isBlank(couponChannelIdStr)) { | ||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "couponChannelId不能为空"); | return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "couponChannelId不能为空"); | ||||
| @@ -165,7 +167,7 @@ public class WxOrderController extends BaseController { | |||||
| WxCUser user = getUser(); | WxCUser user = getUser(); | ||||
| try { | try { | ||||
| WxOrder order = wxOrderService.saveCouponOrder(user, couponChannelId, couponId, isPress, orderGroupId); | |||||
| WxOrder order = wxOrderService.saveCouponOrder(user, couponChannelId, couponId, isPress, orderGroupId, formId); | |||||
| return new ResultData(order); | return new ResultData(order); | ||||
| } catch (MallinkException e) { | } catch (MallinkException e) { | ||||
| logger.error(e.getMessage()); | logger.error(e.getMessage()); | ||||
| @@ -48,65 +48,52 @@ public class WxOrder implements Serializable { | |||||
| @Transient | @Transient | ||||
| private String phone; | private String phone; | ||||
| /**订单码;正反向交易保持一致。**/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="订单码;正反向交易保持一致。",name="orderNumber") | @io.swagger.annotations.ApiModelProperty(value="订单码;正反向交易保持一致。",name="orderNumber") | ||||
| private Long orderNumber; | private Long orderNumber; | ||||
| /**租户ID**/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="租户ID",name="tenantId") | @io.swagger.annotations.ApiModelProperty(value="租户ID",name="tenantId") | ||||
| private String tenantId; | private String tenantId; | ||||
| /**c端用户id**/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="c端用户id",name="cUserId") | @io.swagger.annotations.ApiModelProperty(value="c端用户id",name="cUserId") | ||||
| private Long cUserId; | private Long cUserId; | ||||
| /**渠道ID**/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="渠道ID",name="couponChannelId") | @io.swagger.annotations.ApiModelProperty(value="渠道ID",name="couponChannelId") | ||||
| private Long couponChannelId; | private Long couponChannelId; | ||||
| /**产品ID,根据order type**/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="产品ID(type-0:couponId, 1:buserId, 3:merchantId)",name="productId") | @io.swagger.annotations.ApiModelProperty(value="产品ID(type-0:couponId, 1:buserId, 3:merchantId)",name="productId") | ||||
| private Long productId; | private Long productId; | ||||
| /**类型0:券,1:B刷卡支付,2:C扫码支付,3:储值卡**/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="类型",name="type") | |||||
| @io.swagger.annotations.ApiModelProperty(value="类型(0:券,1:B刷卡支付,2:C扫码支付,3:储值卡)",name="type") | |||||
| private Integer type; | private Integer type; | ||||
| /**0: 付款 1: 退款**/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="0: 付款 1: 退款",name="paymentType") | @io.swagger.annotations.ApiModelProperty(value="0: 付款 1: 退款",name="paymentType") | ||||
| private Integer paymentType; | private Integer paymentType; | ||||
| /**支付金额(分):允许有负数,退款时为负值。**/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="支付金额(分):允许有负数,退款时为负值。",name="payment") | @io.swagger.annotations.ApiModelProperty(value="支付金额(分):允许有负数,退款时为负值。",name="payment") | ||||
| private Integer payment; | private Integer payment; | ||||
| /**支付时间**/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="支付时间",name="paymentTime") | @io.swagger.annotations.ApiModelProperty(value="支付时间",name="paymentTime") | ||||
| private Date paymentTime; | private Date paymentTime; | ||||
| /**订单状态:-1全部;正向交易:0-已下单/待付款;1-已支付;2-已取消(限定时间内未付款)反向交易:3-待退款;4-已退款,5-退款失败; 砍价:6-砍价中,7-砍价完成,8-砍价失败**/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="订单状态:-1全部;正向交易:0-已下单/待付款;1-已支付;2-已取消(限定时间内未付款)反向交易:3-已退款; 4-退款失败,5-退款失败; 砍价:6-砍价中,7-砍价完成,8-砍价失败",name="orderStatus") | @io.swagger.annotations.ApiModelProperty(value="订单状态:-1全部;正向交易:0-已下单/待付款;1-已支付;2-已取消(限定时间内未付款)反向交易:3-已退款; 4-退款失败,5-退款失败; 砍价:6-砍价中,7-砍价完成,8-砍价失败",name="orderStatus") | ||||
| private Integer orderStatus; | private Integer orderStatus; | ||||
| /**创建时间/砍价开始时间**/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="创建时间/砍价开始时间",name="createDate") | @io.swagger.annotations.ApiModelProperty(value="创建时间/砍价开始时间",name="createDate") | ||||
| private Date createDate; | private Date createDate; | ||||
| /**更新时间**/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="更新时间",name="updateDate") | @io.swagger.annotations.ApiModelProperty(value="更新时间",name="updateDate") | ||||
| private Date updateDate; | private Date updateDate; | ||||
| /**支付描述,订单支付时用**/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="支付描述,订单支付时用",name="detail") | @io.swagger.annotations.ApiModelProperty(value="支付描述,订单支付时用",name="detail") | ||||
| private String detail; | private String detail; | ||||
| /**砍价结束时间**/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="砍价结束时间",name="pressEndDate") | @io.swagger.annotations.ApiModelProperty(value="砍价结束时间",name="pressEndDate") | ||||
| private Date pressEndDate; | private Date pressEndDate; | ||||
| /**砍价人数**/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="砍价人数",name="pressCurrentNum") | @io.swagger.annotations.ApiModelProperty(value="砍价人数",name="pressCurrentNum") | ||||
| private Integer pressCurrentNum; | private Integer pressCurrentNum; | ||||
| /**已砍价格**/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="已砍价格",name="pressCurrentValue") | @io.swagger.annotations.ApiModelProperty(value="已砍价格",name="pressCurrentValue") | ||||
| private Integer pressCurrentValue; | private Integer pressCurrentValue; | ||||
| @io.swagger.annotations.ApiModelProperty(value = "拼团ID", name = "orderGroupId") | |||||
| private Long orderGroupId; | |||||
| @io.swagger.annotations.ApiModelProperty(value = "formId", name = "formId") | |||||
| private String formId; | |||||
| @Transient | @Transient | ||||
| protected List<Integer> statusS; | protected List<Integer> statusS; | ||||
| @Transient | @Transient | ||||
| protected String statusStr; | protected String statusStr; | ||||
| @io.swagger.annotations.ApiModelProperty(value = "拼团ID", name = "orderGroupId") | |||||
| private Long orderGroupId; | |||||
| public Long getOrderNumber() { | public Long getOrderNumber() { | ||||
| return orderNumber; | return orderNumber; | ||||
| @@ -275,7 +262,15 @@ public class WxOrder implements Serializable { | |||||
| this.orderGroupId = orderGroupId; | this.orderGroupId = orderGroupId; | ||||
| } | } | ||||
| public static enum Field | |||||
| public String getFormId() { | |||||
| return formId; | |||||
| } | |||||
| public void setFormId(String formId) { | |||||
| this.formId = formId; | |||||
| } | |||||
| public static enum Field | |||||
| { | { | ||||
| Id_ASC("`id` ASC"),Id_DESC("`id` DESC") | Id_ASC("`id` ASC"),Id_DESC("`id` DESC") | ||||
| ,OrderNumber_ASC("`order_number` ASC"),OrderNumber_DESC("`order_number` DESC") | ,OrderNumber_ASC("`order_number` ASC"),OrderNumber_DESC("`order_number` DESC") | ||||
| @@ -21,21 +21,15 @@ public class WxTemplateMsg implements Serializable { | |||||
| protected List<Long> ids; | protected List<Long> ids; | ||||
| @Transient | @Transient | ||||
| protected String sortColumns; | protected String sortColumns; | ||||
| /**租户ID**/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="租户ID",name="tenantId") | @io.swagger.annotations.ApiModelProperty(value="租户ID",name="tenantId") | ||||
| private String tenantId; | private String tenantId; | ||||
| /**模板ID**/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="模板ID",name="templateId") | @io.swagger.annotations.ApiModelProperty(value="模板ID",name="templateId") | ||||
| private String templateId; | private String templateId; | ||||
| /**模板类型1:核销成功消息, 2:核销失败消息**/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="模板类型1:核销成功消息,2:核销失败消息",name="type") | |||||
| @io.swagger.annotations.ApiModelProperty(value="模板类型1:核销成功消息,2:核销失败消息, 101:公众号审核结果消息, 102:公众号卡券核销消息",name="type") | |||||
| private Integer type; | private Integer type; | ||||
| /**创建时间**/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="创建时间",name="createDate") | @io.swagger.annotations.ApiModelProperty(value="创建时间",name="createDate") | ||||
| private Date createDate; | private Date createDate; | ||||
| /**更新时间**/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="更新时间",name="updateDate") | @io.swagger.annotations.ApiModelProperty(value="更新时间",name="updateDate") | ||||
| private Date updateDate; | private Date updateDate; | ||||
| @@ -33,6 +33,14 @@ public interface WxOrderService { | |||||
| ResultData microPayListOnDateAsPage(Long bUserId, Integer type, String date, Integer pageIndex, Integer pageSize); | ResultData microPayListOnDateAsPage(Long bUserId, Integer type, String date, Integer pageIndex, Integer pageSize); | ||||
| /** | |||||
| * 下免费券订单接口 | |||||
| * @param userId | |||||
| * @param couponId | |||||
| * @return WxOrder | |||||
| */ | |||||
| WxOrder saveFreeCouponOrder(Long userId, Long couponChannelId, Long couponId, String formId); | |||||
| /** | /** | ||||
| * 提交订单 | * 提交订单 | ||||
| * @param user | * @param user | ||||
| @@ -40,7 +48,7 @@ public interface WxOrderService { | |||||
| * @param orderGroupId | * @param orderGroupId | ||||
| * @return 订单id | * @return 订单id | ||||
| */ | */ | ||||
| WxOrder saveCouponOrder(WxCUser user, Long couponChannelId, Long couponId, boolean isPress, Long orderGroupId); | |||||
| WxOrder saveCouponOrder(WxCUser user, Long couponChannelId, Long couponId, boolean isPress, Long orderGroupId, String formId); | |||||
| /** | /** | ||||
| * 付款码支付 | * 付款码支付 | ||||
| @@ -60,14 +68,6 @@ public interface WxOrderService { | |||||
| */ | */ | ||||
| WxOrder saveCardPayOrder(WxMerchant merchant, Long cUserId, String totalFeeStr, Integer payment); | WxOrder saveCardPayOrder(WxMerchant merchant, Long cUserId, String totalFeeStr, Integer payment); | ||||
| /** | |||||
| * 免费券订单接口 | |||||
| * @param userId | |||||
| * @param couponId | |||||
| * @return WxOrder | |||||
| */ | |||||
| WxOrder saveFreeCouponOrder(Long userId, Long couponChannelId, Long couponId); | |||||
| /** | /** | ||||
| * 免费券订单接口 | * 免费券订单接口 | ||||
| * @param userId | * @param userId | ||||
| @@ -26,6 +26,7 @@ import com.iformall.utils.Constant; | |||||
| import com.iformall.utils.DateUtils; | import com.iformall.utils.DateUtils; | ||||
| import com.iformall.utils.MaUtil; | import com.iformall.utils.MaUtil; | ||||
| import me.chanjar.weixin.common.error.WxErrorException; | import me.chanjar.weixin.common.error.WxErrorException; | ||||
| import org.apache.commons.lang3.StringUtils; | |||||
| import org.apache.poi.ss.usermodel.Workbook; | import org.apache.poi.ss.usermodel.Workbook; | ||||
| import org.slf4j.Logger; | import org.slf4j.Logger; | ||||
| import org.slf4j.LoggerFactory; | import org.slf4j.LoggerFactory; | ||||
| @@ -535,16 +536,16 @@ public class WxCouponOrderServiceImpl implements WxCouponOrderService { | |||||
| logger.error("找不到订单信息"); | logger.error("找不到订单信息"); | ||||
| throw new MallinkException(ErrorCode.ORDER_IS_NOT_FIND); | throw new MallinkException(ErrorCode.ORDER_IS_NOT_FIND); | ||||
| } | } | ||||
| String formId = null; | |||||
| if(StringUtils.isNotBlank(order.getFormId())) { | |||||
| formId = order.getFormId(); | |||||
| } | |||||
| // 2. get coupon info | // 2. get coupon info | ||||
| WxCoupon coupon = wxCouponMapper.selectByPrimaryKey(couponOrder.getCouponId()); | WxCoupon coupon = wxCouponMapper.selectByPrimaryKey(couponOrder.getCouponId()); | ||||
| if (coupon == null) { | if (coupon == null) { | ||||
| logger.error("找不到券信息"); | logger.error("找不到券信息"); | ||||
| throw new MallinkException(ErrorCode.COUPON_IS_EMPTY); | throw new MallinkException(ErrorCode.COUPON_IS_EMPTY); | ||||
| } | } | ||||
| if(coupon.getSalePrice().equals(0)) { | |||||
| logger.info("免费券不发模板消息!"); | |||||
| return; | |||||
| } | |||||
| // 3. merchant info | // 3. merchant info | ||||
| WxMerchant merchant = wxMerchantMapper.selectByPrimaryKey(bUser.getMerchantId()); | WxMerchant merchant = wxMerchantMapper.selectByPrimaryKey(bUser.getMerchantId()); | ||||
| if (merchant == null) { | if (merchant == null) { | ||||
| @@ -562,26 +563,27 @@ public class WxCouponOrderServiceImpl implements WxCouponOrderService { | |||||
| // WxAppinfo appInfo = wxAppinfoService.getByAppId(user.getAppId()); | // WxAppinfo appInfo = wxAppinfoService.getByAppId(user.getAppId()); | ||||
| // 6. get payOrder info | // 6. get payOrder info | ||||
| WxPayOrder payOrder = null; | |||||
| WxPayOrder payOrderQ = new WxPayOrder(); | |||||
| payOrderQ.setTenantId(couponOrder.getTenantId()); | |||||
| payOrderQ.setOrderId(order.getId()); | |||||
| payOrderQ.setPayOrderStatus(EnumPayStatus.PAY_STATUS_SUCCESS.getCode()); | |||||
| List<WxPayOrder> payList = wxPayOrderMapper.select(payOrderQ); | |||||
| if (payList.size() > 0) { | |||||
| payOrder = payList.get(0); | |||||
| } | |||||
| if (payOrder == null) { | |||||
| logger.error("找不到payOrder信息"); | |||||
| throw new MallinkException(ErrorCode.PAY_ORDER_NOT_FOUND); | |||||
| } | |||||
| if (payOrder.getPrepayId() == null) { | |||||
| logger.error("payOrder信息中,prepay_id为空"); | |||||
| throw new MallinkException(ErrorCode.PREPAY_ID_IS_EMPTY); | |||||
| if(StringUtils.isBlank(order.getFormId())) { | |||||
| WxPayOrder payOrder = null; | |||||
| WxPayOrder payOrderQ = new WxPayOrder(); | |||||
| payOrderQ.setTenantId(couponOrder.getTenantId()); | |||||
| payOrderQ.setOrderId(order.getId()); | |||||
| payOrderQ.setPayOrderStatus(EnumPayStatus.PAY_STATUS_SUCCESS.getCode()); | |||||
| List<WxPayOrder> payList = wxPayOrderMapper.select(payOrderQ); | |||||
| if (payList.size() > 0) { | |||||
| payOrder = payList.get(0); | |||||
| } | |||||
| if (payOrder == null) { | |||||
| logger.error("找不到payOrder信息"); | |||||
| throw new MallinkException(ErrorCode.PAY_ORDER_NOT_FOUND); | |||||
| } | |||||
| if (payOrder.getPrepayId() == null) { | |||||
| logger.error("payOrder信息中,prepay_id为空"); | |||||
| throw new MallinkException(ErrorCode.PREPAY_ID_IS_EMPTY); | |||||
| } | |||||
| formId = payOrder.getPrepayId(); | |||||
| } | } | ||||
| // WxMaService wxMaService = MaUtil.getWeappService(appInfo); | |||||
| SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS"); | SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS"); | ||||
| String couponDetail = ""; | String couponDetail = ""; | ||||
| if (coupon.getType() == EnumCouponType.COUPON_MANJIAN.getCode()) { | if (coupon.getType() == EnumCouponType.COUPON_MANJIAN.getCode()) { | ||||
| @@ -596,7 +598,7 @@ public class WxCouponOrderServiceImpl implements WxCouponOrderService { | |||||
| gotopage = "pages/couponorder/index/index"; | gotopage = "pages/couponorder/index/index"; | ||||
| notes = "您有新的券"; | notes = "您有新的券"; | ||||
| } | } | ||||
| //mq发送小程序消息 | |||||
| //mq发送小程序消息 - 核销成功消息 | |||||
| smartAppMsg = new SmartAppMsg(); | smartAppMsg = new SmartAppMsg(); | ||||
| smartAppMsg.setMsgType(EnumMsgRecordType.SMART_APP.getCode()); | smartAppMsg.setMsgType(EnumMsgRecordType.SMART_APP.getCode()); | ||||
| smartAppMsg.setAppId(user.getAppId()); | smartAppMsg.setAppId(user.getAppId()); | ||||
| @@ -604,7 +606,7 @@ public class WxCouponOrderServiceImpl implements WxCouponOrderService { | |||||
| smartAppMsg.setTemplateType(EnumTemplateType.VERIFY_SUCCESS.getCode()); | smartAppMsg.setTemplateType(EnumTemplateType.VERIFY_SUCCESS.getCode()); | ||||
| smartAppMsg.setGotopage(gotopage); | smartAppMsg.setGotopage(gotopage); | ||||
| smartAppMsg.setTo(user.getOpenId()); | smartAppMsg.setTo(user.getOpenId()); | ||||
| smartAppMsg.setFrom(payOrder.getPrepayId()); | |||||
| smartAppMsg.setFormId(formId); | |||||
| smartAppMsg.setTemplateDataList(Lists.newArrayList( | smartAppMsg.setTemplateDataList(Lists.newArrayList( | ||||
| new WxMaTemplateData("keyword1", coupon.getPriceStr() + "元", "#173177"), | new WxMaTemplateData("keyword1", coupon.getPriceStr() + "元", "#173177"), | ||||
| new WxMaTemplateData("keyword2", merchant.getName(), "#173177"), | new WxMaTemplateData("keyword2", merchant.getName(), "#173177"), | ||||
| @@ -615,7 +617,7 @@ public class WxCouponOrderServiceImpl implements WxCouponOrderService { | |||||
| new WxMaTemplateData("keyword7", notes, "#173177"))); | new WxMaTemplateData("keyword7", notes, "#173177"))); | ||||
| smartAppMsg.setEmphasisKeyword("keyword1.DATA"); | smartAppMsg.setEmphasisKeyword("keyword1.DATA"); | ||||
| } else { | } else { | ||||
| //mq发送小程序消息 | |||||
| //mq发送小程序消息 - 核销失败消息 | |||||
| smartAppMsg = new SmartAppMsg(); | smartAppMsg = new SmartAppMsg(); | ||||
| smartAppMsg.setMsgType(EnumMsgRecordType.SMART_APP.getCode()); | smartAppMsg.setMsgType(EnumMsgRecordType.SMART_APP.getCode()); | ||||
| smartAppMsg.setAppId(user.getAppId()); | smartAppMsg.setAppId(user.getAppId()); | ||||
| @@ -624,7 +626,7 @@ public class WxCouponOrderServiceImpl implements WxCouponOrderService { | |||||
| smartAppMsg.setGotopage("pages/index/index"); | smartAppMsg.setGotopage("pages/index/index"); | ||||
| smartAppMsg.setTo(user.getOpenId()); | smartAppMsg.setTo(user.getOpenId()); | ||||
| smartAppMsg.setReceiver(user.getOpenId()); | smartAppMsg.setReceiver(user.getOpenId()); | ||||
| smartAppMsg.setFrom(payOrder.getPrepayId()); | |||||
| smartAppMsg.setFormId(formId); | |||||
| smartAppMsg.setTemplateDataList(Lists.newArrayList( | smartAppMsg.setTemplateDataList(Lists.newArrayList( | ||||
| new WxMaTemplateData("keyword1", coupon.getTitle(), "#173177"), | new WxMaTemplateData("keyword1", coupon.getTitle(), "#173177"), | ||||
| new WxMaTemplateData("keyword2", dateFormat.format(new Date()), "#173177"), | new WxMaTemplateData("keyword2", dateFormat.format(new Date()), "#173177"), | ||||
| @@ -337,7 +337,7 @@ public class WxOrderServiceImpl implements WxOrderService { | |||||
| @Override | @Override | ||||
| @Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = {Exception.class}) | @Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = {Exception.class}) | ||||
| public WxOrder saveCouponOrder(WxCUser user, Long couponChannelId, Long couponId, boolean isPress, Long orderGroupId) { | |||||
| public WxOrder saveCouponOrder(WxCUser user, Long couponChannelId, Long couponId, boolean isPress, Long orderGroupId, String formId) { | |||||
| // 检查用户 | // 检查用户 | ||||
| if (user == null) { | if (user == null) { | ||||
| logger.error("用户不存在"); | logger.error("用户不存在"); | ||||
| @@ -428,6 +428,7 @@ public class WxOrderServiceImpl implements WxOrderService { | |||||
| record.setCreateDate(curr); | record.setCreateDate(curr); | ||||
| record.setUpdateDate(curr); | record.setUpdateDate(curr); | ||||
| record.setOrderGroupId(orderGroupId); | record.setOrderGroupId(orderGroupId); | ||||
| record.setFormId(formId); | |||||
| if (isPress) { | if (isPress) { | ||||
| // 初始砍价信息 | // 初始砍价信息 | ||||
| @@ -688,7 +689,7 @@ public class WxOrderServiceImpl implements WxOrderService { | |||||
| @Override | @Override | ||||
| @Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = {Exception.class}) | @Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = {Exception.class}) | ||||
| public WxOrder saveFreeCouponOrder(Long userId, Long couponChannelId, Long couponId) { | |||||
| public WxOrder saveFreeCouponOrder(Long userId, Long couponChannelId, Long couponId, String formId) { | |||||
| // check 用户状态 | // check 用户状态 | ||||
| WxCUser user = null; | WxCUser user = null; | ||||
| try { | try { | ||||
| @@ -750,6 +751,7 @@ public class WxOrderServiceImpl implements WxOrderService { | |||||
| record.setDetail(bodyStr); | record.setDetail(bodyStr); | ||||
| record.setCreateDate(curr); | record.setCreateDate(curr); | ||||
| record.setUpdateDate(curr); | record.setUpdateDate(curr); | ||||
| record.setFormId(formId); | |||||
| // 保存订单 | // 保存订单 | ||||
| try { | try { | ||||
| @@ -20,12 +20,13 @@ | |||||
| <result column="press_current_num" jdbcType="INTEGER" property="pressCurrentNum"/> | <result column="press_current_num" jdbcType="INTEGER" property="pressCurrentNum"/> | ||||
| <result column="press_current_value" jdbcType="INTEGER" property="pressCurrentValue"/> | <result column="press_current_value" jdbcType="INTEGER" property="pressCurrentValue"/> | ||||
| <result column="order_group_id" jdbcType="BIGINT" property="orderGroupId"/> | <result column="order_group_id" jdbcType="BIGINT" property="orderGroupId"/> | ||||
| <result column="form_id" jdbcType="VARCHAR" property="formId"/> | |||||
| </resultMap> | </resultMap> | ||||
| <sql id="allColumns"> | <sql id="allColumns"> | ||||
| `id`,`order_number`,`tenant_id`,`c_user_id`,`coupon_channel_id`,`product_id`,`type`,`payment_type`,`payment`,`payment_time`,`order_status`,`create_date`,`update_date`,`detail`, | `id`,`order_number`,`tenant_id`,`c_user_id`,`coupon_channel_id`,`product_id`,`type`,`payment_type`,`payment`,`payment_time`,`order_status`,`create_date`,`update_date`,`detail`, | ||||
| `press_end_date`,`press_current_num`,`press_current_value`,`order_group_id` | |||||
| `press_end_date`,`press_current_num`,`press_current_value`,`order_group_id`,`form_id` | |||||
| </sql> | </sql> | ||||
| <sql id="dynamicWhereConditions"> | <sql id="dynamicWhereConditions"> | ||||
| @@ -102,6 +103,10 @@ | |||||
| <if test=" null != orderGroupId "> | <if test=" null != orderGroupId "> | ||||
| and `order_group_id` = #{orderGroupId} | and `order_group_id` = #{orderGroupId} | ||||
| </if> | </if> | ||||
| <if test=" null != formId "> | |||||
| and `form_id` = #{formId} | |||||
| </if> | |||||
| <if test=" null != statusS "> | <if test=" null != statusS "> | ||||
| and `order_status` in | and `order_status` in | ||||