|
@@ -785,4 +785,36 @@ public class ProduceOrderServiceImpl extends ServiceImpl<ProduceOrderMapper, Pro
|
|
|
return contractService.detail(dto);
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ * 产品工艺校验
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public void notTechnologyCheck(Long orderId) {
|
|
|
+ ProductionOrder poById = this.getById(orderId);
|
|
|
+ Assert.notEmpty(poById, "查询不到生产订单信息!");
|
|
|
+
|
|
|
+
|
|
|
+ List<Long> pIds = contractProductService.listObject(ContractProduct::getProductId, q -> q.eq(ContractProduct::getContractId, poById.getContractId()));
|
|
|
+ List<ProductInfo> list = productInfoService.list(q -> q
|
|
|
+ .in(ProductInfo::getId, pIds)
|
|
|
+ .eq(ProductInfo::getCompanyId, poById.getCompanyId())
|
|
|
+ .isNull(ProductInfo::getTechnologyId)
|
|
|
+ );
|
|
|
+
|
|
|
+ if (ObjectUtil.isNotEmpty(list)) {
|
|
|
+ String collect = list.stream().map(item -> {
|
|
|
+ String productName = ObjectUtil.defaultIfNull(item.getName(), "");
|
|
|
+ String productCode = ObjectUtil.defaultIfNull(item.getCustomCode(), "");
|
|
|
+
|
|
|
+ String productLength = ObjectUtil.isNull(item.getLength()) ? "" : item.getLength().toString();
|
|
|
+ String productWidth = ObjectUtil.isNull(item.getWidth()) ? "" : item.getWidth().toString();
|
|
|
+ String productHeight = ObjectUtil.isNull(item.getHeight()) ? "" : item.getHeight().toString();
|
|
|
+
|
|
|
+
|
|
|
+ return StrUtil.format("{}({}[{}*{}*{}])", productName, productCode, productLength, productWidth, productHeight);
|
|
|
+ }).collect(Collectors.joining(","));
|
|
|
+ throw new ServiceException("以下产品未配置工艺线路:" + collect);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
}
|