|
|
@@ -70,6 +70,8 @@ import com.zhongzheng.modules.system.domain.SysTenant;
|
|
|
import com.zhongzheng.modules.system.service.ISysConfigService;
|
|
|
import com.zhongzheng.modules.system.service.ISysTaskService;
|
|
|
import com.zhongzheng.modules.system.service.ISysTenantService;
|
|
|
+import com.zhongzheng.modules.tencentcloud.bo.FaceQueryBo;
|
|
|
+import com.zhongzheng.modules.tencentcloud.service.IFaceOcrService;
|
|
|
import com.zhongzheng.modules.user.bo.*;
|
|
|
import com.zhongzheng.modules.user.domain.User;
|
|
|
import com.zhongzheng.modules.user.domain.UserCertificate;
|
|
|
@@ -184,6 +186,8 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
|
|
|
private ICourseService iCourseService;
|
|
|
@Autowired
|
|
|
private ICourseSectionService iCourseSectionService;
|
|
|
+ @Autowired
|
|
|
+ private IFaceOcrService iFaceOcrService;
|
|
|
@Value("${liveGotoURL}")
|
|
|
private String liveGotoURL;
|
|
|
@Value("${oldSys.goods}")
|
|
|
@@ -543,12 +547,57 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
|
|
|
userUpdateAddBo.setIdCard(update.getIdCard());
|
|
|
}
|
|
|
}
|
|
|
+ if (ObjectUtils.isNotNull(bo.getCardCheck()) && bo.getCardCheck() == 1
|
|
|
+ && StringUtils.isNotBlank(bo.getIdCardImg1()) && StringUtils.isNotBlank(bo.getIdCard())){
|
|
|
+ //是否有修改
|
|
|
+ if (StringUtils.isBlank(oldUser.getIdCardImg1())){
|
|
|
+ //没有照片
|
|
|
+ Map<String, String> map = IdCardCheck(bo.getIdCardImg1());
|
|
|
+ String idCard = map.get("IdNum");
|
|
|
+ String name = map.get("IdName");
|
|
|
+ if (!idCard.equals(bo.getIdCard())){
|
|
|
+ throw new CustomException(String.format("照片识别的身份证号【%s】与填写的身份证号【%s】不相同,请注意检查!",idCard,bo.getIdCard()),66066);
|
|
|
+ }
|
|
|
+ if (!name.equals(bo.getRealname())){
|
|
|
+ throw new CustomException(String.format("照片识别的姓名【%s】与填写的姓名【%s】不相同,请注意检查!",name,bo.getRealname()),66066);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (StringUtils.isNotBlank(bo.getIdCardImg1()) && StringUtils.isNotBlank(oldUser.getIdCardImg1())
|
|
|
+ && (!oldUser.getIdCardImg1().equals(bo.getIdCardImg1())
|
|
|
+ || !oldUser.getIdCard().equals(bo.getIdCard())
|
|
|
+ || !oldUser.getRealname().equals(bo.getRealname()))){
|
|
|
+ //修改身份证照片/身份证号/姓名
|
|
|
+ Map<String, String> map = IdCardCheck(bo.getIdCardImg1());
|
|
|
+ String idCard = map.get("IdNum");
|
|
|
+ String name = map.get("IdName");
|
|
|
+ if (!idCard.equals(oldUser.getIdCard())){
|
|
|
+ throw new CustomException(String.format("照片识别的身份证号【%s】与填写的身份证号【%s】不相同,请注意检查!",idCard,bo.getIdCard()),66066);
|
|
|
+ }
|
|
|
+ if (!name.equals(oldUser.getRealname())){
|
|
|
+ throw new CustomException(String.format("照片识别的姓名【%s】与填写的姓名【%s】不相同,请注意检查!",name,bo.getRealname()),66066);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
if (Validator.isNotEmpty(userUpdateAddBo.getUserId())) {
|
|
|
userUpdateService.insertByAddBo(userUpdateAddBo);
|
|
|
}
|
|
|
return this.updateById(update);
|
|
|
}
|
|
|
|
|
|
+ private Map<String, String> IdCardCheck(String idCardUrl){
|
|
|
+ FaceQueryBo faceQueryBo = new FaceQueryBo();
|
|
|
+ faceQueryBo.setCardImageUrl(String.format("https://file.xyyxt.net/%s",idCardUrl));
|
|
|
+ faceQueryBo.setCardSide(1);
|
|
|
+ Map<String, String> map = iFaceOcrService.IDCardOCR(faceQueryBo);
|
|
|
+ if (StringUtils.isNotBlank(map.get("errorMsg"))){
|
|
|
+ throw new CustomException(map.get("errorMsg"),66066);
|
|
|
+ }
|
|
|
+ return map;
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
public Boolean appUpdateByEditBo(UserEditBo bo) throws IllegalAccessException {
|
|
|
User update = BeanUtil.toBean(bo, User.class);
|