| | |
| | | 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; |
| | |
| | | @Resource |
| | | private IMdcShiftSubService mdcShiftSubService; |
| | | |
| | | @Resource |
| | | private MdcShiftMapper mdcShiftMapper; |
| | | |
| | | @Override |
| | | public IPage<MdcShift> queryPageList(Page page, MdcShift mdcShift) { |
| | | LambdaQueryWrapper<MdcShift> lambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | |
| | | if (StringUtils.isEmpty(mdcShift.getShiftStatus())){ |
| | | mdcShift.setShiftStatus("1"); |
| | | } |
| | | mdcShift.setDefaultShift("false"); |
| | | List<MdcShift> mdcShifts = listMdcName(mdcShift); |
| | | //查询有重复数据返回false |
| | | if (null != mdcShifts && !mdcShifts.isEmpty()){ |
| | |
| | | } |
| | | 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; |
| | | } |
| | | } |