Commit b137ec64d2c0654613f7002e3c67615ab5ae6a30
1 parent
94fbf422b3
Exists in
master
and in
6 other branches
数据同步
Showing 3 changed files with 107 additions and 97 deletions
platform-common/src/main/java/com/lyms/platform/common/utils/LymsEncodeUtil.java
View file @
b137ec6
| ... | ... | @@ -26,7 +26,7 @@ |
| 26 | 26 | |
| 27 | 27 | String encrypt = aesEncrypt("com.lyms.platform.pojo.PatientWeight", key); System.out.println("加密后:" + encrypt); |
| 28 | 28 | |
| 29 | - String json = aesDecrypt("26EB0301C4A2410E90985A3E55856E4BCB0B8BBABA86F0708151BE6D196C9E96ED08D7D1CEACE8584EAB3D90C3637802", key); | |
| 29 | + String json = aesDecrypt("522E50C6944F903BCAAF46E5078F8A517CEC505DC2BA5ABA52E16CC7A5593909", key); | |
| 30 | 30 | System.out.println("解密后:" + json); |
| 31 | 31 | |
| 32 | 32 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/RiskReportFacade.java
View file @
b137ec6
| ... | ... | @@ -558,6 +558,8 @@ |
| 558 | 558 | map.put("data",items); |
| 559 | 559 | series.add(map); |
| 560 | 560 | |
| 561 | + | |
| 562 | + | |
| 561 | 563 | // List<Map<String,Object>> bfbItem = new ArrayList<>(); |
| 562 | 564 | // |
| 563 | 565 | // if (CollectionUtils.isNotEmpty(series)) |
| ... | ... | @@ -589,6 +591,8 @@ |
| 589 | 591 | // bfb.add(MathUtil.getProportion(Integer.valueOf(String.valueOf(obj)),total); |
| 590 | 592 | // } |
| 591 | 593 | // } |
| 594 | + | |
| 595 | + | |
| 592 | 596 | } |
| 593 | 597 | } |
| 594 | 598 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/SyncDataTaskService.java
View file @
b137ec6
| ... | ... | @@ -42,7 +42,7 @@ |
| 42 | 42 | @Service("syncDataTaskService") |
| 43 | 43 | public class SyncDataTaskService { |
| 44 | 44 | |
| 45 | - private static final Map<String,String> urls = new HashMap<>(); | |
| 45 | + private static final Map<String,String> urls = new LinkedHashMap<>(); | |
| 46 | 46 | |
| 47 | 47 | static |
| 48 | 48 | { |
| ... | ... | @@ -54,7 +54,7 @@ |
| 54 | 54 | urls.put("rp-hbnq-api.healthbaby.com.cn:18019","内丘"); |
| 55 | 55 | urls.put("area-chengde-api.healthbaby.com.cn:12356","承德"); |
| 56 | 56 | urls.put("area-kaifeng-api.healthbaby.com.cn:12356","开封"); |
| 57 | -// urls.put("area-weixian-api.healthbaby.com.cn:12356","威县"); | |
| 57 | + urls.put("area-weixian-api.healthbaby.com.cn:12356","威县"); | |
| 58 | 58 | urls.put("area-zhucheng-api.healthbaby.com.cn:12356","诸城市妇幼保健院"); |
| 59 | 59 | } |
| 60 | 60 | |
| ... | ... | @@ -160,6 +160,7 @@ |
| 160 | 160 | for (final String url : urls.keySet()) |
| 161 | 161 | { |
| 162 | 162 | try{ |
| 163 | + System.out.println(" areaurl = "+ url ); | |
| 163 | 164 | String areaName = urls.get(url); |
| 164 | 165 | String json = HttpClientUtil.doPost("https://"+url+"/findSyncData", new HashMap<String, String>(), "utf-8"); |
| 165 | 166 | if (com.lyms.platform.common.utils.StringUtils.isNotEmpty(json)) |
| 166 | 167 | |
| 167 | 168 | |
| ... | ... | @@ -844,102 +845,107 @@ |
| 844 | 845 | |
| 845 | 846 | public static void main(String[] a) throws Exception { |
| 846 | 847 | // new SyncDataTaskService().syncQhdfyCsv(); |
| 847 | - List<String> list = FileUtils.readLines(new File("D:\\qhd-jd.csv"), "utf-8"); | |
| 848 | - int linenum = 0; | |
| 849 | - DateTime dt = new DateTime(); | |
| 850 | - Set<String> set = new HashSet<>(); | |
| 851 | - Map<String, String> riskMap = buildRiskMap(); | |
| 852 | - int riskcount = 0; | |
| 853 | - int risktotalcount = 0; | |
| 854 | - for (String line : list) { | |
| 855 | - linenum++; | |
| 856 | - if (linenum > 14035) { | |
| 857 | - break; | |
| 858 | - } | |
| 859 | - try { | |
| 860 | - int tempIndex = line.indexOf(",,,,,,,,,,,,,,,"); | |
| 861 | - line = line.substring(0, tempIndex + 1); | |
| 862 | - String ss[] = line.split(","); | |
| 863 | - Patients patients = new Patients(); | |
| 864 | - patients.setServiceStatus(0); | |
| 865 | - patients.setServiceType(0); | |
| 866 | - patients.setType(1); | |
| 867 | - patients.setPcountryId("0da4334f-49e7-4180-b690-5cea668f75e9"); | |
| 868 | - patients.setPnationId("a628ab3a-1e0c-4219-ab14-a14636c5cdaa"); | |
| 869 | - patients.setPcerteTypeId("57e1dcd3f0f02e7ca519d6c6"); | |
| 870 | - patients.setBuildType(0); | |
| 871 | - patients.setYn(1); | |
| 872 | - System.out.println(ss[3].trim()); | |
| 873 | - patients.setAge(Integer.valueOf(ss[3].trim())); | |
| 874 | - DateTime agetime = dt.minusYears(Integer.valueOf(ss[3].trim())); | |
| 875 | - patients.setBirth(agetime.toDate()); | |
| 876 | - // 末次月经6,7,8 | |
| 877 | - String month = ss[7].trim(); | |
| 878 | - if (month.length() == 1) { | |
| 879 | - month = "0" + month; | |
| 880 | - } | |
| 881 | - String day = ss[8].trim(); | |
| 882 | - if (day.length() == 1) { | |
| 883 | - day = "0" + day; | |
| 884 | - } | |
| 885 | - patients.setLastMenses(DateUtil.getYmdhmDate("20" + ss[6].trim() + month + day + "0000")); | |
| 886 | - // > 41zhou | |
| 887 | - if (DateUtil.getWeek(patients.getLastMenses(), new Date()) > 41) { | |
| 888 | - continue; | |
| 889 | - } | |
| 890 | - // 预产期9,10,11 | |
| 891 | - month = ss[10].trim(); | |
| 892 | - if (month.length() == 1) { | |
| 893 | - month = "0" + month; | |
| 894 | - } | |
| 895 | - day = ss[11].trim(); | |
| 896 | - if (day.length() == 1) { | |
| 897 | - day = "0" + day; | |
| 898 | - } | |
| 899 | - patients.setDueDate(DateUtil.getYmdhmDate("20" + ss[9].trim() + month + day + "0000")); | |
| 848 | +// List<String> list = FileUtils.readLines(new File("D:\\qhd-jd.csv"), "utf-8"); | |
| 849 | +// int linenum = 0; | |
| 850 | +// DateTime dt = new DateTime(); | |
| 851 | +// Set<String> set = new HashSet<>(); | |
| 852 | +// Map<String, String> riskMap = buildRiskMap(); | |
| 853 | +// int riskcount = 0; | |
| 854 | +// int risktotalcount = 0; | |
| 855 | +// for (String line : list) { | |
| 856 | +// linenum++; | |
| 857 | +// if (linenum > 14035) { | |
| 858 | +// break; | |
| 859 | +// } | |
| 860 | +// try { | |
| 861 | +// int tempIndex = line.indexOf(",,,,,,,,,,,,,,,"); | |
| 862 | +// line = line.substring(0, tempIndex + 1); | |
| 863 | +// String ss[] = line.split(","); | |
| 864 | +// Patients patients = new Patients(); | |
| 865 | +// patients.setServiceStatus(0); | |
| 866 | +// patients.setServiceType(0); | |
| 867 | +// patients.setType(1); | |
| 868 | +// patients.setPcountryId("0da4334f-49e7-4180-b690-5cea668f75e9"); | |
| 869 | +// patients.setPnationId("a628ab3a-1e0c-4219-ab14-a14636c5cdaa"); | |
| 870 | +// patients.setPcerteTypeId("57e1dcd3f0f02e7ca519d6c6"); | |
| 871 | +// patients.setBuildType(0); | |
| 872 | +// patients.setYn(1); | |
| 873 | +// System.out.println(ss[3].trim()); | |
| 874 | +// patients.setAge(Integer.valueOf(ss[3].trim())); | |
| 875 | +// DateTime agetime = dt.minusYears(Integer.valueOf(ss[3].trim())); | |
| 876 | +// patients.setBirth(agetime.toDate()); | |
| 877 | +// // 末次月经6,7,8 | |
| 878 | +// String month = ss[7].trim(); | |
| 879 | +// if (month.length() == 1) { | |
| 880 | +// month = "0" + month; | |
| 881 | +// } | |
| 882 | +// String day = ss[8].trim(); | |
| 883 | +// if (day.length() == 1) { | |
| 884 | +// day = "0" + day; | |
| 885 | +// } | |
| 886 | +// patients.setLastMenses(DateUtil.getYmdhmDate("20" + ss[6].trim() + month + day + "0000")); | |
| 887 | +// // > 41zhou | |
| 888 | +// if (DateUtil.getWeek(patients.getLastMenses(), new Date()) > 41) { | |
| 889 | +// continue; | |
| 890 | +// } | |
| 891 | +// // 预产期9,10,11 | |
| 892 | +// month = ss[10].trim(); | |
| 893 | +// if (month.length() == 1) { | |
| 894 | +// month = "0" + month; | |
| 895 | +// } | |
| 896 | +// day = ss[11].trim(); | |
| 897 | +// if (day.length() == 1) { | |
| 898 | +// day = "0" + day; | |
| 899 | +// } | |
| 900 | +// patients.setDueDate(DateUtil.getYmdhmDate("20" + ss[9].trim() + month + day + "0000")); | |
| 901 | +// | |
| 902 | +// // 风险因素13 | |
| 903 | +// String risks = ss[13].trim().replace(" ", " "); | |
| 904 | +// if (risks != null && risks.length() > 1) { | |
| 905 | +// Integer score = 0; | |
| 906 | +// patients.setLastRhTime(patients.getBookbuildingDate()); | |
| 907 | +// String[] riskArray = risks.split(" |\\+"); | |
| 908 | +// for (String r : riskArray) { | |
| 909 | +// risktotalcount++; | |
| 910 | +// boolean boo = true; | |
| 911 | +// for (String s : riskMap.keySet()) { | |
| 912 | +// if (s.indexOf(r) >= 0 || r.indexOf(s) >= 0) { | |
| 913 | +// riskcount++; | |
| 914 | +// boo = false; | |
| 915 | +// break; | |
| 916 | +// } | |
| 917 | +// } | |
| 918 | +// if (boo) { | |
| 919 | +// set.add(r); | |
| 920 | +// } | |
| 921 | +// } | |
| 922 | +// } | |
| 923 | +//// System.out.println(JsonUtil.obj2JsonString(patients)); | |
| 924 | +// } catch (Exception e) { | |
| 925 | +//// e.printStackTrace(); | |
| 926 | +// } | |
| 927 | +// } | |
| 928 | +// Map<String, String> map = new HashMap<>(); | |
| 929 | +// System.out.println("riskcount:" + riskcount); | |
| 930 | +// System.out.println("risktotalcount:" + risktotalcount); | |
| 931 | +// for (String s : set) { | |
| 932 | +// System.out.println(s); | |
| 933 | +// } | |
| 934 | +// | |
| 935 | +// AntExChuModel chuModel = new AntExChuModel(); | |
| 936 | +// chuModel.setLastMenses(new Date()); | |
| 937 | +// Map<String, Object> omap = ReflectionUtils.getUpdateField(chuModel); | |
| 938 | +// for (String key : omap.keySet()) { | |
| 939 | +// System.out.println(key + "--" + omap.get(key)); | |
| 940 | +// } | |
| 941 | +// UpdateMultiData data = new UpdateMultiData(); | |
| 942 | +// data.setUpdate(omap); | |
| 943 | +// System.out.println(JsonUtil.obj2Str(data)); | |
| 900 | 944 | |
| 901 | - // 风险因素13 | |
| 902 | - String risks = ss[13].trim().replace(" ", " "); | |
| 903 | - if (risks != null && risks.length() > 1) { | |
| 904 | - Integer score = 0; | |
| 905 | - patients.setLastRhTime(patients.getBookbuildingDate()); | |
| 906 | - String[] riskArray = risks.split(" |\\+"); | |
| 907 | - for (String r : riskArray) { | |
| 908 | - risktotalcount++; | |
| 909 | - boolean boo = true; | |
| 910 | - for (String s : riskMap.keySet()) { | |
| 911 | - if (s.indexOf(r) >= 0 || r.indexOf(s) >= 0) { | |
| 912 | - riskcount++; | |
| 913 | - boo = false; | |
| 914 | - break; | |
| 915 | - } | |
| 916 | - } | |
| 917 | - if (boo) { | |
| 918 | - set.add(r); | |
| 919 | - } | |
| 920 | - } | |
| 921 | - } | |
| 922 | -// System.out.println(JsonUtil.obj2JsonString(patients)); | |
| 923 | - } catch (Exception e) { | |
| 924 | -// e.printStackTrace(); | |
| 925 | - } | |
| 945 | + for (final String url : urls.keySet()) | |
| 946 | + { | |
| 947 | + System.out.println(url); | |
| 926 | 948 | } |
| 927 | - Map<String, String> map = new HashMap<>(); | |
| 928 | - System.out.println("riskcount:" + riskcount); | |
| 929 | - System.out.println("risktotalcount:" + risktotalcount); | |
| 930 | - for (String s : set) { | |
| 931 | - System.out.println(s); | |
| 932 | - } | |
| 933 | - | |
| 934 | - AntExChuModel chuModel = new AntExChuModel(); | |
| 935 | - chuModel.setLastMenses(new Date()); | |
| 936 | - Map<String, Object> omap = ReflectionUtils.getUpdateField(chuModel); | |
| 937 | - for (String key : omap.keySet()) { | |
| 938 | - System.out.println(key + "--" + omap.get(key)); | |
| 939 | - } | |
| 940 | - UpdateMultiData data = new UpdateMultiData(); | |
| 941 | - data.setUpdate(omap); | |
| 942 | - System.out.println(JsonUtil.obj2Str(data)); | |
| 943 | 949 | } |
| 944 | 950 | |
| 945 | 951 | private static Map<String, String> buildRiskMap() { |