| | |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.system.domain.SysTask; |
| | | import com.ruoyi.system.domain.SysTaskLog; |
| | | import com.ruoyi.system.domain.vo.TaskQueryVO; |
| | | import com.ruoyi.system.domain.vo.TaskCreateVO; |
| | | import com.ruoyi.system.domain.vo.TaskUpdateVO; |
| | |
| | | @PreAuthorize("@ss.hasPermi('task:general:query')") |
| | | @GetMapping("/list") |
| | | public TableDataInfo list(TaskQueryVO queryVO) { |
| | | // 在后端自动获取当前用户信息,实现综合查询 |
| | | // 综合查询:当前用户所在机构任务 + 当前用户创建的任务 + 分配给当前用户的任务 |
| | | Long currentUserId = getUserId(); |
| | | Long currentDeptId = getDeptId(); |
| | | |
| | | // 如果前端没有传递这些参数,则使用当前登录用户信息 |
| | | if (queryVO.getCreatorId() == null && queryVO.getAssigneeId() == null && queryVO.getDeptId() == null) { |
| | | queryVO.setDeptId(currentDeptId); |
| | | queryVO.setCreatorId(currentUserId); |
| | | queryVO.setAssigneeId(currentUserId); |
| | | } |
| | | |
| | | startPage(); |
| | | List<SysTask> list = sysTaskService.selectSysTaskList(queryVO); |
| | | return getDataTable(list); |
| | |
| | | if (newStatus == null) { |
| | | return error("无效的任务状态"); |
| | | } |
| | | |
| | | // 如果包含GPS位置信息,使用带位置的方法 |
| | | if (request.getLatitude() != null && request.getLongitude() != null) { |
| | | SysTaskLog locationLog = new SysTaskLog(); |
| | | locationLog.setLatitude(request.getLatitude()); |
| | | locationLog.setLongitude(request.getLongitude()); |
| | | locationLog.setLocationAddress(request.getLocationAddress()); |
| | | locationLog.setLocationProvince(request.getLocationProvince()); |
| | | locationLog.setLocationCity(request.getLocationCity()); |
| | | locationLog.setLocationDistrict(request.getLocationDistrict()); |
| | | locationLog.setGpsAccuracy(request.getGpsAccuracy()); |
| | | locationLog.setAltitude(request.getAltitude()); |
| | | locationLog.setSpeed(request.getSpeed()); |
| | | locationLog.setHeading(request.getHeading()); |
| | | |
| | | return toAjax(sysTaskService.changeTaskStatusWithLocation(taskId, newStatus, request.getRemark(), locationLog)); |
| | | } |
| | | |
| | | return toAjax(sysTaskService.changeTaskStatus(taskId, newStatus, request.getRemark())); |
| | | } |
| | | |
| | |
| | | public static class ChangeStatusRequest { |
| | | private String taskStatus; |
| | | private String remark; |
| | | |
| | | // GPS位置信息字段 |
| | | private Double latitude; |
| | | private Double longitude; |
| | | private String locationAddress; |
| | | private String locationProvince; |
| | | private String locationCity; |
| | | private String locationDistrict; |
| | | private Double gpsAccuracy; |
| | | private Double altitude; |
| | | private Double speed; |
| | | private Double heading; |
| | | |
| | | public String getTaskStatus() { |
| | | return taskStatus; |
| | |
| | | public void setRemark(String remark) { |
| | | this.remark = remark; |
| | | } |
| | | |
| | | public Double getLatitude() { |
| | | return latitude; |
| | | } |
| | | |
| | | public void setLatitude(Double latitude) { |
| | | this.latitude = latitude; |
| | | } |
| | | |
| | | public Double getLongitude() { |
| | | return longitude; |
| | | } |
| | | |
| | | public void setLongitude(Double longitude) { |
| | | this.longitude = longitude; |
| | | } |
| | | |
| | | public String getLocationAddress() { |
| | | return locationAddress; |
| | | } |
| | | |
| | | public void setLocationAddress(String locationAddress) { |
| | | this.locationAddress = locationAddress; |
| | | } |
| | | |
| | | public String getLocationProvince() { |
| | | return locationProvince; |
| | | } |
| | | |
| | | public void setLocationProvince(String locationProvince) { |
| | | this.locationProvince = locationProvince; |
| | | } |
| | | |
| | | public String getLocationCity() { |
| | | return locationCity; |
| | | } |
| | | |
| | | public void setLocationCity(String locationCity) { |
| | | this.locationCity = locationCity; |
| | | } |
| | | |
| | | public String getLocationDistrict() { |
| | | return locationDistrict; |
| | | } |
| | | |
| | | public void setLocationDistrict(String locationDistrict) { |
| | | this.locationDistrict = locationDistrict; |
| | | } |
| | | |
| | | public Double getGpsAccuracy() { |
| | | return gpsAccuracy; |
| | | } |
| | | |
| | | public void setGpsAccuracy(Double gpsAccuracy) { |
| | | this.gpsAccuracy = gpsAccuracy; |
| | | } |
| | | |
| | | public Double getAltitude() { |
| | | return altitude; |
| | | } |
| | | |
| | | public void setAltitude(Double altitude) { |
| | | this.altitude = altitude; |
| | | } |
| | | |
| | | public Double getSpeed() { |
| | | return speed; |
| | | } |
| | | |
| | | public void setSpeed(Double speed) { |
| | | this.speed = speed; |
| | | } |
| | | |
| | | public Double getHeading() { |
| | | return heading; |
| | | } |
| | | |
| | | public void setHeading(Double heading) { |
| | | this.heading = heading; |
| | | } |
| | | } |
| | | } |