|
@ -1,11 +1,15 @@ |
|
|
package com.elink.esua.epdc.service.impl; |
|
|
package com.elink.esua.epdc.service.impl; |
|
|
|
|
|
|
|
|
|
|
|
import com.elink.esua.epdc.commons.tools.exception.RenException; |
|
|
import com.elink.esua.epdc.commons.tools.utils.Result; |
|
|
import com.elink.esua.epdc.commons.tools.utils.Result; |
|
|
import com.elink.esua.epdc.dto.DeptOption; |
|
|
import com.elink.esua.epdc.dto.DeptOption; |
|
|
|
|
|
import com.elink.esua.epdc.dto.ParentAndAllDeptDTO; |
|
|
import com.elink.esua.epdc.dto.form.EpiDemicReportFormDTO; |
|
|
import com.elink.esua.epdc.dto.form.EpiDemicReportFormDTO; |
|
|
import com.elink.esua.epdc.feign.AdminFeignClient; |
|
|
import com.elink.esua.epdc.feign.AdminFeignClient; |
|
|
import com.elink.esua.epdc.feign.CustomFeignClient; |
|
|
import com.elink.esua.epdc.feign.CustomFeignClient; |
|
|
|
|
|
import com.elink.esua.epdc.redis.AppUserRedis; |
|
|
import com.elink.esua.epdc.service.CustomService; |
|
|
import com.elink.esua.epdc.service.CustomService; |
|
|
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
import org.springframework.stereotype.Service; |
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
|
@ -21,6 +25,8 @@ public class CustomServiceImpl implements CustomService { |
|
|
private AdminFeignClient adminFeignClient; |
|
|
private AdminFeignClient adminFeignClient; |
|
|
@Autowired |
|
|
@Autowired |
|
|
private CustomFeignClient customFeignClient; |
|
|
private CustomFeignClient customFeignClient; |
|
|
|
|
|
@Autowired |
|
|
|
|
|
private AppUserRedis appUserRedis; |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* @param |
|
|
* @param |
|
@ -43,6 +49,31 @@ public class CustomServiceImpl implements CustomService { |
|
|
**/ |
|
|
**/ |
|
|
@Override |
|
|
@Override |
|
|
public Result report(EpiDemicReportFormDTO formDTO) { |
|
|
public Result report(EpiDemicReportFormDTO formDTO) { |
|
|
|
|
|
// 验证手机号
|
|
|
|
|
|
this.checkSmsCode(formDTO.getMobile(), formDTO.getSmsCode()); |
|
|
|
|
|
// 获取部门冗余信息
|
|
|
|
|
|
Result<ParentAndAllDeptDTO> pidInfoResult = adminFeignClient.getParentAndAllDept(formDTO.getDeptId()); |
|
|
|
|
|
if (!pidInfoResult.success()) { |
|
|
|
|
|
return new Result().error("获取部门信息失败" + pidInfoResult.getMsg()); |
|
|
|
|
|
} |
|
|
|
|
|
formDTO.setParentDeptIds(pidInfoResult.getData().getParentDeptIds()); |
|
|
|
|
|
formDTO.setParentDeptNames(pidInfoResult.getData().getParentDeptNames()); |
|
|
|
|
|
formDTO.setAllDeptIds(pidInfoResult.getData().getAllDeptIds()); |
|
|
|
|
|
formDTO.setAllDeptNames(pidInfoResult.getData().getAllDeptNames()); |
|
|
return customFeignClient.report(formDTO); |
|
|
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("手机验证码错误"); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|