Lius
2024-08-23 7c7463d2f5012c27ac50f1d2ac39fa09616fc813
update
已添加1个文件
已修改5个文件
102 ■■■■■ 文件已修改
lxzn-module-mdc/src/main/java/org/jeecg/modules/screen/controller/MdcLargeScreenController.java 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
lxzn-module-mdc/src/main/java/org/jeecg/modules/screen/dto/MonthEquipmentUtilizationRateDto.java 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
lxzn-module-mdc/src/main/java/org/jeecg/modules/screen/mapper/MdcLargeScreenMapper.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
lxzn-module-mdc/src/main/java/org/jeecg/modules/screen/mapper/xml/MdcLargeScreenMapper.xml 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
lxzn-module-mdc/src/main/java/org/jeecg/modules/screen/service/MdcLargeScreenService.java 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
lxzn-module-mdc/src/main/java/org/jeecg/modules/screen/service/impl/MdcLargeScreenServiceImpl.java 35 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
lxzn-module-mdc/src/main/java/org/jeecg/modules/screen/controller/MdcLargeScreenController.java
@@ -6,6 +6,7 @@
import org.jeecg.common.api.vo.Result;
import org.jeecg.modules.screen.dto.*;
import org.jeecg.modules.screen.service.MdcLargeScreenService;
import org.jeecg.modules.system.entity.MdcProduction;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@@ -31,7 +32,7 @@
    @ApiOperation(value = "总控看板-今日生产进度", notes = "总控看板-今日生产进度")
    @GetMapping("/todayProductionSchedule")
    public Result<?> todayProductionSchedule() {
        List<TodayProductionDto> result =  mdcLargeScreenService.todayProductionSchedule();
        List<TodayProductionDto> result = mdcLargeScreenService.todayProductionSchedule();
        return Result.ok(result);
    }
@@ -58,6 +59,7 @@
    /**
     * å¼€æœºçŽ‡åˆ©ç”¨çŽ‡
     *
     * @return
     */
    @ApiOperation(value = "总控看板-今日设备工作效率", notes = "总控看板-今日设备工作效率")
@@ -70,8 +72,14 @@
    @ApiOperation(value = "总控看板-月设备利用率", notes = "总控看板-月设备利用率")
    @GetMapping("/monthEquipmentUtilizationRate")
    public Result<?> monthEquipmentUtilizationRate() {
        return Result.ok();
        List<MonthEquipmentUtilizationRateDto> result = mdcLargeScreenService.monthEquipmentUtilizationRate();
        return Result.ok(result);
    }
    @ApiOperation(value = "总控看板-产线列表", notes = "总控看板-产线列表")
    @GetMapping("/productionList")
    public Result<?> productionList() {
        List<MdcProduction> result = mdcLargeScreenService.productionList();
        return Result.ok(result);
    }
}
lxzn-module-mdc/src/main/java/org/jeecg/modules/screen/dto/MonthEquipmentUtilizationRateDto.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,24 @@
package org.jeecg.modules.screen.dto;
import lombok.Data;
import java.math.BigDecimal;
/**
 * @author Lius
 * @date 2024/8/22 17:03
 */
@Data
public class MonthEquipmentUtilizationRateDto {
    /**
     * æ—¥æœŸ
     */
    private String date;
    /**
     * åˆ©ç”¨çއ
     */
    private BigDecimal utilizationRate = BigDecimal.ZERO;
}
lxzn-module-mdc/src/main/java/org/jeecg/modules/screen/mapper/MdcLargeScreenMapper.java
@@ -31,4 +31,5 @@
    List<MdcEfficiencyDto> efficiencyList(@Param("date") String date);
    List<MdcEfficiencyDto> efficiency(@Param("startDate") String startDate, @Param("endDate") String endDate);
}
lxzn-module-mdc/src/main/java/org/jeecg/modules/screen/mapper/xml/MdcLargeScreenMapper.xml
@@ -81,4 +81,18 @@
        WHERE
            t1.the_date = #{date}
    </select>
    <select id="efficiency" resultType="org.jeecg.modules.mdc.dto.MdcEfficiencyDto">
        SELECT
            the_date,
            SUM ( process_long ) process_long
        FROM
            mdc_equipment_statistical_info
        WHERE
            the_date BETWEEN #{startDate} AND #{endDate}
        GROUP BY
            the_date
        ORDER BY
            the_date ASC
    </select>
