| | |
| | | using System.Collections.Generic; |
| | | using System.Text; |
| | | using System.Data; |
| | | using DBUtility; |
| | | |
| | | namespace DAL |
| | | { |
| | |
| | | "," + oModel.HLevel.ToString() + "," + Convert.ToString(oModel.HEndFlag ? 1 : 0) + "," + Convert.ToString(oModel.HStopflag ? 1 : 0) + ",'" + oModel.HRemark + |
| | | "','" + oModel.HUseFlag + "'," + oModel.HUSEORGID + "," + oModel.HCREATEORGID + ",'" + oModel.HMakeEmp + "','" + System.DateTime.Now + "','" + oModel.HCheckEmp + "','" + oModel.HModifyEmp + "','" + oModel.HStopEmp + "'" + ")", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | |
| | | |
| | | //è·åæ°æ® |
| | | DataSet Ds; |
| | | Int64 ItemID = 0; |
| | | Ds = oCn.RunProcReturn("select MAX(HItemID) HItemID from Gy_TaxMIXMain" , "Gy_TaxMIXMain"); |
| | | if (Ds.Tables[0].Rows.Count != 0 && ClsPub.isLong(Ds.Tables[0].Rows[0]["HItemID"].ToString()) != 0) |
| | | { |
| | | ItemID = ClsPub.isLong(Ds.Tables[0].Rows[0]["HItemID"].ToString()); |
| | | } |
| | | |
| | | //æå
¥å表 |
| | | foreach (Model.ClsGy_TaxMIXSub_Model oSub in DetailColl) |
| | | { |
| | | DataSet Cs; |
| | | Int64 EntryID = 0; |
| | | Cs = oCn.RunProcReturn("select MAX(HEntryID) HEntryID from Gy_TaxMIXSub", "Gy_TaxMIXSub"); |
| | | if (Cs.Tables[0].Rows.Count != 0 && ClsPub.isLong(Cs.Tables[0].Rows[0]["HEntryID"].ToString()) != 0) |
| | | { |
| | | EntryID = ClsPub.isLong(Cs.Tables[0].Rows[0]["HEntryID"].ToString()) + 1; |
| | | } |
| | | |
| | | oCn.RunProc("Insert into Gy_TaxMIXSub " + |
| | | " (HTAXBENCHMARK,FTAXRATEID,FTAXBENCHMARKCORRVALUE,HTaxMixID" + |
| | | " (HTAXBENCHMARK,FTAXRATEID,FTAXBENCHMARKCORRVALUE,HTaxMixID,HEntryID" + |
| | | ") values(" |
| | | + "'" + oSub.HTAXBENCHMARK + "'," + oSub.FTAXRATEID + ",'" + oSub.FTAXBENCHMARKCORRVALUE + "'," + oModel.HItemID + |
| | | + "'" + oSub.HTAXBENCHMARK + "'," + oSub.FTAXRATEID + ",'" + oSub.FTAXBENCHMARKCORRVALUE + "'," + ItemID + "," + EntryID + |
| | | ") "); |
| | | } |
| | | |
| | |
| | | public Int64 HERPInterID; |
| | | public string HERPBillType; |
| | | |
| | | public Int64 HSTOCKERGROUPID; |
| | | public Int64 HSALEGROUPID; |
| | | public Int64 HSALEDEPTID; |
| | | public string HBUSINESSTYPE; |
| | | public Int64 HCARRIERID; |
| | | public Int64 HRECEIVERID; |
| | | public Int64 HSETTLEID; |
| | | public Int64 HPAYERID; |
| | | public Int64 HHEADLOCID; |
| | | public Int64 HRECCONTACTID; |
| | | public Int64 HRECEIPTCONDITIONID; |
| | | public Int64 HCORRESPONDORGID; |
| | | public string HCARRIAGENO; |
| | | } |
| | | } |
| | |
| | | public Int64 HSPID; |
| | | public Int64 HOWNERID; |
| | | public string HOWNERTYPEID; |
| | | public Int64 HSETTLEORGID; |
| | | public string HSETTLEORGID; |
| | | public double HMoveStockQty; |
| | | public Int64 HAuxPropID; |
| | | public string HBatchNO; |
| | |
| | | public Int64 HERPInterID; |
| | | public Int64 HERPEntryID; |
| | | public string HSeORderBillNo; |
| | | |
| | | public string HCUSTMATID; |
| | | public Int64 HBASEUNITID; |
| | | public string HBFLOWID; |
| | | public Int64 HOUTCONTROL; |
| | | public Int64 HSTOCKUNITID; |
| | | public string HROWTYPE; |
| | | public string HROWID; |
| | | public string HPARENTROWID; |
| | | public Int64 HPARENTMATID; |
| | | public Int64 HTAXCOMBINATION; |
| | | public double HPRICECOEFFICIENT; |
| | | public double HSYSPRICE; |
| | | public double HLIMITDOWNPRICE; |
| | | public Int64 HPRICEUNITID; |
| | | public double HTAXPRICE; |
| | | public double HTAXRATE; |
| | | public double HTAXNETPRICE; |
| | | public double HDISCOUNTRATE; |
| | | public Int64 HISFREE; |
| | | public Int64 HLOCALCURRID; |
| | | public Int64 HSETTLECURRID; |
| | | public Int64 HEXCHANGETYPEID; |
| | | public Int64 HSETTLETYPEID; |
| | | public Int64 HRECEIPTCONDITIONID; |
| | | public double HEXCHANGERATE; |
| | | public Int64 HISINCLUDEDTAX; |
| | | public Int64 HISPRICEEXCLUDETAX; |
| | | public Int64 HTAXRATEID; |
| | | public double HTaxRate_TAX; |
| | | public double HCOSTPERCENT; |
| | | public Int64 HVAT; |
| | | public Int64 HSELLERWITHHOLDING; |
| | | public Int64 HBUYERWITHHOLDING; |
| | | } |
| | | } |
| | |
| | | { |
| | | omodel.MES_StationBill_ProcNo = ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HValue"]); |
| | | } |
| | | |
| | | //=========å·¥åºè¿åºç« |
| | | //åªæ¾ç¤ºç¨æ·å¯¹åºå·¥åº |
| | | if (ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HKey"]) == "MES_StationBill_ProcNoByUser") |
| | | { |
| | | omodel.MES_StationBill_ProcNoByUser = ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HValue"]); |
| | | } |
| | | } |
| | | sReturn = "æ¾ç¤ºåæ®æåï¼"; |
| | | return true; |
| | |
| | | |
| | | //å·¥åºè¿ç«å |
| | | public string MES_StationBill_ProcNo; //èªå¨å¹é
æµæ°´å· |
| | | public string MES_StationBill_ProcNoByUser; //åªæ¾ç¤ºç¨æ·å¯¹åºå·¥åº |
| | | |
| | | } |
| | | |
| | |
| | | } |
| | | #endregion |
| | | |
| | | #region å§å¤å·¥åºååºåæµæ°´å·å车è·åæ¡ç ä¿¡æ¯2ï¼å§å¤å·¥åºæ¥æ¶ãå·¥åºè¿ç«æ¥æ¶éç¨ï¼ |
| | | [Route("Cj_StationBill/txtHBarCode_KeyDown2")] |
| | | [HttpGet] |
| | | public object txtHBarCode_KeyDown2(string HBarCode,string HInterID,string UserID) |
| | | { |
| | | try |
| | | { |
| | | if (HBarCode == null || HBarCode.Equals("")) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "空ç½ç ,æ¡å½¢ç ä¸è½ä¸ºç©ºï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | //æåæ¡å½¢ç |
| | | string sBillBarCode = HBarCode.Trim(); |
| | | string[] NewBarCode; |
| | | if (sBillBarCode.CompareTo("#") > 0) |
| | | { |
| | | NewBarCode = sBillBarCode.Split(Convert.ToChar("#")); |
| | | sBillBarCode = NewBarCode[0]; |
| | | } |
| | | string sBillNo = sBillBarCode; |
| | | //æªåæ¡ç ç±»å |
| | | string BillNoType = sBillNo.Substring(0, Math.Min(3, sBillNo.Length)); |
| | | //æªåå
ç |
| | | string BillNo = sBillNo.Substring(3, Math.Min(sBillNo.Length - 3,sBillNo.Length)); |
| | | |
| | | switch (BillNoType) |
| | | //å¾å°ä¿¡æ¯ |
| | | { |
| | | case "HCX"://çäº§èµæºç |
| | | ds = oCN.RunProcReturn("select * from h_v_Gy_SourceList where æ¡ç ç¼å· = '" + BillNo + "'", "h_v_Gy_SourceList"); |
| | | break; |
| | | case "SBM"://设å¤ç |
| | | ds = oCN.RunProcReturn("select * from h_v_Gy_EquipMentList where HItemID = '" + BillNo + "'", "h_v_Gy_EquipMentList"); |
| | | break; |
| | | case "JYM"://åå·¥ç |
| | | ds = oCN.RunProcReturn("select * from h_v_Gy_StaffList where HItemID = '" + BillNo + "'", "h_v_Gy_StaffList"); |
| | | break; |
| | | case "GRM"://åå·¥ç |
| | | ds = oCN.RunProcReturn("select * from h_v_Gy_StaffList where HItemID = '" + BillNo + "'", "h_v_Gy_StaffList"); |
| | | break; |
| | | case "CGM"://åå·¥ç |
| | | ds = oCN.RunProcReturn("select * from h_v_Gy_StaffList where HItemID = '" + BillNo + "'", "h_v_Gy_StaffList"); |
| | | break; |
| | | case "HWH"://ä»åºç |
| | | ds = oCN.RunProcReturn("select * from h_v_Gy_WareHouseList where æ¡ç ç¼å· = '" + HBarCode + "'", "h_v_Gy_WareHouseList"); |
| | | break; |
| | | case "HSP"://ä»ä½ç |
| | | ds = oCN.RunProcReturn("select * from h_v_Gy_StockPlaceList where æ¡ç ç¼å· = '" + HBarCode + "'", "h_v_Gy_StockPlaceList"); |
| | | break; |
| | | case "WKM"://å·¥ä½ä¸å¿ç |
| | | ds = oCN.RunProcReturn("select * from h_v_Gy_WorkCenterList where HItemID = '" + BillNo + "'", "h_v_Gy_WorkCenterList"); |
| | | break; |
| | | case "BZM"://çç»ç |
| | | ds = oCN.RunProcReturn("select * from h_v_Gy_GroupList where æ¡ç ç¼å· = '" + BillNo + "'", "h_v_Gy_GroupList"); |
| | | break; |
| | | case "PRO"://å·¥åºç |
| | | string sReturn = ""; |
| | | if (oSystemParameter.ShowBill(ref sReturn) == true) |
| | | { |
| | | //ç³»ç»åæ°æ¯å¦ä¸ºåªæ¾ç¤ºå½åç»å½ç¨æ·å
³èçå·¥åºä¿¡æ¯,N为å¦ï¼Yä¸ºæ¯ |
| | | if (oSystemParameter.omodel.MES_StationBill_ProcNoByUser == "Y") |
| | | { |
| | | ds = oCN.RunProcReturn("select * from h_v_Gy_ProcessList_GetProcNoByUser where HItemID = '" + BillNo + "' and HInterID = '" + HInterID + "' and ç¨æ·ç¼ç = '" + UserID + "'", "h_v_Gy_ProcessList_GetProcNoByUser"); |
| | | } |
| | | else |
| | | { |
| | | ds = oCN.RunProcReturn("select * from h_v_Gy_ProcessList_GetProcNo where HItemID = '" + BillNo + "' and HInterID = '" + |
| | | HInterID + "'", "h_v_Gy_ProcessList_GetProcNo"); |
| | | } |
| | | } |
| | | break; |
| | | case "WLM"://ç©æç |
| | | ds = oCN.RunProcReturn("select * from h_v_Gy_MaterialList where HItemID = '" + BillNo + "'", "h_v_Gy_MaterialList"); |
| | | break; |
| | | case "GXL"://æµè½¬å¡ |
| | | ds = oCN.RunProcReturn("select top 1 * from h_v_Sc_ProcessExchangeBillList where åæ®å·= '" + sBillNo + "'", "h_v_Sc_ProcessExchangeBillList"); |
| | | break; |
| | | } |
| | | |
| | | //åå
¥ä¿¡æ¯ |
| | | if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æªæ¥è¯¢å°æ¡ç ä¿¡æ¯ï¼"; |
| | | objJsonResult.data = null; |
| | | if(BillNoType == "PRO") |
| | | { |
| | | ds = oCN.RunProcReturn("select * from h_v_Gy_ProcessList where HItemID = '" + BillNo + "'", "h_v_Gy_ProcessList"); |
| | | if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.Message = "æªæ¥è¯¢å°æ¡ç ä¿¡æ¯ï¼"; |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.Message = "ç¨æ·æªå
³èç¸å
³å·¥åºææµè½¬å¡æ æ¤å·¥åºï¼å¦æéè¦è¯·ç»´æ¤"; |
| | | } |
| | | } |
| | | return objJsonResult; |
| | | } |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "Sucessï¼"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exceptionï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region æ ¹æ®ç»å½ç¨æ·è·åå·¥åº |
| | | [Route("Sc_StationInBill/autoGetProcNo")] |
| | | [HttpGet] |
| | | public object autoGetProcNo(string HUserName,string HInterID) |
| | | public object autoGetProcNo(string HUserID, string HInterID) |
| | | { |
| | | string sReturn = ""; |
| | | if (oSystemParameter.ShowBill(ref sReturn) == true) |
| | |
| | | { |
| | | try |
| | | { |
| | | if (HUserName == null || HUserName.Equals("")) |
| | | if (HUserID == null || HUserID.Equals("")) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "ç¨æ·åä¸è½ä¸ºç©ºï¼"; |
| | | objJsonResult.Message = "ç¨æ·ç¼ç ä¸è½ä¸ºç©ºï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | //å¾å°ä¿¡æ¯ |
| | | ds = oCN.RunProcReturn("select * from h_v_Sc_StationBill_autoGetProcNo where HInterID = '" + HInterID + "' and ç¨æ·åç§° ='" + HUserName + "'", "h_v_Sc_StationBill_autoGetProcNo"); |
| | | ds = oCN.RunProcReturn("select * from h_v_Sc_StationBill_autoGetProcNo where HInterID = '" + HInterID + "' and ç¨æ·ç¼ç ='" + HUserID + "'", "h_v_Sc_StationBill_autoGetProcNo"); |
| | | //åå
¥ä¿¡æ¯ |
| | | if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | | { |
New file |
| | |
| | | using Newtonsoft.Json; |
| | | using Newtonsoft.Json.Linq; |
| | | using Pub_Class; |
| | | using System; |
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using System.Data; |
| | | using System.Data.SqlClient; |
| | | using System.Web.Http; |
| | | using WebAPI.Models; |
| | | |
| | | namespace WebAPI.Controllers |
| | | { |
| | | public class Sc_ProcessSendWorkController : ApiController |
| | | { |
| | | private json objJsonResult = new json(); |
| | | public DataSet ds = new DataSet(); |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | |
| | | #region å·¥åºæ´¾å·¥å å表 |
| | | /// <summary> |
| | | /// å·¥åºæ´¾å·¥åå表 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [Route("Sc_ProcessSendWork/Sc_ProcessSendWorkList")] |
| | | [HttpGet] |
| | | public object Sc_ProcessSendWorkList(string sWhere, string user) |
| | | { |
| | | try |
| | | { |
| | | List<object> columnNameList = new List<object>(); |
| | | |
| | | ds = oCN.RunProcReturn("select * from h_v_Sc_ProcessSendWorkList where 1=1 " + sWhere, "h_v_Sc_ProcessSendWorkList"); |
| | | |
| | | //æ·»å åå |
| | | 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 = "è¿åè®°å½æåï¼"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | objJsonResult.list = columnNameList; |
| | | return objJsonResult; |
| | | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "没æè¿åä»»ä½è®°å½ï¼" + ex.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region å·¥åºæ´¾å·¥å ä¿å/ç¼è¾ |
| | | /// <summary> |
| | | /// å·¥åºæ´¾å·¥å ä¿å |
| | | /// </summary> |
| | | /// <param name="msg"></param> |
| | | /// <returns></returns> |
| | | [Route("Sc_ProcessSendWork/SaveProcessSendWork")] |
| | | [HttpPost] |
| | | public object SaveProcessSendWork([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 msg4 = sArray[2].ToString(); |
| | | |
| | | |
| | | string UserName = ""; |
| | | ListModels oListModels = new ListModels(); |
| | | try |
| | | { |
| | | DAL.ClsSc_ProcessSendWork oBill = new DAL.ClsSc_ProcessSendWork(); |
| | | List<Model.ClsSc_ProcessSendWorkMain> lsmain = new List<Model.ClsSc_ProcessSendWorkMain>(); |
| | | msg2 = msg2.Replace("\\", ""); |
| | | msg2 = msg2.Replace("\n", ""); //\n |
| | | lsmain = oListModels.getObjectByJson_ClsSc_ProcessSendWorkMain(msg2); |
| | | foreach (Model.ClsSc_ProcessSendWorkMain oItem in lsmain) |
| | | { |
| | | //oItem.HMaker = ""; |
| | | UserName = oItem.HMaker; //å¶å人 |
| | | oItem.HBillType = "3712"; |
| | | oItem.HBillSubType = "3712"; |
| | | oItem.HBillStatus = 1; |
| | | DBUtility.ClsPub.CurUserName = UserName; |
| | | oItem.HYear = DBUtility.ClsPub.isLong(DateTime.Now.Year); |
| | | |
| | | if (DBUtility.ClsPub.isStrNull(oItem.HDate) == "") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "ä¿åå¤±è´¥ï¼æ²¡æåæ®æ¥æï¼æ æ³ä¿åï¼"; |
| | | objJsonResult.data = 1; |
| | | return objJsonResult; |
| | | } |
| | | oBill.omodel = oItem; |
| | | } |
| | | //è¡¨ä½æ°æ® |
| | | //æ },{æ¥æåæ°ç» //廿ãåã |
| | | msg3 = msg3.Substring(1, msg3.Length - 2); |
| | | msg3 = msg3.Replace("\\", ""); |
| | | msg3 = msg3.Replace("\n", ""); //\n |
| | | //msg2 = msg2.Replace("'", "â"); |
| | | List<Model.ClsSc_ProcessSendWorkSub> ls = new List<Model.ClsSc_ProcessSendWorkSub>(); |
| | | ls = oListModels.getObjectByJson_ClsSc_ProcessSendWorkSub(msg3); |
| | | int i = 0; |
| | | foreach (Model.ClsSc_ProcessSendWorkSub oItemSub in ls) |
| | | { |
| | | |
| | | i++; |
| | | oItemSub.HEntryID = i; |
| | | //oItemSub.HCloseMan = ""; //è¡å
³é |
| | | oItemSub.HEntryCloseDate = DBUtility.ClsPub.isDate(DateTime.Now); |
| | | oItemSub.HCloseType = false; //å
³éç±»å |
| | | //oItemSub.HRemark = ""; //夿³¨ |
| | | oItemSub.HSourceInterID = 0; // æºå主å
ç |
| | | oItemSub.HSourceEntryID = 0; //æºååå
ç |
| | | //oItemSub.HSourceBillNo = ""; //æºååå· |
| | | //oItemSub.HSourceBillType = ""; //æºåç±»å |
| | | oItemSub.HRelationQty = 0; //å
³èæ°é |
| | | //oItemSub.HRelationMoney = 0; //å
³èéé¢ |
| | | //HMaterID = "";//é
件代ç |
| | | //HUnitID = "";//åä½ä»£ç |
| | | //HQty = "";//å®é
ç¨é |
| | | //HQtyMust = "";//åä½ç¨é |
| | | //HRemark = "";//夿³¨ |
| | | |
| | | oBill.DetailColl.Add(oItemSub); |
| | | |
| | | } |
| | | //ä¿å |
| | | //ä¿å宿¯åå¤ç |
| | | bool bResult; |
| | | if (oBill.omodel.HInterID == 0) |
| | | { |
| | | // bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo); |
| | | bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo); |
| | | } |
| | | else |
| | | { |
| | | bResult = oBill.ModifyBill(oBill.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | } |
| | | if (bResult) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "ä¿åæåï¼"; |
| | | 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; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region å·¥åºæ´¾å·¥å å é¤ |
| | | /// <summary> |
| | | /// å·¥åºæ´¾å·¥åå é¤ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [Route("Sc_ProcessSendWork/DelProcessSendWork")] |
| | | [HttpGet] |
| | | public object DelProcessSendWork(string HInterID, string user) |
| | | { |
| | | Int64 lngBillKey = 0; |
| | | lngBillKey = DBUtility.ClsPub.isLong(HInterID); |
| | | if (lngBillKey == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "åæ®ID为空ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | DAL.ClsSc_ProcessSendWork oBill = new DAL.ClsSc_ProcessSendWork(); |
| | | if (oBill.ShowBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo)) |
| | | { |
| | | ds = oCN.RunProcReturn("select * from Sc_ProcessSendWorkMain where HInterID=" + lngBillKey, "Sc_ProcessSendWorkMain"); |
| | | if (int.Parse(ds.Tables[0].Rows[0]["HBillStatus"].ToString()) > 1) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "åæ®å½åå¤äºä¸è½å é¤ç¶æ,ä¸è½å é¤ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | if (ds.Tables[0].Rows[0]["HChecker"].ToString() != "") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "忮已ç»å®¡æ ¸,ä¸è½å é¤ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | bool IsDete = oBill.DeleteBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | if (IsDete) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = DBUtility.ClsPub.sExeReturnInfo; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = DBUtility.ClsPub.sExeReturnInfo; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "åæ®æªæ¾å°"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | } |
| | | } |
| | |
| | | string OrganizationNUM = oCN.RunProcReturn("select HNumber from Xt_ORGANIZATIONS where HItemID=" + OrganizationID, "Xt_ORGANIZATIONS").Tables[0].Rows[0]["HNumber"].ToString(); |
| | | //æ ¹æ®å·¥åºæ±æ¥å主IDè·åå·¥åºæ±æ¥å
¥åºåçæ°æ® |
| | | DataSet ds = oCN.RunProcReturn("select * from h_v_MES_StationOutBillList_LastProc where HInterID=" + InterID, "h_v_MES_StationOutBillList_LastProc"); |
| | | if(ds.Tables[0].Rows.Count <= 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "çæçäº§æ±æ¥åè¿ç¨ä¸æ²¡ææ¥è¯¢å°åºç«å"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | DataRow dr = ds.Tables[0].Rows[0]; |
| | | |
| | | //ä¿å |
| | |
| | | /// <returns></returns> |
| | | [Route("Web/GetProcNoList")] |
| | | [HttpGet] |
| | | public object GetProcNoList(int HInterID,string sWhere) |
| | | public object GetProcNoList(int HInterID,string sWhere,string UserID) |
| | | { |
| | | List<object> columnNameList = new List<object>(); |
| | | try |
| | | { |
| | | ds = oCN.RunProcReturn("exec h_p_Sc_ProcNoList '" + HInterID + "','" + sWhere + "'", "h_p_Sc_ProcNoList"); |
| | | ds = oCN.RunProcReturn("exec h_p_Sc_ProcNoList '" + HInterID + "','" + sWhere + "','" + UserID + "'" , "h_p_Sc_ProcNoList"); |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | |
| | | |
| | | #endregion |
| | | |
| | | #region [忥æä»¶] |
| | | [Route("Xs_SeOutStockBill/Xs_SeOutStockBillSaveApi")] |
| | | [HttpPost] |
| | | public object Xs_SeOutStockBillSaveApi([FromBody] JObject sMainSub) |
| | | { |
| | | try |
| | | { |
| | | //LogService.Write("åè´§éç¥å忥,ä¿åæ¹æ³æ§è¡å®æå¼å¸¸ï¼" + sMainSub.ToString()); |
| | | var model = sMainSub["model"].ToString(); |
| | | var entry = sMainSub["model"]["HENTRY"].ToString(); |
| | | |
| | | model = "[" + model.ToString() + "]"; |
| | | List<ClsXs_SeOutStockBillMain> mainList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<ClsXs_SeOutStockBillMain>>(model); |
| | | List<ClsXs_SeOutStockBillSub> subList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<ClsXs_SeOutStockBillSub>>(entry); |
| | | string sql = string.Empty; |
| | | oCN.BeginTran(); |
| | | sql = $"delete Xs_SeOutStockBillMain where HinterID = {mainList[0].HInterID}"; |
| | | oCN.RunProc(sql); |
| | | sql = $"delete Xs_SeOutStockBillSub where HinterID = {mainList[0].HInterID}"; |
| | | oCN.RunProc(sql); |
| | | //主表 |
| | | oCN.RunProc(@"Insert Into Xs_SeOutStockBillMain |
| | | (HInterID,HYear,HPeriod,HBillType,HBillSubType,HDate,HBillNo,HBillStatus |
| | | ,HCusID,HManagerID,HDeptID,HRemark,HAddress,HSSID,HCurID,HWHID,HExRate |
| | | ,HEmpID,HExplanation,HInnerBillNo,HSALEORGID,HDELIVERYORGID,HOWNERID |
| | | ,HOWNERTYPEID,HERPInterID,HERPBillType,HMaker,HMakeDate,HChecker,HCheckDate |
| | | ,HCloseMan,HCloseDate,HSTOCKERGROUPID,HSALEGROUPID,HSALEDEPTID,HBUSINESSTYPE |
| | | ,HCARRIERID,HRECEIVERID,HSETTLEID,HPAYERID,HHEADLOCID,HRECCONTACTID |
| | | ,HRECEIPTCONDITIONID,HCORRESPONDORGID,HCARRIAGENO) |
| | | values(" + mainList[0].HInterID + "," + DateTime.Now.Year + "," + DateTime.Now.Month + ",'" + 1402 + "','" + |
| | | mainList[0].HBillSubType + "','" + mainList[0].HDate + "','" + mainList[0].HBillNo + "','" + mainList[0].HBillStatus + "'," + mainList[0].HCusID + |
| | | "," + mainList[0].HManagerID + "," + mainList[0].HDeptID + ",'" + mainList[0].HRemark + "','" + mainList[0].HAddress + "'," + mainList[0].HSSID + |
| | | "," + mainList[0].HCurID + "," + mainList[0].HWHID + "," + mainList[0].HExRate + "," + mainList[0].HEmpID + ",'" + mainList[0].HExplanation + "','" + mainList[0].HInnerBillNo + "'," + mainList[0].HSALEORGID + "," + mainList[0].HDELIVERYORGID + "," + mainList[0].HOWNERID + ",'" + |
| | | mainList[0].HOWNERTYPEID + "'," + mainList[0].HERPInterID + ",'" + mainList[0].HERPBillType + "','" + mainList[0].HMaker + "','" + mainList[0].HMakeDate + "','" |
| | | + mainList[0].HChecker + "','" + mainList[0].HCheckDate + "','" + mainList[0].HCloseMan + "','" + mainList[0].HCloseDate + "'," + mainList[0].HSTOCKERGROUPID + "," |
| | | + mainList[0].HSALEGROUPID + "," + mainList[0].HSALEDEPTID + ",'" + mainList[0].HBUSINESSTYPE + "'," + mainList[0].HCARRIERID + "," + mainList[0].HRECEIVERID + "," + mainList[0].HSETTLEID + "," + mainList[0].HPAYERID + "," + mainList[0].HHEADLOCID + "," + mainList[0].HRECCONTACTID + "," + mainList[0].HRECEIPTCONDITIONID + "," + mainList[0].HCORRESPONDORGID + ",'" + mainList[0].HCARRIAGENO + "'" + ")"); |
| | | //ä¿å主表 |
| | | foreach (var oSub in subList) |
| | | { |
| | | sql = $@" |
| | | Insert into Xs_SeOutStockBillSub |
| | | (HInterID,HEntryID,HMaterID,HUnitID,HQty,HPrice,HMoney,HWHID,HSPID,HRemark, |
| | | HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HSeOrderInterID, |
| | | HSeOrderEntryID,HSeORderBillNo,HOWNERID,HOWNERTYPEID,HSETTLEORGID,HMoveStockQty, |
| | | HRelationQty,HAuxPropID,HBatchNO,HMTONo,HERPInterID,HERPEntryID,HCUSTMATID, |
| | | HBASEUNITID,HBFLOWID,HOUTCONTROL,HSTOCKUNITID,HROWTYPE,HROWID,HPARENTROWID, |
| | | HPARENTMATID,HTAXCOMBINATION,HPRICECOEFFICIENT,HSYSPRICE,HLIMITDOWNPRICE, |
| | | HPRICEUNITID,HTAXPRICE,HTAXRATE,HTAXNETPRICE,HDISCOUNTRATE,HISFREE,HLOCALCURRID, |
| | | HSETTLECURRID,HEXCHANGETYPEID,HSETTLETYPEID,HRECEIPTCONDITIONID,HEXCHANGERATE, |
| | | HISINCLUDEDTAX,HISPRICEEXCLUDETAX,HTAXRATEID,HTaxRate_TAX,HCOSTPERCENT,HVAT, |
| | | HSELLERWITHHOLDING,HBUYERWITHHOLDING) |
| | | values('{oSub.HInterID}','{oSub.HEntryID}','{oSub.HMaterID}','{oSub.HUnitID}','{oSub.HQty}','{oSub.HPrice}','{oSub.HMoney}','{oSub.HWHID}','{oSub.HSPID}','{oSub.HRemark}','{oSub.HSourceInterID}', |
| | | '{oSub.HSourceEntryID}','{oSub.HSourceBillNo}','{oSub.HSourceBillType}','{oSub.HSeOrderInterID}','{oSub.HSeOrderEntryID}','{oSub.HSeORderBillNo}','{oSub.HOWNERID}','{oSub.HOWNERTYPEID}','{oSub.HSETTLEORGID}','{oSub.HMoveStockQty}', |
| | | '{oSub.HRelationQty}','{oSub.HAuxPropID}','{oSub.HBatchNO}','{oSub.HMTONo}','{oSub.HERPInterID}', |
| | | '{oSub.HERPEntryID}','{oSub.HCUSTMATID}','{oSub.HBASEUNITID}','{oSub.HBFLOWID}','{oSub.HOUTCONTROL}','{oSub.HSTOCKUNITID}','{oSub.HROWTYPE}', |
| | | '{oSub.HROWID}','{oSub.HPARENTROWID}', |
| | | '{oSub.HPARENTMATID}','{oSub.HTAXCOMBINATION}','{oSub.HPRICECOEFFICIENT}','{oSub.HSYSPRICE}','{oSub.HLIMITDOWNPRICE}','{oSub.HPRICEUNITID}','{oSub.HTAXPRICE}','{oSub.HTAXRATE}','{oSub.HTAXNETPRICE}','{oSub.HDISCOUNTRATE}','{oSub.HISFREE}', |
| | | '{oSub.HLOCALCURRID}','{oSub.HSETTLECURRID}','{oSub.HEXCHANGETYPEID}','{oSub.HSETTLETYPEID}','{oSub.HRECEIPTCONDITIONID}','{oSub.HEXCHANGERATE}','{oSub.HISINCLUDEDTAX}','{oSub.HISPRICEEXCLUDETAX}','{oSub.HTAXRATEID}', |
| | | '{oSub.HTaxRate_TAX}','{oSub.HCOSTPERCENT}','{oSub.HVAT}','{oSub.HSELLERWITHHOLDING}','{oSub.HBUYERWITHHOLDING}')"; |
| | | oCN.RunProc(sql); |
| | | } |
| | | oCN.Commit(); |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "åæ®ä¿åæåï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | LogService.Write("åè´§éç¥å忥å¼å¸¸,ä¿åæ¹æ³æ§è¡å®æå¼å¸¸ï¼" + e.Message.ToString()); |
| | | |
| | | oCN.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "ä¿å失败ï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region [忥忮] |
| | | [Route("Xs_SeOutStockBill/Xs_SeOutStockBillViewApi")] |
| | | [HttpGet] |
| | |
| | | { |
| | | DAL.ClsGy_TaxMIX_Ctl oBill = new DAL.ClsGy_TaxMIX_Ctl(); |
| | | List<Model.ClsGy_TaxMIXMain_Model> lsmain = new List<Model.ClsGy_TaxMIXMain_Model>(); |
| | | //List<Model.ClsGy_TaxMIXSub_Model> lssub = new List<Model.ClsGy_TaxMIXSub_Model>(); |
| | | List<Model.ClsGy_TaxMIXSub_Model> lssub = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsGy_TaxMIXSub_Model>>(msg2); |
| | | |
| | | msg1 = msg1.Replace("\\", ""); |
| | | msg1 = msg1.Replace("\n", ""); //\n |
| | | lsmain = oListModels.getObjectByJson_Gy_TaxMIXMain(msg1); |
| | |
| | | oItem.HLevel = 1; //ç级 DBUtility.ClsPub.GetLevel(oItem.HNumber.Trim()) |
| | | oBill.oModel = oItem; |
| | | } |
| | | foreach (Model.ClsGy_TaxMIXSub_Model oItemSub in lssub) |
| | | { |
| | | oBill.DetailColl.Add(oItemSub); |
| | | } |
| | | //ä¿å |
| | | //ä¿å宿¯åå¤ç |
| | | bool bResult; |
| | |
| | | } |
| | | |
| | | oCN.RunProc("delete from Gy_TaxMIXMain where HItemID=" + HItemID); |
| | | oCN.RunProc("delete from Gy_TaxMIXSub where HTaxMixID=" + HItemID); |
| | | oCN.RunProc("delete from Gy_TaxMIXSub where HItemID=" + HItemID); |
| | | oCN.Commit();//æäº¤äºå¡ |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | |
| | | return list; |
| | | } |
| | | |
| | | ///å·¥åºæ´¾å·¥å 主表 |
| | | ///ClsSc_ProcExchWorkBackBillMain |
| | | public List<Model.ClsSc_ProcessSendWorkMain> getObjectByJson_ClsSc_ProcessSendWorkMain(string jsonString) |
| | | { |
| | | jsonString = "[" + jsonString.ToString() + "]"; |
| | | List<Model.ClsSc_ProcessSendWorkMain> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsSc_ProcessSendWorkMain>>(jsonString); |
| | | return list; |
| | | } |
| | | |
| | | ///å·¥åºæ´¾å·¥å å表 |
| | | ///ClsSc_ProcExchWorkBackBillMain |
| | | public List<Model.ClsSc_ProcessSendWorkSub> getObjectByJson_ClsSc_ProcessSendWorkSub(string jsonString) |
| | | { |
| | | jsonString = "[" + jsonString.ToString() + "]"; |
| | | List<Model.ClsSc_ProcessSendWorkSub> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsSc_ProcessSendWorkSub>>(jsonString); |
| | | return list; |
| | | } |
| | | |
| | | ///è®¾å¤æäº§æ£éªéªæ¶å å表 |
| | | ///ClsSb_EquipWorkBeforeCheckBillSub |
| | | public List<Model.ClsSb_EquipWorkBeforeCheckBillSub> getObjectByJson_ClsSb_EquipWorkBeforeCheckBillSub(string jsonString) |
| | |
| | | <Compile Include="Controllers\CJGL\Cj_StationOutBillController.cs" /> |
| | | <Compile Include="Controllers\CJGL\Cj_StationInBillController.cs" /> |
| | | <Compile Include="Controllers\CJGL\Cj_StationEntrustOutBillController.cs" /> |
| | | <Compile Include="Controllers\CJGL\Sc_ProcessSendWorkController.cs" /> |
| | | <Compile Include="Controllers\CJGL\Sc_ProcExchWorkBackBillController.cs" /> |
| | | <Compile Include="Controllers\CJGL\Sc_WorkBillAutoSortBillMainController.cs" /> |
| | | <Compile Include="Controllers\Gy_MateMouldController.cs" /> |
| | |
| | | <Folder Include="Views\Sc_MouldScrapRequestBill\" /> |
| | | <Folder Include="Views\Sc_MouldStatusChangeBill\" /> |
| | | <Folder Include="Views\Sc_ProcessExchangeIssueBill\" /> |
| | | <Folder Include="Views\Sc_ProcessSendWork\" /> |
| | | <Folder Include="Views\Sc_WorkBillAutoSortBillMain\" /> |
| | | <Folder Include="Views\Sc_WorkBillSortBill\" /> |
| | | <Folder Include="Views\Sc_WorkDemandPlanBill\" /> |