Просмотр исходного кода

//COUPON

release_toaliyun_real
xhxu 3 лет назад
Родитель
Сommit
cd820d1ed3
8 измененных файлов: 26 добавлений и 14 удалений
  1. +4
    -0
      mallinkAdmin/src/main/resources/db/migration/V2023031600001_cardspend.sql
  2. +0
    -7
      mallinkAdmin/src/main/resources/db/migration/V2023032200001_coupon_press.sql
  3. +2
    -0
      mallinkService/src/main/java/com/iformall/domain/po/WxCardSpend.java
  4. +1
    -0
      mallinkService/src/main/java/com/iformall/enums/EnumCardInfoType.java
  5. +13
    -6
      mallinkService/src/main/java/com/iformall/service/impl/WxCardInfoServiceImpl.java
  6. +3
    -0
      mallinkService/src/main/java/com/iformall/service/impl/WxCardSpendServiceImpl.java
  7. +1
    -0
      mallinkService/src/main/java/com/iformall/service/impl/WxRefundOrderServiceImpl.java
  8. +2
    -1
      mallinkService/src/main/resources/mapper/WxCardSpendMapper.xml

+ 4
- 0
mallinkAdmin/src/main/resources/db/migration/V2023031600001_cardspend.sql Просмотреть файл

@@ -334,5 +334,9 @@ ADD COLUMN `used_password` varchar(50) COMMENT '使用密码' AFTER `is_recharge






ALTER TABLE `mallink`.`wx_card_spend`
ADD COLUMN `card_type` smallint(2) DEFAULT 0 AFTER `card_id`;




update wx_card_spend set card_type=1 where owner_id = 111111111111111111;


+ 0
- 7
mallinkAdmin/src/main/resources/db/migration/V2023032200001_coupon_press.sql Просмотреть файл

@@ -100,10 +100,3 @@ update wx_coupon_97 set press_limit_hours = press_limit_hours * 60 where press_l
update wx_coupon_98 set press_limit_hours = press_limit_hours * 60 where press_limit_hours is not null; update wx_coupon_98 set press_limit_hours = press_limit_hours * 60 where press_limit_hours is not null;
update wx_coupon_99 set press_limit_hours = press_limit_hours * 60 where press_limit_hours is not null; update wx_coupon_99 set press_limit_hours = press_limit_hours * 60 where press_limit_hours is not null;










+ 2
- 0
mallinkService/src/main/java/com/iformall/domain/po/WxCardSpend.java Просмотреть файл

@@ -27,6 +27,8 @@ public class WxCardSpend extends TenantEntity {
private Long cardId; private Long cardId;
@TableField(exist = false) @TableField(exist = false)
private List<Long> cardIdList; private List<Long> cardIdList;
@io.swagger.annotations.ApiModelProperty(value="EnumCardInfoType",name="cardType")
private Integer cardType;
@io.swagger.annotations.ApiModelProperty(value="持有人ID",name="ownerId") @io.swagger.annotations.ApiModelProperty(value="持有人ID",name="ownerId")
private Long ownerId; private Long ownerId;
@TableField(exist = false) @TableField(exist = false)


+ 1
- 0
mallinkService/src/main/java/com/iformall/enums/EnumCardInfoType.java Просмотреть файл

@@ -33,4 +33,5 @@ public enum EnumCardInfoType {
public String getMessage() { public String getMessage() {
return message; return message;
} }

} }

+ 13
- 6
mallinkService/src/main/java/com/iformall/service/impl/WxCardInfoServiceImpl.java Просмотреть файл

@@ -16,10 +16,7 @@ import com.iformall.domain.vo.WxCouponPasswordVo;
import com.iformall.enums.*; import com.iformall.enums.*;
import com.iformall.exception.MallinkException; import com.iformall.exception.MallinkException;
import com.iformall.mapper.*; import com.iformall.mapper.*;
import com.iformall.service.ExcelService;
import com.iformall.service.WxCUserBasicInfoService;
import com.iformall.service.WxCardInfoService;
import com.iformall.service.WxCouponService;
import com.iformall.service.*;
import com.iformall.utils.Constant; import com.iformall.utils.Constant;
import com.iformall.utils.DateUtils; import com.iformall.utils.DateUtils;
import com.iformall.utils.RedisLock; import com.iformall.utils.RedisLock;
@@ -83,8 +80,10 @@ public class WxCardInfoServiceImpl implements WxCardInfoService {


@Autowired @Autowired
WxCardSpendMapper wxCardSpendMapper; WxCardSpendMapper wxCardSpendMapper;

@Autowired
WxCardSpendService wxCardSpendService;



@Override @Override
public PageInfo<WxCardVo> listAsPage(WxCardVo record, Integer pageIndex, Integer pageSize) { public PageInfo<WxCardVo> listAsPage(WxCardVo record, Integer pageIndex, Integer pageSize) {
@@ -507,6 +506,14 @@ public class WxCardInfoServiceImpl implements WxCardInfoService {
logger.error("card spend insert error"); logger.error("card spend insert error");
throw new MallinkException(ErrorCode.DB_FAIL.getCode(), "card spend 插入出错!"); throw new MallinkException(ErrorCode.DB_FAIL.getCode(), "card spend 插入出错!");
} }

if(record.getCardBeforeAmount().equals(0)){
if (wxCardSpendService.cardFinishedUsing(currentDate, cardInfo)) {
throw new MallinkException(ErrorCode.DB_FAIL.getCode(), "couponOrder status 更新出错!");
}
}
wxCardSpendService.sendCardBalanceChange(wxCoupon,record);

return new ResultData(); return new ResultData();


} }


+ 3
- 0
mallinkService/src/main/java/com/iformall/service/impl/WxCardSpendServiceImpl.java Просмотреть файл

@@ -185,6 +185,7 @@ public class WxCardSpendServiceImpl implements WxCardSpendService {
// 5 insert card_spend // 5 insert card_spend
record.setId(idWorker.nextId()); record.setId(idWorker.nextId());
record.updateTenantInfo(cardInfo); record.updateTenantInfo(cardInfo);
record.setCardType(cardInfo.getType());
record.setPayType(EnumPayType.PAY_PAYMENT.getCode()); record.setPayType(EnumPayType.PAY_PAYMENT.getCode());
if(record.getPayFrom() == null){ if(record.getPayFrom() == null){
record.setPayFrom(EnumCardSpendFrom.C.getCode()); record.setPayFrom(EnumCardSpendFrom.C.getCode());
@@ -1083,6 +1084,8 @@ public class WxCardSpendServiceImpl implements WxCardSpendService {
// 5 insert card_spend // 5 insert card_spend
record.setId(idWorker.nextId()); record.setId(idWorker.nextId());
record.updateTenantInfo(cardInfo); record.updateTenantInfo(cardInfo);
record.setCardType(cardInfo.getType());
record.setPayType(EnumPayType.PAY_PAYMENT.getCode());
record.setPayment(payment); record.setPayment(payment);
record.setRealPayment(real_payment); record.setRealPayment(real_payment);
record.setCardBeforeAmount(cardInfo.getRemainingAmount()); record.setCardBeforeAmount(cardInfo.getRemainingAmount());


+ 1
- 0
mallinkService/src/main/java/com/iformall/service/impl/WxRefundOrderServiceImpl.java Просмотреть файл

@@ -1280,6 +1280,7 @@ public class WxRefundOrderServiceImpl implements WxRefundOrderService {


final IdWorker idWorker = IdWorker.get(); final IdWorker idWorker = IdWorker.get();
record.setId(idWorker.nextId()); record.setId(idWorker.nextId());
record.setCardType(cardSend.getCardType());
record.setOwnerId(cardSend.getOwnerId()); record.setOwnerId(cardSend.getOwnerId());
record.setMerchantId(cardSend.getMerchantId()); record.setMerchantId(cardSend.getMerchantId());
record.setPayFrom(EnumCardSpendFrom.refund.getCode()); record.setPayFrom(EnumCardSpendFrom.refund.getCode());


+ 2
- 1
mallinkService/src/main/resources/mapper/WxCardSpendMapper.xml Просмотреть файл

@@ -6,6 +6,7 @@
<result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/> <result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/>
<result column="parent_tenant_id" jdbcType="VARCHAR" property="parentTenantId" /> <result column="parent_tenant_id" jdbcType="VARCHAR" property="parentTenantId" />
<result column="card_id" jdbcType="BIGINT" property="cardId"/> <result column="card_id" jdbcType="BIGINT" property="cardId"/>
<result column="card_type" jdbcType="BIGINT" property="cardType"/>
<result column="owner_id" jdbcType="BIGINT" property="ownerId"/> <result column="owner_id" jdbcType="BIGINT" property="ownerId"/>
<result column="pay_type" jdbcType="INTEGER" property="payType"/> <result column="pay_type" jdbcType="INTEGER" property="payType"/>
<result column="merchant_id" jdbcType="BIGINT" property="merchantId"/> <result column="merchant_id" jdbcType="BIGINT" property="merchantId"/>
@@ -29,7 +30,7 @@
</resultMap> </resultMap>


<sql id="allColumns"> <sql id="allColumns">
`id`,`tenant_id`,`parent_tenant_id`,`card_id`,`owner_id`,`pay_type`,`merchant_id`,`order_id`,`pos_order_id`,
`id`,`tenant_id`,`parent_tenant_id`,`card_id`,`card_type`,`owner_id`,`pay_type`,`merchant_id`,`order_id`,`pos_order_id`,
`deduction_amount`,`payment`,`real_payment`,`subsidy`, `card_remain_amount`, `deduction_amount`,`payment`,`real_payment`,`subsidy`, `card_remain_amount`,
`card_before_amount`,`card_remain_real_amount`,`card_before_real_amount`, `card_before_amount`,`card_remain_real_amount`,`card_before_real_amount`,
`create_date`, `update_date`, `pay_status`, `pay_from`, `refund_status`, `refund_remark`, `settlement_status` `create_date`, `update_date`, `pay_status`, `pay_from`, `refund_status`, `refund_remark`, `settlement_status`


Загрузка…
Отмена
Сохранить