diff --git a/src/ACUBL.properties b/src/ACUBL.properties index 9c4b0ab..df9ffdb 100644 --- a/src/ACUBL.properties +++ b/src/ACUBL.properties @@ -1,6 +1,6 @@ #ACU\u53D8\u91CF\u8868\u914D\u7F6E\u6587\u4EF6 -######## THXC.ACU001 ######## +######## 01 HXC.ACU001 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU001.CH.COUNT = 6 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -144,7 +144,7 @@ -######## THXC.ACU002 ######## +######## 02 THXC.ACU002 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU002.CH.COUNT = 6 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -288,7 +288,7 @@ -######## THXC.ACU003 ######## +######## 03 THXC.ACU003 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU003.CH.COUNT = 6 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -432,7 +432,7 @@ -######## THXC.ACU004 ######## +######## 04 THXC.ACU004 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU004.CH.COUNT = 6 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -576,7 +576,7 @@ -######## THXC.ACU005 ######## +######## 05 THXC.ACU005 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU005.CH.COUNT = 6 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -720,7 +720,7 @@ -######## THXC.ACU006 ######## +######## 06 THXC.ACU006 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU006.CH.COUNT = 6 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -812,7 +812,7 @@ #\u98CE\u673A\u6570\u91CF -THXC.ACU006.FJ.COUNT = 9 +THXC.ACU006.FJ.COUNT = 6 #\u98CE\u673A\u7F16\u7801\u5217\u8868 THXC.ACU006.FJ.ZC.LIST = THXC.ACU006.F.DFJ01;THXC.ACU006.F.DFJ02;THXC.ACU006.F.SFJ01;THXC.ACU006.F.SFJ02;THXC.ACU006.F.RFJ01;THXC.ACU006.F.RFJ02 #\u98CE\u673A\u72B6\u6001\u8D77\u59CB\u5730\u5740 @@ -864,7 +864,7 @@ -######## THXC.ACU008 ######## +######## 07 THXC.ACU008 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU008.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -1008,7 +1008,7 @@ -######## THXC.ACU009 ######## +######## 08 THXC.ACU009 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU009.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -1152,7 +1152,7 @@ -######## THXC.ACU010 ######## +######## 09 THXC.ACU010 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU010.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -1296,7 +1296,7 @@ -######## THXC.ACU011 ######## +######## 10 THXC.ACU011 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU011.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -1440,7 +1440,7 @@ -######## THXC.ACU013 ######## +######## 11 THXC.ACU013 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU013.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -1584,7 +1584,7 @@ -######## THXC.ACU014 ######## +######## 12 THXC.ACU014 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU014.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -1729,7 +1729,7 @@ -######## THXC.ACU015 ######## +######## 13 THXC.ACU015 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU015.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -1874,7 +1874,7 @@ -######## THXC.ACU016 ######## +######## 14 THXC.ACU016 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU016.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2020,7 +2020,7 @@ ######## \u4E8C\u671F\u4E09\u6807\u6BB5 ######## -######## THXC.ACU301 ######## +######## 01 THXC.ACU301 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU301.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2070,7 +2070,7 @@ -######## THXC.ACU302 ######## +######## 02 THXC.ACU302 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU302.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2083,7 +2083,7 @@ -######## THXC.ACU303 ######## +######## 03 THXC.ACU303 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU303.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2096,7 +2096,7 @@ -######## THXC.ACU304 ######## +######## 04 THXC.ACU304 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU304.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2109,7 +2109,7 @@ -######## THXC.ACU305 ######## +######## 05 THXC.ACU305 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU305.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2122,7 +2122,7 @@ -######## THXC.ACU501 ######## +######## 06 THXC.ACU501 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU501.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2135,7 +2135,7 @@ -######## THXC.ACU502 ######## +######## 07 THXC.ACU502 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU502.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2148,7 +2148,7 @@ -######## THXC.ACU503 ######## +######## 08 THXC.ACU503 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU503.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2161,7 +2161,7 @@ -######## THXC.ACU504 ######## +######## 09 THXC.ACU504 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU504.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2174,7 +2174,7 @@ -######## THXC.ACU505 ######## +######## 10 THXC.ACU505 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU505.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2187,7 +2187,7 @@ -######## THXC.ACU506 ######## +######## 11 THXC.ACU506 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU506.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2200,7 +2200,7 @@ -######## THXC.ACU507 ######## +######## 12 THXC.ACU507 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU507.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2213,7 +2213,7 @@ -######## THXC.ACU601 ######## +######## 13 THXC.ACU601 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU601.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2226,7 +2226,7 @@ -######## THXC.ACU602 ######## +######## 14 THXC.ACU602 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU602.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2239,7 +2239,7 @@ -######## THXC.ACU603 ######## +######## 15 THXC.ACU603 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU603.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2252,7 +2252,7 @@ -######## THXC.ACU604 ######## +######## 16 THXC.ACU604 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU604.WSYQ.COUNT = 6 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2265,7 +2265,7 @@ -######## THXC.ACUS03 ######## +######## 17 THXC.ACUS03 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACUS03.WSYQ.COUNT = 2 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2278,7 +2278,7 @@ -######## THXC.ACUS05 ######## +######## 18 THXC.ACUS05 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACUS05.WSYQ.COUNT = 2 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2291,7 +2291,7 @@ -######## THXC.ACUS06 ######## +######## 19 THXC.ACUS06 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACUS06.WSYQ.COUNT = 2 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2304,6 +2304,103 @@ +######## \u4E8C\u671F\u56DB\u6807\u6BB5 ######## +######## 01 THXC.ACU107 ######## + + +######## 02 THXC.ACU108 ######## + + +######## 03 THXC.ACU109 ######## + + +######## 04 THXC.ACU110 ######## + + +######## 05 THXC.ACU306 ######## + + +######## 06 THXC.ACU307 ######## + + +######## 07 THXC.ACU308 ######## + + +######## 08 THXC.ACU309 ######## + + +######## 09 THXC.ACU401 ######## + + +######## 10 THXC.ACU402 ######## + + +######## 11 THXC.ACU403 ######## + + +######## 12 THXC.ACU404 ######## + + +######## 13 THXC.ACU405 ######## + + +######## 14 THXC.ACU406 ######## + + +######## 15 THXC.ACU407 ######## + + +######## 16 THXC.ACU408 ######## + + +######## 17 THXC.ACUS04 ######## + + +######## 18 THXC.ACU701 ######## + + +######## 19 THXC.ACU702 ######## + + +######## 20 THXC.ACU703 ######## + + +######## 21 THXC.ACU704 ######## + + +######## 22 THXC.ACU705 ######## + + +######## 23 THXC.ACU706 ######## + + +######## 24 THXC.ACU801 ######## + + +######## 25 THXC.ACU802 ######## + + +######## 26 THXC.ACU803 ######## + + +######## 27 THXC.ACU804 ######## + + +######## 28 THXC.ACU805 ######## + + +######## 29 THXC.ACU806 ######## + + +######## 30 THXC.ACU807 ######## + + +######## 31 THXC.ACUS07 ######## + + +######## 32 THXC.ACUS08 ######## + + ######## \u9F99\u7FD4\u8DEF\u71C3\u6C14\u6BB5 THXC.ACU801 ######## #\u98CE\u673A\u6570\u91CF THXC.ACU801.FJ.COUNT = 1 diff --git a/src/ACUBL.properties b/src/ACUBL.properties index 9c4b0ab..df9ffdb 100644 --- a/src/ACUBL.properties +++ b/src/ACUBL.properties @@ -1,6 +1,6 @@ #ACU\u53D8\u91CF\u8868\u914D\u7F6E\u6587\u4EF6 -######## THXC.ACU001 ######## +######## 01 HXC.ACU001 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU001.CH.COUNT = 6 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -144,7 +144,7 @@ -######## THXC.ACU002 ######## +######## 02 THXC.ACU002 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU002.CH.COUNT = 6 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -288,7 +288,7 @@ -######## THXC.ACU003 ######## +######## 03 THXC.ACU003 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU003.CH.COUNT = 6 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -432,7 +432,7 @@ -######## THXC.ACU004 ######## +######## 04 THXC.ACU004 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU004.CH.COUNT = 6 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -576,7 +576,7 @@ -######## THXC.ACU005 ######## +######## 05 THXC.ACU005 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU005.CH.COUNT = 6 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -720,7 +720,7 @@ -######## THXC.ACU006 ######## +######## 06 THXC.ACU006 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU006.CH.COUNT = 6 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -812,7 +812,7 @@ #\u98CE\u673A\u6570\u91CF -THXC.ACU006.FJ.COUNT = 9 +THXC.ACU006.FJ.COUNT = 6 #\u98CE\u673A\u7F16\u7801\u5217\u8868 THXC.ACU006.FJ.ZC.LIST = THXC.ACU006.F.DFJ01;THXC.ACU006.F.DFJ02;THXC.ACU006.F.SFJ01;THXC.ACU006.F.SFJ02;THXC.ACU006.F.RFJ01;THXC.ACU006.F.RFJ02 #\u98CE\u673A\u72B6\u6001\u8D77\u59CB\u5730\u5740 @@ -864,7 +864,7 @@ -######## THXC.ACU008 ######## +######## 07 THXC.ACU008 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU008.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -1008,7 +1008,7 @@ -######## THXC.ACU009 ######## +######## 08 THXC.ACU009 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU009.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -1152,7 +1152,7 @@ -######## THXC.ACU010 ######## +######## 09 THXC.ACU010 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU010.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -1296,7 +1296,7 @@ -######## THXC.ACU011 ######## +######## 10 THXC.ACU011 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU011.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -1440,7 +1440,7 @@ -######## THXC.ACU013 ######## +######## 11 THXC.ACU013 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU013.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -1584,7 +1584,7 @@ -######## THXC.ACU014 ######## +######## 12 THXC.ACU014 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU014.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -1729,7 +1729,7 @@ -######## THXC.ACU015 ######## +######## 13 THXC.ACU015 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU015.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -1874,7 +1874,7 @@ -######## THXC.ACU016 ######## +######## 14 THXC.ACU016 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU016.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2020,7 +2020,7 @@ ######## \u4E8C\u671F\u4E09\u6807\u6BB5 ######## -######## THXC.ACU301 ######## +######## 01 THXC.ACU301 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU301.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2070,7 +2070,7 @@ -######## THXC.ACU302 ######## +######## 02 THXC.ACU302 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU302.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2083,7 +2083,7 @@ -######## THXC.ACU303 ######## +######## 03 THXC.ACU303 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU303.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2096,7 +2096,7 @@ -######## THXC.ACU304 ######## +######## 04 THXC.ACU304 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU304.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2109,7 +2109,7 @@ -######## THXC.ACU305 ######## +######## 05 THXC.ACU305 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU305.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2122,7 +2122,7 @@ -######## THXC.ACU501 ######## +######## 06 THXC.ACU501 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU501.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2135,7 +2135,7 @@ -######## THXC.ACU502 ######## +######## 07 THXC.ACU502 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU502.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2148,7 +2148,7 @@ -######## THXC.ACU503 ######## +######## 08 THXC.ACU503 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU503.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2161,7 +2161,7 @@ -######## THXC.ACU504 ######## +######## 09 THXC.ACU504 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU504.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2174,7 +2174,7 @@ -######## THXC.ACU505 ######## +######## 10 THXC.ACU505 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU505.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2187,7 +2187,7 @@ -######## THXC.ACU506 ######## +######## 11 THXC.ACU506 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU506.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2200,7 +2200,7 @@ -######## THXC.ACU507 ######## +######## 12 THXC.ACU507 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU507.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2213,7 +2213,7 @@ -######## THXC.ACU601 ######## +######## 13 THXC.ACU601 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU601.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2226,7 +2226,7 @@ -######## THXC.ACU602 ######## +######## 14 THXC.ACU602 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU602.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2239,7 +2239,7 @@ -######## THXC.ACU603 ######## +######## 15 THXC.ACU603 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU603.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2252,7 +2252,7 @@ -######## THXC.ACU604 ######## +######## 16 THXC.ACU604 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU604.WSYQ.COUNT = 6 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2265,7 +2265,7 @@ -######## THXC.ACUS03 ######## +######## 17 THXC.ACUS03 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACUS03.WSYQ.COUNT = 2 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2278,7 +2278,7 @@ -######## THXC.ACUS05 ######## +######## 18 THXC.ACUS05 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACUS05.WSYQ.COUNT = 2 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2291,7 +2291,7 @@ -######## THXC.ACUS06 ######## +######## 19 THXC.ACUS06 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACUS06.WSYQ.COUNT = 2 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2304,6 +2304,103 @@ +######## \u4E8C\u671F\u56DB\u6807\u6BB5 ######## +######## 01 THXC.ACU107 ######## + + +######## 02 THXC.ACU108 ######## + + +######## 03 THXC.ACU109 ######## + + +######## 04 THXC.ACU110 ######## + + +######## 05 THXC.ACU306 ######## + + +######## 06 THXC.ACU307 ######## + + +######## 07 THXC.ACU308 ######## + + +######## 08 THXC.ACU309 ######## + + +######## 09 THXC.ACU401 ######## + + +######## 10 THXC.ACU402 ######## + + +######## 11 THXC.ACU403 ######## + + +######## 12 THXC.ACU404 ######## + + +######## 13 THXC.ACU405 ######## + + +######## 14 THXC.ACU406 ######## + + +######## 15 THXC.ACU407 ######## + + +######## 16 THXC.ACU408 ######## + + +######## 17 THXC.ACUS04 ######## + + +######## 18 THXC.ACU701 ######## + + +######## 19 THXC.ACU702 ######## + + +######## 20 THXC.ACU703 ######## + + +######## 21 THXC.ACU704 ######## + + +######## 22 THXC.ACU705 ######## + + +######## 23 THXC.ACU706 ######## + + +######## 24 THXC.ACU801 ######## + + +######## 25 THXC.ACU802 ######## + + +######## 26 THXC.ACU803 ######## + + +######## 27 THXC.ACU804 ######## + + +######## 28 THXC.ACU805 ######## + + +######## 29 THXC.ACU806 ######## + + +######## 30 THXC.ACU807 ######## + + +######## 31 THXC.ACUS07 ######## + + +######## 32 THXC.ACUS08 ######## + + ######## \u9F99\u7FD4\u8DEF\u71C3\u6C14\u6BB5 THXC.ACU801 ######## #\u98CE\u673A\u6570\u91CF THXC.ACU801.FJ.COUNT = 1 diff --git a/src/com/szpg/db/dao/impl/PgAcuCmdDaoImpl.java b/src/com/szpg/db/dao/impl/PgAcuCmdDaoImpl.java index b752a9c..406d9ee 100644 --- a/src/com/szpg/db/dao/impl/PgAcuCmdDaoImpl.java +++ b/src/com/szpg/db/dao/impl/PgAcuCmdDaoImpl.java @@ -154,13 +154,14 @@ Connection conn = null; String insertStr = "INSERT INTO PG_ACU_CMD " + - "(ID, TM, CMD_TYPE, DEST_ACU_CODE, TIMEOUT) " + - "VALUES (?, TO_DATE(?, 'YYYYMMDDHH24MISS'), ?, ?, '0')"; - Object[] params = new Object[4]; + "(ID, TM, CMD_TYPE, DEST_ACU_CODE, TIMEOUT, DEVICE_CODE) " + + "VALUES (?, TO_DATE(?, 'YYYYMMDDHH24MISS'), ?, ?, '0', ?)"; + Object[] params = new Object[5]; params[0] = cmd.getId(); params[1] = TimeFormat.format(cmd.getTm(), "yyyyMMddHHmmss"); params[2] = cmd.getCmd_type(); params[3] = cmd.getDest_acu_code(); + params[4] = cmd.getDevice_code(); try { conn = ConnectionManager.getConnectionFromC3P0(); diff --git a/src/ACUBL.properties b/src/ACUBL.properties index 9c4b0ab..df9ffdb 100644 --- a/src/ACUBL.properties +++ b/src/ACUBL.properties @@ -1,6 +1,6 @@ #ACU\u53D8\u91CF\u8868\u914D\u7F6E\u6587\u4EF6 -######## THXC.ACU001 ######## +######## 01 HXC.ACU001 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU001.CH.COUNT = 6 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -144,7 +144,7 @@ -######## THXC.ACU002 ######## +######## 02 THXC.ACU002 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU002.CH.COUNT = 6 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -288,7 +288,7 @@ -######## THXC.ACU003 ######## +######## 03 THXC.ACU003 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU003.CH.COUNT = 6 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -432,7 +432,7 @@ -######## THXC.ACU004 ######## +######## 04 THXC.ACU004 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU004.CH.COUNT = 6 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -576,7 +576,7 @@ -######## THXC.ACU005 ######## +######## 05 THXC.ACU005 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU005.CH.COUNT = 6 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -720,7 +720,7 @@ -######## THXC.ACU006 ######## +######## 06 THXC.ACU006 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU006.CH.COUNT = 6 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -812,7 +812,7 @@ #\u98CE\u673A\u6570\u91CF -THXC.ACU006.FJ.COUNT = 9 +THXC.ACU006.FJ.COUNT = 6 #\u98CE\u673A\u7F16\u7801\u5217\u8868 THXC.ACU006.FJ.ZC.LIST = THXC.ACU006.F.DFJ01;THXC.ACU006.F.DFJ02;THXC.ACU006.F.SFJ01;THXC.ACU006.F.SFJ02;THXC.ACU006.F.RFJ01;THXC.ACU006.F.RFJ02 #\u98CE\u673A\u72B6\u6001\u8D77\u59CB\u5730\u5740 @@ -864,7 +864,7 @@ -######## THXC.ACU008 ######## +######## 07 THXC.ACU008 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU008.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -1008,7 +1008,7 @@ -######## THXC.ACU009 ######## +######## 08 THXC.ACU009 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU009.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -1152,7 +1152,7 @@ -######## THXC.ACU010 ######## +######## 09 THXC.ACU010 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU010.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -1296,7 +1296,7 @@ -######## THXC.ACU011 ######## +######## 10 THXC.ACU011 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU011.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -1440,7 +1440,7 @@ -######## THXC.ACU013 ######## +######## 11 THXC.ACU013 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU013.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -1584,7 +1584,7 @@ -######## THXC.ACU014 ######## +######## 12 THXC.ACU014 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU014.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -1729,7 +1729,7 @@ -######## THXC.ACU015 ######## +######## 13 THXC.ACU015 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU015.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -1874,7 +1874,7 @@ -######## THXC.ACU016 ######## +######## 14 THXC.ACU016 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU016.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2020,7 +2020,7 @@ ######## \u4E8C\u671F\u4E09\u6807\u6BB5 ######## -######## THXC.ACU301 ######## +######## 01 THXC.ACU301 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU301.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2070,7 +2070,7 @@ -######## THXC.ACU302 ######## +######## 02 THXC.ACU302 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU302.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2083,7 +2083,7 @@ -######## THXC.ACU303 ######## +######## 03 THXC.ACU303 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU303.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2096,7 +2096,7 @@ -######## THXC.ACU304 ######## +######## 04 THXC.ACU304 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU304.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2109,7 +2109,7 @@ -######## THXC.ACU305 ######## +######## 05 THXC.ACU305 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU305.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2122,7 +2122,7 @@ -######## THXC.ACU501 ######## +######## 06 THXC.ACU501 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU501.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2135,7 +2135,7 @@ -######## THXC.ACU502 ######## +######## 07 THXC.ACU502 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU502.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2148,7 +2148,7 @@ -######## THXC.ACU503 ######## +######## 08 THXC.ACU503 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU503.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2161,7 +2161,7 @@ -######## THXC.ACU504 ######## +######## 09 THXC.ACU504 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU504.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2174,7 +2174,7 @@ -######## THXC.ACU505 ######## +######## 10 THXC.ACU505 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU505.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2187,7 +2187,7 @@ -######## THXC.ACU506 ######## +######## 11 THXC.ACU506 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU506.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2200,7 +2200,7 @@ -######## THXC.ACU507 ######## +######## 12 THXC.ACU507 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU507.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2213,7 +2213,7 @@ -######## THXC.ACU601 ######## +######## 13 THXC.ACU601 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU601.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2226,7 +2226,7 @@ -######## THXC.ACU602 ######## +######## 14 THXC.ACU602 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU602.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2239,7 +2239,7 @@ -######## THXC.ACU603 ######## +######## 15 THXC.ACU603 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU603.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2252,7 +2252,7 @@ -######## THXC.ACU604 ######## +######## 16 THXC.ACU604 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU604.WSYQ.COUNT = 6 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2265,7 +2265,7 @@ -######## THXC.ACUS03 ######## +######## 17 THXC.ACUS03 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACUS03.WSYQ.COUNT = 2 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2278,7 +2278,7 @@ -######## THXC.ACUS05 ######## +######## 18 THXC.ACUS05 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACUS05.WSYQ.COUNT = 2 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2291,7 +2291,7 @@ -######## THXC.ACUS06 ######## +######## 19 THXC.ACUS06 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACUS06.WSYQ.COUNT = 2 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2304,6 +2304,103 @@ +######## \u4E8C\u671F\u56DB\u6807\u6BB5 ######## +######## 01 THXC.ACU107 ######## + + +######## 02 THXC.ACU108 ######## + + +######## 03 THXC.ACU109 ######## + + +######## 04 THXC.ACU110 ######## + + +######## 05 THXC.ACU306 ######## + + +######## 06 THXC.ACU307 ######## + + +######## 07 THXC.ACU308 ######## + + +######## 08 THXC.ACU309 ######## + + +######## 09 THXC.ACU401 ######## + + +######## 10 THXC.ACU402 ######## + + +######## 11 THXC.ACU403 ######## + + +######## 12 THXC.ACU404 ######## + + +######## 13 THXC.ACU405 ######## + + +######## 14 THXC.ACU406 ######## + + +######## 15 THXC.ACU407 ######## + + +######## 16 THXC.ACU408 ######## + + +######## 17 THXC.ACUS04 ######## + + +######## 18 THXC.ACU701 ######## + + +######## 19 THXC.ACU702 ######## + + +######## 20 THXC.ACU703 ######## + + +######## 21 THXC.ACU704 ######## + + +######## 22 THXC.ACU705 ######## + + +######## 23 THXC.ACU706 ######## + + +######## 24 THXC.ACU801 ######## + + +######## 25 THXC.ACU802 ######## + + +######## 26 THXC.ACU803 ######## + + +######## 27 THXC.ACU804 ######## + + +######## 28 THXC.ACU805 ######## + + +######## 29 THXC.ACU806 ######## + + +######## 30 THXC.ACU807 ######## + + +######## 31 THXC.ACUS07 ######## + + +######## 32 THXC.ACUS08 ######## + + ######## \u9F99\u7FD4\u8DEF\u71C3\u6C14\u6BB5 THXC.ACU801 ######## #\u98CE\u673A\u6570\u91CF THXC.ACU801.FJ.COUNT = 1 diff --git a/src/com/szpg/db/dao/impl/PgAcuCmdDaoImpl.java b/src/com/szpg/db/dao/impl/PgAcuCmdDaoImpl.java index b752a9c..406d9ee 100644 --- a/src/com/szpg/db/dao/impl/PgAcuCmdDaoImpl.java +++ b/src/com/szpg/db/dao/impl/PgAcuCmdDaoImpl.java @@ -154,13 +154,14 @@ Connection conn = null; String insertStr = "INSERT INTO PG_ACU_CMD " + - "(ID, TM, CMD_TYPE, DEST_ACU_CODE, TIMEOUT) " + - "VALUES (?, TO_DATE(?, 'YYYYMMDDHH24MISS'), ?, ?, '0')"; - Object[] params = new Object[4]; + "(ID, TM, CMD_TYPE, DEST_ACU_CODE, TIMEOUT, DEVICE_CODE) " + + "VALUES (?, TO_DATE(?, 'YYYYMMDDHH24MISS'), ?, ?, '0', ?)"; + Object[] params = new Object[5]; params[0] = cmd.getId(); params[1] = TimeFormat.format(cmd.getTm(), "yyyyMMddHHmmss"); params[2] = cmd.getCmd_type(); params[3] = cmd.getDest_acu_code(); + params[4] = cmd.getDevice_code(); try { conn = ConnectionManager.getConnectionFromC3P0(); diff --git a/src/com/szpg/db/data/PgAcuCmd.java b/src/com/szpg/db/data/PgAcuCmd.java index 9e57628..0f3cabc 100644 --- a/src/com/szpg/db/data/PgAcuCmd.java +++ b/src/com/szpg/db/data/PgAcuCmd.java @@ -23,6 +23,7 @@ private Date tm; // 命令发送时间 private String cmd_type; // 命令类型 private String dest_acu_code; // 目标ACU代码 + private String device_code; // 命令的资产编号 private boolean timeout; // 是否超时 public PgAcuCmd() { @@ -62,6 +63,14 @@ this.dest_acu_code = dest_acu_code; } + public String getDevice_code() { + return device_code; + } + + public void setDevice_code(String device_code) { + this.device_code = device_code; + } + public boolean isTimeout() { return timeout; } diff --git a/src/ACUBL.properties b/src/ACUBL.properties index 9c4b0ab..df9ffdb 100644 --- a/src/ACUBL.properties +++ b/src/ACUBL.properties @@ -1,6 +1,6 @@ #ACU\u53D8\u91CF\u8868\u914D\u7F6E\u6587\u4EF6 -######## THXC.ACU001 ######## +######## 01 HXC.ACU001 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU001.CH.COUNT = 6 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -144,7 +144,7 @@ -######## THXC.ACU002 ######## +######## 02 THXC.ACU002 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU002.CH.COUNT = 6 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -288,7 +288,7 @@ -######## THXC.ACU003 ######## +######## 03 THXC.ACU003 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU003.CH.COUNT = 6 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -432,7 +432,7 @@ -######## THXC.ACU004 ######## +######## 04 THXC.ACU004 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU004.CH.COUNT = 6 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -576,7 +576,7 @@ -######## THXC.ACU005 ######## +######## 05 THXC.ACU005 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU005.CH.COUNT = 6 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -720,7 +720,7 @@ -######## THXC.ACU006 ######## +######## 06 THXC.ACU006 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU006.CH.COUNT = 6 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -812,7 +812,7 @@ #\u98CE\u673A\u6570\u91CF -THXC.ACU006.FJ.COUNT = 9 +THXC.ACU006.FJ.COUNT = 6 #\u98CE\u673A\u7F16\u7801\u5217\u8868 THXC.ACU006.FJ.ZC.LIST = THXC.ACU006.F.DFJ01;THXC.ACU006.F.DFJ02;THXC.ACU006.F.SFJ01;THXC.ACU006.F.SFJ02;THXC.ACU006.F.RFJ01;THXC.ACU006.F.RFJ02 #\u98CE\u673A\u72B6\u6001\u8D77\u59CB\u5730\u5740 @@ -864,7 +864,7 @@ -######## THXC.ACU008 ######## +######## 07 THXC.ACU008 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU008.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -1008,7 +1008,7 @@ -######## THXC.ACU009 ######## +######## 08 THXC.ACU009 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU009.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -1152,7 +1152,7 @@ -######## THXC.ACU010 ######## +######## 09 THXC.ACU010 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU010.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -1296,7 +1296,7 @@ -######## THXC.ACU011 ######## +######## 10 THXC.ACU011 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU011.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -1440,7 +1440,7 @@ -######## THXC.ACU013 ######## +######## 11 THXC.ACU013 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU013.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -1584,7 +1584,7 @@ -######## THXC.ACU014 ######## +######## 12 THXC.ACU014 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU014.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -1729,7 +1729,7 @@ -######## THXC.ACU015 ######## +######## 13 THXC.ACU015 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU015.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -1874,7 +1874,7 @@ -######## THXC.ACU016 ######## +######## 14 THXC.ACU016 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU016.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2020,7 +2020,7 @@ ######## \u4E8C\u671F\u4E09\u6807\u6BB5 ######## -######## THXC.ACU301 ######## +######## 01 THXC.ACU301 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU301.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2070,7 +2070,7 @@ -######## THXC.ACU302 ######## +######## 02 THXC.ACU302 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU302.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2083,7 +2083,7 @@ -######## THXC.ACU303 ######## +######## 03 THXC.ACU303 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU303.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2096,7 +2096,7 @@ -######## THXC.ACU304 ######## +######## 04 THXC.ACU304 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU304.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2109,7 +2109,7 @@ -######## THXC.ACU305 ######## +######## 05 THXC.ACU305 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU305.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2122,7 +2122,7 @@ -######## THXC.ACU501 ######## +######## 06 THXC.ACU501 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU501.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2135,7 +2135,7 @@ -######## THXC.ACU502 ######## +######## 07 THXC.ACU502 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU502.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2148,7 +2148,7 @@ -######## THXC.ACU503 ######## +######## 08 THXC.ACU503 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU503.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2161,7 +2161,7 @@ -######## THXC.ACU504 ######## +######## 09 THXC.ACU504 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU504.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2174,7 +2174,7 @@ -######## THXC.ACU505 ######## +######## 10 THXC.ACU505 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU505.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2187,7 +2187,7 @@ -######## THXC.ACU506 ######## +######## 11 THXC.ACU506 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU506.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2200,7 +2200,7 @@ -######## THXC.ACU507 ######## +######## 12 THXC.ACU507 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU507.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2213,7 +2213,7 @@ -######## THXC.ACU601 ######## +######## 13 THXC.ACU601 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU601.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2226,7 +2226,7 @@ -######## THXC.ACU602 ######## +######## 14 THXC.ACU602 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU602.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2239,7 +2239,7 @@ -######## THXC.ACU603 ######## +######## 15 THXC.ACU603 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU603.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2252,7 +2252,7 @@ -######## THXC.ACU604 ######## +######## 16 THXC.ACU604 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU604.WSYQ.COUNT = 6 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2265,7 +2265,7 @@ -######## THXC.ACUS03 ######## +######## 17 THXC.ACUS03 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACUS03.WSYQ.COUNT = 2 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2278,7 +2278,7 @@ -######## THXC.ACUS05 ######## +######## 18 THXC.ACUS05 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACUS05.WSYQ.COUNT = 2 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2291,7 +2291,7 @@ -######## THXC.ACUS06 ######## +######## 19 THXC.ACUS06 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACUS06.WSYQ.COUNT = 2 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2304,6 +2304,103 @@ +######## \u4E8C\u671F\u56DB\u6807\u6BB5 ######## +######## 01 THXC.ACU107 ######## + + +######## 02 THXC.ACU108 ######## + + +######## 03 THXC.ACU109 ######## + + +######## 04 THXC.ACU110 ######## + + +######## 05 THXC.ACU306 ######## + + +######## 06 THXC.ACU307 ######## + + +######## 07 THXC.ACU308 ######## + + +######## 08 THXC.ACU309 ######## + + +######## 09 THXC.ACU401 ######## + + +######## 10 THXC.ACU402 ######## + + +######## 11 THXC.ACU403 ######## + + +######## 12 THXC.ACU404 ######## + + +######## 13 THXC.ACU405 ######## + + +######## 14 THXC.ACU406 ######## + + +######## 15 THXC.ACU407 ######## + + +######## 16 THXC.ACU408 ######## + + +######## 17 THXC.ACUS04 ######## + + +######## 18 THXC.ACU701 ######## + + +######## 19 THXC.ACU702 ######## + + +######## 20 THXC.ACU703 ######## + + +######## 21 THXC.ACU704 ######## + + +######## 22 THXC.ACU705 ######## + + +######## 23 THXC.ACU706 ######## + + +######## 24 THXC.ACU801 ######## + + +######## 25 THXC.ACU802 ######## + + +######## 26 THXC.ACU803 ######## + + +######## 27 THXC.ACU804 ######## + + +######## 28 THXC.ACU805 ######## + + +######## 29 THXC.ACU806 ######## + + +######## 30 THXC.ACU807 ######## + + +######## 31 THXC.ACUS07 ######## + + +######## 32 THXC.ACUS08 ######## + + ######## \u9F99\u7FD4\u8DEF\u71C3\u6C14\u6BB5 THXC.ACU801 ######## #\u98CE\u673A\u6570\u91CF THXC.ACU801.FJ.COUNT = 1 diff --git a/src/com/szpg/db/dao/impl/PgAcuCmdDaoImpl.java b/src/com/szpg/db/dao/impl/PgAcuCmdDaoImpl.java index b752a9c..406d9ee 100644 --- a/src/com/szpg/db/dao/impl/PgAcuCmdDaoImpl.java +++ b/src/com/szpg/db/dao/impl/PgAcuCmdDaoImpl.java @@ -154,13 +154,14 @@ Connection conn = null; String insertStr = "INSERT INTO PG_ACU_CMD " + - "(ID, TM, CMD_TYPE, DEST_ACU_CODE, TIMEOUT) " + - "VALUES (?, TO_DATE(?, 'YYYYMMDDHH24MISS'), ?, ?, '0')"; - Object[] params = new Object[4]; + "(ID, TM, CMD_TYPE, DEST_ACU_CODE, TIMEOUT, DEVICE_CODE) " + + "VALUES (?, TO_DATE(?, 'YYYYMMDDHH24MISS'), ?, ?, '0', ?)"; + Object[] params = new Object[5]; params[0] = cmd.getId(); params[1] = TimeFormat.format(cmd.getTm(), "yyyyMMddHHmmss"); params[2] = cmd.getCmd_type(); params[3] = cmd.getDest_acu_code(); + params[4] = cmd.getDevice_code(); try { conn = ConnectionManager.getConnectionFromC3P0(); diff --git a/src/com/szpg/db/data/PgAcuCmd.java b/src/com/szpg/db/data/PgAcuCmd.java index 9e57628..0f3cabc 100644 --- a/src/com/szpg/db/data/PgAcuCmd.java +++ b/src/com/szpg/db/data/PgAcuCmd.java @@ -23,6 +23,7 @@ private Date tm; // 命令发送时间 private String cmd_type; // 命令类型 private String dest_acu_code; // 目标ACU代码 + private String device_code; // 命令的资产编号 private boolean timeout; // 是否超时 public PgAcuCmd() { @@ -62,6 +63,14 @@ this.dest_acu_code = dest_acu_code; } + public String getDevice_code() { + return device_code; + } + + public void setDevice_code(String device_code) { + this.device_code = device_code; + } + public boolean isTimeout() { return timeout; } diff --git a/src/com/szpg/plc/PGDSCServlet.java b/src/com/szpg/plc/PGDSCServlet.java index 5653eb6..881c2e3 100644 --- a/src/com/szpg/plc/PGDSCServlet.java +++ b/src/com/szpg/plc/PGDSCServlet.java @@ -104,13 +104,13 @@ sendQueryJGStatusCommand(); //10巡检数据同步 - synchAssetInSpection(); +// synchAssetInSpection(); //运维数据同步 - synchMaintanceRecord(); +// synchMaintanceRecord(); // 查询二期温湿度氧气实时数据 - sendQueryWSYQValueCommand(); +// sendQueryWSYQValueCommand(); } /** diff --git a/src/ACUBL.properties b/src/ACUBL.properties index 9c4b0ab..df9ffdb 100644 --- a/src/ACUBL.properties +++ b/src/ACUBL.properties @@ -1,6 +1,6 @@ #ACU\u53D8\u91CF\u8868\u914D\u7F6E\u6587\u4EF6 -######## THXC.ACU001 ######## +######## 01 HXC.ACU001 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU001.CH.COUNT = 6 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -144,7 +144,7 @@ -######## THXC.ACU002 ######## +######## 02 THXC.ACU002 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU002.CH.COUNT = 6 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -288,7 +288,7 @@ -######## THXC.ACU003 ######## +######## 03 THXC.ACU003 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU003.CH.COUNT = 6 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -432,7 +432,7 @@ -######## THXC.ACU004 ######## +######## 04 THXC.ACU004 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU004.CH.COUNT = 6 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -576,7 +576,7 @@ -######## THXC.ACU005 ######## +######## 05 THXC.ACU005 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU005.CH.COUNT = 6 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -720,7 +720,7 @@ -######## THXC.ACU006 ######## +######## 06 THXC.ACU006 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU006.CH.COUNT = 6 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -812,7 +812,7 @@ #\u98CE\u673A\u6570\u91CF -THXC.ACU006.FJ.COUNT = 9 +THXC.ACU006.FJ.COUNT = 6 #\u98CE\u673A\u7F16\u7801\u5217\u8868 THXC.ACU006.FJ.ZC.LIST = THXC.ACU006.F.DFJ01;THXC.ACU006.F.DFJ02;THXC.ACU006.F.SFJ01;THXC.ACU006.F.SFJ02;THXC.ACU006.F.RFJ01;THXC.ACU006.F.RFJ02 #\u98CE\u673A\u72B6\u6001\u8D77\u59CB\u5730\u5740 @@ -864,7 +864,7 @@ -######## THXC.ACU008 ######## +######## 07 THXC.ACU008 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU008.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -1008,7 +1008,7 @@ -######## THXC.ACU009 ######## +######## 08 THXC.ACU009 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU009.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -1152,7 +1152,7 @@ -######## THXC.ACU010 ######## +######## 09 THXC.ACU010 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU010.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -1296,7 +1296,7 @@ -######## THXC.ACU011 ######## +######## 10 THXC.ACU011 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU011.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -1440,7 +1440,7 @@ -######## THXC.ACU013 ######## +######## 11 THXC.ACU013 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU013.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -1584,7 +1584,7 @@ -######## THXC.ACU014 ######## +######## 12 THXC.ACU014 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU014.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -1729,7 +1729,7 @@ -######## THXC.ACU015 ######## +######## 13 THXC.ACU015 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU015.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -1874,7 +1874,7 @@ -######## THXC.ACU016 ######## +######## 14 THXC.ACU016 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU016.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2020,7 +2020,7 @@ ######## \u4E8C\u671F\u4E09\u6807\u6BB5 ######## -######## THXC.ACU301 ######## +######## 01 THXC.ACU301 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU301.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2070,7 +2070,7 @@ -######## THXC.ACU302 ######## +######## 02 THXC.ACU302 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU302.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2083,7 +2083,7 @@ -######## THXC.ACU303 ######## +######## 03 THXC.ACU303 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU303.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2096,7 +2096,7 @@ -######## THXC.ACU304 ######## +######## 04 THXC.ACU304 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU304.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2109,7 +2109,7 @@ -######## THXC.ACU305 ######## +######## 05 THXC.ACU305 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU305.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2122,7 +2122,7 @@ -######## THXC.ACU501 ######## +######## 06 THXC.ACU501 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU501.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2135,7 +2135,7 @@ -######## THXC.ACU502 ######## +######## 07 THXC.ACU502 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU502.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2148,7 +2148,7 @@ -######## THXC.ACU503 ######## +######## 08 THXC.ACU503 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU503.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2161,7 +2161,7 @@ -######## THXC.ACU504 ######## +######## 09 THXC.ACU504 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU504.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2174,7 +2174,7 @@ -######## THXC.ACU505 ######## +######## 10 THXC.ACU505 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU505.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2187,7 +2187,7 @@ -######## THXC.ACU506 ######## +######## 11 THXC.ACU506 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU506.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2200,7 +2200,7 @@ -######## THXC.ACU507 ######## +######## 12 THXC.ACU507 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU507.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2213,7 +2213,7 @@ -######## THXC.ACU601 ######## +######## 13 THXC.ACU601 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU601.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2226,7 +2226,7 @@ -######## THXC.ACU602 ######## +######## 14 THXC.ACU602 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU602.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2239,7 +2239,7 @@ -######## THXC.ACU603 ######## +######## 15 THXC.ACU603 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU603.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2252,7 +2252,7 @@ -######## THXC.ACU604 ######## +######## 16 THXC.ACU604 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU604.WSYQ.COUNT = 6 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2265,7 +2265,7 @@ -######## THXC.ACUS03 ######## +######## 17 THXC.ACUS03 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACUS03.WSYQ.COUNT = 2 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2278,7 +2278,7 @@ -######## THXC.ACUS05 ######## +######## 18 THXC.ACUS05 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACUS05.WSYQ.COUNT = 2 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2291,7 +2291,7 @@ -######## THXC.ACUS06 ######## +######## 19 THXC.ACUS06 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACUS06.WSYQ.COUNT = 2 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2304,6 +2304,103 @@ +######## \u4E8C\u671F\u56DB\u6807\u6BB5 ######## +######## 01 THXC.ACU107 ######## + + +######## 02 THXC.ACU108 ######## + + +######## 03 THXC.ACU109 ######## + + +######## 04 THXC.ACU110 ######## + + +######## 05 THXC.ACU306 ######## + + +######## 06 THXC.ACU307 ######## + + +######## 07 THXC.ACU308 ######## + + +######## 08 THXC.ACU309 ######## + + +######## 09 THXC.ACU401 ######## + + +######## 10 THXC.ACU402 ######## + + +######## 11 THXC.ACU403 ######## + + +######## 12 THXC.ACU404 ######## + + +######## 13 THXC.ACU405 ######## + + +######## 14 THXC.ACU406 ######## + + +######## 15 THXC.ACU407 ######## + + +######## 16 THXC.ACU408 ######## + + +######## 17 THXC.ACUS04 ######## + + +######## 18 THXC.ACU701 ######## + + +######## 19 THXC.ACU702 ######## + + +######## 20 THXC.ACU703 ######## + + +######## 21 THXC.ACU704 ######## + + +######## 22 THXC.ACU705 ######## + + +######## 23 THXC.ACU706 ######## + + +######## 24 THXC.ACU801 ######## + + +######## 25 THXC.ACU802 ######## + + +######## 26 THXC.ACU803 ######## + + +######## 27 THXC.ACU804 ######## + + +######## 28 THXC.ACU805 ######## + + +######## 29 THXC.ACU806 ######## + + +######## 30 THXC.ACU807 ######## + + +######## 31 THXC.ACUS07 ######## + + +######## 32 THXC.ACUS08 ######## + + ######## \u9F99\u7FD4\u8DEF\u71C3\u6C14\u6BB5 THXC.ACU801 ######## #\u98CE\u673A\u6570\u91CF THXC.ACU801.FJ.COUNT = 1 diff --git a/src/com/szpg/db/dao/impl/PgAcuCmdDaoImpl.java b/src/com/szpg/db/dao/impl/PgAcuCmdDaoImpl.java index b752a9c..406d9ee 100644 --- a/src/com/szpg/db/dao/impl/PgAcuCmdDaoImpl.java +++ b/src/com/szpg/db/dao/impl/PgAcuCmdDaoImpl.java @@ -154,13 +154,14 @@ Connection conn = null; String insertStr = "INSERT INTO PG_ACU_CMD " + - "(ID, TM, CMD_TYPE, DEST_ACU_CODE, TIMEOUT) " + - "VALUES (?, TO_DATE(?, 'YYYYMMDDHH24MISS'), ?, ?, '0')"; - Object[] params = new Object[4]; + "(ID, TM, CMD_TYPE, DEST_ACU_CODE, TIMEOUT, DEVICE_CODE) " + + "VALUES (?, TO_DATE(?, 'YYYYMMDDHH24MISS'), ?, ?, '0', ?)"; + Object[] params = new Object[5]; params[0] = cmd.getId(); params[1] = TimeFormat.format(cmd.getTm(), "yyyyMMddHHmmss"); params[2] = cmd.getCmd_type(); params[3] = cmd.getDest_acu_code(); + params[4] = cmd.getDevice_code(); try { conn = ConnectionManager.getConnectionFromC3P0(); diff --git a/src/com/szpg/db/data/PgAcuCmd.java b/src/com/szpg/db/data/PgAcuCmd.java index 9e57628..0f3cabc 100644 --- a/src/com/szpg/db/data/PgAcuCmd.java +++ b/src/com/szpg/db/data/PgAcuCmd.java @@ -23,6 +23,7 @@ private Date tm; // 命令发送时间 private String cmd_type; // 命令类型 private String dest_acu_code; // 目标ACU代码 + private String device_code; // 命令的资产编号 private boolean timeout; // 是否超时 public PgAcuCmd() { @@ -62,6 +63,14 @@ this.dest_acu_code = dest_acu_code; } + public String getDevice_code() { + return device_code; + } + + public void setDevice_code(String device_code) { + this.device_code = device_code; + } + public boolean isTimeout() { return timeout; } diff --git a/src/com/szpg/plc/PGDSCServlet.java b/src/com/szpg/plc/PGDSCServlet.java index 5653eb6..881c2e3 100644 --- a/src/com/szpg/plc/PGDSCServlet.java +++ b/src/com/szpg/plc/PGDSCServlet.java @@ -104,13 +104,13 @@ sendQueryJGStatusCommand(); //10巡检数据同步 - synchAssetInSpection(); +// synchAssetInSpection(); //运维数据同步 - synchMaintanceRecord(); +// synchMaintanceRecord(); // 查询二期温湿度氧气实时数据 - sendQueryWSYQValueCommand(); +// sendQueryWSYQValueCommand(); } /** diff --git a/src/com/szpg/plc/message/command/write/SetJgLockBitCommand.java b/src/com/szpg/plc/message/command/write/SetJgLockBitCommand.java new file mode 100644 index 0000000..f4bc55a --- /dev/null +++ b/src/com/szpg/plc/message/command/write/SetJgLockBitCommand.java @@ -0,0 +1,40 @@ +package com.szpg.plc.message.command.write; + +import com.szpg.plc.message.AppMessageConstants; +import com.szpg.plc.message.command.WriteMemoryCommand; +import com.szpg.plc.message.response.WriteMemoryCommandResponse; + +public class SetJgLockBitCommand extends WriteMemoryCommand { + + /** + * + */ + private static final long serialVersionUID = 935723353287421429L; + + public final static int JG_LOCK = 0; //井盖锁定 + + private int unlock; + + public int getUnlock() { + return unlock; + } + + public void setUnlock(int unlock) { + this.unlock = unlock; + } + + @Override + public String getCommandType() { + return AppMessageConstants.CMD_TYPE_SETJGLOCK; + } + + @Override + public Class getResponseClass() { + return WriteMemoryCommandResponse.class; + } + + @Override + public String toString() { + return "向终端[" + getDestinationId() + "]发送设置井盖锁定命令"; + } +} diff --git a/src/ACUBL.properties b/src/ACUBL.properties index 9c4b0ab..df9ffdb 100644 --- a/src/ACUBL.properties +++ b/src/ACUBL.properties @@ -1,6 +1,6 @@ #ACU\u53D8\u91CF\u8868\u914D\u7F6E\u6587\u4EF6 -######## THXC.ACU001 ######## +######## 01 HXC.ACU001 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU001.CH.COUNT = 6 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -144,7 +144,7 @@ -######## THXC.ACU002 ######## +######## 02 THXC.ACU002 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU002.CH.COUNT = 6 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -288,7 +288,7 @@ -######## THXC.ACU003 ######## +######## 03 THXC.ACU003 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU003.CH.COUNT = 6 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -432,7 +432,7 @@ -######## THXC.ACU004 ######## +######## 04 THXC.ACU004 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU004.CH.COUNT = 6 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -576,7 +576,7 @@ -######## THXC.ACU005 ######## +######## 05 THXC.ACU005 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU005.CH.COUNT = 6 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -720,7 +720,7 @@ -######## THXC.ACU006 ######## +######## 06 THXC.ACU006 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU006.CH.COUNT = 6 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -812,7 +812,7 @@ #\u98CE\u673A\u6570\u91CF -THXC.ACU006.FJ.COUNT = 9 +THXC.ACU006.FJ.COUNT = 6 #\u98CE\u673A\u7F16\u7801\u5217\u8868 THXC.ACU006.FJ.ZC.LIST = THXC.ACU006.F.DFJ01;THXC.ACU006.F.DFJ02;THXC.ACU006.F.SFJ01;THXC.ACU006.F.SFJ02;THXC.ACU006.F.RFJ01;THXC.ACU006.F.RFJ02 #\u98CE\u673A\u72B6\u6001\u8D77\u59CB\u5730\u5740 @@ -864,7 +864,7 @@ -######## THXC.ACU008 ######## +######## 07 THXC.ACU008 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU008.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -1008,7 +1008,7 @@ -######## THXC.ACU009 ######## +######## 08 THXC.ACU009 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU009.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -1152,7 +1152,7 @@ -######## THXC.ACU010 ######## +######## 09 THXC.ACU010 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU010.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -1296,7 +1296,7 @@ -######## THXC.ACU011 ######## +######## 10 THXC.ACU011 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU011.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -1440,7 +1440,7 @@ -######## THXC.ACU013 ######## +######## 11 THXC.ACU013 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU013.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -1584,7 +1584,7 @@ -######## THXC.ACU014 ######## +######## 12 THXC.ACU014 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU014.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -1729,7 +1729,7 @@ -######## THXC.ACU015 ######## +######## 13 THXC.ACU015 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU015.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -1874,7 +1874,7 @@ -######## THXC.ACU016 ######## +######## 14 THXC.ACU016 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU016.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2020,7 +2020,7 @@ ######## \u4E8C\u671F\u4E09\u6807\u6BB5 ######## -######## THXC.ACU301 ######## +######## 01 THXC.ACU301 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU301.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2070,7 +2070,7 @@ -######## THXC.ACU302 ######## +######## 02 THXC.ACU302 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU302.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2083,7 +2083,7 @@ -######## THXC.ACU303 ######## +######## 03 THXC.ACU303 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU303.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2096,7 +2096,7 @@ -######## THXC.ACU304 ######## +######## 04 THXC.ACU304 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU304.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2109,7 +2109,7 @@ -######## THXC.ACU305 ######## +######## 05 THXC.ACU305 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU305.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2122,7 +2122,7 @@ -######## THXC.ACU501 ######## +######## 06 THXC.ACU501 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU501.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2135,7 +2135,7 @@ -######## THXC.ACU502 ######## +######## 07 THXC.ACU502 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU502.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2148,7 +2148,7 @@ -######## THXC.ACU503 ######## +######## 08 THXC.ACU503 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU503.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2161,7 +2161,7 @@ -######## THXC.ACU504 ######## +######## 09 THXC.ACU504 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU504.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2174,7 +2174,7 @@ -######## THXC.ACU505 ######## +######## 10 THXC.ACU505 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU505.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2187,7 +2187,7 @@ -######## THXC.ACU506 ######## +######## 11 THXC.ACU506 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU506.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2200,7 +2200,7 @@ -######## THXC.ACU507 ######## +######## 12 THXC.ACU507 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU507.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2213,7 +2213,7 @@ -######## THXC.ACU601 ######## +######## 13 THXC.ACU601 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU601.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2226,7 +2226,7 @@ -######## THXC.ACU602 ######## +######## 14 THXC.ACU602 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU602.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2239,7 +2239,7 @@ -######## THXC.ACU603 ######## +######## 15 THXC.ACU603 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU603.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2252,7 +2252,7 @@ -######## THXC.ACU604 ######## +######## 16 THXC.ACU604 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU604.WSYQ.COUNT = 6 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2265,7 +2265,7 @@ -######## THXC.ACUS03 ######## +######## 17 THXC.ACUS03 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACUS03.WSYQ.COUNT = 2 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2278,7 +2278,7 @@ -######## THXC.ACUS05 ######## +######## 18 THXC.ACUS05 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACUS05.WSYQ.COUNT = 2 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2291,7 +2291,7 @@ -######## THXC.ACUS06 ######## +######## 19 THXC.ACUS06 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACUS06.WSYQ.COUNT = 2 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2304,6 +2304,103 @@ +######## \u4E8C\u671F\u56DB\u6807\u6BB5 ######## +######## 01 THXC.ACU107 ######## + + +######## 02 THXC.ACU108 ######## + + +######## 03 THXC.ACU109 ######## + + +######## 04 THXC.ACU110 ######## + + +######## 05 THXC.ACU306 ######## + + +######## 06 THXC.ACU307 ######## + + +######## 07 THXC.ACU308 ######## + + +######## 08 THXC.ACU309 ######## + + +######## 09 THXC.ACU401 ######## + + +######## 10 THXC.ACU402 ######## + + +######## 11 THXC.ACU403 ######## + + +######## 12 THXC.ACU404 ######## + + +######## 13 THXC.ACU405 ######## + + +######## 14 THXC.ACU406 ######## + + +######## 15 THXC.ACU407 ######## + + +######## 16 THXC.ACU408 ######## + + +######## 17 THXC.ACUS04 ######## + + +######## 18 THXC.ACU701 ######## + + +######## 19 THXC.ACU702 ######## + + +######## 20 THXC.ACU703 ######## + + +######## 21 THXC.ACU704 ######## + + +######## 22 THXC.ACU705 ######## + + +######## 23 THXC.ACU706 ######## + + +######## 24 THXC.ACU801 ######## + + +######## 25 THXC.ACU802 ######## + + +######## 26 THXC.ACU803 ######## + + +######## 27 THXC.ACU804 ######## + + +######## 28 THXC.ACU805 ######## + + +######## 29 THXC.ACU806 ######## + + +######## 30 THXC.ACU807 ######## + + +######## 31 THXC.ACUS07 ######## + + +######## 32 THXC.ACUS08 ######## + + ######## \u9F99\u7FD4\u8DEF\u71C3\u6C14\u6BB5 THXC.ACU801 ######## #\u98CE\u673A\u6570\u91CF THXC.ACU801.FJ.COUNT = 1 diff --git a/src/com/szpg/db/dao/impl/PgAcuCmdDaoImpl.java b/src/com/szpg/db/dao/impl/PgAcuCmdDaoImpl.java index b752a9c..406d9ee 100644 --- a/src/com/szpg/db/dao/impl/PgAcuCmdDaoImpl.java +++ b/src/com/szpg/db/dao/impl/PgAcuCmdDaoImpl.java @@ -154,13 +154,14 @@ Connection conn = null; String insertStr = "INSERT INTO PG_ACU_CMD " + - "(ID, TM, CMD_TYPE, DEST_ACU_CODE, TIMEOUT) " + - "VALUES (?, TO_DATE(?, 'YYYYMMDDHH24MISS'), ?, ?, '0')"; - Object[] params = new Object[4]; + "(ID, TM, CMD_TYPE, DEST_ACU_CODE, TIMEOUT, DEVICE_CODE) " + + "VALUES (?, TO_DATE(?, 'YYYYMMDDHH24MISS'), ?, ?, '0', ?)"; + Object[] params = new Object[5]; params[0] = cmd.getId(); params[1] = TimeFormat.format(cmd.getTm(), "yyyyMMddHHmmss"); params[2] = cmd.getCmd_type(); params[3] = cmd.getDest_acu_code(); + params[4] = cmd.getDevice_code(); try { conn = ConnectionManager.getConnectionFromC3P0(); diff --git a/src/com/szpg/db/data/PgAcuCmd.java b/src/com/szpg/db/data/PgAcuCmd.java index 9e57628..0f3cabc 100644 --- a/src/com/szpg/db/data/PgAcuCmd.java +++ b/src/com/szpg/db/data/PgAcuCmd.java @@ -23,6 +23,7 @@ private Date tm; // 命令发送时间 private String cmd_type; // 命令类型 private String dest_acu_code; // 目标ACU代码 + private String device_code; // 命令的资产编号 private boolean timeout; // 是否超时 public PgAcuCmd() { @@ -62,6 +63,14 @@ this.dest_acu_code = dest_acu_code; } + public String getDevice_code() { + return device_code; + } + + public void setDevice_code(String device_code) { + this.device_code = device_code; + } + public boolean isTimeout() { return timeout; } diff --git a/src/com/szpg/plc/PGDSCServlet.java b/src/com/szpg/plc/PGDSCServlet.java index 5653eb6..881c2e3 100644 --- a/src/com/szpg/plc/PGDSCServlet.java +++ b/src/com/szpg/plc/PGDSCServlet.java @@ -104,13 +104,13 @@ sendQueryJGStatusCommand(); //10巡检数据同步 - synchAssetInSpection(); +// synchAssetInSpection(); //运维数据同步 - synchMaintanceRecord(); +// synchMaintanceRecord(); // 查询二期温湿度氧气实时数据 - sendQueryWSYQValueCommand(); +// sendQueryWSYQValueCommand(); } /** diff --git a/src/com/szpg/plc/message/command/write/SetJgLockBitCommand.java b/src/com/szpg/plc/message/command/write/SetJgLockBitCommand.java new file mode 100644 index 0000000..f4bc55a --- /dev/null +++ b/src/com/szpg/plc/message/command/write/SetJgLockBitCommand.java @@ -0,0 +1,40 @@ +package com.szpg.plc.message.command.write; + +import com.szpg.plc.message.AppMessageConstants; +import com.szpg.plc.message.command.WriteMemoryCommand; +import com.szpg.plc.message.response.WriteMemoryCommandResponse; + +public class SetJgLockBitCommand extends WriteMemoryCommand { + + /** + * + */ + private static final long serialVersionUID = 935723353287421429L; + + public final static int JG_LOCK = 0; //井盖锁定 + + private int unlock; + + public int getUnlock() { + return unlock; + } + + public void setUnlock(int unlock) { + this.unlock = unlock; + } + + @Override + public String getCommandType() { + return AppMessageConstants.CMD_TYPE_SETJGLOCK; + } + + @Override + public Class getResponseClass() { + return WriteMemoryCommandResponse.class; + } + + @Override + public String toString() { + return "向终端[" + getDestinationId() + "]发送设置井盖锁定命令"; + } +} diff --git a/src/com/szpg/plc/message/command/write/SetJgOffBitCommand.java b/src/com/szpg/plc/message/command/write/SetJgOffBitCommand.java new file mode 100644 index 0000000..185804c --- /dev/null +++ b/src/com/szpg/plc/message/command/write/SetJgOffBitCommand.java @@ -0,0 +1,41 @@ +package com.szpg.plc.message.command.write; + +import com.szpg.plc.message.AppMessageConstants; +import com.szpg.plc.message.command.WriteMemoryCommand; +import com.szpg.plc.message.response.WriteMemoryCommandResponse; + +public class SetJgOffBitCommand extends WriteMemoryCommand { + + /** + * + */ + private static final long serialVersionUID = 935723353287421429L; + + public final static int JG_OFF_ENABLE = 1; // 井盖关闭 + public final static int JG_OFF_DISABLE = 0; // 井盖关闭复位 + + private int jgoff; + + public int getJgoff() { + return jgoff; + } + + public void setJgoff(int jgoff) { + this.jgoff = jgoff; + } + + @Override + public String getCommandType() { + return AppMessageConstants.CMD_TYPE_SETJGOFF; + } + + @Override + public Class getResponseClass() { + return WriteMemoryCommandResponse.class; + } + + @Override + public String toString() { + return "向终端[" + getDestinationId() + "]发送设置井盖关闭位命令[" + jgoff + "]"; + } +} diff --git a/src/ACUBL.properties b/src/ACUBL.properties index 9c4b0ab..df9ffdb 100644 --- a/src/ACUBL.properties +++ b/src/ACUBL.properties @@ -1,6 +1,6 @@ #ACU\u53D8\u91CF\u8868\u914D\u7F6E\u6587\u4EF6 -######## THXC.ACU001 ######## +######## 01 HXC.ACU001 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU001.CH.COUNT = 6 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -144,7 +144,7 @@ -######## THXC.ACU002 ######## +######## 02 THXC.ACU002 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU002.CH.COUNT = 6 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -288,7 +288,7 @@ -######## THXC.ACU003 ######## +######## 03 THXC.ACU003 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU003.CH.COUNT = 6 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -432,7 +432,7 @@ -######## THXC.ACU004 ######## +######## 04 THXC.ACU004 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU004.CH.COUNT = 6 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -576,7 +576,7 @@ -######## THXC.ACU005 ######## +######## 05 THXC.ACU005 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU005.CH.COUNT = 6 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -720,7 +720,7 @@ -######## THXC.ACU006 ######## +######## 06 THXC.ACU006 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU006.CH.COUNT = 6 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -812,7 +812,7 @@ #\u98CE\u673A\u6570\u91CF -THXC.ACU006.FJ.COUNT = 9 +THXC.ACU006.FJ.COUNT = 6 #\u98CE\u673A\u7F16\u7801\u5217\u8868 THXC.ACU006.FJ.ZC.LIST = THXC.ACU006.F.DFJ01;THXC.ACU006.F.DFJ02;THXC.ACU006.F.SFJ01;THXC.ACU006.F.SFJ02;THXC.ACU006.F.RFJ01;THXC.ACU006.F.RFJ02 #\u98CE\u673A\u72B6\u6001\u8D77\u59CB\u5730\u5740 @@ -864,7 +864,7 @@ -######## THXC.ACU008 ######## +######## 07 THXC.ACU008 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU008.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -1008,7 +1008,7 @@ -######## THXC.ACU009 ######## +######## 08 THXC.ACU009 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU009.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -1152,7 +1152,7 @@ -######## THXC.ACU010 ######## +######## 09 THXC.ACU010 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU010.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -1296,7 +1296,7 @@ -######## THXC.ACU011 ######## +######## 10 THXC.ACU011 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU011.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -1440,7 +1440,7 @@ -######## THXC.ACU013 ######## +######## 11 THXC.ACU013 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU013.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -1584,7 +1584,7 @@ -######## THXC.ACU014 ######## +######## 12 THXC.ACU014 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU014.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -1729,7 +1729,7 @@ -######## THXC.ACU015 ######## +######## 13 THXC.ACU015 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU015.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -1874,7 +1874,7 @@ -######## THXC.ACU016 ######## +######## 14 THXC.ACU016 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU016.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2020,7 +2020,7 @@ ######## \u4E8C\u671F\u4E09\u6807\u6BB5 ######## -######## THXC.ACU301 ######## +######## 01 THXC.ACU301 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU301.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2070,7 +2070,7 @@ -######## THXC.ACU302 ######## +######## 02 THXC.ACU302 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU302.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2083,7 +2083,7 @@ -######## THXC.ACU303 ######## +######## 03 THXC.ACU303 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU303.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2096,7 +2096,7 @@ -######## THXC.ACU304 ######## +######## 04 THXC.ACU304 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU304.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2109,7 +2109,7 @@ -######## THXC.ACU305 ######## +######## 05 THXC.ACU305 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU305.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2122,7 +2122,7 @@ -######## THXC.ACU501 ######## +######## 06 THXC.ACU501 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU501.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2135,7 +2135,7 @@ -######## THXC.ACU502 ######## +######## 07 THXC.ACU502 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU502.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2148,7 +2148,7 @@ -######## THXC.ACU503 ######## +######## 08 THXC.ACU503 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU503.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2161,7 +2161,7 @@ -######## THXC.ACU504 ######## +######## 09 THXC.ACU504 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU504.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2174,7 +2174,7 @@ -######## THXC.ACU505 ######## +######## 10 THXC.ACU505 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU505.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2187,7 +2187,7 @@ -######## THXC.ACU506 ######## +######## 11 THXC.ACU506 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU506.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2200,7 +2200,7 @@ -######## THXC.ACU507 ######## +######## 12 THXC.ACU507 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU507.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2213,7 +2213,7 @@ -######## THXC.ACU601 ######## +######## 13 THXC.ACU601 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU601.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2226,7 +2226,7 @@ -######## THXC.ACU602 ######## +######## 14 THXC.ACU602 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU602.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2239,7 +2239,7 @@ -######## THXC.ACU603 ######## +######## 15 THXC.ACU603 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU603.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2252,7 +2252,7 @@ -######## THXC.ACU604 ######## +######## 16 THXC.ACU604 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU604.WSYQ.COUNT = 6 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2265,7 +2265,7 @@ -######## THXC.ACUS03 ######## +######## 17 THXC.ACUS03 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACUS03.WSYQ.COUNT = 2 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2278,7 +2278,7 @@ -######## THXC.ACUS05 ######## +######## 18 THXC.ACUS05 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACUS05.WSYQ.COUNT = 2 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2291,7 +2291,7 @@ -######## THXC.ACUS06 ######## +######## 19 THXC.ACUS06 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACUS06.WSYQ.COUNT = 2 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2304,6 +2304,103 @@ +######## \u4E8C\u671F\u56DB\u6807\u6BB5 ######## +######## 01 THXC.ACU107 ######## + + +######## 02 THXC.ACU108 ######## + + +######## 03 THXC.ACU109 ######## + + +######## 04 THXC.ACU110 ######## + + +######## 05 THXC.ACU306 ######## + + +######## 06 THXC.ACU307 ######## + + +######## 07 THXC.ACU308 ######## + + +######## 08 THXC.ACU309 ######## + + +######## 09 THXC.ACU401 ######## + + +######## 10 THXC.ACU402 ######## + + +######## 11 THXC.ACU403 ######## + + +######## 12 THXC.ACU404 ######## + + +######## 13 THXC.ACU405 ######## + + +######## 14 THXC.ACU406 ######## + + +######## 15 THXC.ACU407 ######## + + +######## 16 THXC.ACU408 ######## + + +######## 17 THXC.ACUS04 ######## + + +######## 18 THXC.ACU701 ######## + + +######## 19 THXC.ACU702 ######## + + +######## 20 THXC.ACU703 ######## + + +######## 21 THXC.ACU704 ######## + + +######## 22 THXC.ACU705 ######## + + +######## 23 THXC.ACU706 ######## + + +######## 24 THXC.ACU801 ######## + + +######## 25 THXC.ACU802 ######## + + +######## 26 THXC.ACU803 ######## + + +######## 27 THXC.ACU804 ######## + + +######## 28 THXC.ACU805 ######## + + +######## 29 THXC.ACU806 ######## + + +######## 30 THXC.ACU807 ######## + + +######## 31 THXC.ACUS07 ######## + + +######## 32 THXC.ACUS08 ######## + + ######## \u9F99\u7FD4\u8DEF\u71C3\u6C14\u6BB5 THXC.ACU801 ######## #\u98CE\u673A\u6570\u91CF THXC.ACU801.FJ.COUNT = 1 diff --git a/src/com/szpg/db/dao/impl/PgAcuCmdDaoImpl.java b/src/com/szpg/db/dao/impl/PgAcuCmdDaoImpl.java index b752a9c..406d9ee 100644 --- a/src/com/szpg/db/dao/impl/PgAcuCmdDaoImpl.java +++ b/src/com/szpg/db/dao/impl/PgAcuCmdDaoImpl.java @@ -154,13 +154,14 @@ Connection conn = null; String insertStr = "INSERT INTO PG_ACU_CMD " + - "(ID, TM, CMD_TYPE, DEST_ACU_CODE, TIMEOUT) " + - "VALUES (?, TO_DATE(?, 'YYYYMMDDHH24MISS'), ?, ?, '0')"; - Object[] params = new Object[4]; + "(ID, TM, CMD_TYPE, DEST_ACU_CODE, TIMEOUT, DEVICE_CODE) " + + "VALUES (?, TO_DATE(?, 'YYYYMMDDHH24MISS'), ?, ?, '0', ?)"; + Object[] params = new Object[5]; params[0] = cmd.getId(); params[1] = TimeFormat.format(cmd.getTm(), "yyyyMMddHHmmss"); params[2] = cmd.getCmd_type(); params[3] = cmd.getDest_acu_code(); + params[4] = cmd.getDevice_code(); try { conn = ConnectionManager.getConnectionFromC3P0(); diff --git a/src/com/szpg/db/data/PgAcuCmd.java b/src/com/szpg/db/data/PgAcuCmd.java index 9e57628..0f3cabc 100644 --- a/src/com/szpg/db/data/PgAcuCmd.java +++ b/src/com/szpg/db/data/PgAcuCmd.java @@ -23,6 +23,7 @@ private Date tm; // 命令发送时间 private String cmd_type; // 命令类型 private String dest_acu_code; // 目标ACU代码 + private String device_code; // 命令的资产编号 private boolean timeout; // 是否超时 public PgAcuCmd() { @@ -62,6 +63,14 @@ this.dest_acu_code = dest_acu_code; } + public String getDevice_code() { + return device_code; + } + + public void setDevice_code(String device_code) { + this.device_code = device_code; + } + public boolean isTimeout() { return timeout; } diff --git a/src/com/szpg/plc/PGDSCServlet.java b/src/com/szpg/plc/PGDSCServlet.java index 5653eb6..881c2e3 100644 --- a/src/com/szpg/plc/PGDSCServlet.java +++ b/src/com/szpg/plc/PGDSCServlet.java @@ -104,13 +104,13 @@ sendQueryJGStatusCommand(); //10巡检数据同步 - synchAssetInSpection(); +// synchAssetInSpection(); //运维数据同步 - synchMaintanceRecord(); +// synchMaintanceRecord(); // 查询二期温湿度氧气实时数据 - sendQueryWSYQValueCommand(); +// sendQueryWSYQValueCommand(); } /** diff --git a/src/com/szpg/plc/message/command/write/SetJgLockBitCommand.java b/src/com/szpg/plc/message/command/write/SetJgLockBitCommand.java new file mode 100644 index 0000000..f4bc55a --- /dev/null +++ b/src/com/szpg/plc/message/command/write/SetJgLockBitCommand.java @@ -0,0 +1,40 @@ +package com.szpg.plc.message.command.write; + +import com.szpg.plc.message.AppMessageConstants; +import com.szpg.plc.message.command.WriteMemoryCommand; +import com.szpg.plc.message.response.WriteMemoryCommandResponse; + +public class SetJgLockBitCommand extends WriteMemoryCommand { + + /** + * + */ + private static final long serialVersionUID = 935723353287421429L; + + public final static int JG_LOCK = 0; //井盖锁定 + + private int unlock; + + public int getUnlock() { + return unlock; + } + + public void setUnlock(int unlock) { + this.unlock = unlock; + } + + @Override + public String getCommandType() { + return AppMessageConstants.CMD_TYPE_SETJGLOCK; + } + + @Override + public Class getResponseClass() { + return WriteMemoryCommandResponse.class; + } + + @Override + public String toString() { + return "向终端[" + getDestinationId() + "]发送设置井盖锁定命令"; + } +} diff --git a/src/com/szpg/plc/message/command/write/SetJgOffBitCommand.java b/src/com/szpg/plc/message/command/write/SetJgOffBitCommand.java new file mode 100644 index 0000000..185804c --- /dev/null +++ b/src/com/szpg/plc/message/command/write/SetJgOffBitCommand.java @@ -0,0 +1,41 @@ +package com.szpg.plc.message.command.write; + +import com.szpg.plc.message.AppMessageConstants; +import com.szpg.plc.message.command.WriteMemoryCommand; +import com.szpg.plc.message.response.WriteMemoryCommandResponse; + +public class SetJgOffBitCommand extends WriteMemoryCommand { + + /** + * + */ + private static final long serialVersionUID = 935723353287421429L; + + public final static int JG_OFF_ENABLE = 1; // 井盖关闭 + public final static int JG_OFF_DISABLE = 0; // 井盖关闭复位 + + private int jgoff; + + public int getJgoff() { + return jgoff; + } + + public void setJgoff(int jgoff) { + this.jgoff = jgoff; + } + + @Override + public String getCommandType() { + return AppMessageConstants.CMD_TYPE_SETJGOFF; + } + + @Override + public Class getResponseClass() { + return WriteMemoryCommandResponse.class; + } + + @Override + public String toString() { + return "向终端[" + getDestinationId() + "]发送设置井盖关闭位命令[" + jgoff + "]"; + } +} diff --git a/src/com/szpg/plc/message/command/write/SetJgOnBitCommand.java b/src/com/szpg/plc/message/command/write/SetJgOnBitCommand.java new file mode 100644 index 0000000..b63cf19 --- /dev/null +++ b/src/com/szpg/plc/message/command/write/SetJgOnBitCommand.java @@ -0,0 +1,41 @@ +package com.szpg.plc.message.command.write; + +import com.szpg.plc.message.AppMessageConstants; +import com.szpg.plc.message.command.WriteMemoryCommand; +import com.szpg.plc.message.response.WriteMemoryCommandResponse; + +public class SetJgOnBitCommand extends WriteMemoryCommand { + + /** + * + */ + private static final long serialVersionUID = 935723353287421429L; + + public final static int JG_ON_ENABLE = 1; // 井盖打开 + public final static int JG_ON_DISABLE = 0; // 井盖打开复位 + + private int jgon; + + public int getJgon() { + return jgon; + } + + public void setJgon(int jgon) { + this.jgon = jgon; + } + + @Override + public String getCommandType() { + return AppMessageConstants.CMD_TYPE_SETJGON; + } + + @Override + public Class getResponseClass() { + return WriteMemoryCommandResponse.class; + } + + @Override + public String toString() { + return "向终端[" + getDestinationId() + "]发送设置井盖开启位命令[" + jgon + "]"; + } +} diff --git a/src/ACUBL.properties b/src/ACUBL.properties index 9c4b0ab..df9ffdb 100644 --- a/src/ACUBL.properties +++ b/src/ACUBL.properties @@ -1,6 +1,6 @@ #ACU\u53D8\u91CF\u8868\u914D\u7F6E\u6587\u4EF6 -######## THXC.ACU001 ######## +######## 01 HXC.ACU001 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU001.CH.COUNT = 6 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -144,7 +144,7 @@ -######## THXC.ACU002 ######## +######## 02 THXC.ACU002 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU002.CH.COUNT = 6 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -288,7 +288,7 @@ -######## THXC.ACU003 ######## +######## 03 THXC.ACU003 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU003.CH.COUNT = 6 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -432,7 +432,7 @@ -######## THXC.ACU004 ######## +######## 04 THXC.ACU004 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU004.CH.COUNT = 6 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -576,7 +576,7 @@ -######## THXC.ACU005 ######## +######## 05 THXC.ACU005 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU005.CH.COUNT = 6 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -720,7 +720,7 @@ -######## THXC.ACU006 ######## +######## 06 THXC.ACU006 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU006.CH.COUNT = 6 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -812,7 +812,7 @@ #\u98CE\u673A\u6570\u91CF -THXC.ACU006.FJ.COUNT = 9 +THXC.ACU006.FJ.COUNT = 6 #\u98CE\u673A\u7F16\u7801\u5217\u8868 THXC.ACU006.FJ.ZC.LIST = THXC.ACU006.F.DFJ01;THXC.ACU006.F.DFJ02;THXC.ACU006.F.SFJ01;THXC.ACU006.F.SFJ02;THXC.ACU006.F.RFJ01;THXC.ACU006.F.RFJ02 #\u98CE\u673A\u72B6\u6001\u8D77\u59CB\u5730\u5740 @@ -864,7 +864,7 @@ -######## THXC.ACU008 ######## +######## 07 THXC.ACU008 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU008.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -1008,7 +1008,7 @@ -######## THXC.ACU009 ######## +######## 08 THXC.ACU009 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU009.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -1152,7 +1152,7 @@ -######## THXC.ACU010 ######## +######## 09 THXC.ACU010 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU010.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -1296,7 +1296,7 @@ -######## THXC.ACU011 ######## +######## 10 THXC.ACU011 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU011.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -1440,7 +1440,7 @@ -######## THXC.ACU013 ######## +######## 11 THXC.ACU013 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU013.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -1584,7 +1584,7 @@ -######## THXC.ACU014 ######## +######## 12 THXC.ACU014 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU014.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -1729,7 +1729,7 @@ -######## THXC.ACU015 ######## +######## 13 THXC.ACU015 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU015.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -1874,7 +1874,7 @@ -######## THXC.ACU016 ######## +######## 14 THXC.ACU016 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU016.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2020,7 +2020,7 @@ ######## \u4E8C\u671F\u4E09\u6807\u6BB5 ######## -######## THXC.ACU301 ######## +######## 01 THXC.ACU301 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU301.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2070,7 +2070,7 @@ -######## THXC.ACU302 ######## +######## 02 THXC.ACU302 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU302.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2083,7 +2083,7 @@ -######## THXC.ACU303 ######## +######## 03 THXC.ACU303 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU303.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2096,7 +2096,7 @@ -######## THXC.ACU304 ######## +######## 04 THXC.ACU304 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU304.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2109,7 +2109,7 @@ -######## THXC.ACU305 ######## +######## 05 THXC.ACU305 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU305.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2122,7 +2122,7 @@ -######## THXC.ACU501 ######## +######## 06 THXC.ACU501 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU501.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2135,7 +2135,7 @@ -######## THXC.ACU502 ######## +######## 07 THXC.ACU502 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU502.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2148,7 +2148,7 @@ -######## THXC.ACU503 ######## +######## 08 THXC.ACU503 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU503.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2161,7 +2161,7 @@ -######## THXC.ACU504 ######## +######## 09 THXC.ACU504 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU504.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2174,7 +2174,7 @@ -######## THXC.ACU505 ######## +######## 10 THXC.ACU505 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU505.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2187,7 +2187,7 @@ -######## THXC.ACU506 ######## +######## 11 THXC.ACU506 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU506.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2200,7 +2200,7 @@ -######## THXC.ACU507 ######## +######## 12 THXC.ACU507 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU507.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2213,7 +2213,7 @@ -######## THXC.ACU601 ######## +######## 13 THXC.ACU601 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU601.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2226,7 +2226,7 @@ -######## THXC.ACU602 ######## +######## 14 THXC.ACU602 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU602.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2239,7 +2239,7 @@ -######## THXC.ACU603 ######## +######## 15 THXC.ACU603 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU603.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2252,7 +2252,7 @@ -######## THXC.ACU604 ######## +######## 16 THXC.ACU604 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU604.WSYQ.COUNT = 6 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2265,7 +2265,7 @@ -######## THXC.ACUS03 ######## +######## 17 THXC.ACUS03 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACUS03.WSYQ.COUNT = 2 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2278,7 +2278,7 @@ -######## THXC.ACUS05 ######## +######## 18 THXC.ACUS05 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACUS05.WSYQ.COUNT = 2 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2291,7 +2291,7 @@ -######## THXC.ACUS06 ######## +######## 19 THXC.ACUS06 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACUS06.WSYQ.COUNT = 2 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2304,6 +2304,103 @@ +######## \u4E8C\u671F\u56DB\u6807\u6BB5 ######## +######## 01 THXC.ACU107 ######## + + +######## 02 THXC.ACU108 ######## + + +######## 03 THXC.ACU109 ######## + + +######## 04 THXC.ACU110 ######## + + +######## 05 THXC.ACU306 ######## + + +######## 06 THXC.ACU307 ######## + + +######## 07 THXC.ACU308 ######## + + +######## 08 THXC.ACU309 ######## + + +######## 09 THXC.ACU401 ######## + + +######## 10 THXC.ACU402 ######## + + +######## 11 THXC.ACU403 ######## + + +######## 12 THXC.ACU404 ######## + + +######## 13 THXC.ACU405 ######## + + +######## 14 THXC.ACU406 ######## + + +######## 15 THXC.ACU407 ######## + + +######## 16 THXC.ACU408 ######## + + +######## 17 THXC.ACUS04 ######## + + +######## 18 THXC.ACU701 ######## + + +######## 19 THXC.ACU702 ######## + + +######## 20 THXC.ACU703 ######## + + +######## 21 THXC.ACU704 ######## + + +######## 22 THXC.ACU705 ######## + + +######## 23 THXC.ACU706 ######## + + +######## 24 THXC.ACU801 ######## + + +######## 25 THXC.ACU802 ######## + + +######## 26 THXC.ACU803 ######## + + +######## 27 THXC.ACU804 ######## + + +######## 28 THXC.ACU805 ######## + + +######## 29 THXC.ACU806 ######## + + +######## 30 THXC.ACU807 ######## + + +######## 31 THXC.ACUS07 ######## + + +######## 32 THXC.ACUS08 ######## + + ######## \u9F99\u7FD4\u8DEF\u71C3\u6C14\u6BB5 THXC.ACU801 ######## #\u98CE\u673A\u6570\u91CF THXC.ACU801.FJ.COUNT = 1 diff --git a/src/com/szpg/db/dao/impl/PgAcuCmdDaoImpl.java b/src/com/szpg/db/dao/impl/PgAcuCmdDaoImpl.java index b752a9c..406d9ee 100644 --- a/src/com/szpg/db/dao/impl/PgAcuCmdDaoImpl.java +++ b/src/com/szpg/db/dao/impl/PgAcuCmdDaoImpl.java @@ -154,13 +154,14 @@ Connection conn = null; String insertStr = "INSERT INTO PG_ACU_CMD " + - "(ID, TM, CMD_TYPE, DEST_ACU_CODE, TIMEOUT) " + - "VALUES (?, TO_DATE(?, 'YYYYMMDDHH24MISS'), ?, ?, '0')"; - Object[] params = new Object[4]; + "(ID, TM, CMD_TYPE, DEST_ACU_CODE, TIMEOUT, DEVICE_CODE) " + + "VALUES (?, TO_DATE(?, 'YYYYMMDDHH24MISS'), ?, ?, '0', ?)"; + Object[] params = new Object[5]; params[0] = cmd.getId(); params[1] = TimeFormat.format(cmd.getTm(), "yyyyMMddHHmmss"); params[2] = cmd.getCmd_type(); params[3] = cmd.getDest_acu_code(); + params[4] = cmd.getDevice_code(); try { conn = ConnectionManager.getConnectionFromC3P0(); diff --git a/src/com/szpg/db/data/PgAcuCmd.java b/src/com/szpg/db/data/PgAcuCmd.java index 9e57628..0f3cabc 100644 --- a/src/com/szpg/db/data/PgAcuCmd.java +++ b/src/com/szpg/db/data/PgAcuCmd.java @@ -23,6 +23,7 @@ private Date tm; // 命令发送时间 private String cmd_type; // 命令类型 private String dest_acu_code; // 目标ACU代码 + private String device_code; // 命令的资产编号 private boolean timeout; // 是否超时 public PgAcuCmd() { @@ -62,6 +63,14 @@ this.dest_acu_code = dest_acu_code; } + public String getDevice_code() { + return device_code; + } + + public void setDevice_code(String device_code) { + this.device_code = device_code; + } + public boolean isTimeout() { return timeout; } diff --git a/src/com/szpg/plc/PGDSCServlet.java b/src/com/szpg/plc/PGDSCServlet.java index 5653eb6..881c2e3 100644 --- a/src/com/szpg/plc/PGDSCServlet.java +++ b/src/com/szpg/plc/PGDSCServlet.java @@ -104,13 +104,13 @@ sendQueryJGStatusCommand(); //10巡检数据同步 - synchAssetInSpection(); +// synchAssetInSpection(); //运维数据同步 - synchMaintanceRecord(); +// synchMaintanceRecord(); // 查询二期温湿度氧气实时数据 - sendQueryWSYQValueCommand(); +// sendQueryWSYQValueCommand(); } /** diff --git a/src/com/szpg/plc/message/command/write/SetJgLockBitCommand.java b/src/com/szpg/plc/message/command/write/SetJgLockBitCommand.java new file mode 100644 index 0000000..f4bc55a --- /dev/null +++ b/src/com/szpg/plc/message/command/write/SetJgLockBitCommand.java @@ -0,0 +1,40 @@ +package com.szpg.plc.message.command.write; + +import com.szpg.plc.message.AppMessageConstants; +import com.szpg.plc.message.command.WriteMemoryCommand; +import com.szpg.plc.message.response.WriteMemoryCommandResponse; + +public class SetJgLockBitCommand extends WriteMemoryCommand { + + /** + * + */ + private static final long serialVersionUID = 935723353287421429L; + + public final static int JG_LOCK = 0; //井盖锁定 + + private int unlock; + + public int getUnlock() { + return unlock; + } + + public void setUnlock(int unlock) { + this.unlock = unlock; + } + + @Override + public String getCommandType() { + return AppMessageConstants.CMD_TYPE_SETJGLOCK; + } + + @Override + public Class getResponseClass() { + return WriteMemoryCommandResponse.class; + } + + @Override + public String toString() { + return "向终端[" + getDestinationId() + "]发送设置井盖锁定命令"; + } +} diff --git a/src/com/szpg/plc/message/command/write/SetJgOffBitCommand.java b/src/com/szpg/plc/message/command/write/SetJgOffBitCommand.java new file mode 100644 index 0000000..185804c --- /dev/null +++ b/src/com/szpg/plc/message/command/write/SetJgOffBitCommand.java @@ -0,0 +1,41 @@ +package com.szpg.plc.message.command.write; + +import com.szpg.plc.message.AppMessageConstants; +import com.szpg.plc.message.command.WriteMemoryCommand; +import com.szpg.plc.message.response.WriteMemoryCommandResponse; + +public class SetJgOffBitCommand extends WriteMemoryCommand { + + /** + * + */ + private static final long serialVersionUID = 935723353287421429L; + + public final static int JG_OFF_ENABLE = 1; // 井盖关闭 + public final static int JG_OFF_DISABLE = 0; // 井盖关闭复位 + + private int jgoff; + + public int getJgoff() { + return jgoff; + } + + public void setJgoff(int jgoff) { + this.jgoff = jgoff; + } + + @Override + public String getCommandType() { + return AppMessageConstants.CMD_TYPE_SETJGOFF; + } + + @Override + public Class getResponseClass() { + return WriteMemoryCommandResponse.class; + } + + @Override + public String toString() { + return "向终端[" + getDestinationId() + "]发送设置井盖关闭位命令[" + jgoff + "]"; + } +} diff --git a/src/com/szpg/plc/message/command/write/SetJgOnBitCommand.java b/src/com/szpg/plc/message/command/write/SetJgOnBitCommand.java new file mode 100644 index 0000000..b63cf19 --- /dev/null +++ b/src/com/szpg/plc/message/command/write/SetJgOnBitCommand.java @@ -0,0 +1,41 @@ +package com.szpg.plc.message.command.write; + +import com.szpg.plc.message.AppMessageConstants; +import com.szpg.plc.message.command.WriteMemoryCommand; +import com.szpg.plc.message.response.WriteMemoryCommandResponse; + +public class SetJgOnBitCommand extends WriteMemoryCommand { + + /** + * + */ + private static final long serialVersionUID = 935723353287421429L; + + public final static int JG_ON_ENABLE = 1; // 井盖打开 + public final static int JG_ON_DISABLE = 0; // 井盖打开复位 + + private int jgon; + + public int getJgon() { + return jgon; + } + + public void setJgon(int jgon) { + this.jgon = jgon; + } + + @Override + public String getCommandType() { + return AppMessageConstants.CMD_TYPE_SETJGON; + } + + @Override + public Class getResponseClass() { + return WriteMemoryCommandResponse.class; + } + + @Override + public String toString() { + return "向终端[" + getDestinationId() + "]发送设置井盖开启位命令[" + jgon + "]"; + } +} diff --git a/src/com/szpg/plc/message/command/write/SetJgUnlockBitCommand.java b/src/com/szpg/plc/message/command/write/SetJgUnlockBitCommand.java index e3898b4..cfe7a6b 100644 --- a/src/com/szpg/plc/message/command/write/SetJgUnlockBitCommand.java +++ b/src/com/szpg/plc/message/command/write/SetJgUnlockBitCommand.java @@ -10,8 +10,7 @@ * */ private static final long serialVersionUID = 935723353287421429L; - - public final static int JG_LOCK = 0; //井盖锁定 + public final static int JG_UNLOCK = 1; //井盖解锁 private int unlock; diff --git a/src/ACUBL.properties b/src/ACUBL.properties index 9c4b0ab..df9ffdb 100644 --- a/src/ACUBL.properties +++ b/src/ACUBL.properties @@ -1,6 +1,6 @@ #ACU\u53D8\u91CF\u8868\u914D\u7F6E\u6587\u4EF6 -######## THXC.ACU001 ######## +######## 01 HXC.ACU001 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU001.CH.COUNT = 6 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -144,7 +144,7 @@ -######## THXC.ACU002 ######## +######## 02 THXC.ACU002 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU002.CH.COUNT = 6 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -288,7 +288,7 @@ -######## THXC.ACU003 ######## +######## 03 THXC.ACU003 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU003.CH.COUNT = 6 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -432,7 +432,7 @@ -######## THXC.ACU004 ######## +######## 04 THXC.ACU004 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU004.CH.COUNT = 6 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -576,7 +576,7 @@ -######## THXC.ACU005 ######## +######## 05 THXC.ACU005 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU005.CH.COUNT = 6 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -720,7 +720,7 @@ -######## THXC.ACU006 ######## +######## 06 THXC.ACU006 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU006.CH.COUNT = 6 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -812,7 +812,7 @@ #\u98CE\u673A\u6570\u91CF -THXC.ACU006.FJ.COUNT = 9 +THXC.ACU006.FJ.COUNT = 6 #\u98CE\u673A\u7F16\u7801\u5217\u8868 THXC.ACU006.FJ.ZC.LIST = THXC.ACU006.F.DFJ01;THXC.ACU006.F.DFJ02;THXC.ACU006.F.SFJ01;THXC.ACU006.F.SFJ02;THXC.ACU006.F.RFJ01;THXC.ACU006.F.RFJ02 #\u98CE\u673A\u72B6\u6001\u8D77\u59CB\u5730\u5740 @@ -864,7 +864,7 @@ -######## THXC.ACU008 ######## +######## 07 THXC.ACU008 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU008.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -1008,7 +1008,7 @@ -######## THXC.ACU009 ######## +######## 08 THXC.ACU009 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU009.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -1152,7 +1152,7 @@ -######## THXC.ACU010 ######## +######## 09 THXC.ACU010 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU010.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -1296,7 +1296,7 @@ -######## THXC.ACU011 ######## +######## 10 THXC.ACU011 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU011.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -1440,7 +1440,7 @@ -######## THXC.ACU013 ######## +######## 11 THXC.ACU013 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU013.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -1584,7 +1584,7 @@ -######## THXC.ACU014 ######## +######## 12 THXC.ACU014 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU014.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -1729,7 +1729,7 @@ -######## THXC.ACU015 ######## +######## 13 THXC.ACU015 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU015.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -1874,7 +1874,7 @@ -######## THXC.ACU016 ######## +######## 14 THXC.ACU016 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU016.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2020,7 +2020,7 @@ ######## \u4E8C\u671F\u4E09\u6807\u6BB5 ######## -######## THXC.ACU301 ######## +######## 01 THXC.ACU301 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU301.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2070,7 +2070,7 @@ -######## THXC.ACU302 ######## +######## 02 THXC.ACU302 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU302.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2083,7 +2083,7 @@ -######## THXC.ACU303 ######## +######## 03 THXC.ACU303 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU303.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2096,7 +2096,7 @@ -######## THXC.ACU304 ######## +######## 04 THXC.ACU304 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU304.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2109,7 +2109,7 @@ -######## THXC.ACU305 ######## +######## 05 THXC.ACU305 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU305.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2122,7 +2122,7 @@ -######## THXC.ACU501 ######## +######## 06 THXC.ACU501 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU501.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2135,7 +2135,7 @@ -######## THXC.ACU502 ######## +######## 07 THXC.ACU502 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU502.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2148,7 +2148,7 @@ -######## THXC.ACU503 ######## +######## 08 THXC.ACU503 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU503.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2161,7 +2161,7 @@ -######## THXC.ACU504 ######## +######## 09 THXC.ACU504 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU504.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2174,7 +2174,7 @@ -######## THXC.ACU505 ######## +######## 10 THXC.ACU505 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU505.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2187,7 +2187,7 @@ -######## THXC.ACU506 ######## +######## 11 THXC.ACU506 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU506.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2200,7 +2200,7 @@ -######## THXC.ACU507 ######## +######## 12 THXC.ACU507 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU507.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2213,7 +2213,7 @@ -######## THXC.ACU601 ######## +######## 13 THXC.ACU601 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU601.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2226,7 +2226,7 @@ -######## THXC.ACU602 ######## +######## 14 THXC.ACU602 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU602.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2239,7 +2239,7 @@ -######## THXC.ACU603 ######## +######## 15 THXC.ACU603 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU603.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2252,7 +2252,7 @@ -######## THXC.ACU604 ######## +######## 16 THXC.ACU604 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU604.WSYQ.COUNT = 6 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2265,7 +2265,7 @@ -######## THXC.ACUS03 ######## +######## 17 THXC.ACUS03 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACUS03.WSYQ.COUNT = 2 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2278,7 +2278,7 @@ -######## THXC.ACUS05 ######## +######## 18 THXC.ACUS05 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACUS05.WSYQ.COUNT = 2 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2291,7 +2291,7 @@ -######## THXC.ACUS06 ######## +######## 19 THXC.ACUS06 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACUS06.WSYQ.COUNT = 2 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2304,6 +2304,103 @@ +######## \u4E8C\u671F\u56DB\u6807\u6BB5 ######## +######## 01 THXC.ACU107 ######## + + +######## 02 THXC.ACU108 ######## + + +######## 03 THXC.ACU109 ######## + + +######## 04 THXC.ACU110 ######## + + +######## 05 THXC.ACU306 ######## + + +######## 06 THXC.ACU307 ######## + + +######## 07 THXC.ACU308 ######## + + +######## 08 THXC.ACU309 ######## + + +######## 09 THXC.ACU401 ######## + + +######## 10 THXC.ACU402 ######## + + +######## 11 THXC.ACU403 ######## + + +######## 12 THXC.ACU404 ######## + + +######## 13 THXC.ACU405 ######## + + +######## 14 THXC.ACU406 ######## + + +######## 15 THXC.ACU407 ######## + + +######## 16 THXC.ACU408 ######## + + +######## 17 THXC.ACUS04 ######## + + +######## 18 THXC.ACU701 ######## + + +######## 19 THXC.ACU702 ######## + + +######## 20 THXC.ACU703 ######## + + +######## 21 THXC.ACU704 ######## + + +######## 22 THXC.ACU705 ######## + + +######## 23 THXC.ACU706 ######## + + +######## 24 THXC.ACU801 ######## + + +######## 25 THXC.ACU802 ######## + + +######## 26 THXC.ACU803 ######## + + +######## 27 THXC.ACU804 ######## + + +######## 28 THXC.ACU805 ######## + + +######## 29 THXC.ACU806 ######## + + +######## 30 THXC.ACU807 ######## + + +######## 31 THXC.ACUS07 ######## + + +######## 32 THXC.ACUS08 ######## + + ######## \u9F99\u7FD4\u8DEF\u71C3\u6C14\u6BB5 THXC.ACU801 ######## #\u98CE\u673A\u6570\u91CF THXC.ACU801.FJ.COUNT = 1 diff --git a/src/com/szpg/db/dao/impl/PgAcuCmdDaoImpl.java b/src/com/szpg/db/dao/impl/PgAcuCmdDaoImpl.java index b752a9c..406d9ee 100644 --- a/src/com/szpg/db/dao/impl/PgAcuCmdDaoImpl.java +++ b/src/com/szpg/db/dao/impl/PgAcuCmdDaoImpl.java @@ -154,13 +154,14 @@ Connection conn = null; String insertStr = "INSERT INTO PG_ACU_CMD " + - "(ID, TM, CMD_TYPE, DEST_ACU_CODE, TIMEOUT) " + - "VALUES (?, TO_DATE(?, 'YYYYMMDDHH24MISS'), ?, ?, '0')"; - Object[] params = new Object[4]; + "(ID, TM, CMD_TYPE, DEST_ACU_CODE, TIMEOUT, DEVICE_CODE) " + + "VALUES (?, TO_DATE(?, 'YYYYMMDDHH24MISS'), ?, ?, '0', ?)"; + Object[] params = new Object[5]; params[0] = cmd.getId(); params[1] = TimeFormat.format(cmd.getTm(), "yyyyMMddHHmmss"); params[2] = cmd.getCmd_type(); params[3] = cmd.getDest_acu_code(); + params[4] = cmd.getDevice_code(); try { conn = ConnectionManager.getConnectionFromC3P0(); diff --git a/src/com/szpg/db/data/PgAcuCmd.java b/src/com/szpg/db/data/PgAcuCmd.java index 9e57628..0f3cabc 100644 --- a/src/com/szpg/db/data/PgAcuCmd.java +++ b/src/com/szpg/db/data/PgAcuCmd.java @@ -23,6 +23,7 @@ private Date tm; // 命令发送时间 private String cmd_type; // 命令类型 private String dest_acu_code; // 目标ACU代码 + private String device_code; // 命令的资产编号 private boolean timeout; // 是否超时 public PgAcuCmd() { @@ -62,6 +63,14 @@ this.dest_acu_code = dest_acu_code; } + public String getDevice_code() { + return device_code; + } + + public void setDevice_code(String device_code) { + this.device_code = device_code; + } + public boolean isTimeout() { return timeout; } diff --git a/src/com/szpg/plc/PGDSCServlet.java b/src/com/szpg/plc/PGDSCServlet.java index 5653eb6..881c2e3 100644 --- a/src/com/szpg/plc/PGDSCServlet.java +++ b/src/com/szpg/plc/PGDSCServlet.java @@ -104,13 +104,13 @@ sendQueryJGStatusCommand(); //10巡检数据同步 - synchAssetInSpection(); +// synchAssetInSpection(); //运维数据同步 - synchMaintanceRecord(); +// synchMaintanceRecord(); // 查询二期温湿度氧气实时数据 - sendQueryWSYQValueCommand(); +// sendQueryWSYQValueCommand(); } /** diff --git a/src/com/szpg/plc/message/command/write/SetJgLockBitCommand.java b/src/com/szpg/plc/message/command/write/SetJgLockBitCommand.java new file mode 100644 index 0000000..f4bc55a --- /dev/null +++ b/src/com/szpg/plc/message/command/write/SetJgLockBitCommand.java @@ -0,0 +1,40 @@ +package com.szpg.plc.message.command.write; + +import com.szpg.plc.message.AppMessageConstants; +import com.szpg.plc.message.command.WriteMemoryCommand; +import com.szpg.plc.message.response.WriteMemoryCommandResponse; + +public class SetJgLockBitCommand extends WriteMemoryCommand { + + /** + * + */ + private static final long serialVersionUID = 935723353287421429L; + + public final static int JG_LOCK = 0; //井盖锁定 + + private int unlock; + + public int getUnlock() { + return unlock; + } + + public void setUnlock(int unlock) { + this.unlock = unlock; + } + + @Override + public String getCommandType() { + return AppMessageConstants.CMD_TYPE_SETJGLOCK; + } + + @Override + public Class getResponseClass() { + return WriteMemoryCommandResponse.class; + } + + @Override + public String toString() { + return "向终端[" + getDestinationId() + "]发送设置井盖锁定命令"; + } +} diff --git a/src/com/szpg/plc/message/command/write/SetJgOffBitCommand.java b/src/com/szpg/plc/message/command/write/SetJgOffBitCommand.java new file mode 100644 index 0000000..185804c --- /dev/null +++ b/src/com/szpg/plc/message/command/write/SetJgOffBitCommand.java @@ -0,0 +1,41 @@ +package com.szpg.plc.message.command.write; + +import com.szpg.plc.message.AppMessageConstants; +import com.szpg.plc.message.command.WriteMemoryCommand; +import com.szpg.plc.message.response.WriteMemoryCommandResponse; + +public class SetJgOffBitCommand extends WriteMemoryCommand { + + /** + * + */ + private static final long serialVersionUID = 935723353287421429L; + + public final static int JG_OFF_ENABLE = 1; // 井盖关闭 + public final static int JG_OFF_DISABLE = 0; // 井盖关闭复位 + + private int jgoff; + + public int getJgoff() { + return jgoff; + } + + public void setJgoff(int jgoff) { + this.jgoff = jgoff; + } + + @Override + public String getCommandType() { + return AppMessageConstants.CMD_TYPE_SETJGOFF; + } + + @Override + public Class getResponseClass() { + return WriteMemoryCommandResponse.class; + } + + @Override + public String toString() { + return "向终端[" + getDestinationId() + "]发送设置井盖关闭位命令[" + jgoff + "]"; + } +} diff --git a/src/com/szpg/plc/message/command/write/SetJgOnBitCommand.java b/src/com/szpg/plc/message/command/write/SetJgOnBitCommand.java new file mode 100644 index 0000000..b63cf19 --- /dev/null +++ b/src/com/szpg/plc/message/command/write/SetJgOnBitCommand.java @@ -0,0 +1,41 @@ +package com.szpg.plc.message.command.write; + +import com.szpg.plc.message.AppMessageConstants; +import com.szpg.plc.message.command.WriteMemoryCommand; +import com.szpg.plc.message.response.WriteMemoryCommandResponse; + +public class SetJgOnBitCommand extends WriteMemoryCommand { + + /** + * + */ + private static final long serialVersionUID = 935723353287421429L; + + public final static int JG_ON_ENABLE = 1; // 井盖打开 + public final static int JG_ON_DISABLE = 0; // 井盖打开复位 + + private int jgon; + + public int getJgon() { + return jgon; + } + + public void setJgon(int jgon) { + this.jgon = jgon; + } + + @Override + public String getCommandType() { + return AppMessageConstants.CMD_TYPE_SETJGON; + } + + @Override + public Class getResponseClass() { + return WriteMemoryCommandResponse.class; + } + + @Override + public String toString() { + return "向终端[" + getDestinationId() + "]发送设置井盖开启位命令[" + jgon + "]"; + } +} diff --git a/src/com/szpg/plc/message/command/write/SetJgUnlockBitCommand.java b/src/com/szpg/plc/message/command/write/SetJgUnlockBitCommand.java index e3898b4..cfe7a6b 100644 --- a/src/com/szpg/plc/message/command/write/SetJgUnlockBitCommand.java +++ b/src/com/szpg/plc/message/command/write/SetJgUnlockBitCommand.java @@ -10,8 +10,7 @@ * */ private static final long serialVersionUID = 935723353287421429L; - - public final static int JG_LOCK = 0; //井盖锁定 + public final static int JG_UNLOCK = 1; //井盖解锁 private int unlock; diff --git a/src/com/szpg/plc/message/response/write/SetJgLockBitCommandResponse.java b/src/com/szpg/plc/message/response/write/SetJgLockBitCommandResponse.java new file mode 100644 index 0000000..adb5f9d --- /dev/null +++ b/src/com/szpg/plc/message/response/write/SetJgLockBitCommandResponse.java @@ -0,0 +1,29 @@ +package com.szpg.plc.message.response.write; + +import com.szpg.db.dao.PgDeviceDao; +import com.szpg.db.dao.PgJgDao; +import com.szpg.db.dao.impl.PgDeviceDaoImpl; +import com.szpg.db.dao.impl.PgJgDaoImpl; +import com.szpg.plc.message.response.WriteMemoryCommandResponse; +import org.apache.log4j.Logger; + +public class SetJgLockBitCommandResponse extends WriteMemoryCommandResponse { + + private final Logger logger = Logger.getLogger(this.getClass().getName()); + + private PgJgDao jgDao = new PgJgDaoImpl(); + private PgDeviceDao deviceDao = new PgDeviceDaoImpl(); + + @Override + public void afterAction() { + if (this.isSuccess() == true) { + // 更新设备状态 锁定 + int deviceId = deviceDao.findDeviceIdByCode(this.getDestinationId()); + if (deviceId > 0) { + jgDao.updateDeviceStatus(deviceId, "0"); + } + + logger.info("[" + this.getAcucode() + "]锁定井盖成功"); + } + } +} diff --git a/src/ACUBL.properties b/src/ACUBL.properties index 9c4b0ab..df9ffdb 100644 --- a/src/ACUBL.properties +++ b/src/ACUBL.properties @@ -1,6 +1,6 @@ #ACU\u53D8\u91CF\u8868\u914D\u7F6E\u6587\u4EF6 -######## THXC.ACU001 ######## +######## 01 HXC.ACU001 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU001.CH.COUNT = 6 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -144,7 +144,7 @@ -######## THXC.ACU002 ######## +######## 02 THXC.ACU002 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU002.CH.COUNT = 6 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -288,7 +288,7 @@ -######## THXC.ACU003 ######## +######## 03 THXC.ACU003 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU003.CH.COUNT = 6 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -432,7 +432,7 @@ -######## THXC.ACU004 ######## +######## 04 THXC.ACU004 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU004.CH.COUNT = 6 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -576,7 +576,7 @@ -######## THXC.ACU005 ######## +######## 05 THXC.ACU005 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU005.CH.COUNT = 6 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -720,7 +720,7 @@ -######## THXC.ACU006 ######## +######## 06 THXC.ACU006 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU006.CH.COUNT = 6 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -812,7 +812,7 @@ #\u98CE\u673A\u6570\u91CF -THXC.ACU006.FJ.COUNT = 9 +THXC.ACU006.FJ.COUNT = 6 #\u98CE\u673A\u7F16\u7801\u5217\u8868 THXC.ACU006.FJ.ZC.LIST = THXC.ACU006.F.DFJ01;THXC.ACU006.F.DFJ02;THXC.ACU006.F.SFJ01;THXC.ACU006.F.SFJ02;THXC.ACU006.F.RFJ01;THXC.ACU006.F.RFJ02 #\u98CE\u673A\u72B6\u6001\u8D77\u59CB\u5730\u5740 @@ -864,7 +864,7 @@ -######## THXC.ACU008 ######## +######## 07 THXC.ACU008 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU008.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -1008,7 +1008,7 @@ -######## THXC.ACU009 ######## +######## 08 THXC.ACU009 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU009.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -1152,7 +1152,7 @@ -######## THXC.ACU010 ######## +######## 09 THXC.ACU010 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU010.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -1296,7 +1296,7 @@ -######## THXC.ACU011 ######## +######## 10 THXC.ACU011 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU011.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -1440,7 +1440,7 @@ -######## THXC.ACU013 ######## +######## 11 THXC.ACU013 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU013.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -1584,7 +1584,7 @@ -######## THXC.ACU014 ######## +######## 12 THXC.ACU014 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU014.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -1729,7 +1729,7 @@ -######## THXC.ACU015 ######## +######## 13 THXC.ACU015 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU015.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -1874,7 +1874,7 @@ -######## THXC.ACU016 ######## +######## 14 THXC.ACU016 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU016.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2020,7 +2020,7 @@ ######## \u4E8C\u671F\u4E09\u6807\u6BB5 ######## -######## THXC.ACU301 ######## +######## 01 THXC.ACU301 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU301.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2070,7 +2070,7 @@ -######## THXC.ACU302 ######## +######## 02 THXC.ACU302 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU302.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2083,7 +2083,7 @@ -######## THXC.ACU303 ######## +######## 03 THXC.ACU303 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU303.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2096,7 +2096,7 @@ -######## THXC.ACU304 ######## +######## 04 THXC.ACU304 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU304.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2109,7 +2109,7 @@ -######## THXC.ACU305 ######## +######## 05 THXC.ACU305 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU305.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2122,7 +2122,7 @@ -######## THXC.ACU501 ######## +######## 06 THXC.ACU501 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU501.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2135,7 +2135,7 @@ -######## THXC.ACU502 ######## +######## 07 THXC.ACU502 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU502.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2148,7 +2148,7 @@ -######## THXC.ACU503 ######## +######## 08 THXC.ACU503 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU503.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2161,7 +2161,7 @@ -######## THXC.ACU504 ######## +######## 09 THXC.ACU504 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU504.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2174,7 +2174,7 @@ -######## THXC.ACU505 ######## +######## 10 THXC.ACU505 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU505.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2187,7 +2187,7 @@ -######## THXC.ACU506 ######## +######## 11 THXC.ACU506 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU506.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2200,7 +2200,7 @@ -######## THXC.ACU507 ######## +######## 12 THXC.ACU507 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU507.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2213,7 +2213,7 @@ -######## THXC.ACU601 ######## +######## 13 THXC.ACU601 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU601.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2226,7 +2226,7 @@ -######## THXC.ACU602 ######## +######## 14 THXC.ACU602 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU602.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2239,7 +2239,7 @@ -######## THXC.ACU603 ######## +######## 15 THXC.ACU603 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU603.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2252,7 +2252,7 @@ -######## THXC.ACU604 ######## +######## 16 THXC.ACU604 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU604.WSYQ.COUNT = 6 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2265,7 +2265,7 @@ -######## THXC.ACUS03 ######## +######## 17 THXC.ACUS03 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACUS03.WSYQ.COUNT = 2 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2278,7 +2278,7 @@ -######## THXC.ACUS05 ######## +######## 18 THXC.ACUS05 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACUS05.WSYQ.COUNT = 2 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2291,7 +2291,7 @@ -######## THXC.ACUS06 ######## +######## 19 THXC.ACUS06 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACUS06.WSYQ.COUNT = 2 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2304,6 +2304,103 @@ +######## \u4E8C\u671F\u56DB\u6807\u6BB5 ######## +######## 01 THXC.ACU107 ######## + + +######## 02 THXC.ACU108 ######## + + +######## 03 THXC.ACU109 ######## + + +######## 04 THXC.ACU110 ######## + + +######## 05 THXC.ACU306 ######## + + +######## 06 THXC.ACU307 ######## + + +######## 07 THXC.ACU308 ######## + + +######## 08 THXC.ACU309 ######## + + +######## 09 THXC.ACU401 ######## + + +######## 10 THXC.ACU402 ######## + + +######## 11 THXC.ACU403 ######## + + +######## 12 THXC.ACU404 ######## + + +######## 13 THXC.ACU405 ######## + + +######## 14 THXC.ACU406 ######## + + +######## 15 THXC.ACU407 ######## + + +######## 16 THXC.ACU408 ######## + + +######## 17 THXC.ACUS04 ######## + + +######## 18 THXC.ACU701 ######## + + +######## 19 THXC.ACU702 ######## + + +######## 20 THXC.ACU703 ######## + + +######## 21 THXC.ACU704 ######## + + +######## 22 THXC.ACU705 ######## + + +######## 23 THXC.ACU706 ######## + + +######## 24 THXC.ACU801 ######## + + +######## 25 THXC.ACU802 ######## + + +######## 26 THXC.ACU803 ######## + + +######## 27 THXC.ACU804 ######## + + +######## 28 THXC.ACU805 ######## + + +######## 29 THXC.ACU806 ######## + + +######## 30 THXC.ACU807 ######## + + +######## 31 THXC.ACUS07 ######## + + +######## 32 THXC.ACUS08 ######## + + ######## \u9F99\u7FD4\u8DEF\u71C3\u6C14\u6BB5 THXC.ACU801 ######## #\u98CE\u673A\u6570\u91CF THXC.ACU801.FJ.COUNT = 1 diff --git a/src/com/szpg/db/dao/impl/PgAcuCmdDaoImpl.java b/src/com/szpg/db/dao/impl/PgAcuCmdDaoImpl.java index b752a9c..406d9ee 100644 --- a/src/com/szpg/db/dao/impl/PgAcuCmdDaoImpl.java +++ b/src/com/szpg/db/dao/impl/PgAcuCmdDaoImpl.java @@ -154,13 +154,14 @@ Connection conn = null; String insertStr = "INSERT INTO PG_ACU_CMD " + - "(ID, TM, CMD_TYPE, DEST_ACU_CODE, TIMEOUT) " + - "VALUES (?, TO_DATE(?, 'YYYYMMDDHH24MISS'), ?, ?, '0')"; - Object[] params = new Object[4]; + "(ID, TM, CMD_TYPE, DEST_ACU_CODE, TIMEOUT, DEVICE_CODE) " + + "VALUES (?, TO_DATE(?, 'YYYYMMDDHH24MISS'), ?, ?, '0', ?)"; + Object[] params = new Object[5]; params[0] = cmd.getId(); params[1] = TimeFormat.format(cmd.getTm(), "yyyyMMddHHmmss"); params[2] = cmd.getCmd_type(); params[3] = cmd.getDest_acu_code(); + params[4] = cmd.getDevice_code(); try { conn = ConnectionManager.getConnectionFromC3P0(); diff --git a/src/com/szpg/db/data/PgAcuCmd.java b/src/com/szpg/db/data/PgAcuCmd.java index 9e57628..0f3cabc 100644 --- a/src/com/szpg/db/data/PgAcuCmd.java +++ b/src/com/szpg/db/data/PgAcuCmd.java @@ -23,6 +23,7 @@ private Date tm; // 命令发送时间 private String cmd_type; // 命令类型 private String dest_acu_code; // 目标ACU代码 + private String device_code; // 命令的资产编号 private boolean timeout; // 是否超时 public PgAcuCmd() { @@ -62,6 +63,14 @@ this.dest_acu_code = dest_acu_code; } + public String getDevice_code() { + return device_code; + } + + public void setDevice_code(String device_code) { + this.device_code = device_code; + } + public boolean isTimeout() { return timeout; } diff --git a/src/com/szpg/plc/PGDSCServlet.java b/src/com/szpg/plc/PGDSCServlet.java index 5653eb6..881c2e3 100644 --- a/src/com/szpg/plc/PGDSCServlet.java +++ b/src/com/szpg/plc/PGDSCServlet.java @@ -104,13 +104,13 @@ sendQueryJGStatusCommand(); //10巡检数据同步 - synchAssetInSpection(); +// synchAssetInSpection(); //运维数据同步 - synchMaintanceRecord(); +// synchMaintanceRecord(); // 查询二期温湿度氧气实时数据 - sendQueryWSYQValueCommand(); +// sendQueryWSYQValueCommand(); } /** diff --git a/src/com/szpg/plc/message/command/write/SetJgLockBitCommand.java b/src/com/szpg/plc/message/command/write/SetJgLockBitCommand.java new file mode 100644 index 0000000..f4bc55a --- /dev/null +++ b/src/com/szpg/plc/message/command/write/SetJgLockBitCommand.java @@ -0,0 +1,40 @@ +package com.szpg.plc.message.command.write; + +import com.szpg.plc.message.AppMessageConstants; +import com.szpg.plc.message.command.WriteMemoryCommand; +import com.szpg.plc.message.response.WriteMemoryCommandResponse; + +public class SetJgLockBitCommand extends WriteMemoryCommand { + + /** + * + */ + private static final long serialVersionUID = 935723353287421429L; + + public final static int JG_LOCK = 0; //井盖锁定 + + private int unlock; + + public int getUnlock() { + return unlock; + } + + public void setUnlock(int unlock) { + this.unlock = unlock; + } + + @Override + public String getCommandType() { + return AppMessageConstants.CMD_TYPE_SETJGLOCK; + } + + @Override + public Class getResponseClass() { + return WriteMemoryCommandResponse.class; + } + + @Override + public String toString() { + return "向终端[" + getDestinationId() + "]发送设置井盖锁定命令"; + } +} diff --git a/src/com/szpg/plc/message/command/write/SetJgOffBitCommand.java b/src/com/szpg/plc/message/command/write/SetJgOffBitCommand.java new file mode 100644 index 0000000..185804c --- /dev/null +++ b/src/com/szpg/plc/message/command/write/SetJgOffBitCommand.java @@ -0,0 +1,41 @@ +package com.szpg.plc.message.command.write; + +import com.szpg.plc.message.AppMessageConstants; +import com.szpg.plc.message.command.WriteMemoryCommand; +import com.szpg.plc.message.response.WriteMemoryCommandResponse; + +public class SetJgOffBitCommand extends WriteMemoryCommand { + + /** + * + */ + private static final long serialVersionUID = 935723353287421429L; + + public final static int JG_OFF_ENABLE = 1; // 井盖关闭 + public final static int JG_OFF_DISABLE = 0; // 井盖关闭复位 + + private int jgoff; + + public int getJgoff() { + return jgoff; + } + + public void setJgoff(int jgoff) { + this.jgoff = jgoff; + } + + @Override + public String getCommandType() { + return AppMessageConstants.CMD_TYPE_SETJGOFF; + } + + @Override + public Class getResponseClass() { + return WriteMemoryCommandResponse.class; + } + + @Override + public String toString() { + return "向终端[" + getDestinationId() + "]发送设置井盖关闭位命令[" + jgoff + "]"; + } +} diff --git a/src/com/szpg/plc/message/command/write/SetJgOnBitCommand.java b/src/com/szpg/plc/message/command/write/SetJgOnBitCommand.java new file mode 100644 index 0000000..b63cf19 --- /dev/null +++ b/src/com/szpg/plc/message/command/write/SetJgOnBitCommand.java @@ -0,0 +1,41 @@ +package com.szpg.plc.message.command.write; + +import com.szpg.plc.message.AppMessageConstants; +import com.szpg.plc.message.command.WriteMemoryCommand; +import com.szpg.plc.message.response.WriteMemoryCommandResponse; + +public class SetJgOnBitCommand extends WriteMemoryCommand { + + /** + * + */ + private static final long serialVersionUID = 935723353287421429L; + + public final static int JG_ON_ENABLE = 1; // 井盖打开 + public final static int JG_ON_DISABLE = 0; // 井盖打开复位 + + private int jgon; + + public int getJgon() { + return jgon; + } + + public void setJgon(int jgon) { + this.jgon = jgon; + } + + @Override + public String getCommandType() { + return AppMessageConstants.CMD_TYPE_SETJGON; + } + + @Override + public Class getResponseClass() { + return WriteMemoryCommandResponse.class; + } + + @Override + public String toString() { + return "向终端[" + getDestinationId() + "]发送设置井盖开启位命令[" + jgon + "]"; + } +} diff --git a/src/com/szpg/plc/message/command/write/SetJgUnlockBitCommand.java b/src/com/szpg/plc/message/command/write/SetJgUnlockBitCommand.java index e3898b4..cfe7a6b 100644 --- a/src/com/szpg/plc/message/command/write/SetJgUnlockBitCommand.java +++ b/src/com/szpg/plc/message/command/write/SetJgUnlockBitCommand.java @@ -10,8 +10,7 @@ * */ private static final long serialVersionUID = 935723353287421429L; - - public final static int JG_LOCK = 0; //井盖锁定 + public final static int JG_UNLOCK = 1; //井盖解锁 private int unlock; diff --git a/src/com/szpg/plc/message/response/write/SetJgLockBitCommandResponse.java b/src/com/szpg/plc/message/response/write/SetJgLockBitCommandResponse.java new file mode 100644 index 0000000..adb5f9d --- /dev/null +++ b/src/com/szpg/plc/message/response/write/SetJgLockBitCommandResponse.java @@ -0,0 +1,29 @@ +package com.szpg.plc.message.response.write; + +import com.szpg.db.dao.PgDeviceDao; +import com.szpg.db.dao.PgJgDao; +import com.szpg.db.dao.impl.PgDeviceDaoImpl; +import com.szpg.db.dao.impl.PgJgDaoImpl; +import com.szpg.plc.message.response.WriteMemoryCommandResponse; +import org.apache.log4j.Logger; + +public class SetJgLockBitCommandResponse extends WriteMemoryCommandResponse { + + private final Logger logger = Logger.getLogger(this.getClass().getName()); + + private PgJgDao jgDao = new PgJgDaoImpl(); + private PgDeviceDao deviceDao = new PgDeviceDaoImpl(); + + @Override + public void afterAction() { + if (this.isSuccess() == true) { + // 更新设备状态 锁定 + int deviceId = deviceDao.findDeviceIdByCode(this.getDestinationId()); + if (deviceId > 0) { + jgDao.updateDeviceStatus(deviceId, "0"); + } + + logger.info("[" + this.getAcucode() + "]锁定井盖成功"); + } + } +} diff --git a/src/com/szpg/plc/message/response/write/SetJgOffBitCommandResponse.java b/src/com/szpg/plc/message/response/write/SetJgOffBitCommandResponse.java new file mode 100644 index 0000000..f10831c --- /dev/null +++ b/src/com/szpg/plc/message/response/write/SetJgOffBitCommandResponse.java @@ -0,0 +1,29 @@ +package com.szpg.plc.message.response.write; + +import com.szpg.db.dao.PgDeviceDao; +import com.szpg.db.dao.PgJgDao; +import com.szpg.db.dao.impl.PgDeviceDaoImpl; +import com.szpg.db.dao.impl.PgJgDaoImpl; +import com.szpg.plc.message.response.WriteMemoryCommandResponse; +import org.apache.log4j.Logger; + +public class SetJgOffBitCommandResponse extends WriteMemoryCommandResponse { + + private final Logger logger = Logger.getLogger(this.getClass().getName()); + + private PgJgDao jgDao = new PgJgDaoImpl(); + private PgDeviceDao deviceDao = new PgDeviceDaoImpl(); + + @Override + public void afterAction() { + if (this.isSuccess() == true) { + // 更新设备状态 关 + int deviceId = deviceDao.findDeviceIdByCode(this.getDestinationId()); + if (deviceId > 0) { + jgDao.updateDeviceStatus(deviceId, "0"); + } + + logger.info("[" + this.getAcucode() + "]关闭井盖成功"); + } + } +} diff --git a/src/ACUBL.properties b/src/ACUBL.properties index 9c4b0ab..df9ffdb 100644 --- a/src/ACUBL.properties +++ b/src/ACUBL.properties @@ -1,6 +1,6 @@ #ACU\u53D8\u91CF\u8868\u914D\u7F6E\u6587\u4EF6 -######## THXC.ACU001 ######## +######## 01 HXC.ACU001 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU001.CH.COUNT = 6 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -144,7 +144,7 @@ -######## THXC.ACU002 ######## +######## 02 THXC.ACU002 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU002.CH.COUNT = 6 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -288,7 +288,7 @@ -######## THXC.ACU003 ######## +######## 03 THXC.ACU003 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU003.CH.COUNT = 6 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -432,7 +432,7 @@ -######## THXC.ACU004 ######## +######## 04 THXC.ACU004 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU004.CH.COUNT = 6 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -576,7 +576,7 @@ -######## THXC.ACU005 ######## +######## 05 THXC.ACU005 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU005.CH.COUNT = 6 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -720,7 +720,7 @@ -######## THXC.ACU006 ######## +######## 06 THXC.ACU006 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU006.CH.COUNT = 6 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -812,7 +812,7 @@ #\u98CE\u673A\u6570\u91CF -THXC.ACU006.FJ.COUNT = 9 +THXC.ACU006.FJ.COUNT = 6 #\u98CE\u673A\u7F16\u7801\u5217\u8868 THXC.ACU006.FJ.ZC.LIST = THXC.ACU006.F.DFJ01;THXC.ACU006.F.DFJ02;THXC.ACU006.F.SFJ01;THXC.ACU006.F.SFJ02;THXC.ACU006.F.RFJ01;THXC.ACU006.F.RFJ02 #\u98CE\u673A\u72B6\u6001\u8D77\u59CB\u5730\u5740 @@ -864,7 +864,7 @@ -######## THXC.ACU008 ######## +######## 07 THXC.ACU008 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU008.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -1008,7 +1008,7 @@ -######## THXC.ACU009 ######## +######## 08 THXC.ACU009 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU009.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -1152,7 +1152,7 @@ -######## THXC.ACU010 ######## +######## 09 THXC.ACU010 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU010.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -1296,7 +1296,7 @@ -######## THXC.ACU011 ######## +######## 10 THXC.ACU011 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU011.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -1440,7 +1440,7 @@ -######## THXC.ACU013 ######## +######## 11 THXC.ACU013 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU013.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -1584,7 +1584,7 @@ -######## THXC.ACU014 ######## +######## 12 THXC.ACU014 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU014.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -1729,7 +1729,7 @@ -######## THXC.ACU015 ######## +######## 13 THXC.ACU015 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU015.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -1874,7 +1874,7 @@ -######## THXC.ACU016 ######## +######## 14 THXC.ACU016 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU016.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2020,7 +2020,7 @@ ######## \u4E8C\u671F\u4E09\u6807\u6BB5 ######## -######## THXC.ACU301 ######## +######## 01 THXC.ACU301 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU301.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2070,7 +2070,7 @@ -######## THXC.ACU302 ######## +######## 02 THXC.ACU302 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU302.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2083,7 +2083,7 @@ -######## THXC.ACU303 ######## +######## 03 THXC.ACU303 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU303.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2096,7 +2096,7 @@ -######## THXC.ACU304 ######## +######## 04 THXC.ACU304 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU304.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2109,7 +2109,7 @@ -######## THXC.ACU305 ######## +######## 05 THXC.ACU305 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU305.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2122,7 +2122,7 @@ -######## THXC.ACU501 ######## +######## 06 THXC.ACU501 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU501.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2135,7 +2135,7 @@ -######## THXC.ACU502 ######## +######## 07 THXC.ACU502 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU502.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2148,7 +2148,7 @@ -######## THXC.ACU503 ######## +######## 08 THXC.ACU503 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU503.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2161,7 +2161,7 @@ -######## THXC.ACU504 ######## +######## 09 THXC.ACU504 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU504.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2174,7 +2174,7 @@ -######## THXC.ACU505 ######## +######## 10 THXC.ACU505 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU505.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2187,7 +2187,7 @@ -######## THXC.ACU506 ######## +######## 11 THXC.ACU506 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU506.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2200,7 +2200,7 @@ -######## THXC.ACU507 ######## +######## 12 THXC.ACU507 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU507.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2213,7 +2213,7 @@ -######## THXC.ACU601 ######## +######## 13 THXC.ACU601 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU601.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2226,7 +2226,7 @@ -######## THXC.ACU602 ######## +######## 14 THXC.ACU602 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU602.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2239,7 +2239,7 @@ -######## THXC.ACU603 ######## +######## 15 THXC.ACU603 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU603.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2252,7 +2252,7 @@ -######## THXC.ACU604 ######## +######## 16 THXC.ACU604 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU604.WSYQ.COUNT = 6 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2265,7 +2265,7 @@ -######## THXC.ACUS03 ######## +######## 17 THXC.ACUS03 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACUS03.WSYQ.COUNT = 2 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2278,7 +2278,7 @@ -######## THXC.ACUS05 ######## +######## 18 THXC.ACUS05 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACUS05.WSYQ.COUNT = 2 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2291,7 +2291,7 @@ -######## THXC.ACUS06 ######## +######## 19 THXC.ACUS06 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACUS06.WSYQ.COUNT = 2 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2304,6 +2304,103 @@ +######## \u4E8C\u671F\u56DB\u6807\u6BB5 ######## +######## 01 THXC.ACU107 ######## + + +######## 02 THXC.ACU108 ######## + + +######## 03 THXC.ACU109 ######## + + +######## 04 THXC.ACU110 ######## + + +######## 05 THXC.ACU306 ######## + + +######## 06 THXC.ACU307 ######## + + +######## 07 THXC.ACU308 ######## + + +######## 08 THXC.ACU309 ######## + + +######## 09 THXC.ACU401 ######## + + +######## 10 THXC.ACU402 ######## + + +######## 11 THXC.ACU403 ######## + + +######## 12 THXC.ACU404 ######## + + +######## 13 THXC.ACU405 ######## + + +######## 14 THXC.ACU406 ######## + + +######## 15 THXC.ACU407 ######## + + +######## 16 THXC.ACU408 ######## + + +######## 17 THXC.ACUS04 ######## + + +######## 18 THXC.ACU701 ######## + + +######## 19 THXC.ACU702 ######## + + +######## 20 THXC.ACU703 ######## + + +######## 21 THXC.ACU704 ######## + + +######## 22 THXC.ACU705 ######## + + +######## 23 THXC.ACU706 ######## + + +######## 24 THXC.ACU801 ######## + + +######## 25 THXC.ACU802 ######## + + +######## 26 THXC.ACU803 ######## + + +######## 27 THXC.ACU804 ######## + + +######## 28 THXC.ACU805 ######## + + +######## 29 THXC.ACU806 ######## + + +######## 30 THXC.ACU807 ######## + + +######## 31 THXC.ACUS07 ######## + + +######## 32 THXC.ACUS08 ######## + + ######## \u9F99\u7FD4\u8DEF\u71C3\u6C14\u6BB5 THXC.ACU801 ######## #\u98CE\u673A\u6570\u91CF THXC.ACU801.FJ.COUNT = 1 diff --git a/src/com/szpg/db/dao/impl/PgAcuCmdDaoImpl.java b/src/com/szpg/db/dao/impl/PgAcuCmdDaoImpl.java index b752a9c..406d9ee 100644 --- a/src/com/szpg/db/dao/impl/PgAcuCmdDaoImpl.java +++ b/src/com/szpg/db/dao/impl/PgAcuCmdDaoImpl.java @@ -154,13 +154,14 @@ Connection conn = null; String insertStr = "INSERT INTO PG_ACU_CMD " + - "(ID, TM, CMD_TYPE, DEST_ACU_CODE, TIMEOUT) " + - "VALUES (?, TO_DATE(?, 'YYYYMMDDHH24MISS'), ?, ?, '0')"; - Object[] params = new Object[4]; + "(ID, TM, CMD_TYPE, DEST_ACU_CODE, TIMEOUT, DEVICE_CODE) " + + "VALUES (?, TO_DATE(?, 'YYYYMMDDHH24MISS'), ?, ?, '0', ?)"; + Object[] params = new Object[5]; params[0] = cmd.getId(); params[1] = TimeFormat.format(cmd.getTm(), "yyyyMMddHHmmss"); params[2] = cmd.getCmd_type(); params[3] = cmd.getDest_acu_code(); + params[4] = cmd.getDevice_code(); try { conn = ConnectionManager.getConnectionFromC3P0(); diff --git a/src/com/szpg/db/data/PgAcuCmd.java b/src/com/szpg/db/data/PgAcuCmd.java index 9e57628..0f3cabc 100644 --- a/src/com/szpg/db/data/PgAcuCmd.java +++ b/src/com/szpg/db/data/PgAcuCmd.java @@ -23,6 +23,7 @@ private Date tm; // 命令发送时间 private String cmd_type; // 命令类型 private String dest_acu_code; // 目标ACU代码 + private String device_code; // 命令的资产编号 private boolean timeout; // 是否超时 public PgAcuCmd() { @@ -62,6 +63,14 @@ this.dest_acu_code = dest_acu_code; } + public String getDevice_code() { + return device_code; + } + + public void setDevice_code(String device_code) { + this.device_code = device_code; + } + public boolean isTimeout() { return timeout; } diff --git a/src/com/szpg/plc/PGDSCServlet.java b/src/com/szpg/plc/PGDSCServlet.java index 5653eb6..881c2e3 100644 --- a/src/com/szpg/plc/PGDSCServlet.java +++ b/src/com/szpg/plc/PGDSCServlet.java @@ -104,13 +104,13 @@ sendQueryJGStatusCommand(); //10巡检数据同步 - synchAssetInSpection(); +// synchAssetInSpection(); //运维数据同步 - synchMaintanceRecord(); +// synchMaintanceRecord(); // 查询二期温湿度氧气实时数据 - sendQueryWSYQValueCommand(); +// sendQueryWSYQValueCommand(); } /** diff --git a/src/com/szpg/plc/message/command/write/SetJgLockBitCommand.java b/src/com/szpg/plc/message/command/write/SetJgLockBitCommand.java new file mode 100644 index 0000000..f4bc55a --- /dev/null +++ b/src/com/szpg/plc/message/command/write/SetJgLockBitCommand.java @@ -0,0 +1,40 @@ +package com.szpg.plc.message.command.write; + +import com.szpg.plc.message.AppMessageConstants; +import com.szpg.plc.message.command.WriteMemoryCommand; +import com.szpg.plc.message.response.WriteMemoryCommandResponse; + +public class SetJgLockBitCommand extends WriteMemoryCommand { + + /** + * + */ + private static final long serialVersionUID = 935723353287421429L; + + public final static int JG_LOCK = 0; //井盖锁定 + + private int unlock; + + public int getUnlock() { + return unlock; + } + + public void setUnlock(int unlock) { + this.unlock = unlock; + } + + @Override + public String getCommandType() { + return AppMessageConstants.CMD_TYPE_SETJGLOCK; + } + + @Override + public Class getResponseClass() { + return WriteMemoryCommandResponse.class; + } + + @Override + public String toString() { + return "向终端[" + getDestinationId() + "]发送设置井盖锁定命令"; + } +} diff --git a/src/com/szpg/plc/message/command/write/SetJgOffBitCommand.java b/src/com/szpg/plc/message/command/write/SetJgOffBitCommand.java new file mode 100644 index 0000000..185804c --- /dev/null +++ b/src/com/szpg/plc/message/command/write/SetJgOffBitCommand.java @@ -0,0 +1,41 @@ +package com.szpg.plc.message.command.write; + +import com.szpg.plc.message.AppMessageConstants; +import com.szpg.plc.message.command.WriteMemoryCommand; +import com.szpg.plc.message.response.WriteMemoryCommandResponse; + +public class SetJgOffBitCommand extends WriteMemoryCommand { + + /** + * + */ + private static final long serialVersionUID = 935723353287421429L; + + public final static int JG_OFF_ENABLE = 1; // 井盖关闭 + public final static int JG_OFF_DISABLE = 0; // 井盖关闭复位 + + private int jgoff; + + public int getJgoff() { + return jgoff; + } + + public void setJgoff(int jgoff) { + this.jgoff = jgoff; + } + + @Override + public String getCommandType() { + return AppMessageConstants.CMD_TYPE_SETJGOFF; + } + + @Override + public Class getResponseClass() { + return WriteMemoryCommandResponse.class; + } + + @Override + public String toString() { + return "向终端[" + getDestinationId() + "]发送设置井盖关闭位命令[" + jgoff + "]"; + } +} diff --git a/src/com/szpg/plc/message/command/write/SetJgOnBitCommand.java b/src/com/szpg/plc/message/command/write/SetJgOnBitCommand.java new file mode 100644 index 0000000..b63cf19 --- /dev/null +++ b/src/com/szpg/plc/message/command/write/SetJgOnBitCommand.java @@ -0,0 +1,41 @@ +package com.szpg.plc.message.command.write; + +import com.szpg.plc.message.AppMessageConstants; +import com.szpg.plc.message.command.WriteMemoryCommand; +import com.szpg.plc.message.response.WriteMemoryCommandResponse; + +public class SetJgOnBitCommand extends WriteMemoryCommand { + + /** + * + */ + private static final long serialVersionUID = 935723353287421429L; + + public final static int JG_ON_ENABLE = 1; // 井盖打开 + public final static int JG_ON_DISABLE = 0; // 井盖打开复位 + + private int jgon; + + public int getJgon() { + return jgon; + } + + public void setJgon(int jgon) { + this.jgon = jgon; + } + + @Override + public String getCommandType() { + return AppMessageConstants.CMD_TYPE_SETJGON; + } + + @Override + public Class getResponseClass() { + return WriteMemoryCommandResponse.class; + } + + @Override + public String toString() { + return "向终端[" + getDestinationId() + "]发送设置井盖开启位命令[" + jgon + "]"; + } +} diff --git a/src/com/szpg/plc/message/command/write/SetJgUnlockBitCommand.java b/src/com/szpg/plc/message/command/write/SetJgUnlockBitCommand.java index e3898b4..cfe7a6b 100644 --- a/src/com/szpg/plc/message/command/write/SetJgUnlockBitCommand.java +++ b/src/com/szpg/plc/message/command/write/SetJgUnlockBitCommand.java @@ -10,8 +10,7 @@ * */ private static final long serialVersionUID = 935723353287421429L; - - public final static int JG_LOCK = 0; //井盖锁定 + public final static int JG_UNLOCK = 1; //井盖解锁 private int unlock; diff --git a/src/com/szpg/plc/message/response/write/SetJgLockBitCommandResponse.java b/src/com/szpg/plc/message/response/write/SetJgLockBitCommandResponse.java new file mode 100644 index 0000000..adb5f9d --- /dev/null +++ b/src/com/szpg/plc/message/response/write/SetJgLockBitCommandResponse.java @@ -0,0 +1,29 @@ +package com.szpg.plc.message.response.write; + +import com.szpg.db.dao.PgDeviceDao; +import com.szpg.db.dao.PgJgDao; +import com.szpg.db.dao.impl.PgDeviceDaoImpl; +import com.szpg.db.dao.impl.PgJgDaoImpl; +import com.szpg.plc.message.response.WriteMemoryCommandResponse; +import org.apache.log4j.Logger; + +public class SetJgLockBitCommandResponse extends WriteMemoryCommandResponse { + + private final Logger logger = Logger.getLogger(this.getClass().getName()); + + private PgJgDao jgDao = new PgJgDaoImpl(); + private PgDeviceDao deviceDao = new PgDeviceDaoImpl(); + + @Override + public void afterAction() { + if (this.isSuccess() == true) { + // 更新设备状态 锁定 + int deviceId = deviceDao.findDeviceIdByCode(this.getDestinationId()); + if (deviceId > 0) { + jgDao.updateDeviceStatus(deviceId, "0"); + } + + logger.info("[" + this.getAcucode() + "]锁定井盖成功"); + } + } +} diff --git a/src/com/szpg/plc/message/response/write/SetJgOffBitCommandResponse.java b/src/com/szpg/plc/message/response/write/SetJgOffBitCommandResponse.java new file mode 100644 index 0000000..f10831c --- /dev/null +++ b/src/com/szpg/plc/message/response/write/SetJgOffBitCommandResponse.java @@ -0,0 +1,29 @@ +package com.szpg.plc.message.response.write; + +import com.szpg.db.dao.PgDeviceDao; +import com.szpg.db.dao.PgJgDao; +import com.szpg.db.dao.impl.PgDeviceDaoImpl; +import com.szpg.db.dao.impl.PgJgDaoImpl; +import com.szpg.plc.message.response.WriteMemoryCommandResponse; +import org.apache.log4j.Logger; + +public class SetJgOffBitCommandResponse extends WriteMemoryCommandResponse { + + private final Logger logger = Logger.getLogger(this.getClass().getName()); + + private PgJgDao jgDao = new PgJgDaoImpl(); + private PgDeviceDao deviceDao = new PgDeviceDaoImpl(); + + @Override + public void afterAction() { + if (this.isSuccess() == true) { + // 更新设备状态 关 + int deviceId = deviceDao.findDeviceIdByCode(this.getDestinationId()); + if (deviceId > 0) { + jgDao.updateDeviceStatus(deviceId, "0"); + } + + logger.info("[" + this.getAcucode() + "]关闭井盖成功"); + } + } +} diff --git a/src/com/szpg/plc/message/response/write/SetJgOnBitCommandResponse.java b/src/com/szpg/plc/message/response/write/SetJgOnBitCommandResponse.java new file mode 100644 index 0000000..35eb98c --- /dev/null +++ b/src/com/szpg/plc/message/response/write/SetJgOnBitCommandResponse.java @@ -0,0 +1,29 @@ +package com.szpg.plc.message.response.write; + +import com.szpg.db.dao.PgDeviceDao; +import com.szpg.db.dao.PgJgDao; +import com.szpg.db.dao.impl.PgDeviceDaoImpl; +import com.szpg.db.dao.impl.PgJgDaoImpl; +import com.szpg.plc.message.response.WriteMemoryCommandResponse; +import org.apache.log4j.Logger; + +public class SetJgOnBitCommandResponse extends WriteMemoryCommandResponse { + + private final Logger logger = Logger.getLogger(this.getClass().getName()); + + private PgJgDao jgDao = new PgJgDaoImpl(); + private PgDeviceDao deviceDao = new PgDeviceDaoImpl(); + + @Override + public void afterAction() { + if (this.isSuccess() == true) { + // 更新设备状态 开 + int deviceId = deviceDao.findDeviceIdByCode(this.getDestinationId()); + if (deviceId > 0) { + jgDao.updateDeviceStatus(deviceId, "1"); + } + + logger.info("[" + this.getAcucode() + "]打开井盖成功"); + } + } +} diff --git a/src/ACUBL.properties b/src/ACUBL.properties index 9c4b0ab..df9ffdb 100644 --- a/src/ACUBL.properties +++ b/src/ACUBL.properties @@ -1,6 +1,6 @@ #ACU\u53D8\u91CF\u8868\u914D\u7F6E\u6587\u4EF6 -######## THXC.ACU001 ######## +######## 01 HXC.ACU001 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU001.CH.COUNT = 6 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -144,7 +144,7 @@ -######## THXC.ACU002 ######## +######## 02 THXC.ACU002 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU002.CH.COUNT = 6 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -288,7 +288,7 @@ -######## THXC.ACU003 ######## +######## 03 THXC.ACU003 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU003.CH.COUNT = 6 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -432,7 +432,7 @@ -######## THXC.ACU004 ######## +######## 04 THXC.ACU004 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU004.CH.COUNT = 6 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -576,7 +576,7 @@ -######## THXC.ACU005 ######## +######## 05 THXC.ACU005 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU005.CH.COUNT = 6 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -720,7 +720,7 @@ -######## THXC.ACU006 ######## +######## 06 THXC.ACU006 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU006.CH.COUNT = 6 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -812,7 +812,7 @@ #\u98CE\u673A\u6570\u91CF -THXC.ACU006.FJ.COUNT = 9 +THXC.ACU006.FJ.COUNT = 6 #\u98CE\u673A\u7F16\u7801\u5217\u8868 THXC.ACU006.FJ.ZC.LIST = THXC.ACU006.F.DFJ01;THXC.ACU006.F.DFJ02;THXC.ACU006.F.SFJ01;THXC.ACU006.F.SFJ02;THXC.ACU006.F.RFJ01;THXC.ACU006.F.RFJ02 #\u98CE\u673A\u72B6\u6001\u8D77\u59CB\u5730\u5740 @@ -864,7 +864,7 @@ -######## THXC.ACU008 ######## +######## 07 THXC.ACU008 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU008.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -1008,7 +1008,7 @@ -######## THXC.ACU009 ######## +######## 08 THXC.ACU009 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU009.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -1152,7 +1152,7 @@ -######## THXC.ACU010 ######## +######## 09 THXC.ACU010 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU010.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -1296,7 +1296,7 @@ -######## THXC.ACU011 ######## +######## 10 THXC.ACU011 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU011.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -1440,7 +1440,7 @@ -######## THXC.ACU013 ######## +######## 11 THXC.ACU013 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU013.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -1584,7 +1584,7 @@ -######## THXC.ACU014 ######## +######## 12 THXC.ACU014 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU014.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -1729,7 +1729,7 @@ -######## THXC.ACU015 ######## +######## 13 THXC.ACU015 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU015.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -1874,7 +1874,7 @@ -######## THXC.ACU016 ######## +######## 14 THXC.ACU016 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU016.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2020,7 +2020,7 @@ ######## \u4E8C\u671F\u4E09\u6807\u6BB5 ######## -######## THXC.ACU301 ######## +######## 01 THXC.ACU301 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU301.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2070,7 +2070,7 @@ -######## THXC.ACU302 ######## +######## 02 THXC.ACU302 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU302.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2083,7 +2083,7 @@ -######## THXC.ACU303 ######## +######## 03 THXC.ACU303 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU303.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2096,7 +2096,7 @@ -######## THXC.ACU304 ######## +######## 04 THXC.ACU304 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU304.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2109,7 +2109,7 @@ -######## THXC.ACU305 ######## +######## 05 THXC.ACU305 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU305.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2122,7 +2122,7 @@ -######## THXC.ACU501 ######## +######## 06 THXC.ACU501 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU501.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2135,7 +2135,7 @@ -######## THXC.ACU502 ######## +######## 07 THXC.ACU502 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU502.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2148,7 +2148,7 @@ -######## THXC.ACU503 ######## +######## 08 THXC.ACU503 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU503.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2161,7 +2161,7 @@ -######## THXC.ACU504 ######## +######## 09 THXC.ACU504 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU504.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2174,7 +2174,7 @@ -######## THXC.ACU505 ######## +######## 10 THXC.ACU505 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU505.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2187,7 +2187,7 @@ -######## THXC.ACU506 ######## +######## 11 THXC.ACU506 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU506.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2200,7 +2200,7 @@ -######## THXC.ACU507 ######## +######## 12 THXC.ACU507 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU507.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2213,7 +2213,7 @@ -######## THXC.ACU601 ######## +######## 13 THXC.ACU601 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU601.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2226,7 +2226,7 @@ -######## THXC.ACU602 ######## +######## 14 THXC.ACU602 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU602.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2239,7 +2239,7 @@ -######## THXC.ACU603 ######## +######## 15 THXC.ACU603 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU603.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2252,7 +2252,7 @@ -######## THXC.ACU604 ######## +######## 16 THXC.ACU604 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU604.WSYQ.COUNT = 6 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2265,7 +2265,7 @@ -######## THXC.ACUS03 ######## +######## 17 THXC.ACUS03 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACUS03.WSYQ.COUNT = 2 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2278,7 +2278,7 @@ -######## THXC.ACUS05 ######## +######## 18 THXC.ACUS05 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACUS05.WSYQ.COUNT = 2 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2291,7 +2291,7 @@ -######## THXC.ACUS06 ######## +######## 19 THXC.ACUS06 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACUS06.WSYQ.COUNT = 2 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2304,6 +2304,103 @@ +######## \u4E8C\u671F\u56DB\u6807\u6BB5 ######## +######## 01 THXC.ACU107 ######## + + +######## 02 THXC.ACU108 ######## + + +######## 03 THXC.ACU109 ######## + + +######## 04 THXC.ACU110 ######## + + +######## 05 THXC.ACU306 ######## + + +######## 06 THXC.ACU307 ######## + + +######## 07 THXC.ACU308 ######## + + +######## 08 THXC.ACU309 ######## + + +######## 09 THXC.ACU401 ######## + + +######## 10 THXC.ACU402 ######## + + +######## 11 THXC.ACU403 ######## + + +######## 12 THXC.ACU404 ######## + + +######## 13 THXC.ACU405 ######## + + +######## 14 THXC.ACU406 ######## + + +######## 15 THXC.ACU407 ######## + + +######## 16 THXC.ACU408 ######## + + +######## 17 THXC.ACUS04 ######## + + +######## 18 THXC.ACU701 ######## + + +######## 19 THXC.ACU702 ######## + + +######## 20 THXC.ACU703 ######## + + +######## 21 THXC.ACU704 ######## + + +######## 22 THXC.ACU705 ######## + + +######## 23 THXC.ACU706 ######## + + +######## 24 THXC.ACU801 ######## + + +######## 25 THXC.ACU802 ######## + + +######## 26 THXC.ACU803 ######## + + +######## 27 THXC.ACU804 ######## + + +######## 28 THXC.ACU805 ######## + + +######## 29 THXC.ACU806 ######## + + +######## 30 THXC.ACU807 ######## + + +######## 31 THXC.ACUS07 ######## + + +######## 32 THXC.ACUS08 ######## + + ######## \u9F99\u7FD4\u8DEF\u71C3\u6C14\u6BB5 THXC.ACU801 ######## #\u98CE\u673A\u6570\u91CF THXC.ACU801.FJ.COUNT = 1 diff --git a/src/com/szpg/db/dao/impl/PgAcuCmdDaoImpl.java b/src/com/szpg/db/dao/impl/PgAcuCmdDaoImpl.java index b752a9c..406d9ee 100644 --- a/src/com/szpg/db/dao/impl/PgAcuCmdDaoImpl.java +++ b/src/com/szpg/db/dao/impl/PgAcuCmdDaoImpl.java @@ -154,13 +154,14 @@ Connection conn = null; String insertStr = "INSERT INTO PG_ACU_CMD " + - "(ID, TM, CMD_TYPE, DEST_ACU_CODE, TIMEOUT) " + - "VALUES (?, TO_DATE(?, 'YYYYMMDDHH24MISS'), ?, ?, '0')"; - Object[] params = new Object[4]; + "(ID, TM, CMD_TYPE, DEST_ACU_CODE, TIMEOUT, DEVICE_CODE) " + + "VALUES (?, TO_DATE(?, 'YYYYMMDDHH24MISS'), ?, ?, '0', ?)"; + Object[] params = new Object[5]; params[0] = cmd.getId(); params[1] = TimeFormat.format(cmd.getTm(), "yyyyMMddHHmmss"); params[2] = cmd.getCmd_type(); params[3] = cmd.getDest_acu_code(); + params[4] = cmd.getDevice_code(); try { conn = ConnectionManager.getConnectionFromC3P0(); diff --git a/src/com/szpg/db/data/PgAcuCmd.java b/src/com/szpg/db/data/PgAcuCmd.java index 9e57628..0f3cabc 100644 --- a/src/com/szpg/db/data/PgAcuCmd.java +++ b/src/com/szpg/db/data/PgAcuCmd.java @@ -23,6 +23,7 @@ private Date tm; // 命令发送时间 private String cmd_type; // 命令类型 private String dest_acu_code; // 目标ACU代码 + private String device_code; // 命令的资产编号 private boolean timeout; // 是否超时 public PgAcuCmd() { @@ -62,6 +63,14 @@ this.dest_acu_code = dest_acu_code; } + public String getDevice_code() { + return device_code; + } + + public void setDevice_code(String device_code) { + this.device_code = device_code; + } + public boolean isTimeout() { return timeout; } diff --git a/src/com/szpg/plc/PGDSCServlet.java b/src/com/szpg/plc/PGDSCServlet.java index 5653eb6..881c2e3 100644 --- a/src/com/szpg/plc/PGDSCServlet.java +++ b/src/com/szpg/plc/PGDSCServlet.java @@ -104,13 +104,13 @@ sendQueryJGStatusCommand(); //10巡检数据同步 - synchAssetInSpection(); +// synchAssetInSpection(); //运维数据同步 - synchMaintanceRecord(); +// synchMaintanceRecord(); // 查询二期温湿度氧气实时数据 - sendQueryWSYQValueCommand(); +// sendQueryWSYQValueCommand(); } /** diff --git a/src/com/szpg/plc/message/command/write/SetJgLockBitCommand.java b/src/com/szpg/plc/message/command/write/SetJgLockBitCommand.java new file mode 100644 index 0000000..f4bc55a --- /dev/null +++ b/src/com/szpg/plc/message/command/write/SetJgLockBitCommand.java @@ -0,0 +1,40 @@ +package com.szpg.plc.message.command.write; + +import com.szpg.plc.message.AppMessageConstants; +import com.szpg.plc.message.command.WriteMemoryCommand; +import com.szpg.plc.message.response.WriteMemoryCommandResponse; + +public class SetJgLockBitCommand extends WriteMemoryCommand { + + /** + * + */ + private static final long serialVersionUID = 935723353287421429L; + + public final static int JG_LOCK = 0; //井盖锁定 + + private int unlock; + + public int getUnlock() { + return unlock; + } + + public void setUnlock(int unlock) { + this.unlock = unlock; + } + + @Override + public String getCommandType() { + return AppMessageConstants.CMD_TYPE_SETJGLOCK; + } + + @Override + public Class getResponseClass() { + return WriteMemoryCommandResponse.class; + } + + @Override + public String toString() { + return "向终端[" + getDestinationId() + "]发送设置井盖锁定命令"; + } +} diff --git a/src/com/szpg/plc/message/command/write/SetJgOffBitCommand.java b/src/com/szpg/plc/message/command/write/SetJgOffBitCommand.java new file mode 100644 index 0000000..185804c --- /dev/null +++ b/src/com/szpg/plc/message/command/write/SetJgOffBitCommand.java @@ -0,0 +1,41 @@ +package com.szpg.plc.message.command.write; + +import com.szpg.plc.message.AppMessageConstants; +import com.szpg.plc.message.command.WriteMemoryCommand; +import com.szpg.plc.message.response.WriteMemoryCommandResponse; + +public class SetJgOffBitCommand extends WriteMemoryCommand { + + /** + * + */ + private static final long serialVersionUID = 935723353287421429L; + + public final static int JG_OFF_ENABLE = 1; // 井盖关闭 + public final static int JG_OFF_DISABLE = 0; // 井盖关闭复位 + + private int jgoff; + + public int getJgoff() { + return jgoff; + } + + public void setJgoff(int jgoff) { + this.jgoff = jgoff; + } + + @Override + public String getCommandType() { + return AppMessageConstants.CMD_TYPE_SETJGOFF; + } + + @Override + public Class getResponseClass() { + return WriteMemoryCommandResponse.class; + } + + @Override + public String toString() { + return "向终端[" + getDestinationId() + "]发送设置井盖关闭位命令[" + jgoff + "]"; + } +} diff --git a/src/com/szpg/plc/message/command/write/SetJgOnBitCommand.java b/src/com/szpg/plc/message/command/write/SetJgOnBitCommand.java new file mode 100644 index 0000000..b63cf19 --- /dev/null +++ b/src/com/szpg/plc/message/command/write/SetJgOnBitCommand.java @@ -0,0 +1,41 @@ +package com.szpg.plc.message.command.write; + +import com.szpg.plc.message.AppMessageConstants; +import com.szpg.plc.message.command.WriteMemoryCommand; +import com.szpg.plc.message.response.WriteMemoryCommandResponse; + +public class SetJgOnBitCommand extends WriteMemoryCommand { + + /** + * + */ + private static final long serialVersionUID = 935723353287421429L; + + public final static int JG_ON_ENABLE = 1; // 井盖打开 + public final static int JG_ON_DISABLE = 0; // 井盖打开复位 + + private int jgon; + + public int getJgon() { + return jgon; + } + + public void setJgon(int jgon) { + this.jgon = jgon; + } + + @Override + public String getCommandType() { + return AppMessageConstants.CMD_TYPE_SETJGON; + } + + @Override + public Class getResponseClass() { + return WriteMemoryCommandResponse.class; + } + + @Override + public String toString() { + return "向终端[" + getDestinationId() + "]发送设置井盖开启位命令[" + jgon + "]"; + } +} diff --git a/src/com/szpg/plc/message/command/write/SetJgUnlockBitCommand.java b/src/com/szpg/plc/message/command/write/SetJgUnlockBitCommand.java index e3898b4..cfe7a6b 100644 --- a/src/com/szpg/plc/message/command/write/SetJgUnlockBitCommand.java +++ b/src/com/szpg/plc/message/command/write/SetJgUnlockBitCommand.java @@ -10,8 +10,7 @@ * */ private static final long serialVersionUID = 935723353287421429L; - - public final static int JG_LOCK = 0; //井盖锁定 + public final static int JG_UNLOCK = 1; //井盖解锁 private int unlock; diff --git a/src/com/szpg/plc/message/response/write/SetJgLockBitCommandResponse.java b/src/com/szpg/plc/message/response/write/SetJgLockBitCommandResponse.java new file mode 100644 index 0000000..adb5f9d --- /dev/null +++ b/src/com/szpg/plc/message/response/write/SetJgLockBitCommandResponse.java @@ -0,0 +1,29 @@ +package com.szpg.plc.message.response.write; + +import com.szpg.db.dao.PgDeviceDao; +import com.szpg.db.dao.PgJgDao; +import com.szpg.db.dao.impl.PgDeviceDaoImpl; +import com.szpg.db.dao.impl.PgJgDaoImpl; +import com.szpg.plc.message.response.WriteMemoryCommandResponse; +import org.apache.log4j.Logger; + +public class SetJgLockBitCommandResponse extends WriteMemoryCommandResponse { + + private final Logger logger = Logger.getLogger(this.getClass().getName()); + + private PgJgDao jgDao = new PgJgDaoImpl(); + private PgDeviceDao deviceDao = new PgDeviceDaoImpl(); + + @Override + public void afterAction() { + if (this.isSuccess() == true) { + // 更新设备状态 锁定 + int deviceId = deviceDao.findDeviceIdByCode(this.getDestinationId()); + if (deviceId > 0) { + jgDao.updateDeviceStatus(deviceId, "0"); + } + + logger.info("[" + this.getAcucode() + "]锁定井盖成功"); + } + } +} diff --git a/src/com/szpg/plc/message/response/write/SetJgOffBitCommandResponse.java b/src/com/szpg/plc/message/response/write/SetJgOffBitCommandResponse.java new file mode 100644 index 0000000..f10831c --- /dev/null +++ b/src/com/szpg/plc/message/response/write/SetJgOffBitCommandResponse.java @@ -0,0 +1,29 @@ +package com.szpg.plc.message.response.write; + +import com.szpg.db.dao.PgDeviceDao; +import com.szpg.db.dao.PgJgDao; +import com.szpg.db.dao.impl.PgDeviceDaoImpl; +import com.szpg.db.dao.impl.PgJgDaoImpl; +import com.szpg.plc.message.response.WriteMemoryCommandResponse; +import org.apache.log4j.Logger; + +public class SetJgOffBitCommandResponse extends WriteMemoryCommandResponse { + + private final Logger logger = Logger.getLogger(this.getClass().getName()); + + private PgJgDao jgDao = new PgJgDaoImpl(); + private PgDeviceDao deviceDao = new PgDeviceDaoImpl(); + + @Override + public void afterAction() { + if (this.isSuccess() == true) { + // 更新设备状态 关 + int deviceId = deviceDao.findDeviceIdByCode(this.getDestinationId()); + if (deviceId > 0) { + jgDao.updateDeviceStatus(deviceId, "0"); + } + + logger.info("[" + this.getAcucode() + "]关闭井盖成功"); + } + } +} diff --git a/src/com/szpg/plc/message/response/write/SetJgOnBitCommandResponse.java b/src/com/szpg/plc/message/response/write/SetJgOnBitCommandResponse.java new file mode 100644 index 0000000..35eb98c --- /dev/null +++ b/src/com/szpg/plc/message/response/write/SetJgOnBitCommandResponse.java @@ -0,0 +1,29 @@ +package com.szpg.plc.message.response.write; + +import com.szpg.db.dao.PgDeviceDao; +import com.szpg.db.dao.PgJgDao; +import com.szpg.db.dao.impl.PgDeviceDaoImpl; +import com.szpg.db.dao.impl.PgJgDaoImpl; +import com.szpg.plc.message.response.WriteMemoryCommandResponse; +import org.apache.log4j.Logger; + +public class SetJgOnBitCommandResponse extends WriteMemoryCommandResponse { + + private final Logger logger = Logger.getLogger(this.getClass().getName()); + + private PgJgDao jgDao = new PgJgDaoImpl(); + private PgDeviceDao deviceDao = new PgDeviceDaoImpl(); + + @Override + public void afterAction() { + if (this.isSuccess() == true) { + // 更新设备状态 开 + int deviceId = deviceDao.findDeviceIdByCode(this.getDestinationId()); + if (deviceId > 0) { + jgDao.updateDeviceStatus(deviceId, "1"); + } + + logger.info("[" + this.getAcucode() + "]打开井盖成功"); + } + } +} diff --git a/src/com/szpg/plc/message/response/write/SetJgUnlockBitCommandResponse.java b/src/com/szpg/plc/message/response/write/SetJgUnlockBitCommandResponse.java new file mode 100644 index 0000000..1575f09 --- /dev/null +++ b/src/com/szpg/plc/message/response/write/SetJgUnlockBitCommandResponse.java @@ -0,0 +1,30 @@ +package com.szpg.plc.message.response.write; + +import com.szpg.db.dao.PgDeviceDao; +import com.szpg.db.dao.PgJgDao; +import com.szpg.db.dao.impl.PgDeviceDaoImpl; +import com.szpg.db.dao.impl.PgJgDaoImpl; +import com.szpg.plc.message.command.write.SetJgUnlockBitCommand; +import com.szpg.plc.message.response.WriteMemoryCommandResponse; +import org.apache.log4j.Logger; + +public class SetJgUnlockBitCommandResponse extends WriteMemoryCommandResponse { + + private final Logger logger = Logger.getLogger(this.getClass().getName()); + + private PgJgDao jgDao = new PgJgDaoImpl(); + private PgDeviceDao deviceDao = new PgDeviceDaoImpl(); + + @Override + public void afterAction() { + if (this.isSuccess() == true) { + // 更新设备状态 解锁 + int deviceId = deviceDao.findDeviceIdByCode(this.getDestinationId()); + if (deviceId > 0) { + jgDao.updateDeviceStatus(deviceId, "1"); + } + + logger.info("[" + this.getAcucode() + "]解锁井盖成功"); + } + } +} diff --git a/src/ACUBL.properties b/src/ACUBL.properties index 9c4b0ab..df9ffdb 100644 --- a/src/ACUBL.properties +++ b/src/ACUBL.properties @@ -1,6 +1,6 @@ #ACU\u53D8\u91CF\u8868\u914D\u7F6E\u6587\u4EF6 -######## THXC.ACU001 ######## +######## 01 HXC.ACU001 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU001.CH.COUNT = 6 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -144,7 +144,7 @@ -######## THXC.ACU002 ######## +######## 02 THXC.ACU002 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU002.CH.COUNT = 6 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -288,7 +288,7 @@ -######## THXC.ACU003 ######## +######## 03 THXC.ACU003 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU003.CH.COUNT = 6 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -432,7 +432,7 @@ -######## THXC.ACU004 ######## +######## 04 THXC.ACU004 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU004.CH.COUNT = 6 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -576,7 +576,7 @@ -######## THXC.ACU005 ######## +######## 05 THXC.ACU005 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU005.CH.COUNT = 6 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -720,7 +720,7 @@ -######## THXC.ACU006 ######## +######## 06 THXC.ACU006 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU006.CH.COUNT = 6 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -812,7 +812,7 @@ #\u98CE\u673A\u6570\u91CF -THXC.ACU006.FJ.COUNT = 9 +THXC.ACU006.FJ.COUNT = 6 #\u98CE\u673A\u7F16\u7801\u5217\u8868 THXC.ACU006.FJ.ZC.LIST = THXC.ACU006.F.DFJ01;THXC.ACU006.F.DFJ02;THXC.ACU006.F.SFJ01;THXC.ACU006.F.SFJ02;THXC.ACU006.F.RFJ01;THXC.ACU006.F.RFJ02 #\u98CE\u673A\u72B6\u6001\u8D77\u59CB\u5730\u5740 @@ -864,7 +864,7 @@ -######## THXC.ACU008 ######## +######## 07 THXC.ACU008 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU008.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -1008,7 +1008,7 @@ -######## THXC.ACU009 ######## +######## 08 THXC.ACU009 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU009.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -1152,7 +1152,7 @@ -######## THXC.ACU010 ######## +######## 09 THXC.ACU010 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU010.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -1296,7 +1296,7 @@ -######## THXC.ACU011 ######## +######## 10 THXC.ACU011 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU011.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -1440,7 +1440,7 @@ -######## THXC.ACU013 ######## +######## 11 THXC.ACU013 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU013.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -1584,7 +1584,7 @@ -######## THXC.ACU014 ######## +######## 12 THXC.ACU014 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU014.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -1729,7 +1729,7 @@ -######## THXC.ACU015 ######## +######## 13 THXC.ACU015 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU015.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -1874,7 +1874,7 @@ -######## THXC.ACU016 ######## +######## 14 THXC.ACU016 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU016.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2020,7 +2020,7 @@ ######## \u4E8C\u671F\u4E09\u6807\u6BB5 ######## -######## THXC.ACU301 ######## +######## 01 THXC.ACU301 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU301.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2070,7 +2070,7 @@ -######## THXC.ACU302 ######## +######## 02 THXC.ACU302 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU302.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2083,7 +2083,7 @@ -######## THXC.ACU303 ######## +######## 03 THXC.ACU303 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU303.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2096,7 +2096,7 @@ -######## THXC.ACU304 ######## +######## 04 THXC.ACU304 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU304.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2109,7 +2109,7 @@ -######## THXC.ACU305 ######## +######## 05 THXC.ACU305 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU305.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2122,7 +2122,7 @@ -######## THXC.ACU501 ######## +######## 06 THXC.ACU501 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU501.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2135,7 +2135,7 @@ -######## THXC.ACU502 ######## +######## 07 THXC.ACU502 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU502.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2148,7 +2148,7 @@ -######## THXC.ACU503 ######## +######## 08 THXC.ACU503 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU503.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2161,7 +2161,7 @@ -######## THXC.ACU504 ######## +######## 09 THXC.ACU504 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU504.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2174,7 +2174,7 @@ -######## THXC.ACU505 ######## +######## 10 THXC.ACU505 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU505.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2187,7 +2187,7 @@ -######## THXC.ACU506 ######## +######## 11 THXC.ACU506 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU506.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2200,7 +2200,7 @@ -######## THXC.ACU507 ######## +######## 12 THXC.ACU507 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU507.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2213,7 +2213,7 @@ -######## THXC.ACU601 ######## +######## 13 THXC.ACU601 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU601.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2226,7 +2226,7 @@ -######## THXC.ACU602 ######## +######## 14 THXC.ACU602 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU602.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2239,7 +2239,7 @@ -######## THXC.ACU603 ######## +######## 15 THXC.ACU603 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU603.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2252,7 +2252,7 @@ -######## THXC.ACU604 ######## +######## 16 THXC.ACU604 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU604.WSYQ.COUNT = 6 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2265,7 +2265,7 @@ -######## THXC.ACUS03 ######## +######## 17 THXC.ACUS03 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACUS03.WSYQ.COUNT = 2 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2278,7 +2278,7 @@ -######## THXC.ACUS05 ######## +######## 18 THXC.ACUS05 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACUS05.WSYQ.COUNT = 2 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2291,7 +2291,7 @@ -######## THXC.ACUS06 ######## +######## 19 THXC.ACUS06 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACUS06.WSYQ.COUNT = 2 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2304,6 +2304,103 @@ +######## \u4E8C\u671F\u56DB\u6807\u6BB5 ######## +######## 01 THXC.ACU107 ######## + + +######## 02 THXC.ACU108 ######## + + +######## 03 THXC.ACU109 ######## + + +######## 04 THXC.ACU110 ######## + + +######## 05 THXC.ACU306 ######## + + +######## 06 THXC.ACU307 ######## + + +######## 07 THXC.ACU308 ######## + + +######## 08 THXC.ACU309 ######## + + +######## 09 THXC.ACU401 ######## + + +######## 10 THXC.ACU402 ######## + + +######## 11 THXC.ACU403 ######## + + +######## 12 THXC.ACU404 ######## + + +######## 13 THXC.ACU405 ######## + + +######## 14 THXC.ACU406 ######## + + +######## 15 THXC.ACU407 ######## + + +######## 16 THXC.ACU408 ######## + + +######## 17 THXC.ACUS04 ######## + + +######## 18 THXC.ACU701 ######## + + +######## 19 THXC.ACU702 ######## + + +######## 20 THXC.ACU703 ######## + + +######## 21 THXC.ACU704 ######## + + +######## 22 THXC.ACU705 ######## + + +######## 23 THXC.ACU706 ######## + + +######## 24 THXC.ACU801 ######## + + +######## 25 THXC.ACU802 ######## + + +######## 26 THXC.ACU803 ######## + + +######## 27 THXC.ACU804 ######## + + +######## 28 THXC.ACU805 ######## + + +######## 29 THXC.ACU806 ######## + + +######## 30 THXC.ACU807 ######## + + +######## 31 THXC.ACUS07 ######## + + +######## 32 THXC.ACUS08 ######## + + ######## \u9F99\u7FD4\u8DEF\u71C3\u6C14\u6BB5 THXC.ACU801 ######## #\u98CE\u673A\u6570\u91CF THXC.ACU801.FJ.COUNT = 1 diff --git a/src/com/szpg/db/dao/impl/PgAcuCmdDaoImpl.java b/src/com/szpg/db/dao/impl/PgAcuCmdDaoImpl.java index b752a9c..406d9ee 100644 --- a/src/com/szpg/db/dao/impl/PgAcuCmdDaoImpl.java +++ b/src/com/szpg/db/dao/impl/PgAcuCmdDaoImpl.java @@ -154,13 +154,14 @@ Connection conn = null; String insertStr = "INSERT INTO PG_ACU_CMD " + - "(ID, TM, CMD_TYPE, DEST_ACU_CODE, TIMEOUT) " + - "VALUES (?, TO_DATE(?, 'YYYYMMDDHH24MISS'), ?, ?, '0')"; - Object[] params = new Object[4]; + "(ID, TM, CMD_TYPE, DEST_ACU_CODE, TIMEOUT, DEVICE_CODE) " + + "VALUES (?, TO_DATE(?, 'YYYYMMDDHH24MISS'), ?, ?, '0', ?)"; + Object[] params = new Object[5]; params[0] = cmd.getId(); params[1] = TimeFormat.format(cmd.getTm(), "yyyyMMddHHmmss"); params[2] = cmd.getCmd_type(); params[3] = cmd.getDest_acu_code(); + params[4] = cmd.getDevice_code(); try { conn = ConnectionManager.getConnectionFromC3P0(); diff --git a/src/com/szpg/db/data/PgAcuCmd.java b/src/com/szpg/db/data/PgAcuCmd.java index 9e57628..0f3cabc 100644 --- a/src/com/szpg/db/data/PgAcuCmd.java +++ b/src/com/szpg/db/data/PgAcuCmd.java @@ -23,6 +23,7 @@ private Date tm; // 命令发送时间 private String cmd_type; // 命令类型 private String dest_acu_code; // 目标ACU代码 + private String device_code; // 命令的资产编号 private boolean timeout; // 是否超时 public PgAcuCmd() { @@ -62,6 +63,14 @@ this.dest_acu_code = dest_acu_code; } + public String getDevice_code() { + return device_code; + } + + public void setDevice_code(String device_code) { + this.device_code = device_code; + } + public boolean isTimeout() { return timeout; } diff --git a/src/com/szpg/plc/PGDSCServlet.java b/src/com/szpg/plc/PGDSCServlet.java index 5653eb6..881c2e3 100644 --- a/src/com/szpg/plc/PGDSCServlet.java +++ b/src/com/szpg/plc/PGDSCServlet.java @@ -104,13 +104,13 @@ sendQueryJGStatusCommand(); //10巡检数据同步 - synchAssetInSpection(); +// synchAssetInSpection(); //运维数据同步 - synchMaintanceRecord(); +// synchMaintanceRecord(); // 查询二期温湿度氧气实时数据 - sendQueryWSYQValueCommand(); +// sendQueryWSYQValueCommand(); } /** diff --git a/src/com/szpg/plc/message/command/write/SetJgLockBitCommand.java b/src/com/szpg/plc/message/command/write/SetJgLockBitCommand.java new file mode 100644 index 0000000..f4bc55a --- /dev/null +++ b/src/com/szpg/plc/message/command/write/SetJgLockBitCommand.java @@ -0,0 +1,40 @@ +package com.szpg.plc.message.command.write; + +import com.szpg.plc.message.AppMessageConstants; +import com.szpg.plc.message.command.WriteMemoryCommand; +import com.szpg.plc.message.response.WriteMemoryCommandResponse; + +public class SetJgLockBitCommand extends WriteMemoryCommand { + + /** + * + */ + private static final long serialVersionUID = 935723353287421429L; + + public final static int JG_LOCK = 0; //井盖锁定 + + private int unlock; + + public int getUnlock() { + return unlock; + } + + public void setUnlock(int unlock) { + this.unlock = unlock; + } + + @Override + public String getCommandType() { + return AppMessageConstants.CMD_TYPE_SETJGLOCK; + } + + @Override + public Class getResponseClass() { + return WriteMemoryCommandResponse.class; + } + + @Override + public String toString() { + return "向终端[" + getDestinationId() + "]发送设置井盖锁定命令"; + } +} diff --git a/src/com/szpg/plc/message/command/write/SetJgOffBitCommand.java b/src/com/szpg/plc/message/command/write/SetJgOffBitCommand.java new file mode 100644 index 0000000..185804c --- /dev/null +++ b/src/com/szpg/plc/message/command/write/SetJgOffBitCommand.java @@ -0,0 +1,41 @@ +package com.szpg.plc.message.command.write; + +import com.szpg.plc.message.AppMessageConstants; +import com.szpg.plc.message.command.WriteMemoryCommand; +import com.szpg.plc.message.response.WriteMemoryCommandResponse; + +public class SetJgOffBitCommand extends WriteMemoryCommand { + + /** + * + */ + private static final long serialVersionUID = 935723353287421429L; + + public final static int JG_OFF_ENABLE = 1; // 井盖关闭 + public final static int JG_OFF_DISABLE = 0; // 井盖关闭复位 + + private int jgoff; + + public int getJgoff() { + return jgoff; + } + + public void setJgoff(int jgoff) { + this.jgoff = jgoff; + } + + @Override + public String getCommandType() { + return AppMessageConstants.CMD_TYPE_SETJGOFF; + } + + @Override + public Class getResponseClass() { + return WriteMemoryCommandResponse.class; + } + + @Override + public String toString() { + return "向终端[" + getDestinationId() + "]发送设置井盖关闭位命令[" + jgoff + "]"; + } +} diff --git a/src/com/szpg/plc/message/command/write/SetJgOnBitCommand.java b/src/com/szpg/plc/message/command/write/SetJgOnBitCommand.java new file mode 100644 index 0000000..b63cf19 --- /dev/null +++ b/src/com/szpg/plc/message/command/write/SetJgOnBitCommand.java @@ -0,0 +1,41 @@ +package com.szpg.plc.message.command.write; + +import com.szpg.plc.message.AppMessageConstants; +import com.szpg.plc.message.command.WriteMemoryCommand; +import com.szpg.plc.message.response.WriteMemoryCommandResponse; + +public class SetJgOnBitCommand extends WriteMemoryCommand { + + /** + * + */ + private static final long serialVersionUID = 935723353287421429L; + + public final static int JG_ON_ENABLE = 1; // 井盖打开 + public final static int JG_ON_DISABLE = 0; // 井盖打开复位 + + private int jgon; + + public int getJgon() { + return jgon; + } + + public void setJgon(int jgon) { + this.jgon = jgon; + } + + @Override + public String getCommandType() { + return AppMessageConstants.CMD_TYPE_SETJGON; + } + + @Override + public Class getResponseClass() { + return WriteMemoryCommandResponse.class; + } + + @Override + public String toString() { + return "向终端[" + getDestinationId() + "]发送设置井盖开启位命令[" + jgon + "]"; + } +} diff --git a/src/com/szpg/plc/message/command/write/SetJgUnlockBitCommand.java b/src/com/szpg/plc/message/command/write/SetJgUnlockBitCommand.java index e3898b4..cfe7a6b 100644 --- a/src/com/szpg/plc/message/command/write/SetJgUnlockBitCommand.java +++ b/src/com/szpg/plc/message/command/write/SetJgUnlockBitCommand.java @@ -10,8 +10,7 @@ * */ private static final long serialVersionUID = 935723353287421429L; - - public final static int JG_LOCK = 0; //井盖锁定 + public final static int JG_UNLOCK = 1; //井盖解锁 private int unlock; diff --git a/src/com/szpg/plc/message/response/write/SetJgLockBitCommandResponse.java b/src/com/szpg/plc/message/response/write/SetJgLockBitCommandResponse.java new file mode 100644 index 0000000..adb5f9d --- /dev/null +++ b/src/com/szpg/plc/message/response/write/SetJgLockBitCommandResponse.java @@ -0,0 +1,29 @@ +package com.szpg.plc.message.response.write; + +import com.szpg.db.dao.PgDeviceDao; +import com.szpg.db.dao.PgJgDao; +import com.szpg.db.dao.impl.PgDeviceDaoImpl; +import com.szpg.db.dao.impl.PgJgDaoImpl; +import com.szpg.plc.message.response.WriteMemoryCommandResponse; +import org.apache.log4j.Logger; + +public class SetJgLockBitCommandResponse extends WriteMemoryCommandResponse { + + private final Logger logger = Logger.getLogger(this.getClass().getName()); + + private PgJgDao jgDao = new PgJgDaoImpl(); + private PgDeviceDao deviceDao = new PgDeviceDaoImpl(); + + @Override + public void afterAction() { + if (this.isSuccess() == true) { + // 更新设备状态 锁定 + int deviceId = deviceDao.findDeviceIdByCode(this.getDestinationId()); + if (deviceId > 0) { + jgDao.updateDeviceStatus(deviceId, "0"); + } + + logger.info("[" + this.getAcucode() + "]锁定井盖成功"); + } + } +} diff --git a/src/com/szpg/plc/message/response/write/SetJgOffBitCommandResponse.java b/src/com/szpg/plc/message/response/write/SetJgOffBitCommandResponse.java new file mode 100644 index 0000000..f10831c --- /dev/null +++ b/src/com/szpg/plc/message/response/write/SetJgOffBitCommandResponse.java @@ -0,0 +1,29 @@ +package com.szpg.plc.message.response.write; + +import com.szpg.db.dao.PgDeviceDao; +import com.szpg.db.dao.PgJgDao; +import com.szpg.db.dao.impl.PgDeviceDaoImpl; +import com.szpg.db.dao.impl.PgJgDaoImpl; +import com.szpg.plc.message.response.WriteMemoryCommandResponse; +import org.apache.log4j.Logger; + +public class SetJgOffBitCommandResponse extends WriteMemoryCommandResponse { + + private final Logger logger = Logger.getLogger(this.getClass().getName()); + + private PgJgDao jgDao = new PgJgDaoImpl(); + private PgDeviceDao deviceDao = new PgDeviceDaoImpl(); + + @Override + public void afterAction() { + if (this.isSuccess() == true) { + // 更新设备状态 关 + int deviceId = deviceDao.findDeviceIdByCode(this.getDestinationId()); + if (deviceId > 0) { + jgDao.updateDeviceStatus(deviceId, "0"); + } + + logger.info("[" + this.getAcucode() + "]关闭井盖成功"); + } + } +} diff --git a/src/com/szpg/plc/message/response/write/SetJgOnBitCommandResponse.java b/src/com/szpg/plc/message/response/write/SetJgOnBitCommandResponse.java new file mode 100644 index 0000000..35eb98c --- /dev/null +++ b/src/com/szpg/plc/message/response/write/SetJgOnBitCommandResponse.java @@ -0,0 +1,29 @@ +package com.szpg.plc.message.response.write; + +import com.szpg.db.dao.PgDeviceDao; +import com.szpg.db.dao.PgJgDao; +import com.szpg.db.dao.impl.PgDeviceDaoImpl; +import com.szpg.db.dao.impl.PgJgDaoImpl; +import com.szpg.plc.message.response.WriteMemoryCommandResponse; +import org.apache.log4j.Logger; + +public class SetJgOnBitCommandResponse extends WriteMemoryCommandResponse { + + private final Logger logger = Logger.getLogger(this.getClass().getName()); + + private PgJgDao jgDao = new PgJgDaoImpl(); + private PgDeviceDao deviceDao = new PgDeviceDaoImpl(); + + @Override + public void afterAction() { + if (this.isSuccess() == true) { + // 更新设备状态 开 + int deviceId = deviceDao.findDeviceIdByCode(this.getDestinationId()); + if (deviceId > 0) { + jgDao.updateDeviceStatus(deviceId, "1"); + } + + logger.info("[" + this.getAcucode() + "]打开井盖成功"); + } + } +} diff --git a/src/com/szpg/plc/message/response/write/SetJgUnlockBitCommandResponse.java b/src/com/szpg/plc/message/response/write/SetJgUnlockBitCommandResponse.java new file mode 100644 index 0000000..1575f09 --- /dev/null +++ b/src/com/szpg/plc/message/response/write/SetJgUnlockBitCommandResponse.java @@ -0,0 +1,30 @@ +package com.szpg.plc.message.response.write; + +import com.szpg.db.dao.PgDeviceDao; +import com.szpg.db.dao.PgJgDao; +import com.szpg.db.dao.impl.PgDeviceDaoImpl; +import com.szpg.db.dao.impl.PgJgDaoImpl; +import com.szpg.plc.message.command.write.SetJgUnlockBitCommand; +import com.szpg.plc.message.response.WriteMemoryCommandResponse; +import org.apache.log4j.Logger; + +public class SetJgUnlockBitCommandResponse extends WriteMemoryCommandResponse { + + private final Logger logger = Logger.getLogger(this.getClass().getName()); + + private PgJgDao jgDao = new PgJgDaoImpl(); + private PgDeviceDao deviceDao = new PgDeviceDaoImpl(); + + @Override + public void afterAction() { + if (this.isSuccess() == true) { + // 更新设备状态 解锁 + int deviceId = deviceDao.findDeviceIdByCode(this.getDestinationId()); + if (deviceId > 0) { + jgDao.updateDeviceStatus(deviceId, "1"); + } + + logger.info("[" + this.getAcucode() + "]解锁井盖成功"); + } + } +} diff --git a/src/com/szpg/plc/message/response/write/SetZmOffBitCommandResponse.java b/src/com/szpg/plc/message/response/write/SetZmOffBitCommandResponse.java new file mode 100644 index 0000000..bd36ece --- /dev/null +++ b/src/com/szpg/plc/message/response/write/SetZmOffBitCommandResponse.java @@ -0,0 +1,29 @@ +package com.szpg.plc.message.response.write; + +import com.szpg.db.dao.PgDeviceDao; +import com.szpg.db.dao.PgJgDao; +import com.szpg.db.dao.impl.PgDeviceDaoImpl; +import com.szpg.db.dao.impl.PgJgDaoImpl; +import com.szpg.plc.message.response.WriteMemoryCommandResponse; +import org.apache.log4j.Logger; + +public class SetZmOffBitCommandResponse extends WriteMemoryCommandResponse { + + private final Logger logger = Logger.getLogger(this.getClass().getName()); + + private PgJgDao jgDao = new PgJgDaoImpl(); + private PgDeviceDao deviceDao = new PgDeviceDaoImpl(); + + @Override + public void afterAction() { + if (this.isSuccess() == true) { + // 更新设备状态 关 + int deviceId = deviceDao.findDeviceIdByCode(this.getDestinationId()); + if (deviceId > 0) { + jgDao.updateDeviceStatus(deviceId, "0"); + } + + logger.info("[" + this.getAcucode() + "]关闭照明成功"); + } + } +} diff --git a/src/ACUBL.properties b/src/ACUBL.properties index 9c4b0ab..df9ffdb 100644 --- a/src/ACUBL.properties +++ b/src/ACUBL.properties @@ -1,6 +1,6 @@ #ACU\u53D8\u91CF\u8868\u914D\u7F6E\u6587\u4EF6 -######## THXC.ACU001 ######## +######## 01 HXC.ACU001 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU001.CH.COUNT = 6 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -144,7 +144,7 @@ -######## THXC.ACU002 ######## +######## 02 THXC.ACU002 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU002.CH.COUNT = 6 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -288,7 +288,7 @@ -######## THXC.ACU003 ######## +######## 03 THXC.ACU003 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU003.CH.COUNT = 6 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -432,7 +432,7 @@ -######## THXC.ACU004 ######## +######## 04 THXC.ACU004 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU004.CH.COUNT = 6 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -576,7 +576,7 @@ -######## THXC.ACU005 ######## +######## 05 THXC.ACU005 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU005.CH.COUNT = 6 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -720,7 +720,7 @@ -######## THXC.ACU006 ######## +######## 06 THXC.ACU006 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU006.CH.COUNT = 6 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -812,7 +812,7 @@ #\u98CE\u673A\u6570\u91CF -THXC.ACU006.FJ.COUNT = 9 +THXC.ACU006.FJ.COUNT = 6 #\u98CE\u673A\u7F16\u7801\u5217\u8868 THXC.ACU006.FJ.ZC.LIST = THXC.ACU006.F.DFJ01;THXC.ACU006.F.DFJ02;THXC.ACU006.F.SFJ01;THXC.ACU006.F.SFJ02;THXC.ACU006.F.RFJ01;THXC.ACU006.F.RFJ02 #\u98CE\u673A\u72B6\u6001\u8D77\u59CB\u5730\u5740 @@ -864,7 +864,7 @@ -######## THXC.ACU008 ######## +######## 07 THXC.ACU008 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU008.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -1008,7 +1008,7 @@ -######## THXC.ACU009 ######## +######## 08 THXC.ACU009 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU009.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -1152,7 +1152,7 @@ -######## THXC.ACU010 ######## +######## 09 THXC.ACU010 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU010.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -1296,7 +1296,7 @@ -######## THXC.ACU011 ######## +######## 10 THXC.ACU011 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU011.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -1440,7 +1440,7 @@ -######## THXC.ACU013 ######## +######## 11 THXC.ACU013 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU013.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -1584,7 +1584,7 @@ -######## THXC.ACU014 ######## +######## 12 THXC.ACU014 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU014.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -1729,7 +1729,7 @@ -######## THXC.ACU015 ######## +######## 13 THXC.ACU015 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU015.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -1874,7 +1874,7 @@ -######## THXC.ACU016 ######## +######## 14 THXC.ACU016 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU016.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2020,7 +2020,7 @@ ######## \u4E8C\u671F\u4E09\u6807\u6BB5 ######## -######## THXC.ACU301 ######## +######## 01 THXC.ACU301 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU301.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2070,7 +2070,7 @@ -######## THXC.ACU302 ######## +######## 02 THXC.ACU302 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU302.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2083,7 +2083,7 @@ -######## THXC.ACU303 ######## +######## 03 THXC.ACU303 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU303.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2096,7 +2096,7 @@ -######## THXC.ACU304 ######## +######## 04 THXC.ACU304 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU304.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2109,7 +2109,7 @@ -######## THXC.ACU305 ######## +######## 05 THXC.ACU305 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU305.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2122,7 +2122,7 @@ -######## THXC.ACU501 ######## +######## 06 THXC.ACU501 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU501.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2135,7 +2135,7 @@ -######## THXC.ACU502 ######## +######## 07 THXC.ACU502 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU502.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2148,7 +2148,7 @@ -######## THXC.ACU503 ######## +######## 08 THXC.ACU503 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU503.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2161,7 +2161,7 @@ -######## THXC.ACU504 ######## +######## 09 THXC.ACU504 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU504.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2174,7 +2174,7 @@ -######## THXC.ACU505 ######## +######## 10 THXC.ACU505 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU505.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2187,7 +2187,7 @@ -######## THXC.ACU506 ######## +######## 11 THXC.ACU506 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU506.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2200,7 +2200,7 @@ -######## THXC.ACU507 ######## +######## 12 THXC.ACU507 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU507.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2213,7 +2213,7 @@ -######## THXC.ACU601 ######## +######## 13 THXC.ACU601 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU601.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2226,7 +2226,7 @@ -######## THXC.ACU602 ######## +######## 14 THXC.ACU602 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU602.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2239,7 +2239,7 @@ -######## THXC.ACU603 ######## +######## 15 THXC.ACU603 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU603.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2252,7 +2252,7 @@ -######## THXC.ACU604 ######## +######## 16 THXC.ACU604 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU604.WSYQ.COUNT = 6 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2265,7 +2265,7 @@ -######## THXC.ACUS03 ######## +######## 17 THXC.ACUS03 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACUS03.WSYQ.COUNT = 2 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2278,7 +2278,7 @@ -######## THXC.ACUS05 ######## +######## 18 THXC.ACUS05 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACUS05.WSYQ.COUNT = 2 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2291,7 +2291,7 @@ -######## THXC.ACUS06 ######## +######## 19 THXC.ACUS06 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACUS06.WSYQ.COUNT = 2 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2304,6 +2304,103 @@ +######## \u4E8C\u671F\u56DB\u6807\u6BB5 ######## +######## 01 THXC.ACU107 ######## + + +######## 02 THXC.ACU108 ######## + + +######## 03 THXC.ACU109 ######## + + +######## 04 THXC.ACU110 ######## + + +######## 05 THXC.ACU306 ######## + + +######## 06 THXC.ACU307 ######## + + +######## 07 THXC.ACU308 ######## + + +######## 08 THXC.ACU309 ######## + + +######## 09 THXC.ACU401 ######## + + +######## 10 THXC.ACU402 ######## + + +######## 11 THXC.ACU403 ######## + + +######## 12 THXC.ACU404 ######## + + +######## 13 THXC.ACU405 ######## + + +######## 14 THXC.ACU406 ######## + + +######## 15 THXC.ACU407 ######## + + +######## 16 THXC.ACU408 ######## + + +######## 17 THXC.ACUS04 ######## + + +######## 18 THXC.ACU701 ######## + + +######## 19 THXC.ACU702 ######## + + +######## 20 THXC.ACU703 ######## + + +######## 21 THXC.ACU704 ######## + + +######## 22 THXC.ACU705 ######## + + +######## 23 THXC.ACU706 ######## + + +######## 24 THXC.ACU801 ######## + + +######## 25 THXC.ACU802 ######## + + +######## 26 THXC.ACU803 ######## + + +######## 27 THXC.ACU804 ######## + + +######## 28 THXC.ACU805 ######## + + +######## 29 THXC.ACU806 ######## + + +######## 30 THXC.ACU807 ######## + + +######## 31 THXC.ACUS07 ######## + + +######## 32 THXC.ACUS08 ######## + + ######## \u9F99\u7FD4\u8DEF\u71C3\u6C14\u6BB5 THXC.ACU801 ######## #\u98CE\u673A\u6570\u91CF THXC.ACU801.FJ.COUNT = 1 diff --git a/src/com/szpg/db/dao/impl/PgAcuCmdDaoImpl.java b/src/com/szpg/db/dao/impl/PgAcuCmdDaoImpl.java index b752a9c..406d9ee 100644 --- a/src/com/szpg/db/dao/impl/PgAcuCmdDaoImpl.java +++ b/src/com/szpg/db/dao/impl/PgAcuCmdDaoImpl.java @@ -154,13 +154,14 @@ Connection conn = null; String insertStr = "INSERT INTO PG_ACU_CMD " + - "(ID, TM, CMD_TYPE, DEST_ACU_CODE, TIMEOUT) " + - "VALUES (?, TO_DATE(?, 'YYYYMMDDHH24MISS'), ?, ?, '0')"; - Object[] params = new Object[4]; + "(ID, TM, CMD_TYPE, DEST_ACU_CODE, TIMEOUT, DEVICE_CODE) " + + "VALUES (?, TO_DATE(?, 'YYYYMMDDHH24MISS'), ?, ?, '0', ?)"; + Object[] params = new Object[5]; params[0] = cmd.getId(); params[1] = TimeFormat.format(cmd.getTm(), "yyyyMMddHHmmss"); params[2] = cmd.getCmd_type(); params[3] = cmd.getDest_acu_code(); + params[4] = cmd.getDevice_code(); try { conn = ConnectionManager.getConnectionFromC3P0(); diff --git a/src/com/szpg/db/data/PgAcuCmd.java b/src/com/szpg/db/data/PgAcuCmd.java index 9e57628..0f3cabc 100644 --- a/src/com/szpg/db/data/PgAcuCmd.java +++ b/src/com/szpg/db/data/PgAcuCmd.java @@ -23,6 +23,7 @@ private Date tm; // 命令发送时间 private String cmd_type; // 命令类型 private String dest_acu_code; // 目标ACU代码 + private String device_code; // 命令的资产编号 private boolean timeout; // 是否超时 public PgAcuCmd() { @@ -62,6 +63,14 @@ this.dest_acu_code = dest_acu_code; } + public String getDevice_code() { + return device_code; + } + + public void setDevice_code(String device_code) { + this.device_code = device_code; + } + public boolean isTimeout() { return timeout; } diff --git a/src/com/szpg/plc/PGDSCServlet.java b/src/com/szpg/plc/PGDSCServlet.java index 5653eb6..881c2e3 100644 --- a/src/com/szpg/plc/PGDSCServlet.java +++ b/src/com/szpg/plc/PGDSCServlet.java @@ -104,13 +104,13 @@ sendQueryJGStatusCommand(); //10巡检数据同步 - synchAssetInSpection(); +// synchAssetInSpection(); //运维数据同步 - synchMaintanceRecord(); +// synchMaintanceRecord(); // 查询二期温湿度氧气实时数据 - sendQueryWSYQValueCommand(); +// sendQueryWSYQValueCommand(); } /** diff --git a/src/com/szpg/plc/message/command/write/SetJgLockBitCommand.java b/src/com/szpg/plc/message/command/write/SetJgLockBitCommand.java new file mode 100644 index 0000000..f4bc55a --- /dev/null +++ b/src/com/szpg/plc/message/command/write/SetJgLockBitCommand.java @@ -0,0 +1,40 @@ +package com.szpg.plc.message.command.write; + +import com.szpg.plc.message.AppMessageConstants; +import com.szpg.plc.message.command.WriteMemoryCommand; +import com.szpg.plc.message.response.WriteMemoryCommandResponse; + +public class SetJgLockBitCommand extends WriteMemoryCommand { + + /** + * + */ + private static final long serialVersionUID = 935723353287421429L; + + public final static int JG_LOCK = 0; //井盖锁定 + + private int unlock; + + public int getUnlock() { + return unlock; + } + + public void setUnlock(int unlock) { + this.unlock = unlock; + } + + @Override + public String getCommandType() { + return AppMessageConstants.CMD_TYPE_SETJGLOCK; + } + + @Override + public Class getResponseClass() { + return WriteMemoryCommandResponse.class; + } + + @Override + public String toString() { + return "向终端[" + getDestinationId() + "]发送设置井盖锁定命令"; + } +} diff --git a/src/com/szpg/plc/message/command/write/SetJgOffBitCommand.java b/src/com/szpg/plc/message/command/write/SetJgOffBitCommand.java new file mode 100644 index 0000000..185804c --- /dev/null +++ b/src/com/szpg/plc/message/command/write/SetJgOffBitCommand.java @@ -0,0 +1,41 @@ +package com.szpg.plc.message.command.write; + +import com.szpg.plc.message.AppMessageConstants; +import com.szpg.plc.message.command.WriteMemoryCommand; +import com.szpg.plc.message.response.WriteMemoryCommandResponse; + +public class SetJgOffBitCommand extends WriteMemoryCommand { + + /** + * + */ + private static final long serialVersionUID = 935723353287421429L; + + public final static int JG_OFF_ENABLE = 1; // 井盖关闭 + public final static int JG_OFF_DISABLE = 0; // 井盖关闭复位 + + private int jgoff; + + public int getJgoff() { + return jgoff; + } + + public void setJgoff(int jgoff) { + this.jgoff = jgoff; + } + + @Override + public String getCommandType() { + return AppMessageConstants.CMD_TYPE_SETJGOFF; + } + + @Override + public Class getResponseClass() { + return WriteMemoryCommandResponse.class; + } + + @Override + public String toString() { + return "向终端[" + getDestinationId() + "]发送设置井盖关闭位命令[" + jgoff + "]"; + } +} diff --git a/src/com/szpg/plc/message/command/write/SetJgOnBitCommand.java b/src/com/szpg/plc/message/command/write/SetJgOnBitCommand.java new file mode 100644 index 0000000..b63cf19 --- /dev/null +++ b/src/com/szpg/plc/message/command/write/SetJgOnBitCommand.java @@ -0,0 +1,41 @@ +package com.szpg.plc.message.command.write; + +import com.szpg.plc.message.AppMessageConstants; +import com.szpg.plc.message.command.WriteMemoryCommand; +import com.szpg.plc.message.response.WriteMemoryCommandResponse; + +public class SetJgOnBitCommand extends WriteMemoryCommand { + + /** + * + */ + private static final long serialVersionUID = 935723353287421429L; + + public final static int JG_ON_ENABLE = 1; // 井盖打开 + public final static int JG_ON_DISABLE = 0; // 井盖打开复位 + + private int jgon; + + public int getJgon() { + return jgon; + } + + public void setJgon(int jgon) { + this.jgon = jgon; + } + + @Override + public String getCommandType() { + return AppMessageConstants.CMD_TYPE_SETJGON; + } + + @Override + public Class getResponseClass() { + return WriteMemoryCommandResponse.class; + } + + @Override + public String toString() { + return "向终端[" + getDestinationId() + "]发送设置井盖开启位命令[" + jgon + "]"; + } +} diff --git a/src/com/szpg/plc/message/command/write/SetJgUnlockBitCommand.java b/src/com/szpg/plc/message/command/write/SetJgUnlockBitCommand.java index e3898b4..cfe7a6b 100644 --- a/src/com/szpg/plc/message/command/write/SetJgUnlockBitCommand.java +++ b/src/com/szpg/plc/message/command/write/SetJgUnlockBitCommand.java @@ -10,8 +10,7 @@ * */ private static final long serialVersionUID = 935723353287421429L; - - public final static int JG_LOCK = 0; //井盖锁定 + public final static int JG_UNLOCK = 1; //井盖解锁 private int unlock; diff --git a/src/com/szpg/plc/message/response/write/SetJgLockBitCommandResponse.java b/src/com/szpg/plc/message/response/write/SetJgLockBitCommandResponse.java new file mode 100644 index 0000000..adb5f9d --- /dev/null +++ b/src/com/szpg/plc/message/response/write/SetJgLockBitCommandResponse.java @@ -0,0 +1,29 @@ +package com.szpg.plc.message.response.write; + +import com.szpg.db.dao.PgDeviceDao; +import com.szpg.db.dao.PgJgDao; +import com.szpg.db.dao.impl.PgDeviceDaoImpl; +import com.szpg.db.dao.impl.PgJgDaoImpl; +import com.szpg.plc.message.response.WriteMemoryCommandResponse; +import org.apache.log4j.Logger; + +public class SetJgLockBitCommandResponse extends WriteMemoryCommandResponse { + + private final Logger logger = Logger.getLogger(this.getClass().getName()); + + private PgJgDao jgDao = new PgJgDaoImpl(); + private PgDeviceDao deviceDao = new PgDeviceDaoImpl(); + + @Override + public void afterAction() { + if (this.isSuccess() == true) { + // 更新设备状态 锁定 + int deviceId = deviceDao.findDeviceIdByCode(this.getDestinationId()); + if (deviceId > 0) { + jgDao.updateDeviceStatus(deviceId, "0"); + } + + logger.info("[" + this.getAcucode() + "]锁定井盖成功"); + } + } +} diff --git a/src/com/szpg/plc/message/response/write/SetJgOffBitCommandResponse.java b/src/com/szpg/plc/message/response/write/SetJgOffBitCommandResponse.java new file mode 100644 index 0000000..f10831c --- /dev/null +++ b/src/com/szpg/plc/message/response/write/SetJgOffBitCommandResponse.java @@ -0,0 +1,29 @@ +package com.szpg.plc.message.response.write; + +import com.szpg.db.dao.PgDeviceDao; +import com.szpg.db.dao.PgJgDao; +import com.szpg.db.dao.impl.PgDeviceDaoImpl; +import com.szpg.db.dao.impl.PgJgDaoImpl; +import com.szpg.plc.message.response.WriteMemoryCommandResponse; +import org.apache.log4j.Logger; + +public class SetJgOffBitCommandResponse extends WriteMemoryCommandResponse { + + private final Logger logger = Logger.getLogger(this.getClass().getName()); + + private PgJgDao jgDao = new PgJgDaoImpl(); + private PgDeviceDao deviceDao = new PgDeviceDaoImpl(); + + @Override + public void afterAction() { + if (this.isSuccess() == true) { + // 更新设备状态 关 + int deviceId = deviceDao.findDeviceIdByCode(this.getDestinationId()); + if (deviceId > 0) { + jgDao.updateDeviceStatus(deviceId, "0"); + } + + logger.info("[" + this.getAcucode() + "]关闭井盖成功"); + } + } +} diff --git a/src/com/szpg/plc/message/response/write/SetJgOnBitCommandResponse.java b/src/com/szpg/plc/message/response/write/SetJgOnBitCommandResponse.java new file mode 100644 index 0000000..35eb98c --- /dev/null +++ b/src/com/szpg/plc/message/response/write/SetJgOnBitCommandResponse.java @@ -0,0 +1,29 @@ +package com.szpg.plc.message.response.write; + +import com.szpg.db.dao.PgDeviceDao; +import com.szpg.db.dao.PgJgDao; +import com.szpg.db.dao.impl.PgDeviceDaoImpl; +import com.szpg.db.dao.impl.PgJgDaoImpl; +import com.szpg.plc.message.response.WriteMemoryCommandResponse; +import org.apache.log4j.Logger; + +public class SetJgOnBitCommandResponse extends WriteMemoryCommandResponse { + + private final Logger logger = Logger.getLogger(this.getClass().getName()); + + private PgJgDao jgDao = new PgJgDaoImpl(); + private PgDeviceDao deviceDao = new PgDeviceDaoImpl(); + + @Override + public void afterAction() { + if (this.isSuccess() == true) { + // 更新设备状态 开 + int deviceId = deviceDao.findDeviceIdByCode(this.getDestinationId()); + if (deviceId > 0) { + jgDao.updateDeviceStatus(deviceId, "1"); + } + + logger.info("[" + this.getAcucode() + "]打开井盖成功"); + } + } +} diff --git a/src/com/szpg/plc/message/response/write/SetJgUnlockBitCommandResponse.java b/src/com/szpg/plc/message/response/write/SetJgUnlockBitCommandResponse.java new file mode 100644 index 0000000..1575f09 --- /dev/null +++ b/src/com/szpg/plc/message/response/write/SetJgUnlockBitCommandResponse.java @@ -0,0 +1,30 @@ +package com.szpg.plc.message.response.write; + +import com.szpg.db.dao.PgDeviceDao; +import com.szpg.db.dao.PgJgDao; +import com.szpg.db.dao.impl.PgDeviceDaoImpl; +import com.szpg.db.dao.impl.PgJgDaoImpl; +import com.szpg.plc.message.command.write.SetJgUnlockBitCommand; +import com.szpg.plc.message.response.WriteMemoryCommandResponse; +import org.apache.log4j.Logger; + +public class SetJgUnlockBitCommandResponse extends WriteMemoryCommandResponse { + + private final Logger logger = Logger.getLogger(this.getClass().getName()); + + private PgJgDao jgDao = new PgJgDaoImpl(); + private PgDeviceDao deviceDao = new PgDeviceDaoImpl(); + + @Override + public void afterAction() { + if (this.isSuccess() == true) { + // 更新设备状态 解锁 + int deviceId = deviceDao.findDeviceIdByCode(this.getDestinationId()); + if (deviceId > 0) { + jgDao.updateDeviceStatus(deviceId, "1"); + } + + logger.info("[" + this.getAcucode() + "]解锁井盖成功"); + } + } +} diff --git a/src/com/szpg/plc/message/response/write/SetZmOffBitCommandResponse.java b/src/com/szpg/plc/message/response/write/SetZmOffBitCommandResponse.java new file mode 100644 index 0000000..bd36ece --- /dev/null +++ b/src/com/szpg/plc/message/response/write/SetZmOffBitCommandResponse.java @@ -0,0 +1,29 @@ +package com.szpg.plc.message.response.write; + +import com.szpg.db.dao.PgDeviceDao; +import com.szpg.db.dao.PgJgDao; +import com.szpg.db.dao.impl.PgDeviceDaoImpl; +import com.szpg.db.dao.impl.PgJgDaoImpl; +import com.szpg.plc.message.response.WriteMemoryCommandResponse; +import org.apache.log4j.Logger; + +public class SetZmOffBitCommandResponse extends WriteMemoryCommandResponse { + + private final Logger logger = Logger.getLogger(this.getClass().getName()); + + private PgJgDao jgDao = new PgJgDaoImpl(); + private PgDeviceDao deviceDao = new PgDeviceDaoImpl(); + + @Override + public void afterAction() { + if (this.isSuccess() == true) { + // 更新设备状态 关 + int deviceId = deviceDao.findDeviceIdByCode(this.getDestinationId()); + if (deviceId > 0) { + jgDao.updateDeviceStatus(deviceId, "0"); + } + + logger.info("[" + this.getAcucode() + "]关闭照明成功"); + } + } +} diff --git a/src/com/szpg/plc/message/response/write/SetZmOnBitCommandResponse.java b/src/com/szpg/plc/message/response/write/SetZmOnBitCommandResponse.java new file mode 100644 index 0000000..61822b8 --- /dev/null +++ b/src/com/szpg/plc/message/response/write/SetZmOnBitCommandResponse.java @@ -0,0 +1,29 @@ +package com.szpg.plc.message.response.write; + +import com.szpg.db.dao.PgDeviceDao; +import com.szpg.db.dao.PgJgDao; +import com.szpg.db.dao.impl.PgDeviceDaoImpl; +import com.szpg.db.dao.impl.PgJgDaoImpl; +import com.szpg.plc.message.response.WriteMemoryCommandResponse; +import org.apache.log4j.Logger; + +public class SetZmOnBitCommandResponse extends WriteMemoryCommandResponse { + + private final Logger logger = Logger.getLogger(this.getClass().getName()); + + private PgJgDao jgDao = new PgJgDaoImpl(); + private PgDeviceDao deviceDao = new PgDeviceDaoImpl(); + + @Override + public void afterAction() { + if (this.isSuccess() == true) { + // 更新设备状态 开 + int deviceId = deviceDao.findDeviceIdByCode(this.getDestinationId()); + if (deviceId > 0) { + jgDao.updateDeviceStatus(deviceId, "1"); + } + + logger.info("[" + this.getAcucode() + "]打开照明成功"); + } + } +} diff --git a/src/ACUBL.properties b/src/ACUBL.properties index 9c4b0ab..df9ffdb 100644 --- a/src/ACUBL.properties +++ b/src/ACUBL.properties @@ -1,6 +1,6 @@ #ACU\u53D8\u91CF\u8868\u914D\u7F6E\u6587\u4EF6 -######## THXC.ACU001 ######## +######## 01 HXC.ACU001 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU001.CH.COUNT = 6 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -144,7 +144,7 @@ -######## THXC.ACU002 ######## +######## 02 THXC.ACU002 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU002.CH.COUNT = 6 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -288,7 +288,7 @@ -######## THXC.ACU003 ######## +######## 03 THXC.ACU003 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU003.CH.COUNT = 6 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -432,7 +432,7 @@ -######## THXC.ACU004 ######## +######## 04 THXC.ACU004 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU004.CH.COUNT = 6 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -576,7 +576,7 @@ -######## THXC.ACU005 ######## +######## 05 THXC.ACU005 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU005.CH.COUNT = 6 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -720,7 +720,7 @@ -######## THXC.ACU006 ######## +######## 06 THXC.ACU006 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU006.CH.COUNT = 6 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -812,7 +812,7 @@ #\u98CE\u673A\u6570\u91CF -THXC.ACU006.FJ.COUNT = 9 +THXC.ACU006.FJ.COUNT = 6 #\u98CE\u673A\u7F16\u7801\u5217\u8868 THXC.ACU006.FJ.ZC.LIST = THXC.ACU006.F.DFJ01;THXC.ACU006.F.DFJ02;THXC.ACU006.F.SFJ01;THXC.ACU006.F.SFJ02;THXC.ACU006.F.RFJ01;THXC.ACU006.F.RFJ02 #\u98CE\u673A\u72B6\u6001\u8D77\u59CB\u5730\u5740 @@ -864,7 +864,7 @@ -######## THXC.ACU008 ######## +######## 07 THXC.ACU008 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU008.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -1008,7 +1008,7 @@ -######## THXC.ACU009 ######## +######## 08 THXC.ACU009 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU009.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -1152,7 +1152,7 @@ -######## THXC.ACU010 ######## +######## 09 THXC.ACU010 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU010.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -1296,7 +1296,7 @@ -######## THXC.ACU011 ######## +######## 10 THXC.ACU011 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU011.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -1440,7 +1440,7 @@ -######## THXC.ACU013 ######## +######## 11 THXC.ACU013 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU013.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -1584,7 +1584,7 @@ -######## THXC.ACU014 ######## +######## 12 THXC.ACU014 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU014.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -1729,7 +1729,7 @@ -######## THXC.ACU015 ######## +######## 13 THXC.ACU015 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU015.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -1874,7 +1874,7 @@ -######## THXC.ACU016 ######## +######## 14 THXC.ACU016 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU016.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2020,7 +2020,7 @@ ######## \u4E8C\u671F\u4E09\u6807\u6BB5 ######## -######## THXC.ACU301 ######## +######## 01 THXC.ACU301 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU301.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2070,7 +2070,7 @@ -######## THXC.ACU302 ######## +######## 02 THXC.ACU302 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU302.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2083,7 +2083,7 @@ -######## THXC.ACU303 ######## +######## 03 THXC.ACU303 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU303.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2096,7 +2096,7 @@ -######## THXC.ACU304 ######## +######## 04 THXC.ACU304 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU304.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2109,7 +2109,7 @@ -######## THXC.ACU305 ######## +######## 05 THXC.ACU305 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU305.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2122,7 +2122,7 @@ -######## THXC.ACU501 ######## +######## 06 THXC.ACU501 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU501.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2135,7 +2135,7 @@ -######## THXC.ACU502 ######## +######## 07 THXC.ACU502 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU502.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2148,7 +2148,7 @@ -######## THXC.ACU503 ######## +######## 08 THXC.ACU503 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU503.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2161,7 +2161,7 @@ -######## THXC.ACU504 ######## +######## 09 THXC.ACU504 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU504.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2174,7 +2174,7 @@ -######## THXC.ACU505 ######## +######## 10 THXC.ACU505 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU505.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2187,7 +2187,7 @@ -######## THXC.ACU506 ######## +######## 11 THXC.ACU506 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU506.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2200,7 +2200,7 @@ -######## THXC.ACU507 ######## +######## 12 THXC.ACU507 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU507.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2213,7 +2213,7 @@ -######## THXC.ACU601 ######## +######## 13 THXC.ACU601 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU601.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2226,7 +2226,7 @@ -######## THXC.ACU602 ######## +######## 14 THXC.ACU602 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU602.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2239,7 +2239,7 @@ -######## THXC.ACU603 ######## +######## 15 THXC.ACU603 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU603.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2252,7 +2252,7 @@ -######## THXC.ACU604 ######## +######## 16 THXC.ACU604 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU604.WSYQ.COUNT = 6 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2265,7 +2265,7 @@ -######## THXC.ACUS03 ######## +######## 17 THXC.ACUS03 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACUS03.WSYQ.COUNT = 2 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2278,7 +2278,7 @@ -######## THXC.ACUS05 ######## +######## 18 THXC.ACUS05 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACUS05.WSYQ.COUNT = 2 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2291,7 +2291,7 @@ -######## THXC.ACUS06 ######## +######## 19 THXC.ACUS06 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACUS06.WSYQ.COUNT = 2 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2304,6 +2304,103 @@ +######## \u4E8C\u671F\u56DB\u6807\u6BB5 ######## +######## 01 THXC.ACU107 ######## + + +######## 02 THXC.ACU108 ######## + + +######## 03 THXC.ACU109 ######## + + +######## 04 THXC.ACU110 ######## + + +######## 05 THXC.ACU306 ######## + + +######## 06 THXC.ACU307 ######## + + +######## 07 THXC.ACU308 ######## + + +######## 08 THXC.ACU309 ######## + + +######## 09 THXC.ACU401 ######## + + +######## 10 THXC.ACU402 ######## + + +######## 11 THXC.ACU403 ######## + + +######## 12 THXC.ACU404 ######## + + +######## 13 THXC.ACU405 ######## + + +######## 14 THXC.ACU406 ######## + + +######## 15 THXC.ACU407 ######## + + +######## 16 THXC.ACU408 ######## + + +######## 17 THXC.ACUS04 ######## + + +######## 18 THXC.ACU701 ######## + + +######## 19 THXC.ACU702 ######## + + +######## 20 THXC.ACU703 ######## + + +######## 21 THXC.ACU704 ######## + + +######## 22 THXC.ACU705 ######## + + +######## 23 THXC.ACU706 ######## + + +######## 24 THXC.ACU801 ######## + + +######## 25 THXC.ACU802 ######## + + +######## 26 THXC.ACU803 ######## + + +######## 27 THXC.ACU804 ######## + + +######## 28 THXC.ACU805 ######## + + +######## 29 THXC.ACU806 ######## + + +######## 30 THXC.ACU807 ######## + + +######## 31 THXC.ACUS07 ######## + + +######## 32 THXC.ACUS08 ######## + + ######## \u9F99\u7FD4\u8DEF\u71C3\u6C14\u6BB5 THXC.ACU801 ######## #\u98CE\u673A\u6570\u91CF THXC.ACU801.FJ.COUNT = 1 diff --git a/src/com/szpg/db/dao/impl/PgAcuCmdDaoImpl.java b/src/com/szpg/db/dao/impl/PgAcuCmdDaoImpl.java index b752a9c..406d9ee 100644 --- a/src/com/szpg/db/dao/impl/PgAcuCmdDaoImpl.java +++ b/src/com/szpg/db/dao/impl/PgAcuCmdDaoImpl.java @@ -154,13 +154,14 @@ Connection conn = null; String insertStr = "INSERT INTO PG_ACU_CMD " + - "(ID, TM, CMD_TYPE, DEST_ACU_CODE, TIMEOUT) " + - "VALUES (?, TO_DATE(?, 'YYYYMMDDHH24MISS'), ?, ?, '0')"; - Object[] params = new Object[4]; + "(ID, TM, CMD_TYPE, DEST_ACU_CODE, TIMEOUT, DEVICE_CODE) " + + "VALUES (?, TO_DATE(?, 'YYYYMMDDHH24MISS'), ?, ?, '0', ?)"; + Object[] params = new Object[5]; params[0] = cmd.getId(); params[1] = TimeFormat.format(cmd.getTm(), "yyyyMMddHHmmss"); params[2] = cmd.getCmd_type(); params[3] = cmd.getDest_acu_code(); + params[4] = cmd.getDevice_code(); try { conn = ConnectionManager.getConnectionFromC3P0(); diff --git a/src/com/szpg/db/data/PgAcuCmd.java b/src/com/szpg/db/data/PgAcuCmd.java index 9e57628..0f3cabc 100644 --- a/src/com/szpg/db/data/PgAcuCmd.java +++ b/src/com/szpg/db/data/PgAcuCmd.java @@ -23,6 +23,7 @@ private Date tm; // 命令发送时间 private String cmd_type; // 命令类型 private String dest_acu_code; // 目标ACU代码 + private String device_code; // 命令的资产编号 private boolean timeout; // 是否超时 public PgAcuCmd() { @@ -62,6 +63,14 @@ this.dest_acu_code = dest_acu_code; } + public String getDevice_code() { + return device_code; + } + + public void setDevice_code(String device_code) { + this.device_code = device_code; + } + public boolean isTimeout() { return timeout; } diff --git a/src/com/szpg/plc/PGDSCServlet.java b/src/com/szpg/plc/PGDSCServlet.java index 5653eb6..881c2e3 100644 --- a/src/com/szpg/plc/PGDSCServlet.java +++ b/src/com/szpg/plc/PGDSCServlet.java @@ -104,13 +104,13 @@ sendQueryJGStatusCommand(); //10巡检数据同步 - synchAssetInSpection(); +// synchAssetInSpection(); //运维数据同步 - synchMaintanceRecord(); +// synchMaintanceRecord(); // 查询二期温湿度氧气实时数据 - sendQueryWSYQValueCommand(); +// sendQueryWSYQValueCommand(); } /** diff --git a/src/com/szpg/plc/message/command/write/SetJgLockBitCommand.java b/src/com/szpg/plc/message/command/write/SetJgLockBitCommand.java new file mode 100644 index 0000000..f4bc55a --- /dev/null +++ b/src/com/szpg/plc/message/command/write/SetJgLockBitCommand.java @@ -0,0 +1,40 @@ +package com.szpg.plc.message.command.write; + +import com.szpg.plc.message.AppMessageConstants; +import com.szpg.plc.message.command.WriteMemoryCommand; +import com.szpg.plc.message.response.WriteMemoryCommandResponse; + +public class SetJgLockBitCommand extends WriteMemoryCommand { + + /** + * + */ + private static final long serialVersionUID = 935723353287421429L; + + public final static int JG_LOCK = 0; //井盖锁定 + + private int unlock; + + public int getUnlock() { + return unlock; + } + + public void setUnlock(int unlock) { + this.unlock = unlock; + } + + @Override + public String getCommandType() { + return AppMessageConstants.CMD_TYPE_SETJGLOCK; + } + + @Override + public Class getResponseClass() { + return WriteMemoryCommandResponse.class; + } + + @Override + public String toString() { + return "向终端[" + getDestinationId() + "]发送设置井盖锁定命令"; + } +} diff --git a/src/com/szpg/plc/message/command/write/SetJgOffBitCommand.java b/src/com/szpg/plc/message/command/write/SetJgOffBitCommand.java new file mode 100644 index 0000000..185804c --- /dev/null +++ b/src/com/szpg/plc/message/command/write/SetJgOffBitCommand.java @@ -0,0 +1,41 @@ +package com.szpg.plc.message.command.write; + +import com.szpg.plc.message.AppMessageConstants; +import com.szpg.plc.message.command.WriteMemoryCommand; +import com.szpg.plc.message.response.WriteMemoryCommandResponse; + +public class SetJgOffBitCommand extends WriteMemoryCommand { + + /** + * + */ + private static final long serialVersionUID = 935723353287421429L; + + public final static int JG_OFF_ENABLE = 1; // 井盖关闭 + public final static int JG_OFF_DISABLE = 0; // 井盖关闭复位 + + private int jgoff; + + public int getJgoff() { + return jgoff; + } + + public void setJgoff(int jgoff) { + this.jgoff = jgoff; + } + + @Override + public String getCommandType() { + return AppMessageConstants.CMD_TYPE_SETJGOFF; + } + + @Override + public Class getResponseClass() { + return WriteMemoryCommandResponse.class; + } + + @Override + public String toString() { + return "向终端[" + getDestinationId() + "]发送设置井盖关闭位命令[" + jgoff + "]"; + } +} diff --git a/src/com/szpg/plc/message/command/write/SetJgOnBitCommand.java b/src/com/szpg/plc/message/command/write/SetJgOnBitCommand.java new file mode 100644 index 0000000..b63cf19 --- /dev/null +++ b/src/com/szpg/plc/message/command/write/SetJgOnBitCommand.java @@ -0,0 +1,41 @@ +package com.szpg.plc.message.command.write; + +import com.szpg.plc.message.AppMessageConstants; +import com.szpg.plc.message.command.WriteMemoryCommand; +import com.szpg.plc.message.response.WriteMemoryCommandResponse; + +public class SetJgOnBitCommand extends WriteMemoryCommand { + + /** + * + */ + private static final long serialVersionUID = 935723353287421429L; + + public final static int JG_ON_ENABLE = 1; // 井盖打开 + public final static int JG_ON_DISABLE = 0; // 井盖打开复位 + + private int jgon; + + public int getJgon() { + return jgon; + } + + public void setJgon(int jgon) { + this.jgon = jgon; + } + + @Override + public String getCommandType() { + return AppMessageConstants.CMD_TYPE_SETJGON; + } + + @Override + public Class getResponseClass() { + return WriteMemoryCommandResponse.class; + } + + @Override + public String toString() { + return "向终端[" + getDestinationId() + "]发送设置井盖开启位命令[" + jgon + "]"; + } +} diff --git a/src/com/szpg/plc/message/command/write/SetJgUnlockBitCommand.java b/src/com/szpg/plc/message/command/write/SetJgUnlockBitCommand.java index e3898b4..cfe7a6b 100644 --- a/src/com/szpg/plc/message/command/write/SetJgUnlockBitCommand.java +++ b/src/com/szpg/plc/message/command/write/SetJgUnlockBitCommand.java @@ -10,8 +10,7 @@ * */ private static final long serialVersionUID = 935723353287421429L; - - public final static int JG_LOCK = 0; //井盖锁定 + public final static int JG_UNLOCK = 1; //井盖解锁 private int unlock; diff --git a/src/com/szpg/plc/message/response/write/SetJgLockBitCommandResponse.java b/src/com/szpg/plc/message/response/write/SetJgLockBitCommandResponse.java new file mode 100644 index 0000000..adb5f9d --- /dev/null +++ b/src/com/szpg/plc/message/response/write/SetJgLockBitCommandResponse.java @@ -0,0 +1,29 @@ +package com.szpg.plc.message.response.write; + +import com.szpg.db.dao.PgDeviceDao; +import com.szpg.db.dao.PgJgDao; +import com.szpg.db.dao.impl.PgDeviceDaoImpl; +import com.szpg.db.dao.impl.PgJgDaoImpl; +import com.szpg.plc.message.response.WriteMemoryCommandResponse; +import org.apache.log4j.Logger; + +public class SetJgLockBitCommandResponse extends WriteMemoryCommandResponse { + + private final Logger logger = Logger.getLogger(this.getClass().getName()); + + private PgJgDao jgDao = new PgJgDaoImpl(); + private PgDeviceDao deviceDao = new PgDeviceDaoImpl(); + + @Override + public void afterAction() { + if (this.isSuccess() == true) { + // 更新设备状态 锁定 + int deviceId = deviceDao.findDeviceIdByCode(this.getDestinationId()); + if (deviceId > 0) { + jgDao.updateDeviceStatus(deviceId, "0"); + } + + logger.info("[" + this.getAcucode() + "]锁定井盖成功"); + } + } +} diff --git a/src/com/szpg/plc/message/response/write/SetJgOffBitCommandResponse.java b/src/com/szpg/plc/message/response/write/SetJgOffBitCommandResponse.java new file mode 100644 index 0000000..f10831c --- /dev/null +++ b/src/com/szpg/plc/message/response/write/SetJgOffBitCommandResponse.java @@ -0,0 +1,29 @@ +package com.szpg.plc.message.response.write; + +import com.szpg.db.dao.PgDeviceDao; +import com.szpg.db.dao.PgJgDao; +import com.szpg.db.dao.impl.PgDeviceDaoImpl; +import com.szpg.db.dao.impl.PgJgDaoImpl; +import com.szpg.plc.message.response.WriteMemoryCommandResponse; +import org.apache.log4j.Logger; + +public class SetJgOffBitCommandResponse extends WriteMemoryCommandResponse { + + private final Logger logger = Logger.getLogger(this.getClass().getName()); + + private PgJgDao jgDao = new PgJgDaoImpl(); + private PgDeviceDao deviceDao = new PgDeviceDaoImpl(); + + @Override + public void afterAction() { + if (this.isSuccess() == true) { + // 更新设备状态 关 + int deviceId = deviceDao.findDeviceIdByCode(this.getDestinationId()); + if (deviceId > 0) { + jgDao.updateDeviceStatus(deviceId, "0"); + } + + logger.info("[" + this.getAcucode() + "]关闭井盖成功"); + } + } +} diff --git a/src/com/szpg/plc/message/response/write/SetJgOnBitCommandResponse.java b/src/com/szpg/plc/message/response/write/SetJgOnBitCommandResponse.java new file mode 100644 index 0000000..35eb98c --- /dev/null +++ b/src/com/szpg/plc/message/response/write/SetJgOnBitCommandResponse.java @@ -0,0 +1,29 @@ +package com.szpg.plc.message.response.write; + +import com.szpg.db.dao.PgDeviceDao; +import com.szpg.db.dao.PgJgDao; +import com.szpg.db.dao.impl.PgDeviceDaoImpl; +import com.szpg.db.dao.impl.PgJgDaoImpl; +import com.szpg.plc.message.response.WriteMemoryCommandResponse; +import org.apache.log4j.Logger; + +public class SetJgOnBitCommandResponse extends WriteMemoryCommandResponse { + + private final Logger logger = Logger.getLogger(this.getClass().getName()); + + private PgJgDao jgDao = new PgJgDaoImpl(); + private PgDeviceDao deviceDao = new PgDeviceDaoImpl(); + + @Override + public void afterAction() { + if (this.isSuccess() == true) { + // 更新设备状态 开 + int deviceId = deviceDao.findDeviceIdByCode(this.getDestinationId()); + if (deviceId > 0) { + jgDao.updateDeviceStatus(deviceId, "1"); + } + + logger.info("[" + this.getAcucode() + "]打开井盖成功"); + } + } +} diff --git a/src/com/szpg/plc/message/response/write/SetJgUnlockBitCommandResponse.java b/src/com/szpg/plc/message/response/write/SetJgUnlockBitCommandResponse.java new file mode 100644 index 0000000..1575f09 --- /dev/null +++ b/src/com/szpg/plc/message/response/write/SetJgUnlockBitCommandResponse.java @@ -0,0 +1,30 @@ +package com.szpg.plc.message.response.write; + +import com.szpg.db.dao.PgDeviceDao; +import com.szpg.db.dao.PgJgDao; +import com.szpg.db.dao.impl.PgDeviceDaoImpl; +import com.szpg.db.dao.impl.PgJgDaoImpl; +import com.szpg.plc.message.command.write.SetJgUnlockBitCommand; +import com.szpg.plc.message.response.WriteMemoryCommandResponse; +import org.apache.log4j.Logger; + +public class SetJgUnlockBitCommandResponse extends WriteMemoryCommandResponse { + + private final Logger logger = Logger.getLogger(this.getClass().getName()); + + private PgJgDao jgDao = new PgJgDaoImpl(); + private PgDeviceDao deviceDao = new PgDeviceDaoImpl(); + + @Override + public void afterAction() { + if (this.isSuccess() == true) { + // 更新设备状态 解锁 + int deviceId = deviceDao.findDeviceIdByCode(this.getDestinationId()); + if (deviceId > 0) { + jgDao.updateDeviceStatus(deviceId, "1"); + } + + logger.info("[" + this.getAcucode() + "]解锁井盖成功"); + } + } +} diff --git a/src/com/szpg/plc/message/response/write/SetZmOffBitCommandResponse.java b/src/com/szpg/plc/message/response/write/SetZmOffBitCommandResponse.java new file mode 100644 index 0000000..bd36ece --- /dev/null +++ b/src/com/szpg/plc/message/response/write/SetZmOffBitCommandResponse.java @@ -0,0 +1,29 @@ +package com.szpg.plc.message.response.write; + +import com.szpg.db.dao.PgDeviceDao; +import com.szpg.db.dao.PgJgDao; +import com.szpg.db.dao.impl.PgDeviceDaoImpl; +import com.szpg.db.dao.impl.PgJgDaoImpl; +import com.szpg.plc.message.response.WriteMemoryCommandResponse; +import org.apache.log4j.Logger; + +public class SetZmOffBitCommandResponse extends WriteMemoryCommandResponse { + + private final Logger logger = Logger.getLogger(this.getClass().getName()); + + private PgJgDao jgDao = new PgJgDaoImpl(); + private PgDeviceDao deviceDao = new PgDeviceDaoImpl(); + + @Override + public void afterAction() { + if (this.isSuccess() == true) { + // 更新设备状态 关 + int deviceId = deviceDao.findDeviceIdByCode(this.getDestinationId()); + if (deviceId > 0) { + jgDao.updateDeviceStatus(deviceId, "0"); + } + + logger.info("[" + this.getAcucode() + "]关闭照明成功"); + } + } +} diff --git a/src/com/szpg/plc/message/response/write/SetZmOnBitCommandResponse.java b/src/com/szpg/plc/message/response/write/SetZmOnBitCommandResponse.java new file mode 100644 index 0000000..61822b8 --- /dev/null +++ b/src/com/szpg/plc/message/response/write/SetZmOnBitCommandResponse.java @@ -0,0 +1,29 @@ +package com.szpg.plc.message.response.write; + +import com.szpg.db.dao.PgDeviceDao; +import com.szpg.db.dao.PgJgDao; +import com.szpg.db.dao.impl.PgDeviceDaoImpl; +import com.szpg.db.dao.impl.PgJgDaoImpl; +import com.szpg.plc.message.response.WriteMemoryCommandResponse; +import org.apache.log4j.Logger; + +public class SetZmOnBitCommandResponse extends WriteMemoryCommandResponse { + + private final Logger logger = Logger.getLogger(this.getClass().getName()); + + private PgJgDao jgDao = new PgJgDaoImpl(); + private PgDeviceDao deviceDao = new PgDeviceDaoImpl(); + + @Override + public void afterAction() { + if (this.isSuccess() == true) { + // 更新设备状态 开 + int deviceId = deviceDao.findDeviceIdByCode(this.getDestinationId()); + if (deviceId > 0) { + jgDao.updateDeviceStatus(deviceId, "1"); + } + + logger.info("[" + this.getAcucode() + "]打开照明成功"); + } + } +} diff --git a/src/com/szpg/plc/server/ACUClientHandler.java b/src/com/szpg/plc/server/ACUClientHandler.java index cab8a25..c61c664 100644 --- a/src/com/szpg/plc/server/ACUClientHandler.java +++ b/src/com/szpg/plc/server/ACUClientHandler.java @@ -109,6 +109,7 @@ if (null != cmd) { rmcr.setAcucode(cmd.getDest_acu_code()); rmcr.setCmdId(cmd.getId()); + rmcr.setDestinationId(cmd.getDevice_code()); // 用设备资产编号赋值给目标地址 // 字节流已解析 diff --git a/src/ACUBL.properties b/src/ACUBL.properties index 9c4b0ab..df9ffdb 100644 --- a/src/ACUBL.properties +++ b/src/ACUBL.properties @@ -1,6 +1,6 @@ #ACU\u53D8\u91CF\u8868\u914D\u7F6E\u6587\u4EF6 -######## THXC.ACU001 ######## +######## 01 HXC.ACU001 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU001.CH.COUNT = 6 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -144,7 +144,7 @@ -######## THXC.ACU002 ######## +######## 02 THXC.ACU002 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU002.CH.COUNT = 6 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -288,7 +288,7 @@ -######## THXC.ACU003 ######## +######## 03 THXC.ACU003 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU003.CH.COUNT = 6 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -432,7 +432,7 @@ -######## THXC.ACU004 ######## +######## 04 THXC.ACU004 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU004.CH.COUNT = 6 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -576,7 +576,7 @@ -######## THXC.ACU005 ######## +######## 05 THXC.ACU005 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU005.CH.COUNT = 6 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -720,7 +720,7 @@ -######## THXC.ACU006 ######## +######## 06 THXC.ACU006 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU006.CH.COUNT = 6 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -812,7 +812,7 @@ #\u98CE\u673A\u6570\u91CF -THXC.ACU006.FJ.COUNT = 9 +THXC.ACU006.FJ.COUNT = 6 #\u98CE\u673A\u7F16\u7801\u5217\u8868 THXC.ACU006.FJ.ZC.LIST = THXC.ACU006.F.DFJ01;THXC.ACU006.F.DFJ02;THXC.ACU006.F.SFJ01;THXC.ACU006.F.SFJ02;THXC.ACU006.F.RFJ01;THXC.ACU006.F.RFJ02 #\u98CE\u673A\u72B6\u6001\u8D77\u59CB\u5730\u5740 @@ -864,7 +864,7 @@ -######## THXC.ACU008 ######## +######## 07 THXC.ACU008 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU008.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -1008,7 +1008,7 @@ -######## THXC.ACU009 ######## +######## 08 THXC.ACU009 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU009.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -1152,7 +1152,7 @@ -######## THXC.ACU010 ######## +######## 09 THXC.ACU010 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU010.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -1296,7 +1296,7 @@ -######## THXC.ACU011 ######## +######## 10 THXC.ACU011 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU011.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -1440,7 +1440,7 @@ -######## THXC.ACU013 ######## +######## 11 THXC.ACU013 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU013.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -1584,7 +1584,7 @@ -######## THXC.ACU014 ######## +######## 12 THXC.ACU014 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU014.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -1729,7 +1729,7 @@ -######## THXC.ACU015 ######## +######## 13 THXC.ACU015 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU015.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -1874,7 +1874,7 @@ -######## THXC.ACU016 ######## +######## 14 THXC.ACU016 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU016.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2020,7 +2020,7 @@ ######## \u4E8C\u671F\u4E09\u6807\u6BB5 ######## -######## THXC.ACU301 ######## +######## 01 THXC.ACU301 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU301.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2070,7 +2070,7 @@ -######## THXC.ACU302 ######## +######## 02 THXC.ACU302 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU302.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2083,7 +2083,7 @@ -######## THXC.ACU303 ######## +######## 03 THXC.ACU303 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU303.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2096,7 +2096,7 @@ -######## THXC.ACU304 ######## +######## 04 THXC.ACU304 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU304.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2109,7 +2109,7 @@ -######## THXC.ACU305 ######## +######## 05 THXC.ACU305 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU305.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2122,7 +2122,7 @@ -######## THXC.ACU501 ######## +######## 06 THXC.ACU501 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU501.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2135,7 +2135,7 @@ -######## THXC.ACU502 ######## +######## 07 THXC.ACU502 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU502.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2148,7 +2148,7 @@ -######## THXC.ACU503 ######## +######## 08 THXC.ACU503 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU503.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2161,7 +2161,7 @@ -######## THXC.ACU504 ######## +######## 09 THXC.ACU504 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU504.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2174,7 +2174,7 @@ -######## THXC.ACU505 ######## +######## 10 THXC.ACU505 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU505.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2187,7 +2187,7 @@ -######## THXC.ACU506 ######## +######## 11 THXC.ACU506 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU506.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2200,7 +2200,7 @@ -######## THXC.ACU507 ######## +######## 12 THXC.ACU507 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU507.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2213,7 +2213,7 @@ -######## THXC.ACU601 ######## +######## 13 THXC.ACU601 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU601.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2226,7 +2226,7 @@ -######## THXC.ACU602 ######## +######## 14 THXC.ACU602 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU602.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2239,7 +2239,7 @@ -######## THXC.ACU603 ######## +######## 15 THXC.ACU603 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU603.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2252,7 +2252,7 @@ -######## THXC.ACU604 ######## +######## 16 THXC.ACU604 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU604.WSYQ.COUNT = 6 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2265,7 +2265,7 @@ -######## THXC.ACUS03 ######## +######## 17 THXC.ACUS03 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACUS03.WSYQ.COUNT = 2 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2278,7 +2278,7 @@ -######## THXC.ACUS05 ######## +######## 18 THXC.ACUS05 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACUS05.WSYQ.COUNT = 2 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2291,7 +2291,7 @@ -######## THXC.ACUS06 ######## +######## 19 THXC.ACUS06 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACUS06.WSYQ.COUNT = 2 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2304,6 +2304,103 @@ +######## \u4E8C\u671F\u56DB\u6807\u6BB5 ######## +######## 01 THXC.ACU107 ######## + + +######## 02 THXC.ACU108 ######## + + +######## 03 THXC.ACU109 ######## + + +######## 04 THXC.ACU110 ######## + + +######## 05 THXC.ACU306 ######## + + +######## 06 THXC.ACU307 ######## + + +######## 07 THXC.ACU308 ######## + + +######## 08 THXC.ACU309 ######## + + +######## 09 THXC.ACU401 ######## + + +######## 10 THXC.ACU402 ######## + + +######## 11 THXC.ACU403 ######## + + +######## 12 THXC.ACU404 ######## + + +######## 13 THXC.ACU405 ######## + + +######## 14 THXC.ACU406 ######## + + +######## 15 THXC.ACU407 ######## + + +######## 16 THXC.ACU408 ######## + + +######## 17 THXC.ACUS04 ######## + + +######## 18 THXC.ACU701 ######## + + +######## 19 THXC.ACU702 ######## + + +######## 20 THXC.ACU703 ######## + + +######## 21 THXC.ACU704 ######## + + +######## 22 THXC.ACU705 ######## + + +######## 23 THXC.ACU706 ######## + + +######## 24 THXC.ACU801 ######## + + +######## 25 THXC.ACU802 ######## + + +######## 26 THXC.ACU803 ######## + + +######## 27 THXC.ACU804 ######## + + +######## 28 THXC.ACU805 ######## + + +######## 29 THXC.ACU806 ######## + + +######## 30 THXC.ACU807 ######## + + +######## 31 THXC.ACUS07 ######## + + +######## 32 THXC.ACUS08 ######## + + ######## \u9F99\u7FD4\u8DEF\u71C3\u6C14\u6BB5 THXC.ACU801 ######## #\u98CE\u673A\u6570\u91CF THXC.ACU801.FJ.COUNT = 1 diff --git a/src/com/szpg/db/dao/impl/PgAcuCmdDaoImpl.java b/src/com/szpg/db/dao/impl/PgAcuCmdDaoImpl.java index b752a9c..406d9ee 100644 --- a/src/com/szpg/db/dao/impl/PgAcuCmdDaoImpl.java +++ b/src/com/szpg/db/dao/impl/PgAcuCmdDaoImpl.java @@ -154,13 +154,14 @@ Connection conn = null; String insertStr = "INSERT INTO PG_ACU_CMD " + - "(ID, TM, CMD_TYPE, DEST_ACU_CODE, TIMEOUT) " + - "VALUES (?, TO_DATE(?, 'YYYYMMDDHH24MISS'), ?, ?, '0')"; - Object[] params = new Object[4]; + "(ID, TM, CMD_TYPE, DEST_ACU_CODE, TIMEOUT, DEVICE_CODE) " + + "VALUES (?, TO_DATE(?, 'YYYYMMDDHH24MISS'), ?, ?, '0', ?)"; + Object[] params = new Object[5]; params[0] = cmd.getId(); params[1] = TimeFormat.format(cmd.getTm(), "yyyyMMddHHmmss"); params[2] = cmd.getCmd_type(); params[3] = cmd.getDest_acu_code(); + params[4] = cmd.getDevice_code(); try { conn = ConnectionManager.getConnectionFromC3P0(); diff --git a/src/com/szpg/db/data/PgAcuCmd.java b/src/com/szpg/db/data/PgAcuCmd.java index 9e57628..0f3cabc 100644 --- a/src/com/szpg/db/data/PgAcuCmd.java +++ b/src/com/szpg/db/data/PgAcuCmd.java @@ -23,6 +23,7 @@ private Date tm; // 命令发送时间 private String cmd_type; // 命令类型 private String dest_acu_code; // 目标ACU代码 + private String device_code; // 命令的资产编号 private boolean timeout; // 是否超时 public PgAcuCmd() { @@ -62,6 +63,14 @@ this.dest_acu_code = dest_acu_code; } + public String getDevice_code() { + return device_code; + } + + public void setDevice_code(String device_code) { + this.device_code = device_code; + } + public boolean isTimeout() { return timeout; } diff --git a/src/com/szpg/plc/PGDSCServlet.java b/src/com/szpg/plc/PGDSCServlet.java index 5653eb6..881c2e3 100644 --- a/src/com/szpg/plc/PGDSCServlet.java +++ b/src/com/szpg/plc/PGDSCServlet.java @@ -104,13 +104,13 @@ sendQueryJGStatusCommand(); //10巡检数据同步 - synchAssetInSpection(); +// synchAssetInSpection(); //运维数据同步 - synchMaintanceRecord(); +// synchMaintanceRecord(); // 查询二期温湿度氧气实时数据 - sendQueryWSYQValueCommand(); +// sendQueryWSYQValueCommand(); } /** diff --git a/src/com/szpg/plc/message/command/write/SetJgLockBitCommand.java b/src/com/szpg/plc/message/command/write/SetJgLockBitCommand.java new file mode 100644 index 0000000..f4bc55a --- /dev/null +++ b/src/com/szpg/plc/message/command/write/SetJgLockBitCommand.java @@ -0,0 +1,40 @@ +package com.szpg.plc.message.command.write; + +import com.szpg.plc.message.AppMessageConstants; +import com.szpg.plc.message.command.WriteMemoryCommand; +import com.szpg.plc.message.response.WriteMemoryCommandResponse; + +public class SetJgLockBitCommand extends WriteMemoryCommand { + + /** + * + */ + private static final long serialVersionUID = 935723353287421429L; + + public final static int JG_LOCK = 0; //井盖锁定 + + private int unlock; + + public int getUnlock() { + return unlock; + } + + public void setUnlock(int unlock) { + this.unlock = unlock; + } + + @Override + public String getCommandType() { + return AppMessageConstants.CMD_TYPE_SETJGLOCK; + } + + @Override + public Class getResponseClass() { + return WriteMemoryCommandResponse.class; + } + + @Override + public String toString() { + return "向终端[" + getDestinationId() + "]发送设置井盖锁定命令"; + } +} diff --git a/src/com/szpg/plc/message/command/write/SetJgOffBitCommand.java b/src/com/szpg/plc/message/command/write/SetJgOffBitCommand.java new file mode 100644 index 0000000..185804c --- /dev/null +++ b/src/com/szpg/plc/message/command/write/SetJgOffBitCommand.java @@ -0,0 +1,41 @@ +package com.szpg.plc.message.command.write; + +import com.szpg.plc.message.AppMessageConstants; +import com.szpg.plc.message.command.WriteMemoryCommand; +import com.szpg.plc.message.response.WriteMemoryCommandResponse; + +public class SetJgOffBitCommand extends WriteMemoryCommand { + + /** + * + */ + private static final long serialVersionUID = 935723353287421429L; + + public final static int JG_OFF_ENABLE = 1; // 井盖关闭 + public final static int JG_OFF_DISABLE = 0; // 井盖关闭复位 + + private int jgoff; + + public int getJgoff() { + return jgoff; + } + + public void setJgoff(int jgoff) { + this.jgoff = jgoff; + } + + @Override + public String getCommandType() { + return AppMessageConstants.CMD_TYPE_SETJGOFF; + } + + @Override + public Class getResponseClass() { + return WriteMemoryCommandResponse.class; + } + + @Override + public String toString() { + return "向终端[" + getDestinationId() + "]发送设置井盖关闭位命令[" + jgoff + "]"; + } +} diff --git a/src/com/szpg/plc/message/command/write/SetJgOnBitCommand.java b/src/com/szpg/plc/message/command/write/SetJgOnBitCommand.java new file mode 100644 index 0000000..b63cf19 --- /dev/null +++ b/src/com/szpg/plc/message/command/write/SetJgOnBitCommand.java @@ -0,0 +1,41 @@ +package com.szpg.plc.message.command.write; + +import com.szpg.plc.message.AppMessageConstants; +import com.szpg.plc.message.command.WriteMemoryCommand; +import com.szpg.plc.message.response.WriteMemoryCommandResponse; + +public class SetJgOnBitCommand extends WriteMemoryCommand { + + /** + * + */ + private static final long serialVersionUID = 935723353287421429L; + + public final static int JG_ON_ENABLE = 1; // 井盖打开 + public final static int JG_ON_DISABLE = 0; // 井盖打开复位 + + private int jgon; + + public int getJgon() { + return jgon; + } + + public void setJgon(int jgon) { + this.jgon = jgon; + } + + @Override + public String getCommandType() { + return AppMessageConstants.CMD_TYPE_SETJGON; + } + + @Override + public Class getResponseClass() { + return WriteMemoryCommandResponse.class; + } + + @Override + public String toString() { + return "向终端[" + getDestinationId() + "]发送设置井盖开启位命令[" + jgon + "]"; + } +} diff --git a/src/com/szpg/plc/message/command/write/SetJgUnlockBitCommand.java b/src/com/szpg/plc/message/command/write/SetJgUnlockBitCommand.java index e3898b4..cfe7a6b 100644 --- a/src/com/szpg/plc/message/command/write/SetJgUnlockBitCommand.java +++ b/src/com/szpg/plc/message/command/write/SetJgUnlockBitCommand.java @@ -10,8 +10,7 @@ * */ private static final long serialVersionUID = 935723353287421429L; - - public final static int JG_LOCK = 0; //井盖锁定 + public final static int JG_UNLOCK = 1; //井盖解锁 private int unlock; diff --git a/src/com/szpg/plc/message/response/write/SetJgLockBitCommandResponse.java b/src/com/szpg/plc/message/response/write/SetJgLockBitCommandResponse.java new file mode 100644 index 0000000..adb5f9d --- /dev/null +++ b/src/com/szpg/plc/message/response/write/SetJgLockBitCommandResponse.java @@ -0,0 +1,29 @@ +package com.szpg.plc.message.response.write; + +import com.szpg.db.dao.PgDeviceDao; +import com.szpg.db.dao.PgJgDao; +import com.szpg.db.dao.impl.PgDeviceDaoImpl; +import com.szpg.db.dao.impl.PgJgDaoImpl; +import com.szpg.plc.message.response.WriteMemoryCommandResponse; +import org.apache.log4j.Logger; + +public class SetJgLockBitCommandResponse extends WriteMemoryCommandResponse { + + private final Logger logger = Logger.getLogger(this.getClass().getName()); + + private PgJgDao jgDao = new PgJgDaoImpl(); + private PgDeviceDao deviceDao = new PgDeviceDaoImpl(); + + @Override + public void afterAction() { + if (this.isSuccess() == true) { + // 更新设备状态 锁定 + int deviceId = deviceDao.findDeviceIdByCode(this.getDestinationId()); + if (deviceId > 0) { + jgDao.updateDeviceStatus(deviceId, "0"); + } + + logger.info("[" + this.getAcucode() + "]锁定井盖成功"); + } + } +} diff --git a/src/com/szpg/plc/message/response/write/SetJgOffBitCommandResponse.java b/src/com/szpg/plc/message/response/write/SetJgOffBitCommandResponse.java new file mode 100644 index 0000000..f10831c --- /dev/null +++ b/src/com/szpg/plc/message/response/write/SetJgOffBitCommandResponse.java @@ -0,0 +1,29 @@ +package com.szpg.plc.message.response.write; + +import com.szpg.db.dao.PgDeviceDao; +import com.szpg.db.dao.PgJgDao; +import com.szpg.db.dao.impl.PgDeviceDaoImpl; +import com.szpg.db.dao.impl.PgJgDaoImpl; +import com.szpg.plc.message.response.WriteMemoryCommandResponse; +import org.apache.log4j.Logger; + +public class SetJgOffBitCommandResponse extends WriteMemoryCommandResponse { + + private final Logger logger = Logger.getLogger(this.getClass().getName()); + + private PgJgDao jgDao = new PgJgDaoImpl(); + private PgDeviceDao deviceDao = new PgDeviceDaoImpl(); + + @Override + public void afterAction() { + if (this.isSuccess() == true) { + // 更新设备状态 关 + int deviceId = deviceDao.findDeviceIdByCode(this.getDestinationId()); + if (deviceId > 0) { + jgDao.updateDeviceStatus(deviceId, "0"); + } + + logger.info("[" + this.getAcucode() + "]关闭井盖成功"); + } + } +} diff --git a/src/com/szpg/plc/message/response/write/SetJgOnBitCommandResponse.java b/src/com/szpg/plc/message/response/write/SetJgOnBitCommandResponse.java new file mode 100644 index 0000000..35eb98c --- /dev/null +++ b/src/com/szpg/plc/message/response/write/SetJgOnBitCommandResponse.java @@ -0,0 +1,29 @@ +package com.szpg.plc.message.response.write; + +import com.szpg.db.dao.PgDeviceDao; +import com.szpg.db.dao.PgJgDao; +import com.szpg.db.dao.impl.PgDeviceDaoImpl; +import com.szpg.db.dao.impl.PgJgDaoImpl; +import com.szpg.plc.message.response.WriteMemoryCommandResponse; +import org.apache.log4j.Logger; + +public class SetJgOnBitCommandResponse extends WriteMemoryCommandResponse { + + private final Logger logger = Logger.getLogger(this.getClass().getName()); + + private PgJgDao jgDao = new PgJgDaoImpl(); + private PgDeviceDao deviceDao = new PgDeviceDaoImpl(); + + @Override + public void afterAction() { + if (this.isSuccess() == true) { + // 更新设备状态 开 + int deviceId = deviceDao.findDeviceIdByCode(this.getDestinationId()); + if (deviceId > 0) { + jgDao.updateDeviceStatus(deviceId, "1"); + } + + logger.info("[" + this.getAcucode() + "]打开井盖成功"); + } + } +} diff --git a/src/com/szpg/plc/message/response/write/SetJgUnlockBitCommandResponse.java b/src/com/szpg/plc/message/response/write/SetJgUnlockBitCommandResponse.java new file mode 100644 index 0000000..1575f09 --- /dev/null +++ b/src/com/szpg/plc/message/response/write/SetJgUnlockBitCommandResponse.java @@ -0,0 +1,30 @@ +package com.szpg.plc.message.response.write; + +import com.szpg.db.dao.PgDeviceDao; +import com.szpg.db.dao.PgJgDao; +import com.szpg.db.dao.impl.PgDeviceDaoImpl; +import com.szpg.db.dao.impl.PgJgDaoImpl; +import com.szpg.plc.message.command.write.SetJgUnlockBitCommand; +import com.szpg.plc.message.response.WriteMemoryCommandResponse; +import org.apache.log4j.Logger; + +public class SetJgUnlockBitCommandResponse extends WriteMemoryCommandResponse { + + private final Logger logger = Logger.getLogger(this.getClass().getName()); + + private PgJgDao jgDao = new PgJgDaoImpl(); + private PgDeviceDao deviceDao = new PgDeviceDaoImpl(); + + @Override + public void afterAction() { + if (this.isSuccess() == true) { + // 更新设备状态 解锁 + int deviceId = deviceDao.findDeviceIdByCode(this.getDestinationId()); + if (deviceId > 0) { + jgDao.updateDeviceStatus(deviceId, "1"); + } + + logger.info("[" + this.getAcucode() + "]解锁井盖成功"); + } + } +} diff --git a/src/com/szpg/plc/message/response/write/SetZmOffBitCommandResponse.java b/src/com/szpg/plc/message/response/write/SetZmOffBitCommandResponse.java new file mode 100644 index 0000000..bd36ece --- /dev/null +++ b/src/com/szpg/plc/message/response/write/SetZmOffBitCommandResponse.java @@ -0,0 +1,29 @@ +package com.szpg.plc.message.response.write; + +import com.szpg.db.dao.PgDeviceDao; +import com.szpg.db.dao.PgJgDao; +import com.szpg.db.dao.impl.PgDeviceDaoImpl; +import com.szpg.db.dao.impl.PgJgDaoImpl; +import com.szpg.plc.message.response.WriteMemoryCommandResponse; +import org.apache.log4j.Logger; + +public class SetZmOffBitCommandResponse extends WriteMemoryCommandResponse { + + private final Logger logger = Logger.getLogger(this.getClass().getName()); + + private PgJgDao jgDao = new PgJgDaoImpl(); + private PgDeviceDao deviceDao = new PgDeviceDaoImpl(); + + @Override + public void afterAction() { + if (this.isSuccess() == true) { + // 更新设备状态 关 + int deviceId = deviceDao.findDeviceIdByCode(this.getDestinationId()); + if (deviceId > 0) { + jgDao.updateDeviceStatus(deviceId, "0"); + } + + logger.info("[" + this.getAcucode() + "]关闭照明成功"); + } + } +} diff --git a/src/com/szpg/plc/message/response/write/SetZmOnBitCommandResponse.java b/src/com/szpg/plc/message/response/write/SetZmOnBitCommandResponse.java new file mode 100644 index 0000000..61822b8 --- /dev/null +++ b/src/com/szpg/plc/message/response/write/SetZmOnBitCommandResponse.java @@ -0,0 +1,29 @@ +package com.szpg.plc.message.response.write; + +import com.szpg.db.dao.PgDeviceDao; +import com.szpg.db.dao.PgJgDao; +import com.szpg.db.dao.impl.PgDeviceDaoImpl; +import com.szpg.db.dao.impl.PgJgDaoImpl; +import com.szpg.plc.message.response.WriteMemoryCommandResponse; +import org.apache.log4j.Logger; + +public class SetZmOnBitCommandResponse extends WriteMemoryCommandResponse { + + private final Logger logger = Logger.getLogger(this.getClass().getName()); + + private PgJgDao jgDao = new PgJgDaoImpl(); + private PgDeviceDao deviceDao = new PgDeviceDaoImpl(); + + @Override + public void afterAction() { + if (this.isSuccess() == true) { + // 更新设备状态 开 + int deviceId = deviceDao.findDeviceIdByCode(this.getDestinationId()); + if (deviceId > 0) { + jgDao.updateDeviceStatus(deviceId, "1"); + } + + logger.info("[" + this.getAcucode() + "]打开照明成功"); + } + } +} diff --git a/src/com/szpg/plc/server/ACUClientHandler.java b/src/com/szpg/plc/server/ACUClientHandler.java index cab8a25..c61c664 100644 --- a/src/com/szpg/plc/server/ACUClientHandler.java +++ b/src/com/szpg/plc/server/ACUClientHandler.java @@ -109,6 +109,7 @@ if (null != cmd) { rmcr.setAcucode(cmd.getDest_acu_code()); rmcr.setCmdId(cmd.getId()); + rmcr.setDestinationId(cmd.getDevice_code()); // 用设备资产编号赋值给目标地址 // 字节流已解析 diff --git a/src/com/szpg/rmi/RemoteFJCommandAction.java b/src/com/szpg/rmi/RemoteFJCommandAction.java index 8114c3a..82ddf09 100644 --- a/src/com/szpg/rmi/RemoteFJCommandAction.java +++ b/src/com/szpg/rmi/RemoteFJCommandAction.java @@ -197,9 +197,9 @@ // 目标地址 String dest = client.getNet() + client.getNode() + client.getUnit(); - + DTProtocolInterface finspi = ProtocolFactory.getDefaultDTProtocol(); - + // 1首先将停止位置0 // 该逻辑取消,由设备自行控制 @@ -210,7 +210,7 @@ setOnCmd.setMessageProducerHost(client.getHost()); RemoteDeviceControlService service = new RemoteDeviceControlService(); - service.executeService(client, setOnCmd); + service.executeService(client, setOnCmd, zcbh); Logger.getLogger(this.getClass().getName()).info(setOnCmd); } else { @@ -303,7 +303,7 @@ setOffCmd.setMessageProducerHost(client.getHost()); RemoteDeviceControlService service = new RemoteDeviceControlService(); - service.executeService(client, setOffCmd); + service.executeService(client, setOffCmd, zcbh); Logger.getLogger(this.getClass().getName()).info(setOffCmd); } else { diff --git a/src/ACUBL.properties b/src/ACUBL.properties index 9c4b0ab..df9ffdb 100644 --- a/src/ACUBL.properties +++ b/src/ACUBL.properties @@ -1,6 +1,6 @@ #ACU\u53D8\u91CF\u8868\u914D\u7F6E\u6587\u4EF6 -######## THXC.ACU001 ######## +######## 01 HXC.ACU001 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU001.CH.COUNT = 6 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -144,7 +144,7 @@ -######## THXC.ACU002 ######## +######## 02 THXC.ACU002 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU002.CH.COUNT = 6 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -288,7 +288,7 @@ -######## THXC.ACU003 ######## +######## 03 THXC.ACU003 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU003.CH.COUNT = 6 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -432,7 +432,7 @@ -######## THXC.ACU004 ######## +######## 04 THXC.ACU004 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU004.CH.COUNT = 6 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -576,7 +576,7 @@ -######## THXC.ACU005 ######## +######## 05 THXC.ACU005 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU005.CH.COUNT = 6 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -720,7 +720,7 @@ -######## THXC.ACU006 ######## +######## 06 THXC.ACU006 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU006.CH.COUNT = 6 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -812,7 +812,7 @@ #\u98CE\u673A\u6570\u91CF -THXC.ACU006.FJ.COUNT = 9 +THXC.ACU006.FJ.COUNT = 6 #\u98CE\u673A\u7F16\u7801\u5217\u8868 THXC.ACU006.FJ.ZC.LIST = THXC.ACU006.F.DFJ01;THXC.ACU006.F.DFJ02;THXC.ACU006.F.SFJ01;THXC.ACU006.F.SFJ02;THXC.ACU006.F.RFJ01;THXC.ACU006.F.RFJ02 #\u98CE\u673A\u72B6\u6001\u8D77\u59CB\u5730\u5740 @@ -864,7 +864,7 @@ -######## THXC.ACU008 ######## +######## 07 THXC.ACU008 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU008.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -1008,7 +1008,7 @@ -######## THXC.ACU009 ######## +######## 08 THXC.ACU009 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU009.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -1152,7 +1152,7 @@ -######## THXC.ACU010 ######## +######## 09 THXC.ACU010 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU010.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -1296,7 +1296,7 @@ -######## THXC.ACU011 ######## +######## 10 THXC.ACU011 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU011.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -1440,7 +1440,7 @@ -######## THXC.ACU013 ######## +######## 11 THXC.ACU013 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU013.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -1584,7 +1584,7 @@ -######## THXC.ACU014 ######## +######## 12 THXC.ACU014 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU014.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -1729,7 +1729,7 @@ -######## THXC.ACU015 ######## +######## 13 THXC.ACU015 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU015.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -1874,7 +1874,7 @@ -######## THXC.ACU016 ######## +######## 14 THXC.ACU016 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU016.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2020,7 +2020,7 @@ ######## \u4E8C\u671F\u4E09\u6807\u6BB5 ######## -######## THXC.ACU301 ######## +######## 01 THXC.ACU301 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU301.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2070,7 +2070,7 @@ -######## THXC.ACU302 ######## +######## 02 THXC.ACU302 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU302.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2083,7 +2083,7 @@ -######## THXC.ACU303 ######## +######## 03 THXC.ACU303 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU303.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2096,7 +2096,7 @@ -######## THXC.ACU304 ######## +######## 04 THXC.ACU304 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU304.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2109,7 +2109,7 @@ -######## THXC.ACU305 ######## +######## 05 THXC.ACU305 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU305.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2122,7 +2122,7 @@ -######## THXC.ACU501 ######## +######## 06 THXC.ACU501 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU501.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2135,7 +2135,7 @@ -######## THXC.ACU502 ######## +######## 07 THXC.ACU502 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU502.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2148,7 +2148,7 @@ -######## THXC.ACU503 ######## +######## 08 THXC.ACU503 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU503.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2161,7 +2161,7 @@ -######## THXC.ACU504 ######## +######## 09 THXC.ACU504 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU504.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2174,7 +2174,7 @@ -######## THXC.ACU505 ######## +######## 10 THXC.ACU505 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU505.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2187,7 +2187,7 @@ -######## THXC.ACU506 ######## +######## 11 THXC.ACU506 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU506.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2200,7 +2200,7 @@ -######## THXC.ACU507 ######## +######## 12 THXC.ACU507 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU507.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2213,7 +2213,7 @@ -######## THXC.ACU601 ######## +######## 13 THXC.ACU601 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU601.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2226,7 +2226,7 @@ -######## THXC.ACU602 ######## +######## 14 THXC.ACU602 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU602.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2239,7 +2239,7 @@ -######## THXC.ACU603 ######## +######## 15 THXC.ACU603 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU603.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2252,7 +2252,7 @@ -######## THXC.ACU604 ######## +######## 16 THXC.ACU604 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU604.WSYQ.COUNT = 6 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2265,7 +2265,7 @@ -######## THXC.ACUS03 ######## +######## 17 THXC.ACUS03 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACUS03.WSYQ.COUNT = 2 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2278,7 +2278,7 @@ -######## THXC.ACUS05 ######## +######## 18 THXC.ACUS05 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACUS05.WSYQ.COUNT = 2 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2291,7 +2291,7 @@ -######## THXC.ACUS06 ######## +######## 19 THXC.ACUS06 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACUS06.WSYQ.COUNT = 2 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2304,6 +2304,103 @@ +######## \u4E8C\u671F\u56DB\u6807\u6BB5 ######## +######## 01 THXC.ACU107 ######## + + +######## 02 THXC.ACU108 ######## + + +######## 03 THXC.ACU109 ######## + + +######## 04 THXC.ACU110 ######## + + +######## 05 THXC.ACU306 ######## + + +######## 06 THXC.ACU307 ######## + + +######## 07 THXC.ACU308 ######## + + +######## 08 THXC.ACU309 ######## + + +######## 09 THXC.ACU401 ######## + + +######## 10 THXC.ACU402 ######## + + +######## 11 THXC.ACU403 ######## + + +######## 12 THXC.ACU404 ######## + + +######## 13 THXC.ACU405 ######## + + +######## 14 THXC.ACU406 ######## + + +######## 15 THXC.ACU407 ######## + + +######## 16 THXC.ACU408 ######## + + +######## 17 THXC.ACUS04 ######## + + +######## 18 THXC.ACU701 ######## + + +######## 19 THXC.ACU702 ######## + + +######## 20 THXC.ACU703 ######## + + +######## 21 THXC.ACU704 ######## + + +######## 22 THXC.ACU705 ######## + + +######## 23 THXC.ACU706 ######## + + +######## 24 THXC.ACU801 ######## + + +######## 25 THXC.ACU802 ######## + + +######## 26 THXC.ACU803 ######## + + +######## 27 THXC.ACU804 ######## + + +######## 28 THXC.ACU805 ######## + + +######## 29 THXC.ACU806 ######## + + +######## 30 THXC.ACU807 ######## + + +######## 31 THXC.ACUS07 ######## + + +######## 32 THXC.ACUS08 ######## + + ######## \u9F99\u7FD4\u8DEF\u71C3\u6C14\u6BB5 THXC.ACU801 ######## #\u98CE\u673A\u6570\u91CF THXC.ACU801.FJ.COUNT = 1 diff --git a/src/com/szpg/db/dao/impl/PgAcuCmdDaoImpl.java b/src/com/szpg/db/dao/impl/PgAcuCmdDaoImpl.java index b752a9c..406d9ee 100644 --- a/src/com/szpg/db/dao/impl/PgAcuCmdDaoImpl.java +++ b/src/com/szpg/db/dao/impl/PgAcuCmdDaoImpl.java @@ -154,13 +154,14 @@ Connection conn = null; String insertStr = "INSERT INTO PG_ACU_CMD " + - "(ID, TM, CMD_TYPE, DEST_ACU_CODE, TIMEOUT) " + - "VALUES (?, TO_DATE(?, 'YYYYMMDDHH24MISS'), ?, ?, '0')"; - Object[] params = new Object[4]; + "(ID, TM, CMD_TYPE, DEST_ACU_CODE, TIMEOUT, DEVICE_CODE) " + + "VALUES (?, TO_DATE(?, 'YYYYMMDDHH24MISS'), ?, ?, '0', ?)"; + Object[] params = new Object[5]; params[0] = cmd.getId(); params[1] = TimeFormat.format(cmd.getTm(), "yyyyMMddHHmmss"); params[2] = cmd.getCmd_type(); params[3] = cmd.getDest_acu_code(); + params[4] = cmd.getDevice_code(); try { conn = ConnectionManager.getConnectionFromC3P0(); diff --git a/src/com/szpg/db/data/PgAcuCmd.java b/src/com/szpg/db/data/PgAcuCmd.java index 9e57628..0f3cabc 100644 --- a/src/com/szpg/db/data/PgAcuCmd.java +++ b/src/com/szpg/db/data/PgAcuCmd.java @@ -23,6 +23,7 @@ private Date tm; // 命令发送时间 private String cmd_type; // 命令类型 private String dest_acu_code; // 目标ACU代码 + private String device_code; // 命令的资产编号 private boolean timeout; // 是否超时 public PgAcuCmd() { @@ -62,6 +63,14 @@ this.dest_acu_code = dest_acu_code; } + public String getDevice_code() { + return device_code; + } + + public void setDevice_code(String device_code) { + this.device_code = device_code; + } + public boolean isTimeout() { return timeout; } diff --git a/src/com/szpg/plc/PGDSCServlet.java b/src/com/szpg/plc/PGDSCServlet.java index 5653eb6..881c2e3 100644 --- a/src/com/szpg/plc/PGDSCServlet.java +++ b/src/com/szpg/plc/PGDSCServlet.java @@ -104,13 +104,13 @@ sendQueryJGStatusCommand(); //10巡检数据同步 - synchAssetInSpection(); +// synchAssetInSpection(); //运维数据同步 - synchMaintanceRecord(); +// synchMaintanceRecord(); // 查询二期温湿度氧气实时数据 - sendQueryWSYQValueCommand(); +// sendQueryWSYQValueCommand(); } /** diff --git a/src/com/szpg/plc/message/command/write/SetJgLockBitCommand.java b/src/com/szpg/plc/message/command/write/SetJgLockBitCommand.java new file mode 100644 index 0000000..f4bc55a --- /dev/null +++ b/src/com/szpg/plc/message/command/write/SetJgLockBitCommand.java @@ -0,0 +1,40 @@ +package com.szpg.plc.message.command.write; + +import com.szpg.plc.message.AppMessageConstants; +import com.szpg.plc.message.command.WriteMemoryCommand; +import com.szpg.plc.message.response.WriteMemoryCommandResponse; + +public class SetJgLockBitCommand extends WriteMemoryCommand { + + /** + * + */ + private static final long serialVersionUID = 935723353287421429L; + + public final static int JG_LOCK = 0; //井盖锁定 + + private int unlock; + + public int getUnlock() { + return unlock; + } + + public void setUnlock(int unlock) { + this.unlock = unlock; + } + + @Override + public String getCommandType() { + return AppMessageConstants.CMD_TYPE_SETJGLOCK; + } + + @Override + public Class getResponseClass() { + return WriteMemoryCommandResponse.class; + } + + @Override + public String toString() { + return "向终端[" + getDestinationId() + "]发送设置井盖锁定命令"; + } +} diff --git a/src/com/szpg/plc/message/command/write/SetJgOffBitCommand.java b/src/com/szpg/plc/message/command/write/SetJgOffBitCommand.java new file mode 100644 index 0000000..185804c --- /dev/null +++ b/src/com/szpg/plc/message/command/write/SetJgOffBitCommand.java @@ -0,0 +1,41 @@ +package com.szpg.plc.message.command.write; + +import com.szpg.plc.message.AppMessageConstants; +import com.szpg.plc.message.command.WriteMemoryCommand; +import com.szpg.plc.message.response.WriteMemoryCommandResponse; + +public class SetJgOffBitCommand extends WriteMemoryCommand { + + /** + * + */ + private static final long serialVersionUID = 935723353287421429L; + + public final static int JG_OFF_ENABLE = 1; // 井盖关闭 + public final static int JG_OFF_DISABLE = 0; // 井盖关闭复位 + + private int jgoff; + + public int getJgoff() { + return jgoff; + } + + public void setJgoff(int jgoff) { + this.jgoff = jgoff; + } + + @Override + public String getCommandType() { + return AppMessageConstants.CMD_TYPE_SETJGOFF; + } + + @Override + public Class getResponseClass() { + return WriteMemoryCommandResponse.class; + } + + @Override + public String toString() { + return "向终端[" + getDestinationId() + "]发送设置井盖关闭位命令[" + jgoff + "]"; + } +} diff --git a/src/com/szpg/plc/message/command/write/SetJgOnBitCommand.java b/src/com/szpg/plc/message/command/write/SetJgOnBitCommand.java new file mode 100644 index 0000000..b63cf19 --- /dev/null +++ b/src/com/szpg/plc/message/command/write/SetJgOnBitCommand.java @@ -0,0 +1,41 @@ +package com.szpg.plc.message.command.write; + +import com.szpg.plc.message.AppMessageConstants; +import com.szpg.plc.message.command.WriteMemoryCommand; +import com.szpg.plc.message.response.WriteMemoryCommandResponse; + +public class SetJgOnBitCommand extends WriteMemoryCommand { + + /** + * + */ + private static final long serialVersionUID = 935723353287421429L; + + public final static int JG_ON_ENABLE = 1; // 井盖打开 + public final static int JG_ON_DISABLE = 0; // 井盖打开复位 + + private int jgon; + + public int getJgon() { + return jgon; + } + + public void setJgon(int jgon) { + this.jgon = jgon; + } + + @Override + public String getCommandType() { + return AppMessageConstants.CMD_TYPE_SETJGON; + } + + @Override + public Class getResponseClass() { + return WriteMemoryCommandResponse.class; + } + + @Override + public String toString() { + return "向终端[" + getDestinationId() + "]发送设置井盖开启位命令[" + jgon + "]"; + } +} diff --git a/src/com/szpg/plc/message/command/write/SetJgUnlockBitCommand.java b/src/com/szpg/plc/message/command/write/SetJgUnlockBitCommand.java index e3898b4..cfe7a6b 100644 --- a/src/com/szpg/plc/message/command/write/SetJgUnlockBitCommand.java +++ b/src/com/szpg/plc/message/command/write/SetJgUnlockBitCommand.java @@ -10,8 +10,7 @@ * */ private static final long serialVersionUID = 935723353287421429L; - - public final static int JG_LOCK = 0; //井盖锁定 + public final static int JG_UNLOCK = 1; //井盖解锁 private int unlock; diff --git a/src/com/szpg/plc/message/response/write/SetJgLockBitCommandResponse.java b/src/com/szpg/plc/message/response/write/SetJgLockBitCommandResponse.java new file mode 100644 index 0000000..adb5f9d --- /dev/null +++ b/src/com/szpg/plc/message/response/write/SetJgLockBitCommandResponse.java @@ -0,0 +1,29 @@ +package com.szpg.plc.message.response.write; + +import com.szpg.db.dao.PgDeviceDao; +import com.szpg.db.dao.PgJgDao; +import com.szpg.db.dao.impl.PgDeviceDaoImpl; +import com.szpg.db.dao.impl.PgJgDaoImpl; +import com.szpg.plc.message.response.WriteMemoryCommandResponse; +import org.apache.log4j.Logger; + +public class SetJgLockBitCommandResponse extends WriteMemoryCommandResponse { + + private final Logger logger = Logger.getLogger(this.getClass().getName()); + + private PgJgDao jgDao = new PgJgDaoImpl(); + private PgDeviceDao deviceDao = new PgDeviceDaoImpl(); + + @Override + public void afterAction() { + if (this.isSuccess() == true) { + // 更新设备状态 锁定 + int deviceId = deviceDao.findDeviceIdByCode(this.getDestinationId()); + if (deviceId > 0) { + jgDao.updateDeviceStatus(deviceId, "0"); + } + + logger.info("[" + this.getAcucode() + "]锁定井盖成功"); + } + } +} diff --git a/src/com/szpg/plc/message/response/write/SetJgOffBitCommandResponse.java b/src/com/szpg/plc/message/response/write/SetJgOffBitCommandResponse.java new file mode 100644 index 0000000..f10831c --- /dev/null +++ b/src/com/szpg/plc/message/response/write/SetJgOffBitCommandResponse.java @@ -0,0 +1,29 @@ +package com.szpg.plc.message.response.write; + +import com.szpg.db.dao.PgDeviceDao; +import com.szpg.db.dao.PgJgDao; +import com.szpg.db.dao.impl.PgDeviceDaoImpl; +import com.szpg.db.dao.impl.PgJgDaoImpl; +import com.szpg.plc.message.response.WriteMemoryCommandResponse; +import org.apache.log4j.Logger; + +public class SetJgOffBitCommandResponse extends WriteMemoryCommandResponse { + + private final Logger logger = Logger.getLogger(this.getClass().getName()); + + private PgJgDao jgDao = new PgJgDaoImpl(); + private PgDeviceDao deviceDao = new PgDeviceDaoImpl(); + + @Override + public void afterAction() { + if (this.isSuccess() == true) { + // 更新设备状态 关 + int deviceId = deviceDao.findDeviceIdByCode(this.getDestinationId()); + if (deviceId > 0) { + jgDao.updateDeviceStatus(deviceId, "0"); + } + + logger.info("[" + this.getAcucode() + "]关闭井盖成功"); + } + } +} diff --git a/src/com/szpg/plc/message/response/write/SetJgOnBitCommandResponse.java b/src/com/szpg/plc/message/response/write/SetJgOnBitCommandResponse.java new file mode 100644 index 0000000..35eb98c --- /dev/null +++ b/src/com/szpg/plc/message/response/write/SetJgOnBitCommandResponse.java @@ -0,0 +1,29 @@ +package com.szpg.plc.message.response.write; + +import com.szpg.db.dao.PgDeviceDao; +import com.szpg.db.dao.PgJgDao; +import com.szpg.db.dao.impl.PgDeviceDaoImpl; +import com.szpg.db.dao.impl.PgJgDaoImpl; +import com.szpg.plc.message.response.WriteMemoryCommandResponse; +import org.apache.log4j.Logger; + +public class SetJgOnBitCommandResponse extends WriteMemoryCommandResponse { + + private final Logger logger = Logger.getLogger(this.getClass().getName()); + + private PgJgDao jgDao = new PgJgDaoImpl(); + private PgDeviceDao deviceDao = new PgDeviceDaoImpl(); + + @Override + public void afterAction() { + if (this.isSuccess() == true) { + // 更新设备状态 开 + int deviceId = deviceDao.findDeviceIdByCode(this.getDestinationId()); + if (deviceId > 0) { + jgDao.updateDeviceStatus(deviceId, "1"); + } + + logger.info("[" + this.getAcucode() + "]打开井盖成功"); + } + } +} diff --git a/src/com/szpg/plc/message/response/write/SetJgUnlockBitCommandResponse.java b/src/com/szpg/plc/message/response/write/SetJgUnlockBitCommandResponse.java new file mode 100644 index 0000000..1575f09 --- /dev/null +++ b/src/com/szpg/plc/message/response/write/SetJgUnlockBitCommandResponse.java @@ -0,0 +1,30 @@ +package com.szpg.plc.message.response.write; + +import com.szpg.db.dao.PgDeviceDao; +import com.szpg.db.dao.PgJgDao; +import com.szpg.db.dao.impl.PgDeviceDaoImpl; +import com.szpg.db.dao.impl.PgJgDaoImpl; +import com.szpg.plc.message.command.write.SetJgUnlockBitCommand; +import com.szpg.plc.message.response.WriteMemoryCommandResponse; +import org.apache.log4j.Logger; + +public class SetJgUnlockBitCommandResponse extends WriteMemoryCommandResponse { + + private final Logger logger = Logger.getLogger(this.getClass().getName()); + + private PgJgDao jgDao = new PgJgDaoImpl(); + private PgDeviceDao deviceDao = new PgDeviceDaoImpl(); + + @Override + public void afterAction() { + if (this.isSuccess() == true) { + // 更新设备状态 解锁 + int deviceId = deviceDao.findDeviceIdByCode(this.getDestinationId()); + if (deviceId > 0) { + jgDao.updateDeviceStatus(deviceId, "1"); + } + + logger.info("[" + this.getAcucode() + "]解锁井盖成功"); + } + } +} diff --git a/src/com/szpg/plc/message/response/write/SetZmOffBitCommandResponse.java b/src/com/szpg/plc/message/response/write/SetZmOffBitCommandResponse.java new file mode 100644 index 0000000..bd36ece --- /dev/null +++ b/src/com/szpg/plc/message/response/write/SetZmOffBitCommandResponse.java @@ -0,0 +1,29 @@ +package com.szpg.plc.message.response.write; + +import com.szpg.db.dao.PgDeviceDao; +import com.szpg.db.dao.PgJgDao; +import com.szpg.db.dao.impl.PgDeviceDaoImpl; +import com.szpg.db.dao.impl.PgJgDaoImpl; +import com.szpg.plc.message.response.WriteMemoryCommandResponse; +import org.apache.log4j.Logger; + +public class SetZmOffBitCommandResponse extends WriteMemoryCommandResponse { + + private final Logger logger = Logger.getLogger(this.getClass().getName()); + + private PgJgDao jgDao = new PgJgDaoImpl(); + private PgDeviceDao deviceDao = new PgDeviceDaoImpl(); + + @Override + public void afterAction() { + if (this.isSuccess() == true) { + // 更新设备状态 关 + int deviceId = deviceDao.findDeviceIdByCode(this.getDestinationId()); + if (deviceId > 0) { + jgDao.updateDeviceStatus(deviceId, "0"); + } + + logger.info("[" + this.getAcucode() + "]关闭照明成功"); + } + } +} diff --git a/src/com/szpg/plc/message/response/write/SetZmOnBitCommandResponse.java b/src/com/szpg/plc/message/response/write/SetZmOnBitCommandResponse.java new file mode 100644 index 0000000..61822b8 --- /dev/null +++ b/src/com/szpg/plc/message/response/write/SetZmOnBitCommandResponse.java @@ -0,0 +1,29 @@ +package com.szpg.plc.message.response.write; + +import com.szpg.db.dao.PgDeviceDao; +import com.szpg.db.dao.PgJgDao; +import com.szpg.db.dao.impl.PgDeviceDaoImpl; +import com.szpg.db.dao.impl.PgJgDaoImpl; +import com.szpg.plc.message.response.WriteMemoryCommandResponse; +import org.apache.log4j.Logger; + +public class SetZmOnBitCommandResponse extends WriteMemoryCommandResponse { + + private final Logger logger = Logger.getLogger(this.getClass().getName()); + + private PgJgDao jgDao = new PgJgDaoImpl(); + private PgDeviceDao deviceDao = new PgDeviceDaoImpl(); + + @Override + public void afterAction() { + if (this.isSuccess() == true) { + // 更新设备状态 开 + int deviceId = deviceDao.findDeviceIdByCode(this.getDestinationId()); + if (deviceId > 0) { + jgDao.updateDeviceStatus(deviceId, "1"); + } + + logger.info("[" + this.getAcucode() + "]打开照明成功"); + } + } +} diff --git a/src/com/szpg/plc/server/ACUClientHandler.java b/src/com/szpg/plc/server/ACUClientHandler.java index cab8a25..c61c664 100644 --- a/src/com/szpg/plc/server/ACUClientHandler.java +++ b/src/com/szpg/plc/server/ACUClientHandler.java @@ -109,6 +109,7 @@ if (null != cmd) { rmcr.setAcucode(cmd.getDest_acu_code()); rmcr.setCmdId(cmd.getId()); + rmcr.setDestinationId(cmd.getDevice_code()); // 用设备资产编号赋值给目标地址 // 字节流已解析 diff --git a/src/com/szpg/rmi/RemoteFJCommandAction.java b/src/com/szpg/rmi/RemoteFJCommandAction.java index 8114c3a..82ddf09 100644 --- a/src/com/szpg/rmi/RemoteFJCommandAction.java +++ b/src/com/szpg/rmi/RemoteFJCommandAction.java @@ -197,9 +197,9 @@ // 目标地址 String dest = client.getNet() + client.getNode() + client.getUnit(); - + DTProtocolInterface finspi = ProtocolFactory.getDefaultDTProtocol(); - + // 1首先将停止位置0 // 该逻辑取消,由设备自行控制 @@ -210,7 +210,7 @@ setOnCmd.setMessageProducerHost(client.getHost()); RemoteDeviceControlService service = new RemoteDeviceControlService(); - service.executeService(client, setOnCmd); + service.executeService(client, setOnCmd, zcbh); Logger.getLogger(this.getClass().getName()).info(setOnCmd); } else { @@ -303,7 +303,7 @@ setOffCmd.setMessageProducerHost(client.getHost()); RemoteDeviceControlService service = new RemoteDeviceControlService(); - service.executeService(client, setOffCmd); + service.executeService(client, setOffCmd, zcbh); Logger.getLogger(this.getClass().getName()).info(setOffCmd); } else { diff --git a/src/com/szpg/rmi/RemoteZMCommandAction.java b/src/com/szpg/rmi/RemoteZMCommandAction.java index 90dbf9a..e934b0e 100644 --- a/src/com/szpg/rmi/RemoteZMCommandAction.java +++ b/src/com/szpg/rmi/RemoteZMCommandAction.java @@ -206,7 +206,7 @@ setOnCmd.setMessageProducerHost(client.getHost()); RemoteDeviceControlService service = new RemoteDeviceControlService(); - service.executeService(client, setOnCmd); + service.executeService(client, setOnCmd, zcbh); Logger.getLogger(this.getClass().getName()).info(setOnCmd); } else { @@ -299,7 +299,7 @@ setOffCmd.setMessageProducerHost(client.getHost()); RemoteDeviceControlService service = new RemoteDeviceControlService(); - service.executeService(client, setOffCmd); + service.executeService(client, setOffCmd, zcbh); Logger.getLogger(this.getClass().getName()).info(setOffCmd); } else { diff --git a/src/ACUBL.properties b/src/ACUBL.properties index 9c4b0ab..df9ffdb 100644 --- a/src/ACUBL.properties +++ b/src/ACUBL.properties @@ -1,6 +1,6 @@ #ACU\u53D8\u91CF\u8868\u914D\u7F6E\u6587\u4EF6 -######## THXC.ACU001 ######## +######## 01 HXC.ACU001 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU001.CH.COUNT = 6 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -144,7 +144,7 @@ -######## THXC.ACU002 ######## +######## 02 THXC.ACU002 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU002.CH.COUNT = 6 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -288,7 +288,7 @@ -######## THXC.ACU003 ######## +######## 03 THXC.ACU003 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU003.CH.COUNT = 6 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -432,7 +432,7 @@ -######## THXC.ACU004 ######## +######## 04 THXC.ACU004 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU004.CH.COUNT = 6 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -576,7 +576,7 @@ -######## THXC.ACU005 ######## +######## 05 THXC.ACU005 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU005.CH.COUNT = 6 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -720,7 +720,7 @@ -######## THXC.ACU006 ######## +######## 06 THXC.ACU006 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU006.CH.COUNT = 6 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -812,7 +812,7 @@ #\u98CE\u673A\u6570\u91CF -THXC.ACU006.FJ.COUNT = 9 +THXC.ACU006.FJ.COUNT = 6 #\u98CE\u673A\u7F16\u7801\u5217\u8868 THXC.ACU006.FJ.ZC.LIST = THXC.ACU006.F.DFJ01;THXC.ACU006.F.DFJ02;THXC.ACU006.F.SFJ01;THXC.ACU006.F.SFJ02;THXC.ACU006.F.RFJ01;THXC.ACU006.F.RFJ02 #\u98CE\u673A\u72B6\u6001\u8D77\u59CB\u5730\u5740 @@ -864,7 +864,7 @@ -######## THXC.ACU008 ######## +######## 07 THXC.ACU008 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU008.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -1008,7 +1008,7 @@ -######## THXC.ACU009 ######## +######## 08 THXC.ACU009 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU009.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -1152,7 +1152,7 @@ -######## THXC.ACU010 ######## +######## 09 THXC.ACU010 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU010.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -1296,7 +1296,7 @@ -######## THXC.ACU011 ######## +######## 10 THXC.ACU011 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU011.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -1440,7 +1440,7 @@ -######## THXC.ACU013 ######## +######## 11 THXC.ACU013 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU013.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -1584,7 +1584,7 @@ -######## THXC.ACU014 ######## +######## 12 THXC.ACU014 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU014.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -1729,7 +1729,7 @@ -######## THXC.ACU015 ######## +######## 13 THXC.ACU015 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU015.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -1874,7 +1874,7 @@ -######## THXC.ACU016 ######## +######## 14 THXC.ACU016 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU016.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2020,7 +2020,7 @@ ######## \u4E8C\u671F\u4E09\u6807\u6BB5 ######## -######## THXC.ACU301 ######## +######## 01 THXC.ACU301 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU301.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2070,7 +2070,7 @@ -######## THXC.ACU302 ######## +######## 02 THXC.ACU302 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU302.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2083,7 +2083,7 @@ -######## THXC.ACU303 ######## +######## 03 THXC.ACU303 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU303.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2096,7 +2096,7 @@ -######## THXC.ACU304 ######## +######## 04 THXC.ACU304 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU304.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2109,7 +2109,7 @@ -######## THXC.ACU305 ######## +######## 05 THXC.ACU305 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU305.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2122,7 +2122,7 @@ -######## THXC.ACU501 ######## +######## 06 THXC.ACU501 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU501.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2135,7 +2135,7 @@ -######## THXC.ACU502 ######## +######## 07 THXC.ACU502 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU502.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2148,7 +2148,7 @@ -######## THXC.ACU503 ######## +######## 08 THXC.ACU503 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU503.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2161,7 +2161,7 @@ -######## THXC.ACU504 ######## +######## 09 THXC.ACU504 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU504.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2174,7 +2174,7 @@ -######## THXC.ACU505 ######## +######## 10 THXC.ACU505 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU505.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2187,7 +2187,7 @@ -######## THXC.ACU506 ######## +######## 11 THXC.ACU506 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU506.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2200,7 +2200,7 @@ -######## THXC.ACU507 ######## +######## 12 THXC.ACU507 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU507.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2213,7 +2213,7 @@ -######## THXC.ACU601 ######## +######## 13 THXC.ACU601 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU601.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2226,7 +2226,7 @@ -######## THXC.ACU602 ######## +######## 14 THXC.ACU602 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU602.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2239,7 +2239,7 @@ -######## THXC.ACU603 ######## +######## 15 THXC.ACU603 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU603.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2252,7 +2252,7 @@ -######## THXC.ACU604 ######## +######## 16 THXC.ACU604 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU604.WSYQ.COUNT = 6 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2265,7 +2265,7 @@ -######## THXC.ACUS03 ######## +######## 17 THXC.ACUS03 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACUS03.WSYQ.COUNT = 2 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2278,7 +2278,7 @@ -######## THXC.ACUS05 ######## +######## 18 THXC.ACUS05 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACUS05.WSYQ.COUNT = 2 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2291,7 +2291,7 @@ -######## THXC.ACUS06 ######## +######## 19 THXC.ACUS06 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACUS06.WSYQ.COUNT = 2 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2304,6 +2304,103 @@ +######## \u4E8C\u671F\u56DB\u6807\u6BB5 ######## +######## 01 THXC.ACU107 ######## + + +######## 02 THXC.ACU108 ######## + + +######## 03 THXC.ACU109 ######## + + +######## 04 THXC.ACU110 ######## + + +######## 05 THXC.ACU306 ######## + + +######## 06 THXC.ACU307 ######## + + +######## 07 THXC.ACU308 ######## + + +######## 08 THXC.ACU309 ######## + + +######## 09 THXC.ACU401 ######## + + +######## 10 THXC.ACU402 ######## + + +######## 11 THXC.ACU403 ######## + + +######## 12 THXC.ACU404 ######## + + +######## 13 THXC.ACU405 ######## + + +######## 14 THXC.ACU406 ######## + + +######## 15 THXC.ACU407 ######## + + +######## 16 THXC.ACU408 ######## + + +######## 17 THXC.ACUS04 ######## + + +######## 18 THXC.ACU701 ######## + + +######## 19 THXC.ACU702 ######## + + +######## 20 THXC.ACU703 ######## + + +######## 21 THXC.ACU704 ######## + + +######## 22 THXC.ACU705 ######## + + +######## 23 THXC.ACU706 ######## + + +######## 24 THXC.ACU801 ######## + + +######## 25 THXC.ACU802 ######## + + +######## 26 THXC.ACU803 ######## + + +######## 27 THXC.ACU804 ######## + + +######## 28 THXC.ACU805 ######## + + +######## 29 THXC.ACU806 ######## + + +######## 30 THXC.ACU807 ######## + + +######## 31 THXC.ACUS07 ######## + + +######## 32 THXC.ACUS08 ######## + + ######## \u9F99\u7FD4\u8DEF\u71C3\u6C14\u6BB5 THXC.ACU801 ######## #\u98CE\u673A\u6570\u91CF THXC.ACU801.FJ.COUNT = 1 diff --git a/src/com/szpg/db/dao/impl/PgAcuCmdDaoImpl.java b/src/com/szpg/db/dao/impl/PgAcuCmdDaoImpl.java index b752a9c..406d9ee 100644 --- a/src/com/szpg/db/dao/impl/PgAcuCmdDaoImpl.java +++ b/src/com/szpg/db/dao/impl/PgAcuCmdDaoImpl.java @@ -154,13 +154,14 @@ Connection conn = null; String insertStr = "INSERT INTO PG_ACU_CMD " + - "(ID, TM, CMD_TYPE, DEST_ACU_CODE, TIMEOUT) " + - "VALUES (?, TO_DATE(?, 'YYYYMMDDHH24MISS'), ?, ?, '0')"; - Object[] params = new Object[4]; + "(ID, TM, CMD_TYPE, DEST_ACU_CODE, TIMEOUT, DEVICE_CODE) " + + "VALUES (?, TO_DATE(?, 'YYYYMMDDHH24MISS'), ?, ?, '0', ?)"; + Object[] params = new Object[5]; params[0] = cmd.getId(); params[1] = TimeFormat.format(cmd.getTm(), "yyyyMMddHHmmss"); params[2] = cmd.getCmd_type(); params[3] = cmd.getDest_acu_code(); + params[4] = cmd.getDevice_code(); try { conn = ConnectionManager.getConnectionFromC3P0(); diff --git a/src/com/szpg/db/data/PgAcuCmd.java b/src/com/szpg/db/data/PgAcuCmd.java index 9e57628..0f3cabc 100644 --- a/src/com/szpg/db/data/PgAcuCmd.java +++ b/src/com/szpg/db/data/PgAcuCmd.java @@ -23,6 +23,7 @@ private Date tm; // 命令发送时间 private String cmd_type; // 命令类型 private String dest_acu_code; // 目标ACU代码 + private String device_code; // 命令的资产编号 private boolean timeout; // 是否超时 public PgAcuCmd() { @@ -62,6 +63,14 @@ this.dest_acu_code = dest_acu_code; } + public String getDevice_code() { + return device_code; + } + + public void setDevice_code(String device_code) { + this.device_code = device_code; + } + public boolean isTimeout() { return timeout; } diff --git a/src/com/szpg/plc/PGDSCServlet.java b/src/com/szpg/plc/PGDSCServlet.java index 5653eb6..881c2e3 100644 --- a/src/com/szpg/plc/PGDSCServlet.java +++ b/src/com/szpg/plc/PGDSCServlet.java @@ -104,13 +104,13 @@ sendQueryJGStatusCommand(); //10巡检数据同步 - synchAssetInSpection(); +// synchAssetInSpection(); //运维数据同步 - synchMaintanceRecord(); +// synchMaintanceRecord(); // 查询二期温湿度氧气实时数据 - sendQueryWSYQValueCommand(); +// sendQueryWSYQValueCommand(); } /** diff --git a/src/com/szpg/plc/message/command/write/SetJgLockBitCommand.java b/src/com/szpg/plc/message/command/write/SetJgLockBitCommand.java new file mode 100644 index 0000000..f4bc55a --- /dev/null +++ b/src/com/szpg/plc/message/command/write/SetJgLockBitCommand.java @@ -0,0 +1,40 @@ +package com.szpg.plc.message.command.write; + +import com.szpg.plc.message.AppMessageConstants; +import com.szpg.plc.message.command.WriteMemoryCommand; +import com.szpg.plc.message.response.WriteMemoryCommandResponse; + +public class SetJgLockBitCommand extends WriteMemoryCommand { + + /** + * + */ + private static final long serialVersionUID = 935723353287421429L; + + public final static int JG_LOCK = 0; //井盖锁定 + + private int unlock; + + public int getUnlock() { + return unlock; + } + + public void setUnlock(int unlock) { + this.unlock = unlock; + } + + @Override + public String getCommandType() { + return AppMessageConstants.CMD_TYPE_SETJGLOCK; + } + + @Override + public Class getResponseClass() { + return WriteMemoryCommandResponse.class; + } + + @Override + public String toString() { + return "向终端[" + getDestinationId() + "]发送设置井盖锁定命令"; + } +} diff --git a/src/com/szpg/plc/message/command/write/SetJgOffBitCommand.java b/src/com/szpg/plc/message/command/write/SetJgOffBitCommand.java new file mode 100644 index 0000000..185804c --- /dev/null +++ b/src/com/szpg/plc/message/command/write/SetJgOffBitCommand.java @@ -0,0 +1,41 @@ +package com.szpg.plc.message.command.write; + +import com.szpg.plc.message.AppMessageConstants; +import com.szpg.plc.message.command.WriteMemoryCommand; +import com.szpg.plc.message.response.WriteMemoryCommandResponse; + +public class SetJgOffBitCommand extends WriteMemoryCommand { + + /** + * + */ + private static final long serialVersionUID = 935723353287421429L; + + public final static int JG_OFF_ENABLE = 1; // 井盖关闭 + public final static int JG_OFF_DISABLE = 0; // 井盖关闭复位 + + private int jgoff; + + public int getJgoff() { + return jgoff; + } + + public void setJgoff(int jgoff) { + this.jgoff = jgoff; + } + + @Override + public String getCommandType() { + return AppMessageConstants.CMD_TYPE_SETJGOFF; + } + + @Override + public Class getResponseClass() { + return WriteMemoryCommandResponse.class; + } + + @Override + public String toString() { + return "向终端[" + getDestinationId() + "]发送设置井盖关闭位命令[" + jgoff + "]"; + } +} diff --git a/src/com/szpg/plc/message/command/write/SetJgOnBitCommand.java b/src/com/szpg/plc/message/command/write/SetJgOnBitCommand.java new file mode 100644 index 0000000..b63cf19 --- /dev/null +++ b/src/com/szpg/plc/message/command/write/SetJgOnBitCommand.java @@ -0,0 +1,41 @@ +package com.szpg.plc.message.command.write; + +import com.szpg.plc.message.AppMessageConstants; +import com.szpg.plc.message.command.WriteMemoryCommand; +import com.szpg.plc.message.response.WriteMemoryCommandResponse; + +public class SetJgOnBitCommand extends WriteMemoryCommand { + + /** + * + */ + private static final long serialVersionUID = 935723353287421429L; + + public final static int JG_ON_ENABLE = 1; // 井盖打开 + public final static int JG_ON_DISABLE = 0; // 井盖打开复位 + + private int jgon; + + public int getJgon() { + return jgon; + } + + public void setJgon(int jgon) { + this.jgon = jgon; + } + + @Override + public String getCommandType() { + return AppMessageConstants.CMD_TYPE_SETJGON; + } + + @Override + public Class getResponseClass() { + return WriteMemoryCommandResponse.class; + } + + @Override + public String toString() { + return "向终端[" + getDestinationId() + "]发送设置井盖开启位命令[" + jgon + "]"; + } +} diff --git a/src/com/szpg/plc/message/command/write/SetJgUnlockBitCommand.java b/src/com/szpg/plc/message/command/write/SetJgUnlockBitCommand.java index e3898b4..cfe7a6b 100644 --- a/src/com/szpg/plc/message/command/write/SetJgUnlockBitCommand.java +++ b/src/com/szpg/plc/message/command/write/SetJgUnlockBitCommand.java @@ -10,8 +10,7 @@ * */ private static final long serialVersionUID = 935723353287421429L; - - public final static int JG_LOCK = 0; //井盖锁定 + public final static int JG_UNLOCK = 1; //井盖解锁 private int unlock; diff --git a/src/com/szpg/plc/message/response/write/SetJgLockBitCommandResponse.java b/src/com/szpg/plc/message/response/write/SetJgLockBitCommandResponse.java new file mode 100644 index 0000000..adb5f9d --- /dev/null +++ b/src/com/szpg/plc/message/response/write/SetJgLockBitCommandResponse.java @@ -0,0 +1,29 @@ +package com.szpg.plc.message.response.write; + +import com.szpg.db.dao.PgDeviceDao; +import com.szpg.db.dao.PgJgDao; +import com.szpg.db.dao.impl.PgDeviceDaoImpl; +import com.szpg.db.dao.impl.PgJgDaoImpl; +import com.szpg.plc.message.response.WriteMemoryCommandResponse; +import org.apache.log4j.Logger; + +public class SetJgLockBitCommandResponse extends WriteMemoryCommandResponse { + + private final Logger logger = Logger.getLogger(this.getClass().getName()); + + private PgJgDao jgDao = new PgJgDaoImpl(); + private PgDeviceDao deviceDao = new PgDeviceDaoImpl(); + + @Override + public void afterAction() { + if (this.isSuccess() == true) { + // 更新设备状态 锁定 + int deviceId = deviceDao.findDeviceIdByCode(this.getDestinationId()); + if (deviceId > 0) { + jgDao.updateDeviceStatus(deviceId, "0"); + } + + logger.info("[" + this.getAcucode() + "]锁定井盖成功"); + } + } +} diff --git a/src/com/szpg/plc/message/response/write/SetJgOffBitCommandResponse.java b/src/com/szpg/plc/message/response/write/SetJgOffBitCommandResponse.java new file mode 100644 index 0000000..f10831c --- /dev/null +++ b/src/com/szpg/plc/message/response/write/SetJgOffBitCommandResponse.java @@ -0,0 +1,29 @@ +package com.szpg.plc.message.response.write; + +import com.szpg.db.dao.PgDeviceDao; +import com.szpg.db.dao.PgJgDao; +import com.szpg.db.dao.impl.PgDeviceDaoImpl; +import com.szpg.db.dao.impl.PgJgDaoImpl; +import com.szpg.plc.message.response.WriteMemoryCommandResponse; +import org.apache.log4j.Logger; + +public class SetJgOffBitCommandResponse extends WriteMemoryCommandResponse { + + private final Logger logger = Logger.getLogger(this.getClass().getName()); + + private PgJgDao jgDao = new PgJgDaoImpl(); + private PgDeviceDao deviceDao = new PgDeviceDaoImpl(); + + @Override + public void afterAction() { + if (this.isSuccess() == true) { + // 更新设备状态 关 + int deviceId = deviceDao.findDeviceIdByCode(this.getDestinationId()); + if (deviceId > 0) { + jgDao.updateDeviceStatus(deviceId, "0"); + } + + logger.info("[" + this.getAcucode() + "]关闭井盖成功"); + } + } +} diff --git a/src/com/szpg/plc/message/response/write/SetJgOnBitCommandResponse.java b/src/com/szpg/plc/message/response/write/SetJgOnBitCommandResponse.java new file mode 100644 index 0000000..35eb98c --- /dev/null +++ b/src/com/szpg/plc/message/response/write/SetJgOnBitCommandResponse.java @@ -0,0 +1,29 @@ +package com.szpg.plc.message.response.write; + +import com.szpg.db.dao.PgDeviceDao; +import com.szpg.db.dao.PgJgDao; +import com.szpg.db.dao.impl.PgDeviceDaoImpl; +import com.szpg.db.dao.impl.PgJgDaoImpl; +import com.szpg.plc.message.response.WriteMemoryCommandResponse; +import org.apache.log4j.Logger; + +public class SetJgOnBitCommandResponse extends WriteMemoryCommandResponse { + + private final Logger logger = Logger.getLogger(this.getClass().getName()); + + private PgJgDao jgDao = new PgJgDaoImpl(); + private PgDeviceDao deviceDao = new PgDeviceDaoImpl(); + + @Override + public void afterAction() { + if (this.isSuccess() == true) { + // 更新设备状态 开 + int deviceId = deviceDao.findDeviceIdByCode(this.getDestinationId()); + if (deviceId > 0) { + jgDao.updateDeviceStatus(deviceId, "1"); + } + + logger.info("[" + this.getAcucode() + "]打开井盖成功"); + } + } +} diff --git a/src/com/szpg/plc/message/response/write/SetJgUnlockBitCommandResponse.java b/src/com/szpg/plc/message/response/write/SetJgUnlockBitCommandResponse.java new file mode 100644 index 0000000..1575f09 --- /dev/null +++ b/src/com/szpg/plc/message/response/write/SetJgUnlockBitCommandResponse.java @@ -0,0 +1,30 @@ +package com.szpg.plc.message.response.write; + +import com.szpg.db.dao.PgDeviceDao; +import com.szpg.db.dao.PgJgDao; +import com.szpg.db.dao.impl.PgDeviceDaoImpl; +import com.szpg.db.dao.impl.PgJgDaoImpl; +import com.szpg.plc.message.command.write.SetJgUnlockBitCommand; +import com.szpg.plc.message.response.WriteMemoryCommandResponse; +import org.apache.log4j.Logger; + +public class SetJgUnlockBitCommandResponse extends WriteMemoryCommandResponse { + + private final Logger logger = Logger.getLogger(this.getClass().getName()); + + private PgJgDao jgDao = new PgJgDaoImpl(); + private PgDeviceDao deviceDao = new PgDeviceDaoImpl(); + + @Override + public void afterAction() { + if (this.isSuccess() == true) { + // 更新设备状态 解锁 + int deviceId = deviceDao.findDeviceIdByCode(this.getDestinationId()); + if (deviceId > 0) { + jgDao.updateDeviceStatus(deviceId, "1"); + } + + logger.info("[" + this.getAcucode() + "]解锁井盖成功"); + } + } +} diff --git a/src/com/szpg/plc/message/response/write/SetZmOffBitCommandResponse.java b/src/com/szpg/plc/message/response/write/SetZmOffBitCommandResponse.java new file mode 100644 index 0000000..bd36ece --- /dev/null +++ b/src/com/szpg/plc/message/response/write/SetZmOffBitCommandResponse.java @@ -0,0 +1,29 @@ +package com.szpg.plc.message.response.write; + +import com.szpg.db.dao.PgDeviceDao; +import com.szpg.db.dao.PgJgDao; +import com.szpg.db.dao.impl.PgDeviceDaoImpl; +import com.szpg.db.dao.impl.PgJgDaoImpl; +import com.szpg.plc.message.response.WriteMemoryCommandResponse; +import org.apache.log4j.Logger; + +public class SetZmOffBitCommandResponse extends WriteMemoryCommandResponse { + + private final Logger logger = Logger.getLogger(this.getClass().getName()); + + private PgJgDao jgDao = new PgJgDaoImpl(); + private PgDeviceDao deviceDao = new PgDeviceDaoImpl(); + + @Override + public void afterAction() { + if (this.isSuccess() == true) { + // 更新设备状态 关 + int deviceId = deviceDao.findDeviceIdByCode(this.getDestinationId()); + if (deviceId > 0) { + jgDao.updateDeviceStatus(deviceId, "0"); + } + + logger.info("[" + this.getAcucode() + "]关闭照明成功"); + } + } +} diff --git a/src/com/szpg/plc/message/response/write/SetZmOnBitCommandResponse.java b/src/com/szpg/plc/message/response/write/SetZmOnBitCommandResponse.java new file mode 100644 index 0000000..61822b8 --- /dev/null +++ b/src/com/szpg/plc/message/response/write/SetZmOnBitCommandResponse.java @@ -0,0 +1,29 @@ +package com.szpg.plc.message.response.write; + +import com.szpg.db.dao.PgDeviceDao; +import com.szpg.db.dao.PgJgDao; +import com.szpg.db.dao.impl.PgDeviceDaoImpl; +import com.szpg.db.dao.impl.PgJgDaoImpl; +import com.szpg.plc.message.response.WriteMemoryCommandResponse; +import org.apache.log4j.Logger; + +public class SetZmOnBitCommandResponse extends WriteMemoryCommandResponse { + + private final Logger logger = Logger.getLogger(this.getClass().getName()); + + private PgJgDao jgDao = new PgJgDaoImpl(); + private PgDeviceDao deviceDao = new PgDeviceDaoImpl(); + + @Override + public void afterAction() { + if (this.isSuccess() == true) { + // 更新设备状态 开 + int deviceId = deviceDao.findDeviceIdByCode(this.getDestinationId()); + if (deviceId > 0) { + jgDao.updateDeviceStatus(deviceId, "1"); + } + + logger.info("[" + this.getAcucode() + "]打开照明成功"); + } + } +} diff --git a/src/com/szpg/plc/server/ACUClientHandler.java b/src/com/szpg/plc/server/ACUClientHandler.java index cab8a25..c61c664 100644 --- a/src/com/szpg/plc/server/ACUClientHandler.java +++ b/src/com/szpg/plc/server/ACUClientHandler.java @@ -109,6 +109,7 @@ if (null != cmd) { rmcr.setAcucode(cmd.getDest_acu_code()); rmcr.setCmdId(cmd.getId()); + rmcr.setDestinationId(cmd.getDevice_code()); // 用设备资产编号赋值给目标地址 // 字节流已解析 diff --git a/src/com/szpg/rmi/RemoteFJCommandAction.java b/src/com/szpg/rmi/RemoteFJCommandAction.java index 8114c3a..82ddf09 100644 --- a/src/com/szpg/rmi/RemoteFJCommandAction.java +++ b/src/com/szpg/rmi/RemoteFJCommandAction.java @@ -197,9 +197,9 @@ // 目标地址 String dest = client.getNet() + client.getNode() + client.getUnit(); - + DTProtocolInterface finspi = ProtocolFactory.getDefaultDTProtocol(); - + // 1首先将停止位置0 // 该逻辑取消,由设备自行控制 @@ -210,7 +210,7 @@ setOnCmd.setMessageProducerHost(client.getHost()); RemoteDeviceControlService service = new RemoteDeviceControlService(); - service.executeService(client, setOnCmd); + service.executeService(client, setOnCmd, zcbh); Logger.getLogger(this.getClass().getName()).info(setOnCmd); } else { @@ -303,7 +303,7 @@ setOffCmd.setMessageProducerHost(client.getHost()); RemoteDeviceControlService service = new RemoteDeviceControlService(); - service.executeService(client, setOffCmd); + service.executeService(client, setOffCmd, zcbh); Logger.getLogger(this.getClass().getName()).info(setOffCmd); } else { diff --git a/src/com/szpg/rmi/RemoteZMCommandAction.java b/src/com/szpg/rmi/RemoteZMCommandAction.java index 90dbf9a..e934b0e 100644 --- a/src/com/szpg/rmi/RemoteZMCommandAction.java +++ b/src/com/szpg/rmi/RemoteZMCommandAction.java @@ -206,7 +206,7 @@ setOnCmd.setMessageProducerHost(client.getHost()); RemoteDeviceControlService service = new RemoteDeviceControlService(); - service.executeService(client, setOnCmd); + service.executeService(client, setOnCmd, zcbh); Logger.getLogger(this.getClass().getName()).info(setOnCmd); } else { @@ -299,7 +299,7 @@ setOffCmd.setMessageProducerHost(client.getHost()); RemoteDeviceControlService service = new RemoteDeviceControlService(); - service.executeService(client, setOffCmd); + service.executeService(client, setOffCmd, zcbh); Logger.getLogger(this.getClass().getName()).info(setOffCmd); } else { diff --git a/src/com/szpg/service/ReadCommandTimeoutTask.java b/src/com/szpg/service/ReadCommandTimeoutTask.java deleted file mode 100644 index 8a5e247..0000000 --- a/src/com/szpg/service/ReadCommandTimeoutTask.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.szpg.service; - -import com.szpg.db.dao.PgAcuCmdDao; -import com.szpg.db.dao.impl.PgAcuCmdDaoImpl; - -public class ReadCommandTimeoutTask implements Runnable { - - private PgAcuCmdDao cmdDao = new PgAcuCmdDaoImpl(); - private String cmdId; - - public ReadCommandTimeoutTask(String cmdId) { - this.cmdId = cmdId; - } - - @Override - public void run() { - cmdDao.updateCmdRecordTimeout(cmdId); - } - -} diff --git a/src/ACUBL.properties b/src/ACUBL.properties index 9c4b0ab..df9ffdb 100644 --- a/src/ACUBL.properties +++ b/src/ACUBL.properties @@ -1,6 +1,6 @@ #ACU\u53D8\u91CF\u8868\u914D\u7F6E\u6587\u4EF6 -######## THXC.ACU001 ######## +######## 01 HXC.ACU001 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU001.CH.COUNT = 6 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -144,7 +144,7 @@ -######## THXC.ACU002 ######## +######## 02 THXC.ACU002 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU002.CH.COUNT = 6 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -288,7 +288,7 @@ -######## THXC.ACU003 ######## +######## 03 THXC.ACU003 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU003.CH.COUNT = 6 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -432,7 +432,7 @@ -######## THXC.ACU004 ######## +######## 04 THXC.ACU004 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU004.CH.COUNT = 6 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -576,7 +576,7 @@ -######## THXC.ACU005 ######## +######## 05 THXC.ACU005 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU005.CH.COUNT = 6 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -720,7 +720,7 @@ -######## THXC.ACU006 ######## +######## 06 THXC.ACU006 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU006.CH.COUNT = 6 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -812,7 +812,7 @@ #\u98CE\u673A\u6570\u91CF -THXC.ACU006.FJ.COUNT = 9 +THXC.ACU006.FJ.COUNT = 6 #\u98CE\u673A\u7F16\u7801\u5217\u8868 THXC.ACU006.FJ.ZC.LIST = THXC.ACU006.F.DFJ01;THXC.ACU006.F.DFJ02;THXC.ACU006.F.SFJ01;THXC.ACU006.F.SFJ02;THXC.ACU006.F.RFJ01;THXC.ACU006.F.RFJ02 #\u98CE\u673A\u72B6\u6001\u8D77\u59CB\u5730\u5740 @@ -864,7 +864,7 @@ -######## THXC.ACU008 ######## +######## 07 THXC.ACU008 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU008.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -1008,7 +1008,7 @@ -######## THXC.ACU009 ######## +######## 08 THXC.ACU009 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU009.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -1152,7 +1152,7 @@ -######## THXC.ACU010 ######## +######## 09 THXC.ACU010 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU010.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -1296,7 +1296,7 @@ -######## THXC.ACU011 ######## +######## 10 THXC.ACU011 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU011.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -1440,7 +1440,7 @@ -######## THXC.ACU013 ######## +######## 11 THXC.ACU013 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU013.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -1584,7 +1584,7 @@ -######## THXC.ACU014 ######## +######## 12 THXC.ACU014 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU014.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -1729,7 +1729,7 @@ -######## THXC.ACU015 ######## +######## 13 THXC.ACU015 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU015.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -1874,7 +1874,7 @@ -######## THXC.ACU016 ######## +######## 14 THXC.ACU016 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU016.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2020,7 +2020,7 @@ ######## \u4E8C\u671F\u4E09\u6807\u6BB5 ######## -######## THXC.ACU301 ######## +######## 01 THXC.ACU301 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU301.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2070,7 +2070,7 @@ -######## THXC.ACU302 ######## +######## 02 THXC.ACU302 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU302.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2083,7 +2083,7 @@ -######## THXC.ACU303 ######## +######## 03 THXC.ACU303 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU303.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2096,7 +2096,7 @@ -######## THXC.ACU304 ######## +######## 04 THXC.ACU304 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU304.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2109,7 +2109,7 @@ -######## THXC.ACU305 ######## +######## 05 THXC.ACU305 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU305.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2122,7 +2122,7 @@ -######## THXC.ACU501 ######## +######## 06 THXC.ACU501 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU501.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2135,7 +2135,7 @@ -######## THXC.ACU502 ######## +######## 07 THXC.ACU502 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU502.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2148,7 +2148,7 @@ -######## THXC.ACU503 ######## +######## 08 THXC.ACU503 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU503.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2161,7 +2161,7 @@ -######## THXC.ACU504 ######## +######## 09 THXC.ACU504 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU504.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2174,7 +2174,7 @@ -######## THXC.ACU505 ######## +######## 10 THXC.ACU505 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU505.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2187,7 +2187,7 @@ -######## THXC.ACU506 ######## +######## 11 THXC.ACU506 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU506.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2200,7 +2200,7 @@ -######## THXC.ACU507 ######## +######## 12 THXC.ACU507 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU507.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2213,7 +2213,7 @@ -######## THXC.ACU601 ######## +######## 13 THXC.ACU601 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU601.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2226,7 +2226,7 @@ -######## THXC.ACU602 ######## +######## 14 THXC.ACU602 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU602.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2239,7 +2239,7 @@ -######## THXC.ACU603 ######## +######## 15 THXC.ACU603 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU603.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2252,7 +2252,7 @@ -######## THXC.ACU604 ######## +######## 16 THXC.ACU604 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU604.WSYQ.COUNT = 6 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2265,7 +2265,7 @@ -######## THXC.ACUS03 ######## +######## 17 THXC.ACUS03 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACUS03.WSYQ.COUNT = 2 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2278,7 +2278,7 @@ -######## THXC.ACUS05 ######## +######## 18 THXC.ACUS05 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACUS05.WSYQ.COUNT = 2 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2291,7 +2291,7 @@ -######## THXC.ACUS06 ######## +######## 19 THXC.ACUS06 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACUS06.WSYQ.COUNT = 2 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2304,6 +2304,103 @@ +######## \u4E8C\u671F\u56DB\u6807\u6BB5 ######## +######## 01 THXC.ACU107 ######## + + +######## 02 THXC.ACU108 ######## + + +######## 03 THXC.ACU109 ######## + + +######## 04 THXC.ACU110 ######## + + +######## 05 THXC.ACU306 ######## + + +######## 06 THXC.ACU307 ######## + + +######## 07 THXC.ACU308 ######## + + +######## 08 THXC.ACU309 ######## + + +######## 09 THXC.ACU401 ######## + + +######## 10 THXC.ACU402 ######## + + +######## 11 THXC.ACU403 ######## + + +######## 12 THXC.ACU404 ######## + + +######## 13 THXC.ACU405 ######## + + +######## 14 THXC.ACU406 ######## + + +######## 15 THXC.ACU407 ######## + + +######## 16 THXC.ACU408 ######## + + +######## 17 THXC.ACUS04 ######## + + +######## 18 THXC.ACU701 ######## + + +######## 19 THXC.ACU702 ######## + + +######## 20 THXC.ACU703 ######## + + +######## 21 THXC.ACU704 ######## + + +######## 22 THXC.ACU705 ######## + + +######## 23 THXC.ACU706 ######## + + +######## 24 THXC.ACU801 ######## + + +######## 25 THXC.ACU802 ######## + + +######## 26 THXC.ACU803 ######## + + +######## 27 THXC.ACU804 ######## + + +######## 28 THXC.ACU805 ######## + + +######## 29 THXC.ACU806 ######## + + +######## 30 THXC.ACU807 ######## + + +######## 31 THXC.ACUS07 ######## + + +######## 32 THXC.ACUS08 ######## + + ######## \u9F99\u7FD4\u8DEF\u71C3\u6C14\u6BB5 THXC.ACU801 ######## #\u98CE\u673A\u6570\u91CF THXC.ACU801.FJ.COUNT = 1 diff --git a/src/com/szpg/db/dao/impl/PgAcuCmdDaoImpl.java b/src/com/szpg/db/dao/impl/PgAcuCmdDaoImpl.java index b752a9c..406d9ee 100644 --- a/src/com/szpg/db/dao/impl/PgAcuCmdDaoImpl.java +++ b/src/com/szpg/db/dao/impl/PgAcuCmdDaoImpl.java @@ -154,13 +154,14 @@ Connection conn = null; String insertStr = "INSERT INTO PG_ACU_CMD " + - "(ID, TM, CMD_TYPE, DEST_ACU_CODE, TIMEOUT) " + - "VALUES (?, TO_DATE(?, 'YYYYMMDDHH24MISS'), ?, ?, '0')"; - Object[] params = new Object[4]; + "(ID, TM, CMD_TYPE, DEST_ACU_CODE, TIMEOUT, DEVICE_CODE) " + + "VALUES (?, TO_DATE(?, 'YYYYMMDDHH24MISS'), ?, ?, '0', ?)"; + Object[] params = new Object[5]; params[0] = cmd.getId(); params[1] = TimeFormat.format(cmd.getTm(), "yyyyMMddHHmmss"); params[2] = cmd.getCmd_type(); params[3] = cmd.getDest_acu_code(); + params[4] = cmd.getDevice_code(); try { conn = ConnectionManager.getConnectionFromC3P0(); diff --git a/src/com/szpg/db/data/PgAcuCmd.java b/src/com/szpg/db/data/PgAcuCmd.java index 9e57628..0f3cabc 100644 --- a/src/com/szpg/db/data/PgAcuCmd.java +++ b/src/com/szpg/db/data/PgAcuCmd.java @@ -23,6 +23,7 @@ private Date tm; // 命令发送时间 private String cmd_type; // 命令类型 private String dest_acu_code; // 目标ACU代码 + private String device_code; // 命令的资产编号 private boolean timeout; // 是否超时 public PgAcuCmd() { @@ -62,6 +63,14 @@ this.dest_acu_code = dest_acu_code; } + public String getDevice_code() { + return device_code; + } + + public void setDevice_code(String device_code) { + this.device_code = device_code; + } + public boolean isTimeout() { return timeout; } diff --git a/src/com/szpg/plc/PGDSCServlet.java b/src/com/szpg/plc/PGDSCServlet.java index 5653eb6..881c2e3 100644 --- a/src/com/szpg/plc/PGDSCServlet.java +++ b/src/com/szpg/plc/PGDSCServlet.java @@ -104,13 +104,13 @@ sendQueryJGStatusCommand(); //10巡检数据同步 - synchAssetInSpection(); +// synchAssetInSpection(); //运维数据同步 - synchMaintanceRecord(); +// synchMaintanceRecord(); // 查询二期温湿度氧气实时数据 - sendQueryWSYQValueCommand(); +// sendQueryWSYQValueCommand(); } /** diff --git a/src/com/szpg/plc/message/command/write/SetJgLockBitCommand.java b/src/com/szpg/plc/message/command/write/SetJgLockBitCommand.java new file mode 100644 index 0000000..f4bc55a --- /dev/null +++ b/src/com/szpg/plc/message/command/write/SetJgLockBitCommand.java @@ -0,0 +1,40 @@ +package com.szpg.plc.message.command.write; + +import com.szpg.plc.message.AppMessageConstants; +import com.szpg.plc.message.command.WriteMemoryCommand; +import com.szpg.plc.message.response.WriteMemoryCommandResponse; + +public class SetJgLockBitCommand extends WriteMemoryCommand { + + /** + * + */ + private static final long serialVersionUID = 935723353287421429L; + + public final static int JG_LOCK = 0; //井盖锁定 + + private int unlock; + + public int getUnlock() { + return unlock; + } + + public void setUnlock(int unlock) { + this.unlock = unlock; + } + + @Override + public String getCommandType() { + return AppMessageConstants.CMD_TYPE_SETJGLOCK; + } + + @Override + public Class getResponseClass() { + return WriteMemoryCommandResponse.class; + } + + @Override + public String toString() { + return "向终端[" + getDestinationId() + "]发送设置井盖锁定命令"; + } +} diff --git a/src/com/szpg/plc/message/command/write/SetJgOffBitCommand.java b/src/com/szpg/plc/message/command/write/SetJgOffBitCommand.java new file mode 100644 index 0000000..185804c --- /dev/null +++ b/src/com/szpg/plc/message/command/write/SetJgOffBitCommand.java @@ -0,0 +1,41 @@ +package com.szpg.plc.message.command.write; + +import com.szpg.plc.message.AppMessageConstants; +import com.szpg.plc.message.command.WriteMemoryCommand; +import com.szpg.plc.message.response.WriteMemoryCommandResponse; + +public class SetJgOffBitCommand extends WriteMemoryCommand { + + /** + * + */ + private static final long serialVersionUID = 935723353287421429L; + + public final static int JG_OFF_ENABLE = 1; // 井盖关闭 + public final static int JG_OFF_DISABLE = 0; // 井盖关闭复位 + + private int jgoff; + + public int getJgoff() { + return jgoff; + } + + public void setJgoff(int jgoff) { + this.jgoff = jgoff; + } + + @Override + public String getCommandType() { + return AppMessageConstants.CMD_TYPE_SETJGOFF; + } + + @Override + public Class getResponseClass() { + return WriteMemoryCommandResponse.class; + } + + @Override + public String toString() { + return "向终端[" + getDestinationId() + "]发送设置井盖关闭位命令[" + jgoff + "]"; + } +} diff --git a/src/com/szpg/plc/message/command/write/SetJgOnBitCommand.java b/src/com/szpg/plc/message/command/write/SetJgOnBitCommand.java new file mode 100644 index 0000000..b63cf19 --- /dev/null +++ b/src/com/szpg/plc/message/command/write/SetJgOnBitCommand.java @@ -0,0 +1,41 @@ +package com.szpg.plc.message.command.write; + +import com.szpg.plc.message.AppMessageConstants; +import com.szpg.plc.message.command.WriteMemoryCommand; +import com.szpg.plc.message.response.WriteMemoryCommandResponse; + +public class SetJgOnBitCommand extends WriteMemoryCommand { + + /** + * + */ + private static final long serialVersionUID = 935723353287421429L; + + public final static int JG_ON_ENABLE = 1; // 井盖打开 + public final static int JG_ON_DISABLE = 0; // 井盖打开复位 + + private int jgon; + + public int getJgon() { + return jgon; + } + + public void setJgon(int jgon) { + this.jgon = jgon; + } + + @Override + public String getCommandType() { + return AppMessageConstants.CMD_TYPE_SETJGON; + } + + @Override + public Class getResponseClass() { + return WriteMemoryCommandResponse.class; + } + + @Override + public String toString() { + return "向终端[" + getDestinationId() + "]发送设置井盖开启位命令[" + jgon + "]"; + } +} diff --git a/src/com/szpg/plc/message/command/write/SetJgUnlockBitCommand.java b/src/com/szpg/plc/message/command/write/SetJgUnlockBitCommand.java index e3898b4..cfe7a6b 100644 --- a/src/com/szpg/plc/message/command/write/SetJgUnlockBitCommand.java +++ b/src/com/szpg/plc/message/command/write/SetJgUnlockBitCommand.java @@ -10,8 +10,7 @@ * */ private static final long serialVersionUID = 935723353287421429L; - - public final static int JG_LOCK = 0; //井盖锁定 + public final static int JG_UNLOCK = 1; //井盖解锁 private int unlock; diff --git a/src/com/szpg/plc/message/response/write/SetJgLockBitCommandResponse.java b/src/com/szpg/plc/message/response/write/SetJgLockBitCommandResponse.java new file mode 100644 index 0000000..adb5f9d --- /dev/null +++ b/src/com/szpg/plc/message/response/write/SetJgLockBitCommandResponse.java @@ -0,0 +1,29 @@ +package com.szpg.plc.message.response.write; + +import com.szpg.db.dao.PgDeviceDao; +import com.szpg.db.dao.PgJgDao; +import com.szpg.db.dao.impl.PgDeviceDaoImpl; +import com.szpg.db.dao.impl.PgJgDaoImpl; +import com.szpg.plc.message.response.WriteMemoryCommandResponse; +import org.apache.log4j.Logger; + +public class SetJgLockBitCommandResponse extends WriteMemoryCommandResponse { + + private final Logger logger = Logger.getLogger(this.getClass().getName()); + + private PgJgDao jgDao = new PgJgDaoImpl(); + private PgDeviceDao deviceDao = new PgDeviceDaoImpl(); + + @Override + public void afterAction() { + if (this.isSuccess() == true) { + // 更新设备状态 锁定 + int deviceId = deviceDao.findDeviceIdByCode(this.getDestinationId()); + if (deviceId > 0) { + jgDao.updateDeviceStatus(deviceId, "0"); + } + + logger.info("[" + this.getAcucode() + "]锁定井盖成功"); + } + } +} diff --git a/src/com/szpg/plc/message/response/write/SetJgOffBitCommandResponse.java b/src/com/szpg/plc/message/response/write/SetJgOffBitCommandResponse.java new file mode 100644 index 0000000..f10831c --- /dev/null +++ b/src/com/szpg/plc/message/response/write/SetJgOffBitCommandResponse.java @@ -0,0 +1,29 @@ +package com.szpg.plc.message.response.write; + +import com.szpg.db.dao.PgDeviceDao; +import com.szpg.db.dao.PgJgDao; +import com.szpg.db.dao.impl.PgDeviceDaoImpl; +import com.szpg.db.dao.impl.PgJgDaoImpl; +import com.szpg.plc.message.response.WriteMemoryCommandResponse; +import org.apache.log4j.Logger; + +public class SetJgOffBitCommandResponse extends WriteMemoryCommandResponse { + + private final Logger logger = Logger.getLogger(this.getClass().getName()); + + private PgJgDao jgDao = new PgJgDaoImpl(); + private PgDeviceDao deviceDao = new PgDeviceDaoImpl(); + + @Override + public void afterAction() { + if (this.isSuccess() == true) { + // 更新设备状态 关 + int deviceId = deviceDao.findDeviceIdByCode(this.getDestinationId()); + if (deviceId > 0) { + jgDao.updateDeviceStatus(deviceId, "0"); + } + + logger.info("[" + this.getAcucode() + "]关闭井盖成功"); + } + } +} diff --git a/src/com/szpg/plc/message/response/write/SetJgOnBitCommandResponse.java b/src/com/szpg/plc/message/response/write/SetJgOnBitCommandResponse.java new file mode 100644 index 0000000..35eb98c --- /dev/null +++ b/src/com/szpg/plc/message/response/write/SetJgOnBitCommandResponse.java @@ -0,0 +1,29 @@ +package com.szpg.plc.message.response.write; + +import com.szpg.db.dao.PgDeviceDao; +import com.szpg.db.dao.PgJgDao; +import com.szpg.db.dao.impl.PgDeviceDaoImpl; +import com.szpg.db.dao.impl.PgJgDaoImpl; +import com.szpg.plc.message.response.WriteMemoryCommandResponse; +import org.apache.log4j.Logger; + +public class SetJgOnBitCommandResponse extends WriteMemoryCommandResponse { + + private final Logger logger = Logger.getLogger(this.getClass().getName()); + + private PgJgDao jgDao = new PgJgDaoImpl(); + private PgDeviceDao deviceDao = new PgDeviceDaoImpl(); + + @Override + public void afterAction() { + if (this.isSuccess() == true) { + // 更新设备状态 开 + int deviceId = deviceDao.findDeviceIdByCode(this.getDestinationId()); + if (deviceId > 0) { + jgDao.updateDeviceStatus(deviceId, "1"); + } + + logger.info("[" + this.getAcucode() + "]打开井盖成功"); + } + } +} diff --git a/src/com/szpg/plc/message/response/write/SetJgUnlockBitCommandResponse.java b/src/com/szpg/plc/message/response/write/SetJgUnlockBitCommandResponse.java new file mode 100644 index 0000000..1575f09 --- /dev/null +++ b/src/com/szpg/plc/message/response/write/SetJgUnlockBitCommandResponse.java @@ -0,0 +1,30 @@ +package com.szpg.plc.message.response.write; + +import com.szpg.db.dao.PgDeviceDao; +import com.szpg.db.dao.PgJgDao; +import com.szpg.db.dao.impl.PgDeviceDaoImpl; +import com.szpg.db.dao.impl.PgJgDaoImpl; +import com.szpg.plc.message.command.write.SetJgUnlockBitCommand; +import com.szpg.plc.message.response.WriteMemoryCommandResponse; +import org.apache.log4j.Logger; + +public class SetJgUnlockBitCommandResponse extends WriteMemoryCommandResponse { + + private final Logger logger = Logger.getLogger(this.getClass().getName()); + + private PgJgDao jgDao = new PgJgDaoImpl(); + private PgDeviceDao deviceDao = new PgDeviceDaoImpl(); + + @Override + public void afterAction() { + if (this.isSuccess() == true) { + // 更新设备状态 解锁 + int deviceId = deviceDao.findDeviceIdByCode(this.getDestinationId()); + if (deviceId > 0) { + jgDao.updateDeviceStatus(deviceId, "1"); + } + + logger.info("[" + this.getAcucode() + "]解锁井盖成功"); + } + } +} diff --git a/src/com/szpg/plc/message/response/write/SetZmOffBitCommandResponse.java b/src/com/szpg/plc/message/response/write/SetZmOffBitCommandResponse.java new file mode 100644 index 0000000..bd36ece --- /dev/null +++ b/src/com/szpg/plc/message/response/write/SetZmOffBitCommandResponse.java @@ -0,0 +1,29 @@ +package com.szpg.plc.message.response.write; + +import com.szpg.db.dao.PgDeviceDao; +import com.szpg.db.dao.PgJgDao; +import com.szpg.db.dao.impl.PgDeviceDaoImpl; +import com.szpg.db.dao.impl.PgJgDaoImpl; +import com.szpg.plc.message.response.WriteMemoryCommandResponse; +import org.apache.log4j.Logger; + +public class SetZmOffBitCommandResponse extends WriteMemoryCommandResponse { + + private final Logger logger = Logger.getLogger(this.getClass().getName()); + + private PgJgDao jgDao = new PgJgDaoImpl(); + private PgDeviceDao deviceDao = new PgDeviceDaoImpl(); + + @Override + public void afterAction() { + if (this.isSuccess() == true) { + // 更新设备状态 关 + int deviceId = deviceDao.findDeviceIdByCode(this.getDestinationId()); + if (deviceId > 0) { + jgDao.updateDeviceStatus(deviceId, "0"); + } + + logger.info("[" + this.getAcucode() + "]关闭照明成功"); + } + } +} diff --git a/src/com/szpg/plc/message/response/write/SetZmOnBitCommandResponse.java b/src/com/szpg/plc/message/response/write/SetZmOnBitCommandResponse.java new file mode 100644 index 0000000..61822b8 --- /dev/null +++ b/src/com/szpg/plc/message/response/write/SetZmOnBitCommandResponse.java @@ -0,0 +1,29 @@ +package com.szpg.plc.message.response.write; + +import com.szpg.db.dao.PgDeviceDao; +import com.szpg.db.dao.PgJgDao; +import com.szpg.db.dao.impl.PgDeviceDaoImpl; +import com.szpg.db.dao.impl.PgJgDaoImpl; +import com.szpg.plc.message.response.WriteMemoryCommandResponse; +import org.apache.log4j.Logger; + +public class SetZmOnBitCommandResponse extends WriteMemoryCommandResponse { + + private final Logger logger = Logger.getLogger(this.getClass().getName()); + + private PgJgDao jgDao = new PgJgDaoImpl(); + private PgDeviceDao deviceDao = new PgDeviceDaoImpl(); + + @Override + public void afterAction() { + if (this.isSuccess() == true) { + // 更新设备状态 开 + int deviceId = deviceDao.findDeviceIdByCode(this.getDestinationId()); + if (deviceId > 0) { + jgDao.updateDeviceStatus(deviceId, "1"); + } + + logger.info("[" + this.getAcucode() + "]打开照明成功"); + } + } +} diff --git a/src/com/szpg/plc/server/ACUClientHandler.java b/src/com/szpg/plc/server/ACUClientHandler.java index cab8a25..c61c664 100644 --- a/src/com/szpg/plc/server/ACUClientHandler.java +++ b/src/com/szpg/plc/server/ACUClientHandler.java @@ -109,6 +109,7 @@ if (null != cmd) { rmcr.setAcucode(cmd.getDest_acu_code()); rmcr.setCmdId(cmd.getId()); + rmcr.setDestinationId(cmd.getDevice_code()); // 用设备资产编号赋值给目标地址 // 字节流已解析 diff --git a/src/com/szpg/rmi/RemoteFJCommandAction.java b/src/com/szpg/rmi/RemoteFJCommandAction.java index 8114c3a..82ddf09 100644 --- a/src/com/szpg/rmi/RemoteFJCommandAction.java +++ b/src/com/szpg/rmi/RemoteFJCommandAction.java @@ -197,9 +197,9 @@ // 目标地址 String dest = client.getNet() + client.getNode() + client.getUnit(); - + DTProtocolInterface finspi = ProtocolFactory.getDefaultDTProtocol(); - + // 1首先将停止位置0 // 该逻辑取消,由设备自行控制 @@ -210,7 +210,7 @@ setOnCmd.setMessageProducerHost(client.getHost()); RemoteDeviceControlService service = new RemoteDeviceControlService(); - service.executeService(client, setOnCmd); + service.executeService(client, setOnCmd, zcbh); Logger.getLogger(this.getClass().getName()).info(setOnCmd); } else { @@ -303,7 +303,7 @@ setOffCmd.setMessageProducerHost(client.getHost()); RemoteDeviceControlService service = new RemoteDeviceControlService(); - service.executeService(client, setOffCmd); + service.executeService(client, setOffCmd, zcbh); Logger.getLogger(this.getClass().getName()).info(setOffCmd); } else { diff --git a/src/com/szpg/rmi/RemoteZMCommandAction.java b/src/com/szpg/rmi/RemoteZMCommandAction.java index 90dbf9a..e934b0e 100644 --- a/src/com/szpg/rmi/RemoteZMCommandAction.java +++ b/src/com/szpg/rmi/RemoteZMCommandAction.java @@ -206,7 +206,7 @@ setOnCmd.setMessageProducerHost(client.getHost()); RemoteDeviceControlService service = new RemoteDeviceControlService(); - service.executeService(client, setOnCmd); + service.executeService(client, setOnCmd, zcbh); Logger.getLogger(this.getClass().getName()).info(setOnCmd); } else { @@ -299,7 +299,7 @@ setOffCmd.setMessageProducerHost(client.getHost()); RemoteDeviceControlService service = new RemoteDeviceControlService(); - service.executeService(client, setOffCmd); + service.executeService(client, setOffCmd, zcbh); Logger.getLogger(this.getClass().getName()).info(setOffCmd); } else { diff --git a/src/com/szpg/service/ReadCommandTimeoutTask.java b/src/com/szpg/service/ReadCommandTimeoutTask.java deleted file mode 100644 index 8a5e247..0000000 --- a/src/com/szpg/service/ReadCommandTimeoutTask.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.szpg.service; - -import com.szpg.db.dao.PgAcuCmdDao; -import com.szpg.db.dao.impl.PgAcuCmdDaoImpl; - -public class ReadCommandTimeoutTask implements Runnable { - - private PgAcuCmdDao cmdDao = new PgAcuCmdDaoImpl(); - private String cmdId; - - public ReadCommandTimeoutTask(String cmdId) { - this.cmdId = cmdId; - } - - @Override - public void run() { - cmdDao.updateCmdRecordTimeout(cmdId); - } - -} diff --git a/src/com/szpg/service/ReadSensorValueService.java b/src/com/szpg/service/ReadSensorValueService.java index 15bd3e0..3345ba9 100644 --- a/src/com/szpg/service/ReadSensorValueService.java +++ b/src/com/szpg/service/ReadSensorValueService.java @@ -52,6 +52,6 @@ // 4定时将数据库中的命令置为超时 int TIMEOUT = Integer.parseInt(Configure.getProperty("sys", "COMMAND_TIMEOUT", "2")); - new ScheduledThreadPoolExecutor(1).schedule(new ReadCommandTimeoutTask(cmd.getId()), TIMEOUT, TimeUnit.MINUTES); + new ScheduledThreadPoolExecutor(1).schedule(new RemoteCommandTimeoutTask(cmd.getId()), TIMEOUT, TimeUnit.MINUTES); } } diff --git a/src/ACUBL.properties b/src/ACUBL.properties index 9c4b0ab..df9ffdb 100644 --- a/src/ACUBL.properties +++ b/src/ACUBL.properties @@ -1,6 +1,6 @@ #ACU\u53D8\u91CF\u8868\u914D\u7F6E\u6587\u4EF6 -######## THXC.ACU001 ######## +######## 01 HXC.ACU001 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU001.CH.COUNT = 6 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -144,7 +144,7 @@ -######## THXC.ACU002 ######## +######## 02 THXC.ACU002 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU002.CH.COUNT = 6 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -288,7 +288,7 @@ -######## THXC.ACU003 ######## +######## 03 THXC.ACU003 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU003.CH.COUNT = 6 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -432,7 +432,7 @@ -######## THXC.ACU004 ######## +######## 04 THXC.ACU004 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU004.CH.COUNT = 6 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -576,7 +576,7 @@ -######## THXC.ACU005 ######## +######## 05 THXC.ACU005 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU005.CH.COUNT = 6 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -720,7 +720,7 @@ -######## THXC.ACU006 ######## +######## 06 THXC.ACU006 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU006.CH.COUNT = 6 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -812,7 +812,7 @@ #\u98CE\u673A\u6570\u91CF -THXC.ACU006.FJ.COUNT = 9 +THXC.ACU006.FJ.COUNT = 6 #\u98CE\u673A\u7F16\u7801\u5217\u8868 THXC.ACU006.FJ.ZC.LIST = THXC.ACU006.F.DFJ01;THXC.ACU006.F.DFJ02;THXC.ACU006.F.SFJ01;THXC.ACU006.F.SFJ02;THXC.ACU006.F.RFJ01;THXC.ACU006.F.RFJ02 #\u98CE\u673A\u72B6\u6001\u8D77\u59CB\u5730\u5740 @@ -864,7 +864,7 @@ -######## THXC.ACU008 ######## +######## 07 THXC.ACU008 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU008.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -1008,7 +1008,7 @@ -######## THXC.ACU009 ######## +######## 08 THXC.ACU009 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU009.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -1152,7 +1152,7 @@ -######## THXC.ACU010 ######## +######## 09 THXC.ACU010 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU010.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -1296,7 +1296,7 @@ -######## THXC.ACU011 ######## +######## 10 THXC.ACU011 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU011.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -1440,7 +1440,7 @@ -######## THXC.ACU013 ######## +######## 11 THXC.ACU013 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU013.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -1584,7 +1584,7 @@ -######## THXC.ACU014 ######## +######## 12 THXC.ACU014 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU014.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -1729,7 +1729,7 @@ -######## THXC.ACU015 ######## +######## 13 THXC.ACU015 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU015.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -1874,7 +1874,7 @@ -######## THXC.ACU016 ######## +######## 14 THXC.ACU016 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU016.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2020,7 +2020,7 @@ ######## \u4E8C\u671F\u4E09\u6807\u6BB5 ######## -######## THXC.ACU301 ######## +######## 01 THXC.ACU301 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU301.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2070,7 +2070,7 @@ -######## THXC.ACU302 ######## +######## 02 THXC.ACU302 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU302.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2083,7 +2083,7 @@ -######## THXC.ACU303 ######## +######## 03 THXC.ACU303 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU303.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2096,7 +2096,7 @@ -######## THXC.ACU304 ######## +######## 04 THXC.ACU304 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU304.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2109,7 +2109,7 @@ -######## THXC.ACU305 ######## +######## 05 THXC.ACU305 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU305.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2122,7 +2122,7 @@ -######## THXC.ACU501 ######## +######## 06 THXC.ACU501 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU501.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2135,7 +2135,7 @@ -######## THXC.ACU502 ######## +######## 07 THXC.ACU502 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU502.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2148,7 +2148,7 @@ -######## THXC.ACU503 ######## +######## 08 THXC.ACU503 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU503.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2161,7 +2161,7 @@ -######## THXC.ACU504 ######## +######## 09 THXC.ACU504 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU504.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2174,7 +2174,7 @@ -######## THXC.ACU505 ######## +######## 10 THXC.ACU505 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU505.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2187,7 +2187,7 @@ -######## THXC.ACU506 ######## +######## 11 THXC.ACU506 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU506.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2200,7 +2200,7 @@ -######## THXC.ACU507 ######## +######## 12 THXC.ACU507 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU507.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2213,7 +2213,7 @@ -######## THXC.ACU601 ######## +######## 13 THXC.ACU601 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU601.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2226,7 +2226,7 @@ -######## THXC.ACU602 ######## +######## 14 THXC.ACU602 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU602.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2239,7 +2239,7 @@ -######## THXC.ACU603 ######## +######## 15 THXC.ACU603 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU603.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2252,7 +2252,7 @@ -######## THXC.ACU604 ######## +######## 16 THXC.ACU604 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU604.WSYQ.COUNT = 6 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2265,7 +2265,7 @@ -######## THXC.ACUS03 ######## +######## 17 THXC.ACUS03 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACUS03.WSYQ.COUNT = 2 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2278,7 +2278,7 @@ -######## THXC.ACUS05 ######## +######## 18 THXC.ACUS05 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACUS05.WSYQ.COUNT = 2 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2291,7 +2291,7 @@ -######## THXC.ACUS06 ######## +######## 19 THXC.ACUS06 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACUS06.WSYQ.COUNT = 2 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2304,6 +2304,103 @@ +######## \u4E8C\u671F\u56DB\u6807\u6BB5 ######## +######## 01 THXC.ACU107 ######## + + +######## 02 THXC.ACU108 ######## + + +######## 03 THXC.ACU109 ######## + + +######## 04 THXC.ACU110 ######## + + +######## 05 THXC.ACU306 ######## + + +######## 06 THXC.ACU307 ######## + + +######## 07 THXC.ACU308 ######## + + +######## 08 THXC.ACU309 ######## + + +######## 09 THXC.ACU401 ######## + + +######## 10 THXC.ACU402 ######## + + +######## 11 THXC.ACU403 ######## + + +######## 12 THXC.ACU404 ######## + + +######## 13 THXC.ACU405 ######## + + +######## 14 THXC.ACU406 ######## + + +######## 15 THXC.ACU407 ######## + + +######## 16 THXC.ACU408 ######## + + +######## 17 THXC.ACUS04 ######## + + +######## 18 THXC.ACU701 ######## + + +######## 19 THXC.ACU702 ######## + + +######## 20 THXC.ACU703 ######## + + +######## 21 THXC.ACU704 ######## + + +######## 22 THXC.ACU705 ######## + + +######## 23 THXC.ACU706 ######## + + +######## 24 THXC.ACU801 ######## + + +######## 25 THXC.ACU802 ######## + + +######## 26 THXC.ACU803 ######## + + +######## 27 THXC.ACU804 ######## + + +######## 28 THXC.ACU805 ######## + + +######## 29 THXC.ACU806 ######## + + +######## 30 THXC.ACU807 ######## + + +######## 31 THXC.ACUS07 ######## + + +######## 32 THXC.ACUS08 ######## + + ######## \u9F99\u7FD4\u8DEF\u71C3\u6C14\u6BB5 THXC.ACU801 ######## #\u98CE\u673A\u6570\u91CF THXC.ACU801.FJ.COUNT = 1 diff --git a/src/com/szpg/db/dao/impl/PgAcuCmdDaoImpl.java b/src/com/szpg/db/dao/impl/PgAcuCmdDaoImpl.java index b752a9c..406d9ee 100644 --- a/src/com/szpg/db/dao/impl/PgAcuCmdDaoImpl.java +++ b/src/com/szpg/db/dao/impl/PgAcuCmdDaoImpl.java @@ -154,13 +154,14 @@ Connection conn = null; String insertStr = "INSERT INTO PG_ACU_CMD " + - "(ID, TM, CMD_TYPE, DEST_ACU_CODE, TIMEOUT) " + - "VALUES (?, TO_DATE(?, 'YYYYMMDDHH24MISS'), ?, ?, '0')"; - Object[] params = new Object[4]; + "(ID, TM, CMD_TYPE, DEST_ACU_CODE, TIMEOUT, DEVICE_CODE) " + + "VALUES (?, TO_DATE(?, 'YYYYMMDDHH24MISS'), ?, ?, '0', ?)"; + Object[] params = new Object[5]; params[0] = cmd.getId(); params[1] = TimeFormat.format(cmd.getTm(), "yyyyMMddHHmmss"); params[2] = cmd.getCmd_type(); params[3] = cmd.getDest_acu_code(); + params[4] = cmd.getDevice_code(); try { conn = ConnectionManager.getConnectionFromC3P0(); diff --git a/src/com/szpg/db/data/PgAcuCmd.java b/src/com/szpg/db/data/PgAcuCmd.java index 9e57628..0f3cabc 100644 --- a/src/com/szpg/db/data/PgAcuCmd.java +++ b/src/com/szpg/db/data/PgAcuCmd.java @@ -23,6 +23,7 @@ private Date tm; // 命令发送时间 private String cmd_type; // 命令类型 private String dest_acu_code; // 目标ACU代码 + private String device_code; // 命令的资产编号 private boolean timeout; // 是否超时 public PgAcuCmd() { @@ -62,6 +63,14 @@ this.dest_acu_code = dest_acu_code; } + public String getDevice_code() { + return device_code; + } + + public void setDevice_code(String device_code) { + this.device_code = device_code; + } + public boolean isTimeout() { return timeout; } diff --git a/src/com/szpg/plc/PGDSCServlet.java b/src/com/szpg/plc/PGDSCServlet.java index 5653eb6..881c2e3 100644 --- a/src/com/szpg/plc/PGDSCServlet.java +++ b/src/com/szpg/plc/PGDSCServlet.java @@ -104,13 +104,13 @@ sendQueryJGStatusCommand(); //10巡检数据同步 - synchAssetInSpection(); +// synchAssetInSpection(); //运维数据同步 - synchMaintanceRecord(); +// synchMaintanceRecord(); // 查询二期温湿度氧气实时数据 - sendQueryWSYQValueCommand(); +// sendQueryWSYQValueCommand(); } /** diff --git a/src/com/szpg/plc/message/command/write/SetJgLockBitCommand.java b/src/com/szpg/plc/message/command/write/SetJgLockBitCommand.java new file mode 100644 index 0000000..f4bc55a --- /dev/null +++ b/src/com/szpg/plc/message/command/write/SetJgLockBitCommand.java @@ -0,0 +1,40 @@ +package com.szpg.plc.message.command.write; + +import com.szpg.plc.message.AppMessageConstants; +import com.szpg.plc.message.command.WriteMemoryCommand; +import com.szpg.plc.message.response.WriteMemoryCommandResponse; + +public class SetJgLockBitCommand extends WriteMemoryCommand { + + /** + * + */ + private static final long serialVersionUID = 935723353287421429L; + + public final static int JG_LOCK = 0; //井盖锁定 + + private int unlock; + + public int getUnlock() { + return unlock; + } + + public void setUnlock(int unlock) { + this.unlock = unlock; + } + + @Override + public String getCommandType() { + return AppMessageConstants.CMD_TYPE_SETJGLOCK; + } + + @Override + public Class getResponseClass() { + return WriteMemoryCommandResponse.class; + } + + @Override + public String toString() { + return "向终端[" + getDestinationId() + "]发送设置井盖锁定命令"; + } +} diff --git a/src/com/szpg/plc/message/command/write/SetJgOffBitCommand.java b/src/com/szpg/plc/message/command/write/SetJgOffBitCommand.java new file mode 100644 index 0000000..185804c --- /dev/null +++ b/src/com/szpg/plc/message/command/write/SetJgOffBitCommand.java @@ -0,0 +1,41 @@ +package com.szpg.plc.message.command.write; + +import com.szpg.plc.message.AppMessageConstants; +import com.szpg.plc.message.command.WriteMemoryCommand; +import com.szpg.plc.message.response.WriteMemoryCommandResponse; + +public class SetJgOffBitCommand extends WriteMemoryCommand { + + /** + * + */ + private static final long serialVersionUID = 935723353287421429L; + + public final static int JG_OFF_ENABLE = 1; // 井盖关闭 + public final static int JG_OFF_DISABLE = 0; // 井盖关闭复位 + + private int jgoff; + + public int getJgoff() { + return jgoff; + } + + public void setJgoff(int jgoff) { + this.jgoff = jgoff; + } + + @Override + public String getCommandType() { + return AppMessageConstants.CMD_TYPE_SETJGOFF; + } + + @Override + public Class getResponseClass() { + return WriteMemoryCommandResponse.class; + } + + @Override + public String toString() { + return "向终端[" + getDestinationId() + "]发送设置井盖关闭位命令[" + jgoff + "]"; + } +} diff --git a/src/com/szpg/plc/message/command/write/SetJgOnBitCommand.java b/src/com/szpg/plc/message/command/write/SetJgOnBitCommand.java new file mode 100644 index 0000000..b63cf19 --- /dev/null +++ b/src/com/szpg/plc/message/command/write/SetJgOnBitCommand.java @@ -0,0 +1,41 @@ +package com.szpg.plc.message.command.write; + +import com.szpg.plc.message.AppMessageConstants; +import com.szpg.plc.message.command.WriteMemoryCommand; +import com.szpg.plc.message.response.WriteMemoryCommandResponse; + +public class SetJgOnBitCommand extends WriteMemoryCommand { + + /** + * + */ + private static final long serialVersionUID = 935723353287421429L; + + public final static int JG_ON_ENABLE = 1; // 井盖打开 + public final static int JG_ON_DISABLE = 0; // 井盖打开复位 + + private int jgon; + + public int getJgon() { + return jgon; + } + + public void setJgon(int jgon) { + this.jgon = jgon; + } + + @Override + public String getCommandType() { + return AppMessageConstants.CMD_TYPE_SETJGON; + } + + @Override + public Class getResponseClass() { + return WriteMemoryCommandResponse.class; + } + + @Override + public String toString() { + return "向终端[" + getDestinationId() + "]发送设置井盖开启位命令[" + jgon + "]"; + } +} diff --git a/src/com/szpg/plc/message/command/write/SetJgUnlockBitCommand.java b/src/com/szpg/plc/message/command/write/SetJgUnlockBitCommand.java index e3898b4..cfe7a6b 100644 --- a/src/com/szpg/plc/message/command/write/SetJgUnlockBitCommand.java +++ b/src/com/szpg/plc/message/command/write/SetJgUnlockBitCommand.java @@ -10,8 +10,7 @@ * */ private static final long serialVersionUID = 935723353287421429L; - - public final static int JG_LOCK = 0; //井盖锁定 + public final static int JG_UNLOCK = 1; //井盖解锁 private int unlock; diff --git a/src/com/szpg/plc/message/response/write/SetJgLockBitCommandResponse.java b/src/com/szpg/plc/message/response/write/SetJgLockBitCommandResponse.java new file mode 100644 index 0000000..adb5f9d --- /dev/null +++ b/src/com/szpg/plc/message/response/write/SetJgLockBitCommandResponse.java @@ -0,0 +1,29 @@ +package com.szpg.plc.message.response.write; + +import com.szpg.db.dao.PgDeviceDao; +import com.szpg.db.dao.PgJgDao; +import com.szpg.db.dao.impl.PgDeviceDaoImpl; +import com.szpg.db.dao.impl.PgJgDaoImpl; +import com.szpg.plc.message.response.WriteMemoryCommandResponse; +import org.apache.log4j.Logger; + +public class SetJgLockBitCommandResponse extends WriteMemoryCommandResponse { + + private final Logger logger = Logger.getLogger(this.getClass().getName()); + + private PgJgDao jgDao = new PgJgDaoImpl(); + private PgDeviceDao deviceDao = new PgDeviceDaoImpl(); + + @Override + public void afterAction() { + if (this.isSuccess() == true) { + // 更新设备状态 锁定 + int deviceId = deviceDao.findDeviceIdByCode(this.getDestinationId()); + if (deviceId > 0) { + jgDao.updateDeviceStatus(deviceId, "0"); + } + + logger.info("[" + this.getAcucode() + "]锁定井盖成功"); + } + } +} diff --git a/src/com/szpg/plc/message/response/write/SetJgOffBitCommandResponse.java b/src/com/szpg/plc/message/response/write/SetJgOffBitCommandResponse.java new file mode 100644 index 0000000..f10831c --- /dev/null +++ b/src/com/szpg/plc/message/response/write/SetJgOffBitCommandResponse.java @@ -0,0 +1,29 @@ +package com.szpg.plc.message.response.write; + +import com.szpg.db.dao.PgDeviceDao; +import com.szpg.db.dao.PgJgDao; +import com.szpg.db.dao.impl.PgDeviceDaoImpl; +import com.szpg.db.dao.impl.PgJgDaoImpl; +import com.szpg.plc.message.response.WriteMemoryCommandResponse; +import org.apache.log4j.Logger; + +public class SetJgOffBitCommandResponse extends WriteMemoryCommandResponse { + + private final Logger logger = Logger.getLogger(this.getClass().getName()); + + private PgJgDao jgDao = new PgJgDaoImpl(); + private PgDeviceDao deviceDao = new PgDeviceDaoImpl(); + + @Override + public void afterAction() { + if (this.isSuccess() == true) { + // 更新设备状态 关 + int deviceId = deviceDao.findDeviceIdByCode(this.getDestinationId()); + if (deviceId > 0) { + jgDao.updateDeviceStatus(deviceId, "0"); + } + + logger.info("[" + this.getAcucode() + "]关闭井盖成功"); + } + } +} diff --git a/src/com/szpg/plc/message/response/write/SetJgOnBitCommandResponse.java b/src/com/szpg/plc/message/response/write/SetJgOnBitCommandResponse.java new file mode 100644 index 0000000..35eb98c --- /dev/null +++ b/src/com/szpg/plc/message/response/write/SetJgOnBitCommandResponse.java @@ -0,0 +1,29 @@ +package com.szpg.plc.message.response.write; + +import com.szpg.db.dao.PgDeviceDao; +import com.szpg.db.dao.PgJgDao; +import com.szpg.db.dao.impl.PgDeviceDaoImpl; +import com.szpg.db.dao.impl.PgJgDaoImpl; +import com.szpg.plc.message.response.WriteMemoryCommandResponse; +import org.apache.log4j.Logger; + +public class SetJgOnBitCommandResponse extends WriteMemoryCommandResponse { + + private final Logger logger = Logger.getLogger(this.getClass().getName()); + + private PgJgDao jgDao = new PgJgDaoImpl(); + private PgDeviceDao deviceDao = new PgDeviceDaoImpl(); + + @Override + public void afterAction() { + if (this.isSuccess() == true) { + // 更新设备状态 开 + int deviceId = deviceDao.findDeviceIdByCode(this.getDestinationId()); + if (deviceId > 0) { + jgDao.updateDeviceStatus(deviceId, "1"); + } + + logger.info("[" + this.getAcucode() + "]打开井盖成功"); + } + } +} diff --git a/src/com/szpg/plc/message/response/write/SetJgUnlockBitCommandResponse.java b/src/com/szpg/plc/message/response/write/SetJgUnlockBitCommandResponse.java new file mode 100644 index 0000000..1575f09 --- /dev/null +++ b/src/com/szpg/plc/message/response/write/SetJgUnlockBitCommandResponse.java @@ -0,0 +1,30 @@ +package com.szpg.plc.message.response.write; + +import com.szpg.db.dao.PgDeviceDao; +import com.szpg.db.dao.PgJgDao; +import com.szpg.db.dao.impl.PgDeviceDaoImpl; +import com.szpg.db.dao.impl.PgJgDaoImpl; +import com.szpg.plc.message.command.write.SetJgUnlockBitCommand; +import com.szpg.plc.message.response.WriteMemoryCommandResponse; +import org.apache.log4j.Logger; + +public class SetJgUnlockBitCommandResponse extends WriteMemoryCommandResponse { + + private final Logger logger = Logger.getLogger(this.getClass().getName()); + + private PgJgDao jgDao = new PgJgDaoImpl(); + private PgDeviceDao deviceDao = new PgDeviceDaoImpl(); + + @Override + public void afterAction() { + if (this.isSuccess() == true) { + // 更新设备状态 解锁 + int deviceId = deviceDao.findDeviceIdByCode(this.getDestinationId()); + if (deviceId > 0) { + jgDao.updateDeviceStatus(deviceId, "1"); + } + + logger.info("[" + this.getAcucode() + "]解锁井盖成功"); + } + } +} diff --git a/src/com/szpg/plc/message/response/write/SetZmOffBitCommandResponse.java b/src/com/szpg/plc/message/response/write/SetZmOffBitCommandResponse.java new file mode 100644 index 0000000..bd36ece --- /dev/null +++ b/src/com/szpg/plc/message/response/write/SetZmOffBitCommandResponse.java @@ -0,0 +1,29 @@ +package com.szpg.plc.message.response.write; + +import com.szpg.db.dao.PgDeviceDao; +import com.szpg.db.dao.PgJgDao; +import com.szpg.db.dao.impl.PgDeviceDaoImpl; +import com.szpg.db.dao.impl.PgJgDaoImpl; +import com.szpg.plc.message.response.WriteMemoryCommandResponse; +import org.apache.log4j.Logger; + +public class SetZmOffBitCommandResponse extends WriteMemoryCommandResponse { + + private final Logger logger = Logger.getLogger(this.getClass().getName()); + + private PgJgDao jgDao = new PgJgDaoImpl(); + private PgDeviceDao deviceDao = new PgDeviceDaoImpl(); + + @Override + public void afterAction() { + if (this.isSuccess() == true) { + // 更新设备状态 关 + int deviceId = deviceDao.findDeviceIdByCode(this.getDestinationId()); + if (deviceId > 0) { + jgDao.updateDeviceStatus(deviceId, "0"); + } + + logger.info("[" + this.getAcucode() + "]关闭照明成功"); + } + } +} diff --git a/src/com/szpg/plc/message/response/write/SetZmOnBitCommandResponse.java b/src/com/szpg/plc/message/response/write/SetZmOnBitCommandResponse.java new file mode 100644 index 0000000..61822b8 --- /dev/null +++ b/src/com/szpg/plc/message/response/write/SetZmOnBitCommandResponse.java @@ -0,0 +1,29 @@ +package com.szpg.plc.message.response.write; + +import com.szpg.db.dao.PgDeviceDao; +import com.szpg.db.dao.PgJgDao; +import com.szpg.db.dao.impl.PgDeviceDaoImpl; +import com.szpg.db.dao.impl.PgJgDaoImpl; +import com.szpg.plc.message.response.WriteMemoryCommandResponse; +import org.apache.log4j.Logger; + +public class SetZmOnBitCommandResponse extends WriteMemoryCommandResponse { + + private final Logger logger = Logger.getLogger(this.getClass().getName()); + + private PgJgDao jgDao = new PgJgDaoImpl(); + private PgDeviceDao deviceDao = new PgDeviceDaoImpl(); + + @Override + public void afterAction() { + if (this.isSuccess() == true) { + // 更新设备状态 开 + int deviceId = deviceDao.findDeviceIdByCode(this.getDestinationId()); + if (deviceId > 0) { + jgDao.updateDeviceStatus(deviceId, "1"); + } + + logger.info("[" + this.getAcucode() + "]打开照明成功"); + } + } +} diff --git a/src/com/szpg/plc/server/ACUClientHandler.java b/src/com/szpg/plc/server/ACUClientHandler.java index cab8a25..c61c664 100644 --- a/src/com/szpg/plc/server/ACUClientHandler.java +++ b/src/com/szpg/plc/server/ACUClientHandler.java @@ -109,6 +109,7 @@ if (null != cmd) { rmcr.setAcucode(cmd.getDest_acu_code()); rmcr.setCmdId(cmd.getId()); + rmcr.setDestinationId(cmd.getDevice_code()); // 用设备资产编号赋值给目标地址 // 字节流已解析 diff --git a/src/com/szpg/rmi/RemoteFJCommandAction.java b/src/com/szpg/rmi/RemoteFJCommandAction.java index 8114c3a..82ddf09 100644 --- a/src/com/szpg/rmi/RemoteFJCommandAction.java +++ b/src/com/szpg/rmi/RemoteFJCommandAction.java @@ -197,9 +197,9 @@ // 目标地址 String dest = client.getNet() + client.getNode() + client.getUnit(); - + DTProtocolInterface finspi = ProtocolFactory.getDefaultDTProtocol(); - + // 1首先将停止位置0 // 该逻辑取消,由设备自行控制 @@ -210,7 +210,7 @@ setOnCmd.setMessageProducerHost(client.getHost()); RemoteDeviceControlService service = new RemoteDeviceControlService(); - service.executeService(client, setOnCmd); + service.executeService(client, setOnCmd, zcbh); Logger.getLogger(this.getClass().getName()).info(setOnCmd); } else { @@ -303,7 +303,7 @@ setOffCmd.setMessageProducerHost(client.getHost()); RemoteDeviceControlService service = new RemoteDeviceControlService(); - service.executeService(client, setOffCmd); + service.executeService(client, setOffCmd, zcbh); Logger.getLogger(this.getClass().getName()).info(setOffCmd); } else { diff --git a/src/com/szpg/rmi/RemoteZMCommandAction.java b/src/com/szpg/rmi/RemoteZMCommandAction.java index 90dbf9a..e934b0e 100644 --- a/src/com/szpg/rmi/RemoteZMCommandAction.java +++ b/src/com/szpg/rmi/RemoteZMCommandAction.java @@ -206,7 +206,7 @@ setOnCmd.setMessageProducerHost(client.getHost()); RemoteDeviceControlService service = new RemoteDeviceControlService(); - service.executeService(client, setOnCmd); + service.executeService(client, setOnCmd, zcbh); Logger.getLogger(this.getClass().getName()).info(setOnCmd); } else { @@ -299,7 +299,7 @@ setOffCmd.setMessageProducerHost(client.getHost()); RemoteDeviceControlService service = new RemoteDeviceControlService(); - service.executeService(client, setOffCmd); + service.executeService(client, setOffCmd, zcbh); Logger.getLogger(this.getClass().getName()).info(setOffCmd); } else { diff --git a/src/com/szpg/service/ReadCommandTimeoutTask.java b/src/com/szpg/service/ReadCommandTimeoutTask.java deleted file mode 100644 index 8a5e247..0000000 --- a/src/com/szpg/service/ReadCommandTimeoutTask.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.szpg.service; - -import com.szpg.db.dao.PgAcuCmdDao; -import com.szpg.db.dao.impl.PgAcuCmdDaoImpl; - -public class ReadCommandTimeoutTask implements Runnable { - - private PgAcuCmdDao cmdDao = new PgAcuCmdDaoImpl(); - private String cmdId; - - public ReadCommandTimeoutTask(String cmdId) { - this.cmdId = cmdId; - } - - @Override - public void run() { - cmdDao.updateCmdRecordTimeout(cmdId); - } - -} diff --git a/src/com/szpg/service/ReadSensorValueService.java b/src/com/szpg/service/ReadSensorValueService.java index 15bd3e0..3345ba9 100644 --- a/src/com/szpg/service/ReadSensorValueService.java +++ b/src/com/szpg/service/ReadSensorValueService.java @@ -52,6 +52,6 @@ // 4定时将数据库中的命令置为超时 int TIMEOUT = Integer.parseInt(Configure.getProperty("sys", "COMMAND_TIMEOUT", "2")); - new ScheduledThreadPoolExecutor(1).schedule(new ReadCommandTimeoutTask(cmd.getId()), TIMEOUT, TimeUnit.MINUTES); + new ScheduledThreadPoolExecutor(1).schedule(new RemoteCommandTimeoutTask(cmd.getId()), TIMEOUT, TimeUnit.MINUTES); } } diff --git a/src/com/szpg/service/RemoteCommandTimeoutTask.java b/src/com/szpg/service/RemoteCommandTimeoutTask.java new file mode 100644 index 0000000..82b432a --- /dev/null +++ b/src/com/szpg/service/RemoteCommandTimeoutTask.java @@ -0,0 +1,20 @@ +package com.szpg.service; + +import com.szpg.db.dao.PgAcuCmdDao; +import com.szpg.db.dao.impl.PgAcuCmdDaoImpl; + +public class RemoteCommandTimeoutTask implements Runnable { + + private PgAcuCmdDao cmdDao = new PgAcuCmdDaoImpl(); + private String cmdId; + + public RemoteCommandTimeoutTask(String cmdId) { + this.cmdId = cmdId; + } + + @Override + public void run() { + cmdDao.updateCmdRecordTimeout(cmdId); + } + +} diff --git a/src/ACUBL.properties b/src/ACUBL.properties index 9c4b0ab..df9ffdb 100644 --- a/src/ACUBL.properties +++ b/src/ACUBL.properties @@ -1,6 +1,6 @@ #ACU\u53D8\u91CF\u8868\u914D\u7F6E\u6587\u4EF6 -######## THXC.ACU001 ######## +######## 01 HXC.ACU001 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU001.CH.COUNT = 6 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -144,7 +144,7 @@ -######## THXC.ACU002 ######## +######## 02 THXC.ACU002 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU002.CH.COUNT = 6 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -288,7 +288,7 @@ -######## THXC.ACU003 ######## +######## 03 THXC.ACU003 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU003.CH.COUNT = 6 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -432,7 +432,7 @@ -######## THXC.ACU004 ######## +######## 04 THXC.ACU004 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU004.CH.COUNT = 6 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -576,7 +576,7 @@ -######## THXC.ACU005 ######## +######## 05 THXC.ACU005 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU005.CH.COUNT = 6 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -720,7 +720,7 @@ -######## THXC.ACU006 ######## +######## 06 THXC.ACU006 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU006.CH.COUNT = 6 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -812,7 +812,7 @@ #\u98CE\u673A\u6570\u91CF -THXC.ACU006.FJ.COUNT = 9 +THXC.ACU006.FJ.COUNT = 6 #\u98CE\u673A\u7F16\u7801\u5217\u8868 THXC.ACU006.FJ.ZC.LIST = THXC.ACU006.F.DFJ01;THXC.ACU006.F.DFJ02;THXC.ACU006.F.SFJ01;THXC.ACU006.F.SFJ02;THXC.ACU006.F.RFJ01;THXC.ACU006.F.RFJ02 #\u98CE\u673A\u72B6\u6001\u8D77\u59CB\u5730\u5740 @@ -864,7 +864,7 @@ -######## THXC.ACU008 ######## +######## 07 THXC.ACU008 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU008.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -1008,7 +1008,7 @@ -######## THXC.ACU009 ######## +######## 08 THXC.ACU009 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU009.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -1152,7 +1152,7 @@ -######## THXC.ACU010 ######## +######## 09 THXC.ACU010 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU010.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -1296,7 +1296,7 @@ -######## THXC.ACU011 ######## +######## 10 THXC.ACU011 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU011.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -1440,7 +1440,7 @@ -######## THXC.ACU013 ######## +######## 11 THXC.ACU013 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU013.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -1584,7 +1584,7 @@ -######## THXC.ACU014 ######## +######## 12 THXC.ACU014 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU014.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -1729,7 +1729,7 @@ -######## THXC.ACU015 ######## +######## 13 THXC.ACU015 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU015.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -1874,7 +1874,7 @@ -######## THXC.ACU016 ######## +######## 14 THXC.ACU016 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU016.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2020,7 +2020,7 @@ ######## \u4E8C\u671F\u4E09\u6807\u6BB5 ######## -######## THXC.ACU301 ######## +######## 01 THXC.ACU301 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU301.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2070,7 +2070,7 @@ -######## THXC.ACU302 ######## +######## 02 THXC.ACU302 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU302.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2083,7 +2083,7 @@ -######## THXC.ACU303 ######## +######## 03 THXC.ACU303 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU303.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2096,7 +2096,7 @@ -######## THXC.ACU304 ######## +######## 04 THXC.ACU304 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU304.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2109,7 +2109,7 @@ -######## THXC.ACU305 ######## +######## 05 THXC.ACU305 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU305.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2122,7 +2122,7 @@ -######## THXC.ACU501 ######## +######## 06 THXC.ACU501 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU501.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2135,7 +2135,7 @@ -######## THXC.ACU502 ######## +######## 07 THXC.ACU502 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU502.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2148,7 +2148,7 @@ -######## THXC.ACU503 ######## +######## 08 THXC.ACU503 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU503.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2161,7 +2161,7 @@ -######## THXC.ACU504 ######## +######## 09 THXC.ACU504 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU504.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2174,7 +2174,7 @@ -######## THXC.ACU505 ######## +######## 10 THXC.ACU505 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU505.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2187,7 +2187,7 @@ -######## THXC.ACU506 ######## +######## 11 THXC.ACU506 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU506.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2200,7 +2200,7 @@ -######## THXC.ACU507 ######## +######## 12 THXC.ACU507 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU507.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2213,7 +2213,7 @@ -######## THXC.ACU601 ######## +######## 13 THXC.ACU601 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU601.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2226,7 +2226,7 @@ -######## THXC.ACU602 ######## +######## 14 THXC.ACU602 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU602.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2239,7 +2239,7 @@ -######## THXC.ACU603 ######## +######## 15 THXC.ACU603 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU603.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2252,7 +2252,7 @@ -######## THXC.ACU604 ######## +######## 16 THXC.ACU604 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU604.WSYQ.COUNT = 6 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2265,7 +2265,7 @@ -######## THXC.ACUS03 ######## +######## 17 THXC.ACUS03 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACUS03.WSYQ.COUNT = 2 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2278,7 +2278,7 @@ -######## THXC.ACUS05 ######## +######## 18 THXC.ACUS05 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACUS05.WSYQ.COUNT = 2 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2291,7 +2291,7 @@ -######## THXC.ACUS06 ######## +######## 19 THXC.ACUS06 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACUS06.WSYQ.COUNT = 2 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2304,6 +2304,103 @@ +######## \u4E8C\u671F\u56DB\u6807\u6BB5 ######## +######## 01 THXC.ACU107 ######## + + +######## 02 THXC.ACU108 ######## + + +######## 03 THXC.ACU109 ######## + + +######## 04 THXC.ACU110 ######## + + +######## 05 THXC.ACU306 ######## + + +######## 06 THXC.ACU307 ######## + + +######## 07 THXC.ACU308 ######## + + +######## 08 THXC.ACU309 ######## + + +######## 09 THXC.ACU401 ######## + + +######## 10 THXC.ACU402 ######## + + +######## 11 THXC.ACU403 ######## + + +######## 12 THXC.ACU404 ######## + + +######## 13 THXC.ACU405 ######## + + +######## 14 THXC.ACU406 ######## + + +######## 15 THXC.ACU407 ######## + + +######## 16 THXC.ACU408 ######## + + +######## 17 THXC.ACUS04 ######## + + +######## 18 THXC.ACU701 ######## + + +######## 19 THXC.ACU702 ######## + + +######## 20 THXC.ACU703 ######## + + +######## 21 THXC.ACU704 ######## + + +######## 22 THXC.ACU705 ######## + + +######## 23 THXC.ACU706 ######## + + +######## 24 THXC.ACU801 ######## + + +######## 25 THXC.ACU802 ######## + + +######## 26 THXC.ACU803 ######## + + +######## 27 THXC.ACU804 ######## + + +######## 28 THXC.ACU805 ######## + + +######## 29 THXC.ACU806 ######## + + +######## 30 THXC.ACU807 ######## + + +######## 31 THXC.ACUS07 ######## + + +######## 32 THXC.ACUS08 ######## + + ######## \u9F99\u7FD4\u8DEF\u71C3\u6C14\u6BB5 THXC.ACU801 ######## #\u98CE\u673A\u6570\u91CF THXC.ACU801.FJ.COUNT = 1 diff --git a/src/com/szpg/db/dao/impl/PgAcuCmdDaoImpl.java b/src/com/szpg/db/dao/impl/PgAcuCmdDaoImpl.java index b752a9c..406d9ee 100644 --- a/src/com/szpg/db/dao/impl/PgAcuCmdDaoImpl.java +++ b/src/com/szpg/db/dao/impl/PgAcuCmdDaoImpl.java @@ -154,13 +154,14 @@ Connection conn = null; String insertStr = "INSERT INTO PG_ACU_CMD " + - "(ID, TM, CMD_TYPE, DEST_ACU_CODE, TIMEOUT) " + - "VALUES (?, TO_DATE(?, 'YYYYMMDDHH24MISS'), ?, ?, '0')"; - Object[] params = new Object[4]; + "(ID, TM, CMD_TYPE, DEST_ACU_CODE, TIMEOUT, DEVICE_CODE) " + + "VALUES (?, TO_DATE(?, 'YYYYMMDDHH24MISS'), ?, ?, '0', ?)"; + Object[] params = new Object[5]; params[0] = cmd.getId(); params[1] = TimeFormat.format(cmd.getTm(), "yyyyMMddHHmmss"); params[2] = cmd.getCmd_type(); params[3] = cmd.getDest_acu_code(); + params[4] = cmd.getDevice_code(); try { conn = ConnectionManager.getConnectionFromC3P0(); diff --git a/src/com/szpg/db/data/PgAcuCmd.java b/src/com/szpg/db/data/PgAcuCmd.java index 9e57628..0f3cabc 100644 --- a/src/com/szpg/db/data/PgAcuCmd.java +++ b/src/com/szpg/db/data/PgAcuCmd.java @@ -23,6 +23,7 @@ private Date tm; // 命令发送时间 private String cmd_type; // 命令类型 private String dest_acu_code; // 目标ACU代码 + private String device_code; // 命令的资产编号 private boolean timeout; // 是否超时 public PgAcuCmd() { @@ -62,6 +63,14 @@ this.dest_acu_code = dest_acu_code; } + public String getDevice_code() { + return device_code; + } + + public void setDevice_code(String device_code) { + this.device_code = device_code; + } + public boolean isTimeout() { return timeout; } diff --git a/src/com/szpg/plc/PGDSCServlet.java b/src/com/szpg/plc/PGDSCServlet.java index 5653eb6..881c2e3 100644 --- a/src/com/szpg/plc/PGDSCServlet.java +++ b/src/com/szpg/plc/PGDSCServlet.java @@ -104,13 +104,13 @@ sendQueryJGStatusCommand(); //10巡检数据同步 - synchAssetInSpection(); +// synchAssetInSpection(); //运维数据同步 - synchMaintanceRecord(); +// synchMaintanceRecord(); // 查询二期温湿度氧气实时数据 - sendQueryWSYQValueCommand(); +// sendQueryWSYQValueCommand(); } /** diff --git a/src/com/szpg/plc/message/command/write/SetJgLockBitCommand.java b/src/com/szpg/plc/message/command/write/SetJgLockBitCommand.java new file mode 100644 index 0000000..f4bc55a --- /dev/null +++ b/src/com/szpg/plc/message/command/write/SetJgLockBitCommand.java @@ -0,0 +1,40 @@ +package com.szpg.plc.message.command.write; + +import com.szpg.plc.message.AppMessageConstants; +import com.szpg.plc.message.command.WriteMemoryCommand; +import com.szpg.plc.message.response.WriteMemoryCommandResponse; + +public class SetJgLockBitCommand extends WriteMemoryCommand { + + /** + * + */ + private static final long serialVersionUID = 935723353287421429L; + + public final static int JG_LOCK = 0; //井盖锁定 + + private int unlock; + + public int getUnlock() { + return unlock; + } + + public void setUnlock(int unlock) { + this.unlock = unlock; + } + + @Override + public String getCommandType() { + return AppMessageConstants.CMD_TYPE_SETJGLOCK; + } + + @Override + public Class getResponseClass() { + return WriteMemoryCommandResponse.class; + } + + @Override + public String toString() { + return "向终端[" + getDestinationId() + "]发送设置井盖锁定命令"; + } +} diff --git a/src/com/szpg/plc/message/command/write/SetJgOffBitCommand.java b/src/com/szpg/plc/message/command/write/SetJgOffBitCommand.java new file mode 100644 index 0000000..185804c --- /dev/null +++ b/src/com/szpg/plc/message/command/write/SetJgOffBitCommand.java @@ -0,0 +1,41 @@ +package com.szpg.plc.message.command.write; + +import com.szpg.plc.message.AppMessageConstants; +import com.szpg.plc.message.command.WriteMemoryCommand; +import com.szpg.plc.message.response.WriteMemoryCommandResponse; + +public class SetJgOffBitCommand extends WriteMemoryCommand { + + /** + * + */ + private static final long serialVersionUID = 935723353287421429L; + + public final static int JG_OFF_ENABLE = 1; // 井盖关闭 + public final static int JG_OFF_DISABLE = 0; // 井盖关闭复位 + + private int jgoff; + + public int getJgoff() { + return jgoff; + } + + public void setJgoff(int jgoff) { + this.jgoff = jgoff; + } + + @Override + public String getCommandType() { + return AppMessageConstants.CMD_TYPE_SETJGOFF; + } + + @Override + public Class getResponseClass() { + return WriteMemoryCommandResponse.class; + } + + @Override + public String toString() { + return "向终端[" + getDestinationId() + "]发送设置井盖关闭位命令[" + jgoff + "]"; + } +} diff --git a/src/com/szpg/plc/message/command/write/SetJgOnBitCommand.java b/src/com/szpg/plc/message/command/write/SetJgOnBitCommand.java new file mode 100644 index 0000000..b63cf19 --- /dev/null +++ b/src/com/szpg/plc/message/command/write/SetJgOnBitCommand.java @@ -0,0 +1,41 @@ +package com.szpg.plc.message.command.write; + +import com.szpg.plc.message.AppMessageConstants; +import com.szpg.plc.message.command.WriteMemoryCommand; +import com.szpg.plc.message.response.WriteMemoryCommandResponse; + +public class SetJgOnBitCommand extends WriteMemoryCommand { + + /** + * + */ + private static final long serialVersionUID = 935723353287421429L; + + public final static int JG_ON_ENABLE = 1; // 井盖打开 + public final static int JG_ON_DISABLE = 0; // 井盖打开复位 + + private int jgon; + + public int getJgon() { + return jgon; + } + + public void setJgon(int jgon) { + this.jgon = jgon; + } + + @Override + public String getCommandType() { + return AppMessageConstants.CMD_TYPE_SETJGON; + } + + @Override + public Class getResponseClass() { + return WriteMemoryCommandResponse.class; + } + + @Override + public String toString() { + return "向终端[" + getDestinationId() + "]发送设置井盖开启位命令[" + jgon + "]"; + } +} diff --git a/src/com/szpg/plc/message/command/write/SetJgUnlockBitCommand.java b/src/com/szpg/plc/message/command/write/SetJgUnlockBitCommand.java index e3898b4..cfe7a6b 100644 --- a/src/com/szpg/plc/message/command/write/SetJgUnlockBitCommand.java +++ b/src/com/szpg/plc/message/command/write/SetJgUnlockBitCommand.java @@ -10,8 +10,7 @@ * */ private static final long serialVersionUID = 935723353287421429L; - - public final static int JG_LOCK = 0; //井盖锁定 + public final static int JG_UNLOCK = 1; //井盖解锁 private int unlock; diff --git a/src/com/szpg/plc/message/response/write/SetJgLockBitCommandResponse.java b/src/com/szpg/plc/message/response/write/SetJgLockBitCommandResponse.java new file mode 100644 index 0000000..adb5f9d --- /dev/null +++ b/src/com/szpg/plc/message/response/write/SetJgLockBitCommandResponse.java @@ -0,0 +1,29 @@ +package com.szpg.plc.message.response.write; + +import com.szpg.db.dao.PgDeviceDao; +import com.szpg.db.dao.PgJgDao; +import com.szpg.db.dao.impl.PgDeviceDaoImpl; +import com.szpg.db.dao.impl.PgJgDaoImpl; +import com.szpg.plc.message.response.WriteMemoryCommandResponse; +import org.apache.log4j.Logger; + +public class SetJgLockBitCommandResponse extends WriteMemoryCommandResponse { + + private final Logger logger = Logger.getLogger(this.getClass().getName()); + + private PgJgDao jgDao = new PgJgDaoImpl(); + private PgDeviceDao deviceDao = new PgDeviceDaoImpl(); + + @Override + public void afterAction() { + if (this.isSuccess() == true) { + // 更新设备状态 锁定 + int deviceId = deviceDao.findDeviceIdByCode(this.getDestinationId()); + if (deviceId > 0) { + jgDao.updateDeviceStatus(deviceId, "0"); + } + + logger.info("[" + this.getAcucode() + "]锁定井盖成功"); + } + } +} diff --git a/src/com/szpg/plc/message/response/write/SetJgOffBitCommandResponse.java b/src/com/szpg/plc/message/response/write/SetJgOffBitCommandResponse.java new file mode 100644 index 0000000..f10831c --- /dev/null +++ b/src/com/szpg/plc/message/response/write/SetJgOffBitCommandResponse.java @@ -0,0 +1,29 @@ +package com.szpg.plc.message.response.write; + +import com.szpg.db.dao.PgDeviceDao; +import com.szpg.db.dao.PgJgDao; +import com.szpg.db.dao.impl.PgDeviceDaoImpl; +import com.szpg.db.dao.impl.PgJgDaoImpl; +import com.szpg.plc.message.response.WriteMemoryCommandResponse; +import org.apache.log4j.Logger; + +public class SetJgOffBitCommandResponse extends WriteMemoryCommandResponse { + + private final Logger logger = Logger.getLogger(this.getClass().getName()); + + private PgJgDao jgDao = new PgJgDaoImpl(); + private PgDeviceDao deviceDao = new PgDeviceDaoImpl(); + + @Override + public void afterAction() { + if (this.isSuccess() == true) { + // 更新设备状态 关 + int deviceId = deviceDao.findDeviceIdByCode(this.getDestinationId()); + if (deviceId > 0) { + jgDao.updateDeviceStatus(deviceId, "0"); + } + + logger.info("[" + this.getAcucode() + "]关闭井盖成功"); + } + } +} diff --git a/src/com/szpg/plc/message/response/write/SetJgOnBitCommandResponse.java b/src/com/szpg/plc/message/response/write/SetJgOnBitCommandResponse.java new file mode 100644 index 0000000..35eb98c --- /dev/null +++ b/src/com/szpg/plc/message/response/write/SetJgOnBitCommandResponse.java @@ -0,0 +1,29 @@ +package com.szpg.plc.message.response.write; + +import com.szpg.db.dao.PgDeviceDao; +import com.szpg.db.dao.PgJgDao; +import com.szpg.db.dao.impl.PgDeviceDaoImpl; +import com.szpg.db.dao.impl.PgJgDaoImpl; +import com.szpg.plc.message.response.WriteMemoryCommandResponse; +import org.apache.log4j.Logger; + +public class SetJgOnBitCommandResponse extends WriteMemoryCommandResponse { + + private final Logger logger = Logger.getLogger(this.getClass().getName()); + + private PgJgDao jgDao = new PgJgDaoImpl(); + private PgDeviceDao deviceDao = new PgDeviceDaoImpl(); + + @Override + public void afterAction() { + if (this.isSuccess() == true) { + // 更新设备状态 开 + int deviceId = deviceDao.findDeviceIdByCode(this.getDestinationId()); + if (deviceId > 0) { + jgDao.updateDeviceStatus(deviceId, "1"); + } + + logger.info("[" + this.getAcucode() + "]打开井盖成功"); + } + } +} diff --git a/src/com/szpg/plc/message/response/write/SetJgUnlockBitCommandResponse.java b/src/com/szpg/plc/message/response/write/SetJgUnlockBitCommandResponse.java new file mode 100644 index 0000000..1575f09 --- /dev/null +++ b/src/com/szpg/plc/message/response/write/SetJgUnlockBitCommandResponse.java @@ -0,0 +1,30 @@ +package com.szpg.plc.message.response.write; + +import com.szpg.db.dao.PgDeviceDao; +import com.szpg.db.dao.PgJgDao; +import com.szpg.db.dao.impl.PgDeviceDaoImpl; +import com.szpg.db.dao.impl.PgJgDaoImpl; +import com.szpg.plc.message.command.write.SetJgUnlockBitCommand; +import com.szpg.plc.message.response.WriteMemoryCommandResponse; +import org.apache.log4j.Logger; + +public class SetJgUnlockBitCommandResponse extends WriteMemoryCommandResponse { + + private final Logger logger = Logger.getLogger(this.getClass().getName()); + + private PgJgDao jgDao = new PgJgDaoImpl(); + private PgDeviceDao deviceDao = new PgDeviceDaoImpl(); + + @Override + public void afterAction() { + if (this.isSuccess() == true) { + // 更新设备状态 解锁 + int deviceId = deviceDao.findDeviceIdByCode(this.getDestinationId()); + if (deviceId > 0) { + jgDao.updateDeviceStatus(deviceId, "1"); + } + + logger.info("[" + this.getAcucode() + "]解锁井盖成功"); + } + } +} diff --git a/src/com/szpg/plc/message/response/write/SetZmOffBitCommandResponse.java b/src/com/szpg/plc/message/response/write/SetZmOffBitCommandResponse.java new file mode 100644 index 0000000..bd36ece --- /dev/null +++ b/src/com/szpg/plc/message/response/write/SetZmOffBitCommandResponse.java @@ -0,0 +1,29 @@ +package com.szpg.plc.message.response.write; + +import com.szpg.db.dao.PgDeviceDao; +import com.szpg.db.dao.PgJgDao; +import com.szpg.db.dao.impl.PgDeviceDaoImpl; +import com.szpg.db.dao.impl.PgJgDaoImpl; +import com.szpg.plc.message.response.WriteMemoryCommandResponse; +import org.apache.log4j.Logger; + +public class SetZmOffBitCommandResponse extends WriteMemoryCommandResponse { + + private final Logger logger = Logger.getLogger(this.getClass().getName()); + + private PgJgDao jgDao = new PgJgDaoImpl(); + private PgDeviceDao deviceDao = new PgDeviceDaoImpl(); + + @Override + public void afterAction() { + if (this.isSuccess() == true) { + // 更新设备状态 关 + int deviceId = deviceDao.findDeviceIdByCode(this.getDestinationId()); + if (deviceId > 0) { + jgDao.updateDeviceStatus(deviceId, "0"); + } + + logger.info("[" + this.getAcucode() + "]关闭照明成功"); + } + } +} diff --git a/src/com/szpg/plc/message/response/write/SetZmOnBitCommandResponse.java b/src/com/szpg/plc/message/response/write/SetZmOnBitCommandResponse.java new file mode 100644 index 0000000..61822b8 --- /dev/null +++ b/src/com/szpg/plc/message/response/write/SetZmOnBitCommandResponse.java @@ -0,0 +1,29 @@ +package com.szpg.plc.message.response.write; + +import com.szpg.db.dao.PgDeviceDao; +import com.szpg.db.dao.PgJgDao; +import com.szpg.db.dao.impl.PgDeviceDaoImpl; +import com.szpg.db.dao.impl.PgJgDaoImpl; +import com.szpg.plc.message.response.WriteMemoryCommandResponse; +import org.apache.log4j.Logger; + +public class SetZmOnBitCommandResponse extends WriteMemoryCommandResponse { + + private final Logger logger = Logger.getLogger(this.getClass().getName()); + + private PgJgDao jgDao = new PgJgDaoImpl(); + private PgDeviceDao deviceDao = new PgDeviceDaoImpl(); + + @Override + public void afterAction() { + if (this.isSuccess() == true) { + // 更新设备状态 开 + int deviceId = deviceDao.findDeviceIdByCode(this.getDestinationId()); + if (deviceId > 0) { + jgDao.updateDeviceStatus(deviceId, "1"); + } + + logger.info("[" + this.getAcucode() + "]打开照明成功"); + } + } +} diff --git a/src/com/szpg/plc/server/ACUClientHandler.java b/src/com/szpg/plc/server/ACUClientHandler.java index cab8a25..c61c664 100644 --- a/src/com/szpg/plc/server/ACUClientHandler.java +++ b/src/com/szpg/plc/server/ACUClientHandler.java @@ -109,6 +109,7 @@ if (null != cmd) { rmcr.setAcucode(cmd.getDest_acu_code()); rmcr.setCmdId(cmd.getId()); + rmcr.setDestinationId(cmd.getDevice_code()); // 用设备资产编号赋值给目标地址 // 字节流已解析 diff --git a/src/com/szpg/rmi/RemoteFJCommandAction.java b/src/com/szpg/rmi/RemoteFJCommandAction.java index 8114c3a..82ddf09 100644 --- a/src/com/szpg/rmi/RemoteFJCommandAction.java +++ b/src/com/szpg/rmi/RemoteFJCommandAction.java @@ -197,9 +197,9 @@ // 目标地址 String dest = client.getNet() + client.getNode() + client.getUnit(); - + DTProtocolInterface finspi = ProtocolFactory.getDefaultDTProtocol(); - + // 1首先将停止位置0 // 该逻辑取消,由设备自行控制 @@ -210,7 +210,7 @@ setOnCmd.setMessageProducerHost(client.getHost()); RemoteDeviceControlService service = new RemoteDeviceControlService(); - service.executeService(client, setOnCmd); + service.executeService(client, setOnCmd, zcbh); Logger.getLogger(this.getClass().getName()).info(setOnCmd); } else { @@ -303,7 +303,7 @@ setOffCmd.setMessageProducerHost(client.getHost()); RemoteDeviceControlService service = new RemoteDeviceControlService(); - service.executeService(client, setOffCmd); + service.executeService(client, setOffCmd, zcbh); Logger.getLogger(this.getClass().getName()).info(setOffCmd); } else { diff --git a/src/com/szpg/rmi/RemoteZMCommandAction.java b/src/com/szpg/rmi/RemoteZMCommandAction.java index 90dbf9a..e934b0e 100644 --- a/src/com/szpg/rmi/RemoteZMCommandAction.java +++ b/src/com/szpg/rmi/RemoteZMCommandAction.java @@ -206,7 +206,7 @@ setOnCmd.setMessageProducerHost(client.getHost()); RemoteDeviceControlService service = new RemoteDeviceControlService(); - service.executeService(client, setOnCmd); + service.executeService(client, setOnCmd, zcbh); Logger.getLogger(this.getClass().getName()).info(setOnCmd); } else { @@ -299,7 +299,7 @@ setOffCmd.setMessageProducerHost(client.getHost()); RemoteDeviceControlService service = new RemoteDeviceControlService(); - service.executeService(client, setOffCmd); + service.executeService(client, setOffCmd, zcbh); Logger.getLogger(this.getClass().getName()).info(setOffCmd); } else { diff --git a/src/com/szpg/service/ReadCommandTimeoutTask.java b/src/com/szpg/service/ReadCommandTimeoutTask.java deleted file mode 100644 index 8a5e247..0000000 --- a/src/com/szpg/service/ReadCommandTimeoutTask.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.szpg.service; - -import com.szpg.db.dao.PgAcuCmdDao; -import com.szpg.db.dao.impl.PgAcuCmdDaoImpl; - -public class ReadCommandTimeoutTask implements Runnable { - - private PgAcuCmdDao cmdDao = new PgAcuCmdDaoImpl(); - private String cmdId; - - public ReadCommandTimeoutTask(String cmdId) { - this.cmdId = cmdId; - } - - @Override - public void run() { - cmdDao.updateCmdRecordTimeout(cmdId); - } - -} diff --git a/src/com/szpg/service/ReadSensorValueService.java b/src/com/szpg/service/ReadSensorValueService.java index 15bd3e0..3345ba9 100644 --- a/src/com/szpg/service/ReadSensorValueService.java +++ b/src/com/szpg/service/ReadSensorValueService.java @@ -52,6 +52,6 @@ // 4定时将数据库中的命令置为超时 int TIMEOUT = Integer.parseInt(Configure.getProperty("sys", "COMMAND_TIMEOUT", "2")); - new ScheduledThreadPoolExecutor(1).schedule(new ReadCommandTimeoutTask(cmd.getId()), TIMEOUT, TimeUnit.MINUTES); + new ScheduledThreadPoolExecutor(1).schedule(new RemoteCommandTimeoutTask(cmd.getId()), TIMEOUT, TimeUnit.MINUTES); } } diff --git a/src/com/szpg/service/RemoteCommandTimeoutTask.java b/src/com/szpg/service/RemoteCommandTimeoutTask.java new file mode 100644 index 0000000..82b432a --- /dev/null +++ b/src/com/szpg/service/RemoteCommandTimeoutTask.java @@ -0,0 +1,20 @@ +package com.szpg.service; + +import com.szpg.db.dao.PgAcuCmdDao; +import com.szpg.db.dao.impl.PgAcuCmdDaoImpl; + +public class RemoteCommandTimeoutTask implements Runnable { + + private PgAcuCmdDao cmdDao = new PgAcuCmdDaoImpl(); + private String cmdId; + + public RemoteCommandTimeoutTask(String cmdId) { + this.cmdId = cmdId; + } + + @Override + public void run() { + cmdDao.updateCmdRecordTimeout(cmdId); + } + +} diff --git a/src/com/szpg/service/RemoteDeviceControlService.java b/src/com/szpg/service/RemoteDeviceControlService.java index 43fc53f..de5939a 100644 --- a/src/com/szpg/service/RemoteDeviceControlService.java +++ b/src/com/szpg/service/RemoteDeviceControlService.java @@ -11,8 +11,12 @@ import com.szpg.plc.protocol.ProtocolFactory; import com.szpg.plc.server.ACUClient; import com.szpg.plc.server.ACUClientUtil; +import com.szpg.util.Configure; import org.apache.log4j.Logger; +import java.util.concurrent.ScheduledThreadPoolExecutor; +import java.util.concurrent.TimeUnit; + /** * 远程控制设备 * @@ -26,7 +30,7 @@ private PgAcuCmdDao cmdDao = new PgAcuCmdDaoImpl(); private PgAcuDao acuDao = new PgAcuDaoImpl(); - public void executeService(ACUClient client, WriteMemoryCommand command) { + public void executeService(ACUClient client, WriteMemoryCommand command, String zcbh) { // 解析命令对象为字节数组 DTProtocolInterface finspi = ProtocolFactory.getDefaultDTProtocol(); byte[] content = finspi.messageToBytes(command); @@ -45,9 +49,14 @@ cmd.setCmd_type(command.getCommandType()); cmd.setDest_acu_code(acu.getAcu_code()); cmd.setTm(command.getTime().getTime()); + cmd.setDevice_code(zcbh); // 3将命令保存入数据库 cmdDao.addCmdRecord(cmd); + + // 4定时将数据库中的命令置为超时 + int TIMEOUT = Integer.parseInt(Configure.getProperty("sys", "COMMAND_TIMEOUT", "2")); + new ScheduledThreadPoolExecutor(1).schedule(new RemoteCommandTimeoutTask(cmd.getId()), TIMEOUT, TimeUnit.MINUTES); } } diff --git a/src/ACUBL.properties b/src/ACUBL.properties index 9c4b0ab..df9ffdb 100644 --- a/src/ACUBL.properties +++ b/src/ACUBL.properties @@ -1,6 +1,6 @@ #ACU\u53D8\u91CF\u8868\u914D\u7F6E\u6587\u4EF6 -######## THXC.ACU001 ######## +######## 01 HXC.ACU001 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU001.CH.COUNT = 6 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -144,7 +144,7 @@ -######## THXC.ACU002 ######## +######## 02 THXC.ACU002 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU002.CH.COUNT = 6 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -288,7 +288,7 @@ -######## THXC.ACU003 ######## +######## 03 THXC.ACU003 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU003.CH.COUNT = 6 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -432,7 +432,7 @@ -######## THXC.ACU004 ######## +######## 04 THXC.ACU004 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU004.CH.COUNT = 6 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -576,7 +576,7 @@ -######## THXC.ACU005 ######## +######## 05 THXC.ACU005 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU005.CH.COUNT = 6 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -720,7 +720,7 @@ -######## THXC.ACU006 ######## +######## 06 THXC.ACU006 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU006.CH.COUNT = 6 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -812,7 +812,7 @@ #\u98CE\u673A\u6570\u91CF -THXC.ACU006.FJ.COUNT = 9 +THXC.ACU006.FJ.COUNT = 6 #\u98CE\u673A\u7F16\u7801\u5217\u8868 THXC.ACU006.FJ.ZC.LIST = THXC.ACU006.F.DFJ01;THXC.ACU006.F.DFJ02;THXC.ACU006.F.SFJ01;THXC.ACU006.F.SFJ02;THXC.ACU006.F.RFJ01;THXC.ACU006.F.RFJ02 #\u98CE\u673A\u72B6\u6001\u8D77\u59CB\u5730\u5740 @@ -864,7 +864,7 @@ -######## THXC.ACU008 ######## +######## 07 THXC.ACU008 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU008.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -1008,7 +1008,7 @@ -######## THXC.ACU009 ######## +######## 08 THXC.ACU009 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU009.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -1152,7 +1152,7 @@ -######## THXC.ACU010 ######## +######## 09 THXC.ACU010 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU010.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -1296,7 +1296,7 @@ -######## THXC.ACU011 ######## +######## 10 THXC.ACU011 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU011.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -1440,7 +1440,7 @@ -######## THXC.ACU013 ######## +######## 11 THXC.ACU013 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU013.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -1584,7 +1584,7 @@ -######## THXC.ACU014 ######## +######## 12 THXC.ACU014 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU014.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -1729,7 +1729,7 @@ -######## THXC.ACU015 ######## +######## 13 THXC.ACU015 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU015.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -1874,7 +1874,7 @@ -######## THXC.ACU016 ######## +######## 14 THXC.ACU016 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU016.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2020,7 +2020,7 @@ ######## \u4E8C\u671F\u4E09\u6807\u6BB5 ######## -######## THXC.ACU301 ######## +######## 01 THXC.ACU301 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU301.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2070,7 +2070,7 @@ -######## THXC.ACU302 ######## +######## 02 THXC.ACU302 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU302.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2083,7 +2083,7 @@ -######## THXC.ACU303 ######## +######## 03 THXC.ACU303 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU303.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2096,7 +2096,7 @@ -######## THXC.ACU304 ######## +######## 04 THXC.ACU304 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU304.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2109,7 +2109,7 @@ -######## THXC.ACU305 ######## +######## 05 THXC.ACU305 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU305.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2122,7 +2122,7 @@ -######## THXC.ACU501 ######## +######## 06 THXC.ACU501 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU501.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2135,7 +2135,7 @@ -######## THXC.ACU502 ######## +######## 07 THXC.ACU502 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU502.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2148,7 +2148,7 @@ -######## THXC.ACU503 ######## +######## 08 THXC.ACU503 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU503.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2161,7 +2161,7 @@ -######## THXC.ACU504 ######## +######## 09 THXC.ACU504 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU504.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2174,7 +2174,7 @@ -######## THXC.ACU505 ######## +######## 10 THXC.ACU505 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU505.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2187,7 +2187,7 @@ -######## THXC.ACU506 ######## +######## 11 THXC.ACU506 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU506.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2200,7 +2200,7 @@ -######## THXC.ACU507 ######## +######## 12 THXC.ACU507 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU507.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2213,7 +2213,7 @@ -######## THXC.ACU601 ######## +######## 13 THXC.ACU601 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU601.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2226,7 +2226,7 @@ -######## THXC.ACU602 ######## +######## 14 THXC.ACU602 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU602.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2239,7 +2239,7 @@ -######## THXC.ACU603 ######## +######## 15 THXC.ACU603 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU603.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2252,7 +2252,7 @@ -######## THXC.ACU604 ######## +######## 16 THXC.ACU604 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU604.WSYQ.COUNT = 6 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2265,7 +2265,7 @@ -######## THXC.ACUS03 ######## +######## 17 THXC.ACUS03 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACUS03.WSYQ.COUNT = 2 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2278,7 +2278,7 @@ -######## THXC.ACUS05 ######## +######## 18 THXC.ACUS05 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACUS05.WSYQ.COUNT = 2 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2291,7 +2291,7 @@ -######## THXC.ACUS06 ######## +######## 19 THXC.ACUS06 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACUS06.WSYQ.COUNT = 2 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2304,6 +2304,103 @@ +######## \u4E8C\u671F\u56DB\u6807\u6BB5 ######## +######## 01 THXC.ACU107 ######## + + +######## 02 THXC.ACU108 ######## + + +######## 03 THXC.ACU109 ######## + + +######## 04 THXC.ACU110 ######## + + +######## 05 THXC.ACU306 ######## + + +######## 06 THXC.ACU307 ######## + + +######## 07 THXC.ACU308 ######## + + +######## 08 THXC.ACU309 ######## + + +######## 09 THXC.ACU401 ######## + + +######## 10 THXC.ACU402 ######## + + +######## 11 THXC.ACU403 ######## + + +######## 12 THXC.ACU404 ######## + + +######## 13 THXC.ACU405 ######## + + +######## 14 THXC.ACU406 ######## + + +######## 15 THXC.ACU407 ######## + + +######## 16 THXC.ACU408 ######## + + +######## 17 THXC.ACUS04 ######## + + +######## 18 THXC.ACU701 ######## + + +######## 19 THXC.ACU702 ######## + + +######## 20 THXC.ACU703 ######## + + +######## 21 THXC.ACU704 ######## + + +######## 22 THXC.ACU705 ######## + + +######## 23 THXC.ACU706 ######## + + +######## 24 THXC.ACU801 ######## + + +######## 25 THXC.ACU802 ######## + + +######## 26 THXC.ACU803 ######## + + +######## 27 THXC.ACU804 ######## + + +######## 28 THXC.ACU805 ######## + + +######## 29 THXC.ACU806 ######## + + +######## 30 THXC.ACU807 ######## + + +######## 31 THXC.ACUS07 ######## + + +######## 32 THXC.ACUS08 ######## + + ######## \u9F99\u7FD4\u8DEF\u71C3\u6C14\u6BB5 THXC.ACU801 ######## #\u98CE\u673A\u6570\u91CF THXC.ACU801.FJ.COUNT = 1 diff --git a/src/com/szpg/db/dao/impl/PgAcuCmdDaoImpl.java b/src/com/szpg/db/dao/impl/PgAcuCmdDaoImpl.java index b752a9c..406d9ee 100644 --- a/src/com/szpg/db/dao/impl/PgAcuCmdDaoImpl.java +++ b/src/com/szpg/db/dao/impl/PgAcuCmdDaoImpl.java @@ -154,13 +154,14 @@ Connection conn = null; String insertStr = "INSERT INTO PG_ACU_CMD " + - "(ID, TM, CMD_TYPE, DEST_ACU_CODE, TIMEOUT) " + - "VALUES (?, TO_DATE(?, 'YYYYMMDDHH24MISS'), ?, ?, '0')"; - Object[] params = new Object[4]; + "(ID, TM, CMD_TYPE, DEST_ACU_CODE, TIMEOUT, DEVICE_CODE) " + + "VALUES (?, TO_DATE(?, 'YYYYMMDDHH24MISS'), ?, ?, '0', ?)"; + Object[] params = new Object[5]; params[0] = cmd.getId(); params[1] = TimeFormat.format(cmd.getTm(), "yyyyMMddHHmmss"); params[2] = cmd.getCmd_type(); params[3] = cmd.getDest_acu_code(); + params[4] = cmd.getDevice_code(); try { conn = ConnectionManager.getConnectionFromC3P0(); diff --git a/src/com/szpg/db/data/PgAcuCmd.java b/src/com/szpg/db/data/PgAcuCmd.java index 9e57628..0f3cabc 100644 --- a/src/com/szpg/db/data/PgAcuCmd.java +++ b/src/com/szpg/db/data/PgAcuCmd.java @@ -23,6 +23,7 @@ private Date tm; // 命令发送时间 private String cmd_type; // 命令类型 private String dest_acu_code; // 目标ACU代码 + private String device_code; // 命令的资产编号 private boolean timeout; // 是否超时 public PgAcuCmd() { @@ -62,6 +63,14 @@ this.dest_acu_code = dest_acu_code; } + public String getDevice_code() { + return device_code; + } + + public void setDevice_code(String device_code) { + this.device_code = device_code; + } + public boolean isTimeout() { return timeout; } diff --git a/src/com/szpg/plc/PGDSCServlet.java b/src/com/szpg/plc/PGDSCServlet.java index 5653eb6..881c2e3 100644 --- a/src/com/szpg/plc/PGDSCServlet.java +++ b/src/com/szpg/plc/PGDSCServlet.java @@ -104,13 +104,13 @@ sendQueryJGStatusCommand(); //10巡检数据同步 - synchAssetInSpection(); +// synchAssetInSpection(); //运维数据同步 - synchMaintanceRecord(); +// synchMaintanceRecord(); // 查询二期温湿度氧气实时数据 - sendQueryWSYQValueCommand(); +// sendQueryWSYQValueCommand(); } /** diff --git a/src/com/szpg/plc/message/command/write/SetJgLockBitCommand.java b/src/com/szpg/plc/message/command/write/SetJgLockBitCommand.java new file mode 100644 index 0000000..f4bc55a --- /dev/null +++ b/src/com/szpg/plc/message/command/write/SetJgLockBitCommand.java @@ -0,0 +1,40 @@ +package com.szpg.plc.message.command.write; + +import com.szpg.plc.message.AppMessageConstants; +import com.szpg.plc.message.command.WriteMemoryCommand; +import com.szpg.plc.message.response.WriteMemoryCommandResponse; + +public class SetJgLockBitCommand extends WriteMemoryCommand { + + /** + * + */ + private static final long serialVersionUID = 935723353287421429L; + + public final static int JG_LOCK = 0; //井盖锁定 + + private int unlock; + + public int getUnlock() { + return unlock; + } + + public void setUnlock(int unlock) { + this.unlock = unlock; + } + + @Override + public String getCommandType() { + return AppMessageConstants.CMD_TYPE_SETJGLOCK; + } + + @Override + public Class getResponseClass() { + return WriteMemoryCommandResponse.class; + } + + @Override + public String toString() { + return "向终端[" + getDestinationId() + "]发送设置井盖锁定命令"; + } +} diff --git a/src/com/szpg/plc/message/command/write/SetJgOffBitCommand.java b/src/com/szpg/plc/message/command/write/SetJgOffBitCommand.java new file mode 100644 index 0000000..185804c --- /dev/null +++ b/src/com/szpg/plc/message/command/write/SetJgOffBitCommand.java @@ -0,0 +1,41 @@ +package com.szpg.plc.message.command.write; + +import com.szpg.plc.message.AppMessageConstants; +import com.szpg.plc.message.command.WriteMemoryCommand; +import com.szpg.plc.message.response.WriteMemoryCommandResponse; + +public class SetJgOffBitCommand extends WriteMemoryCommand { + + /** + * + */ + private static final long serialVersionUID = 935723353287421429L; + + public final static int JG_OFF_ENABLE = 1; // 井盖关闭 + public final static int JG_OFF_DISABLE = 0; // 井盖关闭复位 + + private int jgoff; + + public int getJgoff() { + return jgoff; + } + + public void setJgoff(int jgoff) { + this.jgoff = jgoff; + } + + @Override + public String getCommandType() { + return AppMessageConstants.CMD_TYPE_SETJGOFF; + } + + @Override + public Class getResponseClass() { + return WriteMemoryCommandResponse.class; + } + + @Override + public String toString() { + return "向终端[" + getDestinationId() + "]发送设置井盖关闭位命令[" + jgoff + "]"; + } +} diff --git a/src/com/szpg/plc/message/command/write/SetJgOnBitCommand.java b/src/com/szpg/plc/message/command/write/SetJgOnBitCommand.java new file mode 100644 index 0000000..b63cf19 --- /dev/null +++ b/src/com/szpg/plc/message/command/write/SetJgOnBitCommand.java @@ -0,0 +1,41 @@ +package com.szpg.plc.message.command.write; + +import com.szpg.plc.message.AppMessageConstants; +import com.szpg.plc.message.command.WriteMemoryCommand; +import com.szpg.plc.message.response.WriteMemoryCommandResponse; + +public class SetJgOnBitCommand extends WriteMemoryCommand { + + /** + * + */ + private static final long serialVersionUID = 935723353287421429L; + + public final static int JG_ON_ENABLE = 1; // 井盖打开 + public final static int JG_ON_DISABLE = 0; // 井盖打开复位 + + private int jgon; + + public int getJgon() { + return jgon; + } + + public void setJgon(int jgon) { + this.jgon = jgon; + } + + @Override + public String getCommandType() { + return AppMessageConstants.CMD_TYPE_SETJGON; + } + + @Override + public Class getResponseClass() { + return WriteMemoryCommandResponse.class; + } + + @Override + public String toString() { + return "向终端[" + getDestinationId() + "]发送设置井盖开启位命令[" + jgon + "]"; + } +} diff --git a/src/com/szpg/plc/message/command/write/SetJgUnlockBitCommand.java b/src/com/szpg/plc/message/command/write/SetJgUnlockBitCommand.java index e3898b4..cfe7a6b 100644 --- a/src/com/szpg/plc/message/command/write/SetJgUnlockBitCommand.java +++ b/src/com/szpg/plc/message/command/write/SetJgUnlockBitCommand.java @@ -10,8 +10,7 @@ * */ private static final long serialVersionUID = 935723353287421429L; - - public final static int JG_LOCK = 0; //井盖锁定 + public final static int JG_UNLOCK = 1; //井盖解锁 private int unlock; diff --git a/src/com/szpg/plc/message/response/write/SetJgLockBitCommandResponse.java b/src/com/szpg/plc/message/response/write/SetJgLockBitCommandResponse.java new file mode 100644 index 0000000..adb5f9d --- /dev/null +++ b/src/com/szpg/plc/message/response/write/SetJgLockBitCommandResponse.java @@ -0,0 +1,29 @@ +package com.szpg.plc.message.response.write; + +import com.szpg.db.dao.PgDeviceDao; +import com.szpg.db.dao.PgJgDao; +import com.szpg.db.dao.impl.PgDeviceDaoImpl; +import com.szpg.db.dao.impl.PgJgDaoImpl; +import com.szpg.plc.message.response.WriteMemoryCommandResponse; +import org.apache.log4j.Logger; + +public class SetJgLockBitCommandResponse extends WriteMemoryCommandResponse { + + private final Logger logger = Logger.getLogger(this.getClass().getName()); + + private PgJgDao jgDao = new PgJgDaoImpl(); + private PgDeviceDao deviceDao = new PgDeviceDaoImpl(); + + @Override + public void afterAction() { + if (this.isSuccess() == true) { + // 更新设备状态 锁定 + int deviceId = deviceDao.findDeviceIdByCode(this.getDestinationId()); + if (deviceId > 0) { + jgDao.updateDeviceStatus(deviceId, "0"); + } + + logger.info("[" + this.getAcucode() + "]锁定井盖成功"); + } + } +} diff --git a/src/com/szpg/plc/message/response/write/SetJgOffBitCommandResponse.java b/src/com/szpg/plc/message/response/write/SetJgOffBitCommandResponse.java new file mode 100644 index 0000000..f10831c --- /dev/null +++ b/src/com/szpg/plc/message/response/write/SetJgOffBitCommandResponse.java @@ -0,0 +1,29 @@ +package com.szpg.plc.message.response.write; + +import com.szpg.db.dao.PgDeviceDao; +import com.szpg.db.dao.PgJgDao; +import com.szpg.db.dao.impl.PgDeviceDaoImpl; +import com.szpg.db.dao.impl.PgJgDaoImpl; +import com.szpg.plc.message.response.WriteMemoryCommandResponse; +import org.apache.log4j.Logger; + +public class SetJgOffBitCommandResponse extends WriteMemoryCommandResponse { + + private final Logger logger = Logger.getLogger(this.getClass().getName()); + + private PgJgDao jgDao = new PgJgDaoImpl(); + private PgDeviceDao deviceDao = new PgDeviceDaoImpl(); + + @Override + public void afterAction() { + if (this.isSuccess() == true) { + // 更新设备状态 关 + int deviceId = deviceDao.findDeviceIdByCode(this.getDestinationId()); + if (deviceId > 0) { + jgDao.updateDeviceStatus(deviceId, "0"); + } + + logger.info("[" + this.getAcucode() + "]关闭井盖成功"); + } + } +} diff --git a/src/com/szpg/plc/message/response/write/SetJgOnBitCommandResponse.java b/src/com/szpg/plc/message/response/write/SetJgOnBitCommandResponse.java new file mode 100644 index 0000000..35eb98c --- /dev/null +++ b/src/com/szpg/plc/message/response/write/SetJgOnBitCommandResponse.java @@ -0,0 +1,29 @@ +package com.szpg.plc.message.response.write; + +import com.szpg.db.dao.PgDeviceDao; +import com.szpg.db.dao.PgJgDao; +import com.szpg.db.dao.impl.PgDeviceDaoImpl; +import com.szpg.db.dao.impl.PgJgDaoImpl; +import com.szpg.plc.message.response.WriteMemoryCommandResponse; +import org.apache.log4j.Logger; + +public class SetJgOnBitCommandResponse extends WriteMemoryCommandResponse { + + private final Logger logger = Logger.getLogger(this.getClass().getName()); + + private PgJgDao jgDao = new PgJgDaoImpl(); + private PgDeviceDao deviceDao = new PgDeviceDaoImpl(); + + @Override + public void afterAction() { + if (this.isSuccess() == true) { + // 更新设备状态 开 + int deviceId = deviceDao.findDeviceIdByCode(this.getDestinationId()); + if (deviceId > 0) { + jgDao.updateDeviceStatus(deviceId, "1"); + } + + logger.info("[" + this.getAcucode() + "]打开井盖成功"); + } + } +} diff --git a/src/com/szpg/plc/message/response/write/SetJgUnlockBitCommandResponse.java b/src/com/szpg/plc/message/response/write/SetJgUnlockBitCommandResponse.java new file mode 100644 index 0000000..1575f09 --- /dev/null +++ b/src/com/szpg/plc/message/response/write/SetJgUnlockBitCommandResponse.java @@ -0,0 +1,30 @@ +package com.szpg.plc.message.response.write; + +import com.szpg.db.dao.PgDeviceDao; +import com.szpg.db.dao.PgJgDao; +import com.szpg.db.dao.impl.PgDeviceDaoImpl; +import com.szpg.db.dao.impl.PgJgDaoImpl; +import com.szpg.plc.message.command.write.SetJgUnlockBitCommand; +import com.szpg.plc.message.response.WriteMemoryCommandResponse; +import org.apache.log4j.Logger; + +public class SetJgUnlockBitCommandResponse extends WriteMemoryCommandResponse { + + private final Logger logger = Logger.getLogger(this.getClass().getName()); + + private PgJgDao jgDao = new PgJgDaoImpl(); + private PgDeviceDao deviceDao = new PgDeviceDaoImpl(); + + @Override + public void afterAction() { + if (this.isSuccess() == true) { + // 更新设备状态 解锁 + int deviceId = deviceDao.findDeviceIdByCode(this.getDestinationId()); + if (deviceId > 0) { + jgDao.updateDeviceStatus(deviceId, "1"); + } + + logger.info("[" + this.getAcucode() + "]解锁井盖成功"); + } + } +} diff --git a/src/com/szpg/plc/message/response/write/SetZmOffBitCommandResponse.java b/src/com/szpg/plc/message/response/write/SetZmOffBitCommandResponse.java new file mode 100644 index 0000000..bd36ece --- /dev/null +++ b/src/com/szpg/plc/message/response/write/SetZmOffBitCommandResponse.java @@ -0,0 +1,29 @@ +package com.szpg.plc.message.response.write; + +import com.szpg.db.dao.PgDeviceDao; +import com.szpg.db.dao.PgJgDao; +import com.szpg.db.dao.impl.PgDeviceDaoImpl; +import com.szpg.db.dao.impl.PgJgDaoImpl; +import com.szpg.plc.message.response.WriteMemoryCommandResponse; +import org.apache.log4j.Logger; + +public class SetZmOffBitCommandResponse extends WriteMemoryCommandResponse { + + private final Logger logger = Logger.getLogger(this.getClass().getName()); + + private PgJgDao jgDao = new PgJgDaoImpl(); + private PgDeviceDao deviceDao = new PgDeviceDaoImpl(); + + @Override + public void afterAction() { + if (this.isSuccess() == true) { + // 更新设备状态 关 + int deviceId = deviceDao.findDeviceIdByCode(this.getDestinationId()); + if (deviceId > 0) { + jgDao.updateDeviceStatus(deviceId, "0"); + } + + logger.info("[" + this.getAcucode() + "]关闭照明成功"); + } + } +} diff --git a/src/com/szpg/plc/message/response/write/SetZmOnBitCommandResponse.java b/src/com/szpg/plc/message/response/write/SetZmOnBitCommandResponse.java new file mode 100644 index 0000000..61822b8 --- /dev/null +++ b/src/com/szpg/plc/message/response/write/SetZmOnBitCommandResponse.java @@ -0,0 +1,29 @@ +package com.szpg.plc.message.response.write; + +import com.szpg.db.dao.PgDeviceDao; +import com.szpg.db.dao.PgJgDao; +import com.szpg.db.dao.impl.PgDeviceDaoImpl; +import com.szpg.db.dao.impl.PgJgDaoImpl; +import com.szpg.plc.message.response.WriteMemoryCommandResponse; +import org.apache.log4j.Logger; + +public class SetZmOnBitCommandResponse extends WriteMemoryCommandResponse { + + private final Logger logger = Logger.getLogger(this.getClass().getName()); + + private PgJgDao jgDao = new PgJgDaoImpl(); + private PgDeviceDao deviceDao = new PgDeviceDaoImpl(); + + @Override + public void afterAction() { + if (this.isSuccess() == true) { + // 更新设备状态 开 + int deviceId = deviceDao.findDeviceIdByCode(this.getDestinationId()); + if (deviceId > 0) { + jgDao.updateDeviceStatus(deviceId, "1"); + } + + logger.info("[" + this.getAcucode() + "]打开照明成功"); + } + } +} diff --git a/src/com/szpg/plc/server/ACUClientHandler.java b/src/com/szpg/plc/server/ACUClientHandler.java index cab8a25..c61c664 100644 --- a/src/com/szpg/plc/server/ACUClientHandler.java +++ b/src/com/szpg/plc/server/ACUClientHandler.java @@ -109,6 +109,7 @@ if (null != cmd) { rmcr.setAcucode(cmd.getDest_acu_code()); rmcr.setCmdId(cmd.getId()); + rmcr.setDestinationId(cmd.getDevice_code()); // 用设备资产编号赋值给目标地址 // 字节流已解析 diff --git a/src/com/szpg/rmi/RemoteFJCommandAction.java b/src/com/szpg/rmi/RemoteFJCommandAction.java index 8114c3a..82ddf09 100644 --- a/src/com/szpg/rmi/RemoteFJCommandAction.java +++ b/src/com/szpg/rmi/RemoteFJCommandAction.java @@ -197,9 +197,9 @@ // 目标地址 String dest = client.getNet() + client.getNode() + client.getUnit(); - + DTProtocolInterface finspi = ProtocolFactory.getDefaultDTProtocol(); - + // 1首先将停止位置0 // 该逻辑取消,由设备自行控制 @@ -210,7 +210,7 @@ setOnCmd.setMessageProducerHost(client.getHost()); RemoteDeviceControlService service = new RemoteDeviceControlService(); - service.executeService(client, setOnCmd); + service.executeService(client, setOnCmd, zcbh); Logger.getLogger(this.getClass().getName()).info(setOnCmd); } else { @@ -303,7 +303,7 @@ setOffCmd.setMessageProducerHost(client.getHost()); RemoteDeviceControlService service = new RemoteDeviceControlService(); - service.executeService(client, setOffCmd); + service.executeService(client, setOffCmd, zcbh); Logger.getLogger(this.getClass().getName()).info(setOffCmd); } else { diff --git a/src/com/szpg/rmi/RemoteZMCommandAction.java b/src/com/szpg/rmi/RemoteZMCommandAction.java index 90dbf9a..e934b0e 100644 --- a/src/com/szpg/rmi/RemoteZMCommandAction.java +++ b/src/com/szpg/rmi/RemoteZMCommandAction.java @@ -206,7 +206,7 @@ setOnCmd.setMessageProducerHost(client.getHost()); RemoteDeviceControlService service = new RemoteDeviceControlService(); - service.executeService(client, setOnCmd); + service.executeService(client, setOnCmd, zcbh); Logger.getLogger(this.getClass().getName()).info(setOnCmd); } else { @@ -299,7 +299,7 @@ setOffCmd.setMessageProducerHost(client.getHost()); RemoteDeviceControlService service = new RemoteDeviceControlService(); - service.executeService(client, setOffCmd); + service.executeService(client, setOffCmd, zcbh); Logger.getLogger(this.getClass().getName()).info(setOffCmd); } else { diff --git a/src/com/szpg/service/ReadCommandTimeoutTask.java b/src/com/szpg/service/ReadCommandTimeoutTask.java deleted file mode 100644 index 8a5e247..0000000 --- a/src/com/szpg/service/ReadCommandTimeoutTask.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.szpg.service; - -import com.szpg.db.dao.PgAcuCmdDao; -import com.szpg.db.dao.impl.PgAcuCmdDaoImpl; - -public class ReadCommandTimeoutTask implements Runnable { - - private PgAcuCmdDao cmdDao = new PgAcuCmdDaoImpl(); - private String cmdId; - - public ReadCommandTimeoutTask(String cmdId) { - this.cmdId = cmdId; - } - - @Override - public void run() { - cmdDao.updateCmdRecordTimeout(cmdId); - } - -} diff --git a/src/com/szpg/service/ReadSensorValueService.java b/src/com/szpg/service/ReadSensorValueService.java index 15bd3e0..3345ba9 100644 --- a/src/com/szpg/service/ReadSensorValueService.java +++ b/src/com/szpg/service/ReadSensorValueService.java @@ -52,6 +52,6 @@ // 4定时将数据库中的命令置为超时 int TIMEOUT = Integer.parseInt(Configure.getProperty("sys", "COMMAND_TIMEOUT", "2")); - new ScheduledThreadPoolExecutor(1).schedule(new ReadCommandTimeoutTask(cmd.getId()), TIMEOUT, TimeUnit.MINUTES); + new ScheduledThreadPoolExecutor(1).schedule(new RemoteCommandTimeoutTask(cmd.getId()), TIMEOUT, TimeUnit.MINUTES); } } diff --git a/src/com/szpg/service/RemoteCommandTimeoutTask.java b/src/com/szpg/service/RemoteCommandTimeoutTask.java new file mode 100644 index 0000000..82b432a --- /dev/null +++ b/src/com/szpg/service/RemoteCommandTimeoutTask.java @@ -0,0 +1,20 @@ +package com.szpg.service; + +import com.szpg.db.dao.PgAcuCmdDao; +import com.szpg.db.dao.impl.PgAcuCmdDaoImpl; + +public class RemoteCommandTimeoutTask implements Runnable { + + private PgAcuCmdDao cmdDao = new PgAcuCmdDaoImpl(); + private String cmdId; + + public RemoteCommandTimeoutTask(String cmdId) { + this.cmdId = cmdId; + } + + @Override + public void run() { + cmdDao.updateCmdRecordTimeout(cmdId); + } + +} diff --git a/src/com/szpg/service/RemoteDeviceControlService.java b/src/com/szpg/service/RemoteDeviceControlService.java index 43fc53f..de5939a 100644 --- a/src/com/szpg/service/RemoteDeviceControlService.java +++ b/src/com/szpg/service/RemoteDeviceControlService.java @@ -11,8 +11,12 @@ import com.szpg.plc.protocol.ProtocolFactory; import com.szpg.plc.server.ACUClient; import com.szpg.plc.server.ACUClientUtil; +import com.szpg.util.Configure; import org.apache.log4j.Logger; +import java.util.concurrent.ScheduledThreadPoolExecutor; +import java.util.concurrent.TimeUnit; + /** * 远程控制设备 * @@ -26,7 +30,7 @@ private PgAcuCmdDao cmdDao = new PgAcuCmdDaoImpl(); private PgAcuDao acuDao = new PgAcuDaoImpl(); - public void executeService(ACUClient client, WriteMemoryCommand command) { + public void executeService(ACUClient client, WriteMemoryCommand command, String zcbh) { // 解析命令对象为字节数组 DTProtocolInterface finspi = ProtocolFactory.getDefaultDTProtocol(); byte[] content = finspi.messageToBytes(command); @@ -45,9 +49,14 @@ cmd.setCmd_type(command.getCommandType()); cmd.setDest_acu_code(acu.getAcu_code()); cmd.setTm(command.getTime().getTime()); + cmd.setDevice_code(zcbh); // 3将命令保存入数据库 cmdDao.addCmdRecord(cmd); + + // 4定时将数据库中的命令置为超时 + int TIMEOUT = Integer.parseInt(Configure.getProperty("sys", "COMMAND_TIMEOUT", "2")); + new ScheduledThreadPoolExecutor(1).schedule(new RemoteCommandTimeoutTask(cmd.getId()), TIMEOUT, TimeUnit.MINUTES); } } diff --git a/src/com/szpg/service/SetSensorThresholdService.java b/src/com/szpg/service/SetSensorThresholdService.java index 8ca1855..670ed7d 100644 --- a/src/com/szpg/service/SetSensorThresholdService.java +++ b/src/com/szpg/service/SetSensorThresholdService.java @@ -54,7 +54,7 @@ // 4定时将数据库中的命令置为超时 int TIMEOUT = Integer.parseInt(Configure.getProperty("sys", "COMMAND_TIMEOUT", "2")); - new ScheduledThreadPoolExecutor(1).schedule(new ReadCommandTimeoutTask(cmd.getId()), TIMEOUT, TimeUnit.MINUTES); + new ScheduledThreadPoolExecutor(1).schedule(new RemoteCommandTimeoutTask(cmd.getId()), TIMEOUT, TimeUnit.MINUTES); } /** diff --git a/src/ACUBL.properties b/src/ACUBL.properties index 9c4b0ab..df9ffdb 100644 --- a/src/ACUBL.properties +++ b/src/ACUBL.properties @@ -1,6 +1,6 @@ #ACU\u53D8\u91CF\u8868\u914D\u7F6E\u6587\u4EF6 -######## THXC.ACU001 ######## +######## 01 HXC.ACU001 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU001.CH.COUNT = 6 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -144,7 +144,7 @@ -######## THXC.ACU002 ######## +######## 02 THXC.ACU002 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU002.CH.COUNT = 6 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -288,7 +288,7 @@ -######## THXC.ACU003 ######## +######## 03 THXC.ACU003 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU003.CH.COUNT = 6 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -432,7 +432,7 @@ -######## THXC.ACU004 ######## +######## 04 THXC.ACU004 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU004.CH.COUNT = 6 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -576,7 +576,7 @@ -######## THXC.ACU005 ######## +######## 05 THXC.ACU005 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU005.CH.COUNT = 6 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -720,7 +720,7 @@ -######## THXC.ACU006 ######## +######## 06 THXC.ACU006 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU006.CH.COUNT = 6 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -812,7 +812,7 @@ #\u98CE\u673A\u6570\u91CF -THXC.ACU006.FJ.COUNT = 9 +THXC.ACU006.FJ.COUNT = 6 #\u98CE\u673A\u7F16\u7801\u5217\u8868 THXC.ACU006.FJ.ZC.LIST = THXC.ACU006.F.DFJ01;THXC.ACU006.F.DFJ02;THXC.ACU006.F.SFJ01;THXC.ACU006.F.SFJ02;THXC.ACU006.F.RFJ01;THXC.ACU006.F.RFJ02 #\u98CE\u673A\u72B6\u6001\u8D77\u59CB\u5730\u5740 @@ -864,7 +864,7 @@ -######## THXC.ACU008 ######## +######## 07 THXC.ACU008 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU008.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -1008,7 +1008,7 @@ -######## THXC.ACU009 ######## +######## 08 THXC.ACU009 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU009.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -1152,7 +1152,7 @@ -######## THXC.ACU010 ######## +######## 09 THXC.ACU010 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU010.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -1296,7 +1296,7 @@ -######## THXC.ACU011 ######## +######## 10 THXC.ACU011 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU011.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -1440,7 +1440,7 @@ -######## THXC.ACU013 ######## +######## 11 THXC.ACU013 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU013.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -1584,7 +1584,7 @@ -######## THXC.ACU014 ######## +######## 12 THXC.ACU014 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU014.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -1729,7 +1729,7 @@ -######## THXC.ACU015 ######## +######## 13 THXC.ACU015 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU015.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -1874,7 +1874,7 @@ -######## THXC.ACU016 ######## +######## 14 THXC.ACU016 ######## #\u7532\u70F7\u4F20\u611F\u5668\u6570\u91CF THXC.ACU016.CH.COUNT = 4 #\u7532\u70F7\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2020,7 +2020,7 @@ ######## \u4E8C\u671F\u4E09\u6807\u6BB5 ######## -######## THXC.ACU301 ######## +######## 01 THXC.ACU301 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU301.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2070,7 +2070,7 @@ -######## THXC.ACU302 ######## +######## 02 THXC.ACU302 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU302.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2083,7 +2083,7 @@ -######## THXC.ACU303 ######## +######## 03 THXC.ACU303 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU303.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2096,7 +2096,7 @@ -######## THXC.ACU304 ######## +######## 04 THXC.ACU304 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU304.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2109,7 +2109,7 @@ -######## THXC.ACU305 ######## +######## 05 THXC.ACU305 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU305.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2122,7 +2122,7 @@ -######## THXC.ACU501 ######## +######## 06 THXC.ACU501 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU501.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2135,7 +2135,7 @@ -######## THXC.ACU502 ######## +######## 07 THXC.ACU502 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU502.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2148,7 +2148,7 @@ -######## THXC.ACU503 ######## +######## 08 THXC.ACU503 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU503.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2161,7 +2161,7 @@ -######## THXC.ACU504 ######## +######## 09 THXC.ACU504 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU504.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2174,7 +2174,7 @@ -######## THXC.ACU505 ######## +######## 10 THXC.ACU505 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU505.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2187,7 +2187,7 @@ -######## THXC.ACU506 ######## +######## 11 THXC.ACU506 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU506.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2200,7 +2200,7 @@ -######## THXC.ACU507 ######## +######## 12 THXC.ACU507 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU507.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2213,7 +2213,7 @@ -######## THXC.ACU601 ######## +######## 13 THXC.ACU601 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU601.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2226,7 +2226,7 @@ -######## THXC.ACU602 ######## +######## 14 THXC.ACU602 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU602.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2239,7 +2239,7 @@ -######## THXC.ACU603 ######## +######## 15 THXC.ACU603 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU603.WSYQ.COUNT = 4 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2252,7 +2252,7 @@ -######## THXC.ACU604 ######## +######## 16 THXC.ACU604 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACU604.WSYQ.COUNT = 6 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2265,7 +2265,7 @@ -######## THXC.ACUS03 ######## +######## 17 THXC.ACUS03 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACUS03.WSYQ.COUNT = 2 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2278,7 +2278,7 @@ -######## THXC.ACUS05 ######## +######## 18 THXC.ACUS05 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACUS05.WSYQ.COUNT = 2 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2291,7 +2291,7 @@ -######## THXC.ACUS06 ######## +######## 19 THXC.ACUS06 ######## #\u6E29\u6E7F\u5EA6\u53CA\u6C27\u6C14\u4F20\u611F\u5668\u6570\u91CF THXC.ACUS06.WSYQ.COUNT = 2 #\u6E29\u6E7F\u5EA6\u4F20\u611F\u5668\u8BBE\u5907\u7F16\u7801\u5217\u8868 @@ -2304,6 +2304,103 @@ +######## \u4E8C\u671F\u56DB\u6807\u6BB5 ######## +######## 01 THXC.ACU107 ######## + + +######## 02 THXC.ACU108 ######## + + +######## 03 THXC.ACU109 ######## + + +######## 04 THXC.ACU110 ######## + + +######## 05 THXC.ACU306 ######## + + +######## 06 THXC.ACU307 ######## + + +######## 07 THXC.ACU308 ######## + + +######## 08 THXC.ACU309 ######## + + +######## 09 THXC.ACU401 ######## + + +######## 10 THXC.ACU402 ######## + + +######## 11 THXC.ACU403 ######## + + +######## 12 THXC.ACU404 ######## + + +######## 13 THXC.ACU405 ######## + + +######## 14 THXC.ACU406 ######## + + +######## 15 THXC.ACU407 ######## + + +######## 16 THXC.ACU408 ######## + + +######## 17 THXC.ACUS04 ######## + + +######## 18 THXC.ACU701 ######## + + +######## 19 THXC.ACU702 ######## + + +######## 20 THXC.ACU703 ######## + + +######## 21 THXC.ACU704 ######## + + +######## 22 THXC.ACU705 ######## + + +######## 23 THXC.ACU706 ######## + + +######## 24 THXC.ACU801 ######## + + +######## 25 THXC.ACU802 ######## + + +######## 26 THXC.ACU803 ######## + + +######## 27 THXC.ACU804 ######## + + +######## 28 THXC.ACU805 ######## + + +######## 29 THXC.ACU806 ######## + + +######## 30 THXC.ACU807 ######## + + +######## 31 THXC.ACUS07 ######## + + +######## 32 THXC.ACUS08 ######## + + ######## \u9F99\u7FD4\u8DEF\u71C3\u6C14\u6BB5 THXC.ACU801 ######## #\u98CE\u673A\u6570\u91CF THXC.ACU801.FJ.COUNT = 1 diff --git a/src/com/szpg/db/dao/impl/PgAcuCmdDaoImpl.java b/src/com/szpg/db/dao/impl/PgAcuCmdDaoImpl.java index b752a9c..406d9ee 100644 --- a/src/com/szpg/db/dao/impl/PgAcuCmdDaoImpl.java +++ b/src/com/szpg/db/dao/impl/PgAcuCmdDaoImpl.java @@ -154,13 +154,14 @@ Connection conn = null; String insertStr = "INSERT INTO PG_ACU_CMD " + - "(ID, TM, CMD_TYPE, DEST_ACU_CODE, TIMEOUT) " + - "VALUES (?, TO_DATE(?, 'YYYYMMDDHH24MISS'), ?, ?, '0')"; - Object[] params = new Object[4]; + "(ID, TM, CMD_TYPE, DEST_ACU_CODE, TIMEOUT, DEVICE_CODE) " + + "VALUES (?, TO_DATE(?, 'YYYYMMDDHH24MISS'), ?, ?, '0', ?)"; + Object[] params = new Object[5]; params[0] = cmd.getId(); params[1] = TimeFormat.format(cmd.getTm(), "yyyyMMddHHmmss"); params[2] = cmd.getCmd_type(); params[3] = cmd.getDest_acu_code(); + params[4] = cmd.getDevice_code(); try { conn = ConnectionManager.getConnectionFromC3P0(); diff --git a/src/com/szpg/db/data/PgAcuCmd.java b/src/com/szpg/db/data/PgAcuCmd.java index 9e57628..0f3cabc 100644 --- a/src/com/szpg/db/data/PgAcuCmd.java +++ b/src/com/szpg/db/data/PgAcuCmd.java @@ -23,6 +23,7 @@ private Date tm; // 命令发送时间 private String cmd_type; // 命令类型 private String dest_acu_code; // 目标ACU代码 + private String device_code; // 命令的资产编号 private boolean timeout; // 是否超时 public PgAcuCmd() { @@ -62,6 +63,14 @@ this.dest_acu_code = dest_acu_code; } + public String getDevice_code() { + return device_code; + } + + public void setDevice_code(String device_code) { + this.device_code = device_code; + } + public boolean isTimeout() { return timeout; } diff --git a/src/com/szpg/plc/PGDSCServlet.java b/src/com/szpg/plc/PGDSCServlet.java index 5653eb6..881c2e3 100644 --- a/src/com/szpg/plc/PGDSCServlet.java +++ b/src/com/szpg/plc/PGDSCServlet.java @@ -104,13 +104,13 @@ sendQueryJGStatusCommand(); //10巡检数据同步 - synchAssetInSpection(); +// synchAssetInSpection(); //运维数据同步 - synchMaintanceRecord(); +// synchMaintanceRecord(); // 查询二期温湿度氧气实时数据 - sendQueryWSYQValueCommand(); +// sendQueryWSYQValueCommand(); } /** diff --git a/src/com/szpg/plc/message/command/write/SetJgLockBitCommand.java b/src/com/szpg/plc/message/command/write/SetJgLockBitCommand.java new file mode 100644 index 0000000..f4bc55a --- /dev/null +++ b/src/com/szpg/plc/message/command/write/SetJgLockBitCommand.java @@ -0,0 +1,40 @@ +package com.szpg.plc.message.command.write; + +import com.szpg.plc.message.AppMessageConstants; +import com.szpg.plc.message.command.WriteMemoryCommand; +import com.szpg.plc.message.response.WriteMemoryCommandResponse; + +public class SetJgLockBitCommand extends WriteMemoryCommand { + + /** + * + */ + private static final long serialVersionUID = 935723353287421429L; + + public final static int JG_LOCK = 0; //井盖锁定 + + private int unlock; + + public int getUnlock() { + return unlock; + } + + public void setUnlock(int unlock) { + this.unlock = unlock; + } + + @Override + public String getCommandType() { + return AppMessageConstants.CMD_TYPE_SETJGLOCK; + } + + @Override + public Class getResponseClass() { + return WriteMemoryCommandResponse.class; + } + + @Override + public String toString() { + return "向终端[" + getDestinationId() + "]发送设置井盖锁定命令"; + } +} diff --git a/src/com/szpg/plc/message/command/write/SetJgOffBitCommand.java b/src/com/szpg/plc/message/command/write/SetJgOffBitCommand.java new file mode 100644 index 0000000..185804c --- /dev/null +++ b/src/com/szpg/plc/message/command/write/SetJgOffBitCommand.java @@ -0,0 +1,41 @@ +package com.szpg.plc.message.command.write; + +import com.szpg.plc.message.AppMessageConstants; +import com.szpg.plc.message.command.WriteMemoryCommand; +import com.szpg.plc.message.response.WriteMemoryCommandResponse; + +public class SetJgOffBitCommand extends WriteMemoryCommand { + + /** + * + */ + private static final long serialVersionUID = 935723353287421429L; + + public final static int JG_OFF_ENABLE = 1; // 井盖关闭 + public final static int JG_OFF_DISABLE = 0; // 井盖关闭复位 + + private int jgoff; + + public int getJgoff() { + return jgoff; + } + + public void setJgoff(int jgoff) { + this.jgoff = jgoff; + } + + @Override + public String getCommandType() { + return AppMessageConstants.CMD_TYPE_SETJGOFF; + } + + @Override + public Class getResponseClass() { + return WriteMemoryCommandResponse.class; + } + + @Override + public String toString() { + return "向终端[" + getDestinationId() + "]发送设置井盖关闭位命令[" + jgoff + "]"; + } +} diff --git a/src/com/szpg/plc/message/command/write/SetJgOnBitCommand.java b/src/com/szpg/plc/message/command/write/SetJgOnBitCommand.java new file mode 100644 index 0000000..b63cf19 --- /dev/null +++ b/src/com/szpg/plc/message/command/write/SetJgOnBitCommand.java @@ -0,0 +1,41 @@ +package com.szpg.plc.message.command.write; + +import com.szpg.plc.message.AppMessageConstants; +import com.szpg.plc.message.command.WriteMemoryCommand; +import com.szpg.plc.message.response.WriteMemoryCommandResponse; + +public class SetJgOnBitCommand extends WriteMemoryCommand { + + /** + * + */ + private static final long serialVersionUID = 935723353287421429L; + + public final static int JG_ON_ENABLE = 1; // 井盖打开 + public final static int JG_ON_DISABLE = 0; // 井盖打开复位 + + private int jgon; + + public int getJgon() { + return jgon; + } + + public void setJgon(int jgon) { + this.jgon = jgon; + } + + @Override + public String getCommandType() { + return AppMessageConstants.CMD_TYPE_SETJGON; + } + + @Override + public Class getResponseClass() { + return WriteMemoryCommandResponse.class; + } + + @Override + public String toString() { + return "向终端[" + getDestinationId() + "]发送设置井盖开启位命令[" + jgon + "]"; + } +} diff --git a/src/com/szpg/plc/message/command/write/SetJgUnlockBitCommand.java b/src/com/szpg/plc/message/command/write/SetJgUnlockBitCommand.java index e3898b4..cfe7a6b 100644 --- a/src/com/szpg/plc/message/command/write/SetJgUnlockBitCommand.java +++ b/src/com/szpg/plc/message/command/write/SetJgUnlockBitCommand.java @@ -10,8 +10,7 @@ * */ private static final long serialVersionUID = 935723353287421429L; - - public final static int JG_LOCK = 0; //井盖锁定 + public final static int JG_UNLOCK = 1; //井盖解锁 private int unlock; diff --git a/src/com/szpg/plc/message/response/write/SetJgLockBitCommandResponse.java b/src/com/szpg/plc/message/response/write/SetJgLockBitCommandResponse.java new file mode 100644 index 0000000..adb5f9d --- /dev/null +++ b/src/com/szpg/plc/message/response/write/SetJgLockBitCommandResponse.java @@ -0,0 +1,29 @@ +package com.szpg.plc.message.response.write; + +import com.szpg.db.dao.PgDeviceDao; +import com.szpg.db.dao.PgJgDao; +import com.szpg.db.dao.impl.PgDeviceDaoImpl; +import com.szpg.db.dao.impl.PgJgDaoImpl; +import com.szpg.plc.message.response.WriteMemoryCommandResponse; +import org.apache.log4j.Logger; + +public class SetJgLockBitCommandResponse extends WriteMemoryCommandResponse { + + private final Logger logger = Logger.getLogger(this.getClass().getName()); + + private PgJgDao jgDao = new PgJgDaoImpl(); + private PgDeviceDao deviceDao = new PgDeviceDaoImpl(); + + @Override + public void afterAction() { + if (this.isSuccess() == true) { + // 更新设备状态 锁定 + int deviceId = deviceDao.findDeviceIdByCode(this.getDestinationId()); + if (deviceId > 0) { + jgDao.updateDeviceStatus(deviceId, "0"); + } + + logger.info("[" + this.getAcucode() + "]锁定井盖成功"); + } + } +} diff --git a/src/com/szpg/plc/message/response/write/SetJgOffBitCommandResponse.java b/src/com/szpg/plc/message/response/write/SetJgOffBitCommandResponse.java new file mode 100644 index 0000000..f10831c --- /dev/null +++ b/src/com/szpg/plc/message/response/write/SetJgOffBitCommandResponse.java @@ -0,0 +1,29 @@ +package com.szpg.plc.message.response.write; + +import com.szpg.db.dao.PgDeviceDao; +import com.szpg.db.dao.PgJgDao; +import com.szpg.db.dao.impl.PgDeviceDaoImpl; +import com.szpg.db.dao.impl.PgJgDaoImpl; +import com.szpg.plc.message.response.WriteMemoryCommandResponse; +import org.apache.log4j.Logger; + +public class SetJgOffBitCommandResponse extends WriteMemoryCommandResponse { + + private final Logger logger = Logger.getLogger(this.getClass().getName()); + + private PgJgDao jgDao = new PgJgDaoImpl(); + private PgDeviceDao deviceDao = new PgDeviceDaoImpl(); + + @Override + public void afterAction() { + if (this.isSuccess() == true) { + // 更新设备状态 关 + int deviceId = deviceDao.findDeviceIdByCode(this.getDestinationId()); + if (deviceId > 0) { + jgDao.updateDeviceStatus(deviceId, "0"); + } + + logger.info("[" + this.getAcucode() + "]关闭井盖成功"); + } + } +} diff --git a/src/com/szpg/plc/message/response/write/SetJgOnBitCommandResponse.java b/src/com/szpg/plc/message/response/write/SetJgOnBitCommandResponse.java new file mode 100644 index 0000000..35eb98c --- /dev/null +++ b/src/com/szpg/plc/message/response/write/SetJgOnBitCommandResponse.java @@ -0,0 +1,29 @@ +package com.szpg.plc.message.response.write; + +import com.szpg.db.dao.PgDeviceDao; +import com.szpg.db.dao.PgJgDao; +import com.szpg.db.dao.impl.PgDeviceDaoImpl; +import com.szpg.db.dao.impl.PgJgDaoImpl; +import com.szpg.plc.message.response.WriteMemoryCommandResponse; +import org.apache.log4j.Logger; + +public class SetJgOnBitCommandResponse extends WriteMemoryCommandResponse { + + private final Logger logger = Logger.getLogger(this.getClass().getName()); + + private PgJgDao jgDao = new PgJgDaoImpl(); + private PgDeviceDao deviceDao = new PgDeviceDaoImpl(); + + @Override + public void afterAction() { + if (this.isSuccess() == true) { + // 更新设备状态 开 + int deviceId = deviceDao.findDeviceIdByCode(this.getDestinationId()); + if (deviceId > 0) { + jgDao.updateDeviceStatus(deviceId, "1"); + } + + logger.info("[" + this.getAcucode() + "]打开井盖成功"); + } + } +} diff --git a/src/com/szpg/plc/message/response/write/SetJgUnlockBitCommandResponse.java b/src/com/szpg/plc/message/response/write/SetJgUnlockBitCommandResponse.java new file mode 100644 index 0000000..1575f09 --- /dev/null +++ b/src/com/szpg/plc/message/response/write/SetJgUnlockBitCommandResponse.java @@ -0,0 +1,30 @@ +package com.szpg.plc.message.response.write; + +import com.szpg.db.dao.PgDeviceDao; +import com.szpg.db.dao.PgJgDao; +import com.szpg.db.dao.impl.PgDeviceDaoImpl; +import com.szpg.db.dao.impl.PgJgDaoImpl; +import com.szpg.plc.message.command.write.SetJgUnlockBitCommand; +import com.szpg.plc.message.response.WriteMemoryCommandResponse; +import org.apache.log4j.Logger; + +public class SetJgUnlockBitCommandResponse extends WriteMemoryCommandResponse { + + private final Logger logger = Logger.getLogger(this.getClass().getName()); + + private PgJgDao jgDao = new PgJgDaoImpl(); + private PgDeviceDao deviceDao = new PgDeviceDaoImpl(); + + @Override + public void afterAction() { + if (this.isSuccess() == true) { + // 更新设备状态 解锁 + int deviceId = deviceDao.findDeviceIdByCode(this.getDestinationId()); + if (deviceId > 0) { + jgDao.updateDeviceStatus(deviceId, "1"); + } + + logger.info("[" + this.getAcucode() + "]解锁井盖成功"); + } + } +} diff --git a/src/com/szpg/plc/message/response/write/SetZmOffBitCommandResponse.java b/src/com/szpg/plc/message/response/write/SetZmOffBitCommandResponse.java new file mode 100644 index 0000000..bd36ece --- /dev/null +++ b/src/com/szpg/plc/message/response/write/SetZmOffBitCommandResponse.java @@ -0,0 +1,29 @@ +package com.szpg.plc.message.response.write; + +import com.szpg.db.dao.PgDeviceDao; +import com.szpg.db.dao.PgJgDao; +import com.szpg.db.dao.impl.PgDeviceDaoImpl; +import com.szpg.db.dao.impl.PgJgDaoImpl; +import com.szpg.plc.message.response.WriteMemoryCommandResponse; +import org.apache.log4j.Logger; + +public class SetZmOffBitCommandResponse extends WriteMemoryCommandResponse { + + private final Logger logger = Logger.getLogger(this.getClass().getName()); + + private PgJgDao jgDao = new PgJgDaoImpl(); + private PgDeviceDao deviceDao = new PgDeviceDaoImpl(); + + @Override + public void afterAction() { + if (this.isSuccess() == true) { + // 更新设备状态 关 + int deviceId = deviceDao.findDeviceIdByCode(this.getDestinationId()); + if (deviceId > 0) { + jgDao.updateDeviceStatus(deviceId, "0"); + } + + logger.info("[" + this.getAcucode() + "]关闭照明成功"); + } + } +} diff --git a/src/com/szpg/plc/message/response/write/SetZmOnBitCommandResponse.java b/src/com/szpg/plc/message/response/write/SetZmOnBitCommandResponse.java new file mode 100644 index 0000000..61822b8 --- /dev/null +++ b/src/com/szpg/plc/message/response/write/SetZmOnBitCommandResponse.java @@ -0,0 +1,29 @@ +package com.szpg.plc.message.response.write; + +import com.szpg.db.dao.PgDeviceDao; +import com.szpg.db.dao.PgJgDao; +import com.szpg.db.dao.impl.PgDeviceDaoImpl; +import com.szpg.db.dao.impl.PgJgDaoImpl; +import com.szpg.plc.message.response.WriteMemoryCommandResponse; +import org.apache.log4j.Logger; + +public class SetZmOnBitCommandResponse extends WriteMemoryCommandResponse { + + private final Logger logger = Logger.getLogger(this.getClass().getName()); + + private PgJgDao jgDao = new PgJgDaoImpl(); + private PgDeviceDao deviceDao = new PgDeviceDaoImpl(); + + @Override + public void afterAction() { + if (this.isSuccess() == true) { + // 更新设备状态 开 + int deviceId = deviceDao.findDeviceIdByCode(this.getDestinationId()); + if (deviceId > 0) { + jgDao.updateDeviceStatus(deviceId, "1"); + } + + logger.info("[" + this.getAcucode() + "]打开照明成功"); + } + } +} diff --git a/src/com/szpg/plc/server/ACUClientHandler.java b/src/com/szpg/plc/server/ACUClientHandler.java index cab8a25..c61c664 100644 --- a/src/com/szpg/plc/server/ACUClientHandler.java +++ b/src/com/szpg/plc/server/ACUClientHandler.java @@ -109,6 +109,7 @@ if (null != cmd) { rmcr.setAcucode(cmd.getDest_acu_code()); rmcr.setCmdId(cmd.getId()); + rmcr.setDestinationId(cmd.getDevice_code()); // 用设备资产编号赋值给目标地址 // 字节流已解析 diff --git a/src/com/szpg/rmi/RemoteFJCommandAction.java b/src/com/szpg/rmi/RemoteFJCommandAction.java index 8114c3a..82ddf09 100644 --- a/src/com/szpg/rmi/RemoteFJCommandAction.java +++ b/src/com/szpg/rmi/RemoteFJCommandAction.java @@ -197,9 +197,9 @@ // 目标地址 String dest = client.getNet() + client.getNode() + client.getUnit(); - + DTProtocolInterface finspi = ProtocolFactory.getDefaultDTProtocol(); - + // 1首先将停止位置0 // 该逻辑取消,由设备自行控制 @@ -210,7 +210,7 @@ setOnCmd.setMessageProducerHost(client.getHost()); RemoteDeviceControlService service = new RemoteDeviceControlService(); - service.executeService(client, setOnCmd); + service.executeService(client, setOnCmd, zcbh); Logger.getLogger(this.getClass().getName()).info(setOnCmd); } else { @@ -303,7 +303,7 @@ setOffCmd.setMessageProducerHost(client.getHost()); RemoteDeviceControlService service = new RemoteDeviceControlService(); - service.executeService(client, setOffCmd); + service.executeService(client, setOffCmd, zcbh); Logger.getLogger(this.getClass().getName()).info(setOffCmd); } else { diff --git a/src/com/szpg/rmi/RemoteZMCommandAction.java b/src/com/szpg/rmi/RemoteZMCommandAction.java index 90dbf9a..e934b0e 100644 --- a/src/com/szpg/rmi/RemoteZMCommandAction.java +++ b/src/com/szpg/rmi/RemoteZMCommandAction.java @@ -206,7 +206,7 @@ setOnCmd.setMessageProducerHost(client.getHost()); RemoteDeviceControlService service = new RemoteDeviceControlService(); - service.executeService(client, setOnCmd); + service.executeService(client, setOnCmd, zcbh); Logger.getLogger(this.getClass().getName()).info(setOnCmd); } else { @@ -299,7 +299,7 @@ setOffCmd.setMessageProducerHost(client.getHost()); RemoteDeviceControlService service = new RemoteDeviceControlService(); - service.executeService(client, setOffCmd); + service.executeService(client, setOffCmd, zcbh); Logger.getLogger(this.getClass().getName()).info(setOffCmd); } else { diff --git a/src/com/szpg/service/ReadCommandTimeoutTask.java b/src/com/szpg/service/ReadCommandTimeoutTask.java deleted file mode 100644 index 8a5e247..0000000 --- a/src/com/szpg/service/ReadCommandTimeoutTask.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.szpg.service; - -import com.szpg.db.dao.PgAcuCmdDao; -import com.szpg.db.dao.impl.PgAcuCmdDaoImpl; - -public class ReadCommandTimeoutTask implements Runnable { - - private PgAcuCmdDao cmdDao = new PgAcuCmdDaoImpl(); - private String cmdId; - - public ReadCommandTimeoutTask(String cmdId) { - this.cmdId = cmdId; - } - - @Override - public void run() { - cmdDao.updateCmdRecordTimeout(cmdId); - } - -} diff --git a/src/com/szpg/service/ReadSensorValueService.java b/src/com/szpg/service/ReadSensorValueService.java index 15bd3e0..3345ba9 100644 --- a/src/com/szpg/service/ReadSensorValueService.java +++ b/src/com/szpg/service/ReadSensorValueService.java @@ -52,6 +52,6 @@ // 4定时将数据库中的命令置为超时 int TIMEOUT = Integer.parseInt(Configure.getProperty("sys", "COMMAND_TIMEOUT", "2")); - new ScheduledThreadPoolExecutor(1).schedule(new ReadCommandTimeoutTask(cmd.getId()), TIMEOUT, TimeUnit.MINUTES); + new ScheduledThreadPoolExecutor(1).schedule(new RemoteCommandTimeoutTask(cmd.getId()), TIMEOUT, TimeUnit.MINUTES); } } diff --git a/src/com/szpg/service/RemoteCommandTimeoutTask.java b/src/com/szpg/service/RemoteCommandTimeoutTask.java new file mode 100644 index 0000000..82b432a --- /dev/null +++ b/src/com/szpg/service/RemoteCommandTimeoutTask.java @@ -0,0 +1,20 @@ +package com.szpg.service; + +import com.szpg.db.dao.PgAcuCmdDao; +import com.szpg.db.dao.impl.PgAcuCmdDaoImpl; + +public class RemoteCommandTimeoutTask implements Runnable { + + private PgAcuCmdDao cmdDao = new PgAcuCmdDaoImpl(); + private String cmdId; + + public RemoteCommandTimeoutTask(String cmdId) { + this.cmdId = cmdId; + } + + @Override + public void run() { + cmdDao.updateCmdRecordTimeout(cmdId); + } + +} diff --git a/src/com/szpg/service/RemoteDeviceControlService.java b/src/com/szpg/service/RemoteDeviceControlService.java index 43fc53f..de5939a 100644 --- a/src/com/szpg/service/RemoteDeviceControlService.java +++ b/src/com/szpg/service/RemoteDeviceControlService.java @@ -11,8 +11,12 @@ import com.szpg.plc.protocol.ProtocolFactory; import com.szpg.plc.server.ACUClient; import com.szpg.plc.server.ACUClientUtil; +import com.szpg.util.Configure; import org.apache.log4j.Logger; +import java.util.concurrent.ScheduledThreadPoolExecutor; +import java.util.concurrent.TimeUnit; + /** * 远程控制设备 * @@ -26,7 +30,7 @@ private PgAcuCmdDao cmdDao = new PgAcuCmdDaoImpl(); private PgAcuDao acuDao = new PgAcuDaoImpl(); - public void executeService(ACUClient client, WriteMemoryCommand command) { + public void executeService(ACUClient client, WriteMemoryCommand command, String zcbh) { // 解析命令对象为字节数组 DTProtocolInterface finspi = ProtocolFactory.getDefaultDTProtocol(); byte[] content = finspi.messageToBytes(command); @@ -45,9 +49,14 @@ cmd.setCmd_type(command.getCommandType()); cmd.setDest_acu_code(acu.getAcu_code()); cmd.setTm(command.getTime().getTime()); + cmd.setDevice_code(zcbh); // 3将命令保存入数据库 cmdDao.addCmdRecord(cmd); + + // 4定时将数据库中的命令置为超时 + int TIMEOUT = Integer.parseInt(Configure.getProperty("sys", "COMMAND_TIMEOUT", "2")); + new ScheduledThreadPoolExecutor(1).schedule(new RemoteCommandTimeoutTask(cmd.getId()), TIMEOUT, TimeUnit.MINUTES); } } diff --git a/src/com/szpg/service/SetSensorThresholdService.java b/src/com/szpg/service/SetSensorThresholdService.java index 8ca1855..670ed7d 100644 --- a/src/com/szpg/service/SetSensorThresholdService.java +++ b/src/com/szpg/service/SetSensorThresholdService.java @@ -54,7 +54,7 @@ // 4定时将数据库中的命令置为超时 int TIMEOUT = Integer.parseInt(Configure.getProperty("sys", "COMMAND_TIMEOUT", "2")); - new ScheduledThreadPoolExecutor(1).schedule(new ReadCommandTimeoutTask(cmd.getId()), TIMEOUT, TimeUnit.MINUTES); + new ScheduledThreadPoolExecutor(1).schedule(new RemoteCommandTimeoutTask(cmd.getId()), TIMEOUT, TimeUnit.MINUTES); } /** diff --git a/src/com/szpg/service/command/ElectronicWellCommandService.java b/src/com/szpg/service/command/ElectronicWellCommandService.java new file mode 100644 index 0000000..0581d7a --- /dev/null +++ b/src/com/szpg/service/command/ElectronicWellCommandService.java @@ -0,0 +1,278 @@ +package com.szpg.service.command; + +import com.szpg.db.dao.PgHjsbblDao; +import com.szpg.db.dao.impl.PgHjsbblDaoImpl; +import com.szpg.db.data.PgHjsbbl; +import com.szpg.plc.message.command.write.*; +import com.szpg.plc.protocol.fins.FINSConstants; +import com.szpg.plc.util.ByteUtil; + +/** + * 照明控制指令辅助类 + * @author admin + * + */ +public class ElectronicWellCommandService { + + /** + * 根据资产编号构建打开井盖控制指令 + * + * @param sour 源地址 + * @param dest 目的地址 + * @param zcbh 资产编号 + * @return + */ + public static SetJgLockBitCommand buildLockCommand(String sour, String dest, String zcbh) { + PgHjsbblDao blDao = new PgHjsbblDaoImpl(); + + SetJgLockBitCommand setLockCmd = new SetJgLockBitCommand(); + setLockCmd.setUnlock(SetJgLockBitCommand.JG_LOCK); + PgHjsbbl lockBlObj = blDao.findBlByBh(zcbh + ".Lock"); + if (null != lockBlObj) { + setLockCmd.setMessageProducerId(sour); + setLockCmd.setDestinationId(dest); + + // SID在new对象的时候已经生成 + + // 内存区域——按位写 + setLockCmd.setMemoryArea(FINSConstants.MEMORY_WORK_AREA_BIT); + + int start = lockBlObj.getKszdz(); + int end = lockBlObj.getJszdz(); + int bit = lockBlObj.getSzw(); + + // 开始字地址 + setLockCmd.setStartAddress(ByteUtil.binToHexString(ByteUtil.intToBins(start, 2))); + + // 位地址 + setLockCmd.setBit(bit); + + // 位数 + setLockCmd.setCount(end - start + 1); + + // 位内容 + setLockCmd.setValue(new byte[] {(byte) SetJgLockBitCommand.JG_LOCK} ); + + return setLockCmd; + } else { + return null; + } + } + + + /** + * 根据资产编号构建打开井盖控制指令 + * + * @param sour 源地址 + * @param dest 目的地址 + * @param zcbh 资产编号 + * @return + */ + public static SetJgUnlockBitCommand buildUnlockCommand(String sour, String dest, String zcbh) { + PgHjsbblDao blDao = new PgHjsbblDaoImpl(); + + SetJgUnlockBitCommand setUnlockCmd = new SetJgUnlockBitCommand(); + setUnlockCmd.setUnlock(SetJgUnlockBitCommand.JG_UNLOCK); + PgHjsbbl unlockBlObj = blDao.findBlByBh(zcbh + ".Lock"); + if (null != unlockBlObj) { + setUnlockCmd.setMessageProducerId(sour); + setUnlockCmd.setDestinationId(dest); + + // SID在new对象的时候已经生成 + + // 内存区域——按位写 + setUnlockCmd.setMemoryArea(FINSConstants.MEMORY_WORK_AREA_BIT); + + int start = unlockBlObj.getKszdz(); + int end = unlockBlObj.getJszdz(); + int bit = unlockBlObj.getSzw(); + + // 开始字地址 + setUnlockCmd.setStartAddress(ByteUtil.binToHexString(ByteUtil.intToBins(start, 2))); + + // 位地址 + setUnlockCmd.setBit(bit); + + // 位数 + setUnlockCmd.setCount(end - start + 1); + + // 位内容 + setUnlockCmd.setValue(new byte[] {(byte) SetJgUnlockBitCommand.JG_UNLOCK} ); + + return setUnlockCmd; + } else { + return null; + } + } + + /** + * 根据资产编号构建打开井盖控制指令 + * + * @param sour 源地址 + * @param dest 目的地址 + * @param zcbh 资产编号 + * @return + */ + public static SetJgOnBitCommand buildTurnOnCommand(String sour, String dest, String zcbh) { + PgHjsbblDao blDao = new PgHjsbblDaoImpl(); + + SetJgOnBitCommand setOnCmd = new SetJgOnBitCommand(); + setOnCmd.setJgon(SetJgOnBitCommand.JG_ON_ENABLE); + PgHjsbbl onBlObj = blDao.findBlByBh(zcbh + ".ON"); + if (null != onBlObj) { + setOnCmd.setMessageProducerId(sour); + setOnCmd.setDestinationId(dest); + + // SID在new对象的时候已经生成 + + // 内存区域——按位写 + setOnCmd.setMemoryArea(FINSConstants.MEMORY_WORK_AREA_BIT); + + int start = onBlObj.getKszdz(); + int end = onBlObj.getJszdz(); + int bit = onBlObj.getSzw(); + + // 开始字地址 + setOnCmd.setStartAddress(ByteUtil.binToHexString(ByteUtil.intToBins(start, 2))); + + // 位地址 + setOnCmd.setBit(bit); + + // 位数 + setOnCmd.setCount(end - start + 1); + + // 位内容 + setOnCmd.setValue(new byte[] {(byte) SetJgOnBitCommand.JG_ON_ENABLE} ); + + return setOnCmd; + } else { + return null; + } + } + + /** + * 根据资产编号构建复位打开井盖控制指令 + * @param sour + * @param dest + * @param zcbh + * @return + */ + public static SetJgOnBitCommand buildResetTurnOnCommand(String sour, String dest, String zcbh) { + PgHjsbblDao blDao = new PgHjsbblDaoImpl(); + + SetJgOnBitCommand setOnCmd = new SetJgOnBitCommand(); + setOnCmd.setJgon(SetJgOnBitCommand.JG_ON_DISABLE); + PgHjsbbl onBlObj = blDao.findBlByBh(zcbh + ".ON"); + if (null != onBlObj) { + setOnCmd.setMessageProducerId(sour); + setOnCmd.setDestinationId(dest); + + // SID在new对象的时候已经生成 + + // 内存区域——按位写 + setOnCmd.setMemoryArea(FINSConstants.MEMORY_WORK_AREA_BIT); + + int start = onBlObj.getKszdz(); + int end = onBlObj.getJszdz(); + int bit = onBlObj.getSzw(); + + // 开始字地址 + setOnCmd.setStartAddress(ByteUtil.binToHexString(ByteUtil.intToBins(start, 2))); + + // 位地址 + setOnCmd.setBit(bit); + + // 位数 + setOnCmd.setCount(end - start + 1); + + // 位内容 + setOnCmd.setValue(new byte[] {(byte) SetJgOnBitCommand.JG_ON_DISABLE} ); + + return setOnCmd; + } else { + return null; + } + } + + + public static SetJgOffBitCommand buildTurnOffCommand(String sour, String dest, String zcbh) { + PgHjsbblDao blDao = new PgHjsbblDaoImpl(); + + SetJgOffBitCommand setOffCmd = new SetJgOffBitCommand(); + setOffCmd.setJgoff(SetJgOffBitCommand.JG_OFF_ENABLE); + PgHjsbbl offBlObj = blDao.findBlByBh(zcbh + ".OFF"); + if (null != offBlObj) { + setOffCmd.setMessageProducerId(sour); + setOffCmd.setDestinationId(dest); + + // SID在new对象的时候已经生成 + + // 内存区域——按位写 + setOffCmd.setMemoryArea(FINSConstants.MEMORY_WORK_AREA_BIT); + + int start = offBlObj.getKszdz(); + int end = offBlObj.getJszdz(); + int bit = offBlObj.getSzw(); + + // 开始字地址 + setOffCmd.setStartAddress(ByteUtil.binToHexString(ByteUtil.intToBins(start, 2))); + + // 位地址 + setOffCmd.setBit(bit); + + // 位数 + setOffCmd.setCount(end - start + 1); + + // 位内容 + setOffCmd.setValue(new byte[] {SetJgOffBitCommand.JG_OFF_ENABLE} ); + + return setOffCmd; + } else { + return null; + } + } + + /** + * 根据资产编号构建复位关闭井盖控制指令 + * @param sour + * @param dest + * @param zcbh + * @return + */ + public static SetJgOffBitCommand buildResetTurnOffCommand(String sour, String dest, String zcbh) { + PgHjsbblDao blDao = new PgHjsbblDaoImpl(); + + SetJgOffBitCommand setOffCmd = new SetJgOffBitCommand(); + setOffCmd.setJgoff(SetJgOffBitCommand.JG_OFF_DISABLE); + PgHjsbbl offBlObj = blDao.findBlByBh(zcbh + ".OFF"); + if (null != offBlObj) { + setOffCmd.setMessageProducerId(sour); + setOffCmd.setDestinationId(dest); + + // SID在new对象的时候已经生成 + + // 内存区域——按位写 + setOffCmd.setMemoryArea(FINSConstants.MEMORY_WORK_AREA_BIT); + + int start = offBlObj.getKszdz(); + int end = offBlObj.getJszdz(); + int bit = offBlObj.getSzw(); + + // 开始字地址 + setOffCmd.setStartAddress(ByteUtil.binToHexString(ByteUtil.intToBins(start, 2))); + + // 位地址 + setOffCmd.setBit(bit); + + // 位数 + setOffCmd.setCount(end - start + 1); + + // 位内容 + setOffCmd.setValue(new byte[] {SetJgOffBitCommand.JG_OFF_DISABLE} ); + + return setOffCmd; + } else { + return null; + } + } +}