Browse Source

更新日志

master
汪菘 3 years ago
parent
commit
c46a895c46
  1. 30
      nladmin-system/src/main/java/org/nl/acs/device_driver/hailiang/hailiang_coating/HaiLiangCoatingDeviceDriver.java
  2. 37
      nladmin-system/src/main/java/org/nl/acs/device_driver/hailiang/hailiang_feeding/HaiLiangFeedingDeviceDriver.java
  3. 43
      nladmin-system/src/main/java/org/nl/acs/device_driver/hailiang/hailiang_feeding_trunk/HaiLiangFeedingTrunkDeviceDriver.java
  4. 72
      nladmin-system/src/main/java/org/nl/acs/device_driver/hailiang/hailiang_labeling/HaiLiangLabelingDeviceDriver.java
  5. 31
      nladmin-system/src/main/java/org/nl/acs/device_driver/hailiang/hailiang_lettering/HaiLiangLetteringDeviceDriver.java
  6. 31
      nladmin-system/src/main/java/org/nl/acs/device_driver/hailiang/hailiang_risking/HaiLiangRiskingDeviceDriver.java
  7. 29
      nladmin-system/src/main/java/org/nl/acs/device_driver/hailiang/hailiang_strapping/HaiLiangStrappingDeviceDriver.java
  8. 2
      nladmin-system/src/main/java/org/nl/acs/order/service/ProduceshiftorderdetailService.java
  9. 30
      nladmin-system/src/main/java/org/nl/acs/order/service/impl/ProduceshiftorderServiceImpl.java
  10. 2
      nladmin-system/src/main/java/org/nl/acs/order/service/impl/ProduceshiftorderdetailServiceImpl.java
  11. 12
      qd/src/views/acs/order/AddDialog.vue
  12. 12
      qd/src/views/acs/order/index.vue
  13. 6
      qd/src/views/acs/order/sorting/index.vue

30
nladmin-system/src/main/java/org/nl/acs/device_driver/hailiang/hailiang_coating/HaiLiangCoatingDeviceDriver.java

@ -1,5 +1,6 @@
package org.nl.acs.device_driver.hailiang.hailiang_coating;
import cn.hutool.core.date.DateUtil;
import lombok.Data;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
@ -83,6 +84,7 @@ public class HaiLiangCoatingDeviceDriver extends AbstractOpcDeviceDriver impleme
if (mode != last_mode) {
logServer.deviceLog(this.device_code,"mode" ,String.valueOf(mode));
logServer.deviceLogToacs(this.device_code,"","","信号mode:" + last_mode + "->" + mode);
logServer.deviceLogToacs(this.device_code,"","","工作模式切换,刷新请求标记:"+this.requireSucess);
this.setRequireSucess(false);
}
if (move != last_move) {
@ -133,14 +135,29 @@ public class HaiLiangCoatingDeviceDriver extends AbstractOpcDeviceDriver impleme
break;
case 4:
//裹膜完成
if(!requireSucess && order > 0 && order_detail > 0 && detail_qty>0 && detail_qualified_qty>0){
update_detail(String.valueOf(order),String.valueOf(order_detail),"01");
if(!requireSucess){
if(order > 0 && order_detail > 0 && detail_qty>0 && detail_qualified_qty>0){
logServer.deviceLogToacs(this.device_code,"","",device_code+":上报裹膜完成,mode:"+mode+",requireSucess:" + requireSucess + ",order:" + order +",order_detail:"
+order_detail+",detail_qty:"+detail_qty+",detail_qualified_qty:"+detail_qualified_qty);
update_detail(String.valueOf(order),String.valueOf(order_detail),"01");
} else {
logServer.deviceLogToacs(this.device_code,"","",device_code+":上报裹膜完成,mode:"+mode+",requireSucess:" + requireSucess + ",order:" + order +",order_detail:"
+order_detail+",detail_qty:"+detail_qty+",detail_qualified_qty:"+detail_qualified_qty);
}
}
break;
case 5:
//强制裹膜完成
if(!requireSucess && order > 0 && order_detail > 0 && detail_qty>0 && detail_qualified_qty>0 ) {
update_detail(String.valueOf(order),String.valueOf(order_detail),"02");
if(!requireSucess){
if( order > 0 && order_detail > 0 && detail_qty>0 && detail_qualified_qty>0 ) {
logServer.deviceLogToacs(this.device_code,"","",device_code+":上报强制裹膜完成,mode:"+mode+",requireSucess:" + requireSucess + ",order:" + order +",order_detail:"
+order_detail+",detail_qty:"+detail_qty+",detail_qualified_qty:"+detail_qualified_qty);
update_detail(String.valueOf(order),String.valueOf(order_detail),"02");
} else {
logServer.deviceLogToacs(this.device_code,"","",device_code+":上报强制裹膜完成失败,mode:"+mode+",requireSucess:" + requireSucess + ",order:" + order +",order_detail:"
+order_detail+",detail_qty:"+detail_qty+",detail_qualified_qty:"+detail_qualified_qty);
}
}
break;
}
@ -163,9 +180,12 @@ public class HaiLiangCoatingDeviceDriver extends AbstractOpcDeviceDriver impleme
this.detail_time = date;
ProduceshiftorderdetailDto dto = produceshiftorderdetailService.findOrderDetailFromCache(String.valueOf(order), String.valueOf(order_detail));
dto.setWraping_finished(status);
dto.setWraping_finish_time(date.toString());
String now = DateUtil.now();
dto.setWraping_finish_time(now);
produceshiftorderdetailService.update(dto);
writing(itemProtocol.item_to_command,String.valueOf(mode));
requireSucess = true;
this.setRequireSucess(true);
return true;
}
}

