diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/scada/NorthWareHouseController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/scada/NorthWareHouseController.java index c351b4c..a16b0a5 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/scada/NorthWareHouseController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/scada/NorthWareHouseController.java @@ -23,6 +23,7 @@ import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; +import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.*; import java.util.stream.Collectors; @@ -135,7 +136,8 @@ public class NorthWareHouseController { @PostMapping("/getStoreInfo") @ResponseBody - public String getStoreInfo(){ + public String getStoreInfo() throws ParseException { + SimpleDateFormat today = new SimpleDateFormat("yyyy-MM-dd 00:00:00"); RecordTask recordTaskInfo; Map params = new HashMap<>(); Calendar calendar = Calendar.getInstance(); @@ -160,7 +162,8 @@ public class NorthWareHouseController { southWare.setUseStoreCount(baseLocationInfoList.size()); southWare.setFreeStoreCount(312-baseLocationInfoList.size()); - params.put("beginRecordTime",calendar.getTime()); + //params.put("beginRecordTime",calendar.getTime()); + params.put("beginRecordTime",today.parse(today.format(new Date()))); params.put("endRecordTime",new Date()); recordTaskInfo = new RecordTask("A","1",1L,new Date()); diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/scada/SouthWareHouseController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/scada/SouthWareHouseController.java index cdf5784..860000a 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/scada/SouthWareHouseController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/scada/SouthWareHouseController.java @@ -23,6 +23,7 @@ import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; +import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.*; import java.util.stream.Collectors; @@ -137,7 +138,8 @@ public class SouthWareHouseController { @PostMapping("/getStoreInfo") @ResponseBody - public String getStoreInfo(){ + public String getStoreInfo() throws ParseException { + SimpleDateFormat today = new SimpleDateFormat("yyyy-MM-dd 00:00:00"); RecordTask recordTaskInfo; Map params = new HashMap<>(); Calendar calendar = Calendar.getInstance(); @@ -162,23 +164,24 @@ public class SouthWareHouseController { southWare.setUseStoreCount(baseLocationInfoList.size()); southWare.setFreeStoreCount(312-baseLocationInfoList.size()); - params.put("beginRecordTime",calendar.getTime()); + //params.put("beginRecordTime",calendar.getTime()); + params.put("beginRecordTime",today.parse(today.format(new Date()))); params.put("endRecordTime",new Date()); - recordTaskInfo = new RecordTask("A","1",1L,new Date()); + recordTaskInfo = new RecordTask("B","1",1L,new Date()); recordTaskInfo.setParams(params); List recordLeftInStore = recordTaskService.selectRecordTaskList(recordTaskInfo); - recordTaskInfo = new RecordTask("A","1",2L,new Date()); + recordTaskInfo = new RecordTask("B","1",2L,new Date()); recordTaskInfo.setParams(params); List recordLeftOutStore = recordTaskService.selectRecordTaskList(recordTaskInfo); - recordTaskInfo = new RecordTask("A","2",1L,new Date()); + recordTaskInfo = new RecordTask("B","2",1L,new Date()); recordTaskInfo.setParams(params); List recordRightInStore = recordTaskService.selectRecordTaskList(recordTaskInfo); - recordTaskInfo = new RecordTask("A","2",2L,new Date()); + recordTaskInfo = new RecordTask("B","2",2L,new Date()); recordTaskInfo.setParams(params); List recordRightOutStore = recordTaskService.selectRecordTaskList(recordTaskInfo); diff --git a/ruoyi-system/src/main/resources/mapper/system/RecordTaskMapper.xml b/ruoyi-system/src/main/resources/mapper/system/RecordTaskMapper.xml index c608255..7750c4b 100644 --- a/ruoyi-system/src/main/resources/mapper/system/RecordTaskMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/RecordTaskMapper.xml @@ -35,6 +35,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and location_area = #{locationArea} and task_type = #{taskType} and task_status = #{taskStatus} + and store_code = #{storeCode} and record_time between #{params.beginRecordTime} and #{params.endRecordTime}