Lius
2024-01-26 09e22d89710364548fa896917506a372795a7bd3
lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/MdcPlanCloseServiceImpl.java
@@ -3,13 +3,14 @@
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.jeecg.modules.mdc.constant.MdcConstant;
import org.jeecg.modules.mdc.entity.MdcPlanClose;
import org.jeecg.modules.mdc.mapper.MdcPlanCloseMapper;
import org.jeecg.modules.mdc.service.IMdcPlanCloseService;
import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.util.Collections;
import java.util.Arrays;
import java.util.List;
@@ -25,17 +26,17 @@
    @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, Collections.singletonList(planCloseType)));
        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 "天":
                    case MdcConstant.DAY:
                        result = result.add(actualWorkDayCount.multiply(new BigDecimal(mdcPlanClose.getPlanCloseTimeLong())));
                        break;
                    case "周":
                    case MdcConstant.WEEK:
                        result = result.add(new BigDecimal("4").multiply(new BigDecimal(mdcPlanClose.getPlanCloseTimeLong())));
                        break;
                    case "月":
                    case MdcConstant.MONTH:
                        result = result.add(new BigDecimal(mdcPlanClose.getPlanCloseTimeLong()));
                        break;
                    default: