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