From 26eb3f82417ac7796f4334e44c1d1a31f9e0b84a Mon Sep 17 00:00:00 2001 From: kira <164851225@qq.com> Date: Thu, 9 Aug 2018 11:29:21 +0800 Subject: [PATCH 1/9] modify Custom --- .../manage/custom/beans/AddCustomVO.java | 47 +++++++++++++------ .../manage/custom/core/CustomService.java | 6 ++- .../custom/core/impl/CustomServiceImpl.java | 22 ++++++--- .../manage/custom/web/CustomController.java | 23 +++++---- src/main/ui/static/payment/custom/custom.js | 2 +- .../payment/custom/templates/custom_add.html | 22 +++++++-- 6 files changed, 86 insertions(+), 36 deletions(-) diff --git a/src/main/java/au/com/royalpay/payment/manage/custom/beans/AddCustomVO.java b/src/main/java/au/com/royalpay/payment/manage/custom/beans/AddCustomVO.java index cc0bfc36f..0f3e12fa3 100644 --- a/src/main/java/au/com/royalpay/payment/manage/custom/beans/AddCustomVO.java +++ b/src/main/java/au/com/royalpay/payment/manage/custom/beans/AddCustomVO.java @@ -4,7 +4,6 @@ package au.com.royalpay.payment.manage.custom.beans; import com.alibaba.fastjson.JSONObject; import java.util.List; - /** * @author kira * @date 2018/7/27 @@ -12,19 +11,13 @@ import java.util.List; public class AddCustomVO { private String order_id; private String custom; - private String mch_custom_no; - private boolean has_sub; + private String mch_custom_id; private String mch_custom_name; + private String mch_ext_custom_id; + private String mch_ext_custom_name; + private boolean has_sub; private List 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() { return order_id; } @@ -41,12 +34,36 @@ public class AddCustomVO { this.custom = custom; } - public String getMch_custom_no() { - return mch_custom_no; + public String getMch_custom_id() { + 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) { - this.mch_custom_no = mch_custom_no; + public void setMch_ext_custom_name(String mch_ext_custom_name) { + this.mch_ext_custom_name = mch_ext_custom_name; } public boolean isHas_sub() { diff --git a/src/main/java/au/com/royalpay/payment/manage/custom/core/CustomService.java b/src/main/java/au/com/royalpay/payment/manage/custom/core/CustomService.java index e0bcff181..00de7944b 100644 --- a/src/main/java/au/com/royalpay/payment/manage/custom/core/CustomService.java +++ b/src/main/java/au/com/royalpay/payment/manage/custom/core/CustomService.java @@ -1,5 +1,7 @@ package au.com.royalpay.payment.manage.custom.core; +import au.com.royalpay.payment.manage.custom.beans.AddCustomVO; + import com.alibaba.fastjson.JSONObject; import java.util.List; @@ -12,7 +14,7 @@ public interface CustomService { JSONObject findOneWithDetail(String report_id); - void add(String orderId, String mchCustomId, String custom, String mchCustomName, List subOrders); + void add(AddCustomVO addCustomVO); boolean check(int client_id, String channel); @@ -21,4 +23,6 @@ public interface CustomService { List channelCustomConfigs(String channel); void resend(String report_id); + + JSONObject getCustomResult(String report_id); } 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 d21e86bf9..da030ffec 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 @@ -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 subOrders) { - JSONObject report = customReportsMapper.findOne(orderId); - if(report!=null){ + 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"))); }); } @@ -98,11 +101,16 @@ public class CustomServiceImpl implements CustomService { @Override public void resend(String report_id) { JSONObject report = customReportsMapper.findOne(report_id); - if(report.getIntValue("report_status")!=2){ + if (report.getIntValue("report_status") != 2) { throw new BadRequestException("order can't report"); } customSupport.sendCustom(report_id); } + @Override + public JSONObject getCustomResult(String report_id) { + return customSupport.queryCustomResult(report_id); + } + } diff --git a/src/main/java/au/com/royalpay/payment/manage/custom/web/CustomController.java b/src/main/java/au/com/royalpay/payment/manage/custom/web/CustomController.java index 797ba3722..ba5f3925a 100644 --- a/src/main/java/au/com/royalpay/payment/manage/custom/web/CustomController.java +++ b/src/main/java/au/com/royalpay/payment/manage/custom/web/CustomController.java @@ -28,32 +28,37 @@ public class CustomController { @Resource private CustomService customService; - @RequestMapping(value = "/{report_id}",method = RequestMethod.GET) + @RequestMapping(value = "/{report_id}", method = RequestMethod.GET) public JSONObject findOne(@PathVariable String report_id) { return customService.findOneWithDetail(report_id); } - @RequestMapping(value = "/query",method = RequestMethod.GET) - public JSONObject queryWithTran(@ModelAttribute(CommonConsts.PARTNER_STATUS)JSONObject partner, QueryCustomVo queryCustomVo) { + @RequestMapping(value = "/query", method = RequestMethod.GET) + public JSONObject queryWithTran(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject partner, QueryCustomVo queryCustomVo) { JSONObject param = queryCustomVo.toParam(); - param.put("client_id",partner.getIntValue("client_id")); - return customService.query(param,queryCustomVo.getPage(),queryCustomVo.getLimit()); + param.put("client_id", partner.getIntValue("client_id")); + return customService.query(param, queryCustomVo.getPage(), queryCustomVo.getLimit()); } - @RequestMapping(value = "",method = RequestMethod.POST) + @RequestMapping(value = "", method = RequestMethod.POST) @ResponseBody 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) public List channelCustomConfigs(@RequestParam String channel) { return customService.channelCustomConfigs(channel); } - @RequestMapping(value = "/{report_id}/resend",method = RequestMethod.POST) + @RequestMapping(value = "/{report_id}/resend", method = RequestMethod.POST) public void resend(@PathVariable String 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); + } + } diff --git a/src/main/ui/static/payment/custom/custom.js b/src/main/ui/static/payment/custom/custom.js index c8195b668..d81c288da 100644 --- a/src/main/ui/static/payment/custom/custom.js +++ b/src/main/ui/static/payment/custom/custom.js @@ -104,7 +104,7 @@ if($scope.custom.custom==''){ alert('请输入海关名称'); } - if($scope.custom.mchCustomId==''){ + if($scope.custom.mch_custom_id==''){ alert('请输入备案号'); } $scope.custom.subOrders = $scope.subOrders; diff --git a/src/main/ui/static/payment/custom/templates/custom_add.html b/src/main/ui/static/payment/custom/templates/custom_add.html index a5abf583b..decf68d7b 100644 --- a/src/main/ui/static/payment/custom/templates/custom_add.html +++ b/src/main/ui/static/payment/custom/templates/custom_add.html @@ -18,20 +18,36 @@ +
- +
- +
- +
+
+ +
+ +
+
+ +
+ +
+ +
+
+ +
From 9fca669d45c5be007db6645aa0d2906404e4c001 Mon Sep 17 00:00:00 2001 From: luoyang14z7 <704328506@qq.com> Date: Thu, 9 Aug 2018 17:19:54 +0800 Subject: [PATCH 2/9] fix : ali for excel --- .../manage/dev/core/impl/AliforexcelServiceImpl.java | 6 +++++- .../royalpay/payment/manage/mappers/system/ClientMapper.xml | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main/java/au/com/royalpay/payment/manage/dev/core/impl/AliforexcelServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/dev/core/impl/AliforexcelServiceImpl.java index 845c76876..ca6b5b381 100644 --- a/src/main/java/au/com/royalpay/payment/manage/dev/core/impl/AliforexcelServiceImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/dev/core/impl/AliforexcelServiceImpl.java @@ -48,7 +48,11 @@ public class AliforexcelServiceImpl implements AliforexcelService { row = sheet.createRow(++rowNum); row.createCell(0, Cell.CELL_TYPE_STRING).setCellValue(partner.getString("company_name")); row.createCell(1, Cell.CELL_TYPE_STRING).setCellValue(partner.getString("short_name")); - row.createCell(2, Cell.CELL_TYPE_STRING).setCellValue(partner.getString("client_moniker")); + if (!"".equals(partner.getString("ali_sub_merchant_id"))) { + row.createCell(2, Cell.CELL_TYPE_STRING).setCellValue(partner.getString("ali_sub_merchant_id")); + }else { + row.createCell(2, Cell.CELL_TYPE_STRING).setCellValue(partner.getString("client_moniker")); + } row.createCell(3, Cell.CELL_TYPE_STRING).setCellValue(partner.getString("alipayindustry")); row.createCell(4, Cell.CELL_TYPE_STRING).setCellValue(partner.getString("address")+","+partner.getString("suburb") + "," + partner.getString("state") + "," + partner.getString("postcode")); row.createCell(5, Cell.CELL_TYPE_STRING).setCellValue(partner.getString("business_hours")); diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/system/ClientMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/system/ClientMapper.xml index ef9a4a2ff..24bfc3a90 100644 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/system/ClientMapper.xml +++ b/src/main/resources/au/com/royalpay/payment/manage/mappers/system/ClientMapper.xml @@ -168,7 +168,7 @@ +
@@ -27,6 +27,21 @@ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
From 194e8e9e096532652c3ae5057e994f46259e9074 Mon Sep 17 00:00:00 2001 From: kira <164851225@qq.com> Date: Sat, 11 Aug 2018 21:53:35 +0800 Subject: [PATCH 6/9] rollback --- src/main/ui/static/payment/custom/templates/custom_detail.html | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/ui/static/payment/custom/templates/custom_detail.html b/src/main/ui/static/payment/custom/templates/custom_detail.html index 69c9aa71e..d3805a6c1 100644 --- a/src/main/ui/static/payment/custom/templates/custom_detail.html +++ b/src/main/ui/static/payment/custom/templates/custom_detail.html @@ -27,6 +27,9 @@
+ + +
From 3fb3c7b7e86b06e7ae5d76dbceea9655dd163ec6 Mon Sep 17 00:00:00 2001 From: kira <164851225@qq.com> Date: Sat, 11 Aug 2018 21:55:52 +0800 Subject: [PATCH 7/9] update --- .../custom/templates/custom_detail.html | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/src/main/ui/static/payment/custom/templates/custom_detail.html b/src/main/ui/static/payment/custom/templates/custom_detail.html index 778bb1b3c..bffc386b3 100644 --- a/src/main/ui/static/payment/custom/templates/custom_detail.html +++ b/src/main/ui/static/payment/custom/templates/custom_detail.html @@ -27,24 +27,6 @@
- - - -
- -
- -
-
- -
- -
- -
-
- -
From 4143d12f7b79997c05c091aaaaf80a31cca7b46f Mon Sep 17 00:00:00 2001 From: kira <164851225@qq.com> Date: Sat, 11 Aug 2018 21:57:41 +0800 Subject: [PATCH 8/9] update --- .../ui/static/payment/custom/templates/custom_detail.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/ui/static/payment/custom/templates/custom_detail.html b/src/main/ui/static/payment/custom/templates/custom_detail.html index bffc386b3..69c9aa71e 100644 --- a/src/main/ui/static/payment/custom/templates/custom_detail.html +++ b/src/main/ui/static/payment/custom/templates/custom_detail.html @@ -14,9 +14,9 @@
- +
- +
From faa2fcd7f83cf707d360056e7a0cf448c097aeac Mon Sep 17 00:00:00 2001 From: kira <164851225@qq.com> Date: Sun, 12 Aug 2018 17:45:06 +0800 Subject: [PATCH 9/9] remove client postpone transaction --- .../com/royalpay/payment/manage/task/PostponeClientTask.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/main/java/au/com/royalpay/payment/manage/task/PostponeClientTask.java b/src/main/java/au/com/royalpay/payment/manage/task/PostponeClientTask.java index 10b8d003c..18a98a6d7 100644 --- a/src/main/java/au/com/royalpay/payment/manage/task/PostponeClientTask.java +++ b/src/main/java/au/com/royalpay/payment/manage/task/PostponeClientTask.java @@ -9,8 +9,8 @@ import au.com.royalpay.payment.manage.merchants.entity.impls.SwitchPermissionMod import au.com.royalpay.payment.tools.connections.mpsupport.MpWechatApi; import au.com.royalpay.payment.tools.connections.mpsupport.MpWechatApiProvider; import au.com.royalpay.payment.tools.connections.mpsupport.beans.TemplateMessage; - import au.com.royalpay.payment.tools.scheduler.SynchronizedScheduler; + import com.alibaba.fastjson.JSONObject; import org.apache.commons.lang3.time.DateFormatUtils; @@ -20,7 +20,6 @@ import org.slf4j.LoggerFactory; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Component; -import org.springframework.transaction.annotation.Transactional; import org.springframework.util.CollectionUtils; import org.springframework.util.StringUtils; @@ -55,7 +54,6 @@ public class PostponeClientTask { private ClientModifySupport clientModifySupport; @Scheduled(cron = "0 30 8 * * ?") - @Transactional public void postponeClient() { synchronizedScheduler.executeProcess("manage_task:postPoneClient", 120_000, () -> { Date now = new Date();