commit
05443256b7
38 changed files with 529 additions and 60 deletions
@ -0,0 +1,30 @@ |
||||
package com.daqing.financial.guarantee.model.request; |
||||
|
||||
import io.swagger.annotations.ApiModelProperty; |
||||
import lombok.Data; |
||||
import lombok.ToString; |
||||
|
||||
import java.io.Serializable; |
||||
|
||||
/** |
||||
* 合规调查调查和审核请求参数 |
||||
* |
||||
* @auther River |
||||
* @date 2020/12/2 14:21 |
||||
*/ |
||||
@Data |
||||
@ToString |
||||
public class DgComplianceInvestigationCheckRequest implements Serializable { |
||||
|
||||
@ApiModelProperty("iid") |
||||
private Integer iid; |
||||
|
||||
@ApiModelProperty("调查/审核操作,1:同意,2:驳回,3:拒绝") |
||||
private Integer status; |
||||
|
||||
@ApiModelProperty("附件,审核没有") |
||||
private String[] fileUrls; |
||||
|
||||
@ApiModelProperty("调查/审核意见") |
||||
private String opinion; |
||||
} |
@ -0,0 +1,54 @@ |
||||
package com.daqing.financial.guarantee.model.request; |
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat; |
||||
import io.swagger.annotations.ApiModelProperty; |
||||
import lombok.Data; |
||||
import lombok.ToString; |
||||
|
||||
import javax.validation.constraints.NotNull; |
||||
import java.io.Serializable; |
||||
import java.util.Date; |
||||
|
||||
/** |
||||
* @auther River |
||||
* @date 2020/12/2 17:27 |
||||
*/ |
||||
@Data |
||||
@ToString |
||||
public class DgLoanCommitteeConsiderConsent implements Serializable { |
||||
|
||||
@NotNull(message = "id不能为空") |
||||
@ApiModelProperty("id") |
||||
private Integer id; |
||||
|
||||
@ApiModelProperty("议定事项") |
||||
private String agreedItems; |
||||
|
||||
@ApiModelProperty("附加事项") |
||||
private String additionalItems; |
||||
|
||||
@ApiModelProperty("贷款金额") |
||||
private Double loanMoney; |
||||
|
||||
@ApiModelProperty("贷款期限") |
||||
private String loanTern; |
||||
|
||||
@ApiModelProperty("同意") |
||||
private String agreePerson; |
||||
|
||||
@ApiModelProperty("不同意") |
||||
private String disagreePerson; |
||||
|
||||
@ApiModelProperty("附件") |
||||
private String fileUrl; |
||||
|
||||
@ApiModelProperty("操作,1:通过,2:拒绝,3:驳回") |
||||
private Integer status; |
||||
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
||||
@ApiModelProperty("贷审会通过时间") |
||||
private Date passingTime; |
||||
|
||||
@ApiModelProperty("拒绝/驳回意见") |
||||
private String refuseOpinion; |
||||
} |
@ -0,0 +1,65 @@ |
||||
package com.daqing.financial.guarantee.model.response; |
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat; |
||||
import io.swagger.annotations.ApiModelProperty; |
||||
import lombok.Data; |
||||
import lombok.ToString; |
||||
|
||||
import java.io.Serializable; |
||||
import java.util.Date; |
||||
|
||||
/** |
||||
* 贷审会查看响应类 |
||||
* |
||||
* @auther River |
||||
* @date 2020/12/2 17:34 |
||||
*/ |
||||
@Data |
||||
@ToString |
||||
public class DgLoanCommitteeConsiderInfoResponse implements Serializable { |
||||
/** |
||||
* 贷审会议定事项 |
||||
*/ |
||||
@ApiModelProperty("贷审会议定事项") |
||||
private String agreedItems; |
||||
|
||||
/** |
||||
* 贷审会附加事项 |
||||
*/ |
||||
@ApiModelProperty("贷审会附加事项") |
||||
private String additionalItems; |
||||
|
||||
/** |
||||
* 贷款金额(贷审会意见) |
||||
*/ |
||||
@ApiModelProperty("贷款金额(贷审会意见)") |
||||
private Integer loanMoney; |
||||
|
||||
/** |
||||
* 贷款期限(贷审会意见) |
||||
*/ |
||||
@ApiModelProperty("贷款期限(贷审会意见)") |
||||
private String loanTern; |
||||
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") |
||||
@ApiModelProperty("贷审会时间") |
||||
private Date time; |
||||
|
||||
/** |
||||
* 同意(贷审委员) |
||||
*/ |
||||
@ApiModelProperty("同意(贷审委员)") |
||||
private String agreePerson; |
||||
|
||||
/** |
||||
* 不同意(贷审委员) |
||||
*/ |
||||
@ApiModelProperty("不同意(贷审委员)") |
||||
private String disagreePerson; |
||||
|
||||
/** |
||||
* 附件(会议记录) |
||||
*/ |
||||
@ApiModelProperty("附件(会议记录)") |
||||
private String[] fileUrls; |
||||
} |
@ -0,0 +1,127 @@ |
||||
package com.daqing.framework.utils; |
||||
|
||||
import java.math.BigDecimal; |
||||
|
||||
/** |
||||
* @Author chen |
||||
* @DATE 2020/12/2 16:32 |
||||
* @Version 1.0 |
||||
*/ |
||||
public class NumberToCN { |
||||
/** |
||||
* 汉语中数字大写 |
||||
*/ |
||||
private static final String[] CN_UPPER_NUMBER = { "零", "壹", "贰", "叁", "肆", |
||||
"伍", "陆", "柒", "捌", "玖" }; |
||||
/** |
||||
* 汉语中货币单位大写,这样的设计类似于占位符 |
||||
*/ |
||||
private static final String[] CN_UPPER_MONETRAY_UNIT = { "分", "角", "元", |
||||
"拾", "佰", "仟", "万", "拾", "佰", "仟", "亿", "拾", "佰", "仟", "兆", "拾", |
||||
"佰", "仟" }; |
||||
/** |
||||
* 特殊字符:整 |
||||
*/ |
||||
private static final String CN_FULL = "整"; |
||||
/** |
||||
* 特殊字符:负 |
||||
*/ |
||||
private static final String CN_NEGATIVE = "负"; |
||||
/** |
||||
* 金额的精度,默认值为2 |
||||
*/ |
||||
private static final int MONEY_PRECISION = 2; |
||||
/** |
||||
* 特殊字符:零元整 |
||||
*/ |
||||
private static final String CN_ZEOR_FULL = "零元" + CN_FULL; |
||||
|
||||
/** |
||||
* 把输入的金额转换为汉语中人民币的大写 |
||||
* |
||||
* @param numberOfMoney |
||||
* 输入的金额 |
||||
* @return 对应的汉语大写 |
||||
*/ |
||||
public static String number2CNMontrayUnit(BigDecimal numberOfMoney) { |
||||
StringBuffer sb = new StringBuffer(); |
||||
// -1, 0, or 1 as the value of this BigDecimal is negative, zero, or
|
||||
// positive.
|
||||
int signum = numberOfMoney.signum(); |
||||
// 零元整的情况
|
||||
if (signum == 0) { |
||||
return CN_ZEOR_FULL; |
||||
} |
||||
// 这里会进行金额的四舍五入
|
||||
long number = numberOfMoney.movePointRight(MONEY_PRECISION) |
||||
.setScale(0, 4).abs().longValue(); |
||||
// 得到小数点后两位值
|
||||
long scale = number % 100; |
||||
int numUnit = 0; |
||||
int numIndex = 0; |
||||
boolean getZero = false; |
||||
// 判断最后两位数,一共有四中情况:00 = 0, 01 = 1, 10, 11
|
||||
if (!(scale > 0)) { |
||||
numIndex = 2; |
||||
number = number / 100; |
||||
getZero = true; |
||||
} |
||||
if ((scale > 0) && (!(scale % 10 > 0))) { |
||||
numIndex = 1; |
||||
number = number / 10; |
||||
getZero = true; |
||||
} |
||||
int zeroSize = 0; |
||||
while (true) { |
||||
if (number <= 0) { |
||||
break; |
||||
} |
||||
// 每次获取到最后一个数
|
||||
numUnit = (int) (number % 10); |
||||
if (numUnit > 0) { |
||||
if ((numIndex == 9) && (zeroSize >= 3)) { |
||||
sb.insert(0, CN_UPPER_MONETRAY_UNIT[6]); |
||||
} |
||||
if ((numIndex == 13) && (zeroSize >= 3)) { |
||||
sb.insert(0, CN_UPPER_MONETRAY_UNIT[10]); |
||||
} |
||||
sb.insert(0, CN_UPPER_MONETRAY_UNIT[numIndex]); |
||||
sb.insert(0, CN_UPPER_NUMBER[numUnit]); |
||||
getZero = false; |
||||
zeroSize = 0; |
||||
} else { |
||||
++zeroSize; |
||||
if (!(getZero)) { |
||||
sb.insert(0, CN_UPPER_NUMBER[numUnit]); |
||||
} |
||||
if (numIndex == 2) { |
||||
if (number > 0) { |
||||
sb.insert(0, CN_UPPER_MONETRAY_UNIT[numIndex]); |
||||
} |
||||
} else if (((numIndex - 2) % 4 == 0) && (number % 1000 > 0)) { |
||||
sb.insert(0, CN_UPPER_MONETRAY_UNIT[numIndex]); |
||||
} |
||||
getZero = true; |
||||
} |
||||
// 让number每次都去掉最后一个数
|
||||
number = number / 10; |
||||
++numIndex; |
||||
} |
||||
// 如果signum == -1,则说明输入的数字为负数,就在最前面追加特殊字符:负
|
||||
if (signum == -1) { |
||||
sb.insert(0, CN_NEGATIVE); |
||||
} |
||||
// 输入的数字小数点后两位为"00"的情况,则要在最后追加特殊字符:整
|
||||
if (!(scale > 0)) { |
||||
sb.append(CN_FULL); |
||||
} |
||||
return sb.toString(); |
||||
} |
||||
|
||||
public static void main(String[] args) { |
||||
double money = 10; |
||||
BigDecimal numberOfMoney = new BigDecimal(money); |
||||
String s = NumberToCN.number2CNMontrayUnit(numberOfMoney); |
||||
System.out.println("你输入的金额为:【" + money + "】 #--# [" + s.toString() + "]"); |
||||
} |
||||
} |
Loading…
Reference in new issue