工单号字段更新
This commit is contained in:
@@ -76,8 +76,8 @@ public class ItemProtocol {
|
||||
return this.getOpcStringValue(item_material);
|
||||
}
|
||||
|
||||
public int getOrder_No() {
|
||||
return this.getOpcIntegerValue(item_order_No);
|
||||
public String getOrder_No() {
|
||||
return this.getOpcStringValue(item_order_No);
|
||||
}
|
||||
|
||||
public int getMix_num() {
|
||||
@@ -88,8 +88,8 @@ public class ItemProtocol {
|
||||
return this.getOpcIntegerValue(item_to_error);
|
||||
}
|
||||
|
||||
public int getTo_order_No() {
|
||||
return this.getOpcIntegerValue(item_to_order_No);
|
||||
public String getTo_order_No() {
|
||||
return this.getOpcStringValue(item_to_order_No);
|
||||
}
|
||||
|
||||
public int getTo_command() {
|
||||
|
||||
@@ -105,8 +105,8 @@ public class LnshMixingMillDeviceDriver extends AbstractOpcDeviceDriver implemen
|
||||
int last_error_time = 0;
|
||||
int weight = 0;
|
||||
int last_weight = 0;
|
||||
int order_No = 0;
|
||||
int last_order_No = 0;
|
||||
String order_No = "0";
|
||||
String last_order_No = "0";
|
||||
int mix_num = 0;
|
||||
int last_mix_num = 0;
|
||||
String material;
|
||||
@@ -173,8 +173,8 @@ public class LnshMixingMillDeviceDriver extends AbstractOpcDeviceDriver implemen
|
||||
logServer.deviceLog(this.device_code,"material" ,String.valueOf(material));
|
||||
logServer.deviceLogToacs(this.device_code,"","","信号material:" + last_material + "->" + material);
|
||||
}
|
||||
if (order_No != last_order_No) {
|
||||
logServer.deviceLog(this.device_code,"order_No" ,String.valueOf(order_No));
|
||||
if (!StrUtil.equals(order_No,last_order_No)) {
|
||||
logServer.deviceLog(this.device_code,"order_No" ,order_No);
|
||||
logServer.deviceLogToacs(this.device_code,"","","信号order_No:" + last_order_No + "->" + order_No);
|
||||
}
|
||||
if (mix_num != last_mix_num) {
|
||||
@@ -215,7 +215,7 @@ public class LnshMixingMillDeviceDriver extends AbstractOpcDeviceDriver implemen
|
||||
break;
|
||||
case 3:
|
||||
//排产单确认
|
||||
if (!requireSucess && order_No != 0) {
|
||||
if (!requireSucess && !order_No.equals("0")) {
|
||||
JSONObject json = new JSONObject();
|
||||
json.put("producetask_code",order_No);
|
||||
json.put("device_code",this.device_code);
|
||||
@@ -227,7 +227,7 @@ public class LnshMixingMillDeviceDriver extends AbstractOpcDeviceDriver implemen
|
||||
break;
|
||||
case 4:
|
||||
//工单完成
|
||||
if (!requireSucess && order_No != 0) {
|
||||
if (!requireSucess && !order_No.equals("0")) {
|
||||
JSONObject json = new JSONObject();
|
||||
json.put("producetask_code",order_No);
|
||||
json.put("device_code",this.device_code);
|
||||
@@ -281,7 +281,7 @@ public class LnshMixingMillDeviceDriver extends AbstractOpcDeviceDriver implemen
|
||||
JSONObject jsonObject = JSON.parseObject(result.body());
|
||||
if (result.getStatus() == 200 && jsonObject.get("status").equals("200")) {
|
||||
this.writing(this.mode);
|
||||
ProduceshiftorderDto dto = produceshiftorderService.findByCode(String.valueOf(order_No));
|
||||
ProduceshiftorderDto dto = produceshiftorderService.findByCode(order_No);
|
||||
if (this.mode == 4) {
|
||||
dto.setOrder_status("2");
|
||||
} else if (this.mode == 3) {
|
||||
|
||||
@@ -208,8 +208,8 @@ public class ItemProtocol {
|
||||
return this.getOpcIntegerValue(item_error_time);
|
||||
}
|
||||
|
||||
public int getOrder_No() {
|
||||
return this.getOpcIntegerValue(item_order_No);
|
||||
public String getOrder_No() {
|
||||
return this.getOpcStringValue(item_order_No);
|
||||
}
|
||||
|
||||
public int getProduct_code() {
|
||||
@@ -468,8 +468,8 @@ public class ItemProtocol {
|
||||
return this.getOpcIntegerValue(item_to_material_code);
|
||||
}
|
||||
|
||||
public int getTo_order_No() {
|
||||
return this.getOpcIntegerValue(item_to_order_No);
|
||||
public String getTo_order_No() {
|
||||
return this.getOpcStringValue(item_to_order_No);
|
||||
}
|
||||
|
||||
public int getToProduct_code() {
|
||||
|
||||
@@ -110,8 +110,8 @@ public class LnshPackagePalletManipulatorDeviceDriver extends AbstractOpcDeviceD
|
||||
String last_barcode;
|
||||
String material;
|
||||
String last_material;
|
||||
int order_No = 0;
|
||||
int last_order_No = 0;
|
||||
String order_No = "0";
|
||||
String last_order_No = "0";
|
||||
int qty = 0;
|
||||
int last_qty = 0;
|
||||
|
||||
@@ -362,8 +362,8 @@ public class LnshPackagePalletManipulatorDeviceDriver extends AbstractOpcDeviceD
|
||||
logServer.deviceLog(this.device_code,"qty" ,String.valueOf(qty));
|
||||
logServer.deviceLogToacs(this.device_code,"","","信号qty:" + last_qty + "->" + qty);
|
||||
}
|
||||
if (order_No != last_order_No) {
|
||||
logServer.deviceLog(this.device_code,"order_No" ,String.valueOf(order_No));
|
||||
if (!StrUtil.equals(order_No,last_order_No)) {
|
||||
logServer.deviceLog(this.device_code,"order_No" ,order_No);
|
||||
logServer.deviceLogToacs(this.device_code,"","","信号order_No:" + last_order_No + "->" + order_No);
|
||||
}
|
||||
if (product_code != last_product_code) {
|
||||
@@ -632,7 +632,7 @@ public class LnshPackagePalletManipulatorDeviceDriver extends AbstractOpcDeviceD
|
||||
break;
|
||||
case 4:
|
||||
//排产单确认
|
||||
if (!requireSucess && order_No != 0) {
|
||||
if (!requireSucess && !order_No.equals("0")) {
|
||||
JSONObject json = new JSONObject();
|
||||
json.put("producetask_code",order_No);
|
||||
json.put("device_code",this.device_code);
|
||||
@@ -667,7 +667,7 @@ public class LnshPackagePalletManipulatorDeviceDriver extends AbstractOpcDeviceD
|
||||
}
|
||||
case 9:
|
||||
//工单完成
|
||||
if (!requireSucess && order_No != 0) {
|
||||
if (!requireSucess && !order_No.equals("0")) {
|
||||
JSONObject json = new JSONObject();
|
||||
json.put("producetask_code",order_No);
|
||||
json.put("device_code",this.device_code);
|
||||
@@ -791,7 +791,7 @@ public class LnshPackagePalletManipulatorDeviceDriver extends AbstractOpcDeviceD
|
||||
JSONObject jsonObject = JSONObject.parseObject(result.body());
|
||||
if (result.getStatus() == 200 && jsonObject.get("status").equals("200")) {
|
||||
this.writing(this.mode);
|
||||
ProduceshiftorderDto dto = produceshiftorderService.findByCode(String.valueOf(order_No));
|
||||
ProduceshiftorderDto dto = produceshiftorderService.findByCode(order_No);
|
||||
if (this.mode == 4) {
|
||||
dto.setOrder_status("0");
|
||||
} else if (this.mode == 9) {
|
||||
|
||||
@@ -90,8 +90,8 @@ public class ItemProtocol {
|
||||
return this.getOpcIntegerValue(item_unqualified);
|
||||
}
|
||||
|
||||
public int getOrder_No() {
|
||||
return this.getOpcIntegerValue(item_order_No);
|
||||
public String getOrder_No() {
|
||||
return this.getOpcStringValue(item_order_No);
|
||||
}
|
||||
|
||||
public int getTo_command() {
|
||||
@@ -102,8 +102,8 @@ public class ItemProtocol {
|
||||
return this.getOpcIntegerValue(item_to_error);
|
||||
}
|
||||
|
||||
public int getTo_order_No() {
|
||||
return this.getOpcIntegerValue(item_to_order_No);
|
||||
public String getTo_order_No() {
|
||||
return this.getOpcStringValue(item_to_order_No);
|
||||
}
|
||||
|
||||
public int getTo_qty() {
|
||||
|
||||
@@ -110,8 +110,8 @@ public class LnshPressDeviceDriver extends AbstractOpcDeviceDriver implements De
|
||||
int last_qualified = 0;
|
||||
int unqualified = 0;
|
||||
int last_unqualified = 0;
|
||||
int order_No = 0;
|
||||
int last_order_No = 0;
|
||||
String order_No = "0";
|
||||
String last_order_No = "0";
|
||||
|
||||
@Override
|
||||
public Device getDevice() {
|
||||
@@ -187,8 +187,8 @@ public class LnshPressDeviceDriver extends AbstractOpcDeviceDriver implements De
|
||||
logServer.deviceLog(this.device_code,"unqualified" ,String.valueOf(unqualified));
|
||||
logServer.deviceLogToacs(this.device_code,"","","信号unqualified:" + last_unqualified + "->" + unqualified);
|
||||
}
|
||||
if (order_No != last_order_No) {
|
||||
logServer.deviceLog(this.device_code,"order_No" ,String.valueOf(order_No));
|
||||
if (!StrUtil.equals(order_No,last_order_No)) {
|
||||
logServer.deviceLog(this.device_code,"order_No" ,order_No);
|
||||
logServer.deviceLogToacs(this.device_code,"","","信号order_No:" + last_order_No + "->" + order_No);
|
||||
}
|
||||
|
||||
@@ -225,7 +225,7 @@ public class LnshPressDeviceDriver extends AbstractOpcDeviceDriver implements De
|
||||
break;
|
||||
case 3:
|
||||
//排产单确认
|
||||
if (!requireSucess && order_No != 0) {
|
||||
if (!requireSucess && !order_No.equals("0")) {
|
||||
JSONObject json = new JSONObject();
|
||||
json.put("producetask_code",order_No);
|
||||
json.put("device_code",this.device_code);
|
||||
@@ -238,7 +238,7 @@ public class LnshPressDeviceDriver extends AbstractOpcDeviceDriver implements De
|
||||
break;
|
||||
case 4:
|
||||
//工单完成反馈
|
||||
if (!requireSucess && order_No != 0) {
|
||||
if (!requireSucess && !order_No.equals("0")) {
|
||||
JSONObject json = new JSONObject();
|
||||
json.put("producetask_code",order_No);
|
||||
json.put("device_code",this.device_code);
|
||||
@@ -304,7 +304,7 @@ public class LnshPressDeviceDriver extends AbstractOpcDeviceDriver implements De
|
||||
HttpResponse result = acsToWmsService.enterOrder(json);
|
||||
if (result.getStatus() == 200) {
|
||||
this.writing(this.mode);
|
||||
ProduceshiftorderDto dto = produceshiftorderService.findByCode(String.valueOf(order_No));
|
||||
ProduceshiftorderDto dto = produceshiftorderService.findByCode(order_No);
|
||||
if (this.mode == 4) {
|
||||
dto.setOrder_status("2");
|
||||
} else if (this.mode == 3){
|
||||
|
||||
@@ -228,8 +228,8 @@ public class ItemProtocol {
|
||||
return this.getOpcIntegerValue(item_error_time);
|
||||
}
|
||||
|
||||
public int getOrder_No() {
|
||||
return this.getOpcIntegerValue(item_order_No);
|
||||
public String getOrder_No() {
|
||||
return this.getOpcStringValue(item_order_No);
|
||||
}
|
||||
|
||||
public int getTotal_split() {
|
||||
@@ -493,8 +493,8 @@ public class ItemProtocol {
|
||||
return this.getOpcIntegerValue(item_to_material_code);
|
||||
}
|
||||
|
||||
public int getTo_order_No() {
|
||||
return this.getOpcIntegerValue(item_to_order_No);
|
||||
public String getTo_order_No() {
|
||||
return this.getOpcStringValue(item_to_order_No);
|
||||
}
|
||||
|
||||
public int getToProduct_code() {
|
||||
|
||||
@@ -103,8 +103,8 @@ public class RljnPackagePalletSplitManipulatorDeviceDriver extends AbstractOpcDe
|
||||
String last_barcode;
|
||||
String material;
|
||||
String last_material;
|
||||
int order_No = 0;
|
||||
int last_order_No = 0;
|
||||
String order_No = "0";
|
||||
String last_order_No = "0";
|
||||
int qty = 0;
|
||||
int last_qty = 0;
|
||||
//开关机状态
|
||||
@@ -391,8 +391,8 @@ public class RljnPackagePalletSplitManipulatorDeviceDriver extends AbstractOpcDe
|
||||
logServer.deviceLog(this.device_code,"batch" ,String.valueOf(batch));
|
||||
logServer.deviceLogToacs(this.device_code,"","","信号batch:" + last_batch + "->" + batch);
|
||||
}
|
||||
if (order_No != last_order_No) {
|
||||
logServer.deviceLog(this.device_code,"order_No" ,String.valueOf(order_No));
|
||||
if (!StrUtil.equals(order_No,last_order_No)) {
|
||||
logServer.deviceLog(this.device_code,"order_No" ,order_No);
|
||||
logServer.deviceLogToacs(this.device_code,"","","信号order_No:" + last_order_No + "->" + order_No);
|
||||
}
|
||||
if (total_split != last_total_split) {
|
||||
@@ -665,7 +665,7 @@ public class RljnPackagePalletSplitManipulatorDeviceDriver extends AbstractOpcDe
|
||||
break;
|
||||
case 4:
|
||||
//排产单确认
|
||||
if (!requireSucess && order_No != 0) {
|
||||
if (!requireSucess && !order_No.equals("0")) {
|
||||
JSONObject json = new JSONObject();
|
||||
json.put("producetask_code",order_No);
|
||||
json.put("device_code",this.device_code);
|
||||
@@ -700,7 +700,7 @@ public class RljnPackagePalletSplitManipulatorDeviceDriver extends AbstractOpcDe
|
||||
}
|
||||
case 9:
|
||||
//工单完成
|
||||
if (!requireSucess && order_No != 0) {
|
||||
if (!requireSucess && !order_No.equals("0")) {
|
||||
JSONObject json = new JSONObject();
|
||||
json.put("producetask_code",order_No);
|
||||
json.put("device_code",this.device_code);
|
||||
@@ -829,7 +829,7 @@ public class RljnPackagePalletSplitManipulatorDeviceDriver extends AbstractOpcDe
|
||||
JSONObject jsonObject = JSONObject.parseObject(result.body());
|
||||
if (result.getStatus() == 200 && jsonObject.get("status").equals("200")) {
|
||||
this.writing(this.mode);
|
||||
ProduceshiftorderDto dto = produceshiftorderService.findByCode(String.valueOf(order_No));
|
||||
ProduceshiftorderDto dto = produceshiftorderService.findByCode(order_No);
|
||||
if (this.mode == 4) {
|
||||
dto.setOrder_status("0");
|
||||
} else if (this.mode == 9){
|
||||
|
||||
@@ -4,10 +4,14 @@ package org.nl.acs.order.service.impl;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.nl.acs.config.AcsConfig;
|
||||
import org.nl.acs.config.server.AcsConfigService;
|
||||
import org.nl.acs.ext.wms.service.AcsToWmsService;
|
||||
import org.nl.acs.order.service.ProduceshiftorderService;
|
||||
import org.nl.acs.order.service.dto.ProduceshiftorderDto;
|
||||
import org.nl.exception.BadRequestException;
|
||||
import org.nl.wql.WQL;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
@@ -38,6 +42,12 @@ import lombok.extern.slf4j.Slf4j;
|
||||
@Slf4j
|
||||
public class ProduceshiftorderServiceImpl implements ProduceshiftorderService {
|
||||
|
||||
@Autowired
|
||||
AcsToWmsService acsToWmsService;
|
||||
|
||||
@Autowired
|
||||
AcsConfigService acsConfigService;
|
||||
|
||||
@Override
|
||||
public Map<String, Object> queryAll(Map whereJson, Pageable page) {
|
||||
HashMap<String, String> map = new HashMap<>();
|
||||
@@ -151,7 +161,24 @@ public class ProduceshiftorderServiceImpl implements ProduceshiftorderService {
|
||||
@Override
|
||||
public void finish(String ids) {
|
||||
ProduceshiftorderDto dto = this.findById(ids);
|
||||
if (dto == null) throw new BadRequestException("被删除或无权限,操作失败!");
|
||||
String currentUsername = SecurityUtils.getCurrentUsername();
|
||||
String now = DateUtil.now();
|
||||
dto.setUpdate_time(now);
|
||||
dto.setUpdate_by(currentUsername);
|
||||
dto.setOrder_status("3");
|
||||
this.update(dto);
|
||||
|
||||
//判断是否为wms下发的排产单
|
||||
String hasWms = acsConfigService.findConfigFromCache().get(AcsConfig.HASWMS);
|
||||
if (dto.getProduct_code().equals("wms") && hasWms.equals("1")) {
|
||||
JSONObject json = new JSONObject();
|
||||
json.put("producetask_code",dto.getOrder_code());
|
||||
json.put("device_code",dto.getDevice_code());
|
||||
json.put("material_code",dto.getMaterial_code());
|
||||
json.put("qty",dto.getQty());
|
||||
json.put("type","3");
|
||||
acsToWmsService.enterOrder(json);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user