From 49485394799fdf39d01492018cd91e2751d23f5f Mon Sep 17 00:00:00 2001 From: kira <164851225@qq.com> Date: Tue, 24 Jul 2018 17:02:24 +0800 Subject: [PATCH] tmp --- .../manage/openim/core/OpenimClient.java | 2 +- src/main/ui/service_client_app.html | 13 +- src/main/ui/service_client_app_outside.html | 34 +++- src/main/ui/service_contact_list_app.html | 14 +- src/main/ui/service_customer.html | 23 +++ src/main/ui/static/images/im/back.png | Bin 0 -> 4254 bytes .../impls/CustomerImpressionImplTest.java | 152 +++++++++++++++--- 7 files changed, 205 insertions(+), 33 deletions(-) create mode 100644 src/main/ui/service_customer.html create mode 100644 src/main/ui/static/images/im/back.png diff --git a/src/main/java/au/com/royalpay/payment/manage/openim/core/OpenimClient.java b/src/main/java/au/com/royalpay/payment/manage/openim/core/OpenimClient.java index 488a36e6d..99d42abac 100644 --- a/src/main/java/au/com/royalpay/payment/manage/openim/core/OpenimClient.java +++ b/src/main/java/au/com/royalpay/payment/manage/openim/core/OpenimClient.java @@ -124,7 +124,7 @@ public class OpenimClient { list2.add(obj3); obj3.setNick("king"); obj3.setIconUrl("https://ss0.baidu.com/73t1bjeh1BF3odCf/it/u=1948403834,955109320&fm=85&s=0D06E5134AD145F30C8D6D680300303A"); - obj3.setUserid("kira1"); + obj3.setUserid("kira2"); obj3.setPassword("xxxxxx"); req.setUserinfos(list2); OpenimUsersAddResponse rsp = null; diff --git a/src/main/ui/service_client_app.html b/src/main/ui/service_client_app.html index ebefe90ef..3332ffd4a 100644 --- a/src/main/ui/service_client_app.html +++ b/src/main/ui/service_client_app.html @@ -5,6 +5,8 @@ + + @@ -26,8 +28,12 @@ error: function (jqXHR) { } }); + $("#back").bind('click',function () { + parent.hideContent(); + }) }; + function loginOpenim() { WKIT.init({ container: document.getElementById('J_demo'), @@ -44,7 +50,7 @@ }); initUnreadMsgAndContact(); WKIT.Conn.sdk.Base.startListenAllMsg(); - window.sdk = document.getElementById("J_wkitPluginFrame").contentWindow; + window.sdk = parent.document.getElementById("subPageList").contentWindow; } }); } @@ -143,4 +149,9 @@ } + +
+ +
+ \ No newline at end of file diff --git a/src/main/ui/service_client_app_outside.html b/src/main/ui/service_client_app_outside.html index ec7544114..2eef92363 100644 --- a/src/main/ui/service_client_app_outside.html +++ b/src/main/ui/service_client_app_outside.html @@ -7,17 +7,25 @@ + + + @@ -60,12 +79,13 @@ -
-
-
-
diff --git a/src/main/ui/service_contact_list_app.html b/src/main/ui/service_contact_list_app.html index cd01bb65d..2dac3db09 100644 --- a/src/main/ui/service_contact_list_app.html +++ b/src/main/ui/service_contact_list_app.html @@ -21,6 +21,11 @@ padding: 0; } + body{ + width: 98%; + height: 98%; + + } .search-div { height: 3%; } @@ -79,7 +84,7 @@ } .frm_search { - width: 133px; + width: 98%; height: 32px; line-height: 32px; border: 0; @@ -94,7 +99,7 @@ .search_bar { position: relative; - width: 137px; + width: 100%; margin: 0 auto 6px; } @@ -166,6 +171,8 @@ css = 'active'; } var headImUrl = ''; + + if (map[key].headimg) { headImUrl = map[key].headimg; } else { @@ -185,7 +192,8 @@ } function switchToUser(touid) { - parent.switchTouid(touid); + parent.document.getElementById("subPage").contentWindow.switchTouid(touid); + parent.hideList(); } diff --git a/src/main/ui/service_customer.html b/src/main/ui/service_customer.html new file mode 100644 index 000000000..2f9948130 --- /dev/null +++ b/src/main/ui/service_customer.html @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/src/main/ui/static/images/im/back.png b/src/main/ui/static/images/im/back.png new file mode 100644 index 0000000000000000000000000000000000000000..c7f5f0d067f5b479af42af3a9458105d4e713230 GIT binary patch literal 4254 zcmeH}`6JZb_rTw?&}1hhJ24qcjUrDZV;v^UVk-0~vJ^rxlCcdUl%*O*WXlXATgko) zDUxNzlst-hh$&lkS-#W%@csPs`P^Ubx#!;dy7!!W?>RRSXO9*ZkQD#`K-k9Gf&c(u zo(KkD5MI?;r1k~?AOOymXt}qy$J6|;{LcgbogNT8TsO(He2+x1cL4r^?SgieAlqwv z`}T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f75Y*EyMSt$?KqeL&t2Vk9Bl_M^BVx%xFT(7M+o@*z`3Bb=ADC3gWzhKpnD z)R(W5D^fYmD)q!ZX{zEofhYh~sZuuCQ}Z5>9x73Zu}zP#^d4=5L4okoRGQ|^Grxiv zXF)Nxr#`>LX?&7S1YE~CnY67&Ns}>iT8}vC*}qVR&VF$iV10T#O+w3`kD^Z6JP?D; zk;ixw7p$Sc%IMVsk0>xIUZ*-%mH4`pdUEZaHGnFPqgL$+TQIN+N1RXYXoE1Jt9moYK*WjM41D@N7~#*v^Dhh&YV%P@!(%fJxaeoqiFXW__<4#bNC@jJ)jSTNBM zUlb8a@zS!fawSlG*8O;mgIApFuy>NlhNon~?QZ9n&%8oM{G-8>zsz!=ZghcX)>hlL z{$I834?aewlgi_czMT_0j&LMsHmOzNiqs=Jc5L7>W7w zlJV}lTgIwKd^MuZ>n`kliguT!m?{I5O1fQEKHb?G*`6Rlbc>6VI)wbE8^qq6+U>Df i@WCEJ9OeIi|KH2$e@55;*!8IYL$

