| | |
| | | "(HInterID,HBillNo_bak,HEntryID,HCloseMan,HEntryCloseDate,HCloseType,HRemark" + |
| | | ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" + |
| | | ",HMaterID,HUnitID,HMouldID,HMouldLength,HMouldHeight,HMouldWidth" + |
| | | ",HMouldFoldHeight,HVolume,HQty,HSNP,HMouldQty) values(" |
| | | ",HMouldFoldHeight,HVolume,HQty,HSNP,HScatteredVolume,HMouldQty) values(" |
| | | + SafeInt(omodel.HInterID.ToString(), 0) + ",'" // HInterID int |
| | | + SafeString(omodel.HBillNo.ToString()) + "'," // HBillNo_bak varchar(50) |
| | | + (oSub.HEntryID) + ",'" // HEntryID int |
| | |
| | | + (oSub.HVolume.ToString() == "" ? 0 : oSub.HVolume) + "," // HVolume dec(18,8) |
| | | + (oSub.HQty.ToString() == "" ? 0 : oSub.HQty) + "," // HQty dec(18,8) |
| | | + (oSub.HSNP.ToString() == "" ? 0 : oSub.HSNP) + "," // HSNP dec(18,8) |
| | | + (oSub.HScatteredVolume) + "," // HSNP dec(18,8) |
| | | + (oSub.HMouldQty.ToString() == "" ? 0 : oSub.HMouldQty) + ")"; // HMouldQty dec(18,8) |
| | | oCn.RunProc(sql); |
| | | } |
| | |
| | | "(HInterID,HBillNo_bak,HEntryID,HCloseMan,HEntryCloseDate,HCloseType,HRemark" + |
| | | ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" + |
| | | ",HMaterID,HUnitID,HMouldID,HMouldLength,HMouldHeight,HMouldWidth" + |
| | | ",HMouldFoldHeight,HVolume,HQty,HSNP,HMouldQty) values(" |
| | | ",HMouldFoldHeight,HVolume,HQty,HSNP,HScatteredVolume,HMouldQty) values(" |
| | | + SafeInt(omodel.HInterID.ToString(), 0) + ",'" // HInterID int |
| | | + SafeString(omodel.HBillNo.ToString()) + "'," // HBillNo_bak varchar(50) |
| | | + (oSub.HEntryID) + ",'" // HEntryID int |
| | |
| | | + (oSub.HVolume.ToString() == "" ? 0 : oSub.HVolume) + "," // HVolume dec(18,8) |
| | | + (oSub.HQty.ToString() == "" ? 0 : oSub.HQty) + "," // HQty dec(18,8) |
| | | + (oSub.HSNP.ToString() == "" ? 0 : oSub.HSNP) + "," // HSNP dec(18,8) |
| | | + (oSub.HScatteredVolume) + "," // HSNP dec(18,8) |
| | | + (oSub.HMouldQty.ToString() == "" ? 0 : oSub.HMouldQty) + ")"; // HMouldQty dec(18,8) |
| | | oCn.RunProc(sql); |
| | | } |
| | |
| | | public int HSourceEntryID { get; set; } // æºååID |
| | | public string HSourceBillNo { get; set; } // æºååå· |
| | | public string HSourceBillType { get; set; } // æºåç±»å |
| | | public string HScatteredVolume { get; set; } // æºåç±»å |
| | | public decimal HRelationQty { get; set; } // å
³èæ°é |
| | | public decimal HRelationMoney { get; set; } // å
³èéé¢ |
| | | |
| | |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | |
| | | #region å®¡æ ¸ãåå®¡æ ¸ |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | /// <param name="HInterID">忮ID</param> |
| | | /// <param name="IsAudit">å®¡æ ¸(0),åå®¡æ ¸(1)</param> |
| | | /// <param name="CurUserName">å®¡æ ¸äºº</param> |
| | | /// <returns></returns> |
| | | [Route("Cg_ContractTransportBillEdit/AuditCg_ContractTransportBillEdit")] |
| | | [HttpGet] |
| | | public object AuditCg_ContractTransportBillEdit(int HInterID, int IsAudit, string CurUserName) |
| | | { |
| | | try |
| | | { |
| | | //å®¡æ ¸æé |
| | | if (!DBUtility.ClsPub.Security_Log_second("Gy_Supplier_Check", 1, false, CurUserName)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "å®¡æ ¸å¤±è´¥ï¼æ æéï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | var ds = oCN.RunProcReturn("select * from Cg_ContractTransportBillMain where HInterID=" + HInterID, "Cg_ContractTransportBillMain"); |
| | | if (ds.Tables[0].Rows.Count > 0) |
| | | { |
| | | if (IsAudit == 0) //å®¡æ ¸å¤æ |
| | | { |
| | | if (ds.Tables[0].Rows[0]["HChecker"].ToString() != "") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "åæ®å·²å®¡æ ¸!ä¸è½åæ¬¡å®¡æ ¸ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | if (IsAudit == 1) //åå®¡æ ¸å¤æ |
| | | { |
| | | if (ds.Tables[0].Rows[0]["HChecker"].ToString() == "") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "åæ®æªå®¡æ ¸!ä¸éè¦åå®¡æ ¸!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "åæ®ä¸åå¨!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | oCN.BeginTran(); |
| | | |
| | | if (IsAudit == 0) //å®¡æ ¸å¤æ |
| | | { |
| | | oCN.RunProc("update Cg_ContractTransportBillMain set HChecker='" + CurUserName + "',HCheckDate=getdate() ,HBillStatus=2 where HInterID=" + HInterID); |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "å®¡æ ¸æå"; |
| | | objJsonResult.data = null; |
| | | } |
| | | if (IsAudit == 1) //åå®¡æ ¸å¤æ |
| | | { |
| | | oCN.RunProc("update Cg_ContractTransportBillMain set HChecker='',HCheckDate=null,HBillStatus=1 where HInterID=" + HInterID); |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "åå®¡æ ¸æå"; |
| | | objJsonResult.data = null; |
| | | } |
| | | oCN.Commit(); |
| | | |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | oCN.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "å®¡æ ¸å¤±è´¥æè
åå®¡æ ¸å¤±è´¥ï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | } |
| | | } |
| | |
| | | |
| | | #endregion |
| | | |
| | | #region å¨å
·å¤çåºåºå è¿åæºåæ°æ® |
| | | /// <summary> |
| | | /// è¿åæºåæ°æ® |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [Route("Sc_MouldScrapOutHouseBill/GetSourceBill_MouldScrapOutHouse_Json")] |
| | | [HttpGet] |
| | | public object GetSourceBill_MouldScrapOutHouse_Json(Int64 HInterID, Int64 HEntryID, string HBillType) |
| | | { |
| | | try |
| | | { |
| | | string sViewName = ""; |
| | | //å¨å
·é¢ç¨ç³è¯·å |
| | | if (HBillType == "3823") |
| | | { |
| | | sViewName = "h_v_Sc_MouldScrapRequestBillList"; |
| | | } |
| | | |
| | | if (sViewName == "") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "䏿¯æè¯¥æºåç±»åï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | ds = oCn.RunProcReturn("select * from h_v_Sc_MouldScrapRequestBillList where hmainid="+ HInterID.ToString()+ "and hsubid="+ HEntryID, "h_v_Sc_MouldScrapRequestBillList"); |
| | | if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æªæ¥è¯¢å°æºåä¿¡æ¯ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "æåï¼"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "è·åæºåä¿¡æ¯å¤±è´¥ï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | #endregion |
| | | #region å¨å
·é¢ç¨å æ«ææºåæ¡ç |
| | | |
| | | /// <summary> |
| | | /// å¨å
·é¢ç¨å æ«ææºåæ¡ç |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [Route("MouldController/Get_SourceBarCode_ScrapRequest_Json")] |
| | | [HttpGet] |
| | | public object Get_SourceBarCode_ScrapRequest_Json(Int64 HInterID, string HBillNo, string HBillType, string HSourceBillNo, string HSourceBillType, string HMaker, Int64 HStockOrgID) |
| | | { |
| | | try |
| | | { |
| | | //å°æºåä¿¡æ¯åå
¥æ¡ç åºå
¥åºä¸´æ¶è¡¨ |
| | | DataSet ds1 = oCn.RunProcReturn("exec h_p_WMS_AddMouldBarCode_ScrapRequest " + HInterID.ToString() + ",'" + HBillNo + "','" + HBillType + "','" + HSourceBillNo + "','" + HSourceBillType + "'," + 0 + ",'" + HMaker + "'," + 0 + "," + HStockOrgID.ToString(), "h_p_WMS_AddMouldBarCode_ScrapRequest"); |
| | | if (ds1 == null || ds1.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "åæ®å·ï¼" + HBillNo + "ï¼åæ®IDï¼" + HInterID + "ï¼å°æºåä¿¡æ¯åå
¥æ¡ç åºå
¥åºä¸´æ¶è¡¨å¤±è´¥ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | if (DBUtility.ClsPub.isLong(ds1.Tables[0].Rows[0][0]) == 0) |
| | | { |
| | | |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "æå"; |
| | | objJsonResult.data = ds1.Tables[0]; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "åæ®å·ï¼" + HBillNo + "ï¼åæ®IDï¼" + HInterID + "ï¼" + DBUtility.ClsPub.isStrNull(ds1.Tables[0].Rows[0]["HRemark"]); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ«ææºåæ¡ç 失败ï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | #endregion |
| | | #endregion |
| | | |
| | | |
| | |
| | | } |
| | | ListMaterial = ListMaterial.Replace(';', ','); |
| | | List<object> columnNameList = new List<object>(); |
| | | |
| | | |
| | | |
| | | ds = oCN.RunProcReturn("select a.*,b.HUnitID from h_v_Gy_MaterialPackingRelationList_Edit a left JOIN Gy_Material b on a.HMaterID=b.HItemID where HDefaultSendPackFlag=1 and HMaterID in (" + ListMaterial+")", "h_v_Gy_MaterialPackingRelationList"); |
| | | |
| | | ds = oCN.RunProcReturn("select a.*,b.HUnitID from h_v_Gy_MaterialPackingRelationList_Edit a left JOIN Gy_Material b on a.HMaterID=b.HItemID where HDefaultSendPackFlag=1 and å®¡æ ¸äºº='' and HMaterID in (" + ListMaterial + ")", "h_v_Gy_MaterialPackingRelationList"); |
| | | |
| | | |
| | | //æ·»å åå |
| | |
| | | } |
| | | |
| | | var ds = oCN.RunProcReturn("select * from WL_YayBillMain where HInterID=" + HInterID, "WL_YayBillMain"); |
| | | |
| | | if (ds.Tables[0].Rows[0]["HChecker"] == null || ds.Tables[0].Rows[0]["HChecker"].ToString() == "") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "请å
å®¡æ ¸åæ®ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | oCN.BeginTran(); |
| | | |
| | | |
| | | oCN.RunProc("update WL_YayBillMain set HDate_CarrierSure='" + DateTime.Now.ToString("yyyy-MM-dd") + "' where HInterID=" + HInterID); |
| | | oCN.RunProc("update WL_YayBillMain set HDate_CarrierSure='" + DateTime.Now.ToString("yyyy-MM-dd") + "' where HInterID=" + HInterID); |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "æå"; |
| | | objJsonResult.data = null; |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "æå"; |
| | | objJsonResult.data = null; |
| | | oCN.Commit(); |
| | | |
| | | return objJsonResult; |
| | |
| | | var ds = oCN.RunProcReturn("select * from WL_YayBillMain where HInterID=" + HInterID, "WL_YayBillMain"); |
| | | |
| | | oCN.BeginTran(); |
| | | if(IsAudit== 1) |
| | | if (IsAudit == 1) |
| | | { |
| | | if (ds.Tables[0].Rows[0]["HDate_AllocationDriver"] == null || ds.Tables[0].Rows[0]["HDate_AllocationDriver"].ToString() == "") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "请å
åé
叿ºï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | oCN.RunProc("update WL_YayBillMain set HSurer_Arrive='" + CurUserName + "',HDate_Arrive=getdate() where HInterID=" + HInterID); |
| | | } |
| | | else if(IsAudit == 2) |
| | | else if (IsAudit == 2) |
| | | { |
| | | if (ds.Tables[0].Rows[0]["HSurer_Arrive"] == null) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "请å
å°å确认ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | oCN.RunProc("update WL_YayBillMain set HSurer_Pick='" + CurUserName + "',HDate_Pick=getdate() where HInterID=" + HInterID); |
| | | |
| | | } |
| | | else if(IsAudit == 3) |
| | | else if (IsAudit == 3) |
| | | { |
| | | if (ds.Tables[0].Rows[0]["HSurer_Pick"] == null || ds.Tables[0].Rows[0]["HSurer_Pick"].ToString() == "") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "请å
æè´§ç¡®è®¤ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | oCN.RunProc("update WL_YayBillMain set HSurer_Trans='" + CurUserName + "',HDate_Trans=getdate() where HInterID=" + HInterID); |
| | | |
| | | } |
| | | else if(IsAudit == 4) |
| | | else if (IsAudit == 4) |
| | | { |
| | | if (ds.Tables[0].Rows[0]["HSurer_Trans"] == null || ds.Tables[0].Rows[0]["HSurer_Trans"].ToString() == "") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "请å
åºåè¿è¾ç¡®è®¤ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | oCN.RunProc("update WL_YayBillMain set HSurer_Receive='" + CurUserName + "',HDate_Receive=getdate() where HInterID=" + HInterID); |
| | | |
| | | } |
| | |
| | | /// <returns></returns> |
| | | [Route("WLYayBillController/selectDriver")] |
| | | [HttpGet] |
| | | public object selectDriver(int HInterID,int HcheckID, int IsAudit, string CurUserName) |
| | | public object selectDriver(int HInterID, int HcheckID, int IsAudit, string CurUserName) |
| | | { |
| | | try |
| | | { |
| | | DataSet ds; |
| | | if(IsAudit==1) |
| | | var dss = oCN.RunProcReturn("select * from WL_YayBillMain where HInterID=" + HInterID, "WL_YayBillMain"); |
| | | if (dss.Tables[0].Rows[0]["HDate_CarrierSure"] == null || dss.Tables[0].Rows[0]["HDate_CarrierSure"].ToString() == "") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "请å
ä¾åºå确认ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | if (IsAudit == 1) |
| | | { |
| | | |
| | | ds = oCN.RunProcReturn("select * from h_v_Gy_CarList where HItemID=" + HcheckID, "h_v_Gy_CarList"); |
| | | |
| | | if (ds.Tables[0].Rows.Count > 0) |
| | | { |
| | | oCN.BeginTran(); |
| | |
| | | return objJsonResult; |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | | else |
| | | { |
| | |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | |
| | | [Route("WLYayBillController/updateBillMEs")] |
| | | [HttpGet] |
| | | public object updateBillMEs(int HInterID,int HEntryID, int ScatteredVolume, string CurUserName) |
| | | { |
| | | var ds = oCN.RunProcReturn("select * from WL_YayBillMain a inner join WL_YayBillSub_Material b on b.HInterID=a.HInterID where a.HInterID=" + HInterID, "WL_YayBillMain"); |
| | | if (ds != null || ds.Tables[0].Rows.Count <= 0) |
| | | { |
| | | oCN.BeginTran(); |
| | | oCN.RunProc("update WL_YayBillSub_Material set HScatteredVolume= " + ScatteredVolume + " where HInterID=" + HInterID+ "and HEntryID="+ HEntryID); |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "æå"; |
| | | objJsonResult.data = null; |
| | | oCN.Commit(); |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ´æ°å¤±è´¥ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | } |
| | | } |