fix:MES接口相关修改

This commit is contained in:
zhouz
2024-05-23 17:21:19 +08:00
parent 8e5fcb1006
commit d1731ab7f3
5 changed files with 202 additions and 11 deletions

View File

@@ -157,4 +157,7 @@ public class PdmBiSlittingproductionplan implements Serializable {
private String level;
/** 子卷重量 */
private String weight;
/** 管件重量 */
private String paper_weight;
}

View File

@@ -113,7 +113,7 @@ public class MesToLmsController {
return new ResponseEntity<>(mesToLmsService.sendProcessInfo(jo), HttpStatus.OK);
}
@PostMapping("/processFoilStart")
@PostMapping("/momRollTRStartMock")
@Log("表处工单推送")
@SaIgnore
public ResponseEntity<Object> processFoilStart(@RequestBody JSONObject jo) {
@@ -128,5 +128,59 @@ public class MesToLmsController {
return new ResponseEntity<>(mesToLmsService.sendTargetHouse(jo), HttpStatus.OK);
}
@PostMapping("/momSendSplitMfgOrderBOM")
@Log("MES传递LMS订单BOM")
@SaIgnore
public ResponseEntity<Object> momSendSplitMfgOrderBOM(@RequestBody JSONObject jo) {
return new ResponseEntity<>(mesToLmsService.momSendSplitMfgOrderBOM(jo), HttpStatus.OK);
}
@PostMapping("/getRollInfo")
@Log("MES传递LMS获取子卷重量信息")
@SaIgnore
public ResponseEntity<Object> getRollInfo(@RequestBody JSONObject jo) {
return new ResponseEntity<>(mesToLmsService.getRollInfo(jo), HttpStatus.OK);
}
@PostMapping("/sendLevelInfo")
@Log("MES传递LMS定级数据")
@SaIgnore
public ResponseEntity<Object> sendLevelInfo(@RequestBody JSONObject jo) {
return new ResponseEntity<>(mesToLmsService.sendLevelInfo(jo), HttpStatus.OK);
}
@PostMapping("/containerNeedDown")
@Log("子卷拼接完成是否下轴")
@SaIgnore
public ResponseEntity<Object> containerNeedDown(@RequestBody JSONObject jo) {
return new ResponseEntity<>(mesToLmsService.containerNeedDown(jo), HttpStatus.OK);
}
@PostMapping("/sendSubInfo")
@Log("子卷下料信息MES传递给LMS")
@SaIgnore
public ResponseEntity<Object> sendSubInfo(@RequestBody JSONObject jo) {
return new ResponseEntity<>(mesToLmsService.sendSubInfo(jo), HttpStatus.OK);
}
@PostMapping("/changeSect")
@Log("MES传递给LMS入线边库或者入成品库、撤销入线边库、人工改变入线边还是包装")
@SaIgnore
public ResponseEntity<Object> changeSect(@RequestBody JSONObject jo) {
return new ResponseEntity<>(mesToLmsService.changeSect(jo), HttpStatus.OK);
}
@PostMapping("/getWasteFoilWeight")
@Log("分切子卷获取LMSAGV废箔称重重量")
@SaIgnore
public ResponseEntity<Object> getWasteFoilWeight(@RequestBody JSONObject jo) {
return new ResponseEntity<>(mesToLmsService.getWasteFoilWeight(jo), HttpStatus.OK);
}
@PostMapping("/WasteFoilSuccess")
@Log("分切子卷获取LMSAGV废箔称重重量")
@SaIgnore
public ResponseEntity<Object> WasteFoilSuccess(@RequestBody JSONObject jo) {
return new ResponseEntity<>(mesToLmsService.WasteFoilSuccess(jo), HttpStatus.OK);
}
}

View File

@@ -70,6 +70,22 @@ public interface MesToLmsService {
*/
JSONObject sendTargetHouse(JSONObject param);
JSONObject momSendSplitMfgOrderBOM(JSONObject param);
JSONObject getRollInfo(JSONObject param);
JSONObject sendLevelInfo(JSONObject param);
JSONObject containerNeedDown(JSONObject param);
JSONObject sendSubInfo(JSONObject param);
JSONObject changeSect(JSONObject param);
JSONObject getWasteFoilWeight(JSONObject param);
JSONObject WasteFoilSuccess(JSONObject param);
}

View File

