From 573a712c63fc6ee5e2bf94224d89a95eb5a940ae Mon Sep 17 00:00:00 2001 From: liuchen864 <23082234@qq.com> Date: Thu, 14 Mar 2024 15:44:37 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E6=88=90=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/base/CommandController.java | 117 +++++++++++++++-- .../web/controller/base/ShellController.java | 116 +++++++++++++++-- .../src/main/resources/application-dev.yml | 22 ---- .../src/main/resources/application-prod.yml | 7 -- .../src/main/resources/application-test.yml | 7 -- .../src/main/resources/logback-spring.xml | 119 +++++++++++++----- .../system/service/LinuxAccessService.java | 34 +++-- 7 files changed, 323 insertions(+), 99 deletions(-) diff --git a/win-admin/src/main/java/com/win/web/controller/base/CommandController.java b/win-admin/src/main/java/com/win/web/controller/base/CommandController.java index 30ac8ee..d603518 100644 --- a/win-admin/src/main/java/com/win/web/controller/base/CommandController.java +++ b/win-admin/src/main/java/com/win/web/controller/base/CommandController.java @@ -1,6 +1,7 @@ package com.win.web.controller.base; import com.alibaba.fastjson2.JSONObject; +import com.jcraft.jsch.JSchException; import com.win.common.annotation.Log; import com.win.common.constant.HttpStatus; import com.win.common.core.domain.AjaxResult; @@ -76,18 +77,112 @@ public class CommandController { return (AjaxResult) method.invoke(this, body); } + public AjaxResult poreceipt(String body) throws IOException, InterruptedException { + return linuxAccessService.executeCommand(body, "purchaseorder/poreceipt/"); + } + + public AjaxResult projectdetail(String body) throws IOException, InterruptedException { + return linuxAccessService.executeCommand(body, "project/projectdetail/"); + } + + public AjaxResult itemmaster(String body) throws IOException, InterruptedException { + return linuxAccessService.executeCommand(body, "items/itemmaster/"); + } + + public AjaxResult inventorydetail(String body) throws IOException, InterruptedException { + return linuxAccessService.executeCommand(body, "inventory/inventorydetail/"); + } + + public AjaxResult podetexport(String body) throws IOException, InterruptedException { + return linuxAccessService.executeCommand(body, "puchaseorder/podetexport/"); + } + + public AjaxResult exportsupplier(String body) throws IOException, InterruptedException { + return linuxAccessService.executeCommand(body, "supplier/exportsupplier/"); + } + public AjaxResult discretepo(String body) throws IOException, InterruptedException { - JSONObject jsonObject = JSONObject.parseObject(body); - jsonObject = JSONObject.parseObject(jsonObject.getString("dsDescreteOrder")); - String domain = jsonObject.getString("domain"); - if(domain == null || domain.isEmpty()) { - return AjaxResult.error(HttpStatus.DOMAIN_ERROR, "域不能为空"); - } - String companyCode = jsonObject.getString("company_code"); - if(companyCode == null || companyCode.isEmpty()) { - return AjaxResult.error(HttpStatus.COMPANY_CODE_ERROR, "公司编码不能为空"); - } - return linuxAccessService.executeCommand(domain, companyCode, "purchaseorder/discretepo/", jsonObject); + return linuxAccessService.executeCommand(body, "purchaseorder/discretepo/"); + } + + public AjaxResult custrequiredschedule(String body) throws IOException, InterruptedException { + return linuxAccessService.executeCommand(body, "customer/custrequiredschedule/"); + } + + public AjaxResult qadgrirexport(String body) throws IOException, InterruptedException { + return linuxAccessService.executeCommand(body, "qadgrir/qadgrirexport/"); + } + + public AjaxResult Unplannedissue(String body) throws IOException, InterruptedException { + return linuxAccessService.executeCommand(body, "transactions/Unplannedissue/"); + } + + public AjaxResult supplierschedule(String body) throws IOException, InterruptedException { + return linuxAccessService.executeCommand(body, "supplier/supplierschedule/"); + } + + public AjaxResult bommastr(String body) throws IOException, InterruptedException { + return linuxAccessService.executeCommand(body, "bom/bommastr/"); + } + + public AjaxResult itemsiteLocdetail(String body) throws IOException, InterruptedException { + return linuxAccessService.executeCommand(body, "items/itemsiteLocdetail/"); + } + + public AjaxResult backflush(String body) throws IOException, InterruptedException { + return linuxAccessService.executeCommand(body, "workorder/backflush/"); + } + + public AjaxResult itemsiteplandetail(String body) throws IOException, InterruptedException { + return linuxAccessService.executeCommand(body, "items/itemsiteplandetail/"); + } + + public AjaxResult supplierasn(String body) throws IOException, InterruptedException { + return linuxAccessService.executeCommand(body, "supplier/supplierasn/"); + } + + public AjaxResult supplierinvoicebalance(String body) throws IOException, InterruptedException { + return linuxAccessService.executeCommand(body, "supplier/supplierinvoicebalance/"); + } + + public AjaxResult createsupplierinvoice(String body) throws IOException, InterruptedException { + return linuxAccessService.executeCommand(body, "supplierinvoice/createsupplierinvoice/"); + } + + public AjaxResult loadbommstr(String body) throws IOException, InterruptedException { + return linuxAccessService.executeCommand(body, "bommstr/loadbommstr/"); + } + + public AjaxResult costcenterdetail(String body) throws IOException, InterruptedException { + return linuxAccessService.executeCommand(body, "costcenter/costcenterdetail/"); + } + + public AjaxResult salesorderexport(String body) throws IOException, InterruptedException { + return linuxAccessService.executeCommand(body, "salesorder/salesorderexport/"); + } + + public AjaxResult costdetail(String body) throws IOException, InterruptedException { + return linuxAccessService.executeCommand(body, "cost/costdetail/"); + } + + public AjaxResult exportcustomer(String body) throws IOException, InterruptedException { + return linuxAccessService.executeCommand(body, "customer/exportcustomer/"); + } + + public AjaxResult routingdetail(String body) throws IOException, InterruptedException { + return linuxAccessService.executeCommand(body, "routing/routingdetail/"); + } + + public AjaxResult productionschedule(String body) throws IOException, InterruptedException { + return linuxAccessService.executeCommand(body, "production/productionschedule/"); + } + + public AjaxResult intransfer(String body) throws IOException, InterruptedException { + return linuxAccessService.executeCommand(body, "transactions/intransfer/"); + } + + public AjaxResult loadbommastr(String body) throws IOException, InterruptedException { + return linuxAccessService.executeCommand(body, "bom/loadbommastr/"); } } diff --git a/win-admin/src/main/java/com/win/web/controller/base/ShellController.java b/win-admin/src/main/java/com/win/web/controller/base/ShellController.java index 9c6bd26..4363e2d 100644 --- a/win-admin/src/main/java/com/win/web/controller/base/ShellController.java +++ b/win-admin/src/main/java/com/win/web/controller/base/ShellController.java @@ -78,18 +78,112 @@ public class ShellController { return (AjaxResult) method.invoke(this, body); } + public AjaxResult poreceipt(String body) throws JSchException, IOException { + return linuxAccessService.executeShell(body, "purchaseorder/poreceipt/"); + } + + public AjaxResult projectdetail(String body) throws JSchException, IOException { + return linuxAccessService.executeShell(body, "project/projectdetail/"); + } + + public AjaxResult itemmaster(String body) throws JSchException, IOException { + return linuxAccessService.executeShell(body, "items/itemmaster/"); + } + + public AjaxResult inventorydetail(String body) throws JSchException, IOException { + return linuxAccessService.executeShell(body, "inventory/inventorydetail/"); + } + + public AjaxResult podetexport(String body) throws JSchException, IOException { + return linuxAccessService.executeShell(body, "puchaseorder/podetexport/"); + } + + public AjaxResult exportsupplier(String body) throws JSchException, IOException { + return linuxAccessService.executeShell(body, "supplier/exportsupplier/"); + } + public AjaxResult discretepo(String body) throws JSchException, IOException { - JSONObject jsonObject = JSONObject.parseObject(body); - jsonObject = JSONObject.parseObject(jsonObject.getString("dsDescreteOrder")); - String domain = jsonObject.getString("domain"); - if(domain == null || domain.isEmpty()) { - return AjaxResult.error(HttpStatus.DOMAIN_ERROR, "域不能为空"); - } - String companyCode = jsonObject.getString("company_code"); - if(companyCode == null || companyCode.isEmpty()) { - return AjaxResult.error(HttpStatus.COMPANY_CODE_ERROR, "公司编码不能为空"); - } - return linuxAccessService.executeShell(domain, companyCode, "purchaseorder/discretepo/", jsonObject); + return linuxAccessService.executeShell(body, "purchaseorder/discretepo/"); + } + + public AjaxResult custrequiredschedule(String body) throws JSchException, IOException { + return linuxAccessService.executeShell(body, "customer/custrequiredschedule/"); + } + + public AjaxResult qadgrirexport(String body) throws JSchException, IOException { + return linuxAccessService.executeShell(body, "qadgrir/qadgrirexport/"); + } + + public AjaxResult Unplannedissue(String body) throws JSchException, IOException { + return linuxAccessService.executeShell(body, "transactions/Unplannedissue/"); + } + + public AjaxResult supplierschedule(String body) throws JSchException, IOException { + return linuxAccessService.executeShell(body, "supplier/supplierschedule/"); + } + + public AjaxResult bommastr(String body) throws JSchException, IOException { + return linuxAccessService.executeShell(body, "bom/bommastr/"); + } + + public AjaxResult itemsiteLocdetail(String body) throws JSchException, IOException { + return linuxAccessService.executeShell(body, "items/itemsiteLocdetail/"); + } + + public AjaxResult backflush(String body) throws JSchException, IOException { + return linuxAccessService.executeShell(body, "workorder/backflush/"); + } + + public AjaxResult itemsiteplandetail(String body) throws JSchException, IOException { + return linuxAccessService.executeShell(body, "items/itemsiteplandetail/"); + } + + public AjaxResult supplierasn(String body) throws JSchException, IOException { + return linuxAccessService.executeShell(body, "supplier/supplierasn/"); + } + + public AjaxResult supplierinvoicebalance(String body) throws JSchException, IOException { + return linuxAccessService.executeShell(body, "supplier/supplierinvoicebalance/"); + } + + public AjaxResult createsupplierinvoice(String body) throws JSchException, IOException { + return linuxAccessService.executeShell(body, "supplierinvoice/createsupplierinvoice/"); + } + + public AjaxResult loadbommstr(String body) throws JSchException, IOException { + return linuxAccessService.executeShell(body, "bommstr/loadbommstr/"); + } + + public AjaxResult costcenterdetail(String body) throws JSchException, IOException { + return linuxAccessService.executeShell(body, "costcenter/costcenterdetail/"); + } + + public AjaxResult salesorderexport(String body) throws JSchException, IOException { + return linuxAccessService.executeShell(body, "salesorder/salesorderexport/"); + } + + public AjaxResult costdetail(String body) throws JSchException, IOException { + return linuxAccessService.executeShell(body, "cost/costdetail/"); + } + + public AjaxResult exportcustomer(String body) throws JSchException, IOException { + return linuxAccessService.executeShell(body, "customer/exportcustomer/"); + } + + public AjaxResult routingdetail(String body) throws JSchException, IOException { + return linuxAccessService.executeShell(body, "routing/routingdetail/"); + } + + public AjaxResult productionschedule(String body) throws JSchException, IOException { + return linuxAccessService.executeShell(body, "production/productionschedule/"); + } + + public AjaxResult intransfer(String body) throws JSchException, IOException { + return linuxAccessService.executeShell(body, "transactions/intransfer/"); + } + + public AjaxResult loadbommastr(String body) throws JSchException, IOException { + return linuxAccessService.executeShell(body, "bom/loadbommastr/"); } } diff --git a/win-admin/src/main/resources/application-dev.yml b/win-admin/src/main/resources/application-dev.yml index f189818..9d68e32 100644 --- a/win-admin/src/main/resources/application-dev.yml +++ b/win-admin/src/main/resources/application-dev.yml @@ -148,25 +148,3 @@ swagger: enabled: true # 请求前缀 pathMapping: / - -shell: - jlht: - qad-domain: JLHT - company-code: CCWININ - server-id: master - ip: 222.169.228.163 - port: 6122 - linux-id: mfg - linux-password: mfgpro - qad-user: mfg - qad-password: Qadwin1 - jlht2: - qad-domain: JLHT2 - company-code: CCWININ - server-id: master - ip: 222.169.228.163 - port: 6122 - linux-id: mfg - linux-password: mfgpro - qad-user: mfg - qad-password: Qadwin1 diff --git a/win-admin/src/main/resources/application-prod.yml b/win-admin/src/main/resources/application-prod.yml index a892677..62cb66c 100644 --- a/win-admin/src/main/resources/application-prod.yml +++ b/win-admin/src/main/resources/application-prod.yml @@ -148,10 +148,3 @@ swagger: enabled: false # 请求前缀 pathMapping: / - -# flowable相关表 -flowable: - # true 会对数据库中所有表进行更新操作。如果表不存在,则自动创建(建议开发时使用) - database-schema-update: false - # 关闭定时任务JOB - async-executor-activate: false \ No newline at end of file diff --git a/win-admin/src/main/resources/application-test.yml b/win-admin/src/main/resources/application-test.yml index eae42a2..5486dcf 100644 --- a/win-admin/src/main/resources/application-test.yml +++ b/win-admin/src/main/resources/application-test.yml @@ -148,10 +148,3 @@ swagger: enabled: true # 请求前缀 pathMapping: / - -# flowable相关表 -flowable: - # true 会对数据库中所有表进行更新操作。如果表不存在,则自动创建(建议开发时使用) - database-schema-update: false - # 关闭定时任务JOB - async-executor-activate: false \ No newline at end of file diff --git a/win-admin/src/main/resources/logback-spring.xml b/win-admin/src/main/resources/logback-spring.xml index c191ed4..061862c 100644 --- a/win-admin/src/main/resources/logback-spring.xml +++ b/win-admin/src/main/resources/logback-spring.xml @@ -27,6 +27,29 @@ + + + ${log.path}/sys-debug.log + + + + ${log.path}/sys-debug.%d{yyyy-MM-dd}.log + + 7 + + + ${log.pattern} + + + + DEBUG + + ACCEPT + + DENY + + + ${log.path}/sys-info.log @@ -34,8 +57,8 @@ ${log.path}/sys-info.%d{yyyy-MM-dd}.log - - 60 + + 7 ${log.pattern} @@ -50,21 +73,22 @@ - - ${log.path}/sys-error.log + + + ${log.path}/sys-warn.log - ${log.path}/sys-error.%d{yyyy-MM-dd}.log - - 60 + ${log.path}/sys-warn.%d{yyyy-MM-dd}.log + + 7 ${log.pattern} - ERROR + WARN ACCEPT @@ -72,37 +96,66 @@ - - - ${log.path}/sys-user.log + + ${log.path}/sys-error.log + - - ${log.path}/sys-user.%d{yyyy-MM-dd}.log - - 60 + + ${log.path}/sys-error.%d{yyyy-MM-dd}.log + + 7 ${log.pattern} + + + ERROR,FATAL + + ACCEPT + DENY + - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - + + + + + + + + + + + + + + - - - - - \ No newline at end of file + \ No newline at end of file diff --git a/win-system/src/main/java/com/win/system/service/LinuxAccessService.java b/win-system/src/main/java/com/win/system/service/LinuxAccessService.java index a0507e7..f1e7738 100644 --- a/win-system/src/main/java/com/win/system/service/LinuxAccessService.java +++ b/win-system/src/main/java/com/win/system/service/LinuxAccessService.java @@ -59,14 +59,23 @@ public class LinuxAccessService extends ServiceImpl linuxAccessQueryWrapper = new QueryWrapper<>(); linuxAccessQueryWrapper.eq("company_code", companyCode); linuxAccessQueryWrapper.eq("uri", uri); @@ -123,14 +132,23 @@ public class LinuxAccessService extends ServiceImpl linuxAccessQueryWrapper = new QueryWrapper<>(); linuxAccessQueryWrapper.eq("company_code", companyCode); linuxAccessQueryWrapper.eq("uri", uri);