|
@@ -4,6 +4,8 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.sqx.common.utils.Result;
|
|
|
import com.sqx.modules.app.annotation.Login;
|
|
|
import com.sqx.modules.common.service.CommonInfoService;
|
|
|
+import com.sqx.modules.driver.entity.Driver;
|
|
|
+import com.sqx.modules.driver.service.DriverService;
|
|
|
import com.sqx.modules.userRealnameInfo.entity.UserRealnameInfo;
|
|
|
import com.sqx.modules.userRealnameInfo.service.UserRealnameInfoService;
|
|
|
import com.sqx.modules.utils.AESCBCWithRandomIV;
|
|
@@ -22,6 +24,8 @@ public class UserRealnameInfoController {
|
|
|
private UserRealnameInfoService userRealnameInfoService;
|
|
|
@Resource
|
|
|
private CommonInfoService commonInfoService;
|
|
|
+ @Resource
|
|
|
+ private DriverService driverService;
|
|
|
|
|
|
@Login
|
|
|
@GetMapping("/selectByUserId")
|
|
@@ -61,9 +65,19 @@ public class UserRealnameInfoController {
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
+ userRealnameInfo.setDriverId(driverService.selectDriverByUserId(userId).getDriverId());
|
|
|
userRealnameInfo.setIdCardNumber(encrypt);
|
|
|
userRealnameInfoService.insert(userRealnameInfo);
|
|
|
}else if (list.size() == 1){
|
|
|
+ if (null != userRealnameInfo.getIdCardNumber() && userRealnameInfo.getIdCardNumber() != ""){
|
|
|
+ String encrypt = null;
|
|
|
+ try {
|
|
|
+ encrypt = AESCBCWithRandomIV.encrypt(userRealnameInfo.getIdCardNumber(), key);
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ userRealnameInfo.setIdCardNumber(encrypt);
|
|
|
+ }
|
|
|
userRealnameInfoService.update(userRealnameInfo);
|
|
|
}
|
|
|
return Result.success();
|