Commit e7b19040 by 陶光胜

门店列表展示字段配置

parent ab741006
......@@ -6,11 +6,16 @@ import com.gic.api.base.commons.ServiceResponse;
import com.gic.commons.util.EntityUtil;
import com.gic.commons.util.GlobalInfo;
import com.gic.commons.webapi.reponse.RestResponse;
import com.gic.redis.data.util.RedisUtil;
import com.gic.store.constant.CreateTypeEnum;
import com.gic.store.dto.*;
import com.gic.store.service.StoreApiService;
import com.gic.store.service.StoreDictApiService;
import com.gic.store.web.qo.PageQO;
import com.gic.store.web.qo.store.StoreQO;
import com.gic.store.web.vo.StoreDictVO;
import com.gic.store.web.vo.StoreListSourceVO;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
......@@ -20,6 +25,7 @@ import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
......@@ -35,6 +41,8 @@ public class StoreController {
@Autowired
private StoreApiService storeApiService;
@Autowired
private StoreDictApiService storeDictApiService;
@RequestMapping("/save-store")
public RestResponse saveOrUpdate(StoreQO storeQO) {
......@@ -83,4 +91,92 @@ public class StoreController {
return RestResponse.failure(serviceResponse.getCode(), serviceResponse.getMessage());
}
}
@RequestMapping("store-list-source")
@ResponseBody
public RestResponse storeListSource(){
Integer enterpriseId = 1111;
List<StoreListSourceVO> list = this.getStoreAllListSource(enterpriseId);
Object obj = RedisUtil.getCache("enterprise:storeListSources:"+enterpriseId);
if(obj == null){
return RestResponse.success(list);
}
String[] sourcesArr = obj.toString().split(",");
for(StoreListSourceVO storeListSourceVO : list){
for(String s : sourcesArr){
if(s.equals(storeListSourceVO.getKey())){
storeListSourceVO.setChecked(1);
}
}
}
return RestResponse.success(list);
}
@RequestMapping("store-list-source-set")
@ResponseBody
public RestResponse storeListSourceSet(String sources){
Integer enterpriseId = 1111;
RedisUtil.setCache("enterprise:storeListSources:"+enterpriseId, sources);
return RestResponse.success();
}
private List<StoreListSourceVO> getStoreAllListSource(Integer enterpriseId){
List<StoreListSourceVO> list = new ArrayList<>();
ServiceResponse<List<StoreDictDTO>> serviceResponse = this.storeDictApiService.listStoreField(enterpriseId);
if(serviceResponse.isSuccess()){
List<StoreDictDTO> storeDictDTOList = serviceResponse.getResult();
if(CollectionUtils.isNotEmpty(storeDictDTOList)){
for(StoreDictDTO storeDictDTO : storeDictDTOList){
StoreListSourceVO vo = new StoreListSourceVO();
vo.setChecked(0);
vo.setIsCustom(1);
vo.setKey(storeDictDTO.getKey());
vo.setValue(storeDictDTO.getValue());
list.add(vo);
}
}
}
StoreListSourceVO vo1 = new StoreListSourceVO();
vo1.setValue("storeName");
vo1.setKey("门店名称");
list.add(vo1);
StoreListSourceVO vo2 = new StoreListSourceVO();
vo1.setValue("storeGroupName");
vo1.setKey("门店分组名称");
list.add(vo2);
StoreListSourceVO vo3 = new StoreListSourceVO();
vo1.setValue("storeCode");
vo1.setKey("关联门店主键");
list.add(vo3);
StoreListSourceVO vo4 = new StoreListSourceVO();
vo1.setValue("provinces");
vo1.setKey("地区");
list.add(vo4);
StoreListSourceVO vo5 = new StoreListSourceVO();
vo1.setValue("brandNames");
vo1.setKey("门店品牌");
list.add(vo5);
StoreListSourceVO vo6 = new StoreListSourceVO();
vo1.setValue("completeStatus");
vo1.setKey("资料完善状态");
list.add(vo6);
StoreListSourceVO vo7 = new StoreListSourceVO();
vo1.setValue("status");
vo1.setKey("门店启用状态");
list.add(vo7);
StoreListSourceVO vo8 = new StoreListSourceVO();
vo1.setValue("regionName");
vo1.setKey("门店所属域");
list.add(vo8);
StoreListSourceVO vo9 = new StoreListSourceVO();
vo1.setValue("erpStatus");
vo1.setKey("门店状态");
list.add(vo9);
StoreListSourceVO vo10 = new StoreListSourceVO();
vo1.setValue("storeType");
vo1.setKey("门店类型");
list.add(vo10);
return list;
}
}
\ No newline at end of file
package com.gic.store.web.vo;
import java.io.Serializable;
/**
* tab_store_dict
*/
public class StoreListSourceVO implements Serializable {
private String value;
private String key;
private Integer checked=0;
private Integer isCustom = 0;//是否是自定义字段
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
public Integer getChecked() {
return checked;
}
public void setChecked(Integer checked) {
this.checked = checked;
}
public String getKey() {
return key;
}
public void setKey(String key) {
this.key = key;
}
public Integer getIsCustom() {
return isCustom;
}
public void setIsCustom(Integer isCustom) {
this.isCustom = isCustom;
}
}
\ No newline at end of file
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