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