解决开启强审核之后账户流水计算的bug
This commit is contained in:
@@ -115,15 +115,15 @@ public class AccountController {
|
|||||||
BaseResponseInfo res = new BaseResponseInfo();
|
BaseResponseInfo res = new BaseResponseInfo();
|
||||||
Map<String, Object> map = new HashMap<String, Object>();
|
Map<String, Object> map = new HashMap<String, Object>();
|
||||||
try {
|
try {
|
||||||
|
Boolean forceFlag = systemConfigService.getForceApprovalFlag();
|
||||||
List<AccountVo4InOutList> dataList = accountService.findAccountInOutList(accountId, StringUtil.toNull(number),
|
List<AccountVo4InOutList> dataList = accountService.findAccountInOutList(accountId, StringUtil.toNull(number),
|
||||||
beginTime, endTime, (currentPage-1)*pageSize, pageSize);
|
beginTime, endTime, forceFlag, (currentPage-1)*pageSize, pageSize);
|
||||||
int total = accountService.findAccountInOutListCount(accountId, StringUtil.toNull(number),
|
int total = accountService.findAccountInOutListCount(accountId, StringUtil.toNull(number),
|
||||||
beginTime, endTime);
|
beginTime, endTime, forceFlag);
|
||||||
map.put("total", total);
|
map.put("total", total);
|
||||||
//存放数据json数组
|
//存放数据json数组
|
||||||
JSONArray dataArray = new JSONArray();
|
JSONArray dataArray = new JSONArray();
|
||||||
if (null != dataList) {
|
if (null != dataList) {
|
||||||
Boolean forceFlag = systemConfigService.getForceApprovalFlag();
|
|
||||||
for (AccountVo4InOutList aEx : dataList) {
|
for (AccountVo4InOutList aEx : dataList) {
|
||||||
String type = aEx.getType().replace("其它", "");
|
String type = aEx.getType().replace("其它", "");
|
||||||
aEx.setType(type);
|
aEx.setType(type);
|
||||||
|
|||||||
@@ -72,6 +72,7 @@ public interface AccountMapperEx {
|
|||||||
@Param("number") String number,
|
@Param("number") String number,
|
||||||
@Param("beginTime") String beginTime,
|
@Param("beginTime") String beginTime,
|
||||||
@Param("endTime") String endTime,
|
@Param("endTime") String endTime,
|
||||||
|
@Param("forceFlag") Boolean forceFlag,
|
||||||
@Param("offset") Integer offset,
|
@Param("offset") Integer offset,
|
||||||
@Param("rows") Integer rows);
|
@Param("rows") Integer rows);
|
||||||
|
|
||||||
@@ -79,7 +80,8 @@ public interface AccountMapperEx {
|
|||||||
@Param("accountId") Long accountId,
|
@Param("accountId") Long accountId,
|
||||||
@Param("number") String number,
|
@Param("number") String number,
|
||||||
@Param("beginTime") String beginTime,
|
@Param("beginTime") String beginTime,
|
||||||
@Param("endTime") String endTime);
|
@Param("endTime") String endTime,
|
||||||
|
@Param("forceFlag") Boolean forceFlag);
|
||||||
|
|
||||||
int batchDeleteAccountByIds(@Param("updateTime") Date updateTime, @Param("updater") Long updater, @Param("ids") String ids[]);
|
int batchDeleteAccountByIds(@Param("updateTime") Date updateTime, @Param("updater") Long updater, @Param("ids") String ids[]);
|
||||||
|
|
||||||
|
|||||||
@@ -378,20 +378,20 @@ public class AccountService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public List<AccountVo4InOutList> findAccountInOutList(Long accountId, String number, String beginTime, String endTime,
|
public List<AccountVo4InOutList> findAccountInOutList(Long accountId, String number, String beginTime, String endTime,
|
||||||
Integer offset, Integer rows) throws Exception{
|
Boolean forceFlag, Integer offset, Integer rows) throws Exception{
|
||||||
List<AccountVo4InOutList> list=null;
|
List<AccountVo4InOutList> list=null;
|
||||||
try{
|
try{
|
||||||
list = accountMapperEx.findAccountInOutList(accountId, number, beginTime, endTime, offset, rows);
|
list = accountMapperEx.findAccountInOutList(accountId, number, beginTime, endTime, forceFlag, offset, rows);
|
||||||
}catch(Exception e){
|
}catch(Exception e){
|
||||||
JshException.readFail(logger, e);
|
JshException.readFail(logger, e);
|
||||||
}
|
}
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int findAccountInOutListCount(Long accountId, String number, String beginTime, String endTime) throws Exception{
|
public int findAccountInOutListCount(Long accountId, String number, String beginTime, String endTime, Boolean forceFlag) throws Exception{
|
||||||
int result=0;
|
int result=0;
|
||||||
try{
|
try{
|
||||||
result = accountMapperEx.findAccountInOutListCount(accountId, number, beginTime, endTime);
|
result = accountMapperEx.findAccountInOutListCount(accountId, number, beginTime, endTime, forceFlag);
|
||||||
}catch(Exception e){
|
}catch(Exception e){
|
||||||
JshException.readFail(logger, e);
|
JshException.readFail(logger, e);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -87,7 +87,7 @@
|
|||||||
and dh.oper_time <= #{endTime}
|
and dh.oper_time <= #{endTime}
|
||||||
</if>
|
</if>
|
||||||
<if test="forceFlag">
|
<if test="forceFlag">
|
||||||
and dh.status = '1'
|
and (dh.status = '1' or dh.status = '2' or dh.status = '3')
|
||||||
</if>
|
</if>
|
||||||
and ifnull(dh.delete_flag,'0') !='1'
|
and ifnull(dh.delete_flag,'0') !='1'
|
||||||
</select>
|
</select>
|
||||||
@@ -143,7 +143,7 @@
|
|||||||
and dh.oper_time <= #{endTime}
|
and dh.oper_time <= #{endTime}
|
||||||
</if>
|
</if>
|
||||||
<if test="forceFlag">
|
<if test="forceFlag">
|
||||||
and dh.status = '1'
|
and (dh.status = '1' or dh.status = '2' or dh.status = '3')
|
||||||
</if>
|
</if>
|
||||||
and ifnull(dh.delete_flag,'0') !='1'
|
and ifnull(dh.delete_flag,'0') !='1'
|
||||||
</select>
|
</select>
|
||||||
@@ -160,7 +160,7 @@
|
|||||||
and dh.oper_time <= #{endTime}
|
and dh.oper_time <= #{endTime}
|
||||||
</if>
|
</if>
|
||||||
<if test="forceFlag">
|
<if test="forceFlag">
|
||||||
and dh.status = '1'
|
and (dh.status = '1' or dh.status = '2' or dh.status = '3')
|
||||||
</if>
|
</if>
|
||||||
and ifnull(dh.delete_flag,'0') !='1') accountSum,
|
and ifnull(dh.delete_flag,'0') !='1') accountSum,
|
||||||
(select ifnull(sum(ah.change_amount),0) from jsh_account_head ah
|
(select ifnull(sum(ah.change_amount),0) from jsh_account_head ah
|
||||||
@@ -217,7 +217,7 @@
|
|||||||
and dh.oper_time <= #{endTime}
|
and dh.oper_time <= #{endTime}
|
||||||
</if>
|
</if>
|
||||||
<if test="forceFlag">
|
<if test="forceFlag">
|
||||||
and dh.status = '1'
|
and (dh.status = '1' or dh.status = '2' or dh.status = '3')
|
||||||
</if>
|
</if>
|
||||||
and ifnull(dh.delete_flag,'0') !='1'
|
and ifnull(dh.delete_flag,'0') !='1'
|
||||||
</select>
|
</select>
|
||||||
@@ -240,6 +240,9 @@
|
|||||||
<if test="endTime != null and endTime !=''">
|
<if test="endTime != null and endTime !=''">
|
||||||
and dh.oper_time <= #{endTime}
|
and dh.oper_time <= #{endTime}
|
||||||
</if>
|
</if>
|
||||||
|
<if test="forceFlag">
|
||||||
|
and (dh.status = '1' or dh.status = '2' or dh.status = '3')
|
||||||
|
</if>
|
||||||
and ifnull(dh.change_amount, 0)!=0
|
and ifnull(dh.change_amount, 0)!=0
|
||||||
and ifnull(dh.delete_flag,'0') !='1'
|
and ifnull(dh.delete_flag,'0') !='1'
|
||||||
<!--主表收入和支出涉及的账户 -->
|
<!--主表收入和支出涉及的账户 -->
|
||||||
@@ -260,6 +263,9 @@
|
|||||||
<if test="endTime != null and endTime !=''">
|
<if test="endTime != null and endTime !=''">
|
||||||
and ah.bill_time <= #{endTime}
|
and ah.bill_time <= #{endTime}
|
||||||
</if>
|
</if>
|
||||||
|
<if test="forceFlag">
|
||||||
|
and ah.status = '1'
|
||||||
|
</if>
|
||||||
and ifnull(ah.change_amount, 0)!=0
|
and ifnull(ah.change_amount, 0)!=0
|
||||||
and ifnull(ah.delete_flag,'0') !='1'
|
and ifnull(ah.delete_flag,'0') !='1'
|
||||||
<!--明细中涉及的账户(收款,付款,收预付款) -->
|
<!--明细中涉及的账户(收款,付款,收预付款) -->
|
||||||
@@ -281,6 +287,9 @@
|
|||||||
<if test="endTime != null and endTime !=''">
|
<if test="endTime != null and endTime !=''">
|
||||||
and ah.bill_time <= #{endTime}
|
and ah.bill_time <= #{endTime}
|
||||||
</if>
|
</if>
|
||||||
|
<if test="forceFlag">
|
||||||
|
and ah.status = '1'
|
||||||
|
</if>
|
||||||
and ifnull(ai.each_amount, 0)!=0
|
and ifnull(ai.each_amount, 0)!=0
|
||||||
and ifnull(ah.delete_flag,'0') !='1'
|
and ifnull(ah.delete_flag,'0') !='1'
|
||||||
<!--主表中转出的账户 -->
|
<!--主表中转出的账户 -->
|
||||||
@@ -301,6 +310,9 @@
|
|||||||
<if test="endTime != null and endTime !=''">
|
<if test="endTime != null and endTime !=''">
|
||||||
and ah.bill_time <= #{endTime}
|
and ah.bill_time <= #{endTime}
|
||||||
</if>
|
</if>
|
||||||
|
<if test="forceFlag">
|
||||||
|
and ah.status = '1'
|
||||||
|
</if>
|
||||||
and ifnull(ah.change_amount, 0)!=0
|
and ifnull(ah.change_amount, 0)!=0
|
||||||
and ifnull(ah.delete_flag,'0') !='1'
|
and ifnull(ah.delete_flag,'0') !='1'
|
||||||
<!--明细中被转入的账户 -->
|
<!--明细中被转入的账户 -->
|
||||||
@@ -321,6 +333,9 @@
|
|||||||
<if test="endTime != null and endTime !=''">
|
<if test="endTime != null and endTime !=''">
|
||||||
and ah.bill_time <= #{endTime}
|
and ah.bill_time <= #{endTime}
|
||||||
</if>
|
</if>
|
||||||
|
<if test="forceFlag">
|
||||||
|
and ah.status = '1'
|
||||||
|
</if>
|
||||||
and ifnull(ai.each_amount, 0)!=0
|
and ifnull(ai.each_amount, 0)!=0
|
||||||
and ifnull(ah.delete_flag,'0') !='1'
|
and ifnull(ah.delete_flag,'0') !='1'
|
||||||
<!--多账户的情况 -->
|
<!--多账户的情况 -->
|
||||||
@@ -343,6 +358,9 @@
|
|||||||
<if test="endTime != null and endTime !=''">
|
<if test="endTime != null and endTime !=''">
|
||||||
and dh.oper_time <= #{endTime}
|
and dh.oper_time <= #{endTime}
|
||||||
</if>
|
</if>
|
||||||
|
<if test="forceFlag">
|
||||||
|
and (dh.status = '1' or dh.status = '2' or dh.status = '3')
|
||||||
|
</if>
|
||||||
and ifnull(dh.change_amount, 0)!=0
|
and ifnull(dh.change_amount, 0)!=0
|
||||||
and ifnull(dh.delete_flag,'0') !='1'
|
and ifnull(dh.delete_flag,'0') !='1'
|
||||||
ORDER BY oTime desc
|
ORDER BY oTime desc
|
||||||
@@ -371,6 +389,9 @@
|
|||||||
<if test="endTime != null and endTime !=''">
|
<if test="endTime != null and endTime !=''">
|
||||||
and dh.oper_time <= #{endTime}
|
and dh.oper_time <= #{endTime}
|
||||||
</if>
|
</if>
|
||||||
|
<if test="forceFlag">
|
||||||
|
and (dh.status = '1' or dh.status = '2' or dh.status = '3')
|
||||||
|
</if>
|
||||||
and ifnull(dh.change_amount, 0)!=0
|
and ifnull(dh.change_amount, 0)!=0
|
||||||
and ifnull(dh.delete_flag,'0') !='1'
|
and ifnull(dh.delete_flag,'0') !='1'
|
||||||
<!--主表收入和支出涉及的账户 -->
|
<!--主表收入和支出涉及的账户 -->
|
||||||
@@ -391,6 +412,9 @@
|
|||||||
<if test="endTime != null and endTime !=''">
|
<if test="endTime != null and endTime !=''">
|
||||||
and ah.bill_time <= #{endTime}
|
and ah.bill_time <= #{endTime}
|
||||||
</if>
|
</if>
|
||||||
|
<if test="forceFlag">
|
||||||
|
and ah.status = '1'
|
||||||
|
</if>
|
||||||
and ifnull(ah.change_amount, 0)!=0
|
and ifnull(ah.change_amount, 0)!=0
|
||||||
and ifnull(ah.delete_flag,'0') !='1'
|
and ifnull(ah.delete_flag,'0') !='1'
|
||||||
<!--明细中涉及的账户(收款,付款,收预付款) -->
|
<!--明细中涉及的账户(收款,付款,收预付款) -->
|
||||||
@@ -412,6 +436,9 @@
|
|||||||
<if test="endTime != null and endTime !=''">
|
<if test="endTime != null and endTime !=''">
|
||||||
and ah.bill_time <= #{endTime}
|
and ah.bill_time <= #{endTime}
|
||||||
</if>
|
</if>
|
||||||
|
<if test="forceFlag">
|
||||||
|
and ah.status = '1'
|
||||||
|
</if>
|
||||||
and ifnull(ai.each_amount, 0)!=0
|
and ifnull(ai.each_amount, 0)!=0
|
||||||
and ifnull(ah.delete_flag,'0') !='1'
|
and ifnull(ah.delete_flag,'0') !='1'
|
||||||
<!--主表中转出的账户 -->
|
<!--主表中转出的账户 -->
|
||||||
@@ -432,6 +459,9 @@
|
|||||||
<if test="endTime != null and endTime !=''">
|
<if test="endTime != null and endTime !=''">
|
||||||
and ah.bill_time <= #{endTime}
|
and ah.bill_time <= #{endTime}
|
||||||
</if>
|
</if>
|
||||||
|
<if test="forceFlag">
|
||||||
|
and ah.status = '1'
|
||||||
|
</if>
|
||||||
and ifnull(ah.change_amount, 0)!=0
|
and ifnull(ah.change_amount, 0)!=0
|
||||||
and ifnull(ah.delete_flag,'0') !='1'
|
and ifnull(ah.delete_flag,'0') !='1'
|
||||||
<!--明细中被转入的账户 -->
|
<!--明细中被转入的账户 -->
|
||||||
@@ -452,6 +482,9 @@
|
|||||||
<if test="endTime != null and endTime !=''">
|
<if test="endTime != null and endTime !=''">
|
||||||
and ah.bill_time <= #{endTime}
|
and ah.bill_time <= #{endTime}
|
||||||
</if>
|
</if>
|
||||||
|
<if test="forceFlag">
|
||||||
|
and ah.status = '1'
|
||||||
|
</if>
|
||||||
and ifnull(ai.each_amount, 0)!=0
|
and ifnull(ai.each_amount, 0)!=0
|
||||||
and ifnull(ah.delete_flag,'0') !='1'
|
and ifnull(ah.delete_flag,'0') !='1'
|
||||||
<!--多账户的情况 -->
|
<!--多账户的情况 -->
|
||||||
@@ -473,6 +506,9 @@
|
|||||||
<if test="endTime != null and endTime !=''">
|
<if test="endTime != null and endTime !=''">
|
||||||
and dh.oper_time <= #{endTime}
|
and dh.oper_time <= #{endTime}
|
||||||
</if>
|
</if>
|
||||||
|
<if test="forceFlag">
|
||||||
|
and (dh.status = '1' or dh.status = '2' or dh.status = '3')
|
||||||
|
</if>
|
||||||
and ifnull(dh.change_amount, 0)!=0
|
and ifnull(dh.change_amount, 0)!=0
|
||||||
and ifnull(dh.delete_flag,'0') !='1'
|
and ifnull(dh.delete_flag,'0') !='1'
|
||||||
) cc
|
) cc
|
||||||
|
|||||||
Reference in New Issue
Block a user