lius
2023-07-21 36d702002699a2cc06200ad6fa781deab33f343a
lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/MdcShiftServiceImpl.java
@@ -12,7 +12,9 @@
import org.jeecg.modules.mdc.mapper.MdcShiftMapper;
import org.jeecg.modules.mdc.service.IMdcShiftService;
import org.jeecg.modules.mdc.service.IMdcShiftSubService;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
@@ -31,9 +33,6 @@
    @Resource
    private IMdcShiftSubService mdcShiftSubService;
    @Resource
    private MdcShiftMapper mdcShiftMapper;
    @Override
    public IPage<MdcShift> queryPageList(Page page, MdcShift mdcShift) {
@@ -103,4 +102,22 @@
        }
        return result;
    }
    /**
     * 设置默认班制
     *
     * @param id
     * @return
     */
    @Override
    @Transactional(rollbackFor = Exception.class)
    public boolean changeDefaultShift(String id) {
        MdcShift mdcShift = this.baseMapper.selectOne(new LambdaQueryWrapper<MdcShift>().eq(MdcShift::getDefaultShift, "true"));
        mdcShift.setDefaultShift("false");
        this.baseMapper.updateById(mdcShift);
        MdcShift defaultShift = this.baseMapper.selectById(id);
        defaultShift.setDefaultShift("true");
        this.baseMapper.updateById(defaultShift);
        return true;
    }
}