rev:空木箱入库给ACS木箱信息字段

This commit is contained in:
zhouz
2024-05-11 09:25:11 +08:00
parent ce168c147b
commit e79f50f09b
8 changed files with 107 additions and 11 deletions

View File

@@ -39,6 +39,7 @@ public class TwoInBoxTrussTask extends AbstractAcsTask {
for (int i = 0; i < arr.size(); i++) {
JSONObject json = arr.getJSONObject(i);
JSONObject params = json.getJSONObject("params");
char dtl_type = json.getString("task_type").charAt(json.getString("task_type").length() - 1);
AcsTaskDto dto = AcsTaskDto.builder()
.ext_task_id(json.getString("task_id"))
@@ -51,6 +52,11 @@ public class TwoInBoxTrussTask extends AbstractAcsTask {
.class_type(json.getString("task_type"))
.dtl_type(String.valueOf(dtl_type))
.remark(json.getString("remark"))
.layer(json.getString("layer"))
.barcode(params.getString("box_no"))
.height(params.getString("height"))
.width(params.getString("width"))
.length(params.getString("length"))
.build();
resultList.add(dto);
}

View File

@@ -67,6 +67,11 @@ public class BstIvtBoxinfo implements Serializable {
*/
private String box_high;
/*
* 载具类型
*/
private String vehicle_type;
/*
* 捆绑数量
*/

View File

@@ -148,6 +148,15 @@ public class InBoxManageServiceImpl implements InBoxManageService {
/*
* 插入木箱对应载具表
*/
//查询对应的木箱信息
// 查询木箱信息
BstIvtBoxinfo boxDao = iBstIvtBoxinfoService.getOne(
new QueryWrapper<BstIvtBoxinfo>().lambda()
.eq(BstIvtBoxinfo::getBox_no, whereJson.getString("box_no"))
);
JSONObject jsonVehicle = vehicleTab.query("storagevehicle_code = '" + whereJson.getString("vehicle_code") + "'")
.uniqueResult(0);
@@ -169,8 +178,16 @@ public class InBoxManageServiceImpl implements InBoxManageService {
taskParam.put("task_type", "010713");
taskParam.put("start_device_code", whereJson.getString("point_code"));
taskParam.put("next_device_code", "1001");
taskParam.put("vehicle_code", whereJson.getString("box_no"));
taskParam.put("vehicle_code", whereJson.getString("vehicle_code"));
taskParam.put("vehicle_code2", whereJson.getString("vehicle_code"));
JSONObject param = new JSONObject();
param.put("layer",whereJson.getString("layer"));
param.put("box_length",boxDao.getBox_length());
param.put("box_width",boxDao.getBox_width());
param.put("box_high",boxDao.getBox_high());
param.put("vehicle_type", boxDao.getVehicle_type());
param.put("box_no", whereJson.getString("box_no"));
taskParam.put("request_param", param.toString());
TwoInBoxTrussTask taskBean = new TwoInBoxTrussTask();
taskBean.createTask(taskParam);

View File

@@ -63,6 +63,14 @@ public class RawFoilController {
return new ResponseEntity<>(rawFoilService.needEmptyAxisTest(whereJson), HttpStatus.OK);
}
@PostMapping("/createOrder")
@Log("创建工单")
public ResponseEntity<Object> createOrder(@RequestBody JSONObject whereJson) {
return new ResponseEntity<>(rawFoilService.createOrder(whereJson), HttpStatus.OK);
}
@PostMapping("/needEmptyVehicle")
@Log("呼叫空轴")

View File

@@ -44,6 +44,15 @@ public interface RawFoilService {
*/
JSONObject needEmptyAxisTest(JSONObject whereJson);
/**
* 创建工单
*
* @param whereJson /
* @return JSONObject
*/
JSONObject createOrder(JSONObject whereJson);
/**
* 呼叫空卷轴
*

View File

@@ -376,6 +376,16 @@ public class BakingServiceImpl implements BakingService {
if (ObjectUtil.isEmpty(point_code2)) {
throw new BadRequestException("没有无货且没有任务的点位类型为出箱的烘箱对接位!");
}
JSONObject jsonRaw = rawTab.query("container_name = '" + jsonHotIvt.getString("container_name") + "' and is_delete = '0'").uniqueResult(0);
if (ObjectUtil.isEmpty(jsonRaw)) {
throw new BadRequestException("未查询到母卷号:" + jsonHotIvt.getString("container_name") + "对应的生箔工单!");
}
JSONObject jsonMater = materTab.query("material_code = '" + jsonRaw.getString("product_name") + "'").uniqueResult(0);
if (ObjectUtil.isEmpty(jsonMater)) {
throw new BadRequestException("物料基础信息中无此物料!");
}
// 3.创建任务
JSONObject param = new JSONObject();
param.put("point_code1", point_code1);
@@ -388,15 +398,6 @@ public class BakingServiceImpl implements BakingService {
//查询该母卷对应最近的一条入烘箱记录
JSONObject last_hot_mst = WQLObject.getWQLObject("ST_IVT_HotRegionIOMst").query("container_name = '" + jsonHotIvt.getString("container_name") + "' AND io_type = '0' order by confirm_time desc").uniqueResult(0);
JSONObject jsonRaw = rawTab.query("container_name = '" + jsonHotIvt.getString("container_name") + "' and is_delete = '0'").uniqueResult(0);
if (ObjectUtil.isEmpty(jsonRaw)) {
throw new BadRequestException("未查询到母卷号:" + jsonHotIvt.getString("container_name") + "对应的生箔工单!");
}
JSONObject jsonMater = materTab.query("material_code = '" + jsonRaw.getString("product_name") + "'").uniqueResult(0);
if (ObjectUtil.isEmpty(jsonMater)) {
throw new BadRequestException("物料基础信息中无此物料!");
}
JSONObject hotParam = new JSONObject();
hotParam.put("container_name", jsonRaw.getString("container_name"));
hotParam.put("workorder_id", jsonRaw.getString("workorder_id"));

View File

@@ -203,13 +203,55 @@ public class RawFoilServiceImpl implements RawFoilService {
return jo;
}
@Override
public JSONObject createOrder(JSONObject whereJson) {
WQLObject rawTab = WQLObject.getWQLObject("PDM_BI_RawFoilWorkOrder"); // 生箔工单表
WQLObject sbTab = WQLObject.getWQLObject("ST_IVT_SbPointIvt"); // 生箔点位库存表
JSONObject device_jo = sbTab.query("point_code = '" + whereJson.getString("point_code") + "'").uniqueResult(0);
String container_name = whereJson.getString("container_name");
//判断该母卷是否存在工单
JSONObject raw_jo = WQLObject.getWQLObject("pdm_bi_rawfoilworkorder").query("container_name = '"+container_name+"'").uniqueResult(0);
if (ObjectUtil.isNotEmpty(raw_jo)){
throw new BadRequestException("当前母卷存在生箔工单,不允许创建!");
}
// 插入生箔工序工单表
JSONObject json = new JSONObject();
json.put("workorder_id", IdUtil.getSnowflake(1, 1).nextId());
json.put("container_name", container_name);
json.put("resource_name", device_jo.getString("ext_code"));
json.put("mfg_order_name", "test");
json.put("product_name", "741011000000361");
json.put("description", "铜箔|双面光|原箔|6微米|1350");
json.put("theory_height", 2000.00);
json.put("eqp_velocity", 20.00);
json.put("up_coiler_date", DateUtil.now());
json.put("is_reload_send", 0);
json.put("order_type", device_jo.getString("device_type"));
json.put("product_area", "B2");
json.put("realstart_time", DateUtil.now());
json.put("status", "01");
json.put("is_delete", "0");
json.put("agvno", "0");
json.put("productin_qty", 0);
json.put("create_id", "1");
json.put("create_name", "管理员");
json.put("create_time", DateUtil.now());
rawTab.insert(json);
JSONObject jo = new JSONObject();
jo.put("message", "操作成功!");
return jo;
}
@Override
@Transactional(rollbackFor = Exception.class)
public JSONObject needEmptyAxisTest(JSONObject whereJson) {
WQLObject rawTab = WQLObject.getWQLObject("PDM_BI_RawFoilWorkOrder"); // 生箔工单表
WQLObject sbTab = WQLObject.getWQLObject("ST_IVT_SbPointIvt"); // 生箔点位库存表
JSONObject device_jo = sbTab.query("point_code = '"+whereJson.getString("point_code")+"'").uniqueResult(0);
JSONObject device_jo = sbTab.query("point_code = '" + whereJson.getString("point_code") + "'").uniqueResult(0);
// 插入生箔工序工单表
JSONObject json = new JSONObject();
json.put("workorder_id", IdUtil.getSnowflake(1, 1).nextId());

View File

@@ -114,6 +114,14 @@ public class AcsTaskDto {
*/
private String empty_site;
private String layer;
private String length;
private String width;
private String height;
private String barcode;
}