修改规则,物料增加物料大类

This commit is contained in:
18188916393
2022-09-24 08:13:49 +08:00
parent 0fadee163b
commit 2f9e8efdaa
7 changed files with 53 additions and 29 deletions

View File

@@ -30,20 +30,24 @@ public class PointUpdateUtil {
//String vehicle_code = pointjo.getString("vehicle_code");
String vehicle_code = pointjo.getString("barcode");
String device_code = pointjo.getString("device_code");
//物料类型
String weight = pointjo.getString("weight");
//将托盘类型123改为 030405,默认给01
String pallet_type = "01";
if (!StrUtil.equals("0", pointjo.getString("pallet_type"))) {
pallet_type = "0" + (pointjo.getIntValue("pallet_type") + 2);
}
pointjo.put("point_status", point_status);
if (StrUtil.equals(vehicle_code,"0")){
vehicle_code="";
if (StrUtil.equals(vehicle_code, "0")) {
vehicle_code = "";
}
JSONObject pointObj = pointTable.query("point_code ='" + device_code + "'").uniqueResult(0);
pointObj.put("vehicle_code", vehicle_code);
pointObj.put("point_status", point_status);
pointObj.put("vehicle_type", pallet_type);
pointObj.put("material_type", weight);
pointObj.put("mode", mode);
pointTable.update(pointObj);
}

View File

@@ -8,6 +8,7 @@ import com.alipay.api.domain.BFActivityOpenApiInfo;
import org.nl.exception.BadRequestException;
import org.nl.start.day01.Struct;
import org.nl.wql.WQL;
import org.nl.wql.core.bean.ResultBean;
import org.nl.wql.core.bean.WQLObject;
public class StructFindUtil {
@@ -97,8 +98,8 @@ public class StructFindUtil {
} else {
result = WQL.getWO("QSTRUCT_RULE").addParam("flag", "5")
.addParam("area_type", area_type).addParam("vehicle_type", vehicle_type)
.addParam("point_code",point_code).
process().uniqueResult(0);
.addParam("point_code", point_code).
process().uniqueResult(0);
}
return result;
}
@@ -119,19 +120,21 @@ public class StructFindUtil {
material_id = "";
}
WQLObject pointTable = WQLObject.getWQLObject("sch_base_point");
WQLObject materialTable = WQLObject.getWQLObject("MD_ME_Material");
WQLObject taskTable = WQLObject.getWQLObject("sch_base_task");
JSONObject materialObj = materialTable.query("material_id ='" + material_id + "'").uniqueResult(0);
//获取可以用的输送线数组
JSONArray deviceArr = WQL.getWO("QSTRUCT_RULE").addParam("flag", "6")
.addParam("material_id", material_id).process().getResultJSONArray(0);
for (int i = 0; i < deviceArr.size(); i++) {
result = WQL.getWO("QSTRUCT_RULE").addParam("flag", "6")
.addParam("material_type", materialObj.getString("material_type")).process().uniqueResult(0);
/*for (int i = 0; i < deviceArr.size(); i++) {
JSONObject deviceObj = deviceArr.getJSONObject(i);
/*int count = deviceObj.getIntValue("count");
*//*int count = deviceObj.getIntValue("count");
//假如到该输送线上料位置的任务>= 空闲的位置个数,则需要选择下一个输送线
int task_num = WQL.getWO("QSTRUCT_RULE").addParam("flag", "7").process().uniqueResult(0).getIntValue("count");
if (count > task_num) {
result = pointTable.query("device_id = '" + deviceObj.getString("device_id") + "' and device_point_type='01'").uniqueResult(0);
break;
}*/
}*//*
//判断输送线上料位置有无空位置
result = pointTable.query("device_id = '" + deviceObj.getString("device_id") + "' and device_point_type='01' and point_status='00'")
.uniqueResult(0);
@@ -143,7 +146,7 @@ public class StructFindUtil {
}
}
}
}*/
return result;
}

View File

