|
|
@ -84,23 +84,52 @@ public class ScmVehiclePatrolinspectionService extends MybatisBaseService<ScmVeh |
|
|
|
ScmVehiclePatrolinspectionQuery query = pq.getParams(); |
|
|
|
QueryWrapper<ScmVehiclePatrolinspection> qw = new QueryWrapper<>(); |
|
|
|
qw.eq("createOrgSid", query.getCreateOrgSid()); |
|
|
|
if (StringUtils.isNotBlank(query.getMainSid())) { |
|
|
|
qw.like("mainSid", query.getMainSid()); |
|
|
|
if (StringUtils.isNotBlank(query.getVinNo())) { |
|
|
|
qw.like("vinNo", query.getVinNo()); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(query.getLocationSid())) { |
|
|
|
qw.like("locationSid", query.getLocationSid()); |
|
|
|
qw.eq("locationSid", query.getLocationSid()); |
|
|
|
} |
|
|
|
String patrolInspectionStartDate = query.getPatrolInspectionStartDate(); |
|
|
|
String patrolInspectionEndDate = query.getPatrolInspectionEndDate(); |
|
|
|
qw.apply(StringUtils.isNotEmpty(patrolInspectionStartDate), "date_format (patrolInspectionDate,'%Y-%m-%d') >= date_format('" + patrolInspectionStartDate + "','%Y-%m-%d')"). |
|
|
|
apply(StringUtils.isNotEmpty(patrolInspectionEndDate), "date_format (patrolInspectionDate,'%Y-%m-%d') <= date_format('" + patrolInspectionEndDate + "','%Y-%m-%d')" |
|
|
|
); |
|
|
|
qw.ne("patrolInspectionStateKey",""); |
|
|
|
IPage<ScmVehiclePatrolinspection> page = PagerUtil.queryToPage(pq); |
|
|
|
IPage<ScmVehiclePatrolinspectionVo> pagging = baseMapper.selectPageVo(page, qw); |
|
|
|
PagerVo<ScmVehiclePatrolinspectionVo> p = PagerUtil.pageToVo(pagging, null); |
|
|
|
return p; |
|
|
|
} |
|
|
|
|
|
|
|
public PagerVo<ScmVehiclePatrolinspectionVo> stayListPage(PagerQuery<ScmVehiclePatrolinspectionQuery> pq) { |
|
|
|
ScmVehiclePatrolinspectionQuery query = pq.getParams(); |
|
|
|
QueryWrapper<ScmVehiclePatrolinspection> qw = new QueryWrapper<>(); |
|
|
|
qw.eq("createOrgSid", query.getCreateOrgSid()); |
|
|
|
if (StringUtils.isNotBlank(query.getVinNo())) { |
|
|
|
qw.like("vinNo", query.getVinNo()); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(query.getLocationSid())) { |
|
|
|
qw.eq("locationSid", query.getLocationSid()); |
|
|
|
} |
|
|
|
qw.eq("patrolInspectionStateKey",""); |
|
|
|
IPage<ScmVehiclePatrolinspection> page = PagerUtil.queryToPage(pq); |
|
|
|
IPage<ScmVehiclePatrolinspectionVo> pagging = baseMapper.selectPageVo(page, qw); |
|
|
|
for (ScmVehiclePatrolinspectionVo record : pagging.getRecords()) { |
|
|
|
String vinNo = record.getVinNo(); |
|
|
|
String id = record.getId(); |
|
|
|
String createOrgSid = record.getCreateOrgSid(); |
|
|
|
List<ScmVehicleStayPatrolinspectionVo> scmVehicleStayPatrolinspectionVos = baseMapper.selPatrolinspection(vinNo, id, createOrgSid); |
|
|
|
if (scmVehicleStayPatrolinspectionVos.size() > 0){ |
|
|
|
ScmVehicleStayPatrolinspectionVo scmVehicleStayPatrolinspectionVo = scmVehicleStayPatrolinspectionVos.get(0); |
|
|
|
record.setPatrolInspectionName(scmVehicleStayPatrolinspectionVo.getPatrolInspectionName()); |
|
|
|
record.setPatrolInspectionDate(scmVehicleStayPatrolinspectionVo.getPatrolInspectionDate()); |
|
|
|
} |
|
|
|
} |
|
|
|
PagerVo<ScmVehiclePatrolinspectionVo> p = PagerUtil.pageToVo(pagging, null); |
|
|
|
return p; |
|
|
|
} |
|
|
|
|
|
|
|
public void saveOrUpdateDto(ScmVehiclePatrolinspectionDto dto) { |
|
|
|
String dtoSid = dto.getSid(); |
|
|
|
if (StringUtils.isBlank(dtoSid)) { |
|
|
@ -262,4 +291,5 @@ public class ScmVehiclePatrolinspectionService extends MybatisBaseService<ScmVeh |
|
|
|
public List<AppVinAndRemarksVo> getMonthRemarksByMainSid(String sid, String stateKey) { |
|
|
|
return baseMapper.getMonthRemarksByMainSid(sid, stateKey); |
|
|
|
} |
|
|
|
|
|
|
|
} |