Просмотр исходного кода

Merge branch '2.2.0' into 2.2.1

klzhangweiya 2 лет назад
Родитель
Сommit
7675926fca
62 измененных файлов с 3845 добавлено и 1606 удалено
  1. 3 0
      .gitignore
  2. 79 0
      VB_DSM_DATA/VbdsmMockData/Vbdsm.Hj212/Common/FileHelper.cs
  3. 104 0
      VB_DSM_DATA/VbdsmMockData/Vbdsm.Hj212/Common/StrHexHelper.cs
  4. 67 0
      VB_DSM_DATA/VbdsmMockData/Vbdsm.Hj212/Gen/GenData.cs
  5. 83 0
      VB_DSM_DATA/VbdsmMockData/Vbdsm.Hj212/Gen/TerminalData.cs
  6. 70 0
      VB_DSM_DATA/VbdsmMockData/Vbdsm.Hj212/Model/Harmonic.cs
  7. 185 0
      VB_DSM_DATA/VbdsmMockData/Vbdsm.Hj212/Model/PowerEnergy.cs
  8. 43 0
      VB_DSM_DATA/VbdsmMockData/Vbdsm.Hj212/Program.cs
  9. 33 0
      VB_DSM_DATA/VbdsmMockData/Vbdsm.Hj212/Settings/AppSetting.cs
  10. 13 0
      VB_DSM_DATA/VbdsmMockData/Vbdsm.Hj212/Settings/ServerSetting.cs
  11. 14 0
      VB_DSM_DATA/VbdsmMockData/Vbdsm.Hj212/Settings/TerminalSetting.cs
  12. 188 0
      VB_DSM_DATA/VbdsmMockData/Vbdsm.Hj212/SocketClients/TpcClient.cs
  13. 22 0
      VB_DSM_DATA/VbdsmMockData/Vbdsm.Hj212/Vbdsm.Hj212.csproj
  14. 26 0
      VB_DSM_DATA/VbdsmMockData/Vbdsm.Hj212/appsettings.json
  15. 25 0
      VB_DSM_DATA/VbdsmMockData/VbdsmMockData.sln
  16. 1 2
      VB_DSM_V2.1/Scripts/Cmds/7085_gov.run.xml
  17. 33 0
      VB_DSM_V2.1/Scripts/Cmds/7087_charts.run.xml
  18. 1 1
      VB_DSM_V2.1/Scripts/Cmds/7090_analysis.run.xml
  19. 21 5
      VB_DSM_V2.1/Scripts/Dockers/docker-compose.yml
  20. 1 1
      VB_DSM_V2.1/vbdsm-data-upload/vbdsm-acquis-ws/src/main/resources/local/redis-host.properties
  21. 2 2
      VB_DSM_V2.1/vbdsm-data-upload/vbdsm-hj212/vbdsm-hj212-datacollect/src/main/resources/config/application.yml
  22. 3 3
      VB_DSM_V2.1/vbdsm-data-upload/vbdsm-hj212/vbdsm-hj212-server/src/main/java/cn/vbdsm/hj212/server/executor/ReaTimeExector.java
  23. 2 2
      VB_DSM_V2.1/vbdsm-data-upload/vbdsm-hj212/vbdsm-hj212-server/src/main/resources/config/application.yml
  24. 1 1
      VB_DSM_V2.1/vbdsm-job/xxl-job-admin/src/main/resources/application.properties
  25. 1 1
      VB_DSM_V2.1/vbdsm-statistics/vbdsm-analysis/pom.xml
  26. 128 129
      VB_DSM_V2.1/vbdsm-statistics/vbdsm-analysis/src/main/java/cn/vbdsm/analysis/dao/AnalData24hEnergyDao.java
  27. 254 261
      VB_DSM_V2.1/vbdsm-statistics/vbdsm-analysis/src/main/java/cn/vbdsm/analysis/dao/OnlineDataEnergyDao.java
  28. 557 555
      VB_DSM_V2.1/vbdsm-statistics/vbdsm-analysis/src/main/java/cn/vbdsm/analysis/timer/impl/FgpTimer.java
  29. 104 90
      VB_DSM_V2.1/vbdsm-statistics/vbdsm-analysis/src/main/java/cn/vbdsm/analysis/timer/impl/H24Timer.java
  30. 436 436
      VB_DSM_V2.1/vbdsm-statistics/vbdsm-analysis/src/main/java/cn/vbdsm/common/constants/CronExpression.java
  31. 1 1
      VB_DSM_V2.1/vbdsm-statistics/vbdsm-analysis/src/main/resources/local/redis-host.properties
  32. 43 39
      VB_DSM_V2.1/vbdsm-statistics/vbdsm-analysis/src/main/resources/local/schedule.xml
  33. 56 57
      VB_DSM_V2.1/vbdsm-statistics/vbdsm-analysis/src/main/resources/test/schedule.xml
  34. 2 2
      VB_DSM_V2.1/vbdsm-statistics/vbdsm-statistic/src/main/java/cn/vbdsm/statistic/biz/impl/OnlineWarnAnalBizImpl.java
  35. 2 2
      VB_DSM_V2.1/vbdsm-statistics/vbdsm-statistic/src/main/resources/config/application-dev.yml
  36. 1 0
      VB_DSM_V2.1/vbdsm-web/pom.xml
  37. 19 0
      VB_DSM_V2.1/vbdsm-web/vbdsm-charts/Dockerfile
  38. 109 0
      VB_DSM_V2.1/vbdsm-web/vbdsm-charts/pom.xml
  39. 133 0
      VB_DSM_V2.1/vbdsm-web/vbdsm-charts/src/main/java/cn/vbdsm/common/config/CustomConfig.java
  40. 68 0
      VB_DSM_V2.1/vbdsm-web/vbdsm-charts/src/main/java/cn/vbdsm/common/converts/ChartsConverter.java
  41. 124 0
      VB_DSM_V2.1/vbdsm-web/vbdsm-charts/src/main/java/cn/vbdsm/common/servlets/ApplicationServlet.java
  42. 14 0
      VB_DSM_V2.1/vbdsm-web/vbdsm-charts/src/main/resources/application-beans.xml
  43. 33 0
      VB_DSM_V2.1/vbdsm-web/vbdsm-charts/src/main/resources/application-common.xml
  44. 10 0
      VB_DSM_V2.1/vbdsm-web/vbdsm-charts/src/main/resources/application-context.xml
  45. 27 0
      VB_DSM_V2.1/vbdsm-web/vbdsm-charts/src/main/resources/application-web.xml
  46. 14 0
      VB_DSM_V2.1/vbdsm-web/vbdsm-charts/src/main/resources/auth-rule.properties
  47. 61 0
      VB_DSM_V2.1/vbdsm-web/vbdsm-charts/src/main/resources/local/log4j-cfg.xml
  48. 1 0
      VB_DSM_V2.1/vbdsm-web/vbdsm-charts/src/main/resources/local/redis-host.properties
  49. 61 0
      VB_DSM_V2.1/vbdsm-web/vbdsm-charts/src/main/resources/product/log4j-cfg.xml
  50. 1 0
      VB_DSM_V2.1/vbdsm-web/vbdsm-charts/src/main/resources/product/redis-host.properties
  51. 9 0
      VB_DSM_V2.1/vbdsm-web/vbdsm-charts/src/main/resources/system.properties
  52. 61 0
      VB_DSM_V2.1/vbdsm-web/vbdsm-charts/src/main/resources/test/log4j-cfg.xml
  53. 1 0
      VB_DSM_V2.1/vbdsm-web/vbdsm-charts/src/main/resources/test/redis-host.properties
  54. 410 0
      VB_DSM_V2.1/vbdsm-web/vbdsm-charts/src/main/resources/webdefault.xml
  55. 3 0
      VB_DSM_V2.1/vbdsm-web/vbdsm-charts/src/main/webapp/META-INF/MANIFEST.MF
  56. 74 0
      VB_DSM_V2.1/vbdsm-web/vbdsm-charts/src/main/webapp/WEB-INF/web.xml
  57. 1 1
      VB_DSM_V2.1/vbdsm-web/vbdsm-explorer/src/main/resources/local/redis-host.properties
  58. 2 2
      VB_DSM_V2.1/vbdsm-web/vbdsm-gov-new/src/main/resources/config/application-dev.yml
  59. 1 1
      VB_DSM_V2.1/vbdsm-web/vbdsm-gov/src/main/resources/local/redis-host.properties
  60. 1 1
      VB_DSM_V2.1/vbdsm-web/vbdsm-manage/src/main/resources/local/redis-host.properties
  61. 1 10
      VB_DSM_V2.1/vbdsm-web/vbdsm-passport/src/main/resources/local/redis-host.properties
  62. 1 1
      VB_DSM_V2.1/vbdsm-web/vbdsm-powerservice/src/main/resources/local/redis-host.properties

+ 3 - 0
.gitignore

@@ -55,6 +55,9 @@ build/
 
 ### VS  ###
 .vs/
