2 小时以前 dd930102c5f6832e8ed52aa76645bd46c38d2f32
修改bug
已修改4个文件
35 ■■■■■ 文件已修改
src/main/java/com/ruoyi/home/controller/HomeController.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/home/service/impl/HomeServiceImpl.java 13 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/production/ProductionProductInputMapper.xml 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/production/ProductionProductOutputMapper.xml 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/home/controller/HomeController.java
@@ -162,15 +162,15 @@
    @GetMapping("/processOutputAnalysis")
    @Operation(summary = "工序产出分析")
    public R processOutputAnalysis(@DefaultType Integer type){
        List<MapDto> list = homeService.processOutputAnalysis(type);
    public R processOutputAnalysis(@DefaultType Integer dateType){
        List<MapDto> list = homeService.processOutputAnalysis(dateType);
        return R.ok(list);
    }
    @GetMapping("/workOrderEfficiencyAnalysis")
    @Operation(summary = "工单执行效率分析")
    public R workOrderEfficiencyAnalysis(@DefaultType Integer type){
        List<WorkOrderEfficiencyDto> list = homeService.workOrderEfficiencyAnalysis(type);
    public R workOrderEfficiencyAnalysis(@DefaultType Integer dateType){
        List<WorkOrderEfficiencyDto> list = homeService.workOrderEfficiencyAnalysis(dateType);
        return R.ok(list);
    }
src/main/java/com/ruoyi/home/service/impl/HomeServiceImpl.java
@@ -1345,17 +1345,17 @@
        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>> 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");
                if (date == null)
                Object dateObj = map.get("date");
                if (dateObj == null)
                    continue;
                String date = dateObj.toString();
                InputOutputAnalysisDto dto = dateMap.getOrDefault(date, new InputOutputAnalysisDto());
                dto.setDate(date);
                BigDecimal qty = (BigDecimal) map.get("quantity");
@@ -1366,9 +1366,10 @@
        if (!CollectionUtils.isEmpty(outputList)) {
            for (Map<String, Object> map : outputList) {
                String date = (String) map.get("date");
                if (date == null)
                Object dateObj = map.get("date");
                if (dateObj == null)
                    continue;
                String date = dateObj.toString();
                InputOutputAnalysisDto dto = dateMap.getOrDefault(date, new InputOutputAnalysisDto());
                dto.setDate(date);
                BigDecimal qty = (BigDecimal) map.get("quantity");
src/main/resources/mapper/production/ProductionProductInputMapper.xml
@@ -43,4 +43,14 @@
        order by ppi.create_time desc
    </select>
    <select id="selectInputStats" resultType="java.util.Map">
        select date(create_time) as date,
               sum(ifnull(input_quantity, 0)) as quantity
        from production_product_input
        where create_time &gt;= #{startDate}
          and create_time &lt;= #{endDate}
        group by date(create_time)
        order by date asc
    </select>
</mapper>
src/main/resources/mapper/production/ProductionProductOutputMapper.xml
@@ -48,14 +48,14 @@
    </select>
    <select id="selectDailyOutputStats" resultType="java.util.Map">
        select date(create_time) as statDate,
        select date(create_time) as date,
               sum(ifnull(quantity, 0)) as quantity,
               sum(ifnull(scrap_qty, 0)) as scrapQty
        from production_product_output
        where create_time &gt;= #{startDate}
          and create_time &lt;= #{endDate}
        group by date(create_time)
        order by statDate asc
        order by date asc
    </select>
</mapper>