diff --git a/mallinkAdmin/src/main/resources/db/migration/V2023022800001__card.sql b/mallinkAdmin/src/main/resources/db/migration/V2023022800001__card.sql
new file mode 100644
index 000000000..36dfe5633
--- /dev/null
+++ b/mallinkAdmin/src/main/resources/db/migration/V2023022800001__card.sql
@@ -0,0 +1,3 @@
+alter table wx_card_info add column coupon_password varchar(50) comment '卡密';
+
+
diff --git a/mallinkCApi/src/main/java/com/iformall/controller/WxCouponPasswordController.java b/mallinkCApi/src/main/java/com/iformall/controller/WxCouponPasswordController.java
index b932990e4..4ec9331ed 100644
--- a/mallinkCApi/src/main/java/com/iformall/controller/WxCouponPasswordController.java
+++ b/mallinkCApi/src/main/java/com/iformall/controller/WxCouponPasswordController.java
@@ -103,7 +103,7 @@ public class WxCouponPasswordController extends BaseController {
try {
WxComposeOrder composeOrder = orderFactory.getOrderAdapterService(EnumComposeOrder.SINGLE.getCode()).createDBMainOrder(coupon, member, 0, payWay,payVersion);
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);
} catch (MallinkException e) {
setCouponPasswordStatus(couponPassword, EnumCouponPasswordStatus.getEnum(pwdStatus));
diff --git a/mallinkService/src/main/java/com/iformall/domain/po/WxCardInfo.java b/mallinkService/src/main/java/com/iformall/domain/po/WxCardInfo.java
index fd8f5dedc..3801b5f1e 100644
--- a/mallinkService/src/main/java/com/iformall/domain/po/WxCardInfo.java
+++ b/mallinkService/src/main/java/com/iformall/domain/po/WxCardInfo.java
@@ -24,6 +24,8 @@ public class WxCardInfo extends TenantEntity {
protected Long id;
@io.swagger.annotations.ApiModelProperty(value="卡密编码",name="couponPasswordId")
protected Long couponPasswordId;
+ @io.swagger.annotations.ApiModelProperty(value="卡密",name="couponPassword")
+ protected String couponPassword;
@TableField(exist = false)
protected Long couponPasswordIdLike;
@io.swagger.annotations.ApiModelProperty(value="卡类型EnumCardInfoType",name="type")
diff --git a/mallinkService/src/main/java/com/iformall/service/WxOrderService.java b/mallinkService/src/main/java/com/iformall/service/WxOrderService.java
index acf1e1054..d59f36158 100644
--- a/mallinkService/src/main/java/com/iformall/service/WxOrderService.java
+++ b/mallinkService/src/main/java/com/iformall/service/WxOrderService.java
@@ -215,7 +215,7 @@ public interface WxOrderService {
// 2. 创建免费订单, 领取 couponOrder
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);
// 3. 创建有价订单
diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxCouponServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxCouponServiceImpl.java
index 404e415cb..80ac9f12c 100644
--- a/mallinkService/src/main/java/com/iformall/service/impl/WxCouponServiceImpl.java
+++ b/mallinkService/src/main/java/com/iformall/service/impl/WxCouponServiceImpl.java
@@ -1022,13 +1022,9 @@ public class WxCouponServiceImpl implements WxCouponService {
if (null == count || count <= 0 ) {
return new ResultData(Result.ERROR,"设置失败");
}
- //TODO 设置卡密金额
return new ResultData();
}
-
-
-
@Override
public ResultData updateTtProduct(WxCoupon record) {
if(EnumCouponType.getDouYinType().contains(record.getType())){
diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxOrderServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxOrderServiceImpl.java
index bc3bcea27..ab998be30 100644
--- a/mallinkService/src/main/java/com/iformall/service/impl/WxOrderServiceImpl.java
+++ b/mallinkService/src/main/java/com/iformall/service/impl/WxOrderServiceImpl.java
@@ -1351,7 +1351,7 @@ public class WxOrderServiceImpl implements WxOrderService {
* @param coupon
*/
@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;
//int limit_days = Constant.WX_LIMIT_DAYS;
WxPayOrder payOrder = null;
@@ -1455,7 +1455,8 @@ public class WxOrderServiceImpl implements WxOrderService {
cardInfo.setCouponId(order.getProductId());
cardInfo.setAmount(coupon.getPrice());
cardInfo.setSaleAmount(coupon.getSalePrice());
- cardInfo.setCouponPasswordId(couponPasswordId);
+ cardInfo.setCouponPasswordId(couponPassWord.getId());
+ cardInfo.setCouponPassword(couponPassWord.getPassword());
cardInfo.setRemainingAmount(coupon.getPrice());
if (!coupon.checkIsFree()) {
//判断该transctionId是否已经存在,如果存在,则不添加
@@ -1489,7 +1490,7 @@ public class WxOrderServiceImpl implements WxOrderService {
cardInfo.setRateAmount(0);
if (coupon.getPasswordSupport().equals(EnumCouponPasswordSupport.SUPPORTED.getCode())) {
WxCouponPassword updateCPwd = new WxCouponPassword();
- updateCPwd.setId(couponPasswordId);
+ updateCPwd.setId(couponPassWord.getId());
updateCPwd.setCardId(cardInfo.getId());
updateCPwd.setStatus(EnumCouponPasswordStatus.USED.getCode());
couponPasswordMapper.updateById(updateCPwd);
@@ -2999,7 +3000,7 @@ public class WxOrderServiceImpl implements WxOrderService {
@Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = {Exception.class})
@Override
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) {
WxOrderServiceImpl proxy = (WxOrderServiceImpl) AopContext.currentProxy();
@@ -3059,7 +3060,7 @@ public class WxOrderServiceImpl implements WxOrderService {
}
// 5. 创建couponOrder
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) {
logger.error("couponOrder失败:" + e.getMessage(),e);
throw new MallinkException(ErrorCode.COUPON_ORDER_SAVE_ERR.getCode(),"["+coupon.getTitle()+"]保存券订单错误."+e.getMessage());
diff --git a/mallinkService/src/main/resources/mapper/WxCardInfoMapper.xml b/mallinkService/src/main/resources/mapper/WxCardInfoMapper.xml
index d77dff2a2..58655d0aa 100644
--- a/mallinkService/src/main/resources/mapper/WxCardInfoMapper.xml
+++ b/mallinkService/src/main/resources/mapper/WxCardInfoMapper.xml
@@ -18,13 +18,13 @@
+
- `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`
@@ -77,6 +77,9 @@
and `coupon_password_id` like concat('%',#{couponPasswordIdLike},'%')
+
+ and `coupon_password` like concat('%',#{couponPassword},'%')
+
and `create_date` between #{startdate} and #{enddate}