From bff708d5984cac7b1a12d5ded3e0779a6057a89a Mon Sep 17 00:00:00 2001 From: anthonyywj2 <353682448@qq.com> Date: Fri, 29 Apr 2022 16:08:23 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E5=A4=87=E4=BB=BD=E3=80=82?= =?UTF-8?q?=E5=8D=95=E6=8D=AE=E8=87=AA=E5=8A=A8=E7=94=9F=E6=88=90=E4=BB=A5?= =?UTF-8?q?=E5=8F=8Abug=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../basic/SpsSyncExportStatusController.java | 94 +++++++++++++++++++ .../req/basic/BasicExportStatusRequest.java | 1 + .../mybatis/mapper/basic/BussinessTypeDao.xml | 3 +- 3 files changed, 96 insertions(+), 2 deletions(-) diff --git a/api-admin/src/main/java/com/glxp/sale/admin/controller/basic/SpsSyncExportStatusController.java b/api-admin/src/main/java/com/glxp/sale/admin/controller/basic/SpsSyncExportStatusController.java index 4c0d69c..f93dbf7 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/controller/basic/SpsSyncExportStatusController.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/controller/basic/SpsSyncExportStatusController.java @@ -3,18 +3,22 @@ package com.glxp.sale.admin.controller.basic; import cn.hutool.core.collection.CollUtil; import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.TypeReference; +import com.github.pagehelper.PageInfo; import com.glxp.sale.admin.constant.BasicProcessStatus; import com.glxp.sale.admin.entity.basic.BasicExportStatusEntity; import com.glxp.sale.admin.entity.basic.BasicExportStatusTimeEntity; +import com.glxp.sale.admin.entity.inout.StockOrderEntity; import com.glxp.sale.admin.req.basic.BasicExportStatusRequest; import com.glxp.sale.admin.req.basic.BasicExportTimeRequest; import com.glxp.sale.admin.req.info.DeleteRequest; +import com.glxp.sale.admin.res.PageSimpleResponse; import com.glxp.sale.admin.res.basic.BasicUnitMaintainExportResponse; import com.glxp.sale.admin.res.basic.SpsSyncDataResponse; import com.glxp.sale.admin.res.basic.UdiRelevanceExportJsonResponse; import com.glxp.sale.admin.res.inventory.InvWarehouseExportResponse; import com.glxp.sale.admin.service.basic.BasicExportService; import com.glxp.sale.admin.service.basic.BasicExportTimeService; +import com.glxp.sale.admin.util.CustomUtil; import com.glxp.sale.admin.util.RedisUtil; import com.glxp.sale.common.res.BaseResponse; import com.glxp.sale.common.util.ResultVOUtils; @@ -45,6 +49,18 @@ public class SpsSyncExportStatusController { return ResultVOUtils.success(basicExportStatusEntities); } + @GetMapping("/spssync/basic/udiinfo/filter") + public BaseResponse filterStatus(BasicExportStatusRequest basicExportStatusRequest) { + List basicExportStatusEntities = basicExportService.filterExportStatus(basicExportStatusRequest); + PageInfo pageInfo; + pageInfo = new PageInfo<>(basicExportStatusEntities); + PageSimpleResponse pageSimpleResponse = new PageSimpleResponse<>(); + pageSimpleResponse.setTotal(pageInfo.getTotal()); + pageSimpleResponse.setList(basicExportStatusEntities); + return ResultVOUtils.success(pageSimpleResponse); + } + + @PostMapping("/spssync/basic/udiinfo/deleteByStatus") public BaseResponse deleteByStatus(@RequestBody DeleteRequest deleteRequest) { @@ -88,4 +104,82 @@ public class SpsSyncExportStatusController { else return ResultVOUtils.error(500, "更新失败!"); } + + @PostMapping("/spssync/basic/schedule/create") + public BaseResponse createSchedule(@RequestBody BasicExportStatusRequest basicExportStatusRequest) { + + + if (basicExportStatusRequest.getCreateType() == 1) { + + //自动创建要求被下载已完成单据任务 + BasicExportStatusEntity basicExportStatusEntity1 = basicExportService.findByData("AutoDownloadOrder", 0); + if (basicExportStatusEntity1 == null) { + BasicExportStatusEntity orderStatusEntity = new BasicExportStatusEntity(); + orderStatusEntity.setId(CustomUtil.getId()); + orderStatusEntity.setIdDatas("AutoDownloadOrder"); + orderStatusEntity.setType(BasicProcessStatus.NEW_ALL_ORDER); + orderStatusEntity.setUpdateTime(new Date()); + orderStatusEntity.setStatus(0); + orderStatusEntity.setStartTime(new Date()); + orderStatusEntity.setScheduleType(BasicProcessStatus.SCHEDULE_NORMAL); + basicExportService.insertExportStatus(orderStatusEntity); + }else { + return ResultVOUtils.error(501,"任务已存在!"); + } + } else if (basicExportStatusRequest.getCreateType() == 2) { + //自动创建要求被下载单据类型任务 + BasicExportStatusEntity basicExportStatusEntity2 = basicExportService.findByData("AutoDownloadBusType", 0); + if (basicExportStatusEntity2 == null) { + BasicExportStatusEntity busTypetatusEntity = new BasicExportStatusEntity(); + busTypetatusEntity.setId(CustomUtil.getId()); + busTypetatusEntity.setIdDatas("AutoDownloadBusType"); + busTypetatusEntity.setType(BasicProcessStatus.NEW_ALL_BUS); + busTypetatusEntity.setUpdateTime(new Date()); + busTypetatusEntity.setStatus(0); + busTypetatusEntity.setStartTime(new Date()); + busTypetatusEntity.setScheduleType(BasicProcessStatus.SCHEDULE_NORMAL); + basicExportService.insertExportStatus(busTypetatusEntity); + }else { + return ResultVOUtils.error(501,"任务已存在!"); + } + + } else if (basicExportStatusRequest.getCreateType() == 3) { + + //自动创建要求被下载基础信息任务 + BasicExportStatusEntity basicExportStatusEntity3 = basicExportService.findByData("AutoDownloadAllData", 0); + if (basicExportStatusEntity3 == null) { + BasicExportStatusEntity basicExportStatusEntity = new BasicExportStatusEntity(); + basicExportStatusEntity.setId(CustomUtil.getId()); + basicExportStatusEntity.setIdDatas("AutoDownloadAllData"); + basicExportStatusEntity.setType(BasicProcessStatus.NEW_ALL_DATA); + basicExportStatusEntity.setUpdateTime(new Date()); + basicExportStatusEntity.setStatus(0); + basicExportStatusEntity.setStartTime(new Date()); + basicExportStatusEntity.setScheduleType(BasicProcessStatus.SCHEDULE_NORMAL); + basicExportService.insertExportStatus(basicExportStatusEntity); + }else { + return ResultVOUtils.error(501,"任务已存在!"); + } + + } else if (basicExportStatusRequest.getCreateType() == 4) { + //自动创建要求被下载同步库DI信息 + BasicExportStatusEntity basicExportStatusEntity4 = basicExportService.findByData("AutoDownloadDiProducts", 0); + if (basicExportStatusEntity4 == null) { + BasicExportStatusEntity basicExportStatusEntity = new BasicExportStatusEntity(); + basicExportStatusEntity.setId(CustomUtil.getId()); + basicExportStatusEntity.setIdDatas("AutoDownloadDiProducts"); + basicExportStatusEntity.setType(BasicProcessStatus.NEW_ALL_DI); + basicExportStatusEntity.setUpdateTime(new Date()); + basicExportStatusEntity.setStatus(0); + basicExportStatusEntity.setStartTime(new Date()); + basicExportStatusEntity.setScheduleType(BasicProcessStatus.SCHEDULE_NORMAL); + basicExportService.insertExportStatus(basicExportStatusEntity); + }else { + return ResultVOUtils.error(501,"任务已存在!"); + } + } + return ResultVOUtils.success("创建成功!"); + + } + } \ No newline at end of file diff --git a/api-admin/src/main/java/com/glxp/sale/admin/req/basic/BasicExportStatusRequest.java b/api-admin/src/main/java/com/glxp/sale/admin/req/basic/BasicExportStatusRequest.java index d5adaad..8379ebb 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/req/basic/BasicExportStatusRequest.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/req/basic/BasicExportStatusRequest.java @@ -10,4 +10,5 @@ public class BasicExportStatusRequest extends ListPageRequest { private Integer type; private Integer scheduleType; private String idDatas; + public Integer createType; } diff --git a/api-admin/src/main/resources/mybatis/mapper/basic/BussinessTypeDao.xml b/api-admin/src/main/resources/mybatis/mapper/basic/BussinessTypeDao.xml index 9a91e43..731df58 100644 --- a/api-admin/src/main/resources/mybatis/mapper/basic/BussinessTypeDao.xml +++ b/api-admin/src/main/resources/mybatis/mapper/basic/BussinessTypeDao.xml @@ -82,8 +82,7 @@ basic_bustype_local.name localName,basic_bussiness_type.checkEnable, basic_bustype_local.advanceType, basic_bustype_local.changeEnable,basic_bussiness_type.genUnit,basic_bussiness_type.innerOrder,defaultUnit, basic_bustype_local.spUse,basic_bussiness_type.storageCode,basic_bussiness_type.expireTip, - basic_bustype_local.prefix localPrefix - localPrefix from + basic_bustype_local.prefix localPrefix from basic_bussiness_type LEFT JOIN basic_third_sys on basic_bussiness_type.thirdSysFk = basic_third_sys.thirdId LEFT JOIN basic_bustype_local on basic_bussiness_type.localAction =