37
nladmin-system/src/main/java/org/nl/acs/device_driver/hailiang/hailiang_feeding/HaiLiangFeedingDeviceDriver.java

@ -1,5 +1,6 @@
package org.nl.acs.device_driver.hailiang.hailiang_feeding;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil;
import lombok.Data;
import lombok.RequiredArgsConstructor;
@ -90,6 +91,7 @@ public class HaiLiangFeedingDeviceDriver extends AbstractOpcDeviceDriver impleme
if (mode != last_mode) {
logServer.deviceLog(this.device_code,"mode" ,String.valueOf(mode));
logServer.deviceLogToacs(this.device_code,"","","信号mode:" + last_mode + "->" + mode);
logServer.deviceLogToacs(this.device_code,"","","工作模式切换,刷新请求标记:"+this.requireSucess);
this.setRequireSucess(false);
}
if (error != last_error) {
@ -148,15 +150,31 @@ public class HaiLiangFeedingDeviceDriver extends AbstractOpcDeviceDriver impleme
break;
case 4:
//上料完成
if(!requireSucess && order > 0 && order_detail > 0 && detail_qty>0 && detail_qualified_qty>0){
update_detail(String.valueOf(order),String.valueOf(order_detail),"01");
if(!requireSucess) {
if( order > 0 && order_detail > 0 && detail_qty>0 && detail_qualified_qty>0){
logServer.deviceLogToacs(this.device_code,"","",device_code+":上报上料完成,mode:"+mode+",requireSucess:" + requireSucess + ",order:" + order +",order_detail:"
+order_detail+",detail_qty:"+detail_qty+",detail_qualified_qty:"+detail_qualified_qty);
update_detail(String.valueOf(order),String.valueOf(order_detail),"01");
} else {
logServer.deviceLogToacs(this.device_code,"","",device_code+":上报上料完成失败,mode:"+mode+",requireSucess:" + requireSucess + ",order:" + order +",order_detail:"
+order_detail+",detail_qty:"+detail_qty+",detail_qualified_qty:"+detail_qualified_qty);
}
}
break;
case 5:
//强制上料完成
if(!requireSucess && order > 0 && order_detail > 0 && detail_qty>0 && detail_qualified_qty>0 ) {
update_detail(String.valueOf(order),String.valueOf(order_detail),"02");
if(!requireSucess) {
if( order > 0 && order_detail > 0 && detail_qty>0 && detail_qualified_qty>0 ) {
logServer.deviceLogToacs(this.device_code,"","",device_code+":上报强制上料完成,mode:"+mode+",requireSucess:" + requireSucess + ",order:" + order +",order_detail:"
+order_detail+",detail_qty:"+detail_qty+",detail_qualified_qty:"+detail_qualified_qty);
update_detail(String.valueOf(order),String.valueOf(order_detail),"02");
} else {
logServer.deviceLogToacs(this.device_code,"","",device_code+":上报强制上料完成失败,mode:"+mode+",requireSucess:" + requireSucess + ",order:" + order +",order_detail:"
+order_detail+",detail_qty:"+detail_qty+",detail_qualified_qty:"+detail_qualified_qty);
}
}
break;
}
}
@ -181,12 +199,13 @@ public class HaiLiangFeedingDeviceDriver extends AbstractOpcDeviceDriver impleme
} else {
this.detail_time = date;
ProduceshiftorderdetailDto dto = produceshiftorderdetailService.findOrderDetailFromCache(String.valueOf(order), String.valueOf(order_detail));
if(!StrUtil.equals(dto.getOrder_detail_qty(),String.valueOf(detail_qualified_qty)) ){
logServer.deviceLogToacs(this.device_code,"","","工单明细上料完成,上料合格数量与订单数量不一致");
throw new BadRequestException("工单明细上料完成,上料合格数量与订单数量不一致!");
}
// if(!StrUtil.equals(dto.getOrder_detail_qty(),String.valueOf(detail_qualified_qty)) ){
// logServer.deviceLogToacs(this.device_code,"","","工单明细上料完成,上料合格数量与订单数量不一致");
// throw new BadRequestException("工单明细上料完成,上料合格数量与订单数量不一致!");
// }
dto.setFeeding_finished(status);
dto.setFeeding_finish_time(date.toString());
String now = DateUtil.now();
dto.setFeeding_finish_time(now);
produceshiftorderdetailService.update(dto);
writing(itemProtocol.item_to_command,String.valueOf(mode));
requireSucess = true;

43
nladmin-system/src/main/java/org/nl/acs/device_driver/hailiang/hailiang_feeding_trunk/HaiLiangFeedingTrunkDeviceDriver.java

@ -391,16 +391,27 @@ public class HaiLiangFeedingTrunkDeviceDriver extends AbstractOpcDeviceDriver im
break;
case 3:
//申请工单
if(!requireSucess && ready == 1 && order ==0 && order_detail ==0 ){
logServer.deviceLogToacs(this.device_code,"","","开始申请工单");
apply_order();
if(!requireSucess) {
if( ready == 1 && order ==0 && order_detail ==0 ){
logServer.deviceLogToacs(this.device_code,"","",device_code+":开始申请工单,mode:"+mode+",requireSucess:" + requireSucess + ",order:" + order +",order_detail:"
+order_detail);
apply_order();
} else {
logServer.deviceLogToacs(this.device_code,"","",device_code+":开始申请工单失败,mode:"+mode+",requireSucess:" + requireSucess + ",order:" + order +",order_detail:"
+order_detail);
}
}
break;
case 4:
//申请工单明细
if(!requireSucess && ready == 1 && order != 0 ) {
logServer.deviceLogToacs(this.device_code,"","","开始申请工单明细");
apply_orderDetail(order);
if(!requireSucess) {
if( ready == 1 && order != 0 ) {
logServer.deviceLogToacs(this.device_code,"","",device_code+":开始申请工单明细,mode:"+mode+",requireSucess:" + requireSucess + ",order:" + order +",ready:"+ready);
apply_orderDetail(order);
} else {
logServer.deviceLogToacs(this.device_code,"","",device_code+":开始申请工单明细失败,mode:"+mode+",requireSucess:" + requireSucess + ",order:" + order +",ready:"+ready);
}
}
break;
}
@ -505,14 +516,14 @@ public class HaiLiangFeedingTrunkDeviceDriver extends AbstractOpcDeviceDriver im
this.detail_time= date;
ProduceshiftorderDto dto = produceshiftorderService.findOrderByOrderCodeFromCache(String.valueOf(order));
if(ObjectUtil.isEmpty(dto)){
logServer.deviceLogToacs(this.device_code,"","","修改工单状态失败,order:"+order);
logServer.deviceLogToacs(this.device_code,"","","update_order_status 修改工单状态失败,order:"+order);
return false;
}
//02是已下发
if(!StrUtil.equals(dto.getOrder_status(),status) && StrUtil.equals(dto.getOrder_status(),"02") ){
dto.setOrder_status("03");
produceshiftorderService.autoupdate(dto);
logServer.deviceLogToacs(this.device_code,"","","修改工单状态成功,order:"+order);
logServer.deviceLogToacs(this.device_code,"","","update_order_status 修改工单状态成功,order:"+order);
}
return true;
}
@ -522,7 +533,7 @@ public class HaiLiangFeedingTrunkDeviceDriver extends AbstractOpcDeviceDriver im
public boolean apply_order() throws Exception {
ProduceshiftorderDto dto = produceshiftorderService.apply_order();
if(ObjectUtil.isEmpty(dto)){
logServer.deviceLogToacs(this.device_code,"","","未找到");
logServer.deviceLogToacs(this.device_code,"","","apply_order 未找到可下发工单!");
throw new BadRequestException("未找到可下发工单!");
}
String order = dto.getOrder_code();
@ -566,12 +577,19 @@ public class HaiLiangFeedingTrunkDeviceDriver extends AbstractOpcDeviceDriver im
public boolean apply_orderDetail(int order) throws Exception {
ProduceshiftorderdetailDto dto = produceshiftorderdetailService.apply_orderDetail(String.valueOf(order));
if(ObjectUtil.isEmpty(dto)){
logServer.deviceLogToacs(this.device_code,"","","apply_orderDetail 未找到可下发工单明细!");
throw new BadRequestException("未找到可下发工单明细!");
}
String orderDetail = dto.getOrder_detail_code();
//上料数量
String feeding_qty = dto.getFeeding_qty();
//捆扎包数
String strap_pack_number = dto.getStrap_pack_number();
//每捆数量
String strap_number = dto.getStrap_number();
//尾料数量
String strap_tailint_number = dto.getStrap_tailint_number();
//贴标信息
String str = dto.getLabeling_message();
//判断是否最后一个客户
boolean last_detail = produceshiftorderdetailService.isLastOrderDetail(String.valueOf(order));
@ -594,12 +612,17 @@ public class HaiLiangFeedingTrunkDeviceDriver extends AbstractOpcDeviceDriver im
writing(ItemProtocol.item_to_one_strapping_qty,strap_number);
writing(ItemProtocol.item_to_coating_qty,strap_pack_number);
writing(ItemProtocol.item_to_labeling_qty,strap_pack_number);
writing(ItemProtocol.item_to_lastone_strapping_qty,strap_tailint_number);
writing(ItemProtocol.item_to_command,String.valueOf(mode));
dto.setOrder_detail_status("02");
dto.setOrder_detail_status("01");
produceshiftorderdetailService.update(dto);
send_letter_flag = false;
send_letter_flag_back = false;
requireSucess = true;
} else {
logServer.deviceLogToacs(this.device_code,"","","申请工单明细等待,order:"+order+",orderdetail:"+orderDetail);
}
return true;

72
nladmin-system/src/main/java/org/nl/acs/device_driver/hailiang/hailiang_labeling/HaiLiangLabelingDeviceDriver.java

@ -1,5 +1,6 @@
package org.nl.acs.device_driver.hailiang.hailiang_labeling;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import lombok.Data;
@ -90,6 +91,7 @@ public class HaiLiangLabelingDeviceDriver extends AbstractOpcDeviceDriver implem
if (mode != last_mode) {
logServer.deviceLog(this.device_code,"mode" ,String.valueOf(mode));
logServer.deviceLogToacs(this.device_code,"","","信号mode:" + last_mode + "->" + mode);
logServer.deviceLogToacs(this.device_code,"","","工作模式切换,刷新请求标记:"+this.requireSucess);
this.setRequireSucess(false);
}
if (move != last_move) {
@ -140,32 +142,71 @@ public class HaiLiangLabelingDeviceDriver extends AbstractOpcDeviceDriver implem
break;
case 3:
//申请贴标
if(!requireSucess && order > 0 && order_detail > 0 && detail_qty>0 && detail_qualified_qty>0){
apply_labeling_message(String.valueOf(order),String.valueOf(order_detail),String.valueOf(detail_qty));
if(!requireSucess){
if(order > 0 && order_detail > 0 && detail_qty>0 && detail_qualified_qty>0){
logServer.deviceLogToacs(this.device_code,"","",device_code+":申请贴标,mode:"+mode+",requireSucess:" + requireSucess + ",order:" + order +",order_detail:"
+order_detail+",detail_qty:"+detail_qty+",detail_qualified_qty:"+detail_qualified_qty);
apply_labeling_message(String.valueOf(order),String.valueOf(order_detail),String.valueOf(detail_qty));
} else {
logServer.deviceLogToacs(this.device_code,"","",device_code+":申请贴标失败,mode:"+mode+",requireSucess:" + requireSucess + ",order:" + order +",order_detail:"
+order_detail+",detail_qty:"+detail_qty+",detail_qualified_qty:"+detail_qualified_qty);
}
}
break;
case 5:
//贴标完成
if(!requireSucess && order > 0 && order_detail > 0 && detail_qty>0 && detail_qualified_qty>0){
update_detail(String.valueOf(order),String.valueOf(order_detail),"01");
if(!requireSucess){
if(order > 0 && order_detail > 0 && detail_qty>0 && detail_qualified_qty>0){
logServer.deviceLogToacs(this.device_code,"","",device_code+":申请贴标完成,mode:"+mode+",requireSucess:" + requireSucess + ",order:" + order +",order_detail:"
+order_detail+",detail_qty:"+detail_qty+",detail_qualified_qty:"+detail_qualified_qty);
update_detail(String.valueOf(order),String.valueOf(order_detail),"01");
} else {
logServer.deviceLogToacs(this.device_code,"","",device_code+":申请贴标完成失败,mode:"+mode+",requireSucess:" + requireSucess + ",order:" + order +",order_detail:"
+order_detail+",detail_qty:"+detail_qty+",detail_qualified_qty:"+detail_qualified_qty);
}
}
break;
case 6:
//强制贴标完成
if(!requireSucess && order > 0 && order_detail > 0 && detail_qty>0 && detail_qualified_qty>0 ) {
update_detail(String.valueOf(order),String.valueOf(order_detail),"02");
if(!requireSucess){
if( order > 0 && order_detail > 0 && detail_qty>0 && detail_qualified_qty>0 ) {
logServer.deviceLogToacs(this.device_code,"","",device_code+":申请强制贴标完成,mode:"+mode+",requireSucess:" + requireSucess + ",order:" + order +",order_detail:"
+order_detail+",detail_qty:"+detail_qty+",detail_qualified_qty:"+detail_qualified_qty);
update_detail(String.valueOf(order),String.valueOf(order_detail),"02");
} else {
logServer.deviceLogToacs(this.device_code,"","",device_code+":申请强制贴标完成失败,mode:"+mode+",requireSucess:" + requireSucess + ",order:" + order +",order_detail:"
+order_detail+",detail_qty:"+detail_qty+",detail_qualified_qty:"+detail_qualified_qty);
}
}
break;
//工单完成
case 7:
if(!requireSucess && order > 0 && order_detail > 0 ) {
finish_order(String.valueOf(order),String.valueOf(order_detail),"01");
if(!requireSucess){
if(order > 0 && order_detail > 0 ) {
logServer.deviceLogToacs(this.device_code,"","",device_code+":申请工单完成,mode:"+mode+",requireSucess:" + requireSucess + ",order:" + order +",order_detail:"
+order_detail);
finish_order(String.valueOf(order),String.valueOf(order_detail),"01");
} else {
logServer.deviceLogToacs(this.device_code,"","",device_code+":申请工单完成失败,mode:"+mode+",requireSucess:" + requireSucess + ",order:" + order +",order_detail:"
+order_detail);
}
}
break;
//工单强制完成
case 8:
if(!requireSucess && order > 0 && order_detail > 0 ) {
finish_order(String.valueOf(order),String.valueOf(order_detail),"02");
if(!requireSucess) {
if(order > 0 && order_detail > 0 ) {
logServer.deviceLogToacs(this.device_code,"","",device_code+":申请工单强制完成,mode:"+mode+",requireSucess:" + requireSucess + ",order:" + order +",order_detail:"
+order_detail);
finish_order(String.valueOf(order),String.valueOf(order_detail),"02");
} else {
logServer.deviceLogToacs(this.device_code,"","",device_code+":申请工单强制完成失败,mode:"+mode+",requireSucess:" + requireSucess + ",order:" + order +",order_detail:"
+order_detail);
}
}
break;
}
@ -188,12 +229,13 @@ public class HaiLiangLabelingDeviceDriver extends AbstractOpcDeviceDriver implem
} else {
this.detail_time = date;
ProduceshiftorderdetailDto dto = produceshiftorderdetailService.findOrderDetailFromCache(String.valueOf(order), String.valueOf(order_detail));
if(!StrUtil.equals(dto.getWraping_number(),String.valueOf(detail_qualified_qty)) ){
logServer.deviceLogToacs(this.device_code,"","","工单明细贴标完成,贴标合格数量与订单数量不一致");
throw new BadRequestException("工单明细贴标完成,贴标合格数量与订单数量不一致!");
}
// if(!StrUtil.equals(dto.getWraping_number(),String.valueOf(detail_qualified_qty)) ){
// logServer.deviceLogToacs(this.device_code,"","","工单明细贴标完成,贴标合格数量与订单数量不一致");
// throw new BadRequestException("工单明细贴标完成,贴标合格数量与订单数量不一致!");
// }
dto.setLabeling_finished(status);
dto.setLabeling_finish_time(date.toString());
String now = DateUtil.now();
dto.setLabeling_finish_time(now);
produceshiftorderdetailService.update(dto);
writing(itemProtocol.item_to_command,String.valueOf(mode));
requireSucess = true;

31
nladmin-system/src/main/java/org/nl/acs/device_driver/hailiang/hailiang_lettering/HaiLiangLetteringDeviceDriver.java

@ -1,5 +1,6 @@
package org.nl.acs.device_driver.hailiang.hailiang_lettering;
import cn.hutool.core.date.DateUtil;
import lombok.Data;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
@ -82,6 +83,7 @@ public class HaiLiangLetteringDeviceDriver extends AbstractOpcDeviceDriver imple
if (mode != last_mode) {
logServer.deviceLog(this.device_code,"mode" ,String.valueOf(mode));
logServer.deviceLogToacs(this.device_code,"","","信号mode:" + last_mode + "->" + mode);
logServer.deviceLogToacs(this.device_code,"","","工作模式切换,刷新请求标记:"+this.requireSucess);
this.setRequireSucess(false);
}
if (move != last_move) {
@ -134,14 +136,29 @@ public class HaiLiangLetteringDeviceDriver extends AbstractOpcDeviceDriver imple
case 4:
//刻字完成
if(!requireSucess && order > 0 && order_detail > 0 && detail_qty>0 && detail_qualified_qty>0){
update_detail(String.valueOf(order),String.valueOf(order_detail),"01");
if(!requireSucess) {
if(order > 0 && order_detail > 0 && detail_qty>0 && detail_qualified_qty>0){
logServer.deviceLogToacs(this.device_code,"","",device_code+":上报刻字完成,mode:"+mode+",requireSucess:" + requireSucess + ",order:" + order +",order_detail:"
+order_detail+",detail_qty:"+detail_qty+",detail_qualified_qty:"+detail_qualified_qty);
update_detail(String.valueOf(order),String.valueOf(order_detail),"01");
} else {
logServer.deviceLogToacs(this.device_code,"","",device_code+":上报刻字完成失败,mode:"+mode+",requireSucess:" + requireSucess + ",order:" + order +",order_detail:"
+order_detail+",detail_qty:"+detail_qty+",detail_qualified_qty:"+detail_qualified_qty);
}
}
break;
case 5:
//强制刻字完成
if(!requireSucess && order > 0 && order_detail > 0 && detail_qty>0 && detail_qualified_qty>0 ) {
update_detail(String.valueOf(order),String.valueOf(order_detail),"02");
if(!requireSucess) {
if(order > 0 && order_detail > 0 && detail_qty>0 && detail_qualified_qty>0){
logServer.deviceLogToacs(this.device_code,"","",device_code+":上报强制刻字完成,mode:"+mode+",requireSucess:" + requireSucess + ",order:" + order +",order_detail:"
+order_detail+",detail_qty:"+detail_qty+",detail_qualified_qty:"+detail_qualified_qty);
update_detail(String.valueOf(order),String.valueOf(order_detail),"02");
} else {
logServer.deviceLogToacs(this.device_code,"","",device_code+":上报强制刻字完成失败,mode:"+mode+",requireSucess:" + requireSucess + ",order:" + order +",order_detail:"
+order_detail+",detail_qty:"+detail_qty+",detail_qualified_qty:"+detail_qualified_qty);
}
}
break;
}
@ -164,10 +181,12 @@ public class HaiLiangLetteringDeviceDriver extends AbstractOpcDeviceDriver imple
} else {
this.detail_time = date;
ProduceshiftorderdetailDto dto = produceshiftorderdetailService.findOrderDetailFromCache(String.valueOf(order), String.valueOf(order_detail));
dto.setLabeling_finished(status);
dto.setLabeling_finish_time(date.toString());
dto.setLettering_finished(status);
String now = DateUtil.now();
dto.setLabeling_finish_time(now);
produceshiftorderdetailService.update(dto);
writing(itemProtocol.item_to_command,String.valueOf(mode));
requireSucess = true;
return true;
}
}

31
nladmin-system/src/main/java/org/nl/acs/device_driver/hailiang/hailiang_risking/HaiLiangRiskingDeviceDriver.java

@ -1,5 +1,6 @@
package org.nl.acs.device_driver.hailiang.hailiang_risking;
import cn.hutool.core.date.DateUtil;
import lombok.Data;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
@ -83,6 +84,7 @@ public class HaiLiangRiskingDeviceDriver extends AbstractOpcDeviceDriver impleme
if (mode != last_mode) {
logServer.deviceLog(this.device_code,"mode" ,String.valueOf(mode));
logServer.deviceLogToacs(this.device_code,"","","信号mode:" + last_mode + "->" + mode);
logServer.deviceLogToacs(this.device_code,"","","工作模式切换,刷新请求标记:"+this.requireSucess);
this.setRequireSucess(false);
}
if (move != last_move) {
@ -133,14 +135,29 @@ public class HaiLiangRiskingDeviceDriver extends AbstractOpcDeviceDriver impleme
break;
case 4:
//套冒完成
if(!requireSucess && order > 0 && order_detail > 0 && detail_qty>0 && detail_qualified_qty>0){
update_detail(String.valueOf(order),String.valueOf(order_detail),"01");
if(!requireSucess) {
if( order > 0 && order_detail > 0 && detail_qty>0 && detail_qualified_qty>0){
logServer.deviceLogToacs(this.device_code,"","",device_code+":上报套冒完成,mode:"+mode+",requireSucess:" + requireSucess + ",order:" + order +",order_detail:"
+order_detail+",detail_qty:"+detail_qty+",detail_qualified_qty:"+detail_qualified_qty);
update_detail(String.valueOf(order),String.valueOf(order_detail),"01");
} else {
logServer.deviceLogToacs(this.device_code,"","",device_code+":上报套冒完成失败,mode:"+mode+",requireSucess:" + requireSucess + ",order:" + order +",order_detail:"
+order_detail+",detail_qty:"+detail_qty+",detail_qualified_qty:"+detail_qualified_qty);
}
}
break;
case 5:
//强制上料完成
if(!requireSucess && order > 0 && order_detail > 0 && detail_qty>0 && detail_qualified_qty>0 ) {
update_detail(String.valueOf(order),String.valueOf(order_detail),"02");
//强制套冒完成
if(!requireSucess) {
if( order > 0 && order_detail > 0 && detail_qty>0 && detail_qualified_qty>0){
logServer.deviceLogToacs(this.device_code,"","",device_code+":上报强制套冒完成,mode:"+mode+",requireSucess:" + requireSucess + ",order:" + order +",order_detail:"
+order_detail+",detail_qty:"+detail_qty+",detail_qualified_qty:"+detail_qualified_qty);
update_detail(String.valueOf(order),String.valueOf(order_detail),"02");
} else {
logServer.deviceLogToacs(this.device_code,"","",device_code+":上报强制套冒完成失败,mode:"+mode+",requireSucess:" + requireSucess + ",order:" + order +",order_detail:"
+order_detail+",detail_qty:"+detail_qty+",detail_qualified_qty:"+detail_qualified_qty);
}
}
break;
}
@ -164,9 +181,11 @@ public class HaiLiangRiskingDeviceDriver extends AbstractOpcDeviceDriver impleme
this.detail_time = date;
ProduceshiftorderdetailDto dto = produceshiftorderdetailService.findOrderDetailFromCache(String.valueOf(order), String.valueOf(order_detail));
dto.setSleeveing_finished(status);
dto.setSleeveing_finish_time(date.toString());
String now = DateUtil.now();
dto.setSleeveing_finish_time(now);
produceshiftorderdetailService.update(dto);
writing(itemProtocol.item_to_command,String.valueOf(mode));
requireSucess = true;
return true;
}
}

29
nladmin-system/src/main/java/org/nl/acs/device_driver/hailiang/hailiang_strapping/HaiLiangStrappingDeviceDriver.java

@ -1,5 +1,6 @@
package org.nl.acs.device_driver.hailiang.hailiang_strapping;
import cn.hutool.core.date.DateUtil;
import lombok.Data;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
@ -88,6 +89,7 @@ public class HaiLiangStrappingDeviceDriver extends AbstractOpcDeviceDriver imple
if (mode != last_mode) {
logServer.deviceLog(this.device_code,"mode" ,String.valueOf(mode));
logServer.deviceLogToacs(this.device_code,"","","信号mode:" + last_mode + "->" + mode);
logServer.deviceLogToacs(this.device_code,"","","工作模式切换,刷新请求标记:"+this.requireSucess);
this.setRequireSucess(false);
}
if (move != last_move) {
@ -146,14 +148,29 @@ public class HaiLiangStrappingDeviceDriver extends AbstractOpcDeviceDriver imple
break;
case 4:
//捆扎完成
if(!requireSucess && order > 0 && order_detail > 0 && detail_qty>0 && detail_qualified_qty>0){
update_detail(String.valueOf(order),String.valueOf(order_detail),"01");
if(!requireSucess) {
if(order > 0 && order_detail > 0 && detail_qty>0 && detail_qualified_qty>0){
logServer.deviceLogToacs(this.device_code,"","",device_code+":上报捆扎完成,mode:"+mode+",requireSucess:" + requireSucess + ",order:" + order +",order_detail:"
+order_detail+",detail_qty:"+detail_qty+",detail_qualified_qty:"+detail_qualified_qty);
update_detail(String.valueOf(order),String.valueOf(order_detail),"01");
} else {
logServer.deviceLogToacs(this.device_code,"","",device_code+":上报捆扎完成失败,mode:"+mode+",requireSucess:" + requireSucess + ",order:" + order +",order_detail:"
+order_detail+",detail_qty:"+detail_qty+",detail_qualified_qty:"+detail_qualified_qty);
}
}
break;
case 5:
//强制捆扎完成
if(!requireSucess && order > 0 && order_detail > 0 && detail_qty>0 && detail_qualified_qty>0 ) {
update_detail(String.valueOf(order),String.valueOf(order_detail),"02");
if(!requireSucess) {
if(order > 0 && order_detail > 0 && detail_qty>0 && detail_qualified_qty>0){
logServer.deviceLogToacs(this.device_code,"","",device_code+":上报强制捆扎完成,mode:"+mode+",requireSucess:" + requireSucess + ",order:" + order +",order_detail:"
+order_detail+",detail_qty:"+detail_qty+",detail_qualified_qty:"+detail_qualified_qty);
update_detail(String.valueOf(order),String.valueOf(order_detail),"02");
} else {
logServer.deviceLogToacs(this.device_code,"","",device_code+":上报强制捆扎完成失败,mode:"+mode+",requireSucess:" + requireSucess + ",order:" + order +",order_detail:"
+order_detail+",detail_qty:"+detail_qty+",detail_qualified_qty:"+detail_qualified_qty);
}
}
break;
}
@ -178,9 +195,11 @@ public class HaiLiangStrappingDeviceDriver extends AbstractOpcDeviceDriver imple
this.detail_time = date;
ProduceshiftorderdetailDto dto = produceshiftorderdetailService.findOrderDetailFromCache(String.valueOf(order), String.valueOf(order_detail));
dto.setStrap_finished(status);
dto.setStrap_finish_time(date.toString());
String now = DateUtil.now();
dto.setStrap_finish_time(now);
produceshiftorderdetailService.update(dto);
writing(itemProtocol.item_to_command,String.valueOf(mode));
requireSucess = true;
return true;
}
}

2
nladmin-system/src/main/java/org/nl/acs/order/service/ProduceshiftorderdetailService.java

@ -86,4 +86,6 @@ public interface ProduceshiftorderdetailService {
Boolean isLastOrderDetail(String order);
void reload();
}

30
nladmin-system/src/main/java/org/nl/acs/order/service/impl/ProduceshiftorderServiceImpl.java

@ -64,6 +64,7 @@ public class ProduceshiftorderServiceImpl implements ProduceshiftorderService, A
public synchronized void reload() {
this.order = this.queryAllOrder("(order_status !='07' and order_status !='08' and order_status !='09') and is_deleted =0");
produceshiftorderdetailService.reload();
}
@Override
@ -258,6 +259,8 @@ public class ProduceshiftorderServiceImpl implements ProduceshiftorderService, A
String strap_number = detaildto.getStrap_number();
//尾料数量
String strap_tailint_number = String.valueOf(Integer.parseInt(detail_qty)%Integer.parseInt(strap_number));
//捆扎包数
Double pack =Math.ceil((double)Integer.parseInt(detail_qty)/Integer.parseInt(strap_number));
detaildto.setOrder_id(order_id);
detaildto.setOrder_code(order_code);
detaildto.setOrder_detail_status("00");
@ -278,6 +281,7 @@ public class ProduceshiftorderServiceImpl implements ProduceshiftorderService, A
detaildto.setLettering_message2(lettering_message2);
detaildto.setLabeling_template(labeling_template);
detaildto.setStrap_number(strap_number);
detaildto.setStrap_pack_number(String.valueOf(pack.intValue()));
detaildto.setStrap_tailint_number(strap_tailint_number);
WQLObject wo = WQLObject.getWQLObject("acs_produceshiftorderdetail");
JSONObject json = (JSONObject) JSONObject.toJSON(detaildto);
@ -292,9 +296,6 @@ public class ProduceshiftorderServiceImpl implements ProduceshiftorderService, A
public void update(ProduceshiftorderDto dto) {
ProduceshiftorderDto entity = this.findById(dto.getOrder_id());
if (entity == null) throw new BadRequestException("被删除或无权限,操作失败!");
if(!StrUtil.equals(entity.getOrder_status(),"00")){
throw new BadRequestException("单据状态非就绪,修改失败!");
}
String currentUsername = SecurityUtils.getCurrentUsername();
String now = DateUtil.now();
dto.setUpdate_time(now);
@ -311,7 +312,7 @@ public class ProduceshiftorderServiceImpl implements ProduceshiftorderService, A
iterator.remove();
}
}
if (!StrUtil.equals(dto.getOrder_id(), "07") || !StrUtil.equals(dto.getOrder_id(), "08")) {
if (!StrUtil.equals(dto.getOrder_id(), "07") && !StrUtil.equals(dto.getOrder_id(), "08") && !StrUtil.equals(dto.getOrder_id(), "09")) {
order.add(dto);
}
}
@ -492,6 +493,17 @@ public class ProduceshiftorderServiceImpl implements ProduceshiftorderService, A
entity.setOrder_status("01");
JSONObject json= (JSONObject) JSONObject.toJSON(entity);
wo.update(json);
Iterator<ProduceshiftorderDto> iterator = order.iterator();
while (iterator.hasNext()) {
ProduceshiftorderDto produceshiftorderDto = iterator.next();
if (produceshiftorderDto.getOrder_id().equals(entity.getOrder_id())) {
iterator.remove();
}
}
if (!StrUtil.equals(entity.getOrder_id(), "07") && !StrUtil.equals(entity.getOrder_id(), "08") && !StrUtil.equals(entity.getOrder_id(), "09")) {
order.add(entity);
}
}
@Override
@ -716,11 +728,11 @@ public class ProduceshiftorderServiceImpl implements ProduceshiftorderService, A
}
@Override
public ProduceshiftorderDto findOrderByOrderCodeFromCache(String order_id) {
public ProduceshiftorderDto findOrderByOrderCodeFromCache(String order_code) {
Iterator var3 = order.iterator();
while (var3.hasNext()) {
ProduceshiftorderDto oneorder = (ProduceshiftorderDto) var3.next();
if (StrUtil.equals(oneorder.getOrder_id(), order_id)) {
if (StrUtil.equals(oneorder.getOrder_code(), order_code)) {
return oneorder;
}
}
@ -728,11 +740,11 @@ public class ProduceshiftorderServiceImpl implements ProduceshiftorderService, A
}
@Override
public ProduceshiftorderDto findOrderByOrderIdFromCache(String order_code) {
public ProduceshiftorderDto findOrderByOrderIdFromCache(String order_id) {
Iterator var3 = order.iterator();
while (var3.hasNext()) {
ProduceshiftorderDto oneorder = (ProduceshiftorderDto) var3.next();
if (StrUtil.equals(oneorder.getOrder_code(), order_code)) {
if (StrUtil.equals(oneorder.getOrder_id(), order_id)) {
return oneorder;
}
}
@ -770,7 +782,7 @@ public class ProduceshiftorderServiceImpl implements ProduceshiftorderService, A
@Override
public Map<String, Object> querySorting(Map whereJson, Pageable page) {
WQLObject wo = WQLObject.getWQLObject("acs_produceshiftorder");
String where = "1=1 and (order_status !='00' and order_status !='07' and order_status !='08' ) and is_deleted= '0'";
String where = "1=1 and (order_status !='00' and order_status !='07' and order_status !='08' and order_status !='09' ) and is_deleted= '0'";
ResultBean rb = wo.pagequery(WqlUtil.getHttpContext(page), where, "order_id desc");
final JSONObject json = rb.pageResult();
JSONArray newja = new JSONArray();

2
nladmin-system/src/main/java/org/nl/acs/order/service/impl/ProduceshiftorderdetailServiceImpl.java

@ -280,7 +280,7 @@ public class ProduceshiftorderdetailServiceImpl implements Produceshiftorderdeta
public ProduceshiftorderdetailDto apply_orderDetail(String order) {
ProduceshiftorderdetailDto order_detail = this.findOrderDetailByOrderFromCache(order,"00");
if(ObjectUtil.isEmpty(order_detail)){
throw new BadRequestException("未找到处于就绪状态的工单明细!");
return null;
}
return order_detail;
}

12
qd/src/views/acs/order/AddDialog.vue

@ -157,12 +157,12 @@
</el-select>
</template>
</el-table-column>
<el-table-column prop="priority" label="优先级" align="center">
<template scope="scope">
<el-input v-show="!scope.row.edit" v-model="scope.row.priority" size="mini" />
<span v-show="scope.row.edit">{{ scope.row.priority }}</span>
</template>
</el-table-column>
<!-- <el-table-column prop="priority" label="优先级" align="center">-->
<!-- <template scope="scope">-->
<!-- <el-input v-show="!scope.row.edit" v-model="scope.row.priority" size="mini" />-->
<!-- <span v-show="scope.row.edit">{{ scope.row.priority }}</span>-->
<!-- </template>-->
<!-- </el-table-column>-->
<el-table-column v-if="crud.status.cu > 0" align="center" label="操作" width="170" fixed="right">
<template scope="scope">

12
qd/src/views/acs/order/index.vue

@ -113,12 +113,12 @@
<el-table-column prop="cust_name" label="客户名称" />
<el-table-column prop="create_by" label="创建者" />
<el-table-column prop="create_time" label="创建时间" />
<el-table-column label="操作" width="200px" align="center" fixed="right">
<template slot-scope="scope">
<el-button v-if="scope.row.is_flag ==='0'" type="text" size="small" @click="handleClick(scope.row,'1')">修改</el-button>
<el-button v-if="scope.row.is_flag ==='0'" type="text" size="small" @click="handleClick(scope.row,'2')">删除</el-button>
</template>
</el-table-column>
<!-- <el-table-column label="操作" width="200px" align="center" fixed="right">-->
<!-- <template slot-scope="scope">-->
<!-- <el-button v-if="scope.row.is_flag ==='0'" type="text" size="small" @click="handleClick(scope.row,'1')">修改</el-button>-->
<!-- <el-button v-if="scope.row.is_flag ==='0'" type="text" size="small" @click="handleClick(scope.row,'2')">删除</el-button>-->
<!-- </template>-->
<!-- </el-table-column>-->
</el-table>
<!--分页组件-->
<pagination />

6
qd/src/views/acs/order/sorting/index.vue

@ -84,6 +84,7 @@
<span v-if="scope.row.order_status==='06' && scope.row.is_flag ==='1' ">下发强制完成</span>
<span v-if="scope.row.order_status==='07' && scope.row.is_flag ==='1' ">强制完成</span>
<span v-if="scope.row.order_status==='08' && scope.row.is_flag ==='1' ">自动完成</span>
<span v-if="scope.row.order_status==='09' && scope.row.is_flag ==='1' ">取消</span>
<span v-if="scope.row.order_status==='00' && scope.row.is_flag ==='0' ">就绪</span>
<span v-if="scope.row.order_status==='01' && scope.row.is_flag ==='0' ">分拣中</span>
<span v-if="scope.row.order_status==='02' && scope.row.is_flag ==='0' ">下发暂停</span>
@ -91,6 +92,7 @@
<span v-if="scope.row.order_status==='04' && scope.row.is_flag ==='0' ">下发强制完成</span>
<span v-if="scope.row.order_status==='05' && scope.row.is_flag ==='0' ">强制完成</span>
<span v-if="scope.row.order_status==='06' && scope.row.is_flag ==='0' ">自动完成</span>
<span v-if="scope.row.order_status==='07' && scope.row.is_flag ==='0' ">取消</span>
</template>
</el-table-column>
<el-table-column prop="material_code" label="物料编码" />
@ -247,8 +249,8 @@ export default {
mounted() {
//
const timer = setInterval(() => {
// this.crud.toQueryNoLoading()
}, 1000)
this.crud.toQueryNoLoading()
}, 5000)
//
this.$once('hook:beforeDestroy', () => {
clearInterval(timer)

Loading…
Cancel
Save