diff --git a/cereshop-admin/src/main/java/com/shop/cereshop/admin/service/member/impl/CerePlatformMemberLevelServiceImpl.java b/cereshop-admin/src/main/java/com/shop/cereshop/admin/service/member/impl/CerePlatformMemberLevelServiceImpl.java index 8baa5f7..dc092c4 100644 --- a/cereshop-admin/src/main/java/com/shop/cereshop/admin/service/member/impl/CerePlatformMemberLevelServiceImpl.java +++ b/cereshop-admin/src/main/java/com/shop/cereshop/admin/service/member/impl/CerePlatformMemberLevelServiceImpl.java @@ -44,9 +44,9 @@ public class CerePlatformMemberLevelServiceImpl implements CerePlatformMemberLev @Transactional(isolation= Isolation.DEFAULT,propagation= Propagation.REQUIRED,rollbackFor = {CoBusinessException.class, Exception.class}) public void save(MemberLevelSaveParam param, CerePlatformUser user) throws CoBusinessException { String time= TimeUtils.yyMMddHHmmss(); - if (cerePlatformMemberLevelDAO.countMemberLevel(StringUtils.trim(param.getMemberLevelName()), param.getGrowth(), null) > 0) { +/* if (cerePlatformMemberLevelDAO.countMemberLevel(StringUtils.trim(param.getMemberLevelName()), param.getGrowth(), null) > 0) { throw new CoBusinessException(CoReturnFormat.EXIST_MEMBER_LEVEL); - } + }*/ if (param.getGrowth() != 0 && cerePlatformMemberLevelDAO.countByGrowth(0) == 0) { throw new CoBusinessException(CoReturnFormat.NEED_ZERO_GROWTH); } @@ -67,9 +67,9 @@ public class CerePlatformMemberLevelServiceImpl implements CerePlatformMemberLev @Transactional(isolation= Isolation.DEFAULT,propagation= Propagation.REQUIRED,rollbackFor = {CoBusinessException.class, Exception.class}) public void update(MemberLevelUpdateParam param, CerePlatformUser user) throws CoBusinessException { String time= TimeUtils.yyMMddHHmmss(); - if (cerePlatformMemberLevelDAO.countMemberLevel(StringUtils.trim(param.getMemberLevelName()), param.getGrowth(), param.getMemberLevelId()) > 0) { +/* if (cerePlatformMemberLevelDAO.countMemberLevel(StringUtils.trim(param.getMemberLevelName()), param.getGrowth(), param.getMemberLevelId()) > 0) { throw new CoBusinessException(CoReturnFormat.EXIST_MEMBER_LEVEL); - } + }*/ CerePlatformMemberLevel oldLevel = cerePlatformMemberLevelDAO.selectByPrimaryKey(param.getMemberLevelId()); if (oldLevel == null) { throw new CoBusinessException(CoReturnFormat.PARAM_INVALID); diff --git a/cereshop-admin/src/main/resources/mybatis/mapper/member/CerePlatformMemberLevelDAO.xml b/cereshop-admin/src/main/resources/mybatis/mapper/member/CerePlatformMemberLevelDAO.xml index 184ebce..43dc959 100644 --- a/cereshop-admin/src/main/resources/mybatis/mapper/member/CerePlatformMemberLevelDAO.xml +++ b/cereshop-admin/src/main/resources/mybatis/mapper/member/CerePlatformMemberLevelDAO.xml @@ -160,6 +160,6 @@ <select id="countByGrowth" resultType="int"> select count(*) from cere_platform_member_level - where growth = #{growth} + where business_id=0 and growth = #{growth} </select> </mapper> diff --git a/cereshop-business/src/main/java/com/shop/cereshop/business/dao/member/CerePlatformMemberLevelDAO.java b/cereshop-business/src/main/java/com/shop/cereshop/business/dao/member/CerePlatformMemberLevelDAO.java index a4ef8c2..8a4d12f 100644 --- a/cereshop-business/src/main/java/com/shop/cereshop/business/dao/member/CerePlatformMemberLevelDAO.java +++ b/cereshop-business/src/main/java/com/shop/cereshop/business/dao/member/CerePlatformMemberLevelDAO.java @@ -39,5 +39,5 @@ public interface CerePlatformMemberLevelDAO extends BaseMapper<CerePlatformMembe @Param("growth")Integer growth, @Param("excludeMemberLevelId")Long excludeMemberLevelId); - int countByGrowth(int growth); + int countByGrowth(Long businessId, int growth); } diff --git a/cereshop-business/src/main/java/com/shop/cereshop/business/service/member/impl/CerePlatformMemberLevelServiceImpl.java b/cereshop-business/src/main/java/com/shop/cereshop/business/service/member/impl/CerePlatformMemberLevelServiceImpl.java index 486ca62..77b3d31 100644 --- a/cereshop-business/src/main/java/com/shop/cereshop/business/service/member/impl/CerePlatformMemberLevelServiceImpl.java +++ b/cereshop-business/src/main/java/com/shop/cereshop/business/service/member/impl/CerePlatformMemberLevelServiceImpl.java @@ -49,10 +49,10 @@ public class CerePlatformMemberLevelServiceImpl implements CerePlatformMemberLev @Transactional(isolation= Isolation.DEFAULT,propagation= Propagation.REQUIRED,rollbackFor = {CoBusinessException.class, Exception.class}) public void save(MemberLevelSaveParam param, CerePlatformBusinessUser user) throws CoBusinessException { String time= TimeUtils.yyMMddHHmmss(); - if (cerePlatformMemberLevelDAO.countMemberLevel(StringUtils.trim(param.getMemberLevelName()), param.getGrowth(), null) > 0) { +/* if (cerePlatformMemberLevelDAO.countMemberLevel(StringUtils.trim(param.getMemberLevelName()), param.getGrowth(), null) > 0) { throw new CoBusinessException(CoReturnFormat.EXIST_MEMBER_LEVEL); - } - if (param.getGrowth() != 0 && cerePlatformMemberLevelDAO.countByGrowth(0) == 0) { + }*/ + if (param.getGrowth() != 0 && cerePlatformMemberLevelDAO.countByGrowth(user.getBusinessId(), 0) == 0) { throw new CoBusinessException(CoReturnFormat.NEED_ZERO_GROWTH); } CerePlatformMemberLevel memberLevel=new CerePlatformMemberLevel(); @@ -73,9 +73,9 @@ public class CerePlatformMemberLevelServiceImpl implements CerePlatformMemberLev @Transactional(isolation= Isolation.DEFAULT,propagation= Propagation.REQUIRED,rollbackFor = {CoBusinessException.class, Exception.class}) public void update(MemberLevelUpdateParam param, CerePlatformBusinessUser user) throws CoBusinessException { String time= TimeUtils.yyMMddHHmmss(); - if (cerePlatformMemberLevelDAO.countMemberLevel(StringUtils.trim(param.getMemberLevelName()), param.getGrowth(), param.getMemberLevelId()) > 0) { + /*if (cerePlatformMemberLevelDAO.countMemberLevel(StringUtils.trim(param.getMemberLevelName()), param.getGrowth(), param.getMemberLevelId()) > 0) { throw new CoBusinessException(CoReturnFormat.EXIST_MEMBER_LEVEL); - } + }*/ CerePlatformMemberLevel oldLevel = cerePlatformMemberLevelDAO.selectByPrimaryKey(param.getMemberLevelId()); if (oldLevel == null) { throw new CoBusinessException(CoReturnFormat.PARAM_INVALID); diff --git a/cereshop-business/src/main/resources/mybatis/mapper/member/CerePlatformMemberLevelDAO.xml b/cereshop-business/src/main/resources/mybatis/mapper/member/CerePlatformMemberLevelDAO.xml index 7aa36a1..3e41094 100644 --- a/cereshop-business/src/main/resources/mybatis/mapper/member/CerePlatformMemberLevelDAO.xml +++ b/cereshop-business/src/main/resources/mybatis/mapper/member/CerePlatformMemberLevelDAO.xml @@ -164,6 +164,6 @@ <select id="countByGrowth" resultType="int"> select count(*) from cere_platform_member_level - where growth = #{growth} + where business_id=#{businessId} and growth = #{growth} </select> </mapper>