Browse Source

收款凭证

LAPTOP-FO2T5SIU\35838 7 months ago
parent
commit
13bd939c45

+ 13 - 1
pro-base/src/main/java/com/idea/customerManagement/controller/IntentionalDepositController.java

@@ -2,6 +2,7 @@ package com.idea.customerManagement.controller;
 
 import com.github.pagehelper.PageInfo;
 import com.idea.customerManagement.dto.IntentionalDepositDto;
+import com.idea.customerManagement.dto.RoomSelectionInfoDto;
 import com.idea.customerManagement.model.IntentionalDeposit;
 import com.idea.customerManagement.service.IntentionalDepositService;
 import com.rockstar.common.base.BaseController;
@@ -12,10 +13,13 @@ import com.rockstar.frame.model.extend.Tablepar;
 import io.swagger.annotations.Api;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.ResponseBody;
 
+import javax.servlet.http.HttpServletResponse;
+
 @Controller
 @RequestMapping(value = "IntentionalDepositController")
 @Api(tags = "意向金管理")
@@ -129,7 +133,15 @@ public class IntentionalDepositController extends BaseController {
     }
 
 
-
+    /**
+     * 意向金收据下载
+     * @param model
+     * @param response
+     */
+    @GetMapping(value = "downLoadReceipt",produces = {"application/json;charset=UTF-8"})
+    public void downLoadReceipt(IntentionalDeposit model, HttpServletResponse response) {
+        modelService.downLoadReceipt(model,response);
+    }
 
 
 

+ 10 - 0
pro-base/src/main/java/com/idea/customerManagement/controller/RoomSelectionInfoController.java

@@ -108,6 +108,16 @@ public class RoomSelectionInfoController extends BaseController {
         modelService.downLoad(model,request,response);
     }
 
