| | |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public Boolean addProductMain(ProductionProductMainDto dto) { |
| | | SysUser user = userMapper.selectUserById(dto.getUserId()); |
| | | ProductionProductMain productionProductMain = new ProductionProductMain(); |
| | |
| | | Long modelId = drawMaterial.getProductModelId(); |
| | | BigDecimal reportQty = drawMaterial.getReportQty(); |
| | | |
| | | if (reportQty != null && reportQty.compareTo(new BigDecimal(0)) == 0) { |
| | | throw new RuntimeException("产品" + drawMaterial.getProductName() + "- 型号" + drawMaterial.getModel() + |
| | | "- 批次号=" + drawMaterial.getBatchNo() + "的料已用完,请重新领料"); |
| | | |
| | | } |
| | | |
| | | String key = drawMaterial.getProductModelId() + "_" + |
| | | (drawMaterial.getBatchNo() == null ? "" : drawMaterial.getBatchNo()) + "_" + |
| | | (drawMaterial.getCustomer() == null ? "" : drawMaterial.getCustomer()); |
| | |
| | | order.setDrawMaterials(JSON.toJSONString(existingMaterialList)); |
| | | productOrderMapper.updateById(order); |
| | | } |
| | | }else { |
| | | throw new RuntimeException("请领取投入材料"); |
| | | } |
| | | /*新增报工产出表*/ |
| | | ProductionProductOutput productionProductOutput = new ProductionProductOutput(); |