fix:看板接口优化

This commit is contained in:
zhangzq
2025-07-15 18:06:33 +08:00
parent 60f9bb2e13
commit bc4def1473
2 changed files with 8 additions and 5 deletions

View File

@@ -5,6 +5,7 @@ import cn.dev33.satoken.annotation.SaIgnore;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.nl.common.base.TableDataInfo; import org.nl.common.base.TableDataInfo;
import org.nl.common.logging.annotation.Log; import org.nl.common.logging.annotation.Log;
import org.nl.wms.bigscreen_manage.service.BigScreenService; import org.nl.wms.bigscreen_manage.service.BigScreenService;
@@ -17,6 +18,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays;
import java.util.List; import java.util.List;
/** /**
@@ -40,10 +42,11 @@ public class BigScreenController {
@Log("大屏数据") @Log("大屏数据")
@SaIgnore @SaIgnore
public ResponseEntity<Object> getData(@RequestBody JSONObject stors) { public ResponseEntity<Object> getData(@RequestBody JSONObject stors) {
List<String> list = new ArrayList<>(); String string = stors.getString("stors");
list.add("GW"); List<JSONObject> data = new ArrayList<>();
list.add("GW"); if (!StringUtils.isEmpty(string)){
List<JSONObject> data = bigScreenService.getData(list); data = bigScreenService.getData(Arrays.asList(string.split(",")));
}
return new ResponseEntity<>(TableDataInfo.build(data), HttpStatus.OK); return new ResponseEntity<>(TableDataInfo.build(data), HttpStatus.OK);
} }

View File

@@ -66,7 +66,7 @@ public class BigScreenServiceImpl implements BigScreenService {
for (String storCode : stors) { for (String storCode : stors) {
JSONObject item = new JSONObject(); JSONObject item = new JSONObject();
//1.【货位使用】数据 //1.【货位使用】数据
item.put("title","GW仓库"); item.put("title",storCode+"仓库");
item.put("pointUse", pointUse(storCode)); item.put("pointUse", pointUse(storCode));
// //2.【实时库存分析】数据 // //2.【实时库存分析】数据
item.put("ivtAnalyse", ivtAnalyse(storCode)); item.put("ivtAnalyse", ivtAnalyse(storCode));