0cce2f66 康伟

kangwei: 后端---隐患排序记录

1 个父辈 941497f7
...@@ -15,6 +15,7 @@ import com.skua.core.query.QueryGenerator; ...@@ -15,6 +15,7 @@ import com.skua.core.query.QueryGenerator;
15 import com.skua.core.service.ISequenceService; 15 import com.skua.core.service.ISequenceService;
16 import com.skua.core.util.ConvertUtils; 16 import com.skua.core.util.ConvertUtils;
17 import com.skua.modules.safe.entity.DangerInspectionRecord; 17 import com.skua.modules.safe.entity.DangerInspectionRecord;
18 import com.skua.modules.safe.entity.DangerLevelManage;
18 import com.skua.modules.safe.service.IDangerInspectionRecordService; 19 import com.skua.modules.safe.service.IDangerInspectionRecordService;
19 import java.util.Date; 20 import java.util.Date;
20 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; 21 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
...@@ -22,6 +23,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage; ...@@ -22,6 +23,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
22 import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 23 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
23 import lombok.extern.slf4j.Slf4j; 24 import lombok.extern.slf4j.Slf4j;
24 25
26 import org.apache.commons.lang3.StringUtils;
25 import org.jeecgframework.poi.excel.ExcelImportUtil; 27 import org.jeecgframework.poi.excel.ExcelImportUtil;
26 import org.jeecgframework.poi.excel.def.NormalExcelConstants; 28 import org.jeecgframework.poi.excel.def.NormalExcelConstants;
27 import org.jeecgframework.poi.excel.entity.ExportParams; 29 import org.jeecgframework.poi.excel.entity.ExportParams;
...@@ -52,6 +54,8 @@ public class DangerInspectionRecordController { ...@@ -52,6 +54,8 @@ public class DangerInspectionRecordController {
52 @Autowired 54 @Autowired
53 private IDangerInspectionRecordService dangerInspectionRecordService; 55 private IDangerInspectionRecordService dangerInspectionRecordService;
54 56
57 @Autowired
58 private IDangerInspectionRecordService inspectionRecordService ;//巡检对象
55 /** 59 /**
56 * <pre> 60 * <pre>
57 * 分页列表查询 61 * 分页列表查询
...@@ -76,6 +80,24 @@ public class DangerInspectionRecordController { ...@@ -76,6 +80,24 @@ public class DangerInspectionRecordController {
76 QueryWrapper<DangerInspectionRecord> queryWrapper = new QueryWrapper<>();//QueryGenerator.initQueryWrapper(dangerInspectionRecord, req.getParameterMap()); 80 QueryWrapper<DangerInspectionRecord> queryWrapper = new QueryWrapper<>();//QueryGenerator.initQueryWrapper(dangerInspectionRecord, req.getParameterMap());
77 Page<DangerInspectionRecord> page = new Page<DangerInspectionRecord>(pageNo, pageSize); 81 Page<DangerInspectionRecord> page = new Page<DangerInspectionRecord>(pageNo, pageSize);
78 queryWrapper.eq("danger_id", dangerInspectionRecord.getDangerId()); 82 queryWrapper.eq("danger_id", dangerInspectionRecord.getDangerId());
83
84 if(StringUtils.isNotBlank(dangerInspectionRecord.getDangerName())){
85 queryWrapper.like("danger_name", dangerInspectionRecord.getDangerName() ) ;
86 }
87
88 if(StringUtils.isNotBlank(dangerInspectionRecord.getDepartId())){
89 queryWrapper.eq("depart_id", dangerInspectionRecord.getDepartId() ) ;
90 }
91
92 if(StringUtils.isNotBlank(dangerInspectionRecord.getStatus())){
93 queryWrapper.eq("status", dangerInspectionRecord.getStatus() ) ;
94 }
95 if(StringUtils.isNotBlank(dangerInspectionRecord.getStartTime())){
96 queryWrapper.ge("report_date", dangerInspectionRecord.getStartTime() ) ;
97 }
98 if(StringUtils.isNotBlank(dangerInspectionRecord.getEndTime())){
99 queryWrapper.le("report_date", dangerInspectionRecord.getEndTime() ) ;
100 }
79 IPage<DangerInspectionRecord> pageList = dangerInspectionRecordService.page(page, queryWrapper); 101 IPage<DangerInspectionRecord> pageList = dangerInspectionRecordService.page(page, queryWrapper);
80 result.setSuccess(true); 102 result.setSuccess(true);
81 result.setResult(pageList); 103 result.setResult(pageList);
...@@ -275,4 +297,29 @@ public class DangerInspectionRecordController { ...@@ -275,4 +297,29 @@ public class DangerInspectionRecordController {
275 return Result.ok("文件导入失败!"); 297 return Result.ok("文件导入失败!");
276 } 298 }
277 299
300
301 /**
302 * <pre>
303 * 扫描二维码进入:风险点详情
304 * </pre>
305 * @param dangerInspectionRecord
306 * @return
307 * @author 开发者姓名, 开发时间
308 * @Description: TODO(这里描述这个方法的需求变更情况)
309 */
310 @AutoLog(value = "风险点:巡检情况列表")
311 @ApiOperation(value="风险点:巡检情况列表", notes="风险点:巡检情况列表")
312 @GetMapping(value = "/detail")
313 public Result<DangerLevelManage> queryById(DangerInspectionRecord dangerInspectionRecord) {
314 Result<DangerLevelManage> result = new Result<DangerLevelManage>();
315 DangerLevelManage dangerLevelManage = inspectionRecordService.queryListByDangerId(dangerInspectionRecord.getDangerId(),dangerInspectionRecord.getStartTime(),dangerInspectionRecord.getEndDate());
316 if(dangerLevelManage == null) {
317 result.error500("未找到对应实体");
318 }else {
319 result.setResult(dangerLevelManage);
320 result.setSuccess(true);
321 }
322 return result;
323 }
324
278 } 325 }
......
...@@ -61,7 +61,6 @@ public class APPDangerInspectionController { ...@@ -61,7 +61,6 @@ public class APPDangerInspectionController {
61 dangerInspection.setLastInspectionTime( inspection.getReportDate() ); 61 dangerInspection.setLastInspectionTime( inspection.getReportDate() );
62 }else{ 62 }else{
63 dangerInspection = new DangerLevelManage(); 63 dangerInspection = new DangerLevelManage();
64
65 dangerInspection.setLastInspectionTime(""); 64 dangerInspection.setLastInspectionTime("");
66 } 65 }
67 if(dangerInspection==null) { 66 if(dangerInspection==null) {
......
...@@ -39,6 +39,11 @@ public class DangerInspectionRecord implements Serializable{ ...@@ -39,6 +39,11 @@ public class DangerInspectionRecord implements Serializable{
39 @Excel(name = "风险等级编号", width = 15) 39 @Excel(name = "风险等级编号", width = 15)
40 @ApiModelProperty(value = "风险等级编号") 40 @ApiModelProperty(value = "风险等级编号")
41 private String dangerId; 41 private String dangerId;
42
43 /**风险等级编号*/
44 @Excel(name = "风险等级名称", width = 15)
45 @ApiModelProperty(value = "风险等级名称")
46 private String dangerName;
42 /**上报人(用户id)*/ 47 /**上报人(用户id)*/
43 @Excel(name = "上报人(用户id)", width = 15) 48 @Excel(name = "上报人(用户id)", width = 15)
44 @ApiModelProperty(value = "上报人(用户id)") 49 @ApiModelProperty(value = "上报人(用户id)")
......
...@@ -61,6 +61,7 @@ public class DangerInspectionRecordServiceImpl extends ServiceImpl<DangerInspect ...@@ -61,6 +61,7 @@ public class DangerInspectionRecordServiceImpl extends ServiceImpl<DangerInspect
61 DangerLevelManage dangerLevelManage = dangerLevelManageMapper.selectById(dangerId ); 61 DangerLevelManage dangerLevelManage = dangerLevelManageMapper.selectById(dangerId );
62 dangerInspection = new DangerInspectionRecord(); 62 dangerInspection = new DangerInspectionRecord();
63 dangerInspection.setDepartId(dangerLevelManage.getDepartId()); 63 dangerInspection.setDepartId(dangerLevelManage.getDepartId());
64 dangerInspection.setDangerName(dangerLevelManage.getDangerName() );//风险等级名称
64 dangerInspection.setDangerId( dangerId ); 65 dangerInspection.setDangerId( dangerId );
65 dangerInspection.setStatus( status); 66 dangerInspection.setStatus( status);
66 dangerInspection.setReportUser( userId ); 67 dangerInspection.setReportUser( userId );
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!