Merge remote-tracking branch 'origin/master' into master
正在显示
22 个修改的文件
包含
716 行增加
和
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 | * 字符串日期格式化 | ... | ... |
1 | package com.skua.modules.safe.controller; | ||
2 | |||
3 | import java.util.Arrays; | ||
4 | import java.util.List; | ||
5 | import java.util.Map; | ||
6 | import java.io.IOException; | ||
7 | import java.io.UnsupportedEncodingException; | ||
8 | import java.net.URLDecoder; | ||
9 | import javax.servlet.http.HttpServletRequest; | ||
10 | import javax.servlet.http.HttpServletResponse; | ||
11 | import com.skua.core.api.vo.Result; | ||
12 | import com.skua.core.aspect.annotation.AutoLog; | ||
13 | import com.skua.core.context.BaseContextHandler; | ||
14 | import com.skua.core.query.QueryGenerator; | ||
15 | import com.skua.core.service.ISequenceService; | ||
16 | import com.skua.core.util.ConvertUtils; | ||
17 | import com.skua.modules.safe.entity.AccidentCase; | ||
18 | import com.skua.modules.safe.service.IAccidentCaseService; | ||
19 | import java.util.Date; | ||
20 | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | ||
21 | import com.baomidou.mybatisplus.core.metadata.IPage; | ||
22 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | ||
23 | import lombok.extern.slf4j.Slf4j; | ||
24 | |||
25 | import org.jeecgframework.poi.excel.ExcelImportUtil; | ||
26 | import org.jeecgframework.poi.excel.def.NormalExcelConstants; | ||
27 | import org.jeecgframework.poi.excel.entity.ExportParams; | ||
28 | import org.jeecgframework.poi.excel.entity.ImportParams; | ||
29 | import org.jeecgframework.poi.excel.view.JeecgEntityExcelView; | ||
30 | |||
31 | import org.springframework.beans.factory.annotation.Autowired; | ||
32 | import org.springframework.web.bind.annotation.*; | ||
33 | import org.springframework.web.multipart.MultipartFile; | ||
34 | import org.springframework.web.multipart.MultipartHttpServletRequest; | ||
35 | import org.springframework.web.servlet.ModelAndView; | ||
36 | import com.alibaba.fastjson.JSON; | ||
37 | import io.swagger.annotations.Api; | ||
38 | import io.swagger.annotations.ApiOperation; | ||
39 | |||
40 | /** | ||
41 | * <pre> | ||
42 | * 事故案例库 | ||
43 | * </pre> | ||
44 | * @author 开发者姓名 | ||
45 | * @version V0.1, 开发时间 | ||
46 | */ | ||
47 | @Slf4j | ||
48 | @Api(tags="事故案例库") | ||
49 | @RestController("webAccidentCaseController") | ||
50 | @RequestMapping("/web/safe/accidentCase") | ||
51 | public class AccidentCaseController { | ||
52 | @Autowired | ||
53 | private IAccidentCaseService accidentCaseService; | ||
54 | |||
55 | /** | ||
56 | * <pre> | ||
57 | * 分页列表查询 | ||
58 | * </pre> | ||
59 | * @param accidentCase | ||
60 | * @param pageNo | ||
61 | * @param pageSize | ||
62 | * @param req | ||
63 | * @return | ||
64 | * @author 开发者姓名, 开发时间 | ||
65 | * @Description: TODO(这里描述这个方法的需求变更情况) | ||
66 | */ | ||
67 | |||
68 | @AutoLog(value = "事故案例库-分页列表查询") | ||
69 | @ApiOperation(value="事故案例库-分页列表查询", notes="事故案例库-分页列表查询") | ||
70 | @GetMapping(value = "/list") | ||
71 | public Result<IPage<AccidentCase>> queryPageList(AccidentCase accidentCase, | ||
72 | @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, | ||
73 | @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, | ||
74 | HttpServletRequest req) { | ||
75 | Result<IPage<AccidentCase>> result = new Result<IPage<AccidentCase>>(); | ||
76 | QueryWrapper<AccidentCase> queryWrapper = QueryGenerator.initQueryWrapper(accidentCase, req.getParameterMap()); | ||
77 | Page<AccidentCase> page = new Page<AccidentCase>(pageNo, pageSize); | ||
78 | queryWrapper.orderByDesc("create_time"); | ||
79 | IPage<AccidentCase> pageList = accidentCaseService.page(page, queryWrapper); | ||
80 | result.setSuccess(true); | ||
81 | result.setResult(pageList); | ||
82 | return result; | ||
83 | } | ||
84 | |||
85 | /** | ||
86 | * <pre> | ||
87 | * 添加 | ||
88 | * </pre> | ||
89 | * @param accidentCase | ||
90 | * @return | ||
91 | * @author 开发者姓名, 开发时间 | ||
92 | * @Description: TODO(这里描述这个方法的需求变更情况) | ||
93 | */ | ||
94 | @AutoLog(value = "事故案例库-添加") | ||
95 | @ApiOperation(value="事故案例库-添加", notes="事故案例库-添加") | ||
96 | @PostMapping(value = "/add") | ||
97 | public Result<AccidentCase> add(@RequestBody AccidentCase accidentCase) { | ||
98 | Result<AccidentCase> result = new Result<AccidentCase>(); | ||
99 | try { | ||
100 | accidentCaseService.save(accidentCase); | ||
101 | result.success("添加成功!"); | ||
102 | } catch (Exception e) { | ||
103 | log.error(e.getMessage(),e); | ||
104 | result.error500("操作失败"); | ||
105 | } | ||
106 | return result; | ||
107 | } | ||
108 | /** | ||
109 | * <pre> | ||
110 | * 编辑 | ||
111 | * </pre> | ||
112 | * @param accidentCase | ||
113 | * @return | ||
114 | * @author 开发者姓名, 开发时间 | ||
115 | * @Description: TODO(这里描述这个方法的需求变更情况) | ||
116 | */ | ||
117 | @AutoLog(value = "事故案例库-编辑") | ||
118 | @ApiOperation(value="事故案例库-编辑", notes="事故案例库-编辑") | ||
119 | @PutMapping(value = "/edit") | ||
120 | public Result<AccidentCase> edit(@RequestBody AccidentCase accidentCase) { | ||
121 | Result<AccidentCase> result = new Result<AccidentCase>(); | ||
122 | AccidentCase accidentCaseEntity = accidentCaseService.getById(accidentCase.getId()); | ||
123 | if(accidentCaseEntity==null) { | ||
124 | result.error500("未找到对应实体"); | ||
125 | }else { | ||
126 | boolean ok = accidentCaseService.updateById(accidentCase); | ||
127 | //TODO 返回false说明什么? | ||
128 | if(ok) { | ||
129 | result.success("修改成功!"); | ||
130 | } | ||
131 | } | ||
132 | |||
133 | return result; | ||
134 | } | ||
135 | /** | ||
136 | * <pre> | ||
137 | * 通过id删除 | ||
138 | * </pre> | ||
139 | * @param id | ||
140 | * @return | ||
141 | * @author 开发者姓名, 开发时间 | ||
142 | * @Description: TODO(这里描述这个方法的需求变更情况) | ||
143 | */ | ||
144 | @AutoLog(value = "事故案例库-通过id删除") | ||
145 | @ApiOperation(value="事故案例库-通过id删除", notes="事故案例库-通过id删除") | ||
146 | @DeleteMapping(value = "/delete") | ||
147 | public Result<?> delete(@RequestParam(name="id",required=true) String id) { | ||
148 | try { | ||
149 | accidentCaseService.removeById(id); | ||
150 | } catch (Exception e) { | ||
151 | log.error("删除失败",e.getMessage()); | ||
152 | return Result.error("删除失败!"); | ||
153 | } | ||
154 | return Result.ok("删除成功!"); | ||
155 | } | ||
156 | |||
157 | /** | ||
158 | * <pre> | ||
159 | * 批量删除 | ||
160 | * </pre> | ||
161 | * @param ids | ||
162 | * @return | ||
163 | * @author 开发者姓名, 开发时间 | ||
164 | * @Description: TODO(这里描述这个方法的需求变更情况) | ||
165 | */ | ||
166 | @AutoLog(value = "事故案例库-批量删除") | ||
167 | @ApiOperation(value="事故案例库-批量删除", notes="事故案例库-批量删除") | ||
168 | @DeleteMapping(value = "/deleteBatch") | ||
169 | public Result<AccidentCase> deleteBatch(@RequestParam(name="ids",required=true) String ids) { | ||
170 | Result<AccidentCase> result = new Result<AccidentCase>(); | ||
171 | if(ids==null || "".equals(ids.trim())) { | ||
172 | result.error500("参数不识别!"); | ||
173 | }else { | ||
174 | this.accidentCaseService.removeByIds(Arrays.asList(ids.split(","))); | ||
175 | result.success("删除成功!"); | ||
176 | } | ||
177 | return result; | ||
178 | } | ||
179 | /** | ||
180 | * <pre> | ||
181 | * 通过id查询 | ||
182 | * </pre> | ||
183 | * @param id | ||
184 | * @return | ||
185 | * @author 开发者姓名, 开发时间 | ||
186 | * @Description: TODO(这里描述这个方法的需求变更情况) | ||
187 | */ | ||
188 | @AutoLog(value = "事故案例库-通过id查询") | ||
189 | @ApiOperation(value="事故案例库-通过id查询", notes="事故案例库-通过id查询") | ||
190 | @GetMapping(value = "/queryById") | ||
191 | public Result<AccidentCase> queryById(@RequestParam(name="id",required=true) String id) { | ||
192 | Result<AccidentCase> result = new Result<AccidentCase>(); | ||
193 | AccidentCase accidentCase = accidentCaseService.getById(id); | ||
194 | if(accidentCase==null) { | ||
195 | result.error500("未找到对应实体"); | ||
196 | }else { | ||
197 | result.setResult(accidentCase); | ||
198 | result.setSuccess(true); | ||
199 | } | ||
200 | return result; | ||
201 | } | ||
202 | |||
203 | /** | ||
204 | * <pre> | ||
205 | * 导出excel | ||
206 | * </pre> | ||
207 | * @param request | ||
208 | * @param response | ||
209 | * @return | ||
210 | * @author 开发者姓名, 开发时间 | ||
211 | * @Description: TODO(这里描述这个方法的需求变更情况) | ||
212 | */ | ||
213 | |||
214 | @RequestMapping(value = "/exportXls") | ||
215 | public ModelAndView exportXls(HttpServletRequest request, HttpServletResponse response) { | ||
216 | // Step.1 组装查询条件 | ||
217 | QueryWrapper<AccidentCase> queryWrapper = null; | ||
218 | try { | ||
219 | String paramsStr = request.getParameter("paramsStr"); | ||
220 | if (ConvertUtils.isNotEmpty(paramsStr)) { | ||
221 | String deString = URLDecoder.decode(paramsStr, "UTF-8"); | ||
222 | AccidentCase accidentCase = JSON.parseObject(deString, AccidentCase.class); | ||
223 | queryWrapper = QueryGenerator.initQueryWrapper(accidentCase, request.getParameterMap()); | ||
224 | } | ||
225 | } catch (UnsupportedEncodingException e) { | ||
226 | e.printStackTrace(); | ||
227 | } | ||
228 | |||
229 | //Step.2 AutoPoi 导出Excel | ||
230 | ModelAndView mv = new ModelAndView(new JeecgEntityExcelView()); | ||
231 | List<AccidentCase> pageList = accidentCaseService.list(queryWrapper); | ||
232 | //导出文件名称 | ||
233 | mv.addObject(NormalExcelConstants.FILE_NAME, "事故案例库列表"); | ||
234 | mv.addObject(NormalExcelConstants.CLASS, AccidentCase.class); | ||
235 | mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("事故案例库列表数据", "导出人:Jeecg", "导出信息")); | ||
236 | mv.addObject(NormalExcelConstants.DATA_LIST, pageList); | ||
237 | return mv; | ||
238 | } | ||
239 | |||
240 | /** | ||
241 | * <pre> | ||
242 | * 通过excel导入数据 | ||
243 | * </pre> | ||
244 | * @param request | ||
245 | * @param response | ||
246 | * @return | ||
247 | * @author 开发者姓名, 开发时间 | ||
248 | * @Description: TODO(这里描述这个方法的需求变更情况) | ||
249 | */ | ||
250 | @RequestMapping(value = "/importExcel", method = RequestMethod.POST) | ||
251 | public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) { | ||
252 | MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request; | ||
253 | Map<String, MultipartFile> fileMap = multipartRequest.getFileMap(); | ||
254 | for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) { | ||
255 | MultipartFile file = entity.getValue();// 获取上传文件对象 | ||
256 | ImportParams params = new ImportParams(); | ||
257 | params.setTitleRows(2); | ||
258 | params.setHeadRows(1); | ||
259 | params.setNeedSave(true); | ||
260 | try { | ||
261 | List<AccidentCase> listAccidentCases = ExcelImportUtil.importExcel(file.getInputStream(), AccidentCase.class, params); | ||
262 | accidentCaseService.saveBatch(listAccidentCases); | ||
263 | return Result.ok("文件导入成功!数据行数:" + listAccidentCases.size()); | ||
264 | } catch (Exception e) { | ||
265 | log.error(e.getMessage(),e); | ||
266 | return Result.error("文件导入失败:"+e.getMessage()); | ||
267 | } finally { | ||
268 | try { | ||
269 | file.getInputStream().close(); | ||
270 | } catch (IOException e) { | ||
271 | e.printStackTrace(); | ||
272 | } | ||
273 | } | ||
274 | } | ||
275 | return Result.ok("文件导入失败!"); | ||
276 | } | ||
277 | |||
278 | } |
... | @@ -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"); | ... | ... |
... | @@ -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 | * 分页列表查询 |
... | @@ -73,8 +77,27 @@ public class DangerInspectionRecordController { | ... | @@ -73,8 +77,27 @@ public class DangerInspectionRecordController { |
73 | @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, | 77 | @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, |
74 | HttpServletRequest req) { | 78 | HttpServletRequest req) { |
75 | Result<IPage<DangerInspectionRecord>> result = new Result<IPage<DangerInspectionRecord>>(); | 79 | Result<IPage<DangerInspectionRecord>> result = new Result<IPage<DangerInspectionRecord>>(); |
76 | QueryWrapper<DangerInspectionRecord> 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); |
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 | } | ||
78 | IPage<DangerInspectionRecord> pageList = dangerInspectionRecordService.page(page, queryWrapper); | 101 | IPage<DangerInspectionRecord> pageList = dangerInspectionRecordService.page(page, queryWrapper); |
79 | result.setSuccess(true); | 102 | result.setSuccess(true); |
80 | result.setResult(pageList); | 103 | result.setResult(pageList); |
... | @@ -274,4 +297,29 @@ public class DangerInspectionRecordController { | ... | @@ -274,4 +297,29 @@ public class DangerInspectionRecordController { |
274 | return Result.ok("文件导入失败!"); | 297 | return Result.ok("文件导入失败!"); |
275 | } | 298 | } |
276 | 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 | |||
277 | } | 325 | } | ... | ... |
... | @@ -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,7 @@ public class APPDangerInspectionController { | ... | @@ -60,6 +60,7 @@ 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(); | ||
63 | dangerInspection.setLastInspectionTime(""); | 64 | dangerInspection.setLastInspectionTime(""); |
64 | } | 65 | } |
65 | if(dangerInspection==null) { | 66 | if(dangerInspection==null) { |
... | @@ -127,8 +128,8 @@ public class APPDangerInspectionController { | ... | @@ -127,8 +128,8 @@ public class APPDangerInspectionController { |
127 | return result; | 128 | return result; |
128 | } | 129 | } |
129 | 130 | ||
130 | @AutoLog(value = "巡查内容对象-保存") | 131 | @AutoLog(value = "风险巡检-提交巡检记录") |
131 | @ApiOperation(value="巡查内容对象-保存", notes="巡查内容对象-保存") | 132 | @ApiOperation(value="风险巡检-保存巡检记录", notes="风险巡检-保存巡检记录") |
132 | @PostMapping(value = "/saveInspectionInf") | 133 | @PostMapping(value = "/saveInspectionInf") |
133 | public Result<DangerInspectInfo> updateDangerInspectionInfo(@RequestBody DangerInspectionInfo dangerInspectionInfo) { | 134 | public Result<DangerInspectInfo> updateDangerInspectionInfo(@RequestBody DangerInspectionInfo dangerInspectionInfo) { |
134 | Result<DangerInspectInfo> result = new Result<DangerInspectInfo>(); | 135 | Result<DangerInspectInfo> result = new Result<DangerInspectInfo>(); |
... | @@ -141,14 +142,25 @@ public class APPDangerInspectionController { | ... | @@ -141,14 +142,25 @@ public class APPDangerInspectionController { |
141 | } | 142 | } |
142 | return result; | 143 | return result; |
143 | } | 144 | } |
144 | @AutoLog(value = "结束巡检") | 145 | @AutoLog(value = "风险巡检-结束巡检") |
145 | @ApiOperation(value="结束巡检", notes="结束巡检") | 146 | @ApiOperation(value="风险巡检-结束巡检", notes="风险巡检-结束巡检") |
146 | @PostMapping(value = "/endInspection") | 147 | @PostMapping(value = "/endInspection") |
147 | public Result<DangerInspectInfo> endInspection(@RequestParam(name="id",required=true) String id) { | 148 | public Result<DangerInspectionRecord> endInspection(@RequestParam(name="id",required=true) String id) { |
148 | Result<DangerInspectInfo> result = new Result<DangerInspectInfo>(); | 149 | Result<DangerInspectionRecord> result = new Result<DangerInspectionRecord>(); |
149 | try { | 150 | try { |
151 | DangerInspectionRecord inspectionRecord = inspectionRecordService.getById(id); | ||
152 | |||
153 | if(inspectionRecord==null) { | ||
154 | result.error500("未找到对应实体"); | ||
155 | }else { | ||
156 | inspectionRecord.setEndDate(DateUtil.getCurrentDate() ) ; | ||
157 | inspectionRecord.setStatus("2");//结束状态 | ||
158 | inspectionRecordService.updateById(inspectionRecord); | ||
159 | |||
160 | result.setResult(inspectionRecord); | ||
161 | result.setSuccess(true); | ||
162 | } | ||
150 | 163 | ||
151 | //inspectionRecordService.(id); | ||
152 | result.success("添加成功!"); | 164 | result.success("添加成功!"); |
153 | } catch (Exception e) { | 165 | } catch (Exception e) { |
154 | log.error(e.getMessage(),e); | 166 | log.error(e.getMessage(),e); |
... | @@ -157,5 +169,8 @@ public class APPDangerInspectionController { | ... | @@ -157,5 +169,8 @@ public class APPDangerInspectionController { |
157 | return result; | 169 | return result; |
158 | } | 170 | } |
159 | 171 | ||
172 | /*************************************************************************************************/ | ||
173 | |||
174 | //作废 | ||
160 | 175 | ||
161 | } | 176 | } | ... | ... |
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 |
1 | package com.skua.modules.safe.entity; | ||
2 | |||
3 | import java.io.Serializable; | ||
4 | import java.util.Date; | ||
5 | import com.baomidou.mybatisplus.annotation.IdType; | ||
6 | import com.baomidou.mybatisplus.annotation.TableId; | ||
7 | import com.baomidou.mybatisplus.annotation.TableName; | ||
8 | import com.baomidou.mybatisplus.annotation.TableField; | ||
9 | import com.skua.core.aspect.annotation.Dict; | ||
10 | import io.swagger.annotations.ApiModel; | ||
11 | import io.swagger.annotations.ApiModelProperty; | ||
12 | import lombok.Data; | ||
13 | import lombok.EqualsAndHashCode; | ||
14 | import lombok.experimental.Accessors; | ||
15 | import com.fasterxml.jackson.annotation.JsonFormat; | ||
16 | import org.springframework.format.annotation.DateTimeFormat; | ||
17 | import org.jeecgframework.poi.excel.annotation.Excel; | ||
18 | |||
19 | /** | ||
20 | * 事故案例库 | ||
21 | */ | ||
22 | @Data | ||
23 | @TableName("safe_accident_case") | ||
24 | @EqualsAndHashCode(callSuper = false) | ||
25 | @Accessors(chain = true) | ||
26 | @ApiModel(value="safe_accident_case对象", description="事故案例库") | ||
27 | public class AccidentCase { | ||
28 | |||
29 | /**id*/ | ||
30 | @TableId(type = IdType.ID_WORKER_STR) | ||
31 | @ApiModelProperty(value = "id") | ||
32 | private String id; | ||
33 | /**所属机构*/ | ||
34 | @Excel(name = "所属机构", width = 15) | ||
35 | @ApiModelProperty(value = "所属机构") | ||
36 | private String departId; | ||
37 | /**事故名称*/ | ||
38 | @Excel(name = "事故名称", width = 15) | ||
39 | @ApiModelProperty(value = "事故名称") | ||
40 | private String accidentName; | ||
41 | /**事故类型*/ | ||
42 | @Excel(name = "事故类型", width = 15) | ||
43 | @ApiModelProperty(value = "事故类型") | ||
44 | @Dict(dicCode = "safe_accident_type") | ||
45 | private String accidentType; | ||
46 | /**发生时间*/ | ||
47 | @Excel(name = "发生时间", width = 15) | ||
48 | @ApiModelProperty(value = "发生时间") | ||
49 | private String accidentTime; | ||
50 | /**发生地点*/ | ||
51 | @Excel(name = "发生地点", width = 15) | ||
52 | @ApiModelProperty(value = "发生地点") | ||
53 | private String accidentPlace; | ||
54 | /**责任部门*/ | ||
55 | @Excel(name = "责任部门", width = 15) | ||
56 | @ApiModelProperty(value = "责任部门") | ||
57 | private String dutyDepart; | ||
58 | /**责任人员(用户id)*/ | ||
59 | @Excel(name = "责任人员(用户id)", width = 15) | ||
60 | @ApiModelProperty(value = "责任人员(用户id)") | ||
61 | private String dutyUser; | ||
62 | /**事故描述*/ | ||
63 | @Excel(name = "事故描述", width = 15) | ||
64 | @ApiModelProperty(value = "事故描述") | ||
65 | private String accidentDescription; | ||
66 | /**事故后果*/ | ||
67 | @Excel(name = "事故后果", width = 15) | ||
68 | @ApiModelProperty(value = "事故后果") | ||
69 | private String accidentResult; | ||
70 | /**应急措施*/ | ||
71 | @Excel(name = "应急措施", width = 15) | ||
72 | @ApiModelProperty(value = "应急措施") | ||
73 | private String measures; | ||
74 | /**事故总结*/ | ||
75 | @Excel(name = "事故总结", width = 15) | ||
76 | @ApiModelProperty(value = "事故总结") | ||
77 | private String accidentSummary; | ||
78 | /**事故照片*/ | ||
79 | @Excel(name = "事故照片", width = 15) | ||
80 | @ApiModelProperty(value = "事故照片") | ||
81 | private String accidentImg; | ||
82 | /**事故报告文件*/ | ||
83 | @Excel(name = "事故报告文件", width = 15) | ||
84 | @ApiModelProperty(value = "事故报告文件") | ||
85 | private String accidentFile; | ||
86 | /**备注*/ | ||
87 | @Excel(name = "备注", width = 15) | ||
88 | @ApiModelProperty(value = "备注") | ||
89 | private String remark; | ||
90 | /**创建人Id*/ | ||
91 | @Excel(name = "创建人Id", width = 15) | ||
92 | @ApiModelProperty(value = "创建人Id") | ||
93 | private String createBy; | ||
94 | /**上报时间*/ | ||
95 | @Excel(name = "上报时间", width = 20, format = "yyyy-MM-dd HH:mm:ss") | ||
96 | @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") | ||
97 | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") | ||
98 | @ApiModelProperty(value = "上报时间") | ||
99 | private Date createTime; | ||
100 | /**修改人Id*/ | ||
101 | @Excel(name = "修改人Id", width = 15) | ||
102 | @ApiModelProperty(value = "修改人Id") | ||
103 | private String updateBy; | ||
104 | /**修改时间*/ | ||
105 | @Excel(name = "修改时间", width = 20, format = "yyyy-MM-dd HH:mm:ss") | ||
106 | @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") | ||
107 | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") | ||
108 | @ApiModelProperty(value = "修改时间") | ||
109 | private Date updateTime; | ||
110 | /**删除标识,1有效,0删除*/ | ||
111 | @Excel(name = "删除标识,1有效,0删除", width = 15) | ||
112 | @ApiModelProperty(value = "删除标识,1有效,0删除") | ||
113 | private Integer delFlag; | ||
114 | } |
... | @@ -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) |
... | @@ -39,6 +39,11 @@ public class DangerInspectionRecord { | ... | @@ -39,6 +39,11 @@ public class DangerInspectionRecord { |
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)") |
... | @@ -47,6 +52,14 @@ public class DangerInspectionRecord { | ... | @@ -47,6 +52,14 @@ public class DangerInspectionRecord { |
47 | @Excel(name = "上报时间", width = 15) | 52 | @Excel(name = "上报时间", width = 15) |
48 | @ApiModelProperty(value = "上报时间") | 53 | @ApiModelProperty(value = "上报时间") |
49 | private String reportDate; | 54 | private String reportDate; |
55 | |||
56 | |||
57 | /**上报时间*/ | ||
58 | @Excel(name = "结束时间", width = 15) | ||
59 | @ApiModelProperty(value = "结束时间") | ||
60 | private String endDate; | ||
61 | |||
62 | |||
50 | /**巡检状态(0:未开始,1:开始,2:结束,3:作废)*/ | 63 | /**巡检状态(0:未开始,1:开始,2:结束,3:作废)*/ |
51 | @Excel(name = "巡检状态(0:未开始,1:开始,2:结束,3:作废)", width = 15) | 64 | @Excel(name = "巡检状态(0:未开始,1:开始,2:结束,3:作废)", width = 15) |
52 | @ApiModelProperty(value = "巡检状态(0:未开始,1:开始,2:结束,3:作废)") | 65 | @ApiModelProperty(value = "巡检状态(0:未开始,1:开始,2:结束,3:作废)") |
... | @@ -83,4 +96,13 @@ public class DangerInspectionRecord { | ... | @@ -83,4 +96,13 @@ public class DangerInspectionRecord { |
83 | @TableField(exist=false) | 96 | @TableField(exist=false) |
84 | @ApiModelProperty(value = "巡检对象集合") | 97 | @ApiModelProperty(value = "巡检对象集合") |
85 | private List<DangerInspectionInfo> inspectionInfoList ; | 98 | private List<DangerInspectionInfo> inspectionInfoList ; |
99 | |||
100 | @TableField(exist=false) | ||
101 | @ApiModelProperty(value = "条件:开始时间") | ||
102 | private String startTime; | ||
103 | |||
104 | @TableField(exist=false) | ||
105 | @ApiModelProperty(value = "条件:结束时间") | ||
106 | private String endTime; | ||
107 | |||
86 | } | 108 | } | ... | ... |
... | @@ -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 | } | ... | ... |
1 | package com.skua.modules.safe.mapper; | ||
2 | |||
3 | import java.util.List; | ||
4 | |||
5 | import org.apache.ibatis.annotations.Param; | ||
6 | import com.skua.modules.safe.entity.AccidentCase; | ||
7 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; | ||
8 | |||
9 | /** | ||
10 | * 事故案例库 | ||
11 | */ | ||
12 | public interface AccidentCaseMapper extends BaseMapper<AccidentCase> { | ||
13 | |||
14 | } |
... | @@ -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 | } | ... | ... |
sk-module-biz/src/main/java/com/skua/modules/safe/service/impl/AccidentCaseServiceImpl.java
0 → 100644
1 | package com.skua.modules.safe.service.impl; | ||
2 | |||
3 | import com.skua.modules.safe.entity.AccidentCase; | ||
4 | import com.skua.modules.safe.mapper.AccidentCaseMapper; | ||
5 | import com.skua.modules.safe.service.IAccidentCaseService; | ||
6 | import org.springframework.stereotype.Service; | ||
7 | |||
8 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | ||
9 | |||
10 | /** | ||
11 | * 事故案例库 | ||
12 | */ | ||
13 | @Service | ||
14 | public class AccidentCaseServiceImpl extends ServiceImpl<AccidentCaseMapper, AccidentCase> implements IAccidentCaseService { | ||
15 | |||
16 | } |
... | @@ -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 | } | ... | ... |
... | @@ -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 ); |
... | @@ -89,6 +90,7 @@ public class DangerInspectionRecordServiceImpl extends ServiceImpl<DangerInspect | ... | @@ -89,6 +90,7 @@ public class DangerInspectionRecordServiceImpl extends ServiceImpl<DangerInspect |
89 | inspectionInfo.setInspectMethod( dangerInspectInfo.getInspectMethod()); | 90 | inspectionInfo.setInspectMethod( dangerInspectInfo.getInspectMethod()); |
90 | inspectionInfo.setInspectStandard( dangerInspectInfo.getInspectStandard() ); | 91 | inspectionInfo.setInspectStandard( dangerInspectInfo.getInspectStandard() ); |
91 | inspectionInfo.setReportUser( userId) ; | 92 | inspectionInfo.setReportUser( userId) ; |
93 | inspectionInfo.setInspectObjId( dangerInspectInfo.getId() ); | ||
92 | dangerInspectionInfoMapper.insert(inspectionInfo); | 94 | dangerInspectionInfoMapper.insert(inspectionInfo); |
93 | 95 | ||
94 | //搜索检查内容对象,检查项目 | 96 | //搜索检查内容对象,检查项目 |
... | @@ -153,4 +155,46 @@ public class DangerInspectionRecordServiceImpl extends ServiceImpl<DangerInspect | ... | @@ -153,4 +155,46 @@ public class DangerInspectionRecordServiceImpl extends ServiceImpl<DangerInspect |
153 | 155 | ||
154 | return inspectionInfoList; | 156 | return inspectionInfoList; |
155 | } | 157 | } |
158 | |||
159 | |||
160 | /*** | ||
161 | * 查询巡查集合 | ||
162 | * @param dangerId | ||
163 | * @param startTime | ||
164 | * @param endDate | ||
165 | * @return | ||
166 | */ | ||
167 | public DangerLevelManage queryListByDangerId(String dangerId, String startTime, String endDate){ | ||
168 | |||
169 | DangerLevelManage dangerLevelManage = dangerLevelManageMapper.selectById(dangerId); | ||
170 | |||
171 | //巡查对象 | ||
172 | LambdaQueryWrapper<DangerInspectionInfo> queryWrapper = new LambdaQueryWrapper<DangerInspectionInfo>(); | ||
173 | queryWrapper.eq(DangerInspectionInfo::getDangerId, dangerId); | ||
174 | queryWrapper.orderByAsc(DangerInspectionInfo::getCreateTime ); | ||
175 | List<DangerInspectionInfo> inspectionInfoList = dangerInspectionInfoMapper.selectList(queryWrapper); | ||
176 | |||
177 | |||
178 | |||
179 | if(inspectionInfoList != null && !inspectionInfoList.isEmpty()){ | ||
180 | |||
181 | LambdaQueryWrapper<DangerInspectionItem> queryItemWrapper = new LambdaQueryWrapper<DangerInspectionItem>(); | ||
182 | List<DangerInspectionItem> itemList = null; | ||
183 | for( DangerInspectionInfo info : inspectionInfoList){ | ||
184 | queryItemWrapper.eq(DangerInspectionItem::getInspectionInfoId, info.getId()); | ||
185 | queryItemWrapper.orderByAsc(DangerInspectionItem::getCreateTime ); | ||
186 | |||
187 | itemList = dangerInspectionItemMapper.selectList(queryItemWrapper); | ||
188 | if(itemList != null ) info.setInspectionItemList( itemList ) ; | ||
189 | } | ||
190 | |||
191 | dangerLevelManage.setInspectionInfoList( inspectionInfoList ); | ||
192 | } | ||
193 | |||
194 | |||
195 | |||
196 | return dangerLevelManage; | ||
197 | } | ||
198 | |||
199 | |||
156 | } | 200 | } | ... | ... |
-
请 注册 或 登录 后发表评论