|
@ -32,11 +32,17 @@ import io.swagger.annotations.Api; |
|
|
import io.swagger.annotations.ApiOperation; |
|
|
import io.swagger.annotations.ApiOperation; |
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
|
|
import org.springframework.http.HttpRequest; |
|
|
import org.springframework.validation.annotation.Validated; |
|
|
import org.springframework.validation.annotation.Validated; |
|
|
import org.springframework.web.bind.annotation.*; |
|
|
import org.springframework.web.bind.annotation.*; |
|
|
import org.springframework.web.multipart.MultipartFile; |
|
|
import org.springframework.web.multipart.MultipartFile; |
|
|
|
|
|
|
|
|
import javax.annotation.Resource; |
|
|
import javax.annotation.Resource; |
|
|
|
|
|
import javax.servlet.http.HttpServletRequest; |
|
|
|
|
|
import javax.servlet.http.HttpServletResponse; |
|
|
|
|
|
import java.io.BufferedReader; |
|
|
|
|
|
import java.io.InputStream; |
|
|
|
|
|
import java.io.InputStreamReader; |
|
|
import java.util.ArrayList; |
|
|
import java.util.ArrayList; |
|
|
import java.util.List; |
|
|
import java.util.List; |
|
|
|
|
|
|
|
@ -160,9 +166,7 @@ public class ExternalController { |
|
|
reportImageDto.setMemberId(str); |
|
|
reportImageDto.setMemberId(str); |
|
|
externalService.addReportImage(reportImageDto); |
|
|
externalService.addReportImage(reportImageDto); |
|
|
return ajax; |
|
|
return ajax; |
|
|
} |
|
|
} catch (Exception e) { |
|
|
catch (Exception e) |
|
|
|
|
|
{ |
|
|
|
|
|
return AjaxResult.error(e.getMessage()); |
|
|
return AjaxResult.error(e.getMessage()); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
@ -193,10 +197,37 @@ public class ExternalController { |
|
|
return JsonResponse.ok(externalService.selectReportByMemberId(dto.getId())); |
|
|
return JsonResponse.ok(externalService.selectReportByMemberId(dto.getId())); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// @Anonymous
|
|
|
|
|
|
// @ApiOperation("身高体重仪和针灸系统的对接")
|
|
|
|
|
|
// @RequestMapping(value = "/api/http/dmh", method = {RequestMethod.GET, RequestMethod.POST})
|
|
|
|
|
|
// public JsonResponse<Integer> dmh(String str){
|
|
|
|
|
|
// //W:066.5 H:173.5\r\n
|
|
|
|
|
|
// log.info("身高体重仪和针灸系统的对接:{}", str);
|
|
|
|
|
|
// externalService.dmh(str);
|
|
|
|
|
|
// return JsonResponse.ok();
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
@Anonymous |
|
|
@Anonymous |
|
|
@ApiOperation("身高体重仪和针灸系统的对接") |
|
|
@ApiOperation("身高体重仪和针灸系统的对接") |
|
|
@RequestMapping(value = "/api/http/dmh", method = {RequestMethod.GET, RequestMethod.POST}) |
|
|
@RequestMapping(value = "/api/http/dmh", method = {RequestMethod.GET, RequestMethod.POST}) |
|
|
public JsonResponse<Integer> dmh(@RequestBody String str){ |
|
|
public JsonResponse<Integer> dmh(HttpServletRequest request) { |
|
|
|
|
|
|
|
|
|
|
|
StringBuffer sb = new StringBuffer(); |
|
|
|
|
|
InputStream is = null; |
|
|
|
|
|
String error = "error"; |
|
|
|
|
|
try { |
|
|
|
|
|
is = request.getInputStream(); |
|
|
|
|
|
InputStreamReader isr = new InputStreamReader(is, "GBK"); |
|
|
|
|
|
BufferedReader br = new BufferedReader(isr); |
|
|
|
|
|
String s = ""; |
|
|
|
|
|
while ((s = br.readLine()) != null) { |
|
|
|
|
|
sb.append(s); |
|
|
|
|
|
} |
|
|
|
|
|
} catch (Exception e) { |
|
|
|
|
|
e.printStackTrace(); |
|
|
|
|
|
} |
|
|
|
|
|
String str =sb.toString(); |
|
|
|
|
|
log.info(str); |
|
|
//W:066.5 H:173.5\r\n
|
|
|
//W:066.5 H:173.5\r\n
|
|
|
log.info("身高体重仪和针灸系统的对接:{}", str); |
|
|
log.info("身高体重仪和针灸系统的对接:{}", str); |
|
|
externalService.dmh(str); |
|
|
externalService.dmh(str); |
|
|