| @@ -154,7 +154,7 @@ public class WxProjectConfigController extends BaseController { | |||||
| tenantEntity.setTenantId(wxMall.getId().toString()); | tenantEntity.setTenantId(wxMall.getId().toString()); | ||||
| WxMall parentWxMall = wxMallService.getByTenantInfo(tenantEntity); | WxMall parentWxMall = wxMallService.getByTenantInfo(tenantEntity); | ||||
| if(parentWxMall == null || !EnumSaleType.GROUP.getCode().equals(parentWxMall.getSaleType()) | |||||
| if(parentWxMall == null | |||||
| || !parentWxMall.getGroupSupport().equals(EnumGroupSupport.SUPPORT.getCode()) | || !parentWxMall.getGroupSupport().equals(EnumGroupSupport.SUPPORT.getCode()) | ||||
| || StringUtils.isNotBlank(parentWxMall.getParentTenantId())){ | || StringUtils.isNotBlank(parentWxMall.getParentTenantId())){ | ||||
| return new ResultData(ErrorCode.SYS_PARAMETER_ERROR); | return new ResultData(ErrorCode.SYS_PARAMETER_ERROR); | ||||
| @@ -177,7 +177,8 @@ public class WxProjectConfigController extends BaseController { | |||||
| logger.debug("[" + getIpAddr() + "] WxProjectConfigController::initMall"); | logger.debug("[" + getIpAddr() + "] WxProjectConfigController::initMall"); | ||||
| try { | 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()); | wxMall.setGroupSupport(EnumGroupSupport.SUPPORT.getCode()); | ||||
| }else{ | }else{ | ||||
| wxMall.setGroupSupport(EnumGroupSupport.NOT_SUPPORT.getCode()); | wxMall.setGroupSupport(EnumGroupSupport.NOT_SUPPORT.getCode()); | ||||
| @@ -113,6 +113,7 @@ public enum ErrorCode{ | |||||
| MERCHANT_BUSER_NOT_VALID(2016, "商户用户不存在或已被禁用"), | MERCHANT_BUSER_NOT_VALID(2016, "商户用户不存在或已被禁用"), | ||||
| MERCHANT_HASRENTCONTRACT(2017,"该商户存在计租中合同"), | MERCHANT_HASRENTCONTRACT(2017,"该商户存在计租中合同"), | ||||
| MERCHANT_CODE_IS_FOUND(2018, "商户编码已存在"), | MERCHANT_CODE_IS_FOUND(2018, "商户编码已存在"), | ||||
| MERCHANT_BRAND_IS_FOUND(2019, "品牌商户已存在"), | |||||
| /** | /** | ||||
| * 券 | * 券 | ||||
| @@ -13,6 +13,7 @@ public enum EnumSaleType { | |||||
| WX_ENJOY_TRY(4, "速享试用版"), | WX_ENJOY_TRY(4, "速享试用版"), | ||||
| TT_ALL_ROUND(11, "抖音尊享版"), | TT_ALL_ROUND(11, "抖音尊享版"), | ||||
| GROUP(100, "集团版"), | GROUP(100, "集团版"), | ||||
| GROUP_v1(101, "集团版"), | |||||
| WX_JM_ALL_ROUND(1035001036,"金茂全能版"), | WX_JM_ALL_ROUND(1035001036,"金茂全能版"), | ||||
| ; | ; | ||||
| @@ -30,6 +30,7 @@ public interface WxMerchantMapper extends CommonMapper<WxMerchant, Long> { | |||||
| int hasMerchant(WxMerchant wxMerchant); | int hasMerchant(WxMerchant wxMerchant); | ||||
| int hasMerchantEncode(WxMerchant wxMerchant); | int hasMerchantEncode(WxMerchant wxMerchant); | ||||
| int hasMerchantBrand(WxMerchant wxMerchant); | |||||
| void updateCreditLocked(WxMerchant wxMerchant); | void updateCreditLocked(WxMerchant wxMerchant); | ||||
| @@ -56,4 +57,5 @@ public interface WxMerchantMapper extends CommonMapper<WxMerchant, Long> { | |||||
| Map<String,Object> findShopMerchant(@Param("id")Long id); | Map<String,Object> findShopMerchant(@Param("id")Long id); | ||||
| int deleteByUpdate(Long id); | int deleteByUpdate(Long id); | ||||
| } | } | ||||
| @@ -160,6 +160,7 @@ public interface WxMerchantService { | |||||
| boolean hasMerchant(WxMerchant wxMerchant); | boolean hasMerchant(WxMerchant wxMerchant); | ||||
| boolean hasMerchantEncode(WxMerchant wxMerchant); | boolean hasMerchantEncode(WxMerchant wxMerchant); | ||||
| boolean hasMerchantBrand(WxMerchant wxMerchant); | |||||
| WxMerchant getMerchantByEncode(String encode); | WxMerchant getMerchantByEncode(String encode); | ||||
| @@ -509,9 +509,14 @@ public class WxMerchantServiceImpl implements WxMerchantService { | |||||
| if (hasMerchant(wxMerchant)) { | if (hasMerchant(wxMerchant)) { | ||||
| return new ResultData(ErrorCode.MERCHANT_NAME_IS_FOUND); | return new ResultData(ErrorCode.MERCHANT_NAME_IS_FOUND); | ||||
| } | } | ||||
| //检查商户唯一编码 | |||||
| if (hasMerchantEncode(wxMerchant)) { | if (hasMerchantEncode(wxMerchant)) { | ||||
| return new ResultData(ErrorCode.MERCHANT_CODE_IS_FOUND); | return new ResultData(ErrorCode.MERCHANT_CODE_IS_FOUND); | ||||
| } | } | ||||
| //检查品牌 | |||||
| if (hasMerchantBrand(wxMerchant)) { | |||||
| return new ResultData(ErrorCode.MERCHANT_BRAND_IS_FOUND); | |||||
| } | |||||
| //保存商户商铺的关联 | //保存商户商铺的关联 | ||||
| List<Long> shopidlist = wxMerchant.getShopids(); | List<Long> shopidlist = wxMerchant.getShopids(); | ||||
| if (shopidlist.isEmpty()) { | if (shopidlist.isEmpty()) { | ||||
| @@ -1026,6 +1031,15 @@ public class WxMerchantServiceImpl implements WxMerchantService { | |||||
| } | } | ||||
| } | } | ||||
| @Override | |||||
| public boolean hasMerchantBrand(WxMerchant wxMerchant) { | |||||
| if(wxMerchant.getBrand() != null && wxMallService.isgroupSupport(wxMerchant)){ | |||||
| wxMerchant.setStatus(EnumMerchantStatus.VALID.getCode()); | |||||
| return wxMerchantMapper.hasMerchantBrand(wxMerchant) > 0 ? true : false; | |||||
| } | |||||
| return false; | |||||
| } | |||||
| @Override | @Override | ||||
| public WxMerchant getMerchantByEncode(String encode){ | public WxMerchant getMerchantByEncode(String encode){ | ||||
| return wxMerchantMapper.getMerchantByEncode(encode); | return wxMerchantMapper.getMerchantByEncode(encode); | ||||
| @@ -101,6 +101,7 @@ public class WxRentPropertyContractServiceImpl implements WxRentPropertyContract | |||||
| data.put("status", wfr.getStatus()); | data.put("status", wfr.getStatus()); | ||||
| data.put("userName", wfr.getUserName()); | data.put("userName", wfr.getUserName()); | ||||
| data.put("remark", wfr.getRemark()); | data.put("remark", wfr.getRemark()); | ||||
| data.put("updateDate",wfr.getUpdateDate()); | |||||
| result.add(data); | result.add(data); | ||||
| } | } | ||||
| return new ResultData(result); | return new ResultData(result); | ||||
| @@ -313,10 +313,24 @@ | |||||
| <select id="hasMerchantEncode" parameterType="com.iformall.domain.po.WxMerchant" resultType="int"> | <select id="hasMerchantEncode" parameterType="com.iformall.domain.po.WxMerchant" resultType="int"> | ||||
| select count(1) from wx_merchant where `encode`=#{encode} | select count(1) from wx_merchant where `encode`=#{encode} | ||||
| <if test=" null != status "> | |||||
| and `status` = #{status} | |||||
| </if> | |||||
| <if test=" null != id"> | |||||
| and `id` != #{id} | |||||
| </if> | |||||
| </select> | |||||
| <select id="hasMerchantBrand" parameterType="com.iformall.domain.po.WxMerchant" resultType="int"> | |||||
| select count(1) from wx_merchant where `brand`=#{brand} | |||||
| <if test=" null != status "> | |||||
| and `status` = #{status} | |||||
| </if> | |||||
| <if test=" null != id"> | <if test=" null != id"> | ||||
| and `id` != #{id} | and `id` != #{id} | ||||
| </if> | </if> | ||||
| </select> | </select> | ||||
| <update id="updateCreditLocked" parameterType="com.iformall.domain.po.WxMerchant"> | <update id="updateCreditLocked" parameterType="com.iformall.domain.po.WxMerchant"> | ||||
| update wx_merchant set credit_locked = #{creditLocked} where tenant_id = #{tenantId} | update wx_merchant set credit_locked = #{creditLocked} where tenant_id = #{tenantId} | ||||
| @@ -174,7 +174,8 @@ public class WxProjectConfigController extends BaseController { | |||||
| logger.debug("[" + getIpAddr() + "] WxProjectConfigController::initMall"); | logger.debug("[" + getIpAddr() + "] WxProjectConfigController::initMall"); | ||||
| try { | 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()); | wxMall.setGroupSupport(EnumGroupSupport.SUPPORT.getCode()); | ||||
| }else{ | }else{ | ||||
| wxMall.setGroupSupport(EnumGroupSupport.NOT_SUPPORT.getCode()); | wxMall.setGroupSupport(EnumGroupSupport.NOT_SUPPORT.getCode()); | ||||
| @@ -653,7 +654,7 @@ public class WxProjectConfigController extends BaseController { | |||||
| TenantEntity tenantEntity = new TenantEntity(); | TenantEntity tenantEntity = new TenantEntity(); | ||||
| tenantEntity.setTenantId(tenantId); | tenantEntity.setTenantId(tenantId); | ||||
| WxMall parentWxMall = wxMallService.getByTenantInfo(tenantEntity); | WxMall parentWxMall = wxMallService.getByTenantInfo(tenantEntity); | ||||
| if(parentWxMall == null || !EnumSaleType.GROUP.getCode().equals(parentWxMall.getSaleType()) | |||||
| if(parentWxMall == null | |||||
| || !parentWxMall.getGroupSupport().equals(EnumGroupSupport.SUPPORT.getCode()) | || !parentWxMall.getGroupSupport().equals(EnumGroupSupport.SUPPORT.getCode()) | ||||
| || StringUtils.isNotBlank(parentWxMall.getParentTenantId())){ | || StringUtils.isNotBlank(parentWxMall.getParentTenantId())){ | ||||
| return new ResultData(ErrorCode.SYS_PARAMETER_ERROR); | return new ResultData(ErrorCode.SYS_PARAMETER_ERROR); | ||||
| @@ -690,7 +691,7 @@ public class WxProjectConfigController extends BaseController { | |||||
| tenantEntity.setTenantId(tenantId); | tenantEntity.setTenantId(tenantId); | ||||
| WxMall parentWxMall = wxMallService.getByTenantInfo(tenantEntity); | WxMall parentWxMall = wxMallService.getByTenantInfo(tenantEntity); | ||||
| if(parentWxMall == null || !EnumSaleType.GROUP.getCode().equals(parentWxMall.getSaleType()) | |||||
| if(parentWxMall == null | |||||
| || !parentWxMall.getGroupSupport().equals(EnumGroupSupport.SUPPORT.getCode()) | || !parentWxMall.getGroupSupport().equals(EnumGroupSupport.SUPPORT.getCode()) | ||||
| || StringUtils.isNotBlank(parentWxMall.getParentTenantId())){ | || StringUtils.isNotBlank(parentWxMall.getParentTenantId())){ | ||||
| return new ResultData(ErrorCode.SYS_PARAMETER_ERROR); | return new ResultData(ErrorCode.SYS_PARAMETER_ERROR); | ||||