|
|
|
@@ -661,7 +661,11 @@ public class WxFinanceServiceImpl implements WxFinanceService { |
|
|
|
|
|
|
|
@Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = {Exception.class}) |
|
|
|
@Override |
|
|
|
public void invalidReceive(WxFinanceReceive record, MallUserInfo user) { |
|
|
|
public void invalidReceive(WxFinanceReceive record, MallUserInfo user,String remark) { |
|
|
|
invalidReceive(record, user, false); |
|
|
|
} |
|
|
|
|
|
|
|
public void invalidReceive(WxFinanceReceive record, MallUserInfo user,boolean isRedSetoff) { |
|
|
|
//如果自身是预充单,则被冲抵了就不能作废 |
|
|
|
if (record.getType().intValue() == EnumFinanceReceiveType.ADVANCE.getCode().intValue()) { |
|
|
|
WxFinanceReceiveSetoff rsq0 = new WxFinanceReceiveSetoff(); |
|
|
|
@@ -673,7 +677,6 @@ public class WxFinanceServiceImpl implements WxFinanceService { |
|
|
|
throw new MallinkException(ErrorCode.SYS_SERVER_ERROR.getCode(),"存在关联的冲抵单,请先处理"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
//主收款单作废 |
|
|
|
record.setStatus(EnumFinanceReceiveStatus.INVALID.getCode()); |
|
|
|
record.setUpdateTime(new Date()); |
|
|
|
@@ -706,7 +709,11 @@ public class WxFinanceServiceImpl implements WxFinanceService { |
|
|
|
payDto.setId(bill.getId()); |
|
|
|
payDto.setBillTypeValue(bill.getBillType()); |
|
|
|
payDto.setAddpay(rb.getReceive()); |
|
|
|
payDto.setRemark("收款单作废,系统自动退回"); |
|
|
|
if (isRedSetoff) { |
|
|
|
payDto.setRemark("收款单红冲,自动回退"); |
|
|
|
}else { |
|
|
|
payDto.setRemark("收款单作废,自动回退"); |
|
|
|
} |
|
|
|
wxBillAllHelper.backPay(payDto, user); |
|
|
|
|
|
|
|
}else { |
|
|
|
@@ -740,12 +747,19 @@ public class WxFinanceServiceImpl implements WxFinanceService { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
@Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = {Exception.class}) |
|
|
|
@Override |
|
|
|
public void redSetoffReceive(WxFinanceReceive record, MallUserInfo user) { |
|
|
|
//红冲 |
|
|
|
invalidReceive(record, user , true); |
|
|
|
//新增一个红冲,金额是负数 |
|
|
|
final IdWorker idWorker = IdWorker.get(); |
|
|
|
record.setId(idWorker.nextId()); |
|
|
|
record.setReceiveMoney("-"+record.getReceiveMoney()); |
|
|
|
record.setSetOffMoney("-"+record.getSetOffMoney()); |
|
|
|
record.setStatus(EnumFinanceReceiveStatus.RED_SETOFF.getCode()); |
|
|
|
wxFinanceReceiveMapper.insert(record); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|