| @@ -0,0 +1,3 @@ | |||||
| alter table wx_card_info add column coupon_password varchar(50) comment '卡密'; | |||||
| @@ -103,7 +103,7 @@ public class WxCouponPasswordController extends BaseController { | |||||
| try { | try { | ||||
| WxComposeOrder composeOrder = orderFactory.getOrderAdapterService(EnumComposeOrder.SINGLE.getCode()).createDBMainOrder(coupon, member, 0, payWay,payVersion); | WxComposeOrder composeOrder = orderFactory.getOrderAdapterService(EnumComposeOrder.SINGLE.getCode()).createDBMainOrder(coupon, member, 0, payWay,payVersion); | ||||
| WxOrder order = orderService.saveFreeOrderForCoupon(new Date(),false,composeOrder,member, coupon, 1, | WxOrder order = orderService.saveFreeOrderForCoupon(new Date(),false,composeOrder,member, coupon, 1, | ||||
| null, formId, couponPassword.getId(),null,payWay,payVersion, | |||||
| null, formId, couponPassword,null,payWay,payVersion, | |||||
| EnumOrderShopingType.ONLINE_PURCHASE.getCode(),null,false); | EnumOrderShopingType.ONLINE_PURCHASE.getCode(),null,false); | ||||
| } catch (MallinkException e) { | } catch (MallinkException e) { | ||||
| setCouponPasswordStatus(couponPassword, EnumCouponPasswordStatus.getEnum(pwdStatus)); | setCouponPasswordStatus(couponPassword, EnumCouponPasswordStatus.getEnum(pwdStatus)); | ||||
| @@ -24,6 +24,8 @@ public class WxCardInfo extends TenantEntity { | |||||
| protected Long id; | protected Long id; | ||||
| @io.swagger.annotations.ApiModelProperty(value="卡密编码",name="couponPasswordId") | @io.swagger.annotations.ApiModelProperty(value="卡密编码",name="couponPasswordId") | ||||
| protected Long couponPasswordId; | protected Long couponPasswordId; | ||||
| @io.swagger.annotations.ApiModelProperty(value="卡密",name="couponPassword") | |||||
| protected String couponPassword; | |||||
| @TableField(exist = false) | @TableField(exist = false) | ||||
| protected Long couponPasswordIdLike; | protected Long couponPasswordIdLike; | ||||
| @io.swagger.annotations.ApiModelProperty(value="卡类型EnumCardInfoType",name="type") | @io.swagger.annotations.ApiModelProperty(value="卡类型EnumCardInfoType",name="type") | ||||
| @@ -215,7 +215,7 @@ public interface WxOrderService { | |||||
| // 2. 创建免费订单, 领取 couponOrder | // 2. 创建免费订单, 领取 couponOrder | ||||
| WxOrder saveFreeOrderForCoupon(Date orderDate,boolean allowUnPayOrder,WxComposeOrder composeOrder, WxCUserBasicInfo user, WxCoupon coupon, int couponNumber, | WxOrder saveFreeOrderForCoupon(Date orderDate,boolean allowUnPayOrder,WxComposeOrder composeOrder, WxCUserBasicInfo user, WxCoupon coupon, int couponNumber, | ||||
| WxCouponChannel couponChannel, String formId, Long couponPasswordId,String extParam, EnumPayWay payWay,EnumPayVersion payVersion, | |||||
| WxCouponChannel couponChannel, String formId, WxCouponPassword couponPassWord,String extParam, EnumPayWay payWay,EnumPayVersion payVersion, | |||||
| Integer shippingType, UserBasicInfoAddress address,boolean isPressOrder); | Integer shippingType, UserBasicInfoAddress address,boolean isPressOrder); | ||||
| // 3. 创建有价订单 | // 3. 创建有价订单 | ||||
| @@ -1022,13 +1022,9 @@ public class WxCouponServiceImpl implements WxCouponService { | |||||
| if (null == count || count <= 0 ) { | if (null == count || count <= 0 ) { | ||||
| return new ResultData(Result.ERROR,"设置失败"); | return new ResultData(Result.ERROR,"设置失败"); | ||||
| } | } | ||||
| //TODO 设置卡密金额 | |||||
| return new ResultData(); | return new ResultData(); | ||||
| } | } | ||||
| @Override | @Override | ||||
| public ResultData updateTtProduct(WxCoupon record) { | public ResultData updateTtProduct(WxCoupon record) { | ||||
| if(EnumCouponType.getDouYinType().contains(record.getType())){ | if(EnumCouponType.getDouYinType().contains(record.getType())){ | ||||
| @@ -1351,7 +1351,7 @@ public class WxOrderServiceImpl implements WxOrderService { | |||||
| * @param coupon | * @param coupon | ||||
| */ | */ | ||||
| @Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = {Exception.class}) | @Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = {Exception.class}) | ||||
| public WxCouponOrder createCouponOrder(Date curr,WxOrder order, WxCUserBasicInfo user, WxCoupon coupon, Long couponPasswordId,EnumPayWay payWay,EnumPayVersion payVersion,Long merchantId,Long bUserId,Long parentCouponOrderId) { | |||||
| public WxCouponOrder createCouponOrder(Date curr,WxOrder order, WxCUserBasicInfo user, WxCoupon coupon, WxCouponPassword couponPassWord,EnumPayWay payWay,EnumPayVersion payVersion,Long merchantId,Long bUserId,Long parentCouponOrderId) { | |||||
| Date valid_date = null; | Date valid_date = null; | ||||
| //int limit_days = Constant.WX_LIMIT_DAYS; | //int limit_days = Constant.WX_LIMIT_DAYS; | ||||
| WxPayOrder payOrder = null; | WxPayOrder payOrder = null; | ||||
| @@ -1455,7 +1455,8 @@ public class WxOrderServiceImpl implements WxOrderService { | |||||
| cardInfo.setCouponId(order.getProductId()); | cardInfo.setCouponId(order.getProductId()); | ||||
| cardInfo.setAmount(coupon.getPrice()); | cardInfo.setAmount(coupon.getPrice()); | ||||
| cardInfo.setSaleAmount(coupon.getSalePrice()); | cardInfo.setSaleAmount(coupon.getSalePrice()); | ||||
| cardInfo.setCouponPasswordId(couponPasswordId); | |||||
| cardInfo.setCouponPasswordId(couponPassWord.getId()); | |||||
| cardInfo.setCouponPassword(couponPassWord.getPassword()); | |||||
| cardInfo.setRemainingAmount(coupon.getPrice()); | cardInfo.setRemainingAmount(coupon.getPrice()); | ||||
| if (!coupon.checkIsFree()) { | if (!coupon.checkIsFree()) { | ||||
| //判断该transctionId是否已经存在,如果存在,则不添加 | //判断该transctionId是否已经存在,如果存在,则不添加 | ||||
| @@ -1489,7 +1490,7 @@ public class WxOrderServiceImpl implements WxOrderService { | |||||
| cardInfo.setRateAmount(0); | cardInfo.setRateAmount(0); | ||||
| if (coupon.getPasswordSupport().equals(EnumCouponPasswordSupport.SUPPORTED.getCode())) { | if (coupon.getPasswordSupport().equals(EnumCouponPasswordSupport.SUPPORTED.getCode())) { | ||||
| WxCouponPassword updateCPwd = new WxCouponPassword(); | WxCouponPassword updateCPwd = new WxCouponPassword(); | ||||
| updateCPwd.setId(couponPasswordId); | |||||
| updateCPwd.setId(couponPassWord.getId()); | |||||
| updateCPwd.setCardId(cardInfo.getId()); | updateCPwd.setCardId(cardInfo.getId()); | ||||
| updateCPwd.setStatus(EnumCouponPasswordStatus.USED.getCode()); | updateCPwd.setStatus(EnumCouponPasswordStatus.USED.getCode()); | ||||
| couponPasswordMapper.updateById(updateCPwd); | couponPasswordMapper.updateById(updateCPwd); | ||||
| @@ -2999,7 +3000,7 @@ public class WxOrderServiceImpl implements WxOrderService { | |||||
| @Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = {Exception.class}) | @Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = {Exception.class}) | ||||
| @Override | @Override | ||||
| public WxOrder saveFreeOrderForCoupon(Date orderDate,boolean allowUnPayOrder,WxComposeOrder composeOrder,WxCUserBasicInfo user, WxCoupon coupon,int couponNumber, | public WxOrder saveFreeOrderForCoupon(Date orderDate,boolean allowUnPayOrder,WxComposeOrder composeOrder,WxCUserBasicInfo user, WxCoupon coupon,int couponNumber, | ||||
| WxCouponChannel couponChannel, String formId, Long couponPasswordId,String extParam,EnumPayWay payWay,EnumPayVersion payVersion, | |||||
| WxCouponChannel couponChannel, String formId, WxCouponPassword wxCouponPassword,String extParam,EnumPayWay payWay,EnumPayVersion payVersion, | |||||
| Integer shippingType, UserBasicInfoAddress address,boolean isPressOrder) { | Integer shippingType, UserBasicInfoAddress address,boolean isPressOrder) { | ||||
| WxOrderServiceImpl proxy = (WxOrderServiceImpl) AopContext.currentProxy(); | WxOrderServiceImpl proxy = (WxOrderServiceImpl) AopContext.currentProxy(); | ||||
| @@ -3059,7 +3060,7 @@ public class WxOrderServiceImpl implements WxOrderService { | |||||
| } | } | ||||
| // 5. 创建couponOrder | // 5. 创建couponOrder | ||||
| try { | try { | ||||
| proxy.createCouponOrder(orderDate,record, user, coupon, couponPasswordId,payWay,payVersion,null,null,null); | |||||
| proxy.createCouponOrder(orderDate,record, user, coupon, wxCouponPassword,payWay,payVersion,null,null,null); | |||||
| } catch (Exception e) { | } catch (Exception e) { | ||||
| logger.error("couponOrder失败:" + e.getMessage(),e); | logger.error("couponOrder失败:" + e.getMessage(),e); | ||||
| throw new MallinkException(ErrorCode.COUPON_ORDER_SAVE_ERR.getCode(),"["+coupon.getTitle()+"]保存券订单错误."+e.getMessage()); | throw new MallinkException(ErrorCode.COUPON_ORDER_SAVE_ERR.getCode(),"["+coupon.getTitle()+"]保存券订单错误."+e.getMessage()); | ||||
| @@ -18,13 +18,13 @@ | |||||
| <result column="update_date" jdbcType="TIMESTAMP" property="updateDate" /> | <result column="update_date" jdbcType="TIMESTAMP" property="updateDate" /> | ||||
| <result column="support_transfer" jdbcType="INTEGER" property="supportTransfer"/> | <result column="support_transfer" jdbcType="INTEGER" property="supportTransfer"/> | ||||
| <result column="coupon_password_id" jdbcType="BIGINT" property="couponPasswordId"/> | <result column="coupon_password_id" jdbcType="BIGINT" property="couponPasswordId"/> | ||||
| <result column="coupon_password" jdbcType="VARCHAR" property="couponPassword"/> | |||||
| </resultMap> | </resultMap> | ||||
| <sql id="allColumns"> | <sql id="allColumns"> | ||||
| `id`,`tenant_id`,`parent_tenant_id`,`coupon_id`,`coupon_password_id`,`transaction_id`, | |||||
| `amount`,`sale_amount`,`remaining_amount`,`service_fee_amount`, | |||||
| `share_fee_amount`,`remaining_share_fee_amount`, `rate_amount`, | |||||
| `create_date`,`update_date`,`support_transfer` | |||||
| `id`,`tenant_id`,`parent_tenant_id`,`coupon_id`,`coupon_password_id`,`coupon_password`,`transaction_id`, | |||||
| `amount`,`sale_amount`,`remaining_amount`,`service_fee_amount`,`share_fee_amount`,`remaining_share_fee_amount`, | |||||
| `rate_amount`,`create_date`,`update_date`,`support_transfer` | |||||
| </sql> | </sql> | ||||
| <sql id="dynamicWhereConditions"> | <sql id="dynamicWhereConditions"> | ||||
| @@ -77,6 +77,9 @@ | |||||
| <if test=" null != couponPasswordIdLike"> | <if test=" null != couponPasswordIdLike"> | ||||
| and `coupon_password_id` like concat('%',#{couponPasswordIdLike},'%') | and `coupon_password_id` like concat('%',#{couponPasswordIdLike},'%') | ||||
| </if> | </if> | ||||
| <if test=" null != couponPassword"> | |||||
| and `coupon_password` like concat('%',#{couponPassword},'%') | |||||
| </if> | |||||
| <if test=" null != startdate and null!=enddate"> | <if test=" null != startdate and null!=enddate"> | ||||
| and `create_date` between #{startdate} and #{enddate} | and `create_date` between #{startdate} and #{enddate} | ||||
| </if> | </if> | ||||