Merge branch 'hotfix_custom' into develop

master
kira 6 years ago
commit 8031e87fcf

@ -4,7 +4,6 @@ package au.com.royalpay.payment.manage.custom.beans;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import java.util.List; import java.util.List;
/** /**
* @author kira * @author kira
* @date 2018/7/27 * @date 2018/7/27
@ -12,19 +11,13 @@ import java.util.List;
public class AddCustomVO { public class AddCustomVO {
private String order_id; private String order_id;
private String custom; private String custom;
private String mch_custom_no; private String mch_custom_id;
private boolean has_sub;
private String mch_custom_name; private String mch_custom_name;
private String mch_ext_custom_id;
private String mch_ext_custom_name;
private boolean has_sub;
private List<JSONObject> subOrders; private List<JSONObject> subOrders;
public String getMch_custom_name() {
return mch_custom_name;
}
public void setMch_custom_name(String mch_custom_name) {
this.mch_custom_name = mch_custom_name;
}
public String getOrder_id() { public String getOrder_id() {
return order_id; return order_id;
} }
@ -41,12 +34,36 @@ public class AddCustomVO {
this.custom = custom; this.custom = custom;
} }
public String getMch_custom_no() { public String getMch_custom_id() {
return mch_custom_no; return mch_custom_id;
}
public void setMch_custom_id(String mch_custom_id) {
this.mch_custom_id = mch_custom_id;
}
public String getMch_custom_name() {
return mch_custom_name;
}
public void setMch_custom_name(String mch_custom_name) {
this.mch_custom_name = mch_custom_name;
}
public String getMch_ext_custom_id() {
return mch_ext_custom_id;
}
public void setMch_ext_custom_id(String mch_ext_custom_id) {
this.mch_ext_custom_id = mch_ext_custom_id;
}
public String getMch_ext_custom_name() {
return mch_ext_custom_name;
} }
public void setMch_custom_no(String mch_custom_no) { public void setMch_ext_custom_name(String mch_ext_custom_name) {
this.mch_custom_no = mch_custom_no; this.mch_ext_custom_name = mch_ext_custom_name;
} }
public boolean isHas_sub() { public boolean isHas_sub() {

@ -1,5 +1,7 @@
package au.com.royalpay.payment.manage.custom.core; package au.com.royalpay.payment.manage.custom.core;
import au.com.royalpay.payment.manage.custom.beans.AddCustomVO;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import java.util.List; import java.util.List;
@ -12,7 +14,7 @@ public interface CustomService {
JSONObject findOneWithDetail(String report_id); JSONObject findOneWithDetail(String report_id);
void add(String orderId, String mchCustomId, String custom, String mchCustomName, List<JSONObject> subOrders); void add(AddCustomVO addCustomVO);
boolean check(int client_id, String channel); boolean check(int client_id, String channel);
@ -21,4 +23,6 @@ public interface CustomService {
List<JSONObject> channelCustomConfigs(String channel); List<JSONObject> channelCustomConfigs(String channel);
void resend(String report_id); void resend(String report_id);
JSONObject getCustomResult(String report_id);
} }

@ -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.CustomSupport;
import au.com.royalpay.payment.core.beans.CustomReport; import au.com.royalpay.payment.core.beans.CustomReport;
import au.com.royalpay.payment.core.beans.OrderStatus; 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.custom.core.CustomService;
import au.com.royalpay.payment.manage.mappers.custom.CustomReportDetailsMapper; import au.com.royalpay.payment.manage.mappers.custom.CustomReportDetailsMapper;
import au.com.royalpay.payment.manage.mappers.custom.CustomReportsMapper; import au.com.royalpay.payment.manage.mappers.custom.CustomReportsMapper;
@ -49,14 +50,16 @@ public class CustomServiceImpl implements CustomService {
} }
@Override @Override
public void add(String orderId, String mchCustomId, String custom, String mchCustomName, List<JSONObject> subOrders) { public void add(AddCustomVO addCustomVO) {
JSONObject report = customReportsMapper.findOne(orderId); JSONObject report = customReportsMapper.findOne(addCustomVO.getOrder_id());
if (report != null) { if (report != null) {
throw new BadRequestException("report record exist"); throw new BadRequestException("report record exist");
} }
CustomReport customReport = new CustomReport(orderId, mchCustomId, mchCustomName, custom); CustomReport customReport = new CustomReport(addCustomVO.getOrder_id(), addCustomVO.getMch_custom_id(), addCustomVO.getMch_custom_name(),
if (!CollectionUtils.isEmpty(subOrders)) { addCustomVO.getCustom());
subOrders.forEach(p -> { 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"))); 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);
}
} }

@ -43,7 +43,7 @@ public class CustomController {
@RequestMapping(value = "", method = RequestMethod.POST) @RequestMapping(value = "", method = RequestMethod.POST)
@ResponseBody @ResponseBody
public void add(@RequestBody AddCustomVO addCustomVO) { public void add(@RequestBody AddCustomVO addCustomVO) {
customService.add(addCustomVO.getOrder_id(),addCustomVO.getMch_custom_no(),addCustomVO.getCustom(),addCustomVO.getMch_custom_name(),addCustomVO.getSubOrders()); customService.add(addCustomVO);
} }
@RequestMapping(value = "/channelCustom", method = RequestMethod.GET) @RequestMapping(value = "/channelCustom", method = RequestMethod.GET)
@ -56,4 +56,9 @@ public class CustomController {
customService.resend(report_id); customService.resend(report_id);
} }
@RequestMapping(value = "/{report_id}/customResult", method = RequestMethod.GET)
public void getCustomResult(@PathVariable String report_id) {
customService.getCustomResult(report_id);
}
} }

@ -104,7 +104,7 @@
if($scope.custom.custom==''){ if($scope.custom.custom==''){
alert('请输入海关名称'); alert('请输入海关名称');
} }
if($scope.custom.mchCustomId==''){ if($scope.custom.mch_custom_id==''){
alert('请输入备案号'); alert('请输入备案号');
} }
$scope.custom.subOrders = $scope.subOrders; $scope.custom.subOrders = $scope.subOrders;

@ -18,20 +18,36 @@
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="control-label col-sm-4" for="mch_custom_no">Customs No</label> <label class="control-label col-sm-4" for="mch_custom_id">Local Customs No</label>
<div class="col-sm-6"> <div class="col-sm-6">
<input class="form-control" ng-model="custom.mch_custom_no" id="mch_custom_no" type="text"> <input class="form-control" ng-model="custom.mch_custom_id" id="mch_custom_id" type="text">
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="control-label col-sm-4" for="mch_custom_name">Merchant Custom Record Name</label> <label class="control-label col-sm-4" for="mch_custom_name">Local Merchant Custom Record Name</label>
<div class="col-sm-6"> <div class="col-sm-6">
<input class="form-control" ng-model="custom.mch_custom_name" id="mch_custom_name" type="text"> <input class="form-control" ng-model="custom.mch_custom_name" id="mch_custom_name" type="text">
</div> </div>
</div> </div>
<div class="form-group">
<label class="control-label col-sm-4" for="mch_ext_custom_id">General Customs No</label>
<div class="col-sm-6">
<input class="form-control" ng-model="custom.mch_ext_custom_id" id="mch_ext_custom_id" type="text">
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-4" for="mch_ext_custom_name">General Merchant Custom Record Name</label>
<div class="col-sm-6">
<input class="form-control" ng-model="custom.mch_ext_custom_name" id="mch_ext_custom_name" type="text">
</div>
</div>
<div class="form-group"> <div class="form-group">
<label class="control-label col-sm-4" for="has_sub">Split</label> <label class="control-label col-sm-4" for="has_sub">Split</label>
<div class="col-sm-6"> <div class="col-sm-6">

Loading…
Cancel
Save