优化对账单的接口逻辑
This commit is contained in:
@@ -529,10 +529,6 @@ public class DepotHeadService {
|
||||
allPrice = BigDecimal.ZERO.subtract(p1);
|
||||
} else if (type.equals("付款")) {
|
||||
allPrice = p1;
|
||||
} else if (type.equals("收入")) {
|
||||
allPrice = p1.subtract(p2);
|
||||
} else if (type.equals("支出")) {
|
||||
allPrice = p2.subtract(p1);
|
||||
}
|
||||
dha.setBillMoney(p1); //单据金额
|
||||
dha.setChangeAmount(p2); //实际支付
|
||||
|
||||
@@ -462,13 +462,13 @@
|
||||
select ah.bill_no number,ah.type as newType,ah.total_price discount_last_money, 0 other_money,ah.change_amount,s.supplier supplierName,
|
||||
date_format(ah.bill_time,'%Y-%m-%d %H:%i:%S') as oTime from jsh_account_head ah
|
||||
left join jsh_supplier s on s.id=ah.organ_id and ifnull(s.delete_Flag,'0') !='1'
|
||||
where s.type=#{supType}
|
||||
where s.type=#{supType} and (ah.type='收款' or ah.type='付款')
|
||||
and ah.bill_time >=#{beginTime} and ah.bill_time <=#{endTime}
|
||||
<if test="organId != null">
|
||||
and ah.organ_id=#{organId}
|
||||
</if>
|
||||
and ifnull(ah.delete_flag,'0') !='1'
|
||||
ORDER BY oTime
|
||||
ORDER BY oTime desc
|
||||
<if test="offset != null and rows != null">
|
||||
limit #{offset},#{rows}
|
||||
</if>
|
||||
@@ -488,7 +488,7 @@
|
||||
UNION ALL
|
||||
select count(1) a from jsh_account_head ah
|
||||
left join jsh_supplier s on s.id=ah.organ_id and ifnull(s.delete_Flag,'0') !='1'
|
||||
where s.type=#{supType}
|
||||
where s.type=#{supType} and (ah.type='收款' or ah.type='付款')
|
||||
and ah.bill_time >=#{beginTime} and ah.bill_time <=#{endTime}
|
||||
<if test="organId != null">
|
||||
and ah.organ_id=#{organId}
|
||||
|
||||
Reference in New Issue
Block a user