| | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import org.dromara.common.core.constant.DictConstants; |
| | | import org.dromara.common.core.utils.DateUtils; |
| | | import org.dromara.common.core.utils.MapstructUtils; |
| | | import org.dromara.common.core.utils.StringUtils; |
| | | import org.dromara.common.mybatis.core.page.TableDataInfo; |
| | |
| | | @Override |
| | | public TableDataInfo<EimsInspectStVo> queryPageList(EimsInspectStBo bo, PageQuery pageQuery) { |
| | | bo.setType(bo.getViewMode()); |
| | | // 月视图 |
| | | // if(bo.getViewMode().equals("Month")){ |
| | | QueryWrapper<EimsInspectSt> qw = buildWrapper(bo); |
| | | Page<EimsInspectStVo> result = baseMapper.selectInspStList(pageQuery.build(), qw); |
| | | // 填充数据 |
| | | fillStData(result,bo.getViewMode()); |
| | | return TableDataInfo.build(result); |
| | | // 日视图 |
| | | // }else if(bo.getViewMode().equals("Day")){ |
| | | // Page<EimsInspectStVo> result = recordMapper.selectInspRecordDayList(pageQuery.build(), buildGroupWrapper(bo)); |
| | | // return TableDataInfo.build(result); |
| | | // } |
| | | |
| | | // return null; |
| | | } |
| | | |
| | | /** |
| | |
| | | qw.like(StringUtils.isNotBlank(bo.getTitle()), "st.title", bo.getTitle()); |
| | | qw.like(StringUtils.isNotBlank(bo.getEquName()), "equ.equ_name", bo.getEquName()); |
| | | qw.like(StringUtils.isNotBlank(bo.getAssetNo()), "equ.asset_no", bo.getAssetNo()); |
| | | if(bo.getPlanTime()!=null&&bo.getViewMode() != null && bo.getViewMode().equals("Day")){ |
| | | qw.eq("DATE_FORMAT(st.plan_time, '%Y-%m-%d')", DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD,bo.getPlanTime())); |
| | | }else if(bo.getPlanTime()!=null&&bo.getViewMode() != null && bo.getViewMode().equals("Month")){ |
| | | qw.eq("DATE_FORMAT(st.plan_time, '%Y-%m')", DateUtils.parseDateToStr(DateUtils.YYYY_MM,bo.getPlanTime())); |
| | | } |
| | | 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()); |
| | | qw.eq(bo.getUpdateBy() != null, "st.update_by", bo.getUpdateBy()); |
| | | qw.orderByDesc( "st.create_time"); |
| | | return qw; |
| | | } |
| | |
| | | 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; |
| | | } |