This commit is contained in:
2022-12-12 11:50:55 +08:00
parent 0c8ebd9db7
commit 8a4819d83d
19 changed files with 71 additions and 53 deletions

View File

@@ -37,4 +37,13 @@ public class BakingController {
public ResponseEntity<Object> inCoolIvt(@RequestBody JSONObject whereJson) {
return new ResponseEntity<>(bakingService.inCoolIvt(whereJson),HttpStatus.OK);
}
@PostMapping("/release")
@Log("解警")
@ApiOperation("解警")
public ResponseEntity<Object> release(@RequestBody JSONObject whereJson) {
return new ResponseEntity<>(bakingService.release(whereJson),HttpStatus.OK);
}
}

View File

@@ -6,6 +6,7 @@ import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.nl.modules.logging.annotation.Log;
import org.nl.modules.wql.core.content.HttpContext;
import org.nl.wms.pda.mps.service.CasingService;
import org.nl.wms.pda.mps.service.FeedingService;
import org.springframework.http.HttpStatus;
@@ -28,7 +29,10 @@ public class FeedingController {
@Log("分切计划初始化查询")
@ApiOperation("分切计划初始化查询")
public ResponseEntity<Object> queryMaterialInfo(@RequestBody JSONObject whereJson) {
return new ResponseEntity<>(feedingService.queryMaterialInfo(whereJson), HttpStatus.OK);
HttpContext ctx = new HttpContext("11");
ctx.setPage((String) (whereJson.get("page")));
ctx.setRows((String) (whereJson.get("size")));
return new ResponseEntity<>(feedingService.queryMaterialInfo(whereJson, ctx), HttpStatus.OK);
}
@PostMapping("/confirm")

View File

@@ -18,5 +18,7 @@ public interface BakingService {
*/
JSONObject inCoolIvt(JSONObject whereJson);
JSONObject release(JSONObject whereJson);
}

View File

@@ -1,18 +1,21 @@
package org.nl.wms.pda.mps.service;
import com.alibaba.fastjson.JSONObject;
import org.nl.modules.wql.core.content.HttpContext;
public interface FeedingService {
/**
* 分切计划初始化查询
*
* @param whereJson /
* @return JSONObject
*/
JSONObject queryMaterialInfo(JSONObject whereJson);
JSONObject queryMaterialInfo(JSONObject whereJson,HttpContext ctx);
/**
* 套轴确认
*
* @param whereJson /
* @return JSONObject
*/

View File

@@ -443,28 +443,9 @@ public class BakingServiceImpl implements BakingService {
return jsonHotMst.getString("iostorinv_id");
}
@Transactional
public void createHotDtl(JSONObject param) {
/*
* 创建烘箱区出入明细表
*/
WQLObject hotDtlTab = WQLObject.getWQLObject("ST_IVT_HotRegionIODtl"); // 烘箱区出入明细表
JSONObject jsonHotDtl = new JSONObject();
jsonHotDtl.put("iostorinv_id", IdUtil.getSnowflake(1, 1).nextId());
jsonHotDtl.put("bill_code", "");
jsonHotDtl.put("start_point_code", param.getString("start_point_code"));
jsonHotDtl.put("next_point_code", param.getString("next_point_code"));
jsonHotDtl.put("temperature", param.getString("temperature"));
jsonHotDtl.put("oven_time", param.getString("oven_time"));
jsonHotDtl.put("task_type", "1");
jsonHotDtl.put("task_id", param.getString("task_id"));
jsonHotDtl.put("create_id", 2);
jsonHotDtl.put("create_name", "mes用户");
jsonHotDtl.put("create_time", DateUtil.now());
jsonHotDtl.put("dtl_status", "10");
hotDtlTab.insert(jsonHotDtl);
@Override
@Transactional(rollbackFor = Exception.class)
public JSONObject release(JSONObject whereJson) {
return null;
}
}

View File

@@ -13,6 +13,7 @@ import org.nl.modules.common.utils.SecurityUtils;
import org.nl.modules.system.util.CodeUtil;
import org.nl.modules.wql.WQL;
import org.nl.modules.wql.core.bean.WQLObject;
import org.nl.modules.wql.core.content.HttpContext;
import org.nl.wms.ext.mes.service.LmsToMesService;
import org.nl.wms.pda.mps.service.CasingService;
import org.nl.wms.pda.mps.service.FeedingService;
@@ -33,7 +34,7 @@ public class FeedingServiceImpl implements FeedingService {
private final CheckOutBillService checkOutBillService;
@Override
public JSONObject queryMaterialInfo(JSONObject whereJson) {
public JSONObject queryMaterialInfo(JSONObject whereJson, HttpContext ctx) {
String product_area = whereJson.getString("product_area");
String point_code = whereJson.getString("point_code");
String device_code = whereJson.getString("device_code");
@@ -53,9 +54,10 @@ public class FeedingServiceImpl implements FeedingService {
if (StrUtil.isNotEmpty(container_name)) {
map.put("container_name", container_name);
}
JSONArray rows = WQL.getWO("PDA_02").addParamMap(map).process().getResultJSONArray(0);
JSONObject rows = WQL.getWO("PDA_02").addParamMap(map).pageQuery(ctx,"container_name");
JSONObject jo = new JSONObject();
jo.put("data", rows);
jo.put("data", rows.getJSONArray("content"));
jo.put("size", rows.getString("totalElements"));
jo.put("message", "查询成功!");
return jo;
}

View File

@@ -62,7 +62,7 @@ public class RawFoilServiceImpl implements RawFoilService {
map.put("product_area", "A1");
}*/
JSONObject arr = WQL.getWO("PDA_RAWFOIL_01").addParamMap(map).pageQuery(ctx,"container_name");
JSONObject arr = WQL.getWO("PDA_RAWFOIL_01").addParamMap(map).pageQuery(ctx, "container_name");
JSONArray rows = arr.getJSONArray("content");
for (int i = 0; i < rows.size(); i++) {
JSONObject json = new JSONObject();
@@ -82,21 +82,26 @@ public class RawFoilServiceImpl implements RawFoilService {
Date now_time = DateUtil.parse(DateUtil.now());
Date end_time2 = DateUtil.parse(end_time);
long betweenDay = DateUtil.between(end_time2, now_time, DateUnit.MINUTE, false);
long betweenDay = DateUtil.between(now_time, end_time2, DateUnit.MINUTE, false);
if (betweenDay > 0) {
if (betweenDay <= 0) {
json.put("color_type", "1");
} else if (betweenDay <= 0 && betweenDay >= -30) {
} else if (betweenDay > 0 && betweenDay <= 30) {
json.put("color_type", "2");
} else {
json.put("color_type", "0");
}
if (betweenDay < 0) {
betweenDay = 0;
}
json.put("container_name", jsonObject.getString("container_name"));
json.put("up_coiler_date", jsonObject.getString("up_coiler_date"));
json.put("end_date", end_time);
json.put("point_code", jsonObject.getString("resource_name"));
json.put("point_code", jsonObject.getString("ed_point_code"));
json.put("resource_name", jsonObject.getString("resource_name"));
json.put("pcsn", jsonObject.getString("product_name"));
json.put("remaining_time", betweenDay);
json.put("product_name", jsonObject.getString("theory_height"));
json.put("mfg_order_name", jsonObject.getString("mfg_order_name"));
@@ -104,7 +109,7 @@ public class RawFoilServiceImpl implements RawFoilService {
}
JSONObject jo = new JSONObject();
jo.put("data", resultArr);
jo.put("size",arr.getString("totalElements"));
jo.put("size", arr.getString("totalElements"));
jo.put("message", "查询成功!");
return jo;
@@ -116,10 +121,10 @@ public class RawFoilServiceImpl implements RawFoilService {
map.put("flag", "5");
map.put("point_code", whereJson.getString("point_code"));
map.put("container_name", whereJson.getString("container_name"));
JSONObject resultJSONArray = WQL.getWO("PDA_RAWFOIL_01").addParamMap(map).pageQuery(ctx,"container_name");
JSONObject resultJSONArray = WQL.getWO("PDA_RAWFOIL_01").addParamMap(map).pageQuery(ctx, "container_name");
JSONObject jo = new JSONObject();
jo.put("data", resultJSONArray.getJSONArray("content"));
jo.put("size",resultJSONArray.getString("totalElements"));
jo.put("size", resultJSONArray.getString("totalElements"));
jo.put("message", "查询成功!");
return jo;
}

View File

@@ -74,7 +74,7 @@
ENDIF
IF 输入.flag = "2"
QUERY
PAGEQUERY
SELECT
plan.*,
ivt.point_code,
@@ -102,7 +102,7 @@
ivt.point_code = 输入.device_code
ENDOPTION
ENDSELECT
ENDQUERY
ENDPAGEQUERY
ENDIF
IF 输入.flag = "3"

View File

@@ -130,15 +130,17 @@
IF 输入.flag = "4"
PAGEQUERY
SELECT
der.*
der.*,
sb.point_code AS ed_point_code
FROM
PDM_BI_RawFoilWorkOrder der
LEFT JOIN st_ivt_sbpointivt sb ON sb.ext_code = der.resource_name
WHERE
der.status = '01'
AND der.is_delete = '0'
OPTION 输入.point_code <> ""
der.resource_name = 输入.point_code
sb.point_code = 输入.point_code
ENDOPTION
OPTION 输入.container_name <> ""
@@ -169,7 +171,7 @@
der.mfg_order_name AS mfg_order_name,
der.container_name AS container_name,
ivt.point_code,
der.product_name AS pcsn,
der.product_name,
der.theory_height AS theory_height,
der.realstart_time AS realstart_time,
der.realend_time AS realend_time,

View File

@@ -202,7 +202,8 @@ public class BookTwoConfirmTask extends AbstractAcsTask {
@Override
public void cancel(String task_id) {
JSONObject taskObj = WQLObject.getWQLObject("SCH_BASE_Task").query("task_id = '" + task_id + "'").uniqueResult(0);
this.updateTaskStatus(taskObj, "0");
}
}

View File

@@ -273,7 +273,8 @@ public class CallEmpReelTask extends AbstractAcsTask {
@Override
public void cancel(String task_id) {
JSONObject taskObj = WQLObject.getWQLObject("SCH_BASE_Task").query("task_id = '" + task_id + "'").uniqueResult(0);
this.updateTaskStatus(taskObj, "0");
}
}

View File

@@ -315,7 +315,8 @@ public class CoolCutTask extends AbstractAcsTask {
@Override
public void cancel(String task_id) {
JSONObject taskObj = WQLObject.getWQLObject("SCH_BASE_Task").query("task_id = '" + task_id + "'").uniqueResult(0);
this.updateTaskStatus(taskObj, "0");
}
//判断该点位是否存在未完成的任务

View File

@@ -196,7 +196,8 @@ public class CutConveyorTask extends AbstractAcsTask {
@Override
public void cancel(String task_id) {
JSONObject taskObj = WQLObject.getWQLObject("SCH_BASE_Task").query("task_id = '" + task_id + "'").uniqueResult(0);
this.updateTaskStatus(taskObj, "0");
}
//判断该点位是否存在未完成的任务

View File

@@ -314,7 +314,8 @@ public class CutTrussTask extends AbstractAcsTask {
@Override
public void cancel(String task_id) {
JSONObject taskObj = WQLObject.getWQLObject("SCH_BASE_Task").query("task_id = '" + task_id + "'").uniqueResult(0);
this.updateTaskStatus(taskObj, "0");
}
}

View File

@@ -201,7 +201,8 @@ public class InCoolIvtTask extends AbstractAcsTask {
@Override
public void cancel(String task_id) {
JSONObject taskObj = WQLObject.getWQLObject("SCH_BASE_Task").query("task_id = '" + task_id + "'").uniqueResult(0);
this.updateTaskStatus(taskObj, "0");
}
}

View File

@@ -288,7 +288,8 @@ public class InHotTask extends AbstractAcsTask {
@Override
public void cancel(String task_id) {
JSONObject taskObj = WQLObject.getWQLObject("SCH_BASE_Task").query("task_id = '" + task_id + "'").uniqueResult(0);
this.updateTaskStatus(taskObj, "0");
}
}

View File

@@ -169,7 +169,8 @@ public class InTask extends AbstractAcsTask {
}
@Override
public void cancel(String taskdtl_id) {
public void cancel(String task_id) {
JSONObject taskObj = WQLObject.getWQLObject("SCH_BASE_Task").query("task_id = '" + task_id + "'").uniqueResult(0);
this.updateTaskStatus(taskObj, "0");
}
}

View File

@@ -190,7 +190,8 @@ public class OutHotTask extends AbstractAcsTask {
@Override
public void cancel(String task_id) {
JSONObject taskObj = WQLObject.getWQLObject("SCH_BASE_Task").query("task_id = '" + task_id + "'").uniqueResult(0);
this.updateTaskStatus(taskObj, "0");
}
}

View File

@@ -157,7 +157,8 @@ public class OutTask extends AbstractAcsTask {
}
@Override
public void cancel(String taskdtl_id) {
public void cancel(String task_id) {
JSONObject taskObj = WQLObject.getWQLObject("SCH_BASE_Task").query("task_id = '" + task_id + "'").uniqueResult(0);
this.updateTaskStatus(taskObj, "0");
}
}