From f6e7ccd43f6b59e01b2800a4ecd928c55079be2a Mon Sep 17 00:00:00 2001 From: wenjy Date: Tue, 10 Jan 2023 19:57:30 +0800 Subject: [PATCH] =?UTF-8?q?change=20-=20=E7=AE=B1=E5=A3=B3=E5=8D=95?= =?UTF-8?q?=E6=97=A5=E5=87=BA=E5=85=A5=E5=BA=93=E6=9F=A5=E8=AF=A2=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../scada/NorthWareHouseController.java | 7 +++++-- .../scada/SouthWareHouseController.java | 15 +++++++++------ .../resources/mapper/system/RecordTaskMapper.xml | 1 + 3 files changed, 15 insertions(+), 8 deletions(-) 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}