| | |
| | | import com.ruoyi.staff.mapper.StaffOnJobMapper; |
| | | import com.ruoyi.staff.pojo.StaffOnJob; |
| | | import com.ruoyi.stock.mapper.StockInventoryMapper; |
| | | import com.ruoyi.energy.mapper.EnergyConsumptionDetailMapper; |
| | | import com.ruoyi.energy.mapper.EnergyMapper; |
| | | import com.ruoyi.energy.pojo.Energy; |
| | | import com.ruoyi.energy.dto.EnergyCostDto; |
| | | import com.ruoyi.energy.mapper.EnergyConsumptionDetailMapper; |
| | | import com.ruoyi.energy.vo.EnergyStatisticsVo; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | |
| | | @Autowired |
| | | private SalesDeliveryMapper salesDeliveryMapper; |
| | | |
| | | @Autowired |
| | | private EnergyMapper energyMapper; |
| | | |
| | | |
| | | @Override |
| | | public HomeBusinessDto business() { |
| | |
| | | } |
| | | |
| | | if (!CollectionUtils.isEmpty(costDtos)) { |
| | | // 获取单位 |
| | | List<Energy> energies = energyMapper.selectList(Wrappers.<Energy>lambdaQuery() |
| | | .in(Energy::getEnergyTyep, Arrays.asList("水", "电", "气"))); |
| | | String waterUnit = energies.stream().filter(e -> "水".equals(e.getEnergyTyep())).map(Energy::getUnit).findFirst().orElse(""); |
| | | String electricityUnit = energies.stream().filter(e -> "电".equals(e.getEnergyTyep())).map(Energy::getUnit).findFirst().orElse(""); |
| | | String steamUnit = energies.stream().filter(e -> "气".equals(e.getEnergyTyep())).map(Energy::getUnit).findFirst().orElse(""); |
| | | |
| | | for (EnergyCostDto costDto : costDtos) { |
| | | String dateStr = costDto.getMeterReadingDate(); |
| | | String label = ""; |
| | |
| | | dayDto.setWater(water); |
| | | dayDto.setElectricity(electricity); |
| | | dayDto.setSteam(steam); |
| | | dayDto.setWaterUnit(waterUnit); |
| | | dayDto.setElectricityUnit(electricityUnit); |
| | | dayDto.setSteamUnit(steamUnit); |
| | | } |
| | | } |
| | | } |
| | |
| | | if (CollectionUtils.isEmpty(mainList)) return new ArrayList<>(); |
| | | |
| | | List<Long> mainIds = mainList.stream().map(ProductionProductMain::getId).collect(Collectors.toList()); |
| | | |
| | | |
| | | // 获取投入明细 |
| | | List<ProductionProductInput> allInputs = productionProductInputService.list(Wrappers.<ProductionProductInput>lambdaQuery() |
| | | .in(ProductionProductInput::getProductMainId, mainIds)); |
| | |
| | | |
| | | return result; |
| | | } |
| | | |
| | | @Override |
| | | public Map<String, Long> manage() { |
| | | Map<String, Long> map = new HashMap<>(); |
| | | //生产订单总数 |
| | | Long total = productOrderMapper.selectCount(new QueryWrapper<ProductOrder>().ne("status", 4)); |
| | | map.put("total", total); |
| | | //已完成订单数 |
| | | Long completed = productOrderMapper.selectCount(new QueryWrapper<ProductOrder>().eq("status", 3)); |
| | | map.put("completed", completed); |
| | | //未完成订单数 |
| | | Long uncompleted = productOrderMapper.selectCount(new QueryWrapper<ProductOrder>().eq("status", 1)); |
| | | map.put("uncompleted", uncompleted); |
| | | //部分完成订单数 |
| | | Long partialCompleted = productOrderMapper.selectCount(new QueryWrapper<ProductOrder>().eq("status", 2)); |
| | | map.put("partialCompleted", partialCompleted); |
| | | //来料检总数 |
| | | Long materialInspection = qualityInspectMapper.selectCount(new QueryWrapper<QualityInspect>().eq("inspect_type", 0)); |
| | | map.put("materialInspection", materialInspection); |
| | | return map; |
| | | } |
| | | } |