RuralPowerCompetition_yizhe.../Test/Program.cs

55 lines
13 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using RuralPower;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Test
{
internal class Program
{
static void Main(string[] args)
{
RuralPowerAPI test = new RuralPowerAPI();
//var result = test.Login("http://umayle.com:8092", "SQ002", "", "kfb263");
var result = test.GetExam("","123", "3", AppDomain.CurrentDomain.BaseDirectory);
var result2 = test.StartExam("", "048dd77b0a734856a86153e2feaa1d1d", "123");
var result3 = test.AddUserTool("", "{\"UserId\":\"123\",\"ExamId\":\"048dd77b0a734856a86153e2feaa1d1d\",\"Purpose\":\"巡线\",\"Tool\":[{\"ToolName\":\"红外热成像\",\"Quantity\":1}]}");
var result6 = test.AddUserFaultRecord("", "{\"ExamId\":\"048dd77b0a734856a86153e2feaa1d1d\",\"UserId\":\"123\",\"Data\":[{\"Cache_Key\":\"2_0_-1_3_-1\",\"Cache_Content\":\"变压器台架-411东线-无剩余电流断路器试验记录卡-一般缺陷\",\"Cache_Value\":\"配电箱-0-无剩余电流断路器试验记录卡-0\",\"FaultId\":\"b5f840480cd311eda2ff7cd30a92bb1c\",\"FaultType\":\"配电箱\",\"Type\":\"配电箱\",\"FaultDesc\":\"无剩余电流断路器试验记录卡\",\"RootDeviceId\":\"6b8da25e0c0d11ed844e7cd30a92bb1c\",\"DeviceId\":\"6b8da25e0c0d11ed844e7cd30a92bb1c\",\"DefectLevel\":\"一般\",\"IsCorrect\":\"1\",\"Answer\":\"\",\"Content\":\"变压器台架-411东线-无剩余电流断路器试验记录卡-一般缺陷\",\"Value\":\"\"},{\"Cache_Key\":\"2_0_-1_5_-1\",\"Cache_Content\":\"变压器台架-411东线-配电箱杂物-一般缺陷\",\"Cache_Value\":\"配电箱-0-配电箱杂物-0\",\"FaultId\":\"bf68cc5c0cd311eda2ff7cd30a92bb1c\",\"FaultType\":\"配电箱\",\"Type\":\"配电箱\",\"FaultDesc\":\"配电箱杂物\",\"RootDeviceId\":\"6b8da25e0c0d11ed844e7cd30a92bb1c\",\"DeviceId\":\"6b8da25e0c0d11ed844e7cd30a92bb1c\",\"DefectLevel\":\"一般\",\"IsCorrect\":\"1\",\"Answer\":\"\",\"Content\":\"变压器台架-411东线-配电箱杂物-一般缺陷\",\"Value\":\"\"},{\"Cache_Key\":\"2_0_-1_4_-1\",\"Cache_Content\":\"变压器台架-411东线-配电箱孔洞未封堵-一般缺陷\",\"Cache_Value\":\"配电箱-0-配电箱孔洞未封堵-0\",\"FaultId\":\"43b034330e7011eda2ff7cd30a92bb1c\",\"FaultType\":\"配电箱\",\"Type\":\"配电箱\",\"FaultDesc\":\"配电箱孔洞未封堵\",\"RootDeviceId\":\"6b8da25e0c0d11ed844e7cd30a92bb1c\",\"DeviceId\":\"6b8da25e0c0d11ed844e7cd30a92bb1c\",\"DefectLevel\":\"一般\",\"IsCorrect\":\"1\",\"Answer\":\"\",\"Content\":\"变压器台架-411东线-配电箱孔洞未封堵-一般缺陷\",\"Value\":\"\"},{\"Cache_Key\":\"2_0_-1_1_-1\",\"Cache_Content\":\"变压器台架-411东线-出线开关编号牌缺失-一般缺陷\",\"Cache_Value\":\"配电箱-0-出线开关编号牌缺失-0\",\"FaultId\":\"f5d5b6bf0ee211eda2ff7cd30a92bb1c\",\"FaultType\":\"配电箱\",\"Type\":\"配电箱\",\"FaultDesc\":\"出线开关编号牌缺失\",\"RootDeviceId\":\"6b8da25e0c0d11ed844e7cd30a92bb1c\",\"DeviceId\":\"9d8da9360c0f11ed844e7cd30a92bb1c\",\"DefectLevel\":\"一般\",\"IsCorrect\":\"1\",\"Answer\":\"\",\"Content\":\"变压器台架-411东线-出线开关编号牌缺失-一般缺陷\",\"Value\":\"\"},{\"Cache_Key\":\"2_0_-1_9_1\",\"Cache_Content\":\"变压器台架-411东线-熔芯损坏-B相-一般缺陷\",\"Cache_Value\":\"配电箱-0-熔芯损坏-B相\",\"FaultId\":\"6aa962530ee311eda2ff7cd30a92bb1c\",\"FaultType\":\"配电箱\",\"Type\":\"配电箱\",\"FaultDesc\":\"熔芯损坏\",\"RootDeviceId\":\"6b8da25e0c0d11ed844e7cd30a92bb1c\",\"DeviceId\":\"9d8da9360c0f11ed844e7cd30a92bb1c\",\"DefectLevel\":\"一般\",\"IsCorrect\":\"1\",\"Answer\":\"\",\"Content\":\"变压器台架-411东线-熔芯损坏-B相-一般缺陷\",\"Value\":\"B相熔芯\"},{\"Cache_Key\":\"2_0_-1_13_-1\",\"Cache_Content\":\"变压器台架-411东线-漏电保护设置不合理-一般缺陷\",\"Cache_Value\":\"配电箱-0-漏电保护设置不合理-0\",\"FaultId\":\"5c6ad4320e4811eda2ff7cd30a92bb1c\",\"FaultType\":\"智能开关参数\",\"Type\":\"断路器\",\"FaultDesc\":\"漏电保护设置不合理\",\"RootDeviceId\":\"6b8da25e0c0d11ed844e7cd30a92bb1c\",\"DeviceId\":\"f3a279fc50e14420a0be0098843d849f\",\"DefectLevel\":\"一般\",\"IsCorrect\":\"1\",\"Answer\":\"\",\"Content\":\"变压器台架-411东线-漏电保护设置不合理-一般缺陷\",\"Value\":\"\"},{\"Cache_Key\":\"2_0_-1_15_-1\",\"Cache_Content\":\"变压器台架-411东线-短路延时保护设置错误-一般缺陷\",\"Cache_Value\":\"配电箱-0-短路延时保护设置错误-0\",\"FaultId\":\"179528ae0e4911eda2ff7cd30a92bb1c\",\"FaultType\":\"智能开关参数\",\"Type\":\"断路器\",\"FaultDesc\":\"短路延时保护设置错误\",\"RootDeviceId\":\"6b8da25e0c0d11ed844e7cd30a92bb1c\",\"DeviceId\":\"f3a279fc50e14420a0be0098843d849f\",\"DefectLevel\":\"一般\",\"IsCorrect\":\"1\",\"Answer\":\"\",\"Content\":\"变压器台架-411东线-短路延时保护设置错误-一般缺陷\",\"Value\":\"\"},{\"Cache_Key\":\"2_0_-1_19_-1\",\"Cache_Content\":\"变压器台架-411东线-缺相保护设置错误-一般缺陷\",\"Cache_Value\":\"配电箱-0-缺相保护设置错误-0\",\"FaultId\":\"a74335e00e4911eda2ff7cd30a92bb1c\",\"FaultType\":\"智能开关参数\",\"Type\":\"断路器\",\"FaultDesc\":\"缺相保护设置错误\",\"RootDeviceId\":\"6b8da25e0c0d11ed844e7cd30a92bb1c\",\"DeviceId\":\"f3a279fc50e14420a0be0098843d849f\",\"DefectLevel\":\"一般\",\"IsCorrect\":\"1\",\"Answer\":\"\",\"Content\":\"变压器台架-411东线-缺相保护设置错误-一般缺陷\",\"Value\":\"\"},{\"Cache_Key\":\"0_0_1_17_3\",\"Cache_Content\":\"杆塔-411东线-002#杆-拉线松动-北侧-一般缺陷\",\"Cache_Value\":\"杆塔-002#杆-拉线松动-北侧\",\"FaultId\":\"efe4fa570f2911eda2ff7cd30a92bb1c\",\"FaultType\":\"线路拉线类\",\"Type\":\"杆塔\",\"FaultDesc\":\"拉线松动\",\"RootDeviceId\":\"e8fc27440c0c11ed844e7cd30a92bb1c\",\"DeviceId\":\"e8fc27440c0c11ed844e7cd30a92bb1c\",\"DefectLevel\":\"一般\",\"IsCorrect\":\"1\",\"Answer\":\"\",\"Content\":\"杆塔-411东线-002#杆-拉线松动-北侧-一般缺陷\",\"Value\":\"北侧\"},{\"Cache_Key\":\"0_0_2_8_-1\",\"Cache_Content\":\"杆塔-411东线-003#杆-电杆倾斜-一般缺陷\",\"Cache_Value\":\"杆塔-003#杆-电杆倾斜-0\",\"FaultId\":\"fba33ff70f2c11eda2ff7cd30a92bb1c\",\"FaultType\":\"线路杆塔类\",\"Type\":\"杆塔\",\"FaultDesc\":\"电杆倾斜\",\"RootDeviceId\":\"04c4be780c0d11ed844e7cd30a92bb1c\",\"DeviceId\":\"04c4be780c0d11ed844e7cd30a92bb1c\",\"DefectLevel\":\"一般\",\"IsCorrect\":\"1\",\"Answer\":\"\",\"Content\":\"杆塔-411东线-003#杆-电杆倾斜-一般缺陷\",\"Value\":\"\"},{\"Cache_Key\":\"0_0_3_3_-1\",\"Cache_Content\":\"杆塔-411东线-004#杆-通道有异物-一般缺陷\",\"Cache_Value\":\"杆塔-004#杆-通道有异物-0\",\"FaultId\":\"7dee2ed80f2611eda2ff7cd30a92bb1c\",\"FaultType\":\"线路通道类\",\"Type\":\"杆塔\",\"FaultDesc\":\"通道有异物\",\"RootDeviceId\":\"0903073e0c0d11ed844e7cd30a92bb1c\",\"DeviceId\":\"0903073e0c0d11ed844e7cd30a92bb1c\",\"DefectLevel\":\"一般\",\"IsCorrect\":\"1\",\"Answer\":\"\",\"Content\":\"杆塔-411东线-004#杆-通道有异物-一般缺陷\",\"Value\":\"\"},{\"Cache_Key\":\"0_0_4_4_-1\",\"Cache_Content\":\"杆塔-411东线-005#杆-鸟巢-一般缺陷\",\"Cache_Value\":\"杆塔-005#杆-鸟巢-0\",\"FaultId\":\"a072a2360f2711eda2ff7cd30a92bb1c\",\"FaultType\":\"线路通道类\",\"Type\":\"杆塔\",\"FaultDesc\":\"鸟巢\",\"RootDeviceId\":\"0eb9ec5f0c0d11ed844e7cd30a92bb1c\",\"DeviceId\":\"0eb9ec5f0c0d11ed844e7cd30a92bb1c\",\"DefectLevel\":\"一般\",\"IsCorrect\":\"1\",\"Answer\":\"\",\"Content\":\"杆塔-411东线-005#杆-鸟巢-一般缺陷\",\"Value\":\"\"},{\"Cache_Key\":\"0_0_5_9_-1\",\"Cache_Content\":\"杆塔-411东线-006#杆-电杆杆身露筋、有裂纹-一般缺陷\",\"Cache_Value\":\"杆塔-006#杆-电杆杆身露筋、有裂纹-0\",\"FaultId\":\"dce4e74d0f2b11eda2ff7cd30a92bb1c\",\"FaultType\":\"线路杆塔类\",\"Type\":\"杆塔\",\"FaultDesc\":\"电杆杆身露筋、有裂纹\",\"RootDeviceId\":\"15b709dc0c0d11ed844e7cd30a92bb1c\",\"DeviceId\":\"15b709dc0c0d11ed844e7cd30a92bb1c\",\"DefectLevel\":\"一般\",\"IsCorrect\":\"1\",\"Answer\":\"\",\"Content\":\"杆塔-411东线-006#杆-电杆杆身露筋、有裂纹-一般缺陷\",\"Value\":\"\"},{\"Cache_Key\":\"0_0_5_12_-1\",\"Cache_Content\":\"杆塔-411东线-006#杆-横担锈蚀-一般缺陷\",\"Cache_Value\":\"杆塔-006#杆-横担锈蚀-0\",\"FaultId\":\"74ea1f530f4111eda2ff7cd30a92bb1c\",\"FaultType\":\"线路金具类\",\"Type\":\"杆塔\",\"FaultDesc\":\"横担锈蚀\",\"RootDeviceId\":\"15b709dc0c0d11ed844e7cd30a92bb1c\",\"DeviceId\":\"8cd1dc640c0d11ed844e7cd30a92bb1c\",\"DefectLevel\":\"一般\",\"IsCorrect\":\"1\",\"Answer\":\"\",\"Content\":\"杆塔-411东线-006#杆-横担锈蚀-一般缺陷\",\"Value\":\"\"},{\"Cache_Key\":\"0_0_6_20_3\",\"Cache_Content\":\"杆塔-411东线-007#杆-接头发热-N相-一般缺陷\",\"Cache_Value\":\"杆塔-007#杆-接头发热-N相\",\"FaultId\":\"ff957c080f2a11eda2ff7cd30a92bb1c\",\"FaultType\":\"接户线\",\"Type\":\"杆塔\",\"FaultDesc\":\"接头发热\",\"RootDeviceId\":\"20c4d6b40c0d11ed844e7cd30a92bb1c\",\"DeviceId\":\"20c4d6b40c0d11ed844e7cd30a92bb1c\",\"DefectLevel\":\"一般\",\"IsCorrect\":\"1\",\"Answer\":\"\",\"Content\":\"杆塔-411东线-007#杆-接头发热-N相-一般缺陷\",\"Value\":\"N相\"},{\"Cache_Key\":\"1_0_2_4_3\",\"Cache_Content\":\"线档-411东线-003#-004#杆-线路弧垂不一致-N相-一般缺陷\",\"Cache_Value\":\"线档-003#-004#杆-线路弧垂不一致-N相\",\"FaultId\":\"7e5b23890fce11eda2ff7cd30a92bb1c\",\"FaultType\":\"线路导线类\",\"Type\":\"线档\",\"FaultDesc\":\"线路弧垂不一致\",\"RootDeviceId\":\"269657410c0d11ed844e7cd30a92bb1c\",\"DeviceId\":\"a2c582520c0d11ed844e7cd30a92bb1c\",\"DefectLevel\":\"一般\",\"IsCorrect\":\"1\",\"Answer\":\"\",\"Content\":\"线档-411东线-003#-004#杆-线路弧垂不一致-N相-一般缺陷\",\"Value\":\"N相\"},{\"Cache_Key\":\"1_0_4_3_-1\",\"Cache_Content\":\"线档-411东线-005#-006#杆-鱼塘附近没有垂钓警示牌-一般缺陷\",\"Cache_Value\":\"线档-005#-006#杆-鱼塘附近没有垂钓警示牌-0\",\"FaultId\":\"44348f400fce11eda2ff7cd30a92bb1c\",\"FaultType\":\"线路通道类\",\"Type\":\"线档\",\"FaultDesc\":\"鱼塘附近没有垂钓警示牌\",\"RootDeviceId\":\"269657410c0d11ed844e7cd30a92bb1c\",\"DeviceId\":\"adae7d710c0d11ed844e7cd30a92bb1c\",\"DefectLevel\":\"一般\",\"IsCorrect\":\"1\",\"Answer\":\"\",\"Content\":\"线档-411东线-005#-006#杆-鱼塘附近没有垂钓警示牌-一般缺陷\",\"Value\":\"\"}]}");
var result4 = test.EndExam("", "048dd77b0a734856a86153e2feaa1d1d", "123");
var result5 = test.GetAnswer("048dd77b0a734856a86153e2feaa1d1d", "123", 1);
//var result = test.UploadFile("http://192.168.1.213:8088", "c7080a513ec043f2baf695e866efcb67", "USER202204211516089625", "测试", "C:\\Users\\Public\\Nwt\\cache\\recv\\吕浩\\04_user-2022-08-18-52150s-800x600.mp4");
//Console.WriteLine(result);
//Font LabelFont = new Font("Adobe 黑体 Std R", 50); //设置字体、字号、是否加粗
//SolidBrush labelColor = new SolidBrush(Color.Black);//设置字体颜色
//MemoryStream ms = new MemoryStream(File.ReadAllBytes(AppDomain.CurrentDomain.BaseDirectory + "/Img/BaseMap.jpg"));//底图
//Image imgSource = Image.FromStream(ms);//底图
//Graphics graphics = Graphics.FromImage(imgSource);//设置画图对象
//StringFormat sf = new StringFormat();//位置对象
//sf.Alignment = StringAlignment.Near;//左对齐,使用时看一下注释,尝试一下,和矩形框有关系
// //sf.Alignment = StringAlignment.Center;//居中
// //sf.Alignment = StringAlignment.Near;//右对齐
//Rectangle rt1 = new Rectangle(240, 155, imgSource.Width, imgSource.Height);//绘图区域框0x方向开始位置20y方向开始位置宽和高是矩形的宽和高
//graphics.DrawString("敏慧1#配变0.4kV411东线出线电缆", LabelFont, labelColor, rt1, sf);
//Rectangle rt2 = new Rectangle(240, 230, imgSource.Width, imgSource.Height);
//graphics.DrawString("敏慧1#配变低压综合配电箱411熔断器", LabelFont, labelColor, rt2, sf);
//Rectangle rt3 = new Rectangle(240, 305, imgSource.Width, imgSource.Height);
//graphics.DrawString("敏慧1#配变0.4kV411东线001#杆", LabelFont, labelColor, rt3, sf);
//Rectangle rt4 = new Rectangle(360, 380, imgSource.Width, imgSource.Height);
//graphics.DrawString("YJLV22-4*150/12米", LabelFont, labelColor, rt4, sf);
//Rectangle rt5 = new Rectangle(360, 455, imgSource.Width, imgSource.Height);
//graphics.DrawString("配电工程处", LabelFont, labelColor, rt5, sf);
//Rectangle rt6 = new Rectangle(240, 530, imgSource.Width, imgSource.Height);
//graphics.DrawString("2019年8月16日", LabelFont, labelColor, rt6, sf);
////graphics.DrawString("另一种写法我在x、y位置", LabelFont, labelColor, x, y);//相对于左上角的x、y坐标
//imgSource.Save(AppDomain.CurrentDomain.BaseDirectory +"测试.jpg");
//graphics.Dispose();
}
}
}