代码更新

This commit is contained in:
ludj
2023-08-11 13:06:06 +08:00
parent a3f11ec708
commit 7bb60d4c39
3 changed files with 38 additions and 48 deletions

View File

@@ -112,11 +112,6 @@ public class StructFindUtil {
//获取空闲的输送线的上料位
public static JSONObject getConveyor(JSONObject jsonObject) {
/*//判断现在是否能去输送线
String material_id = jsonObject.getString("material_id");
WQLObject materialTable = WQLObject.getWQLObject("MD_ME_Material");
JSONObject materialObj = materialTable.query("material_id ='" + material_id + "'").uniqueResult(0);*/
// 查询空闲输送线
JSONArray arr = WQL.getWO("QSTRUCT_RULE").addParam("flag", "13")
.process().getResultJSONArray(0);

View File

@@ -99,7 +99,6 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
throw new BadRequestException("类型不能为空!");
}
WQLObject pointTable = WQLObject.getWQLObject("sch_base_point");
WQLObject structivtTable = WQLObject.getWQLObject("st_ivt_structivt");
WQLObject groupTab = WQLObject.getWQLObject("st_buss_vehiclegroup");
switch (type) {
@@ -202,8 +201,6 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
// 假如是分拣机械手的下料位置,并且是满托,则去包装线
if (StrUtil.equals("1", is_full) && StrUtil.equals(area_type, AreaEnum.FJQY.getCode())) {
// 起点
String vehicle_code = pointTable.query("point_code ='" + device_code + "'").uniqueResult(0).getString("vehicle_code");
jsonObject.put("vehicle_code", vehicle_code);
produceInfoByCode = this.getProduceInfoByCode(device_code);
jsonObject.put("vehicle_type", produceInfoByCode.getString("vehicle_type"));
toPackIngTask.createTask((JSONObject) JSON.toJSON(jsonObject));

View File

@@ -31,8 +31,6 @@ import java.util.HashMap;
@Slf4j
public class ToPackIngTask extends AbstractAcsTask {
private final String THIS_CLASS = ToPackIngTask.class.getName();
@Override
public void updateTaskStatus(JSONObject taskObj, String status) {
/** 改变任务状态 */
@@ -140,9 +138,9 @@ public class ToPackIngTask extends AbstractAcsTask {
@Override
public String createTask(JSONObject form) {
WQLObject pointTable = WQLObject.getWQLObject("sch_base_point");
// 请求参数 载具、起点 物料,数量,客户,批次,创建方式 是否满托不能为空! 终点可以不为空时,入库单据编号不能为空
String vehicle_code = form.getString("vehicle_code");
String start_point_code = form.getString("start_point_code");
//0或者1强制去包装不补空木托
String is_force = form.getString("is_force");
String next_point_code = "BZSLW";
WQLObject taskTable = WQLObject.getWQLObject("SCH_BASE_Task");
if (StrUtil.isEmpty(start_point_code)) {
@@ -158,6 +156,7 @@ public class ToPackIngTask extends AbstractAcsTask {
}
String task_id = IdUtil.getSnowflake(1, 1).nextId() + "";
JSONObject startPoint = pointTable.query("point_code='" + start_point_code + "'").uniqueResult(0);
String vehicle_code=startPoint.getString("vehicle_code");
String task_status = TaskStatusEnum.START_AND_POINT.getCode();
@@ -180,11 +179,8 @@ public class ToPackIngTask extends AbstractAcsTask {
taskObj.put("is_delete", "0");
// 寻找空载具,并设置得到的覆膜机位置
// 线找是否有半托缓存
String material_id = form.getString("material_id");
String vehicle_type = form.getString("vehicle_type");
String start_area = "";
String point = "";
//生产工单信息
JSONObject workInfo = WQL.getWO("QSTRUCT_RULE").addParam("flag", "1").addParam("code", start_point_code)
.process().uniqueResult(0);
@@ -195,43 +191,45 @@ public class ToPackIngTask extends AbstractAcsTask {
if (ObjectUtil.isEmpty(produceObj))
throw new BadRequestException("设备未设置工单或者工单状态不正确请检查LMS设备工单状态!");
//不是强制需要找木托
if (!StrUtil.equals(is_force,"1")){
//查找半托缓存位
JSONObject start_Point2 = pointTable.query("area_type='06' and vehicle_type = '"+produceObj.getString("vehicle_type")+"' and material_id = '"+produceObj.getString("material_id")+"'").uniqueResult(0);
//查找半托缓存
JSONObject start_Point2 = pointTable.query("area_type='06' and vehicle_type = '"+produceObj.getString("vehicle_type")+"' and material_id = '"+produceObj.getString("material_id")+"'").uniqueResult(0);
// 如果半托缓存有库存,则出半满托盘
if (ObjectUtil.isNotEmpty(start_Point2)) {
point = start_Point2.getString("point_code");
vehicle_code = start_Point2.getString("vehicle_code");
vehicle_type = start_Point2.getString("vehicle_type");
taskObj.put("start_point_code2", start_Point2.getString("point_code"));
taskObj.put("next_point_code2", start_point_code);
} else {
// 找空木托盘
// 需要更新覆膜机的托盘类型
JSONArray pointarr = WQL.getWO("ACSTOMES_001").addParam("area_type", "05").addParam("flag", "4")
.process().getResultJSONArray(0);
PointUpdateUtil.updatePoint(pointarr);
// 需要更新堆叠位的点位状态
JSONArray pointarr2 = WQL.getWO("ACSTOMES_001").addParam("point_code", "KTPDDW5").addParam("flag", "4")
.process().getResultJSONArray(0);
PointUpdateUtil.updatePoint(pointarr2);
// 如果半托缓存有库存,则出半满托盘
if (ObjectUtil.isNotEmpty(start_Point2)) {
point = start_Point2.getString("point_code");
vehicle_code = start_Point2.getString("vehicle_code");
vehicle_type = start_Point2.getString("vehicle_type");
taskObj.put("start_point_code2", start_Point2.getString("point_code"));
taskObj.put("next_point_code2", start_point_code);
} else {
// 找空木托盘
// 需要更新覆膜机的托盘类型
JSONArray pointarr = WQL.getWO("ACSTOMES_001").addParam("area_type", "05").addParam("flag", "4")
.process().getResultJSONArray(0);
PointUpdateUtil.updatePoint(pointarr);
// 需要更新堆叠位的点位状态
JSONArray pointarr2 = WQL.getWO("ACSTOMES_001").addParam("point_code", "KTPDDW5").addParam("flag", "4")
.process().getResultJSONArray(0);
PointUpdateUtil.updatePoint(pointarr2);
vehicle_type = produceObj.getString("vehicle_type");
start_Point2 = pointTable.query("area_type='05' and vehicle_type = '"+produceObj.getString("vehicle_type")+"'").uniqueResult(0);
if (ObjectUtil.isEmpty(start_Point2)) {
throw new BadRequestException("覆膜区未找到合适的木托盘类型");
vehicle_type = produceObj.getString("vehicle_type");
start_Point2 = pointTable.query("area_type='05' and vehicle_type = '"+produceObj.getString("vehicle_type")+"'").uniqueResult(0);
if (ObjectUtil.isEmpty(start_Point2)) {
throw new BadRequestException("覆膜区未找到合适的木托盘类型");
}
taskObj.put("start_point_code2", start_Point2.getString("point_code"));
taskObj.put("next_point_code2", start_point_code);
vehicle_code = CodeUtil.getNewCode("VEHICCLE_CODE_MTP");
}
taskObj.put("start_point_code2", start_Point2.getString("point_code"));
taskObj.put("next_point_code2", start_point_code);
vehicle_code = CodeUtil.getNewCode("VEHICCLE_CODE_MTP");
startPoint.put("vehicle_code", vehicle_code);
WQLObject.getWQLObject("sch_base_point").update(startPoint);
// 锁住点位
HashMap lock_map = new HashMap();
lock_map.put("lock_type", "01");
WQLObject.getWQLObject("sch_base_point").update(lock_map, "point_code = '" + point + "'");
}
startPoint.put("vehicle_code", vehicle_code);
WQLObject.getWQLObject("sch_base_point").update(startPoint);
// 锁住点位
HashMap lock_map = new HashMap();
lock_map.put("lock_type", "01");
WQLObject.getWQLObject("sch_base_point").update(lock_map, "point_code = '" + point + "'");
//木托盘类型
taskObj.put("vehicle_type", vehicle_type);