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

@@ -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;
}