| | |
| | | <view class="title">任务详情</view> |
| | | <view class="edit-btn" @click="handleEdit" v-if="taskDetail && !isTaskFinished"> |
| | | <uni-icons type="compose" size="20" color="#007AFF"></uni-icons> |
| | | <text class="edit-text">修改</text> |
| | | </view> |
| | | </view> |
| | | |
| | |
| | | <view class="action-buttons" v-if="taskDetail"> |
| | | <!-- 待处理状态: 显示出发、取消、强制完成 --> |
| | | <template v-if="taskDetail.taskStatus === 'PENDING'"> |
| | | <template v-if="isCurrentUserAssignee()"> |
| | | <button |
| | | v-if="isCurrentUserAssignee()" |
| | | class="action-btn primary" |
| | | @click="handleDepartAction()" |
| | | > |
| | |
| | | 取消 |
| | | </button> |
| | | <button |
| | | v-if="showForceCompleteFeature() && taskDetail.taskStatus === 'PENDING'" |
| | | v-if="isCurrentUserAssignee() && showForceCompleteFeature()" |
| | | class="action-btn force-complete" |
| | | @click="showForceCompleteTimeDialog()" |
| | | > |
| | | 强制完成 |
| | | </button> |
| | | </template> |
| | | </template> |
| | | |
| | | <!-- 出发中状态: 显示已到达、强制结束 --> |
| | |
| | | break; |
| | | |
| | | case 'forceCancel': |
| | | // 强制结束 -> 状态变为已取消 |
| | | this.$modal.confirm('确定要强制结束此任务吗?').then(() => { |
| | | this.updateTaskStatus('CANCELLED', '任务已强制结束') |
| | | }).catch(() => {}); |
| | | // 强制结束 -> 显示取消原因选择对话框 |
| | | this.showCancelReasonDialog(); |
| | | break; |
| | | |
| | | case 'return': |
| | |
| | | } |
| | | |
| | | .edit-btn { |
| | | width: 60rpx; |
| | | width: 120rpx; |
| | | height: 60rpx; |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | cursor: pointer; |
| | | |
| | | .edit-text { |
| | | margin-left: 8rpx; |
| | | font-size: 28rpx; |
| | | color: #007AFF; |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | if (request.getLatitude() != null && request.getLongitude() != null) { |
| | | String address= mapService.reverseGeocoding(request.getLongitude(), request.getLatitude()); |
| | | request.setLocationAddress(address); |
| | | SysTaskLog locationLog = getLocationLog(request); |
| | | |
| | | return toAjax(sysTaskService.changeTaskStatusWithLocation(taskId, newStatus, request.getRemark(), locationLog)); |
| | | } |
| | | |
| | | return toAjax(sysTaskService.changeTaskStatus(taskId, newStatus, request.getRemark())); |
| | | } |
| | | |
| | | private static SysTaskLog getLocationLog(ChangeStatusRequest request) { |
| | | SysTaskLog locationLog = new SysTaskLog(); |
| | | locationLog.setLatitude(request.getLatitude()); |
| | | locationLog.setLongitude(request.getLongitude()); |
| | |
| | | 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())); |
| | | return locationLog; |
| | | } |
| | | |
| | | /** |
| | |
| | | try { |
| | | // 从URL下载文件 |
| | | byte[] fileBytes = downloadFromUrl(fileUrl); |
| | | if (fileBytes == null || fileBytes.length == 0) { |
| | | if (fileBytes.length == 0) { |
| | | return FileUploadResponse.error("从URL下载文件失败"); |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | try { |
| | | log.info("开始解析PHP响应: {}", response); |
| | | // log.info("开始解析PHP响应: {}", response); |
| | | |
| | | // 根据PHP接口的实际返回格式进行解析 |
| | | // PHP返回格式: {"success": true, "message": "文件上传成功", "data": {...}} |
| | |
| | | String filePath = extractFilePathFromResponse(response); |
| | | String thumbnailPath = extractThumbnailPathFromResponse(response); |
| | | |
| | | log.info("解析结果 - filePath: {}, thumbnailPath: {}", filePath, thumbnailPath); |
| | | // log.info("解析结果 - filePath: {}, thumbnailPath: {}", filePath, thumbnailPath); |
| | | |
| | | // 创建响应对象 |
| | | FileUploadResponse uploadResponse = FileUploadResponse.success(filePath, "上传成功"); |
| | |
| | | return uploadResponse; |
| | | } |
| | | |
| | | log.info("上传文件成功 文件:{} 缩略:{}",uploadResponse.getFilePath(),uploadResponse.getThumbnailPath()); |
| | | // log.info("上传文件成功 文件:{} 缩略:{}",uploadResponse.getFilePath(),uploadResponse.getThumbnailPath()); |
| | | return uploadResponse; |
| | | |
| | | } catch (Exception e) { |
| | |
| | | package com.ruoyi.system.mapper; |
| | | |
| | | import com.ruoyi.common.annotation.DataSource; |
| | | import com.ruoyi.common.enums.DataSourceType; |
| | | import com.ruoyi.system.domain.DictionaryCondition; |
| | | import com.ruoyi.system.domain.DispatchOrd; |
| | | import org.apache.ibatis.annotations.Param; |
| | |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @DataSource(DataSourceType.SQLSERVER) |
| | | public interface DispatchOrdMapper { |
| | | /** |
| | | * 根据服务订单ID查询调度订单 |
| | |
| | | |
| | | if (cancelReason != null && !cancelReason.isEmpty()) { |
| | | try { |
| | | log.info("取消原因 cancelReason:{},取消人:{}", cancelReason, cancelBy); |
| | | cancelReasonId = Integer.parseInt(cancelReason); |
| | | // 从数据字典查询取消原因文本 |
| | | String dictLabel = sysDictDataService.selectDictLabel("task_cancel_reason", cancelReason); |
| | |
| | | cancelReasonText = "[取消操作:" + (cancelBy != null ? cancelBy : "系统") + "]"; |
| | | } |
| | | } catch (NumberFormatException e) { |
| | | log.warn("取消原因ID格式错误: {}", cancelReason); |
| | | log.error("取消原因ID格式错误: {}", cancelReason,e); |
| | | cancelReasonText = "[取消操作:" + (cancelBy != null ? cancelBy : "系统") + "] " + cancelReason; |
| | | } |
| | | } else { |
| | |
| | | try { |
| | | // 直接通过Service调用Mapper更新SQL Server数据库 |
| | | int rows = dispatchOrdService.updateDispatchOrdState(dispatchOrdId, statusCode); |
| | | // log.debug("更新旧系统状态,DispatchOrdID: {}, StateInt: {}", dispatchOrdId, statusCode); |
| | | log.debug("更新旧系统状态,DispatchOrdID: {}, statusCode: {}", dispatchOrdId, statusCode); |
| | | if (rows > 0) { |
| | | // log.debug("更新旧系统状态成功,DispatchOrdID: {}, StateInt: {}", |
| | | // dispatchOrdId, statusCode); |
| | | log.debug("更新旧系统状态成功,DispatchOrdID: {}, statusCode: {}", |
| | | dispatchOrdId, statusCode); |
| | | return true; |
| | | } else { |
| | | // log.warn("更新旧系统状态失败,未找到对应调度单,DispatchOrdID: {}", dispatchOrdId); |
| | |
| | | public int sendTaskNotifyMessage(Long taskId, List<Long> userIds, Long excludeUserId) { |
| | | // 检查订阅消息开关 |
| | | if (!isSubscribeMessageEnabled()) { |
| | | log.info("订阅消息发送已关闭,跳过发送,taskId={}", taskId); |
| | | // log.info("订阅消息发送已关闭,跳过发送,taskId={}", taskId); |
| | | return 0; |
| | | } |
| | | if (taskId == null || userIds == null || userIds.isEmpty()) { |
| | | log.warn("发送微信任务通知参数不完整,taskId={}, userIds={}", taskId, userIds); |
| | | // log.warn("发送微信任务通知参数不完整,taskId={}, userIds={}", taskId, userIds); |
| | | return 0; |
| | | } |
| | | |
| | | // 查询任务信息 |
| | | SysTask task = sysTaskMapper.selectSysTaskByTaskId(taskId); |
| | | if (task == null) { |
| | | log.warn("微信通知失败,任务不存在,taskId={}", taskId); |
| | | // log.warn("微信通知失败,任务不存在,taskId={}", taskId); |
| | | return 0; |
| | | } |
| | | |
| | |
| | | try { |
| | | WechatUtils.sendSubscribeMessage(accessToken, user.getOpenId(), templateId, page, data); |
| | | successCount++; |
| | | log.info("微信任务通知发送成功,taskId={}, userId={}, userName={}", taskId, userId, user.getUserName()); |
| | | // log.info("微信任务通知发送成功,taskId={}, userId={}, userName={}", taskId, userId, user.getUserName()); |
| | | } catch (Exception e) { |
| | | log.error("微信任务通知发送失败,taskId={}, userId={}", taskId, userId, e); |
| | | } |