fix:MES变更库区

This commit is contained in:
zhouz
2024-06-29 16:37:34 +08:00
parent 898b1ab452
commit f8d9ad12e4
3 changed files with 76 additions and 48 deletions

View File

@@ -167,7 +167,7 @@ public class MesToLmsController {
@Log("MES传递给LMS入线边库或者入成品库、撤销入线边库、人工改变入线边还是包装") @Log("MES传递给LMS入线边库或者入成品库、撤销入线边库、人工改变入线边还是包装")
@SaIgnore @SaIgnore
public ResponseEntity<Object> changeSect(@RequestBody JSONObject jo) { public ResponseEntity<Object> changeSect(@RequestBody JSONObject jo) {
return new ResponseEntity<>(mesToLmsService.changeSect(jo), HttpStatus.OK); return new ResponseEntity<>(mesToLmsService.sendTargetHouse(jo), HttpStatus.OK);
} }
@PostMapping("/getWasteFoilWeight") @PostMapping("/getWasteFoilWeight")

View File

@@ -80,8 +80,6 @@ public interface MesToLmsService {
JSONObject sendSubInfo(JSONObject param); JSONObject sendSubInfo(JSONObject param);
JSONObject changeSect(JSONObject param);
JSONObject getWasteFoilWeight(JSONObject param); JSONObject getWasteFoilWeight(JSONObject param);
JSONObject WasteFoilSuccess(JSONObject param); JSONObject WasteFoilSuccess(JSONObject param);

View File

@@ -23,6 +23,7 @@ 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;
import org.nl.b_lms.pdm.subpackagerelation.service.IpdmBiSubpackagerelationService;
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;
@@ -88,6 +89,9 @@ public class MesToLmsServiceImpl implements MesToLmsService {
@Resource @Resource
private IbstIvtPackageinfoivtService packageinfoivtService; private IbstIvtPackageinfoivtService packageinfoivtService;
@Autowired
private IpdmBiSubpackagerelationService subpackagerelationService;
/** /**
* 生箔烘箱: * 生箔烘箱:
@@ -1719,7 +1723,7 @@ public class MesToLmsServiceImpl implements MesToLmsService {
log.info("sendTargetHouse输入参数为-------------------" + param.toString()); log.info("sendTargetHouse输入参数为-------------------" + param.toString());
JSONObject resultParam = new JSONObject(); JSONObject resultParam = new JSONObject();
try { try {
String containerName = param.getString("sconds"); String containerName = param.getString("ContainerName");
String TargetHouse = param.getString("TargetHouse"); String TargetHouse = param.getString("TargetHouse");
if (StringUtils.isBlank(containerName)) { if (StringUtils.isBlank(containerName)) {
throw new BadRequestException("传入的母卷号不能为空!"); throw new BadRequestException("传入的母卷号不能为空!");
@@ -1879,17 +1883,44 @@ public class MesToLmsServiceImpl implements MesToLmsService {
public JSONObject containerNeedDown(JSONObject param) { public JSONObject containerNeedDown(JSONObject param) {
log.info("containerNeedDown输入参数为-------------------" + param.toString()); log.info("containerNeedDown输入参数为-------------------" + param.toString());
JSONObject resultParam = new JSONObject(); JSONObject result = new JSONObject();
resultParam.put("RTYPE", "S");
resultParam.put("Code", "0");
resultParam.put("RTMSG", "操作成功!");
return resultParam; String OutsideContainerName = param.getString("OutsideContainerName");
String InsideContainerName = param.getString("InsideContainerName");
String CarrierStatus = param.getString("CarrierStatus");
if (StrUtil.isEmpty(OutsideContainerName)) {
throw new BadRequestException("外卷卷号不能为空!");
}
if (StrUtil.isEmpty(InsideContainerName)) {
throw new BadRequestException("内卷卷号不能为空!");
}
if (StrUtil.isEmpty(CarrierStatus)) {
throw new BadRequestException("是否需要下轴不能为空!");
}
try { // 返回成功
result.put("RTYPE", "S");
result.put("RTMSG", "操作成功!");
result.put("RTOAL", 1);
result.put("RTDAT", null);
} catch (Exception e) {
// 返回失败
result.put("RTYPE", "E");
result.put("RTMSG", "操作失败!" + e.getMessage());
result.put("RTOAL", 0);
result.put("RTDAT", null);
}
return result;
} }
@Override @Override
public JSONObject sendSubInfo(JSONObject param) { public JSONObject sendSubInfo(JSONObject param) {
log.info("sendSubInfo输入参数为-------------------" + param.toString());
/* {"ContainerName":"A1222211290105A3", /* {"ContainerName":"A1222211290105A3",
"SAPLotNumber":"A000000168", "SAPLotNumber":"A000000168",
"SaleOrderName":"100000022-100", "SaleOrderName":"100000022-100",
@@ -1907,6 +1938,7 @@ public class MesToLmsServiceImpl implements MesToLmsService {
"ETTensileStrengthLowerLimit":"300", "ETTensileStrengthLowerLimit":"300",
"TensileStrength":"1.0"}*/ "TensileStrength":"1.0"}*/
JSONObject result = new JSONObject();
//子卷号 //子卷号
String ContainerName = param.getString("ContainerName"); String ContainerName = param.getString("ContainerName");
//SAP批次 //SAP批次
@@ -1948,6 +1980,7 @@ public class MesToLmsServiceImpl implements MesToLmsService {
//生产实际抗拉值 //生产实际抗拉值
String TensileStrength = param.getString("TensileStrength"); String TensileStrength = param.getString("TensileStrength");
try {
PdmBiSubpackagerelation dto = new PdmBiSubpackagerelation(); PdmBiSubpackagerelation dto = new PdmBiSubpackagerelation();
dto.setContainer_name(ContainerName); dto.setContainer_name(ContainerName);
dto.setSap_pcsn(SAPLotNumber); dto.setSap_pcsn(SAPLotNumber);
@@ -1967,28 +2000,25 @@ public class MesToLmsServiceImpl implements MesToLmsService {
dto.setDemand_limit(SOTensileStrengthLowerLimit); dto.setDemand_limit(SOTensileStrengthLowerLimit);
dto.setStandard_limit(ETTensileStrengthLowerLimit); dto.setStandard_limit(ETTensileStrengthLowerLimit);
dto.setActual_value(TensileStrength); dto.setActual_value(TensileStrength);
dto.setWidth_standard(WidthPlan);
dto.setThickness_request(ThicknessPlan);
dto.setWorkorder_id(IdUtil.getSnowflake(1, 1).nextId() + "");
subpackagerelationService.save(dto);
// 返回成功
log.info("sendSubInfo输入参数为-------------------" + param.toString()); result.put("RTYPE", "S");
result.put("RTMSG", "操作成功!");
JSONObject resultParam = new JSONObject(); result.put("RTOAL", 1);
resultParam.put("RTYPE", "S"); result.put("RTDAT", null);
resultParam.put("Code", "0"); } catch (Exception e) {
resultParam.put("RTMSG", "操作成功!"); // 返回失败
result.put("RTYPE", "E");
return resultParam; result.put("RTMSG", "操作失败!" + e.getMessage());
result.put("RTOAL", 0);
result.put("RTDAT", null);
} }
@Override return result;
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 @Override