Commit 30bbeeac by zhiwj

修改经营类目

parent fe6fb3d2
......@@ -2,6 +2,7 @@ package com.gic.store.dto;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
/**
* tab_store_dict
......@@ -44,6 +45,7 @@ public class StoreDictDTO implements Serializable {
* 0:owner 1:other
*/
private Integer ownType = 0;
private List<StoreDictDTO> storeDictList;
public Integer getStoreDictId() {
return storeDictId;
......@@ -116,4 +118,12 @@ public class StoreDictDTO implements Serializable {
public void setOwnType(Integer ownType) {
this.ownType = ownType;
}
public void setStoreDictList(List<StoreDictDTO> storeDictList) {
this.storeDictList = storeDictList;
}
public List<StoreDictDTO> getStoreDictList() {
return storeDictList;
}
}
\ No newline at end of file
......@@ -37,7 +37,29 @@ public class StoreDictApiServiceImpl implements StoreDictApiService {
@Override
public ServiceResponse<List<StoreDictDTO>> listAllBusinessCategory(Integer enterpriseId) {
return ServiceResponse.success(this.listAllStoreDict(enterpriseId, "businessCategory"));
List<StoreDictDTO> result = new ArrayList<>();
List<BizdictDTO> list = this.bizdictService.treeByCategoryCode("businessCategory");
if(CollectionUtils.isNotEmpty(list)){
result = changeListToTree(list, enterpriseId);
}
return ServiceResponse.success(result);
}
private List<StoreDictDTO> changeListToTree(List<BizdictDTO> list, Integer enterpriseId) {
List<StoreDictDTO> result = new ArrayList<>();
for(BizdictDTO bizdictDTO : list){
StoreDictDTO dictDTO = new StoreDictDTO();
dictDTO.setEnterpriseId(enterpriseId);
dictDTO.setKey(bizdictDTO.getName());
dictDTO.setValue(bizdictDTO.getValueContent());
if (CollectionUtils.isNotEmpty(bizdictDTO.getNodeChildren())) {
List nodeChildren = bizdictDTO.getNodeChildren();
List<StoreDictDTO> dtoList = changeListToTree((List<BizdictDTO>) nodeChildren, enterpriseId);
dictDTO.setStoreDictList(dtoList);
}
result.add(dictDTO);
}
return result;
}
@Override
......
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