diff --git a/src/main/java/au/com/royalpay/payment/manage/citypartner/web/CityPartnerRegisterController.java b/src/main/java/au/com/royalpay/payment/manage/citypartner/web/CityPartnerRegisterController.java index 6547049bd..5110c2ae2 100644 --- a/src/main/java/au/com/royalpay/payment/manage/citypartner/web/CityPartnerRegisterController.java +++ b/src/main/java/au/com/royalpay/payment/manage/citypartner/web/CityPartnerRegisterController.java @@ -1,10 +1,17 @@ package au.com.royalpay.payment.manage.citypartner.web; -import au.com.royalpay.payment.manage.citypartner.core.CityPartnerRegisterService; +import au.com.royalpay.payment.manage.citypartner.beans.CityPartnerBean; +import au.com.royalpay.payment.manage.citypartner.core.CityPartnerRegisterService; +import au.com.royalpay.payment.tools.exceptions.ForbiddenException; +import au.com.royalpay.payment.tools.http.HttpUtils; +import org.springframework.validation.Errors; +import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RestController; import javax.annotation.Resource; +import javax.validation.Valid; /** * Created by yixian on 2017-01-23. @@ -15,9 +22,12 @@ public class CityPartnerRegisterController { @Resource private CityPartnerRegisterService cityPartnerRegisterService; -// @RequestMapping(method = RequestMethod.POST) -// public void register(@RequestBody @Valid CityPartnerBean partner, Errors errors) { -// HttpUtils.handleValidErrors(errors); -// cityPartnerRegisterService.saveRegistry(partner); -// } + @RequestMapping(method = RequestMethod.POST) + public void register(@RequestBody @Valid CityPartnerBean partner, Errors errors) { + HttpUtils.handleValidErrors(errors); + if (true) { + throw new ForbiddenException(); + } + cityPartnerRegisterService.saveRegistry(partner); + } } diff --git a/src/main/java/au/com/royalpay/payment/manage/custom/core/impl/CustomServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/custom/core/impl/CustomServiceImpl.java index da030ffec..36dede573 100644 --- a/src/main/java/au/com/royalpay/payment/manage/custom/core/impl/CustomServiceImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/custom/core/impl/CustomServiceImpl.java @@ -57,7 +57,7 @@ public class CustomServiceImpl implements CustomService { } 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()); + customReport.addExtMchCustom(addCustomVO.getMch_ext_custom_id(), addCustomVO.getMch_ext_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")));