给账户流水接口增加筛选条件
This commit is contained in:
@@ -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<String, Object> map = new HashMap<String, Object>();
|
||||
try {
|
||||
List<AccountVo4InOutList> dataList = accountService.findAccountInOutList(accountId, (currentPage-1)*pageSize, pageSize);
|
||||
int total = accountService.findAccountInOutListCount(accountId);
|
||||
List<AccountVo4InOutList> 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);
|
||||
|
||||
@@ -69,11 +69,17 @@ public interface AccountMapperEx {
|
||||
|
||||
List<AccountVo4InOutList> 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[]);
|
||||
|
||||
|
||||
@@ -377,20 +377,21 @@ public class AccountService {
|
||||
return accountSum;
|
||||
}
|
||||
|
||||
public List<AccountVo4InOutList> findAccountInOutList(Long accountId, Integer offset, Integer rows) throws Exception{
|
||||
public List<AccountVo4InOutList> findAccountInOutList(Long accountId, String number, String beginTime, String endTime,
|
||||
Integer offset, Integer rows) throws Exception{
|
||||
List<AccountVo4InOutList> 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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user