Commit f7ff92e2 authored by liuzicheng's avatar liuzicheng

初始化项目

parent efd3ed79
Pipeline #519 canceled with stages
package com.jqtx.windows.common.config;
import com.alibaba.csp.sentinel.adapter.spring.webmvc.callback.BlockExceptionHandler;
import com.alibaba.csp.sentinel.slots.block.BlockException;
import com.alibaba.csp.sentinel.slots.block.authority.AuthorityException;
import com.alibaba.csp.sentinel.slots.block.degrade.DegradeException;
import com.alibaba.csp.sentinel.slots.block.flow.param.ParamFlowException;
import com.alibaba.csp.sentinel.slots.system.SystemBlockException;
import com.alibaba.fastjson.JSON;
import com.jqtx.windows.infrastructure.enums.ExceptionCodeEnum;
import org.springframework.context.annotation.Configuration;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@Configuration
public class SentinelConfig implements BlockExceptionHandler {
@Override
public void handle(HttpServletRequest request, HttpServletResponse response, BlockException e) throws Exception {
// BlockException 异常接口,其子类为Sentinel五种规则异常的实现类
// AuthorityException 授权异常
// DegradeException 降级异常
// FlowException 限流异常
// ParamFlowException 参数限流异常
// SystemBlockException 系统负载异常
ExceptionCodeEnum codeEnum = ExceptionCodeEnum.CURRENT_LIMIT_ERROR;
if (e instanceof DegradeException) {
codeEnum = ExceptionCodeEnum.SERVICE_DEMO_ERROR;
} else if (e instanceof ParamFlowException) {
codeEnum = ExceptionCodeEnum.HOT_CHAR_ERROR;
} else if (e instanceof SystemBlockException) {
codeEnum = ExceptionCodeEnum.SYSTEM_FAIL_ERROR;
} else if (e instanceof AuthorityException) {
codeEnum = ExceptionCodeEnum.ROLE_FAIL_ERROR;
}
response.setCharacterEncoding("UTF-8");
response.setContentType("application/json");
response.getWriter().write(JSON.toJSONString(JsonResult.error(codeEnum)));
}
}
\ No newline at end of file
......@@ -2,7 +2,6 @@ package com.jqtx.windows.common.utils;
import com.jqtx.windows.common.exception.BizException;
import com.jqtx.windows.infrastructure.enums.ExceptionCodeEnum;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.core.ValueOperations;
......
package com.jqtx.windows.common.utils;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
import com.jqtx.windows.common.exception.BizException;
import com.jqtx.windows.infrastructure.enums.ExceptionCodeEnum;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
/**
* @program: baoyouhua
* @description:
* @author: zq
* @create: 2022-05-24 17:16
**/
public class TrialUtil {
public static final BigDecimal irrXi = new BigDecimal(0.12);
public static final BigDecimal irrFu12 = new BigDecimal(0.0576);
public static final BigDecimal irrFu18 = new BigDecimal(0.0696);
public static final BigDecimal irrFu24 = new BigDecimal(0.0696);
public static final BigDecimal irrFu36 = new BigDecimal(0.078);
public static List<PlanResp> getList(String loanIntentionAmount, String loanIntentionNum) {
List list = new ArrayList<>();
BigDecimal amount = new BigDecimal(loanIntentionAmount);
if(amount.intValue()<=0){
throw new BizException(ExceptionCodeEnum.PARAMS_ILLEGAL);
}
int a = Integer.valueOf(loanIntentionNum).intValue();
BigDecimal irrFu = BigDecimal.ZERO;
switch (a) {
case 12:
irrFu = irrFu12;
break;
case 18:
irrFu = irrFu18;
break;
case 24:
irrFu = irrFu24;
break;
case 36:
irrFu = irrFu36;
break;
}
for (int i = 1; i <= a; i++) {
PlanResp resp = new PlanResp();
BigDecimal ben = amount.divide(new BigDecimal(loanIntentionNum), 2, BigDecimal.ROUND_HALF_UP);
BigDecimal xi = amount.multiply(irrXi).divide(new BigDecimal(12), 2, BigDecimal.ROUND_HALF_UP);
BigDecimal fu = amount.multiply(irrFu).divide(new BigDecimal(12), 2, BigDecimal.ROUND_HALF_UP);
BigDecimal add = ben.add(xi).add(fu);
resp.setPlanAmt(add.toString());
DateTime dateTime = DateUtil.offsetMonth(DateUtil.date(), i);
resp.setPlanDate(DateUtil.formatDate(dateTime));
resp.setPlanIndex(String.valueOf(i));
list.add(resp);
}
return list;
}
}
package com.jqtx.windows.infrastructure.enums;
import org.apache.commons.lang3.StringUtils;
/*
* @ClassName ActionEnum
* @Author liuzicheng
* @Description //TODO
* @Date 2022/5/26 11:39
*/
public enum ActionEnum {
PASS("PASS", "通过"),
BACK("BACK", "退回"),
REJECT("REJECT", "拒绝");
ActionEnum(String code, String message) {
this.code = code;
this.message = message;
}
public static ActionEnum getEnum(String code) {
for (ActionEnum loanEnum : ActionEnum.values()) {
if (StringUtils.equals(loanEnum.getCode(), code)) {
return loanEnum;
}
}
return null;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
private String code;
private String message;
}
package com.jqtx.windows.infrastructure.enums;
import org.apache.commons.lang3.StringUtils;
/*
* @ClassName ActionEnum
* @Author liuzicheng
* @Description //TODO
* @Date 2022/5/26 11:39
*/
public enum ApprovalStatusEnum {
INIT("INIT", "初始化"),
FINISH("FINISH", "完成");
ApprovalStatusEnum(String code, String message) {
this.code = code;
this.message = message;
}
public static ApprovalStatusEnum getEnum(String code) {
for (ApprovalStatusEnum loanEnum : ApprovalStatusEnum.values()) {
if (StringUtils.equals(loanEnum.getCode(), code)) {
return loanEnum;
}
}
return null;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
private String code;
private String message;
}
package com.jqtx.windows.infrastructure.enums;
import org.apache.commons.lang3.StringUtils;
import java.util.ArrayList;
import java.util.List;
public enum AttachTypeEnum {
TAOBAO("taobao", "H5","淘宝收货地址截图"),
SHOURU("shouru", "H5","收入证明"),
HUABEI("huabei", "H5","花呗截图"),
SHOUSHU("shoushu", "H5","手术单照片"),
SHIMING("shiming", "H5","支付宝实名"),
ZHIMA("zhima", "H5","芝麻信用分"),
FUMIAN("fumian", "H5","支付宝负面信息"),
KEHU("kehu", "H5","客户照片"),
ALIPAY("alipay", "H5","支付宝相关"),
QITA("qita", "H5","其他"),
XCXSHOUSHU("xcxshoushu", "UNI","手术单照片"),
XCXIDCARD("xcxidcard", "UNI","手持身份证照片"),
XCXINFORM("xcxinform", "UNI","告知书照片"),
XCXWARRANT("xcxwarrant", "UNI","担保函照片"),
XCXBANCARD("xcxbancard", "UNI","银行卡照片"),
XCXQITA("xcxqita", "UNI","其他"),
;
AttachTypeEnum(String code,String type, String message) {
this.code = code;
this.type = type;
this.message = message;
}
public static AttachTypeEnum getEnum(String code) {
for (AttachTypeEnum loanEnum : AttachTypeEnum.values()) {
if (StringUtils.equals(loanEnum.getCode(), code)) {
return loanEnum;
}
}
return null;
}
public static List<AttachTypeEnum> getEnumListByType(String type) {
List<AttachTypeEnum> list = new ArrayList<>();
for (AttachTypeEnum loanEnum : AttachTypeEnum.values()) {
if (StringUtils.equals(loanEnum.getType(), type)) {
list.add(loanEnum);
}
}
return list;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
private String code;
private String type;
private String message;
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
}
package com.jqtx.windows.infrastructure.enums;
public enum BankCodeEnum {
CCB("CCB", "建设银行", "#3875DF"),
ICBC("ICBC", "工商银行", "#38BFB5"),
PINAGAN("PINAGAN", "平安银行", "#E85279"),
ABC("ABC", "农业银行", "#795AB4"),
CMB("CMB", "招商银行", "#FBB849"),
PSBC("PSBC", "邮储银行", "#3C91EF"),
CMBC("CMBC", "民生银行", "#37C2A1"),
CEB("CEB", "光大银行", "#E55B65"),
CITIC("CITIC", "中信银行", "#8962D5"),
CIB("CIB", "兴业银行", "#FBA349"),
SPDB("SPDB", "浦发银行", "#567FC7"),
BOC("BOC", "中国银行", "#FE6B74"),
COMM("COMM", "交通银行", "#1BA7B4"),
GDB("GDB", "广发银行", "#7E58D6"),
HXB("HXB", "华夏银行", "#FC9546"),
BJB("BJB", "北京银行", "#F5545E"),
SHB("SHB", "上海银行", "#4079DD"),
;
/**
* 枚举编号
*/
private String code;
/**
* 枚举详情
*/
private String message;
/**
* 色块
*/
private String color;
/**
* @param code
* @param message
*/
private BankCodeEnum(String code, String message, String color) {
this.message = message;
this.code = code;
this.color = color;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
public String getColor() {
return color;
}
public void setColor(String color) {
this.color = color;
}
}
package com.jqtx.windows.infrastructure.enums;
/**
* @Author: yexiaodong
* @Date:2018/9/30 11:15
*/
public enum CancelTypeEnum {
BLACK_REFUSE("BLACK_REFUSE", "黑名单拒绝"),
MACHINE_REFUSE("MACHINE_REFUSE", "机审拒绝"),
;
/**
* 枚举编号
*/
private String code;
/**
* 枚举详情
*/
private String message;
/**
* @param code
* @param message
*/
CancelTypeEnum(String code, String message) {
this.message = message;
this.code = code;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
}
package com.jqtx.windows.infrastructure.enums;
public enum CapitalEnum {
OWNBUSINESS("OWNBUSINESS", 0, "自营"),
QINJIABUSINESS("QINJIABUSINESS", 1, "亲家"),
LVXINBUSINESS("LVXINBUSINESS", 2, "绿信"),
WHLVXINBUSINESS("WHLVXINBUSINESS", 3, "绿信乌鲁木齐"),
FENGSHENGBUSINESS("FENGSHENGBUSINESS", 4, "丰盛"),
;
private CapitalEnum(String code, int value, String message) {
this.code = code;
this.value = value;
this.message = message;
}
public static CapitalEnum getByCode(String code) {
for (CapitalEnum e : CapitalEnum.values()) {
if (e.getCode().equals(code)) {
return e;
}
}
return null;
}
public static CapitalEnum getByValue(int value) {
for (CapitalEnum e : CapitalEnum.values()) {
if (e.getValue() == value) {
return e;
}
}
return null;
}
private String code;
private int value;
private String message;
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public int getValue() {
return value;
}
public void setValue(int value) {
this.value = value;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
}
package com.jqtx.windows.infrastructure.enums;
public enum CommonEnum {
NO(0,"否"),
YES(1,"是");
private int code;
private String message;
private CommonEnum(int code, String message) {
this.code = code;
this.message = message;
}
public static CommonEnum getCommonEnumByCode(int code) {
for (CommonEnum e : CommonEnum.values()) {
if (code == e.getCode()) {
return e;
}
}
return null;
}
public int getCode() {
return code;
}
public String getMessage() {
return message;
}
}
/**
* yingyinglicai.com Inc.
* Copyright (c) 2013-2018 All Rights Reserved.
*/
package com.jqtx.windows.infrastructure.enums;
import com.jqtx.windows.domain.model.KeyValueModel;
import java.util.ArrayList;
import java.util.List;
/**
* 公司所属行业
*
* @author jianbin.guo
* @version $Id: CompanyIndustryEnum.java, v 0.1 2018年4月16日 下午9:02:16 jianbin.guo Exp $
*/
public enum CompanyIndustryEnum {
ZYZY(-1, "ZYZY", "自由职业", "自由职业"),
JGSY(0, "JGSY", "机关事业", "公共管理、社会保障和社会组织"),
NLMY(1, "NLMY", "农林牧渔", "农、林、牧、渔业"),
JTYS(2, "JTYS", "交通运输", "交通运输、仓储和邮政业"),
CYLY(3, "CYLY", "餐饮旅游", "住宿和餐饮业"),
JZGC(4, "JZGC", "建筑工程", "建筑业"),
XWGG(5, "XWGG", "新闻广告", "文化、体育和娱乐业"),
YLFY(6, "YLFY", "医疗防疫", "卫生和社会工作"),
JYWY(7, "JYWY", "教育文员", "教育"),
JRLC(8, "JRLC", "金融理财", "金融业"),
JZGL(9, "JZGL", "家政管理", "租赁和商务服务业"),
ZARY(10, "ZARY", "治安人员", "租赁和商务服务业"),
TYYD(11, "TYYD", "体育运动", "文化、体育和娱乐业"),
TXHY(12, "TXHY", "通信行业", "信息传输、软件和信息技术服务业"),
KYCS(13, "KYCS", "矿业采石", "采矿业"),
ZZHY(14, "ZZHY", "制造行业", "制造业"),
GGSY(15, "GGSY", "公共事业", "公共管理、社会保障和社会组织"),
YLHY(16, "YLHY", "娱乐行业", "文化、体育和娱乐业"),
GTGS(17, "GTGS", "个体工商", "批发和零售业"),
FDCY(18, "FDCY", "房地产业", "房地产业"),
SCGY(19, "SCGY", "生产供应", "电力、热力、燃气及水生产和供应业"),
KYJS(20, "KYJS", "科研技术", "科学研究和技术服务业"),
GGGL(21, "GGGL", "公共管理", "水利、环境和公共设施管理业"),
JMFW(22, "JMFW", "居民服务", "居民服务、修理和其他服务业"),
GJZZ(23, "GJZZ", "国际组织", "国际组织"),
QT(24, "QT", "其他", "其他");;
private int index;
/**
* 枚举编号
*/
private String code;
/**
* app枚举详情
*/
private String message;
/**
* 行业描述
*/
private String desc;
/**
* @param code
* @param message
*/
private CompanyIndustryEnum(int index, String code, String message, String desc) {
this.index = index;
this.message = message;
this.code = code;
this.desc = desc;
}
public static CompanyIndustryEnum getByName(String name){
for (CompanyIndustryEnum marriagEnum:CompanyIndustryEnum.values()){
if(marriagEnum.name().equals(name)){
return marriagEnum;
}
}
return null;
}
public static List getAllToMap() {
List<KeyValueModel> list = new ArrayList<>();
for (CompanyIndustryEnum alarmType : values()) {
KeyValueModel keyValueModel = new KeyValueModel();
keyValueModel.setKey(alarmType.getMessage());
keyValueModel.setValue(alarmType.name());
list.add(keyValueModel);
}
return list;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
public String getDesc() {
return desc;
}
public void setDesc(String desc) {
this.desc = desc;
}
public int getIndex() {
return index;
}
public void setIndex(int index) {
this.index = index;
}
}
package com.jqtx.windows.infrastructure.enums;
import org.apache.commons.lang3.StringUtils;
public enum CreditDetailStatusEnum {
CREATED("CREATED", "创建中"),
CREDIT_ING("CREDIT_ING", "审核中"),
FINISHED("FINISHED", "完成"),
;
/**
* 枚举编号
*/
private String code;
/**
* 枚举详情
*/
private String message;
/**
* @param code
* @param message
*/
CreditDetailStatusEnum(String code, String message) {
this.message = message;
this.code = code;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
public String getCode() {
return code;
}
public static CreditDetailStatusEnum getEnum(String code) {
for (CreditDetailStatusEnum loanEnum : CreditDetailStatusEnum.values()) {
if (StringUtils.equals(loanEnum.getCode(), code)) {
return loanEnum;
}
}
return null;
}
public void setCode(String code) {
this.code = code;
}
}
package com.jqtx.windows.infrastructure.enums;
import org.apache.commons.lang3.StringUtils;
/**
* @Author: yexiaodong
* @Date:2018/9/30 11:15
*/
public enum CreditDetailStatusResultEnum {
PASS("PASS", "通过"),
BACK("BACK", "退回"),
REJECT("REJECT", "拒绝"),
RETRIAL("RETRIAL", "复议"),
;
/**
* 枚举编号
*/
private String code;
/**
* 枚举详情
*/
private String message;
/**
* @param code
* @param message
*/
CreditDetailStatusResultEnum(String code, String message) {
this.message = message;
this.code = code;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
public String getCode() {
return code;
}
public static CreditDetailStatusResultEnum getEnum(String code) {
for (CreditDetailStatusResultEnum loanEnum : CreditDetailStatusResultEnum.values()) {
if (StringUtils.equals(loanEnum.getCode(), code)) {
return loanEnum;
}
}
return null;
}
public static String creditResult(String code){
if("YES".equalsIgnoreCase(code)){
return PASS.code;
}else if ("NO".equalsIgnoreCase(code)){
return REJECT.code;
}else{
return RETRIAL.code;
}
}
public void setCode(String code) {
this.code = code;
}
}
package com.jqtx.windows.infrastructure.enums;
/**
* @Author: yexiaodong
* @Date:2018/9/30 11:15
*/
public enum CreditStatusEnum {
CREDIT_ING(1, "审核中"),
CREDIT_PASS(2, "授信通过"),
CREDIT_REFUSE(3, "授信拒绝"),
;
/**
* 枚举编号
*/
private int code;
/**
* 枚举详情
*/
private String message;
/**
* @param code
* @param message
*/
CreditStatusEnum(int code, String message) {
this.message = message;
this.code = code;
}
public int getCode() {
return code;
}
public void setCode(int code) {
this.code = code;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
}
package com.jqtx.windows.infrastructure.enums;
/**
* @Author: yexiaodong
* @Date:2018/9/30 11:15
*/
public enum CreditTypeEnum {
ADD_CREDIT("ADD_CREDIT", "提额授信"),
NORMAL_CREDIT("NORMAL_CREDIT", "正常授信"),
;
/**
* 枚举编号
*/
private String code;
/**
* 枚举详情
*/
private String message;
/**
* @param code
* @param message
*/
CreditTypeEnum(String code, String message) {
this.message = message;
this.code = code;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
}
package com.jqtx.windows.infrastructure.enums;
import org.apache.commons.lang3.StringUtils;
public enum CriusLoanStatusEnum {
INIT("INIT", "初始化"),
SUCCESS("SUCCESS", "放款成功"),
CANCEL("CANCEL", "已取消"),
;
/**
* 枚举编号
*/
private String code;
/**
* 枚举详情
*/
private String message;
/**
* @param code
* @param message
*/
private CriusLoanStatusEnum(String code, String message) {
this.message = message;
this.code = code;
}
public static String getMessage(String code) {
for (CriusLoanStatusEnum loanEnum : CriusLoanStatusEnum.values()) {
if (StringUtils.equals(loanEnum.getCode(), code)) {
return loanEnum.getMessage();
}
}
return null;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
}
package com.jqtx.windows.infrastructure.enums;
import com.jqtx.windows.domain.model.KeyValueModel;
import java.util.ArrayList;
import java.util.List;
/**
* @Description:
* @Author: HuangHaodong
* @Date: 2019/11/14 16:24
*/
public enum EducationEnum {
MASTER_DOCTOR("11", "博士"),
MASTER_ABOVE("14", "硕士"),
UNIVERSITY("20", "本科"),
COLLEGE("30", "专科"),
MIDDLE_SCHOOL("40", "中职"),
OTHER("90", "其他");
private String code;
private String message;
/**
* @param code
* @param message
*/
private EducationEnum(String code, String message) {
this.code = code;
this.message = message;
}
public static EducationEnum getByName(String name){
for (EducationEnum marriagEnum:EducationEnum.values()){
if(marriagEnum.name().equals(name)){
return marriagEnum;
}
}
return null;
}
public static List getAllToMap() {
List<KeyValueModel> list = new ArrayList<>();
for (EducationEnum alarmType : values()) {
KeyValueModel keyValueModel = new KeyValueModel();
keyValueModel.setKey(alarmType.getMessage());
keyValueModel.setValue(alarmType.name());
list.add(keyValueModel);
}
return list;
}
/**
* Getter method for property <tt>code</tt>.
*
* @return property value of code
*/
public String getCode() {
return code;
}
/**
* Setter method for property <tt>code</tt>.
*
* @param code value to be assigned to property code
*/
public void setCode(String code) {
this.code = code;
}
/**
* Getter method for property <tt>message</tt>.
*
* @return property value of message
*/
public String getMessage() {
return message;
}
/**
* Setter method for property <tt>message</tt>.
*
* @param message value to be assigned to property message
*/
public void setMessage(String message) {
this.message = message;
}
}
package com.jqtx.windows.infrastructure.enums;
public enum HomeStateEnum {
state_01(-1,"立即申请","立即申请"),
state_0(0,"预授信","预授信"),
state_1(1,"去授信","去授信"),
state_2(2,"去别家看看","去别家看看"),
state_3(3,"授信审核中","授信审核中"),
state_4(4,"立即提现","立即提现"),
state_5(5,"去还款","去还款"),
state_6(6,"放款审核中","放款审核中");
private Integer code;
private String state;
private String des;
HomeStateEnum(Integer code, String state, String des) {
this.code = code;
this.state = state;
this.des = des;
}
public Integer getCode() {
return code;
}
public void setCode(Integer code) {
this.code = code;
}
public String getState() {
return state;
}
public void setState(String state) {
this.state = state;
}
public String getDes() {
return des;
}
public void setDes(String des) {
this.des = des;
}
public static String getDes(Integer code) {
for (HomeStateEnum loanEnum : HomeStateEnum.values()) {
if (loanEnum.getCode().intValue()==code.intValue()) {
return loanEnum.getDes();
}
}
return null;
}
public static String getState(Integer code) {
for (HomeStateEnum loanEnum : HomeStateEnum.values()) {
if (loanEnum.getCode().intValue()==code.intValue()) {
return loanEnum.getState();
}
}
return null;
}
}
package com.jqtx.windows.infrastructure.enums;
import com.jqtx.windows.domain.model.KeyValueModel;
import java.util.ArrayList;
import java.util.List;
/**
* @Description:
* @Author: HuangHaodong
* @Date: 2019/11/14 16:23
*/
public enum IncomeStatusEnum {
THREE_FIVE("5000", "3000 ~ 5000"),
FIVE_EIGHT("8000", "5000 ~ 8000"),
EIGHT_TWELVE("12000", "8000 ~ 12000"),
TWELVE_FIFTEEN("15000", "12000 ~ 15000"),
FIFTEEN_PLUS("20000", "15000 以上"),
;
private String code;
private String message;
/**
* @param code
* @param message
*/
private IncomeStatusEnum(String code, String message) {
this.code = code;
this.message = message;
}
public static List getAllToMap() {
List<KeyValueModel> list = new ArrayList<>();
for (IncomeStatusEnum alarmType : values()) {
KeyValueModel keyValueModel = new KeyValueModel();
keyValueModel.setKey(alarmType.getMessage());
keyValueModel.setValue(alarmType.name());
list.add(keyValueModel);
}
return list;
}
public static IncomeStatusEnum getByName(String name){
for (IncomeStatusEnum marriagEnum:IncomeStatusEnum.values()){
if(marriagEnum.name().equals(name)){
return marriagEnum;
}
}
return null;
}
/**
* Getter method for property <tt>code</tt>.
*
* @return property value of code
*/
public String getCode() {
return code;
}
/**
* Setter method for property <tt>code</tt>.
*
* @param code value to be assigned to property code
*/
public void setCode(String code) {
this.code = code;
}
/**
* Getter method for property <tt>message</tt>.
*
* @return property value of message
*/
public String getMessage() {
return message;
}
/**
* Setter method for property <tt>message</tt>.
*
* @param message value to be assigned to property message
*/
public void setMessage(String message) {
this.message = message;
}
}
package com.jqtx.windows.infrastructure.enums;
import com.jqtx.windows.domain.model.KeyValueModel;
import java.util.ArrayList;
import java.util.List;
/**
* @program: baoyouhua
* @description:
* @author: zq
* @create: 2020-07-22 14:25
**/
public enum LinkerRelateTypeEnum {
PARENTS("PARENTS", "父母", "FAMILY"),
SPOUSE("SPOUSE", "配偶", "FAMILY"),
CHILDREN("CHILDREN", "子女", "FAMILY"),
RELATIVE("RELATIVE", "亲属", "FAMILY"),
WORKMATE("WORKMATE", "同事", "WORK"),
FRIEND("FRIEND", "朋友", "OTHER"),
OTHER("OTHER", "其他", "OTHER");
private String code;
private String message;
private String type;
private LinkerRelateTypeEnum(String code, String message, String type) {
this.code = code;
this.message = message;
this.type = type;
}
public static LinkerRelateTypeEnum getByName(String name){
for (LinkerRelateTypeEnum marriagEnum:LinkerRelateTypeEnum.values()){
if(marriagEnum.name().equals(name)){
return marriagEnum;
}
}
return null;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public static List getAllToMap() {
List<KeyValueModel> list = new ArrayList<>();
for (LinkerRelateTypeEnum alarmType : values()) {
KeyValueModel keyValueModel = new KeyValueModel();
keyValueModel.setKey(alarmType.getMessage());
keyValueModel.setValue(alarmType.name());
list.add(keyValueModel);
}
return list;
}
}
package com.jqtx.windows.infrastructure.enums;
import org.apache.commons.lang3.StringUtils;
public enum LoanEnum {
INIT("INIT", "初始化"),
CANCEL("CANCEL", "取消"),
SUCCESS("SUCCESS", "成功");
LoanEnum(String code, String message) {
this.code = code;
this.message = message;
}
public static LoanEnum getEnum(String code) {
for (LoanEnum loanEnum : LoanEnum.values()) {
if (StringUtils.equals(loanEnum.getCode(), code)) {
return loanEnum;
}
}
return null;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
private String code;
private String message;
}
package com.jqtx.windows.infrastructure.enums;
/**
* @program: baoyouhua
* @description:
* @author: zq
* @create: 2022-06-07 16:02
**/
public enum LoanSignCodeEnum {
OWNDR("OWNBUSINESS", "DR", "自营-鼎荣"),
FENGSHENGDR("FENGSHENGBUSINESS", "ZY", "丰盛-中盈"),
FENGSHENGYX("OWNBUSINESS", "XY", "自营-鑫益保理");
private String capitalCode;
private String loanSign;
private String message;
LoanSignCodeEnum(String capitalCode, String loanSign, String message) {
this.capitalCode = capitalCode;
this.loanSign = loanSign;
this.message = message;
}
public static LoanSignCodeEnum getEnum(String capitalCode, String loanSign) {
LoanSignCodeEnum[] values = LoanSignCodeEnum.values();
for (LoanSignCodeEnum value : values) {
if (value.getCapitalCode().equals(capitalCode) && value.getLoanSign().equals(loanSign)) {
return value;
}
}
return LoanSignCodeEnum.OWNDR;
}
public String getCapitalCode() {
return capitalCode;
}
public void setCapitalCode(String capitalCode) {
this.capitalCode = capitalCode;
}
public String getLoanSign() {
return loanSign;
}
public void setLoanSign(String loanSign) {
this.loanSign = loanSign;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
}
package com.jqtx.windows.infrastructure.enums;
import com.jqtx.windows.domain.model.KeyValueModel;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
/**
* @program: baoyouhua
* @description:
* @author: zq
* @create: 2022-05-24 14:34
**/
public enum MarriagEnum {
UNMARRIED("10", "未婚"),
MARRIED("20", "已婚"),
WIDOWER("30", "丧偶"),
DIVORCE("40", "离婚"),
HAVECHILDREN("99", "已婚有子"),
OTHER("99", "其他"),
;
private String code;
private String message;
MarriagEnum(String code, String message) {
this.code = code;
this.message = message;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
/**
* 获得所有枚举类型到map
*
* @return
*/
public static List getAllToMap() {
List<KeyValueModel> list = new ArrayList<>();
Arrays.asList(MarriagEnum.values()).forEach(marriagEnum -> list.add(new KeyValueModel(marriagEnum.getMessage(), marriagEnum.name())));
return list;
}
public static MarriagEnum getByName(String name){
for (MarriagEnum marriagEnum:MarriagEnum.values()){
if(marriagEnum.name().equals(name)){
return marriagEnum;
}
}
return null;
}
}
package com.jqtx.windows.infrastructure.enums;
import org.apache.commons.lang3.StringUtils;
/**
* @Author: yexiaodong
* @Date:2018/9/30 11:15
*/
public enum PreCreditStatusEnum {
PRE_CREDIT_ING(1, "预授信中"),
PRE_CREDIT_PASS(2, "预授信通过"),
PRE_CREDIT_REFUSE(3, "预授信拒绝"),
;
private int code;
private String message;
public static PreCreditStatusEnum getEnum(String code) {
for (PreCreditStatusEnum loanEnum : PreCreditStatusEnum.values()) {
if (StringUtils.equals(loanEnum.name(), code)) {
return loanEnum;
}
}
return null;
}
PreCreditStatusEnum(int code, String message) {
this.message = message;
this.code = code;
}
public int getCode() {
return code;
}
public void setCode(int code) {
this.code = code;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
}
package com.jqtx.windows.infrastructure.enums;
/*
* @ClassName ProcessEnum
* @Author liuzicheng
* @Description //TODO
* @Date 2022/6/30 14:40
*/
public enum ProcessEnum {
LIVE(1,"活体认证"),
LOAN(2,"意向单"),
BASE(3,"基础信息"),
ATTACH(4,"附件资料");
private int code;
private String message;
private ProcessEnum(int code, String message) {
this.code = code;
this.message = message;
}
public static ProcessEnum getEnumByCode(int code) {
for (ProcessEnum e : ProcessEnum.values()) {
if (code == e.getCode()) {
return e;
}
}
return null;
}
public int getCode() {
return code;
}
public String getMessage() {
return message;
}
}
package com.jqtx.windows.infrastructure.enums;
public enum ProcessStateEnum {
FINISH(1,"已完成"),
INIT(0,"未完成"),
NEED(-1,"待更新");
private int code;
private String message;
private ProcessStateEnum(int code, String message) {
this.code = code;
this.message = message;
}
public static ProcessStateEnum getEnumByCode(int code) {
for (ProcessStateEnum e : ProcessStateEnum.values()) {
if (code == e.getCode()) {
return e;
}
}
return null;
}
public int getCode() {
return code;
}
public String getMessage() {
return message;
}
}
......@@ -2,6 +2,7 @@ package com.jqtx.windows.infrastructure.feign;
import com.jqtx.windows.infrastructure.feign.hytric.IClientFeignServiceHystric;
import com.jqtx.windows.infrastructure.feign.model.client.ClientFeignModel;
import com.jqtx.windows.web.response.JsonResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
......
......@@ -2,7 +2,7 @@ package com.jqtx.windows.infrastructure.feign.hytric;
import com.jqtx.windows.infrastructure.enums.ExceptionCodeEnum;
import com.jqtx.windows.infrastructure.feign.IClientFeignService;
import com.jqtx.windows.infrastructure.feign.model.*;
import com.jqtx.windows.infrastructure.feign.model.client.ClientFeignModel;
import com.jqtx.windows.web.response.JsonResult;
import org.springframework.stereotype.Component;
......
package com.jqtx.windows.infrastructure.feign.hytric;
import com.jqtx.windows.infrastructure.enums.ExceptionCodeEnum;
import com.jqtx.windows.infrastructure.feign.IWakandaFeignService;
import com.jqtx.windows.infrastructure.feign.model.wakanda.ClientInfoModel;
import com.jqtx.windows.web.response.JsonResult;
......
package com.jqtx.windows.infrastructure.feign.model.client;
import lombok.Data;
/**
* @program: asgard
* @description:
* @author: zq
* @create: 2020-03-20 10:36
**/
@Data
public class ClientFeignModel {
private String idCardNumber;
private String realName;
public ClientFeignModel(String idCardNumber, String realName) {
this.idCardNumber = idCardNumber;
this.realName = realName;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment