| | |
| | | |
| | | #endregion |
| | | |
| | | #region æ£éªå ä¸ä¼ çå |
| | | |
| | | #region æ£éªå åæ ¼å |
| | | |
| | | /// <summary> |
| | | /// æ£éªåæ°å¢ä¸ä¼ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [Route("WEBSController/set_SaveQCPOStockInCheckBill_Json")] |
| | | [HttpPost] |
| | | public object set_SaveQCPOStockInCheckBill_Json(Int64 HInterID, string HBillNo, string HSourceBillType, string HSourceBillNo, Int64 HSourceInterID, string sHSourceEntryID, Int64 HFirstCheckEmp, string HMaker) |
| | | { |
| | | try |
| | | { |
| | | ClsQC_POStockInCheckBillMain oMain = new ClsQC_POStockInCheckBillMain(); |
| | | oMain.HInterID = HInterID; |
| | | oMain.HBillNo = HBillNo; |
| | | oMain.HBillType = "7503"; |
| | | oMain.HDate = DateTime.Today; |
| | | oMain.HMainSourceBillType = HSourceBillType; |
| | | oMain.HMainSourceBillNo = HSourceBillNo; |
| | | oMain.HMainSourceInterID = HSourceInterID; |
| | | oMain.HFirstCheckEmp = HFirstCheckEmp; |
| | | oMain.HMaker = HMaker; |
| | | |
| | | if (set_SaveQCPOStockInCheckBill(oMain, HSourceBillType, sHSourceEntryID, ref DBUtility.ClsPub.sErrInfo)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = DBUtility.ClsPub.sErrInfo; //æåï¼ |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = DBUtility.ClsPub.sErrInfo; //å¤±è´¥ï¼ |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ£éªåä¸ä¼ 失败ï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | //çææ£éªå |
| | | public bool set_SaveQCPOStockInCheckBill(Model.ClsQC_POStockInCheckBillMain oMain, string HSourceBillType, string sHSourceEntryID, ref string sErrMsg) |
| | | { |
| | | string sRemark = ""; |
| | | string HReturn; |
| | | |
| | | //ä¸ä¼ å夿 |
| | | SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); |
| | | DataSet BfDs = oCn.RunProcReturn("exec h_p_QC_BeforeUpload_POStockInCheckBill " + oMain.HInterID.ToString() + ",'" + oMain.HBillNo + "','" + HSourceBillType + "','" + sHSourceEntryID + "'," + oMain.HFirstCheckEmp.ToString(), "h_p_QC_BeforeUpload_POStockInCheckBill"); |
| | | if (BfDs == null || BfDs.Tables[0].Rows.Count == 0) |
| | | { |
| | | sErrMsg = "ä¸ä¼ åå¤ææ°æ®å®æ´æ§å¤±è´¥ï¼"; |
| | | return false; |
| | | } |
| | | else |
| | | { |
| | | if (DBUtility.ClsPub.isLong(BfDs.Tables[0].Rows[0][0]) == 1) |
| | | { |
| | | sErrMsg = "åæ®å·ï¼" + oMain.HBillNo + "ï¼åæ®IDï¼" + oMain.HInterID + "ï¼" + DBUtility.ClsPub.isStrNull(BfDs.Tables[0].Rows[0]["HRemark"]); |
| | | return false; |
| | | } |
| | | } |
| | | sRemark = sRemark + " ï¼ä¸ä¼ å夿" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss:ffff"); |
| | | |
| | | //è¿åæéæ°æ® |
| | | DataSet Ds; |
| | | Ds = oCn.RunProcReturn("exec h_p_QC_POStockInCheckBill_CLD " + oMain.HMainSourceInterID.ToString() + ",'" + sHSourceEntryID + "'," + oMain.HFirstCheckEmp.ToString(), "h_p_QC_POStockInCheckBill_CLD"); |
| | | if (Ds == null || Ds.Tables[0].Rows.Count == 0 || Ds.Tables[1].Rows.Count == 0) |
| | | { |
| | | sErrMsg = "æ ¹æ®æ¶æéç¥åï¼" + oMain.HMainSourceBillNo + " è·åæ°æ®å¤±è´¥ï¼"; |
| | | return false; |
| | | } |
| | | sRemark = sRemark + " ï¼è·åCLOUDåæ®APIéå
¥å¼" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss:ffff"); |
| | | |
| | | //è·ååæ®ä¸»è¡¨æéæ°æ® |
| | | oMain.HSupID = Pub_Class.ClsPub.isLong(Ds.Tables[0].Rows[0]["HSupID"]); |
| | | oMain.HSTOCKORGID = Pub_Class.ClsPub.isLong(Ds.Tables[0].Rows[0]["HSTOCKORGID"]); |
| | | |
| | | //è·åç³»ç»åæ° |
| | | Pub_Class.ClsXt_SystemParameter oSystemParameter = new Pub_Class.ClsXt_SystemParameter(); |
| | | if (oSystemParameter.ShowBillByOrgID(oMain.HSTOCKORGID, ref sErrMsg) == false) |
| | | { |
| | | sErrMsg = "è·åç³»ç»åæ°å¤±è´¥ï¼ " + sErrMsg; |
| | | return false; |
| | | } |
| | | |
| | | try |
| | | { |
| | | //夿ä¼è®¡ææ¯å¦åç |
| | | string s = ""; |
| | | int sYear = 0; |
| | | int sPeriod = 0; |
| | | if (DBUtility.Xt_BaseBillFun.Fun_AllowYearPeriod(oMain.HDate, ref sYear, ref sPeriod, ref s) == false) |
| | | { |
| | | sErrMsg = s; |
| | | return false; |
| | | } |
| | | oMain.HYear = sYear; |
| | | oMain.HPeriod = sPeriod; |
| | | |
| | | oCn.BeginTran(); |
| | | //çææ£éªå |
| | | //åå
¥ä¸»è¡¨ |
| | | oCn.RunProc("Insert Into QC_POStockInCheckBillMain " + |
| | | "(HBillType,HBillSubType,HInterID,HBillNo,HDate,HMaker,HMakeDate" + |
| | | ",HYear,HPeriod,HRemark,HSTOCKORGID,HSupID,HMaterID" + |
| | | ",HInstockQty,HCheckQty,HRightQty,HBadQty,HFirstCheckEmp" + |
| | | ",HCheckerResult,HSteelStoveNo,HSteelCompReport,HAspect,HSize" + |
| | | ") " + |
| | | " values('" + oMain.HBillType + "','" + oMain.HBillType + "'," + oMain.HInterID.ToString() + ",'" + oMain.HBillNo + "','" + oMain.HDate.ToShortDateString() + "','" + oMain.HMaker + "',getdate()" + |
| | | ", " + oMain.HYear.ToString() + "," + oMain.HPeriod.ToString() + ",'" + oMain.HRemark + "'," + oMain.HSTOCKORGID.ToString() + "," + oMain.HSupID.ToString() + "," + oMain.HMaterID.ToString() + |
| | | ", " + oMain.HCheckQty.ToString() + "," + oMain.HCheckQty.ToString() + "," + oMain.HRightQty.ToString() + "," + oMain.HBadQty.ToString() + "," + oMain.HFirstCheckEmp.ToString() + |
| | | ",'" + oMain.HCheckerResult + "','" + oMain.HSteelStoveNo + "','" + oMain.HSteelCompReport + "','" + oMain.HAspect + "','" + oMain.HSize + "'" + |
| | | ") "); |
| | | |
| | | //åå
¥å表 |
| | | for (int i = 0; i < Ds.Tables[1].Rows.Count; i++) |
| | | { |
| | | Model.ClsQC_POStockInCheckBillSub oSub = new Model.ClsQC_POStockInCheckBillSub(); |
| | | oSub.HEntryID = i + 1; |
| | | oSub.HSourceInterID = Pub_Class.ClsPub.isLong(Ds.Tables[1].Rows[i]["HSourceInterID"]); |
| | | oSub.HSourceEntryID = Pub_Class.ClsPub.isLong(Ds.Tables[1].Rows[i]["HSourceEntryID"]); |
| | | oSub.HSourceBillNo = Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["HSourceBillNo"]); |
| | | oSub.HSourceBillType = Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["HSourceBillType"]); |
| | | oSub.HResult = "åæ ¼"; |
| | | oSub.HProcCheckEmp = oMain.HFirstCheckEmp; |
| | | oSub.HMaterID = Pub_Class.ClsPub.isLong(Ds.Tables[1].Rows[i]["HMaterID"]); |
| | | oSub.HInStockQty = Pub_Class.ClsPub.isDoule(Ds.Tables[1].Rows[i]["HInStockQty"]); |
| | | oSub.HCheckQty = Pub_Class.ClsPub.isDoule(Ds.Tables[1].Rows[i]["HCheckQty"]); |
| | | oSub.HRightQty = Pub_Class.ClsPub.isDoule(Ds.Tables[1].Rows[i]["HRightQty"]); |
| | | oSub.HBadQty = Pub_Class.ClsPub.isDoule(Ds.Tables[1].Rows[i]["HBadQty"]); |
| | | |
| | | oCn.RunProc("Insert Into QC_POStockInCheckBillSub " + |
| | | "(HInterID,HEntryID,,HBillNo_bak,HRemark" + |
| | | ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType" + |
| | | ",HQCCheckClassID,HQCCheckItemID,HQCStd,HQCRelValue" + |
| | | "HResult,HProcCheckEmp,HProcCheckTime" + |
| | | "HMaterID,HInStockQty,HCheckQty,HRightQty,HBadQty" + |
| | | ") " + |
| | | " values(" + oMain.HInterID.ToString() + "," + oSub.HEntryID.ToString() + ",'" + oMain.HBillNo + "','" + oSub.HRemark + "'" + |
| | | ", " + oSub.HSourceInterID.ToString() + "," + oSub.HSourceEntryID.ToString() + ",'" + oSub.HSourceBillNo + "','" + oSub.HSourceBillType + "'" + |
| | | ", " + oSub.HQCCheckClassID.ToString() + "," + oSub.HQCCheckItemID.ToString() + ",'" + oSub.HQCStd + "','" + oSub.HQCRelValue + "'" + |
| | | ",'" + oSub.HResult + "'," + oSub.HProcCheckEmp.ToString() + "',getdate()" + |
| | | ", " + oSub.HMaterID.ToString() + "," + oSub.HInStockQty.ToString() + "," + oSub.HCheckQty.ToString() + "," + oSub.HRightQty.ToString() + "," + oSub.HBadQty.ToString() + |
| | | ") "); |
| | | } |
| | | sRemark = sRemark + " ï¼çææ£éªååæ®" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss:ffff"); |
| | | |
| | | //è·åéè¶äºAPIæééå
¥æ°æ® |
| | | string sJson_MainCustom = ""; //主表èªå®ä¹å段 |
| | | sJson_MainCustom = Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["MainCustom"]); |
| | | |
| | | string sJson_Main = "{\"Creator\":\"\",\"NeedUpDateFields\":[],\"NeedReturnFields\":[],\"IsDeleteEntry\":\"True\",\"SubSystemId\":\"\",\"IsVerifyBaseDataField\":\"false\",\"IsEntryBatchFill\":\"True\",\"Model\":{\"FBillNo\":\"" + oMain.HBillNo + "\"," + |
| | | //\"FID\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FID"]) + "\"," + |
| | | "\"FBillTypeID\":{ \"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FBillTypeID"]) + "\" }," + |
| | | "\"FBusinessType\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FBusinessType"]) + "\"," + |
| | | "\"FDATE\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FDATE"]) + "\"," + |
| | | "\"FSourceOrgId\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FSourceOrgId"]) + "\"}," + |
| | | "\"FInspectOrgId\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FInspectOrgId"]) + "\"}," + |
| | | "\"FInspectDepId\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FInspectDepId"]) + "\"}," + |
| | | //"\"FInspectGroupId\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FInspectGroupId"]) + "\"}," + |
| | | "\"FInspectorId\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FInspectorId"]) + "\"}," + |
| | | //"\"FDescription\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FDescription"]) + "\"," + |
| | | //"\"FUpScanBox\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FUpScanBox"]) + "\"," + |
| | | //"\"FDefScanBox\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FDefScanBox"]) + "\"," + |
| | | //"\"FCheckQty\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FCheckQty"]) + "\"," + |
| | | //"\"FInspectValScanBox\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FInspectValScanBox"]) + "\"," + |
| | | "\"FIsSynced\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FIsSynced"]) + "\"," + |
| | | sJson_MainCustom + |
| | | "\"FEntity\":["; |
| | | string sJson_Entry = ""; |
| | | for (int i = 0; i < Ds.Tables[1].Rows.Count; i++) |
| | | { |
| | | if (sJson_Entry != "") |
| | | { |
| | | sJson_Entry = sJson_Entry + " , "; |
| | | } |
| | | string sJson_BatchNo = ""; |
| | | string sJson_StockPlace = ""; |
| | | string sJson_FProduceDate = ""; //çäº§æ¥æ |
| | | string sJson_FExpiryDate = ""; //æææè³ |
| | | string sJson_FAUXPROPID = ""; |
| | | string sJson_SubCustom = ""; //å表èªå®ä¹å段 |
| | | |
| | | //å表èªå®ä¹å段 |
| | | sJson_SubCustom = Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["SubCustom"]); |
| | | |
| | | //æ¯å¦å¯ç¨æ¹æ¬¡ç®¡ç |
| | | if (Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["HISBATCHMANAGE"]) == "1") |
| | | { |
| | | sJson_BatchNo = " \"FLOT\": {\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FLOT"]) + "\"}, \"FLOT_TEXT\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FLOT"]) + "\" , "; |
| | | } |
| | | else |
| | | { |
| | | sJson_BatchNo = ""; |
| | | } |
| | | |
| | | //æ¯å¦å¯ç¨ä¿è´¨ææ§å¶ |
| | | if (Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FISKFPERIOD"]) == "1") |
| | | { |
| | | sJson_FProduceDate = " \"FProduceDate\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FProduceDate"]) + "\","; |
| | | sJson_FExpiryDate = " \"FExpiryDate\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FExpiryDate"]) + "\","; |
| | | } |
| | | else |
| | | { |
| | | sJson_FProduceDate = ""; |
| | | sJson_FExpiryDate = ""; |
| | | } |
| | | |
| | | //æ¯å¦å¯ç¨ä»ä½ |
| | | if (Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FStockLocId"]) == "") |
| | | { |
| | | sJson_StockPlace = ""; |
| | | } |
| | | else |
| | | { |
| | | sJson_StockPlace = Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FStockLocId"]) + "\"}},"; |
| | | } |
| | | |
| | | //è¾
å©å±æ§ |
| | | sJson_FAUXPROPID = " \"FAUXPROPID\":{\"FAUXPROPID__FF100002\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FAUXPROPID"]) + "\"}},"; |
| | | |
| | | sJson_Entry = sJson_Entry + "{" + |
| | | //"FEntryID": 0, |
| | | "\"FMaterialId\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FMaterialId"]) + "\"}," + |
| | | //"FQCSchemeId": {"FNUMBER": ""}, |
| | | "\"FUnitID\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FUnitID"]) + "\"}," + |
| | | "\"FInspectQty\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FInspectQty"]) + "\"," + //æ£éªæ°é |
| | | "\"FQualifiedQty\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FQualifiedQty"]) + "\"," + //åæ ¼æ°é |
| | | "\"FUnqualifiedQty\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FUnqualifiedQty"]) + "\"," + //ä¸åæ ¼æ°é |
| | | //"FSampleDamageQty": 0, |
| | | //"FSUnqualifiedQty": 0, |
| | | "\"FInspectResult\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FInspectResult"]) + "\"," + //æ£éªç»æ |
| | | "\"FQCStatus\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FQCStatus"]) + "\"," + //è´¨æ£ç¶æ |
| | | //"FBaseSUnqualifiedQty": 0, |
| | | //"FSampleQty": 0, |
| | | //"FMemo": "", |
| | | "\"FIsRelated\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FIsRelated"]) + "\"," + |
| | | "\"FSrcBillType0\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FSrcBillType0"]) + "\"," + |
| | | "\"FSrcBillNo0\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FSrcBillNo0"]) + "\"," + |
| | | "\"FSrcInterId0\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FSrcInterId0"]) + "\"," + |
| | | "\"FSrcEntryId0\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FSrcEntryId0"]) + "\"," + |
| | | "\"FSrcEntrySeq0\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FSrcEntrySeq0"]) + "\"," + |
| | | "\"FBaseUnitId\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FBaseUnitId"]) + "\"}," + |
| | | //"FQCBusinessType": "", |
| | | //"FBFLowId": {"FNAME": ""}, |
| | | //"FSampleSchemeId": {"FNUMBER": ""}, |
| | | //"FAcceptQty": 0, |
| | | //"FRejectQty": 0, |
| | | //"FInspectEndDate": "1900-01-01", |
| | | "\"FBaseInspectQty\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FBaseInspectQty"]) + "\"," + //åºæ¬å使£éªæ°é |
| | | "\"FSupplierId\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FSupplierId"]) + "\"}," + |
| | | //"FCustomerId": {"FNUMBER": ""}, |
| | | //"FProductLineId": {"FNUMBER": ""}, |
| | | //"FPrdLineLocation": {"FLOCATIONCODE": ""}, |
| | | //"FWorkshopId": {"FNUMBER": ""}, |
| | | "\"FStockId\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FStockId"]) + "\"}," + |
| | | sJson_BatchNo + |
| | | "\"FInspectTimes\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FInspectTimes"]) + "\"," + //æ£éªæ¬¡æ° |
| | | sJson_StockPlace + |
| | | //"FConsumeTime": 0, |
| | | //"FInspectStartDate": "1900-01-01", |
| | | "\"FTimeUnit\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FTimeUnit"]) + "\"," + |
| | | //"FBaseSampleDamageQty": 0, |
| | | //"FBaseUnqualifiedQty": 0, |
| | | //"FOperNumber": 0, |
| | | "\"FSampleDamageBearer\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FSampleDamageBearer"]) + "\"," + |
| | | "\"FIsFirstInspect\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FIsFirstInspect"]) + "\"," + |
| | | "\"FBaseQualifiedQty\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FBaseQualifiedQty"]) + "\"," + //åºæ¬åä½åæ ¼æ° |
| | | "\"FBaseAcceptQty\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FBaseAcceptQty"]) + "\"," + //åºæ¬å使¥æ¶æ° |
| | | sJson_FAUXPROPID + |
| | | //"FPrdUnitId": {"FNumber": ""}, |
| | | //"FBaseReAcceptQty": 0, |
| | | //"FOperDescription": "", |
| | | //"FUnitTransHeadQty": 0, |
| | | //"FUnitTransOperQty": 0, |
| | | //"FSNUnitID": {"FNumber": ""}, |
| | | //"FBaseWBInspectQty": 0, |
| | | //"FBaseUnQuaSalQty": 0, |
| | | //"FSupplierLot": "", |
| | | sJson_FProduceDate + |
| | | sJson_FExpiryDate + |
| | | //"FNewExpiryDate": "1900-01-01", |
| | | "\"FCurrency\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FCurrency"]) + "\"}," + |
| | | //"FDiscountQty": 0, |
| | | "\"FIsSplitRow\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FIsSplitRow"]) + "\"," + |
| | | sJson_SubCustom + |
| | | |
| | | //使ç¨å³çè¡¨ä½ |
| | | "\"FPolicyDetail\": [ { " + |
| | | //"FDetailID": 0, |
| | | "\"FPolicyMaterialId\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FPolicyMaterialId"]) + "\"}," + |
| | | "\"FPolicyStatus\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FPolicyStatus"]) + "\"," + |
| | | "\"FPolicyQty\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FPolicyQty"]) + "\"," + |
| | | "\"FBasePolicyQty\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FBasePolicyQty"]) + "\"," + |
| | | "\"FUsePolicy\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FUsePolicy"]) + "\"," + |
| | | //"FSerialId": { "FNUMBER": ""}, |
| | | "\"FIsCheck\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FIsCheck"]) + "\"," + |
| | | "\"FIsDefectProcess\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FIsDefectProcess"]) + "\"," + |
| | | "\"FCanSale\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FCanSale"]) + "\"," + |
| | | "\"FIsMRBReview\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FIsMRBReview"]) + "\"," + |
| | | "\"FIsReturn\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FIsReturn"]) + "\"," + |
| | | "\"FIsRelatedDefect\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FIsRelatedDefect"]) + "\"" + |
| | | //"FMRBReviewStatus": "", |
| | | //"FBoxNumber": "", |
| | | //"FMemo1": "", |
| | | //"FPolicyAuxPropId": {"FPOLICYAUXPROPID__FF100005": { "FNumber": ""},"FPOLICYAUXPROPID__FF100002": { "FNumber": ""}} |
| | | " } ]," + |
| | | |
| | | //缺é·è®°å½è¡¨ä½ |
| | | //"\"FDefectDetail\": [ { " + |
| | | ////"FDetailID": 0, |
| | | ////"FDSerialId": {"FNUMBER": ""}, |
| | | ////"FDefectTypeId": {"FNUMBER": ""}, |
| | | ////"FDefectQty": 0, |
| | | ////"FBaseDefectQty1": 0, |
| | | ////"FDefectReasonId": {"FNUMBER": ""}, |
| | | ////"FDefectLevel": "", |
| | | ////"FDefectResultId": {"FNUMBER": ""}, |
| | | ////"FDefectMemo": "" |
| | | //" } ]," + |
| | | |
| | | //æ£éªé¡¹ç®è¡¨ä½ |
| | | //"\"FItemDetail\": [ { " + |
| | | ////"FDetailID": 0, |
| | | ////"FInspectItemId": { "FNUMBER": ""}, |
| | | ////"FInspectResult1": "", |
| | | ////"FAnalysisMethod": "", |
| | | ////"FQualityStdId": { "FNUMBER": ""}, |
| | | ////"FUnitId2": { "FNUMBER": ""}, |
| | | ////"FInspectValQ": 0, |
| | | ////"FInspectValB": { "FNUMBER": ""}, |
| | | ////"FInspectValT": "", |
| | | ////"FInspectMethodId": { "FNUMBER": ""}, |
| | | ////"FInspectInstrumentId": { "FNUMBER": ""}, |
| | | ////"FDefectlevel1": "", |
| | | ////"FDestructInspect": "false", |
| | | ////"FKeyInspect": "false", |
| | | ////"FInspectBasisId": { "FNUMBER": ""}, |
| | | ////"FSampleSchemeId1": { "FNUMBER": ""}, |
| | | ////"FItemStatus": "", |
| | | ////"FCompareSymbol": "", |
| | | ////"FSampleQty1": 0, |
| | | ////"FAcceptQty1": 0, |
| | | ////"FRejectQty1": 0, |
| | | ////"FSampleDamageQty1": 0, |
| | | ////"FBaseSampleDamageQty1": 0, |
| | | ////"FItemMemo": "", |
| | | ////"FSUnqualifiedQty1": 0, |
| | | ////"FBaseSUnqualifiedQty1": 0, |
| | | ////"FTargetVal": "", |
| | | ////"FInspectVal": "", |
| | | ////"FUpLimit": "", |
| | | ////"FDownLimit": "", |
| | | ////"FUpOffset": "", |
| | | ////"FDownOffset": "", |
| | | ////"FInspectValKey": "", |
| | | ////"FTargetValKey": "", |
| | | ////"FUpLimitKey": "", |
| | | ////"FDownLimitKey": "", |
| | | ////"FUpOffsetKey": "", |
| | | ////"FDownOffsetKey": "", |
| | | ////"FTargetValQ": 0, |
| | | ////"FUpLimitQ": 0, |
| | | ////"FDownLimitQ": 0, |
| | | ////"FUpOffsetQ": 0, |
| | | ////"FDownOffsetQ": 0, |
| | | ////"FTargetValB": { "FNUMBER": ""}, |
| | | ////"FUpLimitB": { "FNUMBER": ""}, |
| | | ////"FDownLimitB": { "FNUMBER": ""}, |
| | | ////"FUpOffsetB": { "FNUMBER": ""}, |
| | | ////"FDownOffsetB": { "FNUMBER": ""}, |
| | | ////"FTargetValT": "", |
| | | ////"FUpLimitT": "", |
| | | ////"FDownLimitT": "", |
| | | ////"FUpOffsetT": "", |
| | | ////"FDownOffsetT": "", |
| | | ////"FValueGrid": [ |
| | | //// { |
| | | //// "FGridId": 0, |
| | | //// "FInspectResult2": "", |
| | | //// "FInspectValueB": { "FNUMBER": ""}, |
| | | //// "FInspectValueT": "", |
| | | //// "FInspectValue": 0, |
| | | //// "FVSerialId": { "FNUMBER": ""} |
| | | //// } |
| | | ////] |
| | | //" } ]," + |
| | | |
| | | //åèè¡¨ä½ |
| | | "\"FReferDetail\": [ { " + |
| | | //"FDetailID": 0, |
| | | "\"FSrcBillType\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FSrcBillType"]) + "\"," + |
| | | "\"FSrcBillNo\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FSrcBillNo"]) + "\"," + |
| | | "\"FSrcInterId\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FSrcInterId"]) + "\"," + |
| | | "\"FSrcEntryId\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FSrcEntryId"]) + "\"," + |
| | | "\"FSrcEntrySeq\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FSrcEntrySeq"]) + "\"," + |
| | | "\"FOrderType\":{\"FID\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FOrderType"]) + "\"}," + |
| | | "\"FOrderBillNo\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FOrderBillNo"]) + "\"," + |
| | | "\"FOrderId\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FOrderId"]) + "\"," + |
| | | "\"FOrderEntryId\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FOrderEntryId"]) + "\"," + |
| | | "\"FOrderEntrySeq\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FOrderEntrySeq"]) + "\"" + |
| | | " } ]," + |
| | | |
| | | //å
³èå
³ç³»è¡¨ |
| | | "\"FEntity_Link\": [ { " + |
| | | "\"FEntity_Link_FFlowId\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FEntity_Link_FFlowId"]) + "\"," + |
| | | "\"FEntity_Link_FFlowLineId\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FEntity_Link_FFlowLineId"]) + "\"," + |
| | | "\"FEntity_Link_FRuleId\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FEntity_Link_FRuleId"]) + "\"," + |
| | | "\"FEntity_Link_FSTableName\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FEntity_Link_FSTableName"]) + "\"," + |
| | | "\"FEntity_Link_FSBillId\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FEntity_Link_FSBillId"]) + "\"," + |
| | | "\"FEntity_Link_FSId\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FEntity_Link_FSId"]) + "\"," + |
| | | "\"FEntity_Link_FBaseAcceptQty\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FEntity_Link_FBaseAcceptQty"]) + "\"," + |
| | | "\"FEntity_Link_FBaseAcceptQtyOld\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FEntity_Link_FBaseAcceptQtyOld"]) + "\"," + |
| | | "\"FEntity_Link_FBaseInspectQtyOld\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FEntity_Link_FBaseInspectQtyOld"]) + "\"," + |
| | | "\"FEntity_Link_FInspectQtyOld\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FEntity_Link_FInspectQtyOld"]) + "\"" + |
| | | " } ] } "; |
| | | } |
| | | string sJson_End = " ] }}"; |
| | | string sJson = sJson_Main + sJson_Entry + sJson_End; |
| | | |
| | | //CLOUDéè¶äºè´¦å·å¯ç ç»å
¥ |
| | | var loginRet = InvokeHelper.LoginUser(oMain.HMaker); |
| | | var isSuccess = JObject.Parse(loginRet)["LoginResultType"].Value<int>(); |
| | | sRemark = sRemark + " ï¼è·åéªè¯CLOUDè´¦å·å¯ç " + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss:ffff"); |
| | | |
| | | //çæéè¶äºåæ® |
| | | if (isSuccess == 1) |
| | | { |
| | | string result = InvokeHelper.Save("QM_InspectBill", sJson); //ä¿å |
| | | |
| | | sRemark = sRemark + " ï¼çæCLOUDåæ®" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss:ffff"); |
| | | |
| | | HReturn = result.ToString(); |
| | | |
| | | if (HReturn.Contains("\"IsSuccess\":false") == true) |
| | | { |
| | | //ååºååjsonæ°æ® |
| | | var retModel = JsonConvert.DeserializeObject<KingdeeResponse>(HReturn); |
| | | //æ¥æ¶éè¶æ¥éä¿¡æ¯ |
| | | var strErrorMsg = string.Empty; |
| | | //éåè·åæ¥éä¿¡æ¯ |
| | | foreach (var item in retModel.Result.ResponseStatus.Errors) |
| | | { |
| | | strErrorMsg += item.Message + "\r\n"; |
| | | }; |
| | | sErrMsg = "çææ£éªå失败ï¼éè¶äºæç¤ºï¼" + strErrorMsg; |
| | | LogService.Write("çææ£éªå失败ï¼" + HReturn + sJson); //åå
¥txtææ¬ |
| | | oCn.RollBack(); |
| | | return false; |
| | | } |
| | | else |
| | | { |
| | | sRemark = sRemark + sJson; |
| | | oCn.Commit(); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | sErrMsg = "çææ£éªå失败ï¼éè¶äºç»å½å¤±è´¥ï¼"; |
| | | oCn.RollBack(); |
| | | return false; |
| | | } |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | LogService.Write("çæåæ»" + e.Message + sRemark); |
| | | sErrMsg = "çææ£éªå失败ï¼" + e.Message; |
| | | oCn.RollBack(); |
| | | return false; |
| | | } |
| | | |
| | | if (oSystemParameter.omodel.QC_POStockInCheckBill_AutoCheck.ToUpper() == "Y") //ç³»ç»åæ° èªå¨å®¡æ ¸ |
| | | { |
| | | try |
| | | { |
| | | oCn.BeginTran(); |
| | | //å®¡æ ¸WMSåæ® |
| | | oCn.RunProc("Update QC_POStockInCheckBillMain Set HChecker='" + oMain.HMaker + "',HCheckDate=getdate(),HBillStatus=2 where HInterID= " + oMain.HInterID.ToString()); |
| | | |
| | | //æäº¤ãå®¡æ ¸éè¶äºåæ® |
| | | HReturn = ""; |
| | | string sJson2 = "{\"CreateOrgId\":0,\"Numbers\":[\"" + oMain.HBillNo + "\"]}"; |
| | | var result2 = InvokeHelper.Submit("QM_InspectBill", sJson2); //æäº¤ |
| | | sRemark = sRemark + " ï¼æäº¤CLOUDåæ®" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss:ffff"); |
| | | |
| | | var result3 = InvokeHelper.Audit("QM_InspectBill", sJson2); //å®¡æ ¸ |
| | | sRemark = sRemark + " ï¼å®¡æ ¸CLOUDåæ®" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss:ffff"); |
| | | |
| | | HReturn = result2.ToString() + "," + result3.ToString(); |
| | | |
| | | if (HReturn.Contains("\"IsSuccess\":false") == true) |
| | | { |
| | | //ååºååjsonæ°æ® |
| | | var retModel = JsonConvert.DeserializeObject<KingdeeResponse>(result3); |
| | | //æ¥æ¶éè¶æ¥éä¿¡æ¯ |
| | | var strErrorMsg = string.Empty; |
| | | //éåè·åæ¥éä¿¡æ¯ |
| | | foreach (var item in retModel.Result.ResponseStatus.Errors) |
| | | { |
| | | strErrorMsg += item.Message + "\r\n"; |
| | | }; |
| | | sErrMsg = "çææ£éªåæåï¼å®¡æ ¸åæ®å¤±è´¥ï¼éè¶äºæç¤ºï¼" + strErrorMsg; |
| | | LogService.Write("å®¡æ ¸åæ®å¤±è´¥" + sRemark + HReturn); |
| | | oCn.RollBack(); |
| | | return true; |
| | | } |
| | | else |
| | | { |
| | | LogService.Write("çæå¹¶å®¡æ ¸æ£éªåæåï¼" + sRemark); |
| | | sErrMsg = "çæå¹¶å®¡æ ¸æ£éªåæåï¼åæ®å·ä¸ºï¼" + oMain.HBillNo; |
| | | oCn.Commit(); |
| | | return true; |
| | | } |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | LogService.Write("å®¡æ ¸åæ»" + sRemark + HReturn); |
| | | sErrMsg = "å®¡æ ¸æ£éªå失败ï¼" + e.Message; |
| | | oCn.RollBack(); |
| | | return false; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | LogService.Write("çææ£éªåæåï¼" + sRemark); |
| | | sErrMsg = "çææ£éªåæåï¼åæ®å·ä¸ºï¼" + oMain.HBillNo; |
| | | return true; |
| | | } |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | #endregion |
| | | |
| | | #region çäº§ç»æå ä¸ä¼ çå |
| | | |
| | | /// <summary> |