严智鑫
2025-11-11 dd348d0ecae2492d0f39c84d22d1c4336c42787f
按原有项目上的代码方式修改注解报错以及数据库调用报错
6个文件已修改
112 ■■■■■ 已修改文件
.idea/workspace.xml 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
nglib/src/builder/Manager.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
nglib/src/druidConnect/getMeterParatermeter.java 50 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
nglib/src/toTcp/TcpClientHandler.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
nglib/src/toTcp/TcpMain.java 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
nglib/src/toTcp/TcpMultiServer.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
.idea/workspace.xml
@@ -1,10 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
  <component name="ArtifactsWorkspaceSettings">
    <artifacts-to-build>
      <artifact name="gmms" />
    </artifacts-to-build>
  </component>
  <component name="AutoImportSettings">
    <option name="autoReloadType" value="SELECTIVE" />
  </component>
  <component name="ChangeListManager">
    <list default="true" id="8fb06979-163e-47f4-9dfa-cdbddc7489f0" name="更改" comment="" />
    <list default="true" id="8fb06979-163e-47f4-9dfa-cdbddc7489f0" name="更改" comment="">
      <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
      <change beforePath="$PROJECT_DIR$/nglib/src/builder/Manager.java" beforeDir="false" afterPath="$PROJECT_DIR$/nglib/src/builder/Manager.java" afterDir="false" />
      <change beforePath="$PROJECT_DIR$/nglib/src/druidConnect/getMeterParatermeter.java" beforeDir="false" afterPath="$PROJECT_DIR$/nglib/src/druidConnect/getMeterParatermeter.java" afterDir="false" />
      <change beforePath="$PROJECT_DIR$/nglib/src/toTcp/TcpClientHandler.java" beforeDir="false" afterPath="$PROJECT_DIR$/nglib/src/toTcp/TcpClientHandler.java" afterDir="false" />
      <change beforePath="$PROJECT_DIR$/nglib/src/toTcp/TcpMain.java" beforeDir="false" afterPath="$PROJECT_DIR$/nglib/src/toTcp/TcpMain.java" afterDir="false" />
      <change beforePath="$PROJECT_DIR$/nglib/src/toTcp/TcpMultiServer.java" beforeDir="false" afterPath="$PROJECT_DIR$/nglib/src/toTcp/TcpMultiServer.java" afterDir="false" />
    </list>
    <option name="SHOW_DIALOG" value="false" />
    <option name="HIGHLIGHT_CONFLICTS" value="true" />
    <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
@@ -26,15 +38,23 @@
    &quot;RunOnceActivity.ShowReadmeOnStart&quot;: &quot;true&quot;,
    &quot;git-widget-placeholder&quot;: &quot;master&quot;,
    &quot;kotlin-language-version-configured&quot;: &quot;true&quot;,
    &quot;last_opened_file_path&quot;: &quot;D:/workfile/Haier_MES_II&quot;,
    &quot;last_opened_file_path&quot;: &quot;D:/workfile/Haier_MES_II/gmms/WebContent/WEB-INF/lib&quot;,
    &quot;node.js.detected.package.eslint&quot;: &quot;true&quot;,
    &quot;node.js.detected.package.tslint&quot;: &quot;true&quot;,
    &quot;node.js.selected.package.eslint&quot;: &quot;(autodetect)&quot;,
    &quot;node.js.selected.package.tslint&quot;: &quot;(autodetect)&quot;,
    &quot;nodejs_package_manager_path&quot;: &quot;npm&quot;,
    &quot;project.structure.last.edited&quot;: &quot;工件&quot;,
    &quot;project.structure.proportion&quot;: &quot;0.15&quot;,
    &quot;project.structure.side.proportion&quot;: &quot;0.2850575&quot;,
    &quot;vue.rearranger.settings.migration&quot;: &quot;true&quot;
  }
}</component>
  <component name="RecentsManager">
    <key name="CopyFile.RECENT_KEYS">
      <recent name="D:\workfile\Haier_MES_II\gmms\WebContent\WEB-INF\lib" />
    </key>
  </component>
  <component name="SharedIndexes">
    <attachedChunks>
      <set>
@@ -53,6 +73,10 @@
      <updated>1741915288398</updated>
      <workItem from="1741915289710" duration="1265000" />
      <workItem from="1742172726815" duration="696000" />
      <workItem from="1762752139391" duration="356000" />
      <workItem from="1762752728233" duration="432000" />
      <workItem from="1762753213495" duration="110000" />
      <workItem from="1762754867922" duration="4983000" />
    </task>
    <servers />
  </component>
nglib/src/builder/Manager.java
@@ -5,6 +5,8 @@
import ng.db.DBSession;
import ng.devices.HexUtil;
import org.json.JSONArray;
import toTcp.TcpMain;
import toTcp.gethex;
import java.io.BufferedWriter;
import java.io.OutputStreamWriter;
@@ -60,6 +62,7 @@
                Manager.mmgr.RunAll();
                //启动标志
                state = true;
                TcpMain.getElectric();
            } catch (Exception e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
@@ -212,13 +215,14 @@
        while(true){
            try {
                Thread.sleep(100);
                TcpMain.getElectric();
            } catch (InterruptedException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }
        }
            } catch (Exception e) {
                throw new RuntimeException(e);
            }
        }
    }
