md
This commit is contained in:
parent
8037769dc3
commit
dabe275d9d
@ -22,6 +22,7 @@ import com.xdadan.erp.emis.mapper.EmisSettleBillMapper;
|
|||||||
import com.xdadan.erp.emis.mapper.EmisSettleSubBillMapper;
|
import com.xdadan.erp.emis.mapper.EmisSettleSubBillMapper;
|
||||||
import com.xdadan.erp.emis.service.EmisBaseService;
|
import com.xdadan.erp.emis.service.EmisBaseService;
|
||||||
import com.xdadan.erp.emis.utils.WaybillHelper;
|
import com.xdadan.erp.emis.utils.WaybillHelper;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
@ -35,6 +36,7 @@ import com.xdadan.erp.emis.service.IEmisSettlePayRecordService;
|
|||||||
* @author linfso
|
* @author linfso
|
||||||
* @date 2024-07-21 13:31:24
|
* @date 2024-07-21 13:31:24
|
||||||
*/
|
*/
|
||||||
|
@Slf4j
|
||||||
@Service
|
@Service
|
||||||
public class EmisSettlePayRecordServiceImpl extends EmisBaseService implements IEmisSettlePayRecordService
|
public class EmisSettlePayRecordServiceImpl extends EmisBaseService implements IEmisSettlePayRecordService
|
||||||
{
|
{
|
||||||
@ -148,20 +150,27 @@ public class EmisSettlePayRecordServiceImpl extends EmisBaseService implements I
|
|||||||
/* other_money */
|
/* other_money */
|
||||||
BigDecimal otherMoney = BigDecimal.ZERO;
|
BigDecimal otherMoney = BigDecimal.ZERO;
|
||||||
|
|
||||||
|
log.debug("收款状态更新===>应收:{}",oldBill.getRecMoney());
|
||||||
|
|
||||||
for(EmisSettlePayRecord item:payRecordList){
|
for(EmisSettlePayRecord item:payRecordList){
|
||||||
totalPayMoney=totalPayMoney.add(item.getPayMoney());
|
totalPayMoney=totalPayMoney.add(item.getPayMoney());
|
||||||
satisfyMoney=satisfyMoney.add(item.getSatisfyMoney()==null?BigDecimal.ZERO:item.getSatisfyMoney());
|
satisfyMoney=satisfyMoney.add(item.getSatisfyMoney()==null?BigDecimal.ZERO:item.getSatisfyMoney());
|
||||||
allowanceMoney=allowanceMoney.add(item.getAllowanceMoney()==null?BigDecimal.ZERO:item.getAllowanceMoney());
|
allowanceMoney=allowanceMoney.add(item.getAllowanceMoney()==null?BigDecimal.ZERO:item.getAllowanceMoney());
|
||||||
deductionMoney=deductionMoney.add(item.getDeductionMoney()==null?BigDecimal.ZERO:item.getDeductionMoney());
|
deductionMoney=deductionMoney.add(item.getDeductionMoney()==null?BigDecimal.ZERO:item.getDeductionMoney());
|
||||||
otherMoney=otherMoney.add(item.getOtherMoney()==null?BigDecimal.ZERO:item.getOtherMoney());
|
otherMoney=otherMoney.add(item.getOtherMoney()==null?BigDecimal.ZERO:item.getOtherMoney());
|
||||||
|
|
||||||
totalAllPayMoney=totalAllPayMoney.add(totalPayMoney);
|
|
||||||
totalAllPayMoney=totalAllPayMoney.add(satisfyMoney);
|
|
||||||
totalAllPayMoney=totalAllPayMoney.add(allowanceMoney);
|
|
||||||
totalAllPayMoney=totalAllPayMoney.add(deductionMoney);
|
|
||||||
totalAllPayMoney=totalAllPayMoney.add(otherMoney);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 总应收金额
|
||||||
|
log.debug("收款状态更新===>totalPayMoney:{},satisfyMoney:{},allowanceMoney:{},deductionMoney:{},otherMoney:{}"
|
||||||
|
,totalPayMoney,satisfyMoney,allowanceMoney,allowanceMoney,deductionMoney,otherMoney);
|
||||||
|
|
||||||
|
totalAllPayMoney=totalAllPayMoney
|
||||||
|
.add(totalPayMoney)
|
||||||
|
.add(satisfyMoney)
|
||||||
|
.add(allowanceMoney)
|
||||||
|
.add(deductionMoney)
|
||||||
|
.add(otherMoney);
|
||||||
|
|
||||||
EmisSettleBill newBill = new EmisSettleBill();
|
EmisSettleBill newBill = new EmisSettleBill();
|
||||||
newBill.setId(oldBill.getId());
|
newBill.setId(oldBill.getId());
|
||||||
newBill.setRecedMoney(totalPayMoney);
|
newBill.setRecedMoney(totalPayMoney);
|
||||||
@ -171,6 +180,7 @@ public class EmisSettlePayRecordServiceImpl extends EmisBaseService implements I
|
|||||||
|
|
||||||
// 判断收款状态 收款金额
|
// 判断收款状态 收款金额
|
||||||
int rstDif=totalAllPayMoney.compareTo(oldBill.getRecMoney());
|
int rstDif=totalAllPayMoney.compareTo(oldBill.getRecMoney());
|
||||||
|
log.debug("收款状态更新===>收款总金额:{},应收:{},rsDif:{}",totalAllPayMoney,oldBill.getRecMoney(),rstDif);
|
||||||
if( rstDif >= 0 ){
|
if( rstDif >= 0 ){
|
||||||
// 已收款
|
// 已收款
|
||||||
newBill.setPaymentStatus("1");
|
newBill.setPaymentStatus("1");
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user