From 3f4fbfc1c4e02b70542b3845f0bc3016aaf10b10 Mon Sep 17 00:00:00 2001 From: "JinLu.Yin" <411641505@qq.com> Date: Mon, 11 Jul 2022 23:02:07 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A6=E6=8E=A7=E5=B1=8F=E7=AB=AF=E7=94=9F?= =?UTF-8?q?=E4=BA=A7=E6=8A=A5=E5=B7=A5=EF=BC=8C=E5=90=88=E6=A0=BC=E5=93=81?= =?UTF-8?q?=E6=95=B0=E9=87=8F=E5=92=8C=E4=B8=8D=E8=89=AF=E5=93=81=E6=95=B0?= =?UTF-8?q?=E9=87=8F=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- doc/设计文档/数据库设计/mes-pro.sql | 3 +++ .../pro/controller/ProTaskMobController.java | 18 ++++++++++---- .../java/com/ktg/mes/pro/domain/ProTask.java | 24 ++++++++++++++++++- .../resources/mapper/pro/ProTaskMapper.xml | 12 +++++++++- 4 files changed, 51 insertions(+), 6 deletions(-) diff --git a/doc/设计文档/数据库设计/mes-pro.sql b/doc/设计文档/数据库设计/mes-pro.sql index 2b7fd15..aeca8ee 100644 --- a/doc/设计文档/数据库设计/mes-pro.sql +++ b/doc/设计文档/数据库设计/mes-pro.sql @@ -218,6 +218,8 @@ create table pro_task ( unit_of_measure varchar(64) not null comment '单位', quantity double(14,2) default 1 not null comment '排产数量', quantity_produced double(14,2) default 0 comment '已生产数量', + quantity_quanlify double(14,2) default 0 comment '合格品数量', + quantity_unquanlify double(14,2) default 0 comment '不良品数量', quantity_changed double(14,2) default 0 comment '调整数量', client_id bigint(20) not null comment '客户ID', client_code varchar(64) not null comment '客户编码', @@ -262,6 +264,7 @@ create table pro_feedback ( quantity_unquanlified double(14,2) comment '不良品数量', user_name varchar(64) comment '报工用户名', nick_name varchar(64) comment '昵称', + feedback_channel varchar(64) comment '报工途径', feedback_time datetime comment '报工时间', remark varchar(500) default '' comment '备注', attr1 varchar(64) default null comment '预留字段1', diff --git a/ktg-mes/src/main/java/com/ktg/mes/pro/controller/ProTaskMobController.java b/ktg-mes/src/main/java/com/ktg/mes/pro/controller/ProTaskMobController.java index ec5e1c1..92f1a30 100644 --- a/ktg-mes/src/main/java/com/ktg/mes/pro/controller/ProTaskMobController.java +++ b/ktg-mes/src/main/java/com/ktg/mes/pro/controller/ProTaskMobController.java @@ -64,12 +64,9 @@ public class ProTaskMobController extends BaseController { } @Log(title = "生产报工", businessType = BusinessType.INSERT) - @PostMapping("/feedBack") + @PostMapping("/feedback") @ResponseBody public AjaxResult feedBack( ProFeedback feedback){ - MdWorkstation workstation = mdWorkstationService.selectMdWorkstationByWorkstationId(feedback.getWorkstationId()); - feedback.setWorkstationCode(workstation.getWorkstationCode()); - feedback.setWorkstationName(workstation.getWorkstationName()); ProTask task = proTaskService.selectProTaskByTaskId(feedback.getTaskId()); feedback.setTaskCode(task.getTaskCode()); @@ -78,6 +75,19 @@ public class ProTaskMobController extends BaseController { feedback.setWorkorderName(task.getWorkorderName()); feedback.setQuantity(task.getQuantity()); feedback.setFeedbackTime(new Date()); + + if(feedback.getWorkstationId() == null){ + feedback.setWorkstationId(task.getWorkstationId()); + } + + MdWorkstation workstation = mdWorkstationService.selectMdWorkstationByWorkstationId(feedback.getWorkstationId()); + feedback.setWorkstationCode(workstation.getWorkstationCode()); + feedback.setWorkstationName(workstation.getWorkstationName()); + + task.setQuantityProduced(task.getQuantityProduced().add(feedback.getQuantityFeedback())); + task.setQuantityQuanlify(task.getQuantityQuanlify().add(feedback.getQuantityQualified())); + task.setQuantityUnquanlify(task.getQuantityUnquanlify().add(feedback.getQuantityUnquanlified())); + proTaskService.updateProTask(task); return toAjax(proFeedbackService.insertProFeedback(feedback)); } diff --git a/ktg-mes/src/main/java/com/ktg/mes/pro/domain/ProTask.java b/ktg-mes/src/main/java/com/ktg/mes/pro/domain/ProTask.java index 29be6f9..917a4af 100644 --- a/ktg-mes/src/main/java/com/ktg/mes/pro/domain/ProTask.java +++ b/ktg-mes/src/main/java/com/ktg/mes/pro/domain/ProTask.java @@ -93,6 +93,10 @@ public class ProTask extends BaseEntity @Excel(name = "已生产数量") private BigDecimal quantityProduced; + private BigDecimal quantityQuanlify; + + private BigDecimal quantityUnquanlify; + /** 调整数量 */ @Excel(name = "调整数量") private BigDecimal quantityChanged; @@ -326,7 +330,23 @@ public class ProTask extends BaseEntity this.quantityChanged = quantityChanged; } - public BigDecimal getQuantityChanged() + public BigDecimal getQuantityQuanlify() { + return quantityQuanlify; + } + + public void setQuantityQuanlify(BigDecimal quantityQuanlify) { + this.quantityQuanlify = quantityQuanlify; + } + + public BigDecimal getQuantityUnquanlify() { + return quantityUnquanlify; + } + + public void setQuantityUnquanlify(BigDecimal quantityUnquanlify) { + this.quantityUnquanlify = quantityUnquanlify; + } + + public BigDecimal getQuantityChanged() { return quantityChanged; } @@ -479,6 +499,8 @@ public class ProTask extends BaseEntity ", unitOfMeasure='" + unitOfMeasure + '\'' + ", quantity=" + quantity + ", quantityProduced=" + quantityProduced + + ", quantityQuanlify=" + quantityQuanlify + + ", quantityUnquanlify=" + quantityUnquanlify + ", quantityChanged=" + quantityChanged + ", clientId=" + clientId + ", clientCode='" + clientCode + '\'' + diff --git a/ktg-mes/src/main/resources/mapper/pro/ProTaskMapper.xml b/ktg-mes/src/main/resources/mapper/pro/ProTaskMapper.xml index 4e1961d..19ab553 100644 --- a/ktg-mes/src/main/resources/mapper/pro/ProTaskMapper.xml +++ b/ktg-mes/src/main/resources/mapper/pro/ProTaskMapper.xml @@ -24,6 +24,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + + @@ -47,7 +49,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - select task_id, task_code, task_name, workorder_id, workorder_code, workorder_name, workstation_id, workstation_code, workstation_name,process_id,process_code,process_name, item_id, item_code, item_name, specification, unit_of_measure, quantity, quantity_produced, quantity_changed, client_id, client_code, client_name, client_nick, start_time, duration, end_time, color_code, request_date, status, remark, attr1, attr2, attr3, attr4, create_by, create_time, update_by, update_time from pro_task + select task_id, task_code, task_name, workorder_id, workorder_code, workorder_name, workstation_id, workstation_code, workstation_name,process_id,process_code,process_name, item_id, item_code, item_name, specification, unit_of_measure, quantity, quantity_produced,quantity_quanlify,quantity_unquanlify, quantity_changed, client_id, client_code, client_name, client_nick, start_time, duration, end_time, color_code, request_date, status, remark, attr1, attr2, attr3, attr4, create_by, create_time, update_by, update_time from pro_task