|
|
|
@ -1,5 +1,6 @@ |
|
|
|
package com.elink.esua.epdc.service.impl; |
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSON; |
|
|
|
import com.elink.esua.epdc.commons.tools.constant.NumConstant; |
|
|
|
import com.elink.esua.epdc.common.token.dto.TokenDto; |
|
|
|
import com.elink.esua.epdc.commons.tools.exception.RenException; |
|
|
|
@ -16,6 +17,7 @@ import com.elink.esua.epdc.dto.form.EpiDemicReportFormDTO; |
|
|
|
import com.elink.esua.epdc.dto.result.EpdcSentryPostInfoResultDTO; |
|
|
|
import com.elink.esua.epdc.feign.AdminFeignClient; |
|
|
|
import com.elink.esua.epdc.feign.CustomFeignClient; |
|
|
|
import com.elink.esua.epdc.feign.UserFeignClient; |
|
|
|
import com.elink.esua.epdc.redis.AppUserRedis; |
|
|
|
import com.elink.esua.epdc.service.CustomService; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
@ -44,6 +46,9 @@ public class CustomServiceImpl implements CustomService { |
|
|
|
@Autowired |
|
|
|
private AppUserRedis appUserRedis; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private UserFeignClient userFeignClient; |
|
|
|
|
|
|
|
@Override |
|
|
|
public Result<EpdcSentryPostInfoResultDTO> getDeptInfoByMaCode(String code) { |
|
|
|
String combine = "-"; |
|
|
|
@ -148,9 +153,38 @@ public class CustomServiceImpl implements CustomService { |
|
|
|
if (null == userDetail || StringUtils.isBlank(userDetail.getUserId())) { |
|
|
|
return new Result().error("Token is invalid"); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(completeInfoFromDto.getCarNum())) { |
|
|
|
completeInfoFromDto.setCarNum(StringUtils.upperCase(completeInfoFromDto.getCarNum())); |
|
|
|
} |
|
|
|
completeInfoFromDto.setUserId(userDetail.getUserId()); |
|
|
|
redisUtils.convertAndSend(RedisChannels.COMPLETE_INFO_BY_SENTRY_POST, completeInfoFromDto); |
|
|
|
|
|
|
|
//redisUtils.convertAndSend(RedisChannels.COMPLETE_INFO_BY_SENTRY_POST, completeInfoFromDto);
|
|
|
|
this.completeSentryPostUserInfo(completeInfoFromDto); |
|
|
|
return new Result(); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public void completeSentryPostUserInfo(EpdcAppPidemicCompleteInfoFromDTO completeInfoDto) { |
|
|
|
EpidemicSentryPostDTO sentryPostInfoByThirdId = getEpidemicSentryPostInfoByThirdId(completeInfoDto.getPostId()); |
|
|
|
if (null != sentryPostInfoByThirdId) { |
|
|
|
completeInfoDto.setGridId(sentryPostInfoByThirdId.getGridId()); |
|
|
|
} |
|
|
|
userFeignClient.createPidemicInfo(completeInfoDto); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 通过第三方哨卡id,查询哨卡信息 |
|
|
|
* |
|
|
|
* @param thirdId |
|
|
|
* @return com.elink.esua.epdc.dto.EpidemicSentryPostDTO |
|
|
|
* @author work@yujt.net.cn |
|
|
|
* @date 2020/2/16 17:12 |
|
|
|
*/ |
|
|
|
private EpidemicSentryPostDTO getEpidemicSentryPostInfoByThirdId(String thirdId) { |
|
|
|
Result<EpidemicSentryPostDTO> epidemicSentryResult = customFeignClient.getEpidemicSentryByThirdSentryPostid(thirdId); |
|
|
|
if (!epidemicSentryResult.success() || null == epidemicSentryResult.getData()) { |
|
|
|
log.error("根据第三方哨卡id:{}查询哨卡信息失败", thirdId); |
|
|
|
return null; |
|
|
|
} |
|
|
|
return epidemicSentryResult.getData(); |
|
|
|
} |
|
|
|
} |
|
|
|
|