| | |
| | | string Ret = ""; |
| | | if (oSystemParameter.ShowBill(ref Ret)) |
| | | { |
| | | //判断客户为乔一 |
| | | if(oSystemParameter.omodel.WMS_CampanyName == "乔一") |
| | | { |
| | | HDate = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); |
| | | } |
| | | |
| | | //判断客户不为龙山汽配 |
| | | if (oSystemParameter.omodel.WMS_CampanyName != "龙山汽配" && oSystemParameter.omodel.WMS_CampanyName != "瑞与祺" && oSystemParameter.omodel.WMS_CampanyName != "添康科技") //系统参数 |
| | | { |
| | |
| | | ",HSourceID4=" + HSourceID4 + |
| | | ",HSourceID5=" + HSourceID5 + |
| | | ",HPayProcID=" + HPayProcID + |
| | | ",HGroupID=" + HGroupID + |
| | | ",HWorkTimes=" + HWorkTimes + |
| | | ",HSaveBillFlag=0 " + |
| | | ",HBadCount=" + HBadCount + |
| | |
| | | } |
| | | #endregion |
| | | |
| | | #region 工序出站汇报单列表 |
| | | [Route("Cj_StationOutBill/page")] |
| | | #region 返回工序出站汇报单列表-分页 |
| | | [Route("Cj_StationOutBill/get_Display_byPage")] |
| | | [HttpGet] |
| | | public json page(string sWhere, string user, int page, int size) |
| | | public object get_Display_byPage(string sWhere, string user, string Organization, int page, int size, string HBillSubType) |
| | | { |
| | | json res = new json(); |
| | | try |
| | | { |
| | | List<object> columnNameList = new List<object>(); |
| | | //判断是否有查询权限 |
| | | if (!DBUtility.ClsPub.Security_Log("Cj_StationOutBill_Query", 1, false, user)) |
| | | { |
| | | res.code = "0"; |
| | | res.count = 0; |
| | | res.Message = "出站单无查询权限!"; |
| | | res.data = null; |
| | | return res; |
| | | } |
| | | if (sWhere == null || sWhere.Equals("")) |
| | | if (HBillSubType == "SUB") |
| | | { |
| | | ds = oCN.RunProcReturn("exec h_p_MES_StationOutBillList " + page + "," + size + ",''", "h_p_MES_StationOutBillList"); |
| | | //判断是否有查询权限 |
| | | if (!DBUtility.ClsPub.Security_Log("Cj_StationOutBill_Sub_Query", 1, false, user)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "完工单无查询权限!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | ds = oCN.RunProcReturn("exec h_p_MES_StationOutBillList " + page + "," + size + ",'" + sWhere + "'", "h_p_MES_StationOutBillList"); |
| | | //判断是否有查询权限 |
| | | if (!DBUtility.ClsPub.Security_Log("Cj_StationOutBill_Query", 1, false, user)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "出站单无查询权限!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | |
| | | //获取系统参数 |
| | | string Ret = ""; |
| | | if (oSystemParameter.ShowBill(ref Ret)) |
| | | { |
| | | //判断客户为龙山汽配 |
| | | if (oSystemParameter.omodel.WMS_CampanyName == "龙山汽配") |
| | | { |
| | | //获取需要拼接的字符串 |
| | | string sql_splice = DBUtility.ClsPub.SpliceSQL(user, "工序汇报单列表"); |
| | | |
| | | if (sql_splice == "没有查询到相关用户信息") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "没有查询到相关用户信息!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | sWhere += sql_splice; |
| | | } |
| | | } |
| | | } |
| | | |
| | | //sWhere = sWhere.Replace("'", "''"); |
| | | |
| | | if (sWhere == null || sWhere.Equals("")) |
| | | { |
| | | ds = oCN.RunProcReturn("exec h_p_MES_StationOutBillList " + page + "," + size + ",'" + Organization + "'," + "''", "h_p_MES_StationOutBillList"); |
| | | } |
| | | else |
| | | { |
| | | ds = oCN.RunProcReturn("exec h_p_MES_StationOutBillList " + page + "," + size + ",'" + Organization + "','" + sWhere + "'", "h_p_MES_StationOutBillList"); |
| | | } |
| | | |
| | | //添加列名 |
| | |
| | | columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//获取到DataColumn列对象的列名 |
| | | } |
| | | |
| | | res.code = CodeConstant.SUCCEED; |
| | | res.count = int.Parse(ds.Tables[1].Rows[0]["count"].ToString()); |
| | | res.Message = "Sucess!"; |
| | | res.list = columnNameList; |
| | | res.data = ds.Tables[0]; |
| | | return res; |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = int.Parse(ds.Tables[1].Rows[0]["count"].ToString()); |
| | | objJsonResult.Message = "Sucess!"; |
| | | objJsonResult.list = columnNameList; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | res.code = CodeConstant.FAIL; |
| | | res.count = CountConstant.FAIL; |
| | | res.Message = "Exception!" + e.ToString(); |
| | | res.data = null; |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exception!" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region 工序出站汇报单 子表查询 |
| | | [Route("Cj_StationOutBill/get_SubDisplay")] |
| | | [HttpGet] |
| | |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region 保存生成白标 |
| | | public class WhiteLabelGeneration { |
| | | public string ProjectNo { get; set; } |
| | | public string OrderingCode { get; set; } |
| | | public string DrawVersionNumber { get; set; } |
| | | public string CustomerOrderNumber { get; set; } |
| | | public string WaybillNumber { get; set; } |
| | | public string HRemark { get; set; } |
| | | public string HBarCode_Pack { get; set; } |
| | | public string HBillType { get; set; } |
| | | } |
| | | [Route("Cj_StationOutBill_Detail/MES_WhiteLabelGeneration")] |
| | | [HttpPost] |
| | | public object MES_WhiteLabelGeneration([FromBody] JObject oMain) |
| | | { |
| | | try |
| | | { |
| | | oCN.BeginTran(); |
| | | |
| | | var _value = oMain["oMain"].ToString(); |
| | | string msg1 = _value.ToString(); |
| | | string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries); |
| | | string msg2 = sArray[0].ToString(); //主表数据 |
| | | WhiteLabelGeneration Main = Newtonsoft.Json.JsonConvert.DeserializeObject<WhiteLabelGeneration>(msg2); |
| | | |
| | | string HBillType = Main.HBillType; |
| | | string ProjectNo = Main.ProjectNo; |
| | | string OrderingCode = Main.OrderingCode; |
| | | string DrawVersionNumber = Main.DrawVersionNumber; |
| | | string CustomerOrderNumber = Main.CustomerOrderNumber; |
| | | string WaybillNumber = Main.WaybillNumber; |
| | | string HRemark = Main.HRemark; |
| | | string HBarCode_Pack = Main.HBarCode_Pack; |
| | | |
| | | ds = oCN.RunProcReturn($"exec h_p_MES_HBarCode_White_SMR_15 '{HBillType}','{ProjectNo}','{OrderingCode}','{DrawVersionNumber}','{CustomerOrderNumber}','{WaybillNumber}','{HRemark}','{HBarCode_Pack}'", "h_p_MES_HBarCode_White_SMR_15"); |
| | | |
| | | string HBarCode_White = ds.Tables[0].Rows[0]["HBarCode_White"].ToString(); |
| | | |
| | | if (HBarCode_White == "") |
| | | { |
| | | oCN.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "生成白标失败,单据标识:" + HBarCode_Pack + "!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | oCN.RunProc("update Sc_PackUnionBillMain set HBarCode_White='" + HBarCode_White + "' where HBarCode_Pack='" + HBarCode_Pack + "'"); |
| | | |
| | | oCN.Commit(); |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "Sucess!"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | oCN.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exception!" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | #region 下推质量汇报单时返回工序出站汇报单信息 |
| | | [Route("Cj_StationOutBill/PushDownBackInfo")] |
| | | [HttpGet] |
| | | public object PushDownBackInfo(string linterid, string user) |
| | | { |
| | | try |
| | | { |
| | | List<object> columnNameList = new List<object>(); |
| | | |
| | | ds = oCN.RunProcReturn("select * from h_v_Sc_StationOutBill_PushDownBackInfo where hmainid in (" + linterid + ")", "h_v_Sc_StationOutBill_PushDownBackInfo"); |
| | | |
| | | if (ds.Tables[0].Rows.Count > 0 && ds != null) |
| | | { |
| | | //添加列名 |
| | | foreach (DataColumn col in ds.Tables[0].Columns) |
| | | { |
| | | Type dataType = col.DataType; |
| | | string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}"; |
| | | columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//获取到DataColumn列对象的列名 |
| | | } |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "Sucess!"; |
| | | objJsonResult.list = columnNameList; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "无数据"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exception!" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | } |
| | | } |