From d9bcca035dede58ad7edb93b408be92b2f871773 Mon Sep 17 00:00:00 2001 From: x_z Date: Mon, 6 Jun 2022 17:13:32 +0800 Subject: [PATCH] =?UTF-8?q?1.=E6=96=B0=E5=A2=9E=E5=AE=9A=E6=97=B6=E4=B8=8B?= =?UTF-8?q?=E8=BD=BD=E7=AC=AC=E4=B8=89=E6=96=B9=E7=B3=BB=E7=BB=9F=E5=9F=BA?= =?UTF-8?q?=E7=A1=80=E4=BF=A1=E6=81=AF=202.=E6=96=B0=E5=A2=9E=E5=AE=9A?= =?UTF-8?q?=E6=97=B6=E6=8F=90=E4=BA=A4=E5=B7=B2=E6=A0=B8=E5=AF=B9=E5=8D=95?= =?UTF-8?q?=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../info/SystemParamConfigController.java | 29 ++++++++++++++++++- .../dao/basic/BasicThirdSysBusApiDao.java | 7 +++++ .../api/admin/dao/basic/BasicThirdSysDao.java | 6 ++++ .../api/admin/dao/business/StockOrderDao.java | 6 ++++ .../api/admin/service/inout/OrderService.java | 9 ++++++ .../service/inout/impl/OrderServiceImpl.java | 5 ++++ .../com/glxp/api/admin/util/CronUtils.java | 9 ++++++ .../mapper/basic/BasicThirdSysBusApiDao.xml | 5 ++++ .../mybatis/mapper/basic/BasicThirdSysDao.xml | 6 ++++ .../mybatis/mapper/business/StockOrderDao.xml | 14 +++++++++ 10 files changed, 95 insertions(+), 1 deletion(-) diff --git a/api-admin/src/main/java/com/glxp/api/admin/controller/info/SystemParamConfigController.java b/api-admin/src/main/java/com/glxp/api/admin/controller/info/SystemParamConfigController.java index 65ccc131..d8f66946 100644 --- a/api-admin/src/main/java/com/glxp/api/admin/controller/info/SystemParamConfigController.java +++ b/api-admin/src/main/java/com/glxp/api/admin/controller/info/SystemParamConfigController.java @@ -10,7 +10,6 @@ import com.glxp.api.admin.req.info.SystemParamConfigSaveRequest; import com.glxp.api.admin.res.PageSimpleResponse; import com.glxp.api.admin.res.info.SystemParamConfigResponse; import com.glxp.api.admin.service.info.SystemParamConfigService; -import com.glxp.api.admin.thread.IoModifyErpTask; import com.glxp.api.admin.util.CronUtils; import com.glxp.api.common.enums.ResultEnum; import com.glxp.api.common.res.BaseResponse; @@ -140,6 +139,34 @@ public class SystemParamConfigController { } catch (Exception e) { return ResultVOUtils.error(500, "格式错误!"); } + } else if (systemParamConfigSaveRequest.getParamKey().equals("auto_download_thirdSys_data")) { + try { + int time = 1; + if (!"0".equals(systemParamConfigSaveRequest.getParamValue())) { + time = Integer.parseInt(systemParamConfigSaveRequest.getParamValue()); + } + String cornStr = CronUtils.parseHourIntervel(time); + ScheduledEntity scheduledEntity = new ScheduledEntity(); + scheduledEntity.setCron(cornStr); + scheduledEntity.setCronName("downThirdSysDataTask"); + scheduledDao.modifyScheduled(scheduledEntity); + } catch (Exception e) { + return ResultVOUtils.error(500, "格式错误!"); + } + } else if (systemParamConfigSaveRequest.getParamKey().equals("auto_submit_order")) { + try { + int time = 1; + if (!"0".equals(systemParamConfigSaveRequest.getParamValue())) { + time = Integer.parseInt(systemParamConfigSaveRequest.getParamValue()); + } + String cornStr = CronUtils.parseHourIntervel(time); + ScheduledEntity scheduledEntity = new ScheduledEntity(); + scheduledEntity.setCron(cornStr); + scheduledEntity.setCronName("submitOrderTask"); + scheduledDao.modifyScheduled(scheduledEntity); + } catch (Exception e) { + return ResultVOUtils.error(500, "格式错误!"); + } } return ResultVOUtils.success("修改成功"); } diff --git a/api-admin/src/main/java/com/glxp/api/admin/dao/basic/BasicThirdSysBusApiDao.java b/api-admin/src/main/java/com/glxp/api/admin/dao/basic/BasicThirdSysBusApiDao.java index 697fa0f0..f4d25b57 100644 --- a/api-admin/src/main/java/com/glxp/api/admin/dao/basic/BasicThirdSysBusApiDao.java +++ b/api-admin/src/main/java/com/glxp/api/admin/dao/basic/BasicThirdSysBusApiDao.java @@ -27,4 +27,11 @@ public interface BasicThirdSysBusApiDao { boolean deleteById(@Param("id") Integer id); BasicThirdSysBusApiEntity selectByCode(@Param("code") String code); + + /** + * 查询所有编码 + * + * @return + */ + List selectAllCode(); } diff --git a/api-admin/src/main/java/com/glxp/api/admin/dao/basic/BasicThirdSysDao.java b/api-admin/src/main/java/com/glxp/api/admin/dao/basic/BasicThirdSysDao.java index b1cf5ed7..da604153 100644 --- a/api-admin/src/main/java/com/glxp/api/admin/dao/basic/BasicThirdSysDao.java +++ b/api-admin/src/main/java/com/glxp/api/admin/dao/basic/BasicThirdSysDao.java @@ -16,5 +16,11 @@ public interface BasicThirdSysDao { List filterBasicThiSys(FilterBasicThirdSysRequest filterBasicThirdSysRequest); + /** + * 查询启用的第三方系统的ID + * + * @return + */ + List selectEnabledThirdId(); } diff --git a/api-admin/src/main/java/com/glxp/api/admin/dao/business/StockOrderDao.java b/api-admin/src/main/java/com/glxp/api/admin/dao/business/StockOrderDao.java index e306d044..189bb27f 100644 --- a/api-admin/src/main/java/com/glxp/api/admin/dao/business/StockOrderDao.java +++ b/api-admin/src/main/java/com/glxp/api/admin/dao/business/StockOrderDao.java @@ -58,4 +58,10 @@ public interface StockOrderDao { boolean deleteByOrderIdFk(String orderIdFk); StockOrderEntity findById(@Param("id") String id); + + /** + * 查询 + * @return + */ + List selectWaitSubmitOrders(); } diff --git a/api-admin/src/main/java/com/glxp/api/admin/service/inout/OrderService.java b/api-admin/src/main/java/com/glxp/api/admin/service/inout/OrderService.java index c6788a7b..f1c381d4 100644 --- a/api-admin/src/main/java/com/glxp/api/admin/service/inout/OrderService.java +++ b/api-admin/src/main/java/com/glxp/api/admin/service/inout/OrderService.java @@ -80,6 +80,7 @@ public interface OrderService { * @return */ List checkSubmitOrder(List orderResponseList); + /** * 查询单据删除页面订单列表 * @@ -112,4 +113,12 @@ public interface OrderService { * @param orders */ public void getAllOrder(OrderEntity orderEntity, List orders); + + /** + * 查询待提交订单 + * + * @return + */ + List getWaitSubmitOrder(); + } diff --git a/api-admin/src/main/java/com/glxp/api/admin/service/inout/impl/OrderServiceImpl.java b/api-admin/src/main/java/com/glxp/api/admin/service/inout/impl/OrderServiceImpl.java index 73b5cdcd..817c36dc 100644 --- a/api-admin/src/main/java/com/glxp/api/admin/service/inout/impl/OrderServiceImpl.java +++ b/api-admin/src/main/java/com/glxp/api/admin/service/inout/impl/OrderServiceImpl.java @@ -351,6 +351,11 @@ public class OrderServiceImpl implements OrderService { return orderResponseList; } + @Override + public List getWaitSubmitOrder() { + return stockOrderDao.selectWaitSubmitOrders(); + } + @Override public List filterOrderForDelete(String billNo) { diff --git a/api-admin/src/main/java/com/glxp/api/admin/util/CronUtils.java b/api-admin/src/main/java/com/glxp/api/admin/util/CronUtils.java index 79abd013..9cd21df5 100644 --- a/api-admin/src/main/java/com/glxp/api/admin/util/CronUtils.java +++ b/api-admin/src/main/java/com/glxp/api/admin/util/CronUtils.java @@ -29,4 +29,13 @@ public class CronUtils { return cron; } + public static String parseHourIntervel(int time) { + int hour = time; + String cron = "0 0 0/" + hour + " * * ?"; + if (time >= 24) { + hour = 24; + cron = "0 0 0/" + hour + " * * ?"; + } + return cron; + } } diff --git a/api-admin/src/main/resources/mybatis/mapper/basic/BasicThirdSysBusApiDao.xml b/api-admin/src/main/resources/mybatis/mapper/basic/BasicThirdSysBusApiDao.xml index 1db5037e..32ccde0b 100644 --- a/api-admin/src/main/resources/mybatis/mapper/basic/BasicThirdSysBusApiDao.xml +++ b/api-admin/src/main/resources/mybatis/mapper/basic/BasicThirdSysBusApiDao.xml @@ -82,4 +82,9 @@ from basic_third_sys_bus_api where code = #{code} + + + \ No newline at end of file diff --git a/api-admin/src/main/resources/mybatis/mapper/basic/BasicThirdSysDao.xml b/api-admin/src/main/resources/mybatis/mapper/basic/BasicThirdSysDao.xml index 622f4367..f3f9576f 100644 --- a/api-admin/src/main/resources/mybatis/mapper/basic/BasicThirdSysDao.xml +++ b/api-admin/src/main/resources/mybatis/mapper/basic/BasicThirdSysDao.xml @@ -41,4 +41,10 @@ + + \ No newline at end of file diff --git a/api-admin/src/main/resources/mybatis/mapper/business/StockOrderDao.xml b/api-admin/src/main/resources/mybatis/mapper/business/StockOrderDao.xml index e60d2c32..c8056ce6 100644 --- a/api-admin/src/main/resources/mybatis/mapper/business/StockOrderDao.xml +++ b/api-admin/src/main/resources/mybatis/mapper/business/StockOrderDao.xml @@ -293,4 +293,18 @@ where orderIdFk = #{orderIdFk} + + \ No newline at end of file