|
@ -1,17 +1,12 @@ |
|
|
package com.win.web.controller.base; |
|
|
package com.win.web.controller.base; |
|
|
|
|
|
|
|
|
import com.alibaba.fastjson2.JSONObject; |
|
|
|
|
|
import com.jcraft.jsch.JSchException; |
|
|
import com.jcraft.jsch.JSchException; |
|
|
import com.jcraft.jsch.Session; |
|
|
|
|
|
import com.win.common.annotation.Log; |
|
|
import com.win.common.annotation.Log; |
|
|
import com.win.common.constant.HttpStatus; |
|
|
import com.win.common.constant.HttpStatus; |
|
|
import com.win.common.core.domain.AjaxResult; |
|
|
import com.win.common.core.domain.AjaxResult; |
|
|
import com.win.common.enums.BusinessType; |
|
|
import com.win.common.enums.BusinessType; |
|
|
import com.win.common.utils.ProfileUtil; |
|
|
import com.win.common.utils.ProfileUtil; |
|
|
import com.win.common.utils.shell.ShellUtil; |
|
|
|
|
|
import com.win.common.utils.shell.ShellVo; |
|
|
|
|
|
import com.win.system.service.LinuxAccessService; |
|
|
import com.win.system.service.LinuxAccessService; |
|
|
import com.win.web.config.ShellConfig; |
|
|
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
import org.slf4j.Logger; |
|
|
import org.slf4j.Logger; |
|
@ -62,7 +57,7 @@ public class ShellController { |
|
|
return AjaxResult.error(HttpStatus.TIMESTAMP_ERROR, "时间戳不正确"); |
|
|
return AjaxResult.error(HttpStatus.TIMESTAMP_ERROR, "时间戳不正确"); |
|
|
} |
|
|
} |
|
|
String tmp = interfaceName + body + "Wenyin@2024" + timestamp; |
|
|
String tmp = interfaceName + body + "Wenyin@2024" + timestamp; |
|
|
String computeSign = DigestUtils.md5DigestAsHex(tmp.getBytes()); |
|
|
String computeSign = DigestUtils.md5DigestAsHex(tmp.getBytes()).toUpperCase(); |
|
|
long tenTimestamp = timestamp + (10 * 60 * 1000); // 计算10分钟后的时间戳
|
|
|
long tenTimestamp = timestamp + (10 * 60 * 1000); // 计算10分钟后的时间戳
|
|
|
long currentTimestamp = System.currentTimeMillis(); // 获取当前时间戳
|
|
|
long currentTimestamp = System.currentTimeMillis(); // 获取当前时间戳
|
|
|
//过期
|
|
|
//过期
|
|
@ -71,7 +66,7 @@ public class ShellController { |
|
|
} |
|
|
} |
|
|
List<String> activeProfile = ProfileUtil.getActiveProfile(); |
|
|
List<String> activeProfile = ProfileUtil.getActiveProfile(); |
|
|
//dev环境不校验签名
|
|
|
//dev环境不校验签名
|
|
|
if(!activeProfile.contains("dev") && !StringUtils.equals(sign, computeSign.toUpperCase())) { |
|
|
if(/*!activeProfile.contains("dev") && */!StringUtils.equals(sign, computeSign)) { |
|
|
return AjaxResult.error(HttpStatus.SIGN_ERROR, "签名不正确"); |
|
|
return AjaxResult.error(HttpStatus.SIGN_ERROR, "签名不正确"); |
|
|
} |
|
|
} |
|
|
Method method = this.getClass().getMethod(interfaceName, String.class); |
|
|
Method method = this.getClass().getMethod(interfaceName, String.class); |
|
@ -79,111 +74,103 @@ public class ShellController { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public AjaxResult poreceipt(String body) throws JSchException, IOException { |
|
|
public AjaxResult poreceipt(String body) throws JSchException, IOException { |
|
|
return linuxAccessService.executeShell(body, "purchaseorder/poreceipt/"); |
|
|
return linuxAccessService.executeShell(body, "purchaseorder/poreceipt/", "dsPoreceiver"); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public AjaxResult projectdetail(String body) throws JSchException, IOException { |
|
|
public AjaxResult projectdetail(String body) throws JSchException, IOException { |
|
|
return linuxAccessService.executeShell(body, "project/projectdetail/"); |
|
|
return linuxAccessService.executeShell(body, "project/projectdetail/", "dsSearchCondition"); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public AjaxResult itemmaster(String body) throws JSchException, IOException { |
|
|
public AjaxResult itemmaster(String body) throws JSchException, IOException { |
|
|
return linuxAccessService.executeShell(body, "items/itemmaster/"); |
|
|
return linuxAccessService.executeShell(body, "items/itemmaster/", "dsItemmaster"); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public AjaxResult inventorydetail(String body) throws JSchException, IOException { |
|
|
public AjaxResult inventorydetail(String body) throws JSchException, IOException { |
|
|
return linuxAccessService.executeShell(body, "inventory/inventorydetail/"); |
|
|
return linuxAccessService.executeShell(body, "inventory/inventorydetail/", "dsSearchCondition"); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public AjaxResult podetexport(String body) throws JSchException, IOException { |
|
|
public AjaxResult podetexport(String body) throws JSchException, IOException { |
|
|
return linuxAccessService.executeShell(body, "puchaseorder/podetexport/"); |
|
|
return linuxAccessService.executeShell(body, "puchaseorder/podetexport/", "dsSearchCondition"); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public AjaxResult exportsupplier(String body) throws JSchException, IOException { |
|
|
public AjaxResult exportsupplier(String body) throws JSchException, IOException { |
|
|
return linuxAccessService.executeShell(body, "supplier/exportsupplier/"); |
|
|
return linuxAccessService.executeShell(body, "supplier/exportsupplier/", "dsSearchCondition"); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public AjaxResult discretepo(String body) throws JSchException, IOException { |
|
|
public AjaxResult discretepo(String body) throws JSchException, IOException { |
|
|
return linuxAccessService.executeShell(body, "purchaseorder/discretepo/"); |
|
|
return linuxAccessService.executeShell(body, "purchaseorder/discretepo/", "dsDescreteOrder"); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public AjaxResult custrequiredschedule(String body) throws JSchException, IOException { |
|
|
public AjaxResult custrequiredschedule(String body) throws JSchException, IOException { |
|
|
return linuxAccessService.executeShell(body, "customer/custrequiredschedule/"); |
|
|
return linuxAccessService.executeShell(body, "customer/custrequiredschedule/", "dsSearchCondition"); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public AjaxResult qadgrirexport(String body) throws JSchException, IOException { |
|
|
public AjaxResult qadgrirexport(String body) throws JSchException, IOException { |
|
|
return linuxAccessService.executeShell(body, "qadgrir/qadgrirexport/"); |
|
|
return linuxAccessService.executeShell(body, "qadgrir/qadgrirexport/", "dsSearchCondition"); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public AjaxResult Unplannedissue(String body) throws JSchException, IOException { |
|
|
public AjaxResult Unplannedissue(String body) throws JSchException, IOException { |
|
|
return linuxAccessService.executeShell(body, "transactions/Unplannedissue/"); |
|
|
return linuxAccessService.executeShell(body, "transactions/Unplannedissue/", "dsUnplanISRC"); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public AjaxResult supplierschedule(String body) throws JSchException, IOException { |
|
|
public AjaxResult supplierschedule(String body) throws JSchException, IOException { |
|
|
return linuxAccessService.executeShell(body, "supplier/supplierschedule/"); |
|
|
return linuxAccessService.executeShell(body, "supplier/supplierschedule/", "dsSearchCondition"); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public AjaxResult bommastr(String body) throws JSchException, IOException { |
|
|
public AjaxResult bommastr(String body) throws JSchException, IOException { |
|
|
return linuxAccessService.executeShell(body, "bom/bommastr/"); |
|
|
return linuxAccessService.executeShell(body, "bom/bommastr/", "dsBommaster"); |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public AjaxResult itemsiteLocdetail(String body) throws JSchException, IOException { |
|
|
|
|
|
return linuxAccessService.executeShell(body, "items/itemsiteLocdetail/"); |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public AjaxResult backflush(String body) throws JSchException, IOException { |
|
|
public AjaxResult backflush(String body) throws JSchException, IOException { |
|
|
return linuxAccessService.executeShell(body, "workorder/backflush/"); |
|
|
return linuxAccessService.executeShell(body, "workorder/backflush/", "dsBackflushMaster"); |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public AjaxResult itemsiteplandetail(String body) throws JSchException, IOException { |
|
|
|
|
|
return linuxAccessService.executeShell(body, "items/itemsiteplandetail/"); |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public AjaxResult supplierasn(String body) throws JSchException, IOException { |
|
|
public AjaxResult supplierasn(String body) throws JSchException, IOException { |
|
|
return linuxAccessService.executeShell(body, "supplier/supplierasn/"); |
|
|
return linuxAccessService.executeShell(body, "supplier/supplierasn/", "dsttsupplierasn"); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public AjaxResult supplierinvoicebalance(String body) throws JSchException, IOException { |
|
|
public AjaxResult supplierinvoicebalance(String body) throws JSchException, IOException { |
|
|
return linuxAccessService.executeShell(body, "supplier/supplierinvoicebalance/"); |
|
|
return linuxAccessService.executeShell(body, "supplier/supplierinvoicebalance/", "dsSearchCondition"); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public AjaxResult createsupplierinvoice(String body) throws JSchException, IOException { |
|
|
public AjaxResult createsupplierinvoice(String body) throws JSchException, IOException { |
|
|
return linuxAccessService.executeShell(body, "supplierinvoice/createsupplierinvoice/"); |
|
|
return linuxAccessService.executeShell(body, "supplierinvoice/createsupplierinvoice/", "dsSupplierInvoice"); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public AjaxResult loadbommstr(String body) throws JSchException, IOException { |
|
|
public AjaxResult loadbommstr(String body) throws JSchException, IOException { |
|
|
return linuxAccessService.executeShell(body, "bommstr/loadbommstr/"); |
|
|
return linuxAccessService.executeShell(body, "bommstr/loadbommstr/", "dsBommaster"); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public AjaxResult costcenterdetail(String body) throws JSchException, IOException { |
|
|
public AjaxResult costcenterdetail(String body) throws JSchException, IOException { |
|
|
return linuxAccessService.executeShell(body, "costcenter/costcenterdetail/"); |
|
|
return linuxAccessService.executeShell(body, "costcenter/costcenterdetail/", "dsSearchCondition"); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public AjaxResult salesorderexport(String body) throws JSchException, IOException { |
|
|
public AjaxResult salesorderexport(String body) throws JSchException, IOException { |
|
|
return linuxAccessService.executeShell(body, "salesorder/salesorderexport/"); |
|
|
return linuxAccessService.executeShell(body, "salesorder/salesorderexport/", "dsSearchCondition"); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public AjaxResult costdetail(String body) throws JSchException, IOException { |
|
|
public AjaxResult costdetail(String body) throws JSchException, IOException { |
|
|
return linuxAccessService.executeShell(body, "cost/costdetail/"); |
|
|
return linuxAccessService.executeShell(body, "cost/costdetail/", "dsSearchCondition"); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public AjaxResult exportcustomer(String body) throws JSchException, IOException { |
|
|
public AjaxResult exportcustomer(String body) throws JSchException, IOException { |
|
|
return linuxAccessService.executeShell(body, "customer/exportcustomer/"); |
|
|
return linuxAccessService.executeShell(body, "customer/exportcustomer/", "dsSearchCondition"); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public AjaxResult routingdetail(String body) throws JSchException, IOException { |
|
|
public AjaxResult routingdetail(String body) throws JSchException, IOException { |
|
|
return linuxAccessService.executeShell(body, "routing/routingdetail/"); |
|
|
return linuxAccessService.executeShell(body, "routing/routingdetail/", "dsRouting"); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public AjaxResult productionschedule(String body) throws JSchException, IOException { |
|
|
public AjaxResult productionschedule(String body) throws JSchException, IOException { |
|
|
return linuxAccessService.executeShell(body, "production/productionschedule/"); |
|
|
return linuxAccessService.executeShell(body, "production/productionschedule/", "dsSearchCondition"); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public AjaxResult intransfer(String body) throws JSchException, IOException { |
|
|
public AjaxResult intransfer(String body) throws JSchException, IOException { |
|
|
return linuxAccessService.executeShell(body, "transactions/intransfer/"); |
|
|
return linuxAccessService.executeShell(body, "transactions/intransfer/", "dsinvtransfer"); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public AjaxResult loadbommastr(String body) throws JSchException, IOException { |
|
|
public AjaxResult loadbommastr(String body) throws JSchException, IOException { |
|
|
return linuxAccessService.executeShell(body, "bom/loadbommastr/"); |
|
|
return linuxAccessService.executeShell(body, "bom/loadbommastr/", "dsBommaster"); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|