| @@ -2,6 +2,8 @@ package com.iformall.controller.basic; | |||||
| import com.github.pagehelper.PageInfo; | import com.github.pagehelper.PageInfo; | ||||
| import com.iformall.annotation.SystemControllerLog; | import com.iformall.annotation.SystemControllerLog; | ||||
| import com.iformall.annotation.TenantIgnore; | |||||
| import com.iformall.common.ErrorCode; | |||||
| import com.iformall.common.Result; | import com.iformall.common.Result; | ||||
| import com.iformall.common.ResultData; | import com.iformall.common.ResultData; | ||||
| import com.iformall.controller.base.BaseController; | import com.iformall.controller.base.BaseController; | ||||
| @@ -49,7 +51,7 @@ public class WxBrandController extends BaseController { | |||||
| if (null == wxBrand) { | if (null == wxBrand) { | ||||
| wxBrand = new WxBrand(); | wxBrand = new WxBrand(); | ||||
| } | } | ||||
| wxBrand.updateTenantInfo(getTenantInfo()); | |||||
| wxBrand.setTenantId(getTenantInfo().getFinalTenantId()); | |||||
| wxBrand.setSortColumns(BaseEntity.SortField.Id_DESC); | wxBrand.setSortColumns(BaseEntity.SortField.Id_DESC); | ||||
| final PageInfo<WxBrand> page = wxBrandService.listAsPage(wxBrand, pageNum, pageSize); | final PageInfo<WxBrand> page = wxBrandService.listAsPage(wxBrand, pageNum, pageSize); | ||||
| return new ResultData(page); | return new ResultData(page); | ||||
| @@ -59,20 +61,24 @@ public class WxBrandController extends BaseController { | |||||
| @SystemControllerLog(description = "品牌-增加") | @SystemControllerLog(description = "品牌-增加") | ||||
| public ResultData add(@RequestBody WxBrand wxBrand) { | public ResultData add(@RequestBody WxBrand wxBrand) { | ||||
| logger.debug("[" + getIpAddr() + "] WxBrandController::add"); | logger.debug("[" + getIpAddr() + "] WxBrandController::add"); | ||||
| wxBrand.updateTenantInfo(getTenantInfo()); | |||||
| wxBrand.setTenantId(getTenantInfo().getFinalTenantId()); | |||||
| return wxBrandService.save(wxBrand); | return wxBrandService.save(wxBrand); | ||||
| } | } | ||||
| @TenantIgnore | |||||
| @PostMapping("update") | @PostMapping("update") | ||||
| @SystemControllerLog(description = "品牌-更新") | @SystemControllerLog(description = "品牌-更新") | ||||
| public ResultData update(@RequestBody WxBrand wxBrand) { | public ResultData update(@RequestBody WxBrand wxBrand) { | ||||
| logger.debug("[" + getIpAddr() + "] WxBrandController::update"); | 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())){ | if(EnumDelFlag.YES.getCode().equals(wxBrand.getIsDel())){ | ||||
| //判断是否解绑商户 | //判断是否解绑商户 | ||||
| WxMerchant wxMerchant = new WxMerchant(); | WxMerchant wxMerchant = new WxMerchant(); | ||||
| wxMerchant.updateTenantInfo(wxBrand); | |||||
| // wxMerchant.updateTenantInfo(wxBrand); | |||||
| wxMerchant.setIsDel(EnumYesOrNo.NO.getCode()); | wxMerchant.setIsDel(EnumYesOrNo.NO.getCode()); | ||||
| wxMerchant.setBrand(wxBrand.getId()); | wxMerchant.setBrand(wxBrand.getId()); | ||||
| @@ -118,10 +124,10 @@ public class WxBrandController extends BaseController { | |||||
| public ResultData hasBrand(String name, Long id) { | public ResultData hasBrand(String name, Long id) { | ||||
| logger.debug("[" + getIpAddr() + "] WxBrandController::hasBrand"); | logger.debug("[" + getIpAddr() + "] WxBrandController::hasBrand"); | ||||
| WxBrand wxBrand = new WxBrand(); | WxBrand wxBrand = new WxBrand(); | ||||
| wxBrand.updateTenantInfo(getTenantInfo()); | |||||
| wxBrand.setId(id); | |||||
| wxBrand.setTenantId(getTenantInfo().getFinalTenantId()); | |||||
| wxBrand.setName(name); | wxBrand.setName(name); | ||||
| wxBrand.setId(id); | |||||
| return wxBrandService.hasBrand(wxBrand); | return wxBrandService.hasBrand(wxBrand); | ||||
| } | } | ||||
| @@ -22,6 +22,7 @@ public class TenantInfoImpl implements TenantInfo { | |||||
| "mall_permission", | "mall_permission", | ||||
| "mall_sale_type", | "mall_sale_type", | ||||
| "mall_user_role", | "mall_user_role", | ||||
| "wx_brand", | |||||
| "wx_channel", | "wx_channel", | ||||
| "wx_business", | "wx_business", | ||||
| "wx_sub_business", | "wx_sub_business", | ||||
| @@ -74,6 +75,7 @@ public class TenantInfoImpl implements TenantInfo { | |||||
| "wx_mall", | "wx_mall", | ||||
| "wx_appinfo", | "wx_appinfo", | ||||
| "wx_authorizer_info", | "wx_authorizer_info", | ||||
| "wx_brand", | |||||
| "wx_c_user", | "wx_c_user", | ||||
| "tt_c_user", | "tt_c_user", | ||||
| "wx_user_visit", | "wx_user_visit", | ||||
| @@ -0,0 +1,4 @@ | |||||
| --历史品牌数据 | |||||
| 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; | |||||
| @@ -23,6 +23,7 @@ public class TenantInfoImpl implements TenantInfo { | |||||
| "mall_permission", | "mall_permission", | ||||
| "mall_sale_type", | "mall_sale_type", | ||||
| "mall_user_role", | "mall_user_role", | ||||
| "wx_brand", | |||||
| "wx_channel", | "wx_channel", | ||||
| "wx_business", | "wx_business", | ||||
| "wx_coupon_type", | "wx_coupon_type", | ||||
| @@ -62,6 +63,7 @@ public class TenantInfoImpl implements TenantInfo { | |||||
| "wx_mall", | "wx_mall", | ||||
| "wx_appinfo", | "wx_appinfo", | ||||
| "wx_authorizer_info", | "wx_authorizer_info", | ||||
| "wx_brand", | |||||
| "wx_c_user", | "wx_c_user", | ||||
| "tt_c_user", | "tt_c_user", | ||||
| "wx_user_visit", | "wx_user_visit", | ||||
| @@ -23,6 +23,7 @@ public class TenantInfoImpl implements TenantInfo { | |||||
| "mall_permission", | "mall_permission", | ||||
| "mall_sale_type", | "mall_sale_type", | ||||
| "mall_user_role", | "mall_user_role", | ||||
| "wx_brand", | |||||
| "wx_channel", | "wx_channel", | ||||
| "wx_business", | "wx_business", | ||||
| "wx_coupon_type", | "wx_coupon_type", | ||||
| @@ -67,6 +68,7 @@ public class TenantInfoImpl implements TenantInfo { | |||||
| "wx_mall", | "wx_mall", | ||||
| "wx_appinfo", | "wx_appinfo", | ||||
| "wx_authorizer_info", | "wx_authorizer_info", | ||||
| "wx_brand", | |||||
| "wx_c_user", | "wx_c_user", | ||||
| "tt_c_user", | "tt_c_user", | ||||
| "wx_user_visit", | "wx_user_visit", | ||||
| @@ -23,6 +23,7 @@ public class TenantInfoImpl implements TenantInfo { | |||||
| "mall_permission", | "mall_permission", | ||||
| "mall_sale_type", | "mall_sale_type", | ||||
| "mall_user_role", | "mall_user_role", | ||||
| "wx_brand", | |||||
| "wx_channel", | "wx_channel", | ||||
| "wx_business", | "wx_business", | ||||
| "wx_coupon_type", | "wx_coupon_type", | ||||
| @@ -67,6 +68,7 @@ public class TenantInfoImpl implements TenantInfo { | |||||
| "wx_mall", | "wx_mall", | ||||
| "wx_appinfo", | "wx_appinfo", | ||||
| "wx_authorizer_info", | "wx_authorizer_info", | ||||
| "wx_brand", | |||||
| "wx_c_user", | "wx_c_user", | ||||
| "tt_c_user", | "tt_c_user", | ||||
| "wx_user_visit", | "wx_user_visit", | ||||
| @@ -101,7 +101,7 @@ public class WxBrandServiceImpl implements WxBrandService { | |||||
| @Override | @Override | ||||
| public List<Map<String,Object>> queryBrand(TenantEntity tenantEntity) { | public List<Map<String,Object>> queryBrand(TenantEntity tenantEntity) { | ||||
| WxBrand wxBrand = new WxBrand(); | WxBrand wxBrand = new WxBrand(); | ||||
| wxBrand.updateTenantInfo(tenantEntity); | |||||
| wxBrand.setTenantId(tenantEntity.getFinalTenantId()); | |||||
| return wxBrandMapper.queryBrandByTenant(wxBrand); | return wxBrandMapper.queryBrandByTenant(wxBrand); | ||||
| } | } | ||||
| @@ -115,7 +115,7 @@ public class WxBrandServiceImpl implements WxBrandService { | |||||
| @Override | @Override | ||||
| public Map<Long, WxBrand> getAllMap(TenantEntity tenantEntity) { | public Map<Long, WxBrand> getAllMap(TenantEntity tenantEntity) { | ||||
| WxBrand brandQ = new WxBrand(); | WxBrand brandQ = new WxBrand(); | ||||
| brandQ.updateTenantInfo(tenantEntity); | |||||
| brandQ.setTenantId(tenantEntity.getFinalTenantId()); | |||||
| List<WxBrand> brandList = wxBrandMapper.findList(brandQ); | List<WxBrand> brandList = wxBrandMapper.findList(brandQ); | ||||
| Map<Long,WxBrand> map = new HashMap<Long,WxBrand>(); | Map<Long,WxBrand> map = new HashMap<Long,WxBrand>(); | ||||
| if (null != brandList) { | if (null != brandList) { | ||||
| @@ -2,6 +2,8 @@ package com.iformall.controller.basic; | |||||
| import com.github.pagehelper.PageInfo; | import com.github.pagehelper.PageInfo; | ||||
| import com.iformall.annotation.SystemControllerLog; | import com.iformall.annotation.SystemControllerLog; | ||||
| import com.iformall.annotation.TenantIgnore; | |||||
| import com.iformall.common.ErrorCode; | |||||
| import com.iformall.common.Result; | import com.iformall.common.Result; | ||||
| import com.iformall.common.ResultData; | import com.iformall.common.ResultData; | ||||
| import com.iformall.controller.base.BaseController; | import com.iformall.controller.base.BaseController; | ||||
| @@ -9,6 +11,7 @@ import com.iformall.domain.po.base.BaseEntity; | |||||
| import com.iformall.domain.po.WxBrand; | import com.iformall.domain.po.WxBrand; | ||||
| import com.iformall.domain.po.WxMerchant; | import com.iformall.domain.po.WxMerchant; | ||||
| import com.iformall.enums.EnumDelFlag; | import com.iformall.enums.EnumDelFlag; | ||||
| import com.iformall.enums.EnumYesOrNo; | |||||
| import com.iformall.service.WxBrandService; | import com.iformall.service.WxBrandService; | ||||
| import com.iformall.service.WxMerchantService; | import com.iformall.service.WxMerchantService; | ||||
| import io.swagger.annotations.ApiImplicitParam; | import io.swagger.annotations.ApiImplicitParam; | ||||
| @@ -48,7 +51,7 @@ public class WxBrandController extends BaseController { | |||||
| if (null == wxBrand) { | if (null == wxBrand) { | ||||
| wxBrand = new WxBrand(); | wxBrand = new WxBrand(); | ||||
| } | } | ||||
| wxBrand.updateTenantInfo(getTenantInfo()); | |||||
| wxBrand.setTenantId(getTenantInfo().getFinalTenantId()); | |||||
| wxBrand.setSortColumns(BaseEntity.SortField.Id_DESC); | wxBrand.setSortColumns(BaseEntity.SortField.Id_DESC); | ||||
| final PageInfo<WxBrand> page = wxBrandService.listAsPage(wxBrand, pageNum, pageSize); | final PageInfo<WxBrand> page = wxBrandService.listAsPage(wxBrand, pageNum, pageSize); | ||||
| return new ResultData(page); | return new ResultData(page); | ||||
| @@ -58,22 +61,26 @@ public class WxBrandController extends BaseController { | |||||
| @SystemControllerLog(description = "品牌-增加") | @SystemControllerLog(description = "品牌-增加") | ||||
| public ResultData add(@RequestBody WxBrand wxBrand) { | public ResultData add(@RequestBody WxBrand wxBrand) { | ||||
| logger.debug("[" + getIpAddr() + "] WxBrandController::add"); | logger.debug("[" + getIpAddr() + "] WxBrandController::add"); | ||||
| wxBrand.updateTenantInfo(getTenantInfo()); | |||||
| wxBrand.setTenantId(getTenantInfo().getFinalTenantId()); | |||||
| return wxBrandService.save(wxBrand); | return wxBrandService.save(wxBrand); | ||||
| } | } | ||||
| @TenantIgnore | |||||
| @PostMapping("update") | @PostMapping("update") | ||||
| @SystemControllerLog(description = "品牌-更新") | @SystemControllerLog(description = "品牌-更新") | ||||
| public ResultData update(@RequestBody WxBrand wxBrand) { | public ResultData update(@RequestBody WxBrand wxBrand) { | ||||
| logger.debug("[" + getIpAddr() + "] WxBrandController::update"); | 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())){ | if(EnumDelFlag.YES.getCode().equals(wxBrand.getIsDel())){ | ||||
| //判断是否解绑商户 | //判断是否解绑商户 | ||||
| WxMerchant wxMerchant = new WxMerchant(); | WxMerchant wxMerchant = new WxMerchant(); | ||||
| wxMerchant.setIsDel(0); | |||||
| // wxMerchant.updateTenantInfo(wxBrand); | |||||
| wxMerchant.setIsDel(EnumYesOrNo.NO.getCode()); | |||||
| wxMerchant.setBrand(wxBrand.getId()); | wxMerchant.setBrand(wxBrand.getId()); | ||||
| wxMerchant.updateTenantInfo(wxBrand); | |||||
| List<WxMerchant> merchantList = wxMerchantService.findList(wxMerchant); | List<WxMerchant> merchantList = wxMerchantService.findList(wxMerchant); | ||||
| if(CollectionUtils.isNotEmpty(merchantList)){ | if(CollectionUtils.isNotEmpty(merchantList)){ | ||||
| @@ -117,9 +124,10 @@ public class WxBrandController extends BaseController { | |||||
| public ResultData hasBrand(String name, Long id) { | public ResultData hasBrand(String name, Long id) { | ||||
| logger.debug("[" + getIpAddr() + "] WxBrandController::hasBrand"); | logger.debug("[" + getIpAddr() + "] WxBrandController::hasBrand"); | ||||
| WxBrand wxBrand = new WxBrand(); | WxBrand wxBrand = new WxBrand(); | ||||
| wxBrand.updateTenantInfo(getTenantInfo()); | |||||
| wxBrand.setName(name); | |||||
| wxBrand.setId(id); | wxBrand.setId(id); | ||||
| wxBrand.setTenantId(getTenantInfo().getFinalTenantId()); | |||||
| wxBrand.setName(name); | |||||
| return wxBrandService.hasBrand(wxBrand); | return wxBrandService.hasBrand(wxBrand); | ||||
| } | } | ||||