From 85a0b219601fcf684ca18e4f6131dbd3d6869b2b Mon Sep 17 00:00:00 2001 From: jishenghua <752718920@qq.com> Date: Fri, 31 May 2024 00:46:03 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=99=E8=B4=A6=E6=88=B7=E6=B5=81=E6=B0=B4?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E5=A2=9E=E5=8A=A0=E7=AD=9B=E9=80=89=E6=9D=A1?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../jsh/erp/controller/AccountController.java | 19 ++- .../datasource/mappers/AccountMapperEx.java | 8 +- .../erp/service/account/AccountService.java | 9 +- .../resources/mapper_xml/AccountMapperEx.xml | 120 ++++++++++++++++++ 4 files changed, 144 insertions(+), 12 deletions(-) diff --git a/jshERP-boot/src/main/java/com/jsh/erp/controller/AccountController.java b/jshERP-boot/src/main/java/com/jsh/erp/controller/AccountController.java index 2aa21591..bd5566d9 100644 --- a/jshERP-boot/src/main/java/com/jsh/erp/controller/AccountController.java +++ b/jshERP-boot/src/main/java/com/jsh/erp/controller/AccountController.java @@ -108,12 +108,17 @@ public class AccountController { @RequestParam("pageSize") Integer pageSize, @RequestParam("accountId") Long accountId, @RequestParam("initialAmount") BigDecimal initialAmount, + @RequestParam(value = "number",required = false) String number, + @RequestParam(value = "beginTime",required = false) String beginTime, + @RequestParam(value = "endTime",required = false) String endTime, HttpServletRequest request) throws Exception{ BaseResponseInfo res = new BaseResponseInfo(); Map map = new HashMap(); try { - List dataList = accountService.findAccountInOutList(accountId, (currentPage-1)*pageSize, pageSize); - int total = accountService.findAccountInOutListCount(accountId); + List dataList = accountService.findAccountInOutList(accountId, StringUtil.toNull(number), + beginTime, endTime, (currentPage-1)*pageSize, pageSize); + int total = accountService.findAccountInOutListCount(accountId, StringUtil.toNull(number), + beginTime, endTime); map.put("total", total); //存放数据json数组 JSONArray dataArray = new JSONArray(); @@ -122,11 +127,11 @@ public class AccountController { for (AccountVo4InOutList aEx : dataList) { String type = aEx.getType().replace("其它", ""); aEx.setType(type); - String endTime = aEx.getOperTime(); - BigDecimal balance = accountService.getAccountSum(accountId, null, endTime, forceFlag) - .add(accountService.getAccountSumByHead(accountId, null, endTime, forceFlag)) - .add(accountService.getAccountSumByDetail(accountId, null, endTime, forceFlag)) - .add(accountService.getManyAccountSum(accountId, null, endTime, forceFlag)).add(initialAmount); + String operTime = aEx.getOperTime(); + BigDecimal balance = accountService.getAccountSum(accountId, null, operTime, forceFlag) + .add(accountService.getAccountSumByHead(accountId, null, operTime, forceFlag)) + .add(accountService.getAccountSumByDetail(accountId, null, operTime, forceFlag)) + .add(accountService.getManyAccountSum(accountId, null, operTime, forceFlag)).add(initialAmount); aEx.setBalance(balance); aEx.setAccountId(accountId); dataArray.add(aEx); diff --git a/jshERP-boot/src/main/java/com/jsh/erp/datasource/mappers/AccountMapperEx.java b/jshERP-boot/src/main/java/com/jsh/erp/datasource/mappers/AccountMapperEx.java index b7ec1e4f..a21aeb19 100644 --- a/jshERP-boot/src/main/java/com/jsh/erp/datasource/mappers/AccountMapperEx.java +++ b/jshERP-boot/src/main/java/com/jsh/erp/datasource/mappers/AccountMapperEx.java @@ -69,11 +69,17 @@ public interface AccountMapperEx { List findAccountInOutList( @Param("accountId") Long accountId, + @Param("number") String number, + @Param("beginTime") String beginTime, + @Param("endTime") String endTime, @Param("offset") Integer offset, @Param("rows") Integer rows); int findAccountInOutListCount( - @Param("accountId") Long accountId); + @Param("accountId") Long accountId, + @Param("number") String number, + @Param("beginTime") String beginTime, + @Param("endTime") String endTime); int batchDeleteAccountByIds(@Param("updateTime") Date updateTime, @Param("updater") Long updater, @Param("ids") String ids[]); diff --git a/jshERP-boot/src/main/java/com/jsh/erp/service/account/AccountService.java b/jshERP-boot/src/main/java/com/jsh/erp/service/account/AccountService.java index e1f2df98..adb0c518 100644 --- a/jshERP-boot/src/main/java/com/jsh/erp/service/account/AccountService.java +++ b/jshERP-boot/src/main/java/com/jsh/erp/service/account/AccountService.java @@ -377,20 +377,21 @@ public class AccountService { return accountSum; } - public List findAccountInOutList(Long accountId, Integer offset, Integer rows) throws Exception{ + public List findAccountInOutList(Long accountId, String number, String beginTime, String endTime, + Integer offset, Integer rows) throws Exception{ List list=null; try{ - list = accountMapperEx.findAccountInOutList(accountId, offset, rows); + list = accountMapperEx.findAccountInOutList(accountId, number, beginTime, endTime, offset, rows); }catch(Exception e){ JshException.readFail(logger, e); } return list; } - public int findAccountInOutListCount(Long accountId) throws Exception{ + public int findAccountInOutListCount(Long accountId, String number, String beginTime, String endTime) throws Exception{ int result=0; try{ - result = accountMapperEx.findAccountInOutListCount(accountId); + result = accountMapperEx.findAccountInOutListCount(accountId, number, beginTime, endTime); }catch(Exception e){ JshException.readFail(logger, e); } diff --git a/jshERP-boot/src/main/resources/mapper_xml/AccountMapperEx.xml b/jshERP-boot/src/main/resources/mapper_xml/AccountMapperEx.xml index ef036515..84b308b1 100644 --- a/jshERP-boot/src/main/resources/mapper_xml/AccountMapperEx.xml +++ b/jshERP-boot/src/main/resources/mapper_xml/AccountMapperEx.xml @@ -230,6 +230,16 @@ and dh.account_id=#{accountId} + + + and dh.number like #{bindNumber} + + + and dh.oper_time >= #{beginTime} + + + and dh.oper_time <= #{endTime} + and ifnull(dh.change_amount, 0)!=0 and ifnull(dh.delete_flag,'0') !='1' @@ -240,6 +250,16 @@ and ah.account_id=#{accountId} + + + and ah.bill_no like #{bindNumber} + + + and ah.bill_time >= #{beginTime} + + + and ah.bill_time <= #{endTime} + and ifnull(ah.change_amount, 0)!=0 and ifnull(ah.delete_flag,'0') !='1' @@ -251,6 +271,16 @@ and ai.account_id=#{accountId} + + + and ah.bill_no like #{bindNumber} + + + and ah.bill_time >= #{beginTime} + + + and ah.bill_time <= #{endTime} + and ifnull(ai.each_amount, 0)!=0 and ifnull(ah.delete_flag,'0') !='1' @@ -261,6 +291,16 @@ and ah.account_id=#{accountId} + + + and ah.bill_no like #{bindNumber} + + + and ah.bill_time >= #{beginTime} + + + and ah.bill_time <= #{endTime} + and ifnull(ah.change_amount, 0)!=0 and ifnull(ah.delete_flag,'0') !='1' @@ -271,6 +311,16 @@ and ai.account_id=#{accountId} + + + and ah.bill_no like #{bindNumber} + + + and ah.bill_time >= #{beginTime} + + + and ah.bill_time <= #{endTime} + and ifnull(ai.each_amount, 0)!=0 and ifnull(ah.delete_flag,'0') !='1' @@ -283,6 +333,16 @@ and dh.account_id_list like #{bindAccountId} + + + and dh.number like #{bindNumber} + + + and dh.oper_time >= #{beginTime} + + + and dh.oper_time <= #{endTime} + and ifnull(dh.change_amount, 0)!=0 and ifnull(dh.delete_flag,'0') !='1' ORDER BY oTime desc @@ -301,6 +361,16 @@ and dh.account_id=#{accountId} + + + and dh.number like #{bindNumber} + + + and dh.oper_time >= #{beginTime} + + + and dh.oper_time <= #{endTime} + and ifnull(dh.change_amount, 0)!=0 and ifnull(dh.delete_flag,'0') !='1' @@ -311,6 +381,16 @@ and ah.account_id=#{accountId} + + + and ah.bill_no like #{bindNumber} + + + and ah.bill_time >= #{beginTime} + + + and ah.bill_time <= #{endTime} + and ifnull(ah.change_amount, 0)!=0 and ifnull(ah.delete_flag,'0') !='1' @@ -322,6 +402,16 @@ and ai.account_id=#{accountId} + + + and ah.bill_no like #{bindNumber} + + + and ah.bill_time >= #{beginTime} + + + and ah.bill_time <= #{endTime} + and ifnull(ai.each_amount, 0)!=0 and ifnull(ah.delete_flag,'0') !='1' @@ -332,6 +422,16 @@ and ah.account_id=#{accountId} + + + and ah.bill_no like #{bindNumber} + + + and ah.bill_time >= #{beginTime} + + + and ah.bill_time <= #{endTime} + and ifnull(ah.change_amount, 0)!=0 and ifnull(ah.delete_flag,'0') !='1' @@ -342,6 +442,16 @@ and ai.account_id=#{accountId} + + + and ah.bill_no like #{bindNumber} + + + and ah.bill_time >= #{beginTime} + + + and ah.bill_time <= #{endTime} + and ifnull(ai.each_amount, 0)!=0 and ifnull(ah.delete_flag,'0') !='1' @@ -353,6 +463,16 @@ and dh.account_id_list like #{bindAccountId} + + + and dh.number like #{bindNumber} + + + and dh.oper_time >= #{beginTime} + + + and dh.oper_time <= #{endTime} + and ifnull(dh.change_amount, 0)!=0 and ifnull(dh.delete_flag,'0') !='1' ) cc