| @@ -238,5 +238,18 @@ public class WxCardInfoController extends BaseController { | |||||
| wxCardSpendService.exportData(wxCardSpendVo, request, response); | 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(); | |||||
| } | |||||
| } | } | ||||
| @@ -87,11 +87,23 @@ public class WxCouponPasswordController extends BaseController { | |||||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | ||||
| public ResultData batchList(@ModelAttribute WxCouponPassword wxCouponPassword, Integer pageNum, Integer pageSize) { | public ResultData batchList(@ModelAttribute WxCouponPassword wxCouponPassword, Integer pageNum, Integer pageSize) { | ||||
| wxCouponPassword.updateTenantInfo(getTenantInfo()); | 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); | final PageInfo<WxCouponPasswordVo> page = wxCouponPasswordService.listVoAsPage(wxCouponPassword, pageNum, pageSize); | ||||
| return new ResultData(page); | 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(); | |||||
| } | |||||
| } | } | ||||
| @@ -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 owner_user_id bigint(20) comment '持有用户编码'; | ||||
| alter table wx_card_info add column status int(1) not null default 0 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 刷数据,后两者不能为空 | ##coupon_password_id,coupon_password,c_user_id,owner_user_id 刷数据,后两者不能为空 | ||||
| # 转赠验证wx_coupon_order的c_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 | #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-否'; | |||||
| @@ -6,11 +6,14 @@ import com.iformall.common.Result; | |||||
| import com.iformall.common.ResultData; | import com.iformall.common.ResultData; | ||||
| import com.iformall.domain.po.*; | import com.iformall.domain.po.*; | ||||
| import com.iformall.domain.vo.WxCardSpendVo; | 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.EnumCouponStatus; | ||||
| import com.iformall.enums.EnumCreditLockedStatus; | import com.iformall.enums.EnumCreditLockedStatus; | ||||
| import com.iformall.enums.EnumMerchantStatus; | import com.iformall.enums.EnumMerchantStatus; | ||||
| import com.iformall.enums.EnumMerchantSubsidySource; | import com.iformall.enums.EnumMerchantSubsidySource; | ||||
| import com.iformall.enums.EnumPayWay; | import com.iformall.enums.EnumPayWay; | ||||
| import com.iformall.enums.EnumYesOrNo; | |||||
| import com.iformall.exception.MallinkException; | import com.iformall.exception.MallinkException; | ||||
| import com.iformall.service.WxCUserBasicInfoService; | import com.iformall.service.WxCUserBasicInfoService; | ||||
| import com.iformall.service.WxCardInfoService; | import com.iformall.service.WxCardInfoService; | ||||
| @@ -21,6 +24,8 @@ import com.iformall.service.WxCouponService; | |||||
| import com.iformall.service.WxMerchantService; | import com.iformall.service.WxMerchantService; | ||||
| import com.iformall.service.WxOrderService; | import com.iformall.service.WxOrderService; | ||||
| import com.iformall.utils.Constant; | import com.iformall.utils.Constant; | ||||
| import com.iformall.utils.DateUtils; | |||||
| import io.swagger.annotations.Api; | import io.swagger.annotations.Api; | ||||
| import io.swagger.annotations.ApiImplicitParam; | import io.swagger.annotations.ApiImplicitParam; | ||||
| import io.swagger.annotations.ApiImplicitParams; | import io.swagger.annotations.ApiImplicitParams; | ||||
| @@ -32,6 +37,7 @@ import org.springframework.beans.factory.annotation.Autowired; | |||||
| import org.springframework.web.bind.annotation.*; | import org.springframework.web.bind.annotation.*; | ||||
| import java.math.BigDecimal; | import java.math.BigDecimal; | ||||
| import java.util.ArrayList; | import java.util.ArrayList; | ||||
| import java.util.Date; | |||||
| import java.util.List; | import java.util.List; | ||||
| import java.util.Map; | import java.util.Map; | ||||
| import javax.servlet.http.HttpServletRequest; | import javax.servlet.http.HttpServletRequest; | ||||
| @@ -120,6 +126,18 @@ public class WxCardPayController extends BaseController { | |||||
| logger.error("cardId不能为空"); | logger.error("cardId不能为空"); | ||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "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; | Long cUserId = null; | ||||
| try { | try { | ||||
| cUserId = Long.valueOf(cUserIdStr); | cUserId = Long.valueOf(cUserIdStr); | ||||
| @@ -142,11 +160,15 @@ public class WxCardPayController extends BaseController { | |||||
| logger.error("卡不存在: " + cardIdStr); | logger.error("卡不存在: " + cardIdStr); | ||||
| return new ResultData(ErrorCode.CARD_IS_NOT_FOUND); | return new ResultData(ErrorCode.CARD_IS_NOT_FOUND); | ||||
| } | } | ||||
| return saveCardPayOrder(cUserId,cardInfo,merchantBUser,totalFeeStr,EnumPayWay.PAY_WAY_WECHAT); | return saveCardPayOrder(cUserId,cardInfo,merchantBUser,totalFeeStr,EnumPayWay.PAY_WAY_WECHAT); | ||||
| } | } | ||||
| private ResultData saveCardPayOrder(Long cUserId,WxCardInfo cardInfo,WxMerchantBUser merchantBUser,String totalFeeStr,EnumPayWay payWay) { | 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(); | String ipStr = getIpAddr(); | ||||
| if (Constant.defaultCUserId != cUserId) { | if (Constant.defaultCUserId != cUserId) { | ||||
| WxCUserBasicInfo wxCUserBasicInfo = wxCUserBasicInfoService.getById(cUserId,merchantBUser.getFinalTenantId()); | WxCUserBasicInfo wxCUserBasicInfo = wxCUserBasicInfoService.getById(cUserId,merchantBUser.getFinalTenantId()); | ||||
| @@ -250,6 +272,9 @@ public class WxCardPayController extends BaseController { | |||||
| if (null == couponPassword) { | if (null == couponPassword) { | ||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "卡未查询到"); | 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()); | WxCoupon coupon = wxCouponService.getById(couponPassword.getCouponId(),couponPassword.getTenantId()); | ||||
| if (coupon == null) { | if (coupon == null) { | ||||
| @@ -32,6 +32,7 @@ import com.iformall.domain.po.WxCouponOrder; | |||||
| import com.iformall.domain.po.WxMerchant; | import com.iformall.domain.po.WxMerchant; | ||||
| import com.iformall.domain.po.WxOrder; | import com.iformall.domain.po.WxOrder; | ||||
| import com.iformall.domain.vo.WxCardSpendVo; | import com.iformall.domain.vo.WxCardSpendVo; | ||||
| import com.iformall.enums.EnumCardInfoStatus; | |||||
| import com.iformall.enums.EnumCreditLockedStatus; | import com.iformall.enums.EnumCreditLockedStatus; | ||||
| import com.iformall.enums.EnumMerchantStatus; | import com.iformall.enums.EnumMerchantStatus; | ||||
| import com.iformall.enums.EnumMerchantSubsidySource; | import com.iformall.enums.EnumMerchantSubsidySource; | ||||
| @@ -137,6 +138,9 @@ public class WxCardPayController extends BaseController { | |||||
| logger.error("卡不存在: " + cardIdStr); | logger.error("卡不存在: " + cardIdStr); | ||||
| return new ResultData(ErrorCode.CARD_IS_NOT_FOUND); | 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()) { | if(payment > cardInfo.getRemainingAmount()) { | ||||
| logger.error("卡余额不足: " + cardIdStr); | logger.error("卡余额不足: " + cardIdStr); | ||||
| @@ -358,6 +358,30 @@ public class WxCouponOrderController extends BaseController { | |||||
| } | } | ||||
| return wxCouponOrderService.cardDetailCUserVo(memberId,getTenantInfo(), couponOrderId); | 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 = "卡转赠领取") | @ApiOperation(value = "卡转赠领取") | ||||
| @PostMapping("cardAccept") | @PostMapping("cardAccept") | ||||
| @@ -35,6 +35,7 @@ public enum ErrorCode{ | |||||
| * 系统配置 | * 系统配置 | ||||
| */ | */ | ||||
| SYS_CONFIG_VIERFY_SECODES_UNSET(1030,"系统设置【券码刷新时间】未配置"), | SYS_CONFIG_VIERFY_SECODES_UNSET(1030,"系统设置【券码刷新时间】未配置"), | ||||
| SYS_CONFIG_CARD_VIERFY_SECODES_UNSET(1030,"系统设置【电子卡码刷新时间】未配置"), | |||||
| SYS_CONFIG_DEFAULT_MERCHANT_B_USER_UNSET(1031,"系统配置【外部设备核销默认商户员工编号】未配置"), | SYS_CONFIG_DEFAULT_MERCHANT_B_USER_UNSET(1031,"系统配置【外部设备核销默认商户员工编号】未配置"), | ||||
| /** | /** | ||||
| @@ -3,6 +3,7 @@ package com.iformall.common; | |||||
| public class SysConfigConstant { | public class SysConfigConstant { | ||||
| public static final String vierfy_seconds_key="vierfySeconds"; | 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 default_merchant_b_user = "defaultMerchantBUserId"; | ||||
| public static final String coupon_detail_show_selled = "couponDetailShowSelled"; | public static final String coupon_detail_show_selled = "couponDetailShowSelled"; | ||||
| } | } | ||||
| @@ -17,14 +17,17 @@ public class WxCouponPassword extends TenantEntity { | |||||
| @Excel(name = "ID", width = 20, orderNum = "1") | @Excel(name = "ID", width = 20, orderNum = "1") | ||||
| protected Long id; | protected Long id; | ||||
| @TableField(exist = false) | |||||
| private String idLike; | |||||
| @io.swagger.annotations.ApiModelProperty(value="卡券ID",name="couponId") | @io.swagger.annotations.ApiModelProperty(value="卡券ID",name="couponId") | ||||
| private Long couponId; | private Long couponId; | ||||
| @io.swagger.annotations.ApiModelProperty(value="卡券短ID",name="couponShort") | @io.swagger.annotations.ApiModelProperty(value="卡券短ID",name="couponShort") | ||||
| private String couponShort; | private String couponShort; | ||||
| @Excel(name = "兑换码", width = 20, orderNum = "2") | @Excel(name = "兑换码", width = 20, orderNum = "2") | ||||
| @io.swagger.annotations.ApiModelProperty(value="商户名称",name="password") | |||||
| @io.swagger.annotations.ApiModelProperty(value="卡密",name="password") | |||||
| private String password; | private String password; | ||||
| @TableField(exist = false) | |||||
| private String passwordLike; | |||||
| @Excel(name = "状态", width = 20, replace = {"初始_0", "发送中_1", "已发出_2", "已使用_3", "不可用_4"}, orderNum = "4") | @Excel(name = "状态", width = 20, replace = {"初始_0", "发送中_1", "已发出_2", "已使用_3", "不可用_4"}, orderNum = "4") | ||||
| @io.swagger.annotations.ApiModelProperty(value="卡密状态: 0初始1信息发出中2信息已发出3已使用4已过期",name="status") | @io.swagger.annotations.ApiModelProperty(value="卡密状态: 0初始1信息发出中2信息已发出3已使用4已过期",name="status") | ||||
| private Integer status; | private Integer status; | ||||
| @@ -44,6 +47,9 @@ public class WxCouponPassword extends TenantEntity { | |||||
| @io.swagger.annotations.ApiModelProperty(value = "发放ID", name = "presentId") | @io.swagger.annotations.ApiModelProperty(value = "发放ID", name = "presentId") | ||||
| private Long presentId; | private Long presentId; | ||||
| @io.swagger.annotations.ApiModelProperty(value="是否已停止EnumYesOrNo",name="isStop") | |||||
| private Integer isStop; | |||||
| @TableField(exist = false) | @TableField(exist = false) | ||||
| private String statusStr; | private String statusStr; | ||||
| @@ -112,4 +112,6 @@ public class WxCardVo extends WxCardInfo { | |||||
| private Date couponOnlineEndDate; | private Date couponOnlineEndDate; | ||||
| @TableField(exist = false) | @TableField(exist = false) | ||||
| private List<Long> couponIdList; | private List<Long> couponIdList; | ||||
| @TableField(exist = false) | |||||
| private Integer cardInfoStatus; | |||||
| } | } | ||||
| @@ -34,29 +34,32 @@ public class WxCouponPasswordVo extends TenantEntity { | |||||
| @Excel(name = "卡密状态", width = 20, orderNum = "4", replace = {"初始化_0", "消息发送中_1", "消息已发送_2", "已兑换_3","已作废_4"},prefix = "`") | @Excel(name = "卡密状态", width = 20, orderNum = "4", replace = {"初始化_0", "消息发送中_1", "消息已发送_2", "已兑换_3","已作废_4"},prefix = "`") | ||||
| @io.swagger.annotations.ApiModelProperty(value = "卡密状态", name = "remainPrice") | @io.swagger.annotations.ApiModelProperty(value = "卡密状态", name = "remainPrice") | ||||
| private Integer status; | 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") | @io.swagger.annotations.ApiModelProperty(value = "卡激活状态EnumYesOrNo", name = "used") | ||||
| private Integer 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") | @io.swagger.annotations.ApiModelProperty(value = "", name = "activeDate") | ||||
| private Date 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") | @io.swagger.annotations.ApiModelProperty(value = "激活手机号", name = "phone") | ||||
| private String 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") | @io.swagger.annotations.ApiModelProperty(value = "激活会员", name = "userName") | ||||
| private String 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") | @io.swagger.annotations.ApiModelProperty(value = "电子卡卡号", name = "cardId") | ||||
| private Long 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") | @io.swagger.annotations.ApiModelProperty(value = "面额(元)", name = "price") | ||||
| private Double 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") | @io.swagger.annotations.ApiModelProperty(value = "余额(元)", name = "remainPrice") | ||||
| private Double 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; | private Integer cardStatus; | ||||
| } | } | ||||
| @@ -8,12 +8,12 @@ import java.util.List; | |||||
| public interface WxCardInfoMapper extends CommonMapper<WxCardInfo, Long> { | public interface WxCardInfoMapper extends CommonMapper<WxCardInfo, Long> { | ||||
| //List<WxCardVo> findVoList(WxCardVo wxCardVo); | |||||
| void updateTransferStatusByCouponId(Long couponId); | void updateTransferStatusByCouponId(Long couponId); | ||||
| List<WxCardInfo> findList(WxCardInfo wxCardInfo); | List<WxCardInfo> findList(WxCardInfo wxCardInfo); | ||||
| List<Long> findIdList(WxCardInfo wxCardInfo); | List<Long> findIdList(WxCardInfo wxCardInfo); | ||||
| void updateStatus(WxCardInfo wxCardInfo); | |||||
| } | } | ||||
| @@ -27,5 +27,7 @@ public interface WxCouponPasswordMapper extends CommonMapper<WxCouponPassword, L | |||||
| void updatePostpone(WxCouponPassword wxCouponPassword); | void updatePostpone(WxCouponPassword wxCouponPassword); | ||||
| void updateExpiredTime(@Param("couponId")Long couponId,@Param("expiredTime")Date expiredTime); | void updateExpiredTime(@Param("couponId")Long couponId,@Param("expiredTime")Date expiredTime); | ||||
| void updateIsStop(@Param("tenantId")String tenantId,@Param("id")Long Id,@Param("isStop")Integer isStop); | |||||
| } | } | ||||
| @@ -47,5 +47,7 @@ public interface WxCardInfoService { | |||||
| void exportData(WxCardVo wxCardVo, HttpServletRequest request, HttpServletResponse response); | void exportData(WxCardVo wxCardVo, HttpServletRequest request, HttpServletResponse response); | ||||
| void startOrStop(WxCardInfo cardInfo); | |||||
| } | } | ||||
| @@ -113,4 +113,5 @@ public interface WxCardSpendService { | |||||
| WxCardSpend cardSpendForPosPay(PromotionCalc scoreCreditCalc, WxCardSpend record, WxMerchant merchant, WxMerchantBUser buUser,Integer payWay) throws MallinkException; | WxCardSpend cardSpendForPosPay(PromotionCalc scoreCreditCalc, WxCardSpend record, WxMerchant merchant, WxMerchantBUser buUser,Integer payWay) throws MallinkException; | ||||
| Integer sumRealPayment(WxCardSpendVo wxCardSpend); | Integer sumRealPayment(WxCardSpendVo wxCardSpend); | ||||
| } | } | ||||
| @@ -75,4 +75,6 @@ public interface WxCouponPasswordService { | |||||
| List<WxCouponPassword> findList(WxCouponPassword wxCouponPassword); | List<WxCouponPassword> findList(WxCouponPassword wxCouponPassword); | ||||
| void postpone(WxCouponPassword wxCouponPassword); | void postpone(WxCouponPassword wxCouponPassword); | ||||
| void startOrStop(WxCouponPassword wxCouponPassword); | |||||
| } | } | ||||
| @@ -159,6 +159,7 @@ public class WxCardInfoServiceImpl implements WxCardInfoService { | |||||
| WxCardVo co = new WxCardVo(); | WxCardVo co = new WxCardVo(); | ||||
| try { | try { | ||||
| BeanUtils.copyProperties(co, coo); | BeanUtils.copyProperties(co, coo); | ||||
| co.setCardInfoStatus(coo.getStatus()); | |||||
| //coupon | //coupon | ||||
| WxCoupon coupon = couponMap.get(coo.getCouponId()); | WxCoupon coupon = couponMap.get(coo.getCouponId()); | ||||
| if (null != coupon) { | if (null != coupon) { | ||||
| @@ -321,4 +322,9 @@ public class WxCardInfoServiceImpl implements WxCardInfoService { | |||||
| return cardInfo; | return cardInfo; | ||||
| } | } | ||||
| @Override | |||||
| public void startOrStop(WxCardInfo cardInfo) { | |||||
| wxCardInfoMapper.updateStatus(cardInfo); | |||||
| } | |||||
| } | } | ||||
| @@ -147,6 +147,7 @@ public class WxCouponPasswordServiceImpl implements WxCouponPasswordService { | |||||
| } | } | ||||
| co.setStatus(coo.getStatus()); | co.setStatus(coo.getStatus()); | ||||
| co.setCreateDate(coo.getCreateDate()); | co.setCreateDate(coo.getCreateDate()); | ||||
| co.setIsStop(coo.getIsStop()); | |||||
| retList.add(co); | retList.add(co); | ||||
| } | } | ||||
| return retList; | return retList; | ||||
| @@ -298,18 +299,9 @@ public class WxCouponPasswordServiceImpl implements WxCouponPasswordService { | |||||
| wxCouponPasswordMapper.updatePostpone(wxCouponPassword); | 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()); | |||||
| } | |||||
| } | } | ||||
| @@ -8,6 +8,8 @@ | |||||
| <result column="coupon_id" jdbcType="BIGINT" property="couponId" /> | <result column="coupon_id" jdbcType="BIGINT" property="couponId" /> | ||||
| <result column="c_user_id" jdbcType="BIGINT" property="cUserId" /> | <result column="c_user_id" jdbcType="BIGINT" property="cUserId" /> | ||||
| <result column="owner_user_id" jdbcType="BIGINT" property="ownerUserId" /> | <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="transaction_id" jdbcType="VARCHAR" property="transactionId" /> | ||||
| <result column="amount" jdbcType="INTEGER" property="amount" /> | <result column="amount" jdbcType="INTEGER" property="amount" /> | ||||
| <result column="sale_amount" jdbcType="INTEGER" property="saleAmount" /> | <result column="sale_amount" jdbcType="INTEGER" property="saleAmount" /> | ||||
| @@ -19,14 +21,13 @@ | |||||
| <result column="create_date" jdbcType="TIMESTAMP" property="createDate" /> | <result column="create_date" jdbcType="TIMESTAMP" property="createDate" /> | ||||
| <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" jdbcType="VARCHAR" property="couponPassword"/> | |||||
| <result column="status" jdbcType="INTEGER" property="status"/> | |||||
| </resultMap> | </resultMap> | ||||
| <sql id="allColumns"> | <sql id="allColumns"> | ||||
| `id`,`tenant_id`,`parent_tenant_id`,`coupon_id`,`c_user_id`,`owner_user_id`,`coupon_password_id`,`coupon_password`,`transaction_id`, | `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`, | `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> | ||||
| <sql id="dynamicWhereConditions"> | <sql id="dynamicWhereConditions"> | ||||
| @@ -91,6 +92,10 @@ | |||||
| <if test=" null != enddate"> | <if test=" null != enddate"> | ||||
| and `create_date` <= #{enddate} | and `create_date` <= #{enddate} | ||||
| </if> | </if> | ||||
| <if test=" null != status"> | |||||
| and `status` = #{status} | |||||
| </if> | |||||
| <if test=" null != couponPasswordIdList "> | <if test=" null != couponPasswordIdList "> | ||||
| and coupon_password_id in | and coupon_password_id in | ||||
| <foreach collection="couponPasswordIdList" index="index" item="cpidItem" open="(" separator="," close=")"> | <foreach collection="couponPasswordIdList" index="index" item="cpidItem" open="(" separator="," close=")"> | ||||
| @@ -139,4 +144,8 @@ | |||||
| <include refid="dynamicWhereConditions" /> | <include refid="dynamicWhereConditions" /> | ||||
| </select> | </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> | </mapper> | ||||
| @@ -15,11 +15,11 @@ | |||||
| <result column="update_date" jdbcType="TIMESTAMP" property="updateDate" /> | <result column="update_date" jdbcType="TIMESTAMP" property="updateDate" /> | ||||
| <result column="expire_date" jdbcType="TIMESTAMP" property="expireDate" /> | <result column="expire_date" jdbcType="TIMESTAMP" property="expireDate" /> | ||||
| <result column="present_id" jdbcType="TIMESTAMP" property="presentId"/> | <result column="present_id" jdbcType="TIMESTAMP" property="presentId"/> | ||||
| <result column="is_stop" jdbcType="INTEGER" property="isStop"/> | |||||
| </resultMap> | </resultMap> | ||||
| <sql id="allColumns"> | <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> | ||||
| <sql id="dynamicWhereConditions"> | <sql id="dynamicWhereConditions"> | ||||
| @@ -27,6 +27,9 @@ | |||||
| <if test=" null != id "> | <if test=" null != id "> | ||||
| and `id` = #{id} | and `id` = #{id} | ||||
| </if> | </if> | ||||
| <if test=" null != idLike and '' != idLike "> | |||||
| and `id` like concat('%',#{idLike},'%') | |||||
| </if> | |||||
| <if test=" null != tenantId and '' != tenantId"> | <if test=" null != tenantId and '' != tenantId"> | ||||
| and `tenant_id` = #{tenantId} | and `tenant_id` = #{tenantId} | ||||
| </if> | </if> | ||||
| @@ -39,9 +42,12 @@ | |||||
| <if test=" null != couponShort "> | <if test=" null != couponShort "> | ||||
| and `coupon_short` = #{couponShort} | and `coupon_short` = #{couponShort} | ||||
| </if> | </if> | ||||
| <if test=" null != password "> | |||||
| <if test=" null != password and '' != password"> | |||||
| and `password` = #{password} | and `password` = #{password} | ||||
| </if> | |||||
| </if> | |||||
| <if test=" null != passwordLike and '' != passwordLike "> | |||||
| and `password` like concat('%',#{passwordLike},'%') | |||||
| </if> | |||||
| <if test=" null != status "> | <if test=" null != status "> | ||||
| and `status` = #{status} | and `status` = #{status} | ||||
| </if> | </if> | ||||
| @@ -65,6 +71,10 @@ | |||||
| and `present_id` = #{presentId} | and `present_id` = #{presentId} | ||||
| </if> | </if> | ||||
| <if test=" null != isStop "> | |||||
| and `is_stop` = #{isStop} | |||||
| </if> | |||||
| <if test=" null != ids "> | <if test=" null != ids "> | ||||
| and id in | and id in | ||||
| <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | ||||
| @@ -199,5 +209,9 @@ | |||||
| <update id="updateExpiredTime" parameterType="map"> | <update id="updateExpiredTime" parameterType="map"> | ||||
| update wx_coupon_password set expire_date = #{expiredTime} , update_date = now() where coupon_id = #{couponId} | update wx_coupon_password set expire_date = #{expiredTime} , update_date = now() where coupon_id = #{couponId} | ||||
| </update> | </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> | </mapper> | ||||