no message
Showing
7 changed files
with
42 additions
and
34 deletions
| ... | @@ -4,11 +4,11 @@ | ... | @@ -4,11 +4,11 @@ |
| 4 | <modelVersion>4.0.0</modelVersion> | 4 | <modelVersion>4.0.0</modelVersion> |
| 5 | 5 | ||
| 6 | <groupId>com.example</groupId> | 6 | <groupId>com.example</groupId> |
| 7 | <artifactId>csair_dp_HDP</artifactId> | 7 | <artifactId>yry_dp</artifactId> |
| 8 | <version>0.0.1-SNAPSHOT</version> | 8 | <version>0.0.1-SNAPSHOT</version> |
| 9 | <packaging>jar</packaging> | 9 | <packaging>jar</packaging> |
| 10 | 10 | ||
| 11 | <name>csair_dp_HDP</name> | 11 | <name>yry_dp</name> |
| 12 | <description>Demo project for Spring Boot</description> | 12 | <description>Demo project for Spring Boot</description> |
| 13 | 13 | ||
| 14 | <parent> | 14 | <parent> | ... | ... |
| ... | @@ -8,8 +8,6 @@ import java.util.Date; | ... | @@ -8,8 +8,6 @@ import java.util.Date; |
| 8 | public class HttpLog { | 8 | public class HttpLog { |
| 9 | private Long id; | 9 | private Long id; |
| 10 | 10 | ||
| 11 | private String app_id; | ||
| 12 | |||
| 13 | private String url; | 11 | private String url; |
| 14 | 12 | ||
| 15 | private String param; | 13 | private String param; |
| ... | @@ -58,11 +56,4 @@ public class HttpLog { | ... | @@ -58,11 +56,4 @@ public class HttpLog { |
| 58 | this.create_at = create_at; | 56 | this.create_at = create_at; |
| 59 | } | 57 | } |
| 60 | 58 | ||
| 61 | public String getApp_id() { | ||
| 62 | return app_id; | ||
| 63 | } | ||
| 64 | |||
| 65 | public void setApp_id(String app_id) { | ||
| 66 | this.app_id = app_id; | ||
| 67 | } | ||
| 68 | } | 59 | } | ... | ... |
| ... | @@ -7,6 +7,7 @@ import com.example.support.model.MessageEntity; | ... | @@ -7,6 +7,7 @@ import com.example.support.model.MessageEntity; |
| 7 | import com.example.utils.md5.MD5Utils; | 7 | import com.example.utils.md5.MD5Utils; |
| 8 | import com.example.utils.mybatis.pageable.Pageable; | 8 | import com.example.utils.mybatis.pageable.Pageable; |
| 9 | import org.springframework.beans.factory.annotation.Autowired; | 9 | import org.springframework.beans.factory.annotation.Autowired; |
| 10 | import org.springframework.beans.factory.annotation.Value; | ||
| 10 | import org.springframework.stereotype.Service; | 11 | import org.springframework.stereotype.Service; |
| 11 | 12 | ||
| 12 | import java.text.ParseException; | 13 | import java.text.ParseException; |
| ... | @@ -24,19 +25,26 @@ public class HapiServiceImpl implements HapiService { | ... | @@ -24,19 +25,26 @@ public class HapiServiceImpl implements HapiService { |
| 24 | SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy-MM-dd"); | 25 | SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy-MM-dd"); |
| 25 | SimpleDateFormat sdf2 = new SimpleDateFormat("yyyy-MM"); | 26 | SimpleDateFormat sdf2 = new SimpleDateFormat("yyyy-MM"); |
| 26 | 27 | ||
| 27 | private Integer source = 34; | 28 | @Value("${hpai.source}") |
| 29 | private Integer source; | ||
| 28 | 30 | ||
| 29 | private Integer channelId = 952; | 31 | @Value("${hpai.channelId}") |
| 32 | private Integer channelId; | ||
| 30 | 33 | ||
| 31 | private Integer managerId = 1001490786; | 34 | @Value("${hpai.managerId}") |
| 35 | private Integer managerId; | ||
| 32 | 36 | ||
| 33 | private String key = "HXJYUR"; | 37 | @Value("${hpai.registermd5key}") |
| 38 | private String registermd5key; | ||
| 34 | 39 | ||
| 35 | private String pgkey = "HXJYRG"; | 40 | @Value("${hpai.genereportmd5key}") |
| 41 | private String genereportmd5key; | ||
| 36 | 42 | ||
| 37 | private String reportType = "pdf"; | 43 | @Value("${hpai.reportType}") |
| 44 | private String reportType; | ||
| 38 | 45 | ||
| 39 | private Integer downFlag = 1; | 46 | @Value("${hpai.downFlag}") |
| 47 | private Integer downFlag; | ||
| 40 | 48 | ||
| 41 | @Autowired | 49 | @Autowired |
| 42 | private HttpPostService httpPostService; | 50 | private HttpPostService httpPostService; |
| ... | @@ -44,7 +52,8 @@ public class HapiServiceImpl implements HapiService { | ... | @@ -44,7 +52,8 @@ public class HapiServiceImpl implements HapiService { |
| 44 | @Autowired | 52 | @Autowired |
| 45 | private MemberInfoMapper memberInfoMapper; | 53 | private MemberInfoMapper memberInfoMapper; |
| 46 | 54 | ||
| 47 | private static String HOST = "http://www.17jiankang.com"; | 55 | @Value("${hpai.host}") |
| 56 | private String host; | ||
| 48 | 57 | ||
| 49 | private static String REGISTER_URL = "/hxgrm/hapi/v1/genedetection/geneuser/register"; | 58 | private static String REGISTER_URL = "/hxgrm/hapi/v1/genedetection/geneuser/register"; |
| 50 | 59 | ||
| ... | @@ -59,7 +68,7 @@ public class HapiServiceImpl implements HapiService { | ... | @@ -59,7 +68,7 @@ public class HapiServiceImpl implements HapiService { |
| 59 | Map<String,Object> paremMap = new HashMap<>(); | 68 | Map<String,Object> paremMap = new HashMap<>(); |
| 60 | paremMap.put("source",source); | 69 | paremMap.put("source",source); |
| 61 | paremMap.put("timestamp",timestamp); | 70 | paremMap.put("timestamp",timestamp); |
| 62 | String validate = MD5Utils.hash(source+barcode+timestamp+key); | 71 | String validate = MD5Utils.hash(source+barcode+timestamp+registermd5key); |
| 63 | // paremMap.put("validcode",validcode); | 72 | // paremMap.put("validcode",validcode); |
| 64 | // paremMap.put("validkey",validkey); | 73 | // paremMap.put("validkey",validkey); |
| 65 | paremMap.put("barcode",barcode); | 74 | paremMap.put("barcode",barcode); |
| ... | @@ -78,8 +87,10 @@ public class HapiServiceImpl implements HapiService { | ... | @@ -78,8 +87,10 @@ public class HapiServiceImpl implements HapiService { |
| 78 | paremMap.put("height",height); | 87 | paremMap.put("height",height); |
| 79 | paremMap.put("remarks",remarks); | 88 | paremMap.put("remarks",remarks); |
| 80 | paremMap.put("validate",validate); | 89 | paremMap.put("validate",validate); |
| 81 | String url = HOST + REGISTER_URL; | 90 | String url = host + REGISTER_URL; |
| 91 | System.out.println(url); | ||
| 82 | Map<String, Object> map = this.httpPostService.httpPost(url, paremMap); | 92 | Map<String, Object> map = this.httpPostService.httpPost(url, paremMap); |
| 93 | System.out.println(map); | ||
| 83 | if(map.containsKey("ret") && map.get("ret").toString().equals("0") && map.containsKey("uuid")){ | 94 | if(map.containsKey("ret") && map.get("ret").toString().equals("0") && map.containsKey("uuid")){ |
| 84 | String memberNumber = map.get("uuid") != null ? map.get("uuid").toString() : ""; | 95 | String memberNumber = map.get("uuid") != null ? map.get("uuid").toString() : ""; |
| 85 | MemberInfo memberInfo = new MemberInfo(); | 96 | MemberInfo memberInfo = new MemberInfo(); |
| ... | @@ -117,7 +128,7 @@ public class HapiServiceImpl implements HapiService { | ... | @@ -117,7 +128,7 @@ public class HapiServiceImpl implements HapiService { |
| 117 | Map<String,Object> paremMap = new HashMap<>(); | 128 | Map<String,Object> paremMap = new HashMap<>(); |
| 118 | paremMap.put("source",source); | 129 | paremMap.put("source",source); |
| 119 | paremMap.put("timestamp",timestamp); | 130 | paremMap.put("timestamp",timestamp); |
| 120 | String validate = MD5Utils.hash(source+barcode+timestamp+pgkey); | 131 | String validate = MD5Utils.hash(source+barcode+timestamp+genereportmd5key); |
| 121 | // paremMap.put("validcode",validcode); | 132 | // paremMap.put("validcode",validcode); |
| 122 | // paremMap.put("validkey",validkey); | 133 | // paremMap.put("validkey",validkey); |
| 123 | paremMap.put("barcode",barcode); | 134 | paremMap.put("barcode",barcode); |
| ... | @@ -126,7 +137,7 @@ public class HapiServiceImpl implements HapiService { | ... | @@ -126,7 +137,7 @@ public class HapiServiceImpl implements HapiService { |
| 126 | paremMap.put("validate",validate); | 137 | paremMap.put("validate",validate); |
| 127 | paremMap.put("reportType",reportType); | 138 | paremMap.put("reportType",reportType); |
| 128 | paremMap.put("downFlag",downFlag); | 139 | paremMap.put("downFlag",downFlag); |
| 129 | String url = HOST + GENEREPORT_GET_URL; | 140 | String url = host + GENEREPORT_GET_URL; |
| 130 | Map<String, Object> map = this.httpPostService.httpPost(url, paremMap); | 141 | Map<String, Object> map = this.httpPostService.httpPost(url, paremMap); |
| 131 | if(map.containsKey("ret") && map.get("ret").toString().equals("0")){ | 142 | if(map.containsKey("ret") && map.get("ret").toString().equals("0")){ |
| 132 | String pdfurl = map.get("url") != null ? map.get("url").toString() : ""; | 143 | String pdfurl = map.get("url") != null ? map.get("url").toString() : ""; | ... | ... |
| ... | @@ -69,10 +69,9 @@ public class HttpPostServiceImpl implements HttpPostService { | ... | @@ -69,10 +69,9 @@ public class HttpPostServiceImpl implements HttpPostService { |
| 69 | try { | 69 | try { |
| 70 | String postDataString = objectMapper.writeValueAsString(postData); | 70 | String postDataString = objectMapper.writeValueAsString(postData); |
| 71 | httpLog.setParam(postDataString); | 71 | httpLog.setParam(postDataString); |
| 72 | httpLog.setApp_id(app_id); | 72 | this.httpLogMapper.create(httpLog); |
| 73 | // this.httpLogMapper.create(httpLog); | ||
| 74 | String responseEntity = post(url, postDataString, CONFIG); | 73 | String responseEntity = post(url, postDataString, CONFIG); |
| 75 | // this.httpLogMapper.update(httpLog.getId(),responseEntity); | 74 | this.httpLogMapper.update(httpLog.getId(),responseEntity); |
| 76 | readValue = objectMapper.readValue(responseEntity, new TypeReference<Map<String, Object>>() { | 75 | readValue = objectMapper.readValue(responseEntity, new TypeReference<Map<String, Object>>() { |
| 77 | }); | 76 | }); |
| 78 | } catch (JsonProcessingException e) { | 77 | } catch (JsonProcessingException e) { |
| ... | @@ -103,9 +102,9 @@ public class HttpPostServiceImpl implements HttpPostService { | ... | @@ -103,9 +102,9 @@ public class HttpPostServiceImpl implements HttpPostService { |
| 103 | try { | 102 | try { |
| 104 | String postDataString = objectMapper.writeValueAsString(postData); | 103 | String postDataString = objectMapper.writeValueAsString(postData); |
| 105 | httpLog.setParam(postDataString); | 104 | httpLog.setParam(postDataString); |
| 106 | // this.httpLogMapper.create(httpLog); | 105 | this.httpLogMapper.create(httpLog); |
| 107 | String responseEntity = post(url, postData, CONFIG); | 106 | String responseEntity = post(url, postData, CONFIG); |
| 108 | // this.httpLogMapper.update(httpLog.getId(),responseEntity); | 107 | this.httpLogMapper.update(httpLog.getId(),responseEntity); |
| 109 | readValue = objectMapper.readValue(responseEntity, new TypeReference<Map<String, Object>>() { | 108 | readValue = objectMapper.readValue(responseEntity, new TypeReference<Map<String, Object>>() { |
| 110 | }); | 109 | }); |
| 111 | } catch (JsonProcessingException e) { | 110 | } catch (JsonProcessingException e) { |
| ... | @@ -136,10 +135,9 @@ public class HttpPostServiceImpl implements HttpPostService { | ... | @@ -136,10 +135,9 @@ public class HttpPostServiceImpl implements HttpPostService { |
| 136 | try { | 135 | try { |
| 137 | String postDataString = objectMapper.writeValueAsString(postData); | 136 | String postDataString = objectMapper.writeValueAsString(postData); |
| 138 | httpLog.setParam(postDataString); | 137 | httpLog.setParam(postDataString); |
| 139 | httpLog.setApp_id(app_id); | 138 | this.httpLogMapper.create(httpLog); |
| 140 | // this.httpLogMapper.create(httpLog); | ||
| 141 | String responseEntity = postForm(url, postDataString, CONFIG); | 139 | String responseEntity = postForm(url, postDataString, CONFIG); |
| 142 | // this.httpLogMapper.update(httpLog.getId(),responseEntity); | 140 | this.httpLogMapper.update(httpLog.getId(),responseEntity); |
| 143 | readValue = objectMapper.readValue(responseEntity, new TypeReference<Map<String, Object>>() { | 141 | readValue = objectMapper.readValue(responseEntity, new TypeReference<Map<String, Object>>() { |
| 144 | }); | 142 | }); |
| 145 | } catch (JsonProcessingException e) { | 143 | } catch (JsonProcessingException e) { | ... | ... |
| ... | @@ -18,3 +18,13 @@ spring.datasource.jdbc-interceptors=ConnectionState;SlowQueryReport(threshold=0) | ... | @@ -18,3 +18,13 @@ spring.datasource.jdbc-interceptors=ConnectionState;SlowQueryReport(threshold=0) |
| 18 | #mybatis | 18 | #mybatis |
| 19 | mybatis.mapperLocations=classpath*:mappers/*.xml | 19 | mybatis.mapperLocations=classpath*:mappers/*.xml |
| 20 | mybatis.configLocation=classpath:/mybatis-config.xml | 20 | mybatis.configLocation=classpath:/mybatis-config.xml |
| 21 | |||
| 22 | |||
| 23 | hpai.host=http://www.17jiankang.com | ||
| 24 | hpai.source=34 | ||
| 25 | hpai.channelId=952 | ||
| 26 | hpai.managerId=1001490786 | ||
| 27 | hpai.registermd5key=HXJYUR | ||
| 28 | hpai.genereportmd5key=HXJYRG | ||
| 29 | hpai.reportType=pdf | ||
| 30 | hpai.downFlag=1 | ... | ... |
| ... | @@ -8,16 +8,13 @@ | ... | @@ -8,16 +8,13 @@ |
| 8 | INSERT INTO t_http_log ( | 8 | INSERT INTO t_http_log ( |
| 9 | url, | 9 | url, |
| 10 | param, | 10 | param, |
| 11 | app_id, | ||
| 12 | create_at, | 11 | create_at, |
| 13 | restful | 12 | restful |
| 14 | ) | 13 | ) |
| 15 | VALUES ( | 14 | VALUES ( |
| 16 | 15 | ||
| 17 | #{url}, | 16 | #{url}, |
| 18 | |||
| 19 | #{param}, | 17 | #{param}, |
| 20 | #{app_id}, | ||
| 21 | #{create_at}, | 18 | #{create_at}, |
| 22 | #{restful} | 19 | #{restful} |
| 23 | 20 | ... | ... |
-
Please register or sign in to post a comment