diff --git a/src/document/cn/apidoc.json b/src/document/cn/apidoc.json index aa45a775c..3509ecd0a 100644 --- a/src/document/cn/apidoc.json +++ b/src/document/cn/apidoc.json @@ -27,7 +27,9 @@ "JD_Online_Payment", "Alipay_Online_Payment", "HF_Online_Payment", + "CB_BankPay", "SDKPayment", + "Customs_Declaration", "CommonApi", "GetExchange", "OrderStatus", @@ -41,4 +43,4 @@ "template":{ "forceLanguage":"zh_cn" } -} \ No newline at end of file +} diff --git a/src/document/cn/apis.js b/src/document/cn/apis.js index 4d530daae..ff0a01a93 100644 --- a/src/document/cn/apis.js +++ b/src/document/cn/apis.js @@ -17,6 +17,9 @@ /** * @apiDefine JSON JSON字段 */ +/** + * @apiDefine SUB_JSON JSON子字段 + */ /** * @apiDefine ERROR_CODE 错误码 */ @@ -839,6 +842,110 @@ * @apiError (ERROR_CODE) ORDER_PAID 订单已支付 * */ +/** + * @api {PUT} /api/v1.0/yeepay/partners/{partner_code}/orders/{order_id} 创建网银快捷支付订单 + * @apiName cbbankpayapi + * @apiDescription + * 用于PC端网银快捷支付,创建订单后跳转到返回的pay_url,随后进入网银快捷支付页面完成支付 + * + * @apiVersion 1.0.0 + * @apiGroup CB_BankPay + * @apiHeader Accept application/json + * @apiHeader Content-Type application/json + * @apiParam (PathVariable) {String} partner_code 必填,商户编码,由4位大写字母或数字构成 + * @apiParam (PathVariable) {String} order_id 必填,商户支付订单号,要求同一商户唯一 + * @apiUse Sign + * @apiParam (JSON) {String} description 必填,订单标题(最大长度128字符,超出自动截取) + * @apiParam (JSON) {int} price 必填,金额,单位为货币最小单位,例如使用100表示AUD1.00 + * @apiParam (JSON) {String} product_name 必填 商品名称 + * @apiParam (JSON) {String=AUD} currency=AUD 币种代码(当前仅支持AUD) + * @apiParam (JSON) {String} notify_url 支付通知url,详见支付通知api,不填则不会推送支付通知 + * @apiParam (JSON) {String} operator 操作人员标识 + * + * @apiSuccess {String} return_code 执行结果 + * @apiSuccess {String} result_code SUCCESS表示创建订单成功,EXISTS表示订单已存在 + * @apiSuccess {String} partner_code 商户编码 + * @apiSuccess {String} full_name 商户注册全名 + * @apiSuccess {String} partner_name 商户名称 + * @apiSuccess {String} order_id RoyalPay订单ID,最终支付成功的订单ID可能不同 + * @apiSuccess {String} partner_order_id 商户订单ID + * @apiSuccess {String} channel 支付渠道 + * @apiSuccess {String} pay_url 跳转URL + * + * @apiUse GlobalError + * @apiError (ERROR_CODE) ORDER_MISMATCH 订单号与商户不匹配 + * @apiError (ERROR_CODE) ORDER_PAID 订单已支付 + * + */ +/** + * @api {PUT} /api/v1.0/customs/partners/{partner_code}/declare/query/{client_report_id} 创建报关单 + * @apiName declare_report + * @apiDescription + * 用于商户提交海关需要的订单附件信息。仅支持微信和支付宝,微信只支持一个月内的支付订单进行报关申请。 + * + * @apiVersion 1.0.0 + * @apiGroup Customs_Declaration + * @apiHeader Accept application/json + * @apiHeader Content-Type application/json + * @apiParam (PathVariable) {String} partner_code 必填,商户编码,由4位大写字母或数字构成 + * @apiParam (PathVariable) {String} client_report_id 必填,商户申请报关单号,要求同一商户唯一 + * @apiUse Sign + * @apiParam (JSON) {String} order_id 必填,商户支付订单号,要求同一商户唯一 + * @apiParam (JSON) {String} custom 必填,海关编号 * 渠道海关编号 + * @apiParam (JSON) {String} mch_custom_id 必填,商户在海关备案的编号 + * @apiParam (JSON) {String} mch_custom_name 必填,商户海关备案名称 + * @apiParam (JSON) {JSONArray} sub_order 子订单(拆单) + * + * @apiParam (SUB_JSON) {String} sub_order_no 商户子订单号 + * @apiParam (SUB_JSON) {String=CNY} fee_type=CNY 币种代码 + * @apiParam (SUB_JSON) {Double} order_fee 子订单金额 + * @apiParam (SUB_JSON) {Double} transport_fee 子订单物流金额 + * + * @apiSuccess {String} report_id RoyalPay海关单号 + * @apiSuccess {String} client_report_id 商户申请报关单号 + * @apiSuccess {int} report_status 0:暂存,1:提交,2:提交失败,3:提交成功 + * @apiSuccess {String} channel 支付渠道 + * @apiSuccess {String} custom 海关编号 + * @apiSuccess {String} mch_custom_no 商户在海关备案的编号 + * @apiSuccess {String} mch_custom_name 商户海关备案名称 + * @apiSuccess {String} order_id Royalpay订单号 + * @apiSuccess {String} transaction_id 支付渠道订单号 + * @apiSuccess {String} order_currency 币种 + * @apiSuccess {Double} order_amount 订单金额 + * @apiSuccess {String} report_time 报关时间 + * @apiSuccess {String} creation_date 报关单创建时间 + * @apiSuccess {String} last_update_date 更新时间 + * @apiSuccess {String} error_code 错误代码 + * @apiSuccess {String} error_msg 错误返回的信息描述 + * + * @apiUse GlobalError + * @apiError (ERROR_CODE) ORDER_MISMATCH 订单号与商户不匹配 + * + */ +/** + * @api {GET} /api/v1.0/customs/partners/{partner_code}/declare/query/{report_id} 查询报关单 + * @apiName declare_query + * @apiDescription + * 用于商户查询报关单号的状态。 + * + * @apiVersion 1.0.0 + * @apiGroup Customs_Declaration + * @apiHeader Accept application/json + * @apiHeader Content-Type application/json + * @apiParam (PathVariable) {String} partner_code 必填,商户编码,由4位大写字母或数字构成 + * @apiParam (PathVariable) {String} report_id 必填,RoyalPay海关单号 + * @apiUse Sign + * + * @apiSuccess {String} return_code 执行结果 + * @apiSuccess {String} report_status 报关单状态 + * @apiSuccess {String} report_id 商户申请报关单号 + * @apiSuccess {String} return_msg 错误描述,仅在执行结果不为SUCCESS情况下出现 + * @apiSuccess {String} order_id RoyalPay订单号 + * + * @apiUse GlobalError + * @apiError (ERROR_CODE) ORDER_MISMATCH 订单号与商户不匹配 + * + */ function apis() { -} \ No newline at end of file +} diff --git a/src/document/en/apidoc.json b/src/document/en/apidoc.json index 5dba5a8bf..3ae8f4594 100644 --- a/src/document/en/apidoc.json +++ b/src/document/en/apidoc.json @@ -27,7 +27,9 @@ "JD_Online_Payment", "Alipay_Online_Payment", "HF_Online_Payment", + "CB_BankPay", "SDKPayment", + "Customs_Declaration", "CommonApi", "GetExchange", "OrderStatus", @@ -41,4 +43,4 @@ "template":{ "forceLanguage":"en" } -} \ No newline at end of file +} diff --git a/src/document/en/apis.js b/src/document/en/apis.js index f29081340..383aa3bcf 100644 --- a/src/document/en/apis.js +++ b/src/document/en/apis.js @@ -17,6 +17,9 @@ /** * @apiDefine JSON JSON keys */ +/** + * @apiDefine SUB_JSON JSON child keys + */ /** * @apiDefine ERROR_CODE Error Code */ @@ -830,8 +833,8 @@ * @apiGroup HF_Online_Payment * @apiHeader Accept application/json * @apiHeader Content-Type application/json - * @apiParam (PathVariable) {String} partner_code 必填,商户编码,由4位大写字母或数字构成 - * @apiParam (PathVariable) {String} order_id 必填,商户支付订单号,要求同一商户唯一 + * @apiParam (PathVariable) {String} partner_code Required, Partner code + * @apiParam (PathVariable) {String} order_id Required, Partner order id * @apiUse Sign * @apiParam (JSON) {String} description Required, Order description * @apiParam (JSON) {String} mobile Required,Mobile phone @@ -843,18 +846,121 @@ * @apiParam (JSON) {String} notify_url System will call the notify url if provided when the payment succeeds * @apiParam (JSON) {String} operator Note for the operator who created this order. * - * @apiSuccess {String} return_code 执行结果 - * @apiSuccess {String} result_code SUCCESS表示创建订单成功,EXISTS表示订单已存在 - * @apiSuccess {String} partner_code 商户编码 - * @apiSuccess {String} full_name 商户注册全名 - * @apiSuccess {String} partner_name 商户名称 - * @apiSuccess {String} order_id RoyalPay订单ID,同时也是微信订单ID,最终支付成功的订单ID可能不同 - * @apiSuccess {String} partner_order_id 商户订单ID - * @apiSuccess {String} pay_url 跳转URL + * @apiSuccess {String} return_code Execution result + * @apiSuccess {String} result_code SUCCESS means order created successfully, EXISTS means order has already existed. + * @apiSuccess {String} partner_code Partner code + * @apiSuccess {String} full_name Partner's full company name when registered + * @apiSuccess {String} partner_name Partner's name + * @apiSuccess {String} order_id Order id in RoyalPay. The final order id which is paid may be different from this one + * @apiSuccess {String} partner_order_id Partner order id + * @apiSuccess {String} pay_url Payment page in RoyalPay. + * + * @apiUse GlobalError + * @apiError (ERROR_CODE) ORDER_MISMATCH Order is not belong to this partner + * @apiError (ERROR_CODE) ORDER_PAID Order has already been paid + * + */ +/** + * @api {PUT} /api/v1.0/yeepay/partners/{partner_code}/orders/{order_id} Create CB BankPay Order + * @apiName cbbankpayapi + * @apiDescription + * Use for CB BankPay in PC Website. After create order, jump to the pay_url returned and attach sign params and redirect param. + * + * @apiVersion 1.0.0 + * @apiGroup CB_BankPay + * @apiHeader Accept application/json + * @apiHeader Content-Type application/json + * @apiParam (PathVariable) {String} partner_code Required, Partner code + * @apiParam (PathVariable) {String} order_id Required, Partner order id + * @apiUse Sign + * @apiParam (JSON) {String} description Required, Order description + * @apiParam (JSON) {int} price Required, Price of the order. Use the base unit of the currency. + * @apiParam (JSON) {String} product_name Product name Required + * @apiParam (JSON) {String=AUD} currency=AUD Currency (only AUD) + * @apiParam (JSON) {String} notify_url System will call the notify url if provided when the payment succeeds + * @apiParam (JSON) {String} operator Note for the operator who created this order. + * + * @apiSuccess {String} return_code Execution result + * @apiSuccess {String} result_code SUCCESS means order created successfully, EXISTS means order has already existed. + * @apiSuccess {String} partner_code Partner code + * @apiSuccess {String} full_name Partner's full company name when registered + * @apiSuccess {String} partner_name Partner's name + * @apiSuccess {String} order_id Order id in RoyalPay. The final order id which is paid may be different from this one + * @apiSuccess {String} partner_order_id Partner order id + * @apiSuccess {String} pay_url Payment page in RoyalPay. + * + * @apiUse GlobalError + * @apiError (ERROR_CODE) ORDER_MISMATCH Order is not belong to this partner + * @apiError (ERROR_CODE) ORDER_PAID Order has already been paid + * + */ +/** + * @api {PUT} /api/v1.0/customs/partners/{partner_code}/declare/query/{client_report_id} Create Declare No. + * @apiName declare_report + * @apiDescription + * Used to submit the attachment information of the order required by the merchant. WeChat and Alipay are only supported. WeChat only supports payment orders within one month for customs declaration. + * + * @apiVersion 1.0.0 + * @apiGroup Customs_Declaration + * @apiHeader Accept application/json + * @apiHeader Content-Type application/json + * @apiParam (PathVariable) {String} partner_code Required, Partner code + * @apiParam (PathVariable) {String} client_report_id Required, Client declare ID + * @apiUse Sign + * @apiParam (JSON) {String} order_id Required, Partner order id + * @apiParam (JSON) {String} custom Required, Customs No. * Customs No. + * @apiParam (JSON) {String} mch_custom_id Required, Customs record id + * @apiParam (JSON) {String} mch_custom_name Required, Customs record name + * @apiParam (JSON) {JSONArray} sub_order Child orders + * + * @apiParam (SUB_JSON) {String} sub_order_no Child order ID + * @apiParam (SUB_JSON) {String=CNY} fee_type=CNY Currency + * @apiParam (SUB_JSON) {Double} order_fee Child Order Amount + * @apiParam (SUB_JSON) {Double} transport_fee Child Order Logistics Amount + * + * @apiSuccess {String} report_id RoyalPay declare ID + * @apiSuccess {String} client_report_id Client declare ID + * @apiSuccess {int} report_status 0:PROCCESSING,1:SUBMITED,2:FAIL,3:SUCCESS + * @apiSuccess {String} channel Channel + * @apiSuccess {String} custom Customs No. + * @apiSuccess {String} mch_custom_no Customs record ID + * @apiSuccess {String} mch_custom_name Customs record name + * @apiSuccess {String} order_id Royalpay Order ID + * @apiSuccess {String} transaction_id Channel Order ID + * @apiSuccess {String} order_currency Currency + * @apiSuccess {Double} order_amount Order Amount + * @apiSuccess {String} report_time Declare Time + * @apiSuccess {String} creation_date Create Time + * @apiSuccess {String} last_update_date Update Time + * @apiSuccess {String} error_code Error Code + * @apiSuccess {String} error_msg Error Description * * @apiUse GlobalError - * @apiError (ERROR_CODE) ORDER_MISMATCH 订单号与商户不匹配 - * @apiError (ERROR_CODE) ORDER_PAID 订单已支付 + * @apiError (ERROR_CODE) ORDER_MISMATCH Order is not belong to this partner + * + */ +/** + * @api {GET} /api/v1.0/customs/partners/{partner_code}/declare/query/{report_id} Query Declare ID + * @apiName declare_query + * @apiDescription + * Used by the merchant to check the status of the customs declaration number. + * + * @apiVersion 1.0.0 + * @apiGroup Customs_Declaration + * @apiHeader Accept application/json + * @apiHeader Content-Type application/json + * @apiParam (PathVariable) {String} partner_code Required, Partner code + * @apiParam (PathVariable) {String} report_id Required,RoyalPay Declare ID + * @apiUse Sign + * + * @apiSuccess {String} return_code Execution result + * @apiSuccess {String} report_status Result status + * @apiSuccess {String} report_id Client declare ID + * @apiSuccess {String} return_msg Error Description + * @apiSuccess {String} order_id RoyalPay Order + * + * @apiUse GlobalError + * @apiError (ERROR_CODE) ORDER_MISMATCH Order is not belong to this partner * */ function apis() { diff --git a/src/main/java/au/com/royalpay/payment/manage/custom/beans/QueryCustomVo.java b/src/main/java/au/com/royalpay/payment/manage/custom/beans/QueryCustomVo.java index 1297d19f7..0f285f0ec 100644 --- a/src/main/java/au/com/royalpay/payment/manage/custom/beans/QueryCustomVo.java +++ b/src/main/java/au/com/royalpay/payment/manage/custom/beans/QueryCustomVo.java @@ -1,9 +1,12 @@ package au.com.royalpay.payment.manage.custom.beans; +import au.com.royalpay.payment.core.exceptions.ParamInvalidException; import com.alibaba.fastjson.JSONObject; import org.apache.commons.lang3.StringUtils; +import org.apache.commons.lang3.time.DateUtils; +import java.text.DateFormat; import java.text.ParseException; import java.text.SimpleDateFormat; @@ -12,8 +15,9 @@ import java.text.SimpleDateFormat; * @date 2018/7/27 */ public class QueryCustomVo { - - private String date; + private final DateFormat format = new SimpleDateFormat("yyyyMMdd"); + private String datefrom; + private String dateto; private String channel; private String report_status; private int page = 1; @@ -21,12 +25,18 @@ public class QueryCustomVo { public JSONObject toParam() { JSONObject result = new JSONObject(); - if (StringUtils.isNotEmpty(date)) { - date = date.replace("Z", " UTC"); - SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS Z"); + if (datefrom != null) { + try { + result.put("from", format.parse(datefrom)); + } catch (ParseException e) { + throw new ParamInvalidException("datefrom", "error.payment.valid.invalid_date_format"); + } + } + if (dateto != null) { try { - result.put("date", format.parse(date)); + result.put("to", DateUtils.addDays(format.parse(dateto), 1)); } catch (ParseException e) { + throw new ParamInvalidException("dateto", "error.payment.valid.invalid_date_format"); } } if (StringUtils.isNotEmpty(channel)) { @@ -54,12 +64,20 @@ public class QueryCustomVo { this.limit = limit; } - public String getDate() { - return date; + public String getDatefrom() { + return datefrom; + } + + public void setDatefrom(String datefrom) { + this.datefrom = datefrom; + } + + public String getDateto() { + return dateto; } - public void setDate(String date) { - this.date = date; + public void setDateto(String dateto) { + this.dateto = dateto; } public String getChannel() { 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 8d473b7a5..47694c5e7 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 @@ -19,7 +19,9 @@ import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; import org.springframework.util.StringUtils; +import java.util.ArrayList; import java.util.List; +import java.util.UUID; import javax.annotation.Resource; @@ -55,7 +57,7 @@ public class CustomServiceImpl implements CustomService { if (report != null) { throw new BadRequestException("report record exist"); } - CustomReport customReport = new CustomReport(addCustomVO.getOrder_id(), addCustomVO.getMch_custom_id(), addCustomVO.getMch_custom_name(), + CustomReport customReport = new CustomReport(UUID.randomUUID().toString(),addCustomVO.getOrder_id(), addCustomVO.getMch_custom_id(), addCustomVO.getMch_custom_name(), addCustomVO.getCustom()); customReport.addExtMchCustom(addCustomVO.getMch_ext_custom_id(), addCustomVO.getMch_ext_custom_name()); if (!CollectionUtils.isEmpty(addCustomVO.getSubOrders())) { @@ -83,7 +85,11 @@ public class CustomServiceImpl implements CustomService { @Override public JSONObject query(JSONObject param, int page, int limit) { param.put("orderStatus", OrderStatus.SUCCESS.getStatus()); - List channels = customSupport.customSupportedChannels(param.getIntValue("client_id")); +// List channels = customSupport.customSupportedChannels(param.getIntValue("client_id")); + List channels = new ArrayList<>(); + channels.add("Wechat"); + channels.add("Alipay"); + channels.add("AlipayOnline"); param.put("channels", channels); if (!StringUtils.isEmpty(param.getString("channel"))) { channels.clear(); diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/custom/CustomReportDetailsMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/custom/CustomReportDetailsMapper.java index 59316c558..1d148ba56 100644 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/custom/CustomReportDetailsMapper.java +++ b/src/main/java/au/com/royalpay/payment/manage/mappers/custom/CustomReportDetailsMapper.java @@ -15,7 +15,7 @@ import cn.yixblog.support.mybatis.autosql.annotations.SqlType; /** * Created by yishuqian on 9/1/16. */ -@AutoMapper(tablename = "pmt_custom_report_details", pkName = "sub_order_no") +@AutoMapper(tablename = "pmt_custom_report_detail", pkName = "sub_order_no") public interface CustomReportDetailsMapper { @AutoSql(type = SqlType.SELECT) List findByReportId(@Param("report_id") String report_id); diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/custom/CustomReportsMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/custom/CustomReportsMapper.java index 441f8756a..f06a9b6e6 100644 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/custom/CustomReportsMapper.java +++ b/src/main/java/au/com/royalpay/payment/manage/mappers/custom/CustomReportsMapper.java @@ -15,7 +15,7 @@ import cn.yixblog.support.mybatis.autosql.annotations.SqlType; /** * Created by yishuqian on 9/1/16. */ -@AutoMapper(tablename = "pmt_custom_reports", pkName = "report_id") +@AutoMapper(tablename = "pmt_custom_report", pkName = "report_id") public interface CustomReportsMapper { @AutoSql(type = SqlType.SELECT) JSONObject findOne(@Param("report_id") String report_id); diff --git a/src/main/resources/au/com/royalpay/payment/manage/analysis/mappers/ClientAnalysisMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/analysis/mappers/ClientAnalysisMapper.xml index 4135ca3e0..86bc1fc60 100644 --- a/src/main/resources/au/com/royalpay/payment/manage/analysis/mappers/ClientAnalysisMapper.xml +++ b/src/main/resources/au/com/royalpay/payment/manage/analysis/mappers/ClientAnalysisMapper.xml @@ -247,6 +247,7 @@ (SELECT p.sub_merchant_id FROM sys_clients p INNER JOIN pmt_orders o ON o.client_id = p.client_id AND o.status >4 AND o.confirm_time IS NOT NULL WHERE datediff(now(), o.create_time) <= 25 AND p.sub_merchant_id is not null GROUP BY p.sub_merchant_id) AND c.sub_merchant_id IS not null AND c.merchant_id IS NOT NULL AND (c.approve_result = 1 OR c.approve_result= 2) AND c.is_valid = 1 + AND c.enable_wechat = 1 ]]> GROUP by c.sub_merchant_id diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/custom/CustomReportsMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/custom/CustomReportsMapper.xml index ec3880a92..a8653e78c 100644 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/custom/CustomReportsMapper.xml +++ b/src/main/resources/au/com/royalpay/payment/manage/mappers/custom/CustomReportsMapper.xml @@ -12,7 +12,7 @@ pmt_transactions t on o.order_id = t.order_id left join - pmt_custom_reports r + pmt_custom_report r on r.order_id = o.order_id where o.channel in ( @@ -33,13 +33,12 @@ - - and DATE(t.transaction_time) = #{date} - + and t.transaction_time >= #{from} + and t.transaction_time < #{to} and r.report_status = #{report_status} order by transaction_time desc - \ No newline at end of file + diff --git a/src/main/ui/index.html b/src/main/ui/index.html index 728e156ab..c6b305286 100644 --- a/src/main/ui/index.html +++ b/src/main/ui/index.html @@ -934,7 +934,7 @@ margin-bottom: 10%;"/>
  • - Report Custom + Customs Declaration
  • @@ -1071,4 +1071,4 @@ margin-bottom: 10%;"/> - \ No newline at end of file + diff --git a/src/main/ui/static/payment/custom/custom.js b/src/main/ui/static/payment/custom/custom.js index d81c288da..e62eb0dea 100644 --- a/src/main/ui/static/payment/custom/custom.js +++ b/src/main/ui/static/payment/custom/custom.js @@ -11,7 +11,41 @@ app.controller('customCtrl', ['$scope', '$http', 'commonDialog','$filter','$uibModal', function ($scope, $http, commonDialog,$filter,$uibModal) { $scope.pagination = {}; $scope.customOrders = {}; - $scope.params = {channel:'ALL',report_status:'ALL'}; + $scope.params = {channel :'ALL' ,report_status:'ALL',datefrom: new Date(), dateto: new Date()}; + $scope.chooseToday = function () { + $scope.params.datefrom = $scope.params.dateto = new Date(); + $scope.loadList(1); + }; + $scope.chooseYesterday = function () { + var yesterday = new Date(); + yesterday.setDate(yesterday.getDate() - 1); + $scope.params.datefrom = $scope.params.dateto = yesterday; + $scope.loadList(1); + }; + $scope.chooseLast7Days = function () { + $scope.params.dateto = new Date(); + var day = new Date(); + day.setDate(day.getDate() - 7); + $scope.params.datefrom = day; + $scope.loadList(1); + }; + $scope.thisMonth = function () { + $scope.params.dateto = new Date(); + var monthBegin = new Date(); + monthBegin.setDate(1); + $scope.params.datefrom = monthBegin; + $scope.loadList(1); + }; + $scope.lastMonth = function () { + var monthFinish = new Date(); + monthFinish.setDate(0); + $scope.params.dateto = monthFinish; + var monthBegin = new Date(); + monthBegin.setDate(0); + monthBegin.setDate(1); + $scope.params.datefrom = monthBegin; + $scope.loadList(1); + }; $scope.loadList = function () { var params = angular.copy($scope.params); if (params.channel =='ALL'){ @@ -20,6 +54,16 @@ if (params.report_status =='ALL'){ delete params.report_status; } + if (params.datefrom) { + params.datefrom = $filter('date')(params.datefrom, 'yyyyMMdd'); + } else { + params.datefrom = $filter('date')(new Date(), 'yyyyMMdd'); + } + if (params.dateto) { + params.dateto = $filter('date')(params.dateto, 'yyyyMMdd'); + } else { + params.dateto = $filter('date')(new Date(), 'yyyyMMdd'); + } params.page = $scope.pagination.page || 1; $http.get('/custom/query',{params: params}).then(function (resp) { $scope.customOrders = resp.data.data; @@ -109,12 +153,24 @@ } $scope.custom.subOrders = $scope.subOrders; var param = angular.copy($scope.custom); - $http.post('/custom', param).then(function (resp) { + param.custom = $scope.custom.ext_custom_info[0]; + $http.post('/custom',param).then(function (resp) { $scope.$close(); }, function (resp) { commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'}); $scope.$close(); - }) + }); + if($scope.custom.ext_custom_info[1]){ + var infos = angular.copy($scope.custom); + infos.custom = $scope.custom.ext_custom_info[1]; + $http.post('/custom', infos).then(function (resp) { + $scope.$close(); + }, function (resp) { + commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'}); + $scope.$close(); + }) + } + } $scope.removeSubOrders = function (order) { for(var i= 0 ;i<$scope.subOrders.length;i++){ @@ -195,13 +251,13 @@ return function (status) { switch (status + '') { case '0': - return 'Saved'; + return '暂存'; case '1': - return 'Submitted'; + return '已提交'; case '2': - return 'Failed'; + return '失败'; case '3': - return 'Success'; + return '成功'; } } }); @@ -209,4 +265,4 @@ return app; -}); \ No newline at end of file +}); diff --git a/src/main/ui/static/payment/custom/templates/custom.html b/src/main/ui/static/payment/custom/templates/custom.html index 15473745f..1d16e662d 100644 --- a/src/main/ui/static/payment/custom/templates/custom.html +++ b/src/main/ui/static/payment/custom/templates/custom.html @@ -5,12 +5,12 @@
    -

    Custom

    +

    海关

    @@ -35,52 +35,114 @@
    -->
    - +

    All | + ng-click="params.report_status='ALL';loadList()">全部 | Saved | + ng-click="params.report_status='0';loadList()">暂存 | Submitted | + ng-click="params.report_status='1';loadList()">已提交 | Failed | + ng-click="params.report_status='2';loadList()">失败 | Success | + ng-click="params.report_status='3';loadList()">成功 |

    - +
    - +

    + 全部 | + 微信 | + 支付宝| + 支付宝线上 +

    +
    +
    +
    + +
    + +
    + ~ +
    + +
    +
    + 今日 +
    +
    + 昨日 +
    + +
    + 本月 +
    +
    + 上月 +
    +
    + +
    +
    +
    -
    + + + + + + + + + + +
    -

    - Custom Order List +

    + 报关订单列表 + 商户报关API

    - - - - - - + + + + + + @@ -116,20 +178,20 @@
    Order IdTimeOrder AmountCNY AmountReport StatusOperation订单号时间金额金额(CNY)报关状态操作
    - - Submit + 提交 - - @@ -153,8 +215,7 @@ first-text="«" last-text="»">
    -
    Total Records:{{pagination.totalCount}};Total - Pages:{{pagination.totalPages}} +
    总单数:{{pagination.totalCount}};总页数:{{pagination.totalPages}}
    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 decf68d7b..7fd6cfe75 100644 --- a/src/main/ui/static/payment/custom/templates/custom_add.html +++ b/src/main/ui/static/payment/custom/templates/custom_add.html @@ -1,6 +1,6 @@