mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-06-12 19:29:52 +08:00
update 更新记录
This commit is contained in:
@@ -1068,37 +1068,40 @@ public class AdapayUnsplitRecordHandleServiceImpl implements AdapayUnsplitRecord
|
||||
return latestRemaining.compareTo(BigDecimal.ZERO) > 0 ? latestRemaining : BigDecimal.ZERO;
|
||||
}
|
||||
|
||||
private AdapayUnsplitRecord buildUpdateRecordByPaymentId(String paymentId) {
|
||||
List<AdapayUnsplitRecord> existingRecords = adapayUnsplitRecordService.selectByPaymentIds(Lists.newArrayList(paymentId));
|
||||
AdapayUnsplitRecord record = new AdapayUnsplitRecord();
|
||||
record.setPaymentId(paymentId);
|
||||
record.setUpdateTime(DateUtils.getNowDate());
|
||||
if (CollectionUtils.isNotEmpty(existingRecords)) {
|
||||
record.setId(existingRecords.get(0).getId());
|
||||
}
|
||||
return record;
|
||||
}
|
||||
|
||||
private void updateConfirmedSplitAmount(AdapayUnsplitRecordVO item, BigDecimal confirmAmt, String paymentId) {
|
||||
BigDecimal oldConfirmedAmt = parseAmount(item.getConfirmedSplitAmount());
|
||||
BigDecimal newConfirmedAmt = oldConfirmedAmt.add(confirmAmt).setScale(2, BigDecimal.ROUND_HALF_UP);
|
||||
AdapayUnsplitRecord updateRecord = new AdapayUnsplitRecord();
|
||||
updateRecord.setPaymentId(paymentId);
|
||||
AdapayUnsplitRecord updateRecord = buildUpdateRecordByPaymentId(paymentId);
|
||||
updateRecord.setConfirmedSplitAmount(newConfirmedAmt);
|
||||
updateRecord.setUpdateTime(DateUtils.getNowDate());
|
||||
adapayUnsplitRecordService.insertOrUpdateSelective(updateRecord);
|
||||
}
|
||||
|
||||
private void markSplitResult(String paymentId, String splitFlag) {
|
||||
AdapayUnsplitRecord updateRecord = new AdapayUnsplitRecord();
|
||||
updateRecord.setPaymentId(paymentId);
|
||||
AdapayUnsplitRecord updateRecord = buildUpdateRecordByPaymentId(paymentId);
|
||||
updateRecord.setSplitFlag(splitFlag);
|
||||
updateRecord.setUpdateTime(DateUtils.getNowDate());
|
||||
adapayUnsplitRecordService.insertOrUpdateSelective(updateRecord);
|
||||
}
|
||||
|
||||
private void updateRefundAmount(String paymentId, BigDecimal refundAmount) {
|
||||
AdapayUnsplitRecord updateRecord = new AdapayUnsplitRecord();
|
||||
updateRecord.setPaymentId(paymentId);
|
||||
AdapayUnsplitRecord updateRecord = buildUpdateRecordByPaymentId(paymentId);
|
||||
updateRecord.setRefundAmount(refundAmount.setScale(2, BigDecimal.ROUND_HALF_UP));
|
||||
updateRecord.setUpdateTime(DateUtils.getNowDate());
|
||||
adapayUnsplitRecordService.insertOrUpdateSelective(updateRecord);
|
||||
}
|
||||
|
||||
private void markRefundResult(String paymentId, String refundFlag) {
|
||||
AdapayUnsplitRecord updateRecord = new AdapayUnsplitRecord();
|
||||
updateRecord.setPaymentId(paymentId);
|
||||
AdapayUnsplitRecord updateRecord = buildUpdateRecordByPaymentId(paymentId);
|
||||
updateRecord.setRefundFlag(refundFlag);
|
||||
updateRecord.setUpdateTime(DateUtils.getNowDate());
|
||||
adapayUnsplitRecordService.insertOrUpdateSelective(updateRecord);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user