|
|
@@ -4,6 +4,7 @@ import cn.hutool.core.util.ObjectUtil; |
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
|
|
|
import com.tuoheng.admin.conver.InspectionConverMapper; |
|
|
|
import com.tuoheng.admin.entity.domain.AirportLine; |
|
|
|
import com.tuoheng.admin.entity.domain.DspServiceInst; |
|
|
|
import com.tuoheng.admin.entity.domain.Inspection; |
|
|
|
import com.tuoheng.admin.entity.domain.User; |
|
|
|
import com.tuoheng.admin.entity.request.inspection.AddInspectionRequest; |
|
|
@@ -14,6 +15,7 @@ import com.tuoheng.admin.mapper.*; |
|
|
|
import com.tuoheng.admin.service.third.pilot.PilotService; |
|
|
|
import com.tuoheng.admin.utils.CurrentUserUtil; |
|
|
|
import com.tuoheng.admin.utils.GaodeUtil; |
|
|
|
import com.tuoheng.common.core.constant.CommonConstants; |
|
|
|
import com.tuoheng.common.core.utils.DateUtils; |
|
|
|
import com.tuoheng.common.core.utils.JsonResult; |
|
|
|
import com.tuoheng.common.core.utils.StringUtils; |
|
|
@@ -167,12 +169,19 @@ public class AddInspectionService { |
|
|
|
//Inspection inspection = new Inspection(); |
|
|
|
//BeanUtils.copyProperties(addInspectionRequest,inspection); |
|
|
|
String code = DateUtils.generateCode("XJRW"); |
|
|
|
inspection.setType(1); |
|
|
|
inspection.setCode(code); |
|
|
|
inspection.setTenantId(tenantId); |
|
|
|
inspection.setCreateUser(user.getId()); |
|
|
|
inspection.setCreateTime(DateUtils.now()); |
|
|
|
inspection.setMobile(user.getMobile()); |
|
|
|
inspection.setStatus(InspectionStatusEnum.WAIT_FLIGHT.getCode()); |
|
|
|
if (StringUtils.isEmpty(addInspectionRequest.getDspServiceInstId())) { |
|
|
|
//提供默认服务实例id |
|
|
|
DspServiceInst dspServiceInst = dspServiceInstMapper.selectOne(Wrappers.<DspServiceInst>lambdaQuery() |
|
|
|
.eq(DspServiceInst::getIsDefault, CommonConstants.ONE)); |
|
|
|
inspection.setDspServiceInstId(dspServiceInst.getDspServiceInstId()); |
|
|
|
} |
|
|
|
if (InspectionTypeEnum.AIRPORT.getCode() == addInspectionRequest.getInspectionType()) { |
|
|
|
// 机场巡逻,只有直播,将isLive设置为1 |
|
|
|
inspection.setIsLive(1); |