add:新增字段
This commit is contained in:
@@ -180,4 +180,6 @@ public class PdmBiSlittingproductionplan implements Serializable {
|
||||
private String box_description;
|
||||
/** 批次号 */
|
||||
private String pscn;
|
||||
/** 备注 */
|
||||
private String remark;
|
||||
}
|
||||
|
||||
@@ -49,20 +49,6 @@ public class RawFoilController {
|
||||
return new ResponseEntity<>(rawFoilService.queryRawFoilList(whereJson, ctx), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/needEmptyAxis")
|
||||
@Log("呼叫")
|
||||
|
||||
public ResponseEntity<Object> needEmptyAxis(@RequestBody JSONObject whereJson) {
|
||||
return new ResponseEntity<>(rawFoilService.needEmptyAxis(whereJson), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/needEmptyAxisTest")
|
||||
@Log("呼叫")
|
||||
|
||||
public ResponseEntity<Object> needEmptyAxisTest(@RequestBody JSONObject whereJson) {
|
||||
return new ResponseEntity<>(rawFoilService.needEmptyAxisTest(whereJson), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/createOrder")
|
||||
@Log("创建工单")
|
||||
|
||||
@@ -70,14 +56,6 @@ public class RawFoilController {
|
||||
return new ResponseEntity<>(rawFoilService.createOrder(whereJson), HttpStatus.OK);
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/needEmptyVehicle")
|
||||
@Log("呼叫空轴")
|
||||
|
||||
public ResponseEntity<Object> needEmptyVehicle(@RequestBody JSONObject whereJson) {
|
||||
return new ResponseEntity<>(rawFoilService.needEmptyVehicle(whereJson), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/confirmBlanking")
|
||||
@Log("确认下卷")
|
||||
|
||||
@@ -85,22 +63,6 @@ public class RawFoilController {
|
||||
return new ResponseEntity<>(rawFoilService.confirmBlanking(whereJson), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/finishBlanking")
|
||||
@Log("下卷完成")
|
||||
|
||||
public ResponseEntity<Object> finishBlanking(@RequestBody JSONObject whereJson) {
|
||||
rawFoilService.finishBlanking(whereJson);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/finish")
|
||||
@Log("完成")
|
||||
|
||||
public ResponseEntity<Object> finish(@RequestBody JSONObject whereJson) {
|
||||
rawFoilService.finish(whereJson);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/start")
|
||||
@Log("开始生箔工单")
|
||||
|
||||
|
||||
@@ -30,22 +30,6 @@ public interface RawFoilService {
|
||||
*/
|
||||
JSONObject queryRawFoilList(JSONObject whereJson, HttpContext ctx);
|
||||
|
||||
/**
|
||||
* 呼叫
|
||||
*
|
||||
* @param whereJson /
|
||||
* @return JSONObject
|
||||
*/
|
||||
JSONObject needEmptyAxis(JSONObject whereJson);
|
||||
|
||||
/**
|
||||
* 呼叫
|
||||
*
|
||||
* @param whereJson /
|
||||
* @return JSONObject
|
||||
*/
|
||||
JSONObject needEmptyAxisTest(JSONObject whereJson);
|
||||
|
||||
/**
|
||||
* 创建工单
|
||||
*
|
||||
@@ -55,14 +39,6 @@ public interface RawFoilService {
|
||||
JSONObject createOrder(JSONObject whereJson);
|
||||
|
||||
|
||||
/**
|
||||
* 呼叫空卷轴
|
||||
*
|
||||
* @param whereJson /
|
||||
* @return JSONObject
|
||||
*/
|
||||
JSONObject needEmptyVehicle(JSONObject whereJson);
|
||||
|
||||
/**
|
||||
* 准备就绪
|
||||
*
|
||||
@@ -71,22 +47,6 @@ public interface RawFoilService {
|
||||
*/
|
||||
JSONObject confirmBlanking(JSONObject whereJson);
|
||||
|
||||
/**
|
||||
* 下卷完成
|
||||
*
|
||||
* @param whereJson /
|
||||
* @return JSONObject
|
||||
*/
|
||||
JSONObject finishBlanking(JSONObject whereJson);
|
||||
|
||||
/**
|
||||
* 完成
|
||||
*
|
||||
* @param whereJson /
|
||||
* @return JSONObject
|
||||
*/
|
||||
JSONObject finish(JSONObject whereJson);
|
||||
|
||||
/**
|
||||
* 下卷
|
||||
*
|
||||
|
||||
@@ -230,9 +230,6 @@ public class BakingServiceImpl implements BakingService {
|
||||
}
|
||||
JSONObject map = new JSONObject();
|
||||
map.put("flag", "1");
|
||||
if (product_area.equals("B2")) {
|
||||
map.put("flag", "302");
|
||||
}
|
||||
map.put("reging_id", reging_id);
|
||||
map.put("point_location", point_location);
|
||||
//只找入箱点位
|
||||
@@ -242,34 +239,10 @@ public class BakingServiceImpl implements BakingService {
|
||||
if (ObjectUtil.isEmpty(point_code2_jo)) {
|
||||
throw new BadRequestException("未查询到可用的点位类型为入箱的烘箱对接位!");
|
||||
}
|
||||
/*if (ObjectUtil.isEmpty(pointArr)) {
|
||||
if (StrUtil.equals(point_location, "0")) map.put("point_location", "1");
|
||||
if (StrUtil.equals(point_location, "1")) map.put("point_location", "0");
|
||||
pointArr = WQL.getWO("PDA_OVENINANDOUT_01").addParamMap(map).process().getResultJSONArray(0);
|
||||
|
||||
if (ObjectUtil.isEmpty(pointArr)) throw new BadRequestException("没有空暂存位");
|
||||
}*/
|
||||
|
||||
JSONObject jsonHotIvt = getJsonObject(product_area, point_code2_jo, temperature);
|
||||
if (ObjectUtil.isEmpty(jsonHotIvt)) {
|
||||
if (product_area.equals("B2")) {
|
||||
String cant_location1 = point_code2_jo.getString("point_location");
|
||||
String cant_location = "('" + point_code2_jo.getString("point_location") + "')";
|
||||
map.put("cant_location", cant_location);
|
||||
point_code2_jo = WQL.getWO("PDA_OVENINANDOUT_01").addParamMap(map).process().uniqueResult(0);
|
||||
jsonHotIvt = getJsonObject(product_area, point_code2_jo, temperature);
|
||||
if (ObjectUtil.isEmpty(jsonHotIvt)) {
|
||||
cant_location = "('" + cant_location1 + "','" + point_code2_jo.getString("point_location") + "')";
|
||||
map.put("cant_location", cant_location);
|
||||
point_code2_jo = WQL.getWO("PDA_OVENINANDOUT_01").addParamMap(map).process().uniqueResult(0);
|
||||
jsonHotIvt = getJsonObject(product_area, point_code2_jo, temperature);
|
||||
if (ObjectUtil.isEmpty(jsonHotIvt)) {
|
||||
throw new BadRequestException("烘烤区没有合适温度的空位!");
|
||||
}
|
||||
}
|
||||
} else {
|
||||
throw new BadRequestException("烘烤区没有合适温度的空位!");
|
||||
}
|
||||
throw new BadRequestException("烘烤区没有合适温度的空位!");
|
||||
}
|
||||
|
||||
// 3.创建冷却区 --> 烘烤区任务
|
||||
@@ -535,7 +508,7 @@ public class BakingServiceImpl implements BakingService {
|
||||
}
|
||||
|
||||
// 1.获取此暂存位的生产区域和上下位置
|
||||
JSONObject jsonPoint = pointTab.query("point_code = '" + point_code1 + "'").uniqueResult(0);
|
||||
JSONObject jsonPoint = pointTab.query("point_code = '" + point_code1 + "' and point_type = '5'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(jsonPoint)) {
|
||||
throw new BadRequestException("请扫描点位类型为出箱的烘箱对接位!");
|
||||
}
|
||||
@@ -658,11 +631,11 @@ public class BakingServiceImpl implements BakingService {
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public JSONObject reBake(JSONObject whereJson) {
|
||||
String container_name = whereJson.getString("container_name"); // 母卷号
|
||||
if (ObjectUtil.isEmpty(container_name)){
|
||||
if (ObjectUtil.isEmpty(container_name)) {
|
||||
throw new BadRequestException("请输入母卷号!");
|
||||
}
|
||||
String type = whereJson.getString("type");//1-决策入烘箱 2-决策入冷却
|
||||
if (ObjectUtil.isEmpty(type)){
|
||||
if (ObjectUtil.isEmpty(type)) {
|
||||
throw new BadRequestException("请选择类型!");
|
||||
}
|
||||
JSONObject raw_jo = WQLObject.getWQLObject("PDM_BI_RawFoilWorkOrder").query("container_name ='" + container_name + "'").uniqueResult(0);
|
||||
@@ -795,7 +768,7 @@ public class BakingServiceImpl implements BakingService {
|
||||
throw new BadRequestException("未查询到母卷号:" + container_name + "对应的生箔机台编号!");
|
||||
}
|
||||
|
||||
if (StrUtil.equals("1", sb_jo.getString("mes_used"))&& !"1".equals(raw_jo.getString("is_baking"))) {
|
||||
if (StrUtil.equals("1", sb_jo.getString("mes_used")) && !"1".equals(raw_jo.getString("is_baking"))) {
|
||||
throw new BadRequestException("该母卷在MES上未进行决策入烘箱,不允许进行入烘箱操作!");
|
||||
}
|
||||
|
||||
@@ -812,8 +785,8 @@ public class BakingServiceImpl implements BakingService {
|
||||
throw new BadRequestException("点位不能为空");
|
||||
}
|
||||
|
||||
JSONObject jsonPointZc = pointTab.query("point_code = '" + point_code1 + "'").uniqueResult(0);
|
||||
|
||||
JSONObject jsonPointZc = pointTab.query("point_code = '" + point_code1 + "' and point_type = '5'").uniqueResult(0);
|
||||
|
||||
if (ObjectUtil.isNotEmpty(jsonPointZc)) {
|
||||
if (!in_area_id.contains(jsonPointZc.getString("product_area"))) {
|
||||
@@ -880,7 +853,7 @@ public class BakingServiceImpl implements BakingService {
|
||||
hotParam.put("oven_time", hours);
|
||||
this.createHotIoMst(hotParam);
|
||||
} else {
|
||||
throw new BadRequestException("请扫描正确的对接点位!");
|
||||
throw new BadRequestException("请扫描点位类型为出箱的烘箱对接位!");
|
||||
}
|
||||
} else if (StrUtil.equals(option, "1")) {
|
||||
// 入冷却
|
||||
@@ -907,12 +880,12 @@ public class BakingServiceImpl implements BakingService {
|
||||
throw new BadRequestException("未查询到母卷号:" + container_name + "对应的生箔机台编号!");
|
||||
}
|
||||
|
||||
if (StrUtil.equals("1", sb_jo.getString("mes_used")) && !"1".equals(raw_jo.getString("is_instor"))) {
|
||||
throw new BadRequestException("该母卷在MES上未进行决策入半成品库,不允许进行入冷却操作!");
|
||||
}
|
||||
// if (StrUtil.equals("1", sb_jo.getString("mes_used")) && !"1".equals(raw_jo.getString("is_instor"))) {
|
||||
// throw new BadRequestException("该母卷在MES上未进行决策入半成品库,不允许进行入冷却操作!");
|
||||
// }
|
||||
|
||||
// 1.获取此暂存位的生产区域和上下位置
|
||||
JSONObject jsonPoint = pointTab.query("point_code = '" + point_code1 + "'").uniqueResult(0);
|
||||
JSONObject jsonPoint = pointTab.query("point_code = '" + point_code1 + "' and point_type = '5'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(jsonPoint)) {
|
||||
throw new BadRequestException("请扫描点位类型为出箱的烘箱对接位!");
|
||||
}
|
||||
|
||||
@@ -127,236 +127,77 @@ public class FeedingServiceImpl implements FeedingService {
|
||||
throw new BadRequestException("该点位上不存在母卷!");
|
||||
}
|
||||
if (!StrUtil.equals(cool_jo.getString("container_name"), container_name)) {
|
||||
throw new BadRequestException("该点位:"+point_code+"不存在母卷:"+container_name);
|
||||
throw new BadRequestException("该点位:" + point_code + "不存在母卷:" + container_name);
|
||||
}
|
||||
JSONObject result = new JSONObject();
|
||||
result.put("message", "操作成功!");
|
||||
//B1烘箱外边的冷却点
|
||||
if (cool_jo.getString("product_area").equals("B1") && cool_jo.getString("point_type").equals("1")) {
|
||||
JSONObject cut_jo = WQLObject.getWQLObject("st_ivt_cutpointivt").query("full_point_code = '" + next_point_code + "' and product_area='"+cool_jo.getString("product_area")+"'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(cut_jo)) {
|
||||
cut_jo = WQLObject.getWQLObject("st_ivt_coolpointivt").query("full_point_code = '" + next_point_code + "' and product_area='"+cool_jo.getString("product_area")+"' and point_type in ('1','6')").uniqueResult(0);
|
||||
}
|
||||
if (ObjectUtil.isEmpty(cut_jo)) {
|
||||
throw new BadRequestException("请扫描B1车间分切机满轴点位、分切缓存位满轴点位、生箔冷却缓存位满轴点位做为终点!");
|
||||
}
|
||||
//创建AGV任务
|
||||
JSONObject jo = new JSONObject();
|
||||
if (StrUtil.equals("01", cut_jo.getString("empty_point_status"))) {
|
||||
jo.put("point_code1", cool_jo.getString("full_point_code"));
|
||||
jo.put("point_code2", cut_jo.getString("full_point_code"));
|
||||
jo.put("material_code",cool_jo.getString("container_name"));
|
||||
jo.put("product_area", cut_jo.getString("product_area"));
|
||||
jo.put("task_type", "010302");
|
||||
} else {
|
||||
jo.put("point_code1", cool_jo.getString("full_point_code"));
|
||||
jo.put("point_code2", cut_jo.getString("full_point_code"));
|
||||
jo.put("point_code3", cut_jo.getString("empty_point_code"));
|
||||
// 2.找冷却区空货位
|
||||
JSONObject map = new JSONObject();
|
||||
map.put("flag", "2");
|
||||
map.put("product_area", cut_jo.getString("product_area"));
|
||||
map.put("point_location", "0");
|
||||
JSONObject jo = new JSONObject();
|
||||
//查询该分切机对应的点位
|
||||
JSONObject cut_jo = WQLObject.getWQLObject("st_ivt_cutpointivt").query("full_point_code = '" + next_point_code + "'").uniqueResult(0);
|
||||
|
||||
JSONObject jsonCooIvt = WQL.getWO("PDA_OVENINANDOUT_01").addParamMap(map).process().uniqueResult(0);
|
||||
// 如果为空
|
||||
if (ObjectUtil.isEmpty(jsonCooIvt)) {
|
||||
map.put("point_location", "1");
|
||||
jsonCooIvt = WQL.getWO("PDA_OVENINANDOUT_01").addParamMap(map).process().uniqueResult(0);
|
||||
}
|
||||
if (ObjectUtil.isEmpty(jsonCooIvt)) {
|
||||
throw new BadRequestException("B1车间冷却区空位不足");
|
||||
}
|
||||
jo.put("point_code4", jsonCooIvt.getString("empty_point_code"));
|
||||
jo.put("material_code", cool_jo.getString("container_name"));
|
||||
jo.put("product_area", cut_jo.getString("product_area"));
|
||||
jo.put("task_type", "010301");
|
||||
}
|
||||
AbstractAcsTask task = new CoolCutTask();
|
||||
task.createTask(jo);
|
||||
|
||||
return result;
|
||||
if (StrUtil.isNotEmpty(cut_jo.getString("container_name")) || "02".equals(cut_jo.getString("full_point_status"))) {
|
||||
throw new BadRequestException("该分切机对应的上料位存在母卷,不能下发搬运任务!");
|
||||
}
|
||||
if (StrUtil.equals("01", cut_jo.getString("empty_point_status"))) {
|
||||
jo.put("point_code1", point_code);
|
||||
jo.put("point_code2", next_point_code);
|
||||
jo.put("vehicle_code", cool_jo.getString("container_name"));
|
||||
jo.put("product_area", cut_jo.getString("product_area"));
|
||||
jo.put("task_type", "010302");
|
||||
} else {
|
||||
jo.put("point_code1", point_code);
|
||||
jo.put("point_code2", next_point_code);
|
||||
jo.put("point_code3", cut_jo.getString("empty_point_code"));
|
||||
jo.put("point_code4", cool_jo.getString("empty_point_code"));
|
||||
jo.put("vehicle_code", cool_jo.getString("container_name"));
|
||||
jo.put("vehicle_code2", cut_jo.getString("empty_vehicle_code"));
|
||||
jo.put("product_area", cut_jo.getString("product_area"));
|
||||
jo.put("task_type", "010301");
|
||||
}
|
||||
|
||||
if (cool_jo.getString("product_area").equals("B1") && cool_jo.getString("point_type").equals("3")) {
|
||||
if (ObjectUtil.isNotEmpty(cool_jo) && cool_jo.getString("point_type").equals("4")) {
|
||||
JSONObject cut_jo = WQLObject.getWQLObject("st_ivt_cutpointivt").query("full_point_code = '" + next_point_code + "'").uniqueResult(0);
|
||||
//起点为分切缓存位,终点为分切机
|
||||
JSONObject jo = new JSONObject();
|
||||
if (StrUtil.equals("01", cut_jo.getString("empty_point_status"))) {
|
||||
jo.put("point_code1", cool_jo.getString("full_point_code"));
|
||||
jo.put("point_code2", cut_jo.getString("full_point_code"));
|
||||
jo.put("material_code", cool_jo.getString("container_name"));
|
||||
jo.put("product_area", cut_jo.getString("product_area"));
|
||||
jo.put("task_type", "010302");
|
||||
} else {
|
||||
jo.put("point_code1", cool_jo.getString("full_point_code"));
|
||||
jo.put("point_code2", cut_jo.getString("full_point_code"));
|
||||
jo.put("point_code3", cut_jo.getString("empty_point_code"));
|
||||
// 2.找冷却区空货位
|
||||
JSONObject map = new JSONObject();
|
||||
map.put("flag", "2");
|
||||
map.put("product_area", cut_jo.getString("product_area"));
|
||||
map.put("point_location", "0");
|
||||
|
||||
JSONObject jsonCooIvt = WQL.getWO("PDA_OVENINANDOUT_01").addParamMap(map).process().uniqueResult(0);
|
||||
// 如果为空
|
||||
if (ObjectUtil.isEmpty(jsonCooIvt)) {
|
||||
map.put("point_location", "1");
|
||||
jsonCooIvt = WQL.getWO("PDA_OVENINANDOUT_01").addParamMap(map).process().uniqueResult(0);
|
||||
}
|
||||
if (ObjectUtil.isEmpty(jsonCooIvt)) {
|
||||
throw new BadRequestException("冷却区空位不足");
|
||||
}
|
||||
jo.put("point_code4", jsonCooIvt.getString("empty_point_code"));
|
||||
jo.put("material_code", cool_jo.getString("container_name"));
|
||||
jo.put("product_area", cut_jo.getString("product_area"));
|
||||
jo.put("task_type", "010301");
|
||||
}
|
||||
AbstractAcsTask task = new CoolCutTask();
|
||||
task.createTask(jo);
|
||||
} else {
|
||||
JSONObject cut_jo = WQLObject.getWQLObject("st_ivt_cutpointivt").query("full_point_code = '" + next_point_code + "'").uniqueResult(0);
|
||||
JSONObject next_cool_jo = WQLObject.getWQLObject("st_ivt_coolpointivt").query("full_point_code = '" + next_point_code + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(cut_jo) && ObjectUtil.isEmpty(next_cool_jo)) {
|
||||
throw new BadRequestException("请扫描分切机满轴点位或分切缓存位满轴点位做为终点!");
|
||||
}
|
||||
JSONObject task_jo = new JSONObject();
|
||||
task_jo.put("point_code1", cool_jo.getString("point_code"));
|
||||
String reging_id = "";
|
||||
//查询出的对接位
|
||||
switch (cool_jo.getString("product_area")) {
|
||||
case "A1":
|
||||
reging_id = RegionTypeEnum.A_HKZC.getId();
|
||||
break;
|
||||
case "A2":
|
||||
reging_id = RegionTypeEnum.B_HKZC.getId();
|
||||
break;
|
||||
case "A3":
|
||||
reging_id = RegionTypeEnum.C_HKZC.getId();
|
||||
break;
|
||||
case "A4":
|
||||
reging_id = RegionTypeEnum.D_HKZC.getId();
|
||||
break;
|
||||
case "B1":
|
||||
reging_id = RegionTypeEnum.B1_HKZC.getId();
|
||||
break;
|
||||
case "B2":
|
||||
reging_id = RegionTypeEnum.B2_HKZC.getId();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
JSONObject map = new JSONObject();
|
||||
map.put("flag", "4");
|
||||
map.put("reging_id", reging_id);
|
||||
map.put("point_location", cool_jo.getString("point_location"));
|
||||
//只找入箱点位
|
||||
map.put("point_type", "5");
|
||||
CoolCutTask coolCutTask = SpringContextHolder.getBean(CoolCutTask.class);
|
||||
String task_id = coolCutTask.createTask(jo);
|
||||
|
||||
JSONObject pointArr = WQL.getWO("PDA_OVENINANDOUT_01").addParamMap(map).process().uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(pointArr)) {
|
||||
map.put("point_location", cool_jo.getString("point_location").equals("0") ? "1" : "0");
|
||||
pointArr = WQL.getWO("PDA_OVENINANDOUT_01").addParamMap(map).process().uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(pointArr)) {
|
||||
throw new BadRequestException("没有无货且没有任务的点位类型为出箱的烘箱对接位!");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
task_jo.put("point_code2", pointArr.getString("point_code"));
|
||||
//将分切机的点位作为目的点,桁架任务完成时,自动创建AGV任务
|
||||
task_jo.put("point_code3", next_point_code);
|
||||
task_jo.put("material_code", cool_jo.getString("container_name"));
|
||||
task_jo.put("product_area", cool_jo.getString("product_area"));
|
||||
task_jo.put("task_type", "010205");
|
||||
OutHotTask outHotTask = new OutHotTask();
|
||||
String task_id = outHotTask.createTask(task_jo);
|
||||
}
|
||||
//查询该母卷号对应的生箔信息
|
||||
JSONObject raw_jo = WQLObject.getWQLObject("pdm_bi_rawfoilworkorder").query("container_name = '" + cool_jo.getString("container_name") + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(raw_jo)) {
|
||||
throw new BadRequestException("未查询到母卷:" + cool_jo.getString("container_name") + ",对应的生箔信息!");
|
||||
}
|
||||
else {
|
||||
JSONObject jo = new JSONObject();
|
||||
//查询该分切机对应的点位
|
||||
JSONObject cut_jo = WQLObject.getWQLObject("st_ivt_cutpointivt").query("full_point_code = '" + next_point_code + "'").uniqueResult(0);
|
||||
JSONObject zz_jo = WQLObject.getWQLObject("sch_base_point").query("point_type = '8' AND is_used = '1' AND is_delete = '0' AND point_code = '" + next_point_code + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(cut_jo)) {
|
||||
//查询中转区的点位
|
||||
if (ObjectUtil.isEmpty(zz_jo)) {
|
||||
throw new BadRequestException("请扫描或者输入分切区域的满轴点位或表处中转区做为终点!");
|
||||
}
|
||||
if (zz_jo.getString("point_status").equals("2")) {
|
||||
throw new BadRequestException("该表处中转区点位上存在母卷,不能下发搬运任务!");
|
||||
}
|
||||
jo.put("point_code1", point_code);
|
||||
jo.put("point_code2", next_point_code);
|
||||
jo.put("vehicle_code", cool_jo.getString("container_name"));
|
||||
jo.put("product_area", zz_jo.getString("product_area"));
|
||||
jo.put("task_type", "010305");
|
||||
} else {
|
||||
|
||||
if (StrUtil.isNotEmpty(cut_jo.getString("container_name")) || "02".equals(cut_jo.getString("full_point_status"))) {
|
||||
throw new BadRequestException("该分切机对应的上料位存在母卷,不能下发搬运任务!");
|
||||
}
|
||||
if (StrUtil.equals("01", cut_jo.getString("empty_point_status"))) {
|
||||
jo.put("point_code1", point_code);
|
||||
jo.put("point_code2", next_point_code);
|
||||
jo.put("vehicle_code", cool_jo.getString("container_name"));
|
||||
jo.put("product_area", cut_jo.getString("product_area"));
|
||||
jo.put("task_type", "010302");
|
||||
} else {
|
||||
jo.put("point_code1", point_code);
|
||||
jo.put("point_code2", next_point_code);
|
||||
jo.put("point_code3", cut_jo.getString("empty_point_code"));
|
||||
jo.put("point_code4", cool_jo.getString("empty_point_code"));
|
||||
jo.put("vehicle_code", cool_jo.getString("container_name"));
|
||||
jo.put("vehicle_code2", cut_jo.getString("empty_vehicle_code"));
|
||||
jo.put("product_area", cut_jo.getString("product_area"));
|
||||
jo.put("task_type", "010301");
|
||||
}
|
||||
}
|
||||
|
||||
CoolCutTask coolCutTask = SpringContextHolder.getBean(CoolCutTask.class);
|
||||
String task_id = coolCutTask.createTask(jo);
|
||||
|
||||
//查询该母卷号对应的生箔信息
|
||||
JSONObject raw_jo = WQLObject.getWQLObject("pdm_bi_rawfoilworkorder").query("container_name = '" + cool_jo.getString("container_name") + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(raw_jo)) {
|
||||
throw new BadRequestException("未查询到母卷:" + cool_jo.getString("container_name") + ",对应的生箔信息!");
|
||||
}
|
||||
|
||||
JSONObject mater_jo = WQLObject.getWQLObject("md_me_materialbase").query("material_code = '" + raw_jo.getString("product_name") + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(mater_jo)) {
|
||||
throw new BadRequestException("未查询到物料:" + raw_jo.getString("product_name") + "基础信息!");
|
||||
}
|
||||
|
||||
//生成半成品出库单据
|
||||
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String currentUsername = SecurityUtils.getCurrentUsername();
|
||||
|
||||
JSONObject jsonCool = new JSONObject();
|
||||
jsonCool.put("iostorinv_id", IdUtil.getSnowflake(1, 1).nextId());
|
||||
jsonCool.put("bill_code", CodeUtil.getNewCode("COOLREGION_BILL_CODE"));
|
||||
jsonCool.put("io_type", "1");
|
||||
jsonCool.put("material_id", mater_jo.getString("material_id"));
|
||||
jsonCool.put("pcsn", cool_jo.getString("container_name"));
|
||||
jsonCool.put("bill_status", "50");
|
||||
jsonCool.put("task_id", task_id);
|
||||
jsonCool.put("qty_unit_id", "1");
|
||||
jsonCool.put("start_point_code", cool_jo.getString("full_point_code"));
|
||||
jsonCool.put("end_point_code", ObjectUtil.isNotEmpty(cut_jo) ? cut_jo.getString("full_point_code") : zz_jo.getString("point_code"));
|
||||
jsonCool.put("create_mode", "03");
|
||||
jsonCool.put("create_id", currentUserId);
|
||||
jsonCool.put("create_name", currentUsername);
|
||||
jsonCool.put("create_time", DateUtil.now());
|
||||
jsonCool.put("update_optid", currentUserId);
|
||||
jsonCool.put("update_optname", currentUsername);
|
||||
jsonCool.put("update_time", DateUtil.now());
|
||||
jsonCool.put("confirm_optid", currentUserId);
|
||||
jsonCool.put("confirm_optname", currentUsername);
|
||||
jsonCool.put("confirm_time", DateUtil.now());
|
||||
WQLObject.getWQLObject("ST_IVT_CoolRegionIO").insert(jsonCool);
|
||||
JSONObject mater_jo = WQLObject.getWQLObject("md_me_materialbase").query("material_code = '" + raw_jo.getString("product_name") + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(mater_jo)) {
|
||||
throw new BadRequestException("未查询到物料:" + raw_jo.getString("product_name") + "基础信息!");
|
||||
}
|
||||
|
||||
//生成半成品出库单据
|
||||
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String currentUsername = SecurityUtils.getCurrentUsername();
|
||||
|
||||
JSONObject jsonCool = new JSONObject();
|
||||
jsonCool.put("iostorinv_id", IdUtil.getSnowflake(1, 1).nextId());
|
||||
jsonCool.put("bill_code", CodeUtil.getNewCode("COOLREGION_BILL_CODE"));
|
||||
jsonCool.put("io_type", "1");
|
||||
jsonCool.put("material_id", mater_jo.getString("material_id"));
|
||||
jsonCool.put("pcsn", cool_jo.getString("container_name"));
|
||||
jsonCool.put("bill_status", "50");
|
||||
jsonCool.put("task_id", task_id);
|
||||
jsonCool.put("qty_unit_id", "1");
|
||||
jsonCool.put("start_point_code", cool_jo.getString("full_point_code"));
|
||||
jsonCool.put("end_point_code", cut_jo.getString("full_point_code"));
|
||||
jsonCool.put("create_mode", "03");
|
||||
jsonCool.put("create_id", currentUserId);
|
||||
jsonCool.put("create_name", currentUsername);
|
||||
jsonCool.put("create_time", DateUtil.now());
|
||||
jsonCool.put("update_optid", currentUserId);
|
||||
jsonCool.put("update_optname", currentUsername);
|
||||
jsonCool.put("update_time", DateUtil.now());
|
||||
jsonCool.put("confirm_optid", currentUserId);
|
||||
jsonCool.put("confirm_optname", currentUsername);
|
||||
jsonCool.put("confirm_time", DateUtil.now());
|
||||
WQLObject.getWQLObject("ST_IVT_CoolRegionIO").insert(jsonCool);
|
||||
|
||||
|
||||
result.put("message", "操作成功!");
|
||||
return result;
|
||||
}
|
||||
@@ -412,16 +253,9 @@ public class FeedingServiceImpl implements FeedingService {
|
||||
//查询对应的分切点位是否存在
|
||||
JSONObject cut_jo = WQLObject.getWQLObject("st_ivt_cutpointivt").query("full_point_code = '" + point_code + "'").uniqueResult(0);
|
||||
|
||||
//B1支持从分切上料暂存架送回母卷
|
||||
if(point_code.contains("B1_FQZC")){
|
||||
cut_jo = WQLObject.getWQLObject("st_ivt_coolpointivt").query("full_point_code = '" + point_code + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(cut_jo)) {
|
||||
throw new BadRequestException("请输入或者扫码分切区域的满轴点位!");
|
||||
}
|
||||
}else{
|
||||
if (ObjectUtil.isEmpty(cut_jo)) {
|
||||
throw new BadRequestException("请输入或者扫码分切区域的满轴点位!");
|
||||
}
|
||||
|
||||
if (ObjectUtil.isEmpty(cut_jo)) {
|
||||
throw new BadRequestException("请输入或者扫码分切区域的满轴点位!");
|
||||
}
|
||||
if (StrUtil.equals("01", cut_jo.getString("full_point_status"))) {
|
||||
throw new BadRequestException("该点位库存状态不存在满轴!");
|
||||
|
||||
@@ -52,8 +52,6 @@ import java.util.List;
|
||||
@RequiredArgsConstructor
|
||||
@Slf4j
|
||||
public class RawFoilServiceImpl implements RawFoilService {
|
||||
private final AcsToWmsService acsToWmsService;
|
||||
private final PointService pointService;
|
||||
@Autowired
|
||||
RawfoilWorkOrderMapper rawfoilWorkOrderMapper;
|
||||
|
||||
@@ -171,218 +169,6 @@ public class RawFoilServiceImpl implements RawFoilService {
|
||||
return jo;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public JSONObject needEmptyAxis(JSONObject whereJson) {
|
||||
String message = "操作完成!";
|
||||
WQLObject pdmBiRawfoilworkorderService = WQLObject.getWQLObject("PDM_BI_RawFoilWorkOrder"); // 生箔工单表
|
||||
WQLObject stIvtSbpointivtService = WQLObject.getWQLObject("ST_IVT_SbPointIvt"); // 生箔点位库存表
|
||||
|
||||
JSONObject raw_jo = whereJson.getJSONObject("raw_jo");
|
||||
JSONObject jsonRaw = pdmBiRawfoilworkorderService.query("workorder_id = '" + raw_jo.getString("workorder_id") + "'").uniqueResult(0);
|
||||
if (!StrUtil.equals(jsonRaw.getString("status"), "01")) {
|
||||
throw new BadRequestException("工单状态不为开始");
|
||||
}
|
||||
|
||||
JSONObject jsonSb = stIvtSbpointivtService.query("ext_code = '" + jsonRaw.getString("resource_name") + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(jsonSb)) {
|
||||
throw new BadRequestException("点位:" + jsonRaw.getString("resource_name") + "生箔设备不存在");
|
||||
}
|
||||
|
||||
if (StrUtil.equals("0", jsonSb.getString("is_used"))) {
|
||||
throw new BadRequestException("当前生箔机:" + jsonSb.getString("ext_code") + "未启用!");
|
||||
}
|
||||
|
||||
String start_pint_code = "";
|
||||
String point_code4 = "";
|
||||
String orderType = jsonRaw.getString("order_type");
|
||||
|
||||
//二期B1、B3的生箔烘箱任务和其他不一致
|
||||
if (jsonSb.getString("product_area").equals("B1")) {
|
||||
// 2.根据就近原则查对应空卷轴
|
||||
JSONObject map = new JSONObject();
|
||||
map.put("flag", "601");
|
||||
map.put("product_area", jsonSb.getString("product_area"));
|
||||
map.put("point_location", jsonSb.getString("point_location"));
|
||||
// 查找冷却区空轴位状态是空轴的点位
|
||||
JSONObject jsonIvt = WQL.getWO("PDA_RAWFOIL_01").addParamMap(map).process().uniqueResult(0);
|
||||
// 3.如果没找到则继续找下一节点
|
||||
if (ObjectUtil.isEmpty(jsonIvt)) {
|
||||
String point_location = jsonSb.getString("point_location");
|
||||
if (StrUtil.equals(point_location, "0")) map.put("point_location", "1");
|
||||
if (StrUtil.equals(point_location, "1")) map.put("point_location", "0");
|
||||
// 没有找到就往其他位置(上下位置)查找
|
||||
jsonIvt = WQL.getWO("PDA_RAWFOIL_01").addParamMap(map).process().uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(jsonIvt)) {
|
||||
throw new BadRequestException("未查询到有空轴的点位!");
|
||||
}
|
||||
}
|
||||
|
||||
//查询可用的对接位
|
||||
String reging_id = "";
|
||||
String product_area = jsonSb.getString("product_area");
|
||||
// 获取对应的烘箱对接位区域id
|
||||
switch (product_area) {
|
||||
case "A1":
|
||||
reging_id = RegionTypeEnum.A_HKZC.getId();
|
||||
break;
|
||||
case "A2":
|
||||
reging_id = RegionTypeEnum.B_HKZC.getId();
|
||||
break;
|
||||
case "A3":
|
||||
reging_id = RegionTypeEnum.C_HKZC.getId();
|
||||
break;
|
||||
case "A4":
|
||||
reging_id = RegionTypeEnum.D_HKZC.getId();
|
||||
break;
|
||||
case "B1":
|
||||
reging_id = RegionTypeEnum.B1_HKZC.getId();
|
||||
break;
|
||||
case "B2":
|
||||
reging_id = RegionTypeEnum.B2_HKZC.getId();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
JSONObject cache_map = new JSONObject();
|
||||
cache_map.put("flag", "4");
|
||||
cache_map.put("reging_id", reging_id);
|
||||
cache_map.put("point_location", jsonSb.getString("point_location"));
|
||||
//只找入箱点位(point_type : 4)
|
||||
cache_map.put("point_type", "4");
|
||||
|
||||
JSONObject point_code2_jo = WQL.getWO("PDA_OVENINANDOUT_01").addParamMap(cache_map).process().uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(point_code2_jo)) {
|
||||
// 找不到就找其他上下位置的
|
||||
cache_map.put("point_location", jsonSb.getString("point_location").equals("0") ? "1" : "0");
|
||||
point_code2_jo = WQL.getWO("PDA_OVENINANDOUT_01").addParamMap(cache_map).process().uniqueResult(0);
|
||||
}
|
||||
if (ObjectUtil.isEmpty(point_code2_jo)) {
|
||||
throw new BadRequestException("未查询到可用的点位类型为入箱的烘箱对接位!");
|
||||
}
|
||||
// 起点和终点确定 生成任务
|
||||
JSONObject param = new JSONObject();
|
||||
param.put("point_code1", jsonIvt.getString("empty_point_code"));
|
||||
param.put("point_code2", jsonSb.getString("point_code") + "_K");
|
||||
param.put("point_code3", jsonSb.getString("point_code") + "_M");
|
||||
param.put("point_code4", point_code2_jo.getString("point_code"));
|
||||
param.put("task_type", "010104");
|
||||
param.put("material_code", jsonRaw.getString("container_name"));
|
||||
param.put("product_area", jsonSb.getString("product_area"));
|
||||
|
||||
CallEmpReelTask callEmpReelTask = new CallEmpReelTask();
|
||||
callEmpReelTask.createTask(param);
|
||||
} else {
|
||||
// 2.根据就近原则查对应空卷轴
|
||||
JSONObject map = new JSONObject();
|
||||
map.put("flag", "1");
|
||||
map.put("product_area", jsonSb.getString("product_area"));
|
||||
map.put("point_location", jsonSb.getString("point_location"));
|
||||
map.put("point_type", "1");
|
||||
// 如果是B2, 需要根据标箔或者锂电来判断是哪个位置
|
||||
if (jsonSb.getString("product_area").equals("B2")) {
|
||||
// order_type 1-标箔;2-锂电
|
||||
if ("2".equals(orderType)) {
|
||||
map.put("point_type", "4");
|
||||
}
|
||||
}
|
||||
JSONObject jsonIvt = WQL.getWO("PDA_RAWFOIL_01").addParamMap(map).process().uniqueResult(0);
|
||||
// 3.如果没找到则继续找下一节点
|
||||
String bigType = whereJson.getString("big_type");
|
||||
if (ObjectUtil.isEmpty(jsonIvt)) {
|
||||
/*String point_location = jsonSb.getString("point_location");
|
||||
if (StrUtil.equals(point_location, "0")) map.put("point_location", "1");
|
||||
if (StrUtil.equals(point_location, "1")) map.put("point_location", "0");
|
||||
JSONObject jsonIvt_tow = WQL.getWO("PDA_RAWFOIL_01").addParamMap(map).process().uniqueResult(0);*/
|
||||
if (!(jsonSb.getString("product_area").startsWith("A1")
|
||||
&& ObjectUtil.isNotEmpty(bigType)
|
||||
&& "1".equals(bigType))) {
|
||||
throw new BadRequestException("未查询到有空轴且母卷位置为空的点位!");
|
||||
}
|
||||
} else {
|
||||
start_pint_code = jsonIvt.getString("empty_point_code");
|
||||
point_code4 = jsonIvt.getString("full_point_code");
|
||||
}
|
||||
|
||||
// 起点和终点确定 生成任务
|
||||
JSONObject param = new JSONObject();
|
||||
// 只有一期A2才需要指定车号
|
||||
if (jsonSb.getString("product_area").startsWith("A2")
|
||||
&& ObjectUtil.isNotEmpty(bigType)
|
||||
&& "1".equals(bigType)) {
|
||||
param.put("car_no", TaskUtils.getParam("A2_USE_CAR"));
|
||||
// 不能创建四点任务,需要创建两条。
|
||||
map.put("flag", "101");
|
||||
JSONObject emptyPoint = WQL.getWO("PDA_RAWFOIL_01").addParamMap(map).process().uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(emptyPoint)) {
|
||||
throw new BadRequestException("未查询到母卷位置为空且空轴位也是空的点位!");
|
||||
}
|
||||
// 找全空的放满轴,任务完成后找有空轴的取
|
||||
param.put("point_code1", jsonSb.getString("point_code") + "_M");
|
||||
param.put("point_code2", emptyPoint.getString("full_point_code"));
|
||||
param.put("task_type", "010105");
|
||||
param.put("material_code", jsonRaw.getString("container_name"));
|
||||
param.put("product_area", jsonSb.getString("product_area"));
|
||||
} else if (jsonSb.getString("product_area").equals("B2") && "2".equals(orderType)) {
|
||||
// 如果是B2直接送到对接位。(找到对应满足温度的烘箱、没有禁用的烘箱。)
|
||||
BakingServiceImpl bean = SpringContextHolder.getBean(BakingServiceImpl.class);
|
||||
// 温度
|
||||
String temperature = whereJson.getString("temperature");
|
||||
// 时间
|
||||
String hours = whereJson.getString("hours");
|
||||
JSONObject map2 = new JSONObject();
|
||||
map2.put("flag", "301");
|
||||
map2.put("reging_id", RegionTypeEnum.B2_HKZC.getId());
|
||||
//只找入箱点位
|
||||
map2.put("point_type", "4");
|
||||
JSONArray point_code2_jos = WQL.getWO("PDA_OVENINANDOUT_01").addParamMap(map2).process().getResultJSONArray(0);
|
||||
if (ObjectUtil.isNotEmpty(point_code2_jos)) {
|
||||
// 遍历查找
|
||||
for (int i = 0; i < point_code2_jos.size(); i++) {
|
||||
JSONObject point_code2_jo = point_code2_jos.getJSONObject(i);
|
||||
JSONObject productArea = bean.getJsonObject(jsonSb.getString("product_area"), point_code2_jo, temperature);
|
||||
if (ObjectUtil.isNotEmpty(productArea)) {
|
||||
param.put("point_code4", point_code2_jo.getString("point_code"));
|
||||
param.put("task_type", "010106");
|
||||
param.put("temperature", temperature);
|
||||
param.put("hours", hours);
|
||||
message = "送到烘箱对接位!";
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (ObjectUtil.isEmpty(point_code2_jos) || ObjectUtil.isEmpty(param.getString("point_code4"))) {
|
||||
param.put("point_code4", point_code4);
|
||||
param.put("task_type", "010101");
|
||||
message = "送到冷却区!";
|
||||
}
|
||||
param.put("point_code1", start_pint_code);
|
||||
param.put("point_code2", jsonSb.getString("point_code") + "_K");
|
||||
param.put("point_code3", jsonSb.getString("point_code") + "_M");
|
||||
param.put("material_code", jsonRaw.getString("container_name"));
|
||||
param.put("product_area", jsonSb.getString("product_area"));
|
||||
} else {
|
||||
param.put("point_code1", start_pint_code);
|
||||
param.put("point_code2", jsonSb.getString("point_code") + "_K");
|
||||
param.put("point_code3", jsonSb.getString("point_code") + "_M");
|
||||
param.put("point_code4", point_code4);
|
||||
param.put("task_type", "010101");
|
||||
param.put("material_code", jsonRaw.getString("container_name"));
|
||||
param.put("product_area", jsonSb.getString("product_area"));
|
||||
}
|
||||
CallEmpReelTask callEmpReelTask = new CallEmpReelTask();
|
||||
callEmpReelTask.createTask(param);
|
||||
}
|
||||
|
||||
// 更新工单状态
|
||||
JSONObject jo_map = new JSONObject();
|
||||
jo_map.put("status", "02");
|
||||
pdmBiRawfoilworkorderService.update(jo_map, "workorder_id = '" + raw_jo.getString("workorder_id") + "'");
|
||||
|
||||
JSONObject jo = new JSONObject();
|
||||
jo.put("message", message);
|
||||
return jo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONObject createOrder(JSONObject whereJson) {
|
||||
@@ -425,145 +211,6 @@ public class RawFoilServiceImpl implements RawFoilService {
|
||||
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);
|
||||
String bigType = whereJson.getString("big_type");
|
||||
// 插入生箔工序工单表
|
||||
JSONObject json = new JSONObject();
|
||||
json.put("workorder_id", IdUtil.getSnowflake(1, 1).nextId());
|
||||
json.put("container_name", whereJson.getString("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());
|
||||
if (ObjectUtil.isNotEmpty(bigType) && "1".equals(bigType)) {
|
||||
json.put("agvno", "99");
|
||||
}
|
||||
rawTab.insert(json);
|
||||
|
||||
JSONObject jsonSb = sbTab.query("point_code = '" + whereJson.getString("point_code") + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(jsonSb)) {
|
||||
throw new BadRequestException("点位:" + whereJson.getString("point_code") + "生箔设备不存在");
|
||||
}
|
||||
|
||||
if (StrUtil.equals("0", jsonSb.getString("is_used"))) {
|
||||
throw new BadRequestException("当前生箔机:" + jsonSb.getString("ext_code") + "未启用!");
|
||||
}
|
||||
|
||||
String start_pint_code = "";
|
||||
String point_code4 = "";
|
||||
// 2.根据就近原则查对应空卷抽
|
||||
JSONObject map = new JSONObject();
|
||||
map.put("flag", "1");
|
||||
map.put("product_area", jsonSb.getString("product_area"));
|
||||
map.put("point_location", jsonSb.getString("point_location"));
|
||||
JSONObject jsonIvt = WQL.getWO("PDA_RAWFOIL_01").addParamMap(map).process().uniqueResult(0);
|
||||
// 3.如果没找到则继续找下一节点
|
||||
if (ObjectUtil.isEmpty(jsonIvt)) {
|
||||
/*String point_location = jsonSb.getString("point_location");
|
||||
if (StrUtil.equals(point_location, "0")) map.put("point_location", "1");
|
||||
if (StrUtil.equals(point_location, "1")) map.put("point_location", "0");
|
||||
JSONObject jsonIvt_tow = WQL.getWO("PDA_RAWFOIL_01").addParamMap(map).process().uniqueResult(0);*/
|
||||
throw new BadRequestException("未查询到有空轴且母卷位置为空的点位!");
|
||||
} else {
|
||||
start_pint_code = jsonIvt.getString("empty_point_code");
|
||||
point_code4 = jsonIvt.getString("full_point_code");
|
||||
}
|
||||
// 起点和终点确定 生成任务
|
||||
JSONObject param = new JSONObject();
|
||||
param.put("point_code1", start_pint_code);
|
||||
param.put("point_code2", jsonSb.getString("point_code") + "_K");
|
||||
param.put("point_code3", jsonSb.getString("point_code") + "_M");
|
||||
param.put("point_code4", point_code4);
|
||||
param.put("task_type", "010101");
|
||||
if (ObjectUtil.isNotEmpty(bigType) && "1".equals(bigType)) {
|
||||
param.put("car_no", TaskUtils.getParam("A2_USE_CAR"));
|
||||
}
|
||||
param.put("material_code", whereJson.getString("container_name"));
|
||||
param.put("product_area", jsonSb.getString("product_area"));
|
||||
|
||||
CallEmpReelTask callEmpReelTask = new CallEmpReelTask();
|
||||
callEmpReelTask.createTask(param);
|
||||
|
||||
// 更新工单状态
|
||||
json.put("status", "02");
|
||||
rawTab.update(json);
|
||||
|
||||
JSONObject jo = new JSONObject();
|
||||
jo.put("message", "操作成功!");
|
||||
return jo;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public JSONObject needEmptyVehicle(JSONObject whereJson) {
|
||||
throw new BadRequestException("请点击呼叫按钮进行搬运!");
|
||||
|
||||
/*String point_code = whereJson.getString("point_code");
|
||||
if (ObjectUtil.isEmpty(point_code)) {
|
||||
throw new BadRequestException("输入的点位不能为空!");
|
||||
}
|
||||
JSONObject raw_jo = WQLObject.getWQLObject("st_ivt_sbpointivt").query("point_code = '" + point_code + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(raw_jo)) {
|
||||
throw new BadRequestException("未查到相关的生箔机点位!");
|
||||
}
|
||||
|
||||
if (StrUtil.equals("0", raw_jo.getString("is_used"))) {
|
||||
throw new BadRequestException("当前生箔机:" + raw_jo.getString("ext_code") + "未启用!");
|
||||
}
|
||||
|
||||
// 2.根据就近原则查对应空卷抽
|
||||
JSONObject map = new JSONObject();
|
||||
map.put("flag", "1");
|
||||
map.put("product_area", raw_jo.getString("product_area"));
|
||||
map.put("point_location", raw_jo.getString("point_location"));
|
||||
JSONObject jsonIvt = WQL.getWO("PDA_RAWFOIL_01").addParamMap(map).process().uniqueResult(0);
|
||||
// 3.如果没找到则继续找下一节点
|
||||
String start_pint_code = "";
|
||||
if (ObjectUtil.isEmpty(jsonIvt)) {
|
||||
*//*String point_location = jsonSb.getString("point_location");
|
||||
if (StrUtil.equals(point_location, "0")) map.put("point_location", "1");
|
||||
if (StrUtil.equals(point_location, "1")) map.put("point_location", "0");
|
||||
JSONObject jsonIvt_tow = WQL.getWO("PDA_RAWFOIL_01").addParamMap(map).process().uniqueResult(0);*//*
|
||||
throw new BadRequestException("未查询到有空轴且母卷位置为空的点位!");
|
||||
} else {
|
||||
start_pint_code = jsonIvt.getString("empty_point_code");
|
||||
}
|
||||
|
||||
// 起点和终点确定 生成任务
|
||||
JSONObject param = new JSONObject();
|
||||
param.put("point_code1", start_pint_code);
|
||||
param.put("point_code2", point_code + "_K");
|
||||
param.put("task_type", "010103");
|
||||
param.put("product_area", jsonIvt.getString("product_area"));
|
||||
|
||||
CallEmpReelTask callEmpReelTask = new CallEmpReelTask();
|
||||
callEmpReelTask.createTask(param);
|
||||
|
||||
JSONObject jo = new JSONObject();
|
||||
jo.put("message", "操作成功!");
|
||||
return jo;*/
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONObject confirmBlanking(JSONObject whereJson) {
|
||||
WQLObject pdmBiRawfoilworkorderService = WQLObject.getWQLObject("PDM_BI_RawFoilWorkOrder"); // 生箔工单
|
||||
@@ -582,6 +229,9 @@ public class RawFoilServiceImpl implements RawFoilService {
|
||||
//查询该母卷号对应的任务
|
||||
String container_name = rawfoilWorkOrder.getContainer_name();
|
||||
JSONObject task_jo = WQLObject.getWQLObject("SCH_BASE_Task").query("material_code = '" + container_name + "' and task_status <> '07' AND is_delete = '0'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(task_jo)) {
|
||||
throw new BadRequestException("母卷号是" + container_name + "的任务不存在!");
|
||||
}
|
||||
|
||||
// 查询生箔点位库存表
|
||||
SbPointIvt stIvtSbpointivt = sbPointIvtMapper.selectOne(new LambdaQueryWrapper<SbPointIvt>()
|
||||
@@ -615,77 +265,6 @@ public class RawFoilServiceImpl implements RawFoilService {
|
||||
return jo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONObject finishBlanking(JSONObject whereJson) {
|
||||
|
||||
JSONObject raw_jo = whereJson.getJSONObject("raw_jo");
|
||||
WQLObject pdmBiRawfoilworkorderService = WQLObject.getWQLObject("PDM_BI_RawFoilWorkOrder"); // 生箔工单表
|
||||
|
||||
JSONObject jsonRaw = pdmBiRawfoilworkorderService.query("container_name = '" + raw_jo.getString("container_name") + "'").uniqueResult(0);
|
||||
if (!StrUtil.equals(jsonRaw.getString("status"), "03")) {
|
||||
throw new BadRequestException("工单不为确认下卷");
|
||||
}
|
||||
|
||||
//查询该母卷号对应的任务
|
||||
String container_name = jsonRaw.getString("container_name");
|
||||
JSONObject task_jo = WQLObject.getWQLObject("SCH_BASE_Task").query("material_code = '" + container_name + "' and task_status <> '07' AND is_delete = '0'").uniqueResult(0);
|
||||
|
||||
// 查询生箔点位库存表
|
||||
JSONObject jsonSb = WQLObject.getWQLObject("st_ivt_sbpointivt").query("ext_code = '" + jsonRaw.getString("resource_name") + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(jsonSb)) {
|
||||
throw new BadRequestException("点位不存在");
|
||||
}
|
||||
|
||||
//下发ACS,执行取满放空的AGV动作
|
||||
JSONArray paramArr = new JSONArray();
|
||||
JSONObject param = new JSONObject();
|
||||
param.put("device_code", jsonSb.getString("point_code"));
|
||||
param.put("task_code", task_jo.getString("task_code"));
|
||||
param.put("option", "2");
|
||||
paramArr.add(param);
|
||||
|
||||
WmsToAcsServiceImpl wmsToAcsService = new WmsToAcsServiceImpl();
|
||||
JSONObject result = wmsToAcsService.updateTask(paramArr);
|
||||
|
||||
if (!StrUtil.equals(result.getString("status"), "200")) {
|
||||
throw new BadRequestException("操作失败:" + result.getString("message "));
|
||||
}
|
||||
|
||||
// 更新工单状态为下卷完成
|
||||
jsonRaw.put("status", "04");
|
||||
pdmBiRawfoilworkorderService.update(jsonRaw);
|
||||
|
||||
JSONObject jo = new JSONObject();
|
||||
jo.put("message", "操作成功!");
|
||||
return jo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONObject finish(JSONObject whereJson) {
|
||||
WQLObject stIvtCoolRegionIoService = WQLObject.getWQLObject("PDM_BI_RawFoilWorkOrder"); // 生箔工单表
|
||||
|
||||
JSONObject raw_jo = whereJson.getJSONObject("raw_jo");
|
||||
|
||||
JSONObject jsonCool = stIvtCoolRegionIoService.query("workorder_id = '" + raw_jo.getString("workorder_id") + "'").uniqueResult(0);
|
||||
|
||||
//查询该生箔工单是否存在未完成的任务
|
||||
String container_name = raw_jo.getString("container_name");
|
||||
|
||||
JSONObject task_jo = WQLObject.getWQLObject("sch_base_task").query("material_code = '" + container_name + "' AND task_status < '07' AND is_delete = '0'").uniqueResult(0);
|
||||
if (ObjectUtil.isNotEmpty(task_jo)) {
|
||||
throw new BadRequestException("该生箔工单存在未完成的任务,请先完成任务!");
|
||||
}
|
||||
|
||||
jsonCool.put("status", "40");
|
||||
jsonCool.put("realend_time", DateUtil.now());
|
||||
jsonCool.put("finish_type", "02");
|
||||
stIvtCoolRegionIoService.update(jsonCool);
|
||||
|
||||
JSONObject jo = new JSONObject();
|
||||
jo.put("message", "操作成功!");
|
||||
return jo;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@@ -693,28 +272,14 @@ public class RawFoilServiceImpl implements RawFoilService {
|
||||
String message = "操作完成!";
|
||||
String type = whereJson.getString("type");
|
||||
JSONObject raw_jo = whereJson.getJSONObject("raw_jo");
|
||||
SbPointIvt stIvtSbpointivt;
|
||||
if (ObjectUtil.isNotEmpty(whereJson.getString("point_code"))) {
|
||||
stIvtSbpointivt = sbPointIvtMapper.selectOne(new LambdaQueryWrapper<SbPointIvt>()
|
||||
.eq(ObjectUtil.isNotEmpty(whereJson.getString("point_code")), SbPointIvt::getPoint_code, whereJson.getString("point_code")));
|
||||
} else {
|
||||
stIvtSbpointivt = sbPointIvtMapper.selectOne(new LambdaQueryWrapper<SbPointIvt>()
|
||||
.eq(ObjectUtil.isNotEmpty(raw_jo.getString("point_code")), SbPointIvt::getPoint_code, raw_jo.getString("point_code")));
|
||||
}
|
||||
if (ObjectUtil.isEmpty(stIvtSbpointivt)) {
|
||||
throw new BadRequestException("点位:" + stIvtSbpointivt.getExt_code() + "生箔设备不存在");
|
||||
}
|
||||
if (StrUtil.equals("0", stIvtSbpointivt.getIs_used())) {
|
||||
throw new BadRequestException("当前生箔机:" + stIvtSbpointivt.getExt_code() + "未启用!");
|
||||
}
|
||||
|
||||
String point_code = whereJson.getString("point_code");
|
||||
JSONObject param = new JSONObject();
|
||||
if ("1".equals(type) || "3".equals(type)) {// 1:取空取满放空放满,
|
||||
handleType1And3(stIvtSbpointivt, raw_jo, param, type);
|
||||
handleType1And3(raw_jo, param, type);
|
||||
} else if ("2".equals(type)) {//2:单上空轴
|
||||
handleType2(stIvtSbpointivt, param);
|
||||
handleType2(point_code, param);
|
||||
} else if ("4".equals(type)) {//4:单下空轴
|
||||
handleType4(stIvtSbpointivt, param);
|
||||
handleType4(point_code, param);
|
||||
}
|
||||
|
||||
CallEmpReelTask callEmpReelTask = new CallEmpReelTask();
|
||||
@@ -737,7 +302,9 @@ public class RawFoilServiceImpl implements RawFoilService {
|
||||
WQLObject pointTab = WQLObject.getWQLObject("ST_IVT_SbPointIvt");
|
||||
|
||||
JSONObject raw_jo = whereJson.getJSONObject("raw_jo");
|
||||
|
||||
if (ObjectUtil.isEmpty(raw_jo)){
|
||||
throw new BadRequestException("生箔工单不能为空!");
|
||||
}
|
||||
JSONObject jsonRaw = stIvtCoolRegionIoService.query("workorder_id = '" + raw_jo.getString("workorder_id") + "'").uniqueResult(0);
|
||||
|
||||
if (!StrUtil.equals(jsonRaw.getString("status"), "00")) {
|
||||
@@ -794,10 +361,18 @@ public class RawFoilServiceImpl implements RawFoilService {
|
||||
return jo;
|
||||
}
|
||||
|
||||
private void handleType1And3(SbPointIvt stIvtSbpointivt, JSONObject raw_jo, JSONObject param, String type) {
|
||||
private void handleType1And3(JSONObject raw_jo, JSONObject param, String type) {
|
||||
if (ObjectUtil.isEmpty(raw_jo)) {
|
||||
throw new BadRequestException("生箔工单不能为空!");
|
||||
}
|
||||
SbPointIvt stIvtSbpointivt = sbPointIvtMapper.selectOne(new LambdaQueryWrapper<SbPointIvt>()
|
||||
.eq(ObjectUtil.isNotEmpty(raw_jo.getString("point_code")), SbPointIvt::getPoint_code, raw_jo.getString("point_code")));
|
||||
if (ObjectUtil.isEmpty(stIvtSbpointivt)) {
|
||||
throw new BadRequestException("点位:" + stIvtSbpointivt.getExt_code() + "生箔设备不存在");
|
||||
}
|
||||
if (StrUtil.equals("0", stIvtSbpointivt.getIs_used())) {
|
||||
throw new BadRequestException("当前生箔机:" + stIvtSbpointivt.getExt_code() + "未启用!");
|
||||
}
|
||||
JSONObject task_jo = WQLObject.getWQLObject("sch_base_task").query("material_code = '" + raw_jo.getString("container_name") + "' AND task_status < '07' AND is_delete = '0'").uniqueResult(0);
|
||||
if (ObjectUtil.isNotEmpty(task_jo)) {
|
||||
throw new BadRequestException("该生箔工单存在未完成的任务,请先完成任务!");
|
||||
@@ -862,7 +437,18 @@ public class RawFoilServiceImpl implements RawFoilService {
|
||||
}
|
||||
}
|
||||
|
||||
private void handleType2(SbPointIvt stIvtSbpointivt, JSONObject param) {
|
||||
private void handleType2(String point_code, JSONObject param) {
|
||||
if (ObjectUtil.isEmpty(point_code)) {
|
||||
throw new BadRequestException("点位不能为空!");
|
||||
}
|
||||
SbPointIvt stIvtSbpointivt = sbPointIvtMapper.selectOne(new LambdaQueryWrapper<SbPointIvt>()
|
||||
.eq(SbPointIvt::getPoint_code, point_code));
|
||||
if (ObjectUtil.isEmpty(stIvtSbpointivt)) {
|
||||
throw new BadRequestException("点位:" + stIvtSbpointivt.getExt_code() + "生箔设备不存在");
|
||||
}
|
||||
if (StrUtil.equals("0", stIvtSbpointivt.getIs_used())) {
|
||||
throw new BadRequestException("当前生箔机:" + stIvtSbpointivt.getExt_code() + "未启用!");
|
||||
}
|
||||
if (StrUtil.equals("01", stIvtSbpointivt.getEmpty_point_status()) && StrUtil.equals("01", stIvtSbpointivt.getFull_point_status())) {
|
||||
JSONObject map = new JSONObject();
|
||||
map.put("product_area", stIvtSbpointivt.getProduct_area());
|
||||
@@ -892,17 +478,24 @@ public class RawFoilServiceImpl implements RawFoilService {
|
||||
}
|
||||
}
|
||||
|
||||
private void handleType4(SbPointIvt stIvtSbpointivt, JSONObject param) {
|
||||
private void handleType4(String point_code, JSONObject param) {
|
||||
if (ObjectUtil.isEmpty(point_code)) {
|
||||
throw new BadRequestException("点位不能为空!");
|
||||
}
|
||||
SbPointIvt stIvtSbpointivt = sbPointIvtMapper.selectOne(new LambdaQueryWrapper<SbPointIvt>()
|
||||
.eq(SbPointIvt::getPoint_code, point_code));
|
||||
if (ObjectUtil.isEmpty(stIvtSbpointivt)) {
|
||||
throw new BadRequestException("点位:" + stIvtSbpointivt.getExt_code() + "生箔设备不存在");
|
||||
}
|
||||
if (StrUtil.equals("0", stIvtSbpointivt.getIs_used())) {
|
||||
throw new BadRequestException("当前生箔机:" + stIvtSbpointivt.getExt_code() + "未启用!");
|
||||
}
|
||||
List<RawfoilWorkOrder> rawfoilWorkOrderList = rawfoilWorkOrderMapper.selectList(new LambdaQueryWrapper<RawfoilWorkOrder>()
|
||||
.eq(ObjectUtil.isNotEmpty(stIvtSbpointivt.getExt_code()), RawfoilWorkOrder::getResource_name, stIvtSbpointivt.getExt_code())
|
||||
.eq(RawfoilWorkOrder::getStatus, "30"));
|
||||
if (CollectionUtil.isEmpty(rawfoilWorkOrderList)) {
|
||||
throw new BadRequestException("工单状态不为开始生产");
|
||||
}
|
||||
// JSONArray arr = pdmBiRawfoilworkorderService.query("resource_name = '" + sbPointIvt.getString("ext_code") + "' AND status = '30'").getResultJSONArray(0);
|
||||
// if (arr.size() > 0) {
|
||||
// throw new BadRequestException("当前生箔机存在已经开始生产的生箔工单,任务不能创建!");
|
||||
// }
|
||||
|
||||
if (StrUtil.equals("02", stIvtSbpointivt.getEmpty_point_status()) && StrUtil.equals("01", stIvtSbpointivt.getFull_point_status())) {
|
||||
JSONObject map = new JSONObject();
|
||||
|
||||
Reference in New Issue
Block a user