|
@@ -88,33 +88,54 @@ public class UserInformationServiceImpl implements UserInformationService {
|
|
|
public UserInformationDO getAi() {
|
|
|
Long userId = SecurityFrameworkUtils.getLoginUserId();
|
|
|
|
|
|
- return userInformation(userId, false);
|
|
|
+ return userInformationAi(userId);
|
|
|
}
|
|
|
|
|
|
+ private UserInformationDO userInformationAi(Long userId) {
|
|
|
+ UserInformationDO userInformation = userInformationMapper.selectOne(UserInformationDO::getUserId,
|
|
|
+ SecurityFrameworkUtils.getLoginUserId());
|
|
|
+
|
|
|
+ if (userInformation != null) {
|
|
|
+
|
|
|
+
|
|
|
+ return userInformation;
|
|
|
+ } else {
|
|
|
+ UserInformationDO insertUserInformation = new UserInformationDO();
|
|
|
+ insertUserInformation = userAiInformation(userId);
|
|
|
+ insertUserInformation.setUserId(SecurityFrameworkUtils.getLoginUserId());
|
|
|
+
|
|
|
+
|
|
|
+ insertUserInformation.setUserId(userId);
|
|
|
+ userInformationMapper.insert(insertUserInformation);
|
|
|
+// AiFrameworkUtils.getHtml("个人征信HTML", userInformation.getCreditInformation());
|
|
|
+ return insertUserInformation;
|
|
|
+ }
|
|
|
+ }
|
|
|
private UserInformationDO userInformation(Long userId, Boolean updateFlag) {
|
|
|
UserInformationDO userInformation = userInformationMapper.selectOne(UserInformationDO::getUserId,
|
|
|
SecurityFrameworkUtils.getLoginUserId());
|
|
|
|
|
|
if (userInformation != null) {
|
|
|
- Long id = userInformation.getId();
|
|
|
- if (updateFlag) {
|
|
|
- userInformation = userAiInformation(userId);
|
|
|
- userInformation.setId(id);
|
|
|
+
|
|
|
+ UserInformationDO tdo = userAiInformation(userId);
|
|
|
+ userInformation.setCreditInformation(tdo.getCreditInformation());
|
|
|
+ userInformation.setBusinessLicenseInformation(tdo.getBusinessLicenseInformation());
|
|
|
userInformation.setUserHtml(AiFrameworkUtils.getHtml("个人征信HTML",
|
|
|
"个人征信" + userInformation.getCreditInformation()
|
|
|
+ "营业执照" + userInformation.getCreditInformation()));
|
|
|
userInformationMapper.updateById(userInformation);
|
|
|
- }
|
|
|
return userInformation;
|
|
|
} else {
|
|
|
UserInformationDO insertUserInformation = new UserInformationDO();
|
|
|
- insertUserInformation = userAiInformation(userId);
|
|
|
insertUserInformation.setUserId(SecurityFrameworkUtils.getLoginUserId());
|
|
|
- if (updateFlag) {
|
|
|
+ UserInformationDO tdo = userAiInformation(userId);
|
|
|
+ insertUserInformation.setCreditInformation(tdo.getCreditInformation());
|
|
|
+ insertUserInformation.setBusinessLicenseInformation(tdo.getBusinessLicenseInformation());
|
|
|
insertUserInformation.setUserHtml(AiFrameworkUtils.getHtml("个人征信HTML",
|
|
|
"个人征信" + insertUserInformation.getCreditInformation()
|
|
|
+ "营业执照" + insertUserInformation.getCreditInformation()));
|
|
|
- }
|
|
|
+
|
|
|
+ insertUserInformation.setUserId(userId);
|
|
|
userInformationMapper.insert(insertUserInformation);
|
|
|
// AiFrameworkUtils.getHtml("个人征信HTML", userInformation.getCreditInformation());
|
|
|
return insertUserInformation;
|