|
|
|
@ -1,6 +1,7 @@ |
|
|
|
package com.elink.esua.epdc.service.impl; |
|
|
|
|
|
|
|
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; |
|
|
|
import com.elink.esua.epdc.commons.tools.utils.Result; |
|
|
|
import com.elink.esua.epdc.dto.CompleteDeptDTO; |
|
|
|
@ -39,58 +40,6 @@ public class CustomServiceImpl implements CustomService { |
|
|
|
@Autowired |
|
|
|
private UserFeignClient userFeignClient; |
|
|
|
|
|
|
|
/** |
|
|
|
* @param |
|
|
|
* @return com.elink.esua.epdc.commons.tools.utils.Result<com.elink.esua.epdc.dto.DeptOption> |
|
|
|
* @Author yinzuomei |
|
|
|
* @Description 获取所有组织机构信息 |
|
|
|
* @Date 2020/1/28 13:31 |
|
|
|
**/ |
|
|
|
@Override |
|
|
|
public Result<DeptOption> getDeptTree() { |
|
|
|
return adminFeignClient.getDeptTreeForEpiDemic(); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @param formDTO |
|
|
|
* @return com.elink.esua.epdc.commons.tools.utils.Result |
|
|
|
* @Author yinzuomei |
|
|
|
* @Description 疫情上报 |
|
|
|
* @Date 2020/1/28 13:31 |
|
|
|
**/ |
|
|
|
@Override |
|
|
|
public Result report(EpiDemicReportFormDTO formDTO) { |
|
|
|
// 验证手机号
|
|
|
|
this.checkSmsCode(formDTO.getMobile(), formDTO.getSmsCode()); |
|
|
|
// 获取部门冗余信息
|
|
|
|
if (null != formDTO.getDeptId()) { |
|
|
|
Result<ParentAndAllDeptDTO> pidInfoResult = adminFeignClient.getParentAndAllDept(formDTO.getDeptId()); |
|
|
|
if (pidInfoResult.success() && null != pidInfoResult.getData()) { |
|
|
|
formDTO.setParentDeptIds(pidInfoResult.getData().getParentDeptIds()); |
|
|
|
formDTO.setParentDeptNames(pidInfoResult.getData().getParentDeptNames()); |
|
|
|
formDTO.setAllDeptIds(pidInfoResult.getData().getAllDeptIds()); |
|
|
|
formDTO.setAllDeptNames(pidInfoResult.getData().getAllDeptNames()); |
|
|
|
} |
|
|
|
} |
|
|
|
return customFeignClient.report(formDTO); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
* @param mobile 手机号 |
|
|
|
* @param smsCode 用户输入的验证码 |
|
|
|
* @Author yinzuomei |
|
|
|
* @Description 校验手机验证码 |
|
|
|
* @Date 2020/1/28 13:50 |
|
|
|
**/ |
|
|
|
private void checkSmsCode(String mobile, String smsCode) { |
|
|
|
String redisSmsCode = appUserRedis.getSmsCode(mobile); |
|
|
|
if (StringUtils.isBlank(redisSmsCode) || !redisSmsCode.equals(smsCode)) { |
|
|
|
throw new RenException("手机验证码错误"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
public Result<EpdcSentryPostInfoResultDTO> getDeptInfoByMaCode(String code) { |
|
|
|
String combine = "-"; |
|
|
|
@ -137,8 +86,62 @@ public class CustomServiceImpl implements CustomService { |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
public Result createPidemicInfo(EpdcAppPidemicCompleteInfoFromDTO completeInfoFromDto) { |
|
|
|
return userFeignClient.createPidemicInfo(completeInfoFromDto); |
|
|
|
} |
|
|
|
/** |
|
|
|
* @param |
|
|
|
* @return com.elink.esua.epdc.commons.tools.utils.Result<com.elink.esua.epdc.dto.DeptOption> |
|
|
|
* @Author yinzuomei |
|
|
|
* @Description 获取所有组织机构信息 |
|
|
|
* @Date 2020/1/28 13:31 |
|
|
|
**/ |
|
|
|
@Override |
|
|
|
public Result<DeptOption> getDeptTree() { |
|
|
|
return adminFeignClient.getDeptTreeForEpiDemic(); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @param formDTO |
|
|
|
* @return com.elink.esua.epdc.commons.tools.utils.Result |
|
|
|
* @Author yinzuomei |
|
|
|
* @Description 疫情上报 |
|
|
|
* @Date 2020/1/28 13:31 |
|
|
|
**/ |
|
|
|
@Override |
|
|
|
public Result report(EpiDemicReportFormDTO formDTO) { |
|
|
|
// 验证手机号
|
|
|
|
this.checkSmsCode(formDTO.getMobile(), formDTO.getSmsCode()); |
|
|
|
// 获取部门冗余信息
|
|
|
|
if (null != formDTO.getDeptId()) { |
|
|
|
Result<ParentAndAllDeptDTO> pidInfoResult = adminFeignClient.getParentAndAllDept(formDTO.getDeptId()); |
|
|
|
if (pidInfoResult.success() && null != pidInfoResult.getData()) { |
|
|
|
formDTO.setParentDeptIds(pidInfoResult.getData().getParentDeptIds()); |
|
|
|
formDTO.setParentDeptNames(pidInfoResult.getData().getParentDeptNames()); |
|
|
|
formDTO.setAllDeptIds(pidInfoResult.getData().getAllDeptIds()); |
|
|
|
formDTO.setAllDeptNames(pidInfoResult.getData().getAllDeptNames()); |
|
|
|
} |
|
|
|
} |
|
|
|
return customFeignClient.report(formDTO); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
* @param mobile 手机号 |
|
|
|
* @param smsCode 用户输入的验证码 |
|
|
|
* @Author yinzuomei |
|
|
|
* @Description 校验手机验证码 |
|
|
|
* @Date 2020/1/28 13:50 |
|
|
|
**/ |
|
|
|
private void checkSmsCode(String mobile, String smsCode) { |
|
|
|
String redisSmsCode = appUserRedis.getSmsCode(mobile); |
|
|
|
if (StringUtils.isBlank(redisSmsCode) || !redisSmsCode.equals(smsCode)) { |
|
|
|
throw new RenException("手机验证码错误"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
public Result createPidemicInfo(EpdcAppPidemicCompleteInfoFromDTO completeInfoFromDto, TokenDto userDetail) { |
|
|
|
completeInfoFromDto.setUserId(userDetail.getUserId()); |
|
|
|
return userFeignClient.createPidemicInfo(completeInfoFromDto); |
|
|
|
} |
|
|
|
} |
|
|
|
|