941497f7 康伟

kangwei: 移动端---巡检接口

1 个父辈 3a1d6e9b
正在显示 16 个修改的文件 包含 226 行增加18 行删除
...@@ -250,6 +250,13 @@ public class DateUtil { ...@@ -250,6 +250,13 @@ public class DateUtil {
250 return date.toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime(); 250 return date.toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime();
251 } 251 }
252 252
253 /***
254 * 获取当前时间
255 * @return
256 */
257 public static String getCurrentDate(){
258 return formatDate(new Date(),null);
259 }
253 260
254 /*** 261 /***
255 * 字符串日期格式化 262 * 字符串日期格式化
......
...@@ -74,7 +74,7 @@ public class DangerInspectInfoController { ...@@ -74,7 +74,7 @@ public class DangerInspectInfoController {
74 @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, 74 @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
75 HttpServletRequest req) { 75 HttpServletRequest req) {
76 Result<IPage<DangerInspectInfo>> result = new Result<IPage<DangerInspectInfo>>(); 76 Result<IPage<DangerInspectInfo>> result = new Result<IPage<DangerInspectInfo>>();
77 QueryWrapper<DangerInspectInfo> queryWrapper = QueryGenerator.initQueryWrapper(dangerInspectInfo, req.getParameterMap()); 77 QueryWrapper<DangerInspectInfo> queryWrapper = new QueryWrapper<>();//QueryGenerator.initQueryWrapper(dangerInspectInfo, req.getParameterMap());
78 Page<DangerInspectInfo> page = new Page<DangerInspectInfo>(pageNo, pageSize); 78 Page<DangerInspectInfo> page = new Page<DangerInspectInfo>(pageNo, pageSize);
79 queryWrapper.eq("danger_id",dangerInspectInfo.getDangerId()); 79 queryWrapper.eq("danger_id",dangerInspectInfo.getDangerId());
80 queryWrapper.orderByDesc("create_time"); 80 queryWrapper.orderByDesc("create_time");
......
...@@ -73,7 +73,7 @@ public class DangerInspectItemController { ...@@ -73,7 +73,7 @@ public class DangerInspectItemController {
73 @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, 73 @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
74 HttpServletRequest req) { 74 HttpServletRequest req) {
75 Result<IPage<DangerInspectItem>> result = new Result<IPage<DangerInspectItem>>(); 75 Result<IPage<DangerInspectItem>> result = new Result<IPage<DangerInspectItem>>();
76 QueryWrapper<DangerInspectItem> queryWrapper = QueryGenerator.initQueryWrapper(dangerInspectItem, req.getParameterMap()); 76 QueryWrapper<DangerInspectItem> queryWrapper = new QueryWrapper<>();//QueryGenerator.initQueryWrapper(dangerInspectItem, req.getParameterMap());
77 Page<DangerInspectItem> page = new Page<DangerInspectItem>(pageNo, pageSize); 77 Page<DangerInspectItem> page = new Page<DangerInspectItem>(pageNo, pageSize);
78 IPage<DangerInspectItem> pageList = dangerInspectItemService.page(page, queryWrapper); 78 IPage<DangerInspectItem> pageList = dangerInspectItemService.page(page, queryWrapper);
79 queryWrapper.eq("inspect_obj_id", dangerInspectItem.getInspectObjId()); 79 queryWrapper.eq("inspect_obj_id", dangerInspectItem.getInspectObjId());
......
...@@ -73,7 +73,7 @@ public class DangerInspectionInfoController { ...@@ -73,7 +73,7 @@ public class DangerInspectionInfoController {
73 @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, 73 @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
74 HttpServletRequest req) { 74 HttpServletRequest req) {
75 Result<IPage<DangerInspectionInfo>> result = new Result<IPage<DangerInspectionInfo>>(); 75 Result<IPage<DangerInspectionInfo>> result = new Result<IPage<DangerInspectionInfo>>();
76 QueryWrapper<DangerInspectionInfo> queryWrapper = QueryGenerator.initQueryWrapper(dangerInspectionInfo, req.getParameterMap()); 76 QueryWrapper<DangerInspectionInfo> queryWrapper = new QueryWrapper<>();//QueryGenerator.initQueryWrapper(dangerInspectionInfo, req.getParameterMap());
77 Page<DangerInspectionInfo> page = new Page<DangerInspectionInfo>(pageNo, pageSize); 77 Page<DangerInspectionInfo> page = new Page<DangerInspectionInfo>(pageNo, pageSize);
78 IPage<DangerInspectionInfo> pageList = dangerInspectionInfoService.page(page, queryWrapper); 78 IPage<DangerInspectionInfo> pageList = dangerInspectionInfoService.page(page, queryWrapper);
79 result.setSuccess(true); 79 result.setSuccess(true);
......
...@@ -73,7 +73,7 @@ public class DangerInspectionItemController { ...@@ -73,7 +73,7 @@ public class DangerInspectionItemController {
73 @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, 73 @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
74 HttpServletRequest req) { 74 HttpServletRequest req) {
75 Result<IPage<DangerInspectionItem>> result = new Result<IPage<DangerInspectionItem>>(); 75 Result<IPage<DangerInspectionItem>> result = new Result<IPage<DangerInspectionItem>>();
76 QueryWrapper<DangerInspectionItem> queryWrapper = QueryGenerator.initQueryWrapper(dangerInspectionItem, req.getParameterMap()); 76 QueryWrapper<DangerInspectionItem> queryWrapper =new QueryWrapper<>();// QueryGenerator.initQueryWrapper(dangerInspectionItem, req.getParameterMap());
77 Page<DangerInspectionItem> page = new Page<DangerInspectionItem>(pageNo, pageSize); 77 Page<DangerInspectionItem> page = new Page<DangerInspectionItem>(pageNo, pageSize);
78 queryWrapper.eq("inspect_obj_id",dangerInspectionItem.getInspectObjId()); 78 queryWrapper.eq("inspect_obj_id",dangerInspectionItem.getInspectObjId());
79 queryWrapper.orderByDesc("create_time"); 79 queryWrapper.orderByDesc("create_time");
......
...@@ -73,8 +73,9 @@ public class DangerInspectionRecordController { ...@@ -73,8 +73,9 @@ public class DangerInspectionRecordController {
73 @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, 73 @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
74 HttpServletRequest req) { 74 HttpServletRequest req) {
75 Result<IPage<DangerInspectionRecord>> result = new Result<IPage<DangerInspectionRecord>>(); 75 Result<IPage<DangerInspectionRecord>> result = new Result<IPage<DangerInspectionRecord>>();
76 QueryWrapper<DangerInspectionRecord> queryWrapper = QueryGenerator.initQueryWrapper(dangerInspectionRecord, req.getParameterMap()); 76 QueryWrapper<DangerInspectionRecord> queryWrapper = new QueryWrapper<>();//QueryGenerator.initQueryWrapper(dangerInspectionRecord, req.getParameterMap());
77 Page<DangerInspectionRecord> page = new Page<DangerInspectionRecord>(pageNo, pageSize); 77 Page<DangerInspectionRecord> page = new Page<DangerInspectionRecord>(pageNo, pageSize);
78 queryWrapper.eq("danger_id", dangerInspectionRecord.getDangerId());
78 IPage<DangerInspectionRecord> pageList = dangerInspectionRecordService.page(page, queryWrapper); 79 IPage<DangerInspectionRecord> pageList = dangerInspectionRecordService.page(page, queryWrapper);
79 result.setSuccess(true); 80 result.setSuccess(true);
80 result.setResult(pageList); 81 result.setResult(pageList);
......
...@@ -4,6 +4,7 @@ import java.util.List; ...@@ -4,6 +4,7 @@ import java.util.List;
4 import com.skua.core.api.vo.Result; 4 import com.skua.core.api.vo.Result;
5 import com.skua.core.aspect.annotation.AutoLog; 5 import com.skua.core.aspect.annotation.AutoLog;
6 import com.skua.core.context.BaseContextHandler; 6 import com.skua.core.context.BaseContextHandler;
7 import com.skua.modules.guest.util.DateUtil;
7 import com.skua.modules.safe.entity.*; 8 import com.skua.modules.safe.entity.*;
8 import com.skua.modules.safe.mapper.DangerInspectionItemMapper; 9 import com.skua.modules.safe.mapper.DangerInspectionItemMapper;
9 import com.skua.modules.safe.service.*; 10 import com.skua.modules.safe.service.*;
...@@ -39,7 +40,6 @@ public class APPDangerInspectionController { ...@@ -39,7 +40,6 @@ public class APPDangerInspectionController {
39 @Autowired 40 @Autowired
40 private IDangerInspectionItemService inspectionItemService ;//巡检对象,检查项 41 private IDangerInspectionItemService inspectionItemService ;//巡检对象,检查项
41 42
42
43 /** 43 /**
44 * <pre> 44 * <pre>
45 * 扫描二维码进入:风险点详情 45 * 扫描二维码进入:风险点详情
...@@ -60,6 +60,8 @@ public class APPDangerInspectionController { ...@@ -60,6 +60,8 @@ public class APPDangerInspectionController {
60 if(inspection != null ){ 60 if(inspection != null ){
61 dangerInspection.setLastInspectionTime( inspection.getReportDate() ); 61 dangerInspection.setLastInspectionTime( inspection.getReportDate() );
62 }else{ 62 }else{
63 dangerInspection = new DangerLevelManage();
64
63 dangerInspection.setLastInspectionTime(""); 65 dangerInspection.setLastInspectionTime("");
64 } 66 }
65 if(dangerInspection==null) { 67 if(dangerInspection==null) {
...@@ -127,8 +129,8 @@ public class APPDangerInspectionController { ...@@ -127,8 +129,8 @@ public class APPDangerInspectionController {
127 return result; 129 return result;
128 } 130 }
129 131
130 @AutoLog(value = "巡查内容对象-保存") 132 @AutoLog(value = "风险巡检-提交巡检记录")
131 @ApiOperation(value="巡查内容对象-保存", notes="巡查内容对象-保存") 133 @ApiOperation(value="风险巡检-保存巡检记录", notes="风险巡检-保存巡检记录")
132 @PostMapping(value = "/saveInspectionInf") 134 @PostMapping(value = "/saveInspectionInf")
133 public Result<DangerInspectInfo> updateDangerInspectionInfo(@RequestBody DangerInspectionInfo dangerInspectionInfo) { 135 public Result<DangerInspectInfo> updateDangerInspectionInfo(@RequestBody DangerInspectionInfo dangerInspectionInfo) {
134 Result<DangerInspectInfo> result = new Result<DangerInspectInfo>(); 136 Result<DangerInspectInfo> result = new Result<DangerInspectInfo>();
...@@ -141,14 +143,25 @@ public class APPDangerInspectionController { ...@@ -141,14 +143,25 @@ public class APPDangerInspectionController {
141 } 143 }
142 return result; 144 return result;
143 } 145 }
144 @AutoLog(value = "结束巡检") 146 @AutoLog(value = "风险巡检-结束巡检")
145 @ApiOperation(value="结束巡检", notes="结束巡检") 147 @ApiOperation(value="风险巡检-结束巡检", notes="风险巡检-结束巡检")
146 @PostMapping(value = "/endInspection") 148 @PostMapping(value = "/endInspection")
147 public Result<DangerInspectInfo> endInspection(@RequestParam(name="id",required=true) String id) { 149 public Result<DangerInspectionRecord> endInspection(@RequestParam(name="id",required=true) String id) {
148 Result<DangerInspectInfo> result = new Result<DangerInspectInfo>(); 150 Result<DangerInspectionRecord> result = new Result<DangerInspectionRecord>();
149 try { 151 try {
152 DangerInspectionRecord inspectionRecord = inspectionRecordService.getById(id);
153
154 if(inspectionRecord==null) {
155 result.error500("未找到对应实体");
156 }else {
157 inspectionRecord.setEndDate(DateUtil.getCurrentDate() ) ;
158 inspectionRecord.setStatus("2");//结束状态
159 inspectionRecordService.updateById(inspectionRecord);
160
161 result.setResult(inspectionRecord);
162 result.setSuccess(true);
163 }
150 164
151 //inspectionRecordService.(id);
152 result.success("添加成功!"); 165 result.success("添加成功!");
153 } catch (Exception e) { 166 } catch (Exception e) {
154 log.error(e.getMessage(),e); 167 log.error(e.getMessage(),e);
...@@ -157,5 +170,8 @@ public class APPDangerInspectionController { ...@@ -157,5 +170,8 @@ public class APPDangerInspectionController {
157 return result; 170 return result;
158 } 171 }
159 172
173 /*************************************************************************************************/
174
175 //作废
160 176
161 } 177 }
......
1 package com.skua.modules.safe.controller.app;
2
3
4 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
5 import com.baomidou.mybatisplus.core.metadata.IPage;
6 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
7 import com.skua.core.api.vo.Result;
8 import com.skua.core.aspect.annotation.AutoLog;
9 import com.skua.core.query.QueryGenerator;
10 import com.skua.modules.safe.entity.DangerInspectionRecord;
11 import com.skua.modules.safe.entity.DangerLevelManage;
12 import com.skua.modules.safe.service.IDangerInspectionItemService;
13 import com.skua.modules.safe.service.IDangerInspectionRecordService;
14 import io.swagger.annotations.Api;
15 import io.swagger.annotations.ApiOperation;
16 import lombok.extern.slf4j.Slf4j;
17 import org.apache.commons.lang3.StringUtils;
18 import org.springframework.beans.factory.annotation.Autowired;
19 import org.springframework.web.bind.annotation.GetMapping;
20 import org.springframework.web.bind.annotation.RequestMapping;
21 import org.springframework.web.bind.annotation.RequestParam;
22 import org.springframework.web.bind.annotation.RestController;
23
24 import javax.servlet.http.HttpServletRequest;
25 import java.util.List;
26
27 @Slf4j
28 @Api(tags="隐患排查记录")
29 @RestController("appDangerInspectionRecordController")
30 @RequestMapping("/app/safe/dangerInspectionRecord")
31 public class APPDangerInspectionRecordController {
32 @Autowired
33 private IDangerInspectionRecordService dangerInspectionRecordService;
34
35 @Autowired
36 private IDangerInspectionRecordService inspectionRecordService ;//巡检对象
37
38
39 /**
40 * <pre>
41 * 分页列表查询
42 * </pre>
43 * @param dangerInspectionRecord
44 * @param pageNo
45 * @param pageSize
46 * @param req
47 * @return
48 * @author 开发者姓名, 开发时间
49 * @Description: TODO(这里描述这个方法的需求变更情况)
50 */
51 @AutoLog(value = "隐患排查记录-分页列表查询")
52 @ApiOperation(value="隐患排查记录-分页列表查询", notes="隐患排查记录-分页列表查询")
53 @GetMapping(value = "/list")
54 public Result<IPage<DangerInspectionRecord>> queryPageList(DangerInspectionRecord dangerInspectionRecord,
55 @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
56 @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
57 HttpServletRequest req) {
58 Result<IPage<DangerInspectionRecord>> result = new Result<IPage<DangerInspectionRecord>>();
59 QueryWrapper<DangerInspectionRecord> queryWrapper = new QueryWrapper<DangerInspectionRecord>();// QueryGenerator.initQueryWrapper(dangerInspectionRecord, req.getParameterMap());
60 Page<DangerInspectionRecord> page = new Page<DangerInspectionRecord>(pageNo, pageSize);
61 queryWrapper.eq("danger_id", dangerInspectionRecord.getDangerId());
62
63 if(StringUtils.isNotBlank(dangerInspectionRecord.getStartTime())){
64 queryWrapper.ge("report_date", dangerInspectionRecord.getStartTime() ) ;
65 }
66 if(StringUtils.isNotBlank(dangerInspectionRecord.getEndTime())){
67 queryWrapper.le("report_date", dangerInspectionRecord.getEndTime() ) ;
68 }
69 // queryWrapper.eq("report_user", BaseContextHandler.getUserId());
70 IPage<DangerInspectionRecord> pageList = dangerInspectionRecordService.page(page, queryWrapper);
71 result.setSuccess(true);
72 result.setResult(pageList);
73 return result;
74 }
75
76
77 /**
78 * <pre>
79 * 扫描二维码进入:风险点详情
80 * </pre>
81 * @param dangerInspectionRecord
82 * @return
83 * @author 开发者姓名, 开发时间
84 * @Description: TODO(这里描述这个方法的需求变更情况)
85 */
86 @AutoLog(value = "扫描二维码进入:风险点详情")
87 @ApiOperation(value="扫描二维码进入:风险点详情", notes="扫描二维码进入:风险点详情")
88 @GetMapping(value = "/detail")
89 public Result<DangerLevelManage> queryById(DangerInspectionRecord dangerInspectionRecord) {
90 Result<DangerLevelManage> result = new Result<DangerLevelManage>();
91 DangerLevelManage dangerLevelManage = inspectionRecordService.queryListByDangerId(dangerInspectionRecord.getDangerId(),dangerInspectionRecord.getStartTime(),dangerInspectionRecord.getEndDate());
92 if(dangerLevelManage == null) {
93 result.error500("未找到对应实体");
94 }else {
95 result.setResult(dangerLevelManage);
96 result.setSuccess(true);
97 }
98 return result;
99 }
100 }
...\ No newline at end of file ...\ No newline at end of file
...@@ -23,7 +23,7 @@ import org.jeecgframework.poi.excel.annotation.Excel; ...@@ -23,7 +23,7 @@ import org.jeecgframework.poi.excel.annotation.Excel;
23 @EqualsAndHashCode(callSuper = false) 23 @EqualsAndHashCode(callSuper = false)
24 @Accessors(chain = true) 24 @Accessors(chain = true)
25 @ApiModel(value="danger_inspect_item对象", description="风险检查项") 25 @ApiModel(value="danger_inspect_item对象", description="风险检查项")
26 public class DangerInspectItem { 26 public class DangerInspectItem implements Serializable{
27 27
28 /**id*/ 28 /**id*/
29 @TableId(type = IdType.ID_WORKER_STR) 29 @TableId(type = IdType.ID_WORKER_STR)
......
...@@ -25,7 +25,7 @@ import org.jeecgframework.poi.excel.annotation.Excel; ...@@ -25,7 +25,7 @@ import org.jeecgframework.poi.excel.annotation.Excel;
25 @EqualsAndHashCode(callSuper = false) 25 @EqualsAndHashCode(callSuper = false)
26 @Accessors(chain = true) 26 @Accessors(chain = true)
27 @ApiModel(value="danger_inspection_info对象", description="巡检对象") 27 @ApiModel(value="danger_inspection_info对象", description="巡检对象")
28 public class DangerInspectionInfo { 28 public class DangerInspectionInfo implements Serializable{
29 29
30 /**id*/ 30 /**id*/
31 @TableId(type = IdType.ID_WORKER_STR) 31 @TableId(type = IdType.ID_WORKER_STR)
......
...@@ -23,7 +23,7 @@ import org.jeecgframework.poi.excel.annotation.Excel; ...@@ -23,7 +23,7 @@ import org.jeecgframework.poi.excel.annotation.Excel;
23 @EqualsAndHashCode(callSuper = false) 23 @EqualsAndHashCode(callSuper = false)
24 @Accessors(chain = true) 24 @Accessors(chain = true)
25 @ApiModel(value="danger_inspection_item对象", description="风险检查项记录") 25 @ApiModel(value="danger_inspection_item对象", description="风险检查项记录")
26 public class DangerInspectionItem { 26 public class DangerInspectionItem implements Serializable{
27 27
28 /**id*/ 28 /**id*/
29 @TableId(type = IdType.ID_WORKER_STR) 29 @TableId(type = IdType.ID_WORKER_STR)
...@@ -46,6 +46,12 @@ public class DangerInspectionItem { ...@@ -46,6 +46,12 @@ public class DangerInspectionItem {
46 @Excel(name = "选项类型(0:选择,1 是否 2 文本)", width = 15) 46 @Excel(name = "选项类型(0:选择,1 是否 2 文本)", width = 15)
47 @ApiModelProperty(value = "选项类型(0:选择,1 是否 2 文本)") 47 @ApiModelProperty(value = "选项类型(0:选择,1 是否 2 文本)")
48 private String itemType; 48 private String itemType;
49
50
51 /**选项状态(0:异常,1正常)*/
52 @Excel(name = "检查值", width = 15)
53 @ApiModelProperty(value = "检查值")
54 private String itemValue;
49 /**选项状态(0:异常,1正常)*/ 55 /**选项状态(0:异常,1正常)*/
50 @Excel(name = "选项状态(0:异常,1正常)", width = 15) 56 @Excel(name = "选项状态(0:异常,1正常)", width = 15)
51 @ApiModelProperty(value = "选项状态(0:异常,1正常)") 57 @ApiModelProperty(value = "选项状态(0:异常,1正常)")
......
...@@ -25,7 +25,7 @@ import org.jeecgframework.poi.excel.annotation.Excel; ...@@ -25,7 +25,7 @@ import org.jeecgframework.poi.excel.annotation.Excel;
25 @EqualsAndHashCode(callSuper = false) 25 @EqualsAndHashCode(callSuper = false)
26 @Accessors(chain = true) 26 @Accessors(chain = true)
27 @ApiModel(value="danger_inspection_record对象", description="巡检记录") 27 @ApiModel(value="danger_inspection_record对象", description="巡检记录")
28 public class DangerInspectionRecord { 28 public class DangerInspectionRecord implements Serializable{
29 29
30 /**id*/ 30 /**id*/
31 @TableId(type = IdType.ID_WORKER_STR) 31 @TableId(type = IdType.ID_WORKER_STR)
...@@ -47,6 +47,14 @@ public class DangerInspectionRecord { ...@@ -47,6 +47,14 @@ public class DangerInspectionRecord {
47 @Excel(name = "上报时间", width = 15) 47 @Excel(name = "上报时间", width = 15)
48 @ApiModelProperty(value = "上报时间") 48 @ApiModelProperty(value = "上报时间")
49 private String reportDate; 49 private String reportDate;
50
51
52 /**上报时间*/
53 @Excel(name = "结束时间", width = 15)
54 @ApiModelProperty(value = "结束时间")
55 private String endDate;
56
57
50 /**巡检状态(0:未开始,1:开始,2:结束,3:作废)*/ 58 /**巡检状态(0:未开始,1:开始,2:结束,3:作废)*/
51 @Excel(name = "巡检状态(0:未开始,1:开始,2:结束,3:作废)", width = 15) 59 @Excel(name = "巡检状态(0:未开始,1:开始,2:结束,3:作废)", width = 15)
52 @ApiModelProperty(value = "巡检状态(0:未开始,1:开始,2:结束,3:作废)") 60 @ApiModelProperty(value = "巡检状态(0:未开始,1:开始,2:结束,3:作废)")
...@@ -83,4 +91,13 @@ public class DangerInspectionRecord { ...@@ -83,4 +91,13 @@ public class DangerInspectionRecord {
83 @TableField(exist=false) 91 @TableField(exist=false)
84 @ApiModelProperty(value = "巡检对象集合") 92 @ApiModelProperty(value = "巡检对象集合")
85 private List<DangerInspectionInfo> inspectionInfoList ; 93 private List<DangerInspectionInfo> inspectionInfoList ;
94
95 @TableField(exist=false)
96 @ApiModelProperty(value = "条件:开始时间")
97 private String startTime;
98
99 @TableField(exist=false)
100 @ApiModelProperty(value = "条件:结束时间")
101 private String endTime;
102
86 } 103 }
......
...@@ -2,6 +2,8 @@ package com.skua.modules.safe.entity; ...@@ -2,6 +2,8 @@ package com.skua.modules.safe.entity;
2 2
3 import java.io.Serializable; 3 import java.io.Serializable;
4 import java.util.Date; 4 import java.util.Date;
5 import java.util.List;
6
5 import com.baomidou.mybatisplus.annotation.IdType; 7 import com.baomidou.mybatisplus.annotation.IdType;
6 import com.baomidou.mybatisplus.annotation.TableId; 8 import com.baomidou.mybatisplus.annotation.TableId;
7 import com.baomidou.mybatisplus.annotation.TableName; 9 import com.baomidou.mybatisplus.annotation.TableName;
...@@ -25,7 +27,7 @@ import org.jeecgframework.poi.excel.annotation.Excel; ...@@ -25,7 +27,7 @@ import org.jeecgframework.poi.excel.annotation.Excel;
25 @EqualsAndHashCode(callSuper = false) 27 @EqualsAndHashCode(callSuper = false)
26 @Accessors(chain = true) 28 @Accessors(chain = true)
27 @ApiModel(value="danger_level_manage对象", description="风险分级管控清单") 29 @ApiModel(value="danger_level_manage对象", description="风险分级管控清单")
28 public class DangerLevelManage { 30 public class DangerLevelManage implements Serializable{
29 31
30 /**id*/ 32 /**id*/
31 @TableId(type = IdType.UUID) 33 @TableId(type = IdType.UUID)
...@@ -133,4 +135,8 @@ public class DangerLevelManage { ...@@ -133,4 +135,8 @@ public class DangerLevelManage {
133 @ApiModelProperty(value = "上次巡检时间") 135 @ApiModelProperty(value = "上次巡检时间")
134 private String lastInspectionTime; 136 private String lastInspectionTime;
135 137
138 @TableField(exist=false)
139 @ApiModelProperty(value = "巡检内容对象集合")
140 private List<DangerInspectionInfo> inspectionInfoList;
141
136 } 142 }
......
...@@ -3,6 +3,7 @@ package com.skua.modules.safe.service; ...@@ -3,6 +3,7 @@ package com.skua.modules.safe.service;
3 import com.skua.modules.safe.entity.DangerInspectionInfo; 3 import com.skua.modules.safe.entity.DangerInspectionInfo;
4 import com.skua.modules.safe.entity.DangerInspectionRecord; 4 import com.skua.modules.safe.entity.DangerInspectionRecord;
5 import com.baomidou.mybatisplus.extension.service.IService; 5 import com.baomidou.mybatisplus.extension.service.IService;
6 import com.skua.modules.safe.entity.DangerLevelManage;
6 7
7 import java.util.List; 8 import java.util.List;
8 9
...@@ -26,4 +27,13 @@ public interface IDangerInspectionRecordService extends IService<DangerInspectio ...@@ -26,4 +27,13 @@ public interface IDangerInspectionRecordService extends IService<DangerInspectio
26 * @return 27 * @return
27 */ 28 */
28 public DangerInspectionRecord startInspection(String dangerId, String status , String userId); 29 public DangerInspectionRecord startInspection(String dangerId, String status , String userId);
30
31 /***
32 * 查询巡查集合
33 * @param dangerId
34 * @param startTime
35 * @param endDate
36 * @return
37 */
38 public DangerLevelManage queryListByDangerId(String dangerId, String startTime, String endDate);
29 } 39 }
......
...@@ -87,6 +87,7 @@ public class DangerInspectInfoServiceImpl extends ServiceImpl<DangerInspectInfoM ...@@ -87,6 +87,7 @@ public class DangerInspectInfoServiceImpl extends ServiceImpl<DangerInspectInfoM
87 if(dangerInspectInfo.getItemList() != null ){ 87 if(dangerInspectInfo.getItemList() != null ){
88 for(DangerInspectItem dangerInspectItem : dangerInspectInfo.getItemList()){ 88 for(DangerInspectItem dangerInspectItem : dangerInspectInfo.getItemList()){
89 dangerInspectItem.setInspectObjId( dangerInspectInfo.getId() ) ; 89 dangerInspectItem.setInspectObjId( dangerInspectInfo.getId() ) ;
90 dangerInspectItem.setDangerId( dangerInspectInfo.getDangerId());
90 inspectItemMapper.insert(dangerInspectItem) ; 91 inspectItemMapper.insert(dangerInspectItem) ;
91 } 92 }
92 } 93 }
...@@ -105,6 +106,7 @@ public class DangerInspectInfoServiceImpl extends ServiceImpl<DangerInspectInfoM ...@@ -105,6 +106,7 @@ public class DangerInspectInfoServiceImpl extends ServiceImpl<DangerInspectInfoM
105 if(dangerInspectInfo.getItemList() != null ){ 106 if(dangerInspectInfo.getItemList() != null ){
106 for(DangerInspectItem dangerInspectItem : dangerInspectInfo.getItemList()){ 107 for(DangerInspectItem dangerInspectItem : dangerInspectInfo.getItemList()){
107 dangerInspectItem.setInspectObjId( dangerInspectInfo.getId() ) ; 108 dangerInspectItem.setInspectObjId( dangerInspectInfo.getId() ) ;
109 dangerInspectItem.setDangerId( dangerInspectInfo.getDangerId());
108 inspectItemMapper.insert(dangerInspectItem) ; 110 inspectItemMapper.insert(dangerInspectItem) ;
109 } 111 }
110 } 112 }
......
...@@ -89,6 +89,7 @@ public class DangerInspectionRecordServiceImpl extends ServiceImpl<DangerInspect ...@@ -89,6 +89,7 @@ public class DangerInspectionRecordServiceImpl extends ServiceImpl<DangerInspect
89 inspectionInfo.setInspectMethod( dangerInspectInfo.getInspectMethod()); 89 inspectionInfo.setInspectMethod( dangerInspectInfo.getInspectMethod());
90 inspectionInfo.setInspectStandard( dangerInspectInfo.getInspectStandard() ); 90 inspectionInfo.setInspectStandard( dangerInspectInfo.getInspectStandard() );
91 inspectionInfo.setReportUser( userId) ; 91 inspectionInfo.setReportUser( userId) ;
92 inspectionInfo.setInspectObjId( dangerInspectInfo.getId() );
92 dangerInspectionInfoMapper.insert(inspectionInfo); 93 dangerInspectionInfoMapper.insert(inspectionInfo);
93 94
94 //搜索检查内容对象,检查项目 95 //搜索检查内容对象,检查项目
...@@ -153,4 +154,46 @@ public class DangerInspectionRecordServiceImpl extends ServiceImpl<DangerInspect ...@@ -153,4 +154,46 @@ public class DangerInspectionRecordServiceImpl extends ServiceImpl<DangerInspect
153 154
154 return inspectionInfoList; 155 return inspectionInfoList;
155 } 156 }
157
158
159 /***
160 * 查询巡查集合
161 * @param dangerId
162 * @param startTime
163 * @param endDate
164 * @return
165 */
166 public DangerLevelManage queryListByDangerId(String dangerId, String startTime, String endDate){
167
168 DangerLevelManage dangerLevelManage = dangerLevelManageMapper.selectById(dangerId);
169
170 //巡查对象
171 LambdaQueryWrapper<DangerInspectionInfo> queryWrapper = new LambdaQueryWrapper<DangerInspectionInfo>();
172 queryWrapper.eq(DangerInspectionInfo::getDangerId, dangerId);
173 queryWrapper.orderByAsc(DangerInspectionInfo::getCreateTime );
174 List<DangerInspectionInfo> inspectionInfoList = dangerInspectionInfoMapper.selectList(queryWrapper);
175
176
177
178 if(inspectionInfoList != null && !inspectionInfoList.isEmpty()){
179
180 LambdaQueryWrapper<DangerInspectionItem> queryItemWrapper = new LambdaQueryWrapper<DangerInspectionItem>();
181 List<DangerInspectionItem> itemList = null;
182 for( DangerInspectionInfo info : inspectionInfoList){
183 queryItemWrapper.eq(DangerInspectionItem::getInspectionInfoId, info.getId());
184 queryItemWrapper.orderByAsc(DangerInspectionItem::getCreateTime );
185
186 itemList = dangerInspectionItemMapper.selectList(queryItemWrapper);
187 if(itemList != null ) info.setInspectionItemList( itemList ) ;
188 }
189
190 dangerLevelManage.setInspectionInfoList( inspectionInfoList );
191 }
192
193
194
195 return dangerLevelManage;
196 }
197
198
156 } 199 }
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!