parent
dd64ea523f
commit
5e4be58b1a
19 changed files with 366 additions and 180 deletions
@ -0,0 +1,16 @@ |
|||||||
|
package com.blockchain.server.yyyf.dto; |
||||||
|
|
||||||
|
import com.blockchain.server.yyyf.entity.AssessUserTarget; |
||||||
|
import lombok.Data; |
||||||
|
|
||||||
|
/** |
||||||
|
* @author huan.xu |
||||||
|
* @version 1.0 |
||||||
|
* @className AssessUserTargetDto |
||||||
|
* @description |
||||||
|
* @date 2020-05-13 16:52 |
||||||
|
*/ |
||||||
|
@Data |
||||||
|
public class AssessUserTargetDto extends AssessUserTarget { |
||||||
|
private String assessUserId; |
||||||
|
} |
@ -1,46 +0,0 @@ |
|||||||
package com.blockchain.server.yyyf.entity; |
|
||||||
|
|
||||||
import lombok.Data; |
|
||||||
|
|
||||||
import javax.persistence.Column; |
|
||||||
import javax.persistence.Id; |
|
||||||
import javax.persistence.Table; |
|
||||||
import java.io.Serializable; |
|
||||||
import java.math.BigDecimal; |
|
||||||
@Table(name = "yyyf_server_assess_user_project") |
|
||||||
@Data |
|
||||||
public class AssessUserProject implements Serializable { |
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L; |
|
||||||
|
|
||||||
/** |
|
||||||
* uuid |
|
||||||
*/ |
|
||||||
@Id |
|
||||||
@Column(name = "id") |
|
||||||
private String id; |
|
||||||
/** |
|
||||||
* 用户考核主表id |
|
||||||
*/ |
|
||||||
@Column(name = "assess_user_id") |
|
||||||
private String assessUserId; |
|
||||||
/** |
|
||||||
* 子系统项目id |
|
||||||
*/ |
|
||||||
@Column(name = "project_id") |
|
||||||
private String projectId; |
|
||||||
/** |
|
||||||
* 子系统项目名称 |
|
||||||
*/ |
|
||||||
@Column(name = "project_name") |
|
||||||
private String projectName; |
|
||||||
/** |
|
||||||
* 项目得分 |
|
||||||
*/ |
|
||||||
@Column(name = "project_score") |
|
||||||
private BigDecimal projectScore; |
|
||||||
|
|
||||||
@Column(name = "project_case_desc") |
|
||||||
private BigDecimal projectCaseDesc; |
|
||||||
|
|
||||||
} |
|
@ -0,0 +1,65 @@ |
|||||||
|
package com.blockchain.server.yyyf.entity; |
||||||
|
|
||||||
|
import lombok.Data; |
||||||
|
|
||||||
|
import javax.persistence.Column; |
||||||
|
import javax.persistence.Id; |
||||||
|
import javax.persistence.Table; |
||||||
|
import java.io.Serializable; |
||||||
|
|
||||||
|
@Table(name = "yyyf_server_assess_user_target") |
||||||
|
@Data |
||||||
|
public class AssessUserTarget implements Serializable { |
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L; |
||||||
|
|
||||||
|
/** |
||||||
|
* uuid |
||||||
|
*/ |
||||||
|
@Id |
||||||
|
@Column(name = "id") |
||||||
|
private String id; |
||||||
|
/** |
||||||
|
* 用户考核主表id |
||||||
|
*/ |
||||||
|
@Column(name = "assess_user_id") |
||||||
|
private String assessUserId; |
||||||
|
/** |
||||||
|
* 指标id |
||||||
|
*/ |
||||||
|
@Column(name = "targe_id") |
||||||
|
private String targeId; |
||||||
|
|
||||||
|
/** |
||||||
|
* 指标名称 |
||||||
|
*/ |
||||||
|
@Column(name = "target_name") |
||||||
|
private String targetName; |
||||||
|
|
||||||
|
/** |
||||||
|
* 任务目标运算符:1大于2等于3小于 |
||||||
|
*/ |
||||||
|
@Column(name = "task_operate") |
||||||
|
private Integer taskOperate; |
||||||
|
/** |
||||||
|
* 任务目标比率 |
||||||
|
*/ |
||||||
|
@Column(name = "task_rate") |
||||||
|
private Double taskRate; |
||||||
|
/** |
||||||
|
* 任务分数 |
||||||
|
*/ |
||||||
|
@Column(name = "task_score") |
||||||
|
private Double taskScore; |
||||||
|
/** |
||||||
|
* 指标代码 |
||||||
|
*/ |
||||||
|
@Column(name = "code") |
||||||
|
private String code; |
||||||
|
|
||||||
|
/** |
||||||
|
* 排序 |
||||||
|
*/ |
||||||
|
@Column(name = "sort") |
||||||
|
private Integer sort; |
||||||
|
} |
@ -0,0 +1,95 @@ |
|||||||
|
package com.blockchain.server.yyyf.enums; |
||||||
|
|
||||||
|
/** |
||||||
|
* @author huangxl |
||||||
|
* @data 2019/2/21 20:53 |
||||||
|
*/ |
||||||
|
public enum UserEnums { |
||||||
|
USER_NOT_FORBID_OTHER_USER(1098, "禁止登录他人账号", "The user does not allow login other user's accout", "禁止登錄他人賬號"), |
||||||
|
USER_NOT_BIND_YYYF(1099, "该用户未绑定以渔有方或者以渔有方登录已失效", "The user does not bind yyyf", "該用戶未綁定以漁有方或者以漁有方登錄已失效"), |
||||||
|
USER_EXISTS(1100, "该用户已存在", "The user already exists", "該用戶已存在"), |
||||||
|
USER_NOT_EXISTS(1101, "不存在该用户", "The user does not exist", "不存在該用戶"), |
||||||
|
LOGIN_PASSWORD_ERROR(1102, "用户名密码错误", "Wrong username and password", "用戶名密碼錯誤"), |
||||||
|
LOGIN_FORBIDDEN(1103, "你被列入黑名单,禁止登录", "You are blacklisted from logging in", "你被列入黑名單,禁止登錄"), |
||||||
|
SMS_VERIFY_FAIL(1104, "手机号验证码错误", "Wrong verification code for mobile phone number", "手機號驗證碼錯誤"), |
||||||
|
SMS_CODE_NOT_EXIST(1105, "请先获取验证码信息", "Please get the captcha information first", "請先獲取驗證碼資訊"), |
||||||
|
PHONE_FORMAT_ERROR(1106, "手机号格式不正确", "The phone number format is not correct", "手機號格式不正確"), |
||||||
|
FORMAT_ERROR(1106, "手机号或邮箱格式不正确", "The phone number or email format is not correct", "手機號或郵箱格式不正確"), |
||||||
|
VERIFY_CODE_TYPE_ERROR(1107, "没有此类型短信", "There is no text message of this type", "沒有此類型短信"), |
||||||
|
VERIFY_CODE_OVER_COUNT(1108, "今日获取验证码到达上限", "The upper limit of the captcha is reached today", "今日獲取驗證碼到達上限"), |
||||||
|
USER_PHONE_EXISTS(1109, "该手机号或邮箱已存在", "The phone number or email address already exists", "該手機號或郵箱已存在"), |
||||||
|
USER_PASSWORD_ERROR_FORMAT(1110, "密码只能是6-16位数字、字母和特殊字符的组合", "Passwords can only be 6-16 digit combinations of Numbers, letters, and special characters", "密碼只能是6-16位數字、字母和特殊字元的組合"), |
||||||
|
INVALID_INVITATION_CODE(1111, "无效的邀请码信息", "Invalid invitation code information", "無效的邀請碼資訊"), |
||||||
|
INVALID_NICK_NAME(1112, "昵称不能包含特殊字符", "Nicknames cannot contain special characters", "昵稱不能包含特殊字元"), |
||||||
|
PHONE_NOT_CHANGE(1113, "手机号码与当前用户一致", "The phone number is the same as the current user", "手機號碼與當前用戶一致"), |
||||||
|
GOOGLE_SECRET_KEY_FAIL(1114, "获取谷歌安全码失败", "Failed to get Google security code", "獲取穀歌安全碼失敗"), |
||||||
|
GOOGLE_SECRET_KEY_EXIST(1115, "你已绑定谷歌验证器,请勿重复绑定", "You have bound the Google validator. Do not repeat the binding", "你已綁定穀歌驗證器,請勿重複綁定"), |
||||||
|
GOOGLE_AUTH_FAIL(1116, "谷歌验证器验证失败", "Google verifier validation failed", "穀歌驗證器驗證失敗"), |
||||||
|
FILE_UPLOAD_ERROR(1117, "文件上传失败", "File upload failed", "文檔上傳失敗"), |
||||||
|
FILE_UPLOAD_LIMIT(1118, "文件上传失败,上传文件次数过多!", "File upload failed, too many times!", "文檔上傳失敗,上傳檔次數過多!"), |
||||||
|
FILE_UPLOAD_FORMAT_ERROR(1119, "文件地址错误", "File address error", "文檔地址錯誤"), |
||||||
|
FILE_UPLOAD_DEFICIENCY(1120, "请先上传文件", "Please upload the file first", "請先上傳文檔"), |
||||||
|
AUTH_WAIT(1121, "认证审核中,请勿重复申请!", "Please do not repeat the application during the certification audit!", "認證審核中,請勿重複申請!"), |
||||||
|
AUTH_YES(1122, "你已完成认证!", "You have completed the certification!", "你已完成認證!"), |
||||||
|
AUTH_BASIC_BEFORE(1123, "请先完成初级认证!", "Please complete the primary certification first!", "請先完成初級認證!"), |
||||||
|
EMAIL_FORMAT_ERROR(1124, "无效的邮箱格式!", "Invalid mailbox format!", "無效的郵箱格式!"), |
||||||
|
EMAIL_VERIFY_FAIL(1125, "邮箱验证失败!", "Mailbox authentication failed!", "郵箱驗證失敗!"), |
||||||
|
EMAIL_BIND_REPEAT(1126, "绑定失败,你已绑定邮箱", "Failed to bind. You have bound your mailbox", "綁定失敗,你已綁定郵箱"), |
||||||
|
PASSWORD_EXIST(1127, "设置失败,你已经设置过密码了", "Setup failed. You have already set the password", "設置失敗,你已經設置過密碼了"), |
||||||
|
EMAIL_EXIST(1128, "绑定失败,该邮箱已被绑定!", "The mailbox has been bound!", "綁定失敗,該郵箱已被綁定!"), |
||||||
|
PASSWORD_NOT_MATCH(1129, "密码不匹配", "Password mismatch", "密碼不匹配"), |
||||||
|
TRANSACTION_FORBIDDEN(1130, "你被列入黑名单,禁止交易!", "You're blacklisted! No trading!", "你被列入黑名單,禁止交易!"), |
||||||
|
CANNOT_FOUND_INTERNATIONAL(1131, "找不到该国家信息", "Country information not available", "找不到該國家信息"), |
||||||
|
VERIFY_CODE_DID_NOT_FIND(1034, "验证码已过期或没有获取", "The captcha is expired or not available", "驗證碼已過期或沒有獲取"), |
||||||
|
VERIFY_CODE_DID_NOT_MATCH(1035, "您输入的验证码不匹配", "The verification code you entered does not match", "您輸入的驗證碼不匹配"), |
||||||
|
WITHDRAW_FORBIDDEN(1136, "你被列入黑名单,禁止提现!", "You are blacklisted and no withdrawal is allowed!", "你被列入黑名單,禁止提現!"), |
||||||
|
TRANSACTION_NOT_PASS_HIGH_AUTH(1137, "操作失败,您未通过高级认证!", "Operation failed. You did not pass advanced certification!", "操作失敗,您未通過高級認證!"), |
||||||
|
TRANSACTION_NOT_PASS_LOW_AUTH(1137, "操作失败,您未通过初级认证!", "Operation failed. You did not pass primary certification!", "操作失敗,您未通過初級認證!"), |
||||||
|
SEND_CODE_ERROR(1138, "验证码发送失败!", "Verification code failed to send!", "驗證碼發送失敗!"), |
||||||
|
; |
||||||
|
|
||||||
|
|
||||||
|
private int code; |
||||||
|
private String hkmsg; |
||||||
|
private String enMsg; |
||||||
|
private String cnmsg; |
||||||
|
|
||||||
|
UserEnums(int code, String cnmsg, String enMsg, String hkmsg) { |
||||||
|
this.code = code; |
||||||
|
this.cnmsg = cnmsg; |
||||||
|
this.enMsg = enMsg; |
||||||
|
this.hkmsg = hkmsg; |
||||||
|
} |
||||||
|
|
||||||
|
public int getCode() { |
||||||
|
return code; |
||||||
|
} |
||||||
|
|
||||||
|
public void setCode(int code) { |
||||||
|
this.code = code; |
||||||
|
} |
||||||
|
|
||||||
|
public String getHkmsg() { |
||||||
|
return hkmsg; |
||||||
|
} |
||||||
|
|
||||||
|
public void setHkmsg(String hkmsg) { |
||||||
|
this.hkmsg = hkmsg; |
||||||
|
} |
||||||
|
|
||||||
|
public String getEnMsg() { |
||||||
|
return enMsg; |
||||||
|
} |
||||||
|
|
||||||
|
public void setEnMsg(String enMsg) { |
||||||
|
this.enMsg = enMsg; |
||||||
|
} |
||||||
|
|
||||||
|
public String getCnmsg() { |
||||||
|
return cnmsg; |
||||||
|
} |
||||||
|
|
||||||
|
public void setCnmsg(String cnmsg) { |
||||||
|
this.cnmsg = cnmsg; |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,52 @@ |
|||||||
|
package com.blockchain.server.yyyf.exceprion; |
||||||
|
|
||||||
|
import com.blockchain.common.base.constant.BaseConstant; |
||||||
|
import com.blockchain.common.base.exception.BaseException; |
||||||
|
import com.blockchain.common.base.util.HttpRequestUtil; |
||||||
|
import com.blockchain.server.yyyf.enums.UserEnums; |
||||||
|
import lombok.Data; |
||||||
|
import org.springframework.web.context.request.RequestContextHolder; |
||||||
|
import org.springframework.web.context.request.ServletRequestAttributes; |
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest; |
||||||
|
|
||||||
|
/** |
||||||
|
* @author huangxl |
||||||
|
* @data 2019/2/21 20:51 |
||||||
|
*/ |
||||||
|
@Data |
||||||
|
public class UserException extends BaseException { |
||||||
|
protected int code; |
||||||
|
protected String msg; |
||||||
|
|
||||||
|
public UserException(int code, String msg) { |
||||||
|
this.code = code; |
||||||
|
this.msg = msg; |
||||||
|
} |
||||||
|
|
||||||
|
public UserException(UserEnums rs) { |
||||||
|
ServletRequestAttributes servletRequestAttributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes(); |
||||||
|
//可能是定时器调用,避免获取request空指针
|
||||||
|
if (servletRequestAttributes == null) { |
||||||
|
this.code = rs.getCode(); |
||||||
|
this.msg = rs.getCnmsg(); |
||||||
|
} else { |
||||||
|
HttpServletRequest request = servletRequestAttributes.getRequest(); |
||||||
|
String userLocale = HttpRequestUtil.getUserLocale(request); |
||||||
|
String msg = ""; |
||||||
|
switch (userLocale) { |
||||||
|
case BaseConstant.USER_LOCALE_EN_US: |
||||||
|
msg = rs.getEnMsg(); |
||||||
|
break; |
||||||
|
case BaseConstant.USER_LOCALE_ZH_HK: |
||||||
|
msg = rs.getHkmsg(); |
||||||
|
break; |
||||||
|
default: |
||||||
|
msg = rs.getCnmsg(); |
||||||
|
break; |
||||||
|
} |
||||||
|
this.code = rs.getCode(); |
||||||
|
this.msg = msg; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
@ -1,15 +0,0 @@ |
|||||||
package com.blockchain.server.yyyf.mapper; |
|
||||||
|
|
||||||
import com.blockchain.server.yyyf.entity.AssessUserProject; |
|
||||||
import org.springframework.stereotype.Repository; |
|
||||||
|
|
||||||
import java.util.List; |
|
||||||
|
|
||||||
@Repository |
|
||||||
public interface AssessUserProjectMapper { |
|
||||||
|
|
||||||
void insert(AssessUserProject assessUserProject); |
|
||||||
|
|
||||||
void batchInsert(List<AssessUserProject> assessUserProjectList); |
|
||||||
|
|
||||||
} |
|
@ -0,0 +1,16 @@ |
|||||||
|
package com.blockchain.server.yyyf.mapper; |
||||||
|
|
||||||
|
import com.blockchain.server.yyyf.dto.AssessUserTargetDto; |
||||||
|
import com.blockchain.server.yyyf.entity.AssessUserTarget; |
||||||
|
import org.apache.ibatis.annotations.Param; |
||||||
|
import org.springframework.stereotype.Repository; |
||||||
|
import tk.mybatis.mapper.common.Mapper; |
||||||
|
|
||||||
|
import java.util.List; |
||||||
|
|
||||||
|
@Repository |
||||||
|
public interface AssessUserTargetMapper extends Mapper<AssessUserTarget> { |
||||||
|
|
||||||
|
|
||||||
|
AssessUserTargetDto selectAssessUserTargetDtoByUserIdAndIssueIdAndCaseId(@Param("userId") Integer userId, @Param("issueId") String issueId,@Param("caseId") String caseId); |
||||||
|
} |
@ -1,4 +0,0 @@ |
|||||||
package com.blockchain.server.yyyf.service; |
|
||||||
|
|
||||||
public interface AssessUserProjectService{ |
|
||||||
} |
|
@ -0,0 +1,13 @@ |
|||||||
|
package com.blockchain.server.yyyf.service; |
||||||
|
|
||||||
|
import com.blockchain.server.yyyf.dto.AssessUserTargetDto; |
||||||
|
import com.blockchain.server.yyyf.entity.AssessUserTarget; |
||||||
|
|
||||||
|
public interface AssessUserTargetService{ |
||||||
|
/** |
||||||
|
* @description 获取指标情况 |
||||||
|
* @param [yyyfUserId, examId, caseId] |
||||||
|
* @return com.blockchain.server.yyyf.dto.AssessUserTargetDto |
||||||
|
**/ |
||||||
|
AssessUserTargetDto selectAssessUserTargetDtoByUserIdAndIssueIdAndCaseId(Integer yyyfUserId, String examId, String caseId); |
||||||
|
} |
@ -1,15 +0,0 @@ |
|||||||
package com.blockchain.server.yyyf.service.impl; |
|
||||||
|
|
||||||
import com.blockchain.server.yyyf.service.AssessUserProjectService; |
|
||||||
import org.springframework.stereotype.Service; |
|
||||||
|
|
||||||
/** |
|
||||||
* @author huan.xu |
|
||||||
* @version 1.0 |
|
||||||
* @className AssessUserProjectServiceImpl |
|
||||||
* @description |
|
||||||
* @date 2019-10-31 17:40 |
|
||||||
*/ |
|
||||||
@Service |
|
||||||
public class AssessUserProjectServiceImpl implements AssessUserProjectService { |
|
||||||
} |
|
@ -0,0 +1,23 @@ |
|||||||
|
package com.blockchain.server.yyyf.service.impl; |
||||||
|
|
||||||
|
import com.blockchain.server.yyyf.dto.AssessUserTargetDto; |
||||||
|
import com.blockchain.server.yyyf.entity.AssessUserTarget; |
||||||
|
import com.blockchain.server.yyyf.mapper.AssessUserTargetMapper; |
||||||
|
import com.blockchain.server.yyyf.service.AssessUserTargetService; |
||||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||||
|
import org.springframework.stereotype.Service; |
||||||
|
|
||||||
|
/** |
||||||
|
* @version 1.0 |
||||||
|
* @className AssessUserProjectServiceImpl |
||||||
|
* @description |
||||||
|
*/ |
||||||
|
@Service |
||||||
|
public class AssessUserTargetServiceImpl implements AssessUserTargetService { |
||||||
|
@Autowired |
||||||
|
private AssessUserTargetMapper assessUserTargetMapper; |
||||||
|
@Override |
||||||
|
public AssessUserTargetDto selectAssessUserTargetDtoByUserIdAndIssueIdAndCaseId(Integer yyyfUserId, String examId, String caseId) { |
||||||
|
return this.assessUserTargetMapper.selectAssessUserTargetDtoByUserIdAndIssueIdAndCaseId(yyyfUserId,examId,caseId); |
||||||
|
} |
||||||
|
} |
Loading…
Reference in new issue