| | |
| | | } |
| | | List<ProductionAccount> accountList = defaultList(productionAccountMapper.selectList(accountWrapper)); |
| | | |
| | | Map<String, BigDecimal> salaryQuotaByOperation = defaultList(technologyOperationMapper.selectList(new LambdaQueryWrapper<TechnologyOperation>() |
| | | .select(TechnologyOperation::getName, TechnologyOperation::getSalaryQuota))) |
| | | .stream() |
| | | .filter(item -> StringUtils.hasText(item.getName())) |
| | | .collect(Collectors.toMap(TechnologyOperation::getName, item -> defaultDecimal(item.getSalaryQuota()), (a, b) -> a)); |
| | | // 工资定额已取消在薪资相关计算中的依赖,暂不再按工序工资定额估算人工成本。 |
| | | Map<String, BigDecimal> salaryQuotaByOperation = new HashMap<>(); |
| | | |
| | | Map<Long, BigDecimal> laborCostByLedger = new HashMap<>(); |
| | | Map<String, BigDecimal> processCostMap = new HashMap<>(); |
| | |
| | | } |
| | | |
| | | private BigDecimal estimateLaborCost(ProductionAccount account, Map<String, BigDecimal> salaryQuotaByOperation) { |
| | | BigDecimal salaryQuota = salaryQuotaByOperation.getOrDefault(safe(account.getTechnologyOperationName()), BigDecimal.ZERO); |
| | | // BigDecimal salaryQuota = salaryQuotaByOperation.getOrDefault(safe(account.getTechnologyOperationName()), BigDecimal.ZERO); |
| | | BigDecimal finishedNum = defaultDecimal(account.getFinishedNum()); |
| | | BigDecimal workHours = defaultDecimal(account.getWorkHours()); |
| | | if (salaryQuota.compareTo(BigDecimal.ZERO) > 0 && finishedNum.compareTo(BigDecimal.ZERO) > 0) { |
| | | return finishedNum.multiply(salaryQuota); |
| | | } |
| | | if (salaryQuota.compareTo(BigDecimal.ZERO) > 0 && workHours.compareTo(BigDecimal.ZERO) > 0) { |
| | | return workHours.multiply(salaryQuota); |
| | | } |
| | | // if (salaryQuota.compareTo(BigDecimal.ZERO) > 0 && finishedNum.compareTo(BigDecimal.ZERO) > 0) { |
| | | // return finishedNum.multiply(salaryQuota); |
| | | // } |
| | | // if (salaryQuota.compareTo(BigDecimal.ZERO) > 0 && workHours.compareTo(BigDecimal.ZERO) > 0) { |
| | | // return workHours.multiply(salaryQuota); |
| | | // } |
| | | if (workHours.compareTo(BigDecimal.ZERO) > 0) { |
| | | return workHours; |
| | | } |