|
|
|
@ -66,10 +66,8 @@ import javax.validation.Valid;
|
|
|
|
|
import java.io.*;
|
|
|
|
|
import java.net.URLEncoder;
|
|
|
|
|
import java.nio.charset.StandardCharsets;
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
import java.util.Date;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
|
|
@RestController
|
|
|
|
|
@Api(tags = "同步下载相关")
|
|
|
|
@ -335,28 +333,28 @@ public class SpsSyncDownloadController {
|
|
|
|
|
|
|
|
|
|
@ApiOperation("上传同步数据")
|
|
|
|
|
@PostMapping("sps/sync/upload/data")
|
|
|
|
|
@Transactional
|
|
|
|
|
public Object uploadData(@RequestBody SyncUpLoadRequest upLoadRequest) {
|
|
|
|
|
try {
|
|
|
|
|
JSONObject obj = JSONUtil.parseObj(upLoadRequest.getData());
|
|
|
|
|
String log = "";
|
|
|
|
|
switch (upLoadRequest.getExportType()) {
|
|
|
|
|
case BASIC_DATA:
|
|
|
|
|
log = saveUploadBasicData(JSONUtil.toBean(obj, SpsSyncBasicDataResponse.class));
|
|
|
|
|
saveUploadBasicData(JSONUtil.toBean(obj, SpsSyncBasicDataResponse.class));
|
|
|
|
|
break;
|
|
|
|
|
case OTHER_DATA:
|
|
|
|
|
log = saveUploadOtherData(JSONUtil.toBean(obj, SpsSyncOtherDataResponse.class));
|
|
|
|
|
saveUploadOtherData(JSONUtil.toBean(obj, SpsSyncOtherDataResponse.class));
|
|
|
|
|
break;
|
|
|
|
|
case DOCUMENT_TYPE_DATA:
|
|
|
|
|
log = saveUploadDocumentTypeData(JSONUtil.toBean(obj, SpsSyncBusResponse.class));
|
|
|
|
|
saveUploadDocumentTypeData(JSONUtil.toBean(obj, SpsSyncBusResponse.class));
|
|
|
|
|
break;
|
|
|
|
|
case USER_DATA:
|
|
|
|
|
log = saveUploadUserData(JSONUtil.toBean(obj, SpsSyncDataResponse.class));
|
|
|
|
|
saveUploadUserData(JSONUtil.toBean(obj, SpsSyncDataResponse.class));
|
|
|
|
|
break;
|
|
|
|
|
case THIRD_DATA:
|
|
|
|
|
log = saveUploadThrData(JSONUtil.toBean(obj, SpsSyncThrDataResponse.class));
|
|
|
|
|
saveUploadThrData(JSONUtil.toBean(obj, SpsSyncThrDataResponse.class));
|
|
|
|
|
break;
|
|
|
|
|
case SYS_SET_DATA:
|
|
|
|
|
log = saveUploadSysSettingData(JSONUtil.toBean(obj, SpsSyncSysSettingResponse.class));
|
|
|
|
|
saveUploadSysSettingData(JSONUtil.toBean(obj, SpsSyncSysSettingResponse.class));
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
String taskId = obj.getStr("taskId");
|
|
|
|
@ -370,15 +368,14 @@ public class SpsSyncDownloadController {
|
|
|
|
|
.type(upLoadRequest.getExportType().getRemark())
|
|
|
|
|
.idDatas(upLoadRequest.getExportType().getKey())
|
|
|
|
|
.scheduleType(1)
|
|
|
|
|
.execInfo(log)
|
|
|
|
|
.build();
|
|
|
|
|
String fileFullPath = writeFile(filePrefix, upLoadRequest.getExportType().getRemark(), JSONUtil.toJsonStr(upLoadRequest.getData()));
|
|
|
|
|
downloadStatus.setCacheFilePath(fileFullPath);
|
|
|
|
|
basicDownloadService.insertDownloadStatus(downloadStatus);
|
|
|
|
|
return ResultVOUtils.success(log);
|
|
|
|
|
return ResultVOUtils.success();
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
return ResultVOUtils.error(ResultEnum.NOT_NETWORK.getCode(), e.getMessage());
|
|
|
|
|
return ResultVOUtils.error(ResultEnum.NOT_NETWORK, e.getMessage());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
@ -416,120 +413,40 @@ public class SpsSyncDownloadController {
|
|
|
|
|
private final BasicBusTypeChangeDao basicBusTypeChangeDao;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private String saveUploadSysSettingData(SpsSyncSysSettingResponse bean) {
|
|
|
|
|
List<String> success = new ArrayList<>();
|
|
|
|
|
List<String> fail = new ArrayList<>();
|
|
|
|
|
private void saveUploadSysSettingData(SpsSyncSysSettingResponse bean) {
|
|
|
|
|
|
|
|
|
|
if (CollectionUtil.isNotEmpty(bean.getSystemParamConfigEntities())) {
|
|
|
|
|
String desc = "运行参数设置信息:";
|
|
|
|
|
try {
|
|
|
|
|
systemParamConfigDao.insertOrUpdateBatch(bean.getSystemParamConfigEntities());
|
|
|
|
|
success.add(desc + "成功");
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
fail.add(desc + "失败");
|
|
|
|
|
}
|
|
|
|
|
systemParamConfigDao.insertOrUpdateBatch(bean.getSystemParamConfigEntities());
|
|
|
|
|
}
|
|
|
|
|
if (CollectionUtil.isNotEmpty(bean.getEntrustReceEntities())) {
|
|
|
|
|
String desc = "委托验收设置信息:";
|
|
|
|
|
try {
|
|
|
|
|
entrustReceDao.insertOrUpdateBatch(bean.getEntrustReceEntities());
|
|
|
|
|
success.add(desc + "成功");
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
fail.add(desc + "失败");
|
|
|
|
|
}
|
|
|
|
|
entrustReceDao.insertOrUpdateBatch(bean.getEntrustReceEntities());
|
|
|
|
|
}
|
|
|
|
|
if (CollectionUtil.isNotEmpty(bean.getSystemPDFModuleEntities())) {
|
|
|
|
|
String desc = "系统模板模块信息:";
|
|
|
|
|
try {
|
|
|
|
|
systemPDFModuleDao.insertOrUpdateBatch(bean.getSystemPDFModuleEntities());
|
|
|
|
|
success.add(desc + "成功");
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
fail.add(desc + "失败");
|
|
|
|
|
}
|
|
|
|
|
systemPDFModuleDao.insertOrUpdateBatch(bean.getSystemPDFModuleEntities());
|
|
|
|
|
}
|
|
|
|
|
if (CollectionUtil.isNotEmpty(bean.getSystemPDFTemplateEntities())) {
|
|
|
|
|
String desc = "模板信息:";
|
|
|
|
|
boolean flag = true;
|
|
|
|
|
int failCount = 0;
|
|
|
|
|
try {
|
|
|
|
|
for (SystemPDFTemplateEntity systemPDFTemplateEntity : bean.getSystemPDFTemplateEntities()) {
|
|
|
|
|
try {
|
|
|
|
|
systemPDFTemplateDao.insertOrUpdate(systemPDFTemplateEntity);
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
flag = false;
|
|
|
|
|
failCount++;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
success.add(desc + "成功" + (bean.getSystemPDFTemplateEntities().size() - failCount) + "条");
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
fail.add(desc + "失败" + failCount + "条");
|
|
|
|
|
}
|
|
|
|
|
for (SystemPDFTemplateEntity systemPDFTemplateEntity : bean.getSystemPDFTemplateEntities())
|
|
|
|
|
systemPDFTemplateDao.insertOrUpdate(systemPDFTemplateEntity);
|
|
|
|
|
}
|
|
|
|
|
if (CollectionUtil.isNotEmpty(bean.getSysPdfTemplateRelevanceCodeEntities())) {
|
|
|
|
|
String desc = "扫码单据关联模板信息:";
|
|
|
|
|
try {
|
|
|
|
|
sysPdfTemplateRelevanceCodeDao.insertOrUpdateBatch(bean.getSysPdfTemplateRelevanceCodeEntities());
|
|
|
|
|
success.add(desc + "成功");
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
fail.add(desc + "失败");
|
|
|
|
|
}
|
|
|
|
|
sysPdfTemplateRelevanceCodeDao.insertOrUpdateBatch(bean.getSysPdfTemplateRelevanceCodeEntities());
|
|
|
|
|
}
|
|
|
|
|
if (CollectionUtil.isNotEmpty(bean.getSysPdfTemplateRelevanceBizEntities())) {
|
|
|
|
|
String desc = "业务单据关联模板信息:";
|
|
|
|
|
try {
|
|
|
|
|
sysPdfTemplateRelevanceBizDao.insertOrUpdateBatch(bean.getSysPdfTemplateRelevanceBizEntities());
|
|
|
|
|
success.add(desc + "成功");
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
fail.add(desc + "失败");
|
|
|
|
|
}
|
|
|
|
|
sysPdfTemplateRelevanceBizDao.insertOrUpdateBatch(bean.getSysPdfTemplateRelevanceBizEntities());
|
|
|
|
|
}
|
|
|
|
|
if (CollectionUtil.isNotEmpty(bean.getSysPdfTemplateRelevanceLabelEntities())) {
|
|
|
|
|
String desc = "标签关联模板信息:";
|
|
|
|
|
try {
|
|
|
|
|
sysPdfTemplateRelevanceLabelDao.insertOrUpdateBatch(bean.getSysPdfTemplateRelevanceLabelEntities());
|
|
|
|
|
success.add(desc + "成功");
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
fail.add(desc + "失败");
|
|
|
|
|
}
|
|
|
|
|
sysPdfTemplateRelevanceLabelDao.insertOrUpdateBatch(bean.getSysPdfTemplateRelevanceLabelEntities());
|
|
|
|
|
}
|
|
|
|
|
if (CollectionUtil.isNotEmpty(bean.getSysPdfTemplateRelevanceStatemenEntities())) {
|
|
|
|
|
String desc = "报表关联模板信息:";
|
|
|
|
|
try {
|
|
|
|
|
sysPdfTemplateRelevanceStatemenDao.insertOrUpdateBatch(bean.getSysPdfTemplateRelevanceStatemenEntities());
|
|
|
|
|
success.add(desc + "成功");
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
fail.add(desc + "失败");
|
|
|
|
|
}
|
|
|
|
|
sysPdfTemplateRelevanceStatemenDao.insertOrUpdateBatch(bean.getSysPdfTemplateRelevanceStatemenEntities());
|
|
|
|
|
}
|
|
|
|
|
if (CollectionUtil.isNotEmpty(bean.getBasicBusTypePreEntities())) {
|
|
|
|
|
String desc = "出入库单自动补单设置信息:";
|
|
|
|
|
try {
|
|
|
|
|
basicBusTypePreDao.insertOrUpdateBatch(bean.getBasicBusTypePreEntities());
|
|
|
|
|
success.add(desc + "成功");
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
fail.add(desc + "失败");
|
|
|
|
|
}
|
|
|
|
|
basicBusTypePreDao.insertOrUpdateBatch(bean.getBasicBusTypePreEntities());
|
|
|
|
|
}
|
|
|
|
|
if (CollectionUtil.isNotEmpty(bean.getBasicBusTypeChangeEntities())) {
|
|
|
|
|
String desc = "业务单自动补单设置信息:";
|
|
|
|
|
try {
|
|
|
|
|
basicBusTypeChangeDao.insertOrUpdateBatch(bean.getBasicBusTypeChangeEntities());
|
|
|
|
|
success.add(desc + "成功");
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
fail.add(desc + "失败");
|
|
|
|
|
}
|
|
|
|
|
basicBusTypeChangeDao.insertOrUpdateBatch(bean.getBasicBusTypeChangeEntities());
|
|
|
|
|
}
|
|
|
|
|
success.addAll(fail);
|
|
|
|
|
return String.join(",", success);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -538,147 +455,50 @@ public class SpsSyncDownloadController {
|
|
|
|
|
private final ThrProductsDao thrProductsDao;
|
|
|
|
|
private final ThrCorpDao thrCorpDao;
|
|
|
|
|
|
|
|
|
|
private String saveUploadThrData(SpsSyncThrDataResponse bean) {
|
|
|
|
|
List<String> success = new ArrayList<>();
|
|
|
|
|
List<String> fail = new ArrayList<>();
|
|
|
|
|
private void saveUploadThrData(SpsSyncThrDataResponse bean) {
|
|
|
|
|
|
|
|
|
|
if (CollectionUtil.isNotEmpty(bean.getDeptEntities())) {
|
|
|
|
|
String desc = "第三方部门信息:";
|
|
|
|
|
try {
|
|
|
|
|
thrDeptDao.insertOrUpdateBatch(bean.getDeptEntities());
|
|
|
|
|
success.add(desc + "成功");
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
fail.add(desc + "失败");
|
|
|
|
|
}
|
|
|
|
|
thrDeptDao.insertOrUpdateBatch(bean.getDeptEntities());
|
|
|
|
|
}
|
|
|
|
|
if (CollectionUtil.isNotEmpty(bean.getInvWarehouseEntities())) {
|
|
|
|
|
String desc = "第三方仓库信息:";
|
|
|
|
|
try {
|
|
|
|
|
thrInvWarehouseDao.insertOrUpdateBatch(bean.getInvWarehouseEntities());
|
|
|
|
|
success.add(desc + "成功");
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
fail.add(desc + "失败");
|
|
|
|
|
}
|
|
|
|
|
thrInvWarehouseDao.insertOrUpdateBatch(bean.getInvWarehouseEntities());
|
|
|
|
|
}
|
|
|
|
|
if (CollectionUtil.isNotEmpty(bean.getProductsEntityList())) {
|
|
|
|
|
String desc = "第三方产品信息:";
|
|
|
|
|
try {
|
|
|
|
|
thrProductsDao.insertOrUpdateBatch(bean.getProductsEntityList());
|
|
|
|
|
success.add(desc + "成功");
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
fail.add(desc + "失败");
|
|
|
|
|
}
|
|
|
|
|
thrProductsDao.insertOrUpdateBatch(bean.getProductsEntityList());
|
|
|
|
|
}
|
|
|
|
|
if (CollectionUtil.isNotEmpty(bean.getCorpEntities())) {
|
|
|
|
|
String desc = "第三方往来信息:";
|
|
|
|
|
try {
|
|
|
|
|
thrCorpDao.insertOrUpdateBatch(bean.getCorpEntities());
|
|
|
|
|
success.add(desc + "成功");
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
fail.add(desc + "失败");
|
|
|
|
|
}
|
|
|
|
|
thrCorpDao.insertOrUpdateBatch(bean.getCorpEntities());
|
|
|
|
|
}
|
|
|
|
|
success.addAll(fail);
|
|
|
|
|
return String.join(",", success);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private String saveUploadUserData(SpsSyncDataResponse bean) {
|
|
|
|
|
List<String> success = new ArrayList<>();
|
|
|
|
|
List<String> fail = new ArrayList<>();
|
|
|
|
|
private void saveUploadUserData(SpsSyncDataResponse bean) {
|
|
|
|
|
|
|
|
|
|
if (CollectionUtil.isNotEmpty(bean.getAuthAdminList())) {
|
|
|
|
|
String desc = "系统用户信息:";
|
|
|
|
|
try {
|
|
|
|
|
authAdminDao.insertOrUpdateBatch(bean.getAuthAdminList());
|
|
|
|
|
success.add(desc + "成功");
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
fail.add(desc + "失败");
|
|
|
|
|
}
|
|
|
|
|
authAdminDao.insertOrUpdateBatch(bean.getAuthAdminList());
|
|
|
|
|
}
|
|
|
|
|
if (CollectionUtil.isNotEmpty(bean.getDeptEntityList())) {
|
|
|
|
|
String desc = "部门信息:";
|
|
|
|
|
try {
|
|
|
|
|
deptDao.insertOrUpdateBatch(bean.getDeptEntityList());
|
|
|
|
|
success.add(desc + "成功");
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
fail.add(desc + "失败");
|
|
|
|
|
}
|
|
|
|
|
deptDao.insertOrUpdateBatch(bean.getDeptEntityList());
|
|
|
|
|
}
|
|
|
|
|
if (CollectionUtil.isNotEmpty(bean.getDeptUserEntities())) {
|
|
|
|
|
String desc = "部门用户信息:";
|
|
|
|
|
try {
|
|
|
|
|
deptUserDao.replaceBatch(bean.getDeptUserEntities());
|
|
|
|
|
success.add(desc + "成功");
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
fail.add(desc + "失败");
|
|
|
|
|
}
|
|
|
|
|
deptUserDao.replaceBatch(bean.getDeptUserEntities());
|
|
|
|
|
}
|
|
|
|
|
if (CollectionUtil.isNotEmpty(bean.getInvWarehouseEntities())) {
|
|
|
|
|
String desc = "仓库字典信息:";
|
|
|
|
|
try {
|
|
|
|
|
invWarehouseDao.insertOrUpdateBatch(bean.getInvWarehouseEntities());
|
|
|
|
|
success.add(desc + "成功");
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
fail.add(desc + "失败");
|
|
|
|
|
}
|
|
|
|
|
invWarehouseDao.insertOrUpdateBatch(bean.getInvWarehouseEntities());
|
|
|
|
|
}
|
|
|
|
|
if (CollectionUtil.isNotEmpty(bean.getWarehouseUserEntities())) {
|
|
|
|
|
String desc = "仓库用户信息:";
|
|
|
|
|
try {
|
|
|
|
|
warehouseUserDao.insertOrUpdateBatch(bean.getWarehouseUserEntities());
|
|
|
|
|
success.add(desc + "成功");
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
fail.add(desc + "失败");
|
|
|
|
|
}
|
|
|
|
|
warehouseUserDao.insertOrUpdateBatch(bean.getWarehouseUserEntities());
|
|
|
|
|
}
|
|
|
|
|
if (CollectionUtil.isNotEmpty(bean.getWarehouseBussinessTypeEntities())) {
|
|
|
|
|
String desc = "仓库单据类型信息:";
|
|
|
|
|
boolean flag = true;
|
|
|
|
|
int failCount = 0;
|
|
|
|
|
try {
|
|
|
|
|
for (WarehouseBussinessTypeEntity warehouseBussinessTypeEntity : bean.getWarehouseBussinessTypeEntities()) {
|
|
|
|
|
try {
|
|
|
|
|
warehouseBussinessTypeDao.insertOrUpdate(warehouseBussinessTypeEntity);
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
flag = false;
|
|
|
|
|
failCount++;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
success.add(desc + "成功" + (bean.getWarehouseBussinessTypeEntities().size() - failCount) + "条");
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
fail.add(desc + "失败" + failCount + "条");
|
|
|
|
|
for (WarehouseBussinessTypeEntity warehouseBussinessTypeEntity : bean.getWarehouseBussinessTypeEntities()) {
|
|
|
|
|
warehouseBussinessTypeDao.insertOrUpdate(warehouseBussinessTypeEntity);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (CollectionUtil.isNotEmpty(bean.getInvSpaces())) {
|
|
|
|
|
String desc = "货位信息:";
|
|
|
|
|
try {
|
|
|
|
|
invSpaceDao.insertOrUpdateBatch(bean.getInvSpaces());
|
|
|
|
|
success.add(desc + "成功");
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
fail.add(desc + "失败");
|
|
|
|
|
}
|
|
|
|
|
invSpaceDao.insertOrUpdateBatch(bean.getInvSpaces());
|
|
|
|
|
}
|
|
|
|
|
if (CollectionUtil.isNotEmpty(bean.getInvBusUserEntities())) {
|
|
|
|
|
String desc = "用户关联单据信息:";
|
|
|
|
|
try {
|
|
|
|
|
invBusUserDao.insertOrUpdateBatch(bean.getInvBusUserEntities());
|
|
|
|
|
success.add(desc + "成功");
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
fail.add(desc + "失败");
|
|
|
|
|
}
|
|
|
|
|
invBusUserDao.insertOrUpdateBatch(bean.getInvBusUserEntities());
|
|
|
|
|
}
|
|
|
|
|
success.addAll(fail);
|
|
|
|
|
return String.join(",", success);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private final BasicBussinessTypeDao basicBussinessTypeDao;
|
|
|
|
@ -691,41 +511,16 @@ public class SpsSyncDownloadController {
|
|
|
|
|
*
|
|
|
|
|
* @param bean
|
|
|
|
|
*/
|
|
|
|
|
private String saveUploadDocumentTypeData(SpsSyncBusResponse bean) {
|
|
|
|
|
List<String> success = new ArrayList<>();
|
|
|
|
|
List<String> fail = new ArrayList<>();
|
|
|
|
|
private void saveUploadDocumentTypeData(SpsSyncBusResponse bean) {
|
|
|
|
|
if (CollectionUtil.isNotEmpty(bean.getBussinessTypeEntities())) {
|
|
|
|
|
String desc = "扫码单据类型信息:";
|
|
|
|
|
try {
|
|
|
|
|
basicBussinessTypeDao.insertOrUpdateBatch(bean.getBussinessTypeEntities());
|
|
|
|
|
success.add(desc + "成功");
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
fail.add(desc + "失败");
|
|
|
|
|
}
|
|
|
|
|
basicBussinessTypeDao.insertOrUpdateBatch(bean.getBussinessTypeEntities());
|
|
|
|
|
}
|
|
|
|
|
if (CollectionUtil.isNotEmpty(bean.getBusTypeChangeEntities())) {
|
|
|
|
|
String desc = "业务单据类型:";
|
|
|
|
|
try {
|
|
|
|
|
busTypeChangeDao.insertOrUpdateBatch(bean.getBusTypeChangeEntities());
|
|
|
|
|
success.add(desc + "成功");
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
fail.add(desc + "失败");
|
|
|
|
|
}
|
|
|
|
|
busTypeChangeDao.insertOrUpdateBatch(bean.getBusTypeChangeEntities());
|
|
|
|
|
}
|
|
|
|
|
if (CollectionUtil.isNotEmpty(bean.getThrBusTypeOriginEntities())) {
|
|
|
|
|
String desc = "第三方单据类型信息:";
|
|
|
|
|
try {
|
|
|
|
|
thrBusTypeOriginDao.insertOrUpdateBatch(bean.getThrBusTypeOriginEntities());
|
|
|
|
|
success.add(desc + "成功");
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
fail.add(desc + "失败");
|
|
|
|
|
}
|
|
|
|
|
thrBusTypeOriginDao.insertOrUpdateBatch(bean.getThrBusTypeOriginEntities());
|
|
|
|
|
}
|
|
|
|
|
success.addAll(fail);
|
|
|
|
|
return String.join(",", success);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -737,31 +532,14 @@ public class SpsSyncDownloadController {
|
|
|
|
|
*
|
|
|
|
|
* @param bean
|
|
|
|
|
*/
|
|
|
|
|
private String saveUploadOtherData(SpsSyncOtherDataResponse bean) {
|
|
|
|
|
List<String> success = new ArrayList<>();
|
|
|
|
|
List<String> fail = new ArrayList<>();
|
|
|
|
|
private void saveUploadOtherData(SpsSyncOtherDataResponse bean) {
|
|
|
|
|
if (CollectionUtil.isNotEmpty(bean.getIoCodeLostList())) {
|
|
|
|
|
String desc = "UDI码补齐信息:";
|
|
|
|
|
try {
|
|
|
|
|
ioCodeLostMapper.insertOrUpdateBatch(bean.getIoCodeLostList());
|
|
|
|
|
success.add(desc + "成功");
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
fail.add(desc + "失败");
|
|
|
|
|
}
|
|
|
|
|
ioCodeLostMapper.insertOrUpdateBatch(bean.getIoCodeLostList());
|
|
|
|
|
}
|
|
|
|
|
if (CollectionUtil.isNotEmpty(bean.getIoCodeRelList())) {
|
|
|
|
|
String desc = "UDI码关联关系:";
|
|
|
|
|
try {
|
|
|
|
|
ioCodeRelMapper.insertOrUpdateBatch(bean.getIoCodeRelList());
|
|
|
|
|
success.add(desc + "成功");
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
fail.add(desc + "失败");
|
|
|
|
|
}
|
|
|
|
|
ioCodeRelMapper.insertOrUpdateBatch(bean.getIoCodeRelList());
|
|
|
|
|
}
|
|
|
|
|
success.addAll(fail);
|
|
|
|
|
return String.join(",", success);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private final BasicHospTypeDao basicHospTypeDao;
|
|
|
|
@ -780,101 +558,37 @@ public class SpsSyncDownloadController {
|
|
|
|
|
*
|
|
|
|
|
* @param bean
|
|
|
|
|
*/
|
|
|
|
|
private String saveUploadBasicData(SpsSyncBasicDataResponse bean) {
|
|
|
|
|
List<String> success = new ArrayList<>();
|
|
|
|
|
List<String> fail = new ArrayList<>();
|
|
|
|
|
private void saveUploadBasicData(SpsSyncBasicDataResponse bean) {
|
|
|
|
|
if (CollectionUtil.isNotEmpty(bean.getHospTypeList())) {
|
|
|
|
|
String desc = "物资字典分类信息:";
|
|
|
|
|
try {
|
|
|
|
|
basicHospTypeDao.insertOrUpdateBatch(bean.getHospTypeList());
|
|
|
|
|
success.add(desc + "成功");
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
fail.add(desc + "失败");
|
|
|
|
|
}
|
|
|
|
|
basicHospTypeDao.insertOrUpdateBatch(bean.getHospTypeList());
|
|
|
|
|
}
|
|
|
|
|
if (CollectionUtil.isNotEmpty(bean.getUdiRelevanceList())) {
|
|
|
|
|
String desc = "物资字典主表信息:";
|
|
|
|
|
try {
|
|
|
|
|
udiRelevanceDao.insertOrUpdateBatch(bean.getUdiRelevanceList());
|
|
|
|
|
success.add(desc + "成功");
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
fail.add(desc + "失败");
|
|
|
|
|
}
|
|
|
|
|
udiRelevanceDao.insertOrUpdateBatch(bean.getUdiRelevanceList());
|
|
|
|
|
}
|
|
|
|
|
if (CollectionUtil.isNotEmpty(bean.getProductsList())) {
|
|
|
|
|
String desc = "供应商物资字典信息:";
|
|
|
|
|
try {
|
|
|
|
|
basicProductsDao.insertOrUpdateBatch(bean.getProductsList());
|
|
|
|
|
success.add(desc + "成功");
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
fail.add(desc + "失败");
|
|
|
|
|
}
|
|
|
|
|
basicProductsDao.insertOrUpdateBatch(bean.getProductsList());
|
|
|
|
|
}
|
|
|
|
|
if (CollectionUtil.isNotEmpty(bean.getRelevanceList())) {
|
|
|
|
|
String desc = "物资字典子表信息:";
|
|
|
|
|
try {
|
|
|
|
|
relevanceDao.insertOrUpdateBatch(bean.getRelevanceList());
|
|
|
|
|
success.add(desc + "成功");
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
fail.add(desc + "失败");
|
|
|
|
|
}
|
|
|
|
|
relevanceDao.insertOrUpdateBatch(bean.getRelevanceList());
|
|
|
|
|
}
|
|
|
|
|
if (CollectionUtil.isNotEmpty(bean.getCorpList())) {
|
|
|
|
|
String desc = "往来单位信息:";
|
|
|
|
|
try {
|
|
|
|
|
corpDao.insertOrUpdateBatch(bean.getCorpList());
|
|
|
|
|
success.add(desc + "成功");
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
fail.add(desc + "失败");
|
|
|
|
|
}
|
|
|
|
|
corpDao.insertOrUpdateBatch(bean.getCorpList());
|
|
|
|
|
}
|
|
|
|
|
if (CollectionUtil.isNotEmpty(bean.getSupCertList())) {
|
|
|
|
|
String desc = "资质证书信息:";
|
|
|
|
|
try {
|
|
|
|
|
supCertDao.insertOrUpdateBatch(bean.getSupCertList());
|
|
|
|
|
success.add(desc + "成功");
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
fail.add(desc + "失败");
|
|
|
|
|
}
|
|
|
|
|
supCertDao.insertOrUpdateBatch(bean.getSupCertList());
|
|
|
|
|
}
|
|
|
|
|
if (CollectionUtil.isNotEmpty(bean.getSupCertSetList())) {
|
|
|
|
|
String desc = "资质证书要求设置信息:";
|
|
|
|
|
try {
|
|
|
|
|
supCertSetDao.insertOrUpdateBatch(bean.getSupCertSetList());
|
|
|
|
|
success.add(desc + "成功");
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
fail.add(desc + "失败");
|
|
|
|
|
}
|
|
|
|
|
supCertSetDao.insertOrUpdateBatch(bean.getSupCertSetList());
|
|
|
|
|
}
|
|
|
|
|
if (CollectionUtil.isNotEmpty(bean.getSupCompanyList())) {
|
|
|
|
|
String desc = "供应商资质信息:";
|
|
|
|
|
try {
|
|
|
|
|
supCompanyDao.insertOrUpdateBatch(bean.getSupCompanyList());
|
|
|
|
|
success.add(desc + "成功");
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
fail.add(desc + "失败");
|
|
|
|
|
}
|
|
|
|
|
supCompanyDao.insertOrUpdateBatch(bean.getSupCompanyList());
|
|
|
|
|
}
|
|
|
|
|
if (CollectionUtil.isNotEmpty(bean.getSupManufacturerList())) {
|
|
|
|
|
String desc = "生产企业资质信息:";
|
|
|
|
|
try {
|
|
|
|
|
supManufacturerDao.insertOrUpdateBatch(bean.getSupManufacturerList());
|
|
|
|
|
success.add(desc + "成功");
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
fail.add(desc + "失败");
|
|
|
|
|
}
|
|
|
|
|
supManufacturerDao.insertOrUpdateBatch(bean.getSupManufacturerList());
|
|
|
|
|
}
|
|
|
|
|
if (CollectionUtil.isNotEmpty(bean.getSupProductList())) {
|
|
|
|
|
String desc = "配送产品资质信息:";
|
|
|
|
|
try {
|
|
|
|
|
supProductDao.insertOrUpdateBatch(bean.getSupProductList());
|
|
|
|
|
success.add(desc + "成功");
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
fail.add(desc + "失败");
|
|
|
|
|
}
|
|
|
|
|
supProductDao.insertOrUpdateBatch(bean.getSupProductList());
|
|
|
|
|
}
|
|
|
|
|
success.addAll(fail);
|
|
|
|
|
return String.join(",", success);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|