|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import javax.servlet.http.HttpServletResponse; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import com.ruoyi.alarmpoints.well.domain.ArdAlarmpointsWellParam; | 
|---|
|  |  |  | import com.ruoyi.app.position.domain.ArdAppPosition; | 
|---|
|  |  |  | import com.ruoyi.app.position.service.IArdAppPositionService; | 
|---|
|  |  |  | import com.ruoyi.common.core.domain.entity.SysUser; | 
|---|
|  |  |  | import com.ruoyi.common.utils.SecurityUtils; | 
|---|
|  |  |  | import com.ruoyi.common.utils.StringUtils; | 
|---|
|  |  |  | import com.ruoyi.common.utils.poi.ExcelUtil; | 
|---|
|  |  |  | import com.ruoyi.storage.minio.utils.MinioUtils; | 
|---|
|  |  |  | import com.ruoyi.rongcloud.service.RongCloudService; | 
|---|
|  |  |  | import com.ruoyi.system.service.ISysUserService; | 
|---|
|  |  |  | import com.ruoyi.utils.minio.MinioUtil; | 
|---|
|  |  |  | import com.ruoyi.utils.result.Results; | 
|---|
|  |  |  | import io.swagger.annotations.Api; | 
|---|
|  |  |  | import io.swagger.annotations.ApiOperation; | 
|---|
|  |  |  | import org.springframework.security.access.prepost.PreAuthorize; | 
|---|
|  |  |  | 
|---|
|  |  |  | private IArdAppPositionService ardAppPositionService; | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | private ISysUserService sysUserService; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //    @Autowired | 
|---|
|  |  |  | //    private MinioUtils minioUtil; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 查询app位置列表 | 
|---|
|  |  |  | 
|---|
|  |  |  | @PostMapping | 
|---|
|  |  |  | public AjaxResult add(@RequestBody ArdAppPosition ardAppPosition) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | return toAjax(ardAppPositionService.insertArdAppPosition(ardAppPosition)); | 
|---|
|  |  |  | return AjaxResult.success(ardAppPositionService.insertArdAppPosition(ardAppPosition)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | 
|---|
|  |  |  | return AjaxResult.success(list); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 获取所有app用户 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @ApiOperation("获取所有app用户") | 
|---|
|  |  |  | @GetMapping("/getAppUserList") | 
|---|
|  |  |  | public AjaxResult getAppUserList(Long deptId) { | 
|---|
|  |  |  | SysUser user = new SysUser(); | 
|---|
|  |  |  | user.setDeptId(deptId); | 
|---|
|  |  |  | List<SysUser> list = sysUserService.selectAllAppUserList(user); | 
|---|
|  |  |  | return AjaxResult.success(list); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 获取所有app用户 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | 
|---|
|  |  |  | lists.add(offlineMap); | 
|---|
|  |  |  | return AjaxResult.success(lists); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 获取用户详情 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | 
|---|
|  |  |  | @ApiOperation("上传文件") | 
|---|
|  |  |  | public AjaxResult uploadFile(MultipartFile file,String type) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | String url = MinioUtils.putObjectAndGetUrl("app",type, file); | 
|---|
|  |  |  | String url = MinioUtil.putObjectAndGetUrl("app",type, file); | 
|---|
|  |  |  | return AjaxResult.success(url); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @GetMapping("/getOnlinePCOrCommander") | 
|---|
|  |  |  | @ApiOperation("查询本部门在线PC端及指挥端") | 
|---|
|  |  |  | public AjaxResult getOnlinePCOrCommander() { | 
|---|
|  |  |  | String usersId = SecurityUtils.getUserId(); | 
|---|
|  |  |  | Map<String,List<SysUser>> result = ardAppPositionService.getOnlinePCOrCommander(usersId); | 
|---|
|  |  |  | return AjaxResult.success(result); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @GetMapping("/getOnlineCommanderPosition") | 
|---|
|  |  |  | @ApiOperation("单兵端查看已通过审批的在线指挥端位置") | 
|---|
|  |  |  | public AjaxResult getOnlineCommanderPosition() { | 
|---|
|  |  |  | String soilderId = SecurityUtils.getUserId(); | 
|---|
|  |  |  | try{ | 
|---|
|  |  |  | List<Map<String,Object>> result = ardAppPositionService.getOnlineCommanderPosition(soilderId); | 
|---|
|  |  |  | return AjaxResult.success(result); | 
|---|
|  |  |  | }catch(Exception e){ | 
|---|
|  |  |  | e.printStackTrace(); | 
|---|
|  |  |  | return AjaxResult.error(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @GetMapping("/getAPPPositionByUserIdAndTime") | 
|---|
|  |  |  | @ApiOperation("查看APP历史位置") | 
|---|
|  |  |  | public AjaxResult getAPPPositionByUserIdAndTime(@RequestBody Map<String,String> para) { | 
|---|
|  |  |  | try{ | 
|---|
|  |  |  | List<ArdAppPosition> result = ardAppPositionService.getAPPPositionByUserIdAndTime(para); | 
|---|
|  |  |  | return AjaxResult.success(result); | 
|---|
|  |  |  | }catch(Exception e){ | 
|---|
|  |  |  | e.printStackTrace(); | 
|---|
|  |  |  | return AjaxResult.error(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @GetMapping("/getOnlineAPPSoilderByCommanderId") | 
|---|
|  |  |  | public AjaxResult getOnlineAPPSoilderByCommanderId() { | 
|---|
|  |  |  | String userId = SecurityUtils.getUserId(); | 
|---|
|  |  |  | return success(ardAppPositionService.getOnlineAPPSoilderByCommanderId(userId)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|