|
|
|
|
@ -107,10 +107,13 @@ public class CostStatisticsServiceImpl extends BaseServiceImpl<CostStatisticsMap |
|
|
|
|
List<WorkCenter> workCenterList = workCenterService.list(); |
|
|
|
|
//获取总的辅助人员材料费用(剔除成本计算维护的物料)
|
|
|
|
|
BigDecimal assistantMaterialCostSum = baseMapper.getAssistantMaterialCost(month); |
|
|
|
|
//获取所有费用科目
|
|
|
|
|
List<SubjectFeeEntity> subjectFeeList = subjectFeeService.list(Wrappers.<SubjectFeeEntity>lambdaQuery() |
|
|
|
|
.ne(SubjectFeeEntity::getSubjectName,"辅助人员材料费用")); |
|
|
|
|
//辅助人员科目
|
|
|
|
|
for(WorkCenter workCenter : workCenterList){ |
|
|
|
|
//制造费用
|
|
|
|
|
BigDecimal productCost = getProductCost(workCenter,month); |
|
|
|
|
BigDecimal productCost = getProductCost(subjectFeeList,workCenter,month); |
|
|
|
|
//作业中心材料费用(剔除成本计算维护的物料)
|
|
|
|
|
BigDecimal workCenterMaterialCost = baseMapper.getWorkCenterMaterialCost(workCenter.getId(),month); |
|
|
|
|
//作业中心辅助人员材料费用比例
|
|
|
|
|
@ -187,12 +190,10 @@ public class CostStatisticsServiceImpl extends BaseServiceImpl<CostStatisticsMap |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public BigDecimal getProductCost(WorkCenter workCenter, String month){ |
|
|
|
|
public BigDecimal getProductCost(List<SubjectFeeEntity> subjectFeeList,WorkCenter workCenter, String month){ |
|
|
|
|
//【制造费用】=科目费用中除【辅助人员材料费用】外各作业中心的所有费用的总和
|
|
|
|
|
BigDecimal productCost = BigDecimal.ZERO; |
|
|
|
|
List<SubjectFeeEntity> subjectFeeList = subjectFeeService.list(Wrappers.<SubjectFeeEntity>lambdaQuery() |
|
|
|
|
.eq(SubjectFeeEntity::getMonth,month) |
|
|
|
|
.ne(SubjectFeeEntity::getSubjectName,"辅助人员材料费用")); |
|
|
|
|
|
|
|
|
|
if(CollectionUtils.isNotEmpty(subjectFeeList)){ |
|
|
|
|
List<Long> subjectFeeIdList = subjectFeeList.stream().map(BaseEntity::getId).collect(Collectors.toList()); |
|
|
|
|
List<SubjectFeeDetailEntity> subjectFeeDetailList = subjectFeeDetailService.list(Wrappers.<SubjectFeeDetailEntity>lambdaQuery() |
|
|
|
|
|