| | |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | #region 拆箱小卫 |
| | | [Route("CheckBarcodeController/UnpackMiddleBox")] |
| | | [HttpGet] |
| | | public object UnpackMiddleBox(string HBarCode_Middle,int signal,string HMaker,string HDate) |
| | | { |
| | | try |
| | | { |
| | | if(signal==1)//扫码 |
| | | { |
| | | DataSet ds = oCn.RunProcReturn("select a.HCaseCode 中箱码,a.HBarCode 对应的SN码,b.HNumber 物料代码,b.HName 物料名称 from Gy_CaseCodeRelation a left join Gy_Material b on a.HMaterID=b.HItemID where HCaseCode='" + HBarCode_Middle + "'", "Gy_CaseCodeRelation"); |
| | | if (ds.Tables[0].Rows[0]["中箱码"].ToString() =="" || ds == null) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "条码不存在!请检查是否装箱"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "成功"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | return objJsonResult; |
| | | |
| | | } |
| | | else |
| | | { |
| | | oCn.BeginTran(); |
| | | oCn.RunProc("delete from Gy_CaseCodeRelation where HCaseCode='"+ HBarCode_Middle+"'"); |
| | | DataSet dss = oCn.RunProcReturn("select * from Gy_BarCodeBill where HBarCode=' "+ HBarCode_Middle + "'", "Gy_BarCodeBill"); |
| | | if(dss!=null&&dss.Tables.Count>0) |
| | | { |
| | | oCn.RunProc("delete from Gy_BarCodeBill where HBarCode='"+ HBarCode_Middle + "'"); |
| | | } |
| | | oCn.RunProc("insert into System_log VALUES('"+ HDate + "','"+HMaker+"','',"+ "'小卫拆箱条码"+ HBarCode_Middle + "',"+ "'APP-中箱码拆箱'"+",'',"+ "'删除条码')"); |
| | | oCn.Commit(); |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "成功"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | |
| | | } |
| | | catch (Exception) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "错误请联系管理员"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | } |
| | | } |