diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/core/ClientManager.java b/src/main/java/au/com/royalpay/payment/manage/merchants/core/ClientManager.java index 46267d2f2..b204554ce 100644 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/core/ClientManager.java +++ b/src/main/java/au/com/royalpay/payment/manage/merchants/core/ClientManager.java @@ -393,7 +393,7 @@ public interface ClientManager { void getAggregateCardAgreeFile(String clientMoniker, JSONObject manager, boolean renewal) throws Exception; - void getAggregateCardPromotionaAgreeFile(String clientMoniker, JSONObject manager, boolean renewal,Date promotionalEffectiveDate,int promotionalPeriod) throws Exception; + void getAggregateCardPromotionaAgreeFile(String clientMoniker, JSONObject manager, boolean renewal,String promotionalEffectiveDate,int promotionalPeriod) throws Exception; void getNewAggregateAgreeFile(String clientMoniker, JSONObject manager, boolean renewal) throws Exception; diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/core/impls/ClientManagerImpl.java b/src/main/java/au/com/royalpay/payment/manage/merchants/core/impls/ClientManagerImpl.java index b6a5dba47..60d784df4 100644 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/core/impls/ClientManagerImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/merchants/core/impls/ClientManagerImpl.java @@ -142,6 +142,7 @@ import java.security.InvalidParameterException; import java.security.KeyPair; import java.security.interfaces.RSAPrivateKey; import java.security.interfaces.RSAPublicKey; +import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.List; import java.util.*; @@ -3194,7 +3195,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid } @Override @Transactional - public void getAggregateCardPromotionaAgreeFile(String clientMoniker, JSONObject manager, boolean renewal,Date promotionalEffectiveDate,int promotionalPeriod){ + public void getAggregateCardPromotionaAgreeFile(String clientMoniker, JSONObject manager, boolean renewal,String promotionalEffectiveDate,int promotionalPeriod) throws ParseException { JSONObject client = clientMapper.findClientByMoniker(clientMoniker); if (client == null) { throw new InvalidShortIdException(); @@ -7386,8 +7387,9 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid return info; } - private void exportPromotionalOfferPDF(String clientMoniker,JSONObject manager,Date promotionalEffectiveDate,int promotionalPeriod) { - JSONObject info = convertPromotionalOfferInfo(clientMoniker,convertDateEnglish(promotionalEffectiveDate),promotionalPeriod); + private void exportPromotionalOfferPDF(String clientMoniker,JSONObject manager,String promotionalEffectiveDate,int promotionalPeriod) throws ParseException { + Date date = DateUtils.parseDate(promotionalEffectiveDate,"yyyy-MM-dd"); + JSONObject info = convertPromotionalOfferInfo(clientMoniker,convertDateEnglish(date),promotionalPeriod); String pdfPath = this.getClass().getClassLoader().getResource("").getPath() + "/templates/pdf/promotional_offer.pdf"; String fileName = clientMoniker + "_Promotional_Offer.pdf"; publishExcelCardPDFFile(clientMoniker,manager,fileName, pdfPath, info,PROMOTIONAL_OFFER_FILE); diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/web/PartnerManageController.java b/src/main/java/au/com/royalpay/payment/manage/merchants/web/PartnerManageController.java index d89fc146a..1ea7c90d1 100644 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/web/PartnerManageController.java +++ b/src/main/java/au/com/royalpay/payment/manage/merchants/web/PartnerManageController.java @@ -704,7 +704,7 @@ public class PartnerManageController { */ @ManagerMapping(value = "/{clientMoniker}/export/aggregate/card_promotiona_agree_pdf", method = RequestMethod.GET, role = {ManagerRole.ADMIN, ManagerRole.DIRECTOR, ManagerRole.OPERATOR}) public void exportAggregateCardPromotionaAgreeFile(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, - @RequestParam("date") Date promotionalEffectiveDate,@RequestParam("period") int promotionalPeriod) throws Exception { + @RequestParam("date") String promotionalEffectiveDate,@RequestParam("period") int promotionalPeriod) throws Exception { clientManager.getAggregateCardPromotionaAgreeFile(clientMoniker, manager, false,promotionalEffectiveDate,promotionalPeriod); } diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/system/ClientRateMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/system/ClientRateMapper.xml index 5731bd475..3ab0d1fd2 100644 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/system/ClientRateMapper.xml +++ b/src/main/resources/au/com/royalpay/payment/manage/mappers/system/ClientRateMapper.xml @@ -180,7 +180,7 @@ + +
+ 请输入活动周期: + +
+ + + \ No newline at end of file diff --git a/src/main/ui/static/payment/partner/partner-manage.js b/src/main/ui/static/payment/partner/partner-manage.js index 58f007f79..f29f5c844 100644 --- a/src/main/ui/static/payment/partner/partner-manage.js +++ b/src/main/ui/static/payment/partner/partner-manage.js @@ -424,6 +424,7 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter $scope.isComplianceOfCompanyName = false; $scope.isComplianceOfShortName = false; $scope.isComplianceOfBusinessStructure = false; + $scope.cardPromotionaparams={} var website = partner.data.company_website; if (website != null) { if (website.indexOf('http') != 0) { @@ -685,12 +686,15 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter //制作促销合同 $scope.exportCardPromotionaAgreegatePDF = function(){ - var title = 'Warning'; - $scope.cardPromotionaparams={} - var contentHtml = $sce.trustAsHtml('请选择优惠生效日:'+ '
' + - ' 请输入活动周期: '); + var title = '确认生成Promotional Offer合同'; + var promotiona_date=''; + var promotiona_period =''; + var contentHtml = $sce.trustAsHtml( + '请输入优惠生成日: '+ + ' (eg: 2020-02-01)' + + '
' + + '请输入活动周期数: ' + + ' (unit:week)'); var choises = [{label: '取消', className: 'btn-danger', key: '2', dismiss: true}, {label: '确认提交', className: 'btn-success', key: '1'}]; var content = ''; @@ -701,8 +705,12 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter choises: choises, contentHtml: contentHtml }).then(function (res) { - if(params != null){ - $http.get('/sys/partners/' + $scope.partner.client_moniker + '/export/aggregate/card_promotiona_agree_pdf').then(function () { + var date = document.getElementById("promotiona_date").value; + var period = document.getElementById("promotiona_period").value; + if(date=='' || period==''){ + commonDialog.alert({title: 'Error', content: '选项不得未空', type: 'error'}); + }else{ + $http.get('/sys/partners/' + $scope.partner.client_moniker + '/export/aggregate/card_promotiona_agree_pdf?date='+date+'&period='+period).then(function () { commonDialog.alert({ title: 'Success', content: 'Agreement File Generate Succeed! Please notify BD!', @@ -716,8 +724,8 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'}); }); } - }); + }); } $scope.Export = function () {