This commit is contained in:
linfso 2025-03-11 11:18:07 +08:00
parent f8e68d0929
commit 84f47a3d7d
3 changed files with 51 additions and 0 deletions

View File

@ -56,7 +56,11 @@ package com.xdadan.erp.emis.service;
public class EmisBaseService {
@Autowired
private EmisCreditCustomerMapper emisCreditCustomerMapper;
@Autowired
private EmisCreditSalesmenMapper emisCreditSalesmenMapper;
@Autowired
private ISysConfigService configService;
@ -206,6 +210,41 @@ public class EmisBaseService {
return emisExchangeRateMapper.getValidExchangeRate(from, to,rateDate);
}
/**
* 占用下单额度
* @param emisWaybill
*/
public void occupyQuotaCredit(EmisWaybill emisWaybill) throws EmisBizError {
String paymentType=emisWaybill.getPaymentType();
// 月结客户
if("2".equals(paymentType)
|| "4".equals(paymentType)
|| "5".equals(paymentType)
){
// 月结额度占用
EmisCreditCustomer queryCreditCustomer = new EmisCreditCustomer();
queryCreditCustomer.setMonthlyPayCode(emisWaybill.getCustNo());
queryCreditCustomer.getParams().put("sendDate",emisWaybill.getSendDate());
queryCreditCustomer.setTransType(emisWaybill.getTransType());
List<EmisCreditCustomer> listCreditCustomer=emisCreditCustomerMapper.selectEmisCreditCustomerList(queryCreditCustomer);
if(!CollectionUtils.isEmpty(listCreditCustomer)){
EmisCreditCustomer item0=listCreditCustomer.get(0);
if(emisWaybill.getFreight().compareTo(item0.getCurMoney()) == 1 ){
// 提示异常
throw new EmisBizError(EmisBizErrorType.FAIL, "超出信用额度");
}else{
// 扣减额度,插入扣额度数据明细
// 重算总额度
}
}
}else{
// 现金额度占用
}
}
/**

View File

@ -2296,6 +2296,13 @@ public class EmisWaybillServiceImpl extends EmisBaseService implements IEmisWayb
throw new EmisBizError(EmisBizErrorType.FAIL, "网点余额不足,请充值");
}
// 判断客户额度,现金判断现金客户,月结判断月结客户额度
// 获取月结客户现金额度
// --------------------------
// 登记网点
if(isNew) {
@ -3002,6 +3009,7 @@ public class EmisWaybillServiceImpl extends EmisBaseService implements IEmisWayb
// 公共计算部分
calcWayBillCommonInfo(emisWaybillSave,null,true);
String goodsPicsStr=emisWaybillSave.getGoodsPics();
if(!StringUtils.isEmpty(goodsPicsStr)) {
emisWaybillSave.setGoodsPics("1");

View File

@ -72,6 +72,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
and a.cur_money_rate <![CDATA[ <= ]]> #{params.endCurMoneyRate}
</if>
<if test="params.sendDate != null ">
and ( a.start_date <![CDATA[ < ]]> #{params.sendDate} ) and ( #{params.sendDate} <![CDATA[ <= ]]> a.end_date )
</if>
<if test="params.payee != null and params.payee != ''">
and b.payee = #{params.payee}
</if>