nglib/src/druidConnect/getMeterParatermeter.java
@@ -1,5 +1,8 @@
package druidConnect;
import ng.db.DBHelper;
import ng.db.DBSession;
import java.sql.*;
import java.util.LinkedHashMap;
import java.util.LinkedList;
@@ -7,39 +10,50 @@
public class getMeterParatermeter {
    public static void main(String[] args) throws Exception {
        LinkedList<LinkedHashMap> a=getMeterParater();
        System.out.println(a);
        //System.out.println(a);
    }
    public static  LinkedList<LinkedHashMap> getMeterParater() throws Exception {
        Connection con = druidConnect.JDBCUtils.getConnection();
        CallableStatement cs =con.prepareCall("call AXJ_a_meter_paramenter()");
        ResultSet rs = cs.executeQuery();
        ResultSetMetaData rsmd = rs.getMetaData();
        String[] arr;
        //Connection con = sqlConnection();
        LinkedList<LinkedHashMap> results = new LinkedList<LinkedHashMap>();
        while(rs.next()){
            LinkedHashMap<String, String> result = new LinkedHashMap<String, String>();
            for(int i=0;i<rsmd.getColumnCount();i++){
                String val=rs.getString(i+1)!=null?String.valueOf(rs.getString(i+1)):"";
                result.put(String.valueOf(rsmd.getColumnName(i+1)),val);
        Connection con=null;
        try{
            con= DriverManager.getConnection("jdbc:mysql://127.0.0.1:3306/gmms?serverTimezone=GMT%2B8","root","beibo.123/");
            CallableStatement cs =con.prepareCall("call AXJ_a_meter_paramenter()");
            ResultSet rs = cs.executeQuery();
            ResultSetMetaData rsmd = rs.getMetaData();
            String[] arr;
            while(rs.next()){
                LinkedHashMap<String, String> result = new LinkedHashMap<String, String>();
                for(int i=0;i<rsmd.getColumnCount();i++){
                    String val=rs.getString(i+1)!=null?String.valueOf(rs.getString(i+1)):"";
                    result.put(String.valueOf(rsmd.getColumnName(i+1)),val);
                }
                results.add(result);
            }
            results.add(result);
            return results;
        }
        druidConnect.JDBCUtils.close(cs, con);
        catch(Exception e){
            e.printStackTrace();
        }
        finally{
            con.close();
        }
        return results;
    }
    public static  void meterToMysql(String meterid,Double meter,String DLT645) throws Exception {
        Connection con = druidConnect.JDBCUtils.getConnection();
        Connection con = DriverManager.getConnection("jdbc:mysql://127.0.0.1:3306/gmms?serverTimezone=GMT%2B8","root","beibo.123/");
        CallableStatement cs =con.prepareCall("call AXJ_a_addMeter(?,?,?)");
        cs.setString(1, meterid);
        cs.setDouble(2, meter);
        cs.setString(3, DLT645);
        cs.executeQuery();
        druidConnect.JDBCUtils.close(cs, con);
        con.close();
    }
    public static  LinkedList<LinkedHashMap> getOrderOpt() throws Exception {
        Connection con = druidConnect.JDBCUtils.getConnection();
        Connection con = DriverManager.getConnection("jdbc:mysql://127.0.0.1:3306/gmms?serverTimezone=GMT%2B8","root","beibo.123/");
        CallableStatement cs =con.prepareCall("call AXJ_a_get_orderRecipeOpt_select()");
        ResultSet rs = cs.executeQuery();
        ResultSetMetaData rsmd = rs.getMetaData();
@@ -54,7 +68,7 @@
            }
            results.add(result);
        }
        druidConnect.JDBCUtils.close(cs, con);
        con.close();
        return results;
    }
}
nglib/src/toTcp/TcpClientHandler.java
@@ -21,12 +21,11 @@
        this.clientSocket = socket;
        this.meterParameter=meterParameter;
    }
    @Override
    public void run() {
        try {
            while (true) {
                try {
                    System.out.println(clientSocket.getInetAddress().getHostAddress()+"客户端连接上了");
                    InputStream in = clientSocket.getInputStream();
                    ByteArrayOutputStream output = new ByteArrayOutputStream();
@@ -59,8 +58,6 @@
                                }
                            }
                        }else if(HexDLT645.indexOf("68")>-1){
                            String HEX=HexDLT645.replace(" ", "");
                            for (int i = 0; i < meterParameter.size(); i++) {
@@ -85,7 +82,7 @@
                }catch (Exception e){
                    //
                    System.out.println("tcp电表客户端已断开连接---------"+e);
                    System.out.println("tcp���ͻ����ѶϿ�����---------"+e);
                    break;
                }
@@ -94,7 +91,7 @@
                //System.out.println(inputLine);
//                if (".".equals(inputLine)) {
//                    System.out.println(inputLine);
//                    System.out.println("tcp电表客户端已断开连接1---------");
//                    System.out.println("tcp���ͻ����ѶϿ�����1---------");
//                    //out.println("bye");
//                    break;
//                }
nglib/src/toTcp/TcpMain.java
@@ -6,22 +6,14 @@
public class TcpMain {
    public static void main(String[] args) throws Exception
    {
//        try{
//            new TcpMultiServer().start(55559);
//        }catch (Exception e){
//            System.out.println("tcp服务发生错误");
//        }
        getElectric();
    }
    public static void getElectric() throws Exception
    {
        //new ServerSocket(55550).close();
        try{
            new TcpMultiServer().start(55550);
        }catch (Exception e){
            System.out.println("tcp服务发生错误"+e);
            System.out.println("tcp����������"+e);
        }
    }
@@ -32,7 +24,7 @@
            new TcpMultiServer().start(55550);
        }catch (Exception e){
            System.out.println("tcp服务发生错误"+e);
            System.out.println("tcp����������"+e);
        }
    }
nglib/src/toTcp/TcpMultiServer.java
@@ -11,7 +11,6 @@
public class TcpMultiServer {
    LinkedList<LinkedHashMap> meterParameter;
    {
        try {
            meterParameter = getMeterParatermeter.getMeterParater();