|
@@ -2,6 +2,7 @@ package com.idea.invoice.service;
|
|
|
|
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
|
import cn.hutool.core.util.IdUtil;
|
|
|
+import cn.hutool.core.util.ObjectUtil;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.github.pagehelper.PageHelper;
|
|
|
import com.github.pagehelper.PageInfo;
|
|
@@ -137,11 +138,10 @@ public class InvoiceManageService implements BaseService<InvoiceManage, InvoiceM
|
|
|
PageHelper.startPage(tablepar.getPageNum(), tablepar.getPageSize());
|
|
|
List<InvoiceManageDto> list = extendMapper.listByModel(model);
|
|
|
for(InvoiceManageDto invoiceManage : list){
|
|
|
- BigDecimal totalPrice = invoiceManage.getTotalPrice();
|
|
|
- BigDecimal maintenanceTotalPrice = invoiceManage.getMaintenanceTotalPrice();
|
|
|
- String money = payLogService.getMoneyByContractId(invoiceManage.getContractId(), null);
|
|
|
- invoiceManage.setReceivableMoney(totalPrice.add(maintenanceTotalPrice));
|
|
|
- invoiceManage.setReceivedMoney(new BigDecimal(money));
|
|
|
+// String money = payLogService.getMoneyByContractId(invoiceManage.getContractId(), null);
|
|
|
+// invoiceManage.setReceivedMoney(new BigDecimal(money));
|
|
|
+ // 预收款发票 已收金额
|
|
|
+ invoiceManage.setReceivedMoney(invoiceManage.getInvoiceAmount());
|
|
|
}
|
|
|
return new PageInfo<>(list);
|
|
|
}
|
|
@@ -191,7 +191,7 @@ public class InvoiceManageService implements BaseService<InvoiceManage, InvoiceM
|
|
|
// 房款
|
|
|
if(invoiceManage.getPaymentType().equals("1")){
|
|
|
money = payLogService.getMoneyByContractId(invoiceManage.getContractId(), 1);
|
|
|
- invoiceManage.setReceivableMoney(invoiceManage.getTotalPrice());
|
|
|
+ invoiceManage.setReceivableMoney(invoiceManage.getBuyerMoney());
|
|
|
}
|
|
|
// 专项维修资金
|
|
|
if(invoiceManage.getPaymentType().equals("2")){
|
|
@@ -208,7 +208,7 @@ public class InvoiceManageService implements BaseService<InvoiceManage, InvoiceM
|
|
|
* @param contractId
|
|
|
* @return
|
|
|
*/
|
|
|
- public InvoiceManageDto getInfoByContract(String contractId,String invoiceGoodsName){
|
|
|
+ public InvoiceManageDto getInfoByContract(String contractId,String invoiceGoodsName,Integer payType){
|
|
|
|
|
|
InvoiceManageDto invoiceManage = new InvoiceManageDto();
|
|
|
// 合同信息
|
|
@@ -228,7 +228,12 @@ public class InvoiceManageService implements BaseService<InvoiceManage, InvoiceM
|
|
|
}
|
|
|
}
|
|
|
PayLogExample payLogExample = new PayLogExample();
|
|
|
- payLogExample.createCriteria().andContractIdEqualTo(contractId).andStatusEqualTo(0);
|
|
|
+ PayLogExample.Criteria criteria = payLogExample.createCriteria();
|
|
|
+ criteria.andContractIdEqualTo(contractId)
|
|
|
+ .andStatusEqualTo(0);
|
|
|
+ if(ObjectUtil.isNotNull(payType)){
|
|
|
+ criteria.andPayTypeEqualTo(payType);
|
|
|
+ }
|
|
|
List<PayLog> payLogs = payLogService.selectByExample(payLogExample);
|
|
|
BigDecimal money = BigDecimal.ZERO;
|
|
|
for(PayLog payLog : payLogs){
|