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> <parent>
<groupId>au.com.royalpay.payment</groupId> <groupId>au.com.royalpay.payment</groupId>
<artifactId>payment-parent</artifactId> <artifactId>payment-parent</artifactId>
<version>0.2.0-dev</version> <version>0.2.0</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>

@ -20,4 +20,5 @@ public interface CustomService {
List<JSONObject> channelCustomConfigs(String channel); 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.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;
import au.com.royalpay.payment.tools.exceptions.BadRequestException;
import au.com.royalpay.payment.tools.utils.PageListUtils; import au.com.royalpay.payment.tools.utils.PageListUtils;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
@ -49,6 +50,10 @@ public class CustomServiceImpl implements CustomService {
@Override @Override
public void add(String orderId, String mchCustomId, String custom, String mchCustomName, List<JSONObject> subOrders) { 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); CustomReport customReport = new CustomReport(orderId, mchCustomId, mchCustomName, custom);
if (!CollectionUtils.isEmpty(subOrders)) { if (!CollectionUtils.isEmpty(subOrders)) {
subOrders.forEach(p -> { subOrders.forEach(p -> {
@ -90,4 +95,14 @@ public class CustomServiceImpl implements CustomService {
return customSupport.channelCustomConfigs(channel); 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) { public List<JSONObject> channelCustomConfigs(@RequestParam String channel) {
return customService.channelCustomConfigs(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) @AutoSql(type = SqlType.SELECT)
JSONObject findOne(@Param("report_id") String report_id); 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); 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) { app.controller('customAddCtrl', ['$scope', '$http','commonDialog','order_id','channelCustom', function ($scope, $http,commonDialog,order_id,channelCustom) {

@ -124,6 +124,13 @@
ng-click="detail(order)"> ng-click="detail(order)">
<i class="fa fa-search"></i> <i class="fa fa-search"></i>
</a> </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> </td>
</tr> </tr>
</tbody> </tbody>

Loading…
Cancel
Save