Merge branch 'hotfix' into develop

# Conflicts:
#	src/main/java/au/com/royalpay/payment/manage/custom/core/impl/CustomServiceImpl.java
master
kira 6 years ago
commit 9ba62f3e33

@ -5,7 +5,7 @@
<parent>
<groupId>au.com.royalpay.payment</groupId>
<artifactId>payment-parent</artifactId>
<version>0.2.0-dev</version>
<version>0.2.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>

@ -20,4 +20,5 @@ public interface CustomService {
List<JSONObject> channelCustomConfigs(String channel);
void resend(String report_id);
}

@ -6,6 +6,7 @@ import au.com.royalpay.payment.core.beans.OrderStatus;
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;
import au.com.royalpay.payment.tools.exceptions.BadRequestException;
import au.com.royalpay.payment.tools.utils.PageListUtils;
import com.alibaba.fastjson.JSONObject;
@ -49,6 +50,10 @@ 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);
if(report!=null){
throw new BadRequestException("report record exist");
}
CustomReport customReport = new CustomReport(orderId, mchCustomId, mchCustomName, custom);
if (!CollectionUtils.isEmpty(subOrders)) {
subOrders.forEach(p -> {
@ -90,4 +95,14 @@ public class CustomServiceImpl implements CustomService {
return customSupport.channelCustomConfigs(channel);
}
@Override
public void resend(String report_id) {
JSONObject report = customReportsMapper.findOne(report_id);
if(report.getIntValue("report_status")!=2){
throw new BadRequestException("order can't report");
}
customSupport.sendCustom(report_id);
}
}

@ -50,4 +50,10 @@ public class CustomController {
public List<JSONObject> channelCustomConfigs(@RequestParam String channel) {
return customService.channelCustomConfigs(channel);
}
@RequestMapping(value = "/{report_id}/resend",method = RequestMethod.POST)
public void resend(@PathVariable String report_id) {
customService.resend(report_id);
}
}

@ -20,5 +20,8 @@ public interface CustomReportsMapper {
@AutoSql(type = SqlType.SELECT)
JSONObject findOne(@Param("report_id") String report_id);
@AutoSql(type = SqlType.SELECT)
JSONObject findByOrderId(@Param("order_id")String order_id);
PageList<JSONObject> queryWithTrans(JSONObject param,PageBounds pagination);
}

@ -80,6 +80,14 @@
})
}
$scope.resend = function (order) {
$http.post('/custom/'+order.report_id+'/resend').then(function () {
$scope.loadList(1);
}, function (resp) {
$scope.loadList(1);
});
}
}]);
app.controller('customAddCtrl', ['$scope', '$http','commonDialog','order_id','channelCustom', function ($scope, $http,commonDialog,order_id,channelCustom) {

@ -124,6 +124,13 @@
ng-click="detail(order)">
<i class="fa fa-search"></i>
</a>
<a ng-if="order.report_status==2" class="text-primary" role="button" title="Detail"
ng-click="resend(order)">
<i class="fa fa-refresh"></i>
</a>
</td>
</tr>
</tbody>

Loading…
Cancel
Save