|
|
|
@ -59,26 +59,27 @@ public class IdcController {
|
|
|
|
|
|
|
|
|
|
@RequestMapping(value = "/spssync/common/uploadJson")
|
|
|
|
|
@ResponseBody
|
|
|
|
|
public BaseResponse uploadJson(HttpServletRequest request,@RequestBody Map<String, Object> params) {
|
|
|
|
|
public BaseResponse uploadJson(HttpServletRequest request, @RequestBody Map<String, Object> params) {
|
|
|
|
|
//
|
|
|
|
|
return idcService.receiveJson(request, params);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@RequestMapping(value = "/spssync/common/uploadFile")
|
|
|
|
|
public BaseResponse uploadFile(HttpServletRequest request,
|
|
|
|
|
@RequestParam("content") String content,
|
|
|
|
|
@RequestParam(value = "files", required = false) MultipartFile[] files) {
|
|
|
|
|
@RequestParam("content") String content,
|
|
|
|
|
@RequestParam(value = "files", required = false) MultipartFile[] files) {
|
|
|
|
|
//
|
|
|
|
|
return idcService.receive(request, content, files);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@RequestMapping(value = "/spssync/common/once")
|
|
|
|
|
@ResponseBody
|
|
|
|
|
public BaseResponse once(HttpServletRequest request,@RequestBody Map<String, Object> params) {
|
|
|
|
|
public BaseResponse once(HttpServletRequest request, @RequestBody Map<String, Object> params) {
|
|
|
|
|
//
|
|
|
|
|
boolean isUpload = params.get("isUpload")!=null && params.get("isUpload").equals("1") ? true : false ;
|
|
|
|
|
return idcService.onceSync( params.get("tableName").toString(), isUpload);
|
|
|
|
|
boolean isUpload = params.get("isUpload") != null && params.get("isUpload").equals("1") ? true : false;
|
|
|
|
|
return idcService.onceSync(params.get("tableName").toString(), isUpload);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//@Log("数据同步测试")
|
|
|
|
|
@RequestMapping(value = "/spssync/common/test")
|
|
|
|
|
public BaseResponse test(HttpServletRequest request, @RequestBody Map<String, Object> params) {
|
|
|
|
@ -121,12 +122,12 @@ public class IdcController {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@RequestMapping(value = "/spssync/common/downloadFile")
|
|
|
|
|
public void downloadFile(HttpServletResponse response,@RequestParam String fileName) throws UnsupportedEncodingException {
|
|
|
|
|
if (fileName != null) {
|
|
|
|
|
response.setHeader("Content-disposition", "attachment; filename=" + URLEncoder.encode(fileName, "UTF-8"));
|
|
|
|
|
response.setContentType("application/force-download");
|
|
|
|
|
idcService.downloadFile(fileName, response);
|
|
|
|
|
}
|
|
|
|
|
public void downloadFile(HttpServletResponse response, @RequestParam String fileName) throws UnsupportedEncodingException {
|
|
|
|
|
if (fileName != null) {
|
|
|
|
|
response.setHeader("Content-disposition", "attachment; filename=" + URLEncoder.encode(fileName, "UTF-8"));
|
|
|
|
|
response.setContentType("application/force-download");
|
|
|
|
|
idcService.downloadFile(fileName, response);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -139,6 +140,10 @@ public class IdcController {
|
|
|
|
|
String isTopService = systemParamConfigService.selectValueByParamKey("is_top_service");
|
|
|
|
|
if (StrUtil.isNotEmpty(isTopService) && isTopService.equals("1")) {
|
|
|
|
|
uri = uri.replace("mapi/", "");
|
|
|
|
|
if (uri.contains("SP_SYNC_SERVER")) {
|
|
|
|
|
uri = uri.replace("SP_SYNC_SERVER/", "");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
String upperServerHost = systemParamConfigService.selectValueByParamKey("upper_server_ip");
|
|
|
|
|
if (StrUtil.isNotEmpty(upperServerHost)) {
|
|
|
|
|