|
|
|
@ -117,8 +117,8 @@ public class CostStatisticsServiceImpl extends BaseServiceImpl<CostStatisticsMap |
|
|
|
BigDecimal erpWorkCenterMaterialCost = BigDecimal.ZERO; |
|
|
|
BigDecimal erpWorkCenterMaterialCost = BigDecimal.ZERO; |
|
|
|
BigDecimal assistantMaterialCost = BigDecimal.ZERO; |
|
|
|
BigDecimal assistantMaterialCost = BigDecimal.ZERO; |
|
|
|
//查询成分配置人员
|
|
|
|
//查询成分配置人员
|
|
|
|
CostCalculationEmployeeEntity costCalculationEmployee = costCalculationEmployeeService.getOne(Wrappers.<CostCalculationEmployeeEntity>lambdaQuery().eq(CostCalculationEmployeeEntity::getWorkCenterId,workCenter.getId())); |
|
|
|
List<CostCalculationEmployeeEntity> costCalculationEmployeeList = costCalculationEmployeeService.list(Wrappers.<CostCalculationEmployeeEntity>lambdaQuery().eq(CostCalculationEmployeeEntity::getWorkCenterId,workCenter.getId())); |
|
|
|
if(costCalculationEmployee == null){ |
|
|
|
if(CollectionUtils.isEmpty(costCalculationEmployeeList)){ |
|
|
|
//作业中心材料费用(剔除成本计算维护的物料)
|
|
|
|
//作业中心材料费用(剔除成本计算维护的物料)
|
|
|
|
workCenterMaterialCost = baseMapper.getWorkCenterMaterialCost(workCenter.getId(),month); |
|
|
|
workCenterMaterialCost = baseMapper.getWorkCenterMaterialCost(workCenter.getId(),month); |
|
|
|
//费用科目中维护的作业中心材料费用
|
|
|
|
//费用科目中维护的作业中心材料费用
|
|
|
|
@ -130,11 +130,12 @@ public class CostStatisticsServiceImpl extends BaseServiceImpl<CostStatisticsMap |
|
|
|
//材料费用
|
|
|
|
//材料费用
|
|
|
|
materialCost = workCenterMaterialCost.add(assistantMaterialCost).add(erpWorkCenterMaterialCost); |
|
|
|
materialCost = workCenterMaterialCost.add(assistantMaterialCost).add(erpWorkCenterMaterialCost); |
|
|
|
}else{ |
|
|
|
}else{ |
|
|
|
|
|
|
|
List<String> userCodeList = costCalculationEmployeeList.stream().map(CostCalculationEmployeeEntity::getEmployeeCode).collect(Collectors.toList()); |
|
|
|
//作业中心材料费用(剔除成本计算维护的物料)
|
|
|
|
//作业中心材料费用(剔除成本计算维护的物料)
|
|
|
|
workCenterMaterialCost = baseMapper.getWorkCenterMaterialCostByUser(costCalculationEmployee.getEmployeeCode(),month); |
|
|
|
workCenterMaterialCost = baseMapper.getWorkCenterMaterialCostByUser(userCodeList,month); |
|
|
|
//费用科目中维护的作业中心材料费用
|
|
|
|
//费用科目中维护的作业中心材料费用
|
|
|
|
erpWorkCenterMaterialCost = getMaterialCost(subjectFeeList,workCenter,month); |
|
|
|
erpWorkCenterMaterialCost = getMaterialCost(subjectFeeList,workCenter,month); |
|
|
|
assistantMaterialCost = baseMapper.getAssistantMaterialCostByUser(costCalculationEmployee.getEmployeeCode(),month); |
|
|
|
assistantMaterialCost = baseMapper.getAssistantMaterialCostByUser(userCodeList,month); |
|
|
|
//材料费用
|
|
|
|
//材料费用
|
|
|
|
materialCost = workCenterMaterialCost.add(assistantMaterialCost).add(erpWorkCenterMaterialCost); |
|
|
|
materialCost = workCenterMaterialCost.add(assistantMaterialCost).add(erpWorkCenterMaterialCost); |
|
|
|
} |
|
|
|
} |
|
|
|
|