修改
This commit is contained in:
@@ -48,8 +48,8 @@ public class RawFoilController {
|
||||
@Log("呼叫空轴")
|
||||
@ApiOperation("呼叫空轴")
|
||||
public ResponseEntity<Object> needEmptyAxis(@RequestBody JSONObject whereJson) {
|
||||
rawFoilService.needEmptyAxis(whereJson);
|
||||
return new ResponseEntity<>( HttpStatus.OK);
|
||||
|
||||
return new ResponseEntity<>(rawFoilService.needEmptyAxis(whereJson), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/confirmBlanking")
|
||||
|
||||
@@ -9,28 +9,28 @@ public interface RawFoilService {
|
||||
* 查询生产区域
|
||||
* @return json
|
||||
*/
|
||||
JSONArray queryProductArea();
|
||||
JSONObject queryProductArea();
|
||||
|
||||
/**
|
||||
* 查询生箔生产进度
|
||||
* @param whereJson /
|
||||
* @return JSONObject
|
||||
*/
|
||||
JSONArray queryRawFoil(JSONObject whereJson);
|
||||
JSONObject queryRawFoil(JSONObject whereJson);
|
||||
|
||||
/**
|
||||
* 查询生箔工单
|
||||
* @param whereJson /
|
||||
* @return JSONObject
|
||||
*/
|
||||
JSONArray queryRawFoilList(JSONObject whereJson);
|
||||
JSONObject queryRawFoilList(JSONObject whereJson);
|
||||
|
||||
/**
|
||||
* 确认下卷
|
||||
* @param whereJson /
|
||||
* @return JSONObject
|
||||
*/
|
||||
void needEmptyAxis(JSONObject whereJson);
|
||||
JSONObject needEmptyAxis(JSONObject whereJson);
|
||||
|
||||
/**
|
||||
* 查询生箔工单
|
||||
@@ -44,12 +44,12 @@ public interface RawFoilService {
|
||||
* @param whereJson /
|
||||
* @return JSONObject
|
||||
*/
|
||||
void finishBlanking(JSONObject whereJson);
|
||||
JSONObject finishBlanking(JSONObject whereJson);
|
||||
|
||||
/**
|
||||
* 完成
|
||||
* @param whereJson /
|
||||
* @return JSONObject
|
||||
*/
|
||||
void finish(JSONObject whereJson);
|
||||
JSONObject finish(JSONObject whereJson);
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@ import org.nl.wms.pda.mps.service.OutService;
|
||||
import org.nl.wms.pda.mps.service.ShippingService;
|
||||
import org.nl.wms.sch.tasks.CutTrussTask;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
@@ -42,12 +43,13 @@ public class OutServiceImpl implements OutService {
|
||||
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public JSONObject confirm(JSONObject whereJson) {
|
||||
String point_code = whereJson.getString("point_code");
|
||||
|
||||
JSONArray rows = whereJson.getJSONArray("cut_rows");
|
||||
|
||||
String cut_qzzno = rows.getJSONObject(0).getString("qzz_no");
|
||||
String cut_qzzno = rows.getJSONObject(0).getString("qzzno");
|
||||
//查询该点位对应的机台编号
|
||||
JSONObject cut_ivt = WQLObject.getWQLObject("ST_IVT_CutPointIvt").query("up_point_code ='"+point_code+"' OR down_point_code ='"+point_code+"'").uniqueResult(0);
|
||||
|
||||
@@ -58,7 +60,7 @@ public class OutServiceImpl implements OutService {
|
||||
String ext_code = cut_ivt.getString("ext_code");
|
||||
|
||||
//查询该机台编号已经配送完成,套轴完成但是未完成的分切计划
|
||||
JSONObject slitting = WQLObject.getWQLObject("PDM_BI_SlittingProductionPlan").query("resource_name = '"+ext_code+"' AND is_child_tz_ok = '1' AND is_child_ps_ok = '1' AND status = '1'").uniqueResult(0);
|
||||
JSONObject slitting = WQLObject.getWQLObject("PDM_BI_SlittingProductionPlan").query("resource_name = '"+ext_code+"' AND is_child_tz_ok = '1' AND is_child_ps_ok = '1' AND status = '03'").uniqueResult(0);
|
||||
|
||||
if (ObjectUtil.isEmpty(slitting)){
|
||||
throw new BadRequestException("该分切机没有对应完成配送完成的气涨轴!");
|
||||
|
||||
@@ -109,8 +109,14 @@ public class PointStatusServiceImpl implements PointStatusService {
|
||||
}
|
||||
JSONObject jo = new JSONObject();
|
||||
jo.put("container_name", vehicle_code);
|
||||
if (have_goods.equals("01")){
|
||||
have_goods = "否";
|
||||
}else {
|
||||
have_goods = "是";
|
||||
}
|
||||
jo.put("have_goods", have_goods);
|
||||
|
||||
|
||||
JSONObject result = new JSONObject();
|
||||
result.put("data", jo);
|
||||
result.put("message", "查询成功!");
|
||||
|
||||
@@ -34,15 +34,18 @@ public class RawFoilServiceImpl implements RawFoilService {
|
||||
private final PointService pointService;
|
||||
|
||||
@Override
|
||||
public JSONArray queryProductArea() {
|
||||
public JSONObject queryProductArea() {
|
||||
JSONObject map = new JSONObject();
|
||||
map.put("flag", "3");
|
||||
JSONArray jsonArr = WQL.getWO("PDA_RAWFOIL_01").addParam("flag", "3").process().getResultJSONArray(0);
|
||||
return jsonArr;
|
||||
JSONObject jo = new JSONObject();
|
||||
jo.put("data", jsonArr);
|
||||
jo.put("message", "查询成功!");
|
||||
return jo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONArray queryRawFoil(JSONObject whereJson) {
|
||||
public JSONObject queryRawFoil(JSONObject whereJson) {
|
||||
String point_code = whereJson.getString("point_code");
|
||||
String container_name = whereJson.getString("container_name");
|
||||
String product_area = whereJson.getString("product_area");
|
||||
@@ -80,8 +83,13 @@ public class RawFoilServiceImpl implements RawFoilService {
|
||||
|
||||
long betweenDay = DateUtil.between(end_time2, now_time, DateUnit.MINUTE, false);
|
||||
|
||||
if (betweenDay > 0) json.put("color_type", "1");
|
||||
if (betweenDay <= 0 && betweenDay >= -30) json.put("color_type", "2");
|
||||
if (betweenDay > 0) {
|
||||
json.put("color_type", "1");
|
||||
}else if(betweenDay <= 0 && betweenDay >= -30) {
|
||||
json.put("color_type", "2");
|
||||
}else {
|
||||
json.put("color_type", "0");
|
||||
}
|
||||
|
||||
json.put("container_name", jsonObject.getString("container_name"));
|
||||
json.put("realstart_time", jsonObject.getString("realstart_time"));
|
||||
@@ -93,22 +101,28 @@ public class RawFoilServiceImpl implements RawFoilService {
|
||||
|
||||
resultArr.add(json);
|
||||
}
|
||||
return resultArr;
|
||||
JSONObject jo = new JSONObject();
|
||||
jo.put("data", resultArr);
|
||||
jo.put("message", "查询成功!");
|
||||
return jo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONArray queryRawFoilList(JSONObject whereJson) {
|
||||
public JSONObject queryRawFoilList(JSONObject whereJson) {
|
||||
JSONObject map = new JSONObject();
|
||||
map.put("flag", "5");
|
||||
map.put("point_code", whereJson.getString("point_code"));
|
||||
map.put("container_name", whereJson.getString("container_name"));
|
||||
JSONArray resultJSONArray = WQL.getWO("PDA_RAWFOIL_01").addParamMap(map).process().getResultJSONArray(0);
|
||||
return resultJSONArray;
|
||||
JSONObject jo = new JSONObject();
|
||||
jo.put("data", resultJSONArray);
|
||||
jo.put("message", "查询成功!");
|
||||
return jo;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void needEmptyAxis(JSONObject whereJson) {
|
||||
public JSONObject needEmptyAxis(JSONObject whereJson) {
|
||||
|
||||
WQLObject taskTab = WQLObject.getWQLObject("SCH_BASE_Task");
|
||||
|
||||
@@ -138,10 +152,41 @@ public class RawFoilServiceImpl implements RawFoilService {
|
||||
} else {
|
||||
start_pint_code = jsonIvt.getString("empty_point_code");
|
||||
}
|
||||
|
||||
//查询满轴存放点位
|
||||
// 2.根据就近原则查对应空卷抽
|
||||
String point_code4= "";
|
||||
JSONObject map4 = new JSONObject();
|
||||
map4.put("flag", "2");
|
||||
map4.put("product_area", jsonPoint.getProduct_area());
|
||||
map4.put("point_location", jsonPoint.getPoint_location());
|
||||
JSONObject jsonIvt4 = WQL.getWO("PDA_RAWFOIL_01").addParamMap(map).process().uniqueResult(0);
|
||||
// 3.如果没找到则继续找下一节点
|
||||
if (ObjectUtil.isEmpty(jsonIvt)) {
|
||||
String point_location = jsonPoint.getPoint_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 (ObjectUtil.isEmpty(jsonIvt_tow)) {
|
||||
throw new BadRequestException("没有空位");
|
||||
}
|
||||
point_code4 = jsonIvt_tow.getString("full_point_code");
|
||||
} else {
|
||||
point_code4 = jsonIvt.getString("full_point_code");
|
||||
}
|
||||
// 起点和终点确定 生成任务
|
||||
JSONObject param = new JSONObject();
|
||||
param.put("start_pint_code", start_pint_code);
|
||||
param.put("end_pint_code", end_pint_code);
|
||||
param.put("point_code1", start_pint_code);
|
||||
param.put("point_code2", end_pint_code);
|
||||
param.put("point_code3", end_pint_code);
|
||||
param.put("point_code4", point_code4);
|
||||
param.put("task_type", "010101");
|
||||
param.put("material_code", whereJson.getString("container_name"));
|
||||
|
||||
CallEmpReelTask callEmpReelTask = new CallEmpReelTask();
|
||||
String task_id = callEmpReelTask.createTask(param);
|
||||
@@ -154,15 +199,23 @@ public class RawFoilServiceImpl implements RawFoilService {
|
||||
jsonTask.put("task_status", "05");
|
||||
taskTab.update(jsonTask);
|
||||
}
|
||||
JSONObject jo = new JSONObject();
|
||||
jo.put("message", "操作成功!");
|
||||
return jo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void confirmBlanking(JSONObject whereJson) {
|
||||
//查询该母卷号对应的任务
|
||||
String container_name = whereJson.getString("container_name");
|
||||
JSONObject task_jo = WQLObject.getWQLObject("SCH_BASE_Task").query("material_code = '"+container_name+"'").uniqueResult(0);
|
||||
|
||||
|
||||
//下发ACS,执行取满放空的AGV动作
|
||||
}
|
||||
|
||||
@Override
|
||||
public void finishBlanking(JSONObject whereJson) {
|
||||
public JSONObject finishBlanking(JSONObject whereJson) {
|
||||
String start_pint_code = whereJson.getString("point_code");
|
||||
|
||||
WQLObject regionTab = WQLObject.getWQLObject("ST_IVT_CoolRegionIO"); // 冷却区出入表
|
||||
@@ -170,6 +223,10 @@ public class RawFoilServiceImpl implements RawFoilService {
|
||||
WQLObject coolTab = WQLObject.getWQLObject("PDM_BI_RawFoilWorkOrder"); // 生箔工单表
|
||||
WQLObject taskTab = WQLObject.getWQLObject("SCH_BASE_Task"); // 任务表
|
||||
|
||||
//查询该母卷号对应的任务
|
||||
String container_name = whereJson.getString("container_name");
|
||||
JSONObject task_jo = WQLObject.getWQLObject("SCH_BASE_Task").query("material_code = '"+container_name+"'").uniqueResult(0);
|
||||
|
||||
JSONObject jsonCool = coolTab.query("mfg_order_name = '" + whereJson.getString("mfg_order_name") + "'").uniqueResult(0);
|
||||
|
||||
if (ObjectUtil.isEmpty(start_pint_code)) throw new BadRequestException("起点不能为空");
|
||||
@@ -179,7 +236,7 @@ public class RawFoilServiceImpl implements RawFoilService {
|
||||
PointDto jsonPoint = pointService.findByCode(start_pint_code);
|
||||
if (ObjectUtil.isEmpty(jsonPoint)) throw new BadRequestException("起点点位不存在");
|
||||
|
||||
// 2.根据就近原则查对应空卷抽
|
||||
/*// 2.根据就近原则查对应空卷抽
|
||||
JSONObject map = new JSONObject();
|
||||
map.put("flag", "2");
|
||||
map.put("product_area", jsonPoint.getProduct_area());
|
||||
@@ -202,9 +259,7 @@ public class RawFoilServiceImpl implements RawFoilService {
|
||||
JSONObject param = new JSONObject();
|
||||
param.put("start_pint_code", start_pint_code);
|
||||
param.put("end_pint_code", end_point_code);
|
||||
|
||||
BookTwoConfirmTask bookTwoConfirmTask = new BookTwoConfirmTask();
|
||||
String task_id = bookTwoConfirmTask.createTask(param);
|
||||
String task_id = bookTwoConfirmTask.createTask(param);*/
|
||||
|
||||
// 5.插入入库单
|
||||
Long currentUserId = SecurityUtils.getCurrentUserId();
|
||||
@@ -226,17 +281,18 @@ public class RawFoilServiceImpl implements RawFoilService {
|
||||
jsonRegion.put("end_point_code", end_point_code);
|
||||
jsonRegion.put("cust_id", "");
|
||||
jsonRegion.put("create_mode", "03");
|
||||
jsonRegion.put("task_id",task_id);
|
||||
jsonRegion.put("task_id", task_jo.getString("task_id"));
|
||||
jsonRegion.put("create_id", currentUserId);
|
||||
jsonRegion.put("create_name", currentUsername);
|
||||
jsonRegion.put("create_time", DateUtil.now());
|
||||
regionTab.insert(jsonRegion);
|
||||
|
||||
// 6.下发任务
|
||||
JSONObject jsonObject = bookTwoConfirmTask.renotifyAcs(task_id);
|
||||
// 6.下发任务入库任务
|
||||
BookTwoConfirmTask bookTwoConfirmTask = new BookTwoConfirmTask();
|
||||
JSONObject jsonObject = bookTwoConfirmTask.renotifyAcs(task_jo.getString("task_id"));
|
||||
if (StrUtil.equals(jsonObject.getString("status"), "200")) {
|
||||
// 成功返回 更新任务状态
|
||||
JSONObject jsonTask = taskTab.query("task_id ='" + task_id + "'").uniqueResult(0);
|
||||
JSONObject jsonTask = taskTab.query("task_id ='" + task_jo.getString("task_id") + "'").uniqueResult(0);
|
||||
jsonTask.put("task_status", "05");
|
||||
taskTab.update(jsonTask);
|
||||
// 更新出入表状态
|
||||
@@ -246,10 +302,13 @@ public class RawFoilServiceImpl implements RawFoilService {
|
||||
jsonRegion.put("update_time", DateUtil.now());
|
||||
regionTab.update(jsonRegion);
|
||||
}
|
||||
JSONObject jo = new JSONObject();
|
||||
jo.put("message", "操作成功!");
|
||||
return jo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void finish(JSONObject whereJson) {
|
||||
public JSONObject finish(JSONObject whereJson) {
|
||||
WQLObject coolTab = WQLObject.getWQLObject("PDM_BI_RawFoilWorkOrder"); // 生箔工单表
|
||||
|
||||
JSONObject jsonCool = coolTab.query("mfg_order_name = '" + whereJson.getString("mfg_order_name") + "'").uniqueResult(0);
|
||||
@@ -257,5 +316,9 @@ public class RawFoilServiceImpl implements RawFoilService {
|
||||
jsonCool.put("realend_time", DateUtil.now());
|
||||
jsonCool.put("finish_type", "02");
|
||||
coolTab.update(jsonCool);
|
||||
|
||||
JSONObject jo = new JSONObject();
|
||||
jo.put("message", "操作成功!");
|
||||
return jo;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -170,12 +170,13 @@
|
||||
plan.workorder_id,
|
||||
ivt.sort_seq,
|
||||
ivt.product_area,
|
||||
ivt.point_location
|
||||
ivt.point_location,
|
||||
plan.qzzno
|
||||
FROM
|
||||
PDM_BI_SlittingProductionPlan plan
|
||||
LEFT JOIN st_ivt_cutpointivt ivt ON ivt.ext_code = plan.resource_name
|
||||
WHERE
|
||||
plan.STATUS = 03
|
||||
plan.STATUS = 05
|
||||
AND
|
||||
is_child_tz_ok = 1
|
||||
AND
|
||||
|
||||
Binary file not shown.
@@ -101,10 +101,12 @@ public class CallEmpReelTask extends AbstractAcsTask {
|
||||
JSONObject json = new JSONObject();
|
||||
json.put("task_id",IdUtil.getSnowflake(1,1).nextId());
|
||||
json.put("task_code", CodeUtil.getNewCode("TASK_CODE"));
|
||||
json.put("task_type", "05");
|
||||
json.put("task_status", "01");
|
||||
json.put("point_code1", form.getString("start_pint_code"));
|
||||
json.put("point_code2", form.getString("end_pint_code"));
|
||||
json.put("point_code1", form.getString("point_code1"));
|
||||
json.put("point_code2", form.getString("point_code2"));
|
||||
json.put("point_code3", form.getString("point_code3"));
|
||||
json.put("point_code4", form.getString("point_code4"));
|
||||
json.put("task_type", form.getString("task_type"));
|
||||
json.put("handle_class", THIS_CLASS);
|
||||
json.put("sort_seq", "1");
|
||||
json.put("create_id", currentUserId);
|
||||
|
||||
@@ -68,14 +68,15 @@ public class CutTrussTask extends AbstractAcsTask {
|
||||
}
|
||||
WQLObject.getWQLObject("ST_IVT_CutPointIvt").update(cut_point);
|
||||
//更新输送线的气涨轴编码
|
||||
JSONObject delivery_point = WQLObject.getWQLObject("ST_IVT_DeliveryPointIvt").query("qzzno = '"+jsonTask.getString("point_code1")+"'").uniqueResult(0);
|
||||
JSONObject delivery_point = WQLObject.getWQLObject("ST_IVT_DeliveryPointIvt").query("point_code = '"+jsonTask.getString("point_code1")+"'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(delivery_point)){
|
||||
throw new BadRequestException("未查询到对应的输送线点位!");
|
||||
}
|
||||
delivery_point.put("qzzno",jsonTask.getString("vehicle_code2"));
|
||||
delivery_point.put("point_status","04");
|
||||
WQLObject.getWQLObject("ST_IVT_DeliveryPointIvt").update(delivery_point);
|
||||
//更新分切计划状态
|
||||
JSONArray plan_jo = WQLObject.getWQLObject("PDM_BI_SlittingProductionPlan").query("qzzno = '"+jsonTask.getString("vehicle_code2")+"' AND is_child_tz_ok = '1' AND is_child_ps_ok = '1' AND is_delete = '0' AND status = '1'").getResultJSONArray(0);
|
||||
//更新出站气涨轴的分切计划状态
|
||||
JSONArray plan_jo = WQLObject.getWQLObject("PDM_BI_SlittingProductionPlan").query("qzzno = '"+jsonTask.getString("vehicle_code2")+"' AND is_child_tz_ok = '1' AND is_child_ps_ok = '1' AND is_delete = '0' AND status = '06'").getResultJSONArray(0);
|
||||
if (ObjectUtil.isEmpty(plan_jo)){
|
||||
throw new BadRequestException("未查询到气涨轴:"+jsonTask.getString("vehicle_code2")+"对应的分切计划!");
|
||||
}
|
||||
@@ -85,6 +86,17 @@ public class CutTrussTask extends AbstractAcsTask {
|
||||
plan_row.put("end_time",DateUtil.now());
|
||||
WQLObject.getWQLObject("PDM_BI_SlittingProductionPlan").update(plan_row);
|
||||
}
|
||||
//更新入站气涨轴的分切计划状态
|
||||
JSONArray plan_jo2 = WQLObject.getWQLObject("PDM_BI_SlittingProductionPlan").query("qzzno = '"+jsonTask.getString("vehicle_code")+"' AND is_child_tz_ok = '1' AND is_child_ps_ok = '1' AND is_delete = '0' AND status = '04'").getResultJSONArray(0);
|
||||
if (ObjectUtil.isEmpty(plan_jo2)){
|
||||
throw new BadRequestException("未查询到气涨轴:"+jsonTask.getString("vehicle_code")+"对应的分切计划!");
|
||||
}
|
||||
for (int i = 0; i < plan_jo2.size(); i++) {
|
||||
JSONObject plan_row = plan_jo2.getJSONObject(i);
|
||||
plan_row.put("status","05");
|
||||
plan_row.put("end_time",DateUtil.now());
|
||||
WQLObject.getWQLObject("PDM_BI_SlittingProductionPlan").update(plan_row);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -125,6 +137,30 @@ public class CutTrussTask extends AbstractAcsTask {
|
||||
json.put("acs_task_type","5" );
|
||||
tab.insert(json);
|
||||
|
||||
//更新入站气涨轴的分切计划状态
|
||||
JSONArray plan_jo = WQLObject.getWQLObject("PDM_BI_SlittingProductionPlan").query("qzzno = '"+json.getString("vehicle_code")+"' AND is_child_tz_ok = '1' AND is_child_ps_ok = '1' AND is_delete = '0' AND status = '03'").getResultJSONArray(0);
|
||||
if (ObjectUtil.isEmpty(plan_jo)){
|
||||
throw new BadRequestException("未查询到气涨轴:"+json.getString("vehicle_code")+"对应的分切计划!");
|
||||
}
|
||||
for (int i = 0; i < plan_jo.size(); i++) {
|
||||
JSONObject plan_row = plan_jo.getJSONObject(i);
|
||||
plan_row.put("status","04");
|
||||
plan_row.put("end_time",DateUtil.now());
|
||||
WQLObject.getWQLObject("PDM_BI_SlittingProductionPlan").update(plan_row);
|
||||
}
|
||||
|
||||
//更新出站气涨轴的分切计划状态
|
||||
JSONArray plan_jo2 = WQLObject.getWQLObject("PDM_BI_SlittingProductionPlan").query("qzzno = '"+json.getString("vehicle_code2")+"' AND is_child_tz_ok = '1' AND is_child_ps_ok = '1' AND is_delete = '0' AND status = '05'").getResultJSONArray(0);
|
||||
if (ObjectUtil.isEmpty(plan_jo2)){
|
||||
throw new BadRequestException("未查询到气涨轴:"+json.getString("vehicle_code2")+"对应的分切计划!");
|
||||
}
|
||||
for (int i = 0; i < plan_jo2.size(); i++) {
|
||||
JSONObject plan_row = plan_jo.getJSONObject(i);
|
||||
plan_row.put("status","06");
|
||||
plan_row.put("end_time",DateUtil.now());
|
||||
WQLObject.getWQLObject("PDM_BI_SlittingProductionPlan").update(plan_row);
|
||||
}
|
||||
|
||||
return json.getString("task_id");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user