+    /**
+     * 定金收据下载
+     * @param model
+     * @param response
+     */
+    @GetMapping(value = "downLoadReceipt",produces = {"application/json;charset=UTF-8"})
+    public void downLoadReceipt(RoomSelectionInfoDto model, HttpServletResponse response) {
+        modelService.downLoadReceipt(model,response);
+    }
+
     @PostMapping(value = "list",produces = {"application/json;charset=UTF-8"})
     @ResponseBody
     public Object list(Tablepar tablepar, RoomSelectionInfoDto model, DateTrans dt){

+ 58 - 3
pro-base/src/main/java/com/idea/customerManagement/service/IntentionalDepositService.java

@@ -15,6 +15,7 @@ import com.idea.buildManage.model.ParkRoom;
 import com.idea.buildManage.response.ParkRoomResponse;
 import com.idea.customerManagement.dto.ContractManageDto;
 import com.idea.customerManagement.dto.IntentionalDepositDto;
+import com.idea.customerManagement.dto.RoomSelectionInfoDto;
 import com.idea.customerManagement.mapper.CustomerManagementMapper;
 import com.idea.customerManagement.mapper.IntentionalDepositExtendMapper;
 import com.idea.customerManagement.mapper.IntentionalDepositMapper;
@@ -25,21 +26,24 @@ import com.idea.invoice.model.ReceiptManageExample;
 import com.idea.invoice.service.ReceiptManageService;
 import com.idea.paymentManagement.mapper.PayLogMapper;
 import com.idea.paymentManagement.model.PayLog;
+import com.idea.util.DateUtils;
+import com.idea.util.MoneyUtils;
+import com.idea.util.ReplaceWord;
 import com.rockstar.common.base.BaseService;
 import com.rockstar.frame.model.FrameUser;
 import com.rockstar.frame.model.extend.DateTrans;
 import com.rockstar.frame.model.extend.Tablepar;
 import com.rockstar.frame.service.FrameUserService;
 import com.rockstar.shiro.util.ShiroUtils;
+import com.rockstar.system.service.SysDictService;
 import com.rockstar.util.StringUtils;
 import org.apache.commons.collections.CollectionUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
-import java.util.Arrays;
-import java.util.Date;
-import java.util.List;
+import javax.servlet.http.HttpServletResponse;
+import java.util.*;
 
 @Service
 public class IntentionalDepositService implements BaseService<IntentionalDeposit, IntentionalDepositExample> {
@@ -68,6 +72,10 @@ public class IntentionalDepositService implements BaseService<IntentionalDeposit
     private PayLogMapper payLogMapper;
     @Autowired
     private ReceiptManageService receiptManageService;
+    @Autowired
+    private BuyerService buyerService;
+    @Autowired
+    private SysDictService sysDictService;
 
 
     @Override
@@ -402,4 +410,51 @@ public class IntentionalDepositService implements BaseService<IntentionalDeposit
         return intentionalDepositDto;
     }
 
+    /**
+     * 意向金收据
+     * @param model
+     * @param response
+     */
+    public void downLoadReceipt(IntentionalDeposit model, HttpServletResponse response) {
+
+        // TODO: 2024/10/24 意向金收据暂无word文档
+        String filePath = "/home/project/settleDown/tem/.docx";
+        String fileName = "意向金收据.docx";
+        String customerManagementId = model.getCustomerManagementId();
+        BuyerExample buyerExample = new BuyerExample();
+        buyerExample.setOrderByClause("order_num asc");
+        buyerExample.createCriteria().andCustomerManagementIdEqualTo(customerManagementId);
+        List<Buyer> buyers = buyerService.selectByExample(buyerExample);
+        String name = "";
+        if (CollectionUtils.isNotEmpty(buyers)) {
+            Buyer buyer = buyers.get(0);
+            name = buyer.getName();
+        }
+        String collectionTime = DateUtils.parseDateToStr(DateUtils.DATE_CH, model.getCollectionTime());
+        String content = "定金";
+        String paymentMethod = "";
+        String dictLabel = sysDictService.getDictLabel("COLLECTION_METHODS", model.getPaymentMethod().toString());
+        if(StringUtils.isNotEmpty(dictLabel)){
+            paymentMethod = dictLabel;
+        }
+        String receivedAmount = model.getReceivedAmount().toString();
+        String capital = MoneyUtils.amountConversion(receivedAmount);
+
+        Map<String, Object> data = new HashMap<>();
+        Map<String, Object> picData = new HashMap<>();
+        Map<String, Object> sealData = new HashMap<>();
+        data.put("${name}", name);
+        data.put("${collectionTime}", collectionTime);
+        data.put("${content}", content);
+        data.put("${paymentMethod}", paymentMethod);
+        data.put("${capital}", capital);
+        data.put("${receivedAmount}", receivedAmount);
+
+        ReplaceWord.operateWord(response, filePath, fileName, data, picData, sealData);
+
+
+    }
+
+
+
 }

+ 78 - 14
pro-base/src/main/java/com/idea/customerManagement/service/RoomSelectionInfoService.java

@@ -1,5 +1,6 @@
 package com.idea.customerManagement.service;
 
+import cn.hutool.core.math.Money;
 import cn.hutool.core.util.IdUtil;
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
@@ -19,11 +20,14 @@ import com.idea.invoice.service.ReceiptManageService;
 import com.idea.paymentManagement.mapper.PayLogMapper;
 import com.idea.paymentManagement.model.PayLog;
 import com.idea.util.DateUtils;
+import com.idea.util.MoneyUtils;
 import com.idea.util.ReplaceWord;
 import com.rockstar.common.base.BaseService;
 import com.rockstar.frame.model.extend.DateTrans;
 import com.rockstar.frame.model.extend.Tablepar;
 import com.rockstar.shiro.util.ShiroUtils;
+import com.rockstar.system.service.SysDictService;
+import com.rockstar.util.StringUtils;
 import org.apache.commons.collections.CollectionUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -31,6 +35,7 @@ import org.springframework.transaction.annotation.Transactional;
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
+import java.math.BigDecimal;
 import java.util.*;
 
 @Service
