| | |
| | | package com.gkhy.safePlatform.emergency.controller; |
| | | |
| | | import com.gkhy.safePlatform.commons.co.ContextCacheUser; |
| | | import com.gkhy.safePlatform.commons.query.PageQuery; |
| | | import com.gkhy.safePlatform.commons.utils.PageUtils; |
| | | import com.gkhy.safePlatform.commons.vo.ResultVO; |
| | |
| | | import com.gkhy.safePlatform.emergency.query.EmergencyPlanLogQuery; |
| | | import com.gkhy.safePlatform.emergency.service.EmergencyPlanLogService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.core.Authentication; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.security.Principal; |
| | |
| | | */ |
| | | @RequestMapping(value = "/page/list" ,method = RequestMethod.POST) |
| | | private ResultVO<List<EmergencyPlanLogRespDTO>> list (@RequestBody PageQuery<EmergencyPlanLogQuery> pageQuery){ |
| | | PageUtils.checkCheck(pageQuery.getPageIndex(), pageQuery.getPageSize()); |
| | | PageUtils.checkCheck(pageQuery); |
| | | return emergencyPlanLogService.selectEmergencyPlanLogList(pageQuery); |
| | | } |
| | | |
| | |
| | | * 应急预案启动记录新增 |
| | | */ |
| | | @RequestMapping(value = "/add",method = RequestMethod.POST) |
| | | public ResultVO addEmergencyPlanLog(Principal principal, @RequestBody EmergencyPlanLogReqDTO emergencyPlanLogReqDTO) { |
| | | String uid = principal.getName(); |
| | | return emergencyPlanLogService.addEmergencyPlanLog(Long.valueOf(uid), emergencyPlanLogReqDTO); |
| | | public ResultVO addEmergencyPlanLog(Authentication authentication, @RequestBody EmergencyPlanLogReqDTO emergencyPlanLogReqDTO) { |
| | | ContextCacheUser currentUser = (ContextCacheUser) authentication.getPrincipal(); |
| | | return emergencyPlanLogService.addEmergencyPlanLog(currentUser, emergencyPlanLogReqDTO); |
| | | } |
| | | |
| | | /** |
| | |
| | | } |
| | | |
| | | /** |
| | | * 应急预案修改 |
| | | * 应急预案启动记录修改 |
| | | */ |
| | | @RequestMapping(value = "/update",method = RequestMethod.POST) |
| | | public ResultVO updateEmergencyPlanLog(Principal principal, @RequestBody EmergencyPlanLogReqDTO emergencyPlanLogReqDTO) { |
| | | String uid = principal.getName(); |
| | | return emergencyPlanLogService.updateEmergencyPlanLog(Long.valueOf(uid), emergencyPlanLogReqDTO); |
| | | public ResultVO updateEmergencyPlanLog(Authentication authentication, @RequestBody EmergencyPlanLogReqDTO emergencyPlanLogReqDTO) { |
| | | ContextCacheUser currentUser = (ContextCacheUser) authentication.getPrincipal(); |
| | | return emergencyPlanLogService.updateEmergencyPlanLog(currentUser.getUid(), emergencyPlanLogReqDTO); |
| | | } |
| | | |
| | | /** |
| | | * 应急预案删除/批量删除 |
| | | * 应急预案启动记录删除/批量删除 |
| | | */ |
| | | @RequestMapping(value = "/batchDelete/{ids}",method = RequestMethod.GET) |
| | | public ResultVO batchDeleteEmergencyPlanLog(@PathVariable("ids")String ids){ |
| | | @RequestMapping(value = "/batchDelete",method = RequestMethod.POST) |
| | | public ResultVO batchDeleteEmergencyPlanLog(@RequestBody Long[] ids){ |
| | | return emergencyPlanLogService.batchDeleteEmergencyPlanLog(ids); |
| | | } |
| | | } |