|
@ -365,9 +365,12 @@ public class InspectRequestMainServiceImpl implements InspectRequestMainService |
|
|
} |
|
|
} |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
|
|
|
InspectRequestDetailDO inspectRequestDetailDOTmp = detailDOList.get(0); |
|
|
List<ExpectoutCreateReqVO> expectoutCreateReqVOList = new ArrayList<>(); |
|
|
List<ExpectoutCreateReqVO> expectoutCreateReqVOList = new ArrayList<>(); |
|
|
InspectJobMainDO inspectJobMainDO = InspectJobMainConvert.INSTANCE.convert(mainDO); |
|
|
InspectJobMainDO inspectJobMainDO = InspectJobMainConvert.INSTANCE.convert(mainDO); |
|
|
inspectJobMainDO.setStatus(JobStatusEnum.PENDING.getCode()); |
|
|
inspectJobMainDO.setStatus(JobStatusEnum.PENDING.getCode()); |
|
|
|
|
|
inspectJobMainDO.setRequestNumber(mainDO.getNumber()); |
|
|
|
|
|
inspectJobMainDO.setWarehouseCode(mainDO.getFromWarehouseCode()); |
|
|
String number = serialNumberApi.generateCode(RuleCodeEnum.INSPECT_JOB.getCode()); |
|
|
String number = serialNumberApi.generateCode(RuleCodeEnum.INSPECT_JOB.getCode()); |
|
|
inspectJobMainDO.setNumber(number); |
|
|
inspectJobMainDO.setNumber(number); |
|
|
//增加业务类型
|
|
|
//增加业务类型
|
|
@ -383,7 +386,9 @@ public class InspectRequestMainServiceImpl implements InspectRequestMainService |
|
|
//预计出
|
|
|
//预计出
|
|
|
ExpectoutCreateReqVO expectoutCreateReqVO = new ExpectoutCreateReqVO(); |
|
|
ExpectoutCreateReqVO expectoutCreateReqVO = new ExpectoutCreateReqVO(); |
|
|
BeanUtils.copyProperties(inspectJobDetailDO, expectoutCreateReqVO); |
|
|
BeanUtils.copyProperties(inspectJobDetailDO, expectoutCreateReqVO); |
|
|
|
|
|
expectoutCreateReqVO.setId(null); |
|
|
expectoutCreateReqVO.setJobNumber(number); |
|
|
expectoutCreateReqVO.setJobNumber(number); |
|
|
|
|
|
expectoutCreateReqVO.setBatch(inspectJobMainDO.getBatch()); |
|
|
expectoutCreateReqVO.setBusinessType(inspectJobMainDO.getBusinessType()); |
|
|
expectoutCreateReqVO.setBusinessType(inspectJobMainDO.getBusinessType()); |
|
|
expectoutCreateReqVO.setLocationCode(inspectJobDetailDO.getFromLocationCode()); |
|
|
expectoutCreateReqVO.setLocationCode(inspectJobDetailDO.getFromLocationCode()); |
|
|
expectoutCreateReqVO.setOwnerCode(mainDO.getOwnerCode()); |
|
|
expectoutCreateReqVO.setOwnerCode(mainDO.getOwnerCode()); |
|
@ -406,22 +411,23 @@ public class InspectRequestMainServiceImpl implements InspectRequestMainService |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
//查询检验类型
|
|
|
//查询检验类型
|
|
|
@Override |
|
|
private BigDecimal selectInspectType(InspectRequestMainDO mainDO, BigDecimal sampleQty, HashMap<String, String> ruleAll) { |
|
|
public BigDecimal selectInspectType(BigDecimal sampleQty, HashMap<String, String> ruleAll) { |
|
|
|
|
|
String inspectType = ruleAll.get("InspectType"); |
|
|
String inspectType = ruleAll.get("InspectType"); |
|
|
|
|
|
mainDO.setInspectType(inspectType); |
|
|
if ("FULL".equals(inspectType)) { |
|
|
if ("FULL".equals(inspectType)) { |
|
|
return sampleQty; |
|
|
return sampleQty; |
|
|
} else if ("SAMPLING".equals(inspectType)) { |
|
|
} else if ("SAMPLING".equals(inspectType)) { |
|
|
return selectSampleMethod(ruleAll, sampleQty); |
|
|
return selectSampleMethod(mainDO, ruleAll, sampleQty); |
|
|
} else { |
|
|
} else { |
|
|
return BigDecimal.ZERO; |
|
|
return BigDecimal.ZERO; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
//查询抽检方式 计算抽检数量并返回
|
|
|
//查询抽检方式 计算抽检数量并返回
|
|
|
private BigDecimal selectSampleMethod(HashMap<String, String> ruleAll, BigDecimal sampleQty) { |
|
|
private BigDecimal selectSampleMethod(InspectRequestMainDO mainDO, HashMap<String, String> ruleAll, BigDecimal sampleQty) { |
|
|
String sampleMethod = ruleAll.get("SampleMethod"); |
|
|
String sampleMethod = ruleAll.get("SampleMethod"); |
|
|
JSONArray aplList = JSONUtil.parseArray(ruleAll.get("AplList")); |
|
|
mainDO.setSampleMethod(sampleMethod); |
|
|
|
|
|
JSONArray aplList = JSONUtil.parseArray(ruleAll.get("AqlList")); |
|
|
//获取最大校验规则范围
|
|
|
//获取最大校验规则范围
|
|
|
BigDecimal maxFloorQty = BigDecimal.ZERO; |
|
|
BigDecimal maxFloorQty = BigDecimal.ZERO; |
|
|
BigDecimal maxCeilingQty = BigDecimal.ZERO; |
|
|
BigDecimal maxCeilingQty = BigDecimal.ZERO; |
|
@ -471,17 +477,7 @@ public class InspectRequestMainServiceImpl implements InspectRequestMainService |
|
|
HashMap<String, String> mapRule = new HashMap<>(); |
|
|
HashMap<String, String> mapRule = new HashMap<>(); |
|
|
mapRule.put("InspectType", configuration.get("InspectType").toString()); |
|
|
mapRule.put("InspectType", configuration.get("InspectType").toString()); |
|
|
mapRule.put("SampleMethod", configuration.get("SampleMethod").toString()); |
|
|
mapRule.put("SampleMethod", configuration.get("SampleMethod").toString()); |
|
|
mapRule.put("AqList", configuration.get("AqList").toString()); |
|
|
mapRule.put("AqlList", configuration.get("AqlList").toString()); |
|
|
String aqlList = mapRule.get("AqlList"); |
|
|
|
|
|
if (aqlList != null) { |
|
|
|
|
|
JSONArray objects = JSONUtil.parseArray(aqlList); |
|
|
|
|
|
for (int i = 0; i < objects.size(); i++) { |
|
|
|
|
|
JSONObject entries = JSONUtil.parseObj(objects.getObj(i)); |
|
|
|
|
|
mapRule.put("FloorQty" + (i + 1), entries.get("FloorQty").toString()); |
|
|
|
|
|
mapRule.put("CeilingQty" + (i + 1), entries.get("CeilingQty").toString()); |
|
|
|
|
|
mapRule.put("SampleValue" + (i + 1), entries.get("SampleValue").toString()); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
return mapRule; |
|
|
return mapRule; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -491,7 +487,7 @@ public class InspectRequestMainServiceImpl implements InspectRequestMainService |
|
|
|
|
|
|
|
|
private void validatorRule(InspectRequestMainDO mainDO) { |
|
|
private void validatorRule(InspectRequestMainDO mainDO) { |
|
|
HashMap<String, String> rule = selectRule(null, mainDO.getItemCode()); |
|
|
HashMap<String, String> rule = selectRule(null, mainDO.getItemCode()); |
|
|
mainDO.setSampleQty(selectInspectType(mainDO.getReceiveQty(), rule)); |
|
|
mainDO.setSampleQty(selectInspectType(mainDO, mainDO.getReceiveQty(), rule)); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|