From 8248a1d5302e33e7620879287d8aaae60c1886ac Mon Sep 17 00:00:00 2001 From: huangxinlu Date: Thu, 7 Nov 2019 20:07:16 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BA=AB=E4=BB=BD=E8=AE=A4=E8=AF=81=E4=B8=8D?= =?UTF-8?q?=E9=9C=80=E8=A6=81=E5=AE=A1=E6=A0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../user/entity/UserAuthentication.java | 4 +- .../impl/AuthenticationApplyServiceImpl.java | 44 +++++++++++-------- .../mapper/UserAuthenticationMapper.xml | 2 +- 3 files changed, 28 insertions(+), 22 deletions(-) diff --git a/blockchain-server/blockchain-server-user/src/main/java/com/blockchain/server/user/entity/UserAuthentication.java b/blockchain-server/blockchain-server-user/src/main/java/com/blockchain/server/user/entity/UserAuthentication.java index 86c9551..013add1 100644 --- a/blockchain-server/blockchain-server-user/src/main/java/com/blockchain/server/user/entity/UserAuthentication.java +++ b/blockchain-server/blockchain-server-user/src/main/java/com/blockchain/server/user/entity/UserAuthentication.java @@ -74,7 +74,7 @@ public class UserAuthentication extends BaseModel { /** * 修改时间 */ - @Column(name = "midify_time") - private java.util.Date midifyTime; + @Column(name = "modify_time") + private java.util.Date modifyTime; } \ No newline at end of file diff --git a/blockchain-server/blockchain-server-user/src/main/java/com/blockchain/server/user/service/impl/AuthenticationApplyServiceImpl.java b/blockchain-server/blockchain-server-user/src/main/java/com/blockchain/server/user/service/impl/AuthenticationApplyServiceImpl.java index 08447c2..8ed132b 100644 --- a/blockchain-server/blockchain-server-user/src/main/java/com/blockchain/server/user/service/impl/AuthenticationApplyServiceImpl.java +++ b/blockchain-server/blockchain-server-user/src/main/java/com/blockchain/server/user/service/impl/AuthenticationApplyServiceImpl.java @@ -7,12 +7,10 @@ import com.blockchain.server.user.common.constants.sql.UserInfoConstant; import com.blockchain.server.user.common.enums.UserEnums; import com.blockchain.server.user.common.exceprion.UserException; import com.blockchain.server.user.common.utils.FileUploadHelper; -import com.blockchain.server.user.entity.AuthenticationApply; -import com.blockchain.server.user.entity.AuthenticationApplyLog; -import com.blockchain.server.user.entity.HighAuthenticationApply; -import com.blockchain.server.user.entity.UserInfo; +import com.blockchain.server.user.entity.*; import com.blockchain.server.user.mapper.AuthenticationApplyMapper; import com.blockchain.server.user.mapper.HighAuthenticationApplyMapper; +import com.blockchain.server.user.mapper.UserAuthenticationMapper; import com.blockchain.server.user.service.AuthenticationApplyLogService; import com.blockchain.server.user.service.AuthenticationApplyService; import com.blockchain.server.user.service.UserInfoService; @@ -38,6 +36,8 @@ public class AuthenticationApplyServiceImpl implements AuthenticationApplyServic private HighAuthenticationApplyMapper highAuthenticationApplyMapper; @Autowired private AuthenticationApplyLogService authenticationApplyLogService; + @Autowired + private UserAuthenticationMapper userAuthenticationMapper; @Override @@ -75,7 +75,7 @@ public class AuthenticationApplyServiceImpl implements AuthenticationApplyServic String[] filePath = imgs.split(","); - AuthenticationApply apply = new AuthenticationApply(); + UserAuthentication apply = new UserAuthentication(); apply.setId(UUID.randomUUID().toString()); apply.setUserId(userId); apply.setCreateTime(now); @@ -86,10 +86,9 @@ public class AuthenticationApplyServiceImpl implements AuthenticationApplyServic apply.setRealName(realName); apply.setType(type); apply.setModifyTime(now); - apply.setStatus(AuthenticationApplyConstant.STATUS_WAIT); - authenticationApplyMapper.insert(apply); + userAuthenticationMapper.insert(apply); - userInfo.setLowAuth(UserInfoConstant.STATUS_LOW_AUTH_WAIT); + userInfo.setLowAuth(UserInfoConstant.STATUS_LOW_AUTH_YES); userInfo.setModifyTime(now); userInfoService.updateUserInfo(userInfo); } @@ -114,17 +113,24 @@ public class AuthenticationApplyServiceImpl implements AuthenticationApplyServic } Date now = new Date(); - HighAuthenticationApply apply = new HighAuthenticationApply(); - apply.setId(UUID.randomUUID().toString()); - apply.setCreateTime(now); - apply.setFileUrl(img); - apply.setModifyTime(now); - apply.setStatus(AuthenticationApplyConstant.STATUS_WAIT); - apply.setUserId(userId); - - highAuthenticationApplyMapper.insert(apply); - - userInfo.setHighAuth(UserInfoConstant.STATUS_HIGHT_AUTH_WAIT); +// HighAuthenticationApply apply = new HighAuthenticationApply(); +// apply.setId(UUID.randomUUID().toString()); +// apply.setCreateTime(now); +// apply.setFileUrl(img); +// apply.setModifyTime(now); +// apply.setStatus(AuthenticationApplyConstant.STATUS_WAIT); +// apply.setUserId(userId); +// +// highAuthenticationApplyMapper.insert(apply); + + UserAuthentication exist = new UserAuthentication(); + exist.setUserId(userId); + UserAuthentication userAuthentication = userAuthenticationMapper.selectOne(exist); + userAuthentication.setFileUrl3(img); + userAuthentication.setModifyTime(now); + userAuthenticationMapper.updateByPrimaryKey(userAuthentication); + + userInfo.setHighAuth(UserInfoConstant.STATUS_HIGHT_AUTH_YES); userInfo.setModifyTime(now); userInfoService.updateUserInfo(userInfo); } diff --git a/blockchain-server/blockchain-server-user/src/main/resources/mapper/UserAuthenticationMapper.xml b/blockchain-server/blockchain-server-user/src/main/resources/mapper/UserAuthenticationMapper.xml index 6e17e5b..77ae3b1 100644 --- a/blockchain-server/blockchain-server-user/src/main/resources/mapper/UserAuthenticationMapper.xml +++ b/blockchain-server/blockchain-server-user/src/main/resources/mapper/UserAuthenticationMapper.xml @@ -9,7 +9,7 @@ - +