fix: 修复生产驾驶舱工单执行效率分析、生产核算分析、投入产出分析数据不显示问题
| | |
| | | String endStr = endDate.atStartOfDay() |
| | | .format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")); |
| | | |
| | | // List<Map<String, Object>> inputList = productionProductInputMapper.selectInputStats(startStr, endStr); |
| | | List<Map<String, Object>> inputList = null; |
| | | List<Map<String, Object>> inputList = productionProductInputMapper.selectInputStats(startStr, endStr); |
| | | //List<Map<String, Object>> inputList = null; |
| | | List<Map<String, Object>> outputList = productionProductOutputMapper.selectDailyOutputStats(startStr, endStr); |
| | | |
| | | Map<String, InputOutputAnalysisDto> dateMap = new HashMap<>(); |
| | | |
| | | if (!CollectionUtils.isEmpty(inputList)) { |
| | | for (Map<String, Object> map : inputList) { |
| | | String date = (String) map.get("date"); |
| | | String date = (String) map.get("statDate"); |
| | | if (date == null) |
| | | continue; |
| | | InputOutputAnalysisDto dto = dateMap.getOrDefault(date, new InputOutputAnalysisDto()); |
| | |
| | | |
| | | if (!CollectionUtils.isEmpty(outputList)) { |
| | | for (Map<String, Object> map : outputList) { |
| | | String date = (String) map.get("date"); |
| | | String date = (String) map.get("statDate"); |
| | | if (date == null) |
| | | continue; |
| | | InputOutputAnalysisDto dto = dateMap.getOrDefault(date, new InputOutputAnalysisDto()); |
| | |
| | | select date_format(scheduling_date, '%m-%d') as dateStr, |
| | | cast(ifnull(sum(finished_num), 0) as decimal(18,2)) as numberOfCompleted, |
| | | cast(ifnull(sum(work_hours), 0) as decimal(18,2)) as amount, |
| | | cast(0 as decimal(18,2)) as passRate |
| | | cast(sum(ppo.quantity) / sum(ppo.quantity + ppo.scrap_qty) * 100.00 as decimal(18,2)) as passRate |
| | | from production_account |
| | | left join production_product_main ppm on ppm.id = production_account.production_product_main_id |
| | | left join production_product_output ppo on ppo.production_product_main_id = ppm.id |
| | | where scheduling_date >= #{startDate} |
| | | and scheduling_date <= #{endDate} |
| | | group by date_format(scheduling_date, '%m-%d') |
| | |
| | | </where> |
| | | order by ppi.create_time desc |
| | | </select> |
| | | <select id="selectInputStats" resultType="java.util.Map"> |
| | | select DATE_FORMAT(create_time, '%Y-%m-%d') as statDate, |
| | | sum(ifnull(quantity, 0)) as quantity |
| | | # sum(ifnull(scrap_qty, 0)) as scrapQty |
| | | from production_product_input |
| | | where create_time >= #{startDate} |
| | | and create_time <= #{endDate} |
| | | group by DATE_FORMAT(create_time, '%Y-%m-%d') |
| | | order by statDate asc |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | </select> |
| | | |
| | | <select id="selectDailyOutputStats" resultType="java.util.Map"> |
| | | select date(create_time) as statDate, |
| | | select DATE_FORMAT(create_time, '%Y-%m-%d') as statDate, |
| | | sum(ifnull(quantity, 0)) as quantity, |
| | | sum(ifnull(scrap_qty, 0)) as scrapQty |
| | | from production_product_output |
| | | where create_time >= #{startDate} |
| | | and create_time <= #{endDate} |
| | | group by date(create_time) |
| | | group by DATE_FORMAT(create_time, '%Y-%m-%d') |
| | | order by statDate asc |
| | | </select> |
| | | |