diff --git a/cweb/src/main/java/com/cweb/controller/BsMerController.java b/cweb/src/main/java/com/cweb/controller/BsMerController.java index 75bf429..b88b870 100644 --- a/cweb/src/main/java/com/cweb/controller/BsMerController.java +++ b/cweb/src/main/java/com/cweb/controller/BsMerController.java @@ -428,6 +428,7 @@ public class BsMerController { || StringUtils.isBlank(storeModel.getDoorHeadImg()) || StringUtils.isBlank(storeModel.getCashRegisterImg()) || StringUtils.isBlank(storeModel.getInternalImg()) + || storeModel.getStoreRegion() == null || StringUtils.isBlank(storeModel.getStoreRegion().getAddress()) || storeModel.getStoreRegion().getAreaCode() == null || storeModel.getStoreRegion().getLongitude() == null diff --git a/cweb/src/main/java/com/cweb/controller/TestController.java b/cweb/src/main/java/com/cweb/controller/TestController.java index cd87b62..bddd335 100644 --- a/cweb/src/main/java/com/cweb/controller/TestController.java +++ b/cweb/src/main/java/com/cweb/controller/TestController.java @@ -303,17 +303,19 @@ public class TestController { public ResponseData saasActivity() { try { + // return ResponseMsgUtil.success(saasActivityService.queryAgentActivityStatus("73")); - // return ResponseMsgUtil.success(saasActivityService.queryAgentActivityStatus("284")); +/* List externalCustomerNos = new ArrayList<>(); - externalCustomerNos.add("822290058120KK2"); - externalCustomerNos.add("822290058120LMB"); - // return ResponseMsgUtil.success(saasActivityService.customerRegisterActivity("6000000417", null, externalCustomerNos)); - return ResponseMsgUtil.success(saasActivityService.agentRegisterActivity("6000000417")); - - // return ResponseMsgUtil.success(saasActivityService.queryAgentActivity()); - /*return ResponseMsgUtil.success(saasActivityService.queryCustomerActivityStatus("284", "822290058120KK2")); + externalCustomerNos.add("8226900581219V0"); + externalCustomerNos.add("8226900445800HB"); + return ResponseMsgUtil.success(saasActivityService.customerRegisterActivity("73", null, externalCustomerNos)); */ + + // return ResponseMsgUtil.success(saasActivityService.agentRegisterActivity("73")); + // return ResponseMsgUtil.success(saasActivityService.queryAgentActivityList()); + return ResponseMsgUtil.success(saasActivityService.queryCustomerActivityStatus("73", "8226900445800HB")); + } catch (Exception e) { log.error(e.getMessage(), e); return ResponseMsgUtil.exception(e); @@ -326,8 +328,9 @@ public class TestController { public ResponseData generate() { try { - MerBasisModel merDetail = merService.getMerDetail(57L); + MerBasisModel merDetail = merService.getMerDetail(57L); +/* Configuration cfg = new Configuration(); cfg.setDirectoryForTemplateLoading(new File("D:/home")); Template template = cfg.getTemplate("indexHTKWECHAT_PAY.html"); @@ -377,8 +380,9 @@ public class TestController { param.put("receiveDetail", merDetail.getStoreModel().getStoreRegion().getAddress()); param.put("agencyName", "重庆惠付科技有限公司"); GenerateAgreementUtil.createAgreementPicture(merDetail.getId(),GenerateAgreementUtil.writeHtml(merDetail.getId(),template, param)); +*/ - return ResponseMsgUtil.success(null); + return ResponseMsgUtil.success(saasCommon.fileUpload(new File(CommonSysConst.getSysConfig().getFile_url() +"/"+ SaasMerService.generateAddContract(merDetail)), "OPENING_PERMIT", "0").getString("url")); } catch (Exception e) { log.error(e.getMessage(), e); diff --git a/service/src/main/java/com/hfkj/channel/saas/SaasActivityService.java b/service/src/main/java/com/hfkj/channel/saas/SaasActivityService.java index 1021bac..5b9d716 100644 --- a/service/src/main/java/com/hfkj/channel/saas/SaasActivityService.java +++ b/service/src/main/java/com/hfkj/channel/saas/SaasActivityService.java @@ -77,7 +77,7 @@ public class SaasActivityService { JSONObject obj = new JSONObject(); obj.put("data", Base64.encodeBase64String(RSAUtil.encryptByPrivateKey(JSONObject.toJSONString(param).getBytes(), Base64.decodeBase64(RSAUtil.PRIVATE_KEY)))); - JSONObject responseObj = HttpsUtils.doPost(SaasConfig.requestUrl + "https://test.wsmsd.cn/sit/htkmarketing/open/welfare/agent/status", obj, header); + JSONObject responseObj = HttpsUtils.doPost(SaasConfig.requestUrl + "htkmarketing/open/welfare/agent/status", obj, header); System.out.println("参数:" + JSONObject.toJSONString(param)); System.out.println("加密:" + obj.getString("data")); System.out.println("request:" + obj.toJSONString()); diff --git a/service/src/main/java/com/hfkj/channel/saas/SaasMerService.java b/service/src/main/java/com/hfkj/channel/saas/SaasMerService.java index 4bbd811..5443058 100644 --- a/service/src/main/java/com/hfkj/channel/saas/SaasMerService.java +++ b/service/src/main/java/com/hfkj/channel/saas/SaasMerService.java @@ -219,8 +219,8 @@ public class SaasMerService { // 协议 attchMap = new HashMap<>(); - attchMap.put("type", MerAttachType.type11.getLklCode()); - attchMap.put("id", saasCommon.fileUpload(new File(CommonSysConst.getSysConfig().getFile_url() +"/"+ generateAddContract(basisModel)), MerAttachType.type11.getLklCode(), "0").getString("url")); + attchMap.put("type", MerAttachType.type11.getLklSaasCode()); + attchMap.put("id", saasCommon.fileUpload(new File(CommonSysConst.getSysConfig().getFile_url() +"/"+ generateAddContract(basisModel)), MerAttachType.type11.getLklSaasCode(), "0").getString("url")); attchMapList.add(attchMap); body.put("bizContent", bizContent); @@ -533,7 +533,7 @@ public class SaasMerService { public static String generateAddContract(MerBasisModel merDetail) { try { Configuration cfg = new Configuration(); - cfg.setDirectoryForTemplateLoading(new File("D:/home")); + cfg.setDirectoryForTemplateLoading(new File(CommonSysConst.getSysConfig().getFile_url(), "template")); Template template = cfg.getTemplate("indexHTKWECHAT_PAY.html"); Map param = new HashMap<>(); diff --git a/service/src/main/java/com/hfkj/channel/saas/utils/GenerateAgreementUtil.java b/service/src/main/java/com/hfkj/channel/saas/utils/GenerateAgreementUtil.java index 776458a..3aadf11 100644 --- a/service/src/main/java/com/hfkj/channel/saas/utils/GenerateAgreementUtil.java +++ b/service/src/main/java/com/hfkj/channel/saas/utils/GenerateAgreementUtil.java @@ -1,5 +1,6 @@ package com.hfkj.channel.saas.utils; +import com.hfkj.config.CommonSysConst; import freemarker.template.Template; import freemarker.template.TemplateException; import net.coobird.thumbnailator.Thumbnails; @@ -31,8 +32,8 @@ public class GenerateAgreementUtil { */ // html 替换占位符 public static File writeHtml(Long merId,Template template, Map data) throws IOException, TemplateException { - String fileName = merId+"/"+System.currentTimeMillis()+".html"; - File htmlFile = new File("D:/home", fileName); + String fileName = "merchant/"+merId+"/"+System.currentTimeMillis()+".html"; + File htmlFile = new File(CommonSysConst.getSysConfig().getFile_url(), fileName); FileWriter sw = new FileWriter(htmlFile); log.info("生成协议html, 地址:{}, 参数:{} ", htmlFile.getAbsolutePath(), data); template.process(data, sw); @@ -46,12 +47,12 @@ public class GenerateAgreementUtil { * @throws IOException */ public static String createAgreementPicture(Long merId,File htmlFile) throws IOException { - String fileName = merId+"/"+htmlFile.getName() + ".jpg"; - File outputFile = new File("D:/home", htmlFile.getName() + ".jpg"); + String fileName = "merchant/"+merId+"/"+htmlFile.getName() + ".jpg"; + File outputFile = new File(CommonSysConst.getSysConfig().getFile_url(), fileName); log.info("生成图片开始, HTML地址 {}, 图片地址:{}", htmlFile.getAbsolutePath(), outputFile.getAbsolutePath()); // windows - String commandProcess = "cmd.exe /c wkhtmltoimage --width 400 --quality 94 " + htmlFile.getPath() + " " + outputFile.getPath(); - // String commandProcess = "wkhtmltoimage --width 400 --quality 94 " + htmlFile.getPath() + " " + outputFile.getPath(); + // String commandProcess = "cmd.exe /c wkhtmltoimage --width 400 --quality 94 " + htmlFile.getPath() + " " + outputFile.getPath(); + String commandProcess = "wkhtmltoimage --width 400 --quality 94 " + htmlFile.getPath() + " " + outputFile.getPath(); log.info("协议执行procommand:{}", commandProcess); long startTime = System.currentTimeMillis(); //获取开始时间 Process process = Runtime.getRuntime().exec(commandProcess); diff --git a/service/src/main/resources/dev/commonConfig.properties b/service/src/main/resources/dev/commonConfig.properties index 4ce83b3..0e6d759 100644 --- a/service/src/main/resources/dev/commonConfig.properties +++ b/service/src/main/resources/dev/commonConfig.properties @@ -20,31 +20,31 @@ lkl_v2_private_key=/home/project/gratia-pay/cert/lakala/v2/OP00000003_private_ke lkl_mer_contract_ret_url=https://gratia-pay.dctpay.com/brest/laKaLaNotify/merContract lkl_micro_pay_ret_url=https://gratia-pay.dctpay.com/crest/laKaLaNotify/microPay -#lkl_saas_client_id=testsit -#lkl_saas_client_secret=EguwEckByf2I6u6z -#lkl_saas_activity_id=37 -#lkl_saas_user_no=20000101 -#lkl_saas_request_url=https://test.wsmsd.cn/sit/ -#lkl_saas_request_mer_registration_token_url=https://test.wsmsd.cn/sit/htkauth/oauth/token -#lkl_saas_request_mer_registration_url=https://test.wsmsd.cn/sit/htkregistration/merchant/ -#lkl_saas_request_mer_update_url=https://test.wsmsd.cn/sit/htk-api/ -#lkl_saas_request_mer_registration_common_url=https://test.wsmsd.cn/sit/htkregistration/ -#lkl_saas_request_mer_url=https://test.wsmsd.cn/sit/htkmerchants/ -#lkl_saas_public_key=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCp5aV3ZiXG2R8Yd8Nxocv+cF7VAUHBc0TF4MNne7mI8wM2yEP2QgI+rK1qDf6G7ZFPhutpIHKQchpolbSuC0vgaHpSjO9OUs1fpnK/JjZq9o8DatUsA0n4Fccec9NBbV5dy5yrwro7xmDpsevp1/IeiIssi1+iD+nBWqqVFx7GVQIDAQAB -#lkl_saas_private_key="MIICdgIBADANBgkqhkiG9w0BAQEFAASCAmAwggJcAgEAAoGBAKnlpXdmJcbZHxh3w3Ghy/5wXtUBQcFzRMXgw2d7uYjzAzbIQ/ZCAj6srWoN/obtkU+G62kgcpByGmiVtK4LS+BoelKM705SzV+mcr8mNmr2jwNq1SwDSfgVxx5z00FtXl3LnKvCujvGYOmx6+nX8h6IiyyLX6IP6cFaqpUXHsZVAgMBAAECgYA4NpeM7etJ48T6H4Y3LsWEJkH6UDQlgbIblsaQkstMmLtTgOebrzN28UNfd8njcu9FVOrHGclOKbK7L+1cOLiduWsZKc/c/gAy9wAR4EhoLvlerH9EEPiPWFxdEDbMxPqlkpqLOo+PxHrhTn4vU4CaPdJtL2ujKn7nmsUdUDWo8QJBANS1TlM6nhPt2XlzN5kGfsJ4kBYNjuLXNA2YdNuC2ttYvEXHJ9T70FN/GnRBBIZu47uHH3Ie5nfep+qMk6a8RP8CQQDMecIyI0z1kVt+tOfWKw2ZFLsi74708qTaeR4W1ABtkngj1+bxoWWXr3KqhjqJkWxnhioSfXqu7CScNzjdM1CrAkAQd+ESjI1EmbumrYb2cAxMXi05p98SLPs4uj8B58WuCda5yEuLL9vXOxX/PjFtfxRepn2GxmGtki2J+UxNMnJdAkAFoORjlO0tZU7rcfdfwdeh+xwbnhSFUZiQGv1lC3jnizybX/oPdK3jOwUhBIjf+IzPXLYTxDh4UC/BzRNXo235AkEAhgYBk6H7RU2iIuvwz1c6CtE1gJ8DvEp1F0KOMWMFB0KCpDXUToix0dlMz962FozYENi4X4zYQo6nFwlXeS3Pfw== - -lkl_saas_client_id=huifu -lkl_saas_client_secret=f65VVjqJfLtc177F -lkl_saas_activity_id=12 -lkl_saas_user_no=22206482 -lkl_saas_request_url=https://tkapi.lakala.com/ -lkl_saas_request_mer_registration_token_url=https://tkapi.lakala.com/auth/oauth/token -lkl_saas_request_mer_registration_url=https://htkactvi.lakala.com/registration/merchant/ -lkl_saas_request_mer_update_url=https://htkapi.lakala.com/api/ -lkl_saas_request_mer_registration_common_url=https://htkactvi.lakala.com/registration/ -lkl_saas_request_mer_url=https://tkapi.lakala.com/htkmerchants/ -lkl_saas_public_key=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDAUkzRA+4GOS5OzYqxD/UJwM6p9to1dPvetL/7RbMa93o46qToPlPtaW61EvblOldHcBEHo7AGXXKmIYr7t2Up1PZC0g7UMpno/b5WkT6ieJ601Xreuj8hhyf2/xoej5vpi4/+lAr9YF+5GcyaVf4gfzTNJrmKj9PfvX5B3rUH2QIDAQAB -lkl_saas_private_key=MIICdwIBADANBgkqhkiG9w0BAQEFAASCAmEwggJdAgEAAoGBAMBSTNED7gY5Lk7NirEP9QnAzqn22jV0+960v/tFsxr3ejjqpOg+U+1pbrUS9uU6V0dwEQejsAZdcqYhivu3ZSnU9kLSDtQymej9vlaRPqJ4nrTVet66PyGHJ/b/Gh6Pm+mLj/6UCv1gX7kZzJpV/iB/NM0muYqP09+9fkHetQfZAgMBAAECgYB42D3kaC+8QVnTsluffoNeKYSyT6Y1SNiqy7CGVvl/zFlEQkx0khVybHlf1hbFWq9U+Bn7TuNgXH+Z3CHUoRwy4Ap/kMx637iRatoC8F/kcPaiB7JFQfdrxhgK858dSyHCQ2OXXQDJgJdth+oF9FylVsrDu5Sw3ha4OuzrmufuwQJBAPnPPSeFr1wu7kH6I+A5E49fMbAm7EU+3TYVzxNH1lr3X/LWuK9pi/LVPrSR4eNgAypyQWREIqdpBIiJ9bOnwa0CQQDFFl0zTQTVTWf5r/hwgCUMo4gHr2y/q7XMNe6n5fh4SQuQ+o4gW+BGHzDrT97G5hFGPL+w5niGuEBHWSo5/9xdAkEAnrxdM7vzDjSUGUCFg3lBQJ1QyYoyIF4t2qxJBQtk3jDKu1hNysjasNdoHP2F+CGOYW5wtvHEw3Qr+UcQ5bP3kQJABPAcga6KUnXQBxd7mAX956UpQVgJ13uL4IPxaM+APDNIUOeWLAVhRyB870hfAoi9Ig9fliUQG//9zEvVnQJmGQJBAOb8Z0mGMEbEeAyEKjqoNiQkkIcoBdmPKNFUoUJ6ohcBNOoMfklvNsf2+BPfuhs26tvhYDBRgCAfOVhqTQcGj6I= +lkl_saas_client_id=testsit +lkl_saas_client_secret=EguwEckByf2I6u6z +lkl_saas_activity_id=37 +lkl_saas_user_no=20000101 +lkl_saas_request_url=https://test.wsmsd.cn/sit/ +lkl_saas_request_mer_registration_token_url=https://test.wsmsd.cn/sit/htkauth/oauth/token +lkl_saas_request_mer_registration_url=https://test.wsmsd.cn/sit/htkregistration/merchant/ +lkl_saas_request_mer_update_url=https://test.wsmsd.cn/sit/htk-api/ +lkl_saas_request_mer_registration_common_url=https://test.wsmsd.cn/sit/htkregistration/ +lkl_saas_request_mer_url=https://test.wsmsd.cn/sit/htkmerchants/ +lkl_saas_public_key=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCp5aV3ZiXG2R8Yd8Nxocv+cF7VAUHBc0TF4MNne7mI8wM2yEP2QgI+rK1qDf6G7ZFPhutpIHKQchpolbSuC0vgaHpSjO9OUs1fpnK/JjZq9o8DatUsA0n4Fccec9NBbV5dy5yrwro7xmDpsevp1/IeiIssi1+iD+nBWqqVFx7GVQIDAQAB +lkl_saas_private_key="MIICdgIBADANBgkqhkiG9w0BAQEFAASCAmAwggJcAgEAAoGBAKnlpXdmJcbZHxh3w3Ghy/5wXtUBQcFzRMXgw2d7uYjzAzbIQ/ZCAj6srWoN/obtkU+G62kgcpByGmiVtK4LS+BoelKM705SzV+mcr8mNmr2jwNq1SwDSfgVxx5z00FtXl3LnKvCujvGYOmx6+nX8h6IiyyLX6IP6cFaqpUXHsZVAgMBAAECgYA4NpeM7etJ48T6H4Y3LsWEJkH6UDQlgbIblsaQkstMmLtTgOebrzN28UNfd8njcu9FVOrHGclOKbK7L+1cOLiduWsZKc/c/gAy9wAR4EhoLvlerH9EEPiPWFxdEDbMxPqlkpqLOo+PxHrhTn4vU4CaPdJtL2ujKn7nmsUdUDWo8QJBANS1TlM6nhPt2XlzN5kGfsJ4kBYNjuLXNA2YdNuC2ttYvEXHJ9T70FN/GnRBBIZu47uHH3Ie5nfep+qMk6a8RP8CQQDMecIyI0z1kVt+tOfWKw2ZFLsi74708qTaeR4W1ABtkngj1+bxoWWXr3KqhjqJkWxnhioSfXqu7CScNzjdM1CrAkAQd+ESjI1EmbumrYb2cAxMXi05p98SLPs4uj8B58WuCda5yEuLL9vXOxX/PjFtfxRepn2GxmGtki2J+UxNMnJdAkAFoORjlO0tZU7rcfdfwdeh+xwbnhSFUZiQGv1lC3jnizybX/oPdK3jOwUhBIjf+IzPXLYTxDh4UC/BzRNXo235AkEAhgYBk6H7RU2iIuvwz1c6CtE1gJ8DvEp1F0KOMWMFB0KCpDXUToix0dlMz962FozYENi4X4zYQo6nFwlXeS3Pfw== + +#lkl_saas_client_id=huifu +#lkl_saas_client_secret=f65VVjqJfLtc177F +#lkl_saas_activity_id=12 +#lkl_saas_user_no=22206482 +#lkl_saas_request_url=https://tkapi.lakala.com/ +#lkl_saas_request_mer_registration_token_url=https://tkapi.lakala.com/auth/oauth/token +#lkl_saas_request_mer_registration_url=https://htkactvi.lakala.com/registration/merchant/ +#lkl_saas_request_mer_update_url=https://htkapi.lakala.com/api/ +#lkl_saas_request_mer_registration_common_url=https://htkactvi.lakala.com/registration/ +#lkl_saas_request_mer_url=https://tkapi.lakala.com/htkmerchants/ +#lkl_saas_public_key=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDAUkzRA+4GOS5OzYqxD/UJwM6p9to1dPvetL/7RbMa93o46qToPlPtaW61EvblOldHcBEHo7AGXXKmIYr7t2Up1PZC0g7UMpno/b5WkT6ieJ601Xreuj8hhyf2/xoej5vpi4/+lAr9YF+5GcyaVf4gfzTNJrmKj9PfvX5B3rUH2QIDAQAB +#lkl_saas_private_key=MIICdwIBADANBgkqhkiG9w0BAQEFAASCAmEwggJdAgEAAoGBAMBSTNED7gY5Lk7NirEP9QnAzqn22jV0+960v/tFsxr3ejjqpOg+U+1pbrUS9uU6V0dwEQejsAZdcqYhivu3ZSnU9kLSDtQymej9vlaRPqJ4nrTVet66PyGHJ/b/Gh6Pm+mLj/6UCv1gX7kZzJpV/iB/NM0muYqP09+9fkHetQfZAgMBAAECgYB42D3kaC+8QVnTsluffoNeKYSyT6Y1SNiqy7CGVvl/zFlEQkx0khVybHlf1hbFWq9U+Bn7TuNgXH+Z3CHUoRwy4Ap/kMx637iRatoC8F/kcPaiB7JFQfdrxhgK858dSyHCQ2OXXQDJgJdth+oF9FylVsrDu5Sw3ha4OuzrmufuwQJBAPnPPSeFr1wu7kH6I+A5E49fMbAm7EU+3TYVzxNH1lr3X/LWuK9pi/LVPrSR4eNgAypyQWREIqdpBIiJ9bOnwa0CQQDFFl0zTQTVTWf5r/hwgCUMo4gHr2y/q7XMNe6n5fh4SQuQ+o4gW+BGHzDrT97G5hFGPL+w5niGuEBHWSo5/9xdAkEAnrxdM7vzDjSUGUCFg3lBQJ1QyYoyIF4t2qxJBQtk3jDKu1hNysjasNdoHP2F+CGOYW5wtvHEw3Qr+UcQ5bP3kQJABPAcga6KUnXQBxd7mAX956UpQVgJ13uL4IPxaM+APDNIUOeWLAVhRyB870hfAoi9Ig9fliUQG//9zEvVnQJmGQJBAOb8Z0mGMEbEeAyEKjqoNiQkkIcoBdmPKNFUoUJ6ohcBNOoMfklvNsf2+BPfuhs26tvhYDBRgCAfOVhqTQcGj6I= wechat_pay_notify_url=https://gratia-pay.dctpay.com/crest/weiXinNotify/jsapiPay