zhangbin 4 lat temu
rodzic
commit
32ef0a6467

+ 14 - 1
hzgzpt-admin/pom.xml

@@ -104,8 +104,21 @@
                     <warName>${project.artifactId}</warName>
                 </configuration>
            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-resources-plugin</artifactId>
+                <configuration>
+                    <encoding>UTF-8</encoding>
+                    <!-- 过滤后缀为pem、pfx的证书文件 -->
+                    <nonFilteredFileExtensions>
+                        <nonFilteredFileExtension>p12</nonFilteredFileExtension>
+                        <nonFilteredFileExtension>pem</nonFilteredFileExtension>
+                        <nonFilteredFileExtension>pfx</nonFilteredFileExtension>
+                        <nonFilteredFileExtension>cer</nonFilteredFileExtension>
+                    </nonFilteredFileExtensions>
+                </configuration>
+            </plugin>
         </plugins>
         <finalName>${project.artifactId}</finalName>
     </build>
-
 </project>

+ 24 - 0
hzgzpt-admin/src/main/resources/zs/fujianzhongzhen.cer

@@ -0,0 +1,24 @@
+-----BEGIN CERTIFICATE-----
+MIID7zCCAtegAwIBAgIGAWWzd6mtMA0GCSqGSIb3DQEBCwUAMGMxCzAJBgNVBAYT
+AkNOMREwDwYDVQQKHghW/U6kT+GQGjEMMAoGA1UECxMDUEtJMTMwMQYDVQQDHioA
+TwBwAGUAcgBhAHQAaQBvAG4AIABDAEEAIABmAG8AcgAgVv1OpE/hkBowHhcNMTgw
+OTA2MTYwMDAwWhcNMjgwOTA2MTYwMDAwWjA+MQswCQYDVQQGEwJDTjEVMBMGA1UE
+Ch4Mi6Fl9n7Ieu+LwU5mMRgwFgYDVQQDEw9mdWppYW56aG9uZ3poZW4wggEiMA0G
+CSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC6e2QNUV1KjEC06zpo+G9uCi8/O5BH
+eTua3Akj825ORPEitOOclULkTyEO+b/z61vski9xcp36zz0IZ4TDJjixrDIMejg0
+iyzO8j4/IqSeDlaINioQuK4WwVqHSbe8lQ0Fz4QDc0KTD31UTERJirppnQXaPvMU
++UNSf7c7KKm1mQdhW9n2PQWmoOWlgbo+5PeEAfDJQEBFfTNzzUWUhmU9qi/fJ6T4
+YzjgHVp9qFqN9AJ1j3jqpRUwO+mok/B+Jdr75m73pVhbcBYIoMIH+Pv4kCmMc1B3
+4NszFK4DOCIkkUPmMpZqHoxBjxziTiD7LlGvGUJ9wldYA0dyFzmFvzl/AgMBAAGj
+gc0wgcowHwYDVR0jBBgwFoAUXKqOitJrMkwHwGNrPDT8fn6yrnswHQYDVR0OBBYE
+FAA1XrvSNkIfOb9lypi9uqD5ovGDMF0GA1UdHwRWMFQwUqBQoE6kTDBKMRcwFQYD
+VQQDHg4AQwBSAEwAMQAwADAAMDEPMA0GA1UECx4GAEMAUgBMMREwDwYDVQQKHghW
+/U6kT+GQGjELMAkGA1UEBhMCQ04wCQYDVR0TBAIwADALBgNVHQ8EBAMCAPgwEQYJ
+YIZIAYb4QgEBBAQDAgCgMA0GCSqGSIb3DQEBCwUAA4IBAQAl1dus2bk65a+mhiaQ
+txu4l8dYwCrL7P8RV0A5ov0CqqKVugT+++1V/59aDQ094hvN8RLABr/ma0rdzrr2
+dWdEuvl0DrBOwMOObCsz/yU5fiDFbSar/58ihM2jdvhD+kQZETNP7efkgF67Gp7i
+KM+K7kXx39BoJAAyq/XU/D+TIM5gpXv9uSoZeZzkr1wMl1jWglD81Dyvip1pmMoD
+JZ5mg2l9qoH3bR/sQsrcqkpW8pBjNZhFkDP/E6QksfiZ45r7WYjOX3ngtbehBpsp
+gk17wUoiS+cAlUimic3K0ZDRE4nl100TK/Nc54CvsV8BZEJvWe1Moas8rWz+X+ct
+sir7
+-----END CERTIFICATE-----

BIN
hzgzpt-admin/src/main/resources/zs/fujianzhongzhen.pfx


+ 18 - 1
hzgzpt-admin/src/test/java/com/miaxis/test/NormalTest.java

@@ -1,18 +1,31 @@
 package com.miaxis.test;
 
 import com.miaxis.HzgzptApplication;
+import com.miaxis.app.test.inf.ITestService;
 import com.miaxis.app.xxx.service.ITMClassRecordDetailService;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.stereotype.Service;
 import org.springframework.test.context.junit4.SpringRunner;
 
 import javax.annotation.Resource;
