| @@ -13,10 +13,7 @@ import com.iformall.domain.vo.WxOrderCouponPressVo; | |||||
| import com.iformall.domain.vo.WxOrderCouponVo; | import com.iformall.domain.vo.WxOrderCouponVo; | ||||
| import com.iformall.enums.*; | import com.iformall.enums.*; | ||||
| import com.iformall.exception.MallinkException; | import com.iformall.exception.MallinkException; | ||||
| import com.iformall.service.WxCUserBasicInfoService; | |||||
| import com.iformall.service.WxCouponChannelService; | |||||
| import com.iformall.service.WxCouponService; | |||||
| import com.iformall.service.WxOrderService; | |||||
| import com.iformall.service.*; | |||||
| import com.iformall.utils.Constant; | import com.iformall.utils.Constant; | ||||
| import com.iformall.utils.RedisLock; | import com.iformall.utils.RedisLock; | ||||
| @@ -55,6 +52,9 @@ public class WxOrderController extends BaseController { | |||||
| @Autowired | @Autowired | ||||
| private WxCUserBasicInfoService wxCUserBasicInfoService; | private WxCUserBasicInfoService wxCUserBasicInfoService; | ||||
| @Autowired | |||||
| private OrderSnapshotService orderSnapshotService; | |||||
| @Autowired | @Autowired | ||||
| @Qualifier("couponDetailRedisTemplate") | @Qualifier("couponDetailRedisTemplate") | ||||
| RedisTemplate<String, WxCouponCVo> cdRedisTemplate; | RedisTemplate<String, WxCouponCVo> cdRedisTemplate; | ||||
| @@ -333,6 +333,24 @@ public class WxOrderController extends BaseController { | |||||
| return new ResultData(wxBatchOrder); | return new ResultData(wxBatchOrder); | ||||
| } | } | ||||
| @ApiOperation("订单详情接口") | |||||
| @GetMapping("getSnapshot") | |||||
| @ApiImplicitParams({ | |||||
| @ApiImplicitParam(name = "orderId", value = "订单composeOrderId", dataType = "String", paramType = "query", required = true) | |||||
| }) | |||||
| public ResultData getSnapshot(Long orderId,Long composeOrderId) { | |||||
| if(orderId == null && composeOrderId == null){ | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); | |||||
| } | |||||
| if(orderId != null){ | |||||
| return new ResultData(orderSnapshotService.getOrderSnapshotByOrderId(getTenantInfo(),orderId)); | |||||
| }else if(composeOrderId != null){ | |||||
| return new ResultData(orderSnapshotService.getOrderSnapshotByComposeOrderId(getTenantInfo(),composeOrderId)); | |||||
| }else{ | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); | |||||
| } | |||||
| } | |||||
| // @ApiOperation(value = "根据orderId查询接口", notes = "{\"orderId\":\"string\"}") | // @ApiOperation(value = "根据orderId查询接口", notes = "{\"orderId\":\"string\"}") | ||||
| // @GetMapping("/findById") | // @GetMapping("/findById") | ||||
| // @ApiImplicitParams({ | // @ApiImplicitParams({ | ||||
| @@ -0,0 +1,340 @@ | |||||
| 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.common.SortColumn; | |||||
| import com.iformall.domain.po.base.TenantEntity; | |||||
| import com.iformall.domain.vo.WxCouponStatisVo; | |||||
| import com.iformall.enums.EnumCouponType; | |||||
| import com.iformall.enums.EnumValidStatus; | |||||
| import com.iformall.utils.Constant; | |||||
| import com.iformall.utils.DateUtils; | |||||
| import lombok.Data; | |||||
| import lombok.EqualsAndHashCode; | |||||
| import lombok.ToString; | |||||
| import java.math.BigDecimal; | |||||
| import java.util.Date; | |||||
| import java.util.HashMap; | |||||
| import java.util.List; | |||||
| import java.util.Map; | |||||
| @TableName(value = "order_snapshot") | |||||
| @Data | |||||
| @ToString(callSuper = true) | |||||
| @EqualsAndHashCode(callSuper = true) | |||||
| public class OrderSnapshot extends TenantEntity { | |||||
| protected Long id; | |||||
| @io.swagger.annotations.ApiModelProperty(value="orderId",name="orderId") | |||||
| private Long orderId; | |||||
| @io.swagger.annotations.ApiModelProperty(value="orderId",name="composeOrderId") | |||||
| private Long composeOrderId; | |||||
| @io.swagger.annotations.ApiModelProperty(value="EnumCouponType 券类型(1.满减券,2.代金券,3.团购券,4.礼品券,5.停车券,6.多商户券,8.砍价券,9.团购券,10.预购商品,11.可配送商品,12.券礼包,50.积分券,51.积分停车券,100.消费卡)",name="type") | |||||
| private Integer type; | |||||
| @io.swagger.annotations.ApiModelProperty(value="封面图",name="coverImg") | |||||
| private String coverImg; | |||||
| @io.swagger.annotations.ApiModelProperty(value="多封面图",name="coverPicture") | |||||
| private String coverPicture; | |||||
| @io.swagger.annotations.ApiModelProperty(value="详情多图",name="detailPicture") | |||||
| private String detailPicture; | |||||
| @io.swagger.annotations.ApiModelProperty(value="券名称",name="title") | |||||
| private String title; | |||||
| @io.swagger.annotations.ApiModelProperty(value="副标题",name="subTitle") | |||||
| private String subTitle; | |||||
| @io.swagger.annotations.ApiModelProperty(value="卷包含内容",name="itemGroup") | |||||
| private String itemGroup; | |||||
| @io.swagger.annotations.ApiModelProperty(value="售价(适用于类型2,3,4,5, 6, 8, 9, 100)",name="salePrice") | |||||
| private Integer salePrice; | |||||
| @io.swagger.annotations.ApiModelProperty(value="使用条件金额(适用于类型1,2,3,4)",name="usePrice") | |||||
| private Integer usePrice; | |||||
| @io.swagger.annotations.ApiModelProperty(value="运费",name="freightPrice") | |||||
| private Integer freightPrice; | |||||
| @io.swagger.annotations.ApiModelProperty(value="限领规则",name="useLimitRule") | |||||
| private Integer useLimitRule; | |||||
| @io.swagger.annotations.ApiModelProperty(value="限领张数",name="useLimitQuantity") | |||||
| private Integer useLimitQuantity; | |||||
| @io.swagger.annotations.ApiModelProperty(value="1.主动领取2.定向投放",name="sendType") | |||||
| private Integer sendType; | |||||
| @io.swagger.annotations.ApiModelProperty(value="EnumCouponValidType 有效时间类型1.时间范围(valid_start_date,valid_end_date). 2领取后几日有效(valid_days)",name="validType") | |||||
| private Integer validType; | |||||
| @io.swagger.annotations.ApiModelProperty(value="卷有效日期-开始",name="validStartDate") | |||||
| private Date validStartDate; | |||||
| @io.swagger.annotations.ApiModelProperty(value="卷有效日期-结束",name="validEndDate") | |||||
| private Date validEndDate; | |||||
| @io.swagger.annotations.ApiModelProperty(value="自领取之日几日有效,(停车券当天有效)",name="validDays") | |||||
| private Integer validDays; | |||||
| @io.swagger.annotations.ApiModelProperty(value="提货有效日期-开始",name="pickStartDate") | |||||
| private Date pickStartDate; | |||||
| @io.swagger.annotations.ApiModelProperty(value="提货有效日期-结束",name="pickEndDate") | |||||
| private Date pickEndDate; | |||||
| @io.swagger.annotations.ApiModelProperty(value="须知",name="detail") | |||||
| private String detail; | |||||
| @io.swagger.annotations.ApiModelProperty(value="面额",name="price") | |||||
| @Excel(name="面额(分)",width = 20,orderNum = "2") | |||||
| private Integer price; | |||||
| @io.swagger.annotations.ApiModelProperty(value="尾款(适用于类型10)",name="tailPrice") | |||||
| private Integer tailPrice; | |||||
| @io.swagger.annotations.ApiModelProperty(value="原价(适用于类型10)",name="origPrice") | |||||
| private Integer origPrice; | |||||
| @io.swagger.annotations.ApiModelProperty(value="单位(0:rmb分 1:小时*100)",name="unit") | |||||
| private Integer unit; | |||||
| @io.swagger.annotations.ApiModelProperty(value="购买须知",name="remark") | |||||
| private String remark; | |||||
| @io.swagger.annotations.ApiModelProperty(value="EnumCouponStatus 状态(-1:全部,0:草稿/待生效,1:已生效,2:已失效,3:已作废)",name="status") | |||||
| private Integer status; | |||||
| @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="business") | |||||
| private Integer business; | |||||
| @io.swagger.annotations.ApiModelProperty(value="子业态",name="subBusiness") | |||||
| private Integer subBusiness; | |||||
| @io.swagger.annotations.ApiModelProperty(value="是否支持转送(0:不支持,1支持)",name="supportTransfer") | |||||
| private Integer supportTransfer; | |||||
| @io.swagger.annotations.ApiModelProperty(value="过期退款(0:正常,1不退)",name="autoRefund") | |||||
| private Integer autoRefund; | |||||
| @io.swagger.annotations.ApiModelProperty(value="补贴类型(0:不支持, 1:微信支付立减与折扣, 2:线下结算, 3:微信付款到银行卡)",name="subsidyType") | |||||
| private Integer subsidyType; | |||||
| @io.swagger.annotations.ApiModelProperty(value="补贴额",name="subsidyNum") | |||||
| private Integer subsidyNum; | |||||
| @io.swagger.annotations.ApiModelProperty(value="砍价/团购限制人数",name="pressLimitNum") | |||||
| private Integer pressLimitNum; | |||||
| @io.swagger.annotations.ApiModelProperty(value="砍价限制时间",name="pressLimitHours") | |||||
| private Integer pressLimitHours; | |||||
| @io.swagger.annotations.ApiModelProperty(value="积分售价(适用于类型10,11)",name="creditPrice") | |||||
| private Integer creditPrice; | |||||
| @io.swagger.annotations.ApiModelProperty(value="过期退积分(0:正常,1不退)",name="autoRefund") | |||||
| private Integer creditRefund; | |||||
| @io.swagger.annotations.ApiModelProperty(value="领取条件",name="condition") | |||||
| private String conditions; | |||||
| @io.swagger.annotations.ApiModelProperty(value="卡密是否支持(0:不支持,1支持)",name="passwordSupport") | |||||
| private Integer passwordSupport; | |||||
| @io.swagger.annotations.ApiModelProperty(value="1:A端发卷,2:B端发卷",name="sourceType") | |||||
| private Integer sourceType; | |||||
| @io.swagger.annotations.ApiModelProperty(value="EnumCouponContentType 内容类型(0:小程序页面类型,1:富文本类型)",name="contentType") | |||||
| private Integer contentType; | |||||
| @io.swagger.annotations.ApiModelProperty(value="富文本内容",name="html") | |||||
| private String html; | |||||
| @io.swagger.annotations.ApiModelProperty(value="卷包内容",name="giftList") | |||||
| private String giftList; | |||||
| @io.swagger.annotations.ApiModelProperty(value="卷包内容",name="giftList") | |||||
| private String merchasntList; | |||||
| @TableField(exist = false) | |||||
| private String salePriceStr; | |||||
| @TableField(exist = false) | |||||
| private String usePriceStr; | |||||
| @TableField(exist = false) | |||||
| private String freightPriceStr; | |||||
| @TableField(exist = false) | |||||
| private String priceStr; | |||||
| @TableField(exist = false) | |||||
| private String tailPriceStr; | |||||
| @TableField(exist = false) | |||||
| private String origPriceStr; | |||||
| @TableField(exist = false) | |||||
| private String subsidyNumStr; | |||||
| public String getSalePriceStr() { | |||||
| if(salePrice!=null) { | |||||
| salePriceStr = new BigDecimal(salePrice).divide(new BigDecimal(100)).toString(); | |||||
| } | |||||
| return salePriceStr; | |||||
| } | |||||
| public String getUsePriceStr() { | |||||
| if(usePrice!=null) { | |||||
| usePriceStr = new BigDecimal(usePrice).divide(new BigDecimal(100)).toString(); | |||||
| } | |||||
| return usePriceStr; | |||||
| } | |||||
| public String getFreightPriceStr() { | |||||
| if(freightPrice!=null) { | |||||
| freightPriceStr = new BigDecimal(freightPrice).divide(new BigDecimal(100)).toString(); | |||||
| } | |||||
| return freightPriceStr; | |||||
| } | |||||
| public String getPriceStr() { | |||||
| if(price!=null) { | |||||
| priceStr = new BigDecimal(price).divide(new BigDecimal(100)).toString(); | |||||
| } | |||||
| return priceStr; | |||||
| } | |||||
| public String getTailPriceStr() { | |||||
| if(tailPrice!=null) { | |||||
| tailPriceStr = new BigDecimal(tailPrice).divide(new BigDecimal(100)).toString(); | |||||
| } | |||||
| return tailPriceStr; | |||||
| } | |||||
| public String getOrigPriceStr() { | |||||
| if(origPrice!=null) { | |||||
| origPriceStr = new BigDecimal(origPrice).divide(new BigDecimal(100)).toString(); | |||||
| } | |||||
| return origPriceStr; | |||||
| } | |||||
| public String getSubsidyNumStr() { | |||||
| if(subsidyNum!=null) { | |||||
| subsidyNumStr = new BigDecimal(subsidyNum).divide(new BigDecimal(100)).toString(); | |||||
| } | |||||
| return subsidyNumStr; | |||||
| } | |||||
| public boolean checkIsCreditCoupon() { | |||||
| if(type == null) { | |||||
| return false; | |||||
| } | |||||
| if(type == EnumCouponType.COUPON_CREDIT.getCode() || | |||||
| type == EnumCouponType.COUPON_CREDIT_PARK.getCode()) { | |||||
| return true; | |||||
| } | |||||
| return false; | |||||
| } | |||||
| public boolean checkIsCard() { | |||||
| if(type == null) { | |||||
| return false; | |||||
| } | |||||
| if(type == EnumCouponType.CARD_MULTIMCH.getCode()) { | |||||
| return true; | |||||
| } | |||||
| return false; | |||||
| } | |||||
| public boolean checkIsFree() { | |||||
| if(salePrice!= null) { | |||||
| if (salePrice.equals(0)) { | |||||
| return true; | |||||
| } else { | |||||
| return false; | |||||
| } | |||||
| } | |||||
| return false; | |||||
| } | |||||
| public boolean validDate(boolean isShare,boolean hasShareAmount,Date curr) { | |||||
| Map retMap = calcuteValidDate(isShare, hasShareAmount, curr); | |||||
| int success = (int) retMap.get("success"); | |||||
| if (success > 0) { | |||||
| return true; | |||||
| }else { | |||||
| return false; | |||||
| } | |||||
| } | |||||
| public Date getRealValidDate(boolean isShare,boolean hasShareAmount,Date curr) { | |||||
| Map retMap = calcuteValidDate(isShare,hasShareAmount,curr); | |||||
| return (Date) retMap.get("realDate"); | |||||
| } | |||||
| private Map calcuteValidDate(boolean isShare,boolean hasShareAmount,Date curr) { | |||||
| int limit_days = Constant.WX_LIMIT_DAYS; | |||||
| int success = 1; | |||||
| Date valid_date = null; | |||||
| if (this.getValidType().equals(EnumValidStatus.VALID_RANGE.getCode()) || | |||||
| this.getType().equals(EnumCouponType.COUPON_TINGCHE.getCode())) { | |||||
| if( this.getType().equals(EnumCouponType.COUPON_PREORDER.getCode())){ | |||||
| valid_date = this.getPickEndDate(); | |||||
| }else{ | |||||
| valid_date = this.getValidEndDate(); | |||||
| } | |||||
| if (this.getSalePrice() > 0 && !this.checkIsCard()) { | |||||
| if (hasShareAmount) { | |||||
| if (isShare) { | |||||
| // 分账有价券核销有效期不能大于分账过期时间 | |||||
| Date limit_date = DateUtils.getTimeAfterDays(limit_days, curr); | |||||
| if (valid_date.after(limit_date)) { | |||||
| valid_date = limit_date; | |||||
| success = 0; | |||||
| } | |||||
| } | |||||
| } | |||||
| } | |||||
| } else { | |||||
| if (this.getSalePrice() > 0 && !this.checkIsCard()) { | |||||
| if (hasShareAmount) { | |||||
| // 分账有价券核销有效期不能大于分账过期时间 | |||||
| if (isShare) { | |||||
| if (this.getValidDays() < Constant.WX_LIMIT_DAYS) { | |||||
| limit_days = this.getValidDays(); | |||||
| }else { | |||||
| success = 0; | |||||
| } | |||||
| }else { | |||||
| limit_days = this.getValidDays(); | |||||
| } | |||||
| }else{ | |||||
| limit_days = this.getValidDays(); | |||||
| } | |||||
| } else { | |||||
| limit_days = this.getValidDays(); | |||||
| } | |||||
| valid_date = DateUtils.getTimeAfterDays(limit_days, curr); | |||||
| } | |||||
| Map retMap = new HashMap(); | |||||
| retMap.put("success", success); | |||||
| retMap.put("realDate", valid_date); | |||||
| return retMap; | |||||
| } | |||||
| public Date getOuterRealValidDate(Date curr) { | |||||
| int limit_days = Constant.WX_LIMIT_DAYS; | |||||
| Date valid_date = null; | |||||
| if (this.getValidType().equals(EnumValidStatus.VALID_RANGE.getCode())) { | |||||
| if( this.getType().equals(EnumCouponType.COUPON_PREORDER.getCode())){ | |||||
| valid_date = this.getPickEndDate(); | |||||
| }else{ | |||||
| valid_date = this.getValidEndDate(); | |||||
| } | |||||
| } else { | |||||
| limit_days = this.getValidDays(); | |||||
| valid_date = DateUtils.getTimeAfterDays(limit_days, curr); | |||||
| } | |||||
| return valid_date; | |||||
| } | |||||
| } | |||||
| @@ -79,6 +79,9 @@ public class WxOrderCouponVo extends TenantEntity { | |||||
| private String title; | private String title; | ||||
| @io.swagger.annotations.ApiModelProperty(value="副标题",name="subTitle") | @io.swagger.annotations.ApiModelProperty(value="副标题",name="subTitle") | ||||
| private String subTitle; | private String subTitle; | ||||
| @io.swagger.annotations.ApiModelProperty(value="卷包含内容",name="itemGroup") | |||||
| private String itemGroup; | |||||
| @io.swagger.annotations.ApiModelProperty(value="售价(适用于类型2,3,4,5)",name="salePrice") | @io.swagger.annotations.ApiModelProperty(value="售价(适用于类型2,3,4,5)",name="salePrice") | ||||
| private Integer salePrice; | private Integer salePrice; | ||||
| @io.swagger.annotations.ApiModelProperty(value="使用条件金额(适用于类型1,2,3,4)",name="usePrice") | @io.swagger.annotations.ApiModelProperty(value="使用条件金额(适用于类型1,2,3,4)",name="usePrice") | ||||
| @@ -190,6 +193,7 @@ public class WxOrderCouponVo extends TenantEntity { | |||||
| this.setCoverImg(c.getCoverImg()); | this.setCoverImg(c.getCoverImg()); | ||||
| this.setTitle(c.getTitle()); | this.setTitle(c.getTitle()); | ||||
| this.setSubTitle(c.getSubTitle()); | this.setSubTitle(c.getSubTitle()); | ||||
| this.setItemGroup(c.getItemGroup()); | |||||
| this.setSalePrice(c.getSalePrice()); | this.setSalePrice(c.getSalePrice()); | ||||
| this.setUsePrice(c.getUsePrice()); | this.setUsePrice(c.getUsePrice()); | ||||
| this.setPrice(c.getPrice()); | this.setPrice(c.getPrice()); | ||||
| @@ -0,0 +1,12 @@ | |||||
| package com.iformall.mapper; | |||||
| import com.iformall.common.CommonMapper; | |||||
| import com.iformall.domain.po.OrderSnapshot; | |||||
| import java.util.List; | |||||
| public interface OrderSnapshotMapper extends CommonMapper<OrderSnapshot, Long> { | |||||
| List<OrderSnapshot> findList(OrderSnapshot os); | |||||
| } | |||||
| @@ -0,0 +1,16 @@ | |||||
| package com.iformall.service; | |||||
| import com.iformall.common.ResultData; | |||||
| import com.iformall.domain.po.WxOrder; | |||||
| import com.iformall.domain.po.base.TenantEntity; | |||||
| public interface OrderSnapshotService { | |||||
| ResultData getOrderSnapshotByOrderId(TenantEntity tenantEntity,Long orderId); | |||||
| ResultData getOrderSnapshotByComposeOrderId(TenantEntity tenantEntity,Long composeOrderId); | |||||
| int saveOrderSnapshot(WxOrder order); | |||||
| } | |||||
| @@ -0,0 +1,61 @@ | |||||
| package com.iformall.service.impl; | |||||
| import com.iformall.common.ErrorCode; | |||||
| import com.iformall.common.ResultData; | |||||
| import com.iformall.domain.po.*; | |||||
| import com.iformall.domain.po.base.TenantEntity; | |||||
| import com.iformall.mapper.OrderSnapshotMapper; | |||||
| import com.iformall.service.*; | |||||
| import org.slf4j.Logger; | |||||
| import org.slf4j.LoggerFactory; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | |||||
| import org.springframework.scheduling.annotation.Async; | |||||
| import org.springframework.stereotype.Service; | |||||
| import java.util.List; | |||||
| @Service | |||||
| public class OrderSnapshotServiceImpl implements OrderSnapshotService { | |||||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||||
| @Autowired | |||||
| OrderSnapshotMapper orderSnapshotMapper; | |||||
| @Override | |||||
| public ResultData getOrderSnapshotByOrderId(TenantEntity tenantEntity, Long orderId) { | |||||
| OrderSnapshot os = new OrderSnapshot(); | |||||
| os.updateTenantInfo(tenantEntity); | |||||
| os.setOrderId(orderId); | |||||
| List<OrderSnapshot> list = orderSnapshotMapper.findList(os); | |||||
| if(list != null && !list.isEmpty()){ | |||||
| return new ResultData(list.get(0)); | |||||
| } | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"未找到订单数据"); | |||||
| } | |||||
| @Override | |||||
| public ResultData getOrderSnapshotByComposeOrderId(TenantEntity tenantEntity, Long composeOrderId) { | |||||
| OrderSnapshot os = new OrderSnapshot(); | |||||
| os.updateTenantInfo(tenantEntity); | |||||
| os.setComposeOrderId(composeOrderId); | |||||
| List<OrderSnapshot> list = orderSnapshotMapper.findList(os); | |||||
| if(list != null && !list.isEmpty()){ | |||||
| return new ResultData(list.get(0)); | |||||
| } | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"未找到订单数据"); | |||||
| } | |||||
| @Async | |||||
| @Override | |||||
| public int saveOrderSnapshot(WxOrder order) { | |||||
| try{ | |||||
| }catch(Exception e){ | |||||
| logger.error("同步订单快照异常"+e.getMessage()); | |||||
| } | |||||
| return 0; | |||||
| } | |||||
| } | |||||
| @@ -1604,6 +1604,21 @@ public class WxMerchantServiceImpl implements WxMerchantService { | |||||
| Map<Long,WxMerchant> merchantMap = new HashMap<Long,WxMerchant>(); | Map<Long,WxMerchant> merchantMap = new HashMap<Long,WxMerchant>(); | ||||
| Map<Long, List<WxShopVo>> merchantShopVoMap = null; | Map<Long, List<WxShopVo>> merchantShopVoMap = null; | ||||
| if (null != merchantIds && merchantIds.size() > 0 ) { | if (null != merchantIds && merchantIds.size() > 0 ) { | ||||
| TtMerchantPoi poiQ = new TtMerchantPoi(); | |||||
| poiQ.updateTenantInfo(tenantEntity); | |||||
| poiQ.setIds(merchantIds); | |||||
| List<TtMerchantPoi> poiList = ttMerchantPoiMapper.findList(poiQ); | |||||
| Map<Long,TtMerchantPoi> poiMap = new HashMap<Long,TtMerchantPoi>(); | |||||
| if(null != poiList){ | |||||
| for (int i = 0 ; i < poiList.size() ; i++) { | |||||
| TtMerchantPoi p = poiList.get(i); | |||||
| if (null != p) { | |||||
| poiMap.put(p.getId(), p); | |||||
| } | |||||
| } | |||||
| } | |||||
| WxMerchant merchantQ = new WxMerchant(); | WxMerchant merchantQ = new WxMerchant(); | ||||
| merchantQ.updateTenantInfo(tenantEntity); | merchantQ.updateTenantInfo(tenantEntity); | ||||
| merchantQ.setIds(merchantIds); | merchantQ.setIds(merchantIds); | ||||
| @@ -1612,6 +1627,12 @@ public class WxMerchantServiceImpl implements WxMerchantService { | |||||
| for (int i = 0 ; i < merchantList.size(); i++) { | for (int i = 0 ; i < merchantList.size(); i++) { | ||||
| WxMerchant m = merchantList.get(i); | WxMerchant m = merchantList.get(i); | ||||
| if (null != m) { | if (null != m) { | ||||
| TtMerchantPoi poi = poiMap.get(m.getId()); | |||||
| if(null != poi){ | |||||
| m.setAddr(poi.getAddress()); | |||||
| m.setLongitude(poi.getLongitude()); | |||||
| m.setLatitude(poi.getLatitude()); | |||||
| } | |||||
| merchantMap.put(m.getId(), m); | merchantMap.put(m.getId(), m); | ||||
| } | } | ||||
| } | } | ||||
| @@ -1632,6 +1653,9 @@ public class WxMerchantServiceImpl implements WxMerchantService { | |||||
| vo.setParameter(cm.getParameter()); | vo.setParameter(cm.getParameter()); | ||||
| vo.setId(m.getId()); | vo.setId(m.getId()); | ||||
| vo.setAddr(m.getAddr()); | |||||
| vo.setLongitude(m.getLongitude()); | |||||
| vo.setLatitude(m.getLatitude()); | |||||
| vo.setMerchantImgUrl(m.getImgUrl()); | vo.setMerchantImgUrl(m.getImgUrl()); | ||||
| vo.setMerchantName(m.getName()); | vo.setMerchantName(m.getName()); | ||||
| vo.setMerchantLinkPhone(m.getLinkPhone()); | vo.setMerchantLinkPhone(m.getLinkPhone()); | ||||
| @@ -112,6 +112,9 @@ public class WxPayOrderServiceImpl implements WxPayOrderService { | |||||
| @Autowired | @Autowired | ||||
| WxBatchOrderMapper wxBatchOrderMapper; | WxBatchOrderMapper wxBatchOrderMapper; | ||||
| @Autowired | |||||
| OrderSnapshotService orderSnapshotService; | |||||
| @Autowired | @Autowired | ||||
| OrderFactory orderFactory; | OrderFactory orderFactory; | ||||
| @@ -931,6 +934,10 @@ public class WxPayOrderServiceImpl implements WxPayOrderService { | |||||
| throw new MallinkException(ErrorCode.MSG_INSIDE_ERROR); | throw new MallinkException(ErrorCode.MSG_INSIDE_ERROR); | ||||
| } | } | ||||
| } | } | ||||
| //订单快照 | |||||
| orderSnapshotService.saveOrderSnapshot(order); | |||||
| } | } | ||||
| } | } | ||||
| @@ -0,0 +1,108 @@ | |||||
| <?xml version="1.0" encoding="UTF-8"?> | |||||
| <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | |||||
| <mapper namespace="com.iformall.mapper.OrderSnapshotMapper"> | |||||
| <resultMap id="BaseResultMap" type="com.iformall.domain.po.OrderSnapshot"> | |||||
| <id column="id" jdbcType="BIGINT" property="id"/> | |||||
| <result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/> | |||||
| <result column="parent_tenant_id" jdbcType="VARCHAR" property="parentTenantId" /> | |||||
| <result column="order_id" jdbcType="BIGINT" property="orderId" /> | |||||
| <result column="compose_order_id" jdbcType="BIGINT" property="composeOrderId" /> | |||||
| <result column="type" jdbcType="INTEGER" property="type"/> | |||||
| <result column="cover_img" jdbcType="VARCHAR" property="coverImg"/> | |||||
| <result column="cover_picture" jdbcType="VARCHAR" property="coverPicture"/> | |||||
| <result column="detail_picture" jdbcType="VARCHAR" property="detailPicture"/> | |||||
| <result column="title" jdbcType="VARCHAR" property="title"/> | |||||
| <result column="sub_title" jdbcType="VARCHAR" property="subTitle"/> | |||||
| <result column="item_group" jdbcType="VARCHAR" property="itemGroup"/> | |||||
| <result column="sale_price" jdbcType="INTEGER" property="salePrice"/> | |||||
| <result column="freight_price" jdbcType="INTEGER" property="freightPrice"/> | |||||
| <result column="use_price" jdbcType="INTEGER" property="usePrice"/> | |||||
| <result column="use_limit_rule" jdbcType="INTEGER" property="useLimitRule"/> | |||||
| <result column="use_limit_quantity" jdbcType="INTEGER" property="useLimitQuantity"/> | |||||
| <result column="send_type" jdbcType="INTEGER" property="sendType"/> | |||||
| <result column="valid_type" jdbcType="INTEGER" property="validType"/> | |||||
| <result column="valid_start_date" jdbcType="TIMESTAMP" property="validStartDate"/> | |||||
| <result column="valid_end_date" jdbcType="TIMESTAMP" property="validEndDate"/> | |||||
| <result column="pick_start_date" jdbcType="TIMESTAMP" property="pickStartDate"/> | |||||
| <result column="pick_end_date" jdbcType="TIMESTAMP" property="pickEndDate"/> | |||||
| <result column="valid_days" jdbcType="INTEGER" property="validDays"/> | |||||
| <result column="detail" jdbcType="VARCHAR" property="detail"/> | |||||
| <result column="price" jdbcType="INTEGER" property="price"/> | |||||
| <result column="tail_price" jdbcType="INTEGER" property="tailPrice"/> | |||||
| <result column="orig_price" jdbcType="INTEGER" property="origPrice"/> | |||||
| <result column="unit" jdbcType="INTEGER" property="unit"/> | |||||
| <result column="remark" jdbcType="VARCHAR" property="remark"/> | |||||
| <result column="status" jdbcType="INTEGER" property="status"/> | |||||
| <result column="create_date" jdbcType="TIMESTAMP" property="createDate"/> | |||||
| <result column="update_date" jdbcType="TIMESTAMP" property="updateDate"/> | |||||
| <result column="business" jdbcType="INTEGER" property="business"/> | |||||
| <result column="sub_business" jdbcType="INTEGER" property="subBusiness"/> | |||||
| <result column="support_transfer" jdbcType="INTEGER" property="supportTransfer"/> | |||||
| <result column="subsidy_type" jdbcType="INTEGER" property="subsidyType"/> | |||||
| <result column="subsidy_num" jdbcType="INTEGER" property="subsidyNum"/> | |||||
| <result column="press_limit_num" jdbcType="INTEGER" property="pressLimitNum"/> | |||||
| <result column="press_limit_hours" jdbcType="INTEGER" property="pressLimitHours"/> | |||||
| <result column="auto_refund" jdbcType="INTEGER" property="autoRefund"/> | |||||
| <result column="credit_price" jdbcType="INTEGER" property="creditPrice"/> | |||||
| <result column="credit_refund" jdbcType="INTEGER" property="creditRefund"/> | |||||
| <result column="conditions" jdbcType="VARCHAR" property="conditions"/> | |||||
| <result column="password_support" property="passwordSupport"/> | |||||
| <result column="content_type" property="contentType"/> | |||||
| <result column="html" property="html"/> | |||||
| <result column="source_type" jdbcType="INTEGER" property="sourceType"/> | |||||
| <result column="gift_list" jdbcType="VARCHAR" property="giftList"></result> | |||||
| <result column="merchant_list" jdbcType="VARCHAR" property="merchantList"></result> | |||||
| </resultMap> | |||||
| <sql id="allColumns"> | |||||
| `id`,`tenant_id`,`parent_tenant_id`,`order_id`,`compose_order_id`,`type`,`cover_img`,`cover_picture`,`detail_picture`, | |||||
| `title`,`sub_title`,`item_group`,`sale_price`,`freight_price`,`use_price`,`use_limit_rule`,`use_limit_quantity`,`send_type`, | |||||
| `valid_type`,`valid_start_date`,`valid_end_date`,pick_start_date,pick_end_date,`valid_days`,`detail`,`price`,tail_price,orig_price,`unit`, | |||||
| `remark`,`status`,`create_date`,`update_date`,`business`,`sub_business`,`support_transfer`,`subsidy_num`,`subsidy_type`, | |||||
| `press_limit_num`, `press_limit_hours`, `auto_refund`,`credit_price`,`credit_refund`, | |||||
| `conditions`,content_type,source_type,password_support,gift_list,merchant_list | |||||
| </sql> | |||||
| <sql id="dynamicWhereConditions"> | |||||
| where 1 = 1 | |||||
| <if test=" null != id "> | |||||
| and `id` = #{id} | |||||
| </if> | |||||
| <if test=" null != tenantId and '' != tenantId"> | |||||
| and `tenant_id` = #{tenantId} | |||||
| </if> | |||||
| <if test=" null != parentTenantId and '' != parentTenantId"> | |||||
| and `parent_tenant_id` = #{parentTenantId} | |||||
| </if> | |||||
| <if test=" null != orderId "> | |||||
| and `order_id` = #{orderId} | |||||
| </if> | |||||
| <if test=" null != composeOrderId "> | |||||
| and `compose_order_id` = #{composeOrderId} | |||||
| </if> | |||||
| <if test=" null != ids "> | |||||
| and id in | |||||
| <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | |||||
| #{idItem} | |||||
| </foreach> | |||||
| </if> | |||||
| <if test=" null != sortColumns">order by ${sortColumns}</if> | |||||
| </sql> | |||||
| <select id="findList" parameterType="com.iformall.domain.po.WxCoupon" resultMap="BaseResultMap"> | |||||
| select | |||||
| <include refid="allColumns"/> | |||||
| from wx_coupon c | |||||
| <include refid="dynamicWhereConditions"/> | |||||
| </select> | |||||
| </mapper> | |||||