Browse Source

Merge branch 'release_toaliyun_real_20230228' of https://git.malls.iformall.com/server/formallProject into release_toaliyun_real_20230228

release_toaliyun_real
xhxu 3 years ago
parent
commit
2cf6ce6775
20 changed files with 159 additions and 37 deletions
  1. +13
    -0
      mallinkAdmin/src/main/java/com/iformall/controller/market/WxCardInfoController.java
  2. +14
    -2
      mallinkAdmin/src/main/java/com/iformall/controller/market/WxCouponPasswordController.java
  3. +4
    -1
      mallinkAdmin/src/main/resources/db/migration/V2023022800001__card.sql
  4. +26
    -1
      mallinkBApi/src/main/java/com/iformall/controller/WxCardPayController.java
  5. +4
    -0
      mallinkCApi/src/main/java/com/iformall/controller/WxCardPayController.java
  6. +24
    -0
      mallinkCApi/src/main/java/com/iformall/controller/WxCouponOrderController.java
  7. +1
    -0
      mallinkService/src/main/java/com/iformall/common/ErrorCode.java
  8. +1
    -0
      mallinkService/src/main/java/com/iformall/common/SysConfigConstant.java
  9. +8
    -2
      mallinkService/src/main/java/com/iformall/domain/po/WxCouponPassword.java
  10. +2
    -0
      mallinkService/src/main/java/com/iformall/domain/vo/WxCardVo.java
  11. +12
    -9
      mallinkService/src/main/java/com/iformall/domain/vo/WxCouponPasswordVo.java
  12. +2
    -2
      mallinkService/src/main/java/com/iformall/mapper/WxCardInfoMapper.java
  13. +2
    -0
      mallinkService/src/main/java/com/iformall/mapper/WxCouponPasswordMapper.java
  14. +2
    -0
      mallinkService/src/main/java/com/iformall/service/WxCardInfoService.java
  15. +1
    -0
      mallinkService/src/main/java/com/iformall/service/WxCardSpendService.java
  16. +2
    -0
      mallinkService/src/main/java/com/iformall/service/WxCouponPasswordService.java
  17. +6
    -0
      mallinkService/src/main/java/com/iformall/service/impl/WxCardInfoServiceImpl.java
  18. +5
    -13
      mallinkService/src/main/java/com/iformall/service/impl/WxCouponPasswordServiceImpl.java
  19. +12
    -3
      mallinkService/src/main/resources/mapper/WxCardInfoMapper.xml
  20. +18
    -4
      mallinkService/src/main/resources/mapper/WxCouponPasswordMapper.xml

+ 13
- 0
mallinkAdmin/src/main/java/com/iformall/controller/market/WxCardInfoController.java View File

@@ -238,5 +238,18 @@ public class WxCardInfoController extends BaseController {
wxCardSpendService.exportData(wxCardSpendVo, request, response);

}
@ApiOperation("启用/停用")
@PostMapping("/startOrStop")
@SystemControllerLog(description = "启用/停用")
public ResultData startOrStop(@RequestBody WxCardInfo WxCardInfo) {
try {
wxCardInfoService.startOrStop(WxCardInfo);
} catch (Exception e) {
logger.error(e.getMessage());
return new ResultData(ErrorCode.COUPON_PASSWORD_POSTPONE_ERR.getCode(),"更新失败");
}
return new ResultData();
}

}

+ 14
- 2
mallinkAdmin/src/main/java/com/iformall/controller/market/WxCouponPasswordController.java View File

@@ -87,11 +87,23 @@ public class WxCouponPasswordController extends BaseController {
@ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)})
public ResultData batchList(@ModelAttribute WxCouponPassword wxCouponPassword, Integer pageNum, Integer pageSize) {
wxCouponPassword.updateTenantInfo(getTenantInfo());
wxCouponPassword.setSortColumns(BaseEntity.SortField.CreateDate_DESC, BaseEntity.SortField.Id_DESC);
wxCouponPassword.setSortColumns(BaseEntity.SortField.CreateDate_DESC);
final PageInfo<WxCouponPasswordVo> page = wxCouponPasswordService.listVoAsPage(wxCouponPassword, pageNum, pageSize);
return new ResultData(page);
}
@ApiOperation("启用/停用")
@PostMapping("/startOrStop")
@SystemControllerLog(description = "启用/停用")
public ResultData startOrStop(@RequestBody WxCouponPassword wxCouponPassword) {
try {
wxCouponPasswordService.startOrStop(wxCouponPassword);
} catch (Exception e) {
logger.error(e.getMessage());
return new ResultData(ErrorCode.COUPON_PASSWORD_POSTPONE_ERR.getCode(),"更新失败");
}
return new ResultData();
}


}

+ 4
- 1
mallinkAdmin/src/main/resources/db/migration/V2023022800001__card.sql View File

@@ -3,7 +3,7 @@ alter table wx_card_info add column c_user_id bigint(20) comment '购买用户
alter table wx_card_info add column owner_user_id bigint(20) comment '持有用户编码';
alter table wx_card_info add column status int(1) not null default 0 comment '状态';

###待做#######
###待做wx_card_info#######
##coupon_password_id,coupon_password,c_user_id,owner_user_id 刷数据,后两者不能为空
# 转赠验证wx_coupon_order的c_user_id不变

@@ -14,6 +14,9 @@ alter table wx_card_info add column status int(1) not null default 0 comment '
#set ci.c_user_id = co.c_user_id, ci.owner_user_id = co.owner_id


alter table wx_coupon_password add column is_stop int(1) not null default 0 comment '是否已停止1-是,0-否';







+ 26
- 1
mallinkBApi/src/main/java/com/iformall/controller/WxCardPayController.java View File

@@ -6,11 +6,14 @@ import com.iformall.common.Result;
import com.iformall.common.ResultData;
import com.iformall.domain.po.*;
import com.iformall.domain.vo.WxCardSpendVo;
import com.iformall.domain.vo.WxCouponOrderCVo;
import com.iformall.enums.EnumCardInfoStatus;
import com.iformall.enums.EnumCouponStatus;
import com.iformall.enums.EnumCreditLockedStatus;
import com.iformall.enums.EnumMerchantStatus;
import com.iformall.enums.EnumMerchantSubsidySource;
import com.iformall.enums.EnumPayWay;
import com.iformall.enums.EnumYesOrNo;
import com.iformall.exception.MallinkException;
import com.iformall.service.WxCUserBasicInfoService;
import com.iformall.service.WxCardInfoService;
@@ -21,6 +24,8 @@ import com.iformall.service.WxCouponService;
import com.iformall.service.WxMerchantService;
import com.iformall.service.WxOrderService;
import com.iformall.utils.Constant;
import com.iformall.utils.DateUtils;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
@@ -32,6 +37,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
@@ -120,6 +126,18 @@ public class WxCardPayController extends BaseController {
logger.error("cardId不能为空");
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "cardId不能为空");
}
String _decodeCouponOrderId = WxCouponOrderCVo.getDecodeExpiredCouponOrderId(cardIdStr);
if (_decodeCouponOrderId.contains(WxCouponOrderCVo.arg)) {
String[] decodeids = _decodeCouponOrderId.split(WxCouponOrderCVo.arg);
cardIdStr = decodeids[0];
String expiredtimeStr = decodeids[1];
Date expiredtime = DateUtils.string2Date(expiredtimeStr).getTime();
if (expiredtime.before(new Date())) {
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"码已失效,请更新二维码后重试");
}
}
Long cUserId = null;
try {
cUserId = Long.valueOf(cUserIdStr);
@@ -142,11 +160,15 @@ public class WxCardPayController extends BaseController {
logger.error("卡不存在: " + cardIdStr);
return new ResultData(ErrorCode.CARD_IS_NOT_FOUND);
}
return saveCardPayOrder(cUserId,cardInfo,merchantBUser,totalFeeStr,EnumPayWay.PAY_WAY_WECHAT);
}

