| @@ -7,9 +7,13 @@ import com.iformall.common.ErrorCode; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.controller.base.BaseController; | |||
| import com.iformall.domain.po.TtPoiTakeRate; | |||
| import com.iformall.domain.po.WxCoupon; | |||
| import com.iformall.domain.po.base.BaseEntity; | |||
| import com.iformall.enums.EnumCpsPlanContentType; | |||
| import com.iformall.enums.EnumCpsPlanStatus; | |||
| import com.iformall.enums.EnumCpsPlanType; | |||
| import com.iformall.service.TtCouponGoodsService; | |||
| import com.iformall.service.WxCouponService; | |||
| import io.swagger.annotations.ApiImplicitParam; | |||
| import io.swagger.annotations.ApiImplicitParams; | |||
| import io.swagger.annotations.ApiOperation; | |||
| @@ -20,7 +24,9 @@ import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.web.bind.annotation.*; | |||
| import java.util.HashMap; | |||
| import java.util.List; | |||
| import java.util.Map; | |||
| import java.util.stream.Collectors; | |||
| /** | |||
| @@ -34,8 +40,46 @@ public class TtPoiPlanController extends BaseController { | |||
| @Autowired | |||
| private TtCouponGoodsService ttCouponGoodsService; | |||
| // @TenantIgnore | |||
| @Autowired | |||
| private WxCouponService wxCouponService; | |||
| @ApiOperation("分页列表接口") | |||
| @GetMapping("takeRateList") | |||
| @ApiImplicitParams({ | |||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | |||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | |||
| @SystemControllerLog(description = "列表") | |||
| public ResultData takeRateList(@ModelAttribute TtPoiTakeRate record, Integer pageNum, Integer pageSize) { | |||
| logger.debug("[" + getIpAddr() + "] TtMerchantPoiController::list"); | |||
| if (null == record) record = new TtPoiTakeRate(); | |||
| record.updateTenantInfo(getTenantInfo()); | |||
| record.setSortColumns(BaseEntity.SortField.UpdateDate_DESC); | |||
| final PageInfo<TtPoiTakeRate> page = ttCouponGoodsService.takeRateListAsPage(record, pageNum, pageSize); | |||
| if(page.getList() != null && !page.getList().isEmpty()){ | |||
| List<Long> couponIds = page.getList().stream().map(cc -> cc.getCouponId()).collect(Collectors.toList()); | |||
| Map<Long, WxCoupon> couponMap = wxCouponService.getCouponMap(couponIds, getTenantInfo()); | |||
| for (TtPoiTakeRate takeRate:page.getList()) { | |||
| takeRate.setCoupon(couponMap.get(takeRate.getCouponId())); | |||
| } | |||
| } | |||
| return new ResultData(page); | |||
| } | |||
| @ApiOperation("通过id获取") | |||
| @GetMapping("getTakeRate") | |||
| @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) | |||
| @SystemControllerLog(description = "列表") | |||
| public ResultData getTakeRate(Long id) { | |||
| logger.debug("[" + getIpAddr() + "] TtMerchantPoiController::getTakeRate"); | |||
| if(id == null){ | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); | |||
| } | |||
| TtPoiTakeRate takeRateById = ttCouponGoodsService.getTakeRateById(getTenantInfo(), id); | |||
| return new ResultData(takeRateById); | |||
| } | |||
| // @TenantIgnore | |||
| @ApiOperation("通用计划分页列表接口") | |||
| @GetMapping("list") | |||
| @ApiImplicitParams({}) | |||
| @SystemControllerLog(description = "列表") | |||
| @@ -53,110 +97,132 @@ public class TtPoiPlanController extends BaseController { | |||
| return ttCouponGoodsService.poiPlanList(getTenantInfo(),couponId,pageNum,pageSize); | |||
| } | |||
| @ApiOperation("定向计划分页列表接口") | |||
| @GetMapping("orientedList") | |||
| @ApiImplicitParams({}) | |||
| @SystemControllerLog(description = "列表") | |||
| public ResultData orientedList(Long couponId,Integer pageNum, Integer pageSize) { | |||
| logger.debug("[" + getIpAddr() + "] TtPoiPlanController::orientedList"); | |||
| if(couponId == null){ | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); | |||
| } | |||
| if(pageNum == null){ | |||
| pageNum = 1; | |||
| } | |||
| if(pageSize == null){ | |||
| pageSize = 100; | |||
| } | |||
| return ttCouponGoodsService.poiOrientedPlanList(getTenantInfo(),couponId,pageNum,pageSize); | |||
| } | |||
| @ApiOperation("发布修改通用佣金计划") | |||
| @PostMapping("save") | |||
| @SystemControllerLog(description = "更新") | |||
| public ResultData save(@RequestBody Map<String, Object> param) { | |||
| public ResultData save(@RequestBody TtPoiTakeRate record) { | |||
| logger.debug("[" + getIpAddr() + "] TtMerchantPoiController::save"); | |||
| Integer commissionRate = (Integer) param.get("commissionRate"); | |||
| if(commissionRate == null){ | |||
| if(record.getTakeRate() == null){ | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"商品的抽佣率为空"); | |||
| } | |||
| if(commissionRate.intValue() < 100 || commissionRate.intValue() > 2900){ | |||
| if(record.getTakeRate() < 100 || record.getTakeRate() > 2900){ | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"商品的抽佣率需在万分位100-2900之间"); | |||
| } | |||
| Integer contentType = (Integer) param.get("contentType"); | |||
| if(contentType == null){ | |||
| if(record.getContentType() == null){ | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"带货场景为空"); | |||
| } | |||
| if(contentType.intValue() < 1 || contentType.intValue() > 3){ | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"带货场景不合法"); | |||
| } | |||
| String planIdStr = (String) param.get("planId"); | |||
| Long planId = null; | |||
| if(StringUtils.isNotBlank(planIdStr)){ | |||
| planId = Long.parseLong(planIdStr); | |||
| if(record.getCouponId() == null){ | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"商品Id为空"); | |||
| } | |||
| record.updateTenantInfo(getTenantInfo()); | |||
| return ttCouponGoodsService.poiPlanSave(record); | |||
| } | |||
| String couponIdStr = (String) param.get("couponId"); | |||
| if(StringUtils.isBlank(couponIdStr)){ | |||
| @ApiOperation("发布修改定向佣金计划") | |||
| @PostMapping("saveOrientedPlan") | |||
| @SystemControllerLog(description = "更新") | |||
| public ResultData saveOrientedPlan(@RequestBody TtPoiTakeRate record) { | |||
| logger.debug("[" + getIpAddr() + "] TtMerchantPoiController::saveOrientedPlan"); | |||
| if(StringUtils.isBlank(record.getName())){//不可修改 | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"计划名称为空"); | |||
| } | |||
| if(StringUtils.isBlank(record.getMerchantPhone())){ | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"计划联系人为空"); | |||
| } | |||
| if(record.getDouyinIdList() == null || record.getDouyinIdList().isEmpty()){ | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"定向达人抖音号为空"); | |||
| } | |||
| if(record.getCouponId() == null){ | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"商品Id为空"); | |||
| } | |||
| Long couponId = Long.parseLong(couponIdStr); | |||
| return ttCouponGoodsService.poiPlanSave(getTenantInfo(),couponId,planId,contentType,commissionRate); | |||
| if(record.getContentType() == null){ | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"带货场景为空"); | |||
| } | |||
| EnumCpsPlanContentType planType = EnumCpsPlanContentType.getEnum(record.getContentType()); | |||
| if(planType == null || (!planType.equals(EnumCpsPlanContentType.VIDEO) && !planType.equals(EnumCpsPlanContentType.LIVE))){ | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(),"带货场景错误"); | |||
| } | |||
| if(planType.equals(EnumCpsPlanContentType.VIDEO)){ | |||
| if(record.getStartTime() == null){ | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"计划开始时间为空"); | |||
| } | |||
| if(record.getEndTime() == null){ | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"计划结束时间为空"); | |||
| } | |||
| if(record.getCommissionDuration() == null){ | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"佣金有效期为空"); | |||
| } | |||
| } | |||
| if(record.getTakeRate() == null){ | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"商品的抽佣率为空"); | |||
| } | |||
| if(record.getTakeRate() <= 0 || record.getTakeRate() > 2900){ | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"商品的抽佣率需在万分位0-2900之间"); | |||
| } | |||
| record.updateTenantInfo(getTenantInfo()); | |||
| return ttCouponGoodsService.saveOrientedPlan(record); | |||
| } | |||
| @ApiOperation("修改通用佣金计划状态") | |||
| @PostMapping("updateStatus") | |||
| @SystemControllerLog(description = "更新") | |||
| public ResultData updateStatus(@RequestBody Map<String, Object> param) { | |||
| public ResultData updateStatus(@RequestBody TtPoiTakeRate record) { | |||
| logger.debug("[" + getIpAddr() + "] TtMerchantPoiController::updateStatus"); | |||
| String planIdStr = (String) param.get("planId"); | |||
| if(StringUtils.isBlank(planIdStr)){ | |||
| if(record.getId() == null){ | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"计划ID为空"); | |||
| } | |||
| Long planId = Long.parseLong(planIdStr); | |||
| Integer status = (Integer) param.get("status"); | |||
| if(status == null){ | |||
| if(record.getStatus() == null){ | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"状态值为空"); | |||
| } | |||
| if(status.intValue() < 1 || status.intValue() > 3){ | |||
| EnumCpsPlanStatus planStatus = EnumCpsPlanStatus.getEnum(record.getStatus()); | |||
| if(planStatus == null){ | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"状态不合法"); | |||
| } | |||
| return ttCouponGoodsService.poiPlanUpdateStatus(getTenantInfo(),planId,status); | |||
| } | |||
| @ApiOperation("分页列表接口") | |||
| @GetMapping("takeRateList") | |||
| @ApiImplicitParams({ | |||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | |||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | |||
| @SystemControllerLog(description = "列表") | |||
| public ResultData takeRateList(@ModelAttribute TtPoiTakeRate record, Integer pageNum, Integer pageSize) { | |||
| logger.debug("[" + getIpAddr() + "] TtMerchantPoiController::list"); | |||
| if (null == record) record = new TtPoiTakeRate(); | |||
| record.updateTenantInfo(getTenantInfo()); | |||
| record.setSortColumns(BaseEntity.SortField.UpdateDate_DESC); | |||
| final PageInfo<TtPoiTakeRate> page = ttCouponGoodsService.takeRateListAsPage(record, pageNum, pageSize); | |||
| return new ResultData(page); | |||
| return ttCouponGoodsService.poiPlanUpdateStatus(record); | |||
| } | |||
| @ApiOperation("商品达人分佣配置") | |||
| @PostMapping("takeRate") | |||
| @ApiOperation("修改定向佣金计划状态") | |||
| @PostMapping("updateOrientedStatus") | |||
| @SystemControllerLog(description = "更新") | |||
| public ResultData takeRate(@RequestBody Map<String, Object> param) { | |||
| logger.debug("[" + getIpAddr() + "] TtMerchantPoiController::takeRate"); | |||
| Integer status = (Integer) param.get("status"); | |||
| if(status == null){ | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"状态为空"); | |||
| } | |||
| if(status.intValue() != 1 && status.intValue() != 2){ | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"状态不规范"); | |||
| } | |||
| Integer takeRate = (Integer) param.get("takeRate"); | |||
| if(takeRate == null){ | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"抽佣率为空"); | |||
| public ResultData updateOrientedStatus(@RequestBody TtPoiTakeRate record) { | |||
| logger.debug("[" + getIpAddr() + "] TtMerchantPoiController::updateOrientedStatus"); | |||
| if(record.getId() == null){ | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"计划ID为空"); | |||
| } | |||
| // if(takeRate.intValue() < 100 || takeRate.intValue() > 2900){ | |||
| // return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"抽佣率需在万分位100-2900之间"); | |||
| // } | |||
| String douyinId = (String) param.get("douyinId"); | |||
| if(StringUtils.isBlank(douyinId)){ | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"抖音号为空"); | |||
| if(record.getStatus() == null){ | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"状态值为空"); | |||
| } | |||
| String couponIdStr = (String) param.get("couponId"); | |||
| if(StringUtils.isBlank(couponIdStr)){ | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"商品Id为空"); | |||
| EnumCpsPlanStatus planStatus = EnumCpsPlanStatus.getEnum(record.getStatus()); | |||
| if(!EnumCpsPlanStatus.OFF.equals(planStatus)){ | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"状态不合法"); | |||
| } | |||
| Long couponId = Long.parseLong(couponIdStr); | |||
| record.updateTenantInfo(getTenantInfo()); | |||
| return ttCouponGoodsService.poiTakeRate(getTenantInfo(),couponId,douyinId,takeRate,status); | |||
| return ttCouponGoodsService.poiOrientedPlanUpdateStatus(record); | |||
| } | |||
| @ApiOperation("获取佣金范围") | |||
| @PostMapping("getRateScope") | |||
| @SystemControllerLog(description = "获取") | |||
| @@ -371,15 +371,7 @@ public class WxMerchantController extends BaseController { | |||
| if(merchant == null){ | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(),"请检查传递参数"); | |||
| } | |||
| WxAppinfo appInfo = wxAppinfoService.getCAppInfo(getTenantInfo(), EnumAppPlat.TOUTIAO); | |||
| if(appInfo == null) { | |||
| return new ResultData(ErrorCode.APP_ID_NOT_FOUND); | |||
| } | |||
| WxPayAccount payAcount = payAccountService.getById(appInfo.getPayId()); | |||
| if(payAcount == null){ | |||
| return new ResultData(ErrorCode.APP_ID_NOT_FOUND); | |||
| } | |||
| return wxProfitSharingReceiverService.updateTtReceiver(merchant,appInfo.getAppId(),payAcount.getApiKey()); | |||
| return wxProfitSharingReceiverService.updateTtReceiver(merchant); | |||
| } | |||
| @@ -400,19 +392,10 @@ public class WxMerchantController extends BaseController { | |||
| if(anEnum == null){ | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(),"请检查传递参数"); | |||
| } | |||
| WxAppinfo appInfo = wxAppinfoService.getCAppInfo(getTenantInfo(), EnumAppPlat.TOUTIAO); | |||
| if(appInfo == null) { | |||
| return new ResultData(ErrorCode.APP_ID_NOT_FOUND); | |||
| } | |||
| WxPayAccount payAcount = payAccountService.getById(appInfo.getPayId()); | |||
| if(payAcount == null){ | |||
| return new ResultData(ErrorCode.APP_ID_NOT_FOUND); | |||
| } | |||
| if(anEnum.equals(AppAddSubMerchantUrlType.improt_URL)){ | |||
| return wxProfitSharingReceiverService.getTtReceiverImprotURL(merchant,appInfo.getAppId(),payAcount.getApiKey()); | |||
| return wxProfitSharingReceiverService.getTtReceiverImprotURL(merchant); | |||
| }else if(anEnum.equals(AppAddSubMerchantUrlType.Balance_URL)){ | |||
| return wxProfitSharingReceiverService.getTtReceiverBalanceURL(merchant,appInfo.getAppId(),payAcount.getApiKey()); | |||
| return wxProfitSharingReceiverService.getTtReceiverBalanceURL(merchant); | |||
| }else{ | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(),"请检查传递参数"); | |||
| } | |||
| @@ -436,7 +419,7 @@ public class WxMerchantController extends BaseController { | |||
| if(payAcount == null){ | |||
| return new ResultData(ErrorCode.APP_ID_NOT_FOUND); | |||
| } | |||
| return wxProfitSharingReceiverService.updateTtReceiverIsUse(merchant,appInfo.getAppId(),payAcount.getApiKey()); | |||
| return wxProfitSharingReceiverService.updateTtReceiverIsUse(merchant); | |||
| } | |||
| } | |||
| @@ -3,6 +3,7 @@ package com.iformall.controller.market; | |||
| import com.alibaba.fastjson.JSON; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.annotation.SystemControllerLog; | |||
| import com.iformall.common.ErrorCode; | |||
| import com.iformall.common.Result; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.controller.base.BaseController; | |||
| @@ -11,6 +12,7 @@ import com.iformall.domain.po.*; | |||
| import com.iformall.domain.vo.WxCouponChannelVo; | |||
| import com.iformall.enums.EnumCouponSourceType; | |||
| import com.iformall.domain.po.base.BaseEntity; | |||
| import com.iformall.enums.EnumCouponStatus; | |||
| import com.iformall.exception.MallinkException; | |||
| import com.iformall.service.WxCouponChannelService; | |||
| import com.iformall.service.WxCouponService; | |||
| @@ -87,7 +89,6 @@ public class WxCouponChannelController extends BaseController { | |||
| public ResultData update(@RequestBody WxCouponChannel wxCouponChannel) { | |||
| logger.debug("[" + getIpAddr() + "] WxCouponChannelController::update"); | |||
| wxCouponChannel.updateTenantInfo(getTenantInfo()); | |||
| ResultData resultData = wxCouponChannelService.saveOrUpdate(wxCouponChannel); | |||
| WxCouponChannel couponChannel = (WxCouponChannel)resultData.data; | |||
| //生成二维码 | |||
| @@ -121,7 +121,7 @@ public class WxCouponController extends BaseController { | |||
| Integer[] typeArray = { | |||
| EnumCouponType.COUPON_MANJIAN.getCode(), | |||
| EnumCouponType.COUPON_DAIJIN.getCode(), | |||
| EnumCouponType.COUPON_TUANGOU.getCode(), | |||
| // EnumCouponType.COUPON_TUANGOU.getCode(), | |||
| EnumCouponType.COUPON_LIPIN.getCode(), | |||
| EnumCouponType.COUPON_TINGCHE.getCode(), | |||
| EnumCouponType.COUPON_MULTIMCH.getCode(), | |||
| @@ -184,30 +184,22 @@ public class WxCouponController extends BaseController { | |||
| if (wxCoupon.getId() == null) { | |||
| return new ResultData(ResultData.ERROR, "缺少id"); | |||
| } | |||
| wxCoupon.updateTenantInfo(getTenantInfo()); | |||
| if(EnumDelFlag.YES.getCode().equals(wxCoupon.getIsDel())){ | |||
| WxCouponChannel query = new WxCouponChannel(); | |||
| query.updateTenantInfo(wxCoupon); | |||
| query.setCouponId(wxCoupon.getId()); | |||
| query.setStatus(EnumCouponChannelStatus.STATUS_THROW_IN.getCode()); | |||
| if (CollectionUtils.isNotEmpty(wxCouponChannelService.findList(query))) { | |||
| return new ResultData(ResultData.ERROR, "有活动正在上架,请先下架。"); | |||
| } | |||
| // query.setStatus(EnumCouponChannelStatus.STATUS_BEFORE.getCode()); | |||
| // if (CollectionUtils.isNotEmpty(wxCouponChannelService.findList(query))) { | |||
| // TtCouponChannelPoi ttCouponChannelPoi = wxCouponService.getCouponChannelPoi(getTenantInfo(),wxCoupon.getId()); | |||
| // if(EnumSpuSyncStatus.sync_auditing.getCode().equals(ttCouponChannelPoi.getLastStatus())){ | |||
| // return new ResultData(ResultData.ERROR, "有活动正在预审核."); | |||
| // } | |||
| // } | |||
| } | |||
| WxCoupon coupon = wxCouponService.getById(wxCoupon.getId(),wxCoupon.getTenantId()); | |||
| if (null == coupon) { | |||
| return new ResultData(ResultData.ERROR, "券未查询到。"+wxCoupon.getId()); | |||
| return new ResultData(ResultData.ERROR, "券未查询到。"+wxCoupon.getId()); | |||
| } | |||
| redisLock.setCouponStock(wxCoupon.getId(), coupon.getRemainInventory()); | |||
| if(EnumDelFlag.YES.getCode().equals(wxCoupon.getIsDel())){ | |||
| if(!EnumCouponStatus.COUPON_STATUS_TAKE_OFFF.getCode().equals(coupon.getStatus())){ | |||
| return new ResultData(ResultData.ERROR, "请先作废,再进行删除。"); | |||
| } | |||
| wxCouponService.deleteById(wxCoupon.getId(),wxCoupon.getTenantId()); | |||
| CouponCacheUtils.removeCouponCache(redisTemplate, wxCoupon.getId()); | |||
| CouponCacheUtils.removeCouponMerchantCache(redisTemplate, wxCoupon.getId()); | |||
| return new ResultData(); | |||
| } | |||
| //启动审批流 | |||
| if (wxCoupon.getFlowParams() != null && wxCoupon.getFlowParams().size() > 0) { | |||
| logger.info("------coupon.update().businessType:"+wxCoupon.getFlowParams().get("businessType")); | |||
| @@ -222,8 +214,17 @@ public class WxCouponController extends BaseController { | |||
| wxCoupon.setPutApplyStatus(EnumRentContractAppStatus.APPLYING.getCode()); | |||
| } | |||
| } | |||
| ResultData result = wxCouponService.saveOrUpdate(wxCoupon); | |||
| ResultData result = null; | |||
| if(EnumCouponStatus.COUPON_STATUS_TAKE_OFFF.getCode().equals(wxCoupon.getStatus())){ | |||
| result = wxCouponService.disable(wxCoupon, wxCoupon.getId()); | |||
| }else{ | |||
| result = wxCouponService.saveOrUpdate(wxCoupon); | |||
| if(wxCoupon.getRemainInventory() != null){ | |||
| redisLock.setCouponStock(wxCoupon.getId(), wxCoupon.getRemainInventory()); | |||
| } | |||
| } | |||
| CouponCacheUtils.removeCouponCache(redisTemplate, wxCoupon.getId()); | |||
| CouponCacheUtils.removeCouponMerchantCache(redisTemplate, wxCoupon.getId()); | |||
| return result; | |||
| @@ -242,16 +243,6 @@ public class WxCouponController extends BaseController { | |||
| } | |||
| wxCoupon.updateTenantInfo(getTenantInfo()); | |||
| if(EnumDelFlag.YES.getCode().equals(wxCoupon.getIsDel())){ | |||
| WxCouponChannel query = new WxCouponChannel(); | |||
| query.updateTenantInfo(wxCoupon); | |||
| query.setCouponId(wxCoupon.getId()); | |||
| query.setStatus(EnumCouponChannelStatus.STATUS_THROW_IN.getCode()); | |||
| if (CollectionUtils.isNotEmpty(wxCouponChannelService.findList(query))) { | |||
| return new ResultData(ResultData.ERROR, "有活动正在上架,请先下架。"); | |||
| } | |||
| } | |||
| WxCoupon coupon = wxCouponService.getById(wxCoupon.getId(),wxCoupon.getTenantId()); | |||
| if (null == coupon) { | |||
| return new ResultData(ResultData.ERROR, "券未查询到。"+wxCoupon.getId()); | |||
| @@ -339,10 +330,8 @@ public class WxCouponController extends BaseController { | |||
| return new ResultData(ErrorCode.COUPON_STOCK_ENDTIME_ERR); | |||
| } | |||
| wxCoupon.setSalePrice(coupon.getSalePrice()); | |||
| if(!EnumCouponType.COUPON_DOUYIN.getCode().equals(wxCoupon.getType()) | |||
| && !wxCouponService.validCouponDate(wxCoupon)) { | |||
| // if(!wxCouponService.validCouponDate(wxCoupon)) { | |||
| return new ResultData(ResultData.ERROR,"券有效使用日期必须在30天以内。"); | |||
| if(!wxCouponService.validCouponDate(wxCoupon)) { | |||
| return new ResultData(ResultData.ERROR,"券有效结束日期必须在30天以内。"); | |||
| } | |||
| wxCoupon.setSalePrice(null); | |||
| @@ -197,7 +197,7 @@ public class WxCUserBasicInfoController extends BaseController { | |||
| updateLevelParam(wxCUserBasicInfo); | |||
| } | |||
| } | |||
| wxCUserBasicInfo.undateFinalTenantId(getTenantInfo()); | |||
| wxCUserBasicInfo.updateFinalTenantId(getTenantInfo()); | |||
| wxCUserBasicInfo.setSortColumns(BaseEntity.SortField.wcubiActiveTime_DESC); | |||
| PageInfo<WxCUserBasicInfo> page = wxCUserBasicInfoService.listAsPage(wxCUserBasicInfo, pageNum, pageSize); | |||
| @@ -172,6 +172,16 @@ public class WxCreditHistoryController extends BaseController { | |||
| return new ResultData(Result.SUCCESS); | |||
| } | |||
| @ApiOperation("积分清零计划 刷新商圈积分") | |||
| @PostMapping("syncClearCredit") | |||
| @SystemControllerLog(description = "刷新商圈积分") | |||
| @TenantIgnore | |||
| public ResultData syncClearCredit() { | |||
| logger.debug("[" + getIpAddr() + "] WxCreditHistoryController::syncClearCredit"); | |||
| wxCreditHistoryService.syncClearCredit(getTenantInfo()); | |||
| return new ResultData(Result.SUCCESS); | |||
| } | |||
| @ApiOperation("门店排行榜") | |||
| @GetMapping("merchantCreditRanking") | |||
| @ApiImplicitParams({ | |||
| @@ -0,0 +1,302 @@ | |||
| ALTER TABLE `mallink`.`wx_coupon_channel_0` | |||
| ADD COLUMN `make_merchant_id` bigint(20) NOT NULL DEFAULT 0 AFTER `coupon_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_channel_1` | |||
| ADD COLUMN `make_merchant_id` bigint(20) NOT NULL DEFAULT 0 AFTER `coupon_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_channel_2` | |||
| ADD COLUMN `make_merchant_id` bigint(20) NOT NULL DEFAULT 0 AFTER `coupon_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_channel_3` | |||
| ADD COLUMN `make_merchant_id` bigint(20) NOT NULL DEFAULT 0 AFTER `coupon_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_channel_4` | |||
| ADD COLUMN `make_merchant_id` bigint(20) NOT NULL DEFAULT 0 AFTER `coupon_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_channel_5` | |||
| ADD COLUMN `make_merchant_id` bigint(20) NOT NULL DEFAULT 0 AFTER `coupon_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_channel_6` | |||
| ADD COLUMN `make_merchant_id` bigint(20) NOT NULL DEFAULT 0 AFTER `coupon_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_channel_7` | |||
| ADD COLUMN `make_merchant_id` bigint(20) NOT NULL DEFAULT 0 AFTER `coupon_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_channel_8` | |||
| ADD COLUMN `make_merchant_id` bigint(20) NOT NULL DEFAULT 0 AFTER `coupon_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_channel_9` | |||
| ADD COLUMN `make_merchant_id` bigint(20) NOT NULL DEFAULT 0 AFTER `coupon_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_channel_10` | |||
| ADD COLUMN `make_merchant_id` bigint(20) NOT NULL DEFAULT 0 AFTER `coupon_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_channel_11` | |||
| ADD COLUMN `make_merchant_id` bigint(20) NOT NULL DEFAULT 0 AFTER `coupon_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_channel_12` | |||
| ADD COLUMN `make_merchant_id` bigint(20) NOT NULL DEFAULT 0 AFTER `coupon_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_channel_13` | |||
| ADD COLUMN `make_merchant_id` bigint(20) NOT NULL DEFAULT 0 AFTER `coupon_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_channel_14` | |||
| ADD COLUMN `make_merchant_id` bigint(20) NOT NULL DEFAULT 0 AFTER `coupon_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_channel_15` | |||
| ADD COLUMN `make_merchant_id` bigint(20) NOT NULL DEFAULT 0 AFTER `coupon_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_channel_16` | |||
| ADD COLUMN `make_merchant_id` bigint(20) NOT NULL DEFAULT 0 AFTER `coupon_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_channel_17` | |||
| ADD COLUMN `make_merchant_id` bigint(20) NOT NULL DEFAULT 0 AFTER `coupon_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_channel_18` | |||
| ADD COLUMN `make_merchant_id` bigint(20) NOT NULL DEFAULT 0 AFTER `coupon_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_channel_19` | |||
| ADD COLUMN `make_merchant_id` bigint(20) NOT NULL DEFAULT 0 AFTER `coupon_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_channel_20` | |||
| ADD COLUMN `make_merchant_id` bigint(20) NOT NULL DEFAULT 0 AFTER `coupon_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_channel_21` | |||
| ADD COLUMN `make_merchant_id` bigint(20) NOT NULL DEFAULT 0 AFTER `coupon_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_channel_22` | |||
| ADD COLUMN `make_merchant_id` bigint(20) NOT NULL DEFAULT 0 AFTER `coupon_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_channel_23` | |||
| ADD COLUMN `make_merchant_id` bigint(20) NOT NULL DEFAULT 0 AFTER `coupon_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_channel_24` | |||
| ADD COLUMN `make_merchant_id` bigint(20) NOT NULL DEFAULT 0 AFTER `coupon_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_channel_25` | |||
| ADD COLUMN `make_merchant_id` bigint(20) NOT NULL DEFAULT 0 AFTER `coupon_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_channel_26` | |||
| ADD COLUMN `make_merchant_id` bigint(20) NOT NULL DEFAULT 0 AFTER `coupon_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_channel_27` | |||
| ADD COLUMN `make_merchant_id` bigint(20) NOT NULL DEFAULT 0 AFTER `coupon_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_channel_28` | |||
| ADD COLUMN `make_merchant_id` bigint(20) NOT NULL DEFAULT 0 AFTER `coupon_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_channel_29` | |||
| ADD COLUMN `make_merchant_id` bigint(20) NOT NULL DEFAULT 0 AFTER `coupon_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_channel_30` | |||
| ADD COLUMN `make_merchant_id` bigint(20) NOT NULL DEFAULT 0 AFTER `coupon_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_channel_31` | |||
| ADD COLUMN `make_merchant_id` bigint(20) NOT NULL DEFAULT 0 AFTER `coupon_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_channel_32` | |||
| ADD COLUMN `make_merchant_id` bigint(20) NOT NULL DEFAULT 0 AFTER `coupon_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_channel_33` | |||
| ADD COLUMN `make_merchant_id` bigint(20) NOT NULL DEFAULT 0 AFTER `coupon_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_channel_34` | |||
| ADD COLUMN `make_merchant_id` bigint(20) NOT NULL DEFAULT 0 AFTER `coupon_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_channel_35` | |||
| ADD COLUMN `make_merchant_id` bigint(20) NOT NULL DEFAULT 0 AFTER `coupon_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_channel_36` | |||
| ADD COLUMN `make_merchant_id` bigint(20) NOT NULL DEFAULT 0 AFTER `coupon_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_channel_37` | |||
| ADD COLUMN `make_merchant_id` bigint(20) NOT NULL DEFAULT 0 AFTER `coupon_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_channel_38` | |||
| ADD COLUMN `make_merchant_id` bigint(20) NOT NULL DEFAULT 0 AFTER `coupon_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_channel_39` | |||
| ADD COLUMN `make_merchant_id` bigint(20) NOT NULL DEFAULT 0 AFTER `coupon_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_channel_40` | |||
| ADD COLUMN `make_merchant_id` bigint(20) NOT NULL DEFAULT 0 AFTER `coupon_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_channel_41` | |||
| ADD COLUMN `make_merchant_id` bigint(20) NOT NULL DEFAULT 0 AFTER `coupon_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_channel_42` | |||
| ADD COLUMN `make_merchant_id` bigint(20) NOT NULL DEFAULT 0 AFTER `coupon_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_channel_43` | |||
| ADD COLUMN `make_merchant_id` bigint(20) NOT NULL DEFAULT 0 AFTER `coupon_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_channel_44` | |||
| ADD COLUMN `make_merchant_id` bigint(20) NOT NULL DEFAULT 0 AFTER `coupon_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_channel_45` | |||
| ADD COLUMN `make_merchant_id` bigint(20) NOT NULL DEFAULT 0 AFTER `coupon_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_channel_46` | |||
| ADD COLUMN `make_merchant_id` bigint(20) NOT NULL DEFAULT 0 AFTER `coupon_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_channel_47` | |||
| ADD COLUMN `make_merchant_id` bigint(20) NOT NULL DEFAULT 0 AFTER `coupon_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_channel_48` | |||
| ADD COLUMN `make_merchant_id` bigint(20) NOT NULL DEFAULT 0 AFTER `coupon_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_channel_49` | |||
| ADD COLUMN `make_merchant_id` bigint(20) NOT NULL DEFAULT 0 AFTER `coupon_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_channel_50` | |||
| ADD COLUMN `make_merchant_id` bigint(20) NOT NULL DEFAULT 0 AFTER `coupon_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_channel_51` | |||
| ADD COLUMN `make_merchant_id` bigint(20) NOT NULL DEFAULT 0 AFTER `coupon_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_channel_52` | |||
| ADD COLUMN `make_merchant_id` bigint(20) NOT NULL DEFAULT 0 AFTER `coupon_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_channel_53` | |||
| ADD COLUMN `make_merchant_id` bigint(20) NOT NULL DEFAULT 0 AFTER `coupon_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_channel_54` | |||
| ADD COLUMN `make_merchant_id` bigint(20) NOT NULL DEFAULT 0 AFTER `coupon_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_channel_55` | |||
| ADD COLUMN `make_merchant_id` bigint(20) NOT NULL DEFAULT 0 AFTER `coupon_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_channel_56` | |||
| ADD COLUMN `make_merchant_id` bigint(20) NOT NULL DEFAULT 0 AFTER `coupon_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_channel_57` | |||
| ADD COLUMN `make_merchant_id` bigint(20) NOT NULL DEFAULT 0 AFTER `coupon_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_channel_58` | |||
| ADD COLUMN `make_merchant_id` bigint(20) NOT NULL DEFAULT 0 AFTER `coupon_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_channel_59` | |||
| ADD COLUMN `make_merchant_id` bigint(20) NOT NULL DEFAULT 0 AFTER `coupon_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_channel_60` | |||
| ADD COLUMN `make_merchant_id` bigint(20) NOT NULL DEFAULT 0 AFTER `coupon_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_channel_61` | |||
| ADD COLUMN `make_merchant_id` bigint(20) NOT NULL DEFAULT 0 AFTER `coupon_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_channel_62` | |||
| ADD COLUMN `make_merchant_id` bigint(20) NOT NULL DEFAULT 0 AFTER `coupon_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_channel_63` | |||
| ADD COLUMN `make_merchant_id` bigint(20) NOT NULL DEFAULT 0 AFTER `coupon_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_channel_64` | |||
| ADD COLUMN `make_merchant_id` bigint(20) NOT NULL DEFAULT 0 AFTER `coupon_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_channel_65` | |||
| ADD COLUMN `make_merchant_id` bigint(20) NOT NULL DEFAULT 0 AFTER `coupon_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_channel_66` | |||
| ADD COLUMN `make_merchant_id` bigint(20) NOT NULL DEFAULT 0 AFTER `coupon_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_channel_67` | |||
| ADD COLUMN `make_merchant_id` bigint(20) NOT NULL DEFAULT 0 AFTER `coupon_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_channel_68` | |||
| ADD COLUMN `make_merchant_id` bigint(20) NOT NULL DEFAULT 0 AFTER `coupon_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_channel_69` | |||
| ADD COLUMN `make_merchant_id` bigint(20) NOT NULL DEFAULT 0 AFTER `coupon_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_channel_70` | |||
| ADD COLUMN `make_merchant_id` bigint(20) NOT NULL DEFAULT 0 AFTER `coupon_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_channel_71` | |||
| ADD COLUMN `make_merchant_id` bigint(20) NOT NULL DEFAULT 0 AFTER `coupon_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_channel_72` | |||
| ADD COLUMN `make_merchant_id` bigint(20) NOT NULL DEFAULT 0 AFTER `coupon_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_channel_73` | |||
| ADD COLUMN `make_merchant_id` bigint(20) NOT NULL DEFAULT 0 AFTER `coupon_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_channel_74` | |||
| ADD COLUMN `make_merchant_id` bigint(20) NOT NULL DEFAULT 0 AFTER `coupon_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_channel_75` | |||
| ADD COLUMN `make_merchant_id` bigint(20) NOT NULL DEFAULT 0 AFTER `coupon_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_channel_76` | |||
| ADD COLUMN `make_merchant_id` bigint(20) NOT NULL DEFAULT 0 AFTER `coupon_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_channel_77` | |||
| ADD COLUMN `make_merchant_id` bigint(20) NOT NULL DEFAULT 0 AFTER `coupon_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_channel_78` | |||
| ADD COLUMN `make_merchant_id` bigint(20) NOT NULL DEFAULT 0 AFTER `coupon_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_channel_79` | |||
| ADD COLUMN `make_merchant_id` bigint(20) NOT NULL DEFAULT 0 AFTER `coupon_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_channel_80` | |||
| ADD COLUMN `make_merchant_id` bigint(20) NOT NULL DEFAULT 0 AFTER `coupon_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_channel_81` | |||
| ADD COLUMN `make_merchant_id` bigint(20) NOT NULL DEFAULT 0 AFTER `coupon_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_channel_82` | |||
| ADD COLUMN `make_merchant_id` bigint(20) NOT NULL DEFAULT 0 AFTER `coupon_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_channel_83` | |||
| ADD COLUMN `make_merchant_id` bigint(20) NOT NULL DEFAULT 0 AFTER `coupon_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_channel_84` | |||
| ADD COLUMN `make_merchant_id` bigint(20) NOT NULL DEFAULT 0 AFTER `coupon_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_channel_85` | |||
| ADD COLUMN `make_merchant_id` bigint(20) NOT NULL DEFAULT 0 AFTER `coupon_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_channel_86` | |||
| ADD COLUMN `make_merchant_id` bigint(20) NOT NULL DEFAULT 0 AFTER `coupon_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_channel_87` | |||
| ADD COLUMN `make_merchant_id` bigint(20) NOT NULL DEFAULT 0 AFTER `coupon_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_channel_88` | |||
| ADD COLUMN `make_merchant_id` bigint(20) NOT NULL DEFAULT 0 AFTER `coupon_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_channel_89` | |||
| ADD COLUMN `make_merchant_id` bigint(20) NOT NULL DEFAULT 0 AFTER `coupon_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_channel_90` | |||
| ADD COLUMN `make_merchant_id` bigint(20) NOT NULL DEFAULT 0 AFTER `coupon_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_channel_91` | |||
| ADD COLUMN `make_merchant_id` bigint(20) NOT NULL DEFAULT 0 AFTER `coupon_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_channel_92` | |||
| ADD COLUMN `make_merchant_id` bigint(20) NOT NULL DEFAULT 0 AFTER `coupon_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_channel_93` | |||
| ADD COLUMN `make_merchant_id` bigint(20) NOT NULL DEFAULT 0 AFTER `coupon_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_channel_94` | |||
| ADD COLUMN `make_merchant_id` bigint(20) NOT NULL DEFAULT 0 AFTER `coupon_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_channel_95` | |||
| ADD COLUMN `make_merchant_id` bigint(20) NOT NULL DEFAULT 0 AFTER `coupon_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_channel_96` | |||
| ADD COLUMN `make_merchant_id` bigint(20) NOT NULL DEFAULT 0 AFTER `coupon_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_channel_97` | |||
| ADD COLUMN `make_merchant_id` bigint(20) NOT NULL DEFAULT 0 AFTER `coupon_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_channel_98` | |||
| ADD COLUMN `make_merchant_id` bigint(20) NOT NULL DEFAULT 0 AFTER `coupon_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_channel_99` | |||
| ADD COLUMN `make_merchant_id` bigint(20) NOT NULL DEFAULT 0 AFTER `coupon_id`; | |||
| update `wx_coupon_channel_0` wcc left join wx_coupon_0 wc on wc.id = wcc.coupon_id set wcc.`make_merchant_id` = wc.`make_merchant_id` where wc.`make_merchant_id` is not null and wc.`make_merchant_id` != 0; | |||
| update `wx_coupon_channel_1` wcc left join wx_coupon_1 wc on wc.id = wcc.coupon_id set wcc.`make_merchant_id` = wc.`make_merchant_id` where wc.`make_merchant_id` is not null and wc.`make_merchant_id` != 0; | |||
| update `wx_coupon_channel_2` wcc left join wx_coupon_2 wc on wc.id = wcc.coupon_id set wcc.`make_merchant_id` = wc.`make_merchant_id` where wc.`make_merchant_id` is not null and wc.`make_merchant_id` != 0; | |||
| update `wx_coupon_channel_3` wcc left join wx_coupon_3 wc on wc.id = wcc.coupon_id set wcc.`make_merchant_id` = wc.`make_merchant_id` where wc.`make_merchant_id` is not null and wc.`make_merchant_id` != 0; | |||
| update `wx_coupon_channel_4` wcc left join wx_coupon_4 wc on wc.id = wcc.coupon_id set wcc.`make_merchant_id` = wc.`make_merchant_id` where wc.`make_merchant_id` is not null and wc.`make_merchant_id` != 0; | |||
| update `wx_coupon_channel_5` wcc left join wx_coupon_5 wc on wc.id = wcc.coupon_id set wcc.`make_merchant_id` = wc.`make_merchant_id` where wc.`make_merchant_id` is not null and wc.`make_merchant_id` != 0; | |||
| update `wx_coupon_channel_6` wcc left join wx_coupon_6 wc on wc.id = wcc.coupon_id set wcc.`make_merchant_id` = wc.`make_merchant_id` where wc.`make_merchant_id` is not null and wc.`make_merchant_id` != 0; | |||
| update `wx_coupon_channel_7` wcc left join wx_coupon_7 wc on wc.id = wcc.coupon_id set wcc.`make_merchant_id` = wc.`make_merchant_id` where wc.`make_merchant_id` is not null and wc.`make_merchant_id` != 0; | |||
| update `wx_coupon_channel_8` wcc left join wx_coupon_8 wc on wc.id = wcc.coupon_id set wcc.`make_merchant_id` = wc.`make_merchant_id` where wc.`make_merchant_id` is not null and wc.`make_merchant_id` != 0; | |||
| update `wx_coupon_channel_9` wcc left join wx_coupon_9 wc on wc.id = wcc.coupon_id set wcc.`make_merchant_id` = wc.`make_merchant_id` where wc.`make_merchant_id` is not null and wc.`make_merchant_id` != 0; | |||
| update `wx_coupon_channel_10` wcc left join wx_coupon_10 wc on wc.id = wcc.coupon_id set wcc.`make_merchant_id` = wc.`make_merchant_id` where wc.`make_merchant_id` is not null and wc.`make_merchant_id` != 0; | |||
| update `wx_coupon_channel_11` wcc left join wx_coupon_11 wc on wc.id = wcc.coupon_id set wcc.`make_merchant_id` = wc.`make_merchant_id` where wc.`make_merchant_id` is not null and wc.`make_merchant_id` != 0; | |||
| update `wx_coupon_channel_12` wcc left join wx_coupon_12 wc on wc.id = wcc.coupon_id set wcc.`make_merchant_id` = wc.`make_merchant_id` where wc.`make_merchant_id` is not null and wc.`make_merchant_id` != 0; | |||
| update `wx_coupon_channel_13` wcc left join wx_coupon_13 wc on wc.id = wcc.coupon_id set wcc.`make_merchant_id` = wc.`make_merchant_id` where wc.`make_merchant_id` is not null and wc.`make_merchant_id` != 0; | |||
| update `wx_coupon_channel_14` wcc left join wx_coupon_14 wc on wc.id = wcc.coupon_id set wcc.`make_merchant_id` = wc.`make_merchant_id` where wc.`make_merchant_id` is not null and wc.`make_merchant_id` != 0; | |||
| update `wx_coupon_channel_15` wcc left join wx_coupon_15 wc on wc.id = wcc.coupon_id set wcc.`make_merchant_id` = wc.`make_merchant_id` where wc.`make_merchant_id` is not null and wc.`make_merchant_id` != 0; | |||
| update `wx_coupon_channel_16` wcc left join wx_coupon_16 wc on wc.id = wcc.coupon_id set wcc.`make_merchant_id` = wc.`make_merchant_id` where wc.`make_merchant_id` is not null and wc.`make_merchant_id` != 0; | |||
| update `wx_coupon_channel_17` wcc left join wx_coupon_17 wc on wc.id = wcc.coupon_id set wcc.`make_merchant_id` = wc.`make_merchant_id` where wc.`make_merchant_id` is not null and wc.`make_merchant_id` != 0; | |||
| update `wx_coupon_channel_18` wcc left join wx_coupon_18 wc on wc.id = wcc.coupon_id set wcc.`make_merchant_id` = wc.`make_merchant_id` where wc.`make_merchant_id` is not null and wc.`make_merchant_id` != 0; | |||
| update `wx_coupon_channel_19` wcc left join wx_coupon_19 wc on wc.id = wcc.coupon_id set wcc.`make_merchant_id` = wc.`make_merchant_id` where wc.`make_merchant_id` is not null and wc.`make_merchant_id` != 0; | |||
| update `wx_coupon_channel_20` wcc left join wx_coupon_20 wc on wc.id = wcc.coupon_id set wcc.`make_merchant_id` = wc.`make_merchant_id` where wc.`make_merchant_id` is not null and wc.`make_merchant_id` != 0; | |||
| update `wx_coupon_channel_21` wcc left join wx_coupon_21 wc on wc.id = wcc.coupon_id set wcc.`make_merchant_id` = wc.`make_merchant_id` where wc.`make_merchant_id` is not null and wc.`make_merchant_id` != 0; | |||
| update `wx_coupon_channel_22` wcc left join wx_coupon_22 wc on wc.id = wcc.coupon_id set wcc.`make_merchant_id` = wc.`make_merchant_id` where wc.`make_merchant_id` is not null and wc.`make_merchant_id` != 0; | |||
| update `wx_coupon_channel_23` wcc left join wx_coupon_23 wc on wc.id = wcc.coupon_id set wcc.`make_merchant_id` = wc.`make_merchant_id` where wc.`make_merchant_id` is not null and wc.`make_merchant_id` != 0; | |||
| update `wx_coupon_channel_24` wcc left join wx_coupon_24 wc on wc.id = wcc.coupon_id set wcc.`make_merchant_id` = wc.`make_merchant_id` where wc.`make_merchant_id` is not null and wc.`make_merchant_id` != 0; | |||
| update `wx_coupon_channel_25` wcc left join wx_coupon_25 wc on wc.id = wcc.coupon_id set wcc.`make_merchant_id` = wc.`make_merchant_id` where wc.`make_merchant_id` is not null and wc.`make_merchant_id` != 0; | |||
| update `wx_coupon_channel_26` wcc left join wx_coupon_26 wc on wc.id = wcc.coupon_id set wcc.`make_merchant_id` = wc.`make_merchant_id` where wc.`make_merchant_id` is not null and wc.`make_merchant_id` != 0; | |||
| update `wx_coupon_channel_27` wcc left join wx_coupon_27 wc on wc.id = wcc.coupon_id set wcc.`make_merchant_id` = wc.`make_merchant_id` where wc.`make_merchant_id` is not null and wc.`make_merchant_id` != 0; | |||
| update `wx_coupon_channel_28` wcc left join wx_coupon_28 wc on wc.id = wcc.coupon_id set wcc.`make_merchant_id` = wc.`make_merchant_id` where wc.`make_merchant_id` is not null and wc.`make_merchant_id` != 0; | |||
| update `wx_coupon_channel_29` wcc left join wx_coupon_29 wc on wc.id = wcc.coupon_id set wcc.`make_merchant_id` = wc.`make_merchant_id` where wc.`make_merchant_id` is not null and wc.`make_merchant_id` != 0; | |||
| update `wx_coupon_channel_30` wcc left join wx_coupon_30 wc on wc.id = wcc.coupon_id set wcc.`make_merchant_id` = wc.`make_merchant_id` where wc.`make_merchant_id` is not null and wc.`make_merchant_id` != 0; | |||
| update `wx_coupon_channel_31` wcc left join wx_coupon_31 wc on wc.id = wcc.coupon_id set wcc.`make_merchant_id` = wc.`make_merchant_id` where wc.`make_merchant_id` is not null and wc.`make_merchant_id` != 0; | |||
| update `wx_coupon_channel_32` wcc left join wx_coupon_32 wc on wc.id = wcc.coupon_id set wcc.`make_merchant_id` = wc.`make_merchant_id` where wc.`make_merchant_id` is not null and wc.`make_merchant_id` != 0; | |||
| update `wx_coupon_channel_33` wcc left join wx_coupon_33 wc on wc.id = wcc.coupon_id set wcc.`make_merchant_id` = wc.`make_merchant_id` where wc.`make_merchant_id` is not null and wc.`make_merchant_id` != 0; | |||
| update `wx_coupon_channel_34` wcc left join wx_coupon_34 wc on wc.id = wcc.coupon_id set wcc.`make_merchant_id` = wc.`make_merchant_id` where wc.`make_merchant_id` is not null and wc.`make_merchant_id` != 0; | |||
| update `wx_coupon_channel_35` wcc left join wx_coupon_35 wc on wc.id = wcc.coupon_id set wcc.`make_merchant_id` = wc.`make_merchant_id` where wc.`make_merchant_id` is not null and wc.`make_merchant_id` != 0; | |||
| update `wx_coupon_channel_36` wcc left join wx_coupon_36 wc on wc.id = wcc.coupon_id set wcc.`make_merchant_id` = wc.`make_merchant_id` where wc.`make_merchant_id` is not null and wc.`make_merchant_id` != 0; | |||
| update `wx_coupon_channel_37` wcc left join wx_coupon_37 wc on wc.id = wcc.coupon_id set wcc.`make_merchant_id` = wc.`make_merchant_id` where wc.`make_merchant_id` is not null and wc.`make_merchant_id` != 0; | |||
| update `wx_coupon_channel_38` wcc left join wx_coupon_38 wc on wc.id = wcc.coupon_id set wcc.`make_merchant_id` = wc.`make_merchant_id` where wc.`make_merchant_id` is not null and wc.`make_merchant_id` != 0; | |||
| update `wx_coupon_channel_39` wcc left join wx_coupon_39 wc on wc.id = wcc.coupon_id set wcc.`make_merchant_id` = wc.`make_merchant_id` where wc.`make_merchant_id` is not null and wc.`make_merchant_id` != 0; | |||
| update `wx_coupon_channel_40` wcc left join wx_coupon_40 wc on wc.id = wcc.coupon_id set wcc.`make_merchant_id` = wc.`make_merchant_id` where wc.`make_merchant_id` is not null and wc.`make_merchant_id` != 0; | |||
| update `wx_coupon_channel_41` wcc left join wx_coupon_41 wc on wc.id = wcc.coupon_id set wcc.`make_merchant_id` = wc.`make_merchant_id` where wc.`make_merchant_id` is not null and wc.`make_merchant_id` != 0; | |||
| update `wx_coupon_channel_42` wcc left join wx_coupon_42 wc on wc.id = wcc.coupon_id set wcc.`make_merchant_id` = wc.`make_merchant_id` where wc.`make_merchant_id` is not null and wc.`make_merchant_id` != 0; | |||
| update `wx_coupon_channel_43` wcc left join wx_coupon_43 wc on wc.id = wcc.coupon_id set wcc.`make_merchant_id` = wc.`make_merchant_id` where wc.`make_merchant_id` is not null and wc.`make_merchant_id` != 0; | |||
| update `wx_coupon_channel_44` wcc left join wx_coupon_44 wc on wc.id = wcc.coupon_id set wcc.`make_merchant_id` = wc.`make_merchant_id` where wc.`make_merchant_id` is not null and wc.`make_merchant_id` != 0; | |||
| update `wx_coupon_channel_45` wcc left join wx_coupon_45 wc on wc.id = wcc.coupon_id set wcc.`make_merchant_id` = wc.`make_merchant_id` where wc.`make_merchant_id` is not null and wc.`make_merchant_id` != 0; | |||
| update `wx_coupon_channel_46` wcc left join wx_coupon_46 wc on wc.id = wcc.coupon_id set wcc.`make_merchant_id` = wc.`make_merchant_id` where wc.`make_merchant_id` is not null and wc.`make_merchant_id` != 0; | |||
| update `wx_coupon_channel_47` wcc left join wx_coupon_47 wc on wc.id = wcc.coupon_id set wcc.`make_merchant_id` = wc.`make_merchant_id` where wc.`make_merchant_id` is not null and wc.`make_merchant_id` != 0; | |||
| update `wx_coupon_channel_48` wcc left join wx_coupon_48 wc on wc.id = wcc.coupon_id set wcc.`make_merchant_id` = wc.`make_merchant_id` where wc.`make_merchant_id` is not null and wc.`make_merchant_id` != 0; | |||
| update `wx_coupon_channel_49` wcc left join wx_coupon_49 wc on wc.id = wcc.coupon_id set wcc.`make_merchant_id` = wc.`make_merchant_id` where wc.`make_merchant_id` is not null and wc.`make_merchant_id` != 0; | |||
| update `wx_coupon_channel_50` wcc left join wx_coupon_50 wc on wc.id = wcc.coupon_id set wcc.`make_merchant_id` = wc.`make_merchant_id` where wc.`make_merchant_id` is not null and wc.`make_merchant_id` != 0; | |||
| update `wx_coupon_channel_51` wcc left join wx_coupon_51 wc on wc.id = wcc.coupon_id set wcc.`make_merchant_id` = wc.`make_merchant_id` where wc.`make_merchant_id` is not null and wc.`make_merchant_id` != 0; | |||
| update `wx_coupon_channel_52` wcc left join wx_coupon_52 wc on wc.id = wcc.coupon_id set wcc.`make_merchant_id` = wc.`make_merchant_id` where wc.`make_merchant_id` is not null and wc.`make_merchant_id` != 0; | |||
| update `wx_coupon_channel_53` wcc left join wx_coupon_53 wc on wc.id = wcc.coupon_id set wcc.`make_merchant_id` = wc.`make_merchant_id` where wc.`make_merchant_id` is not null and wc.`make_merchant_id` != 0; | |||
| update `wx_coupon_channel_54` wcc left join wx_coupon_54 wc on wc.id = wcc.coupon_id set wcc.`make_merchant_id` = wc.`make_merchant_id` where wc.`make_merchant_id` is not null and wc.`make_merchant_id` != 0; | |||
| update `wx_coupon_channel_55` wcc left join wx_coupon_55 wc on wc.id = wcc.coupon_id set wcc.`make_merchant_id` = wc.`make_merchant_id` where wc.`make_merchant_id` is not null and wc.`make_merchant_id` != 0; | |||
| update `wx_coupon_channel_56` wcc left join wx_coupon_56 wc on wc.id = wcc.coupon_id set wcc.`make_merchant_id` = wc.`make_merchant_id` where wc.`make_merchant_id` is not null and wc.`make_merchant_id` != 0; | |||
| update `wx_coupon_channel_57` wcc left join wx_coupon_57 wc on wc.id = wcc.coupon_id set wcc.`make_merchant_id` = wc.`make_merchant_id` where wc.`make_merchant_id` is not null and wc.`make_merchant_id` != 0; | |||
| update `wx_coupon_channel_58` wcc left join wx_coupon_58 wc on wc.id = wcc.coupon_id set wcc.`make_merchant_id` = wc.`make_merchant_id` where wc.`make_merchant_id` is not null and wc.`make_merchant_id` != 0; | |||
| update `wx_coupon_channel_59` wcc left join wx_coupon_59 wc on wc.id = wcc.coupon_id set wcc.`make_merchant_id` = wc.`make_merchant_id` where wc.`make_merchant_id` is not null and wc.`make_merchant_id` != 0; | |||
| update `wx_coupon_channel_60` wcc left join wx_coupon_60 wc on wc.id = wcc.coupon_id set wcc.`make_merchant_id` = wc.`make_merchant_id` where wc.`make_merchant_id` is not null and wc.`make_merchant_id` != 0; | |||
| update `wx_coupon_channel_61` wcc left join wx_coupon_61 wc on wc.id = wcc.coupon_id set wcc.`make_merchant_id` = wc.`make_merchant_id` where wc.`make_merchant_id` is not null and wc.`make_merchant_id` != 0; | |||
| update `wx_coupon_channel_62` wcc left join wx_coupon_62 wc on wc.id = wcc.coupon_id set wcc.`make_merchant_id` = wc.`make_merchant_id` where wc.`make_merchant_id` is not null and wc.`make_merchant_id` != 0; | |||
| update `wx_coupon_channel_63` wcc left join wx_coupon_63 wc on wc.id = wcc.coupon_id set wcc.`make_merchant_id` = wc.`make_merchant_id` where wc.`make_merchant_id` is not null and wc.`make_merchant_id` != 0; | |||
| update `wx_coupon_channel_64` wcc left join wx_coupon_64 wc on wc.id = wcc.coupon_id set wcc.`make_merchant_id` = wc.`make_merchant_id` where wc.`make_merchant_id` is not null and wc.`make_merchant_id` != 0; | |||
| update `wx_coupon_channel_65` wcc left join wx_coupon_65 wc on wc.id = wcc.coupon_id set wcc.`make_merchant_id` = wc.`make_merchant_id` where wc.`make_merchant_id` is not null and wc.`make_merchant_id` != 0; | |||
| update `wx_coupon_channel_66` wcc left join wx_coupon_66 wc on wc.id = wcc.coupon_id set wcc.`make_merchant_id` = wc.`make_merchant_id` where wc.`make_merchant_id` is not null and wc.`make_merchant_id` != 0; | |||
| update `wx_coupon_channel_67` wcc left join wx_coupon_67 wc on wc.id = wcc.coupon_id set wcc.`make_merchant_id` = wc.`make_merchant_id` where wc.`make_merchant_id` is not null and wc.`make_merchant_id` != 0; | |||
| update `wx_coupon_channel_68` wcc left join wx_coupon_68 wc on wc.id = wcc.coupon_id set wcc.`make_merchant_id` = wc.`make_merchant_id` where wc.`make_merchant_id` is not null and wc.`make_merchant_id` != 0; | |||
| update `wx_coupon_channel_69` wcc left join wx_coupon_69 wc on wc.id = wcc.coupon_id set wcc.`make_merchant_id` = wc.`make_merchant_id` where wc.`make_merchant_id` is not null and wc.`make_merchant_id` != 0; | |||
| update `wx_coupon_channel_70` wcc left join wx_coupon_70 wc on wc.id = wcc.coupon_id set wcc.`make_merchant_id` = wc.`make_merchant_id` where wc.`make_merchant_id` is not null and wc.`make_merchant_id` != 0; | |||
| update `wx_coupon_channel_71` wcc left join wx_coupon_71 wc on wc.id = wcc.coupon_id set wcc.`make_merchant_id` = wc.`make_merchant_id` where wc.`make_merchant_id` is not null and wc.`make_merchant_id` != 0; | |||
| update `wx_coupon_channel_72` wcc left join wx_coupon_72 wc on wc.id = wcc.coupon_id set wcc.`make_merchant_id` = wc.`make_merchant_id` where wc.`make_merchant_id` is not null and wc.`make_merchant_id` != 0; | |||
| update `wx_coupon_channel_73` wcc left join wx_coupon_73 wc on wc.id = wcc.coupon_id set wcc.`make_merchant_id` = wc.`make_merchant_id` where wc.`make_merchant_id` is not null and wc.`make_merchant_id` != 0; | |||
| update `wx_coupon_channel_74` wcc left join wx_coupon_74 wc on wc.id = wcc.coupon_id set wcc.`make_merchant_id` = wc.`make_merchant_id` where wc.`make_merchant_id` is not null and wc.`make_merchant_id` != 0; | |||
| update `wx_coupon_channel_75` wcc left join wx_coupon_75 wc on wc.id = wcc.coupon_id set wcc.`make_merchant_id` = wc.`make_merchant_id` where wc.`make_merchant_id` is not null and wc.`make_merchant_id` != 0; | |||
| update `wx_coupon_channel_76` wcc left join wx_coupon_76 wc on wc.id = wcc.coupon_id set wcc.`make_merchant_id` = wc.`make_merchant_id` where wc.`make_merchant_id` is not null and wc.`make_merchant_id` != 0; | |||
| update `wx_coupon_channel_77` wcc left join wx_coupon_77 wc on wc.id = wcc.coupon_id set wcc.`make_merchant_id` = wc.`make_merchant_id` where wc.`make_merchant_id` is not null and wc.`make_merchant_id` != 0; | |||
| update `wx_coupon_channel_78` wcc left join wx_coupon_78 wc on wc.id = wcc.coupon_id set wcc.`make_merchant_id` = wc.`make_merchant_id` where wc.`make_merchant_id` is not null and wc.`make_merchant_id` != 0; | |||
| update `wx_coupon_channel_79` wcc left join wx_coupon_79 wc on wc.id = wcc.coupon_id set wcc.`make_merchant_id` = wc.`make_merchant_id` where wc.`make_merchant_id` is not null and wc.`make_merchant_id` != 0; | |||
| update `wx_coupon_channel_80` wcc left join wx_coupon_80 wc on wc.id = wcc.coupon_id set wcc.`make_merchant_id` = wc.`make_merchant_id` where wc.`make_merchant_id` is not null and wc.`make_merchant_id` != 0; | |||
| update `wx_coupon_channel_81` wcc left join wx_coupon_81 wc on wc.id = wcc.coupon_id set wcc.`make_merchant_id` = wc.`make_merchant_id` where wc.`make_merchant_id` is not null and wc.`make_merchant_id` != 0; | |||
| update `wx_coupon_channel_82` wcc left join wx_coupon_82 wc on wc.id = wcc.coupon_id set wcc.`make_merchant_id` = wc.`make_merchant_id` where wc.`make_merchant_id` is not null and wc.`make_merchant_id` != 0; | |||
| update `wx_coupon_channel_83` wcc left join wx_coupon_83 wc on wc.id = wcc.coupon_id set wcc.`make_merchant_id` = wc.`make_merchant_id` where wc.`make_merchant_id` is not null and wc.`make_merchant_id` != 0; | |||
| update `wx_coupon_channel_84` wcc left join wx_coupon_84 wc on wc.id = wcc.coupon_id set wcc.`make_merchant_id` = wc.`make_merchant_id` where wc.`make_merchant_id` is not null and wc.`make_merchant_id` != 0; | |||
| update `wx_coupon_channel_85` wcc left join wx_coupon_85 wc on wc.id = wcc.coupon_id set wcc.`make_merchant_id` = wc.`make_merchant_id` where wc.`make_merchant_id` is not null and wc.`make_merchant_id` != 0; | |||
| update `wx_coupon_channel_86` wcc left join wx_coupon_86 wc on wc.id = wcc.coupon_id set wcc.`make_merchant_id` = wc.`make_merchant_id` where wc.`make_merchant_id` is not null and wc.`make_merchant_id` != 0; | |||
| update `wx_coupon_channel_87` wcc left join wx_coupon_87 wc on wc.id = wcc.coupon_id set wcc.`make_merchant_id` = wc.`make_merchant_id` where wc.`make_merchant_id` is not null and wc.`make_merchant_id` != 0; | |||
| update `wx_coupon_channel_88` wcc left join wx_coupon_88 wc on wc.id = wcc.coupon_id set wcc.`make_merchant_id` = wc.`make_merchant_id` where wc.`make_merchant_id` is not null and wc.`make_merchant_id` != 0; | |||
| update `wx_coupon_channel_89` wcc left join wx_coupon_89 wc on wc.id = wcc.coupon_id set wcc.`make_merchant_id` = wc.`make_merchant_id` where wc.`make_merchant_id` is not null and wc.`make_merchant_id` != 0; | |||
| update `wx_coupon_channel_90` wcc left join wx_coupon_90 wc on wc.id = wcc.coupon_id set wcc.`make_merchant_id` = wc.`make_merchant_id` where wc.`make_merchant_id` is not null and wc.`make_merchant_id` != 0; | |||
| update `wx_coupon_channel_91` wcc left join wx_coupon_91 wc on wc.id = wcc.coupon_id set wcc.`make_merchant_id` = wc.`make_merchant_id` where wc.`make_merchant_id` is not null and wc.`make_merchant_id` != 0; | |||
| update `wx_coupon_channel_92` wcc left join wx_coupon_92 wc on wc.id = wcc.coupon_id set wcc.`make_merchant_id` = wc.`make_merchant_id` where wc.`make_merchant_id` is not null and wc.`make_merchant_id` != 0; | |||
| update `wx_coupon_channel_93` wcc left join wx_coupon_93 wc on wc.id = wcc.coupon_id set wcc.`make_merchant_id` = wc.`make_merchant_id` where wc.`make_merchant_id` is not null and wc.`make_merchant_id` != 0; | |||
| update `wx_coupon_channel_94` wcc left join wx_coupon_94 wc on wc.id = wcc.coupon_id set wcc.`make_merchant_id` = wc.`make_merchant_id` where wc.`make_merchant_id` is not null and wc.`make_merchant_id` != 0; | |||
| update `wx_coupon_channel_95` wcc left join wx_coupon_95 wc on wc.id = wcc.coupon_id set wcc.`make_merchant_id` = wc.`make_merchant_id` where wc.`make_merchant_id` is not null and wc.`make_merchant_id` != 0; | |||
| update `wx_coupon_channel_96` wcc left join wx_coupon_96 wc on wc.id = wcc.coupon_id set wcc.`make_merchant_id` = wc.`make_merchant_id` where wc.`make_merchant_id` is not null and wc.`make_merchant_id` != 0; | |||
| update `wx_coupon_channel_97` wcc left join wx_coupon_97 wc on wc.id = wcc.coupon_id set wcc.`make_merchant_id` = wc.`make_merchant_id` where wc.`make_merchant_id` is not null and wc.`make_merchant_id` != 0; | |||
| update `wx_coupon_channel_98` wcc left join wx_coupon_98 wc on wc.id = wcc.coupon_id set wcc.`make_merchant_id` = wc.`make_merchant_id` where wc.`make_merchant_id` is not null and wc.`make_merchant_id` != 0; | |||
| update `wx_coupon_channel_99` wcc left join wx_coupon_99 wc on wc.id = wcc.coupon_id set wcc.`make_merchant_id` = wc.`make_merchant_id` where wc.`make_merchant_id` is not null and wc.`make_merchant_id` != 0; | |||
| @@ -0,0 +1,300 @@ | |||
| ALTER TABLE `mallink`.`wx_order_0` | |||
| ADD COLUMN `product_name` varchar(255) AFTER `product_id`, | |||
| ADD COLUMN `make_merchant_id` bigint(20) DEFAULT 0 AFTER `pay_version`; | |||
| ALTER TABLE `mallink`.`wx_order_1` | |||
| ADD COLUMN `product_name` varchar(255) AFTER `product_id`, | |||
| ADD COLUMN `make_merchant_id` bigint(20) DEFAULT 0 AFTER `pay_version`; | |||
| ALTER TABLE `mallink`.`wx_order_2` | |||
| ADD COLUMN `product_name` varchar(255) AFTER `product_id`, | |||
| ADD COLUMN `make_merchant_id` bigint(20) DEFAULT 0 AFTER `pay_version`; | |||
| ALTER TABLE `mallink`.`wx_order_3` | |||
| ADD COLUMN `product_name` varchar(255) AFTER `product_id`, | |||
| ADD COLUMN `make_merchant_id` bigint(20) DEFAULT 0 AFTER `pay_version`; | |||
| ALTER TABLE `mallink`.`wx_order_4` | |||
| ADD COLUMN `product_name` varchar(255) AFTER `product_id`, | |||
| ADD COLUMN `make_merchant_id` bigint(20) DEFAULT 0 AFTER `pay_version`; | |||
| ALTER TABLE `mallink`.`wx_order_5` | |||
| ADD COLUMN `product_name` varchar(255) AFTER `product_id`, | |||
| ADD COLUMN `make_merchant_id` bigint(20) DEFAULT 0 AFTER `pay_version`; | |||
| ALTER TABLE `mallink`.`wx_order_6` | |||
| ADD COLUMN `product_name` varchar(255) AFTER `product_id`, | |||
| ADD COLUMN `make_merchant_id` bigint(20) DEFAULT 0 AFTER `pay_version`; | |||
| ALTER TABLE `mallink`.`wx_order_7` | |||
| ADD COLUMN `product_name` varchar(255) AFTER `product_id`, | |||
| ADD COLUMN `make_merchant_id` bigint(20) DEFAULT 0 AFTER `pay_version`; | |||
| ALTER TABLE `mallink`.`wx_order_8` | |||
| ADD COLUMN `product_name` varchar(255) AFTER `product_id`, | |||
| ADD COLUMN `make_merchant_id` bigint(20) DEFAULT 0 AFTER `pay_version`; | |||
| ALTER TABLE `mallink`.`wx_order_9` | |||
| ADD COLUMN `product_name` varchar(255) AFTER `product_id`, | |||
| ADD COLUMN `make_merchant_id` bigint(20) DEFAULT 0 AFTER `pay_version`; | |||
| ALTER TABLE `mallink`.`wx_order_10` | |||
| ADD COLUMN `product_name` varchar(255) AFTER `product_id`, | |||
| ADD COLUMN `make_merchant_id` bigint(20) DEFAULT 0 AFTER `pay_version`; | |||
| ALTER TABLE `mallink`.`wx_order_11` | |||
| ADD COLUMN `product_name` varchar(255) AFTER `product_id`, | |||
| ADD COLUMN `make_merchant_id` bigint(20) DEFAULT 0 AFTER `pay_version`; | |||
| ALTER TABLE `mallink`.`wx_order_12` | |||
| ADD COLUMN `product_name` varchar(255) AFTER `product_id`, | |||
| ADD COLUMN `make_merchant_id` bigint(20) DEFAULT 0 AFTER `pay_version`; | |||
| ALTER TABLE `mallink`.`wx_order_13` | |||
| ADD COLUMN `product_name` varchar(255) AFTER `product_id`, | |||
| ADD COLUMN `make_merchant_id` bigint(20) DEFAULT 0 AFTER `pay_version`; | |||
| ALTER TABLE `mallink`.`wx_order_14` | |||
| ADD COLUMN `product_name` varchar(255) AFTER `product_id`, | |||
| ADD COLUMN `make_merchant_id` bigint(20) DEFAULT 0 AFTER `pay_version`; | |||
| ALTER TABLE `mallink`.`wx_order_15` | |||
| ADD COLUMN `product_name` varchar(255) AFTER `product_id`, | |||
| ADD COLUMN `make_merchant_id` bigint(20) DEFAULT 0 AFTER `pay_version`; | |||
| ALTER TABLE `mallink`.`wx_order_16` | |||
| ADD COLUMN `product_name` varchar(255) AFTER `product_id`, | |||
| ADD COLUMN `make_merchant_id` bigint(20) DEFAULT 0 AFTER `pay_version`; | |||
| ALTER TABLE `mallink`.`wx_order_17` | |||
| ADD COLUMN `product_name` varchar(255) AFTER `product_id`, | |||
| ADD COLUMN `make_merchant_id` bigint(20) DEFAULT 0 AFTER `pay_version`; | |||
| ALTER TABLE `mallink`.`wx_order_18` | |||
| ADD COLUMN `product_name` varchar(255) AFTER `product_id`, | |||
| ADD COLUMN `make_merchant_id` bigint(20) DEFAULT 0 AFTER `pay_version`; | |||
| ALTER TABLE `mallink`.`wx_order_19` | |||
| ADD COLUMN `product_name` varchar(255) AFTER `product_id`, | |||
| ADD COLUMN `make_merchant_id` bigint(20) DEFAULT 0 AFTER `pay_version`; | |||
| ALTER TABLE `mallink`.`wx_order_20` | |||
| ADD COLUMN `product_name` varchar(255) AFTER `product_id`, | |||
| ADD COLUMN `make_merchant_id` bigint(20) DEFAULT 0 AFTER `pay_version`; | |||
| ALTER TABLE `mallink`.`wx_order_21` | |||
| ADD COLUMN `product_name` varchar(255) AFTER `product_id`, | |||
| ADD COLUMN `make_merchant_id` bigint(20) DEFAULT 0 AFTER `pay_version`; | |||
| ALTER TABLE `mallink`.`wx_order_22` | |||
| ADD COLUMN `product_name` varchar(255) AFTER `product_id`, | |||
| ADD COLUMN `make_merchant_id` bigint(20) DEFAULT 0 AFTER `pay_version`; | |||
| ALTER TABLE `mallink`.`wx_order_23` | |||
| ADD COLUMN `product_name` varchar(255) AFTER `product_id`, | |||
| ADD COLUMN `make_merchant_id` bigint(20) DEFAULT 0 AFTER `pay_version`; | |||
| ALTER TABLE `mallink`.`wx_order_24` | |||
| ADD COLUMN `product_name` varchar(255) AFTER `product_id`, | |||
| ADD COLUMN `make_merchant_id` bigint(20) DEFAULT 0 AFTER `pay_version`; | |||
| ALTER TABLE `mallink`.`wx_order_25` | |||
| ADD COLUMN `product_name` varchar(255) AFTER `product_id`, | |||
| ADD COLUMN `make_merchant_id` bigint(20) DEFAULT 0 AFTER `pay_version`; | |||
| ALTER TABLE `mallink`.`wx_order_26` | |||
| ADD COLUMN `product_name` varchar(255) AFTER `product_id`, | |||
| ADD COLUMN `make_merchant_id` bigint(20) DEFAULT 0 AFTER `pay_version`; | |||
| ALTER TABLE `mallink`.`wx_order_27` | |||
| ADD COLUMN `product_name` varchar(255) AFTER `product_id`, | |||
| ADD COLUMN `make_merchant_id` bigint(20) DEFAULT 0 AFTER `pay_version`; | |||
| ALTER TABLE `mallink`.`wx_order_28` | |||
| ADD COLUMN `product_name` varchar(255) AFTER `product_id`, | |||
| ADD COLUMN `make_merchant_id` bigint(20) DEFAULT 0 AFTER `pay_version`; | |||
| ALTER TABLE `mallink`.`wx_order_29` | |||
| ADD COLUMN `product_name` varchar(255) AFTER `product_id`, | |||
| ADD COLUMN `make_merchant_id` bigint(20) DEFAULT 0 AFTER `pay_version`; | |||
| ALTER TABLE `mallink`.`wx_order_30` | |||
| ADD COLUMN `product_name` varchar(255) AFTER `product_id`, | |||
| ADD COLUMN `make_merchant_id` bigint(20) DEFAULT 0 AFTER `pay_version`; | |||
| ALTER TABLE `mallink`.`wx_order_31` | |||
| ADD COLUMN `product_name` varchar(255) AFTER `product_id`, | |||
| ADD COLUMN `make_merchant_id` bigint(20) DEFAULT 0 AFTER `pay_version`; | |||
| ALTER TABLE `mallink`.`wx_order_32` | |||
| ADD COLUMN `product_name` varchar(255) AFTER `product_id`, | |||
| ADD COLUMN `make_merchant_id` bigint(20) DEFAULT 0 AFTER `pay_version`; | |||
| ALTER TABLE `mallink`.`wx_order_33` | |||
| ADD COLUMN `product_name` varchar(255) AFTER `product_id`, | |||
| ADD COLUMN `make_merchant_id` bigint(20) DEFAULT 0 AFTER `pay_version`; | |||
| ALTER TABLE `mallink`.`wx_order_34` | |||
| ADD COLUMN `product_name` varchar(255) AFTER `product_id`, | |||
| ADD COLUMN `make_merchant_id` bigint(20) DEFAULT 0 AFTER `pay_version`; | |||
| ALTER TABLE `mallink`.`wx_order_35` | |||
| ADD COLUMN `product_name` varchar(255) AFTER `product_id`, | |||
| ADD COLUMN `make_merchant_id` bigint(20) DEFAULT 0 AFTER `pay_version`; | |||
| ALTER TABLE `mallink`.`wx_order_36` | |||
| ADD COLUMN `product_name` varchar(255) AFTER `product_id`, | |||
| ADD COLUMN `make_merchant_id` bigint(20) DEFAULT 0 AFTER `pay_version`; | |||
| ALTER TABLE `mallink`.`wx_order_37` | |||
| ADD COLUMN `product_name` varchar(255) AFTER `product_id`, | |||
| ADD COLUMN `make_merchant_id` bigint(20) DEFAULT 0 AFTER `pay_version`; | |||
| ALTER TABLE `mallink`.`wx_order_38` | |||
| ADD COLUMN `product_name` varchar(255) AFTER `product_id`, | |||
| ADD COLUMN `make_merchant_id` bigint(20) DEFAULT 0 AFTER `pay_version`; | |||
| ALTER TABLE `mallink`.`wx_order_39` | |||
| ADD COLUMN `product_name` varchar(255) AFTER `product_id`, | |||
| ADD COLUMN `make_merchant_id` bigint(20) DEFAULT 0 AFTER `pay_version`; | |||
| ALTER TABLE `mallink`.`wx_order_40` | |||
| ADD COLUMN `product_name` varchar(255) AFTER `product_id`, | |||
| ADD COLUMN `make_merchant_id` bigint(20) DEFAULT 0 AFTER `pay_version`; | |||
| ALTER TABLE `mallink`.`wx_order_41` | |||
| ADD COLUMN `product_name` varchar(255) AFTER `product_id`, | |||
| ADD COLUMN `make_merchant_id` bigint(20) DEFAULT 0 AFTER `pay_version`; | |||
| ALTER TABLE `mallink`.`wx_order_42` | |||
| ADD COLUMN `product_name` varchar(255) AFTER `product_id`, | |||
| ADD COLUMN `make_merchant_id` bigint(20) DEFAULT 0 AFTER `pay_version`; | |||
| ALTER TABLE `mallink`.`wx_order_43` | |||
| ADD COLUMN `product_name` varchar(255) AFTER `product_id`, | |||
| ADD COLUMN `make_merchant_id` bigint(20) DEFAULT 0 AFTER `pay_version`; | |||
| ALTER TABLE `mallink`.`wx_order_44` | |||
| ADD COLUMN `product_name` varchar(255) AFTER `product_id`, | |||
| ADD COLUMN `make_merchant_id` bigint(20) DEFAULT 0 AFTER `pay_version`; | |||
| ALTER TABLE `mallink`.`wx_order_45` | |||
| ADD COLUMN `product_name` varchar(255) AFTER `product_id`, | |||
| ADD COLUMN `make_merchant_id` bigint(20) DEFAULT 0 AFTER `pay_version`; | |||
| ALTER TABLE `mallink`.`wx_order_46` | |||
| ADD COLUMN `product_name` varchar(255) AFTER `product_id`, | |||
| ADD COLUMN `make_merchant_id` bigint(20) DEFAULT 0 AFTER `pay_version`; | |||
| ALTER TABLE `mallink`.`wx_order_47` | |||
| ADD COLUMN `product_name` varchar(255) AFTER `product_id`, | |||
| ADD COLUMN `make_merchant_id` bigint(20) DEFAULT 0 AFTER `pay_version`; | |||
| ALTER TABLE `mallink`.`wx_order_48` | |||
| ADD COLUMN `product_name` varchar(255) AFTER `product_id`, | |||
| ADD COLUMN `make_merchant_id` bigint(20) DEFAULT 0 AFTER `pay_version`; | |||
| ALTER TABLE `mallink`.`wx_order_49` | |||
| ADD COLUMN `product_name` varchar(255) AFTER `product_id`, | |||
| ADD COLUMN `make_merchant_id` bigint(20) DEFAULT 0 AFTER `pay_version`; | |||
| ALTER TABLE `mallink`.`wx_order_50` | |||
| ADD COLUMN `product_name` varchar(255) AFTER `product_id`, | |||
| ADD COLUMN `make_merchant_id` bigint(20) DEFAULT 0 AFTER `pay_version`; | |||
| ALTER TABLE `mallink`.`wx_order_51` | |||
| ADD COLUMN `product_name` varchar(255) AFTER `product_id`, | |||
| ADD COLUMN `make_merchant_id` bigint(20) DEFAULT 0 AFTER `pay_version`; | |||
| ALTER TABLE `mallink`.`wx_order_52` | |||
| ADD COLUMN `product_name` varchar(255) AFTER `product_id`, | |||
| ADD COLUMN `make_merchant_id` bigint(20) DEFAULT 0 AFTER `pay_version`; | |||
| ALTER TABLE `mallink`.`wx_order_53` | |||
| ADD COLUMN `product_name` varchar(255) AFTER `product_id`, | |||
| ADD COLUMN `make_merchant_id` bigint(20) DEFAULT 0 AFTER `pay_version`; | |||
| ALTER TABLE `mallink`.`wx_order_54` | |||
| ADD COLUMN `product_name` varchar(255) AFTER `product_id`, | |||
| ADD COLUMN `make_merchant_id` bigint(20) DEFAULT 0 AFTER `pay_version`; | |||
| ALTER TABLE `mallink`.`wx_order_55` | |||
| ADD COLUMN `product_name` varchar(255) AFTER `product_id`, | |||
| ADD COLUMN `make_merchant_id` bigint(20) DEFAULT 0 AFTER `pay_version`; | |||
| ALTER TABLE `mallink`.`wx_order_56` | |||
| ADD COLUMN `product_name` varchar(255) AFTER `product_id`, | |||
| ADD COLUMN `make_merchant_id` bigint(20) DEFAULT 0 AFTER `pay_version`; | |||
| ALTER TABLE `mallink`.`wx_order_57` | |||
| ADD COLUMN `product_name` varchar(255) AFTER `product_id`, | |||
| ADD COLUMN `make_merchant_id` bigint(20) DEFAULT 0 AFTER `pay_version`; | |||
| ALTER TABLE `mallink`.`wx_order_58` | |||
| ADD COLUMN `product_name` varchar(255) AFTER `product_id`, | |||
| ADD COLUMN `make_merchant_id` bigint(20) DEFAULT 0 AFTER `pay_version`; | |||
| ALTER TABLE `mallink`.`wx_order_59` | |||
| ADD COLUMN `product_name` varchar(255) AFTER `product_id`, | |||
| ADD COLUMN `make_merchant_id` bigint(20) DEFAULT 0 AFTER `pay_version`; | |||
| ALTER TABLE `mallink`.`wx_order_60` | |||
| ADD COLUMN `product_name` varchar(255) AFTER `product_id`, | |||
| ADD COLUMN `make_merchant_id` bigint(20) DEFAULT 0 AFTER `pay_version`; | |||
| ALTER TABLE `mallink`.`wx_order_61` | |||
| ADD COLUMN `product_name` varchar(255) AFTER `product_id`, | |||
| ADD COLUMN `make_merchant_id` bigint(20) DEFAULT 0 AFTER `pay_version`; | |||
| ALTER TABLE `mallink`.`wx_order_62` | |||
| ADD COLUMN `product_name` varchar(255) AFTER `product_id`, | |||
| ADD COLUMN `make_merchant_id` bigint(20) DEFAULT 0 AFTER `pay_version`; | |||
| ALTER TABLE `mallink`.`wx_order_63` | |||
| ADD COLUMN `product_name` varchar(255) AFTER `product_id`, | |||
| ADD COLUMN `make_merchant_id` bigint(20) DEFAULT 0 AFTER `pay_version`; | |||
| ALTER TABLE `mallink`.`wx_order_64` | |||
| ADD COLUMN `product_name` varchar(255) AFTER `product_id`, | |||
| ADD COLUMN `make_merchant_id` bigint(20) DEFAULT 0 AFTER `pay_version`; | |||
| ALTER TABLE `mallink`.`wx_order_65` | |||
| ADD COLUMN `product_name` varchar(255) AFTER `product_id`, | |||
| ADD COLUMN `make_merchant_id` bigint(20) DEFAULT 0 AFTER `pay_version`; | |||
| ALTER TABLE `mallink`.`wx_order_66` | |||
| ADD COLUMN `product_name` varchar(255) AFTER `product_id`, | |||
| ADD COLUMN `make_merchant_id` bigint(20) DEFAULT 0 AFTER `pay_version`; | |||
| ALTER TABLE `mallink`.`wx_order_67` | |||
| ADD COLUMN `product_name` varchar(255) AFTER `product_id`, | |||
| ADD COLUMN `make_merchant_id` bigint(20) DEFAULT 0 AFTER `pay_version`; | |||
| ALTER TABLE `mallink`.`wx_order_68` | |||
| ADD COLUMN `product_name` varchar(255) AFTER `product_id`, | |||
| ADD COLUMN `make_merchant_id` bigint(20) DEFAULT 0 AFTER `pay_version`; | |||
| ALTER TABLE `mallink`.`wx_order_69` | |||
| ADD COLUMN `product_name` varchar(255) AFTER `product_id`, | |||
| ADD COLUMN `make_merchant_id` bigint(20) DEFAULT 0 AFTER `pay_version`; | |||
| ALTER TABLE `mallink`.`wx_order_70` | |||
| ADD COLUMN `product_name` varchar(255) AFTER `product_id`, | |||
| ADD COLUMN `make_merchant_id` bigint(20) DEFAULT 0 AFTER `pay_version`; | |||
| ALTER TABLE `mallink`.`wx_order_71` | |||
| ADD COLUMN `product_name` varchar(255) AFTER `product_id`, | |||
| ADD COLUMN `make_merchant_id` bigint(20) DEFAULT 0 AFTER `pay_version`; | |||
| ALTER TABLE `mallink`.`wx_order_72` | |||
| ADD COLUMN `product_name` varchar(255) AFTER `product_id`, | |||
| ADD COLUMN `make_merchant_id` bigint(20) DEFAULT 0 AFTER `pay_version`; | |||
| ALTER TABLE `mallink`.`wx_order_73` | |||
| ADD COLUMN `product_name` varchar(255) AFTER `product_id`, | |||
| ADD COLUMN `make_merchant_id` bigint(20) DEFAULT 0 AFTER `pay_version`; | |||
| ALTER TABLE `mallink`.`wx_order_74` | |||
| ADD COLUMN `product_name` varchar(255) AFTER `product_id`, | |||
| ADD COLUMN `make_merchant_id` bigint(20) DEFAULT 0 AFTER `pay_version`; | |||
| ALTER TABLE `mallink`.`wx_order_75` | |||
| ADD COLUMN `product_name` varchar(255) AFTER `product_id`, | |||
| ADD COLUMN `make_merchant_id` bigint(20) DEFAULT 0 AFTER `pay_version`; | |||
| ALTER TABLE `mallink`.`wx_order_76` | |||
| ADD COLUMN `product_name` varchar(255) AFTER `product_id`, | |||
| ADD COLUMN `make_merchant_id` bigint(20) DEFAULT 0 AFTER `pay_version`; | |||
| ALTER TABLE `mallink`.`wx_order_77` | |||
| ADD COLUMN `product_name` varchar(255) AFTER `product_id`, | |||
| ADD COLUMN `make_merchant_id` bigint(20) DEFAULT 0 AFTER `pay_version`; | |||
| ALTER TABLE `mallink`.`wx_order_78` | |||
| ADD COLUMN `product_name` varchar(255) AFTER `product_id`, | |||
| ADD COLUMN `make_merchant_id` bigint(20) DEFAULT 0 AFTER `pay_version`; | |||
| ALTER TABLE `mallink`.`wx_order_79` | |||
| ADD COLUMN `product_name` varchar(255) AFTER `product_id`, | |||
| ADD COLUMN `make_merchant_id` bigint(20) DEFAULT 0 AFTER `pay_version`; | |||
| ALTER TABLE `mallink`.`wx_order_80` | |||
| ADD COLUMN `product_name` varchar(255) AFTER `product_id`, | |||
| ADD COLUMN `make_merchant_id` bigint(20) DEFAULT 0 AFTER `pay_version`; | |||
| ALTER TABLE `mallink`.`wx_order_81` | |||
| ADD COLUMN `product_name` varchar(255) AFTER `product_id`, | |||
| ADD COLUMN `make_merchant_id` bigint(20) DEFAULT 0 AFTER `pay_version`; | |||
| ALTER TABLE `mallink`.`wx_order_82` | |||
| ADD COLUMN `product_name` varchar(255) AFTER `product_id`, | |||
| ADD COLUMN `make_merchant_id` bigint(20) DEFAULT 0 AFTER `pay_version`; | |||
| ALTER TABLE `mallink`.`wx_order_83` | |||
| ADD COLUMN `product_name` varchar(255) AFTER `product_id`, | |||
| ADD COLUMN `make_merchant_id` bigint(20) DEFAULT 0 AFTER `pay_version`; | |||
| ALTER TABLE `mallink`.`wx_order_84` | |||
| ADD COLUMN `product_name` varchar(255) AFTER `product_id`, | |||
| ADD COLUMN `make_merchant_id` bigint(20) DEFAULT 0 AFTER `pay_version`; | |||
| ALTER TABLE `mallink`.`wx_order_85` | |||
| ADD COLUMN `product_name` varchar(255) AFTER `product_id`, | |||
| ADD COLUMN `make_merchant_id` bigint(20) DEFAULT 0 AFTER `pay_version`; | |||
| ALTER TABLE `mallink`.`wx_order_86` | |||
| ADD COLUMN `product_name` varchar(255) AFTER `product_id`, | |||
| ADD COLUMN `make_merchant_id` bigint(20) DEFAULT 0 AFTER `pay_version`; | |||
| ALTER TABLE `mallink`.`wx_order_87` | |||
| ADD COLUMN `product_name` varchar(255) AFTER `product_id`, | |||
| ADD COLUMN `make_merchant_id` bigint(20) DEFAULT 0 AFTER `pay_version`; | |||
| ALTER TABLE `mallink`.`wx_order_88` | |||
| ADD COLUMN `product_name` varchar(255) AFTER `product_id`, | |||
| ADD COLUMN `make_merchant_id` bigint(20) DEFAULT 0 AFTER `pay_version`; | |||
| ALTER TABLE `mallink`.`wx_order_89` | |||
| ADD COLUMN `product_name` varchar(255) AFTER `product_id`, | |||
| ADD COLUMN `make_merchant_id` bigint(20) DEFAULT 0 AFTER `pay_version`; | |||
| ALTER TABLE `mallink`.`wx_order_90` | |||
| ADD COLUMN `product_name` varchar(255) AFTER `product_id`, | |||
| ADD COLUMN `make_merchant_id` bigint(20) DEFAULT 0 AFTER `pay_version`; | |||
| ALTER TABLE `mallink`.`wx_order_91` | |||
| ADD COLUMN `product_name` varchar(255) AFTER `product_id`, | |||
| ADD COLUMN `make_merchant_id` bigint(20) DEFAULT 0 AFTER `pay_version`; | |||
| ALTER TABLE `mallink`.`wx_order_92` | |||
| ADD COLUMN `product_name` varchar(255) AFTER `product_id`, | |||
| ADD COLUMN `make_merchant_id` bigint(20) DEFAULT 0 AFTER `pay_version`; | |||
| ALTER TABLE `mallink`.`wx_order_93` | |||
| ADD COLUMN `product_name` varchar(255) AFTER `product_id`, | |||
| ADD COLUMN `make_merchant_id` bigint(20) DEFAULT 0 AFTER `pay_version`; | |||
| ALTER TABLE `mallink`.`wx_order_94` | |||
| ADD COLUMN `product_name` varchar(255) AFTER `product_id`, | |||
| ADD COLUMN `make_merchant_id` bigint(20) DEFAULT 0 AFTER `pay_version`; | |||
| ALTER TABLE `mallink`.`wx_order_95` | |||
| ADD COLUMN `product_name` varchar(255) AFTER `product_id`, | |||
| ADD COLUMN `make_merchant_id` bigint(20) DEFAULT 0 AFTER `pay_version`; | |||
| ALTER TABLE `mallink`.`wx_order_96` | |||
| ADD COLUMN `product_name` varchar(255) AFTER `product_id`, | |||
| ADD COLUMN `make_merchant_id` bigint(20) DEFAULT 0 AFTER `pay_version`; | |||
| ALTER TABLE `mallink`.`wx_order_97` | |||
| ADD COLUMN `product_name` varchar(255) AFTER `product_id`, | |||
| ADD COLUMN `make_merchant_id` bigint(20) DEFAULT 0 AFTER `pay_version`; | |||
| ALTER TABLE `mallink`.`wx_order_98` | |||
| ADD COLUMN `product_name` varchar(255) AFTER `product_id`, | |||
| ADD COLUMN `make_merchant_id` bigint(20) DEFAULT 0 AFTER `pay_version`; | |||
| ALTER TABLE `mallink`.`wx_order_99` | |||
| ADD COLUMN `product_name` varchar(255) AFTER `product_id`, | |||
| ADD COLUMN `make_merchant_id` bigint(20) DEFAULT 0 AFTER `pay_version`; | |||
| @@ -0,0 +1,202 @@ | |||
| ALTER TABLE `mallink`.`wx_coupon_0` ADD COLUMN `goods_id` varchar(50) COMMENT '第三方商品Id'; | |||
| ALTER TABLE `mallink`.`wx_coupon_1` ADD COLUMN `goods_id` varchar(50) COMMENT '第三方商品Id'; | |||
| ALTER TABLE `mallink`.`wx_coupon_2` ADD COLUMN `goods_id` varchar(50) COMMENT '第三方商品Id'; | |||
| ALTER TABLE `mallink`.`wx_coupon_3` ADD COLUMN `goods_id` varchar(50) COMMENT '第三方商品Id'; | |||
| ALTER TABLE `mallink`.`wx_coupon_4` ADD COLUMN `goods_id` varchar(50) COMMENT '第三方商品Id'; | |||
| ALTER TABLE `mallink`.`wx_coupon_5` ADD COLUMN `goods_id` varchar(50) COMMENT '第三方商品Id'; | |||
| ALTER TABLE `mallink`.`wx_coupon_6` ADD COLUMN `goods_id` varchar(50) COMMENT '第三方商品Id'; | |||
| ALTER TABLE `mallink`.`wx_coupon_7` ADD COLUMN `goods_id` varchar(50) COMMENT '第三方商品Id'; | |||
| ALTER TABLE `mallink`.`wx_coupon_8` ADD COLUMN `goods_id` varchar(50) COMMENT '第三方商品Id'; | |||
| ALTER TABLE `mallink`.`wx_coupon_9` ADD COLUMN `goods_id` varchar(50) COMMENT '第三方商品Id'; | |||
| ALTER TABLE `mallink`.`wx_coupon_10` ADD COLUMN `goods_id` varchar(50) COMMENT '第三方商品Id'; | |||
| ALTER TABLE `mallink`.`wx_coupon_11` ADD COLUMN `goods_id` varchar(50) COMMENT '第三方商品Id'; | |||
| ALTER TABLE `mallink`.`wx_coupon_12` ADD COLUMN `goods_id` varchar(50) COMMENT '第三方商品Id'; | |||
| ALTER TABLE `mallink`.`wx_coupon_13` ADD COLUMN `goods_id` varchar(50) COMMENT '第三方商品Id'; | |||
| ALTER TABLE `mallink`.`wx_coupon_14` ADD COLUMN `goods_id` varchar(50) COMMENT '第三方商品Id'; | |||
| ALTER TABLE `mallink`.`wx_coupon_15` ADD COLUMN `goods_id` varchar(50) COMMENT '第三方商品Id'; | |||
| ALTER TABLE `mallink`.`wx_coupon_16` ADD COLUMN `goods_id` varchar(50) COMMENT '第三方商品Id'; | |||
| ALTER TABLE `mallink`.`wx_coupon_17` ADD COLUMN `goods_id` varchar(50) COMMENT '第三方商品Id'; | |||
| ALTER TABLE `mallink`.`wx_coupon_18` ADD COLUMN `goods_id` varchar(50) COMMENT '第三方商品Id'; | |||
| ALTER TABLE `mallink`.`wx_coupon_19` ADD COLUMN `goods_id` varchar(50) COMMENT '第三方商品Id'; | |||
| ALTER TABLE `mallink`.`wx_coupon_20` ADD COLUMN `goods_id` varchar(50) COMMENT '第三方商品Id'; | |||
| ALTER TABLE `mallink`.`wx_coupon_21` ADD COLUMN `goods_id` varchar(50) COMMENT '第三方商品Id'; | |||
| ALTER TABLE `mallink`.`wx_coupon_22` ADD COLUMN `goods_id` varchar(50) COMMENT '第三方商品Id'; | |||
| ALTER TABLE `mallink`.`wx_coupon_23` ADD COLUMN `goods_id` varchar(50) COMMENT '第三方商品Id'; | |||
| ALTER TABLE `mallink`.`wx_coupon_24` ADD COLUMN `goods_id` varchar(50) COMMENT '第三方商品Id'; | |||
| ALTER TABLE `mallink`.`wx_coupon_25` ADD COLUMN `goods_id` varchar(50) COMMENT '第三方商品Id'; | |||
| ALTER TABLE `mallink`.`wx_coupon_26` ADD COLUMN `goods_id` varchar(50) COMMENT '第三方商品Id'; | |||
| ALTER TABLE `mallink`.`wx_coupon_27` ADD COLUMN `goods_id` varchar(50) COMMENT '第三方商品Id'; | |||
| ALTER TABLE `mallink`.`wx_coupon_28` ADD COLUMN `goods_id` varchar(50) COMMENT '第三方商品Id'; | |||
| ALTER TABLE `mallink`.`wx_coupon_29` ADD COLUMN `goods_id` varchar(50) COMMENT '第三方商品Id'; | |||
| ALTER TABLE `mallink`.`wx_coupon_30` ADD COLUMN `goods_id` varchar(50) COMMENT '第三方商品Id'; | |||
| ALTER TABLE `mallink`.`wx_coupon_31` ADD COLUMN `goods_id` varchar(50) COMMENT '第三方商品Id'; | |||
| ALTER TABLE `mallink`.`wx_coupon_32` ADD COLUMN `goods_id` varchar(50) COMMENT '第三方商品Id'; | |||
| ALTER TABLE `mallink`.`wx_coupon_33` ADD COLUMN `goods_id` varchar(50) COMMENT '第三方商品Id'; | |||
| ALTER TABLE `mallink`.`wx_coupon_34` ADD COLUMN `goods_id` varchar(50) COMMENT '第三方商品Id'; | |||
| ALTER TABLE `mallink`.`wx_coupon_35` ADD COLUMN `goods_id` varchar(50) COMMENT '第三方商品Id'; | |||
| ALTER TABLE `mallink`.`wx_coupon_36` ADD COLUMN `goods_id` varchar(50) COMMENT '第三方商品Id'; | |||
| ALTER TABLE `mallink`.`wx_coupon_37` ADD COLUMN `goods_id` varchar(50) COMMENT '第三方商品Id'; | |||
| ALTER TABLE `mallink`.`wx_coupon_38` ADD COLUMN `goods_id` varchar(50) COMMENT '第三方商品Id'; | |||
| ALTER TABLE `mallink`.`wx_coupon_39` ADD COLUMN `goods_id` varchar(50) COMMENT '第三方商品Id'; | |||
| ALTER TABLE `mallink`.`wx_coupon_40` ADD COLUMN `goods_id` varchar(50) COMMENT '第三方商品Id'; | |||
| ALTER TABLE `mallink`.`wx_coupon_41` ADD COLUMN `goods_id` varchar(50) COMMENT '第三方商品Id'; | |||
| ALTER TABLE `mallink`.`wx_coupon_42` ADD COLUMN `goods_id` varchar(50) COMMENT '第三方商品Id'; | |||
| ALTER TABLE `mallink`.`wx_coupon_43` ADD COLUMN `goods_id` varchar(50) COMMENT '第三方商品Id'; | |||
| ALTER TABLE `mallink`.`wx_coupon_44` ADD COLUMN `goods_id` varchar(50) COMMENT '第三方商品Id'; | |||
| ALTER TABLE `mallink`.`wx_coupon_45` ADD COLUMN `goods_id` varchar(50) COMMENT '第三方商品Id'; | |||
| ALTER TABLE `mallink`.`wx_coupon_46` ADD COLUMN `goods_id` varchar(50) COMMENT '第三方商品Id'; | |||
| ALTER TABLE `mallink`.`wx_coupon_47` ADD COLUMN `goods_id` varchar(50) COMMENT '第三方商品Id'; | |||
| ALTER TABLE `mallink`.`wx_coupon_48` ADD COLUMN `goods_id` varchar(50) COMMENT '第三方商品Id'; | |||
| ALTER TABLE `mallink`.`wx_coupon_49` ADD COLUMN `goods_id` varchar(50) COMMENT '第三方商品Id'; | |||
| ALTER TABLE `mallink`.`wx_coupon_50` ADD COLUMN `goods_id` varchar(50) COMMENT '第三方商品Id'; | |||
| ALTER TABLE `mallink`.`wx_coupon_51` ADD COLUMN `goods_id` varchar(50) COMMENT '第三方商品Id'; | |||
| ALTER TABLE `mallink`.`wx_coupon_52` ADD COLUMN `goods_id` varchar(50) COMMENT '第三方商品Id'; | |||
| ALTER TABLE `mallink`.`wx_coupon_53` ADD COLUMN `goods_id` varchar(50) COMMENT '第三方商品Id'; | |||
| ALTER TABLE `mallink`.`wx_coupon_54` ADD COLUMN `goods_id` varchar(50) COMMENT '第三方商品Id'; | |||
| ALTER TABLE `mallink`.`wx_coupon_55` ADD COLUMN `goods_id` varchar(50) COMMENT '第三方商品Id'; | |||
| ALTER TABLE `mallink`.`wx_coupon_56` ADD COLUMN `goods_id` varchar(50) COMMENT '第三方商品Id'; | |||
| ALTER TABLE `mallink`.`wx_coupon_57` ADD COLUMN `goods_id` varchar(50) COMMENT '第三方商品Id'; | |||
| ALTER TABLE `mallink`.`wx_coupon_58` ADD COLUMN `goods_id` varchar(50) COMMENT '第三方商品Id'; | |||
| ALTER TABLE `mallink`.`wx_coupon_59` ADD COLUMN `goods_id` varchar(50) COMMENT '第三方商品Id'; | |||
| ALTER TABLE `mallink`.`wx_coupon_60` ADD COLUMN `goods_id` varchar(50) COMMENT '第三方商品Id'; | |||
| ALTER TABLE `mallink`.`wx_coupon_61` ADD COLUMN `goods_id` varchar(50) COMMENT '第三方商品Id'; | |||
| ALTER TABLE `mallink`.`wx_coupon_62` ADD COLUMN `goods_id` varchar(50) COMMENT '第三方商品Id'; | |||
| ALTER TABLE `mallink`.`wx_coupon_63` ADD COLUMN `goods_id` varchar(50) COMMENT '第三方商品Id'; | |||
| ALTER TABLE `mallink`.`wx_coupon_64` ADD COLUMN `goods_id` varchar(50) COMMENT '第三方商品Id'; | |||
| ALTER TABLE `mallink`.`wx_coupon_65` ADD COLUMN `goods_id` varchar(50) COMMENT '第三方商品Id'; | |||
| ALTER TABLE `mallink`.`wx_coupon_66` ADD COLUMN `goods_id` varchar(50) COMMENT '第三方商品Id'; | |||
| ALTER TABLE `mallink`.`wx_coupon_67` ADD COLUMN `goods_id` varchar(50) COMMENT '第三方商品Id'; | |||
| ALTER TABLE `mallink`.`wx_coupon_68` ADD COLUMN `goods_id` varchar(50) COMMENT '第三方商品Id'; | |||
| ALTER TABLE `mallink`.`wx_coupon_69` ADD COLUMN `goods_id` varchar(50) COMMENT '第三方商品Id'; | |||
| ALTER TABLE `mallink`.`wx_coupon_70` ADD COLUMN `goods_id` varchar(50) COMMENT '第三方商品Id'; | |||
| ALTER TABLE `mallink`.`wx_coupon_71` ADD COLUMN `goods_id` varchar(50) COMMENT '第三方商品Id'; | |||
| ALTER TABLE `mallink`.`wx_coupon_72` ADD COLUMN `goods_id` varchar(50) COMMENT '第三方商品Id'; | |||
| ALTER TABLE `mallink`.`wx_coupon_73` ADD COLUMN `goods_id` varchar(50) COMMENT '第三方商品Id'; | |||
| ALTER TABLE `mallink`.`wx_coupon_74` ADD COLUMN `goods_id` varchar(50) COMMENT '第三方商品Id'; | |||
| ALTER TABLE `mallink`.`wx_coupon_75` ADD COLUMN `goods_id` varchar(50) COMMENT '第三方商品Id'; | |||
| ALTER TABLE `mallink`.`wx_coupon_76` ADD COLUMN `goods_id` varchar(50) COMMENT '第三方商品Id'; | |||
| ALTER TABLE `mallink`.`wx_coupon_77` ADD COLUMN `goods_id` varchar(50) COMMENT '第三方商品Id'; | |||
| ALTER TABLE `mallink`.`wx_coupon_78` ADD COLUMN `goods_id` varchar(50) COMMENT '第三方商品Id'; | |||
| ALTER TABLE `mallink`.`wx_coupon_79` ADD COLUMN `goods_id` varchar(50) COMMENT '第三方商品Id'; | |||
| ALTER TABLE `mallink`.`wx_coupon_80` ADD COLUMN `goods_id` varchar(50) COMMENT '第三方商品Id'; | |||
| ALTER TABLE `mallink`.`wx_coupon_81` ADD COLUMN `goods_id` varchar(50) COMMENT '第三方商品Id'; | |||
| ALTER TABLE `mallink`.`wx_coupon_82` ADD COLUMN `goods_id` varchar(50) COMMENT '第三方商品Id'; | |||
| ALTER TABLE `mallink`.`wx_coupon_83` ADD COLUMN `goods_id` varchar(50) COMMENT '第三方商品Id'; | |||
| ALTER TABLE `mallink`.`wx_coupon_84` ADD COLUMN `goods_id` varchar(50) COMMENT '第三方商品Id'; | |||
| ALTER TABLE `mallink`.`wx_coupon_85` ADD COLUMN `goods_id` varchar(50) COMMENT '第三方商品Id'; | |||
| ALTER TABLE `mallink`.`wx_coupon_86` ADD COLUMN `goods_id` varchar(50) COMMENT '第三方商品Id'; | |||
| ALTER TABLE `mallink`.`wx_coupon_87` ADD COLUMN `goods_id` varchar(50) COMMENT '第三方商品Id'; | |||
| ALTER TABLE `mallink`.`wx_coupon_88` ADD COLUMN `goods_id` varchar(50) COMMENT '第三方商品Id'; | |||
| ALTER TABLE `mallink`.`wx_coupon_89` ADD COLUMN `goods_id` varchar(50) COMMENT '第三方商品Id'; | |||
| ALTER TABLE `mallink`.`wx_coupon_90` ADD COLUMN `goods_id` varchar(50) COMMENT '第三方商品Id'; | |||
| ALTER TABLE `mallink`.`wx_coupon_91` ADD COLUMN `goods_id` varchar(50) COMMENT '第三方商品Id'; | |||
| ALTER TABLE `mallink`.`wx_coupon_92` ADD COLUMN `goods_id` varchar(50) COMMENT '第三方商品Id'; | |||
| ALTER TABLE `mallink`.`wx_coupon_93` ADD COLUMN `goods_id` varchar(50) COMMENT '第三方商品Id'; | |||
| ALTER TABLE `mallink`.`wx_coupon_94` ADD COLUMN `goods_id` varchar(50) COMMENT '第三方商品Id'; | |||
| ALTER TABLE `mallink`.`wx_coupon_95` ADD COLUMN `goods_id` varchar(50) COMMENT '第三方商品Id'; | |||
| ALTER TABLE `mallink`.`wx_coupon_96` ADD COLUMN `goods_id` varchar(50) COMMENT '第三方商品Id'; | |||
| ALTER TABLE `mallink`.`wx_coupon_97` ADD COLUMN `goods_id` varchar(50) COMMENT '第三方商品Id'; | |||
| ALTER TABLE `mallink`.`wx_coupon_98` ADD COLUMN `goods_id` varchar(50) COMMENT '第三方商品Id'; | |||
| ALTER TABLE `mallink`.`wx_coupon_99` ADD COLUMN `goods_id` varchar(50) COMMENT '第三方商品Id'; | |||
| update `wx_coupon_0` wc left join tt_coupon_channel_poi ccp on wc.id = ccp.id set wc.`goods_id` = ccp.`spu_id` where ccp.`spu_id` is not null; | |||
| update `wx_coupon_1` wc left join tt_coupon_channel_poi ccp on wc.id = ccp.id set wc.`goods_id` = ccp.`spu_id` where ccp.`spu_id` is not null; | |||
| update `wx_coupon_2` wc left join tt_coupon_channel_poi ccp on wc.id = ccp.id set wc.`goods_id` = ccp.`spu_id` where ccp.`spu_id` is not null; | |||
| update `wx_coupon_3` wc left join tt_coupon_channel_poi ccp on wc.id = ccp.id set wc.`goods_id` = ccp.`spu_id` where ccp.`spu_id` is not null; | |||
| update `wx_coupon_4` wc left join tt_coupon_channel_poi ccp on wc.id = ccp.id set wc.`goods_id` = ccp.`spu_id` where ccp.`spu_id` is not null; | |||
| update `wx_coupon_5` wc left join tt_coupon_channel_poi ccp on wc.id = ccp.id set wc.`goods_id` = ccp.`spu_id` where ccp.`spu_id` is not null; | |||
| update `wx_coupon_6` wc left join tt_coupon_channel_poi ccp on wc.id = ccp.id set wc.`goods_id` = ccp.`spu_id` where ccp.`spu_id` is not null; | |||
| update `wx_coupon_7` wc left join tt_coupon_channel_poi ccp on wc.id = ccp.id set wc.`goods_id` = ccp.`spu_id` where ccp.`spu_id` is not null; | |||
| update `wx_coupon_8` wc left join tt_coupon_channel_poi ccp on wc.id = ccp.id set wc.`goods_id` = ccp.`spu_id` where ccp.`spu_id` is not null; | |||
| update `wx_coupon_9` wc left join tt_coupon_channel_poi ccp on wc.id = ccp.id set wc.`goods_id` = ccp.`spu_id` where ccp.`spu_id` is not null; | |||
| update `wx_coupon_10` wc left join tt_coupon_channel_poi ccp on wc.id = ccp.id set wc.`goods_id` = ccp.`spu_id` where ccp.`spu_id` is not null; | |||
| update `wx_coupon_11` wc left join tt_coupon_channel_poi ccp on wc.id = ccp.id set wc.`goods_id` = ccp.`spu_id` where ccp.`spu_id` is not null; | |||
| update `wx_coupon_12` wc left join tt_coupon_channel_poi ccp on wc.id = ccp.id set wc.`goods_id` = ccp.`spu_id` where ccp.`spu_id` is not null; | |||
| update `wx_coupon_13` wc left join tt_coupon_channel_poi ccp on wc.id = ccp.id set wc.`goods_id` = ccp.`spu_id` where ccp.`spu_id` is not null; | |||
| update `wx_coupon_14` wc left join tt_coupon_channel_poi ccp on wc.id = ccp.id set wc.`goods_id` = ccp.`spu_id` where ccp.`spu_id` is not null; | |||
| update `wx_coupon_15` wc left join tt_coupon_channel_poi ccp on wc.id = ccp.id set wc.`goods_id` = ccp.`spu_id` where ccp.`spu_id` is not null; | |||
| update `wx_coupon_16` wc left join tt_coupon_channel_poi ccp on wc.id = ccp.id set wc.`goods_id` = ccp.`spu_id` where ccp.`spu_id` is not null; | |||
| update `wx_coupon_17` wc left join tt_coupon_channel_poi ccp on wc.id = ccp.id set wc.`goods_id` = ccp.`spu_id` where ccp.`spu_id` is not null; | |||
| update `wx_coupon_18` wc left join tt_coupon_channel_poi ccp on wc.id = ccp.id set wc.`goods_id` = ccp.`spu_id` where ccp.`spu_id` is not null; | |||
| update `wx_coupon_19` wc left join tt_coupon_channel_poi ccp on wc.id = ccp.id set wc.`goods_id` = ccp.`spu_id` where ccp.`spu_id` is not null; | |||
| update `wx_coupon_20` wc left join tt_coupon_channel_poi ccp on wc.id = ccp.id set wc.`goods_id` = ccp.`spu_id` where ccp.`spu_id` is not null; | |||
| update `wx_coupon_21` wc left join tt_coupon_channel_poi ccp on wc.id = ccp.id set wc.`goods_id` = ccp.`spu_id` where ccp.`spu_id` is not null; | |||
| update `wx_coupon_22` wc left join tt_coupon_channel_poi ccp on wc.id = ccp.id set wc.`goods_id` = ccp.`spu_id` where ccp.`spu_id` is not null; | |||
| update `wx_coupon_23` wc left join tt_coupon_channel_poi ccp on wc.id = ccp.id set wc.`goods_id` = ccp.`spu_id` where ccp.`spu_id` is not null; | |||
| update `wx_coupon_24` wc left join tt_coupon_channel_poi ccp on wc.id = ccp.id set wc.`goods_id` = ccp.`spu_id` where ccp.`spu_id` is not null; | |||
| update `wx_coupon_25` wc left join tt_coupon_channel_poi ccp on wc.id = ccp.id set wc.`goods_id` = ccp.`spu_id` where ccp.`spu_id` is not null; | |||
| update `wx_coupon_26` wc left join tt_coupon_channel_poi ccp on wc.id = ccp.id set wc.`goods_id` = ccp.`spu_id` where ccp.`spu_id` is not null; | |||
| update `wx_coupon_27` wc left join tt_coupon_channel_poi ccp on wc.id = ccp.id set wc.`goods_id` = ccp.`spu_id` where ccp.`spu_id` is not null; | |||
| update `wx_coupon_28` wc left join tt_coupon_channel_poi ccp on wc.id = ccp.id set wc.`goods_id` = ccp.`spu_id` where ccp.`spu_id` is not null; | |||
| update `wx_coupon_29` wc left join tt_coupon_channel_poi ccp on wc.id = ccp.id set wc.`goods_id` = ccp.`spu_id` where ccp.`spu_id` is not null; | |||
| update `wx_coupon_30` wc left join tt_coupon_channel_poi ccp on wc.id = ccp.id set wc.`goods_id` = ccp.`spu_id` where ccp.`spu_id` is not null; | |||
| update `wx_coupon_31` wc left join tt_coupon_channel_poi ccp on wc.id = ccp.id set wc.`goods_id` = ccp.`spu_id` where ccp.`spu_id` is not null; | |||
| update `wx_coupon_32` wc left join tt_coupon_channel_poi ccp on wc.id = ccp.id set wc.`goods_id` = ccp.`spu_id` where ccp.`spu_id` is not null; | |||
| update `wx_coupon_33` wc left join tt_coupon_channel_poi ccp on wc.id = ccp.id set wc.`goods_id` = ccp.`spu_id` where ccp.`spu_id` is not null; | |||
| update `wx_coupon_34` wc left join tt_coupon_channel_poi ccp on wc.id = ccp.id set wc.`goods_id` = ccp.`spu_id` where ccp.`spu_id` is not null; | |||
| update `wx_coupon_35` wc left join tt_coupon_channel_poi ccp on wc.id = ccp.id set wc.`goods_id` = ccp.`spu_id` where ccp.`spu_id` is not null; | |||
| update `wx_coupon_36` wc left join tt_coupon_channel_poi ccp on wc.id = ccp.id set wc.`goods_id` = ccp.`spu_id` where ccp.`spu_id` is not null; | |||
| update `wx_coupon_37` wc left join tt_coupon_channel_poi ccp on wc.id = ccp.id set wc.`goods_id` = ccp.`spu_id` where ccp.`spu_id` is not null; | |||
| update `wx_coupon_38` wc left join tt_coupon_channel_poi ccp on wc.id = ccp.id set wc.`goods_id` = ccp.`spu_id` where ccp.`spu_id` is not null; | |||
| update `wx_coupon_39` wc left join tt_coupon_channel_poi ccp on wc.id = ccp.id set wc.`goods_id` = ccp.`spu_id` where ccp.`spu_id` is not null; | |||
| update `wx_coupon_40` wc left join tt_coupon_channel_poi ccp on wc.id = ccp.id set wc.`goods_id` = ccp.`spu_id` where ccp.`spu_id` is not null; | |||
| update `wx_coupon_41` wc left join tt_coupon_channel_poi ccp on wc.id = ccp.id set wc.`goods_id` = ccp.`spu_id` where ccp.`spu_id` is not null; | |||
| update `wx_coupon_42` wc left join tt_coupon_channel_poi ccp on wc.id = ccp.id set wc.`goods_id` = ccp.`spu_id` where ccp.`spu_id` is not null; | |||
| update `wx_coupon_43` wc left join tt_coupon_channel_poi ccp on wc.id = ccp.id set wc.`goods_id` = ccp.`spu_id` where ccp.`spu_id` is not null; | |||
| update `wx_coupon_44` wc left join tt_coupon_channel_poi ccp on wc.id = ccp.id set wc.`goods_id` = ccp.`spu_id` where ccp.`spu_id` is not null; | |||
| update `wx_coupon_45` wc left join tt_coupon_channel_poi ccp on wc.id = ccp.id set wc.`goods_id` = ccp.`spu_id` where ccp.`spu_id` is not null; | |||
| update `wx_coupon_46` wc left join tt_coupon_channel_poi ccp on wc.id = ccp.id set wc.`goods_id` = ccp.`spu_id` where ccp.`spu_id` is not null; | |||
| update `wx_coupon_47` wc left join tt_coupon_channel_poi ccp on wc.id = ccp.id set wc.`goods_id` = ccp.`spu_id` where ccp.`spu_id` is not null; | |||
| update `wx_coupon_48` wc left join tt_coupon_channel_poi ccp on wc.id = ccp.id set wc.`goods_id` = ccp.`spu_id` where ccp.`spu_id` is not null; | |||
| update `wx_coupon_49` wc left join tt_coupon_channel_poi ccp on wc.id = ccp.id set wc.`goods_id` = ccp.`spu_id` where ccp.`spu_id` is not null; | |||
| update `wx_coupon_50` wc left join tt_coupon_channel_poi ccp on wc.id = ccp.id set wc.`goods_id` = ccp.`spu_id` where ccp.`spu_id` is not null; | |||
| update `wx_coupon_51` wc left join tt_coupon_channel_poi ccp on wc.id = ccp.id set wc.`goods_id` = ccp.`spu_id` where ccp.`spu_id` is not null; | |||
| update `wx_coupon_52` wc left join tt_coupon_channel_poi ccp on wc.id = ccp.id set wc.`goods_id` = ccp.`spu_id` where ccp.`spu_id` is not null; | |||
| update `wx_coupon_53` wc left join tt_coupon_channel_poi ccp on wc.id = ccp.id set wc.`goods_id` = ccp.`spu_id` where ccp.`spu_id` is not null; | |||
| update `wx_coupon_54` wc left join tt_coupon_channel_poi ccp on wc.id = ccp.id set wc.`goods_id` = ccp.`spu_id` where ccp.`spu_id` is not null; | |||
| update `wx_coupon_55` wc left join tt_coupon_channel_poi ccp on wc.id = ccp.id set wc.`goods_id` = ccp.`spu_id` where ccp.`spu_id` is not null; | |||
| update `wx_coupon_56` wc left join tt_coupon_channel_poi ccp on wc.id = ccp.id set wc.`goods_id` = ccp.`spu_id` where ccp.`spu_id` is not null; | |||
| update `wx_coupon_57` wc left join tt_coupon_channel_poi ccp on wc.id = ccp.id set wc.`goods_id` = ccp.`spu_id` where ccp.`spu_id` is not null; | |||
| update `wx_coupon_58` wc left join tt_coupon_channel_poi ccp on wc.id = ccp.id set wc.`goods_id` = ccp.`spu_id` where ccp.`spu_id` is not null; | |||
| update `wx_coupon_59` wc left join tt_coupon_channel_poi ccp on wc.id = ccp.id set wc.`goods_id` = ccp.`spu_id` where ccp.`spu_id` is not null; | |||
| update `wx_coupon_60` wc left join tt_coupon_channel_poi ccp on wc.id = ccp.id set wc.`goods_id` = ccp.`spu_id` where ccp.`spu_id` is not null; | |||
| update `wx_coupon_61` wc left join tt_coupon_channel_poi ccp on wc.id = ccp.id set wc.`goods_id` = ccp.`spu_id` where ccp.`spu_id` is not null; | |||
| update `wx_coupon_62` wc left join tt_coupon_channel_poi ccp on wc.id = ccp.id set wc.`goods_id` = ccp.`spu_id` where ccp.`spu_id` is not null; | |||
| update `wx_coupon_63` wc left join tt_coupon_channel_poi ccp on wc.id = ccp.id set wc.`goods_id` = ccp.`spu_id` where ccp.`spu_id` is not null; | |||
| update `wx_coupon_64` wc left join tt_coupon_channel_poi ccp on wc.id = ccp.id set wc.`goods_id` = ccp.`spu_id` where ccp.`spu_id` is not null; | |||
| update `wx_coupon_65` wc left join tt_coupon_channel_poi ccp on wc.id = ccp.id set wc.`goods_id` = ccp.`spu_id` where ccp.`spu_id` is not null; | |||
| update `wx_coupon_66` wc left join tt_coupon_channel_poi ccp on wc.id = ccp.id set wc.`goods_id` = ccp.`spu_id` where ccp.`spu_id` is not null; | |||
| update `wx_coupon_67` wc left join tt_coupon_channel_poi ccp on wc.id = ccp.id set wc.`goods_id` = ccp.`spu_id` where ccp.`spu_id` is not null; | |||
| update `wx_coupon_68` wc left join tt_coupon_channel_poi ccp on wc.id = ccp.id set wc.`goods_id` = ccp.`spu_id` where ccp.`spu_id` is not null; | |||
| update `wx_coupon_69` wc left join tt_coupon_channel_poi ccp on wc.id = ccp.id set wc.`goods_id` = ccp.`spu_id` where ccp.`spu_id` is not null; | |||
| update `wx_coupon_70` wc left join tt_coupon_channel_poi ccp on wc.id = ccp.id set wc.`goods_id` = ccp.`spu_id` where ccp.`spu_id` is not null; | |||
| update `wx_coupon_71` wc left join tt_coupon_channel_poi ccp on wc.id = ccp.id set wc.`goods_id` = ccp.`spu_id` where ccp.`spu_id` is not null; | |||
| update `wx_coupon_72` wc left join tt_coupon_channel_poi ccp on wc.id = ccp.id set wc.`goods_id` = ccp.`spu_id` where ccp.`spu_id` is not null; | |||
| update `wx_coupon_73` wc left join tt_coupon_channel_poi ccp on wc.id = ccp.id set wc.`goods_id` = ccp.`spu_id` where ccp.`spu_id` is not null; | |||
| update `wx_coupon_74` wc left join tt_coupon_channel_poi ccp on wc.id = ccp.id set wc.`goods_id` = ccp.`spu_id` where ccp.`spu_id` is not null; | |||
| update `wx_coupon_75` wc left join tt_coupon_channel_poi ccp on wc.id = ccp.id set wc.`goods_id` = ccp.`spu_id` where ccp.`spu_id` is not null; | |||
| update `wx_coupon_76` wc left join tt_coupon_channel_poi ccp on wc.id = ccp.id set wc.`goods_id` = ccp.`spu_id` where ccp.`spu_id` is not null; | |||
| update `wx_coupon_77` wc left join tt_coupon_channel_poi ccp on wc.id = ccp.id set wc.`goods_id` = ccp.`spu_id` where ccp.`spu_id` is not null; | |||
| update `wx_coupon_78` wc left join tt_coupon_channel_poi ccp on wc.id = ccp.id set wc.`goods_id` = ccp.`spu_id` where ccp.`spu_id` is not null; | |||
| update `wx_coupon_79` wc left join tt_coupon_channel_poi ccp on wc.id = ccp.id set wc.`goods_id` = ccp.`spu_id` where ccp.`spu_id` is not null; | |||
| update `wx_coupon_80` wc left join tt_coupon_channel_poi ccp on wc.id = ccp.id set wc.`goods_id` = ccp.`spu_id` where ccp.`spu_id` is not null; | |||
| update `wx_coupon_81` wc left join tt_coupon_channel_poi ccp on wc.id = ccp.id set wc.`goods_id` = ccp.`spu_id` where ccp.`spu_id` is not null; | |||
| update `wx_coupon_82` wc left join tt_coupon_channel_poi ccp on wc.id = ccp.id set wc.`goods_id` = ccp.`spu_id` where ccp.`spu_id` is not null; | |||
| update `wx_coupon_83` wc left join tt_coupon_channel_poi ccp on wc.id = ccp.id set wc.`goods_id` = ccp.`spu_id` where ccp.`spu_id` is not null; | |||
| update `wx_coupon_84` wc left join tt_coupon_channel_poi ccp on wc.id = ccp.id set wc.`goods_id` = ccp.`spu_id` where ccp.`spu_id` is not null; | |||
| update `wx_coupon_85` wc left join tt_coupon_channel_poi ccp on wc.id = ccp.id set wc.`goods_id` = ccp.`spu_id` where ccp.`spu_id` is not null; | |||
| update `wx_coupon_86` wc left join tt_coupon_channel_poi ccp on wc.id = ccp.id set wc.`goods_id` = ccp.`spu_id` where ccp.`spu_id` is not null; | |||
| update `wx_coupon_87` wc left join tt_coupon_channel_poi ccp on wc.id = ccp.id set wc.`goods_id` = ccp.`spu_id` where ccp.`spu_id` is not null; | |||
| update `wx_coupon_88` wc left join tt_coupon_channel_poi ccp on wc.id = ccp.id set wc.`goods_id` = ccp.`spu_id` where ccp.`spu_id` is not null; | |||
| update `wx_coupon_89` wc left join tt_coupon_channel_poi ccp on wc.id = ccp.id set wc.`goods_id` = ccp.`spu_id` where ccp.`spu_id` is not null; | |||
| update `wx_coupon_90` wc left join tt_coupon_channel_poi ccp on wc.id = ccp.id set wc.`goods_id` = ccp.`spu_id` where ccp.`spu_id` is not null; | |||
| update `wx_coupon_91` wc left join tt_coupon_channel_poi ccp on wc.id = ccp.id set wc.`goods_id` = ccp.`spu_id` where ccp.`spu_id` is not null; | |||
| update `wx_coupon_92` wc left join tt_coupon_channel_poi ccp on wc.id = ccp.id set wc.`goods_id` = ccp.`spu_id` where ccp.`spu_id` is not null; | |||
| update `wx_coupon_93` wc left join tt_coupon_channel_poi ccp on wc.id = ccp.id set wc.`goods_id` = ccp.`spu_id` where ccp.`spu_id` is not null; | |||
| update `wx_coupon_94` wc left join tt_coupon_channel_poi ccp on wc.id = ccp.id set wc.`goods_id` = ccp.`spu_id` where ccp.`spu_id` is not null; | |||
| update `wx_coupon_95` wc left join tt_coupon_channel_poi ccp on wc.id = ccp.id set wc.`goods_id` = ccp.`spu_id` where ccp.`spu_id` is not null; | |||
| update `wx_coupon_96` wc left join tt_coupon_channel_poi ccp on wc.id = ccp.id set wc.`goods_id` = ccp.`spu_id` where ccp.`spu_id` is not null; | |||
| update `wx_coupon_97` wc left join tt_coupon_channel_poi ccp on wc.id = ccp.id set wc.`goods_id` = ccp.`spu_id` where ccp.`spu_id` is not null; | |||
| update `wx_coupon_98` wc left join tt_coupon_channel_poi ccp on wc.id = ccp.id set wc.`goods_id` = ccp.`spu_id` where ccp.`spu_id` is not null; | |||
| update `wx_coupon_99` wc left join tt_coupon_channel_poi ccp on wc.id = ccp.id set wc.`goods_id` = ccp.`spu_id` where ccp.`spu_id` is not null; | |||
| @@ -0,0 +1,23 @@ | |||
| ALTER TABLE `mallink`.`wx_pay_account` | |||
| ADD COLUMN `business_type` smallint(2) COMMENT '商圈版本' AFTER `merchant_cert_pem_path`, | |||
| ADD COLUMN `brandid` varchar(50) COMMENT '商圈品牌ID' AFTER `business_type`, | |||
| ADD COLUMN `card_id` varchar(50) COMMENT '商圈会员卡ID' AFTER `brandid`; | |||
| ALTER TABLE `mallink`.`wx_pay_account` | |||
| ADD COLUMN `merchant_cert_serial_no` varchar(100) AFTER `cert_serial_no`; | |||
| update `mallink`.`wx_pay_account` set merchant_key_path = private_key_path,merchant_cert_serial_no = cert_serial_no,merchant_apiv3_key = api_v3_key | |||
| where type = 0; | |||
| update `mallink`.`wx_pay_account` set private_key_path = null,cert_serial_no = null,api_v3_key = null | |||
| where type = 0; | |||
| update `mallink`.`wx_pay_account` set merchant_api_key = api_key | |||
| where type = 0; | |||
| update `mallink`.`wx_pay_account` set api_key = null | |||
| where type = 0; | |||
| --清缓存,重启项目 | |||
| @@ -0,0 +1,19 @@ | |||
| INSERT INTO `mallink`.`mall_sale_type`(`id`, `name`, `type`, `period`, `menus`) VALUES (103500103610, '金茂合同全能版+抖音', 10, 12, '[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 50, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 201, 202, 203, 204, 205, 206, 209, 211, 212, 221, 222, 223, 251, 299, 300, 307, 308, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 420, 421, 422, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 511, 512, 513, 514, 521, 522, 523, 531, 532, 533, 591, 592, 595, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 621, 622, 623, 624, 625, 626, 627, 641, 642, 643, 644, 645, 646, 647, 651, 661, 662, 663, 664, 665, 666, 671, 672, 673, 674, 675, 676, 680, 681, 682, 683, 684, 685, 687, 691, 692, 693, 694, 695, 701, 702, 703, 704, 711, 712, 713, 714, 901, 902, 903, 904, 905, 906, 907, 908, 910, 931, 932, 951, 952, 961, 962, 963, 965, 966, 967, 968, 1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009, 1010, 1011, 1012, 1013, 1014, 1015, 1016, 1017, 5310, 5320, 6611, 60701, 60702]'); | |||
| INSERT INTO `mallink`.`mall_sale_type`(`id`, `name`, `type`, `period`, `menus`) VALUES (12, '尊享全能版+抖音', 12, 12, '[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 50, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 201, 202, 203, 204, 205, 206, 209, 211, 212, 221, 222, 223, 251, 299, 300, 301, 302, 303, 304, 305, 306, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 420, 421, 422, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 511, 512, 513, 514, 521, 522, 523, 531, 532, 533, 591, 592, 595, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 621, 622, 623, 624, 625, 626, 627, 641, 642, 643, 644, 645, 646, 647, 651, 661, 662, 663, 664, 665, 666, 671, 672, 673, 674, 675, 676, 680, 681, 682, 683, 684, 685, 687, 691, 692, 693, 694, 695, 701, 702, 703, 704, 711, 712, 713, 714, 901, 902, 903, 904, 905, 906, 907, 908, 910, 931, 932, 951, 952, 961, 962, 963, 965, 966, 967, 968, 1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009, 1010, 1011, 1012, 1013, 1014, 1015, 1016, 1017, 5310, 5320, 6611, 60701, 60702]'); | |||
| INSERT INTO `mallink`.`mall_permission`(`id`, `name`, `parent_id`, `available`, `permission`, `resource_type`, `module_color`, `module_color_num`, `url`, `icon`, `version_type`, `sort`) VALUES (615, '抖音CPS佣金', 6, 'Y', NULL, 0, NULL, NULL, NULL, 'icon-jifen', 0, 602); | |||
| INSERT INTO `mallink`.`mall_permission`(`id`, `name`, `parent_id`, `available`, `permission`, `resource_type`, `module_color`, `module_color_num`, `url`, `icon`, `version_type`, `sort`) VALUES (61501, '通用佣金', 615, 'Y', NULL, 1, NULL, NULL, 'commonPlan', NULL, 0, 61501); | |||
| INSERT INTO `mallink`.`mall_permission`(`id`, `name`, `parent_id`, `available`, `permission`, `resource_type`, `module_color`, `module_color_num`, `url`, `icon`, `version_type`, `sort`) VALUES (61502, '定向佣金', 615, 'Y', NULL, 1, NULL, NULL, 'orientedPlan', NULL, 0, 61502); | |||
| UPDATE `mallink`.`mall_sale_type` SET `menus` = '[1, 2, 4, 5, 6, 50, 105, 110, 201, 205, 202, 211, 212, 221, 222, 223, 251, 409, 410, 411, 416, 500, 502, 504, 505, 506, 507, 508, 511, 512, 521, 522, 523, 591, 592, 595, 601, 602, 605, 606, 610, 615, 622, 647, 676, 680, 711, 901, 902, 904, 907, 5310, 5320, 61501, 61502]' WHERE `id` = 11; | |||
| UPDATE `mallink`.`mall_sale_type` SET `menus` = '[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 50, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 201, 202, 203, 204, 205, 206, 209, 211, 212, 221, 222, 223, 251, 299, 300, 301, 302, 303, 304, 305, 306, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 420, 421, 422, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 511, 512, 513, 514, 521, 522, 523, 531, 532, 533, 591, 592, 595, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 621, 622, 623, 624, 625, 626, 627, 641, 642, 643, 644, 645, 646, 647, 651, 661, 662, 663, 664, 665, 666, 671, 672, 673, 674, 675, 676, 680, 681, 682, 683, 684, 685, 687, 691, 692, 693, 694, 695, 701, 702, 703, 704, 711, 712, 713, 714, 901, 902, 903, 904, 905, 906, 907, 908, 910, 931, 932, 951, 952, 961, 962, 963, 965, 966, 967, 968, 1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009, 1010, 1011, 1012, 1013, 1014, 1015, 1016, 1017, 5310, 5320, 6611, 60701, 60702, 61501, 61502]' WHERE `id` = 12; | |||
| UPDATE `mallink`.`mall_sale_type` SET `menus` = '[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 50, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 201, 202, 203, 204, 205, 206, 209, 211, 212, 221, 222, 223, 251, 299, 300, 307, 308, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 420, 421, 422, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 511, 512, 513, 514, 521, 522, 523, 531, 532, 533, 591, 592, 595, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 621, 622, 623, 624, 625, 626, 627, 641, 642, 643, 644, 645, 646, 647, 651, 661, 662, 663, 664, 665, 666, 671, 672, 673, 674, 675, 676, 680, 681, 682, 683, 684, 685, 687, 691, 692, 693, 694, 695, 701, 702, 703, 704, 711, 712, 713, 714, 901, 902, 903, 904, 905, 906, 907, 908, 910, 931, 932, 951, 952, 961, 962, 963, 965, 966, 967, 968, 1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009, 1010, 1011, 1012, 1013, 1014, 1015, 1016, 1017, 5310, 5320, 6611, 60701, 60702, 61501, 61502]' WHERE `id` = 103500103610; | |||
| @@ -0,0 +1,400 @@ | |||
| ALTER TABLE `mallink`.`wx_c_user_0` | |||
| ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`, | |||
| ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`, | |||
| ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`; | |||
| ALTER TABLE `mallink`.`wx_c_user_1` | |||
| ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`, | |||
| ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`, | |||
| ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`; | |||
| ALTER TABLE `mallink`.`wx_c_user_2` | |||
| ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`, | |||
| ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`, | |||
| ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`; | |||
| ALTER TABLE `mallink`.`wx_c_user_3` | |||
| ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`, | |||
| ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`, | |||
| ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`; | |||
| ALTER TABLE `mallink`.`wx_c_user_4` | |||
| ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`, | |||
| ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`, | |||
| ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`; | |||
| ALTER TABLE `mallink`.`wx_c_user_5` | |||
| ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`, | |||
| ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`, | |||
| ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`; | |||
| ALTER TABLE `mallink`.`wx_c_user_6` | |||
| ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`, | |||
| ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`, | |||
| ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`; | |||
| ALTER TABLE `mallink`.`wx_c_user_7` | |||
| ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`, | |||
| ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`, | |||
| ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`; | |||
| ALTER TABLE `mallink`.`wx_c_user_8` | |||
| ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`, | |||
| ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`, | |||
| ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`; | |||
| ALTER TABLE `mallink`.`wx_c_user_9` | |||
| ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`, | |||
| ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`, | |||
| ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`; | |||
| ALTER TABLE `mallink`.`wx_c_user_10` | |||
| ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`, | |||
| ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`, | |||
| ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`; | |||
| ALTER TABLE `mallink`.`wx_c_user_11` | |||
| ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`, | |||
| ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`, | |||
| ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`; | |||
| ALTER TABLE `mallink`.`wx_c_user_12` | |||
| ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`, | |||
| ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`, | |||
| ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`; | |||
| ALTER TABLE `mallink`.`wx_c_user_13` | |||
| ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`, | |||
| ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`, | |||
| ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`; | |||
| ALTER TABLE `mallink`.`wx_c_user_14` | |||
| ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`, | |||
| ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`, | |||
| ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`; | |||
| ALTER TABLE `mallink`.`wx_c_user_15` | |||
| ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`, | |||
| ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`, | |||
| ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`; | |||
| ALTER TABLE `mallink`.`wx_c_user_16` | |||
| ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`, | |||
| ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`, | |||
| ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`; | |||
| ALTER TABLE `mallink`.`wx_c_user_17` | |||
| ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`, | |||
| ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`, | |||
| ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`; | |||
| ALTER TABLE `mallink`.`wx_c_user_18` | |||
| ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`, | |||
| ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`, | |||
| ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`; | |||
| ALTER TABLE `mallink`.`wx_c_user_19` | |||
| ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`, | |||
| ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`, | |||
| ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`; | |||
| ALTER TABLE `mallink`.`wx_c_user_20` | |||
| ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`, | |||
| ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`, | |||
| ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`; | |||
| ALTER TABLE `mallink`.`wx_c_user_21` | |||
| ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`, | |||
| ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`, | |||
| ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`; | |||
| ALTER TABLE `mallink`.`wx_c_user_22` | |||
| ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`, | |||
| ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`, | |||
| ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`; | |||
| ALTER TABLE `mallink`.`wx_c_user_23` | |||
| ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`, | |||
| ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`, | |||
| ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`; | |||
| ALTER TABLE `mallink`.`wx_c_user_24` | |||
| ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`, | |||
| ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`, | |||
| ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`; | |||
| ALTER TABLE `mallink`.`wx_c_user_25` | |||
| ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`, | |||
| ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`, | |||
| ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`; | |||
| ALTER TABLE `mallink`.`wx_c_user_26` | |||
| ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`, | |||
| ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`, | |||
| ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`; | |||
| ALTER TABLE `mallink`.`wx_c_user_27` | |||
| ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`, | |||
| ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`, | |||
| ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`; | |||
| ALTER TABLE `mallink`.`wx_c_user_28` | |||
| ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`, | |||
| ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`, | |||
| ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`; | |||
| ALTER TABLE `mallink`.`wx_c_user_29` | |||
| ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`, | |||
| ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`, | |||
| ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`; | |||
| ALTER TABLE `mallink`.`wx_c_user_30` | |||
| ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`, | |||
| ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`, | |||
| ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`; | |||
| ALTER TABLE `mallink`.`wx_c_user_31` | |||
| ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`, | |||
| ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`, | |||
| ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`; | |||
| ALTER TABLE `mallink`.`wx_c_user_32` | |||
| ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`, | |||
| ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`, | |||
| ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`; | |||
| ALTER TABLE `mallink`.`wx_c_user_33` | |||
| ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`, | |||
| ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`, | |||
| ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`; | |||
| ALTER TABLE `mallink`.`wx_c_user_34` | |||
| ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`, | |||
| ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`, | |||
| ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`; | |||
| ALTER TABLE `mallink`.`wx_c_user_35` | |||
| ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`, | |||
| ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`, | |||
| ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`; | |||
| ALTER TABLE `mallink`.`wx_c_user_36` | |||
| ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`, | |||
| ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`, | |||
| ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`; | |||
| ALTER TABLE `mallink`.`wx_c_user_37` | |||
| ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`, | |||
| ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`, | |||
| ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`; | |||
| ALTER TABLE `mallink`.`wx_c_user_38` | |||
| ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`, | |||
| ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`, | |||
| ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`; | |||
| ALTER TABLE `mallink`.`wx_c_user_39` | |||
| ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`, | |||
| ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`, | |||
| ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`; | |||
| ALTER TABLE `mallink`.`wx_c_user_40` | |||
| ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`, | |||
| ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`, | |||
| ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`; | |||
| ALTER TABLE `mallink`.`wx_c_user_41` | |||
| ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`, | |||
| ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`, | |||
| ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`; | |||
| ALTER TABLE `mallink`.`wx_c_user_42` | |||
| ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`, | |||
| ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`, | |||
| ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`; | |||
| ALTER TABLE `mallink`.`wx_c_user_43` | |||
| ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`, | |||
| ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`, | |||
| ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`; | |||
| ALTER TABLE `mallink`.`wx_c_user_44` | |||
| ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`, | |||
| ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`, | |||
| ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`; | |||
| ALTER TABLE `mallink`.`wx_c_user_45` | |||
| ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`, | |||
| ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`, | |||
| ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`; | |||
| ALTER TABLE `mallink`.`wx_c_user_46` | |||
| ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`, | |||
| ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`, | |||
| ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`; | |||
| ALTER TABLE `mallink`.`wx_c_user_47` | |||
| ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`, | |||
| ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`, | |||
| ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`; | |||
| ALTER TABLE `mallink`.`wx_c_user_48` | |||
| ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`, | |||
| ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`, | |||
| ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`; | |||
| ALTER TABLE `mallink`.`wx_c_user_49` | |||
| ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`, | |||
| ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`, | |||
| ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`; | |||
| ALTER TABLE `mallink`.`wx_c_user_50` | |||
| ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`, | |||
| ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`, | |||
| ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`; | |||
| ALTER TABLE `mallink`.`wx_c_user_51` | |||
| ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`, | |||
| ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`, | |||
| ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`; | |||
| ALTER TABLE `mallink`.`wx_c_user_52` | |||
| ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`, | |||
| ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`, | |||
| ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`; | |||
| ALTER TABLE `mallink`.`wx_c_user_53` | |||
| ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`, | |||
| ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`, | |||
| ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`; | |||
| ALTER TABLE `mallink`.`wx_c_user_54` | |||
| ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`, | |||
| ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`, | |||
| ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`; | |||
| ALTER TABLE `mallink`.`wx_c_user_55` | |||
| ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`, | |||
| ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`, | |||
| ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`; | |||
| ALTER TABLE `mallink`.`wx_c_user_56` | |||
| ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`, | |||
| ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`, | |||
| ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`; | |||
| ALTER TABLE `mallink`.`wx_c_user_57` | |||
| ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`, | |||
| ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`, | |||
| ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`; | |||
| ALTER TABLE `mallink`.`wx_c_user_58` | |||
| ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`, | |||
| ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`, | |||
| ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`; | |||
| ALTER TABLE `mallink`.`wx_c_user_59` | |||
| ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`, | |||
| ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`, | |||
| ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`; | |||
| ALTER TABLE `mallink`.`wx_c_user_60` | |||
| ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`, | |||
| ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`, | |||
| ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`; | |||
| ALTER TABLE `mallink`.`wx_c_user_61` | |||
| ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`, | |||
| ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`, | |||
| ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`; | |||
| ALTER TABLE `mallink`.`wx_c_user_62` | |||
| ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`, | |||
| ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`, | |||
| ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`; | |||
| ALTER TABLE `mallink`.`wx_c_user_63` | |||
| ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`, | |||
| ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`, | |||
| ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`; | |||
| ALTER TABLE `mallink`.`wx_c_user_64` | |||
| ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`, | |||
| ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`, | |||
| ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`; | |||
| ALTER TABLE `mallink`.`wx_c_user_65` | |||
| ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`, | |||
| ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`, | |||
| ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`; | |||
| ALTER TABLE `mallink`.`wx_c_user_66` | |||
| ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`, | |||
| ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`, | |||
| ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`; | |||
| ALTER TABLE `mallink`.`wx_c_user_67` | |||
| ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`, | |||
| ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`, | |||
| ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`; | |||
| ALTER TABLE `mallink`.`wx_c_user_68` | |||
| ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`, | |||
| ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`, | |||
| ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`; | |||
| ALTER TABLE `mallink`.`wx_c_user_69` | |||
| ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`, | |||
| ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`, | |||
| ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`; | |||
| ALTER TABLE `mallink`.`wx_c_user_70` | |||
| ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`, | |||
| ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`, | |||
| ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`; | |||
| ALTER TABLE `mallink`.`wx_c_user_71` | |||
| ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`, | |||
| ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`, | |||
| ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`; | |||
| ALTER TABLE `mallink`.`wx_c_user_72` | |||
| ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`, | |||
| ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`, | |||
| ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`; | |||
| ALTER TABLE `mallink`.`wx_c_user_73` | |||
| ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`, | |||
| ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`, | |||
| ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`; | |||
| ALTER TABLE `mallink`.`wx_c_user_74` | |||
| ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`, | |||
| ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`, | |||
| ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`; | |||
| ALTER TABLE `mallink`.`wx_c_user_75` | |||
| ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`, | |||
| ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`, | |||
| ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`; | |||
| ALTER TABLE `mallink`.`wx_c_user_76` | |||
| ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`, | |||
| ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`, | |||
| ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`; | |||
| ALTER TABLE `mallink`.`wx_c_user_77` | |||
| ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`, | |||
| ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`, | |||
| ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`; | |||
| ALTER TABLE `mallink`.`wx_c_user_78` | |||
| ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`, | |||
| ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`, | |||
| ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`; | |||
| ALTER TABLE `mallink`.`wx_c_user_79` | |||
| ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`, | |||
| ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`, | |||
| ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`; | |||
| ALTER TABLE `mallink`.`wx_c_user_80` | |||
| ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`, | |||
| ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`, | |||
| ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`; | |||
| ALTER TABLE `mallink`.`wx_c_user_81` | |||
| ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`, | |||
| ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`, | |||
| ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`; | |||
| ALTER TABLE `mallink`.`wx_c_user_82` | |||
| ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`, | |||
| ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`, | |||
| ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`; | |||
| ALTER TABLE `mallink`.`wx_c_user_83` | |||
| ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`, | |||
| ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`, | |||
| ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`; | |||
| ALTER TABLE `mallink`.`wx_c_user_84` | |||
| ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`, | |||
| ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`, | |||
| ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`; | |||
| ALTER TABLE `mallink`.`wx_c_user_85` | |||
| ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`, | |||
| ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`, | |||
| ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`; | |||
| ALTER TABLE `mallink`.`wx_c_user_86` | |||
| ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`, | |||
| ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`, | |||
| ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`; | |||
| ALTER TABLE `mallink`.`wx_c_user_87` | |||
| ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`, | |||
| ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`, | |||
| ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`; | |||
| ALTER TABLE `mallink`.`wx_c_user_88` | |||
| ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`, | |||
| ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`, | |||
| ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`; | |||
| ALTER TABLE `mallink`.`wx_c_user_89` | |||
| ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`, | |||
| ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`, | |||
| ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`; | |||
| ALTER TABLE `mallink`.`wx_c_user_90` | |||
| ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`, | |||
| ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`, | |||
| ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`; | |||
| ALTER TABLE `mallink`.`wx_c_user_91` | |||
| ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`, | |||
| ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`, | |||
| ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`; | |||
| ALTER TABLE `mallink`.`wx_c_user_92` | |||
| ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`, | |||
| ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`, | |||
| ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`; | |||
| ALTER TABLE `mallink`.`wx_c_user_93` | |||
| ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`, | |||
| ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`, | |||
| ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`; | |||
| ALTER TABLE `mallink`.`wx_c_user_94` | |||
| ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`, | |||
| ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`, | |||
| ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`; | |||
| ALTER TABLE `mallink`.`wx_c_user_95` | |||
| ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`, | |||
| ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`, | |||
| ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`; | |||
| ALTER TABLE `mallink`.`wx_c_user_96` | |||
| ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`, | |||
| ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`, | |||
| ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`; | |||
| ALTER TABLE `mallink`.`wx_c_user_97` | |||
| ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`, | |||
| ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`, | |||
| ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`; | |||
| ALTER TABLE `mallink`.`wx_c_user_98` | |||
| ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`, | |||
| ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`, | |||
| ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`; | |||
| ALTER TABLE `mallink`.`wx_c_user_99` | |||
| ADD COLUMN `authorize_state` smallint(2) DEFAULT 0 COMMENT '用户授权快速积分' AFTER `qr_code`, | |||
| ADD COLUMN `authorize_time` datetime(0) COMMENT '授权时间' AFTER `authorize_state`, | |||
| ADD COLUMN `deauthorize_time` datetime(0) COMMENT '取消授权时间' AFTER `authorize_time`; | |||
| @@ -0,0 +1,441 @@ | |||
| CREATE TABLE `wx_member_card` ( | |||
| `id` bigint(20) NOT NULL COMMENT '主键ID', | |||
| `tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '租户ID', | |||
| `parent_tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '父租户ID', | |||
| `final_tenant_id` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, | |||
| `card_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '会员卡ID', | |||
| `card_code` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '会员卡code', | |||
| `activate_scene` smallint(2) DEFAULT NULL COMMENT '开卡场景', | |||
| `outer_str` smallint(2) DEFAULT NULL COMMENT '自定义场景', | |||
| `open_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '微信openId', | |||
| `union_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '微信unionId', | |||
| `membership_number` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '展示会员编号', | |||
| `level` varchar(5) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '会员等级', | |||
| `nickname` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '用户昵称', | |||
| `head_image_url` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '头像', | |||
| `background_picture_url` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '会员卡背景', | |||
| `balance` int(11) DEFAULT NULL COMMENT '用户储值的最新余额,单位分', | |||
| `user_card_status` smallint(2) DEFAULT NULL COMMENT '用户会员卡状态', | |||
| `user_information` json COMMENT '用户开卡时填写的个人信息{}', | |||
| `bonus_value` int(11) DEFAULT NULL COMMENT '用户当前的积分值', | |||
| `service_modules` json COMMENT '用户当前的会员服务项内容[]', | |||
| `member_price_word` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '用户会员卡详情页会员优惠栏目中的会员专享价文案', | |||
| `fapiao_jump_word` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '发票栏跳转小程序的引导文案', | |||
| `guide` json COMMENT '设置商家联系人员的名字、头像和联系方式[]', | |||
| `update_date` datetime(0) DEFAULT NULL COMMENT '更新时间', | |||
| `create_date` datetime(0) DEFAULT NULL COMMENT '创建时间', | |||
| `user_id` bigint(20) DEFAULT NULL COMMENT '会员Id', | |||
| PRIMARY KEY (`id`) USING BTREE, | |||
| UNIQUE INDEX `id_UNIQUE`(`id`) USING BTREE, | |||
| UNIQUE INDEX `card_code`(`card_id`, `card_code`) USING BTREE, | |||
| INDEX `open_id`(`open_id`) USING BTREE, | |||
| INDEX `user_id`(`user_id`) USING BTREE, | |||
| INDEX `tenant_id`(`final_tenant_id`) USING BTREE | |||
| ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = 'c端用户授权信息' ROW_FORMAT = Dynamic; | |||
| CREATE TABLE wx_member_card_0 LIKE wx_member_card; | |||
| CREATE TABLE wx_member_card_1 LIKE wx_member_card; | |||
| CREATE TABLE wx_member_card_2 LIKE wx_member_card; | |||
| CREATE TABLE wx_member_card_3 LIKE wx_member_card; | |||
| CREATE TABLE wx_member_card_4 LIKE wx_member_card; | |||
| CREATE TABLE wx_member_card_5 LIKE wx_member_card; | |||
| CREATE TABLE wx_member_card_6 LIKE wx_member_card; | |||
| CREATE TABLE wx_member_card_7 LIKE wx_member_card; | |||
| CREATE TABLE wx_member_card_8 LIKE wx_member_card; | |||
| CREATE TABLE wx_member_card_9 LIKE wx_member_card; | |||
| CREATE TABLE wx_member_card_10 LIKE wx_member_card; | |||
| CREATE TABLE wx_member_card_11 LIKE wx_member_card; | |||
| CREATE TABLE wx_member_card_12 LIKE wx_member_card; | |||
| CREATE TABLE wx_member_card_13 LIKE wx_member_card; | |||
| CREATE TABLE wx_member_card_14 LIKE wx_member_card; | |||
| CREATE TABLE wx_member_card_15 LIKE wx_member_card; | |||
| CREATE TABLE wx_member_card_16 LIKE wx_member_card; | |||
| CREATE TABLE wx_member_card_17 LIKE wx_member_card; | |||
| CREATE TABLE wx_member_card_18 LIKE wx_member_card; | |||
| CREATE TABLE wx_member_card_19 LIKE wx_member_card; | |||
| CREATE TABLE wx_member_card_20 LIKE wx_member_card; | |||
| CREATE TABLE wx_member_card_21 LIKE wx_member_card; | |||
| CREATE TABLE wx_member_card_22 LIKE wx_member_card; | |||
| CREATE TABLE wx_member_card_23 LIKE wx_member_card; | |||
| CREATE TABLE wx_member_card_24 LIKE wx_member_card; | |||
| CREATE TABLE wx_member_card_25 LIKE wx_member_card; | |||
| CREATE TABLE wx_member_card_26 LIKE wx_member_card; | |||
| CREATE TABLE wx_member_card_27 LIKE wx_member_card; | |||
| CREATE TABLE wx_member_card_28 LIKE wx_member_card; | |||
| CREATE TABLE wx_member_card_29 LIKE wx_member_card; | |||
| CREATE TABLE wx_member_card_30 LIKE wx_member_card; | |||
| CREATE TABLE wx_member_card_31 LIKE wx_member_card; | |||
| CREATE TABLE wx_member_card_32 LIKE wx_member_card; | |||
| CREATE TABLE wx_member_card_33 LIKE wx_member_card; | |||
| CREATE TABLE wx_member_card_34 LIKE wx_member_card; | |||
| CREATE TABLE wx_member_card_35 LIKE wx_member_card; | |||
| CREATE TABLE wx_member_card_36 LIKE wx_member_card; | |||
| CREATE TABLE wx_member_card_37 LIKE wx_member_card; | |||
| CREATE TABLE wx_member_card_38 LIKE wx_member_card; | |||
| CREATE TABLE wx_member_card_39 LIKE wx_member_card; | |||
| CREATE TABLE wx_member_card_40 LIKE wx_member_card; | |||
| CREATE TABLE wx_member_card_41 LIKE wx_member_card; | |||
| CREATE TABLE wx_member_card_42 LIKE wx_member_card; | |||
| CREATE TABLE wx_member_card_43 LIKE wx_member_card; | |||
| CREATE TABLE wx_member_card_44 LIKE wx_member_card; | |||
| CREATE TABLE wx_member_card_45 LIKE wx_member_card; | |||
| CREATE TABLE wx_member_card_46 LIKE wx_member_card; | |||
| CREATE TABLE wx_member_card_47 LIKE wx_member_card; | |||
| CREATE TABLE wx_member_card_48 LIKE wx_member_card; | |||
| CREATE TABLE wx_member_card_49 LIKE wx_member_card; | |||
| CREATE TABLE wx_member_card_50 LIKE wx_member_card; | |||
| CREATE TABLE wx_member_card_51 LIKE wx_member_card; | |||
| CREATE TABLE wx_member_card_52 LIKE wx_member_card; | |||
| CREATE TABLE wx_member_card_53 LIKE wx_member_card; | |||
| CREATE TABLE wx_member_card_54 LIKE wx_member_card; | |||
| CREATE TABLE wx_member_card_55 LIKE wx_member_card; | |||
| CREATE TABLE wx_member_card_56 LIKE wx_member_card; | |||
| CREATE TABLE wx_member_card_57 LIKE wx_member_card; | |||
| CREATE TABLE wx_member_card_58 LIKE wx_member_card; | |||
| CREATE TABLE wx_member_card_59 LIKE wx_member_card; | |||
| CREATE TABLE wx_member_card_60 LIKE wx_member_card; | |||
| CREATE TABLE wx_member_card_61 LIKE wx_member_card; | |||
| CREATE TABLE wx_member_card_62 LIKE wx_member_card; | |||
| CREATE TABLE wx_member_card_63 LIKE wx_member_card; | |||
| CREATE TABLE wx_member_card_64 LIKE wx_member_card; | |||
| CREATE TABLE wx_member_card_65 LIKE wx_member_card; | |||
| CREATE TABLE wx_member_card_66 LIKE wx_member_card; | |||
| CREATE TABLE wx_member_card_67 LIKE wx_member_card; | |||
| CREATE TABLE wx_member_card_68 LIKE wx_member_card; | |||
| CREATE TABLE wx_member_card_69 LIKE wx_member_card; | |||
| CREATE TABLE wx_member_card_70 LIKE wx_member_card; | |||
| CREATE TABLE wx_member_card_71 LIKE wx_member_card; | |||
| CREATE TABLE wx_member_card_72 LIKE wx_member_card; | |||
| CREATE TABLE wx_member_card_73 LIKE wx_member_card; | |||
| CREATE TABLE wx_member_card_74 LIKE wx_member_card; | |||
| CREATE TABLE wx_member_card_75 LIKE wx_member_card; | |||
| CREATE TABLE wx_member_card_76 LIKE wx_member_card; | |||
| CREATE TABLE wx_member_card_77 LIKE wx_member_card; | |||
| CREATE TABLE wx_member_card_78 LIKE wx_member_card; | |||
| CREATE TABLE wx_member_card_79 LIKE wx_member_card; | |||
| CREATE TABLE wx_member_card_80 LIKE wx_member_card; | |||
| CREATE TABLE wx_member_card_81 LIKE wx_member_card; | |||
| CREATE TABLE wx_member_card_82 LIKE wx_member_card; | |||
| CREATE TABLE wx_member_card_83 LIKE wx_member_card; | |||
| CREATE TABLE wx_member_card_84 LIKE wx_member_card; | |||
| CREATE TABLE wx_member_card_85 LIKE wx_member_card; | |||
| CREATE TABLE wx_member_card_86 LIKE wx_member_card; | |||
| CREATE TABLE wx_member_card_87 LIKE wx_member_card; | |||
| CREATE TABLE wx_member_card_88 LIKE wx_member_card; | |||
| CREATE TABLE wx_member_card_89 LIKE wx_member_card; | |||
| CREATE TABLE wx_member_card_90 LIKE wx_member_card; | |||
| CREATE TABLE wx_member_card_91 LIKE wx_member_card; | |||
| CREATE TABLE wx_member_card_92 LIKE wx_member_card; | |||
| CREATE TABLE wx_member_card_93 LIKE wx_member_card; | |||
| CREATE TABLE wx_member_card_94 LIKE wx_member_card; | |||
| CREATE TABLE wx_member_card_95 LIKE wx_member_card; | |||
| CREATE TABLE wx_member_card_96 LIKE wx_member_card; | |||
| CREATE TABLE wx_member_card_97 LIKE wx_member_card; | |||
| CREATE TABLE wx_member_card_98 LIKE wx_member_card; | |||
| CREATE TABLE wx_member_card_99 LIKE wx_member_card; | |||
| ALTER TABLE `mallink`.`wx_member_card` | |||
| ADD COLUMN `cuser_id` bigint(20) AFTER `user_id`, | |||
| ADD INDEX `cuser_id`(`cuser_id`); | |||
| ALTER TABLE `mallink`.`wx_member_card_0` | |||
| ADD COLUMN `cuser_id` bigint(20) AFTER `user_id`, | |||
| ADD INDEX `cuser_id`(`cuser_id`); | |||
| ALTER TABLE `mallink`.`wx_member_card_1` | |||
| ADD COLUMN `cuser_id` bigint(20) AFTER `user_id`, | |||
| ADD INDEX `cuser_id`(`cuser_id`); | |||
| ALTER TABLE `mallink`.`wx_member_card_2` | |||
| ADD COLUMN `cuser_id` bigint(20) AFTER `user_id`, | |||
| ADD INDEX `cuser_id`(`cuser_id`); | |||
| ALTER TABLE `mallink`.`wx_member_card_3` | |||
| ADD COLUMN `cuser_id` bigint(20) AFTER `user_id`, | |||
| ADD INDEX `cuser_id`(`cuser_id`); | |||
| ALTER TABLE `mallink`.`wx_member_card_4` | |||
| ADD COLUMN `cuser_id` bigint(20) AFTER `user_id`, | |||
| ADD INDEX `cuser_id`(`cuser_id`); | |||
| ALTER TABLE `mallink`.`wx_member_card_5` | |||
| ADD COLUMN `cuser_id` bigint(20) AFTER `user_id`, | |||
| ADD INDEX `cuser_id`(`cuser_id`); | |||
| ALTER TABLE `mallink`.`wx_member_card_6` | |||
| ADD COLUMN `cuser_id` bigint(20) AFTER `user_id`, | |||
| ADD INDEX `cuser_id`(`cuser_id`); | |||
| ALTER TABLE `mallink`.`wx_member_card_7` | |||
| ADD COLUMN `cuser_id` bigint(20) AFTER `user_id`, | |||
| ADD INDEX `cuser_id`(`cuser_id`); | |||
| ALTER TABLE `mallink`.`wx_member_card_8` | |||
| ADD COLUMN `cuser_id` bigint(20) AFTER `user_id`, | |||
| ADD INDEX `cuser_id`(`cuser_id`); | |||
| ALTER TABLE `mallink`.`wx_member_card_9` | |||
| ADD COLUMN `cuser_id` bigint(20) AFTER `user_id`, | |||
| ADD INDEX `cuser_id`(`cuser_id`); | |||
| ALTER TABLE `mallink`.`wx_member_card_10` | |||
| ADD COLUMN `cuser_id` bigint(20) AFTER `user_id`, | |||
| ADD INDEX `cuser_id`(`cuser_id`); | |||
| ALTER TABLE `mallink`.`wx_member_card_11` | |||
| ADD COLUMN `cuser_id` bigint(20) AFTER `user_id`, | |||
| ADD INDEX `cuser_id`(`cuser_id`); | |||
| ALTER TABLE `mallink`.`wx_member_card_12` | |||
| ADD COLUMN `cuser_id` bigint(20) AFTER `user_id`, | |||
| ADD INDEX `cuser_id`(`cuser_id`); | |||
| ALTER TABLE `mallink`.`wx_member_card_13` | |||
| ADD COLUMN `cuser_id` bigint(20) AFTER `user_id`, | |||
| ADD INDEX `cuser_id`(`cuser_id`); | |||
| ALTER TABLE `mallink`.`wx_member_card_14` | |||
| ADD COLUMN `cuser_id` bigint(20) AFTER `user_id`, | |||
| ADD INDEX `cuser_id`(`cuser_id`); | |||
| ALTER TABLE `mallink`.`wx_member_card_15` | |||
| ADD COLUMN `cuser_id` bigint(20) AFTER `user_id`, | |||
| ADD INDEX `cuser_id`(`cuser_id`); | |||
| ALTER TABLE `mallink`.`wx_member_card_16` | |||
| ADD COLUMN `cuser_id` bigint(20) AFTER `user_id`, | |||
| ADD INDEX `cuser_id`(`cuser_id`); | |||
| ALTER TABLE `mallink`.`wx_member_card_17` | |||
| ADD COLUMN `cuser_id` bigint(20) AFTER `user_id`, | |||
| ADD INDEX `cuser_id`(`cuser_id`); | |||
| ALTER TABLE `mallink`.`wx_member_card_18` | |||
| ADD COLUMN `cuser_id` bigint(20) AFTER `user_id`, | |||
| ADD INDEX `cuser_id`(`cuser_id`); | |||
| ALTER TABLE `mallink`.`wx_member_card_19` | |||
| ADD COLUMN `cuser_id` bigint(20) AFTER `user_id`, | |||
| ADD INDEX `cuser_id`(`cuser_id`); | |||
| ALTER TABLE `mallink`.`wx_member_card_20` | |||
| ADD COLUMN `cuser_id` bigint(20) AFTER `user_id`, | |||
| ADD INDEX `cuser_id`(`cuser_id`); | |||
| ALTER TABLE `mallink`.`wx_member_card_21` | |||
| ADD COLUMN `cuser_id` bigint(20) AFTER `user_id`, | |||
| ADD INDEX `cuser_id`(`cuser_id`); | |||
| ALTER TABLE `mallink`.`wx_member_card_22` | |||
| ADD COLUMN `cuser_id` bigint(20) AFTER `user_id`, | |||
| ADD INDEX `cuser_id`(`cuser_id`); | |||
| ALTER TABLE `mallink`.`wx_member_card_23` | |||
| ADD COLUMN `cuser_id` bigint(20) AFTER `user_id`, | |||
| ADD INDEX `cuser_id`(`cuser_id`); | |||
| ALTER TABLE `mallink`.`wx_member_card_24` | |||
| ADD COLUMN `cuser_id` bigint(20) AFTER `user_id`, | |||
| ADD INDEX `cuser_id`(`cuser_id`); | |||
| ALTER TABLE `mallink`.`wx_member_card_25` | |||
| ADD COLUMN `cuser_id` bigint(20) AFTER `user_id`, | |||
| ADD INDEX `cuser_id`(`cuser_id`); | |||
| ALTER TABLE `mallink`.`wx_member_card_26` | |||
| ADD COLUMN `cuser_id` bigint(20) AFTER `user_id`, | |||
| ADD INDEX `cuser_id`(`cuser_id`); | |||
| ALTER TABLE `mallink`.`wx_member_card_27` | |||
| ADD COLUMN `cuser_id` bigint(20) AFTER `user_id`, | |||
| ADD INDEX `cuser_id`(`cuser_id`); | |||
| ALTER TABLE `mallink`.`wx_member_card_28` | |||
| ADD COLUMN `cuser_id` bigint(20) AFTER `user_id`, | |||
| ADD INDEX `cuser_id`(`cuser_id`); | |||
| ALTER TABLE `mallink`.`wx_member_card_29` | |||
| ADD COLUMN `cuser_id` bigint(20) AFTER `user_id`, | |||
| ADD INDEX `cuser_id`(`cuser_id`); | |||
| ALTER TABLE `mallink`.`wx_member_card_30` | |||
| ADD COLUMN `cuser_id` bigint(20) AFTER `user_id`, | |||
| ADD INDEX `cuser_id`(`cuser_id`); | |||
| ALTER TABLE `mallink`.`wx_member_card_31` | |||
| ADD COLUMN `cuser_id` bigint(20) AFTER `user_id`, | |||
| ADD INDEX `cuser_id`(`cuser_id`); | |||
| ALTER TABLE `mallink`.`wx_member_card_32` | |||
| ADD COLUMN `cuser_id` bigint(20) AFTER `user_id`, | |||
| ADD INDEX `cuser_id`(`cuser_id`); | |||
| ALTER TABLE `mallink`.`wx_member_card_33` | |||
| ADD COLUMN `cuser_id` bigint(20) AFTER `user_id`, | |||
| ADD INDEX `cuser_id`(`cuser_id`); | |||
| ALTER TABLE `mallink`.`wx_member_card_34` | |||
| ADD COLUMN `cuser_id` bigint(20) AFTER `user_id`, | |||
| ADD INDEX `cuser_id`(`cuser_id`); | |||
| ALTER TABLE `mallink`.`wx_member_card_35` | |||
| ADD COLUMN `cuser_id` bigint(20) AFTER `user_id`, | |||
| ADD INDEX `cuser_id`(`cuser_id`); | |||
| ALTER TABLE `mallink`.`wx_member_card_36` | |||
| ADD COLUMN `cuser_id` bigint(20) AFTER `user_id`, | |||
| ADD INDEX `cuser_id`(`cuser_id`); | |||
| ALTER TABLE `mallink`.`wx_member_card_37` | |||
| ADD COLUMN `cuser_id` bigint(20) AFTER `user_id`, | |||
| ADD INDEX `cuser_id`(`cuser_id`); | |||
| ALTER TABLE `mallink`.`wx_member_card_38` | |||
| ADD COLUMN `cuser_id` bigint(20) AFTER `user_id`, | |||
| ADD INDEX `cuser_id`(`cuser_id`); | |||
| ALTER TABLE `mallink`.`wx_member_card_39` | |||
| ADD COLUMN `cuser_id` bigint(20) AFTER `user_id`, | |||
| ADD INDEX `cuser_id`(`cuser_id`); | |||
| ALTER TABLE `mallink`.`wx_member_card_40` | |||
| ADD COLUMN `cuser_id` bigint(20) AFTER `user_id`, | |||
| ADD INDEX `cuser_id`(`cuser_id`); | |||
| ALTER TABLE `mallink`.`wx_member_card_41` | |||
| ADD COLUMN `cuser_id` bigint(20) AFTER `user_id`, | |||
| ADD INDEX `cuser_id`(`cuser_id`); | |||
| ALTER TABLE `mallink`.`wx_member_card_42` | |||
| ADD COLUMN `cuser_id` bigint(20) AFTER `user_id`, | |||
| ADD INDEX `cuser_id`(`cuser_id`); | |||
| ALTER TABLE `mallink`.`wx_member_card_43` | |||
| ADD COLUMN `cuser_id` bigint(20) AFTER `user_id`, | |||
| ADD INDEX `cuser_id`(`cuser_id`); | |||
| ALTER TABLE `mallink`.`wx_member_card_44` | |||
| ADD COLUMN `cuser_id` bigint(20) AFTER `user_id`, | |||
| ADD INDEX `cuser_id`(`cuser_id`); | |||
| ALTER TABLE `mallink`.`wx_member_card_45` | |||
| ADD COLUMN `cuser_id` bigint(20) AFTER `user_id`, | |||
| ADD INDEX `cuser_id`(`cuser_id`); | |||
| ALTER TABLE `mallink`.`wx_member_card_46` | |||
| ADD COLUMN `cuser_id` bigint(20) AFTER `user_id`, | |||
| ADD INDEX `cuser_id`(`cuser_id`); | |||
| ALTER TABLE `mallink`.`wx_member_card_47` | |||
| ADD COLUMN `cuser_id` bigint(20) AFTER `user_id`, | |||
| ADD INDEX `cuser_id`(`cuser_id`); | |||
| ALTER TABLE `mallink`.`wx_member_card_48` | |||
| ADD COLUMN `cuser_id` bigint(20) AFTER `user_id`, | |||
| ADD INDEX `cuser_id`(`cuser_id`); | |||
| ALTER TABLE `mallink`.`wx_member_card_49` | |||
| ADD COLUMN `cuser_id` bigint(20) AFTER `user_id`, | |||
| ADD INDEX `cuser_id`(`cuser_id`); | |||
| ALTER TABLE `mallink`.`wx_member_card_50` | |||
| ADD COLUMN `cuser_id` bigint(20) AFTER `user_id`, | |||
| ADD INDEX `cuser_id`(`cuser_id`); | |||
| ALTER TABLE `mallink`.`wx_member_card_51` | |||
| ADD COLUMN `cuser_id` bigint(20) AFTER `user_id`, | |||
| ADD INDEX `cuser_id`(`cuser_id`); | |||
| ALTER TABLE `mallink`.`wx_member_card_52` | |||
| ADD COLUMN `cuser_id` bigint(20) AFTER `user_id`, | |||
| ADD INDEX `cuser_id`(`cuser_id`); | |||
| ALTER TABLE `mallink`.`wx_member_card_53` | |||
| ADD COLUMN `cuser_id` bigint(20) AFTER `user_id`, | |||
| ADD INDEX `cuser_id`(`cuser_id`); | |||
| ALTER TABLE `mallink`.`wx_member_card_54` | |||
| ADD COLUMN `cuser_id` bigint(20) AFTER `user_id`, | |||
| ADD INDEX `cuser_id`(`cuser_id`); | |||
| ALTER TABLE `mallink`.`wx_member_card_55` | |||
| ADD COLUMN `cuser_id` bigint(20) AFTER `user_id`, | |||
| ADD INDEX `cuser_id`(`cuser_id`); | |||
| ALTER TABLE `mallink`.`wx_member_card_56` | |||
| ADD COLUMN `cuser_id` bigint(20) AFTER `user_id`, | |||
| ADD INDEX `cuser_id`(`cuser_id`); | |||
| ALTER TABLE `mallink`.`wx_member_card_57` | |||
| ADD COLUMN `cuser_id` bigint(20) AFTER `user_id`, | |||
| ADD INDEX `cuser_id`(`cuser_id`); | |||
| ALTER TABLE `mallink`.`wx_member_card_58` | |||
| ADD COLUMN `cuser_id` bigint(20) AFTER `user_id`, | |||
| ADD INDEX `cuser_id`(`cuser_id`); | |||
| ALTER TABLE `mallink`.`wx_member_card_59` | |||
| ADD COLUMN `cuser_id` bigint(20) AFTER `user_id`, | |||
| ADD INDEX `cuser_id`(`cuser_id`); | |||
| ALTER TABLE `mallink`.`wx_member_card_60` | |||
| ADD COLUMN `cuser_id` bigint(20) AFTER `user_id`, | |||
| ADD INDEX `cuser_id`(`cuser_id`); | |||
| ALTER TABLE `mallink`.`wx_member_card_61` | |||
| ADD COLUMN `cuser_id` bigint(20) AFTER `user_id`, | |||
| ADD INDEX `cuser_id`(`cuser_id`); | |||
| ALTER TABLE `mallink`.`wx_member_card_62` | |||
| ADD COLUMN `cuser_id` bigint(20) AFTER `user_id`, | |||
| ADD INDEX `cuser_id`(`cuser_id`); | |||
| ALTER TABLE `mallink`.`wx_member_card_63` | |||
| ADD COLUMN `cuser_id` bigint(20) AFTER `user_id`, | |||
| ADD INDEX `cuser_id`(`cuser_id`); | |||
| ALTER TABLE `mallink`.`wx_member_card_64` | |||
| ADD COLUMN `cuser_id` bigint(20) AFTER `user_id`, | |||
| ADD INDEX `cuser_id`(`cuser_id`); | |||
| ALTER TABLE `mallink`.`wx_member_card_65` | |||
| ADD COLUMN `cuser_id` bigint(20) AFTER `user_id`, | |||
| ADD INDEX `cuser_id`(`cuser_id`); | |||
| ALTER TABLE `mallink`.`wx_member_card_66` | |||
| ADD COLUMN `cuser_id` bigint(20) AFTER `user_id`, | |||
| ADD INDEX `cuser_id`(`cuser_id`); | |||
| ALTER TABLE `mallink`.`wx_member_card_67` | |||
| ADD COLUMN `cuser_id` bigint(20) AFTER `user_id`, | |||
| ADD INDEX `cuser_id`(`cuser_id`); | |||
| ALTER TABLE `mallink`.`wx_member_card_68` | |||
| ADD COLUMN `cuser_id` bigint(20) AFTER `user_id`, | |||
| ADD INDEX `cuser_id`(`cuser_id`); | |||
| ALTER TABLE `mallink`.`wx_member_card_69` | |||
| ADD COLUMN `cuser_id` bigint(20) AFTER `user_id`, | |||
| ADD INDEX `cuser_id`(`cuser_id`); | |||
| ALTER TABLE `mallink`.`wx_member_card_70` | |||
| ADD COLUMN `cuser_id` bigint(20) AFTER `user_id`, | |||
| ADD INDEX `cuser_id`(`cuser_id`); | |||
| ALTER TABLE `mallink`.`wx_member_card_71` | |||
| ADD COLUMN `cuser_id` bigint(20) AFTER `user_id`, | |||
| ADD INDEX `cuser_id`(`cuser_id`); | |||
| ALTER TABLE `mallink`.`wx_member_card_72` | |||
| ADD COLUMN `cuser_id` bigint(20) AFTER `user_id`, | |||
| ADD INDEX `cuser_id`(`cuser_id`); | |||
| ALTER TABLE `mallink`.`wx_member_card_73` | |||
| ADD COLUMN `cuser_id` bigint(20) AFTER `user_id`, | |||
| ADD INDEX `cuser_id`(`cuser_id`); | |||
| ALTER TABLE `mallink`.`wx_member_card_74` | |||
| ADD COLUMN `cuser_id` bigint(20) AFTER `user_id`, | |||
| ADD INDEX `cuser_id`(`cuser_id`); | |||
| ALTER TABLE `mallink`.`wx_member_card_75` | |||
| ADD COLUMN `cuser_id` bigint(20) AFTER `user_id`, | |||
| ADD INDEX `cuser_id`(`cuser_id`); | |||
| ALTER TABLE `mallink`.`wx_member_card_76` | |||
| ADD COLUMN `cuser_id` bigint(20) AFTER `user_id`, | |||
| ADD INDEX `cuser_id`(`cuser_id`); | |||
| ALTER TABLE `mallink`.`wx_member_card_77` | |||
| ADD COLUMN `cuser_id` bigint(20) AFTER `user_id`, | |||
| ADD INDEX `cuser_id`(`cuser_id`); | |||
| ALTER TABLE `mallink`.`wx_member_card_78` | |||
| ADD COLUMN `cuser_id` bigint(20) AFTER `user_id`, | |||
| ADD INDEX `cuser_id`(`cuser_id`); | |||
| ALTER TABLE `mallink`.`wx_member_card_79` | |||
| ADD COLUMN `cuser_id` bigint(20) AFTER `user_id`, | |||
| ADD INDEX `cuser_id`(`cuser_id`); | |||
| ALTER TABLE `mallink`.`wx_member_card_80` | |||
| ADD COLUMN `cuser_id` bigint(20) AFTER `user_id`, | |||
| ADD INDEX `cuser_id`(`cuser_id`); | |||
| ALTER TABLE `mallink`.`wx_member_card_81` | |||
| ADD COLUMN `cuser_id` bigint(20) AFTER `user_id`, | |||
| ADD INDEX `cuser_id`(`cuser_id`); | |||
| ALTER TABLE `mallink`.`wx_member_card_82` | |||
| ADD COLUMN `cuser_id` bigint(20) AFTER `user_id`, | |||
| ADD INDEX `cuser_id`(`cuser_id`); | |||
| ALTER TABLE `mallink`.`wx_member_card_83` | |||
| ADD COLUMN `cuser_id` bigint(20) AFTER `user_id`, | |||
| ADD INDEX `cuser_id`(`cuser_id`); | |||
| ALTER TABLE `mallink`.`wx_member_card_84` | |||
| ADD COLUMN `cuser_id` bigint(20) AFTER `user_id`, | |||
| ADD INDEX `cuser_id`(`cuser_id`); | |||
| ALTER TABLE `mallink`.`wx_member_card_85` | |||
| ADD COLUMN `cuser_id` bigint(20) AFTER `user_id`, | |||
| ADD INDEX `cuser_id`(`cuser_id`); | |||
| ALTER TABLE `mallink`.`wx_member_card_86` | |||
| ADD COLUMN `cuser_id` bigint(20) AFTER `user_id`, | |||
| ADD INDEX `cuser_id`(`cuser_id`); | |||
| ALTER TABLE `mallink`.`wx_member_card_87` | |||
| ADD COLUMN `cuser_id` bigint(20) AFTER `user_id`, | |||
| ADD INDEX `cuser_id`(`cuser_id`); | |||
| ALTER TABLE `mallink`.`wx_member_card_88` | |||
| ADD COLUMN `cuser_id` bigint(20) AFTER `user_id`, | |||
| ADD INDEX `cuser_id`(`cuser_id`); | |||
| ALTER TABLE `mallink`.`wx_member_card_89` | |||
| ADD COLUMN `cuser_id` bigint(20) AFTER `user_id`, | |||
| ADD INDEX `cuser_id`(`cuser_id`); | |||
| ALTER TABLE `mallink`.`wx_member_card_90` | |||
| ADD COLUMN `cuser_id` bigint(20) AFTER `user_id`, | |||
| ADD INDEX `cuser_id`(`cuser_id`); | |||
| ALTER TABLE `mallink`.`wx_member_card_91` | |||
| ADD COLUMN `cuser_id` bigint(20) AFTER `user_id`, | |||
| ADD INDEX `cuser_id`(`cuser_id`); | |||
| ALTER TABLE `mallink`.`wx_member_card_92` | |||
| ADD COLUMN `cuser_id` bigint(20) AFTER `user_id`, | |||
| ADD INDEX `cuser_id`(`cuser_id`); | |||
| ALTER TABLE `mallink`.`wx_member_card_93` | |||
| ADD COLUMN `cuser_id` bigint(20) AFTER `user_id`, | |||
| ADD INDEX `cuser_id`(`cuser_id`); | |||
| ALTER TABLE `mallink`.`wx_member_card_94` | |||
| ADD COLUMN `cuser_id` bigint(20) AFTER `user_id`, | |||
| ADD INDEX `cuser_id`(`cuser_id`); | |||
| ALTER TABLE `mallink`.`wx_member_card_95` | |||
| ADD COLUMN `cuser_id` bigint(20) AFTER `user_id`, | |||
| ADD INDEX `cuser_id`(`cuser_id`); | |||
| ALTER TABLE `mallink`.`wx_member_card_96` | |||
| ADD COLUMN `cuser_id` bigint(20) AFTER `user_id`, | |||
| ADD INDEX `cuser_id`(`cuser_id`); | |||
| ALTER TABLE `mallink`.`wx_member_card_97` | |||
| ADD COLUMN `cuser_id` bigint(20) AFTER `user_id`, | |||
| ADD INDEX `cuser_id`(`cuser_id`); | |||
| ALTER TABLE `mallink`.`wx_member_card_98` | |||
| ADD COLUMN `cuser_id` bigint(20) AFTER `user_id`, | |||
| ADD INDEX `cuser_id`(`cuser_id`); | |||
| ALTER TABLE `mallink`.`wx_member_card_99` | |||
| ADD COLUMN `cuser_id` bigint(20) AFTER `user_id`, | |||
| ADD INDEX `cuser_id`(`cuser_id`); | |||
| @@ -0,0 +1,803 @@ | |||
| UPDATE `tt_poi_take_rate_0` SET `douyin_id` = CONCAT('["',douyin_id,'"]') WHERE `douyin_id` is not null; | |||
| UPDATE `tt_poi_take_rate_1` SET `douyin_id` = CONCAT('["',douyin_id,'"]') WHERE `douyin_id` is not null; | |||
| UPDATE `tt_poi_take_rate_2` SET `douyin_id` = CONCAT('["',douyin_id,'"]') WHERE `douyin_id` is not null; | |||
| UPDATE `tt_poi_take_rate_3` SET `douyin_id` = CONCAT('["',douyin_id,'"]') WHERE `douyin_id` is not null; | |||
| UPDATE `tt_poi_take_rate_4` SET `douyin_id` = CONCAT('["',douyin_id,'"]') WHERE `douyin_id` is not null; | |||
| UPDATE `tt_poi_take_rate_5` SET `douyin_id` = CONCAT('["',douyin_id,'"]') WHERE `douyin_id` is not null; | |||
| UPDATE `tt_poi_take_rate_6` SET `douyin_id` = CONCAT('["',douyin_id,'"]') WHERE `douyin_id` is not null; | |||
| UPDATE `tt_poi_take_rate_7` SET `douyin_id` = CONCAT('["',douyin_id,'"]') WHERE `douyin_id` is not null; | |||
| UPDATE `tt_poi_take_rate_8` SET `douyin_id` = CONCAT('["',douyin_id,'"]') WHERE `douyin_id` is not null; | |||
| UPDATE `tt_poi_take_rate_9` SET `douyin_id` = CONCAT('["',douyin_id,'"]') WHERE `douyin_id` is not null; | |||
| UPDATE `tt_poi_take_rate_10` SET `douyin_id` = CONCAT('["',douyin_id,'"]') WHERE `douyin_id` is not null; | |||
| UPDATE `tt_poi_take_rate_11` SET `douyin_id` = CONCAT('["',douyin_id,'"]') WHERE `douyin_id` is not null; | |||
| UPDATE `tt_poi_take_rate_12` SET `douyin_id` = CONCAT('["',douyin_id,'"]') WHERE `douyin_id` is not null; | |||
| UPDATE `tt_poi_take_rate_13` SET `douyin_id` = CONCAT('["',douyin_id,'"]') WHERE `douyin_id` is not null; | |||
| UPDATE `tt_poi_take_rate_14` SET `douyin_id` = CONCAT('["',douyin_id,'"]') WHERE `douyin_id` is not null; | |||
| UPDATE `tt_poi_take_rate_15` SET `douyin_id` = CONCAT('["',douyin_id,'"]') WHERE `douyin_id` is not null; | |||
| UPDATE `tt_poi_take_rate_16` SET `douyin_id` = CONCAT('["',douyin_id,'"]') WHERE `douyin_id` is not null; | |||
| UPDATE `tt_poi_take_rate_17` SET `douyin_id` = CONCAT('["',douyin_id,'"]') WHERE `douyin_id` is not null; | |||
| UPDATE `tt_poi_take_rate_18` SET `douyin_id` = CONCAT('["',douyin_id,'"]') WHERE `douyin_id` is not null; | |||
| UPDATE `tt_poi_take_rate_19` SET `douyin_id` = CONCAT('["',douyin_id,'"]') WHERE `douyin_id` is not null; | |||
| UPDATE `tt_poi_take_rate_20` SET `douyin_id` = CONCAT('["',douyin_id,'"]') WHERE `douyin_id` is not null; | |||
| UPDATE `tt_poi_take_rate_21` SET `douyin_id` = CONCAT('["',douyin_id,'"]') WHERE `douyin_id` is not null; | |||
| UPDATE `tt_poi_take_rate_22` SET `douyin_id` = CONCAT('["',douyin_id,'"]') WHERE `douyin_id` is not null; | |||
| UPDATE `tt_poi_take_rate_23` SET `douyin_id` = CONCAT('["',douyin_id,'"]') WHERE `douyin_id` is not null; | |||
| UPDATE `tt_poi_take_rate_24` SET `douyin_id` = CONCAT('["',douyin_id,'"]') WHERE `douyin_id` is not null; | |||
| UPDATE `tt_poi_take_rate_25` SET `douyin_id` = CONCAT('["',douyin_id,'"]') WHERE `douyin_id` is not null; | |||
| UPDATE `tt_poi_take_rate_26` SET `douyin_id` = CONCAT('["',douyin_id,'"]') WHERE `douyin_id` is not null; | |||
| UPDATE `tt_poi_take_rate_27` SET `douyin_id` = CONCAT('["',douyin_id,'"]') WHERE `douyin_id` is not null; | |||
| UPDATE `tt_poi_take_rate_28` SET `douyin_id` = CONCAT('["',douyin_id,'"]') WHERE `douyin_id` is not null; | |||
| UPDATE `tt_poi_take_rate_29` SET `douyin_id` = CONCAT('["',douyin_id,'"]') WHERE `douyin_id` is not null; | |||
| UPDATE `tt_poi_take_rate_30` SET `douyin_id` = CONCAT('["',douyin_id,'"]') WHERE `douyin_id` is not null; | |||
| UPDATE `tt_poi_take_rate_31` SET `douyin_id` = CONCAT('["',douyin_id,'"]') WHERE `douyin_id` is not null; | |||
| UPDATE `tt_poi_take_rate_32` SET `douyin_id` = CONCAT('["',douyin_id,'"]') WHERE `douyin_id` is not null; | |||
| UPDATE `tt_poi_take_rate_33` SET `douyin_id` = CONCAT('["',douyin_id,'"]') WHERE `douyin_id` is not null; | |||
| UPDATE `tt_poi_take_rate_34` SET `douyin_id` = CONCAT('["',douyin_id,'"]') WHERE `douyin_id` is not null; | |||
| UPDATE `tt_poi_take_rate_35` SET `douyin_id` = CONCAT('["',douyin_id,'"]') WHERE `douyin_id` is not null; | |||
| UPDATE `tt_poi_take_rate_36` SET `douyin_id` = CONCAT('["',douyin_id,'"]') WHERE `douyin_id` is not null; | |||
| UPDATE `tt_poi_take_rate_37` SET `douyin_id` = CONCAT('["',douyin_id,'"]') WHERE `douyin_id` is not null; | |||
| UPDATE `tt_poi_take_rate_38` SET `douyin_id` = CONCAT('["',douyin_id,'"]') WHERE `douyin_id` is not null; | |||
| UPDATE `tt_poi_take_rate_39` SET `douyin_id` = CONCAT('["',douyin_id,'"]') WHERE `douyin_id` is not null; | |||
| UPDATE `tt_poi_take_rate_40` SET `douyin_id` = CONCAT('["',douyin_id,'"]') WHERE `douyin_id` is not null; | |||
| UPDATE `tt_poi_take_rate_41` SET `douyin_id` = CONCAT('["',douyin_id,'"]') WHERE `douyin_id` is not null; | |||
| UPDATE `tt_poi_take_rate_42` SET `douyin_id` = CONCAT('["',douyin_id,'"]') WHERE `douyin_id` is not null; | |||
| UPDATE `tt_poi_take_rate_43` SET `douyin_id` = CONCAT('["',douyin_id,'"]') WHERE `douyin_id` is not null; | |||
| UPDATE `tt_poi_take_rate_44` SET `douyin_id` = CONCAT('["',douyin_id,'"]') WHERE `douyin_id` is not null; | |||
| UPDATE `tt_poi_take_rate_45` SET `douyin_id` = CONCAT('["',douyin_id,'"]') WHERE `douyin_id` is not null; | |||
| UPDATE `tt_poi_take_rate_46` SET `douyin_id` = CONCAT('["',douyin_id,'"]') WHERE `douyin_id` is not null; | |||
| UPDATE `tt_poi_take_rate_47` SET `douyin_id` = CONCAT('["',douyin_id,'"]') WHERE `douyin_id` is not null; | |||
| UPDATE `tt_poi_take_rate_48` SET `douyin_id` = CONCAT('["',douyin_id,'"]') WHERE `douyin_id` is not null; | |||
| UPDATE `tt_poi_take_rate_49` SET `douyin_id` = CONCAT('["',douyin_id,'"]') WHERE `douyin_id` is not null; | |||
| UPDATE `tt_poi_take_rate_50` SET `douyin_id` = CONCAT('["',douyin_id,'"]') WHERE `douyin_id` is not null; | |||
| UPDATE `tt_poi_take_rate_51` SET `douyin_id` = CONCAT('["',douyin_id,'"]') WHERE `douyin_id` is not null; | |||
| UPDATE `tt_poi_take_rate_52` SET `douyin_id` = CONCAT('["',douyin_id,'"]') WHERE `douyin_id` is not null; | |||
| UPDATE `tt_poi_take_rate_53` SET `douyin_id` = CONCAT('["',douyin_id,'"]') WHERE `douyin_id` is not null; | |||
| UPDATE `tt_poi_take_rate_54` SET `douyin_id` = CONCAT('["',douyin_id,'"]') WHERE `douyin_id` is not null; | |||
| UPDATE `tt_poi_take_rate_55` SET `douyin_id` = CONCAT('["',douyin_id,'"]') WHERE `douyin_id` is not null; | |||
| UPDATE `tt_poi_take_rate_56` SET `douyin_id` = CONCAT('["',douyin_id,'"]') WHERE `douyin_id` is not null; | |||
| UPDATE `tt_poi_take_rate_57` SET `douyin_id` = CONCAT('["',douyin_id,'"]') WHERE `douyin_id` is not null; | |||
| UPDATE `tt_poi_take_rate_58` SET `douyin_id` = CONCAT('["',douyin_id,'"]') WHERE `douyin_id` is not null; | |||
| UPDATE `tt_poi_take_rate_59` SET `douyin_id` = CONCAT('["',douyin_id,'"]') WHERE `douyin_id` is not null; | |||
| UPDATE `tt_poi_take_rate_60` SET `douyin_id` = CONCAT('["',douyin_id,'"]') WHERE `douyin_id` is not null; | |||
| UPDATE `tt_poi_take_rate_61` SET `douyin_id` = CONCAT('["',douyin_id,'"]') WHERE `douyin_id` is not null; | |||
| UPDATE `tt_poi_take_rate_62` SET `douyin_id` = CONCAT('["',douyin_id,'"]') WHERE `douyin_id` is not null; | |||
| UPDATE `tt_poi_take_rate_63` SET `douyin_id` = CONCAT('["',douyin_id,'"]') WHERE `douyin_id` is not null; | |||
| UPDATE `tt_poi_take_rate_64` SET `douyin_id` = CONCAT('["',douyin_id,'"]') WHERE `douyin_id` is not null; | |||
| UPDATE `tt_poi_take_rate_65` SET `douyin_id` = CONCAT('["',douyin_id,'"]') WHERE `douyin_id` is not null; | |||
| UPDATE `tt_poi_take_rate_66` SET `douyin_id` = CONCAT('["',douyin_id,'"]') WHERE `douyin_id` is not null; | |||
| UPDATE `tt_poi_take_rate_67` SET `douyin_id` = CONCAT('["',douyin_id,'"]') WHERE `douyin_id` is not null; | |||
| UPDATE `tt_poi_take_rate_68` SET `douyin_id` = CONCAT('["',douyin_id,'"]') WHERE `douyin_id` is not null; | |||
| UPDATE `tt_poi_take_rate_69` SET `douyin_id` = CONCAT('["',douyin_id,'"]') WHERE `douyin_id` is not null; | |||
| UPDATE `tt_poi_take_rate_70` SET `douyin_id` = CONCAT('["',douyin_id,'"]') WHERE `douyin_id` is not null; | |||
| UPDATE `tt_poi_take_rate_71` SET `douyin_id` = CONCAT('["',douyin_id,'"]') WHERE `douyin_id` is not null; | |||
| UPDATE `tt_poi_take_rate_72` SET `douyin_id` = CONCAT('["',douyin_id,'"]') WHERE `douyin_id` is not null; | |||
| UPDATE `tt_poi_take_rate_73` SET `douyin_id` = CONCAT('["',douyin_id,'"]') WHERE `douyin_id` is not null; | |||
| UPDATE `tt_poi_take_rate_74` SET `douyin_id` = CONCAT('["',douyin_id,'"]') WHERE `douyin_id` is not null; | |||
| UPDATE `tt_poi_take_rate_75` SET `douyin_id` = CONCAT('["',douyin_id,'"]') WHERE `douyin_id` is not null; | |||
| UPDATE `tt_poi_take_rate_76` SET `douyin_id` = CONCAT('["',douyin_id,'"]') WHERE `douyin_id` is not null; | |||
| UPDATE `tt_poi_take_rate_77` SET `douyin_id` = CONCAT('["',douyin_id,'"]') WHERE `douyin_id` is not null; | |||
| UPDATE `tt_poi_take_rate_78` SET `douyin_id` = CONCAT('["',douyin_id,'"]') WHERE `douyin_id` is not null; | |||
| UPDATE `tt_poi_take_rate_79` SET `douyin_id` = CONCAT('["',douyin_id,'"]') WHERE `douyin_id` is not null; | |||
| UPDATE `tt_poi_take_rate_80` SET `douyin_id` = CONCAT('["',douyin_id,'"]') WHERE `douyin_id` is not null; | |||
| UPDATE `tt_poi_take_rate_81` SET `douyin_id` = CONCAT('["',douyin_id,'"]') WHERE `douyin_id` is not null; | |||
| UPDATE `tt_poi_take_rate_82` SET `douyin_id` = CONCAT('["',douyin_id,'"]') WHERE `douyin_id` is not null; | |||
| UPDATE `tt_poi_take_rate_83` SET `douyin_id` = CONCAT('["',douyin_id,'"]') WHERE `douyin_id` is not null; | |||
| UPDATE `tt_poi_take_rate_84` SET `douyin_id` = CONCAT('["',douyin_id,'"]') WHERE `douyin_id` is not null; | |||
| UPDATE `tt_poi_take_rate_85` SET `douyin_id` = CONCAT('["',douyin_id,'"]') WHERE `douyin_id` is not null; | |||
| UPDATE `tt_poi_take_rate_86` SET `douyin_id` = CONCAT('["',douyin_id,'"]') WHERE `douyin_id` is not null; | |||
| UPDATE `tt_poi_take_rate_87` SET `douyin_id` = CONCAT('["',douyin_id,'"]') WHERE `douyin_id` is not null; | |||
| UPDATE `tt_poi_take_rate_88` SET `douyin_id` = CONCAT('["',douyin_id,'"]') WHERE `douyin_id` is not null; | |||
| UPDATE `tt_poi_take_rate_89` SET `douyin_id` = CONCAT('["',douyin_id,'"]') WHERE `douyin_id` is not null; | |||
| UPDATE `tt_poi_take_rate_90` SET `douyin_id` = CONCAT('["',douyin_id,'"]') WHERE `douyin_id` is not null; | |||
| UPDATE `tt_poi_take_rate_91` SET `douyin_id` = CONCAT('["',douyin_id,'"]') WHERE `douyin_id` is not null; | |||
| UPDATE `tt_poi_take_rate_92` SET `douyin_id` = CONCAT('["',douyin_id,'"]') WHERE `douyin_id` is not null; | |||
| UPDATE `tt_poi_take_rate_93` SET `douyin_id` = CONCAT('["',douyin_id,'"]') WHERE `douyin_id` is not null; | |||
| UPDATE `tt_poi_take_rate_94` SET `douyin_id` = CONCAT('["',douyin_id,'"]') WHERE `douyin_id` is not null; | |||
| UPDATE `tt_poi_take_rate_95` SET `douyin_id` = CONCAT('["',douyin_id,'"]') WHERE `douyin_id` is not null; | |||
| UPDATE `tt_poi_take_rate_96` SET `douyin_id` = CONCAT('["',douyin_id,'"]') WHERE `douyin_id` is not null; | |||
| UPDATE `tt_poi_take_rate_97` SET `douyin_id` = CONCAT('["',douyin_id,'"]') WHERE `douyin_id` is not null; | |||
| UPDATE `tt_poi_take_rate_98` SET `douyin_id` = CONCAT('["',douyin_id,'"]') WHERE `douyin_id` is not null; | |||
| UPDATE `tt_poi_take_rate_99` SET `douyin_id` = CONCAT('["',douyin_id,'"]') WHERE `douyin_id` is not null; | |||
| ALTER TABLE `mallink`.`tt_poi_take_rate_0` | |||
| ADD COLUMN `merchant_phone` varchar(20) COMMENT '计划联系人手机号' AFTER `name`, | |||
| MODIFY COLUMN `douyin_id` json COMMENT '抖音号' AFTER `content_type`, | |||
| ADD COLUMN `douyin_id_status` json COMMENT '达人履约状态' AFTER `douyin_id`, | |||
| ADD COLUMN `commission_duration` bigint(20) COMMENT '佣金有效期,单位是秒' AFTER `end_time`, | |||
| DROP INDEX `tcd_unique`, | |||
| ADD INDEX `tcd_unique`(`tenant_id`, `coupon_id`) USING BTREE; | |||
| ALTER TABLE `mallink`.`tt_poi_take_rate_1` | |||
| ADD COLUMN `merchant_phone` varchar(20) COMMENT '计划联系人手机号' AFTER `name`, | |||
| MODIFY COLUMN `douyin_id` json COMMENT '抖音号' AFTER `content_type`, | |||
| ADD COLUMN `douyin_id_status` json COMMENT '达人履约状态' AFTER `douyin_id`, | |||
| ADD COLUMN `commission_duration` bigint(20) COMMENT '佣金有效期,单位是秒' AFTER `end_time`, | |||
| DROP INDEX `tcd_unique`, | |||
| ADD INDEX `tcd_unique`(`tenant_id`, `coupon_id`) USING BTREE; | |||
| ALTER TABLE `mallink`.`tt_poi_take_rate_2` | |||
| ADD COLUMN `merchant_phone` varchar(20) COMMENT '计划联系人手机号' AFTER `name`, | |||
| MODIFY COLUMN `douyin_id` json COMMENT '抖音号' AFTER `content_type`, | |||
| ADD COLUMN `douyin_id_status` json COMMENT '达人履约状态' AFTER `douyin_id`, | |||
| ADD COLUMN `commission_duration` bigint(20) COMMENT '佣金有效期,单位是秒' AFTER `end_time`, | |||
| DROP INDEX `tcd_unique`, | |||
| ADD INDEX `tcd_unique`(`tenant_id`, `coupon_id`) USING BTREE; | |||
| ALTER TABLE `mallink`.`tt_poi_take_rate_3` | |||
| ADD COLUMN `merchant_phone` varchar(20) COMMENT '计划联系人手机号' AFTER `name`, | |||
| MODIFY COLUMN `douyin_id` json COMMENT '抖音号' AFTER `content_type`, | |||
| ADD COLUMN `douyin_id_status` json COMMENT '达人履约状态' AFTER `douyin_id`, | |||
| ADD COLUMN `commission_duration` bigint(20) COMMENT '佣金有效期,单位是秒' AFTER `end_time`, | |||
| DROP INDEX `tcd_unique`, | |||
| ADD INDEX `tcd_unique`(`tenant_id`, `coupon_id`) USING BTREE; | |||
| ALTER TABLE `mallink`.`tt_poi_take_rate_4` | |||
| ADD COLUMN `merchant_phone` varchar(20) COMMENT '计划联系人手机号' AFTER `name`, | |||
| MODIFY COLUMN `douyin_id` json COMMENT '抖音号' AFTER `content_type`, | |||
| ADD COLUMN `douyin_id_status` json COMMENT '达人履约状态' AFTER `douyin_id`, | |||
| ADD COLUMN `commission_duration` bigint(20) COMMENT '佣金有效期,单位是秒' AFTER `end_time`, | |||
| DROP INDEX `tcd_unique`, | |||
| ADD INDEX `tcd_unique`(`tenant_id`, `coupon_id`) USING BTREE; | |||
| ALTER TABLE `mallink`.`tt_poi_take_rate_5` | |||
| ADD COLUMN `merchant_phone` varchar(20) COMMENT '计划联系人手机号' AFTER `name`, | |||
| MODIFY COLUMN `douyin_id` json COMMENT '抖音号' AFTER `content_type`, | |||
| ADD COLUMN `douyin_id_status` json COMMENT '达人履约状态' AFTER `douyin_id`, | |||
| ADD COLUMN `commission_duration` bigint(20) COMMENT '佣金有效期,单位是秒' AFTER `end_time`, | |||
| DROP INDEX `tcd_unique`, | |||
| ADD INDEX `tcd_unique`(`tenant_id`, `coupon_id`) USING BTREE; | |||
| ALTER TABLE `mallink`.`tt_poi_take_rate_6` | |||
| ADD COLUMN `merchant_phone` varchar(20) COMMENT '计划联系人手机号' AFTER `name`, | |||
| MODIFY COLUMN `douyin_id` json COMMENT '抖音号' AFTER `content_type`, | |||
| ADD COLUMN `douyin_id_status` json COMMENT '达人履约状态' AFTER `douyin_id`, | |||
| ADD COLUMN `commission_duration` bigint(20) COMMENT '佣金有效期,单位是秒' AFTER `end_time`, | |||
| DROP INDEX `tcd_unique`, | |||
| ADD INDEX `tcd_unique`(`tenant_id`, `coupon_id`) USING BTREE; | |||
| ALTER TABLE `mallink`.`tt_poi_take_rate_7` | |||
| ADD COLUMN `merchant_phone` varchar(20) COMMENT '计划联系人手机号' AFTER `name`, | |||
| MODIFY COLUMN `douyin_id` json COMMENT '抖音号' AFTER `content_type`, | |||
| ADD COLUMN `douyin_id_status` json COMMENT '达人履约状态' AFTER `douyin_id`, | |||
| ADD COLUMN `commission_duration` bigint(20) COMMENT '佣金有效期,单位是秒' AFTER `end_time`, | |||
| DROP INDEX `tcd_unique`, | |||
| ADD INDEX `tcd_unique`(`tenant_id`, `coupon_id`) USING BTREE; | |||
| ALTER TABLE `mallink`.`tt_poi_take_rate_8` | |||
| ADD COLUMN `merchant_phone` varchar(20) COMMENT '计划联系人手机号' AFTER `name`, | |||
| MODIFY COLUMN `douyin_id` json COMMENT '抖音号' AFTER `content_type`, | |||
| ADD COLUMN `douyin_id_status` json COMMENT '达人履约状态' AFTER `douyin_id`, | |||
| ADD COLUMN `commission_duration` bigint(20) COMMENT '佣金有效期,单位是秒' AFTER `end_time`, | |||
| DROP INDEX `tcd_unique`, | |||
| ADD INDEX `tcd_unique`(`tenant_id`, `coupon_id`) USING BTREE; | |||
| ALTER TABLE `mallink`.`tt_poi_take_rate_9` | |||
| ADD COLUMN `merchant_phone` varchar(20) COMMENT '计划联系人手机号' AFTER `name`, | |||
| MODIFY COLUMN `douyin_id` json COMMENT '抖音号' AFTER `content_type`, | |||
| ADD COLUMN `douyin_id_status` json COMMENT '达人履约状态' AFTER `douyin_id`, | |||
| ADD COLUMN `commission_duration` bigint(20) COMMENT '佣金有效期,单位是秒' AFTER `end_time`, | |||
| DROP INDEX `tcd_unique`, | |||
| ADD INDEX `tcd_unique`(`tenant_id`, `coupon_id`) USING BTREE; | |||
| ALTER TABLE `mallink`.`tt_poi_take_rate_10` | |||
| ADD COLUMN `merchant_phone` varchar(20) COMMENT '计划联系人手机号' AFTER `name`, | |||
| MODIFY COLUMN `douyin_id` json COMMENT '抖音号' AFTER `content_type`, | |||
| ADD COLUMN `douyin_id_status` json COMMENT '达人履约状态' AFTER `douyin_id`, | |||
| ADD COLUMN `commission_duration` bigint(20) COMMENT '佣金有效期,单位是秒' AFTER `end_time`, | |||
| DROP INDEX `tcd_unique`, | |||
| ADD INDEX `tcd_unique`(`tenant_id`, `coupon_id`) USING BTREE; | |||
| ALTER TABLE `mallink`.`tt_poi_take_rate_11` | |||
| ADD COLUMN `merchant_phone` varchar(20) COMMENT '计划联系人手机号' AFTER `name`, | |||
| MODIFY COLUMN `douyin_id` json COMMENT '抖音号' AFTER `content_type`, | |||
| ADD COLUMN `douyin_id_status` json COMMENT '达人履约状态' AFTER `douyin_id`, | |||
| ADD COLUMN `commission_duration` bigint(20) COMMENT '佣金有效期,单位是秒' AFTER `end_time`, | |||
| DROP INDEX `tcd_unique`, | |||
| ADD INDEX `tcd_unique`(`tenant_id`, `coupon_id`) USING BTREE; | |||
| ALTER TABLE `mallink`.`tt_poi_take_rate_12` | |||
| ADD COLUMN `merchant_phone` varchar(20) COMMENT '计划联系人手机号' AFTER `name`, | |||
| MODIFY COLUMN `douyin_id` json COMMENT '抖音号' AFTER `content_type`, | |||
| ADD COLUMN `douyin_id_status` json COMMENT '达人履约状态' AFTER `douyin_id`, | |||
| ADD COLUMN `commission_duration` bigint(20) COMMENT '佣金有效期,单位是秒' AFTER `end_time`, | |||
| DROP INDEX `tcd_unique`, | |||
| ADD INDEX `tcd_unique`(`tenant_id`, `coupon_id`) USING BTREE; | |||
| ALTER TABLE `mallink`.`tt_poi_take_rate_13` | |||
| ADD COLUMN `merchant_phone` varchar(20) COMMENT '计划联系人手机号' AFTER `name`, | |||
| MODIFY COLUMN `douyin_id` json COMMENT '抖音号' AFTER `content_type`, | |||
| ADD COLUMN `douyin_id_status` json COMMENT '达人履约状态' AFTER `douyin_id`, | |||
| ADD COLUMN `commission_duration` bigint(20) COMMENT '佣金有效期,单位是秒' AFTER `end_time`, | |||
| DROP INDEX `tcd_unique`, | |||
| ADD INDEX `tcd_unique`(`tenant_id`, `coupon_id`) USING BTREE; | |||
| ALTER TABLE `mallink`.`tt_poi_take_rate_14` | |||
| ADD COLUMN `merchant_phone` varchar(20) COMMENT '计划联系人手机号' AFTER `name`, | |||
| MODIFY COLUMN `douyin_id` json COMMENT '抖音号' AFTER `content_type`, | |||
| ADD COLUMN `douyin_id_status` json COMMENT '达人履约状态' AFTER `douyin_id`, | |||
| ADD COLUMN `commission_duration` bigint(20) COMMENT '佣金有效期,单位是秒' AFTER `end_time`, | |||
| DROP INDEX `tcd_unique`, | |||
| ADD INDEX `tcd_unique`(`tenant_id`, `coupon_id`) USING BTREE; | |||
| ALTER TABLE `mallink`.`tt_poi_take_rate_15` | |||
| ADD COLUMN `merchant_phone` varchar(20) COMMENT '计划联系人手机号' AFTER `name`, | |||
| MODIFY COLUMN `douyin_id` json COMMENT '抖音号' AFTER `content_type`, | |||
| ADD COLUMN `douyin_id_status` json COMMENT '达人履约状态' AFTER `douyin_id`, | |||
| ADD COLUMN `commission_duration` bigint(20) COMMENT '佣金有效期,单位是秒' AFTER `end_time`, | |||
| DROP INDEX `tcd_unique`, | |||
| ADD INDEX `tcd_unique`(`tenant_id`, `coupon_id`) USING BTREE; | |||
| ALTER TABLE `mallink`.`tt_poi_take_rate_16` | |||
| ADD COLUMN `merchant_phone` varchar(20) COMMENT '计划联系人手机号' AFTER `name`, | |||
| MODIFY COLUMN `douyin_id` json COMMENT '抖音号' AFTER `content_type`, | |||
| ADD COLUMN `douyin_id_status` json COMMENT '达人履约状态' AFTER `douyin_id`, | |||
| ADD COLUMN `commission_duration` bigint(20) COMMENT '佣金有效期,单位是秒' AFTER `end_time`, | |||
| DROP INDEX `tcd_unique`, | |||
| ADD INDEX `tcd_unique`(`tenant_id`, `coupon_id`) USING BTREE; | |||
| ALTER TABLE `mallink`.`tt_poi_take_rate_17` | |||
| ADD COLUMN `merchant_phone` varchar(20) COMMENT '计划联系人手机号' AFTER `name`, | |||
| MODIFY COLUMN `douyin_id` json COMMENT '抖音号' AFTER `content_type`, | |||
| ADD COLUMN `douyin_id_status` json COMMENT '达人履约状态' AFTER `douyin_id`, | |||
| ADD COLUMN `commission_duration` bigint(20) COMMENT '佣金有效期,单位是秒' AFTER `end_time`, | |||
| DROP INDEX `tcd_unique`, | |||
| ADD INDEX `tcd_unique`(`tenant_id`, `coupon_id`) USING BTREE; | |||
| ALTER TABLE `mallink`.`tt_poi_take_rate_18` | |||
| ADD COLUMN `merchant_phone` varchar(20) COMMENT '计划联系人手机号' AFTER `name`, | |||
| MODIFY COLUMN `douyin_id` json COMMENT '抖音号' AFTER `content_type`, | |||
| ADD COLUMN `douyin_id_status` json COMMENT '达人履约状态' AFTER `douyin_id`, | |||
| ADD COLUMN `commission_duration` bigint(20) COMMENT '佣金有效期,单位是秒' AFTER `end_time`, | |||
| DROP INDEX `tcd_unique`, | |||
| ADD INDEX `tcd_unique`(`tenant_id`, `coupon_id`) USING BTREE; | |||
| ALTER TABLE `mallink`.`tt_poi_take_rate_19` | |||
| ADD COLUMN `merchant_phone` varchar(20) COMMENT '计划联系人手机号' AFTER `name`, | |||
| MODIFY COLUMN `douyin_id` json COMMENT '抖音号' AFTER `content_type`, | |||
| ADD COLUMN `douyin_id_status` json COMMENT '达人履约状态' AFTER `douyin_id`, | |||
| ADD COLUMN `commission_duration` bigint(20) COMMENT '佣金有效期,单位是秒' AFTER `end_time`, | |||
| DROP INDEX `tcd_unique`, | |||
| ADD INDEX `tcd_unique`(`tenant_id`, `coupon_id`) USING BTREE; | |||
| ALTER TABLE `mallink`.`tt_poi_take_rate_20` | |||
| ADD COLUMN `merchant_phone` varchar(20) COMMENT '计划联系人手机号' AFTER `name`, | |||
| MODIFY COLUMN `douyin_id` json COMMENT '抖音号' AFTER `content_type`, | |||
| ADD COLUMN `douyin_id_status` json COMMENT '达人履约状态' AFTER `douyin_id`, | |||
| ADD COLUMN `commission_duration` bigint(20) COMMENT '佣金有效期,单位是秒' AFTER `end_time`, | |||
| DROP INDEX `tcd_unique`, | |||
| ADD INDEX `tcd_unique`(`tenant_id`, `coupon_id`) USING BTREE; | |||
| ALTER TABLE `mallink`.`tt_poi_take_rate_21` | |||
| ADD COLUMN `merchant_phone` varchar(20) COMMENT '计划联系人手机号' AFTER `name`, | |||
| MODIFY COLUMN `douyin_id` json COMMENT '抖音号' AFTER `content_type`, | |||
| ADD COLUMN `douyin_id_status` json COMMENT '达人履约状态' AFTER `douyin_id`, | |||
| ADD COLUMN `commission_duration` bigint(20) COMMENT '佣金有效期,单位是秒' AFTER `end_time`, | |||
| DROP INDEX `tcd_unique`, | |||
| ADD INDEX `tcd_unique`(`tenant_id`, `coupon_id`) USING BTREE; | |||
| ALTER TABLE `mallink`.`tt_poi_take_rate_22` | |||
| ADD COLUMN `merchant_phone` varchar(20) COMMENT '计划联系人手机号' AFTER `name`, | |||
| MODIFY COLUMN `douyin_id` json COMMENT '抖音号' AFTER `content_type`, | |||
| ADD COLUMN `douyin_id_status` json COMMENT '达人履约状态' AFTER `douyin_id`, | |||
| ADD COLUMN `commission_duration` bigint(20) COMMENT '佣金有效期,单位是秒' AFTER `end_time`, | |||
| DROP INDEX `tcd_unique`, | |||
| ADD INDEX `tcd_unique`(`tenant_id`, `coupon_id`) USING BTREE; | |||
| ALTER TABLE `mallink`.`tt_poi_take_rate_23` | |||
| ADD COLUMN `merchant_phone` varchar(20) COMMENT '计划联系人手机号' AFTER `name`, | |||
| MODIFY COLUMN `douyin_id` json COMMENT '抖音号' AFTER `content_type`, | |||
| ADD COLUMN `douyin_id_status` json COMMENT '达人履约状态' AFTER `douyin_id`, | |||
| ADD COLUMN `commission_duration` bigint(20) COMMENT '佣金有效期,单位是秒' AFTER `end_time`, | |||
| DROP INDEX `tcd_unique`, | |||
| ADD INDEX `tcd_unique`(`tenant_id`, `coupon_id`) USING BTREE; | |||
| ALTER TABLE `mallink`.`tt_poi_take_rate_24` | |||
| ADD COLUMN `merchant_phone` varchar(20) COMMENT '计划联系人手机号' AFTER `name`, | |||
| MODIFY COLUMN `douyin_id` json COMMENT '抖音号' AFTER `content_type`, | |||
| ADD COLUMN `douyin_id_status` json COMMENT '达人履约状态' AFTER `douyin_id`, | |||
| ADD COLUMN `commission_duration` bigint(20) COMMENT '佣金有效期,单位是秒' AFTER `end_time`, | |||
| DROP INDEX `tcd_unique`, | |||
| ADD INDEX `tcd_unique`(`tenant_id`, `coupon_id`) USING BTREE; | |||
| ALTER TABLE `mallink`.`tt_poi_take_rate_25` | |||
| ADD COLUMN `merchant_phone` varchar(20) COMMENT '计划联系人手机号' AFTER `name`, | |||
| MODIFY COLUMN `douyin_id` json COMMENT '抖音号' AFTER `content_type`, | |||
| ADD COLUMN `douyin_id_status` json COMMENT '达人履约状态' AFTER `douyin_id`, | |||
| ADD COLUMN `commission_duration` bigint(20) COMMENT '佣金有效期,单位是秒' AFTER `end_time`, | |||
| DROP INDEX `tcd_unique`, | |||
| ADD INDEX `tcd_unique`(`tenant_id`, `coupon_id`) USING BTREE; | |||
| ALTER TABLE `mallink`.`tt_poi_take_rate_26` | |||
| ADD COLUMN `merchant_phone` varchar(20) COMMENT '计划联系人手机号' AFTER `name`, | |||
| MODIFY COLUMN `douyin_id` json COMMENT '抖音号' AFTER `content_type`, | |||
| ADD COLUMN `douyin_id_status` json COMMENT '达人履约状态' AFTER `douyin_id`, | |||
| ADD COLUMN `commission_duration` bigint(20) COMMENT '佣金有效期,单位是秒' AFTER `end_time`, | |||
| DROP INDEX `tcd_unique`, | |||
| ADD INDEX `tcd_unique`(`tenant_id`, `coupon_id`) USING BTREE; | |||
| ALTER TABLE `mallink`.`tt_poi_take_rate_27` | |||
| ADD COLUMN `merchant_phone` varchar(20) COMMENT '计划联系人手机号' AFTER `name`, | |||
| MODIFY COLUMN `douyin_id` json COMMENT '抖音号' AFTER `content_type`, | |||
| ADD COLUMN `douyin_id_status` json COMMENT '达人履约状态' AFTER `douyin_id`, | |||
| ADD COLUMN `commission_duration` bigint(20) COMMENT '佣金有效期,单位是秒' AFTER `end_time`, | |||
| DROP INDEX `tcd_unique`, | |||
| ADD INDEX `tcd_unique`(`tenant_id`, `coupon_id`) USING BTREE; | |||
| ALTER TABLE `mallink`.`tt_poi_take_rate_28` | |||
| ADD COLUMN `merchant_phone` varchar(20) COMMENT '计划联系人手机号' AFTER `name`, | |||
| MODIFY COLUMN `douyin_id` json COMMENT '抖音号' AFTER `content_type`, | |||
| ADD COLUMN `douyin_id_status` json COMMENT '达人履约状态' AFTER `douyin_id`, | |||
| ADD COLUMN `commission_duration` bigint(20) COMMENT '佣金有效期,单位是秒' AFTER `end_time`, | |||
| DROP INDEX `tcd_unique`, | |||
| ADD INDEX `tcd_unique`(`tenant_id`, `coupon_id`) USING BTREE; | |||
| ALTER TABLE `mallink`.`tt_poi_take_rate_29` | |||
| ADD COLUMN `merchant_phone` varchar(20) COMMENT '计划联系人手机号' AFTER `name`, | |||
| MODIFY COLUMN `douyin_id` json COMMENT '抖音号' AFTER `content_type`, | |||
| ADD COLUMN `douyin_id_status` json COMMENT '达人履约状态' AFTER `douyin_id`, | |||
| ADD COLUMN `commission_duration` bigint(20) COMMENT '佣金有效期,单位是秒' AFTER `end_time`, | |||
| DROP INDEX `tcd_unique`, | |||
| ADD INDEX `tcd_unique`(`tenant_id`, `coupon_id`) USING BTREE; | |||
| ALTER TABLE `mallink`.`tt_poi_take_rate_30` | |||
| ADD COLUMN `merchant_phone` varchar(20) COMMENT '计划联系人手机号' AFTER `name`, | |||
| MODIFY COLUMN `douyin_id` json COMMENT '抖音号' AFTER `content_type`, | |||
| ADD COLUMN `douyin_id_status` json COMMENT '达人履约状态' AFTER `douyin_id`, | |||
| ADD COLUMN `commission_duration` bigint(20) COMMENT '佣金有效期,单位是秒' AFTER `end_time`, | |||
| DROP INDEX `tcd_unique`, | |||
| ADD INDEX `tcd_unique`(`tenant_id`, `coupon_id`) USING BTREE; | |||
| ALTER TABLE `mallink`.`tt_poi_take_rate_31` | |||
| ADD COLUMN `merchant_phone` varchar(20) COMMENT '计划联系人手机号' AFTER `name`, | |||
| MODIFY COLUMN `douyin_id` json COMMENT '抖音号' AFTER `content_type`, | |||
| ADD COLUMN `douyin_id_status` json COMMENT '达人履约状态' AFTER `douyin_id`, | |||
| ADD COLUMN `commission_duration` bigint(20) COMMENT '佣金有效期,单位是秒' AFTER `end_time`, | |||
| DROP INDEX `tcd_unique`, | |||
| ADD INDEX `tcd_unique`(`tenant_id`, `coupon_id`) USING BTREE; | |||
| ALTER TABLE `mallink`.`tt_poi_take_rate_32` | |||
| ADD COLUMN `merchant_phone` varchar(20) COMMENT '计划联系人手机号' AFTER `name`, | |||
| MODIFY COLUMN `douyin_id` json COMMENT '抖音号' AFTER `content_type`, | |||
| ADD COLUMN `douyin_id_status` json COMMENT '达人履约状态' AFTER `douyin_id`, | |||
| ADD COLUMN `commission_duration` bigint(20) COMMENT '佣金有效期,单位是秒' AFTER `end_time`, | |||
| DROP INDEX `tcd_unique`, | |||
| ADD INDEX `tcd_unique`(`tenant_id`, `coupon_id`) USING BTREE; | |||
| ALTER TABLE `mallink`.`tt_poi_take_rate_33` | |||
| ADD COLUMN `merchant_phone` varchar(20) COMMENT '计划联系人手机号' AFTER `name`, | |||
| MODIFY COLUMN `douyin_id` json COMMENT '抖音号' AFTER `content_type`, | |||
| ADD COLUMN `douyin_id_status` json COMMENT '达人履约状态' AFTER `douyin_id`, | |||
| ADD COLUMN `commission_duration` bigint(20) COMMENT '佣金有效期,单位是秒' AFTER `end_time`, | |||
| DROP INDEX `tcd_unique`, | |||
| ADD INDEX `tcd_unique`(`tenant_id`, `coupon_id`) USING BTREE; | |||
| ALTER TABLE `mallink`.`tt_poi_take_rate_34` | |||
| ADD COLUMN `merchant_phone` varchar(20) COMMENT '计划联系人手机号' AFTER `name`, | |||
| MODIFY COLUMN `douyin_id` json COMMENT '抖音号' AFTER `content_type`, | |||
| ADD COLUMN `douyin_id_status` json COMMENT '达人履约状态' AFTER `douyin_id`, | |||
| ADD COLUMN `commission_duration` bigint(20) COMMENT '佣金有效期,单位是秒' AFTER `end_time`, | |||
| DROP INDEX `tcd_unique`, | |||
| ADD INDEX `tcd_unique`(`tenant_id`, `coupon_id`) USING BTREE; | |||
| ALTER TABLE `mallink`.`tt_poi_take_rate_35` | |||
| ADD COLUMN `merchant_phone` varchar(20) COMMENT '计划联系人手机号' AFTER `name`, | |||
| MODIFY COLUMN `douyin_id` json COMMENT '抖音号' AFTER `content_type`, | |||
| ADD COLUMN `douyin_id_status` json COMMENT '达人履约状态' AFTER `douyin_id`, | |||
| ADD COLUMN `commission_duration` bigint(20) COMMENT '佣金有效期,单位是秒' AFTER `end_time`, | |||
| DROP INDEX `tcd_unique`, | |||
| ADD INDEX `tcd_unique`(`tenant_id`, `coupon_id`) USING BTREE; | |||
| ALTER TABLE `mallink`.`tt_poi_take_rate_36` | |||
| ADD COLUMN `merchant_phone` varchar(20) COMMENT '计划联系人手机号' AFTER `name`, | |||
| MODIFY COLUMN `douyin_id` json COMMENT '抖音号' AFTER `content_type`, | |||
| ADD COLUMN `douyin_id_status` json COMMENT '达人履约状态' AFTER `douyin_id`, | |||
| ADD COLUMN `commission_duration` bigint(20) COMMENT '佣金有效期,单位是秒' AFTER `end_time`, | |||
| DROP INDEX `tcd_unique`, | |||
| ADD INDEX `tcd_unique`(`tenant_id`, `coupon_id`) USING BTREE; | |||
| ALTER TABLE `mallink`.`tt_poi_take_rate_37` | |||
| ADD COLUMN `merchant_phone` varchar(20) COMMENT '计划联系人手机号' AFTER `name`, | |||
| MODIFY COLUMN `douyin_id` json COMMENT '抖音号' AFTER `content_type`, | |||
| ADD COLUMN `douyin_id_status` json COMMENT '达人履约状态' AFTER `douyin_id`, | |||
| ADD COLUMN `commission_duration` bigint(20) COMMENT '佣金有效期,单位是秒' AFTER `end_time`, | |||
| DROP INDEX `tcd_unique`, | |||
| ADD INDEX `tcd_unique`(`tenant_id`, `coupon_id`) USING BTREE; | |||
| ALTER TABLE `mallink`.`tt_poi_take_rate_38` | |||
| ADD COLUMN `merchant_phone` varchar(20) COMMENT '计划联系人手机号' AFTER `name`, | |||
| MODIFY COLUMN `douyin_id` json COMMENT '抖音号' AFTER `content_type`, | |||
| ADD COLUMN `douyin_id_status` json COMMENT '达人履约状态' AFTER `douyin_id`, | |||
| ADD COLUMN `commission_duration` bigint(20) COMMENT '佣金有效期,单位是秒' AFTER `end_time`, | |||
| DROP INDEX `tcd_unique`, | |||
| ADD INDEX `tcd_unique`(`tenant_id`, `coupon_id`) USING BTREE; | |||
| ALTER TABLE `mallink`.`tt_poi_take_rate_39` | |||
| ADD COLUMN `merchant_phone` varchar(20) COMMENT '计划联系人手机号' AFTER `name`, | |||
| MODIFY COLUMN `douyin_id` json COMMENT '抖音号' AFTER `content_type`, | |||
| ADD COLUMN `douyin_id_status` json COMMENT '达人履约状态' AFTER `douyin_id`, | |||
| ADD COLUMN `commission_duration` bigint(20) COMMENT '佣金有效期,单位是秒' AFTER `end_time`, | |||
| DROP INDEX `tcd_unique`, | |||
| ADD INDEX `tcd_unique`(`tenant_id`, `coupon_id`) USING BTREE; | |||
| ALTER TABLE `mallink`.`tt_poi_take_rate_40` | |||
| ADD COLUMN `merchant_phone` varchar(20) COMMENT '计划联系人手机号' AFTER `name`, | |||
| MODIFY COLUMN `douyin_id` json COMMENT '抖音号' AFTER `content_type`, | |||
| ADD COLUMN `douyin_id_status` json COMMENT '达人履约状态' AFTER `douyin_id`, | |||
| ADD COLUMN `commission_duration` bigint(20) COMMENT '佣金有效期,单位是秒' AFTER `end_time`, | |||
| DROP INDEX `tcd_unique`, | |||
| ADD INDEX `tcd_unique`(`tenant_id`, `coupon_id`) USING BTREE; | |||
| ALTER TABLE `mallink`.`tt_poi_take_rate_41` | |||
| ADD COLUMN `merchant_phone` varchar(20) COMMENT '计划联系人手机号' AFTER `name`, | |||
| MODIFY COLUMN `douyin_id` json COMMENT '抖音号' AFTER `content_type`, | |||
| ADD COLUMN `douyin_id_status` json COMMENT '达人履约状态' AFTER `douyin_id`, | |||
| ADD COLUMN `commission_duration` bigint(20) COMMENT '佣金有效期,单位是秒' AFTER `end_time`, | |||
| DROP INDEX `tcd_unique`, | |||
| ADD INDEX `tcd_unique`(`tenant_id`, `coupon_id`) USING BTREE; | |||
| ALTER TABLE `mallink`.`tt_poi_take_rate_42` | |||
| ADD COLUMN `merchant_phone` varchar(20) COMMENT '计划联系人手机号' AFTER `name`, | |||
| MODIFY COLUMN `douyin_id` json COMMENT '抖音号' AFTER `content_type`, | |||
| ADD COLUMN `douyin_id_status` json COMMENT '达人履约状态' AFTER `douyin_id`, | |||
| ADD COLUMN `commission_duration` bigint(20) COMMENT '佣金有效期,单位是秒' AFTER `end_time`, | |||
| DROP INDEX `tcd_unique`, | |||
| ADD INDEX `tcd_unique`(`tenant_id`, `coupon_id`) USING BTREE; | |||
| ALTER TABLE `mallink`.`tt_poi_take_rate_43` | |||
| ADD COLUMN `merchant_phone` varchar(20) COMMENT '计划联系人手机号' AFTER `name`, | |||
| MODIFY COLUMN `douyin_id` json COMMENT '抖音号' AFTER `content_type`, | |||
| ADD COLUMN `douyin_id_status` json COMMENT '达人履约状态' AFTER `douyin_id`, | |||
| ADD COLUMN `commission_duration` bigint(20) COMMENT '佣金有效期,单位是秒' AFTER `end_time`, | |||
| DROP INDEX `tcd_unique`, | |||
| ADD INDEX `tcd_unique`(`tenant_id`, `coupon_id`) USING BTREE; | |||
| ALTER TABLE `mallink`.`tt_poi_take_rate_44` | |||
| ADD COLUMN `merchant_phone` varchar(20) COMMENT '计划联系人手机号' AFTER `name`, | |||
| MODIFY COLUMN `douyin_id` json COMMENT '抖音号' AFTER `content_type`, | |||
| ADD COLUMN `douyin_id_status` json COMMENT '达人履约状态' AFTER `douyin_id`, | |||
| ADD COLUMN `commission_duration` bigint(20) COMMENT '佣金有效期,单位是秒' AFTER `end_time`, | |||
| DROP INDEX `tcd_unique`, | |||
| ADD INDEX `tcd_unique`(`tenant_id`, `coupon_id`) USING BTREE; | |||
| ALTER TABLE `mallink`.`tt_poi_take_rate_45` | |||
| ADD COLUMN `merchant_phone` varchar(20) COMMENT '计划联系人手机号' AFTER `name`, | |||
| MODIFY COLUMN `douyin_id` json COMMENT '抖音号' AFTER `content_type`, | |||
| ADD COLUMN `douyin_id_status` json COMMENT '达人履约状态' AFTER `douyin_id`, | |||
| ADD COLUMN `commission_duration` bigint(20) COMMENT '佣金有效期,单位是秒' AFTER `end_time`, | |||
| DROP INDEX `tcd_unique`, | |||
| ADD INDEX `tcd_unique`(`tenant_id`, `coupon_id`) USING BTREE; | |||
| ALTER TABLE `mallink`.`tt_poi_take_rate_46` | |||
| ADD COLUMN `merchant_phone` varchar(20) COMMENT '计划联系人手机号' AFTER `name`, | |||
| MODIFY COLUMN `douyin_id` json COMMENT '抖音号' AFTER `content_type`, | |||
| ADD COLUMN `douyin_id_status` json COMMENT '达人履约状态' AFTER `douyin_id`, | |||
| ADD COLUMN `commission_duration` bigint(20) COMMENT '佣金有效期,单位是秒' AFTER `end_time`, | |||
| DROP INDEX `tcd_unique`, | |||
| ADD INDEX `tcd_unique`(`tenant_id`, `coupon_id`) USING BTREE; | |||
| ALTER TABLE `mallink`.`tt_poi_take_rate_47` | |||
| ADD COLUMN `merchant_phone` varchar(20) COMMENT '计划联系人手机号' AFTER `name`, | |||
| MODIFY COLUMN `douyin_id` json COMMENT '抖音号' AFTER `content_type`, | |||
| ADD COLUMN `douyin_id_status` json COMMENT '达人履约状态' AFTER `douyin_id`, | |||
| ADD COLUMN `commission_duration` bigint(20) COMMENT '佣金有效期,单位是秒' AFTER `end_time`, | |||
| DROP INDEX `tcd_unique`, | |||
| ADD INDEX `tcd_unique`(`tenant_id`, `coupon_id`) USING BTREE; | |||
| ALTER TABLE `mallink`.`tt_poi_take_rate_48` | |||
| ADD COLUMN `merchant_phone` varchar(20) COMMENT '计划联系人手机号' AFTER `name`, | |||
| MODIFY COLUMN `douyin_id` json COMMENT '抖音号' AFTER `content_type`, | |||
| ADD COLUMN `douyin_id_status` json COMMENT '达人履约状态' AFTER `douyin_id`, | |||
| ADD COLUMN `commission_duration` bigint(20) COMMENT '佣金有效期,单位是秒' AFTER `end_time`, | |||
| DROP INDEX `tcd_unique`, | |||
| ADD INDEX `tcd_unique`(`tenant_id`, `coupon_id`) USING BTREE; | |||
| ALTER TABLE `mallink`.`tt_poi_take_rate_49` | |||
| ADD COLUMN `merchant_phone` varchar(20) COMMENT '计划联系人手机号' AFTER `name`, | |||
| MODIFY COLUMN `douyin_id` json COMMENT '抖音号' AFTER `content_type`, | |||
| ADD COLUMN `douyin_id_status` json COMMENT '达人履约状态' AFTER `douyin_id`, | |||
| ADD COLUMN `commission_duration` bigint(20) COMMENT '佣金有效期,单位是秒' AFTER `end_time`, | |||
| DROP INDEX `tcd_unique`, | |||
| ADD INDEX `tcd_unique`(`tenant_id`, `coupon_id`) USING BTREE; | |||
| ALTER TABLE `mallink`.`tt_poi_take_rate_50` | |||
| ADD COLUMN `merchant_phone` varchar(20) COMMENT '计划联系人手机号' AFTER `name`, | |||
| MODIFY COLUMN `douyin_id` json COMMENT '抖音号' AFTER `content_type`, | |||
| ADD COLUMN `douyin_id_status` json COMMENT '达人履约状态' AFTER `douyin_id`, | |||
| ADD COLUMN `commission_duration` bigint(20) COMMENT '佣金有效期,单位是秒' AFTER `end_time`, | |||
| DROP INDEX `tcd_unique`, | |||
| ADD INDEX `tcd_unique`(`tenant_id`, `coupon_id`) USING BTREE; | |||
| ALTER TABLE `mallink`.`tt_poi_take_rate_51` | |||
| ADD COLUMN `merchant_phone` varchar(20) COMMENT '计划联系人手机号' AFTER `name`, | |||
| MODIFY COLUMN `douyin_id` json COMMENT '抖音号' AFTER `content_type`, | |||
| ADD COLUMN `douyin_id_status` json COMMENT '达人履约状态' AFTER `douyin_id`, | |||
| ADD COLUMN `commission_duration` bigint(20) COMMENT '佣金有效期,单位是秒' AFTER `end_time`, | |||
| DROP INDEX `tcd_unique`, | |||
| ADD INDEX `tcd_unique`(`tenant_id`, `coupon_id`) USING BTREE; | |||
| ALTER TABLE `mallink`.`tt_poi_take_rate_52` | |||
| ADD COLUMN `merchant_phone` varchar(20) COMMENT '计划联系人手机号' AFTER `name`, | |||
| MODIFY COLUMN `douyin_id` json COMMENT '抖音号' AFTER `content_type`, | |||
| ADD COLUMN `douyin_id_status` json COMMENT '达人履约状态' AFTER `douyin_id`, | |||
| ADD COLUMN `commission_duration` bigint(20) COMMENT '佣金有效期,单位是秒' AFTER `end_time`, | |||
| DROP INDEX `tcd_unique`, | |||
| ADD INDEX `tcd_unique`(`tenant_id`, `coupon_id`) USING BTREE; | |||
| ALTER TABLE `mallink`.`tt_poi_take_rate_53` | |||
| ADD COLUMN `merchant_phone` varchar(20) COMMENT '计划联系人手机号' AFTER `name`, | |||
| MODIFY COLUMN `douyin_id` json COMMENT '抖音号' AFTER `content_type`, | |||
| ADD COLUMN `douyin_id_status` json COMMENT '达人履约状态' AFTER `douyin_id`, | |||
| ADD COLUMN `commission_duration` bigint(20) COMMENT '佣金有效期,单位是秒' AFTER `end_time`, | |||
| DROP INDEX `tcd_unique`, | |||
| ADD INDEX `tcd_unique`(`tenant_id`, `coupon_id`) USING BTREE; | |||
| ALTER TABLE `mallink`.`tt_poi_take_rate_54` | |||
| ADD COLUMN `merchant_phone` varchar(20) COMMENT '计划联系人手机号' AFTER `name`, | |||
| MODIFY COLUMN `douyin_id` json COMMENT '抖音号' AFTER `content_type`, | |||
| ADD COLUMN `douyin_id_status` json COMMENT '达人履约状态' AFTER `douyin_id`, | |||
| ADD COLUMN `commission_duration` bigint(20) COMMENT '佣金有效期,单位是秒' AFTER `end_time`, | |||
| DROP INDEX `tcd_unique`, | |||
| ADD INDEX `tcd_unique`(`tenant_id`, `coupon_id`) USING BTREE; | |||
| ALTER TABLE `mallink`.`tt_poi_take_rate_55` | |||
| ADD COLUMN `merchant_phone` varchar(20) COMMENT '计划联系人手机号' AFTER `name`, | |||
| MODIFY COLUMN `douyin_id` json COMMENT '抖音号' AFTER `content_type`, | |||
| ADD COLUMN `douyin_id_status` json COMMENT '达人履约状态' AFTER `douyin_id`, | |||
| ADD COLUMN `commission_duration` bigint(20) COMMENT '佣金有效期,单位是秒' AFTER `end_time`, | |||
| DROP INDEX `tcd_unique`, | |||
| ADD INDEX `tcd_unique`(`tenant_id`, `coupon_id`) USING BTREE; | |||
| ALTER TABLE `mallink`.`tt_poi_take_rate_56` | |||
| ADD COLUMN `merchant_phone` varchar(20) COMMENT '计划联系人手机号' AFTER `name`, | |||
| MODIFY COLUMN `douyin_id` json COMMENT '抖音号' AFTER `content_type`, | |||
| ADD COLUMN `douyin_id_status` json COMMENT '达人履约状态' AFTER `douyin_id`, | |||
| ADD COLUMN `commission_duration` bigint(20) COMMENT '佣金有效期,单位是秒' AFTER `end_time`, | |||
| DROP INDEX `tcd_unique`, | |||
| ADD INDEX `tcd_unique`(`tenant_id`, `coupon_id`) USING BTREE; | |||
| ALTER TABLE `mallink`.`tt_poi_take_rate_57` | |||
| ADD COLUMN `merchant_phone` varchar(20) COMMENT '计划联系人手机号' AFTER `name`, | |||
| MODIFY COLUMN `douyin_id` json COMMENT '抖音号' AFTER `content_type`, | |||
| ADD COLUMN `douyin_id_status` json COMMENT '达人履约状态' AFTER `douyin_id`, | |||
| ADD COLUMN `commission_duration` bigint(20) COMMENT '佣金有效期,单位是秒' AFTER `end_time`, | |||
| DROP INDEX `tcd_unique`, | |||
| ADD INDEX `tcd_unique`(`tenant_id`, `coupon_id`) USING BTREE; | |||
| ALTER TABLE `mallink`.`tt_poi_take_rate_58` | |||
| ADD COLUMN `merchant_phone` varchar(20) COMMENT '计划联系人手机号' AFTER `name`, | |||
| MODIFY COLUMN `douyin_id` json COMMENT '抖音号' AFTER `content_type`, | |||
| ADD COLUMN `douyin_id_status` json COMMENT '达人履约状态' AFTER `douyin_id`, | |||
| ADD COLUMN `commission_duration` bigint(20) COMMENT '佣金有效期,单位是秒' AFTER `end_time`, | |||
| DROP INDEX `tcd_unique`, | |||
| ADD INDEX `tcd_unique`(`tenant_id`, `coupon_id`) USING BTREE; | |||
| ALTER TABLE `mallink`.`tt_poi_take_rate_59` | |||
| ADD COLUMN `merchant_phone` varchar(20) COMMENT '计划联系人手机号' AFTER `name`, | |||
| MODIFY COLUMN `douyin_id` json COMMENT '抖音号' AFTER `content_type`, | |||
| ADD COLUMN `douyin_id_status` json COMMENT '达人履约状态' AFTER `douyin_id`, | |||
| ADD COLUMN `commission_duration` bigint(20) COMMENT '佣金有效期,单位是秒' AFTER `end_time`, | |||
| DROP INDEX `tcd_unique`, | |||
| ADD INDEX `tcd_unique`(`tenant_id`, `coupon_id`) USING BTREE; | |||
| ALTER TABLE `mallink`.`tt_poi_take_rate_60` | |||
| ADD COLUMN `merchant_phone` varchar(20) COMMENT '计划联系人手机号' AFTER `name`, | |||
| MODIFY COLUMN `douyin_id` json COMMENT '抖音号' AFTER `content_type`, | |||
| ADD COLUMN `douyin_id_status` json COMMENT '达人履约状态' AFTER `douyin_id`, | |||
| ADD COLUMN `commission_duration` bigint(20) COMMENT '佣金有效期,单位是秒' AFTER `end_time`, | |||
| DROP INDEX `tcd_unique`, | |||
| ADD INDEX `tcd_unique`(`tenant_id`, `coupon_id`) USING BTREE; | |||
| ALTER TABLE `mallink`.`tt_poi_take_rate_61` | |||
| ADD COLUMN `merchant_phone` varchar(20) COMMENT '计划联系人手机号' AFTER `name`, | |||
| MODIFY COLUMN `douyin_id` json COMMENT '抖音号' AFTER `content_type`, | |||
| ADD COLUMN `douyin_id_status` json COMMENT '达人履约状态' AFTER `douyin_id`, | |||
| ADD COLUMN `commission_duration` bigint(20) COMMENT '佣金有效期,单位是秒' AFTER `end_time`, | |||
| DROP INDEX `tcd_unique`, | |||
| ADD INDEX `tcd_unique`(`tenant_id`, `coupon_id`) USING BTREE; | |||
| ALTER TABLE `mallink`.`tt_poi_take_rate_62` | |||
| ADD COLUMN `merchant_phone` varchar(20) COMMENT '计划联系人手机号' AFTER `name`, | |||
| MODIFY COLUMN `douyin_id` json COMMENT '抖音号' AFTER `content_type`, | |||
| ADD COLUMN `douyin_id_status` json COMMENT '达人履约状态' AFTER `douyin_id`, | |||
| ADD COLUMN `commission_duration` bigint(20) COMMENT '佣金有效期,单位是秒' AFTER `end_time`, | |||
| DROP INDEX `tcd_unique`, | |||
| ADD INDEX `tcd_unique`(`tenant_id`, `coupon_id`) USING BTREE; | |||
| ALTER TABLE `mallink`.`tt_poi_take_rate_63` | |||
| ADD COLUMN `merchant_phone` varchar(20) COMMENT '计划联系人手机号' AFTER `name`, | |||
| MODIFY COLUMN `douyin_id` json COMMENT '抖音号' AFTER `content_type`, | |||
| ADD COLUMN `douyin_id_status` json COMMENT '达人履约状态' AFTER `douyin_id`, | |||
| ADD COLUMN `commission_duration` bigint(20) COMMENT '佣金有效期,单位是秒' AFTER `end_time`, | |||
| DROP INDEX `tcd_unique`, | |||
| ADD INDEX `tcd_unique`(`tenant_id`, `coupon_id`) USING BTREE; | |||
| ALTER TABLE `mallink`.`tt_poi_take_rate_64` | |||
| ADD COLUMN `merchant_phone` varchar(20) COMMENT '计划联系人手机号' AFTER `name`, | |||
| MODIFY COLUMN `douyin_id` json COMMENT '抖音号' AFTER `content_type`, | |||
| ADD COLUMN `douyin_id_status` json COMMENT '达人履约状态' AFTER `douyin_id`, | |||
| ADD COLUMN `commission_duration` bigint(20) COMMENT '佣金有效期,单位是秒' AFTER `end_time`, | |||
| DROP INDEX `tcd_unique`, | |||
| ADD INDEX `tcd_unique`(`tenant_id`, `coupon_id`) USING BTREE; | |||
| ALTER TABLE `mallink`.`tt_poi_take_rate_65` | |||
| ADD COLUMN `merchant_phone` varchar(20) COMMENT '计划联系人手机号' AFTER `name`, | |||
| MODIFY COLUMN `douyin_id` json COMMENT '抖音号' AFTER `content_type`, | |||
| ADD COLUMN `douyin_id_status` json COMMENT '达人履约状态' AFTER `douyin_id`, | |||
| ADD COLUMN `commission_duration` bigint(20) COMMENT '佣金有效期,单位是秒' AFTER `end_time`, | |||
| DROP INDEX `tcd_unique`, | |||
| ADD INDEX `tcd_unique`(`tenant_id`, `coupon_id`) USING BTREE; | |||
| ALTER TABLE `mallink`.`tt_poi_take_rate_66` | |||
| ADD COLUMN `merchant_phone` varchar(20) COMMENT '计划联系人手机号' AFTER `name`, | |||
| MODIFY COLUMN `douyin_id` json COMMENT '抖音号' AFTER `content_type`, | |||
| ADD COLUMN `douyin_id_status` json COMMENT '达人履约状态' AFTER `douyin_id`, | |||
| ADD COLUMN `commission_duration` bigint(20) COMMENT '佣金有效期,单位是秒' AFTER `end_time`, | |||
| DROP INDEX `tcd_unique`, | |||
| ADD INDEX `tcd_unique`(`tenant_id`, `coupon_id`) USING BTREE; | |||
| ALTER TABLE `mallink`.`tt_poi_take_rate_67` | |||
| ADD COLUMN `merchant_phone` varchar(20) COMMENT '计划联系人手机号' AFTER `name`, | |||
| MODIFY COLUMN `douyin_id` json COMMENT '抖音号' AFTER `content_type`, | |||
| ADD COLUMN `douyin_id_status` json COMMENT '达人履约状态' AFTER `douyin_id`, | |||
| ADD COLUMN `commission_duration` bigint(20) COMMENT '佣金有效期,单位是秒' AFTER `end_time`, | |||
| DROP INDEX `tcd_unique`, | |||
| ADD INDEX `tcd_unique`(`tenant_id`, `coupon_id`) USING BTREE; | |||
| ALTER TABLE `mallink`.`tt_poi_take_rate_68` | |||
| ADD COLUMN `merchant_phone` varchar(20) COMMENT '计划联系人手机号' AFTER `name`, | |||
| MODIFY COLUMN `douyin_id` json COMMENT '抖音号' AFTER `content_type`, | |||
| ADD COLUMN `douyin_id_status` json COMMENT '达人履约状态' AFTER `douyin_id`, | |||
| ADD COLUMN `commission_duration` bigint(20) COMMENT '佣金有效期,单位是秒' AFTER `end_time`, | |||
| DROP INDEX `tcd_unique`, | |||
| ADD INDEX `tcd_unique`(`tenant_id`, `coupon_id`) USING BTREE; | |||
| ALTER TABLE `mallink`.`tt_poi_take_rate_69` | |||
| ADD COLUMN `merchant_phone` varchar(20) COMMENT '计划联系人手机号' AFTER `name`, | |||
| MODIFY COLUMN `douyin_id` json COMMENT '抖音号' AFTER `content_type`, | |||
| ADD COLUMN `douyin_id_status` json COMMENT '达人履约状态' AFTER `douyin_id`, | |||
| ADD COLUMN `commission_duration` bigint(20) COMMENT '佣金有效期,单位是秒' AFTER `end_time`, | |||
| DROP INDEX `tcd_unique`, | |||
| ADD INDEX `tcd_unique`(`tenant_id`, `coupon_id`) USING BTREE; | |||
| ALTER TABLE `mallink`.`tt_poi_take_rate_70` | |||
| ADD COLUMN `merchant_phone` varchar(20) COMMENT '计划联系人手机号' AFTER `name`, | |||
| MODIFY COLUMN `douyin_id` json COMMENT '抖音号' AFTER `content_type`, | |||
| ADD COLUMN `douyin_id_status` json COMMENT '达人履约状态' AFTER `douyin_id`, | |||
| ADD COLUMN `commission_duration` bigint(20) COMMENT '佣金有效期,单位是秒' AFTER `end_time`, | |||
| DROP INDEX `tcd_unique`, | |||
| ADD INDEX `tcd_unique`(`tenant_id`, `coupon_id`) USING BTREE; | |||
| ALTER TABLE `mallink`.`tt_poi_take_rate_71` | |||
| ADD COLUMN `merchant_phone` varchar(20) COMMENT '计划联系人手机号' AFTER `name`, | |||
| MODIFY COLUMN `douyin_id` json COMMENT '抖音号' AFTER `content_type`, | |||
| ADD COLUMN `douyin_id_status` json COMMENT '达人履约状态' AFTER `douyin_id`, | |||
| ADD COLUMN `commission_duration` bigint(20) COMMENT '佣金有效期,单位是秒' AFTER `end_time`, | |||
| DROP INDEX `tcd_unique`, | |||
| ADD INDEX `tcd_unique`(`tenant_id`, `coupon_id`) USING BTREE; | |||
| ALTER TABLE `mallink`.`tt_poi_take_rate_72` | |||
| ADD COLUMN `merchant_phone` varchar(20) COMMENT '计划联系人手机号' AFTER `name`, | |||
| MODIFY COLUMN `douyin_id` json COMMENT '抖音号' AFTER `content_type`, | |||
| ADD COLUMN `douyin_id_status` json COMMENT '达人履约状态' AFTER `douyin_id`, | |||
| ADD COLUMN `commission_duration` bigint(20) COMMENT '佣金有效期,单位是秒' AFTER `end_time`, | |||
| DROP INDEX `tcd_unique`, | |||
| ADD INDEX `tcd_unique`(`tenant_id`, `coupon_id`) USING BTREE; | |||
| ALTER TABLE `mallink`.`tt_poi_take_rate_73` | |||
| ADD COLUMN `merchant_phone` varchar(20) COMMENT '计划联系人手机号' AFTER `name`, | |||
| MODIFY COLUMN `douyin_id` json COMMENT '抖音号' AFTER `content_type`, | |||
| ADD COLUMN `douyin_id_status` json COMMENT '达人履约状态' AFTER `douyin_id`, | |||
| ADD COLUMN `commission_duration` bigint(20) COMMENT '佣金有效期,单位是秒' AFTER `end_time`, | |||
| DROP INDEX `tcd_unique`, | |||
| ADD INDEX `tcd_unique`(`tenant_id`, `coupon_id`) USING BTREE; | |||
| ALTER TABLE `mallink`.`tt_poi_take_rate_74` | |||
| ADD COLUMN `merchant_phone` varchar(20) COMMENT '计划联系人手机号' AFTER `name`, | |||
| MODIFY COLUMN `douyin_id` json COMMENT '抖音号' AFTER `content_type`, | |||
| ADD COLUMN `douyin_id_status` json COMMENT '达人履约状态' AFTER `douyin_id`, | |||
| ADD COLUMN `commission_duration` bigint(20) COMMENT '佣金有效期,单位是秒' AFTER `end_time`, | |||
| DROP INDEX `tcd_unique`, | |||
| ADD INDEX `tcd_unique`(`tenant_id`, `coupon_id`) USING BTREE; | |||
| ALTER TABLE `mallink`.`tt_poi_take_rate_75` | |||
| ADD COLUMN `merchant_phone` varchar(20) COMMENT '计划联系人手机号' AFTER `name`, | |||
| MODIFY COLUMN `douyin_id` json COMMENT '抖音号' AFTER `content_type`, | |||
| ADD COLUMN `douyin_id_status` json COMMENT '达人履约状态' AFTER `douyin_id`, | |||
| ADD COLUMN `commission_duration` bigint(20) COMMENT '佣金有效期,单位是秒' AFTER `end_time`, | |||
| DROP INDEX `tcd_unique`, | |||
| ADD INDEX `tcd_unique`(`tenant_id`, `coupon_id`) USING BTREE; | |||
| ALTER TABLE `mallink`.`tt_poi_take_rate_76` | |||
| ADD COLUMN `merchant_phone` varchar(20) COMMENT '计划联系人手机号' AFTER `name`, | |||
| MODIFY COLUMN `douyin_id` json COMMENT '抖音号' AFTER `content_type`, | |||
| ADD COLUMN `douyin_id_status` json COMMENT '达人履约状态' AFTER `douyin_id`, | |||
| ADD COLUMN `commission_duration` bigint(20) COMMENT '佣金有效期,单位是秒' AFTER `end_time`, | |||
| DROP INDEX `tcd_unique`, | |||
| ADD INDEX `tcd_unique`(`tenant_id`, `coupon_id`) USING BTREE; | |||
| ALTER TABLE `mallink`.`tt_poi_take_rate_77` | |||
| ADD COLUMN `merchant_phone` varchar(20) COMMENT '计划联系人手机号' AFTER `name`, | |||
| MODIFY COLUMN `douyin_id` json COMMENT '抖音号' AFTER `content_type`, | |||
| ADD COLUMN `douyin_id_status` json COMMENT '达人履约状态' AFTER `douyin_id`, | |||
| ADD COLUMN `commission_duration` bigint(20) COMMENT '佣金有效期,单位是秒' AFTER `end_time`, | |||
| DROP INDEX `tcd_unique`, | |||
| ADD INDEX `tcd_unique`(`tenant_id`, `coupon_id`) USING BTREE; | |||
| ALTER TABLE `mallink`.`tt_poi_take_rate_78` | |||
| ADD COLUMN `merchant_phone` varchar(20) COMMENT '计划联系人手机号' AFTER `name`, | |||
| MODIFY COLUMN `douyin_id` json COMMENT '抖音号' AFTER `content_type`, | |||
| ADD COLUMN `douyin_id_status` json COMMENT '达人履约状态' AFTER `douyin_id`, | |||
| ADD COLUMN `commission_duration` bigint(20) COMMENT '佣金有效期,单位是秒' AFTER `end_time`, | |||
| DROP INDEX `tcd_unique`, | |||
| ADD INDEX `tcd_unique`(`tenant_id`, `coupon_id`) USING BTREE; | |||
| ALTER TABLE `mallink`.`tt_poi_take_rate_79` | |||
| ADD COLUMN `merchant_phone` varchar(20) COMMENT '计划联系人手机号' AFTER `name`, | |||
| MODIFY COLUMN `douyin_id` json COMMENT '抖音号' AFTER `content_type`, | |||
| ADD COLUMN `douyin_id_status` json COMMENT '达人履约状态' AFTER `douyin_id`, | |||
| ADD COLUMN `commission_duration` bigint(20) COMMENT '佣金有效期,单位是秒' AFTER `end_time`, | |||
| DROP INDEX `tcd_unique`, | |||
| ADD INDEX `tcd_unique`(`tenant_id`, `coupon_id`) USING BTREE; | |||
| ALTER TABLE `mallink`.`tt_poi_take_rate_80` | |||
| ADD COLUMN `merchant_phone` varchar(20) COMMENT '计划联系人手机号' AFTER `name`, | |||
| MODIFY COLUMN `douyin_id` json COMMENT '抖音号' AFTER `content_type`, | |||
| ADD COLUMN `douyin_id_status` json COMMENT '达人履约状态' AFTER `douyin_id`, | |||
| ADD COLUMN `commission_duration` bigint(20) COMMENT '佣金有效期,单位是秒' AFTER `end_time`, | |||
| DROP INDEX `tcd_unique`, | |||
| ADD INDEX `tcd_unique`(`tenant_id`, `coupon_id`) USING BTREE; | |||
| ALTER TABLE `mallink`.`tt_poi_take_rate_81` | |||
| ADD COLUMN `merchant_phone` varchar(20) COMMENT '计划联系人手机号' AFTER `name`, | |||
| MODIFY COLUMN `douyin_id` json COMMENT '抖音号' AFTER `content_type`, | |||
| ADD COLUMN `douyin_id_status` json COMMENT '达人履约状态' AFTER `douyin_id`, | |||
| ADD COLUMN `commission_duration` bigint(20) COMMENT '佣金有效期,单位是秒' AFTER `end_time`, | |||
| DROP INDEX `tcd_unique`, | |||
| ADD INDEX `tcd_unique`(`tenant_id`, `coupon_id`) USING BTREE; | |||
| ALTER TABLE `mallink`.`tt_poi_take_rate_82` | |||
| ADD COLUMN `merchant_phone` varchar(20) COMMENT '计划联系人手机号' AFTER `name`, | |||
| MODIFY COLUMN `douyin_id` json COMMENT '抖音号' AFTER `content_type`, | |||
| ADD COLUMN `douyin_id_status` json COMMENT '达人履约状态' AFTER `douyin_id`, | |||
| ADD COLUMN `commission_duration` bigint(20) COMMENT '佣金有效期,单位是秒' AFTER `end_time`, | |||
| DROP INDEX `tcd_unique`, | |||
| ADD INDEX `tcd_unique`(`tenant_id`, `coupon_id`) USING BTREE; | |||
| ALTER TABLE `mallink`.`tt_poi_take_rate_83` | |||
| ADD COLUMN `merchant_phone` varchar(20) COMMENT '计划联系人手机号' AFTER `name`, | |||
| MODIFY COLUMN `douyin_id` json COMMENT '抖音号' AFTER `content_type`, | |||
| ADD COLUMN `douyin_id_status` json COMMENT '达人履约状态' AFTER `douyin_id`, | |||
| ADD COLUMN `commission_duration` bigint(20) COMMENT '佣金有效期,单位是秒' AFTER `end_time`, | |||
| DROP INDEX `tcd_unique`, | |||
| ADD INDEX `tcd_unique`(`tenant_id`, `coupon_id`) USING BTREE; | |||
| ALTER TABLE `mallink`.`tt_poi_take_rate_84` | |||
| ADD COLUMN `merchant_phone` varchar(20) COMMENT '计划联系人手机号' AFTER `name`, | |||
| MODIFY COLUMN `douyin_id` json COMMENT '抖音号' AFTER `content_type`, | |||
| ADD COLUMN `douyin_id_status` json COMMENT '达人履约状态' AFTER `douyin_id`, | |||
| ADD COLUMN `commission_duration` bigint(20) COMMENT '佣金有效期,单位是秒' AFTER `end_time`, | |||
| DROP INDEX `tcd_unique`, | |||
| ADD INDEX `tcd_unique`(`tenant_id`, `coupon_id`) USING BTREE; | |||
| ALTER TABLE `mallink`.`tt_poi_take_rate_85` | |||
| ADD COLUMN `merchant_phone` varchar(20) COMMENT '计划联系人手机号' AFTER `name`, | |||
| MODIFY COLUMN `douyin_id` json COMMENT '抖音号' AFTER `content_type`, | |||
| ADD COLUMN `douyin_id_status` json COMMENT '达人履约状态' AFTER `douyin_id`, | |||
| ADD COLUMN `commission_duration` bigint(20) COMMENT '佣金有效期,单位是秒' AFTER `end_time`, | |||
| DROP INDEX `tcd_unique`, | |||
| ADD INDEX `tcd_unique`(`tenant_id`, `coupon_id`) USING BTREE; | |||
| ALTER TABLE `mallink`.`tt_poi_take_rate_86` | |||
| ADD COLUMN `merchant_phone` varchar(20) COMMENT '计划联系人手机号' AFTER `name`, | |||
| MODIFY COLUMN `douyin_id` json COMMENT '抖音号' AFTER `content_type`, | |||
| ADD COLUMN `douyin_id_status` json COMMENT '达人履约状态' AFTER `douyin_id`, | |||
| ADD COLUMN `commission_duration` bigint(20) COMMENT '佣金有效期,单位是秒' AFTER `end_time`, | |||
| DROP INDEX `tcd_unique`, | |||
| ADD INDEX `tcd_unique`(`tenant_id`, `coupon_id`) USING BTREE; | |||
| ALTER TABLE `mallink`.`tt_poi_take_rate_87` | |||
| ADD COLUMN `merchant_phone` varchar(20) COMMENT '计划联系人手机号' AFTER `name`, | |||
| MODIFY COLUMN `douyin_id` json COMMENT '抖音号' AFTER `content_type`, | |||
| ADD COLUMN `douyin_id_status` json COMMENT '达人履约状态' AFTER `douyin_id`, | |||
| ADD COLUMN `commission_duration` bigint(20) COMMENT '佣金有效期,单位是秒' AFTER `end_time`, | |||
| DROP INDEX `tcd_unique`, | |||
| ADD INDEX `tcd_unique`(`tenant_id`, `coupon_id`) USING BTREE; | |||
| ALTER TABLE `mallink`.`tt_poi_take_rate_88` | |||
| ADD COLUMN `merchant_phone` varchar(20) COMMENT '计划联系人手机号' AFTER `name`, | |||
| MODIFY COLUMN `douyin_id` json COMMENT '抖音号' AFTER `content_type`, | |||
| ADD COLUMN `douyin_id_status` json COMMENT '达人履约状态' AFTER `douyin_id`, | |||
| ADD COLUMN `commission_duration` bigint(20) COMMENT '佣金有效期,单位是秒' AFTER `end_time`, | |||
| DROP INDEX `tcd_unique`, | |||
| ADD INDEX `tcd_unique`(`tenant_id`, `coupon_id`) USING BTREE; | |||
| ALTER TABLE `mallink`.`tt_poi_take_rate_89` | |||
| ADD COLUMN `merchant_phone` varchar(20) COMMENT '计划联系人手机号' AFTER `name`, | |||
| MODIFY COLUMN `douyin_id` json COMMENT '抖音号' AFTER `content_type`, | |||
| ADD COLUMN `douyin_id_status` json COMMENT '达人履约状态' AFTER `douyin_id`, | |||
| ADD COLUMN `commission_duration` bigint(20) COMMENT '佣金有效期,单位是秒' AFTER `end_time`, | |||
| DROP INDEX `tcd_unique`, | |||
| ADD INDEX `tcd_unique`(`tenant_id`, `coupon_id`) USING BTREE; | |||
| ALTER TABLE `mallink`.`tt_poi_take_rate_90` | |||
| ADD COLUMN `merchant_phone` varchar(20) COMMENT '计划联系人手机号' AFTER `name`, | |||
| MODIFY COLUMN `douyin_id` json COMMENT '抖音号' AFTER `content_type`, | |||
| ADD COLUMN `douyin_id_status` json COMMENT '达人履约状态' AFTER `douyin_id`, | |||
| ADD COLUMN `commission_duration` bigint(20) COMMENT '佣金有效期,单位是秒' AFTER `end_time`, | |||
| DROP INDEX `tcd_unique`, | |||
| ADD INDEX `tcd_unique`(`tenant_id`, `coupon_id`) USING BTREE; | |||
| ALTER TABLE `mallink`.`tt_poi_take_rate_91` | |||
| ADD COLUMN `merchant_phone` varchar(20) COMMENT '计划联系人手机号' AFTER `name`, | |||
| MODIFY COLUMN `douyin_id` json COMMENT '抖音号' AFTER `content_type`, | |||
| ADD COLUMN `douyin_id_status` json COMMENT '达人履约状态' AFTER `douyin_id`, | |||
| ADD COLUMN `commission_duration` bigint(20) COMMENT '佣金有效期,单位是秒' AFTER `end_time`, | |||
| DROP INDEX `tcd_unique`, | |||
| ADD INDEX `tcd_unique`(`tenant_id`, `coupon_id`) USING BTREE; | |||
| ALTER TABLE `mallink`.`tt_poi_take_rate_92` | |||
| ADD COLUMN `merchant_phone` varchar(20) COMMENT '计划联系人手机号' AFTER `name`, | |||
| MODIFY COLUMN `douyin_id` json COMMENT '抖音号' AFTER `content_type`, | |||
| ADD COLUMN `douyin_id_status` json COMMENT '达人履约状态' AFTER `douyin_id`, | |||
| ADD COLUMN `commission_duration` bigint(20) COMMENT '佣金有效期,单位是秒' AFTER `end_time`, | |||
| DROP INDEX `tcd_unique`, | |||
| ADD INDEX `tcd_unique`(`tenant_id`, `coupon_id`) USING BTREE; | |||
| ALTER TABLE `mallink`.`tt_poi_take_rate_93` | |||
| ADD COLUMN `merchant_phone` varchar(20) COMMENT '计划联系人手机号' AFTER `name`, | |||
| MODIFY COLUMN `douyin_id` json COMMENT '抖音号' AFTER `content_type`, | |||
| ADD COLUMN `douyin_id_status` json COMMENT '达人履约状态' AFTER `douyin_id`, | |||
| ADD COLUMN `commission_duration` bigint(20) COMMENT '佣金有效期,单位是秒' AFTER `end_time`, | |||
| DROP INDEX `tcd_unique`, | |||
| ADD INDEX `tcd_unique`(`tenant_id`, `coupon_id`) USING BTREE; | |||
| ALTER TABLE `mallink`.`tt_poi_take_rate_94` | |||
| ADD COLUMN `merchant_phone` varchar(20) COMMENT '计划联系人手机号' AFTER `name`, | |||
| MODIFY COLUMN `douyin_id` json COMMENT '抖音号' AFTER `content_type`, | |||
| ADD COLUMN `douyin_id_status` json COMMENT '达人履约状态' AFTER `douyin_id`, | |||
| ADD COLUMN `commission_duration` bigint(20) COMMENT '佣金有效期,单位是秒' AFTER `end_time`, | |||
| DROP INDEX `tcd_unique`, | |||
| ADD INDEX `tcd_unique`(`tenant_id`, `coupon_id`) USING BTREE; | |||
| ALTER TABLE `mallink`.`tt_poi_take_rate_95` | |||
| ADD COLUMN `merchant_phone` varchar(20) COMMENT '计划联系人手机号' AFTER `name`, | |||
| MODIFY COLUMN `douyin_id` json COMMENT '抖音号' AFTER `content_type`, | |||
| ADD COLUMN `douyin_id_status` json COMMENT '达人履约状态' AFTER `douyin_id`, | |||
| ADD COLUMN `commission_duration` bigint(20) COMMENT '佣金有效期,单位是秒' AFTER `end_time`, | |||
| DROP INDEX `tcd_unique`, | |||
| ADD INDEX `tcd_unique`(`tenant_id`, `coupon_id`) USING BTREE; | |||
| ALTER TABLE `mallink`.`tt_poi_take_rate_96` | |||
| ADD COLUMN `merchant_phone` varchar(20) COMMENT '计划联系人手机号' AFTER `name`, | |||
| MODIFY COLUMN `douyin_id` json COMMENT '抖音号' AFTER `content_type`, | |||
| ADD COLUMN `douyin_id_status` json COMMENT '达人履约状态' AFTER `douyin_id`, | |||
| ADD COLUMN `commission_duration` bigint(20) COMMENT '佣金有效期,单位是秒' AFTER `end_time`, | |||
| DROP INDEX `tcd_unique`, | |||
| ADD INDEX `tcd_unique`(`tenant_id`, `coupon_id`) USING BTREE; | |||
| ALTER TABLE `mallink`.`tt_poi_take_rate_97` | |||
| ADD COLUMN `merchant_phone` varchar(20) COMMENT '计划联系人手机号' AFTER `name`, | |||
| MODIFY COLUMN `douyin_id` json COMMENT '抖音号' AFTER `content_type`, | |||
| ADD COLUMN `douyin_id_status` json COMMENT '达人履约状态' AFTER `douyin_id`, | |||
| ADD COLUMN `commission_duration` bigint(20) COMMENT '佣金有效期,单位是秒' AFTER `end_time`, | |||
| DROP INDEX `tcd_unique`, | |||
| ADD INDEX `tcd_unique`(`tenant_id`, `coupon_id`) USING BTREE; | |||
| ALTER TABLE `mallink`.`tt_poi_take_rate_98` | |||
| ADD COLUMN `merchant_phone` varchar(20) COMMENT '计划联系人手机号' AFTER `name`, | |||
| MODIFY COLUMN `douyin_id` json COMMENT '抖音号' AFTER `content_type`, | |||
| ADD COLUMN `douyin_id_status` json COMMENT '达人履约状态' AFTER `douyin_id`, | |||
| ADD COLUMN `commission_duration` bigint(20) COMMENT '佣金有效期,单位是秒' AFTER `end_time`, | |||
| DROP INDEX `tcd_unique`, | |||
| ADD INDEX `tcd_unique`(`tenant_id`, `coupon_id`) USING BTREE; | |||
| ALTER TABLE `mallink`.`tt_poi_take_rate_99` | |||
| ADD COLUMN `merchant_phone` varchar(20) COMMENT '计划联系人手机号' AFTER `name`, | |||
| MODIFY COLUMN `douyin_id` json COMMENT '抖音号' AFTER `content_type`, | |||
| ADD COLUMN `douyin_id_status` json COMMENT '达人履约状态' AFTER `douyin_id`, | |||
| ADD COLUMN `commission_duration` bigint(20) COMMENT '佣金有效期,单位是秒' AFTER `end_time`, | |||
| DROP INDEX `tcd_unique`, | |||
| ADD INDEX `tcd_unique`(`tenant_id`, `coupon_id`) USING BTREE; | |||
| @@ -2,13 +2,17 @@ package com.iformall.controller; | |||
| import com.alibaba.fastjson.JSON; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.common.ErrorCode; | |||
| import com.iformall.common.Result; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.domain.dto.WxCouponChannelDto; | |||
| import com.iformall.domain.po.WxCoupon; | |||
| import com.iformall.domain.po.WxCouponChannel; | |||
| import com.iformall.domain.po.base.BaseEntity; | |||
| import com.iformall.domain.vo.WxCouponChannelVo; | |||
| import com.iformall.enums.EnumCouponStatus; | |||
| import com.iformall.service.WxCouponChannelService; | |||
| import com.iformall.service.WxCouponService; | |||
| import com.iformall.service.util.CouponCacheUtils; | |||
| import io.swagger.annotations.Api; | |||
| @@ -36,6 +40,9 @@ public class WxCouponChannelController extends BaseController { | |||
| @Autowired | |||
| private WxCouponChannelService wxCouponChannelService; | |||
| @Autowired | |||
| private WxCouponService wxCouponService; | |||
| @Autowired | |||
| @Qualifier("objectCommonRedisTemplate") | |||
| @@ -98,7 +98,7 @@ public class WxCouponController extends BaseController { | |||
| Integer[] typeArray = { | |||
| EnumCouponType.COUPON_MANJIAN.getCode(), | |||
| EnumCouponType.COUPON_DAIJIN.getCode(), | |||
| EnumCouponType.COUPON_TUANGOU.getCode(), | |||
| // EnumCouponType.COUPON_TUANGOU.getCode(), | |||
| EnumCouponType.COUPON_LIPIN.getCode(), | |||
| EnumCouponType.COUPON_TINGCHE.getCode(), | |||
| EnumCouponType.COUPON_MULTIMCH.getCode(), | |||
| @@ -230,36 +230,62 @@ public class WxCouponController extends BaseController { | |||
| @ApiOperation("根据id更新接口") | |||
| @PostMapping("update") | |||
| public ResultData update(@RequestBody WxCoupon wxCoupon) { | |||
| if (!hasMerchantCouponFlow()) { | |||
| return new ResultData(Result.ERROR,EnumFlowKey.B_COUPON_MERCHANT_CREATE.getMessage()+"未配置审批流程"); | |||
| } | |||
| logger.debug("[" + getIpAddr() + "] WxCouponController::update"); | |||
| if (wxCoupon.getId() == null) { | |||
| return new ResultData(ResultData.ERROR, "缺少id"); | |||
| } | |||
| WxCoupon coupon = wxCouponService.getById(wxCoupon.getId(),wxCoupon.getTenantId()); | |||
| if (null == coupon) { | |||
| return new ResultData(ResultData.ERROR, "券未查询到。"+wxCoupon.getId()); | |||
| } | |||
| wxCoupon.updateTenantInfo(getTenantInfo()); | |||
| if(EnumDelFlag.YES.getCode().equals(wxCoupon.getIsDel())){ | |||
| WxCouponChannel query = new WxCouponChannel(); | |||
| query.updateTenantInfo(wxCoupon); | |||
| query.setCouponId(wxCoupon.getId()); | |||
| query.setStatus(EnumCouponChannelStatus.STATUS_THROW_IN.getCode()); | |||
| if (CollectionUtils.isNotEmpty(wxCouponChannelService.findList(query))) { | |||
| return new ResultData(ResultData.ERROR, "有活动正在上架,请先下架。"); | |||
| if(!EnumCouponStatus.COUPON_STATUS_TAKE_OFFF.getCode().equals(coupon.getStatus())){ | |||
| return new ResultData(ResultData.ERROR, "请先作废,再进行删除。"); | |||
| } | |||
| wxCouponService.deleteById(wxCoupon.getId(),wxCoupon.getTenantId()); | |||
| CouponCacheUtils.removeCouponCache(redisTemplate, wxCoupon.getId()); | |||
| CouponCacheUtils.removeCouponMerchantCache(redisTemplate, wxCoupon.getId()); | |||
| return new ResultData(); | |||
| } | |||
| List<WxMerchant> merchantList = new ArrayList<>(); | |||
| WxMerchant wxMerchant = wxMerchantService.getById(getLoginBUser().getMerchantId()); | |||
| merchantList.add(wxMerchant); | |||
| if (!hasMerchantCouponFlow()) { | |||
| return new ResultData(Result.ERROR,EnumFlowKey.B_COUPON_MERCHANT_CREATE.getMessage()+"未配置审批流程"); | |||
| } | |||
| wxCoupon.setMerchantParams(JSONObject.toJSONString(merchantList)); | |||
| //启动审批流 | |||
| WxMerchantBUser buser = getLoginBUser(); | |||
| if (wxCoupon.getFlowParams() != null && wxCoupon.getFlowParams().size() > 0) { | |||
| logger.info("------coupon.update().businessType:"+wxCoupon.getFlowParams().get("businessType")); | |||
| wxCoupon.getFlowParams().put("businessId",wxCoupon.getId()); | |||
| wxFlowService.start(wxCoupon.getFlowParams(), buser.getId(), buser.getName(), getTenantInfo()); | |||
| //作废审批 | |||
| if (EnumCouponStatus.COUPON_STATUS_TAKE_OFFF.getCode().equals(wxCoupon.getStatus())) { | |||
| wxCoupon.setCancleApplyStatus(EnumRentContractAppStatus.APPLYING.getCode()); | |||
| return new ResultData(wxCoupon); | |||
| } else { | |||
| //投放审批 | |||
| wxCoupon.setPutApplyStatus(EnumRentContractAppStatus.APPLYING.getCode()); | |||
| } | |||
| } | |||
| WxCoupon coupon = wxCouponService.getById(wxCoupon.getId(),wxCoupon.getTenantId()); | |||
| if (null == coupon) { | |||
| return new ResultData(ResultData.ERROR, "券未查询到。"+wxCoupon.getId()); | |||
| ResultData result = null; | |||
| if(EnumCouponStatus.COUPON_STATUS_TAKE_OFFF.getCode().equals(wxCoupon.getStatus())){ | |||
| result = wxCouponService.disable(wxCoupon, wxCoupon.getId()); | |||
| }else{ | |||
| List<WxMerchant> merchantList = new ArrayList<>(); | |||
| WxMerchant wxMerchant = wxMerchantService.selectById(getLoginBUser().getMerchantId()); | |||
| merchantList.add(wxMerchant); | |||
| wxCoupon.setMerchantParams(JSONObject.toJSONString(merchantList)); | |||
| result = wxCouponService.saveOrUpdate(wxCoupon); | |||
| if(wxCoupon.getRemainInventory() != null){ | |||
| redisLock.setCouponStock(wxCoupon.getId(), wxCoupon.getRemainInventory()); | |||
| } | |||
| } | |||
| redisLock.setCouponStock(wxCoupon.getId(), coupon.getRemainInventory()); | |||
| ResultData result = wxCouponService.saveOrUpdate(wxCoupon); | |||
| CouponCacheUtils.removeCouponCache(redisTemplate, wxCoupon.getId()); | |||
| CouponCacheUtils.removeCouponMerchantCache(redisTemplate, wxCoupon.getId()); | |||
| return result; | |||
| @@ -184,18 +184,10 @@ public class WxMerchantController extends BaseController { | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(),"请检查传递参数"); | |||
| } | |||
| WxAppinfo appInfo = wxAppinfoService.getCAppInfo(getTenantInfo(), EnumAppPlat.TOUTIAO); | |||
| if(appInfo == null) { | |||
| return new ResultData(ErrorCode.APP_ID_NOT_FOUND); | |||
| } | |||
| WxPayAccount payAcount = payAccountService.getById(appInfo.getPayId()); | |||
| if(payAcount == null){ | |||
| return new ResultData(ErrorCode.APP_ID_NOT_FOUND); | |||
| } | |||
| if(anEnum.equals(AppAddSubMerchantUrlType.improt_URL)){ | |||
| return wxProfitSharingReceiverService.getTtReceiverImprotURL(merchant,appInfo.getAppId(),payAcount.getApiKey()); | |||
| return wxProfitSharingReceiverService.getTtReceiverImprotURL(merchant); | |||
| }else if(anEnum.equals(AppAddSubMerchantUrlType.Balance_URL)){ | |||
| return wxProfitSharingReceiverService.getTtReceiverBalanceURL(merchant,appInfo.getAppId(),payAcount.getApiKey()); | |||
| return wxProfitSharingReceiverService.getTtReceiverBalanceURL(merchant); | |||
| }else{ | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(),"请检查传递参数"); | |||
| } | |||
| @@ -146,11 +146,11 @@ public class BaseController { | |||
| throw new MallinkException(ErrorCode.USER_APPINFO_NOT_EXIST); | |||
| } | |||
| WxPayAccount payAccount = RedisCacheUtils.getCacheObject(objectCommonRedisTemplate, "payAccount:"+appinfo.getPayId(), WxPayAccount.class); | |||
| WxPayAccount payAccount = RedisCacheUtils.getCacheObject(objectCommonRedisTemplate, Constant.payaccountPrev+appinfo.getPayId(), WxPayAccount.class); | |||
| if (null == payAccount) { | |||
| payAccount = wxPayAccountService.getById(appinfo.getPayId()); | |||
| if (null != payAccount) { | |||
| RedisCacheUtils.cache(objectCommonRedisTemplate, "payAccount:"+appinfo.getPayId(), payAccount, 24*60*60); | |||
| RedisCacheUtils.cache(objectCommonRedisTemplate, Constant.payaccountPrev+appinfo.getPayId(), payAccount, 24*60*60); | |||
| } | |||
| } | |||
| if (null == payAccount) { | |||
| @@ -245,7 +245,7 @@ public class BaseController { | |||
| } | |||
| public WxAppinfo getAppInfo(String appId) { | |||
| return wxAppinfoService.getByAppId(appId); | |||
| return wxAppinfoService.getByAppIdFromRedis(appId); | |||
| } | |||
| public WxMaService getWeappService(String appId) { | |||
| @@ -0,0 +1,74 @@ | |||
| package com.iformall.controller; | |||
| import com.iformall.annotation.RedisCache; | |||
| import com.iformall.common.ErrorCode; | |||
| import com.iformall.common.Result; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.domain.po.*; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import com.iformall.enums.EnumAppPlat; | |||
| import com.iformall.enums.EnumBusinessCircleAuthorizeState; | |||
| import com.iformall.service.*; | |||
| import com.iformall.utils.Constant; | |||
| import com.iformall.utils.RedisCacheUtils; | |||
| import io.swagger.annotations.Api; | |||
| import io.swagger.annotations.ApiOperation; | |||
| import org.apache.commons.lang3.StringUtils; | |||
| import org.slf4j.Logger; | |||
| import org.slf4j.LoggerFactory; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.beans.factory.annotation.Qualifier; | |||
| import org.springframework.data.redis.core.RedisTemplate; | |||
| import org.springframework.web.bind.annotation.*; | |||
| @RestController | |||
| @RequestMapping("/api/circle") | |||
| @Api(description = "业态查询接口") | |||
| public class WxBusinessCircleController extends BaseController { | |||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||
| @Autowired | |||
| WxBusinessCircleOrderService wxBusinessCircleOrderService; | |||
| @Autowired | |||
| @Qualifier("objectCommonRedisTemplate") | |||
| RedisTemplate<String, Object> objectCommonRedisTemplate; | |||
| @ApiOperation("获取商圈授权状态") | |||
| @GetMapping("/getAuthorizeState") | |||
| public ResultData getAuthorizeState() { | |||
| logger.debug("[" + getIpAddr() + "] WxBusinessCircleController::getAuthorizeState"); | |||
| CUser user = getCUser(); | |||
| if(!EnumAppPlat.WX.equals(user.getAppPlat())){ | |||
| return new ResultData(ErrorCode.SYS_METHOD_NOT_SUPPORT.getCode(),"平台不支持此请求"); | |||
| } | |||
| String key = Constant.wx_user_authorize_state + user.getOpenId(); | |||
| EnumBusinessCircleAuthorizeState cacheObject = RedisCacheUtils.getCacheObject(objectCommonRedisTemplate, key, EnumBusinessCircleAuthorizeState.class); | |||
| if(cacheObject != null){ | |||
| return new ResultData(cacheObject); | |||
| } | |||
| ResultData resultData = wxBusinessCircleOrderService.syncauthorizeState(getTenantInfo(), user.getOpenId()); | |||
| if(Result.SUCCESS == resultData.code){ | |||
| EnumBusinessCircleAuthorizeState data = (EnumBusinessCircleAuthorizeState) resultData.data; | |||
| if(EnumBusinessCircleAuthorizeState.AUTHORIZED.equals(data)){ | |||
| RedisCacheUtils.cache(objectCommonRedisTemplate,key,data,3600*24*3); | |||
| } | |||
| } | |||
| return resultData; | |||
| } | |||
| @ApiOperation("获取商圈有未提交的积分") | |||
| @GetMapping("/getPointsCommitStatus") | |||
| public ResultData getPointsCommitStatus() { | |||
| logger.debug("[" + getIpAddr() + "] WxBusinessCircleController::getPointsCommitStatus"); | |||
| CUser user = getCUser(); | |||
| if(!EnumAppPlat.WX.equals(user.getAppPlat())){ | |||
| return new ResultData(ErrorCode.SYS_METHOD_NOT_SUPPORT.getCode(),"平台不支持此请求"); | |||
| } | |||
| return wxBusinessCircleOrderService.getPointsCommitStatus(getTenantInfo(), user.getOpenId()); | |||
| } | |||
| } | |||
| @@ -206,14 +206,14 @@ public class WxOrderController extends BaseController { | |||
| } | |||
| //验证app | |||
| WxAppinfo appinfo = wxAppinfoService.getByAppId(app_id); | |||
| WxAppinfo appinfo = wxAppinfoService.getByAppIdFromRedis(app_id); | |||
| if(appinfo == null || !EnumAppPlat.TOUTIAO.getCode().equals(appinfo.getPlat()) | |||
| || !EnumAppType.C.getCode().equals(appinfo.getType())){ | |||
| map.put("err_no",ErrorCode.APP_ID_NOT_FOUND.getCode()); | |||
| map.put("err_tips",ErrorCode.APP_ID_NOT_FOUND.getMessage()); | |||
| return map; | |||
| } | |||
| WxPayAccount payAccount = wxPayAccountService.getById(appinfo.getPayId()); | |||
| WxPayAccount payAccount = wxPayAccountService.getByIdFromRedis(appinfo.getPayId()); | |||
| if(payAccount == null){ | |||
| map.put("err_no",ErrorCode.API_KEY_NOT_FOUND.getCode()); | |||
| map.put("err_tips","未找到支付配置"); | |||
| @@ -255,23 +255,6 @@ public class WxOrderController extends BaseController { | |||
| data.put("order_goods_info",order.getExtParam()); | |||
| } | |||
| // List<Map<String,Object>> goodsValid = new ArrayList<>(); | |||
| // for (Long couponChannelId:order.getCouponChannelMap().keySet()) { | |||
| // Map<String,Object> goodsValidMap = new HashMap<>(); | |||
| // WxCouponChannel couponChannel = order.getCouponChannelMap().get(couponChannelId); | |||
| // goodsValidMap.put("goods_id",couponChannel.getTtSpuId()); | |||
| // WxCoupon wxCoupon = order.getCouponMap().get(couponChannel.getCouponId()); | |||
| // if(EnumCouponValidType.BETWEEN_TWO_TIME.getCode().equals(wxCoupon.getValidType())){ | |||
| // goodsValidMap.put("valid_start_time",wxCoupon.getValidStartDate().getTime()); | |||
| // goodsValidMap.put("valid_end_time",wxCoupon.getValidEndDate().getTime()); | |||
| // }else{ | |||
| // goodsValidMap.put("valid_duration",(long)wxCoupon.getValidDays()*24*3600*1000); | |||
| // } | |||
| // goodsValid.add(goodsValidMap); | |||
| // } | |||
| // data.put("order_valid_time",goodsValid); | |||
| map.put("data",data); | |||
| map.put("err_no",0); | |||
| map.put("err_tips",resultData.message); | |||
| @@ -296,209 +279,6 @@ public class WxOrderController extends BaseController { | |||
| } | |||
| } | |||
| // @AuthIgnore | |||
| // @ApiOperation(value = "抖音支付2.0与下单回调推送订单", notes = "{\"couponChannelId\":\"String\",\"couponId\":\"String\",\"press\":\"String\",\"orderGroupId\":\"String\",\"formId\":\"String\"}") | |||
| // @PostMapping("douyinPushOrder") | |||
| // public Map<String,Object> douyinPushOrder(HttpServletRequest request) { | |||
| // | |||
| // Map<String, Object> map = new HashMap(); | |||
| // | |||
| // SignatureHeader header = new SignatureHeader(); | |||
| // header.setTimeStamp(request.getHeader("Byte-Timestamp")); | |||
| // header.setNonce(request.getHeader("Byte-Nonce-Str")); | |||
| // header.setSigned(request.getHeader("Byte-Signature")); | |||
| // | |||
| // logger.info("支付2.0预下单回调---header{}"+header.toString()); | |||
| // | |||
| // String body = ((BodyReaderHttpServletRequestWrapper) request).getBody(); | |||
| // logger.info("支付2.0预下单回调---body{}"+body); | |||
| // try { | |||
| // JSONObject jsonObject = JSONObject.parseObject(body); | |||
| // String msg = jsonObject.getString("msg"); | |||
| // | |||
| // JSONObject msgObject = JSONObject.parseObject(msg); | |||
| // String app_id = msgObject.getString("app_id"); | |||
| // String open_id = msgObject.getString("open_id"); | |||
| // //透传字段 | |||
| // Map<String,String> couponMap = new HashMap<>(); | |||
| // try{ | |||
| // String cp_extra = msgObject.getString("cp_extra"); | |||
| // if(StringUtils.isBlank(cp_extra)){ | |||
| // map.put("err_no",ErrorCode.SYS_PARAMETER_NOT_NULL.getCode()); | |||
| // map.put("err_tips","缺少透传字段"); | |||
| // return map; | |||
| // } | |||
| // couponMap = JSONObject.parseObject(cp_extra, Map.class); | |||
| // }catch(Exception e){ | |||
| // } | |||
| // if(couponMap.isEmpty()){ | |||
| // map.put("err_no",ErrorCode.SYS_PARAMETER_NOT_NULL.getCode()); | |||
| // map.put("err_tips","透传字段格式不正确"); | |||
| // return map; | |||
| // } | |||
| // | |||
| // //验证app | |||
| // WxAppinfo appinfo = wxAppinfoService.getByAppId(app_id); | |||
| // if(appinfo == null || !EnumAppPlat.TOUTIAO.getCode().equals(appinfo.getPlat()) | |||
| // || !EnumAppType.C.getCode().equals(appinfo.getType())){ | |||
| // map.put("err_no",ErrorCode.APP_ID_NOT_FOUND.getCode()); | |||
| // map.put("err_tips",ErrorCode.APP_ID_NOT_FOUND.getMessage()); | |||
| // return map; | |||
| // } | |||
| // WxPayAccount payAccount = wxPayAccountService.getById(appinfo.getPayId()); | |||
| // if(payAccount == null){ | |||
| // map.put("err_no",ErrorCode.API_KEY_NOT_FOUND.getCode()); | |||
| // map.put("err_tips","未找到支付配置"); | |||
| // return map; | |||
| // } | |||
| // TenantEntity tenantEntity = new TenantEntity(); | |||
| // tenantEntity.updateTenantInfo(appinfo); | |||
| // //验证用户 | |||
| // Long memberId = null; | |||
| // TtCUser cuser = (TtCUser) cuserFactory.getCUserService(EnumAppPlat.TOUTIAO).getByOpenId(open_id, tenantEntity.getTenantId()); | |||
| // if(cuser != null && cuser.getUserId() != null){ | |||
| // memberId = cuser.getUserId(); | |||
| // } | |||
| // if(memberId == null){ | |||
| // map.put("err_no",ErrorCode.USER_NOT_MEMBER.getCode()); | |||
| // map.put("err_tips",ErrorCode.USER_NOT_MEMBER.getMessage()); | |||
| // return map; | |||
| // } | |||
| // | |||
| // | |||
| // TtPayService ttPayService = maUtil.getTtPayService(appinfo, payAccount); | |||
| // CreateOrderCallback createOrderCallback = ttPayService.parseOrderNotifyV2Result(body, header); | |||
| // JSONObject allExtParam = new JSONObject(); | |||
| // allExtParam.put("order_id",createOrderCallback.getOrderId()); | |||
| // allExtParam.put("total_amount",createOrderCallback.getTotalAmount()); | |||
| // allExtParam.put("discount",createOrderCallback.getDiscount()); | |||
| // allExtParam.put("open_id",createOrderCallback.getOpenId()); | |||
| // | |||
| // List<PlatPushOrderSaveDto> list = new ArrayList<>(); | |||
| // for (CreateOrderCallback.Good good:createOrderCallback.getGoods()) { | |||
| // PlatPushOrderSaveDto dto = new PlatPushOrderSaveDto(); | |||
| // dto.setCouponChannelId(Long.parseLong(couponMap.get(good.getGoodsId()))); | |||
| // dto.setCount(good.getQuantity()); | |||
| // dto.setExtParam(JSON.toJSONString(good.getItemOrderInfoList())); | |||
| // list.add(dto); | |||
| // } | |||
| // | |||
| // ResultData resultData = wxOrderService.platPushSaveOrder(true, EnumComposeOrder.ONE_NUMBER_ORDER_BATCH, allExtParam.toJSONString(), list, memberId, EnumPayWay.PAY_WAY_TT, tenantEntity); | |||
| // logger.info("resultData{}"+JSON.toJSONString(resultData)); | |||
| // if(resultData.code == 200){ | |||
| // WxComposeOrder order = (WxComposeOrder) resultData.data; | |||
| // Map<String, Object> data = new HashMap<>(); | |||
| // data.put("out_order_no",order.getMainOrderId().toString()); | |||
| // data.put("pay_expire_seconds",15*60); | |||
| // data.put("order_entry_schema",wxOrderService.getOrderEntrySchema(order.getMainOrderId())); | |||
| //// List<Map<String,Object>> goodsValid = new ArrayList<>(); | |||
| //// for (Long couponChannelId:order.getCouponChannelMap().keySet()) { | |||
| //// Map<String,Object> goodsValidMap = new HashMap<>(); | |||
| //// WxCouponChannel couponChannel = order.getCouponChannelMap().get(couponChannelId); | |||
| //// goodsValidMap.put("goods_id",couponChannel.getTtSpuId()); | |||
| //// WxCoupon wxCoupon = order.getCouponMap().get(couponChannel.getCouponId()); | |||
| //// if(EnumCouponValidType.BETWEEN_TWO_TIME.getCode().equals(wxCoupon.getValidType())){ | |||
| //// goodsValidMap.put("valid_start_time",wxCoupon.getValidStartDate().getTime()); | |||
| //// goodsValidMap.put("valid_end_time",wxCoupon.getValidEndDate().getTime()); | |||
| //// }else{ | |||
| //// goodsValidMap.put("valid_duration",(long)wxCoupon.getValidDays()*24*3600*1000); | |||
| //// } | |||
| //// goodsValid.add(goodsValidMap); | |||
| //// } | |||
| //// data.put("order_valid_time",goodsValid); | |||
| // | |||
| // map.put("data",data); | |||
| // map.put("err_no",0); | |||
| // map.put("err_tips",resultData.message); | |||
| // logger.info("resultData{}"+JSON.toJSONString(map)); | |||
| // return map; | |||
| // }else{ | |||
| // map.put("err_no",resultData.code); | |||
| // map.put("err_tips",resultData.message); | |||
| // return map; | |||
| // } | |||
| // | |||
| // } catch (TtPayException e) { | |||
| // logger.error(e.getMessage()); | |||
| // map.put("err_no",ErrorCode.SYS_BEAN_EMPTY_PROPERTY_ERROR.getCode()); | |||
| // map.put("err_tips",e.getMessage()); | |||
| // return map; | |||
| // } catch (Exception e){ | |||
| // logger.error(e.getMessage()); | |||
| // map.put("err_no",ErrorCode.SYS_SERVER_ERROR.getCode()); | |||
| // map.put("err_tips",e.getMessage()); | |||
| // return map; | |||
| // } | |||
| // } | |||
| // @ApiOperation(value = "继续支付", notes = "{\"composeOrderId\":\"string\"}") | |||
| // @PostMapping("/continueToPay") | |||
| // public ResultData continueToPay(@RequestBody Map<String, Object> paramMap) { | |||
| // logger.info("/api/order/continueToPay" + paramMap.toString()); | |||
| // String orderIdStr = (String) paramMap.get("composeOrderId"); | |||
| // if (StringUtils.isBlank(orderIdStr)) { | |||
| // logger.info("orderId不能为空: " + paramMap.toString()); | |||
| // return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "orderId不能为空"); | |||
| // } | |||
| // Long orderId = 0L; | |||
| // try { | |||
| // orderId = Long.valueOf(orderIdStr); | |||
| // } catch (NumberFormatException e) { | |||
| // logger.error("orderId参数不正确: " + paramMap.toString() + ", e:" + e.getMessage()); | |||
| // return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "orderId参数不正确"); | |||
| // } | |||
| // | |||
| // WxBatchOrder batchOrder = wxOrderService.getWxBatchOrder(getTenantInfo(),orderId); | |||
| // if(batchOrder == null){ | |||
| // return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(), "未找到订单"); | |||
| // } | |||
| // | |||
| // WxPayOrder payOrder = new WxPayOrder(); | |||
| // payOrder.setOrderId(orderId); | |||
| // payOrder.updateTenantInfo(getTenantInfo()); | |||
| // payOrder.setPayVendor(batchOrder.getPayVendor()); | |||
| // payOrder.setComposeOrder(batchOrder.getOrderType()); | |||
| // | |||
| // try { | |||
| // WxPayOrder byObj = wxPayOrderService.getByObj(payOrder); | |||
| // if(byObj == null){ | |||
| // return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(), "未找到支付订单"); | |||
| // } | |||
| // if(EnumPayStatus.PAY_STATUS_WAIT.getCode().equals(byObj.getPayOrderStatus())){ | |||
| // WxComposeOrder composeOrder = orderFactory.getOrderAdapterService(byObj.getComposeOrder()).getComposeOrder(byObj.getOrderId(), byObj.getTenantId()); | |||
| // | |||
| // WxAppinfo appInfo = wxAppinfoService.getCAppInfo(byObj, EnumPayWay.getEnum(byObj.getPayVendor()).getPlat()); | |||
| // //WxCUser user = getUser(); | |||
| // //WxAppinfo appInfo = getAppInfo(user.getAppId()); | |||
| // if (null == appInfo) { | |||
| // return new ResultData(ErrorCode.PAY_ORDER_ERROR, "当前支付类型["+byObj.getPayVendor()+"]找不到C端appInfo"); | |||
| // } | |||
| // WxPayAccount payAccount = wxPayAccountService.getById(appInfo.getPayId()); | |||
| // try { | |||
| // WxPayOrder wo = wxPayOrderService.handleWxOrderQuery(byObj, composeOrder,appInfo, payAccount, IdWorker.get(),false); | |||
| // if (null != wo) { | |||
| // Map<String,Object> map = new HashMap<>(); | |||
| // map.put("outOrderNo",orderId); | |||
| // return new ResultData(map); | |||
| // } | |||
| // }catch(MallinkException e) { | |||
| // //已经同步了微信的支付状态,表示已经更新 | |||
| // return new ResultData(e.getErrorCode(),e.getMessage()); | |||
| // } | |||
| // return new ResultData(ErrorCode.PAY_ORDER_QUERY_ERROR.getCode(), "查询微信订单支付状态失败,请稍后!"); | |||
| // }else{ | |||
| // return new ResultData(ErrorCode.PAY_ORDER_QUERY_ERROR.getCode(), "订单"+EnumPayStatus.getEnum(payOrder.getPayOrderStatus()).getMessage()); | |||
| // } | |||
| // } catch (MallinkException e) { | |||
| // logger.error("支付状态更新失败2: " + orderId + ", e:" + e.getMessage(),e); | |||
| // return new ResultData(e.getErrorCode(), e.getMessage()); | |||
| // } catch (Exception e) { | |||
| // logger.error("支付状态更新失败3: " + orderId + ", e:" + e.getMessage(),e); | |||
| // return new ResultData(ErrorCode.PAY_ORDER_ERROR, "支付状态更新失败3: " + orderId + ", e:" + e.getMessage()); | |||
| // } | |||
| // } | |||
| @ApiOperation(value = "取消订单", notes = "{\"orderId\":\"string\"}") | |||
| @PostMapping("cancel") | |||
| @@ -583,104 +363,6 @@ public class WxOrderController extends BaseController { | |||
| return new ResultData(); | |||
| } | |||
| // @ApiOperation("分页订单列表接口") | |||
| // @GetMapping("list") | |||
| // @ApiImplicitParams({ | |||
| // @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | |||
| // @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true), | |||
| // }) | |||
| // public ResultData list(@ModelAttribute WxOrder wxOrder, Integer pageNum, Integer pageSize) { | |||
| // // c端用户应该只能看到自己的订单 | |||
| // if (wxOrder == null){ | |||
| // wxOrder = new WxOrder(); | |||
| // } | |||
| // Long memberId; | |||
| // try { | |||
| // memberId = getMemberId(); | |||
| // } catch (Exception e) { | |||
| // return new ResultData(Result.ERROR,e.getMessage()); | |||
| // } | |||
| // wxOrder.setCUserId(memberId); | |||
| // wxOrder.setSortColumns(BaseEntity.SortField.UpdateDate_DESC); | |||
| // wxOrder.updateTenantInfo(getTenantInfo()); | |||
| // final PageInfo<WxOrderCouponVo> page = wxOrderService.listCUserVoAsPage(wxOrder, pageNum, pageSize,false); | |||
| // | |||
| // Date now = new Date(); | |||
| // page.getList().stream().forEach(oc->{ | |||
| // if (oc.getValidStartDate() != null && oc.getValidEndDate() != null ) { | |||
| // if (oc.getValidStartDate().getTime() > now.getTime()) { | |||
| // oc.setValidStatus(EnumCouponOrderValidStatus.PREPARED.getCode()); | |||
| // } else if (oc.getValidEndDate().getTime() < now.getTime()) { | |||
| // oc.setValidStatus(EnumCouponOrderValidStatus.ENDED.getCode()); | |||
| // } else { | |||
| // oc.setValidStatus(EnumCouponChannelActivityStatus.STARTED.getCode()); | |||
| // } | |||
| // } | |||
| // }); | |||
| // | |||
| // | |||
| // return new ResultData(page); | |||
| // } | |||
| // @ApiOperation("订单详情接口") | |||
| // @GetMapping("detail") | |||
| // @ApiImplicitParams({ | |||
| // @ApiImplicitParam(name = "orderId", value = "订单id", dataType = "String", paramType = "query", required = true) | |||
| // }) | |||
| // public ResultData detail(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); | |||
| // wxOrder.updateTenantInfo(getTenantInfo()); | |||
| // WxOrderCouponVo wxOrderCVo = wxOrderService.detailCUserVo(wxOrder); | |||
| // if (wxOrderCVo == null) | |||
| // return new ResultData(ErrorCode.ORDER_IS_NOT_FIND); | |||
| // | |||
| // 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("订单详情接口") | |||
| @GetMapping("detail_v1") | |||
| @ApiImplicitParams({ | |||
| @@ -761,35 +443,6 @@ public class WxOrderController extends BaseController { | |||
| } | |||
| } | |||
| // @ApiOperation(value = "根据orderId查询接口", notes = "{\"orderId\":\"string\"}") | |||
| // @GetMapping("/findById") | |||
| // @ApiImplicitParams({ | |||
| // @ApiImplicitParam(name = "orderId", value = "订单id", dataType = "String", paramType = "query", required = true) | |||
| // }) | |||
| // public ResultData findById(String orderId) { | |||
| // if (orderId == null || orderId.equalsIgnoreCase(Constant.UNDEFINED)) { | |||
| // return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); | |||
| // } | |||
| // 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 order = null; | |||
| // try { | |||
| // order = wxOrderService.getById(id,getTenantInfo().getTenantId()); | |||
| // if (order != null) { | |||
| // return new ResultData(Result.SUCCESS, "查询成功", order); | |||
| // } else { | |||
| // return new ResultData(ErrorCode.ORDER_IS_NOT_FIND); | |||
| // } | |||
| // } catch (Exception e) { | |||
| // logger.error("parse orderId failed"); | |||
| // return new ResultData(ErrorCode.DB_FAIL.getCode(), "订单查询未成功,e:" + e.getMessage()); | |||
| // } | |||
| // } | |||
| @ApiOperation(value = "获取未支付订单", notes = "{\"couponId\":\"string\"}") | |||
| @GetMapping("getUnPaidOrder") | |||
| @@ -677,14 +677,18 @@ public class WxUserGrantController extends BaseController { | |||
| return new ResultData(Result.ERROR,e.getMessage()); | |||
| } | |||
| if (wxCUserBasicInfo.getName() != null || | |||
| wxCUserBasicInfo.getBirthdate() != null || | |||
| wxCUserBasicInfo.getSex() != null || | |||
| wxCUserBasicInfo.getAddress() != null) { | |||
| if (StringUtils.isNotBlank(wxCUserBasicInfo.getNickName()) | |||
| || StringUtils.isNotBlank(wxCUserBasicInfo.getAvatarUrl()) | |||
| || StringUtils.isNotBlank(wxCUserBasicInfo.getName()) | |||
| || wxCUserBasicInfo.getBirthdate() != null | |||
| || wxCUserBasicInfo.getSex() != null | |||
| || StringUtils.isNotBlank(wxCUserBasicInfo.getAddress())) { | |||
| WxCUserBasicInfo record = new WxCUserBasicInfo(); | |||
| record.setId(memberId); | |||
| record.setName(wxCUserBasicInfo.getName()); | |||
| record.setNickName(wxCUserBasicInfo.getNickName()); | |||
| record.setAvatarUrl(wxCUserBasicInfo.getAvatarUrl()); | |||
| record.setName(wxCUserBasicInfo.getName()); | |||
| record.setBirthdate(wxCUserBasicInfo.getBirthdate()); | |||
| record.setSex(wxCUserBasicInfo.getSex()); | |||
| record.setWeight(wxCUserBasicInfo.getWeight()); | |||
| @@ -703,7 +707,6 @@ public class WxUserGrantController extends BaseController { | |||
| logger.error("发送同步会员消息异常"); | |||
| } | |||
| wxScoreRulesService.addScore(tenantEntity,EnumScoreType.COMPLETE_INFO, record); | |||
| //增加积分 | |||
| WxCreditHistory wxCreditHistory = new WxCreditHistory(); | |||
| @@ -1,24 +1,21 @@ | |||
| package com.iformall.controller.callback; | |||
| import com.github.binarywang.wxpay.bean.businesscircle.BusinessCircleNotifyData; | |||
| import com.github.binarywang.wxpay.bean.businesscircle.MemberCardAuthorizeNotifyResult; | |||
| import com.github.binarywang.wxpay.bean.businesscircle.PaidResult; | |||
| import com.github.binarywang.wxpay.bean.businesscircle.RefundResult; | |||
| import com.github.binarywang.wxpay.bean.ecommerce.SignatureHeader; | |||
| import com.github.binarywang.wxpay.exception.WxPayException; | |||
| import com.github.binarywang.wxpay.service.WxPayService; | |||
| import com.iformall.controller.base.BaseController; | |||
| import com.iformall.domain.po.WxBusinessCircleOrder; | |||
| import com.iformall.domain.po.*; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import com.iformall.enums.EnumThirdPartyConfigType; | |||
| import com.iformall.enums.*; | |||
| import com.iformall.exception.MallinkException; | |||
| import com.iformall.interceptor.BodyReaderHttpServletRequestWrapper; | |||
| import com.iformall.pay.WxPayConstant; | |||
| import com.iformall.service.WxBusinessCircleOrderService; | |||
| import com.iformall.service.WxMallService; | |||
| import com.iformall.service.WxPayAccountService; | |||
| import com.iformall.service.*; | |||
| import com.iformall.utils.MaUtil; | |||
| import org.apache.commons.lang3.StringUtils; | |||
| import org.apache.shiro.web.servlet.ShiroHttpServletRequest; | |||
| import org.slf4j.Logger; | |||
| import org.slf4j.LoggerFactory; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| @@ -31,6 +28,7 @@ import java.io.InputStream; | |||
| import java.io.InputStreamReader; | |||
| import java.text.ParseException; | |||
| import java.text.SimpleDateFormat; | |||
| import java.util.Date; | |||
| import java.util.HashMap; | |||
| import java.util.Locale; | |||
| import java.util.Map; | |||
| @@ -46,12 +44,128 @@ public class WxBusinessOrderController extends BaseController { | |||
| @Autowired | |||
| WxMallService wxMallService; | |||
| @Autowired | |||
| WxAppinfoService wxAppinfoService; | |||
| @Autowired | |||
| WxPayAccountService wxPayAccountService; | |||
| @Autowired | |||
| WxBusinessCircleOrderService wxBusinessCircleOrderService; | |||
| @Autowired | |||
| WxMemberCardService wxMemberCardService; | |||
| @Autowired | |||
| WxCUserService wxCUserService; | |||
| @Autowired | |||
| MaUtil maUtil; | |||
| /** | |||
| * | |||
| * @return 商圈授权通知 | |||
| */ | |||
| @PostMapping(value = "/membercard/{tenantId}") | |||
| @ResponseBody | |||
| public Map<String,String> notify(@PathVariable String tenantId, HttpServletRequest request){ | |||
| logger.info("[" +getIpAddr() + "]商圈授权通知-----"+tenantId); | |||
| Map<String,String> resultMap = new HashMap<>(); | |||
| if(StringUtils.isBlank(tenantId)){ | |||
| logger.error("tenantId为空"); | |||
| resultMap.put("code","FAIL"); | |||
| return resultMap; | |||
| } | |||
| TenantEntity tenantEntity = wxMallService.getByTenantId(tenantId); | |||
| if(tenantEntity == null){ | |||
| logger.error("获取tenantEntity为null"); | |||
| resultMap.put("code","FAIL"); | |||
| return resultMap; | |||
| } | |||
| SignatureHeader header = new SignatureHeader(); | |||
| header.setSerialNo(request.getHeader("Wechatpay-Serial")); | |||
| header.setTimeStamp(request.getHeader("Wechatpay-Timestamp")); | |||
| header.setNonce(request.getHeader("Wechatpay-Nonce")); | |||
| header.setSigned(request.getHeader("Wechatpay-Signature")); | |||
| logger.info("商圈授权通知---header{}"+header.toString()); | |||
| try { | |||
| String body = this.getBody(request); | |||
| logger.info("商圈授权通知---body{}"+body); | |||
| WxAppinfo cAppInfo = wxAppinfoService.getCAppInfoFromRedis(tenantId, EnumAppPlat.WX); | |||
| if(cAppInfo == null){ | |||
| resultMap.put("code","FAIL"); | |||
| return resultMap; | |||
| } | |||
| WxPayAccount payAccount = wxPayAccountService.getByIdFromRedis(cAppInfo.getPayId()); | |||
| if(payAccount == null){ | |||
| resultMap.put("code","FAIL"); | |||
| return resultMap; | |||
| } | |||
| WxPayService wxPayService = maUtil.getWxPayService(cAppInfo, payAccount); | |||
| //----------------签名验证----------- | |||
| // BusinessCircleNotifyData notifyData = verifySignature(request,wxPayService); | |||
| BusinessCircleNotifyData notifyData = wxPayService.getBusinessCircleService().parseNotifyData(body, header); | |||
| logger.info("商圈授权通知---回调通知对象{}"+notifyData.toString()); | |||
| MemberCardAuthorizeNotifyResult result = wxPayService.getBusinessCircleService().decryptMemberCardAuthorizeNotifyDataResource(notifyData); | |||
| logger.info("商圈授权通知---解密结果{}"+result.toString()); | |||
| WxMemberCard memberCard = new WxMemberCard(); | |||
| memberCard.setTenantId(tenantEntity.getTenantId()); | |||
| memberCard.setParentTenantId(tenantEntity.getParentTenantId()); | |||
| memberCard.updateFinalTenantId(tenantEntity); | |||
| memberCard.setCardId(payAccount.getCardId()); | |||
| memberCard.setCardCode(result.getCode()); | |||
| if(WxPayConstant.REGISTERED_MODE.equals(result.getAuthType())){ | |||
| // memberCard.setUserCardStatus(EnumMemberCardStatus.EFFECTIVE.getCode()); | |||
| // wxMemberCardService.saveorupdateByCode(memberCard); | |||
| // | |||
| // wxMemberCardService.sendSyncMemberCardMsg(tenantEntity,memberCard.getCardId(),memberCard.getCardCode()); | |||
| resultMap.put("code","SUCCESS"); | |||
| return resultMap; | |||
| }else if(WxPayConstant.REGISTERED_AND_AUTHORIZATION_MODE.equals(result.getAuthType())){ | |||
| WxCUser cuser = new WxCUser(); | |||
| cuser.updateTenantInfo(tenantEntity); | |||
| cuser.setOpenId(result.getOpenid()); | |||
| WxCUser byOpenId = wxCUserService.getByOpenId(cuser); | |||
| memberCard.setCuserId(byOpenId.getId()); | |||
| memberCard.setUserCardStatus(EnumMemberCardStatus.EFFECTIVE.getCode()); | |||
| wxMemberCardService.saveorupdateByCode(memberCard); | |||
| cuser.setAuthorizeState(EnumBusinessCircleAuthorizeState.AUTHORIZED.getCode()); | |||
| cuser.setAuthorizeTime(new Date()); | |||
| wxCUserService.updateAuthorizeStateByOpenId(cuser); | |||
| wxMemberCardService.sendSyncMemberCardMsg(tenantEntity,memberCard.getCardId(),memberCard.getCardCode()); | |||
| resultMap.put("code","SUCCESS"); | |||
| return resultMap; | |||
| } | |||
| resultMap.put("code","FAIL"); | |||
| return resultMap; | |||
| } catch (WxPayException e) { | |||
| e.printStackTrace(); | |||
| logger.error("商圈授权通知---"+e.getCustomErrorMsg()); | |||
| resultMap.put("code","FAIL"); | |||
| return resultMap; | |||
| } catch(MallinkException e){ | |||
| logger.error("商圈授权通知---"+e.getMessage()); | |||
| resultMap.put("code","FAIL"); | |||
| return resultMap; | |||
| }catch (Exception e){ | |||
| e.printStackTrace(); | |||
| logger.error("商圈授权通知---其他异常"); | |||
| resultMap.put("code","FAIL"); | |||
| return resultMap; | |||
| } | |||
| } | |||
| /** | |||
| * | |||
| * @return 微信商圈支付通知 | |||
| @@ -0,0 +1,301 @@ | |||
| package com.iformall.controller.callback; | |||
| import com.github.binarywang.wxpay.bean.businesscircle.BusinessCircleNotifyData; | |||
| import com.github.binarywang.wxpay.bean.businesscircle.PaidResult; | |||
| import com.github.binarywang.wxpay.bean.businesscircle.RefundResult; | |||
| import com.github.binarywang.wxpay.bean.ecommerce.SignatureHeader; | |||
| import com.github.binarywang.wxpay.bean.membercard.MemberCardActivateResult; | |||
| import com.github.binarywang.wxpay.bean.membercard.MemberCardNotifyData; | |||
| import com.github.binarywang.wxpay.exception.WxPayException; | |||
| import com.github.binarywang.wxpay.service.WxPayService; | |||
| import com.iformall.controller.base.BaseController; | |||
| import com.iformall.domain.po.WxAppinfo; | |||
| import com.iformall.domain.po.WxBusinessCircleOrder; | |||
| import com.iformall.domain.po.WxMemberCard; | |||
| import com.iformall.domain.po.WxPayAccount; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import com.iformall.enums.EnumAppPlat; | |||
| import com.iformall.enums.EnumMemberCardActivateScene; | |||
| import com.iformall.enums.EnumMemberCardStatus; | |||
| import com.iformall.exception.MallinkException; | |||
| import com.iformall.pay.WxPayConstant; | |||
| import com.iformall.service.*; | |||
| import com.iformall.utils.MaUtil; | |||
| import org.apache.commons.lang3.StringUtils; | |||
| import org.slf4j.Logger; | |||
| import org.slf4j.LoggerFactory; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.web.bind.annotation.*; | |||
| import javax.servlet.http.HttpServletRequest; | |||
| import java.io.BufferedReader; | |||
| import java.io.IOException; | |||
| import java.io.InputStream; | |||
| import java.io.InputStreamReader; | |||
| import java.text.ParseException; | |||
| import java.text.SimpleDateFormat; | |||
| import java.util.HashMap; | |||
| import java.util.Locale; | |||
| import java.util.Map; | |||
| @RestController | |||
| @RequestMapping("/member/card") | |||
| public class WxMemberCardController extends BaseController { | |||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||
| private final SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'+'mm:ss", Locale.CHINA); | |||
| @Autowired | |||
| WxMallService wxMallService; | |||
| @Autowired | |||
| WxAppinfoService wxAppinfoService; | |||
| @Autowired | |||
| WxPayAccountService wxPayAccountService; | |||
| @Autowired | |||
| WxMemberCardService wxMemberCardService; | |||
| @Autowired | |||
| MaUtil maUtil; | |||
| /** | |||
| * | |||
| * @return 微信会员卡通知 | |||
| */ | |||
| @PostMapping(value = "/notify/{tenantId}") | |||
| @ResponseBody | |||
| public Map<String,String> notify(@PathVariable String tenantId, HttpServletRequest request){ | |||
| logger.info("[" +getIpAddr() + "]微信会员卡通知-----"+tenantId); | |||
| Map<String,String> resultMap = new HashMap<>(); | |||
| if(StringUtils.isBlank(tenantId)){ | |||
| logger.error("tenantId为空"); | |||
| resultMap.put("code","FAIL"); | |||
| return resultMap; | |||
| } | |||
| TenantEntity tenantEntity = wxMallService.getByTenantId(tenantId); | |||
| if(tenantEntity == null){ | |||
| logger.error("获取tenantEntity为null"); | |||
| resultMap.put("code","FAIL"); | |||
| return resultMap; | |||
| } | |||
| SignatureHeader header = new SignatureHeader(); | |||
| header.setSerialNo(request.getHeader("Wechatpay-Serial")); | |||
| header.setTimeStamp(request.getHeader("Wechatpay-Timestamp")); | |||
| header.setNonce(request.getHeader("Wechatpay-Nonce")); | |||
| header.setSigned(request.getHeader("Wechatpay-Signature")); | |||
| logger.info("微信会员卡通知---header{}"+header.toString()); | |||
| try { | |||
| String body = this.getBody(request); | |||
| logger.info("微信会员卡通知---body{}"+body); | |||
| WxAppinfo cAppInfo = wxAppinfoService.getCAppInfoFromRedis(tenantId, EnumAppPlat.WX); | |||
| if(cAppInfo == null){ | |||
| resultMap.put("code","FAIL"); | |||
| return resultMap; | |||
| } | |||
| WxPayAccount payAccount = wxPayAccountService.getByIdFromRedis(cAppInfo.getPayId()); | |||
| if(payAccount == null){ | |||
| resultMap.put("code","FAIL"); | |||
| return resultMap; | |||
| } | |||
| WxPayService wxPayService = maUtil.getWxPayService(cAppInfo, payAccount); | |||
| //----------------签名验证----------- | |||
| // BusinessCircleNotifyData notifyData = verifySignature(request,wxPayService); | |||
| MemberCardNotifyData notifyData = wxPayService.getMemberCardService().parseNotifyData(body, header); | |||
| logger.info("微信会员卡通知---回调通知对象{}"+notifyData.toString()); | |||
| MemberCardActivateResult result = wxPayService.getMemberCardService().decryptActivateNotifyDataResource(notifyData); | |||
| logger.info("微信会员卡通知---解密结果{}"+result.toString()); | |||
| WxMemberCard memberCard = new WxMemberCard(); | |||
| memberCard.setTenantId(tenantEntity.getTenantId()); | |||
| memberCard.setParentTenantId(tenantEntity.getParentTenantId()); | |||
| memberCard.updateFinalTenantId(tenantEntity); | |||
| memberCard.setCardId(result.getCardId()); | |||
| memberCard.setCardCode(result.getCode()); | |||
| memberCard.setOpenId(result.getOpenid()); | |||
| memberCard.setUnionId(result.getUnionid()); | |||
| if(WxPayConstant.MEMBER_CARD_ACTIVATE.equals(result.getEventType())){ | |||
| memberCard.setUserCardStatus(EnumMemberCardStatus.EFFECTIVE.getCode()); | |||
| memberCard.setCreateDate(sdf.parse(result.getEventTime())); | |||
| memberCard.setActivateScene(EnumMemberCardActivateScene.getEnum(result.getActivateScene()).getCode()); | |||
| // memberCard.setOuterStr(result.getOuterStr()); | |||
| wxMemberCardService.saveorupdateByCode(memberCard); | |||
| wxMemberCardService.sendSyncMemberCardMsg(tenantEntity,memberCard.getCardId(),memberCard.getCardCode()); | |||
| resultMap.put("code","SUCCESS"); | |||
| return resultMap; | |||
| }else if(WxPayConstant.USER_VIEW_MEMBERCARD.equals(result.getEventType())){ | |||
| resultMap.put("code","SUCCESS"); | |||
| return resultMap; | |||
| }else if(WxPayConstant.USER_DELETE_MEMBERCARD.equals(result.getEventType())){ | |||
| memberCard.setUpdateDate(sdf.parse(result.getEventTime())); | |||
| memberCard.setUserCardStatus(EnumMemberCardStatus.DELETE.getCode()); | |||
| wxMemberCardService.delUserCardStatusByCode(memberCard); | |||
| wxMemberCardService.sendSyncMemberCardMsg(tenantEntity,memberCard.getCardId(),memberCard.getCardCode()); | |||
| resultMap.put("code","SUCCESS"); | |||
| return resultMap; | |||
| }else if(WxPayConstant.USER_MODIFY_INFORMATION.equals(result.getEventType())){ | |||
| wxMemberCardService.sendSyncMemberCardMsg(tenantEntity,memberCard.getCardId(),memberCard.getCardCode()); | |||
| resultMap.put("code","SUCCESS"); | |||
| return resultMap; | |||
| } | |||
| resultMap.put("code","FAIL"); | |||
| return resultMap; | |||
| } catch (WxPayException e) { | |||
| e.printStackTrace(); | |||
| logger.error("微信会员卡通知---"+e.getCustomErrorMsg()); | |||
| resultMap.put("code","FAIL"); | |||
| return resultMap; | |||
| } catch (ParseException e) { | |||
| e.printStackTrace(); | |||
| logger.error("微信会员卡通知---时间转换异常"); | |||
| resultMap.put("code","FAIL"); | |||
| return resultMap; | |||
| } catch(MallinkException e){ | |||
| logger.error("微信会员卡通知---"+e.getMessage()); | |||
| resultMap.put("code","FAIL"); | |||
| return resultMap; | |||
| }catch (Exception e){ | |||
| e.printStackTrace(); | |||
| logger.error("微信会员卡通知---其他异常"); | |||
| resultMap.put("code","FAIL"); | |||
| return resultMap; | |||
| } | |||
| } | |||
| private String getBody(HttpServletRequest request) throws IOException { | |||
| StringBuilder stringBuilder = new StringBuilder(); | |||
| BufferedReader bufferedReader = null; | |||
| try { | |||
| InputStream inputStream = request.getInputStream(); | |||
| if (inputStream != null) { | |||
| bufferedReader = new BufferedReader(new InputStreamReader(inputStream,"utf-8")); | |||
| char[] charBuffer = new char[1024]; | |||
| int bytesRead = -1; | |||
| while ((bytesRead = bufferedReader.read(charBuffer)) > 0) { | |||
| stringBuilder.append(charBuffer, 0, bytesRead); | |||
| } | |||
| } else { | |||
| stringBuilder.append(""); | |||
| } | |||
| } catch ( | |||
| IOException ex) { | |||
| throw ex; | |||
| } finally { | |||
| if (bufferedReader != null) { | |||
| try { | |||
| bufferedReader.close(); | |||
| } catch (IOException ex) { | |||
| throw ex; | |||
| } | |||
| } | |||
| } | |||
| return stringBuilder.toString(); | |||
| } | |||
| // @PostMapping(value = "/test") | |||
| // @ResponseBody | |||
| // public void createOrdertests(){ | |||
| // | |||
| //// SignatureHeader(timeStamp=1627973486, nonce=pKGTNqxLaljN9jB5DprFagpmggWIhyBA, signed=gDmv1WDCGdlIyyW9bGDJuztWNritufRsiYt5bPfudpwvPA9hHWM47eFeZYzHpgxttnxyAL10XYbPK8SngtCHSeOghS4gXHuAQoWv3RlEkTHhIcf1eg+uD4zd4PsNqJ35YlW6RyYkjv/Y8didERnkvXZPvDrzP5DKsurLXvMJBs7mzVzt6QIgZa2DuVjnhmSk4aC3wPs7lqm8ElWsEblCr8k9RSrP92PFGSTnU5owAUrTMTL1kqfwzavzwVJxafAGkXxrHbybpP5qZ5DjttAhDkRI3L2xQfPvHAFyibnwk2N9KYC9H6AOuZIuku/9eRlan+ZMDln63gaPFfvl1OB7hg==, serialNo=76EEF0C28D079D9CED85C67237F173FF825CFAE7) | |||
| // | |||
| // SignatureHeader header = new SignatureHeader(); | |||
| // header.setSerialNo("76EEF0C28D079D9CED85C67237F173FF825CFAE7"); | |||
| // header.setTimeStamp("1627973486"); | |||
| // header.setNonce("pKGTNqxLaljN9jB5DprFagpmggWIhyBA"); | |||
| // header.setSigned("gDmv1WDCGdlIyyW9bGDJuztWNritufRsiYt5bPfudpwvPA9hHWM47eFeZYzHpgxttnxyAL10XYbPK8SngtCHSeOghS4gXHuAQoWv3RlEkTHhIcf1eg+uD4zd4PsNqJ35YlW6RyYkjv/Y8didERnkvXZPvDrzP5DKsurLXvMJBs7mzVzt6QIgZa2DuVjnhmSk4aC3wPs7lqm8ElWsEblCr8k9RSrP92PFGSTnU5owAUrTMTL1kqfwzavzwVJxafAGkXxrHbybpP5qZ5DjttAhDkRI3L2xQfPvHAFyibnwk2N9KYC9H6AOuZIuku/9eRlan+ZMDln63gaPFfvl1OB7hg=="); | |||
| // | |||
| // | |||
| // logger.info("微信商圈支付通知---header{}"+header.toString()); | |||
| // String tenantId = "1019"; | |||
| // TenantEntity tenantEntity = wxMallService.getByTenantId(tenantId); | |||
| // | |||
| // try { | |||
| // // {"id":"fe9f7590-89d3-588a-a5a3-f3ca5cb6e806","create_time":"2021-08-03T14:51:23+08:00","resource_type":"encrypt-resource","event_type":"MALL_TRANSACTION.SUCCESS","summary":"支付成功","resource":{"original_type":"mall_transaction","algorithm":"AEAD_AES_256_GCM","ciphertext":"T9VctVJB+7Zs0dhZnejwXNOvxHM/CfPt4S4C4cAtvSYsO2++8eVMN3dZky1/TLVg/mJtFBVHU4IiPavZMV+tULw3yKBs/JomTBHblb8De8GKU2/m03/wD3rxufdYejTnxXQWsdAEaWduM/zWCCtNIblayVE8Bz6p0cZtutk6jknYaDQk13sNGh1U12lpcElGf3i8LxLG0jWp+DBp2seOizBsjB8Cky/xEMjmd9OzbtrCd7K22ZtGv7gyA2C/9NY5gFT9tlcGFaD+BvOx69o7Sw1uHZ5IaXHTpI9SQlHCWCs8tGZtMZrlzgFLa/DI+TFkh//WYNcZRomhBydAbE4xQJqSWB5/81Rqa4gYT85YJPhgXRKGl+F0S/6jCYuL5cJpqUCojNz+g16znI8=","associated_data":"mall_transaction","nonce":"0GqZRhyTkcHG"}} | |||
| // | |||
| // String body = "{\"id\":\"fe9f7590-89d3-588a-a5a3-f3ca5cb6e806\",\"create_time\":\"2021-08-03T14:51:23+08:00\",\"resource_type\":\"encrypt-resource\",\"event_type\":\"MALL_TRANSACTION.SUCCESS\",\"summary\":\"支付成功\",\"resource\":{\"original_type\":\"mall_transaction\",\"algorithm\":\"AEAD_AES_256_GCM\",\"ciphertext\":\"T9VctVJB+7Zs0dhZnejwXNOvxHM/CfPt4S4C4cAtvSYsO2++8eVMN3dZky1/TLVg/mJtFBVHU4IiPavZMV+tULw3yKBs/JomTBHblb8De8GKU2/m03/wD3rxufdYejTnxXQWsdAEaWduM/zWCCtNIblayVE8Bz6p0cZtutk6jknYaDQk13sNGh1U12lpcElGf3i8LxLG0jWp+DBp2seOizBsjB8Cky/xEMjmd9OzbtrCd7K22ZtGv7gyA2C/9NY5gFT9tlcGFaD+BvOx69o7Sw1uHZ5IaXHTpI9SQlHCWCs8tGZtMZrlzgFLa/DI+TFkh//WYNcZRomhBydAbE4xQJqSWB5/81Rqa4gYT85YJPhgXRKGl+F0S/6jCYuL5cJpqUCojNz+g16znI8=\",\"associated_data\":\"mall_transaction\",\"nonce\":\"0GqZRhyTkcHG\"}}"; | |||
| // logger.info("微信商圈支付通知---body{}"+body); | |||
| // WxPayService wxPayService = wxPayAccountService.getWxPayService(tenantId); | |||
| // | |||
| // //----------------签名验证----------- | |||
| //// BusinessCircleNotifyData notifyData = verifySignature(request,wxPayService); | |||
| // BusinessCircleNotifyData notifyData = wxPayService.getBusinessCircleService().parseNotifyData(body, header); | |||
| // logger.info("微信商圈通知---回调通知对象{}"+notifyData.toString()); | |||
| // | |||
| // WxBusinessCircleOrder wxBusinessCircleOrder = new WxBusinessCircleOrder(); | |||
| // wxBusinessCircleOrder.updateTenantInfo(tenantEntity); | |||
| // wxBusinessCircleOrder.setNoticeId(notifyData.getId()); | |||
| // wxBusinessCircleOrder.setNoticeCreateTime(sdf.parse(notifyData.getCreateTime())); | |||
| // wxBusinessCircleOrder.setNoticeEventType(notifyData.getEventType()); | |||
| // wxBusinessCircleOrder.setSummary(notifyData.getSummary()); | |||
| // | |||
| // //解密 | |||
| // if(WxPayConstant.NOTICE_EVENT_TYPE.equals(notifyData.getEventType())){ | |||
| // PaidResult result = wxPayService.getBusinessCircleService().decryptPaidNotifyDataResource(notifyData); | |||
| // logger.info("微信商圈支付成功通知---解密结果{}"+result.toString()); | |||
| // | |||
| // wxBusinessCircleOrder.setWxMchid(result.getMchid()); | |||
| // wxBusinessCircleOrder.setWxMerchantName(result.getMerchantName()); | |||
| // wxBusinessCircleOrder.setWxShopName(result.getShopName()); | |||
| // wxBusinessCircleOrder.setWxShopNumber(result.getShopNumber()); | |||
| // wxBusinessCircleOrder.setAppid(result.getAppid()); | |||
| // wxBusinessCircleOrder.setOpenid(result.getOpenid()); | |||
| // wxBusinessCircleOrder.setTimeEnd(sdf.parse(result.getTimeEnd())); | |||
| // wxBusinessCircleOrder.setAmount(result.getAmount()); | |||
| // wxBusinessCircleOrder.setPayAmount(result.getAmount()); | |||
| // wxBusinessCircleOrder.setTransactionId(result.getTransactionId()); | |||
| // wxBusinessCircleOrder.setCommitTag(result.getCommitTag()); | |||
| // | |||
| // | |||
| // | |||
| // }else if(WxPayConstant.REFUND_EVENT_TYPE.equals(notifyData.getEventType())){ | |||
| // RefundResult result = wxPayService.getBusinessCircleService().decryptRefundNotifyDataResource(notifyData); | |||
| // logger.info("微信商圈退款成功通知---解密结果{}"+result.toString()); | |||
| // | |||
| // wxBusinessCircleOrder.setWxMchid(result.getMchid()); | |||
| // wxBusinessCircleOrder.setWxMerchantName(result.getMerchantName()); | |||
| // wxBusinessCircleOrder.setWxShopName(result.getShopName()); | |||
| // wxBusinessCircleOrder.setWxShopNumber(result.getShopNumber()); | |||
| // wxBusinessCircleOrder.setAppid(result.getAppid()); | |||
| // wxBusinessCircleOrder.setOpenid(result.getOpenid()); | |||
| // wxBusinessCircleOrder.setTimeEnd(sdf.parse(result.getRefundTime())); | |||
| // wxBusinessCircleOrder.setAmount(result.getPayAmount()); | |||
| // wxBusinessCircleOrder.setPayAmount(result.getPayAmount()); | |||
| // wxBusinessCircleOrder.setTransactionId(result.getTransactionId()); | |||
| // | |||
| // wxBusinessCircleOrder.setRefundAmount(result.getRefundAmount()); | |||
| // wxBusinessCircleOrder.setRefundId(result.getRefundId()); | |||
| // | |||
| // | |||
| // } | |||
| // | |||
| // } catch (WxPayException e) { | |||
| // e.printStackTrace(); | |||
| // logger.error("微信商圈通知---"+e.getCustomErrorMsg()); | |||
| // | |||
| // } catch (ParseException e) { | |||
| // e.printStackTrace(); | |||
| // logger.error("微信商圈通知---时间转换异常"); | |||
| // | |||
| // } catch(MallinkException e){ | |||
| // logger.error("微信商圈通知---"+e.getMessage()); | |||
| // | |||
| // }catch (Exception e){ | |||
| // e.printStackTrace(); | |||
| // logger.error("微信商圈通知---其他异常"); | |||
| // | |||
| // } | |||
| // } | |||
| } | |||
| @@ -31,6 +31,16 @@ public class MqBaseConsumer { | |||
| @Autowired | |||
| private SendWeappUniformMsgServiceImpl sendWeappUniformMsgService; | |||
| @Autowired | |||
| private AfterAddCreditMsgServiceImpl afterAddCreditMsgService; | |||
| @Autowired | |||
| private AfterAddScoreMsgServiceImpl afterAddScoreMsgService; | |||
| @Autowired | |||
| private AfterCarInOutMsgServiceImpl afterCarInOutMsgService; | |||
| @Autowired | |||
| private AfterBusinessCreditMsgServiceImpl afterBusinessCreditMsgService; | |||
| @Autowired | |||
| private SyncMemberCardMsgServiceImpl syncMemberCardMsgService; | |||
| @Autowired | |||
| private FmInsideOrderSuccessMsgServiceImpl fmInsideOrderSuccessMsgService; | |||
| @Autowired | |||
| private FmInsideCouponVerifyMsgServiceImpl fmInsideCouponVerifyMsgService; | |||
| @@ -79,40 +89,74 @@ public class MqBaseConsumer { | |||
| //短信 | |||
| WxMsgRecord msg = (WxMsgRecord)JsonUtil.readValue(message,WxMsgRecord.class); | |||
| sendSmsService.send(msg); | |||
| } else if(EnumMsgRecordType.SMS_CALLBACK.getCode().equals(baseMsg.getMsgType())){ | |||
| } | |||
| else if(EnumMsgRecordType.SMS_CALLBACK.getCode().equals(baseMsg.getMsgType())){ | |||
| //业务短信 | |||
| WxMsg msg = (WxMsg)JsonUtil.readValue(message,WxMsg.class); | |||
| sendCallBackSmsService.send(msg); | |||
| } else if(EnumMsgRecordType.EMAIL.getCode().equals(baseMsg.getMsgType())){ | |||
| } | |||
| else if(EnumMsgRecordType.EMAIL.getCode().equals(baseMsg.getMsgType())){ | |||
| //邮件 | |||
| MailMsg msg = (MailMsg)JsonUtil.readValue(message,MailMsg.class); | |||
| sendEmailService.send(msg); | |||
| // } else if(EnumMsgRecordType.SMART_APP.getCode().equals(baseMsg.getMsgType())){ | |||
| } else if(EnumMsgRecordType.SMART_APP_TO.getCode().equals(baseMsg.getMsgType())){ | |||
| } | |||
| else if(EnumMsgRecordType.SMART_APP_TO.getCode().equals(baseMsg.getMsgType())){ | |||
| //微信小程序-订阅消息 | |||
| SmartAppMsg msg = (SmartAppMsg)JsonUtil.readValue(message,SmartAppMsg.class); | |||
| sendSmartAppMsgService.send(msg); | |||
| } else if(EnumMsgRecordType.PUBLIC.getCode().equals(baseMsg.getMsgType())) { | |||
| } | |||
| else if(EnumMsgRecordType.PUBLIC.getCode().equals(baseMsg.getMsgType())) { | |||
| //公众号-模板消息 | |||
| MpAppMsg msg = (MpAppMsg)JsonUtil.readValue(message,MpAppMsg.class); | |||
| sendMpMsgService.send(msg); | |||
| } else if(EnumMsgRecordType.SMART_APP_UNIFORM.getCode().equals(baseMsg.getMsgType())) { | |||
| } | |||
| else if(EnumMsgRecordType.SMART_APP_UNIFORM.getCode().equals(baseMsg.getMsgType())) { | |||
| //微信小程序-统一消息 | |||
| AppUniformMsg msg = (AppUniformMsg)JsonUtil.readValue(message,AppUniformMsg.class); | |||
| sendWeappUniformMsgService.send(msg); | |||
| } else if(EnumMsgRecordType.INSIDE_ORDER_SUCCESS.getCode().equals(baseMsg.getMsgType())) { | |||
| } | |||
| else if(EnumMsgRecordType.SYNC_MEMBER_CARD.getCode().equals(baseMsg.getMsgType())) { | |||
| //微信商圈同步会员 | |||
| SyncMemberCardMsg msg = (SyncMemberCardMsg)JsonUtil.readValue(message,SyncMemberCardMsg.class); | |||
| syncMemberCardMsgService.send(msg); | |||
| } | |||
| else if(EnumMsgRecordType.AFTER_ADD_CREDIT.getCode().equals(baseMsg.getMsgType())) { | |||
| //积分变更后 | |||
| AfterAddCreditMsg msg = (AfterAddCreditMsg)JsonUtil.readValue(message,AfterAddCreditMsg.class); | |||
| afterAddCreditMsgService.send(msg); | |||
| } | |||
| else if(EnumMsgRecordType.AFTER_ADD_SCORE.getCode().equals(baseMsg.getMsgType())) { | |||
| //成长值变更后 | |||
| AfterAddScoreMsg msg = (AfterAddScoreMsg)JsonUtil.readValue(message,AfterAddScoreMsg.class); | |||
| afterAddScoreMsgService.send(msg); | |||
| } | |||
| else if(EnumMsgRecordType.AFTER_CAR_IN_OR_OUT.getCode().equals(baseMsg.getMsgType())) { | |||
| //车辆入场,出场后 | |||
| AfterCarInOutMsg msg = (AfterCarInOutMsg)JsonUtil.readValue(message,AfterCarInOutMsg.class); | |||
| afterCarInOutMsgService.send(msg); | |||
| } | |||
| else if(EnumMsgRecordType.AFTER_BUSINESS_CREDIT.getCode().equals(baseMsg.getMsgType())) { | |||
| //商圈积分后 | |||
| AfterBusinessCreditMsg msg = (AfterBusinessCreditMsg)JsonUtil.readValue(message,AfterBusinessCreditMsg.class); | |||
| afterBusinessCreditMsgService.send(msg); | |||
| } | |||
| else if(EnumMsgRecordType.INSIDE_ORDER_SUCCESS.getCode().equals(baseMsg.getMsgType())) { | |||
| // 内部消息 - 下订单成功 | |||
| FmInsideOrderSuccessMsg msg = (FmInsideOrderSuccessMsg)JsonUtil.readValue(message,FmInsideOrderSuccessMsg.class); | |||
| fmInsideOrderSuccessMsgService.send(msg); | |||
| } else if(EnumMsgRecordType.INSIDE_COUPON_VERIFY.getCode().equals(baseMsg.getMsgType())) { | |||
| } | |||
| else if(EnumMsgRecordType.INSIDE_COUPON_VERIFY.getCode().equals(baseMsg.getMsgType())) { | |||
| // 内部消息 - 券核销 | |||
| FmInsideCouponVerifyMsg msg = (FmInsideCouponVerifyMsg)JsonUtil.readValue(message,FmInsideCouponVerifyMsg.class); | |||
| fmInsideCouponVerifyMsgService.send(msg); | |||
| } else if(EnumMsgRecordType.INSIDE_ORDER_REFUND.getCode().equals(baseMsg.getMsgType())){ | |||
| } | |||
| else if(EnumMsgRecordType.INSIDE_ORDER_REFUND.getCode().equals(baseMsg.getMsgType())){ | |||
| //内部消息 - 退款申请成功 | |||
| FmInsideOrderRefundMsg msg = (FmInsideOrderRefundMsg) JsonUtil.readValue(message,FmInsideOrderRefundMsg.class); | |||
| fmInsideOrderRefundMsgService.send(msg); | |||
| } else if(EnumMsgRecordType.INSIDE_C_LOGIN.getCode().equals(baseMsg.getMsgType())) { | |||
| } | |||
| else if(EnumMsgRecordType.INSIDE_C_LOGIN.getCode().equals(baseMsg.getMsgType())) { | |||
| // 内部消息 - c端登录 | |||
| FmInsideCLoginMsg msg = (FmInsideCLoginMsg)JsonUtil.readValue(message,FmInsideCLoginMsg.class); | |||
| fmInsideCLoginMsgService.send(msg); | |||
| @@ -2467,6 +2467,7 @@ public class PosServiceImpl implements PosService { | |||
| order.setPayVendor(EnumPayWay.PAY_WAY_POS_NEU.getCode()); | |||
| order.setPayVersion(EnumPayVersion.NEU_POS_V1.getCode()); | |||
| order.setProductId(merchantBUser.getId()); | |||
| order.setProductName(EnumOrderType.POSPAY.getMessage()); | |||
| order.setCUserId(memId); | |||
| order.setPaymentType(EnumPayType.PAY_PAYMENT.getCode()); | |||
| order.setPayment(posAmount); | |||
| @@ -68,7 +68,7 @@ public class UserBasicInfoController extends BaseController { | |||
| TenantEntity tenantEntity = getTenantInfo(); | |||
| WxCUserBasicInfo userBasicInfo = wxCUserBasicInfoService.registerByPhone(tenantEntity, phone,nickName,sex,avatarUrl); | |||
| WxCUserBasicInfo userBasicInfo = wxCUserBasicInfoService.registerByPhone(tenantEntity, phone,nickName,null,sex,avatarUrl); | |||
| this.setLevel(userBasicInfo,tenantEntity); | |||
| @@ -45,33 +45,15 @@ public class TtMerchantReciverSchedule { | |||
| @Scheduled(cron = "0 */30 * * * ?") | |||
| // @Scheduled(cron = "0 */5 * * * *?") //测试五分钟执行 | |||
| public void updateMerchantReciverSchedule() { | |||
| WxMall mallQ = new WxMall(); | |||
| mallQ.setSaleType(EnumSaleType.TT_ALL_ROUND.getCode()); | |||
| List<WxMall> mallList = wxMallService.findList(mallQ); | |||
| if(mallList == null || mallList.isEmpty()){ | |||
| return; | |||
| } | |||
| List<String> tenantIds = mallList.stream().map(m -> m.getTenantId()).collect(Collectors.toList()); | |||
| List<WxAppinfo> ttAppInfos = getTTAppInfos(); | |||
| List<String> tenantIds = ttAppInfos.stream().map(appinfo -> appinfo.getTenantId()).collect(Collectors.toList()); | |||
| List<WxMerchant> merchants = wxMerchantMapper.findByTenantIds(tenantIds); | |||
| if(merchants == null || merchants.isEmpty()){ | |||
| return; | |||
| } | |||
| Map<String, String> appIdMap = new HashMap<>(); | |||
| Map<String, String> payAccountKeyMap = new HashMap<>(); | |||
| WxAppinfo appQ = new WxAppinfo(); | |||
| appQ.setType(EnumAppType.C.getCode()); | |||
| appQ.setPlat(EnumPayWay.PAY_WAY_TT.getPlat().getCode()); | |||
| List<WxAppinfo> wxAppinfoList = wxAppinfoService.getList(appQ); | |||
| for (WxAppinfo wxAppinfo:wxAppinfoList) { | |||
| appIdMap.put(wxAppinfo.getTenantId(),wxAppinfo.getAppId()); | |||
| WxPayAccount wxPayAccount = payAccountService.getById(wxAppinfo.getPayId()); | |||
| if(wxPayAccount != null){ | |||
| payAccountKeyMap.put(wxAppinfo.getTenantId(),wxPayAccount.getApiKey()); | |||
| } | |||
| } | |||
| for (WxMerchant m:merchants) { | |||
| // try { | |||
| // wxProfitSharingReceiverService.updateTtReceiver(m,appIdMap.get(m.getTenantId()),payAccountKeyMap.get(m.getTenantId())); | |||
| @@ -80,7 +62,7 @@ public class TtMerchantReciverSchedule { | |||
| // logger.error("TtMerchantReciverSchedule error.updateTtReceiver:"+m.getId(),e); | |||
| // } | |||
| try { | |||
| wxProfitSharingReceiverService.updateTtReceiverIsUse(m,appIdMap.get(m.getTenantId()),payAccountKeyMap.get(m.getTenantId())); | |||
| wxProfitSharingReceiverService.updateTtReceiverIsUse(m); | |||
| } catch (Exception e) { | |||
| e.printStackTrace(); | |||
| logger.error("TtMerchantReciverSchedule error.updateTtReceiver:"+m.getId(),e); | |||
| @@ -88,4 +70,12 @@ public class TtMerchantReciverSchedule { | |||
| } | |||
| } | |||
| private List<WxAppinfo> getTTAppInfos() { | |||
| WxAppinfo appinfo =new WxAppinfo(); | |||
| appinfo.setPlat(EnumAppPlat.TOUTIAO.getCode()); | |||
| appinfo.setType(EnumAppType.C.getCode()); | |||
| appinfo.setEnable(EnumEnableType.Enable.getCode()); | |||
| return wxAppinfoService.getList(appinfo); | |||
| } | |||
| } | |||
| @@ -46,10 +46,8 @@ public class TtOrderQueryCpsSchedule { | |||
| @Scheduled(cron = "0 5 */1 * * ?") | |||
| // @Scheduled(cron = "0 0/5 * * * ?") | |||
| public void OrderPushErrorTaskSchedule() { | |||
| WxAppinfo appQ = new WxAppinfo(); | |||
| appQ.setType(EnumAppType.C.getCode()); | |||
| appQ.setPlat(EnumPayWay.PAY_WAY_TT.getPlat().getCode()); | |||
| List<WxAppinfo> wxAppinfoList = wxAppinfoService.getList(appQ); | |||
| List<WxAppinfo> wxAppinfoList = this.getTTAppInfos(); | |||
| for (WxAppinfo appinfo:wxAppinfoList) { | |||
| try{ | |||
| WxPayAccount payAccount = wxPayAccountService.getById(appinfo.getPayId()); | |||
| @@ -117,4 +115,12 @@ public class TtOrderQueryCpsSchedule { | |||
| } | |||
| private List<WxAppinfo> getTTAppInfos() { | |||
| WxAppinfo appinfo =new WxAppinfo(); | |||
| appinfo.setPlat(EnumAppPlat.TOUTIAO.getCode()); | |||
| appinfo.setType(EnumAppType.C.getCode()); | |||
| appinfo.setEnable(EnumEnableType.Enable.getCode()); | |||
| return wxAppinfoService.getList(appinfo); | |||
| } | |||
| } | |||
| @@ -88,6 +88,13 @@ public class BaseMyBatisConfiguration { | |||
| ttCUserSharding.setCount(100); | |||
| ttCUserSharding.setRule(EnumShardingRule.HASH.getCode()); | |||
| shardingList.add(ttCUserSharding); | |||
| ShardingSphere wxMemberCardSharding = new ShardingSphere(); | |||
| wxMemberCardSharding.setColumn("final_tenant_id"); | |||
| wxMemberCardSharding.setTableName("wx_member_card"); | |||
| wxMemberCardSharding.setCount(100); | |||
| wxMemberCardSharding.setRule(EnumShardingRule.HASH.getCode()); | |||
| shardingList.add(wxMemberCardSharding); | |||
| ShardingSphere basicInfoSharding = new ShardingSphere(); | |||
| basicInfoSharding.setColumn("final_tenant_id"); | |||
| @@ -104,7 +104,7 @@ public class BusinessCircleBase extends TenantEntity { | |||
| private Integer increasedPoints; | |||
| @Excel(name = "积分更新时间", width = 20, orderNum = "15", format = "yyyy-MM-dd HH:mm:ss") | |||
| @io.swagger.annotations.ApiModelProperty(value="积分更新时间(新增)",name="increasedPoints") | |||
| @io.swagger.annotations.ApiModelProperty(value="积分更新时间(新增)",name="pointsUpdateTime") | |||
| private Date pointsUpdateTime; | |||
| @Excel(name = "是否退款", width = 20, orderNum = "6", replace = {"退款订单_1", "付款订单_0"}) | |||
| @@ -19,7 +19,7 @@ public class TtMerchantPoi extends TenantEntity { | |||
| protected Long id;//merchant_id | |||
| @io.swagger.annotations.ApiModelProperty(value=" merchant_id",name="supplierExtId") | |||
| @io.swagger.annotations.ApiModelProperty(value=" 暂定merchant_id",name="supplierExtId") | |||
| private String supplierExtId; | |||
| @io.swagger.annotations.ApiModelProperty(value="商户名",name="merchantName") | |||
| @@ -1,5 +1,6 @@ | |||
| package com.iformall.domain.po; | |||
| import com.baomidou.mybatisplus.annotation.TableField; | |||
| import com.baomidou.mybatisplus.annotation.TableName; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import lombok.Data; | |||
| @@ -7,6 +8,7 @@ import lombok.EqualsAndHashCode; | |||
| import lombok.ToString; | |||
| import java.util.Date; | |||
| import java.util.List; | |||
| @TableName(value = "tt_poi_take_rate") | |||
| @Data | |||
| @@ -25,12 +27,18 @@ public class TtPoiTakeRate extends TenantEntity { | |||
| @io.swagger.annotations.ApiModelProperty(value="",name="name") | |||
| private String name; | |||
| @io.swagger.annotations.ApiModelProperty(value="计划联系人手机号",name="merchantPhone") | |||
| private String merchantPhone; | |||
| @io.swagger.annotations.ApiModelProperty(value="EnumCpsPlanContentType 场景",name="contentType") | |||
| private Integer contentType; | |||
| @io.swagger.annotations.ApiModelProperty(value="抖音ID",name="douyinId") | |||
| private String douyinId; | |||
| @io.swagger.annotations.ApiModelProperty(value="达人履约状态",name="douyinIdStatus") | |||
| private String douyinIdStatus; | |||
| @io.swagger.annotations.ApiModelProperty(value="分佣率",name="takeRate") | |||
| private Integer takeRate; | |||
| @@ -39,10 +47,18 @@ public class TtPoiTakeRate extends TenantEntity { | |||
| private Date startTime; | |||
| private Date endTime; | |||
| @io.swagger.annotations.ApiModelProperty(value="佣金有效期,单位是秒",name="commissionDuration") | |||
| private Long commissionDuration; | |||
| @io.swagger.annotations.ApiModelProperty(value="创建时间",name="createDate") | |||
| private Date createDate; | |||
| @io.swagger.annotations.ApiModelProperty(value="更新时间",name="updateDate") | |||
| private Date updateDate; | |||
| @TableField(exist = false) | |||
| private List<String> douyinIdList; | |||
| @TableField(exist = false) | |||
| private WxCoupon coupon; | |||
| } | |||
| @@ -1,12 +1,15 @@ | |||
| package com.iformall.domain.po; | |||
| import cn.afterturn.easypoi.excel.annotation.Excel; | |||
| import com.alibaba.fastjson.JSON; | |||
| import com.alibaba.fastjson.JSONObject; | |||
| import com.baomidou.mybatisplus.annotation.TableField; | |||
| import com.baomidou.mybatisplus.annotation.TableName; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import lombok.Data; | |||
| import lombok.EqualsAndHashCode; | |||
| import lombok.ToString; | |||
| import org.apache.commons.lang3.StringUtils; | |||
| import java.util.Date; | |||
| @@ -26,11 +29,11 @@ public class WxActivityJoin extends TenantEntity { | |||
| @io.swagger.annotations.ApiModelProperty(value = "活动ID", name = "activityId") | |||
| private Long activityId; | |||
| @Excel(name = "姓名", width = 10, orderNum = "1") | |||
| @Excel(name = "姓名", width = 15, orderNum = "1") | |||
| @io.swagger.annotations.ApiModelProperty(value = "姓名", name = "name") | |||
| private String name; | |||
| @Excel(name = "电话号码", width = 10, orderNum = "2") | |||
| @Excel(name = "电话号码", width = 20, orderNum = "2") | |||
| @io.swagger.annotations.ApiModelProperty(value = "手机", name = "phone") | |||
| private String phone; | |||
| @@ -46,35 +49,52 @@ public class WxActivityJoin extends TenantEntity { | |||
| @io.swagger.annotations.ApiModelProperty(value = "性别0保密1男2女", name = "sex") | |||
| private Integer sex; | |||
| @Excel(name = "生日", format = "yyyy-MM-dd", width = 10, orderNum = "6") | |||
| @Excel(name = "生日", format = "yyyy-MM-dd", width = 20, orderNum = "6") | |||
| @io.swagger.annotations.ApiModelProperty(value = "生日", name = "birthday") | |||
| private Date birthday; | |||
| @Excel(name = "微信昵称", width = 10, orderNum = "7") | |||
| @Excel(name = "微信昵称", width = 15, orderNum = "7") | |||
| @io.swagger.annotations.ApiModelProperty(value = "昵称", name = "nickName") | |||
| private String nickName; | |||
| @Excel(name = "报名时间", format = "yyyy-MM-dd HH:mm:ss", width = 10, orderNum = "8") | |||
| @Excel(name = "报名时间", format = "yyyy-MM-dd HH:mm:ss", width = 30, orderNum = "9") | |||
| @io.swagger.annotations.ApiModelProperty(value = "创建时间", name = "createTime") | |||
| private Date createTime; | |||
| @Excel(name = "活动签到", replace = {"未签到_0", "已签到_1"}, width = 10, orderNum = "9") | |||
| @Excel(name = "活动签到", replace = {"未签到_0", "已签到_1"}, width = 10, orderNum = "10") | |||
| @io.swagger.annotations.ApiModelProperty(value = "签到状态1签到0未签到", name = "signIn") | |||
| private Integer signIn; | |||
| @Excel(name = "报名状态", replace = {"未确认_0", "已确认_1", "报名失败_2", "活动过期_3"}, width = 10, orderNum = "10") | |||
| @Excel(name = "报名状态", replace = {"未确认_0", "已确认_1", "报名失败_2", "活动过期_3"}, width = 11, orderNum = "10") | |||
| @io.swagger.annotations.ApiModelProperty(value = "状态0未确认-报名中1确认-报名成功2取消-报名失败3过期", name = "status") | |||
| private Integer status; | |||
| @Excel(name = "调查问券", width = 10, orderNum = "11") | |||
| @Excel(name = "调查问券", width = 50, orderNum = "12") | |||
| @io.swagger.annotations.ApiModelProperty(value = "调查问券", name = "answer") | |||
| private String answer; | |||
| @io.swagger.annotations.ApiModelProperty(value = "地址", name = "address") | |||
| private String address; | |||
| @TableField(exist = false) | |||
| @Excel(name = "地址", width = 20, orderNum = "8") | |||
| @io.swagger.annotations.ApiModelProperty(value = "地址", name = "addressStr") | |||
| private String addressStr; | |||
| public String getAddressStr(){ | |||
| if(StringUtils.isNotBlank(this.address)){ | |||
| try{ | |||
| JSONObject addressObject = JSON.parseObject(this.address); | |||
| if(addressObject != null && !addressObject.isEmpty()){ | |||
| String string = addressObject.getString("address"); | |||
| this.addressStr = string; | |||
| } | |||
| }catch(Exception e){} | |||
| } | |||
| return this.addressStr; | |||
| } | |||
| @io.swagger.annotations.ApiModelProperty(value = "更新时间", name = "updateTime") | |||
| private Date updateTime; | |||
| @@ -25,6 +25,15 @@ public class WxCUser extends CUser { | |||
| appPlat = EnumAppPlat.WX; | |||
| } | |||
| @io.swagger.annotations.ApiModelProperty(value="EnumBusinessCircleAuthorizeState 授权商圈快速积分状态",name="authorizeState") | |||
| private Integer authorizeState; | |||
| @io.swagger.annotations.ApiModelProperty(value="授权时间",name="authorizeTime") | |||
| private Date authorizeTime; | |||
| @io.swagger.annotations.ApiModelProperty(value="取消授权时间",name="deauthorizeTime") | |||
| private Date deauthorizeTime; | |||
| public String createToken(Date currentDate,String tenantId) { | |||
| if(StringUtils.isBlank(tenantId)){ | |||
| tenantId = "1"; | |||
| @@ -237,7 +237,7 @@ public class WxCUserBasicInfo extends TenantEntityWithoutFinalTenantId { | |||
| return Objects.hash(this.phone); | |||
| } | |||
| public void undateFinalTenantId(TenantEntity tenantEntity){ | |||
| public void updateFinalTenantId(TenantEntity tenantEntity){ | |||
| // setTenantId(tenantEntity.getTenantId()); | |||
| // setParentTenantId(tenantEntity.getParentTenantId()); | |||
| setFinalTenantId(tenantEntity.getTenantId()); | |||
| @@ -252,6 +252,9 @@ public class WxCoupon extends TenantEntity { | |||
| @io.swagger.annotations.ApiModelProperty(value="直连收款门店",name="makeMerchantId") | |||
| private Long makeMerchantId; | |||
| @io.swagger.annotations.ApiModelProperty(value="第三方商品Id",name="goodsId") | |||
| private String goodsId; | |||
| @io.swagger.annotations.ApiModelProperty(value="EnumTtProductType",name="productType") | |||
| private Integer productType; | |||
| @@ -448,94 +451,6 @@ public class WxCoupon extends TenantEntity { | |||
| return false; | |||
| } | |||
| public boolean validDate(boolean isShare,Date curr) { | |||
| if(this.getType().equals(EnumCouponType.COUPON_DOUYIN.getCode())){ | |||
| return true; | |||
| } | |||
| if(isShare && this.getSalePrice() > 0 && !this.checkIsCard()){ | |||
| Date valid_date = getOuterRealValidDate(curr); | |||
| Date limit_date = DateUtils.getTimeAfterDays(Constant.WX_LIMIT_DAYS, curr); | |||
| if (valid_date.after(limit_date)) { | |||
| return false; | |||
| } | |||
| } | |||
| return true; | |||
| // Map retMap = calcuteValidDate(isShare, hasShareAmount, curr); | |||
| // int success = (int) retMap.get("success"); | |||
| // if (success > 0) { | |||
| // return true; | |||
| // }else { | |||
| // return false; | |||
| // } | |||
| } | |||
| public Date getRealValidDate(Date curr) { | |||
| //券都上架卖出去了还判断个什么有效期 | |||
| // Map retMap = calcuteValidDate(isShare,hasShareAmount,curr); | |||
| // return (Date) retMap.get("realDate"); | |||
| return getOuterRealValidDate(curr); | |||
| } | |||
| // private Map calcuteValidDate(boolean isShare,boolean hasShareAmount,Date curr) { | |||
| // if(this.getType().equals(EnumCouponType.COUPON_DOUYIN.getCode())){ | |||
| // Map retMap = new HashMap(); | |||
| // retMap.put("success", 1); | |||
| // retMap.put("realDate", getOuterRealValidDate(new Date())); | |||
| // return retMap; | |||
| // } | |||
| // 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) { | |||
| Date valid_date = null; | |||
| @@ -41,6 +41,8 @@ public class WxCouponChannel extends TenantEntity { | |||
| @io.swagger.annotations.ApiModelProperty(value="卡券id",name="couponId") | |||
| private Long couponId; | |||
| @io.swagger.annotations.ApiModelProperty(value="直连收款门店",name="makeMerchantId") | |||
| private Long makeMerchantId; | |||
| @io.swagger.annotations.ApiModelProperty(value="券类型(1.满减券,2.代金券,3.团购券,4.礼品券,5.停车券)",name="type") | |||
| private Integer type; | |||
| @@ -0,0 +1,100 @@ | |||
| package com.iformall.domain.po; | |||
| import com.baomidou.mybatisplus.annotation.TableName; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import com.iformall.domain.po.base.TenantEntityWithoutFinalTenantId; | |||
| import lombok.Data; | |||
| import lombok.EqualsAndHashCode; | |||
| import lombok.ToString; | |||
| import org.apache.commons.lang3.StringUtils; | |||
| import java.util.Date; | |||
| @TableName(value = "wx_member_card") | |||
| @Data | |||
| @ToString(callSuper = true) | |||
| @EqualsAndHashCode(callSuper = true) | |||
| public class WxMemberCard extends TenantEntityWithoutFinalTenantId { | |||
| @io.swagger.annotations.ApiModelProperty(value="如果是集团版的,存集团版的tenantId,如果是商场,则存商场",name="sex") | |||
| private String finalTenantId; | |||
| protected Long id; | |||
| @io.swagger.annotations.ApiModelProperty(value="会员卡ID",name="cardId") | |||
| private String cardId; | |||
| @io.swagger.annotations.ApiModelProperty(value="会员卡code",name="cardCode") | |||
| private String cardCode; | |||
| @io.swagger.annotations.ApiModelProperty(value="EnumMemberCardActivateScene 开卡场景",name="activateScene") | |||
| private Integer activateScene; | |||
| @io.swagger.annotations.ApiModelProperty(value="自定义场景",name="outerStr") | |||
| private Integer outerStr; | |||
| @io.swagger.annotations.ApiModelProperty(value="",name="openId") | |||
| private String openId; | |||
| @io.swagger.annotations.ApiModelProperty(value="",name="unionId") | |||
| private String unionId; | |||
| @io.swagger.annotations.ApiModelProperty(value="展示会员编号",name="membershipNumber") | |||
| private String membershipNumber; | |||
| @io.swagger.annotations.ApiModelProperty(value="会员等级",name="level") | |||
| private String level; | |||
| @io.swagger.annotations.ApiModelProperty(value="用户昵称",name="nickname") | |||
| private String nickname; | |||
| @io.swagger.annotations.ApiModelProperty(value="头像",name="headImageUrl") | |||
| private String headImageUrl; | |||
| @io.swagger.annotations.ApiModelProperty(value="会员卡背景",name="backgroundPictureUrl") | |||
| private String backgroundPictureUrl; | |||
| @io.swagger.annotations.ApiModelProperty(value="用户储值的最新余额,单位分",name="balance") | |||
| private Integer balance; | |||
| @io.swagger.annotations.ApiModelProperty(value="EnumMemberCardStatus 用户会员卡状态",name="userCardStatus") | |||
| private Integer userCardStatus; | |||
| @io.swagger.annotations.ApiModelProperty(value="用户开卡时填写的个人信息{}",name="userInformation") | |||
| private String userInformation; | |||
| @io.swagger.annotations.ApiModelProperty(value="用户当前的积分值",name="bonusValue") | |||
| private Integer bonusValue; | |||
| @io.swagger.annotations.ApiModelProperty(value="用户当前的会员服务项内容[]",name="serviceModules") | |||
| private String serviceModules; | |||
| @io.swagger.annotations.ApiModelProperty(value="用户会员卡详情页会员优惠栏目中的会员专享价文案",name="memberPriceWord") | |||
| private String memberPriceWord; | |||
| @io.swagger.annotations.ApiModelProperty(value="发票栏跳转小程序的引导文案",name="fapiaoJumpWord") | |||
| private String fapiaoJumpWord; | |||
| @io.swagger.annotations.ApiModelProperty(value="设置商家联系人员的名字、头像和联系方式[]",name="guide") | |||
| private String guide; | |||
| @io.swagger.annotations.ApiModelProperty(value="更新时间",name="updateDate") | |||
| private Date updateDate; | |||
| @io.swagger.annotations.ApiModelProperty(value="创建时间",name="createDate") | |||
| private Date createDate; | |||
| @io.swagger.annotations.ApiModelProperty(value="",name="cuserId") | |||
| private Long cuserId; | |||
| @io.swagger.annotations.ApiModelProperty(value="",name="userId") | |||
| private Long userId; | |||
| public void updateFinalTenantId(TenantEntity tenantEntity){ | |||
| setFinalTenantId(tenantEntity.getTenantId()); | |||
| if(StringUtils.isNotBlank(tenantEntity.getParentTenantId())){ | |||
| setFinalTenantId(tenantEntity.getParentTenantId()); | |||
| } | |||
| } | |||
| } | |||
| @@ -7,13 +7,12 @@ import com.google.gson.JsonObject; | |||
| import com.iformall.common.SortColumn; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import com.iformall.domain.vo.WxShopVo; | |||
| import com.iformall.enums.EnumBusiness; | |||
| import com.iformall.enums.EnumMerchantStatus; | |||
| import com.iformall.enums.EnumSubBusiness; | |||
| import com.iformall.enums.*; | |||
| import com.iformall.utils.Constant; | |||
| import lombok.Data; | |||
| import lombok.EqualsAndHashCode; | |||
| import lombok.ToString; | |||
| import org.apache.commons.lang3.StringUtils; | |||
| import java.math.BigDecimal; | |||
| import java.util.Date; | |||
| @@ -138,11 +137,15 @@ public class WxMerchant extends TenantEntity { | |||
| @Excel(name = "管理员", width = 20, orderNum = "14") | |||
| private String usersStr; | |||
| @Excel(name = "主谈人", width = 20, orderNum = "15") | |||
| @TableField(exist = false) | |||
| @Excel(name = "账户", width = 30, orderNum = "15") | |||
| private String receivers; | |||
| @Excel(name = "主谈人", width = 20, orderNum = "16") | |||
| @io.swagger.annotations.ApiModelProperty(value = "主谈人", name = "talkUserMain") | |||
| private String talkUserMain; | |||
| @Excel(name = "辅谈人", width = 20, orderNum = "16") | |||
| @Excel(name = "辅谈人", width = 20, orderNum = "17") | |||
| @io.swagger.annotations.ApiModelProperty(value = "辅谈人", name = "talkUserAux") | |||
| private String talkUserAux; | |||
| @@ -188,6 +191,39 @@ public class WxMerchant extends TenantEntity { | |||
| } | |||
| } | |||
| public String getReceivers() { | |||
| if (wxProfitSharingReceiver != null && wxProfitSharingReceiver.size() > 0) { | |||
| return String.join("\n", | |||
| wxProfitSharingReceiver.stream().map(r->{ | |||
| StringBuffer str = new StringBuffer(); | |||
| if(EnumProfitSharingType.PROFIT_SHARING_TYPE_WECHAT_v2.getCode().equals(r.getSharingType())){ | |||
| str.append("微信特约商户号:"); | |||
| }else if(EnumProfitSharingType.PROFIT_SHARING_TYPE_DOUYIN.getCode().equals(r.getSharingType())){ | |||
| str.append("抖音商户号:"); | |||
| }else if(EnumProfitSharingType.PROFIT_SHARING_TYPE_BANK.getCode().equals(r.getSharingType())){ | |||
| str.append("银行卡号:"); | |||
| }else if(EnumProfitSharingType.PROFIT_SHARING_TYPE_WECHAT.getCode().equals(r.getSharingType())){ | |||
| if(EnumProfitSharingReceiverType.PROFIT_SHARING_RECEIVER_MERCHANT_ID.getCode().equals(r.getReceiverType())){ | |||
| str.append("微信商户号:"); | |||
| }else if(EnumProfitSharingReceiverType.PROFIT_SHARING_RECEIVER_PERSONAL_WECHATID.getCode().equals(r.getReceiverType())){ | |||
| str.append("个人微信号(微信已停用):"); | |||
| }else if(EnumProfitSharingReceiverType.PROFIT_SHARING_RECEIVER_PERSONAL_OPENID.getCode().equals(r.getReceiverType())){ | |||
| str.append("OPENID:"); | |||
| } else if(EnumProfitSharingReceiverType.PROFIT_SHARING_RECEIVER_PERSONAL_SUB_OPENID.getCode().equals(r.getReceiverType())){ | |||
| str.append("OPENID:"); | |||
| } | |||
| } | |||
| str.append(r.getReceiverAccount()); | |||
| if(StringUtils.isNotBlank(r.getTrueName())){ | |||
| str.append("(").append(r.getTrueName()).append(")"); | |||
| } | |||
| return str.toString(); | |||
| }).collect(Collectors.toList())); | |||
| } else { | |||
| return null; | |||
| } | |||
| } | |||
| public String getBusinessName() { | |||
| return EnumBusiness.getEnumMessage(businessId); | |||
| } | |||
| @@ -57,6 +57,8 @@ public class WxOrder extends TenantEntity { | |||
| private Long couponChannelId; | |||
| @io.swagger.annotations.ApiModelProperty(value="产品ID(type-0:couponId, 1:buserId, 3:merchantId)",name="productId") | |||
| private Long productId; | |||
| @io.swagger.annotations.ApiModelProperty(value="产品基本描述",name="productName") | |||
| private String productName; | |||
| @io.swagger.annotations.ApiModelProperty(value="类型(0:券,1:B刷卡支付,2:C扫码支付,3:储值卡, 10:POS支付)",name="type") | |||
| private Integer type; | |||
| @io.swagger.annotations.ApiModelProperty(value = "支付渠道EnumPayWay", name = "payVendor") | |||
| @@ -66,6 +68,9 @@ public class WxOrder extends TenantEntity { | |||
| @io.swagger.annotations.ApiModelProperty(value="0: 付款 1: 退款",name="paymentType") | |||
| private Integer paymentType; | |||
| @io.swagger.annotations.ApiModelProperty(value="直连收款门店",name="makeMerchantId") | |||
| private Long makeMerchantId; | |||
| @io.swagger.annotations.ApiModelProperty(value="支付金额(分):允许有负数,退款时为负值。",name="payment") | |||
| private Integer payment; | |||
| @io.swagger.annotations.ApiModelProperty(value="支付时间",name="paymentTime") | |||
| @@ -22,26 +22,39 @@ public class WxPayAccount extends TenantEntity { | |||
| private String subMchId; | |||
| @io.swagger.annotations.ApiModelProperty(value="服务商模式下的子商户公众账号ID",name="subAppId") | |||
| private String subAppId; | |||
| @io.swagger.annotations.ApiModelProperty(value="支付密钥",name="apiKey") | |||
| private String apiKey; | |||
| @io.swagger.annotations.ApiModelProperty(value="平台证书本地存放位置",name="certPath") | |||
| private String certPath; | |||
| @io.swagger.annotations.ApiModelProperty(value="商户支付密钥",name="merchantApiKey") | |||
| private String merchantApiKey; | |||
| @io.swagger.annotations.ApiModelProperty(value="商户自己的证书",name="merchantCertPath") | |||
| private String merchantCertPath; | |||
| @io.swagger.annotations.ApiModelProperty(value="微信回调,支持3种回调,(1.url/pay 2.url/refund3.url/separate)",name="notifyUrl") | |||
| private String notifyUrl; | |||
| @io.swagger.annotations.ApiModelProperty(value="tt回调token",name="notifyToken") | |||
| private String notifyToken; | |||
| @io.swagger.annotations.ApiModelProperty(value="平台证书本地存放位置",name="certPath") | |||
| private String certPath; | |||
| @io.swagger.annotations.ApiModelProperty(value="商户自己的证书",name="merchantCertPath") | |||
| private String merchantCertPath; | |||
| @io.swagger.annotations.ApiModelProperty(value="商户自己的证书密钥文件",name="merchantCertPemPath") | |||
| private String merchantCertPemPath; | |||
| @io.swagger.annotations.ApiModelProperty(value="商户自己的密钥文件",name="merchantKeyPath") | |||
| private String merchantKeyPath; | |||
| @io.swagger.annotations.ApiModelProperty(value="平台apiV3秘钥",name="apiV3Key") | |||
| private String apiV3Key; | |||
| @io.swagger.annotations.ApiModelProperty(value="平台证书序列号",name="certSerialNo") | |||
| private String certSerialNo; | |||
| @io.swagger.annotations.ApiModelProperty(value="平台私钥文件",name="privateKeyPath") | |||
| private String privateKeyPath; | |||
| @io.swagger.annotations.ApiModelProperty(value="平台证书密钥文件",name="privateCertPemPath") | |||
| private String privateCertPemPath; | |||
| @io.swagger.annotations.ApiModelProperty(value="商户自己的apiv3密钥",name="merchantApiv3Key") | |||
| private String merchantApiv3Key; | |||
| @io.swagger.annotations.ApiModelProperty(value="商户自己的平台证书序列号",name="merchantCertSerialNo") | |||
| private String merchantCertSerialNo; | |||
| @io.swagger.annotations.ApiModelProperty(value="商户自己的密钥文件",name="merchantKeyPath") | |||
| private String merchantKeyPath; | |||
| @io.swagger.annotations.ApiModelProperty(value="商户自己的证书密钥文件",name="merchantCertPemPath") | |||
| private String merchantCertPemPath; | |||
| @io.swagger.annotations.ApiModelProperty(value="商户模式-0:普通商户模式1:服务商模式",name="type") | |||
| private Integer type; | |||
| @io.swagger.annotations.ApiModelProperty(value="EnumPayMchType 0:总分1:直连",name="mchType") | |||
| @@ -56,6 +69,7 @@ public class WxPayAccount extends TenantEntity { | |||
| private Integer rate; | |||
| @io.swagger.annotations.ApiModelProperty(value="实际手续费(万分之几,默认60)",name="realRate") | |||
| private Integer realRate; | |||
| @io.swagger.annotations.ApiModelProperty(value="是否抽成",name="isCommission") | |||
| private Integer isCommission; | |||
| @io.swagger.annotations.ApiModelProperty(value="系统提点",name="systemRate") | |||
| @@ -88,14 +102,15 @@ public class WxPayAccount extends TenantEntity { | |||
| private String serviceId; | |||
| @io.swagger.annotations.ApiModelProperty(value="微信支付分回调地址",name="payScoreNotifyUrl") | |||
| private String payScoreNotifyUrl; | |||
| @io.swagger.annotations.ApiModelProperty(value="平台apiV3秘钥",name="apiV3Key") | |||
| private String apiV3Key; | |||
| @io.swagger.annotations.ApiModelProperty(value="平台证书序列号",name="certSerialNo") | |||
| private String certSerialNo; | |||
| @io.swagger.annotations.ApiModelProperty(value="平台私钥文件",name="privateKeyPath") | |||
| private String privateKeyPath; | |||
| @io.swagger.annotations.ApiModelProperty(value="平台证书密钥文件",name="privateCertPemPath") | |||
| private String privateCertPemPath; | |||
| @io.swagger.annotations.ApiModelProperty(value="商圈版本",name="businessType") | |||
| private Integer businessType; | |||
| @io.swagger.annotations.ApiModelProperty(value="品牌ID",name="brandid") | |||
| private String brandid; | |||
| @io.swagger.annotations.ApiModelProperty(value="商圈会员卡ID",name="cardId") | |||
| private String cardId; | |||
| // @io.swagger.annotations.ApiModelProperty(value="app平台 EnumAppPlat ",name="plat") | |||
| // private Integer plat; | |||
| @@ -0,0 +1,25 @@ | |||
| package com.iformall.domain.po.msg; | |||
| import lombok.Data; | |||
| import lombok.EqualsAndHashCode; | |||
| import lombok.ToString; | |||
| import java.util.List; | |||
| /** | |||
| * | |||
| */ | |||
| @Data | |||
| @ToString(callSuper = true) | |||
| @EqualsAndHashCode(callSuper = true) | |||
| public class AfterAddCreditMsg extends BaseMsg { | |||
| private static final long serialVersionUID = -1l; | |||
| @io.swagger.annotations.ApiModelProperty(value="用户ID",name="cserId") | |||
| private Long cuserId; | |||
| @io.swagger.annotations.ApiModelProperty(value="会员ID",name="basicUserId") | |||
| private Long basicUserId; | |||
| @io.swagger.annotations.ApiModelProperty(value="积分变动ID",name="creditHistoryId") | |||
| private Long creditHistoryId; | |||
| } | |||
| @@ -0,0 +1,21 @@ | |||
| package com.iformall.domain.po.msg; | |||
| import lombok.Data; | |||
| import lombok.EqualsAndHashCode; | |||
| import lombok.ToString; | |||
| /** | |||
| * | |||
| */ | |||
| @Data | |||
| @ToString(callSuper = true) | |||
| @EqualsAndHashCode(callSuper = true) | |||
| public class AfterAddScoreMsg extends BaseMsg { | |||
| private static final long serialVersionUID = -1l; | |||
| @io.swagger.annotations.ApiModelProperty(value="会员ID",name="basicUserId") | |||
| private Long basicUserId; | |||
| @io.swagger.annotations.ApiModelProperty(value="成长值变动ID",name="scoreHistoryId") | |||
| private Long scoreHistoryId; | |||
| } | |||
| @@ -0,0 +1,20 @@ | |||
| package com.iformall.domain.po.msg; | |||
| import lombok.Data; | |||
| import lombok.EqualsAndHashCode; | |||
| import lombok.ToString; | |||
| /** | |||
| * | |||
| */ | |||
| @Data | |||
| @ToString(callSuper = true) | |||
| @EqualsAndHashCode(callSuper = true) | |||
| public class AfterBusinessCreditMsg extends BaseMsg { | |||
| private static final long serialVersionUID = -1l; | |||
| @io.swagger.annotations.ApiModelProperty(value="商圈订单ID",name="businessCircleOrderId") | |||
| private Long businessCircleOrderId; | |||
| } | |||
| @@ -0,0 +1,19 @@ | |||
| package com.iformall.domain.po.msg; | |||
| import lombok.Data; | |||
| import lombok.EqualsAndHashCode; | |||
| import lombok.ToString; | |||
| /** | |||
| * | |||
| */ | |||
| @Data | |||
| @ToString(callSuper = true) | |||
| @EqualsAndHashCode(callSuper = true) | |||
| public class AfterCarInOutMsg extends BaseMsg { | |||
| private static final long serialVersionUID = -1l; | |||
| @io.swagger.annotations.ApiModelProperty(value="停车记录ID",name="carCmdLogId") | |||
| private Long carCmdLogId; | |||
| } | |||
| @@ -0,0 +1,22 @@ | |||
| package com.iformall.domain.po.msg; | |||
| import lombok.Data; | |||
| import lombok.EqualsAndHashCode; | |||
| import lombok.ToString; | |||
| /** | |||
| * | |||
| */ | |||
| @Data | |||
| @ToString(callSuper = true) | |||
| @EqualsAndHashCode(callSuper = true) | |||
| public class SyncMemberCardMsg extends BaseMsg { | |||
| private static final long serialVersionUID = -1l; | |||
| @io.swagger.annotations.ApiModelProperty(value="",name="cardId") | |||
| private String cardId; | |||
| @io.swagger.annotations.ApiModelProperty(value="",name="code") | |||
| private String code; | |||
| } | |||
| @@ -13,6 +13,7 @@ public class MarkingSceneDataReportVo { | |||
| private int verifySendCount; // 核销发放 | |||
| private int microPaySendCount; // B端刷卡支付发放 | |||
| private int orderSendCount; // 购买发放数 | |||
| private int merchantSendCount; // 商户发放数 | |||
| private int parkCount; // 停车核销数 | |||
| private int verifyCount; // 核销核销数 | |||
| private int microPayCount; // 核销核销数 | |||
| @@ -91,10 +91,12 @@ public class WxOrderPayExpVo extends WxOrder { | |||
| this.setCUserId(o.getCUserId()); | |||
| this.setCouponChannelId(o.getCouponChannelId()); | |||
| this.setProductId(o.getProductId()); | |||
| this.setProductName(o.getProductName()); | |||
| this.setType(o.getType()); | |||
| this.setPayVendor(o.getPayVendor()); | |||
| this.setPayVersion(o.getPayVersion()); | |||
| this.setPaymentType(o.getPaymentType()); | |||
| this.setMakeMerchantId(o.getMakeMerchantId()); | |||
| this.setPayment(o.getPayment()); | |||
| this.setPaymentTime(o.getPaymentTime()); | |||
| this.setFreightPrice(o.getFreightPrice()); | |||
| @@ -110,10 +110,12 @@ public class WxOrderPayVo extends WxOrder { | |||
| this.setCUserId(o.getCUserId()); | |||
| this.setCouponChannelId(o.getCouponChannelId()); | |||
| this.setProductId(o.getProductId()); | |||
| this.setProductName(o.getProductName()); | |||
| this.setType(o.getType()); | |||
| this.setPayVendor(o.getPayVendor()); | |||
| this.setPayVersion(o.getPayVersion()); | |||
| this.setPaymentType(o.getPaymentType()); | |||
| this.setMakeMerchantId(o.getMakeMerchantId()); | |||
| this.setPayment(o.getPayment()); | |||
| this.setPaymentTime(o.getPaymentTime()); | |||
| this.setFreightPrice(o.getFreightPrice()); | |||
| @@ -43,8 +43,39 @@ public interface TtWebPoiPlanService { | |||
| String POI_COMMON_PLAN_TALENT_MEDIA_LIST = "https://open.douyin.com/poi/common/plan/talent/media/list/"; | |||
| /** | |||
| * 发布/修改直播间定向佣金计划 | |||
| */ | |||
| String POI_ORIENTED_PLAN_LIVE_SAVE = "https://open.douyin.com/poi/oriented/plan/live/save/"; | |||
| /** | |||
| * 发布/修改短视频定向佣金计划 | |||
| */ | |||
| String POI_ORIENTED_PLAN_VIDEO_SAVE = "https://open.douyin.com/poi/oriented/plan/video/save/"; | |||
| /** | |||
| * 修改定向计划状态 | |||
| */ | |||
| String POI_ORIENTED_PLAN_UPDATE_STATUS = "https://open.douyin.com/poi/oriented/plan/update/status/"; | |||
| /** | |||
| * 取消定向佣金计划指定的达人 | |||
| */ | |||
| String POI_ORIENTED_PLAN_DELETE_TALENT = "https://open.douyin.com/poi/oriented/plan/delete/talent/"; | |||
| /** | |||
| * 查询达人的定向佣金计划带货数据 | |||
| */ | |||
| String POI_ORIENTED_PLAN_TALENT_DETAIL = "https://open.douyin.com/poi/oriented/plan/talent/detail/"; | |||
| /** | |||
| * 通过商品 ID 查询定向佣金计划 | |||
| */ | |||
| String POI_ORIENTED_PLAN_LIST = "https://open.douyin.com/poi/oriented/plan/list/"; | |||
| /** | |||
| * 查询定向佣金计划带货汇总数据 | |||
| */ | |||
| String POI_ORIENTED_PLAN_DETAIL = "https://open.douyin.com/poi/oriented/plan/detail/"; | |||
| /** | |||
| * 商品达人分佣配置 | |||
| * 淘汰 | |||
| */ | |||
| String POI_TAKE_RATE = "https://open.douyin.com/poi/v2/spu/take_rate/sync/"; | |||
| @@ -53,11 +84,26 @@ public interface TtWebPoiPlanService { | |||
| */ | |||
| PoiPlanPage poiPlanList(Long spuId,Integer pageNo,Integer pageSize) throws WxErrorException; | |||
| /** | |||
| * 通过商品 ID 查询定向佣金计划 | |||
| */ | |||
| PoiOrientedPlanPage poiOrientedPlanList(Long spuId,Integer pageNo,Integer pageSize) throws WxErrorException; | |||
| /** | |||
| * 发布/修改通用佣金计划 | |||
| */ | |||
| Long poiPlanSave(PoiPlan poiPlan) throws WxErrorException ; | |||
| /** | |||
| * 发布/修改直播间定向佣金计划 | |||
| */ | |||
| Long poiOrientedPlanLiveSave(PoiOrientedPlan poiPlan) throws WxErrorException ; | |||
| /** | |||
| * 发布/修改短视频定向佣金计划 | |||
| */ | |||
| Long poiOrientedPlanVideoSave(PoiOrientedPlan poiPlan) throws WxErrorException ; | |||
| /** | |||
| * 修改通用佣金计划状态 | |||
| * status | |||
| @@ -67,8 +113,25 @@ public interface TtWebPoiPlanService { | |||
| */ | |||
| boolean poiPlanUpdateStatus(Long planId,Integer status) throws WxErrorException ; | |||
| /** | |||
| * 修改定向佣金计划状态 | |||
| * status | |||
| * 1:设置为进行中 | |||
| * 2:设置为暂停中 | |||
| * 3:设置为已关闭 | |||
| */ | |||
| boolean poiOrientedPlanUpdateStatus(Long planId,Integer status) throws WxErrorException ; | |||
| /** | |||
| * 取消定向佣金计划指定的达人ORIENTED_PLAN_DELETE_TALENT | |||
| */ | |||
| boolean poiOrientedPlanDeleteTalent(Long planId,String douyinId) throws WxErrorException ; | |||
| /** | |||
| * 商品达人分佣配置(定向分佣) | |||
| * 淘汰 | |||
| */ | |||
| String poiTakeRate(PoiTakeRate poiTakeRate) throws WxErrorException ; | |||
| @@ -77,6 +140,11 @@ public interface TtWebPoiPlanService { | |||
| */ | |||
| PoiPlanDetail poiPlanDetail(List<Long> plan_id_list) throws WxErrorException ; | |||
| /** | |||
| * 查询定向佣金计划带货汇总数据 | |||
| */ | |||
| PoiOrientedPlanDetail poiOrientedPlanDetail(List<Long> plan_id_list) throws WxErrorException ; | |||
| /** | |||
| * 通用佣金计划查询带货达人列表 | |||
| */ | |||
| @@ -87,6 +155,11 @@ public interface TtWebPoiPlanService { | |||
| */ | |||
| PoiPlanTalentDetail poiPlanTalentDetail(Long plan_id,List<String> douyin_id_list) throws WxErrorException ; | |||
| /** | |||
| * 查询达人的定向佣金计划带货数据 | |||
| */ | |||
| PoiOrientedPlanTalentDetail poiOrientedPlanTalentDetail(Long plan_id,List<String> douyin_id_list) throws WxErrorException ; | |||
| /** | |||
| * 通用佣金计划查询达人带货详情 | |||
| * | |||
| @@ -35,6 +35,17 @@ public class TtWebPoiPlanServiceImpl implements TtWebPoiPlanService { | |||
| return GSON.fromJson(result, PoiPlanPage.class); | |||
| } | |||
| @Override | |||
| public PoiOrientedPlanPage poiOrientedPlanList(Long spuId, Integer pageNo, Integer pageSize) throws WxErrorException { | |||
| final TtWebPostRequestExecutor executor = new TtWebPostRequestExecutor(this.service.getRequestHttp()); | |||
| Map<String,Object> map = new HashMap<>(); | |||
| List<Long> spu_id_list = new ArrayList<>(); | |||
| spu_id_list.add(spuId); | |||
| map.put("spu_id_list",spu_id_list); | |||
| String result = this.service.execute(executor, this.POI_ORIENTED_PLAN_LIST, GSON.toJson(map)); | |||
| return GSON.fromJson(result, PoiOrientedPlanPage.class); | |||
| } | |||
| @Override | |||
| public Long poiPlanSave(PoiPlan poiPlan) throws WxErrorException { | |||
| final TtWebPostRequestExecutor executor = new TtWebPostRequestExecutor(this.service.getRequestHttp()); | |||
| @@ -43,6 +54,22 @@ public class TtWebPoiPlanServiceImpl implements TtWebPoiPlanService { | |||
| return jsonObject.getLong("plan_id"); | |||
| } | |||
| @Override | |||
| public Long poiOrientedPlanLiveSave(PoiOrientedPlan poiPlan) throws WxErrorException { | |||
| final TtWebPostRequestExecutor executor = new TtWebPostRequestExecutor(this.service.getRequestHttp()); | |||
| String result = this.service.execute(executor, this.POI_ORIENTED_PLAN_LIVE_SAVE, GSON.toJson(poiPlan)); | |||
| JSONObject jsonObject = JSONObject.parseObject(result); | |||
| return jsonObject.getLong("plan_id"); | |||
| } | |||
| @Override | |||
| public Long poiOrientedPlanVideoSave(PoiOrientedPlan poiPlan) throws WxErrorException { | |||
| final TtWebPostRequestExecutor executor = new TtWebPostRequestExecutor(this.service.getRequestHttp()); | |||
| String result = this.service.execute(executor, this.POI_ORIENTED_PLAN_VIDEO_SAVE, GSON.toJson(poiPlan)); | |||
| JSONObject jsonObject = JSONObject.parseObject(result); | |||
| return jsonObject.getLong("plan_id"); | |||
| } | |||
| @Override | |||
| public boolean poiPlanUpdateStatus(Long planId, Integer status) throws WxErrorException { | |||
| final TtWebPostRequestExecutor executor = new TtWebPostRequestExecutor(this.service.getRequestHttp()); | |||
| @@ -62,6 +89,35 @@ public class TtWebPoiPlanServiceImpl implements TtWebPoiPlanService { | |||
| return true; | |||
| } | |||
| @Override | |||
| public boolean poiOrientedPlanUpdateStatus(Long planId, Integer status) throws WxErrorException { | |||
| final TtWebPostRequestExecutor executor = new TtWebPostRequestExecutor(this.service.getRequestHttp()); | |||
| Map<String,Object> map = new HashMap<>(); | |||
| List<Map<String,Object>> updateList = new ArrayList<>(); | |||
| Map<String,Object> updateMap = new HashMap<>(); | |||
| updateMap.put("plan_id",planId); | |||
| updateMap.put("status",status); | |||
| updateList.add(updateMap); | |||
| map.put("plan_update_list",updateList); | |||
| String result = this.service.execute(executor, this.POI_ORIENTED_PLAN_UPDATE_STATUS, GSON.toJson(map)); | |||
| JSONObject jsonObject = JSONObject.parseObject(result); | |||
| JSONArray fail_plan_id_list = jsonObject.getJSONArray("fail_plan_id_list"); | |||
| if(fail_plan_id_list != null && fail_plan_id_list.size() > 0){ | |||
| return false; | |||
| } | |||
| return true; | |||
| } | |||
| @Override | |||
| public boolean poiOrientedPlanDeleteTalent(Long planId, String douyinId) throws WxErrorException { | |||
| final TtWebPostRequestExecutor executor = new TtWebPostRequestExecutor(this.service.getRequestHttp()); | |||
| Map<String,Object> map = new HashMap<>(); | |||
| map.put("plan_id",planId); | |||
| map.put("douyin_id",douyinId); | |||
| String result = this.service.execute(executor, this.POI_ORIENTED_PLAN_DELETE_TALENT, GSON.toJson(map)); | |||
| return true; | |||
| } | |||
| @Override | |||
| public String poiTakeRate(PoiTakeRate poiTakeRate) throws WxErrorException { | |||
| final TtWebPostRequestExecutor executor = new TtWebPostRequestExecutor(this.service.getRequestHttp()); | |||
| @@ -79,6 +135,15 @@ public class TtWebPoiPlanServiceImpl implements TtWebPoiPlanService { | |||
| return GSON.fromJson(result, PoiPlanDetail.class); | |||
| } | |||
| @Override | |||
| public PoiOrientedPlanDetail poiOrientedPlanDetail(List<Long> plan_id_list) throws WxErrorException { | |||
| final TtWebPostRequestExecutor executor = new TtWebPostRequestExecutor(this.service.getRequestHttp()); | |||
| Map<String,Object> map = new HashMap<>(); | |||
| map.put("plan_id_list",plan_id_list); | |||
| String result = this.service.execute(executor, this.POI_ORIENTED_PLAN_DETAIL, GSON.toJson(map)); | |||
| return GSON.fromJson(result, PoiOrientedPlanDetail.class); | |||
| } | |||
| @Override | |||
| public PoiPlanTalentPage poiPlanTalentList(Long plan_id, Integer pageNo, Integer pageSize) throws WxErrorException { | |||
| final TtWebPostRequestExecutor executor = new TtWebPostRequestExecutor(this.service.getRequestHttp()); | |||
| @@ -100,6 +165,16 @@ public class TtWebPoiPlanServiceImpl implements TtWebPoiPlanService { | |||
| return GSON.fromJson(result, PoiPlanTalentDetail.class); | |||
| } | |||
| @Override | |||
| public PoiOrientedPlanTalentDetail poiOrientedPlanTalentDetail(Long plan_id, List<String> douyin_id_list) throws WxErrorException { | |||
| final TtWebPostRequestExecutor executor = new TtWebPostRequestExecutor(this.service.getRequestHttp()); | |||
| Map<String,Object> map = new HashMap<>(); | |||
| map.put("plan_id",plan_id); | |||
| map.put("douyin_id_list",douyin_id_list); | |||
| String result = this.service.execute(executor, this.POI_ORIENTED_PLAN_TALENT_DETAIL, GSON.toJson(map)); | |||
| return GSON.fromJson(result, PoiOrientedPlanTalentDetail.class); | |||
| } | |||
| @Override | |||
| public PoiPlanTalentMediaPage poiPlanTalentMediaList(Long plan_id, Integer pageNo, Integer pageSize, String douyin_id, Integer content_type) throws WxErrorException { | |||
| final TtWebPostRequestExecutor executor = new TtWebPostRequestExecutor(this.service.getRequestHttp()); | |||
| @@ -0,0 +1,128 @@ | |||
| package com.iformall.douyin.web.bean; | |||
| import com.google.gson.annotations.SerializedName; | |||
| import lombok.Data; | |||
| import lombok.NoArgsConstructor; | |||
| import java.io.Serializable; | |||
| import java.util.List; | |||
| import java.util.Map; | |||
| /** | |||
| * 计划. | |||
| * | |||
| * @author thinsstar | |||
| */ | |||
| @Data | |||
| @NoArgsConstructor | |||
| public class PoiOrientedPlan implements Serializable { | |||
| private static final long serialVersionUID = -1L; | |||
| /** | |||
| * 计划ID | |||
| */ | |||
| @SerializedName(value = "plan_id") | |||
| private Long planId; | |||
| /** | |||
| * 计划名称 | |||
| */ | |||
| @SerializedName(value = "plan_name") | |||
| private String planName; | |||
| /** | |||
| * 计划开始时间,直播间场景下的计划此字段为0 | |||
| * 秒级时间戳 | |||
| */ | |||
| @SerializedName(value = "start_time") | |||
| private Long startTime; | |||
| /** | |||
| * 计划结束时间,直播间场景下的计划此字段为0 | |||
| * 秒级时间戳 | |||
| */ | |||
| @SerializedName(value = "end_time") | |||
| private Long endTime; | |||
| /** | |||
| * 佣金有效期,直播间场景下的计划此字段为0 | |||
| */ | |||
| @SerializedName(value = "commission_duration") | |||
| private Long commissionDuration; | |||
| /** | |||
| * 联系电话 | |||
| */ | |||
| @SerializedName(value = "merchant_phone") | |||
| private String merchantPhone; | |||
| /** | |||
| * 可选值: | |||
| * 1:进行中 | |||
| * 2:已完成 | |||
| * 3:已取消 | |||
| */ | |||
| @SerializedName(value = "status") | |||
| private Integer status; | |||
| /** | |||
| * 达人抖音号列表 | |||
| */ | |||
| @SerializedName(value = "douyin_id_list") | |||
| private List<String> douyinIdList; | |||
| /** | |||
| * 达人履约状态: | |||
| * 1:进行中 | |||
| * 2:已完成 | |||
| * 3:已取消 | |||
| */ | |||
| @SerializedName(value = "talent_status_map") | |||
| private Map<String,Integer> talentStatusMap; | |||
| /** | |||
| * 计划指定的商品配置列表 | |||
| */ | |||
| @SerializedName(value = "product_list") | |||
| private List<ProductRate> productList; | |||
| /** | |||
| * 计划创建时间 | |||
| */ | |||
| @SerializedName(value = "create_time") | |||
| private String createTime; | |||
| /** | |||
| * 计划创建时间 | |||
| */ | |||
| @SerializedName(value = "update_time") | |||
| private String updateTime; | |||
| /** | |||
| * 计划支持的带货场景,可选以下的值: | |||
| * | |||
| * 1:仅短视频 | |||
| * 2:仅直播间 | |||
| */ | |||
| @SerializedName(value = "content_type") | |||
| private Integer contentType; | |||
| @Data | |||
| @NoArgsConstructor | |||
| public static class ProductRate implements Serializable { | |||
| private static final long serialVersionUID = 1L; | |||
| /** | |||
| * 商品ID | |||
| */ | |||
| @SerializedName(value = "product_id") | |||
| private Long productId; | |||
| /** | |||
| * 商品定向分佣比例,万分位 | |||
| */ | |||
| @SerializedName(value = "commission_rate") | |||
| private Integer commissionRate; | |||
| } | |||
| } | |||
| @@ -0,0 +1,61 @@ | |||
| package com.iformall.douyin.web.bean; | |||
| import com.google.gson.annotations.SerializedName; | |||
| import lombok.Data; | |||
| import lombok.NoArgsConstructor; | |||
| import java.io.Serializable; | |||
| import java.util.Map; | |||
| /** | |||
| * 商品. | |||
| * | |||
| * @author thinsstar | |||
| */ | |||
| @Data | |||
| @NoArgsConstructor | |||
| public class PoiOrientedPlanDetail implements Serializable { | |||
| private static final long serialVersionUID = -1L; | |||
| /** | |||
| * 数据产出日期 | |||
| */ | |||
| @SerializedName(value = "date") | |||
| private String date; | |||
| /** | |||
| * 计划带货信息详情,以计划ID为key,带货数据为value | |||
| */ | |||
| @SerializedName(value = "data") | |||
| private Map<String,OrientedPlanGMV> data; | |||
| @Data | |||
| @NoArgsConstructor | |||
| public static class OrientedPlanGMV implements Serializable { | |||
| private static final long serialVersionUID = 1L; | |||
| /** | |||
| * 带货GMV | |||
| */ | |||
| @SerializedName(value = "gmv") | |||
| private Integer gmv; | |||
| /** | |||
| * 计划关联的短视频播放量和直播间观看人数总和 | |||
| */ | |||
| @SerializedName(value = "media_cnt") | |||
| private Integer mediaCnt; | |||
| /** | |||
| * 已核销GMV | |||
| */ | |||
| @SerializedName(value = "used_gmv") | |||
| private Integer usedGmv; | |||
| /** | |||
| * 计划信息 | |||
| */ | |||
| @SerializedName(value = "plan_info") | |||
| private PoiOrientedPlan planInfo; | |||
| } | |||
| } | |||
| @@ -0,0 +1,39 @@ | |||
| package com.iformall.douyin.web.bean; | |||
| import com.google.gson.annotations.SerializedName; | |||
| import lombok.Data; | |||
| import lombok.NoArgsConstructor; | |||
| import java.io.Serializable; | |||
| import java.util.List; | |||
| /** | |||
| * | |||
| * | |||
| * @author thinsstar | |||
| */ | |||
| @Data | |||
| @NoArgsConstructor | |||
| public class PoiOrientedPlanPage implements Serializable { | |||
| private static final long serialVersionUID = -1L; | |||
| /** | |||
| * 总页数 | |||
| */ | |||
| @SerializedName(value = "page_count") | |||
| private Integer pageCount; | |||
| /** | |||
| * 总计划数 | |||
| */ | |||
| @SerializedName(value = "total") | |||
| private Integer total; | |||
| /** | |||
| * 计划 | |||
| */ | |||
| @SerializedName(value = "data") | |||
| private List<PoiOrientedPlan> data; | |||
| } | |||
| @@ -0,0 +1,101 @@ | |||
| package com.iformall.douyin.web.bean; | |||
| import com.google.gson.annotations.SerializedName; | |||
| import lombok.Data; | |||
| import lombok.NoArgsConstructor; | |||
| import java.io.Serializable; | |||
| import java.util.List; | |||
| import java.util.Map; | |||
| /** | |||
| * | |||
| * | |||
| * @author thinsstar | |||
| */ | |||
| @Data | |||
| @NoArgsConstructor | |||
| public class PoiOrientedPlanTalentDetail implements Serializable { | |||
| private static final long serialVersionUID = -1L; | |||
| /** | |||
| * 数据产出日期 | |||
| */ | |||
| @SerializedName(value = "date") | |||
| private String date; | |||
| /** | |||
| * 达人带货数据,以达人抖音号为key,带货数据为value | |||
| */ | |||
| @SerializedName(value = "data") | |||
| private Map<String,PlanGMVDatail> data; | |||
| @Data | |||
| @NoArgsConstructor | |||
| public static class PlanGMVDatail implements Serializable { | |||
| private static final long serialVersionUID = 1L; | |||
| /** | |||
| * 达人所有短视频&直播间的总带货GMV | |||
| */ | |||
| @SerializedName(value = "gmv") | |||
| private Integer gmv; | |||
| /** | |||
| * 达人所有短视频&直播间的总播放量&观看量 | |||
| */ | |||
| @SerializedName(value = "play_cnt") | |||
| private Integer playCnt; | |||
| /** | |||
| * | |||
| * 达人所有短视频&直播间的总带货佣金 | |||
| */ | |||
| @SerializedName(value = "talent_commission") | |||
| private Integer talentCommission; | |||
| /** | |||
| * 达人所有短视频&直播间的已核销GMV | |||
| */ | |||
| @SerializedName(value = "used_gmv") | |||
| private Integer usedGmv; | |||
| /** | |||
| * 每个短视频/直播间的带货数据列表 | |||
| */ | |||
| @SerializedName(value = "media_sell_info") | |||
| private List<MediaSellInfo> mediaSellInfo; | |||
| } | |||
| @Data | |||
| @NoArgsConstructor | |||
| public static class MediaSellInfo implements Serializable { | |||
| private static final long serialVersionUID = 1L; | |||
| /** | |||
| * 该直播间/短视频的唯一标识 | |||
| */ | |||
| @SerializedName(value = "content_open_id") | |||
| private String contentOpenId; | |||
| /** | |||
| * 达人该直播间/短视频的带货GMV | |||
| */ | |||
| @SerializedName(value = "gmv") | |||
| private Integer gmv; | |||
| /** | |||
| * 达人该直播间/短视频的观看人数/播放量 | |||
| */ | |||
| @SerializedName(value = "play_cnt") | |||
| private Integer playCnt; | |||
| /** | |||
| * | |||
| * 达人该直播间/短视频的带货佣金 | |||
| */ | |||
| @SerializedName(value = "talent_commission") | |||
| private Integer talentCommission; | |||
| /** | |||
| * 达人该直播间/短视频的已核销GMV | |||
| */ | |||
| @SerializedName(value = "used_gmv") | |||
| private Integer usedGmv; | |||
| } | |||
| } | |||
| @@ -1,5 +1,8 @@ | |||
| package com.iformall.enums; | |||
| import com.iformall.common.ErrorCode; | |||
| import com.iformall.exception.MallinkException; | |||
| /** | |||
| * app平台 | |||
| * @author alascor | |||
| @@ -35,4 +38,15 @@ public enum EnumAppPlat { | |||
| } | |||
| return null; | |||
| } | |||
| public static EnumPayWay getPayWay(EnumAppPlat plat){ | |||
| if(WX.equals(plat)){ | |||
| return EnumPayWay.PAY_WAY_WECHAT; | |||
| }else if(ALI.equals(plat)){ | |||
| return EnumPayWay.PAY_WAY_ALIPAY; | |||
| }else if(TOUTIAO.equals(plat)){ | |||
| return EnumPayWay.PAY_WAY_TT; | |||
| } | |||
| throw new MallinkException(ErrorCode.SYS_PARAMETER_ERROR.getCode(), "未找到对应支付"); | |||
| } | |||
| } | |||
| @@ -0,0 +1,48 @@ | |||
| package com.iformall.enums; | |||
| /** | |||
| * . | |||
| */ | |||
| public enum EnumBusinessCircleAuthorizeState { | |||
| //UNAUTHORIZED:未授权 | |||
| //AUTHORIZED:已授权 | |||
| //DEAUTHORIZED:已取消授权 | |||
| UNAUTHORIZED(0, "UNAUTHORIZED"), | |||
| AUTHORIZED(1, "AUTHORIZED"), | |||
| DEAUTHORIZED(2, "DEAUTHORIZED"), | |||
| ; | |||
| public static EnumBusinessCircleAuthorizeState getEnum(Integer code) { | |||
| for (EnumBusinessCircleAuthorizeState value : values()) { | |||
| if (value.getCode().equals(code)) { | |||
| return value; | |||
| } | |||
| } | |||
| return null; | |||
| } | |||
| public static EnumBusinessCircleAuthorizeState getEnum(String message) { | |||
| for (EnumBusinessCircleAuthorizeState value : values()) { | |||
| if (value.getMessage().equals(message)) { | |||
| return value; | |||
| } | |||
| } | |||
| return null; | |||
| } | |||
| private Integer code; | |||
| private String message; | |||
| EnumBusinessCircleAuthorizeState(Integer code, String message) { | |||
| this.code = code; | |||
| this.message = message; | |||
| } | |||
| public Integer getCode() { | |||
| return code; | |||
| } | |||
| public String getMessage() { | |||
| return message; | |||
| } | |||
| } | |||
| @@ -0,0 +1,37 @@ | |||
| package com.iformall.enums; | |||
| /** | |||
| * Created by Stormeye on 2018/08/09. | |||
| */ | |||
| public enum EnumBusinessType { | |||
| BUSINESS_0(0, "暂未开通"), | |||
| BUSINESS_1(1, "1.0"), | |||
| BUSINESS_2(2, "2.0"), | |||
| BUSINESS_3(3, "3.0"); | |||
| public static EnumBusinessType getEnum(Integer code) { | |||
| for (EnumBusinessType value : values()) { | |||
| if (value.getCode().equals(code)) { | |||
| return value; | |||
| } | |||
| } | |||
| return null; | |||
| } | |||
| private Integer code; | |||
| private String message; | |||
| EnumBusinessType(Integer code, String message) { | |||
| this.code = code; | |||
| this.message = message; | |||
| } | |||
| public Integer getCode() { | |||
| return code; | |||
| } | |||
| public String getMessage() { | |||
| return message; | |||
| } | |||
| } | |||
| @@ -1,5 +1,8 @@ | |||
| package com.iformall.enums; | |||
| import com.iformall.common.ErrorCode; | |||
| import com.iformall.exception.MallinkException; | |||
| import java.util.ArrayList; | |||
| import java.util.List; | |||
| @@ -12,13 +15,13 @@ public enum EnumCouponType { | |||
| // 100.消费卡 | |||
| COUPON_MANJIAN(1, "满减券"), | |||
| COUPON_DAIJIN(2, "代金券"), | |||
| COUPON_TUANGOU(3, "团购券"),//没用 | |||
| // COUPON_TUANGOU(3, "团购券"),//弃用 | |||
| COUPON_LIPIN(4, "礼品券"), | |||
| COUPON_TINGCHE(5, "停车券"), | |||
| COUPON_MULTIMCH(6, "通用券"), | |||
| COUPON_DOUYIN(66, "抖音券"), | |||
| COUPON_PRESS(8, "砍价券"), | |||
| COUPON_GROUP(9, "团购券"), | |||
| COUPON_GROUP(9, "拼团券"), | |||
| COUPON_PREORDER(10, "预购商品"), | |||
| COUPON_DISTRIBUTION(11, "可配送商品"), | |||
| COUPON_GIFT(12, "券礼包"), | |||
| @@ -64,6 +67,10 @@ public enum EnumCouponType { | |||
| return message; | |||
| } | |||
| /** | |||
| * 抖音平台的券 | |||
| * @return | |||
| */ | |||
| public static List<Integer> getDouYinType(){ | |||
| List<Integer> typeList = new ArrayList<>(); | |||
| typeList.add(COUPON_DOUYIN.getCode()); | |||
| @@ -71,4 +78,45 @@ public enum EnumCouponType { | |||
| return typeList; | |||
| } | |||
| /** | |||
| * 微信平台的券 | |||
| */ | |||
| public static List<Integer> getWeiXinType(){ | |||
| List<Integer> typeList = new ArrayList<>(); | |||
| typeList.add(COUPON_MANJIAN.getCode()); | |||
| typeList.add(COUPON_DAIJIN.getCode()); | |||
| // typeList.add(COUPON_TUANGOU.getCode()); | |||
| typeList.add(COUPON_LIPIN.getCode()); | |||
| typeList.add(COUPON_TINGCHE.getCode()); | |||
| typeList.add(COUPON_MULTIMCH.getCode()); | |||
| typeList.add(COUPON_PRESS.getCode()); | |||
| typeList.add(COUPON_GROUP.getCode()); | |||
| typeList.add(COUPON_PREORDER.getCode()); | |||
| typeList.add(COUPON_DISTRIBUTION.getCode()); | |||
| typeList.add(COUPON_GIFT.getCode()); | |||
| typeList.add(COUPON_CREDIT.getCode()); | |||
| typeList.add(COUPON_CREDIT_PARK.getCode()); | |||
| typeList.add(CARD_MULTIMCH.getCode()); | |||
| return typeList; | |||
| } | |||
| /** | |||
| * 有价 并且永不分账的券类型 | |||
| */ | |||
| public static List<Integer> getPlatType(){ | |||
| List<Integer> typeList = new ArrayList<>(); | |||
| typeList.add(COUPON_GIFT.getCode()); | |||
| typeList.add(CARD_MULTIMCH.getCode()); | |||
| return typeList; | |||
| } | |||
| public static EnumAppPlat getAppPlat(Integer couponType){ | |||
| if(getWeiXinType().contains(couponType)){ | |||
| return EnumAppPlat.WX; | |||
| }else if(getDouYinType().contains(couponType)){ | |||
| return EnumAppPlat.TOUTIAO; | |||
| } | |||
| throw new MallinkException(ErrorCode.SYS_PARAMETER_ERROR.getCode(), "券类型错误,未找到对应平台"); | |||
| } | |||
| } | |||
| @@ -7,9 +7,9 @@ public enum EnumCpsPlanStatus { | |||
| // | |||
| ING(1, "进行中/在线"), | |||
| SUSPEND(2, "暂停/下线"), | |||
| OFF(3, "关闭"), | |||
| ING(1, "进行中"), | |||
| SUSPEND(2, "暂停中/已完成"), | |||
| OFF(3, "已关闭"), | |||
| ; | |||
| public static EnumCpsPlanStatus getEnum(Integer code) { | |||
| @@ -0,0 +1,48 @@ | |||
| package com.iformall.enums; | |||
| /** | |||
| * . | |||
| */ | |||
| public enum EnumMemberCardActivateScene { | |||
| //NEW_ACTIVATE 新开卡激活 | |||
| //RECOVER 删卡后重新领取激活 | |||
| NEW_ACTIVATE(0, "NEW_ACTIVATE"), | |||
| RECOVER(1, "RECOVER") | |||
| ; | |||
| public static EnumMemberCardActivateScene getEnum(Integer code) { | |||
| for (EnumMemberCardActivateScene value : values()) { | |||
| if (value.getCode().equals(code)) { | |||
| return value; | |||
| } | |||
| } | |||
| return null; | |||
| } | |||
| public static EnumMemberCardActivateScene getEnum(String message) { | |||
| for (EnumMemberCardActivateScene value : values()) { | |||
| if (value.getMessage().equals(message)) { | |||
| return value; | |||
| } | |||
| } | |||
| return null; | |||
| } | |||
| private Integer code; | |||
| private String message; | |||
| EnumMemberCardActivateScene(Integer code, String message) { | |||
| this.code = code; | |||
| this.message = message; | |||
| } | |||
| public Integer getCode() { | |||
| return code; | |||
| } | |||
| public String getMessage() { | |||
| return message; | |||
| } | |||
| } | |||
| @@ -0,0 +1,54 @@ | |||
| package com.iformall.enums; | |||
| /** | |||
| * . | |||
| */ | |||
| public enum EnumMemberCardStatus { | |||
| //NOT_ACTIVATE:未激活 | |||
| //EFFECTIVE:生效中 | |||
| //EXPIRE:已过期 | |||
| //UNAVAILABLE:已失效 | |||
| //DELETE:已删除 | |||
| //IMPORTED:已导入 | |||
| NOT_ACTIVATE(0, "NOT_ACTIVATE"), | |||
| EFFECTIVE(1, "EFFECTIVE"), | |||
| EXPIRE(2, "EFFECTIVE"), | |||
| UNAVAILABLE(3, "EFFECTIVE"), | |||
| DELETE(4, "EFFECTIVE"), | |||
| IMPORTED(5, "EFFECTIVE"), | |||
| ; | |||
| public static EnumMemberCardStatus getEnum(Integer code) { | |||
| for (EnumMemberCardStatus value : values()) { | |||
| if (value.getCode().equals(code)) { | |||
| return value; | |||
| } | |||
| } | |||
| return null; | |||
| } | |||
| public static EnumMemberCardStatus getEnum(String message) { | |||
| for (EnumMemberCardStatus value : values()) { | |||
| if (value.getMessage().equals(message)) { | |||
| return value; | |||
| } | |||
| } | |||
| return null; | |||
| } | |||
| private Integer code; | |||
| private String message; | |||
| EnumMemberCardStatus(Integer code, String message) { | |||
| this.code = code; | |||
| this.message = message; | |||
| } | |||
| public Integer getCode() { | |||
| return code; | |||
| } | |||
| public String getMessage() { | |||
| return message; | |||
| } | |||
| } | |||
| @@ -13,6 +13,13 @@ public enum EnumMsgRecordType { | |||
| SYSTEM(6, "系统通知"), | |||
| SMART_APP_UNIFORM(7, "小程序统一消息"), | |||
| WEBSOCKET_APP(8, "小程序websocket"), | |||
| SYNC_MEMBER_CARD(10,"微信商圈同步会员"), | |||
| AFTER_ADD_CREDIT(11,"积分变更后"), | |||
| AFTER_ADD_SCORE(12,"成长值变更后"), | |||
| AFTER_CAR_IN_OR_OUT(13,"车辆入场,出场后"), | |||
| AFTER_BUSINESS_CREDIT(14,"商圈积分后"), | |||
| INSIDE_ORDER_SUCCESS(100, "下订单成功"), | |||
| INSIDE_COUPON_VERIFY(101, "券核销"), | |||
| INSIDE_C_LOGIN(102, "C端用户登录"),//内部消息,加积分等 | |||
| @@ -10,7 +10,7 @@ public enum EnumOrderType { | |||
| COUPON(0,"券"), | |||
| MICROPAY(1,"B收款码支付"), | |||
| NATIVEPAY(2,"C扫码支付"), | |||
| PREPAIDCARD(3, "储值卡"), | |||
| PREPAIDCARD(3, "储值卡支付"), | |||
| CREDIT(4,"积分支付"), | |||
| POSPAY(10, "POS支付") | |||
| ; | |||
| @@ -10,7 +10,7 @@ import java.util.List; | |||
| public interface TtPoiTakeRateMapper extends CommonMapper<TtPoiTakeRate, Long> { | |||
| TtPoiTakeRate selectByCoupon(@Param("tenantId")String tenantId,@Param("couponId")Long couponId, | |||
| @Param("type") Integer type,@Param("douyinId")String douyinId); | |||
| @Param("type") Integer type); | |||
| List<TtPoiTakeRate> findList(TtPoiTakeRate takeRate); | |||
| @@ -40,9 +40,13 @@ public interface WxCUserMapper extends CommonMapper<WxCUser, Long> { | |||
| // void updateMsgCountDown(@Param("tenantId")String tenantId, @Param("openId")String openId); | |||
| List<String> findOpenIdList(@Param("userId")Long userId, @Param("tenantId")String tenantId); | |||
| String findOpenId(@Param("userId")Long userId, @Param("tenantId")String tenantId); | |||
| Long findCuserId(@Param("userId")Long userId, @Param("tenantId")String tenantId); | |||
| List<String> findTokenList(@Param("id")Long id,@Param("userId")Long userId, @Param("tenantId")String tenantId); | |||
| List<UserStructureVo> findCountData(WxCUserBasicInfoDto dto); | |||
| void updateAuthorizeStateByOpenId(WxCUser updCuser); | |||
| } | |||
| @@ -39,7 +39,7 @@ public interface WxCouponOrderMapper extends CommonMapper<WxCouponOrder, Long> { | |||
| int findProductCount(WxCouponOrder wxCouponOrder); | |||
| List<Map<String, Object>> getCouponCount(WxCouponOrder wxCouponOrder); | |||
| //统一额度统计接口 | |||
| int queryPriceTotal(WxCouponOrder wxCouponOrder); | |||
| Integer queryPriceTotal(WxCouponOrder wxCouponOrder); | |||
| List<WxCouponOrder> findCarListOfCUser(WxCouponOrder wxCouponOrder); | |||
| @@ -12,7 +12,7 @@ import java.util.List; | |||
| public interface WxCreditHistoryMapper extends CommonMapper<WxCreditHistory, Long>{ | |||
| WxCreditHistory selectById(@Param("id")Long id,@Param("tenantId")String tenantId); | |||
| WxCreditHistory selectById(@Param("id")Long id,@Param("tenantId")String finalTenantId); | |||
| List<WxCreditHistory> findList(WxCreditHistory wxCreditHistory); | |||
| @@ -51,4 +51,6 @@ public interface WxCreditHistoryMapper extends CommonMapper<WxCreditHistory, Lon | |||
| List<WxCreditHistory> findAddList(WxCreditHistory chaddq); | |||
| List<WxCreditHistory> findLesList(WxCreditHistory chlesq); | |||
| List<WxCreditHistory> getIsMemberCarAndClearCredit(WxCreditHistory record); | |||
| } | |||
| @@ -0,0 +1,19 @@ | |||
| package com.iformall.mapper; | |||
| import com.iformall.common.CommonMapper; | |||
| import com.iformall.domain.po.WxMemberCard; | |||
| import java.util.List; | |||
| public interface WxMemberCardMapper extends CommonMapper<WxMemberCard, Long> { | |||
| List<WxMemberCard> findList(WxMemberCard record); | |||
| int deleteByCode(WxMemberCard record); | |||
| Long getIdByCode(WxMemberCard record); | |||
| int updateByOpenId(WxMemberCard record); | |||
| WxMemberCard getByCode(WxMemberCard record); | |||
| } | |||
| @@ -5,6 +5,17 @@ public class WxPayConstant { | |||
| public static final String NOTICE_EVENT_TYPE = "MALL_TRANSACTION.SUCCESS"; | |||
| public static final String REFUND_EVENT_TYPE = "MALL_REFUND.SUCCESS"; | |||
| //微信会员卡 | |||
| public static final String MEMBER_CARD_ACTIVATE = "MEMBER_CARD_ACTIVATE";//激活会员卡 | |||
| public static final String USER_VIEW_MEMBERCARD = "USER_VIEW_MEMBERCARD";//用户查看会员卡详情 | |||
| public static final String USER_DELETE_MEMBERCARD = "USER_DELETE_MEMBERCARD";//用户删除会员卡 | |||
| public static final String USER_MODIFY_INFORMATION = "USER_MODIFY_INFORMATION";//用户修改个人信息 | |||
| //微信商圈授权 | |||
| public static final String REGISTERED_MODE = "REGISTERED_MODE";//会员开卡(进卡包) + 未授权会员积分服务 | |||
| public static final String REGISTERED_AND_AUTHORIZATION_MODE = "REGISTERED_AND_AUTHORIZATION_MODE";//会员开卡(进卡包)+授权会员积分服务 | |||
| public final static String REQ_KEY = "reqKey"; | |||
| public final static String RES_KEY = "resKey"; | |||
| @@ -167,4 +178,7 @@ public class WxPayConstant { | |||
| public final static String NEU_ORDER_PAY = "0"; // 有效, 优惠券从预核销处理为核销, 卡从预支付->支付 | |||
| public final static String NEU_ORDER_REFUND = "1"; // 取消 | |||
| public final static String CAR_IN = "IN"; // 入场,用户开车进入商圈 | |||
| public final static String CAR_OUT = "OUT"; // 离场,用户开车离开商圈 | |||
| } | |||
| @@ -30,21 +30,28 @@ public interface TtCouponGoodsService { | |||
| ResultData productFreeAudit(TenantEntity tenantInfo, Long id); | |||
| //cps 佣金 | |||
| PageInfo<TtPoiTakeRate> takeRateListAsPage(TtPoiTakeRate record, Integer pageNum, Integer pageSize); | |||
| TtPoiTakeRate getTakeRateById(TenantEntity tenantInfo, Long id); | |||
| //根据商品id查询线上通用佣金情况 | |||
| ResultData poiPlanList(TenantEntity tenantInfo,Long couponId, Integer pageNum, Integer pageSize); | |||
| //根据商品id查询线上定向佣金情况 | |||
| ResultData poiOrientedPlanList(TenantEntity tenantInfo,Long couponId, Integer pageNum, Integer pageSize); | |||
| ResultData poiPlanSave(TenantEntity tenantInfo, Long couponId, Long planId, Integer contentType, Integer commissionRate); | |||
| ResultData poiPlanSave(TtPoiTakeRate record); | |||
| ResultData poiPlanUpdateStatus(TenantEntity tenantInfo, Long planId, Integer status); | |||
| ResultData saveOrientedPlan(TtPoiTakeRate record); | |||
| ResultData poiTakeRate(TenantEntity tenantInfo, Long couponId, String douyinId, Integer takeRate, Integer status); | |||
| ResultData poiPlanUpdateStatus(TtPoiTakeRate record); | |||
| PageInfo<TtPoiTakeRate> takeRateListAsPage(TtPoiTakeRate record, Integer pageNum, Integer pageSize); | |||
| ResultData poiOrientedPlanUpdateStatus(TtPoiTakeRate record); | |||
| ResultData setUpAll(TenantEntity tenantInfo, Long couponId, Integer mallRate); | |||
| TtPoiTakeRate selectByCoupon(TenantEntity tenantInfo, Long couponId, Integer planType, String douyinId); | |||
| TtPoiTakeRate selectByCoupon(TenantEntity tenantInfo, Long couponId, Integer planType); | |||
| ResultData getAll(TenantEntity tenantInfo, Long couponId); | |||
| @@ -51,14 +51,42 @@ public interface WxBusinessCircleOrderService { | |||
| */ | |||
| void updatePoints(WxBusinessCircleOrder record); | |||
| /** | |||
| * 同步积分状态 | |||
| * @param record | |||
| */ | |||
| void notifyPoints(WxBusinessCircleOrder record); | |||
| /** | |||
| * 积分同步状态修改 | |||
| */ | |||
| void updateIsPointsNotify(WxBusinessCircleOrder record); | |||
| void sendsyncNotifyPointsMsg(TenantEntity tenantEntity, Long businessCircleOrderId); | |||
| void exportData(WxBusinessCircleOrder circleOrder, HttpServletRequest request, HttpServletResponse response); | |||
| Integer sumCirclePayment(BusinessCircleBase circleOrder); | |||
| Integer sumCircleRefundAmount(BusinessCircleBase circleOrder); | |||
| /** | |||
| * 同步授权快速积分 | |||
| */ | |||
| ResultData syncauthorizeState(TenantEntity tenantEntity,String openid); | |||
| /** | |||
| * 查询待积分状态 | |||
| */ | |||
| ResultData getPointsCommitStatus(TenantEntity tenantEntity,String openId); | |||
| /** | |||
| * 商圈同步停车状态 | |||
| * state | |||
| * IN:入场,用户开车进入商圈 | |||
| * OUT:离场,用户开车离开商圈 | |||
| */ | |||
| ResultData syncParkings(TenantEntity tenantEntity,String openId,String plate_number,String state,Date time); | |||
| void sendSyncParkingsMsg(TenantEntity tenantEntity,Long carCmdLogId); | |||
| } | |||
| @@ -169,7 +169,7 @@ public interface WxCUserBasicInfoService { | |||
| void cuserOldToNew(Long oldCuserId, Long newCuserId,TenantEntity tenantinfo); | |||
| WxCUserBasicInfo registerByPhone(TenantEntity tenantEntity, String phone, String nickName, Integer sex, String avatarUrl); | |||
| WxCUserBasicInfo registerByPhone(TenantEntity tenantEntity, String phone, String nickName,String name, Integer sex, String avatarUrl); | |||
| int addCredit(Long userId, TenantEntity tenantInfo, EnumScoreType wechatPhone); | |||
| @@ -136,4 +136,6 @@ public interface WxCUserService { | |||
| void delForUserIdOnly(Long id, Long userId, String tenantId); | |||
| void updateMsgCount(WxCUser user); | |||
| void updateAuthorizeStateByOpenId(WxCUser updCuser); | |||
| } | |||
| @@ -1,16 +0,0 @@ | |||
| package com.iformall.service; | |||
| import com.iformall.domain.po.WxBusinessCircleOrder; | |||
| import org.springframework.scheduling.annotation.Async; | |||
| public interface WxCallBackService { | |||
| /** | |||
| * | |||
| * @param record | |||
| */ | |||
| @Async | |||
| void notifyPoints(WxBusinessCircleOrder record); | |||
| } | |||
| @@ -10,6 +10,7 @@ import com.iformall.common.ResultData; | |||
| import com.iformall.domain.po.TtCouponChannelPoi; | |||
| import com.iformall.domain.po.WxAppinfo; | |||
| import com.iformall.domain.po.WxCoupon; | |||
| import com.iformall.domain.po.WxMerchant; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import com.iformall.domain.vo.TtCouponVo; | |||
| import com.iformall.domain.vo.WxCouponCVo; | |||
| @@ -267,6 +268,7 @@ public interface WxCouponService { | |||
| boolean validCouponDate(WxCoupon wxCoupon); | |||
| ResultData validGiftCouponDate(WxCoupon wxCoupon); | |||
| /** | |||
| * 获取券商户map | |||
| @@ -278,4 +280,11 @@ public interface WxCouponService { | |||
| List<WxMerchantVo> getCouponMerchantList(TenantEntity tenantInfo, Long couponId); | |||
| /** | |||
| * 作废卷 | |||
| * @param tenantInfo | |||
| * @param couponId | |||
| * @return | |||
| */ | |||
| ResultData disable(TenantEntity tenantInfo, Long couponId); | |||
| } | |||
| @@ -40,7 +40,7 @@ public interface WxCreditHistoryService { | |||
| * @param id | |||
| * @return | |||
| */ | |||
| WxCreditHistory getById(Long id,String tenantId); | |||
| WxCreditHistory getById(Long id,String finalTenantId); | |||
| /** | |||
| * 添加积分时,需要校验用户以及手机号是否存在 | |||
| @@ -76,6 +76,8 @@ public interface WxCreditHistoryService { | |||
| void clearCreditByYear(WxCreditHistory wxCreditHistory); | |||
| void syncClearCredit(TenantEntity tenantInfo); | |||
| void exportData(HttpServletRequest request, HttpServletResponse response, WxCreditHistory wxCreditHistory); | |||
| ResultData getCreditSummary(WxCreditHistory wxCreditHistory); | |||
| @@ -89,4 +91,5 @@ public interface WxCreditHistoryService { | |||
| long getIncrementCreditAmount(WxCreditHistory wxCreditHistory); | |||
| PageInfo<WxCreditHistoryVo> findListMorePage(WxCreditHistory wxCreditHistory,Integer pageIndex, Integer pageSize); | |||
| } | |||
| @@ -0,0 +1,50 @@ | |||
| package com.iformall.service; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.domain.po.WxMemberCard; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| public interface WxMemberCardService { | |||
| /** | |||
| * 根据实体查询分页列表 | |||
| * | |||
| * @param record | |||
| * @param pageIndex | |||
| * @param pageSize | |||
| * @return | |||
| */ | |||
| PageInfo<WxMemberCard> listAsPage(WxMemberCard record, Integer pageIndex, Integer pageSize); | |||
| ResultData saveorupdate(WxMemberCard record); | |||
| ResultData saveorupdateByCode(WxMemberCard record); | |||
| ResultData delUserCardStatusByCode(WxMemberCard record); | |||
| /** | |||
| * 同步会员卡卡信息 | |||
| */ | |||
| ResultData syncMemberCard(TenantEntity tenantEntity,String card_id,String code); | |||
| void sendSyncMemberCardMsg(TenantEntity tenantEntity,String card_id,String code); | |||
| /** | |||
| * 同步会员卡等级 | |||
| * need_inform_level 是否发送等级变更通知 | |||
| */ | |||
| ResultData syncMemberCardLevel(TenantEntity tenantEntity,String card_id,String code,String markid, | |||
| String level,Boolean need_inform_level); | |||
| void sendsyncMemberCardLevelMsg(TenantEntity tenantEntity,Long baseUserId,Long scoreHistoryId); | |||
| /** | |||
| * 更新会员卡积分 | |||
| */ | |||
| ResultData syncMemberCardBonus(TenantEntity tenantEntity,String card_id,String code,String markid, | |||
| int before_bonus_value,int bonus_value,Boolean need_inform_bonus); | |||
| void sendsyncMemberCardBonusMsg(TenantEntity tenantEntity,Long cuserId,Long baseUserId,Long creditHistoryId); | |||
| } | |||
| @@ -250,10 +250,6 @@ public interface WxOrderService { | |||
| ResultData composeSaveOrder(boolean allowUnPayOrder,EnumComposeOrder composeOrderType,List<OrderComposeSaveDto> composeOrderSaveDto,Long cUserId,EnumPayWay payWay, | |||
| TenantEntity tenantEntity,EnumPayVersion payVersion); | |||
| //平台推送订单,如抖音支付2.0 | |||
| ResultData platPushSaveOrder(boolean allowUnPayOrder,EnumComposeOrder composeOrderType,String allExtParam,List<PlatPushOrderSaveDto> platPushOrderList,Long cUserId, | |||
| EnumPayWay payWay,EnumPayVersion payVersion,TenantEntity tenantEntity); | |||
| void sendInsideOrderPushMsg(TenantEntity tenantEntity,Long composeOrderId); | |||
| @@ -2,6 +2,7 @@ package com.iformall.service; | |||
| import com.github.binarywang.wxpay.service.WxPayService; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.domain.po.WxAppinfo; | |||
| import com.iformall.domain.po.WxPayAccount; | |||
| import com.iformall.domain.po.WxProjectConfig; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| @@ -26,6 +27,7 @@ public interface WxPayAccountService { | |||
| * @return | |||
| */ | |||
| WxPayAccount getById(Long id); | |||
| WxPayAccount getByIdFromRedis(Long id); | |||
| /** | |||
| * 保存或更新实体 | |||
| @@ -54,12 +54,12 @@ public interface WxProfitSharingReceiverService { | |||
| void sendMsg(String phone, String account, String merchant, String time, Integer modelType, TenantEntity tenantEntity); | |||
| ResultData updateTtReceiver(WxMerchant merchant, String appId, String payAccountKey); | |||
| ResultData updateTtReceiver(WxMerchant merchant); | |||
| ResultData getTtReceiverImprotURL(WxMerchant merchant, String appId, String payAccountKey); | |||
| ResultData getTtReceiverImprotURL(WxMerchant merchant); | |||
| ResultData getTtReceiverBalanceURL(WxMerchant merchant, String appId, String payAccountKey); | |||
| ResultData getTtReceiverBalanceURL(WxMerchant merchant); | |||
| ResultData updateTtReceiverIsUse(WxMerchant merchant, String appId, String payAccountKey); | |||
| ResultData updateTtReceiverIsUse(WxMerchant merchant); | |||
| } | |||
| @@ -20,6 +20,7 @@ import org.springframework.data.redis.core.RedisTemplate; | |||
| import org.springframework.stereotype.Service; | |||
| import java.util.ArrayList; | |||
| import java.util.Arrays; | |||
| import java.util.List; | |||
| @@ -28,6 +29,10 @@ public class WxBankUtilServiceImpl implements WxBankUtilService { | |||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||
| private final List<String> bank17= Arrays.asList("工商银行","交通银行","招商银行","民生银行","中信银行","浦发银行","兴业银行","光大银行","广发银行","平安银行","北京银行","华夏银行","农业银行","建设银行","邮政储蓄银行","中国银行","宁波银行"); | |||
| private final String otherBank = "其他银行"; | |||
| @Autowired | |||
| WxPayAccountService wxPayAccountService; | |||
| @@ -55,6 +60,7 @@ public class WxBankUtilServiceImpl implements WxBankUtilService { | |||
| WxPayService wxPayService = wxPayAccountService.getWxPayService(tenantInfo.getTenantId()); | |||
| try { | |||
| BankingResult bankingResult = wxPayService.getBankService().personalBanking(offset,limit); | |||
| this.handlBankingResult(bankingResult.getData()); | |||
| return new ResultData(bankingResult.getData()); | |||
| } catch (WxPayException e) { | |||
| e.printStackTrace(); | |||
| @@ -70,6 +76,7 @@ public class WxBankUtilServiceImpl implements WxBankUtilService { | |||
| int offset = 0, limit = 200; | |||
| try { | |||
| BankingResult bankingResult = wxPayService.getBankService().personalBanking(offset,limit); | |||
| this.handlBankingResult(bankingResult.getData()); | |||
| bankInfoList.addAll(bankingResult.getData()); | |||
| String key = prev+offset+"_"+limit; | |||
| BankingResult cacheObject = RedisCacheUtils.getCacheObject(bankRedisTemplate, key, BankingResult.class); | |||
| @@ -88,6 +95,7 @@ public class WxBankUtilServiceImpl implements WxBankUtilService { | |||
| if(nextBankingResult == null){ | |||
| try{ | |||
| nextBankingResult = wxPayService.getBankService().personalBanking(offset,limit); | |||
| this.handlBankingResult(nextBankingResult.getData()); | |||
| if(nextBankingResult != null){ | |||
| RedisCacheUtils.cache(bankRedisTemplate,nextkey,nextBankingResult,0); | |||
| } | |||
| @@ -112,6 +120,7 @@ public class WxBankUtilServiceImpl implements WxBankUtilService { | |||
| WxPayService wxPayService = wxPayAccountService.getWxPayService(tenantInfo.getTenantId()); | |||
| try { | |||
| BankingResult bankingResult = wxPayService.getBankService().corporateBanking(offset,limit); | |||
| this.handlBankingResult(bankingResult.getData()); | |||
| return new ResultData(bankingResult.getData()); | |||
| } catch (WxPayException e) { | |||
| e.printStackTrace(); | |||
| @@ -127,6 +136,7 @@ public class WxBankUtilServiceImpl implements WxBankUtilService { | |||
| int offset = 0, limit = 200; | |||
| try { | |||
| BankingResult bankingResult = wxPayService.getBankService().corporateBanking(offset,limit); | |||
| this.handlBankingResult(bankingResult.getData()); | |||
| bankInfoList.addAll(bankingResult.getData()); | |||
| String key = prev+offset+"_"+limit; | |||
| BankingResult cacheObject = RedisCacheUtils.getCacheObject(bankRedisTemplate, key, BankingResult.class); | |||
| @@ -145,6 +155,7 @@ public class WxBankUtilServiceImpl implements WxBankUtilService { | |||
| if(nextBankingResult == null){ | |||
| try{ | |||
| nextBankingResult = wxPayService.getBankService().corporateBanking(offset,limit); | |||
| this.handlBankingResult(nextBankingResult.getData()); | |||
| if(nextBankingResult != null){ | |||
| RedisCacheUtils.cache(bankRedisTemplate,nextkey,nextBankingResult,0); | |||
| } | |||
| @@ -164,6 +175,24 @@ public class WxBankUtilServiceImpl implements WxBankUtilService { | |||
| return new ResultData(bankInfoList); | |||
| } | |||
| /** | |||
| * 处理银行数据 | |||
| * 开户银行,传参规则如下: | |||
| * 1、17家直连银行,请根据开户银行对照表直接填写银行名 ; | |||
| * 2、非17家直连银行,该参数请填写为“其他银行”。 | |||
| */ | |||
| private void handlBankingResult(List<BankInfo> list){ | |||
| if(list != null && !list.isEmpty()){ | |||
| for (BankInfo bank:list) { | |||
| if(!bank17.contains(bank.getBankAlias())){ | |||
| bank.setAccountBank(otherBank); | |||
| bank.setNeedBankBranch(true); | |||
| } | |||
| } | |||
| } | |||
| } | |||
| @Override | |||
| public ResultData areasProvinces(TenantEntity tenantInfo) { | |||
| WxPayService wxPayService = wxPayAccountService.getWxPayService(tenantInfo.getTenantId()); | |||
| @@ -149,7 +149,7 @@ public class AliBusinessCircleOrderServiceImpl implements AliBusinessCircleOrder | |||
| } | |||
| }else if(record.getCUserPhone() != null) { | |||
| WxCUserBasicInfo byPhone = wxCUserBasicInfoService.registerByPhone(record, record.getCUserPhone(), null, null, null); | |||
| WxCUserBasicInfo byPhone = wxCUserBasicInfoService.registerByPhone(record, record.getCUserPhone(), null,null, null, null); | |||
| if (byPhone != null) { | |||
| record.setCUserId(byPhone.getId()); | |||
| record.setCUserNickName(byPhone.getNickName()); | |||
| @@ -162,7 +162,7 @@ public class AliBusinessCircleOrderServiceImpl implements AliBusinessCircleOrder | |||
| AliPayCUser aliUser = aliPayCUserService.getByAliPayUserId(userQ); | |||
| if(aliUser != null){ | |||
| // WxCUserBasicInfo infoByPhone = wxCUserBasicInfoService.findInfoByPhone(aliUser, aliUser.getPhone()); | |||
| WxCUserBasicInfo infoByPhone = wxCUserBasicInfoService.registerByPhone(aliUser, aliUser.getPhone(),aliUser.getName(),null,null); | |||
| WxCUserBasicInfo infoByPhone = wxCUserBasicInfoService.registerByPhone(aliUser, aliUser.getPhone(),aliUser.getName(),null,null,null); | |||
| if(infoByPhone != null ){ | |||
| record.setCUserId(infoByPhone.getId()); | |||
| record.setCUserNickName(infoByPhone.getNickName()); | |||
| @@ -188,7 +188,7 @@ public class MarkingDataReportServiceImpl implements MarkingDataReportService { | |||
| //处理数据 | |||
| wxCouponActionLogService.updateCreateTimeMd(tenantEntity); | |||
| Map<String,Integer> sceneMap = wxCouponActionLogService.getSceneDataMap(tenantEntity,addDay(-30),addDay(1)); | |||
| Map<String,Integer> sceneMap = wxCouponActionLogService.getSceneDataMap(tenantEntity,addDay(-30),addDay(1));//2,3,4,5,7 | |||
| String startdate = DateUtils.getTimeBefore(30, new Date()); | |||
| String enddate = DateUtils.getTimeBefore(1,new Date()); | |||
| @@ -206,12 +206,15 @@ public class MarkingDataReportServiceImpl implements MarkingDataReportService { | |||
| Integer count4 = sceneMap.get(tj + "_" + EnumCouponSendSendType.B_MICROPAY.getCode()); | |||
| msdVo.setMicroPaySendCount(count4==null?0:count4); | |||
| Integer count5 = sceneMap.get(tj + "_" + EnumCouponSendSendType.C_ORDER.getCode()); | |||
| msdVo.setMicroPaySendCount(count5==null?0:count5); | |||
| msdVo.setOrderSendCount(count5==null?0:count5); | |||
| Integer count6 = sceneMap.get(tj + "_" + EnumCouponSendSendType.MERCHANT.getCode()); | |||
| msdVo.setMerchantSendCount(count6==null?0:count6); | |||
| msdVo.setTotal(msdVo.getParkSendCount() + | |||
| msdVo.getVerifySendCount() + | |||
| msdVo.getMicroPaySendCount() + | |||
| msdVo.getOrderSendCount()); | |||
| msdVo.getOrderSendCount() + | |||
| msdVo.getMerchantSendCount()); | |||
| tempDatalist.add(msdVo); | |||
| } | |||
| @@ -1,6 +1,7 @@ | |||
| package com.iformall.service.impl; | |||
| import com.alibaba.fastjson.JSON; | |||
| import com.alibaba.fastjson.JSONObject; | |||
| import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | |||
| import com.github.pagehelper.PageHelper; | |||
| import com.github.pagehelper.PageInfo; | |||
| @@ -11,11 +12,9 @@ import com.iformall.domain.po.*; | |||
| import com.iformall.domain.po.base.BaseEntity; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import com.iformall.domain.vo.*; | |||
| import com.iformall.douyin.web.api.TtWebPoiPlanService; | |||
| import com.iformall.douyin.web.api.TtWebService; | |||
| import com.iformall.douyin.web.bean.PoiPlan; | |||
| import com.iformall.douyin.web.bean.PoiPlanPage; | |||
| import com.iformall.douyin.web.bean.PoiTakeRate; | |||
| import com.iformall.douyin.web.bean.Product; | |||
| import com.iformall.douyin.web.bean.*; | |||
| import com.iformall.enums.*; | |||
| import com.iformall.exception.MallinkException; | |||
| import com.iformall.mapper.*; | |||
| @@ -202,6 +201,7 @@ public class TtCouponGoodsServiceImpl implements TtCouponGoodsService { | |||
| wxCouponChannel.setEndTime(coupon.getValidEndDate()); | |||
| wxCouponChannel.setStatus(EnumCouponChannelStatus.STATUS_BEFORE.getCode()); | |||
| wxCouponChannel.setCouponId(coupon.getId()); | |||
| wxCouponChannel.setMakeMerchantId(coupon.getMakeMerchantId()); | |||
| wxCouponChannel.setType(coupon.getType()); | |||
| wxCouponChannel.setTargetAd(EnumCouponChannelType.COUPON_CHANNEL_ID_DOUYIN_LIST.getCode()); | |||
| wxCouponChannel.setBusiness(coupon.getBusiness()); | |||
| @@ -250,12 +250,6 @@ public class TtCouponGoodsServiceImpl implements TtCouponGoodsService { | |||
| throw new Exception("未获取到抖音商品product_id"); | |||
| } | |||
| WxCouponChannel updCC = new WxCouponChannel(); | |||
| updCC.setId(wxCouponChannel.getId()); | |||
| updCC.updateTenantInfo(wxCouponChannel); | |||
| wxCouponChannel.setTtSpuId(productId); | |||
| wxCouponChannelMapper.updateById(wxCouponChannel); | |||
| syncCouponChannelPoi(coupon,wxCouponChannel.getId(),productId); | |||
| return new ResultData(); | |||
| @@ -435,7 +429,20 @@ public class TtCouponGoodsServiceImpl implements TtCouponGoodsService { | |||
| } | |||
| } | |||
| private void syncCouponChannelPoi(WxCoupon coupon,Long couponChannelId,String productId){ | |||
| WxCoupon updC = new WxCoupon(); | |||
| updC.setId(coupon.getId()); | |||
| updC.updateTenantInfo(coupon); | |||
| updC.setGoodsId(productId); | |||
| wxCouponMapper.updateById(updC); | |||
| WxCouponChannel updCC = new WxCouponChannel(); | |||
| updCC.setId(couponChannelId); | |||
| updCC.updateTenantInfo(coupon); | |||
| updCC.setTtSpuId(productId); | |||
| wxCouponChannelMapper.updateById(updCC); | |||
| TtCouponChannelPoi ttCouponChannelPoi = ttCouponChannelPoiMapper.selectById(coupon.getTenantId(),coupon.getId()); | |||
| Date date = new Date(); | |||
| if(ttCouponChannelPoi != null){ | |||
| @@ -485,6 +492,24 @@ public class TtCouponGoodsServiceImpl implements TtCouponGoodsService { | |||
| } | |||
| @Override | |||
| public PageInfo<TtPoiTakeRate> takeRateListAsPage(TtPoiTakeRate record, Integer pageNum, Integer pageSize) { | |||
| return PageHelper.startPage(pageNum, pageSize).doSelectPageInfo(() -> ttPoiTakeRateMapper.findList(record)); | |||
| } | |||
| @Override | |||
| public TtPoiTakeRate getTakeRateById(TenantEntity tenantInfo, Long id) { | |||
| TtPoiTakeRate takeRate = ttPoiTakeRateMapper.selectById(id, tenantInfo.getTenantId()); | |||
| if(takeRate != null){ | |||
| WxCoupon coupon = wxCouponMapper.selectById(takeRate.getCouponId(), tenantInfo.getTenantId()); | |||
| takeRate.setCoupon(coupon); | |||
| } | |||
| return takeRate; | |||
| } | |||
| @Override | |||
| public ResultData poiPlanList(TenantEntity tenantInfo,Long couponId, Integer pageNum, Integer pageSize) { | |||
| TtCouponChannelPoi ttCouponChannelPoi = ttCouponChannelPoiMapper.selectById(tenantInfo.getTenantId(),couponId); | |||
| @@ -502,45 +527,60 @@ public class TtCouponGoodsServiceImpl implements TtCouponGoodsService { | |||
| } | |||
| @Override | |||
| public ResultData poiPlanSave(TenantEntity tenantInfo, Long couponId, Long planId, Integer contentType, Integer commissionRate) { | |||
| WxCoupon wxCoupon = wxCouponMapper.selectById(couponId, tenantInfo.getTenantId()); | |||
| public ResultData poiOrientedPlanList(TenantEntity tenantInfo,Long couponId, Integer pageNum, Integer pageSize) { | |||
| TtCouponChannelPoi ttCouponChannelPoi = ttCouponChannelPoiMapper.selectById(tenantInfo.getTenantId(),couponId); | |||
| if(ttCouponChannelPoi == null || !EnumSpuSyncStatus.sync_audit_pass.getCode().equals(ttCouponChannelPoi.getLastStatus())){ | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(),"该券未提交审核或审核未通过"); | |||
| } | |||
| try { | |||
| Long spu_id = Long.parseLong(ttCouponChannelPoi.getSpuId()); | |||
| PoiOrientedPlanPage poiOrientedPlanPage = ttMerchantPoiService.getTtWebService(tenantInfo).getPoiPlanService().poiOrientedPlanList(spu_id, pageNum, pageSize); | |||
| return new ResultData(poiOrientedPlanPage); | |||
| } catch (WxErrorException e) { | |||
| e.printStackTrace(); | |||
| return new ResultData(ErrorCode.SYS_SERVER_ERROR.getCode(),e.getMessage()); | |||
| } | |||
| } | |||
| @Override | |||
| public ResultData poiPlanSave(TtPoiTakeRate record) { | |||
| WxCoupon wxCoupon = wxCouponMapper.selectById(record.getCouponId(), record.getTenantId()); | |||
| if(wxCoupon == null){ | |||
| return new ResultData(ErrorCode.COUPON_IS_EMPTY.getCode(),"未找到该券"); | |||
| } | |||
| if(wxCoupon.getSalePrice() == 0 || wxCoupon.checkIsCard()){ | |||
| if(!EnumCouponType.COUPON_DOUYIN.getCode().equals(wxCoupon.getType())){ | |||
| return new ResultData(ErrorCode.COUPON_ORDER_TYPE_NOT_SUPPORTED); | |||
| } | |||
| TtCouponChannelPoi ttCouponChannelPoi = ttCouponChannelPoiMapper.selectById(tenantInfo.getTenantId(),couponId); | |||
| TtCouponChannelPoi ttCouponChannelPoi = ttCouponChannelPoiMapper.selectById(wxCoupon.getTenantId(),wxCoupon.getId()); | |||
| if(ttCouponChannelPoi == null || !EnumSpuSyncStatus.sync_audit_pass.getCode().equals(ttCouponChannelPoi.getLastStatus())){ | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(),"该券未提交审核或审核未通过"); | |||
| } | |||
| try { | |||
| int rateMin = getRateMin(); | |||
| if(commissionRate.intValue() < rateMin){ | |||
| if(record.getTakeRate() < rateMin){ | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(),"分佣率低于最小值("+rateMin+")"); | |||
| } | |||
| int rateMax = getRateMax(wxCoupon); | |||
| if(commissionRate.intValue() > rateMax){ | |||
| if(record.getTakeRate() > rateMax){ | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(),"分佣率超过最大值("+rateMax+")"); | |||
| } | |||
| Long spu_id = Long.parseLong(ttCouponChannelPoi.getSpuId()); | |||
| PoiPlan poiPlan = new PoiPlan(); | |||
| poiPlan.setPlanId(planId); | |||
| if(record.getId() != null){ | |||
| poiPlan.setPlanId(record.getId()); | |||
| } | |||
| poiPlan.setSpuId(spu_id); | |||
| poiPlan.setContentType(contentType); | |||
| poiPlan.setCommissionRate(commissionRate); | |||
| poiPlan.setContentType(record.getContentType()); | |||
| poiPlan.setCommissionRate(record.getTakeRate()); | |||
| Long returnPlanId = ttMerchantPoiService.getTtWebService(tenantInfo).getPoiPlanService().poiPlanSave(poiPlan); | |||
| Long returnPlanId = ttMerchantPoiService.getTtWebService(record).getPoiPlanService().poiPlanSave(poiPlan); | |||
| if(returnPlanId != null){ | |||
| TtPoiTakeRate ttPoiTakeRate = new TtPoiTakeRate(); | |||
| ttPoiTakeRate.setId(returnPlanId); | |||
| ttPoiTakeRate.updateTenantInfo(tenantInfo); | |||
| ttPoiTakeRate.setCouponId(couponId); | |||
| ttPoiTakeRate.setType(EnumCpsPlanType.COMMON.getCode()); | |||
| ttPoiTakeRate.setContentType(contentType); | |||
| ttPoiTakeRate.setTakeRate(commissionRate); | |||
| this.saveorupdate(ttPoiTakeRate); | |||
| if(record.getId() == null){ | |||
| record.setId(returnPlanId); | |||
| } | |||
| record.setType(EnumCpsPlanType.COMMON.getCode()); | |||
| this.saveorupdate(record); | |||
| return new ResultData(returnPlanId); | |||
| }else{ | |||
| return new ResultData(ErrorCode.SYS_SERVER_ERROR.getCode(),"未获取到计划ID"); | |||
| @@ -554,68 +594,151 @@ public class TtCouponGoodsServiceImpl implements TtCouponGoodsService { | |||
| } | |||
| @Override | |||
| public ResultData poiPlanUpdateStatus(TenantEntity tenantInfo, Long planId, Integer status) { | |||
| try { | |||
| boolean b = ttMerchantPoiService.getTtWebService(tenantInfo).getPoiPlanService().poiPlanUpdateStatus(planId, status); | |||
| if(b){ | |||
| TtPoiTakeRate ttPoiTakeRate = new TtPoiTakeRate(); | |||
| ttPoiTakeRate.setId(planId); | |||
| ttPoiTakeRate.updateTenantInfo(tenantInfo); | |||
| ttPoiTakeRate.setType(EnumCpsPlanType.COMMON.getCode()); | |||
| ttPoiTakeRate.setStatus(status); | |||
| this.saveorupdate(ttPoiTakeRate); | |||
| return new ResultData(); | |||
| }else{ | |||
| return new ResultData(ErrorCode.SYS_SERVER_ERROR.getCode(),"false"); | |||
| } | |||
| } catch (WxErrorException e) { | |||
| e.printStackTrace(); | |||
| return new ResultData(ErrorCode.SYS_SERVER_ERROR.getCode(),e.getMessage()); | |||
| } | |||
| } | |||
| @Override | |||
| public ResultData poiTakeRate(TenantEntity tenantInfo, Long couponId, String douyinId, Integer takeRate, Integer status) { | |||
| WxCoupon wxCoupon = wxCouponMapper.selectById(couponId, tenantInfo.getTenantId()); | |||
| public ResultData saveOrientedPlan(TtPoiTakeRate record) { | |||
| WxCoupon wxCoupon = wxCouponMapper.selectById(record.getCouponId(), record.getTenantId()); | |||
| if(wxCoupon == null){ | |||
| return new ResultData(ErrorCode.COUPON_IS_EMPTY.getCode(),"未找到该券"); | |||
| } | |||
| if(wxCoupon.getSalePrice() == 0 || wxCoupon.checkIsCard()){ | |||
| if(!EnumCouponType.COUPON_DOUYIN.getCode().equals(wxCoupon.getType())){ | |||
| return new ResultData(ErrorCode.COUPON_ORDER_TYPE_NOT_SUPPORTED); | |||
| } | |||
| TtCouponChannelPoi ttCouponChannelPoi = ttCouponChannelPoiMapper.selectById(tenantInfo.getTenantId(),couponId); | |||
| TtCouponChannelPoi ttCouponChannelPoi = ttCouponChannelPoiMapper.selectById(wxCoupon.getTenantId(),wxCoupon.getId()); | |||
| if(ttCouponChannelPoi == null || !EnumSpuSyncStatus.sync_audit_pass.getCode().equals(ttCouponChannelPoi.getLastStatus())){ | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(),"该券未提交审核或审核未通过"); | |||
| } | |||
| try { | |||
| int rateMin = getRateMin(); | |||
| if(takeRate.intValue() < rateMin){ | |||
| if(record.getTakeRate() < rateMin){ | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(),"分佣率低于最小值("+rateMin+")"); | |||
| } | |||
| int rateMax = getRateMax(wxCoupon); | |||
| if(takeRate.intValue() > rateMax){ | |||
| if(record.getTakeRate() > rateMax){ | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(),"分佣率超过最大值("+rateMax+")"); | |||
| } | |||
| Long spu_id = Long.parseLong(ttCouponChannelPoi.getSpuId()); | |||
| TtWebService ttWebService = ttMerchantPoiService.getTtWebService(record); | |||
| Long returnPlanId = null; | |||
| PoiOrientedPlan poiPlan = new PoiOrientedPlan(); | |||
| if(record.getId() != null){ | |||
| poiPlan.setPlanId(record.getId()); | |||
| this.poiOrientedPlanDeleteTalent(ttWebService,record); | |||
| }else{ | |||
| record.setDouyinId(JSON.toJSONString(record.getDouyinIdList())); | |||
| poiPlan.setPlanName(record.getName()); | |||
| } | |||
| poiPlan.setMerchantPhone(record.getMerchantPhone()); | |||
| if(record.getDouyinIdList() != null && !record.getDouyinIdList().isEmpty()){ | |||
| poiPlan.setDouyinIdList(record.getDouyinIdList()); | |||
| } | |||
| List<PoiOrientedPlan.ProductRate> productList = new ArrayList<>(); | |||
| PoiOrientedPlan.ProductRate product = new PoiOrientedPlan.ProductRate(); | |||
| product.setProductId(spu_id); | |||
| product.setCommissionRate(record.getTakeRate()); | |||
| productList.add(product); | |||
| poiPlan.setProductList(productList); | |||
| if(EnumCpsPlanContentType.LIVE.getCode().equals(record.getContentType())){ | |||
| returnPlanId = ttWebService.getPoiPlanService().poiOrientedPlanLiveSave(poiPlan); | |||
| }else if(EnumCpsPlanContentType.VIDEO.getCode().equals(record.getContentType())){ | |||
| poiPlan.setStartTime(record.getStartTime().getTime()/1000); | |||
| poiPlan.setEndTime(record.getEndTime().getTime()/1000); | |||
| if(poiPlan.getPlanId() == null){ | |||
| poiPlan.setCommissionDuration(record.getCommissionDuration()); | |||
| } | |||
| returnPlanId = ttWebService.getPoiPlanService().poiOrientedPlanLiveSave(poiPlan); | |||
| }else{ | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(),"带货场景错误"); | |||
| } | |||
| if(returnPlanId != null){ | |||
| if(record.getId() == null){ | |||
| record.setId(returnPlanId); | |||
| }else{ | |||
| record.setName(null); | |||
| record.setCommissionDuration(null); | |||
| } | |||
| record.setType(EnumCpsPlanType.DIRECTIONAL.getCode()); | |||
| this.saveorupdate(record); | |||
| return new ResultData(returnPlanId); | |||
| }else{ | |||
| return new ResultData(ErrorCode.SYS_SERVER_ERROR.getCode(),"未获取到计划ID"); | |||
| } | |||
| PoiTakeRate poiTakeRate = new PoiTakeRate(); | |||
| poiTakeRate.setSpuExtId(couponId.toString()); | |||
| poiTakeRate.setDouyinId(douyinId); | |||
| poiTakeRate.setTakeRate(takeRate); | |||
| poiTakeRate.setStatus(status); | |||
| String spu_id = ttMerchantPoiService.getTtWebService(tenantInfo).getPoiPlanService().poiTakeRate(poiTakeRate); | |||
| if(StringUtils.isNotBlank(spu_id) && spu_id.equals(ttCouponChannelPoi.getSpuId())){ | |||
| TtPoiTakeRate ttPoiTakeRate = new TtPoiTakeRate(); | |||
| ttPoiTakeRate.updateTenantInfo(tenantInfo); | |||
| ttPoiTakeRate.setCouponId(couponId); | |||
| ttPoiTakeRate.setType(EnumCpsPlanType.DIRECTIONAL.getCode()); | |||
| ttPoiTakeRate.setDouyinId(douyinId); | |||
| ttPoiTakeRate.setTakeRate(takeRate); | |||
| ttPoiTakeRate.setStatus(status); | |||
| this.saveorupdate(ttPoiTakeRate); | |||
| } catch (WxErrorException e) { | |||
| e.printStackTrace(); | |||
| return new ResultData(ErrorCode.SYS_SERVER_ERROR.getCode(),e.getMessage()); | |||
| } | |||
| } | |||
| /** | |||
| * 删除定向计划里的达人,并处理达人数据 | |||
| * 只能一个个删除,有可能删除失败 | |||
| * @param ttWebService | |||
| * @param takeRate | |||
| * @return | |||
| */ | |||
| private void poiOrientedPlanDeleteTalent(TtWebService ttWebService,TtPoiTakeRate takeRate){ | |||
| if(takeRate == null || takeRate.getId() == null | |||
| || takeRate.getDouyinIdList() == null || takeRate.getDouyinIdList().isEmpty()){ | |||
| throw new MallinkException(ErrorCode.SYS_PARAMETER_ERROR); | |||
| } | |||
| TtPoiTakeRate oldTakeRate = ttPoiTakeRateMapper.selectById(takeRate.getId(), takeRate.getTenantId()); | |||
| if(oldTakeRate == null || StringUtils.isBlank(oldTakeRate.getDouyinId())){ | |||
| throw new MallinkException(ErrorCode.SYS_PARAMETER_ERROR); | |||
| } | |||
| List<String> oldDouyinIdList = JSONObject.parseArray(oldTakeRate.getDouyinId(), String.class); | |||
| List<String> newDouyinIdList = takeRate.getDouyinIdList(); | |||
| List<String> addDouyinIdList = new ArrayList<>(); | |||
| for (String douyinId:newDouyinIdList) { | |||
| if(!oldDouyinIdList.contains(douyinId)){ | |||
| addDouyinIdList.add(douyinId); | |||
| } | |||
| } | |||
| List<String> delDouyinIdList = new ArrayList<>(); | |||
| for (String douyinId:oldDouyinIdList) { | |||
| if(!newDouyinIdList.contains(douyinId)){ | |||
| try { | |||
| boolean b = ttWebService.getPoiPlanService().poiOrientedPlanDeleteTalent(oldTakeRate.getId(), douyinId); | |||
| delDouyinIdList.add(douyinId); | |||
| } catch (WxErrorException e) { | |||
| e.printStackTrace(); | |||
| logger.error("定向计划删除达人失败"+oldTakeRate.getId()+"del--"+douyinId); | |||
| } | |||
| } | |||
| } | |||
| if(!delDouyinIdList.isEmpty()){ | |||
| oldDouyinIdList.removeAll(delDouyinIdList); | |||
| } | |||
| TtPoiTakeRate updTakeRate = new TtPoiTakeRate(); | |||
| updTakeRate.updateTenantInfo(oldTakeRate); | |||
| updTakeRate.setId(oldTakeRate.getId()); | |||
| updTakeRate.setDouyinId(JSON.toJSONString(oldDouyinIdList)); | |||
| ttPoiTakeRateMapper.updateById(updTakeRate); | |||
| if(!addDouyinIdList.isEmpty()){ | |||
| oldDouyinIdList.addAll(addDouyinIdList); | |||
| takeRate.setDouyinId(JSON.toJSONString(oldDouyinIdList)); | |||
| takeRate.setDouyinIdList(addDouyinIdList); | |||
| }else{ | |||
| takeRate.setDouyinIdList(null); | |||
| } | |||
| } | |||
| @Override | |||
| public ResultData poiPlanUpdateStatus(TtPoiTakeRate record) { | |||
| try { | |||
| boolean b = ttMerchantPoiService.getTtWebService(record).getPoiPlanService().poiPlanUpdateStatus(record.getId(), record.getStatus()); | |||
| if(b){ | |||
| TtPoiTakeRate updTakeRate = new TtPoiTakeRate(); | |||
| updTakeRate.setId(record.getId()); | |||
| updTakeRate.updateTenantInfo(record); | |||
| updTakeRate.setType(EnumCpsPlanType.COMMON.getCode()); | |||
| updTakeRate.setStatus(record.getStatus()); | |||
| updTakeRate.setUpdateDate(new Date()); | |||
| ttPoiTakeRateMapper.updateById(updTakeRate); | |||
| return new ResultData(); | |||
| }else{ | |||
| return new ResultData(ErrorCode.SYS_SERVER_ERROR.getCode(),"设置达人分佣错误"); | |||
| return new ResultData(ErrorCode.SYS_SERVER_ERROR.getCode(),"false"); | |||
| } | |||
| } catch (WxErrorException e) { | |||
| e.printStackTrace(); | |||
| @@ -624,8 +747,24 @@ public class TtCouponGoodsServiceImpl implements TtCouponGoodsService { | |||
| } | |||
| @Override | |||
| public PageInfo<TtPoiTakeRate> takeRateListAsPage(TtPoiTakeRate record, Integer pageNum, Integer pageSize) { | |||
| return PageHelper.startPage(pageNum, pageSize).doSelectPageInfo(() -> ttPoiTakeRateMapper.findList(record)); | |||
| public ResultData poiOrientedPlanUpdateStatus(TtPoiTakeRate record) { | |||
| try { | |||
| boolean b = ttMerchantPoiService.getTtWebService(record).getPoiPlanService().poiOrientedPlanUpdateStatus(record.getId(), record.getStatus()); | |||
| if(b){ | |||
| TtPoiTakeRate updTakeRate = new TtPoiTakeRate(); | |||
| updTakeRate.setId(record.getId()); | |||
| updTakeRate.updateTenantInfo(record); | |||
| updTakeRate.setStatus(record.getStatus()); | |||
| updTakeRate.setUpdateDate(new Date()); | |||
| ttPoiTakeRateMapper.updateById(updTakeRate); | |||
| return new ResultData(); | |||
| }else{ | |||
| return new ResultData(ErrorCode.SYS_SERVER_ERROR.getCode(),"false"); | |||
| } | |||
| } catch (WxErrorException e) { | |||
| e.printStackTrace(); | |||
| return new ResultData(ErrorCode.SYS_SERVER_ERROR.getCode(),e.getMessage()); | |||
| } | |||
| } | |||
| @Override | |||
| @@ -655,9 +794,8 @@ public class TtCouponGoodsServiceImpl implements TtCouponGoodsService { | |||
| } | |||
| @Override | |||
| public TtPoiTakeRate selectByCoupon(TenantEntity tenantInfo, Long couponId,Integer planType, String douyinId) { | |||
| return ttPoiTakeRateMapper.selectByCoupon(tenantInfo.getTenantId(), couponId, | |||
| planType,douyinId); | |||
| public TtPoiTakeRate selectByCoupon(TenantEntity tenantInfo, Long couponId,Integer planType) { | |||
| return ttPoiTakeRateMapper.selectByCoupon(tenantInfo.getTenantId(), couponId, planType); | |||
| } | |||
| /** | |||
| @@ -676,7 +814,7 @@ public class TtCouponGoodsServiceImpl implements TtCouponGoodsService { | |||
| return new ResultData(ErrorCode.COUPON_ORDER_TYPE_NOT_SUPPORTED); | |||
| } | |||
| TtPoiTakeRate ttPoiTakeRate = ttPoiTakeRateMapper.selectByCoupon(tenantInfo.getTenantId(), couponId,EnumCpsPlanType.ALL.getCode(),null); | |||
| TtPoiTakeRate ttPoiTakeRate = ttPoiTakeRateMapper.selectByCoupon(tenantInfo.getTenantId(), couponId,EnumCpsPlanType.ALL.getCode()); | |||
| Map<String,Object> map = new HashMap<>(); | |||
| if(ttPoiTakeRate != null){ | |||
| map.put("mallRate",ttPoiTakeRate.getTakeRate()); | |||
| @@ -745,7 +883,7 @@ public class TtCouponGoodsServiceImpl implements TtCouponGoodsService { | |||
| if(wxCoupon.getSalePrice() == 0 || wxCoupon.checkIsCard()){ | |||
| throw new MallinkException(ErrorCode.COUPON_ORDER_TYPE_NOT_SUPPORTED); | |||
| } | |||
| TtPoiTakeRate ttPoiTakeRate = ttPoiTakeRateMapper.selectByCoupon(wxCoupon.getTenantId(), wxCoupon.getId(),EnumCpsPlanType.ALL.getCode(),null); | |||
| TtPoiTakeRate ttPoiTakeRate = ttPoiTakeRateMapper.selectByCoupon(wxCoupon.getTenantId(), wxCoupon.getId(),EnumCpsPlanType.ALL.getCode()); | |||
| Integer takeRate = null; | |||
| if(ttPoiTakeRate != null){ | |||
| takeRate = ttPoiTakeRate.getTakeRate(); | |||
| @@ -822,17 +960,13 @@ public class TtCouponGoodsServiceImpl implements TtCouponGoodsService { | |||
| private int saveorupdate(TtPoiTakeRate takeRate){ | |||
| TtPoiTakeRate ttPoiTakeRate = null; | |||
| if(EnumCpsPlanType.DIRECTIONAL.getCode().equals(takeRate.getType())){ | |||
| ttPoiTakeRate = ttPoiTakeRateMapper.selectByCoupon(takeRate.getTenantId(), takeRate.getCouponId(), | |||
| takeRate.getType(),takeRate.getDouyinId()); | |||
| }else if(EnumCpsPlanType.COMMON.getCode().equals(takeRate.getType())){ | |||
| if(EnumCpsPlanType.COMMON.getCode().equals(takeRate.getType()) || EnumCpsPlanType.DIRECTIONAL.getCode().equals(takeRate.getType())){ | |||
| ttPoiTakeRate = ttPoiTakeRateMapper.selectById(takeRate.getId(), takeRate.getTenantId()); | |||
| if(ttPoiTakeRate == null){ | |||
| takeRate.setStatus(EnumCpsPlanStatus.ING.getCode()); | |||
| } | |||
| }else if(EnumCpsPlanType.ALL.getCode().equals(takeRate.getType())){ | |||
| ttPoiTakeRate = ttPoiTakeRateMapper.selectByCoupon(takeRate.getTenantId(), takeRate.getCouponId(), | |||
| takeRate.getType(),null); | |||
| ttPoiTakeRate = ttPoiTakeRateMapper.selectByCoupon(takeRate.getTenantId(), takeRate.getCouponId(), takeRate.getType()); | |||
| if(ttPoiTakeRate == null){ | |||
| takeRate.setStatus(EnumCpsPlanStatus.ING.getCode()); | |||
| } | |||
| @@ -909,105 +909,109 @@ public class WxBillAllServiceImpl implements WxBillAllService { | |||
| result.put("endtime", " "); | |||
| } | |||
| Integer filterHasPay = wxBillAll.getFilterHasPay(); | |||
| List<WxBillAllVo> list = list(wxBillAll); | |||
| if (!list.isEmpty()) { | |||
| //租金总额 | |||
| Long rentSum = list.stream().filter(b -> b.getBillTypeValue().equals(EnumBillTypeParam.RENT.getCode())) | |||
| .collect(Collectors.summingLong(b -> status == null && filterHasPay == null ? b.getReceivePay() + b.getLatePayPrice() + b.getServiceChargePay() : b.getOwe())); | |||
| //物业总额 | |||
| Long propertySum = list.parallelStream().filter(b -> b.getBillTypeValue().equals(EnumBillTypeParam.PROPERTY.getCode())) | |||
| .collect(Collectors.summingLong(b -> status == null && filterHasPay == null ? b.getReceivePay() + b.getLatePayPrice() + b.getServiceChargePay() : b.getOwe())); | |||
| //押金总额 | |||
| Long depositSum = list.stream().filter(b -> b.getBillTypeValue().equals(EnumBillTypeParam.RENT_DEPOSIT.getCode()) || | |||
| b.getBillTypeValue().equals(EnumBillTypeParam.PROPERTY_DEPOSIT.getCode()) || b.getBillTypeValue().equals(EnumBillTypeParam.ATHER_DEPOSIT.getCode())) | |||
| .collect(Collectors.summingLong(b -> status == null && filterHasPay == null ? b.getReceivePay() + b.getLatePayPrice() + b.getServiceChargePay() : b.getOwe())); | |||
| //水费 | |||
| Long waterSum = list.stream().filter(b -> b.getBillTypeValue().equals(EnumBillTypeParam.WATER.getCode())) | |||
| .collect(Collectors.summingLong(b -> status == null && filterHasPay == null ? b.getReceivePay() + b.getLatePayPrice() + b.getServiceChargePay() : b.getOwe())); | |||
| //电费 | |||
| Long powerSum = list.stream().filter(b -> b.getBillTypeValue().equals(EnumBillTypeParam.POWER.getCode())) | |||
| .collect(Collectors.summingLong(b -> status == null && filterHasPay == null ? b.getReceivePay() + b.getLatePayPrice() + b.getServiceChargePay() : b.getOwe())); | |||
| //空调费 | |||
| Long airConditioningSum = list.stream().filter(b -> b.getBillTypeValue().equals(EnumBillTypeParam.AIR_CONDITIONING.getCode())) | |||
| .collect(Collectors.summingLong(b -> status == null && filterHasPay == null ? b.getReceivePay() + b.getLatePayPrice() + b.getServiceChargePay() : b.getOwe())); | |||
| //其他费用 | |||
| Long otherSum = list.stream().filter(b -> b.getBillTypeValue().equals(EnumBillTypeParam.ROUTINE.getCode())) | |||
| .collect(Collectors.summingLong(b -> status == null && filterHasPay == null ? b.getReceivePay() + b.getLatePayPrice() + b.getServiceChargePay() : b.getOwe())); | |||
| //押金明细 | |||
| StringBuffer depositDetail = new StringBuffer(); | |||
| list.stream().filter(b -> b.getBillTypeValue().equals(EnumBillTypeParam.RENT_DEPOSIT.getCode()) || | |||
| b.getBillTypeValue().equals(EnumBillTypeParam.PROPERTY_DEPOSIT.getCode()) || b.getBillTypeValue().equals(EnumBillTypeParam.ATHER_DEPOSIT.getCode())) | |||
| .forEach(b -> { | |||
| //租金 | |||
| wxBillAll.setBillTypeValue(EnumBillQueryType.RENT.getCode()); | |||
| List<WxBillAllVo> rentList = this.list(wxBillAll); | |||
| Long rentSum = 0l; | |||
| if(!rentList.isEmpty()){ | |||
| rentSum = rentList.stream().collect(Collectors.summingLong(b -> status == null && filterHasPay == null ? b.getReceivePay() + b.getLatePayPrice() + b.getServiceChargePay() : b.getOwe())); | |||
| } | |||
| //物业 | |||
| wxBillAll.setBillTypeValue(EnumBillQueryType.PROPERTY.getCode()); | |||
| List<WxBillAllVo> propertyList = this.list(wxBillAll); | |||
| Long propertySum = 0l; | |||
| if(!propertyList.isEmpty()){ | |||
| propertySum = propertyList.stream().collect(Collectors.summingLong(b -> status == null && filterHasPay == null ? b.getReceivePay() + b.getLatePayPrice() + b.getServiceChargePay() : b.getOwe())); | |||
| } | |||
| //押金 | |||
| List<WxBillAllVo> depositList = new ArrayList<>(); | |||
| //租赁押金 | |||
| wxBillAll.setBillTypeValue(EnumBillQueryType.RENT_DEPOSIT.getCode()); | |||
| List<WxBillAllVo> rentDepositList = this.list(wxBillAll); | |||
| depositList.addAll(rentDepositList); | |||
| //物业押金 | |||
| wxBillAll.setBillTypeValue(EnumBillQueryType.PROPERTY_DEPOSIT.getCode()); | |||
| List<WxBillAllVo> propertyDepositList = this.list(wxBillAll); | |||
| depositList.addAll(propertyDepositList); | |||
| //其他押金 | |||
| wxBillAll.setBillTypeValue(EnumBillQueryType.OTHER_DEPOSIT.getCode()); | |||
| List<WxBillAllVo> otherDepositList = this.list(wxBillAll); | |||
| depositList.addAll(otherDepositList); | |||
| Long depositSum = 0l; | |||
| StringBuffer depositDetail = new StringBuffer();//押金明细 | |||
| if(!depositList.isEmpty()){ | |||
| depositSum = depositList.stream().collect(Collectors.summingLong(b -> status == null && filterHasPay == null ? b.getReceivePay() + b.getLatePayPrice() + b.getServiceChargePay() : b.getOwe())); | |||
| depositList.stream().forEach(b -> { | |||
| BigDecimal owe = new BigDecimal(status == null && filterHasPay == null ? b.getReceivePay() : b.getOwe()).divide(new BigDecimal(100)).setScale(2, RoundingMode.HALF_EVEN); | |||
| depositDetail.append(b.getName()).append(":[").append(owe.toPlainString()).append("] "); | |||
| }); | |||
| //其他费用明细 | |||
| StringBuffer otherDetail = new StringBuffer(); | |||
| list.stream().filter(b -> b.getBillTypeValue().equals(EnumBillTypeParam.ROUTINE.getCode())) | |||
| .forEach(b -> { | |||
| } | |||
| //水电空调费 | |||
| wxBillAll.setBillTypeValue(EnumBillQueryType.WATER_POWER_AIR.getCode()); | |||
| List<WxBillAllVo> waterPowerAirList = this.list(wxBillAll); | |||
| Long waterSum = 0l, powerSum = 0l, airConditioningSum = 0l; | |||
| if (!waterPowerAirList.isEmpty()) { | |||
| waterSum = waterPowerAirList.stream().filter(b -> b.getBillTypeValue().equals(EnumBillTypeParam.WATER.getCode())) | |||
| .collect(Collectors.summingLong(b -> status == null && filterHasPay == null ? b.getReceivePay() + b.getLatePayPrice() + b.getServiceChargePay() : b.getOwe())); | |||
| powerSum = waterPowerAirList.stream().filter(b -> b.getBillTypeValue().equals(EnumBillTypeParam.POWER.getCode())) | |||
| .collect(Collectors.summingLong(b -> status == null && filterHasPay == null ? b.getReceivePay() + b.getLatePayPrice() + b.getServiceChargePay() : b.getOwe())); | |||
| airConditioningSum = waterPowerAirList.stream().filter(b -> b.getBillTypeValue().equals(EnumBillTypeParam.AIR_CONDITIONING.getCode())) | |||
| .collect(Collectors.summingLong(b -> status == null && filterHasPay == null ? b.getReceivePay() + b.getLatePayPrice() + b.getServiceChargePay() : b.getOwe())); | |||
| } | |||
| //其他费用 | |||
| wxBillAll.setBillTypeValue(EnumBillQueryType.OTHER.getCode()); | |||
| List<WxBillAllVo> otherList = this.list(wxBillAll); | |||
| Long otherSum = 0l; | |||
| StringBuffer otherDetail = new StringBuffer();//其他费用明细 | |||
| if(!otherList.isEmpty()){ | |||
| otherSum = otherList.stream().collect(Collectors.summingLong(b -> status == null && filterHasPay == null ? b.getReceivePay() + b.getLatePayPrice() + b.getServiceChargePay() : b.getOwe())); | |||
| otherList.stream().forEach(b -> { | |||
| BigDecimal owe = new BigDecimal(status == null && filterHasPay == null ? b.getReceivePay() : b.getOwe()).divide(new BigDecimal(100)).setScale(2, RoundingMode.HALF_EVEN); | |||
| otherDetail.append(b.getName()).append(":[").append(owe.toPlainString()).append("] "); | |||
| }); | |||
| //总计 | |||
| Long summarySum = rentSum + propertySum + depositSum + waterSum + powerSum + airConditioningSum + otherSum; | |||
| BigDecimal rent = new BigDecimal(rentSum).divide(new BigDecimal(100)).setScale(2, RoundingMode.HALF_EVEN); | |||
| BigDecimal property = new BigDecimal(propertySum).divide(new BigDecimal(100)).setScale(2, RoundingMode.HALF_EVEN); | |||
| BigDecimal deposit = new BigDecimal(depositSum).divide(new BigDecimal(100)).setScale(2, RoundingMode.HALF_EVEN); | |||
| BigDecimal water = new BigDecimal(waterSum).divide(new BigDecimal(100)).setScale(2, RoundingMode.HALF_EVEN); | |||
| BigDecimal power = new BigDecimal(powerSum).divide(new BigDecimal(100)).setScale(2, RoundingMode.HALF_EVEN); | |||
| BigDecimal airConditioning = new BigDecimal(airConditioningSum).divide(new BigDecimal(100)).setScale(2, RoundingMode.HALF_EVEN); | |||
| BigDecimal other = new BigDecimal(otherSum).divide(new BigDecimal(100)).setScale(2, RoundingMode.HALF_EVEN); | |||
| BigDecimal summary = new BigDecimal(summarySum).divide(new BigDecimal(100)).setScale(2, RoundingMode.HALF_EVEN); | |||
| String summaryUpper = PriceUtil.number2CNMontrayUnit(summary); | |||
| result.put("rent", rent.toPlainString()); | |||
| result.put("property", property.toPlainString()); | |||
| result.put("deposit", deposit.toPlainString()); | |||
| result.put("water", water.toPlainString()); | |||
| result.put("power", power.toPlainString()); | |||
| result.put("airConditioning", airConditioning.toPlainString()); | |||
| result.put("other", other.toPlainString()); | |||
| result.put("summary", summary.toPlainString()); | |||
| result.put("summaryUpper", summaryUpper); | |||
| result.put("depositDetail", StringUtils.isNotEmpty(depositDetail.toString()) ? depositDetail.toString() : " "); | |||
| result.put("otherDetail", StringUtils.isNotEmpty(otherDetail.toString()) ? otherDetail.toString() : " "); | |||
| WxMerchantDto wxMerchantDto = new WxMerchantDto(); | |||
| wxMerchantDto.setId(wxBillAll.getMerchantId()); | |||
| wxMerchantDto.updateTenantInfo(wxMall); | |||
| PageInfo<WxMerchantVo> pageInfo = wxMerchantService.listAsPageCVo(wxMerchantDto,1,1,true); | |||
| List<WxMerchantVo> listCVo = pageInfo.getList(); | |||
| WxMerchantVo wxMerchantVo = listCVo.get(0); | |||
| result.put("merchant", wxMerchantVo.getMerchantName()); | |||
| WxShopVo wxShopVo = wxMerchantVo.getShopVoList().stream() | |||
| .filter(s -> StringUtils.isNotEmpty(s.getLinkPhone()) || StringUtils.isNotEmpty(s.getLinkPerson())).findFirst().orElse(null); | |||
| if (wxShopVo != null) { | |||
| String linkPerson = wxShopVo.getLinkPerson(); | |||
| String linkPhone = wxShopVo.getLinkPhone(); | |||
| result.put("linkPerson", StringUtils.isNotEmpty(linkPerson) ? linkPerson : " "); | |||
| result.put("linkPhone", StringUtils.isNotEmpty(linkPhone) ? linkPhone : " "); | |||
| } else { | |||
| result.put("linkPerson", " "); | |||
| result.put("linkPhone", " "); | |||
| } | |||
| } | |||
| //总计 | |||
| Long summarySum = rentSum + propertySum + depositSum + waterSum + powerSum + airConditioningSum + otherSum; | |||
| BigDecimal rent = new BigDecimal(rentSum).divide(new BigDecimal(100)).setScale(2, RoundingMode.HALF_EVEN); | |||
| BigDecimal property = new BigDecimal(propertySum).divide(new BigDecimal(100)).setScale(2, RoundingMode.HALF_EVEN); | |||
| BigDecimal deposit = new BigDecimal(depositSum).divide(new BigDecimal(100)).setScale(2, RoundingMode.HALF_EVEN); | |||
| BigDecimal water = new BigDecimal(waterSum).divide(new BigDecimal(100)).setScale(2, RoundingMode.HALF_EVEN); | |||
| BigDecimal power = new BigDecimal(powerSum).divide(new BigDecimal(100)).setScale(2, RoundingMode.HALF_EVEN); | |||
| BigDecimal airConditioning = new BigDecimal(airConditioningSum).divide(new BigDecimal(100)).setScale(2, RoundingMode.HALF_EVEN); | |||
| BigDecimal other = new BigDecimal(otherSum).divide(new BigDecimal(100)).setScale(2, RoundingMode.HALF_EVEN); | |||
| BigDecimal summary = new BigDecimal(summarySum).divide(new BigDecimal(100)).setScale(2, RoundingMode.HALF_EVEN); | |||
| String summaryUpper = PriceUtil.number2CNMontrayUnit(summary); | |||
| result.put("rent", rent.toPlainString()); | |||
| result.put("property", property.toPlainString()); | |||
| result.put("deposit", deposit.toPlainString()); | |||
| result.put("water", water.toPlainString()); | |||
| result.put("power", power.toPlainString()); | |||
| result.put("airConditioning", airConditioning.toPlainString()); | |||
| result.put("other", other.toPlainString()); | |||
| result.put("summary", summary.toPlainString()); | |||
| result.put("summaryUpper", summaryUpper); | |||
| result.put("depositDetail", StringUtils.isNotEmpty(depositDetail.toString()) ? depositDetail.toString() : " "); | |||
| result.put("otherDetail", StringUtils.isNotEmpty(otherDetail.toString()) ? otherDetail.toString() : " "); | |||
| WxMerchantDto wxMerchantDto = new WxMerchantDto(); | |||
| wxMerchantDto.setId(wxBillAll.getMerchantId()); | |||
| wxMerchantDto.updateTenantInfo(wxMall); | |||
| PageInfo<WxMerchantVo> pageInfo = wxMerchantService.listAsPageCVo(wxMerchantDto,1,1,true); | |||
| List<WxMerchantVo> listCVo = pageInfo.getList(); | |||
| WxMerchantVo wxMerchantVo = listCVo.get(0); | |||
| result.put("merchant", wxMerchantVo.getMerchantName()); | |||
| WxShopVo wxShopVo = wxMerchantVo.getShopVoList().stream() | |||
| .filter(s -> StringUtils.isNotEmpty(s.getLinkPhone()) || StringUtils.isNotEmpty(s.getLinkPerson())).findFirst().orElse(null); | |||
| if (wxShopVo != null) { | |||
| String linkPerson = wxShopVo.getLinkPerson(); | |||
| String linkPhone = wxShopVo.getLinkPhone(); | |||
| result.put("linkPerson", StringUtils.isNotEmpty(linkPerson) ? linkPerson : " "); | |||
| result.put("linkPhone", StringUtils.isNotEmpty(linkPhone) ? linkPhone : " "); | |||
| } else { | |||
| result.put("merchant", " "); | |||
| result.put("rent", " "); | |||
| result.put("property", " "); | |||
| result.put("deposit", " "); | |||
| result.put("water", " "); | |||
| result.put("power", " "); | |||
| result.put("airConditioning", " "); | |||
| result.put("other", " "); | |||
| result.put("summary", " "); | |||
| result.put("summaryUpper", " "); | |||
| result.put("depositDetail", " "); | |||
| result.put("otherDetail", " "); | |||
| result.put("linkPerson", " "); | |||
| result.put("linkPhone", " "); | |||
| } | |||
| @@ -1022,6 +1026,7 @@ public class WxBillAllServiceImpl implements WxBillAllService { | |||
| WordUtil.exportWord(templatePath, filepath, filename, exportFileName, result, request, response, null); | |||
| } | |||
| @Override | |||
| public void exportSettleBill(WxBillSettle wxBillSettle, HttpServletRequest request, HttpServletResponse response) { | |||
| wxBillSettle = wxBillSettleService.getById(wxBillSettle.getId(), EnumFilterSettle.NO.getCode()); | |||
| @@ -1,5 +1,11 @@ | |||
| package com.iformall.service.impl; | |||
| import com.github.binarywang.wxpay.bean.businesscircle.MemberCardAuthorizeResult; | |||
| import com.github.binarywang.wxpay.bean.businesscircle.ParkingNotifyRequest; | |||
| import com.github.binarywang.wxpay.bean.businesscircle.PointsCommitStatusResult; | |||
| import com.github.binarywang.wxpay.bean.businesscircle.PointsNotifyRequest; | |||
| import com.github.binarywang.wxpay.exception.WxPayException; | |||
| import com.github.binarywang.wxpay.service.WxPayService; | |||
| import com.github.pagehelper.PageHelper; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.common.ErrorCode; | |||
| @@ -7,10 +13,16 @@ import com.iformall.common.IdWorker; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.domain.po.*; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import com.iformall.domain.po.msg.AfterAddCreditMsg; | |||
| import com.iformall.domain.po.msg.AfterBusinessCreditMsg; | |||
| import com.iformall.domain.po.msg.AfterCarInOutMsg; | |||
| import com.iformall.enums.*; | |||
| import com.iformall.exception.MallinkException; | |||
| import com.iformall.mapper.WxBusinessCircleOrderMapper; | |||
| import com.iformall.mq.MqBaseProducer; | |||
| import com.iformall.service.*; | |||
| import com.iformall.utils.DateUtils; | |||
| import com.iformall.utils.MaUtil; | |||
| import com.iformall.utils.RedisLock; | |||
| import org.apache.commons.lang3.StringUtils; | |||
| import org.slf4j.Logger; | |||
| @@ -23,8 +35,10 @@ import org.springframework.transaction.annotation.Transactional; | |||
| import javax.servlet.http.HttpServletRequest; | |||
| import javax.servlet.http.HttpServletResponse; | |||
| import java.math.BigDecimal; | |||
| import java.text.SimpleDateFormat; | |||
| import java.util.Date; | |||
| import java.util.List; | |||
| import java.util.Locale; | |||
| @Service | |||
| public class WxBusinessCircleOrderServiceImpl implements WxBusinessCircleOrderService { | |||
| @@ -55,10 +69,19 @@ public class WxBusinessCircleOrderServiceImpl implements WxBusinessCircleOrderSe | |||
| WxCreditHistoryService creditHistoryService; | |||
| @Autowired | |||
| WxCallBackService wxCallBackService; | |||
| WxCouponSendService wxCouponSendService; | |||
| @Autowired | |||
| WxCouponSendService wxCouponSendService; | |||
| WxAppinfoService wxAppinfoService; | |||
| @Autowired | |||
| WxPayAccountService wxPayAccountService; | |||
| @Autowired | |||
| MqBaseProducer mqBaseProducer; | |||
| @Autowired | |||
| MaUtil maUtil; | |||
| @Override | |||
| @@ -124,8 +147,11 @@ public class WxBusinessCircleOrderServiceImpl implements WxBusinessCircleOrderSe | |||
| WxBusinessCircleOrder byTransactionId = this.getOrderByTransactionId(record.getTransactionId(),record.getTenantId()); | |||
| if(byTransactionId != null){ | |||
| logger.error("--Wx商圈付款--订单消息已存在---byTransactionId="+byTransactionId.getTransactionId()); | |||
| //同步积分状态 | |||
| this.sendsyncNotifyPointsMsg(record,byTransactionId.getId()); | |||
| redisLock.unlock(lockKey, timeStr); | |||
| throw new MallinkException(ErrorCode.SYS_PARAMETER_ERROR.getCode(), "订单数据已存在"); | |||
| return new ResultData(); | |||
| // throw new MallinkException(ErrorCode.SYS_PARAMETER_ERROR.getCode(), "订单数据已存在"); | |||
| }else { | |||
| Date now = new Date(); | |||
| final IdWorker idWorker = IdWorker.get(); | |||
| @@ -155,7 +181,7 @@ public class WxBusinessCircleOrderServiceImpl implements WxBusinessCircleOrderSe | |||
| } | |||
| } | |||
| if(record.getCUserId() == null){ | |||
| WxCUserBasicInfo byPhone = wxCUserBasicInfoService.registerByPhone(record, record.getCUserPhone(),null,null,null); | |||
| WxCUserBasicInfo byPhone = wxCUserBasicInfoService.registerByPhone(record, record.getCUserPhone(),null,null,null,null); | |||
| if(byPhone != null){ | |||
| record.setCUserNickName(byPhone.getNickName()); | |||
| record.setCUserPhone(byPhone.getPhone()); | |||
| @@ -213,10 +239,8 @@ public class WxBusinessCircleOrderServiceImpl implements WxBusinessCircleOrderSe | |||
| record.setPointsUpdateTime(creditHistory.getCreateDate()); | |||
| this.updatePoints(record); | |||
| if(StringUtils.isNotBlank(record.getNoticeId())){ | |||
| //同步积分 | |||
| wxCallBackService.notifyPoints(record); | |||
| } | |||
| //同步积分 | |||
| this.sendsyncNotifyPointsMsg(record,record.getId()); | |||
| } | |||
| redisLock.unlock(lockKey, timeStr); | |||
| return new ResultData(creditNum); | |||
| @@ -366,6 +390,52 @@ public class WxBusinessCircleOrderServiceImpl implements WxBusinessCircleOrderSe | |||
| wxBusinessCircleOrderMapper.updatePoints(record); | |||
| } | |||
| @Override | |||
| public void notifyPoints(WxBusinessCircleOrder record){ | |||
| if(EnumYesOrNo.YES.getCode().equals(record.getIsPointsNotify())){ | |||
| logger.info("该商圈订单已同步积分"+record.getId()); | |||
| return; | |||
| } | |||
| WxPayService wxPayService = wxPayAccountService.getWxPayService(record.getTenantId()); | |||
| PointsNotifyRequest request = new PointsNotifyRequest(); | |||
| request.setSubMchid(wxPayService.getConfig().getSubMchId()); | |||
| request.setTransactionId(record.getTransactionId()); | |||
| request.setAppid(wxPayService.getConfig().getAppId()); | |||
| request.setOpenid(record.getOpenid()); | |||
| SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'+'mm:ss", Locale.CHINA); | |||
| if(record.getIncreasedPoints() != null && record.getIncreasedPoints() > 0 ){ | |||
| request.setEarnPoints(true); | |||
| request.setIncreasedPoints(record.getIncreasedPoints()); | |||
| request.setPointsUpdateTime(sdf.format(record.getPointsUpdateTime())); | |||
| }else{ | |||
| request.setEarnPoints(false); | |||
| request.setIncreasedPoints(0); | |||
| request.setPointsUpdateTime(sdf.format(new Date())); | |||
| request.setNoPointsRemarks("该订单不参与积分活动"); | |||
| } | |||
| try { | |||
| String result = wxPayService.getBusinessCircleService().notifyPoints(request); | |||
| logger.info("微信商圈同步积分请求结果----"+result); | |||
| record.setUpdateTime(new Date()); | |||
| this.updateIsPointsNotify(record); | |||
| } catch (WxPayException e) { | |||
| e.printStackTrace(); | |||
| } | |||
| } | |||
| @Override | |||
| public void sendsyncNotifyPointsMsg(TenantEntity tenantEntity, Long businessCircleOrderId) { | |||
| AfterBusinessCreditMsg msg = new AfterBusinessCreditMsg(); | |||
| msg.updateTenantInfo(tenantEntity); | |||
| msg.setMsgType(EnumMsgRecordType.AFTER_BUSINESS_CREDIT.getCode()); | |||
| msg.setBusinessCircleOrderId(businessCircleOrderId); | |||
| mqBaseProducer.sendMessage(msg, EnumMsgMqTopic.DEFAULT.getCode(), EnumMsgMqTag.DEFAULT.getCode(), EnumMsgMqKey.DEFAULT.getCode()); | |||
| } | |||
| @Override | |||
| public void updateIsPointsNotify(WxBusinessCircleOrder record) { | |||
| record.setUpdateTime(new Date()); | |||
| @@ -390,5 +460,104 @@ public class WxBusinessCircleOrderServiceImpl implements WxBusinessCircleOrderSe | |||
| return sumCircleRefundAmount==null?0:sumCircleRefundAmount; | |||
| } | |||
| @Override | |||
| public ResultData syncauthorizeState(TenantEntity tenantEntity, String openid) { | |||
| WxAppinfo cAppInfo = wxAppinfoService.getCAppInfoFromRedis(tenantEntity.getTenantId(), EnumAppPlat.WX); | |||
| if(cAppInfo == null){ | |||
| return new ResultData(ErrorCode.APP_ID_NOT_FOUND); | |||
| } | |||
| WxPayAccount payAccount = wxPayAccountService.getByIdFromRedis(cAppInfo.getPayId()); | |||
| if(payAccount == null){ | |||
| return new ResultData(ErrorCode.API_KEY_NOT_FOUND); | |||
| } | |||
| if(!EnumBusinessType.BUSINESS_3.getCode().equals(payAccount.getBusinessType())){ | |||
| return new ResultData(ErrorCode.SYS_SERVER_ERROR.getCode(),"未开通商圈或不支持此项操作"); | |||
| } | |||
| try { | |||
| WxPayService wxPayService = maUtil.getWxPayService(cAppInfo, payAccount); | |||
| MemberCardAuthorizeResult authorizations = wxPayService.getBusinessCircleService().getAuthorizations(openid); | |||
| EnumBusinessCircleAuthorizeState authorizeState = EnumBusinessCircleAuthorizeState.getEnum(authorizations.getAuthorizeState()); | |||
| if(!EnumBusinessCircleAuthorizeState.UNAUTHORIZED.equals(authorizeState)){ | |||
| WxCUser updCuser = new WxCUser(); | |||
| updCuser.updateTenantInfo(tenantEntity); | |||
| updCuser.setOpenId(authorizations.getOpenid()); | |||
| updCuser.setAuthorizeState(authorizeState.getCode()); | |||
| String formaStr = "yyyy-MM-dd'T'HH:mm:ss'+'mm:ss"; | |||
| updCuser.setAuthorizeTime(DateUtils.stringToDate(authorizations.getAuthorizeTime(),formaStr)); | |||
| updCuser.setDeauthorizeTime(DateUtils.stringToDate(authorizations.getDeauthorizeTime(),formaStr)); | |||
| wxCUserService.updateAuthorizeStateByOpenId(updCuser); | |||
| } | |||
| return new ResultData(authorizeState); | |||
| } catch (WxPayException e) { | |||
| e.printStackTrace(); | |||
| return new ResultData(ErrorCode.SYS_SERVER_ERROR.getCode(),e.getMessage()); | |||
| } | |||
| } | |||
| @Override | |||
| public ResultData getPointsCommitStatus(TenantEntity tenantEntity, String openId) { | |||
| WxAppinfo cAppInfo = wxAppinfoService.getCAppInfoFromRedis(tenantEntity.getTenantId(), EnumAppPlat.WX); | |||
| if(cAppInfo == null){ | |||
| return new ResultData(ErrorCode.APP_ID_NOT_FOUND); | |||
| } | |||
| WxPayAccount payAccount = wxPayAccountService.getByIdFromRedis(cAppInfo.getPayId()); | |||
| if(payAccount == null){ | |||
| return new ResultData(ErrorCode.API_KEY_NOT_FOUND); | |||
| } | |||
| if(!EnumBusinessType.BUSINESS_3.getCode().equals(payAccount.getBusinessType())){ | |||
| return new ResultData(ErrorCode.SYS_SERVER_ERROR.getCode(),"未开通商圈或不支持此项操作"); | |||
| } | |||
| try { | |||
| WxPayService wxPayService = maUtil.getWxPayService(cAppInfo, payAccount); | |||
| PointsCommitStatusResult pointsCommitStatus = wxPayService.getBusinessCircleService().getPointsCommitStatus(payAccount.getBrandid(), openId); | |||
| return new ResultData(pointsCommitStatus); | |||
| } catch (WxPayException e) { | |||
| e.printStackTrace(); | |||
| return new ResultData(ErrorCode.SYS_SERVER_ERROR.getCode(),e.getMessage()); | |||
| } | |||
| } | |||
| @Override | |||
| public ResultData syncParkings(TenantEntity tenantEntity, String openId, String plate_number, String state, Date time) { | |||
| WxAppinfo cAppInfo = wxAppinfoService.getCAppInfoFromRedis(tenantEntity.getTenantId(), EnumAppPlat.WX); | |||
| if(cAppInfo == null){ | |||
| return new ResultData(ErrorCode.APP_ID_NOT_FOUND); | |||
| } | |||
| WxPayAccount payAccount = wxPayAccountService.getByIdFromRedis(cAppInfo.getPayId()); | |||
| if(payAccount == null){ | |||
| return new ResultData(ErrorCode.API_KEY_NOT_FOUND); | |||
| } | |||
| if(!EnumBusinessType.BUSINESS_3.getCode().equals(payAccount.getBusinessType())){ | |||
| return new ResultData(ErrorCode.SYS_SERVER_ERROR.getCode(),"未开通商圈或不支持此项操作"); | |||
| } | |||
| try { | |||
| WxPayService wxPayService = maUtil.getWxPayService(cAppInfo, payAccount); | |||
| ParkingNotifyRequest request = new ParkingNotifyRequest(); | |||
| request.setBrandid(payAccount.getBrandid()); | |||
| request.setOpenid(openId); | |||
| request.setPlateNumber(plate_number); | |||
| request.setState(state); | |||
| String formaStr = "yyyy-MM-dd'T'HH:mm:ss'+'mm:ss"; | |||
| request.setTime(DateUtils.date2String(time,formaStr)); | |||
| wxPayService.getBusinessCircleService().notifyParkings(request); | |||
| return new ResultData(); | |||
| } catch (WxPayException e) { | |||
| e.printStackTrace(); | |||
| return new ResultData(ErrorCode.SYS_SERVER_ERROR.getCode(),e.getMessage()); | |||
| } | |||
| } | |||
| @Override | |||
| public void sendSyncParkingsMsg(TenantEntity tenantEntity, Long carCmdLogId) { | |||
| //停车出入场通知 todo | |||
| // AfterCarInOutMsg msg = new AfterCarInOutMsg(); | |||
| // msg.updateTenantInfo(tenantEntity); | |||
| // msg.setMsgType(EnumMsgRecordType.AFTER_ADD_CREDIT.getCode()); | |||
| // msg.setCarCmdLogId(carCmdLogId); | |||
| // mqBaseProducer.sendMessage(msg, EnumMsgMqTopic.DEFAULT.getCode(), EnumMsgMqTag.DEFAULT.getCode(), EnumMsgMqKey.DEFAULT.getCode()); | |||
| } | |||
| } | |||
| @@ -672,7 +672,7 @@ public class WxCUserBasicInfoServiceImpl implements WxCUserBasicInfoService,IExc | |||
| @Override | |||
| public WxCUserBasicInfo registerByPhone(TenantEntity tenantEntity, String phone, String nickName, Integer sex, String avatarUrl) { | |||
| public WxCUserBasicInfo registerByPhone(TenantEntity tenantEntity, String phone, String nickName,String name, Integer sex, String avatarUrl) { | |||
| if (StringUtils.isBlank(phone)) | |||
| return null; | |||
| @@ -682,6 +682,7 @@ public class WxCUserBasicInfoServiceImpl implements WxCUserBasicInfoService,IExc | |||
| basicInfo.setTenantId("," + tenantEntity.getTenantId() + ","); | |||
| basicInfo.setFinalTenantId(tenantEntity.getFinalTenantId()); | |||
| basicInfo.setPhone(phone); | |||
| basicInfo.setName(name); | |||
| basicInfo.setNickName(nickName); | |||
| basicInfo.setSex(sex); | |||
| basicInfo.setAvatarUrl(avatarUrl); | |||
| @@ -690,6 +691,7 @@ public class WxCUserBasicInfoServiceImpl implements WxCUserBasicInfoService,IExc | |||
| WxCUserBasicInfo wxCUserBasicInfo = new WxCUserBasicInfo(); | |||
| wxCUserBasicInfo.setId(basicInfo.getId()); | |||
| wxCUserBasicInfo.setFinalTenantId(basicInfo.getFinalTenantId()); | |||
| wxCUserBasicInfo.setName(name); | |||
| wxCUserBasicInfo.setNickName(nickName); | |||
| wxCUserBasicInfo.setSex(sex); | |||
| wxCUserBasicInfo.setAvatarUrl(avatarUrl); | |||
| @@ -346,4 +346,9 @@ public class WxCUserServiceImpl implements WxCUserService { | |||
| wxCUserMapper.updateMsgCount(user); | |||
| } | |||
| @Override | |||
| public void updateAuthorizeStateByOpenId(WxCUser updCuser) { | |||
| wxCUserMapper.updateAuthorizeStateByOpenId(updCuser); | |||
| } | |||
| } | |||
| @@ -1,58 +0,0 @@ | |||
| package com.iformall.service.impl; | |||
| import com.github.binarywang.wxpay.bean.businesscircle.PointsNotifyRequest; | |||
| import com.github.binarywang.wxpay.exception.WxPayException; | |||
| import com.github.binarywang.wxpay.service.WxPayService; | |||
| import com.iformall.domain.po.WxBusinessCircleOrder; | |||
| import com.iformall.mapper.WxBusinessCircleOrderMapper; | |||
| import com.iformall.service.*; | |||
| import org.slf4j.Logger; | |||
| import org.slf4j.LoggerFactory; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.stereotype.Service; | |||
| import java.text.SimpleDateFormat; | |||
| import java.util.Date; | |||
| import java.util.Locale; | |||
| @Service | |||
| public class WxCallBackServiceImpl implements WxCallBackService { | |||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||
| private final SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'+'mm:ss", Locale.CHINA); | |||
| @Autowired | |||
| WxPayAccountService wxPayAccountService; | |||
| @Autowired | |||
| WxBusinessCircleOrderMapper wxBusinessCircleOrderMapper; | |||
| /** | |||
| * | |||
| * @param record | |||
| */ | |||
| public void notifyPoints(WxBusinessCircleOrder record){ | |||
| WxPayService wxPayService = wxPayAccountService.getWxPayService(record.getTenantId()); | |||
| PointsNotifyRequest request = new PointsNotifyRequest(); | |||
| request.setSubMchid(wxPayService.getConfig().getSubMchId()); | |||
| request.setTransactionId(record.getTransactionId()); | |||
| request.setAppid(wxPayService.getConfig().getAppId()); | |||
| request.setOpenid(record.getOpenid()); | |||
| request.setEarnPoints(true); | |||
| request.setIncreasedPoints(record.getIncreasedPoints()); | |||
| request.setPointsUpdateTime(sdf.format(new Date())); | |||
| try { | |||
| String result = wxPayService.getBusinessCircleService().notifyPoints(request); | |||
| logger.info("微信商圈同步积分请求结果----"+result); | |||
| record.setUpdateTime(new Date()); | |||
| wxBusinessCircleOrderMapper.updateIsPointsNotify(record); | |||
| } catch (WxPayException e) { | |||
| e.printStackTrace(); | |||
| } | |||
| } | |||
| } | |||
| @@ -325,6 +325,7 @@ public class WxCampaignServiceImpl implements WxCampaignService { | |||
| wxCouponChannel.setEndTime(endTime); | |||
| wxCouponChannel.setStatus(EnumCouponChannelStatus.STATUS_THROW_IN.getCode()); | |||
| wxCouponChannel.setCouponId(couponId); | |||
| wxCouponChannel.setMakeMerchantId(wxCoupon.getMakeMerchantId()); | |||
| wxCouponChannel.setType(wxCoupon.getType()); | |||
| wxCouponChannel.setTargetAd(EnumCouponChannelType.COUPON_CHANNEL_ID_CAMPAIN.getCode()); | |||
| wxCouponChannel.updateTenantInfo(wxCoupon); | |||
| @@ -4,8 +4,10 @@ import com.github.pagehelper.PageHelper; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.domain.po.WxCarCmdLog; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import com.iformall.enums.EnumCarCmd; | |||
| import com.iformall.mapper.WxCarCmdLogMapper; | |||
| import com.iformall.mapper.WxMallMapper; | |||
| import com.iformall.service.WxBusinessCircleOrderService; | |||
| import com.iformall.service.WxCarCmdLogService; | |||
| import com.iformall.service.WxMallService; | |||
| import org.apache.commons.lang3.StringUtils; | |||
| @@ -31,6 +33,9 @@ public class WxCarCmdLogServiceImpl implements WxCarCmdLogService { | |||
| @Autowired | |||
| WxMallService wxMallService; | |||
| @Autowired | |||
| WxBusinessCircleOrderService wxBusinessCircleOrderService; | |||
| @Override | |||
| public PageInfo<WxCarCmdLog> listAsPage(WxCarCmdLog record, Integer pageIndex, Integer pageSize) { | |||
| @@ -49,11 +54,22 @@ public class WxCarCmdLogServiceImpl implements WxCarCmdLogService { | |||
| final IdWorker idWorker = IdWorker.get(); | |||
| record.setId(idWorker.nextId()); | |||
| wxCarCmdLogMapper.insert(record); | |||
| this.afterCarInOrOut(record); | |||
| } else { | |||
| wxCarCmdLogMapper.updateById(record); | |||
| } | |||
| } | |||
| private void afterCarInOrOut(WxCarCmdLog record){ | |||
| if(StringUtils.isBlank(record.getPlateNumber())){ | |||
| return; | |||
| } | |||
| if(EnumCarCmd.getCarIn().contains(record.getCmdType()) | |||
| || EnumCarCmd.getCarOut().contains(record.getCmdType())){ | |||
| wxBusinessCircleOrderService.sendSyncParkingsMsg(record,record.getId()); | |||
| } | |||
| } | |||
| @Override | |||
| public void deleteById(Long id,String tenantId) { | |||
| wxCarCmdLogMapper.deleteById(id,tenantId); | |||
| @@ -54,7 +54,10 @@ public class WxCardSpendServiceImpl implements WxCardSpendService { | |||
| WxCouponMerchantMapper wxCouponMerchantMapper; | |||
| @Autowired | |||
| WxPayAccountMapper payAccountMapper; | |||
| WxAppinfoService wxAppinfoService; | |||
| @Autowired | |||
| WxPayAccountService wxPayAccountService; | |||
| @Autowired | |||
| WxOrderMapper wxOrderMapper; | |||
| @@ -117,14 +120,13 @@ public class WxCardSpendServiceImpl implements WxCardSpendService { | |||
| } | |||
| // 3. get pay account | |||
| WxPayAccount payAccount = null; | |||
| WxPayAccount payAccountQ = new WxPayAccount(); | |||
| payAccountQ.updateTenantInfo(record); | |||
| try { | |||
| payAccount = payAccountMapper.selectOne(new QueryWrapper(payAccountQ)); | |||
| } catch (Exception e) { | |||
| logger.error("获取payAccount error: " + record.getTenantId()); | |||
| return new ResultData(ErrorCode.DB_FAIL.getCode(), "获取payAccount失败"); | |||
| WxAppinfo cAppInfo = wxAppinfoService.getCAppInfoFromRedis(cardInfo.getTenantId(), EnumAppPlat.WX); | |||
| if(cAppInfo == null){ | |||
| return new ResultData(ErrorCode.APP_ID_NOT_FOUND); | |||
| } | |||
| WxPayAccount payAccount = wxPayAccountService.getByIdFromRedis(cAppInfo.getPayId()); | |||
| if(payAccount == null){ | |||
| return new ResultData(ErrorCode.API_KEY_NOT_FOUND); | |||
| } | |||
| // 4. 扣减计算 | |||
| @@ -651,14 +653,13 @@ public class WxCardSpendServiceImpl implements WxCardSpendService { | |||
| } | |||
| // 3. get pay account | |||
| WxPayAccount payAccount = null; | |||
| WxPayAccount payAccountQ = new WxPayAccount(); | |||
| payAccountQ.updateTenantInfo(record); | |||
| try { | |||
| payAccount = payAccountMapper.selectOne(new QueryWrapper(payAccountQ)); | |||
| } catch (Exception e) { | |||
| logger.error("获取payAccount error: " + record.getTenantId()); | |||
| throw new MallinkException(ErrorCode.SYS_MCH_NOT_FOUND); | |||
| WxAppinfo cAppInfo = wxAppinfoService.getCAppInfoFromRedis(cardInfo.getTenantId(), EnumAppPlat.WX); | |||
| if(cAppInfo == null){ | |||
| throw new MallinkException(ErrorCode.APP_ID_NOT_FOUND); | |||
| } | |||
| WxPayAccount payAccount = wxPayAccountService.getByIdFromRedis(cAppInfo.getPayId()); | |||
| if(payAccount == null){ | |||
| throw new MallinkException(ErrorCode.API_KEY_NOT_FOUND); | |||
| } | |||
| // 查询是否有已有的 | |||
| @@ -748,14 +749,13 @@ public class WxCardSpendServiceImpl implements WxCardSpendService { | |||
| } | |||
| // 3. get pay account | |||
| WxPayAccount payAccount = null; | |||
| WxPayAccount payAccountQ = new WxPayAccount(); | |||
| payAccountQ.updateTenantInfo(record); | |||
| try { | |||
| payAccount = payAccountMapper.selectOne(new QueryWrapper(payAccountQ)); | |||
| } catch (Exception e) { | |||
| logger.error("获取payAccount error: " + record.getTenantId()); | |||
| throw new MallinkException(ErrorCode.SYS_MCH_NOT_FOUND); | |||
| WxAppinfo cAppInfo = wxAppinfoService.getCAppInfoFromRedis(cardInfo.getTenantId(), EnumAppPlat.WX); | |||
| if(cAppInfo == null){ | |||
| throw new MallinkException(ErrorCode.APP_ID_NOT_FOUND); | |||
| } | |||
| WxPayAccount payAccount = wxPayAccountService.getByIdFromRedis(cAppInfo.getPayId()); | |||
| if(payAccount == null){ | |||
| throw new MallinkException(ErrorCode.API_KEY_NOT_FOUND); | |||
| } | |||
| // 4. 增加计算 | |||
| @@ -838,14 +838,13 @@ public class WxCardSpendServiceImpl implements WxCardSpendService { | |||
| } | |||
| // 3. get pay account | |||
| WxPayAccount payAccount = null; | |||
| WxPayAccount payAccountQ = new WxPayAccount(); | |||
| payAccountQ.updateTenantInfo(record); | |||
| try { | |||
| payAccount = payAccountMapper.selectOne(new QueryWrapper(payAccountQ)); | |||
| } catch (Exception e) { | |||
| logger.error("获取payAccount error: " + record.getTenantId()); | |||
| throw new MallinkException(ErrorCode.DB_FAIL.getCode(), "获取payAccount失败"); | |||
| WxAppinfo cAppInfo = wxAppinfoService.getCAppInfoFromRedis(cardInfo.getTenantId(), EnumAppPlat.WX); | |||
| if(cAppInfo == null){ | |||
| throw new MallinkException(ErrorCode.APP_ID_NOT_FOUND); | |||
| } | |||
| WxPayAccount payAccount = wxPayAccountService.getByIdFromRedis(cAppInfo.getPayId()); | |||
| if(payAccount == null){ | |||
| throw new MallinkException(ErrorCode.API_KEY_NOT_FOUND); | |||
| } | |||
| // 3. 补贴 | |||
| @@ -639,6 +639,7 @@ public class WxCouponChannelServiceImpl implements WxCouponChannelService { | |||
| wxCouponChannel.setStatus(EnumCouponChannelStatus.STATUS_THROW_IN.getCode()); | |||
| wxCouponChannel.setBeginTime(beginTime); | |||
| wxCouponChannel.setCouponId(couponid); | |||
| wxCouponChannel.setMakeMerchantId(wxCoupon.getMakeMerchantId()); | |||
| wxCouponChannel.setType(wxCoupon.getType()); | |||
| wxCouponChannel.setTargetAd(channelId); | |||
| wxCouponChannel.updateTenantInfo(tenantEntity); | |||
| @@ -826,7 +827,6 @@ public class WxCouponChannelServiceImpl implements WxCouponChannelService { | |||
| updChannel.setId(wxCouponChannel.getId()); | |||
| updChannel.updateTenantInfo(wxCouponChannel); | |||
| updChannel.setStatus(EnumCouponChannelStatus.STATUS_THROW_IN.getCode()); | |||
| updChannel.setTtSpuId(ttCouponChannelPoi.getSpuId()); | |||
| updChannel.setShowBeginTime(date); | |||
| updChannel.setUpdateDate(date); | |||
| wxCouponChannelMapper.updateById(updChannel); | |||
| @@ -1300,9 +1300,6 @@ public class WxCouponOrderServiceImpl implements WxCouponOrderService { | |||
| throw new MallinkException(ErrorCode.VERIFY_COUPON_ORDER_MERCHANT_IS_NULL); | |||
| } | |||
| merchantId = bUser.getMerchantId(); | |||
| //TODO 111111111查询核销商户的收款账户有没有配置 | |||
| //couponOrder.getm | |||
| } | |||
| if(merchantId != null){ | |||
| @@ -2186,7 +2183,10 @@ public class WxCouponOrderServiceImpl implements WxCouponOrderService { | |||
| int price = 0; | |||
| for (TenantEntity te:tenantEntitys) { | |||
| wxCouponOrder.updateTenantInfo(te); | |||
| price += wxCouponOrderMapper.queryPriceTotal(wxCouponOrder); | |||
| Integer mallPrice = wxCouponOrderMapper.queryPriceTotal(wxCouponOrder); | |||
| if(mallPrice != null){ | |||
| price += mallPrice; | |||
| } | |||
| } | |||
| wxCouponOrder.updateTenantInfo(tenantEntity); | |||
| return price; | |||
| @@ -33,6 +33,8 @@ import com.iformall.service.excel.WxPressDataExporter; | |||
| import com.iformall.service.pay.PayServiceFactory; | |||
| import com.iformall.service.pay.service.share.PayShareAdapterService; | |||
| import com.iformall.utils.Constant; | |||
| import com.iformall.utils.DateUtils; | |||
| import org.apache.commons.collections.CollectionUtils; | |||
| import org.apache.commons.lang3.StringUtils; | |||
| import org.slf4j.Logger; | |||
| @@ -102,6 +104,9 @@ public class WxCouponServiceImpl implements WxCouponService { | |||
| @Autowired | |||
| WxPayAccountMapper payAccountMapper; | |||
| @Autowired | |||
| WxPayAccountService payAccountService; | |||
| @Autowired | |||
| WxCouponOrderMapper wxCouponOrderMapper; | |||
| @@ -131,6 +136,8 @@ public class WxCouponServiceImpl implements WxCouponService { | |||
| @Autowired | |||
| private TtGoodsCategoryService ttGoodsCategoryService; | |||
| @Autowired | |||
| private TtMerchantPoiService ttMerchantPoiService; | |||
| @Autowired | |||
| WxAppinfoService wxAppinfoService; | |||
| @@ -353,7 +360,7 @@ public class WxCouponServiceImpl implements WxCouponService { | |||
| @Override | |||
| @Transactional(isolation=Isolation.SERIALIZABLE, propagation = Propagation.REQUIRED, rollbackFor = {Exception.class}) | |||
| public ResultData saveOrUpdate(WxCoupon record) { | |||
| //金额处理 | |||
| if (StringUtils.isNotEmpty(record.getSalePriceStr())) { | |||
| record.setSalePrice(new BigDecimal(record.getSalePriceStr()).multiply(new BigDecimal(100)).intValue()); | |||
| } | |||
| @@ -375,16 +382,36 @@ public class WxCouponServiceImpl implements WxCouponService { | |||
| if (StringUtils.isNotEmpty(record.getSubsidyNumStr())) { | |||
| record.setSubsidyNum(new BigDecimal(record.getSubsidyNumStr()).multiply(new BigDecimal(100)).intValue()); | |||
| } | |||
| // if (EnumCouponType.COUPON_DOUYIN.getCode().equals(record.getType())){ | |||
| // if(StringUtils.isBlank(record.getItemGroup())){ | |||
| // return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(),"团购详情不能为"); | |||
| // } | |||
| // try{ | |||
| // JSON.parseArray(record.getItemGroup()); | |||
| // }catch(Exception e){ | |||
| // return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(),"团购详情格式不正确"); | |||
| // } | |||
| // } | |||
| //补贴处理 | |||
| if(record.getSubsidyType() == null){ | |||
| record.setSubsidyType(EnumCouponSubsidyType.NO_SUBSIDY.getCode()); | |||
| } | |||
| if(record.getSubsidyNum() == null || record.getSubsidyNum().intValue() == 0){ | |||
| record.setSubsidyType(EnumCouponSubsidyType.NO_SUBSIDY.getCode()); | |||
| record.setSubsidyNum(0); | |||
| } | |||
| if (EnumCouponSubsidyType.WECHAT_COUPON.getCode().equals(record.getSubsidyType())) { | |||
| // 微信 立减 | |||
| if (record.getSubsidyNum() > record.getSalePrice()) { | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "补贴额大于售价"); | |||
| } | |||
| } else if (EnumCouponSubsidyType.OFFLINE_SUBSIDY.getCode().equals(record.getSubsidyType())) { | |||
| // 线下补贴 | |||
| int subsidy_num = record.getPrice() - record.getSalePrice(); | |||
| if (record.getSubsidyNum() > subsidy_num) { | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "补贴额大于面额与售价的差值"); | |||
| } | |||
| } else if (EnumCouponSubsidyType.WECHAT_MCHPAY.getCode().equals(record.getSubsidyType())) { | |||
| // TODO 微信转账到银行卡 | |||
| } | |||
| if (EnumCouponContentType.HTML.getCode().equals(record.getContentType())) { | |||
| if (StringUtils.isEmpty(record.getHtml())) { | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(), "请填写富文本内容"); | |||
| } | |||
| } | |||
| if (StringUtils.isBlank(record.getCoverPicture())) { | |||
| List<String> strList = new ArrayList<String>(); | |||
| if (StringUtils.isNotBlank(record.getCoverImg())) { | |||
| @@ -405,108 +432,50 @@ public class WxCouponServiceImpl implements WxCouponService { | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(), "请填写有效时间类型"); | |||
| } | |||
| if(!this.validCouponDate(record)) { | |||
| return new ResultData(ResultData.ERROR,"券有效使用日期必须在30天以内。"); | |||
| return new ResultData(ResultData.ERROR,"券有效结束日期必须在30天以内。"); | |||
| } | |||
| } | |||
| if(EnumCouponType.COUPON_GIFT.getCode().equals(record.getType()) && EnumCouponValidType.BETWEEN_TWO_TIME.getCode().equals(record.getValidType())){ | |||
| //券礼包时间判断 | |||
| WxCoupon couponQ = new WxCoupon(); | |||
| couponQ.updateTenantInfo(record); | |||
| List<Long> longs = JSON.parseArray(record.getGiftList(), Long.class); | |||
| if(longs != null && longs.size() > 0){ | |||
| couponQ.setIds(longs); | |||
| List<WxCoupon> list = wxCouponMapper.findList(couponQ); | |||
| if(list != null && list.size() > 0){ | |||
| for (WxCoupon wc:list) { | |||
| if(EnumCouponStatus.COUPON_STATUS_TAKE_OFFF.getCode().equals(wc.getStatus())){ | |||
| return new ResultData(ErrorCode.COUPON_IS_TAKE_OFF_GIFT); | |||
| } | |||
| if(EnumCouponValidType.BETWEEN_TWO_TIME.getCode().equals(wc.getValidType()) && wc.getValidEndDate().before(record.getValidEndDate())){ | |||
| return new ResultData(ErrorCode.COUPON_VALID_DATE_ERR_GIFT); | |||
| } | |||
| } | |||
| }else{ | |||
| return new ResultData(ErrorCode.COUPON_IS_EMPTY_GIFT); | |||
| } | |||
| }else{ | |||
| return new ResultData(ErrorCode.COUPON_IS_EMPTY_GIFT); | |||
| } | |||
| ResultData giftResult = this.validGiftCouponDate(record); | |||
| if(Result.SUCCESS != giftResult.code){ | |||
| return giftResult; | |||
| } | |||
| if (EnumCouponContentType.HTML.getCode().equals(record.getContentType())) { | |||
| if (StringUtils.isEmpty(record.getHtml())) { | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(), "请填写富文本内容"); | |||
| } | |||
| ResultData receiverResult = checkCouponMerchantReceiver(record); | |||
| if(Result.SUCCESS != receiverResult.code){ | |||
| return receiverResult; | |||
| } | |||
| List<WxMerchant> merchantList = (List<WxMerchant>) receiverResult.data; | |||
| ResultData resultData = checkCouponMerchantReceiver(record); | |||
| if(resultData.code != 200){ | |||
| return resultData; | |||
| if(merchantList.size() > 1){ | |||
| record.setBusiness(EnumBusiness.BUSINESS_ID6.getCode()); | |||
| }else{ | |||
| record.setBusiness(merchantList.get(0).getBusinessId()); | |||
| record.setSubBusiness(merchantList.get(0).getSubBusinessId()); | |||
| } | |||
| List<JSONObject> merchantParamList = JSONObject.parseArray(record.getMerchantParams(), JSONObject.class); | |||
| final IdWorker idWorker = IdWorker.get(); | |||
| if (record.getId() == null) { | |||
| // check 卡券补贴设置 | |||
| Integer subsidyType = record.getSubsidyType(); | |||
| Integer subsidyNum = record.getSubsidyNum(); | |||
| if(subsidyType != null && subsidyNum != null) { | |||
| if (subsidyType.equals(EnumCouponSubsidyType.WECHAT_COUPON.getCode())) { | |||
| // 微信 立减 | |||
| if (subsidyNum > record.getSalePrice()) { | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "补贴额大于售价"); | |||
| } | |||
| } else if (subsidyType.equals(EnumCouponSubsidyType.OFFLINE_SUBSIDY.getCode())) { | |||
| // 线下补贴 | |||
| int subsidy_num = record.getPrice() - record.getSalePrice(); | |||
| if (subsidyNum > subsidy_num) { | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "补贴额大于面额与售价的差值"); | |||
| } | |||
| } else if (subsidyType.equals(EnumCouponSubsidyType.WECHAT_MCHPAY.getCode())) { | |||
| // TODO 微信转账到银行卡 | |||
| } | |||
| } | |||
| record.setId(idWorker.nextId()); | |||
| if (merchantParamList != null && merchantParamList.size() > 0) { | |||
| List<WxCouponMerchantDto> wxCouponMerchantDtoList = new ArrayList<>(); | |||
| merchantParamList.forEach(merchantParam -> { | |||
| WxCouponMerchant cm = new WxCouponMerchant(); | |||
| WxCouponMerchantDto wxCouponMerchantDto = parseMerchantParam(merchantParam); | |||
| cm.setId(idWorker.nextId()); | |||
| cm.updateTenantInfo(record); | |||
| cm.setMerchantId(wxCouponMerchantDto.getMerchantId()); | |||
| cm.setParameter(wxCouponMerchantDto.getParameter()); | |||
| cm.setProductId(record.getId()); | |||
| cm.setCreateDate(new Date()); | |||
| cm.setUpdateDate(new Date()); | |||
| cm.setStatus(EnumCouponMerchantStatus.COUPON_MERCHANT_STATUS_VALID.getCode()); | |||
| wxCouponMerchantDtoList.add(wxCouponMerchantDto); | |||
| wxCouponMerchantMapper.insert(cm); | |||
| }); | |||
| if (wxCouponMerchantDtoList.stream() | |||
| .mapToInt(WxCouponMerchantDto::getBusiness).distinct().count() > 1) { | |||
| record.setBusiness(EnumBusiness.BUSINESS_ID6.getCode()); | |||
| } else if (wxCouponMerchantDtoList.size() > 1){ | |||
| record.setBusiness(wxCouponMerchantDtoList.get(0).getBusiness()); | |||
| } else { | |||
| record.setBusiness(wxCouponMerchantDtoList.get(0).getBusiness()); | |||
| record.setSubBusiness(wxCouponMerchantDtoList.get(0).getSubBusiness()); | |||
| } | |||
| } else{ | |||
| if (!EnumCouponType.COUPON_GIFT.getCode().equals(record.getType())){ | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); | |||
| } | |||
| record.setBusiness(EnumBusiness.BUSINESS_ID6.getCode()); | |||
| } | |||
| merchantParamList.forEach(merchantParam -> { | |||
| WxCouponMerchant cm = new WxCouponMerchant(); | |||
| WxCouponMerchantDto wxCouponMerchantDto = parseMerchantParam(merchantParam); | |||
| cm.setId(idWorker.nextId()); | |||
| cm.updateTenantInfo(record); | |||
| cm.setMerchantId(wxCouponMerchantDto.getMerchantId()); | |||
| cm.setParameter(wxCouponMerchantDto.getParameter()); | |||
| cm.setProductId(record.getId()); | |||
| cm.setCreateDate(new Date()); | |||
| cm.setUpdateDate(new Date()); | |||
| cm.setStatus(EnumCouponMerchantStatus.COUPON_MERCHANT_STATUS_VALID.getCode()); | |||
| wxCouponMerchantMapper.insert(cm); | |||
| }); | |||
| if (record.getPasswordSupport() != null && record.getPasswordSupport().equals(EnumCouponPasswordSupport.SUPPORTED.getCode())) { | |||
| // 如果用户启用卡密,生成数据并保存 | |||
| // todo 生成卡密无法修改, 调整 | |||
| couponPasswordService.mkPasswords(record, record.getId(), record.getInventory()); | |||
| } | |||
| @@ -515,23 +484,7 @@ public class WxCouponServiceImpl implements WxCouponService { | |||
| wxCouponMapper.insert(record); | |||
| } else { | |||
| if(EnumCouponSendType.GIFT.getCode().equals(record.getSendType())){ | |||
| //券礼包子券类型判断时间 | |||
| WxCoupon couponQ = new WxCoupon(); | |||
| couponQ.updateTenantInfo(record); | |||
| couponQ.setStatus(EnumCouponStatus.COUPON_STATUS_THROW_IN.getCode()); | |||
| couponQ.setGiftList(Long.toString(record.getId())); | |||
| List<WxCoupon> couponList = wxCouponMapper.findCouponList(couponQ); | |||
| if(couponList != null && couponList.size() > 0){ | |||
| for (WxCoupon wc:couponList) { | |||
| if(EnumCouponType.COUPON_GIFT.getCode().equals(wc.getType()) | |||
| && EnumCouponValidType.BETWEEN_TWO_TIME.getCode().equals(record.getValidType()) | |||
| && record.getValidEndDate().before(wc.getValidEndDate())){ | |||
| return new ResultData(ErrorCode.COUPON_VALID_DATE_ERR_GIFT); | |||
| } | |||
| } | |||
| } | |||
| } | |||
| if(record.getInventory() != null && record.getRemainInventory() != null) { | |||
| // 库存修改检查 | |||
| WxCoupon oldCoupon = wxCouponMapper.selectById(record.getId(),record.getTenantId()); | |||
| @@ -547,86 +500,44 @@ public class WxCouponServiceImpl implements WxCouponService { | |||
| record.setInventory(oldCoupon.getInventory() + record.getRemainInventory() - oldCoupon.getRemainInventory()); | |||
| } | |||
| } | |||
| if (merchantParamList != null && merchantParamList.size() > 0) { | |||
| WxCouponMerchant cmParam = new WxCouponMerchant(); | |||
| cmParam.updateTenantInfo(record); | |||
| cmParam.setProductId(record.getId()); | |||
| List<WxCouponMerchant> oldList = wxCouponMerchantMapper.findList(cmParam); | |||
| List<WxCouponMerchantDto> wxCouponMerchantDtoList = new ArrayList<>(); | |||
| merchantParamList.stream().forEach(merchantParam -> { | |||
| WxCouponMerchant cm = new WxCouponMerchant(); | |||
| WxCouponMerchantDto wxCouponMerchantDto = parseMerchantParam(merchantParam); | |||
| cm.updateTenantInfo(record); | |||
| cm.setMerchantId(wxCouponMerchantDto.getMerchantId()); | |||
| cm.setProductId(record.getId()); | |||
| WxCouponMerchant rcm = wxCouponMerchantMapper.selectOne(new QueryWrapper<>(cm)); | |||
| if (rcm != null) { | |||
| rcm.setParameter(wxCouponMerchantDto.getParameter()); | |||
| rcm.setStatus(EnumCouponMerchantStatus.COUPON_MERCHANT_STATUS_VALID.getCode()); | |||
| rcm.setUpdateDate(new Date()); | |||
| wxCouponMerchantMapper.updateById(rcm); | |||
| }else { | |||
| cm.setId(idWorker.nextId()); | |||
| cm.setStatus(EnumCouponMerchantStatus.COUPON_MERCHANT_STATUS_VALID.getCode()); | |||
| cm.setParameter(wxCouponMerchantDto.getParameter()); | |||
| cm.setCreateDate(new Date()); | |||
| cm.setUpdateDate(new Date()); | |||
| wxCouponMerchantMapper.insert(cm); | |||
| } | |||
| wxCouponMerchantDtoList.add(wxCouponMerchantDto); | |||
| oldList.removeIf( | |||
| old->old.getProductId().equals(record.getId()) && | |||
| old.getMerchantId().equals(wxCouponMerchantDto.getMerchantId())); | |||
| }); | |||
| oldList.stream().forEach(old->{ | |||
| old.setStatus(EnumCouponMerchantStatus.COUPON_MERCHANT_STATUS_INVALID.getCode()); | |||
| old.setUpdateDate(new Date()); | |||
| wxCouponMerchantMapper.updateById(old); | |||
| }); | |||
| if (wxCouponMerchantDtoList.stream() | |||
| .mapToInt(WxCouponMerchantDto::getBusiness).distinct().count() > 1) { | |||
| record.setBusiness(EnumBusiness.BUSINESS_ID6.getCode()); | |||
| } else if (wxCouponMerchantDtoList.size() > 1){ | |||
| record.setBusiness(wxCouponMerchantDtoList.get(0).getBusiness()); | |||
| } else { | |||
| record.setBusiness(wxCouponMerchantDtoList.get(0).getBusiness()); | |||
| record.setSubBusiness(wxCouponMerchantDtoList.get(0).getSubBusiness()); | |||
| } | |||
| } | |||
| if (record.getStatus() != null && | |||
| (record.getStatus().equals(EnumCouponStatus.COUPON_STATUS_TAKE_OFFF.getCode()))) { | |||
| //下架所有投放频道 | |||
| wxCouponChannelService.updateStatusByCouponId(record.getId(), record, EnumCouponChannelStatus.STATUS_TAKE_OFFF.getCode()); | |||
| //下架所有场景投放 | |||
| wxCouponSendService.updateStatusByCouponId(record.getId(), record, EnumCouponSendStatus.INVALID.getCode()); | |||
| //下架所有已砍价券 | |||
| wxOrderService.updateStatusByPressCouponId(record.getId(), record, EnumOrderStatus.ORDER_STATUS_PRESS_CANCEL.getCode()); | |||
| //下架所有相关广告 | |||
| wxScreenAdService.updateStatusByCouponId(record.getId(), record, EnumScreenAdStatus.INVALID.getCode()); | |||
| //下架拼团券 | |||
| wxOrderService.updateOrderGroupStatusByCouponId(record.getId(), record, EnumOrderStatus.ORDER_STATUS_COOPERATING_CANCEL.getCode()); | |||
| // 卡下架后,转赠找不到卡相关信息,所以修改卡转赠状态为不可转赠 | |||
| wxCardInfoMapper.updateTransferStatusByCouponId(record.getId()); | |||
| // 卡券下架,未使用的卡密要下架 | |||
| couponPasswordMapper.disableByCouponId(record.getId()); | |||
| WxCouponMerchant cmParam = new WxCouponMerchant(); | |||
| cmParam.updateTenantInfo(record); | |||
| cmParam.setProductId(record.getId()); | |||
| List<WxCouponMerchant> oldList = wxCouponMerchantMapper.findList(cmParam); | |||
| merchantParamList.stream().forEach(merchantParam -> { | |||
| WxCouponMerchant cm = new WxCouponMerchant(); | |||
| WxCouponMerchantDto wxCouponMerchantDto = parseMerchantParam(merchantParam); | |||
| cm.updateTenantInfo(record); | |||
| cm.setMerchantId(wxCouponMerchantDto.getMerchantId()); | |||
| cm.setProductId(record.getId()); | |||
| WxCouponMerchant rcm = wxCouponMerchantMapper.selectOne(new QueryWrapper<>(cm)); | |||
| if (rcm != null) { | |||
| rcm.setParameter(wxCouponMerchantDto.getParameter()); | |||
| rcm.setStatus(EnumCouponMerchantStatus.COUPON_MERCHANT_STATUS_VALID.getCode()); | |||
| rcm.setUpdateDate(new Date()); | |||
| wxCouponMerchantMapper.updateById(rcm); | |||
| }else { | |||
| cm.setId(idWorker.nextId()); | |||
| cm.setStatus(EnumCouponMerchantStatus.COUPON_MERCHANT_STATUS_VALID.getCode()); | |||
| cm.setParameter(wxCouponMerchantDto.getParameter()); | |||
| cm.setCreateDate(new Date()); | |||
| cm.setUpdateDate(new Date()); | |||
| wxCouponMerchantMapper.insert(cm); | |||
| } | |||
| oldList.removeIf( | |||
| old->old.getProductId().equals(record.getId()) && | |||
| old.getMerchantId().equals(wxCouponMerchantDto.getMerchantId())); | |||
| }); | |||
| oldList.stream().forEach(old->{ | |||
| old.setStatus(EnumCouponMerchantStatus.COUPON_MERCHANT_STATUS_INVALID.getCode()); | |||
| old.setUpdateDate(new Date()); | |||
| wxCouponMerchantMapper.updateById(old); | |||
| }); | |||
| } | |||
| record.setUpdateDate(new Date()); | |||
| wxCouponMapper.updateById(record); | |||
| try{ | |||
| if(EnumCouponStatus.COUPON_STATUS_TAKE_OFFF.getCode().equals(record.getStatus())){ | |||
| //同步抖音状态 | |||
| wxCouponChannelService.spuStatusSyncByCoupon(record,record.getId()); | |||
| } | |||
| }catch(Exception e){ | |||
| logger.error("send spuStatusSync error: " + e.getMessage()); | |||
| } | |||
| } | |||
| //清空缓存 | |||
| @@ -636,101 +547,99 @@ public class WxCouponServiceImpl implements WxCouponService { | |||
| private ResultData checkCouponMerchantReceiver(WxCoupon record){ | |||
| List<JSONObject> merchantParamList = JSONObject.parseArray(record.getMerchantParams(), JSONObject.class); | |||
| // if(EnumCouponType.COUPON_GIFT.getCode().equals(record.getType())){ | |||
| // return new ResultData(); | |||
| // } | |||
| if(merchantParamList == null || merchantParamList.isEmpty()){ | |||
| return new ResultData(); | |||
| return new ResultData(ErrorCode.MERCHANT_INFO_NOT_FOUND.getCode(),"所属商户为空"); | |||
| } | |||
| List<Long> merchantIds = new ArrayList<>(); | |||
| for (JSONObject o:merchantParamList) { | |||
| merchantIds.add(o.getLong("id")); | |||
| } | |||
| WxMerchant merchantQ = new WxMerchant(); | |||
| merchantQ.updateTenantInfo(record); | |||
| merchantQ.setIds(merchantIds); | |||
| List<WxMerchant> merchantList = wxMerchantService.findList(merchantQ); | |||
| if(merchantList.size() != merchantParamList.size()){ | |||
| return new ResultData(ErrorCode.MERCHANT_INFO_NOT_EQUAL.getCode(),"所属商户信息异常"); | |||
| } | |||
| List<WxMerchant> badMerchant = merchantList.stream().filter(m -> !EnumMerchantStatus.VALID.getCode().equals(m.getStatus())).collect(toList()); | |||
| if(badMerchant != null && !badMerchant.isEmpty()){ | |||
| List<String> badNames = badMerchant.stream().map(WxMerchant::getName).collect(toList()); | |||
| return new ResultData(ErrorCode.MERCHANT_INFO_NOT_VALID.getCode(),JSONArray.toJSONString(badNames)+"被停用"); | |||
| } | |||
| if(record.getSalePrice() != null && record.getSalePrice() > 0) { | |||
| WxAppinfo cAppInfo = wxAppinfoService.getCouponAppInfo(record); | |||
| EnumAppPlat plat = EnumCouponType.getAppPlat(record.getType()); | |||
| EnumPayWay payWay = EnumAppPlat.getPayWay(plat); | |||
| WxAppinfo cAppInfo = wxAppinfoService.getCAppInfo(record,plat); | |||
| if (cAppInfo == null) { | |||
| return new ResultData(ErrorCode.APP_ID_NOT_FOUND); | |||
| } | |||
| EnumAppPlat plat = EnumAppPlat.WX; | |||
| EnumAppPlat platEnum = EnumAppPlat.getByCode(cAppInfo.getPlat()); | |||
| if (platEnum != null) { | |||
| plat = platEnum; | |||
| } | |||
| EnumPayWay payWay = EnumPayWay.PAY_WAY_WECHAT; | |||
| if(EnumAppPlat.TOUTIAO.equals(plat)){ | |||
| payWay = EnumPayWay.PAY_WAY_TT; | |||
| } | |||
| WxPayAccount payAccount = payAccountMapper.selectById(cAppInfo.getPayId()); | |||
| if (payAccount == null) { | |||
| return new ResultData(ErrorCode.APP_ID_NOT_FOUND); | |||
| } | |||
| EnumPayMchType payMchType = EnumPayMchType.TOTAL; | |||
| EnumPayShare isShare = EnumPayShare.NO; | |||
| EnumPayMchType payMchTypeEnum = EnumPayMchType.getEnum(payAccount.getMchType()); | |||
| if (payMchTypeEnum != null) { | |||
| payMchType = payMchTypeEnum; | |||
| } | |||
| if (EnumPayMchType.DIRECT.equals(payMchType)) { | |||
| isShare = EnumPayShare.NO; | |||
| } else { | |||
| EnumPayShare paySHareEnum = EnumPayShare.getEnum(payAccount.getShare()); | |||
| if (paySHareEnum != null) { | |||
| isShare = paySHareEnum; | |||
| //判断商户是否匹配poi | |||
| if (EnumAppPlat.TOUTIAO.equals(plat)) { | |||
| List<String> badPoiNames = new ArrayList(); | |||
| for (WxMerchant merchant:merchantList) { | |||
| TtMerchantPoi byId = ttMerchantPoiService.getById(merchant.getId()); | |||
| if(byId == null || !EnumSupplierMathStatus.match_success.getCode().equals(byId.getMatchStatus())){ | |||
| badPoiNames.add(merchant.getName()); | |||
| } | |||
| } | |||
| if(!badPoiNames.isEmpty()){ | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(), JSONArray.toJSONString(badPoiNames)+"未匹配poi"); | |||
| } | |||
| } | |||
| EnumPayMchType payMchType = EnumPayMchType.getEnum(payAccount.getMchType()); | |||
| EnumPayShare isShare = EnumPayShare.getEnum(payAccount.getShare()); | |||
| PayShareAdapterService payShareServie = payServiceFactory.getPayShareAdapterService(payWay.getCode(),payAccount.getPayVersion()); | |||
| List<Long> merchantIds = new ArrayList<>(); | |||
| for (JSONObject o:merchantParamList) { | |||
| merchantIds.add(o.getLong("id")); | |||
| } | |||
| WxMerchant merchantQ = new WxMerchant(); | |||
| merchantQ.updateTenantInfo(record); | |||
| merchantQ.setIds(merchantIds); | |||
| Map<Long, String> idAndNamesMap = wxMerchantService.getIdAndNamesMap(merchantQ); | |||
| if (EnumPayMchType.DIRECT.equals(payMchType)) { | |||
| Long merchantId = null; | |||
| if (merchantIds.size() > 1) { | |||
| WxMerchant merchantQ2 = new WxMerchant(); | |||
| merchantQ2.updateTenantInfo(record); | |||
| merchantQ2.setIds(merchantIds); | |||
| merchantQ2.setIsAdmin(EnumMerchantAdmin.PUBLIC_ADMIN.getCode()); | |||
| merchantQ2.setStatus(EnumMerchantStatus.VALID.getCode()); | |||
| List<Long> list = wxMerchantMapper.findIdList(merchantQ2); | |||
| if(list == null || list.isEmpty()){ | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(), "直连模式多门店券需包含一个商管商户"); | |||
| }else if(list.size() > 1){ | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(), "直连模式多门店券只能包含一个商管商户"); | |||
| WxMerchant makeMerchant = null; | |||
| if(merchantList.size() == 1){ | |||
| record.setMerchantType(EnumCouponMerchantType.ONE_MERCHANT.getCode()); | |||
| makeMerchant = merchantList.get(0); | |||
| }else{ | |||
| List<WxMerchant> adminMerchant = merchantList.stream().filter(m -> EnumMerchantAdmin.PUBLIC_ADMIN.getCode().equals(m.getIsAdmin())).collect(toList()); | |||
| if(adminMerchant == null || adminMerchant.isEmpty()){ | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(), "多门店券需包含一个商管商户"); | |||
| }else if(adminMerchant.size() > 1){ | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(), "多门店券只能包含一个商管商户"); | |||
| } | |||
| record.setMerchantType(EnumCouponMerchantType.MULTIPLE_MERCHANT.getCode()); | |||
| merchantId = list.get(0); | |||
| }else{ | |||
| record.setMerchantType(EnumCouponMerchantType.ONE_MERCHANT.getCode()); | |||
| merchantId = merchantIds.get(0); | |||
| makeMerchant = adminMerchant.get(0); | |||
| } | |||
| record.setMakeMerchantId(merchantId); | |||
| WxProfitSharingReceiver receiver = payShareServie.getReceiver(payAccount, merchantId, null, payMchTypeEnum.getCode()); | |||
| record.setMakeMerchantId(makeMerchant.getId()); | |||
| WxProfitSharingReceiver receiver = payShareServie.getReceiver(payAccount, makeMerchant.getId(), null, payMchType.getCode()); | |||
| if (receiver == null) { | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(), "["+idAndNamesMap.get(merchantId)+"]未配置收款账户"); | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(), "[\""+makeMerchant.getName()+"\"]未配置收款账户"); | |||
| } | |||
| if (EnumAppPlat.TOUTIAO.equals(plat)) { | |||
| if (!MerchantImportStatus.improt_success.getCode().equals(receiver.getWxImportStatus()) | |||
| && !MerchantImportStatus.improt_success.getCode().equals(receiver.getAlipayImportStatus()) | |||
| && !MerchantImportStatus.improt_success.getCode().equals(receiver.getHzImportStatus())) { | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(), "["+idAndNamesMap.get(merchantId)+"]未配置收款账户"); | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(), "[\""+makeMerchant.getName()+"\"]未配置收款账户"); | |||
| } | |||
| } | |||
| } else if (EnumPayShare.YES.equals(isShare)) { | |||
| List<String> merchantNames = new ArrayList(); | |||
| for (Long merchantId:merchantIds) { | |||
| WxProfitSharingReceiver receiver = payShareServie.getReceiver(payAccount, merchantId, null, payMchTypeEnum.getCode()); | |||
| List<String> badNames = new ArrayList(); | |||
| for (WxMerchant merchant:merchantList) { | |||
| WxProfitSharingReceiver receiver = payShareServie.getReceiver(payAccount, merchant.getId(), null, payMchType.getCode()); | |||
| if (receiver == null) { | |||
| merchantNames.add(idAndNamesMap.get(merchantId)); | |||
| badNames.add(merchant.getName()); | |||
| continue; | |||
| // return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(), "第(" + n + ")个商户还未配置分账账户或未进件"); | |||
| } | |||
| if (EnumAppPlat.TOUTIAO.equals(plat)) { | |||
| QueryMerchantResult openPayResult = payAccount.getOpenPayResult(); | |||
| if(!EnumYesOrNo.YES.getCode().equals(openPayResult.getAlipay()) | |||
| && !EnumYesOrNo.YES.getCode().equals(openPayResult.getWx()) | |||
| && !EnumYesOrNo.YES.getCode().equals(openPayResult.getHz())){ | |||
| @@ -738,30 +647,27 @@ public class WxCouponServiceImpl implements WxCouponService { | |||
| } | |||
| if(EnumYesOrNo.YES.getCode().equals(openPayResult.getAlipay()) | |||
| && !MerchantImportStatus.improt_success.getCode().equals(receiver.getAlipayImportStatus())){ | |||
| merchantNames.add(idAndNamesMap.get(merchantId)); | |||
| badNames.add(merchant.getName()); | |||
| continue; | |||
| // return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(), "["+idAndNamesMap.get(merchantId)+"]未进件支付宝"); | |||
| } | |||
| if(EnumYesOrNo.YES.getCode().equals(openPayResult.getWx()) | |||
| && !MerchantImportStatus.improt_success.getCode().equals(receiver.getWxImportStatus())){ | |||
| merchantNames.add(idAndNamesMap.get(merchantId)); | |||
| badNames.add(merchant.getName()); | |||
| continue; | |||
| // return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(), "["+idAndNamesMap.get(merchantId)+"]未进件微信"); | |||
| } | |||
| if(EnumYesOrNo.YES.getCode().equals(openPayResult.getHz()) | |||
| && !MerchantImportStatus.improt_success.getCode().equals(receiver.getHzImportStatus())){ | |||
| merchantNames.add(idAndNamesMap.get(merchantId)); | |||
| badNames.add(merchant.getName()); | |||
| continue; | |||
| // return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(), "["+idAndNamesMap.get(merchantId)+"]未进件抖音"); | |||
| } | |||
| } | |||
| } | |||
| if(!merchantNames.isEmpty()){ | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(), JSONArray.toJSONString(merchantNames)+"未配置分账账户"); | |||
| if(!badNames.isEmpty()){ | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(), JSONArray.toJSONString(badNames)+"未配置分账账户"); | |||
| } | |||
| } | |||
| } | |||
| return new ResultData(); | |||
| return new ResultData(merchantList); | |||
| } | |||
| @Override | |||
| @@ -1232,33 +1138,75 @@ public class WxCouponServiceImpl implements WxCouponService { | |||
| return new ResultData(); | |||
| } | |||
| //有价券开启了分账,必须在30天以内。,停车券,积分券,积分停车券,卡无次限制 | |||
| /** | |||
| * 1.有价券 | |||
| * 2.微信 | |||
| * 3.分账 (因微信支付线上分账30天限制) 需要限制有效期30天 | |||
| * @param wxCoupon | |||
| * @return boolean 有效期结束时间需要当前时间的30天限制 验证是否通过 | |||
| */ | |||
| @Override | |||
| public boolean validCouponDate(WxCoupon wxCoupon) { | |||
| if(wxCoupon.getType().equals(EnumCouponType.COUPON_DOUYIN.getCode())){ | |||
| if(wxCoupon.checkIsFree()){ | |||
| return true; | |||
| } | |||
| if(wxCoupon.getSalePrice() == 0){ | |||
| if(!EnumCouponType.getWeiXinType().contains(wxCoupon.getType())){ | |||
| return true; | |||
| } | |||
| if(wxCoupon.checkIsCard()){ | |||
| if(EnumCouponType.getPlatType().contains(wxCoupon.getType())){ | |||
| return true; | |||
| } | |||
| EnumPayShare isShare = EnumPayShare.NO; | |||
| WxAppinfo appinfo = wxAppinfoService.getCouponAppInfo(wxCoupon); | |||
| if (null == appinfo) { | |||
| throw new MallinkException(ErrorCode.SYS_SERVER_ERROR.getCode(), "券未查询到appInfo"); | |||
| WxPayAccount payAccount = payAccountService.getPayAccount(wxCoupon, EnumAppPlat.WX); | |||
| if(payAccount == null){ | |||
| throw new MallinkException(ErrorCode.SYS_PARAMETER_ERROR.getCode(), "未找到支付配置"); | |||
| } | |||
| WxPayAccount payAccount = payAccountMapper.selectById(appinfo.getPayId()); | |||
| EnumPayShare paySHareEnum = EnumPayShare.getEnum(payAccount.getShare()); | |||
| if (paySHareEnum != null) { | |||
| isShare = paySHareEnum; | |||
| if(EnumPayShare.YES.getCode().equals(payAccount.getShare())){ | |||
| Date now = new Date(); | |||
| Date realValidDate = wxCoupon.getOuterRealValidDate(now); | |||
| Date limit_date = DateUtils.getTimeAfterDays(Constant.WX_LIMIT_DAYS, now); | |||
| if (realValidDate.after(limit_date)) { | |||
| return false; | |||
| } | |||
| } | |||
| if (EnumPayShare.YES.equals(isShare)) { | |||
| return wxCoupon.validDate(true,new Date()); | |||
| }else{ | |||
| return wxCoupon.validDate(false,new Date()); | |||
| return true; | |||
| } | |||
| /** | |||
| * 礼包券判断子券有效期 | |||
| * @param wxCoupon | |||
| * @return | |||
| */ | |||
| @Override | |||
| public ResultData validGiftCouponDate(WxCoupon wxCoupon){ | |||
| if(!EnumCouponType.COUPON_GIFT.getCode().equals(wxCoupon.getType())){ | |||
| return new ResultData(); | |||
| } | |||
| //获取子券 | |||
| List<Long> giftIds = JSON.parseArray(wxCoupon.getGiftList(), Long.class); | |||
| if(giftIds == null || giftIds.isEmpty()){ | |||
| return new ResultData(ErrorCode.COUPON_IS_EMPTY_GIFT.getCode(),"未添加子券"); | |||
| } | |||
| WxCoupon couponQ = new WxCoupon(); | |||
| couponQ.updateTenantInfo(wxCoupon); | |||
| couponQ.setIds(giftIds); | |||
| List<WxCoupon> giftList = wxCouponMapper.findList(couponQ); | |||
| if(giftList == null || giftList.isEmpty()){ | |||
| throw new MallinkException(ErrorCode.COUPON_IS_EMPTY_GIFT.getCode(), "未找到相应子券"); | |||
| } | |||
| for (WxCoupon gift:giftList) { | |||
| if(EnumCouponStatus.COUPON_STATUS_TAKE_OFFF.getCode().equals(gift.getStatus())){ | |||
| return new ResultData(ErrorCode.COUPON_IS_TAKE_OFF_GIFT.getCode(),"存在已作废的子券"); | |||
| } | |||
| if(EnumCouponValidType.BETWEEN_TWO_TIME.getCode().equals(wxCoupon.getValidType()) | |||
| && EnumCouponValidType.BETWEEN_TWO_TIME.getCode().equals(gift.getValidType()) | |||
| && gift.getValidEndDate().before(wxCoupon.getValidEndDate())){ | |||
| return new ResultData(ErrorCode.COUPON_VALID_DATE_ERR_GIFT); | |||
| } | |||
| } | |||
| return new ResultData(); | |||
| } | |||
| @Override | |||
| @@ -1341,4 +1289,35 @@ public class WxCouponServiceImpl implements WxCouponService { | |||
| return merchantList; | |||
| } | |||
| @Override | |||
| @Transactional(isolation=Isolation.SERIALIZABLE, propagation = Propagation.REQUIRED, rollbackFor = {Exception.class}) | |||
| public ResultData disable(TenantEntity tenantInfo, Long couponId) { | |||
| WxCoupon couponUpd = new WxCoupon(); | |||
| couponUpd.updateTenantInfo(tenantInfo); | |||
| couponUpd.setId(couponId); | |||
| couponUpd.setStatus(EnumCouponStatus.COUPON_STATUS_TAKE_OFFF.getCode()); | |||
| couponUpd.setUpdateDate(new Date()); | |||
| int upd = wxCouponMapper.updateById(couponUpd); | |||
| if(upd == 1){ | |||
| //下架所有投放频道 | |||
| wxCouponChannelService.updateStatusByCouponId(couponId, tenantInfo, EnumCouponChannelStatus.STATUS_TAKE_OFFF.getCode()); | |||
| //下架所有场景投放 | |||
| wxCouponSendService.updateStatusByCouponId(couponId, tenantInfo, EnumCouponSendStatus.INVALID.getCode()); | |||
| //下架所有已砍价券 | |||
| wxOrderService.updateStatusByPressCouponId(couponId, tenantInfo, EnumOrderStatus.ORDER_STATUS_PRESS_CANCEL.getCode()); | |||
| //下架所有相关广告 | |||
| wxScreenAdService.updateStatusByCouponId(couponId, tenantInfo, EnumScreenAdStatus.INVALID.getCode()); | |||
| //下架拼团券 | |||
| wxOrderService.updateOrderGroupStatusByCouponId(couponId, tenantInfo, EnumOrderStatus.ORDER_STATUS_COOPERATING_CANCEL.getCode()); | |||
| // 卡下架后,转赠找不到卡相关信息,所以修改卡转赠状态为不可转赠 | |||
| wxCardInfoMapper.updateTransferStatusByCouponId(couponId); | |||
| // 卡券下架,未使用的卡密要下架 | |||
| couponPasswordMapper.disableByCouponId(couponId); | |||
| //同步抖音状态 | |||
| wxCouponChannelService.spuStatusSyncByCoupon(tenantInfo,couponId); | |||
| } | |||
| return new ResultData(); | |||
| } | |||
| } | |||
| @@ -18,6 +18,7 @@ import com.iformall.exception.MallinkException; | |||
| import com.iformall.mapper.*; | |||
| import com.iformall.service.*; | |||
| import com.iformall.utils.CreditUtil; | |||
| import com.iformall.utils.DateUtils; | |||
| import com.iformall.utils.RedisLock; | |||
| import com.iformall.utils.UserUtil; | |||
| import lombok.extern.slf4j.Slf4j; | |||
| @@ -98,6 +99,9 @@ public class WxCreditHistoryServiceImpl implements WxCreditHistoryService { | |||
| @Autowired | |||
| private WxTemplateMsgService wxTemplateMsgService; | |||
| @Autowired | |||
| private WxMemberCardService wxMemberCardService; | |||
| @Override | |||
| public void clearCreditByYear() { | |||
| WxScoreRules wxScoreRules = new WxScoreRules(); | |||
| @@ -121,6 +125,20 @@ public class WxCreditHistoryServiceImpl implements WxCreditHistoryService { | |||
| } | |||
| @Override | |||
| public void syncClearCredit(TenantEntity tenantInfo) { | |||
| WxCreditHistory creditHistoryQ = new WxCreditHistory(); | |||
| creditHistoryQ.setTenantId(tenantInfo.getFinalTenantId()); | |||
| creditHistoryQ.setCreditType(EnumScoreType.CLEAN_CREDIT.getCode()); | |||
| String beforeYesterday = DateUtils.getTimeBefore(2, new Date()); | |||
| Date date = DateUtils.stringToDate(beforeYesterday); | |||
| creditHistoryQ.setStartTime(date); | |||
| List<WxCreditHistory> list = wxCreditHistoryMapper.getIsMemberCarAndClearCredit(creditHistoryQ); | |||
| for (WxCreditHistory history:list) { | |||
| wxMemberCardService.sendsyncMemberCardBonusMsg(tenantInfo,null,history.getCUserId(),history.getId()); | |||
| } | |||
| } | |||
| @Override | |||
| public void exportData(HttpServletRequest request, HttpServletResponse response, WxCreditHistory wxCreditHistory) { | |||
| PageInfo<WxCreditHistoryVo> wxCreditHistoryVoList = findListMorePage(wxCreditHistory,0,50000); | |||
| @@ -546,8 +564,8 @@ public class WxCreditHistoryServiceImpl implements WxCreditHistoryService { | |||
| // } | |||
| @Override | |||
| public WxCreditHistory getById(Long id,String tenantId) { | |||
| return wxCreditHistoryMapper.selectById(id,tenantId); | |||
| public WxCreditHistory getById(Long id,String finalTenantId) { | |||
| return wxCreditHistoryMapper.selectById(id,finalTenantId); | |||
| } | |||
| @Override | |||
| @@ -629,6 +647,12 @@ public class WxCreditHistoryServiceImpl implements WxCreditHistoryService { | |||
| //发消息 | |||
| sendCreditUpdRemind(wxCUserBasicInfo,record,tenantId); | |||
| TenantEntity tenantEntity = new TenantEntity(); | |||
| tenantEntity.setTenantId(tenantId); | |||
| if(!record.getTenantId().equals(tenantId)){ | |||
| tenantEntity.setParentTenantId(record.getTenantId()); | |||
| } | |||
| wxMemberCardService.sendsyncMemberCardBonusMsg(tenantEntity,null,wxCUserBasicInfo.getId(),record.getId()); | |||
| } else { | |||
| @@ -646,15 +670,15 @@ public class WxCreditHistoryServiceImpl implements WxCreditHistoryService { | |||
| temp.setType(EnumTemplateType.CREDIT_UPD_REMIND.getCode()); | |||
| temp = wxTemplateMsgService.getByObj(temp); | |||
| if(temp.getId() != null){ | |||
| List<String> openIds = wxCUserMapper.findOpenIdList(wxCUserBasicInfo.getId(),tenantId); | |||
| if(openIds != null && openIds.size() > 0){ | |||
| String openId = wxCUserMapper.findOpenId(wxCUserBasicInfo.getId(),tenantId); | |||
| if(StringUtils.isNotBlank(openId)){ | |||
| WxMsg msg = new WxMsg(); | |||
| // msg.updateTenantInfo(record); | |||
| msg.setTenantId(tenantId); | |||
| // msg.setWay(EnumSendWay.APPINFOR.getCode()); | |||
| // msg.setIsright(EnumMsgSend.MSG_SEND_IMMEDIATELY.getCode()); | |||
| // msg.setStatus(EnumMsgStatus.MSG_STATUS_NOT_SEND.getCode()); | |||
| msg.setPhones(String.join(",", openIds)); | |||
| msg.setPhones(openId); | |||
| msg.setModelId(temp.getId()); | |||
| Map<String,String> map = new HashMap<>(); | |||
| map.put("character_string1",record.getCreditNum().toString()); | |||
| @@ -392,6 +392,7 @@ public class WxGameServiceImpl implements WxGameService { | |||
| wxCouponChannel.setEndTime(record.getValidEndDate()); | |||
| wxCouponChannel.setStatus(EnumCouponChannelStatus.STATUS_THROW_IN.getCode()); | |||
| wxCouponChannel.setCouponId(couponId); | |||
| wxCouponChannel.setMakeMerchantId(wxCoupon.getMakeMerchantId()); | |||
| wxCouponChannel.setType(wxCoupon.getType()); | |||
| wxCouponChannel.setTargetAd(EnumCouponChannelType.COUPON_CHANNEL_ID_GAME.getCode()); | |||
| wxCouponChannel.updateTenantInfo(wxCoupon); | |||
| @@ -0,0 +1,317 @@ | |||
| package com.iformall.service.impl; | |||
| import com.alibaba.fastjson.JSON; | |||
| import com.github.binarywang.wxpay.bean.businesscircle.MemberCardAuthorizeResult; | |||
| import com.github.binarywang.wxpay.bean.membercard.MemberCardResult; | |||
| import com.github.binarywang.wxpay.bean.membercard.MemberCardRightsRequest; | |||
| import com.github.binarywang.wxpay.bean.membercard.MemberCardUpdRequest; | |||
| import com.github.binarywang.wxpay.exception.WxPayException; | |||
| import com.github.binarywang.wxpay.service.WxPayService; | |||
| import com.github.pagehelper.PageHelper; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.common.ErrorCode; | |||
| import com.iformall.common.IdWorker; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.domain.po.*; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import com.iformall.domain.po.msg.AfterAddCreditMsg; | |||
| import com.iformall.domain.po.msg.AfterAddScoreMsg; | |||
| import com.iformall.domain.po.msg.FmInsideCLoginMsg; | |||
| import com.iformall.domain.po.msg.SyncMemberCardMsg; | |||
| import com.iformall.enums.*; | |||
| import com.iformall.mapper.WxMemberCardMapper; | |||
| import com.iformall.mq.MqBaseProducer; | |||
| import com.iformall.service.*; | |||
| import com.iformall.utils.DateUtils; | |||
| import com.iformall.utils.MaUtil; | |||
| import org.apache.commons.lang3.StringUtils; | |||
| import org.slf4j.Logger; | |||
| import org.slf4j.LoggerFactory; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.stereotype.Service; | |||
| import java.util.Date; | |||
| import java.util.List; | |||
| @Service | |||
| public class WxMemberCardServiceImpl implements WxMemberCardService { | |||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||
| @Autowired | |||
| WxMemberCardMapper wxMemberCardMapper; | |||
| @Autowired | |||
| WxAppinfoService wxAppinfoService; | |||
| @Autowired | |||
| WxPayAccountService wxPayAccountService; | |||
| @Autowired | |||
| WxCUserBasicInfoService wxCUserBasicInfoService; | |||
| @Autowired | |||
| private MqBaseProducer mqBaseProducer; | |||
| @Autowired | |||
| MaUtil maUtil; | |||
| @Override | |||
| public PageInfo<WxMemberCard> listAsPage(WxMemberCard record, Integer pageIndex, Integer pageSize) { | |||
| return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxMemberCardMapper.findList(record)); | |||
| } | |||
| @Override | |||
| public ResultData saveorupdate(WxMemberCard record) { | |||
| Date now = new Date(); | |||
| if(record.getId() == null){ | |||
| final IdWorker idWorker = IdWorker.get(); | |||
| record.setId(idWorker.nextId()); | |||
| record.setCreateDate(now); | |||
| record.setUpdateDate(now); | |||
| wxMemberCardMapper.insert(record); | |||
| }else{ | |||
| record.setUpdateDate(now); | |||
| wxMemberCardMapper.updateById(record); | |||
| } | |||
| return new ResultData(); | |||
| } | |||
| @Override | |||
| public ResultData saveorupdateByCode(WxMemberCard record) { | |||
| Long id = wxMemberCardMapper.getIdByCode(record); | |||
| Date now = new Date(); | |||
| if(id == null){ | |||
| final IdWorker idWorker = IdWorker.get(); | |||
| id = idWorker.nextId(); | |||
| record.setId(id); | |||
| if(record.getCreateDate() == null){ | |||
| record.setCreateDate(now); | |||
| } | |||
| record.setUpdateDate(record.getCreateDate()); | |||
| wxMemberCardMapper.insert(record); | |||
| if(record.getCuserId() != null){ | |||
| TenantEntity tenantEntity = new TenantEntity(); | |||
| tenantEntity.setTenantId(record.getTenantId()); | |||
| tenantEntity.setParentTenantId(record.getParentTenantId()); | |||
| this.sendsyncMemberCardBonusMsg(tenantEntity,record.getCuserId(),null,null); | |||
| } | |||
| }else{ | |||
| record.setId(id); | |||
| if(record.getUpdateDate() == null){ | |||
| record.setUpdateDate(now); | |||
| } | |||
| wxMemberCardMapper.updateById(record); | |||
| } | |||
| return new ResultData(); | |||
| } | |||
| @Override | |||
| public ResultData delUserCardStatusByCode(WxMemberCard record) { | |||
| record.setUserCardStatus(EnumMemberCardStatus.DELETE.getCode()); | |||
| if(record.getUpdateDate() == null){ | |||
| record.setUpdateDate(new Date()); | |||
| } | |||
| wxMemberCardMapper.deleteByCode(record); | |||
| return new ResultData(); | |||
| } | |||
| @Override | |||
| public ResultData syncMemberCard(TenantEntity tenantEntity, String card_id, String code) { | |||
| WxAppinfo cAppInfo = wxAppinfoService.getCAppInfoFromRedis(tenantEntity.getTenantId(), EnumAppPlat.WX); | |||
| if(cAppInfo == null){ | |||
| return new ResultData(ErrorCode.APP_ID_NOT_FOUND); | |||
| } | |||
| WxPayAccount payAccount = wxPayAccountService.getByIdFromRedis(cAppInfo.getPayId()); | |||
| if(payAccount == null){ | |||
| return new ResultData(ErrorCode.API_KEY_NOT_FOUND); | |||
| } | |||
| if(!EnumBusinessType.BUSINESS_3.getCode().equals(payAccount.getBusinessType())){ | |||
| return new ResultData(ErrorCode.SYS_SERVER_ERROR.getCode(),"未开通商圈或不支持此项操作"); | |||
| } | |||
| try { | |||
| WxPayService wxPayService = maUtil.getWxPayServiceBySelfModel(cAppInfo, payAccount); | |||
| MemberCardResult memberCard = wxPayService.getMemberCardService().getMemberCard(card_id, code); | |||
| WxMemberCard record = new WxMemberCard(); | |||
| record.setTenantId(tenantEntity.getTenantId()); | |||
| record.setParentTenantId(tenantEntity.getParentTenantId()); | |||
| record.updateFinalTenantId(tenantEntity); | |||
| record.setCardId(card_id); | |||
| record.setCardCode(code); | |||
| record.setOpenId(memberCard.getOpenid()); | |||
| record.setMembershipNumber(memberCard.getMembershipNumber()); | |||
| record.setLevel(memberCard.getLevel()); | |||
| record.setNickname(memberCard.getNickname()); | |||
| record.setHeadImageUrl(memberCard.getHeadImageUrl()); | |||
| record.setBackgroundPictureUrl(memberCard.getBackgroundPictureUrl()); | |||
| record.setBalance(memberCard.getBalance()); | |||
| EnumMemberCardStatus enumMemberCardStatus = EnumMemberCardStatus.getEnum(memberCard.getUserCardStatus()); | |||
| if(enumMemberCardStatus != null){ | |||
| record.setUserCardStatus(enumMemberCardStatus.getCode()); | |||
| } | |||
| record.setUserInformation(JSON.toJSONString(memberCard.getUserInformation())); | |||
| record.setBonusValue(memberCard.getBonusValue()); | |||
| if(memberCard.getServiceModules() != null){ | |||
| record.setServiceModules(JSON.toJSONString(memberCard.getServiceModules())); | |||
| } | |||
| record.setMemberPriceWord(memberCard.getMemberPriceWord()); | |||
| record.setFapiaoJumpWord(memberCard.getFapiaoJumpWord()); | |||
| if(memberCard.getGuide() != null){ | |||
| record.setGuide(JSON.toJSONString(memberCard.getGuide())); | |||
| } | |||
| // MemberCardResult.UserInformation userInformation = memberCard.getUserInformation(); | |||
| // List<MemberCardResult.CommonField> commonFieldList = userInformation.getCommonFieldList(); | |||
| // String phone = null, name = null, avatarUrl = null; | |||
| // Integer sex = null; | |||
| // for (MemberCardResult.CommonField commonField:commonFieldList) { | |||
| // /** | |||
| // * 平台提供了一些通用的开卡字段供开发者选用 | |||
| // * USER_FORM_FLAG_MOBILE:手机号 | |||
| // * USER_FORM_FLAG_SEX:性别 | |||
| // * USER_FORM_FLAG_NAME:姓名 | |||
| // * USER_FORM_FLAG_BIRTHDAY:生日 | |||
| // * USER_FORM_FLAG_ADDRESS:地址 | |||
| // * USER_FORM_FLAG_EMAIL:邮箱 | |||
| // * USER_FORM_FLAG_CITY:城市 | |||
| // */ | |||
| // if("USER_FORM_FLAG_MOBILE".equals(commonField.getName())){ | |||
| // phone = commonField.getValue(); | |||
| // }else if("USER_FORM_FLAG_SEX".equals(commonField.getName())){ | |||
| // if("男".equals(commonField.getValue())){ | |||
| // sex = 1; | |||
| // }else if("女".equals(commonField.getValue())){ | |||
| // sex = 2; | |||
| // }else{ | |||
| // sex = 0; | |||
| // } | |||
| // }else if("USER_FORM_FLAG_NAME".equals(commonField.getName())){ | |||
| // name = commonField.getValue(); | |||
| // } | |||
| // } | |||
| // WxCUserBasicInfo basicInfo = wxCUserBasicInfoService.registerByPhone(tenantEntity, phone, null,name, sex, avatarUrl); | |||
| WxMemberCard old = wxMemberCardMapper.getByCode(record); | |||
| if(old != null){ | |||
| record.setId(old.getId()); | |||
| } | |||
| // if(basicInfo != null && (old == null || !basicInfo.getId().equals(old.getUserId()))){ | |||
| // record.setUserId(basicInfo.getId()); | |||
| // } | |||
| this.saveorupdate(record); | |||
| // if(record.getUserId() != null){ | |||
| // this.sendsyncMemberCardBonusMsg(tenantEntity,record.getUserId(),null); | |||
| //// this.sendsyncMemberCardLevelMsg(tenantEntity,record.getUserId(),null); | |||
| // } | |||
| return new ResultData(); | |||
| } catch (WxPayException e) { | |||
| e.printStackTrace(); | |||
| return new ResultData(ErrorCode.SYS_SERVER_ERROR.getCode(),e.getMessage()); | |||
| } | |||
| } | |||
| @Override | |||
| public void sendSyncMemberCardMsg(TenantEntity tenantEntity, String card_id, String code) { | |||
| SyncMemberCardMsg msg = new SyncMemberCardMsg(); | |||
| msg.updateTenantInfo(tenantEntity); | |||
| msg.setMsgType(EnumMsgRecordType.SYNC_MEMBER_CARD.getCode()); | |||
| msg.setCardId(card_id); | |||
| msg.setCode(code); | |||
| mqBaseProducer.sendMessage(msg, EnumMsgMqTopic.DEFAULT.getCode(), EnumMsgMqTag.DEFAULT.getCode(), EnumMsgMqKey.DEFAULT.getCode()); | |||
| } | |||
| @Override | |||
| public ResultData syncMemberCardLevel(TenantEntity tenantEntity, String card_id, String code,String markid, | |||
| String level, Boolean need_inform_level) { | |||
| WxAppinfo cAppInfo = wxAppinfoService.getCAppInfoFromRedis(tenantEntity.getTenantId(), EnumAppPlat.WX); | |||
| if(cAppInfo == null){ | |||
| return new ResultData(ErrorCode.APP_ID_NOT_FOUND); | |||
| } | |||
| WxPayAccount payAccount = wxPayAccountService.getByIdFromRedis(cAppInfo.getPayId()); | |||
| if(payAccount == null){ | |||
| return new ResultData(ErrorCode.API_KEY_NOT_FOUND); | |||
| } | |||
| if(!EnumBusinessType.BUSINESS_3.getCode().equals(payAccount.getBusinessType())){ | |||
| return new ResultData(ErrorCode.SYS_SERVER_ERROR.getCode(),"未开通商圈或不支持此项操作"); | |||
| } | |||
| try { | |||
| WxPayService wxPayService = maUtil.getWxPayServiceBySelfModel(cAppInfo, payAccount); | |||
| MemberCardUpdRequest request = new MemberCardUpdRequest(); | |||
| request.setLevel(level); | |||
| request.setOutRequestNo(markid); | |||
| request.setNeedInformLevel(need_inform_level); | |||
| wxPayService.getMemberCardService().updMemberCard(card_id,code,request); | |||
| this.sendSyncMemberCardMsg(tenantEntity,card_id,code); | |||
| return new ResultData(); | |||
| } catch (WxPayException e) { | |||
| e.printStackTrace(); | |||
| return new ResultData(ErrorCode.SYS_SERVER_ERROR.getCode(),e.getMessage()); | |||
| } | |||
| } | |||
| @Override | |||
| public void sendsyncMemberCardLevelMsg(TenantEntity tenantEntity, Long baseUserId, Long scoreHistoryId) { | |||
| //todo 暂不推送等级给商圈 | |||
| // AfterAddScoreMsg msg = new AfterAddScoreMsg(); | |||
| // msg.updateTenantInfo(tenantEntity); | |||
| // msg.setMsgType(EnumMsgRecordType.AFTER_ADD_SCORE.getCode()); | |||
| // msg.setBasicUserId(baseUserId); | |||
| // msg.setScoreHistoryId(scoreHistoryId); | |||
| // mqBaseProducer.sendMessage(msg, EnumMsgMqTopic.DEFAULT.getCode(), EnumMsgMqTag.DEFAULT.getCode(), EnumMsgMqKey.DEFAULT.getCode()); | |||
| } | |||
| @Override | |||
| public ResultData syncMemberCardBonus(TenantEntity tenantEntity, String card_id, String code,String markid, | |||
| int before_bonus_value,int bonus_value, Boolean need_inform_bonus) { | |||
| WxAppinfo cAppInfo = wxAppinfoService.getCAppInfoFromRedis(tenantEntity.getTenantId(), EnumAppPlat.WX); | |||
| if(cAppInfo == null){ | |||
| return new ResultData(ErrorCode.APP_ID_NOT_FOUND); | |||
| } | |||
| WxPayAccount payAccount = wxPayAccountService.getByIdFromRedis(cAppInfo.getPayId()); | |||
| if(payAccount == null){ | |||
| return new ResultData(ErrorCode.API_KEY_NOT_FOUND); | |||
| } | |||
| if(!EnumBusinessType.BUSINESS_3.getCode().equals(payAccount.getBusinessType())){ | |||
| return new ResultData(ErrorCode.SYS_SERVER_ERROR.getCode(),"未开通商圈或不支持此项操作"); | |||
| } | |||
| try { | |||
| WxPayService wxPayService = maUtil.getWxPayServiceBySelfModel(cAppInfo, payAccount); | |||
| MemberCardRightsRequest request = new MemberCardRightsRequest(); | |||
| request.setBeforeBonusValue(before_bonus_value); | |||
| request.setBonusValue(bonus_value); | |||
| request.setAddBonusValue(bonus_value - before_bonus_value); | |||
| request.setOutRequestNo(markid); | |||
| request.setNeedInformBonus(need_inform_bonus); | |||
| wxPayService.getMemberCardService().setMemberCardRights(card_id,code,request); | |||
| this.sendSyncMemberCardMsg(tenantEntity,card_id,code); | |||
| return new ResultData(); | |||
| } catch (WxPayException e) { | |||
| e.printStackTrace(); | |||
| return new ResultData(ErrorCode.SYS_SERVER_ERROR.getCode(),e.getMessage()); | |||
| } | |||
| } | |||
| @Override | |||
| public void sendsyncMemberCardBonusMsg(TenantEntity tenantEntity, Long cuserId, Long baseUserId, Long creditHistoryId) { | |||
| AfterAddCreditMsg msg = new AfterAddCreditMsg(); | |||
| msg.updateTenantInfo(tenantEntity); | |||
| msg.setMsgType(EnumMsgRecordType.AFTER_ADD_CREDIT.getCode()); | |||
| if(cuserId != null){ | |||
| msg.setCuserId(cuserId); | |||
| }else if(baseUserId != null){ | |||
| msg.setBasicUserId(baseUserId); | |||
| }else { | |||
| logger.error("商圈会员积分同步消息发送失败"); | |||
| } | |||
| msg.setCreditHistoryId(creditHistoryId); | |||
| mqBaseProducer.sendMessage(msg, EnumMsgMqTopic.DEFAULT.getCode(), EnumMsgMqTag.DEFAULT.getCode(), EnumMsgMqKey.DEFAULT.getCode()); | |||
| } | |||
| } | |||
| @@ -482,11 +482,7 @@ public class WxMerchantServiceImpl implements WxMerchantService { | |||
| List<Long> couponIds = wxCouponMerchantList.stream().map(cm -> cm.getProductId()).collect(Collectors.toList()); | |||
| couponIds.stream().filter(cid -> !isCouponMerchantValid(cid,wxCouponMerchant)).forEach(cid -> { | |||
| WxCoupon wxCoupon = new WxCoupon(); | |||
| wxCoupon.setId(cid); | |||
| wxCoupon.updateTenantInfo(wxMerchant); | |||
| wxCoupon.setStatus(EnumCouponStatus.COUPON_STATUS_TAKE_OFFF.getCode()); | |||
| wxCouponService.saveOrUpdate(wxCoupon); | |||
| wxCouponService.disable(wxMerchant,cid); | |||
| CouponCacheUtils.removeCouponMerchantCache(redisTemplate, cid); | |||
| }); | |||
| } | |||
| @@ -934,6 +930,10 @@ public class WxMerchantServiceImpl implements WxMerchantService { | |||
| List<WxMerchant> list = wxMerchantMapper.findList(wxMerchant); | |||
| list.stream().forEach(m->{ | |||
| List<WxProfitSharingReceiver> receivers = wxProfitSharingReceiverService.findReceivers(m, m.getId()); | |||
| m.setWxProfitSharingReceiver(receivers); | |||
| //分账信息 可能有多个, 先干掉 | |||
| // WxProfitSharingReceiver receiver = wxProfitSharingReceiverService.findReceiver(m,EnumProfitSharingType.PROFIT_SHARING_TYPE_WECHAT); | |||
| // if (receiver != null) { | |||
| @@ -1002,7 +1002,7 @@ public class WxMerchantServiceImpl implements WxMerchantService { | |||
| @Override | |||
| public boolean hasMerchant(WxMerchant wxMerchant) { | |||
| // wxMerchant.setStatus(EnumMerchantStatus.VALID.getCode()); | |||
| wxMerchant.setStatus(EnumMerchantStatus.VALID.getCode()); | |||
| return wxMerchantMapper.hasMerchant(wxMerchant) > 0 ? true : false; | |||
| } | |||