给对账接口增加欠款的筛选参数
This commit is contained in:
@@ -308,6 +308,7 @@ public class DepotHeadController {
|
|||||||
* @param beginTime
|
* @param beginTime
|
||||||
* @param endTime
|
* @param endTime
|
||||||
* @param organId
|
* @param organId
|
||||||
|
* @param hasDebt 1-有欠款 0-无欠款
|
||||||
* @param supplierType
|
* @param supplierType
|
||||||
* @param request
|
* @param request
|
||||||
* @return
|
* @return
|
||||||
@@ -319,6 +320,7 @@ public class DepotHeadController {
|
|||||||
@RequestParam("beginTime") String beginTime,
|
@RequestParam("beginTime") String beginTime,
|
||||||
@RequestParam("endTime") String endTime,
|
@RequestParam("endTime") String endTime,
|
||||||
@RequestParam(value = "organId", required = false) Integer organId,
|
@RequestParam(value = "organId", required = false) Integer organId,
|
||||||
|
@RequestParam(value = "hasDebt", required = false) Integer hasDebt,
|
||||||
@RequestParam("supplierType") String supplierType,
|
@RequestParam("supplierType") String supplierType,
|
||||||
HttpServletRequest request) throws Exception{
|
HttpServletRequest request) throws Exception{
|
||||||
BaseResponseInfo res = new BaseResponseInfo();
|
BaseResponseInfo res = new BaseResponseInfo();
|
||||||
@@ -346,9 +348,9 @@ public class DepotHeadController {
|
|||||||
beginTime = Tools.parseDayToTime(beginTime,BusinessConstants.DAY_FIRST_TIME);
|
beginTime = Tools.parseDayToTime(beginTime,BusinessConstants.DAY_FIRST_TIME);
|
||||||
endTime = Tools.parseDayToTime(endTime,BusinessConstants.DAY_LAST_TIME);
|
endTime = Tools.parseDayToTime(endTime,BusinessConstants.DAY_LAST_TIME);
|
||||||
List<DepotHeadVo4StatementAccount> list = depotHeadService.getStatementAccount(beginTime, endTime, organId, organArray,
|
List<DepotHeadVo4StatementAccount> list = depotHeadService.getStatementAccount(beginTime, endTime, organId, organArray,
|
||||||
supplierType, type, subType,typeBack, subTypeBack, billType, (currentPage-1)*pageSize, pageSize);
|
hasDebt, supplierType, type, subType,typeBack, subTypeBack, billType, (currentPage-1)*pageSize, pageSize);
|
||||||
int total = depotHeadService.getStatementAccountCount(beginTime, endTime, organId, organArray,
|
int total = depotHeadService.getStatementAccountCount(beginTime, endTime, organId, organArray,
|
||||||
supplierType, type, subType,typeBack, subTypeBack, billType);
|
hasDebt, supplierType, type, subType,typeBack, subTypeBack, billType);
|
||||||
for(DepotHeadVo4StatementAccount item: list) {
|
for(DepotHeadVo4StatementAccount item: list) {
|
||||||
//期初 = 起始期初金额+上期欠款金额-上期退货的欠款金额-上期收付款
|
//期初 = 起始期初金额+上期欠款金额-上期退货的欠款金额-上期收付款
|
||||||
BigDecimal preNeed = item.getBeginNeed().add(item.getPreDebtMoney()).subtract(item.getPreReturnDebtMoney()).subtract(item.getPreBackMoney());
|
BigDecimal preNeed = item.getBeginNeed().add(item.getPreDebtMoney()).subtract(item.getPreReturnDebtMoney()).subtract(item.getPreBackMoney());
|
||||||
@@ -363,7 +365,7 @@ public class DepotHeadController {
|
|||||||
map.put("rows", list);
|
map.put("rows", list);
|
||||||
map.put("total", total);
|
map.put("total", total);
|
||||||
List<DepotHeadVo4StatementAccount> totalPayList = depotHeadService.getStatementAccountTotalPay(beginTime, endTime, organId, organArray,
|
List<DepotHeadVo4StatementAccount> totalPayList = depotHeadService.getStatementAccountTotalPay(beginTime, endTime, organId, organArray,
|
||||||
supplierType, type, subType, typeBack, subTypeBack, billType);
|
hasDebt, supplierType, type, subType, typeBack, subTypeBack, billType);
|
||||||
if(totalPayList.size()>0) {
|
if(totalPayList.size()>0) {
|
||||||
DepotHeadVo4StatementAccount totalPayItem = totalPayList.get(0);
|
DepotHeadVo4StatementAccount totalPayItem = totalPayList.get(0);
|
||||||
BigDecimal firstMoney = BigDecimal.ZERO;
|
BigDecimal firstMoney = BigDecimal.ZERO;
|
||||||
|
|||||||
@@ -199,6 +199,7 @@ public interface DepotHeadMapperEx {
|
|||||||
@Param("endTime") String endTime,
|
@Param("endTime") String endTime,
|
||||||
@Param("organId") Integer organId,
|
@Param("organId") Integer organId,
|
||||||
@Param("organArray") String[] organArray,
|
@Param("organArray") String[] organArray,
|
||||||
|
@Param("hasDebt") Integer hasDebt,
|
||||||
@Param("supplierType") String supplierType,
|
@Param("supplierType") String supplierType,
|
||||||
@Param("type") String type,
|
@Param("type") String type,
|
||||||
@Param("subType") String subType,
|
@Param("subType") String subType,
|
||||||
@@ -213,6 +214,7 @@ public interface DepotHeadMapperEx {
|
|||||||
@Param("endTime") String endTime,
|
@Param("endTime") String endTime,
|
||||||
@Param("organId") Integer organId,
|
@Param("organId") Integer organId,
|
||||||
@Param("organArray") String[] organArray,
|
@Param("organArray") String[] organArray,
|
||||||
|
@Param("hasDebt") Integer hasDebt,
|
||||||
@Param("supplierType") String supplierType,
|
@Param("supplierType") String supplierType,
|
||||||
@Param("type") String type,
|
@Param("type") String type,
|
||||||
@Param("subType") String subType,
|
@Param("subType") String subType,
|
||||||
@@ -225,6 +227,7 @@ public interface DepotHeadMapperEx {
|
|||||||
@Param("endTime") String endTime,
|
@Param("endTime") String endTime,
|
||||||
@Param("organId") Integer organId,
|
@Param("organId") Integer organId,
|
||||||
@Param("organArray") String[] organArray,
|
@Param("organArray") String[] organArray,
|
||||||
|
@Param("hasDebt") Integer hasDebt,
|
||||||
@Param("supplierType") String supplierType,
|
@Param("supplierType") String supplierType,
|
||||||
@Param("type") String type,
|
@Param("type") String type,
|
||||||
@Param("subType") String subType,
|
@Param("subType") String subType,
|
||||||
|
|||||||
@@ -848,33 +848,34 @@ public class DepotHeadService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public List<DepotHeadVo4StatementAccount> getStatementAccount(String beginTime, String endTime, Integer organId, String [] organArray,
|
public List<DepotHeadVo4StatementAccount> getStatementAccount(String beginTime, String endTime, Integer organId, String [] organArray,
|
||||||
String supplierType, String type, String subType, String typeBack, String subTypeBack, String billType, Integer offset, Integer rows) {
|
Integer hasDebt, String supplierType, String type, String subType, String typeBack,
|
||||||
|
String subTypeBack, String billType, Integer offset, Integer rows) {
|
||||||
List<DepotHeadVo4StatementAccount> list = null;
|
List<DepotHeadVo4StatementAccount> list = null;
|
||||||
try{
|
try{
|
||||||
list = depotHeadMapperEx.getStatementAccount(beginTime, endTime, organId, organArray, supplierType, type, subType,typeBack, subTypeBack, billType, offset, rows);
|
list = depotHeadMapperEx.getStatementAccount(beginTime, endTime, organId, organArray, hasDebt, supplierType, type, subType,typeBack, subTypeBack, billType, offset, rows);
|
||||||
} catch(Exception e){
|
} catch(Exception e){
|
||||||
JshException.readFail(logger, e);
|
JshException.readFail(logger, e);
|
||||||
}
|
}
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getStatementAccountCount(String beginTime, String endTime, Integer organId,
|
public int getStatementAccountCount(String beginTime, String endTime, Integer organId, String [] organArray,
|
||||||
String [] organArray, String supplierType, String type, String subType, String typeBack, String subTypeBack, String billType) {
|
Integer hasDebt, String supplierType, String type, String subType, String typeBack, String subTypeBack, String billType) {
|
||||||
int result = 0;
|
int result = 0;
|
||||||
try{
|
try{
|
||||||
result = depotHeadMapperEx.getStatementAccountCount(beginTime, endTime, organId, organArray, supplierType, type, subType,typeBack, subTypeBack, billType);
|
result = depotHeadMapperEx.getStatementAccountCount(beginTime, endTime, organId, organArray, hasDebt, supplierType, type, subType,typeBack, subTypeBack, billType);
|
||||||
} catch(Exception e){
|
} catch(Exception e){
|
||||||
JshException.readFail(logger, e);
|
JshException.readFail(logger, e);
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<DepotHeadVo4StatementAccount> getStatementAccountTotalPay(String beginTime, String endTime, Integer organId,
|
public List<DepotHeadVo4StatementAccount> getStatementAccountTotalPay(String beginTime, String endTime, Integer organId, String [] organArray,
|
||||||
String [] organArray, String supplierType,
|
Integer hasDebt, String supplierType, String type, String subType,
|
||||||
String type, String subType, String typeBack, String subTypeBack, String billType) {
|
String typeBack, String subTypeBack, String billType) {
|
||||||
List<DepotHeadVo4StatementAccount> list = null;
|
List<DepotHeadVo4StatementAccount> list = null;
|
||||||
try{
|
try{
|
||||||
list = depotHeadMapperEx.getStatementAccountTotalPay(beginTime, endTime, organId, organArray, supplierType, type, subType,typeBack, subTypeBack, billType);
|
list = depotHeadMapperEx.getStatementAccountTotalPay(beginTime, endTime, organId, organArray, hasDebt, supplierType, type, subType,typeBack, subTypeBack, billType);
|
||||||
} catch(Exception e){
|
} catch(Exception e){
|
||||||
JshException.readFail(logger, e);
|
JshException.readFail(logger, e);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -126,7 +126,7 @@ public class SupplierService {
|
|||||||
billType = "收款";
|
billType = "收款";
|
||||||
}
|
}
|
||||||
List<DepotHeadVo4StatementAccount> saList = depotHeadService.getStatementAccount(beginTime, endTime, supplierId, null,
|
List<DepotHeadVo4StatementAccount> saList = depotHeadService.getStatementAccount(beginTime, endTime, supplierId, null,
|
||||||
supplierType, inOutType, subType, typeBack, subTypeBack, billType, null, null);
|
1, supplierType, inOutType, subType, typeBack, subTypeBack, billType, null, null);
|
||||||
if(saList.size()>0) {
|
if(saList.size()>0) {
|
||||||
DepotHeadVo4StatementAccount item = saList.get(0);
|
DepotHeadVo4StatementAccount item = saList.get(0);
|
||||||
//期初 = 起始期初金额+上期欠款金额-上期退货的欠款金额-上期收付款
|
//期初 = 起始期初金额+上期欠款金额-上期退货的欠款金额-上期收付款
|
||||||
|
|||||||
@@ -900,7 +900,12 @@
|
|||||||
)
|
)
|
||||||
</if>
|
</if>
|
||||||
and ifnull(s.delete_flag,'0') !='1') tb
|
and ifnull(s.delete_flag,'0') !='1') tb
|
||||||
where begin_need+preDebtMoney-preReturnDebtMoney-preBackMoney+debtMoney-returnDebtMoney-backMoney!=0
|
<if test="hasDebt == 1">
|
||||||
|
where begin_need+preDebtMoney-preReturnDebtMoney-preBackMoney+debtMoney-returnDebtMoney-backMoney!=0
|
||||||
|
</if>
|
||||||
|
<if test="hasDebt == 0">
|
||||||
|
where begin_need+preDebtMoney-preReturnDebtMoney-preBackMoney+debtMoney-returnDebtMoney-backMoney=0
|
||||||
|
</if>
|
||||||
order by begin_need+preDebtMoney-preReturnDebtMoney-preBackMoney+debtMoney-returnDebtMoney-backMoney desc
|
order by begin_need+preDebtMoney-preReturnDebtMoney-preBackMoney+debtMoney-returnDebtMoney-backMoney desc
|
||||||
<if test="offset != null and rows != null">
|
<if test="offset != null and rows != null">
|
||||||
limit #{offset},#{rows}
|
limit #{offset},#{rows}
|
||||||
@@ -970,7 +975,12 @@
|
|||||||
)
|
)
|
||||||
</if>
|
</if>
|
||||||
and ifnull(s.delete_flag,'0') !='1') tb
|
and ifnull(s.delete_flag,'0') !='1') tb
|
||||||
where begin_need+preDebtMoney-preReturnDebtMoney-preBackMoney+debtMoney-returnDebtMoney-backMoney!=0
|
<if test="hasDebt == 1">
|
||||||
|
where begin_need+preDebtMoney-preReturnDebtMoney-preBackMoney+debtMoney-returnDebtMoney-backMoney!=0
|
||||||
|
</if>
|
||||||
|
<if test="hasDebt == 0">
|
||||||
|
where begin_need+preDebtMoney-preReturnDebtMoney-preBackMoney+debtMoney-returnDebtMoney-backMoney=0
|
||||||
|
</if>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getStatementAccountTotalPay" resultType="com.jsh.erp.datasource.vo.DepotHeadVo4StatementAccount">
|
<select id="getStatementAccountTotalPay" resultType="com.jsh.erp.datasource.vo.DepotHeadVo4StatementAccount">
|
||||||
@@ -1030,7 +1040,12 @@
|
|||||||
)
|
)
|
||||||
</if>
|
</if>
|
||||||
and ifnull(s.delete_flag,'0') !='1') tb
|
and ifnull(s.delete_flag,'0') !='1') tb
|
||||||
where begin_need+preDebtMoney-preReturnDebtMoney-preBackMoney+debtMoney-returnDebtMoney-backMoney!=0
|
<if test="hasDebt == 1">
|
||||||
|
where begin_need+preDebtMoney-preReturnDebtMoney-preBackMoney+debtMoney-returnDebtMoney-backMoney!=0
|
||||||
|
</if>
|
||||||
|
<if test="hasDebt == 0">
|
||||||
|
where begin_need+preDebtMoney-preReturnDebtMoney-preBackMoney+debtMoney-returnDebtMoney-backMoney=0
|
||||||
|
</if>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getDetailByNumber" parameterType="com.jsh.erp.datasource.entities.DepotHeadExample" resultMap="ResultMapEx">
|
<select id="getDetailByNumber" parameterType="com.jsh.erp.datasource.entities.DepotHeadExample" resultMap="ResultMapEx">
|
||||||
|
|||||||
Reference in New Issue
Block a user