WebAPI/Controllers/Sc_ProcessMangementController.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
WebAPI/DLL/ClsWW_EntrustProcessReportBill.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
WebAPI/ListModels.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
WebAPI/Models/ClsWW_EntrustProcessReportBillMain.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
WebAPI/Models/ClsWW_EntrustProcessReportBillSub.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
WebAPI/Models/WW_EntrustProcSendWorkViewModel.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
WebAPI/Properties/PublishProfiles/API.pubxml.user | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
WebAPI/WebAPI.csproj | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
WebAPI/Controllers/Sc_ProcessMangementController.cs
@@ -1602,5 +1602,153 @@ } /// <summary> /// 保存委外汇报单信息 /// </summary> /// <param name="msg"></param> /// <returns></returns> [Route("SaveWW_EntrustProcessReportBill")] [HttpPost] public object SaveWW_EntrustProcessReportBill([FromBody] JObject msg) { var _value = msg["msg"].ToString(); string msg1 = _value.ToString(); string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries); string msg2 = sArray[0].ToString(); string msg3 = sArray[1].ToString(); string UserName = ""; ListModels oListModels = new ListModels(); try { WebAPI.DLL.ClsWW_EntrustProcessReportBill Sendwork = new WebAPI.DLL.ClsWW_EntrustProcessReportBill(); List<WebAPI.Models.ClsWW_EntrustProcessReportBillMain> lsmain = new List<WebAPI.Models.ClsWW_EntrustProcessReportBillMain>(); msg2 = msg2.Replace("\\", ""); msg2 = msg2.Replace("\n", ""); lsmain = oListModels.getObjectByJson_WW_EntrustProcessReportBillMain(msg2); foreach (WebAPI.Models.ClsWW_EntrustProcessReportBillMain oItem in lsmain) { UserName = oItem.HMaker; oItem.HMakeDate = DBUtility.ClsPub.isStrNull(DateTime.Now.ToString("yyyy-MM-dd")); oItem.HYear = DBUtility.ClsPub.isLong(DateTime.Now.Year); oItem.HDate = DateTime.Now; oItem.HMainSourceInterID = oItem.HInterID; oItem.HInterID = 0; Sendwork.omodel = oItem; } //表体数据 //按 },{来拆分数组 //去掉【和】 msg3 = msg3.Substring(1, msg3.Length - 2); msg3 = msg3.Replace("\\", ""); msg3 = msg3.Replace("\n", ""); //\n List<WebAPI.Models.WW_EntrustProcSendWorkViewModel> ls = new List<WebAPI.Models.WW_EntrustProcSendWorkViewModel>(); ls = oListModels.getObjectByJson_WW_EntrustProcSendWork(msg3); int i = 0; List<Models.ClsWW_EntrustProcessReportBillSub> lss = new List<Models.ClsWW_EntrustProcessReportBillSub>(); foreach (WebAPI.Models.WW_EntrustProcSendWorkViewModel oItemSub in ls) { i++; Models.ClsWW_EntrustProcessReportBillSub sendworksub = new Models.ClsWW_EntrustProcessReportBillSub(); sendworksub.HProcID = 0;//--工序ID sendworksub.HSourceInterID = (long)oItemSub.hmainid;//源单id sendworksub.HSourceEntryID = (long)oItemSub.hsubid; //--源单子ID sendworksub.HSourceBillNo = oItemSub.单据号; //--源单单号 sendworksub.HSourceBillType = oItemSub.HBillType; //--源单类型 sendworksub.HQty = (decimal)oItemSub.数量; //--数量 sendworksub.HICMOBillNo = ""; //--任务单号 sendworksub.HSeOrderBillNo = ""; //--销售订单号 sendworksub.HSeOrderEntryID = 0; //--销售子ID sendworksub.HSeOrderInterID = 0; //--销售订单主ID sendworksub.HTimes = 0; //--计划工时 if (oItemSub.数量 <= 0) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "保存失败!第" + i.ToString() + "行数量不大于0无法保存!"; objJsonResult.data = 1; return objJsonResult; } if (Convert.ToInt32(sendworksub.HQty) > Convert.ToInt32(oItemSub.数量)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "保存失败!第" + i.ToString() + "行委外汇报数量不能大于委外派工单数量!"; objJsonResult.data = 1; return objJsonResult; } sendworksub.HEntryID = i; sendworksub.HEntryCloseDate = DBUtility.ClsPub.isDate(DateTime.Now); sendworksub.HRemark = ""; sendworksub.HCloseMan = ""; sendworksub.HCloseType = false; lss.Add(sendworksub);//先把数据存放到派工单子表集合里 } if (lss.Count > 0) { //然后再循环保存到派工单子表的集合里 foreach (Models.ClsWW_EntrustProcessReportBillSub Itemsendwork in lss) { Sendwork.DetailColl.Add(Itemsendwork); } } else { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "保存失败!lss集合小于0"; objJsonResult.data = 1; return objJsonResult; } //保存 //保存完毕后处理 bool bResult; if (Sendwork.omodel.HInterID == 0) { // bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo); bResult = Sendwork.AddBill(ref DBUtility.ClsPub.sExeReturnInfo); } else { bResult = Sendwork.ModifyBill(Sendwork.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo); } if (bResult) { objJsonResult.code = "0"; objJsonResult.count = 1; objJsonResult.Message = "保存成功!"; //WebAPIController.Add_Log("送货单下推", UserName, "生成送货单"); objJsonResult.data = 1; return objJsonResult; } else { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "保存失败!" + DBUtility.ClsPub.sExeReturnInfo; objJsonResult.data = 1; return objJsonResult; } } catch (Exception e) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "保存失败!" + e.ToString(); objJsonResult.data = 1; return objJsonResult; } } } } WebAPI/DLL/ClsWW_EntrustProcessReportBill.cs
New file @@ -0,0 +1,298 @@ using System; using System.Collections.Generic; using System.Data; using System.Linq; using System.Web; namespace WebAPI.DLL { public class ClsWW_EntrustProcessReportBill : DBUtility.ClsXt_BaseBill { public WebAPI.Models.ClsWW_EntrustProcessReportBillMain omodel = new WebAPI.Models.ClsWW_EntrustProcessReportBillMain(); public List<WebAPI.Models.ClsWW_EntrustProcessReportBillSub> DetailColl = new List<WebAPI.Models.ClsWW_EntrustProcessReportBillSub>(); public ClsWW_EntrustProcessReportBill() { base.MvarItemKeySub = "WW_EntrustProcessReportBillSub"; base.MvarItemKeySub2 = ""; base.MvarItemKeySub3 = ""; base.MvarItemKeySub4 = ""; base.MvarItemKey = "WW_EntrustProcessReportBillMain"; base.MvarReportTitle = "委外工序计划汇报单"; base.BillType = "3742"; base.HBillSubType = "3742"; } #region 固定代码 ~ClsWW_EntrustProcessReportBill() { DetailColl = null; } #endregion 自定义方法 #region ////修改单据 //public override bool ModifyBill(Int64 lngBillKey, ref string sReturn) //{ // try // { // // // oCn.BeginTran(); // //更新主表 // oCn.RunProc("UpDate Sc_ProcessSendWorkMain set " + // " HYear=" + omodel.HYear.ToString() + // ",HPeriod=" + omodel.HPeriod.ToString() + // ",HInterID=" + omodel.HInterID.ToString() + // ",HDate='" + omodel.HDate.ToShortDateString() + "'" + // ",HBillNo='" + omodel.HBillNo + "'" + // ",HBillStatus=" + omodel.HBillStatus.ToString() + // ",HCheckItemNowID=" + omodel.HCheckItemNowID.ToString() + // ",HCheckItemNextID=" + omodel.HCheckItemNextID.ToString() + // ",HCheckFlowID=" + omodel.HCheckFlowID.ToString() + // ",HICMOInterID=" + omodel.HICMOInterID.ToString() + // ",HICMOBillNo='" + omodel.HICMOBillNo + "'" + // ",HProcPlanBillNo='" + omodel.HProcPlanBillNo + "'" + // ",HPlanBeginDate='" + omodel.HPlanBeginDate.ToShortDateString() + "'" + // ",HPlanEndDate='" + omodel.HPlanEndDate.ToShortDateString() + "'" + // ",HBatchNo='" + omodel.HBatchNo + "'" + // ",HSeOrderInterID=" + omodel.HSeOrderInterID.ToString() + // ",HSeOrderEntryID=" + omodel.HSeOrderEntryID.ToString() + // ",HSeOrderBillNo='" + omodel.HSeOrderBillNo + "'" + // ",HProcID=" + omodel.HProcID.ToString() + // ",HProcNumber='" + omodel.HProcNumber + "'" + // ",HDeptID=" + omodel.HDeptID.ToString() + // ",HDeptNumber='" + omodel.HDeptNumber + "'" + // ",HGroupID=" + omodel.HGroupID.ToString() + // ",HGroupNumber='" + omodel.HGroupNumber + "'" + // ",HMaterID=" + omodel.HMaterID.ToString() + // ",HMaterNumber='" + omodel.HMaterNumber + "'" + // ",HUnitID=" + omodel.HUnitID.ToString() + // ",HUnitNumber='" + omodel.HUnitNumber + "'" + // ",HRoutingInterID=" + omodel.HRoutingInterID.ToString() + // ",HPlanQty=" + omodel.HPlanQty.ToString() + // ",HExplanation='" + omodel.HExplanation + "'" + // ",HRemark='" + omodel.HRemark + "'" + // ",HInnerBillNo='" + omodel.HInnerBillNo + "'" + // ",HUpDater='" + DBUtility.ClsPub.CurUserName + "'" + // ",HUpDateDate=getdate()" + // ",HSupID=" + omodel.HSupID.ToString() + // " where HInterID=" + lngBillKey.ToString()); // //删除关联 // DeleteRelation(ref sReturn, lngBillKey); // //删除子表 // DeleteBillSub(lngBillKey); // //插入子表 // omodel.HInterID = lngBillKey; // foreach (Model.ClsSc_ProcessSendWorkSub oSub in DetailColl) // { // oCn.RunProc("Insert into Sc_ProcessSendWorkSub " + // " (HInterID,HEntryID,HProcID,HProcNumber,HGroupID,HSourceID,HSourceNumber" + // ",HGroupNumber,HWorkerID,HWorkerNumber,HQty,HPlanBeginDate" + // ",HPlanEndDate,HPlanTimes,HSeOrderInterID,HSeOrderEntryID,HSeOrderBillNo" + // ",HICMOBillNo,HICMOInterID,HProcPlanInterID,HProcPlanEntryID,HProcPlanBillNo" + // ",HCloseMan,HCloseType,HRemark,HSourceInterID,HSourceEntryID" + // ",HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" + // ") values(" // + omodel.HInterID.ToString() + "," + oSub.HEntryID.ToString() + "," + oSub.HProcID.ToString() + ",'" + oSub.HProcNumber + "'," + oSub.HGroupID.ToString() + "," + oSub.HSourceID.ToString() + ",'" + oSub.HSourceNumber + "'" + // ",'" + oSub.HGroupNumber + "'," + oSub.HWorkerID.ToString() + ",'" + oSub.HWorkerNumber + "'," + oSub.HQty.ToString() + ",'" + oSub.HPlanBeginDate + "'" + // ",'" + oSub.HPlanEndDate + "'," + oSub.HPlanTimes.ToString() + "," + oSub.HSeOrderInterID.ToString() + "," + oSub.HSeOrderEntryID.ToString() + ",'" + oSub.HSeOrderBillNo + "'" + // ",'" + oSub.HICMOBillNo + "'," + oSub.HICMOInterID.ToString() + "," + oSub.HProcPlanInterID.ToString() + "," + oSub.HProcPlanEntryID.ToString() + ",'" + oSub.HProcPlanBillNo + "'" + // ",'" + oSub.HCloseMan + "'," + Convert.ToString(oSub.HCloseType ? 1 : 0) + ",'" + oSub.HRemark + "'," + oSub.HSourceInterID.ToString() + "," + oSub.HSourceEntryID.ToString() + // ",'" + oSub.HSourceBillNo + "','" + oSub.HSourceBillType + "'," + oSub.HRelationQty.ToString() + "," + oSub.HRelationMoney.ToString() + // ") "); // } // sReturn = "修改单据成功!"; // oCn.Commit(); // return true; // } // catch (Exception e) // { // sReturn = e.Message; // oCn.RollBack(); // throw (e); // } //} #endregion //新增单据 public override bool AddBill(ref string sReturn) { try { //得到mainid omodel.HInterID = DBUtility.ClsPub.CreateBillID(BillType, ref DBUtility.ClsPub.sExeReturnInfo); //若MAINDI重复则重新获取 oCn.BeginTran(); //主表 oCn.RunProc("Insert Into WW_EntrustProcessReportBillMain " + "(HYear, HPeriod, HBillType, HBillSubType, HInterID" + ",HDate, HBillNo, HBillStatus, HCheckItemNowID, HCheckItemNextID" + ",HCheckFlowID, HRemark, HBacker, HBackDate, HBackRemark" + ",HChecker, HCheckDate, HMaker, HMakeDate, HUpDater" + ",HUpDateDate, HCloseMan, HCloseDate, HCloseType,HDeleteMan" + ",HDeleteDate,HMainSourceBillType, HMainSourceInterID, HMainSourceEntryID, HMainSourceBillNo" + ",[HPrintQty], [HDeptID], [HSupID], [HEmpID], [HExplanation], [HInnerBillNo]" + ") " + " values(" + omodel.HYear.ToString() + "," + omodel.HPeriod.ToString() + ",'" + this.BillType + "','" + omodel.HBillSubType + "'," + omodel.HInterID.ToString() + ",'" + omodel.HDate.ToShortDateString() + "','" + omodel.HBillNo + "'," + omodel.HBillStatus + "," + omodel.HCheckItemNowID.ToString() + "," + omodel.HCheckItemNextID.ToString() + "," + omodel.HCheckFlowID.ToString() + ",'" + omodel.HRemark + "','" + omodel.HBacker + "','" + omodel.HBackDate + "','" + omodel.HBackRemark + "'" + ",'" + omodel.HChecker + "','" + omodel.HCheckDate + "','" + DBUtility.ClsPub.CurUserName + "',getdate(),'" + omodel.HUpDater + "'" + ",'" + omodel.HUpDateDate + "','" + omodel.HCloseMan + "','" + omodel.HCloseDate + "'," + Convert.ToString(omodel.HCloseType ? 1 : 0) + ",'" + omodel.HDeleteMan + "'" + ",'" + omodel.HDeleteDate + "','" + omodel.HMainSourceBillType + "'," + omodel.HMainSourceInterID.ToString() + "," + omodel.HMainSourceEntryID.ToString() + ",'" + omodel.HMainSourceBillNo + "'" + ",'" + omodel.HPrintQty + "','" + omodel.HDeptID + "','" + omodel.HSupID + "','" + omodel.HEmpID +"'"+ ",'" + omodel.HExplanation + "','" + omodel.HInnerBillNo + "'" + ") "); //插入子表 foreach (Models.ClsWW_EntrustProcessReportBillSub oSub in DetailColl) { oCn.RunProc("Insert into WW_EntrustProcessReportBillSub " + "([HInterID], [HBillNo_bak], [HEntryID], [HCloseMan], [HEntryCloseDate], [HCloseType], [HRemark], [HSourceInterID]" + ",[HSourceEntryID], [HSourceBillNo], [HSourceBillType], [HRelationQty], [HRelationMoney], [HProcID]" + ", [HSupFlag], [HMaterID], [HTimes], [HQty],[HCheckQty], [HBadCount], [HWasterQty], [HWasterQty2], [HWeight]" + ", [HPrice], [HMoney], [HBatchNo], [HBadPrirce], [HBadMoney], [HWasterPrice], [HWasterMoney],[HQualityRate]" + ", [HUsingQty], [HSelfBadCount], [HPreBadCount], [HPayMentQty], [HPackType],[HCheckEmpID], [HProcPlanInterID]" + ", [HProcPlanEntryID], [HProcPlanBillNo], [HICMOInterID],[HICMOEntryID], [HICMOBillNo], [HSeOrderInterID]" + ", [HSeOrderEntryID], [HSeOrderBillNo]" + ") " + "values(" + omodel.HInterID.ToString() + ",'" + oSub.HBillNo_bak + "'," + oSub.HEntryID.ToString() + ",'" + oSub.HCloseMan + "'," + oSub.HEntryCloseDate.ToShortDateString() + "," + Convert.ToString(oSub.HCloseType ? 1 : 0) + ",'" + oSub.HRemark + "'" + "," + oSub.HSourceInterID.ToString() + "," + oSub.HSourceEntryID.ToString() + ",'" + oSub.HSourceBillNo + "','" + oSub.HSourceBillType + "'," + oSub.HRelationQty.ToString() + "," + oSub.HRelationMoney.ToString() + "," + oSub.HProcID.ToString() + "," + Convert.ToString(oSub.HSupFlag ? 1 : 0) + "," + oSub.HMaterID.ToString() + "," + oSub.HTimes.ToString() + "," + oSub.HQty.ToString() + "," + oSub.HCheckQty.ToString() + "," + oSub.HBadCount.ToString() + "," + oSub.HWasterQty.ToString() + "," + oSub.HWasterQty2.ToString() + "," + oSub.HWeight.ToString() + "," + oSub.HPrice.ToString() + "," + oSub.HMoney.ToString() + ",'" + oSub.HBatchNo + "'," + oSub.HBadPrirce.ToString() + "," + oSub.HBadMoney.ToString() + "," + oSub.HWasterPrice.ToString() + "," + oSub.HWasterMoney.ToString() + "," + oSub.HQualityRate.ToString() + "," + oSub.HUsingQty + "," + oSub.HSelfBadCount + "," + oSub.HPreBadCount.ToString() + "," + oSub.HPayMentQty.ToString() + ",'" + oSub.HPackType + "'," + oSub.HCheckEmpID.ToString() + "," + oSub.HProcPlanInterID.ToString() + "," + oSub.HProcPlanEntryID.ToString() + ",'" + oSub.HProcPlanBillNo + "'," + oSub.HICMOInterID.ToString() + "," + oSub.HICMOEntryID.ToString() + ",'" + oSub.HICMOBillNo + "','" + oSub.HSeOrderInterID + "','" + oSub.HSeOrderEntryID + "','" + oSub.HSeOrderBillNo + "'" + ") "); } sReturn = "新增单据成功!"; oCn.Commit(); return true; } catch (Exception e) { sReturn = e.Message; oCn.RollBack(); throw (e); } } //显示单据 public override bool ShowBill(Int64 lngBillKey, ref string sReturn) { try { //查询主表 DataSet Ds; Ds = oCn.RunProcReturn("Select * from WW_EntrustProcessReportBillMain Where HInterID=" + lngBillKey.ToString(), "WW_EntrustProcessReportBillMain"); if (Ds.Tables[0].Rows.Count == 0) { sReturn = "单据未找到!"; return false; } //赋值 omodel.HYear = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HYear"]); omodel.HPeriod = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HPeriod"]); omodel.HBillType = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HBillType"]); omodel.HBillSubType = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HBillSubType"]); omodel.HInterID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HInterID"]); omodel.HDate = DBUtility.ClsPub.isDate(Ds.Tables[0].Rows[0]["HDate"]); omodel.HBillNo = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HBillNo"]); omodel.HBillStatus = DBUtility.ClsPub.isInt(Ds.Tables[0].Rows[0]["HBillStatus"]); omodel.HCheckItemNowID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HCheckItemNowID"]); omodel.HCheckItemNextID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HCheckItemNextID"]); // omodel.HSupID = (int)DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HSupID"]); omodel.HDeptID = (int)DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HDeptID"]); omodel.HExplanation = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HExplanation"]); omodel.HRemark = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HRemark"]); omodel.HInnerBillNo = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HInnerBillNo"]); // omodel.HBacker = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HBacker"]); omodel.HBackDate = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HBackDate"]); omodel.HChecker = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HChecker"]); omodel.HCheckDate = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HCheckDate"]); omodel.HMaker = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HMaker"]); omodel.HMakeDate = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HMakeDate"]); omodel.HUpDater = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HUpDater"]); omodel.HUpDateDate = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HUpDateDate"]); omodel.HCloseMan = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HCloseMan"]); omodel.HCloseDate = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HCloseDate"]); omodel.HCloseType = DBUtility.ClsPub.isBool(Ds.Tables[0].Rows[0]["HCloseType"]); omodel.HDeleteMan = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HDeleteMan"]); omodel.HDeleteDate = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HDeleteDate"]); //循环 DataSet DsSub; DsSub = oCn.RunProcReturn("Select * from Sc_ProcessReportSub Where HInterID=" + lngBillKey.ToString() + " order by HEntryID ", "Sc_ProcessReportSub"); DetailColl.Clear();//清空 for (int i = 0; i < DsSub.Tables[0].Rows.Count; i++) { Models.ClsWW_EntrustProcessReportBillSub oSub = new Models.ClsWW_EntrustProcessReportBillSub(); oSub.HInterID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HInterID"]); oSub.HEntryID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HEntryID"]); // oSub.HMaterID = (int)DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HMaterID"]); oSub.HProcID = (int)DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HProcID"]); oSub.HTimes = DBUtility.ClsPub.isSingle(DsSub.Tables[0].Rows[i]["HTimes"]); oSub.HQty = (decimal)DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HQty"]); oSub.HCheckQty = (decimal)DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HCheckQty"]); oSub.HBadCount = DBUtility.ClsPub.isSingle(DsSub.Tables[0].Rows[i]["HBadCount"]); oSub.HWasterQty = DBUtility.ClsPub.isSingle(DsSub.Tables[0].Rows[i]["HWasterQty"]); oSub.HWasterQty2 = DBUtility.ClsPub.isSingle(DsSub.Tables[0].Rows[i]["HWasterQty2"]); oSub.HPrice = (decimal)DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HPrice"]); oSub.HMoney = DBUtility.ClsPub.isSingle(DsSub.Tables[0].Rows[i]["HMoney"]); //addnew oSub.HBadPrirce = DBUtility.ClsPub.isSingle(DsSub.Tables[0].Rows[i]["HBadPrirce"]); oSub.HBadMoney = DBUtility.ClsPub.isSingle(DsSub.Tables[0].Rows[i]["HBadMoney"]); oSub.HWasterPrice = DBUtility.ClsPub.isSingle(DsSub.Tables[0].Rows[i]["HWasterPrice"]); oSub.HWasterMoney = DBUtility.ClsPub.isSingle(DsSub.Tables[0].Rows[i]["HWasterMoney"]); oSub.HQualityRate = DBUtility.ClsPub.isSingle(DsSub.Tables[0].Rows[i]["HQualityRate"]); oSub.HUsingQty = DBUtility.ClsPub.isSingle(DsSub.Tables[0].Rows[i]["HUsingQty"]); oSub.HSelfBadCount = DBUtility.ClsPub.isSingle(DsSub.Tables[0].Rows[i]["HSelfBadCount"]); oSub.HPreBadCount = DBUtility.ClsPub.isSingle(DsSub.Tables[0].Rows[i]["HPreBadCount"]); oSub.HPayMentQty = DBUtility.ClsPub.isSingle(DsSub.Tables[0].Rows[i]["HPayMentQty"]); oSub.HBatchNo = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HBatchNo"]); oSub.HPackType = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HPackType"]); oSub.HCheckEmpID = (int)DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HCheckEmpID"]); // oSub.HProcPlanInterID = (int)DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HProcPlanInterID"]); oSub.HProcPlanEntryID = (int)DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HProcPlanEntryID"]); oSub.HProcPlanBillNo = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HProcPlanBillNo"]); oSub.HICMOInterID = (int)DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HICMOInterID"]); oSub.HICMOBillNo = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HICMOBillNo"]); oSub.HSeOrderInterID = (int)DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HSeOrderInterID"]); oSub.HSeOrderEntryID = (int)DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HSeOrderEntryID"]); oSub.HSeOrderBillNo = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HSeOrderBillNo"]); // oSub.HCloseMan = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HCloseMan"]); oSub.HCloseType = DBUtility.ClsPub.isBool(DsSub.Tables[0].Rows[i]["HCloseType"]); oSub.HRemark = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HRemark"]); oSub.HSourceInterID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HSourceInterID"]); oSub.HSourceEntryID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HSourceEntryID"]); oSub.HSourceBillNo = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HSourceBillNo"]); oSub.HSourceBillType = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HSourceBillType"]); oSub.HRelationQty = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HRelationQty"]); oSub.HRelationMoney = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HRelationMoney"]); DetailColl.Add(oSub); } sReturn = "显示单据成功!"; return true; } catch (Exception e) { sReturn = e.Message; throw (e); } } } } WebAPI/ListModels.cs
@@ -261,7 +261,29 @@ return list; } /// <summary> /// 委外汇报单主表json处理 /// </summary> /// <param name="jsonString"></param> /// <returns></returns> public List<WebAPI.Models.ClsWW_EntrustProcessReportBillMain> getObjectByJson_WW_EntrustProcessReportBillMain(string jsonString) { jsonString = "[" + jsonString.ToString() + "]"; List<WebAPI.Models.ClsWW_EntrustProcessReportBillMain> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<WebAPI.Models.ClsWW_EntrustProcessReportBillMain>>(jsonString); return list; } /// <summary> /// 委外派工单视图模型json处理 /// </summary> /// <param name="jsonString"></param> /// <returns></returns> public List<WebAPI.Models.WW_EntrustProcSendWorkViewModel> getObjectByJson_WW_EntrustProcSendWork(string jsonString) { jsonString = "[" + jsonString.ToString() + "]"; List<WebAPI.Models.WW_EntrustProcSendWorkViewModel> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<WebAPI.Models.WW_EntrustProcSendWorkViewModel>>(jsonString); return list; } } } WebAPI/Models/ClsWW_EntrustProcessReportBillMain.cs
New file @@ -0,0 +1,42 @@ using System; using System.Collections.Generic; using System.Linq; using System.Web; namespace WebAPI.Models { public class ClsWW_EntrustProcessReportBillMain: DBUtility.ClsXt_BaseBillMain { /// <summary> /// HDeptID int --部门ID(Gy_Department) /// </summary> public int? HDeptID { get; set; }// /// <summary> /// HSupID int --供应商(Gy_Supplier) /// </summary> public int? HSupID { get; set; }// /// <summary> /// HEmpID int --职员(Gy_Employee) /// </summary> public int? HEmpID { get; set; }// /// <summary> /// HExplanation varchar(500) --摘要 /// </summary> public string HExplanation { get; set; }// /// <summary> /// HInnerBillNo varchar(50) --内部单据号 /// </summary> public string HInnerBillNo { get; set; }// /// <summary> /// HPrintQty int --打印次数 /// </summary> public int? HPrintQty { get; set; } } } WebAPI/Models/ClsWW_EntrustProcessReportBillSub.cs
New file @@ -0,0 +1,181 @@ using System; using System.Collections.Generic; using System.Linq; using System.Web; namespace WebAPI.Models { public class ClsWW_EntrustProcessReportBillSub : DBUtility.ClsXt_BaseBillSub { /// <summary> /// HBillNo_bak varchar(50) --单据号(备份,以免内码丢失,找不到对应主表) /// </summary> public string HBillNo_bak { get; set; } /// <summary> /// HProcID int --工序 (gy_Process) /// </summary> public int HProcID { get; set; } /// <summary> /// HSupFlag bit --委外标记 /// </summary> public bool HSupFlag { get; set; } /// <summary> /// HMaterID int --产品ID(Gy_Material) /// </summary> public int HMaterID { get; set; } /// <summary> /// HTimes money --实作时间 /// </summary> public double HTimes { get; set; } /// <summary> /// HQty dec(18,8) --实作数量 /// </summary> public decimal HQty { get; set; } /// <summary> /// HCheckQty dec(18,8) --合格数量 /// </summary> public decimal HCheckQty { get; set; } /// <summary> /// HBadCount money --不良品数 /// </summary> public double HBadCount { get; set; } /// <summary> /// HWasterQty money --因工报废数量 /// </summary> public double HWasterQty { get; set; } /// <summary> /// HWasterQty2 money --因料报废数量 /// </summary> public double HWasterQty2 { get; set; } /// <summary> /// HWeight dec(18,8) --重量 addnew /// </summary> public decimal HWeight { get; set; } /// <summary> /// HPrice dec(18,8) --加工费 /// </summary> public decimal HPrice { get; set; } /// <summary> /// HMoney money -- 金额 /// </summary> public double HMoney { get; set; } /// <summary> /// HBatchNo varchar(100) -- 批次 /// </summary> public string HBatchNo { get; set; } /// <summary> /// HBadPrirce money --不良单价 --addnew /// </summary> public double HBadPrirce { get; set; } /// <summary> /// HBadMoney money --不良金额 --addnew /// </summary> public double HBadMoney { get; set; } /// <summary> /// HWasterPrice money --报废单价 --addnew /// </summary> public double HWasterPrice { get; set; } /// <summary> /// HWasterMoney money --报废金额 --addnew /// </summary> public double HWasterMoney { get; set; } /// <summary> /// HQualityRate money --质量系数 --addnew /// </summary> public double HQualityRate { get; set; } /// <summary> /// HUsingQty money --让步数量 --addnew /// </summary> public double HUsingQty { get; set; } /// <summary> /// HSelfBadCount money --本道返工 --addnew /// </summary> public double HSelfBadCount { get; set; } /// <summary> /// HPreBadCount money --前道不良数 --addnew /// </summary> public double HPreBadCount { get; set; } /// <summary> /// HPayMentQty money --结算数量 --addnew /// </summary> public double HPayMentQty { get; set; } /// <summary> /// HPackType varchar(50) --包装类型 --addnew /// </summary> public string HPackType { get; set; } /// <summary> /// HCheckEmpID int --检验员(gy_employee) --addnew /// </summary> public int HCheckEmpID { get; set; } /// <summary> /// HProcPlanInterID int --工序计划单ID /// </summary> public int HProcPlanInterID { get; set; } /// <summary> /// HProcPlanEntryID int --工序计划单子ID /// </summary> public int HProcPlanEntryID { get; set; } /// <summary> /// HProcPlanBillNo varchar(50) --工序计划单号 /// </summary> public string HProcPlanBillNo { get; set; } /// <summary> /// HICMOInterID int --任务单ID /// </summary> public int HICMOInterID { get; set; } /// <summary> /// HICMOEntryID int --任务单ID /// </summary> public int HICMOEntryID { get; set; } /// <summary> /// HICMOBillNo varchar(50) --任务单号 /// </summary> public string HICMOBillNo { get; set; } /// <summary> /// HSeOrderInterID int --销售订单主ID /// </summary> public int HSeOrderInterID { get; set; } /// <summary> /// HSeOrderEntryID int --销售子ID /// </summary> public int HSeOrderEntryID { get; set; } /// <summary> /// HSeOrderBillNo varchar(50) --销售订单号 /// </summary> public string HSeOrderBillNo { get; set; } } } WebAPI/Models/WW_EntrustProcSendWorkViewModel.cs
New file @@ -0,0 +1,75 @@ using System; using System.Collections.Generic; using System.Linq; using System.Web; namespace WebAPI.Models { public class WW_EntrustProcSendWorkViewModel { public int? hmainid { get; set; } public DateTime? 日期 { get; set; } public string 单据号 { get; set; } public int? HDeptID { get; set; } public string 部门代码 { get; set; } public string 部门 { get; set; } public int? HMaterID { get; set; } public string 物料代码 { get; set; } public string 规格型号 { get; set; } public int? HUnitID { get; set; } public string 计量单位代码 { get; set; } public string 计量单位 { get; set; } public int? HSupID { get; set; } public string 供应商代码 { get; set; } public string 供应商名称 { get; set; } public int? HprocID { get; set; } public string 工序代码 { get; set; } public string 工序 { get; set; } public int? HGroupID { get; set; } public string 班组代码 { get; set; } public string 班组名称 { get; set; } public int? HSourceID { get; set; } public string 资源代码 { get; set; } public string 生产资源 { get; set; } public int HWorkerID { get; set; } public string 职员代码 { get; set; } public string 职员 { get; set; } public int? hsubid { get; set; } public double 数量 { get; set; } public DateTime? 计划开工日期 { get; set; } public DateTime? 计划完工日期 { get; set; } public double 计划工时 { get; set; } public string 表体备注 { get; set; } public int? HICMOInterID { get; set; } public string 生产任务单号 { get; set; } public int? HSeOrderInterID { get; set; } public string 销售订单号 { get; set; } public string 表头备注 { get; set; } public string 制单人 { get; set; } public DateTime? 制单日期 { get; set; } public string 审核人 { get; set; } public DateTime? 审核日期 { get; set; } public string 修改人 { get; set; } public DateTime? 修改日期 { get; set; } public string 关闭人 { get; set; } public DateTime? 关闭日期 { get; set; } public string 作废人 { get; set; } public DateTime? 作废日期 { get; set; } public int? 源单主内码 { get; set; } public int? 源单子内码 { get; set; } public string 源单单号 { get; set; } public string 源单类型 { get; set; } public string 行关闭人 { get; set; } public string HBillType { get; set; } public int? HQtyDecimal { get; set; } public int? HPriceDecimal { get; set; } } } WebAPI/Properties/PublishProfiles/API.pubxml.user
@@ -7,7 +7,7 @@ <PropertyGroup> <TimeStampOfAssociatedLegacyPublishXmlFile /> <_PublishTargetUrl>D:\网站发布\智云MESWMS\API</_PublishTargetUrl> <History>True|2021-05-06T10:11:36.9078607Z;True|2021-05-06T18:08:40.5403791+08:00;True|2021-05-06T18:07:04.1929681+08:00;True|2021-05-06T18:06:54.5987264+08:00;True|2021-05-06T18:05:46.1791578+08:00;True|2021-05-06T17:18:58.8131464+08:00;True|2021-05-06T17:18:37.9969968+08:00;True|2021-05-06T14:47:33.5704679+08:00;True|2021-05-06T10:03:28.7226576+08:00;True|2021-04-28T10:18:54.1336497+08:00;True|2021-04-27T16:34:19.0789205+08:00;True|2021-04-27T14:48:28.8138232+08:00;True|2021-04-27T10:34:03.6370089+08:00;True|2021-04-26T16:18:32.0260755+08:00;True|2021-04-26T15:00:58.6773071+08:00;True|2021-04-26T13:23:50.3968646+08:00;True|2021-04-16T08:50:41.5499248+08:00;True|2021-04-16T08:32:59.1701708+08:00;True|2021-04-16T08:27:36.9176335+08:00;True|2021-04-15T15:56:26.8485667+08:00;True|2021-04-15T15:21:23.2875671+08:00;True|2021-04-15T14:41:16.9980034+08:00;True|2021-04-15T14:36:34.8570017+08:00;True|2021-04-13T16:15:00.7668503+08:00;</History> <History>True|2021-05-07T12:47:46.1401919Z;True|2021-05-07T20:31:45.7777162+08:00;True|2021-05-07T20:31:35.2882424+08:00;True|2021-05-07T20:31:21.5616729+08:00;False|2021-05-07T20:29:33.8855457+08:00;False|2021-05-07T20:28:43.1845420+08:00;False|2021-05-07T20:28:13.1335411+08:00;True|2021-05-07T20:10:01.7346568+08:00;True|2021-05-07T20:03:17.0005596+08:00;True|2021-05-07T09:05:04.3102029+08:00;True|2021-05-06T18:11:36.9078607+08:00;True|2021-05-06T18:08:40.5403791+08:00;True|2021-05-06T18:07:04.1929681+08:00;True|2021-05-06T18:06:54.5987264+08:00;True|2021-05-06T18:05:46.1791578+08:00;True|2021-05-06T17:18:58.8131464+08:00;True|2021-05-06T17:18:37.9969968+08:00;True|2021-05-06T14:47:33.5704679+08:00;True|2021-05-06T10:03:28.7226576+08:00;True|2021-04-28T10:18:54.1336497+08:00;True|2021-04-27T16:34:19.0789205+08:00;True|2021-04-27T14:48:28.8138232+08:00;True|2021-04-27T10:34:03.6370089+08:00;True|2021-04-26T16:18:32.0260755+08:00;True|2021-04-26T15:00:58.6773071+08:00;True|2021-04-26T13:23:50.3968646+08:00;True|2021-04-16T08:50:41.5499248+08:00;True|2021-04-16T08:32:59.1701708+08:00;True|2021-04-16T08:27:36.9176335+08:00;True|2021-04-15T15:56:26.8485667+08:00;True|2021-04-15T15:21:23.2875671+08:00;True|2021-04-15T14:41:16.9980034+08:00;True|2021-04-15T14:36:34.8570017+08:00;True|2021-04-13T16:15:00.7668503+08:00;</History> </PropertyGroup> <ItemGroup> <File Include="apiapp.json"> @@ -19,6 +19,12 @@ </File> <File Include="bin/Antlr3.Runtime.pdb"> <publishTime>02/22/2013 08:43:40</publishTime> </File> <File Include="bin/App_global.asax.compiled"> <publishTime>05/07/2021 20:31:20</publishTime> </File> <File Include="bin/App_global.asax.dll"> <publishTime>05/07/2021 20:31:20</publishTime> </File> <File Include="bin/BLL.dll"> <publishTime>05/06/2021 09:48:41</publishTime> @@ -165,10 +171,10 @@ <publishTime>11/24/2014 11:18:48</publishTime> </File> <File Include="bin/WebAPI.dll"> <publishTime>05/06/2021 18:11:32</publishTime> <publishTime>05/07/2021 20:47:25</publishTime> </File> <File Include="bin/WebAPI.pdb"> <publishTime>05/06/2021 18:11:32</publishTime> <publishTime>05/07/2021 20:47:25</publishTime> </File> <File Include="bin/WebAPI.XmlSerializers.dll"> <publishTime>02/04/2021 21:35:21</publishTime> @@ -244,6 +250,9 @@ </File> <File Include="packages.config"> <publishTime>05/06/2021 09:48:41</publishTime> </File> <File Include="PrecompiledApp.config"> <publishTime>05/07/2021 20:31:19</publishTime> </File> <File Include="Views/Scripts/bootstrap.js"> <publishTime>05/06/2021 09:48:41</publishTime> @@ -342,7 +351,7 @@ <publishTime>05/06/2021 09:48:41</publishTime> </File> <File Include="Web.config"> <publishTime>05/06/2021 18:11:36</publishTime> <publishTime>05/07/2021 20:47:45</publishTime> </File> </ItemGroup> </Project> WebAPI/WebAPI.csproj
@@ -360,9 +360,12 @@ <Compile Include="DLL\ClsQC_NoPassProdCheckBill.cs" /> <Compile Include="DLL\ClsSc_ProcessReport.cs" /> <Compile Include="DLL\ClsSc_ProcessSendWork.cs" /> <Compile Include="DLL\ClsWW_EntrustProcessReportBill.cs" /> <Compile Include="Models\ApiConfig.cs" /> <Compile Include="Models\ApiResult.cs" /> <Compile Include="Models\ClsSc_ProcessSendWorkMain.cs" /> <Compile Include="Models\ClsWW_EntrustProcessReportBillMain.cs" /> <Compile Include="Models\ClsWW_EntrustProcessReportBillSub.cs" /> <Compile Include="Models\DocumentsView.cs" /> <Compile Include="Models\Gy_RoutingBillSub.cs" /> <Compile Include="Models\LookingForBill.cs" /> @@ -377,6 +380,7 @@ <Compile Include="Models\Gy_RoutingBill.cs" /> <Compile Include="Models\StationBill.cs" /> <Compile Include="Models\StationOutBillView.cs" /> <Compile Include="Models\WW_EntrustProcSendWorkViewModel.cs" /> <Compile Include="Models\WW_EntrustWorkOrderViewModel.cs" /> <Compile Include="Properties\Resources.Designer.cs"> <AutoGen>True</AutoGen>