| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071 |
- 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
- {
- /// <summary>
- /// 业务处理 停止扫描
- /// </summary>
- public class biz_stopScan
- {
- /// <summary>
- /// 主业务
- /// </summary>
- /// <param name="connId"></param>
- /// <param name="data"></param>
- 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());
- }
- /// <summary>
- /// 停止扫描及构造返回值
- /// </summary>
- /// <param name="connId"></param>
- /// <param name="data"></param>
- /// <returns></returns>
- 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;
- }
- }
- }
|