Commit e376c7d7 by guojuxing

门店分组

parent 2c6e054c
......@@ -34,8 +34,7 @@ public interface StoreGroupApiService {
/**
* 查询分组列表
* @param enterpriseId
* @param search 门店分组名称
* @param storeGroupDTO
* @return
*/
List<StoreGroupDTO> listStoreGroup(StoreGroupDTO storeGroupDTO);
......
......@@ -169,7 +169,11 @@ public class StoreGroupApiServiceImpl implements StoreGroupApiService{
@Override
public int remove(int storeGroupId) {
//todo 判断该分组是否有门店,如果有,不能删除
return tabStoreGroupMapper.deleteByPrimaryKey(storeGroupId);
TabStoreGroup tabStoreGroup = new TabStoreGroup();
tabStoreGroup.setStoreGroupId(storeGroupId);
tabStoreGroup.setStatus(0);
return tabStoreGroupMapper.updateByPrimaryKeySelective(tabStoreGroup);
}
private int selectStoreGroupMaxSort(Integer enterpriseId, Integer groupLevel) {
......
......@@ -63,9 +63,8 @@ public class StoreGroupController {
}
@RequestMapping("/remove")
public RestResponse remove(StoreGroupDTO storeGroupDTO) {
storeGroupDTO.setEnterpriseId(ENTERPRISE_ID);
return RestResponse.success(storeGroupApiService.remove(storeGroupDTO.getStoreGroupId()));
public RestResponse remove(@Validated({StoreGroupQO.RemoveValidView.class}) StoreGroupQO storeGroupQO) {
return RestResponse.success(storeGroupApiService.remove(storeGroupQO.getStoreGroupId()));
}
private List<Map<String, Object>> changeListToTree(int storeGroupId, List<StoreGroupDTO> list) {
......
......@@ -20,10 +20,15 @@ public class StoreGroupQO implements Serializable{
public interface SortValidView {
}
public interface RemoveValidView {
}
/**
*
*
*/
@NotNull(message = "门店分组ID不能为空", groups = {RemoveValidView.class})
private Integer storeGroupId;
/**
......@@ -45,7 +50,7 @@ public class StoreGroupQO implements Serializable{
/**
* 分组层级
*/
@NotNull(message = "名称不能为空", groups = {SaveValidView.class})
@NotNull(message = "层级不能为空", groups = {SaveValidView.class})
private Integer groupLevel;
/**
......
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