Commit 2c8ae0bf by guojuxing

默认门店不能编辑

parent 5a814681
......@@ -112,7 +112,10 @@ public class StoreGroupApiServiceImpl implements StoreGroupApiService {
return ServiceResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), "父级ID参数错误");
}
int storeGroupParentId = storeGroupDTO.getParentStoreGroupId();
validIsDefault(storeGroupParentId);
ServiceResponse<TabStoreGroup> authValid = validIsDefault(storeGroupParentId);
if (!authValid.isSuccess()) {
return ServiceResponse.failure(authValid.getCode(), authValid.getMessage());
}
int oldStoreGroupParentId = oldStoreGroup.getParentStoreGroupId();
boolean hasEditParentId = storeGroupParentId != oldStoreGroupParentId;
if (hasEditParentId) {
......@@ -164,7 +167,10 @@ public class StoreGroupApiServiceImpl implements StoreGroupApiService {
if (StringUtils.isBlank(storeGroupDTO.getStoreGroupName())) {
return ServiceResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), "名称不能为空");
}
validIsDefault(storeGroupDTO.getStoreGroupId());
ServiceResponse<TabStoreGroup> authValid = validIsDefault(storeGroupDTO.getStoreGroupId());
if (!authValid.isSuccess()) {
return ServiceResponse.failure(authValid.getCode(), authValid.getMessage());
}
if (storeGroupService.isRepeatName(storeGroupDTO.getStoreGroupName(), storeGroupDTO.getStoreGroupId(),
storeGroupDTO.getEnterpriseId())) {
return ServiceResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), "名称不能重复");
......@@ -244,6 +250,10 @@ public class StoreGroupApiServiceImpl implements StoreGroupApiService {
if (isContainStore(storeGroupId)) {
return ServiceResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), "该分组下存在门店,不能删除");
}
ServiceResponse<TabStoreGroup> authValid = validIsDefault(storeGroupId);
if (!authValid.isSuccess()) {
return ServiceResponse.failure(authValid.getCode(), authValid.getMessage());
}
TabStoreGroup tabStoreGroup = new TabStoreGroup();
tabStoreGroup.setStoreGroupId(storeGroupId);
tabStoreGroup.setStatus(0);
......@@ -269,7 +279,10 @@ public class StoreGroupApiServiceImpl implements StoreGroupApiService {
if (tabStoreGroup == null) {
return ServiceResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), "主键错误,查询不到数据");
}
validIsDefault(storeGroupId);
ServiceResponse<TabStoreGroup> authValid = validIsDefault(storeGroupId);
if (!authValid.isSuccess()) {
return ServiceResponse.failure(authValid.getCode(), authValid.getMessage());
}
if (setSortValue == null) {
return ServiceResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), "拖拽排序值不能为空");
}
......
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