private ResultData saveCardPayOrder(Long cUserId,WxCardInfo cardInfo,WxMerchantBUser merchantBUser,String totalFeeStr,EnumPayWay payWay) {
if (EnumCardInfoStatus.STOP.getCode().intValue() == cardInfo.getStatus().intValue()) {
return new ResultData(ErrorCode.CARD_IS_NOT_FOUND.getCode(),"卡已被禁用.");
}
String ipStr = getIpAddr();
if (Constant.defaultCUserId != cUserId) {
WxCUserBasicInfo wxCUserBasicInfo = wxCUserBasicInfoService.getById(cUserId,merchantBUser.getFinalTenantId());
@@ -250,6 +272,9 @@ public class WxCardPayController extends BaseController {
if (null == couponPassword) {
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "卡未查询到");
}
if (EnumYesOrNo.YES.getCode().intValue() == couponPassword.getIsStop().intValue()) {
return new ResultData(ErrorCode.CARD_IS_NOT_FOUND.getCode(),"卡已被禁用.");
}
WxCoupon coupon = wxCouponService.getById(couponPassword.getCouponId(),couponPassword.getTenantId());
if (coupon == null) {


+ 4
- 0
mallinkCApi/src/main/java/com/iformall/controller/WxCardPayController.java View File

@@ -32,6 +32,7 @@ import com.iformall.domain.po.WxCouponOrder;
import com.iformall.domain.po.WxMerchant;
import com.iformall.domain.po.WxOrder;
import com.iformall.domain.vo.WxCardSpendVo;
import com.iformall.enums.EnumCardInfoStatus;
import com.iformall.enums.EnumCreditLockedStatus;
import com.iformall.enums.EnumMerchantStatus;
import com.iformall.enums.EnumMerchantSubsidySource;
@@ -137,6 +138,9 @@ public class WxCardPayController extends BaseController {
logger.error("卡不存在: " + cardIdStr);
return new ResultData(ErrorCode.CARD_IS_NOT_FOUND);
}
if (EnumCardInfoStatus.STOP.getCode().intValue() == cardInfo.getStatus().intValue()) {
return new ResultData(ErrorCode.CARD_IS_NOT_FOUND.getCode(),"卡已被禁用.");
}

if(payment > cardInfo.getRemainingAmount()) {
logger.error("卡余额不足: " + cardIdStr);


+ 24
- 0
mallinkCApi/src/main/java/com/iformall/controller/WxCouponOrderController.java View File

@@ -358,6 +358,30 @@ public class WxCouponOrderController extends BaseController {
}
return wxCouponOrderService.cardDetailCUserVo(memberId,getTenantInfo(), couponOrderId);
}
@ApiOperation(value = "手动核销方式,电子卡获取动态id")
@GetMapping("cardDynamicId")
@ApiImplicitParams({
@ApiImplicitParam(name = "cardId", value = "卡ID", dataType = "string", paramType = "query", required = true),
@ApiImplicitParam(name = "cardTenantId", value = "券tenantID", dataType = "string", paramType = "query", required = false)
})
public ResultData cardDynamicId(String cardId,String cardTenantId) {

if (StringUtils.isBlank(cardId) || cardId.equalsIgnoreCase(Constant.UNDEFINED)) {
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL);
}
SysConfig sysConfig = sysConfigService.getByKey(SysConfigConstant.card_vierfy_seconds_key, getTenantInfo());
if (null == sysConfig || StringUtils.isBlank(sysConfig.getConfigItemValue())) {
return new ResultData(ErrorCode.SYS_CONFIG_CARD_VIERFY_SECODES_UNSET);
}
Map retmap = new HashMap();
retmap.put("dynamicId", WxCouponOrderCVo.calcuteExpiredCouponOrderId(cardId,Integer.parseInt(sysConfig.getConfigItemValue())));
retmap.put("expiredSeconds", Integer.parseInt(sysConfig.getConfigItemValue()));
retmap.put("cardTenantId", cardTenantId);
return new ResultData(retmap);
}

@ApiOperation(value = "卡转赠领取")
@PostMapping("cardAccept")


+ 1
- 0
mallinkService/src/main/java/com/iformall/common/ErrorCode.java View File

@@ -35,6 +35,7 @@ public enum ErrorCode{
* 系统配置
*/
SYS_CONFIG_VIERFY_SECODES_UNSET(1030,"系统设置【券码刷新时间】未配置"),
SYS_CONFIG_CARD_VIERFY_SECODES_UNSET(1030,"系统设置【电子卡码刷新时间】未配置"),
SYS_CONFIG_DEFAULT_MERCHANT_B_USER_UNSET(1031,"系统配置【外部设备核销默认商户员工编号】未配置"),

/**


+ 1
- 0
mallinkService/src/main/java/com/iformall/common/SysConfigConstant.java View File

@@ -3,6 +3,7 @@ package com.iformall.common;
public class SysConfigConstant {

public static final String vierfy_seconds_key="vierfySeconds";
public static final String card_vierfy_seconds_key="cardVierfySeconds";
public static final String default_merchant_b_user = "defaultMerchantBUserId";
public static final String coupon_detail_show_selled = "couponDetailShowSelled";
}

+ 8
- 2
mallinkService/src/main/java/com/iformall/domain/po/WxCouponPassword.java View File

@@ -17,14 +17,17 @@ public class WxCouponPassword extends TenantEntity {

@Excel(name = "ID", width = 20, orderNum = "1")
protected Long id;

@TableField(exist = false)
private String idLike;
@io.swagger.annotations.ApiModelProperty(value="卡券ID",name="couponId")
private Long couponId;
@io.swagger.annotations.ApiModelProperty(value="卡券短ID",name="couponShort")
private String couponShort;
@Excel(name = "兑换码", width = 20, orderNum = "2")
@io.swagger.annotations.ApiModelProperty(value="商户名称",name="password")
@io.swagger.annotations.ApiModelProperty(value="卡密",name="password")
private String password;
@TableField(exist = false)
private String passwordLike;
@Excel(name = "状态", width = 20, replace = {"初始_0", "发送中_1", "已发出_2", "已使用_3", "不可用_4"}, orderNum = "4")
@io.swagger.annotations.ApiModelProperty(value="卡密状态: 0初始1信息发出中2信息已发出3已使用4已过期",name="status")
private Integer status;
@@ -44,6 +47,9 @@ public class WxCouponPassword extends TenantEntity {

@io.swagger.annotations.ApiModelProperty(value = "发放ID", name = "presentId")
private Long presentId;
@io.swagger.annotations.ApiModelProperty(value="是否已停止EnumYesOrNo",name="isStop")
private Integer isStop;

@TableField(exist = false)
private String statusStr;


+ 2
- 0
mallinkService/src/main/java/com/iformall/domain/vo/WxCardVo.java View File

@@ -112,4 +112,6 @@ public class WxCardVo extends WxCardInfo {
private Date couponOnlineEndDate;
@TableField(exist = false)
private List<Long> couponIdList;
@TableField(exist = false)
private Integer cardInfoStatus;
}

+ 12
- 9
mallinkService/src/main/java/com/iformall/domain/vo/WxCouponPasswordVo.java View File

@@ -34,29 +34,32 @@ public class WxCouponPasswordVo extends TenantEntity {
@Excel(name = "卡密状态", width = 20, orderNum = "4", replace = {"初始化_0", "消息发送中_1", "消息已发送_2", "已兑换_3","已作废_4"},prefix = "`")
@io.swagger.annotations.ApiModelProperty(value = "卡密状态", name = "remainPrice")
private Integer status;
@Excel(name = "卡激活状态", width = 20, orderNum = "5",replace = {"未激活_0", "已激活_1"}, prefix = "`")
@Excel(name = "卡密是否停用", width = 20, orderNum = "5", replace = {"否_0", "是_1"},prefix = "`")
@io.swagger.annotations.ApiModelProperty(value = "卡密是否停用", name = "isStop")
private Integer isStop;
@Excel(name = "卡激活状态", width = 20, orderNum = "6",replace = {"未激活_0", "已激活_1"}, prefix = "`")
@io.swagger.annotations.ApiModelProperty(value = "卡激活状态EnumYesOrNo", name = "used")
private Integer used;
@Excel(name = "激活时间", width = 20, exportFormat = "yyyy-MM-dd HH:mm:ss", orderNum = "6")
@Excel(name = "激活时间", width = 20, exportFormat = "yyyy-MM-dd HH:mm:ss", orderNum = "7")
@io.swagger.annotations.ApiModelProperty(value = "", name = "activeDate")
private Date activeDate;
@Excel(name = "激活手机号", width = 20, orderNum = "7", prefix = "`")
@Excel(name = "激活手机号", width = 20, orderNum = "8", prefix = "`")
@io.swagger.annotations.ApiModelProperty(value = "激活手机号", name = "phone")
private String phone;
@Excel(name = "激活会员", width = 20, orderNum = "8", prefix = "`")
@Excel(name = "激活会员", width = 20, orderNum = "9", prefix = "`")
@io.swagger.annotations.ApiModelProperty(value = "激活会员", name = "userName")
private String userName;
@Excel(name = "电子卡卡号", width = 20, orderNum = "9", prefix = "`")
@Excel(name = "电子卡卡号", width = 20, orderNum = "10", prefix = "`")
@io.swagger.annotations.ApiModelProperty(value = "电子卡卡号", name = "cardId")
private Long cardId;
@Excel(name = "面额(元)", width = 20, orderNum = "10", prefix = "`")
@Excel(name = "面额(元)", width = 20, orderNum = "11", prefix = "`")
@io.swagger.annotations.ApiModelProperty(value = "面额(元)", name = "price")
private Double price;
@Excel(name = "余额(元)", width = 20, orderNum = "11", prefix = "`")
@Excel(name = "余额(元)", width = 20, orderNum = "12", prefix = "`")
@io.swagger.annotations.ApiModelProperty(value = "余额(元)", name = "remainPrice")
private Double remainPrice;
@Excel(name = "激活卡状态", width = 20, orderNum = "12",replace = {"正常_0", "已禁用_1"}, prefix = "`")
@io.swagger.annotations.ApiModelProperty(value = "激活卡状态EnumYesOrNo", name = "used")
@Excel(name = "电子卡状态", width = 20, orderNum = "13",replace = {"正常_0", "已禁用_1"}, prefix = "`")
@io.swagger.annotations.ApiModelProperty(value = "电子卡状态EnumYesOrNo", name = "used")
private Integer cardStatus;

}

+ 2
- 2
mallinkService/src/main/java/com/iformall/mapper/WxCardInfoMapper.java View File

@@ -8,12 +8,12 @@ import java.util.List;

public interface WxCardInfoMapper extends CommonMapper<WxCardInfo, Long> {

//List<WxCardVo> findVoList(WxCardVo wxCardVo);

void updateTransferStatusByCouponId(Long couponId);
List<WxCardInfo> findList(WxCardInfo wxCardInfo);
List<Long> findIdList(WxCardInfo wxCardInfo);
void updateStatus(WxCardInfo wxCardInfo);

}

+ 2
- 0
mallinkService/src/main/java/com/iformall/mapper/WxCouponPasswordMapper.java View File

@@ -27,5 +27,7 @@ public interface WxCouponPasswordMapper extends CommonMapper<WxCouponPassword, L
void updatePostpone(WxCouponPassword wxCouponPassword);
void updateExpiredTime(@Param("couponId")Long couponId,@Param("expiredTime")Date expiredTime);
void updateIsStop(@Param("tenantId")String tenantId,@Param("id")Long Id,@Param("isStop")Integer isStop);

}

+ 2
- 0
mallinkService/src/main/java/com/iformall/service/WxCardInfoService.java View File

@@ -47,5 +47,7 @@ public interface WxCardInfoService {


void exportData(WxCardVo wxCardVo, HttpServletRequest request, HttpServletResponse response);
void startOrStop(WxCardInfo cardInfo);

}

+ 1
- 0
mallinkService/src/main/java/com/iformall/service/WxCardSpendService.java View File

@@ -113,4 +113,5 @@ public interface WxCardSpendService {
WxCardSpend cardSpendForPosPay(PromotionCalc scoreCreditCalc, WxCardSpend record, WxMerchant merchant, WxMerchantBUser buUser,Integer payWay) throws MallinkException;

Integer sumRealPayment(WxCardSpendVo wxCardSpend);
}

+ 2
- 0
mallinkService/src/main/java/com/iformall/service/WxCouponPasswordService.java View File

@@ -75,4 +75,6 @@ public interface WxCouponPasswordService {
List<WxCouponPassword> findList(WxCouponPassword wxCouponPassword);

void postpone(WxCouponPassword wxCouponPassword);
void startOrStop(WxCouponPassword wxCouponPassword);
}

+ 6
- 0
mallinkService/src/main/java/com/iformall/service/impl/WxCardInfoServiceImpl.java View File

@@ -159,6 +159,7 @@ public class WxCardInfoServiceImpl implements WxCardInfoService {
WxCardVo co = new WxCardVo();
try {
BeanUtils.copyProperties(co, coo);
co.setCardInfoStatus(coo.getStatus());
//coupon
WxCoupon coupon = couponMap.get(coo.getCouponId());
if (null != coupon) {
@@ -321,4 +322,9 @@ public class WxCardInfoServiceImpl implements WxCardInfoService {
return cardInfo;
}

@Override
public void startOrStop(WxCardInfo cardInfo) {
wxCardInfoMapper.updateStatus(cardInfo);
}

}

+ 5
- 13
mallinkService/src/main/java/com/iformall/service/impl/WxCouponPasswordServiceImpl.java View File

@@ -147,6 +147,7 @@ public class WxCouponPasswordServiceImpl implements WxCouponPasswordService {
}
co.setStatus(coo.getStatus());
co.setCreateDate(coo.getCreateDate());
co.setIsStop(coo.getIsStop());
retList.add(co);
}
return retList;
@@ -298,18 +299,9 @@ public class WxCouponPasswordServiceImpl implements WxCouponPasswordService {
wxCouponPasswordMapper.updatePostpone(wxCouponPassword);
}

/*
public static void main(String[] args) {
WxCouponPasswordServiceImpl ll = new WxCouponPasswordServiceImpl();
long startTime = System.currentTimeMillis();
System.out.println(startTime);
ll.mkPasswords("456", 12345L, 100);
long endTime = System.currentTimeMillis();
System.out.println(endTime);
long usedTime = (endTime-startTime)/1000;
System.out.println("耗时:" + usedTime + "s");
}
*/
@Override
public void startOrStop(WxCouponPassword wxCouponPassword) {
wxCouponPasswordMapper.updateIsStop(wxCouponPassword.getTenantId(), wxCouponPassword.getId(), wxCouponPassword.getIsStop());
}
}

+ 12
- 3
mallinkService/src/main/resources/mapper/WxCardInfoMapper.xml View File

@@ -8,6 +8,8 @@
<result column="coupon_id" jdbcType="BIGINT" property="couponId" />
<result column="c_user_id" jdbcType="BIGINT" property="cUserId" />
<result column="owner_user_id" jdbcType="BIGINT" property="ownerUserId" />
<result column="coupon_password_id" jdbcType="BIGINT" property="couponPasswordId" />
<result column="coupon_password" jdbcType="VARCHAR" property="couponPassword" />
<result column="transaction_id" jdbcType="VARCHAR" property="transactionId" />
<result column="amount" jdbcType="INTEGER" property="amount" />
<result column="sale_amount" jdbcType="INTEGER" property="saleAmount" />
@@ -19,14 +21,13 @@
<result column="create_date" jdbcType="TIMESTAMP" property="createDate" />
<result column="update_date" jdbcType="TIMESTAMP" property="updateDate" />
<result column="support_transfer" jdbcType="INTEGER" property="supportTransfer"/>
<result column="coupon_password_id" jdbcType="BIGINT" property="couponPasswordId"/>
<result column="coupon_password" jdbcType="VARCHAR" property="couponPassword"/>
<result column="status" jdbcType="INTEGER" property="status"/>
</resultMap>
<sql id="allColumns">
`id`,`tenant_id`,`parent_tenant_id`,`coupon_id`,`c_user_id`,`owner_user_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`
`rate_amount`,`create_date`,`update_date`,`support_transfer`,`status`
</sql>
<sql id="dynamicWhereConditions">
@@ -91,6 +92,10 @@
<if test=" null != enddate">
and `create_date` &lt;= #{enddate}
</if>
<if test=" null != status">
and `status` = #{status}
</if>
<if test=" null != couponPasswordIdList ">
and coupon_password_id in
<foreach collection="couponPasswordIdList" index="index" item="cpidItem" open="(" separator="," close=")">
@@ -139,4 +144,8 @@
<include refid="dynamicWhereConditions" />
</select>
<update id="updateStatus" parameterType="com.iformall.domain.po.WxCardInfo">
update wx_card_info set status=#{status},update_date=now() where id=#{id} and tenant_id = #{tenantId}
</update>
</mapper>

+ 18
- 4
mallinkService/src/main/resources/mapper/WxCouponPasswordMapper.xml View File

@@ -15,11 +15,11 @@
<result column="update_date" jdbcType="TIMESTAMP" property="updateDate" />
<result column="expire_date" jdbcType="TIMESTAMP" property="expireDate" />
<result column="present_id" jdbcType="TIMESTAMP" property="presentId"/>
<result column="is_stop" jdbcType="INTEGER" property="isStop"/>
</resultMap>
<sql id="allColumns">
`id`,`tenant_id`,`parent_tenant_id`,`coupon_id`,`coupon_short`,`password`,`status`,`sended_phone`,`card_id`,`create_date`,`update_date`,`expire_date`,`present_id`
`id`,`tenant_id`,`parent_tenant_id`,`coupon_id`,`coupon_short`,`password`,`status`,`sended_phone`,`card_id`,`create_date`,`update_date`,`expire_date`,`present_id`,`is_stop`
</sql>

<sql id="dynamicWhereConditions">
@@ -27,6 +27,9 @@
<if test=" null != id ">
and `id` = #{id}
</if>
<if test=" null != idLike and '' != idLike ">
and `id` like concat('%',#{idLike},'%')
</if>
<if test=" null != tenantId and '' != tenantId">
and `tenant_id` = #{tenantId}
</if>
@@ -39,9 +42,12 @@
<if test=" null != couponShort ">
and `coupon_short` = #{couponShort}
</if>
<if test=" null != password ">
<if test=" null != password and '' != password">
and `password` = #{password}
</if>
</if>
<if test=" null != passwordLike and '' != passwordLike ">
and `password` like concat('%',#{passwordLike},'%')
</if>
<if test=" null != status ">
and `status` = #{status}
</if>
@@ -65,6 +71,10 @@
and `present_id` = #{presentId}
</if>
<if test=" null != isStop ">
and `is_stop` = #{isStop}
</if>
<if test=" null != ids ">
and id in
<foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
@@ -199,5 +209,9 @@
<update id="updateExpiredTime" parameterType="map">
update wx_coupon_password set expire_date = #{expiredTime} , update_date = now() where coupon_id = #{couponId}
</update>
<update id="updateIsStop" parameterType="map">
update wx_coupon_password set is_stop = #{isStop} , update_date = now() where id = #{id} and tenant_id = #{tenantId}
</update>

</mapper>

Loading…
Cancel
Save