Lius
2025-03-03 75d26035001d85c12dc3ca93455b0fee477c3f77
lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/MdcEquipmentStatisticalInfoServiceImpl.java
@@ -2,7 +2,6 @@
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import io.swagger.models.auth.In;
import org.apache.commons.lang.StringUtils;
import org.jeecg.common.system.vo.DictModel;
import org.jeecg.modules.mdc.entity.*;
@@ -99,6 +98,26 @@
        return this.baseMapper.findMdcEquipmentStatisticalInfo(equipmentId, date.replaceAll("-", ""));
    }
    @Override
    public BigDecimal computeUtilizationMonth(String productionId, String startDate, String endDate) {
        BigDecimal processLong = this.baseMapper.computeUtilizationMonth(productionId, startDate, endDate);
        if (processLong != null && processLong.compareTo(BigDecimal.ZERO) > 0) {
            return processLong.divide(new BigDecimal("864"), 2, RoundingMode.HALF_UP);
        } else {
            return BigDecimal.ZERO;
        }
    }
    @Override
    public BigDecimal computeUtilizationMonthTotal(String productionId, String startDate, String endDate) {
        BigDecimal processLong = this.baseMapper.computeUtilizationMonthTotal(productionId, startDate, endDate);
        if (processLong != null && processLong.compareTo(BigDecimal.ZERO) > 0) {
            return processLong.divide(new BigDecimal("864"), 2, RoundingMode.HALF_UP);
        } else {
            return BigDecimal.ZERO;
        }
    }
    private List<EquipmentStatisticalInfo> dataHandle(List<MdcEquipmentStatisticalInfo> list) {
        List<EquipmentStatisticalInfo> result = new ArrayList<>();
        list.forEach(item -> {