</mapper>
lxzn-module-mdc/src/main/java/org/jeecg/modules/screen/service/MdcLargeScreenService.java
@@ -1,6 +1,7 @@
package org.jeecg.modules.screen.service;
import org.jeecg.modules.screen.dto.*;
import org.jeecg.modules.system.entity.MdcProduction;
import java.util.List;
import java.util.Map;
@@ -46,4 +47,17 @@
     */
    List<EquipmentRateDto> todayEquipmentRate();
    /**
     * æœˆè®¾å¤‡åˆ©ç”¨çއ
     *
     * @return
     */
    List<MonthEquipmentUtilizationRateDto> monthEquipmentUtilizationRate();
    /**
     * äº§çº¿åˆ—表
     * @return
     */
    List<MdcProduction> productionList();
}
lxzn-module-mdc/src/main/java/org/jeecg/modules/screen/service/impl/MdcLargeScreenServiceImpl.java
@@ -1,5 +1,7 @@
package org.jeecg.modules.screen.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import org.jeecg.common.constant.CommonConstant;
import org.jeecg.modules.mdc.dto.MdcEfficiencyDto;
import org.jeecg.modules.mdc.service.IMdcEquipmentStatisticalInfoService;
import org.jeecg.modules.mdcJc.entity.MdcProductDayschedule;
@@ -7,6 +9,8 @@
import org.jeecg.modules.screen.dto.*;
import org.jeecg.modules.screen.mapper.MdcLargeScreenMapper;
import org.jeecg.modules.screen.service.MdcLargeScreenService;
import org.jeecg.modules.system.entity.MdcProduction;
import org.jeecg.modules.system.service.IMdcProductionService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
@@ -32,6 +36,9 @@
    private final String yesterday = LocalDate.now().plusDays(-1).toString().replaceAll("-", "");
    private final String today = LocalDate.now().toString();
    @Resource
    private IMdcProductionService mdcProductionService;
    /**
@@ -124,4 +131,32 @@
        }
        return result;
    }
    /**
     * æœˆåˆ©ç”¨çއ
     *
     * @return
     */
    @Override
    public List<MonthEquipmentUtilizationRateDto> monthEquipmentUtilizationRate() {
        List<MonthEquipmentUtilizationRateDto> result = new ArrayList<>();
        String startDate = LocalDate.now().plusDays(-32).toString().replaceAll("-", "");
        List<MdcEfficiencyDto> mdcEfficiencyDtoList = mdcLargeScreenMapper.efficiency(startDate, yesterday);
        if (mdcEfficiencyDtoList != null && !mdcEfficiencyDtoList.isEmpty()) {
            for (MdcEfficiencyDto mdcEfficiencyDto : mdcEfficiencyDtoList) {
                MonthEquipmentUtilizationRateDto meu = new MonthEquipmentUtilizationRateDto();
                meu.setDate(new StringBuilder(mdcEfficiencyDto.getTheDate().substring(4, 8)).insert(2, "-").toString());
                BigDecimal equipmentCount = mdcLargeScreenMapper.findEquipmentCount(yesterday);
                meu.setUtilizationRate(mdcEfficiencyDto.getProcessLong().divide(equipmentCount.multiply(new BigDecimal("86400")), 4, RoundingMode.HALF_UP).multiply(new BigDecimal("100")).setScale(2, RoundingMode.HALF_UP));
                result.add(meu);
            }
        }
        return result;
    }
    @Override
    public List<MdcProduction> productionList() {
        return mdcProductionService.list(new LambdaQueryWrapper<MdcProduction>().eq(MdcProduction::getOrgType, "3").eq(MdcProduction::getDelFlag, CommonConstant.DEL_FLAG_0.toString()).orderByAsc(MdcProduction::getProductionOrder));
    }
}