| | |
| | | import com.project.common.exception.base.BaseException; |
| | | import com.project.common.utils.SecurityUtils; |
| | | import com.project.common.utils.StringUtils; |
| | | import com.project.common.vo.KeyVal; |
| | | import com.project.enforce.domain.EnforceOrder; |
| | | import com.project.enforce.domain.bo.editBo.EnforceOrderBo; |
| | | import com.project.enforce.domain.bo.queryBo.EnforceOrderQueryBo; |
| | |
| | | public class EnforceOrderServiceImpl extends ServiceImpl<EnforceOrderMapper, EnforceOrder> implements IEnforceOrderService { |
| | | |
| | | private final ISysDeptService deptService; |
| | | private final EnforceOrderMapper orderMapper; |
| | | |
| | | |
| | | @Override//列表查询 |
| | |
| | | public List<EnforceOrderVo> queryCheckList(EnforceOrderQueryBo bo) |
| | | { |
| | | SysUser loginUser = SecurityUtils.getLoginUser().getUser(); |
| | | if (!"01".equals(loginUser.getUserType())) { |
| | | throw new BaseException("您没有审批权限,请重试!"); |
| | | if (bo.getIsCheckQuery()!=null && bo.getIsCheckQuery()==1){ |
| | | List<String> roleKeys = loginUser.getRoles().stream().map(SysRole::getRoleKey).collect(Collectors.toList()); |
| | | if (roleKeys.contains(CheckLevelCodeConstants.CHECK_LEVEL_ONE) && roleKeys.contains(CheckLevelCodeConstants.CHECK_LEVEL_TWO)){ |
| | | bo.setCheckLevel(null); |
| | | } else if (roleKeys.contains(CheckLevelCodeConstants.CHECK_LEVEL_ONE)){ |
| | | bo.setCheckLevel(0); |
| | | } else if (roleKeys.contains(CheckLevelCodeConstants.CHECK_LEVEL_TWO)) { |
| | | bo.setCheckLevel(1); |
| | | } else { |
| | | throw new BaseException("您没有审批权限,请重试!"); |
| | | } |
| | | } |
| | | List<String> roleKeys = loginUser.getRoles().stream().map(SysRole::getRoleKey).collect(Collectors.toList()); |
| | | if (roleKeys.contains(CheckLevelCodeConstants.CHECK_LEVEL_ONE) && roleKeys.contains(CheckLevelCodeConstants.CHECK_LEVEL_TWO)){ |
| | | bo.setCheckLevel(null); |
| | | } else if (roleKeys.contains(CheckLevelCodeConstants.CHECK_LEVEL_ONE)){ |
| | | bo.setCheckLevel(0); |
| | | } else if (roleKeys.contains(CheckLevelCodeConstants.CHECK_LEVEL_TWO)) { |
| | | bo.setCheckLevel(1); |
| | | } else { |
| | | throw new BaseException("您没有审批权限,请重试!"); |
| | | } |
| | | |
| | | bo.setCheckDeptId(deptService.getCheckDeptIdByLoginDeptId(loginUser.getDeptId())); |
| | | bo.setApplyDeptIds(deptService.getApplyDeptIdsByLoginUserId(loginUser.getUserId())); |
| | | |
| | | return this.baseMapper.selectCheckList(bo); |
| | | } |
| | | |
| | | @Override//信息公式列表 |
| | | public List<EnforceOrderVo> showList() |
| | | { |
| | | List<EnforceOrder> list = this.list(lq().eq(EnforceOrder::getIsShow, 1)); |
| | | return Convert.toList(EnforceOrderVo.class, list); |
| | | } |
| | | |
| | | @Override//id查询 |
| | |
| | | return this.removeByIds(ids); |
| | | } |
| | | |
| | | @Override//月度分布 |
| | | public List<KeyVal> getMonthCount(Long deptId) { |
| | | return orderMapper.getMonthCount(deptId); |
| | | } |
| | | |
| | | @Override//部门分布 |
| | | public List<KeyVal> getDeptCount(String yearMonth) |
| | | { |
| | | return orderMapper.getDeptCount(yearMonth); |
| | | } |
| | | |
| | | |
| | | //------------------------------------------------------------------------------------- |
| | | |
| | |
| | | qw.eq(StringUtils.isNotEmpty(bo.getRegionCode()), "region_code", bo.getRegionCode()); |
| | | qw.like(StringUtils.isNotEmpty(bo.getRegionName()), "region_name", bo.getRegionName()); |
| | | qw.eq(StringUtils.isNotEmpty(bo.getEnforceReason()), "enforce_reason", bo.getEnforceReason()); |
| | | qw.eq(StringUtils.isNotEmpty(bo.getEnforceType()), "enforce_type", bo.getEnforceType()); |
| | | qw.eq(bo.getApplyId() != null, "apply_id", bo.getApplyId()); |
| | | qw.eq(StringUtils.isNotEmpty(bo.getApplyUser()), "apply_user", bo.getApplyUser()); |
| | | qw.eq(StringUtils.isNotEmpty(bo.getApplyPhone()), "apply_phone", bo.getApplyPhone()); |