From c1c38d89b4d1b6576b7be0115a73a35b695ad375 Mon Sep 17 00:00:00 2001
From: dubin <bindu_bean@163.com>
Date: 星期三, 10 十二月 2025 16:20:22 +0800
Subject: [PATCH] 初始化
---
src/main/java/com/zy/system/controller/LicenseCreatorController.java | 29 -
src/main/webapp/static/wcs/js/console3.map.js | 2
src/main/java/com/zy/system/entity/license/LicenseCheckListener.java | 47 ++
src/main/java/com/zy/system/entity/LicenseInfos.java | 56 +++
src/main/webapp/static/wcs/js/console2.map.js | 2
src/main/webapp/static/wcs/js/common.js | 2
src/main/java/com/zy/system/entity/license/CustomLicenseManager.java | 6
src/main/java/com/zy/system/entity/license/LicenseVerify.java | 75 ++--
src/main/resources/mapper/LicenseInfosMapper.xml | 18 +
src/main/java/com/zy/system/mapper/LicenseInfosMapper.java | 14
src/main/resources/application-prod.yml | 309 +----------------
src/main/java/com/zy/system/entity/license/LinuxServerInfos.java | 91 +++++
pom.xml | 2
src/main/webapp/static/wcs/js/console1.map.js | 2
src/main/java/com/zy/system/entity/license/CustomKeyStoreParam.java | 6
src/main/webapp/static/wcs/js/console.map.js | 2
src/main/webapp/views/index.html | 148 +-------
src/main/java/com/zy/system/service/LicenseInfosService.java | 10
src/main/java/com/zy/system/entity/license/AbstractServerInfos.java | 2
src/main/java/com/zy/system/timer/LicenseTimer.java | 163 +++++++++
src/main/resources/application.yml | 4
src/main/java/com/zy/system/service/impl/LicenseInfosServiceImpl.java | 16
22 files changed, 511 insertions(+), 495 deletions(-)
diff --git a/pom.xml b/pom.xml
index f8501f5..efdfe37 100644
--- a/pom.xml
+++ b/pom.xml
@@ -200,7 +200,7 @@
</dependencies>
<build>
- <finalName>scwcs</finalName>
+ <finalName>wcs</finalName>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
diff --git a/src/main/java/com/zy/system/controller/LicenseCreatorController.java b/src/main/java/com/zy/system/controller/LicenseCreatorController.java
index 0aafb3b..13e2b1c 100644
--- a/src/main/java/com/zy/system/controller/LicenseCreatorController.java
+++ b/src/main/java/com/zy/system/controller/LicenseCreatorController.java
@@ -3,7 +3,7 @@
import com.core.common.Cools;
import com.core.common.R;
import com.zy.system.entity.license.*;
-import de.schlichtherle.license.LicenseContent;
+import com.zy.system.timer.LicenseTimer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.MediaType;
@@ -14,7 +14,6 @@
import java.io.File;
import java.io.IOException;
-import java.util.Date;
/**
*
@@ -26,10 +25,10 @@
@Value("${license.licensePath}")
private String licensePath;
-
@Autowired
private LicenseCheckListener licenseCheckListener;
-
+ @Autowired
+ private LicenseTimer licenseTimer;
/**
* 鑾峰彇鏈嶅姟鍣ㄧ‖浠朵俊鎭�
* @param osName 鎿嶄綔绯荤粺绫诲瀷锛屽鏋滀负绌哄垯鑷姩鍒ゆ柇
@@ -48,7 +47,7 @@
if (osName.startsWith("windows")) {
abstractServerInfos = new WindowsServerInfos();
} else if (osName.startsWith("linux")) {
-// abstractServerInfos = new LinuxServerInfos();
+ abstractServerInfos = new LinuxServerInfos();
}else{//鍏朵粬鏈嶅姟鍣ㄧ被鍨�
abstractServerInfos = new WindowsServerInfos();
}
@@ -61,19 +60,7 @@
*/
@RequestMapping(value = "/getLicenseDays")
public R getLicenseDays() {
- LicenseVerify licenseVerify = new LicenseVerify();
- LicenseContent verifyInfo = licenseVerify.getVerifyInfo();
- if (verifyInfo == null) {
- return R.error();
- }
-
- Date start = new Date();
- Date end = verifyInfo.getNotAfter();
- Long starTime = start.getTime();
- Long endTime = end.getTime();
- Long num = endTime - starTime;//鏃堕棿鎴崇浉宸殑姣鏁�
- int day = (int) (num / 24 / 60 / 60 / 1000);
- return R.ok().add(day);
+ return R.ok(licenseTimer.getLicenseDays());
}
@RequestMapping(value = "/updateLicense")
@@ -109,4 +96,10 @@
return R.error("璁稿彲璇佹洿鏂板け璐�");
}
+ @RequestMapping(value = "/activate")
+ public R activate() {
+ licenseTimer.timer();
+ return R.ok();
+ }
+
}
\ No newline at end of file
diff --git a/src/main/java/com/zy/system/entity/LicenseInfos.java b/src/main/java/com/zy/system/entity/LicenseInfos.java
new file mode 100644
index 0000000..dafec6d
--- /dev/null
+++ b/src/main/java/com/zy/system/entity/LicenseInfos.java
@@ -0,0 +1,56 @@
+package com.zy.system.entity;
+
+import com.core.common.Cools;import com.baomidou.mybatisplus.annotations.TableId;
+import com.baomidou.mybatisplus.enums.IdType;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import com.baomidou.mybatisplus.annotations.TableField;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import com.baomidou.mybatisplus.annotations.TableName;
+import java.io.Serializable;
+
+@Data
+@TableName("sys_license_infos")
+public class LicenseInfos implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ @ApiModelProperty(value= "")
+ @TableId(value = "id", type = IdType.AUTO)
+ private Integer id;
+
+ @ApiModelProperty(value= "")
+ private String license;
+
+ @ApiModelProperty(value= "")
+ private String licenseTime;
+
+ @ApiModelProperty(value= "")
+ @TableField("create_time")
+ @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+ private Date createTime;
+
+ public LicenseInfos() {}
+
+ public LicenseInfos(String license,Date createTime) {
+ this.license = license;
+ this.createTime = createTime;
+ }
+
+// LicenseInfos licenseInfos = new LicenseInfos(
+// null, //
+// null //
+// );
+
+ public String getCreateTime$(){
+ if (Cools.isEmpty(this.createTime)){
+ return "";
+ }
+ return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.createTime);
+ }
+
+
+}
diff --git a/src/main/java/com/zy/system/entity/license/AbstractServerInfos.java b/src/main/java/com/zy/system/entity/license/AbstractServerInfos.java
index f771d16..cb413ae 100644
--- a/src/main/java/com/zy/system/entity/license/AbstractServerInfos.java
+++ b/src/main/java/com/zy/system/entity/license/AbstractServerInfos.java
@@ -23,7 +23,7 @@
LicenseCheck result = new LicenseCheck();
try {
- result.setIpAddress(this.getIpAddress());
+// result.setIpAddress(this.getIpAddress());
result.setMacAddress(this.getMacAddress());
result.setCpuSerial(this.getCPUSerial());
result.setMainBoardSerial(this.getMainBoardSerial());
diff --git a/src/main/java/com/zy/system/entity/license/CustomKeyStoreParam.java b/src/main/java/com/zy/system/entity/license/CustomKeyStoreParam.java
index 3d4e4b9..f1cab8b 100644
--- a/src/main/java/com/zy/system/entity/license/CustomKeyStoreParam.java
+++ b/src/main/java/com/zy/system/entity/license/CustomKeyStoreParam.java
@@ -2,7 +2,9 @@
import de.schlichtherle.license.AbstractKeyStoreParam;
-import java.io.*;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.io.InputStream;
/**
* 鑷畾涔塊eyStoreParam锛岀敤浜庡皢鍏閽ュ瓨鍌ㄦ枃浠跺瓨鏀惧埌鍏朵粬纾佺洏浣嶇疆鑰屼笉鏄」鐩腑
@@ -47,7 +49,7 @@
*/
@Override
public InputStream getStream() throws IOException {
- final InputStream in = new FileInputStream(new File(storePath));
+ final InputStream in = this.getClass().getClassLoader().getResourceAsStream(storePath);
if (null == in) {
throw new FileNotFoundException(storePath);
}
diff --git a/src/main/java/com/zy/system/entity/license/CustomLicenseManager.java b/src/main/java/com/zy/system/entity/license/CustomLicenseManager.java
index a0cd9e8..9a7fc6d 100644
--- a/src/main/java/com/zy/system/entity/license/CustomLicenseManager.java
+++ b/src/main/java/com/zy/system/entity/license/CustomLicenseManager.java
@@ -129,12 +129,12 @@
if(expectedCheckModel != null && serverCheckModel != null){
//鏍¢獙IP鍦板潃
if(!checkIpAddress(expectedCheckModel.getIpAddress(),serverCheckModel.getIpAddress())){
- //throw new LicenseContentException("褰撳墠鏈嶅姟鍣ㄧ殑IP娌″湪鎺堟潈鑼冨洿鍐�");
+ throw new LicenseContentException("褰撳墠鏈嶅姟鍣ㄧ殑IP娌″湪鎺堟潈鑼冨洿鍐�");
}
//鏍¢獙Mac鍦板潃
if(!checkIpAddress(expectedCheckModel.getMacAddress(),serverCheckModel.getMacAddress())){
- //throw new LicenseContentException("褰撳墠鏈嶅姟鍣ㄧ殑Mac鍦板潃娌″湪鎺堟潈鑼冨洿鍐�");
+ throw new LicenseContentException("褰撳墠鏈嶅姟鍣ㄧ殑Mac鍦板潃娌″湪鎺堟潈鑼冨洿鍐�");
}
//鏍¢獙涓绘澘搴忓垪鍙�
@@ -194,7 +194,7 @@
if (osName.startsWith("windows")) {
abstractServerInfos = new WindowsServerInfos();
} else if (osName.startsWith("linux")) {
-// abstractServerInfos = new LinuxServerInfos();
+ abstractServerInfos = new LinuxServerInfos();
}else{//鍏朵粬鏈嶅姟鍣ㄧ被鍨�
abstractServerInfos = new WindowsServerInfos();
}
diff --git a/src/main/java/com/zy/system/entity/license/LicenseCheckListener.java b/src/main/java/com/zy/system/entity/license/LicenseCheckListener.java
index 1659df2..643ce23 100644
--- a/src/main/java/com/zy/system/entity/license/LicenseCheckListener.java
+++ b/src/main/java/com/zy/system/entity/license/LicenseCheckListener.java
@@ -1,9 +1,13 @@
package com.zy.system.entity.license;
import com.core.common.Cools;
+import com.zy.system.entity.LicenseInfos;
+import com.zy.system.service.LicenseInfosService;
+import com.zy.system.timer.LicenseTimer;
import de.schlichtherle.license.LicenseContent;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
+import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationListener;
@@ -11,6 +15,7 @@
import org.springframework.stereotype.Component;
import java.io.File;
+import java.util.Date;
/**
* 鍦ㄩ」鐩惎鍔ㄦ椂瀹夎璇佷功
@@ -48,6 +53,10 @@
*/
@Value("${license.publicKeysStorePath}")
private String publicKeysStorePath;
+ @Autowired
+ private LicenseTimer licenseTimer;
+ @Autowired
+ private LicenseInfosService licenseInfosService;
@Override
public void onApplicationEvent(ContextRefreshedEvent event) {
@@ -64,31 +73,51 @@
logger.info("++++++++ 寮�濮嬪姞杞借鍙瘉 ++++++++");
try {
- String publicKeysStoreFileName = this.getClass().getClassLoader().getResource(publicKeysStorePath).getPath();
- File publicKeysStoreFile = new File(publicKeysStoreFileName);
+ licenseTimer.getRemoteLicense();
+ } catch (Exception e) {
+ }
- String licensePathFileName = this.getClass().getClassLoader().getResource(licensePath).getPath();
- File licensePathFile = new File(licensePathFileName);
-
+ try {
LicenseVerifyParam param = new LicenseVerifyParam();
param.setSubject(subject);
param.setPublicAlias(publicAlias);
param.setStorePass(storePass);
- param.setLicensePath(licensePathFile.getPath());
- param.setPublicKeysStorePath(publicKeysStoreFile.getPath());
+ param.setLicensePath(licensePath);
+ param.setPublicKeysStorePath(publicKeysStorePath);
LicenseVerify licenseVerify = new LicenseVerify();
+
+ LicenseInfos latestLicense = licenseInfosService.getLatestLicense();
+ if (latestLicense == null) {
+ logger.info("璁稿彲璇佷笉瀛樺湪");
+ return false;
+ }
+
//瀹夎璇佷功
- LicenseContent install = licenseVerify.install(param);
+ LicenseContent install = licenseVerify.install(param, latestLicense.getLicense());
logger.info("++++++++ 璁稿彲璇佸姞杞界粨鏉� ++++++++");
+ licenseTimer.setSystemSupport(install!=null);
+
+ if (install != null) {
+ Date start = new Date();
+ Date end = install.getNotAfter();
+ Long starTime = start.getTime();
+ Long endTime = end.getTime();
+ Long num = endTime - starTime;//鏃堕棿鎴崇浉宸殑姣鏁�
+ int day = (int) (num / 24 / 60 / 60 / 1000);
+ licenseTimer.setLicenseDays(day);
+ }
+
+
return install != null;
} catch (Exception e) {
+ e.printStackTrace();
return false;
}
}
-
+ licenseTimer.setSystemSupport(false);
return false;
}
}
\ No newline at end of file
diff --git a/src/main/java/com/zy/system/entity/license/LicenseVerify.java b/src/main/java/com/zy/system/entity/license/LicenseVerify.java
index 2175930..da239c0 100644
--- a/src/main/java/com/zy/system/entity/license/LicenseVerify.java
+++ b/src/main/java/com/zy/system/entity/license/LicenseVerify.java
@@ -5,9 +5,13 @@
import org.apache.logging.log4j.Logger;
import java.io.File;
+import java.io.IOException;
+import java.nio.file.Files;
+import java.nio.file.Path;
import java.text.DateFormat;
import java.text.MessageFormat;
import java.text.SimpleDateFormat;
+import java.util.Base64;
import java.util.prefs.Preferences;
/**
@@ -19,19 +23,21 @@
/**
* 瀹夎License璇佷功
*/
- public synchronized LicenseContent install(LicenseVerifyParam param){
+ public synchronized LicenseContent install(LicenseVerifyParam param, String license) {
LicenseContent result = null;
DateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
//1. 瀹夎璇佷功
- try{
- LicenseManager licenseManager = LicenseManagerHolder.getInstance(initLicenseParam(param));
+ try {
+ LicenseParam licenseParam = initLicenseParam(param);
+ LicenseManager licenseManager = LicenseManagerHolder.getInstance(licenseParam);
licenseManager.uninstall();
- result = licenseManager.install(new File(param.getLicensePath()));
- logger.info(MessageFormat.format("璁稿彲璇佸姞杞芥垚鍔燂紝璁稿彲璇佹湁鏁堟湡锛歿0} - {1}",format.format(result.getNotBefore()),format.format(result.getNotAfter())));
- }catch (Exception e){
- logger.error("璁稿彲璇佸姞杞藉け璐ワ紒",e);
+ File tempFileFromBase64 = createTempFileFromBase64(license);
+ result = licenseManager.install(tempFileFromBase64);
+ logger.info(MessageFormat.format("璁稿彲璇佸姞杞芥垚鍔燂紝璁稿彲璇佹湁鏁堟湡锛歿0} - {1}", format.format(result.getNotBefore()), format.format(result.getNotAfter())));
+ } catch (Exception e) {
+ logger.error("璁稿彲璇佸姞杞藉け璐ワ紒", e);
}
return result;
@@ -44,11 +50,6 @@
try {
LicenseManager licenseManager = LicenseManagerHolder.getInstance(null);
DateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
-
- if (!updateSystemTime()) {
- //鏃堕棿鏇存柊澶辫触锛岀郴缁熸椂闂磋鏇存敼
- return false;
- }
LicenseContent licenseContent = licenseManager.verify();
logger.info(MessageFormat.format("璁稿彲璇佹牎楠岄�氳繃锛岃鍙瘉鏈夋晥鏈燂細{0} - {1}",format.format(licenseContent.getNotBefore()),format.format(licenseContent.getNotAfter())));
@@ -64,11 +65,6 @@
*/
public LicenseContent getVerifyInfo(){
LicenseManager licenseManager = LicenseManagerHolder.getInstance(null);
-
- if (!updateSystemTime()) {
- //鏃堕棿鏇存柊澶辫触锛岀郴缁熸椂闂磋鏇存敼
- return null;
- }
//鏍¢獙璇佷功
try {
@@ -103,31 +99,28 @@
}
/**
- * 鏇存柊鏃堕棿鍒版敞鍐岃〃涓�
+ * 灏咮ase64瀛楃涓茶浆鎹负涓存椂鏂囦欢
+ * @param base64String Base64缂栫爜鐨勫瓧绗︿覆
+ * @param filePrefix 鏂囦欢鍚嶅墠缂�锛堜緥濡� "license_"锛�
+ * @param fileSuffix 鏂囦欢鍚庣紑锛堜緥濡� ".lic"锛�
+ * @return 鐢熸垚鐨勪复鏃禙ile瀵硅薄锛堣嚜鍔ㄥ湪JVM閫�鍑烘椂鍒犻櫎锛�
+ * @throws IOException
*/
- private boolean updateSystemTime() {
- // 鑾峰彇鐢ㄦ埛鏍硅妭鐐�
- Preferences userRoot = Preferences.userRoot();
- // 鑾峰彇鎸囧畾璺緞涓嬬殑鑺傜偣
- Preferences node = userRoot.node("/zhongyang");
- String key = "time";
- // 璇诲彇娉ㄥ唽琛�
- String value = node.get(key, null);
- if (value != null) {
- long originTime = Long.parseLong(value);
- long now = System.currentTimeMillis();
- long diff = now - originTime;//鐜板湪鏃堕棿 - 婧愭椂闂� = 鏃堕棿宸�
- if (diff > 0) {
- //鏃堕棿宸ぇ浜�0鎵嶅厑璁告洿鏂版敞鍐岃〃鏃堕棿
- node.put(key, String.valueOf(System.currentTimeMillis()));
- return true;
- }
- }else {
- // 鍐欏叆娉ㄥ唽琛�
- node.put(key, String.valueOf(System.currentTimeMillis()));
- return true;
- }
- return false;
+ public File base64ToTempFile(String base64String, String filePrefix, String fileSuffix)
+ throws IOException {
+ // 瑙g爜Base64
+ byte[] decodedBytes = Base64.getDecoder().decode(base64String);
+ // 鍒涘缓涓存椂鏂囦欢
+ Path tempPath = Files.createTempFile(filePrefix, fileSuffix);
+ // 鍐欏叆鍐呭
+ Files.write(tempPath, decodedBytes);
+ // 璁剧疆JVM閫�鍑烘椂鑷姩鍒犻櫎
+ tempPath.toFile().deleteOnExit();
+ return tempPath.toFile();
+ }
+
+ public File createTempFileFromBase64(String base64Data) throws IOException {
+ return base64ToTempFile(base64Data, "temp_license_", ".bin");
}
}
\ No newline at end of file
diff --git a/src/main/java/com/zy/system/entity/license/LinuxServerInfos.java b/src/main/java/com/zy/system/entity/license/LinuxServerInfos.java
new file mode 100644
index 0000000..0f40daf
--- /dev/null
+++ b/src/main/java/com/zy/system/entity/license/LinuxServerInfos.java
@@ -0,0 +1,91 @@
+package com.zy.system.entity.license;
+
+import com.core.common.Cools;
+
+import java.io.BufferedReader;
+import java.io.InputStreamReader;
+import java.net.InetAddress;
+import java.util.List;
+import java.util.stream.Collectors;
+
+/**
+ * 鐢ㄤ簬鑾峰彇瀹㈡埛Linux鏈嶅姟鍣ㄧ殑鍩烘湰淇℃伅
+ */
+public class LinuxServerInfos extends AbstractServerInfos {
+
+ @Override
+ protected List<String> getIpAddress() throws Exception {
+ List<String> result = null;
+
+ //鑾峰彇鎵�鏈夌綉缁滄帴鍙�
+ List<InetAddress> inetAddresses = getLocalAllInetAddress();
+
+ if (inetAddresses != null && inetAddresses.size() > 0) {
+ result = inetAddresses.stream().map(InetAddress::getHostAddress).distinct().map(String::toLowerCase).collect(Collectors.toList());
+ }
+
+ return result;
+ }
+
+ @Override
+ protected List<String> getMacAddress() throws Exception {
+ List<String> result = null;
+
+ //1. 鑾峰彇鎵�鏈夌綉缁滄帴鍙�
+ List<InetAddress> inetAddresses = getLocalAllInetAddress();
+
+ if (inetAddresses != null && inetAddresses.size() > 0) {
+ //2. 鑾峰彇鎵�鏈夌綉缁滄帴鍙g殑Mac鍦板潃
+ result = inetAddresses.stream().map(this::getMacByInetAddress).distinct().collect(Collectors.toList());
+ }
+
+ return result;
+ }
+
+ @Override
+ protected String getCPUSerial() throws Exception {
+ //搴忓垪鍙�
+ String serialNumber = "";
+
+ //浣跨敤dmidecode鍛戒护鑾峰彇CPU搴忓垪鍙�
+ String[] shell = {"/bin/bash", "-c", "dmidecode -t processor | grep 'ID' | awk -F ':' '{print $2}' | head -n 1"};
+ Process process = Runtime.getRuntime().exec(shell);
+ process.getOutputStream().close();
+
+ BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream()));
+
+ if (null == reader.readLine()) {
+ return serialNumber;
+ }
+ String line = reader.readLine().trim();
+ if (!Cools.isEmpty(line)) {
+ serialNumber = line;
+ }
+
+ reader.close();
+ return serialNumber;
+ }
+
+ @Override
+ protected String getMainBoardSerial() throws Exception {
+ //搴忓垪鍙�
+ String serialNumber = "";
+
+ //浣跨敤dmidecode鍛戒护鑾峰彇涓绘澘搴忓垪鍙�
+ String[] shell = {"/bin/bash", "-c", "dmidecode | grep 'Serial Number' | awk -F ':' '{print $2}' | head -n 1"};
+ Process process = Runtime.getRuntime().exec(shell);
+ process.getOutputStream().close();
+
+ BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream()));
+ if (null == reader.readLine()) {
+ return serialNumber;
+ }
+ String line = reader.readLine().trim();
+ if (!Cools.isEmpty(line)) {
+ serialNumber = line;
+ }
+
+ reader.close();
+ return serialNumber;
+ }
+}
\ No newline at end of file
diff --git a/src/main/java/com/zy/system/mapper/LicenseInfosMapper.java b/src/main/java/com/zy/system/mapper/LicenseInfosMapper.java
new file mode 100644
index 0000000..2e51ff1
--- /dev/null
+++ b/src/main/java/com/zy/system/mapper/LicenseInfosMapper.java
@@ -0,0 +1,14 @@
+package com.zy.system.mapper;
+
+import com.zy.system.entity.LicenseInfos;
+import com.baomidou.mybatisplus.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Mapper;
+import org.springframework.stereotype.Repository;
+
+@Mapper
+@Repository
+public interface LicenseInfosMapper extends BaseMapper<LicenseInfos> {
+
+ LicenseInfos getLatestLicense();
+
+}
diff --git a/src/main/java/com/zy/system/service/LicenseInfosService.java b/src/main/java/com/zy/system/service/LicenseInfosService.java
new file mode 100644
index 0000000..dc3dc04
--- /dev/null
+++ b/src/main/java/com/zy/system/service/LicenseInfosService.java
@@ -0,0 +1,10 @@
+package com.zy.system.service;
+
+import com.zy.system.entity.LicenseInfos;
+import com.baomidou.mybatisplus.service.IService;
+
+public interface LicenseInfosService extends IService<LicenseInfos> {
+
+ LicenseInfos getLatestLicense();
+
+}
diff --git a/src/main/java/com/zy/system/service/impl/LicenseInfosServiceImpl.java b/src/main/java/com/zy/system/service/impl/LicenseInfosServiceImpl.java
new file mode 100644
index 0000000..2a6b9b3
--- /dev/null
+++ b/src/main/java/com/zy/system/service/impl/LicenseInfosServiceImpl.java
@@ -0,0 +1,16 @@
+package com.zy.system.service.impl;
+
+import com.zy.system.mapper.LicenseInfosMapper;
+import com.zy.system.entity.LicenseInfos;
+import com.zy.system.service.LicenseInfosService;
+import com.baomidou.mybatisplus.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+@Service("licenseInfosService")
+public class LicenseInfosServiceImpl extends ServiceImpl<LicenseInfosMapper, LicenseInfos> implements LicenseInfosService {
+
+ @Override
+ public LicenseInfos getLatestLicense() {
+ return this.baseMapper.getLatestLicense();
+ }
+}
diff --git a/src/main/java/com/zy/system/timer/LicenseTimer.java b/src/main/java/com/zy/system/timer/LicenseTimer.java
new file mode 100644
index 0000000..985ace4
--- /dev/null
+++ b/src/main/java/com/zy/system/timer/LicenseTimer.java
@@ -0,0 +1,163 @@
+package com.zy.system.timer;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
+import com.core.common.Cools;
+import com.zy.common.utils.HttpHandler;
+import com.zy.system.entity.LicenseInfos;
+import com.zy.system.entity.license.*;
+import com.zy.system.service.LicenseInfosService;
+import de.schlichtherle.license.LicenseContent;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.scheduling.annotation.Scheduled;
+import org.springframework.stereotype.Component;
+
+import java.util.Date;
+import java.util.HashMap;
+
+@Component
+public class LicenseTimer {
+
+ private static boolean SYSTEM_SUPPORT = false;//绯荤粺婵�娲荤姸鎬侊紝榛樿鍏抽棴
+
+ private static int LICENSE_DAYS = 0;//璁稿彲璇佸ぉ鏁�
+
+ /**
+ * 璇佷功subject
+ */
+ @Value("${license.subject}")
+ private String subject;
+
+ /**
+ * 鍏挜鍒О
+ */
+ @Value("${license.publicAlias}")
+ private String publicAlias;
+
+ /**
+ * 璁块棶鍏挜搴撶殑瀵嗙爜
+ */
+ @Value("${license.storePass}")
+ private String storePass;
+
+ /**
+ * 璇佷功鐢熸垚璺緞
+ */
+ @Value("${license.licensePath}")
+ private String licensePath;
+
+ /**
+ * 瀵嗛挜搴撳瓨鍌ㄨ矾寰�
+ */
+ @Value("${license.publicKeysStorePath}")
+ private String publicKeysStorePath;
+
+ @Autowired
+ private LicenseInfosService licenseInfosService;
+
+ //姣忓ぉ鏅氫笂11鐐规洿鏂扮郴缁熸縺娲荤姸鎬�
+ @Scheduled(cron = "0 0 23 * * ? ")
+ public void timer() {
+ try {
+ getRemoteLicense();
+ } catch (Exception e) {
+
+ }
+
+ try {
+ verify();
+ } catch (Exception e) {
+
+ }
+ }
+
+ public void getRemoteLicense() {
+ try {
+ AbstractServerInfos abstractServerInfos = null;
+ String osName = System.getProperty("os.name");
+ //鏍规嵁涓嶅悓鎿嶄綔绯荤粺绫诲瀷閫夋嫨涓嶅悓鐨勬暟鎹幏鍙栨柟娉�
+ if (osName.startsWith("windows")) {
+ abstractServerInfos = new WindowsServerInfos();
+ } else if (osName.startsWith("linux")) {
+ abstractServerInfos = new LinuxServerInfos();
+ }else{//鍏朵粬鏈嶅姟鍣ㄧ被鍨�
+ abstractServerInfos = new WindowsServerInfos();
+ }
+ LicenseCheck serverInfos = abstractServerInfos.getServerInfos();
+
+ HashMap<String, Object> map = new HashMap<>();
+ map.put("subject", subject);
+ map.put("licenseCheck", serverInfos);
+
+ String response = new HttpHandler.Builder()
+ .setUri("http://net.zoneyung.net:9999/license")
+ .setPath("/remoteQueryLicense")
+ .setJson(JSON.toJSONString(map))
+ .build()
+ .doPost();
+ JSONObject jsonObject = JSON.parseObject(response);
+ if (jsonObject.getString("result").equals("ok")) {
+ LicenseInfos licenseInfos = new LicenseInfos();
+ licenseInfos.setLicense(jsonObject.getString("data"));
+ licenseInfos.setCreateTime(new Date());
+ licenseInfos.setLicenseTime(jsonObject.getString("licenseTime"));
+ licenseInfosService.insert(licenseInfos);
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ public void verify() {
+ LicenseInfos latestLicense = licenseInfosService.getLatestLicense();
+ if (latestLicense == null) {
+ setLicenseDays(0);
+ setSystemSupport(false);
+ return;
+ }
+
+ LicenseVerifyParam param = new LicenseVerifyParam();
+ param.setSubject(subject);
+ param.setPublicAlias(publicAlias);
+ param.setStorePass(storePass);
+ param.setLicensePath(licensePath);
+ param.setPublicKeysStorePath(publicKeysStorePath);
+
+ //楠岃瘉璁稿彲璇佹槸鍚︽湁鏁�
+ LicenseVerify licenseVerify = new LicenseVerify();
+ //瀹夎璇佷功
+ LicenseContent install = licenseVerify.install(param, latestLicense.getLicense());
+
+ if (install != null) {
+ Date start = new Date();
+ Date end = install.getNotAfter();
+ Long starTime = start.getTime();
+ Long endTime = end.getTime();
+ long num = endTime - starTime;//鏃堕棿鎴崇浉宸殑姣鏁�
+ int day = (int) (num / 24 / 60 / 60 / 1000);
+ setLicenseDays(day);
+ setSystemSupport(true);
+ }else {
+ setLicenseDays(0);
+ setSystemSupport(false);
+ }
+ }
+
+ public boolean getSystemSupport() {
+ return SYSTEM_SUPPORT;
+ }
+
+ public void setSystemSupport(boolean systemSupport) {
+ SYSTEM_SUPPORT = systemSupport;
+ }
+
+ public int getLicenseDays() {
+ return LICENSE_DAYS;
+ }
+
+ public void setLicenseDays(int licenseDays) {
+ LICENSE_DAYS = licenseDays;
+ }
+
+}
diff --git a/src/main/resources/application-prod.yml b/src/main/resources/application-prod.yml
index 393a917..f4c584e 100644
--- a/src/main/resources/application-prod.yml
+++ b/src/main/resources/application-prod.yml
@@ -1,6 +1,6 @@
wcs-slave:
doubleDeep: true #鍙屾繁
- doubleLocs: 5,8 #鍙屾繁搴撲綅鎺掑彿 1,4
+ doubleLocs: 1,4 #鍙屾繁搴撲綅鎺掑彿 1,4
groupCount: 4 #涓�涓爢鍨涙満璐熻矗鐨勮揣鏋舵帓鏁�
crn[0]: #鍫嗗灈鏈�1
id: 1
@@ -28,134 +28,14 @@
row: 1
bay: 59
lev: 11
- devpPlcId: ${wcs-slave.devp[1].id}
+ devpPlcId: ${wcs-slave.devp[0].id}
crnInStn[1]: #鍫嗗灈鏈哄叆搴撶珯鐐�--2F杈撻�佺嚎 鍙栬揣鍙�
staNo: 2003
row: 2
bay: 59
lev: 11
backSta: 102
- devpPlcId: ${wcs-slave.devp[1].id}
- crn[1]: #鍫嗗灈鏈�2
- id: 2
- ip: 192.168.110.90
- slot: 0
- demo: false
- rack: 0
- offset: 2 #鍋忕Щ閲忥紝褰撳爢鍨涙満绔欑偣鍒楀彿=1鏃讹紝鍋忕Щ閲�=2
- port: 102
- crnOutStn[0]: #鍫嗗灈鏈哄嚭搴撶珯鐐�--1F杈撻�佺嚎 鏀捐揣鍙�
- staNo: 1006
- row: 3
- bay: 1
- lev: 1
devpPlcId: ${wcs-slave.devp[0].id}
- crnInStn[0]: #鍫嗗灈鏈哄叆搴撶珯鐐�1--1F杈撻�佺嚎 鍙栬揣鍙�
- staNo: 1008
- row: 4
- bay: 1
- lev: 1
- backSta: 106
- devpPlcId: ${wcs-slave.devp[0].id}
- crnOutStn[1]: #鍫嗗灈鏈哄嚭搴撶珯鐐�--2F杈撻�佺嚎 鏀捐揣鍙�
- staNo: 2013
- row: 4
- bay: 59
- lev: 11
- devpPlcId: ${wcs-slave.devp[1].id}
- crnInStn[1]: #鍫嗗灈鏈哄叆搴撶珯鐐�1--2F杈撻�佺嚎 鍙栬揣鍙�
- staNo: 2012
- row: 3
- bay: 59
- lev: 11
- backSta: 106
- devpPlcId: ${wcs-slave.devp[1].id}
- crn[2]: #鍫嗗灈鏈�3
- id: 3
- ip: 192.168.110.10
- slot: 0
- demo: false
- rack: 0
- offset: 2 #鍋忕Щ閲忥紝褰撳爢鍨涙満绔欑偣鍒楀彿=1鏃讹紝鍋忕Щ閲�=2
- port: 102
- crnOutStn[0]: #鍫嗗灈鏈哄嚭搴撶珯鐐�--1F杈撻�佺嚎 鏀捐揣鍙�
- staNo: 1056
- row: 7
- bay: 1
- lev: 1
- devpPlcId: ${wcs-slave.devp[2].id}
- crnInStn[0]: #鍫嗗灈鏈哄叆搴撶珯鐐�1--1F杈撻�佺嚎 鍙栬揣鍙�
- staNo: 1058
- row: 6
- bay: 1
- lev: 1
- backSta: 106
- devpPlcId: ${wcs-slave.devp[2].id}
- crnOutStn[1]: #鍫嗗灈鏈哄嚭搴撶珯鐐�--2F杈撻�佺嚎 鏀捐揣鍙�
- staNo: 2057
- row: 7
- bay: 1
- lev: 13
- devpPlcId: ${wcs-slave.devp[3].id}
- crnInStn[1]: #鍫嗗灈鏈哄叆搴撶珯鐐�1--2F杈撻�佺嚎 鍙栬揣鍙�
- staNo: 2057
- row: 7
- bay: 1
- lev: 13
- backSta: 106
- devpPlcId: ${wcs-slave.devp[3].id}
- crnOutStn[2]: #鍫嗗灈鏈哄嚭搴撶珯鐐�--2F杈撻�佺嚎 鏀捐揣鍙�
- staNo: 2058
- row: 6
- bay: 1
- lev: 13
- devpPlcId: ${wcs-slave.devp[3].id}
- crnInStn[2]: #鍫嗗灈鏈哄叆搴撶珯鐐�1--2F杈撻�佺嚎 鍙栬揣鍙�
- staNo: 2058
- row: 6
- bay: 1
- lev: 13
- backSta: 106
- devpPlcId: ${wcs-slave.devp[3].id}
- crnOutStn[3]: #鍫嗗灈鏈哄嚭搴撶珯鐐�--2F杈撻�佺嚎 鏀捐揣鍙�
- staNo: 2051
- row: 7
- bay: 13
- lev: 13
- devpPlcId: ${wcs-slave.devp[3].id}
- crnInStn[3]: #鍫嗗灈鏈哄叆搴撶珯鐐�1--2F杈撻�佺嚎 鍙栬揣鍙�
- staNo: 2051
- row: 7
- bay: 13
- lev: 13
- backSta: 106
- devpPlcId: ${wcs-slave.devp[3].id}
- crnOutStn[4]: #鍫嗗灈鏈哄嚭搴撶珯鐐�--2F杈撻�佺嚎 鏀捐揣鍙�
- staNo: 2052
- row: 7
- bay: 10
- lev: 13
- devpPlcId: ${wcs-slave.devp[3].id}
- crnInStn[4]: #鍫嗗灈鏈哄叆搴撶珯鐐�1--2F杈撻�佺嚎 鍙栬揣鍙�
- staNo: 2052
- row: 7
- bay: 10
- lev: 13
- backSta: 106
- devpPlcId: ${wcs-slave.devp[3].id}
- crnOutStn[5]: #鍫嗗灈鏈哄嚭搴撶珯鐐�--2F杈撻�佺嚎 鏀捐揣鍙�
- staNo: 2054
- row: 7
- bay: 4
- lev: 13
- devpPlcId: ${wcs-slave.devp[3].id}
- crnInStn[5]: #鍫嗗灈鏈哄叆搴撶珯鐐�1--2F杈撻�佺嚎 鍙栬揣鍙�
- staNo: 2056
- row: 7
- bay: 2
- lev: 13
- backSta: 106
- devpPlcId: ${wcs-slave.devp[3].id}
devp[0]: #杈撻�佺嚎--鍗婃垚鍝�1F
id: 1
ip: 192.168.110.50
@@ -168,192 +48,51 @@
staNo: 1014
backSta: 1015
barcode: ${wcs-slave.barcode[0].id}
- led: ${wcs-slave.led[2].id}
- scale: ${wcs-slave.scale[0].id}
+ led: ${wcs-slave.led[0].id}
+# scale: ${wcs-slave.scale[0].id}
outSta[0]: #鍑哄簱鍙�1
staNo: 1019
outSta[1]: #鍑哄簱鍙�2
staNo: 1010
outSta[2]: #鍑哄簱鍙�2
staNo: 1020
- devp[1]: #杈撻�佺嚎--鍗婃垚鍝�2F
- id: 2
- ip: 192.168.110.70
- rack: 0
- port: 102
- slot: 0
- emptyInSta[0]: #绌烘澘鍏ュ簱鍙�0
- staNo: 2007
- inSta[0]: #鍏ュ簱鍙�1
- staNo: 2007
- backSta: 2006
- barcode: ${wcs-slave.barcode[1].id}
- led: ${wcs-slave.led[8].id}
- scale: ${wcs-slave.scale[1].id}
- outSta[0]: #鍑哄簱鍙�1
- staNo: 2001
- outSta[1]: #鍑哄簱鍙�2
- staNo: 2019
- devp[2]: #杈撻�佺嚎--鎴愬搧1F
- id: 3
- ip: 192.168.110.30
- rack: 0
- port: 102
- slot: 0
- inSta[0]: #鍏ュ簱鍙�1
- staNo: 1052
- backSta: 1051
- barcode: ${wcs-slave.barcode[2].id}
- led: ${wcs-slave.led[0].id}
- scale: ${wcs-slave.scale[2].id}
- inSta[1]: #绌烘澘鍏ュ簱鍙�0
- staNo: 1058
- outSta[0]: #鍑哄簱鍙�1
- staNo: 1053
- devp[3]: #杈撻�佺嚎--鎴愬搧2F
- id: 4
- ip: 192.168.110.40
- rack: 0
- port: 102
- slot: 0
- emptyInSta[0]: #绌烘澘鍏ュ簱鍙�0
- staNo: 2056
- led: ${wcs-slave.led[3].id}
- inSta[0]: #鍏ュ簱鍙�1
- staNo: 2056
- backSta: 2055
- barcode: ${wcs-slave.barcode[3].id}
- led: ${wcs-slave.led[4].id}
- scale: ${wcs-slave.scale[3].id}
- outSta[0]: #鍑哄簱鍙�1
- staNo: 1053
- outSta[1]: #鍑哄簱鍙�1
- staNo: 251
- outSta[2]: #鍑哄簱鍙�1
- staNo: 252
- outSta[3]: #鍑哄簱鍙�1
- staNo: 257
- outSta[4]: #鍑哄簱鍙�1
- staNo: 258
- # 鎷f枡鍏ュ簱鍙�1
- pickSta[0]:
- staNo: 2051
- led: ${wcs-slave.led[6].id}
- # 鎷f枡鍏ュ簱鍙�2
- pickSta[1]:
- staNo: 2052
- # 鎷f枡鍏ュ簱鍙�3
- pickSta[2]:
- staNo: 2057
- led: ${wcs-slave.led[3].id}
- # 鎷f枡鍏ュ簱鍙�4
- pickSta[3]:
- staNo: 2058
barcode[0]: #鏉$爜鎵弿浠�
port: 51236
ip: 172.17.91.39
id: 1
- barcode[1]: #鏉$爜鎵弿浠�
- port: 51236
- ip: 172.17.91.39
- id: 2
- barcode[2]: #鏉$爜鎵弿浠�
- port: 51236
- ip: 172.17.91.39
- id: 3
- barcode[3]: #鏉$爜鎵弿浠�
- port: 51236
- ip: 172.17.91.39
- id: 4
- # LED1 鎴愬搧搴�1F
+ # LED1
led[0]:
id: 1
ip: 192.168.110.210
port: 5005
- devpPlcId: ${wcs-slave.devp[2].id}
+ devpPlcId: ${wcs-slave.devp[0].id}
staArr: 1052
- # LED2 鎴愬搧搴�1F
+ # LED2
led[1]:
id: 2
ip: 192.168.110.211
port: 5005
- devpPlcId: ${wcs-slave.devp[2].id}
- staArr: 1051
- # LED3 鍗婃垚鍝佸簱1F
- led[2]:
- id: 3
- ip: 192.168.110.212
- port: 5005
devpPlcId: ${wcs-slave.devp[0].id}
- staArr: 1014,1015
- # LED4 鎴愬搧搴�2F
- led[3]:
- id: 4
- ip: 192.168.110.213
- port: 5005
- devpPlcId: ${wcs-slave.devp[3].id}
- staArr: 2057
- # LED5 鎴愬搧搴�2F
- led[4]:
- id: 5
- ip: 192.168.110.214
- port: 5005
- devpPlcId: ${wcs-slave.devp[3].id}
- staArr: 2056
- # LED6 鎴愬搧搴�2F
- led[5]:
- id: 6
- ip: 192.168.110.215
- port: 5005
- devpPlcId: ${wcs-slave.devp[3].id}
- staArr: 2054
- # LED7 鎴愬搧搴�2F
- led[6]:
- id: 7
- ip: 192.168.110.216
- port: 5005
- devpPlcId: ${wcs-slave.devp[3].id}
- staArr: 2051
- # LED8 鍗婃垚鍝佸簱2F
- led[7]:
- id: 8
- ip: 192.168.110.217
- port: 5005
- devpPlcId: ${wcs-slave.devp[1].id}
- staArr: 2002
- # LED9 鍗婃垚鍝佸簱2F
- led[8]:
- id: 9
- ip: 192.168.110.218
- port: 5005
- devpPlcId: ${wcs-slave.devp[1].id}
- staArr: 2007
- # LED10 鍗婃垚鍝佸簱2F
- led[9]:
- id: 10
- ip: 192.168.110.219
- port: 5005
- devpPlcId: ${wcs-slave.devp[1].id}
- staArr: 2018
+ staArr: 1051
# 纾呯Г 鍗婃垚鍝佷竴妤� 192.168.110.24
- scale[0]:
- id: 1
- ip: 192.168.110.24
- port: 5005
+# scale[0]:
+# id: 1
+# ip: 192.168.110.24
+# port: 5005
# 纾呯Г 鍗婃垚鍝�2妤� 192.168.110.23
- scale[1]:
- id: 2
- ip: 192.168.110.23
- port: 5005
+# scale[1]:
+# id: 2
+# ip: 192.168.110.23
+# port: 5005
# 纾呯Г 鎴愬搧搴撲竴妤�192.168.110.21
- scale[2]:
- id: 3
- ip: 192.168.110.21
- port: 5005
+# scale[2]:
+# id: 3
+# ip: 192.168.110.21
+# port: 5005
# 纾呯Г 鎴愬搧搴�2妤� 192.168.110.22
- scale[3]:
- id: 4
- ip: 192.168.110.22
- port: 5005
+# scale[3]:
+# id: 4
+# ip: 192.168.110.22
+# port: 5005
diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml
index 2b7bec6..c382e6c 100644
--- a/src/main/resources/application.yml
+++ b/src/main/resources/application.yml
@@ -1,5 +1,5 @@
server:
- port: 8080
+ port: 9090
servlet:
context-path: /@pom.build.finalName@
@@ -37,7 +37,7 @@
#License鐩稿叧閰嶇疆
license:
- subject: scwcs
+ subject: yrwcs
publicAlias: publicCert
storePass: public_zhongyang_123456789
licensePath: license.lic
diff --git a/src/main/resources/mapper/LicenseInfosMapper.xml b/src/main/resources/mapper/LicenseInfosMapper.xml
new file mode 100644
index 0000000..6274069
--- /dev/null
+++ b/src/main/resources/mapper/LicenseInfosMapper.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.zy.system.mapper.LicenseInfosMapper">
+
+ <!-- 閫氱敤鏌ヨ鏄犲皠缁撴灉 -->
+ <resultMap id="BaseResultMap" type="com.zy.system.entity.LicenseInfos">
+ <id column="id" property="id" />
+ <result column="license" property="license" />
+ <result column="license_time" property="licenseTime" />
+ <result column="create_time" property="createTime" />
+
+ </resultMap>
+
+ <select id="getLatestLicense" resultMap="BaseResultMap">
+ select top 1 * from sys_license_infos order by create_time desc
+ </select>
+
+</mapper>
diff --git a/src/main/webapp/static/wcs/js/common.js b/src/main/webapp/static/wcs/js/common.js
index 01a010b..dd0efd0 100644
--- a/src/main/webapp/static/wcs/js/common.js
+++ b/src/main/webapp/static/wcs/js/common.js
@@ -1,4 +1,4 @@
-var baseUrl = "/scwcs";
+var baseUrl = "/wcs";
// 璧嬪��
function setVal(el, val) {
diff --git a/src/main/webapp/static/wcs/js/console.map.js b/src/main/webapp/static/wcs/js/console.map.js
index 1a1cb35..5d7249b 100644
--- a/src/main/webapp/static/wcs/js/console.map.js
+++ b/src/main/webapp/static/wcs/js/console.map.js
@@ -1,5 +1,5 @@
mapInfo = {
- "mapName": "scwcs",
+ "mapName": "wcs",
"rackCount": 13,
"crnCount": 4,
"stbCount": 4,
diff --git a/src/main/webapp/static/wcs/js/console1.map.js b/src/main/webapp/static/wcs/js/console1.map.js
index 220692e..1f84f82 100644
--- a/src/main/webapp/static/wcs/js/console1.map.js
+++ b/src/main/webapp/static/wcs/js/console1.map.js
@@ -1,5 +1,5 @@
mapInfo = {
- "mapName": "scwcs",
+ "mapName": "wcs",
"rackCount": 13,
"crnCount": 4,
"stbCount": 4,
diff --git a/src/main/webapp/static/wcs/js/console2.map.js b/src/main/webapp/static/wcs/js/console2.map.js
index da7a249..894dd83 100644
--- a/src/main/webapp/static/wcs/js/console2.map.js
+++ b/src/main/webapp/static/wcs/js/console2.map.js
@@ -1,5 +1,5 @@
mapInfo = {
- "mapName": "scwcs",
+ "mapName": "wcs",
"rackCount": 13,
"crnCount": 4,
"stbCount": 4,
diff --git a/src/main/webapp/static/wcs/js/console3.map.js b/src/main/webapp/static/wcs/js/console3.map.js
index 38ed27f..348cc4f 100644
--- a/src/main/webapp/static/wcs/js/console3.map.js
+++ b/src/main/webapp/static/wcs/js/console3.map.js
@@ -1,5 +1,5 @@
mapInfo = {
- "mapName": "scwcs",
+ "mapName": "wcs",
"rackCount": 13,
"crnCount": 4,
"stbCount": 4,
diff --git a/src/main/webapp/views/index.html b/src/main/webapp/views/index.html
index 68fa6af..834ff6c 100644
--- a/src/main/webapp/views/index.html
+++ b/src/main/webapp/views/index.html
@@ -2,15 +2,14 @@
<html lang="en">
<head>
<meta charset="utf-8">
- <title>鑷姩鍖栫珛浣撲粨搴� - wcs</title>
+ <title>涓壃 - 鑷姩鍖栫珛浣撲粨搴� - AS / RS</title>
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
- <link rel="stylesheet" href="../static/wms/layui/css/layui.css" media="all">
- <link rel="stylesheet" href="../static/wms/css/admin.css?v=318" media="all">
- <link rel="stylesheet" href="../static/wms/css/loader.css" media="all">
- <link rel="stylesheet" href="../static/wcs/css/layx.min.css" type="text/css" />
- <script src="../static/wcs/js/tools/layx.min.js"></script>
+ <link rel="icon" type="image/x-icon" href="../static/image/favicon.ico" />
+ <link rel="stylesheet" href="../static/layui/css/layui.css" media="all">
+ <link rel="stylesheet" href="../static/css/admin.css?v=318" media="all">
+ <link rel="stylesheet" href="../static/css/loader.css" media="all">
<style>
.layui-logo img {
width: 25px;
@@ -20,27 +19,6 @@
font-weight: 400;
/*margin-left: 5px;*/
}
- /* 寮圭獥鏍峰紡 */
- .popup {
- position: fixed;
- top: 0;
- left: 0;
- width: 100%;
- height: 100%;
- background-color: rgba(0,0,0,0.5);
- display: none;
- justify-content: center;
- align-items: center;
- z-index: 9999;
- }
-
- .popup-content {
- background-color: #fff;
- padding: 20px;
- border-radius: 5px;
- box-shadow: 0px 0px 20px rgba(0,0,0,0.3);
- text-align: center;
- }
</style>
</head>
<body class="layui-layout-body">
@@ -48,10 +26,10 @@
<!-- 澶撮儴 -->
<div class="layui-header">
<div class="layui-logo">
- <img class="loginLogo" src="../static/wms/image/logo.png" style="display: inline-block; width: 60%;height: auto">
- <!-- <span style="margin-top: 0; letter-spacing: 10px">wcs</span>-->
- <!-- <img src="../static/wms/image/logo.svg"/>-->
- <!-- <cite>wcs - 鑷姩鍖栫珛浣撲粨搴�</cite>-->
+ <img src="../static/image/zy_logo_dark_color.png" style="display: inline-block; width: 40%;height: auto">
+ <!-- <span style="margin-top: 0; letter-spacing: 10px">涓壃绔嬪簱</span>-->
+ <!-- <img src="../static/image/logo.svg"/>-->
+ <!-- <cite>涓壃 - Zoneyung</cite>-->
</div>
<ul class="layui-nav layui-layout-left">
@@ -63,11 +41,8 @@
</li>
</ul>
<ul class="layui-nav layui-layout-right">
-<!-- <li class="layui-nav-item" lay-unselect>-->
-<!-- <a ew-event="note" title="渚跨"><i class="layui-icon layui-icon-note"></i></a>-->
-<!-- </li>-->
<li class="layui-nav-item" lay-unselect id="licenseShow" style="display: none;user-select: none;">
- <div style="color: red;">浠撳偍绯荤粺璁稿彲鏈夋晥鏈燂細<span id="licenseDays">29</span>澶�</div>
+ <div style="color: red;">涓存椂璁稿彲璇佹湁鏁堟湡锛�<span id="licenseDays">29</span>澶�</div>
</li>
<li class="layui-nav-item layui-hide-xs" lay-unselect>
<a ew-event="fullScreen" title="鍏ㄥ睆"><i class="layui-icon layui-icon-screen-full"></i></a>
@@ -100,7 +75,7 @@
<div class="layui-body"></div>
<!-- 搴曢儴 -->
<div class="layui-footer layui-text">
-<!-- <span class="copyright-text">copyright 漏 2023 wcs all rights reserved.</span>-->
+ copyright 漏 2022 <a href="https://www.superton.cn/" target="_blank">娴欐睙涓壃绔嬪簱鏈夐檺鍏徃</a> all rights reserved.
<span class="pull-right">Version 1.0.0</span>
</div>
@@ -110,65 +85,13 @@
<div class="layuimini-loader">
<div class="layuimini-loader-inner"></div>
</div>
-<!-- 寮圭獥鍐呭 -->
-<div class="popup" id="popup">
- <div class="popup-content">
- <h2 style="font-size: 28px;margin-bottom: 10px;">璁稿彲璇佸嵆灏嗚繃鏈�</h2>
- <div id="popup-text" style="font-size: 28px;color: red"></div>
- <button style="background-color: #007bff;color: #fff;border: none;padding: 10px 20px;border-radius: 5px;cursor: pointer;font-size: 16px;" onclick="hidePopup()">鍏抽棴</button>
- </div>
-</div>
-<script>
- // 鏄剧ず寮圭獥
- function showPopup(res) {
- document.getElementById('popup').style.display = 'block';
- // 鑾峰彇寮瑰嚭绐楀彛鍐呭鐨勫鍣ㄥ厓绱�
- var popupText = document.getElementById('popup-text');
- // 鍋囪鍚庡彴杩斿洖鐨勫瓧绗︿覆涓� responseString
- if (res!==""){
- // 鑾峰彇褰撳墠鏃ユ湡
- const currentDate = new Date();
- // 鍒涘缓鏂版棩鏈熷璞″苟娣诲姞澶╂暟
- const newDate = new Date();
- newDate.setDate(currentDate.getDate() + res + 1);
- // 灏嗗瓧绗︿覆璁剧疆涓哄脊绐楀唴瀹圭殑鏂囨湰
- popupText.textContent = "璁稿彲璇佸皢浜�" + new Intl.DateTimeFormat('zh-CN').format(newDate) + "杩囨湡锛屽墿浣欐湁鏁堟湡:" + res + "澶╋紒";
- }else {
- document.getElementById('popup').style.display = 'none';
- }
- }
- // 闅愯棌寮圭獥
- function hidePopup() {
- document.getElementById('popup').style.display = 'none';
- }
-</script>
-<script type="text/javascript" src="../static/wms/js/jquery/jquery-3.3.1.min.js"></script>
-<script type="text/javascript" src="../static/wms/layui/layui.js"></script>
-<script type="text/javascript" src="../static/wms/js/handlebars/handlebars-v4.5.3.js"></script>
-<script type="text/javascript" src="../static/wms/js/common.js"></script>
+<script type="text/javascript" src="../static/js/jquery/jquery-3.3.1.min.js"></script>
+<script type="text/javascript" src="../static/layui/layui.js"></script>
+<script type="text/javascript" src="../static/js/handlebars/handlebars-v4.5.3.js"></script>
+<script type="text/javascript" src="../static/js/common.js"></script>
<script>
- f()
- function f() {
- $.ajax({
- url: baseUrl + "/license/getLicenseDays",
- headers: {'token': localStorage.getItem('token')},
- method: 'POST',
- success: function (res) {
- if (res.code == 200) {
- let days = res.data
- if (days <= 15) {
- showPopup(res.data)
- } else {
- showPopup("");
- }
- }
- }
- });
- }
-</script>
-<script>
- console.log('%c wcs %c 1.0.0','background-color:rgb(53,73,94);color: #fff;border-radius:2px 0 0 2px;padding:2px 4px;','background-color:rgb(25,190,107);color: #fff;border-radius:0 2px 2px 0;padding:2px 4px;font: 9pt "Apercu Regular", Georgia, "Times New Roman", Times, serif;');
+ console.log('%c 涓壃绔嬪簱骞冲彴 %c 1.0.0','background-color:rgb(53,73,94);color: #fff;border-radius:2px 0 0 2px;padding:2px 4px;','background-color:rgb(25,190,107);color: #fff;border-radius:0 2px 2px 0;padding:2px 4px;font: 9pt "Apercu Regular", Georgia, "Times New Roman", Times, serif;');
$(function () {
if ("" === localStorage.getItem('token')) {
top.location.href = baseUrl + "/login";
@@ -176,7 +99,7 @@
});
layui.config({
- base: baseUrl + "/static/wms/layui/lay/modules/"
+ base: baseUrl + "/static/layui/lay/modules/"
}).extend({
notice: 'notice/notice',
}).use(['index', 'element', 'layer', 'admin', 'notice'], function () {
@@ -209,29 +132,11 @@
var html = template(res);
$("#menu-main").html(html);
element.init();
-
- $("#a-30519").attr({"href":$("#a-30519").attr("lay-href"),"target":"_blank"})
- $("#a-30519").attr({"lay-href":""})
- $("#a-30520").attr({"href":$("#a-30520").attr("lay-href"),"target":"_blank"})
- $("#a-30520").attr({"lay-href":""})
- $("#a-30522").attr({"href":$("#a-30522").attr("lay-href"),"target":"_blank"})
- $("#a-30522").attr({"lay-href":""})
} else if (res.code === 403) {
top.location.href = baseUrl + "/login";
} else {
layer.msg(res.msg, {icon: 2});
}
- }
- });
-
- $.ajax({
- url: baseUrl+"/loginInformation",
- data: {},
- method: 'GET',
- success: function (res) {
- var data = res.data
- $(".copyright-text").text(data.loginCopyrightText);
- $(".loginLogo").attr("src", data.loginLogo);
}
});
@@ -243,22 +148,9 @@
if (res.code == 200) {
let days = res.data
if (days <= 30) {
- // 寮瑰嚭涓�涓畝鍗曠殑鎻愮ず妗�
- layer.alert(`
- <div style="font-size: 100px; text-align: center; line-height: 1.8; color: red">
- 璁稿彲璇佹湁鏁堟湡涓猴細${days}
- </div>
-`, {
- area: ['1000px', '800px'],
- btn: '纭畾',
- btnAlign: 'c', // 鎸夐挳灞呬腑锛堥粯璁ゆ槸鍙冲榻愶級
- yes: function(index) {
- layer.msg('璇疯仈绯荤珛搴撳叕鍙稿晢鍔$画绾�');
- layer.close(index);
- }
- });
$("#licenseShow").show()
$("#licenseDays").html(days)
+ alert("涓存椂璁稿彲鏈夋晥鏈燂細" + days + "澶�")
}
}else {
top.location.href = baseUrl + "/login";
@@ -268,7 +160,7 @@
// 榛樿鍔犺浇涓婚〉
index.loadHome({
- menuPath: baseUrl+'/views/home/console.html',
+ menuPath: baseUrl+'/views/home/navigation.html',
menuName: '<i class="layui-icon layui-icon-home"></i>'
});
@@ -294,7 +186,7 @@
<a><i class="layui-icon {{this.menuIcon}}"></i> <cite>{{this.menu}}</cite></a>
<dl class="layui-nav-child">
{{#each this.subMenu}}
- <dd><a lay-href="{{this.code}}?resourceId={{this.id}}" id="a-{{this.id}}">{{this.name}}</a></dd>
+ <dd><a lay-href="{{this.code}}?resourceId={{this.id}}">{{this.name}}</a></dd>
{{/each}}
</dl>
</li>
--
Gitblit v1.9.1