Hi

"); List list = new ArrayList<>(); list.add("testTag"); -// sendMail.setTags(list); + // sendMail.setTags(list); Set mailCCs = new HashSet<>(); mailCCs.add("asd1159111@163.com"); sendMail.setMailCcs(mailCCs); @@ -202,15 +201,15 @@ public class CustomerImpressionImplTest { JSONObject var = new JSONObject(); var.put("client_moniker", client.getString("client_moniker")); var.put("short_name", client.getString("short_name")); - JSONObject result = mailGunClient.addListMember(client.getString("contact_email"), "merchants@mail.royalpay.com.au", client.getString("contact_person"),"", - var); + JSONObject result = mailGunClient.addListMember(client.getString("contact_email"), "merchants@mail.royalpay.com.au", client.getString("contact_person"), + "", var); } @Test - public void fd(){ + public void fd() { List asd12eq = new ArrayList<>(); asd12eq.add("9"); - JSONObject asd = clientManager.getByEmail("164851225@qq.com",1,1,asd12eq); + JSONObject asd = clientManager.getByEmail("164851225@qq.com", 1, 1, asd12eq); JSONArray qwe = asd.getJSONArray("data"); System.out.println(asd.getJSONArray("data")); System.out.println(qwe); @@ -231,27 +230,27 @@ public class CustomerImpressionImplTest { while (rowIterator.hasNext()) { row = rowIterator.next(); cell = row.getCell(1); - if(cell==null){ + if (cell == null) { continue; } cell.setCellType(HSSFCell.CELL_TYPE_STRING); CellStyle cellStyle = cell.getCellStyle(); - if(cellStyle.getFillForegroundColor()==0){ + if (cellStyle.getFillForegroundColor() == 0) { continue; } String clientMonikers = cell.getStringCellValue().trim(); - if(clientMonikers.contains("/")){ - String [] clientMonikerArr = clientMonikers.split("/"); + if (clientMonikers.contains("/")) { + String[] clientMonikerArr = clientMonikers.split("/"); for (String s : clientMonikerArr) { String tmp = s.trim().toUpperCase(); - if(tmp.length()>4 || tmp.length()==0){ + if (tmp.length() > 4 || tmp.length() == 0) { continue; } mailService.addUnsub(s.trim().toUpperCase()); } - }else { + } else { String tmp = clientMonikers.trim().toUpperCase(); - if(tmp.length()>4 || tmp.length()==0){ + if (tmp.length() > 4 || tmp.length() == 0) { continue; } mailService.addUnsub(clientMonikers.trim().toUpperCase()); @@ -263,7 +262,118 @@ public class CustomerImpressionImplTest { } @Test - public void zxc(){ - weekReporter.generateReport("2018-06-04",false); + public void zxc() { + weekReporter.generateReport("2018-06-04", false); + } + + @Test + public void royalpayIndustryTransform() { + String json = "[\n" + " {\n" + " \"children\": [\n" + " {\n" + " \"children\": [],\n" + " \"label\": \"机票\",\n" + + " \"mccCode\": \"10001\"\n" + " },\n" + " {\n" + " \"children\": [],\n" + " \"label\": \"旅游行业\",\n" + + " \"mccCode\": \"10002\"\n" + " },\n" + " {\n" + " \"children\": [],\n" + " \"label\": \"私人定制旅游\",\n" + + " \"mccCode\": \"10003\"\n" + " },\n" + " {\n" + " \"children\": [],\n" + " \"label\": \"租车\",\n" + + " \"mccCode\": \"10004\"\n" + " },\n" + " {\n" + " \"children\": [],\n" + " \"label\": \"巴士\",\n" + + " \"mccCode\": \"10005\"\n" + " }\n" + " ],\n" + " \"label\": \"旅游出行\",\n" + " \"mccCode\": \"1\"\n" + " },\n" + " {\n" + + " \"children\": [\n" + " {\n" + " \"children\": [],\n" + " \"label\": \"饭店\",\n" + " \"mccCode\": \"20001\"\n" + + " },\n" + " {\n" + " \"children\": [],\n" + " \"label\": \"奶茶店\",\n" + " \"mccCode\": \"20002\"\n" + + " },\n" + " {\n" + " \"children\": [],\n" + " \"label\": \"烧烤\",\n" + " \"mccCode\": \"20003\"\n" + + " },\n" + " {\n" + " \"children\": [],\n" + " \"label\": \"火锅\",\n" + " \"mccCode\": \"20004\"\n" + + " },\n" + " {\n" + " \"children\": [],\n" + " \"label\": \"Coffee\",\n" + " \"mccCode\": \"20005\"\n" + + " },\n" + " {\n" + " \"children\": [],\n" + " \"label\": \"酒吧\",\n" + " \"mccCode\": \"20006\"\n" + " }\n" + + " ],\n" + " \"label\": \"餐饮\",\n" + " \"mccCode\": \"2\"\n" + " },\n" + " {\n" + " \"children\": [\n" + " {\n" + + " \"children\": [],\n" + " \"label\": \"培训类\",\n" + " \"mccCode\": \"30001\"\n" + " },\n" + " {\n" + + " \"children\": [],\n" + " \"label\": \"移民留学\",\n" + " \"mccCode\": \"30002\"\n" + " },\n" + " {\n" + + " \"children\": [],\n" + " \"label\": \"私人幼儿园\",\n" + " \"mccCode\": \"30003\"\n" + " }\n" + " ],\n" + + " \"label\": \"教育\",\n" + " \"mccCode\": \"3\"\n" + " },\n" + " {\n" + " \"children\": [\n" + " {\n" + + " \"children\": [],\n" + " \"label\": \"换汇\",\n" + " \"mccCode\": \"40001\"\n" + " },\n" + " {\n" + + " \"children\": [],\n" + " \"label\": \"房产\",\n" + " \"mccCode\": \"40002\"\n" + " }\n" + " ],\n" + + " \"label\": \"商务咨询\",\n" + " \"mccCode\": \"4\"\n" + " },\n" + " {\n" + " \"children\": [\n" + " {\n" + + " \"children\": [],\n" + " \"label\": \"公众号服务商\",\n" + " \"mccCode\": \"50001\"\n" + " },\n" + " {\n" + + " \"children\": [],\n" + " \"label\": \"各种媒体类宣传\",\n" + " \"mccCode\": \"50002\"\n" + " }\n" + " ],\n" + + " \"label\": \"传媒\",\n" + " \"mccCode\": \"5\",\n" + + " \"value\": \"{\\\"category\\\":\\\"SERVICE\\\",\\\"code\\\":\\\"7542\\\",\\\"description\\\":\\\"Car Washes\\\",\\\"parentCode\\\":\\\"S10\\\"}\"\n" + + " },\n" + " {\n" + " \"children\": [\n" + " {\n" + " \"children\": [],\n" + " \"label\": \"美容院\",\n" + + " \"mccCode\": \"60001\"\n" + " },\n" + " {\n" + " \"children\": [],\n" + " \"label\": \"医疗美容\",\n" + + " \"mccCode\": \"60002\"\n" + " }\n" + " ],\n" + " \"label\": \"医美\",\n" + " \"mccCode\": \"6\"\n" + " },\n" + " {\n" + + " \"children\": [\n" + " {\n" + " \"label\": \"超市\",\n" + " \"mccCode\": \"70001\"\n" + " },\n" + " {\n" + + " \"children\": [],\n" + " \"label\": \"服装店\",\n" + " \"mccCode\": \"70002\"\n" + " },\n" + " {\n" + + " \"children\": [],\n" + " \"label\": \"鞋店\",\n" + " \"mccCode\": \"70003\"\n" + " },\n" + " {\n" + + " \"children\": [],\n" + " \"label\": \"珠宝店\",\n" + " \"mccCode\": \"70004\"\n" + " },{\n" + + " \"children\": [],\n" + " \"label\": \"箱包\",\n" + " \"mccCode\": \"70005\"\n" + " }\n" + " ],\n" + + " \"label\": \"零售\",\n" + " \"mccCode\": \"7\"\n" + " },\n" + " {\n" + " \"children\": [\n" + " {\n" + + " \"children\": [],\n" + " \"label\": \"桌游吧\",\n" + " \"mccCode\": \"80001\"\n" + " },\n" + " {\n" + + " \"children\": [],\n" + " \"label\": \"演唱会\",\n" + " \"mccCode\": \"80002\"\n" + " },\n" + " {\n" + + " \"children\": [],\n" + " \"label\": \"马术训练\",\n" + " \"mccCode\": \"80003\"\n" + " },\n" + " {\n" + + " \"children\": [],\n" + " \"label\": \"瑜伽\",\n" + " \"mccCode\": \"80004\"\n" + " },\n" + " {\n" + + " \"children\": [],\n" + " \"label\": \"健身\",\n" + " \"mccCode\": \"80005\"\n" + " },\n" + " {\n" + + " \"children\": [],\n" + " \"label\": \"社团\",\n" + " \"mccCode\": \"80006\"\n" + " },\n" + " {\n" + + " \"children\": [],\n" + " \"label\": \"网吧\",\n" + " \"mccCode\": \"80007\"\n" + " },\n" + " {\n" + + " \"children\": [],\n" + " \"label\": \"KTV\",\n" + " \"mccCode\": \"80008\"\n" + " },\n" + " {\n" + + " \"children\": [],\n" + " \"label\": \"电影\",\n" + " \"mccCode\": \"80009\"\n" + " }\n" + " ],\n" + + " \"label\": \"休闲娱乐\",\n" + " \"mccCode\": \"8\"\n" + " },\n" + " {\n" + " \"children\": [\n" + " {\n" + + " \"children\": [],\n" + " \"label\": \"摄影\",\n" + " \"mccCode\": \"90001\"\n" + " },\n" + " {\n" + + " \"children\": [],\n" + " \"label\": \"massage\",\n" + " \"mccCode\": \"90002\"\n" + " },\n" + " {\n" + + " \"children\": [],\n" + " \"label\": \"通讯运营商\",\n" + " \"mccCode\": \"90003\"\n" + " },\n" + " {\n" + + " \"children\": [],\n" + " \"label\": \"车行\",\n" + " \"mccCode\": \"90004\"\n" + " },\n" + " {\n" + + " \"children:\":[],\n" + " \"label\":\"软件服务\",\n" + " \"mccCode\":\"90005\"\n" + " }\n" + " ],\n" + + " \"label\": \"其他服务类\",\n" + " \"mccCode\": \"9\"\n" + " },\n" + " {\n" + " \"children\": [\n" + " {\n" + + " \"children\": [],\n" + " \"label\": \"Hotel\",\n" + " \"mccCode\": \"100001\"\n" + " },\n" + " {\n" + + " \"children\": [],\n" + " \"label\": \"Motel\",\n" + " \"mccCode\": \"100002\"\n" + " }\n" + " ],\n" + + " \"label\": \"酒店\",\n" + " \"mccCode\": \"10\"\n" + " },\n" + " {\n" + " \"children\": [\n" + " {\n" + + " \"children\": [],\n" + " \"label\": \"代购\",\n" + " \"mccCode\": \"110001\"\n" + " },\n" + " {\n" + + " \"children\": [],\n" + " \"label\": \"物流(大宗出口贸易)\",\n" + " \"mccCode\": \"110002\"\n" + " },\n" + " {\n" + + " \"children\": [],\n" + " \"label\": \"红酒出口\",\n" + " \"mccCode\": \"110003\"\n" + " },\n" + " {\n" + + " \"children\": [],\n" + " \"label\": \"综合电商\",\n" + " \"mccCode\": \"110004\"\n" + " }\n" + " ],\n" + + " \"label\": \"出口贸易\",\n" + " \"mccCode\": \"11\"\n" + " },\n" + " {\n" + " \"children\": [\n" + " {\n" + + " \"children\": [],\n" + " \"label\": \"建材\",\n" + " \"mccCode\": \"120001\"\n" + " },\n" + " {\n" + + " \"children\": [],\n" + " \"label\": \"家居\",\n" + " \"mccCode\": \"120002\"\n" + " }\n" + " ],\n" + + " \"label\": \"家居建材\",\n" + " \"mccCode\": \"12\"\n" + " }\n" + "]"; + + JSONArray jsonArray = JSONObject.parseArray(json); + + try { + XSSFWorkbook workbook = new XSSFWorkbook(new FileInputStream(new File("/Users/wangning/Desktop/asd.xlsx"))); + XSSFSheet sheet = workbook.getSheetAt(0); + Iterator rowIterator = sheet.rowIterator(); + Row row = null; + Cell cell = null; + while (rowIterator.hasNext()) { + row = rowIterator.next(); + cell = row.getCell(2); + if (cell == null) { + continue; + } + cell.setCellType(HSSFCell.CELL_TYPE_STRING); + String industryChinese = recursionIndustry(jsonArray, cell.getStringCellValue()); + cell.setCellValue(industryChinese); + + } + OutputStream out = new FileOutputStream("/Users/wangning/Desktop/qwe.xlsx"); + workbook.write(out); + workbook.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + + public String recursionIndustry(JSONArray jsonArray, String mccCode) { + String result = ""; + for (Object o : jsonArray) { + if(StringUtils.isNotEmpty(result)){ + break; + } + JSONObject tmp = (JSONObject) o; + if (tmp.getString("mccCode").equals(mccCode)) { + result = tmp.getString("label"); + }else { + if(tmp.getJSONArray("children")!=null){ + result = recursionIndustry(tmp.getJSONArray("children"), mccCode); + }else { + result = ""; + } + } + } + return result; + } } \ No newline at end of file