FIX
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package org.nl.start.auto.run;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
@@ -271,7 +272,8 @@ public class NDCSocketConnectionAutoRun extends AbstractAutoRunnable {
|
||||
jsonObject.put("product_code", standardInspectSiteSmartDeviceDriver.getProduct_code());
|
||||
jsonObject.put("batch_code", standardInspectSiteSmartDeviceDriver.getBatch_code());
|
||||
jsonObject.put("product_specifications", standardInspectSiteSmartDeviceDriver.getProduct_specifications());
|
||||
jsonObject.put("time", standardInspectSiteSmartDeviceDriver.getTime());
|
||||
// jsonObject.put("time", standardInspectSiteSmartDeviceDriver.getTime());
|
||||
jsonObject.put("time", DateUtil.formatDate(new Date()));
|
||||
jsonObject.put("type", "9");
|
||||
acsToWmsService.lnshApplyTaskToWms(jsonObject);
|
||||
}
|
||||
@@ -336,23 +338,35 @@ public class NDCSocketConnectionAutoRun extends AbstractAutoRunnable {
|
||||
flag = true;
|
||||
|
||||
}
|
||||
// 检验取放货条件
|
||||
JSONObject agv_check = device_extra_table
|
||||
.query("is_delete = '0' AND extra_code = 'agv_check' AND device_code = '" + device.getDevice_code() + "'")
|
||||
.uniqueResult(0);
|
||||
if (ObjectUtil.isNotEmpty(agv_check) && "true".equals(agv_check.getString("extra_value"))) {
|
||||
JSONObject agv_check_status = device_extra_table
|
||||
.query("is_delete = '0' AND extra_code = 'agv_check_status' AND device_code = '" + device.getDevice_code() + "'")
|
||||
.uniqueResult(0);
|
||||
if (ObjectUtil.isNotEmpty(agv_check_status) && "1".equals(agv_check_status.getString("extra_value"))) {
|
||||
inst.setExecute_status("1");
|
||||
instructionService.update(inst);
|
||||
data = AgvService.sendAgvOneModeInst(phase, index, 0);
|
||||
flag = true;
|
||||
agv_check_status.put("extra_value", "0");
|
||||
device_extra_table.update(agv_check_status);
|
||||
} else {
|
||||
logServer.deviceExecuteLog(device_code, "", "", "AGV请求取货设备{}未取盖确认,无法反馈");
|
||||
//检测站点smart200
|
||||
//混料机进入前判断气缸是否已经抬起且已经取盖,否则不发下请求放货动作
|
||||
if (device.getDeviceDriver() instanceof StandardInspectSiteSmartDeviceDriver) {
|
||||
standardInspectSiteSmartDeviceDriver = (StandardInspectSiteSmartDeviceDriver) device.getDeviceDriver();
|
||||
log.info("flag:" + standardInspectSiteSmartDeviceDriver.getFlag());
|
||||
log.info("time:" + standardInspectSiteSmartDeviceDriver.getTime());
|
||||
log.info("Product_code:" + standardInspectSiteSmartDeviceDriver.getProduct_code());
|
||||
log.info("Product_specifications:" + standardInspectSiteSmartDeviceDriver.getProduct_specifications());
|
||||
log.info("Weight:" + standardInspectSiteSmartDeviceDriver.getWeight());
|
||||
if (1 == standardInspectSiteSmartDeviceDriver.getFlag()) {
|
||||
// 检验取放货条件
|
||||
JSONObject agv_check = device_extra_table
|
||||
.query("is_delete = '0' AND extra_code = 'agv_check' AND device_code = '" + device.getDevice_code() + "'")
|
||||
.uniqueResult(0);
|
||||
if (ObjectUtil.isNotEmpty(agv_check) && "true".equals(agv_check.getString("extra_value"))) {
|
||||
JSONObject agv_check_status = device_extra_table
|
||||
.query("is_delete = '0' AND extra_code = 'agv_check_status' AND device_code = '" + device.getDevice_code() + "'")
|
||||
.uniqueResult(0);
|
||||
if (ObjectUtil.isNotEmpty(agv_check_status) && "1".equals(agv_check_status.getString("extra_value"))) {
|
||||
inst.setExecute_status("1");
|
||||
instructionService.update(inst);
|
||||
data = AgvService.sendAgvOneModeInst(phase, index, 0);
|
||||
flag = true;
|
||||
agv_check_status.put("extra_value", "0");
|
||||
device_extra_table.update(agv_check_status);
|
||||
} else {
|
||||
logServer.deviceExecuteLog(device_code, "", "", "AGV请求取货设备{}未取盖确认,无法反馈");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -447,8 +447,8 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
String next_code = whereJson.getString("next_code");
|
||||
JSONObject start_point = WQLObject.getWQLObject("sch_base_point").query("point_code = '" + start_code + "'").uniqueResult(0);
|
||||
JSONObject next_point = WQLObject.getWQLObject("sch_base_point").query("point_code = '" + next_code + "'").uniqueResult(0);
|
||||
JSONObject start_jsonIvt = ivtTab.query("struct_id = " + start_point.getString("point_id")).uniqueResult(0);
|
||||
JSONObject next_jsonIvt = ivtTab.query("struct_id = " + next_point.getString("point_id")).uniqueResult(0);
|
||||
JSONObject start_jsonIvt = ivtTab.query("struct_code = '" + start_point.getString("point_code")+ "'").uniqueResult(0);
|
||||
JSONObject next_jsonIvt = ivtTab.query("struct_code = '" + next_point.getString("point_code")+ "'").uniqueResult(0);
|
||||
start_point.put("point_status","00");
|
||||
pointTab.update(start_point);
|
||||
if(next_code.startsWith("DJ")||next_code.startsWith("BHG")||next_code.startsWith("TL")){
|
||||
|
||||
@@ -38,6 +38,13 @@ public class EmptyAndQtyServiceImpl implements EmptyAndQtyService {
|
||||
ivt_json.put("quality_scode", quality_scode);
|
||||
} else if (type == 2) {
|
||||
ivt_json.put("quality_scode", null);
|
||||
if(ivt_json.getString("struct_code").startsWith("BHG")) {
|
||||
ivt_json.put("weight", "");
|
||||
ivt_json.put("product_code", "");
|
||||
ivt_json.put("batch_code", "");
|
||||
ivt_json.put("product_specifications", "");
|
||||
ivt_json.put("time", "");
|
||||
}
|
||||
}
|
||||
ivtTab.update(ivt_json);
|
||||
}
|
||||
|
||||
@@ -110,10 +110,30 @@ public class SendMaterialServiceImpl implements SendMaterialService {
|
||||
resultJSON.put("desc", "终点不能为空");
|
||||
return resultJSON;
|
||||
}
|
||||
WQLObject ivtTab = WQLObject.getWQLObject("st_ivt_structivt");
|
||||
if(startPointCode.startsWith("DJ")){
|
||||
JSONObject start_jsonIvt = ivtTab.query("struct_code = '" + startPointCode+"'").uniqueResult(0);
|
||||
if("00".equals(start_jsonIvt.getString("quality_scode"))){
|
||||
resultJSON.put("code", "0");
|
||||
resultJSON.put("desc", "待检品不能搬运");
|
||||
return resultJSON;
|
||||
}
|
||||
if("01".equals(start_jsonIvt.getString("quality_scode"))
|
||||
&&nextPointCode.startsWith("BHG")){
|
||||
resultJSON.put("code", "0");
|
||||
resultJSON.put("desc", "合格品不能进入不合格区");
|
||||
return resultJSON;
|
||||
}
|
||||
if("02".equals(start_jsonIvt.getString("quality_scode"))
|
||||
&&nextPointCode.startsWith("TL")){
|
||||
resultJSON.put("code", "0");
|
||||
resultJSON.put("desc", "不合格品不能进入投料区");
|
||||
return resultJSON;
|
||||
}
|
||||
}
|
||||
String point_id=param.getString("point_id");
|
||||
int type=param.getIntValue("type");
|
||||
String quality_scode=param.getString("quality_scode");
|
||||
WQLObject ivtTab = WQLObject.getWQLObject("st_ivt_structivt");
|
||||
JSONObject ivt_json = ivtTab.query("struct_id ='" + point_id + "'").uniqueResult(0);
|
||||
if (type==1) {
|
||||
ivt_json.put("quality_scode",quality_scode);
|
||||
@@ -150,20 +170,6 @@ public class SendMaterialServiceImpl implements SendMaterialService {
|
||||
String taskId = sendMaterialTask.createTask(param);
|
||||
|
||||
PointServiceImpl pointService = SpringContextHolder.getBean(PointServiceImpl.class);
|
||||
PointDto nextPointDto = pointService.findByCode(nextPointCode);
|
||||
PointDto startPointDto = pointService.findByCode(startPointCode);
|
||||
// 如果终点为仓位(待检区),则需要添加库存
|
||||
if (StrUtil.equals(nextPointDto.getPoint_type(), "01")) {
|
||||
JSONObject struct = new JSONObject();
|
||||
struct.put("stockrecord_id", IdUtil.getSnowflake(1, 1).nextId());
|
||||
struct.put("struct_id", nextPointDto.getPoint_id());
|
||||
struct.put("struct_code", nextPointDto.getPoint_code());
|
||||
struct.put("struct_name", nextPointDto.getPoint_name());
|
||||
struct.put("region_id", startPointDto.getRegion_id());
|
||||
struct.put("quality_scode", "00");// 待检品
|
||||
struct.put("instorage_time", DateUtil.now());
|
||||
WQLObject.getWQLObject("st_ivt_structivt").insert(struct);
|
||||
}
|
||||
|
||||
// 创建并下发成功后更新搬运记录
|
||||
JSONObject json = new JSONObject();
|
||||
|
||||
Reference in New Issue
Block a user