子卷出站
This commit is contained in:
@@ -7,6 +7,7 @@ import lombok.RequiredArgsConstructor;
|
|||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.nl.modules.logging.annotation.Log;
|
import org.nl.modules.logging.annotation.Log;
|
||||||
import org.nl.wms.pda.mps.service.CasingService;
|
import org.nl.wms.pda.mps.service.CasingService;
|
||||||
|
import org.nl.wms.pda.mps.service.OutService;
|
||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
@@ -21,20 +22,20 @@ import org.springframework.web.bind.annotation.RestController;
|
|||||||
@Slf4j
|
@Slf4j
|
||||||
public class OutController {
|
public class OutController {
|
||||||
|
|
||||||
private final CasingService casingService;
|
private final OutService outService;
|
||||||
|
|
||||||
@PostMapping("/queryMaterialInfo")
|
@PostMapping("/queryMaterialInfo")
|
||||||
@Log("分切计划初始化查询")
|
@Log("分切计划初始化查询")
|
||||||
@ApiOperation("分切计划初始化查询")
|
@ApiOperation("分切计划初始化查询")
|
||||||
public ResponseEntity<Object> queryMaterialInfo(@RequestBody JSONObject whereJson) {
|
public ResponseEntity<Object> queryMaterialInfo(@RequestBody JSONObject whereJson) {
|
||||||
return new ResponseEntity<>(casingService.queryMaterialInfo(whereJson), HttpStatus.OK);
|
return new ResponseEntity<>(outService.queryMaterialInfo(whereJson), HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/confirm")
|
@PostMapping("/confirm")
|
||||||
@Log("套轴确认")
|
@Log("套轴确认")
|
||||||
@ApiOperation("套轴确认")
|
@ApiOperation("套轴确认")
|
||||||
public ResponseEntity<Object> confirm(@RequestBody JSONObject whereJson) {
|
public ResponseEntity<Object> confirm(@RequestBody JSONObject whereJson) {
|
||||||
casingService.confirm(whereJson);
|
outService.confirm(whereJson);
|
||||||
return new ResponseEntity<>(HttpStatus.OK);
|
return new ResponseEntity<>(HttpStatus.OK);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package org.nl.wms.pda.mps.service;
|
package org.nl.wms.pda.mps.service;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
|
||||||
public interface OutService {
|
public interface OutService {
|
||||||
@@ -9,7 +10,7 @@ public interface OutService {
|
|||||||
* @param whereJson /
|
* @param whereJson /
|
||||||
* @return JSONObject
|
* @return JSONObject
|
||||||
*/
|
*/
|
||||||
JSONObject queryMaterialInfo(JSONObject whereJson);
|
JSONArray queryMaterialInfo(JSONObject whereJson);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 出站确认
|
* 出站确认
|
||||||
|
|||||||
@@ -1,12 +1,17 @@
|
|||||||
package org.nl.wms.pda.mps.service.impl;
|
package org.nl.wms.pda.mps.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.nl.modules.wql.WQL;
|
||||||
import org.nl.wms.pda.mps.service.OutService;
|
import org.nl.wms.pda.mps.service.OutService;
|
||||||
import org.nl.wms.pda.mps.service.ShippingService;
|
import org.nl.wms.pda.mps.service.ShippingService;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@@ -14,11 +19,16 @@ public class OutServiceImpl implements OutService {
|
|||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public JSONObject queryMaterialInfo(JSONObject whereJson) {
|
public JSONArray queryMaterialInfo(JSONObject whereJson) {
|
||||||
JSONObject result = new JSONObject();
|
String product_area = whereJson.getString("product_area");
|
||||||
result.put("code", "1");
|
|
||||||
result.put("desc", "查询成功");
|
HashMap map = new HashMap();
|
||||||
return result;
|
map.put("flag", "5");
|
||||||
|
if (StrUtil.isNotEmpty(product_area)) {
|
||||||
|
map.put("product_area", product_area);
|
||||||
|
}
|
||||||
|
JSONArray rows = WQL.getWO("PDA_02").addParamMap(map).process().getResultJSONArray(0);
|
||||||
|
return rows;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import lombok.RequiredArgsConstructor;
|
|||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.nl.modules.common.exception.BadRequestException;
|
import org.nl.modules.common.exception.BadRequestException;
|
||||||
import org.nl.modules.wql.WQL;
|
import org.nl.modules.wql.WQL;
|
||||||
|
import org.nl.modules.wql.core.bean.WQLObject;
|
||||||
import org.nl.wms.pda.mps.service.CasingService;
|
import org.nl.wms.pda.mps.service.CasingService;
|
||||||
import org.nl.wms.pda.mps.service.ShippingService;
|
import org.nl.wms.pda.mps.service.ShippingService;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
@@ -42,21 +43,40 @@ public class ShippingServiceImpl implements ShippingService {
|
|||||||
JSONObject cut_jo = whereJson.getJSONObject("cut_jo");
|
JSONObject cut_jo = whereJson.getJSONObject("cut_jo");
|
||||||
//查询离该分切计划包含机台最近的一个空载具
|
//查询离该分切计划包含机台最近的一个空载具
|
||||||
JSONObject empty_vehicle = WQL.getWO("PDA_02")
|
JSONObject empty_vehicle = WQL.getWO("PDA_02")
|
||||||
.addParam("sort_seq",cut_jo.getString("sort_seq"))
|
.addParam("sort_seq", cut_jo.getString("sort_seq"))
|
||||||
.addParam("product_area",cut_jo.getString("product_area"))
|
.addParam("product_area", cut_jo.getString("product_area"))
|
||||||
.addParam("point_location",cut_jo.getString("point_location"))
|
.addParam("point_location", cut_jo.getString("point_location"))
|
||||||
.addParam("flag","3").process().uniqueResult(0);
|
.addParam("flag", "3").process().uniqueResult(0);
|
||||||
if (ObjectUtil.isEmpty(empty_vehicle)){
|
if (ObjectUtil.isEmpty(empty_vehicle)) {
|
||||||
throw new BadRequestException("未查询到可用的空载具!");
|
throw new BadRequestException("未查询到可用的空载具!");
|
||||||
}
|
}
|
||||||
|
|
||||||
//如果查询到给ACS下发一个桁架任务
|
//如果查询到给ACS下发一个输送线任务
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void confirm(JSONObject whereJson) {
|
public void confirm(JSONObject whereJson) {
|
||||||
|
JSONArray rows = whereJson.getJSONArray("cut_rows");
|
||||||
|
|
||||||
|
//通过气涨轴对应的分切计划来判断要送到哪个机台编号附近
|
||||||
|
String qzzno = rows.getJSONObject(0).getString("qzzno");
|
||||||
|
|
||||||
|
HashMap map = new HashMap();
|
||||||
|
map.put("flag", "3");
|
||||||
|
|
||||||
|
if (StrUtil.isNotEmpty(qzzno)) {
|
||||||
|
map.put("qzzno", qzzno);
|
||||||
|
}
|
||||||
|
JSONObject plan_jo = WQL.getWO("PDA_02").addParamMap(map).process().uniqueResult(0);
|
||||||
|
//查询离该分切计划包含机台最近的一个空点位
|
||||||
|
JSONObject empty_point = WQL.getWO("PDA_02")
|
||||||
|
.addParam("sort_seq", plan_jo.getString("sort_seq"))
|
||||||
|
.addParam("product_area", plan_jo.getString("product_area"))
|
||||||
|
.addParam("point_location", plan_jo.getString("point_location"))
|
||||||
|
.addParam("flag", "4").process().uniqueResult(0);
|
||||||
|
|
||||||
|
//下发输送线任务
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -116,7 +116,7 @@
|
|||||||
FROM
|
FROM
|
||||||
st_ivt_deliverypointivt ivt
|
st_ivt_deliverypointivt ivt
|
||||||
WHERE
|
WHERE
|
||||||
1=1
|
point_status = '02'
|
||||||
OPTION 输入.product_area <> ""
|
OPTION 输入.product_area <> ""
|
||||||
ivt.product_area = 输入.product_area
|
ivt.product_area = 输入.product_area
|
||||||
ENDOPTION
|
ENDOPTION
|
||||||
@@ -124,10 +124,64 @@
|
|||||||
ivt.point_location = 输入.point_location
|
ivt.point_location = 输入.point_location
|
||||||
ENDOPTION
|
ENDOPTION
|
||||||
ORDER BY
|
ORDER BY
|
||||||
abs(3-输入.sort_seq),point_code
|
abs(输入.sort_seq-sort_seq),point_code
|
||||||
ENDSELECT
|
ENDSELECT
|
||||||
ENDQUERY
|
ENDQUERY
|
||||||
ENDIF
|
ENDIF
|
||||||
|
|
||||||
|
IF 输入.flag = "4"
|
||||||
|
QUERY
|
||||||
|
SELECT
|
||||||
|
ivt.*
|
||||||
|
FROM
|
||||||
|
st_ivt_deliverypointivt ivt
|
||||||
|
WHERE
|
||||||
|
point_status = '01'
|
||||||
|
OPTION 输入.product_area <> ""
|
||||||
|
ivt.product_area = 输入.product_area
|
||||||
|
ENDOPTION
|
||||||
|
OPTION 输入.product_area <> ""
|
||||||
|
ivt.point_location = 输入.point_location
|
||||||
|
ENDOPTION
|
||||||
|
ORDER BY
|
||||||
|
abs(输入.sort_seq-sort_seq),point_code
|
||||||
|
ENDSELECT
|
||||||
|
ENDQUERY
|
||||||
|
ENDIF
|
||||||
|
|
||||||
|
IF 输入.flag = "5"
|
||||||
|
QUERY
|
||||||
|
SELECT
|
||||||
|
plan.mfg_order_name,
|
||||||
|
plan.container_name,
|
||||||
|
ivt.point_code,
|
||||||
|
plan.split_group,
|
||||||
|
plan.manufacture_sort,
|
||||||
|
plan.manufacture_date,
|
||||||
|
plan.paper_tube_or_FRP,
|
||||||
|
plan.paper_tube_material,
|
||||||
|
plan.paper_tube_description,
|
||||||
|
plan.paper_tube_model,
|
||||||
|
plan.FRP_material,
|
||||||
|
plan.FRP_description,
|
||||||
|
plan.FRP_model,
|
||||||
|
plan.workorder_id,
|
||||||
|
ivt.sort_seq,
|
||||||
|
ivt.product_area,
|
||||||
|
ivt.point_location
|
||||||
|
FROM
|
||||||
|
PDM_BI_SlittingProductionPlan plan
|
||||||
|
LEFT JOIN st_ivt_cutpointivt ivt ON ivt.ext_code = plan.resource_name
|
||||||
|
WHERE
|
||||||
|
plan.STATUS < 2
|
||||||
|
AND
|
||||||
|
is_child_tz_ok = 1
|
||||||
|
AND
|
||||||
|
is_child_ps_ok = 1
|
||||||
|
OPTION 输入.product_area <> ""
|
||||||
|
ivt.product_area = 输入.product_area
|
||||||
|
ENDOPTION
|
||||||
|
ENDSELECT
|
||||||
|
ENDQUERY
|
||||||
|
ENDIF
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user