| @@ -124,7 +124,7 @@ public class WxCouponChannelController extends BaseController { | |||||
| logger.debug("[" + getIpAddr() + "] WxCouponChannelController::addbatch"); | logger.debug("[" + getIpAddr() + "] WxCouponChannelController::addbatch"); | ||||
| String[] ids = wxCouponChannelDto.getCouponIds().split(","); | String[] ids = wxCouponChannelDto.getCouponIds().split(","); | ||||
| String[] channelId = wxCouponChannelDto.getChannelId().split(","); | String[] channelId = wxCouponChannelDto.getChannelId().split(","); | ||||
| ResultData resultData = wxCouponChannelService.addBatch(ids, channelId, getTenantInfo(),wxCouponChannelDto.getShowBeginTime(), wxCouponChannelDto.getBeginTime(), wxCouponChannelDto.getEndTime()); | |||||
| ResultData resultData = wxCouponChannelService.addBatch(wxCouponChannelDto.getType(),ids, channelId, getTenantInfo(),wxCouponChannelDto.getShowBeginTime(), wxCouponChannelDto.getBeginTime(), wxCouponChannelDto.getEndTime()); | |||||
| return resultData; | return resultData; | ||||
| } | } | ||||
| @@ -110,7 +110,7 @@ public class WxCouponChannelController extends BaseController { | |||||
| logger.debug("[" + getIpAddr() + "] WxCouponChannelController::addbatch"); | logger.debug("[" + getIpAddr() + "] WxCouponChannelController::addbatch"); | ||||
| String[] ids = wxCouponChannelDto.getCouponIds().split(","); | String[] ids = wxCouponChannelDto.getCouponIds().split(","); | ||||
| String[] channelId = wxCouponChannelDto.getChannelId().split(","); | String[] channelId = wxCouponChannelDto.getChannelId().split(","); | ||||
| ResultData resultData = wxCouponChannelService.addBatch(ids, channelId, getTenantInfo(),wxCouponChannelDto.getShowBeginTime(), wxCouponChannelDto.getBeginTime(), wxCouponChannelDto.getEndTime()); | |||||
| ResultData resultData = wxCouponChannelService.addBatch(wxCouponChannelDto.getType(),ids, channelId, getTenantInfo(),wxCouponChannelDto.getShowBeginTime(), wxCouponChannelDto.getBeginTime(), wxCouponChannelDto.getEndTime()); | |||||
| return resultData; | return resultData; | ||||
| } | } | ||||
| @@ -18,6 +18,8 @@ public class WxCouponChannelDto implements Serializable { | |||||
| private Date endTime; | private Date endTime; | ||||
| private Date showBeginTime; | private Date showBeginTime; | ||||
| private Integer type; | |||||
| @TableField(exist = false) | @TableField(exist = false) | ||||
| @io.swagger.annotations.ApiModelProperty(value = "审批流参数", name = "flowParams") | @io.swagger.annotations.ApiModelProperty(value = "审批流参数", name = "flowParams") | ||||
| @@ -15,7 +15,7 @@ public class MallSaleType extends BaseEntity { | |||||
| @io.swagger.annotations.ApiModelProperty(value="销售类型名",name="name") | @io.swagger.annotations.ApiModelProperty(value="销售类型名",name="name") | ||||
| private String name; | private String name; | ||||
| @io.swagger.annotations.ApiModelProperty(value="资源类型1:速享版 2:速享标准版 3.标准版",name="type") | |||||
| @io.swagger.annotations.ApiModelProperty(value="资源类型1:速享版 2:速享标准版 3.标准版 4.速享试用版",name="type") | |||||
| private Integer type; | private Integer type; | ||||
| @io.swagger.annotations.ApiModelProperty(value="有效期(单位月))",name="period") | @io.swagger.annotations.ApiModelProperty(value="有效期(单位月))",name="period") | ||||
| private Integer period; | private Integer period; | ||||
| @@ -71,7 +71,7 @@ public interface WxCouponChannelService { | |||||
| */ | */ | ||||
| ResultData saveOrUpdate(WxCouponChannel record); | ResultData saveOrUpdate(WxCouponChannel record); | ||||
| ResultData addBatch(String[] ids, String[] channelId, TenantEntity tenantEntity, Date showBeginTime, Date beginTime, Date endTime); | |||||
| ResultData addBatch(Integer type,String[] ids, String[] channelId, TenantEntity tenantEntity, Date showBeginTime, Date beginTime, Date endTime); | |||||
| void updateStatusByCouponId(Long couponId,TenantEntity tenantEntity,int status); | void updateStatusByCouponId(Long couponId,TenantEntity tenantEntity,int status); | ||||
| @@ -9,6 +9,7 @@ import com.iformall.common.ResultData; | |||||
| import com.iformall.domain.po.base.TenantEntity; | import com.iformall.domain.po.base.TenantEntity; | ||||
| import com.iformall.domain.po.WxCoupon; | import com.iformall.domain.po.WxCoupon; | ||||
| import com.iformall.domain.po.WxCouponChannel; | import com.iformall.domain.po.WxCouponChannel; | ||||
| import com.iformall.domain.po.WxMall; | |||||
| import com.iformall.domain.vo.WxCouponCVo; | import com.iformall.domain.vo.WxCouponCVo; | ||||
| import com.iformall.domain.vo.WxCouponChannelAddVo; | import com.iformall.domain.vo.WxCouponChannelAddVo; | ||||
| import com.iformall.domain.vo.WxCouponChannelVo; | import com.iformall.domain.vo.WxCouponChannelVo; | ||||
| @@ -53,6 +54,8 @@ public class WxCouponChannelServiceImpl implements WxCouponChannelService { | |||||
| WxCardInfoMapper wxCardInfoMapper; | WxCardInfoMapper wxCardInfoMapper; | ||||
| @Autowired | @Autowired | ||||
| WxFloatingLayerMapper wxFloatingLayerMapper; | WxFloatingLayerMapper wxFloatingLayerMapper; | ||||
| @Autowired | |||||
| WxMallMapper wxMallMapper; | |||||
| @Autowired | @Autowired | ||||
| @Qualifier("couponChannelRedisTemplate") | @Qualifier("couponChannelRedisTemplate") | ||||
| @@ -141,8 +144,24 @@ public class WxCouponChannelServiceImpl implements WxCouponChannelService { | |||||
| } | } | ||||
| @Override | @Override | ||||
| public ResultData addBatch(String[] ids, String[] channelId, TenantEntity tenantEntity, Date showBeginTime, Date beginTime, Date endTime) { | |||||
| List<WxCouponChannelAddVo> errorList = new ArrayList<>(); | |||||
| public ResultData addBatch(Integer type,String[] ids, String[] channelId, TenantEntity tenantEntity, Date showBeginTime, Date beginTime, Date endTime) { | |||||
| //如果当前版本是推广版,则线上只能有一个拼团,一个砍价 | |||||
| WxMall mall = wxMallMapper.getByTenantId(tenantEntity.getTenantId()); | |||||
| if (mall.getSaleType().intValue() == 4 ) { | |||||
| if (null != type && (type.intValue() == EnumCouponType.COUPON_PRESS.getCode().intValue() | |||||
| || type.intValue() == EnumCouponType.COUPON_GROUP.getCode().intValue())) { | |||||
| WxCouponChannel record = new WxCouponChannel(); | |||||
| record.updateTenantInfo(tenantEntity); | |||||
| record.setStatus(EnumCouponChannelStatus.STATUS_THROW_IN.getCode()); | |||||
| record.setType(type); | |||||
| List<WxCouponChannelVo> list = wxCouponChannelMapper.findVoList(record); | |||||
| if (null != list && list.size() > 0 ) { | |||||
| return new ResultData(ErrorCode.COUPON_CHANNEL_IS_EXISTED,"该版本【拼团】、【砍价】线上只能发布一个。"); | |||||
| } | |||||
| } | |||||
| } | |||||
| List<WxCouponChannelAddVo> errorList = new ArrayList<>(); | |||||
| for (String targetIdstr:channelId) { | for (String targetIdstr:channelId) { | ||||
| Integer targetId = Integer.parseInt(targetIdstr); | Integer targetId = Integer.parseInt(targetIdstr); | ||||
| for (String couponidstr:ids) { | for (String couponidstr:ids) { | ||||
| @@ -404,11 +404,21 @@ public class WxCouponOrderServiceImpl implements WxCouponOrderService { | |||||
| psReceiverQ.setSharingType(payServiceFactory.getPayShareAdapterService(couponOrder.getPayVendor()).getProfitSharingType()); | psReceiverQ.setSharingType(payServiceFactory.getPayShareAdapterService(couponOrder.getPayVendor()).getProfitSharingType()); | ||||
| psReceiverQ.setStatus(EnumProfitSharingReceiverStatus.PROFIT_SHARING_RECEIVER_STATUS_VALID.getCode()); | psReceiverQ.setStatus(EnumProfitSharingReceiverStatus.PROFIT_SHARING_RECEIVER_STATUS_VALID.getCode()); | ||||
| List<WxProfitSharingReceiver> psReceiverList = wxProfitSharingReceiverMapper.findList(psReceiverQ); | List<WxProfitSharingReceiver> psReceiverList = wxProfitSharingReceiverMapper.findList(psReceiverQ); | ||||
| if (null != payAccount.getShare() && EnumPayShare.YES.getCode().intValue() == payAccount.getShare().intValue() && psReceiverList.size() == 0) { | |||||
| throw new MallinkException(ErrorCode.PROFIT_SHARING_RECEIVER_INVALID.getCode(),"该商户分账账户未设置"); | |||||
| if (null == payAccount.getShare()) { | |||||
| throw new MallinkException(ErrorCode.PROFIT_SHARING_RECEIVER_INVALID.getCode(),"该租户payAccount未设置分账."); | |||||
| } | |||||
| if (EnumPayShare.YES.getCode().intValue() == payAccount.getShare().intValue()) { | |||||
| if (null == psReceiverList || psReceiverList.size() == 0) { | |||||
| throw new MallinkException(ErrorCode.PROFIT_SHARING_RECEIVER_INVALID.getCode(),"该商户未设置分账账号."); | |||||
| }else { | |||||
| for (WxProfitSharingReceiver receiver:psReceiverList) { | |||||
| if (EnumProfitSharingReceiverType.PROFIT_SHARING_RECEIVER_PERSONAL_WECHATID.getCode().intValue() | |||||
| == receiver.getReceiverType().intValue()) { | |||||
| throw new MallinkException(ErrorCode.PROFIT_SHARING_RECEIVER_INVALID.getCode(),"该商户收款账号存在个人微信号方式,微信已停止支持,请重新设置."); | |||||
| } | |||||
| } | |||||
| } | |||||
| } | } | ||||
| int num = 0; | int num = 0; | ||||
| try { | try { | ||||
| couponOrder.setCouponOrderStatus(EnumCouponOrderStatus.COUPON_ORDER_USED.getCode()); //1核销 | couponOrder.setCouponOrderStatus(EnumCouponOrderStatus.COUPON_ORDER_USED.getCode()); //1核销 | ||||