From 92c1b6d108288abfc24fe5f4d2beed7915284e60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=AE=B5=E9=A3=9E=E5=AE=87?= <2684146481@qq.com> Date: Wed, 26 Jul 2023 10:17:01 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=AE=89=E5=85=A8=E5=AE=89?= =?UTF-8?q?=E5=85=A8=E7=AE=A1=E7=90=86=E6=97=A5=E5=BF=97=E6=B3=A8=E8=A7=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../safeproduct/controller/AccidentController.java | 152 ++++++++++----------- .../controller/CheckMonthController.java | 2 +- .../controller/DangerSourceController.java | 2 +- .../controller/EmergencyPlanController.java | 2 +- .../controller/SafetyToolController.java | 2 +- .../controller/SafetyToolTypeController.java | 2 +- .../controller/SystemFileController.java | 2 +- 7 files changed, 80 insertions(+), 84 deletions(-) diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/AccidentController.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/AccidentController.java index 55e1ed5..6cd9bc6 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/AccidentController.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/AccidentController.java @@ -45,89 +45,85 @@ import java.util.concurrent.locks.ReentrantReadWriteLock; @Slf4j @AllArgsConstructor @RequestMapping("/accident") -@Api(value = "事故管理",tags = "事故管理") +@Api(value = "事故管理", tags = "事故管理") public class AccidentController extends BladeController { - private final IAccidentService accidentService; - private final IOssClient ossClient; - private static ReentrantReadWriteLock lock = new ReentrantReadWriteLock(); - private static ReentrantReadWriteLock.WriteLock writeLock = lock.writeLock(); - private static ReentrantReadWriteLock.ReadLock readLock = lock.readLock(); + private final IAccidentService accidentService; + private final IOssClient ossClient; + private static ReentrantReadWriteLock lock = new ReentrantReadWriteLock(); + private static ReentrantReadWriteLock.WriteLock writeLock = lock.writeLock(); + private static ReentrantReadWriteLock.ReadLock readLock = lock.readLock(); - @PostMapping("/save") - @ApiOperation("事故管理保存") - @ApiOperationSupport(order = 1) - public R save(@RequestBody @Valid AccidentDTO req) { - AccidentEntity accidentEntity = BeanUtil.copy(req,AccidentEntity.class); - accidentService.save(accidentEntity); - return R.data(accidentEntity); - } + @PostMapping("/save") + @ApiOperation("事故管理保存") + @ApiOperationSupport(order = 1) + public R save(@RequestBody @Valid AccidentDTO req) { + AccidentEntity accidentEntity = BeanUtil.copy(req, AccidentEntity.class); + accidentService.save(accidentEntity); + return R.data(accidentEntity); + } - @GetMapping("/detail/{id}") - @ApiOperation("事故管理查询详情") - @ApiOperationSupport(order = 2) - public R detail(@PathVariable(value = "id") Long id) { - AccidentVO accidentVO = null; - readLock.lock(); - try{ - AccidentEntity accidentEntity = accidentService.getById(id); - if( ObjectUtil.isNotEmpty(accidentEntity)) { - accidentVO = AccidentWrapper.build().entityVO(accidentEntity); - } - } - catch(Exception e){ - e.printStackTrace(); - } - finally { - readLock.unlock(); - } - return R.data(accidentVO); - } + @GetMapping("/detail/{id}") + @ApiOperation("事故管理查询详情") + @ApiOperationSupport(order = 2) + public R detail(@PathVariable(value = "id") Long id) { + AccidentVO accidentVO = null; + readLock.lock(); + try { + AccidentEntity accidentEntity = accidentService.getById(id); + if (ObjectUtil.isNotEmpty(accidentEntity)) { + accidentVO = AccidentWrapper.build().entityVO(accidentEntity); + } + } catch (Exception e) { + e.printStackTrace(); + } finally { + readLock.unlock(); + } + return R.data(accidentVO); + } - @PostMapping("updateById") - @ApiOperation("根据ID修改事故") - @ApiOperationSupport(order = 3) - @Transactional(rollbackFor = Exception.class) - public R updateById (@RequestBody @Valid AccidentDTO req) { - writeLock.lock(); - try{ - AccidentEntity accidentEntity = BeanUtil.copy(req,AccidentEntity.class); - accidentService.updateById(accidentEntity); - } - catch(Exception e) { - e.printStackTrace(); - } - finally { - writeLock.unlock(); - } - return R.success("操作成功"); - } + @PostMapping("updateById") + @ApiOperation("根据ID修改事故") + @ApiOperationSupport(order = 3) + @Transactional(rollbackFor = Exception.class) + public R updateById(@RequestBody @Valid AccidentDTO req) { + writeLock.lock(); + try { + AccidentEntity accidentEntity = BeanUtil.copy(req, AccidentEntity.class); + accidentService.updateById(accidentEntity); + } catch (Exception e) { + e.printStackTrace(); + } finally { + writeLock.unlock(); + } + return R.success("操作成功"); + } - @PutMapping("/remove/{ids}") - @ApiOperation("删除事故管理,id按逗号分隔") - @ApiOperationSupport(order = 4) - public R remove(@PathVariable(value = "ids") @Valid String ids) { - List idList = Func.toLongList(ids); - return R.status(accidentService.deleteLogic(idList)); - } + @PutMapping("/remove/{ids}") + @ApiOperation("删除事故管理,id按逗号分隔") + @ApiOperationSupport(order = 4) + public R remove(@PathVariable(value = "ids") @Valid String ids) { + List idList = Func.toLongList(ids); + return R.status(accidentService.deleteLogic(idList)); + } - @ApiLog - @GetMapping("/pageList") - @ApiOperation("分页查询") - @ApiOperationSupport(order = 5) - @OperationAnnotation(moduleName = "安全管理", - title = "事故管理",operatorType = OperatorType.MOBILE,businessType = BusinessType.GENCODE, - action = "分页条件") - public R pageList(AccidentDTO req, Query query){ - AccidentEntity accidentEntity = BeanUtil.copy(req,AccidentEntity.class); - LambdaQueryWrapper queryWrapper = Condition.getQueryWrapper(new AccidentEntity(),accidentEntity); - if(ObjectUtil.isNotEmpty(req.getStatus())){ - queryWrapper.eq(AccidentEntity::getStatus,req.getStatus()); - } - IPage page = accidentService.page(Condition.getPage(query),queryWrapper); - if(CollectionUtil.isNotEmpty(page.getRecords())){ - page.setRecords(AccidentWrapper.build().listVO(page.getRecords())); - } - return R.data(page); - } + @ApiLog + @GetMapping("/pageList") + @ApiOperation("分页查询") + @ApiOperationSupport(order = 5) + @OperationAnnotation(moduleName = "安全管理", + title = "事故管理", operatorType = OperatorType.MOBILE, businessType = BusinessType.GENCODE, + action = "分页查询事故管理列表") + public R pageList(AccidentDTO req, Query query) { + AccidentEntity accidentEntity = BeanUtil.copy(req, AccidentEntity.class); + LambdaQueryWrapper queryWrapper = Condition.getQueryWrapper(new AccidentEntity(), accidentEntity); + if (ObjectUtil.isNotEmpty(req.getStatus())) { + queryWrapper.eq(AccidentEntity::getStatus, req.getStatus()); + } + IPage page = accidentService.page(Condition.getPage(query), queryWrapper); + if (CollectionUtil.isNotEmpty(page.getRecords())) { + page.setRecords(AccidentWrapper.build().listVO(page.getRecords())); + } + return R.data(page); + } } diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/CheckMonthController.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/CheckMonthController.java index 71dcd62..25724c4 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/CheckMonthController.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/CheckMonthController.java @@ -103,7 +103,7 @@ public class CheckMonthController extends BladeController { @ApiOperation(value = "分页", notes = "查询条件:month,status,createDept") @OperationAnnotation(moduleName = "安全管理", title = "月度自查核查",operatorType = OperatorType.MOBILE,businessType = BusinessType.GENCODE, - action = "分页") + action = "分页查询月度自查核查数据") public R> listNotDataScope(CheckMonthEntity req, Query query) { R> pageR = checkMonthlyService.pageNotDataScope(req, query); IPage page = pageR.getData(); diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/DangerSourceController.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/DangerSourceController.java index 994a819..5215e5c 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/DangerSourceController.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/DangerSourceController.java @@ -85,7 +85,7 @@ public class DangerSourceController extends BladeController { @ApiOperation(value = "分页", notes = "查询条件:eqId,level,`dangerEle,applyType,type") @OperationAnnotation(moduleName = "安全管理",title = "危险点列表",operatorType = OperatorType.MOBILE,businessType = BusinessType.GENCODE, - action = "分页") + action = "分页查询危险点列表列表") public R> list(DangerSourceEntity req, Query query) { return dangerSourceService.pageCondition(req, query); } diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/EmergencyPlanController.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/EmergencyPlanController.java index 307abc0..2529e30 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/EmergencyPlanController.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/EmergencyPlanController.java @@ -81,7 +81,7 @@ public class EmergencyPlanController extends BladeController { @ApiOperationSupport(order = 50) @OperationAnnotation(moduleName = "安全管理",title = "应急预案文件",operatorType = OperatorType.MOBILE,businessType = BusinessType.GENCODE, - action = "分页条件") + action = "分页查询应急预案文件列表") @ApiOperation(value = "分页", notes = "查询条件:typeId,fileStatus,fileName") public R> list(EmergencyPlanListDTO req, Query query) { return emergencyPlanService.pageCondition(req, query); diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/SafetyToolController.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/SafetyToolController.java index cab97dc..3457261 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/SafetyToolController.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/SafetyToolController.java @@ -99,7 +99,7 @@ public class SafetyToolController extends BladeController { @ApiOperationSupport(order = 50) @OperationAnnotation(moduleName = "安全管理",title = "安全工具器",operatorType = OperatorType.MOBILE,businessType = BusinessType.GENCODE, - action = "分页条件") + action = "分页查询安全工具器列表") @ApiOperation(value = "分页", notes = "查询条件:typeId,toolName,toolCode") public R> list(SafetyToolDTO req, Query query) { return safetyToolService.pageCondition(req, query); diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/SafetyToolTypeController.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/SafetyToolTypeController.java index 8723ca2..32f3f5e 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/SafetyToolTypeController.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/SafetyToolTypeController.java @@ -98,7 +98,7 @@ public class SafetyToolTypeController extends BladeController { @GetMapping("/list") @ApiOperationSupport(order = 60) @OperationAnnotation(moduleName = "安全管理",title = "安全工器具类型",operatorType = OperatorType.MOBILE,businessType = BusinessType.GENCODE, - action = "分页条件") + action = "分页查询安全工器具类型数据") @ApiOperation(value = "分页", notes = "查询条件:sendType,name,startSendTime,endSendTime") public R> list(SafetyToolTypeListDTO req, Query query) { return R.data(safetyToolTypeService.pageCondition(req, query)); diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/SystemFileController.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/SystemFileController.java index 677242c..bf75d8e 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/SystemFileController.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/SystemFileController.java @@ -87,7 +87,7 @@ public class SystemFileController extends BladeController { @ApiOperation(value = "分页", notes = "查询条件:fTypeId,fileStatus,fileName") @OperationAnnotation(moduleName = "安全管理",title = "体系文件",operatorType = OperatorType.MOBILE,businessType = BusinessType.GENCODE, - action = "分页条件") + action = "分页查询体系文件数据") public R> list(SystemFileListDTO req, Query query) { return systemFileService.pageCondition(req, query); }