|
|
@@ -16,6 +16,7 @@ import com.usky.fire.mapper.PatrolInspectionPlanSonMapper;
|
|
|
import com.usky.fire.service.*;
|
|
|
import com.usky.common.mybatis.core.AbstractCrudService;
|
|
|
import com.usky.fire.service.vo.ContentOptionVo;
|
|
|
+import com.usky.fire.service.vo.PatrolInspectionAbnormalExportVo;
|
|
|
import com.usky.fire.service.vo.PatrolInspectionAbnormalVo;
|
|
|
import com.usky.fire.service.vo.PatrolInspectionContentVo;
|
|
|
import com.usky.fire.service.vo.PatrolInspectionRecordVo;
|
|
|
@@ -307,4 +308,50 @@ public class PatrolInspectionAbnormalServiceImpl extends AbstractCrudService<Pat
|
|
|
}
|
|
|
return list;
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public List<PatrolInspectionAbnormalExportVo> abnormalListExport(String areaName, String siteName, String name,
|
|
|
+ Integer planType, Integer routeId,
|
|
|
+ String startDateTime, String endDateTime) {
|
|
|
+ DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
|
|
+ LoginUser loginUser = SecurityUtils.getLoginUser();
|
|
|
+ String userType = null;
|
|
|
+ if (loginUser != null && !"".equals(loginUser)) {
|
|
|
+ userType = loginUser.getUserType();
|
|
|
+ }
|
|
|
+ LambdaQueryWrapper<PatrolInspectionAbnormal> queryWrapper = Wrappers.lambdaQuery();
|
|
|
+ queryWrapper.eq(PatrolInspectionAbnormal::getTenantId, SecurityUtils.getTenantId())
|
|
|
+ .like(StringUtils.isNotBlank(areaName), PatrolInspectionAbnormal::getAreaName, areaName)
|
|
|
+ .like(StringUtils.isNotBlank(siteName), PatrolInspectionAbnormal::getSiteName, siteName)
|
|
|
+ .like(StringUtils.isNotBlank(name), PatrolInspectionAbnormal::getName, name)
|
|
|
+ .eq(planType != null && planType != 0, PatrolInspectionAbnormal::getPlanType, planType)
|
|
|
+ .eq(routeId != null, PatrolInspectionAbnormal::getRouteId, routeId)
|
|
|
+ .between(StringUtils.isNotBlank(startDateTime) && StringUtils.isNotBlank(endDateTime), PatrolInspectionAbnormal::getCreateTime, startDateTime, endDateTime)
|
|
|
+ .eq("00".equals(userType), PatrolInspectionAbnormal::getCreator, SecurityUtils.getUsername());
|
|
|
+ queryWrapper.orderByDesc(PatrolInspectionAbnormal::getId);
|
|
|
+ List<PatrolInspectionAbnormal> recordList = this.list(queryWrapper);
|
|
|
+
|
|
|
+ List<PatrolInspectionAbnormalExportVo> list = new ArrayList<>();
|
|
|
+ for (int i = 0; i < recordList.size(); i++) {
|
|
|
+ PatrolInspectionAbnormalExportVo vo = new PatrolInspectionAbnormalExportVo();
|
|
|
+ vo.setXh(i + 1);
|
|
|
+ vo.setSiteNubmber(recordList.get(i).getSiteNubmber());
|
|
|
+ vo.setSiteType(recordList.get(i).getSiteType());
|
|
|
+ vo.setAreaName(recordList.get(i).getAreaName());
|
|
|
+ vo.setSiteName(recordList.get(i).getSiteName());
|
|
|
+ vo.setName(recordList.get(i).getName());
|
|
|
+ vo.setPhone(recordList.get(i).getPhone());
|
|
|
+ vo.setPlanType(recordList.get(i).getPlanType());
|
|
|
+ vo.setLongitude(recordList.get(i).getLongitude());
|
|
|
+ vo.setLatitude(recordList.get(i).getLatitude());
|
|
|
+ vo.setStartDate(recordList.get(i).getStartDate() != null ? recordList.get(i).getStartDate().format(df) : "");
|
|
|
+ vo.setEndDate(recordList.get(i).getEndDate() != null ? recordList.get(i).getEndDate().format(df) : "");
|
|
|
+ vo.setCreateTime(recordList.get(i).getCreateTime() != null ? recordList.get(i).getCreateTime().format(df) : "");
|
|
|
+ vo.setAbnormalStatus(recordList.get(i).getAbnormalStatus());
|
|
|
+ vo.setRemarks(recordList.get(i).getRemarks());
|
|
|
+ vo.setCreator(recordList.get(i).getCreator());
|
|
|
+ list.add(vo);
|
|
|
+ }
|
|
|
+ return list;
|
|
|
+ }
|
|
|
}
|