@@ -25,7 +25,8 @@
输入.next_point_code TYPEAS s_string
输入.point_code TYPEAS s_string
输入.group_device TYPEAS s_string
输入.point_code TYPEAS s_string
输入.point_code TYPEAS s_string
输入.material_type TYPEAS s_string
[临时表]
@@ -204,26 +205,22 @@ ENDIF
IF 输入.flag = "6"
QUERY
SELECT
point.*,
device.device_id,
device.device_code,
device.device_name,
rule.in_seq_no
point.*,
task.task_code
FROM
sch_base_point point
LEFT JOIN st_rule_cacheline rule ON point.device_id = rule.cacheline_id
LEFT JOIN pdm_base_device device ON device.device_id = rule.cacheline_id
LEFT JOIN sch_base_task task ON point.point_code = task.next_point_code
AND task.task_status IN ( '04', '05', '06' )
WHERE
point.area_type = '07'
AND device_point_type='01'
AND point.mode<>'0'
AND device_point_type = '01'
AND point.MODE <> '0'
AND ( point.vehicle_code = '' OR point.vehicle_code IS NULL )
OPTION 输入.material_id <> ""
rule.material_id = 输入.material_id
AND point.material_type = '1'
AND task.task_code IS NULL
OPTION 输入.material_type <> ""
point.material_type = 输入.material_type
ENDOPTION
ORDER BY
rule.in_seq_no
ENDSELECT
ENDQUERY
ENDIF

View File

@@ -123,14 +123,14 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
jsonObject.put("next_point_code", pointObj.getString("point_code"));
jsonObject.put("group_id", group_id);
toConveyorTask.createTask((JSONObject) JSON.toJSON(jsonObject));
//假如是压制下料的几个位置 需要记录不合格数量
//假如是压制下料的几个位置 需要记 录不合格数量
if (StrUtil.equals(area_type, AreaEnum.YZQY.getCode())) {
JSONObject joo = new JSONObject();
joo.put("qty", jsonObject.get("unqualified_qty"));
joo.put("device_code", device_code);
String record_id = PressureUtil.record(joo);
//回传不合格记录
WmsToJnServiceImpl wmsToJnService = new WmsToJnServiceImpl();
// Wms/api/produceTaskToJnServiceImpl wmsToJnService = new WmsToJnServiceImpl();
// wmsToJnService.feedBackQualityInfo(record_id);
}
break;

View File

@@ -166,6 +166,7 @@ public class WmsToJnServiceImpl implements WmsToJnService {
material_jo.put("stewing_time", stewing_time);
material_jo.put("print_model", materialjo.getString("PRINTTYPE"));
material_jo.put("is_auto_package", materialjo.getString("ISAUTO"));
material_jo.put("material_type", materialjo.getString("TYPEID"));
material_jo.put("is_used", "1");
material_jo.put("update_optid", "1");
material_jo.put("update_optname", "管理员");

View File

@@ -13,6 +13,7 @@ import org.nl.utils.SpringContextHolder;
import org.nl.wms.WorkProcedureEnum;
import org.nl.wms.common.SortingUtil;
import org.nl.wms.common.StructFindUtil;
import org.nl.wms.ext.acs.service.impl.WmsToAcsServiceImpl;
import org.nl.wms.ext.acs.service.impl.WmsToJnServiceImpl;
import org.nl.wms.sch.manage.AbstractAcsTask;
import org.nl.wms.sch.manage.AreaEnum;
@@ -320,8 +321,6 @@ public class CallMaterialTask extends AbstractAcsTask {
break;
}
}
JSONObject param = new JSONObject();
param.put("material_id", material_id);
param.put("area_type", startArea_type);
@@ -330,6 +329,26 @@ public class CallMaterialTask extends AbstractAcsTask {
param.put("group_device", group_device);
JSONObject outStructObj = StructFindUtil.getOutStruct(param);
if (ObjectUtil.isEmpty(outStructObj)) {
//假如没有货且下料位两个都为空下发acs动作信号
WmsToAcsServiceImpl wmsToAcsService = new WmsToAcsServiceImpl();
if (StrUtil.equals(next_point_code, "FJJXSSLW101") || StrUtil.equals(next_point_code, "FJJXSSLW102")) {
JSONObject jo = new JSONObject();
JSONArray arr = new JSONArray();
jo.put("device_code", "FJJXS1");
jo.put("code", "to_feedback");
jo.put("value", "10");
arr.add(jo);
wmsToAcsService.action(arr);
}
if (StrUtil.equals(next_point_code, "FJJXSSLW301") || StrUtil.equals(next_point_code, "FJJXSSLW301")) {
JSONObject jo = new JSONObject();
JSONArray arr = new JSONArray();
jo.put("device_code", "FJJXS3");
jo.put("code", "to_feedback");
jo.put("value", "10");
arr.add(jo);
wmsToAcsService.action(arr);
}
throw new BadRequestException("未找到合适的出库仓位!");
}
qty = outStructObj.getString("canuse_qty");