Commit a1b24491 by guojuxing

门店分组如果上级分组是子节点且下面有门店,则提示

parent e9bfa290
......@@ -3,6 +3,7 @@ package com.gic.store.web.controller;
import java.util.List;
import com.gic.download.utils.OperationResultUtils;
import com.gic.enterprise.utils.ResultControllerUtils;
import com.gic.enterprise.utils.UserDetailUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
......@@ -70,26 +71,49 @@ public class StoreGroupController {
return OperationResultUtils.operationResult(result, "修改上级分组", OperationResultUtils.getOperationObject(result));
}
/**
* 新增子分组验证,是否是子节点且有门店
* @param groupLevel
* @param parentStoreGroupId
* @return
*/
@RequestMapping("/has-parent-store-group-store-when-save")
public RestResponse hasParentStoreGroupStoreWhenSave(Integer groupLevel, Integer parentStoreGroupId) {
return ResultControllerUtils.commonResult(storeGroupApiService.tipWhenSaveStoreGroup(groupLevel,
UserDetailUtils.getUserDetail().getEnterpriseId(), parentStoreGroupId));
}
/**
* 修改上级分组之前验证,上级分组ID是否是子节点且有门店
* @param parentStoreGroupId
* @return
*/
@RequestMapping("/has-parent-store-group-store")
public RestResponse hasParentStoreGroupStore(Integer parentStoreGroupId) {
return ResultControllerUtils.commonResult(storeGroupApiService.tipWhenUpdateParentId(parentStoreGroupId));
}
@RequestMapping("/drag-sort")
public RestResponse dragSort(@Validated({ StoreGroupQO.RemoveValidView.class,
StoreGroupQO.SetSortValueValidView.class }) StoreGroupQO storeGroupQO) {
ServiceResponse<String> result = storeGroupApiService.dragSort(storeGroupQO.getStoreGroupId(), storeGroupQO.getSortValue());
return OperationResultUtils.operationResult(
result, "拖拽排序门店分组", OperationResultUtils.getOperationObject(result));
ServiceResponse<String> result = storeGroupApiService.dragSort(storeGroupQO.getStoreGroupId(),
storeGroupQO.getSortValue());
return OperationResultUtils.operationResult(result, "拖拽排序门店分组",
OperationResultUtils.getOperationObject(result));
}
@RequestMapping("/sort")
public RestResponse sort(@Validated({ StoreGroupQO.SortValidView.class }) StoreGroupQO storeGroupQO) {
ServiceResponse<String> result = storeGroupApiService.sort(transferQoToDTO(storeGroupQO), storeGroupQO.isUp());
return OperationResultUtils.operationResult(
result, "上下排序门店分组", OperationResultUtils.getOperationObject(result));
return OperationResultUtils.operationResult(result, "上下排序门店分组",
OperationResultUtils.getOperationObject(result));
}
@RequestMapping("/remove")
public RestResponse remove(@Validated({ StoreGroupQO.RemoveValidView.class }) StoreGroupQO storeGroupQO) {
ServiceResponse<String> result = storeGroupApiService.remove(storeGroupQO.getStoreGroupId());
return OperationResultUtils.operationResult(
result, OperationResultUtils.LOG_DELETE+ "门店分组", OperationResultUtils.getOperationObject(result));
return OperationResultUtils.operationResult(result, OperationResultUtils.LOG_DELETE + "门店分组",
OperationResultUtils.getOperationObject(result));
}
private StoreGroupDTO transferQoToDTO(StoreGroupQO storeGroupQO) {
......
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