diff --git a/common-ruoyi/ruoyi-common/src/main/java/com/ruoyi/common/constant/Constants.java b/common-ruoyi/ruoyi-common/src/main/java/com/ruoyi/common/constant/Constants.java index bb32106..4ed70dc 100644 --- a/common-ruoyi/ruoyi-common/src/main/java/com/ruoyi/common/constant/Constants.java +++ b/common-ruoyi/ruoyi-common/src/main/java/com/ruoyi/common/constant/Constants.java @@ -163,7 +163,7 @@ public class Constants /** * 定时任务白名单配置(仅允许访问的包名,如其他需要可以自行添加) */ - public static final String[] JOB_WHITELIST_STR = { "com.ruoyi.quartz.task" }; + public static final String[] JOB_WHITELIST_STR = { "com.ruoyi.quartz.task", "com.ruoyi.task" }; /** * 定时任务违规的字符 diff --git a/ruoyi-web/src/main/java/com/ruoyi/task/prodOrder/ProdOrderTask.java b/ruoyi-web/src/main/java/com/ruoyi/task/prodOrder/ProdOrderTask.java new file mode 100644 index 0000000..2dee339 --- /dev/null +++ b/ruoyi-web/src/main/java/com/ruoyi/task/prodOrder/ProdOrderTask.java @@ -0,0 +1,29 @@ +package com.ruoyi.task.prodOrder; + +import com.ruoyi.common.constant.Constants; +import com.ruoyi.web.yh.prodOrder.domain.dto.ProdOrderSyncQuery; +import com.ruoyi.web.yh.prodOrder.domain.enums.ProdOrderErpStatus; +import com.ruoyi.web.yh.prodOrder.service.ProdOrderService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * @author wjh + * 2024/11/21 + */ +@Component +public class ProdOrderTask { + + @Autowired + private ProdOrderService prodOrderService; + + /** + * 同步生产订单 + */ + public void sync() { + ProdOrderSyncQuery query = new ProdOrderSyncQuery(); + query.setStatusList(ProdOrderErpStatus.canSync()); + prodOrderService.sync(query, Constants.SYSTEM_USER_ID); + } + +}