using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.IO; using System.Threading; using Newtonsoft.Json; using Saraff.Twain; using HXX.Scanner.Socket; using HXX.Scanner.Common; namespace HXX.Scanner.Biz.Socket { /// /// 业务处理 停止扫描 /// public class biz_stopScan { /// /// 主业务 /// /// /// public static void Work(IntPtr connId, cmd_stopScan data) { var response = work_detail(connId, data); //SocketServerManager.Send_Family(connId, response.ToJson()); SocketServerManager.Send_Single(connId, response.ToJson()); } /// /// 停止扫描及构造返回值 /// /// /// /// public static response_stopScan work_detail(IntPtr connId, cmd_stopScan data) { //修改环境参数为停止(真实停止业务根据本值做实时判断和操作) config_environment.scan_state = false; var response = new response_stopScan() { param = new response_stopScanSub() }; try { if (config_environment.web_parameter != null) { response.param.examId = config_environment.web_parameter.examId; response.param.examPaperId = config_environment.web_parameter.examPaperId; response.param.scanCount = new biz_db().get_count_by_seq(config_environment.web_parameter.batchNumber, config_environment.web_parameter.zipId, config_environment.web_parameter.paperSchema); config_environment.web_parameter.examPaperId = "0"; } } catch (Exception ee) { LogManager.WriteLog(ee); response.code = 500; response.msg = ee.Message; } return response; } } }