Merge remote-tracking branch 'origin/master_merge' into master_merge
This commit is contained in:
@@ -65,8 +65,8 @@
|
||||
AND p.is_child_tz_ok = '0'
|
||||
AND p.is_paper_ok = '1'
|
||||
AND p.is_delete = '0'
|
||||
AND p.up_or_down IS NOT NULL
|
||||
AND p.left_or_right IS NOT NULL
|
||||
AND IFNULL(p.up_or_down,'') <![CDATA[ <> ]]> ''
|
||||
AND IFNULL(p.left_or_right,'') <![CDATA[ <> ]]> ''
|
||||
GROUP BY
|
||||
p.resource_name,
|
||||
p.parent_container_name,
|
||||
|
||||
@@ -854,11 +854,11 @@ public class PdmBiSubpackagerelationServiceImpl extends ServiceImpl<PdmBiSubpack
|
||||
boxInfo.put("device_code", deviceCode);
|
||||
boxInfo.put("material_code", boxType);
|
||||
boxInfo.put("num", workIdList.size());
|
||||
String boxSn = outBoxManageService.outBox(boxInfo);
|
||||
//String boxSn = outBoxManageService.outBox(boxInfo);
|
||||
stopWatch.stop();
|
||||
System.out.println("木箱出库代码执行花费时间------------------------------------------------------------------------------------------*************************************************************************************************= totalTime = " + stopWatch.getTotalTimeMillis());
|
||||
log.info("木箱出库代码执行花费时间------------------------------------------------------------------------------------------*************************************************************************************************= totalTime = " + stopWatch.getTotalTimeMillis());
|
||||
//String boxSn = "MX240702000169";
|
||||
String boxSn = "MX240703000118";
|
||||
StopWatch stopWatch1 = new StopWatch();
|
||||
stopWatch1.start();
|
||||
//更新及子卷包装状态已分配规格及木箱规格组
|
||||
@@ -902,7 +902,7 @@ public class PdmBiSubpackagerelationServiceImpl extends ServiceImpl<PdmBiSubpack
|
||||
djqPoints.forEach(r -> {
|
||||
//校验重复任务
|
||||
List<SchBaseTask> taskList = taskService.list(new LambdaQueryWrapper<SchBaseTask>().eq(SchBaseTask::getVehicle_code, r.getContainer_name()).eq(SchBaseTask::getTask_type, PackageInfoIvtEnum.TASK_TYPE.code("待检区->装箱区"))
|
||||
.eq(SchBaseTask::getIs_delete, IOSEnum.IS_NOTANDYES.code("否")));
|
||||
.eq(SchBaseTask::getIs_delete, IOSEnum.IS_NOTANDYES.code("否")).lt(SchBaseTask::getTask_status, TaskStatusEnum.FINISHED));
|
||||
if (CollectionUtils.isEmpty(taskList)) {
|
||||
JSONObject jo = new JSONObject();
|
||||
jo.put("task_type", PackageInfoIvtEnum.TASK_TYPE.code("待检区->装箱区"));
|
||||
|
||||
@@ -27,6 +27,7 @@ import org.nl.common.enums.PackageInfoIvtEnum;
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
import org.nl.system.service.param.ISysParamService;
|
||||
import org.nl.wms.ext.mes.service.impl.LmsToMesServiceImpl;
|
||||
import org.nl.wms.sch.manage.TaskStatusEnum;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
@@ -114,7 +115,7 @@ public class AutoSendZxToDjw {
|
||||
throw new BadRequestException("装箱区的子卷号为" + containerName + "无对应的分切计划信息,请检查!");
|
||||
}
|
||||
//校验是否存在相同子卷号任务
|
||||
List<SchBaseTask> taskList = taskService.list(new LambdaQueryWrapper<SchBaseTask>().eq(SchBaseTask::getVehicle_code, containerName).eq(SchBaseTask::getTask_type, PackageInfoIvtEnum.TASK_TYPE.code("装箱区->装箱对接位")).eq(SchBaseTask::getIs_delete, IOSEnum.IS_NOTANDYES.code("否")));
|
||||
List<SchBaseTask> taskList = taskService.list(new LambdaQueryWrapper<SchBaseTask>().eq(SchBaseTask::getVehicle_code, containerName).eq(SchBaseTask::getTask_type, PackageInfoIvtEnum.TASK_TYPE.code("装箱区->装箱对接位")).eq(SchBaseTask::getIs_delete, IOSEnum.IS_NOTANDYES.code("否")).lt(SchBaseTask::getTask_status, TaskStatusEnum.FINISHED.getCode()));
|
||||
if (CollectionUtils.isEmpty(taskList)) {
|
||||
//创建搬运任务到装箱位
|
||||
JSONObject jo = new JSONObject();
|
||||
@@ -159,7 +160,7 @@ public class AutoSendZxToDjw {
|
||||
* 传输子卷包装关系至MES
|
||||
*/
|
||||
public void transferBoxPackageToMes(List<PdmBiSubpackagerelation> packagerelationList, BstIvtBoxinfo bstIvtBoxinfo) {
|
||||
if (StringUtils.isBlank(packagerelationList.get(0).getPackage_box_sn()) || packagerelationList.get(0).getBox_weight() == null) {
|
||||
if (StringUtils.isBlank(packagerelationList.get(0).getPackage_box_sn())) {
|
||||
log.info("transferBoxPackageToMes接口的子卷号:" + packagerelationList.get(0).getContainer_name() + ",子卷未确定木箱规格信息");
|
||||
throw new BadRequestException("子卷未确定木箱规格信息!");
|
||||
}
|
||||
|
||||
@@ -15,6 +15,8 @@ import org.nl.b_lms.bst.ivt.stockingivt.service.IBstIvtStockingivtService;
|
||||
import org.nl.b_lms.bst.ivt.stockingivt.service.dao.BstIvtStockingivt;
|
||||
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.sch.task.dao.SchBaseTask;
|
||||
import org.nl.b_lms.sch.task.service.IschBaseTaskService;
|
||||
import org.nl.b_lms.sch.tasks.slitter.StockAreaCallTubeTask;
|
||||
import org.nl.b_lms.sch.tasks.slitter.StockAreaSendVehicleTask;
|
||||
import org.nl.b_lms.sch.tasks.slitter.TrussCallAirShaftTask;
|
||||
@@ -32,8 +34,10 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import static org.nl.b_lms.sch.tasks.slitter.util.SlitterTaskUtil.*;
|
||||
|
||||
@@ -70,6 +74,8 @@ public class AutoCallAirShaftTask {
|
||||
private StockAreaCallTubeTask stockAreaCallTubeTask;
|
||||
@Autowired
|
||||
private IMdPbPapervehicleService mdPbPapervehicleService;
|
||||
@Autowired
|
||||
private IschBaseTaskService taskService;
|
||||
|
||||
/**
|
||||
* hint: 目前只是考虑了上区域
|
||||
@@ -82,6 +88,7 @@ public class AutoCallAirShaftTask {
|
||||
*/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void run() {
|
||||
log.info(this.getClass().getName() + "开始执行...");
|
||||
// 1、获取空的插拔轴位(无任务)
|
||||
List<BstIvtShafttubeivt> emptyPoints = bstIvtShafttubeivtService.getAllShaftPointsByConditions("2",
|
||||
"0", "0");
|
||||
@@ -92,7 +99,7 @@ public class AutoCallAirShaftTask {
|
||||
// 2、获取分切计划数据 校验代数
|
||||
List<SlitterPlanDistinctDto> planAll = slittingproductionplanService.getAllCutPlan();
|
||||
List<SlitterPlanDistinctDto> plans = planAll.stream()
|
||||
.filter(p -> p.getResource_name().startsWith("B")).collect(Collectors.toList());
|
||||
.filter(p -> p.getResource_name().startsWith("B6")).collect(Collectors.toList());
|
||||
if (plans.size() == 0) {
|
||||
// 如果不需要套轴,就只做拔轴
|
||||
makePullShaft(empty, specification);
|
||||
@@ -445,7 +452,27 @@ public class AutoCallAirShaftTask {
|
||||
trussCallAirShaftTask.createTask(param);
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查是否有同设备的任务
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
public boolean checkHasTask(SlitterPlanDistinctDto dto) {
|
||||
// 同设备,同母卷,同组别的任务
|
||||
|
||||
// 桁架也需要校验
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查是否有同母卷,不同组的点位数据
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
public boolean checkComputationPoint(SlitterPlanDistinctDto dto) {
|
||||
// 同设备,同母卷,同组别的点位
|
||||
|
||||
// 有就返回true
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -123,7 +123,7 @@ public class AutoSendAirShaftAgvTask {
|
||||
param.put("point_code2", endPoint.getPoint_code());
|
||||
param.put("vehicle_code1", cutPoint.getQzz_no1());
|
||||
param.put("vehicle_code2", cutPoint.getQzz_no2());
|
||||
param.put("task_type", SlitterEnum.TASK_TYPE.code("穿拔轴缓存<>穿拔轴位"));
|
||||
param.put("task_type", SlitterEnum.TASK_TYPE.code("送气胀轴到分切机任务"));
|
||||
param.put("product_area", SlitterConstant.SLITTER_TASK_AREA);
|
||||
sendAirShaftAgvTask.createTask(param);
|
||||
} else {
|
||||
|
||||
@@ -22,7 +22,7 @@ public enum SlitterEnum {
|
||||
TASK_TYPE(MapOf.of("穿拔轴缓存<>穿拔轴位", "010801", "穿拔轴缓存<>分切对接位", "010802", "穿拔轴位<>气胀轴缓存位", "010803"
|
||||
, "分切机下料AGV任务", "010804", "分切机上气胀轴", "010805", "分切机下气胀轴", "010806", "备货区送载具", "010807"
|
||||
, "备货区送纸管", "010808", "分切机下料桁架任务", "010809", "分切机下料AGV到内包间", "010810", "套轴异常处理AGV任务", "010811"
|
||||
, "套轴异常处理桁架任务", "010812"));
|
||||
, "套轴异常处理桁架任务", "010812", "送气胀轴到分切机任务", "010813"));
|
||||
private Map<String, String> code;
|
||||
|
||||
public String code(String desc) {
|
||||
|
||||
@@ -769,6 +769,9 @@ public class SlitterServiceImpl implements SlitterService {
|
||||
StIvtCutpointivt deviceCode = cutpointivtService.getPintByExtCode(device_code, false);
|
||||
List<String> qzzNo = Stream.of(deviceCode.getUp_qzzno(), deviceCode.getDown_qzzno())
|
||||
.filter(ObjectUtil::isNotEmpty).collect(Collectors.toList());
|
||||
if (qzzNo.size() == 0) {
|
||||
throw new BadRequestException("分切机 " + device_code + " 的分切计划不存在!");
|
||||
}
|
||||
List<PdmBiSlittingproductionplan> list = slittingproductionplanService.getByQzzNos(qzzNo, "05");
|
||||
if (list.size() == 0) {
|
||||
throw new BadRequestException("分切机" + device_code + " 的分切计划 " + qzzNo + " 不存在");
|
||||
|
||||
@@ -1939,7 +1939,8 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
return taskService.list(new LambdaQueryWrapper<SchBaseTask>()
|
||||
.eq(SchBaseTask::getTask_type, taskType)
|
||||
.eq(SchBaseTask::getVehicle_code, containerName)
|
||||
.gt(SchBaseTask::getCreate_time, startTime)
|
||||
//.gt(SchBaseTask::getCreate_time, startTime)
|
||||
.lt(SchBaseTask::getTask_status, TaskStatusEnum.FINISHED.getCode())
|
||||
.eq(SchBaseTask::getIs_delete, IOSEnum.IS_NOTANDYES.code("否"))
|
||||
|
||||
);
|
||||
|
||||
@@ -18,6 +18,9 @@ import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
@@ -128,73 +131,87 @@ public class SapToLmsServiceImpl implements SapToLmsService {
|
||||
public JSONObject getReCutInfo(JSONObject json) {
|
||||
log.info("getReCutInfo的输入参数为:------------------------" + json.toString());
|
||||
|
||||
JSONObject jsonMst = new JSONObject();
|
||||
|
||||
JSONObject result = new JSONObject();
|
||||
|
||||
String msg = "改切出库单据推送成功!";
|
||||
try {
|
||||
JSONArray dtl_ja = json.getJSONArray("ITEM");
|
||||
String LGORT = dtl_ja.getJSONObject(0).getString("LGORT");
|
||||
JSONObject stor_jo = WQLObject.getWQLObject("ST_IVT_BSRealStorAttr").query("ext_id = '" + LGORT + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(stor_jo)) {
|
||||
result.put("RTYPE", "E");
|
||||
result.put("RTMSG", "操作失败!" + "未查询到外部标识为:" + LGORT + "对应的仓库!");
|
||||
result.put("RTOAL", 1);
|
||||
result.put("RTDAT", null);
|
||||
return result;
|
||||
}
|
||||
// 需要插入分切计划的集合
|
||||
List<JSONObject> needInsetIos = new ArrayList<>();
|
||||
// 子卷集合
|
||||
List<JSONObject> dtl_ja = json.getJSONArray("ITEM").toJavaList(JSONObject.class);
|
||||
// 根据仓库进行分类:一个仓库生成一个单据
|
||||
Map<String, List<JSONObject>> storList = dtl_ja.stream()
|
||||
.collect(Collectors.groupingBy(row -> row.getString("LGORT")));
|
||||
|
||||
jsonMst.put("stor_id", stor_jo.getString("stor_id"));
|
||||
jsonMst.put("stor_code", stor_jo.getString("stor_code"));
|
||||
jsonMst.put("stor_name", stor_jo.getString("stor_name"));
|
||||
for(String LGORT: storList.keySet()) {
|
||||
// 查询仓库是否存在
|
||||
JSONObject stor_jo = WQLObject.getWQLObject("ST_IVT_BSRealStorAttr").query("ext_id = '" + LGORT + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(stor_jo)) {
|
||||
result.put("RTYPE", "E");
|
||||
result.put("RTMSG", "操作失败!" + "未查询到外部标识为:" + LGORT + "对应的仓库!");
|
||||
result.put("RTOAL", 1);
|
||||
result.put("RTDAT", null);
|
||||
return result;
|
||||
}
|
||||
|
||||
JSONArray dtls = new JSONArray();
|
||||
for (int i = 0; i < dtl_ja.size(); i++) {
|
||||
JSONObject jo = dtl_ja.getJSONObject(i);
|
||||
String sap_pcsn = jo.getString("CHARG");
|
||||
if (StrUtil.isEmpty("sap_pcsn")) {
|
||||
throw new BadRequestException("请求参数SAP批次不能为空!");
|
||||
}
|
||||
JSONObject sub_jo = WQLObject.getWQLObject("PDM_BI_SubPackageRelation").query("sap_pcsn = '" + sap_pcsn + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(sub_jo)) {
|
||||
throw new BadRequestException("LMS中不存在SAP批次为【" + sap_pcsn + "】的包装关系");
|
||||
}
|
||||
String container_name = sub_jo.getString("container_name");
|
||||
JSONObject struct_ivt = WQLObject.getWQLObject("st_ivt_structivt").query("pcsn = '" + container_name + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(struct_ivt)) {
|
||||
throw new BadRequestException("SAP批次为【" + sap_pcsn + "】的成品卷不存在或已经出库!");
|
||||
} else {
|
||||
if (struct_ivt.getDoubleValue("frozen_qty") > 0) {
|
||||
msg = "SAP批次为【" + sap_pcsn + "】的成品卷已经被分配或出库中";
|
||||
// 组织主表信息
|
||||
JSONObject jsonMst = new JSONObject();
|
||||
jsonMst.put("stor_id", stor_jo.getString("stor_id"));
|
||||
jsonMst.put("stor_code", stor_jo.getString("stor_code"));
|
||||
jsonMst.put("stor_name", stor_jo.getString("stor_name"));
|
||||
|
||||
// 组织明细信息
|
||||
JSONArray dtls = new JSONArray();
|
||||
for (JSONObject jo : storList.get(LGORT)) {
|
||||
String sap_pcsn = jo.getString("CHARG");
|
||||
if (StrUtil.isEmpty("sap_pcsn")) {
|
||||
throw new BadRequestException("请求参数SAP批次不能为空!");
|
||||
}
|
||||
JSONObject sub_jo = WQLObject.getWQLObject("PDM_BI_SubPackageRelation").query("sap_pcsn = '" + sap_pcsn + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(sub_jo)) {
|
||||
throw new BadRequestException("LMS中不存在SAP批次为【" + sap_pcsn + "】的包装关系");
|
||||
}
|
||||
String container_name = sub_jo.getString("container_name");
|
||||
JSONObject struct_ivt = WQLObject.getWQLObject("st_ivt_structivt").query("pcsn = '" + container_name + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(struct_ivt)) {
|
||||
throw new BadRequestException("SAP批次为【" + sap_pcsn + "】的成品卷不存在或已经出库!");
|
||||
} else {
|
||||
JSONObject dtl = new JSONObject();
|
||||
//查询该物料
|
||||
JSONObject mater_jo = WQLObject.getWQLObject("md_me_materialbase").query("material_code = '" + sub_jo.getString("product_name") + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(mater_jo)) {
|
||||
throw new BadRequestException("未查询到物料:" + sub_jo.getString("product_name") + ",信息!");
|
||||
if (struct_ivt.getDoubleValue("frozen_qty") > 0) {
|
||||
msg = "SAP批次为【" + sap_pcsn + "】的成品卷已经被分配或出库中";
|
||||
} else {
|
||||
JSONObject dtl = new JSONObject();
|
||||
//查询该物料
|
||||
JSONObject mater_jo = WQLObject.getWQLObject("md_me_materialbase").query("material_code = '" + sub_jo.getString("product_name") + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(mater_jo)) {
|
||||
throw new BadRequestException("未查询到物料:" + sub_jo.getString("product_name") + ",信息!");
|
||||
}
|
||||
dtl.put("material_id", mater_jo.getString("material_id"));
|
||||
dtl.put("sap_pcsn", sap_pcsn);
|
||||
JSONObject unit = WQLObject.getWQLObject("md_pb_measureunit").query("measure_unit_id = '" + mater_jo.getString("base_unit_id") + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(unit)) {
|
||||
throw new BadRequestException("未查询到物料计量单位:" + mater_jo.getString("base_unit_id") + ",信息!");
|
||||
}
|
||||
dtl.put("qty_unit_id", unit.getString("measure_unit_id"));
|
||||
dtl.put("qty_unit_name", unit.getString("unit_name"));
|
||||
dtl.put("package_box_sn", sub_jo.getString("package_box_sn"));
|
||||
dtl.put("qty", sub_jo.getString("net_weight"));
|
||||
dtls.add(dtl);
|
||||
}
|
||||
dtl.put("material_id", mater_jo.getString("material_id"));
|
||||
dtl.put("sap_pcsn", sap_pcsn);
|
||||
JSONObject unit = WQLObject.getWQLObject("md_pb_measureunit").query("measure_unit_id = '" + mater_jo.getString("base_unit_id") + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(unit)) {
|
||||
throw new BadRequestException("未查询到物料计量单位:" + mater_jo.getString("base_unit_id") + ",信息!");
|
||||
}
|
||||
dtl.put("qty_unit_id", unit.getString("measure_unit_id"));
|
||||
dtl.put("qty_unit_name", unit.getString("unit_name"));
|
||||
dtl.put("package_box_sn", sub_jo.getString("package_box_sn"));
|
||||
dtl.put("qty", sub_jo.getString("net_weight"));
|
||||
dtls.add(dtl);
|
||||
}
|
||||
}
|
||||
|
||||
if (!dtls.isEmpty()) {
|
||||
jsonMst.put("tableData", dtls);
|
||||
needInsetIos.add(jsonMst);
|
||||
} else {
|
||||
throw new BadRequestException("推送失败!SAP推送的子卷明细不符合出库状态!");
|
||||
}
|
||||
}
|
||||
|
||||
if (!dtls.isEmpty()) {
|
||||
jsonMst.put("tableData", dtls);
|
||||
recutPlanService.insertDtl(jsonMst);
|
||||
} else {
|
||||
throw new BadRequestException("推送失败!SAP推送的子卷明细不符合出库状态!");
|
||||
// 生成单据
|
||||
for(JSONObject jsonIos : needInsetIos) {
|
||||
recutPlanService.insertDtl(jsonIos);
|
||||
}
|
||||
|
||||
} catch (Exception exception) {
|
||||
result.put("TYPE", "E");
|
||||
result.put("MESSAGE", "推送失败!" + exception.getMessage());
|
||||
|
||||
@@ -29,9 +29,9 @@ public class TaskUtil {
|
||||
if (schBaseTask.getTask_status().equals(TaskStatusEnum.FINISHED.getCode())) {
|
||||
return true;
|
||||
}
|
||||
if (StringUtils.isBlank(schBaseTask.getVehicle_code())) {
|
||||
throw new BadRequestException("任务类型为:" + taskType + "子卷号不能为空!");
|
||||
}
|
||||
// if (StringUtils.isBlank(schBaseTask.getVehicle_code())) {
|
||||
// throw new BadRequestException("任务类型为:" + taskType + "子卷号不能为空!");
|
||||
// }
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user