+bin/
+obj/
+
 
 ### auto-import ###
 /UI/**/vite/auto-import/*.d.ts

+ 79 - 0
VB_DSM_DATA/VbdsmMockData/Vbdsm.Hj212/Common/FileHelper.cs

@@ -0,0 +1,79 @@
+using System.Text;
+
+using Newtonsoft.Json;
+
+namespace Vbdsm.Common
+{
+    public class FileHelper
+    {
+        public static T? ReadFileInfo<T>(string fileName) where T : new()
+        {
+            var str = ReadFileInfo(fileName);
+            return Str2Obj<T>(str);
+        }
+
+        public static string ReadFileInfo(string fileName, string path = "Data")
+        {
+            string filePath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, $"{path}\\{fileName}.json");
+            StringBuilder sb = new StringBuilder();
+            if (File.Exists(filePath)) //文件存在
+            {
+                try
+                {
+                    FileStream fs = new FileStream(filePath, FileMode.Open, FileAccess.Read);
+                    StreamReader reader = new StreamReader(fs, Encoding.UTF8);
+                    while (reader.ReadLine() is { } line)
+                    {
+                        sb.Append(line);
+                    }
+                    reader.Close();
+                    fs.Close();
+                }
+                catch
+                {
+                    // ignored
+                }
+            }
+
+            return sb.ToString();
+        }
+
+        public static void SaveFileInfo(object obj, string fileName)
+        {
+            string str = Obj2Str(obj);
+            SaveFileInfo(str, fileName);
+        }
+
+        public static void SaveFileInfo(string contents, string fileName)
+        {
+            string path = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, $"Data");
+            if (!Directory.Exists(path))
+            {
+                Directory.CreateDirectory(path);
+            }
+            string filePath = $"{path}\\{fileName}.json";
+            File.WriteAllText(filePath, contents);
+        }
+
+        public static T? Str2Obj<T>(string str) where T : new()
+        {
+            if (!string.IsNullOrEmpty(str))
+            {
+                try
+                {
+                    return JsonConvert.DeserializeObject<T>(str);
+                }
+                catch //(Exception e)
+                {
+                    return default;
+                }
+            }
+            return default;
+        }
+
+        public static string Obj2Str(object obj)
+        {
+            return JsonConvert.SerializeObject(obj, Formatting.Indented);
+        }
+    }
+}

+ 104 - 0
VB_DSM_DATA/VbdsmMockData/Vbdsm.Hj212/Common/StrHexHelper.cs

@@ -0,0 +1,104 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace StressClient.Common
+{
+    public class StrHexHelper
+    {
+        // 字符串转16进制字符串   AB-->4142
+        public static string StrToHexStr(string str, Encoding encode)
+        {
+            byte[] b = encode.GetBytes(str);
+
+            string result = string.Empty;
+            foreach (var t in b)
+            {
+                result += Convert.ToString(t, 16);
+            }
+            return result;
+        }
+
+        // 将16进制字符串转换到byte[]
+        public static byte[] HexStrToArray(string str)
+        {
+            int count = str.Length / 2;
+            byte[] b = new byte[count];
+            for (int i = 0; i < count; i++)
+            {
+                string val = "0x" + str.Substring(i * 2, 2);
+                b[i] = Convert.ToByte(val, 16);    // '0x41'->65
+            }
+            return b;
+        }
+
+        public static string do_CRC(byte[] data)
+        {
+            uint crc = 0xFFFF;
+
+            foreach (var pos in data)
+            {
+                crc = (crc >> 8) ^ pos;
+                for (int i = 0; i < 8; i++)
+                {
+                    var check = (byte)(crc & 0x0001);
+                    crc >>= 1;
+                    if (check == 0x0001)
+                        crc ^= 0xA001;
+                }
+            }
+
+            //string ret_str = Convert.ToString(crc, 16);
+            string ret_str = crc.ToString("X4"); ;
+            return ret_str.ToUpper();
+        }
+
+        public static string do_CRC16(byte[] data)
+        {
+            byte[] returnVal = new byte[2];
+            byte CRC16Lo, CRC16Hi, CL, CH, SaveHi, SaveLo;
+            int i, Flag;
+            CRC16Lo = 0xFF;
+            CRC16Hi = 0xFF;
+            CL = 0x86;
+            CH = 0x68;
+            for (i = 0; i < data.Length; i++)
+            {
+                CRC16Lo = (byte)(CRC16Lo ^ data[i]);//每一个数据与CRC寄存器进行异或
+                for (Flag = 0; Flag <= 7; Flag++)
+                {
+                    SaveHi = CRC16Hi;
+                    SaveLo = CRC16Lo;
+                    CRC16Hi = (byte)(CRC16Hi >> 1);//高位右移一位
+                    CRC16Lo = (byte)(CRC16Lo >> 1);//低位右移一位
+                    if ((SaveHi & 0x01) == 0x01)//如果高位字节最后一位为
+                    {
+                        CRC16Lo = (byte)(CRC16Lo | 0x80);//则低位字节右移后前面补 否则自动补0
+                    }
+                    if ((SaveLo & 0x01) == 0x01)//如果LSB为1,则与多项式码进行异或
+                    {
+                        CRC16Hi = (byte)(CRC16Hi ^ CH);
+                        CRC16Lo = (byte)(CRC16Lo ^ CL);
+                    }
+                }
+            }
+            returnVal[0] = CRC16Hi;//CRC高位
+            returnVal[1] = CRC16Lo;//CRC低位
+            return Encoding.UTF8.GetString(returnVal);
+        }
+    }
+
+    public class Helper
+    {
+        public static decimal GetRan(int val, int diff, decimal k = 1)
+        {
+            if (k <= 0)
+                return 0;
+            System.Threading.Thread.Sleep(new Random().Next(10, 30));
+            var ran = Convert.ToDecimal(new Random(DateTime.Now.Millisecond).Next(val - diff, val + diff)) / k;
+            return ran;
+        }
+    }
+}

+ 67 - 0
VB_DSM_DATA/VbdsmMockData/Vbdsm.Hj212/Gen/GenData.cs

@@ -0,0 +1,67 @@
+using System.Text;
+
+using StressClient.Common;
+
+using Vbdsm.Common;
+using Vbdsm.Model;
+
+namespace Vbdsm.Gen
+{
+    public class GenData
+    {
+        public GenData(string terminalIds, string? companyId)
+        {
+            TerminalIds = terminalIds;
+            CompanyId = companyId;
+        }
+
+        public string TerminalIds { get; set; }
+        public string? CompanyId { get; set; }
+
+        public string GenTerminals(string? date = null)
+        {
+            date = date ?? $"{DateTime.Now:yyyyMMddHH}{(DateTime.Now.Minute - DateTime.Now.Minute % 15):D2}00";
+            var str = $"st=01;cn={CompanyId};datatime={date};cphh=&&";
+            var tidList = TerminalIds.Split(',');
+            foreach (var tid in tidList)
+            {
+                str += GenTerminal(tid) + "$";
+            }
+            str = str.TrimEnd('$');
+            Console.WriteLine($"\t {str}");
+            byte[] bytes = StrHexHelper.HexStrToArray(StrHexHelper.StrToHexStr(str, Encoding.Default));
+            var result = $"##{str.Length:D6}{str}{StrHexHelper.do_CRC(bytes)}\r\n";
+            return result;
+        }
+
+        private string GenTerminal(string terminalId)
+        {
+            string fileName = $"{CompanyId}@{terminalId}";
+            TerminalData terminalData = FileHelper.ReadFileInfo<TerminalData>(fileName) ?? new TerminalData(CompanyId, terminalId);
+            var str = $"tid={terminalId}";
+            var power = new PowerEnergy();
+            var dp = Helper.GetRan(22000, 3000, 100);
+            var de = Helper.GetRan(6600, 600, 100);
+            var pe = terminalData.GetCurMonthTotal_P() == 0 ? 0 : terminalData.GetCurMonthTotal_P() + dp;
+            var qe = terminalData.GetCurMonthTotal_E() == 0 ? 0 : terminalData.GetCurMonthTotal_E() + de;
+            var ps = terminalData.Total_P + dp;
+            var qs = terminalData.Total_E + de;
+            power.SetEngine(pe, qe, ps, ps);
+            terminalData.SetMouthTotal_P(pe == 0 ? (decimal)0.01 : pe).SetMouthTotal_E(qe == 0 ? (decimal)0.01 : qe).SetTotal_P(ps).SetTotal_E(qs).Save();
+            str += "&" + power.GetStr();
+            var hia = new Harmonic("a").SetI(power.ia);
+            str += "&" + hia.GetStr_I();
+            var hib = new Harmonic("b").SetI(power.ib);
+            str += "&" + hib.GetStr_I();
+            var hic = new Harmonic("c").SetI(power.ic);
+            str += "&" + hic.GetStr_I();
+            var hua = new Harmonic("a").SetU(power.ua);
+            str += "&" + hua.GetStr_U();
+            var hub = new Harmonic("b").SetU(power.ub);
+            str += "&" + hub.GetStr_U();
+            var huc = new Harmonic("c").SetU(power.uc);
+            str += "&" + huc.GetStr_U();
+            return str;
+        }
+    }
+}

+ 83 - 0
VB_DSM_DATA/VbdsmMockData/Vbdsm.Hj212/Gen/TerminalData.cs

@@ -0,0 +1,83 @@
+using Vbdsm.Common;
+
+namespace Vbdsm.Gen
+{
+    public class TerminalData
+    {
+        public TerminalData()
+        {
+            CompanyId = "";
+            TerminalId = "";
+        }
+
+        public TerminalData(string? companyId, string terminalId)
+        {
+            CompanyId = companyId;
+            TerminalId = terminalId;
+        }
+
+        public string? CompanyId { get; set; }
+        public string TerminalId { get; set; }
+        public Dictionary<string, decimal> MonthTotal_P { get; set; } = new Dictionary<string, decimal>();
+        public decimal Total_P { get; set; }
+        public Dictionary<string, decimal> MonthTotal_E { get; set; } = new Dictionary<string, decimal>();
+        public decimal Total_E { get; set; }
+        private string Key => $"{DateTime.Now:yyyyMMdd}";
+
+        public decimal GetCurMonthTotal_P()
+        {
+            if (!MonthTotal_P.TryGetValue(Key, out var d))
+            {
+                d = 0;
+            }
+            return d;
+        }
+
+        public decimal GetCurMonthTotal_E()
+        {
+            if (!MonthTotal_E.TryGetValue(Key, out var d))
+            {
+                d = 0;
+            }
+            return d;
+        }
+
+        public TerminalData SetTotal_P(decimal d)
+        {
+            Total_P = d;
+            return this;
+        }
+
+        public TerminalData SetMouthTotal_P(decimal d)
+        {
+            if (MonthTotal_P.ContainsKey(Key))
+            {
+                MonthTotal_P.Remove(Key);
+            }
+            MonthTotal_P.Add(Key, d);
+            return this;
+        }
+
+        public TerminalData SetTotal_E(decimal d)
+        {
+            Total_E = d;
+            return this;
+        }
+
+        public TerminalData SetMouthTotal_E(decimal d)
+        {
+            if (MonthTotal_E.ContainsKey(Key))
+            {
+                MonthTotal_E.Remove(Key);
+            }
+            MonthTotal_E.Add(Key, d);
+            return this;
+        }
+
+        public TerminalData Save()
+        {
+            FileHelper.SaveFileInfo(this, $"{CompanyId}@{TerminalId}");
+            return this;
+        }
+    }
+}

+ 70 - 0
VB_DSM_DATA/VbdsmMockData/Vbdsm.Hj212/Model/Harmonic.cs

@@ -0,0 +1,70 @@
+using StressClient.Common;
+
+namespace Vbdsm.Model
+{
+    public class Harmonic
+    {
+        public Harmonic(string type)
+        {
+            this.type = type;
+        }
+
+        public Harmonic()
+        {
+            type = "";
+        }
+
+        public string type { get; set; }
+        public decimal h3 => GetVal();
+        public decimal h5 => GetVal();
+        public decimal h7 => GetVal();
+        public decimal h9 => GetVal();
+        public decimal h11 => GetVal();
+        public decimal h13 => GetVal();
+        public decimal h15 => GetVal();
+        public decimal h17 => GetVal();
+        public decimal h19 => GetVal();
+        public decimal h21 => GetVal();
+        public decimal h23 => GetVal();
+        public decimal h25 => GetVal();
+        public decimal h27 => GetVal();
+        public decimal h29 => GetVal();
+        public decimal h31 => GetVal();
+        public decimal hall => Helper.GetRan(550, 100, 100);
+        public decimal baseI { get; private set; }
+        public decimal baseU { get; private set; }
+
+        private decimal GetVal()
+        {
+            return new Random().Next(0, 100) > 50 ? Helper.GetRan(150, 50, 100) : 0;
+        }
+
+        private string GetStr()
+        {
+            return
+                $"h3:{h3},h5:{h5},h7:{h7},h9:{h9},h11:{h11},h13:{h13},h15:{h15},h17:{h17},h19:{h19},h21:{h21},h23:{h23},h25:{h25},h27:{h27},h29:{h29},h31:{h31},hall:{hall}";
+        }
+
+        public string GetStr_I()
+        {
+            return $"hi{type}={GetStr()},basei:{baseI}";
+        }
+
+        public string GetStr_U()
+        {
+            return $"hu{type}={GetStr()},baseu:{baseU}";
+        }
+
+        public Harmonic SetU(decimal u)
+        {
+            baseU = u;
+            return this;
+        }
+
+        public Harmonic SetI(decimal i)
+        {
+            baseI = i;
+            return this;
+        }
+    }
+}

+ 185 - 0
VB_DSM_DATA/VbdsmMockData/Vbdsm.Hj212/Model/PowerEnergy.cs

@@ -0,0 +1,185 @@
+using StressClient.Common;
+
+namespace Vbdsm.Model
+{
+    public class PowerEnergy
+    {
+        public PowerEnergy()
+        {
+            var list_i = GetI();
+            ia = list_i[0];
+            ib = list_i[1];
+            ic = list_i[2];
+            var listU_220 = GetU_220();
+            ua = listU_220[0];
+            ub = listU_220[1];
+            uc = listU_220[2];
+            var listU_380 = GetU_380();
+            uab = listU_380[0];
+            ubc = listU_380[1];
+            uca = listU_380[2];
+            var listPf = GetPf();
+            pfa = listPf[0];
+            pfb = listPf[1];
+            pfc = listPf[2];
+
+            f = Helper.GetRan(5000, 20, 100);
+        }
+
+        public decimal pa => Math.Floor(ia * ua * pfa) / 1000;
+        public decimal pb => Math.Floor(ib * ub * pfb) / 1000;
+        public decimal pc => Math.Floor(ic * uc * pfc) / 1000;
+        public decimal p => pa + pb + pc;
+        public decimal qa => Math.Floor(ia * ua * (1 - pfa)) / 1000;
+        public decimal qb => Math.Floor(ib * ub * (1 - pfb)) / 1000;
+        public decimal qc => Math.Floor(ic * uc * (1 - pfc)) / 1000;
+        public decimal q => qa + qb + qc;
+        public decimal pfa { get; }
+        public decimal pfb { get; }
+        public decimal pfc { get; }
+        public decimal pf => Math.Floor(p * 100 / (ia * ua / 1000 + ib * ub / 1000 + ic * uc / 1000)) / 100;
+        public decimal ia { get; }
+        public decimal ib { get; }
+        public decimal ic { get; }
+        public decimal iz => Helper.GetRan(1100, 100, 10);
+        public decimal ua { get; }
+        public decimal ub { get; }
+        public decimal uc { get; }
+        public decimal uab { get; }
+        public decimal ubc { get; }
+        public decimal uca { get; }
+
+        //需量负荷
+        public decimal dp => Helper.GetRan((int)Math.Floor(p * 1000), 500, 1000);
+
+        //负荷率
+        public decimal pv => Helper.GetRan(8500, 1500, 100);
+
+        public decimal tpe { get; set; }
+        public decimal tqe { get; set; }
+        public decimal fpe { get; set; }
+        public decimal fqe { get; set; }
+        public decimal tps { get; set; }
+        public decimal tqs { get; set; }
+        public decimal fps { get; set; }
+        public decimal fqs { get; set; }
+        public decimal uaw => GetUw(ua, 220);
+        public decimal ubw => GetUw(ub, 220);
+        public decimal ucw => GetUw(uc, 220);
+        public decimal uabw => GetUw(uab, 380);
+        public decimal ubcw => GetUw(ubc, 380);
+        public decimal ucaw => GetUw(uca, 380);
+        public decimal fw => f - 50;
+        public decimal f { get; }
+        public decimal inbalance => GetUnbalance_I();
+        public decimal unbalance => GetUnbalance_U();
+        public decimal t => Helper.GetRan(42, 3);
+        public decimal t2 { get; set; }
+        public decimal t3 { get; set; }
+        public decimal t4 { get; set; }
+        public decimal t5 { get; set; }
+        public decimal t6 { get; set; }
+        public decimal t7 { get; set; }
+        public decimal t8 { get; set; }
+
+        public PowerEnergy SetEngine(decimal pe, decimal qe, decimal ps, decimal qs)
+        {
+            tpe = pe;
+            tqe = qe;
+            fpe = 0;
+            fqe = 0;
+            tps = ps;
+            tqs = qs;
+            fps = 0;
+            fqs = 0;
+            return this;
+        }
+
+        private List<decimal> GetU_220()
+        {
+            var ran = new Random().Next(2303, 2308);
+            var list = new List<decimal>
+            {
+                Helper.GetRan(ran * 10, 150, 100),
+                Helper.GetRan(ran * 10, 250, 100),
+                Helper.GetRan(ran * 10, 150, 100)
+            };
+            return list;
+        }
+
+        private List<decimal> GetU_380()
+        {
+            var ran = new Random().Next(4003, 4008);
+            var list = new List<decimal>
+            {
+                Helper.GetRan(ran * 10, 150, 100),
+                Helper.GetRan(ran * 10, 250, 100),
+                Helper.GetRan(ran * 10, 150, 100)
+            };
+            return list;
+        }
+
+        private List<decimal> GetI()
+        {
+            var ran = new Random().Next(1000, 1200);
+            var list = new List<decimal>
+            {
+                Helper.GetRan(ran * 100, 450, 100),
+                Helper.GetRan(ran * 100, 350, 100),
+                Helper.GetRan(ran * 100, 550, 100)
+            };
+            return list;
+        }
+
+        public decimal GetUw(decimal u, decimal un)
+        {
+            var w = (u - un) * 100 / un;
+            w = Math.Floor(w * 100) / 100;
+            return w;
+        }
+
+        private List<decimal> GetPf()
+        {
+            var ran = new Random().Next(955, 965);
+            var list = new List<decimal>
+            {
+                Helper.GetRan(ran * 10, 50, 10000),
+                Helper.GetRan(ran * 10, 50, 10000),
+                Helper.GetRan(ran * 10, 50, 10000)
+            };
+            return list;
+        }
+
+        private decimal GetUnbalance_I()
+        {
+            var arr = new decimal[3];
+            arr[0] = ia;
+            arr[1] = ib;
+            arr[2] = ic;
+            var max = arr.Max();
+            var min = arr.Min();
+            var i = (max - min) * 100 / max;
+            i = Math.Floor(i * 100) / 100;
+            return i;
+        }
+
+        private decimal GetUnbalance_U()
+        {
+            var arr = new decimal[3];
+            arr[0] = ua;
+            arr[1] = ub;
+            arr[2] = uc;
+            var max = arr.Max();
+            var ave = arr.Average();
+            var u = (max - ave) * 100 / ave;
+            u = Math.Floor(u * 100) / 100;
+            return u;
+        }
+
+        public string GetStr()
+        {
+            var str = $"p={p}&pa={pa}&pb={pb}&pc={pc}&q={q}&qa={qa}&qb={qb}&qc={qc}&pf={pf}&pfa={pfa}&pfb={pfb}&pfc={pfc}&ia={ia}&ib={ib}&ic={ic}&iz={iz}&ua={ua}&ub={ub}&uc={uc}&uab={uab}&ubc={ubc}&uca={uca}&dp={dp}&pv={pv}&uaw={uaw}&ubw={ubw}&ucw={ucw}&uabw={uabw}&ubcw={ubcw}&ucaw={ucaw}&f={f}&fw={fw}&inbalance={inbalance}&unbalance={unbalance}&t={t}&t2={t2}&t3={t3}&t4={t4}&t5={t5}&t6={t6}&t7={t7}&t8={t8}&tps={tps}&tqs={tqs}&fps={fps}&fqs={fqs}&tpe={tpe}&tqe={tqe}&fpe={fpe}&fqe={fqe}";
+            return str;
+        }
+    }
+}

+ 43 - 0
VB_DSM_DATA/VbdsmMockData/Vbdsm.Hj212/Program.cs

@@ -0,0 +1,43 @@
+using Vbdsm.Settings;
+using Vbdsm.SocketClients;
+
+Console.WriteLine("------------------------数据上传(模拟)程序启动------------------------");
+CancellationTokenSource tokenSource = new CancellationTokenSource();
+CancellationToken cancellationToken = tokenSource.Token;
+var clients = new Dictionary<string?, TpcClient>();
+var terminals = new List<TerminalSetting>();
+if (AppSetting.Instance.Terminals.Count > 0)
+{
+    terminals.AddRange(AppSetting.Instance.Terminals);
+}
+foreach (var terminal in terminals)
+{
+    var client = new TpcClient(terminal.CompanyId, terminal.TerminalIds);
+    if (!clients.ContainsKey(terminal.CompanyId))
+    {
+        clients.Add(terminal.CompanyId, client);
+        Task.Run(() => client.Run(), cancellationToken);
+    }
+}
+Console.WriteLine("------------------------数据上传(模拟)启动完成------------------------");
+while (true)
+{
+    string? cmd = Console.ReadLine();
+    if (cmd == "exit")
+    {
+        break;
+    }
+
+    if (cmd != null)
+    {
+        if (clients.TryGetValue(cmd, out var _client))
+        {
+            _client.ReSend();
+        }
+        else
+        {
+            Console.WriteLine($"未能找到客户端【{cmd}】");
+        }
+    }
+}
+tokenSource.Cancel();

+ 33 - 0
VB_DSM_DATA/VbdsmMockData/Vbdsm.Hj212/Settings/AppSetting.cs

@@ -0,0 +1,33 @@
+using System.Text;
+
+using Newtonsoft.Json;
+
+namespace Vbdsm.Settings
+{
+    public class AppSetting
+    {
+        public List<ServerSetting> Servers { get; set; } = new List<ServerSetting>();
+        public int MaxErrorCount { get; set; } = 10;
+        public bool UseInnerTerminal { get; set; } = false;
+        public List<TerminalSetting> Terminals { get; set; } = new List<TerminalSetting>();
+
+        private static AppSetting? _instance;
+        public static AppSetting Instance => GetInstance();
+
+        private static AppSetting GetInstance()
+        {
+            if (_instance == null)
+            {
+                using var fileStream = new FileStream("appsettings.json", FileMode.Open, FileAccess.Read);
+                int n = (int)fileStream.Length;
+                byte[] bt = new byte[n];
+                var read = fileStream.Read(bt, 0, n);
+                fileStream.Close();
+
+                string data = Encoding.UTF8.GetString(bt, 0, n);
+                _instance = JsonConvert.DeserializeObject<AppSetting>(data) ?? new AppSetting();
+            }
+            return _instance;
+        }
+    }
+}

+ 13 - 0
VB_DSM_DATA/VbdsmMockData/Vbdsm.Hj212/Settings/ServerSetting.cs

@@ -0,0 +1,13 @@
+namespace Vbdsm.Settings;
+
+public class ServerSetting
+{
+    public ServerSetting(string ip, int port)
+    {
+        Ip = ip;
+        Port = port;
+    }
+
+    public string Ip { get; set; }
+    public int Port { get; set; }
+}

+ 14 - 0
VB_DSM_DATA/VbdsmMockData/Vbdsm.Hj212/Settings/TerminalSetting.cs

@@ -0,0 +1,14 @@
+namespace Vbdsm.Settings
+{
+    public class TerminalSetting
+    {
+        public TerminalSetting(string? companyId, string terminalIds)
+        {
+            CompanyId = companyId;
+            TerminalIds = terminalIds;
+        }
+
+        public string? CompanyId { get; set; }
+        public string TerminalIds { get; set; }
+    }
+}

+ 188 - 0
VB_DSM_DATA/VbdsmMockData/Vbdsm.Hj212/SocketClients/TpcClient.cs

@@ -0,0 +1,188 @@
+using SuperSocket.ClientEngine;
+
+using System.Net;
+using System.Text;
+
+using Vbdsm.Gen;
+using Vbdsm.Settings;
+
+namespace Vbdsm.SocketClients
+{
+    public class TpcClient
+    {
+        private Dictionary<string, AsyncTcpSession> Clients { get; }
+
+        private int MaxErrorCount { get; }
+        private int MinuteInterval => 15;
+        private long LastRequestTime { get; set; }
+        private int ErrorCount { get; set; }
+
+        private string? ClientId { get; }
+        private string TerminalIds { get; }
+
+        public TpcClient(string? clientId, string terminalIds)
+        {
+            Clients = GenClients();
+
+            MaxErrorCount = AppSetting.Instance.MaxErrorCount;
+            ClientId = clientId;
+            TerminalIds = terminalIds;
+            LastRequestTime = CalcCurrentTime();
+        }
+
+        private Dictionary<string, AsyncTcpSession> GenClients()
+        {
+            var clients = new Dictionary<string, AsyncTcpSession>();
+            foreach (var server in AppSetting.Instance.Servers)
+            {
+                var key = $"{server.Ip}:{server.Port}";
+                if (!clients.ContainsKey(key))
+                {
+                    var client = InitClient(key);
+                    clients.Add(key, client);
+                }
+            }
+            return clients;
+        }
+
+        private AsyncTcpSession InitClient(string key, AsyncTcpSession? client = null)
+        {
+            if (client != null)
+                client.Close();
+            client = new AsyncTcpSession();
+            try
+            {
+                var arr = key.Split(':');
+                var ip = arr[0];
+                var port = arr[1];
+                if (arr.Length < 2)
+                {
+                    return client;
+                }
+
+                // 连接断开事件
+                client.Closed += (sender, _) =>
+                {
+                    client = sender as AsyncTcpSession;
+                    string message = $"[{DateTime.Now}] :客户端【{ClientId}】【{ip}:{port}】连接断开。";
+                    Console.WriteLine(message);
+                };
+                // 收到服务器数据事件
+                client.DataReceived += (_, e) =>
+                {
+                    string msg = Encoding.Default.GetString(e.Data, 0, e.Length).ToString().Replace("\r\n", "");
+                    string message = $"[{DateTime.Now}] 客户端【{ClientId}】【{ip}:{port}】接受消息 => {msg}。";
+                    Console.WriteLine(message);
+                };
+                // 连接到服务器事件
+                client.Connected += (_, _) =>
+                {
+                    string message = $"[{DateTime.Now}] 客户端【{ClientId}】【{ip}:{port}】连接成功。";
+                    Console.WriteLine(message);
+                };
+                // 发生错误的处理
+                client.Error += (_, e) =>
+                {
+                    string message = $"[{DateTime.Now}] 客户端【{ClientId}】【{ip}:{port}】错误 => {e.Exception.Message}";
+                    Console.WriteLine(message);
+                };
+
+                client.Connect(new IPEndPoint(IPAddress.Parse(ip), Convert.ToInt16(port)));
+            }
+            catch (Exception e)
+            {
+                Console.WriteLine(e.Message);
+            }
+            return client;
+        }
+
+        public void Run()
+        {
+            try
+            {
+                Console.WriteLine($"[{DateTime.Now}]  客户端【{ClientId}@{TerminalIds}】开始运行");
+                // 创建连接
+                Thread.Sleep(2000);
+                while (true)
+                {
+                    Console.Write(".");
+                    Send();
+                    Thread.Sleep(2 * 1000);
+                }
+            }
+            catch (Exception e)
+            {
+                Console.WriteLine(e.Message);
+            }
+        }
+
+        public void ReSend()
+        {
+            Console.WriteLine($"[{DateTime.Now}] 客户端【{ClientId}】 手动触发 ==>");
+            Send(false);
+        }
+
+        private void Send(bool needCheck = true)
+        {
+            if (ErrorCount >= MaxErrorCount || needCheck && !CheckSend())
+            {
+                return;
+            }
+
+            try
+            {
+                LastRequestTime = CalcCurrentTime();
+                Console.WriteLine($"\r\n[{DateTime.Now}] 客户端【{ClientId}】发送数据[{LastRequestTime}] ==>");
+                string str = new GenData(TerminalIds, ClientId).GenTerminals(LastRequestTime + "");
+                byte[] bytes = Encoding.UTF8.GetBytes(str);
+                foreach (var kv in Clients)
+                {
+                    ErrorCount = 0;
+                    Send(kv, bytes);
+                }
+            }
+            catch (Exception e)
+            {
+                ErrorCount++;
+                Console.WriteLine(e);
+            }
+        }
+
+        private void Send(KeyValuePair<string, AsyncTcpSession> keyValue, byte[] bytes)
+        {
+            var client = keyValue.Value;
+            if (client.IsConnected)
+            {
+                Console.WriteLine($"[{DateTime.Now}] 客户端【{ClientId}】【{keyValue.Key}】发送数据");
+                client.Send(bytes, 0, bytes.Length);
+            }
+            else
+            {
+                client = InitClient(keyValue.Key, client);
+                Clients.Remove(keyValue.Key);
+                Clients.Add(keyValue.Key, client);
+                ErrorCount++;
+                Console.WriteLine($"[{DateTime.Now}] 客户端【{ClientId}】【{keyValue.Key}】连接失败 ==> {ErrorCount}/{MaxErrorCount}");
+                Thread.Sleep(2 * 1000);
+                if (ErrorCount <= MaxErrorCount)
+                {
+                    Send(keyValue, bytes);
+                }
+            }
+        }
+
+        private bool CheckSend()
+        {
+            var time = CalcCurrentTime() - LastRequestTime;
+            return time > 0;
+        }
+
+        private long CalcCurrentTime()
+        {
+            //long time = Convert.ToInt64($"{DateTime.Now:yyyyMMddHH}{(DateTime.Now.Minute - DateTime.Now.Minute % minuteInterval):D2}00");
+            long time = Convert.ToInt64($"{DateTime.Now:yyyyMMddHHmm00}");
+            time -= (time - (time / 10000) * 10000) % (MinuteInterval * 100);
+            return time;
+        }
+    }
+}

+ 22 - 0
VB_DSM_DATA/VbdsmMockData/Vbdsm.Hj212/Vbdsm.Hj212.csproj

@@ -0,0 +1,22 @@
+<Project Sdk="Microsoft.NET.Sdk">
+
+  <PropertyGroup>
+    <OutputType>Exe</OutputType>
+    <TargetFramework>net6.0</TargetFramework>
+    <ImplicitUsings>enable</ImplicitUsings>
+    <Nullable>enable</Nullable>
+    <RootNamespace>Vbdsm</RootNamespace>
+  </PropertyGroup>
+
+  <ItemGroup>
+    <PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
+    <PackageReference Include="SuperSocket.ClientEngine.Core" Version="0.10.0" />
+  </ItemGroup>
+
+  <ItemGroup>
+    <None Update="appsettings.json">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </None>
+  </ItemGroup>
+
+</Project>

+ 26 - 0
VB_DSM_DATA/VbdsmMockData/Vbdsm.Hj212/appsettings.json

@@ -0,0 +1,26 @@
+{
+  "Servers": [
+    {
+      "ip": "127.0.0.1",
+      "port": 7777
+    },
+    {
+      "ip": "47.112.30.247",
+      "port": 11112
+    }
+  ],
+  "maxErrorCount": 10, //客户端错误上线
+  //模拟的终端配置
+  "terminals": [
+    {
+      "CompanyId": "1",
+      "TerminalIds": "YD001_01,YD001_02"
+    }
+  ],
+  "work_day_time_span": [
+    "11:00",
+    "13:30",
+    "16:00",
+    "21:30"
+  ]
+}

+ 25 - 0
VB_DSM_DATA/VbdsmMockData/VbdsmMockData.sln

@@ -0,0 +1,25 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio Version 17
+VisualStudioVersion = 17.4.33213.308
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Vbdsm.Hj212", "Vbdsm.Hj212\Vbdsm.Hj212.csproj", "{39F8F08C-0F9D-468E-A296-5BF3D0044BB6}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|Any CPU = Debug|Any CPU
+		Release|Any CPU = Release|Any CPU
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{39F8F08C-0F9D-468E-A296-5BF3D0044BB6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{39F8F08C-0F9D-468E-A296-5BF3D0044BB6}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{39F8F08C-0F9D-468E-A296-5BF3D0044BB6}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{39F8F08C-0F9D-468E-A296-5BF3D0044BB6}.Release|Any CPU.Build.0 = Release|Any CPU
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+	GlobalSection(ExtensibilityGlobals) = postSolution
+		SolutionGuid = {9C219E8A-B739-4C47-A4E9-192248BC5DE1}
+	EndGlobalSection
+EndGlobal

+ 1 - 2
VB_DSM_V2.1/Scripts/Cmds/7085_gov.run.xml

@@ -1,7 +1,6 @@
 <component name="ProjectRunConfigurationManager">
   <configuration default="false" name="7085_gov" type="SpringBootApplicationConfigurationType" factoryName="Spring Boot">
-    <option name="ALTERNATIVE_JRE_PATH" value="1.8" />
-    <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="true" />
+    <option name="ACTIVE_PROFILES" value="dev" />
     <module name="vbdsm-gov-new" />
     <option name="SPRING_BOOT_MAIN_CLASS" value="cn.vbdsm.VbdsmGovNewApplication" />
     <method v="2">

+ 33 - 0
VB_DSM_V2.1/Scripts/Cmds/7087_charts.run.xml

@@ -0,0 +1,33 @@
+<component name="ProjectRunConfigurationManager">
+  <configuration default="false" name="7087_charts" type="MavenRunConfiguration" factoryName="Maven">
+    <MavenSettings>
+      <option name="myGeneralSettings" />
+      <option name="myRunnerSettings" />
+      <option name="myRunnerParameters">
+        <MavenRunnerParameters>
+          <option name="cmdOptions" />
+          <option name="profiles">
+            <set />
+          </option>
+          <option name="goals">
+            <list>
+              <option value="jetty:run" />
+            </list>
+          </option>
+          <option name="pomFileName" />
+          <option name="profilesMap">
+            <map>
+              <entry key="local" value="true" />
+            </map>
+          </option>
+          <option name="projectsCmdOptionValues">
+            <list />
+          </option>
+          <option name="resolveToWorkspace" value="false" />
+          <option name="workingDirPath" value="$PROJECT_DIR$/vbdsm-web/vbdsm-charts" />
+        </MavenRunnerParameters>
+      </option>
+    </MavenSettings>
+    <method v="2" />
+  </configuration>
+</component>

+ 1 - 1
VB_DSM_V2.1/Scripts/Cmds/7087_analysis.run.xml → VB_DSM_V2.1/Scripts/Cmds/7090_analysis.run.xml

@@ -1,5 +1,5 @@
 <component name="ProjectRunConfigurationManager">
-  <configuration default="false" name="7087_analysis" type="MavenRunConfiguration" factoryName="Maven">
+  <configuration default="false" name="7090_analysis" type="MavenRunConfiguration" factoryName="Maven">
     <MavenSettings>
       <option name="myGeneralSettings" />
       <option name="myRunnerSettings" />

+ 21 - 5
VB_DSM_V2.1/Scripts/Dockers/docker-compose.yml

@@ -2,7 +2,7 @@ version: '3'
 
 services:
   mysql:
-    image: mysql:5.7.4
+    image: mysql:5.7.24
     container_name: vbdsm-mysql
     restart: always
     environment:
@@ -14,7 +14,7 @@ services:
       # 数据挂载
       - /home/yue/vbdsm/mysql/data/:/var/lib/mysql/
       # 配置挂载
-      - /home/yue/vbdsm/mysql/conf/my.cnf:/etc/mysql/my.cnf
+      - /home/yue/vbdsm/mysql/conf/:/etc/mysql/
     privileged: true
 
     networks:
@@ -61,7 +61,7 @@ services:
 
   vber-server-passport:
     build: ../../vbdsm-web/vbdsm-passport
-    image: vbdsm-passport:2.1.0
+    image: vbdsm-passport:2.1.1
     container_name: vbdsm-passport
     restart: always
     ports:
@@ -162,13 +162,29 @@ services:
     networks:
       - vbdsm-net
 
+  vber-server-charts:
+    build: ../../vbdsm-web/vbdsm-charts
+    image: vbdsm-charts:2.1.0
+    container_name: vbdsm-charts
+    restart: always
+    ports:
+      - "7087:8080"
+    environment:
+      TZ: Asia/Shanghai
+    volumes:
+      # 日志文件
+      - /home/yue/vbdsm/server-logs/charts/:/vbdsm/logs/
+    privileged: true
+    networks:
+      - vbdsm-net
+
   vber-server-analysis:
     build: ../../vbdsm-statistics/vbdsm-analysis
     image: vbdsm-analysis:2.1.0
     container_name: vbdsm-analysis
     restart: always
     ports:
-      - "7087:8080"
+      - "7090:8080"
     environment:
       TZ: Asia/Shanghai
     volumes:
@@ -189,7 +205,7 @@ services:
     environment:
       # SERVER_PORT: 7200
       TZ: Asia/Shanghai
-      PARAMS: --server.port=7200 --spring.datasource.url=jdbc:mysql://47.112.30.247:4501/vbdsm_xxl_job?characterEncoding=UTF-8&serverTimezone=UTC&useSSL=false&useSSL=false
+      PARAMS: --server.port=7200 --spring.datasource.url=jdbc:mysql://vbdsm-mysql:3306/vbdsm_xxl_job?characterEncoding=UTF-8&serverTimezone=UTC&useSSL=false&useSSL=false
     volumes:
       # 日志文件
       - /home/yue/vbdsm/server-logs/job/:/vbdsm/logs/

+ 1 - 1
VB_DSM_V2.1/vbdsm-data-upload/vbdsm-acquis-ws/src/main/resources/local/redis-host.properties

@@ -1 +1 @@
-redis_ref_hosts=47.112.30.247:16379
+redis_ref_hosts=47.112.30.247:6399:Iwb-2017

+ 2 - 2
VB_DSM_V2.1/vbdsm-data-upload/vbdsm-hj212/vbdsm-hj212-datacollect/src/main/resources/config/application.yml

@@ -5,8 +5,8 @@ server:
 spring:
   redis:
     host: 47.112.30.247
-    #password: Iwb-2017
-    port: 16379
+    password: Iwb-2017
+    port: 6399
     database: 5
     lettuce:
       pool:

+ 3 - 3
VB_DSM_V2.1/vbdsm-data-upload/vbdsm-hj212/vbdsm-hj212-server/src/main/java/cn/vbdsm/hj212/server/executor/ReaTimeExector.java

@@ -50,7 +50,9 @@ public class ReaTimeExector implements IExecutor {
             request.getCtx().channel().writeAndFlush(response);
             return;
         }
-        time = time - time % 500;
+        //校正时间 15分钟间隔
+        time = time - (time - (time / 10000) * 10000) % 1500;
+
 
         log.debug(cp);
         DataUploadRequest dataUpload = DataUploadRequest.parse(cp);
@@ -61,8 +63,6 @@ public class ReaTimeExector implements IExecutor {
             OnlineTerminal onlineTerminal = new OnlineTerminal();
             onlineTerminal.setTerminalId(tid);
             MonitorCache entity = dataBiz.getMonitorByPk(cn, tid);
-            //Long entity = 20L;
-            //Long entity = null;
             if (entity != null) {
                 VbDsmBody body = dataUpload.getBody(tid);
                 if (body.getP() != null) {

+ 2 - 2
VB_DSM_V2.1/vbdsm-data-upload/vbdsm-hj212/vbdsm-hj212-server/src/main/resources/config/application.yml

@@ -10,8 +10,8 @@ vbdsm:
 spring:
   redis:
     host: 47.112.30.247
-    #password: Iwb-2017
-    port: 16379
+    password: Iwb-2017
+    port: 6399
     database: 5
     lettuce:
       pool:

+ 1 - 1
VB_DSM_V2.1/vbdsm-job/xxl-job-admin/src/main/resources/application.properties

@@ -18,7 +18,7 @@ spring.freemarker.settings.number_format=0.##########
 mybatis.mapper-locations=classpath:/mybatis-mapper/*Mapper.xml
 #mybatis.type-aliases-package=com.xxl.job.admin.core.model
 ### xxl-job, datasource
-spring.datasource.url=jdbc:mysql://47.112.30.247:23306/vbdsm_xxl_job?characterEncoding=UTF-8&serverTimezone=UTC&useSSL=false&useSSL=false
+spring.datasource.url=jdbc:mysql://47.112.30.247:4501/vbdsm_xxl_job?characterEncoding=UTF-8&serverTimezone=UTC&useSSL=false&useSSL=false
 spring.datasource.username=root
 spring.datasource.password=123456
 spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver

+ 1 - 1
VB_DSM_V2.1/vbdsm-statistics/vbdsm-analysis/pom.xml

@@ -123,7 +123,7 @@
                     <contextPath>/</contextPath>
                     <connectors>
                         <connector implementation="org.mortbay.jetty.nio.SelectChannelConnector">
-                            <port>7087</port>
+                            <port>7090</port>
                         </connector>
                     </connectors>
                     <scanIntervalSeconds>0</scanIntervalSeconds>

+ 128 - 129
VB_DSM_V2.1/vbdsm-statistics/vbdsm-analysis/src/main/java/cn/vbdsm/analysis/dao/AnalData24hEnergyDao.java

@@ -1,149 +1,148 @@
 package cn.vbdsm.analysis.dao;
 
-import java.text.SimpleDateFormat;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-
-import javax.annotation.Resource;
-import javax.core.common.jdbc.BaseDaoSupport;
-import javax.core.common.jdbc.QueryRule;
-import javax.sql.DataSource;
-
-import org.springframework.stereotype.Repository;
-
 import cn.vbdsm.analysis.model.AnalData24hEnergy;
 import cn.vbdsm.common.constants.DataSourceConstant;
 import cn.vbdsm.common.utils.DataSourceUtil;
 import cn.vbdsm.core.dao.datasource.DynamicDataSource;
 import cn.vbdsm.core.dao.datasource.DynamicDataSourceEntry;
+import org.springframework.stereotype.Repository;
+
+import javax.annotation.Resource;
+import javax.core.common.jdbc.BaseDaoSupport;
+import javax.core.common.jdbc.QueryRule;
+import javax.sql.DataSource;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
 
 /**
  * 日电量统计整点数据
- * 
+ *
  * @author Tanyongde
  * @version 1.0
  */
 @Repository
 public class AnalData24hEnergyDao extends BaseDaoSupport<AnalData24hEnergy, Long> {
 
-	private DynamicDataSourceEntry dynamicDataSourceEntry;
-	private SimpleDateFormat todaySdf = new SimpleDateFormat("yyyyMMdd");
+    private DynamicDataSourceEntry dynamicDataSourceEntry;
+    private final SimpleDateFormat todaySdf = new SimpleDateFormat("yyyyMMdd");
 //	private SimpleDateFormat fullSdf = new SimpleDateFormat("yyyyMMddHHmmss");
 
-	@Override
-	protected String getPKColumn() {
-		return "id";
-	}
-
-	/**
-	 * 配置动态数据源
-	 * 
-	 * @param dataSource
-	 */
-	@Resource(name="dynamicDataSource")
-	public void setDataSource(DataSource dataSource) {
-		dynamicDataSourceEntry = ((DynamicDataSource) dataSource).getDataSourceEntry();
-		super.setDataSourceReadOnly(dataSource);
-		super.setDataSourceWrite(dataSource);
-	}
-
-	public List<AnalData24hEnergy> selectByTime(List<String> terminalIds,Long getTime) {
-		
-		String today = todaySdf.format(new Date());
-		String time = getTime.toString().substring(0,8);
-		
-		
-		Long date = Long.valueOf(("" + getTime).substring(0,8));
-		Long hour = Long.valueOf(("" + getTime).substring(8,10));
-		
-		QueryRule queryRule = QueryRule.getInstance();
-		queryRule.andIn("terminalId", terminalIds);
-		queryRule.andEqual("getDate", date);
-		queryRule.andEqual("hour", hour);
-		
-		if(today.equals(time)){
-			dynamicDataSourceEntry.set(DataSourceConstant.DB_CURR);
-			this.setTableName(super.op.tableName);
-			return super.find(queryRule);
-		}else{//不是今天的查历史库
-			int year = Integer.valueOf(time.substring(0,4));
-			String month = time.substring(4,6);
-			this.setTableName(super.op.tableName + "_" + month);
-			dynamicDataSourceEntry.set(year);
-			List<AnalData24hEnergy> r = super.find(queryRule);
-			this.setTableName(super.op.tableName);
-			return r;
-		}
-	}
-	
-	public List<AnalData24hEnergy> selectByTimesAndTerminalIds(Long time,List<String> terminalIds){
-		if(null == terminalIds || terminalIds.size() == 0){return new ArrayList<AnalData24hEnergy>(); }
-		Date today = new Date();
-		Long todayTime = Long.valueOf(todaySdf.format(today));
-		
-		Long date = Long.valueOf(time.toString().substring(0,8));
-		QueryRule queryRule = QueryRule.getInstance();
-		queryRule.andEqual("getDate", date);
-		queryRule.andIn("terminalId", terminalIds);
-		//queryRule.addAscOrder("hour");
-		if(todayTime > time){
-			//根据年,月 切换到 年数据源,月分表
-			int year = DataSourceUtil.parse(time).get("year");
-			int month = DataSourceUtil.parse(time).get("month");
-			dynamicDataSourceEntry.set(year);
-			this.setTableName(DataSourceUtil.getTableName(super.op.tableName,month));
-			return super.find(queryRule);
-		}else{
-			dynamicDataSourceEntry.set(DataSourceConstant.DB_CURR);
-			this.setTableName(super.op.tableName);
-			return super.find(queryRule);
-		}
-	}
-	
-	public List<AnalData24hEnergy> selectByTimesAndTerminalIdForHistory(Long time,String terminalId){
-		QueryRule queryRule = QueryRule.getInstance();
-		queryRule.andEqual("getDate",Long.valueOf(time.toString().substring(0,8)));
-		queryRule.andEqual("terminalId",terminalId);
-		int year = DataSourceUtil.parse(time).get("year");
-		int month = DataSourceUtil.parse(time).get("month");
-		//queryRule.addAscOrder("hour");
-		dynamicDataSourceEntry.set(year);
-		this.setTableName(DataSourceUtil.getTableName(super.op.tableName,month));
-		return super.find(queryRule);
-	}
-	
-	
-	public int replaceForBatch(List<AnalData24hEnergy> data) throws Exception {
-		//保存到历史库
-		Long time = data.get(0).getGetDate();
-		if(time == 0){ return 0;}
-		//根据年,月 切换到 年数据源,月分表
-		int year = 0;
-		int month = 0;
-		try{
-			year = DataSourceUtil.parse(time).get("year");
-			month = DataSourceUtil.parse(time).get("month");
-			
-		}catch(Exception e){
-			
-		}
-		
-		if(0 == year || month == 0){
-			return 0;
-		}
-		
-//			LOG.error("replaceAll==========time=" + time + ",year=" + year + ",month=" + month);
-		dynamicDataSourceEntry.set(year);
-		this.setTableName(DataSourceUtil.getTableName(super.op.tableName,month));
-		this.replaceAll(data);
-	//		LOG.warn("成功写入" + data.size() + "条数据");
-			//		LOG.warn("成功写入" + data.size() + "条数据");
-		
-		//保存到实时库
-		this.setTableName(this.op.tableName);
-		dynamicDataSourceEntry.set(DataSourceConstant.DB_CURR);
-		return this.replaceAll(data);
-	}
+    @Override
+    protected String getPKColumn() {
+        return "id";
+    }
+
+    /**
+     * 配置动态数据源
+     *
+     * @param dataSource
+     */
+    @Resource(name = "dynamicDataSource")
+    public void setDataSource(DataSource dataSource) {
+        dynamicDataSourceEntry = ((DynamicDataSource) dataSource).getDataSourceEntry();
+        super.setDataSourceReadOnly(dataSource);
+        super.setDataSourceWrite(dataSource);
+    }
+
+    public List<AnalData24hEnergy> selectByTime(List<String> terminalIds, Long getTime) {
+
+        String today = todaySdf.format(new Date());
+        String time = getTime.toString().substring(0, 8);
+
+
+        Long date = Long.valueOf(("" + getTime).substring(0, 8));
+        Long hour = Long.valueOf(("" + getTime).substring(8, 10));
+
+        QueryRule queryRule = QueryRule.getInstance();
+        queryRule.andIn("terminalId", terminalIds);
+        queryRule.andEqual("getDate", date);
+        queryRule.andEqual("hour", hour);
+
+        if (today.equals(time)) {
+            dynamicDataSourceEntry.set(DataSourceConstant.DB_CURR);
+            this.setTableName(super.op.tableName);
+            return super.find(queryRule);
+        } else {//不是今天的查历史库
+            int year = Integer.valueOf(time.substring(0, 4));
+            String month = time.substring(4, 6);
+            this.setTableName(super.op.tableName + "_" + month);
+            dynamicDataSourceEntry.set(year);
+            List<AnalData24hEnergy> r = super.find(queryRule);
+            this.setTableName(super.op.tableName);
+            return r;
+        }
+    }
+
+    public List<AnalData24hEnergy> selectByTimesAndTerminalIds(Long time, List<String> terminalIds) {
+        if (null == terminalIds || terminalIds.size() == 0) {
+            return new ArrayList<AnalData24hEnergy>();
+        }
+        Date today = new Date();
+        Long todayTime = Long.valueOf(todaySdf.format(today));
+
+        Long date = Long.valueOf(time.toString().substring(0, 8));
+        QueryRule queryRule = QueryRule.getInstance();
+        queryRule.andEqual("getDate", date);
+        queryRule.andIn("terminalId", terminalIds);
+        //queryRule.addAscOrder("hour");
+        if (todayTime > time) {
+            //根据年,月 切换到 年数据源,月分表
+            int year = DataSourceUtil.parse(time).get("year");
+            int month = DataSourceUtil.parse(time).get("month");
+            dynamicDataSourceEntry.set(year);
+            this.setTableName(DataSourceUtil.getTableName(super.op.tableName, month));
+            return super.find(queryRule);
+        } else {
+            dynamicDataSourceEntry.set(DataSourceConstant.DB_CURR);
+            this.setTableName(super.op.tableName);
+            return super.find(queryRule);
+        }
+    }
+
+    public List<AnalData24hEnergy> selectByTimesAndTerminalIdForHistory(Long time, String terminalId) {
+        QueryRule queryRule = QueryRule.getInstance();
+        queryRule.andEqual("getDate", Long.valueOf(time.toString().substring(0, 8)));
+        queryRule.andEqual("terminalId", terminalId);
+        int year = DataSourceUtil.parse(time).get("year");
+        int month = DataSourceUtil.parse(time).get("month");
+        //queryRule.addAscOrder("hour");
+        dynamicDataSourceEntry.set(year);
+        this.setTableName(DataSourceUtil.getTableName(super.op.tableName, month));
+        return super.find(queryRule);
+    }
+
+
+    public int replaceForBatch(List<AnalData24hEnergy> data) throws Exception {
+        //保存到历史库
+        Long time = data.get(0).getGetDate();
+        if (time == 0) {
+            return 0;
+        }
+        //根据年,月 切换到 年数据源,月分表
+        int year = 0;
+        int month = 0;
+        try {
+            year = DataSourceUtil.parse(time).get("year");
+            month = DataSourceUtil.parse(time).get("month");
+
+        } catch (Exception e) {
+
+        }
+
+        if (0 == year || month == 0) {
+            return 0;
+        }
+
+        dynamicDataSourceEntry.set(year);
+        this.setTableName(DataSourceUtil.getTableName(super.op.tableName, month));
+        this.replaceAll(data);
+
+        //保存到实时库
+        this.setTableName(this.op.tableName);
+        dynamicDataSourceEntry.set(DataSourceConstant.DB_CURR);
+        return this.replaceAll(data);
+    }
 
 }