@@ -54,6 +59,8 @@ public class RoomSelectionInfoService implements BaseService<RoomSelectionInfo,
     private PayLogMapper payLogMapper;
     @Autowired
     private ReceiptManageService receiptManageService;
+    @Autowired
+    private SysDictService sysDictService;
 
 
     @Override
@@ -179,10 +186,11 @@ public class RoomSelectionInfoService implements BaseService<RoomSelectionInfo,
 
     /**
      * 获取收据流水号(定金编号)
+     *
      * @param houseId
      * @return
      */
-    public String getSerialNumber(String houseId){
+    public String getSerialNumber(String houseId) {
         ParkRoomResponse response = roomExtendMapper.getFullName(houseId);
         String groupId = response.getGroupId();
         // 查找这个小区已收取认购金的 数据量
@@ -190,23 +198,24 @@ public class RoomSelectionInfoService implements BaseService<RoomSelectionInfo,
         example.createCriteria().andGroupIdEqualTo(groupId).andStatusEqualTo(2);
         Long count = countByExample(example);
         String number = "";
-        if(count.doubleValue() == 0){
+        if (count.doubleValue() == 0) {
             number = "00001";
-        }else {
-            count ++;
+        } else {
+            count++;
             number = String.format("%05d", count);
         }
-        String serialNumber = response.getGroupName()+ response.getDiscName() + "-DJ" + number;
+        String serialNumber = response.getGroupName() + response.getDiscName() + "-DJ" + number;
         return serialNumber;
     }
 
     /**
      * 认购金登记
+     *
      * @param model
      * @return
      */
     @Transactional
-    public int add(RoomSelectionInfoDto model){
+    public int add(RoomSelectionInfoDto model) {
 
         model.setUpdatedAt(new Date());
         model.setUpdatedId(ShiroUtils.getUserId());
@@ -216,7 +225,7 @@ public class RoomSelectionInfoService implements BaseService<RoomSelectionInfo,
         int result = updateByPrimaryKeySelective(model);
         // 生成合同
         String contractId = IdUtil.simpleUUID();
-        contractManageService.addContract(model,contractId);
+        contractManageService.addContract(model, contractId);
         // 修改房间已收状态 已认购
         ParkRoom parkRoom = new ParkRoom();
         parkRoom.setId(model.getHouseId());
@@ -257,10 +266,11 @@ public class RoomSelectionInfoService implements BaseService<RoomSelectionInfo,
 
     /**
      * 认购金修改
+     *
      * @param model
      * @return
      */
-    public int edit(RoomSelectionInfoDto model){
+    public int edit(RoomSelectionInfoDto model) {
 
         model.setUpdatedAt(new Date());
         model.setUpdatedId(ShiroUtils.getUserId());
@@ -270,20 +280,22 @@ public class RoomSelectionInfoService implements BaseService<RoomSelectionInfo,
 
     /**
      * 查看详情
+     *
      * @param id
      * @return
      */
-    public RoomSelectionInfo getById(String id){
+    public RoomSelectionInfo getById(String id) {
         return selectByPrimaryKey(id);
     }
 
     /**
      * 房源确认单 下载
+     *
      * @param model
      * @param request
      * @param response
      */
-    public void downLoad(RoomSelectionInfoDto model,HttpServletRequest request, HttpServletResponse response) {
+    public void downLoad(RoomSelectionInfoDto model, HttpServletRequest request, HttpServletResponse response) {
 
         String filePath = "/home/project/settleDown/tem/roomConfirmationSheet.docx";
         String picturePath = "C:\\Users\\35838\\Pictures\\liuhaizhu.jpg";
@@ -294,7 +306,7 @@ public class RoomSelectionInfoService implements BaseService<RoomSelectionInfo,
         buyerExample.setOrderByClause("order_num asc");
         buyerExample.createCriteria().andCustomerManagementIdEqualTo(customerManagementId);
         List<Buyer> buyers = buyerService.selectByExample(buyerExample);
-        if(CollectionUtils.isNotEmpty(buyers)){
+        if (CollectionUtils.isNotEmpty(buyers)) {
             Buyer buyer = buyers.get(0);
             ParkRoomResponse roomResponse = roomExtendMapper.getFullName(model.getHouseId());
             String fullName = roomResponse.getGroupName() + roomResponse.getDiscName() + roomResponse.getBuildName()
@@ -314,17 +326,16 @@ public class RoomSelectionInfoService implements BaseService<RoomSelectionInfo,
             data.put("${username}", loginName);
             picData.put("${picture}", picturePath);
             sealData.put("${seal}", sealPath);
-            ReplaceWord.operateWord(response,filePath,fileName,data, picData,sealData);
+            ReplaceWord.operateWord(response, filePath, fileName, data, picData, sealData);
         }
 
 
-
-
     }
 
 
     /**
      * 定金列表
+     *
      * @param tablepar
      * @param model
      * @param dt
@@ -337,5 +348,58 @@ public class RoomSelectionInfoService implements BaseService<RoomSelectionInfo,
         return pageInfo;
     }
 
+    /**
+     * 定金收据
+     * @param model
+     * @param response
+     */
+    public void downLoadReceipt(RoomSelectionInfoDto model, HttpServletResponse response) {
+
+        // TODO: 2024/10/24 定金收据暂无word文档
+        String filePath = "/home/project/settleDown/tem/.docx";
+        String fileName = "定金收据.docx";
+        String customerManagementId = model.getCustomerManagementId();
+        BuyerExample buyerExample = new BuyerExample();
+        buyerExample.setOrderByClause("order_num asc");
+        buyerExample.createCriteria().andCustomerManagementIdEqualTo(customerManagementId);
+        List<Buyer> buyers = buyerService.selectByExample(buyerExample);
+        String name = "";
+        if (CollectionUtils.isNotEmpty(buyers)) {
+            Buyer buyer = buyers.get(0);
+            name = buyer.getName();
+        }
+        ParkRoomResponse roomResponse = roomExtendMapper.getFullName(model.getHouseId());
+        String fullName = roomResponse.getGroupName()
+                + "-"
+                + roomResponse.getDiscName()
+                + roomResponse.getBuildName()
+                + roomResponse.getRoomNo();
+
+        String collectionTime = DateUtils.parseDateToStr(DateUtils.DATE_CH, model.getCollectionTime());
+        String content = "定金";
+        String paymentMethod = "";
+        String dictLabel = sysDictService.getDictLabel("COLLECTION_METHODS", model.getPaymentMethod().toString());
+        if(StringUtils.isNotEmpty(dictLabel)){
+            paymentMethod = dictLabel;
+        }
+        String receivedAmount = model.getReceivedAmount().toString();
+        String capital = MoneyUtils.amountConversion(receivedAmount);
+
+        Map<String, Object> data = new HashMap<>();
+        Map<String, Object> picData = new HashMap<>();
+        Map<String, Object> sealData = new HashMap<>();
+        data.put("${name}", name);
+        data.put("${collectionTime}", collectionTime);
+        data.put("${content}", content);
+        data.put("${paymentMethod}", paymentMethod);
+        data.put("${fullName}", fullName);
+        data.put("${capital}", capital);
+        data.put("${receivedAmount}", receivedAmount);
+
+        ReplaceWord.operateWord(response, filePath, fileName, data, picData, sealData);
+
+
+    }
+
 
 }

+ 28 - 0
pro-base/src/main/java/com/idea/invoice/util/InvoiceUtil.java

@@ -0,0 +1,28 @@
+package com.idea.invoice.util;
+
+import cn.hutool.http.HttpUtil;
+import cn.hutool.json.JSONUtil;
+import com.idea.invoice.model.InvoiceManage;
+import lombok.extern.slf4j.Slf4j;
+
+import java.util.HashMap;
+
+@Slf4j
+public class InvoiceUtil {
+
+    public static final String prefix = "http://10.1.2.17:8999/";
+
+    public static void sendInvoice(InvoiceManage record){
+
+        String url = "nccloud/api/wxyy/arap/gatheringbill/saveandcommit";
+        HashMap<String, Object> paramMap = new HashMap<>();
+        log.info("请求参数——:{}", JSONUtil.toJsonStr(paramMap));
+        String result = HttpUtil.post(prefix + url, JSONUtil.toJsonStr(paramMap));
+        log.info("发送消息接口返回——:{}",result);
+
+    }
+
+
+
+
+}

+ 17 - 4
pro-base/src/main/java/com/idea/paymentManagement/controller/PayLogController.java

@@ -2,6 +2,7 @@ package com.idea.paymentManagement.controller;
 
 import com.github.pagehelper.PageInfo;
 import com.idea.customerManagement.dto.ContractManageDto;
+import com.idea.customerManagement.model.IntentionalDeposit;
 import com.idea.paymentManagement.dto.PayLogDto;
 import com.idea.paymentManagement.model.PayLog;
 import com.idea.paymentManagement.service.PayLogService;
@@ -15,11 +16,9 @@ import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.bind.annotation.*;
 
+import javax.servlet.http.HttpServletResponse;
 import java.util.Date;
 
 @Controller
@@ -92,4 +91,18 @@ public class PayLogController extends BaseController {
         return result;
     }
 
+
+    /**
+     * 收款收据下载
+     * @param id
+     * @param response
+     */
+    @GetMapping(value = "downLoadReceipt",produces = {"application/json;charset=UTF-8"})
+    public void downLoadReceipt(String id, HttpServletResponse response) {
+        modelService.downLoadReceipt(id,response);
+    }
+
+
+
+
 }

+ 95 - 2
pro-base/src/main/java/com/idea/paymentManagement/service/PayLogService.java

@@ -5,14 +5,16 @@ import cn.hutool.core.util.IdUtil;
 import cn.hutool.core.util.ObjectUtil;
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
+import com.idea.buildManage.mapper.ParkRoomExtendMapper;
 import com.idea.buildManage.model.ParkInfo;
 import com.idea.buildManage.model.ParkInfoExample;
 import com.idea.buildManage.model.ParkRoom;
+import com.idea.buildManage.response.ParkRoomResponse;
 import com.idea.customerManagement.dto.ContractManageDto;
 import com.idea.customerManagement.mapper.ContractManageMapper;
 import com.idea.customerManagement.mapper.CustomerManagementMapper;
-import com.idea.customerManagement.model.ContractManage;
-import com.idea.customerManagement.model.CustomerManagement;
+import com.idea.customerManagement.model.*;
+import com.idea.customerManagement.service.BuyerService;
 import com.idea.invoice.dto.InvoiceManageDto;
 import com.idea.invoice.model.InvoiceManage;
 import com.idea.invoice.model.InvoiceManageExample;
@@ -25,21 +27,27 @@ import com.idea.paymentManagement.mapper.PayLogMapper;
 import com.idea.paymentManagement.model.PayLog;
 import com.idea.paymentManagement.model.PayLogExample;
 import com.idea.util.DateUtils;
+import com.idea.util.MoneyUtils;
+import com.idea.util.ReplaceWord;
 import com.rockstar.common.base.BaseService;
 import com.rockstar.frame.model.FrameUser;
 import com.rockstar.frame.model.extend.DateTrans;
 import com.rockstar.frame.model.extend.Tablepar;
 import com.rockstar.frame.service.FrameUserService;
 import com.rockstar.shiro.util.ShiroUtils;
+import com.rockstar.system.service.SysDictService;
 import com.rockstar.util.StringUtils;
 import org.apache.commons.collections.CollectionUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
+import javax.servlet.http.HttpServletResponse;
 import java.math.BigDecimal;
 import java.util.Date;
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
 
 @Service
 public class PayLogService implements BaseService<PayLog, PayLogExample> {
@@ -58,6 +66,12 @@ public class PayLogService implements BaseService<PayLog, PayLogExample> {
     private CustomerManagementMapper customerManagementMapper;
     @Autowired
     private ReceiptManageService receiptManageService;
+    @Autowired
+    private BuyerService buyerService;
+    @Autowired
+    private SysDictService sysDictService;
+    @Autowired
+    private ParkRoomExtendMapper roomExtendMapper;
 
 
     @Override
@@ -295,4 +309,83 @@ public class PayLogService implements BaseService<PayLog, PayLogExample> {
     }
 
 
+    /**
+     * 收款收据
+     * @param id
+     * @param response
+     */
+    public void downLoadReceipt(String id, HttpServletResponse response) {
+
+        PayLog payLog = selectByPrimaryKey(id);
+        Integer contentType = payLog.getContentType();
+        String filePath = "";
+        String fileName = "";
+        switch (contentType){
+            case 1: // 定金
+                filePath = "/home/project/settleDown/tem/.docx";
+                fileName = "定金收据.docx";
+                break;
+            case 2: // 首付
+                filePath = "/home/project/settleDown/tem/.docx";
+                fileName = "首付收据.docx";
+                break;
+            case 3: // 银行按揭
+                filePath = "/home/project/settleDown/tem/.docx";
+                fileName = "银行按揭收据.docx";
+                break;
+        }
+
+        String customerManagementId = payLog.getCustomerManagementId();
+        BuyerExample buyerExample = new BuyerExample();
+        buyerExample.setOrderByClause("order_num asc");
+        buyerExample.createCriteria().andCustomerManagementIdEqualTo(customerManagementId);
+        List<Buyer> buyers = buyerService.selectByExample(buyerExample);
+        String name = "";
+        if (CollectionUtils.isNotEmpty(buyers)) {
+            Buyer buyer = buyers.get(0);
+            name = buyer.getName();
+        }
+
+        ParkRoomResponse roomResponse = roomExtendMapper.getFullName(payLog.getHouseId());
+        String fullName = roomResponse.getGroupName()
+                + "-"
+                + roomResponse.getDiscName()
+                + roomResponse.getBuildName()
+                + roomResponse.getRoomNo();
+
+        String collectionTime = DateUtils.parseDateToStr(DateUtils.DATE_CH, payLog.getPayTime());
+        String content = "";
+        String paymentMethod = "";
+        String contentTypeLabel = sysDictService.getDictLabel("CONTENT_TYPE",payLog.getContentType().toString());
+        String paymentMethodLabel = sysDictService.getDictLabel("COLLECTION_METHODS",payLog.getPaymentMethod().toString());
+        if(StringUtils.isNotEmpty(contentTypeLabel)){
+            content = contentTypeLabel;
+        }
+        if(StringUtils.isNotEmpty(paymentMethodLabel)){
+            paymentMethod = paymentMethodLabel;
+        }
+        String receivedAmount = payLog.getPayMoney().toString();
+        String capital = MoneyUtils.amountConversion(receivedAmount);
+
+        Map<String, Object> data = new HashMap<>();
+        Map<String, Object> picData = new HashMap<>();
+        Map<String, Object> sealData = new HashMap<>();
+        data.put("${name}", name);
+        data.put("${collectionTime}", collectionTime);
+        data.put("${fullName}", fullName);
+        data.put("${content}", content);
+        data.put("${paymentMethod}", paymentMethod);
+        data.put("${capital}", capital);
+        data.put("${receivedAmount}", receivedAmount);
+
+        ReplaceWord.operateWord(response, filePath, fileName, data, picData, sealData);
+
+
+    }
+
+
+
+
+
+
 }

+ 109 - 0
pro-base/src/main/java/com/idea/util/MoneyUtils.java

@@ -0,0 +1,109 @@
+package com.idea.util;
+
+import org.apache.commons.lang3.RandomStringUtils;
+import org.apache.commons.lang3.RandomUtils;
+import org.apache.commons.lang3.StringUtils;
+
+import java.math.BigDecimal;
+import java.text.DecimalFormat;
+
+public class MoneyUtils {
+
+    private static final String[] cnNums = { "零", "壹", "贰", "叁", "肆", "伍", "陆", "柒", "捌", "玖" }; // 汉字的数字
+    private static final String[] cnIntRadice = { "", "拾", "佰", "仟" }; // 基本单位
+    private static final String[] cnIntUnits = { "", "万", "亿", "兆" }; // 对应整数部分扩展单位
+    private static final String[] cnDecUnits = { "角", "分"}; // 对应小数部分单位
+    private static final String cnInteger = "整"; // 整数金额时后面跟的字符
+    private static final String cnIntLast = "元"; // 整型完以后的单位
+
+    /**
+     * 金额大小写转换,将数字转换为汉字
+     * @param money 支持最大16位整数2位小数
+     * @return
+     */
+    public static String amountConversion(String money){
+        //如果传入为空,则返回null
+        if(StringUtils.isBlank(money)){
+            return "null";
+        }
+        String result = "";
+        //整数部分
+        String integer="";
+        //小数部分
+        String point="";
+        if(money.matches("^[0-9]{0,16}|[0-9]{0,16}+([.]{0,1}[0-9]{0,2})$")){
+            BigDecimal bigDecimal = new BigDecimal(money);
+            //对金额进行格式化,统一小数点后面保留两位。 此举能去除整数部分多余的0,以及小数部分统一保留两位 如:00456.1-->456.10
+            money = new DecimalFormat("##0.00").format(bigDecimal);
+            //整数部分
+            integer = money.split("\\.").length==1?money:money.split("\\.")[0];
+            //小数部分
+            point = money.split("\\.").length==1?"00":money.split("\\.")[1];
+
+
+            if("0".equals(integer)){
+                result = "零"+cnIntLast;
+            }else{
+                int zeroCount = 0;
+                char[] array = integer.toCharArray();
+                String n="";
+                int p=0,q=0,m=0;
+                for (int i = 0; i < integer.length(); i++) {
+                    n = Character.toString(array[i]);
+                    p = integer.length() - i - 1;
+                    q = p / 4;
+                    m = p % 4;
+                    if (n.equals("0")) {
+                        zeroCount++;
+                    } else {
+                        if (zeroCount > 0) {
+                            result += cnNums[0];
+                        }
+                        zeroCount = 0; // 归零
+                        result += cnNums[Integer.parseInt(n)] + cnIntRadice[m];
+                    }
+                    if (m == 0 && zeroCount < 4) {
+                        result += cnIntUnits[q];
+                    }
+                }
+                result += cnIntLast;
+            }
+
+            //组装小数部分
+            if ("00".equals(point)) {
+                result += cnInteger;
+            }else{
+                String n="";
+                char[] array = point.toCharArray();
+                for (int i = 0; i < point.length(); i++) {
+                    n = Character.toString(array[i]);
+                    if (!n.equals("0")) {
+                        result += cnNums[Integer.parseInt(n)] + cnDecUnits[i];
+                    }
+                }
+            }
+
+
+        }else{
+            return "请检查金额(整数位不能超过16位,小数不能超过2位)";
+        }
+
+        return result;
+    }
+
+    public static void main(String[] args) {
+        System.out.println(amountConversion("107.01"));
+        for(int i=0;i<20;i++){
+            int integer = RandomUtils.nextInt(0,17);
+            int point = RandomUtils.nextInt(0,3);
+            String in = integer==0?"0":RandomStringUtils.randomNumeric(integer);
+            String po = point==0?"0":RandomStringUtils.randomNumeric(point);
+            String money = in+"."+po;
+            System.out.println(money +"====="+amountConversion(money));
+        }
+    }
+
+
+}
+
+