|
|
@ -72,6 +72,7 @@ import java.io.*; |
|
|
|
import java.net.HttpURLConnection; |
|
|
|
import java.net.URL; |
|
|
|
import java.net.URLEncoder; |
|
|
|
import java.text.NumberFormat; |
|
|
|
import java.util.*; |
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
@ -366,7 +367,7 @@ public class FinPaymentrecordService extends MybatisBaseService<FinPaymentrecord |
|
|
|
FinPaymentrecordSourceLCVo finPaymentrecordSourceLCVo = new FinPaymentrecordSourceLCVo(); |
|
|
|
finPaymentrecordSourceLCVo.setName(flowTask.getTaskUserInfos().get(0).getAssigneeName()); |
|
|
|
finPaymentrecordSourceLCVo.setComment(flowTask.getComment().getComment()); |
|
|
|
finPaymentrecordSourceLCVo.setSpsj(DateUtil.format(flowTask.getFinishTime(),"yyyy-MM-dd")); |
|
|
|
finPaymentrecordSourceLCVo.setSpsj(DateUtil.format(flowTask.getFinishTime(), "yyyy-MM-dd")); |
|
|
|
finPaymentrecordSourceLCVos.add(finPaymentrecordSourceLCVo); |
|
|
|
} |
|
|
|
dataMap.put("lcList", finPaymentrecordSourceLCVos); |
|
|
@ -385,19 +386,22 @@ public class FinPaymentrecordService extends MybatisBaseService<FinPaymentrecord |
|
|
|
FinPaymentrecordSourceLCVo finPaymentrecordSourceLCVo = new FinPaymentrecordSourceLCVo(); |
|
|
|
finPaymentrecordSourceLCVo.setName(flowTask.getTaskUserInfos().get(0).getAssigneeName()); |
|
|
|
finPaymentrecordSourceLCVo.setComment(flowTask.getComment().getComment()); |
|
|
|
finPaymentrecordSourceLCVo.setSpsj(DateUtil.format(flowTask.getFinishTime(),"yyyy-MM-dd")); |
|
|
|
finPaymentrecordSourceLCVo.setSpsj(DateUtil.format(flowTask.getFinishTime(), "yyyy-MM-dd")); |
|
|
|
finPaymentrecordSourceLCVos.add(finPaymentrecordSourceLCVo); |
|
|
|
} |
|
|
|
dataMap.put("lcList", finPaymentrecordSourceLCVos); |
|
|
|
} |
|
|
|
dataMap.put("createTime", DateUtil.format(finPaymentrecord.getCreateTime(),"yyyy-MM-dd")); |
|
|
|
dataMap.put("createTime", DateUtil.format(finPaymentrecord.getCreateTime(), "yyyy-MM-dd")); |
|
|
|
dataMap.put("createByName", createByName); |
|
|
|
dataMap.put("createByDeptName", deptName); |
|
|
|
dataMap.put("createOrgName", createOrgName); |
|
|
|
dataMap.put("remarks", finPaymentrecord.getRemarks()); |
|
|
|
dataMap.put("receiveCompany", finPaymentrecord.getReceiveCompany()); |
|
|
|
dataMap.put("receiveBank", finPaymentrecord.getReceiveBank()); |
|
|
|
dataMap.put("receiveBankAccount", finPaymentrecord.getReceiveBankAccount()); |
|
|
|
dataMap.put("cost", finPaymentrecord.getCost()); |
|
|
|
Double aDouble = Double.valueOf(finPaymentrecord.getCost()); |
|
|
|
String s = upperCase2(aDouble); |
|
|
|
dataMap.put("cost", finPaymentrecord.getCost() + " " + "(" + s + ")"); |
|
|
|
dataMap.put("payRemark", finPaymentrecord.getPayRemark()); |
|
|
|
//获取图片路径
|
|
|
|
// String photoPath = "file://D:/anrui/upload/20211227/kbjl_20211227143750186948.jpg";
|
|
|
@ -505,4 +509,103 @@ public class FinPaymentrecordService extends MybatisBaseService<FinPaymentrecord |
|
|
|
} |
|
|
|
return imgUrl; |
|
|
|
} |
|
|
|
|
|
|
|
public static String upperCase2(double money) { |
|
|
|
String[] upNum = {"零", "壹", "贰", "叁", "肆", "伍", "陆", "柒", "捌", "玖"}; |
|
|
|
String[] danwei = {"圆", "拾", "佰", "仟", "万", "拾", "佰", "仟", "亿", "拾", "佰", "仟"}; |
|
|
|
//取消科学记数法
|
|
|
|
NumberFormat numFormat = NumberFormat.getInstance(); |
|
|
|
numFormat.setMaximumFractionDigits(2);//设置小数位个数
|
|
|
|
numFormat.setGroupingUsed(false);//取消科学技术发
|
|
|
|
String formatNum = numFormat.format(money); |
|
|
|
String strmoney = formatNum + "";//浮点型转为字符型
|
|
|
|
String lastUpNum = "null"; //用于存放上个参数的值
|
|
|
|
String result = "";//返回的结果
|
|
|
|
String[] split = strmoney.split("\\."); |
|
|
|
String strMoney = split[0]; |
|
|
|
String point = ""; |
|
|
|
//小数部分取值处理。
|
|
|
|
if (split.length > 1) { |
|
|
|
point = split[1]; |
|
|
|
if (point.length() == 1) { |
|
|
|
point = point.concat("0"); |
|
|
|
} |
|
|
|
} else { |
|
|
|
point = "0"; |
|
|
|
} |
|
|
|
//大于12位就直接返回。
|
|
|
|
int moneyLen = strMoney.length(); |
|
|
|
if (money == 0) { |
|
|
|
return "零圆整"; |
|
|
|
} |
|
|
|
if (moneyLen > 12) { |
|
|
|
return "金额:" + money + "元,超出大写转换范围。最大金额:999999999999.99元"; |
|
|
|
} |
|
|
|
//整数(integer)部分处理。
|
|
|
|
if (!"0".equals(strMoney)) { |
|
|
|
for (int i = 0; i < moneyLen; i++) { |
|
|
|
String strNum = strMoney.charAt(i) + ""; |
|
|
|
int singleNum = Integer.parseInt(strNum); |
|
|
|
String upSingleNum = upNum[singleNum]; |
|
|
|
//上一为不等于0的情况
|
|
|
|
if (!"零".equals(lastUpNum)) { |
|
|
|
if (!"零".equals(upSingleNum)) { |
|
|
|
result = result.concat(upSingleNum).concat(danwei[moneyLen - i - 1]); |
|
|
|
} else |
|
|
|
//为零但是在万、亿位上要加单位 (moneyLen-i)==9 指的是单位:亿。 (moneyLen-i)==5指的是单位:万
|
|
|
|
if ((moneyLen - i) == 5 || (moneyLen - i) == 9) { |
|
|
|
lastUpNum = ""; |
|
|
|
} else { |
|
|
|
result = result.concat(upSingleNum); |
|
|
|
} |
|
|
|
} |
|
|
|
//上一位为0的情况
|
|
|
|
if ("零".equals(lastUpNum) && !"零".equals(upSingleNum)) { |
|
|
|
result = result.concat(upSingleNum).concat(danwei[moneyLen - i - 1]); |
|
|
|
} |
|
|
|
//捕捉上一位数(lastUpNum)为零的情况做优化。
|
|
|
|
if ((moneyLen - i) == 5 || (moneyLen - i) == 9) { |
|
|
|
//排除加单位时前面为"零"的情况。如:两百零万
|
|
|
|
if ("零".equals(lastUpNum) || "null".equals(lastUpNum)) { |
|
|
|
result = result.substring(0, result.length() - 1); |
|
|
|
} |
|
|
|
if (!result.endsWith("亿")) { |
|
|
|
result = result.concat(danwei[moneyLen - i - 1]); |
|
|
|
} |
|
|
|
lastUpNum = ""; |
|
|
|
} else { |
|
|
|
//把当前大写数字复制给 lastUpNum 用于下次判断
|
|
|
|
lastUpNum = upSingleNum; |
|
|
|
} |
|
|
|
} |
|
|
|
//对几万元整和几亿元整(result:五万零或者五亿零零)做优化。
|
|
|
|
result = result.replaceAll("零零", "零"); |
|
|
|
if (result.endsWith("零")) { |
|
|
|
String substring = result.substring(0, result.length() - 1); |
|
|
|
result = substring; |
|
|
|
} |
|
|
|
result = result.concat("圆"); |
|
|
|
result = result.replaceAll("圆圆", "圆"); |
|
|
|
result = result.replaceAll("万万", "万"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
//小数(point)部分处理
|
|
|
|
if ("0".equals(point)) { |
|
|
|
result = result + "整"; |
|
|
|
} else { |
|
|
|
//去 整
|
|
|
|
// if(result.endsWith("整")){
|
|
|
|
// result = result.substring(0,result.length()-1);
|
|
|
|
// }
|
|
|
|
if ((point.charAt(0) + "").equals("0")) { |
|
|
|
result = result.concat(upNum[Integer.parseInt(point.charAt(1) + "")] + "分"); |
|
|
|
} else if ((point.charAt(1) + "").equals("0")) { |
|
|
|
result = result.concat(upNum[Integer.parseInt(point.charAt(0) + "")] + "角"); |
|
|
|
} else { |
|
|
|
result = result.concat(upNum[Integer.parseInt(point.charAt(0) + "")] + "角").concat(upNum[Integer.parseInt(point.charAt(1) + "")] + "分"); |
|
|
|
} |
|
|
|
} |
|
|
|
return result; |
|
|
|
} |
|
|
|
} |