@@ -7,11 +7,14 @@ import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
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.point.dao.BstIvtPackageinfoivt;
import org.nl.b_lms.sch.point.service.IbstIvtPackageinfoivtService;
import org.nl.b_lms.sch.tasks.ProcessTask;
@@ -33,6 +36,7 @@ import org.nl.wms.sch.manage.AbstractAcsTask;
import org.nl.wms.sch.tasks.CoolCutTask;
import org.nl.wms.st.inbill.service.CheckOutBillService;
import org.nl.wms.st.instor.service.impl.ProductScrapServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@@ -53,6 +57,9 @@ public class MesToLmsServiceImpl implements MesToLmsService {
private final InService inService;
@Autowired
private IPdmBiSlittingproductionplanService slittingproductionplanService;
@Resource
private DjqTask djqTask;
@Resource
@@ -183,15 +190,26 @@ public class MesToLmsServiceImpl implements MesToLmsService {
JSONArray arr = new JSONArray();
String ContainerName = param.getString("ContainerName");
String ResourceName = param.getString("ResourceName");
String Type = param.getString("Type");
JSONObject raw_jo = new JSONObject();
if (Type.equals("TR")) {
raw_jo = WQLObject.getWQLObject("PDM_BI_SurProcessOrder").query("container_name ='" + ContainerName + "' AND resource_name = '" + ResourceName + "'").uniqueResult(0);
} else {
raw_jo = WQLObject.getWQLObject("PDM_BI_RawFoilWorkOrder").query("container_name ='" + ContainerName + "' AND resource_name = '" + ResourceName + "'").uniqueResult(0);
}
//查询该母卷号、设备号对应的生箔工单
JSONObject raw_jo = WQLObject.getWQLObject("PDM_BI_RawFoilWorkOrder").query("container_name ='" + ContainerName + "' AND resource_name = '" + ResourceName + "'").uniqueResult(0);
if (ObjectUtil.isEmpty(raw_jo)) {
throw new BadRequestException("未查询到对应的生箔工单!");
throw new BadRequestException("未查询到对应的工单!");
}
//查询对应的设备是否启用
JSONObject jsonPoint = WQLObject.getWQLObject("ST_IVT_SbPointIvt").query("ext_code ='" + ResourceName + "'").uniqueResult(0);
JSONObject jsonPoint = new JSONObject();
if (Type.equals("TR")) {
jsonPoint = WQLObject.getWQLObject("ST_IVT_StPointIvt").query("ext_code ='" + ResourceName + "'").uniqueResult(0);
} else {
jsonPoint = WQLObject.getWQLObject("ST_IVT_SbPointIvt").query("ext_code ='" + ResourceName + "'").uniqueResult(0);
}
if (ObjectUtil.isEmpty(jsonPoint)) {
jsonPoint = new JSONObject();
}
@@ -398,7 +416,8 @@ public class MesToLmsServiceImpl implements MesToLmsService {
} else {
log.info("当前AGV启用参数为否");
//判断当前位置是否在冷却区如果不在则提醒人工报错
JSONObject container_jo = coolIvtTab.query("container_name = '" + containerName + "' and full_point_status = '02' and cool_ivt_status <> '04' AND point_type = '1'").uniqueResult(0); if (ObjectUtil.isEmpty(container_jo)) {
JSONObject container_jo = coolIvtTab.query("container_name = '" + containerName + "' and full_point_status = '02' and cool_ivt_status <> '04' AND point_type = '1'").uniqueResult(0);
if (ObjectUtil.isEmpty(container_jo)) {
throw new BadRequestException("该母卷已经被烘烤或现在还未绑定在冷却区上且AGV未启用请使用人工烘烤功能【出箱】将母卷绑定到冷却区");
}
container_jo.put("cool_ivt_status", "04");
@@ -1503,14 +1522,14 @@ public class MesToLmsServiceImpl implements MesToLmsService {
String up_scroll = device_jo.getString("up_scroll");
//查询母卷所在点位
JSONObject jsonCoolIvt = coolIvtTab.query("container_name = '" + containerName + "' and full_point_status = '02' and cool_ivt_status <> '04'").uniqueResult(0);
if(ObjectUtil.isEmpty(jsonCoolIvt)) {
throw new BadRequestException("未查询到母卷【"+containerName+"】所在的半成品暂存点!");
if (ObjectUtil.isEmpty(jsonCoolIvt)) {
throw new BadRequestException("未查询到母卷【" + containerName + "】所在的半成品暂存点!");
}
JSONObject form = new JSONObject();
if (StrUtil.isEmpty(up_scroll)) {
//取满放满
form.put("point_code1", jsonCoolIvt.getString("full_point_code"));
form.put("point_code2", device_jo.getString("up_point_code")+"_M");
form.put("point_code2", device_jo.getString("up_point_code") + "_M");
form.put("task_type", "010702");
form.put("material_code", containerName);
form.put("vehicle_code", jsonCoolIvt.getString("full_vehicle_code"));
@@ -1518,8 +1537,8 @@ public class MesToLmsServiceImpl implements MesToLmsService {
} else {
//取满取空放满放空
form.put("point_code1", jsonCoolIvt.getString("full_point_code"));
form.put("point_code2", device_jo.getString("up_point_code")+"_M");
form.put("point_code3", device_jo.getString("up_point_code")+"_K");
form.put("point_code2", device_jo.getString("up_point_code") + "_M");
form.put("point_code3", device_jo.getString("up_point_code") + "_K");
//判断对应空轴点位是否为空,为空用当前点位,不为空查询其他点位
if (jsonCoolIvt.getString("empty_point_status").equals("01")) {
form.put("point_code4", jsonCoolIvt.getString("empty_point_code"));
@@ -1545,7 +1564,7 @@ public class MesToLmsServiceImpl implements MesToLmsService {
map.put("flag", "1");
map.put("product_area", device_jo.getString("product_area"));
JSONObject jsonIvt = WQL.getWO("PDA_RAWFOIL_01").addParamMap(map).process().uniqueResult(0);
form.put("point_code1", device_jo.getString("up_point_code")+"_M");
form.put("point_code1", device_jo.getString("up_point_code") + "_M");
//寻找可用的冷却区满轴点位
form.put("point_code2", jsonIvt.getString("full_point_code"));
form.put("task_type", "010704");
@@ -1713,5 +1732,104 @@ public class MesToLmsServiceImpl implements MesToLmsService {
return resultParam;
}
@Override
public JSONObject momSendSplitMfgOrderBOM(JSONObject param) {
log.info("momSendSplitMfgOrderBOM输入参数为-------------------" + param.toString());
JSONObject resultParam = new JSONObject();
resultParam.put("RTYPE", "S");
resultParam.put("Code", "0");
resultParam.put("RTMSG", "操作成功!");
return resultParam;
}
@Override
public JSONObject getRollInfo(JSONObject param) {
String ContainerName = param.getString("ContainerName");
PdmBiSlittingproductionplan one = slittingproductionplanService.getOne(new LambdaQueryWrapper<PdmBiSlittingproductionplan>().eq(PdmBiSlittingproductionplan::getContainer_name, ContainerName));
if (ObjectUtil.isEmpty(one)){
throw new BadRequestException("未查询到子卷号为["+ContainerName+"]的分切计划!");
}
JSONObject resultParam = new JSONObject();
resultParam.put("ContainerName",ContainerName);
resultParam.put("ResourceName","");
resultParam.put("Weight",one.getWeight());
resultParam.put("WeighDate",DateUtil.now());
resultParam.put("Type",one.getPaper_tube_or_FRP());
resultParam.put("CarrierWeight",one.getPaper_weight());
return resultParam;
}
@Override
public JSONObject sendLevelInfo(JSONObject param) {
log.info("sendLevelInfo输入参数为-------------------" + param.toString());
JSONObject resultParam = new JSONObject();
resultParam.put("RTYPE", "S");
resultParam.put("Code", "0");
resultParam.put("RTMSG", "操作成功!");
return resultParam;
}
@Override
public JSONObject containerNeedDown(JSONObject param) {
log.info("containerNeedDown输入参数为-------------------" + param.toString());
JSONObject resultParam = new JSONObject();
resultParam.put("RTYPE", "S");
resultParam.put("Code", "0");
resultParam.put("RTMSG", "操作成功!");
return resultParam;
}
@Override
public JSONObject sendSubInfo(JSONObject param) {
log.info("sendSubInfo输入参数为-------------------" + param.toString());
JSONObject resultParam = new JSONObject();
resultParam.put("RTYPE", "S");
resultParam.put("Code", "0");
resultParam.put("RTMSG", "操作成功!");
return resultParam;
}
@Override
public JSONObject changeSect(JSONObject param) {
log.info("changeSect输入参数为-------------------" + param.toString());
JSONObject resultParam = new JSONObject();
resultParam.put("RTYPE", "S");
resultParam.put("Code", "0");
resultParam.put("RTMSG", "操作成功!");
return resultParam;
}
@Override
public JSONObject getWasteFoilWeight(JSONObject param) {
log.info("getWasteFoilWeight输入参数为-------------------" + param.toString());
JSONObject resultParam = new JSONObject();
resultParam.put("RTYPE", "S");
resultParam.put("Code", "0");
resultParam.put("RTMSG", "操作成功!");
return resultParam;
}
@Override
public JSONObject WasteFoilSuccess(JSONObject param) {
log.info("WasteFoilSuccess输入参数为-------------------" + param.toString());
JSONObject resultParam = new JSONObject();
resultParam.put("RTYPE", "S");
resultParam.put("Code", "0");
resultParam.put("RTMSG", "操作成功!");
return resultParam;
}
}