Commit f4f0c4a9 authored by 李德才's avatar 李德才

保存各系统所在服务器SN码到配置文件

parent 099c8dfc
...@@ -20,7 +20,11 @@ public class SnController extends Controller { ...@@ -20,7 +20,11 @@ public class SnController extends Controller {
public void getPropertiesValue() { public void getPropertiesValue() {
String cupCode = getPara("cupCode"); String cupCode = getPara("cupCode");
try { try {
renderJson(Ret.ok("snCode", snService.getPropertiesValue(cupCode))); String propertiesValue = snService.getPropertiesValue(cupCode);
if (propertiesValue == null) {
snService.saveSnCode(cupCode);
}
renderJson(Ret.ok("snCode", propertiesValue));
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
renderJson(Ret.fail()); renderJson(Ret.fail());
......
...@@ -36,4 +36,8 @@ public class SnService { ...@@ -36,4 +36,8 @@ public class SnService {
} }
public void saveSnCode(String cpuCode){
PropertyUtil.setProperty(cpuCode,"",FILE_PATH);
}
} }
package com.archser.aserver.util; package com.archser.aserver.util;
import com.jfinal.kit.PropKit;
import java.io.BufferedReader; import java.io.BufferedReader;
import java.io.File; import java.io.File;
import java.io.FileInputStream; import java.io.FileInputStream;
...@@ -10,7 +9,6 @@ import java.io.InputStream; ...@@ -10,7 +9,6 @@ import java.io.InputStream;
import java.io.InputStreamReader; import java.io.InputStreamReader;
import java.io.OutputStream; import java.io.OutputStream;
import java.io.OutputStreamWriter; import java.io.OutputStreamWriter;
import java.io.UnsupportedEncodingException;
import java.nio.charset.StandardCharsets; import java.nio.charset.StandardCharsets;
import java.util.Objects; import java.util.Objects;
import java.util.Properties; import java.util.Properties;
......
#III
#Thu Dec 03 09:31:25 CST 2020
AAA=数字档案室3,cdcsdcdscd
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment