@@ -6,6 +6,7 @@ import com.tuoheng.admin.entity.InspectionHistory; | |||
import com.tuoheng.admin.enums.InspectionStatusEnum; | |||
import com.tuoheng.admin.mapper.InspectionHistoryMapper; | |||
import com.tuoheng.admin.mapper.InspectionMapper; | |||
import com.tuoheng.admin.service.report.generate.GenerateReportService; | |||
import com.tuoheng.admin.service.third.dsp.IDspService; | |||
import com.tuoheng.admin.tzhl.response.TZHLFlyLogResponse; | |||
import com.tuoheng.admin.tzhl.service.fly.data.FlyDataService; | |||
@@ -47,6 +48,9 @@ public class FlyLogByNormalService { | |||
@Autowired | |||
private FlyDataService flyDataService; | |||
@Autowired | |||
private GenerateReportService generateReportService; | |||
public void getFlyLog(Inspection inspection, TZHLFlyLogResponse flyLogResponse) { | |||
log.info("获取飞行日志,status=normal,title={}", flyLogResponse.getTitle()); | |||
@@ -129,6 +133,9 @@ public class FlyLogByNormalService { | |||
this.updateInspection(inspection); | |||
// 任务完成后自动生成报告 | |||
generateReportService.generateByAuto(inspection); | |||
// 拉取飞行数据 | |||
flyDataService.getFlyData(inspection); | |||
@@ -53,17 +53,7 @@ public class IUserServiceImpl extends ServiceImpl<UserMapper, User> implements I | |||
@Override | |||
public JsonResult getUserInfo() { | |||
//登录用户信息 | |||
User userInfo = CurrentUserUtil.getUserInfo(); | |||
String username = userInfo.getUsername(); | |||
if(StringUtils.isEmpty(username)){ | |||
return JsonResult.error(UserCodeEnum.USER_NAME_IS_NULL.getCode(),UserCodeEnum.USER_NAME_IS_NULL.getMsg()); | |||
} | |||
User user = userMapper.selectOne(new LambdaQueryWrapper<User>() | |||
.eq(User::getUsername, username) | |||
.eq(User::getMark, MarkEnum.VALID.getCode())); | |||
if(ObjectUtil.isNull(user)){ | |||
return JsonResult.error(UserCodeEnum.USER_IS_NULL.getCode(),UserCodeEnum.USER_IS_NULL.getMsg()); | |||
} | |||
User user = CurrentUserUtil.getUserInfo(); | |||
if(2== user.getStatus()){ | |||
return JsonResult.error(UserCodeEnum.USER_STATUS_INTERDICT.getCode(),UserCodeEnum.USER_STATUS_INTERDICT.getMsg()); | |||
} |
@@ -53,17 +53,7 @@ public class InspectionFileHandleServiceImpl implements IInspectionFileHandleSer | |||
@Override | |||
public JsonResult uploadResult(UploadResultDto dto) { | |||
//登录用户信息 | |||
User userInfo = CurrentUserUtil.getUserInfo(); | |||
String username = userInfo.getUsername(); | |||
if(StringUtils.isEmpty(username)){ | |||
return JsonResult.error(InspectionFileHandleEnum.USER_NAME_IS_NULL.getCode(),InspectionFileHandleEnum.USER_NAME_IS_NULL.getMsg()); | |||
} | |||
User user = userMapper.selectOne(Wrappers.<User>lambdaQuery() | |||
.eq(User::getMark, MarkEnum.VALID.getCode()) | |||
.eq(User::getUsername, username)); | |||
if(ObjectUtil.isNull(user)){ | |||
return JsonResult.error(InspectionFileHandleEnum.USER_IS_NOT_EXIST.getCode(),InspectionFileHandleEnum.USER_IS_NOT_EXIST.getMsg()); | |||
} | |||
User user = CurrentUserUtil.getUserInfo(); | |||
if(StringUtils.isEmpty(user.getId())){ | |||
return JsonResult.error(InspectionFileHandleEnum.USER_ID_IS_NULL.getCode(),InspectionFileHandleEnum.USER_ID_IS_NULL.getMsg()); | |||
} |
@@ -63,14 +63,7 @@ public class InspectionServiceImpl implements IInspectionService { | |||
throw new ServiceException(ServiceExceptionEnum.PARAMETER_IS_NULL); | |||
} | |||
//登录用户信息 | |||
User userInfo = CurrentUserUtil.getUserInfo(); | |||
String username = userInfo.getUsername(); | |||
User user = userMapper.selectOne(Wrappers.<User>lambdaQuery() | |||
.eq(StringUtils.isNotEmpty(username), User::getUsername, username) | |||
.eq(User::getStatus, 1).eq(User::getMark, MarkEnum.VALID.getCode())); | |||
if(ObjectUtil.isNull(user)){ | |||
return null; | |||
} | |||
User user = CurrentUserUtil.getUserInfo(); | |||
String tenantId = user.getTenantId(); | |||
if(StringUtils.isEmpty(tenantId)){ | |||
return null; |
@@ -880,17 +880,7 @@ public class WorkOrderServiceImpl extends BaseServiceImpl<WorkOrderMapper, WorkO | |||
@Override | |||
public JsonResult mothCount() { | |||
//获取登录用户信息 | |||
User userInfo = CurrentUserUtil.getUserInfo(); | |||
String username = userInfo.getUsername(); | |||
if (StringUtils.isEmpty(username)) { | |||
return JsonResult.error(WorkOrderEnum.USER_NAME_IS_NULL.getCode(), WorkOrderEnum.USER_NAME_IS_NULL.getMsg()); | |||
} | |||
User user = userMapper.selectOne(Wrappers.<User>lambdaQuery() | |||
.eq(User::getMark, MarkEnum.VALID.getCode()) | |||
.eq(User::getUsername, username)); | |||
if (ObjectUtil.isNull(user)) { | |||
return JsonResult.error(WorkOrderEnum.USER_IS_NOT_EXIST.getCode(), WorkOrderEnum.USER_IS_NOT_EXIST.getMsg()); | |||
} | |||
User user = CurrentUserUtil.getUserInfo(); | |||
String tenantId = user.getTenantId(); | |||
if (StringUtils.isEmpty(tenantId)) { | |||
return JsonResult.error(WorkOrderEnum.TENANT_ID_IS_NULL.getCode(), WorkOrderEnum.TENANT_ID_IS_NULL.getMsg()); | |||
@@ -915,7 +905,6 @@ public class WorkOrderServiceImpl extends BaseServiceImpl<WorkOrderMapper, WorkO | |||
if (null == endTime || null == beginTime) { | |||
return null; | |||
} | |||
//根据用户角色判断 1超级管理员 2部门管理员 3普通用户 | |||
if (RoleEnum.SUPER_ADMIN.getCode() == type) { | |||
//获取当前登录用户(超级管理员)已完成工单列表 | |||
List<WorkOrder> workOrders = workOrderMapper.selectList(Wrappers.<WorkOrder>lambdaQuery() |