Merge remote-tracking branch 'origin/master'

version1
anthonywj 2 years ago
commit 4c54d831a9

@ -57,6 +57,20 @@ public class IdcController {
return idcService.receive(request, content, files);
}
@RequestMapping(value = "/spssync/common/uploadJson")
@ResponseBody
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) {
//
return idcService.receive(request, content, files);
}
//@Log("数据同步测试")
@RequestMapping(value = "/spssync/common/test")

@ -16,7 +16,9 @@ public interface IdcService {
BaseResponse receive(HttpServletRequest request,
String content,MultipartFile[] files);
BaseResponse receiveJson(HttpServletRequest request,Map<String, Object> params);
BaseResponse uploadFile(HttpServletRequest request,
String content,MultipartFile[] files);
BaseResponse send(Map<String,Object> params);
BaseResponse send(String messageType,String tableName,Map<String,Object> params);
@ -29,7 +31,6 @@ public interface IdcService {
BaseResponse downlaodSuccess(HttpServletRequest request,Map<String,Object> params);
public void asyncIdcTask();
void asyncUdiTask();
void asyncSpsTask();

@ -1,14 +1,24 @@
package com.glxp.sale.admin.idc.utils;
import java.io.File;
import java.io.IOException;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Map;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.alibaba.fastjson.JSON;
import okhttp3.MediaType;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.RequestBody;
import okhttp3.Response;
@ -130,4 +140,28 @@ public class IDCUtils {
}
}
public static String post(String url, Map<String, Object> params) {
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "");
if (params != null)
body = RequestBody.create(mediaType, JSON.toJSONString(params));
Request request = new Request.Builder()
.url(url)
.method("POST", body)
.addHeader("Content-Type", "application/json")
.build();
String result = "";
try {
Response response = client.newCall(request).execute();
result = response.body().string();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return result;
}
}

@ -0,0 +1,42 @@
package com.glxp.sale.admin.idc.utils;
/**
* @author chenqf
*/
public class TableUtils {
/*同步表,格式:同步设置表列名/同步设置表列名(子表时设置,主表不设置)/主表唯一列(多列逗号分隔)/主表关联列/子表关联列/数据库实际表/时间列/图片或文件列/数据条件/说明*/
private static final String[] SYNC_TABLES = {
"entrustAction//basic_entrust_accept/id///updateTime///委托验收",
"basicProducts//basic_udirel/id///updateTime///耗材字典",
"/basicProducts/basic_products/id/uuid/uuid////耗材字典信息详情",
"basicCorp//basic_corp/id///updateTime///往来单位",
"//company_product_relevance/id///updateTime///供应商关联信息",
"typeThird//thr_bustype_origin/id///updateTime///第三方单据类型",
"basicThirdCorp//thr_corp/id///updateTime///第三方往来单位",
"//thr_dept/id///updateTime///第三方部门",
"//thr_inv_products/id///updateTime///第三方库存",
"basicThirdInv//thr_inv_warehouse/id//////第三方仓库",
"basicThirdBusOrder//thr_order/id///updateTime///第三方业务单据",
"/basicThirdBusOrder/thr_order_detail/orderIdFk/id/orderIdFk/updateTime///第三方单据详情",
"basicThirdProducts//thr_products/id///updateTime///第三方产品信息",
"//sup_cert_set/id///updateTime///供应商资质证书设置",
"companyCert//sup_company/customerId///updateTime///配送企业",
"manufacturerCert//sup_manufacturer/id///updateTime///生产企业",
"productCert//sup_product/id///updateTime///产品资质信息",
"/companyCert/sup_cert/id/customerId/customerId/updateTime/filePath/type=1/配送企业资质证书信息",
"/manufacturerCert/sup_cert/id/manufacturerId/manufacturerIdFk/updateTime/filePath/type=2/生产企业资质证书信息",
"/productCert/sup_cert/id/productId/productIdFk/updateTime/filePath/type=3/产品资质证书信息",
"//udicompany/id///updateTime///国际库医疗器械注册人信息",
"basicType//basic_hosp_type/id///updateTime///物资字典分类",
"basicDept//auth_dept/id///updateTime///部门信息",
"basicInv//auth_warehouse/id///updateTime///仓库信息",
};
//"dbDiProducts//productinfo/id///updateTime///DI产品信息",
//"basicInv/////////仓库字典",
//"typeBus/////////业务单据类型",
//"typeScan/////////扫码单据类型",
public static String[] syncTables() {
return SYNC_TABLES;
}
}

@ -5,4 +5,11 @@ spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
mybatis.config-location=classpath:mybatis/mybatis-config.xml
mybatis.mapper-locations=classpath:mybatis/mapper/*/*.xml
spring.jmx.enabled=false
spring.jmx.enabled=false
server.tomcat.max-http-form-post-size=100MB
server.tomcat.max-http-post-size=100MB
server.max-http-header-size=100MB
#\u6700\u5927\u4E0A\u4F20\u6587\u4EF6\u5927\u5C0F(10MB)
spring.servlet.multipart.max-file-size=200MB
spring.servlet.multipart.max-request-size=200MB
Loading…
Cancel
Save