Lius
2024-12-17 2d727903343feb01fedc988370091395c368faf2
lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/MdcPlanCloseServiceImpl.java
@@ -165,28 +165,21 @@
        return mv;
    }
    /**
     * 计算 计划/非计划停机当天总时长
     * @param equipmentId
     * @param validDate
     * @param closeType
     * @return
     */
    @Override
    public BigDecimal findPlanTimeDuration(BigDecimal actualWorkDayCount, String planCloseType) {
        BigDecimal result = new BigDecimal("0");
//        List<MdcPlanClose> mdcPlanCloses = this.baseMapper.selectList(new LambdaQueryWrapper<MdcPlanClose>().in(MdcPlanClose::getPlanCloseType, Arrays.asList(planCloseType.split(","))));
//        if (mdcPlanCloses != null && !mdcPlanCloses.isEmpty()) {
//            for (MdcPlanClose mdcPlanClose : mdcPlanCloses) {
//                switch (mdcPlanClose.getPlanCloseTimeType()) {
//                    case MdcConstant.DAY:
//                        result = result.add(actualWorkDayCount.multiply(new BigDecimal(mdcPlanClose.getPlanCloseTimeLong())));
//                        break;
//                    case MdcConstant.WEEK:
//                        result = result.add(new BigDecimal("4").multiply(new BigDecimal(mdcPlanClose.getPlanCloseTimeLong())));
//                        break;
//                    case MdcConstant.MONTH:
//                        result = result.add(new BigDecimal(mdcPlanClose.getPlanCloseTimeLong()));
//                        break;
//                    default:
//                        break;
//                }
//            }
//        }
        return result;
    public Integer findPlanTimeDuration(String equipmentId, String validDate, String closeType) {
        Integer planTimeDuration = this.baseMapper.findPlanTimeDuration(equipmentId, validDate, closeType);
        if (planTimeDuration == null) {
            return 0;
        } else {
            return planTimeDuration;
        }
    }
}