From 6f6f1ba38f6e98c3b35b7ef5cbe28989b1c5574b Mon Sep 17 00:00:00 2001 From: yinq Date: Fri, 8 Mar 2024 16:45:33 +0800 Subject: [PATCH] =?UTF-8?q?change=20-=20=E4=BC=98=E5=8C=96=E5=B7=A5?= =?UTF-8?q?=E8=89=BA=E8=B7=AF=E7=BA=BF=E3=80=81=E5=B7=A5=E5=BA=8F=E3=80=81?= =?UTF-8?q?=E5=B7=A5=E4=BD=8D=E3=80=81=E7=94=9F=E4=BA=A7=E5=B7=A5=E5=8D=95?= =?UTF-8?q?=E5=8D=95=E4=BD=8D=E6=97=B6=E9=97=B4=E9=A1=B5=E9=9D=A2=E9=80=BB?= =?UTF-8?q?=E8=BE=91=E3=80=82=E7=94=9F=E4=BA=A7BOM=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=AE=89=E8=A3=85=E6=97=B6=E9=95=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/hw/mes/domain/MesBaseRoute.java | 14 ++ .../com/hw/mes/domain/MesMaterialBom.java | 14 ++ .../com/hw/mes/domain/MesProductOrder.java | 14 ++ .../mapper/mes/MesBaseRouteMapper.xml | 130 +++++++---- .../mapper/mes/MesMaterialBomMapper.xml | 5 + .../mapper/mes/MesProductOrderMapper.xml | 12 +- hw-ui/src/main.js | 11 +- hw-ui/src/utils/ruoyi.js | 18 ++ hw-ui/src/views/mes/baseRoute/index.vue | 18 +- hw-ui/src/views/mes/baseStationInfo/index.vue | 8 +- hw-ui/src/views/mes/materialBom/index.vue | 114 ++++++++-- hw-ui/src/views/mes/materialinfo/index.vue | 12 +- hw-ui/src/views/mes/processInfo/index.vue | 214 +++++++++++------- hw-ui/src/views/mes/productOrder/index.vue | 10 +- 14 files changed, 434 insertions(+), 160 deletions(-) diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/domain/MesBaseRoute.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/domain/MesBaseRoute.java index 76349e87..81a9a6e9 100644 --- a/hw-modules/hw-mes/src/main/java/com/hw/mes/domain/MesBaseRoute.java +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/domain/MesBaseRoute.java @@ -33,6 +33,12 @@ public class MesBaseRoute extends BaseEntity { @Excel(name = "工艺路线说明") private String routeDesc; + /** + * 单位时间 + */ + @Excel(name = "单位时间") + private Long productionTime; + /** * 激活标识 */ @@ -44,6 +50,14 @@ public class MesBaseRoute extends BaseEntity { */ private List mesBaseRouteProcessList; + public Long getProductionTime() { + return productionTime; + } + + public void setProductionTime(Long productionTime) { + this.productionTime = productionTime; + } + public void setRouteId(Long routeId) { this.routeId = routeId; } diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/domain/MesMaterialBom.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/domain/MesMaterialBom.java index 3759c604..58b53e40 100644 --- a/hw-modules/hw-mes/src/main/java/com/hw/mes/domain/MesMaterialBom.java +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/domain/MesMaterialBom.java @@ -80,6 +80,20 @@ public class MesMaterialBom extends TreeEntity { */ private String materialNameDesc; + /** + * 安装时长 + */ + @Excel(name = "安装时长") + private Long assembleTime; + + public Long getAssembleTime() { + return assembleTime; + } + + public void setAssembleTime(Long assembleTime) { + this.assembleTime = assembleTime; + } + public String getMaterialNameDesc() { return materialNameDesc; } diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/domain/MesProductOrder.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/domain/MesProductOrder.java index d8a6dbd9..cf9f6b54 100644 --- a/hw-modules/hw-mes/src/main/java/com/hw/mes/domain/MesProductOrder.java +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/domain/MesProductOrder.java @@ -185,6 +185,20 @@ public class MesProductOrder extends BaseEntity { @Excel(name = "物料名称") private String materialName; + /** + * 单位时间 + */ + @Excel(name = "单位时间") + private Long productionTime; + + public Long getProductionTime() { + return productionTime; + } + + public void setProductionTime(Long productionTime) { + this.productionTime = productionTime; + } + public String getMaterialBomDesc() { return materialBomDesc; } diff --git a/hw-modules/hw-mes/src/main/resources/mapper/mes/MesBaseRouteMapper.xml b/hw-modules/hw-mes/src/main/resources/mapper/mes/MesBaseRouteMapper.xml index 4c12625b..68eaf036 100644 --- a/hw-modules/hw-mes/src/main/resources/mapper/mes/MesBaseRouteMapper.xml +++ b/hw-modules/hw-mes/src/main/resources/mapper/mes/MesBaseRouteMapper.xml @@ -1,62 +1,94 @@ + PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - + - - - - - - - - - + + + + + + + + + + - + - - - - - - - - - + + + + + + + + + - select route_id, route_name, route_desc, active_flag, remark, create_by, create_time, update_by, update_time from mes_base_route + select a.route_id, + a.route_name, + a.route_desc, + a.active_flag, + a.remark, + a.create_by, + a.create_time, + a.update_by, + a.update_time, + sum(p.production_time) production_time + from mes_base_route a + left join mes_base_route_process b on b.route_id = a.route_id + left join mes_base_process_info p on p.process_id = b.process_id - + - + insert into mes_base_route @@ -68,7 +100,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" create_time, update_by, update_time, - + #{routeName}, #{routeDesc}, @@ -78,7 +110,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{createTime}, #{updateBy}, #{updateTime}, - + @@ -97,31 +129,37 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - delete from mes_base_route where route_id = #{routeId} + delete + from mes_base_route + where route_id = #{routeId} - delete from mes_base_route where route_id in + delete from mes_base_route where route_id in #{routeId} - + - delete from mes_base_route_process where route_id in + delete from mes_base_route_process where route_id in #{routeId} - delete from mes_base_route_process where route_id = #{routeId} + delete + from mes_base_route_process + where route_id = #{routeId} - insert into mes_base_route_process( route_process_id, route_id, process_id, process_order, remark, create_by, create_time, update_by, update_time) values - - ( #{item.routeProcessId}, #{item.routeId}, #{item.processId}, #{item.processOrder}, #{item.remark}, #{item.createBy}, #{item.createTime}, #{item.updateBy}, #{item.updateTime}) + insert into mes_base_route_process( route_process_id, route_id, process_id, process_order, remark, create_by, + create_time, update_by, update_time) values + + ( #{item.routeProcessId}, #{item.routeId}, #{item.processId}, #{item.processOrder}, #{item.remark}, + #{item.createBy}, #{item.createTime}, #{item.updateBy}, #{item.updateTime}) diff --git a/hw-modules/hw-mes/src/main/resources/mapper/mes/MesMaterialBomMapper.xml b/hw-modules/hw-mes/src/main/resources/mapper/mes/MesMaterialBomMapper.xml index 335a49c8..d5afa8f7 100644 --- a/hw-modules/hw-mes/src/main/resources/mapper/mes/MesMaterialBomMapper.xml +++ b/hw-modules/hw-mes/src/main/resources/mapper/mes/MesMaterialBomMapper.xml @@ -23,6 +23,7 @@ + @@ -42,6 +43,7 @@ create_time, update_by, update_time, + assemble_time, CONCAT(material_name, '-', material_bom_desc) materialNameDesc from mes_material_bom @@ -89,6 +91,7 @@ create_time, update_by, update_time, + assemble_time, #{parentId}, @@ -106,6 +109,7 @@ #{createTime}, #{updateBy}, #{updateTime}, + #{assembleTime}, @@ -127,6 +131,7 @@ create_time = #{createTime}, update_by = #{updateBy}, update_time = #{updateTime}, + assemble_time = #{assembleTime}, where material_bom_id = #{materialBomId} diff --git a/hw-modules/hw-mes/src/main/resources/mapper/mes/MesProductOrderMapper.xml b/hw-modules/hw-mes/src/main/resources/mapper/mes/MesProductOrderMapper.xml index 60b71953..b4793598 100644 --- a/hw-modules/hw-mes/src/main/resources/mapper/mes/MesProductOrderMapper.xml +++ b/hw-modules/hw-mes/src/main/resources/mapper/mes/MesProductOrderMapper.xml @@ -37,6 +37,7 @@ + @@ -71,9 +72,16 @@ mpo.create_by, mpo.create_time, mpo.update_by, - mpo.update_time + mpo.update_time, + mbr.production_time from mes_product_order mpo - left join mes_base_route mbr on mbr.route_id = mpo.dispatch_id + left join (select a.route_id, + a.route_name, + sum(p.production_time) production_time + from mes_base_route a + left join mes_base_route_process b on b.route_id = a.route_id + left join mes_base_process_info p on p.process_id = b.process_id + group by a.route_id, a.route_name) mbr on mbr.route_id = mpo.dispatch_id left join mes_base_material_info bmi on bmi.material_id = mpo.material_id left join mes_material_bom mb on mb.material_bom_id = mpo.material_bom_id diff --git a/hw-ui/src/main.js b/hw-ui/src/main.js index 13c6cf29..1b770c25 100644 --- a/hw-ui/src/main.js +++ b/hw-ui/src/main.js @@ -18,7 +18,15 @@ import './assets/icons' // icon import './permission' // permission control import { getDicts } from "@/api/system/dict/data"; import { getConfigKey } from "@/api/system/config"; -import { parseTime, resetForm, addDateRange, selectDictLabel, selectDictLabels, handleTree } from "@/utils/ruoyi"; +import { + parseTime, + resetForm, + addDateRange, + selectDictLabel, + selectDictLabels, + handleTree, + formatDayHourMinutes +} from "@/utils/ruoyi"; // 分页组件 import Pagination from "@/components/Pagination"; // 自定义表格工具组件 @@ -48,6 +56,7 @@ Vue.prototype.selectDictLabel = selectDictLabel Vue.prototype.selectDictLabels = selectDictLabels Vue.prototype.download = download Vue.prototype.handleTree = handleTree +Vue.prototype.formatDayHourMinutes = formatDayHourMinutes // 全局组件挂载 Vue.component('DictTag', DictTag) diff --git a/hw-ui/src/utils/ruoyi.js b/hw-ui/src/utils/ruoyi.js index 44bf9c40..4c3b186f 100644 --- a/hw-ui/src/utils/ruoyi.js +++ b/hw-ui/src/utils/ruoyi.js @@ -231,3 +231,21 @@ export function tansParams(params) { export function blobValidate(data) { return data.type !== 'application/json' } + +// 秒转天、小时、分钟 +export function formatDayHourMinutes(seconds) { + const days = Math.floor(seconds / (24 * 60 * 60)); + const hours = Math.floor((seconds % (24 * 60 * 60)) / 3600); + const minutes = Math.floor((seconds % 3600) / 60); + let result = ''; + if (days > 0) { + result += `${days}天`; + } + if (hours > 0) { + result += `${hours}小时`; + } + if (minutes > 0) { + result += `${minutes}分钟`; + } + return result; +} diff --git a/hw-ui/src/views/mes/baseRoute/index.vue b/hw-ui/src/views/mes/baseRoute/index.vue index c09511eb..721d3078 100644 --- a/hw-ui/src/views/mes/baseRoute/index.vue +++ b/hw-ui/src/views/mes/baseRoute/index.vue @@ -70,6 +70,11 @@ + + +