fix: kyc fix issue
This commit is contained in:
@@ -22,10 +22,9 @@ import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* User Portal-User KYC table contorller
|
||||
* System Portal-User KYC table contorller
|
||||
* </p>
|
||||
*
|
||||
* @author sys
|
||||
* @since 2025-01-08
|
||||
*/
|
||||
@RestController
|
||||
|
||||
@@ -13,8 +13,9 @@ import org.wfc.common.core.web.domain.AjaxResult;
|
||||
import org.wfc.common.core.web.page.TableDataInfo;
|
||||
import org.wfc.common.log.annotation.Log;
|
||||
import org.wfc.common.log.enums.BusinessType;
|
||||
import org.wfc.common.security.annotation.RequiresPermissions;
|
||||
// import org.wfc.common.security.annotation.RequiresPermissions;
|
||||
import org.wfc.user.domain.UKyc;
|
||||
import org.wfc.user.domain.constant.KycStatusEnum;
|
||||
import org.wfc.user.domain.vo.UKycUserVo;
|
||||
import org.wfc.user.service.IUKycService;
|
||||
|
||||
@@ -22,10 +23,9 @@ import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 用户平台-账单表 前端控制器
|
||||
* User Portal-User KYC table contorller
|
||||
* </p>
|
||||
*
|
||||
* @author sys
|
||||
* @since 2025-01-06
|
||||
*/
|
||||
@RestController
|
||||
@@ -35,7 +35,7 @@ public class UKycController extends BaseController {
|
||||
@Autowired
|
||||
private IUKycService uKycService;
|
||||
|
||||
@RequiresPermissions("Utem:kyc:query")
|
||||
// @RequiresPermissions("Utem:kyc:query")
|
||||
@GetMapping("/page")
|
||||
public TableDataInfo page() {
|
||||
startPage();
|
||||
@@ -43,17 +43,19 @@ public class UKycController extends BaseController {
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@RequiresPermissions("Utem:kyc:add")
|
||||
// @RequiresPermissions("Utem:kyc:add")
|
||||
@Log(title = "User Management", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/verify")
|
||||
public AjaxResult add(@Validated @RequestBody UKyc uKyc) {
|
||||
uKyc.setStatus(KycStatusEnum.PENDING.getCode());
|
||||
return toAjax(uKycService.insertUserKyc(uKyc));
|
||||
}
|
||||
|
||||
@RequiresPermissions("Utem:kyc:edit")
|
||||
// @RequiresPermissions("Utem:kyc:edit")
|
||||
@Log(title = "User Management", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/verify")
|
||||
public AjaxResult edit(@Validated @RequestBody UKyc uKyc) {
|
||||
uKyc.setStatus(KycStatusEnum.PENDING.getCode());
|
||||
return toAjax(uKycService.updateUserKyc(uKyc));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ public class UKycUserVo {
|
||||
private Long userId;
|
||||
|
||||
@Schema(description = "Real Name")
|
||||
private String userName;
|
||||
private String realName;
|
||||
|
||||
@Schema(description = "Birth Date")
|
||||
private String birthDate;
|
||||
|
||||
@@ -50,6 +50,18 @@ public class UKycServiceImpl extends ServiceImpl<UKycMapper, UKyc> implements IU
|
||||
@Override
|
||||
public int insertUserKyc(UKyc uKyc) {
|
||||
log.debug("uKyc: {}", uKyc);
|
||||
LoginUser<Object> loginUser = SecurityUtils.getLoginUser();
|
||||
|
||||
if (uKyc.getUserId() == null) {
|
||||
uKyc.setUserId(loginUser.getUserid());
|
||||
} else {
|
||||
if (!loginUser.getUserid().equals(uKyc.getUserId())) {
|
||||
log.error("The kyc user(userId={}) is not the logged in user(userId={})",
|
||||
uKyc.getUserId(), loginUser.getUserid());
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (this.uKycMapper.isExistUserKyc(uKyc.getUserId()) == 0) {
|
||||
return this.uKycMapper.insertUserKyc(uKyc);
|
||||
} else {
|
||||
@@ -59,6 +71,18 @@ public class UKycServiceImpl extends ServiceImpl<UKycMapper, UKyc> implements IU
|
||||
|
||||
@Override
|
||||
public int updateUserKyc(UKyc uKyc) {
|
||||
LoginUser<Object> loginUser = SecurityUtils.getLoginUser();
|
||||
|
||||
if (uKyc.getUserId() == null) {
|
||||
uKyc.setUserId(loginUser.getUserid());
|
||||
} else {
|
||||
if (!loginUser.getUserid().equals(uKyc.getUserId())) {
|
||||
log.error("The kyc user(userId={}) is not the logged in user(userId={})",
|
||||
uKyc.getUserId(), loginUser.getUserid());
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
return this.uKycMapper.updateUserKyc(uKyc);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -73,7 +73,7 @@
|
||||
SELECT
|
||||
k.kyc_id,
|
||||
k.user_id,
|
||||
u.user_name,
|
||||
u.full_name as realName,
|
||||
k.birth_date,
|
||||
k.id_type,
|
||||
k.id_file,
|
||||
|
||||
Reference in New Issue
Block a user