调整获取方法

This commit is contained in:
BF-202309241046\Administrator 2023-12-10 08:48:34 +08:00
parent b605864b08
commit 7793636288
1 changed files with 40 additions and 40 deletions

View File

@ -141,14 +141,14 @@ public class PublishMaterialService {
try {
String data = materialService.addMaterial("", sendPack.getMaterialName(), OptionalBomConstant.PublishMaterialEnum.OTHER.getCategory());
ResultVO<String> resultVO = JSON.parseObject(data, new com.alibaba.fastjson.TypeReference<ResultVO<String>>(){});
if (resultVO == null) {
throw new NflgBusinessException(STATE.Error, "机型发货物料编码申请失败,联系管理员," + data);
}
if (!Objects.equal(resultVO.getState(), STATE.Success.getState())) {
throw new NflgBusinessException(STATE.Error, resultVO.getMsg());
}
sendPack.setMaterialNo(resultVO.getData());
// ResultVO<String> resultVO = JSON.parseObject(data, new com.alibaba.fastjson.TypeReference<ResultVO<String>>(){});
// if (resultVO == null) {
// throw new NflgBusinessException(STATE.Error, "机型发货物料编码申请失败,联系管理员," + data);
// }
// if (!Objects.equal(resultVO.getState(), STATE.Success.getState())) {
// throw new NflgBusinessException(STATE.Error, resultVO.getMsg());
// }
sendPack.setMaterialNo(data);
} catch (Exception e) {
throw new NflgBusinessException(STATE.Error, "机型发货物料编码申请失败," + e.getMessage());
}
@ -172,14 +172,14 @@ public class PublishMaterialService {
try {
String data = materialService.addMaterial("", makePack.getMaterialName(), OptionalBomConstant.PublishMaterialEnum.OTHER.getCategory());
ResultVO<String> resultVO = JSON.parseObject(data, new com.alibaba.fastjson.TypeReference<ResultVO<String>>(){});
if (resultVO == null) {
throw new NflgBusinessException(STATE.Error, "机型制作物料编码申请失败,联系管理员," + data);
}
if (!Objects.equal(resultVO.getState(), STATE.Success.getState())) {
throw new NflgBusinessException(STATE.Error, resultVO.getMsg());
}
makePack.setMaterialNo(resultVO.getData());
// ResultVO<String> resultVO = JSON.parseObject(data, new com.alibaba.fastjson.TypeReference<ResultVO<String>>(){});
// if (resultVO == null) {
// throw new NflgBusinessException(STATE.Error, "机型制作物料编码申请失败,联系管理员," + data);
// }
// if (!Objects.equal(resultVO.getState(), STATE.Success.getState())) {
// throw new NflgBusinessException(STATE.Error, resultVO.getMsg());
// }
makePack.setMaterialNo(data);
} catch (Exception e) {
throw new NflgBusinessException(STATE.Error, "机型制作物料编码申请失败," + e.getMessage());
}
@ -241,14 +241,14 @@ public class PublishMaterialService {
try {
String data = materialService.addMaterial(material.getDrawingNo(), material.getMaterialName(), OptionalBomConstant.PublishMaterialEnum.MACHINE.getCategory());
ResultVO<String> resultVO = JSON.parseObject(data, new com.alibaba.fastjson.TypeReference<ResultVO<String>>(){});
if (resultVO == null) {
throw new NflgBusinessException(STATE.Error, "机械部分物料编码申请失败,联系管理员," + data);
}
if (!Objects.equal(resultVO.getState(), STATE.Success.getState())) {
throw new NflgBusinessException(STATE.Error, resultVO.getMsg());
}
material.setMaterialNo(resultVO.getData());
// ResultVO<String> resultVO = JSON.parseObject(data, new com.alibaba.fastjson.TypeReference<ResultVO<String>>(){});
// if (resultVO == null) {
// throw new NflgBusinessException(STATE.Error, "机械部分物料编码申请失败,联系管理员," + data);
// }
// if (!Objects.equal(resultVO.getState(), STATE.Success.getState())) {
// throw new NflgBusinessException(STATE.Error, resultVO.getMsg());
// }
material.setMaterialNo(data);
} catch (Exception e) {
throw new NflgBusinessException(STATE.Error, "机械部分物料编码申请失败," + e.getMessage());
}
@ -331,14 +331,14 @@ public class PublishMaterialService {
try {
String data = materialService.addMaterial("", makePack.getMaterialName(), OptionalBomConstant.PublishMaterialEnum.OTHER.getCategory());
ResultVO<String> resultVO = JSON.parseObject(data, new com.alibaba.fastjson.TypeReference<ResultVO<String>>(){});
if (resultVO == null) {
throw new NflgBusinessException(STATE.Error, "电控制作物料编码申请失败,联系管理员," + data);
}
if (!Objects.equal(resultVO.getState(), STATE.Success.getState())) {
throw new NflgBusinessException(STATE.Error, resultVO.getMsg());
}
makePack.setMaterialNo(resultVO.getData());
// ResultVO<String> resultVO = JSON.parseObject(data, new com.alibaba.fastjson.TypeReference<ResultVO<String>>(){});
// if (resultVO == null) {
// throw new NflgBusinessException(STATE.Error, "电控制作物料编码申请失败,联系管理员," + data);
// }
// if (!Objects.equal(resultVO.getState(), STATE.Success.getState())) {
// throw new NflgBusinessException(STATE.Error, resultVO.getMsg());
// }
makePack.setMaterialNo(data);
} catch (Exception e) {
throw new NflgBusinessException(STATE.Error, "电控制作物料编码申请失败," + e.getMessage());
}
@ -361,14 +361,14 @@ public class PublishMaterialService {
sendPack.setMaterialNo("");//申请物料号
try {
String data = materialService.addMaterial("", sendPack.getMaterialName(), OptionalBomConstant.PublishMaterialEnum.OTHER.getCategory());
ResultVO<String> resultVO = JSON.parseObject(data, new com.alibaba.fastjson.TypeReference<ResultVO<String>>(){});
if (resultVO == null) {
throw new NflgBusinessException(STATE.Error, "电控发货物料编码申请失败,联系管理员," + data);
}
if (!Objects.equal(resultVO.getState(), STATE.Success.getState())) {
throw new NflgBusinessException(STATE.Error, resultVO.getMsg());
}
sendPack.setMaterialNo(resultVO.getData());
// ResultVO<String> resultVO = JSON.parseObject(data, new com.alibaba.fastjson.TypeReference<ResultVO<String>>(){});
// if (resultVO == null) {
// throw new NflgBusinessException(STATE.Error, "电控发货物料编码申请失败,联系管理员," + data);
// }
// if (!Objects.equal(resultVO.getState(), STATE.Success.getState())) {
// throw new NflgBusinessException(STATE.Error, resultVO.getMsg());
// }
sendPack.setMaterialNo(data);
} catch (Exception e) {
throw new NflgBusinessException(STATE.Error, "电控发货物料编码申请失败," + e.getMessage());
}