Merge remote-tracking branch 'origin/b_lms' into b_lms
This commit is contained in:
@@ -53,10 +53,18 @@ public class SlitterPdaController {
|
|||||||
public ResponseEntity<Object> getShaftPoint() {
|
public ResponseEntity<Object> getShaftPoint() {
|
||||||
return new ResponseEntity<>(slitterDevices.getShaftPoint(), HttpStatus.OK);
|
return new ResponseEntity<>(slitterDevices.getShaftPoint(), HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/doInitShaftPoint")
|
@PostMapping("/doInitShaftPoint")
|
||||||
@Log("初始化套拔轴点位")
|
@Log("初始化套拔轴点位")
|
||||||
@SaIgnore
|
@SaIgnore
|
||||||
public ResponseEntity<Object> doInitShaftPoint(@RequestBody JSONObject param) {
|
public ResponseEntity<Object> doInitShaftPoint(@RequestBody JSONObject param) {
|
||||||
return new ResponseEntity<>(slitterDevices.doInitShaftPoint(param), HttpStatus.OK);
|
return new ResponseEntity<>(slitterDevices.doInitShaftPoint(param), HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PostMapping("/cutIn")
|
||||||
|
@Log("分切母卷上料")
|
||||||
|
@SaIgnore
|
||||||
|
public ResponseEntity<Object> cutIn(@RequestBody JSONObject param) {
|
||||||
|
return new ResponseEntity<>(slitterDevices.cutIn(param), HttpStatus.OK);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,6 +12,8 @@ import org.nl.common.utils.SecurityUtils;
|
|||||||
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.modules.wql.core.bean.WQLObject;
|
||||||
|
import org.nl.modules.wql.util.SpringContextHolder;
|
||||||
|
import org.nl.wms.ext.mes.service.LmsToMesService;
|
||||||
import org.nl.wms.sch.AcsTaskDto;
|
import org.nl.wms.sch.AcsTaskDto;
|
||||||
import org.nl.wms.sch.manage.AbstractAcsTask;
|
import org.nl.wms.sch.manage.AbstractAcsTask;
|
||||||
import org.nl.wms.sch.manage.TaskStatusEnum;
|
import org.nl.wms.sch.manage.TaskStatusEnum;
|
||||||
@@ -128,6 +130,17 @@ public class ProcessTask extends AbstractAcsTask {
|
|||||||
map3.put("empty_vehicle_code", empty_vehicle_code);
|
map3.put("empty_vehicle_code", empty_vehicle_code);
|
||||||
map3.put("empty_point_status", "02");
|
map3.put("empty_point_status", "02");
|
||||||
ivtTab.update(map3, "empty_point_code = '" + point_code4 + "'");
|
ivtTab.update(map3, "empty_point_code = '" + point_code4 + "'");
|
||||||
|
|
||||||
|
//调用MES转移接口
|
||||||
|
String from_area = cool_jo1.getString("point_code").substring(0,2);
|
||||||
|
String to_area = st_jo1.getString("ext_code").substring(0, 2);
|
||||||
|
JSONObject mom_jo = new JSONObject();
|
||||||
|
mom_jo.put("from_area", from_area);
|
||||||
|
mom_jo.put("to_area", to_area);
|
||||||
|
mom_jo.put("container_name", container_name);
|
||||||
|
LmsToMesService bean = SpringContextHolder.getBean(LmsToMesService.class);
|
||||||
|
bean.momAutoTransterMoveIn(mom_jo);
|
||||||
|
|
||||||
}
|
}
|
||||||
if ("011002".equals(task_type)) {
|
if ("011002".equals(task_type)) {
|
||||||
//维护冷却区满轴点位的库存
|
//维护冷却区满轴点位的库存
|
||||||
@@ -142,6 +155,18 @@ public class ProcessTask extends AbstractAcsTask {
|
|||||||
HashMap map2 = new HashMap();
|
HashMap map2 = new HashMap();
|
||||||
map2.put("up_scroll", full_vehicle_code);
|
map2.put("up_scroll", full_vehicle_code);
|
||||||
stTab.update(map2, "up_point_code = '" + point_code2.split("_K")[0] + "'").uniqueResult(0);
|
stTab.update(map2, "up_point_code = '" + point_code2.split("_K")[0] + "'").uniqueResult(0);
|
||||||
|
JSONObject st_jo1 = stTab.query("up_point_code = '" + point_code2.split("_M")[0] + "'").uniqueResult(0);
|
||||||
|
|
||||||
|
//调用MES转移接口
|
||||||
|
String from_area = cool_jo1.getString("point_code").substring(0,2);
|
||||||
|
String to_area = st_jo1.getString("ext_code").substring(0, 2);
|
||||||
|
JSONObject mom_jo = new JSONObject();
|
||||||
|
mom_jo.put("from_area", from_area);
|
||||||
|
mom_jo.put("to_area", to_area);
|
||||||
|
mom_jo.put("container_name", container_name);
|
||||||
|
LmsToMesService bean = SpringContextHolder.getBean(LmsToMesService.class);
|
||||||
|
bean.momAutoTransterMoveIn(mom_jo);
|
||||||
|
|
||||||
}
|
}
|
||||||
if ("010703".equals(task_type)) {
|
if ("010703".equals(task_type)) {
|
||||||
//维护表处区点位
|
//维护表处区点位
|
||||||
@@ -169,6 +194,18 @@ public class ProcessTask extends AbstractAcsTask {
|
|||||||
map3.put("container_name", container_name);
|
map3.put("container_name", container_name);
|
||||||
map3.put("full_point_status", "02");
|
map3.put("full_point_status", "02");
|
||||||
ivtTab.update(map3, "full_point_code = '" + point_code2 + "'");
|
ivtTab.update(map3, "full_point_code = '" + point_code2 + "'");
|
||||||
|
|
||||||
|
JSONObject cool_jo1 = ivtTab.query("full_point_code = '" + point_code2 + "'").uniqueResult(0);
|
||||||
|
|
||||||
|
//调用MES转移接口
|
||||||
|
String from_area = st_jo1.getString("ext_code").substring(0, 2);
|
||||||
|
String to_area = cool_jo1.getString("point_code").substring(0,2);
|
||||||
|
JSONObject mom_jo = new JSONObject();
|
||||||
|
mom_jo.put("from_area", from_area);
|
||||||
|
mom_jo.put("to_area", to_area);
|
||||||
|
mom_jo.put("container_name", container_name);
|
||||||
|
LmsToMesService bean = SpringContextHolder.getBean(LmsToMesService.class);
|
||||||
|
bean.momAutoTransterMoveIn(mom_jo);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -70,7 +70,6 @@ public class StockAreaCallTubeTask extends AbstractAcsTask {
|
|||||||
.vehicle_code(task.getVehicle_code())
|
.vehicle_code(task.getVehicle_code())
|
||||||
.agv_system_type(agv_system_type)
|
.agv_system_type(agv_system_type)
|
||||||
.priority(task.getPriority())
|
.priority(task.getPriority())
|
||||||
.remark(task.getRemark())
|
|
||||||
.product_area(task.getProduct_area())
|
.product_area(task.getProduct_area())
|
||||||
.build();
|
.build();
|
||||||
resultList.add(dto);
|
resultList.add(dto);
|
||||||
|
|||||||
@@ -64,7 +64,6 @@ public class StockAreaSendVehicleTask extends AbstractAcsTask {
|
|||||||
.vehicle_code(task.getVehicle_code())
|
.vehicle_code(task.getVehicle_code())
|
||||||
.agv_system_type(agv_system_type)
|
.agv_system_type(agv_system_type)
|
||||||
.priority(task.getPriority())
|
.priority(task.getPriority())
|
||||||
.remark(task.getRemark())
|
|
||||||
.product_area(task.getProduct_area())
|
.product_area(task.getProduct_area())
|
||||||
.build();
|
.build();
|
||||||
resultList.add(dto);
|
resultList.add(dto);
|
||||||
|
|||||||
@@ -118,4 +118,6 @@ public interface SlitterService {
|
|||||||
* @return /
|
* @return /
|
||||||
*/
|
*/
|
||||||
JSONObject doInitShaftPoint(JSONObject param);
|
JSONObject doInitShaftPoint(JSONObject param);
|
||||||
|
|
||||||
|
JSONObject cutIn(JSONObject param);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,6 +39,7 @@ import org.nl.b_lms.sch.tasks.slitter.util.SlitterTaskUtil;
|
|||||||
import org.nl.common.utils.SecurityUtils;
|
import org.nl.common.utils.SecurityUtils;
|
||||||
import org.nl.common.utils.TaskUtils;
|
import org.nl.common.utils.TaskUtils;
|
||||||
import org.nl.modules.common.exception.BadRequestException;
|
import org.nl.modules.common.exception.BadRequestException;
|
||||||
|
import org.nl.modules.wql.core.bean.WQLObject;
|
||||||
import org.nl.wms.ext.acs.service.WmsToAcsService;
|
import org.nl.wms.ext.acs.service.WmsToAcsService;
|
||||||
import org.redisson.api.RLock;
|
import org.redisson.api.RLock;
|
||||||
import org.redisson.api.RedissonClient;
|
import org.redisson.api.RedissonClient;
|
||||||
@@ -610,7 +611,7 @@ public class SlitterServiceImpl implements SlitterService {
|
|||||||
}
|
}
|
||||||
res.put("RTOAL", 0);
|
res.put("RTOAL", 0);
|
||||||
res.put("RTMSG", "操作失败!");
|
res.put("RTMSG", "操作失败!");
|
||||||
res.put("RTYPE", "F");
|
res.put("RTYPE", "E");
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -800,4 +801,23 @@ public class SlitterServiceImpl implements SlitterService {
|
|||||||
res.put("message", "请求成功!");
|
res.put("message", "请求成功!");
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public JSONObject cutIn(JSONObject param) {
|
||||||
|
String container_name = param.getString("container_name");
|
||||||
|
//如果have_empty为0,则不做四个点的任务,为1则做四个点的任务
|
||||||
|
String have_empty = param.getString("have_empty");
|
||||||
|
String device_code = param.getString("device_code");
|
||||||
|
|
||||||
|
//查询当前母卷所在的点位在哪
|
||||||
|
JSONObject cache_jo = WQLObject.getWQLObject("st_ivt_stpointcacheivt").query("container_name = '"+container_name+"'").uniqueResult(0);
|
||||||
|
if (ObjectUtil.isEmpty(cache_jo)) {
|
||||||
|
throw new BadRequestException("未查询到母卷所在的点位!");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
import java.util.Comparator;
|
import java.util.Comparator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
@@ -132,7 +133,15 @@ public class InBoxManageServiceImpl implements InBoxManageService {
|
|||||||
jsonParam.put("box_high", boxDao.getBox_high());
|
jsonParam.put("box_high", boxDao.getBox_high());
|
||||||
jsonParam.put("vehicle_type", boxDao.getVehicle_type());
|
jsonParam.put("vehicle_type", boxDao.getVehicle_type());
|
||||||
jsonParam.put("height", height);
|
jsonParam.put("height", height);
|
||||||
JSONObject jsonAttr = getStruct(jsonParam);
|
|
||||||
|
// 优先找相同规格的木箱:如果未找到在执行负载均衡策略
|
||||||
|
JSONObject jsonAttr;
|
||||||
|
jsonAttr = queryEqualBox(jsonParam);
|
||||||
|
|
||||||
|
if (ObjectUtil.isEmpty(jsonAttr)) {
|
||||||
|
jsonAttr = getStruct(jsonParam);
|
||||||
|
}
|
||||||
|
|
||||||
if (ObjectUtil.isEmpty(jsonAttr)) {
|
if (ObjectUtil.isEmpty(jsonAttr)) {
|
||||||
notInRowList.clear();
|
notInRowList.clear();
|
||||||
notInBlockList.clear();
|
notInBlockList.clear();
|
||||||
@@ -412,6 +421,84 @@ public class InBoxManageServiceImpl implements InBoxManageService {
|
|||||||
return jsonAttrNow;
|
return jsonAttrNow;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据木箱规格找相同规格的仓位
|
||||||
|
* @param jsonParam {
|
||||||
|
* stor_id:仓库标识
|
||||||
|
* sect_id:库区标识
|
||||||
|
* box_length:木箱长度
|
||||||
|
* box_width:木箱宽度
|
||||||
|
* box_high:木箱高度
|
||||||
|
* vehicle_type: 载具类型
|
||||||
|
* height: 仓位高度
|
||||||
|
* }
|
||||||
|
* @return JSONObject : 仓位对象
|
||||||
|
*/
|
||||||
|
private JSONObject queryEqualBox(JSONObject jsonParam) {
|
||||||
|
// 需要返回的仓位
|
||||||
|
JSONObject result = new JSONObject();
|
||||||
|
|
||||||
|
// 1.匹配相同木箱规格的排(row_num)
|
||||||
|
jsonParam.put("flag", "6");
|
||||||
|
List<JSONObject> rowList = WQL.getWO("BST_INBOX").addParamMap(jsonParam)
|
||||||
|
.process().getResultJSONArray(0).toJavaList(JSONObject.class);
|
||||||
|
|
||||||
|
// 查询此排的所有仓位
|
||||||
|
String row_in = rowList.stream()
|
||||||
|
.map(row -> row.getString("row_num"))
|
||||||
|
.collect(Collectors.joining("','"));
|
||||||
|
|
||||||
|
List<JSONObject> attrRowAllList = WQL.getWO("BST_INBOX").addParam("flag", "7").addParam("sect_id", jsonParam.getString("sect_id"))
|
||||||
|
.addParam("row_in", "('" + row_in + "')").process().getResultJSONArray(0).toJavaList(JSONObject.class);
|
||||||
|
|
||||||
|
|
||||||
|
outerLoop: for (JSONObject jsonRow : rowList) {
|
||||||
|
// 查询这一排相同木箱规格的仓位
|
||||||
|
List<JSONObject> attrRowList = attrRowAllList.stream()
|
||||||
|
.filter(row -> row.getString("row_num").equals(jsonRow.getString("row_num")))
|
||||||
|
.filter(row -> row.getDoubleValue("box_length") == jsonParam.getDoubleValue("box_length")
|
||||||
|
&& row.getDoubleValue("box_width") == jsonParam.getDoubleValue("box_width")
|
||||||
|
&& row.getDoubleValue("box_high") == jsonParam.getDoubleValue("box_high")
|
||||||
|
&& ObjectUtil.isNotEmpty(row.getString("storagevehicle_code"))
|
||||||
|
)
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
|
||||||
|
// 匹配货位
|
||||||
|
for (JSONObject json : attrRowList) {
|
||||||
|
// 判断此货位是深位还是浅位
|
||||||
|
if (json.getString("zdepth").equals(IOSEnum.ZDEPTH_STRUCT.code("浅"))
|
||||||
|
|| json.getString("zdepth").equals(IOSEnum.ZDEPTH_STRUCT.code("无"))
|
||||||
|
) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 如果是深位:找出对应浅位
|
||||||
|
JSONObject lowAttr = attrRowAllList.stream()
|
||||||
|
.filter(row -> row.getString("col_num").equals(json.getString("col_num")) &&
|
||||||
|
row.getString("layer_num").equals(json.getString("layer_num")) &&
|
||||||
|
row.getString("row_num").equals(json.getString("row_num")) &&
|
||||||
|
row.getString("zdepth").equals(IOSEnum.ZDEPTH_STRUCT.code("浅")))
|
||||||
|
.findFirst().orElse(null);
|
||||||
|
|
||||||
|
if (ObjectUtil.isEmpty(lowAttr)) {
|
||||||
|
throw new BadRequestException("仓位:" + json.getString("struct_code") + "对应的浅货位错误!");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 判断此仓位是否有货、是否被锁住
|
||||||
|
if (ObjectUtil.isNotEmpty(lowAttr.getString("storagevehicle_code"))
|
||||||
|
|| !lowAttr.getString("lock_type").equals(IOSEnum.LOCK_TYPE.code("未锁定"))
|
||||||
|
) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
result = lowAttr;
|
||||||
|
break outerLoop;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 找一个空仓位(木箱区)
|
* 找一个空仓位(木箱区)
|
||||||
*
|
*
|
||||||
@@ -502,6 +589,7 @@ public class InBoxManageServiceImpl implements InBoxManageService {
|
|||||||
* box_length:木箱长度
|
* box_length:木箱长度
|
||||||
* box_width:木箱宽度
|
* box_width:木箱宽度
|
||||||
* box_high:木箱高度
|
* box_high:木箱高度
|
||||||
|
* vehicle_type: 载具类型
|
||||||
* }
|
* }
|
||||||
* @return String 巷道
|
* @return String 巷道
|
||||||
*/
|
*/
|
||||||
@@ -562,6 +650,7 @@ public class InBoxManageServiceImpl implements InBoxManageService {
|
|||||||
* box_length:木箱长度
|
* box_length:木箱长度
|
||||||
* box_width:木箱宽度
|
* box_width:木箱宽度
|
||||||
* box_high:木箱高度
|
* box_high:木箱高度
|
||||||
|
* vehicle_type: 载具类型
|
||||||
* }
|
* }
|
||||||
* @return String 排
|
* @return String 排
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -20,6 +20,9 @@
|
|||||||
输入.height TYPEAS s_string
|
输入.height TYPEAS s_string
|
||||||
输入.row_num TYPEAS s_string
|
输入.row_num TYPEAS s_string
|
||||||
输入.vehicle_type TYPEAS s_string
|
输入.vehicle_type TYPEAS s_string
|
||||||
|
输入.box_length TYPEAS s_string
|
||||||
|
输入.box_width TYPEAS s_string
|
||||||
|
输入.box_high TYPEAS s_string
|
||||||
输入.block_in TYPEAS f_string
|
输入.block_in TYPEAS f_string
|
||||||
输入.row_in TYPEAS f_string
|
输入.row_in TYPEAS f_string
|
||||||
输入.not_row_in TYPEAS f_string
|
输入.not_row_in TYPEAS f_string
|
||||||
@@ -184,4 +187,64 @@
|
|||||||
|
|
||||||
ENDSELECT
|
ENDSELECT
|
||||||
ENDQUERY
|
ENDQUERY
|
||||||
ENDIF
|
ENDIF
|
||||||
|
|
||||||
|
IF 输入.flag = "6"
|
||||||
|
QUERY
|
||||||
|
SELECT
|
||||||
|
attr.row_num
|
||||||
|
FROM
|
||||||
|
st_ivt_structattr attr
|
||||||
|
INNER JOIN bst_ivt_boxinfo box ON box.box_no = attr.storagevehicle_code
|
||||||
|
WHERE
|
||||||
|
attr.is_used = '1'
|
||||||
|
AND attr.is_delete = '0'
|
||||||
|
AND attr.stor_id = 输入.stor_id
|
||||||
|
AND attr.sect_id = 输入.sect_id
|
||||||
|
AND attr.storagevehicle_type = 输入.vehicle_type
|
||||||
|
AND box.is_packing = '0'
|
||||||
|
AND IFNULL(attr.storagevehicle_code,'') <> ''
|
||||||
|
|
||||||
|
OPTION 输入.box_length <> ""
|
||||||
|
box.box_length = 输入.box_length
|
||||||
|
ENDOPTION
|
||||||
|
|
||||||
|
OPTION 输入.box_width <> ""
|
||||||
|
box.box_width = 输入.box_width
|
||||||
|
ENDOPTION
|
||||||
|
|
||||||
|
OPTION 输入.box_high <> ""
|
||||||
|
box.box_high = 输入.box_high
|
||||||
|
ENDOPTION
|
||||||
|
|
||||||
|
GROUP BY attr.row_num
|
||||||
|
|
||||||
|
ENDOPTION
|
||||||
|
|
||||||
|
ENDSELECT
|
||||||
|
ENDQUERY
|
||||||
|
ENDIF
|
||||||
|
|
||||||
|
IF 输入.flag = "7"
|
||||||
|
QUERY
|
||||||
|
SELECT
|
||||||
|
attr.*,
|
||||||
|
box.box_length,
|
||||||
|
box.box_width,
|
||||||
|
box.box_high
|
||||||
|
FROM
|
||||||
|
st_ivt_structattr attr
|
||||||
|
LEFT JOIN bst_ivt_boxinfo box ON box.box_no = attr.storagevehicle_code AND box.is_packing = '0'
|
||||||
|
WHERE
|
||||||
|
attr.is_used = '1'
|
||||||
|
AND attr.is_delete = '0'
|
||||||
|
AND attr.sect_id = 输入.sect_id
|
||||||
|
|
||||||
|
OPTION 输入.row_in <> ""
|
||||||
|
attr.row_num IN 输入.row_in
|
||||||
|
ENDOPTION
|
||||||
|
|
||||||
|
ENDOPTION
|
||||||
|
ENDSELECT
|
||||||
|
ENDQUERY
|
||||||
|
ENDIF
|
||||||
|
|||||||
@@ -1886,6 +1886,9 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
|||||||
if (ObjectUtil.isEmpty(whereJson.getString("material_barcode"))) {
|
if (ObjectUtil.isEmpty(whereJson.getString("material_barcode"))) {
|
||||||
throw new BadRequestException("子卷号不能为空!");
|
throw new BadRequestException("子卷号不能为空!");
|
||||||
}
|
}
|
||||||
|
if (whereJson.getIntValue("weight") <= 0) {
|
||||||
|
throw new BadRequestException("上报的重量不能为0!");
|
||||||
|
}
|
||||||
whereJson.put("bill_type", IOSEnum.IN_TYPE.code("生产入库"));
|
whereJson.put("bill_type", IOSEnum.IN_TYPE.code("生产入库"));
|
||||||
inBussManageService.inTask(whereJson);
|
inBussManageService.inTask(whereJson);
|
||||||
} else if (type.equals(IOSEnum.ACSTOLMS_TYPE.code("空盘入库"))) {
|
} else if (type.equals(IOSEnum.ACSTOLMS_TYPE.code("空盘入库"))) {
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package org.nl.wms.ext.mes.rest;
|
package org.nl.wms.ext.mes.rest;
|
||||||
|
|
||||||
|
import cn.dev33.satoken.annotation.SaIgnore;
|
||||||
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;
|
||||||
@@ -120,18 +121,21 @@ public class LmsToMesController {
|
|||||||
|
|
||||||
@PostMapping("/momAutoTransterMoveIn")
|
@PostMapping("/momAutoTransterMoveIn")
|
||||||
@Log("表处、分切上料反馈接口")
|
@Log("表处、分切上料反馈接口")
|
||||||
|
@SaIgnore
|
||||||
public ResponseEntity<Object> momAutoTransterMoveIn(@RequestBody JSONObject jo) {
|
public ResponseEntity<Object> momAutoTransterMoveIn(@RequestBody JSONObject jo) {
|
||||||
return new ResponseEntity<>(lmsToMesService.momAutoTransterMoveIn(jo), HttpStatus.OK);
|
return new ResponseEntity<>(lmsToMesService.momAutoTransterMoveIn(jo), HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/momGetPackingInfo")
|
@PostMapping("/momGetPackingInfo")
|
||||||
@Log("LMS通过木箱号调用木箱信息")
|
@Log("LMS通过木箱号调用木箱信息")
|
||||||
|
@SaIgnore
|
||||||
public ResponseEntity<Object> momGetPackingInfo(@RequestBody JSONObject jo) {
|
public ResponseEntity<Object> momGetPackingInfo(@RequestBody JSONObject jo) {
|
||||||
return new ResponseEntity<>(lmsToMesService.momGetPackingInfo(jo), HttpStatus.OK);
|
return new ResponseEntity<>(lmsToMesService.momGetPackingInfo(jo), HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/momBoxPackageSubmit")
|
@PostMapping("/momBoxPackageSubmit")
|
||||||
@Log("LMS装箱完成传MES包装关系")
|
@Log("LMS装箱完成传MES包装关系")
|
||||||
|
@SaIgnore
|
||||||
public ResponseEntity<Object> momBoxPackageSubmit(@RequestBody JSONObject jo) {
|
public ResponseEntity<Object> momBoxPackageSubmit(@RequestBody JSONObject jo) {
|
||||||
return new ResponseEntity<>(lmsToMesService.momBoxPackageSubmit(jo), HttpStatus.OK);
|
return new ResponseEntity<>(lmsToMesService.momBoxPackageSubmit(jo), HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -724,7 +724,7 @@ public class LmsToMesServiceImpl implements LmsToMesService {
|
|||||||
log.info("momAutoTransterMoveIn接口输入参数为:-------------------" + param.toString());
|
log.info("momAutoTransterMoveIn接口输入参数为:-------------------" + param.toString());
|
||||||
|
|
||||||
String url = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("MES_URL").getValue();
|
String url = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("MES_URL").getValue();
|
||||||
String api = "CamstarApi/momAutoTransterMoveIn";
|
String api = "/momAutoTransterMoveIn";
|
||||||
url = url + api;
|
url = url + api;
|
||||||
|
|
||||||
String UserName = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("MES_USERNAME").getValue();
|
String UserName = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("MES_USERNAME").getValue();
|
||||||
@@ -768,7 +768,7 @@ public class LmsToMesServiceImpl implements LmsToMesService {
|
|||||||
log.info("momGetPackingInfo接口输入参数为:-------------------" + param.toString());
|
log.info("momGetPackingInfo接口输入参数为:-------------------" + param.toString());
|
||||||
|
|
||||||
String url = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("MES_URL").getValue();
|
String url = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("MES_URL").getValue();
|
||||||
String api = "CamstarApi/momGetPackingInfo";
|
String api = "momGetPackingInfo";
|
||||||
url = url + api;
|
url = url + api;
|
||||||
|
|
||||||
String UserName = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("MES_USERNAME").getValue();
|
String UserName = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("MES_USERNAME").getValue();
|
||||||
@@ -827,7 +827,7 @@ public class LmsToMesServiceImpl implements LmsToMesService {
|
|||||||
JSONObject result = new JSONObject();
|
JSONObject result = new JSONObject();
|
||||||
|
|
||||||
String url = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("MES_URL").getValue();
|
String url = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("MES_URL").getValue();
|
||||||
String api = "CamstarApi/momBoxPackageSubmit";
|
String api = "momBoxPackageSubmit";
|
||||||
url = url + api;
|
url = url + api;
|
||||||
|
|
||||||
String UserName = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("MES_USERNAME").getValue();
|
String UserName = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("MES_USERNAME").getValue();
|
||||||
@@ -837,7 +837,7 @@ public class LmsToMesServiceImpl implements LmsToMesService {
|
|||||||
param.put("PackageBoxSN", box_no);
|
param.put("PackageBoxSN", box_no);
|
||||||
param.put("QuanlityInBox", num);
|
param.put("QuanlityInBox", num);
|
||||||
param.put("BoxWeight", box_weight);
|
param.put("BoxWeight", box_weight);
|
||||||
param.put("ContainerList", box_weight);
|
param.put("ContainerList", rows);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
String resultMsg = HttpRequest.post(url)
|
String resultMsg = HttpRequest.post(url)
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import cn.hutool.core.util.IdUtil;
|
|||||||
import cn.hutool.core.util.NumberUtil;
|
import cn.hutool.core.util.NumberUtil;
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import cn.hutool.http.HttpStatus;
|
||||||
import com.alibaba.fastjson.JSONArray;
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
@@ -15,6 +16,10 @@ import lombok.extern.slf4j.Slf4j;
|
|||||||
import org.apache.commons.collections4.CollectionUtils;
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.checkerframework.checker.units.qual.C;
|
import org.checkerframework.checker.units.qual.C;
|
||||||
|
import org.nl.b_lms.bst.ivt.scale.bound.service.IBstIvtScaleboundService;
|
||||||
|
import org.nl.b_lms.bst.ivt.scale.bound.service.dao.BstIvtScalebound;
|
||||||
|
import org.nl.b_lms.bst.ivt.scale.history.service.IBstIvtScalehistoryService;
|
||||||
|
import org.nl.b_lms.bst.ivt.scale.history.service.dao.BstIvtScalehistory;
|
||||||
import org.nl.b_lms.pdm.bi.slittingproductionplan.service.IPdmBiSlittingproductionplanService;
|
import org.nl.b_lms.pdm.bi.slittingproductionplan.service.IPdmBiSlittingproductionplanService;
|
||||||
import org.nl.b_lms.pdm.bi.slittingproductionplan.service.dao.PdmBiSlittingproductionplan;
|
import org.nl.b_lms.pdm.bi.slittingproductionplan.service.dao.PdmBiSlittingproductionplan;
|
||||||
import org.nl.b_lms.pdm.subpackagerelation.dao.PdmBiSubpackagerelation;
|
import org.nl.b_lms.pdm.subpackagerelation.dao.PdmBiSubpackagerelation;
|
||||||
@@ -23,6 +28,7 @@ import org.nl.b_lms.sch.point.service.IbstIvtPackageinfoivtService;
|
|||||||
import org.nl.b_lms.sch.tasks.ProcessTask;
|
import org.nl.b_lms.sch.tasks.ProcessTask;
|
||||||
import org.nl.b_lms.sch.tasks.first_floor_area.DjqTask;
|
import org.nl.b_lms.sch.tasks.first_floor_area.DjqTask;
|
||||||
import org.nl.b_lms.sch.tasks.first_floor_area.GzqTask;
|
import org.nl.b_lms.sch.tasks.first_floor_area.GzqTask;
|
||||||
|
import org.nl.b_lms.sch.tasks.slitter.constant.SlitterConstant;
|
||||||
import org.nl.common.enums.PackageInfoIvtEnum;
|
import org.nl.common.enums.PackageInfoIvtEnum;
|
||||||
import org.nl.common.utils.SecurityUtils;
|
import org.nl.common.utils.SecurityUtils;
|
||||||
import org.nl.modules.common.exception.BadRequestException;
|
import org.nl.modules.common.exception.BadRequestException;
|
||||||
@@ -31,6 +37,7 @@ import org.nl.modules.wql.WQL;
|
|||||||
import org.nl.modules.wql.core.bean.WQLObject;
|
import org.nl.modules.wql.core.bean.WQLObject;
|
||||||
import org.nl.modules.wql.util.SpringContextHolder;
|
import org.nl.modules.wql.util.SpringContextHolder;
|
||||||
import org.nl.system.service.param.impl.SysParamServiceImpl;
|
import org.nl.system.service.param.impl.SysParamServiceImpl;
|
||||||
|
import org.nl.wms.ext.acs.service.WmsToAcsService;
|
||||||
import org.nl.wms.ext.mes.service.MesToLmsService;
|
import org.nl.wms.ext.mes.service.MesToLmsService;
|
||||||
import org.nl.wms.pda.mps.service.InService;
|
import org.nl.wms.pda.mps.service.InService;
|
||||||
import org.nl.wms.pda.mps.service.OutService;
|
import org.nl.wms.pda.mps.service.OutService;
|
||||||
@@ -64,11 +71,20 @@ public class MesToLmsServiceImpl implements MesToLmsService {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private IPdmBiSlittingproductionplanService slittingproductionplanService;
|
private IPdmBiSlittingproductionplanService slittingproductionplanService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private WmsToAcsService wmsToAcsService;
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private DjqTask djqTask;
|
private DjqTask djqTask;
|
||||||
@Resource
|
@Resource
|
||||||
private GzqTask gzqTask;
|
private GzqTask gzqTask;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IBstIvtScalehistoryService scaleHistoryService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IBstIvtScaleboundService scaleBoundService;
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private IbstIvtPackageinfoivtService packageinfoivtService;
|
private IbstIvtPackageinfoivtService packageinfoivtService;
|
||||||
|
|
||||||
@@ -102,6 +118,7 @@ public class MesToLmsServiceImpl implements MesToLmsService {
|
|||||||
String EqpVelocity = param.getString("EqpVelocity");
|
String EqpVelocity = param.getString("EqpVelocity");
|
||||||
String UpCoilerDate = param.getString("UpCoilerDate");
|
String UpCoilerDate = param.getString("UpCoilerDate");
|
||||||
String IsReloadSend = param.getString("IsReloadSend");
|
String IsReloadSend = param.getString("IsReloadSend");
|
||||||
|
String Attribute1 = param.getString("Attribute1");
|
||||||
|
|
||||||
WQLObject pointTab = WQLObject.getWQLObject("ST_IVT_SbPointIvt");
|
WQLObject pointTab = WQLObject.getWQLObject("ST_IVT_SbPointIvt");
|
||||||
WQLObject orderTab = WQLObject.getWQLObject("PDM_BI_RawFoilWorkOrder");
|
WQLObject orderTab = WQLObject.getWQLObject("PDM_BI_RawFoilWorkOrder");
|
||||||
@@ -153,6 +170,11 @@ public class MesToLmsServiceImpl implements MesToLmsService {
|
|||||||
json.put("is_reload_send", IsReloadSend);
|
json.put("is_reload_send", IsReloadSend);
|
||||||
json.put("product_area", jsonPoint.getString("product_area"));
|
json.put("product_area", jsonPoint.getString("product_area"));
|
||||||
json.put("point_code", jsonPoint.getString("point_code"));
|
json.put("point_code", jsonPoint.getString("point_code"));
|
||||||
|
if (Attribute1.equals("SF1")) {
|
||||||
|
json.put("order_type", "1");
|
||||||
|
} else if (Attribute1.equals("SF2")) {
|
||||||
|
json.put("order_type", "2");
|
||||||
|
}
|
||||||
json.put("realstart_time", DateUtil.now());
|
json.put("realstart_time", DateUtil.now());
|
||||||
json.put("status", "01");
|
json.put("status", "01");
|
||||||
json.put("is_delete", "0");
|
json.put("is_delete", "0");
|
||||||
@@ -1776,11 +1798,13 @@ public class MesToLmsServiceImpl implements MesToLmsService {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public JSONObject getRollInfo(JSONObject param) {
|
public JSONObject getRollInfo(JSONObject param) {
|
||||||
|
JSONObject result = new JSONObject();
|
||||||
String ContainerName = param.getString("ContainerName");
|
String ContainerName = param.getString("ContainerName");
|
||||||
PdmBiSlittingproductionplan one = slittingproductionplanService.getOne(new LambdaQueryWrapper<PdmBiSlittingproductionplan>().eq(PdmBiSlittingproductionplan::getContainer_name, ContainerName));
|
PdmBiSlittingproductionplan one = slittingproductionplanService.getOne(new LambdaQueryWrapper<PdmBiSlittingproductionplan>().eq(PdmBiSlittingproductionplan::getContainer_name, ContainerName));
|
||||||
if (ObjectUtil.isEmpty(one)) {
|
if (ObjectUtil.isEmpty(one)) {
|
||||||
throw new BadRequestException("未查询到子卷号为[" + ContainerName + "]的分切计划!");
|
throw new BadRequestException("未查询到子卷号为[" + ContainerName + "]的分切计划!");
|
||||||
}
|
}
|
||||||
|
JSONArray arr = new JSONArray();
|
||||||
JSONObject resultParam = new JSONObject();
|
JSONObject resultParam = new JSONObject();
|
||||||
resultParam.put("ContainerName", ContainerName);
|
resultParam.put("ContainerName", ContainerName);
|
||||||
resultParam.put("ResourceName", "");
|
resultParam.put("ResourceName", "");
|
||||||
@@ -1788,7 +1812,13 @@ public class MesToLmsServiceImpl implements MesToLmsService {
|
|||||||
resultParam.put("WeighDate", DateUtil.now());
|
resultParam.put("WeighDate", DateUtil.now());
|
||||||
resultParam.put("Type", one.getPaper_tube_or_FRP());
|
resultParam.put("Type", one.getPaper_tube_or_FRP());
|
||||||
resultParam.put("CarrierWeight", one.getPaper_weight());
|
resultParam.put("CarrierWeight", one.getPaper_weight());
|
||||||
return resultParam;
|
arr.add(resultParam);
|
||||||
|
result.put("RTYPE", "S");
|
||||||
|
result.put("RTMSG", "操作成功!");
|
||||||
|
result.put("RTOAL", 1);
|
||||||
|
result.put("RTDAT", arr);
|
||||||
|
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -1947,18 +1977,78 @@ public class MesToLmsServiceImpl implements MesToLmsService {
|
|||||||
public JSONObject getWasteFoilWeight(JSONObject param) {
|
public JSONObject getWasteFoilWeight(JSONObject param) {
|
||||||
log.info("getWasteFoilWeight输入参数为:-------------------" + param.toString());
|
log.info("getWasteFoilWeight输入参数为:-------------------" + param.toString());
|
||||||
|
|
||||||
JSONObject resultParam = new JSONObject();
|
{
|
||||||
resultParam.put("RTYPE", "S");
|
log.info("分切子卷获取LMS,AGV废箔称重重量的输入参数为:{}", param);
|
||||||
resultParam.put("Code", "0");
|
JSONObject res = new JSONObject();
|
||||||
resultParam.put("RTMSG", "操作成功!");
|
JSONObject resData = new JSONObject();
|
||||||
|
String resourceName = param.getString("ResourceName");
|
||||||
return resultParam;
|
// 获取称的设备号
|
||||||
|
BstIvtScalebound scaleEquipment = scaleBoundService.getOne(new LambdaQueryWrapper<BstIvtScalebound>()
|
||||||
|
.eq(BstIvtScalebound::getDevice_code, resourceName));
|
||||||
|
// 下发给acs称重
|
||||||
|
JSONObject acsWeighing = new JSONObject();
|
||||||
|
acsWeighing.put("device_code", scaleEquipment.getScale_code());
|
||||||
|
acsWeighing.put("type", "1");
|
||||||
|
acsWeighing.put("product_area", SlitterConstant.SLITTER_TASK_AREA);
|
||||||
|
JSONObject action = wmsToAcsService.getWeight(acsWeighing);
|
||||||
|
if (HttpStatus.HTTP_OK == action.getInteger("status")) {
|
||||||
|
JSONObject data = action.getJSONObject("data");
|
||||||
|
String currentWeight = data.getString("currentWeight");
|
||||||
|
String lastWeight = data.getString("lastWeight");
|
||||||
|
String weightGap = data.getString("weightGap");
|
||||||
|
String now = DateUtil.now();
|
||||||
|
// 记录数据库
|
||||||
|
BstIvtScalehistory history = new BstIvtScalehistory();
|
||||||
|
history.setHistory_id(IdUtil.getSnowflake(1, 1).nextIdStr());
|
||||||
|
history.setScale_code(scaleEquipment.getScale_code());
|
||||||
|
history.setDevice_code(scaleEquipment.getDevice_code());
|
||||||
|
history.setCurrent_weight(currentWeight);
|
||||||
|
history.setLast_weight(lastWeight);
|
||||||
|
history.setWeight_gap(weightGap);
|
||||||
|
history.setRecord_time(now);
|
||||||
|
scaleHistoryService.save(history);
|
||||||
|
log.info("废箔称重记录:{}", history);
|
||||||
|
res.put("RTOAL", 1);
|
||||||
|
res.put("RTMSG", "操作成功!");
|
||||||
|
res.put("RTYPE", "S");
|
||||||
|
res.put("RTDAT", resData);
|
||||||
|
resData.put("ResourceName", resourceName);
|
||||||
|
resData.put("Weight", weightGap);
|
||||||
|
resData.put("WeighDate", now);
|
||||||
|
log.info("废箔称重反馈MES, 反馈信息:{}", res);
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
res.put("RTOAL", 0);
|
||||||
|
res.put("RTMSG", "称重失败!");
|
||||||
|
res.put("RTYPE", "F");
|
||||||
|
log.error("废箔称重反馈MES, 反馈信息:{}", res);
|
||||||
|
return res;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public JSONObject WasteFoilSuccess(JSONObject param) {
|
public JSONObject WasteFoilSuccess(JSONObject param) {
|
||||||
log.info("WasteFoilSuccess输入参数为:-------------------" + param.toString());
|
log.info("WasteFoilSuccess输入参数为:-------------------" + param.toString());
|
||||||
|
|
||||||
|
log.info("分切子卷获取LMS,AGV废箔称重重量MES提交废箔成功的输入参数为:{}", param);
|
||||||
|
JSONObject res = new JSONObject();
|
||||||
|
String resourceName = param.getString("ResourceName");
|
||||||
|
// 获取称的设备号
|
||||||
|
BstIvtScalebound scaleEquipment = scaleBoundService.getOne(new LambdaQueryWrapper<BstIvtScalebound>()
|
||||||
|
.eq(BstIvtScalebound::getDevice_code, resourceName));
|
||||||
|
// 下发给acs称重
|
||||||
|
JSONObject acsWeighing = new JSONObject();
|
||||||
|
acsWeighing.put("device_code", scaleEquipment.getScale_code());
|
||||||
|
acsWeighing.put("type", "2");
|
||||||
|
acsWeighing.put("product_area", SlitterConstant.SLITTER_TASK_AREA);
|
||||||
|
JSONObject action = wmsToAcsService.getWeight(acsWeighing);
|
||||||
|
if (HttpStatus.HTTP_OK == action.getInteger("status")) {
|
||||||
|
// 记录数据库
|
||||||
|
res.put("RTOAL", 1);
|
||||||
|
res.put("RTMSG", "操作成功!");
|
||||||
|
res.put("RTYPE", "S");
|
||||||
|
return res;
|
||||||
|
}
|
||||||
JSONObject resultParam = new JSONObject();
|
JSONObject resultParam = new JSONObject();
|
||||||
resultParam.put("RTYPE", "S");
|
resultParam.put("RTYPE", "S");
|
||||||
resultParam.put("Code", "0");
|
resultParam.put("Code", "0");
|
||||||
|
|||||||
Reference in New Issue
Block a user