psh 1 year ago
parent
commit
c72db126ff
  1. 16
      acs/hd/nladmin-system/src/main/java/org/nl/start/auto/run/NDCSocketConnectionAutoRun.java
  2. 4
      lms/hd/nladmin-system/src/main/java/org/nl/wms/ext/acs/service/impl/AcsToWmsServiceImpl.java
  3. 7
      lms/hd/nladmin-system/src/main/java/org/nl/wms/pda/emptyandqty/service/impl/EmptyAndQtyServiceImpl.java
  4. 36
      lms/hd/nladmin-system/src/main/java/org/nl/wms/pda/sendmaterial/service/impl/SendMaterialServiceImpl.java

16
acs/hd/nladmin-system/src/main/java/org/nl/start/auto/run/NDCSocketConnectionAutoRun.java

@ -1,5 +1,6 @@
package org.nl.start.auto.run; package org.nl.start.auto.run;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
@ -271,7 +272,8 @@ public class NDCSocketConnectionAutoRun extends AbstractAutoRunnable {
jsonObject.put("product_code", standardInspectSiteSmartDeviceDriver.getProduct_code()); jsonObject.put("product_code", standardInspectSiteSmartDeviceDriver.getProduct_code());
jsonObject.put("batch_code", standardInspectSiteSmartDeviceDriver.getBatch_code()); jsonObject.put("batch_code", standardInspectSiteSmartDeviceDriver.getBatch_code());
jsonObject.put("product_specifications", standardInspectSiteSmartDeviceDriver.getProduct_specifications()); 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"); jsonObject.put("type", "9");
acsToWmsService.lnshApplyTaskToWms(jsonObject); acsToWmsService.lnshApplyTaskToWms(jsonObject);
} }
@ -336,6 +338,16 @@ public class NDCSocketConnectionAutoRun extends AbstractAutoRunnable {
flag = true; flag = true;
} }
//检测站点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 JSONObject agv_check = device_extra_table
.query("is_delete = '0' AND extra_code = 'agv_check' AND device_code = '" + device.getDevice_code() + "'") .query("is_delete = '0' AND extra_code = 'agv_check' AND device_code = '" + device.getDevice_code() + "'")
@ -356,6 +368,8 @@ public class NDCSocketConnectionAutoRun extends AbstractAutoRunnable {
} }
} }
} }
}
}
// 放货完成请求离开 // 放货完成请求离开
else if (phase == 0x09) { else if (phase == 0x09) {
if (ObjectUtil.isEmpty(inst)) { if (ObjectUtil.isEmpty(inst)) {

4
lms/hd/nladmin-system/src/main/java/org/nl/wms/ext/acs/service/impl/AcsToWmsServiceImpl.java

@ -447,8 +447,8 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
String next_code = whereJson.getString("next_code"); String next_code = whereJson.getString("next_code");
JSONObject start_point = WQLObject.getWQLObject("sch_base_point").query("point_code = '" + start_code + "'").uniqueResult(0); 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 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 start_jsonIvt = ivtTab.query("struct_code = '" + start_point.getString("point_code")+ "'").uniqueResult(0);
JSONObject next_jsonIvt = ivtTab.query("struct_id = " + next_point.getString("point_id")).uniqueResult(0); JSONObject next_jsonIvt = ivtTab.query("struct_code = '" + next_point.getString("point_code")+ "'").uniqueResult(0);
start_point.put("point_status","00"); start_point.put("point_status","00");
pointTab.update(start_point); pointTab.update(start_point);
if(next_code.startsWith("DJ")||next_code.startsWith("BHG")||next_code.startsWith("TL")){ if(next_code.startsWith("DJ")||next_code.startsWith("BHG")||next_code.startsWith("TL")){

7
lms/hd/nladmin-system/src/main/java/org/nl/wms/pda/emptyandqty/service/impl/EmptyAndQtyServiceImpl.java

@ -38,6 +38,13 @@ public class EmptyAndQtyServiceImpl implements EmptyAndQtyService {
ivt_json.put("quality_scode", quality_scode); ivt_json.put("quality_scode", quality_scode);
} else if (type == 2) { } else if (type == 2) {
ivt_json.put("quality_scode", null); 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); ivtTab.update(ivt_json);
} }

36
lms/hd/nladmin-system/src/main/java/org/nl/wms/pda/sendmaterial/service/impl/SendMaterialServiceImpl.java

@ -110,10 +110,30 @@ public class SendMaterialServiceImpl implements SendMaterialService {
resultJSON.put("desc", "终点不能为空"); resultJSON.put("desc", "终点不能为空");
return resultJSON; 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"); String point_id=param.getString("point_id");
int type=param.getIntValue("type"); int type=param.getIntValue("type");
String quality_scode=param.getString("quality_scode"); 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); JSONObject ivt_json = ivtTab.query("struct_id ='" + point_id + "'").uniqueResult(0);
if (type==1) { if (type==1) {
ivt_json.put("quality_scode",quality_scode); ivt_json.put("quality_scode",quality_scode);
@ -150,20 +170,6 @@ public class SendMaterialServiceImpl implements SendMaterialService {
String taskId = sendMaterialTask.createTask(param); String taskId = sendMaterialTask.createTask(param);
PointServiceImpl pointService = SpringContextHolder.getBean(PointServiceImpl.class); 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(); JSONObject json = new JSONObject();

Loading…
Cancel
Save