代码更新

This commit is contained in:
ludj
2023-07-06 14:57:18 +08:00
parent 60414655e7
commit 4c701a555c
7 changed files with 28 additions and 21 deletions

View File

@@ -44,7 +44,7 @@ public class Init implements ApplicationRunner {
isStart = true;
System.out.println("系统启动成功!");
//将窑设备的信息导入内存中
initKiln();
// initKiln();
}
@@ -57,7 +57,7 @@ public class Init implements ApplicationRunner {
for (int i = 0; i <kilnarr.size() ; i++) {
JSONObject kilnjo = kilnarr.getJSONObject(i);
String vehicle_code = kilnjo.getString("vehicle_code");
KilnUtil.KilnQueue.offer(vehicle_code);
// KilnUtil.KilnQueue.offer(vehicle_code);
}
}

View File

@@ -5,16 +5,17 @@ import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSONObject;
import org.nl.exception.BadRequestException;
import org.nl.wms.ext.acs.service.impl.WmsToJnServiceImpl;
import org.nl.wql.core.bean.WQLObject;
import java.util.Queue;
import java.util.concurrent.ArrayBlockingQueue;
public class KilnUtil {
public static Queue<String> KilnQueue = new ArrayBlockingQueue<>(10);
// public static Queue<String> KilnQueue = new ArrayBlockingQueue<>(10);
//入窑扫码
public static void inKiln(String vehicle_code) {
KilnQueue.offer(vehicle_code);
// KilnQueue.offer(vehicle_code);
//插入窑设备记录表
WQLObject recordTable = WQLObject.getWQLObject("pdm_bi_kilnrecord");
WQLObject groupTable = WQLObject.getWQLObject("st_buss_vehiclegroup");
@@ -35,11 +36,18 @@ public class KilnUtil {
jo.put("is_success", "0");
jo.put("is_delete", "0");
recordTable.insert(jo);
//入窑调用MES接口
JSONObject jo2 = new JSONObject();
jo.put("vehicle_code", vehicle_code);
// 调用wms的接口
WmsToJnServiceImpl wmsToJnService = new WmsToJnServiceImpl();
wmsToJnService.feedBackInKiln(jo2);
}
//出窑扫码
public static void outKiln(String vehicle_code) {
KilnQueue.offer(vehicle_code);
// KilnQueue.offer(vehicle_code);
//更新窑设备记录表
WQLObject recordTable = WQLObject.getWQLObject("pdm_bi_kilnrecord");
JSONObject vehicleObj = recordTable.query("vehicle_code='"+vehicle_code+"'and out_time=''","in_time desc").uniqueResult(0);
@@ -48,6 +56,12 @@ public class KilnUtil {
}
vehicleObj.put("out_time", DateUtil.now());
recordTable.update(vehicleObj);
JSONObject jo = new JSONObject();
jo.put("vehicle_code", vehicle_code);
// 调用wms的接口
WmsToJnServiceImpl wmsToJnService = new WmsToJnServiceImpl();
wmsToJnService.feedBackOutKiln(jo);
}

View File

@@ -95,7 +95,7 @@ public interface WmsToJnService {
Map<String, Object> queryCurrentOrder(Map whereJson);
/**
* 反馈入冷却缓冲区
* 出窑炉进冷却缓冲区
*
* @param
* @return Map<String, Object>
@@ -103,7 +103,7 @@ public interface WmsToJnService {
Map<String, Object> feedBackInWait(Map whereJson);
/**
* 反馈出冷却缓冲区
* 反馈出冷却缓冲区(出窑成品货架-->分拣机械手)
*
* @param
* @return Map<String, Object>

View File

@@ -588,11 +588,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
log.debug("ACS的inKiln请求参数为:" + jsonObject);
String vehicle_code = String.valueOf(jsonObject.get("vehicle_code"));
KilnUtil.inKiln(vehicle_code);
JSONObject jo = new JSONObject();
jo.put("vehicle_code", vehicle_code);
// 调用wms的接口
WmsToJnServiceImpl wmsToJnService = new WmsToJnServiceImpl();
wmsToJnService.feedBackInKiln(jo);
JSONObject result = new JSONObject();
result.put("status", HttpStatus.OK.value());
result.put("message", "任务状态反馈成功!");
@@ -626,11 +622,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
// 更新窑的信息
KilnUtil.outKiln(vehicle_code);
JSONObject jo = new JSONObject();
jo.put("vehicle_code", vehicle_code);
// 调用wms的接口
WmsToJnServiceImpl wmsToJnService = new WmsToJnServiceImpl();
wmsToJnService.feedBackOutKiln(jo);
JSONObject result = new JSONObject();
result.put("status", HttpStatus.OK.value());

View File

@@ -104,6 +104,7 @@
kiln.vehicle_code = 输入.vehicle_code
ENDOPTION
ENDSELECT
ORDER BY in_time desc
ENDQUERY
ENDIF
IF 输入.flag = "4"

View File

@@ -154,14 +154,14 @@ public class CallMaterialTask extends AbstractAcsTask {
// 2是出窑缓存货架调用反馈出冷却缓冲区
// 3是木托盘缓存货架调用反馈半木托出临时库区
String point_type = startPointObj.getString("point_type");
String area_type = startPointObj.getString("area_type");
JSONObject jo = new JSONObject();
jo.put("task_id", task_id);
WmsToJnServiceImpl wmsToJnServiceImpl = new WmsToJnServiceImpl();
if (StrUtil.equals(point_type, AreaEnum.CYHCHJ.getCode())) {
if (StrUtil.equals(area_type, AreaEnum.CYHCHJ.getCode())) {
wmsToJnServiceImpl.feedBackOutWait(jo);
}
if (StrUtil.equals(point_type, AreaEnum.BTHCQ.getCode())) {
if (StrUtil.equals(area_type, AreaEnum.BTHCQ.getCode())) {
wmsToJnServiceImpl.feedBackOutPartStock(jo);
}
}

View File

@@ -62,7 +62,7 @@ public class ToPackIngTask extends AbstractAcsTask {
JSONObject startPointObj = pointTab.query("point_code='" + jsonTask.getString("start_point_code") + "'").uniqueResult(0);
startPointObj.put("lock_type", "00");
startPointObj.put("point_status", "00");
startPointObj.put("vehicle_code", "");
// startPointObj.put("vehicle_code", "");
startPointObj.put("update_time", DateUtil.now());
pointTab.update(startPointObj);