Merge branch 'b_lms' into master_merge
# Conflicts: # lms/nladmin-system/src/main/java/org/nl/wms/ext/mes/service/impl/LmsToMesServiceImpl.java
This commit is contained in:
@@ -117,19 +117,19 @@ public class PdmBiSubpackagerelation extends Model<PdmBiSubpackagerelation> {
|
|||||||
/**
|
/**
|
||||||
* 单位面积质量
|
* 单位面积质量
|
||||||
*/
|
*/
|
||||||
private BigDecimal mass_per_unit_area;
|
private String mass_per_unit_area;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 净重
|
* 净重
|
||||||
*/
|
*/
|
||||||
private BigDecimal net_weight;
|
private String net_weight;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 长度
|
* 长度
|
||||||
*/
|
*/
|
||||||
private BigDecimal length;
|
private String length;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import com.alibaba.fastjson.JSONObject;
|
|||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.nl.b_lms.storage_manage.ios.enums.IOSEnum;
|
import org.nl.b_lms.storage_manage.ios.enums.IOSEnum;
|
||||||
|
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;
|
||||||
import org.nl.modules.wql.WQL;
|
import org.nl.modules.wql.WQL;
|
||||||
@@ -44,6 +45,8 @@ public class TwoSendOutTask extends AbstractAcsTask {
|
|||||||
JSONArray arr = WQLObject.getWQLObject("SCH_BASE_Task").query("handle_class = '" + THIS_CLASS + "' and task_status = '" + TaskStatusEnum.START_AND_POINT.getCode() + "' and is_delete ='0'").getResultJSONArray(0);
|
JSONArray arr = WQLObject.getWQLObject("SCH_BASE_Task").query("handle_class = '" + THIS_CLASS + "' and task_status = '" + TaskStatusEnum.START_AND_POINT.getCode() + "' and is_delete ='0'").getResultJSONArray(0);
|
||||||
// 获取系统参数
|
// 获取系统参数
|
||||||
String expandWidthLength = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("expandWidthLength").getValue();
|
String expandWidthLength = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("expandWidthLength").getValue();
|
||||||
|
JSONObject param = new JSONObject();
|
||||||
|
param.put("expandWidthLength",expandWidthLength);
|
||||||
|
|
||||||
ArrayList<AcsTaskDto> resultList = new ArrayList<>();
|
ArrayList<AcsTaskDto> resultList = new ArrayList<>();
|
||||||
for (int i = 0; i < arr.size(); i++) {
|
for (int i = 0; i < arr.size(); i++) {
|
||||||
@@ -59,10 +62,12 @@ public class TwoSendOutTask extends AbstractAcsTask {
|
|||||||
.vehicle_code(json.getString("vehicle_code"))
|
.vehicle_code(json.getString("vehicle_code"))
|
||||||
.priority(json.getString("priority"))
|
.priority(json.getString("priority"))
|
||||||
.class_type(json.getString("task_type"))
|
.class_type(json.getString("task_type"))
|
||||||
|
.agv_system_type("3")
|
||||||
|
.agv_action_type(PackageInfoIvtEnum.AGV_ACTION_TYPE.code("放货二次分配"))
|
||||||
.dtl_type(String.valueOf(dtl_type))
|
.dtl_type(String.valueOf(dtl_type))
|
||||||
.route_plan_code(getRoutePlanCode(json.getString("point_code1")))
|
.route_plan_code(getRoutePlanCode(json.getString("point_code1")))
|
||||||
.remark(json.getString("remark"))
|
.remark(json.getString("remark"))
|
||||||
.expandWidthLength(expandWidthLength)
|
.interaction_json(param)
|
||||||
.build();
|
.build();
|
||||||
resultList.add(dto);
|
resultList.add(dto);
|
||||||
|
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ import org.nl.b_lms.sch.task.service.IschBaseTaskService;
|
|||||||
import org.nl.b_lms.storage_manage.ios.enums.IOSEnum;
|
import org.nl.b_lms.storage_manage.ios.enums.IOSEnum;
|
||||||
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.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.wms.sch.AcsTaskDto;
|
import org.nl.wms.sch.AcsTaskDto;
|
||||||
@@ -76,6 +77,9 @@ public class SlitterDownAgvTask extends AbstractAcsTask {
|
|||||||
task.setTask_status(TaskStatusEnum.EXECUTING.getCode());
|
task.setTask_status(TaskStatusEnum.EXECUTING.getCode());
|
||||||
}
|
}
|
||||||
if (StrUtil.equals(status, TaskStatusEnum.FINISHED.getCode())) {
|
if (StrUtil.equals(status, TaskStatusEnum.FINISHED.getCode())) {
|
||||||
|
if (TaskStatusEnum.FINISHED.getCode().equals(task.getTask_status())) {
|
||||||
|
throw new BadRequestException("任务[" + task.getTask_code() + "]已经完成!");
|
||||||
|
}
|
||||||
task.setTask_status(TaskStatusEnum.FINISHED.getCode());
|
task.setTask_status(TaskStatusEnum.FINISHED.getCode());
|
||||||
// 互换资源
|
// 互换资源
|
||||||
String startPoint = task.getPoint_code1();
|
String startPoint = task.getPoint_code1();
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ import org.nl.b_lms.sch.tasks.slitter.SendAirShaftAgvTask;
|
|||||||
import org.nl.b_lms.sch.tasks.slitter.constant.SlitterConstant;
|
import org.nl.b_lms.sch.tasks.slitter.constant.SlitterConstant;
|
||||||
import org.nl.b_lms.sch.tasks.slitter.constant.SlitterEnum;
|
import org.nl.b_lms.sch.tasks.slitter.constant.SlitterEnum;
|
||||||
import org.nl.b_lms.sch.tasks.slitter.mapper.SlitterMapper;
|
import org.nl.b_lms.sch.tasks.slitter.mapper.SlitterMapper;
|
||||||
|
import org.nl.b_lms.sch.tasks.slitter.util.SlitterTaskUtil;
|
||||||
import org.nl.modules.common.exception.BadRequestException;
|
import org.nl.modules.common.exception.BadRequestException;
|
||||||
import org.redisson.api.RLock;
|
import org.redisson.api.RLock;
|
||||||
import org.redisson.api.RedissonClient;
|
import org.redisson.api.RedissonClient;
|
||||||
@@ -84,7 +85,10 @@ public class AutoSendAirShaftAgvTask {
|
|||||||
}
|
}
|
||||||
// 如果两个气涨轴编码则表示一组满了
|
// 如果两个气涨轴编码则表示一组满了
|
||||||
// 查找分切对接没任务的空位
|
// 查找分切对接没任务的空位
|
||||||
List<BstIvtCutpointivt> emptyPoint = slitterMapper.getEmptyCutPointNotTask(area, deviceCut.getSort_seq());
|
List<BstIvtCutpointivt> emptyPoint = slitterMapper.getEmptyCutPointNotTask(area,
|
||||||
|
deviceCut.getSort_seq(),
|
||||||
|
SlitterTaskUtil.getPointLocationInCutDevice(
|
||||||
|
SlitterTaskUtil.getNumberByResourceCode(demoPlan.getResource_name())));
|
||||||
if (emptyPoint.size() == 0) {
|
if (emptyPoint.size() == 0) {
|
||||||
log.warn("找不到对应的位置!");
|
log.warn("找不到对应的位置!");
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -97,9 +97,9 @@ public class AutoUpShaftTrussTask {
|
|||||||
|
|
||||||
if (ObjectUtil.isNotEmpty(nextUpPlan) && ObjectUtil.isNotEmpty(nextDownPlan)) {
|
if (ObjectUtil.isNotEmpty(nextUpPlan) && ObjectUtil.isNotEmpty(nextDownPlan)) {
|
||||||
// 双轴任务参数构建
|
// 双轴任务参数构建
|
||||||
param.put("point_code1", newCutPoint.getTruss_point_code2());
|
param.put("point_code1", newCutPoint.getTruss_point_code1());
|
||||||
param.put("point_code2", device.getUp_point_code());
|
param.put("point_code2", device.getUp_point_code());
|
||||||
param.put("point_code3", newCutPoint.getTruss_point_code1());
|
param.put("point_code3", newCutPoint.getTruss_point_code2());
|
||||||
param.put("point_code4", device.getDown_point_code());
|
param.put("point_code4", device.getDown_point_code());
|
||||||
param.put("vehicle_code1", newCutPoint.getQzz_no1());
|
param.put("vehicle_code1", newCutPoint.getQzz_no1());
|
||||||
param.put("vehicle_code2", newCutPoint.getQzz_no2());
|
param.put("vehicle_code2", newCutPoint.getQzz_no2());
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ public enum SlitterEnum {
|
|||||||
*/
|
*/
|
||||||
TASK_TYPE(MapOf.of("穿拔轴缓存<>穿拔轴位", "010801", "穿拔轴缓存<>分切对接位", "010802", "穿拔轴位<>气胀轴缓存位", "010803"
|
TASK_TYPE(MapOf.of("穿拔轴缓存<>穿拔轴位", "010801", "穿拔轴缓存<>分切对接位", "010802", "穿拔轴位<>气胀轴缓存位", "010803"
|
||||||
, "分切机下料AGV任务", "010804", "分切机上气胀轴", "010805", "分切机下气胀轴", "010806", "备货区送载具", "010807"
|
, "分切机下料AGV任务", "010804", "分切机上气胀轴", "010805", "分切机下气胀轴", "010806", "备货区送载具", "010807"
|
||||||
, "备货区送纸管", "010808"));
|
, "备货区送纸管", "010808", "分切机下料桁架任务", "010809"));
|
||||||
private Map<String, String> code;
|
private Map<String, String> code;
|
||||||
|
|
||||||
public String code(String desc) {
|
public String code(String desc) {
|
||||||
|
|||||||
@@ -37,9 +37,10 @@ public interface SlitterMapper {
|
|||||||
* 获取分切机下料位没任务的点位
|
* 获取分切机下料位没任务的点位
|
||||||
* @param area 区域
|
* @param area 区域
|
||||||
* @param sortSeq 设备序号
|
* @param sortSeq 设备序号
|
||||||
* @return
|
* @param location 区域 1-5:0 6-10:1
|
||||||
|
* @return /
|
||||||
*/
|
*/
|
||||||
List<BstIvtCutpointivt> getEmptyCutPointNotTask(String area, BigDecimal sortSeq);
|
List<BstIvtCutpointivt> getEmptyCutPointNotTask(String area, BigDecimal sortSeq, String location);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取分切机下一组分切计划对应的点位
|
* 获取分切机下一组分切计划对应的点位
|
||||||
|
|||||||
@@ -27,6 +27,7 @@
|
|||||||
FROM `bst_ivt_cutpointivt` bct
|
FROM `bst_ivt_cutpointivt` bct
|
||||||
WHERE bct.point_type IN ('2', '3')
|
WHERE bct.point_type IN ('2', '3')
|
||||||
AND bct.point_status = '3'
|
AND bct.point_status = '3'
|
||||||
|
AND bct.is_used = '1'
|
||||||
AND 0 = (SELECT COUNT(*)
|
AND 0 = (SELECT COUNT(*)
|
||||||
FROM sch_base_task t
|
FROM sch_base_task t
|
||||||
WHERE t.task_status <![CDATA[ < ]]> '07'
|
WHERE t.task_status <![CDATA[ < ]]> '07'
|
||||||
@@ -49,6 +50,7 @@
|
|||||||
`bst_ivt_cutpointivt` bcp
|
`bst_ivt_cutpointivt` bcp
|
||||||
WHERE bcp.point_type = '3' AND bcp.point_status = '1' AND bcp.is_used = '1'
|
WHERE bcp.point_type = '3' AND bcp.point_status = '1' AND bcp.is_used = '1'
|
||||||
AND bcp.product_area = #{area}
|
AND bcp.product_area = #{area}
|
||||||
|
AND bcp.point_location = #{location}
|
||||||
AND 0 = (
|
AND 0 = (
|
||||||
SELECT COUNT(*) FROM sch_base_task t
|
SELECT COUNT(*) FROM sch_base_task t
|
||||||
WHERE t.task_status <![CDATA[ < ]]> '07' AND (t.point_code2 = bcp.point_code OR t.point_code2 = bcp.truss_point_code1
|
WHERE t.task_status <![CDATA[ < ]]> '07' AND (t.point_code2 = bcp.point_code OR t.point_code2 = bcp.truss_point_code1
|
||||||
|
|||||||
@@ -46,16 +46,15 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
import java.time.LocalDateTime;
|
|
||||||
import java.time.format.DateTimeFormatter;
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Objects;
|
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
import java.util.stream.Stream;
|
import java.util.stream.Stream;
|
||||||
|
|
||||||
|
import static org.nl.b_lms.sch.tasks.slitter.util.SlitterTaskUtil.getPointLocationInCutDevice;
|
||||||
|
import static org.nl.b_lms.sch.tasks.slitter.util.SlitterTaskUtil.getNumberByResourceCode;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author lyd
|
* @author lyd
|
||||||
* @description 服务接口
|
* @description 服务接口
|
||||||
@@ -117,9 +116,17 @@ public class SlitterServiceImpl implements SlitterService {
|
|||||||
throw new BadRequestException("设备:{ " + deviceCode + " }对应的气胀轴尺寸不批对" +
|
throw new BadRequestException("设备:{ " + deviceCode + " }对应的气胀轴尺寸不批对" +
|
||||||
",需要气胀轴尺寸:{ " + point.getQzz_size() + " },实际尺寸:{ " + size + " }");
|
",需要气胀轴尺寸:{ " + point.getQzz_size() + " },实际尺寸:{ " + size + " }");
|
||||||
}
|
}
|
||||||
|
List<String> tubes = Stream.of(point.getTube_code1(), point.getTube_code2())
|
||||||
|
.filter(ObjectUtil::isNotEmpty)
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
// 判断是否存在纸管
|
||||||
|
List<MdPbPapervehicle> list = papervehicleService.list(new LambdaQueryWrapper<MdPbPapervehicle>()
|
||||||
|
.in(MdPbPapervehicle::getMaterial_code, tubes)
|
||||||
|
.gt(MdPbPapervehicle::getQty, 0));
|
||||||
// point.getTube_code1() 编码 , getTube_name1() : 纸制筒管|纸管|6英寸|1300 or 纸制筒管|纸管|3英寸|12|650
|
// point.getTube_code1() 编码 , getTube_name1() : 纸制筒管|纸管|6英寸|1300 or 纸制筒管|纸管|3英寸|12|650
|
||||||
res.put("device_code", deviceCode);
|
res.put("device_code", deviceCode);
|
||||||
res.put("data", con);
|
res.put("data", con);
|
||||||
|
con.put("is_bushing", list.size() > 0 ? SlitterConstant.SLITTER_YES : SlitterConstant.SLITTER_NO);
|
||||||
con.put("left", point.getTube_code1());
|
con.put("left", point.getTube_code1());
|
||||||
con.put("leftSize", ObjectUtil.isNotEmpty(point.getTube_name1())
|
con.put("leftSize", ObjectUtil.isNotEmpty(point.getTube_name1())
|
||||||
? point.getTube_name1().split("\\|")[2].charAt(0) : "");
|
? point.getTube_name1().split("\\|")[2].charAt(0) : "");
|
||||||
@@ -385,7 +392,9 @@ public class SlitterServiceImpl implements SlitterService {
|
|||||||
if (timePlans.size() == 0) {
|
if (timePlans.size() == 0) {
|
||||||
// 如果没有下一组的分切计划,就只做下卷任务(判断下单/下双)
|
// 如果没有下一组的分切计划,就只做下卷任务(判断下单/下双)
|
||||||
// 获取分切对接位没任务的空位置
|
// 获取分切对接位没任务的空位置
|
||||||
List<BstIvtCutpointivt> emptyPoints = slitterMapper.getEmptyCutPointNotTask(area, device.getSort_seq());
|
List<BstIvtCutpointivt> emptyPoints = slitterMapper.getEmptyCutPointNotTask(area,
|
||||||
|
device.getSort_seq(),
|
||||||
|
getPointLocationInCutDevice(getNumberByResourceCode(demoPlan.getResource_name())));
|
||||||
if (emptyPoints.size() == 0) {
|
if (emptyPoints.size() == 0) {
|
||||||
log.error("分切机【" + device.getExt_code() + "】找不到对应的对接位!");
|
log.error("分切机【" + device.getExt_code() + "】找不到对应的对接位!");
|
||||||
throw new BadRequestException("分切机【" + device.getExt_code() + "】找不到对应的对接位!");
|
throw new BadRequestException("分切机【" + device.getExt_code() + "】找不到对应的对接位!");
|
||||||
@@ -414,6 +423,7 @@ public class SlitterServiceImpl implements SlitterService {
|
|||||||
taskParam.put("truss_type", "1");
|
taskParam.put("truss_type", "1");
|
||||||
taskParam.put("empty_site", "0");
|
taskParam.put("empty_site", "0");
|
||||||
}
|
}
|
||||||
|
taskParam.put("task_type", SlitterEnum.TASK_TYPE.code("分切机下料桁架任务"));
|
||||||
taskParam.put("product_area", SlitterConstant.SLITTER_TASK_AREA);
|
taskParam.put("product_area", SlitterConstant.SLITTER_TASK_AREA);
|
||||||
// 分切计划修改状态 05 -> 06
|
// 分切计划修改状态 05 -> 06
|
||||||
currentPlans.forEach(plan -> {
|
currentPlans.forEach(plan -> {
|
||||||
@@ -505,6 +515,7 @@ public class SlitterServiceImpl implements SlitterService {
|
|||||||
throw new BadRequestException("错误表达式");
|
throw new BadRequestException("错误表达式");
|
||||||
}
|
}
|
||||||
// 创建任务
|
// 创建任务
|
||||||
|
taskParam.put("task_type", SlitterEnum.TASK_TYPE.code("分切机下料桁架任务"));
|
||||||
taskParam.put("product_area", SlitterConstant.SLITTER_TASK_AREA);
|
taskParam.put("product_area", SlitterConstant.SLITTER_TASK_AREA);
|
||||||
slitterDownTrussTask.createTask(taskParam);
|
slitterDownTrussTask.createTask(taskParam);
|
||||||
// 下来的分切计划修改状态:05 -> 06
|
// 下来的分切计划修改状态:05 -> 06
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import cn.hutool.core.util.ObjectUtil;
|
|||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
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.sch.tasks.slitter.constant.SlitterConstant;
|
import org.nl.b_lms.sch.tasks.slitter.constant.SlitterConstant;
|
||||||
|
import org.nl.modules.common.exception.BadRequestException;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.StringJoiner;
|
import java.util.StringJoiner;
|
||||||
@@ -150,4 +151,31 @@ public class SlitterTaskUtil {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取设备号
|
||||||
|
* @param resourceCode /
|
||||||
|
* @return /
|
||||||
|
*/
|
||||||
|
public static int getNumberByResourceCode(String resourceCode) {
|
||||||
|
if (ObjectUtil.isEmpty(resourceCode)) {
|
||||||
|
throw new BadRequestException("输入的设备号编码不能为空!");
|
||||||
|
}
|
||||||
|
String trimStr = resourceCode.trim();
|
||||||
|
// 提取最后两位作为字符串
|
||||||
|
String lastTwoDigitsString = trimStr.substring(trimStr.length() - 2);
|
||||||
|
// 将整数再转换回字符串以供返回
|
||||||
|
return Integer.parseInt(lastTwoDigitsString);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取上下区域
|
||||||
|
* @param num /
|
||||||
|
* @return /
|
||||||
|
*/
|
||||||
|
public static String getPointLocationInCutDevice(int num) {
|
||||||
|
if (num >= 1 && num <= 5) {
|
||||||
|
return "0";
|
||||||
|
}
|
||||||
|
return "1";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,6 +9,8 @@ import org.nl.b_lms.storage_manage.database.service.IBstIvtBoxinfoService;
|
|||||||
import org.nl.b_lms.storage_manage.database.service.dao.BstIvtBoxinfo;
|
import org.nl.b_lms.storage_manage.database.service.dao.BstIvtBoxinfo;
|
||||||
import org.nl.b_lms.storage_manage.database.service.dao.mapper.BstIvtBoxinfoMapper;
|
import org.nl.b_lms.storage_manage.database.service.dao.mapper.BstIvtBoxinfoMapper;
|
||||||
import org.nl.common.utils.IdUtil;
|
import org.nl.common.utils.IdUtil;
|
||||||
|
import org.nl.system.service.param.ISysParamService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.data.domain.Pageable;
|
import org.springframework.data.domain.Pageable;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
@@ -28,6 +30,9 @@ public class BstIvtBoxinfoServiceImpl extends ServiceImpl<BstIvtBoxinfoMapper, B
|
|||||||
@Resource
|
@Resource
|
||||||
private BstIvtBoxinfoMapper bstIvtBoxinfoMapper;
|
private BstIvtBoxinfoMapper bstIvtBoxinfoMapper;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ISysParamService iSysParamService;
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Map<String, Object> queryAll(Map whereJson, Pageable page) {
|
public Map<String, Object> queryAll(Map whereJson, Pageable page) {
|
||||||
@@ -46,6 +51,15 @@ public class BstIvtBoxinfoServiceImpl extends ServiceImpl<BstIvtBoxinfoMapper, B
|
|||||||
@Override
|
@Override
|
||||||
public BstIvtBoxinfo mesInsert(JSONObject whereJson) {
|
public BstIvtBoxinfo mesInsert(JSONObject whereJson) {
|
||||||
|
|
||||||
|
int length = whereJson.getInteger("length");
|
||||||
|
String boxLength = iSysParamService.findByCode("box_length").getValue();
|
||||||
|
String vehicle_type = "";
|
||||||
|
if (length <= Integer.parseInt(boxLength)) {
|
||||||
|
vehicle_type = "1";
|
||||||
|
}else {
|
||||||
|
vehicle_type = "2";
|
||||||
|
}
|
||||||
|
|
||||||
BstIvtBoxinfo boxDao = BstIvtBoxinfo.builder()
|
BstIvtBoxinfo boxDao = BstIvtBoxinfo.builder()
|
||||||
.box_id(IdUtil.getStringId())
|
.box_id(IdUtil.getStringId())
|
||||||
.box_high(whereJson.getString("Height"))
|
.box_high(whereJson.getString("Height"))
|
||||||
@@ -54,6 +68,7 @@ public class BstIvtBoxinfoServiceImpl extends ServiceImpl<BstIvtBoxinfoMapper, B
|
|||||||
.material_code(whereJson.getString("ProductName"))
|
.material_code(whereJson.getString("ProductName"))
|
||||||
.material_name(whereJson.getString("Description"))
|
.material_name(whereJson.getString("Description"))
|
||||||
.box_no(whereJson.getString("ContainerName"))
|
.box_no(whereJson.getString("ContainerName"))
|
||||||
|
.vehicle_type(vehicle_type)
|
||||||
.insert_time(DateUtil.now())
|
.insert_time(DateUtil.now())
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
|
|||||||
@@ -104,8 +104,8 @@ public enum IOSEnum {
|
|||||||
"6","CK2046", "7","7", "8","8", "9","9", "10","10")),
|
"6","CK2046", "7","7", "8","8", "9","9", "10","10")),
|
||||||
|
|
||||||
// 出库发货等待点
|
// 出库发货等待点
|
||||||
OUT_FH_POINT(MapOf.of("1","B_FH_01_0", "2","B_FH_02_0", "3","B_FH_03_0", "4","B_FH_04_0" ,"5","B_FH_05_0",
|
OUT_FH_POINT(MapOf.of("1","B_FH01_0", "2","B_FH02_0", "3","B_FH03_0", "4","B_FH04_0" ,"5","B_FH05_0",
|
||||||
"6","B_FH_06_0")),
|
"6","B_FH06_0")),
|
||||||
|
|
||||||
// 行架点位
|
// 行架点位
|
||||||
OUT_HANGER(MapOf.of("行架位1", "CK2013","行架位2", "CK2017")),
|
OUT_HANGER(MapOf.of("行架位1", "CK2013","行架位2", "CK2017")),
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ import org.nl.modules.wql.util.SpringContextHolder;
|
|||||||
import org.nl.system.service.param.ISysParamService;
|
import org.nl.system.service.param.ISysParamService;
|
||||||
import org.nl.wms.ext.acs.service.AcsToWmsService;
|
import org.nl.wms.ext.acs.service.AcsToWmsService;
|
||||||
import org.nl.wms.ext.acs.service.WmsToAcsService;
|
import org.nl.wms.ext.acs.service.WmsToAcsService;
|
||||||
|
import org.nl.wms.ext.mes.service.LmsToMesService;
|
||||||
import org.nl.wms.pda.mps.eum.RegionTypeEnum;
|
import org.nl.wms.pda.mps.eum.RegionTypeEnum;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
@@ -72,6 +73,9 @@ public class InBoxManageServiceImpl implements InBoxManageService {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private ISysParamService iSysParamService;
|
private ISysParamService iSysParamService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private LmsToMesService lmsToMesService;
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
@@ -216,7 +220,7 @@ public class InBoxManageServiceImpl implements InBoxManageService {
|
|||||||
JSONObject data = device_data.getJSONArray("data").getJSONObject(0);
|
JSONObject data = device_data.getJSONArray("data").getJSONObject(0);
|
||||||
AcsToWmsService acsToWmsService = SpringContextHolder.getBean(AcsToWmsService.class);
|
AcsToWmsService acsToWmsService = SpringContextHolder.getBean(AcsToWmsService.class);
|
||||||
//如果此时拆叠盘位为空
|
//如果此时拆叠盘位为空
|
||||||
if (data.getIntValue("qty") == 0) {
|
if (data.getIntValue("qty") == 0 && data.getIntValue("move") == 0) {
|
||||||
//生成空托盘出库任务
|
//生成空托盘出库任务
|
||||||
JSONObject apply_jo = new JSONObject();
|
JSONObject apply_jo = new JSONObject();
|
||||||
apply_jo.put("device_code", "RK1004");
|
apply_jo.put("device_code", "RK1004");
|
||||||
@@ -281,12 +285,12 @@ public class InBoxManageServiceImpl implements InBoxManageService {
|
|||||||
///api/twoPda/vehicle/returnIn
|
///api/twoPda/vehicle/returnIn
|
||||||
WQLObject vehicleTab = WQLObject.getWQLObject("md_pb_storagevehicleinfo");
|
WQLObject vehicleTab = WQLObject.getWQLObject("md_pb_storagevehicleinfo");
|
||||||
// 载具扩展属性表
|
// 载具扩展属性表
|
||||||
WQLObject veExtTab = WQLObject.getWQLObject("md_pb_storagevehicleext");
|
WQLObject veExtTab = WQLObject.getWQLObject("md_pb_storagevehicleext");
|
||||||
/*
|
/*
|
||||||
* 查询mes木箱信息,插入木箱信息表
|
* 查询mes木箱信息,插入木箱信息表
|
||||||
*/
|
*/
|
||||||
// TODO 调用mes接口
|
// TODO 调用mes接口
|
||||||
JSONObject mesBoxInfo = new JSONObject();
|
// JSONObject mesBoxInfo = lmsToMesService.momGetPackingInfo(whereJson);
|
||||||
|
|
||||||
// 插入木箱信息表
|
// 插入木箱信息表
|
||||||
// iBstIvtBoxinfoService.mesInsert(mesBoxInfo);
|
// iBstIvtBoxinfoService.mesInsert(mesBoxInfo);
|
||||||
@@ -310,7 +314,7 @@ public class InBoxManageServiceImpl implements InBoxManageService {
|
|||||||
if (ObjectUtil.isEmpty(jsonVehicle)) {
|
if (ObjectUtil.isEmpty(jsonVehicle)) {
|
||||||
throw new BadRequestException("载具不存在!");
|
throw new BadRequestException("载具不存在!");
|
||||||
}
|
}
|
||||||
JSONObject ext_jo = veExtTab.query("storagevehicle_code = '"+jsonVehicle.getString("storagevehicle_code")+"'").uniqueResult(0);
|
JSONObject ext_jo = veExtTab.query("storagevehicle_code = '" + jsonVehicle.getString("storagevehicle_code") + "'").uniqueResult(0);
|
||||||
if (ObjectUtil.isEmpty(ext_jo)) {
|
if (ObjectUtil.isEmpty(ext_jo)) {
|
||||||
JSONObject jsonVeExt = new JSONObject();
|
JSONObject jsonVeExt = new JSONObject();
|
||||||
jsonVeExt.put("storagevehicleext_id", IdUtil.getLongId());
|
jsonVeExt.put("storagevehicleext_id", IdUtil.getLongId());
|
||||||
@@ -321,7 +325,7 @@ public class InBoxManageServiceImpl implements InBoxManageService {
|
|||||||
jsonVeExt.put("device_uuid", IdUtil.getLongId());
|
jsonVeExt.put("device_uuid", IdUtil.getLongId());
|
||||||
jsonVeExt.put("update_time", DateUtil.now());
|
jsonVeExt.put("update_time", DateUtil.now());
|
||||||
veExtTab.insert(jsonVeExt);
|
veExtTab.insert(jsonVeExt);
|
||||||
}else {
|
} else {
|
||||||
ext_jo.put("pcsn", whereJson.getString("box_no"));
|
ext_jo.put("pcsn", whereJson.getString("box_no"));
|
||||||
ext_jo.put("device_uuid", IdUtil.getLongId());
|
ext_jo.put("device_uuid", IdUtil.getLongId());
|
||||||
ext_jo.put("update_time", DateUtil.now());
|
ext_jo.put("update_time", DateUtil.now());
|
||||||
|
|||||||
@@ -169,6 +169,7 @@ public class InVehicleManageServiceImpl implements InVehicleManageService {
|
|||||||
"AND is_used = '" + IOSEnum.IS_NOTANDYES.code("是") + "' AND is_delete = '" + IOSEnum.IS_NOTANDYES.code("否") + "' " +
|
"AND is_used = '" + IOSEnum.IS_NOTANDYES.code("是") + "' AND is_delete = '" + IOSEnum.IS_NOTANDYES.code("否") + "' " +
|
||||||
"AND lock_type = '" + IOSEnum.LOCK_TYPE.code("未锁定") + "' AND stor_id = '"+jsonParam.getString("stor_id")+"' " +
|
"AND lock_type = '" + IOSEnum.LOCK_TYPE.code("未锁定") + "' AND stor_id = '"+jsonParam.getString("stor_id")+"' " +
|
||||||
"AND storagevehicle_type = '" +jsonParam.getString("vehicle_type")+"'"+
|
"AND storagevehicle_type = '" +jsonParam.getString("vehicle_type")+"'"+
|
||||||
|
"AND height = '2'" +
|
||||||
"AND sect_id = '"+jsonParam.getString("sect_id")+"'").getResultJSONArray(0);
|
"AND sect_id = '"+jsonParam.getString("sect_id")+"'").getResultJSONArray(0);
|
||||||
|
|
||||||
if (ObjectUtil.isEmpty(structArray)) {
|
if (ObjectUtil.isEmpty(structArray)) {
|
||||||
|
|||||||
@@ -260,7 +260,7 @@ public class LashManageServiceImpl implements LashManageService {
|
|||||||
|
|
||||||
result.put("printQty", "1");
|
result.put("printQty", "1");
|
||||||
//第一次捆扎次数
|
//第一次捆扎次数
|
||||||
result.put("bundleTimes", "2");
|
result.put("bundleTimes", "3");
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -98,6 +98,7 @@ public class OutBoxManageServiceImpl implements OutBoxManageService {
|
|||||||
jsonTaskParam.put("start_device_code", jsonAttr.getString("struct_code"));
|
jsonTaskParam.put("start_device_code", jsonAttr.getString("struct_code"));
|
||||||
jsonTaskParam.put("next_device_code", whereJson.getString("device_code"));
|
jsonTaskParam.put("next_device_code", whereJson.getString("device_code"));
|
||||||
jsonTaskParam.put("vehicle_code", jsonAttr.getString("storagevehicle_code"));
|
jsonTaskParam.put("vehicle_code", jsonAttr.getString("storagevehicle_code"));
|
||||||
|
|
||||||
jsonTaskParam.put("task_group_id", jsonAttr.getString("task_group_id"));
|
jsonTaskParam.put("task_group_id", jsonAttr.getString("task_group_id"));
|
||||||
JSONObject request_param = new JSONObject();
|
JSONObject request_param = new JSONObject();
|
||||||
request_param.put("containerType", jsonAttr.getString("storagevehicle_type"));
|
request_param.put("containerType", jsonAttr.getString("storagevehicle_type"));
|
||||||
|
|||||||
@@ -56,6 +56,7 @@
|
|||||||
attr.is_used = '1'
|
attr.is_used = '1'
|
||||||
AND attr.is_delete = '0'
|
AND attr.is_delete = '0'
|
||||||
AND attr.lock_type = '1'
|
AND attr.lock_type = '1'
|
||||||
|
AND attr.height = '2'
|
||||||
AND IFNULL(attr.storagevehicle_code,'') = ''
|
AND IFNULL(attr.storagevehicle_code,'') = ''
|
||||||
AND attr.stor_id = 输入.stor_id
|
AND attr.stor_id = 输入.stor_id
|
||||||
AND attr.sect_id = 输入.sect_id
|
AND attr.sect_id = 输入.sect_id
|
||||||
@@ -86,6 +87,7 @@
|
|||||||
WHERE
|
WHERE
|
||||||
attr.is_used = '1'
|
attr.is_used = '1'
|
||||||
AND attr.is_delete = '0'
|
AND attr.is_delete = '0'
|
||||||
|
AND attr.height = '2'
|
||||||
AND attr.stor_id = 输入.stor_id
|
AND attr.stor_id = 输入.stor_id
|
||||||
AND attr.sect_id = 输入.sect_id
|
AND attr.sect_id = 输入.sect_id
|
||||||
AND IFNULL(attr.storagevehicle_code,'') <> ''
|
AND IFNULL(attr.storagevehicle_code,'') <> ''
|
||||||
@@ -113,6 +115,7 @@
|
|||||||
attr.is_used = '1'
|
attr.is_used = '1'
|
||||||
AND attr.is_delete = '0'
|
AND attr.is_delete = '0'
|
||||||
AND attr.lock_type = '1'
|
AND attr.lock_type = '1'
|
||||||
|
AND height = '2'
|
||||||
AND IFNULL(attr.storagevehicle_code,'') = ''
|
AND IFNULL(attr.storagevehicle_code,'') = ''
|
||||||
AND attr.stor_id = 输入.stor_id
|
AND attr.stor_id = 输入.stor_id
|
||||||
AND attr.sect_id = 输入.sect_id
|
AND attr.sect_id = 输入.sect_id
|
||||||
|
|||||||
@@ -1,40 +0,0 @@
|
|||||||
package org.nl.wms.ext.mes.rest;
|
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.nl.modules.logging.annotation.Log;
|
|
||||||
import org.nl.wms.ext.mes.service.LmsToMesService;
|
|
||||||
import org.springframework.http.HttpStatus;
|
|
||||||
import org.springframework.http.ResponseEntity;
|
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
@RestController
|
|
||||||
@RequiredArgsConstructor
|
|
||||||
|
|
||||||
@RequestMapping("/CamstarApi")
|
|
||||||
@Slf4j
|
|
||||||
public class BLmsToMesController {
|
|
||||||
private final LmsToMesService lmsToMesService;
|
|
||||||
|
|
||||||
@PostMapping("/momAutoTransterMoveIn")
|
|
||||||
@Log("表处、分切上料反馈接口")
|
|
||||||
public ResponseEntity<Object> momAutoTransterMoveIn(@RequestBody JSONObject jo) {
|
|
||||||
return new ResponseEntity<>(lmsToMesService.momAutoTransterMoveIn(jo), HttpStatus.OK);
|
|
||||||
}
|
|
||||||
|
|
||||||
@PostMapping("/momGetPackingInfo")
|
|
||||||
@Log("LMS通过木箱号调用木箱信息")
|
|
||||||
public ResponseEntity<Object> momGetPackingInfo(@RequestBody JSONObject jo) {
|
|
||||||
return new ResponseEntity<>(lmsToMesService.momGetPackingInfo(jo), HttpStatus.OK);
|
|
||||||
}
|
|
||||||
|
|
||||||
@PostMapping("/momBoxPackageSubmit")
|
|
||||||
@Log("LMS装箱完成传MES包装关系")
|
|
||||||
public ResponseEntity<Object> momBoxPackageSubmit(@RequestBody JSONObject jo) {
|
|
||||||
return new ResponseEntity<>(lmsToMesService.momBoxPackageSubmit(jo), HttpStatus.OK);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -117,4 +117,22 @@ public class LmsToMesController {
|
|||||||
public ResponseEntity<Object> ChildScrapUpdate(@RequestBody JSONObject jo) {
|
public ResponseEntity<Object> ChildScrapUpdate(@RequestBody JSONObject jo) {
|
||||||
return new ResponseEntity<>(lmsToMesService.ChildScrapUpdate(jo), HttpStatus.OK);
|
return new ResponseEntity<>(lmsToMesService.ChildScrapUpdate(jo), HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PostMapping("/momAutoTransterMoveIn")
|
||||||
|
@Log("表处、分切上料反馈接口")
|
||||||
|
public ResponseEntity<Object> momAutoTransterMoveIn(@RequestBody JSONObject jo) {
|
||||||
|
return new ResponseEntity<>(lmsToMesService.momAutoTransterMoveIn(jo), HttpStatus.OK);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/momGetPackingInfo")
|
||||||
|
@Log("LMS通过木箱号调用木箱信息")
|
||||||
|
public ResponseEntity<Object> momGetPackingInfo(@RequestBody JSONObject jo) {
|
||||||
|
return new ResponseEntity<>(lmsToMesService.momGetPackingInfo(jo), HttpStatus.OK);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/momBoxPackageSubmit")
|
||||||
|
@Log("LMS装箱完成传MES包装关系")
|
||||||
|
public ResponseEntity<Object> momBoxPackageSubmit(@RequestBody JSONObject jo) {
|
||||||
|
return new ResponseEntity<>(lmsToMesService.momBoxPackageSubmit(jo), HttpStatus.OK);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -771,13 +771,25 @@ public class LmsToMesServiceImpl implements LmsToMesService {
|
|||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public JSONObject momAutoTransterMoveIn(JSONObject param){ return null;} /*{
|
public JSONObject momAutoTransterMoveIn(JSONObject param) {
|
||||||
String from_area = param.getString("from_area");
|
String from_area = param.getString("from_area");
|
||||||
String to_area = param.getString("to_area");
|
String to_area = param.getString("to_area");
|
||||||
String container_name = param.getString("container_name");
|
String container_name = param.getString("container_name");
|
||||||
|
|
||||||
|
if (StrUtil.isEmpty(from_area)) {
|
||||||
|
throw new BadRequestException("起始区域不能为空!");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (StrUtil.isEmpty(to_area)) {
|
||||||
|
throw new BadRequestException("目的区域不能为空!");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (StrUtil.isEmpty(container_name)) {
|
||||||
|
throw new BadRequestException("子卷号不能为空!");
|
||||||
|
}
|
||||||
|
|
||||||
|
JSONObject result = new JSONObject();
|
||||||
|
|
||||||
log.info("momAutoTransterMoveIn接口输入参数为:-------------------" + param.toString());
|
log.info("momAutoTransterMoveIn接口输入参数为:-------------------" + param.toString());
|
||||||
|
|
||||||
@@ -789,13 +801,16 @@ public class LmsToMesServiceImpl implements LmsToMesService {
|
|||||||
String Password = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("MES_PASSWORD").getValue();
|
String Password = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("MES_PASSWORD").getValue();
|
||||||
param.put("UserName", UserName);
|
param.put("UserName", UserName);
|
||||||
param.put("Password", Password);
|
param.put("Password", Password);
|
||||||
|
param.put("SourceLocation", from_area);
|
||||||
|
param.put("ContainerName", container_name);
|
||||||
|
param.put("DestLocation", to_area);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
String resultMsg = HttpRequest.post(url)
|
String resultMsg = HttpRequest.post(url)
|
||||||
.body(String.valueOf(param))
|
.body(String.valueOf(param))
|
||||||
.execute().body();
|
.execute().body();
|
||||||
result = JSONObject.parseObject(resultMsg);
|
result = JSONObject.parseObject(resultMsg);
|
||||||
log.info("LMSPackakge接口输出参数为:-------------------" + result.toString());
|
log.info("momAutoTransterMoveIn接口输出参数为:-------------------" + result.toString());
|
||||||
|
|
||||||
|
|
||||||
String RTYPE = result.getString("RTYPE");
|
String RTYPE = result.getString("RTYPE");
|
||||||
@@ -808,15 +823,109 @@ public class LmsToMesServiceImpl implements LmsToMesService {
|
|||||||
throw new BadRequestException("MES提示错误:" + e.getMessage());
|
throw new BadRequestException("MES提示错误:" + e.getMessage());
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}*/
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public JSONObject momGetPackingInfo(JSONObject jo) {
|
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public JSONObject momBoxPackageSubmit(JSONObject jo) {
|
public JSONObject momGetPackingInfo(JSONObject param) {
|
||||||
return null;
|
String box_no = param.getString("box_no");
|
||||||
|
|
||||||
|
if (StrUtil.isEmpty(box_no)) {
|
||||||
|
throw new BadRequestException("木箱号不能为空!");
|
||||||
|
}
|
||||||
|
|
||||||
|
JSONObject result = new JSONObject();
|
||||||
|
|
||||||
|
log.info("momGetPackingInfo接口输入参数为:-------------------" + param.toString());
|
||||||
|
|
||||||
|
String url = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("MES_URL").getValue();
|
||||||
|
String api = "CamstarApi/momGetPackingInfo";
|
||||||
|
url = url + api;
|
||||||
|
|
||||||
|
String UserName = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("MES_USERNAME").getValue();
|
||||||
|
String Password = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("MES_PASSWORD").getValue();
|
||||||
|
param.put("UserName", UserName);
|
||||||
|
param.put("Password", Password);
|
||||||
|
param.put("ContainerName", box_no);
|
||||||
|
|
||||||
|
try {
|
||||||
|
String resultMsg = HttpRequest.post(url)
|
||||||
|
.body(String.valueOf(param))
|
||||||
|
.execute().body();
|
||||||
|
result = JSONObject.parseObject(resultMsg);
|
||||||
|
log.info("momGetPackingInfo接口输出参数为:-------------------" + result.toString());
|
||||||
|
|
||||||
|
|
||||||
|
String RTYPE = result.getString("RTYPE");
|
||||||
|
if ("E".equals(RTYPE)) {
|
||||||
|
throw new BadRequestException(result.getString("RTMSG"));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new BadRequestException("MES提示错误:" + e.getMessage());
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public JSONObject momBoxPackageSubmit(JSONObject param) {
|
||||||
|
|
||||||
|
log.info("momBoxPackageSubmit接口输入参数为:-------------------" + param.toString());
|
||||||
|
|
||||||
|
|
||||||
|
String box_no = param.getString("box_no");
|
||||||
|
String num = param.getString("num");
|
||||||
|
String box_weight = param.getString("box_weight");
|
||||||
|
JSONArray rows = param.getJSONArray("rows");
|
||||||
|
|
||||||
|
if (StrUtil.isEmpty(box_no)) {
|
||||||
|
throw new BadRequestException("木箱号不能为空!");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (StrUtil.isEmpty(num)) {
|
||||||
|
throw new BadRequestException("箱内子卷数不能为空!");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (StrUtil.isEmpty(box_weight)) {
|
||||||
|
throw new BadRequestException("木箱毛重不能为空!");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ObjectUtil.isEmpty(rows)) {
|
||||||
|
throw new BadRequestException("箱内子卷信息不能为空!");
|
||||||
|
}
|
||||||
|
|
||||||
|
JSONObject result = new JSONObject();
|
||||||
|
|
||||||
|
String url = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("MES_URL").getValue();
|
||||||
|
String api = "CamstarApi/momBoxPackageSubmit";
|
||||||
|
url = url + api;
|
||||||
|
|
||||||
|
String UserName = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("MES_USERNAME").getValue();
|
||||||
|
String Password = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("MES_PASSWORD").getValue();
|
||||||
|
param.put("UserName", UserName);
|
||||||
|
param.put("Password", Password);
|
||||||
|
param.put("PackageBoxSN", box_no);
|
||||||
|
param.put("QuanlityInBox", num);
|
||||||
|
param.put("BoxWeight", box_weight);
|
||||||
|
param.put("ContainerList", box_weight);
|
||||||
|
|
||||||
|
try {
|
||||||
|
String resultMsg = HttpRequest.post(url)
|
||||||
|
.body(String.valueOf(param))
|
||||||
|
.execute().body();
|
||||||
|
result = JSONObject.parseObject(resultMsg);
|
||||||
|
log.info("momBoxPackageSubmit接口输出参数为:-------------------" + result.toString());
|
||||||
|
|
||||||
|
|
||||||
|
String RTYPE = result.getString("RTYPE");
|
||||||
|
if ("E".equals(RTYPE)) {
|
||||||
|
throw new BadRequestException(result.getString("RTMSG"));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new BadRequestException("MES提示错误:" + e.getMessage());
|
||||||
|
}
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,13 +8,16 @@ import cn.hutool.core.util.StrUtil;
|
|||||||
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;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
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.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.sch.point.dao.BstIvtPackageinfoivt;
|
import org.nl.b_lms.sch.point.dao.BstIvtPackageinfoivt;
|
||||||
import org.nl.b_lms.sch.point.service.IbstIvtPackageinfoivtService;
|
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;
|
||||||
@@ -32,6 +35,7 @@ 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;
|
||||||
import org.nl.wms.pda.mps.service.impl.BakingServiceImpl;
|
import org.nl.wms.pda.mps.service.impl.BakingServiceImpl;
|
||||||
|
import org.nl.wms.pdm.bi.service.dto.SubpackagerelationDto;
|
||||||
import org.nl.wms.sch.manage.AbstractAcsTask;
|
import org.nl.wms.sch.manage.AbstractAcsTask;
|
||||||
import org.nl.wms.sch.tasks.CoolCutTask;
|
import org.nl.wms.sch.tasks.CoolCutTask;
|
||||||
import org.nl.wms.st.inbill.service.CheckOutBillService;
|
import org.nl.wms.st.inbill.service.CheckOutBillService;
|
||||||
@@ -1746,6 +1750,32 @@ public class MesToLmsServiceImpl implements MesToLmsService {
|
|||||||
public JSONObject momSendSplitMfgOrderBOM(JSONObject param) {
|
public JSONObject momSendSplitMfgOrderBOM(JSONObject param) {
|
||||||
log.info("momSendSplitMfgOrderBOM输入参数为:-------------------" + param.toString());
|
log.info("momSendSplitMfgOrderBOM输入参数为:-------------------" + param.toString());
|
||||||
|
|
||||||
|
/* MES传递的入参内容
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"MfgOrderName": "25529502-20230926$02#02",
|
||||||
|
"ProductName": "44151000900045",
|
||||||
|
"Description": "木制包装容器及板材|木箱|650|4|3|1290*750*494",
|
||||||
|
"CarrierName": "48221000000001",
|
||||||
|
"CarrierDescription": "纸制筒管|纸管|3英寸|650",
|
||||||
|
"Type": "RW2",
|
||||||
|
"HL01": "A+",
|
||||||
|
"HL02": "520",
|
||||||
|
"HL03": "1,538.000",
|
||||||
|
"HL031": "2,000.000",
|
||||||
|
"HL04": "100.000",
|
||||||
|
"HL041": "130.000",
|
||||||
|
"HL05": "20,000.000",
|
||||||
|
"HL06": "CC",
|
||||||
|
"HL07": "4",
|
||||||
|
"HL08": "ZT1(纸筒-3寸)",
|
||||||
|
"HL081": "650",
|
||||||
|
"HL09": "ROF(毛面朝外)",
|
||||||
|
"HL10": "纸管长度650,中性包装",
|
||||||
|
"HL11": null
|
||||||
|
}
|
||||||
|
]*/
|
||||||
|
|
||||||
JSONObject resultParam = new JSONObject();
|
JSONObject resultParam = new JSONObject();
|
||||||
resultParam.put("RTYPE", "S");
|
resultParam.put("RTYPE", "S");
|
||||||
resultParam.put("Code", "0");
|
resultParam.put("Code", "0");
|
||||||
@@ -1758,27 +1788,51 @@ public class MesToLmsServiceImpl implements MesToLmsService {
|
|||||||
public JSONObject getRollInfo(JSONObject param) {
|
public JSONObject getRollInfo(JSONObject param) {
|
||||||
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 + "]的分切计划!");
|
||||||
}
|
}
|
||||||
JSONObject resultParam = new JSONObject();
|
JSONObject resultParam = new JSONObject();
|
||||||
resultParam.put("ContainerName",ContainerName);
|
resultParam.put("ContainerName", ContainerName);
|
||||||
resultParam.put("ResourceName","");
|
resultParam.put("ResourceName", "");
|
||||||
resultParam.put("Weight",one.getWeight());
|
resultParam.put("Weight", one.getWeight());
|
||||||
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;
|
return resultParam;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public JSONObject sendLevelInfo(JSONObject param) {
|
public JSONObject sendLevelInfo(JSONObject param) {
|
||||||
log.info("sendLevelInfo输入参数为:-------------------" + param.toString());
|
log.info("sendLevelInfo输入参数为:-------------------" + param.toString());
|
||||||
|
|
||||||
JSONObject resultParam = new JSONObject();
|
JSONObject resultParam = new JSONObject();
|
||||||
resultParam.put("RTYPE", "S");
|
|
||||||
resultParam.put("Code", "0");
|
String ContainerName = param.getString("ContainerName");
|
||||||
resultParam.put("RTMSG", "操作成功!");
|
String Level = param.getString("Level");
|
||||||
|
|
||||||
|
try {
|
||||||
|
if (StrUtil.isEmpty(ContainerName)) {
|
||||||
|
throw new BadRequestException("子卷号不能为空!");
|
||||||
|
}
|
||||||
|
if (StrUtil.isEmpty(Level)) {
|
||||||
|
throw new BadRequestException("子卷等级不能为空!");
|
||||||
|
}
|
||||||
|
|
||||||
|
PdmBiSlittingproductionplan plan = slittingproductionplanService.getOne(new LambdaQueryWrapper<PdmBiSlittingproductionplan>().eq(PdmBiSlittingproductionplan::getContainer_name, ContainerName)
|
||||||
|
.eq(PdmBiSlittingproductionplan::getIs_delete, "0"));
|
||||||
|
if (ObjectUtil.isEmpty(plan)) {
|
||||||
|
throw new BadRequestException("未查询到对应的分切计划!");
|
||||||
|
}
|
||||||
|
plan.setLevel(Level);
|
||||||
|
slittingproductionplanService.update(plan);
|
||||||
|
resultParam.put("RTYPE", "S");
|
||||||
|
resultParam.put("Code", "0");
|
||||||
|
resultParam.put("RTMSG", "操作成功!");
|
||||||
|
} catch (Exception e) {
|
||||||
|
resultParam.put("RTYPE", "E");
|
||||||
|
resultParam.put("Code", "1");
|
||||||
|
resultParam.put("RTMSG", "操作失败!," + e.getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
return resultParam;
|
return resultParam;
|
||||||
}
|
}
|
||||||
@@ -1797,6 +1851,86 @@ public class MesToLmsServiceImpl implements MesToLmsService {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public JSONObject sendSubInfo(JSONObject param) {
|
public JSONObject sendSubInfo(JSONObject param) {
|
||||||
|
|
||||||
|
/* {"ContainerName":"A1222211290105A3",
|
||||||
|
"SAPLotNumber":"A000000168",
|
||||||
|
"SaleOrderName":"100000022-100",
|
||||||
|
"CustomerName":"10000282",
|
||||||
|
"CustomerDescription":"深圳市金泰莱新材料有限公司",
|
||||||
|
"WidthPlan":null,"ThicknessPlan":"6",
|
||||||
|
"Width":"710","Thickness":"1",
|
||||||
|
"MassPerUnitArea":"1","NetWeight":204.906,
|
||||||
|
"Length":"6500","DateOfProduction":"2024-05-24",
|
||||||
|
"isUnPlanProduction":"0",
|
||||||
|
"UnPlanProductProperty1":"面密度/g/m²:1|面密度极差/g/m²:0.4|铬含量/ppm:1|断裂伸长率/%:1.0|高温抗氧化性(150℃|10min):1|M面光泽度/GU:1|M面粗糙度Rz/μm:1|S面粗糙度Ra/μm:1|抗拉强度/Mpa:1.0|厚度/μm:1|润湿性/mN/m - ≥:1|翘曲/mm:1",
|
||||||
|
"UnPlanProductProperty2":"",
|
||||||
|
"UnPlanProductProperty3":"",
|
||||||
|
"SOTensileStrengthLowerLimit":null,
|
||||||
|
"ETTensileStrengthLowerLimit":"300",
|
||||||
|
"TensileStrength":"1.0"}*/
|
||||||
|
|
||||||
|
//子卷号
|
||||||
|
String ContainerName = param.getString("ContainerName");
|
||||||
|
//SAP批次
|
||||||
|
String SAPLotNumber = param.getString("SAPLotNumber");
|
||||||
|
//销售订单及行号
|
||||||
|
String SaleOrderName = param.getString("SaleOrderName");
|
||||||
|
//客户编号
|
||||||
|
String CustomerName = param.getString("CustomerName");
|
||||||
|
//客户名称
|
||||||
|
String CustomerDescription = param.getString("CustomerDescription");
|
||||||
|
//计划幅宽
|
||||||
|
String WidthPlan = param.getString("WidthPlan");
|
||||||
|
//计划厚度
|
||||||
|
String ThicknessPlan = param.getString("ThicknessPlan");
|
||||||
|
//产品幅宽
|
||||||
|
String Width = param.getString("Width");
|
||||||
|
//产品厚度
|
||||||
|
String Thickness = param.getString("Thickness");
|
||||||
|
//单位面积质量
|
||||||
|
String MassPerUnitArea = param.getString("MassPerUnitArea");
|
||||||
|
//净重
|
||||||
|
String NetWeight = param.getString("NetWeight");
|
||||||
|
//长度
|
||||||
|
String Length = param.getString("Length");
|
||||||
|
//制造完成日期
|
||||||
|
String DateOfProduction = param.getString("DateOfProduction");
|
||||||
|
//计划外分切的子卷
|
||||||
|
String isUnPlanProduction = param.getString("isUnPlanProduction");
|
||||||
|
//子卷的物性值1
|
||||||
|
String UnPlanProductProperty1 = param.getString("UnPlanProductProperty1");
|
||||||
|
//子卷的物性值2
|
||||||
|
String UnPlanProductProperty2 = param.getString("UnPlanProductProperty2");
|
||||||
|
//子卷的物性值3
|
||||||
|
String UnPlanProductProperty3 = param.getString("UnPlanProductProperty3");
|
||||||
|
//客户需求抗拉下限
|
||||||
|
String SOTensileStrengthLowerLimit = param.getString("SOTensileStrengthLowerLimit");
|
||||||
|
//内控标准抗拉下限
|
||||||
|
String ETTensileStrengthLowerLimit = param.getString("ETTensileStrengthLowerLimit");
|
||||||
|
//生产实际抗拉值
|
||||||
|
String TensileStrength = param.getString("TensileStrength");
|
||||||
|
|
||||||
|
PdmBiSubpackagerelation dto = new PdmBiSubpackagerelation();
|
||||||
|
dto.setContainer_name(ContainerName);
|
||||||
|
dto.setSap_pcsn(SAPLotNumber);
|
||||||
|
dto.setSale_order_name(SaleOrderName);
|
||||||
|
dto.setContainer_name(CustomerName);
|
||||||
|
dto.setCustomer_description(CustomerDescription);
|
||||||
|
dto.setWidth(Width);
|
||||||
|
dto.setThickness(Thickness);
|
||||||
|
dto.setMass_per_unit_area(MassPerUnitArea);
|
||||||
|
dto.setNet_weight(NetWeight);
|
||||||
|
dto.setLength(Length);
|
||||||
|
dto.setDate_of_production(DateOfProduction);
|
||||||
|
dto.setIs_un_plan_production(isUnPlanProduction);
|
||||||
|
dto.setUn_plan_product_property1(UnPlanProductProperty1);
|
||||||
|
dto.setUn_plan_product_property2(UnPlanProductProperty2);
|
||||||
|
dto.setUn_plan_product_property3(UnPlanProductProperty3);
|
||||||
|
dto.setDemand_limit(SOTensileStrengthLowerLimit);
|
||||||
|
dto.setStandard_limit(ETTensileStrengthLowerLimit);
|
||||||
|
dto.setActual_value(TensileStrength);
|
||||||
|
|
||||||
|
|
||||||
log.info("sendSubInfo输入参数为:-------------------" + param.toString());
|
log.info("sendSubInfo输入参数为:-------------------" + param.toString());
|
||||||
|
|
||||||
JSONObject resultParam = new JSONObject();
|
JSONObject resultParam = new JSONObject();
|
||||||
|
|||||||
@@ -90,17 +90,17 @@ public class SubpackagerelationDto implements Serializable {
|
|||||||
/**
|
/**
|
||||||
* 单位面积质量
|
* 单位面积质量
|
||||||
*/
|
*/
|
||||||
private BigDecimal mass_per_unit_area;
|
private String mass_per_unit_area;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 净重
|
* 净重
|
||||||
*/
|
*/
|
||||||
private BigDecimal net_weight;
|
private String net_weight;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 长度
|
* 长度
|
||||||
*/
|
*/
|
||||||
private BigDecimal length;
|
private String length;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 制造完成日期
|
* 制造完成日期
|
||||||
|
|||||||
@@ -140,10 +140,4 @@ public class AcsTaskDto {
|
|||||||
|
|
||||||
private String barcode;
|
private String barcode;
|
||||||
|
|
||||||
/**
|
|
||||||
* 发货任务下发货叉宽度
|
|
||||||
*/
|
|
||||||
private String expandWidthLength;
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user