优化返回值
This commit is contained in:
parent
63fb6936a2
commit
91a3f986f1
|
@ -13,6 +13,8 @@ import nc.itf.bd.bom.bom0202.IBomBillQueryService;
|
|||
import nc.jdbc.framework.generator.IdGenerator;
|
||||
import nc.mmbd.utils.factoryparam.MMBDFactoryParameter;
|
||||
import nc.uif.pub.exception.UifException;
|
||||
import nc.util.mmf.framework.base.MMArrayUtil;
|
||||
import nc.util.mmf.framework.base.MMStringUtil;
|
||||
import nc.util.mmf.framework.base.MMValueCheck;
|
||||
import nc.vo.bd.bom.bom0202.entity.AggBomVO;
|
||||
import nc.vo.bd.bom.bom0202.entity.BomItemVO;
|
||||
|
@ -214,9 +216,42 @@ public class BomResource extends AbstractNCCRestResource {
|
|||
bomReplVOS.addAll(Arrays.asList(result));
|
||||
}
|
||||
}
|
||||
List<Map<String,Object>> bomReplVOList = new ArrayList<>();
|
||||
HYPubBO hybo = new HYPubBO();
|
||||
for (Map<String, Object> param : paramMap) {
|
||||
String cbomid = (String) param.get("cbomid");
|
||||
String targetCbomReplaceId = (String) param.get("cbom_replaceid"); // 目标替代ID
|
||||
String targetCbomBid = (String) param.get("cbombid"); // 目标物料项ID
|
||||
if(!MMStringUtil.isEmpty(targetCbomReplaceId)){
|
||||
bomReplVOList.add(param);
|
||||
continue;
|
||||
}else{
|
||||
if (param.containsKey("creplmaterialvid")) {
|
||||
|
||||
String mrlCode= (String) param.get("creplmaterialvid");
|
||||
String mrlid=(String) hybo.findColValue("bd_material","pk_material"," code = '" + mrlCode + "' ");
|
||||
for (AggBomVO aggBomVO : bomReplVOS) {
|
||||
for (BomItemVO bomItemVO : aggBomVO.getChildrenVO()) {
|
||||
|
||||
return ResultMessageUtil.toJSON(bomReplVOS, "BOM更新成功");
|
||||
if (targetCbomBid.equals(bomItemVO.getCbom_bid())) {
|
||||
for (BomReplVO replVO : bomItemVO.getRepl()) {
|
||||
if(replVO.getCreplmaterialvid().equals(mrlid)){
|
||||
param.put("cbom_replaceid",replVO.getCbom_replaceid());
|
||||
bomReplVOList.add(param);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
return ResultMessageUtil.toJSON(bomReplVOList, "BOM更新成功");
|
||||
} catch (BusinessException e) {
|
||||
return ResultMessageUtil.exceptionToJSON(e);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue