From 355801cbd730b20b302878b608ec5bd55ef2e4c3 Mon Sep 17 00:00:00 2001 From: yinq Date: Sat, 30 Mar 2024 19:06:15 +0800 Subject: [PATCH] =?UTF-8?q?change=20-=20=E8=AE=BE=E5=A4=87=E6=8A=A5?= =?UTF-8?q?=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mapper/base/BaseMonitorWorkUnitMapper.xml | 2 +- .../mapper/base/BaseWorkUnitMapper.xml | 169 ++++++++++-------- .../ProductionReportController.java | 16 +- .../com/aucma/report/domain/ReportDayDnb.java | 22 ++- .../mapper/report/ReportDayDnbMapper.xml | 144 ++++++++------- .../mapper/report/ReportPointDnbMapper.xml | 5 +- 6 files changed, 205 insertions(+), 153 deletions(-) diff --git a/aucma-base/src/main/resources/mapper/base/BaseMonitorWorkUnitMapper.xml b/aucma-base/src/main/resources/mapper/base/BaseMonitorWorkUnitMapper.xml index b1850e7..2d5756d 100644 --- a/aucma-base/src/main/resources/mapper/base/BaseMonitorWorkUnitMapper.xml +++ b/aucma-base/src/main/resources/mapper/base/BaseMonitorWorkUnitMapper.xml @@ -56,7 +56,7 @@ and bmwu.proportion = #{proportion} and bmwu.is_flag = #{isFlag} - order by OBJ_ID + order by bmwu.monitor_code - and obj_id = #{objId} - and work_unit_code = #{workUnitCode} - and parent_id = #{parentId} - and work_unit_name like concat(concat('%', #{workUnitName}), '%') - and work_unit_address = #{workUnitAddress} - and ancestors = #{ancestors} - and work_unit_sort = #{workUnitSort} - and product_line_code = #{productLineCode} - and work_unit_type = #{workUnitType} - and is_flag = #{isFlag} - and created_by = #{createdBy} - and created_time = #{createdTime} - and updated_by = #{updatedBy} - and updated_time = #{updatedTime} + and obj_id = #{objId} + and work_unit_code = #{workUnitCode} + and parent_id = #{parentId} + and work_unit_name like concat(concat('%', + #{workUnitName}), '%') + + and work_unit_address = #{workUnitAddress} + + and ancestors = #{ancestors} + and work_unit_sort = #{workUnitSort} + and product_line_code = #{productLineCode} + + and work_unit_type = #{workUnitType} + and is_flag = #{isFlag} + and created_by = #{createdBy} + and created_time = #{createdTime} + and updated_by = #{updatedBy} + and updated_time = #{updatedTime} + order by work_unit_code @@ -57,61 +76,63 @@ insert into base_work_unit - obj_id, - work_unit_code, - parent_id, - work_unit_name, - work_unit_address, - ancestors, - work_unit_sort, - product_line_code, - work_unit_type, - is_flag, - created_by, - created_time, - updated_by, - updated_time, + obj_id, + work_unit_code, + parent_id, + work_unit_name, + work_unit_address, + ancestors, + work_unit_sort, + product_line_code, + work_unit_type, + is_flag, + created_by, + created_time, + updated_by, + updated_time, - #{objId}, - #{workUnitCode}, - #{parentId}, - #{workUnitName}, - #{workUnitAddress}, - #{ancestors}, - #{workUnitSort}, - #{productLineCode}, - #{workUnitType}, - #{isFlag}, - #{createdBy}, - #{createdTime}, - #{updatedBy}, - #{updatedTime}, + #{objId}, + #{workUnitCode}, + #{parentId}, + #{workUnitName}, + #{workUnitAddress}, + #{ancestors}, + #{workUnitSort}, + #{productLineCode}, + #{workUnitType}, + #{isFlag}, + #{createdBy}, + #{createdTime}, + #{updatedBy}, + #{updatedTime}, update base_work_unit - work_unit_code = #{workUnitCode}, - parent_id = #{parentId}, - work_unit_name = #{workUnitName}, - work_unit_address = #{workUnitAddress}, - ancestors = #{ancestors}, - work_unit_sort = #{workUnitSort}, - product_line_code = #{productLineCode}, - work_unit_type = #{workUnitType}, - is_flag = #{isFlag}, - created_by = #{createdBy}, - created_time = #{createdTime}, - updated_by = #{updatedBy}, - updated_time = #{updatedTime}, + work_unit_code = #{workUnitCode}, + parent_id = #{parentId}, + work_unit_name = #{workUnitName}, + work_unit_address = #{workUnitAddress}, + ancestors = #{ancestors}, + work_unit_sort = #{workUnitSort}, + product_line_code = #{productLineCode}, + work_unit_type = #{workUnitType}, + is_flag = #{isFlag}, + created_by = #{createdBy}, + created_time = #{createdTime}, + updated_by = #{updatedBy}, + updated_time = #{updatedTime}, where obj_id = #{objId} - delete from base_work_unit where obj_id = #{objId} + delete + from base_work_unit + where obj_id = #{objId} diff --git a/aucma-report/src/main/java/com/aucma/report/controller/ProductionReportController.java b/aucma-report/src/main/java/com/aucma/report/controller/ProductionReportController.java index d0d36ca..8d8ed78 100644 --- a/aucma-report/src/main/java/com/aucma/report/controller/ProductionReportController.java +++ b/aucma-report/src/main/java/com/aucma/report/controller/ProductionReportController.java @@ -53,9 +53,10 @@ public class ProductionReportController extends BaseController { * 查询生产执行报表 */ @GetMapping("/productionExecutionReportList") - public AjaxResult productionExecutionReportList(@RequestParam(required = false) Map hashMap) { + public TableDataInfo productionExecutionReportList(@RequestParam(required = false) Map hashMap) { + startPage(); List list = productionReportService.productionExecutionReportList(hashMap); - return success(list); + return getDataTable(list); } /** @@ -65,18 +66,21 @@ public class ProductionReportController extends BaseController { */ @PostMapping("/productionExecutionReportList/export") public void productionExecutionReportListExport(HttpServletResponse response, @RequestParam(required = false) Map hashMap) { + hashMap.put("pageNum",null); + hashMap.put("pageSize",null); List list = productionReportService.productionExecutionReportList(hashMap); ExcelUtil util = new ExcelUtil<>(ProductionExecutionReport. class); - util.exportExcel(response, list, "清单率报表" ); + util.exportExcel(response, list, "查询生产执行报表" ); } /** * 查询在制品查询报表 */ @GetMapping("/WIPInquiryReportList") - public AjaxResult WIPInquiryReportList(@RequestParam(required = false) Map hashMap) { + public TableDataInfo WIPInquiryReportList(@RequestParam(required = false) Map hashMap) { + startPage(); List list = productionReportService.WIPInquiryReportList(hashMap); - return success(list); + return getDataTable(list); } /** @@ -86,6 +90,8 @@ public class ProductionReportController extends BaseController { */ @PostMapping("/WIPInquiryReportList/export") public void WIPInquiryReportListExport(HttpServletResponse response, @RequestParam(required = false) Map hashMap) { + hashMap.put("pageNum",null); + hashMap.put("pageSize",null); List list = productionReportService.WIPInquiryReportList(hashMap); ExcelUtil util = new ExcelUtil<>(WIPInquiryReport. class); util.exportExcel(response, list, "清单率报表" ); diff --git a/aucma-report/src/main/java/com/aucma/report/domain/ReportDayDnb.java b/aucma-report/src/main/java/com/aucma/report/domain/ReportDayDnb.java index 791dbbf..f091405 100644 --- a/aucma-report/src/main/java/com/aucma/report/domain/ReportDayDnb.java +++ b/aucma-report/src/main/java/com/aucma/report/domain/ReportDayDnb.java @@ -29,6 +29,12 @@ public class ReportDayDnb extends BaseEntity { @Excel(name = "计量设备编号") private String monitorCode; + /** + * 计量设备名称 + */ + @Excel(name = "计量设备名称") + private String monitorName; + /** * 仪表值 */ @@ -50,47 +56,49 @@ public class ReportDayDnb extends BaseEntity { /** * 开始时间 */ - @Excel(name = "开始时间") private String beginTime; /** * 结束时间 */ - @Excel(name = "结束时间") private String endTime; /** * 是否标识 */ - @Excel(name = "是否标识") private Long isFlag; /** * 创建人 */ - @Excel(name = "创建人") private String createdBy; /** * 创建时间 */ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - @Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") private Date createdTime; /** * 更新人 */ - @Excel(name = "更新人") private String updatedBy; /** * 更新时间 */ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - @Excel(name = "更新时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") private Date updatedTime; + + public String getMonitorName() { + return monitorName; + } + + public void setMonitorName(String monitorName) { + this.monitorName = monitorName; + } + public void setObjId(Long objId) { this.objId = objId; } diff --git a/aucma-report/src/main/resources/mapper/report/ReportDayDnbMapper.xml b/aucma-report/src/main/resources/mapper/report/ReportDayDnbMapper.xml index 369b151..4a80c0c 100644 --- a/aucma-report/src/main/resources/mapper/report/ReportDayDnbMapper.xml +++ b/aucma-report/src/main/resources/mapper/report/ReportDayDnbMapper.xml @@ -5,101 +5,115 @@ - - - - - - - - - - - - + + + + + + + + + + + + + - select obj_id, monitor_code, instrument_value, expend, report_date, begin_time, end_time, is_flag, created_by, created_time, updated_by, updated_time from report_day_dnb + select rpd.monitor_code, + bm.MONITOR_NAME, + MAX(rpd.instrument_value) instrument_value, + SUM(rpd.expend) expend, + SUBSTR(rpd.begin_time, 1, 10) report_date + from report_point_dnb rpd + left join BASE_MONITORINFO bm on bm.MONITOR_CODE = rpd.MONITOR_CODE - - SELECT seq_report_day_dnb.NEXTVAL as objId FROM DUAL - + + SELECT seq_report_day_dnb.NEXTVAL as objId FROM DUAL + insert into report_day_dnb - obj_id, - monitor_code, - instrument_value, - expend, - report_date, - begin_time, - end_time, - is_flag, - created_by, - created_time, - updated_by, - updated_time, + obj_id, + monitor_code, + instrument_value, + expend, + report_date, + begin_time, + end_time, + is_flag, + created_by, + created_time, + updated_by, + updated_time, - #{objId}, - #{monitorCode}, - #{instrumentValue}, - #{expend}, - #{reportDate}, - #{beginTime}, - #{endTime}, - #{isFlag}, - #{createdBy}, - #{createdTime}, - #{updatedBy}, - #{updatedTime}, + #{objId}, + #{monitorCode}, + #{instrumentValue}, + #{expend}, + #{reportDate}, + #{beginTime}, + #{endTime}, + #{isFlag}, + #{createdBy}, + #{createdTime}, + #{updatedBy}, + #{updatedTime}, update report_day_dnb - monitor_code = #{monitorCode}, - instrument_value = #{instrumentValue}, - expend = #{expend}, - report_date = #{reportDate}, - begin_time = #{beginTime}, - end_time = #{endTime}, - is_flag = #{isFlag}, - created_by = #{createdBy}, - created_time = #{createdTime}, - updated_by = #{updatedBy}, - updated_time = #{updatedTime}, + monitor_code = #{monitorCode}, + instrument_value = #{instrumentValue}, + expend = #{expend}, + report_date = #{reportDate}, + begin_time = #{beginTime}, + end_time = #{endTime}, + is_flag = #{isFlag}, + created_by = #{createdBy}, + created_time = #{createdTime}, + updated_by = #{updatedBy}, + updated_time = #{updatedTime}, where obj_id = #{objId} - delete from report_day_dnb where obj_id = #{objId} + delete + from report_day_dnb + where obj_id = #{objId} diff --git a/aucma-report/src/main/resources/mapper/report/ReportPointDnbMapper.xml b/aucma-report/src/main/resources/mapper/report/ReportPointDnbMapper.xml index 95cea5b..b93e554 100644 --- a/aucma-report/src/main/resources/mapper/report/ReportPointDnbMapper.xml +++ b/aucma-report/src/main/resources/mapper/report/ReportPointDnbMapper.xml @@ -49,12 +49,15 @@ and rpd.begin_time = #{beginTime} and rpd.end_time = #{endTime} and rpd.is_flag = #{isFlag} + + and rpd.begin_time between #{params.beginCollectTime} and #{params.endCollectTime} + and rpd.created_by = #{createdBy} and rpd.created_time = #{createdTime} and rpd.updated_by = #{updatedBy} and rpd.updated_time = #{updatedTime} - order by rpd.OBJ_ID + order by rpd.begin_time DESC