| @@ -62,7 +62,7 @@ public class WxCouponController extends BaseController { | |||||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | ||||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | ||||
| @SystemControllerLog(description = "券投放-列表") | @SystemControllerLog(description = "券投放-列表") | ||||
| public ResultData list(@ModelAttribute WxCoupon wxCoupon, Integer pageNum, Integer pageSize,Integer dataType) { | |||||
| public ResultData list(@ModelAttribute WxCoupon wxCoupon, Integer pageNum, Integer pageSize,Integer dataType,Boolean isList) { | |||||
| logger.debug("[" + getIpAddr() + "] WxCouponController::list"); | logger.debug("[" + getIpAddr() + "] WxCouponController::list"); | ||||
| if (wxCoupon == null) wxCoupon = new WxCoupon(); | if (wxCoupon == null) wxCoupon = new WxCoupon(); | ||||
| if(null != dataType && dataType == 1){ | if(null != dataType && dataType == 1){ | ||||
| @@ -87,7 +87,16 @@ public class WxCouponController extends BaseController { | |||||
| EnumCouponType.COUPON_MULTIMCH.getCode()}; | EnumCouponType.COUPON_MULTIMCH.getCode()}; | ||||
| wxCoupon.setTypes(Arrays.asList(typeArray)); | wxCoupon.setTypes(Arrays.asList(typeArray)); | ||||
| } | |||||
| if(!(isList == null?false:isList)){ | |||||
| Integer[] sendTypeArray = { | |||||
| EnumCouponSendType.ACTIVE.getCode(), | |||||
| EnumCouponSendType.PASSIVE.getCode(),}; | |||||
| wxCoupon.setSendTypes(Arrays.asList(sendTypeArray)); | |||||
| } | } | ||||
| return wxCouponService.list(wxCoupon,wxCoupon, pageNum, pageSize); //全列表 | return wxCouponService.list(wxCoupon,wxCoupon, pageNum, pageSize); //全列表 | ||||
| } | } | ||||
| @@ -62,12 +62,16 @@ public class WxCouponController extends BaseController { | |||||
| @ApiImplicitParam(name = "couponChannelId", value = "couponChannelId", dataType = "String", paramType = "query", required = true), | @ApiImplicitParam(name = "couponChannelId", value = "couponChannelId", dataType = "String", paramType = "query", required = true), | ||||
| @ApiImplicitParam(name = "couponId", value = "couponId", dataType = "String", paramType = "query", required = false)}) | @ApiImplicitParam(name = "couponId", value = "couponId", dataType = "String", paramType = "query", required = false)}) | ||||
| public ResultData detailC(String couponChannelId, String couponId) { | public ResultData detailC(String couponChannelId, String couponId) { | ||||
| if (StringUtils.isBlank(couponChannelId) || couponChannelId.equalsIgnoreCase(Constant.UNDEFINED)) { | |||||
| if ((StringUtils.isBlank(couponChannelId) || couponChannelId.equalsIgnoreCase(Constant.UNDEFINED)) | |||||
| && (StringUtils.isBlank(couponId) || couponId.equalsIgnoreCase(Constant.UNDEFINED))) { | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "couponChannelId/couponId为空"); | return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "couponChannelId/couponId为空"); | ||||
| } | } | ||||
| Long couponChannelIdL = 0L, couponIdL = 0L; | Long couponChannelIdL = 0L, couponIdL = 0L; | ||||
| try { | try { | ||||
| couponChannelIdL = Long.valueOf(couponChannelId); | |||||
| if (StringUtils.isNotBlank(couponChannelId) && !couponChannelId.equalsIgnoreCase(Constant.UNDEFINED)) { | |||||
| couponChannelIdL = Long.valueOf(couponChannelId); | |||||
| } | |||||
| if (StringUtils.isNotBlank(couponId) && !couponId.equalsIgnoreCase(Constant.UNDEFINED)) { | if (StringUtils.isNotBlank(couponId) && !couponId.equalsIgnoreCase(Constant.UNDEFINED)) { | ||||
| couponIdL = Long.valueOf(couponId); | couponIdL = Long.valueOf(couponId); | ||||
| } | } | ||||
| @@ -112,7 +116,7 @@ public class WxCouponController extends BaseController { | |||||
| //WxCouponCVo wxCouponCVo = wxCouponChannelService.findDetailVo(couponChannelIdL); | //WxCouponCVo wxCouponCVo = wxCouponChannelService.findDetailVo(couponChannelIdL); | ||||
| WxCouponCVo wxCouponCVo = null; | WxCouponCVo wxCouponCVo = null; | ||||
| try { | try { | ||||
| wxCouponCVo = generateWxCouponCVoex(couponChannelIdL,getTenantInfo().getTenantId()); | |||||
| wxCouponCVo = generateWxCouponCVoex(couponChannelIdL,couponIdL,getTenantInfo().getTenantId()); | |||||
| } catch (IllegalAccessException e) { | } catch (IllegalAccessException e) { | ||||
| logger.error("coupon detail fail,copyproperties error" + couponChannelId,e); | logger.error("coupon detail fail,copyproperties error" + couponChannelId,e); | ||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "coupon detail fail,copyproperties error" + couponChannelId); | return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "coupon detail fail,copyproperties error" + couponChannelId); | ||||
| @@ -138,12 +142,16 @@ public class WxCouponController extends BaseController { | |||||
| @ApiImplicitParam(name = "couponChannelId", value = "couponChannelId", dataType = "String", paramType = "query", required = true), | @ApiImplicitParam(name = "couponChannelId", value = "couponChannelId", dataType = "String", paramType = "query", required = true), | ||||
| @ApiImplicitParam(name = "couponId", value = "couponId", dataType = "String", paramType = "query", required = false)}) | @ApiImplicitParam(name = "couponId", value = "couponId", dataType = "String", paramType = "query", required = false)}) | ||||
| public ResultData getHtml(String couponChannelId, String couponId) { | public ResultData getHtml(String couponChannelId, String couponId) { | ||||
| if (StringUtils.isBlank(couponChannelId) || couponChannelId.equalsIgnoreCase(Constant.UNDEFINED)) { | |||||
| if (StringUtils.isBlank(couponChannelId) || couponChannelId.equalsIgnoreCase(Constant.UNDEFINED) | |||||
| && (StringUtils.isBlank(couponId) || couponId.equalsIgnoreCase(Constant.UNDEFINED))) { | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "couponChannelId/couponId为空"); | return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "couponChannelId/couponId为空"); | ||||
| } | } | ||||
| Long couponChannelIdL = 0L, couponIdL = 0L; | Long couponChannelIdL = 0L, couponIdL = 0L; | ||||
| try { | try { | ||||
| couponChannelIdL = Long.valueOf(couponChannelId); | |||||
| if (StringUtils.isNotBlank(couponChannelId) && !couponChannelId.equalsIgnoreCase(Constant.UNDEFINED)) { | |||||
| couponChannelIdL = Long.valueOf(couponChannelId); | |||||
| } | |||||
| if (StringUtils.isNotBlank(couponId) && !couponId.equalsIgnoreCase(Constant.UNDEFINED)) { | if (StringUtils.isNotBlank(couponId) && !couponId.equalsIgnoreCase(Constant.UNDEFINED)) { | ||||
| couponIdL = Long.valueOf(couponId); | couponIdL = Long.valueOf(couponId); | ||||
| } | } | ||||
| @@ -199,49 +207,57 @@ public class WxCouponController extends BaseController { | |||||
| } | } | ||||
| private WxCouponCVo generateWxCouponCVoForHtml(Long couponChannelIdL, Long couponIdL,String tenantId) { | private WxCouponCVo generateWxCouponCVoForHtml(Long couponChannelIdL, Long couponIdL,String tenantId) { | ||||
| WxCouponChannel cc = wxCouponChannelService.getById(couponChannelIdL,tenantId); | |||||
| if (cc == null) { | |||||
| return null; | |||||
| } | |||||
| WxCoupon c = couponService.getHtmlById(cc.getCouponId(),cc.getTenantId()); | |||||
| if (c == null) { | |||||
| return null; | |||||
| if(couponChannelIdL > 0l){ | |||||
| WxCouponChannel cc = wxCouponChannelService.getById(couponChannelIdL,tenantId); | |||||
| if(cc == null){ | |||||
| return null; | |||||
| } | |||||
| WxCoupon c = couponService.getHtmlById(cc.getCouponId(),cc.getTenantId()); | |||||
| if (c == null) { | |||||
| return null; | |||||
| } | |||||
| WxCouponCVo couponCVo = new WxCouponCVo(); | |||||
| couponCVo.setId(cc.getId()); | |||||
| couponCVo.setCouponId(cc.getCouponId()); | |||||
| couponCVo.setHtml(c.getHtml()); | |||||
| return couponCVo; | |||||
| }else if(couponIdL > 0l){ | |||||
| WxCoupon c = couponService.getHtmlById(couponIdL,tenantId); | |||||
| if (c == null) { | |||||
| return null; | |||||
| } | |||||
| WxCouponCVo couponCVo = new WxCouponCVo(); | |||||
| couponCVo.setCouponId(c.getId()); | |||||
| couponCVo.setHtml(c.getHtml()); | |||||
| return couponCVo; | |||||
| } | } | ||||
| return null; | |||||
| WxCouponCVo couponCVo = new WxCouponCVo(); | |||||
| couponCVo.setId(cc.getId()); | |||||
| couponCVo.setCouponId(cc.getCouponId()); | |||||
| couponCVo.setHtml(c.getHtml()); | |||||
| return couponCVo; | |||||
| } | } | ||||
| private WxCouponCVo generateWxCouponCVoex(Long couponChannelIdL,String tenantId) throws IllegalAccessException, InvocationTargetException { | |||||
| WxCouponChannel cc = wxCouponChannelService.getById(couponChannelIdL,tenantId); | |||||
| if (cc == null) { | |||||
| return null; | |||||
| } | |||||
| WxCoupon c = couponService.getById(cc.getCouponId(),cc.getTenantId()); | |||||
| if (c == null) { | |||||
| c = new WxCoupon(); | |||||
| } | |||||
| WxCouponCVo wxcv = new WxCouponCVo(); | |||||
| BeanUtils.copyProperties(wxcv, c); | |||||
| wxcv.setId(cc.getId()); | |||||
| wxcv.setCouponId(cc.getCouponId()); | |||||
| wxcv.setTargetAd(cc.getTargetAd()); | |||||
| wxcv.setBeginTime(cc.getBeginTime()); | |||||
| wxcv.setEndTime(cc.getEndTime()); | |||||
| wxcv.setQrCode(cc.getQrCode()); | |||||
| List<WxMerchantVo> chantlist = merchantService.findMerchantVoList(cc.getCouponId(),cc.getTenantId()); | |||||
| if (null != chantlist && chantlist.size()>0) { | |||||
| wxcv.setMerchantVoList(chantlist); | |||||
| private WxCouponCVo generateWxCouponCVoex(Long couponChannelIdL,Long couponIdL,String tenantId) throws IllegalAccessException, InvocationTargetException { | |||||
| if(couponChannelIdL > 0l){ | |||||
| WxCouponChannel cc = wxCouponChannelService.getById(couponChannelIdL,tenantId); | |||||
| if(cc == null){ | |||||
| return null; | |||||
| } | |||||
| WxCouponCVo wxcv = couponService.getVoById(cc.getCouponId(),tenantId); | |||||
| if(wxcv == null){ | |||||
| return null; | |||||
| } | |||||
| wxcv.setId(cc.getId()); | |||||
| wxcv.setCouponId(cc.getCouponId()); | |||||
| wxcv.setTargetAd(cc.getTargetAd()); | |||||
| wxcv.setBeginTime(cc.getBeginTime()); | |||||
| wxcv.setEndTime(cc.getEndTime()); | |||||
| wxcv.setQrCode(cc.getQrCode()); | |||||
| return wxcv; | |||||
| }else if(couponIdL > 0l){ | |||||
| WxCouponCVo wxcv = couponService.getVoById(couponIdL,tenantId); | |||||
| return wxcv; | |||||
| } | } | ||||
| return wxcv; | |||||
| return null; | |||||
| } | } | ||||
| private void updateActivityStatus(WxCouponCVo wxCouponCVo) { | private void updateActivityStatus(WxCouponCVo wxCouponCVo) { | ||||
| @@ -271,6 +271,83 @@ public class WxOrderController extends BaseController { | |||||
| return new ResultData(wxOrderCVo); | return new ResultData(wxOrderCVo); | ||||
| } | } | ||||
| @ApiOperation("订单详情接口") | |||||
| @GetMapping("detail_v1") | |||||
| @ApiImplicitParams({ | |||||
| @ApiImplicitParam(name = "orderId", value = "订单id", dataType = "String", paramType = "query", required = true) | |||||
| }) | |||||
| public ResultData detail_v1(String orderId) { | |||||
| if (StringUtils.isBlank(orderId) || orderId.equalsIgnoreCase(Constant.UNDEFINED)) { | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); | |||||
| } | |||||
| // c端用户应该只能看到自己的订单细节 | |||||
| WxOrder wxOrder = new WxOrder(); | |||||
| Long id = 0L; | |||||
| try { | |||||
| id = Long.valueOf(orderId); | |||||
| } catch (NumberFormatException e) { | |||||
| logger.error("parse orderId failed"); | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "订单ID转换异常:"+orderId); | |||||
| } | |||||
| wxOrder.setId(id); | |||||
| Long memberId; | |||||
| try { | |||||
| memberId = getMemberId(); | |||||
| } catch (Exception e) { | |||||
| return new ResultData(Result.ERROR,e.getMessage()); | |||||
| } | |||||
| wxOrder.setCUserId(memberId); | |||||
| WxOrderCouponVo wxOrderCVo = wxOrderService.detailCUserVo(wxOrder); | |||||
| if (wxOrderCVo == null){ | |||||
| wxOrderCVo = new WxOrderCouponVo(); | |||||
| wxOrderCVo.setLevel(1); | |||||
| wxOrder.setComposeOrderId(wxOrder.getId()); | |||||
| wxOrder.setId(null); | |||||
| List<WxOrderCouponVo> wxOrders = wxOrderService.goodsDetailCUserVo(wxOrder); | |||||
| if(wxOrders != null && wxOrders.size() > 0){ | |||||
| wxOrderCVo.setOrderCouponVoList(wxOrders); | |||||
| WxOrderCouponVo wxOrderCouponVo = wxOrders.get(0); | |||||
| wxOrderCVo.setComposeOrderType(wxOrderCouponVo.getComposeOrderType()); | |||||
| wxOrderCVo.setComposeOrderId(wxOrderCouponVo.getCouponOrderId()); | |||||
| wxOrderCVo.setOrderStatus(wxOrderCouponVo.getOrderStatus()); | |||||
| wxOrderCVo.setCreateDate(wxOrderCouponVo.getCreateDate()); | |||||
| wxOrderCVo.setPayment(wxOrders.stream().mapToInt(o -> o.getPayment()).sum()); | |||||
| }else{ | |||||
| return new ResultData(ErrorCode.ORDER_IS_NOT_FIND); | |||||
| } | |||||
| }else{ | |||||
| wxOrderCVo.setLevel(0); | |||||
| Date now = new Date(); | |||||
| if (wxOrderCVo.getValidStartDate() != null && wxOrderCVo.getValidEndDate() != null | |||||
| && !wxOrderCVo.getType().equals(EnumCouponType.COUPON_PREORDER.getCode())) { | |||||
| if (wxOrderCVo.getValidStartDate().getTime() > now.getTime()) { | |||||
| wxOrderCVo.setValidStatus(EnumCouponOrderValidStatus.PREPARED.getCode()); | |||||
| } else if (wxOrderCVo.getValidEndDate().getTime() < now.getTime()) { | |||||
| wxOrderCVo.setValidStatus(EnumCouponOrderValidStatus.ENDED.getCode()); | |||||
| } else { | |||||
| wxOrderCVo.setValidStatus(EnumCouponChannelActivityStatus.STARTED.getCode()); | |||||
| } | |||||
| } | |||||
| if(wxOrderCVo.getType().equals(EnumCouponType.COUPON_PREORDER.getCode()) | |||||
| && wxOrderCVo.getPickStartDate() != null && wxOrderCVo.getPickEndDate() != null){ | |||||
| // wxOrderCVo.setValidStartDate(wxOrderCVo.getPickStartDate()); | |||||
| // wxOrderCVo.setValidEndDate(wxOrderCVo.getPickEndDate()); | |||||
| if (wxOrderCVo.getPickStartDate().getTime() > now.getTime()) { | |||||
| wxOrderCVo.setValidStatus(EnumCouponOrderValidStatus.PREPARED.getCode()); | |||||
| } else if (wxOrderCVo.getPickEndDate().getTime() < now.getTime()) { | |||||
| wxOrderCVo.setValidStatus(EnumCouponOrderValidStatus.ENDED.getCode()); | |||||
| } else { | |||||
| wxOrderCVo.setValidStatus(EnumCouponChannelActivityStatus.STARTED.getCode()); | |||||
| } | |||||
| } | |||||
| } | |||||
| return new ResultData(wxOrderCVo); | |||||
| } | |||||
| @ApiOperation(value = "根据orderId查询接口", notes = "{\"orderId\":\"string\"}") | @ApiOperation(value = "根据orderId查询接口", notes = "{\"orderId\":\"string\"}") | ||||
| @GetMapping("/findById") | @GetMapping("/findById") | ||||
| @ApiImplicitParams({ | @ApiImplicitParams({ | ||||
| @@ -29,6 +29,9 @@ public class WxCoupon extends TenantEntity { | |||||
| @TableField(exist = false) | @TableField(exist = false) | ||||
| protected List<Integer> types; | protected List<Integer> types; | ||||
| @TableField(exist = false) | |||||
| protected List<Integer> sendTypes; | |||||
| @TableField(exist = false) | @TableField(exist = false) | ||||
| protected List<Long> notinTypes; | protected List<Long> notinTypes; | ||||
| @@ -3,6 +3,7 @@ package com.iformall.domain.vo; | |||||
| import com.baomidou.mybatisplus.annotation.TableField; | import com.baomidou.mybatisplus.annotation.TableField; | ||||
| import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | ||||
| import com.iformall.common.SortColumn; | import com.iformall.common.SortColumn; | ||||
| import com.iformall.domain.po.WxCoupon; | |||||
| import com.iformall.domain.po.base.TenantEntity; | import com.iformall.domain.po.base.TenantEntity; | ||||
| import lombok.Data; | import lombok.Data; | ||||
| import lombok.EqualsAndHashCode; | import lombok.EqualsAndHashCode; | ||||
| @@ -146,4 +147,11 @@ public class WxOrderCouponVo extends TenantEntity { | |||||
| @io.swagger.annotations.ApiModelProperty(value="配送信息",name="deliveryInfo") | @io.swagger.annotations.ApiModelProperty(value="配送信息",name="deliveryInfo") | ||||
| private String deliveryInfo; | private String deliveryInfo; | ||||
| @io.swagger.annotations.ApiModelProperty(value="卷包内容",name="giftList") | |||||
| private String giftList; | |||||
| @TableField(exist = false) | |||||
| private List<WxCoupon> giftCouponList; | |||||
| } | } | ||||
| @@ -293,7 +293,8 @@ public class WxCouponChannelServiceImpl implements WxCouponChannelService { | |||||
| return vo; | return vo; | ||||
| } | } | ||||
| if(!isCouponMerchantValid(wxCoupon.getId(),wxCoupon.getTenantId())) { | |||||
| if(!EnumCouponType.COUPON_GIFT.getCode().equals(wxCoupon.getType()) | |||||
| && !isCouponMerchantValid(wxCoupon.getId(),wxCoupon.getTenantId())) { | |||||
| logger.debug(wxCoupon.getId()+couponid+ErrorCode.MERCHANT_INFO_NOT_FOUND.getMessage()); | logger.debug(wxCoupon.getId()+couponid+ErrorCode.MERCHANT_INFO_NOT_FOUND.getMessage()); | ||||
| vo.toCouponChannnelVo(wxCoupon,channelId); | vo.toCouponChannnelVo(wxCoupon,channelId); | ||||
| vo.setErrorMsg(ErrorCode.MERCHANT_INFO_NOT_FOUND.getMessage()); | vo.setErrorMsg(ErrorCode.MERCHANT_INFO_NOT_FOUND.getMessage()); | ||||
| @@ -227,6 +227,9 @@ public class WxCouponServiceImpl implements WxCouponService { | |||||
| @Override | @Override | ||||
| public WxCouponCVo getVoById(Long id,String tenantId) { | public WxCouponCVo getVoById(Long id,String tenantId) { | ||||
| WxCouponCVo wxCouponCVo = wxCouponMapper.findVoDetail(id,tenantId); | WxCouponCVo wxCouponCVo = wxCouponMapper.findVoDetail(id,tenantId); | ||||
| if(wxCouponCVo == null){ | |||||
| return null; | |||||
| } | |||||
| List<WxMerchantVo> merchantList = wxCouponCVo.getMerchantVoList(); | List<WxMerchantVo> merchantList = wxCouponCVo.getMerchantVoList(); | ||||
| if (merchantList != null) { | if (merchantList != null) { | ||||
| merchantList = merchantList.stream().filter( | merchantList = merchantList.stream().filter( | ||||
| @@ -238,8 +241,10 @@ public class WxCouponServiceImpl implements WxCouponService { | |||||
| WxCoupon coupon = new WxCoupon(); | WxCoupon coupon = new WxCoupon(); | ||||
| coupon.updateTenantInfo(wxCouponCVo); | coupon.updateTenantInfo(wxCouponCVo); | ||||
| List<Long> longs = JSON.parseArray(wxCouponCVo.getGiftList(), Long.class); | List<Long> longs = JSON.parseArray(wxCouponCVo.getGiftList(), Long.class); | ||||
| coupon.setIds(longs); | |||||
| wxCouponCVo.setGiftCouponList(wxCouponMapper.findList(coupon)); | |||||
| if(longs != null && longs.size() > 0){ | |||||
| coupon.setIds(longs); | |||||
| wxCouponCVo.setGiftCouponList(wxCouponMapper.findList(coupon)); | |||||
| } | |||||
| } | } | ||||
| return wxCouponCVo; | return wxCouponCVo; | ||||
| @@ -341,7 +346,8 @@ public class WxCouponServiceImpl implements WxCouponService { | |||||
| List<JSONObject> merchantParamList = JSONObject.parseArray(record.getMerchantParams(), JSONObject.class); | List<JSONObject> merchantParamList = JSONObject.parseArray(record.getMerchantParams(), JSONObject.class); | ||||
| //有价券判断商户是否配置了分账账号 | //有价券判断商户是否配置了分账账号 | ||||
| if (record.getSalePrice() != null && record.getSalePrice() > 0) { | |||||
| if (!EnumCouponType.COUPON_GIFT.getCode().equals(record.getType()) | |||||
| && record.getSalePrice() != null && record.getSalePrice() > 0) { | |||||
| boolean share = false; | boolean share = false; | ||||
| WxPayAccount payQ = new WxPayAccount(); | WxPayAccount payQ = new WxPayAccount(); | ||||
| payQ.updateTenantInfo(record); | payQ.updateTenantInfo(record); | ||||
| @@ -428,7 +434,9 @@ public class WxCouponServiceImpl implements WxCouponService { | |||||
| } | } | ||||
| } else{ | } else{ | ||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); | |||||
| if (!EnumCouponType.COUPON_GIFT.getCode().equals(record.getType())){ | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); | |||||
| } | |||||
| } | } | ||||
| if (record.getPasswordSupport() != null && record.getPasswordSupport().equals(EnumCouponPasswordSupport.SUPPORTED.getCode())) { | if (record.getPasswordSupport() != null && record.getPasswordSupport().equals(EnumCouponPasswordSupport.SUPPORTED.getCode())) { | ||||
| @@ -1750,7 +1750,17 @@ public class WxOrderServiceImpl implements WxOrderService { | |||||
| public WxOrderCouponVo detailCUserVo(WxOrder record) { | public WxOrderCouponVo detailCUserVo(WxOrder record) { | ||||
| List<WxOrderCouponVo> list = wxOrderMapper.selectDetailOfCUser(record); | List<WxOrderCouponVo> list = wxOrderMapper.selectDetailOfCUser(record); | ||||
| if (list.size() > 0) { | if (list.size() > 0) { | ||||
| return list.get(0); | |||||
| WxOrderCouponVo wxOrderCouponVo = list.get(0); | |||||
| if(EnumCouponType.COUPON_GIFT.getCode().equals(wxOrderCouponVo.getType())){ | |||||
| WxCoupon coupon = new WxCoupon(); | |||||
| coupon.updateTenantInfo(wxOrderCouponVo); | |||||
| List<Long> longs = JSON.parseArray(wxOrderCouponVo.getGiftList(), Long.class); | |||||
| if(longs != null && longs.size() > 0){ | |||||
| coupon.setIds(longs); | |||||
| wxOrderCouponVo.setGiftCouponList(wxCouponMapper.findList(coupon)); | |||||
| } | |||||
| } | |||||
| return wxOrderCouponVo; | |||||
| } | } | ||||
| return null; | return null; | ||||
| } | } | ||||
| @@ -2,19 +2,16 @@ package com.iformall.service.order.impl.batch; | |||||
| import java.util.Date; | import java.util.Date; | ||||
| import java.util.List; | import java.util.List; | ||||
| import java.util.Objects; | |||||
| import com.aliyun.openservices.shade.com.alibaba.fastjson.JSON; | import com.aliyun.openservices.shade.com.alibaba.fastjson.JSON; | ||||
| import com.iformall.common.ErrorCode; | import com.iformall.common.ErrorCode; | ||||
| import com.iformall.common.IdWorker; | |||||
| import com.iformall.domain.po.*; | import com.iformall.domain.po.*; | ||||
| import com.iformall.domain.po.base.TenantEntity; | |||||
| import com.iformall.domain.vo.WxCouponSendVo; | |||||
| import com.iformall.enums.*; | import com.iformall.enums.*; | ||||
| import com.iformall.exception.MallinkException; | import com.iformall.exception.MallinkException; | ||||
| import org.apache.commons.lang3.StringUtils; | import org.apache.commons.lang3.StringUtils; | ||||
| import org.slf4j.Logger; | import org.slf4j.Logger; | ||||
| import org.slf4j.LoggerFactory; | import org.slf4j.LoggerFactory; | ||||
| import org.springframework.scheduling.annotation.Async; | |||||
| import org.springframework.stereotype.Service; | import org.springframework.stereotype.Service; | ||||
| import org.springframework.transaction.annotation.Propagation; | import org.springframework.transaction.annotation.Propagation; | ||||
| import org.springframework.transaction.annotation.Transactional; | import org.springframework.transaction.annotation.Transactional; | ||||
| @@ -57,6 +54,7 @@ public class CouponPackageOrderAdapterService extends BaseBatchOrderAdapterServi | |||||
| } | } | ||||
| @Override | @Override | ||||
| @Async | |||||
| @Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = {Exception.class}) | @Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = {Exception.class}) | ||||
| public void doOthersAfterPaySuccess(WxOrder order, WxPayOrder record, WxCouponOrder couponOrder) { | public void doOthersAfterPaySuccess(WxOrder order, WxPayOrder record, WxCouponOrder couponOrder) { | ||||
| WxCoupon wxCoupon = wxCouponMapper.selectById(couponOrder.getCouponId(), couponOrder.getTenantId()); | WxCoupon wxCoupon = wxCouponMapper.selectById(couponOrder.getCouponId(), couponOrder.getTenantId()); | ||||
| @@ -111,7 +111,7 @@ | |||||
| c.`valid_type`,c.`valid_start_date`,c.`valid_end_date`,c.pick_start_date,c.pick_end_date,c.`valid_days`,c.`detail`,c.`price`,c.tail_price,c.orig_price,c.`unit`,c.`remain_inventory`,c.`inventory`, | c.`valid_type`,c.`valid_start_date`,c.`valid_end_date`,c.pick_start_date,c.pick_end_date,c.`valid_days`,c.`detail`,c.`price`,c.tail_price,c.orig_price,c.`unit`,c.`remain_inventory`,c.`inventory`, | ||||
| c.`remark`,c.`status`,c.`create_date`,c.`update_date`,c.`business`,c.`sub_business`,c.`support_transfer`,c.`subsidy_num`,c.`subsidy_type`, | c.`remark`,c.`status`,c.`create_date`,c.`update_date`,c.`business`,c.`sub_business`,c.`support_transfer`,c.`subsidy_num`,c.`subsidy_type`, | ||||
| c.`press_limit_num`, c.`press_limit_hours`, c.`auto_refund`,c.`credit_price`,c.`credit_refund`,c.`put_apply_status`,c.`stock_apply_status`,c.`cancle_apply_status`, | c.`press_limit_num`, c.`press_limit_hours`, c.`auto_refund`,c.`credit_price`,c.`credit_refund`,c.`put_apply_status`,c.`stock_apply_status`,c.`cancle_apply_status`, | ||||
| c.`conditions`,c.approval_type,c.content_type,c.source_type,c.password_support | |||||
| c.`conditions`,c.approval_type,c.content_type,c.source_type,c.password_support,c.gift_list | |||||
| </sql> | </sql> | ||||
| <sql id="statusColumns"> | <sql id="statusColumns"> | ||||
| @@ -357,7 +357,8 @@ | |||||
| </if> | </if> | ||||
| <if test=" null == type and null == types"> | <if test=" null == type and null == types"> | ||||
| and ( c.`type` < 7 or c.`type` = 10 ) | |||||
| <!-- and ( c.`type` < 7 or c.`type` = 10 ) --> | |||||
| and c.`type` in (1,2,3,4,5,6,10,11,12) | |||||
| </if> | </if> | ||||
| <if test=" null != type "> | <if test=" null != type "> | ||||
| @@ -573,6 +574,13 @@ | |||||
| </foreach> | </foreach> | ||||
| </if> | </if> | ||||
| <if test=" null != sendTypes "> | |||||
| and c.send_type in | |||||
| <foreach collection="sendTypes" index="index" item="typesItem" open="(" separator="," close=")"> | |||||
| #{typesItem} | |||||
| </foreach> | |||||
| </if> | |||||
| <if test=" null != sortColumns">order by ${sortColumns}</if> | <if test=" null != sortColumns">order by ${sortColumns}</if> | ||||
| </sql> | </sql> | ||||
| @@ -640,6 +648,8 @@ | |||||
| <result column="content_type" jdbcType="INTEGER" property="contentType"/> | <result column="content_type" jdbcType="INTEGER" property="contentType"/> | ||||
| <result column="source_type" jdbcType="INTEGER" property="sourceType"/> | <result column="source_type" jdbcType="INTEGER" property="sourceType"/> | ||||
| <result column="gift_list" jdbcType="VARCHAR" property="giftList"></result> | |||||
| <collection column="{productId=id,tenantId=tenant_id}" property="merchantVoList" | <collection column="{productId=id,tenantId=tenant_id}" property="merchantVoList" | ||||
| ofType="com.iformall.domain.vo.WxMerchantVo" | ofType="com.iformall.domain.vo.WxMerchantVo" | ||||
| javaType="java.util.List" | javaType="java.util.List" | ||||
| @@ -264,7 +264,7 @@ | |||||
| <sql id="allCUserOrderDetailColumns"> | <sql id="allCUserOrderDetailColumns"> | ||||
| o.id,o.order_number,o.tenant_id,o.parent_tenant_id,o.c_user_id,o.coupon_channel_id,o.product_id,o.payment_type,o.payment,o.payment_time,o.order_status,o.create_date,o.update_date, | o.id,o.order_number,o.tenant_id,o.parent_tenant_id,o.c_user_id,o.coupon_channel_id,o.product_id,o.payment_type,o.payment,o.payment_time,o.order_status,o.create_date,o.update_date, | ||||
| c.type,c.cover_img,c.title,c.sub_title,c.sale_price,c.use_price,c.price,c.tail_price,c.orig_price,c.unit,c.detail,c.remark,c.valid_start_date,c.valid_end_date,c.pick_start_date,c.pick_end_date, | |||||
| c.type,c.cover_img,c.title,c.sub_title,c.sale_price,c.use_price,c.price,c.tail_price,c.orig_price,c.unit,c.detail,c.remark,c.valid_start_date,c.valid_end_date,c.pick_start_date,c.pick_end_date,c.gift_list, | |||||
| co.id as coupon_order_id,co.coupon_order_status,c.support_transfer,c.subsidy_num,o.compose_order_type,o.compose_order_id, | co.id as coupon_order_id,co.coupon_order_status,c.support_transfer,c.subsidy_num,o.compose_order_type,o.compose_order_id, | ||||
| o.`coupon_number`,o.`freight_price`,o.`shipping_type`,o.`shipping_address`,co.`shipping_status`,co.`delivery_info` | o.`coupon_number`,o.`freight_price`,o.`shipping_type`,o.`shipping_address`,co.`shipping_status`,co.`delivery_info` | ||||
| </sql> | </sql> | ||||
| @@ -390,6 +390,7 @@ | |||||
| <result column="remark" jdbcType="VARCHAR" property="remark"/> | <result column="remark" jdbcType="VARCHAR" property="remark"/> | ||||
| <result column="valid_start_date" jdbcType="TIMESTAMP" property="validStartDate"/> | <result column="valid_start_date" jdbcType="TIMESTAMP" property="validStartDate"/> | ||||
| <result column="valid_end_date" jdbcType="TIMESTAMP" property="validEndDate"/> | <result column="valid_end_date" jdbcType="TIMESTAMP" property="validEndDate"/> | ||||
| <result column="gift_list" jdbcType="VARCHAR" property="giftList"></result> | |||||
| <result column="subsidy_num" jdbcType="INTEGER" property="subsidyNum"></result> | <result column="subsidy_num" jdbcType="INTEGER" property="subsidyNum"></result> | ||||
| <result column="pick_start_date" jdbcType="TIMESTAMP" property="pickStartDate"/> | <result column="pick_start_date" jdbcType="TIMESTAMP" property="pickStartDate"/> | ||||
| @@ -464,7 +465,7 @@ | |||||
| o.`coupon_number`,o.`freight_price`,o.`shipping_type`,o.`shipping_address` | o.`coupon_number`,o.`freight_price`,o.`shipping_type`,o.`shipping_address` | ||||
| from wx_coupon c,wx_order o | from wx_coupon c,wx_order o | ||||
| where o.product_id = c.id and o.order_status in (0,2) | where o.product_id = c.id and o.order_status in (0,2) | ||||
| and o.compose_order_type in (0,3) | |||||
| and o.compose_order_type = 0 | |||||
| and o.compose_order_id = 0 | and o.compose_order_id = 0 | ||||
| <if test="cUserId != null"> | <if test="cUserId != null"> | ||||
| and o.c_user_id = #{cUserId} | and o.c_user_id = #{cUserId} | ||||
| @@ -509,7 +510,7 @@ | |||||
| null ,null ,null ,null | null ,null ,null ,null | ||||
| from wx_order o | from wx_order o | ||||
| where o.order_status in (0,2) | where o.order_status in (0,2) | ||||
| and o.compose_order_type in (1,2) | |||||
| and o.compose_order_type in (1,2,3) | |||||
| and o.compose_order_id > 0 | and o.compose_order_id > 0 | ||||
| <if test="cUserId != null"> | <if test="cUserId != null"> | ||||
| and o.c_user_id = #{cUserId} | and o.c_user_id = #{cUserId} | ||||