diff --git a/model/常态化疫情下的大学生出入校管理系统“入校申请”用例的顺序图.vsdx b/model/常态化疫情下的大学生出入校管理系统“入校申请”用例的顺序图.vsdx new file mode 100644 index 0000000..284b362 Binary files /dev/null and b/model/常态化疫情下的大学生出入校管理系统“入校申请”用例的顺序图.vsdx differ diff --git a/model/常态化疫情下的大学生出入校管理系统“出校申请”用例的顺序图.vsdx b/model/常态化疫情下的大学生出入校管理系统“出校申请”用例的顺序图.vsdx new file mode 100644 index 0000000..a6c882c Binary files /dev/null and b/model/常态化疫情下的大学生出入校管理系统“出校申请”用例的顺序图.vsdx differ diff --git a/model/常态化疫情下的大学生出入校管理系统“扫码”用例的顺序图.vsdx b/model/常态化疫情下的大学生出入校管理系统“扫码”用例的顺序图.vsdx new file mode 100644 index 0000000..33cf2fa Binary files /dev/null and b/model/常态化疫情下的大学生出入校管理系统“扫码”用例的顺序图.vsdx differ diff --git a/model/常态化疫情下的大学生出入校管理系统“更新疫情信息”用例的顺序图.vsdx b/model/常态化疫情下的大学生出入校管理系统“更新疫情信息”用例的顺序图.vsdx new file mode 100644 index 0000000..166bad0 Binary files /dev/null and b/model/常态化疫情下的大学生出入校管理系统“更新疫情信息”用例的顺序图.vsdx differ diff --git a/model/常态化疫情下的大学生出入校管理系统体系结构逻辑视图.vsdx b/model/常态化疫情下的大学生出入校管理系统体系结构逻辑视图.vsdx deleted file mode 100644 index b6b2b49..0000000 Binary files a/model/常态化疫情下的大学生出入校管理系统体系结构逻辑视图.vsdx and /dev/null differ diff --git a/model/常态化疫情下的大学生出入校管理系统数据设计类图.vsdx b/model/常态化疫情下的大学生出入校管理系统数据设计类图.vsdx deleted file mode 100644 index aed41e7..0000000 Binary files a/model/常态化疫情下的大学生出入校管理系统数据设计类图.vsdx and /dev/null differ diff --git a/src/client/OCR_baidu.jar b/src/client/OCR_baidu.jar new file mode 100644 index 0000000..b997942 Binary files /dev/null and b/src/client/OCR_baidu.jar differ diff --git a/src/client/OCR_baidu/.idea/.gitignore b/src/client/OCR_baidu/.idea/.gitignore new file mode 100644 index 0000000..359bb53 --- /dev/null +++ b/src/client/OCR_baidu/.idea/.gitignore @@ -0,0 +1,3 @@ +# 默认忽略的文件 +/shelf/ +/workspace.xml diff --git a/src/client/OCR_baidu/.idea/artifacts/OCR_baidu_jar.xml b/src/client/OCR_baidu/.idea/artifacts/OCR_baidu_jar.xml new file mode 100644 index 0000000..89136c5 --- /dev/null +++ b/src/client/OCR_baidu/.idea/artifacts/OCR_baidu_jar.xml @@ -0,0 +1,12 @@ + + + $PROJECT_DIR$/out/artifacts/OCR_baidu_jar + + + + + + + + + \ No newline at end of file diff --git a/src/client/OCR_baidu/.idea/compiler.xml b/src/client/OCR_baidu/.idea/compiler.xml new file mode 100644 index 0000000..a1757ae --- /dev/null +++ b/src/client/OCR_baidu/.idea/compiler.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/src/client/OCR_baidu/.idea/libraries/aip_java_sdk_4_16_11.xml b/src/client/OCR_baidu/.idea/libraries/aip_java_sdk_4_16_11.xml new file mode 100644 index 0000000..6052cd7 --- /dev/null +++ b/src/client/OCR_baidu/.idea/libraries/aip_java_sdk_4_16_11.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/src/client/OCR_baidu/.idea/libraries/json_20160810.xml b/src/client/OCR_baidu/.idea/libraries/json_20160810.xml new file mode 100644 index 0000000..fc37fb4 --- /dev/null +++ b/src/client/OCR_baidu/.idea/libraries/json_20160810.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/src/client/OCR_baidu/.idea/libraries/slf4j_api_1_7_25.xml b/src/client/OCR_baidu/.idea/libraries/slf4j_api_1_7_25.xml new file mode 100644 index 0000000..72c9c27 --- /dev/null +++ b/src/client/OCR_baidu/.idea/libraries/slf4j_api_1_7_25.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/src/client/OCR_baidu/.idea/libraries/slf4j_simple_1_7_25.xml b/src/client/OCR_baidu/.idea/libraries/slf4j_simple_1_7_25.xml new file mode 100644 index 0000000..b804740 --- /dev/null +++ b/src/client/OCR_baidu/.idea/libraries/slf4j_simple_1_7_25.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/src/client/OCR_baidu/.idea/misc.xml b/src/client/OCR_baidu/.idea/misc.xml new file mode 100644 index 0000000..f76f386 --- /dev/null +++ b/src/client/OCR_baidu/.idea/misc.xml @@ -0,0 +1,9 @@ + + + + + + + + \ No newline at end of file diff --git a/src/client/OCR_baidu/.idea/modules.xml b/src/client/OCR_baidu/.idea/modules.xml new file mode 100644 index 0000000..b39853e --- /dev/null +++ b/src/client/OCR_baidu/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/src/client/OCR_baidu/.idea/uiDesigner.xml b/src/client/OCR_baidu/.idea/uiDesigner.xml new file mode 100644 index 0000000..e96534f --- /dev/null +++ b/src/client/OCR_baidu/.idea/uiDesigner.xml @@ -0,0 +1,124 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/client/OCR_baidu/META-INF/MANIFEST.MF b/src/client/OCR_baidu/META-INF/MANIFEST.MF new file mode 100644 index 0000000..9b8fcba --- /dev/null +++ b/src/client/OCR_baidu/META-INF/MANIFEST.MF @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +Main-Class: OCR + diff --git a/src/client/OCR_baidu/OCR_baidu.iml b/src/client/OCR_baidu/OCR_baidu.iml new file mode 100644 index 0000000..025727a --- /dev/null +++ b/src/client/OCR_baidu/OCR_baidu.iml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/client/OCR_baidu/lib/aip-java-sdk-4.16.11.jar b/src/client/OCR_baidu/lib/aip-java-sdk-4.16.11.jar new file mode 100644 index 0000000..1fe3884 Binary files /dev/null and b/src/client/OCR_baidu/lib/aip-java-sdk-4.16.11.jar differ diff --git a/src/client/OCR_baidu/lib/json-20160810.jar b/src/client/OCR_baidu/lib/json-20160810.jar new file mode 100644 index 0000000..a90e448 Binary files /dev/null and b/src/client/OCR_baidu/lib/json-20160810.jar differ diff --git a/src/client/OCR_baidu/lib/slf4j-api-1.7.25.jar b/src/client/OCR_baidu/lib/slf4j-api-1.7.25.jar new file mode 100644 index 0000000..0143c09 Binary files /dev/null and b/src/client/OCR_baidu/lib/slf4j-api-1.7.25.jar differ diff --git a/src/client/OCR_baidu/lib/slf4j-simple-1.7.25.jar b/src/client/OCR_baidu/lib/slf4j-simple-1.7.25.jar new file mode 100644 index 0000000..a7260f3 Binary files /dev/null and b/src/client/OCR_baidu/lib/slf4j-simple-1.7.25.jar differ diff --git a/src/client/OCR_baidu/out/META-INF/MANIFEST.MF b/src/client/OCR_baidu/out/META-INF/MANIFEST.MF new file mode 100644 index 0000000..a30bfa7 --- /dev/null +++ b/src/client/OCR_baidu/out/META-INF/MANIFEST.MF @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +Main-Class: HealthCode + diff --git a/src/client/OCR_baidu/out/production/OCR_baidu/AipOcr.class b/src/client/OCR_baidu/out/production/OCR_baidu/AipOcr.class new file mode 100644 index 0000000..9cfd8dc Binary files /dev/null and b/src/client/OCR_baidu/out/production/OCR_baidu/AipOcr.class differ diff --git a/src/client/OCR_baidu/out/production/OCR_baidu/CovidTestRep.class b/src/client/OCR_baidu/out/production/OCR_baidu/CovidTestRep.class new file mode 100644 index 0000000..4253a2d Binary files /dev/null and b/src/client/OCR_baidu/out/production/OCR_baidu/CovidTestRep.class differ diff --git a/src/client/OCR_baidu/out/production/OCR_baidu/HealthCode.class b/src/client/OCR_baidu/out/production/OCR_baidu/HealthCode.class new file mode 100644 index 0000000..74a26f1 Binary files /dev/null and b/src/client/OCR_baidu/out/production/OCR_baidu/HealthCode.class differ diff --git a/src/client/OCR_baidu/out/production/OCR_baidu/META-INF/MANIFEST.MF b/src/client/OCR_baidu/out/production/OCR_baidu/META-INF/MANIFEST.MF new file mode 100644 index 0000000..a30bfa7 --- /dev/null +++ b/src/client/OCR_baidu/out/production/OCR_baidu/META-INF/MANIFEST.MF @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +Main-Class: HealthCode + diff --git a/src/client/OCR_baidu/out/production/OCR_baidu/TripCode.class b/src/client/OCR_baidu/out/production/OCR_baidu/TripCode.class new file mode 100644 index 0000000..c207233 Binary files /dev/null and b/src/client/OCR_baidu/out/production/OCR_baidu/TripCode.class differ diff --git a/src/client/OCR_baidu/src/AipOcr.java b/src/client/OCR_baidu/src/AipOcr.java new file mode 100644 index 0000000..262f815 --- /dev/null +++ b/src/client/OCR_baidu/src/AipOcr.java @@ -0,0 +1,1841 @@ +// +// Source code recreated from a .class file by IntelliJ IDEA +// (powered by FernFlower decompiler) +// + +import com.baidu.aip.client.BaseClient; +import com.baidu.aip.contentcensor.EImgType; +import com.baidu.aip.error.AipError; +import com.baidu.aip.http.AipRequest; +import com.baidu.aip.util.Base64Util; +import com.baidu.aip.util.Util; +import org.json.JSONObject; + +import java.io.IOException; +import java.util.Calendar; +import java.util.HashMap; + +public class AipOcr extends BaseClient { + public AipOcr(String appId, String apiKey, String secretKey) { + super(appId, apiKey, secretKey); + } + + public JSONObject basicGeneral(byte[] image, HashMap options) { + AipRequest request = new AipRequest(); + this.preOperation(request); + String base64Content = Base64Util.encode(image); + request.addBody("image", base64Content); + if (options != null) { + request.addBody(options); + } + + request.setUri("https://aip.baidubce.com/rest/2.0/ocr/v1/general_basic"); + this.postOperation(request); + return this.requestServer(request); + } + + public JSONObject basicGeneral(String image, HashMap options) { + try { + byte[] data = Util.readFileByBytes(image); + return this.basicGeneral(data, options); + } catch (IOException var4) { + var4.printStackTrace(); + return AipError.IMAGE_READ_ERROR.toJsonResult(); + } + } + + public JSONObject basicGeneralUrl(String url, HashMap options) { + AipRequest request = new AipRequest(); + this.preOperation(request); + request.addBody("url", url); + if (options != null) { + request.addBody(options); + } + + request.setUri("https://aip.baidubce.com/rest/2.0/ocr/v1/general_basic"); + this.postOperation(request); + return this.requestServer(request); + } + + public JSONObject basicAccurateGeneral(byte[] image, HashMap options) { + AipRequest request = new AipRequest(); + this.preOperation(request); + String base64Content = Base64Util.encode(image); + request.addBody("image", base64Content); + if (options != null) { + request.addBody(options); + } + + request.setUri("https://aip.baidubce.com/rest/2.0/ocr/v1/accurate_basic"); + this.postOperation(request); + return this.requestServer(request); + } + + public JSONObject basicAccurateGeneral(String image, HashMap options) { + try { + byte[] data = Util.readFileByBytes(image); + return this.basicAccurateGeneral(data, options); + } catch (IOException var4) { + var4.printStackTrace(); + return AipError.IMAGE_READ_ERROR.toJsonResult(); + } + } + + public JSONObject general(byte[] image, HashMap options) { + AipRequest request = new AipRequest(); + this.preOperation(request); + String base64Content = Base64Util.encode(image); + request.addBody("image", base64Content); + if (options != null) { + request.addBody(options); + } + + request.setUri("https://aip.baidubce.com/rest/2.0/ocr/v1/general"); + this.postOperation(request); + return this.requestServer(request); + } + + public JSONObject general(String image, HashMap options) { + try { + byte[] data = Util.readFileByBytes(image); + return this.general(data, options); + } catch (IOException var4) { + var4.printStackTrace(); + return AipError.IMAGE_READ_ERROR.toJsonResult(); + } + } + + public JSONObject generalUrl(String url, HashMap options) { + AipRequest request = new AipRequest(); + this.preOperation(request); + request.addBody("url", url); + if (options != null) { + request.addBody(options); + } + + request.setUri("https://aip.baidubce.com/rest/2.0/ocr/v1/general"); + this.postOperation(request); + return this.requestServer(request); + } + + public JSONObject accurateGeneral(byte[] image, HashMap options) { + AipRequest request = new AipRequest(); + this.preOperation(request); + String base64Content = Base64Util.encode(image); + request.addBody("image", base64Content); + if (options != null) { + request.addBody(options); + } + + request.setUri("https://aip.baidubce.com/rest/2.0/ocr/v1/accurate"); + this.postOperation(request); + return this.requestServer(request); + } + + public JSONObject accurateGeneral(String image, HashMap options) { + try { + byte[] data = Util.readFileByBytes(image); + return this.accurateGeneral(data, options); + } catch (IOException var4) { + var4.printStackTrace(); + return AipError.IMAGE_READ_ERROR.toJsonResult(); + } + } + + public JSONObject enhancedGeneral(byte[] image, HashMap options) { + AipRequest request = new AipRequest(); + this.preOperation(request); + String base64Content = Base64Util.encode(image); + request.addBody("image", base64Content); + if (options != null) { + request.addBody(options); + } + + request.setUri("https://aip.baidubce.com/rest/2.0/ocr/v1/general_enhanced"); + this.postOperation(request); + return this.requestServer(request); + } + + public JSONObject enhancedGeneral(String image, HashMap options) { + try { + byte[] data = Util.readFileByBytes(image); + return this.enhancedGeneral(data, options); + } catch (IOException var4) { + var4.printStackTrace(); + return AipError.IMAGE_READ_ERROR.toJsonResult(); + } + } + + public JSONObject enhancedGeneralUrl(String url, HashMap options) { + AipRequest request = new AipRequest(); + this.preOperation(request); + request.addBody("url", url); + if (options != null) { + request.addBody(options); + } + + request.setUri("https://aip.baidubce.com/rest/2.0/ocr/v1/general_enhanced"); + this.postOperation(request); + return this.requestServer(request); + } + + public JSONObject webImage(byte[] image, HashMap options) { + AipRequest request = new AipRequest(); + this.preOperation(request); + String base64Content = Base64Util.encode(image); + request.addBody("image", base64Content); + if (options != null) { + request.addBody(options); + } + + request.setUri("https://aip.baidubce.com/rest/2.0/ocr/v1/webimage"); + this.postOperation(request); + return this.requestServer(request); + } + + public JSONObject webImage(String image, HashMap options) { + try { + byte[] data = Util.readFileByBytes(image); + return this.webImage(data, options); + } catch (IOException var4) { + var4.printStackTrace(); + return AipError.IMAGE_READ_ERROR.toJsonResult(); + } + } + + public JSONObject webImageUrl(String url, HashMap options) { + AipRequest request = new AipRequest(); + this.preOperation(request); + request.addBody("url", url); + if (options != null) { + request.addBody(options); + } + + request.setUri("https://aip.baidubce.com/rest/2.0/ocr/v1/webimage"); + this.postOperation(request); + return this.requestServer(request); + } + + public JSONObject idcard(byte[] image, String idCardSide, HashMap options) { + AipRequest request = new AipRequest(); + this.preOperation(request); + String base64Content = Base64Util.encode(image); + request.addBody("image", base64Content); + request.addBody("id_card_side", idCardSide); + if (options != null) { + request.addBody(options); + } + + request.setUri("https://aip.baidubce.com/rest/2.0/ocr/v1/idcard"); + this.postOperation(request); + return this.requestServer(request); + } + + public JSONObject idcard(String image, String idCardSide, HashMap options) { + try { + byte[] data = Util.readFileByBytes(image); + return this.idcard(data, idCardSide, options); + } catch (IOException var5) { + var5.printStackTrace(); + return AipError.IMAGE_READ_ERROR.toJsonResult(); + } + } + + public JSONObject bankcard(byte[] image, HashMap options) { + AipRequest request = new AipRequest(); + this.preOperation(request); + String base64Content = Base64Util.encode(image); + request.addBody("image", base64Content); + if (options != null) { + request.addBody(options); + } + + request.setUri("https://aip.baidubce.com/rest/2.0/ocr/v1/bankcard"); + this.postOperation(request); + return this.requestServer(request); + } + + public JSONObject bankcard(String image, HashMap options) { + try { + byte[] data = Util.readFileByBytes(image); + return this.bankcard(data, options); + } catch (IOException var4) { + var4.printStackTrace(); + return AipError.IMAGE_READ_ERROR.toJsonResult(); + } + } + + public JSONObject drivingLicense(byte[] image, HashMap options) { + AipRequest request = new AipRequest(); + this.preOperation(request); + String base64Content = Base64Util.encode(image); + request.addBody("image", base64Content); + if (options != null) { + request.addBody(options); + } + + request.setUri("https://aip.baidubce.com/rest/2.0/ocr/v1/driving_license"); + this.postOperation(request); + return this.requestServer(request); + } + + public JSONObject drivingLicense(String image, HashMap options) { + try { + byte[] data = Util.readFileByBytes(image); + return this.drivingLicense(data, options); + } catch (IOException var4) { + var4.printStackTrace(); + return AipError.IMAGE_READ_ERROR.toJsonResult(); + } + } + + public JSONObject vehicleLicense(byte[] image, HashMap options) { + AipRequest request = new AipRequest(); + this.preOperation(request); + String base64Content = Base64Util.encode(image); + request.addBody("image", base64Content); + if (options != null) { + request.addBody(options); + } + + request.setUri("https://aip.baidubce.com/rest/2.0/ocr/v1/vehicle_license"); + this.postOperation(request); + return this.requestServer(request); + } + + public JSONObject vehicleLicense(String image, HashMap options) { + try { + byte[] data = Util.readFileByBytes(image); + return this.vehicleLicense(data, options); + } catch (IOException var4) { + var4.printStackTrace(); + return AipError.IMAGE_READ_ERROR.toJsonResult(); + } + } + + public JSONObject plateLicense(byte[] image, HashMap options) { + AipRequest request = new AipRequest(); + this.preOperation(request); + String base64Content = Base64Util.encode(image); + request.addBody("image", base64Content); + if (options != null) { + request.addBody(options); + } + + request.setUri("https://aip.baidubce.com/rest/2.0/ocr/v1/license_plate"); + this.postOperation(request); + return this.requestServer(request); + } + + public JSONObject plateLicense(String image, HashMap options) { + try { + byte[] data = Util.readFileByBytes(image); + return this.plateLicense(data, options); + } catch (IOException var4) { + var4.printStackTrace(); + return AipError.IMAGE_READ_ERROR.toJsonResult(); + } + } + + public JSONObject businessLicense(byte[] image, HashMap options) { + AipRequest request = new AipRequest(); + this.preOperation(request); + String base64Content = Base64Util.encode(image); + request.addBody("image", base64Content); + if (options != null) { + request.addBody(options); + } + + request.setUri("https://aip.baidubce.com/rest/2.0/ocr/v1/business_license"); + this.postOperation(request); + return this.requestServer(request); + } + + public JSONObject businessLicense(String image, HashMap options) { + try { + byte[] data = Util.readFileByBytes(image); + return this.businessLicense(data, options); + } catch (IOException var4) { + var4.printStackTrace(); + return AipError.IMAGE_READ_ERROR.toJsonResult(); + } + } + + public JSONObject receipt(byte[] image, HashMap options) { + AipRequest request = new AipRequest(); + this.preOperation(request); + String base64Content = Base64Util.encode(image); + request.addBody("image", base64Content); + if (options != null) { + request.addBody(options); + } + + request.setUri("https://aip.baidubce.com/rest/2.0/ocr/v1/receipt"); + this.postOperation(request); + return this.requestServer(request); + } + + public JSONObject receipt(String image, HashMap options) { + try { + byte[] data = Util.readFileByBytes(image); + return this.receipt(data, options); + } catch (IOException var4) { + var4.printStackTrace(); + return AipError.IMAGE_READ_ERROR.toJsonResult(); + } + } + + public JSONObject trainTicket(byte[] image, HashMap options) { + AipRequest request = new AipRequest(); + this.preOperation(request); + String base64Content = Base64Util.encode(image); + request.addBody("image", base64Content); + if (options != null) { + request.addBody(options); + } + + request.setUri("https://aip.baidubce.com/rest/2.0/ocr/v1/train_ticket"); + this.postOperation(request); + return this.requestServer(request); + } + + public JSONObject trainTicket(String image, EImgType type, HashMap options) { + return this.ocrByUrlOrFile(image, type, "https://aip.baidubce.com/rest/2.0/ocr/v1/train_ticket", options); + } + + public JSONObject taxiReceipt(byte[] image, HashMap options) { + AipRequest request = new AipRequest(); + this.preOperation(request); + String base64Content = Base64Util.encode(image); + request.addBody("image", base64Content); + if (options != null) { + request.addBody(options); + } + + request.setUri("https://aip.baidubce.com/rest/2.0/ocr/v1/taxi_receipt"); + this.postOperation(request); + return this.requestServer(request); + } + + public JSONObject taxiReceipt(String image, EImgType type, HashMap options) { + return this.ocrByUrlOrFile(image, type, "https://aip.baidubce.com/rest/2.0/ocr/v1/taxi_receipt", options); + } + + public JSONObject form(byte[] image, HashMap options) { + AipRequest request = new AipRequest(); + this.preOperation(request); + String base64Content = Base64Util.encode(image); + request.addBody("image", base64Content); + if (options != null) { + request.addBody(options); + } + + request.setUri("https://aip.baidubce.com/rest/2.0/ocr/v1/form"); + this.postOperation(request); + return this.requestServer(request); + } + + public JSONObject form(String image, HashMap options) { + try { + byte[] data = Util.readFileByBytes(image); + return this.form(data, options); + } catch (IOException var4) { + var4.printStackTrace(); + return AipError.IMAGE_READ_ERROR.toJsonResult(); + } + } + + public JSONObject tableRecognitionAsync(byte[] image, HashMap options) { + AipRequest request = new AipRequest(); + this.preOperation(request); + String base64Content = Base64Util.encode(image); + request.addBody("image", base64Content); + if (options != null) { + request.addBody(options); + } + + request.setUri("https://aip.baidubce.com/rest/2.0/solution/v1/form_ocr/request"); + this.postOperation(request); + return this.requestServer(request); + } + + public JSONObject tableRecognitionAsync(String image, HashMap options) { + try { + byte[] data = Util.readFileByBytes(image); + return this.tableRecognitionAsync(data, options); + } catch (IOException var4) { + var4.printStackTrace(); + return AipError.IMAGE_READ_ERROR.toJsonResult(); + } + } + + public JSONObject tableResultGet(String requestId, HashMap options) { + AipRequest request = new AipRequest(); + this.preOperation(request); + request.addBody("request_id", requestId); + if (options != null) { + request.addBody(options); + } + + request.setUri("https://aip.baidubce.com/rest/2.0/solution/v1/form_ocr/get_request_result"); + this.postOperation(request); + return this.requestServer(request); + } + + public JSONObject vinCode(byte[] image, HashMap options) { + AipRequest request = new AipRequest(); + this.preOperation(request); + String base64Content = Base64Util.encode(image); + request.addBody("image", base64Content); + if (options != null) { + request.addBody(options); + } + + request.setUri("https://aip.baidubce.com/rest/2.0/ocr/v1/vin_code"); + this.postOperation(request); + return this.requestServer(request); + } + + public JSONObject vinCode(String image, EImgType type, HashMap options) { + return this.ocrByUrlOrFile(image, type, "https://aip.baidubce.com/rest/2.0/ocr/v1/vin_code", options); + } + + public JSONObject quotaInvoice(byte[] image, HashMap options) { + AipRequest request = new AipRequest(); + this.preOperation(request); + String base64Content = Base64Util.encode(image); + request.addBody("image", base64Content); + if (options != null) { + request.addBody(options); + } + + request.setUri("https://aip.baidubce.com/rest/2.0/ocr/v1/quota_invoice"); + this.postOperation(request); + return this.requestServer(request); + } + + public JSONObject quotaInvoice(String image, HashMap options) { + try { + byte[] data = Util.readFileByBytes(image); + return this.quotaInvoice(data, options); + } catch (IOException var4) { + var4.printStackTrace(); + return AipError.IMAGE_READ_ERROR.toJsonResult(); + } + } + + public JSONObject householdRegister(byte[] image, HashMap options) { + AipRequest request = new AipRequest(); + this.preOperation(request); + String base64Content = Base64Util.encode(image); + request.addBody("image", base64Content); + if (options != null) { + request.addBody(options); + } + + request.setUri("https://aip.baidubce.com/rest/2.0/ocr/v1/household_register"); + this.postOperation(request); + return this.requestServer(request); + } + + public JSONObject householdRegister(String image, HashMap options) { + try { + byte[] data = Util.readFileByBytes(image); + return this.householdRegister(data, options); + } catch (IOException var4) { + var4.printStackTrace(); + return AipError.IMAGE_READ_ERROR.toJsonResult(); + } + } + + public JSONObject HKMacauExitentrypermit(byte[] image, HashMap options) { + AipRequest request = new AipRequest(); + this.preOperation(request); + String base64Content = Base64Util.encode(image); + request.addBody("image", base64Content); + if (options != null) { + request.addBody(options); + } + + request.setUri("https://aip.baidubce.com/rest/2.0/ocr/v1/HK_Macau_exitentrypermit"); + this.postOperation(request); + return this.requestServer(request); + } + + public JSONObject HKMacauExitentrypermit(String image, HashMap options) { + try { + byte[] data = Util.readFileByBytes(image); + return this.HKMacauExitentrypermit(data, options); + } catch (IOException var4) { + var4.printStackTrace(); + return AipError.IMAGE_READ_ERROR.toJsonResult(); + } + } + + public JSONObject taiwanExitentrypermit(byte[] image, HashMap options) { + AipRequest request = new AipRequest(); + this.preOperation(request); + String base64Content = Base64Util.encode(image); + request.addBody("image", base64Content); + if (options != null) { + request.addBody(options); + } + + request.setUri("https://aip.baidubce.com/rest/2.0/ocr/v1/taiwan_exitentrypermit"); + this.postOperation(request); + return this.requestServer(request); + } + + public JSONObject taiwanExitentrypermit(String image, HashMap options) { + try { + byte[] data = Util.readFileByBytes(image); + return this.taiwanExitentrypermit(data, options); + } catch (IOException var4) { + var4.printStackTrace(); + return AipError.IMAGE_READ_ERROR.toJsonResult(); + } + } + + public JSONObject birthCertificate(byte[] image, HashMap options) { + AipRequest request = new AipRequest(); + this.preOperation(request); + String base64Content = Base64Util.encode(image); + request.addBody("image", base64Content); + if (options != null) { + request.addBody(options); + } + + request.setUri("https://aip.baidubce.com/rest/2.0/ocr/v1/birth_certificate"); + this.postOperation(request); + return this.requestServer(request); + } + + public JSONObject birthCertificate(String image, HashMap options) { + try { + byte[] data = Util.readFileByBytes(image); + return this.birthCertificate(data, options); + } catch (IOException var4) { + var4.printStackTrace(); + return AipError.IMAGE_READ_ERROR.toJsonResult(); + } + } + + public JSONObject vehicleInvoice(byte[] image, HashMap options) { + AipRequest request = new AipRequest(); + this.preOperation(request); + String base64Content = Base64Util.encode(image); + request.addBody("image", base64Content); + if (options != null) { + request.addBody(options); + } + + request.setUri("https://aip.baidubce.com/rest/2.0/ocr/v1/vehicle_invoice"); + this.postOperation(request); + return this.requestServer(request); + } + + public JSONObject vehicleInvoice(String image, HashMap options) { + try { + byte[] data = Util.readFileByBytes(image); + return this.vehicleInvoice(data, options); + } catch (IOException var4) { + var4.printStackTrace(); + return AipError.IMAGE_READ_ERROR.toJsonResult(); + } + } + + public JSONObject vehicleCertificate(byte[] image, HashMap options) { + AipRequest request = new AipRequest(); + this.preOperation(request); + String base64Content = Base64Util.encode(image); + request.addBody("image", base64Content); + if (options != null) { + request.addBody(options); + } + + request.setUri("https://aip.baidubce.com/rest/2.0/ocr/v1/vehicle_certificate"); + this.postOperation(request); + return this.requestServer(request); + } + + public JSONObject vehicleCertificate(String image, HashMap options) { + try { + byte[] data = Util.readFileByBytes(image); + return this.vehicleCertificate(data, options); + } catch (IOException var4) { + var4.printStackTrace(); + return AipError.IMAGE_READ_ERROR.toJsonResult(); + } + } + + public JSONObject invoice(byte[] image, HashMap options) { + AipRequest request = new AipRequest(); + this.preOperation(request); + String base64Content = Base64Util.encode(image); + request.addBody("image", base64Content); + if (options != null) { + request.addBody(options); + } + + request.setUri("https://aip.baidubce.com/rest/2.0/ocr/v1/invoice"); + this.postOperation(request); + return this.requestServer(request); + } + + public JSONObject invoice(String image, HashMap options) { + try { + byte[] data = Util.readFileByBytes(image); + return this.invoice(data, options); + } catch (IOException var4) { + var4.printStackTrace(); + return AipError.IMAGE_READ_ERROR.toJsonResult(); + } + } + + public JSONObject airTicket(byte[] image, HashMap options) { + AipRequest request = new AipRequest(); + this.preOperation(request); + String base64Content = Base64Util.encode(image); + request.addBody("image", base64Content); + if (options != null) { + request.addBody(options); + } + + request.setUri("https://aip.baidubce.com/rest/2.0/ocr/v1/air_ticket"); + this.postOperation(request); + return this.requestServer(request); + } + + public JSONObject airTicket(String image, HashMap options) { + try { + byte[] data = Util.readFileByBytes(image); + return this.airTicket(data, options); + } catch (IOException var4) { + var4.printStackTrace(); + return AipError.IMAGE_READ_ERROR.toJsonResult(); + } + } + + public JSONObject insuranceDocuments(byte[] image, HashMap options) { + AipRequest request = new AipRequest(); + this.preOperation(request); + String base64Content = Base64Util.encode(image); + request.addBody("image", base64Content); + if (options != null) { + request.addBody(options); + } + + request.setUri("https://aip.baidubce.com/rest/2.0/ocr/v1/insurance_documents"); + this.postOperation(request); + return this.requestServer(request); + } + + public JSONObject insuranceDocuments(String image, HashMap options) { + try { + byte[] data = Util.readFileByBytes(image); + return this.insuranceDocuments(data, options); + } catch (IOException var4) { + var4.printStackTrace(); + return AipError.IMAGE_READ_ERROR.toJsonResult(); + } + } + + public JSONObject vatInvoice(String image, EImgType type, HashMap options) { + if (type == EImgType.PDF) { + AipRequest request = new AipRequest(); + this.preOperation(request); + if (options != null) { + request.addBody(options); + } + + try { + byte[] data = Util.readFileByBytes(image); + String base64Content = Base64Util.encode(data); + request.addBody("pdf_file", base64Content); + } catch (IOException var7) { + var7.printStackTrace(); + } + + request.setUri("https://aip.baidubce.com/rest/2.0/ocr/v1/vat_invoice"); + this.postOperation(request); + return this.requestServer(request); + } else { + return this.ocrByUrlOrFile(image, type, "https://aip.baidubce.com/rest/2.0/ocr/v1/vat_invoice", options); + } + } + + public JSONObject vatInvoice(byte[] image, HashMap options) { + AipRequest request = new AipRequest(); + this.preOperation(request); + String base64Content = Base64Util.encode(image); + request.addBody("image", base64Content); + if (options != null) { + request.addBody(options); + } + + request.setUri("https://aip.baidubce.com/rest/2.0/ocr/v1/vat_invoice"); + this.postOperation(request); + return this.requestServer(request); + } + + public JSONObject vatInvoice(String image, HashMap options) { + try { + byte[] data = Util.readFileByBytes(image); + return this.vatInvoice(data, options); + } catch (IOException var4) { + var4.printStackTrace(); + return AipError.IMAGE_READ_ERROR.toJsonResult(); + } + } + + public JSONObject qrcode(byte[] image, HashMap options) { + AipRequest request = new AipRequest(); + this.preOperation(request); + String base64Content = Base64Util.encode(image); + request.addBody("image", base64Content); + if (options != null) { + request.addBody(options); + } + + request.setUri("https://aip.baidubce.com/rest/2.0/ocr/v1/qrcode"); + this.postOperation(request); + return this.requestServer(request); + } + + public JSONObject qrcode(String image, HashMap options) { + try { + byte[] data = Util.readFileByBytes(image); + return this.qrcode(data, options); + } catch (IOException var4) { + var4.printStackTrace(); + return AipError.IMAGE_READ_ERROR.toJsonResult(); + } + } + + public JSONObject numbers(byte[] image, HashMap options) { + AipRequest request = new AipRequest(); + this.preOperation(request); + String base64Content = Base64Util.encode(image); + request.addBody("image", base64Content); + if (options != null) { + request.addBody(options); + } + + request.setUri("https://aip.baidubce.com/rest/2.0/ocr/v1/numbers"); + this.postOperation(request); + return this.requestServer(request); + } + + public JSONObject numbers(String image, HashMap options) { + try { + byte[] data = Util.readFileByBytes(image); + return this.numbers(data, options); + } catch (IOException var4) { + var4.printStackTrace(); + return AipError.IMAGE_READ_ERROR.toJsonResult(); + } + } + + public JSONObject lottery(byte[] image, HashMap options) { + AipRequest request = new AipRequest(); + this.preOperation(request); + String base64Content = Base64Util.encode(image); + request.addBody("image", base64Content); + if (options != null) { + request.addBody(options); + } + + request.setUri("https://aip.baidubce.com/rest/2.0/ocr/v1/lottery"); + this.postOperation(request); + return this.requestServer(request); + } + + public JSONObject lottery(String image, HashMap options) { + try { + byte[] data = Util.readFileByBytes(image); + return this.lottery(data, options); + } catch (IOException var4) { + var4.printStackTrace(); + return AipError.IMAGE_READ_ERROR.toJsonResult(); + } + } + + public JSONObject passport(byte[] image, HashMap options) { + AipRequest request = new AipRequest(); + this.preOperation(request); + String base64Content = Base64Util.encode(image); + request.addBody("image", base64Content); + if (options != null) { + request.addBody(options); + } + + request.setUri("https://aip.baidubce.com/rest/2.0/ocr/v1/passport"); + this.postOperation(request); + return this.requestServer(request); + } + + public JSONObject passport(String image, HashMap options) { + try { + byte[] data = Util.readFileByBytes(image); + return this.passport(data, options); + } catch (IOException var4) { + var4.printStackTrace(); + return AipError.IMAGE_READ_ERROR.toJsonResult(); + } + } + + public JSONObject businessCard(byte[] image, HashMap options) { + AipRequest request = new AipRequest(); + this.preOperation(request); + String base64Content = Base64Util.encode(image); + request.addBody("image", base64Content); + if (options != null) { + request.addBody(options); + } + + request.setUri("https://aip.baidubce.com/rest/2.0/ocr/v1/business_card"); + this.postOperation(request); + return this.requestServer(request); + } + + public JSONObject businessCard(String image, HashMap options) { + try { + byte[] data = Util.readFileByBytes(image); + return this.businessCard(data, options); + } catch (IOException var4) { + var4.printStackTrace(); + return AipError.IMAGE_READ_ERROR.toJsonResult(); + } + } + + public JSONObject handwriting(byte[] image, HashMap options) { + AipRequest request = new AipRequest(); + this.preOperation(request); + String base64Content = Base64Util.encode(image); + request.addBody("image", base64Content); + if (options != null) { + request.addBody(options); + } + + request.setUri("https://aip.baidubce.com/rest/2.0/ocr/v1/handwriting"); + this.postOperation(request); + return this.requestServer(request); + } + + public JSONObject handwriting(String image, HashMap options) { + try { + byte[] data = Util.readFileByBytes(image); + return this.handwriting(data, options); + } catch (IOException var4) { + var4.printStackTrace(); + return AipError.IMAGE_READ_ERROR.toJsonResult(); + } + } + + public JSONObject custom(byte[] image, HashMap options) { + AipRequest request = new AipRequest(); + this.preOperation(request); + String base64Content = Base64Util.encode(image); + request.addBody("image", base64Content); + if (options != null) { + request.addBody(options); + } + + request.setUri("https://aip.baidubce.com/rest/2.0/solution/v1/iocr/recognise"); + this.postOperation(request); + return this.requestServer(request); + } + + public JSONObject custom(String image, HashMap options) { + try { + byte[] data = Util.readFileByBytes(image); + return this.custom(data, options); + } catch (IOException var4) { + var4.printStackTrace(); + return AipError.IMAGE_READ_ERROR.toJsonResult(); + } + } + + public JSONObject getTableRecognitionJsonResult(String requestId) { + return this.getTableResultHelper(requestId, "json"); + } + + public JSONObject getTableRecognitionExcelResult(String requestId) { + return this.getTableResultHelper(requestId, "excel"); + } + + private JSONObject getTableResultHelper(String requestId, String resultType) { + AipRequest request = new AipRequest(); + this.preOperation(request); + request.addBody("request_id", requestId); + request.addBody("result_type", resultType); + request.setUri("https://aip.baidubce.com/rest/2.0/solution/v1/form_ocr/get_request_result"); + this.postOperation(request); + return this.requestServer(request); + } + + public JSONObject tableRecognizeToJson(String imgPath, long timeoutMiliseconds) { + try { + byte[] imgData = Util.readFileByBytes(imgPath); + return this.tableRecognizeToJson(imgData, timeoutMiliseconds); + } catch (IOException var5) { + var5.printStackTrace(); + return AipError.IMAGE_READ_ERROR.toJsonResult(); + } + } + + public JSONObject tableRecognizeToJson(byte[] imgData, long timeoutMiliseconds) { + return this.tableRecSyncHelper(imgData, timeoutMiliseconds, "json"); + } + + public JSONObject tableRecognizeToExcelUrl(String imgPath, long timeoutMiliseconds) { + try { + byte[] imgData = Util.readFileByBytes(imgPath); + return this.tableRecognizeToExcelUrl(imgData, timeoutMiliseconds); + } catch (IOException var5) { + var5.printStackTrace(); + return AipError.IMAGE_READ_ERROR.toJsonResult(); + } + } + + public JSONObject tableRecognizeToExcelUrl(byte[] imgData, long timeoutMiliseconds) { + return this.tableRecSyncHelper(imgData, timeoutMiliseconds, "excel"); + } + + private JSONObject tableRecSyncHelper(byte[] imgData, long timeout, String resultType) { + JSONObject res = this.tableRecognitionAsync((byte[])imgData, (HashMap)null); + if (res.has("error_code")) { + return res; + } else { + String reqId = res.getJSONArray("result").getJSONObject(0).getString("request_id"); + long start = Calendar.getInstance().getTimeInMillis(); + long sleepInterval = 2000L; + + while(true) { + long now = Calendar.getInstance().getTimeInMillis(); + if (now - start > timeout) { + return AipError.ASYNC_TIMEOUT_ERROR.toJsonResult(); + } + + JSONObject result = this.getTableResultHelper(reqId, resultType); + if (result.has("error_code")) { + return result; + } + + int retCode = result.getJSONObject("result").getInt("ret_code"); + if (retCode == 3) { + return result; + } + + try { + Thread.sleep(sleepInterval); + } catch (InterruptedException var16) { + var16.printStackTrace(); + } + } + } + } + + public JSONObject docAnalysis(String image, HashMap options) { + try { + byte[] data = Util.readFileByBytes(image); + return this.docAnalysis(data, options); + } catch (IOException var4) { + var4.printStackTrace(); + return AipError.IMAGE_READ_ERROR.toJsonResult(); + } + } + + public JSONObject docAnalysis(byte[] image, HashMap options) { + AipRequest request = new AipRequest(); + this.preOperation(request); + String base64Content = Base64Util.encode(image); + request.addBody("image", base64Content); + if (options != null) { + request.addBody(options); + } + + request.setUri("https://aip.baidubce.com/rest/2.0/ocr/v1/doc_analysis"); + this.postOperation(request); + return this.requestServer(request); + } + + public JSONObject meter(String image, HashMap options) { + try { + byte[] data = Util.readFileByBytes(image); + return this.meter(data, options); + } catch (IOException var4) { + var4.printStackTrace(); + return AipError.IMAGE_READ_ERROR.toJsonResult(); + } + } + + public JSONObject meter(byte[] image, HashMap options) { + AipRequest request = new AipRequest(); + this.preOperation(request); + String base64Content = Base64Util.encode(image); + request.addBody("image", base64Content); + if (options != null) { + request.addBody(options); + } + + request.setUri("https://aip.baidubce.com/rest/2.0/ocr/v1/meter"); + this.postOperation(request); + return this.requestServer(request); + } + + public JSONObject webimageLoc(String image, HashMap options) { + try { + byte[] data = Util.readFileByBytes(image); + return this.webimageLoc(data, options); + } catch (IOException var4) { + var4.printStackTrace(); + return AipError.IMAGE_READ_ERROR.toJsonResult(); + } + } + + public JSONObject webimageLoc(byte[] image, HashMap options) { + AipRequest request = new AipRequest(); + this.preOperation(request); + String base64Content = Base64Util.encode(image); + request.addBody("image", base64Content); + if (options != null) { + request.addBody(options); + } + + request.setUri("https://aip.baidubce.com/rest/2.0/ocr/v1/webimage_loc"); + this.postOperation(request); + return this.requestServer(request); + } + + private JSONObject ocrByUrlOrFile(String image, EImgType type, String targetUrl, HashMap options) { + return type == EImgType.FILE ? this.ocrByFile(image, targetUrl, options) : this.ocrByUrl(image, targetUrl, options); + } + + private JSONObject ocrByUrl(String imageUrl, String targetUrl, HashMap options) { + AipRequest request = new AipRequest(); + this.preOperation(request); + request.addBody("url", imageUrl); + if (options != null) { + request.addBody(options); + } + + request.setUri(targetUrl); + this.postOperation(request); + return this.requestServer(request); + } + + private JSONObject ocrByFile(String image, String targetUrl, HashMap options) { + AipRequest request = new AipRequest(); + this.preOperation(request); + + try { + byte[] data = Util.readFileByBytes(image); + String base64Content = Base64Util.encode(data); + request.addBody("image", base64Content); + } catch (IOException var7) { + var7.printStackTrace(); + return AipError.IMAGE_READ_ERROR.toJsonResult(); + } + + if (options != null) { + request.addBody(options); + } + + request.setUri(targetUrl); + this.postOperation(request); + return this.requestServer(request); + } + + public JSONObject qrcodeUrl(String url, HashMap options) { + AipRequest request = new AipRequest(); + this.preOperation(request); + request.addBody("url", url); + if (options != null) { + request.addBody(options); + } + + request.setUri("https://aip.baidubce.com/rest/2.0/ocr/v1/qrcode"); + this.postOperation(request); + return this.requestServer(request); + } + + public JSONObject docAnalysisUrl(String url, HashMap options) { + AipRequest request = new AipRequest(); + this.preOperation(request); + request.addBody("url", url); + if (options != null) { + request.addBody(options); + } + + request.setUri("https://aip.baidubce.com/rest/2.0/ocr/v1/doc_analysis"); + this.postOperation(request); + return this.requestServer(request); + } + + public JSONObject vehicleInvoiceUrl(String url, HashMap options) { + AipRequest request = new AipRequest(); + this.preOperation(request); + request.addBody("url", url); + if (options != null) { + request.addBody(options); + } + + request.setUri("https://aip.baidubce.com/rest/2.0/ocr/v1/vehicle_invoice"); + this.postOperation(request); + return this.requestServer(request); + } + + public JSONObject vehicleCertificateUrl(String url, HashMap options) { + AipRequest request = new AipRequest(); + this.preOperation(request); + request.addBody("url", url); + if (options != null) { + request.addBody(options); + } + + request.setUri("https://aip.baidubce.com/rest/2.0/ocr/v1/vehicle_certificate"); + this.postOperation(request); + return this.requestServer(request); + } + + public JSONObject householdRegisterUrl(String url, HashMap options) { + AipRequest request = new AipRequest(); + this.preOperation(request); + request.addBody("url", url); + if (options != null) { + request.addBody(options); + } + + request.setUri("https://aip.baidubce.com/rest/2.0/ocr/v1/household_register"); + this.postOperation(request); + return this.requestServer(request); + } + + public JSONObject handwritingUrl(String url, HashMap options) { + AipRequest request = new AipRequest(); + this.preOperation(request); + request.addBody("url", url); + if (options != null) { + request.addBody(options); + } + + request.setUri("https://aip.baidubce.com/rest/2.0/ocr/v1/handwriting"); + this.postOperation(request); + return this.requestServer(request); + } + + public JSONObject airTicketUrl(String url, HashMap options) { + AipRequest request = new AipRequest(); + this.preOperation(request); + request.addBody("url", url); + if (options != null) { + request.addBody(options); + } + + request.setUri("https://aip.baidubce.com/rest/2.0/ocr/v1/air_ticket"); + this.postOperation(request); + return this.requestServer(request); + } + + public JSONObject invoiceUrl(String url, HashMap options) { + AipRequest request = new AipRequest(); + this.preOperation(request); + request.addBody("url", url); + if (options != null) { + request.addBody(options); + } + + request.setUri("https://aip.baidubce.com/rest/2.0/ocr/v1/invoice"); + this.postOperation(request); + return this.requestServer(request); + } + + public JSONObject passportUrl(String url, HashMap options) { + AipRequest request = new AipRequest(); + this.preOperation(request); + request.addBody("url", url); + if (options != null) { + request.addBody(options); + } + + request.setUri("https://aip.baidubce.com/rest/2.0/ocr/v1/passport"); + this.postOperation(request); + return this.requestServer(request); + } + + public JSONObject onlineTaxiItinerary(byte[] image) { + AipRequest request = new AipRequest(); + this.preOperation(request); + String base64Content = Base64Util.encode(image); + request.addBody("image", base64Content); + request.setUri("https://aip.baidubce.com/rest/2.0/ocr/v1/online_taxi_itinerary"); + this.postOperation(request); + return this.requestServer(request); + } + + public JSONObject onlineTaxiItineraryUrl(String url) { + AipRequest request = new AipRequest(); + this.preOperation(request); + request.addBody("url", url); + request.setUri("https://aip.baidubce.com/rest/2.0/ocr/v1/online_taxi_itinerary"); + this.postOperation(request); + return this.requestServer(request); + } + + public JSONObject onlineTaxiItineraryPdf(byte[] pdfFile, HashMap options) { + AipRequest request = new AipRequest(); + this.preOperation(request); + String base64Content = Base64Util.encode(pdfFile); + request.addBody("pdf_file", base64Content); + if (options != null) { + request.addBody(options); + } + + request.setUri("https://aip.baidubce.com/rest/2.0/ocr/v1/online_taxi_itinerary"); + this.postOperation(request); + return this.requestServer(request); + } + + public JSONObject weightNote(byte[] image, HashMap options) { + AipRequest request = new AipRequest(); + this.preOperation(request); + String base64Content = Base64Util.encode(image); + request.addBody("image", base64Content); + if (options != null) { + request.addBody(options); + } + + request.setUri("https://aip.baidubce.com/rest/2.0/ocr/v1/weight_note"); + this.postOperation(request); + return this.requestServer(request); + } + + public JSONObject weightNoteUrl(String url, HashMap options) { + AipRequest request = new AipRequest(); + this.preOperation(request); + request.addBody("url", url); + if (options != null) { + request.addBody(options); + } + + request.setUri("https://aip.baidubce.com/rest/2.0/ocr/v1/weight_note"); + this.postOperation(request); + return this.requestServer(request); + } + + public JSONObject weightNotePdf(byte[] pdfFile, HashMap options) { + AipRequest request = new AipRequest(); + this.preOperation(request); + String base64Content = Base64Util.encode(pdfFile); + request.addBody("pdf_file", base64Content); + if (options != null) { + request.addBody(options); + } + + request.setUri("https://aip.baidubce.com/rest/2.0/ocr/v1/weight_note"); + this.postOperation(request); + return this.requestServer(request); + } + + public JSONObject medicalDetail(byte[] image, HashMap options) { + AipRequest request = new AipRequest(); + this.preOperation(request); + String base64Content = Base64Util.encode(image); + request.addBody("image", base64Content); + if (options != null) { + request.addBody(options); + } + + request.setUri("https://aip.baidubce.com/rest/2.0/ocr/v1/medical_detail"); + this.postOperation(request); + return this.requestServer(request); + } + + public JSONObject medicalDetailUrl(String url, HashMap options) { + AipRequest request = new AipRequest(); + this.preOperation(request); + request.addBody("url", url); + if (options != null) { + request.addBody(options); + } + + request.setUri("https://aip.baidubce.com/rest/2.0/ocr/v1/medical_detail"); + this.postOperation(request); + return this.requestServer(request); + } + + public JSONObject docAnalysisOffice(String image, HashMap options) { + try { + byte[] data = Util.readFileByBytes(image); + return this.docAnalysisOffice(data, options); + } catch (IOException var4) { + var4.printStackTrace(); + return AipError.IMAGE_READ_ERROR.toJsonResult(); + } + } + + public JSONObject docAnalysisOffice(byte[] image, HashMap options) { + AipRequest request = new AipRequest(); + this.preOperation(request); + String base64Content = Base64Util.encode(image); + request.addBody("image", base64Content); + if (options != null) { + request.addBody(options); + } + + request.setUri("https://aip.baidubce.com/rest/2.0/ocr/v1/doc_analysis_office"); + this.postOperation(request); + return this.requestServer(request); + } + + public JSONObject docAnalysisOfficeUrl(String url, HashMap options) { + AipRequest request = new AipRequest(); + this.preOperation(request); + request.addBody("url", url); + if (options != null) { + request.addBody(options); + } + + request.setUri("https://aip.baidubce.com/rest/2.0/ocr/v1/doc_analysis_office"); + this.postOperation(request); + return this.requestServer(request); + } + + public JSONObject docAnalysisOfficePdf(String pdf, int pdfFileNum, HashMap options) { + try { + byte[] data = Util.readFileByBytes(pdf); + return this.docAnalysisOfficePdf(data, pdfFileNum, options); + } catch (IOException var5) { + var5.printStackTrace(); + return AipError.IMAGE_READ_ERROR.toJsonResult(); + } + } + + public JSONObject docAnalysisOfficePdf(byte[] pdf, int pdfFileNum, HashMap options) { + AipRequest request = new AipRequest(); + this.preOperation(request); + String base64Content = Base64Util.encode(pdf); + request.addBody("pdf_file", base64Content); + request.addBody("pdf_file_num", pdfFileNum); + if (options != null) { + request.addBody(options); + } + + request.setUri("https://aip.baidubce.com/rest/2.0/ocr/v1/doc_analysis_office"); + this.postOperation(request); + return this.requestServer(request); + } + + public JSONObject seal(String image) { + try { + byte[] data = Util.readFileByBytes(image); + return this.seal(data); + } catch (IOException var3) { + var3.printStackTrace(); + return AipError.IMAGE_READ_ERROR.toJsonResult(); + } + } + + public JSONObject seal(byte[] image) { + AipRequest request = new AipRequest(); + this.preOperation(request); + String base64Content = Base64Util.encode(image); + request.addBody("image", base64Content); + request.setUri("https://aip.baidubce.com/rest/2.0/ocr/v1/seal"); + this.postOperation(request); + return this.requestServer(request); + } + + public JSONObject sealUrl(String url) { + AipRequest request = new AipRequest(); + this.preOperation(request); + request.addBody("url", url); + request.setUri("https://aip.baidubce.com/rest/2.0/ocr/v1/seal"); + this.postOperation(request); + return this.requestServer(request); + } + + public JSONObject sealPdf(String pdf, int pdfFileNum) { + try { + byte[] data = Util.readFileByBytes(pdf); + return this.sealPdf(data, pdfFileNum); + } catch (IOException var4) { + var4.printStackTrace(); + return AipError.IMAGE_READ_ERROR.toJsonResult(); + } + } + + public JSONObject sealPdf(byte[] pdf, int pdfFileNum) { + AipRequest request = new AipRequest(); + this.preOperation(request); + String base64Content = Base64Util.encode(pdf); + request.addBody("pdf_file", base64Content); + request.addBody("pdf_file_num", pdfFileNum); + request.setUri("https://aip.baidubce.com/rest/2.0/ocr/v1/seal"); + this.postOperation(request); + return this.requestServer(request); + } + + public JSONObject multiIdcard(String image, HashMap options) { + try { + byte[] data = Util.readFileByBytes(image); + return this.multiIdcard(data, options); + } catch (IOException var4) { + var4.printStackTrace(); + return AipError.IMAGE_READ_ERROR.toJsonResult(); + } + } + + public JSONObject multiIdcard(byte[] image, HashMap options) { + AipRequest request = new AipRequest(); + this.preOperation(request); + String base64Content = Base64Util.encode(image); + request.addBody("image", base64Content); + if (options != null) { + request.addBody(options); + } + + request.setUri("https://aip.baidubce.com/rest/2.0/ocr/v1/multi_idcard"); + this.postOperation(request); + return this.requestServer(request); + } + + public JSONObject multiIdcardUrl(String url, HashMap options) { + AipRequest request = new AipRequest(); + this.preOperation(request); + request.addBody("url", url); + if (options != null) { + request.addBody(options); + } + + request.setUri("https://aip.baidubce.com/rest/2.0/ocr/v1/multi_idcard"); + this.postOperation(request); + return this.requestServer(request); + } + + public JSONObject mixedMultiVehicle(String image, HashMap options) { + try { + byte[] data = Util.readFileByBytes(image); + return this.mixedMultiVehicle(data, options); + } catch (IOException var4) { + var4.printStackTrace(); + return AipError.IMAGE_READ_ERROR.toJsonResult(); + } + } + + public JSONObject mixedMultiVehicle(byte[] image, HashMap options) { + AipRequest request = new AipRequest(); + this.preOperation(request); + String base64Content = Base64Util.encode(image); + request.addBody("image", base64Content); + if (options != null) { + request.addBody(options); + } + + request.setUri("https://aip.baidubce.com/rest/2.0/ocr/v1/mixed_multi_vehicle"); + this.postOperation(request); + return this.requestServer(request); + } + + public JSONObject mixedMultiVehicleUrl(String url, HashMap options) { + AipRequest request = new AipRequest(); + this.preOperation(request); + request.addBody("url", url); + if (options != null) { + request.addBody(options); + } + + request.setUri("https://aip.baidubce.com/rest/2.0/ocr/v1/mixed_multi_vehicle"); + this.postOperation(request); + return this.requestServer(request); + } + + public JSONObject vehicleRegistrationCertificate(String image) { + try { + byte[] data = Util.readFileByBytes(image); + return this.vehicleRegistrationCertificate(data); + } catch (IOException var3) { + var3.printStackTrace(); + return AipError.IMAGE_READ_ERROR.toJsonResult(); + } + } + + public JSONObject vehicleRegistrationCertificate(byte[] image) { + AipRequest request = new AipRequest(); + this.preOperation(request); + String base64Content = Base64Util.encode(image); + request.addBody("image", base64Content); + request.setUri("https://aip.baidubce.com/rest/2.0/ocr/v1/vehicle_registration_certificate"); + this.postOperation(request); + return this.requestServer(request); + } + + public JSONObject vehicleRegistrationCertificateUrl(String url) { + AipRequest request = new AipRequest(); + this.preOperation(request); + request.addBody("url", url); + request.setUri("https://aip.baidubce.com/rest/2.0/ocr/v1/vehicle_registration_certificate"); + this.postOperation(request); + return this.requestServer(request); + } + + public JSONObject multipleInvoice(String image, HashMap options) { + try { + byte[] data = Util.readFileByBytes(image); + return this.multipleInvoice(data, options); + } catch (IOException var4) { + var4.printStackTrace(); + return AipError.IMAGE_READ_ERROR.toJsonResult(); + } + } + + public JSONObject multipleInvoice(byte[] image, HashMap options) { + AipRequest request = new AipRequest(); + this.preOperation(request); + String base64Content = Base64Util.encode(image); + request.addBody("image", base64Content); + if (options != null) { + request.addBody(options); + } + + request.setUri("https://aip.baidubce.com/rest/2.0/ocr/v1/multiple_invoice"); + this.postOperation(request); + return this.requestServer(request); + } + + public JSONObject multipleInvoiceUrl(String url, HashMap options) { + AipRequest request = new AipRequest(); + this.preOperation(request); + request.addBody("url", url); + if (options != null) { + request.addBody(options); + } + + request.setUri("https://aip.baidubce.com/rest/2.0/ocr/v1/multiple_invoice"); + this.postOperation(request); + return this.requestServer(request); + } + + public JSONObject multipleInvoicePdf(String pdf, int pdfFileNum, HashMap options) { + try { + byte[] data = Util.readFileByBytes(pdf); + return this.multipleInvoicePdf(data, pdfFileNum, options); + } catch (IOException var5) { + var5.printStackTrace(); + return AipError.IMAGE_READ_ERROR.toJsonResult(); + } + } + + public JSONObject multipleInvoicePdf(byte[] pdf, int pdfFileNum, HashMap options) { + AipRequest request = new AipRequest(); + this.preOperation(request); + String base64Content = Base64Util.encode(pdf); + request.addBody("pdf_file", base64Content); + request.addBody("pdf_file_num", pdfFileNum); + if (options != null) { + request.addBody(options); + } + + request.setUri("https://aip.baidubce.com/rest/2.0/ocr/v1/multiple_invoice"); + this.postOperation(request); + return this.requestServer(request); + } + + public JSONObject vatInvoiceVerification(String invoiceCode, String invoiceNum, String invoiceDate, String invoiceType, String checkCode, String totalAmount) { + AipRequest request = new AipRequest(); + this.preOperation(request); + request.addBody("invoice_code", invoiceCode); + request.addBody("invoice_num", invoiceNum); + request.addBody("invoice_date", invoiceDate); + request.addBody("invoice_type", invoiceType); + request.addBody("check_code", checkCode); + request.addBody("total_amount", totalAmount); + request.setUri("https://aip.baidubce.com/rest/2.0/ocr/v1/vat_invoice_verification"); + this.postOperation(request); + return this.requestServer(request); + } + + public JSONObject busTicket(String image) { + try { + byte[] data = Util.readFileByBytes(image); + return this.busTicket(data); + } catch (IOException var3) { + var3.printStackTrace(); + return AipError.IMAGE_READ_ERROR.toJsonResult(); + } + } + + public JSONObject busTicket(byte[] image) { + AipRequest request = new AipRequest(); + this.preOperation(request); + String base64Content = Base64Util.encode(image); + request.addBody("image", base64Content); + request.setUri("https://aip.baidubce.com/rest/2.0/ocr/v1/bus_ticket"); + this.postOperation(request); + return this.requestServer(request); + } + + public JSONObject busTicketUrl(String url) { + AipRequest request = new AipRequest(); + this.preOperation(request); + request.addBody("url", url); + request.setUri("https://aip.baidubce.com/rest/2.0/ocr/v1/bus_ticket"); + this.postOperation(request); + return this.requestServer(request); + } + + public JSONObject medicalInvoice(String image, HashMap options) { + try { + byte[] data = Util.readFileByBytes(image); + return this.medicalInvoice(data, options); + } catch (IOException var4) { + var4.printStackTrace(); + return AipError.IMAGE_READ_ERROR.toJsonResult(); + } + } + + public JSONObject medicalInvoice(byte[] image, HashMap options) { + AipRequest request = new AipRequest(); + this.preOperation(request); + String base64Content = Base64Util.encode(image); + request.addBody("image", base64Content); + if (options != null) { + request.addBody(options); + } + + request.setUri("https://aip.baidubce.com/rest/2.0/ocr/v1/medical_invoice"); + this.postOperation(request); + return this.requestServer(request); + } + + public JSONObject medicalInvoiceUrl(String url, HashMap options) { + AipRequest request = new AipRequest(); + this.preOperation(request); + request.addBody("url", url); + if (options != null) { + request.addBody(options); + } + + request.setUri("https://aip.baidubce.com/rest/2.0/ocr/v1/medical_invoice"); + this.postOperation(request); + return this.requestServer(request); + } + + public JSONObject formula(String image, HashMap options) { + try { + byte[] data = Util.readFileByBytes(image); + return this.formula(data, options); + } catch (IOException var4) { + var4.printStackTrace(); + return AipError.IMAGE_READ_ERROR.toJsonResult(); + } + } + + public JSONObject formula(byte[] image, HashMap options) { + AipRequest request = new AipRequest(); + this.preOperation(request); + String base64Content = Base64Util.encode(image); + request.addBody("image", base64Content); + if (options != null) { + request.addBody(options); + } + + request.setUri("https://aip.baidubce.com/rest/2.0/ocr/v1/formula"); + this.postOperation(request); + return this.requestServer(request); + } + + public JSONObject formulaUrl(String url, HashMap options) { + AipRequest request = new AipRequest(); + this.preOperation(request); + request.addBody("url", url); + if (options != null) { + request.addBody(options); + } + + request.setUri("https://aip.baidubce.com/rest/2.0/ocr/v1/formula"); + this.postOperation(request); + return this.requestServer(request); + } + + public JSONObject travelCard(String image) { + try { + byte[] data = Util.readFileByBytes(image); + return this.travelCard(data); + } catch (IOException var3) { + var3.printStackTrace(); + return AipError.IMAGE_READ_ERROR.toJsonResult(); + } + } + + public JSONObject travelCard(byte[] image) { + AipRequest request = new AipRequest(); + this.preOperation(request); + String base64Content = Base64Util.encode(image); + request.addBody("image", base64Content); + request.setUri("https://aip.baidubce.com/rest/2.0/ocr/v1/travel_card"); + this.postOperation(request); + return this.requestServer(request); + } + + public JSONObject facade(String image) { + try { + byte[] data = Util.readFileByBytes(image); + return this.facade(data); + } catch (IOException var3) { + var3.printStackTrace(); + return AipError.IMAGE_READ_ERROR.toJsonResult(); + } + } + + public JSONObject facade(byte[] image) { + AipRequest request = new AipRequest(); + this.preOperation(request); + String base64Content = Base64Util.encode(image); + request.addBody("image", base64Content); + request.setUri("https://aip.baidubce.com/rest/2.0/ocr/v1/facade"); + this.postOperation(request); + return this.requestServer(request); + } + + public JSONObject healthCode(String image) { + try { + byte[] data = Util.readFileByBytes(image); + return this.healthCode(data); + } catch (IOException var3) { + var3.printStackTrace(); + return AipError.IMAGE_READ_ERROR.toJsonResult(); + } + } + + public JSONObject healthCode(byte[] image) { + AipRequest request = new AipRequest(); + this.preOperation(request); + String base64Content = Base64Util.encode(image); + request.addBody("image", base64Content); + request.setUri("https://aip.baidubce.com/rest/2.0/ocr/v1/health_code"); + this.postOperation(request); + return this.requestServer(request); + } + + public JSONObject covidTest(String image) { + try { + byte[] data = Util.readFileByBytes(image); + return this.covidTest(data); + } catch (IOException var3) { + var3.printStackTrace(); + return AipError.IMAGE_READ_ERROR.toJsonResult(); + } + } + + public JSONObject covidTest(byte[] image) { + AipRequest request = new AipRequest(); + this.preOperation(request); + String base64Content = Base64Util.encode(image); + request.addBody("image", base64Content); + request.setUri("https://aip.baidubce.com/rest/2.0/ocr/v1/covid_test"); + this.postOperation(request); + return this.requestServer(request); + } +} diff --git a/src/client/OCR_baidu/src/CovidTestRep.java b/src/client/OCR_baidu/src/CovidTestRep.java new file mode 100644 index 0000000..61e8a9e --- /dev/null +++ b/src/client/OCR_baidu/src/CovidTestRep.java @@ -0,0 +1,138 @@ +import com.baidu.aip.ocr.AipOcr; +import org.json.JSONObject; + +import java.util.HashMap; + +public class CovidTestRep { + private String Name; + private String Time; + private String Status; + public CovidTestRep() { + Name = ""; + Time = ""; + Status = ""; + } + + public String getName() { + return Name; + } + + public String getData() { + return Time; + } + + public String getStatus() { + return Status; + } + + public void setStatus(String status) { + Status = status; + } + + public void setName(String name) { + Name = name; + } + + public void setData(String data) { + Time = data; + } + + public void Print() { + System.out.println("Name:" + this.Name); + System.out.println("Data:" + this.Time); + System.out.println("Status:" + this.Status); + } + + + public static void main(String[] args) { + String path = "C:/Users//16491/eclipse-workspace/OCR_baidu/src/3.jpg";// 初始化一个AipOcr + ocr3(path); + } + public static String Judge(String path) { + CovidTestRep Ctr=new CovidTestRep(); + Ctr=ocr3(path); + String StatusNameTime=Ctr.Status+","+Ctr.Name+","+Ctr.Time; + return StatusNameTime; + } + public static CovidTestRep ocr3(String path) { + final String APP_ID = "28049220"; + final String API_KEY = "qyKlUy6xSapA89DTPomExteq"; + final String SECRET_KEY = "q5EYpXULVh5gC3firLU1nGaymwIwOMBd"; + AipOcr client = new AipOcr(APP_ID, API_KEY, SECRET_KEY); + + // 可选:设置网络连接参数 + client.setConnectionTimeoutInMillis(2000); + client.setSocketTimeoutInMillis(10000); + + // 可选:设置代理服务器地址, http和socket二选一,或者均不设置 + // client.setHttpProxy("proxy_host", proxy_port); // 设置http代理 + // client.setSocketProxy("proxy_host", proxy_port); // 设置socket代理 + + // 可选:设置log4j日志输出格式,若不设置,则使用默认配置 + // 也可以直接通过jvm启动参数设置此环境变量 + System.setProperty("aip.log4j.conf", "path/to/your/log4j.properties"); + + // 调用接口 + JSONObject res = client.basicGeneral(path, new HashMap()); + /*Map m=res.toMap(); + Set s=m.entrySet();*//* + + for (Object str : s) { + System.out.println(str); + } + //System.out.println(s);*/ + String str= res.toString(0); + /*for(int i=0;i='a'&&c<='z')||(c>='A'&&c<='Z')||c=='{'||c=='"'||c==':'||c=='}'||c==':'||c=='_'){ + continue; + } + else + s+=c; + if(c==']')break; + } + //System.out.println(s); + CovidTestRep CTR=new CovidTestRep(); + for(int i=0;i()); + String str= res.toString(0); + + int flag = 0; + int flag1 = 0; + int flag2 = 0; + HealthCode HC = new HealthCode(); + for (int i = 16; i < str.length(); i++) { + char c = str.charAt(i); + if (c == '[' && flag == 0) { + flag = 1; + } else if (flag == 1 && c == ']') { + break; + } else { + if (i == 27) { + String N = HC.getName(); + for (; str.charAt(i) != '\"'; i++) { + N = N + str.charAt(i); + + } + HC.setName(N); + } + + + if (str.charAt(i) == '-' && flag1 == 0) { + flag1 = 1; + String D = HC.getData(); + for (i = i - 4; str.charAt(i) != '\"'; i++) { + D = D + str.charAt(i); + } + HC.setData(D); + } + if (str.charAt(i) == '码' && flag2 == 0) { + flag2 = 1; + String S = HC.getStatus(); + S = S + str.charAt(i - 1); + HC.setStatus(S); + } + } + } + return HC; + } +} \ No newline at end of file diff --git a/src/client/OCR_baidu/src/META-INF/MANIFEST.MF b/src/client/OCR_baidu/src/META-INF/MANIFEST.MF new file mode 100644 index 0000000..a30bfa7 --- /dev/null +++ b/src/client/OCR_baidu/src/META-INF/MANIFEST.MF @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +Main-Class: HealthCode + diff --git a/src/client/OCR_baidu/src/TripCode.java b/src/client/OCR_baidu/src/TripCode.java new file mode 100644 index 0000000..6cd45a4 --- /dev/null +++ b/src/client/OCR_baidu/src/TripCode.java @@ -0,0 +1,146 @@ +import com.baidu.aip.ocr.AipOcr; +import org.json.JSONObject; + +import java.util.HashMap; +public class TripCode { + private String Status; + private String Telephone; + private String Time; + private String District; + + public TripCode() { + Status = ""; + Telephone = ""; + Time = ""; + District = ""; + } + + public void setStatus(String status) { + Status = status; + } + + public void setTelephone(String telephone) { + Telephone = telephone; + } + + public void setTime(String time) { + Time = time; + } + + public void setDistrict(String district) { + District = district; + } + + public String getTelephone() { + return Telephone; + } + + public String getStatus() { + return Status; + } + + public String getDistrict() { + return District; + } + + public String getTime() { + return Time; + } + + public void Print() { + System.out.println("Status:" + this.Status); + System.out.println("Telephone:" + this.Telephone); + System.out.println("Time:" + this.Time); + System.out.println("District:" + this.District); + } + + public static void main(String[] args) { + String path = "C:\\Users\\16491\\Desktop\\1.jpg"; + System.out.println(Judge(path)); + } + + /*}; + class OCR2 { + //设置APPID/AK/SK*/ + public static String Judge(String path) { + TripCode T = new TripCode(); + T = ocr2(path); + String InfM = T.Status + "," + T.Telephone + "," + T.Time + "," + T.District; + return InfM; + } + + public static TripCode ocr2(String path) { + final String APP_ID = "28049220"; + final String API_KEY = "qyKlUy6xSapA89DTPomExteq"; + final String SECRET_KEY = "q5EYpXULVh5gC3firLU1nGaymwIwOMBd"; + + + // 初始化一个AipOcr + AipOcr client = new AipOcr(APP_ID, API_KEY, SECRET_KEY); + + // 可选:设置网络连接参数 + client.setConnectionTimeoutInMillis(2000); + client.setSocketTimeoutInMillis(10000); + + // 可选:设置代理服务器地址, http和socket二选一,或者均不设置 + // client.setHttpProxy("proxy_host", proxy_port); // 设置http代理 + // client.setSocketProxy("proxy_host", proxy_port); // 设置socket代理 + + // 可选:设置log4j日志输出格式,若不设置,则使用默认配置 + // 也可以直接通过jvm启动参数设置此环境变量 + System.setProperty("aip.log4j.conf", "path/to/your/log4j.properties"); + + // 调用接口 + JSONObject res = client.basicGeneral(path, new HashMap()); + //System.out.println(res); + String str = res.toString(0); + //System.out.println(str); + String s = ""; + for (int i = 0; i < str.length(); i++) { + char c = str.charAt(i); + if ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || c == '{' || c == '"' || c == ':' || c == '}' || c == ':' || c == '_') { + continue; + } else + s += c; + if (c == ']') break; + } + //System.out.println(s); + TripCode TC = new TripCode(); + for (int i = 0; i < s.length(); i++) { + if (s.charAt(i) == '的' && s.charAt(i + 1) == '动' && s.charAt(i + 2) == '态' && s.charAt(i + 3) == '行' && s.charAt(i + 4) == '程' && s.charAt(i + 5) == '卡') { + String tel = TC.getTelephone(); + for(;s.charAt(i)!=',';i--); + i++; + for (; s.charAt(i) != ','; i++) { + tel += s.charAt(i); + } + TC.setTelephone(tel); + } + if (s.charAt(i) == '请' && s.charAt(i + 1) == '收' && s.charAt(i + 2) == '下') { + String St = TC.getStatus(); + i = i + 3; + for (; s.charAt(i) != ','; i++) { + St += s.charAt(i); + } + TC.setStatus(St); + } + if (s.charAt(i) == '更' && s.charAt(i + 1) == '新' && s.charAt(i + 2) == '于') { + String Data = TC.getTime(); + i = i + 3; + for (; s.charAt(i) != ','; i++) { + Data += s.charAt(i); + } + TC.setTime(Data); + } + if (s.charAt(i) == '到' && s.charAt(i + 1) == '达' && s.charAt(i + 2) == '或' && s.charAt(i + 3) == '途' && s.charAt(i + 4) == '经') { + String Dis = TC.getDistrict(); + i = i + 5; + for (; s.charAt(i) != ']'; i++) { + Dis += s.charAt(i); + } + TC.setDistrict(Dis); + } + } + return TC; + } +} diff --git a/src/client/admin_log.py b/src/client/admin_log.py new file mode 100644 index 0000000..e990c40 --- /dev/null +++ b/src/client/admin_log.py @@ -0,0 +1,53 @@ +from codecs import ignore_errors +from pickle import TRUE +import turtle +from xmlrpc.client import boolean +import numpy as np +from asyncore import write +import xlrd +import pandas as pd +import openpyxl +from xlrd import Book +import datetime +import time +import time +from flask import Flask,request +from encodings import utf_8 +import pymssql +import json +import base64 +import jpype +class admin_log(): + def admin_log1(c,a): + b={ + 'test1':[], + 'text':'2' + } + # 把数据装载成json格式并回传 + #a='{"a":{"test":1},"b":2,"c":3,"d":4,"e":5}' + conn =pymssql.connect( + server="LAPTOP-FLH9FTB4",#本地服务器 + user="sa",password="as2799094948", + database="software_project", + charset="utf8" + ) + if conn: + print('连接数据库成功!')#测试是否连接上 + cursor =conn.cursor() #使用cursor()方法获取操作游标 + a= request.json + username=a['username'] + passwd=a['password'] + sql_select="SELECT [password] FROM admin where username = '{}'".format(username) #数据库查询语句 + cursor.execute(sql_select) #执行语句 + results =cursor.fetchall() #获取所有记录列表 + if len(results)==0: + b['text']=1 + elif results[0][0]==passwd: + b['text']=2 + else: b['text']=3 + conn.commit() + cursor.close() + conn.close() + # 把数据装载成json格式并回传 + a1=json.dumps(b,ensure_ascii=False) + return a1 \ No newline at end of file diff --git a/src/client/ceshi.py b/src/client/ceshi.py new file mode 100644 index 0000000..c2ea60a --- /dev/null +++ b/src/client/ceshi.py @@ -0,0 +1,16 @@ +'''b={ + 'test1':[], + 'text':'2', + 'image':[] + } +b['test1'].append(['学号:200340001','姓名:白雪健','电话:13080337680','时间:2020','校门:南','市:天津','区:东丽区','详细地址:中国民航大学']) +print(b)''' +b={ + 'test1':[], + 'text':'2', + 'image':[] + } +b['test1'].append([]) +b['test1'][0].append('申请表类型') +b['test1'][0].append('申请表类型') +print(b) \ No newline at end of file diff --git a/src/client/getmes.py b/src/client/getmes.py new file mode 100644 index 0000000..a336a00 --- /dev/null +++ b/src/client/getmes.py @@ -0,0 +1,88 @@ +import time +import requests +import pymssql +import re +from bs4 import BeautifulSoup +cookies = { + 'security_session_verify': '2b416949a891a8c262d984ce4252acc6', + '__yjs_duid': '1_0b113b04c0c0e5c875c1b9485d5285781666539190108', + 'Hm_lvt_133c8ee1fed22328c57193e7ed6ce0c5': '1666539138,1666540035', + 'Hm_lpvt_133c8ee1fed22328c57193e7ed6ce0c5': '1666540145', +} + +headers = { + 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9', + 'Accept-Language': 'zh-CN,zh;q=0.9', + 'Cache-Control': 'max-age=0', + 'Connection': 'keep-alive', + # Requests sorts cookies= alphabetically + # 'Cookie': 'security_session_verify=2b416949a891a8c262d984ce4252acc6; __yjs_duid=1_0b113b04c0c0e5c875c1b9485d5285781666539190108; Hm_lvt_133c8ee1fed22328c57193e7ed6ce0c5=1666539138,1666540035; Hm_lpvt_133c8ee1fed22328c57193e7ed6ce0c5=1666540145', + 'Referer': 'http://tj.bendibao.com/news/gelizhengce/fengxianmingdan.php?isqg=0', + 'Upgrade-Insecure-Requests': '1', + 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Safari/537.36', +} + +params = { + 'isqg': '1', + 'qu': '全部', +} +t=0 +while True: + conn =pymssql.connect( + server="LAPTOP-FLH9FTB4",#本地服务器 + user="sa",password="as2799094948", + database="software_project", + charset="utf8" + #这里设置全局的GBK,如果设置的是UTF—8需要将数据库默认的GBK转化成UTF-8 + ) + if conn: + print('连接数据库成功!')#测试是否连接上 + res = requests.get('http://tj.bendibao.com/news/gelizhengce/fengxianmingdan.php', params=params, cookies=cookies, headers=headers) + res.encoding='utf-8' + soup = BeautifulSoup(res.text, 'html.parser') + # 使用cursor()方法获取操作游标 + cursor =conn.cursor() + # 高风险地区信息 + # 清除原有数据 + cursor.execute("truncate table height") + conn.commit() + # 存入新数据 + content='#info > div.height.info-item > div > div > div > div' + a=soup.select(content) + for i in range(1,len(a)): + a[i] = a[i].text.strip().replace("\n", "") + if len(a[i])!=0: + area=re.search(r'.*?区',a[i]).group() + cursor.execute("insert into height values('{0}','{1}')".format(area,a[i])) + conn.commit() + # 中风险地区信息 + # 清除原有数据 + cursor.execute("truncate table middle") + conn.commit() + # 存入新数据 + content='#info > div.middle.info-item > div > div > div > div' + a=soup.select(content) + for i in range(1,len(a)): + a[i] = a[i].text.strip().replace("\n", "") + if len(a[i])!=0: + area=re.search(r'.*?区',a[i]).group() + cursor.execute("insert into middle values('{0}','{1}')".format(area,a[i])) + conn.commit() + # 低风险地区信息 + # 清除原有数据 + cursor.execute("truncate table low") + conn.commit() + # 存入新数据 + content='#info > div.low.info-item > div > div > div > div' + a=soup.select(content) + for i in range(1,len(a)): + a[i] = a[i].text.strip().replace("\n", "") + if len(a[i])!=0: + area=re.search(r'.*?区',a[i]).group() + cursor.execute("insert into low values('{0}','{1}')".format(area,a[i])) + conn.commit() + cursor.close() + # 断开数据库连接 + conn.close() +# 设置休眠时间,定时执行 + time.sleep(43200) #12小时 diff --git a/src/client/in_school.py b/src/client/in_school.py new file mode 100644 index 0000000..3aba8e2 --- /dev/null +++ b/src/client/in_school.py @@ -0,0 +1,190 @@ +# from crypt import methods +# 将对应图片的base64编码解析为图片 +from audioop import add +import base64 +import os +from unicodedata import name +import time +from flask import Flask,request +from codecs import ignore_errors +from pickle import TRUE +import turtle +from xmlrpc.client import boolean +import numpy as np +from asyncore import write +import xlrd +import pandas as pd +import openpyxl +from xlrd import Book +import datetime +import time +import time +from flask import Flask,request +from encodings import utf_8 +import pymssql +import json +import base64 +import jpype + +# 出校申请请求的类def decode_base64(base64_data,i): + # print(type(base64_data)) + #print(base64_data) + # 如果想要在浏览器上访问base64格式图片,需要在前面加上:data:image/jpeg;base64, +class in_school: + def __init__(self,type='',sno='',name='',phone='',time='',door='',city='',area='',address='',health_code='',Tour_code='',NAT='',Pass=''): + self.type='' + self.sno='' + self.name='' + self.phone='' + self.time='' + self.door='' + self.city='' + self.area='' + self.address='' + self.health_code='' + self.Tour_code='' + self.NAT='' + self.Pass='' + def in_school1(p,json_data): + Conn = pymssql.connect('LAPTOP-FLH9FTB4',"sa","as2799094948","software_project",charset='utf8') + cur = Conn.cursor() + sql = "Select [sno] from Form where sno= '{}'".format(json_data['sno']) + cur.execute(sql) + requests = cur.fetchall() + if(len (requests)!=0): + return '2' + sql = "Select state from [user] where username= '{}'".format(json_data['sno']) + cur.execute(sql) + requests = cur.fetchall() + for row in requests: + if(row[0]==json_data['type']): + return '3' + cur.close() + Conn.close() + #将请求得到的数据转换为json格式 + l1 = len(json_data['test']) + '''for i in range(l1): + decode_base64(json_data['test'][i],i) #调用base64编码转换图片的函数得到相应图片并存到目录中''' + #查找user表,如果state是在校 就return 2 + a = in_school() + a.type='入校' + a.sno=json_data['sno'] + a.name = json_data['name'] + a.phone = json_data['phone'] + a.time = json_data['time'] + a.door = json_data['door'] + a.city =json_data['city'] + a.area =json_data['area'] + a.address = json_data['address'] + a.health_code = json_data['test'][0] + a.Tour_code = json_data['test'][1] + a.NAT = json_data['test'][2] + f=a.shengpi1(json_data['area'],json_data['time'],json_data['test'][2],json_data['test'][1],json_data['test'][0]) + a.Pass = str(f) + return a + def shengpi1(p,a,b,c,d,e):#a:xx区 b:时间 c:健康码 d:行程码 e:核酸 + year,month,day=b.split('-',2) + Conn = pymssql.connect('LAPTOP-FLH9FTB4',"sa","as2799094948","software_project",charset='utf8')#xxx是防疫表,现在先不填 + cur = Conn.cursor() + sql = "Select [area] from height" + cur.execute(sql) + now=str(time.strftime("%d"))#调用本地时间 + x=0 + if '区' not in a: + a=a+'区' + # wb1=openpyxl.load_workbook('D:\\fanyi.xlsx') + #ws1=wb1['Sheet1'] + #num_rows1 = ws1.max_row # 总行数 + #num_cols1 = ws1.max_column + row = cur.fetchone() + while row: + if(a==row[0]): + return 3 # ---调用防疫区数据库,将a和防疫区数据库的值进行一一比较,如果找到,返回不通过 + row = cur.fetchone() + #----- + a2=1 + if(day!=now): + return 3 #2----将本地时间和b进行比较,如果异常,将数据库中对应用户的通过情况改成不通过。 + #2---- + #jarpath =r"D:\tupian\OCR_baidu.jar" # jar包地址 + #jvmPath = jpype.getDefaultJVMPath() + #jpype.startJVM(jvmPath, "-ea", "-Djava.class.path=%s" % (jarpath)) + java1 = jpype.JClass("HealthCode") + java2 = jpype.JClass("TripCode") + java3 = jpype.JClass("CovidTestRep") + j1 = java1() + j2 = java2() + j3 = java3() + a2=1 + path="D:/tupian//12.jpg" + with open(path,'wb') as file: + img = base64.b64decode(c) + file.write(img) + str1 = str(j1.Judge(r"D:\tupian\12.jpg")) #Hst, Hname, Hdata 对应健康码颜色,姓名,日期3---- 将c传给ocr,让ocr把颜色传回来,对应给参数进行比较,如果异常,将数据库中对应用户的通过情况改成不通过。 + Hst, Hname, Hdata = str1.split(',') + year1,month1,day1=Hdata.split('-') + #if(year1!=year or month!= month1 or day!=day1): + #return 3 + print(Hst) + #if(Hst!='S绿'): + #return 3 + path="D:/tupian//13.jpg" + with open(path,'wb') as file: + img = base64.b64decode(d) + file.write(img) + str2 = str(j2.Judge(r"D:\tupian\13.jpg")) + Tst, Ttel, Tdata, Tdis = str2.split(',')#Tst, Ttel, Tdata, Tdis 对应行程码颜色,电话,日期,去过的地方4--- 将d传给ocr,让ocr把地点,颜色传回来, 查看行程码是否是正常,如果异常,将数据库中对应用户的通过情况改成不通过。 + year2,month2,day2=Tdata.split('.') + #if(year2!=year or month!= month2 or day!=day2): + #return 3 + if(Tdis!='天津市'): + + + return 3 + #4--- + path="D://tupian/11.jpg" + with open(path,'wb') as file: + img = base64.b64decode(e) + file.write(img) + str3 = str(j3.Judge(r"D:\tupian\11.jpg")) + Cst, Cname, Cdata = str3.split(',')#Cst, Cname, Cdata 对应 核酸结果 姓名 核酸日期5--- 将e传给ocr,让ocr把状态传回来, 查看核酸是否是正常,如果异常,将数据库中对应用户的通过情况改成不通过。 + year3,month3,day3=Cdata.split('-') + #if(year3!=year or month!= month3 or day-day3<=14): + #return 3 + if(Cst!='阴性'): + + + return 3 + + + return 2 + + + # 路由交换数据 + # def change(self): + # app= Flask(__name__) + # @app.route('/',methods=['GET','POST'])#开启app.route,进到根目录里面 + # def hello_world(): + # json_data = request.json #将请求得到的数据转换为json格式 + # l1 = len(json_data['test']) + # for i in range(l1): + # decode_base64(json_data['test'][i],i) #调用base64编码转换图片的函数得到相应图片并存到目录中 + + # self.name = json_data['name'] + # self.sno = json_data['sno'] + # self.phone = json_data['phone'] + # self.time = json_data['time'] + # self.door = json_data['door'] + # self.city =json_data['city'] + # self.area =json_data['area'] + # self.address = json_data['address'] + + # return '1' #如果一切正常则返回1 + # app.run(host='127.0.0.1',port=2022) + +# if __name__=='__main__': +# a = in_school1() +# a.change() +# print(a.name) +# print(a.sno) +# print(a.) \ No newline at end of file diff --git a/src/client/main.py b/src/client/main.py new file mode 100644 index 0000000..1261f8f --- /dev/null +++ b/src/client/main.py @@ -0,0 +1,172 @@ +from audioop import add +import base64 +import os +import json +from unicodedata import name +from codecs import ignore_errors +from pickle import TRUE +import turtle +from xmlrpc.client import boolean +import numpy as np +from asyncore import write +import xlrd +import pandas as pd +import openpyxl +from xlrd import Book +import datetime +import time +from flask import Flask,request +from encodings import utf_8 +import pymssql +import json +import base64 +from out_school import out_school +from in_school import in_school +import time +from flask import Flask,request +from shengpi import approval +from admin_log import admin_log +from user_log import user_log +from view import view +from scan_the_code import scan_the_code +import jpype +app= Flask(__name__) +@app.route('/',methods=['GET','POST']) +def hello(): + return '2' +@app.route('/uesr',methods=['GET','POST']) +def log(): + a= request.json + user=user_log() + a1=user.user_log1(a) + return a1 +@app.route('/admin',methods=['GET','POST']) +def log1(): + a= request.json + admin=admin_log() + a1=admin.admin_log1(a) + #a='{"a":{"test":1},"b":2,"c":3,"d":4,"e":5}' + return a1 +@app.route('/in_school',methods=['GET','POST'])#开启app.route,进到根目录里面 +def in_school1(): + json_data = request.json + a=in_school() + b=a.in_school1(json_data) + + if(b=='2' or b == '3'): + print(b) + return b + to_mssql(b) + # print(a.sno) + return '1' + + +@app.route('/out_school',methods=['GET','POST'])#开启app.route,进到根目录里面 +def out_school1(): + json_data = request.json #将请求得到的数据转换为json格式 + a=out_school() + b=a.out_school1(json_data) + + if(b=='2' or b == '3'): + return b + to_mssql(b) + return '1' +def a(): + password = request.values.get("password") + print(password) + +@app.route('/shengpi',methods=['GET','POST']) +def Userdisplay(): #收到request返回所有没有通过申请的用户名字的列表 + a=approval() + data=a.list() + data=json.dumps(data,ensure_ascii=False) + return data + +@app.route('/info',methods=['GET','POST']) +def Userdisplay1(): #收到学号返回该用户信息 + a=approval() + b=a.list2() + a=json.dumps(b,ensure_ascii=False) + data=json.loads(a) + # print(data) + return data + + + +def to_mssql(a): + Conn = pymssql.connect('LAPTOP-FLH9FTB4',"sa","as2799094948","software_project",charset='utf8') + + if Conn: + print ("连接成功") + else: + print("失败") + + # print(a.type,a.sno,a.name,a.phone,a.time,a.door,a.city,a.area,a.address,a.health_code,a.Tour_code,a.NAT,a.Pass) + # print(type(a.NAT)) + + cur = Conn.cursor() + print(a.Pass) + insert = "insert into Form([type] ,[sno] ,[name] ,[phone] ,[time] ,[door] ,[city] ,[area] ,[address] ,[health_code] ,[Tour_code] ,[NAT] ,[Pass]) values ('%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s') ; COMMIT"%( + a.type,a.sno,a.name,a.phone,a.time,a.door,a.city,a.area,a.address,a.health_code,a.Tour_code,a.NAT,a.Pass + ) + cur.execute(insert) + print("qqqqq") + + cur.close() + Conn.close() + + +@app.route('/access',methods=['GET','POST'])#开启app.route,进到根目录里面 +def access(): + # return '1' + a= request.json + a1=approval() + a1.shengpi2(a) + return '1' +@app.route('/state',methods=['GET','POST']) +def State(): + a = request.json + num = a['sno'] + print(num) + Conn = pymssql.connect(server="LAPTOP-FLH9FTB4",#本地服务器 + user="sa",password="as2799094948", + database="software_project", + charset="utf8") + cur = Conn.cursor() + Query = 'Select [Pass] from Form where [sno] = %s'%num + cur.execute(Query) + p = cur.fetchall() + if(len(p)==0): + print('您还没有提交表单或您的申请已被管理员驳回') + return '您还没有提交表单或您的申请已被管理员驳回' + if p[0][0] == '1': + print('您的申请表待审核') + return '您的申请表待审核' + elif p[0][0] == '2': + print('您的申请表已通过审核') + return '您的申请表已通过审核' + elif p[0][0] == '3': + print('您的申请表自动审批未通过,等待管理员审批') + return '您的申请表自动审批未通过,等待管理员审批' + else: + print('error') + return 'error' +# 查看疫情信息 +@app.route('/look_info',methods=['GET','POST']) +def look(): + json_data = request.json + a=view() + b=a.view1(json_data) + return b +@app.route('/scan_the_code',methods=['GET','POST'])#开启app.route,进到根目录里面 +def scan(): + data = request.json + a=scan_the_code() + b=a.scan_the_code1(data) + return b +if __name__ == "__main__": + jarpath =r"D:\tupian\OCR_baidu.jar" + jvmPath = jpype.getDefaultJVMPath() + jpype.startJVM(jvmPath, "-ea", "-Djava.class.path=%s" % (jarpath)) + app.run(host='127.0.0.1',port=2020) + jpype.shutdownJVM () \ No newline at end of file diff --git a/src/client/main1.py b/src/client/main1.py new file mode 100644 index 0000000..e3ddf2f --- /dev/null +++ b/src/client/main1.py @@ -0,0 +1,41 @@ +import os + +import jpype + +jarpath = r"D:\tupian\OCR_baidu.jar" # jar包地址 +jvmPath = jpype.getDefaultJVMPath() +jpype.startJVM(jvmPath, "-ea", "-Djava.class.path=%s" % (jarpath)) +java1 = jpype.JClass("HealthCode") +java2 = jpype.JClass("TripCode") +java3 = jpype.JClass("CovidTestRep") +j1 = java1() +j2 = java2() +j3 = java3() +str1 = str(j1.Judge(r"D:\tupian\12.jpg")) # 健康码地址,不要包含中文 下同 +str2 = str(j2.Judge(r"D:\tupian\13.jpg")) # 行程码地址 +str3 = str(j3.Judge(r"D:\tupian\11.jpg")) # 核酸结果地址 +# if str2==",," or str3==',,':图片有误 +''' +Hst, Hname, Hdata 对应健康码颜色,姓名,日期 +Tst, Ttel, Tdata, Tdis 对应行程码颜色,电话,日期,去过的地方 +Cst, Cname, Cdata 对应 核酸结果 姓名 核酸日期 +''' +# 为方便分割,Hst前加了一个大写字符S,判断时应注意,如绿码 Hst为:S绿 +Hst, Hname, Hdata = str1.split(',') +Tst, Ttel, Tdata, Tdis = str2.split(',') +Cst, Cname, Cdata = str3.split(',') +Hdata = Hdata[0:10] # 只要求精确到日,不考虑小时。 +Tdata = Tdata[0:10] +Cdata = Cdata[0:10] + +print(Hst) +print(Hname) +print(Hdata) +print(Tst) +print(Ttel) +print(Tdis) +print(Tdata) +print(Cst) +print(Cname) +print(Cdata) +jpype.shutdownJVM() diff --git a/src/client/out_school.py b/src/client/out_school.py new file mode 100644 index 0000000..bb04967 --- /dev/null +++ b/src/client/out_school.py @@ -0,0 +1,149 @@ +from codecs import ignore_errors +from pickle import TRUE +import turtle +from xmlrpc.client import boolean +import numpy as np +from asyncore import write +import xlrd +import pandas as pd +import openpyxl +from xlrd import Book +import datetime +import time +import time +from flask import Flask,request +from encodings import utf_8 +import pymssql +import json +import base64 +import jpype + +class out_school: + def __init__(self,type='',sno='',name='',phone='',time='',door='',city='',area='',address='',health_code='',Tour_code='',NAT='',Pass=''): + self.type='' + self.sno='' + self.name='' + self.phone='' + self.time='' + self.door='' + self.city='' + self.area='' + self.address='' + self.health_code='' + self.Tour_code='' + self.NAT='' + self.Pass='' + def out_school1(p,json_data): + l1 = len(json_data['test']) + Conn = pymssql.connect('LAPTOP-FLH9FTB4',"sa","as2799094948","software_project",charset='utf8') + cur = Conn.cursor() + sql = "Select [sno] from Form where sno= '{}'".format(json_data['sno']) + cur.execute(sql) + requests = cur.fetchall() + if(len (requests)!=0): + return '2' + sql = "Select state from [user] where username= '{}'".format(json_data['sno']) + cur.execute(sql) + requests = cur.fetchall() + for row in requests: + print(type(json_data['type'])) + if(row[0]==json_data['type']): + return '3' + cur.close() + Conn.close() + '''for i in range(l1): + decode_base64(json_data['test'][i],i+3) #调用base64编码转换图片的函数得到相应图片并存到目录中''' + #查找user表,如果state是出校 就return 2 + a = out_school() + a.type = '出校' + a.sno = json_data['sno'] + a.name = json_data['name'] + a.phone = json_data['phone'] + a.time = json_data['time'] + a.door = json_data['door'] + a.city =json_data['city'] + a.area =json_data['area'] + a.address = json_data['address'] + a.health_code = json_data['test'][0] + a.Tour_code = json_data['test'][1] + a.NAT = json_data['test'][2] + f=a.shengpi1(json_data['area'],json_data['time'],json_data['test'][1],json_data['test'][2],json_data['test'][0]) + a.Pass=f + return a + def shengpi1(p,a,b,c,d,e):#a:xx区 b:时间 c:健康码 d:行程码 e:核酸 + year,month,day=b.split('-',2) + Conn = pymssql.connect('LAPTOP-FLH9FTB4',"sa","as2799094948","software_project",charset='utf8')#xxx是防疫表,现在先不填 + cur = Conn.cursor() + sql = "Select [area] from height" + cur.execute(sql) + now=str(time.strftime("%d"))#调用本地时间 + x=0 + if '区' not in a: + a=a+'区' + row = cur.fetchone() + while row: + if(a==row[0]): + return 3 # ---调用防疫区数据库,将a和防疫区数据库的值进行一一比较,如果找到,返回不通过 + row = cur.fetchone() + #----- + sql = "Select [area] from middle" + cur.execute(sql) + row = cur.fetchone() + while row: + if(a==row[0]): + return 3 # ---调用防疫区数据库,将a和防疫区数据库的值进行一一比较,如果找到,返回不通过 + row = cur.fetchone() + a2=1 + if(day!=now): + return 3 #2----将本地时间和b进行比较,如果异常,将数据库中对应用户的通过情况改成不通过。 + #2---- + #jarpath =r"D:\tupian\OCR_baidu.jar" # jar包地址 + #jvmPath = jpype.getDefaultJVMPath() + #jpype.startJVM(jvmPath, "-ea", "-Djava.class.path=%s" % (jarpath)) + java1 = jpype.JClass("HealthCode") + java2 = jpype.JClass("TripCode") + java3 = jpype.JClass("CovidTestRep") + j1 = java1() + j2 = java2() + j3 = java3() + a2=1 + path="D:/tupian//12.jpg" + with open(path,'wb') as file: + img = base64.b64decode(c) + file.write(img) + str1 = str(j1.Judge(r"D:\tupian\12.jpg")) #Hst, Hname, Hdata 对应健康码颜色,姓名,日期3---- 将c传给ocr,让ocr把颜色传回来,对应给参数进行比较,如果异常,将数据库中对应用户的通过情况改成不通过。 + Hst, Hname, Hdata = str1.split(',') + year1,month1,day1=Hdata.split('-') + #if(year1!=year or month!= month1 or day!=day1): + #return 3 + if(Hst!='S绿'): + + + return 3 + path="D:/tupian//13.jpg" + with open(path,'wb') as file: + img = base64.b64decode(d) + file.write(img) + str2 = str(j2.Judge(r"D:\tupian\13.jpg")) + Tst, Ttel, Tdata, Tdis = str2.split(',')#Tst, Ttel, Tdata, Tdis 对应行程码颜色,电话,日期,去过的地方4--- 将d传给ocr,让ocr把地点,颜色传回来, 查看行程码是否是正常,如果异常,将数据库中对应用户的通过情况改成不通过。 + year2,month2,day2=Tdata.split('.') + #if(year2!=year or month!= month2 or day!=day2): + #return 3 + if(Tdis!='天津市'): + + return 3 + #4--- + path="D://tupian/11.jpg" + with open(path,'wb') as file: + img = base64.b64decode(e) + file.write(img) + str3 = str(j3.Judge(r"D:\tupian\11.jpg")) + Cst, Cname, Cdata = str3.split(',')#Cst, Cname, Cdata 对应 核酸结果 姓名 核酸日期5--- 将e传给ocr,让ocr把状态传回来, 查看核酸是否是正常,如果异常,将数据库中对应用户的通过情况改成不通过。 + year3,month3,day3=Cdata.split('-') + #if(year3!=year or month!= month3 or day-day3<=14): + #return 3 + if(Cst!='阴性'): + + return 3 + + return 2 \ No newline at end of file diff --git a/src/client/scan_the_code.py b/src/client/scan_the_code.py new file mode 100644 index 0000000..92e1ffa --- /dev/null +++ b/src/client/scan_the_code.py @@ -0,0 +1,70 @@ +from audioop import add +import base64 +import os +import json +from unicodedata import name +from codecs import ignore_errors +from pickle import TRUE +import turtle +from xmlrpc.client import boolean +import numpy as np +from asyncore import write +import xlrd +import pandas as pd +import openpyxl +from xlrd import Book +import datetime +import time +from flask import Flask,request +from encodings import utf_8 +import pymssql +import json +import base64 +from out_school import out_school +from in_school import in_school +import time +class scan_the_code: + def scan_the_code1(p,data): + sno=data['sno'] + res={ + 'result':[] + } + Conn = pymssql.connect(server="LAPTOP-FLH9FTB4",#本地服务器 + user="sa",password="as2799094948", + database="software_project", + charset="utf8") + if Conn: + print ("连接成功") + cur = Conn.cursor() + #cur.execute("delete student where state='出' and pass='2' ") + #1在校,2审批通过 + if data['shuju']=='5YWl5qCh5LqM57u056CB': + cur.execute("select * from Form , [user] where state='出校' and pass='2' and sno='{}' and username=sno".format(sno)) + results=cur.fetchall() + if(len(results)==0): + res['result'].append('您没有入校资格') + else: + cur.execute("update [user] set state='入校' where username='{}' ".format(sno)) + cur.execute("delete from Form where sno='{}'".format(sno)) + res['result'].append('入校成功') + elif data['shuju']=='5Ye65qCh5LqM57u056CB': + cur.execute("select * from Form , [user] where state='入校' and pass='2'and sno='{}' and username=sno".format(sno)) + results=cur.fetchall() + if(len(results)==0): + print('无出校资格') + res['result'].append('您没有出校资格') + else: + # 测试时不更改数据 + cur.execute("update [user] set state='出校' where username='{}' ".format(sno)) + cur.execute("delete from Form where sno='{}'".format(sno)) + print('出校成功') + res['result'].append('出校成功') + else: + print('二维码无效') + res['result'].append('二维码无效') + print ("成功") + Conn.commit() + cur.close() + Conn.close() + b=json.dumps(res,ensure_ascii=False) + return b \ No newline at end of file diff --git a/src/client/shengpi.py b/src/client/shengpi.py new file mode 100644 index 0000000..2c1134f --- /dev/null +++ b/src/client/shengpi.py @@ -0,0 +1,113 @@ +from codecs import ignore_errors +from pickle import TRUE +import turtle +from xmlrpc.client import boolean +import numpy as np +from asyncore import write +import xlrd +import pandas as pd +import openpyxl +from xlrd import Book +import datetime +import time +import time +from flask import Flask,request +from encodings import utf_8 +import pymssql +import json +import base64 +import jpype +class approval: + def shengpi2(p,a):#a:xx区 b:时间 c:健康码 d:行程码 e:核酸 + Conn = pymssql.connect('LAPTOP-FLH9FTB4',"sa","as2799094948","software_project",charset='utf8') + cur = Conn.cursor() + sql = "Select [type] ,[sno] ,[name] ,[phone] ,[time] ,[door] ,[city] ,[area] ,[address] ,[health_code] ,[Tour_code] ,[NAT] ,[Pass] from Form" + cur.execute(sql) + row = cur.fetchone() + sno=a['data'] + sno1,sno=sno.split(':') + print(sno) + print(a['condition']) + while row: + if(row[1]==sno): + if(a['condition'] == '通过'): + change = "update Form set [Pass] = '2' where [sno] = '%s';COMMIT"%row[1] + elif a['condition'] == '不通过': + change = "delete From Form where [sno] = '%s';COMMIT"%row[1] + cur.execute(change) + break + #把row找到的这个值的通过情况改为xxx + row = cur.fetchone() + cur.close() + Conn.close() + def list(p): + Conn = pymssql.connect('LAPTOP-FLH9FTB4',"sa","as2799094948","software_project",charset='utf8') + cur = Conn.cursor() + sql = "Select [type] ,[sno] ,[name] ,[phone] ,[time] ,[door] ,[city] ,[area] ,[address] ,[health_code] ,[Tour_code] ,[NAT] ,[Pass] from Form" + cur.execute(sql) + row = cur.fetchone() + data={ + 'test1':[], + } + while row: + # #row[1].encode('big5hkscs') + # print(row[1].encode('latin1').decode('gbk')) + if(row[12]=='3'): + data['test1'].append(row[2])#将每一行的名字进行对code的编码和在code的基础上进行gbk解码 + row = cur.fetchone() + cur.close() + Conn.close() + return data + def list2(p): + Conn = pymssql.connect('LAPTOP-FLH9FTB4',"sa","as2799094948","software_project",charset='utf8') + cur = Conn.cursor() + sql = "Select [type] ,[sno] ,[name] ,[phone] ,[time] ,[door] ,[city] ,[area] ,[address] ,[health_code] ,[Tour_code] ,[NAT] ,[Pass] from Form" + cur.execute(sql) + row = cur.fetchone() + b={ + 'test1':[], + 'text':'2', + 'image':[] + } + number=0 + while row: + if(row[12]=='3'): + b['image'].append([]) + b['image'][number].append(row[9]) + b['image'][number].append(row[10]) + b['image'][number].append(row[11]) + b['test1'].append([]) + b['test1'][number].append('申请表类型:{}'.format(row[0])) + b['test1'][number].append('姓名:{}'.format(row[2])) + b['test1'][number].append('学号:{}'.format(row[1])) + b['test1'][number].append('联系电话:{}'.format(row[3])) + b['test1'][number].append('时间:{}'.format(row[4])) + b['test1'][number].append('校门:{}'.format(row[5])) + b['test1'][number].append('省市:{}'.format(row[6])) + b['test1'][number].append('区:{}'.format(row[7])) + b['test1'][number].append('详细地址:{}'.format(row[8])) + # b['test1'][number].append('健康码:{}'.format(row[9])) + # b['test1'][number].append('行程码:{}'.format(row[10])) + # b['test1'][number].append('核酸:{}'.format(row[11])) + b['test1'][number].append('通过情况:不通过') + number=number+1 + row = cur.fetchone() + cur.close() + Conn.close() + return b + +'''a1=shengpi() +path="D://tupian/11.jpg" +with open(path,'rb') as file: + a=file.read() + img = base64.b64encode(a) +path="D://tupian/12.jpg" +with open(path,'rb') as file: + a=file.read() + img1 = base64.b64encode(a) +path="D://tupian/13.jpg" +with open(path,'rb') as file: + a=file.read() + img2 = base64.b64encode(a) + +print(a1.shengpi1(str('爱华'),'2022-11-12',img1,img2,img))''' \ No newline at end of file diff --git a/src/client/user_log.py b/src/client/user_log.py new file mode 100644 index 0000000..18c353a --- /dev/null +++ b/src/client/user_log.py @@ -0,0 +1,54 @@ +from codecs import ignore_errors +from pickle import TRUE +import turtle +from xmlrpc.client import boolean +import numpy as np +from asyncore import write +import xlrd +import pandas as pd +import openpyxl +from xlrd import Book +import datetime +import time +import time +from flask import Flask,request +from encodings import utf_8 +import pymssql +import json +import base64 +import jpype +class user_log(): + def user_log1(p,a): + b={ + 'test1':[], + 'text':'2' + } + # 把数据装载成json格式并回传 + #a='{"a":{"test":1},"b":2,"c":3,"d":4,"e":5}' + conn =pymssql.connect( + server="LAPTOP-FLH9FTB4",#本地服务器 + user="sa",password="as2799094948", + database="software_project", + charset="utf8" + ) + if conn: + print('连接数据库成功!')#测试是否连接上 + cursor =conn.cursor() #使用cursor()方法获取操作游标 + a= request.json + username=a['username'] + passwd=a['password'] + sql_select="SELECT password FROM [user] where username = '{}'".format(username) #数据库查询语句 + cursor.execute(sql_select) #执行语句 + results =cursor.fetchall() #获取所有记录列表 + if len(results)==0: + b['text']=1 + elif results[0][0]==passwd: + b['text']=2 + else: b['text']=3 + conn.commit() + cursor.close() + conn.close() + # 把数据装载成json格式并回传 + a1=json.dumps(b,ensure_ascii=False) + #a='{"a":{"test":1},"b":2,"c":3,"d":4,"e":5}' + return a1 \ No newline at end of file diff --git a/src/client/view.py b/src/client/view.py new file mode 100644 index 0000000..fac1d12 --- /dev/null +++ b/src/client/view.py @@ -0,0 +1,96 @@ +from audioop import add +import base64 +import os +import json +from unicodedata import name +from codecs import ignore_errors +from pickle import TRUE +import turtle +from xmlrpc.client import boolean +import numpy as np +from asyncore import write +import xlrd +import pandas as pd +import openpyxl +from xlrd import Book +import datetime +import time +from flask import Flask,request +from encodings import utf_8 +import pymssql +import json +import base64 +from out_school import out_school +from in_school import in_school +import time +class view(): + def view1(p,json_data): + print(type(json_data['name'])) + area=json_data['name'] + data={ + 'height':[], + 'middle':[], + 'low':[] + } + conn =pymssql.connect( + server="LAPTOP-FLH9FTB4",#本地服务器 + user="sa",password="as2799094948", + database="software_project", + charset="utf8" + #这里设置全局的GBK,如果设置的是UTF—8需要将数据库默认的GBK转化成UTF-8 + ) + if conn: + print('连接数据库成功!')#测试是否连接上 + #高风险地区 + cursor =conn.cursor() #使用cursor()方法获取操作游标 + if area=='全部':sql_select="SELECT location FROM height order by location" + else:sql_select="SELECT location FROM height where area ='{}' order by location".format(area) + # sql_select="SELECT location FROM height where location like '{}%'".format(area) #数据库查询语句 + cursor.execute(sql_select) #执行语句 + results =cursor.fetchall() #获取所有记录列表 + if len(results)==0: + print('该地区暂无高风险区域') + data['height'].append('该地区暂无高风险区域') + else: + print('共查询到{}条信息'.format(len(results))) + data['height'].append('共查询到{}条信息'.format(len(results))) + for result in results: + print(result[0]) + data['height'].append(result[0]) + + #中风险地区 + cursor =conn.cursor() #使用cursor()方法获取操作游标 + if area=='全部':sql_select="SELECT location FROM middle order by location" + else:sql_select="SELECT location FROM middle where area ='{}' order by location".format(area) + cursor.execute(sql_select) #执行语句 + results =cursor.fetchall() #获取所有记录列表 + if len(results)==0: + print('该地区暂无中风险区域') + data['middle'].append('该地区暂无中风险区域') + else: + print('共查询到{}条信息'.format(len(results))) + data['middle'].append('共查询到{}条信息'.format(len(results))) + for result in results: + print(result[0]) + data['middle'].append(result[0]) + + #低风险地区 + cursor =conn.cursor() #使用cursor()方法获取操作游标 + if area=='全部':sql_select="SELECT location FROM low order by location" + else:sql_select="SELECT location FROM low where area ='{}' order by location".format(area) + cursor.execute(sql_select) #执行语句 + results =cursor.fetchall() #获取所有记录列表 + if len(results)==0: + print('该地区暂无低风险区域') + data['low'].append('该地区暂无低风险区域') + else: + print('共查询到{}条信息'.format(len(results))) + data['low'].append('共查询到{}条信息'.format(len(results))) + for result in results: + print(result[0]) + data['low'].append(result[0]) + conn.commit() + cursor.close() + conn.close() + b=json.dumps(data,ensure_ascii=False) + return b \ No newline at end of file diff --git a/src/wechat_app/app.js b/src/wechat_app/app.js new file mode 100644 index 0000000..1a40fb2 --- /dev/null +++ b/src/wechat_app/app.js @@ -0,0 +1,38 @@ +//app.js +App({ + + globalData:{ + phone:null, + no:'', + globalsno:'' + + }, + + /** + * 当小程序初始化完成时,会触发 onLaunch(全局只触发一次) + */ + onLaunch: function () { + + }, + + /** + * 当小程序启动,或从后台进入前台显示,会触发 onShow + */ + onShow: function (options) { + + }, + + /** + * 当小程序从前台进入后台,会触发 onHide + */ + onHide: function () { + + }, + + /** + * 当小程序发生脚本错误,或者 api 调用失败时,会触发 onError 并带上错误信息 + */ + onError: function (msg) { + + } +}) diff --git a/src/wechat_app/app.json b/src/wechat_app/app.json new file mode 100644 index 0000000..432e6f6 --- /dev/null +++ b/src/wechat_app/app.json @@ -0,0 +1,44 @@ +{ + "pages": [ + "pages/home/home", + "pages/administrator_log/administrator_log", + "pages/user_log/user_log", + "pages/set/set", + "pages/user/user", + "pages/v6_administrator/v6_administrator", + "pages/v7_out_school/v7_out_school", + "pages/v8_in_school/v8_in_school", + "pages/v9_manual/v9_manual", + "pages/v10_auto/v10_auto", + "pages/v11_success/v11_success", + "pages/v12_submit_info/v12_submit_info", + "pages/v13_look_info/v13_look_info", + "pages/v15_scan_the_code/v15_scan_the_code", + "pages/info/info", + "pages/v19_test/v19_test", + "pages/v16_user_state/v16_user_state" + ], + "window": { + "navigationBarBackgroundColor": "#00F5FF", + "navigationBarTextStyle": "white", + "navigationBarTitleText": "学生出入校管理", + "backgroundColor": "#000000", + "backgroundTextStyle": "dark" + }, + "tabBar": { + "list": [ + { + "pagePath": "pages/home/home", + "text": "首页", + "iconPath": "/static/image/home.png", + "selectedIconPath": "static/image/home-o.png" + }, + { + "pagePath": "pages/set/set", + "text": "简介", + "iconPath": "/static/image/my.png", + "selectedIconPath": "static/image/my-o.png" + } + ] + } +} \ No newline at end of file diff --git a/src/wechat_app/pages/administrator_log/administrator_log.js b/src/wechat_app/pages/administrator_log/administrator_log.js new file mode 100644 index 0000000..3225cda --- /dev/null +++ b/src/wechat_app/pages/administrator_log/administrator_log.js @@ -0,0 +1,152 @@ +//index.js +//获取应用实例 +// const app = getApp() +var i = 0; +Page({ + // 在js文件中设置相关的数据,data + data: { + username: '', + password: '', + snows: [], + animation: [], + dateTime: "", + }, + + + onUnload: function () { + clearTimeout(this.data.dateTime) + this.setData({ + snows: [], + animation: [] + }) + }, + onShow: function () { + this.initSnow(); + this.data.snows = []; + this.data.animation = []; + let j = 50 + while (j--) + this.data.snows.push(Math.floor(Math.random() * 700)) + this.setData({ + snows: this.data.snows + }) + }, + onHide: function () { + clearTimeout(this.data.dateTime) + this.setData({ + snows: [], + animation: [] + }) + }, + + initSnow: function () { + setTimeout(function () { + let animation = wx.createAnimation({}) + animation.translateY(804).opacity(1).step({ + duration: 4000 + }) + animation.translateY(0).opacity(1).step({ + duration: 0 + }) + this.setData({ + ['snows[' + i + ']']: Math.floor(Math.random() * 700), + ['animation[' + i + ']']: animation.export() + }) + i++; + if (i == 50) + i = 0 + }.bind(this), 500) + var dateTime = setTimeout(function () { + this.initSnow() + }.bind(this), 100) + this.setData({ + dateTime, + }) + }, + + + + // 1、将获取的账号存到数据username里面 + usernameInput: function (e) { + this.setData({ + username: e.detail.value + }) + }, + + // 2、将获取的密码存到password里面 + passwordInput: function (e) { + this.setData({ + password: e.detail.value + }) + }, + //3、、点击登录进行页面跳转 + bindViewTap: function() { + wx.request({ + url: 'http://127.0.0.1:2020/admin', + data: {username:this.data.username,password:this.data.password}, + dataType: JSON, + enableCache: true, + enableHttp2: true, + enableQuic: true, + method: 'POST', + timeout: 0, + success: (result) => { + // console.log(result) + console.log(result.data) +// JSON.parse将JSON字符串转换成一个JS对象,然后利用python的调用语法对相关内容进行操作 +var p=JSON.parse(result.data) + console.log(p.test1) + if(p.text=='2'){ + console.log("登录成功") + wx.navigateTo({ + url: '/pages/v6_administrator/v6_administrator' + }) + } + if(p.text=='1'){ + wx.showModal({ + cancelColor: 'cancelColor', + title: '用户名不存在', + success: function (res) { + if (res.confirm) { + console.log('用户点击确定') + } else { + console.log('用户点击取消') + } + } + }) + } + if(p.text=='3'){ + wx.showModal({ + cancelColor: 'cancelColor', + title: '密码错误', + success: function (res) { + if (res.confirm) { + console.log('用户点击确定') + } else { + console.log('用户点击取消') + } + } + }) + } + }, + fail:(res)=>{ + console.log("发生错误") + } + + })}, +// 管理员登录 +to1:function(){ + wx.navigateTo({ + url: "/pages/v16_registered/v16_registered", + }) +}, +to2:function(){ + wx.navigateTo({ + url: '/pages/v17_forget_mima/v17_forget_mima', + }) +} +}) + + + + \ No newline at end of file diff --git a/src/wechat_app/pages/administrator_log/administrator_log.json b/src/wechat_app/pages/administrator_log/administrator_log.json new file mode 100644 index 0000000..8835af0 --- /dev/null +++ b/src/wechat_app/pages/administrator_log/administrator_log.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/src/wechat_app/pages/administrator_log/administrator_log.wxml b/src/wechat_app/pages/administrator_log/administrator_log.wxml new file mode 100644 index 0000000..dd7681c --- /dev/null +++ b/src/wechat_app/pages/administrator_log/administrator_log.wxml @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + + + diff --git a/src/wechat_app/pages/administrator_log/administrator_log.wxss b/src/wechat_app/pages/administrator_log/administrator_log.wxss new file mode 100644 index 0000000..35635f5 --- /dev/null +++ b/src/wechat_app/pages/administrator_log/administrator_log.wxss @@ -0,0 +1,138 @@ +page{ + height: 100%; + } + + /* 1、表格的整体样式 */ + .container { + height: 100%; + display: flex; + flex-direction: column; + padding: 0; + box-sizing: border-box; + /* background-color: rgb(156, 23, 78) */ + } + + /*2、登录的图片样式*/ + .login-icon{ + display: flex; + justify-content: center; + align-items: center; + } + +/* 3、用来设置登录图片的宽度 */ + .login-img{ + + width: 500rpx; + height: 500rpx; + } + + /*4、表单内容*/ + .login-from { + /* 设置表格上方的高度 */ + margin-top: 20px; + flex: auto; + height:100%; + } + /* 5、设置输入的框 */ + .inputView { + /* background-color: #fff; */ + line-height: 50px; + border-radius:40px; + border:1px solid #161515; + } + + /*6、设置输入框旁边的图片*/ + .nameImage, .keyImage { + margin-left: 22px; + width: 18px; + height: 16px + } + /* 7、设置账号、密码字体的颜色 */ + .loginLab { + margin: 15px 15px 15px 10px; + color:blue; + font-size: 14px + } + /* 8、进行提示输入的框是灰色的 */ + .inputText { + flex: block; + float: right; + text-align: right; + margin-right: 22px; + margin-top: 11px; + color: gray; + font-size: 14px + } + + /* 9、 内部框图进行相应的分割*/ + .line { + margin-top: 10px; + } + + /* .line { + width: 100%; + height: 1px; + background-color: #cccccc; + margin-top: 1px; + } */ + + /*10、设置按钮*/ + .loginBtnView { + width: 100%; + height: auto; + /* background-color:#DCDCDC; */ + margin-top: 0px; + margin-bottom: 0px; + padding-bottom: 0px; + } + + .loginBtn { + width: 90%; + margin-top: 40px; + border-radius:10px; + } + + /* 设置字体颜色 */ + .bxj{ + color: red; + } +/* 用来设置注册和忘记密码 */ + .saveBtn { + width: 50% !important; + float:left; + font-weight: 100; + font-size: 10px; + } + .submitBtn { + width: 50% !important; + float:right; + font-size: 10px + + } +.s_view{ + position: fixed; + width: 100%; +} + +/* 雪花效果特效 */ +page { + background: linear-gradient(180deg, #6699CC 0%, #B8DBF0 100%); + background-attachment: fixed; + background-size: cover; + background-position: center top; + height: 100%; +} + +.snow { + width: fit-content; + position: absolute; + top: -100rpx; + width: 30rpx; + height: 27rpx; + z-index: 11; +} + +.snow:nth-child(2n+2) { + width: 35rpx; + height: 33rpx; +} diff --git a/src/wechat_app/pages/home/home.js b/src/wechat_app/pages/home/home.js new file mode 100644 index 0000000..06d950f --- /dev/null +++ b/src/wechat_app/pages/home/home.js @@ -0,0 +1,113 @@ +// pages/index/index.js +Page({ + + /** + * 页面的初始数据 + */ + data: { + message:"你好nihao", + datalist:['黑夜','白天','中午'], + userinfo:{ + name:"白雪健", + age:20 + }, + Image1:["/static/image/apic2098.jpg","/static/image/apic2098.jpg"] + }, + + uploadimage:function(){ + var that = this; + wx.chooseMedia({ + mediaType: ['image','video'], + sourceType: ['album', 'camera'], + maxDuration: 30, + camera: 'back', + success(res) { + + console.log(res), + console.log(res.tempFiles[0].tempFilePath), + that.setData({ + Image1:that.data.Image1.concat(res.tempFiles[0].tempFilePath) + }) + } + }) + + }, + + // clearimage:function(){ + // this.setData({ + // Image1:'' + // }) + // }, + + // 输入用户名所采取的行动 + + fakeCallback:function(e){ + console.log(1) + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady() { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide() { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload() { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom() { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage() { + + }, + clickme:function(){ + wx.navigateTo({ + url: '/pages/administrator_log/administrator_log', + }) + }, + clickme1:function(){ + wx.navigateTo({ + url: '/pages/user_log/user_log', + }) + } +}) \ No newline at end of file diff --git a/src/wechat_app/pages/home/home.json b/src/wechat_app/pages/home/home.json new file mode 100644 index 0000000..8835af0 --- /dev/null +++ b/src/wechat_app/pages/home/home.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/src/wechat_app/pages/home/home.wxml b/src/wechat_app/pages/home/home.wxml new file mode 100644 index 0000000..1bbb58e --- /dev/null +++ b/src/wechat_app/pages/home/home.wxml @@ -0,0 +1,61 @@ + + + + + + + + + + + + + + 用户 + + + + 管理员 + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/wechat_app/pages/home/home.wxss b/src/wechat_app/pages/home/home.wxss new file mode 100644 index 0000000..6217fa2 --- /dev/null +++ b/src/wechat_app/pages/home/home.wxss @@ -0,0 +1,64 @@ +/* pages/index/index.wxss */ +.c1{ + color: red; +} +.image1{ + width: 200rpx; + height: 200rpx; + /* 如果要设置圆角的话 */ + border-radius: 100rpx; +} +.menu{ + display: flex; + /* 规定主轴的方向 */ + flex-direction: row; + /* 元素在主轴方向的排列方式 我用的是平均排列*/ + justify-content: space-around; + /* 元素在负轴方向如何展示 */ + /* align-items: center; */ + +} +/* 缺个空格差点g。 */ +.menu .item{ + display: flex; + flex-direction: column; + /* 元素在负轴方向如何展示 */ + align-items: center; +} + +/* 设置背景图片 */ + +.banner{ + + width: 100%; + height: 550rpx; +} +.banner swiper{ + + height: 100%; + width: 100%; +} +.banner image{ + + width: 100%; + height: 550rpx; +} + +.header { + position: relative; + height:300rpx; + background: linear-gradient(to bottom, #56ccf2, #2f80ed); +} + +.bg_ware { + position: absolute; + left: 0; + bottom: -2rpx; + width: 100%; + mix-blend-mode: screen; + height: 120rpx; +} + + + + diff --git a/src/wechat_app/pages/info/info.js b/src/wechat_app/pages/info/info.js new file mode 100644 index 0000000..7463268 --- /dev/null +++ b/src/wechat_app/pages/info/info.js @@ -0,0 +1,139 @@ +// pages/info/info.js +var app = getApp(); +Page({ + + /** + * 页面的初始数据 + */ + data: { + list:[], + image:[] + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady() { + + }, + // 返回通过的信息 + backR:function(){ + // console.log(abc) + // console.log(abc.currentTarget.dataset.abc) + wx.request({ + url: 'http://127.0.0.1:2020/access', + data: { + data:this.data.list[2], + condition:'通过' + }, + dataType: JSON, + enableCache: true, + enableHttp2: true, + enableQuic: true, + method: 'POST', + timeout: 0, + success: (result) => { + console.log(this.data.list[2]) + wx.redirectTo({ + url: '/pages/v9_manual/v9_manual', + }) + // console.log(result.data) + }, + }) + }, +//返回不通过的信息 + backE:function(){ + // console.log(abc) + wx.request({ + url: 'http://127.0.0.1:2020/access', + dataType: JSON, + enableCache: true, + enableHttp2: true, + enableQuic: true, + method: 'POST', + timeout: 0, + + data:{ + data:this.data.list[2], + condition:'不通过' + }, + success: (result) => { + wx.redirectTo({ + url: '/pages/v9_manual/v9_manual', + }) + // console.log(2) + }, + }) + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + console.log(app.globalData.no) + var that = this; + wx.request({ + url: 'http://127.0.0.1:2020/info', + dataType: JSON, + method: 'GET', + timeout: 0, + success: (res) => { + // console.log(res.data) + var p = JSON.parse(res.data) + // console.log(app.globalData.no) + // console.log(p.test1[app.globalData.no]) + // console.log(p.image) + // console.log(p) + // console.log(p.test1[app.globalData.no]) + that.setData({ + list:p.test1[app.globalData.no], + image:p.image[app.globalData.no] + }) + // console.log(this.data.list[2]) + // console.log(that.data.image) + }, + }) + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide() { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload() { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom() { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage() { + + } +}) \ No newline at end of file diff --git a/src/wechat_app/pages/info/info.json b/src/wechat_app/pages/info/info.json new file mode 100644 index 0000000..8835af0 --- /dev/null +++ b/src/wechat_app/pages/info/info.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/src/wechat_app/pages/info/info.wxml b/src/wechat_app/pages/info/info.wxml new file mode 100644 index 0000000..5fce100 --- /dev/null +++ b/src/wechat_app/pages/info/info.wxml @@ -0,0 +1,32 @@ + + + +{{item}} + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/wechat_app/pages/info/info.wxss b/src/wechat_app/pages/info/info.wxss new file mode 100644 index 0000000..3c0d9f4 --- /dev/null +++ b/src/wechat_app/pages/info/info.wxss @@ -0,0 +1,14 @@ +/* pages/info/info.wxss */ +.schoollist{ + margin-top: 20rpx; +} +.school-list-info{ + float: left; + margin-left: 20rpx; + margin-top: 20rpx; + position: relative; +} +.school-list-photo{ + width: 350rpx; + height: 700rpx; +} \ No newline at end of file diff --git a/src/wechat_app/pages/set/set.js b/src/wechat_app/pages/set/set.js new file mode 100644 index 0000000..62f1e96 --- /dev/null +++ b/src/wechat_app/pages/set/set.js @@ -0,0 +1,66 @@ +// pages/set/set.js +Page({ + + /** + * 页面的初始数据 + */ + data: { + + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady() { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide() { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload() { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom() { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage() { + + } +}) \ No newline at end of file diff --git a/src/wechat_app/pages/set/set.json b/src/wechat_app/pages/set/set.json new file mode 100644 index 0000000..8835af0 --- /dev/null +++ b/src/wechat_app/pages/set/set.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/src/wechat_app/pages/set/set.wxml b/src/wechat_app/pages/set/set.wxml new file mode 100644 index 0000000..00e17d6 --- /dev/null +++ b/src/wechat_app/pages/set/set.wxml @@ -0,0 +1,6 @@ + + + + + + diff --git a/src/wechat_app/pages/set/set.wxss b/src/wechat_app/pages/set/set.wxss new file mode 100644 index 0000000..a939f70 --- /dev/null +++ b/src/wechat_app/pages/set/set.wxss @@ -0,0 +1,31 @@ +.banner{ + + width: 100%; + height: 550rpx; +} +.banner swiper{ + + height: 100%; + width: 100%; +} +.banner image{ + + width: 100%; + height: 550rpx; +} + +.header { + position: relative; + height:300rpx; + background: linear-gradient(to bottom, #56ccf2, #2f80ed); +} + +.bg_ware { + position: absolute; + left: 0; + bottom: -2rpx; + width: 100%; + mix-blend-mode: screen; + height: 120rpx; +} + diff --git a/src/wechat_app/pages/user/user.js b/src/wechat_app/pages/user/user.js new file mode 100644 index 0000000..ed56496 --- /dev/null +++ b/src/wechat_app/pages/user/user.js @@ -0,0 +1,160 @@ +// pages/user/user.js +var app = getApp() +Page({ + + /** + * 页面的初始数据 + */ + data: { + cc:"sdasdasd", + + swiperList: [ + { + type: 'video', + url: 'https://static.51dh.com.cn/dbp/12/98/4494bd8a6e0fcd4a992f25a42bea28f8d1fb.mp4' + }, { + type: 'image', + url: 'https://bj.bcebos.com/shitu-query-bj/2022-11-25/12/65c8785efdf614c0?authorization=bce-auth-v1%2F7e22d8caf5af46cc9310f1e3021709f3%2F2022-11-25T04%3A21%3A48Z%2F300%2F%2Fcba06b77ff3338331ba50868a058fa1e01045adb673ced5692d04f84009ca4aa' + }, { + + type: 'image', + url: 'https://bj.bcebos.com/shitu-query-bj/2022-11-25/12/a12f2c0208db3f56?authorization=bce-auth-v1%2F7e22d8caf5af46cc9310f1e3021709f3%2F2022-11-25T04%3A20%3A16Z%2F300%2F%2F2d395d19e9b327015c749f3e9edfa863b1d73c8da8d935a87f8f00d34b482ba4', + }, { + + type: 'image', + url: 'https://i.postimg.cc/pXDp6RXq/susu3.jpg' + }, { + + type: 'image', + url: 'https://i.postimg.cc/XJmpTvCD/susu2.jpg' + }, { + + type: 'image', + url: 'https://i.postimg.cc/76br1jzJ/susu1.jpg' + }, { + + type: 'image', + url: 'https://i.postimg.cc/pXDp6RXq/susu3.jpg' + }, + { + + type: 'image', + url: 'https://i.postimg.cc/XJmpTvCD/susu2.jpg' + }, + ], + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + this.tauchSwiper('swiperList'); + }, + // 初始化tauchSwiper + tauchSwiper(name) { + let list = this.data[name]; + for (let i = 0; i < list.length; i++) { + // Math.abs(x) 函数返回指定数字 “x“ 的绝对值 + list[i].zIndex = parseInt(list.length / 2) + 1 - Math.abs(i - parseInt(list.length / 2)) + list[i].mLeft = i - parseInt(list.length / 2) + } + this.setData({ + swiperList: list + }) + }, + // tauchSwiper触摸开始 + tauchStart(e) { + this.setData({ + tauchStart: e.touches[0].pageX + }) + }, + // tauchSwiper计算方向 + tauchMove(e) { + this.setData({ + direction: e.touches[0].pageX - this.data.tauchStart > 0 ? 'right' : 'left' + }) + }, + // tauchSwiper计算滚动 + tauchEnd(e) { + let direction = this.data.direction; + let list = this.data.swiperList; + if (direction == 'right') { + let mLeft = list[0].mLeft; + let zIndex = list[0].zIndex; + for (let i = 1; i < list.length; i++) { + list[i - 1].mLeft = list[i].mLeft + list[i - 1].zIndex = list[i].zIndex + } + list[list.length - 1].mLeft = mLeft; + list[list.length - 1].zIndex = zIndex; + this.setData({ + swiperList: list + }) + } else { + let mLeft = list[list.length - 1].mLeft; + let zIndex = list[list.length - 1].zIndex; + for (let i = list.length - 1; i > 0; i--) { + list[i].mLeft = list[i - 1].mLeft + list[i].zIndex = list[i - 1].zIndex + } + list[0].mLeft = mLeft; + list[0].zIndex = zIndex; + this.setData({ + swiperList: list + }) + } + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady() { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + // 修改全局变量值的时候再用 =,其他时候用setData + this.setData({ + cc:app.globalData.globalsno + }) + console.log(app.globalData.globalsno) + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide() { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload() { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom() { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage() { + + } +}) \ No newline at end of file diff --git a/src/wechat_app/pages/user/user.json b/src/wechat_app/pages/user/user.json new file mode 100644 index 0000000..8835af0 --- /dev/null +++ b/src/wechat_app/pages/user/user.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/src/wechat_app/pages/user/user.wxml b/src/wechat_app/pages/user/user.wxml new file mode 100644 index 0000000..8fb553c --- /dev/null +++ b/src/wechat_app/pages/user/user.wxml @@ -0,0 +1,56 @@ + + + + + + + + + + + 出校 + + + + + 入校 + + + + + 疫情信息 + + + + + + + + + 申请状态 + + + + + + 扫码 + + + + + + + + + + + + + + + + + + + + diff --git a/src/wechat_app/pages/user/user.wxss b/src/wechat_app/pages/user/user.wxss new file mode 100644 index 0000000..520a8d4 --- /dev/null +++ b/src/wechat_app/pages/user/user.wxss @@ -0,0 +1,122 @@ +/* pages/index/index.wxss */ +.c1{ + color: red; +} +.image1{ + width: 200rpx; + height: 200rpx; + /* 如果要设置圆角的话 */ + border-radius: 100rpx; +} + +.menu{ + display: flex; + /* 规定主轴的方向 */ + flex-direction: row; + /* 元素在主轴方向的排列方式 我用的是平均排列*/ + justify-content: space-between; + /* 元素在负轴方向如何展示 */ + /* align-items: center; */ + +} + +.menu1{ + display: flex; + /* 规定主轴的方向 */ + flex-direction: row; + /* 元素在主轴方向的排列方式 我用的是平均排列*/ + justify-content: space-around; + /* 元素在负轴方向如何展示 */ + /* align-items: center; */ + +} +/* 缺个空格差点g。 */ +.menu .item{ + display: flex; + flex-direction: column; + /* 元素在负轴方向如何展示 */ + align-items: center; +} + +.menu1 .item{ + display: flex; + flex-direction: column; + /* 元素在负轴方向如何展示 */ + align-items: center; +} + +/* 做波浪 */ +.header { + position: relative; + height:600rpx; + background: linear-gradient(to bottom, #56ccf2, #2f80ed); +} + +.bg_ware { + position: absolute; + left: 0; + bottom: -2rpx; + width: 100%; + mix-blend-mode: screen; + height: 120rpx; +} + +/* 轮播图 */ +.swiper-item image, +.swiper-item video { + width: 100%; + display: block; + height: 100%; + margin: 0; + pointer-events: none; +} + +image { + max-width: 100%; + display: inline-block; + position: relative; + z-index: 0; +} + +.swiper-box { + height: 420rpx; + position: relative; + max-width: 750rpx; + overflow: hidden; + box-sizing: border-box; + margin-top: 90rpx; +} + +.swiper-box .item-box { + position: absolute; + width: 300rpx; + height: 380rpx; + top: 0; + bottom: 0; + left: 50%; + margin: auto; + transition: all 0.2s ease-in 0s; + opacity: 1; + box-shadow: 0px 13rpx 12rpx rgba(0, 0, 0, .5); + border-radius: 15rpx; + overflow: hidden; +} + +.swiper-box .item-box.none { + opacity: 0; +} + +.swiper-box .item-box .swiper-item { + width: 100%; + height: 100%; + border-radius: 6rpx; + overflow: hidden; +} + + +.swiper-box .item-box { + transform: scale(calc(0.5 + var(--index) / 10)); + margin-left: calc(var(--left) * 100rpx - 150rpx); + z-index: var(--index); +} + diff --git a/src/wechat_app/pages/user_log/user_log.js b/src/wechat_app/pages/user_log/user_log.js new file mode 100644 index 0000000..4ccced7 --- /dev/null +++ b/src/wechat_app/pages/user_log/user_log.js @@ -0,0 +1,150 @@ +//index.js +//获取应用实例 +// const app = getApp() +var app = getApp(); +var i = 0; +Page({ + // 在js文件中设置相关的数据,data + data: { + username: '', + password: '', + snows: [], + animation: [], + dateTime: "", + }, + onUnload: function () { + clearTimeout(this.data.dateTime) + this.setData({ + snows: [], + animation: [] + }) + }, + + onShow: function () { + this.initSnow(); + this.data.snows = []; + this.data.animation = []; + let j = 50 + while (j--) + this.data.snows.push(Math.floor(Math.random() * 700)) + this.setData({ + snows: this.data.snows + }) + }, + onHide: function () { + clearTimeout(this.data.dateTime) + this.setData({ + snows: [], + animation: [] + }) + }, + initSnow: function () { + setTimeout(function () { + let animation = wx.createAnimation({}) + animation.translateY(804).opacity(1).step({ + duration: 4000 + }) + animation.translateY(0).opacity(1).step({ + duration: 0 + }) + this.setData({ + ['snows[' + i + ']']: Math.floor(Math.random() * 700), + ['animation[' + i + ']']: animation.export() + }) + i++; + if (i == 50) + i = 0 + }.bind(this), 500) + var dateTime = setTimeout(function () { + this.initSnow() + }.bind(this), 100) + this.setData({ + dateTime, + }) + }, + + + // 1、将获取的账号存到数据username里面 + usernameInput: function (e) { + this.setData({ + + username: e.detail.value + }) + }, + + // 2、将获取的密码存到password里面 + passwordInput: function (e) { + this.setData({ + password: e.detail.value + }) + }, + //3、、点击登录进行页面跳转 + bindViewTap: function() { + var that = this + wx.request({ + url: 'http://127.0.0.1:2020/uesr', + data: {username:this.data.username,password:this.data.password}, + dataType: JSON, + enableCache: true, + enableHttp2: true, + enableQuic: true, + method: 'POST', + timeout: 0, + success: (result) => { + // console.log(result) + console.log(result.data) +// JSON.parse将JSON字符串转换成一个JS对象,然后利用python的调用语法对相关内容进行操作 + var p=JSON.parse(result.data) + console.log(p.test1) + if(p.text=='2'){ + console.log("登录成功") + app.globalData.globalsno = that.data.username + console.log(app.globalData.globalsno) + wx.navigateTo({ + url: '/pages/user/user' + }) + } + if(p.text=='1'){ + wx.showModal({ + cancelColor: 'cancelColor', + title: '用户名不存在', + success: function (res) { + if (res.confirm) { + console.log('用户点击确定') + } else { + console.log('用户点击取消') + } + } + }) + } + if(p.text=='3'){ + wx.showModal({ + cancelColor: 'cancelColor', + title: '密码错误', + success: function (res) { + if (res.confirm) { + console.log('用户点击确定') + } else { + console.log('用户点击取消') + } + } + }) + } + }, + fail:(res)=>{ + console.log("发生错误") + } + + })}, +to1:function(){ + wx.navigateTo({ + url: "/pages/v16_registered/v16_registered", + }) + }, + to2:function(){ + wx.navigateTo({ + url: '/pages/v17_forget_mima/v17_forget_mima', + }) + } +}) + \ No newline at end of file diff --git a/src/wechat_app/pages/user_log/user_log.json b/src/wechat_app/pages/user_log/user_log.json new file mode 100644 index 0000000..8835af0 --- /dev/null +++ b/src/wechat_app/pages/user_log/user_log.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/src/wechat_app/pages/user_log/user_log.wxml b/src/wechat_app/pages/user_log/user_log.wxml new file mode 100644 index 0000000..8a80e37 --- /dev/null +++ b/src/wechat_app/pages/user_log/user_log.wxml @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + + + diff --git a/src/wechat_app/pages/user_log/user_log.wxss b/src/wechat_app/pages/user_log/user_log.wxss new file mode 100644 index 0000000..35635f5 --- /dev/null +++ b/src/wechat_app/pages/user_log/user_log.wxss @@ -0,0 +1,138 @@ +page{ + height: 100%; + } + + /* 1、表格的整体样式 */ + .container { + height: 100%; + display: flex; + flex-direction: column; + padding: 0; + box-sizing: border-box; + /* background-color: rgb(156, 23, 78) */ + } + + /*2、登录的图片样式*/ + .login-icon{ + display: flex; + justify-content: center; + align-items: center; + } + +/* 3、用来设置登录图片的宽度 */ + .login-img{ + + width: 500rpx; + height: 500rpx; + } + + /*4、表单内容*/ + .login-from { + /* 设置表格上方的高度 */ + margin-top: 20px; + flex: auto; + height:100%; + } + /* 5、设置输入的框 */ + .inputView { + /* background-color: #fff; */ + line-height: 50px; + border-radius:40px; + border:1px solid #161515; + } + + /*6、设置输入框旁边的图片*/ + .nameImage, .keyImage { + margin-left: 22px; + width: 18px; + height: 16px + } + /* 7、设置账号、密码字体的颜色 */ + .loginLab { + margin: 15px 15px 15px 10px; + color:blue; + font-size: 14px + } + /* 8、进行提示输入的框是灰色的 */ + .inputText { + flex: block; + float: right; + text-align: right; + margin-right: 22px; + margin-top: 11px; + color: gray; + font-size: 14px + } + + /* 9、 内部框图进行相应的分割*/ + .line { + margin-top: 10px; + } + + /* .line { + width: 100%; + height: 1px; + background-color: #cccccc; + margin-top: 1px; + } */ + + /*10、设置按钮*/ + .loginBtnView { + width: 100%; + height: auto; + /* background-color:#DCDCDC; */ + margin-top: 0px; + margin-bottom: 0px; + padding-bottom: 0px; + } + + .loginBtn { + width: 90%; + margin-top: 40px; + border-radius:10px; + } + + /* 设置字体颜色 */ + .bxj{ + color: red; + } +/* 用来设置注册和忘记密码 */ + .saveBtn { + width: 50% !important; + float:left; + font-weight: 100; + font-size: 10px; + } + .submitBtn { + width: 50% !important; + float:right; + font-size: 10px + + } +.s_view{ + position: fixed; + width: 100%; +} + +/* 雪花效果特效 */ +page { + background: linear-gradient(180deg, #6699CC 0%, #B8DBF0 100%); + background-attachment: fixed; + background-size: cover; + background-position: center top; + height: 100%; +} + +.snow { + width: fit-content; + position: absolute; + top: -100rpx; + width: 30rpx; + height: 27rpx; + z-index: 11; +} + +.snow:nth-child(2n+2) { + width: 35rpx; + height: 33rpx; +} diff --git a/src/wechat_app/pages/v13_look_info/v13_look_info.js b/src/wechat_app/pages/v13_look_info/v13_look_info.js new file mode 100644 index 0000000..1c18152 --- /dev/null +++ b/src/wechat_app/pages/v13_look_info/v13_look_info.js @@ -0,0 +1,93 @@ +Page({ + + /** + * 页面的初始数据 + */ + data: { + select: false, + area: "全部", + tempgao:'', + tempzhong:'', + tempdi:'', + gao:'', + zhong:'', + di:'', + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + + }, + bindShowMsg() { + // console.log(!this.data.select) + this.setData({ + select:!this.data.select + // 选中为true + }) + }, + mySelect:function(e) { + var name = e.currentTarget.dataset.name + this.setData({ + area: name, + select: false, + gao:'', + zhong:'', + di:'' + + }) + + var that =this + wx.request({ + url: 'http://127.0.0.1:2020/look_info', + data: {name:this.data.area + }, + dataType:JSON , + method: 'POST', + timeout: 0, + success: (result) => { + var p =JSON.parse(result.data) + that.setData({ + tempgao:p.height, + tempzhong:p.middle, + tempdi:p.low + }) + // console.log(that.data.tempgao) + }, + }) + + }, + +// 高风险区触发函数 +gao_info:function(){ +this.setData({ + gao:this.data.tempgao, + zhong:'', + di:'' +}) +}, +//中风险区触发函数 +zhong_info:function(){ + this.setData({ + gao:'', + zhong:this.data.tempzhong, + di:'' + }) +}, +//低风险区触发函数 +di_info:function(){ + this.setData({ + gao:'', + zhong:'', + di:this.data.tempdi + }) +}, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + } +}) diff --git a/src/wechat_app/pages/v13_look_info/v13_look_info.json b/src/wechat_app/pages/v13_look_info/v13_look_info.json new file mode 100644 index 0000000..8835af0 --- /dev/null +++ b/src/wechat_app/pages/v13_look_info/v13_look_info.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/src/wechat_app/pages/v13_look_info/v13_look_info.wxml b/src/wechat_app/pages/v13_look_info/v13_look_info.wxml new file mode 100644 index 0000000..a391271 --- /dev/null +++ b/src/wechat_app/pages/v13_look_info/v13_look_info.wxml @@ -0,0 +1,55 @@ + + + 区域选择 + + + + + {{area}} + + + + + + + + + + + + + 全部 + 和平区 + 河东区 + 河西区 + 南开区 + 河北区 + 红桥区 + 塘沽区 + 汉沽区 + 大港区 + 东丽区 + 西青区 + 津南区 + 北辰区 + 武清区 + 宝坻区 + 宁河区 + 静海区 + 蓟州区 + 滨海新区 + + + + +{{item}} +---------------------------------------------- + + + {{item}} +---------------------------------------------- + + + {{item}} +---------------------------------------------- + diff --git a/src/wechat_app/pages/v13_look_info/v13_look_info.wxss b/src/wechat_app/pages/v13_look_info/v13_look_info.wxss new file mode 100644 index 0000000..974f328 --- /dev/null +++ b/src/wechat_app/pages/v13_look_info/v13_look_info.wxss @@ -0,0 +1,48 @@ +.list-msg { + padding: 0 20rpx; + background-color: #fff; + position: relative; +} + +.list-msg1 { + height: 60rpx; + display: flex; + align-items: center; + justify-content: space-between; +} + +.list-msg .list-msg2 { + height: 60rpx; + display: flex; + align-items: center; + justify-content: space-between; + border: 1px solid #ccc; + padding: 0 10rpx; +} + +.select_box { + background-color: #eee; + padding: 0 10rpx; + width: 93%; + position: absolute; + top: 130rpx; + z-index: 1; + overflow: hidden; + animation: myfirst 0.5s; +} + +@keyframes myfirst { + from { + height: 0rpx; + } + + to { + height: 210rpx; + } +} + +.select_one { + height: 60rpx; + line-height: 60rpx; + border-bottom: 1px solid #ccc; +} diff --git a/src/wechat_app/pages/v15_scan_the_code/v15_scan_the_code.js b/src/wechat_app/pages/v15_scan_the_code/v15_scan_the_code.js new file mode 100644 index 0000000..7439a3a --- /dev/null +++ b/src/wechat_app/pages/v15_scan_the_code/v15_scan_the_code.js @@ -0,0 +1,74 @@ +// pages/v15_scan_the_code/v15_scan_the_code.js +const app = getApp() + +Page({ + data: { + scan: '', + sno:'' + + }, + getScancode: function() { + // var _this = this; + // 允许从相机和相册扫码 + wx.scanCode({ + success: (res) => { + var jieguo = res.result; + console.log(jieguo) + + this.setData({ + scan: jieguo, + sno:app.globalData.globalsno + + }) + // console.log(result) + // console.log(this.data.result) + wx.request({ + url: 'http://127.0.0.1:2020/scan_the_code', + data: {shuju:this.data.scan, + sno:this.data.sno + }, + method:"POST", + dataType: JSON, + enableCache: true, + enableHttp2: true, + enableQuic: true, + timeout: 0, + success: (result) => { + var p =JSON.parse(result.data) + wx.showModal({ + showCancel:false, + title: p.result[0], + success: function (res) { + if (res.confirm) { + console.log('用户点击确定') + wx.navigateBack({ + delta: 0, + }) + } + } + }) + console.log(p.result[0]) + // if(result.data=='1'){ + // console.log("成功") + // } + + }, + fail: (result) => { + console.log("失败") + }, + + }) + + + } + }) + + }, + onLoad: function() { + this.getScancode(); + }, + + onShow() { + }, + +}) \ No newline at end of file diff --git a/src/wechat_app/pages/v15_scan_the_code/v15_scan_the_code.json b/src/wechat_app/pages/v15_scan_the_code/v15_scan_the_code.json new file mode 100644 index 0000000..8835af0 --- /dev/null +++ b/src/wechat_app/pages/v15_scan_the_code/v15_scan_the_code.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/src/wechat_app/pages/v15_scan_the_code/v15_scan_the_code.wxml b/src/wechat_app/pages/v15_scan_the_code/v15_scan_the_code.wxml new file mode 100644 index 0000000..0f8639b --- /dev/null +++ b/src/wechat_app/pages/v15_scan_the_code/v15_scan_the_code.wxml @@ -0,0 +1,7 @@ + + + + + \ No newline at end of file diff --git a/src/wechat_app/pages/v15_scan_the_code/v15_scan_the_code.wxss b/src/wechat_app/pages/v15_scan_the_code/v15_scan_the_code.wxss new file mode 100644 index 0000000..f886a8e --- /dev/null +++ b/src/wechat_app/pages/v15_scan_the_code/v15_scan_the_code.wxss @@ -0,0 +1,5 @@ +/* pages/v15_scan_the_code/v15_scan_the_code.wxss */ +.intro{ + margin:30px; + text-align:center; +} \ No newline at end of file diff --git a/src/wechat_app/pages/v16_user_state/v16_user_state.js b/src/wechat_app/pages/v16_user_state/v16_user_state.js new file mode 100644 index 0000000..e9596b4 --- /dev/null +++ b/src/wechat_app/pages/v16_user_state/v16_user_state.js @@ -0,0 +1,92 @@ +// pages/v16_user_state/v16_user_state.js +var app = getApp() +Page({ + + /** + * 页面的初始数据 + */ + data: { + sno:'' + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady() { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow(){ + this.setData({ + sno:app.globalData.globalsno + }) + wx.request({ + url: 'http://127.0.0.1:2020/state', + data: {sno:this.data.sno + }, + dataType:JSON , + method: 'POST', + timeout: 0, + success: (result) => { + wx.showModal({ + showCancel:false, + title: result.data, + success: function (res) { + if (res.confirm) { + console.log('用户点击确定') + wx.navigateBack({ + delta: 0, + }) + } + } + }) + }, + }) + + } , + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide() { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload() { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom() { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage() { + + } +}) \ No newline at end of file diff --git a/src/wechat_app/pages/v16_user_state/v16_user_state.json b/src/wechat_app/pages/v16_user_state/v16_user_state.json new file mode 100644 index 0000000..8835af0 --- /dev/null +++ b/src/wechat_app/pages/v16_user_state/v16_user_state.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/src/wechat_app/pages/v16_user_state/v16_user_state.wxml b/src/wechat_app/pages/v16_user_state/v16_user_state.wxml new file mode 100644 index 0000000..a5ec630 --- /dev/null +++ b/src/wechat_app/pages/v16_user_state/v16_user_state.wxml @@ -0,0 +1,2 @@ + + diff --git a/src/wechat_app/pages/v16_user_state/v16_user_state.wxss b/src/wechat_app/pages/v16_user_state/v16_user_state.wxss new file mode 100644 index 0000000..9a7d77e --- /dev/null +++ b/src/wechat_app/pages/v16_user_state/v16_user_state.wxss @@ -0,0 +1 @@ +/* pages/v16_user_state/v16_user_state.wxss */ diff --git a/src/wechat_app/pages/v19_test/v19_test.js b/src/wechat_app/pages/v19_test/v19_test.js new file mode 100644 index 0000000..bb17243 --- /dev/null +++ b/src/wechat_app/pages/v19_test/v19_test.js @@ -0,0 +1,22 @@ +// pages/fengguang/fengguang.js +Page({ + data:{ + + "items": [1,2,3,4], + number:[1,2,3,4,5,6] + + }, + + onReady:function(){ + // 页面渲染完成 + }, + onShow:function(){ + // 页面显示 + }, + onHide:function(){ + // 页面隐藏 + }, + onUnload:function(){ + // 页面关闭 + } +}) diff --git a/src/wechat_app/pages/v19_test/v19_test.json b/src/wechat_app/pages/v19_test/v19_test.json new file mode 100644 index 0000000..8835af0 --- /dev/null +++ b/src/wechat_app/pages/v19_test/v19_test.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/src/wechat_app/pages/v19_test/v19_test.wxml b/src/wechat_app/pages/v19_test/v19_test.wxml new file mode 100644 index 0000000..efd438b --- /dev/null +++ b/src/wechat_app/pages/v19_test/v19_test.wxml @@ -0,0 +1,4 @@ + + + + diff --git a/src/wechat_app/pages/v19_test/v19_test.wxss b/src/wechat_app/pages/v19_test/v19_test.wxss new file mode 100644 index 0000000..034dd74 --- /dev/null +++ b/src/wechat_app/pages/v19_test/v19_test.wxss @@ -0,0 +1,15 @@ +.header { + position: relative; + height:300rpx; + background: linear-gradient(to bottom, #56ccf2, #2f80ed); +} + +.bg_ware { + position: absolute; + left: 0; + bottom: -2rpx; + width: 100%; + mix-blend-mode: screen; + height: 120rpx; +} + diff --git a/src/wechat_app/pages/v6_administrator/v6_administrator.js b/src/wechat_app/pages/v6_administrator/v6_administrator.js new file mode 100644 index 0000000..427732e --- /dev/null +++ b/src/wechat_app/pages/v6_administrator/v6_administrator.js @@ -0,0 +1,156 @@ +// pages/v6_administrator/v6_administrator.js +Page({ + + /** + * 页面的初始数据 + */ + data: { + + swiperList: [ + { + type: 'video', + url: 'https://static.51dh.com.cn/dbp/12/98/4494bd8a6e0fcd4a992f25a42bea28f8d1fb.mp4' + }, { + type: 'image', + url: 'https://i.postimg.cc/mgsKJGLw/susu1.jpg' + }, { + + type: 'image', + url: 'https://i.postimg.cc/qRRLS16Q/susu0.jpg', + }, { + + type: 'image', + url: 'https://i.postimg.cc/pXDp6RXq/susu3.jpg' + }, { + + type: 'image', + url: 'https://i.postimg.cc/XJmpTvCD/susu2.jpg' + }, { + + type: 'image', + url: 'https://i.postimg.cc/76br1jzJ/susu1.jpg' + }, { + + type: 'image', + url: 'https://i.postimg.cc/pXDp6RXq/susu3.jpg' + }, + { + + type: 'image', + url: 'https://i.postimg.cc/XJmpTvCD/susu2.jpg' + }, + ], + + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + this.tauchSwiper('swiperList'); + }, + + // 初始化tauchSwiper + tauchSwiper(name) { + let list = this.data[name]; + for (let i = 0; i < list.length; i++) { + // Math.abs(x) 函数返回指定数字 “x“ 的绝对值 + list[i].zIndex = parseInt(list.length / 2) + 1 - Math.abs(i - parseInt(list.length / 2)) + list[i].mLeft = i - parseInt(list.length / 2) + } + this.setData({ + swiperList: list + }) + }, + // tauchSwiper触摸开始 + tauchStart(e) { + this.setData({ + tauchStart: e.touches[0].pageX + }) + }, + // tauchSwiper计算方向 + tauchMove(e) { + this.setData({ + direction: e.touches[0].pageX - this.data.tauchStart > 0 ? 'right' : 'left' + }) + }, + // tauchSwiper计算滚动 + tauchEnd(e) { + let direction = this.data.direction; + let list = this.data.swiperList; + if (direction == 'right') { + let mLeft = list[0].mLeft; + let zIndex = list[0].zIndex; + for (let i = 1; i < list.length; i++) { + list[i - 1].mLeft = list[i].mLeft + list[i - 1].zIndex = list[i].zIndex + } + list[list.length - 1].mLeft = mLeft; + list[list.length - 1].zIndex = zIndex; + this.setData({ + swiperList: list + }) + } else { + let mLeft = list[list.length - 1].mLeft; + let zIndex = list[list.length - 1].zIndex; + for (let i = list.length - 1; i > 0; i--) { + list[i].mLeft = list[i - 1].mLeft + list[i].zIndex = list[i - 1].zIndex + } + list[0].mLeft = mLeft; + list[0].zIndex = zIndex; + this.setData({ + swiperList: list + }) + } + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady() { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide() { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload() { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom() { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage() { + + } +}) \ No newline at end of file diff --git a/src/wechat_app/pages/v6_administrator/v6_administrator.json b/src/wechat_app/pages/v6_administrator/v6_administrator.json new file mode 100644 index 0000000..8835af0 --- /dev/null +++ b/src/wechat_app/pages/v6_administrator/v6_administrator.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/src/wechat_app/pages/v6_administrator/v6_administrator.wxml b/src/wechat_app/pages/v6_administrator/v6_administrator.wxml new file mode 100644 index 0000000..e08c71a --- /dev/null +++ b/src/wechat_app/pages/v6_administrator/v6_administrator.wxml @@ -0,0 +1,32 @@ + + + + + + + + + + 查看疫情信息 + + + + + 审批 + + + + + + + + + + + + + + + + + diff --git a/src/wechat_app/pages/v6_administrator/v6_administrator.wxss b/src/wechat_app/pages/v6_administrator/v6_administrator.wxss new file mode 100644 index 0000000..1b3083c --- /dev/null +++ b/src/wechat_app/pages/v6_administrator/v6_administrator.wxss @@ -0,0 +1,104 @@ +/* pages/index/index.wxss */ +.c1{ + color: red; +} +.image1{ + width: 200rpx; + height: 200rpx; + /* 如果要设置圆角的话 */ + border-radius: 100rpx; +} + .menu{ + display: flex; + /* 规定主轴的方向 */ + flex-direction: row; + /* 元素在主轴方向的排列方式 我用的是平均排列*/ + justify-content: space-around; + /* 元素在负轴方向如何展示 */ + /* align-items: center; */ + +} +/* 缺个空格差点g。 */ + .menu .item{ + display: flex; + flex-direction: column; + /* 元素在负轴方向如何展示 */ + align-items: center; +} + +/* 波浪的渲染 */ +.header { + position: relative; + height:450rpx; + background: linear-gradient(to bottom, #56ccf2, #2f80ed); +} + +.bg_ware { + position: absolute; + left: 0; + bottom: -2rpx; + width: 100%; + mix-blend-mode: screen; + height: 120rpx; +} + +/* 轮播图 */ +.swiper-item image, +.swiper-item video { + width: 100%; + display: block; + height: 100%; + margin: 0; + pointer-events: none; +} + +image { + max-width: 100%; + display: inline-block; + position: relative; + z-index: 0; +} + +.swiper-box { + height: 420rpx; + position: relative; + max-width: 750rpx; + overflow: hidden; + box-sizing: border-box; + margin-top: 90rpx; +} + +.swiper-box .item-box { + position: absolute; + width: 300rpx; + height: 380rpx; + top: 0; + bottom: 0; + left: 50%; + margin: auto; + transition: all 0.2s ease-in 0s; + opacity: 1; + box-shadow: 0px 13rpx 12rpx rgba(0, 0, 0, .5); + border-radius: 15rpx; + overflow: hidden; +} + +.swiper-box .item-box.none { + opacity: 0; +} + +.swiper-box .item-box .swiper-item { + width: 100%; + height: 100%; + border-radius: 6rpx; + overflow: hidden; +} + + +.swiper-box .item-box { + transform: scale(calc(0.5 + var(--index) / 10)); + margin-left: calc(var(--left) * 100rpx - 150rpx); + z-index: var(--index); +} + + diff --git a/src/wechat_app/project.config.json b/src/wechat_app/project.config.json new file mode 100644 index 0000000..841ae49 --- /dev/null +++ b/src/wechat_app/project.config.json @@ -0,0 +1,29 @@ +{ + "appid": "wx1be3d41368551c6d", + "projectname": "%E8%BD%AF%E4%BB%B6%E5%B7%A5%E7%A8%8B%E5%BC%80%E5%8F%91%E9%A1%B9%E7%9B%AE", + "compileType": "miniprogram", + "libVersion": "2.19.4", + "packOptions": { + "ignore": [], + "include": [] + }, + "setting": { + "coverView": true, + "es6": true, + "postcss": true, + "minified": true, + "enhance": true, + "showShadowRootInWxmlPanel": true, + "packNpmRelationList": [], + "compileHotReLoad": true, + "babelSetting": { + "ignore": [], + "disablePlugins": [], + "outputPath": "" + } + }, + "editorSetting": { + "tabIndent": "insertSpaces", + "tabSize": 2 + } +} \ No newline at end of file diff --git a/src/wechat_app/project.private.config.json b/src/wechat_app/project.private.config.json new file mode 100644 index 0000000..ab949bd --- /dev/null +++ b/src/wechat_app/project.private.config.json @@ -0,0 +1,89 @@ +{ + "description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html", + "condition": { + "miniprogram": { + "list": [ + { + "name": "", + "pathName": "pages/v8_in_school/v8_in_school", + "query": "", + "launchMode": "default", + "scene": null + }, + { + "name": "", + "pathName": "pages/v11_success/v11_success", + "query": "", + "launchMode": "default", + "scene": null + }, + { + "name": "", + "pathName": "pages/v9_manual/v9_manual", + "query": "", + "launchMode": "default", + "scene": null + }, + { + "name": "", + "pathName": "pages/info/info", + "query": "", + "launchMode": "default", + "scene": null + }, + { + "name": "", + "pathName": "pages/v19_test/v19_test", + "query": "", + "launchMode": "default", + "scene": null + }, + { + "name": "", + "pathName": "pages/v13_look_info/v13_look_info", + "query": "", + "launchMode": "default", + "scene": null + }, + { + "name": "", + "pathName": "pages/v15_scan_the_code/v15_scan_the_code", + "query": "", + "launchMode": "default", + "scene": null + }, + { + "name": "", + "pathName": "pages/v16_user_state/v16_user_state", + "query": "", + "launchMode": "default", + "scene": null + }, + { + "name": "", + "pathName": "pages/user/user", + "query": "", + "launchMode": "default", + "scene": null + }, + { + "name": "", + "pathName": "pages/v6_administrator/v6_administrator", + "query": "", + "launchMode": "default", + "scene": null + }, + { + "name": "", + "pathName": "pages/v7_out_school/v7_out_school", + "query": "", + "launchMode": "default", + "scene": null + } + ] + } + }, + "setting": { + "urlCheck": false + } +} \ No newline at end of file diff --git a/src/wechat_app/static/image/1.jpg b/src/wechat_app/static/image/1.jpg new file mode 100644 index 0000000..87b2b00 Binary files /dev/null and b/src/wechat_app/static/image/1.jpg differ diff --git a/src/wechat_app/static/image/2.jpg b/src/wechat_app/static/image/2.jpg new file mode 100644 index 0000000..0c3c542 Binary files /dev/null and b/src/wechat_app/static/image/2.jpg differ diff --git a/src/wechat_app/static/image/3.jpg b/src/wechat_app/static/image/3.jpg new file mode 100644 index 0000000..89095fa Binary files /dev/null and b/src/wechat_app/static/image/3.jpg differ diff --git a/src/wechat_app/static/image/CAUC.png b/src/wechat_app/static/image/CAUC.png new file mode 100644 index 0000000..7dd03bc Binary files /dev/null and b/src/wechat_app/static/image/CAUC.png differ diff --git a/src/wechat_app/static/image/apic2098.jpg b/src/wechat_app/static/image/apic2098.jpg new file mode 100644 index 0000000..a644e32 Binary files /dev/null and b/src/wechat_app/static/image/apic2098.jpg differ diff --git a/src/wechat_app/static/image/apic27858.jpg b/src/wechat_app/static/image/apic27858.jpg new file mode 100644 index 0000000..fb39876 Binary files /dev/null and b/src/wechat_app/static/image/apic27858.jpg differ diff --git a/src/wechat_app/static/image/background.jpg b/src/wechat_app/static/image/background.jpg new file mode 100644 index 0000000..2784dea Binary files /dev/null and b/src/wechat_app/static/image/background.jpg differ diff --git a/src/wechat_app/static/image/home-o.png b/src/wechat_app/static/image/home-o.png new file mode 100644 index 0000000..3324e9f Binary files /dev/null and b/src/wechat_app/static/image/home-o.png differ diff --git a/src/wechat_app/static/image/home.png b/src/wechat_app/static/image/home.png new file mode 100644 index 0000000..1e5c055 Binary files /dev/null and b/src/wechat_app/static/image/home.png differ diff --git a/src/wechat_app/static/image/my-o.png b/src/wechat_app/static/image/my-o.png new file mode 100644 index 0000000..f76ba80 Binary files /dev/null and b/src/wechat_app/static/image/my-o.png differ diff --git a/src/wechat_app/static/image/my.png b/src/wechat_app/static/image/my.png new file mode 100644 index 0000000..5ebb3df Binary files /dev/null and b/src/wechat_app/static/image/my.png differ