|
|
|
@ -40,6 +40,7 @@ import com.glxp.api.entity.system.SystemParamConfigEntity;
|
|
|
|
|
import com.glxp.api.idc.service.IdcService;
|
|
|
|
|
import com.glxp.api.idc.utils.DBAUtils;
|
|
|
|
|
import com.glxp.api.idc.utils.IDCUtils;
|
|
|
|
|
import com.glxp.api.idc.utils.TableUtils;
|
|
|
|
|
import com.glxp.api.req.system.ScheduledRequest;
|
|
|
|
|
import com.glxp.api.service.system.SystemParamConfigService;
|
|
|
|
|
import com.glxp.api.util.CustomUtil;
|
|
|
|
@ -69,37 +70,7 @@ public class IdcServiceImpl implements IdcService {
|
|
|
|
|
@Value("${API_SECRET}")
|
|
|
|
|
private String apiSecret;
|
|
|
|
|
|
|
|
|
|
/*同步表,格式:同步设置表列名/同步设置表列名(子表时设置,主表不设置)/主表唯一列(多列逗号分隔)/主表关联列/子表关联列/数据库实际表/时间列/图片或文件列/数据条件/说明*/
|
|
|
|
|
private 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/////////扫码单据类型",
|
|
|
|
|
|
|
|
|
|
private int orderNum = 0;
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
@ -235,14 +206,15 @@ public class IdcServiceImpl implements IdcService {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
for (int i = 0; i < SYNC_TABLES.length; i++) {
|
|
|
|
|
String[] tnames = SYNC_TABLES[i].split("/");
|
|
|
|
|
String[] syncTables = TableUtils.syncTables();
|
|
|
|
|
for (int i = 0; i < syncTables.length; i++) {
|
|
|
|
|
String[] tnames = syncTables[i].split("/");
|
|
|
|
|
boolean sync = StringUtils.isEmpty(tnames[0]) ||
|
|
|
|
|
(!StringUtils.isEmpty(tnames[0]) && map != null && map.get(tnames[0]) != null && map.get(tnames[0]).toString().equals("1"));
|
|
|
|
|
saveIdcLog("---", "", map.get(tnames[0]) + SYNC_TABLES[i], 0, 0);
|
|
|
|
|
saveIdcLog("---", "", map.get(tnames[0]) + syncTables[i], 0, 0);
|
|
|
|
|
if (sync) {
|
|
|
|
|
String syncIp = map.get("syncIp") != null ? map.get("syncIp").toString() : "";
|
|
|
|
|
syncData(SYNC_TABLES[i], isUpload, syncIp);
|
|
|
|
|
syncData(syncTables[i], isUpload, syncIp);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -542,7 +514,8 @@ public class IdcServiceImpl implements IdcService {
|
|
|
|
|
String[] childs = new String[30];
|
|
|
|
|
int childNum = -1;
|
|
|
|
|
/*子表*/
|
|
|
|
|
for (String str : SYNC_TABLES) {
|
|
|
|
|
String[] syncTables = TableUtils.syncTables();
|
|
|
|
|
for (String str : syncTables) {
|
|
|
|
|
if (str.contains("/" + tableKey + "/")) {
|
|
|
|
|
childNum++;
|
|
|
|
|
childs[childNum] = str;
|
|
|
|
|