工单号字段更新
This commit is contained in:
@@ -88,8 +88,8 @@ public class ItemProtocol {
|
|||||||
return this.getOpcIntegerValue(item_to_error);
|
return this.getOpcIntegerValue(item_to_error);
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getTo_order_No() {
|
public String getTo_order_No() {
|
||||||
return this.getOpcIntegerValue(item_to_order_No);
|
return this.getOpcStringValue(item_to_order_No);
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getTo_command() {
|
public int getTo_command() {
|
||||||
|
|||||||
@@ -171,8 +171,8 @@ public class LnshMixingMillDeviceDriver extends AbstractOpcDeviceDriver implemen
|
|||||||
logServer.deviceLog(this.device_code,"material" ,String.valueOf(material));
|
logServer.deviceLog(this.device_code,"material" ,String.valueOf(material));
|
||||||
logServer.deviceLogToacs(this.device_code,"","","信号material:" + last_material + "->" + material);
|
logServer.deviceLogToacs(this.device_code,"","","信号material:" + last_material + "->" + material);
|
||||||
}
|
}
|
||||||
if (StrUtil.equals(order_No,last_order_No)) {
|
if (!StrUtil.equals(order_No,last_order_No)) {
|
||||||
logServer.deviceLog(this.device_code,"order_No" ,String.valueOf(order_No));
|
logServer.deviceLog(this.device_code,"order_No" ,order_No);
|
||||||
logServer.deviceLogToacs(this.device_code,"","","信号order_No:" + last_order_No + "->" + order_No);
|
logServer.deviceLogToacs(this.device_code,"","","信号order_No:" + last_order_No + "->" + order_No);
|
||||||
}
|
}
|
||||||
if (mix_num != last_mix_num) {
|
if (mix_num != last_mix_num) {
|
||||||
@@ -277,7 +277,7 @@ public class LnshMixingMillDeviceDriver extends AbstractOpcDeviceDriver implemen
|
|||||||
HttpResponse result = acsToWmsService.enterOrder(json);
|
HttpResponse result = acsToWmsService.enterOrder(json);
|
||||||
if (result.getStatus() == 200) {
|
if (result.getStatus() == 200) {
|
||||||
this.writing(this.mode);
|
this.writing(this.mode);
|
||||||
ProduceshiftorderDto dto = produceshiftorderService.findByCode(String.valueOf(order_No));
|
ProduceshiftorderDto dto = produceshiftorderService.findByCode(order_No);
|
||||||
if (this.mode == 4) {
|
if (this.mode == 4) {
|
||||||
dto.setOrder_status("2");
|
dto.setOrder_status("2");
|
||||||
} else if (this.mode == 3){
|
} else if (this.mode == 3){
|
||||||
|
|||||||
@@ -208,8 +208,8 @@ public class ItemProtocol {
|
|||||||
return this.getOpcIntegerValue(item_error_time);
|
return this.getOpcIntegerValue(item_error_time);
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getOrder_No() {
|
public String getOrder_No() {
|
||||||
return this.getOpcIntegerValue(item_order_No);
|
return this.getOpcStringValue(item_order_No);
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getProduct_code() {
|
public int getProduct_code() {
|
||||||
@@ -468,8 +468,8 @@ public class ItemProtocol {
|
|||||||
return this.getOpcIntegerValue(item_to_material_code);
|
return this.getOpcIntegerValue(item_to_material_code);
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getTo_order_No() {
|
public String getTo_order_No() {
|
||||||
return this.getOpcIntegerValue(item_to_order_No);
|
return this.getOpcStringValue(item_to_order_No);
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getToProduct_code() {
|
public int getToProduct_code() {
|
||||||
|
|||||||
@@ -109,8 +109,8 @@ public class LnshPackagePalletManipulatorDeviceDriver extends AbstractOpcDeviceD
|
|||||||
String last_barcode;
|
String last_barcode;
|
||||||
String material;
|
String material;
|
||||||
String last_material;
|
String last_material;
|
||||||
int order_No = 0;
|
String order_No = "0";
|
||||||
int last_order_No = 0;
|
String last_order_No = "0";
|
||||||
int qty = 0;
|
int qty = 0;
|
||||||
int last_qty = 0;
|
int last_qty = 0;
|
||||||
|
|
||||||
@@ -361,8 +361,8 @@ public class LnshPackagePalletManipulatorDeviceDriver extends AbstractOpcDeviceD
|
|||||||
logServer.deviceLog(this.device_code,"qty" ,String.valueOf(qty));
|
logServer.deviceLog(this.device_code,"qty" ,String.valueOf(qty));
|
||||||
logServer.deviceLogToacs(this.device_code,"","","信号qty:" + last_qty + "->" + qty);
|
logServer.deviceLogToacs(this.device_code,"","","信号qty:" + last_qty + "->" + qty);
|
||||||
}
|
}
|
||||||
if (order_No != last_order_No) {
|
if (!StrUtil.equals(order_No,last_order_No)) {
|
||||||
logServer.deviceLog(this.device_code,"order_No" ,String.valueOf(order_No));
|
logServer.deviceLog(this.device_code,"order_No" ,order_No);
|
||||||
logServer.deviceLogToacs(this.device_code,"","","信号order_No:" + last_order_No + "->" + order_No);
|
logServer.deviceLogToacs(this.device_code,"","","信号order_No:" + last_order_No + "->" + order_No);
|
||||||
}
|
}
|
||||||
if (product_code != last_product_code) {
|
if (product_code != last_product_code) {
|
||||||
@@ -631,7 +631,7 @@ public class LnshPackagePalletManipulatorDeviceDriver extends AbstractOpcDeviceD
|
|||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
//排产单确认
|
//排产单确认
|
||||||
if (!requireSucess && order_No != 0) {
|
if (!requireSucess && !order_No.equals("0")) {
|
||||||
JSONObject json = new JSONObject();
|
JSONObject json = new JSONObject();
|
||||||
json.put("producetask_code",order_No);
|
json.put("producetask_code",order_No);
|
||||||
json.put("device_code",this.device_code);
|
json.put("device_code",this.device_code);
|
||||||
@@ -666,7 +666,7 @@ public class LnshPackagePalletManipulatorDeviceDriver extends AbstractOpcDeviceD
|
|||||||
}
|
}
|
||||||
case 9:
|
case 9:
|
||||||
//工单完成
|
//工单完成
|
||||||
if (!requireSucess && order_No != 0) {
|
if (!requireSucess && !order_No.equals("0")) {
|
||||||
JSONObject json = new JSONObject();
|
JSONObject json = new JSONObject();
|
||||||
json.put("producetask_code",order_No);
|
json.put("producetask_code",order_No);
|
||||||
json.put("device_code",this.device_code);
|
json.put("device_code",this.device_code);
|
||||||
@@ -788,7 +788,7 @@ public class LnshPackagePalletManipulatorDeviceDriver extends AbstractOpcDeviceD
|
|||||||
HttpResponse result = acsToWmsService.enterOrder(json);
|
HttpResponse result = acsToWmsService.enterOrder(json);
|
||||||
if (result.getStatus() == 200) {
|
if (result.getStatus() == 200) {
|
||||||
this.writing(this.mode);
|
this.writing(this.mode);
|
||||||
ProduceshiftorderDto dto = produceshiftorderService.findByCode(String.valueOf(order_No));
|
ProduceshiftorderDto dto = produceshiftorderService.findByCode(order_No);
|
||||||
if (this.mode == 4) {
|
if (this.mode == 4) {
|
||||||
dto.setOrder_status("0");
|
dto.setOrder_status("0");
|
||||||
} else if (this.mode == 9){
|
} else if (this.mode == 9){
|
||||||
|
|||||||
@@ -90,8 +90,8 @@ public class ItemProtocol {
|
|||||||
return this.getOpcIntegerValue(item_unqualified);
|
return this.getOpcIntegerValue(item_unqualified);
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getOrder_No() {
|
public String getOrder_No() {
|
||||||
return this.getOpcIntegerValue(item_order_No);
|
return this.getOpcStringValue(item_order_No);
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getTo_command() {
|
public int getTo_command() {
|
||||||
@@ -102,8 +102,8 @@ public class ItemProtocol {
|
|||||||
return this.getOpcIntegerValue(item_to_error);
|
return this.getOpcIntegerValue(item_to_error);
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getTo_order_No() {
|
public String getTo_order_No() {
|
||||||
return this.getOpcIntegerValue(item_to_order_No);
|
return this.getOpcStringValue(item_to_order_No);
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getTo_qty() {
|
public int getTo_qty() {
|
||||||
|
|||||||
@@ -110,8 +110,8 @@ public class LnshPressDeviceDriver extends AbstractOpcDeviceDriver implements De
|
|||||||
int last_qualified = 0;
|
int last_qualified = 0;
|
||||||
int unqualified = 0;
|
int unqualified = 0;
|
||||||
int last_unqualified = 0;
|
int last_unqualified = 0;
|
||||||
int order_No = 0;
|
String order_No = "0";
|
||||||
int last_order_No = 0;
|
String last_order_No = "0";
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Device getDevice() {
|
public Device getDevice() {
|
||||||
@@ -187,8 +187,8 @@ public class LnshPressDeviceDriver extends AbstractOpcDeviceDriver implements De
|
|||||||
logServer.deviceLog(this.device_code,"unqualified" ,String.valueOf(unqualified));
|
logServer.deviceLog(this.device_code,"unqualified" ,String.valueOf(unqualified));
|
||||||
logServer.deviceLogToacs(this.device_code,"","","信号unqualified:" + last_unqualified + "->" + unqualified);
|
logServer.deviceLogToacs(this.device_code,"","","信号unqualified:" + last_unqualified + "->" + unqualified);
|
||||||
}
|
}
|
||||||
if (order_No != last_order_No) {
|
if (!StrUtil.equals(order_No,last_order_No)) {
|
||||||
logServer.deviceLog(this.device_code,"order_No" ,String.valueOf(order_No));
|
logServer.deviceLog(this.device_code,"order_No" ,order_No);
|
||||||
logServer.deviceLogToacs(this.device_code,"","","信号order_No:" + last_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;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
//排产单确认
|
//排产单确认
|
||||||
if (!requireSucess && order_No != 0) {
|
if (!requireSucess && !order_No.equals("0")) {
|
||||||
JSONObject json = new JSONObject();
|
JSONObject json = new JSONObject();
|
||||||
json.put("producetask_code",order_No);
|
json.put("producetask_code",order_No);
|
||||||
json.put("device_code",this.device_code);
|
json.put("device_code",this.device_code);
|
||||||
@@ -238,7 +238,7 @@ public class LnshPressDeviceDriver extends AbstractOpcDeviceDriver implements De
|
|||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
//工单完成反馈
|
//工单完成反馈
|
||||||
if (!requireSucess && order_No != 0) {
|
if (!requireSucess && !order_No.equals("0")) {
|
||||||
JSONObject json = new JSONObject();
|
JSONObject json = new JSONObject();
|
||||||
json.put("producetask_code",order_No);
|
json.put("producetask_code",order_No);
|
||||||
json.put("device_code",this.device_code);
|
json.put("device_code",this.device_code);
|
||||||
@@ -304,7 +304,7 @@ public class LnshPressDeviceDriver extends AbstractOpcDeviceDriver implements De
|
|||||||
HttpResponse result = acsToWmsService.enterOrder(json);
|
HttpResponse result = acsToWmsService.enterOrder(json);
|
||||||
if (result.getStatus() == 200) {
|
if (result.getStatus() == 200) {
|
||||||
this.writing(this.mode);
|
this.writing(this.mode);
|
||||||
ProduceshiftorderDto dto = produceshiftorderService.findByCode(String.valueOf(order_No));
|
ProduceshiftorderDto dto = produceshiftorderService.findByCode(order_No);
|
||||||
if (this.mode == 4) {
|
if (this.mode == 4) {
|
||||||
dto.setOrder_status("2");
|
dto.setOrder_status("2");
|
||||||
} else if (this.mode == 3){
|
} else if (this.mode == 3){
|
||||||
|
|||||||
@@ -4,10 +4,14 @@ package org.nl.acs.order.service.impl;
|
|||||||
|
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import lombok.RequiredArgsConstructor;
|
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.ProduceshiftorderService;
|
||||||
import org.nl.acs.order.service.dto.ProduceshiftorderDto;
|
import org.nl.acs.order.service.dto.ProduceshiftorderDto;
|
||||||
import org.nl.exception.BadRequestException;
|
import org.nl.exception.BadRequestException;
|
||||||
import org.nl.wql.WQL;
|
import org.nl.wql.WQL;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
@@ -38,6 +42,12 @@ import lombok.extern.slf4j.Slf4j;
|
|||||||
@Slf4j
|
@Slf4j
|
||||||
public class ProduceshiftorderServiceImpl implements ProduceshiftorderService {
|
public class ProduceshiftorderServiceImpl implements ProduceshiftorderService {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
AcsToWmsService acsToWmsService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
AcsConfigService acsConfigService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Map<String, Object> queryAll(Map whereJson, Pageable page) {
|
public Map<String, Object> queryAll(Map whereJson, Pageable page) {
|
||||||
HashMap<String, String> map = new HashMap<>();
|
HashMap<String, String> map = new HashMap<>();
|
||||||
@@ -151,7 +161,24 @@ public class ProduceshiftorderServiceImpl implements ProduceshiftorderService {
|
|||||||
@Override
|
@Override
|
||||||
public void finish(String ids) {
|
public void finish(String ids) {
|
||||||
ProduceshiftorderDto dto = this.findById(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");
|
dto.setOrder_status("3");
|
||||||
this.update(dto);
|
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