diff --git a/mallinkAdmin/src/main/java/com/iformall/controller/market/WxCardPayController.java b/mallinkAdmin/src/main/java/com/iformall/controller/market/WxCardPayController.java index 9e38c917d..336872deb 100644 --- a/mallinkAdmin/src/main/java/com/iformall/controller/market/WxCardPayController.java +++ b/mallinkAdmin/src/main/java/com/iformall/controller/market/WxCardPayController.java @@ -290,7 +290,7 @@ public class WxCardPayController extends BaseController { if(Constant.UNDEFINED.equals(cardInfo.getTransactionId())){ cardInfo.setTransactionId(null); } - return wxCardInfoService.rechargeAmount(cardInfo); + return wxCardInfoService.rechargeAmount(cardInfo,getUser()); } } diff --git a/mallinkAdmin/src/main/java/com/iformall/controller/market/WxCouponController.java b/mallinkAdmin/src/main/java/com/iformall/controller/market/WxCouponController.java index 21201527d..eba6180e5 100644 --- a/mallinkAdmin/src/main/java/com/iformall/controller/market/WxCouponController.java +++ b/mallinkAdmin/src/main/java/com/iformall/controller/market/WxCouponController.java @@ -484,37 +484,37 @@ public class WxCouponController extends BaseController { return new ResultData(); } - @TenantIgnore - @ApiOperation("后置设置金额") - @PostMapping("setPrice") - public ResultData setPrice(@RequestBody WxCoupon wxCoupon) { - TenantEntity tenantEntity = getTenantInfo(); - wxCoupon.updateTenantInfo(tenantEntity); - WxCoupon coupon = wxCouponService.findById(wxCoupon); - if (null == coupon ) { - return new ResultData(ResultData.ERROR, "券未查询到。"+wxCoupon.getId()); - } - if (EnumYesOrNo.YES.getCode() != coupon.getIsAfterSetPrice()) { - return new ResultData(ResultData.ERROR, "当前不是后置类型,不能设置。"+wxCoupon.getId()); - } - if (null != coupon.getPrice() && coupon.getPrice() > 0 ) { - return new ResultData(ResultData.ERROR, "当前已设置面额,不能设置。"+wxCoupon.getId()); - } - if (EnumCouponSubsidyType.WECHAT_COUPON.getCode().equals(coupon.getSubsidyType())) { - // 微信 立减 - if (wxCoupon.getSubsidyNum() > coupon.getSalePrice()) { - return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "补贴额大于售价"); - } - } else if (EnumCouponSubsidyType.OFFLINE_SUBSIDY.getCode().equals(coupon.getSubsidyType())) { - // 线下补贴 - int subsidy_num = wxCoupon.getPrice() - coupon.getSalePrice(); - if (wxCoupon.getSubsidyNum() > subsidy_num) { - return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "补贴额大于面额与售价的差值"); - } - } - ResultData resultData = wxCouponService.setPrice(wxCoupon); - return resultData; - } +// @TenantIgnore +// @ApiOperation("后置设置金额") +// @PostMapping("setPrice") +// public ResultData setPrice(@RequestBody WxCoupon wxCoupon) { +// TenantEntity tenantEntity = getTenantInfo(); +// wxCoupon.updateTenantInfo(tenantEntity); +// WxCoupon coupon = wxCouponService.findById(wxCoupon); +// if (null == coupon ) { +// return new ResultData(ResultData.ERROR, "券未查询到。"+wxCoupon.getId()); +// } +// if (EnumYesOrNo.YES.getCode() != coupon.getIsAfterSetPrice()) { +// return new ResultData(ResultData.ERROR, "当前不是后置类型,不能设置。"+wxCoupon.getId()); +// } +// if (null != coupon.getPrice() && coupon.getPrice() > 0 ) { +// return new ResultData(ResultData.ERROR, "当前已设置面额,不能设置。"+wxCoupon.getId()); +// } +// if (EnumCouponSubsidyType.WECHAT_COUPON.getCode().equals(coupon.getSubsidyType())) { +// // 微信 立减 +// if (wxCoupon.getSubsidyNum() > coupon.getSalePrice()) { +// return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "补贴额大于售价"); +// } +// } else if (EnumCouponSubsidyType.OFFLINE_SUBSIDY.getCode().equals(coupon.getSubsidyType())) { +// // 线下补贴 +// int subsidy_num = wxCoupon.getPrice() - coupon.getSalePrice(); +// if (wxCoupon.getSubsidyNum() > subsidy_num) { +// return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "补贴额大于面额与售价的差值"); +// } +// } +// ResultData resultData = wxCouponService.setPrice(wxCoupon); +// return resultData; +// } @ApiOperation("根据id删除接口") diff --git a/mallinkAdmin/src/main/java/com/iformall/controller/market/WxCouponPasswordController.java b/mallinkAdmin/src/main/java/com/iformall/controller/market/WxCouponPasswordController.java index 6a791da2e..19d3ca672 100644 --- a/mallinkAdmin/src/main/java/com/iformall/controller/market/WxCouponPasswordController.java +++ b/mallinkAdmin/src/main/java/com/iformall/controller/market/WxCouponPasswordController.java @@ -211,7 +211,7 @@ public class WxCouponPasswordController extends BaseController { if (null != cardInfo) { return new ResultData(ResultData.ERROR, "卡已绑定,不能再次设置面额。"); } - wxCouponPasswordService.setPrice(wxCouponPassword); + wxCouponPasswordService.setPrice(wxCouponPassword,getUser()); return new ResultData(); } diff --git a/mallinkAdmin/src/main/resources/db/migration/V2023061500001_wx_card_spend.sql b/mallinkAdmin/src/main/resources/db/migration/V2023061500001_wx_card_spend.sql new file mode 100644 index 000000000..c744e1776 --- /dev/null +++ b/mallinkAdmin/src/main/resources/db/migration/V2023061500001_wx_card_spend.sql @@ -0,0 +1,20 @@ +ALTER TABLE `mallink`.`wx_card_spend` +MODIFY COLUMN `remark` varchar(225) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '备注' AFTER `pos_order_id`; + + +CREATE TABLE `wx_card_set_price` ( + `id` bigint(20) NOT NULL COMMENT '主键ID', + `tenant_id` varchar(5) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '租户ID', + `parent_tenant_id` varchar(5) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '父租户ID', + `card_password_id` bigint(20) NOT NULL COMMENT '卡密Id', + `ip` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'ip地址', + `price` int(10) DEFAULT NULL, + `create_date` datetime(0) NOT NULL COMMENT '创建时间', + `update_date` datetime(0) NOT NULL COMMENT '更新时间', + `operator_type` smallint(1) NOT NULL COMMENT '操作人类型', + `operator_id` bigint(20) DEFAULT NULL COMMENT '操作人', + `operator_user` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `remark` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '备注', + PRIMARY KEY (`id`) USING BTREE, + UNIQUE INDEX `idx`(`id`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic; \ No newline at end of file diff --git a/mallinkService/src/main/java/com/iformall/domain/po/WxCardSetPrice.java b/mallinkService/src/main/java/com/iformall/domain/po/WxCardSetPrice.java new file mode 100644 index 000000000..c24ade750 --- /dev/null +++ b/mallinkService/src/main/java/com/iformall/domain/po/WxCardSetPrice.java @@ -0,0 +1,40 @@ +package com.iformall.domain.po; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.iformall.domain.po.base.TenantEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; +import java.util.List; + +@TableName(value = "wx_card_set_price") +@Data +@EqualsAndHashCode(callSuper = true) +public class WxCardSetPrice extends TenantEntity { + + protected Long id; + @io.swagger.annotations.ApiModelProperty(value="卡密id",name="cardPasswordId") + private Long cardPasswordId; + @io.swagger.annotations.ApiModelProperty(value="ip",name="ip") + private String ip; + @io.swagger.annotations.ApiModelProperty(value="",name="price") + private Integer price; + @io.swagger.annotations.ApiModelProperty(value="创建时间",name="createDate") + private Date createDate; + @io.swagger.annotations.ApiModelProperty(value="更新时间",name="updateDate") + private Date updateDate; + + @io.swagger.annotations.ApiModelProperty(value="",name="remark") + private String remark; + + @io.swagger.annotations.ApiModelProperty(value="",name="operatorType") + private Integer operatorType; + @io.swagger.annotations.ApiModelProperty(value="",name="operatorId") + private Long operatorId; + @io.swagger.annotations.ApiModelProperty(value="EnumUserType",name="operatorUser") + private String operatorUser; + +} diff --git a/mallinkService/src/main/java/com/iformall/domain/po/WxCardSpend.java b/mallinkService/src/main/java/com/iformall/domain/po/WxCardSpend.java index bd3f2fb5e..9a90c87da 100644 --- a/mallinkService/src/main/java/com/iformall/domain/po/WxCardSpend.java +++ b/mallinkService/src/main/java/com/iformall/domain/po/WxCardSpend.java @@ -19,7 +19,7 @@ public class WxCardSpend extends TenantEntity { protected Long id; - @Excel(name = "订单类型", width = 20, orderNum = "8", replace = {"付款_0", "退款_1", "充值_1"}) + @Excel(name = "订单类型", width = 20, orderNum = "8", replace = {"付款_0", "退款_1", "充值_10"}) @io.swagger.annotations.ApiModelProperty(value="EnumPayType",name="payType") private Integer payType; diff --git a/mallinkService/src/main/java/com/iformall/mapper/WxCardSetPriceMapper.java b/mallinkService/src/main/java/com/iformall/mapper/WxCardSetPriceMapper.java new file mode 100644 index 000000000..8ae1fe85a --- /dev/null +++ b/mallinkService/src/main/java/com/iformall/mapper/WxCardSetPriceMapper.java @@ -0,0 +1,14 @@ +package com.iformall.mapper; + +import com.iformall.common.CommonMapper; +import com.iformall.domain.po.WxCardSetPrice; + +import java.math.BigDecimal; +import java.util.List; +import java.util.Map; + +public interface WxCardSetPriceMapper extends CommonMapper { + + List findList(WxCardSetPrice wxCardSpend); + +} diff --git a/mallinkService/src/main/java/com/iformall/service/WxCardInfoService.java b/mallinkService/src/main/java/com/iformall/service/WxCardInfoService.java index 63ea63f2d..59b8f0fe8 100644 --- a/mallinkService/src/main/java/com/iformall/service/WxCardInfoService.java +++ b/mallinkService/src/main/java/com/iformall/service/WxCardInfoService.java @@ -2,10 +2,7 @@ package com.iformall.service; import com.github.pagehelper.PageInfo; import com.iformall.common.ResultData; -import com.iformall.domain.po.WxCardInfo; -import com.iformall.domain.po.WxCardTransferInfo; -import com.iformall.domain.po.WxCoupon; -import com.iformall.domain.po.WxCouponPassword; +import com.iformall.domain.po.*; import com.iformall.domain.po.base.TenantEntity; import com.iformall.domain.vo.WxCardTransferVo; import com.iformall.domain.vo.WxCardVo; @@ -70,5 +67,5 @@ public interface WxCardInfoService { ResultData updatePayPassword(WxCardInfo cardInfo, EnumCUserFrom userFrom); - ResultData rechargeAmount(WxCardInfo cardInfo); + ResultData rechargeAmount(WxCardInfo cardInfo, MallUserInfo user); } diff --git a/mallinkService/src/main/java/com/iformall/service/WxCardSetPriceService.java b/mallinkService/src/main/java/com/iformall/service/WxCardSetPriceService.java new file mode 100644 index 000000000..1edc96852 --- /dev/null +++ b/mallinkService/src/main/java/com/iformall/service/WxCardSetPriceService.java @@ -0,0 +1,26 @@ +package com.iformall.service; + +import com.github.pagehelper.PageInfo; +import com.iformall.domain.po.*; + +public interface WxCardSetPriceService { + + /** + * 根据实体查询分页列表 + * + * @param record + * @param pageIndex + * @param pageSize + * @return + */ + PageInfo listAsPage(WxCardSetPrice record, Integer pageIndex, Integer pageSize); + + + /** + * 保存或更新实体 + * + * @param record + */ + void saveOrUpdate(WxCardSetPrice record); + +} diff --git a/mallinkService/src/main/java/com/iformall/service/WxCouponPasswordService.java b/mallinkService/src/main/java/com/iformall/service/WxCouponPasswordService.java index dc24613c5..c0b6bfc1a 100644 --- a/mallinkService/src/main/java/com/iformall/service/WxCouponPasswordService.java +++ b/mallinkService/src/main/java/com/iformall/service/WxCouponPasswordService.java @@ -86,7 +86,7 @@ public interface WxCouponPasswordService { void startOrStop(WxCouponPassword wxCouponPassword); - Integer setPrice(WxCouponPassword wxCouponPassword); + Integer setPrice(WxCouponPassword wxCouponPassword,MallUserInfo user); void exportTemplate(HttpServletRequest request, HttpServletResponse response); void importPrice(MallUserInfo user,String importKey, WxCardPriceTemplate template); diff --git a/mallinkService/src/main/java/com/iformall/service/WxCouponService.java b/mallinkService/src/main/java/com/iformall/service/WxCouponService.java index eb98d4760..da7109854 100644 --- a/mallinkService/src/main/java/com/iformall/service/WxCouponService.java +++ b/mallinkService/src/main/java/com/iformall/service/WxCouponService.java @@ -90,7 +90,7 @@ public interface WxCouponService { */ ResultData saveOrUpdate(WxCoupon record); - ResultData setPrice(WxCoupon record); +// ResultData setPrice(WxCoupon record); ResultData updateTtProduct(WxCoupon wxCoupon); /** diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxCardInfoServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxCardInfoServiceImpl.java index ed6b219e2..ea8ae896a 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxCardInfoServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxCardInfoServiceImpl.java @@ -445,7 +445,7 @@ public class WxCardInfoServiceImpl implements WxCardInfoService { @Override @Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = {Exception.class}) - public ResultData rechargeAmount(WxCardInfo cardInfo) { + public ResultData rechargeAmount(WxCardInfo cardInfo,MallUserInfo user) { WxCardInfo wxCardInfo = wxCardInfoMapper.selectById(cardInfo.getId()); if(wxCardInfo == null){ return new ResultData(ErrorCode.CARD_IS_NOT_FOUND); @@ -490,7 +490,7 @@ public class WxCardInfoServiceImpl implements WxCardInfoService { record.setMerchantId(0l);//充值订单无商户 record.setPayFrom(EnumCardSpendFrom.recharge.getCode()); record.setDeductionAmount(cardInfo.getAmount()); - record.setRemark("充值"); + record.setRemark(user.getUsername()+"【"+user.getId()+"】"+"充值"); record.setPayment(0); record.setRealPayment(0); diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxCardSetPriceServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxCardSetPriceServiceImpl.java new file mode 100644 index 000000000..6e64411d0 --- /dev/null +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxCardSetPriceServiceImpl.java @@ -0,0 +1,70 @@ +package com.iformall.service.impl; + +import com.alibaba.fastjson.JSONObject; +import com.aliyun.openservices.shade.org.apache.commons.lang3.StringUtils; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import com.iformall.common.ErrorCode; +import com.iformall.common.IdWorker; +import com.iformall.common.ResultData; +import com.iformall.domain.dto.WxSharingOrderDto; +import com.iformall.domain.po.*; +import com.iformall.domain.po.base.TenantEntity; +import com.iformall.domain.po.msg.WxMsg; +import com.iformall.domain.vo.PromotionCalc; +import com.iformall.domain.vo.WxCardSpendMerchantVo; +import com.iformall.domain.vo.WxCardSpendVo; +import com.iformall.enums.*; +import com.iformall.exception.MallinkException; +import com.iformall.mapper.*; +import com.iformall.service.*; +import com.iformall.utils.Constant; +import com.iformall.utils.PayUtils; +import org.apache.commons.beanutils.BeanUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Lazy; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Propagation; +import org.springframework.transaction.annotation.Transactional; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.lang.reflect.InvocationTargetException; +import java.math.BigDecimal; +import java.text.SimpleDateFormat; +import java.util.*; + +@Service +public class WxCardSetPriceServiceImpl implements WxCardSetPriceService { + + private final Logger logger = LoggerFactory.getLogger(this.getClass()); + + @Autowired + WxCardSetPriceMapper wxCardSetPriceMapper; + + + @Override + public PageInfo listAsPage(WxCardSetPrice record, Integer pageIndex, Integer pageSize) { + return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxCardSetPriceMapper.findList(record)); + } + + @Override + public void saveOrUpdate(WxCardSetPrice record) { + Date now = new Date(); + if (record.getId() == null) { + //record.setId(UUID.randomUUID().toString().replaceAll("-", "")); + final IdWorker idWorker = IdWorker.get(); + record.setId(idWorker.nextId()); + record.setCreateDate(now); + record.setUpdateDate(now); + wxCardSetPriceMapper.insert(record); + } else { + record.setUpdateDate(now); + wxCardSetPriceMapper.updateById(record); + } + } + +} diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxCouponPasswordServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxCouponPasswordServiceImpl.java index 6de41ac17..eef654797 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxCouponPasswordServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxCouponPasswordServiceImpl.java @@ -20,11 +20,7 @@ import com.iformall.exception.MallinkException; import com.iformall.mapper.WxCardInfoMapper; import com.iformall.mapper.WxCouponMapper; import com.iformall.mapper.WxCouponPasswordMapper; -import com.iformall.service.ExcelService; -import com.iformall.service.SysConfigService; -import com.iformall.service.WxCUserBasicInfoService; -import com.iformall.service.WxCardInfoService; -import com.iformall.service.WxCouponPasswordService; +import com.iformall.service.*; import com.iformall.utils.sign.AppUtils; import org.apache.commons.beanutils.BeanUtils; @@ -35,6 +31,8 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Lazy; import org.springframework.data.redis.core.StringRedisTemplate; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Propagation; +import org.springframework.transaction.annotation.Transactional; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; @@ -78,6 +76,9 @@ public class WxCouponPasswordServiceImpl implements WxCouponPasswordService { @Autowired WxCardInfoService wxCardInfoService; + @Autowired + WxCardSetPriceService wxCardSetPriceService; + @Override public PageInfo listAsPage(WxCouponPassword record, Integer pageIndex, Integer pageSize) { return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxCouponPasswordMapper.findList(record)); @@ -341,12 +342,45 @@ public class WxCouponPasswordServiceImpl implements WxCouponPasswordService { } @Override - public Integer setPrice(WxCouponPassword wxCouponPassword) { - WxCardInfo cardInfo = wxCardInfoService.getByCouponPasswordId(wxCouponPassword.getId(), wxCouponPassword); - if (null == cardInfo) { - return wxCouponPasswordMapper.setPrice(wxCouponPassword); + @Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = {Exception.class}) + public Integer setPrice(WxCouponPassword wxCouponPassword,MallUserInfo user) { + + WxCouponPassword couponPassword = this.getById(wxCouponPassword.getId()); + if(couponPassword == null){ + throw new MallinkException(ErrorCode.COUPON_PASSWORD_NOT_FOUND.getCode(),"卡未找到"); + } + if(wxCouponPassword.getPrice() == null || wxCouponPassword.getPrice() < 0){ + throw new MallinkException(ErrorCode.SYS_PARAMETER_ERROR.getCode(),"价格参数异常"); + } + WxCardInfo cardInfo = wxCardInfoService.getByCouponPasswordId(couponPassword.getId(), couponPassword); + if(cardInfo != null){ + throw new MallinkException(ErrorCode.SYS_PARAMETER_ERROR.getCode(),"卡已激活"); + } + WxCoupon wxCoupon = wxCouponMapper.selectById(couponPassword.getCouponId(), couponPassword.getTenantId()); + if(wxCoupon == null){ + throw new MallinkException(ErrorCode.CARD_IS_NOT_FOUND); + } + if(!EnumCouponType.CARD_MULTIMCH.getCode().equals(wxCoupon.getType()) + || !EnumYesOrNo.YES.getCode().equals(wxCoupon.getIsAfterSetPrice())){ + throw new MallinkException(ErrorCode.SYS_PARAMETER_ERROR.getCode(),"当前不是后置类型"); + } + WxCouponPassword wxCouponPasswordUpd = new WxCouponPassword(); + wxCouponPasswordUpd.setId(couponPassword.getId()); + wxCouponPasswordUpd.updateTenantInfo(couponPassword); + wxCouponPasswordUpd.setPrice(wxCouponPassword.getPrice()); + Integer count = wxCouponPasswordMapper.setPrice(wxCouponPasswordUpd); + if(count > 0){ + //设置面额记录 + WxCardSetPrice cardSetPrice = new WxCardSetPrice(); + cardSetPrice.updateTenantInfo(wxCouponPasswordUpd); + cardSetPrice.setCardPasswordId(wxCouponPasswordUpd.getId()); + cardSetPrice.setPrice(wxCouponPasswordUpd.getPrice()); + cardSetPrice.setOperatorType(EnumUserType.MALLUSER.getCode()); + cardSetPrice.setOperatorId(user.getId()); + cardSetPrice.setOperatorUser(user.getUsername()); + wxCardSetPriceService.saveOrUpdate(cardSetPrice); } - return 0; + return count; } @Override @@ -388,7 +422,7 @@ public class WxCouponPasswordServiceImpl implements WxCouponPasswordService { password.updateTenantInfo(user); password.setId(Long.parseLong(template.getCouponPasswordId())); password.setPrice(new BigDecimal(template.getPrice()).multiply(new BigDecimal(100)).intValue()); - Integer count = setPrice(password); + Integer count = setPrice(password,user); if (null != count && count > 0 ) { }else { stringRedisTemplate.opsForHash().increment(importKey, "processCount", 1); 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 74d4b3b55..9f45f90bd 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxCouponServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxCouponServiceImpl.java @@ -1046,21 +1046,21 @@ public class WxCouponServiceImpl implements WxCouponService { return false; } - @Override - @Transactional(isolation=Isolation.SERIALIZABLE, propagation = Propagation.REQUIRED, rollbackFor = {Exception.class}) - public ResultData setPrice(WxCoupon record) { - Integer count = wxCouponMapper.setPrice(record); - if (null == count || count <= 0 ) { - return new ResultData(Result.ERROR,"设置失败"); - } - //设置卡密price - WxCouponPassword couponPassword = new WxCouponPassword(); - couponPassword.updateTenantInfo(record); - couponPassword.setCouponId(record.getId()); - couponPassword.setPrice(record.getPrice()); - couponPasswordMapper.setPrice(couponPassword); - return new ResultData(); - } +// @Override +// @Transactional(isolation=Isolation.SERIALIZABLE, propagation = Propagation.REQUIRED, rollbackFor = {Exception.class}) +// public ResultData setPrice(WxCoupon record) { +// Integer count = wxCouponMapper.setPrice(record); +// if (null == count || count <= 0 ) { +// return new ResultData(Result.ERROR,"设置失败"); +// } +// //设置卡密price +// WxCouponPassword couponPassword = new WxCouponPassword(); +// couponPassword.updateTenantInfo(record); +// couponPassword.setCouponId(record.getId()); +// couponPassword.setPrice(record.getPrice()); +// couponPasswordMapper.setPrice(couponPassword); +// return new ResultData(); +// } @Override public ResultData updateTtProduct(WxCoupon record) { diff --git a/mallinkService/src/main/resources/mapper/WxCardSetPriceMapper.xml b/mallinkService/src/main/resources/mapper/WxCardSetPriceMapper.xml new file mode 100644 index 000000000..424d2bfe4 --- /dev/null +++ b/mallinkService/src/main/resources/mapper/WxCardSetPriceMapper.xml @@ -0,0 +1,64 @@ + + + + + + + + + + + + + + + + + + + + `id`,`tenant_id`,`parent_tenant_id`,`card_password_id`,`ip`,`create_date`,`update_date`, + `price`,`operator_type`,`operator_id`,`operator_user`, `remark` + + + + where 1 = 1 + + and `id` = #{id} + + + and `tenant_id` = #{tenantId} + + + and `parent_tenant_id` = #{parentTenantId} + + + and `card_password_id` = #{cardPasswordId} + + + and `operator_type` = #{operatorType} + + + and `operator_id` = #{operatorId} + + + and `operator_user` like concat('%', #{operatorUser},'%') + + + and id in + + #{idItem} + + + order by ${sortColumns} + + + + + +