|
|
|
@ -3,6 +3,7 @@ package au.com.royalpay.payment.manage.custom.core.impl;
|
|
|
|
|
import au.com.royalpay.payment.core.CustomSupport;
|
|
|
|
|
import au.com.royalpay.payment.core.beans.CustomReport;
|
|
|
|
|
import au.com.royalpay.payment.core.beans.OrderStatus;
|
|
|
|
|
import au.com.royalpay.payment.manage.custom.beans.AddCustomVO;
|
|
|
|
|
import au.com.royalpay.payment.manage.custom.core.CustomService;
|
|
|
|
|
import au.com.royalpay.payment.manage.mappers.custom.CustomReportDetailsMapper;
|
|
|
|
|
import au.com.royalpay.payment.manage.mappers.custom.CustomReportsMapper;
|
|
|
|
@ -49,14 +50,16 @@ public class CustomServiceImpl implements CustomService {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void add(String orderId, String mchCustomId, String custom, String mchCustomName, List<JSONObject> subOrders) {
|
|
|
|
|
JSONObject report = customReportsMapper.findOne(orderId);
|
|
|
|
|
public void add(AddCustomVO addCustomVO) {
|
|
|
|
|
JSONObject report = customReportsMapper.findOne(addCustomVO.getOrder_id());
|
|
|
|
|
if (report != null) {
|
|
|
|
|
throw new BadRequestException("report record exist");
|
|
|
|
|
}
|
|
|
|
|
CustomReport customReport = new CustomReport(orderId, mchCustomId, mchCustomName, custom);
|
|
|
|
|
if (!CollectionUtils.isEmpty(subOrders)) {
|
|
|
|
|
subOrders.forEach(p -> {
|
|
|
|
|
CustomReport customReport = new CustomReport(addCustomVO.getOrder_id(), addCustomVO.getMch_custom_id(), addCustomVO.getMch_custom_name(),
|
|
|
|
|
addCustomVO.getCustom());
|
|
|
|
|
customReport.addExtMchCustom(addCustomVO.getMch_custom_id(), addCustomVO.getMch_custom_name());
|
|
|
|
|
if (!CollectionUtils.isEmpty(addCustomVO.getSubOrders())) {
|
|
|
|
|
addCustomVO.getSubOrders().forEach(p -> {
|
|
|
|
|
customReport.addSubOrder(p.getBigDecimal("order_fee"), p.getBigDecimal("order_fee").subtract(p.getBigDecimal("transport_fee")));
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
@ -105,4 +108,9 @@ public class CustomServiceImpl implements CustomService {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public JSONObject getCustomResult(String report_id) {
|
|
|
|
|
return customSupport.queryCustomResult(report_id);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|