| | |
| | | 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.EmergencyDrillEvaluationQuery; |
| | | import com.gkhy.safePlatform.emergency.service.EmergencyDrillEvaluationService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.core.Authentication; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.security.Principal; |
| | | import java.util.List; |
| | | |
| | | @RestController |
| | |
| | | * 应急演练实施评价新增 |
| | | */ |
| | | @RequestMapping(value = "/add",method = RequestMethod.POST) |
| | | public ResultVO addEmergencyDrillEvaluation(Principal principal, @RequestBody EmergencyDrillEvaluationReqDTO emergencyDrillEvaluationReqDTO) { |
| | | String uid = principal.getName(); |
| | | return emergencyDrillEvaluationService.addEmergencyDrillEvaluation(Long.valueOf(uid), emergencyDrillEvaluationReqDTO); |
| | | public ResultVO addEmergencyDrillEvaluation(Authentication authentication, @RequestBody EmergencyDrillEvaluationReqDTO emergencyDrillEvaluationReqDTO) { |
| | | ContextCacheUser currentUser = (ContextCacheUser) authentication.getPrincipal(); |
| | | return emergencyDrillEvaluationService.addEmergencyDrillEvaluation(currentUser.getUid(), emergencyDrillEvaluationReqDTO); |
| | | } |
| | | |
| | | /** |
| | |
| | | * 应急演练实施评价修改 |
| | | */ |
| | | @RequestMapping(value = "/update",method = RequestMethod.POST) |
| | | public ResultVO updateEmergencyDrillEvaluation(Principal principal, @RequestBody EmergencyDrillEvaluationReqDTO emergencyDrillEvaluationReqDTO) { |
| | | String uid = principal.getName(); |
| | | return emergencyDrillEvaluationService.updateEmergencyDrillEvaluation(Long.valueOf(uid), emergencyDrillEvaluationReqDTO); |
| | | public ResultVO updateEmergencyDrillEvaluation(Authentication authentication, @RequestBody EmergencyDrillEvaluationReqDTO emergencyDrillEvaluationReqDTO) { |
| | | ContextCacheUser currentUser = (ContextCacheUser) authentication.getPrincipal(); |
| | | return emergencyDrillEvaluationService.updateEmergencyDrillEvaluation(currentUser.getUid(), emergencyDrillEvaluationReqDTO); |
| | | } |
| | | |
| | | /** |
| | |
| | | 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.EmergencyDrillExecuteQuery; |
| | | import com.gkhy.safePlatform.emergency.service.EmergencyDrillExecuteService; |
| | | 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 = "/add",method = RequestMethod.POST) |
| | | public ResultVO addEmergencyDrillExecute(Principal principal, @RequestBody EmergencyDrillExecuteReqDTO emergencyDrillExecuteReqDTO) { |
| | | String uid = principal.getName(); |
| | | return emergencyDrillExecuteService.addEmergencyDrillExecute(Long.valueOf(uid), emergencyDrillExecuteReqDTO); |
| | | public ResultVO addEmergencyDrillExecute(Authentication authentication, @RequestBody EmergencyDrillExecuteReqDTO emergencyDrillExecuteReqDTO) { |
| | | ContextCacheUser currentUser = (ContextCacheUser) authentication.getPrincipal(); |
| | | return emergencyDrillExecuteService.addEmergencyDrillExecute(currentUser.getUid(), emergencyDrillExecuteReqDTO); |
| | | } |
| | | |
| | | /** |
| | |
| | | * 应急演练实施修改 |
| | | */ |
| | | @RequestMapping(value = "/update",method = RequestMethod.POST) |
| | | public ResultVO updateEmergencyDrillExecute(Principal principal, @RequestBody EmergencyDrillExecuteReqDTO emergencyDrillExecuteReqDTO) { |
| | | String uid = principal.getName(); |
| | | return emergencyDrillExecuteService.updateEmergencyDrillExecute(Long.valueOf(uid), emergencyDrillExecuteReqDTO); |
| | | public ResultVO updateEmergencyDrillExecute(Authentication authentication, @RequestBody EmergencyDrillExecuteReqDTO emergencyDrillExecuteReqDTO) { |
| | | ContextCacheUser currentUser = (ContextCacheUser) authentication.getPrincipal(); |
| | | return emergencyDrillExecuteService.updateEmergencyDrillExecute(currentUser.getUid(), emergencyDrillExecuteReqDTO); |
| | | } |
| | | |
| | | /** |
| | |
| | | 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.EmergencyDrillPlanQuery; |
| | | import com.gkhy.safePlatform.emergency.service.EmergencyDrillPlanService; |
| | | 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 = "/add",method = RequestMethod.POST) |
| | | public ResultVO addEmergencyDrillPlan(Principal principal, @RequestBody EmergencyDrillPlanReqDTO emergencyDrillPlanReqDTO) { |
| | | String uid = principal.getName(); |
| | | return emergencyDrillPlanService.addEmergencyDrillPlan(Long.valueOf(uid), emergencyDrillPlanReqDTO); |
| | | public ResultVO addEmergencyDrillPlan(Authentication authentication, @RequestBody EmergencyDrillPlanReqDTO emergencyDrillPlanReqDTO) { |
| | | ContextCacheUser currentUser = (ContextCacheUser) authentication.getPrincipal(); |
| | | return emergencyDrillPlanService.addEmergencyDrillPlan(currentUser.getUid(), emergencyDrillPlanReqDTO); |
| | | } |
| | | |
| | | /** |
| | |
| | | * 应急演练计划修改 |
| | | */ |
| | | @RequestMapping(value = "/update",method = RequestMethod.POST) |
| | | public ResultVO updateEmergencyDrillPlan(Principal principal, @RequestBody EmergencyDrillPlanReqDTO emergencyDrillPlanReqDTO) { |
| | | String uid = principal.getName(); |
| | | return emergencyDrillPlanService.updateEmergencyDrillPlan(Long.valueOf(uid), emergencyDrillPlanReqDTO); |
| | | public ResultVO updateEmergencyDrillPlan(Authentication authentication, @RequestBody EmergencyDrillPlanReqDTO emergencyDrillPlanReqDTO) { |
| | | ContextCacheUser currentUser = (ContextCacheUser) authentication.getPrincipal(); |
| | | return emergencyDrillPlanService.updateEmergencyDrillPlan(currentUser.getUid(), emergencyDrillPlanReqDTO); |
| | | } |
| | | |
| | | /** |
| | |
| | | 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.EmergencyPlanQuery; |
| | | import com.gkhy.safePlatform.emergency.service.EmergencyPlanService; |
| | | 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 = "/add",method = RequestMethod.POST) |
| | | public ResultVO addEmergencyPlan(Principal principal, @RequestBody EmergencyPlanReqDTO emergencyPlanReqDTO) { |
| | | String uid = principal.getName(); |
| | | return emergencyPlanService.addEmergencyPlan(Long.valueOf(uid), emergencyPlanReqDTO); |
| | | public ResultVO addEmergencyPlan(Authentication authentication, @RequestBody EmergencyPlanReqDTO emergencyPlanReqDTO) { |
| | | ContextCacheUser currentUser = (ContextCacheUser) authentication.getPrincipal(); |
| | | return emergencyPlanService.addEmergencyPlan(currentUser.getUid(), emergencyPlanReqDTO); |
| | | } |
| | | |
| | | /** |
| | |
| | | * 应急预案修改 |
| | | */ |
| | | @RequestMapping(value = "/update",method = RequestMethod.POST) |
| | | public ResultVO updateEmergencyPlan(Principal principal, @RequestBody EmergencyPlanReqDTO emergencyPlanReqDTO) { |
| | | String uid = principal.getName(); |
| | | return emergencyPlanService.updateEmergencyPlan(Long.valueOf(uid), emergencyPlanReqDTO); |
| | | public ResultVO updateEmergencyPlan(Authentication authentication, @RequestBody EmergencyPlanReqDTO emergencyPlanReqDTO) { |
| | | ContextCacheUser currentUser = (ContextCacheUser) authentication.getPrincipal(); |
| | | return emergencyPlanService.updateEmergencyPlan(currentUser.getUid(), emergencyPlanReqDTO); |
| | | } |
| | | |
| | | /** |
| | |
| | | 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 = "/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.getUid(), 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); |
| | | } |
| | | |
| | | /** |
| | |
| | | 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.EmergencySuppliesQuery; |
| | | import com.gkhy.safePlatform.emergency.service.EmergencySuppliesService; |
| | | 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 = "/add",method = RequestMethod.POST) |
| | | public ResultVO addEmergencySupplies(Principal principal, @RequestBody EmergencySuppliesReqDTO emergencySuppliesReqDTO) { |
| | | String uid = principal.getName(); |
| | | return emergencySuppliesService.addEmergencySupplies(Long.valueOf(uid), emergencySuppliesReqDTO); |
| | | public ResultVO addEmergencySupplies(Authentication authentication, @RequestBody EmergencySuppliesReqDTO emergencySuppliesReqDTO) { |
| | | ContextCacheUser currentUser = (ContextCacheUser) authentication.getPrincipal(); |
| | | return emergencySuppliesService.addEmergencySupplies(currentUser.getUid(), emergencySuppliesReqDTO); |
| | | } |
| | | |
| | | /** |
| | |
| | | * 应急预案修改 |
| | | */ |
| | | @RequestMapping(value = "/update",method = RequestMethod.POST) |
| | | public ResultVO updateEmergencySupplies(Principal principal, @RequestBody EmergencySuppliesReqDTO emergencySuppliesReqDTO) { |
| | | String uid = principal.getName(); |
| | | return emergencySuppliesService.updateEmergencySupplies(Long.valueOf(uid), emergencySuppliesReqDTO); |
| | | public ResultVO updateEmergencySupplies(Authentication authentication, @RequestBody EmergencySuppliesReqDTO emergencySuppliesReqDTO) { |
| | | ContextCacheUser currentUser = (ContextCacheUser) authentication.getPrincipal(); |
| | | return emergencySuppliesService.updateEmergencySupplies(currentUser.getUid(), emergencySuppliesReqDTO); |
| | | } |
| | | |
| | | /** |
| | |
| | | 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.EmergencySuppliesInspectQuery; |
| | | import com.gkhy.safePlatform.emergency.service.EmergencySuppliesInspectService; |
| | | 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 = "/add",method = RequestMethod.POST) |
| | | public ResultVO addEmergencySuppliesInspect(Principal principal, @RequestBody EmergencySuppliesInspectReqDTO emergencySuppliesInspectReqDTO) { |
| | | String uid = principal.getName(); |
| | | return emergencySuppliesInspectService.addEmergencySuppliesInspect(Long.valueOf(uid), emergencySuppliesInspectReqDTO); |
| | | public ResultVO addEmergencySuppliesInspect(Authentication authentication, @RequestBody EmergencySuppliesInspectReqDTO emergencySuppliesInspectReqDTO) { |
| | | ContextCacheUser currentUser = (ContextCacheUser) authentication.getPrincipal(); |
| | | return emergencySuppliesInspectService.addEmergencySuppliesInspect(currentUser.getUid(), emergencySuppliesInspectReqDTO); |
| | | } |
| | | |
| | | /** |
| | |
| | | * 应急物资检查修改 |
| | | */ |
| | | @RequestMapping(value = "/update",method = RequestMethod.POST) |
| | | public ResultVO updateEmergencySuppliesInspect(Principal principal, @RequestBody EmergencySuppliesInspectReqDTO emergencySuppliesInspectReqDTO) { |
| | | String uid = principal.getName(); |
| | | return emergencySuppliesInspectService.updateEmergencySuppliesInspect(Long.valueOf(uid), emergencySuppliesInspectReqDTO); |
| | | public ResultVO updateEmergencySuppliesInspect(Authentication authentication, @RequestBody EmergencySuppliesInspectReqDTO emergencySuppliesInspectReqDTO) { |
| | | ContextCacheUser currentUser = (ContextCacheUser) authentication.getPrincipal(); |
| | | return emergencySuppliesInspectService.updateEmergencySuppliesInspect(currentUser.getUid(), emergencySuppliesInspectReqDTO); |
| | | } |
| | | |
| | | /** |
| | |
| | | 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.EmergencySuppliesMaintainQuery; |
| | | import com.gkhy.safePlatform.emergency.service.EmergencySuppliesMaintainService; |
| | | 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 = "/add",method = RequestMethod.POST) |
| | | public ResultVO addEmergencySuppliesMaintain(Principal principal, @RequestBody EmergencySuppliesMaintainReqDTO emergencySuppliesMaintainReqDTO) { |
| | | String uid = principal.getName(); |
| | | return emergencySuppliesMaintainService.addEmergencySuppliesMaintain(Long.valueOf(uid), emergencySuppliesMaintainReqDTO); |
| | | public ResultVO addEmergencySuppliesMaintain(Authentication authentication, @RequestBody EmergencySuppliesMaintainReqDTO emergencySuppliesMaintainReqDTO) { |
| | | ContextCacheUser currentUser = (ContextCacheUser) authentication.getPrincipal(); |
| | | return emergencySuppliesMaintainService.addEmergencySuppliesMaintain(currentUser.getUid(), emergencySuppliesMaintainReqDTO); |
| | | } |
| | | |
| | | /** |
| | |
| | | * 应急物资检查修改 |
| | | */ |
| | | @RequestMapping(value = "/update",method = RequestMethod.POST) |
| | | public ResultVO updateEmergencySuppliesMaintain(Principal principal, @RequestBody EmergencySuppliesMaintainReqDTO emergencySuppliesMaintainReqDTO) { |
| | | String uid = principal.getName(); |
| | | return emergencySuppliesMaintainService.updateEmergencySuppliesMaintain(Long.valueOf(uid), emergencySuppliesMaintainReqDTO); |
| | | public ResultVO updateEmergencySuppliesMaintain(Authentication authentication, @RequestBody EmergencySuppliesMaintainReqDTO emergencySuppliesMaintainReqDTO) { |
| | | ContextCacheUser currentUser = (ContextCacheUser) authentication.getPrincipal(); |
| | | return emergencySuppliesMaintainService.updateEmergencySuppliesMaintain(currentUser.getUid(), emergencySuppliesMaintainReqDTO); |
| | | } |
| | | |
| | | /** |
| | |
| | | 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.EmergencyTeamQuery; |
| | | import com.gkhy.safePlatform.emergency.service.EmergencyTeamService; |
| | | 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 = "/add",method = RequestMethod.POST) |
| | | public ResultVO addEmergencyTeam(Principal principal, @RequestBody EmergencyTeamReqDTO emergencyTeamReqDTO) { |
| | | String uid = principal.getName(); |
| | | return emergencyTeamService.addEmergencyTeam(Long.valueOf(uid), emergencyTeamReqDTO); |
| | | public ResultVO addEmergencyTeam(Authentication authentication, @RequestBody EmergencyTeamReqDTO emergencyTeamReqDTO) { |
| | | ContextCacheUser currentUser = (ContextCacheUser) authentication.getPrincipal(); |
| | | return emergencyTeamService.addEmergencyTeam(currentUser.getUid(), emergencyTeamReqDTO); |
| | | } |
| | | |
| | | /** |
| | |
| | | * 应急队伍修改 |
| | | */ |
| | | @RequestMapping(value = "/update",method = RequestMethod.POST) |
| | | public ResultVO updateEmergencyTeam(Principal principal, @RequestBody EmergencyTeamReqDTO emergencyTeamReqDTO) { |
| | | String uid = principal.getName(); |
| | | return emergencyTeamService.updateEmergencyTeam(Long.valueOf(uid), emergencyTeamReqDTO); |
| | | public ResultVO updateEmergencyTeam(Authentication authentication, @RequestBody EmergencyTeamReqDTO emergencyTeamReqDTO) { |
| | | ContextCacheUser currentUser = (ContextCacheUser) authentication.getPrincipal(); |
| | | return emergencyTeamService.updateEmergencyTeam(currentUser.getUid(), emergencyTeamReqDTO); |
| | | } |
| | | |
| | | /** |
| | |
| | | * 应急队伍修改(应急人员新增) |
| | | */ |
| | | @RequestMapping(value = "/addMember",method = RequestMethod.POST) |
| | | public ResultVO addEmergencyTeamMember(Principal principal, @RequestBody EmergencyTeamMemberReqDTO emergencyTeamMemberReqDTO) { |
| | | String uid = principal.getName(); |
| | | return emergencyTeamService.addEmergencyTeamMember(Long.valueOf(uid), emergencyTeamMemberReqDTO); |
| | | public ResultVO addEmergencyTeamMember(Authentication authentication, @RequestBody EmergencyTeamMemberReqDTO emergencyTeamMemberReqDTO) { |
| | | ContextCacheUser currentUser = (ContextCacheUser) authentication.getPrincipal(); |
| | | return emergencyTeamService.addEmergencyTeamMember(currentUser.getUid(), emergencyTeamMemberReqDTO); |
| | | } |
| | | |
| | | /** |
| | |
| | | * 应急队伍修改(应急人员修改) |
| | | */ |
| | | @RequestMapping(value = "/updateMember",method = RequestMethod.POST) |
| | | public ResultVO updateEmergencyTeamMember(Principal principal, @RequestBody EmergencyTeamMemberReqDTO emergencyTeamMemberReqDTO) { |
| | | String uid = principal.getName(); |
| | | return emergencyTeamService.updateEmergencyTeamMember(Long.valueOf(uid), emergencyTeamMemberReqDTO); |
| | | public ResultVO updateEmergencyTeamMember(Authentication authentication, @RequestBody EmergencyTeamMemberReqDTO emergencyTeamMemberReqDTO) { |
| | | ContextCacheUser currentUser = (ContextCacheUser) authentication.getPrincipal(); |
| | | return emergencyTeamService.updateEmergencyTeamMember(currentUser.getUid(), emergencyTeamMemberReqDTO); |
| | | } |
| | | /** |
| | | * 应急队伍修改(应急人员删除) |
| | |
| | | import com.gkhy.safePlatform.account.rpc.apimodel.model.req.DepAddRPCReqDTO; |
| | | import com.gkhy.safePlatform.account.rpc.apimodel.model.req.DepModRPCReqDTO; |
| | | import com.gkhy.safePlatform.account.rpc.apimodel.model.resp.DepRPCRespDTO; |
| | | import com.gkhy.safePlatform.commons.co.ContextCacheUser; |
| | | import com.gkhy.safePlatform.commons.enums.ResultCodes; |
| | | import com.gkhy.safePlatform.commons.vo.ResultVO; |
| | | import org.apache.dubbo.config.annotation.DubboReference; |
| | | import org.springframework.security.core.Authentication; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestMethod; |
| | |
| | | |
| | | |
| | | @RequestMapping(value = "/add", method = RequestMethod.POST) |
| | | public ResultVO<String> addDepartment(Principal principal, @RequestBody DepAddRPCReqDTO depAddRPCReqDTO) { |
| | | String userId = principal.getName(); |
| | | return accountDepartmentService.addDep(Long.valueOf(userId) , depAddRPCReqDTO); |
| | | public ResultVO<String> addDepartment(Authentication authentication, @RequestBody DepAddRPCReqDTO depAddRPCReqDTO) { |
| | | ContextCacheUser currentUser = (ContextCacheUser) authentication.getPrincipal(); |
| | | return accountDepartmentService.addDep(currentUser.getUid(), depAddRPCReqDTO); |
| | | } |
| | | |
| | | |
| | | @RequestMapping(value = "/mod", method = RequestMethod.POST) |
| | | public ResultVO<String> addDepartment(Principal principal, @RequestBody DepModRPCReqDTO depModRPCReqDTO) { |
| | | String userId = principal.getName(); |
| | | return accountDepartmentService.modDep(Long.valueOf(userId) , depModRPCReqDTO); |
| | | public ResultVO<String> addDepartment(Authentication authentication, @RequestBody DepModRPCReqDTO depModRPCReqDTO) { |
| | | ContextCacheUser currentUser = (ContextCacheUser) authentication.getPrincipal(); |
| | | return accountDepartmentService.modDep(currentUser.getUid(), depModRPCReqDTO); |
| | | } |
| | | |
| | | |
| | | @RequestMapping(value = "/del", method = RequestMethod.POST) |
| | | public ResultVO<String> addDepartment(Principal principal, @RequestBody JSONObject json) { |
| | | String userId = principal.getName(); |
| | | public ResultVO<String> addDepartment(Authentication authentication, @RequestBody JSONObject json) { |
| | | ContextCacheUser currentUser = (ContextCacheUser) authentication.getPrincipal(); |
| | | Long depId = json.getLong("depId"); |
| | | return accountDepartmentService.delDep(Long.valueOf(userId) , depId); |
| | | return accountDepartmentService.delDep(currentUser.getUid(), depId); |
| | | } |
| | | |
| | | |
| | |
| | | import com.gkhy.safePlatform.account.rpc.apimodel.AccountAuthService; |
| | | import com.gkhy.safePlatform.account.rpc.apimodel.model.resp.MenuRPCRespDTO; |
| | | import com.gkhy.safePlatform.account.rpc.apimodel.model.resp.UserLoginRPCRespDTO; |
| | | import com.gkhy.safePlatform.commons.co.ContextCacheUser; |
| | | import com.gkhy.safePlatform.commons.vo.ResultVO; |
| | | import org.apache.dubbo.config.annotation.DubboReference; |
| | | import org.apache.dubbo.config.annotation.DubboService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.core.Authentication; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | |
| | | } |
| | | |
| | | @RequestMapping("/menu") |
| | | public ResultVO<List<MenuRPCRespDTO>> getMenu(Principal principal, Long projectId){ |
| | | String userId = principal.getName(); |
| | | return accountAuthService.getMenu(Long.valueOf(userId), projectId); |
| | | public ResultVO<List<MenuRPCRespDTO>> getMenu(Authentication authentication, Long projectId){ |
| | | ContextCacheUser currentUser = (ContextCacheUser) authentication.getPrincipal(); |
| | | return accountAuthService.getMenu(currentUser.getUid(), projectId); |
| | | } |
| | | } |
| | |
| | | package com.gkhy.safePlatform.accountController; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.gkhy.safePlatform.account.rpc.apimodel.AccountMenuService; |
| | | import com.gkhy.safePlatform.account.rpc.apimodel.model.req.MenuAddRPCReqDTO; |
| | | import com.gkhy.safePlatform.account.rpc.apimodel.model.resp.MenuModRPCReqDTO; |
| | | import com.gkhy.safePlatform.commons.co.ContextCacheUser; |
| | | import com.gkhy.safePlatform.commons.enums.ResultCodes; |
| | | import com.gkhy.safePlatform.commons.vo.ResultVO; |
| | | import org.apache.dubbo.config.annotation.DubboReference; |
| | | import org.springframework.security.core.Authentication; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestMethod; |
| | |
| | | * @Description: 新增菜单 |
| | | */ |
| | | @RequestMapping(value = "/add",method = RequestMethod.POST) |
| | | public ResultVO<String> addMenu(Principal principal, @RequestBody MenuAddRPCReqDTO menuAddDto) { |
| | | String userId = principal.getName(); |
| | | return accountMenuService.addMenu(Long.valueOf(userId), menuAddDto); |
| | | public ResultVO<String> addMenu(Authentication authentication, @RequestBody MenuAddRPCReqDTO menuAddDto) { |
| | | ContextCacheUser currentUser = (ContextCacheUser) authentication.getPrincipal(); |
| | | return accountMenuService.addMenu(currentUser.getUid(), menuAddDto); |
| | | } |
| | | |
| | | |
| | |
| | | * @Description: 新增菜单 |
| | | */ |
| | | @RequestMapping(value = "/mod",method = RequestMethod.POST) |
| | | public ResultVO<String> addMenu(Principal principal, @RequestBody MenuModRPCReqDTO menuModDto) { |
| | | String userId = principal.getName(); |
| | | return accountMenuService.modMenu(Long.valueOf(userId), menuModDto); |
| | | public ResultVO<String> addMenu(Authentication authentication, @RequestBody MenuModRPCReqDTO menuModDto) { |
| | | ContextCacheUser currentUser = (ContextCacheUser) authentication.getPrincipal(); |
| | | return accountMenuService.modMenu(currentUser.getUid(), menuModDto); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * @Description: 新增菜单 |
| | | */ |
| | | @RequestMapping(value = "/del",method = RequestMethod.POST) |
| | | public ResultVO<String> delMenu(Authentication authentication,@RequestBody JSONObject json ) { |
| | | ContextCacheUser currentUser = (ContextCacheUser) authentication.getPrincipal(); |
| | | Long id = json.getLong("id"); |
| | | return accountMenuService.delMenu(currentUser.getUid(), id); |
| | | } |
| | | |
| | | } |
| | |
| | | import com.gkhy.safePlatform.account.rpc.apimodel.model.req.RoleAddRPCReqDTO; |
| | | import com.gkhy.safePlatform.account.rpc.apimodel.model.req.RoleModRPCReqDTO; |
| | | import com.gkhy.safePlatform.account.rpc.apimodel.model.resp.RoleRPCRespDTO; |
| | | import com.gkhy.safePlatform.commons.co.ContextCacheUser; |
| | | import com.gkhy.safePlatform.commons.enums.ResultCodes; |
| | | import com.gkhy.safePlatform.commons.vo.ResultVO; |
| | | import org.apache.dubbo.config.annotation.DubboReference; |
| | | import org.springframework.security.core.Authentication; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestMethod; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | |
| | | |
| | | |
| | | @RequestMapping(value = "/add",method = RequestMethod.POST) |
| | | public ResultVO<String> addRole(Principal principal, RoleAddRPCReqDTO roleAddRPCReqDTO){ |
| | | String userId = principal.getName(); |
| | | return accountRoleService.addRole(Long.valueOf(userId),roleAddRPCReqDTO); |
| | | public ResultVO<String> addRole(Authentication authentication, RoleAddRPCReqDTO roleAddRPCReqDTO){ |
| | | ContextCacheUser currentUser = (ContextCacheUser) authentication.getPrincipal(); |
| | | return accountRoleService.addRole(currentUser.getUid(),roleAddRPCReqDTO); |
| | | } |
| | | |
| | | |
| | | |
| | | @RequestMapping(value = "/mod",method = RequestMethod.POST) |
| | | public ResultVO<String> modRole(Principal principal, RoleModRPCReqDTO roleModRPCReqDTO){ |
| | | String userId = principal.getName(); |
| | | return accountRoleService.modRole(Long.valueOf(userId),roleModRPCReqDTO); |
| | | public ResultVO<String> modRole(Authentication authentication, RoleModRPCReqDTO roleModRPCReqDTO){ |
| | | ContextCacheUser currentUser = (ContextCacheUser) authentication.getPrincipal(); |
| | | return accountRoleService.modRole(currentUser.getUid(),roleModRPCReqDTO); |
| | | } |
| | | |
| | | |
| | | @RequestMapping(value = "/del",method = RequestMethod.POST) |
| | | public ResultVO<String> modRole(Principal principal, JSONObject json){ |
| | | String userId = principal.getName(); |
| | | public ResultVO<String> modRole(Authentication authentication, JSONObject json){ |
| | | ContextCacheUser currentUser = (ContextCacheUser) authentication.getPrincipal(); |
| | | Long depId = json.getLong("depId"); |
| | | return accountRoleService.delRole(Long.valueOf(userId),depId); |
| | | return accountRoleService.delRole(currentUser.getUid(),depId); |
| | | } |
| | | } |
| | |
| | | import com.gkhy.safePlatform.account.rpc.apimodel.model.req.query.AccountRPCQuery; |
| | | import com.gkhy.safePlatform.account.rpc.apimodel.model.resp.DepUserRPCRespDTO; |
| | | import com.gkhy.safePlatform.account.rpc.apimodel.model.resp.PersonalDetailRPCRespDTO; |
| | | import com.gkhy.safePlatform.commons.co.ContextCacheUser; |
| | | import com.gkhy.safePlatform.commons.enums.ResultCodes; |
| | | import com.gkhy.safePlatform.commons.query.PageQuery; |
| | | import com.gkhy.safePlatform.commons.vo.ResultVO; |
| | | import org.apache.dubbo.config.annotation.DubboReference; |
| | | import org.apache.dubbo.config.annotation.DubboService; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.security.core.Authentication; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestMethod; |
| | |
| | | |
| | | |
| | | @RequestMapping("/page/list") |
| | | public Object getUserPage(Principal principal, PageQuery<AccountRPCQuery> rpcQueryPageQuery) { |
| | | return accountUserService.getAccountPage(Long.valueOf(principal.getName()), rpcQueryPageQuery); |
| | | public Object getUserPage(Authentication authentication, PageQuery<AccountRPCQuery> rpcQueryPageQuery) { |
| | | ContextCacheUser currentUser = (ContextCacheUser) authentication.getPrincipal(); |
| | | return accountUserService.getAccountPage(currentUser.getUid(), rpcQueryPageQuery); |
| | | } |
| | | |
| | | |
| | |
| | | * @Description: 获取部门下的用户列表 |
| | | */ |
| | | @RequestMapping(value = "/dep/list", method = RequestMethod.GET) |
| | | public ResultVO<List<DepUserRPCRespDTO>> depUserList(Principal principal, Long depId) { |
| | | String userId = principal.getName(); |
| | | return accountUserService.getDepList(Long.valueOf(userId), depId); |
| | | public ResultVO<List<DepUserRPCRespDTO>> depUserList(Authentication authentication, Long depId) { |
| | | ContextCacheUser currentUser = (ContextCacheUser) authentication.getPrincipal(); |
| | | return accountUserService.getDepList(currentUser.getUid(), depId); |
| | | } |
| | | |
| | | /** |
| | | * @Description: 个人信息 |
| | | */ |
| | | @RequestMapping(value = "/personal", method = RequestMethod.GET) |
| | | public ResultVO<PersonalDetailRPCRespDTO> getPersonal(Principal principal) { |
| | | String userId = principal.getName(); |
| | | return accountUserService.getPersonalAccountDetail(Long.valueOf(userId)); |
| | | public ResultVO<PersonalDetailRPCRespDTO> getPersonal(Authentication authentication) { |
| | | ContextCacheUser currentUser = (ContextCacheUser) authentication.getPrincipal(); |
| | | return accountUserService.getPersonalAccountDetail(currentUser.getUid()); |
| | | } |
| | | |
| | | |
| | |
| | | */ |
| | | @RequestMapping(value = "/add", method = RequestMethod.POST) |
| | | @PreAuthorize("hasRole('ROLE_admin')") |
| | | public ResultVO<String> addUser(Principal principal, @RequestBody AccountAddRPCReqDTO accountAddRPCReqDTO) { |
| | | String userId = principal.getName(); |
| | | return accountUserService.addAccount(Long.valueOf(userId), accountAddRPCReqDTO); |
| | | public ResultVO<String> addUser(Authentication authentication, @RequestBody AccountAddRPCReqDTO accountAddRPCReqDTO) { |
| | | ContextCacheUser currentUser = (ContextCacheUser) authentication.getPrincipal(); |
| | | return accountUserService.addAccount(currentUser.getUid(), accountAddRPCReqDTO); |
| | | } |
| | | |
| | | |
| | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.gkhy.safePlatform.account.rpc.apimodel.AccountAuthService; |
| | | import com.gkhy.safePlatform.account.rpc.apimodel.AccountAuthService; |
| | | import com.gkhy.safePlatform.commons.co.CacheAuthority; |
| | | import com.gkhy.safePlatform.commons.co.CacheUser; |
| | | import com.gkhy.safePlatform.commons.co.ContextCacheAuthority; |
| | | import com.gkhy.safePlatform.commons.co.ContextCacheUser; |
| | | import com.gkhy.safePlatform.commons.enums.RedisKeyEnum; |
| | | import com.gkhy.safePlatform.commons.enums.ResultCodes; |
| | | import com.gkhy.safePlatform.commons.exception.BusinessException; |
| | |
| | | throw new BusinessException(ResultCodes.CLIENT_CREDENTIALS_TOKEN_INVALID); |
| | | }else{ |
| | | Long userId = Long.valueOf(loginUserId); |
| | | CacheUser cacheUser = JSONObject.parseObject(o.toString(), CacheUser.class); |
| | | assert userId.equals(cacheUser.getUserId()); |
| | | if ( !authToken.equals(cacheUser.getAccessToken())) { |
| | | ContextCacheUser contextCacheUser = JSONObject.parseObject(o.toString(), ContextCacheUser.class); |
| | | assert userId.equals(contextCacheUser.getUid()); |
| | | if ( !authToken.equals(contextCacheUser.getAccessToken())) { |
| | | throw new BusinessException(ResultCodes.CLIENT_CREDENTIALS_TOKEN_INVALID); |
| | | } |
| | | |
| | |
| | | // 4.redis中是否存在 |
| | | if (oo != null) { |
| | | // 5.存在 |
| | | List<CacheAuthority> cacheAuthorities = JSONArray.parseArray(oo.toString(), CacheAuthority.class); |
| | | for (CacheAuthority cacheAuthority: cacheAuthorities) { |
| | | List<ContextCacheAuthority> cacheAuthorities = JSONArray.parseArray(oo.toString(), ContextCacheAuthority.class); |
| | | for (ContextCacheAuthority cacheAuthority: cacheAuthorities) { |
| | | authorities.add(new SimpleGrantedAuthority(cacheAuthority.getAuthority())); |
| | | } |
| | | }else { |
| | |
| | | } |
| | | |
| | | // security对象中存入登陆者信息 |
| | | return new UsernamePasswordAuthenticationToken(userId,authToken,authorities); |
| | | return new UsernamePasswordAuthenticationToken(contextCacheUser,authToken,authorities); |
| | | |
| | | } |
| | | |
对比新文件 |
| | |
| | | server: |
| | | tomcat: |
| | | uri-encoding: UTF-8 |
| | | basedir: / |
| | | port: 8009 |
| | | servlet: |
| | | context-path: / |
| | | |
| | | # mysql |
| | | spring: |
| | | datasource: |
| | | emergency: |
| | | driver-class-name: com.mysql.cj.jdbc.Driver |
| | | url: jdbc:mysql://192.168.0.52:3306/safeplatform.emergency.dev?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai |
| | | username: gkhy_dev_out_team |
| | | password: Adsdf675T6AC7yga |
| | | type: com.alibaba.druid.pool.DruidDataSource |
| | | goalmanage: |
| | | driver-class-name: com.mysql.cj.jdbc.Driver |
| | | url: jdbc:mysql://192.168.0.52:3306/safeplatform.goalmanage.dev?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai |
| | | username: gkhy_dev_out_team |
| | | password: Adsdf675T6AC7yga |
| | | type: com.alibaba.druid.pool.DruidDataSource |
| | | redis: |
| | | host: 192.168.0.52 |
| | | port: 6378 |
| | | password: SEF98uvs98dUAUEF90Udssa |
| | | database: 0 # Redis 数据库号,默认为 0 |
| | | timeout: 15000 # Redis 连接超时时间,单位:毫秒。 |
| | | # 对应 RedisProperties.Jedis 内部类 |
| | | jedis: |
| | | pool: |
| | | max-active: 8 # 连接池最大连接数,默认为 8 。使用负数表示没有限制 同一时间最大只能执行8条sql语句,每执行一条语句就会建立一个连接 |
| | | max-idle: 8 # 默认连接数最大空闲的连接数,默认为 8 。使用负数表示没有限制。 |
| | | min-idle: 0 # 默认连接池最小空闲的连接数,默认为 0 。允许设置 0 和 正数。 |
| | | max-wait: -1 |
| | | |
| | | |
| | | mybatis-plus: |
| | | configuration: |
| | | log-impl: org.apache.ibatis.logging.stdout.StdOutImpl |
| | | |
| | | dubbo: |
| | | registry: |
| | | protocol: nacos |
| | | address: nacos://192.168.0.52:8848?namespace=11ee8fe9-ea10-4f63-9752-c33c7ac36e36&username=gkhy_safeplatform_out&password=9485uyJHISes09t |
| | | application: |
| | | name: gkhy-safeplatform-out |
| | | scan: |
| | | # 扫描rpc接口定义包 |
| | | base-packages: com.gkhy.safePlatform |
| | | protocol: |
| | | name: dubbo |
| | | port: 18082 |
| | | serialization: kryo |
| | | consumer: |
| | | # 服务连接超时时间 |
| | | timeout: 3000 |
| | | # 取消服务启动检查 |
| | | check: false |
| | | |
| | | minio: |
| | | endPoint: 192.168.0.52 |
| | | port: 9001 |
| | | accessKey: kH6eiQtNrWqGNb1r |
| | | secretKey: ff5ykVUJJn0hi5PghsitdGNSsrW0Xrju |
| | | secure: false |
| | | bucketName: szh-stu |
| | | urlPrefix: http://192.168.0.52/file |
| | | |
| | | |
| | | token: |
| | | header: Authorization |
| | | secret: safe666 |
| | | expiration: 7200 |
| | | refreshExpiration: 14400 |
| | | tokenHead: Bearer |
| | | loginUserHeader: uid |
| | | |
| | |
| | | name: gkhy-safeplatform-out |
| | | profiles: |
| | | # active: prod |
| | | active: dev |
| | | active: out-dev |
| | | |
| | | mybatis-plus: |
| | | mapper-locations: classpath:config/mapper/**/*.xml |
| | |
| | | logging: |
| | | config: classpath:config/log/log4j2.xml |
| | | level: |
| | | com.gkhy: info |
| | | com.gkhy: info |