TransferUtils.java 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486
  1. package com.ydtech.modules.inv.utils;
  2. import com.alibaba.fastjson.JSONObject;
  3. import com.ydtech.exception.SystemException;
  4. import com.ydtech.modules.base.controller.BaseController;
  5. import com.ydtech.modules.inv.model.*;
  6. import com.ydtech.modules.inv.service.InvAccountService;
  7. import com.ydtech.modules.inv.service.impl.InvAccountServiceImpl;
  8. import org.apache.bcel.generic.IF_ACMPEQ;
  9. import java.math.BigDecimal;
  10. import java.math.RoundingMode;
  11. import java.time.LocalDateTime;
  12. import java.util.ArrayList;
  13. import java.util.List;
  14. import java.util.Map;
  15. /**
  16. * 转账工具类
  17. *
  18. * @author jianlong
  19. * @date 2024-01-10 14:10
  20. */
  21. public class TransferUtils {
  22. /**
  23. * 插入收入归属
  24. *
  25. * @param entProfit
  26. * @param entAccount
  27. * @param entAccountCard
  28. * @return
  29. */
  30. public static List<InvAccountOp> invAccountEntOpList(JSONObject entProfit, InvAccount entAccount, InvAccountCard entAccountCard, String operateId) {
  31. List<InvAccountOp> list = new ArrayList<>();
  32. if (entProfit != null) {
  33. for (Map.Entry<String, Object> entry : entProfit.entrySet()) {
  34. if (new BigDecimal(entry.getValue().toString()).compareTo(BigDecimal.ZERO) != 0) {
  35. InvAccountOp invAccountOp = new InvAccountOp();
  36. invAccountOp.setAccountId(entAccount.getAccountId());
  37. invAccountOp.setAccountName(entAccount.getAccountName());
  38. invAccountOp.setCardNum(entAccountCard.getBankCardNum());
  39. invAccountOp.setCardName(entAccountCard.getBankName());
  40. invAccountOp.setAccountOperateId(operateId);
  41. invAccountOp.setProfit(entry.getKey());
  42. invAccountOp.setMoney(entry.getValue().toString());
  43. list.add(invAccountOp);
  44. }
  45. }
  46. }
  47. return list;
  48. }
  49. public static List<InvAccountOp> invAccountEntOpList1(JSONObject entProfit, InvAccount entAccount, InvAccountCard entAccountCard, String operateId,String payoutAmount) {
  50. List<InvAccountOp> list = new ArrayList<>();
  51. if (entProfit != null) {
  52. for (Map.Entry<String, Object> entry : entProfit.entrySet()) {
  53. if (new BigDecimal(entry.getValue().toString()).compareTo(BigDecimal.ZERO) != 0) {
  54. InvAccountOp invAccountOp = new InvAccountOp();
  55. invAccountOp.setAccountId(entAccount.getAccountId());
  56. invAccountOp.setAccountName(entAccount.getAccountName());
  57. invAccountOp.setCardNum(entAccountCard.getBankCardNum());
  58. invAccountOp.setCardName(entAccountCard.getBankName());
  59. invAccountOp.setAccountOperateId(operateId);
  60. invAccountOp.setProfit(entry.getKey());
  61. invAccountOp.setMoney(payoutAmount);
  62. list.add(invAccountOp);
  63. }
  64. }
  65. }
  66. return list;
  67. }
  68. /**
  69. * 插入支出归属
  70. *
  71. * @param outProfit
  72. * @param outAccount
  73. * @param outAccountCard
  74. * @return
  75. */
  76. public static List<InvAccountOp> invAccountOutOpList(JSONObject outProfit, InvAccount outAccount, InvAccountCard outAccountCard, String operateId) {
  77. List<InvAccountOp> list = new ArrayList<>();
  78. for (Map.Entry<String, Object> entry : outProfit.entrySet()) {
  79. if (new BigDecimal(entry.getValue().toString()).compareTo(BigDecimal.ZERO) != 0) {
  80. InvAccountOp invAccountOp = new InvAccountOp();
  81. invAccountOp.setAccountId(outAccount.getAccountId());
  82. invAccountOp.setAccountName(outAccount.getAccountName());
  83. invAccountOp.setCardNum(outAccountCard.getBankCardNum());
  84. invAccountOp.setCardName(outAccountCard.getBankName());
  85. invAccountOp.setProfit(entry.getKey());
  86. invAccountOp.setAccountOperateId(operateId);
  87. invAccountOp.setMoney(String.valueOf(entry.getValue()));
  88. list.add(invAccountOp);
  89. }
  90. }
  91. return list;
  92. }
  93. //处理部分支出时逻辑
  94. public static List<InvAccountOp> invAccountOutOpList1(JSONObject outProfit, InvAccount outAccount, InvAccountCard outAccountCard, String operateId,String payoutAmount) {
  95. List<InvAccountOp> list = new ArrayList<>();
  96. for (Map.Entry<String, Object> entry : outProfit.entrySet()) {
  97. if (new BigDecimal(entry.getValue().toString()).compareTo(BigDecimal.ZERO) != 0) {
  98. InvAccountOp invAccountOp = new InvAccountOp();
  99. invAccountOp.setAccountId(outAccount.getAccountId());
  100. invAccountOp.setAccountName(outAccount.getAccountName());
  101. invAccountOp.setCardNum(outAccountCard.getBankCardNum());
  102. invAccountOp.setCardName(outAccountCard.getBankName());
  103. invAccountOp.setProfit(entry.getKey());
  104. invAccountOp.setAccountOperateId(operateId);
  105. payoutAmount = "-" + payoutAmount;
  106. invAccountOp.setMoney(payoutAmount);
  107. list.add(invAccountOp);
  108. }
  109. }
  110. return list;
  111. }
  112. /**
  113. * 转账成功后添加支出账户操作信息
  114. */
  115. public static InvAccountOperate insertOutAccountOperate(InvAccountExcel insAccountExcel) {
  116. //支出公司
  117. InvAccountOperate insAccountOperate = new InvAccountOperate();
  118. BaseController baseController = new BaseController();
  119. InvAccountOperate operate = operate(insAccountExcel, insAccountOperate);
  120. operate.setRevenueOutlay("1");
  121. operate.setApplyAmount(insAccountExcel.getPayoutAmount());
  122. operate.setOutProfit(insAccountExcel.getOutProfit());
  123. operate.setCreateTime(LocalDateTime.now().toString());
  124. operate.setCreateBy(baseController.getUserName());
  125. operate.setCreateId(baseController.getUserId());
  126. operate.setRemark(insAccountExcel.getRemark());
  127. operate.setOutCardNum(insAccountExcel.getOutCardNum());
  128. return operate;
  129. }
  130. /**
  131. * 转账成功后添加收入账户操作信息
  132. */
  133. public static InvAccountOperate insertRevenueAccountOperate(InvAccountExcel insAccountExcel) {
  134. //支出公司
  135. InvAccountOperate insAccountOperate = new InvAccountOperate();
  136. BaseController baseController = new BaseController();
  137. InvAccountOperate operate = operate(insAccountExcel, insAccountOperate);
  138. operate.setRevenueOutlay("0");
  139. operate.setEntProfit(insAccountExcel.getEntProfit());
  140. operate.setCreateTime(LocalDateTime.now().toString());
  141. operate.setRemark(insAccountExcel.getRemark());
  142. operate.setCreateBy(baseController.getUserName());
  143. operate.setCreateId(baseController.getUserId());
  144. operate.setEnterCardNum(insAccountExcel.getEnterCardNum());
  145. return operate;
  146. }
  147. private static InvAccountOperate operate(InvAccountExcel invAccountExcel, InvAccountOperate invAccountOperate) {
  148. invAccountOperate.setApplicant(invAccountExcel.getApplicant());
  149. invAccountOperate.setApplySector(invAccountExcel.getApplySector());
  150. invAccountOperate.setApplyTime(invAccountExcel.getApplyTime());
  151. invAccountOperate.setCollectionMessage(invAccountExcel.getCollectionMessage());
  152. invAccountOperate.setFundFlow(invAccountExcel.getFundFlow());
  153. invAccountOperate.setFundUse(invAccountExcel.getFundUse());
  154. invAccountOperate.setPayMethod(invAccountExcel.getPayMethod());
  155. invAccountOperate.setCompany(invAccountExcel.getCompany());
  156. invAccountOperate.setApplyAmount(invAccountExcel.getApplyAmount());
  157. invAccountOperate.setBigApplyAmount(invAccountExcel.getBigApplyAmount());
  158. invAccountOperate.setFundFen(invAccountExcel.getFundFen());
  159. return invAccountOperate;
  160. }
  161. /**
  162. * 判断各余额是否足够
  163. *
  164. * @param outAccountCard
  165. * @param entAccountCard
  166. * @param ApplyAmount
  167. * @return
  168. */
  169. public static Boolean lenss(InvAccountCard outAccountCard, InvAccountCard entAccountCard, InvAccount outAccount, InvAccount entAccount, String ApplyAmount) {
  170. if (entAccountCard == null || entAccount == null) {
  171. throw new SystemException("收入卡或收入账户为空");
  172. }
  173. if (outAccountCard == null || outAccount == null) {
  174. throw new SystemException("转出卡或转出账户为空");
  175. }
  176. if (ApplyAmount == null) {
  177. throw new SystemException("金额为空");
  178. }
  179. if (outAccount.getOuterFlag().equals("0")) {
  180. //公户单日转账剩余
  181. BigDecimal pubDayLinesExcess = new BigDecimal(outAccountCard.getPubDayLinesExcess());
  182. //私户单日转账剩余
  183. BigDecimal priDayLinesExcess = new BigDecimal(outAccountCard.getPriDayLinesExcess());
  184. //公户年额度剩余
  185. BigDecimal pubYearExcess = new BigDecimal(outAccountCard.getPubYearExcess());
  186. //私户年额度剩余
  187. BigDecimal priYearExcess = new BigDecimal(outAccountCard.getPriYearExcess());
  188. //对公单笔限额
  189. BigDecimal pubSingleLines = new BigDecimal(outAccountCard.getPubSingleLines());
  190. //对私单笔限额
  191. BigDecimal priSingleLines = new BigDecimal(outAccountCard.getPriSingleLines());
  192. //单日转账笔数剩余
  193. long dayStrokeNumExcess = Long.parseLong(outAccountCard.getDayStrokeNumExcess());
  194. //申请金额
  195. BigDecimal invApplyAmount = new BigDecimal(ApplyAmount);
  196. //转出账户余额
  197. BigDecimal outAccountBalance = new BigDecimal(outAccountCard.getBalance());
  198. if (outAccountBalance.compareTo(invApplyAmount) < 0) {
  199. throw new SystemException("转出账户余额不足");
  200. }
  201. if (entAccountCard.getAccountQuality().equals("0")) {
  202. //收入账户为公户
  203. if (dayStrokeNumExcess <= 0) {
  204. throw new SystemException("公户单日转账笔数不足");
  205. }
  206. //判断单日转账金额是否超过
  207. if (pubDayLinesExcess.compareTo(BigDecimal.valueOf(0)) != 0 && pubDayLinesExcess.compareTo(invApplyAmount) < 0) {
  208. throw new SystemException("公户单日转账金额不足");
  209. }
  210. //判断年额度是否超过
  211. if (pubYearExcess.compareTo(BigDecimal.valueOf(0)) != 0 && pubYearExcess.compareTo(invApplyAmount) < 0) {
  212. throw new SystemException("公户年额度不足");
  213. }
  214. if (pubSingleLines.compareTo(invApplyAmount) < 0) {
  215. throw new SystemException("公户转账金额超出单笔限额");
  216. }
  217. } else {
  218. //收入账户为私户
  219. if (dayStrokeNumExcess <= 0) {
  220. throw new SystemException("私户单日转账笔数不足");
  221. }
  222. if (priDayLinesExcess.compareTo(BigDecimal.valueOf(0)) != 0 && priDayLinesExcess.compareTo(invApplyAmount) < 0) {
  223. throw new SystemException("私户单日转账金额不足");
  224. }
  225. if (priYearExcess.compareTo(BigDecimal.valueOf(0)) != 0 && priYearExcess.compareTo(invApplyAmount) < 0) {
  226. throw new SystemException("私户年额度不足");
  227. }
  228. if (priSingleLines.compareTo(invApplyAmount) < 0) {
  229. throw new SystemException("私户转账金额超出单笔限额");
  230. }
  231. }
  232. }
  233. return true;
  234. }
  235. /**
  236. * 判断归属是否分配完毕
  237. *
  238. * @param outProfit
  239. * @param entProfit
  240. * @return
  241. */
  242. public static Boolean isProfitFull(JSONObject outProfit, JSONObject entProfit) {
  243. BigDecimal outAmount = new BigDecimal(0);
  244. BigDecimal entAmount = new BigDecimal(0);
  245. for (Map.Entry<String, Object> entry : outProfit.entrySet()) {
  246. outAmount = outAmount.add(new BigDecimal(entry.getValue().toString()));
  247. }
  248. for (Map.Entry<String, Object> entry : entProfit.entrySet()) {
  249. entAmount = entAmount.add(new BigDecimal(entry.getValue().toString()));
  250. }
  251. String string = (new BigDecimal(String.valueOf(entAmount)).add(new BigDecimal(String.valueOf(outAmount)))).toString();
  252. if (new BigDecimal(string).compareTo(BigDecimal.ZERO) != 0) {
  253. throw new SystemException("金额未完全分配");
  254. }
  255. return true;
  256. }
  257. /**
  258. * 判断归属是否分配完毕
  259. *
  260. * @param outProfit
  261. * @param entProfit
  262. * @return
  263. */
  264. public static Boolean isProfitFull(JSONObject outProfit, JSONObject entProfit, String payoutMoney) {
  265. BigDecimal outAmount = new BigDecimal(0);
  266. BigDecimal entAmount = new BigDecimal(0);
  267. for (Map.Entry<String, Object> entry : outProfit.entrySet()) {
  268. outAmount = outAmount.add(new BigDecimal(entry.getValue().toString()));
  269. }
  270. for (Map.Entry<String, Object> entry : entProfit.entrySet()) {
  271. entAmount = entAmount.add(new BigDecimal(entry.getValue().toString()));
  272. }
  273. String string = (new BigDecimal(String.valueOf(entAmount)).add(new BigDecimal(String.valueOf(outAmount)))).toString();
  274. if (new BigDecimal(string).compareTo(BigDecimal.ZERO) != 0) {
  275. throw new SystemException("金额未完全分配");
  276. }
  277. if ((entAmount.compareTo(new BigDecimal(payoutMoney)) != 0)
  278. || (outAmount.abs().compareTo(new BigDecimal(payoutMoney)) != 0)) {
  279. throw new SystemException("进账金额与板块总金额不匹配");
  280. }
  281. return true;
  282. }
  283. /**
  284. * 转给私户扣除余额方法
  285. */
  286. private static InvAccountCard priAccountUtils(InvAccountCard outAccountCard, String invAccountExcelApplyAmount) {
  287. String spend = outAccountCard.getSpend();
  288. String dayStrokeNumExcess = outAccountCard.getDayStrokeNumExcess();
  289. String priDayLinesExcess = outAccountCard.getPriDayLinesExcess();
  290. String priYearExcess = outAccountCard.getPriYearExcess();
  291. outAccountCard.setSpend(new BigDecimal(spend).add(new BigDecimal(invAccountExcelApplyAmount)).toString());
  292. outAccountCard.setBalance(new BigDecimal(outAccountCard.getBalance()).subtract(new BigDecimal(invAccountExcelApplyAmount)).toString());
  293. outAccountCard.setDayStrokeNumExcess(String.valueOf(Integer.parseInt(dayStrokeNumExcess) - 1));
  294. outAccountCard.setPriDayLinesExcess(new BigDecimal(priDayLinesExcess).subtract(new BigDecimal(invAccountExcelApplyAmount)).toString());
  295. outAccountCard.setPriYearExcess(new BigDecimal(priYearExcess).subtract(new BigDecimal(invAccountExcelApplyAmount)).toString());
  296. return outAccountCard;
  297. }
  298. /**
  299. * 转给公户扣除余额方法
  300. */
  301. private static InvAccountCard pubAccountUtils(InvAccountCard outAccountCard, String invAccountExcelApplyAmount) {
  302. String spend = outAccountCard.getSpend();
  303. String dayStrokeNumExcess = outAccountCard.getDayStrokeNumExcess();
  304. String pubDayLinesExcess = outAccountCard.getPubDayLinesExcess();
  305. String pubYearExcess = outAccountCard.getPubYearExcess();
  306. BigDecimal bigDecimal = new BigDecimal(invAccountExcelApplyAmount);
  307. //支出方减少余额
  308. outAccountCard.setSpend(new BigDecimal(spend).add(bigDecimal).toString());
  309. outAccountCard.setBalance(new BigDecimal(outAccountCard.getBalance()).subtract(bigDecimal).toString());
  310. //公户单日转账笔数减少
  311. outAccountCard.setDayStrokeNumExcess(String.valueOf(Integer.parseInt(dayStrokeNumExcess) - 1));
  312. //公户单日转账剩余减少
  313. outAccountCard.setPubDayLinesExcess(new BigDecimal(pubDayLinesExcess).subtract(bigDecimal).toString());
  314. //公户年额度减少
  315. outAccountCard.setPubYearExcess(new BigDecimal(pubYearExcess).subtract(bigDecimal).toString());
  316. return outAccountCard;
  317. }
  318. /**
  319. * 内部转内部方法
  320. */
  321. public static List<InvAccountCard> insideTransfer(InvAccountCard outAccountCard, InvAccount outAccount, InvAccountCard enterAccountCard, InvAccount enterAccount, String applyAmount) {
  322. List<InvAccountCard> list = new ArrayList<>();
  323. TransferUtils.lenss(outAccountCard, enterAccountCard, outAccount, enterAccount, applyAmount);
  324. if (enterAccountCard.getAccountQuality().equals("0")) {
  325. list.add(pubAccountUtils(outAccountCard, applyAmount));
  326. list.add(enterAccountUtils(enterAccountCard, applyAmount));
  327. return list;
  328. } else {
  329. //私户操作
  330. list.add(priAccountUtils(outAccountCard, applyAmount));
  331. list.add(enterAccountUtils(enterAccountCard, applyAmount));
  332. return list;
  333. }
  334. }
  335. /**
  336. * 内部转外部方法
  337. */
  338. public static List<InvAccountCard> enterDeTransfer(InvAccountCard outAccountCard, InvAccount outAccount, InvAccountCard enterAccountCard, InvAccount enterAccount, String applyAmount) {
  339. List<InvAccountCard> list = new ArrayList<>();
  340. TransferUtils.lenss(outAccountCard, enterAccountCard, outAccount, enterAccount, applyAmount);
  341. if (enterAccountCard.getAccountQuality().equals("0")) {
  342. //公户操作
  343. list.add(pubAccountUtils(outAccountCard, applyAmount));
  344. } else {
  345. //私户操作
  346. list.add(priAccountUtils(outAccountCard, applyAmount));
  347. }
  348. return list;
  349. }
  350. /**
  351. * 外部转内部方法
  352. */
  353. public static InvAccountCard outsideTransfer(InvAccountCard outAccountCard, InvAccount outAccount, InvAccountCard enterAccountCard, InvAccount enterAccount, String applyAmount) {
  354. TransferUtils.lenss(outAccountCard, enterAccountCard, outAccount, enterAccount, applyAmount);
  355. return enterAccountUtils(enterAccountCard, applyAmount);
  356. }
  357. /**
  358. * 收入方增加利润方法
  359. *
  360. * @return
  361. */
  362. private static InvAccountCard enterAccountUtils(InvAccountCard enterAccountCard, String invAccountExcelApplyAmount) {
  363. if (enterAccountCard.getBalance() != null && !enterAccountCard.getBalance().isEmpty()) {
  364. enterAccountCard.setBalance(new BigDecimal(enterAccountCard.getBalance()).add(new BigDecimal(invAccountExcelApplyAmount)).toString());
  365. }
  366. return enterAccountCard;
  367. }
  368. /**
  369. * 撤销发票方法
  370. */
  371. public static List<InvAccountCard> quashOutsideTransfer(InvAccountCard outAccountCard, InvAccountCard enterAccountCard, BigDecimal applyAmount, InvAccount entInvAccount) {
  372. List<InvAccountCard> list = new ArrayList<>();
  373. list.add(enterAccountBreakUtils(enterAccountCard, outAccountCard, applyAmount, entInvAccount));
  374. InvAccountCard invAccountCard = outAccountBreakUtils(outAccountCard, enterAccountCard, applyAmount);
  375. if (invAccountCard != null) {
  376. list.add(invAccountCard);
  377. }
  378. return list;
  379. }
  380. /**
  381. * 收入方回滚利润方法
  382. *
  383. * @return
  384. */
  385. private static InvAccountCard enterAccountBreakUtils(InvAccountCard enterAccountCard, InvAccountCard outAccountCard, BigDecimal invAccountExcelApplyAmount, InvAccount entInvAccount) {
  386. if (entInvAccount.getOuterFlag().equals("0")) {
  387. if (enterAccountCard != null) {
  388. if (outAccountCard != null) {
  389. if (new BigDecimal(enterAccountCard.getBalance()).compareTo(BigDecimal.ZERO) == 0) {
  390. throw new SystemException("账户余额不足");
  391. }
  392. if (new BigDecimal(enterAccountCard.getBalance()).compareTo(invAccountExcelApplyAmount) < 0) {
  393. throw new SystemException("账户余额不足");
  394. }
  395. }
  396. if (!enterAccountCard.getBalance().isEmpty()) {
  397. enterAccountCard.setBalance(new BigDecimal(enterAccountCard.getBalance()).subtract(invAccountExcelApplyAmount).toString());
  398. }
  399. }
  400. }
  401. return enterAccountCard;
  402. }
  403. /**
  404. * 支出方回滚利润方法
  405. *
  406. * @return
  407. */
  408. private static InvAccountCard outAccountBreakUtils(InvAccountCard outAccountCard, InvAccountCard enterAccountCard, BigDecimal invAccountExcelApplyAmount) {
  409. if (outAccountCard != null) {
  410. if (outAccountCard.getBalance() != null && !outAccountCard.getBalance().isEmpty()) {
  411. outAccountCard.setBalance(new BigDecimal(outAccountCard.getBalance()).add(invAccountExcelApplyAmount).toString());
  412. outAccountCard.setSpend(new BigDecimal(outAccountCard.getSpend()).subtract(invAccountExcelApplyAmount).toString());
  413. if (outAccountCard.getDayStrokeNumExcess() != null && !outAccountCard.getDayStrokeNumExcess().isEmpty()) {
  414. outAccountCard.setDayStrokeNumExcess(new BigDecimal(outAccountCard.getDayStrokeNumExcess()).add(new BigDecimal("1")).toString());
  415. }
  416. if (enterAccountCard.getAccountQuality().equals("0")) {
  417. if (outAccountCard.getPubDayLinesExcess() != null && !outAccountCard.getPubDayLinesExcess().isEmpty()) {
  418. outAccountCard.setPubDayLinesExcess(new BigDecimal(outAccountCard.getPubDayLinesExcess()).add(invAccountExcelApplyAmount).toString());
  419. }
  420. if (outAccountCard.getPubYearExcess() != null && !outAccountCard.getPubYearExcess().isEmpty()) {
  421. outAccountCard.setPubYearExcess(new BigDecimal(outAccountCard.getPubYearExcess()).add(invAccountExcelApplyAmount).toString());
  422. }
  423. } else {
  424. if (outAccountCard.getPriDayLinesExcess() != null && !outAccountCard.getPriDayLinesExcess().isEmpty()) {
  425. outAccountCard.setPriDayLinesExcess(new BigDecimal(outAccountCard.getPriDayLinesExcess()).add(invAccountExcelApplyAmount).toString());
  426. }
  427. if (outAccountCard.getPriYearExcess() != null && !outAccountCard.getPriYearExcess().isEmpty()) {
  428. outAccountCard.setPriYearExcess(new BigDecimal(outAccountCard.getPriYearExcess()).add(invAccountExcelApplyAmount).toString());
  429. }
  430. }
  431. }
  432. }
  433. return outAccountCard;
  434. }
  435. }