Commit 947b85f0 by 徐高华

删除分组增加校验

parent 6b00046f
...@@ -9,6 +9,7 @@ public enum HaoBanErrCode { ...@@ -9,6 +9,7 @@ public enum HaoBanErrCode {
ERR_10012("10012","企业微信不存在"), ERR_10012("10012","企业微信不存在"),
ERR_OTHER("9999","业务异常"), ERR_OTHER("9999","业务异常"),
ERR_100033("100033", "活码分组已经被关联,不可删除"), ERR_100033("100033", "活码分组已经被关联,不可删除"),
ERR_100034("100034", "无法删除该分组"),
ERR_2000("2000", "企微接口调用次数限制-月"), ERR_2000("2000", "企微接口调用次数限制-月"),
ERR_2001("2001", "企微接口调用次数限制-天"), ERR_2001("2001", "企微接口调用次数限制-天"),
ERR_2002("2002", "企微接口调用次数限制-小时"), ERR_2002("2002", "企微接口调用次数限制-小时"),
......
...@@ -30,6 +30,7 @@ import org.springframework.beans.factory.annotation.Autowired; ...@@ -30,6 +30,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -181,6 +182,13 @@ public class HmGroupApiServiceImpl implements HmGroupApiService { ...@@ -181,6 +182,13 @@ public class HmGroupApiServiceImpl implements HmGroupApiService {
if (groupSettingBo.getReferNum() != null && groupSettingBo.getReferNum() > 0) { if (groupSettingBo.getReferNum() != null && groupSettingBo.getReferNum() > 0) {
return ServiceResponse.failure(HaoBanErrCode.ERR_100033.getCode(), HaoBanErrCode.ERR_100033.getMsg()); return ServiceResponse.failure(HaoBanErrCode.ERR_100033.getCode(), HaoBanErrCode.ERR_100033.getMsg());
} }
List<HmQrcodeGroupNumBO> qrcodeGroupNumBoList = qrcodeService.getGroupIdNumByEnterpriseId(groupSettingBo.getWxEnterpriseId(), groupSettingBo.getEnterpriseId(), Arrays.asList(groupDTO.getGroupId()), null);
if (CollectionUtils.isNotEmpty(qrcodeGroupNumBoList)) {
if(qrcodeGroupNumBoList.get(0).getNum() > 0) {
return ServiceResponse.failure(HaoBanErrCode.ERR_100034.getCode(), HaoBanErrCode.ERR_100034.getMsg());
}
}
groupService.deleteGroupSetting(groupDTO); groupService.deleteGroupSetting(groupDTO);
return ServiceResponse.success(Boolean.TRUE); return ServiceResponse.success(Boolean.TRUE);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment