| | |
| | | TN_WM_TASKEntity transportTask = DALCreator.Create<DapperDAL<TN_WM_TASKEntity>>().GetSingleEntity(new { CN_S_TASK_NO = data.taskNo }); |
| | | |
| | | WebServiceAgent jxAgent = new WebServiceAgent(jxWebUrl); |
| | | object[] para = { clientKey1, clientKey2, transportTask.CN_S_REMARK, transportTask.CN_S_TRAY_CODE, transportTask.CN_S_END_BIT, "80", "Y", "hh" }; |
| | | object[] para = { clientKey1, clientKey2, transportTask.CN_S_REMARK, transportTask.CN_S_TRAY_CODE, transportTask.CN_S_END_BIT, "80", "Y", "hh" }; |
| | | |
| | | object returnObject = jxAgent.Invoke("SetAGVJobStatus", para); |
| | | // HH.WMS.JX.JXWMSServices.WebServiceSoapClient jxServices = new JX.JXWMSServices.WebServiceSoapClient(); |
| | |
| | | } |
| | | return JsonConvert.SerializeObject(result); |
| | | } |
| | | #endregion |
| | | |
| | | #region 中策 |
| | | /// <summary> |
| | | /// 改道 |
| | | /// </summary> |
| | | /// <param name="param"></param> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | public string ChangeWay(dynamic param) |
| | | { |
| | | var logPara = new TOOLS.LOG.LogPara("改道"); |
| | | logPara.Push("接口请求参数:" + JsonConvert.SerializeObject(param)); |
| | | |
| | | var result = new ChangeWayResult() { success = false, errCode = "200", location = "" }; |
| | | try |
| | | { |
| | | //任务号 |
| | | string taskNo = param.taskNo; |
| | | //改道类型(起点/终点) |
| | | string updateType = param.updateType; |
| | | //改道类型对应的原因 |
| | | string reasonCode = param.reasonCode; |
| | | if (string.IsNullOrEmpty(taskNo)) |
| | | { |
| | | result.errMsg = "任务号不可为空"; |
| | | result.errCode = "102"; |
| | | } |
| | | if (string.IsNullOrEmpty(updateType) || !(updateType.Equals("起点") || updateType.Equals("终点"))) |
| | | { |
| | | result.errMsg += " 改道类型不正确"; |
| | | result.errCode = "102"; |
| | | } |
| | | if (taskNo.Split('_').Length <= 1) |
| | | { |
| | | result.errMsg += " 主任务无法变更起点"; |
| | | result.errCode = "102"; |
| | | } |
| | | string preTaskNo = taskNo.Split('_')[0] + "_1"; |
| | | string navTaskNo = taskNo.Split('_')[1]; |
| | | if (navTaskNo != "2") |
| | | { |
| | | result.errMsg += " 当前任务无前置任务,不支持变更起点"; |
| | | result.errCode = "102"; |
| | | } |
| | | var preTask = BLLCreator.Create<DapperBLL<TN_WM_TASKEntity>>().GetSingleEntity(new { CN_S_TASK_NO = preTaskNo }); |
| | | if (preTask == null) |
| | | { |
| | | result.errMsg += "未找到此任务的主任务,任务号:" + taskNo; |
| | | result.errCode = "102"; |
| | | } |
| | | var currentTask = BLLCreator.Create<DapperBLL<TN_WM_TASKEntity>>().GetSingleEntity(new { CN_S_TASK_NO = taskNo }); |
| | | if (currentTask == null) |
| | | { |
| | | result.errMsg += "未找到此任务,任务号:" + taskNo; |
| | | result.errCode = "102"; |
| | | } |
| | | // 主任务的立库接驳位 |
| | | string connectBit = preTask.CN_S_END_BIT; |
| | | AutoBomLocationEntity locationModel = DALCreator.Create<TN_WMS_LOCATIONDAL>().GetModel(connectBit); |
| | | var locationArea = DALCreator.Create<TN_AB_STOCK_LOCATIONDAL>().GetAreaModelByLocation(connectBit); |
| | | if (locationModel == null) |
| | | { |
| | | result.errMsg += "未找到接驳位货位:" + connectBit; |
| | | result.errCode = "102"; |
| | | } |
| | | if (locationModel.CN_S_LOCATION_STATE != Constants.Location_State_Normal) |
| | | { |
| | | result.errMsg += "接驳位货位:" + connectBit + "存在未执行完的任务"; |
| | | result.errCode = "102"; |
| | | } |
| | | |
| | | if (result.errCode == "200") |
| | | { |
| | | var sqlResult = BLLCreator.Create<TN_WM_TASKBLL>().ChangeWay(currentTask, locationModel, locationArea,"start"); |
| | | |
| | | if (!sqlResult.Success) |
| | | result.errMsg = sqlResult.Msg; |
| | | else |
| | | { |
| | | result.success = true; |
| | | result.errCode = "100"; |
| | | result.location = connectBit; |
| | | } |
| | | } |
| | | |
| | | if (result.success) |
| | | { |
| | | logPara.PushAndAdd("改道成功!"); |
| | | } |
| | | else |
| | | { |
| | | logPara.PushAndAdd("改道失败,原因:" + result.errMsg); |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | result.errCode = "200"; |
| | | result.errMsg = "ChangeWay方法异常" + ex.Message + ex.StackTrace; |
| | | logPara.PushAndAdd(ex); |
| | | } |
| | | return JsonConvert.SerializeObject(result); |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | #region 宇寿 叫料 |
| | |
| | | AutoBomLocationEntity locationEntity = DALCreator.Create<TN_WMS_LOCATIONDAL>().GetModel(entity.CN_S_START_BIT); |
| | | entity.CN_S_STOCK_CODE = locationEntity.CN_S_STOCK_CODE; |
| | | entity.CN_N_PRIORITY = 1; |
| | | // entity.CN_S_END_BIT = GetEndBit(entity.CN_S_START_BIT); |
| | | // entity.CN_S_END_BIT = GetEndBit(entity.CN_S_START_BIT); |
| | | string postData = "{\"appCode\":\"" + Constants.appCode + "\",\"ruleName\":\"" + Constants.Rule_TransTaskNo + "\",\"orgId\":\"\",\"orgFlag\":\"0\"}"; |
| | | string taskNo = WebApiManager.HttpAutoBom_Post("api/BillRule/GenBillNo", postData); |
| | | if (string.IsNullOrEmpty(taskNo)) |
| | |
| | | |
| | | ZCReceiveTaskEntity sendTaskEntity = JsonConvert.DeserializeObject<ZCReceiveTaskEntity>(jsonData.ToString()); |
| | | |
| | | if(string.IsNullOrEmpty(sendTaskEntity.BUSI_TYPE)) |
| | | if (string.IsNullOrEmpty(sendTaskEntity.BUSI_TYPE)) |
| | | { |
| | | Log.Detail(logPara, "ZCSendTask任务下发失败,缺少参数BUSI_TYPE。" + jsonData.ToString()); |
| | | return new |