+ 254 - 261
VB_DSM_V2.1/vbdsm-statistics/vbdsm-analysis/src/main/java/cn/vbdsm/analysis/dao/OnlineDataEnergyDao.java

@@ -1,279 +1,272 @@
 package cn.vbdsm.analysis.dao;
 
-import java.text.ParseException;
-import java.text.SimpleDateFormat;
-import java.util.ArrayList;
-import java.util.Calendar;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.Date;
-import java.util.List;
-import java.util.Map;
+import cn.vbdsm.analysis.model.OnlineDataEnergy;
+import cn.vbdsm.common.constants.DataSourceConstant;
+import cn.vbdsm.common.utils.DataSourceUtil;
+import cn.vbdsm.core.dao.datasource.DynamicDataSource;
+import cn.vbdsm.core.dao.datasource.DynamicDataSourceEntry;
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONArray;
+import org.springframework.stereotype.Repository;
 
 import javax.annotation.Resource;
 import javax.core.common.jdbc.BaseDaoSupport;
 import javax.core.common.jdbc.QueryRule;
 import javax.core.common.utils.DateTime;
 import javax.sql.DataSource;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.*;
 
-import org.springframework.stereotype.Repository;
+@Repository
+public class OnlineDataEnergyDao extends BaseDaoSupport<OnlineDataEnergy, String> {
 
-import com.alibaba.fastjson.JSON;
-import com.alibaba.fastjson.JSONArray;
-import cn.vbdsm.analysis.model.OnlineDataEnergy;
-import cn.vbdsm.common.constants.DataSourceConstant;
-import cn.vbdsm.common.utils.DataSourceUtil;
-import cn.vbdsm.core.dao.datasource.DynamicDataSource;
-import cn.vbdsm.core.dao.datasource.DynamicDataSourceEntry;
+    private final static String PK_COLUMN = "terminalId";
+    private final SimpleDateFormat dateSdf = new SimpleDateFormat("yyyyMMdd");
+    private final SimpleDateFormat hourSdf = new SimpleDateFormat("yyyyMMddHH");
+    private DynamicDataSourceEntry dynamicDataSourceEntry;
 
-@Repository
-public class OnlineDataEnergyDao extends BaseDaoSupport<OnlineDataEnergy,String>{
-
-	private DynamicDataSourceEntry dynamicDataSourceEntry;
-	private final static String PK_COLUMN = "terminalId";
-	
-	private SimpleDateFormat dateSdf = new SimpleDateFormat("yyyyMMdd");
-	private SimpleDateFormat hourSdf = new SimpleDateFormat("yyyyMMddHH");
-	
 //	private Logger LOG = Logger.getLogger(this.getClass());
-	
-	@Override
-	protected String getPKColumn() {
-		return PK_COLUMN;
-	}
-
-	/**
-	 * 配置动态数据源
-	 * 
-	 * @param dataSource
-	 */
-	@Resource(name = "dynamicDataSource")
-	public void setDataSource(DataSource dataSource) {
-		dynamicDataSourceEntry = ((DynamicDataSource) dataSource).getDataSourceEntry();
-		this.setDataSourceReadOnly(dataSource);
-		this.setDataSourceWrite(dataSource);
-	}
-
-	
-	public List<OnlineDataEnergy> selectByTimeAndTerminalIds(Long time,List<String> terminalIds){
-		if(null == terminalIds || terminalIds.size() == 0){ return new ArrayList<OnlineDataEnergy>(); }
-		Date today = new Date();
-		Calendar c = Calendar.getInstance();
-		try {
-			c.setTime(dateSdf.parse(time.toString().substring(0,8)));
-		} catch (ParseException e1) {
-			e1.printStackTrace();
-		}
-		c.add(Calendar.DAY_OF_YEAR, 1);
-		Date tomrrow = c.getTime();
-		Long todayTime = Long.valueOf(dateSdf.format(today));
-		
-		QueryRule queryRule = QueryRule.getInstance();
-		try{
-			Long startTime = Long.valueOf(dateSdf.format(dateSdf.parse("" + time)) + "000000");
-			Long endTime = Long.valueOf(dateSdf.format(tomrrow) + "000000");
-			
-			queryRule.andBetween("getTime", startTime,endTime);
-			queryRule.andIn("terminalId", terminalIds);
+
+    /**
+     * 获取两个时间之间所有月份列表<br>传入格式为yyyyDDmm
+     *
+     * @param minDate
+     * @param maxDate
+     * @return
+     */
+    public static List<String> dateSplitAllMonth(String startDate, String endDate) {
+        ArrayList<String> result = new ArrayList<String>();
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");// 格式化为年月
+        try {
+            Calendar min = Calendar.getInstance();
+            Calendar max = Calendar.getInstance();
+
+            min.setTime(sdf.parse(startDate));
+            min.set(min.get(Calendar.YEAR), min.get(Calendar.MONTH), 1);
+
+            max.setTime(sdf.parse(endDate));
+            max.set(max.get(Calendar.YEAR), max.get(Calendar.MONTH), 2);
+
+            SimpleDateFormat sdf1 = new SimpleDateFormat("yyyyMM");// 格式化为年月
+            Calendar curr = min;
+            while (curr.before(max)) {
+                result.add(sdf1.format(curr.getTime()));
+                curr.add(Calendar.MONTH, 1);
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+
+        return result;
+    }
+
+    @Override
+    protected String getPKColumn() {
+        return PK_COLUMN;
+    }
+
+    /**
+     * 配置动态数据源
+     *
+     * @param dataSource
+     */
+    @Resource(name = "dynamicDataSource")
+    public void setDataSource(DataSource dataSource) {
+        dynamicDataSourceEntry = ((DynamicDataSource) dataSource).getDataSourceEntry();
+        this.setDataSourceReadOnly(dataSource);
+        this.setDataSourceWrite(dataSource);
+    }
+
+    public List<OnlineDataEnergy> selectByTimeAndTerminalIds(Long time, List<String> terminalIds) {
+        if (null == terminalIds || terminalIds.size() == 0) {
+            return new ArrayList<OnlineDataEnergy>();
+        }
+        Date today = new Date();
+        Calendar c = Calendar.getInstance();
+        try {
+            c.setTime(dateSdf.parse(time.toString().substring(0, 8)));
+        } catch (ParseException e1) {
+            e1.printStackTrace();
+        }
+        c.add(Calendar.DAY_OF_YEAR, 1);
+        Date tomrrow = c.getTime();
+        Long todayTime = Long.valueOf(dateSdf.format(today));
+
+        QueryRule queryRule = QueryRule.getInstance();
+        try {
+            Long startTime = Long.valueOf(dateSdf.format(dateSdf.parse("" + time)) + "000000");
+            Long endTime = Long.valueOf(dateSdf.format(tomrrow) + "000000");
+
+            queryRule.andBetween("getTime", startTime, endTime);
+            queryRule.andIn("terminalId", terminalIds);
 //			queryRule.addAscOrder("getTime");
-		}catch(Exception e){
-			return new ArrayList<OnlineDataEnergy>();
-		}
-		
-		if(todayTime > time){
-			//根据年,月 切换到 年数据源,月分表
-			int year = DataSourceUtil.parse(time).get("year");
-			int month = DataSourceUtil.parse(time).get("month");
-			dynamicDataSourceEntry.set(year);
-			this.setTableName(DataSourceUtil.getTableName(super.op.tableName,month));
-			List<OnlineDataEnergy> r = super.find(queryRule);
-			this.setTableName(super.op.tableName);
-			return r;
-		}else{
-			dynamicDataSourceEntry.set(DataSourceConstant.DB_CURR);
-			this.setTableName(super.op.tableName);
-			return super.find(queryRule);
-		}
-	}
-
-	public List<OnlineDataEnergy> selectByGetDateAndTerminalIds(Long getDate,List<String> terminalIds) {
-		QueryRule queryRule = QueryRule.getInstance();
-		try{
-			Long startTime = Long.valueOf(dateSdf.format(dateSdf.parse("" + getDate)) + "000000");
-			Long endTime = Long.valueOf(dateSdf.format(dateSdf.parse("" + getDate)) + "235959");
-			queryRule.andBetween("getTime", startTime,endTime);
-			queryRule.andIn("terminalId", terminalIds);
-			queryRule.addAscOrder("getTime");
-		}catch(Exception e){
-			return new ArrayList<OnlineDataEnergy>();
-		}
-		
-		//根据年,月 切换到 年数据源,月分表
-		int year = DataSourceUtil.parse(getDate).get("year");
-		int month = DataSourceUtil.parse(getDate).get("month");
-		dynamicDataSourceEntry.set(year);
-		this.setTableName(DataSourceUtil.getTableName(super.op.tableName,month));
-		List<OnlineDataEnergy> r = super.find(queryRule);
-		this.setTableName(super.op.tableName);
-		return r;
-	}
-	
-	
-	public List<OnlineDataEnergy> selectByHour(Date hour,String terminalId){
-		Calendar c = Calendar.getInstance();
-		c.setTime(hour);
-		
-		Long getDate = Long.valueOf(dateSdf.format(c.getTime()));
-		
-		c.add(Calendar.HOUR_OF_DAY, -1);
-		
-		Date start = c.getTime();
-		c.add(Calendar.HOUR_OF_DAY, 1);
-		
-		Date end = c.getTime();
-		
-		Long startTime = Long.valueOf(hourSdf.format(start) + "0000");
-		Long endTime = Long.valueOf(hourSdf.format(end) + "0000");
-		
-		int year = DataSourceUtil.parse(getDate).get("year");
-		int month = DataSourceUtil.parse(getDate).get("month");
-		String tableName = DataSourceUtil.getTableName(super.op.tableName,month);
-		
-		StringBuffer sql = new StringBuffer("");
-		sql.append("(select * from " + tableName + " where getTime BETWEEN " + startTime + " and " + endTime + " and terminalId = ? limit 0,1)");
-		sql.append("union all");
-		sql.append("(select * from " + tableName + " where getTime BETWEEN " + startTime + " and " + endTime + " and terminalId = ? limit 0,1)");
-		
-		dynamicDataSourceEntry.set(year);
-		List<Map<String, Object>> r = super.findBySql(sql.toString(),terminalId,terminalId);
-		List<OnlineDataEnergy> result = JSONArray.parseArray(JSON.toJSONString(r), OnlineDataEnergy.class);
-		Collections.sort(result,new Comparator<OnlineDataEnergy>() {
-
-			@Override
-			public int compare(OnlineDataEnergy o1, OnlineDataEnergy o2) {
-				if(o1.getGetTime() > o2.getGetTime()){
-					return 1;
-				}else if(o1.getGetTime() < o2.getGetTime()){
-					return  -1;
-				}else{
-					return 1;
-				}
-			}
-		});
-		
-		return result;
-	}
-	
-	
-	/**
-	 * 根据时间段查询所有电量实时数据
-	 * @param terminalId
-	 * @param start
-	 * @param end
-	 * @return
-	 */
-	public List<OnlineDataEnergy> selectByTerminalIdAndGetTime(String terminalId,Long start,Long end) {
-		super.setTableName(null);//数据源置空,后面将重新加载数据源
-		List<OnlineDataEnergy> dataList = new ArrayList<OnlineDataEnergy>();
-		if(DataSourceUtil.isSameDay(start, end)){ //同一天
+        } catch (Exception e) {
+            return new ArrayList<OnlineDataEnergy>();
+        }
+
+        if (todayTime > time) {
+            //根据年,月 切换到 年数据源,月分表
+            int year = DataSourceUtil.parse(time).get("year");
+            int month = DataSourceUtil.parse(time).get("month");
+            dynamicDataSourceEntry.set(year);
+            this.setTableName(DataSourceUtil.getTableName(super.op.tableName, month));
+            List<OnlineDataEnergy> r = super.find(queryRule);
+            this.setTableName(super.op.tableName);
+            return r;
+        } else {
+            dynamicDataSourceEntry.set(DataSourceConstant.DB_CURR);
+            this.setTableName(super.op.tableName);
+            return super.find(queryRule);
+        }
+    }
+
+    public List<OnlineDataEnergy> selectByGetDateAndTerminalIds(Long getDate, List<String> terminalIds) {
+        QueryRule queryRule = QueryRule.getInstance();
+        try {
+            Long startTime = Long.valueOf(dateSdf.format(dateSdf.parse("" + getDate)) + "000000");
+            Long endTime = Long.valueOf(dateSdf.format(dateSdf.parse("" + getDate)) + "235959");
+            queryRule.andBetween("getTime", startTime, endTime);
+            queryRule.andIn("terminalId", terminalIds);
+            queryRule.addAscOrder("getTime");
+        } catch (Exception e) {
+            return new ArrayList<OnlineDataEnergy>();
+        }
+
+        //根据年,月 切换到 年数据源,月分表
+        int year = DataSourceUtil.parse(getDate).get("year");
+        int month = DataSourceUtil.parse(getDate).get("month");
+        dynamicDataSourceEntry.set(year);
+        this.setTableName(DataSourceUtil.getTableName(super.op.tableName, month));
+        List<OnlineDataEnergy> r = super.find(queryRule);
+        this.setTableName(super.op.tableName);
+        return r;
+    }
+
+    public List<OnlineDataEnergy> selectByHour(Date hour, String terminalId) {
+        Calendar c = Calendar.getInstance();
+        c.setTime(hour);
+
+        Long getDate = Long.valueOf(dateSdf.format(c.getTime()));
+
+        c.add(Calendar.HOUR_OF_DAY, -1);
+        Date start = c.getTime();
+        c.add(Calendar.HOUR_OF_DAY, 1);
+        Date mid = c.getTime();
+        c.add(Calendar.HOUR_OF_DAY, 1);
+        Date end = c.getTime();
+
+        Long startTime = Long.valueOf(hourSdf.format(start) + "0000");
+        Long midTime = Long.valueOf(hourSdf.format(mid) + "0000");
+        Long endTime = Long.valueOf(hourSdf.format(end) + "0000");
+
+        int year = DataSourceUtil.parse(getDate).get("year");
+        int month = DataSourceUtil.parse(getDate).get("month");
+        String tableName = DataSourceUtil.getTableName(super.op.tableName, month);
+
+        String sql = "(select * from " + tableName + " where getTime BETWEEN " + startTime + " and " + midTime + " and terminalId = ? limit 0,1)" +
+                "union all" +
+                "(select * from " + tableName + " where getTime BETWEEN " + midTime + " and " + endTime + " and terminalId = ? limit 0,1)";
+
+        dynamicDataSourceEntry.set(year);
+        List<Map<String, Object>> r = super.findBySql(sql, terminalId, terminalId);
+        List<OnlineDataEnergy> result = JSONArray.parseArray(JSON.toJSONString(r), OnlineDataEnergy.class);
+        Collections.sort(result, new Comparator<OnlineDataEnergy>() {
+
+            @Override
+            public int compare(OnlineDataEnergy o1, OnlineDataEnergy o2) {
+                if (o1.getGetTime() > o2.getGetTime()) {
+                    return 1;
+                } else if (o1.getGetTime() < o2.getGetTime()) {
+                    return -1;
+                } else {
+                    return 1;
+                }
+            }
+        });
+
+        return result;
+    }
+
+    /**
+     * 根据时间段查询所有电量实时数据
+     *
+     * @param terminalId
+     * @param start
+     * @param end
+     * @return
+     */
+    public List<OnlineDataEnergy> selectByTerminalIdAndGetTime(String terminalId, Long start, Long end) {
+        super.setTableName(null);//数据源置空,后面将重新加载数据源
+        List<OnlineDataEnergy> dataList = new ArrayList<OnlineDataEnergy>();
+        if (DataSourceUtil.isSameDay(start, end)) { //同一天
 //			if(DataSourceUtil.isToday(start)) {//今天
 //				return getOnlineDataEnergyByTerminalId(terminalId, start, end);
 //			}
-			//不是今天,切换数据源和表查询数据
-			dynamicDataSourceEntry.set(DataSourceUtil.parse(start).get(DataSourceUtil.YEAR_KEY));
-			String tableName = DataSourceUtil.getTableName(super.getTableName(), DataSourceUtil.parse(start).get(DataSourceUtil.MONTH_KEY));
-			super.setTableName(tableName);
-			
-			return getOnlineDataEnergyByTerminalId(terminalId, start, end);
-		}
-		//不是同一天
-		String startDate = new DateTime(String.valueOf(start), DateTime.TYPE_YEAR_TO_SECOND,DateTime.TYPE_YEAR_TO_DAY).toString();
-		String endDate = new DateTime(String.valueOf(end), DateTime.TYPE_YEAR_TO_SECOND,DateTime.TYPE_YEAR_TO_DAY).toString();
-		List<String> monthList = dateSplitAllMonth(startDate, endDate);
-		for (String date : monthList) {
-			super.setTableName(null);//数据源置空,后面将重新加载数据源
-			dynamicDataSourceEntry.set(DataSourceUtil.parse(date).get(DataSourceUtil.YEAR_KEY));
-			String tableName = DataSourceUtil.getTableName(super.getTableName(), DataSourceUtil.parse(date).get(DataSourceUtil.MONTH_KEY));
-			super.setTableName(tableName);
-			List<OnlineDataEnergy> list = getOnlineDataEnergyByTerminalId(terminalId, start, end);
-			if(!list.isEmpty()){
-				dataList.addAll(list);
-			}
-		}
-		return dataList;
-	}
-	
-	
-	private List<OnlineDataEnergy> getOnlineDataEnergyByTerminalId(String terminalId,Long start,Long end) {
-		QueryRule queryRule = QueryRule.getInstance();
-		queryRule.andEqual("terminalId", terminalId);
-		queryRule.andGreaterEqual("getTime", start);
-		queryRule.andLessEqual("getTime", end);
-		queryRule.addAscOrder("getTime");
-		return super.find(queryRule);
-	}
-	
-	/**
-	 * 获取两个时间之间所有月份列表<br>传入格式为yyyyDDmm
-	 * @param minDate
-	 * @param maxDate
-	 * @return
-	 */
-	public static List<String> dateSplitAllMonth(String startDate, String endDate) {
-		ArrayList<String> result = new ArrayList<String>();
-		SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");// 格式化为年月
-		try {
-			Calendar min = Calendar.getInstance();
-			Calendar max = Calendar.getInstance();
-
-			min.setTime(sdf.parse(startDate));
-			min.set(min.get(Calendar.YEAR), min.get(Calendar.MONTH), 1);
-
-			max.setTime(sdf.parse(endDate));
-			max.set(max.get(Calendar.YEAR), max.get(Calendar.MONTH), 2);
-
-			SimpleDateFormat sdf1 = new SimpleDateFormat("yyyyMM");// 格式化为年月
-			Calendar curr = min;
-			while (curr.before(max)) {
-				result.add(sdf1.format(curr.getTime()));
-				curr.add(Calendar.MONTH, 1);
-			}
-		} catch (Exception e) {
-			e.printStackTrace();
-		}
-
-		return result;
-	}
-	
-	public int replaceForBatch(List<OnlineDataEnergy> data) throws Exception {
-		//保存到历史库
-		Long time = data.get(0).getGetTime();
-		if(time == 0){ return 0;}
-		//根据年,月 切换到 年数据源,月分表
-		int year = 0; 
-		int month = 0;
-		try{
-			year = DataSourceUtil.parse(time).get("year");
-			month = DataSourceUtil.parse(time).get("month");
-		}catch(Exception e){
-			
-		}
-		
-		if(0 == year || month == 0){
-			return 0;
-		}
-			
-	//			LOG.error("replaceAll==========time=" + time + ",year=" + year + ",month=" + month);
-	//		LOG.error("replaceAll,历史库" + year + month);
-		dynamicDataSourceEntry.set(year);
-		this.setTableName(DataSourceUtil.getTableName(super.op.tableName,month));
-		this.replaceAll(data);
-	//		LOG.warn("成功写入" + data.size() + "条数据");
-	
-	//保存到实时库
-		this.setTableName(super.op.tableName);
-		dynamicDataSourceEntry.set(DataSourceConstant.DB_CURR);
+            //不是今天,切换数据源和表查询数据
+            dynamicDataSourceEntry.set(DataSourceUtil.parse(start).get(DataSourceUtil.YEAR_KEY));
+            String tableName = DataSourceUtil.getTableName(super.getTableName(), DataSourceUtil.parse(start).get(DataSourceUtil.MONTH_KEY));
+            super.setTableName(tableName);
+
+            return getOnlineDataEnergyByTerminalId(terminalId, start, end);
+        }
+        //不是同一天
+        String startDate = new DateTime(String.valueOf(start), DateTime.TYPE_YEAR_TO_SECOND, DateTime.TYPE_YEAR_TO_DAY).toString();
+        String endDate = new DateTime(String.valueOf(end), DateTime.TYPE_YEAR_TO_SECOND, DateTime.TYPE_YEAR_TO_DAY).toString();
+        List<String> monthList = dateSplitAllMonth(startDate, endDate);
+        for (String date : monthList) {
+            super.setTableName(null);//数据源置空,后面将重新加载数据源
+            dynamicDataSourceEntry.set(DataSourceUtil.parse(date).get(DataSourceUtil.YEAR_KEY));
+            String tableName = DataSourceUtil.getTableName(super.getTableName(), DataSourceUtil.parse(date).get(DataSourceUtil.MONTH_KEY));
+            super.setTableName(tableName);
+            List<OnlineDataEnergy> list = getOnlineDataEnergyByTerminalId(terminalId, start, end);
+            if (!list.isEmpty()) {
+                dataList.addAll(list);
+            }
+        }
+        return dataList;
+    }
+
+    private List<OnlineDataEnergy> getOnlineDataEnergyByTerminalId(String terminalId, Long start, Long end) {
+        QueryRule queryRule = QueryRule.getInstance();
+        queryRule.andEqual("terminalId", terminalId);
+        queryRule.andGreaterEqual("getTime", start);
+        queryRule.andLessEqual("getTime", end);
+        queryRule.addAscOrder("getTime");
+        return super.find(queryRule);
+    }
+
+    public int replaceForBatch(List<OnlineDataEnergy> data) throws Exception {
+        //保存到历史库
+        Long time = data.get(0).getGetTime();
+        if (time == 0) {
+            return 0;
+        }
+        //根据年,月 切换到 年数据源,月分表
+        int year = 0;
+        int month = 0;
+        try {
+            year = DataSourceUtil.parse(time).get("year");
+            month = DataSourceUtil.parse(time).get("month");
+        } catch (Exception e) {
+
+        }
+
+        if (0 == year || month == 0) {
+            return 0;
+        }
+
+        //			LOG.error("replaceAll==========time=" + time + ",year=" + year + ",month=" + month);
+        //		LOG.error("replaceAll,历史库" + year + month);
+        dynamicDataSourceEntry.set(year);
+        this.setTableName(DataSourceUtil.getTableName(super.op.tableName, month));
+        this.replaceAll(data);
+        //		LOG.warn("成功写入" + data.size() + "条数据");
+
+        //保存到实时库
+        this.setTableName(super.op.tableName);
+        dynamicDataSourceEntry.set(DataSourceConstant.DB_CURR);
 //		LOG.error("replaceAll,实时库" + this.getTableName());
-		return this.replaceAll(data);
-	}
+        return this.replaceAll(data);
+    }
 }

Разница между файлами не показана из-за своего большого размера
+ 557 - 555
VB_DSM_V2.1/vbdsm-statistics/vbdsm-analysis/src/main/java/cn/vbdsm/analysis/timer/impl/FgpTimer.java


+ 104 - 90
VB_DSM_V2.1/vbdsm-statistics/vbdsm-analysis/src/main/java/cn/vbdsm/analysis/timer/impl/H24Timer.java

@@ -1,15 +1,5 @@
 package cn.vbdsm.analysis.timer.impl;
 
-import java.text.SimpleDateFormat;
-import java.util.Calendar;
-import java.util.Date;
-import java.util.List;
-
-import org.apache.log4j.Logger;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Component;
-
-import com.alibaba.fastjson.JSON;
 import cn.vbdsm.analysis.dao.AnalData24hEnergyDao;
 import cn.vbdsm.analysis.dao.MonitorDao;
 import cn.vbdsm.analysis.dao.OnlineDataEnergyDao;
@@ -17,85 +7,109 @@ import cn.vbdsm.analysis.model.AnalData24hEnergy;
 import cn.vbdsm.analysis.model.Monitor;
 import cn.vbdsm.analysis.model.OnlineDataEnergy;
 import cn.vbdsm.common.annotation.Comment;
+import cn.vbdsm.common.constants.CronExpression;
+import com.alibaba.fastjson.JSON;
+import org.apache.log4j.Logger;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.scheduling.annotation.Async;
+import org.springframework.scheduling.annotation.Scheduled;
+import org.springframework.stereotype.Component;
+
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.List;
 
 @Component
-@Comment("统计最值")
+@Comment("H24小时电能统计")
 public class H24Timer {
 
-	private SimpleDateFormat dateSdf = new SimpleDateFormat("yyyyMMddHH");
-	private SimpleDateFormat hourSdf = new SimpleDateFormat("yyyyMMddHH");
-	private SimpleDateFormat daySdf = new SimpleDateFormat("yyyyMMdd");
-	
-	@Autowired OnlineDataEnergyDao onlineDataEnergyDao;
-	@Autowired AnalData24hEnergyDao analData24hEnergyDao;
-	@Autowired MonitorDao monitorDao;
-	
-	private Logger LOG = Logger.getLogger(this.getClass());
-	
-	private void privateH24(Date hour,String terminalId,List<OnlineDataEnergy> online){
-		Calendar c = Calendar.getInstance();
-		c.setTime(hour);
-		Long getDate = Long.valueOf(dateSdf.format(c.getTime()));
-		int hourNum = c.get(Calendar.HOUR_OF_DAY);
-		
-		AnalData24hEnergy data = new AnalData24hEnergy();
-		data.setTerminalId(terminalId);
-		data.setGetDate(getDate);
-		data.setHour(hourNum);
-		
-		if(online.get(1).getFpe() != null && online.get(0).getFpe() != null){
-			data.setFpe(online.get(1).getFpe().subtract(online.get(0).getFpe()));
-		}
-		if(online.get(1).getFqe() != null && online.get(0).getFqe() != null){
-			data.setFqe(online.get(1).getFqe().subtract(online.get(0).getFqe()));
-		}
-		if(online.get(1).getTpe() != null && online.get(0).getTpe() != null){
-			data.setTpe(online.get(1).getTpe().subtract(online.get(0).getTpe()));
-		}
-		if(online.get(1).getTqe() != null && online.get(0).getTqe() != null){
-			data.setTqe(online.get(1).getTqe().subtract(online.get(0).getTqe()));
-		}
-		if(online.get(1).getFps() != null && online.get(0).getFps() != null){
-			data.setFps(online.get(1).getFps());
-		}
-		if(online.get(1).getFqs() != null && online.get(0).getFqs() != null){
-			data.setFqs(online.get(1).getFqs());
-		}
-		if(online.get(1).getTps() != null && online.get(0).getTps() != null){
-			data.setTps(online.get(1).getTps());
-		}
-		if(online.get(1).getTqs() != null && online.get(0).getTqs() != null){
-			data.setTqs(online.get(1).getTqs());
-		}
-		
-		boolean r = analData24hEnergyDao.replaceOne(data);
-		if(r){
-			LOG.info("已写入整点数据:" + JSON.toJSON(data));
-		}
-	}
-	
-	
-//	@Scheduled(cron=CronExpression.	)
-//	@Comment("")
-//	@Async
-	public void h24Timer(){
-		
-		List<Monitor> pm = monitorDao.selectAll();
-		
+    private final SimpleDateFormat dateSdf = new SimpleDateFormat("yyyyMMddHH");
+    private final SimpleDateFormat hourSdf = new SimpleDateFormat("yyyyMMddHH");
+    private final SimpleDateFormat daySdf = new SimpleDateFormat("yyyyMMdd");
+    private final Logger LOG = Logger.getLogger(this.getClass());
+    @Autowired
+    OnlineDataEnergyDao onlineDataEnergyDao;
+    @Autowired
+    AnalData24hEnergyDao analData24hEnergyDao;
+    @Autowired
+    MonitorDao monitorDao;
+
+    private void privateH24(Date hour, String terminalId, List<OnlineDataEnergy> online) {
+        Calendar c = Calendar.getInstance();
+        c.setTime(hour);
+        Long getDate = Long.valueOf(daySdf.format(c.getTime()));
+        int hourNum = c.get(Calendar.HOUR_OF_DAY);
+
+        ArrayList<AnalData24hEnergy> list = new ArrayList<AnalData24hEnergy>();
+        AnalData24hEnergy data = new AnalData24hEnergy();
+        data.setTerminalId(terminalId);
+        data.setGetDate(getDate);
+        data.setHour(hourNum);
+
+        if (online.get(1).getFpe() != null && online.get(0).getFpe() != null) {
+            data.setFpe(online.get(1).getFpe().subtract(online.get(0).getFpe()));
+        }
+        if (online.get(1).getFqe() != null && online.get(0).getFqe() != null) {
+            data.setFqe(online.get(1).getFqe().subtract(online.get(0).getFqe()));
+        }
+        if (online.get(1).getTpe() != null && online.get(0).getTpe() != null) {
+            data.setTpe(online.get(1).getTpe().subtract(online.get(0).getTpe()));
+        }
+        if (online.get(1).getTqe() != null && online.get(0).getTqe() != null) {
+            data.setTqe(online.get(1).getTqe().subtract(online.get(0).getTqe()));
+        }
+        if (online.get(1).getFps() != null && online.get(0).getFps() != null) {
+            data.setFps(online.get(1).getFps());
+        }
+        if (online.get(1).getFqs() != null && online.get(0).getFqs() != null) {
+            data.setFqs(online.get(1).getFqs());
+        }
+        if (online.get(1).getTps() != null && online.get(0).getTps() != null) {
+            data.setTps(online.get(1).getTps());
+        }
+        if (online.get(1).getTqs() != null && online.get(0).getTqs() != null) {
+            data.setTqs(online.get(1).getTqs());
+        }
+        list.add(data);
+
+        try {
+            //往历史库和实时库里同时更新记录
+            int r = analData24hEnergyDao.replaceForBatch(list);
+            if (r > 0) {
+                LOG.info("已写入整点数据:" + JSON.toJSON(list));
+            }
+        } catch (Exception e) {
+            LOG.error("整点数据报错:" + e.getMessage());
+        }
+    }
+
+
+    /**
+     * 每小时20分触发
+     */
+    @Scheduled(cron = CronExpression.EVERY_01_MINUTE_OF_HOUR)
+    @Comment("每个小时的第01分触发")
+    @Async
+    public void h24Timer() {
+
+        List<Monitor> pm = monitorDao.selectAll();
+
 //		List<Long> companyIds = new ArrayList<Long>();
 //		companyIds.add(621L);
 //		companyIds.add(622L);
 //		List<Monitor> pm = monitorDao.selectByCompanyIds(companyIds);
-		
-		Calendar c = Calendar.getInstance();
+
+        Calendar c = Calendar.getInstance();
 //		try{
 //			c.setTime(hourSdf.parse("2016102013"));
 //		}catch(Exception e){
 //			
 //		}
-		Date hour = new Date();
+        Date hour = new Date();
 //		Date hour = c.getTime();
-		
+
 //		for (int i = 0; i < 24 * 30 * 3; i++) {
 //			c.setTime(hour);
 //			c.add(Calendar.HOUR_OF_DAY, -i);
@@ -103,20 +117,20 @@ public class H24Timer {
 //			if(daySdf.format(c.getTime()).equals("20160831")){
 //				break;
 //			}
-			
-			int j = 1;
-			for (Monitor m : pm) {
-				LOG.info("时间:" + hourSdf.format(c.getTime()) + ",设备ID:" + m.getTerminalId()  + ",共" + pm.size() + "个设备,当前第" + j + "个");
-				List<OnlineDataEnergy> r = onlineDataEnergyDao.selectByHour(c.getTime(), m.getTerminalId());
-				if(r != null && r.size() == 2){
-					privateH24(hour,m.getTerminalId(),r);
-				}
-				j ++;
-			}
-			
+
+        int j = 1;
+        for (Monitor m : pm) {
+            LOG.info("时间:" + hourSdf.format(c.getTime()) + ",设备ID:" + m.getTerminalId() + ",共" + pm.size() + "个设备,当前第" + j + "个");
+            List<OnlineDataEnergy> r = onlineDataEnergyDao.selectByHour(c.getTime(), m.getTerminalId());
+            if (r != null && r.size() == 2) {
+                privateH24(hour, m.getTerminalId(), r);
+            }
+            j++;
+        }
+
 //		}
-		
-		
-	}
-	
+
+
+    }
+
 }

+ 436 - 436
VB_DSM_V2.1/vbdsm-statistics/vbdsm-analysis/src/main/java/cn/vbdsm/common/constants/CronExpression.java

@@ -4,443 +4,443 @@ import cn.vbdsm.common.annotation.Comment;
 
 /**
  * 定时任务表达式定义
+ *
  * @author Tanyongde
  */
 public class CronExpression {
-	
-	
-	/**
-	 * 每天0点0分30秒触发
-	 */
-	@Comment("每天0点0分30秒触发")
-	public static final String TIME_0_HOUR_0_MINUTE_30_SECOND = "30 0 0 * * ?";
-	
-	/**
-	 * 每天0点触发
-	 */
-	@Comment("每天0点触发")
-	public static final String TIME_0_HOUR = "0 0 0 * * ?";
-	
-	/**
-	 * 每天0点15分触发
-	 */
-	@Comment("每天0点15分触发")
-	public static final String TIME_0_HOUR_15_MINUTE = "0 15 0 * * ?";
-	
-	/**
-	 * 每天0点10分触发
-	 */
-	@Comment("每天0点10分触发")
-	public static final String TIME_0_HOUR_10_MINUTE = "0 10 0 * * ?";
-	
-	/**
-	 * 每天凌晨1点触发
-	 */
-	@Comment("每天凌晨1点触发")
-	public static final String TIME_1_HOUR = "0 0 1 * * ?";
-	
-	/**
-	 * 每天凌晨1点10分触发
-	 */
-	@Comment("每天凌晨1点10分触发")
-	public static final String TIME_1_10_HOUR = "0 10 1 * * ?";
-	
-	/**
-	 * 每天凌晨1点30分触发
-	 */
-	@Comment("每天凌晨1点30分触发")
-	public static final String TIME_1_30_HOUR = "0 30 1 * * ?";
-	
-	/**
-	 * 每天凌晨2点触发
-	 */
-	@Comment("每天凌晨2点触发")
-	public static final String TIME_2_HOUR = "0 0 2 * * ?";
-	
-	/**
-	 * 每天凌晨2点15分触发
-	 */
-	@Comment("每天凌晨2点10分触发")
-	public static final String TIME_2_10_HOUR = "0 10 2 * * ?";
-	
-	/**
-	 * 每天凌晨2点20分触发
-	 */
-	@Comment("每天凌晨2点20分触发")
-	public static final String TIME_2_20_HOUR = "0 20 2 * * ?";
-	
-	/**
-	 * 每天凌晨2点30分触发
-	 */
-	@Comment("每天凌晨2点30分触发")
-	public static final String TIME_2_30_HOUR = "0 30 2 * * ?";
-	
-	/**
-	 * 每天凌晨3点触发
-	 */
-	@Comment("每天凌晨3点触发")
-	public static final String TIME_3_HOUR = "0 0 3 * * ?";
-	
-	/**
-	 * 每天凌晨3点10分触发
-	 */
-	@Comment("每天凌晨3点10分触发")
-	public static final String TIME_3_10_HOUR = "0 10 3 * * ?";
-	
-	/**
-	 * 每天凌晨3点30分触发
-	 */
-	@Comment("每天凌晨3点30分触发")
-	public static final String TIME_3_30_HOUR = "0 30 3 * * ?";
-	
-	/**
-	 * 每天凌晨4点触发
-	 */
-	@Comment("每天凌晨4点触发")
-	public static final String TIME_4_HOUR = "0 0 4 * * ?";
-	
-	/**
-	 * 每天凌晨4点10分触发
-	 */
-	@Comment("每天凌晨4点10分触发")
-	public static final String TIME_4_10_HOUR = "0 10 4 * * ?";
-	
-	/**
-	 * 每天凌晨4点30分触发
-	 */
-	@Comment("每天凌晨4点30分触发")
-	public static final String TIME_4_30_HOUR = "0 30 4 * * ?";
-	
-	/**
-	 * 每天凌晨5点触发
-	 */
-	@Comment("每天凌晨5点触发")
-	public static final String TIME_5_HOUR = "0 0 5 * * ?";
-	
-	/**
-	 * 每天凌晨5点10分触发
-	 */
-	@Comment("每天凌晨5点10分触发")
-	public static final String TIME_5_10_HOUR = "0 10 5 * * ?";
-	
-	/**
-	 * 每天凌晨5点30分触发
-	 */
-	@Comment("每天凌晨5点30分触发")
-	public static final String TIME_5_30_HOUR = "0 30 5 * * ?";
-	
-	/**
-	 * 每天凌晨6点触发
-	 */
-	@Comment("每天凌晨6点触发")
-	public static final String TIME_6_HOUR = "0 0 6 * * ?";
-	
-	/**
-	 * 每天凌晨6点20分触发
-	 */
-	@Comment("每天凌晨6点20分触发")
-	public static final String TIME_6_20_HOUR = "0 20 6 * * ?";
-	
-	/**
-	 * 每天凌晨7点触发
-	 */
-	@Comment("每天凌晨7点触发")
-	public static final String TIME_7_HOUR = "0 0 7 * * ?";
-	
-	/**
-	 * 每天早上8点触发
-	 */
-	@Comment("每天上午8点触发")
-	public static final String TIME_8_HOUR = "0 0 8 * * ?";
-
-	/**
-	 * 每天9点触发
-	 */
-	@Comment("每天上午9点触发")
-	public static final String TIME_9_HOUR = "0 0 9 * * ?";
-	
-	/**
-	 * 每天10点触发
-	 */
-	@Comment("每天上午10点触发")
-	public static final String TIME_10_HOUR = "0 0 10 * * ?";
-	
-	/**
-	 * 每天11点触发
-	 */
-	@Comment("每天上午11点30分触发")
-	public static final String TIME_11_HOUR = "0 30 11 * * ?";
-	
-	/**
-	 * 每天中午12点触发
-	 */
-	@Comment("每天中午12点触发")
-	public static final String TIME_12_HOUR = "0 0 12 * * ?";
-	
-	/**
-	 * 每天中午13点触发
-	 */
-	@Comment("每天中午13点25分触发")
-	public static final String TIME_13_HOUR = "0 25 13 * * ?";
-	
-	/**
-	 * 每天下午14点触发
-	 */
-	@Comment("每天下午14点触发")
-	public static final String TIME_14_HOUR = "0 0 14 * * ?";
-	
-	/**
-	 * 每天下午15点触发
-	 */
-	@Comment("每天下午15点触发")
-	public static final String TIME_15_HOUR = "0 0 15 * * ?";
-	
-	/**
-	 * 每天下午16点触发
-	 */
-	@Comment("每天下午16点触发")
-	public static final String TIME_16_HOUR = "0 0 16 * * ?";
-	
-	/**
-	 * 每天下午17点触发
-	 */
-	@Comment("每天下午17点触发")
-	public static final String TIME_17_HOUR = "0 0 17 * * ?";
-	
-	/**
-	 * 每天下午18点触发
-	 */
-	@Comment("每天下午18点触发")
-	public static final String TIME_18_HOUR = "0 0 18 * * ?";
-	
-	/**
-	 * 每天下午19点触发
-	 */
-	@Comment("每天下午19点触发")
-	public static final String TIME_19_HOUR = "0 0 19 * * ?";
-	
-	/**
-	 * 每天晚上20点触发
-	 */
-	@Comment("每天晚上20点触发")
-	public static final String TIME_20_HOUR = "0 0 20 * * ?";
-	
-	/**
-	 * 每天晚上21点触发
-	 */
-	@Comment("每天晚上21点触发")
-	public static final String TIME_21_HOUR = "0 0 21 * * ?";
-	
-	/**
-	 * 每天晚上22点触发
-	 */
-	@Comment("每天晚上22点触发")
-	public static final String TIME_22_HOUR = "0 0 22 * * ?";
-	
-	/**
-	 * 每天晚上23点触发
-	 */
-	@Comment("每天晚上23点触发")
-	public static final String TIME_23_HOUR = "0 0 23 * * ?";
-	
-	/**
-	 * 每天晚上24点触发
-	 */
-	@Comment("每天晚上24点触发")
-	public static final String TIME_24_HOUR = "0 0 24 * * ?";
-	
-	/**
-	 * 每隔5秒钟触发
-	 */
-	@Comment("每隔5秒钟触发")
-	public static final String EVERY_5_SECOND = "0/5 * * * * ?";
-	
-	/**
-	 * 每隔5分钟触发
-	 */
-	@Comment("每隔5分钟触发")
-	public static final String EVERY_5_MINUTE = "0 0/5 * * * ?";
-	
-	/**
-	 * 每隔30分钟触发
-	 */
-	@Comment("每隔30分钟触发")
-	public static final String EVERY_30_MINUTE = "0 0/30 * * * ?";
-	
-	/**
-	 * 每隔1小时触发
-	 */
-	@Comment("每隔1小时触发")
-	public static final String EVERY_1_HOUR = "0 0 0/1 * * ?";
-	
-	/**
-	 * 每隔2小时触发
-	 */
-	@Comment("每隔2小时触发")
-	public static final String EVERY_2_HOUR = "0 0 0/2 * * ?";
-	
-	/**
-	 * 每隔3小时触发
-	 */
-	@Comment("每隔3小时触发")
-	public static final String EVERY_3_HOUR = "0 0 0/3 * * ?";
-	
-	
-	@Comment("每个小时的第5分钟触发")
-	public static final String EVERY_5_MINUTE_OF_HOUR = "0 5 * * * ?";
-	
-	
-	@Comment("每个小时的第40分钟触发")
-	public static final String EVERY_40_MINUTE_OF_HOUR = "0 40 * * * ?";
-	
-	@Comment("每天9点整,13点整,19点整触发 ")
-	public static final String TIME_9_HOUR_AND_13_HOUR_19_HOUR = "0 0 9,13,19 * * ?";
-	
-	@Comment("每天7点整,10点整,14点整触发 ")
-	public static final String TIME_7_HOUR_AND_10_HOUR_14_HOUR = "0 0 7,10,14 * * ?";
-	
-	@Comment("每月第一天凌晨2点触发")
-	public static final String TIME_2_HOUR_WHERE_FIRST_DAY_OF_MONTH = "0 0 2 1 * ?";
-	
-	@Comment("每年第一天早上6点触发")
-	public static final String TIME_6_HOUR_WHERE_FIRST_DAY_OF_YEAR = "0 0 6 1 1 ?";
-	
-	@Comment("2099年1月1号0点触发")
-	public static final String TIME_OUTHER = "0 0 0 * * ? 2099";
-	
-	/**
-	 * 每月1号3点15分触发
-	 */
-	@Comment("每月1号3点15分触发")
-	public static final String Month_FristDay_3_HOUR_15_MINUTE = "0 15 3 1 * ? *";
-	
-	
-	//=========================  常用表达式举例  ================================
-	
-	/**
-	 * 每天上午10点15分触发(写法1)
-	 */
-	@Comment("每天上午10点15分触发")
-	private static final String TIME_10_HOUR_15_MINUTE_1 = "0 15 10 ? *";
-	
-	/**
-	 * 每天上午10点15分触发(写法2)
-	 */
-	@Comment("每天上午10点15分触发")
-	private static final String TIME_10_HOUR_15_MINUTE_2 = "0 15 10 * * ?";
-	
-	/**
-	 * 每天上午10点15分触发(写法3)
-	 */
-	@Comment("每天上午10点15分触发")
-	private static final String TIME_10_HOUR_15_MINUTE_3 = "0 15 10 * * ? *";
-	
-	/**
-	 * 2005年的每天上午10:15触发
-	 */
-	@Comment("2005年的每天上午10:15触发")
-	private static final String TIME_10_HOUR_15_MINUTE_WHERE_2005_YEAR = "0 15 10 * * ? 2005";
-	
-	/**
-	 * 1970年的每天00:00触发
-	 */
-	@Comment("1970年的每天00:00触发")
-	public static final String TIME_10_HOUR_15_MINUTE_WHERE_1970_YEAR = "0 0 0 * * ? 1970";
-	
-	/**
-	 * 每年三月的星期三的下午2:10和2:44触发
-	 */
-	@Comment("每年三月的星期三的下午2:10和2:44触发")
-	private static final String TIME_14_HOUR_10_MINUTE_AND_14_HOUR_44_MINUTE_WHERE_WEDNESDAY_AND_MARCH = "0 10,44 14 ? 3 WED";
-
-	/**
-	 * 周一至周五的上午10:15触发
-	 */
-	@Comment("周一至周五的上午10:15触发")
-	private static final String TIME_10_HOUR_15_MINUTE_WHERE_MONDAY_TO_FRIDAY = "0 15 10 ? * MON-FRI";
-	
-	/**
-	 * 每月15日上午10:15触发
-	 */
-	@Comment("每月15日上午10:15触发")
-	private static final String TIME_10_HOUR_15_MINUTE_WHERE_ERERY_MONTH = "0 15 10 15 * ?";
-	
-	/** 
-	 *每月最后一日的上午10:15触发
-	 */
-	@Comment("每月最后一日的上午10:15触发")
-	private static final String TIME_10_HOUR_15_MINUTE_WHERE_LAST_DAY_OF_MONTH = "0 15 10 L * ?";
-	
-	/**
-	 * 每月的最后一个星期五上午10:15触发
-	 */
-	@Comment("每月的最后一个星期五上午10:15触发")
-	private static final String TIME_10_HOUR_15_MINUTE_WHERE_LAST_FRIDAY_OF_MONTH = "0 15 10 ? * 6L";
-	
-	/**
-	 * 2002年至2005年的每月的最后一个星期五上午10:15触发
-	 */
-	@Comment("2002年至2005年的每月的最后一个星期五上午10:15触发")
-	private static final String TIME_10_HOUR_15_MINUTE_WHERE_LAST_FRIDAY_OF_MONTH_AND_2002_YEAR_TO_2005_YEAR = "0 15 10 ? * 6L 2002-2005";
-	
-	/**
-	 * 每月的第三个星期五上午10:15触发
-	 */
-	@Comment("每月的第三个星期五上午10:15触发")
-	private static final String TIME_10_HOUR_15_MINUTE_WHERE_THIRD_FRIDAY_OF_MONTH = "0 15 10 ? * 6#3";
-	
-	/**
-	 * 每个月的4号和每个周一和周三的早上11点触发
-	 */
-	@Comment("每个月的4号和每个周一和周三的早上11点触发")
-	private static final String TIME_11_HOUR_WHERE_FOURTH_DAY_OF_MONTH_AND_MONDAY_AND_WEDNESDAY = "0 11 4 * 1-3";
-	
-	/**
-	 * 每年1月1日早上4点触发
-	 */
-	@Comment("每年1月1日早上4点触发")
-	private static final String TIME_4_HOUR_WHERE_FIRST_DAY_OF_YEAR = "0 4 1 1 *";
-	
-	/**
-	 * 在每周三和周五的10:30,11:30,12:30触发
-	 */
-	@Comment("在每周三和周五的10:30,11:30,12:30触发")
-	private static final String TIME_30_MINUTE_WHERE_10_HOUR_TO_13_HOUR_AND_WEDNESDAY_AND_FRIDAY = "0 30 10-13 ? *WED,FRI";
-	
-	/**
-	 * 在每天下午2点到下午2:59期间的每1分钟触发
-	 */
-	@Comment("在每天下午2点到下午2:59期间的每1分钟触发")
-	private static final String EVERY_1_MINUTE_WHERE_14_HOUR_TO_14_HOUR_1_MINUTE = "0 * 14 * * ?";
-	
-	/**
-	 * 在每天下午2点到下午2:55期间的每5分钟触发 
-	 */
-	@Comment("在每天下午2点到下午2:55期间的每5分钟触发")
-	private static final String EVERY_5_MINUTE_WHERE_14_HOUR_TO_14_HOUR_55_MINUTE = "0 0/5 14 * * ?";
-	
-	/**
-	 * 在每天下午2点到2:55期间和下午6点到6:55期间的每5分钟触发 
-	 */
-	@Comment("在每天下午2点到2:55期间和下午6点到6:55期间的每5分钟触发 ")
-	private static final String EVERY_5_MINUTE_WHERE_14_HOUR_55_MINUTE_TO_18_HOUR_55_MINUTE = "0 0/5 14,18 * * ?";
-
-	/**
-	 * 在每天下午2点到下午2:05期间的每1分钟触发 
-	 */
-	@Comment("在每天下午2点到下午2:05期间的每1分钟触发")
-	private static final String EVERY_1_MINUTE_WHERE_14_HOUR_TO_14_HOUR_55_MINUTE = "0 0-5 14 * * ?";
-	
-	/**
-	 * 每天晚上11点到早上8点之间每两个小时触发一次
-	 */
-	@Comment("每天晚上11点到早上8点之间每两个小时触发")
-	private static final String EVERY_2_HOUR_WHERE_23_HOUR_TO_8_HOUR = "0 23-7/2,8 * * *";
-	
-	/**
-	 * 在每分钟的10秒后每隔5分钟触发(例如. 10:00:10 am, 10:05:10等)
-	 */
-	@Comment("在每分钟的10秒后每隔5分钟触发")
-	private static final String EVERY_5_MINUTE_WHERE_AFTER_10_SECOND_OF_MINUTE = "10 0/5 * * *?";
-	
+
+
+    /**
+     * 每天0点0分30秒触发
+     */
+    @Comment("每天0点0分30秒触发")
+    public static final String TIME_0_HOUR_0_MINUTE_30_SECOND = "30 0 0 * * ?";
+
+    /**
+     * 每天0点触发
+     */
+    @Comment("每天0点触发")
+    public static final String TIME_0_HOUR = "0 0 0 * * ?";
+
+    /**
+     * 每天0点15分触发
+     */
+    @Comment("每天0点15分触发")
+    public static final String TIME_0_HOUR_15_MINUTE = "0 15 0 * * ?";
+
+    /**
+     * 每天0点10分触发
+     */
+    @Comment("每天0点10分触发")
+    public static final String TIME_0_HOUR_10_MINUTE = "0 10 0 * * ?";
+
+    /**
+     * 每天凌晨1点触发
+     */
+    @Comment("每天凌晨1点触发")
+    public static final String TIME_1_HOUR = "0 0 1 * * ?";
+
+    /**
+     * 每天凌晨1点10分触发
+     */
+    @Comment("每天凌晨1点10分触发")
+    public static final String TIME_1_10_HOUR = "0 10 1 * * ?";
+
+    /**
+     * 每天凌晨1点30分触发
+     */
+    @Comment("每天凌晨1点30分触发")
+    public static final String TIME_1_30_HOUR = "0 30 1 * * ?";
+
+    /**
+     * 每天凌晨2点触发
+     */
+    @Comment("每天凌晨2点触发")
+    public static final String TIME_2_HOUR = "0 0 2 * * ?";
+
+    /**
+     * 每天凌晨2点15分触发
+     */
+    @Comment("每天凌晨2点10分触发")
+    public static final String TIME_2_10_HOUR = "0 10 2 * * ?";
+
+    /**
+     * 每天凌晨2点20分触发
+     */
+    @Comment("每天凌晨2点20分触发")
+    public static final String TIME_2_20_HOUR = "0 20 2 * * ?";
+
+    /**
+     * 每天凌晨2点30分触发
+     */
+    @Comment("每天凌晨2点30分触发")
+    public static final String TIME_2_30_HOUR = "0 30 2 * * ?";
+
+    /**
+     * 每天凌晨3点触发
+     */
+    @Comment("每天凌晨3点触发")
+    public static final String TIME_3_HOUR = "0 0 3 * * ?";
+
+    /**
+     * 每天凌晨3点10分触发
+     */
+    @Comment("每天凌晨3点10分触发")
+    public static final String TIME_3_10_HOUR = "0 10 3 * * ?";
+
+    /**
+     * 每天凌晨3点30分触发
+     */
+    @Comment("每天凌晨3点30分触发")
+    public static final String TIME_3_30_HOUR = "0 30 3 * * ?";
+
+    /**
+     * 每天凌晨4点触发
+     */
+    @Comment("每天凌晨4点触发")
+    public static final String TIME_4_HOUR = "0 0 4 * * ?";
+
+    /**
+     * 每天凌晨4点10分触发
+     */
+    @Comment("每天凌晨4点10分触发")
+    public static final String TIME_4_10_HOUR = "0 10 4 * * ?";
+
+    /**
+     * 每天凌晨4点30分触发
+     */
+    @Comment("每天凌晨4点30分触发")
+    public static final String TIME_4_30_HOUR = "0 30 4 * * ?";
+
+    /**
+     * 每天凌晨5点触发
+     */
+    @Comment("每天凌晨5点触发")
+    public static final String TIME_5_HOUR = "0 0 5 * * ?";
+
+    /**
+     * 每天凌晨5点10分触发
+     */
+    @Comment("每天凌晨5点10分触发")
+    public static final String TIME_5_10_HOUR = "0 10 5 * * ?";
+
+    /**
+     * 每天凌晨5点30分触发
+     */
+    @Comment("每天凌晨5点30分触发")
+    public static final String TIME_5_30_HOUR = "0 30 5 * * ?";
+
+    /**
+     * 每天凌晨6点触发
+     */
+    @Comment("每天凌晨6点触发")
+    public static final String TIME_6_HOUR = "0 0 6 * * ?";
+
+    /**
+     * 每天凌晨6点20分触发
+     */
+    @Comment("每天凌晨6点20分触发")
+    public static final String TIME_6_20_HOUR = "0 20 6 * * ?";
+
+    /**
+     * 每天凌晨7点触发
+     */
+    @Comment("每天凌晨7点触发")
+    public static final String TIME_7_HOUR = "0 0 7 * * ?";
+
+    /**
+     * 每天早上8点触发
+     */
+    @Comment("每天上午8点触发")
+    public static final String TIME_8_HOUR = "0 0 8 * * ?";
+
+    /**
+     * 每天9点触发
+     */
+    @Comment("每天上午9点触发")
+    public static final String TIME_9_HOUR = "0 0 9 * * ?";
+
+    /**
+     * 每天10点触发
+     */
+    @Comment("每天上午10点触发")
+    public static final String TIME_10_HOUR = "0 0 10 * * ?";
+
+    /**
+     * 每天11点触发
+     */
+    @Comment("每天上午11点30分触发")
+    public static final String TIME_11_HOUR = "0 30 11 * * ?";
+
+    /**
+     * 每天中午12点触发
+     */
+    @Comment("每天中午12点触发")
+    public static final String TIME_12_HOUR = "0 0 12 * * ?";
+
+    /**
+     * 每天中午13点触发
+     */
+    @Comment("每天中午13点25分触发")
+    public static final String TIME_13_HOUR = "0 25 13 * * ?";
+
+    /**
+     * 每天下午14点触发
+     */
+    @Comment("每天下午14点触发")
+    public static final String TIME_14_HOUR = "0 0 14 * * ?";
+
+    /**
+     * 每天下午15点触发
+     */
+    @Comment("每天下午15点触发")
+    public static final String TIME_15_HOUR = "0 0 15 * * ?";
+
+    /**
+     * 每天下午16点触发
+     */
+    @Comment("每天下午16点触发")
+    public static final String TIME_16_HOUR = "0 0 16 * * ?";
+
+    /**
+     * 每天下午17点触发
+     */
+    @Comment("每天下午17点触发")
+    public static final String TIME_17_HOUR = "0 0 17 * * ?";
+
+    /**
+     * 每天下午18点触发
+     */
+    @Comment("每天下午18点触发")
+    public static final String TIME_18_HOUR = "0 0 18 * * ?";
+
+    /**
+     * 每天下午19点触发
+     */
+    @Comment("每天下午19点触发")
+    public static final String TIME_19_HOUR = "0 0 19 * * ?";
+
+    /**
+     * 每天晚上20点触发
+     */
+    @Comment("每天晚上20点触发")
+    public static final String TIME_20_HOUR = "0 0 20 * * ?";
+
+    /**
+     * 每天晚上21点触发
+     */
+    @Comment("每天晚上21点触发")
+    public static final String TIME_21_HOUR = "0 0 21 * * ?";
+
+    /**
+     * 每天晚上22点触发
+     */
+    @Comment("每天晚上22点触发")
+    public static final String TIME_22_HOUR = "0 0 22 * * ?";
+
+    /**
+     * 每天晚上23点触发
+     */
+    @Comment("每天晚上23点触发")
+    public static final String TIME_23_HOUR = "0 0 23 * * ?";
+
+    /**
+     * 每天晚上24点触发
+     */
+    @Comment("每天晚上24点触发")
+    public static final String TIME_24_HOUR = "0 0 24 * * ?";
+
+    /**
+     * 每隔5秒钟触发
+     */
+    @Comment("每隔5秒钟触发")
+    public static final String EVERY_5_SECOND = "0/5 * * * * ?";
+
+    /**
+     * 每隔5分钟触发
+     */
+    @Comment("每隔5分钟触发")
+    public static final String EVERY_5_MINUTE = "0 0/5 * * * ?";
+
+    /**
+     * 每隔30分钟触发
+     */
+    @Comment("每隔30分钟触发")
+    public static final String EVERY_30_MINUTE = "0 0/30 * * * ?";
+
+    /**
+     * 每隔1小时触发
+     */
+    @Comment("每隔1小时触发")
+    public static final String EVERY_1_HOUR = "0 0 0/1 * * ?";
+
+    /**
+     * 每隔2小时触发
+     */
+    @Comment("每隔2小时触发")
+    public static final String EVERY_2_HOUR = "0 0 0/2 * * ?";
+
+    /**
+     * 每隔3小时触发
+     */
+    @Comment("每隔3小时触发")
+    public static final String EVERY_3_HOUR = "0 0 0/3 * * ?";
+
+
+    @Comment("每个小时的第5分钟触发")
+    public static final String EVERY_5_MINUTE_OF_HOUR = "0 5 * * * ?";
+
+
+    @Comment("每个小时的第40分钟触发")
+    public static final String EVERY_40_MINUTE_OF_HOUR = "0 40 * * * ?";
+
+    @Comment("每天9点整,13点整,19点整触发 ")
+    public static final String TIME_9_HOUR_AND_13_HOUR_19_HOUR = "0 0 9,13,19 * * ?";
+
+    @Comment("每天7点整,10点整,14点整触发 ")
+    public static final String TIME_7_HOUR_AND_10_HOUR_14_HOUR = "0 0 7,10,14 * * ?";
+
+    @Comment("每月第一天凌晨2点触发")
+    public static final String TIME_2_HOUR_WHERE_FIRST_DAY_OF_MONTH = "0 0 2 1 * ?";
+
+    @Comment("每年第一天早上6点触发")
+    public static final String TIME_6_HOUR_WHERE_FIRST_DAY_OF_YEAR = "0 0 6 1 1 ?";
+
+    @Comment("2099年1月1号0点触发")
+    public static final String TIME_OUTHER = "0 0 0 * * ? 2099";
+
+    /**
+     * 每月1号3点15分触发
+     */
+    @Comment("每月1号3点15分触发")
+    public static final String Month_FristDay_3_HOUR_15_MINUTE = "0 15 3 1 * ? *";
+    /**
+     * 每月1号3点15分触发
+     */
+    @Comment("每个小时的第01分触发")
+    public static final String EVERY_01_MINUTE_OF_HOUR = "0 01 * * * ?";
+
+
+    //=========================  常用表达式举例  ================================
+    /**
+     * 1970年的每天00:00触发
+     */
+    @Comment("1970年的每天00:00触发")
+    public static final String TIME_10_HOUR_15_MINUTE_WHERE_1970_YEAR = "0 0 0 * * ? 1970";
+    /**
+     * 每天上午10点15分触发(写法1)
+     */
+    @Comment("每天上午10点15分触发")
+    private static final String TIME_10_HOUR_15_MINUTE_1 = "0 15 10 ? *";
+    /**
+     * 每天上午10点15分触发(写法2)
+     */
+    @Comment("每天上午10点15分触发")
+    private static final String TIME_10_HOUR_15_MINUTE_2 = "0 15 10 * * ?";
+    /**
+     * 每天上午10点15分触发(写法3)
+     */
+    @Comment("每天上午10点15分触发")
+    private static final String TIME_10_HOUR_15_MINUTE_3 = "0 15 10 * * ? *";
+    /**
+     * 2005年的每天上午10:15触发
+     */
+    @Comment("2005年的每天上午10:15触发")
+    private static final String TIME_10_HOUR_15_MINUTE_WHERE_2005_YEAR = "0 15 10 * * ? 2005";
+    /**
+     * 每年三月的星期三的下午2:10和2:44触发
+     */
+    @Comment("每年三月的星期三的下午2:10和2:44触发")
+    private static final String TIME_14_HOUR_10_MINUTE_AND_14_HOUR_44_MINUTE_WHERE_WEDNESDAY_AND_MARCH = "0 10,44 14 ? 3 WED";
+
+    /**
+     * 周一至周五的上午10:15触发
+     */
+    @Comment("周一至周五的上午10:15触发")
+    private static final String TIME_10_HOUR_15_MINUTE_WHERE_MONDAY_TO_FRIDAY = "0 15 10 ? * MON-FRI";
+
+    /**
+     * 每月15日上午10:15触发
+     */
+    @Comment("每月15日上午10:15触发")
+    private static final String TIME_10_HOUR_15_MINUTE_WHERE_ERERY_MONTH = "0 15 10 15 * ?";
+
+    /**
+     * 每月最后一日的上午10:15触发
+     */
+    @Comment("每月最后一日的上午10:15触发")
+    private static final String TIME_10_HOUR_15_MINUTE_WHERE_LAST_DAY_OF_MONTH = "0 15 10 L * ?";
+
+    /**
+     * 每月的最后一个星期五上午10:15触发
+     */
+    @Comment("每月的最后一个星期五上午10:15触发")
+    private static final String TIME_10_HOUR_15_MINUTE_WHERE_LAST_FRIDAY_OF_MONTH = "0 15 10 ? * 6L";
+
+    /**
+     * 2002年至2005年的每月的最后一个星期五上午10:15触发
+     */
+    @Comment("2002年至2005年的每月的最后一个星期五上午10:15触发")
+    private static final String TIME_10_HOUR_15_MINUTE_WHERE_LAST_FRIDAY_OF_MONTH_AND_2002_YEAR_TO_2005_YEAR = "0 15 10 ? * 6L 2002-2005";
+
+    /**
+     * 每月的第三个星期五上午10:15触发
+     */
+    @Comment("每月的第三个星期五上午10:15触发")
+    private static final String TIME_10_HOUR_15_MINUTE_WHERE_THIRD_FRIDAY_OF_MONTH = "0 15 10 ? * 6#3";
+
+    /**
+     * 每个月的4号和每个周一和周三的早上11点触发
+     */
+    @Comment("每个月的4号和每个周一和周三的早上11点触发")
+    private static final String TIME_11_HOUR_WHERE_FOURTH_DAY_OF_MONTH_AND_MONDAY_AND_WEDNESDAY = "0 11 4 * 1-3";
+
+    /**
+     * 每年1月1日早上4点触发
+     */
+    @Comment("每年1月1日早上4点触发")
+    private static final String TIME_4_HOUR_WHERE_FIRST_DAY_OF_YEAR = "0 4 1 1 *";
+
+    /**
+     * 在每周三和周五的10:30,11:30,12:30触发
+     */
+    @Comment("在每周三和周五的10:30,11:30,12:30触发")
+    private static final String TIME_30_MINUTE_WHERE_10_HOUR_TO_13_HOUR_AND_WEDNESDAY_AND_FRIDAY = "0 30 10-13 ? *WED,FRI";
+
+    /**
+     * 在每天下午2点到下午2:59期间的每1分钟触发
+     */
+    @Comment("在每天下午2点到下午2:59期间的每1分钟触发")
+    private static final String EVERY_1_MINUTE_WHERE_14_HOUR_TO_14_HOUR_1_MINUTE = "0 * 14 * * ?";
+
+    /**
+     * 在每天下午2点到下午2:55期间的每5分钟触发
+     */
+    @Comment("在每天下午2点到下午2:55期间的每5分钟触发")
+    private static final String EVERY_5_MINUTE_WHERE_14_HOUR_TO_14_HOUR_55_MINUTE = "0 0/5 14 * * ?";
+
+    /**
+     * 在每天下午2点到2:55期间和下午6点到6:55期间的每5分钟触发
+     */
+    @Comment("在每天下午2点到2:55期间和下午6点到6:55期间的每5分钟触发 ")
+    private static final String EVERY_5_MINUTE_WHERE_14_HOUR_55_MINUTE_TO_18_HOUR_55_MINUTE = "0 0/5 14,18 * * ?";
+
+    /**
+     * 在每天下午2点到下午2:05期间的每1分钟触发
+     */
+    @Comment("在每天下午2点到下午2:05期间的每1分钟触发")
+    private static final String EVERY_1_MINUTE_WHERE_14_HOUR_TO_14_HOUR_55_MINUTE = "0 0-5 14 * * ?";
+
+    /**
+     * 每天晚上11点到早上8点之间每两个小时触发一次
+     */
+    @Comment("每天晚上11点到早上8点之间每两个小时触发")
+    private static final String EVERY_2_HOUR_WHERE_23_HOUR_TO_8_HOUR = "0 23-7/2,8 * * *";
+
+    /**
+     * 在每分钟的10秒后每隔5分钟触发(例如. 10:00:10 am, 10:05:10等)
+     */
+    @Comment("在每分钟的10秒后每隔5分钟触发")
+    private static final String EVERY_5_MINUTE_WHERE_AFTER_10_SECOND_OF_MINUTE = "10 0/5 * * *?";
+
 }

+ 1 - 1
VB_DSM_V2.1/vbdsm-statistics/vbdsm-analysis/src/main/resources/local/redis-host.properties

@@ -1 +1 @@
-redis_ref_hosts=47.112.30.247:16379
+redis_ref_hosts=47.112.30.247:6399:Iwb-2017

+ 43 - 39
VB_DSM_V2.1/vbdsm-statistics/vbdsm-analysis/src/main/resources/local/schedule.xml

@@ -1,56 +1,60 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <timers>
 
-   	<timer>clearLogsTimer.clearHistroyLog</timer>
-   	<timer>clearBibleWaringInfoTimer.clearHistroy</timer>
-   	<!-- <timer>energyPriceTimer.energyPrice</timer> -->
+    <timer>clearLogsTimer.clearHistroyLog</timer>
+    <timer>clearBibleWaringInfoTimer.clearHistroy</timer>
+    <!-- <timer>energyPriceTimer.energyPrice</timer> -->
 
-   	<timer>fgpTimer.companyFgp</timer>
-   	<timer>fgpTimer.companyFgpForLastDate</timer>
-   	<timer>fgpTimer.companyFgpFor7DaysAgo</timer>
-   	<!-- <timer>fgpTimer.companyFgpForYestDayDate</timer> -->
+    <timer>fgpTimer.companyFgp</timer>
+    <timer>fgpTimer.companyFgpForLastDate</timer>
+    <timer>fgpTimer.companyFgpFor7DaysAgo</timer>
+    <!-- <timer>fgpTimer.companyFgpForYestDayDate</timer> -->
 
-   	<timer>fgpTimer.monitorFgpForEvery</timer>
-   	<timer>fgpTimer.monitorFgpForLastDate</timer>
-   	<timer>fgpTimer.monitorFgpFor7DaysAgo</timer>
-   	<!-- <timer>fgpTimer.monitorFgpForYestDayDate</timer> -->
+    <timer>fgpTimer.monitorFgpForEvery</timer>
+    <timer>fgpTimer.monitorFgpForLastDate</timer>
+    <timer>fgpTimer.monitorFgpFor7DaysAgo</timer>
+    <!-- <timer>fgpTimer.monitorFgpForYestDayDate</timer> -->
 
-   	<timer>monitorLimitTimer.monitorDateTimer</timer>
-   	<timer>monitorLimitTimer.monitorLastDateTimer</timer>
-   	<timer>monitorLimitTimer.monitorMonthAndYearTimer</timer>
-   	<timer>monitorLimitTimer.monitorLastYearTimer</timer>
+    <timer>monitorLimitTimer.monitorDateTimer</timer>
+    <timer>monitorLimitTimer.monitorLastDateTimer</timer>
+    <timer>monitorLimitTimer.monitorMonthAndYearTimer</timer>
+    <timer>monitorLimitTimer.monitorLastYearTimer</timer>
 
     <timer>divisionLimitTimer.divisionDateTimer</timer>
-   	<timer>divisionLimitTimer.divisionMonthTimer</timer>
+    <timer>divisionLimitTimer.divisionMonthTimer</timer>
 
-   	<timer>powerOnlineTimer.powerTimer</timer>
-   	<timer>powerOnlineTimer.powerDayTimer</timer>
+    <timer>powerOnlineTimer.powerTimer</timer>
+    <timer>powerOnlineTimer.powerDayTimer</timer>
 
-   	<timer>shiftsEnergyTimer.today</timer>
-   	<timer>shiftsEnergyTimer.yesterAndBefore</timer>
+    <timer>shiftsEnergyTimer.today</timer>
+    <timer>shiftsEnergyTimer.yesterAndBefore</timer>
 
-   	<timer>stationEnergyTimer.today</timer>
-   	<timer>stationEnergyTimer.yesterAndBefore</timer>
+    <timer>stationEnergyTimer.today</timer>
+    <timer>stationEnergyTimer.yesterAndBefore</timer>
 
-   	<timer>enterpriseStateTimer.EnterpriseStateTimingTask</timer>
+    <timer>enterpriseStateTimer.EnterpriseStateTimingTask</timer>
 
-   	<timer>powerFactorAlarmTimer.powerFactorAlarm</timer>
-   	<timer>voltageMessageAlarmTimer.voltageMessageAlarm</timer>
-   	<timer>threePhaseUnbalanceTimer.threePhaseUnbalanceAlarm</timer>
-   	<timer>loadMessageAlarmTimer.loadMessageAlarm</timer>
-   	<timer>harmonicAlarmTimer.harmonicAlarm</timer>
-   	<timer>zeroSequenceCurrentTimer.allCommand</timer>
-   	<timer>phaseFaultTimer.allCommand</timer>
-   	<timer>basicElectricityChargeTimer.allCommand</timer>
+    <timer>powerFactorAlarmTimer.powerFactorAlarm</timer>
+    <timer>voltageMessageAlarmTimer.voltageMessageAlarm</timer>
+    <timer>threePhaseUnbalanceTimer.threePhaseUnbalanceAlarm</timer>
+    <timer>loadMessageAlarmTimer.loadMessageAlarm</timer>
+    <timer>harmonicAlarmTimer.harmonicAlarm</timer>
+    <timer>zeroSequenceCurrentTimer.allCommand</timer>
+    <timer>phaseFaultTimer.allCommand</timer>
+    <timer>basicElectricityChargeTimer.allCommand</timer>
 
-   	<timer>monitorOnlineTimer.updateMonitorOnline</timer>
+    <timer>monitorOnlineTimer.updateMonitorOnline</timer>
 
-   	<timer>waterGasHeatStatisticsTimer.integralPoint</timer>
-   	<timer>waterGasHeatStatisticsTimer.dayMaximum</timer>
-   	<timer>waterGasHeatStatisticsTimer.monthMaximum</timer>
-   	<timer>waterGasHeatStatisticsTimer.yearMaximum</timer>
-   	<timer>waterGasHeatStatisticsTimer.otherEnergydailyDosage</timer>
+    <timer>waterGasHeatStatisticsTimer.integralPoint</timer>
+    <timer>waterGasHeatStatisticsTimer.dayMaximum</timer>
+    <timer>waterGasHeatStatisticsTimer.monthMaximum</timer>
+    <timer>waterGasHeatStatisticsTimer.yearMaximum</timer>
+    <timer>waterGasHeatStatisticsTimer.otherEnergydailyDosage</timer>
 
-   	<timer>overWarnTimer.warnningInfoTimer</timer>
-   	<timer>rebuildTableTimer.rebuildTables</timer>
+    <timer>overWarnTimer.warnningInfoTimer</timer>
+    <timer>h24Timer.h24Timer</timer>
+
+    <!--    <timer>fgpTimer.monitorFgpForEvery</timer>-->
+    <!--    <timer>fgpTimer.monitorFgpForLastDate</timer>-->
+    <!--    <timer>fgpTimer.monitorFgpFor7DaysAgo</timer>-->
 </timers>

+ 56 - 57
VB_DSM_V2.1/vbdsm-statistics/vbdsm-analysis/src/main/resources/test/schedule.xml

@@ -1,58 +1,57 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<timers> 
-
-   	<timer>clearLogsTimer.clearHistroyLog</timer>
-   	
-   	<timer>energyPriceTimer.energyPrice</timer>
-   	
-   	<timer>energyTimer.terminalEnergy</timer>
-   	
-   	<timer>exceptionTimer.terminalException</timer>
-   	
-   	<timer>fgpTimer.companyFgp</timer>
-   	<timer>fgpTimer.companyFgpForLastDate</timer>
-   	<timer>fgpTimer.companyFgpFor7DaysAgo</timer>
-   	<timer>fgpTimer.monitorFgpForEvery</timer>
-   	<timer>fgpTimer.monitorFgpForLastDate</timer>
-   	
-   	<timer>h24Timer.h24Timer</timer>
-   	
-   	<timer>monitorLimitTimer.monitorDateTimer</timer>
-   	<timer>monitorLimitTimer.monitorLastDateTimer</timer>
-   	<timer>monitorLimitTimer.monitorMonthAndYearTimer</timer>
-   	<timer>monitorLimitTimer.monitorLastYearTimer</timer>
-   	
-   	<timer>divisionLimitTimer.divisionDateTimer</timer>
-   	<timer>divisionLimitTimer.divisionMonthTimer</timer>
-   	
-   	<timer>powerOnlineTimer.powerTimer</timer>
-   	<timer>powerOnlineTimer.powerDayTimer</timer>
-   	
-   	<timer>machineshopEnergyTimer.today</timer>
-   	<timer>machineshopEnergyTimer.yesterAndBefore</timer>
-   	
-   	<timer>overWarnTimer.terminalWarn</timer>
-   	<timer>overWarnTimer.day</timer>
-   	
-   	<timer>plineEnergyTimer.today</timer>
-   	<timer>plineEnergyTimer.yesterAndBefore</timer>
-   	
-   	<timer>shiftsEnergyTimer.today</timer>
-   	<timer>shiftsEnergyTimer.yesterAndBefore</timer>
-   	
-   	<timer>stationEnergyTimer.today</timer>
-   	<timer>stationEnergyTimer.yesterAndBefore</timer>
-   	
-   	<timer>tempOnlineDataOtherTimer.saveTempOnlineData</timer>
-   	
-   	<timer>powerFactorAlarmTimer.powerFactorAlarm</timer>
-   	
-   	<timer>voltageMessageAlarmTimer.voltageMessageAlarm</timer>
-   	
-   	<timer>threePhaseUnbalanceTimer.threePhaseUnbalanceAlarm</timer>
-   	
-   	<timer>loadMessageAlarmTimer.loadMessageAlarm</timer>
-   	
-   	<timer>harmonicAlarmTimer.harmonicAlarm</timer>
-   	
-</timers>		
+<timers>
+
+    <timer>clearLogsTimer.clearHistroyLog</timer>
+    <timer>clearBibleWaringInfoTimer.clearHistroy</timer>
+    <!-- <timer>energyPriceTimer.energyPrice</timer> -->
+
+    <timer>fgpTimer.companyFgp</timer>
+    <timer>fgpTimer.companyFgpForLastDate</timer>
+    <timer>fgpTimer.companyFgpFor7DaysAgo</timer>
+    <!-- <timer>fgpTimer.companyFgpForYestDayDate</timer> -->
+
+    <timer>fgpTimer.monitorFgpForEvery</timer>
+    <timer>fgpTimer.monitorFgpForLastDate</timer>
+    <timer>fgpTimer.monitorFgpFor7DaysAgo</timer>
+    <!-- <timer>fgpTimer.monitorFgpForYestDayDate</timer> -->
+
+    <timer>monitorLimitTimer.monitorDateTimer</timer>
+    <timer>monitorLimitTimer.monitorLastDateTimer</timer>
+    <timer>monitorLimitTimer.monitorMonthAndYearTimer</timer>
+    <timer>monitorLimitTimer.monitorLastYearTimer</timer>
+
+    <timer>divisionLimitTimer.divisionDateTimer</timer>
+    <timer>divisionLimitTimer.divisionMonthTimer</timer>
+
+    <timer>powerOnlineTimer.powerTimer</timer>
+    <timer>powerOnlineTimer.powerDayTimer</timer>
+
+    <timer>shiftsEnergyTimer.today</timer>
+    <timer>shiftsEnergyTimer.yesterAndBefore</timer>
+
+    <timer>stationEnergyTimer.today</timer>
+    <timer>stationEnergyTimer.yesterAndBefore</timer>
+
+    <timer>enterpriseStateTimer.EnterpriseStateTimingTask</timer>
+
+    <timer>powerFactorAlarmTimer.powerFactorAlarm</timer>
+    <timer>voltageMessageAlarmTimer.voltageMessageAlarm</timer>
+    <timer>threePhaseUnbalanceTimer.threePhaseUnbalanceAlarm</timer>
+    <timer>loadMessageAlarmTimer.loadMessageAlarm</timer>
+    <timer>harmonicAlarmTimer.harmonicAlarm</timer>
+    <timer>zeroSequenceCurrentTimer.allCommand</timer>
+    <timer>phaseFaultTimer.allCommand</timer>
+    <timer>basicElectricityChargeTimer.allCommand</timer>
+
+    <timer>monitorOnlineTimer.updateMonitorOnline</timer>
+
+    <timer>waterGasHeatStatisticsTimer.integralPoint</timer>
+    <timer>waterGasHeatStatisticsTimer.dayMaximum</timer>
+    <timer>waterGasHeatStatisticsTimer.monthMaximum</timer>
+    <timer>waterGasHeatStatisticsTimer.yearMaximum</timer>
+    <timer>waterGasHeatStatisticsTimer.otherEnergydailyDosage</timer>
+
+    <timer>overWarnTimer.warnningInfoTimer</timer>
+    <timer>h24Timer.h24Timer</timer>
+
+</timers>

+ 2 - 2
VB_DSM_V2.1/vbdsm-statistics/vbdsm-statistic/src/main/java/cn/vbdsm/statistic/biz/impl/OnlineWarnAnalBizImpl.java

@@ -115,7 +115,7 @@ public class OnlineWarnAnalBizImpl implements IOnlineWarnAnalBiz {
         for (OnlineWarn onlineWarn : onlineWarns) {
             onlineWarn.setWarn_state(ONLINE_WARN_STATE_OVERTIME);
             //处理状态修改成已处理,判断是否人为处理
-            if (onlineWarn.getIs_resolved() != SOLVED_STATUS_SOLVED && onlineWarn.getHandle_result() == 0) {
+            if (onlineWarn.getIs_resolved() != SOLVED_STATUS_SOLVED && onlineWarn.getHandle_result() == null && onlineWarn.getHandle_result() == 0) {
                 onlineWarn.setIs_resolved(SOLVED_STATUS_SOLVED);
                 onlineWarn.setHandle_result(HANDLE_RESULT_CODE_OVERTIME);
                 onlineWarn.setHandle_date(Long.valueOf(sdfHMDHMS.format(new Date())));
@@ -166,7 +166,7 @@ public class OnlineWarnAnalBizImpl implements IOnlineWarnAnalBiz {
                 for (OnlineWarn onlineWarn : onlineWarns) {
                     onlineWarn.setWarn_state(ONLINE_WARN_STATE_RECOVERY);
                     //处理状态修改成已处理,,判断是否人为处理
-                    if (onlineWarn.getIs_resolved() != SOLVED_STATUS_SOLVED && onlineWarn.getHandle_result() == 0) {
+                    if (onlineWarn.getIs_resolved() != SOLVED_STATUS_SOLVED && (onlineWarn.getHandle_result() == null || onlineWarn.getHandle_result() == 0)) {
                         onlineWarn.setIs_resolved(SOLVED_STATUS_SOLVED);
                         onlineWarn.setHandle_result(HANDLE_RESULT_CODE_RECOVERY);
                         onlineWarn.setHandle_date(Long.valueOf(sdfHMDHMS.format(new Date())));

+ 2 - 2
VB_DSM_V2.1/vbdsm-statistics/vbdsm-statistic/src/main/resources/config/application-dev.yml

@@ -7,8 +7,8 @@ tg:
 spring:
   redis:
     host: 47.112.30.247
-    #password: Iwb-2017
-    port: 16379
+    password: Iwb-2017
+    port: 6399
     database: 0
     pool:
       maxActive: 8

+ 1 - 0
VB_DSM_V2.1/vbdsm-web/pom.xml

@@ -20,6 +20,7 @@
         <module>vbdsm-gov</module>
         <module>vbdsm-gov-new</module>
         <module>vbdsm-explorer</module>
+        <module>vbdsm-charts</module>
     </modules>
 
     <build>

+ 19 - 0
VB_DSM_V2.1/vbdsm-web/vbdsm-charts/Dockerfile

@@ -0,0 +1,19 @@
+FROM tomcat:8.5.38
+MAINTAINER Vber
+
+RUN rm -rf webapps
+
+RUN mkdir -p /vbdsm/logs
+
+ENV TZ=Asia/Shanghai
+RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
+
+ADD ./target/ROOT.war /usr/local/tomcat/webapps/
+
+WORKDIR /vbdsm
+
+#端口
+EXPOSE 8080
+
+#设置启动命令
+ENTRYPOINT ["/usr/local/tomcat/bin/catalina.sh","run"]

+ 109 - 0
VB_DSM_V2.1/vbdsm-web/vbdsm-charts/pom.xml

@@ -0,0 +1,109 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xmlns="http://maven.apache.org/POM/4.0.0"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>cn.vbdsm</groupId>
+        <artifactId>vbdsm-web</artifactId>
+        <version>2.1.0</version>
+    </parent>
+    <packaging>war</packaging>
+
+    <artifactId>vbdsm-charts</artifactId>
+    <properties>
+        <javacc.version>4.1</javacc.version>
+    </properties>
+
+    <dependencies>
+        <dependency>
+            <groupId>javacc</groupId>
+            <artifactId>javacc</artifactId>
+            <version>${javacc.version}</version>
+            <scope>test</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>bouncycastle</groupId>
+            <artifactId>bouncycastle-jce-jdk13</artifactId>
+            <version>112</version>
+        </dependency>
+
+        <dependency>
+            <groupId>javax.servlet</groupId>
+            <artifactId>servlet-api</artifactId>
+            <scope>provided</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>cn.vbdsm</groupId>
+            <artifactId>vbdsm-base</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.springframework</groupId>
+            <artifactId>spring-test</artifactId>
+            <version>${spring.version}</version>
+            <scope>test</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>batik</groupId>
+            <artifactId>batik-all</artifactId>
+            <version>1.7</version>
+        </dependency>
+
+        <dependency>
+            <groupId>pdf-transcoder</groupId>
+            <artifactId>pdf-transcoder</artifactId>
+            <version>1.0</version>
+        </dependency>
+        <dependency>
+            <groupId>xalan</groupId>
+            <artifactId>xalan</artifactId>
+            <version>2.7.0</version>
+        </dependency>
+
+        <dependency>
+            <groupId>xerces</groupId>
+            <artifactId>org-apache-xerces</artifactId>
+            <version>2.5.0</version>
+        </dependency>
+        <dependency>
+            <groupId>xml-apis</groupId>
+            <artifactId>xml-apis-ext</artifactId>
+            <version>1.3.04</version>
+        </dependency>
+        <dependency>
+            <groupId>xml-apis</groupId>
+            <artifactId>xml-apis</artifactId>
+            <version>1.3.04</version>
+        </dependency>
+        <dependency>
+            <groupId>xmlgraphics</groupId>
+            <artifactId>xmlgraphics-commons</artifactId>
+            <version>1.4</version>
+        </dependency>
+
+    </dependencies>
+
+    <build>
+        <finalName>ROOT</finalName>
+        <plugins>
+            <plugin>
+                <groupId>org.mortbay.jetty</groupId>
+                <artifactId>maven-jetty-plugin</artifactId>
+                <configuration>
+                    <webDefaultXml>src/main/resources/webdefault.xml</webDefaultXml>
+                    <contextPath>/</contextPath>
+                    <connectors>
+                        <connector implementation="org.mortbay.jetty.nio.SelectChannelConnector">
+                            <port>7087</port>
+                        </connector>
+                    </connectors>
+                </configuration>
+            </plugin>
+        </plugins>
+
+    </build>
+</project>

+ 133 - 0
VB_DSM_V2.1/vbdsm-web/vbdsm-charts/src/main/java/cn/vbdsm/common/config/CustomConfig.java

@@ -0,0 +1,133 @@
+package cn.vbdsm.common.config;
+
+import org.springframework.beans.BeansException;
+import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
+import org.springframework.beans.factory.config.PropertyPlaceholderConfigurer;
+
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Properties;
+
+/**
+ * 加载自定义配置
+ *
+ * @author tanyongde
+ */
+public class CustomConfig extends PropertyPlaceholderConfigurer {
+
+    private static Map<String, String> ctxPropertiesMap;
+    private final String PLACEHOLDER_START = "${";
+
+    /**
+     * 获取已加载的配置信息
+     *
+     * @param name
+     * @return
+     */
+    public static String getContextProperty(String name) {
+        return ctxPropertiesMap.get(name);
+    }
+
+    @Override
+    protected void processProperties(ConfigurableListableBeanFactory beanFactoryToProcess, Properties props) throws BeansException {
+        resolvePlaceHolders(props);
+        super.processProperties(beanFactoryToProcess, props);
+        ctxPropertiesMap = new HashMap<String, String>();
+        for (Object key : props.keySet()) {
+            String keyStr = key.toString();
+            String value = props.getProperty(keyStr);
+            ctxPropertiesMap.put(keyStr, value);
+        }
+    }
+
+    /**
+     * 解析占位符
+     *
+     * @param properties
+     */
+    private void resolvePlaceHolders(Properties properties) {
+        Iterator itr = properties.entrySet().iterator();
+        while (itr.hasNext()) {
+            final Map.Entry entry = (Map.Entry) itr.next();
+            final Object value = entry.getValue();
+            if (value instanceof String) {
+                final String resolved = resolvePlaceHolder(properties, (String) value);
+                if (!value.equals(resolved)) {
+                    if (resolved == null) {
+                        itr.remove();
+                    } else {
+                        entry.setValue(resolved);
+                    }
+                }
+            }
+        }
+    }
+
+    /**
+     * 解析占位符具体操作
+     *
+     * @param property
+     * @return
+     */
+    private String resolvePlaceHolder(Properties prots, String property) {
+        if (property.indexOf(PLACEHOLDER_START) < 0) {
+            return property;
+        }
+        StringBuffer buff = new StringBuffer();
+        char[] chars = property.toCharArray();
+        for (int pos = 0; pos < chars.length; pos++) {
+            if (chars[pos] == '$') {
+                // peek ahead  
+                if (chars[pos + 1] == '{') {
+                    // we have a placeholder, spin forward till we find the end  
+                    String propertyName = "";
+                    int x = pos + 2;
+                    for (; x < chars.length && chars[x] != '}'; x++) {
+                        propertyName += chars[x];
+                        // if we reach the end of the string w/o finding the  
+                        // matching end, that is an exception  
+                        if (x == chars.length - 1) {
+                            throw new IllegalArgumentException("unmatched placeholder start [" + property + "]");
+                        }
+                    }
+                    String value = extractFromSystem(prots, propertyName);
+                    buff.append(value == null ? "" : value);
+                    pos = x + 1;
+                    // make sure spinning forward did not put us past the end of the buffer...  
+                    if (pos >= chars.length) {
+                        break;
+                    }
+                }
+            }
+            buff.append(chars[pos]);
+        }
+        String rtn = buff.toString();
+        return isEmpty(rtn) ? null : rtn;
+    }
+
+
+    /**
+     * 获得系统属性 当然 你可以选择从别的地方获取值
+     *
+     * @param systemPropertyName
+     * @return
+     */
+    private String extractFromSystem(Properties prots, String propertyName) {
+        try {
+            return prots.getProperty(propertyName);
+        } catch (Throwable t) {
+            return null;
+        }
+    }
+
+    /**
+     * 判断字符串的空(null或者.length=0)
+     *
+     * @param string
+     * @return
+     */
+    private boolean isEmpty(String string) {
+        return string == null || string.length() == 0;
+    }
+}

+ 68 - 0
VB_DSM_V2.1/vbdsm-web/vbdsm-charts/src/main/java/cn/vbdsm/common/converts/ChartsConverter.java

@@ -0,0 +1,68 @@
+package cn.vbdsm.common.converts;
+
+import org.apache.batik.apps.rasterizer.DestinationType;
+import org.apache.batik.apps.rasterizer.SVGConverter;
+import org.apache.batik.apps.rasterizer.SVGConverterException;
+
+import java.io.File;
+
+/**
+ * 导出文件转换
+ *
+ * @author tanyongde
+ */
+public class ChartsConverter extends SVGConverter {
+
+    /**
+     * 转换方法
+     *
+     * @param sources     SVG文件路径
+     * @param destination 目标文件路径
+     * @param type        转换类型,有 image/png | image/jpeg | application/pdf |
+     *                    image/svg+xml 可选
+     * @param width       导出图片宽度
+     * @return 目标文件名
+     * @throws SVGConverterException
+     */
+    public String conver(String sources, String destination, String type, float width) throws SVGConverterException {
+
+        SVGConverter converter = new ChartsConverter();
+
+        // 设置高度,默认是400
+        converter.setHeight(400);
+
+        // 设置宽度,传入的值
+        converter.setWidth(width);
+
+        // 设置svg源文件路径,是一个数组,支持多个文件同时转换
+        String[] src = {sources};
+        converter.setSources(src);
+
+        // 设置图片质量
+        converter.setQuality(MAXIMUM_QUALITY);
+
+        // 记录文件后缀
+        String ext = "";
+
+        // 更具传入的类型设置导出类型和文件后缀
+        if (type.equals("image/png")) {
+            converter.setDestinationType(DestinationType.PNG);
+            ext = "png";
+        } else if (type.equals("image/jpeg")) {
+            converter.setDestinationType(DestinationType.JPEG);
+            ext = "jpg";
+        } else if (type.equals("application/pdf")) {
+            converter.setDestinationType(DestinationType.PDF);
+            ext = "pdf";
+        } else {
+            return null;
+        }
+
+        // 设置目标文件路径
+        converter.setDst(new File(destination + "/chart." + ext));
+        // 执行导出
+        converter.execute();
+
+        return "chart." + ext;
+    }
+}

+ 124 - 0
VB_DSM_V2.1/vbdsm-web/vbdsm-charts/src/main/java/cn/vbdsm/common/servlets/ApplicationServlet.java

@@ -0,0 +1,124 @@
+package cn.vbdsm.common.servlets;
+
+import cn.vbdsm.common.converts.ChartsConverter;
+import org.apache.batik.apps.rasterizer.SVGConverterException;
+import org.springframework.web.servlet.DispatcherServlet;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.OutputStreamWriter;
+
+/**
+ * Highcharts Servlet导出服务器 Servlet文件
+ *
+ * @author tanyongde
+ */
+public class ApplicationServlet extends DispatcherServlet {
+    private static final long serialVersionUID = 1L;
+
+    @Override
+    protected void doService(HttpServletRequest request, HttpServletResponse response) throws Exception {
+
+        request.setCharacterEncoding("utf-8");
+
+        response.setContentType("text/html");
+
+        /*
+         * 第一步:获取参数
+         */
+        String svg = request.getParameter("svg");
+
+        String width = request.getParameter("width");
+
+        String type = request.getParameter("type");
+
+        String filename = request.getParameter("filename");
+
+        // method,有两种情况,download为将生成的文件下载、show为将图片显示在页面上
+        String method = request.getParameter("method");
+
+        if (svg == null || type == null || method == null) {
+            response.getWriter().print("the parameter is error, please check the parameters!");
+            response.getWriter().close();
+            return;
+        }
+        /*
+         * 第二步:生成 .svg文件
+         */
+        @SuppressWarnings("deprecation")
+        String webRoot = request.getRealPath("") + "/temp/";// 获取项目的绝对路径
+        File dir = new File(webRoot);
+        if (!dir.exists()) {
+            dir.mkdirs();
+        }
+
+        // SVG临时文件名
+        String temp = webRoot + System.currentTimeMillis() + (int) (Math.random() * 1000) + ".svg";
+
+        // 将svg代码写入到临时文件中,文件后缀的.svg
+        File svgTempFile = new File(temp);
+        // 写入文件,注意文件编码
+        OutputStreamWriter svgFileOsw = new OutputStreamWriter(new FileOutputStream(svgTempFile), "UTF-8");
+        svgFileOsw.write(svg);
+        svgFileOsw.flush();
+        svgFileOsw.close();
+
+        /**
+         * 第三步:调用转换函数,生成目标文件
+         */
+
+        try {
+            File resultFile = null;
+            // 如果是导出SVG,直接调用下载,不需要将svg转换成其他格式
+            if (type.equals("image/svg+xml")) {
+                resultFile = new File(temp);
+                filename = "chart.svg";
+            } else {
+                ChartsConverter mc = new ChartsConverter();
+                // 调用转换函数,返回目标文件名
+                filename = mc.conver(temp, webRoot, type, Float.parseFloat(width));
+                // 读取目标文件流,转换调用下载
+                resultFile = new File(webRoot + filename);
+            }
+            FileInputStream resultFileFi = new FileInputStream(resultFile);
+            long l = resultFile.length();
+            int k = 0;
+            byte[] abyte0 = new byte[65000];
+
+            /**
+             * 第四步:调用浏览器下载
+             */
+            if (method.equals("download")) {
+                // 调用下载
+                response.setContentType("application/x-msdownload");
+                response.setContentLength((int) l);
+                response.setHeader("Content-Disposition", "attachment; filename=" + filename);
+                while ((long) k < l) {
+                    int j;
+                    j = resultFileFi.read(abyte0, 0, 65000);
+                    k += j;
+                    response.getOutputStream().write(abyte0, 0, j);
+                }
+                resultFileFi.close();
+                resultFile.delete();
+            } else {
+                // 直接将图片显示在页面上
+                response.setCharacterEncoding("utf-8");
+                String filepath = (webRoot + filename).replaceAll("\\\\", "\\\\\\\\");
+                // 写包含图片路径的Json字符串
+                response.getWriter().write("{\"filename\":\"" + filepath + "\"}");
+            }
+            // 转换成功后,删除临时文件
+            svgTempFile.delete();
+
+        } catch (NumberFormatException e) {
+            e.printStackTrace();
+        } catch (SVGConverterException e) {
+            e.printStackTrace();
+        }
+    }
+
+}

+ 14 - 0
VB_DSM_V2.1/vbdsm-web/vbdsm-charts/src/main/resources/application-beans.xml

@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans"
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:mvc="http://www.springframework.org/schema/mvc"
+	xmlns:context="http://www.springframework.org/schema/context"
+	xmlns:aop="http://www.springframework.org/schema/aop" xmlns:util="http://www.springframework.org/schema/util"
+	xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
+       http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd
+       http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd
+       http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd 
+       http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.0.xsd">
+
+	<bean name="restTemplate" class="org.springframework.web.client.RestTemplate"></bean>
+
+</beans>

+ 33 - 0
VB_DSM_V2.1/vbdsm-web/vbdsm-charts/src/main/resources/application-common.xml

@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	   xmlns:context="http://www.springframework.org/schema/context"
+	   xmlns="http://www.springframework.org/schema/beans"
+	   xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
+
+	   http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd">
+
+    <context:component-scan base-package="com.cn95598"/>
+    <context:annotation-config/>
+
+    <bean id="log4jInitialization"
+          class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
+        <property name="targetClass" value="org.springframework.util.Log4jConfigurer"/>
+        <property name="targetMethod" value="initLogging"/>
+        <property name="arguments">
+            <list>
+                <value>classpath:log4j-cfg.xml</value>
+            </list>
+        </property>
+    </bean>
+
+    <bean id="propertyConfigurer" class="cn.vbdsm.common.config.CustomConfig">
+        <property name="locations">
+            <list>
+                <value>classpath:system.properties</value>
+                <value>classpath:auth-rule.properties</value>
+            </list>
+        </property>
+    </bean>
+
+
+</beans>

+ 10 - 0
VB_DSM_V2.1/vbdsm-web/vbdsm-charts/src/main/resources/application-context.xml

@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans"
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
+	
+	<import resource="classpath:application-beans.xml"/>
+	<import resource="classpath:application-common.xml"/>
+	
+	
+</beans>

+ 27 - 0
VB_DSM_V2.1/vbdsm-web/vbdsm-charts/src/main/resources/application-web.xml

@@ -0,0 +1,27 @@
+<beans xmlns="http://www.springframework.org/schema/beans"
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p"
+	xmlns:mvc="http://www.springframework.org/schema/mvc"
+	xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
+           http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd">
+           
+	<mvc:annotation-driven />
+
+	<bean class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter"></bean>
+	
+	<bean id="multipartResolver" class="org.springframework.web.multipart.commons.CommonsMultipartResolver"
+		p:defaultEncoding="UTF-8" p:maxUploadSize="2199023255552" />
+		
+	<!-- <mvc:interceptors>
+		<mvc:interceptor>
+			<mvc:mapping path="/**"/>
+			<bean class="com.cn95598.common.interceptors.LoginInterceptor"></bean>
+		</mvc:interceptor>
+		<mvc:interceptor>
+			<mvc:mapping path="/**"/>
+			<bean class="com.cn95598.common.interceptors.AuthInterceptor"></bean>
+		</mvc:interceptor>
+	</mvc:interceptors> -->
+	
+	<import resource="classpath:application-context.xml" />
+	
+</beans>

+ 14 - 0
VB_DSM_V2.1/vbdsm-web/vbdsm-charts/src/main/resources/auth-rule.properties

@@ -0,0 +1,14 @@
+#allow request common modes
+auth.rule.allow.modes=lang,desktop,setting,app,buildingmornitor,plugins
+#allow request urls
+auth.rule.allow.urls=web/menu/getList,web/getMonitorTree/.*
+
+#allow request methods
+auth.rule.method.query=get,config
+auth.rule.method.add=add,save
+auth.rule.method.edit=modify,update
+auth.rule.method.remove=remove,recovery,delete,realDel
+auth.rule.method.upload=upload
+auth.rule.method.download=download
+auth.rule.method.import=import
+auth.rule.method.export=export

+ 61 - 0
VB_DSM_V2.1/vbdsm-web/vbdsm-charts/src/main/resources/local/log4j-cfg.xml

@@ -0,0 +1,61 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE log4j:configuration PUBLIC "-//LOGGER"
+        "http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/xml/doc-files/log4j.dtd">
+<log4j:configuration>
+
+    <appender name="stdout" class="org.apache.log4j.ConsoleAppender">
+        <layout class="org.apache.log4j.PatternLayout">
+            <param name="ConversionPattern" value="[%-5p] [%d{HH:mm:ss}] %c - %m%n"/>
+        </layout>
+    </appender>
+
+    <appender name="file" class="org.apache.log4j.DailyRollingFileAppender">
+        <param name="file" value="D:/logs/vbdsm/charts/logs/webapp.log"/>
+        <param name="append" value="true"/>
+        <param name="datePattern" value="'.'yyyy-MM-dd"/>
+        <layout class="org.apache.log4j.PatternLayout">
+            <param name="ConversionPattern" value="[%-5p] [%d{yyyy-MM-dd HH:mm:ss}] %c - %m%n"/>
+        </layout>
+        <filter class="org.apache.log4j.varia.LevelRangeFilter">
+            <param name="AcceptOnMatch" value="true"/>
+        </filter>
+    </appender>
+
+    <appender name="warn" class="org.apache.log4j.DailyRollingFileAppender">
+        <param name="file" value="/opt/cn95598-charts/logs/warn.log"/>
+        <param name="append" value="true"/>
+        <param name="datePattern" value="'.'yyyy-MM-dd"/>
+        <layout class="org.apache.log4j.PatternLayout">
+            <param name="ConversionPattern" value="[%-5p][ %t ] [%d{yyyy-MM-dd HH:mm:ss}] %c - %m%n"/>
+        </layout>
+        <filter class="org.apache.log4j.varia.LevelRangeFilter">
+            <param name="LevelMin" value="WARN"/>
+            <param name="LevelMax" value="WARN"/>
+            <param name="AcceptOnMatch" value="true"/>
+        </filter>
+    </appender>
+
+    <appender name="error" class="org.apache.log4j.DailyRollingFileAppender">
+        <param name="file" value="/opt/cn95598-charts/logs/error.log"/>
+        <param name="append" value="true"/>
+        <param name="datePattern" value="'.'yyyy-MM-dd"/>
+        <layout class="org.apache.log4j.PatternLayout">
+            <param name="ConversionPattern" value="[%-5p][ %t ] [%d{yyyy-MM-dd HH:mm:ss}] %c - %m%n"/>
+        </layout>
+        <filter class="org.apache.log4j.varia.LevelRangeFilter">
+            <param name="LevelMin" value="ERROR"/>
+            <param name="LevelMax" value="ERROR"/>
+            <param name="AcceptOnMatch" value="true"/>
+        </filter>
+    </appender>
+
+    <logger name="org.springframework.jdbc.core.JdbcTemplate" additivity="true">
+        <level value="info"/>
+    </logger>
+
+    <root>
+        <level value="info"/>
+        <appender-ref ref="stdout"/>
+    </root>
+
+</log4j:configuration>

+ 1 - 0
VB_DSM_V2.1/vbdsm-web/vbdsm-charts/src/main/resources/local/redis-host.properties

@@ -0,0 +1 @@
+redis_ref_hosts=47.112.30.247:6399

+ 61 - 0
VB_DSM_V2.1/vbdsm-web/vbdsm-charts/src/main/resources/product/log4j-cfg.xml

@@ -0,0 +1,61 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE log4j:configuration PUBLIC "-//LOGGER"
+        "http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/xml/doc-files/log4j.dtd">
+<log4j:configuration>
+
+    <appender name="stdout" class="org.apache.log4j.ConsoleAppender">
+        <layout class="org.apache.log4j.PatternLayout">
+            <param name="ConversionPattern" value="[%-5p] [%d{HH:mm:ss}] %c - %m%n"/>
+        </layout>
+    </appender>
+
+    <appender name="file" class="org.apache.log4j.DailyRollingFileAppender">
+        <param name="file" value="D:/logs/vbdsm/charts/logs/webapp.log"/>
+        <param name="append" value="true"/>
+        <param name="datePattern" value="'.'yyyy-MM-dd"/>
+        <layout class="org.apache.log4j.PatternLayout">
+            <param name="ConversionPattern" value="[%-5p] [%d{yyyy-MM-dd HH:mm:ss}] %c - %m%n"/>
+        </layout>
+        <filter class="org.apache.log4j.varia.LevelRangeFilter">
+            <param name="AcceptOnMatch" value="true"/>
+        </filter>
+    </appender>
+
+    <appender name="warn" class="org.apache.log4j.DailyRollingFileAppender">
+        <param name="file" value="D:/CN95598_2.0/cn95598-charts/logs/warn.log"/>
+        <param name="append" value="true"/>
+        <param name="datePattern" value="'.'yyyy-MM-dd"/>
+        <layout class="org.apache.log4j.PatternLayout">
+            <param name="ConversionPattern" value="[%-5p][ %t ] [%d{yyyy-MM-dd HH:mm:ss}] %c - %m%n"/>
+        </layout>
+        <filter class="org.apache.log4j.varia.LevelRangeFilter">
+            <param name="LevelMin" value="WARN"/>
+            <param name="LevelMax" value="WARN"/>
+            <param name="AcceptOnMatch" value="true"/>
+        </filter>
+    </appender>
+
+    <appender name="error" class="org.apache.log4j.DailyRollingFileAppender">
+        <param name="file" value="D:/CN95598_2.0/cn95598-charts/logs/error.log"/>
+        <param name="append" value="true"/>
+        <param name="datePattern" value="'.'yyyy-MM-dd"/>
+        <layout class="org.apache.log4j.PatternLayout">
+            <param name="ConversionPattern" value="[%-5p][ %t ] [%d{yyyy-MM-dd HH:mm:ss}] %c - %m%n"/>
+        </layout>
+        <filter class="org.apache.log4j.varia.LevelRangeFilter">
+            <param name="LevelMin" value="ERROR"/>
+            <param name="LevelMax" value="ERROR"/>
+            <param name="AcceptOnMatch" value="true"/>
+        </filter>
+    </appender>
+
+    <logger name="org.springframework.jdbc.core.JdbcTemplate" additivity="true">
+        <level value="info"/>
+    </logger>
+
+    <root>
+        <level value="info"/>
+        <appender-ref ref="stdout"/>
+    </root>
+
+</log4j:configuration>

+ 1 - 0
VB_DSM_V2.1/vbdsm-web/vbdsm-charts/src/main/resources/product/redis-host.properties

@@ -0,0 +1 @@
+redis_ref_hosts=47.112.30.247:6399

+ 9 - 0
VB_DSM_V2.1/vbdsm-web/vbdsm-charts/src/main/resources/system.properties

@@ -0,0 +1,9 @@
+chartset=utf-8
+
+#andsm DEPOT_HOME path
+filesDepot=/opt/DSM/DEPOT_HOME/files/
+rootDir=/opt/DSM/DEPOT_HOME/
+usersRootDir=/opt/DSM/DEPOT_HOME/users/
+classRootDir=/opt/DSM/DEPOT_HOME/class/
+resourceRootDir=/opt/DSM/DEPOT_HOME/resource/
+ftpPort=21

+ 61 - 0
VB_DSM_V2.1/vbdsm-web/vbdsm-charts/src/main/resources/test/log4j-cfg.xml

@@ -0,0 +1,61 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE log4j:configuration PUBLIC "-//LOGGER"
+        "http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/xml/doc-files/log4j.dtd">
+<log4j:configuration>
+
+    <appender name="stdout" class="org.apache.log4j.ConsoleAppender">
+        <layout class="org.apache.log4j.PatternLayout">
+            <param name="ConversionPattern" value="[%-5p] [%d{HH:mm:ss}] %c - %m%n"/>
+        </layout>
+    </appender>
+
+    <appender name="file" class="org.apache.log4j.DailyRollingFileAppender">
+        <param name="file" value="/vbdsm-charts/logs/webapp.log"/>
+        <param name="append" value="true"/>
+        <param name="datePattern" value="'.'yyyy-MM-dd"/>
+        <layout class="org.apache.log4j.PatternLayout">
+            <param name="ConversionPattern" value="[%-5p] [%d{yyyy-MM-dd HH:mm:ss}] %c - %m%n"/>
+        </layout>
+        <filter class="org.apache.log4j.varia.LevelRangeFilter">
+            <param name="AcceptOnMatch" value="true"/>
+        </filter>
+    </appender>
+
+    <appender name="warn" class="org.apache.log4j.DailyRollingFileAppender">
+        <param name="file" value="/opt/NXDSM_2.0/nxdsm-charts/logs/warn.log"/>
+        <param name="append" value="true"/>
+        <param name="datePattern" value="'.'yyyy-MM-dd"/>
+        <layout class="org.apache.log4j.PatternLayout">
+            <param name="ConversionPattern" value="[%-5p][ %t ] [%d{yyyy-MM-dd HH:mm:ss}] %c - %m%n"/>
+        </layout>
+        <filter class="org.apache.log4j.varia.LevelRangeFilter">
+            <param name="LevelMin" value="WARN"/>
+            <param name="LevelMax" value="WARN"/>
+            <param name="AcceptOnMatch" value="true"/>
+        </filter>
+    </appender>
+
+    <appender name="error" class="org.apache.log4j.DailyRollingFileAppender">
+        <param name="file" value="/opt/NXDSM_2.0/nxdsm-charts/logs/error.log"/>
+        <param name="append" value="true"/>
+        <param name="datePattern" value="'.'yyyy-MM-dd"/>
+        <layout class="org.apache.log4j.PatternLayout">
+            <param name="ConversionPattern" value="[%-5p][ %t ] [%d{yyyy-MM-dd HH:mm:ss}] %c - %m%n"/>
+        </layout>
+        <filter class="org.apache.log4j.varia.LevelRangeFilter">
+            <param name="LevelMin" value="ERROR"/>
+            <param name="LevelMax" value="ERROR"/>
+            <param name="AcceptOnMatch" value="true"/>
+        </filter>
+    </appender>
+
+    <logger name="org.springframework.jdbc.core.JdbcTemplate" additivity="true">
+        <level value="info"/>
+    </logger>
+
+    <root>
+        <level value="info"/>
+        <appender-ref ref="stdout"/>
+    </root>
+
+</log4j:configuration>

+ 1 - 0
VB_DSM_V2.1/vbdsm-web/vbdsm-charts/src/main/resources/test/redis-host.properties

@@ -0,0 +1 @@
+redis_ref_hosts=vbdsm-redis:6379

+ 410 - 0
VB_DSM_V2.1/vbdsm-web/vbdsm-charts/src/main/resources/webdefault.xml

@@ -0,0 +1,410 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+
+<!-- ===================================================================== -->
+<!-- This file contains the default descriptor for web applications.       -->
+<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
+<!-- The intent of this descriptor is to include jetty specific or common  -->
+<!-- configuration for all webapps.   If a context has a webdefault.xml    -->
+<!-- descriptor, it is applied before the contexts own web.xml file        -->
+<!--                                                                       -->
+<!-- A context may be assigned a default descriptor by:                    -->
+<!--  + Calling WebApplicationContext.setDefaultsDescriptor                -->
+<!--  + Passed an arg to addWebApplications                                -->
+<!--                                                                       -->
+<!-- This file is used both as the resource within the jetty.jar (which is -->
+<!-- used as the default if no explicit defaults descriptor is set) and it -->
+<!-- is copied to the etc directory of the Jetty distro and explicitly     -->
+<!-- by the jetty.xml file.                                                -->
+<!--                                                                       -->
+<!-- ===================================================================== -->
+<web-app 
+   xmlns="http://java.sun.com/xml/ns/javaee" 
+   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+   xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" 
+   metadata-complete="true"
+   version="2.5"> 
+
+  <description>
+    Default web.xml file.  
+    This file is applied to a Web application before it's own WEB_INF/web.xml file
+  </description>
+
+
+  <!-- ==================================================================== -->
+  <!-- Context params to control Session Cookies                            -->
+  <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  -->
+  <!-- UNCOMMENT TO ACTIVATE
+  <context-param>
+    <param-name>org.mortbay.jetty.servlet.SessionDomain</param-name>
+    <param-value>127.0.0.1</param-value>
+  </context-param>
+
+  <context-param>
+    <param-name>org.mortbay.jetty.servlet.SessionPath</param-name>
+    <param-value>/</param-value>
+  </context-param>
+
+  <context-param>
+    <param-name>org.mortbay.jetty.servlet.MaxAge</param-name>
+    <param-value>-1</param-value>
+  </context-param>
+  -->
+
+  <context-param>
+    <param-name>org.mortbay.jetty.webapp.NoTLDJarPattern</param-name>
+    <param-value>start.jar|ant-.*\.jar|dojo-.*\.jar|jetty-.*\.jar|jsp-api-.*\.jar|junit-.*\.jar|servlet-api-.*\.jar|dnsns\.jar|rt\.jar|jsse\.jar|tools\.jar|sunpkcs11\.jar|sunjce_provider\.jar|xerces.*\.jar</param-value>
+  </context-param>
+            
+
+
+  <!-- ==================================================================== -->
+  <!-- The default servlet.                                                 -->
+  <!-- This servlet, normally mapped to /, provides the handling for static -->
+  <!-- content, OPTIONS and TRACE methods for the context.                  -->
+  <!-- The following initParameters are supported:                          -->
+  <!--                                                                      -->
+  <!--   acceptRanges     If true, range requests and responses are         -->
+  <!--                    supported                                         -->
+  <!--                                                                      -->
+  <!--   dirAllowed       If true, directory listings are returned if no    -->
+  <!--                    welcome file is found. Else 403 Forbidden.        -->
+  <!--                                                                      -->
+  <!--   welcomeServlets  If true, attempt to dispatch to welcome files     -->
+  <!--                    that are servlets, if no matching static          --> 
+  <!--                    resources can be found.                           -->
+  <!--                                                                      -->
+  <!--   redirectWelcome  If true, redirect welcome file requests           -->
+  <!--                    else use request dispatcher forwards              -->
+  <!--                                                                      -->
+  <!--   gzip             If set to true, then static content will be served--> 
+  <!--                    as gzip content encoded if a matching resource is -->
+  <!--                    found ending with ".gz"                           -->
+  <!--                                                                      -->
+  <!--   resoureBase      Can be set to replace the context resource base   -->
+  <!--                                                                      -->
+  <!--   relativeResourceBase                                               -->
+  <!--                    Set with a pathname relative to the base of the   -->
+  <!--                    servlet context root. Useful for only serving     -->
+  <!--                    static content from only specific subdirectories. -->
+  <!--                                                                      -->
+  <!--   useFileMappedBuffer                                                -->
+  <!--                    If set to true (the default), a  memory mapped    -->
+  <!--                    file buffer will be used to serve static content  -->
+  <!--                    when using an NIO connector. Setting this value   -->
+  <!--                    to false means that a direct buffer will be used  -->
+  <!--                    instead. If you are having trouble with Windows   -->
+  <!--                    file locking, set this to false.                  -->
+  <!--                                                                      -->
+  <!--  cacheControl      If set, all static content will have this value   -->
+  <!--                    set as the cache-control header.                  -->
+  <!--                                                                      -->
+  <!--  maxCacheSize      Maximum size of the static resource cache         -->
+  <!--                                                                      -->
+  <!--  maxCachedFileSize Maximum size of any single file in the cache      -->
+  <!--                                                                      -->
+  <!--  maxCachedFiles    Maximum number of files in the cache              -->
+  <!--                                                                      -->
+  <!--  cacheType         "nio", "bio" or "both" to determine the type(s)   -->
+  <!--                    of resource cache. A bio cached buffer may be used-->
+  <!--                    by nio but is not as efficient as a nio buffer.   -->
+  <!--                    An nio cached buffer may not be used by bio.      -->
+  <!--                                                                      -->
+  <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  -->
+  <servlet>
+    <servlet-name>default</servlet-name>
+    <servlet-class>org.mortbay.jetty.servlet.DefaultServlet</servlet-class>
+    <init-param>
+      <param-name>acceptRanges</param-name>
+      <param-value>true</param-value>
+    </init-param>
+    <init-param>
+      <param-name>dirAllowed</param-name>
+      <param-value>true</param-value>
+    </init-param>
+    <init-param>
+      <param-name>welcomeServlets</param-name>
+      <param-value>false</param-value>
+    </init-param>
+    <init-param>
+      <param-name>redirectWelcome</param-name>
+      <param-value>false</param-value>
+    </init-param>
+    <init-param>
+      <param-name>maxCacheSize</param-name>
+      <param-value>256000000</param-value>
+    </init-param>
+    <init-param>
+      <param-name>maxCachedFileSize</param-name>
+      <param-value>10000000</param-value>
+    </init-param>
+    <init-param>
+      <param-name>maxCachedFiles</param-name>
+      <param-value>1000</param-value>
+    </init-param>
+    <init-param>
+      <param-name>cacheType</param-name>
+      <param-value>both</param-value>
+    </init-param>
+    <init-param>
+      <param-name>gzip</param-name>
+      <param-value>true</param-value>
+    </init-param>
+    <init-param>
+      <param-name>useFileMappedBuffer</param-name>
+      <param-value>false</param-value>
+    </init-param>  
+    <!--
+    <init-param>
+      <param-name>cacheControl</param-name>
+      <param-value>max-age=3600,public</param-value>
+    </init-param>
+    -->
+    <load-on-startup>0</load-on-startup>
+  </servlet> 
+
+  <servlet-mapping> <servlet-name>default</servlet-name> <url-pattern>/</url-pattern> </servlet-mapping>
+  
+
+  <!-- ==================================================================== -->
+  <!-- JSP Servlet                                                          -->
+  <!-- This is the jasper JSP servlet from the jakarta project              -->
+  <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  -->
+  <!-- The JSP page compiler and execution servlet, which is the mechanism  -->
+  <!-- used by Glassfish to support JSP pages.  Traditionally, this servlet -->
+  <!-- is mapped to URL patterh "*.jsp".  This servlet supports the         -->
+  <!-- following initialization parameters (default values are in square    -->
+  <!-- brackets):                                                           -->
+  <!--                                                                      -->
+  <!--   checkInterval       If development is false and reloading is true, -->
+  <!--                       background compiles are enabled. checkInterval -->
+  <!--                       is the time in seconds between checks to see   -->
+  <!--                       if a JSP page needs to be recompiled. [300]    -->
+  <!--                                                                      -->
+  <!--   compiler            Which compiler Ant should use to compile JSP   -->
+  <!--                       pages.  See the Ant documenation for more      -->
+  <!--                       information. [javac]                           -->
+  <!--                                                                      -->
+  <!--   classdebuginfo      Should the class file be compiled with         -->
+  <!--                       debugging information?  [true]                 -->
+  <!--                                                                      -->
+  <!--   classpath           What class path should I use while compiling   -->
+  <!--                       generated servlets?  [Created dynamically      -->
+  <!--                       based on the current web application]          -->
+  <!--                       Set to ? to make the container explicitly set  -->
+  <!--                       this parameter.                                -->
+  <!--                                                                      -->
+  <!--   development         Is Jasper used in development mode (will check -->
+  <!--                       for JSP modification on every access)?  [true] -->
+  <!--                                                                      -->
+  <!--   enablePooling       Determines whether tag handler pooling is      -->
+  <!--                       enabled  [true]                                -->
+  <!--                                                                      -->
+  <!--   fork                Tell Ant to fork compiles of JSP pages so that -->
+  <!--                       a separate JVM is used for JSP page compiles   -->
+  <!--                       from the one Tomcat is running in. [true]      -->
+  <!--                                                                      -->
+  <!--   ieClassId           The class-id value to be sent to Internet      -->
+  <!--                       Explorer when using <jsp:plugin> tags.         -->
+  <!--                       [clsid:8AD9C840-044E-11D1-B3E9-00805F499D93]   -->
+  <!--                                                                      -->
+  <!--   javaEncoding        Java file encoding to use for generating java  -->
+  <!--                       source files. [UTF-8]                          -->
+  <!--                                                                      -->
+  <!--   keepgenerated       Should we keep the generated Java source code  -->
+  <!--                       for each page instead of deleting it? [true]   -->
+  <!--                                                                      -->
+  <!--   logVerbosityLevel   The level of detailed messages to be produced  -->
+  <!--                       by this servlet.  Increasing levels cause the  -->
+  <!--                       generation of more messages.  Valid values are -->
+  <!--                       FATAL, ERROR, WARNING, INFORMATION, and DEBUG. -->
+  <!--                       [WARNING]                                      -->
+  <!--                                                                      -->
+  <!--   mappedfile          Should we generate static content with one     -->
+  <!--                       print statement per input line, to ease        -->
+  <!--                       debugging?  [false]                            -->
+  <!--                                                                      -->
+  <!--                                                                      -->
+  <!--   reloading           Should Jasper check for modified JSPs?  [true] -->
+  <!--                                                                      -->
+  <!--   suppressSmap        Should the generation of SMAP info for JSR45   -->
+  <!--                       debugging be suppressed?  [false]              -->
+  <!--                                                                      -->
+  <!--   dumpSmap            Should the SMAP info for JSR45 debugging be    -->
+  <!--                       dumped to a file? [false]                      -->
+  <!--                       False if suppressSmap is true                  -->
+  <!--                                                                      -->
+  <!--   scratchdir          What scratch directory should we use when      -->
+  <!--                       compiling JSP pages?  [default work directory  -->
+  <!--                       for the current web application]               -->
+  <!--                                                                      -->
+  <!--   tagpoolMaxSize      The maximum tag handler pool size  [5]         -->
+  <!--                                                                      -->
+  <!--   xpoweredBy          Determines whether X-Powered-By response       -->
+  <!--                       header is added by generated servlet  [false]  -->
+  <!--                                                                      -->
+  <!-- If you wish to use Jikes to compile JSP pages:                       -->
+  <!--   Set the init parameter "compiler" to "jikes".  Define              -->
+  <!--   the property "-Dbuild.compiler.emacs=true" when starting Jetty     -->
+  <!--   to cause Jikes to emit error messages in a format compatible with  -->
+  <!--   Jasper.                                                            -->
+  <!--   If you get an error reporting that jikes can't use UTF-8 encoding, -->
+  <!--   try setting the init parameter "javaEncoding" to "ISO-8859-1".     -->
+  <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  -->
+  <servlet id="jsp">
+    <servlet-name>jsp</servlet-name>
+    <servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class>
+    <init-param>
+        <param-name>logVerbosityLevel</param-name>
+        <param-value>DEBUG</param-value>
+    </init-param>
+    <init-param>
+        <param-name>fork</param-name>
+        <param-value>false</param-value>
+    </init-param>
+    <init-param>
+        <param-name>xpoweredBy</param-name>
+        <param-value>false</param-value>
+    </init-param>
+    <!--  
+    <init-param>
+        <param-name>classpath</param-name>
+        <param-value>?</param-value>
+    </init-param>
+    -->
+    <load-on-startup>0</load-on-startup>
+  </servlet>
+
+  <servlet-mapping> 
+    <servlet-name>jsp</servlet-name> 
+    <url-pattern>*.jsp</url-pattern> 
+    <url-pattern>*.jspf</url-pattern>
+    <url-pattern>*.jspx</url-pattern>
+    <url-pattern>*.xsp</url-pattern>
+    <url-pattern>*.JSP</url-pattern> 
+    <url-pattern>*.JSPF</url-pattern>
+    <url-pattern>*.JSPX</url-pattern>
+    <url-pattern>*.XSP</url-pattern>
+  </servlet-mapping>
+  
+  <!-- ==================================================================== -->
+  <!-- Dynamic Servlet Invoker.                                             -->
+  <!-- This servlet invokes anonymous servlets that have not been defined   -->
+  <!-- in the web.xml or by other means. The first element of the pathInfo  -->
+  <!-- of a request passed to the envoker is treated as a servlet name for  -->
+  <!-- an existing servlet, or as a class name of a new servlet.            -->
+  <!-- This servlet is normally mapped to /servlet/*                        -->
+  <!-- This servlet support the following initParams:                       -->
+  <!--                                                                      -->
+  <!--  nonContextServlets       If false, the invoker can only load        -->
+  <!--                           servlets from the contexts classloader.    -->
+  <!--                           This is false by default and setting this  -->
+  <!--                           to true may have security implications.    -->
+  <!--                                                                      -->
+  <!--  verbose                  If true, log dynamic loads                 -->
+  <!--                                                                      -->
+  <!--  *                        All other parameters are copied to the     -->
+  <!--                           each dynamic servlet as init parameters    -->
+  <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  -->
+  <!-- Uncomment for dynamic invocation
+  <servlet>
+    <servlet-name>invoker</servlet-name>
+    <servlet-class>org.mortbay.jetty.servlet.Invoker</servlet-class>
+    <init-param>
+      <param-name>verbose</param-name>
+      <param-value>false</param-value>
+    </init-param>
+    <init-param>
+      <param-name>nonContextServlets</param-name>
+      <param-value>false</param-value>
+    </init-param>
+    <init-param>
+      <param-name>dynamicParam</param-name>
+      <param-value>anyValue</param-value>
+    </init-param>
+    <load-on-startup>0</load-on-startup>
+  </servlet>
+
+  <servlet-mapping> <servlet-name>invoker</servlet-name> <url-pattern>/servlet/*</url-pattern> </servlet-mapping>
+  -->
+
+
+
+  <!-- ==================================================================== -->
+  <session-config>
+    <session-timeout>30</session-timeout>
+  </session-config>
+
+  <!-- ==================================================================== -->
+  <!-- Default MIME mappings                                                -->
+  <!-- The default MIME mappings are provided by the mime.properties        -->
+  <!-- resource in the org.mortbay.jetty.jar file.  Additional or modified  -->
+  <!-- mappings may be specified here                                       -->
+  <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  -->
+  <!-- UNCOMMENT TO ACTIVATE
+  <mime-mapping>
+    <extension>mysuffix</extension>
+    <mime-type>mymime/type</mime-type>
+  </mime-mapping>
+  -->
+
+  <!-- ==================================================================== -->
+  <welcome-file-list>
+    <welcome-file>index.html</welcome-file>
+    <welcome-file>index.htm</welcome-file>
+    <welcome-file>index.jsp</welcome-file>
+  </welcome-file-list>
+
+  <!-- ==================================================================== -->
+  <locale-encoding-mapping-list>
+    <locale-encoding-mapping><locale>ar</locale><encoding>ISO-8859-6</encoding></locale-encoding-mapping>
+    <locale-encoding-mapping><locale>be</locale><encoding>ISO-8859-5</encoding></locale-encoding-mapping>
+    <locale-encoding-mapping><locale>bg</locale><encoding>ISO-8859-5</encoding></locale-encoding-mapping>
+    <locale-encoding-mapping><locale>ca</locale><encoding>ISO-8859-1</encoding></locale-encoding-mapping>
+    <locale-encoding-mapping><locale>cs</locale><encoding>ISO-8859-2</encoding></locale-encoding-mapping>
+    <locale-encoding-mapping><locale>da</locale><encoding>ISO-8859-1</encoding></locale-encoding-mapping>
+    <locale-encoding-mapping><locale>de</locale><encoding>ISO-8859-1</encoding></locale-encoding-mapping>
+    <locale-encoding-mapping><locale>el</locale><encoding>ISO-8859-7</encoding></locale-encoding-mapping>
+    <locale-encoding-mapping><locale>en</locale><encoding>ISO-8859-1</encoding></locale-encoding-mapping>
+    <locale-encoding-mapping><locale>es</locale><encoding>ISO-8859-1</encoding></locale-encoding-mapping>
+    <locale-encoding-mapping><locale>et</locale><encoding>ISO-8859-1</encoding></locale-encoding-mapping>
+    <locale-encoding-mapping><locale>fi</locale><encoding>ISO-8859-1</encoding></locale-encoding-mapping>
+    <locale-encoding-mapping><locale>fr</locale><encoding>ISO-8859-1</encoding></locale-encoding-mapping>
+    <locale-encoding-mapping><locale>hr</locale><encoding>ISO-8859-2</encoding></locale-encoding-mapping>
+    <locale-encoding-mapping><locale>hu</locale><encoding>ISO-8859-2</encoding></locale-encoding-mapping>
+    <locale-encoding-mapping><locale>is</locale><encoding>ISO-8859-1</encoding></locale-encoding-mapping>
+    <locale-encoding-mapping><locale>it</locale><encoding>ISO-8859-1</encoding></locale-encoding-mapping>
+    <locale-encoding-mapping><locale>iw</locale><encoding>ISO-8859-8</encoding></locale-encoding-mapping>
+    <locale-encoding-mapping><locale>ja</locale><encoding>Shift_JIS</encoding></locale-encoding-mapping>
+    <locale-encoding-mapping><locale>ko</locale><encoding>EUC-KR</encoding></locale-encoding-mapping>     
+    <locale-encoding-mapping><locale>lt</locale><encoding>ISO-8859-2</encoding></locale-encoding-mapping>
+    <locale-encoding-mapping><locale>lv</locale><encoding>ISO-8859-2</encoding></locale-encoding-mapping>
+    <locale-encoding-mapping><locale>mk</locale><encoding>ISO-8859-5</encoding></locale-encoding-mapping>
+    <locale-encoding-mapping><locale>nl</locale><encoding>ISO-8859-1</encoding></locale-encoding-mapping>
+    <locale-encoding-mapping><locale>no</locale><encoding>ISO-8859-1</encoding></locale-encoding-mapping>
+    <locale-encoding-mapping><locale>pl</locale><encoding>ISO-8859-2</encoding></locale-encoding-mapping>
+    <locale-encoding-mapping><locale>pt</locale><encoding>ISO-8859-1</encoding></locale-encoding-mapping>
+    <locale-encoding-mapping><locale>ro</locale><encoding>ISO-8859-2</encoding></locale-encoding-mapping>
+    <locale-encoding-mapping><locale>ru</locale><encoding>ISO-8859-5</encoding></locale-encoding-mapping>
+    <locale-encoding-mapping><locale>sh</locale><encoding>ISO-8859-5</encoding></locale-encoding-mapping>
+    <locale-encoding-mapping><locale>sk</locale><encoding>ISO-8859-2</encoding></locale-encoding-mapping>
+    <locale-encoding-mapping><locale>sl</locale><encoding>ISO-8859-2</encoding></locale-encoding-mapping>
+    <locale-encoding-mapping><locale>sq</locale><encoding>ISO-8859-2</encoding></locale-encoding-mapping>
+    <locale-encoding-mapping><locale>sr</locale><encoding>ISO-8859-5</encoding></locale-encoding-mapping>
+    <locale-encoding-mapping><locale>sv</locale><encoding>ISO-8859-1</encoding></locale-encoding-mapping>
+    <locale-encoding-mapping><locale>tr</locale><encoding>ISO-8859-9</encoding></locale-encoding-mapping>
+    <locale-encoding-mapping><locale>uk</locale><encoding>ISO-8859-5</encoding></locale-encoding-mapping>
+    <locale-encoding-mapping><locale>zh</locale><encoding>GB2312</encoding></locale-encoding-mapping>
+    <locale-encoding-mapping><locale>zh_TW</locale><encoding>Big5</encoding></locale-encoding-mapping>   
+  </locale-encoding-mapping-list>
+  
+  <security-constraint>
+    <web-resource-collection>
+      <web-resource-name>Disable TRACE</web-resource-name>
+      <url-pattern>/</url-pattern>
+      <http-method>TRACE</http-method>
+    </web-resource-collection>
+    <auth-constraint/>
+  </security-constraint>
+  
+</web-app>
+

+ 3 - 0
VB_DSM_V2.1/vbdsm-web/vbdsm-charts/src/main/webapp/META-INF/MANIFEST.MF

@@ -0,0 +1,3 @@
+Manifest-Version: 1.0
+Class-Path: 
+

+ 74 - 0
VB_DSM_V2.1/vbdsm-web/vbdsm-charts/src/main/webapp/WEB-INF/web.xml

@@ -0,0 +1,74 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.5"
+         xmlns="http://java.sun.com/xml/ns/javaee"
+         xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
+	http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
+
+    <servlet>
+        <servlet-name>dispatcher</servlet-name>
+        <servlet-class>cn.vbdsm.common.servlets.ApplicationServlet</servlet-class>
+        <init-param>
+            <param-name>contextConfigLocation</param-name>
+            <param-value>classpath:application-web.xml</param-value>
+        </init-param>
+        <load-on-startup>0</load-on-startup>
+    </servlet>
+    <servlet-mapping>
+        <servlet-name>dispatcher</servlet-name>
+        <url-pattern>/open/exporting</url-pattern>
+    </servlet-mapping>
+
+    <servlet>
+        <servlet-name>DruidStatView</servlet-name>
+        <servlet-class>com.alibaba.druid.support.http.StatViewServlet</servlet-class>
+    </servlet>
+    <servlet-mapping>
+        <servlet-name>DruidStatView</servlet-name>
+        <url-pattern>/druid/*</url-pattern>
+    </servlet-mapping>
+
+    <filter>
+        <filter-name>DruidWebStatFilter</filter-name>
+        <filter-class>com.alibaba.druid.support.http.WebStatFilter</filter-class>
+        <!-- 排除一些不必要的url,比如.js,/jslib/等等。配置在init-param中 -->
+        <init-param>
+            <param-name>exclusions</param-name>
+            <param-value>*.js,*.gif,*.jpg,*.png,*.css,*.ico,/druid/*</param-value>
+        </init-param>
+        <!-- 缺省sessionStatMaxCount是1000个。你可以按需要进行配置 -->
+        <init-param>
+            <param-name>sessionStatMaxCount</param-name>
+            <param-value>1000</param-value>
+        </init-param>
+        <!-- 你可以关闭session统计功能 -->
+        <init-param>
+            <param-name>sessionStatEnable</param-name>
+            <param-value>true</param-value>
+        </init-param>
+        <!-- 保存在session中的sessionName 此处 userinfo 为系统中SessionName。如果你session中保存的是非string类型的对象,需要重载toString方法 -->
+        <init-param>
+            <param-name>principalSessionName</param-name>
+            <param-value>userinfo.toString()</param-value>
+        </init-param>
+        <!-- 保存在Cookie中的CookieName。此处 _uname 为系统中CookieName -->
+        <init-param>
+            <param-name>principalCookieName</param-name>
+            <param-value>_uname</param-value>
+        </init-param>
+        <!-- druid 0.2.7版本开始支持profile,配置profileEnable能够监控单个url调用的sql列表 -->
+        <init-param>
+            <param-name>profileEnable</param-name>
+            <param-value>true</param-value>
+        </init-param>
+    </filter>
+    <filter-mapping>
+        <filter-name>DruidWebStatFilter</filter-name>
+        <url-pattern>/*</url-pattern>
+    </filter-mapping>
+
+
+    <welcome-file-list>
+        <welcome-file>/index.html</welcome-file>
+    </welcome-file-list>
+
+</web-app>

+ 1 - 1
VB_DSM_V2.1/vbdsm-web/vbdsm-explorer/src/main/resources/local/redis-host.properties

@@ -1 +1 @@
-redis_ref_hosts=47.112.30.247:16379
+redis_ref_hosts=47.112.30.247:6399:Iwb-2017

+ 2 - 2
VB_DSM_V2.1/vbdsm-web/vbdsm-gov-new/src/main/resources/config/application-dev.yml

@@ -7,8 +7,8 @@ tg:
 spring:
   redis:
     host: 47.112.30.247
-    #password: Iwb-2017
-    port: 16379
+    password: Iwb-2017
+    port: 6399
     database: 0
     pool:
       maxActive: 8

+ 1 - 1
VB_DSM_V2.1/vbdsm-web/vbdsm-gov/src/main/resources/local/redis-host.properties

@@ -2,7 +2,7 @@
 #222.92.214.198:6379
 #192.168.81.17:6379
 #static.chnmooc.com:6379
-redis_ref_hosts=47.112.30.247:16379
+redis_ref_hosts=47.112.30.247:6399:Iwb-2017
 #redis.host=127.0.0.1
 #redis.port=6379
 #redis.expire=1800

+ 1 - 1
VB_DSM_V2.1/vbdsm-web/vbdsm-manage/src/main/resources/local/redis-host.properties

@@ -1 +1 @@
-redis_ref_hosts=47.112.30.247:16379
+redis_ref_hosts=47.112.30.247:6399:Iwb-2017

+ 1 - 10
VB_DSM_V2.1/vbdsm-web/vbdsm-passport/src/main/resources/local/redis-host.properties

@@ -1,10 +1 @@
-#redis_ref_hosts=222.92.214.198:6379
-#222.92.214.198:6379
-#192.168.81.17:6379
-#static.chnmooc.com:6379
-redis_ref_hosts=47.112.30.247:16379
-#redis.host=127.0.0.1
-#redis.port=6379
-#redis.expire=1800
-#redis.timeout=10000
-#redis.password=123456
+redis_ref_hosts=47.112.30.247:6399:Iwb-2017

+ 1 - 1
VB_DSM_V2.1/vbdsm-web/vbdsm-powerservice/src/main/resources/local/redis-host.properties

@@ -2,7 +2,7 @@
 #222.92.214.198:6379
 #192.168.81.17:6379
 #static.chnmooc.com:6379
-redis_ref_hosts=47.112.30.247:16379
+redis_ref_hosts=47.112.30.247:6399:Iwb-2017
 #redis.host=127.0.0.1
 #redis.port=6379
 #redis.expire=1800

Некоторые файлы не были показаны из-за большого количества измененных файлов