feat(eims): 添加未完成维修工单数量查询功能,优化搜索设备、保养、点检、维修查询,增加关键字模糊查询
| | |
| | | return eimsRepairResService.queryPageListCustom(bo, pageQuery); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 查询未完成的维修工单数量 |
| | | * |
| | | */ |
| | | @SaCheckPermission("eims:repairRes:list") |
| | | @GetMapping("/list/unfinished") |
| | | public R<Integer> listUnfinished(String status) { |
| | | Integer num = eimsRepairResService.listUnfinished(status); |
| | | return R.ok("操作成功", num); |
| | | } |
| | | /** |
| | | * 导出维修工单列表 |
| | | */ |
| | |
| | | import org.dromara.eims.domain.EimsRepairRes; |
| | | import org.dromara.eims.domain.vo.EimsRepairResVo; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 维修工单Mapper接口 |
| | | * |
| | |
| | | public interface EimsRepairResMapper extends BaseMapperPlus<EimsRepairRes, EimsRepairResVo> { |
| | | Page<EimsRepairResVo> selectRepairResList(@Param("page") Page<EimsRepairResVo> page, @Param(Constants.WRAPPER) Wrapper<EimsRepairRes> queryWrapper); |
| | | |
| | | Integer listUnfinished(List<String> list); |
| | | } |
| | |
| | | package org.dromara.eims.service; |
| | | |
| | | import org.dromara.eims.domain.bo.EimsRepairReqBo; |
| | | import org.dromara.eims.domain.vo.EimsRepairReqVo; |
| | | import org.dromara.eims.domain.vo.EimsRepairResVo; |
| | | import org.dromara.eims.domain.bo.EimsRepairResBo; |
| | | import org.dromara.common.mybatis.core.page.TableDataInfo; |
| | |
| | | Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid); |
| | | |
| | | |
| | | Integer listUnfinished(String status); |
| | | |
| | | /** |
| | | * 分页查询维修工单列表-多表查询 |
| | | * |
| | |
| | | @Override |
| | | public EimsEquVo queryByAssetNo(String assetNo) { |
| | | LambdaQueryWrapper<EimsEqu> lqw = new LambdaQueryWrapper<>(); |
| | | lqw.eq(EimsEqu::getAssetNo, assetNo); |
| | | lqw.eq(EimsEqu::getAssetNo, assetNo.trim()); |
| | | EimsEquVo eimsEquVo = baseMapper.selectVoOne(lqw); |
| | | return eimsEquVo; |
| | | } |
| | |
| | | List<Long> allDescendantIds = getAllDescendantIds(equTypeId); |
| | | lqw.in(EimsEqu::getEquTypeId, allDescendantIds); |
| | | } |
| | | if (params.get("searchValue") != null && StringUtils.isNotBlank(params.get("searchValue").toString())) { |
| | | // 如果搜索值不为空,则按设备名称、资产编号进行模糊查询 |
| | | lqw.and(wrapper -> { |
| | | wrapper.like(EimsEqu::getEquName, params.get("searchValue")) |
| | | .or() |
| | | .like(EimsEqu::getAssetNo, params.get("searchValue")); |
| | | }); |
| | | } |
| | | |
| | | lqw.like(StringUtils.isNotBlank(bo.getEquName()), EimsEqu::getEquName, bo.getEquName()); |
| | | lqw.eq(StringUtils.isNotBlank(bo.getModelNo()), EimsEqu::getModelNo, bo.getModelNo()); |
| | |
| | | qw.like(StringUtils.isNotBlank(bo.getInspName()),"ir.insp_name", bo.getInspName()); |
| | | qw.like(bo.getEquName() != null, "equ.equ_name", bo.getEquName()); |
| | | qw.like(bo.getAssetNo() != null, "equ.asset_no", bo.getAssetNo()); |
| | | if (params.get("searchValue") != null && StringUtils.isNotBlank(params.get("searchValue").toString())) { |
| | | qw.and(wq -> wq.like("equ.equ_name", params.get("searchValue")) |
| | | .or().like("equ.asset_no", params.get("searchValue")) |
| | | ); |
| | | } |
| | | qw.like(bo.getEquId() != null, "equ.equ_id", bo.getEquId()); |
| | | qw.eq(StringUtils.isNotBlank(bo.getInspType()), "ir.insp_type", bo.getInspType()); |
| | | qw.eq(bo.getInspUser() != null, "ir.insp_user", bo.getInspUser()); |
| | |
| | | |
| | | @Override |
| | | public Boolean updateBatchByBo(InspectRecordBo bo) { |
| | | LoginUser loginUser = LoginHelper.getLoginUser(); |
| | | // LoginUser loginUser = LoginHelper.getLoginUser(); |
| | | List<EimsInspectRecord> inspRecordList = MapstructUtils.convert(bo.getInspRecordList(), EimsInspectRecord.class); |
| | | inspRecordList.forEach(item->{ |
| | | // 更新为已点检 |
| | | item.setStatus(DictConstants.EIMS_INSPECT_STATUS_DETAIL.Y); |
| | | item.setInspTime(new Date()); |
| | | item.setInspUser(loginUser.getUserId()); |
| | | // item.setInspTime(new Date()); |
| | | // item.setInspUser(loginUser.getUserId()); |
| | | }); |
| | | return baseMapper.updateBatchById(inspRecordList); |
| | | } |
| | |
| | | qw.eq( "st.type", bo.getType()); |
| | | qw.between(params.get("beginPlanTime") != null && params.get("endPlanTime") != null, |
| | | "st.plan_time", params.get("beginPlanTime"), params.get("endPlanTime")); |
| | | if (params.get("searchValue") != null && StringUtils.isNotBlank(params.get("searchValue").toString())) { |
| | | qw.and(wq -> wq.like("st.title", params.get("searchValue")) |
| | | .or().like("equ.equ_name", params.get("searchValue")) |
| | | .or().like("equ.asset_no", params.get("searchValue")) |
| | | ); |
| | | } |
| | | qw.eq(bo.getInspUser() != null, "st.maint_user", bo.getInspUser()); |
| | | qw.eq(bo.getVerifyUser() != null, "st.verify_user", bo.getVerifyUser()); |
| | | qw.eq(bo.getStatus() != null, "st.status", bo.getStatus()); |
| | |
| | | public Boolean updateByBo(EimsInspectStBo bo) { |
| | | EimsInspectSt update = MapstructUtils.convert(bo, EimsInspectSt.class); |
| | | |
| | | if(bo.getVerifyUser()!=null){ |
| | | EimsInspectSt st = baseMapper.selectById(bo.getId()); |
| | | String status = st.getStatus(); |
| | | if(status==null || status.equals(DictConstants.MAINT_ORDER_ST_STATUS_DETAIL.N)){ |
| | | if(update.getVerifyTime()==null) update.setStatus(DictConstants.MAINT_ORDER_ST_STATUS_DETAIL.Y); |
| | | if(update.getVerifyTime()==null) update.setVerifyTime(new Date()); |
| | | } |
| | | } |
| | | // if(bo.getVerifyUser()!=null){ |
| | | // EimsInspectSt st = baseMapper.selectById(bo.getId()); |
| | | // String status = st.getStatus(); |
| | | // if(status==null || status.equals(DictConstants.MAINT_ORDER_ST_STATUS_DETAIL.N)){ |
| | | // if(update.getVerifyTime()==null) update.setStatus(DictConstants.MAINT_ORDER_ST_STATUS_DETAIL.Y); |
| | | // if(update.getVerifyTime()==null) update.setVerifyTime(new Date()); |
| | | // } |
| | | // } |
| | | validEntityBeforeSave(update); |
| | | return baseMapper.updateById(update) > 0; |
| | | } |
| | |
| | | qw.like(StringUtils.isNotBlank(bo.getAssetNo()), "equ.asset_no", bo.getAssetNo()); |
| | | qw.between(params.get("beginPlanTime") != null && params.get("endPlanTime") != null, |
| | | "st.plan_time", params.get("beginPlanTime"), params.get("endPlanTime")); |
| | | if (params.get("searchValue") != null && StringUtils.isNotBlank(params.get("searchValue").toString())) { |
| | | qw.and( wq ->wq.like("st.title", params.get("searchValue")) |
| | | .or().like("equ.equ_name", params.get("searchValue")) |
| | | .or().like("equ.asset_no", params.get("searchValue")) |
| | | ); |
| | | } |
| | | qw.eq(bo.getMaintUser() != null, "st.maint_user", bo.getMaintUser()); |
| | | qw.eq(bo.getVerifyUser() != null, "st.verify_user", bo.getVerifyUser()); |
| | | qw.eq(bo.getStatus() != null, "st.status", bo.getStatus()); |
| | |
| | | qw.eq(StringUtils.isNotBlank(bo.getFaultType()), "a,fault_type", bo.getFaultType()); |
| | | qw.in(params.containsKey("createBy"), "a.create_by", (List<Long>) params.get("createBy")); |
| | | Object status = params.get("status") == null ? "" : params.get("status"); |
| | | |
| | | if (params.get("searchValue") != null && StringUtils.isNotBlank(params.get("searchValue").toString())) { |
| | | qw.and( wq ->wq.like("b.equ_name", params.get("searchValue")) |
| | | .or().like("b.asset_no", params.get("searchValue")) |
| | | ); |
| | | } |
| | | String[] split = status.toString().split(","); |
| | | qw.in(params.containsKey("status"), "a.status", split); |
| | | qw.between(params.get("beginReqTime") != null && params.get("endReqTime") != null, |
| | |
| | | import org.dromara.system.domain.SysDept; |
| | | import org.dromara.system.domain.vo.SysDeptVo; |
| | | import org.dromara.system.mapper.SysDeptMapper; |
| | | import org.redisson.misc.LogHelper; |
| | | import org.springframework.stereotype.Service; |
| | | import org.dromara.eims.domain.bo.EimsRepairResBo; |
| | | import org.dromara.eims.service.IEimsRepairResService; |
| | |
| | | return TableDataInfo.build(page); |
| | | } |
| | | |
| | | @Override |
| | | public Integer listUnfinished(String status) { |
| | | // 根据工单状态查询总数 |
| | | if (!status.isEmpty()) { |
| | | List<String> statusList = Arrays.asList(status.split(",")); |
| | | return baseMapper.listUnfinished(statusList); |
| | | } |
| | | return 0; |
| | | } |
| | | |
| | | private QueryWrapper<EimsRepairRes> buildWrapper(EimsRepairResBo bo) { |
| | | Map<String, Object> params = bo.getParams(); |
| | | QueryWrapper<EimsRepairRes> qw = Wrappers.query(); |
| | |
| | | |
| | | List<Long> reqDeptIds = getAllDescendantIds(bo.getReqDept()); |
| | | qw.in(bo.getReqDept() != null, "res.req_dept", reqDeptIds); |
| | | |
| | | if (params.get("searchValue") != null && StringUtils.isNotBlank(params.get("searchValue").toString())) { |
| | | qw.and( wq ->wq.like("equ.equ_name", params.get("searchValue")) |
| | | .or().like("equ.asset_no", params.get("searchValue")) |
| | | ); |
| | | } |
| | | |
| | | qw.eq(StringUtils.isNotBlank(bo.getStatus()), "res.status", bo.getStatus()); |
| | | String s = params.get("status") == null ? "" : params.get("status").toString(); |
| | |
| | | LEFT JOIN sys_user usr ON req.req_user = usr.user_id |
| | | ${ew.getCustomSqlSegment} |
| | | </select> |
| | | <select id="listUnfinished" resultType="java.lang.Integer"> |
| | | SELECT COUNT(1) |
| | | FROM eims_repair_res |
| | | WHERE status in |
| | | <foreach item="item" collection="list" separator="," open="(" close=")" index=""> |
| | | #{item} |
| | | </foreach> |
| | | </select> |
| | | |
| | | </mapper> |