/// <summary> /// 添加到异常记录报表 /// </summary> /// <param name="model"></param> /// <returns></returns> public bool AddOpenGateRecord(OpenGateRecordModel model) { bool result = false; try { Dictionary <string, object> dicParam = new Dictionary <string, object>(); RequestFujicaStandard requestFujica = new RequestFujicaStandard(); string servername = "Park/UnderLineAddOpenGateRecord"; dicParam["ParkingCode"] = model.ParkingCode; dicParam["EntranceType"] = model.EntranceType; dicParam["EquipmentCode"] = model.DeviceIdentify; dicParam["ThroughName"] = model.ThroughName; dicParam["DiscernCamera"] = model.DiscernCamera; dicParam["ThroughType"] = model.ThroughType; dicParam["OpenGateTime"] = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); dicParam["OpenGateReason"] = model.OpenGateReason; dicParam["OpenGateOperator"] = model.OpenGateOperator; dicParam["Remarks"] = model.Remark; dicParam["ImageUrl"] = model.ImageUrl; result = requestFujica.RequestInterfaceV2(servername, dicParam); return(result); } catch (Exception ex) { m_logger.LogFatal(LoggerLogicEnum.Bussiness, "", model.ParkingCode, "", "Fujica.com.cn.Business.ParkLot.CarInOutManager.AddOpenGateRecord", "添加到异常记录报表时发生异常", ex.ToString()); return(false); } }
public IHttpActionResult OpenGate(Models.InPut.OpenGateRecordRequest model) { //考虑用异步的接口,然后实现返回拍照后的图片地址 ResponseBaseCommon response = new ResponseBaseCommon() { IsSuccess = true, MessageCode = (int)ApiBaseErrorCode.API_SUCCESS, MessageContent = ApiBaseErrorCode.API_SUCCESS.ToString() }; if (string.IsNullOrWhiteSpace(model.ParkingCode) || string.IsNullOrWhiteSpace(model.DeviceIdentify)) { response.IsSuccess = false; response.MessageCode = (int)ApiBaseErrorCode.API_PARAM_ERROR; response.MessageContent = "必要参数缺失,请检查"; return(Ok(response)); } OpenGateRecordModel content = new OpenGateRecordModel() { // Guid = Guid.NewGuid().ToString("N"), ParkingCode = model.ParkingCode, DeviceIdentify = model.DeviceIdentify, CarType = model.CarType, EntranceType = model.EntranceType, ThroughName = model.ThroughName, DiscernCamera = model.DiscernCamera, ThroughType = model.ThroughType, OpenGateOperator = model.OpenGateOperator, OpenGateReason = model.OpenGateReason, Remark = model.Remark, ImageUrl = model.ImageUrl, ErrorCode = model.ErrorCode, CarNo = model.CarNo }; if (!_openGateReasonManager.OpenGate(content)) { response.IsSuccess = false; response.MessageCode = (int)ApiBaseErrorCode.API_FAIL; response.MessageContent = ApiBaseErrorCode.API_FAIL.ToString(); } return(Ok(response)); }
/// <summary> /// 手动开闸--出口未识别到车牌(添加到异常记录报表) /// --出口识别到车牌(如果是临时车则添加免费临停车缴费记录) /// --入口开闸 未识别到车牌 (添加到异常记录报表) /// </summary> /// <param name="model">异常开闸记录</param> /// <returns></returns> public bool OpenGate(OpenGateRecordModel model) { bool result = false; try { if (model.EntranceType == 1) //出口 { /// 404-禁止无牌车 407-无压地感车辆 加到 "异常开闸记录" if ((model.ErrorCode != "404") || (model.ErrorCode != "407")) //识别到车牌 { if (model.CarType == "0" && model.ErrorCode != "13") //如果是临时车(并且有入场记录)则添加临停车缴费记录 { FreeOpenGateModel freemodel = new FreeOpenGateModel() { ParkingCode = model.ParkingCode, DeviceIdentify = model.DeviceIdentify, TolloPerator = model.OpenGateOperator, CarNo = model.CarNo, Remark = model.Remark }; result = ChargeOpenGate(freemodel); } else { result = AddOpenGateRecord(model); // if(result) //先执行扣费 //{ //if (model.CarType == "2" && model.ErrorCode != "13") //如果是储值车(并且有入场记录) //{ // ValueCardFeeModel valueCardFeeModel = new ValueCardFeeModel() // { // ParkingCode=model.ParkingCode, // CarNo=model.CarNo // }; // _cardServiceManager.GetValueCardFeeInfoByCarNo(valueCardFeeModel); //} // } //在发送出场命令 result = OpenGateToCamera(new OpenGateModel() { DeviceIdentify = model.DeviceIdentify, OpenType = OpenTypeEnum.Manual, Operator = model.OpenGateOperator, Remark = model.Remark }, model.ParkingCode); } } else //出口未识别到车牌 { // 添加到异常记录报表 result = AddOpenGateRecord(model); if (result) { result = OpenGateToCamera(new OpenGateModel() { DeviceIdentify = model.DeviceIdentify, OpenType = OpenTypeEnum.Manual, Operator = model.OpenGateOperator, Remark = model.Remark }, model.ParkingCode); } } } else { if ((model.ErrorCode == "404") || (model.ErrorCode == "407")) //入口 未识别到车牌 (添加到异常记录报表) { // 添加到异常记录报表 result = AddOpenGateRecord(model); } result = OpenGateToCamera(new OpenGateModel() { DeviceIdentify = model.DeviceIdentify, OpenType = OpenTypeEnum.Manual, Operator = model.OpenGateOperator, Remark = model.Remark }, model.ParkingCode); } return(result); } catch (Exception ex) { m_logger.LogFatal(LoggerLogicEnum.Bussiness, "", model.ParkingCode, model.CarNo, "Fujica.com.cn.Business.ParkLot.CarInOutManager.OpenGate", "手动开闸时发生异常", ex.ToString()); return(false); } }