| | |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.common.utils.bean.BeanUtils; |
| | | import com.ruoyi.framework.web.service.TokenService; |
| | | import com.ruoyi.system.applet.dto.AppealDTO; |
| | | import com.ruoyi.system.applet.dto.AppealInspectorDTO; |
| | | import com.ruoyi.system.dto.InspectorDetailDto; |
| | | import com.ruoyi.system.dto.TTaskAuditBatchDTO; |
| | | import com.ruoyi.system.dto.TaskDetailDto; |
| | | import com.ruoyi.system.model.*; |
| | |
| | | private TLocationService locationService; |
| | | @Resource |
| | | private TInspectorService inspectorService; |
| | | @Resource |
| | | private TInspectorDetailService inspectorDetailService; |
| | | |
| | | @ApiOperation(value = "上传任务") |
| | | @PostMapping(value = "/uploadTask") |
| | |
| | | double radius = 50; // 单位:米 |
| | | int segments = 4; // 四段,共 5 个点 |
| | | TTask task = taskService.getById(dto.getTaskId()); |
| | | if (task==null)return R.fail("任务不存在"); |
| | | TLocation location = locationService.getById(task.getLocationId()); |
| | | if (location==null)return R.fail("点位不存在"); |
| | | TInspector byId = inspectorService.getById(dto.getId()); |
| | | TInspector byId = inspectorService.getById(dto.getTaskId()); |
| | | if (byId!=null){ |
| | | UpdateWrapper<TInspector> tInspectorUpdateWrapper = new UpdateWrapper<>(); |
| | | tInspectorUpdateWrapper.set("clear_status", dto.getClearStatus()); |
| | | tInspectorUpdateWrapper.set("unqualified", dto.getUnqualified()); |
| | | tInspectorUpdateWrapper.set("remark", dto.getRemark()); |
| | | tInspectorUpdateWrapper.set("picture", dto.getPicture()); |
| | | tInspectorUpdateWrapper.set("audio_url", dto.getAudioUrl()); |
| | | tInspectorUpdateWrapper.set("status", 1); |
| | | tInspectorUpdateWrapper.set("audit_time", 1); |
| | | tInspectorUpdateWrapper.set("audit_person", 1); |
| | | tInspectorUpdateWrapper.set("audit_status", 1); |
| | | tInspectorUpdateWrapper.set("audit_remark", 1); |
| | | tInspectorUpdateWrapper.eq("id", dto.getId()); |
| | | inspectorService.update(tInspectorUpdateWrapper); |
| | | TLocation location = locationService.getById(byId.getLocationId()); |
| | | byId.setClearStatus( dto.getClearStatus()); |
| | | byId.setUnqualified(dto.getUnqualified()); |
| | | byId.setRemark( dto.getRemark()); |
| | | byId.setPicture( dto.getPicture()); |
| | | byId.setAudioUrl( dto.getAudioUrl()); |
| | | byId.setStatus( 1); |
| | | TInspectorDetail tInspectorDetail = new TInspectorDetail(); |
| | | BeanUtils.copyProperties(dto, tInspectorDetail); |
| | | tInspectorDetail.setInspectorId(byId.getId()); |
| | | tInspectorDetail.setHandleType(1); |
| | | tInspectorDetail.setInspectorId(byId.getId()); |
| | | inspectorDetailService.save(tInspectorDetail); |
| | | inspectorService.updateById(byId); |
| | | }else{ |
| | | TLocation location = locationService.getById(task.getLocationId()); |
| | | |
| | | // try { |
| | | // String routeJson = AmapApiClient.getDrivingRoute(Double.parseDouble(location.getLocationLat()), |
| | | // String routeJson = AmapApiCalient.getDrivingRoute(Double.parseDouble(location.getLocationLat()), |
| | | // Double.parseDouble(location.getLocationLon()), |
| | | // Double.parseDouble(location.getLocationLatEnd()), |
| | | // Double.parseDouble(location.getLocationLonEnd())); |
| | |
| | | // } catch (Exception e) { |
| | | // e.printStackTrace(); |
| | | // } |
| | | dto.setTaskId(task.getId()); |
| | | dto.setHandleType(1); |
| | | dto.setAuditStatus(1); |
| | | dto.setAuditTime(LocalDateTime.now()); |
| | | taskDetailService.save(dto); |
| | | // 修改任务状态 |
| | | taskService.update(Wrappers.<TTask>lambdaUpdate().set(TTask::getStatus, 3).eq(TTask::getId, dto.getTaskId())); |
| | |
| | | |
| | | return R.ok(); |
| | | } |
| | | |
| | | |
| | | @Resource |
| | | private TokenService tokenService; |
| | |
| | | taskDetailService.save(taskDetail); |
| | | return R.ok(); |
| | | } |
| | | @ApiOperation(value = "督察申诉") |
| | | @PostMapping(value = "/appealInspector") |
| | | public R<Boolean> appealInspector(@RequestBody AppealInspectorDTO dto) { |
| | | List<TAppeal> list = appealService.lambdaQuery().eq(TAppeal::getInspectorId, dto.getInspectorId()).list(); |
| | | if (!list.isEmpty()){ |
| | | return R.fail("任务只有一次申诉机会"); |
| | | } |
| | | dto.setAppealPerson(tokenService.getLoginUserApplet().getUserId()+""); |
| | | appealService.save(dto); |
| | | // 添加督察任务详情 |
| | | TInspectorDetail taskDetail = new TInspectorDetail(); |
| | | taskDetail.setInspectorId(dto.getTaskId()); |
| | | taskDetail.setHandleType(4); |
| | | taskDetail.setClearStatus(taskDetail.getClearStatus()); |
| | | taskDetail.setAppealId(dto.getId()); |
| | | inspectorDetailService.save(taskDetail); |
| | | return R.ok(); |
| | | } |
| | | |
| | | } |
| | | |