手持人工压机下料

This commit is contained in:
18188916393
2022-10-12 11:54:30 +08:00
parent 6846288b0d
commit 4ca3835f74
4 changed files with 41 additions and 3 deletions

View File

@@ -15,7 +15,7 @@ public class PressureUtil {
public static String record(JSONObject whereJson) {
String device_code = (String) whereJson.get("device_code");
String reason = (String) whereJson.get("reason");
int qty = (int) whereJson.get("qty");
int qty =Integer.valueOf((String)whereJson.get("qty"));
String record_id = "";
//根据设备查询当前设备以及排产单号
JSONObject joo = WQL.getWO("QSTRUCT_RULE").addParam("flag", "12").addParam("point_code", device_code).process().uniqueResult(0);

View File

@@ -116,7 +116,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
if (StrUtil.equals(area_type, AreaEnum.YZQY.getCode()) && stewing_time <= 0) {
//1.首先更新所有输送线的点位状态
JSONArray pointarr = WQL.getWO("ACSTOMES_001").addParam("area_type", "07").addParam("flag", "4").process().getResultJSONArray(0);
PointUpdateUtil.updatePoint(pointarr);
//PointUpdateUtil.updatePoint(pointarr);
//2.找一个合适的输送带
JSONObject pointObj = StructFindUtil.getConveyor(materiralObj);
//如果未找到合适的输送带 就去货架

View File

@@ -1,6 +1,7 @@
package org.nl.wms.pda.sendMaterial.service.impl;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.NumberUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
@@ -12,9 +13,12 @@ import lombok.extern.slf4j.Slf4j;
import org.nl.exception.BadRequestException;
import org.nl.modules.system.service.UserService;
import org.nl.utils.SecurityUtils;
import org.nl.wms.WorkProcedureEnum;
import org.nl.wms.database.service.MaterialService;
import org.nl.wms.ext.acs.service.impl.AcsToWmsServiceImpl;
import org.nl.wms.pda.sendMaterial.service.SendMaterialService;
import org.nl.wms.pda.exception.PdaRequestException;
import org.nl.wms.sch.manage.buss.FmjToPackIngTask;
import org.nl.wms.sch.manage.buss.SendMaterialTask;
import org.nl.wql.core.bean.WQLObject;
import org.springframework.security.crypto.password.PasswordEncoder;
@@ -31,6 +35,7 @@ import java.util.Map;
@Slf4j
public class SendMaterialServiceImpl implements SendMaterialService {
private final SendMaterialTask sendMaterialTask;
private final AcsToWmsServiceImpl acsToWmsServiceImpl;
@Override
public Map<String, Object> queryDevice(Map<String, String> jsonObject) {
@@ -95,7 +100,40 @@ public class SendMaterialServiceImpl implements SendMaterialService {
jsonObject.put("vehicle_code", vehicle_code);
jsonObject.put("qty", qty);
jsonObject.put("is_full", is_full);
sendMaterialTask.createTask((JSONObject) JSON.toJSON(jsonObject));
//假如是压制下料 需要组盘
String workprocedure_id = param.get("workprocedure_id");
WQLObject material_table = WQLObject.getWQLObject("md_me_material");
if (StrUtil.equals(workprocedure_id, WorkProcedureEnum.YZGX.getId())) {
JSONObject groubObj = new JSONObject();
String material_id = produceInfoByCode.getString("material_id");
String producetask_id = produceInfoByCode.getString("producetask_id");
JSONObject materialObj = material_table.query("material_id='" + material_id + "'").uniqueResult(0);
String group_id = IdUtil.getSnowflake(1, 1).nextId() + "";
groubObj.put("device_id", produceInfoByCode.getString("device_id"));
groubObj.put("group_id", group_id);
groubObj.put("material_id", material_id);
groubObj.put("material_code", materialObj.getString("material_code"));
groubObj.put("material_name", materialObj.getString("material_name"));
//groubObj.put("product_code", product_code);
groubObj.put("cust_id", produceInfoByCode.getString("yh_name"));
groubObj.put("qty", qty);
groubObj.put("producetask_id", producetask_id);
groubObj.put("is_autopackage", "1");
groubObj.put("is_full", is_full);
groubObj.put("create_id", SecurityUtils.getCurrentUserId());
groubObj.put("create_name", SecurityUtils.getNickName());
groubObj.put("create_time", DateUtil.now());
WQLObject.getWQLObject("st_buss_vehiclegroup").insert(groubObj);
groubObj.put("type", "1");
groubObj.put("group_id", group_id);
groubObj.put("producetask_id", producetask_id);
groubObj.put("device_code", start_point_code);
groubObj.put("unqualified_qty", "0");
acsToWmsServiceImpl.receiveTaskFromAcs(groubObj);
} else {
sendMaterialTask.createTask((JSONObject) JSON.toJSON(jsonObject));
}
JSONObject returnjo = new JSONObject();
returnjo.put("code", "1");
returnjo.put("desc", "操作成功!");