From 9434f89b5c30a2c3c41175eabf4826d23cf7138b Mon Sep 17 00:00:00 2001 From: anthonywj Date: Thu, 4 May 2023 10:17:18 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E5=90=8C=E6=AD=A5=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=E7=B3=BB=E7=BB=9F=E7=B9=81=E5=BF=99=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/glxp/api/service/inout/IoChangeInoutService.java | 8 ++++---- src/main/resources/schemas/schema_v2.1.sql | 1 + 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/glxp/api/service/inout/IoChangeInoutService.java b/src/main/java/com/glxp/api/service/inout/IoChangeInoutService.java index 0b936a17..29cd1e28 100644 --- a/src/main/java/com/glxp/api/service/inout/IoChangeInoutService.java +++ b/src/main/java/com/glxp/api/service/inout/IoChangeInoutService.java @@ -198,14 +198,14 @@ public class IoChangeInoutService { outOrder.setFromInvCode(null); outOrder.setFromDeptCode(null); } else if (bussinessChangeTypeEntity.getCreateType() == 3) { //寄售、预验收补单 - outOrder.setCustomerId(null); - outOrder.setFromCorp(null); + outOrder.setCustomerId(corpName); + outOrder.setFromCorp(corpName); InvWarehouseEntity invWarehouseEntity = invWarehouseService.findByInvSubByCode(Constant.INV_PRE_IN_CODE); outOrder.setFromInvCode(invWarehouseEntity.getCode()); outOrder.setFromDeptCode(invWarehouseEntity.getParentId()); } else if (bussinessChangeTypeEntity.getCreateType() == 4) { - outOrder.setCustomerId(null); - outOrder.setFromCorp(null); + outOrder.setCustomerId(corpName); + outOrder.setFromCorp(corpName); InvWarehouseEntity invWarehouseEntity = invWarehouseService.findByInvSubByCode(Constant.INV_PRE_CODE); outOrder.setFromInvCode(invWarehouseEntity.getCode()); outOrder.setFromDeptCode(invWarehouseEntity.getParentId()); diff --git a/src/main/resources/schemas/schema_v2.1.sql b/src/main/resources/schemas/schema_v2.1.sql index d2565465..edaac24a 100644 --- a/src/main/resources/schemas/schema_v2.1.sql +++ b/src/main/resources/schemas/schema_v2.1.sql @@ -356,3 +356,4 @@ ALTER TABLE `auth_dept_user` ADD UNIQUE (`userId`, deptId); +CALL Pro_Temp_ColumnWork('sync_data_bustypes', 'id', 'bigint', 2); From 0b093bed9a7e60c4715b51ab440092403dfc40ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=91=E6=98=8E=E6=A2=81?= <2429105222@qq.com> Date: Thu, 4 May 2023 11:09:19 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E7=94=A8=E6=88=B7=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E8=A7=92=E8=89=B2=E5=A4=B1=E8=B4=A5=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/glxp/api/controller/auth/SysUserController.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/glxp/api/controller/auth/SysUserController.java b/src/main/java/com/glxp/api/controller/auth/SysUserController.java index bb3af2bf..35b8f1b8 100644 --- a/src/main/java/com/glxp/api/controller/auth/SysUserController.java +++ b/src/main/java/com/glxp/api/controller/auth/SysUserController.java @@ -292,7 +292,7 @@ public class SysUserController extends BaseController { return ResultVOUtils.error(ResultEnum.NOT_NETWORK); } // 修改角色 - // userService.insertUserAuth(authAdmin.getId(), authUserSaveRequest.getRoles()); + userService.insertUserAuth(authAdmin.getId(), authUserSaveRequest.getRoles()); userService.updateAuthAdmin(authAdmin); From 98c0b2ed30f236170f0ddd1445eb95f7a9bca43a Mon Sep 17 00:00:00 2001 From: wj <1285151836@qq.com> Date: Thu, 4 May 2023 11:33:06 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=89=A7=E8=A1=8C?= =?UTF-8?q?=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sync/SpsSyncDownloadController.java | 402 +++++++++++++++--- .../sync/BasicDownloadStatusEntity.java | 1 + src/main/resources/schemas/schema_v2.1.sql | 3 + 3 files changed, 348 insertions(+), 58 deletions(-) diff --git a/src/main/java/com/glxp/api/controller/sync/SpsSyncDownloadController.java b/src/main/java/com/glxp/api/controller/sync/SpsSyncDownloadController.java index 2cf91d82..14399de2 100644 --- a/src/main/java/com/glxp/api/controller/sync/SpsSyncDownloadController.java +++ b/src/main/java/com/glxp/api/controller/sync/SpsSyncDownloadController.java @@ -66,8 +66,10 @@ 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 = "同步下载相关") @@ -333,28 +335,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: - saveUploadBasicData(JSONUtil.toBean(obj, SpsSyncBasicDataResponse.class)); + log = saveUploadBasicData(JSONUtil.toBean(obj, SpsSyncBasicDataResponse.class)); break; case OTHER_DATA: - saveUploadOtherData(JSONUtil.toBean(obj, SpsSyncOtherDataResponse.class)); + log = saveUploadOtherData(JSONUtil.toBean(obj, SpsSyncOtherDataResponse.class)); break; case DOCUMENT_TYPE_DATA: - saveUploadDocumentTypeData(JSONUtil.toBean(obj, SpsSyncBusResponse.class)); + log = saveUploadDocumentTypeData(JSONUtil.toBean(obj, SpsSyncBusResponse.class)); break; case USER_DATA: - saveUploadUserData(JSONUtil.toBean(obj, SpsSyncDataResponse.class)); + log = saveUploadUserData(JSONUtil.toBean(obj, SpsSyncDataResponse.class)); break; case THIRD_DATA: - saveUploadThrData(JSONUtil.toBean(obj, SpsSyncThrDataResponse.class)); + log = saveUploadThrData(JSONUtil.toBean(obj, SpsSyncThrDataResponse.class)); break; case SYS_SET_DATA: - saveUploadSysSettingData(JSONUtil.toBean(obj, SpsSyncSysSettingResponse.class)); + log = saveUploadSysSettingData(JSONUtil.toBean(obj, SpsSyncSysSettingResponse.class)); break; } String taskId = obj.getStr("taskId"); @@ -368,6 +370,7 @@ 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); @@ -375,7 +378,7 @@ public class SpsSyncDownloadController { return ResultVOUtils.success(); } catch (Exception e) { e.printStackTrace(); - return ResultVOUtils.error(ResultEnum.NOT_NETWORK, e.getMessage()); + return ResultVOUtils.error(ResultEnum.NOT_NETWORK.getCode(), e.getMessage()); } } @@ -413,40 +416,120 @@ public class SpsSyncDownloadController { private final BasicBusTypeChangeDao basicBusTypeChangeDao; - private void saveUploadSysSettingData(SpsSyncSysSettingResponse bean) { - + private String saveUploadSysSettingData(SpsSyncSysSettingResponse bean) { + List success = new ArrayList<>(); + List fail = new ArrayList<>(); if (CollectionUtil.isNotEmpty(bean.getSystemParamConfigEntities())) { - systemParamConfigDao.insertOrUpdateBatch(bean.getSystemParamConfigEntities()); + String desc = "运行参数设置信息:"; + try { + systemParamConfigDao.insertOrUpdateBatch(bean.getSystemParamConfigEntities()); + success.add(desc + "成功"); + } catch (Exception e) { + e.printStackTrace(); + fail.add(desc + "失败"); + } } if (CollectionUtil.isNotEmpty(bean.getEntrustReceEntities())) { - entrustReceDao.insertOrUpdateBatch(bean.getEntrustReceEntities()); + String desc = "委托验收设置信息:"; + try { + entrustReceDao.insertOrUpdateBatch(bean.getEntrustReceEntities()); + success.add(desc + "成功"); + } catch (Exception e) { + e.printStackTrace(); + fail.add(desc + "失败"); + } } if (CollectionUtil.isNotEmpty(bean.getSystemPDFModuleEntities())) { - systemPDFModuleDao.insertOrUpdateBatch(bean.getSystemPDFModuleEntities()); + String desc = "系统模板模块信息:"; + try { + systemPDFModuleDao.insertOrUpdateBatch(bean.getSystemPDFModuleEntities()); + success.add(desc + "成功"); + } catch (Exception e) { + e.printStackTrace(); + fail.add(desc + "失败"); + } } if (CollectionUtil.isNotEmpty(bean.getSystemPDFTemplateEntities())) { - for (SystemPDFTemplateEntity systemPDFTemplateEntity : bean.getSystemPDFTemplateEntities()) - systemPDFTemplateDao.insertOrUpdate(systemPDFTemplateEntity); + 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 + "条"); + } } if (CollectionUtil.isNotEmpty(bean.getSysPdfTemplateRelevanceCodeEntities())) { - sysPdfTemplateRelevanceCodeDao.insertOrUpdateBatch(bean.getSysPdfTemplateRelevanceCodeEntities()); + String desc = "扫码单据关联模板信息:"; + try { + sysPdfTemplateRelevanceCodeDao.insertOrUpdateBatch(bean.getSysPdfTemplateRelevanceCodeEntities()); + success.add(desc + "成功"); + } catch (Exception e) { + e.printStackTrace(); + fail.add(desc + "失败"); + } } if (CollectionUtil.isNotEmpty(bean.getSysPdfTemplateRelevanceBizEntities())) { - sysPdfTemplateRelevanceBizDao.insertOrUpdateBatch(bean.getSysPdfTemplateRelevanceBizEntities()); + String desc = "业务单据关联模板信息:"; + try { + sysPdfTemplateRelevanceBizDao.insertOrUpdateBatch(bean.getSysPdfTemplateRelevanceBizEntities()); + success.add(desc + "成功"); + } catch (Exception e) { + e.printStackTrace(); + fail.add(desc + "失败"); + } } if (CollectionUtil.isNotEmpty(bean.getSysPdfTemplateRelevanceLabelEntities())) { - sysPdfTemplateRelevanceLabelDao.insertOrUpdateBatch(bean.getSysPdfTemplateRelevanceLabelEntities()); + String desc = "标签关联模板信息:"; + try { + sysPdfTemplateRelevanceLabelDao.insertOrUpdateBatch(bean.getSysPdfTemplateRelevanceLabelEntities()); + success.add(desc + "成功"); + } catch (Exception e) { + e.printStackTrace(); + fail.add(desc + "失败"); + } } if (CollectionUtil.isNotEmpty(bean.getSysPdfTemplateRelevanceStatemenEntities())) { - sysPdfTemplateRelevanceStatemenDao.insertOrUpdateBatch(bean.getSysPdfTemplateRelevanceStatemenEntities()); + String desc = "报表关联模板信息:"; + try { + sysPdfTemplateRelevanceStatemenDao.insertOrUpdateBatch(bean.getSysPdfTemplateRelevanceStatemenEntities()); + success.add(desc + "成功"); + } catch (Exception e) { + e.printStackTrace(); + fail.add(desc + "失败"); + } } if (CollectionUtil.isNotEmpty(bean.getBasicBusTypePreEntities())) { - basicBusTypePreDao.insertOrUpdateBatch(bean.getBasicBusTypePreEntities()); + String desc = "出入库单自动补单设置信息:"; + try { + basicBusTypePreDao.insertOrUpdateBatch(bean.getBasicBusTypePreEntities()); + success.add(desc + "成功"); + } catch (Exception e) { + e.printStackTrace(); + fail.add(desc + "失败"); + } } if (CollectionUtil.isNotEmpty(bean.getBasicBusTypeChangeEntities())) { - basicBusTypeChangeDao.insertOrUpdateBatch(bean.getBasicBusTypeChangeEntities()); + String desc = "业务单自动补单设置信息:"; + try { + basicBusTypeChangeDao.insertOrUpdateBatch(bean.getBasicBusTypeChangeEntities()); + success.add(desc + "成功"); + } catch (Exception e) { + e.printStackTrace(); + fail.add(desc + "失败"); + } } - + success.addAll(fail); + return String.join(",", success); } @@ -455,50 +538,147 @@ public class SpsSyncDownloadController { private final ThrProductsDao thrProductsDao; private final ThrCorpDao thrCorpDao; - private void saveUploadThrData(SpsSyncThrDataResponse bean) { - + private String saveUploadThrData(SpsSyncThrDataResponse bean) { + List success = new ArrayList<>(); + List fail = new ArrayList<>(); if (CollectionUtil.isNotEmpty(bean.getDeptEntities())) { - thrDeptDao.insertOrUpdateBatch(bean.getDeptEntities()); + String desc = "第三方部门信息:"; + try { + thrDeptDao.insertOrUpdateBatch(bean.getDeptEntities()); + success.add(desc + "成功"); + } catch (Exception e) { + e.printStackTrace(); + fail.add(desc + "失败"); + } } if (CollectionUtil.isNotEmpty(bean.getInvWarehouseEntities())) { - thrInvWarehouseDao.insertOrUpdateBatch(bean.getInvWarehouseEntities()); + String desc = "第三方仓库信息:"; + try { + thrInvWarehouseDao.insertOrUpdateBatch(bean.getInvWarehouseEntities()); + success.add(desc + "成功"); + } catch (Exception e) { + e.printStackTrace(); + fail.add(desc + "失败"); + } } if (CollectionUtil.isNotEmpty(bean.getProductsEntityList())) { - thrProductsDao.insertOrUpdateBatch(bean.getProductsEntityList()); + String desc = "第三方产品信息:"; + try { + thrProductsDao.insertOrUpdateBatch(bean.getProductsEntityList()); + success.add(desc + "成功"); + } catch (Exception e) { + e.printStackTrace(); + fail.add(desc + "失败"); + } } if (CollectionUtil.isNotEmpty(bean.getCorpEntities())) { - thrCorpDao.insertOrUpdateBatch(bean.getCorpEntities()); + String desc = "第三方往来信息:"; + try { + thrCorpDao.insertOrUpdateBatch(bean.getCorpEntities()); + success.add(desc + "成功"); + } catch (Exception e) { + e.printStackTrace(); + fail.add(desc + "失败"); + } } + success.addAll(fail); + return String.join(",", success); } - private void saveUploadUserData(SpsSyncDataResponse bean) { - + private String saveUploadUserData(SpsSyncDataResponse bean) { + List success = new ArrayList<>(); + List fail = new ArrayList<>(); if (CollectionUtil.isNotEmpty(bean.getAuthAdminList())) { - authAdminDao.insertOrUpdateBatch(bean.getAuthAdminList()); + String desc = "系统用户信息:"; + try { + authAdminDao.insertOrUpdateBatch(bean.getAuthAdminList()); + success.add(desc + "成功"); + } catch (Exception e) { + e.printStackTrace(); + fail.add(desc + "失败"); + } } if (CollectionUtil.isNotEmpty(bean.getDeptEntityList())) { - deptDao.insertOrUpdateBatch(bean.getDeptEntityList()); + String desc = "部门信息:"; + try { + deptDao.insertOrUpdateBatch(bean.getDeptEntityList()); + success.add(desc + "成功"); + } catch (Exception e) { + e.printStackTrace(); + fail.add(desc + "失败"); + } } if (CollectionUtil.isNotEmpty(bean.getDeptUserEntities())) { - deptUserDao.replaceBatch(bean.getDeptUserEntities()); + String desc = "部门用户信息:"; + try { + deptUserDao.replaceBatch(bean.getDeptUserEntities()); + success.add(desc + "成功"); + } catch (Exception e) { + e.printStackTrace(); + fail.add(desc + "失败"); + } } if (CollectionUtil.isNotEmpty(bean.getInvWarehouseEntities())) { - invWarehouseDao.insertOrUpdateBatch(bean.getInvWarehouseEntities()); + String desc = "仓库字典信息:"; + try { + invWarehouseDao.insertOrUpdateBatch(bean.getInvWarehouseEntities()); + success.add(desc + "成功"); + } catch (Exception e) { + e.printStackTrace(); + fail.add(desc + "失败"); + } } if (CollectionUtil.isNotEmpty(bean.getWarehouseUserEntities())) { - warehouseUserDao.insertOrUpdateBatch(bean.getWarehouseUserEntities()); + String desc = "仓库用户信息:"; + try { + warehouseUserDao.insertOrUpdateBatch(bean.getWarehouseUserEntities()); + success.add(desc + "成功"); + } catch (Exception e) { + e.printStackTrace(); + fail.add(desc + "失败"); + } } if (CollectionUtil.isNotEmpty(bean.getWarehouseBussinessTypeEntities())) { - for (WarehouseBussinessTypeEntity warehouseBussinessTypeEntity : bean.getWarehouseBussinessTypeEntities()) { - warehouseBussinessTypeDao.insertOrUpdate(warehouseBussinessTypeEntity); + 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 + "条"); } } if (CollectionUtil.isNotEmpty(bean.getInvSpaces())) { - invSpaceDao.insertOrUpdateBatch(bean.getInvSpaces()); + String desc = "货位信息:"; + try { + invSpaceDao.insertOrUpdateBatch(bean.getInvSpaces()); + success.add(desc + "成功"); + } catch (Exception e) { + e.printStackTrace(); + fail.add(desc + "失败"); + } } if (CollectionUtil.isNotEmpty(bean.getInvBusUserEntities())) { - invBusUserDao.insertOrUpdateBatch(bean.getInvBusUserEntities()); + String desc = "用户关联单据信息:"; + try { + invBusUserDao.insertOrUpdateBatch(bean.getInvBusUserEntities()); + success.add(desc + "成功"); + } catch (Exception e) { + e.printStackTrace(); + fail.add(desc + "失败"); + } } + success.addAll(fail); + return String.join(",", success); } private final BasicBussinessTypeDao basicBussinessTypeDao; @@ -511,16 +691,41 @@ public class SpsSyncDownloadController { * * @param bean */ - private void saveUploadDocumentTypeData(SpsSyncBusResponse bean) { + private String saveUploadDocumentTypeData(SpsSyncBusResponse bean) { + List success = new ArrayList<>(); + List fail = new ArrayList<>(); if (CollectionUtil.isNotEmpty(bean.getBussinessTypeEntities())) { - basicBussinessTypeDao.insertOrUpdateBatch(bean.getBussinessTypeEntities()); + String desc = "扫码单据类型信息:"; + try { + basicBussinessTypeDao.insertOrUpdateBatch(bean.getBussinessTypeEntities()); + success.add(desc + "成功"); + } catch (Exception e) { + e.printStackTrace(); + fail.add(desc + "失败"); + } } if (CollectionUtil.isNotEmpty(bean.getBusTypeChangeEntities())) { - busTypeChangeDao.insertOrUpdateBatch(bean.getBusTypeChangeEntities()); + String desc = "业务单据类型:"; + try { + busTypeChangeDao.insertOrUpdateBatch(bean.getBusTypeChangeEntities()); + success.add(desc + "成功"); + } catch (Exception e) { + e.printStackTrace(); + fail.add(desc + "失败"); + } } if (CollectionUtil.isNotEmpty(bean.getThrBusTypeOriginEntities())) { - thrBusTypeOriginDao.insertOrUpdateBatch(bean.getThrBusTypeOriginEntities()); + String desc = "第三方单据类型信息:"; + try { + thrBusTypeOriginDao.insertOrUpdateBatch(bean.getThrBusTypeOriginEntities()); + success.add(desc + "成功"); + } catch (Exception e) { + e.printStackTrace(); + fail.add(desc + "失败"); + } } + success.addAll(fail); + return String.join(",", success); } @@ -532,14 +737,31 @@ public class SpsSyncDownloadController { * * @param bean */ - private void saveUploadOtherData(SpsSyncOtherDataResponse bean) { + private String saveUploadOtherData(SpsSyncOtherDataResponse bean) { + List success = new ArrayList<>(); + List fail = new ArrayList<>(); if (CollectionUtil.isNotEmpty(bean.getIoCodeLostList())) { - ioCodeLostMapper.insertOrUpdateBatch(bean.getIoCodeLostList()); + String desc = "UDI码补齐信息:"; + try { + ioCodeLostMapper.insertOrUpdateBatch(bean.getIoCodeLostList()); + success.add(desc + "成功"); + } catch (Exception e) { + e.printStackTrace(); + fail.add(desc + "失败"); + } } if (CollectionUtil.isNotEmpty(bean.getIoCodeRelList())) { - ioCodeRelMapper.insertOrUpdateBatch(bean.getIoCodeRelList()); + String desc = "UDI码关联关系:"; + try { + ioCodeRelMapper.insertOrUpdateBatch(bean.getIoCodeRelList()); + success.add(desc + "成功"); + } catch (Exception e) { + e.printStackTrace(); + fail.add(desc + "失败"); + } } - + success.addAll(fail); + return String.join(",", success); } private final BasicHospTypeDao basicHospTypeDao; @@ -558,37 +780,101 @@ public class SpsSyncDownloadController { * * @param bean */ - private void saveUploadBasicData(SpsSyncBasicDataResponse bean) { + private String saveUploadBasicData(SpsSyncBasicDataResponse bean) { + List success = new ArrayList<>(); + List fail = new ArrayList<>(); if (CollectionUtil.isNotEmpty(bean.getHospTypeList())) { - basicHospTypeDao.insertOrUpdateBatch(bean.getHospTypeList()); + String desc = "物资字典分类信息:"; + try { + basicHospTypeDao.insertOrUpdateBatch(bean.getHospTypeList()); + success.add(desc + "成功"); + } catch (Exception e) { + fail.add(desc + "失败"); + } } if (CollectionUtil.isNotEmpty(bean.getUdiRelevanceList())) { - udiRelevanceDao.insertOrUpdateBatch(bean.getUdiRelevanceList()); + String desc = "物资字典主表信息:"; + try { + udiRelevanceDao.insertOrUpdateBatch(bean.getUdiRelevanceList()); + success.add(desc + "成功"); + } catch (Exception e) { + fail.add(desc + "失败"); + } } if (CollectionUtil.isNotEmpty(bean.getProductsList())) { - basicProductsDao.insertOrUpdateBatch(bean.getProductsList()); + String desc = "供应商物资字典信息:"; + try { + basicProductsDao.insertOrUpdateBatch(bean.getProductsList()); + success.add(desc + "成功"); + } catch (Exception e) { + fail.add(desc + "失败"); + } } if (CollectionUtil.isNotEmpty(bean.getRelevanceList())) { - relevanceDao.insertOrUpdateBatch(bean.getRelevanceList()); + String desc = "物资字典子表信息:"; + try { + relevanceDao.insertOrUpdateBatch(bean.getRelevanceList()); + success.add(desc + "成功"); + } catch (Exception e) { + fail.add(desc + "失败"); + } } if (CollectionUtil.isNotEmpty(bean.getCorpList())) { - corpDao.insertOrUpdateBatch(bean.getCorpList()); + String desc = "往来单位信息:"; + try { + corpDao.insertOrUpdateBatch(bean.getCorpList()); + success.add(desc + "成功"); + } catch (Exception e) { + fail.add(desc + "失败"); + } } if (CollectionUtil.isNotEmpty(bean.getSupCertList())) { - supCertDao.insertOrUpdateBatch(bean.getSupCertList()); + String desc = "资质证书信息:"; + try { + supCertDao.insertOrUpdateBatch(bean.getSupCertList()); + success.add(desc + "成功"); + } catch (Exception e) { + fail.add(desc + "失败"); + } } if (CollectionUtil.isNotEmpty(bean.getSupCertSetList())) { - supCertSetDao.insertOrUpdateBatch(bean.getSupCertSetList()); + String desc = "资质证书要求设置信息:"; + try { + supCertSetDao.insertOrUpdateBatch(bean.getSupCertSetList()); + success.add(desc + "成功"); + } catch (Exception e) { + fail.add(desc + "失败"); + } } if (CollectionUtil.isNotEmpty(bean.getSupCompanyList())) { - supCompanyDao.insertOrUpdateBatch(bean.getSupCompanyList()); + String desc = "供应商资质信息:"; + try { + supCompanyDao.insertOrUpdateBatch(bean.getSupCompanyList()); + success.add(desc + "成功"); + } catch (Exception e) { + fail.add(desc + "失败"); + } } if (CollectionUtil.isNotEmpty(bean.getSupManufacturerList())) { - supManufacturerDao.insertOrUpdateBatch(bean.getSupManufacturerList()); + String desc = "生产企业资质信息:"; + try { + supManufacturerDao.insertOrUpdateBatch(bean.getSupManufacturerList()); + success.add(desc + "成功"); + } catch (Exception e) { + fail.add(desc + "失败"); + } } if (CollectionUtil.isNotEmpty(bean.getSupProductList())) { - supProductDao.insertOrUpdateBatch(bean.getSupProductList()); + String desc = "配送产品资质信息:"; + try { + supProductDao.insertOrUpdateBatch(bean.getSupProductList()); + success.add(desc + "成功"); + } catch (Exception e) { + fail.add(desc + "失败"); + } } + success.addAll(fail); + return String.join(",", success); } @Resource diff --git a/src/main/java/com/glxp/api/entity/sync/BasicDownloadStatusEntity.java b/src/main/java/com/glxp/api/entity/sync/BasicDownloadStatusEntity.java index 688a7830..eb64afa7 100644 --- a/src/main/java/com/glxp/api/entity/sync/BasicDownloadStatusEntity.java +++ b/src/main/java/com/glxp/api/entity/sync/BasicDownloadStatusEntity.java @@ -35,4 +35,5 @@ public class BasicDownloadStatusEntity { private String remark; @TableField(value = "cacheFilePath") private String cacheFilePath; + private String execInfo; } diff --git a/src/main/resources/schemas/schema_v2.1.sql b/src/main/resources/schemas/schema_v2.1.sql index edaac24a..38fba94f 100644 --- a/src/main/resources/schemas/schema_v2.1.sql +++ b/src/main/resources/schemas/schema_v2.1.sql @@ -1,5 +1,8 @@ # 字段新增 (表名,字段名,字段类型,修改方式(1:新增,2:修改,3:删除) +CALL Pro_Temp_ColumnWork('basic_download_status', 'execInfo', + 'varchar(255) ', 1); + CALL Pro_Temp_ColumnWork('basic_download_status', 'cacheFilePath', 'varchar(255) ', 1); From 925a203e4eb26820238204b54a61ae5414691b70 Mon Sep 17 00:00:00 2001 From: wj <1285151836@qq.com> Date: Thu, 4 May 2023 12:01:02 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=89=A7=E8=A1=8C?= =?UTF-8?q?=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/glxp/api/controller/sync/SpsSyncDownloadController.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/glxp/api/controller/sync/SpsSyncDownloadController.java b/src/main/java/com/glxp/api/controller/sync/SpsSyncDownloadController.java index 14399de2..7a34a3a8 100644 --- a/src/main/java/com/glxp/api/controller/sync/SpsSyncDownloadController.java +++ b/src/main/java/com/glxp/api/controller/sync/SpsSyncDownloadController.java @@ -375,7 +375,7 @@ public class SpsSyncDownloadController { String fileFullPath = writeFile(filePrefix, upLoadRequest.getExportType().getRemark(), JSONUtil.toJsonStr(upLoadRequest.getData())); downloadStatus.setCacheFilePath(fileFullPath); basicDownloadService.insertDownloadStatus(downloadStatus); - return ResultVOUtils.success(); + return ResultVOUtils.success(log); } catch (Exception e) { e.printStackTrace(); return ResultVOUtils.error(ResultEnum.NOT_NETWORK.getCode(), e.getMessage());