+import java.io.File;
 
 @SpringBootTest(classes = HzgzptApplication.class)
 @RunWith(SpringRunner.class)
 public class NormalTest {
 
+    public static String qgptHttpTopServerPath = "http://114.55.58.112:8085/top/";
+    public static String qgptHttpServerPath = "http://115.29.171.186:8085/";
+    public static final String file_stuimg = "stuimg";//学员头像
+    /** 接口服务器:Imageup (文件资料信息上传) */
+    public static final String httpServer_Imageup = "imageup";
+
+
+    @Resource
+    private ITestService testService;
+
     @Resource
     ITMClassRecordDetailService itmClassRecordDetailService;
 
@@ -23,7 +36,11 @@ public class NormalTest {
     }
 
 
-
+    @Test
+    public void test2() throws Exception {
+        File file =new File("D:\\xx.jpg");
+        testService.imageUpForQG(file,this.httpServer_Imageup,this.file_stuimg,"");
+    }
 
 
 

+ 10 - 0
hzgzpt-service-app/pom.xml

@@ -24,6 +24,16 @@
             <artifactId>hzgzpt-framework</artifactId>
         </dependency>
 
+
+
+        <!-- https://mvnrepository.com/artifact/commons-httpclient/commons-httpclient -->
+        <dependency>
+            <groupId>commons-httpclient</groupId>
+            <artifactId>commons-httpclient</artifactId>
+            <version>3.1</version>
+        </dependency>
+
+
     </dependencies>
 
 

+ 122 - 0
hzgzpt-service-app/src/main/java/com/miaxis/app/test/Impl/TestServiceImpl.java

@@ -0,0 +1,122 @@
+package com.miaxis.app.test.Impl;
+
+import com.miaxis.app.test.inf.ITestService;
+import com.miaxis.app.test.util.*;
+import org.apache.commons.httpclient.HttpClient;
+import org.apache.commons.httpclient.HttpStatus;
+import org.apache.commons.httpclient.methods.PostMethod;
+import org.apache.commons.httpclient.methods.multipart.FilePart;
+import org.apache.commons.httpclient.methods.multipart.MultipartRequestEntity;
+import org.apache.commons.httpclient.methods.multipart.Part;
+import org.springframework.stereotype.Service;
+
+import java.io.*;
+import java.security.KeyStore;
+import java.security.PrivateKey;
+import java.security.cert.X509Certificate;
+import java.util.Enumeration;
+
+@Service
+public class TestServiceImpl implements ITestService {
+
+    public static String qgptHttpTopServerPath = "http://114.55.58.112:8085/top/";
+    public static String qgptHttpServerPath = "http://115.29.171.186:8085/";
+    public static final String file_stuimg = "stuimg";//学员头像
+
+    /** 接口服务器:Imageup (文件资料信息上传) */
+    public static final String httpServer_Imageup = "imageup";
+
+    public String imageUpForQG(File file, String serviceName, String type, String filePath) throws Exception {
+        ProvResultJson result = new ProvResultJson("操作失败", "1");
+
+        System.out.println("上传照片到全国平台");
+        HttpClient client = new HttpClient();
+        StringBuffer sb = null;
+        FilePart fp = new FilePart("file", file);
+        result = this.getHttpServerUrlForFileUpload(this.qgptHttpTopServerPath, serviceName + "/" + type, PlatUtil.getBytesFromFile(file), filePath);
+        if (result != null && result.getResult().equals("0")) {
+            String sendUrl = result.getObject().toString();
+            Part[] parts = { fp };
+            PostMethod pomethod = new PostMethod(sendUrl);
+            MultipartRequestEntity mre = new MultipartRequestEntity(parts, pomethod.getParams());
+            pomethod.setRequestEntity(mre);
+            client.executeMethod(pomethod);
+            sb = new StringBuffer();
+            if (pomethod.getStatusCode() == HttpStatus.SC_OK) {
+                BufferedReader reader = new BufferedReader(new InputStreamReader(pomethod.getResponseBodyAsStream(), "UTF-8"));
+                String line;
+                while ((line = reader.readLine()) != null) {
+                    sb.append(line);
+                }
+                reader.close();
+            }
+            System.out.println(sb.toString());
+//            JSONObject jsonObject = JSONObject.fromObject(sb.toString());
+//            String errorcode = jsonObject.containsKey("errorcode") ? jsonObject.getString("errorcode") : "1";
+//            if(errorcode.equals("0")){
+//                String dataJson = jsonObject.get("data").toString();
+//                JSONObject fileIdJosn = JSONObject.fromObject(dataJson);
+//                return  fileIdJosn.getString("id"); // 培训学员全国统一编号
+//            }
+        }else {
+            return "";
+        }
+
+        return "";
+    }
+
+
+
+    /**
+     * 调用HTTP接口,Delete请求(静态参数在ptUtil里面定义静态变量统一使用)
+     * 为文件上传加密数据和验证签名,返回加密后的URL
+     * */
+    public  ProvResultJson getHttpServerUrlForFileUpload(String urlPort, String serviceName, byte[] data, String imgPath) throws Exception {
+        ProvResultJson result = new ProvResultJson("操作失败", "1");
+
+        long timestamp = System.currentTimeMillis(); // 时间戳
+        String sign_str = ""; // 签名
+        /* 获取签名 */
+        String path = getClass().getResource("/").getPath();
+        java.io.File jarFile = new java.io.File(path);
+        String propertiesfile = jarFile.getParentFile().getAbsolutePath().replace("%20", " ");
+        KeyStore keyStore = KeyStore.getInstance("PKCS12");
+        InputStream input = new FileInputStream(propertiesfile + PlatUtil.privateKeyUrl);
+        keyStore.load(input, PlatUtil.keyPassword.toCharArray());
+        Enumeration<String> aliases = keyStore.aliases();
+        if (!aliases.hasMoreElements()) {
+            System.out.println("-99");
+            System.out.println("HTTP接口协议签名获取失败: no alias found");
+            return result;
+        }
+        String alias = aliases.nextElement();
+        PrivateKey privateKey = (PrivateKey) keyStore.getKey(alias, PlatUtil.keyPassword.toCharArray()); // 私钥
+        ISign sign = new Sign();
+        sign_str = sign.sign(data, timestamp, privateKey);
+
+        /* 验证签名 */
+        X509Certificate cert = (X509Certificate) keyStore.getCertificate(alias);
+        String serialNumber = cert.getSerialNumber().toString(); // 证书序列号
+        long snInteger = Long.parseLong(serialNumber);
+        serialNumber = Long.toHexString(snInteger).toUpperCase();
+        IVerify verify = new Verify();
+        boolean ok = verify.verify(data, timestamp, sign_str, cert);
+        //String serialNumber = ""; //证书序列号
+        //boolean ok = true;
+        if (ok) {
+            String url = urlPort + serviceName + "?v=" + PlatUtil.url_version + "&ts=" + timestamp + "&user=" + serialNumber + "&sign=" + sign_str;
+            if(VerifyUtil.verifyString(imgPath)) {
+                url += "&imgPath=" + imgPath;
+            }
+            result.setObject(url);
+            result.setResult("0");
+            result.setMsg("操作成功");
+        } else {
+            System.out.println("-99");
+            System.out.println("HTTP接口协议签名获取失败");
+        }
+//        result.setXlog(xlog);
+        return result;
+    }
+
+}

+ 8 - 0
hzgzpt-service-app/src/main/java/com/miaxis/app/test/inf/ITestService.java

@@ -0,0 +1,8 @@
+package com.miaxis.app.test.inf;
+
+import java.io.File;
+
+public interface ITestService {
+
+    public String imageUpForQG(File file, String serviceName, String type, String filePath) throws Exception;
+}

+ 17 - 0
hzgzpt-service-app/src/main/java/com/miaxis/app/test/util/EncodeUtil.java

@@ -0,0 +1,17 @@
+package com.miaxis.app.test.util;
+
+public class EncodeUtil {
+	public static byte[] toBE(long data) {
+		byte[] buffer = new byte[8];
+        buffer[0] = (byte)(data >>> 56);
+        buffer[1] = (byte)(data >>> 48);
+        buffer[2] = (byte)(data >>> 40);
+        buffer[3] = (byte)(data >>> 32);
+        buffer[4] = (byte)(data >>> 24);
+        buffer[5] = (byte)(data >>> 16);
+        buffer[6] = (byte)(data >>>  8);
+        buffer[7] = (byte)(data >>>  0);
+        return buffer;
+	}
+	
+}

+ 10 - 0
hzgzpt-service-app/src/main/java/com/miaxis/app/test/util/ISign.java

@@ -0,0 +1,10 @@
+package com.miaxis.app.test.util;
+
+import java.security.PrivateKey;
+
+public interface ISign {
+	public String sign(String data, long timestamp, PrivateKey key) throws Exception;
+	public String sign(byte [] data, long timestamp, PrivateKey key) throws Exception;
+	public String sign(String data, PrivateKey key) throws Exception;
+	public String sign(byte [] data, PrivateKey key) throws Exception;
+}

+ 14 - 0
hzgzpt-service-app/src/main/java/com/miaxis/app/test/util/IVerify.java

@@ -0,0 +1,14 @@
+package com.miaxis.app.test.util;
+
+import java.security.cert.X509Certificate;
+
+public interface IVerify {
+	public boolean verify(String data, long timestamp, String encodedEncryptedStr,
+			X509Certificate userCert) throws Exception ;
+	public boolean verify(String data, String encodedEncryptedStr,
+			X509Certificate userCert) throws Exception;
+	public boolean verify(byte [] data, String encodedEncryptedStr,
+			X509Certificate userCert) throws Exception;
+	public boolean verify(byte [] data, long timestamp, String encodedEncryptedStr,
+			X509Certificate userCert) throws Exception;
+}

+ 628 - 0
hzgzpt-service-app/src/main/java/com/miaxis/app/test/util/PlatUtil.java

@@ -0,0 +1,628 @@
+package com.miaxis.app.test.util;
+
+import java.io.*;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * 省计时平台接口访问常量
+ * */
+public class PlatUtil {
+	/** 下发IP地址及端口 */
+	public static String dl_weUser="1598BAE7757";
+	public static String issueHttpServerPath = "";
+	public static String sld_img_path = "http://122.lnjppt.com/sytmp/";
+	public static String sld_save_Path = "E://newproject//webapp//tms//src//main//webapp//upload//sld//";
+	public static String jyz_save_Path = "E://newproject//webapp//tms//src//main//webapp//upload//jyz//";
+
+	public static String contract_save_Path = "E://contract//";//学员培训合同保存路径
+	public static String contract_temp_Path = "E://ht.pdf";//学员培训合同模板路径
+	public static String sld_temp_path="E:\\sld.pdf";
+	public static String jyz_temp_path="E:\\jyz.pdf";
+	public static String file_savepath = "/media/html/tms/upload/";
+	public static String wxUrl = ""; //微信分享有效地址(项目地址)
+	public static String wxImgFile = ""; //微信顶部图片路径(文件夹)
+	public static String wxName = ""; //微信公众号名称
+	public static String gzpt_sbh = "3500"; //省编号,默认
+	public static String gzpt_dqbh = "3501"; //地市编号,默认
+	public static String gzpt_dblink = "newgzpt";//默认
+	public static String isAudit = "1";
+	public static String open_aduit = "1";
+	public static String tmp_dblink = "tmpfj";
+	public static String tms_dblink = "tmpfj";
+	public static String project_url = "http://fj.jppt.com.cn/xmjspt/";
+	public static String loaclPath_qianzhang = "/media/html/tms_qianzhang";
+	public static String device_img_path = "http://fj.jppt.com.cn/xmtmsphoto/";
+	public static String dm92_img_path = "http://fj.jppt.com.cn/xmtmsphoto/";
+	public static String device_video_path = "http://image.lnjppt.com/";
+	public static String lntmpservice = "http://127.0.0.1:8099/lntmpservice";
+	public static String device_tmp_img_path="";//省监管平台终端照片访问路径
+	public static String useross="useross_"; //单点登录特征值
+	public static String face_photo_path = "";//人脸比对照片路径
+	public static String term_pic_path = "/media/html/photo/upload/";//模拟器签到照片上次路径
+	//安卓_APP下载(教练/学员/驾校/运管)
+	public static String downAppJL_Android = "";
+	public static String downAppXY_Android = "";
+	public static String downAppJX_Android = "";
+	public static String downAppYG_Android = "";
+	//IOS_APP下载(教练/学员/驾校/运管)
+	public static String downAppJL_IOS = "";
+	public static String downAppXY_IOS = "";
+	public static String downAppJX_IOS = "";
+	public static String downAppYG_IOS = "";
+	
+	/**实时视频参数*/
+	public static  String video_resolution = "";//分辨率
+	public static  String video_chaneId = "";//通道号
+	public static  String video_stram = "";//码流
+	public static  String video_audio = "";//音频
+	public static  String video_ip = "";//登入IP
+	public static  String video_loginPort = "";//登入端口
+	public static  String video_appId = "";//应用ID
+	public static  String  video_displayCode = "";//登入显示用户名
+	public static  String  video_roomNum = "";//房间数量
+	public static  String sso_open = "1";
+	public static String sso_url = "http://fj.jppt.com.cn/sso";
+	
+	public static String httpServer_LeaveCoach = "leaveCoach";
+	public static String businessType_leaveCoach = "leaveCoach";
+
+	public static String ip_dir = "/media/html/ip_data/";
+	public static boolean isIpInit = false;
+	public static String saveFile = "";
+	/** HTTP接口协议: 协议版本(目前使用“1.0.0.e2”。其中e?代表所使用的加密算法,e1:SHA1,e2:SHA-256,e3:SHA-512。) */
+	public static final String url_version = "1.0.0.e2";
+	/** 私钥路径 */
+//	public static  String privateKeyUrl = "/classes/fujianzhongzhen.pfx";
+	public static  String privateKeyUrl = "/classes/zs/fujianzhongzhen.pfx";
+	public static  String keyPassword = "Zz2314";
+
+	public static final String platnum = "A0148";
+	/** 加密方式 */
+	public static final String url_version_type = "SHA-256";
+	/** 日志-业务编号: XmjpSch(培训机构) */
+	public static final String businessCode_XmjpSch = "XmjpSch";
+	/** 日志-业务编号: XmjpCoach(教练员) */
+	public static final String businessCode_XmjpCoach = "XmjpCoachInfo";
+	/** 日志-业务编号: XmjpStudent(学员) */
+	public static final String businessCode_Student = "Student";
+	/** 日志-业务编号: XmjpSchArae(教学区域) */
+	public static final String businessCode_XmjpSchArae = "XmjpSchArae";
+	/** 日志-业务编号: ExaminerInfo(考核员) */
+	public static final String businessCode_ExaminerInfo = "ExaminerInfo";
+	/** 日志-业务编号: EecurityInfo(安全员) */
+	public static final String businessCode_EecurityInfo = "EecurityInfo";
+	/** 日志-业务编号: XmjpCar(教练车) */
+	public static final String businessCode_XmjpCar = "XmjpCar";
+	/** 日志-业务编号: AppReservePayConfig(收费标准) */
+	public static final String businessCode_AppReservePayConfig = "AppReservePayConfig";
+	/** 日志-业务编号: XmjpDevice(计时终端) */
+	public static final String businessCode_XmjpDevice = "XmjpDevice";
+	/** 日志-业务编号: XmjpRegion(围栏) */
+	public static final String businessCode_XmjpRegion = "XmjpRegion";
+	/** 日志-业务编号: TerminateMachine(计时终端) */
+	public static final String businessCode_TerminateMachine = "TerminateMachine";
+	/** 日志-业务编号: Eval(评价信息) */
+	public static final String businessCode_Eval= "eval";
+	/** 日志-业务编号: Complaint(投诉信息) */
+	public static final String businessCode_Complaint= "complaint";
+	/** 日志-业务编号: LogSign(签到签退信息) */
+	public static final String businessCode_LogSign = "logSign";
+	/** 日志-业务编号: Msg(消息通知) */
+	public static final String businessCode_Msg= "msg";
+	/** 日志-业务编号: XmjpPoint(报名点) */
+	public static final String businessCode_XmjpPoint = "XmjpPoint";
+	/** 日志-业务编号: XmjpTheoryRoom(理论教室) */
+	public static final String businessCode_XmjpTheoryRoom = "XmjpTheoryRoom";
+	/** 日志-业务编号: XmjpSchPublicRegion(经营训练场地) */
+	public static final String businessCode_XmjpSchPublicRegion = "XmjpSchPublicRegion";
+	/** 日志-业务编号: XmjpStudentClassOpen(历史学员开班) */
+	public static final String businessCode_XmjpStudentClassOpen = "XmjpStudentClassOpen";
+
+	public static  String default_photo= "TerminateMachine";
+
+	/** 日志-业务编号: XmjpStudentClassOpen(历史学员开班) */
+	public static final String businessCode_Imageup = "Imageup";
+	/** 日志-业务编号: 浙江表A.75 学时异常查询接口定义 */
+	public static final String businessCode_abnormal = "abnormal";
+
+	/** 日志-业务编号: 浙江表A.67 阶段送审信息查询接口定义 */
+	public static final String businessCode_querystage = "querystage";
+
+	/** 日志-业务编号: 浙江表表A.59 终端备案关系查询接口定义 */
+	public static final String businessCode_searchDevice = "searchDevice";
+	/**
+	 * <p>业务名称Map:</p>
+	 */
+	@SuppressWarnings("serial")
+	public final static Map<String, String> businessCodeMap = new HashMap<String, String>(){{
+		put(businessCode_XmjpSch, "培训机构");
+		put(businessCode_XmjpCoach, "教练员");
+		put(businessCode_Student, "学员");
+		put(businessCode_XmjpSchArae, "教学区域");
+		put(businessCode_ExaminerInfo, "考核员");
+		put(businessCode_EecurityInfo, "安全员");
+		put(businessCode_XmjpCar, "教练车");
+		put(businessCode_AppReservePayConfig,"收费标准");
+		put(businessCode_TerminateMachine,"计时终端");
+		put(businessCode_Eval,"评价信息");
+		put(businessCode_Complaint,"投诉信息");
+		put(businessCode_LogSign,"签到签退");
+		put(businessCode_Msg,"消息通知");
+		put(businessCode_XmjpPoint,"报名点");
+		put(businessCode_XmjpTheoryRoom,"理论教室");
+		put(businessCode_XmjpSchPublicRegion,"经营训练场地");
+		put(businessCode_XmjpStudentClassOpen,"历史学员开班");
+		put(businessCode_searchDevice,"终端备案关系查询接");
+	}};
+	/** 日志-业务类型: 全国平台预录入 */
+	public static final String businessType_schbaseaddQgpt = "全国平台预录入";
+	/** 日志-业务类型: 省平台预录入 */
+	public static final String businessType_schbaseaddSpt = "省平台预录入";
+	/** 日志-业务类型: 获取统一编码 */
+	public static final String businessType_code = "获取统一编码";
+	/** 日志-业务类型: 查询统一编码 */
+	public static final String businessType_codeSelect = "查询统一编码";
+	/** 日志-业务类型: 新增备案 */
+	public static final String businessType_add_record = "新增备案";
+	/** 日志-业务类型: 修改备案 */
+	public static final String businessType_upd_record = "修改备案";
+	/** 日志-业务类型: 备案 */
+	public static final String businessType_record = "备案";
+	/** 日志-业务类型: 跨培训机构备案 */
+	public static final String businessType_record_kpxjg = "跨培训机构备案";
+	/** 日志-业务类型: 修改 */
+	public static final String businessType_upd = "修改";
+	/** 日志-业务类型: 新增修改 */
+	public static final String businessType_add_upd = "新增修改";
+	/** 日志-业务类型: 删除 */
+	public static final String businessType_del = "删除";
+	/** 日志-业务类型: 查询 */
+	public static final String businessType_sel = "查询";
+	/** 日志-业务类型: 上传照片 */
+	public static final String businessType_pic = "上传照片";
+	/** 日志-业务类型: 分钟学时补传 */
+	public static final String businessType_min = "分钟学时补传";
+	/** 日志-业务类型: 评价信息交换 */
+	public static final String businessType_evaljh = "评价信息交换";
+	/** 日志-业务类型: 投诉信息交换 */
+	public static final String businessType_complaintjh = "投诉信息交换";
+	/** 日志-业务类型: 评价信息查询 */
+	public static final String businessType_eval = "评价信息查询";
+	/** 日志-业务类型: 投诉信息查询 */
+	public static final String businessType_complaint = "投诉信息查询";
+	/** 日志-业务类型: 训练照片上传 */
+	public static final String businessType_trainimgInfo = "训练照片上传";
+	/** 日志-业务类型: 训练视频上传 */
+	public static final String businessType_videoRecord = "训练视频上传";
+	/** 日志-业务类型: 电子教学日志上传 */
+	public static final String businessType_classRecord = "电子教学日志上传";
+	/** 日志-业务类型: 阶段学时上报 */
+	public static final String businessType_stageTrainningTime = "阶段学时上报";
+	/** 日志-业务类型: 阶段学时上报 */
+	public static final String businessType_graduation = "学员结业备案";
+	/** 日志-业务类型: 绑定教练车 */
+	public static final String businessType_bindCar = "绑定教练车";
+	
+	/** 日志-业务类型:绑定模拟  */
+	public static final String httpServer_BindSimulator = "绑定模拟器";
+	
+	/** 日志-业务类型: 解绑教练车 */
+	public static final String businessType_unBindCar = "解绑教练车";
+	
+	/** 日志-业务类型: 解绑模拟器 */
+	public static final String businessType_unBindSimulator = "解绑模拟器";
+	
+	/** 日志-业务类型: 解绑教练车 */
+	public static final String businessType_altConnect = "变更在线状态";
+	/** 日志-业务类型: 审核结果消息通知 */
+	public static final String businessType_reviewmsg = "审核结果";
+	/** 日志-业务类型: 备案关系变更消息通知 */
+	public static final String businessType_recordchangemsg = "备案关系变更";
+	/** 日志-业务类型: 基础信息审核关系变更消息通知 */
+	public static final String businessType_recordauditmsg = "基础信息审核关系变更";
+	/** 日志-业务类型: 锁定与解除锁定消息通知 */
+	public static final String businessType_recordlockmsg = "锁定与解除锁定关系变更";
+	/** 日志-业务类型: 驾校通知下发 */
+	public static final String businessType_schoolnoticesend = "驾校通知下发";
+	/** 日志-业务类型: 查询统一编码 */
+	public static final String businessType_codeSelecte = "查询统一编码";
+	/** 日志-业务类型: 签到签退信息 */
+	public static final String businessType_logSign = "签到签退";
+	/** 日志-业务类型: 备案关系变更消息通知 */
+	public static final String businessType_auditrecord = "备案审核通知";
+	/** 日志-业务类型: 备案关系变更消息通知 */
+	public static final String businessType_schoolModifyLimit = "更新培训机构人数限制";
+
+	/** 日志-业务类型: 新增备案 */
+	public static final String businessType_Change = "转校申请";
+	/** 日志-业务类型: 历史学员阶段学时上报 */
+	public static final String businessType_stageTrainningTimeHistory = "历史学员阶段学时上报";
+	/** 日志-业务类型: 获取最后GPS点信息 */
+	public static final String businessType_getLastGpsBySim = "获取最后GPS点信息";
+	/** 日志-业务类型: 获取设备视频房间 */
+	public static final String businessType_getDeviceVideoByDeviceNum = "获取设备视频房间";
+	/** 日志-业务类型: 根据全国编号获取教练信息 */
+	public static final String businessType_getCoachByObjnum = "根据全国编号获取教练信息";
+	/** 日志-业务类型: 表A.72 电子教学日志按时间查询 */
+	public static final String businessType_queryclassrecord = "电子教学日志按时间查询";
+	/** 日志-业务类型:  表A.69 分钟学时按时间查询 */
+	public static final String businessType_querytrainrecord = "分钟学时按时间查询";
+	/** 日志-业务类型:  表A.63 分钟学时备案结果查询 */
+	public static final String businessType_trainrecord = "分钟学时备案结果查询";
+	/** 日志-业务类型:  表A.61 电子教学日志备案结果查询*/
+	public static final String businessType_classrecord = "电子教学日志备案结果查询";
+	/** 日志-业务类型: 刷卡类型变更 */
+	public static final String businessType_changecardtype = "刷卡类型变更";
+	/** 日志-业务类型: 新增备案 */
+	public static final String businessType_Student_Change = "转校申请";
+	
+	public static final String businessType_abnormal = "学时异常查询接";
+	public static final String businessType_querystage = "阶段送审信息查询";
+	public static final String businessType_queryPoliceState = "阶段送审记录推送交警查询";
+	public static final String businessType_transferrecord = "学员各部分学时查询";
+	/** 日志-业务类型: 学员合同上传 */
+	public static final String businessType_studentcontract = "学员合同上传";
+	/** 日志-业务类型: 车辆证审核提交 */
+	public static final String businessType_carLicense = "车辆证审核提交";
+	/** 日志-业务类型: 车辆等级评定审核提交 */
+	public static final String businessType_vehicleClass = "车辆登记评定审核提交";
+	/** 日志-业务类型: 车辆保险修改提交 */
+	public static final String businessType_updateCarInsurance = "车辆保险修改提交";
+	/** 日志-业务类型: IC卡申请审核提交 */
+	public static final String businessType_applyCard="ID卡申请审核提交";
+	/** 日志-业务类型:学时异常审核通知*/
+	public static final String businessType_reviewabnormal="学时异常审核通知";
+	/** 返回码: -99(系统错误日记) */
+
+	public static final String businessType_studentScore="学员考试成绩";
+	
+	public static final String businessType_studenttransfer="异地学员转入";
+	
+	
+	
+	
+	public static final String errorcode_system = "-99";
+	/** 返回码: -99(系统错误日记) */
+	public static final String errorcode_exceptionText = "服务异常";
+	/** 返回码: 0(执行成功/数据上传成功) */
+	public static final String errorcode_0 = "0";
+	/** 返回码: 1(执行失败) */
+	public static final String errorcode_1 = "1";
+	/** 返回码: 100(请求的服务/资源不存在) */
+	public static final String errorcode_100 = "100";
+	/** 返回码: 200(数据格式错误,无法正确解析) */
+	public static final String errorcode_200 = "200";
+	/** 返回码: 201(时间戳重复) */
+	public static final String errorcode_201 = "201";
+	/** 返回码: 202(证书无法通过验证) */
+	public static final String errorcode_202 = "202";
+	/**
+	 * <p>返回码Map:</p>
+	 * <p>	0(执行成功/数据上传成功)</p>
+	 * <p>	1(执行失败)</p>
+	 * <p>	100(请求的服务/资源不存在)</p>
+	 * <p>	200(数据格式错误,无法正确解析)</p>
+	 * <p>	201(时间戳重复)</p>
+	 * <p>	202(证书无法通过验证)</p>
+	 */
+	@SuppressWarnings("serial")
+	public final static Map<String, String> errorcodeMap = new HashMap<String, String>(){{
+		put("0", "执行成功/数据上传成功");
+		put("1", "执行失败");
+		put("100", "请求的服务/资源不存在");
+		put("200", "数据格式错误,无法正确解析");
+		put("201", "时间戳重复");
+		put("202", "证书无法通过验证");
+	}};
+
+	
+	/** 接口服务名:Schbaseadd(全国、省平台预录入) 20190618全国平台预录入新的方支*/
+	public static final String httpServer_Schbaseadd_new = "preinstitution";
+	/** 接口服务名:Schbaseadd(全国、省平台预录入) */
+	public static final String httpServer_Schbaseadd = "schbaseadd";
+	/** 接口服务名:Institution(新增培训机构接口定义) */
+	public static final String httpServer_Institution = "institution";
+	/** 接口服务名:Student(新增学员接口定义) */
+	public static final String httpServer_Student = "student";
+	/** 接口服务名:Student(新增历史学员接口定义) */
+	public static final String httpServer_HistoryStudent = "historyStudent";
+	/** 接口服务名:Student(学员全国统一编号查询方法) */
+	public static final String httpServer_stuinfo = "stuinfo";
+	/** 接口服务名:Student(跨培训机构备案方法) */
+	public static final String httpServer_Transfer = "transfer";
+	/** 接口服务名:Student(投诉信息交换方法) */
+	public static final String httpServer_Complaint = "complaint";
+	/** 接口服务名:Student(投诉信息交换方法) */
+	public static final String httpServer_Abnormal = "abnormal";
+	/** 接口服务名:Student(投诉信息查询方法) */
+	public static final String httpServer_ComplaintQuery = "complaintquery";
+	/** 接口服务名:Student(评价信息交换方法) */
+	public static final String httpServer_Evaluation = "evaluation";
+	/** 接口服务名:Student(评价信息查询方法) */
+	public static final String httpServer_EvaluationQuery = "evaluationquery";
+	/** 接口服务名:region */
+	public static final String httpServer_Region = "region";
+	/** 接口服务名:Theoryroom */
+	public static final String httpServer_Theoryroom = "theoryroom";
+	/** 接口服务名:coach(新增教练员接口) */
+	public static final String httpServer_Coach = "coach";
+	/** 接口服务名:Examiner(新增考核员接口) */
+	public static final String httpServer_Examiner = "examiner";
+	/** 接口服务名:Securityguard(新增安全员接口) */
+	public static final String httpServer_Securityguard = "securityguard";
+	/** 接口服务名:TrainingCar(新增教练车接口) */
+	public static final String httpServer_TrainingCar = "trainingcar";
+	/** 接口服务名:TrainingCar(新增教练车接口) */
+	public static final String httpServer_trainingCar = "trainingCar";
+	/** 接口服务名:region */
+	public static final String httpServer_RegionReview = "regionreview";
+	/** 接口服务器:CharStandard */
+	public static final String httpServer_CharStandard = "CharStandard";
+	/** 接口服务器:Imageup (文件资料信息上传) */
+	public static final String httpServer_Imageup = "imageup";
+	/** 接口服务器:Imageup (文件资料信息查看) */
+	public static final String httpServer_ImageSel = "imageSel";
+	/** 接口服务器:Imageup (文件资料信息删除) */
+	public static final String httpServer_ImageDel = "imageDel";
+	/** 接口服务器:计时终端设备  */
+	public static final String httpServer_Device = "device";
+	/** 接口服务器:模拟器设备  */
+	public static final String httpServer_TrainingSimulator = "simulator";
+	/** 接口服务器:培训照片上传  */
+	public static final String httpServer_Trainimginfo = "trainimginfo";
+	/** 接口服务器:培训视频上传  */
+	public static final String httpServer_VideoRecord = "videoRecord";
+	/** 接口服务器:电子教学日志上传  */
+	public static final String httpServer_ClassRecord = "classrecord";
+	/** 接口服务器:阶段培训记录上报  */
+	public static final String httpServer_StageTrainningTime = "stagetrainningtime";
+	/** 接口服务器:阶段培训记录上报  */
+	public static final String httpServer_StageTrainningTimeN = "stagetrainningtimeN";
+	/** 接口服务器:结业备案  */
+	public static final String httpServer_Graduation = "graduation";
+	/** 接口服务器:表A.75 阶段学时审核结果查询 */
+	public static final String httpServer_StageTrainningTimeReview = "stagetrainningtimereview";
+	/** 接口服务器:车载计程计时终端绑定  */
+	public static final String httpServer_Devassign = "devassign";
+	/** 接口服务器:模拟器终端绑定  */
+	public static final String httpServer_BindSimulatordev = "bindSimulatordev";
+	/** 接口服务器:车载计程计时终端解绑  */
+	public static final String httpServer_DevRembinding = "devRembinding";
+	/** 接口服务器:模拟器终端解绑  */
+	public static final String httpServer_Removesimulatordevbind = "removesimulatordevbind";
+	/** 接口服务器:车载计程计时终端在线状态变更  */
+	public static final String httpServer_DevAltConnect = "devAltConnect";
+	/** 接口服务器:审核结果消息通知接口  */
+	public static final String httpServer_Reviewmsg = "reviewmsg";
+	/** 接口服务器:备案关系变更消息通知接口  */
+	public static final String httpServer_Recordchangemsg = "recordchangemsg";
+	/** 接口服务器:基础信息审核关系变更消息通知接口  */
+	public static final String httpServer_RecordAuditmsg = "recordAuditmsg";
+	/** 接口服务器:锁定关系变更消息通知接口  */
+	public static final String httpServer_RecordLockmsg = "recordLockmsg";
+	/** 接口服务器:驾校通知下发接口  */
+	public static final String httpServer_SchoolNoticeSend = "schoolnoticesend";
+	/** 接口服务器:分钟学时接收接口  */
+	public static final String httpServer_MinTrainingTime = "mintrainingtime";
+	/** 接口服务器:GPS接收接口  */
+	public static final String httpServer_Gps= "gps";
+	/** 接口服务器:签到签退接口  */
+	public static final String httpServer_LogSign= "logSign";
+	/** 同步历史学员里程 */
+	public static final String httpServer_GetTrainMile = "getTrainMile";
+	/** 同步历史学员训练照片 */
+	public static final String httpServer_GetTrainPhoto = "getTrainPhoto";
+	/** 获取历史学员培训信息*/
+	public static final String httpServer_GetStuHistoryDetail = "getStuHistoryDetail";
+	/** 获取历史学员培训坐标点 */
+	public static final String httpServer_GetStuHistoryGps = "getStuHistoryGps";
+	/** 接口服务名:Schoolpoint(新增报名点接口定义) */
+	public static final String httpServer_Schoolpoint = "schoolpoint";
+	/** 接口服务名:Schooltheoryroom(新增理论教室接口定义) */
+	public static final String httpServer_Schooltheoryroom = "schooltheoryroom";
+	/** 接口服务名:Studentlogout(新增学员退学接口定义) */
+	public static final String httpServer_Studentlogout = "studentlogout";
+	/** 接口服务名:Schoolpublicregion(新增经营训练场接口定义) */
+	public static final String httpServer_Schoolpublicregion = "schoolpublicregion";
+	/** 接口服务名:Schoolpublicregioncar(新增经营训练场车辆入驻接口定义) */
+	public static final String httpServer_Schoolpublicregioncar = "schoolpublicregioncar";
+	/** 接口服务名:Stagetrainningtimehistory(历史学员阶段培训记录上报接口定义) */
+	public static final String httpServer_Stagetrainningtimehistory = "stagetrainningtimehistory";
+	/** 接口服务名:classopen(历史学员开班记录上报/修改接口定义) */
+	public static final String httpServer_classopen = "classopen";
+	/** 接口服务器:jsimageup (文件资料信息上传) */
+	public static final String httpServer_jsimageup = "jsimageup";
+	/** 接口服务器:计时培训图片上传接口,用于TCP上传失败时使用  */
+	public static final String httpServer_Jsimageup = "Jsimageup";
+	/** 接口服务器:计时培训分钟学时补传,用于TCP上传失败时使用  */
+	public static final String httpServer_JsTrainminup = "JsTrainminup";
+	/** 接口服务器:同步消息接口  */
+	public static final String httpServer_SyncStudent = "syncStudent";
+	/** 获取驾校签章 **/
+	public static final String httpServer_GetJxQz = "getJxQz";
+	/** 获取最后GPS点信息 **/
+	public static final String httpServer_getLastGpsBySim = "getLastGpsBySim";
+	/** 获取房间号 **/ 
+	public static final String httpServer_getRoomNum = "getRoomNum";
+	/**获取设备视频房间**/
+	public static final String httpServer_getDeviceVideoByDeviceNum = "getDeviceVideoByDeviceNum";
+	/**修改学员名称**/
+	public static final String httpServer_updateStuState = "updateStuState";
+	/**  监管平台扩展接口20200108服务名:根据全国编号获取教练信息  */
+	public static final String httpServer_getCoachByObjnum = "getCoachByObjnum";
+	
+	/** 接口服务器:扩展消息通知接口  */
+	public static final String httpServer_Msgnotify = "msgnotify";
+	/**  监管平台扩展接口:表A.72 电子教学日志按时间查询接口定义  */
+	public static final String httpServer_queryclassrecord = "queryclassrecord";
+	/**  监管平台扩展接口:表A.69 分钟学时按时间查询  */
+	public static final String httpServer_querytrainrecord = "querytrainrecord";
+	/**  监管平台扩展接口:表A.63 分钟学时备案结果查询  */
+	public static final String httpServer_trainrecord = "trainrecord";
+	/**  监管平台扩展接口:表A.61 电子教学日志备案结果查询  */
+	public static final String httpServer_classrecord = "classrecord";
+	
+	/** 接口服务名:coach(教练通知结果查询) */
+	public static final String httpServer_SelectCoachNotify = "coach";
+	
+	/** 接口服务名:trainingcar(教练车通知结果查询) */
+	public static final String httpServer_SelectTrainingcarNotify = "trainingcar";
+	/** 接口服务名:examiner(考核员通知结果查询) */
+	public static final String httpServer_SelectExaminerNotify = "examiner";
+	/** 接口服务名:examiner(安全员通知结果查询) */
+	public static final String httpServer_SelectSecurityguardNotify = "securityguard";
+	/** 接口服务名:institution(驾校通知结果查询) */
+	public static final String httpServer_SelectInstitutionNotify = "institution";
+	/** 接口服务名:device(终端通知结果查询) */
+	public static final String httpServer_SelectDeviceNotify = "device";
+	/** 接口服务名:region(围栏通知结果查询) */
+	public static final String httpServer_SelectRegionNotify = "region";
+	/** 接口服务名:Theoryroom(理论教室通知结果查询) */
+	public static final String httpServer_SelectTheoryroomNotify = "theoryroom";
+	/** 接口服务名:student(学员通知结果查询) */
+	public static final String httpServer_SelectStudentNotify = "student";
+	/** 接口服务名:contract(新增学员合同接口定义) */
+	public static final String httpServer_Student_Contract = "contract";
+	/** 接口服务名:contract(查询学员接口定义) */
+	public static final String httpServer_SearchStudent = "searchStudent";
+	/** 接口服务名:carLicense(车辆证审核接口定义) */
+	public static final String httpServer_carLicense = "carLicense";
+	/** 接口服务名:updateCarInsurance(车辆保险修改接口定义) */
+	public static final String httpServer_updateCarInsurance = "updateCarInsurance";
+	
+	/** 接口服务名:vehicleClass(车辆等级评定审核接口定义) */
+	public static final String httpServer_vehicleClass = "vehicleClass";
+	/** 接口服务名:applyCard(IC卡申请审核接口定义) */
+	public static final String httpServer_applyCard = "applyCard";
+	/** 接口服务名:reviewabnormal(异常学时审核接口定义) */
+	public static final String httpServer_reviewabnormal = "reviewabnormal";
+	/** 接口服务名:coachLeave(教练员离职) */
+	public static final String httpServer_coachLeave = "coachLeave";
+	/** 接口服务名:coachLeave(学员异常日志申诉审核通知) */
+	public static final String httpServer_trainAppeal = "trainAppeal";
+	
+	/** 接口服务名:carRembinding(车辆解绑教练员) */
+	public static final String httpServer_carRembinding = "carRembinding";
+	
+	/**上传文件参数类型*/
+	public static final String file_stuimg = "stuimg";//学员头像
+	public static final String file_stufp = "stufp";//学员指纹
+	public static final String file_coachimg = "coachimg";//教练员头像
+	public static final String file_coachfp = "coachfp";//教练员指纹
+	public static final String file_examinerimg = "examinerimg";//考核员头像
+	public static final String file_examinerfp = "examinerfp";//考核员指纹
+	public static final String file_securityguardimg = "securityguardimg";//安全员头像
+	public static final String file_securityguardfg = "securityguardfg";//安全员指纹
+	public static final String file_vehimg = "vehimg";//教练车图片
+	public static final String file_outletsimg = "outletsimg";//招生点照片
+	public static final String file_occupationimg = "occupationimg";//资格证书图片
+	public static final String file_voiceprintimg = "voiceprintimg";//声纹文件
+	public static final String file_epdfimg = "epdfimg";//电子培训部分记录表PDF文件;
+	public static final String file_onlineimg = "onlineimg";//网络远程学习过程照片;
+	public static final String file_classroom = "classroom";//课堂教学过程照片;
+	public static final String file_simulation = "simulation";//模拟教学过程照片;
+	public static final String file_video = "video";//视频文件
+	public static final String file_region = "region";//电子围栏纸质文件
+	public static final String file_traincar = "traincar";//车辆附件文件上传接口
+	public static final String file_coachcontract = "coachcontract";//教练合同
+	public static final String file_stucontract = "stucontract";//学员培训协议
+	public static final String file_stuface = "stuface";//学员人脸模板
+	public static final String file_conimg = "conimg";//学员合同
+	public static final String file_transferschimg = "transferschimg";//异地转入合同
+
+	/** 接口服务名:TrainingCar(新增运政教练车新备修改接口) */
+	public static final String httpServer_TrainingCarYz = "addCarLicense";
+	/** 接口服务名:TrainingCar(运政车辆等级评定审核) */
+	public static final String httpServer_TrainingCar_VehicleClass = "vehicleClass";
+	/** 接口服务名:TrainingCar(新增运政教练车辆保险修改接口) */
+	public static final String httpServer_TrainingCar_UpdateCarInsurance = "updateCarInsurance";
+	/** 接口服务名:TrainingCar(新增运政教练车辆注销接口) */
+	public static final String httpServer_TrainingCar_RemoveCarLicense = "removeCarLicense";
+	/** 接口服务名:TrainingCar(新增运政教练车辆补发车辆证接口) */
+	public static final String httpServer_TrainingCar_ReissueCarLicense = "reissueCarLicense";
+
+	/** 接口服务名:TrainingCar(新增运政教练车辆证变更接口) */
+	public static final String httpServer_TrainingCar_UpdateCarLicense = "updateCarLicense";
+	
+	/** 接口服务名:TrainingCar(补传车辆信息) */
+	public static final String httpServer_TrainingCar_UpdateCarFiles = "updateCarFiles";
+	
+	/** 接口服务名:studentLogout(学员注销) */
+	public static final String httpServer_studentLogout = "studentLogout";
+	
+	/** 接口服务名:studenttransfer(异地学员) */
+	public static final String httpServer_studenttransfer = "studenttransfer";
+	
+	public static final String httpServer_studentScore = "studentScore";
+	
+	/**
+	 * 用于查询全国平台统一编号列表
+	 */
+	@SuppressWarnings("serial")
+	public final static Map<String, String> qgptCodeMap = new HashMap<String, String>(){{
+		put(businessCode_XmjpSch, "培训机构");
+		put(businessCode_XmjpCoach, "教练员");
+		put(businessCode_Student, "学员");
+		put(businessCode_ExaminerInfo, "考核员");
+		put(businessCode_EecurityInfo, "安全员");
+		put(businessCode_XmjpCar, "教练车");
+		put(businessCode_TerminateMachine,"计时终端");
+	}};
+
+
+	// 返回一个byte数组
+	@SuppressWarnings("resource")
+	public static byte[] getBytesFromFile(File file) throws IOException {
+		InputStream is = new FileInputStream(file);
+		// 获取文件大小
+		long length = file.length();
+		if (length > Integer.MAX_VALUE) {
+			// 文件太大,无法读取
+			throw new IOException("File is to large " + file.getName());
+		}
+		// 创建一个数据来保存文件数据
+		byte[] bytes = new byte[(int) length];
+		// 读取数据到byte数组中
+		int offset = 0;
+		int numRead = 0;
+		while (offset < bytes.length&& (numRead = is.read(bytes, offset, bytes.length - offset)) >= 0) {
+			offset += numRead;
+		}
+		// 确保所有数据均被读取
+		if (offset < bytes.length) {
+			throw new IOException("Could not completely read file "+ file.getName());
+		}
+		is.close();
+		return bytes;
+	}
+	public static byte[] getBytes(File file) {
+		byte[] buffer = null;
+		try {
+			FileInputStream fis = new FileInputStream(file);
+			ByteArrayOutputStream bos = new ByteArrayOutputStream(1000);
+			byte[] b = new byte[1000];
+			int n;
+			while ((n = fis.read(b)) != -1) {
+				bos.write(b, 0, n);
+			}
+			fis.close();
+			bos.close();
+			buffer = bos.toByteArray();
+		} catch (FileNotFoundException e) {
+			e.printStackTrace();
+		} catch (IOException e) {
+			e.printStackTrace();
+		}
+		return buffer;
+	}
+
+
+
+	
+
+
+	
+
+
+}

+ 160 - 0
hzgzpt-service-app/src/main/java/com/miaxis/app/test/util/ProvResultJson.java

@@ -0,0 +1,160 @@
+/**
+ * JSON返回结果集
+ * @author liaogr 2015-3-24
+ * */
+package com.miaxis.app.test.util;
+
+
+public class ProvResultJson {
+	private String result;// 操作结果 0 成功 1 失败
+	private String msg;// 消息
+	private Object object; //传递的对象(用于存放全国统一编码)
+
+	//全国统一编号
+	private String inscode;//培训机构编号	统一编号
+	private String coachnum;//教练员编号	统一编号
+	private String examnum;//考核员编号 	统一编号
+	private String secunum;//安全员编号 	统一编号
+	
+	private String carnum;//教练车编号	  	统一编号
+	private String stunum;//学员编号		统一编号
+	private String devnum;//终端编号		统一编号
+	
+	private String id;//上传资源 统一返回ID
+	
+	private String imei;//如果终端时,为终端IMEI号或设备MAC地址
+	private String key;//如果终端时,为终端证书
+	private String passwd;//如果终端时,为终端密码
+	
+	private String path;//图片路径
+	
+
+	public String getPath() {
+		return path;
+	}
+
+	public void setPath(String path) {
+		this.path = path;
+	}
+
+
+	public String getResult() {
+		return result;
+	}
+
+	public void setResult(String result) {
+		this.result = result;
+	}
+
+	public String getMsg() {
+		return msg;
+	}
+
+	public void setMsg(String msg) {
+		this.msg = msg;
+	}
+
+	public Object getObject() {
+		return object;
+	}
+
+	public void setObject(Object object) {
+		this.object = object;
+	}
+
+	public String getInscode() {
+		return inscode;
+	}
+
+	public void setInscode(String inscode) {
+		this.inscode = inscode;
+	}
+
+	public String getCoachnum() {
+		return coachnum;
+	}
+
+	public void setCoachnum(String coachnum) {
+		this.coachnum = coachnum;
+	}
+
+	public String getExamnum() {
+		return examnum;
+	}
+
+	public void setExamnum(String examnum) {
+		this.examnum = examnum;
+	}
+
+	public String getSecunum() {
+		return secunum;
+	}
+
+	public void setSecunum(String secunum) {
+		this.secunum = secunum;
+	}
+
+	public String getCarnum() {
+		return carnum;
+	}
+
+	public void setCarnum(String carnum) {
+		this.carnum = carnum;
+	}
+
+	public String getStunum() {
+		return stunum;
+	}
+
+	public void setStunum(String stunum) {
+		this.stunum = stunum;
+	}
+
+	public String getDevnum() {
+		return devnum;
+	}
+
+	public void setDevnum(String devnum) {
+		this.devnum = devnum;
+	}
+
+	public String getId() {
+		return id;
+	}
+
+	public void setId(String id) {
+		this.id = id;
+	}
+
+	public String getImei() {
+		return imei;
+	}
+
+	public void setImei(String imei) {
+		this.imei = imei;
+	}
+
+	public String getKey() {
+		return key;
+	}
+
+	public void setKey(String key) {
+		this.key = key;
+	}
+
+	public String getPasswd() {
+		return passwd;
+	}
+
+	public void setPasswd(String passwd) {
+		this.passwd = passwd;
+	}
+
+	public ProvResultJson(String msg, String result) {
+		this.msg = msg;
+		this.result = result;
+	}
+	public ProvResultJson(){
+		
+	}
+}

+ 38 - 0
hzgzpt-service-app/src/main/java/com/miaxis/app/test/util/Sign.java

@@ -0,0 +1,38 @@
+package com.miaxis.app.test.util;
+
+import com.sun.org.apache.xerces.internal.impl.dv.util.HexBin;
+
+import javax.crypto.Cipher;
+import java.security.MessageDigest;
+import java.security.PrivateKey;
+
+@SuppressWarnings("restriction")
+public class Sign implements ISign {
+	
+	public String sign(String data, long timestamp, PrivateKey key) throws Exception {
+		return sign(data.getBytes("utf-8"), timestamp, key);
+	}
+	
+	public String sign(String data, PrivateKey key) throws Exception{
+		return sign(data.getBytes("utf-8"), 0, key);
+	}
+	
+	public String sign(byte [] data, PrivateKey key) throws Exception {
+		return sign(data, 0, key);
+	}
+	
+	public String sign(byte [] data, long timestamp, PrivateKey key) throws Exception {
+		MessageDigest md = MessageDigest.getInstance(PlatUtil.url_version_type);
+		md.update(data);
+		if(timestamp > 0){
+			md.update(EncodeUtil.toBE(timestamp));
+		}
+		
+		byte[] hash = md.digest();
+		Cipher cipher = Cipher.getInstance("RSA");
+		cipher.init(Cipher.ENCRYPT_MODE, key);
+		byte[] encrypted = cipher.doFinal(hash);
+		return HexBin.encode(encrypted);
+	}
+
+}

+ 50 - 0
hzgzpt-service-app/src/main/java/com/miaxis/app/test/util/Verify.java

@@ -0,0 +1,50 @@
+package com.miaxis.app.test.util;
+
+import com.sun.org.apache.xerces.internal.impl.dv.util.HexBin;
+
+import javax.crypto.Cipher;
+import java.security.MessageDigest;
+import java.security.cert.X509Certificate;
+import java.util.Arrays;
+
+@SuppressWarnings("restriction")
+public class Verify implements IVerify {
+	
+	public boolean verify(String data, long timestamp, String encodedEncryptedStr,
+			X509Certificate userCert) throws Exception 
+	{
+		return verify(data.getBytes("utf-8"), timestamp, encodedEncryptedStr, userCert);
+	}
+	
+	public boolean verify(String data, String encodedEncryptedStr,
+			X509Certificate userCert) throws Exception
+	{
+		return verify(data.getBytes("utf-8"), 0, encodedEncryptedStr, userCert);
+	}
+	
+	public boolean verify(byte [] data, String encodedEncryptedStr,
+			X509Certificate userCert) throws Exception{
+		return verify(data, encodedEncryptedStr, userCert);
+	}
+	
+	
+	public boolean verify(byte [] data, long timestamp, String encodedEncryptedStr,
+			X509Certificate userCert) throws Exception
+	{
+		MessageDigest md = MessageDigest.getInstance(PlatUtil.url_version_type);
+		md.update(data);
+		if(timestamp > 0){
+			md.update(EncodeUtil.toBE(timestamp));
+		}
+		
+		byte[] hash = md.digest();
+
+		byte[] encryptedStr = HexBin.decode(encodedEncryptedStr);
+		Cipher cipher = Cipher.getInstance("RSA");
+		cipher.init(Cipher.DECRYPT_MODE, userCert);
+		byte[] plain = cipher.doFinal(encryptedStr);
+		boolean ok = Arrays.equals(hash, plain);
+		return ok;
+	}
+
+}

+ 66 - 0
hzgzpt-service-app/src/main/java/com/miaxis/app/test/util/VerifyUtil.java

@@ -0,0 +1,66 @@
+package com.miaxis.app.test.util;
+
+import java.util.List;
+
+/**
+ * 验证工具类
+ * 
+ * @author 刘志敏
+ * @Date 2016年11月30日 下午3:00:34
+ */
+public class VerifyUtil {
+	
+	/**
+	 * 验证字符串(String)是否为空字符串,true不为空,false为空
+	 * @param str
+	 * @return
+	 */
+	public static boolean verifyString(String str) {
+		if(str != null && !"".equals(str.trim())&&!"null".equals(str)) {
+			return true;
+		}
+		return false;
+	}
+	
+	/**
+	 * 验证整形(Integer)是否为空字符串,true不为空,false为空
+	 * @param str
+	 * @return
+	 */
+	public static boolean verifyInteger(Integer i) {
+		if(i != null) {
+			return true;
+		}
+		return false;
+	}
+	
+	/**
+	 * 验证集合(List)是否为空集合,true不为空,false为空
+	 * @param str
+	 * @return
+	 */
+	@SuppressWarnings("rawtypes")
+	public static boolean verifyList(List list) {
+		if(list != null && list.size() > 0) {
+			return true;
+		}
+		return false;
+	}
+	
+	/**
+	 * 验证Object
+	 * 
+	 * @param obj
+	 * @return boolean
+	 * @throws 
+	 * @author 刘志敏
+	 * @Date 2017年11月8日 下午3:34:11
+	 */
+	public static boolean verifyObject(Object obj) {
+		if(obj != null && !obj.toString().trim().equals("")) {
+			return true;
+		}
+		return false;
+	}
+	
+}