| @@ -8,6 +8,7 @@ import java.util.Date; | |||
| import com.iformall.domain.po.MallUserInfo; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import com.iformall.shiro.UserSession; | |||
| import com.iformall.utils.Constant; | |||
| import com.iformall.utils.IPUtil; | |||
| import org.apache.commons.lang3.StringUtils; | |||
| import org.apache.shiro.SecurityUtils; | |||
| @@ -2,6 +2,8 @@ package com.iformall.controller.basic; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.annotation.SystemControllerLog; | |||
| import com.iformall.annotation.TenantIgnore; | |||
| import com.iformall.common.ErrorCode; | |||
| import com.iformall.common.Result; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.controller.base.BaseController; | |||
| @@ -49,7 +51,7 @@ public class WxBrandController extends BaseController { | |||
| if (null == wxBrand) { | |||
| wxBrand = new WxBrand(); | |||
| } | |||
| wxBrand.updateTenantInfo(getTenantInfo()); | |||
| wxBrand.setTenantId(getTenantInfo().getFinalTenantId()); | |||
| wxBrand.setSortColumns(BaseEntity.SortField.Id_DESC); | |||
| final PageInfo<WxBrand> page = wxBrandService.listAsPage(wxBrand, pageNum, pageSize); | |||
| return new ResultData(page); | |||
| @@ -59,20 +61,24 @@ public class WxBrandController extends BaseController { | |||
| @SystemControllerLog(description = "品牌-增加") | |||
| public ResultData add(@RequestBody WxBrand wxBrand) { | |||
| logger.debug("[" + getIpAddr() + "] WxBrandController::add"); | |||
| wxBrand.updateTenantInfo(getTenantInfo()); | |||
| wxBrand.setTenantId(getTenantInfo().getFinalTenantId()); | |||
| return wxBrandService.save(wxBrand); | |||
| } | |||
| @TenantIgnore | |||
| @PostMapping("update") | |||
| @SystemControllerLog(description = "品牌-更新") | |||
| public ResultData update(@RequestBody WxBrand wxBrand) { | |||
| logger.debug("[" + getIpAddr() + "] WxBrandController::update"); | |||
| wxBrand.updateTenantInfo(getTenantInfo()); | |||
| if(wxBrand.getId() == null){ | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); | |||
| } | |||
| if(EnumDelFlag.YES.getCode().equals(wxBrand.getIsDel())){ | |||
| //判断是否解绑商户 | |||
| WxMerchant wxMerchant = new WxMerchant(); | |||
| wxMerchant.updateTenantInfo(wxBrand); | |||
| // wxMerchant.updateTenantInfo(wxBrand); | |||
| wxMerchant.setIsDel(EnumYesOrNo.NO.getCode()); | |||
| wxMerchant.setBrand(wxBrand.getId()); | |||
| @@ -118,10 +124,10 @@ public class WxBrandController extends BaseController { | |||
| public ResultData hasBrand(String name, Long id) { | |||
| logger.debug("[" + getIpAddr() + "] WxBrandController::hasBrand"); | |||
| WxBrand wxBrand = new WxBrand(); | |||
| wxBrand.updateTenantInfo(getTenantInfo()); | |||
| wxBrand.setId(id); | |||
| wxBrand.setTenantId(getTenantInfo().getFinalTenantId()); | |||
| wxBrand.setName(name); | |||
| wxBrand.setId(id); | |||
| return wxBrandService.hasBrand(wxBrand); | |||
| } | |||
| @@ -23,6 +23,7 @@ import javax.servlet.ServletOutputStream; | |||
| import javax.servlet.http.HttpServletResponse; | |||
| import java.awt.image.BufferedImage; | |||
| import java.io.IOException; | |||
| import java.util.List; | |||
| @RestController | |||
| @RequestMapping("wxMall") | |||
| @@ -66,6 +67,23 @@ public class WxMallController extends BaseController { | |||
| return new ResultData(mall); | |||
| } | |||
| @ApiOperation("查询当前mall的子广场") | |||
| @GetMapping("/childMall") | |||
| @SystemControllerLog(description = "商城-当前查询") | |||
| public ResultData childMall() { | |||
| logger.debug("[" + getIpAddr() + "] WxMallController::childMall"); | |||
| WxMall mall = wxMallService.getByTenantInfo(getUser()); | |||
| if(mall == null) { | |||
| logger.error("未配置相应的mall"); | |||
| return new ResultData(Result.ERROR, "未配置相应的mall"); | |||
| } | |||
| if (wxMallService.isgroupSupport(mall)) { | |||
| List<WxMall> childMall = wxMallService.getSubByParentTenantId(mall.getTenantId()); | |||
| return new ResultData(childMall); | |||
| } | |||
| return new ResultData(Result.ERROR, "未查询到子广场"); | |||
| } | |||
| @ApiOperation("验证码") | |||
| @GetMapping("/imgUrlH") | |||
| public ResultData imgUrlH(){ | |||
| @@ -107,6 +107,26 @@ public class WxMerchantController extends BaseController { | |||
| return new ResultData(page); | |||
| } | |||
| @TenantIgnore | |||
| @ApiOperation("分页列表接口") | |||
| @GetMapping("parentList") | |||
| @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 parentList(@ModelAttribute WxMerchant wxMerchant, Integer pageNum, Integer pageSize) { | |||
| logger.debug("[" + getIpAddr() + "] WxMerchantController::parentList"); | |||
| if (null == wxMerchant) wxMerchant = new WxMerchant(); | |||
| String tenantId = getUser().getTenantId(); | |||
| // wxMerchant.updateTenantInfo(getTenantInfo()); | |||
| wxMerchant.setParentTenantId(tenantId); | |||
| wxMerchant.setSortColumns(BaseEntity.SortField.TopTime_DESC); | |||
| wxMerchant.setIsPrivate(EnumYesOrNo.NO.getCode()); | |||
| final PageInfo<WxMerchant> page = wxMerchantService.listAsPage(wxMerchant, pageNum, pageSize); | |||
| return new ResultData(page); | |||
| } | |||
| @ApiOperation("获取商管商户") | |||
| @GetMapping("adminMerchantOne") | |||
| @SystemControllerLog(description = "商户-列表") | |||
| @@ -118,6 +118,24 @@ public class WxProjectConfigController extends BaseController { | |||
| // | |||
| // } | |||
| @ApiOperation("查询商场集团列表") | |||
| @GetMapping(value = "/childMallList") | |||
| @SystemControllerLog(description = "商场基础数据") | |||
| @TenantIgnore | |||
| public ResultData childMallList(@ModelAttribute WxMall wxMall, Integer pageNum, Integer pageSize) { | |||
| logger.debug("[" + getIpAddr() + "] WxProjectConfigController::getMallList"); | |||
| try { | |||
| if(wxMall == null){ | |||
| wxMall = new WxMall(); | |||
| } | |||
| wxMall.setParentTenantId(this.getTenantInfo().getTenantId()); | |||
| PageInfo<WxMall> page = wxMallService.listAsPage(wxMall, pageNum, pageSize); | |||
| return new ResultData(page); | |||
| }catch (Exception e){ | |||
| logger.error(e.getMessage(),e); | |||
| return new ResultData(ErrorCode.SYS_SERVER_ERROR); | |||
| } | |||
| } | |||
| @ApiOperation("查询商场集团列表") | |||
| @GetMapping(value = "/mallList") | |||
| @@ -154,7 +172,7 @@ public class WxProjectConfigController extends BaseController { | |||
| tenantEntity.setTenantId(wxMall.getId().toString()); | |||
| WxMall parentWxMall = wxMallService.getByTenantInfo(tenantEntity); | |||
| if(parentWxMall == null || !EnumSaleType.GROUP.getCode().equals(parentWxMall.getSaleType()) | |||
| if(parentWxMall == null | |||
| || !parentWxMall.getGroupSupport().equals(EnumGroupSupport.SUPPORT.getCode()) | |||
| || StringUtils.isNotBlank(parentWxMall.getParentTenantId())){ | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_ERROR); | |||
| @@ -177,7 +195,8 @@ public class WxProjectConfigController extends BaseController { | |||
| logger.debug("[" + getIpAddr() + "] WxProjectConfigController::initMall"); | |||
| try { | |||
| //集团版 | |||
| if(EnumSaleType.GROUP.getCode().equals(wxMall.getSaleType())){ | |||
| if(EnumSaleType.GROUP.getCode().equals(wxMall.getSaleType()) | |||
| || EnumSaleType.GROUP_v1.getCode().equals(wxMall.getSaleType())){ | |||
| wxMall.setGroupSupport(EnumGroupSupport.SUPPORT.getCode()); | |||
| }else{ | |||
| wxMall.setGroupSupport(EnumGroupSupport.NOT_SUPPORT.getCode()); | |||
| @@ -249,9 +268,9 @@ public class WxProjectConfigController extends BaseController { | |||
| if(StringUtils.isBlank(wxPayAccount.getNotifyUrl())){ | |||
| wxPayAccount.setNotifyUrl(wechatWebProperties.getUrl()+"/wxPay/notify"); | |||
| } | |||
| if(StringUtils.isBlank(wxPayAccount.getCertPath())){ | |||
| wxPayAccount.setCertPath("/opt/iformall/service/apiclient_cert.p12"); | |||
| } | |||
| // if(StringUtils.isBlank(wxPayAccount.getCertPath())){ | |||
| // wxPayAccount.setCertPath("/opt/iformall/service/apiclient_cert.p12"); | |||
| // } | |||
| if(wxPayAccount.getType() == null){ | |||
| wxPayAccount.setType(1);//0:普通商户模式, 1:服务商模式(默认服务商模式) | |||
| } | |||
| @@ -366,7 +385,8 @@ public class WxProjectConfigController extends BaseController { | |||
| if(byId == null){ | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(),"未找到小程序"); | |||
| } | |||
| if(!EnumAppType.B.getCode().equals(byId.getType()) && !EnumAppType.C.getCode().equals(byId.getType())){ | |||
| if(!EnumAppType.B.getCode().equals(byId.getType()) | |||
| && !EnumAppType.C.getCode().equals(byId.getType())){ | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(),"小程序类型不支持"); | |||
| } | |||
| if(wxAppinfo.getEnable() == null || | |||
| @@ -801,14 +821,15 @@ public class WxProjectConfigController extends BaseController { | |||
| public ResultData ttcallbackQuerySettings(String appid) { | |||
| logger.debug("[" + getIpAddr() + "] WxProjectConfigController::ttcallbackQuerySettings"); | |||
| try { | |||
| WxAppinfo appinfo = wxAppinfoService.getByAppId(appid); | |||
| WxAppinfo appinfo = wxAppinfoService.getOnlyByAppIdFromRedis(appid); | |||
| if(appinfo == null){ | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"未找到对应的小程序"); | |||
| } | |||
| if(!EnumAppPlat.TOUTIAO.getCode().equals(appinfo.getPlat()) || !EnumAppType.C.getCode().equals(appinfo.getType())){ | |||
| if(!EnumAppPlat.TOUTIAO.getCode().equals(appinfo.getPlat()) | |||
| || !EnumAppType.C.getCode().equals(appinfo.getType())){ | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"该小程序不支持"); | |||
| } | |||
| WxPayAccount payAccount = wxPayAccountService.getById(appinfo.getPayId()); | |||
| WxPayAccount payAccount = wxPayAccountService.getByIdFromRedis(appinfo.getPayId()); | |||
| if(payAccount == null){ | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"未找到对应的支付数据"); | |||
| } | |||
| @@ -836,14 +857,15 @@ public class WxProjectConfigController extends BaseController { | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); | |||
| } | |||
| try { | |||
| WxAppinfo appinfo = wxAppinfoService.getByAppId(appid); | |||
| WxAppinfo appinfo = wxAppinfoService.getOnlyByAppIdFromRedis(appid); | |||
| if(appinfo == null){ | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"未找到对应的小程序"); | |||
| } | |||
| if(!EnumAppPlat.TOUTIAO.getCode().equals(appinfo.getPlat()) || !EnumAppType.C.getCode().equals(appinfo.getType())){ | |||
| if(!EnumAppPlat.TOUTIAO.getCode().equals(appinfo.getPlat()) | |||
| || !EnumAppType.C.getCode().equals(appinfo.getType())){ | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"该小程序不支持"); | |||
| } | |||
| WxPayAccount payAccount = wxPayAccountService.getById(appinfo.getPayId()); | |||
| WxPayAccount payAccount = wxPayAccountService.getByIdFromRedis(appinfo.getPayId()); | |||
| if(payAccount == null){ | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"未找到对应的支付数据"); | |||
| } | |||
| @@ -1,6 +1,7 @@ | |||
| package com.iformall.controller.market; | |||
| import com.iformall.annotation.SystemControllerLog; | |||
| import com.iformall.annotation.TenantIgnore; | |||
| import com.iformall.common.ErrorCode; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.controller.base.BaseController; | |||
| @@ -41,54 +42,54 @@ public class TtCouponGoodsController extends BaseController { | |||
| @Autowired | |||
| private TtGoodsCategoryService ttGoodsCategoryService; | |||
| @ApiOperation("分页列表接口") | |||
| @GetMapping("couponList") | |||
| @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 couponList(@ModelAttribute TtCouponVo ttCouponVo, Integer pageNum, Integer pageSize) { | |||
| logger.debug("[" + getIpAddr() + "] WxCouponController::couponList"); | |||
| if (ttCouponVo == null) ttCouponVo = new TtCouponVo(); | |||
| ttCouponVo.updateTenantInfo(getTenantInfo()); | |||
| ttCouponVo.setType(EnumCouponType.COUPON_DOUYIN.getCode()); | |||
| if(StringUtils.isNotBlank(ttCouponVo.getSortColumn())){ | |||
| String coryColumn = "c."+ttCouponVo.getSortColumns(); | |||
| ttCouponVo.setSortColumns(coryColumn); | |||
| ttCouponVo.setSortColumn(null); | |||
| }else{ | |||
| ttCouponVo.setSortColumns(BaseEntity.SortField.CCreateDate_DESC, BaseEntity.SortField.CId_DESC); | |||
| } | |||
| if (ttCouponVo.getStatus() != null && ttCouponVo.getStatus() == -1) | |||
| ttCouponVo.setStatus(null); | |||
| return ttCouponGoodsService.couponList(ttCouponVo, pageNum, pageSize); | |||
| } | |||
| @ApiOperation("分页列表接口") | |||
| @GetMapping("channelList") | |||
| @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 channelList(@ModelAttribute TtCouponChannelVo ttChannelVo, Integer pageNum, Integer pageSize) { | |||
| logger.debug("[" + getIpAddr() + "] WxCouponController::channelList"); | |||
| if (ttChannelVo == null) ttChannelVo = new TtCouponChannelVo(); | |||
| ttChannelVo.updateTenantInfo(getTenantInfo()); | |||
| ttChannelVo.setTargetAd(EnumCouponChannelType.COUPON_CHANNEL_ID_DOUYIN_LIST.getCode()); | |||
| if(null == ttChannelVo.getSourceType()){ | |||
| ttChannelVo.setSourceType(EnumCouponSourceType.COUPONSource_Admin.getCode()); | |||
| } | |||
| if(StringUtils.isNotBlank(ttChannelVo.getSortColumn())){ | |||
| String coryColumn = "cc."+ttChannelVo.getSortColumns(); | |||
| ttChannelVo.setSortColumns(coryColumn); | |||
| ttChannelVo.setSortColumn(null); | |||
| }else{ | |||
| ttChannelVo.setSortColumns(BaseEntity.SortField.CCUpdateDate_DESC); | |||
| } | |||
| return ttCouponGoodsService.channelList(ttChannelVo, pageNum, pageSize); | |||
| } | |||
| // @ApiOperation("分页列表接口") | |||
| // @GetMapping("couponList") | |||
| // @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 couponList(@ModelAttribute TtCouponVo ttCouponVo, Integer pageNum, Integer pageSize) { | |||
| // logger.debug("[" + getIpAddr() + "] WxCouponController::couponList"); | |||
| // if (ttCouponVo == null) ttCouponVo = new TtCouponVo(); | |||
| // ttCouponVo.updateTenantInfo(getTenantInfo()); | |||
| // ttCouponVo.setType(EnumCouponType.COUPON_DOUYIN.getCode()); | |||
| // if(StringUtils.isNotBlank(ttCouponVo.getSortColumn())){ | |||
| // String coryColumn = "c."+ttCouponVo.getSortColumns(); | |||
| // ttCouponVo.setSortColumns(coryColumn); | |||
| // ttCouponVo.setSortColumn(null); | |||
| // }else{ | |||
| // ttCouponVo.setSortColumns(BaseEntity.SortField.CCreateDate_DESC, BaseEntity.SortField.CId_DESC); | |||
| // } | |||
| // if (ttCouponVo.getStatus() != null && ttCouponVo.getStatus() == -1) | |||
| // ttCouponVo.setStatus(null); | |||
| // return ttCouponGoodsService.couponList(ttCouponVo, pageNum, pageSize); | |||
| // } | |||
| // | |||
| // @ApiOperation("分页列表接口") | |||
| // @GetMapping("channelList") | |||
| // @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 channelList(@ModelAttribute TtCouponChannelVo ttChannelVo, Integer pageNum, Integer pageSize) { | |||
| // logger.debug("[" + getIpAddr() + "] WxCouponController::channelList"); | |||
| // if (ttChannelVo == null) ttChannelVo = new TtCouponChannelVo(); | |||
| // ttChannelVo.updateTenantInfo(getTenantInfo()); | |||
| // ttChannelVo.setTargetAd(EnumCouponChannelType.COUPON_CHANNEL_ID_DOUYIN_LIST.getCode()); | |||
| // if(null == ttChannelVo.getSourceType()){ | |||
| // ttChannelVo.setSourceType(EnumCouponSourceType.COUPONSource_Admin.getCode()); | |||
| // } | |||
| // | |||
| // if(StringUtils.isNotBlank(ttChannelVo.getSortColumn())){ | |||
| // String coryColumn = "cc."+ttChannelVo.getSortColumns(); | |||
| // ttChannelVo.setSortColumns(coryColumn); | |||
| // ttChannelVo.setSortColumn(null); | |||
| // }else{ | |||
| // ttChannelVo.setSortColumns(BaseEntity.SortField.CCUpdateDate_DESC); | |||
| // } | |||
| // | |||
| // return ttCouponGoodsService.channelList(ttChannelVo, pageNum, pageSize); | |||
| // } | |||
| @ApiOperation("根据类目获取商品模板") | |||
| @GetMapping("getTemplate") | |||
| @@ -119,6 +120,7 @@ public class TtCouponGoodsController extends BaseController { | |||
| } | |||
| @TenantIgnore | |||
| @ApiOperation("提交审核") | |||
| @PostMapping("product/save") | |||
| @SystemControllerLog(description = "提交审核") | |||
| @@ -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.annotation.TenantIgnore; | |||
| import com.iformall.common.ErrorCode; | |||
| import com.iformall.common.Result; | |||
| import com.iformall.common.ResultData; | |||
| @@ -128,6 +129,7 @@ public class WxCouponChannelController extends BaseController { | |||
| return new ResultData(Result.SUCCESS, "查询成功", wxCouponChannelService.getById(id,getTenantInfo().getTenantId())); | |||
| } | |||
| @TenantIgnore | |||
| @ApiOperation("批量新增") | |||
| @PostMapping("/addbatch") | |||
| @SystemControllerLog(description = "券投放-批量新增") | |||
| @@ -55,6 +55,8 @@ public class WxCouponController extends BaseController { | |||
| @Autowired | |||
| private WxMallService wxMallService; | |||
| @Autowired | |||
| private WxCouponMallService wxCouponMallService; | |||
| @Autowired | |||
| RedisLock redisLock; | |||
| @Autowired | |||
| @@ -66,39 +68,55 @@ public class WxCouponController extends BaseController { | |||
| @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 list(@ModelAttribute WxCoupon wxCoupon, Integer pageNum, Integer pageSize,Integer dataType,Boolean isList) { | |||
| public ResultData list(@ModelAttribute WxCoupon wxCoupon, Integer pageNum, Integer pageSize,Boolean isList) { | |||
| logger.debug("[" + getIpAddr() + "] WxCouponController::list"); | |||
| if (wxCoupon == null) wxCoupon = new WxCoupon(); | |||
| if(null != dataType && dataType == 1){ | |||
| wxCoupon.updateTenantInfo(getTenantInfo()); | |||
| }else{ | |||
| wxCoupon.updateTenantInfo(getTenantInfo()); | |||
| } | |||
| wxCoupon.updateTenantInfo(getTenantInfo()); | |||
| return couponList(wxCoupon, pageNum, pageSize, isList); | |||
| } | |||
| @TenantIgnore | |||
| @ApiOperation("父券分页列表接口") | |||
| @GetMapping("parentCouponList") | |||
| @ApiImplicitParams({ | |||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | |||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | |||
| public ResultData parentCouponList(@ModelAttribute WxCoupon wxCoupon, Integer pageNum, Integer pageSize,Boolean isList) { | |||
| logger.debug("[" + getIpAddr() + "] WxCouponController::list"); | |||
| if (wxCoupon == null) wxCoupon = new WxCoupon(); | |||
| TenantEntity mallTenantEntity = getTenantInfo(); | |||
| wxCoupon.setTenantId(mallTenantEntity.getParentTenantId()); | |||
| wxCoupon.setParentTenantId(null); | |||
| //平台券 | |||
| if (EnumCouponType.COUPON_DOUYIN_PLAT.getCode() == wxCoupon.getType()) { | |||
| //查询已经分配了的parentCouponList | |||
| WxCouponMall couponMall = new WxCouponMall(); | |||
| couponMall.updateTenantInfo(wxCoupon); | |||
| couponMall.setMallTenantId(mallTenantEntity.getTenantId()); | |||
| List<Long> couponIds = wxCouponMallService.listCouponIds(couponMall); | |||
| if (null != couponIds && couponIds.size() > 0 ) { | |||
| wxCoupon.setIds(couponIds); | |||
| }else { | |||
| wxCoupon.setId(-1L); | |||
| } | |||
| } | |||
| return couponList(wxCoupon, pageNum, pageSize, isList); | |||
| } | |||
| private ResultData couponList(WxCoupon wxCoupon, Integer pageNum, Integer pageSize,Boolean isList) { | |||
| //默认A端建券 | |||
| if(null == wxCoupon.getSourceType()){ | |||
| wxCoupon.setSourceType(EnumCouponSourceType.COUPONSource_Admin.getCode()); | |||
| } | |||
| //排序处理 | |||
| if(StringUtils.isNotBlank(wxCoupon.getSortColumn())){ | |||
| String coryColumn = "c."+wxCoupon.getSortColumns(); | |||
| wxCoupon.setSortColumns(coryColumn); | |||
| wxCoupon.setSortColumn(null); | |||
| } | |||
| if(wxCoupon.getTargetAd() != null ){ | |||
| if(wxCoupon.getTargetAd() == EnumCouponChannelType.COUPON_CHANNEL_ID_TIMED.getCode() | |||
| || wxCoupon.getTargetAd() == EnumCouponChannelType.COUPON_CHANNEL_ID_GAME.getCode()){ | |||
| Integer[] typeArray = { | |||
| EnumCouponType.COUPON_MANJIAN.getCode(), | |||
| EnumCouponType.COUPON_DAIJIN.getCode(), | |||
| EnumCouponType.COUPON_LIPIN.getCode(), | |||
| EnumCouponType.COUPON_TINGCHE.getCode(), | |||
| EnumCouponType.COUPON_MULTIMCH.getCode(), | |||
| EnumCouponType.COUPON_DOUYIN.getCode()}; | |||
| wxCoupon.setTypes(Arrays.asList(typeArray)); | |||
| } | |||
| } | |||
| if(!(isList == null?false:isList) && wxCoupon.getSendType() == null){ | |||
| //isList true 查全部 / 否则 只查询主动领取和定向投放的。 | |||
| if(wxCoupon.getSendType() == null && !(isList == null?false:isList)){ | |||
| Integer[] sendTypeArray = { | |||
| EnumCouponSendType.ACTIVE.getCode(), | |||
| EnumCouponSendType.PASSIVE.getCode(),}; | |||
| @@ -145,6 +163,7 @@ public class WxCouponController extends BaseController { | |||
| return wxCouponService.list(wxCoupon,wxCoupon, pageNum, pageSize); //全列表 | |||
| } | |||
| @TenantIgnore | |||
| @ApiOperation("新增接口") | |||
| @PostMapping("add") | |||
| @SystemControllerLog(description = "券投放-新增") | |||
| @@ -176,6 +195,7 @@ public class WxCouponController extends BaseController { | |||
| return resultData; | |||
| } | |||
| @TenantIgnore | |||
| @ApiOperation("根据id更新接口") | |||
| @PostMapping("update") | |||
| @SystemControllerLog(description = "券投放-更新") | |||
| @@ -395,13 +415,26 @@ public class WxCouponController extends BaseController { | |||
| return new ResultData(Result.SUCCESS, "删除成功", null); | |||
| } | |||
| @TenantIgnore | |||
| @ApiOperation("根据id查询接口") | |||
| @GetMapping("/findById") | |||
| @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) | |||
| @SystemControllerLog(description = "券投放-查询") | |||
| public ResultData findById(@RequestParam Long id) { | |||
| logger.debug("[" + getIpAddr() + "] WxCouponController::findById"); | |||
| return new ResultData(wxCouponService.getVoById(id,getTenantInfo().getTenantId())); | |||
| TenantEntity tenantEntity = getTenantInfo(); | |||
| return new ResultData(wxCouponService.getVoById(id,tenantEntity.getTenantId(),tenantEntity)); | |||
| } | |||
| @TenantIgnore | |||
| @ApiOperation("根据id查询接口") | |||
| @GetMapping("/findParentCouponById") | |||
| @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) | |||
| @SystemControllerLog(description = "券投放-查询") | |||
| public ResultData findParentCouponById(@RequestParam Long id) { | |||
| logger.debug("[" + getIpAddr() + "] WxCouponController::findById"); | |||
| TenantEntity tenantEntity = getTenantInfo(); | |||
| return new ResultData(wxCouponService.getVoById(id,getTenantInfo().getParentTenantId(),tenantEntity)); | |||
| } | |||
| @TenantIgnore | |||
| @@ -572,5 +605,135 @@ public class WxCouponController extends BaseController { | |||
| CouponCacheUtils.removeCouponCache(redisTemplate, wxCoupon.getId()); | |||
| return result; | |||
| } | |||
| @ApiOperation("集团查询:查询平台券商场列表") | |||
| @GetMapping("/getPlatMallList") | |||
| @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) | |||
| public ResultData getPlatMallList(@RequestParam Long id) { | |||
| WxCouponMall wxCouponMall = new WxCouponMall(); | |||
| wxCouponMall.updateTenantInfo(getTenantInfo()); | |||
| wxCouponMall.setProductId(id); | |||
| return new ResultData(wxCouponMallService.list(wxCouponMall,true)); | |||
| } | |||
| @TenantIgnore | |||
| @ApiOperation("平台券商场列表") | |||
| @GetMapping("/getCouponMall") | |||
| @ApiImplicitParams({ | |||
| @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true)}) | |||
| public ResultData getCouponMall(Long id) { | |||
| //如果是集团查询,则查询所有的,如果是商场查询,则只查询商场的 | |||
| WxCouponMall wxCouponMall = new WxCouponMall(); | |||
| TenantEntity tenantEntity = getTenantInfo(); | |||
| if (null == tenantEntity.getParentTenantId()) { | |||
| wxCouponMall.updateTenantInfo(tenantEntity); | |||
| wxCouponMall.setProductId(id); | |||
| }else { | |||
| wxCouponMall.setTenantId(tenantEntity.getParentTenantId()); | |||
| //一个商场,每个平台券只有一条记录 | |||
| wxCouponMall.setMallTenantId(tenantEntity.getTenantId()); | |||
| wxCouponMall.setProductId(id); | |||
| } | |||
| List<WxCouponMall> mallList= wxCouponMallService.list(wxCouponMall,false); | |||
| if (null != mallList && mallList.size() > 0 ) { | |||
| boolean isComplete = true; | |||
| for (int i = 0 ; i < mallList.size(); i ++) { | |||
| WxCouponMall cm = mallList.get(i); | |||
| if (EnumCouponMallStatus.UNFINISED.getCode() == cm.getStatus()) { | |||
| isComplete = false; | |||
| break; | |||
| } | |||
| } | |||
| if (isComplete) { | |||
| return new ResultData("{\"isCompleted\":1}"); | |||
| }else { | |||
| return new ResultData("{\"isCompleted\":0}"); | |||
| } | |||
| }else { | |||
| return new ResultData("{\"isCompleted\":0}"); | |||
| } | |||
| } | |||
| @TenantIgnore | |||
| @ApiOperation("商场设置平台券商户") | |||
| @PostMapping("/setParentCouponMerchants") | |||
| public ResultData setMallMerchants(@RequestBody WxCoupon wxCoupon) { | |||
| try { | |||
| wxCouponService.setParentCouponMallMerchants(getTenantInfo(),wxCoupon); | |||
| } catch (Exception e) { | |||
| return new ResultData(Result.ERROR,e.getMessage()); | |||
| } | |||
| return new ResultData(); | |||
| } | |||
| @ApiOperation("自己券商户是否自动分账") | |||
| @PostMapping("/couponMerchantAutoShare") | |||
| public ResultData couponMerchantAutoShare(@RequestBody WxCoupon wxCoupon) { | |||
| wxCoupon.updateTenantInfo(getTenantInfo()); | |||
| try { | |||
| Map<Long, Boolean> map = wxCouponService.couponMerchantAutoShare(wxCoupon,wxCoupon); | |||
| return new ResultData(map); | |||
| } catch (Exception e) { | |||
| return new ResultData(Result.ERROR,e.getMessage()); | |||
| } | |||
| } | |||
| @TenantIgnore | |||
| @ApiOperation("父券商户是否自动分账") | |||
| @PostMapping("/parentCouponMerchantAutoShare") | |||
| public ResultData parentCouponMerchantAutoShare(@RequestBody WxCoupon wxCoupon) { | |||
| TenantEntity tenantEntity = getTenantInfo(); | |||
| wxCoupon.setTenantId(tenantEntity.getParentTenantId()); | |||
| wxCoupon.setParentTenantId(null); | |||
| try { | |||
| Map<Long, Boolean> map = wxCouponService.couponMerchantAutoShare(tenantEntity,wxCoupon); | |||
| return new ResultData(map); | |||
| } catch (Exception e) { | |||
| return new ResultData(Result.ERROR,e.getMessage()); | |||
| } | |||
| } | |||
| @TenantIgnore | |||
| @ApiOperation("商场设置平台券已完成") | |||
| @PostMapping("/setPlatCouponFinished") | |||
| public ResultData setPlatCouponFinished(@RequestBody WxCoupon wxCoupon) { | |||
| try { | |||
| TenantEntity tenantEntity = getTenantInfo(); | |||
| String mallTenantId = tenantEntity.getTenantId(); | |||
| String tenantId = tenantEntity.getTenantId(); | |||
| if (null != tenantEntity.getParentTenantId()) { | |||
| tenantId = tenantEntity.getParentTenantId(); | |||
| } | |||
| wxCouponMallService.finised(tenantId, wxCoupon.getId(), mallTenantId); | |||
| return new ResultData(); | |||
| } catch (Exception e) { | |||
| return new ResultData(Result.ERROR,e.getMessage()); | |||
| } | |||
| } | |||
| @TenantIgnore | |||
| @ApiOperation("商场设置平台券未完成") | |||
| @PostMapping("/setPlatCouponUnFinished") | |||
| public ResultData setPlatCouponUnFinished(@RequestBody WxCoupon wxCoupon) { | |||
| try { | |||
| if (null == wxCoupon.getType()) { | |||
| return new ResultData(Result.ERROR,"缺少参数"); | |||
| } | |||
| TenantEntity tenantEntity = getTenantInfo(); | |||
| String mallTenantId = tenantEntity.getTenantId(); | |||
| String tenantId = tenantEntity.getTenantId(); | |||
| if (null != tenantEntity.getParentTenantId()) { | |||
| tenantId = tenantEntity.getParentTenantId(); | |||
| } | |||
| wxCouponMallService.unfinised(tenantId, wxCoupon.getId(),wxCoupon.getType(), mallTenantId); | |||
| return new ResultData(); | |||
| } catch (Exception e) { | |||
| return new ResultData(Result.ERROR,e.getMessage()); | |||
| } | |||
| } | |||
| } | |||
| @@ -2,11 +2,13 @@ package com.iformall.controller.market; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.annotation.SystemControllerLog; | |||
| import com.iformall.annotation.TenantIgnore; | |||
| import com.iformall.common.ErrorCode; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.controller.base.BaseController; | |||
| import com.iformall.domain.po.WxAppinfo; | |||
| import com.iformall.domain.po.WxCouponOrder; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import com.iformall.domain.vo.WxCouponOrderBVo; | |||
| import com.iformall.enums.EnumAppType; | |||
| import com.iformall.enums.EnumPayType; | |||
| @@ -44,14 +46,13 @@ public class WxCouponOrderController extends BaseController { | |||
| @Autowired | |||
| private WxAppinfoService wxAppinfoService; | |||
| @TenantIgnore | |||
| @ApiOperation("分页列表接口") | |||
| @GetMapping("list") | |||
| @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 list(@ModelAttribute WxCouponOrderBVo wxCouponOrder, Integer pageNum, Integer pageSize) { | |||
| logger.debug("[" + getIpAddr() + "] WxCouponOrderController::list"); | |||
| if (wxCouponOrder == null) wxCouponOrder = new WxCouponOrderBVo(); | |||
| wxCouponOrder.updateTenantInfo(getTenantInfo()); | |||
| if (wxCouponOrder.getMerchantName() != null && | |||
| @@ -60,13 +61,31 @@ public class WxCouponOrderController extends BaseController { | |||
| } | |||
| return wxCouponOrderService.listAdminAsPage(wxCouponOrder, pageNum, pageSize); | |||
| } | |||
| @TenantIgnore | |||
| @ApiOperation("子商场查询集团券核销分页列表接口") | |||
| @GetMapping("groupList") | |||
| @ApiImplicitParams({ | |||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | |||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | |||
| public ResultData groupList(@ModelAttribute WxCouponOrderBVo wxCouponOrder, Integer pageNum, Integer pageSize) { | |||
| if (wxCouponOrder == null) wxCouponOrder = new WxCouponOrderBVo(); | |||
| TenantEntity mallTenantEntity = getTenantInfo(); | |||
| wxCouponOrder.setTenantId(mallTenantEntity.getParentTenantId()); | |||
| if (wxCouponOrder.getMerchantName() != null && | |||
| wxCouponOrder.getMerchantName().isEmpty()) { | |||
| wxCouponOrder.setMerchantName(null); | |||
| } | |||
| wxCouponOrder.setBTenantId(mallTenantEntity.getTenantId()); | |||
| return wxCouponOrderService.listAdminAsPage(wxCouponOrder, pageNum, pageSize); | |||
| } | |||
| @TenantIgnore | |||
| @ApiOperation(value = "卡券详情接口") | |||
| @GetMapping("detail") | |||
| @ApiImplicitParams({ | |||
| @ApiImplicitParam(name = "couponOrderId", value = "券ID", dataType = "Long", paramType = "query", required = true) | |||
| }) | |||
| @SystemControllerLog(description = "券包-卡券详情") | |||
| public ResultData detail(@RequestParam("couponOrderId") Long couponOrderId) { | |||
| if(couponOrderId == null) { | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); | |||
| @@ -125,5 +144,21 @@ public class WxCouponOrderController extends BaseController { | |||
| } | |||
| wxCouponOrderService.exportData(false,wxCouponOrder, request, response); | |||
| } | |||
| @TenantIgnore | |||
| @GetMapping("exportGroupData") | |||
| @SystemControllerLog(description = "券订单数据-导出数据") | |||
| public void exportGroupData(@ModelAttribute WxCouponOrderBVo wxCouponOrder, HttpServletRequest request, HttpServletResponse response) { | |||
| logger.debug("[" + getIpAddr() + "] WxCouponOrderController::exportData"); | |||
| if (wxCouponOrder == null) wxCouponOrder = new WxCouponOrderBVo(); | |||
| TenantEntity mallTenantEntity = getTenantInfo(); | |||
| wxCouponOrder.setTenantId(mallTenantEntity.getParentTenantId()); | |||
| if (wxCouponOrder.getMerchantName() != null && | |||
| wxCouponOrder.getMerchantName().isEmpty()) { | |||
| wxCouponOrder.setMerchantName(null); | |||
| } | |||
| wxCouponOrder.setBTenantId(mallTenantEntity.getTenantId()); | |||
| wxCouponOrderService.exportData(false,wxCouponOrder, request, response); | |||
| } | |||
| } | |||
| @@ -2,9 +2,11 @@ package com.iformall.controller.market; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.annotation.SystemControllerLog; | |||
| import com.iformall.annotation.TenantIgnore; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.controller.base.BaseController; | |||
| import com.iformall.domain.po.WxCUserBasicInfo; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import com.iformall.domain.vo.WxProfitSharingOrderQueryVo; | |||
| import com.iformall.domain.vo.WxProfitSharingOrderVo; | |||
| import com.iformall.service.WxProfitSharingOrderService; | |||
| @@ -36,17 +38,36 @@ public class WxProfitSharingOrderController extends BaseController { | |||
| @Autowired | |||
| private WxProfitSharingOrderService wxProfitSharingOrderService; | |||
| @TenantIgnore | |||
| @ApiOperation("分页列表接口") | |||
| @GetMapping("list") | |||
| @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 list(@ModelAttribute WxProfitSharingOrderQueryVo order, Integer pageNum, Integer pageSize) { | |||
| logger.debug("[" + getIpAddr() + "] WxProfitSharingOrderController::list"); | |||
| if (null == order) { | |||
| order = new WxProfitSharingOrderQueryVo(); | |||
| } | |||
| order.updateTenantInfo(getTenantInfo()); | |||
| final PageInfo<WxProfitSharingOrderVo> page = wxProfitSharingOrderService.listAsPage(order, pageNum, pageSize); | |||
| return new ResultData(page); | |||
| } | |||
| @TenantIgnore | |||
| @ApiOperation("子广场集团券核销分页列表接口") | |||
| @GetMapping("groupList") | |||
| @ApiImplicitParams({ | |||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | |||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | |||
| public ResultData groupList(@ModelAttribute WxProfitSharingOrderQueryVo order, Integer pageNum, Integer pageSize) { | |||
| logger.debug("[" + getIpAddr() + "] WxProfitSharingOrderController::list"); | |||
| if (null == order) { | |||
| order = new WxProfitSharingOrderQueryVo(); | |||
| } | |||
| TenantEntity mallTenantEntity = getTenantInfo(); | |||
| order.setTenantId(mallTenantEntity.getParentTenantId()); | |||
| order.setBTenantId(mallTenantEntity.getTenantId()); | |||
| final PageInfo<WxProfitSharingOrderVo> page = wxProfitSharingOrderService.listAsPage(order, pageNum, pageSize); | |||
| return new ResultData(page); | |||
| } | |||
| @@ -62,6 +83,20 @@ public class WxProfitSharingOrderController extends BaseController { | |||
| wxProfitSharingOrderService.exportData(order, request, response); | |||
| } | |||
| @TenantIgnore | |||
| @ApiOperation("记录导出") | |||
| @GetMapping("/exportGroupData") | |||
| @SystemControllerLog(description = "线上自动分账记录-导出") | |||
| public void exportGroupData(@ModelAttribute WxProfitSharingOrderQueryVo order, HttpServletRequest request, HttpServletResponse response) { | |||
| if (null == order) { | |||
| order = new WxProfitSharingOrderQueryVo(); | |||
| } | |||
| TenantEntity mallTenantEntity = getTenantInfo(); | |||
| order.setTenantId(mallTenantEntity.getParentTenantId()); | |||
| order.setBTenantId(mallTenantEntity.getTenantId()); | |||
| wxProfitSharingOrderService.exportData(order, request, response); | |||
| } | |||
| @ApiOperation("交易统计") | |||
| @GetMapping("/queryOrderSummary") | |||
| @SystemControllerLog(description = "分账订单-交易统计") | |||
| @@ -255,7 +255,7 @@ public class HomeController extends BaseController { | |||
| logger.error("appid信息未提供"); | |||
| return new ResultData(ErrorCode.MALL_INFO_NOT_FOUND); | |||
| } | |||
| WxAppinfo appinfo = appinfoService.getByAppId(user.getTenantId()); | |||
| WxAppinfo appinfo = appinfoService.getOnlyByAppIdFromRedis(user.getTenantId()); | |||
| if (appinfo == null) { | |||
| logger.error("appid未找到"); | |||
| return new ResultData(ErrorCode.MALL_INFO_NOT_FOUND); | |||
| @@ -2,12 +2,19 @@ package com.iformall.interceptor; | |||
| import javax.servlet.http.HttpServletRequest; | |||
| import javax.servlet.http.HttpServletResponse; | |||
| import com.alibaba.fastjson.JSONObject; | |||
| import com.iformall.domain.po.WxMall; | |||
| import com.iformall.service.WxMallService; | |||
| import org.apache.commons.lang3.StringUtils; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.stereotype.Component; | |||
| import org.springframework.web.method.HandlerMethod; | |||
| import org.springframework.web.servlet.handler.HandlerInterceptorAdapter; | |||
| import com.iformall.annotation.TenantIgnore; | |||
| import com.iformall.common.TenantThreadLocal; | |||
| import com.iformall.shiro.UserSession; | |||
| import com.iformall.utils.Constant; | |||
| /** | |||
| * 权限(Token)验证 | |||
| @@ -18,11 +25,38 @@ import com.iformall.shiro.UserSession; | |||
| @Component | |||
| public class CurrentTenantInterceptor extends HandlerInterceptorAdapter { | |||
| @Autowired | |||
| private WxMallService wxMallService; | |||
| @Override | |||
| public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { | |||
| TenantThreadLocal.setCurrentThreadTenant((String)request.getSession().getAttribute(UserSession.tenantId), | |||
| (String)request.getSession().getAttribute(UserSession.parentTenantId)); | |||
| //集团版中针对某一商场的业务需要传递mallTenantId | |||
| String mallTenantId = request.getHeader("mallTenantId"); | |||
| if(StringUtils.isBlank(mallTenantId)){ | |||
| mallTenantId = request.getParameter("mallTenantId"); | |||
| } | |||
| if(StringUtils.isBlank(mallTenantId)){ | |||
| try{ | |||
| String body = ((BodyReaderHttpServletRequestWrapper) request).getBody(); | |||
| mallTenantId = JSONObject.parseObject(body).getString("mallTenantId"); | |||
| }catch(Exception e){} | |||
| } | |||
| String tenantId = null; | |||
| String parenTenantId = null; | |||
| if(StringUtils.isNotBlank(mallTenantId)){ | |||
| tenantId = mallTenantId; | |||
| WxMall mall = wxMallService.getByTenantId(tenantId); | |||
| if(StringUtils.isNotBlank(mall.getParentTenantId())){ | |||
| parenTenantId = mall.getParentTenantId(); | |||
| } | |||
| }else{ | |||
| tenantId = (String)request.getSession().getAttribute(UserSession.tenantId); | |||
| parenTenantId = (String)request.getSession().getAttribute(UserSession.parentTenantId); | |||
| } | |||
| TenantThreadLocal.setCurrentThreadTenant(tenantId, parenTenantId); | |||
| TenantIgnore annotation = null; | |||
| if(handler instanceof HandlerMethod) { | |||
| @@ -22,6 +22,7 @@ public class TenantInfoImpl implements TenantInfo { | |||
| "mall_permission", | |||
| "mall_sale_type", | |||
| "mall_user_role", | |||
| "wx_brand", | |||
| "wx_channel", | |||
| "wx_business", | |||
| "wx_sub_business", | |||
| @@ -65,6 +66,9 @@ public class TenantInfoImpl implements TenantInfo { | |||
| "fengniao_map_config", | |||
| "wx_c_user", | |||
| "tt_c_user", | |||
| "tt_buser", | |||
| "wx_buser", | |||
| "wx_merchant_b_user", | |||
| "wx_user_visit", | |||
| "tt_goods_category", | |||
| @@ -74,8 +78,12 @@ public class TenantInfoImpl implements TenantInfo { | |||
| "wx_mall", | |||
| "wx_appinfo", | |||
| "wx_authorizer_info", | |||
| "wx_brand", | |||
| "wx_c_user", | |||
| "tt_c_user", | |||
| "tt_buser", | |||
| "wx_buser", | |||
| "wx_merchant_b_user", | |||
| "wx_user_visit", | |||
| "wx_c_user_car", | |||
| "wx_c_user_from_b", | |||
| @@ -0,0 +1,9 @@ | |||
| INSERT INTO `mallink`.`mall_permission`(`id`, `name`, `parent_id`, `available`, `permission`, `resource_type`, `module_color`, `module_color_num`, `url`, `icon`, `version_type`, `sort`) VALUES (648, '抖音平台券', 602, 'Y', NULL, 1, NULL, NULL, 'douyinPlatCoupon', NULL, 0, 648); | |||
| INSERT INTO `mallink`.`mall_permission`(`id`, `name`, `parent_id`, `available`, `permission`, `resource_type`, `module_color`, `module_color_num`, `url`, `icon`, `version_type`, `sort`) VALUES (649, '抖音品牌券', 602, 'Y', NULL, 1, NULL, NULL, 'douyinBrandCoupon', NULL, 0, 649); | |||
| INSERT INTO `mallink`.`mall_sale_type`(`id`, `name`, `type`, `period`, `menus`) VALUES (101, '抖音集团版', 101, 12, '[1, 2, 4, 5, 6, 50, 105, 110, 201, 205, 202, 211, 212, 221, 222, 223, 224, 251, 409, 410, 411, 416, 500, 502, 504, 505, 506, 507, 511, 512, 521, 522, 523, 591, 592, 595, 601, 602, 605, 606, 610, 615, 622, 648, 649, 676, 680, 711, 901, 902, 904, 907, 61501, 61502]'); | |||
| INSERT INTO `mallink`.`mall_permission`(`id`, `name`, `parent_id`, `available`, `permission`, `resource_type`, `module_color`, `module_color_num`, `url`, `icon`, `version_type`, `sort`) VALUES (650, '抖音平台券', 602, 'Y', NULL, 1, NULL, NULL, 'douyinSubPlatCoupon', NULL, 0, 650); | |||
| INSERT INTO `mallink`.`mall_sale_type`(`id`, `name`, `type`, `period`, `menus`) VALUES (102, '抖音集团子版', 102, 12, '[1, 2, 4, 5, 6, 50, 105, 110, 201, 205, 202, 211, 212, 221, 222, 223, 224, 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, 650, 676, 680, 711, 901, 902, 904, 907, 5310, 5320, 61501, 61502]'); | |||
| @@ -0,0 +1,200 @@ | |||
| ALTER TABLE `mallink`.`wx_coupon_0` | |||
| ADD COLUMN `brand` bigint(20) COMMENT '品牌' AFTER `make_merchant_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_1` | |||
| ADD COLUMN `brand` bigint(20) COMMENT '品牌' AFTER `make_merchant_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_2` | |||
| ADD COLUMN `brand` bigint(20) COMMENT '品牌' AFTER `make_merchant_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_3` | |||
| ADD COLUMN `brand` bigint(20) COMMENT '品牌' AFTER `make_merchant_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_4` | |||
| ADD COLUMN `brand` bigint(20) COMMENT '品牌' AFTER `make_merchant_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_5` | |||
| ADD COLUMN `brand` bigint(20) COMMENT '品牌' AFTER `make_merchant_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_6` | |||
| ADD COLUMN `brand` bigint(20) COMMENT '品牌' AFTER `make_merchant_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_7` | |||
| ADD COLUMN `brand` bigint(20) COMMENT '品牌' AFTER `make_merchant_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_8` | |||
| ADD COLUMN `brand` bigint(20) COMMENT '品牌' AFTER `make_merchant_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_9` | |||
| ADD COLUMN `brand` bigint(20) COMMENT '品牌' AFTER `make_merchant_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_10` | |||
| ADD COLUMN `brand` bigint(20) COMMENT '品牌' AFTER `make_merchant_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_11` | |||
| ADD COLUMN `brand` bigint(20) COMMENT '品牌' AFTER `make_merchant_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_12` | |||
| ADD COLUMN `brand` bigint(20) COMMENT '品牌' AFTER `make_merchant_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_13` | |||
| ADD COLUMN `brand` bigint(20) COMMENT '品牌' AFTER `make_merchant_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_14` | |||
| ADD COLUMN `brand` bigint(20) COMMENT '品牌' AFTER `make_merchant_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_15` | |||
| ADD COLUMN `brand` bigint(20) COMMENT '品牌' AFTER `make_merchant_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_16` | |||
| ADD COLUMN `brand` bigint(20) COMMENT '品牌' AFTER `make_merchant_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_17` | |||
| ADD COLUMN `brand` bigint(20) COMMENT '品牌' AFTER `make_merchant_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_18` | |||
| ADD COLUMN `brand` bigint(20) COMMENT '品牌' AFTER `make_merchant_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_19` | |||
| ADD COLUMN `brand` bigint(20) COMMENT '品牌' AFTER `make_merchant_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_20` | |||
| ADD COLUMN `brand` bigint(20) COMMENT '品牌' AFTER `make_merchant_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_21` | |||
| ADD COLUMN `brand` bigint(20) COMMENT '品牌' AFTER `make_merchant_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_22` | |||
| ADD COLUMN `brand` bigint(20) COMMENT '品牌' AFTER `make_merchant_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_23` | |||
| ADD COLUMN `brand` bigint(20) COMMENT '品牌' AFTER `make_merchant_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_24` | |||
| ADD COLUMN `brand` bigint(20) COMMENT '品牌' AFTER `make_merchant_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_25` | |||
| ADD COLUMN `brand` bigint(20) COMMENT '品牌' AFTER `make_merchant_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_26` | |||
| ADD COLUMN `brand` bigint(20) COMMENT '品牌' AFTER `make_merchant_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_27` | |||
| ADD COLUMN `brand` bigint(20) COMMENT '品牌' AFTER `make_merchant_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_28` | |||
| ADD COLUMN `brand` bigint(20) COMMENT '品牌' AFTER `make_merchant_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_29` | |||
| ADD COLUMN `brand` bigint(20) COMMENT '品牌' AFTER `make_merchant_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_30` | |||
| ADD COLUMN `brand` bigint(20) COMMENT '品牌' AFTER `make_merchant_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_31` | |||
| ADD COLUMN `brand` bigint(20) COMMENT '品牌' AFTER `make_merchant_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_32` | |||
| ADD COLUMN `brand` bigint(20) COMMENT '品牌' AFTER `make_merchant_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_33` | |||
| ADD COLUMN `brand` bigint(20) COMMENT '品牌' AFTER `make_merchant_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_34` | |||
| ADD COLUMN `brand` bigint(20) COMMENT '品牌' AFTER `make_merchant_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_35` | |||
| ADD COLUMN `brand` bigint(20) COMMENT '品牌' AFTER `make_merchant_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_36` | |||
| ADD COLUMN `brand` bigint(20) COMMENT '品牌' AFTER `make_merchant_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_37` | |||
| ADD COLUMN `brand` bigint(20) COMMENT '品牌' AFTER `make_merchant_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_38` | |||
| ADD COLUMN `brand` bigint(20) COMMENT '品牌' AFTER `make_merchant_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_39` | |||
| ADD COLUMN `brand` bigint(20) COMMENT '品牌' AFTER `make_merchant_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_40` | |||
| ADD COLUMN `brand` bigint(20) COMMENT '品牌' AFTER `make_merchant_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_41` | |||
| ADD COLUMN `brand` bigint(20) COMMENT '品牌' AFTER `make_merchant_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_42` | |||
| ADD COLUMN `brand` bigint(20) COMMENT '品牌' AFTER `make_merchant_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_43` | |||
| ADD COLUMN `brand` bigint(20) COMMENT '品牌' AFTER `make_merchant_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_44` | |||
| ADD COLUMN `brand` bigint(20) COMMENT '品牌' AFTER `make_merchant_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_45` | |||
| ADD COLUMN `brand` bigint(20) COMMENT '品牌' AFTER `make_merchant_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_46` | |||
| ADD COLUMN `brand` bigint(20) COMMENT '品牌' AFTER `make_merchant_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_47` | |||
| ADD COLUMN `brand` bigint(20) COMMENT '品牌' AFTER `make_merchant_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_48` | |||
| ADD COLUMN `brand` bigint(20) COMMENT '品牌' AFTER `make_merchant_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_49` | |||
| ADD COLUMN `brand` bigint(20) COMMENT '品牌' AFTER `make_merchant_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_50` | |||
| ADD COLUMN `brand` bigint(20) COMMENT '品牌' AFTER `make_merchant_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_51` | |||
| ADD COLUMN `brand` bigint(20) COMMENT '品牌' AFTER `make_merchant_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_52` | |||
| ADD COLUMN `brand` bigint(20) COMMENT '品牌' AFTER `make_merchant_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_53` | |||
| ADD COLUMN `brand` bigint(20) COMMENT '品牌' AFTER `make_merchant_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_54` | |||
| ADD COLUMN `brand` bigint(20) COMMENT '品牌' AFTER `make_merchant_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_55` | |||
| ADD COLUMN `brand` bigint(20) COMMENT '品牌' AFTER `make_merchant_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_56` | |||
| ADD COLUMN `brand` bigint(20) COMMENT '品牌' AFTER `make_merchant_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_57` | |||
| ADD COLUMN `brand` bigint(20) COMMENT '品牌' AFTER `make_merchant_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_58` | |||
| ADD COLUMN `brand` bigint(20) COMMENT '品牌' AFTER `make_merchant_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_59` | |||
| ADD COLUMN `brand` bigint(20) COMMENT '品牌' AFTER `make_merchant_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_60` | |||
| ADD COLUMN `brand` bigint(20) COMMENT '品牌' AFTER `make_merchant_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_61` | |||
| ADD COLUMN `brand` bigint(20) COMMENT '品牌' AFTER `make_merchant_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_62` | |||
| ADD COLUMN `brand` bigint(20) COMMENT '品牌' AFTER `make_merchant_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_63` | |||
| ADD COLUMN `brand` bigint(20) COMMENT '品牌' AFTER `make_merchant_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_64` | |||
| ADD COLUMN `brand` bigint(20) COMMENT '品牌' AFTER `make_merchant_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_65` | |||
| ADD COLUMN `brand` bigint(20) COMMENT '品牌' AFTER `make_merchant_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_66` | |||
| ADD COLUMN `brand` bigint(20) COMMENT '品牌' AFTER `make_merchant_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_67` | |||
| ADD COLUMN `brand` bigint(20) COMMENT '品牌' AFTER `make_merchant_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_68` | |||
| ADD COLUMN `brand` bigint(20) COMMENT '品牌' AFTER `make_merchant_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_69` | |||
| ADD COLUMN `brand` bigint(20) COMMENT '品牌' AFTER `make_merchant_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_70` | |||
| ADD COLUMN `brand` bigint(20) COMMENT '品牌' AFTER `make_merchant_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_71` | |||
| ADD COLUMN `brand` bigint(20) COMMENT '品牌' AFTER `make_merchant_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_72` | |||
| ADD COLUMN `brand` bigint(20) COMMENT '品牌' AFTER `make_merchant_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_73` | |||
| ADD COLUMN `brand` bigint(20) COMMENT '品牌' AFTER `make_merchant_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_74` | |||
| ADD COLUMN `brand` bigint(20) COMMENT '品牌' AFTER `make_merchant_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_75` | |||
| ADD COLUMN `brand` bigint(20) COMMENT '品牌' AFTER `make_merchant_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_76` | |||
| ADD COLUMN `brand` bigint(20) COMMENT '品牌' AFTER `make_merchant_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_77` | |||
| ADD COLUMN `brand` bigint(20) COMMENT '品牌' AFTER `make_merchant_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_78` | |||
| ADD COLUMN `brand` bigint(20) COMMENT '品牌' AFTER `make_merchant_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_79` | |||
| ADD COLUMN `brand` bigint(20) COMMENT '品牌' AFTER `make_merchant_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_80` | |||
| ADD COLUMN `brand` bigint(20) COMMENT '品牌' AFTER `make_merchant_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_81` | |||
| ADD COLUMN `brand` bigint(20) COMMENT '品牌' AFTER `make_merchant_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_82` | |||
| ADD COLUMN `brand` bigint(20) COMMENT '品牌' AFTER `make_merchant_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_83` | |||
| ADD COLUMN `brand` bigint(20) COMMENT '品牌' AFTER `make_merchant_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_84` | |||
| ADD COLUMN `brand` bigint(20) COMMENT '品牌' AFTER `make_merchant_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_85` | |||
| ADD COLUMN `brand` bigint(20) COMMENT '品牌' AFTER `make_merchant_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_86` | |||
| ADD COLUMN `brand` bigint(20) COMMENT '品牌' AFTER `make_merchant_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_87` | |||
| ADD COLUMN `brand` bigint(20) COMMENT '品牌' AFTER `make_merchant_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_88` | |||
| ADD COLUMN `brand` bigint(20) COMMENT '品牌' AFTER `make_merchant_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_89` | |||
| ADD COLUMN `brand` bigint(20) COMMENT '品牌' AFTER `make_merchant_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_90` | |||
| ADD COLUMN `brand` bigint(20) COMMENT '品牌' AFTER `make_merchant_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_91` | |||
| ADD COLUMN `brand` bigint(20) COMMENT '品牌' AFTER `make_merchant_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_92` | |||
| ADD COLUMN `brand` bigint(20) COMMENT '品牌' AFTER `make_merchant_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_93` | |||
| ADD COLUMN `brand` bigint(20) COMMENT '品牌' AFTER `make_merchant_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_94` | |||
| ADD COLUMN `brand` bigint(20) COMMENT '品牌' AFTER `make_merchant_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_95` | |||
| ADD COLUMN `brand` bigint(20) COMMENT '品牌' AFTER `make_merchant_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_96` | |||
| ADD COLUMN `brand` bigint(20) COMMENT '品牌' AFTER `make_merchant_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_97` | |||
| ADD COLUMN `brand` bigint(20) COMMENT '品牌' AFTER `make_merchant_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_98` | |||
| ADD COLUMN `brand` bigint(20) COMMENT '品牌' AFTER `make_merchant_id`; | |||
| ALTER TABLE `mallink`.`wx_coupon_99` | |||
| ADD COLUMN `brand` bigint(20) COMMENT '品牌' AFTER `make_merchant_id`; | |||
| @@ -0,0 +1,11 @@ | |||
| --历史品牌数据 | |||
| UPDATE `mallink`.`wx_brand` SET `tenant_id` = `parent_tenant_id` WHERE `parent_tenant_id` is not null and `parent_tenant_id` != ''; | |||
| UPDATE `mallink`.`wx_brand` SET `parent_tenant_id` = null; | |||
| --appinfo | |||
| ALTER TABLE `mallink`.`wx_appinfo` | |||
| DROP INDEX `appid_index`, | |||
| ADD INDEX `appid_index`(`app_id`, `tenant_id`) USING BTREE; | |||
| @@ -0,0 +1,6 @@ | |||
| INSERT INTO `mallink`.`mall_permission`(`id`, `name`, `parent_id`, `available`, `permission`, `resource_type`, `module_color`, `module_color_num`, `url`, `icon`, `version_type`, `sort`) VALUES (71101, '集团券订单', 610, 'Y', NULL, 1, NULL, NULL, 'groupOrderList', NULL, 0, 711); | |||
| INSERT INTO `mallink`.`mall_permission`(`id`, `name`, `parent_id`, `available`, `permission`, `resource_type`, `module_color`, `module_color_num`, `url`, `icon`, `version_type`, `sort`) VALUES (41001, '集团自动分账', 416, 'Y', NULL, 1, NULL, NULL, 'groupSharingOrderList', NULL, 0, 412); | |||
| UPDATE `mallink`.`mall_sale_type` SET `menus` = '[1, 2, 4, 5, 6, 50, 105, 110, 201, 205, 202, 211, 212, 221, 222, 223, 224, 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, 650, 676, 680, 711, 901, 902, 904, 907, 41001, 5310, 5320, 61501, 61502, 71101]' WHERE `id` = 102; | |||
| @@ -0,0 +1,200 @@ | |||
| ALTER TABLE `mallink`.`wx_profit_sharing_order_0` | |||
| ADD COLUMN `sharing_merchant_id` bigint(20) COMMENT '实际到账商户' AFTER `pay_merchant_mch_id`; | |||
| ALTER TABLE `mallink`.`wx_profit_sharing_order_1` | |||
| ADD COLUMN `sharing_merchant_id` bigint(20) COMMENT '实际到账商户' AFTER `pay_merchant_mch_id`; | |||
| ALTER TABLE `mallink`.`wx_profit_sharing_order_2` | |||
| ADD COLUMN `sharing_merchant_id` bigint(20) COMMENT '实际到账商户' AFTER `pay_merchant_mch_id`; | |||
| ALTER TABLE `mallink`.`wx_profit_sharing_order_3` | |||
| ADD COLUMN `sharing_merchant_id` bigint(20) COMMENT '实际到账商户' AFTER `pay_merchant_mch_id`; | |||
| ALTER TABLE `mallink`.`wx_profit_sharing_order_4` | |||
| ADD COLUMN `sharing_merchant_id` bigint(20) COMMENT '实际到账商户' AFTER `pay_merchant_mch_id`; | |||
| ALTER TABLE `mallink`.`wx_profit_sharing_order_5` | |||
| ADD COLUMN `sharing_merchant_id` bigint(20) COMMENT '实际到账商户' AFTER `pay_merchant_mch_id`; | |||
| ALTER TABLE `mallink`.`wx_profit_sharing_order_6` | |||
| ADD COLUMN `sharing_merchant_id` bigint(20) COMMENT '实际到账商户' AFTER `pay_merchant_mch_id`; | |||
| ALTER TABLE `mallink`.`wx_profit_sharing_order_7` | |||
| ADD COLUMN `sharing_merchant_id` bigint(20) COMMENT '实际到账商户' AFTER `pay_merchant_mch_id`; | |||
| ALTER TABLE `mallink`.`wx_profit_sharing_order_8` | |||
| ADD COLUMN `sharing_merchant_id` bigint(20) COMMENT '实际到账商户' AFTER `pay_merchant_mch_id`; | |||
| ALTER TABLE `mallink`.`wx_profit_sharing_order_9` | |||
| ADD COLUMN `sharing_merchant_id` bigint(20) COMMENT '实际到账商户' AFTER `pay_merchant_mch_id`; | |||
| ALTER TABLE `mallink`.`wx_profit_sharing_order_10` | |||
| ADD COLUMN `sharing_merchant_id` bigint(20) COMMENT '实际到账商户' AFTER `pay_merchant_mch_id`; | |||
| ALTER TABLE `mallink`.`wx_profit_sharing_order_11` | |||
| ADD COLUMN `sharing_merchant_id` bigint(20) COMMENT '实际到账商户' AFTER `pay_merchant_mch_id`; | |||
| ALTER TABLE `mallink`.`wx_profit_sharing_order_12` | |||
| ADD COLUMN `sharing_merchant_id` bigint(20) COMMENT '实际到账商户' AFTER `pay_merchant_mch_id`; | |||
| ALTER TABLE `mallink`.`wx_profit_sharing_order_13` | |||
| ADD COLUMN `sharing_merchant_id` bigint(20) COMMENT '实际到账商户' AFTER `pay_merchant_mch_id`; | |||
| ALTER TABLE `mallink`.`wx_profit_sharing_order_14` | |||
| ADD COLUMN `sharing_merchant_id` bigint(20) COMMENT '实际到账商户' AFTER `pay_merchant_mch_id`; | |||
| ALTER TABLE `mallink`.`wx_profit_sharing_order_15` | |||
| ADD COLUMN `sharing_merchant_id` bigint(20) COMMENT '实际到账商户' AFTER `pay_merchant_mch_id`; | |||
| ALTER TABLE `mallink`.`wx_profit_sharing_order_16` | |||
| ADD COLUMN `sharing_merchant_id` bigint(20) COMMENT '实际到账商户' AFTER `pay_merchant_mch_id`; | |||
| ALTER TABLE `mallink`.`wx_profit_sharing_order_17` | |||
| ADD COLUMN `sharing_merchant_id` bigint(20) COMMENT '实际到账商户' AFTER `pay_merchant_mch_id`; | |||
| ALTER TABLE `mallink`.`wx_profit_sharing_order_18` | |||
| ADD COLUMN `sharing_merchant_id` bigint(20) COMMENT '实际到账商户' AFTER `pay_merchant_mch_id`; | |||
| ALTER TABLE `mallink`.`wx_profit_sharing_order_19` | |||
| ADD COLUMN `sharing_merchant_id` bigint(20) COMMENT '实际到账商户' AFTER `pay_merchant_mch_id`; | |||
| ALTER TABLE `mallink`.`wx_profit_sharing_order_20` | |||
| ADD COLUMN `sharing_merchant_id` bigint(20) COMMENT '实际到账商户' AFTER `pay_merchant_mch_id`; | |||
| ALTER TABLE `mallink`.`wx_profit_sharing_order_21` | |||
| ADD COLUMN `sharing_merchant_id` bigint(20) COMMENT '实际到账商户' AFTER `pay_merchant_mch_id`; | |||
| ALTER TABLE `mallink`.`wx_profit_sharing_order_22` | |||
| ADD COLUMN `sharing_merchant_id` bigint(20) COMMENT '实际到账商户' AFTER `pay_merchant_mch_id`; | |||
| ALTER TABLE `mallink`.`wx_profit_sharing_order_23` | |||
| ADD COLUMN `sharing_merchant_id` bigint(20) COMMENT '实际到账商户' AFTER `pay_merchant_mch_id`; | |||
| ALTER TABLE `mallink`.`wx_profit_sharing_order_24` | |||
| ADD COLUMN `sharing_merchant_id` bigint(20) COMMENT '实际到账商户' AFTER `pay_merchant_mch_id`; | |||
| ALTER TABLE `mallink`.`wx_profit_sharing_order_25` | |||
| ADD COLUMN `sharing_merchant_id` bigint(20) COMMENT '实际到账商户' AFTER `pay_merchant_mch_id`; | |||
| ALTER TABLE `mallink`.`wx_profit_sharing_order_26` | |||
| ADD COLUMN `sharing_merchant_id` bigint(20) COMMENT '实际到账商户' AFTER `pay_merchant_mch_id`; | |||
| ALTER TABLE `mallink`.`wx_profit_sharing_order_27` | |||
| ADD COLUMN `sharing_merchant_id` bigint(20) COMMENT '实际到账商户' AFTER `pay_merchant_mch_id`; | |||
| ALTER TABLE `mallink`.`wx_profit_sharing_order_28` | |||
| ADD COLUMN `sharing_merchant_id` bigint(20) COMMENT '实际到账商户' AFTER `pay_merchant_mch_id`; | |||
| ALTER TABLE `mallink`.`wx_profit_sharing_order_29` | |||
| ADD COLUMN `sharing_merchant_id` bigint(20) COMMENT '实际到账商户' AFTER `pay_merchant_mch_id`; | |||
| ALTER TABLE `mallink`.`wx_profit_sharing_order_30` | |||
| ADD COLUMN `sharing_merchant_id` bigint(20) COMMENT '实际到账商户' AFTER `pay_merchant_mch_id`; | |||
| ALTER TABLE `mallink`.`wx_profit_sharing_order_31` | |||
| ADD COLUMN `sharing_merchant_id` bigint(20) COMMENT '实际到账商户' AFTER `pay_merchant_mch_id`; | |||
| ALTER TABLE `mallink`.`wx_profit_sharing_order_32` | |||
| ADD COLUMN `sharing_merchant_id` bigint(20) COMMENT '实际到账商户' AFTER `pay_merchant_mch_id`; | |||
| ALTER TABLE `mallink`.`wx_profit_sharing_order_33` | |||
| ADD COLUMN `sharing_merchant_id` bigint(20) COMMENT '实际到账商户' AFTER `pay_merchant_mch_id`; | |||
| ALTER TABLE `mallink`.`wx_profit_sharing_order_34` | |||
| ADD COLUMN `sharing_merchant_id` bigint(20) COMMENT '实际到账商户' AFTER `pay_merchant_mch_id`; | |||
| ALTER TABLE `mallink`.`wx_profit_sharing_order_35` | |||
| ADD COLUMN `sharing_merchant_id` bigint(20) COMMENT '实际到账商户' AFTER `pay_merchant_mch_id`; | |||
| ALTER TABLE `mallink`.`wx_profit_sharing_order_36` | |||
| ADD COLUMN `sharing_merchant_id` bigint(20) COMMENT '实际到账商户' AFTER `pay_merchant_mch_id`; | |||
| ALTER TABLE `mallink`.`wx_profit_sharing_order_37` | |||
| ADD COLUMN `sharing_merchant_id` bigint(20) COMMENT '实际到账商户' AFTER `pay_merchant_mch_id`; | |||
| ALTER TABLE `mallink`.`wx_profit_sharing_order_38` | |||
| ADD COLUMN `sharing_merchant_id` bigint(20) COMMENT '实际到账商户' AFTER `pay_merchant_mch_id`; | |||
| ALTER TABLE `mallink`.`wx_profit_sharing_order_39` | |||
| ADD COLUMN `sharing_merchant_id` bigint(20) COMMENT '实际到账商户' AFTER `pay_merchant_mch_id`; | |||
| ALTER TABLE `mallink`.`wx_profit_sharing_order_40` | |||
| ADD COLUMN `sharing_merchant_id` bigint(20) COMMENT '实际到账商户' AFTER `pay_merchant_mch_id`; | |||
| ALTER TABLE `mallink`.`wx_profit_sharing_order_41` | |||
| ADD COLUMN `sharing_merchant_id` bigint(20) COMMENT '实际到账商户' AFTER `pay_merchant_mch_id`; | |||
| ALTER TABLE `mallink`.`wx_profit_sharing_order_42` | |||
| ADD COLUMN `sharing_merchant_id` bigint(20) COMMENT '实际到账商户' AFTER `pay_merchant_mch_id`; | |||
| ALTER TABLE `mallink`.`wx_profit_sharing_order_43` | |||
| ADD COLUMN `sharing_merchant_id` bigint(20) COMMENT '实际到账商户' AFTER `pay_merchant_mch_id`; | |||
| ALTER TABLE `mallink`.`wx_profit_sharing_order_44` | |||
| ADD COLUMN `sharing_merchant_id` bigint(20) COMMENT '实际到账商户' AFTER `pay_merchant_mch_id`; | |||
| ALTER TABLE `mallink`.`wx_profit_sharing_order_45` | |||
| ADD COLUMN `sharing_merchant_id` bigint(20) COMMENT '实际到账商户' AFTER `pay_merchant_mch_id`; | |||
| ALTER TABLE `mallink`.`wx_profit_sharing_order_46` | |||
| ADD COLUMN `sharing_merchant_id` bigint(20) COMMENT '实际到账商户' AFTER `pay_merchant_mch_id`; | |||
| ALTER TABLE `mallink`.`wx_profit_sharing_order_47` | |||
| ADD COLUMN `sharing_merchant_id` bigint(20) COMMENT '实际到账商户' AFTER `pay_merchant_mch_id`; | |||
| ALTER TABLE `mallink`.`wx_profit_sharing_order_48` | |||
| ADD COLUMN `sharing_merchant_id` bigint(20) COMMENT '实际到账商户' AFTER `pay_merchant_mch_id`; | |||
| ALTER TABLE `mallink`.`wx_profit_sharing_order_49` | |||
| ADD COLUMN `sharing_merchant_id` bigint(20) COMMENT '实际到账商户' AFTER `pay_merchant_mch_id`; | |||
| ALTER TABLE `mallink`.`wx_profit_sharing_order_50` | |||
| ADD COLUMN `sharing_merchant_id` bigint(20) COMMENT '实际到账商户' AFTER `pay_merchant_mch_id`; | |||
| ALTER TABLE `mallink`.`wx_profit_sharing_order_51` | |||
| ADD COLUMN `sharing_merchant_id` bigint(20) COMMENT '实际到账商户' AFTER `pay_merchant_mch_id`; | |||
| ALTER TABLE `mallink`.`wx_profit_sharing_order_52` | |||
| ADD COLUMN `sharing_merchant_id` bigint(20) COMMENT '实际到账商户' AFTER `pay_merchant_mch_id`; | |||
| ALTER TABLE `mallink`.`wx_profit_sharing_order_53` | |||
| ADD COLUMN `sharing_merchant_id` bigint(20) COMMENT '实际到账商户' AFTER `pay_merchant_mch_id`; | |||
| ALTER TABLE `mallink`.`wx_profit_sharing_order_54` | |||
| ADD COLUMN `sharing_merchant_id` bigint(20) COMMENT '实际到账商户' AFTER `pay_merchant_mch_id`; | |||
| ALTER TABLE `mallink`.`wx_profit_sharing_order_55` | |||
| ADD COLUMN `sharing_merchant_id` bigint(20) COMMENT '实际到账商户' AFTER `pay_merchant_mch_id`; | |||
| ALTER TABLE `mallink`.`wx_profit_sharing_order_56` | |||
| ADD COLUMN `sharing_merchant_id` bigint(20) COMMENT '实际到账商户' AFTER `pay_merchant_mch_id`; | |||
| ALTER TABLE `mallink`.`wx_profit_sharing_order_57` | |||
| ADD COLUMN `sharing_merchant_id` bigint(20) COMMENT '实际到账商户' AFTER `pay_merchant_mch_id`; | |||
| ALTER TABLE `mallink`.`wx_profit_sharing_order_58` | |||
| ADD COLUMN `sharing_merchant_id` bigint(20) COMMENT '实际到账商户' AFTER `pay_merchant_mch_id`; | |||
| ALTER TABLE `mallink`.`wx_profit_sharing_order_59` | |||
| ADD COLUMN `sharing_merchant_id` bigint(20) COMMENT '实际到账商户' AFTER `pay_merchant_mch_id`; | |||
| ALTER TABLE `mallink`.`wx_profit_sharing_order_60` | |||
| ADD COLUMN `sharing_merchant_id` bigint(20) COMMENT '实际到账商户' AFTER `pay_merchant_mch_id`; | |||
| ALTER TABLE `mallink`.`wx_profit_sharing_order_61` | |||
| ADD COLUMN `sharing_merchant_id` bigint(20) COMMENT '实际到账商户' AFTER `pay_merchant_mch_id`; | |||
| ALTER TABLE `mallink`.`wx_profit_sharing_order_62` | |||
| ADD COLUMN `sharing_merchant_id` bigint(20) COMMENT '实际到账商户' AFTER `pay_merchant_mch_id`; | |||
| ALTER TABLE `mallink`.`wx_profit_sharing_order_63` | |||
| ADD COLUMN `sharing_merchant_id` bigint(20) COMMENT '实际到账商户' AFTER `pay_merchant_mch_id`; | |||
| ALTER TABLE `mallink`.`wx_profit_sharing_order_64` | |||
| ADD COLUMN `sharing_merchant_id` bigint(20) COMMENT '实际到账商户' AFTER `pay_merchant_mch_id`; | |||
| ALTER TABLE `mallink`.`wx_profit_sharing_order_65` | |||
| ADD COLUMN `sharing_merchant_id` bigint(20) COMMENT '实际到账商户' AFTER `pay_merchant_mch_id`; | |||
| ALTER TABLE `mallink`.`wx_profit_sharing_order_66` | |||
| ADD COLUMN `sharing_merchant_id` bigint(20) COMMENT '实际到账商户' AFTER `pay_merchant_mch_id`; | |||
| ALTER TABLE `mallink`.`wx_profit_sharing_order_67` | |||
| ADD COLUMN `sharing_merchant_id` bigint(20) COMMENT '实际到账商户' AFTER `pay_merchant_mch_id`; | |||
| ALTER TABLE `mallink`.`wx_profit_sharing_order_68` | |||
| ADD COLUMN `sharing_merchant_id` bigint(20) COMMENT '实际到账商户' AFTER `pay_merchant_mch_id`; | |||
| ALTER TABLE `mallink`.`wx_profit_sharing_order_69` | |||
| ADD COLUMN `sharing_merchant_id` bigint(20) COMMENT '实际到账商户' AFTER `pay_merchant_mch_id`; | |||
| ALTER TABLE `mallink`.`wx_profit_sharing_order_70` | |||
| ADD COLUMN `sharing_merchant_id` bigint(20) COMMENT '实际到账商户' AFTER `pay_merchant_mch_id`; | |||
| ALTER TABLE `mallink`.`wx_profit_sharing_order_71` | |||
| ADD COLUMN `sharing_merchant_id` bigint(20) COMMENT '实际到账商户' AFTER `pay_merchant_mch_id`; | |||
| ALTER TABLE `mallink`.`wx_profit_sharing_order_72` | |||
| ADD COLUMN `sharing_merchant_id` bigint(20) COMMENT '实际到账商户' AFTER `pay_merchant_mch_id`; | |||
| ALTER TABLE `mallink`.`wx_profit_sharing_order_73` | |||
| ADD COLUMN `sharing_merchant_id` bigint(20) COMMENT '实际到账商户' AFTER `pay_merchant_mch_id`; | |||
| ALTER TABLE `mallink`.`wx_profit_sharing_order_74` | |||
| ADD COLUMN `sharing_merchant_id` bigint(20) COMMENT '实际到账商户' AFTER `pay_merchant_mch_id`; | |||
| ALTER TABLE `mallink`.`wx_profit_sharing_order_75` | |||
| ADD COLUMN `sharing_merchant_id` bigint(20) COMMENT '实际到账商户' AFTER `pay_merchant_mch_id`; | |||
| ALTER TABLE `mallink`.`wx_profit_sharing_order_76` | |||
| ADD COLUMN `sharing_merchant_id` bigint(20) COMMENT '实际到账商户' AFTER `pay_merchant_mch_id`; | |||
| ALTER TABLE `mallink`.`wx_profit_sharing_order_77` | |||
| ADD COLUMN `sharing_merchant_id` bigint(20) COMMENT '实际到账商户' AFTER `pay_merchant_mch_id`; | |||
| ALTER TABLE `mallink`.`wx_profit_sharing_order_78` | |||
| ADD COLUMN `sharing_merchant_id` bigint(20) COMMENT '实际到账商户' AFTER `pay_merchant_mch_id`; | |||
| ALTER TABLE `mallink`.`wx_profit_sharing_order_79` | |||
| ADD COLUMN `sharing_merchant_id` bigint(20) COMMENT '实际到账商户' AFTER `pay_merchant_mch_id`; | |||
| ALTER TABLE `mallink`.`wx_profit_sharing_order_80` | |||
| ADD COLUMN `sharing_merchant_id` bigint(20) COMMENT '实际到账商户' AFTER `pay_merchant_mch_id`; | |||
| ALTER TABLE `mallink`.`wx_profit_sharing_order_81` | |||
| ADD COLUMN `sharing_merchant_id` bigint(20) COMMENT '实际到账商户' AFTER `pay_merchant_mch_id`; | |||
| ALTER TABLE `mallink`.`wx_profit_sharing_order_82` | |||
| ADD COLUMN `sharing_merchant_id` bigint(20) COMMENT '实际到账商户' AFTER `pay_merchant_mch_id`; | |||
| ALTER TABLE `mallink`.`wx_profit_sharing_order_83` | |||
| ADD COLUMN `sharing_merchant_id` bigint(20) COMMENT '实际到账商户' AFTER `pay_merchant_mch_id`; | |||
| ALTER TABLE `mallink`.`wx_profit_sharing_order_84` | |||
| ADD COLUMN `sharing_merchant_id` bigint(20) COMMENT '实际到账商户' AFTER `pay_merchant_mch_id`; | |||
| ALTER TABLE `mallink`.`wx_profit_sharing_order_85` | |||
| ADD COLUMN `sharing_merchant_id` bigint(20) COMMENT '实际到账商户' AFTER `pay_merchant_mch_id`; | |||
| ALTER TABLE `mallink`.`wx_profit_sharing_order_86` | |||
| ADD COLUMN `sharing_merchant_id` bigint(20) COMMENT '实际到账商户' AFTER `pay_merchant_mch_id`; | |||
| ALTER TABLE `mallink`.`wx_profit_sharing_order_87` | |||
| ADD COLUMN `sharing_merchant_id` bigint(20) COMMENT '实际到账商户' AFTER `pay_merchant_mch_id`; | |||
| ALTER TABLE `mallink`.`wx_profit_sharing_order_88` | |||
| ADD COLUMN `sharing_merchant_id` bigint(20) COMMENT '实际到账商户' AFTER `pay_merchant_mch_id`; | |||
| ALTER TABLE `mallink`.`wx_profit_sharing_order_89` | |||
| ADD COLUMN `sharing_merchant_id` bigint(20) COMMENT '实际到账商户' AFTER `pay_merchant_mch_id`; | |||
| ALTER TABLE `mallink`.`wx_profit_sharing_order_90` | |||
| ADD COLUMN `sharing_merchant_id` bigint(20) COMMENT '实际到账商户' AFTER `pay_merchant_mch_id`; | |||
| ALTER TABLE `mallink`.`wx_profit_sharing_order_91` | |||
| ADD COLUMN `sharing_merchant_id` bigint(20) COMMENT '实际到账商户' AFTER `pay_merchant_mch_id`; | |||
| ALTER TABLE `mallink`.`wx_profit_sharing_order_92` | |||
| ADD COLUMN `sharing_merchant_id` bigint(20) COMMENT '实际到账商户' AFTER `pay_merchant_mch_id`; | |||
| ALTER TABLE `mallink`.`wx_profit_sharing_order_93` | |||
| ADD COLUMN `sharing_merchant_id` bigint(20) COMMENT '实际到账商户' AFTER `pay_merchant_mch_id`; | |||
| ALTER TABLE `mallink`.`wx_profit_sharing_order_94` | |||
| ADD COLUMN `sharing_merchant_id` bigint(20) COMMENT '实际到账商户' AFTER `pay_merchant_mch_id`; | |||
| ALTER TABLE `mallink`.`wx_profit_sharing_order_95` | |||
| ADD COLUMN `sharing_merchant_id` bigint(20) COMMENT '实际到账商户' AFTER `pay_merchant_mch_id`; | |||
| ALTER TABLE `mallink`.`wx_profit_sharing_order_96` | |||
| ADD COLUMN `sharing_merchant_id` bigint(20) COMMENT '实际到账商户' AFTER `pay_merchant_mch_id`; | |||
| ALTER TABLE `mallink`.`wx_profit_sharing_order_97` | |||
| ADD COLUMN `sharing_merchant_id` bigint(20) COMMENT '实际到账商户' AFTER `pay_merchant_mch_id`; | |||
| ALTER TABLE `mallink`.`wx_profit_sharing_order_98` | |||
| ADD COLUMN `sharing_merchant_id` bigint(20) COMMENT '实际到账商户' AFTER `pay_merchant_mch_id`; | |||
| ALTER TABLE `mallink`.`wx_profit_sharing_order_99` | |||
| ADD COLUMN `sharing_merchant_id` bigint(20) COMMENT '实际到账商户' AFTER `pay_merchant_mch_id`; | |||
| @@ -91,17 +91,8 @@ public class BaseController { | |||
| //该方法兼容微信登陆和非微信登陆 | |||
| public WxMerchantBUser getLoginBUser() { | |||
| Long wxBuserId = getWxBuserId(); | |||
| if (null != wxBuserId) { | |||
| CUser buser = getCUser(); | |||
| Long userId = buser.getUserId(); | |||
| WxMerchantBUser user = getWxMerchantBUser(userId); | |||
| user.setBuserId(buser.getId()); | |||
| return user; | |||
| }else { | |||
| Long userId = getMerchantBUserId(); | |||
| return getWxMerchantBUser(userId); | |||
| } | |||
| Long userId = getMerchantBUserId(); | |||
| return getWxMerchantBUser(userId); | |||
| } | |||
| public Long getWxBuserId() { | |||
| @@ -109,12 +100,6 @@ public class BaseController { | |||
| Long id = (Long) request.getAttribute(Constant.LOGIN_USER_KEY); | |||
| return id; | |||
| } | |||
| public WxAppinfo getCurrentApp() { | |||
| HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); | |||
| WxAppinfo appInfo = (WxAppinfo) request.getAttribute(Constant.APP_INFO); | |||
| return appInfo; | |||
| } | |||
| public CUser getCUser() { | |||
| HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); | |||
| @@ -137,13 +122,23 @@ public class BaseController { | |||
| if(user == null){ | |||
| throw new MallinkException(ErrorCode.USER_IS_EMPTY); | |||
| } | |||
| TenantEntity tenantEntity = getTenantInfo(); | |||
| if (user.getTenantId() == null) { | |||
| user.setTenantId(tenantEntity.getTenantId()); | |||
| } | |||
| if (user.getParentTenantId() == null) { | |||
| user.setParentTenantId(tenantEntity.getParentTenantId()); | |||
| } | |||
| // TenantEntity tenantEntity = getTenantInfo(); | |||
| // if (tenantEntity.isChildMall()) { | |||
| // if (user.getTenantId() == null) { | |||
| // user.setTenantId(tenantEntity.getParentTenantId()); | |||
| // } | |||
| // if (user.getParentTenantId() == null) { | |||
| // user.setParentTenantId(null); | |||
| // } | |||
| // }else { | |||
| // if (user.getTenantId() == null) { | |||
| // user.setTenantId(tenantEntity.getTenantId()); | |||
| // } | |||
| // if (user.getParentTenantId() == null) { | |||
| // user.setParentTenantId(tenantEntity.getParentTenantId()); | |||
| // } | |||
| // } | |||
| return user; | |||
| } | |||
| @@ -165,7 +160,11 @@ public class BaseController { | |||
| } | |||
| public WxAppinfo getAppInfo(String appId) { | |||
| return wxAppinfoService.getByAppId(appId); | |||
| return wxAppinfoService.getOnlyByAppIdFromRedis(appId); | |||
| } | |||
| public WxAppinfo getAppInfo(String appId,String tenantId) { | |||
| return wxAppinfoService.getByAppIdFromRedis(appId,tenantId); | |||
| } | |||
| public String getIpAddr() { | |||
| @@ -36,6 +36,8 @@ public class PosOrderController extends BaseController { | |||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | |||
| public ResultData list(@ModelAttribute PosOrder posOrder, Integer pageNum, Integer pageSize) { | |||
| if (null == posOrder) posOrder = new PosOrder(); | |||
| WxMerchantBUser user = getLoginBUser(); | |||
| posOrder.updateTenantInfo(user); | |||
| final PageInfo<PosOrder> page = posOrderService.listAsPage(posOrder, pageNum, pageSize); | |||
| return new ResultData(page); | |||
| } | |||
| @@ -72,7 +74,8 @@ public class PosOrderController extends BaseController { | |||
| @ApiOperation("根据id更新接口") | |||
| @PostMapping("update") | |||
| public ResultData update(@RequestBody PosOrder posOrder) { | |||
| posOrder.updateTenantInfo(getTenantInfo()); | |||
| WxMerchantBUser user = getLoginBUser(); | |||
| posOrder.updateTenantInfo(user); | |||
| posOrderService.saveOrUpdate(posOrder); | |||
| return new ResultData(); | |||
| } | |||
| @@ -89,7 +92,8 @@ public class PosOrderController extends BaseController { | |||
| @GetMapping("/findById") | |||
| @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) | |||
| public ResultData findById(Long id) { | |||
| return new ResultData(Result.SUCCESS, "查询成功", posOrderService.getById(id,getTenantInfo().getTenantId())); | |||
| WxMerchantBUser user = getLoginBUser(); | |||
| return new ResultData(Result.SUCCESS, "查询成功", posOrderService.getById(id,user.getTenantId())); | |||
| } | |||
| @@ -117,8 +117,7 @@ public class WxBillController extends BaseController { | |||
| if(!billFinishHasWorkFlow(wxBillAll)) { | |||
| return new ResultData(ErrorCode.FLOW_FAIL.getCode(),"商户账单完结审批不存在工作流,不能提交审批。"); | |||
| } | |||
| WxMerchantBUser buser = this.getLoginBUser(); | |||
| WxMerchantBUser buser = getLoginBUser(); | |||
| Map<String,Object> billObject = wxBillAllService.detail(wxBillAll.getId(), wxBillAll.getBillTypeValue()); | |||
| @@ -383,7 +383,8 @@ public class WxCouponController extends BaseController { | |||
| @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) | |||
| public ResultData findById(@RequestParam Long id) { | |||
| logger.debug("[" + getIpAddr() + "] WxCouponController::findById"); | |||
| return new ResultData(wxCouponService.getVoById(id,getTenantInfo().getTenantId())); | |||
| TenantEntity tenantEntity = getTenantInfo(); | |||
| return new ResultData(wxCouponService.getVoById(id,tenantEntity.getTenantId(),tenantEntity)); | |||
| } | |||
| @@ -4,10 +4,12 @@ import com.alibaba.fastjson.JSONObject; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.annotation.AuthIgnore; | |||
| import com.iformall.annotation.RedisCache; | |||
| import com.iformall.annotation.TenantIgnore; | |||
| 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.domain.vo.WxCouponCVo; | |||
| import com.iformall.domain.vo.WxCouponOrderBVo; | |||
| import com.iformall.domain.vo.WxCouponOrderCVo; | |||
| @@ -152,12 +154,31 @@ public class WxCouponOrderController extends BaseController { | |||
| } | |||
| private TenantEntity getCouponOrderTenantEntity(String couponTenantId) { | |||
| TenantEntity curTenantEntity = getTenantInfo(); | |||
| TenantEntity couponOrderTenantEntity = null; | |||
| if (StringUtils.isBlank(couponTenantId) || "null".equals(couponTenantId) || "NULL".equals(couponTenantId)) { | |||
| couponOrderTenantEntity = curTenantEntity; | |||
| }else { | |||
| if (curTenantEntity.getTenantId().equals(couponTenantId)) { | |||
| couponOrderTenantEntity = curTenantEntity; | |||
| }else { | |||
| couponOrderTenantEntity = new TenantEntity(); | |||
| couponOrderTenantEntity.setTenantId(couponTenantId); | |||
| couponOrderTenantEntity.setParentTenantId(null); | |||
| } | |||
| } | |||
| return couponOrderTenantEntity; | |||
| } | |||
| @TenantIgnore | |||
| @ApiOperation(value = "卡券详情接口") | |||
| @GetMapping("detail") | |||
| @ApiImplicitParams({ | |||
| @ApiImplicitParam(name = "couponOrderId", value = "券ID", dataType = "string", paramType = "query", required = true) | |||
| @ApiImplicitParam(name = "couponOrderId", value = "券ID", dataType = "string", paramType = "query", required = true), | |||
| @ApiImplicitParam(name = "couponTenantId", value = "券tenantID", dataType = "string", paramType = "query", required = false) | |||
| }) | |||
| public ResultData detail(String couponOrderId) { | |||
| public ResultData detail(String couponOrderId,String couponTenantId) { | |||
| logger.info("couponOrderController.detail:" + couponOrderId); | |||
| @@ -191,8 +212,9 @@ public class WxCouponOrderController extends BaseController { | |||
| throw new MallinkException(ErrorCode.MERCHANT_INFO_NOT_FOUND); | |||
| } | |||
| WxCouponOrderCVo wxCouponOrderCVo = null; | |||
| TenantEntity couponOrderTenantEntity = getCouponOrderTenantEntity(couponTenantId); | |||
| try { | |||
| wxCouponOrderCVo = wxCouponOrderService.simpleDetailCUserVo(couponOrderId,wxMerchant); | |||
| wxCouponOrderCVo = wxCouponOrderService.simpleDetailCUserVo(couponOrderId,couponOrderTenantEntity); | |||
| } catch (Exception e) { | |||
| return new ResultData(ErrorCode.COUPON_ORDER_IS_NULL); | |||
| } | |||
| @@ -210,7 +232,7 @@ public class WxCouponOrderController extends BaseController { | |||
| return new ResultData(ErrorCode.COUPON_IS_EMPTY); | |||
| } | |||
| } else { | |||
| wxCouponCVo = wxCouponService.getVoById(wxCouponOrderCVo.getCouponId(),wxMerchantBUser.getTenantId()); | |||
| wxCouponCVo = wxCouponService.getVoById(wxCouponOrderCVo.getCouponId(),couponOrderTenantEntity.getTenantId(),wxMerchantBUser); | |||
| if (wxCouponCVo == null) { | |||
| return new ResultData(ErrorCode.COUPON_IS_EMPTY); | |||
| } | |||
| @@ -237,18 +259,21 @@ public class WxCouponOrderController extends BaseController { | |||
| return new ResultData(wxCouponOrderCVo); | |||
| } | |||
| @TenantIgnore | |||
| @ApiOperation(value = "卡券富文本接口") | |||
| @GetMapping("html") | |||
| @ApiImplicitParams({ | |||
| @ApiImplicitParam(name = "couponOrderId", value = "券ID", dataType = "string", paramType = "query", required = true) | |||
| @ApiImplicitParam(name = "couponOrderId", value = "券ID", dataType = "string", paramType = "query", required = true), | |||
| @ApiImplicitParam(name = "couponTenantId", value = "券tenantID", dataType = "string", paramType = "query", required = false) | |||
| }) | |||
| public ResultData getHtml(String couponOrderId) { | |||
| public ResultData getHtml(String couponOrderId,String couponTenantId) { | |||
| if (couponOrderId == null) { | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); | |||
| } | |||
| TenantEntity couponOrderTenantEntity = getCouponOrderTenantEntity(couponTenantId); | |||
| WxCouponOrderCVo wxCouponOrderCVo = null; | |||
| try { | |||
| wxCouponOrderCVo = wxCouponOrderService.simpleDetailCUserVo(couponOrderId,getTenantInfo()); | |||
| wxCouponOrderCVo = wxCouponOrderService.simpleDetailCUserVo(couponOrderId,couponOrderTenantEntity); | |||
| } catch (Exception e) { | |||
| return new ResultData(ErrorCode.COUPON_ORDER_IS_NULL); | |||
| } | |||
| @@ -282,7 +307,8 @@ public class WxCouponOrderController extends BaseController { | |||
| return new ResultData(wxCouponOrderCVo); | |||
| } | |||
| @ApiOperation(value = "核销接口", notes = "{\"couponOrderId\":\"string\"}") | |||
| @TenantIgnore | |||
| @ApiOperation(value = "核销接口", notes = "{\"couponOrderId\":\"string\",\"couponTenantId\":\"string\"}") | |||
| @PostMapping("verify") | |||
| public ResultData verify(@RequestBody Map<String, String> paramMap) { | |||
| logger.info("couponOrderController.verify:" + paramMap.toString()); | |||
| @@ -313,8 +339,10 @@ public class WxCouponOrderController extends BaseController { | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); | |||
| } | |||
| WxCouponOrderCVo wxCouponOrderCVo = wxCouponOrderService.detailCUserVo(couponOrderIdStr,getTenantInfo()); | |||
| WxCouponOrderCVo wxCouponOrderCVo = null; | |||
| String couponTenantId = paramMap.get("couponTenantId"); | |||
| TenantEntity couponOrderTenantEntity = getCouponOrderTenantEntity(couponTenantId); | |||
| wxCouponOrderCVo = wxCouponOrderService.detailCUserVo(couponOrderIdStr,couponOrderTenantEntity); | |||
| if (wxCouponOrderCVo == null) | |||
| return new ResultData(ErrorCode.COUPON_ORDER_IS_NULL); | |||
| @@ -353,13 +381,13 @@ public class WxCouponOrderController extends BaseController { | |||
| } | |||
| } | |||
| WxCouponOrder wxCouponOrder = wxCouponOrderService.getById(couponOrderId,getTenantInfo().getTenantId()); | |||
| WxCouponOrder wxCouponOrder = wxCouponOrderService.getById(couponOrderId,couponOrderTenantEntity.getTenantId()); | |||
| if (wxCouponOrder == null) { | |||
| logger.error("券ID不存在:" + couponOrderId); | |||
| return new ResultData(ErrorCode.COUPON_ORDER_IS_NULL); | |||
| } | |||
| WxMerchantBUser wxMerchantBUser = wxMerchantBUserService.getById(getLoginBUser().getId()); | |||
| WxMerchantBUser wxMerchantBUser = getLoginBUser(); | |||
| if (wxMerchantBUser == null) { | |||
| logger.error("核销员ID不存在:" + getLoginBUser().getId()); | |||
| throw new MallinkException(ErrorCode.USER_IS_EMPTY.getCode(), "核销员ID不存在或者无权限"); | |||
| @@ -381,15 +409,15 @@ public class WxCouponOrderController extends BaseController { | |||
| return new ResultData(ErrorCode.VERIFY_ERROR, e.getMessage()); | |||
| } | |||
| if (couponOrder != null && couponOrder.getMerchantId() != null) { | |||
| wxCouponOrderService.sendInsideCouponVerifyMsg(couponOrder, couponOrderId, couponOrder.getMerchantId(),couponOrder.getBMerchantId()); | |||
| if (couponOrder != null) { | |||
| wxCouponOrderService.sendInsideCouponVerifyMsg(couponOrder.getId(), couponOrder, couponOrder.getBMerchantId(), wxMerchantBUser); | |||
| } | |||
| return new ResultData(couponOrder); | |||
| } | |||
| @ApiOperation(value = "根据couponOrderId查询接口", notes = "{\"couponOrderId\":\"string\"}") | |||
| @TenantIgnore | |||
| @ApiOperation(value = "根据couponOrderId查询接口", notes = "{\"couponOrderId\":\"string\",\"couponTenantId\":\"string\"}") | |||
| @PostMapping("/findById") | |||
| public ResultData findById(@RequestBody Map<String, String> paramMap) { | |||
| logger.info(paramMap.toString()); | |||
| @@ -406,7 +434,9 @@ public class WxCouponOrderController extends BaseController { | |||
| logger.error("couponOrderId参数不正确: " + paramMap.toString()); | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); | |||
| } | |||
| return new ResultData(Result.SUCCESS, "查询成功", wxCouponOrderService.getById(couponOrderId,getTenantInfo().getTenantId())); | |||
| String couponTenantId = paramMap.get("couponTenantId"); | |||
| TenantEntity couponOrderTenantEntity = getCouponOrderTenantEntity(couponTenantId); | |||
| return new ResultData(Result.SUCCESS, "查询成功", wxCouponOrderService.getById(couponOrderId,couponOrderTenantEntity.getTenantId())); | |||
| } | |||
| @ApiOperation(value = "核销接口", notes = "{\"couponOrderId\":\"string\"}") | |||
| @@ -420,7 +450,7 @@ public class WxCouponOrderController extends BaseController { | |||
| return new ResultData(); | |||
| } | |||
| @ApiOperation(value = "商品发货", notes = "{\"id\":\"string\", \"deliveryInfo\":\"jsonString\"}") | |||
| @ApiOperation(value = "商品发货", notes = "{\"id\":\"string\", \"deliveryInfo\":\"jsonString\",\"couponTenantId\":\"string\"}") | |||
| @PostMapping("/sendGoods") | |||
| public ResultData sendGoods(@RequestBody WxCouponOrder wxCouponOrder) { | |||
| logger.debug("[" + getIpAddr() + "] WxCouponPasswordController::postpone"); | |||
| @@ -429,7 +459,10 @@ public class WxCouponOrderController extends BaseController { | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); | |||
| } | |||
| try { | |||
| WxCouponOrder couponOrder = wxCouponOrderService.getById(wxCouponOrder.getId(), getTenantInfo().getTenantId()); | |||
| String couponTenantId = wxCouponOrder.getCouponTenantId(); | |||
| TenantEntity couponOrderTenantEntity = getCouponOrderTenantEntity(couponTenantId); | |||
| WxCouponOrder couponOrder = wxCouponOrderService.getById(wxCouponOrder.getId(), couponOrderTenantEntity.getTenantId()); | |||
| if(couponOrder==null){ | |||
| return new ResultData(ErrorCode.COUPON_ORDER_IS_NULL); | |||
| } | |||
| @@ -2,6 +2,7 @@ package com.iformall.controller; | |||
| import cn.binarywang.wx.miniapp.bean.WxMaJscode2SessionResult; | |||
| import com.alibaba.fastjson.JSON; | |||
| import com.alibaba.fastjson.JSONObject; | |||
| import com.iformall.annotation.AuthIgnore; | |||
| import com.iformall.annotation.TenantIgnore; | |||
| @@ -156,11 +157,11 @@ public class WxInfoController extends BaseController { | |||
| cUser = cuserFactory.getBUserService(appPlat).handleLoginUser(cUser,null); | |||
| resultMap.put("token", cUser.getToken()); | |||
| request.setAttribute(Constant.LOGIN_USER_KEY, cUser.getId()); | |||
| request.setAttribute(Constant.TENANT_ID, buUser.getTenantId()); | |||
| if (StringUtils.isNotBlank(buUser.getParentTenantId())) { | |||
| request.setAttribute(Constant.PARENT_TENANT_ID, buUser.getParentTenantId()); | |||
| } | |||
| // request.setAttribute(Constant.LOGIN_USER_KEY, cUser.getId()); | |||
| // request.setAttribute(Constant.TENANT_ID, buUser.getTenantId()); | |||
| // if (StringUtils.isNotBlank(buUser.getParentTenantId())) { | |||
| // request.setAttribute(Constant.PARENT_TENANT_ID, buUser.getParentTenantId()); | |||
| // } | |||
| return new ResultData(resultMap); | |||
| } | |||
| @@ -427,6 +428,7 @@ public class WxInfoController extends BaseController { | |||
| * @param map | |||
| * @return | |||
| */ | |||
| @TenantIgnore | |||
| @PostMapping("/getUserInfo") | |||
| @ApiOperation(value = "授权后获取用户的昵称,unionId等信息", notes = "{\"encryptedData\":\"string\",\"iv\":\"string\"}") | |||
| public ResultData getUserInfo(@RequestBody Map<String, String> map) { | |||
| @@ -446,7 +448,7 @@ public class WxInfoController extends BaseController { | |||
| CUser user = getCUser(); | |||
| if (user != null) { | |||
| WxAppinfo wxAppinfo = wxAppinfoService.getByAppId(user.getAppId()); | |||
| WxAppinfo wxAppinfo = getAppInfo(user.getAppId(),user.getTenantId()); | |||
| if(wxAppinfo == null){ | |||
| return new ResultData(ErrorCode.APP_ID_NOT_FOUND); | |||
| } | |||
| @@ -468,6 +470,7 @@ public class WxInfoController extends BaseController { | |||
| } | |||
| } | |||
| @TenantIgnore | |||
| @PostMapping("/updateExtInfo") | |||
| @ApiOperation(value = "用户更新扩展信息(手机)", notes = "{\"systemInfo\":\"string\"}") | |||
| public ResultData updateExtInfo(@RequestBody Map<String, String> map) { | |||
| @@ -485,6 +488,7 @@ public class WxInfoController extends BaseController { | |||
| return new ResultData(); | |||
| } | |||
| @TenantIgnore | |||
| @PostMapping("/updateLBS") | |||
| @ApiOperation(value = "用户更新位置信息", notes = "{\"latitude\":\"string\",\"longitude\":\"string\"}") | |||
| public ResultData updateLBS(@RequestBody Map<String, String> map) { | |||
| @@ -504,6 +508,7 @@ public class WxInfoController extends BaseController { | |||
| return new ResultData(); | |||
| } | |||
| @TenantIgnore | |||
| @PostMapping("/updateScene") | |||
| @ApiOperation(value = "用户更新scene", notes = "{\"scene\":\"string\"}") | |||
| public ResultData updateScene(@RequestBody Map<String, String> map) { | |||
| @@ -51,7 +51,7 @@ public class WxMallController extends BaseController { | |||
| @GetMapping("/getAppIcon") | |||
| @ApiImplicitParam(name = "appId", value = "appId", dataType = "String", paramType = "query", required = true) | |||
| public ResultData getAppIcon(String appId) { | |||
| WxAppinfo appInfo = wxAppinfoService.getByAppId(appId); | |||
| WxAppinfo appInfo = getAppInfo(appId); | |||
| if (appInfo == null) { | |||
| return new ResultData(ErrorCode.APP_ID_NOT_FOUND); | |||
| } | |||
| @@ -3,6 +3,7 @@ package com.iformall.controller; | |||
| import com.iformall.annotation.AuthIgnore; | |||
| import com.iformall.annotation.RedisCache; | |||
| import com.iformall.annotation.TenantIgnore; | |||
| import com.iformall.common.ErrorCode; | |||
| import com.iformall.common.Result; | |||
| import com.iformall.common.ResultData; | |||
| @@ -122,6 +123,7 @@ public class WxMerchantBUserController extends BaseController { | |||
| * @param map | |||
| * @return | |||
| */ | |||
| @TenantIgnore | |||
| @AuthIgnore | |||
| @PostMapping("/login") | |||
| @ApiOperation(value = "用户登录", notes = "{" + | |||
| @@ -149,7 +151,7 @@ public class WxMerchantBUserController extends BaseController { | |||
| if (StringUtils.isNotBlank(latitude) && StringUtils.isNotBlank(longitude)) { | |||
| logger.info("B端用户: " + phone + " 登录 IP" + ipaddress + ", 经纬度(" + longitude + "," + latitude + ")"); | |||
| } | |||
| WxAppinfo wxAppinfo = wxAppinfoService.getByAppId(appId); | |||
| WxAppinfo wxAppinfo = getAppInfo(appId); | |||
| if(wxAppinfo == null){ | |||
| return new ResultData(ErrorCode.APP_ID_NOT_FOUND); | |||
| } | |||
| @@ -162,7 +164,7 @@ public class WxMerchantBUserController extends BaseController { | |||
| // userQ.setAppId(appId); | |||
| userQ.setPhone(phone); | |||
| userQ.setStatus(EnumMerchantBUserStatus.VALID.getCode()); | |||
| List<WxMerchantBUser> orgList = wxMerchantBUserService.getBUserByAppId(userQ); | |||
| List<WxMerchantBUser> orgList = wxMerchantBUserService.findAllList(userQ); | |||
| if (orgList.size() == 1) { | |||
| // 集团内只发现一个用户 | |||
| @@ -174,16 +176,16 @@ public class WxMerchantBUserController extends BaseController { | |||
| ResultData merchantStatus = checkMerchantStatus(orgUser); | |||
| if (merchantStatus != null) return merchantStatus; | |||
| try { | |||
| wxMerchantBUserService.saveOrUpdate(orgUser); | |||
| } catch (Exception e) { | |||
| logger.error("B端用户更新用户信息失败, e:" + e.getMessage()); | |||
| return new ResultData(ErrorCode.DB_FAIL.getCode(), "数据库保存失败,e:" + e.getMessage()); | |||
| } | |||
| // try { | |||
| // wxMerchantBUserService.saveOrUpdate(orgUser); | |||
| // } catch (Exception e) { | |||
| // logger.error("B端用户更新用户信息失败, e:" + e.getMessage()); | |||
| // return new ResultData(ErrorCode.DB_FAIL.getCode(), "数据库保存失败,e:" + e.getMessage()); | |||
| // } | |||
| Map<String, Object> resultMap = new HashMap<>(); | |||
| resultMap.put("bUserId", orgUser.getId()); | |||
| resultMap.put("logined", true); | |||
| request.setAttribute(Constant.LOGIN_B_USER_KEY, orgUser.getId()); | |||
| // request.setAttribute(Constant.LOGIN_B_USER_KEY, orgUser.getId()); | |||
| return new ResultData(resultMap); | |||
| } else { | |||
| return new ResultData(ErrorCode.PASSWORD_ERROR); | |||
| @@ -199,12 +201,12 @@ public class WxMerchantBUserController extends BaseController { | |||
| // check password | |||
| if (orgUser.getUserPwd().equalsIgnoreCase(password)) { | |||
| // 返回多个(商场+商户) | |||
| List<WxMerchantBuInfoVo> merchantListInfo = wxMerchantBUserService.getMerchantInfoByBUser(userQ); | |||
| List<WxMerchantBuInfoVo> merchantListInfo = wxMerchantBUserService.handMerchantBUser(orgList); | |||
| Map<String, Object> resultMap = new HashMap<>(); | |||
| resultMap.put("merchantList", merchantListInfo); | |||
| resultMap.put("logined", true); | |||
| resultMap.put("bUserId", orgUser.getId()); | |||
| request.setAttribute(Constant.LOGIN_B_USER_KEY, orgUser.getId()); | |||
| resultMap.put("logined", false); | |||
| // resultMap.put("bUserId", orgUser.getId()); | |||
| // request.setAttribute(Constant.LOGIN_B_USER_KEY, orgUser.getId()); | |||
| return new ResultData(resultMap); | |||
| } else { | |||
| logger.error(ErrorCode.PASSWORD_ERROR.getMessage()); | |||
| @@ -220,6 +222,7 @@ public class WxMerchantBUserController extends BaseController { | |||
| } | |||
| } | |||
| @TenantIgnore | |||
| @AuthIgnore | |||
| @PostMapping("/selectMerchant") | |||
| @ApiOperation(value = "选择商户", notes = "{" + | |||
| @@ -239,18 +242,18 @@ public class WxMerchantBUserController extends BaseController { | |||
| WxMerchantBUser userQ = new WxMerchantBUser(); | |||
| userQ.setId(Long.valueOf(buUserIdStr)); | |||
| userQ.setMerchantId(Long.valueOf(merchantIdStr)); | |||
| List<WxMerchantBUser> orgList = wxMerchantBUserService.getBUserByAppId(userQ); | |||
| List<WxMerchantBUser> orgList = wxMerchantBUserService.findList(userQ); | |||
| if (orgList.size() == 1) { | |||
| WxMerchantBUser orgUser = orgList.get(0); | |||
| if (orgUser != null) { | |||
| ResultData merchantStatus = checkMerchantStatus(orgUser); | |||
| if (merchantStatus != null) return merchantStatus; | |||
| try { | |||
| wxMerchantBUserService.saveOrUpdate(orgUser); | |||
| } catch (Exception e) { | |||
| logger.error("B端用户更新用户信息失败, e:" + e.getMessage()); | |||
| return new ResultData(ErrorCode.DB_FAIL.getCode(), "数据库保存失败,e:" + e.getMessage()); | |||
| } | |||
| // try { | |||
| // wxMerchantBUserService.saveOrUpdate(orgUser); | |||
| // } catch (Exception e) { | |||
| // logger.error("B端用户更新用户信息失败, e:" + e.getMessage()); | |||
| // return new ResultData(ErrorCode.DB_FAIL.getCode(), "数据库保存失败,e:" + e.getMessage()); | |||
| // } | |||
| Map<String, Object> resultMap = new HashMap<>(); | |||
| resultMap.put("bUserId", orgUser.getId()); | |||
| resultMap.put("logined", true); | |||
| @@ -285,6 +288,7 @@ public class WxMerchantBUserController extends BaseController { | |||
| } | |||
| @TenantIgnore | |||
| @AuthIgnore | |||
| @ApiOperation(value = "修改密码,集团版会修改集团下同一手机号的密码", notes = "{\"appId\",\"string\", \"phone\",\"string\",\"code\",\"string\",\"pwd\",\"string\"}") | |||
| @PostMapping("/updatepwd") | |||
| @@ -297,6 +301,14 @@ public class WxMerchantBUserController extends BaseController { | |||
| if (StringUtils.isBlank(appId)) { | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "appId不能为空"); | |||
| } | |||
| WxAppinfo wxAppinfo = getAppInfo(appId); | |||
| if(wxAppinfo == null){ | |||
| return new ResultData(ErrorCode.APP_ID_NOT_FOUND); | |||
| } | |||
| if(!wxAppinfo.getEnable().equals(EnumEnableType.Enable.getCode())){ | |||
| return new ResultData(ErrorCode.APP_ID_NOT_ENABLE); | |||
| } | |||
| if (StringUtils.isBlank(phone)) { | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "手机号不能为空"); | |||
| } | |||
| @@ -306,8 +318,7 @@ public class WxMerchantBUserController extends BaseController { | |||
| if (StringUtils.isBlank(pwd)) { | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "密码不能为空"); | |||
| } | |||
| return wxMerchantBUserService.updatePwd(appId, phone, code, pwd); | |||
| return wxMerchantBUserService.updatePwd(wxAppinfo.getTenantId(), phone, code, pwd); | |||
| } | |||
| } | |||
| @@ -1,6 +1,7 @@ | |||
| package com.iformall.controller; | |||
| import com.iformall.annotation.RedisCache; | |||
| import com.iformall.annotation.TenantIgnore; | |||
| import com.iformall.common.ErrorCode; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.domain.po.*; | |||
| @@ -131,6 +132,7 @@ public class WxMerchantController extends BaseController { | |||
| return new ResultData(has); | |||
| } | |||
| @TenantIgnore | |||
| @ApiOperation("获取微信OpenId") | |||
| @GetMapping("/getOpenIdByPhone") | |||
| @ApiImplicitParam(name = "phone", value = "商户C端注册手机号", dataType = "String", paramType = "query", required = true) | |||
| @@ -145,7 +147,7 @@ public class WxMerchantController extends BaseController { | |||
| phone = wxMerchant.getLinkPhone(); | |||
| } | |||
| WxCUser cuUser = new WxCUser(); | |||
| cuUser.updateTenantInfo(getTenantInfo()); | |||
| cuUser.updateTenantInfo(buser); | |||
| cuUser.setPhone(phone); | |||
| try { | |||
| WxCUser mUser = cUserService.getByObject(cuUser); | |||
| @@ -299,7 +299,7 @@ public class WxMicroPayController extends BaseController { | |||
| } | |||
| WxMerchantBUser bUser = getLoginBUser(); | |||
| WxAppinfo appinfo = getAppInfo(bUser.getAppId()); | |||
| WxAppinfo appinfo = getAppInfo(bUser.getAppId(),bUser.getTenantId()); | |||
| try { | |||
| ResultData rd = wxRefundOrderService.createRefundOrderFromMicroPay(appinfo, orderId, EnumPayType.PAY_B_REFUND, bUser.getId()); | |||
| return rd; | |||
| @@ -1,7 +1,9 @@ | |||
| package com.iformall.controller; | |||
| import com.iformall.annotation.TenantIgnore; | |||
| import com.iformall.common.ErrorCode; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.domain.po.WxAppinfo; | |||
| import com.iformall.domain.po.WxMerchant; | |||
| import com.iformall.domain.po.WxMerchantBUser; | |||
| import com.iformall.domain.po.WxMsgValidationcode; | |||
| @@ -37,8 +39,7 @@ public class WxMsgValidationcodeController extends BaseController { | |||
| @Autowired | |||
| private WxMerchantService wxMerchantService; | |||
| @TenantIgnore | |||
| @GetMapping("sendvalidationcode") | |||
| @ApiImplicitParams({ | |||
| @ApiImplicitParam(name = "phone", value = "手机号", dataType = "String", paramType = "query", required = true), | |||
| @@ -46,12 +47,20 @@ public class WxMsgValidationcodeController extends BaseController { | |||
| @ApiImplicitParam(name = "appid", value = "appid", dataType = "String", paramType = "query", required = true)}) | |||
| public ResultData sendvalidationcode(String phone, String type, String appid) { | |||
| WxAppinfo wxAppinfo = getAppInfo(appid); | |||
| if(wxAppinfo == null){ | |||
| return new ResultData(ErrorCode.APP_ID_NOT_FOUND); | |||
| } | |||
| if(!wxAppinfo.getEnable().equals(EnumEnableType.Enable.getCode())){ | |||
| return new ResultData(ErrorCode.APP_ID_NOT_ENABLE); | |||
| } | |||
| WxMerchantBUser userQ = new WxMerchantBUser(); | |||
| userQ.setAppId(appid); | |||
| userQ.updateTenantInfo(wxAppinfo); | |||
| userQ.setPhone(phone); | |||
| userQ.setStatus(EnumMerchantBUserStatus.VALID.getCode()); | |||
| List<WxMerchantBUser> orgUserList = wxMerchantBUserService.getBUserByAppId(userQ); | |||
| List<WxMerchantBUser> orgUserList = wxMerchantBUserService.findList(userQ); | |||
| if (orgUserList.size() <= 0) { | |||
| logger.error("B端用户不存在, phone: " + phone); | |||
| return new ResultData(ErrorCode.USER_IS_EMPTY); | |||
| @@ -41,10 +41,10 @@ public class WxPayAccountController extends BaseController { | |||
| logger.info("/api/payAccount/getPayAccount" + paramMap.toString()); | |||
| String appId = paramMap.get("appId"); | |||
| if (StringUtils.isBlank(appId)) { | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "appId不能为空"); | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); | |||
| } | |||
| WxAppinfo wxAppinfo = getAppInfo(appId); | |||
| WxAppinfo wxAppinfo = getAppInfo(appId,getTenantInfo().getTenantId()); | |||
| if(wxAppinfo == null){ | |||
| return new ResultData(ErrorCode.APP_ID_NOT_FOUND); | |||
| } | |||
| @@ -103,7 +103,7 @@ public class WxPayBillController extends BaseController { | |||
| //openid | |||
| String openid = paramMap.get("openId"); | |||
| //获取小程序配置信息 | |||
| WxAppinfo appInfo = getAppInfo(appid); | |||
| WxAppinfo appInfo = getAppInfo(appid,getTenantInfo().getTenantId()); | |||
| //支付账单参数 | |||
| WxPayBill record = new WxPayBill(); | |||
| record.setBillId(billId); | |||
| @@ -6,11 +6,13 @@ import com.iformall.annotation.TenantIgnore; | |||
| import com.iformall.common.ErrorCode; | |||
| import com.iformall.common.TenantThreadLocal; | |||
| import com.iformall.domain.po.WxBuser; | |||
| import com.iformall.domain.po.WxMall; | |||
| import com.iformall.domain.po.WxMerchantBUser; | |||
| import com.iformall.domain.po.base.BaseCUserEntity; | |||
| import com.iformall.exception.MallinkException; | |||
| import com.iformall.service.CUserTokenService; | |||
| import com.iformall.service.WxBuserTokenService; | |||
| import com.iformall.service.WxMallService; | |||
| import com.iformall.service.WxMerchantBUserService; | |||
| import com.iformall.utils.Constant; | |||
| import org.apache.commons.lang3.StringUtils; | |||
| @@ -38,6 +40,9 @@ public class AuthorizationInterceptor extends HandlerInterceptorAdapter { | |||
| @Autowired | |||
| private WxMerchantBUserService wxMerchantBUserService; | |||
| @Autowired | |||
| private WxMallService wxMallService; | |||
| @Override | |||
| public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { | |||
| AuthIgnore annotation; | |||
| @@ -69,40 +74,56 @@ public class AuthorizationInterceptor extends HandlerInterceptorAdapter { | |||
| if(StringUtils.isBlank(token) && StringUtils.isBlank(bid)){ | |||
| throw new MallinkException(ErrorCode.NET_TOKEN_EMPTY); | |||
| } | |||
| //集团版中针对某一商场的业务需要传递mallTenantId | |||
| String mallTenantId = request.getHeader("mallTenantId"); | |||
| if(StringUtils.isBlank(mallTenantId)){ | |||
| mallTenantId = request.getParameter("mallTenantId"); | |||
| } | |||
| // 查询token信息 | |||
| WxMerchantBUser buser = null; | |||
| String tenantId = null; | |||
| String parenTenantId = null; | |||
| if (!StringUtils.isBlank(token)) { | |||
| if (StringUtils.isNotBlank(token)) { | |||
| BaseCUserEntity user = cUserTokenService.getBByToken(token); | |||
| if (user == null || user.getExpireTime().getTime() < System.currentTimeMillis()) { | |||
| throw new MallinkException(ErrorCode.NET_TOKEN_INVALID.getCode(), "URL:" + request.getRequestURL() + " token失效,请重新登录"); | |||
| } | |||
| tenantId = user.getTenantId(); | |||
| parenTenantId = user.getParentTenantId(); | |||
| request.setAttribute(Constant.LOGIN_USER_KEY, user.getId()); | |||
| request.setAttribute(Constant.TENANT_ID, tenantId); | |||
| request.setAttribute(Constant.REQUEST_C_USER_KEY, user); | |||
| request.setAttribute(Constant.APP_INFO, user.getAppinfo()); | |||
| if (StringUtils.isNotBlank(parenTenantId)) { | |||
| request.setAttribute(Constant.PARENT_TENANT_ID, parenTenantId); | |||
| if(user.getUserId() != null){ | |||
| buser = wxMerchantBUserService.getById(user.getUserId()); | |||
| } | |||
| }else if (!StringUtils.isBlank(bid)) { | |||
| WxMerchantBUser buser = wxMerchantBUserService.getById(Long.parseLong(bid)); | |||
| if (buser == null) { | |||
| throw new MallinkException(ErrorCode.NET_TOKEN_INVALID.getCode(), "URL:" + request.getRequestURL() + " bid失效,请重新登录"); | |||
| } | |||
| tenantId = buser.getTenantId(); | |||
| parenTenantId = buser.getParentTenantId(); | |||
| request.setAttribute(Constant.LOGIN_B_USER_KEY, buser.getId()); | |||
| request.setAttribute(Constant.TENANT_ID, tenantId); | |||
| if (StringUtils.isNotBlank(parenTenantId)) { | |||
| request.setAttribute(Constant.PARENT_TENANT_ID, parenTenantId); | |||
| } | |||
| }else if (StringUtils.isNotBlank(bid)) { | |||
| buser = wxMerchantBUserService.getById(Long.parseLong(bid)); | |||
| } | |||
| if (buser == null) { | |||
| throw new MallinkException(ErrorCode.NET_TOKEN_INVALID.getCode(), "URL:" + request.getRequestURL() + " bid失效,请重新登录"); | |||
| } | |||
| if(StringUtils.isNotBlank(mallTenantId)){ | |||
| tenantId = mallTenantId; | |||
| WxMall mall = wxMallService.getByTenantId(tenantId); | |||
| if(StringUtils.isNotBlank(mall.getParentTenantId())){ | |||
| parenTenantId = mall.getParentTenantId(); | |||
| } | |||
| }else{ | |||
| tenantId = buser.getTenantId(); | |||
| if (StringUtils.isNotBlank(buser.getParentTenantId())) { | |||
| parenTenantId = buser.getParentTenantId(); | |||
| } | |||
| } | |||
| if(!tenantId.equals(buser.getTenantId()) | |||
| && !buser.getTenantId().equals(parenTenantId) | |||
| && !tenantId.equals(buser.getParentTenantId())){ | |||
| throw new MallinkException(ErrorCode.SYS_AUTH_ERROR); | |||
| } | |||
| request.setAttribute(Constant.LOGIN_B_USER_KEY, buser.getId()); | |||
| request.setAttribute(Constant.TENANT_ID, tenantId); | |||
| request.setAttribute(Constant.PARENT_TENANT_ID, parenTenantId); | |||
| //如果是要不需要自动设置tenantI信息 | |||
| TenantIgnore tenantIgnoreAnnotation = null; | |||
| @@ -23,6 +23,7 @@ public class TenantInfoImpl implements TenantInfo { | |||
| "mall_permission", | |||
| "mall_sale_type", | |||
| "mall_user_role", | |||
| "wx_brand", | |||
| "wx_channel", | |||
| "wx_business", | |||
| "wx_coupon_type", | |||
| @@ -54,6 +55,9 @@ public class TenantInfoImpl implements TenantInfo { | |||
| "fengniao_map_config", | |||
| "wx_c_user", | |||
| "tt_c_user", | |||
| "tt_buser", | |||
| "wx_buser", | |||
| "wx_merchant_b_user", | |||
| "wx_user_visit", | |||
| "tt_goods_category", | |||
| }; | |||
| @@ -62,8 +66,12 @@ public class TenantInfoImpl implements TenantInfo { | |||
| "wx_mall", | |||
| "wx_appinfo", | |||
| "wx_authorizer_info", | |||
| "wx_brand", | |||
| "wx_c_user", | |||
| "tt_c_user", | |||
| "tt_buser", | |||
| "wx_buser", | |||
| "wx_merchant_b_user", | |||
| "wx_user_visit", | |||
| "wx_c_user_basic_info", | |||
| "user_basic_info_address", | |||
| @@ -74,8 +82,6 @@ public class TenantInfoImpl implements TenantInfo { | |||
| "wx_c_user_from_b", | |||
| "wx_c_user_tags", | |||
| "wx_cuser_floating_layer", | |||
| "wx_buser", | |||
| "tt_buser", | |||
| "wx_floating_layer", | |||
| "wx_user_visit", | |||
| "wx_level_config", | |||
| @@ -89,7 +89,7 @@ public class CouponsendTest { | |||
| log.error("券包ID未找到: " + couponOrderId); | |||
| throw new MallinkException(ErrorCode.COUPON_ORDER_IS_NULL.getCode(), "券包ID未找到" + couponOrderId); | |||
| } | |||
| wxCouponOrderService.subsidyAfterVerify(couponOrder, merchantId); | |||
| // wxCouponOrderService.subsidyAfterVerify(couponOrder, merchantId); | |||
| } | |||
| @@ -1,6 +1,7 @@ | |||
| package com.iformall.controller; | |||
| import cn.binarywang.wx.miniapp.api.WxMaService; | |||
| import com.alibaba.fastjson.JSONObject; | |||
| import com.iformall.common.ErrorCode; | |||
| import com.iformall.common.IdWorker; | |||
| import com.iformall.common.ResultData; | |||
| @@ -38,6 +39,7 @@ import java.text.ParseException; | |||
| import java.text.SimpleDateFormat; | |||
| import java.util.Date; | |||
| import java.util.List; | |||
| import java.util.Map; | |||
| @RestController | |||
| public class BaseController { | |||
| @@ -111,9 +113,11 @@ public class BaseController { | |||
| HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); | |||
| String tenantId = (String) request.getAttribute(Constant.TENANT_ID); | |||
| String parentTenantId = (String) request.getAttribute(Constant.PARENT_TENANT_ID); | |||
| // boolean isChildMall = (boolean)request.getAttribute(Constant.IS_CHILD_MALL); | |||
| TenantEntity tenantEntity = new TenantEntity() ; | |||
| tenantEntity.setTenantId(tenantId); | |||
| tenantEntity.setParentTenantId(parentTenantId); | |||
| // tenantEntity.setChildMall(isChildMall); | |||
| return tenantEntity; | |||
| } | |||
| @@ -184,13 +188,13 @@ public class BaseController { | |||
| if(user == null){ | |||
| throw new MallinkException(ErrorCode.USER_IS_EMPTY); | |||
| } | |||
| TenantEntity tenantEntity = getTenantInfo(); | |||
| if (user.getTenantId() == null) { | |||
| user.setTenantId(tenantEntity.getTenantId()); | |||
| } | |||
| if (user.getParentTenantId() == null) { | |||
| user.setParentTenantId(tenantEntity.getParentTenantId()); | |||
| } | |||
| // TenantEntity tenantEntity = getTenantInfo(); | |||
| // if (user.getTenantId() == null) { | |||
| // user.setTenantId(tenantEntity.getTenantId()); | |||
| // } | |||
| // if (user.getParentTenantId() == null) { | |||
| // user.setParentTenantId(tenantEntity.getParentTenantId()); | |||
| // } | |||
| return user; | |||
| } | |||
| @@ -243,15 +247,11 @@ public class BaseController { | |||
| RedisCacheUtils.removeCache(objectCommonRedisTemplate, shortKey); | |||
| } | |||
| public WxAppinfo getAppInfo(String appId) { | |||
| return wxAppinfoService.getByAppIdFromRedis(appId); | |||
| } | |||
| public WxMaService getWeappService(String appId) { | |||
| if(isFmOpen) { | |||
| return openService.getWxOpenComponentService().getWxMaServiceByAppid(appId); | |||
| } else { | |||
| WxAppinfo appinfo = wxAppinfoService.getByAppId(appId); | |||
| WxAppinfo appinfo = wxAppinfoService.getOnlyByAppIdFromRedis(appId); | |||
| if (appinfo == null) { | |||
| return null; | |||
| } | |||
| @@ -275,5 +275,23 @@ public class BaseController { | |||
| return ipaddress; | |||
| } | |||
| /** | |||
| * 根据扩展字段获取tenantId | |||
| */ | |||
| public String getTenantId(String attach){ | |||
| if(StringUtils.isNotBlank(attach)){ | |||
| try{ | |||
| Map<String,Object> map = JSONObject.parseObject(attach, Map.class); | |||
| String tenantId = map.get("tenantId").toString(); | |||
| if(StringUtils.isNotBlank(tenantId)){ | |||
| return tenantId; | |||
| } | |||
| }catch (Exception e){ | |||
| } | |||
| } | |||
| return null; | |||
| } | |||
| } | |||
| @@ -11,6 +11,7 @@ import java.util.stream.Collectors; | |||
| import com.iformall.domain.po.WxMerchant; | |||
| import com.iformall.domain.po.WxMiniappThemeValue; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import com.iformall.enums.EnumCouponType; | |||
| import com.iformall.enums.EnumMerchantStatus; | |||
| import com.iformall.utils.*; | |||
| @@ -27,10 +28,12 @@ import org.springframework.web.bind.annotation.RequestMapping; | |||
| import org.springframework.web.bind.annotation.RestController; | |||
| import com.alibaba.fastjson.JSON; | |||
| import com.iformall.annotation.TenantIgnore; | |||
| import com.iformall.common.ErrorCode; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.domain.po.WxCoupon; | |||
| import com.iformall.domain.po.WxCouponChannel; | |||
| import com.iformall.domain.po.WxMall; | |||
| import com.iformall.domain.vo.WxCouponCVo; | |||
| import com.iformall.domain.vo.WxMerchantVo; | |||
| import com.iformall.enums.EnumCouponChannelActivityStatus; | |||
| @@ -72,12 +75,14 @@ public class WxCouponController extends BaseController { | |||
| @ApiOperation("根据id(couponChannel)查询详情接口") | |||
| @GetMapping("/couponDetail") | |||
| @ApiImplicitParams({ | |||
| @ApiImplicitParam(name = "couponChannelId", value = "couponChannelId", dataType = "String", paramType = "query", required = true)}) | |||
| @ApiImplicitParam(name = "couponChannelId", value = "couponChannelId", dataType = "String", paramType = "query", required = true), | |||
| @ApiImplicitParam(name = "mallTenantId", value = "mallTenantId", dataType = "String", paramType = "query", required = false)}) | |||
| public ResultData couponDetail(String couponChannelId) { | |||
| if ((StringUtils.isBlank(couponChannelId) || couponChannelId.equalsIgnoreCase(Constant.UNDEFINED)) | |||
| ) { | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "couponChannelId为空"); | |||
| } | |||
| Long couponChannelIdL = 0L; | |||
| try { | |||
| @@ -278,6 +283,7 @@ public class WxCouponController extends BaseController { | |||
| return new ResultData(sb.toString()); | |||
| } | |||
| @TenantIgnore | |||
| @ApiOperation("根据id(couponChannel)查询商品商户接口") | |||
| @GetMapping("/couponMerchant") | |||
| @ApiImplicitParams({ | |||
| @@ -311,7 +317,7 @@ public class WxCouponController extends BaseController { | |||
| CouponCacheUtils.setCouponChannelCache(redisTemplate, couponChannelIdL, couponChannel); | |||
| } | |||
| List<WxMerchantVo> volist = CouponCacheUtils.getCouponMerchantCache(redisTemplate, couponChannel.getId()); | |||
| Map<String,List<WxMerchantVo>> volist = CouponCacheUtils.getCouponMerchantCache(redisTemplate, couponChannel.getCouponId()); | |||
| if (null == volist) { | |||
| volist = couponService.getCouponMerchantList(getTenantInfo(), couponChannel.getCouponId()); | |||
| if (null != volist && volist.size() > 0 ) { | |||
| @@ -321,6 +327,42 @@ public class WxCouponController extends BaseController { | |||
| return new ResultData(volist); | |||
| } | |||
| @TenantIgnore | |||
| @ApiOperation("根据couponId查询商品商户接口") | |||
| @GetMapping("/couponMerchantByCouponId") | |||
| @ApiImplicitParams({ | |||
| @ApiImplicitParam(name = "couponId", value = "couponId", dataType = "String", paramType = "query", required = true)}) | |||
| public ResultData couponMerchantByCouponId(String couponId) { | |||
| if ((StringUtils.isBlank(couponId) || couponId.equalsIgnoreCase(Constant.UNDEFINED)) | |||
| ) { | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "couponId为空"); | |||
| } | |||
| Long couponIdL = 0L; | |||
| try { | |||
| if (StringUtils.isNotBlank(couponId) && !couponId.equalsIgnoreCase(Constant.UNDEFINED)) { | |||
| couponIdL = Long.valueOf(couponId); | |||
| } | |||
| } catch (NumberFormatException e) { | |||
| logger.error("id转换失败" + couponId); | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "couponId转换失败" + couponId); | |||
| } | |||
| if(couponIdL <= 0){ | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "couponId为空"); | |||
| } | |||
| Map<String,List<WxMerchantVo>> volist = CouponCacheUtils.getCouponMerchantCache(redisTemplate, couponIdL); | |||
| if (null == volist) { | |||
| volist = couponService.getCouponMerchantList(getTenantInfo(), couponIdL); | |||
| if (null != volist && volist.size() > 0 ) { | |||
| CouponCacheUtils.setCouponMerchantCache(redisTemplate, couponIdL, volist); | |||
| } | |||
| } | |||
| return new ResultData(volist); | |||
| } | |||
| @Deprecated | |||
| @ApiOperation("根据id(couponChannel)查询接口") | |||
| @@ -391,7 +433,8 @@ public class WxCouponController extends BaseController { | |||
| //WxCouponCVo wxCouponCVo = wxCouponChannelService.findDetailVo(couponChannelIdL); | |||
| WxCouponCVo wxCouponCVo = null; | |||
| try { | |||
| wxCouponCVo = generateWxCouponCVoex(couponChannelIdL,couponIdL,getTenantInfo().getTenantId()); | |||
| TenantEntity tenantEntity = getTenantInfo(); | |||
| wxCouponCVo = generateWxCouponCVoex(couponChannelIdL,couponIdL,tenantEntity.getTenantId(),tenantEntity); | |||
| } catch (IllegalAccessException e) { | |||
| logger.error("coupon detail fail,copyproperties error" + couponChannelId,e); | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "coupon detail fail,copyproperties error" + couponChannelId); | |||
| @@ -527,13 +570,13 @@ public class WxCouponController extends BaseController { | |||
| } | |||
| private WxCouponCVo generateWxCouponCVoex(Long couponChannelIdL,Long couponIdL,String tenantId) throws IllegalAccessException, InvocationTargetException { | |||
| private WxCouponCVo generateWxCouponCVoex(Long couponChannelIdL,Long couponIdL,String couponTenantId,TenantEntity mallTenantEntity) throws IllegalAccessException, InvocationTargetException { | |||
| if(couponChannelIdL > 0l){ | |||
| WxCouponChannel cc = wxCouponChannelService.getById(couponChannelIdL,tenantId); | |||
| WxCouponChannel cc = wxCouponChannelService.getById(couponChannelIdL,couponTenantId); | |||
| if(cc == null){ | |||
| return null; | |||
| } | |||
| WxCouponCVo wxcv = couponService.getVoById(cc.getCouponId(),tenantId); | |||
| WxCouponCVo wxcv = couponService.getVoById(cc.getCouponId(),couponTenantId,mallTenantEntity); | |||
| if(wxcv == null){ | |||
| return null; | |||
| } | |||
| @@ -552,7 +595,7 @@ public class WxCouponController extends BaseController { | |||
| wxcv.setTtSpuId(cc.getTtSpuId()); | |||
| return wxcv; | |||
| }else if(couponIdL > 0l){ | |||
| WxCouponCVo wxcv = couponService.getVoById(couponIdL,tenantId); | |||
| WxCouponCVo wxcv = couponService.getVoById(couponIdL,couponTenantId,mallTenantEntity); | |||
| return wxcv; | |||
| } | |||
| return null; | |||
| @@ -119,7 +119,8 @@ public class WxCouponOrderController extends BaseController { | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); | |||
| } | |||
| WxCouponOrderCVo wxCouponOrderCVo = wxCouponOrderService.simpleDetailCUserVo(couponOrderId,getTenantInfo()); | |||
| TenantEntity tenantEntity = getTenantInfo(); | |||
| WxCouponOrderCVo wxCouponOrderCVo = wxCouponOrderService.simpleDetailCUserVo(couponOrderId,tenantEntity); | |||
| if (wxCouponOrderCVo == null) { | |||
| return new ResultData(ErrorCode.COUPON_ORDER_IS_NULL); | |||
| } | |||
| @@ -144,7 +145,7 @@ public class WxCouponOrderController extends BaseController { | |||
| return new ResultData(ErrorCode.COUPON_IS_EMPTY); | |||
| } | |||
| } else { | |||
| wxCouponCVo = wxCouponService.getVoById(wxCouponOrderCVo.getCouponId(),wxCouponOrderCVo.getTenantId()); | |||
| wxCouponCVo = wxCouponService.getVoById(wxCouponOrderCVo.getCouponId(),wxCouponOrderCVo.getTenantId(),tenantEntity); | |||
| if (wxCouponCVo == null) { | |||
| return new ResultData(ErrorCode.COUPON_IS_EMPTY); | |||
| } | |||
| @@ -207,9 +208,10 @@ public class WxCouponOrderController extends BaseController { | |||
| @ApiOperation(value = "手动核销方式,获取动态id") | |||
| @GetMapping("dynamicId") | |||
| @ApiImplicitParams({ | |||
| @ApiImplicitParam(name = "couponOrderId", value = "券ID", dataType = "string", paramType = "query", required = true) | |||
| @ApiImplicitParam(name = "couponOrderId", value = "券ID", dataType = "string", paramType = "query", required = true), | |||
| @ApiImplicitParam(name = "couponTenantId", value = "券tenantID", dataType = "string", paramType = "query", required = false) | |||
| }) | |||
| public ResultData dynamicId(String couponOrderId) { | |||
| public ResultData dynamicId(String couponOrderId,String couponTenantId) { | |||
| if (StringUtils.isBlank(couponOrderId) || couponOrderId.equalsIgnoreCase(Constant.UNDEFINED)) { | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); | |||
| @@ -223,6 +225,7 @@ public class WxCouponOrderController extends BaseController { | |||
| Map retmap = new HashMap(); | |||
| retmap.put("dynamicId", WxCouponOrderCVo.calcuteExpiredCouponOrderId(couponOrderId,Integer.parseInt(sysConfig.getConfigItemValue()))); | |||
| retmap.put("expiredSeconds", Integer.parseInt(sysConfig.getConfigItemValue())); | |||
| retmap.put("couponTenantId", couponTenantId); | |||
| return new ResultData(retmap); | |||
| } | |||
| @@ -515,8 +518,8 @@ public class WxCouponOrderController extends BaseController { | |||
| return new ResultData(ErrorCode.VERIFY_ERROR, e.getMessage()); | |||
| } | |||
| if (couponOrder != null && couponOrder.getMerchantId() != null) { | |||
| wxCouponOrderService.sendInsideCouponVerifyMsg(couponOrder, couponOrderId, couponOrder.getMerchantId(),couponOrder.getBMerchantId()); | |||
| if (couponOrder != null) { | |||
| wxCouponOrderService.sendInsideCouponVerifyMsg(couponOrder.getId(),couponOrder, couponOrder.getBMerchantId(), couponOrder); | |||
| } | |||
| return new ResultData(couponOrder); | |||
| @@ -30,14 +30,13 @@ public class WxCuserFloatingLayerController extends BaseController { | |||
| @Autowired | |||
| WxCuserFloatingLayerService wxCuserFloatingLayerService; | |||
| @AuthIgnore | |||
| @ApiOperation("获取浮层") | |||
| @GetMapping("/getFloatingLayer") | |||
| @ApiImplicitParams({ | |||
| @ApiImplicitParam(name = "openId", value = "openId", dataType = "String", paramType = "query", required = true), | |||
| @ApiImplicitParam(name = "appId", value = "appId", dataType = "String", paramType = "query", required = true)}) | |||
| public ResultData getAppIcon(String openId, String appId) { | |||
| WxFloatingLayer wxFloatingLayer = wxCuserFloatingLayerService.getFloatingLayer(openId, appId); | |||
| public ResultData getAppIcon(String openId) { | |||
| WxFloatingLayer wxFloatingLayer = wxCuserFloatingLayerService.getFloatingLayer(getTenantInfo(),openId); | |||
| return new ResultData(Result.SUCCESS, "查询成功", wxFloatingLayer); | |||
| } | |||
| @@ -7,10 +7,13 @@ 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.EnumGroupSupport; | |||
| import com.iformall.enums.EnumYesOrNo; | |||
| import com.iformall.service.*; | |||
| import io.swagger.annotations.Api; | |||
| import io.swagger.annotations.ApiImplicitParam; | |||
| 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; | |||
| @@ -48,7 +51,7 @@ public class WxMallController extends BaseController { | |||
| @ApiOperation("获取模板类型") | |||
| @GetMapping("/getAppIcp") | |||
| public ResultData getAppIcp(String appId) { | |||
| WxAppinfo appInfo = wxAppinfoService.getByAppId(appId); | |||
| WxAppinfo appInfo = wxAppinfoService.getOnlyByAppIdFromRedis(appId); | |||
| if (appInfo == null) { | |||
| return new ResultData(ErrorCode.APP_ID_NOT_FOUND); | |||
| } | |||
| @@ -60,7 +63,7 @@ public class WxMallController extends BaseController { | |||
| @ApiOperation("获取模板类型") | |||
| @GetMapping("/modelType") | |||
| public ResultData modelType(String appId) { | |||
| WxAppinfo appInfo = wxAppinfoService.getByAppId(appId); | |||
| WxAppinfo appInfo = wxAppinfoService.getOnlyByAppIdFromRedis(appId); | |||
| if (appInfo == null) { | |||
| return new ResultData(ErrorCode.APP_ID_NOT_FOUND); | |||
| } | |||
| @@ -73,7 +76,7 @@ public class WxMallController extends BaseController { | |||
| @GetMapping("/getAppIcon") | |||
| @ApiImplicitParam(name = "appId", value = "appId", dataType = "String", paramType = "query", required = true) | |||
| public ResultData getAppIcon(String appId) { | |||
| WxAppinfo appInfo = wxAppinfoService.getByAppId(appId); | |||
| WxAppinfo appInfo = wxAppinfoService.getOnlyByAppIdFromRedis(appId); | |||
| if (appInfo == null) { | |||
| return new ResultData(ErrorCode.APP_ID_NOT_FOUND); | |||
| } | |||
| @@ -93,7 +96,7 @@ public class WxMallController extends BaseController { | |||
| @GetMapping("/getWeapNote") | |||
| @ApiImplicitParam(name = "appId", value = "appId", dataType = "String", paramType = "query", required = true) | |||
| public ResultData getWeapNote(String appId) { | |||
| WxAppinfo appInfo = wxAppinfoService.getByAppId(appId); | |||
| WxAppinfo appInfo = wxAppinfoService.getOnlyByAppIdFromRedis(appId); | |||
| if (appInfo == null) { | |||
| return new ResultData(ErrorCode.APP_ID_NOT_FOUND); | |||
| } | |||
| @@ -117,6 +120,26 @@ public class WxMallController extends BaseController { | |||
| return new ResultData(Result.SUCCESS, "查询成功", mall); | |||
| } | |||
| @RedisCache | |||
| @ApiOperation("商场信息") | |||
| @GetMapping("/subMall") | |||
| public ResultData getSubMall(Integer isAll) { | |||
| List<WxMall> mallList = new ArrayList<>(); | |||
| WxMall mall = wxMallService.getByTenantInfo(getTenantInfo()); | |||
| if (mall == null) { | |||
| return new ResultData(ErrorCode.MALL_INFO_NOT_FOUND); | |||
| } | |||
| if(EnumYesOrNo.YES.getCode().equals(isAll)){ | |||
| mallList.add(mall); | |||
| } | |||
| if (mall.getGroupSupport().equals(EnumGroupSupport.SUPPORT.getCode()) && | |||
| StringUtils.isBlank(mall.getParentTenantId())) { | |||
| List<WxMall> subMall = wxMallService.getSubByParentTenantId(mall.getTenantId()); | |||
| mallList.addAll(subMall); | |||
| } | |||
| return new ResultData(Result.SUCCESS, "查询成功", mallList); | |||
| } | |||
| @ApiOperation("成长值相关信息") | |||
| @GetMapping("/scoreLevelInfo") | |||
| public ResultData getScoreLevelInfo() { | |||
| @@ -1,5 +1,6 @@ | |||
| package com.iformall.controller; | |||
| import com.iformall.annotation.TenantIgnore; | |||
| import com.iformall.common.ErrorCode; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.domain.dto.WxMerchantDto; | |||
| @@ -61,6 +61,9 @@ import java.util.*; | |||
| public class WxOrderController extends BaseController { | |||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||
| @Autowired | |||
| private WxMallService mallService; | |||
| @Autowired | |||
| private WxCouponChannelService wxCouponChannelService; | |||
| @@ -140,7 +143,8 @@ public class WxOrderController extends BaseController { | |||
| } | |||
| return wxOrderService.composeSaveOrder(false,EnumComposeOrder.ONE_NUMBER_ORDER_BATCH,orderSaveDto,memberId,getPayWay(),getTenantInfo(),this.getPayVersion()); | |||
| } | |||
| @TenantIgnore | |||
| @ApiOperation(value = "单个券单个订单,卡(分账导致无法批量下单)、拼团,砍价用", notes = "{\"couponChannelId\":\"String\",\"couponId\":\"String\",\"press\":\"String\",\"orderGroupId\":\"String\",\"formId\":\"String\"}") | |||
| @PostMapping("save") | |||
| public ResultData saveOrder(@RequestBody OrderSaveDto orderSaveDto) { | |||
| @@ -187,6 +191,7 @@ public class WxOrderController extends BaseController { | |||
| String open_id = msgObject.getString("open_id"); | |||
| //透传字段 | |||
| Long composeOrderId = null; | |||
| String tenantId = null; | |||
| try{ | |||
| String cp_extra = msgObject.getString("cp_extra"); | |||
| if(StringUtils.isBlank(cp_extra)){ | |||
| @@ -197,16 +202,18 @@ public class WxOrderController extends BaseController { | |||
| Map<String,String> couponMap = JSONObject.parseObject(cp_extra, Map.class); | |||
| String idstr = couponMap.get("composeOrderId"); | |||
| composeOrderId = Long.parseLong(idstr); | |||
| tenantId = couponMap.get("tenantId"); | |||
| }catch(Exception e){ | |||
| } | |||
| if(composeOrderId == null){ | |||
| if(composeOrderId == null || StringUtils.isBlank(tenantId)){ | |||
| map.put("err_no",ErrorCode.SYS_PARAMETER_NOT_NULL.getCode()); | |||
| map.put("err_tips","透传字段格式不正确"); | |||
| return map; | |||
| } | |||
| WxMall mall = mallService.getByTenantId(tenantId); | |||
| //验证app | |||
| WxAppinfo appinfo = wxAppinfoService.getByAppIdFromRedis(app_id); | |||
| WxAppinfo appinfo = wxAppinfoService.getOnlyByAppIdFromRedis(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()); | |||
| @@ -220,10 +227,10 @@ public class WxOrderController extends BaseController { | |||
| return map; | |||
| } | |||
| TenantEntity tenantEntity = new TenantEntity(); | |||
| tenantEntity.updateTenantInfo(appinfo); | |||
| tenantEntity.updateTenantInfo(mall); | |||
| //验证用户 | |||
| Long memberId = null; | |||
| TtCUser cuser = (TtCUser) cuserFactory.getCUserService(EnumAppPlat.TOUTIAO).getByOpenId(open_id, tenantEntity.getTenantId()); | |||
| TtCUser cuser = (TtCUser) cuserFactory.getCUserService(EnumAppPlat.TOUTIAO).getByOpenId(open_id, appinfo.getTenantId()); | |||
| if(cuser != null && cuser.getUserId() != null){ | |||
| memberId = cuser.getUserId(); | |||
| } | |||
| @@ -250,7 +257,7 @@ public class WxOrderController extends BaseController { | |||
| Map<String, Object> data = new HashMap<>(); | |||
| data.put("out_order_no",order.getMainOrderId().toString()); | |||
| data.put("pay_expire_seconds",14*60); | |||
| data.put("order_entry_schema",wxOrderService.getOrderEntrySchema(order.getMainOrderId())); | |||
| data.put("order_entry_schema",wxOrderService.getOrderEntrySchema(mall.getTenantId(),order.getMainOrderId())); | |||
| if(order.getExtParam() != null && !order.getExtParam().isEmpty()){ | |||
| data.put("order_goods_info",order.getExtParam()); | |||
| } | |||
| @@ -752,26 +759,28 @@ public class WxOrderController extends BaseController { | |||
| JSONObject msgObject = JSONObject.parseObject(msg); | |||
| String app_id = msgObject.getString("app_id"); | |||
| String open_id = msgObject.getString("open_id"); | |||
| String cp_extra = msgObject.getString("cp_extra"); | |||
| String tenantId = getTenantId(cp_extra); | |||
| WxMall mall = mallService.getByTenantId(tenantId); | |||
| //验证app | |||
| WxAppinfo appinfo = wxAppinfoService.getByAppId(app_id); | |||
| WxAppinfo appinfo = wxAppinfoService.getOnlyByAppIdFromRedis(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","未找到支付配置"); | |||
| return map; | |||
| } | |||
| TenantEntity tenantEntity = new TenantEntity(); | |||
| tenantEntity.updateTenantInfo(appinfo); | |||
| tenantEntity.updateTenantInfo(mall); | |||
| //验证用户 | |||
| Long memberId = null; | |||
| TtCUser cuser = (TtCUser) cuserFactory.getCUserService(EnumAppPlat.TOUTIAO).getByOpenId(open_id, tenantEntity.getTenantId()); | |||
| TtCUser cuser = (TtCUser) cuserFactory.getCUserService(EnumAppPlat.TOUTIAO).getByOpenId(open_id, appinfo.getTenantId()); | |||
| if(cuser != null && cuser.getUserId() != null){ | |||
| memberId = cuser.getUserId(); | |||
| } | |||
| @@ -790,7 +799,7 @@ public class WxOrderController extends BaseController { | |||
| WxRefundOrder refundOrder = (WxRefundOrder) resultData.data; | |||
| Map<String, Object> data = new HashMap<>(); | |||
| data.put("out_refund_no",refundOrder.getId().toString()); | |||
| data.put("order_entry_schema",wxOrderService.getOrderEntrySchema(Long.parseLong(refundOrder.getPayOrderNo()))); | |||
| data.put("order_entry_schema",wxOrderService.getOrderEntrySchema(mall.getTenantId(),Long.parseLong(refundOrder.getPayOrderNo()))); | |||
| map.put("data",data); | |||
| map.put("err_no",0); | |||
| map.put("err_tips",resultData.message); | |||
| @@ -113,7 +113,7 @@ public class WxPayOrderController extends BaseController { | |||
| if (null != wxCUserBasicInfo && EnumCreditLockedStatus.CLOSE.getCode().equals(wxCUserBasicInfo.getStatus())) { | |||
| return new ResultData(ErrorCode.MEMBER_IS_LOCKED); | |||
| } | |||
| WxAppinfo appInfo = getAppInfo(appId); | |||
| WxAppinfo appInfo = wxAppinfoService.getByAppIdFromRedis(appId,getTenantInfo().getTenantId()); | |||
| if(appInfo == null) { | |||
| return new ResultData(ErrorCode.APP_ID_NOT_FOUND); | |||
| } | |||
| @@ -6,6 +6,7 @@ import com.iformall.common.ResultData; | |||
| import com.iformall.domain.po.WxCUser; | |||
| import com.iformall.domain.po.WxOrder; | |||
| import com.iformall.domain.po.WxOrderPress; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import com.iformall.domain.vo.WxCouponCVo; | |||
| import com.iformall.enums.EnumOrderPressStatus; | |||
| import com.iformall.enums.EnumOrderStatus; | |||
| @@ -91,12 +92,15 @@ public class WxPressOrderController extends BaseController { | |||
| ValueOperations<String, WxOrder> operations = orderRedisTemplate.opsForValue(); | |||
| // 缓存 | |||
| boolean hasKey = orderRedisTemplate.hasKey(key); | |||
| TenantEntity tenantEntity = getTenantInfo(); | |||
| if (hasKey) { | |||
| // 从缓存获取砍价订单信息 | |||
| order = operations.get(key); | |||
| } else { | |||
| // 订单没有入缓存,需要从数据库中读取 | |||
| order = wxOrderService.getById(orderId,getTenantInfo().getTenantId()); | |||
| order = wxOrderService.getById(orderId,tenantEntity.getTenantId()); | |||
| if (order != null) { | |||
| // 订单优化,进缓存 | |||
| orderRedisTemplate.opsForValue().set(key, order, 3600, TimeUnit.SECONDS); | |||
| @@ -117,7 +121,7 @@ public class WxPressOrderController extends BaseController { | |||
| wxCouponCVo = cdOperations.get(cdKey); | |||
| } else { | |||
| // 券信息没有入缓存,需要从数据库中读取 | |||
| wxCouponCVo = wxCouponService.getVoById(order.getProductId(),order.getTenantId()); | |||
| wxCouponCVo = wxCouponService.getVoById(order.getProductId(),order.getTenantId(),tenantEntity); | |||
| if (wxCouponCVo != null) { | |||
| // 券详情优化,进缓存 | |||
| couponCVoRedisTemplate.opsForValue().set(cdKey, wxCouponCVo, 3600, TimeUnit.SECONDS); | |||
| @@ -183,7 +183,7 @@ public class WxUserGrantController extends BaseController { | |||
| //其他参数 | |||
| String systemInfo = map.get("systemInfo"); | |||
| WxAppinfo wxAppinfo = wxAppinfoService.getByAppId(appId); | |||
| WxAppinfo wxAppinfo = wxAppinfoService.getOnlyByAppIdFromRedis(appId); | |||
| if(wxAppinfo == null){ | |||
| return new ResultData(ErrorCode.APP_ID_NOT_FOUND); | |||
| } | |||
| @@ -214,7 +214,7 @@ public class WxUserGrantController extends BaseController { | |||
| } | |||
| if(mallList != null && mallList.size() >0){ | |||
| mallList.stream().forEach(cs -> { | |||
| WxAppinfo cAppInfo = wxAppinfoService.getCAppInfoFromRedis(cs.getTenantId(), EnumAppPlat.WX); | |||
| WxAppinfo cAppInfo = wxAppinfoService.getCAppInfoFromRedis(cs.getTenantId(), appPlat); | |||
| cs.setAppId(cAppInfo.getAppId()); | |||
| }); | |||
| resultMap.put("subMalls", JSON.toJSONString(mallList)); | |||
| @@ -244,8 +244,8 @@ public class WxUserGrantController extends BaseController { | |||
| } | |||
| HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); | |||
| request.setAttribute(Constant.TENANT_ID, wxMall.getTenantId()); | |||
| request.setAttribute(Constant.PARENT_TENANT_ID, wxMall.getParentTenantId()); | |||
| // request.setAttribute(Constant.TENANT_ID, wxMall.getTenantId()); | |||
| // request.setAttribute(Constant.PARENT_TENANT_ID, wxMall.getParentTenantId()); | |||
| String ipaddress = IPUtil.getIpAddr(request); | |||
| CUser cUser = new CUser(); | |||
| @@ -270,7 +270,7 @@ public class WxUserGrantController extends BaseController { | |||
| cUser = cuserFactory.getCUserService(appPlat).handleLoginUser(cUser,wxCUserFrom); | |||
| resultMap.put("token", cUser.getToken()); | |||
| request.setAttribute(Constant.LOGIN_USER_KEY, cUser.getId()); | |||
| // request.setAttribute(Constant.LOGIN_USER_KEY, cUser.getId()); | |||
| return new ResultData(resultMap); | |||
| } | |||
| @@ -370,7 +370,7 @@ public class WxUserGrantController extends BaseController { | |||
| } | |||
| CUser user = getCUser(); | |||
| if (user != null) { | |||
| WxAppinfo wxAppinfo = wxAppinfoService.getByAppId(user.getAppId()); | |||
| WxAppinfo wxAppinfo = wxAppinfoService.getOnlyByAppIdFromRedis(user.getAppId()); | |||
| if(wxAppinfo == null){ | |||
| return new ResultData(ErrorCode.APP_ID_NOT_FOUND); | |||
| } | |||
| @@ -417,7 +417,7 @@ public class WxUserGrantController extends BaseController { | |||
| if (user == null) { | |||
| return new ResultData(ErrorCode.USER_IS_EMPTY); | |||
| } | |||
| WxAppinfo wxAppinfo = wxAppinfoService.getByAppId(user.getAppId()); | |||
| WxAppinfo wxAppinfo = wxAppinfoService.getOnlyByAppIdFromRedis(user.getAppId()); | |||
| if(wxAppinfo == null){ | |||
| return new ResultData(ErrorCode.APP_ID_NOT_FOUND); | |||
| } | |||
| @@ -1,13 +1,16 @@ | |||
| package com.iformall.interceptor; | |||
| import com.alibaba.fastjson.JSONObject; | |||
| import com.iformall.annotation.AuthIgnore; | |||
| import com.iformall.annotation.TenantIgnore; | |||
| import com.iformall.common.ErrorCode; | |||
| import com.iformall.common.TenantThreadLocal; | |||
| import com.iformall.domain.po.WxMall; | |||
| import com.iformall.domain.po.base.BaseCUserEntity; | |||
| import com.iformall.exception.MallinkException; | |||
| import com.iformall.service.CUserTokenService; | |||
| import com.iformall.service.WxMallService; | |||
| import com.iformall.utils.Constant; | |||
| import org.apache.commons.lang3.StringUtils; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| @@ -26,9 +29,13 @@ import javax.servlet.http.HttpServletResponse; | |||
| */ | |||
| @Component | |||
| public class AuthorizationInterceptor extends HandlerInterceptorAdapter { | |||
| @Autowired | |||
| private CUserTokenService cUserTokenService; | |||
| @Autowired | |||
| private WxMallService wxMallService; | |||
| @Override | |||
| public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { | |||
| @@ -63,18 +70,54 @@ public class AuthorizationInterceptor extends HandlerInterceptorAdapter { | |||
| if(cUser == null || cUser.getExpireTime().getTime() < System.currentTimeMillis()){ | |||
| throw new MallinkException(ErrorCode.NET_TOKEN_INVALID.getCode(), "URL:" + request.getRequestURL() + " token失效,请重新登录"); | |||
| } | |||
| //集团版中针对某一商场的业务需要传递mallTenantId | |||
| String mallTenantId = request.getHeader("mallTenantId"); | |||
| if(StringUtils.isBlank(mallTenantId)){ | |||
| mallTenantId = request.getParameter("mallTenantId"); | |||
| } | |||
| if(StringUtils.isBlank(mallTenantId)){ | |||
| try{ | |||
| String body = ((BodyReaderHttpServletRequestWrapper) request).getBody(); | |||
| mallTenantId = JSONObject.parseObject(body).getString("mallTenantId"); | |||
| }catch(Exception e){} | |||
| } | |||
| String tenantId = null; | |||
| String parenTenantId = null; | |||
| //设置userId到request里,后续根据userId,获取用户信息 | |||
| request.setAttribute(Constant.LOGIN_USER_KEY, cUser.getId()); | |||
| request.setAttribute(Constant.TENANT_ID, cUser.getTenantId()); | |||
| request.setAttribute(Constant.REQUEST_C_USER_KEY, cUser); | |||
| request.setAttribute(Constant.APP_INFO,cUser.getAppinfo()); | |||
| if (StringUtils.isNotBlank(cUser.getParentTenantId())) { | |||
| request.setAttribute(Constant.PARENT_TENANT_ID, cUser.getParentTenantId()); | |||
| if(StringUtils.isNotBlank(mallTenantId)){ | |||
| tenantId = mallTenantId; | |||
| WxMall mall = wxMallService.getByTenantId(tenantId); | |||
| if(StringUtils.isNotBlank(mall.getParentTenantId())){ | |||
| parenTenantId = mall.getParentTenantId(); | |||
| } | |||
| }else{ | |||
| tenantId = cUser.getTenantId(); | |||
| if (StringUtils.isNotBlank(cUser.getParentTenantId())) { | |||
| parenTenantId = cUser.getParentTenantId(); | |||
| } | |||
| } | |||
| if(!tenantId.equals(cUser.getTenantId()) | |||
| && !cUser.getTenantId().equals(parenTenantId) | |||
| && !tenantId.equals(cUser.getParentTenantId())){ | |||
| throw new MallinkException(ErrorCode.SYS_AUTH_ERROR); | |||
| } | |||
| request.setAttribute(Constant.TENANT_ID, tenantId); | |||
| request.setAttribute(Constant.PARENT_TENANT_ID, parenTenantId); | |||
| request.setAttribute(Constant.REQUEST_C_USER_KEY, cUser); | |||
| if(cUser.basicInfoIs()){ | |||
| request.setAttribute(Constant.LOGIN_MEMBER_KEY, cUser.getUserId()); | |||
| }else{ | |||
| request.setAttribute(Constant.LOGIN_MEMBER_KEY, null); | |||
| } | |||
| request.setAttribute(Constant.APP_INFO,cUser.getAppinfo()); | |||
| //如果是要不需要自动设置tenantI信息 | |||
| TenantIgnore tenantIgnoreAnnotation = null; | |||
| @@ -86,7 +129,7 @@ public class AuthorizationInterceptor extends HandlerInterceptorAdapter { | |||
| if(tenantIgnoreAnnotation != null){ | |||
| TenantThreadLocal.remove(); | |||
| }else { | |||
| TenantThreadLocal.setCurrentThreadTenant(cUser.getTenantId(), cUser.getParentTenantId()); | |||
| TenantThreadLocal.setCurrentThreadTenant(tenantId, parenTenantId); | |||
| } | |||
| return true; | |||
| @@ -23,6 +23,7 @@ public class TenantInfoImpl implements TenantInfo { | |||
| "mall_permission", | |||
| "mall_sale_type", | |||
| "mall_user_role", | |||
| "wx_brand", | |||
| "wx_channel", | |||
| "wx_business", | |||
| "wx_coupon_type", | |||
| @@ -59,6 +60,9 @@ public class TenantInfoImpl implements TenantInfo { | |||
| "fengniao_map_config", | |||
| "wx_c_user", | |||
| "tt_c_user", | |||
| "tt_buser", | |||
| "wx_buser", | |||
| "wx_merchant_b_user", | |||
| "wx_user_visit", | |||
| "tt_goods_category", | |||
| }; | |||
| @@ -67,8 +71,12 @@ public class TenantInfoImpl implements TenantInfo { | |||
| "wx_mall", | |||
| "wx_appinfo", | |||
| "wx_authorizer_info", | |||
| "wx_brand", | |||
| "wx_c_user", | |||
| "tt_c_user", | |||
| "tt_buser", | |||
| "wx_buser", | |||
| "wx_merchant_b_user", | |||
| "wx_user_visit", | |||
| "wx_c_user_basic_info", | |||
| "user_basic_info_address", | |||
| @@ -1,7 +1,9 @@ | |||
| package com.iformall.controller.base; | |||
| import com.alibaba.fastjson.JSONObject; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import com.iformall.utils.IPUtil; | |||
| import org.apache.commons.lang3.StringUtils; | |||
| import org.springframework.web.bind.WebDataBinder; | |||
| import org.springframework.web.bind.annotation.InitBinder; | |||
| import org.springframework.web.bind.annotation.RestController; | |||
| @@ -13,6 +15,7 @@ import java.beans.PropertyEditorSupport; | |||
| import java.text.ParseException; | |||
| import java.text.SimpleDateFormat; | |||
| import java.util.Date; | |||
| import java.util.Map; | |||
| @RestController | |||
| public class BaseController { | |||
| @@ -44,4 +47,22 @@ public class BaseController { | |||
| String ipaddress = IPUtil.getIpAddr(request); | |||
| return ipaddress; | |||
| } | |||
| /** | |||
| * 根据扩展字段获取tenantId | |||
| */ | |||
| public String getTenantId(String attach){ | |||
| if(StringUtils.isNotBlank(attach)){ | |||
| try{ | |||
| Map<String,Object> map = JSONObject.parseObject(attach, Map.class); | |||
| String tenantId = map.get("tenantId").toString(); | |||
| if(StringUtils.isNotBlank(tenantId)){ | |||
| return tenantId; | |||
| } | |||
| }catch (Exception e){ | |||
| } | |||
| } | |||
| return null; | |||
| } | |||
| } | |||
| @@ -100,6 +100,7 @@ public class TtPayController extends BaseController { | |||
| Map<String, Object> pMap = JSONObject.parseObject(msg, Map.class); | |||
| String appid; | |||
| String tenantId; | |||
| WxAppinfo appinfo; | |||
| WxPayAccount payAccount; | |||
| Boolean is2_0 = false; | |||
| @@ -111,8 +112,10 @@ public class TtPayController extends BaseController { | |||
| String nonce = request.getHeader("Byte-Nonce-Str"); | |||
| appid = (String) pMap.get("app_id"); | |||
| appinfo = appinfoService.getByAppId(appid); | |||
| payAccount = payAccountService.getById(appinfo.getPayId()); | |||
| String cp_extra = (String) pMap.get("cp_extra"); | |||
| tenantId = getTenantId(cp_extra); | |||
| appinfo = appinfoService.getOnlyByAppIdFromRedis(appid); | |||
| payAccount = payAccountService.getByIdFromRedis(appinfo.getPayId()); | |||
| TtPayService ttPayService = maUtil.getTtPayService(appinfo, payAccount); | |||
| String beforeSign = String.format("%s\n%s\n%s\n", | |||
| @@ -134,8 +137,10 @@ public class TtPayController extends BaseController { | |||
| String nonce = (String) parameterMap.get("nonce"); | |||
| appid = (String) pMap.get("appid"); | |||
| appinfo = appinfoService.getByAppId(appid); | |||
| payAccount = payAccountService.getById(appinfo.getPayId()); | |||
| String cp_extra = (String) pMap.get("cp_extra"); | |||
| tenantId = getTenantId(cp_extra); | |||
| appinfo = appinfoService.getOnlyByAppIdFromRedis(appid); | |||
| payAccount = payAccountService.getByIdFromRedis(appinfo.getPayId()); | |||
| Map<String,Object> paramMap = new HashMap<>(); | |||
| paramMap.put("token",payAccount.getNotifyToken()); | |||
| @@ -164,7 +169,7 @@ public class TtPayController extends BaseController { | |||
| if (StringUtils.isNotBlank(out_order_no)) { | |||
| try { | |||
| Long orderId = Long.valueOf(out_order_no); | |||
| WxPayOrder wxpayOrder = wxPayOrderService.getById(orderId, appinfo.getTenantId()); | |||
| WxPayOrder wxpayOrder = wxPayOrderService.getById(orderId, tenantId); | |||
| if(wxpayOrder == null){ | |||
| logger.error("未找到订单"+orderId); | |||
| resultMap.put("err_tips","未找到订单"); | |||
| @@ -207,6 +212,7 @@ public class TtPayController extends BaseController { | |||
| } | |||
| Map<String,String> map = new HashMap<>(); | |||
| map.put("tenantId",tenantId); | |||
| map.put("appid",appid); | |||
| map.put("cp_refundno",cp_refundno); | |||
| map.put("status",status); | |||
| @@ -216,6 +222,7 @@ public class TtPayController extends BaseController { | |||
| String jsonMsg = JSON.toJSONString(map); | |||
| FmInsideNotifyRefundSuccessMsg refundSuccessMsg = new FmInsideNotifyRefundSuccessMsg(); | |||
| refundSuccessMsg.setTenantId(tenantId); | |||
| refundSuccessMsg.setMsgType(EnumMsgRecordType.INSIDE_NOTIFY_REFUND_SUCCESS.getCode()); | |||
| refundSuccessMsg.setDelayTimeLevel(3); | |||
| refundSuccessMsg.setPayWay(EnumPayWay.PAY_WAY_TT.getCode()); | |||
| @@ -233,7 +240,7 @@ public class TtPayController extends BaseController { | |||
| String out_settle_no = (String) pMap.get("out_settle_no"); | |||
| String status = (String) pMap.get("status"); | |||
| WxProfitSharingOrder wxProfitSharingOrder = new WxProfitSharingOrder(); | |||
| wxProfitSharingOrder.setTenantId(appinfo.getTenantId()); | |||
| wxProfitSharingOrder.setTenantId(tenantId); | |||
| wxProfitSharingOrder.setOutSettleNo(Long.parseLong(out_settle_no)); | |||
| WxProfitSharingOrder one = wxProfitSharingOrderService.findOne(wxProfitSharingOrder); | |||
| if(one != null){ | |||
| @@ -70,7 +70,7 @@ public class TtWebController extends BaseController { | |||
| } | |||
| String client_key = (String) parameterMap.get("client_key"); | |||
| WxAppinfo appInfo = wxAppinfoService.getByAppId(client_key); | |||
| WxAppinfo appInfo = wxAppinfoService.getOnlyByAppIdFromRedis(client_key); | |||
| if(appInfo == null){ | |||
| resultMap.put("err_code",1000); | |||
| resultMap.put("err_tips","error"); | |||
| @@ -109,14 +109,16 @@ public class TtWebController extends BaseController { | |||
| // String status = (String) content.get("status"); | |||
| TtCouponChannelPoi couponChannelPoi = new TtCouponChannelPoi(); | |||
| couponChannelPoi.updateTenantInfo(appInfo); | |||
| // couponChannelPoi.updateTenantInfo(appInfo); | |||
| couponChannelPoi.setSpuId(product_id); | |||
| if("FAIL".equals(status)){ | |||
| couponChannelPoi.setLastStatus(EnumSpuSyncStatus.sync_audit_rejection.getCode()); | |||
| couponChannelPoi.setLastStatusDesc(reason); | |||
| }else if("PASS".equals(status)){ | |||
| couponChannelPoi.setLastStatus(EnumSpuSyncStatus.sync_audit_pass.getCode()); | |||
| // couponChannelPoi.setLastStatus(EnumSpuSyncStatus.sync_audit_pass.getCode()); | |||
| //抖音审核通过既上架 | |||
| couponChannelPoi.setLastStatus(EnumSpuSyncStatus.sync_put_on.getCode()); | |||
| couponChannelPoi.setLastStatusDesc(reason); | |||
| }else{ | |||
| @@ -1,13 +1,16 @@ | |||
| package com.iformall.controller.callback; | |||
| import com.alibaba.fastjson.JSON; | |||
| import com.iformall.controller.base.BaseController; | |||
| import com.iformall.enums.EnumPayVersion; | |||
| import com.iformall.enums.EnumPayWay; | |||
| import com.iformall.exception.BizMessageException; | |||
| import com.iformall.exception.MallinkException; | |||
| import com.iformall.pay.WxPayment; | |||
| import com.iformall.service.MailService; | |||
| import com.iformall.service.WxPayBillService; | |||
| import com.iformall.service.WxRefundOrderService; | |||
| import com.iformall.utils.DateUtils; | |||
| import com.iformall.utils.XmlUtil; | |||
| import org.apache.commons.io.IOUtils; | |||
| import org.jdom2.JDOMException; | |||
| @@ -24,6 +27,7 @@ import java.io.ByteArrayOutputStream; | |||
| import java.io.IOException; | |||
| import java.io.InputStream; | |||
| import java.nio.charset.Charset; | |||
| import java.util.Date; | |||
| import java.util.Map; | |||
| import java.util.SortedMap; | |||
| import java.util.TreeMap; | |||
| @@ -37,6 +41,12 @@ public class WxPayBillController extends BaseController { | |||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||
| @Autowired | |||
| private String fmExceptionEmails; | |||
| @Autowired | |||
| private MailService mailService; | |||
| @Autowired | |||
| private WxPayBillService wxPayBillService; | |||
| @@ -69,7 +79,8 @@ public class WxPayBillController extends BaseController { | |||
| try { | |||
| paramMap = WxPayment.xmlToMap(resultxml); | |||
| logger.info("微信支付回调, notify, param: " + paramMap.toString() ); | |||
| String response = wxPayBillService.notify(paramMap, EnumPayWay.PAY_WAY_WECHAT); | |||
| String attach = paramMap.get("attach"); | |||
| String response = wxPayBillService.notify(getTenantId(attach),paramMap, EnumPayWay.PAY_WAY_WECHAT); | |||
| logger.info("微信支付回调, notify success, req : " + resultxml + ", resp: " + response.toString()); | |||
| return response; | |||
| } catch (BizMessageException e) { | |||
| @@ -121,6 +132,7 @@ public class WxPayBillController extends BaseController { | |||
| xml = IOUtils.toString(request.getInputStream(), Charset.forName("UTF-8")); | |||
| logger.info(xml); | |||
| paramMap = WxPayment.xmlToMap(xml); | |||
| response = wxRefundOrderService.notify(paramMap, EnumPayWay.PAY_WAY_WECHAT,EnumPayVersion.WX_PAY_V2); | |||
| logger.info("refund wxpay, notify success, req : " + xml + ", resp: " + response.toString()); | |||
| return response; | |||
| @@ -160,7 +172,17 @@ public class WxPayBillController extends BaseController { | |||
| xml = IOUtils.toString(request.getInputStream(), Charset.forName("UTF-8")); | |||
| paramMap = WxPayment.xmlToMap(xml); | |||
| logger.info("share wxpay, notify, param: " + xml ); | |||
| response = wxPayBillService.notify(paramMap, EnumPayWay.PAY_WAY_WECHAT); | |||
| //发邮件 | |||
| String[] receivers = fmExceptionEmails.split(","); | |||
| StringBuilder sb = new StringBuilder(); | |||
| sb.append(DateUtils.date2String(new Date())); | |||
| sb.append("\n"); | |||
| sb.append("分账回调 :WxPayBillController"); | |||
| sb.append("\n"); | |||
| sb.append(JSON.toJSONString(paramMap)); | |||
| //发送邮件 | |||
| mailService.sendSimpleMail(receivers, "排查回调位置", sb.toString()); | |||
| // response = wxPayBillService.notify(paramMap, EnumPayWay.PAY_WAY_WECHAT); | |||
| logger.info("share wxpay, notify success, req : " + xml + ", resp: " + response.toString()); | |||
| return response; | |||
| } catch (BizMessageException e) { | |||
| @@ -10,9 +10,11 @@ import com.iformall.exception.BizMessageException; | |||
| import com.iformall.exception.MallinkException; | |||
| import com.iformall.mq.MqBaseProducer; | |||
| import com.iformall.pay.WxPayment; | |||
| import com.iformall.service.MailService; | |||
| import com.iformall.service.WxPayOrderService; | |||
| import com.iformall.service.WxRefundOrderService; | |||
| import com.iformall.service.WxSubsidyService; | |||
| import com.iformall.utils.DateUtils; | |||
| import com.iformall.utils.XmlUtil; | |||
| import org.apache.commons.io.IOUtils; | |||
| import org.jdom2.JDOMException; | |||
| @@ -32,10 +34,7 @@ import java.io.ByteArrayOutputStream; | |||
| import java.io.IOException; | |||
| import java.io.InputStream; | |||
| import java.nio.charset.Charset; | |||
| import java.util.HashMap; | |||
| import java.util.Map; | |||
| import java.util.SortedMap; | |||
| import java.util.TreeMap; | |||
| import java.util.*; | |||
| @RestController | |||
| @RequestMapping("/wxPay/notify") | |||
| @@ -51,14 +50,20 @@ public class WxPayController extends BaseController { | |||
| @Autowired | |||
| private MqBaseProducer mqBaseProducer; | |||
| @Autowired | |||
| private String fmExceptionEmails; | |||
| @Autowired | |||
| private MailService mailService; | |||
| /** | |||
| * | |||
| * @return 接收微信异步通知 | |||
| * @throws Exception 可能产生的任何异常 | |||
| */ | |||
| @RequestMapping(value = "/pay", produces = MediaType.APPLICATION_JSON_UTF8_VALUE) | |||
| @RequestMapping(value = "/pay/{tenantId}", produces = MediaType.APPLICATION_JSON_UTF8_VALUE) | |||
| @ResponseBody | |||
| public String _payNotify(HttpServletRequest request) throws IOException, JDOMException { | |||
| public String _payNotify(@PathVariable String tenantId,HttpServletRequest request) throws IOException, JDOMException { | |||
| logger.info("[" +getIpAddr() + "]微信支付回调"); | |||
| SortedMap resultMap = new TreeMap(); | |||
| resultMap.put("return_code", "SUCCESS"); | |||
| @@ -139,8 +144,8 @@ public class WxPayController extends BaseController { | |||
| * @return 接收微信退款异步通知 | |||
| * @throws Exception 可能产生的任何异常 | |||
| */ | |||
| @RequestMapping(value = "/refund") | |||
| public String __refundNotify(HttpServletRequest request) throws Exception { | |||
| @RequestMapping(value = "/refund/{tenantId}") | |||
| public String __refundNotify(@PathVariable String tenantId,HttpServletRequest request) throws Exception { | |||
| logger.info("[" +getIpAddr() + "]微信退款回调"); | |||
| Map<String, String> paramMap = null; | |||
| String response = ""; | |||
| @@ -152,6 +157,7 @@ public class WxPayController extends BaseController { | |||
| String jsonMsg = JSON.toJSONString(paramMap); | |||
| FmInsideNotifyRefundSuccessMsg refundSuccessMsg = new FmInsideNotifyRefundSuccessMsg(); | |||
| refundSuccessMsg.setTenantId(tenantId); | |||
| refundSuccessMsg.setMsgType(EnumMsgRecordType.INSIDE_NOTIFY_REFUND_SUCCESS.getCode()); | |||
| refundSuccessMsg.setDelayTimeLevel(3); | |||
| refundSuccessMsg.setPayWay(EnumPayWay.PAY_WAY_WECHAT.getCode()); | |||
| @@ -216,6 +222,7 @@ public class WxPayController extends BaseController { | |||
| String jsonMsg = JSON.toJSONString(paramMap); | |||
| FmInsideNotifyRefundSuccessMsg refundSuccessMsg = new FmInsideNotifyRefundSuccessMsg(); | |||
| refundSuccessMsg.setTenantId(tenantId); | |||
| refundSuccessMsg.setMsgType(EnumMsgRecordType.INSIDE_NOTIFY_REFUND_SUCCESS.getCode()); | |||
| refundSuccessMsg.setDelayTimeLevel(3); | |||
| refundSuccessMsg.setPayWay(EnumPayWay.PAY_WAY_WECHAT.getCode()); | |||
| @@ -262,8 +269,18 @@ public class WxPayController extends BaseController { | |||
| try { | |||
| xml = IOUtils.toString(request.getInputStream(), Charset.forName("UTF-8")); | |||
| paramMap = WxPayment.xmlToMap(xml); | |||
| //发邮件 | |||
| String[] receivers = fmExceptionEmails.split(","); | |||
| StringBuilder sb = new StringBuilder(); | |||
| sb.append(DateUtils.date2String(new Date())); | |||
| sb.append("\n"); | |||
| sb.append("分账回调 WxPayController:"); | |||
| sb.append("\n"); | |||
| sb.append(JSON.toJSONString(paramMap)); | |||
| //发送邮件 | |||
| mailService.sendSimpleMail(receivers, "排查回调位置", sb.toString()); | |||
| logger.info("share wxpay, notify, param: " + xml ); | |||
| response = wxPayOrderService.shareNotify(paramMap, EnumPayWay.PAY_WAY_WECHAT,EnumPayVersion.WX_PAY_V2); | |||
| // response = wxPayOrderService.shareNotify(paramMap, EnumPayWay.PAY_WAY_WECHAT,EnumPayVersion.WX_PAY_V2); | |||
| logger.info("share wxpay, notify success, req : " + xml + ", resp: " + response.toString()); | |||
| return response; | |||
| } catch (BizMessageException e) { | |||
| @@ -23,6 +23,7 @@ public class TenantInfoImpl implements TenantInfo { | |||
| "mall_permission", | |||
| "mall_sale_type", | |||
| "mall_user_role", | |||
| "wx_brand", | |||
| "wx_channel", | |||
| "wx_business", | |||
| "wx_coupon_type", | |||
| @@ -59,6 +60,9 @@ public class TenantInfoImpl implements TenantInfo { | |||
| "fengniao_map_config", | |||
| "wx_c_user", | |||
| "tt_c_user", | |||
| "tt_buser", | |||
| "wx_buser", | |||
| "wx_merchant_b_user", | |||
| "wx_user_visit", | |||
| "tt_goods_category", | |||
| }; | |||
| @@ -67,8 +71,12 @@ public class TenantInfoImpl implements TenantInfo { | |||
| "wx_mall", | |||
| "wx_appinfo", | |||
| "wx_authorizer_info", | |||
| "wx_brand", | |||
| "wx_c_user", | |||
| "tt_c_user", | |||
| "tt_buser", | |||
| "wx_buser", | |||
| "wx_merchant_b_user", | |||
| "wx_user_visit", | |||
| "wx_c_user_basic_info", | |||
| "user_basic_info_address", | |||
| @@ -56,28 +56,6 @@ public class BaseController { | |||
| }); | |||
| } | |||
| public WxAppinfo getAppInfo(String appId) { | |||
| return wxAppinfoService.getByAppId(appId); | |||
| } | |||
| public WxMaService getWeappService(String appId) { | |||
| if(isFmOpen) { | |||
| return openService.getWxOpenComponentService().getWxMaServiceByAppid(appId); | |||
| } else { | |||
| WxAppinfo appinfo = wxAppinfoService.getByAppId(appId); | |||
| WxMaService service = maUtil.getWeappService(appinfo); | |||
| return service; | |||
| } | |||
| } | |||
| public WxMaService getWeappServiceByAppInfo(WxAppinfo appinfo) { | |||
| if(!isFmOpen) { | |||
| WxMaService service = maUtil.getWeappService(appinfo); | |||
| return service; | |||
| } | |||
| return null; | |||
| } | |||
| public String getIpAddr() { | |||
| HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); | |||
| String ipaddress = IPUtil.getIpAddr(request); | |||
| @@ -109,7 +109,7 @@ public class PosServiceImpl implements PosService { | |||
| List<WxMerchantBUser> orgUserList = null; | |||
| try { | |||
| orgUserList = merchantBUserService.getBUserByAppId(userQ); | |||
| orgUserList = merchantBUserService.findList(userQ); | |||
| } catch (Exception e) { | |||
| String errMessage = ErrorCode.MERCHANT_BUSER_NOT_VALID.getMessage() + "phone: " + phone + ", " +e.getMessage(); | |||
| throw new MallinkException(ErrorCode.MERCHANT_BUSER_NOT_VALID.getCode(), errMessage); | |||
| @@ -447,7 +447,8 @@ public class PosServiceImpl implements PosService { | |||
| * @param couponOrderIdStr | |||
| * @return | |||
| */ | |||
| public JSONObject oneCouponVerify(PromotionCalc promotionCalc,TenantEntity tenantinfo, String couponOrderIdStr, Long merchantId, Long buUserId, Long posOrderId) { | |||
| public JSONObject oneCouponVerify(PromotionCalc promotionCalc,TenantEntity tenantinfo, String couponOrderIdStr, Long merchantId, | |||
| Long buUserId,String mallTenantId, Long posOrderId) { | |||
| JSONObject retObj = new JSONObject(); | |||
| Date now = new Date(); | |||
| // 1. 获取券包信息 | |||
| @@ -473,7 +474,7 @@ public class PosServiceImpl implements PosService { | |||
| } | |||
| try { | |||
| doVerify(retObj, EnumPosActionType.VERIFY_INDEPENT, couponOrderCVo, wxCoupon, merchantId, buUserId, posOrderId); | |||
| doVerify(retObj, EnumPosActionType.VERIFY_INDEPENT, couponOrderCVo, wxCoupon, merchantId, buUserId,mallTenantId, posOrderId); | |||
| } catch (MallinkException e) { | |||
| logger.error(e.getMessage()); | |||
| throw new MallinkException(e.getErrorCode(), e.getMessage()); | |||
| @@ -564,7 +565,8 @@ public class PosServiceImpl implements PosService { | |||
| * @param couponSelected | |||
| * @return | |||
| */ | |||
| private JSONObject oneCouponPay(PromotionCalc promotionCalc, WxCouponOrderCVo couponOrderCVo, Long merchantId, Long buUserId, Long posOrderId, boolean couponSelected) { | |||
| private JSONObject oneCouponPay(PromotionCalc promotionCalc, WxCouponOrderCVo couponOrderCVo, Long merchantId, | |||
| Long buUserId, String mallTenantId,Long posOrderId, boolean couponSelected) { | |||
| JSONObject retObj = new JSONObject(); | |||
| Date curDate = new Date(); | |||
| @@ -624,7 +626,7 @@ public class PosServiceImpl implements PosService { | |||
| throw new MallinkException(ErrorCode.COUPON_ORDER_IS_NULL); | |||
| } | |||
| try { | |||
| doVerify(retObj, EnumPosActionType.VERIFY_PAY, couponOrderCVo, wxCoupon, merchantId, buUserId, posOrderId); | |||
| doVerify(retObj, EnumPosActionType.VERIFY_PAY, couponOrderCVo, wxCoupon, merchantId, buUserId,mallTenantId, posOrderId); | |||
| } catch (MallinkException e) { | |||
| logger.error(e.getMessage()); | |||
| throw new MallinkException(e.getErrorCode(), e.getMessage()); | |||
| @@ -883,7 +885,7 @@ public class PosServiceImpl implements PosService { | |||
| String couponOrderIdStr = couponOrderArr.getString(0); | |||
| if (couponOrderIdStr != null) { | |||
| try { | |||
| JSONObject couponPromoMap = oneCouponVerify(promotionCalc,tenantEntity, couponOrderIdStr, merchantId, buUserId, posOrderId); | |||
| JSONObject couponPromoMap = oneCouponVerify(promotionCalc,tenantEntity, couponOrderIdStr, merchantId, buUserId,merchant.getTenantId(), posOrderId); | |||
| couponList.add(couponPromoMap); | |||
| } catch (MallinkException e) { | |||
| throw new MallinkException(e.getErrorCode(), e.getMessage()); | |||
| @@ -967,7 +969,7 @@ public class PosServiceImpl implements PosService { | |||
| WxCouponOrderCVo couponOrderCVo = avaCoList.get(i); | |||
| boolean selCoupon = isSelCoupon(selCoArr, couponOrderCVo.getId()); | |||
| try { | |||
| JSONObject couponObj = oneCouponPay(promotionCalc, couponOrderCVo, merchantId, buUserId, posOrderId, selCoupon); | |||
| JSONObject couponObj = oneCouponPay(promotionCalc, couponOrderCVo, merchantId, buUserId,merchant.getTenantId(), posOrderId, selCoupon); | |||
| couponList.add(couponObj); | |||
| } catch (MallinkException e) { | |||
| throw new MallinkException(e.getErrorCode(), e.getMessage()); | |||
| @@ -1277,7 +1279,7 @@ public class PosServiceImpl implements PosService { | |||
| * @param posOrderId | |||
| */ | |||
| private void doVerify(JSONObject retMap, EnumPosActionType actionType, WxCouponOrderCVo couponOrderCVo, WxCoupon coupon, | |||
| Long merchantId, Long buUserId, Long posOrderId) { | |||
| Long merchantId, Long buUserId,String mallTenantId, Long posOrderId) { | |||
| int num = 0; | |||
| // 1. insert posOrderId | |||
| PosCouponOrderVerify posCouponOrderVerify = new PosCouponOrderVerify(); | |||
| @@ -1307,6 +1309,7 @@ public class PosServiceImpl implements PosService { | |||
| } | |||
| couponOrder.setBUserId(buUserId); | |||
| couponOrder.setBMerchantId(merchantId); | |||
| couponOrder.setBTenantId(mallTenantId); | |||
| couponOrder.setUpdateDate(curDate); | |||
| if (couponOrderCVo.getBUserId() == null) { | |||
| num = couponOrderMapper.updateVerifyCouponOrder(couponOrder); | |||
| @@ -2172,15 +2175,18 @@ public class PosServiceImpl implements PosService { | |||
| } | |||
| // 4. 积分 | |||
| WxMerchant wxMerchant = merchantMapper.selectById(merchantBUser.getMerchantId()); | |||
| if (null == wxMerchant) { | |||
| throw new MallinkException(ErrorCode.COUPON_MERCHANT_NOT_FOUND); | |||
| } | |||
| try { | |||
| WxMerchant wxMerchant = merchantMapper.selectById(merchantBUser.getMerchantId()); | |||
| int credit = posAddCredit(couponOrderCVo, wxCoupon, merchantBUser, wxMerchant); | |||
| scoreCreditCalc.setCredit(scoreCreditCalc.getCredit() + credit); | |||
| } catch (Exception e) { | |||
| logger.error("交易核销积分异常:" + e.getMessage()); | |||
| } | |||
| // 3. 核销后处理 | |||
| couponOrderService.sendInsideCouponVerifyMsg(merchantBUser, couponOrderId, merchantBUser.getMerchantId(),merchantBUser.getMerchantId()); | |||
| couponOrderService.sendInsideCouponVerifyMsg(couponOrderId,merchantBUser,merchantBUser.getMerchantId(),merchantBUser); | |||
| } | |||
| return payOrder; | |||
| } | |||
| @@ -133,8 +133,8 @@ public class CouponOrderExpiringSchedule { | |||
| logger.error("核销异常: " + e.getMessage()); | |||
| } | |||
| if (couponOrder != null && couponOrder.getMerchantId() != null) { | |||
| wxCouponOrderService.sendInsideCouponVerifyMsg(couponOrder, couponOrder.getId(), couponOrder.getMerchantId(),couponOrder.getBMerchantId()); | |||
| if (couponOrder != null) { | |||
| wxCouponOrderService.sendInsideCouponVerifyMsg(couponOrder.getId(),couponOrder, couponOrder.getBMerchantId(), couponOrder); | |||
| } | |||
| }); | |||
| } | |||
| @@ -14,6 +14,8 @@ import org.springframework.stereotype.Component; | |||
| import java.util.Date; | |||
| import java.util.List; | |||
| import java.util.Map; | |||
| import java.util.stream.Collectors; | |||
| @Component | |||
| public class WeChatAccessTokenSchedule { | |||
| @@ -38,10 +40,15 @@ public class WeChatAccessTokenSchedule { | |||
| WxAppinfo appinfoQ = new WxAppinfo(); | |||
| List<WxAppinfo> appList = wxAppinfoMapper.findList(appinfoQ); | |||
| Map<String, List<WxAppinfo>> collect = appList.stream().collect(Collectors.groupingBy(WxAppinfo::getAppId, Collectors.toList())); | |||
| for (WxAppinfo appinfo : appList) { | |||
| resetAccessToken(appinfo); | |||
| for (String appId:collect.keySet()) { | |||
| List<WxAppinfo> wxAppinfoList = collect.get(appId); | |||
| resetAccessToken(wxAppinfoList.get(0)); | |||
| } | |||
| // for (WxAppinfo appinfo : appList) { | |||
| // resetAccessToken(appinfo); | |||
| // } | |||
| } | |||
| logger.info("微信访问AccessToken获取定时任务结束"); | |||
| @@ -52,10 +59,11 @@ public class WeChatAccessTokenSchedule { | |||
| try { | |||
| String accessToken = wxMaService.getAccessToken(true); | |||
| WxAppinfo updateAppInfo = new WxAppinfo(); | |||
| updateAppInfo.setAppId(appinfo.getAppId()); | |||
| updateAppInfo.setAccessToken(accessToken); | |||
| updateAppInfo.setLastTokenTime(new Date()); | |||
| updateAppInfo.setExpiresIn(7200); | |||
| wxAppinfoMapper.updateById(updateAppInfo); | |||
| wxAppinfoMapper.updateAccessToken(updateAppInfo); | |||
| } catch (WxErrorException e) { | |||
| logger.error(e.getMessage()); | |||
| } catch (Exception e) { | |||
| @@ -113,6 +113,8 @@ public enum ErrorCode{ | |||
| MERCHANT_BUSER_NOT_VALID(2016, "商户用户不存在或已被禁用"), | |||
| MERCHANT_HASRENTCONTRACT(2017,"该商户存在计租中合同"), | |||
| MERCHANT_CODE_IS_FOUND(2018, "商户编码已存在"), | |||
| MERCHANT_BRAND_IS_FOUND(2019, "品牌商户已存在"), | |||
| MERCHANT_ADMIN_IS_FOUND(20020, "商管商户已存在"), | |||
| /** | |||
| * 券 | |||
| @@ -323,6 +323,13 @@ public class BaseMyBatisConfiguration { | |||
| wxPressBatchItemSharding.setRule(EnumShardingRule.HASH.getCode()); | |||
| shardingList.add(wxPressBatchItemSharding); | |||
| ShardingSphere wxCouponMallSharding = new ShardingSphere(); | |||
| wxCouponMallSharding.setColumn("tenant_id"); | |||
| wxCouponMallSharding.setTableName("wx_coupon_mall"); | |||
| wxCouponMallSharding.setCount(100); | |||
| wxCouponMallSharding.setRule(EnumShardingRule.HASH.getCode()); | |||
| shardingList.add(wxCouponMallSharding); | |||
| //初始化 | |||
| shardingSpherePlugin.setShardingSpheres(shardingList); | |||
| Properties properties = new Properties(); | |||
| @@ -32,7 +32,7 @@ public class TtCouponChannelPoi extends TenantEntity { | |||
| @io.swagger.annotations.ApiModelProperty(value="描述",name="statusDesc") | |||
| private String statusDesc; | |||
| @io.swagger.annotations.ApiModelProperty(value="状态:0-审核中,1-上架,2-下架,3-审核拒绝 4-审核通过",name="lastStatus") | |||
| @io.swagger.annotations.ApiModelProperty(value="EnumSpuSyncStatus状态:0-审核中,1-上架,2-下架,3-审核拒绝 4-审核通过",name="lastStatus") | |||
| private Integer lastStatus; | |||
| @io.swagger.annotations.ApiModelProperty(value="描述",name="lastStatusDesc") | |||
| @@ -42,6 +42,9 @@ public class WxCoupon extends TenantEntity { | |||
| @TableField(exist = false) | |||
| protected List<Long> notinTypes; | |||
| @TableField(exist = false) | |||
| protected Integer plat; | |||
| @TableField(exist = false) | |||
| protected String channels; | |||
| @@ -203,6 +206,9 @@ public class WxCoupon extends TenantEntity { | |||
| private Long merchantId; | |||
| @TableField(exist = false) | |||
| private String merchantName; | |||
| @TableField(exist = false) | |||
| private String childMerchantParams; | |||
| @TableField(exist = false) | |||
| @io.swagger.annotations.ApiModelProperty(value="投放频道参数,用来过滤",name="targetAd") | |||
| @@ -252,6 +258,9 @@ public class WxCoupon extends TenantEntity { | |||
| @io.swagger.annotations.ApiModelProperty(value="直连收款门店",name="makeMerchantId") | |||
| private Long makeMerchantId; | |||
| @io.swagger.annotations.ApiModelProperty(value="品牌",name="brand") | |||
| private Long brand; | |||
| @io.swagger.annotations.ApiModelProperty(value="第三方商品Id",name="goodsId") | |||
| private String goodsId; | |||
| @@ -363,8 +372,34 @@ public class WxCoupon extends TenantEntity { | |||
| @io.swagger.annotations.ApiModelProperty(value = "审批流参数", name = "flowParams") | |||
| private Map<String, Object> flowParams; | |||
| @TableField(exist = false) | |||
| @io.swagger.annotations.ApiModelProperty(value="spuId",name="spuId")//goodsId | |||
| private String spuId; | |||
| @TableField(exist = false) | |||
| @io.swagger.annotations.ApiModelProperty(value="状态:0-审核中,1-上架,2-下架,3-审核拒绝 4-审核通过",name="poiStatus") | |||
| private Integer poiStatus; | |||
| @TableField(exist = false) | |||
| @io.swagger.annotations.ApiModelProperty(value="描述",name="statusDesc") | |||
| private String statusDesc; | |||
| @TableField(exist = false) | |||
| @io.swagger.annotations.ApiModelProperty(value="状态:0-审核中,1-上架,2-下架,3-审核拒绝 4-审核通过",name="lastStatus") | |||
| private Integer lastStatus; | |||
| @TableField(exist = false) | |||
| @io.swagger.annotations.ApiModelProperty(value="描述",name="lastStatusDesc") | |||
| private String lastStatusDesc; | |||
| @io.swagger.annotations.ApiModelProperty(value = "是否删除1是0否", name = "isDel") | |||
| private Integer isDel; | |||
| @TableField(exist = false) | |||
| private Long[] merchantIds; | |||
| @TableField(exist = false) | |||
| private String[] mallTenantIds; | |||
| public String getSalePriceStr() { | |||
| if(salePrice!=null) { | |||
| @@ -0,0 +1,37 @@ | |||
| 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; | |||
| import lombok.EqualsAndHashCode; | |||
| import java.util.Date; | |||
| import java.util.List; | |||
| @TableName(value = "wx_coupon_mall") | |||
| @Data | |||
| @EqualsAndHashCode(callSuper = true) | |||
| public class WxCouponMall extends TenantEntity { | |||
| private static final long serialVersionUID = -2285755324480617990L; | |||
| protected Long id; | |||
| @io.swagger.annotations.ApiModelProperty(value="",name="productId") | |||
| private Long productId; | |||
| @TableField(exist = false) | |||
| private List<Long> productIds; | |||
| @io.swagger.annotations.ApiModelProperty(value="",name="mallTenantId") | |||
| private String mallTenantId; | |||
| @io.swagger.annotations.ApiModelProperty(value="创建时间",name="createDate") | |||
| private Date createDate; | |||
| @io.swagger.annotations.ApiModelProperty(value="修改时间",name="updateDate") | |||
| private Date updateDate; | |||
| @io.swagger.annotations.ApiModelProperty(value="状态",name="status") | |||
| private Integer status; | |||
| @io.swagger.annotations.ApiModelProperty(value="商场信息",name="mall") | |||
| @TableField(exist = false) | |||
| protected WxMall mall; | |||
| } | |||
| @@ -35,14 +35,16 @@ public class WxCouponOrder extends TenantEntity { | |||
| private Long cUserId; | |||
| @io.swagger.annotations.ApiModelProperty(value = "持有者ID", name = "ownerId") | |||
| private Long ownerId; | |||
| @io.swagger.annotations.ApiModelProperty(value = "操作券B端小程序用户ID", name = "bUserId") | |||
| @io.swagger.annotations.ApiModelProperty(value = "商户用户ID", name = "bUserId") | |||
| private Long bUserId; | |||
| @TableField(exist = false) | |||
| private List<Long> bUserIdList; | |||
| @io.swagger.annotations.ApiModelProperty(value = "操作券B端小程序用户商户ID", name = "bMerchantId") | |||
| @io.swagger.annotations.ApiModelProperty(value = "商户ID", name = "bMerchantId") | |||
| private Long bMerchantId; | |||
| @TableField(exist = false) | |||
| private List<Long> bMerchantIdList; | |||
| @io.swagger.annotations.ApiModelProperty(value = "b端核销商场tenantId", name = "bTenantId") | |||
| private String bTenantId; | |||
| @io.swagger.annotations.ApiModelProperty(value = "操作券A端用户ID", name = "aUserId") | |||
| private Long aUserId; | |||
| @io.swagger.annotations.ApiModelProperty(value = "用户订单ID", name = "orderId") | |||
| @@ -197,5 +199,8 @@ public class WxCouponOrder extends TenantEntity { | |||
| @TableField(exist = false) | |||
| private List<Integer> shippingStatuss; | |||
| @TableField(exist = false) | |||
| private String couponTenantId; | |||
| } | |||
| @@ -39,6 +39,9 @@ public class WxMerchantSubsidy extends TenantEntity { | |||
| @io.swagger.annotations.ApiModelProperty(value="商户ID",name="merchantId") | |||
| private Long merchantId; | |||
| @io.swagger.annotations.ApiModelProperty(value = "b端核销商场tenantId", name = "bTenantId") | |||
| private String bTenantId; | |||
| @io.swagger.annotations.ApiModelProperty(value="券包ID/存储卡ID",name="couponOrderId") | |||
| private Long couponOrderId; | |||
| @@ -81,13 +81,13 @@ public class WxPayAccount extends TenantEntity { | |||
| return notifyUrl + "/pay/v3/"+this.getTenantId(); | |||
| } | |||
| public String getPayNotifyUrl() { | |||
| return notifyUrl + "/pay"; | |||
| return notifyUrl + "/pay/"+this.getTenantId(); | |||
| } | |||
| public String getRefundNotifyV3Url() { | |||
| return notifyUrl + "/refund/v3/"+this.getTenantId(); | |||
| } | |||
| public String getRefundNotifyUrl() { | |||
| return notifyUrl + "/refund"; | |||
| return notifyUrl + "/refund/"+this.getTenantId(); | |||
| } | |||
| public String getSubsidyNotifyV3Url() { | |||
| return notifyUrl + "/subsidyPay/v3/"+this.getTenantId(); | |||
| @@ -18,10 +18,14 @@ public class WxProfitSharingOrder extends TenantEntity { | |||
| @io.swagger.annotations.ApiModelProperty(value="核销商户ID",name="merchantId") | |||
| private Long merchantId; | |||
| @io.swagger.annotations.ApiModelProperty(value="b端核销商场tenantId",name="bTenantId") | |||
| private String bTenantId; | |||
| @io.swagger.annotations.ApiModelProperty(value="支付时收款商户,直连模式必须有",name="payMerchantId") | |||
| private Long payMerchantId; | |||
| @io.swagger.annotations.ApiModelProperty(value="支付时收款商户平台账号,直连模式必须有",name="payMerchantMchId") | |||
| private String payMerchantMchId; | |||
| private String payMerchantMchId; | |||
| @io.swagger.annotations.ApiModelProperty(value="实际到账商户",name="sharingMerchantId") | |||
| private Long sharingMerchantId; | |||
| @io.swagger.annotations.ApiModelProperty(value="支付订单ID",name="wxPayOrderId") | |||
| private Long orderId; | |||
| @io.swagger.annotations.ApiModelProperty(value="支付渠道: (抖音分账用)",name="payVendor") | |||
| @@ -16,7 +16,8 @@ public class WxProfitSharingResult extends TenantEntity { | |||
| @io.swagger.annotations.ApiModelProperty(value="商户ID",name="merchantId") | |||
| private Long merchantId; | |||
| @io.swagger.annotations.ApiModelProperty(value="b端核销商场tenantId",name="bTenantId") | |||
| private String bTenantId; | |||
| @io.swagger.annotations.ApiModelProperty(value="分账订单号",name="sharingOrderId") | |||
| private Long sharingOrderId; | |||
| @io.swagger.annotations.ApiModelProperty(value="分账接收方id",name="sharingReceiverId") | |||
| @@ -4,6 +4,9 @@ import com.baomidou.mybatisplus.annotation.TableField; | |||
| import com.fasterxml.jackson.annotation.JsonIgnore; | |||
| import com.fasterxml.jackson.annotation.JsonProperty; | |||
| import lombok.EqualsAndHashCode; | |||
| import java.util.List; | |||
| import org.apache.commons.lang3.StringUtils; | |||
| /** | |||
| @@ -23,10 +26,18 @@ public class TenantEntity extends BaseEntity { | |||
| @io.swagger.annotations.ApiModelProperty(value="父租户ID",name="parentTenantId") | |||
| @TableField(exist = false) | |||
| protected String finalTenantId; | |||
| @JsonIgnore | |||
| @TableField(exist = false) | |||
| protected String shardTableSuffix; | |||
| @io.swagger.annotations.ApiModelProperty(value="租户编号列表,查询使用",name="tenantIdList") | |||
| @TableField(exist = false) | |||
| protected List<String> tenantIdList; | |||
| @io.swagger.annotations.ApiModelProperty(value="父租户编号列表,查询使用",name="parentTenantIdList") | |||
| @TableField(exist = false) | |||
| protected List<String> parentTenantIdList; | |||
| public void updateTenantInfo(TenantEntity info) { | |||
| tenantId = info.getTenantId(); | |||
| @@ -82,4 +93,21 @@ public class TenantEntity extends BaseEntity { | |||
| public void setFinalTenantId(String finalTenantId) { | |||
| this.finalTenantId = finalTenantId; | |||
| } | |||
| public List<String> getTenantIdList() { | |||
| return tenantIdList; | |||
| } | |||
| public void setTenantIdList(List<String> tenantIdList) { | |||
| this.tenantIdList = tenantIdList; | |||
| } | |||
| public List<String> getParentTenantIdList() { | |||
| return parentTenantIdList; | |||
| } | |||
| public void setParentTenantIdList(List<String> parentTenantIdList) { | |||
| this.parentTenantIdList = parentTenantIdList; | |||
| } | |||
| } | |||
| @@ -32,6 +32,10 @@ public class BaseMsg extends BaseEntity { | |||
| @io.swagger.annotations.ApiModelProperty(value="父租户id",name="parentTenantId") | |||
| private String parentTenantId; | |||
| @TableField(exist = false) | |||
| @io.swagger.annotations.ApiModelProperty(value = "商场tenant", name = "mallTenantEntity") | |||
| private TenantEntity mallTenantEntity; | |||
| @io.swagger.annotations.ApiModelProperty(value="唯一标识",name="uuid") | |||
| @TableField(exist = false) | |||
| private String uuid; | |||
| @@ -12,7 +12,7 @@ public class FmInsideCouponVerifyMsg extends BaseMsg{ | |||
| @io.swagger.annotations.ApiModelProperty(value = "券包ID", name = "couponOrderId") | |||
| private Long couponOrderId; | |||
| @io.swagger.annotations.ApiModelProperty(value = "分账商户", name = "merchantId") | |||
| @io.swagger.annotations.ApiModelProperty(value = "商户", name = "merchantId") | |||
| private Long merchantId; | |||
| @io.swagger.annotations.ApiModelProperty(value = "核销商户", name = "bmerchantId") | |||
| private Long bmerchantId; | |||
| @@ -1,5 +1,7 @@ | |||
| package com.iformall.domain.po.msg; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import lombok.Data; | |||
| import lombok.EqualsAndHashCode; | |||
| import lombok.ToString; | |||
| @@ -117,6 +117,9 @@ public class WxCouponOrderBVo extends WxCouponOrder { | |||
| @io.swagger.annotations.ApiModelProperty(value="1:A端发卷,2:B端发卷",name="sourceType") | |||
| private Integer sourceType; | |||
| @io.swagger.annotations.ApiModelProperty(value = "b端核销商场tenantId", name = "bTenantId") | |||
| private String bTenantId; | |||
| public String getbUserName() { | |||
| return bUserName; | |||
| @@ -232,7 +235,7 @@ public class WxCouponOrderBVo extends WxCouponOrder { | |||
| @TableField(exist = false) | |||
| private Date verifyEndDate; | |||
| @Excel(name = "类型", width = 50, orderNum = "16", replace = {"满减券_1", "代金券_2", "团购券_3", "礼品券_4", "停车券_5", "通用券_6", "砍价券_8", "团购券_9", "预购商品_10", "可配送商品_11", "券礼包_12", "积分券_50", "积分停车券_51", "消费卡_100"}) | |||
| @Excel(name = "类型", width = 50, orderNum = "16", replace = {"满减券_1", "代金券_2", "团购券_3", "礼品券_4", "停车券_5", "通用券_6", "砍价券_8", "团购券_9", "预购商品_10", "可配送商品_11", "券礼包_12", "积分券_50", "积分停车券_51","抖音券_66","抖音平台券_67","抖音品牌券_68", "消费卡_100"}) | |||
| @TableField(exist = false) | |||
| private Integer couponType; | |||
| @@ -47,7 +47,9 @@ public class WxCreditHistoryVo extends BaseTenantEntity { | |||
| @io.swagger.annotations.ApiModelProperty(value = "操作人类型", name = "operator") | |||
| private Integer operatorType; | |||
| @Excel(name = "操作说明", width = 20, orderNum = "9", replace = {"每日登录_1", "消费_2", "绑车牌_3", "连接WIFI_4", "微信用户昵称授权_5", "微信用户手机授权_6", "完善个人信息_7", "会员导入_8", "会员成长值扣减_9", "新增积分_10", "积分兑换_11", "消费积分_12", "活动报名_13", "积分清零计划_14", "游戏消耗积分_15", "游戏奖励积分_16"}) | |||
| @Excel(name = "操作说明", width = 20, orderNum = "9", replace = {"每日登录_1", "消费_2", "绑车牌_3", "连接WIFI_4", "微信用户昵称授权_5", "微信用户手机授权_6", "完善个人信息_7", "会员导入_8", "会员成长值扣减_9", "新增积分_10", "积分兑换_11", "消费积分_12", "活动报名_13", | |||
| "积分清零计划_14", "游戏消耗积分_15", "游戏奖励积分_16", "每日签到_17", "连续签到7天_18", "连续签到14天_19", "连续签到28天_20" | |||
| , "问卷奖励积分_21", "消费退款_22", "积分兑换退款_23", "其他积分变动_24"}) | |||
| @io.swagger.annotations.ApiModelProperty(value = "积分类型", name = "creditType") | |||
| private Integer creditType; | |||
| @@ -77,6 +77,8 @@ public class WxOrderCouponVo extends TenantEntity { | |||
| @io.swagger.annotations.ApiModelProperty(value = "操作券B端小程序用户商户ID", name = "bMerchantId") | |||
| private Long bMerchantId; | |||
| @io.swagger.annotations.ApiModelProperty(value = "商场tenant", name = "bTenantId") | |||
| private String bTenantId; | |||
| /** 券类型信息 */ | |||
| @io.swagger.annotations.ApiModelProperty(value="券类型(1.满减券,2.代金券,3.团购券,4.礼品券,5.停车券,6.多商户券,8.砍价券,9.团购券,100.消费卡)",name="type") | |||
| @@ -273,6 +275,7 @@ public class WxOrderCouponVo extends TenantEntity { | |||
| this.setCouponOrderId(couponOrder.getId()); | |||
| this.setCouponOrderStatus(couponOrder.getCouponOrderStatus()); | |||
| this.setBMerchantId(couponOrder.getBMerchantId()); | |||
| this.setBTenantId(couponOrder.getBTenantId()); | |||
| this.setShippingStatus(couponOrder.getShippingStatus()); | |||
| this.setDeliveryInfo(couponOrder.getDeliveryInfo()); | |||
| this.setCreateDate(couponOrder.getCreateDate()); | |||
| @@ -45,6 +45,9 @@ public class WxProfitSharingOrderQueryVo extends TenantEntity { | |||
| @TableField(exist = false) | |||
| private Integer limit; | |||
| @TableField(exist = false) | |||
| private String bTenantId; | |||
| } | |||
| @@ -17,18 +17,34 @@ public class WxProfitSharingOrderVo extends TenantEntity { | |||
| private Long id; | |||
| private String bTenantId; | |||
| private Long payMerchantId; | |||
| private String payMerchantMchId; | |||
| private Long merchantId; | |||
| private String mchId; | |||
| @Excel(name="商户名称",width = 20,orderNum = "2") | |||
| private String merchantName; | |||
| private Long sharingMerchantId; | |||
| @Excel(name="商户单号",width = 20,orderNum = "1") | |||
| private Long orderId; | |||
| @Excel(name="交易金额(分)",width = 20,orderNum = "3") | |||
| @Excel(name="商户名称",width = 20,orderNum = "2") | |||
| private String merchantName; | |||
| private String payMerchantName; | |||
| @Excel(name="到账商户",width = 20,orderNum = "3") | |||
| private String sharingMerchantName; | |||
| public String getSharingMerchantName(){ | |||
| if(this.sharingMerchantId != null && this.sharingMerchantId.equals(this.merchantId)){ | |||
| this.sharingMerchantName = this.merchantName; | |||
| }else if(this.sharingMerchantId != null && this.sharingMerchantId.equals(this.payMerchantId)){ | |||
| this.sharingMerchantName = this.payMerchantName; | |||
| } | |||
| return sharingMerchantName; | |||
| } | |||
| @Excel(name="交易金额(分)",width = 20,orderNum = "4") | |||
| private Integer payAmount; | |||
| @io.swagger.annotations.ApiModelProperty(value="订单ID",name="singleOrderId") | |||
| @@ -36,23 +52,23 @@ public class WxProfitSharingOrderVo extends TenantEntity { | |||
| @io.swagger.annotations.ApiModelProperty(value="单个订单分账总金额(分)",name="singleOrderAmount") | |||
| private Integer singleOrderAmount; | |||
| @Excel(name="交易结束时间",exportFormat = "yyyy-MM-dd HH:mm:ss",width = 20,orderNum = "5") | |||
| // @Excel(name="交易结束时间",exportFormat = "yyyy-MM-dd HH:mm:ss",width = 20,orderNum = "5") | |||
| private Date payTimeEnd; | |||
| @Excel(name="交易开始时间",exportFormat = "yyyy-MM-dd HH:mm:ss",width = 20,orderNum = "4") | |||
| @Excel(name="核销时间",exportFormat = "yyyy-MM-dd HH:mm:ss",width = 20,orderNum = "6") | |||
| private Date payTimeStart; | |||
| private String transactionId; | |||
| private String sharingOrderNo; | |||
| @Excel(name="分账类型",width = 20,replace = { "单次分账_0", "多次分账_1", "完结分账(多次)_2", "完结分账(单次)_3"},orderNum = "6") | |||
| @Excel(name="分账类型",width = 20,replace = { "单次分账_0", "多次分账_1", "完结分账(多次)_2", "完结分账(单次)_3"},orderNum = "7") | |||
| private Integer type; | |||
| private String pointDeduction; | |||
| private String receivers; | |||
| private String errorMsg; | |||
| @Excel(name="分账状态",width = 20,replace = { "未知_0", "提交订单失败_1", "提交业务失败_2", "受理成功_3", "处理中_4", "处理完成_5", "处理失败_6"},orderNum = "7") | |||
| @Excel(name="分账状态",width = 20,replace = { "未知_0", "提交订单失败_1", "提交业务失败_2", "受理成功_3", "处理中_4", "处理完成_5", "处理失败_6"},orderNum = "8") | |||
| private Integer sharingStatus; | |||
| private Date updateTime; | |||
| private Date createTime; | |||
| @@ -97,7 +97,7 @@ public class TtPayUnifiedOrderV2Request implements Serializable { | |||
| * 开发者自定义透传字段,不支持二进制,长度 <= 2048 byte | |||
| */ | |||
| @SerializedName(value = "cp_extra") | |||
| private PageEntry cpExtra; | |||
| private String cpExtra; | |||
| /** | |||
| * 否 | |||
| @@ -204,6 +204,16 @@ public class TtPayUnifiedOrderV2Request implements Serializable { | |||
| @SerializedName(value = "discount_amount") | |||
| private Integer discountAmount; | |||
| /** | |||
| * 否 | |||
| * 折扣金额,单位(分) | |||
| */ | |||
| @SerializedName(value = "merchant_uid") | |||
| private String merchantUid; | |||
| } | |||
| @@ -1,10 +1,27 @@ | |||
| package com.iformall.enums; | |||
| import com.iformall.common.ErrorCode; | |||
| import com.iformall.exception.MallinkException; | |||
| import java.util.ArrayList; | |||
| import java.util.List; | |||
| /** | |||
| * Created by Stormeye on 2018/08/09. | |||
| */ | |||
| public enum EnumCouponChannelType { | |||
| /** | |||
| * //投放到抖音渠道。 | |||
| * //初次投放,只为展示审核,不让购买。 | |||
| * //当券投放到其他渠道时,此渠道自动上架,才可购买。 | |||
| * //其他所有渠道下架后,该渠道自动下架。 | |||
| * | |||
| * //该渠道不做任何查询 | |||
| */ | |||
| COUPON_CHANNEL_ID_DOUYIN(0,"抖音"), | |||
| COUPON_CHANNEL_ID_LIST(1, "列表"), | |||
| COUPON_CHANNEL_ID_TIMED(2, "限时抢购"), | |||
| COUPON_CHANNEL_ID_CAMPAIN(3, "幻灯片"), // banner图, 宣传页,轮播图,走马灯 | |||
| @@ -38,6 +55,41 @@ public enum EnumCouponChannelType { | |||
| this.message = message; | |||
| } | |||
| /** | |||
| * 微信平台的渠道 | |||
| */ | |||
| public static List<Integer> getWeiXinType(){ | |||
| List<Integer> typeList = new ArrayList<>(); | |||
| typeList.add(COUPON_CHANNEL_ID_LIST.getCode()); | |||
| typeList.add(COUPON_CHANNEL_ID_TIMED.getCode()); | |||
| typeList.add(COUPON_CHANNEL_ID_GAME.getCode()); | |||
| typeList.add(COUPON_CHANNEL_ID_CARD.getCode()); | |||
| typeList.add(COUPON_CHANNEL_ID_PRESS.getCode()); | |||
| typeList.add(COUPON_CHANNEL_ID_ORDER_GROUP.getCode()); | |||
| typeList.add(COUPON_CHANNEL_ID_CREDIT.getCode()); | |||
| typeList.add(COUPON_CHANNEL_ID_H5.getCode()); | |||
| typeList.add(COUPON_CHANNEL_ID_WXLIVE_LIST.getCode()); | |||
| return typeList; | |||
| } | |||
| /** | |||
| * 抖音平台的渠道 | |||
| */ | |||
| public static List<Integer> getDouYinType(){ | |||
| List<Integer> typeList = new ArrayList<>(); | |||
| typeList.add(COUPON_CHANNEL_ID_DOUYIN_LIST.getCode()); | |||
| return typeList; | |||
| } | |||
| public static EnumAppPlat getAppPlat(Integer code) { | |||
| if(getWeiXinType().contains(code)){ | |||
| return EnumAppPlat.WX; | |||
| }else if(getDouYinType().contains(code)){ | |||
| return EnumAppPlat.TOUTIAO; | |||
| } | |||
| throw new MallinkException(ErrorCode.SYS_PARAMETER_ERROR.getCode(), "券类型错误,未找到对应平台"); | |||
| } | |||
| public Integer getCode() { | |||
| return code; | |||
| } | |||
| @@ -45,4 +97,57 @@ public enum EnumCouponChannelType { | |||
| public String getMessage() { | |||
| return message; | |||
| } | |||
| //根据渠道筛选券类型 | |||
| public static List<Integer> getCouponTypeBy(Integer code){ | |||
| List<Integer> codes = new ArrayList<>(); | |||
| if(COUPON_CHANNEL_ID_LIST.getCode().equals(code)){ | |||
| //微信 列表 渠道 | |||
| //满减,代金,礼品,停车,通用,预购商品,可配送商品,券礼包 | |||
| codes.add(EnumCouponType.COUPON_MANJIAN.getCode()); | |||
| codes.add(EnumCouponType.COUPON_DAIJIN.getCode()); | |||
| codes.add(EnumCouponType.COUPON_LIPIN.getCode()); | |||
| codes.add(EnumCouponType.COUPON_TINGCHE.getCode()); | |||
| codes.add(EnumCouponType.COUPON_MULTIMCH.getCode()); | |||
| codes.add(EnumCouponType.COUPON_PREORDER.getCode()); | |||
| codes.add(EnumCouponType.COUPON_DISTRIBUTION.getCode()); | |||
| codes.add(EnumCouponType.COUPON_GIFT.getCode()); | |||
| }else if(COUPON_CHANNEL_ID_TIMED.getCode().equals(code) | |||
| || COUPON_CHANNEL_ID_GAME.getCode().equals(code)){ | |||
| //微信 限时抢购,游戏 渠道 | |||
| //可用 满减,代金,礼品,停车,通用 | |||
| codes.add(EnumCouponType.COUPON_MANJIAN.getCode()); | |||
| codes.add(EnumCouponType.COUPON_DAIJIN.getCode()); | |||
| codes.add(EnumCouponType.COUPON_LIPIN.getCode()); | |||
| codes.add(EnumCouponType.COUPON_TINGCHE.getCode()); | |||
| codes.add(EnumCouponType.COUPON_MULTIMCH.getCode()); | |||
| }else if(COUPON_CHANNEL_ID_CARD.getCode().equals(code)){ | |||
| //微信 卡频道 | |||
| //可用 消费卡 | |||
| codes.add(EnumCouponType.CARD_MULTIMCH.getCode()); | |||
| }else if(COUPON_CHANNEL_ID_PRESS.getCode().equals(code)){ | |||
| //微信 砍价频道 | |||
| //可用 砍价券 | |||
| codes.add(EnumCouponType.COUPON_PRESS.getCode()); | |||
| }else if(COUPON_CHANNEL_ID_ORDER_GROUP.getCode().equals(code)){ | |||
| //微信 拼团频道 | |||
| //可用 拼团券 | |||
| codes.add(EnumCouponType.COUPON_GROUP.getCode()); | |||
| }else if(COUPON_CHANNEL_ID_CAMPAIN.getCode().equals(code) | |||
| || COUPON_CHANNEL_ID_TOPIC.getCode().equals(code)){ | |||
| //宣传页 专题 (不分平台)查所有券 | |||
| //平台从其他地方区分 | |||
| codes.addAll(EnumCouponType.getAllCodes()); | |||
| }else if(COUPON_CHANNEL_ID_CREDIT.getCode().equals(code)){ | |||
| //微信 积分商城 | |||
| codes.add(EnumCouponType.COUPON_CREDIT.getCode()); | |||
| codes.add(EnumCouponType.COUPON_CREDIT_PARK.getCode()); | |||
| }else if(COUPON_CHANNEL_ID_DOUYIN_LIST.getCode().equals(code)){ | |||
| //抖音 列表 | |||
| codes.add(EnumCouponType.COUPON_DOUYIN.getCode()); | |||
| codes.add(EnumCouponType.COUPON_DOUYIN_PLAT.getCode()); | |||
| codes.add(EnumCouponType.COUPON_DOUYIN_BRAND.getCode()); | |||
| } | |||
| return codes; | |||
| } | |||
| } | |||
| @@ -0,0 +1,36 @@ | |||
| package com.iformall.enums; | |||
| /** | |||
| * Created by Stormeye on 2018/08/09. | |||
| */ | |||
| public enum EnumCouponMallStatus { | |||
| UNFINISED(0, "未设置完成"), | |||
| FINISED(1, "已设置完成") | |||
| ; | |||
| public static EnumCouponMallStatus getEnum(Integer code) { | |||
| for (EnumCouponMallStatus value : values()) { | |||
| if (value.getCode().equals(code)) { | |||
| return value; | |||
| } | |||
| } | |||
| return null; | |||
| } | |||
| private Integer code; | |||
| private String message; | |||
| EnumCouponMallStatus(Integer code, String message) { | |||
| this.code = code; | |||
| this.message = message; | |||
| } | |||
| public Integer getCode() { | |||
| return code; | |||
| } | |||
| public String getMessage() { | |||
| return message; | |||
| } | |||
| } | |||
| @@ -29,6 +29,9 @@ public enum EnumCouponType { | |||
| COUPON_CREDIT_PARK(51,"积分停车券"), | |||
| // COUPON_CREDIT_DOUYIN(55,"抖音积分券"), | |||
| COUPON_DOUYIN_PLAT(67, "抖音集团平台券"), | |||
| COUPON_DOUYIN_BRAND(68, "抖音集团品牌券"), | |||
| CARD_MULTIMCH(100, "消费卡"), | |||
| ; | |||
| @@ -40,6 +43,14 @@ public enum EnumCouponType { | |||
| } | |||
| return null; | |||
| } | |||
| public static List<Integer> getAllCodes(){ | |||
| List<Integer> codes = new ArrayList<>(); | |||
| for (EnumCouponType value : values()) { | |||
| codes.add(value.getCode()); | |||
| } | |||
| return codes; | |||
| } | |||
| public static boolean mustHasMerchant(Integer code) { | |||
| if (null == code) { | |||
| @@ -75,6 +86,8 @@ public enum EnumCouponType { | |||
| List<Integer> typeList = new ArrayList<>(); | |||
| typeList.add(COUPON_DOUYIN.getCode()); | |||
| // typeList.add(COUPON_CREDIT_DOUYIN.getCode()); | |||
| typeList.add(COUPON_DOUYIN_PLAT.getCode()); | |||
| typeList.add(COUPON_DOUYIN_BRAND.getCode()); | |||
| return typeList; | |||
| } | |||
| @@ -101,7 +114,7 @@ public enum EnumCouponType { | |||
| } | |||
| /** | |||
| * 有价 并且永不分账的券类型 | |||
| * 微信 有价 并且永不分账的券类型 | |||
| */ | |||
| public static List<Integer> getPlatType(){ | |||
| List<Integer> typeList = new ArrayList<>(); | |||
| @@ -119,4 +132,42 @@ public enum EnumCouponType { | |||
| throw new MallinkException(ErrorCode.SYS_PARAMETER_ERROR.getCode(), "券类型错误,未找到对应平台"); | |||
| } | |||
| public static List<Integer> getTypeCode(Integer plat){ | |||
| if(EnumAppPlat.WX.getCode().equals(plat)){ | |||
| return getWeiXinType(); | |||
| }else if(EnumAppPlat.TOUTIAO.getCode().equals(plat)){ | |||
| return getDouYinType(); | |||
| } | |||
| throw new MallinkException(ErrorCode.SYS_PARAMETER_ERROR.getCode(), "券平台错误,未找到对应类型"); | |||
| } | |||
| //是不是必须要有商户 | |||
| public static boolean checkCreateWithMerchants(Integer type) { | |||
| if(type == null) { | |||
| return true; | |||
| } | |||
| if(type == COUPON_DOUYIN_PLAT.getCode()) { | |||
| return false; | |||
| } | |||
| return true; | |||
| } | |||
| //是不是必须要有商场 | |||
| public static boolean checkCreateWithMalls(Integer type) { | |||
| if(type == null) { | |||
| return false; | |||
| } | |||
| if(type == COUPON_DOUYIN_PLAT.getCode() || type == COUPON_DOUYIN_BRAND.getCode()) { | |||
| return true; | |||
| } | |||
| return false; | |||
| } | |||
| public static boolean isParentCoupon(Integer couponType) { | |||
| if (couponType == COUPON_DOUYIN_PLAT.getCode() || couponType == COUPON_DOUYIN_BRAND.getCode()) { | |||
| return true; | |||
| } | |||
| return false; | |||
| } | |||
| } | |||
| @@ -7,7 +7,7 @@ public enum EnumCouponVerifyType { | |||
| // 0: 微信B端核销 1:POS独立核销 2:POS交易核销 | |||
| VERIFY_B(0,"B端核销"), | |||
| //verifyRemark | |||
| //verifyRemark 记录使用 | |||
| VERIFY_B_10(10,"B端收银核销"), | |||
| VERIFY_B_11(11,"B端券码核销"), | |||
| VERIFY_B_12(12,"B端扫码核销"), | |||
| @@ -12,7 +12,7 @@ public enum EnumMerchantSubsidySource { | |||
| GROUP(4, "拼团核销"), | |||
| CASHIER(5, "收银台"), | |||
| DISTRIBUTION_GOODS(6, "可配送商品"), | |||
| GIFT_BAG(7, "券订单"),; | |||
| GIFT_BAG(7, "券礼包"),; | |||
| public static EnumMerchantSubsidySource getEnum(Integer code) { | |||
| for (EnumMerchantSubsidySource value : values()) { | |||
| @@ -5,7 +5,7 @@ package com.iformall.enums; | |||
| */ | |||
| public enum EnumMerchantSubsidyType { | |||
| MANUAL(1, "自主结算"), | |||
| MANUAL(1, "自主结算"),//补贴 | |||
| WECHAT(2, "微信结算"), | |||
| DOUYIN(3, "抖音结算"),; | |||
| @@ -12,7 +12,8 @@ public enum EnumSaleType { | |||
| WX_ENJOY(3,"速享版"), | |||
| WX_ENJOY_TRY(4, "速享试用版"), | |||
| TT_ALL_ROUND(11, "抖音尊享版"), | |||
| GROUP(100, "集团版"), | |||
| GROUP(100, "集团版(旧版,每个商场一个小程序)"), | |||
| GROUP_v1(101, "集团版(同一个小程序)"), | |||
| WX_JM_ALL_ROUND(1035001036,"金茂全能版"), | |||
| ; | |||
| @@ -38,4 +38,15 @@ public enum EnumSpuSyncStatus { | |||
| public String getMessage() { | |||
| return message; | |||
| } | |||
| public static boolean isValid(Integer code) { | |||
| if (code == sync_auditing.getCode()) { | |||
| return true; | |||
| }else if (code == sync_put_on.getCode()) { | |||
| return true; | |||
| }else if (code == sync_audit_pass.getCode()) { | |||
| return true; | |||
| } | |||
| return false; | |||
| } | |||
| } | |||
| @@ -18,5 +18,4 @@ public interface TtCouponChannelPoiMapper extends CommonMapper<TtCouponChannelPo | |||
| TtCouponChannelPoi selectById(@Param("tenantId")String tenantId,@Param("id")Long id); | |||
| TtCouponChannelPoi selectByChannelId(@Param("tenantId")String tenantId,@Param("couponChannelId")Long couponChannelId); | |||
| } | |||
| @@ -7,10 +7,10 @@ import com.iformall.domain.po.WxAppinfo; | |||
| public interface WxAppinfoMapper extends CommonMapper<WxAppinfo, Long> { | |||
| List<WxAppinfo> findList(WxAppinfo wxAppinfo); | |||
| WxAppinfo findByAppId(String appId); | |||
| WxAppinfo findByAppId(String appId,String tenantId); | |||
| int updateAccessToken(WxAppinfo updateApp); | |||
| } | |||
| @@ -24,7 +24,7 @@ public interface WxCouponChannelMapper extends CommonMapper<WxCouponChannel, Str | |||
| WxCouponChannel findVoStatusDetail(@Param("id")Long id,@Param("tenantId")String tenantId); | |||
| void updateStatusByCouponId(WxCouponChannel wxCouponChannel); | |||
| int updateStatusByCouponId(WxCouponChannel wxCouponChannel); | |||
| int updateEndTimeByCouponId(WxCouponChannel wxCouponChannel); | |||
| @@ -70,4 +70,8 @@ public interface WxCouponChannelMapper extends CommonMapper<WxCouponChannel, Str | |||
| List<TtCouponChannelVo> ttChannelList(TtCouponChannelVo ttChannelVo); | |||
| Long findCouponIdById(@Param("id")Long id,@Param("tenantId")String tenantId); | |||
| int updateStatusByTargetAd(WxCouponChannel updCC); | |||
| int selectCountExclude(WxCouponChannel ccQ); | |||
| } | |||
| @@ -0,0 +1,19 @@ | |||
| package com.iformall.mapper; | |||
| import com.iformall.common.CommonMapper; | |||
| import com.iformall.domain.po.WxCouponMall; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import java.util.List; | |||
| import java.util.Map; | |||
| import org.apache.ibatis.annotations.Param; | |||
| public interface WxCouponMallMapper extends CommonMapper<WxCouponMall, Long> { | |||
| List<WxCouponMall> findList(WxCouponMall wxCouponMall); | |||
| List<Long> findCouponIdList(WxCouponMall wxCouponMall); | |||
| void updateStatus(WxCouponMall wxCouponMall); | |||
| void delteAllByProductId(WxCouponMall wxCouponMall); | |||
| } | |||
| @@ -125,4 +125,6 @@ public interface WxCouponMapper extends CommonMapper<WxCoupon, Long> { | |||
| List<TtCouponVo> ttCouponList(TtCouponVo ttCouponVo); | |||
| Integer findCategoryIdById(@Param("id")Long id,@Param("tenantId")String tenantId); | |||
| void setMakeMerchantId(WxCoupon couponQ); | |||
| } | |||
| @@ -30,6 +30,8 @@ public interface WxMerchantMapper extends CommonMapper<WxMerchant, Long> { | |||
| int hasMerchant(WxMerchant wxMerchant); | |||
| int hasMerchantEncode(WxMerchant wxMerchant); | |||
| int hasMerchantBrand(WxMerchant wxMerchant); | |||
| int hasMerchantIsAdmin(WxMerchant wxMerchant); | |||
| void updateCreditLocked(WxMerchant wxMerchant); | |||
| @@ -56,4 +58,5 @@ public interface WxMerchantMapper extends CommonMapper<WxMerchant, Long> { | |||
| Map<String,Object> findShopMerchant(@Param("id")Long id); | |||
| int deleteByUpdate(Long id); | |||
| } | |||
| @@ -14,6 +14,7 @@ public class WxMicroPayOrderP { | |||
| private String nonce_str; // 随机字符串 | |||
| private String sign; // 签名 | |||
| private String body; // 商品简单描述 128 | |||
| private String attach; // 附加数据 | |||
| private String out_trade_no; // 商户订单号 | |||
| private Integer total_fee; // 支付金额 | |||
| private String spbill_create_ip; // 支付IP | |||
| @@ -17,6 +17,7 @@ public class WxMicroPayOrderSP { | |||
| private String sign; // 签名 | |||
| private String sign_type; // 签名类型 | |||
| private String body; // 商品简单描述 128 | |||
| private String attach; // 附加数据 | |||
| private String out_trade_no; // 商户订单号 | |||
| private Integer total_fee; // 支付金额 | |||
| private String spbill_create_ip; // 支付IP | |||
| @@ -13,6 +13,7 @@ public class WxPayOrderP { | |||
| private String nonce_str; // 随机字符串 | |||
| private String sign; // 签名 | |||
| private String body; // 商品简单描述 128 | |||
| private String attach; // 附加数据 | |||
| private String out_trade_no; // 商户订单号 | |||
| private Integer total_fee; // 支付金额 | |||
| private String spbill_create_ip; // 支付IP | |||
| @@ -16,6 +16,7 @@ public class WxPayOrderSP { | |||
| private String sign; // 签名 | |||
| private String sign_type; // 签名类型 | |||
| private String body; // 商品简单描述 128 | |||
| private String attach; // 附加数据 | |||
| private String out_trade_no; // 商户订单号 | |||
| private String total_fee; // 支付金额 | |||
| private String spbill_create_ip; // 支付IP | |||
| @@ -14,9 +14,9 @@ import java.util.List; | |||
| public interface TtCouponGoodsService { | |||
| ResultData couponList(TtCouponVo ttCouponVo, Integer pageNum, Integer pageSize); | |||
| ResultData channelList(TtCouponChannelVo ttChannelVo, Integer pageNum, Integer pageSize); | |||
| // ResultData couponList(TtCouponVo ttCouponVo, Integer pageNum, Integer pageSize); | |||
| // | |||
| // ResultData channelList(TtCouponChannelVo ttChannelVo, Integer pageNum, Integer pageSize); | |||
| ResultData productSave(WxCoupon coupon) throws Exception; | |||
| @@ -52,12 +52,13 @@ public interface WxAppinfoService { | |||
| WxAppinfo getById(Long id); | |||
| /** | |||
| * 根据appId获得实体 | |||
| * 多个存在获取集团的。 | |||
| * | |||
| * @param appId | |||
| * @return | |||
| */ | |||
| WxAppinfo getByAppId(String appId); | |||
| WxAppinfo getOnlyByAppId(String appId); | |||
| WxAppinfo getByAppId(String appId,String tenantId); | |||
| /** | |||
| * 获取c端小程序信息 | |||
| @@ -83,7 +84,8 @@ public interface WxAppinfoService { | |||
| */ | |||
| void deleteById(Long id); | |||
| WxAppinfo getByAppIdFromRedis(String appId); | |||
| WxAppinfo getOnlyByAppIdFromRedis(String appId); | |||
| WxAppinfo getByAppIdFromRedis(String appId,String tenantId); | |||
| WxAppinfo getByIdFromRedis(Long id); | |||
| WxAppinfo getCAppInfoFromRedis(String tenantId, EnumAppPlat appPlat); | |||
| @@ -49,6 +49,6 @@ public interface WxCashOutService { | |||
| */ | |||
| ResultData reCashout(WxMerchantBUser buser,WxCashOut record,EnumPayWay payWay); | |||
| void addCashOut(Long merchantId,Integer amount) throws MallinkException; | |||
| void addCashOut(WxMerchant merchant,Integer amount) throws MallinkException; | |||
| } | |||
| @@ -0,0 +1,31 @@ | |||
| package com.iformall.service; | |||
| import java.util.*; | |||
| import javax.servlet.http.HttpServletRequest; | |||
| import javax.servlet.http.HttpServletResponse; | |||
| import com.github.pagehelper.PageInfo; | |||
| 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.WxCouponMall; | |||
| 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; | |||
| import com.iformall.domain.vo.WxCouponStatisVo; | |||
| import com.iformall.domain.vo.WxMerchantVo; | |||
| public interface WxCouponMallService { | |||
| PageInfo<WxCouponMall> listAsPage(WxCouponMall record, Integer pageIndex, Integer pageSize); | |||
| List<WxCouponMall> list(WxCouponMall wxCouponMall,boolean queryMall); | |||
| List<Long> listCouponIds(WxCouponMall wxCouponMall); | |||
| void finised(String couponTenantId,Long couponId,String mallTenantId); | |||
| void unfinised(String couponTenantId, Long couponId,Integer couponType, String mallTenantId) throws Exception; | |||
| } | |||
| @@ -66,16 +66,15 @@ public interface WxCouponOrderService { | |||
| /** | |||
| * 核销后发送消息 | |||
| */ | |||
| void sendInsideCouponVerifyMsg(TenantEntity tenantEntity, Long couponOrderId, Long merchantId, Long bmerchantId); | |||
| void sendInsideCouponVerifyMsg(Long couponOrderId, TenantEntity couponOrderTenantEntity, Long merchantId, TenantEntity mallTenantEntity); | |||
| /** | |||
| * 核销后处理 | |||
| * | |||
| * @param couponOrder | |||
| * @param merchant 分账商户 | |||
| * @param bmerchant 核销商户 | |||
| */ | |||
| void actionAfterVerify(WxCouponOrder couponOrder, WxMerchant merchant, WxMerchant bmerchant); | |||
| void actionAfterVerify(WxCouponOrder couponOrder, WxMerchant merchant); | |||
| /** | |||
| * 核销发券 | |||
| @@ -95,13 +94,15 @@ public interface WxCouponOrderService { | |||
| * 核销分账 | |||
| * @param couponOrder | |||
| */ | |||
| void shareAfterVerify(WxCouponOrder couponOrder, Long merchantId,boolean mulityShare); | |||
| void shareAfterVerify(WxCouponOrder couponOrder, WxMerchant wxMerchant,boolean mulityShare); | |||
| WxMerchantSubsidy recordAfterVerified(WxOrder order, WxMerchant wxMerchant); | |||
| /** | |||
| * 核销后补贴 | |||
| * @param couponOrder | |||
| */ | |||
| void subsidyAfterVerify(WxCouponOrder couponOrder, Long merchantId); | |||
| void subsidyAfterVerify(WxCouponOrder couponOrder, WxMerchant merchant); | |||
| /** | |||
| * 核销模板消息 | |||
| * @param couponOrder | |||