diff --git a/src/main/java/au/com/royalpay/payment/manage/application/beans/ClientPreApplyBean.java b/src/main/java/au/com/royalpay/payment/manage/application/beans/ClientPreApplyBean.java index e2b44065d..998a6b1d5 100644 --- a/src/main/java/au/com/royalpay/payment/manage/application/beans/ClientPreApplyBean.java +++ b/src/main/java/au/com/royalpay/payment/manage/application/beans/ClientPreApplyBean.java @@ -3,7 +3,6 @@ package au.com.royalpay.payment.manage.application.beans; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; -import com.alibaba.fastjson.annotation.JSONField; import org.apache.commons.lang3.StringUtils; import javax.validation.constraints.NotEmpty; @@ -77,30 +76,15 @@ public class ClientPreApplyBean { private String registered_postcode; @NotEmpty(message = "logo_url can't be null") private String logo_url; - @NotEmpty(message = "company_website can't be null") private String company_website; - @NotEmpty(message = "company_photo can't be null") private String company_photo; - @NotEmpty(message = "royalpayindustry can't be null") + //@NotEmpty(message = "royalpayindustry can't be null") private String royalpayindustry; - @NotEmpty(message = "alipayindustry can't be null") + //@NotEmpty(message = "alipayindustry can't be null") private String alipayindustry; - -/* private String contact_job; - private String representative_person; - private String representative_phone; - private String representative_email; - private String representative_job_title; - private String registered_address; - private String registered_suburb; - private String registered_state; - private String registered_postcode; - private String logo_url; - private String company_website; - private String company_photo; - private String royalpayindustry; - private String alipayindustry;*/ + private String store_photo; + private String contract_url;//合同地址 public JSONObject insertObject() { JSONObject res = (JSONObject) JSON.toJSON(this); @@ -410,4 +394,20 @@ public class ClientPreApplyBean { public void setAlipayindustry(String alipayindustry) { this.alipayindustry = alipayindustry; } + + public String getContract_url() { + return contract_url; + } + + public void setContract_url(String contract_url) { + this.contract_url = contract_url; + } + + public String getStore_photo() { + return store_photo; + } + + public void setStore_photo(String store_photo) { + this.store_photo = store_photo; + } } diff --git a/src/main/java/au/com/royalpay/payment/manage/application/core/impls/SimpleClientApplyServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/application/core/impls/SimpleClientApplyServiceImpl.java index 2fe4659db..7dd41c36b 100644 --- a/src/main/java/au/com/royalpay/payment/manage/application/core/impls/SimpleClientApplyServiceImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/application/core/impls/SimpleClientApplyServiceImpl.java @@ -89,6 +89,8 @@ public class SimpleClientApplyServiceImpl implements SimpleClientApplyService { private SignInAccountService signInAccountService; @Resource private SimpleClientApplyService simpleClientApplyService; + @Resource + private ClientFilesMapper clientFilesMapper; private Logger logger = LoggerFactory.getLogger(getClass()); @Resource private ClientAccountMapper clientAccountMapper; @@ -112,8 +114,8 @@ public class SimpleClientApplyServiceImpl implements SimpleClientApplyService { @Resource private ClientBDMapper clientBDMapper; private ThreadPoolExecutor pool = new ThreadPoolExecutor(1, 10, 5, TimeUnit.SECONDS, new LinkedBlockingQueue()); - private final String IMG_AGGREGATE_FILE = "https://file.royalpay.com.au/open/2019/09/06/1567741055646_qeWC7kwqEwsJjRHisJSyAjqnB9nnnh.pdf"; + private static final String CLIENT_AGREE_FILE = "client_agree_file"; @Resource private SmsSender smsSender; @Resource @@ -363,7 +365,6 @@ public class SimpleClientApplyServiceImpl implements SimpleClientApplyService { JSONObject rate = test.getJSONObject("t"+clean_days.trim()); - apply.put("wechat_rate",rate.getString("Wechat")); apply.put("alipay_rate",rate.getString("Alipay")); apply.put("alipay_online_rate",rate.getString("AlipayOnline")); @@ -401,22 +402,27 @@ public class SimpleClientApplyServiceImpl implements SimpleClientApplyService { ImageIO.write(img, "png", out); apply.put("img","data:image/png;base64," + Base64.encodeBase64String(out.toByteArray())); - return exportImgAggregateFile(username, apply); + return exportImgAggregateFile(apply); } - private JSONObject exportImgAggregateFile(String username, JSONObject apply) throws IOException{ + private JSONObject exportImgAggregateFile(JSONObject apply) throws IOException{ InputStream stream = null; JSONObject contractInfo = new JSONObject(); try { PdfUtils pdu = new PdfUtils(); pdu.setTemplatePdfPath(IMG_AGGREGATE_FILE); pdu.setPdfTemplate(apply); - File file = new File(username + "_agreement.pdf"); + File file = new File(apply.getString("username") + "_agreement.pdf"); ByteArrayOutputStream bos = pdu.templetPdfBos(file,"STSong-Light","UniGB-UCS2-H"); stream = new ByteArrayInputStream(bos.toByteArray()); - JSONObject fileInfo = attachmentClient.uploadFile(stream, username + "_" + System.currentTimeMillis() + "_agreement.pdf", false); - + JSONObject fileInfo = attachmentClient.uploadFile(stream, apply.getString("username") + "_" + System.currentTimeMillis() + "_agreement.pdf", false); contractInfo.put("contract_url",fileInfo.getString("url")); + + JSONObject applyInfo = new JSONObject(); + applyInfo.put("client_pre_apply_id", apply.getIntValue("client_pre_apply_id")); + applyInfo.put("update_time", new Date()); + applyInfo.put("contract_url",fileInfo.getString("url")); + sysClientPreMapperMapper.update(applyInfo); } catch (Exception e) { logger.error("合同制作出现问题:", e); throw new BadRequestException("合同制作出现问题:" + e.getMessage()); @@ -476,6 +482,7 @@ public class SimpleClientApplyServiceImpl implements SimpleClientApplyService { sysClient.put("logo_url", apply.getString("logo_url")); sysClient.put("company_website", apply.getString("company_website")); sysClient.put("company_photo", apply.getString("company_photo")); + sysClient.put("store_photo",apply.getString("store_photo")); sysClient.put("contact_email", apply.getString("contact_email")); sysClient.put("contact_phone", "+61"+apply.getString("contact_phone")); sysClient.put("company_phone", apply.getString("company_phone")); @@ -498,6 +505,20 @@ public class SimpleClientApplyServiceImpl implements SimpleClientApplyService { sysClient.put("ali_sub_merchant_id", clientMoniker); clientMapper.save(sysClient); + JSONObject fileJson = new JSONObject(); + fileJson.put("client_id", sysClient.getIntValue("client_id")); + fileJson.put("last_update_date", new Date()); + //fileJson.put("last_update_by", manager.getString("display_name")); + fileJson.put("file_name", CLIENT_AGREE_FILE); + fileJson.put("file_value", apply.getString("contact_url")); + fileJson.put("signature_time", new Date()); + //fileJson.put("signature_ip", manager.getString("signature_ip")); + //fileJson.put("user_agent", manager.getString("user_agent")); + //fileJson.put("signature_account_id", signatureAccountId); + fileJson.put("status", 0); + fileJson.put("is_valid", 1); + clientFilesMapper.save(fileJson); + JSONObject representativeInfo = new JSONObject(); representativeInfo.put("client_id", sysClient.getIntValue("client_id")); representativeInfo.put("representative_person", apply.getString("representative_person")); diff --git a/src/main/java/au/com/royalpay/payment/manage/application/web/SimpleClientApplyController.java b/src/main/java/au/com/royalpay/payment/manage/application/web/SimpleClientApplyController.java index 4080c2351..dbebc3fff 100644 --- a/src/main/java/au/com/royalpay/payment/manage/application/web/SimpleClientApplyController.java +++ b/src/main/java/au/com/royalpay/payment/manage/application/web/SimpleClientApplyController.java @@ -5,6 +5,7 @@ import au.com.royalpay.payment.manage.application.beans.ClientPreApplyStep1Bean; import au.com.royalpay.payment.manage.application.core.SimpleClientApplyService; import au.com.royalpay.payment.manage.permission.manager.PartnerMapping; import au.com.royalpay.payment.tools.CommonConsts; +import au.com.royalpay.payment.tools.connections.attachment.core.AttachmentClient; import au.com.royalpay.payment.tools.env.SysConfigManager; import com.alibaba.fastjson.JSONObject; import org.apache.commons.lang3.StringUtils; @@ -24,6 +25,8 @@ public class SimpleClientApplyController { private SimpleClientApplyService simpleClientApplyService; @Resource private SysConfigManager sysConfigManager; + @Resource + private AttachmentClient attachmentClient; @GetMapping("/account/check") public void checkAccountName(@RequestParam String nation_code,@RequestParam String phone) { @@ -83,6 +86,11 @@ public class SimpleClientApplyController { return simpleClientApplyService.getClientAggregateFile(username, file,clean_days); } + @PostMapping("/risk/business/upload/files") + public JSONObject uploadImage(@RequestParam MultipartFile file) throws Exception { + return attachmentClient.uploadFile(file, false); + } + @GetMapping("/info/bank/{bsb_no}") public JSONObject getBankInfo(@PathVariable String bsb_no, @RequestParam String username, @RequestParam String codeKey) { simpleClientApplyService.checkOrGenerateRegisterProcessKey(username, codeKey); diff --git a/src/main/ui/merchant_application.html b/src/main/ui/merchant_application.html index b8c23a350..640728c88 100644 --- a/src/main/ui/merchant_application.html +++ b/src/main/ui/merchant_application.html @@ -385,6 +385,23 @@ + +
+ +
+
+ +
+ + +
+
+
+
+ +
+ +
+

Required + Field

+

Less + Than 200 + Characters(including symbols and spaces)

+
+
+
@@ -595,6 +630,38 @@
+
+ +
+
1:  + +
+ + + + +
+
+
2:  + +
+ + + + +
+
@@ -796,225 +863,6 @@
-
diff --git a/src/main/ui/static/merchantapplication/merchant_application.js b/src/main/ui/static/merchantapplication/merchant_application.js index bd07c9641..7337f7a7c 100644 --- a/src/main/ui/static/merchantapplication/merchant_application.js +++ b/src/main/ui/static/merchantapplication/merchant_application.js @@ -496,7 +496,7 @@ angular.module('applyPartnerApp', ['ngMessages','ngFileUpload']).controller('app } else { $scope.logoProgress = {value: 0}; Upload.upload({ - url: '/risk/business/upload/files', + url: '/register/risk/business/upload/files', data: {file: file} }).then(function (resp) { delete $scope.logoProgress; @@ -504,7 +504,8 @@ angular.module('applyPartnerApp', ['ngMessages','ngFileUpload']).controller('app $scope.partner.logo_url = resp.data.url; }, function (resp) { delete $scope.logoProgress; - commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'}) + /*commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'})*/ + alert(resp.data.message); }, function (evt) { $scope.logoProgress.value = parseInt(100 * evt.loaded / evt.total); }) @@ -512,4 +513,50 @@ angular.module('applyPartnerApp', ['ngMessages','ngFileUpload']).controller('app } }; + $scope.uploadShopPhoto = function (file) { + if (file != null) { + if (file.size > 2 * 1024 * 1024) { + commonDialog.alert({title: 'Error', content: '文件大小不能超过2MB,请压缩后重试', type: 'error'}) + } else { + $scope.shopPhotoProgress = {value: 0}; + Upload.upload({ + url: '/register/risk/business/upload/files', + data: {file: file} + }).then(function (resp) { + delete $scope.shopPhotoProgress; + $scope.partner.company_photo = resp.data.url; + }, function (resp) { + delete $scope.shopPhotoProgress; + /*commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'})*/ + alert(resp.data.message); + }, function (evt) { + $scope.shopPhotoProgress.value = parseInt(100 * evt.loaded / evt.total); + }) + } + } + }; + + $scope.uploadStorePhoto = function (file) { + if (file != null) { + if (file.size > 2 * 1024 * 1024) { + commonDialog.alert({title: 'Error', content: '文件大小不能超过2MB,请压缩后重试', type: 'error'}) + } else { + $scope.storePhotoProgress = {value: 0}; + Upload.upload({ + url: '/register/risk/business/upload/files', + data: {file: file} + }).then(function (resp) { + delete $scope.storePhotoProgress; + $scope.partner.store_photo = resp.data.url; + }, function (resp) { + delete $scope.storePhotoProgress; + /*commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'})*/ + alert(resp.data.message); + }, function (evt) { + $scope.storePhotoProgress.value = parseInt(100 * evt.loaded / evt.total); + }) + } + } + }; + }]);