|
@@ -120,6 +120,15 @@ public class ProductionReportingServiceImpl extends ServiceImpl<ProductionReport
|
|
|
Long companyId = SecurityUtils.getCompanyId();
|
|
|
dto.setCompanyId(companyId);
|
|
|
|
|
|
+ //获取工序信息
|
|
|
+ ProductionProcesses productionProcesses = productionProcessesService.getById(productionProcessesId);
|
|
|
+ Assert.notEmpty(productionProcesses, "查询不到工序信息!");
|
|
|
+
|
|
|
+ //赋值价格
|
|
|
+ BigDecimal costPrice = ObjectUtil.defaultIfNull(productionProcesses.getCostPrice(), BigDecimal.ZERO);
|
|
|
+ dto.setPrice(costPrice);
|
|
|
+ dto.setAmount(reportingQuantity.multiply(dto.getPrice()));
|
|
|
+
|
|
|
//保存报工
|
|
|
this.save(dto);
|
|
|
|
|
@@ -136,6 +145,10 @@ public class ProductionReportingServiceImpl extends ServiceImpl<ProductionReport
|
|
|
productionReportingDetail.setQuantity(divide);
|
|
|
productionReportingDetail.setUserId(userId);
|
|
|
productionReportingDetail.setCompanyId(companyId);
|
|
|
+ //单价信息
|
|
|
+ productionReportingDetail.setPrice(dto.getPrice());
|
|
|
+ productionReportingDetail.setAmount(divide.multiply(dto.getPrice()));
|
|
|
+
|
|
|
productionReportingDetailList.add(productionReportingDetail);
|
|
|
}
|
|
|
productionReportingDetailService.saveBatch(productionReportingDetailList);
|