| | |
| | | oMain.HPeriod = sPeriod; |
| | | |
| | | DataSet Ds; |
| | | oCn.BeginTran(); |
| | | //oCn.BeginTran(); |
| | | //生成出门确认单 |
| | | //插入子表 |
| | | oCn.RunProc("EXEC h_p_Sc_DoorOutCheckBillSub_Insert_New " + oMain.HInterID.ToString() + ",'" + oMain.HBillNo + "','" + sHSourceType + "'"); |
| | |
| | | //} |
| | | |
| | | sErrMsg = "新增单据成功!"; |
| | | oCn.Commit(); |
| | | //oCn.Commit(); |
| | | return true; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | sErrMsg = "生成出门确认单失败!" + e.Message; |
| | | oCn.RollBack(); |
| | | //oCn.RollBack(); |
| | | return false; |
| | | } |
| | | } |
| | |
| | | sErrMsg = "获取系统参数失败! " + sErrMsg; |
| | | return false; |
| | | } |
| | | //上传前判断 |
| | | SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); |
| | | DataSet Ds = oCn.RunProcReturn("exec h_p_WMS_BeforeUpload_ICMOReportBill " + oMain.HInterID.ToString() + ",'" + oMain.HBillNo + "','" + oMain.HBillType + "','" + sHSourceType + "'," + oMain.HDeptID.ToString() + ",'" + oSystemParameter.omodel.Sc_ICMOReportBill_MustQtyCtl + "'", "h_p_WMS_BeforeUpload_ICMOReportBill"); |
| | | if (Ds == null || Ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | sErrMsg = "上传前判断数据完整性失败!"; |
| | | return false; |
| | | } |
| | | else |
| | | { |
| | | if (DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0][0]) == 1) |
| | | { |
| | | sErrMsg = "单据号:" + oMain.HBillNo + ",单据ID:" + oMain.HInterID + ";" + DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HRemark"]); |
| | | return false; |
| | | } |
| | | } |
| | | // |
| | | if (oSystemParameter.omodel.Sc_ICMOReportBill_ERPMode.ToUpper() == "WISE") //判断同步模式是金蝶WISE |
| | | { |
| | |
| | | } |
| | | if (oSystemParameter.omodel.Sc_ICMOReportBill_ERPMode.ToUpper() == "CLOUD") //判断同步模式是金蝶CLOUD |
| | | { |
| | | if (set_SaveICMOReportBill_CLD_New(oMain, sHSourceType, oSystemParameter.omodel, ref sErrMsg) == true) |
| | | if (set_SaveICMOReportBill_CLD_New(oMain, sHSourceType, oSystemParameter.omodel, ref sErrMsg) == true) |
| | | { |
| | | //"保存成功!"; |
| | | return true; |
| | |
| | | [WebMethod] |
| | | public bool set_SaveICMOReportBill_CLD_New(Model.ClsSc_ICMOReportBillMain oMain, string sHSourceType, Pub_Class.ClsXt_SystemParameterMain oSystemParameterMain, ref string sErrMsg) |
| | | { |
| | | //上传前判断是否存在相同条码 |
| | | SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); |
| | | DataSet ds = oCn.RunProcReturn("exec h_p_WMS_UpLoadControl " + oMain.HInterID.ToString() + ",'" + oMain.HBillNo + "','" + oMain.HBillType + "'", "h_p_WMS_UpLoadControl"); |
| | | if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | } |
| | | else |
| | | { |
| | | if (DBUtility.ClsPub.isLong(ds.Tables[0].Rows[0][0]) == 1) |
| | | { |
| | | sErrMsg = DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HRemark"]); |
| | | return false; |
| | | } |
| | | } |
| | | ////上传前判断是否存在相同条码 |
| | | //SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); |
| | | //DataSet ds = oCn.RunProcReturn("exec h_p_WMS_UpLoadControl " + oMain.HInterID.ToString() + ",'" + oMain.HBillNo + "','" + oMain.HBillType + "'", "h_p_WMS_UpLoadControl"); |
| | | //if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | | //{ |
| | | //} |
| | | //else |
| | | //{ |
| | | // if (DBUtility.ClsPub.isLong(ds.Tables[0].Rows[0][0]) == 1) |
| | | // { |
| | | // sErrMsg = DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HRemark"]); |
| | | // return false; |
| | | // } |
| | | //} |
| | | |
| | | //if (sHSourceType == "3710") //源单:生产订单 |
| | | //{ |
| | |
| | | return false; |
| | | } |
| | | try |
| | | { |
| | | { |
| | | string sJson_CheckFlag = ""; //生成单据是否审核标志 |
| | | //根据TMP表 返回 子表信息 |
| | | Ds = oCn.RunProcReturn("exec h_p_Kf_GetMoveMaterOutBill_CLD " + oMain.HInterID.ToString() + ",'" + oMain.HBillNo + "'", "h_p_Kf_GetMoveMaterOutBill_CLD"); |
| | | if (Ds == null || Ds.Tables[0].Rows.Count == 0 || Ds.Tables[1].Rows.Count == 0) |
| | |
| | | } |
| | | else |
| | | { |
| | | sJson_CheckFlag = Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HCheckFlag"]); |
| | | |
| | | string sJson_StockStyle = ""; |
| | | if (oSystemParameterMain.WMS_CampanyName == "韩电") //系统参数 客户定制化名称 空白为通用 |
| | | { |
| | |
| | | |
| | | if (oSystemParameterMain.Kf_MoveStockBill_AutoCheck == "Y") //系统参数 自动审核 |
| | | { |
| | | string sJson2 = "{\"CreateOrgId\":0,\"Numbers\":[\"" + oMain.HBillNo + "\"]}"; |
| | | var result2 = client.Execute<string>("Kingdee.BOS.WebApi.ServicesStub.DynamicFormService.Submit", |
| | | new object[] { "STK_TransferDirect", sJson2 }); |
| | | if (sJson_CheckFlag == "N") //递加是否审核,N为不审核 |
| | | { |
| | | HReturn = result.ToString(); |
| | | } |
| | | else |
| | | { |
| | | string sJson2 = "{\"CreateOrgId\":0,\"Numbers\":[\"" + oMain.HBillNo + "\"]}"; |
| | | var result2 = client.Execute<string>("Kingdee.BOS.WebApi.ServicesStub.DynamicFormService.Submit", |
| | | new object[] { "STK_TransferDirect", sJson2 }); |
| | | |
| | | string sJson3 = "{\"CreateOrgId\":0,\"Numbers\":[\"" + oMain.HBillNo + "\"]}"; |
| | | var result3 = client.Execute<string>("Kingdee.BOS.WebApi.ServicesStub.DynamicFormService.Audit", |
| | | new object[] { "STK_TransferDirect", sJson3 }); |
| | | string sJson3 = "{\"CreateOrgId\":0,\"Numbers\":[\"" + oMain.HBillNo + "\"]}"; |
| | | var result3 = client.Execute<string>("Kingdee.BOS.WebApi.ServicesStub.DynamicFormService.Audit", |
| | | new object[] { "STK_TransferDirect", sJson3 }); |
| | | |
| | | HReturn = result.ToString() + "," + result2.ToString() + "," + result3.ToString(); |
| | | HReturn = result.ToString() + "," + result2.ToString() + "," + result3.ToString(); |
| | | } |
| | | } |
| | | else |
| | | { |
| | |
| | | |
| | | try |
| | | { |
| | | string sJson_CheckFlag = ""; //生成单据是否审核标志 |
| | | //根据TMP表 返回 子表信息 |
| | | Ds = oCn.RunProcReturn("exec h_p_Kf_GetMoveSellOutBill_CLD " + oMain.HInterID.ToString() + ",'" + oMain.HBillNo + "'", "h_p_Kf_GetMoveSellOutBill_CLD"); |
| | | if (Ds == null || Ds.Tables[0].Rows.Count == 0 || Ds.Tables[1].Rows.Count == 0) |
| | |
| | | } |
| | | else |
| | | { |
| | | sJson_CheckFlag = Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HCheckFlag"]); |
| | | |
| | | string sJson_StockStyle = ""; |
| | | if (oSystemParameterMain.WMS_CampanyName == "韩电") //系统参数 客户定制化名称 空白为通用 |
| | | { |
| | |
| | | |
| | | if (oSystemParameterMain.Kf_MoveStockBill_AutoCheck == "Y") //系统参数 自动审核 |
| | | { |
| | | string sJson2 = "{\"CreateOrgId\":0,\"Numbers\":[\"" + oMain.HBillNo + "\"]}"; |
| | | var result2 = client.Execute<string>("Kingdee.BOS.WebApi.ServicesStub.DynamicFormService.Submit", |
| | | new object[] { "STK_TransferDirect", sJson2 }); |
| | | if (sJson_CheckFlag == "N") //递加是否审核,N为不审核 |
| | | { |
| | | HReturn = result.ToString(); |
| | | } |
| | | else |
| | | { |
| | | string sJson2 = "{\"CreateOrgId\":0,\"Numbers\":[\"" + oMain.HBillNo + "\"]}"; |
| | | var result2 = client.Execute<string>("Kingdee.BOS.WebApi.ServicesStub.DynamicFormService.Submit", |
| | | new object[] { "STK_TransferDirect", sJson2 }); |
| | | |
| | | string sJson3 = "{\"CreateOrgId\":0,\"Numbers\":[\"" + oMain.HBillNo + "\"]}"; |
| | | var result3 = client.Execute<string>("Kingdee.BOS.WebApi.ServicesStub.DynamicFormService.Audit", |
| | | new object[] { "STK_TransferDirect", sJson3 }); |
| | | string sJson3 = "{\"CreateOrgId\":0,\"Numbers\":[\"" + oMain.HBillNo + "\"]}"; |
| | | var result3 = client.Execute<string>("Kingdee.BOS.WebApi.ServicesStub.DynamicFormService.Audit", |
| | | new object[] { "STK_TransferDirect", sJson3 }); |
| | | |
| | | HReturn = result.ToString() + "," + result2.ToString() + "," + result3.ToString(); |
| | | HReturn = result.ToString() + "," + result2.ToString() + "," + result3.ToString(); |
| | | } |
| | | } |
| | | else |
| | | { |
| | |
| | | } |
| | | try |
| | | { |
| | | string sJson_CheckFlag = ""; //生成单据是否审核标志 |
| | | //根据TMP表 返回 子表信息 |
| | | DataSet Ds; |
| | | Ds = oCn.RunProcReturn("exec h_p_Kf_GetMoveStockBill_MoveStockRequest_CLD_New " + oMain.HInterID.ToString() + ",'" + oMain.HBillNo + "'", "h_p_Kf_GetMoveStockBill_MoveStockRequest_CLD_New"); |
| | |
| | | } |
| | | else |
| | | { |
| | | sJson_CheckFlag = Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HCheckFlag"]); |
| | | |
| | | string sJson_StockStyle = ""; |
| | | if (oSystemParameterMain.WMS_CampanyName == "韩电") //系统参数 客户定制化名称 空白为通用 |
| | | { |
| | |
| | | |
| | | if (oSystemParameterMain.Kf_MoveStockBill_AutoCheck == "Y") //系统参数 自动审核 |
| | | { |
| | | string sJson2 = "{\"CreateOrgId\":0,\"Numbers\":[\"" + oMain.HBillNo + "\"]}"; |
| | | var result2 = client.Execute<string>("Kingdee.BOS.WebApi.ServicesStub.DynamicFormService.Submit", |
| | | new object[] { "STK_TransferDirect", sJson2 }); |
| | | if (sJson_CheckFlag == "N") //递加是否审核,N为不审核 |
| | | { |
| | | HReturn = result.ToString(); |
| | | } |
| | | else |
| | | { |
| | | string sJson2 = "{\"CreateOrgId\":0,\"Numbers\":[\"" + oMain.HBillNo + "\"]}"; |
| | | var result2 = client.Execute<string>("Kingdee.BOS.WebApi.ServicesStub.DynamicFormService.Submit", |
| | | new object[] { "STK_TransferDirect", sJson2 }); |
| | | |
| | | string sJson3 = "{\"CreateOrgId\":0,\"Numbers\":[\"" + oMain.HBillNo + "\"]}"; |
| | | var result3 = client.Execute<string>("Kingdee.BOS.WebApi.ServicesStub.DynamicFormService.Audit", |
| | | new object[] { "STK_TransferDirect", sJson3 }); |
| | | string sJson3 = "{\"CreateOrgId\":0,\"Numbers\":[\"" + oMain.HBillNo + "\"]}"; |
| | | var result3 = client.Execute<string>("Kingdee.BOS.WebApi.ServicesStub.DynamicFormService.Audit", |
| | | new object[] { "STK_TransferDirect", sJson3 }); |
| | | |
| | | HReturn = result.ToString() + "," + result2.ToString() + "," + result3.ToString(); |
| | | HReturn = result.ToString() + "," + result2.ToString() + "," + result3.ToString(); |
| | | } |
| | | } |
| | | else |
| | | { |
| | |
| | | sErrMsg = "获取系统参数失败! " + sErrMsg; |
| | | return false; |
| | | } |
| | | |
| | | //上传前判断 |
| | | SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); |
| | | DataSet Ds = oCn.RunProcReturn("exec h_p_WMS_BeforeUpload_MoveStockBill " + oMain.HInterID.ToString() + ",'" + oMain.HBillNo + "','" + oMain.HBillType + "','" + sHSourceType + "'," + oMain.HDeptID.ToString() + "," + oMain.HSecManagerID.ToString() + "," + oMain.HKeeperID.ToString() + ",'" + oSystemParameter.omodel.Kf_MoveStockBill_MustQtyCtl + "'", "h_p_WMS_BeforeUpload_MoveStockBill"); |
| | | if (Ds == null || Ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | sErrMsg = "上传前判断数据完整性失败!"; |
| | | return false; |
| | | } |
| | | else |
| | | { |
| | | if (DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0][0]) == 1) |
| | | { |
| | | sErrMsg = "单据号:" + oMain.HBillNo + ",单据ID:" + oMain.HInterID + ";" + DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HRemark"]); |
| | | return false; |
| | | } |
| | | } |
| | | // |
| | | if (oSystemParameter.omodel.Kf_MoveStockBill_ERPMode.ToUpper() == "WISE") //判断同步模式是金蝶WISE |
| | | { |
| | |
| | | sErrMsg = "获取系统参数失败! " + sErrMsg; |
| | | return false; |
| | | } |
| | | //上传前判断 |
| | | SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); |
| | | DataSet Ds = oCn.RunProcReturn("exec h_p_WMS_BeforeUpload_SellOutBill " + oMain.HInterID.ToString() + ",'" + oMain.HBillNo + "','" + oMain.HBillType + "','" + sHSourceType + "'," + oMain.HDeptID.ToString() + "," + oMain.HSecManagerID.ToString() + "," + oMain.HKeeperID.ToString() + ",'" + oSystemParameter.omodel.Kf_SellOutBill_MustQtyCtl + "'", "h_p_WMS_BeforeUpload_SellOutBill"); |
| | | if (Ds == null || Ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | sErrMsg = "上传前判断数据完整性失败!"; |
| | | return false; |
| | | } |
| | | else |
| | | { |
| | | if (DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0][0]) == 1) |
| | | { |
| | | sErrMsg = "单据号:" + oMain.HBillNo + ",单据ID:" + oMain.HInterID + ";" + DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HRemark"]); |
| | | return false; |
| | | } |
| | | } |
| | | // |
| | | if (oSystemParameter.omodel.Kf_SellOutBill_ERPMode.ToUpper() == "WISE") //判断同步模式是金蝶WISE |
| | | { |
| | |
| | | |
| | | private bool SaveSellOutBill_CLD(Model.ClsKf_SellOutBillMain oMain, Pub_Class.ClsXt_SystemParameterMain oSystemParameterMain, ref string sErrMsg) |
| | | { |
| | | string sRemark = ""; |
| | | SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); |
| | | DataSet Ds; |
| | | try |
| | |
| | | |
| | | //插入子表 |
| | | oCn.RunProc("EXEC h_p_Kf_SellOutBillSub_Insert " + oMain.HInterID.ToString() + ",'" + oMain.HBillNo + "'"); |
| | | |
| | | sRemark = sRemark + " ;写入子表" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss:ffff"); |
| | | //插入主表 |
| | | oCn.RunProc("Insert Into Kf_ICStockBillMain " + |
| | | "(HBillType,HBillSubType,HInterID,HBillNo,HDate,HMainSourceBillType" + |
| | |
| | | ", " + oMain.HSupID.ToString() + "," + oMain.HWHID.ToString() + "," + oMain.HSCWHID.ToString() + "," + oMain.HEmpID.ToString() + "," + oMain.HManagerID.ToString() + "," + oMain.HSecManagerID.ToString() + |
| | | ", " + oMain.HKeeperID.ToString() + "," + oMain.HDeptID.ToString() + ",'" + oMain.HExplanation + "','" + oMain.HInnerBillNo + "'," + DBUtility.ClsPub.BoolToString(oMain.HRedBlueFlag) + |
| | | ") "); |
| | | |
| | | sRemark = sRemark + " ;写入主表" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss:ffff"); |
| | | //更新关联数量 |
| | | oCn.RunProc("exec h_p_Xs_UpDateSeOutStockRelation_Add " + oMain.HInterID.ToString()); |
| | | |
| | | sRemark = sRemark + " ;更新关联数量" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss:ffff"); |
| | | |
| | | if (oSystemParameterMain.Kf_SellOutBill_AutoCheck == "Y") //系统参数 自动审核 |
| | | { |
| | | //审核单据 |
| | | oCn.RunProc("Update Kf_ICStockBillMain Set HChecker='" + oMain.HMaker + "',HCheckDate=convert(varchar(10),getdate(),120),HBillStatus=2 where HInterID= " + oMain.HInterID.ToString()); |
| | | } |
| | | |
| | | sRemark = sRemark + " ;回填审核人" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss:ffff"); |
| | | oCn.Commit(); |
| | | } |
| | | catch (Exception e) |
| | |
| | | |
| | | try |
| | | { |
| | | string sJson_CheckFlag = ""; //生成单据是否审核标志 |
| | | //根据TMP表 返回 子表信息 |
| | | Ds = oCn.RunProcReturn("exec h_p_Kf_GetSellOutBill_CLD " + oMain.HInterID.ToString() + ",'" + oMain.HBillNo + "'", "h_p_Kf_GetSellOutBill_CLD"); |
| | | |
| | | sRemark = sRemark + " ;返回API数据" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss:ffff"); |
| | | if (Ds == null || Ds.Tables[0].Rows.Count == 0 || Ds.Tables[1].Rows.Count == 0) |
| | | { |
| | | sErrMsg = "获取子表信息失败!"; |
| | |
| | | } |
| | | else |
| | | { |
| | | sJson_CheckFlag = Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HCheckFlag"]); |
| | | |
| | | string sJson_Custom = ""; |
| | | if (oSystemParameterMain.WMS_CampanyName == "韩电") //系统参数 客户定制化名称 空白为通用 |
| | | { |
| | |
| | | { |
| | | sJson_Custom = ""; |
| | | } |
| | | |
| | | string sJson_Main = "{\"Creator\":\"\",\"NeedUpDateFields\":[]," + |
| | | "\"Model\":{ " + |
| | | //\"FID\":" + oMain.HInterID.ToString() + "," + |
| | |
| | | sCLOUDPsd = DBUtility.ClsPub.isStrNull(ds11.Tables[0].Rows[0]["HCloudUserPsd"]); |
| | | } |
| | | |
| | | sRemark = sRemark + " ;获取验证CLOUD账号密码" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss:ffff"); |
| | | |
| | | //生成 销售出库 |
| | | string HReturn; |
| | | ApiClient client = new ApiClient(Pub_Class.ClsPub.sCLOUDUrl); |
| | |
| | | ////生成单据后更新自定义字段 |
| | | oCn.RunProc("exec h_p_Sc_UpDateSelfFildSellOut '" + oMain.HBillNo + "'"); |
| | | // |
| | | sRemark = sRemark + " 生成单据后更新自定义字段" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss:ffff"); |
| | | if (oSystemParameterMain.Kf_SellOutBill_AutoCheck == "Y") //系统参数 自动审核 |
| | | { |
| | | string sJson2 = "{\"CreateOrgId\":0,\"Numbers\":[\"" + oMain.HBillNo + "\"]}"; |
| | | var result2 = client.Execute<string>("Kingdee.BOS.WebApi.ServicesStub.DynamicFormService.Submit", |
| | | new object[] { "SAL_OUTSTOCK", sJson2 }); |
| | | if (sJson_CheckFlag == "N") //递加是否审核,N为不审核 |
| | | { |
| | | HReturn = result.ToString(); |
| | | } |
| | | else |
| | | { |
| | | string sJson2 = "{\"CreateOrgId\":0,\"Numbers\":[\"" + oMain.HBillNo + "\"]}"; |
| | | var result2 = client.Execute<string>("Kingdee.BOS.WebApi.ServicesStub.DynamicFormService.Submit", |
| | | new object[] { "SAL_OUTSTOCK", sJson2 }); |
| | | |
| | | string sJson3 = "{\"CreateOrgId\":0,\"Numbers\":[\"" + oMain.HBillNo + "\"]}"; |
| | | var result3 = client.Execute<string>("Kingdee.BOS.WebApi.ServicesStub.DynamicFormService.Audit", |
| | | new object[] { "SAL_OUTSTOCK", sJson3 }); |
| | | string sJson3 = "{\"CreateOrgId\":0,\"Numbers\":[\"" + oMain.HBillNo + "\"]}"; |
| | | var result3 = client.Execute<string>("Kingdee.BOS.WebApi.ServicesStub.DynamicFormService.Audit", |
| | | new object[] { "SAL_OUTSTOCK", sJson3 }); |
| | | |
| | | HReturn = result.ToString() + "," + result2.ToString() + "," + result3.ToString(); |
| | | HReturn = result.ToString() + "," + result2.ToString() + "," + result3.ToString(); |
| | | } |
| | | } |
| | | else |
| | | { |
| | |
| | | } |
| | | if (HReturn.Contains("\"IsSuccess\":false") == true) |
| | | { |
| | | LogService.Write("生成销售出库单失败" + sRemark); |
| | | sErrMsg = "生成销售出库单失败!" + HReturn + sJson; |
| | | //oCn.RollBack(); |
| | | return false; |
| | | } |
| | | else |
| | | { |
| | | |
| | | sRemark = sRemark + " ;生成CLOUD单据" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss:ffff"); |
| | | |
| | | if (oSystemParameterMain.WMS_CampanyName == "韩电") |
| | | { |
| | | //销售出库时反写发货通知单、销售订单 |
| | |
| | | { |
| | | //外销反写发货通知单、销售订单数量 |
| | | oCn.RunProc("EXEC h_p_ToCLD_BackDataDELIVERYNOTICE '" + oMain.HBillNo + "'"); |
| | | |
| | | sRemark = sRemark + " ;外销反写发货通知单、销售订单数量" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss:ffff"); |
| | | } |
| | | else if (Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["F_XSLX"]) == "内销" |
| | | || Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["F_XSLX"]) == "OEM" |
| | |
| | | { |
| | | //内销、OEM和电商 关闭发货通知单、销售订单 |
| | | oCn.RunProc("EXEC h_p_ToCLD_BackDataDELIVERYNOTICE_Close '" + oMain.HBillNo + "'"); |
| | | sRemark = sRemark + " ;内销、OEM和电商 关闭发货通知单、销售订单" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss:ffff"); |
| | | } |
| | | } |
| | | |
| | | |
| | | LogService.Write("生成销售出库单成功!" + sRemark); |
| | | return true; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | LogService.Write("生成销售出库单失败!登录失败" + sRemark); |
| | | sErrMsg = "生成销售出库单失败!登录失败!"; |
| | | //oCn.RollBack(); |
| | | return false; |
| | |
| | | } |
| | | catch (Exception e1) |
| | | { |
| | | LogService.Write("生成销售出库单失败回滚" + sRemark); |
| | | sErrMsg = "生成销售出库单失败!" + e1.Message; |
| | | //oCn.RollBack(); |
| | | return false; |
| | |
| | | { |
| | | sErrMsg = "获取系统参数失败! " + sErrMsg; |
| | | return false; |
| | | } |
| | | //上传前判断 |
| | | SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); |
| | | DataSet Ds = oCn.RunProcReturn("exec h_p_WMS_BeforeUpload_MateOutBill " + oMain.HInterID.ToString() + ",'" + oMain.HBillNo + "','" + oMain.HBillType + "','" + sHSourceType + "'," + oMain.HDeptID.ToString() + "," + oMain.HSecManagerID.ToString() + "," + oMain.HKeeperID.ToString() + ",'" + oSystemParameter.omodel.Kf_MateOutBill_MustQtyCtl + "'", "h_p_WMS_BeforeUpload_MateOutBill"); |
| | | if (Ds == null || Ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | sErrMsg = "上传前判断数据完整性失败!"; |
| | | return false; |
| | | } |
| | | else |
| | | { |
| | | if (DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0][0]) == 1) |
| | | { |
| | | sErrMsg = "单据号:" + oMain.HBillNo + ",单据ID:" + oMain.HInterID + ";" + DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HRemark"]); |
| | | return false; |
| | | } |
| | | } |
| | | // |
| | | if (oSystemParameter.omodel.Kf_MateOutBill_ERPMode.ToUpper() == "WISE") //判断同步模式是金蝶WISE |
| | |
| | | sErrMsg = "获取系统参数失败! " + sErrMsg; |
| | | return false; |
| | | } |
| | | //上传前判断 |
| | | SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); |
| | | DataSet Ds = oCn.RunProcReturn("exec h_p_WMS_BeforeUpload_OtherOutBill " + oMain.HInterID.ToString() + ",'" + oMain.HBillNo + "','" + oMain.HBillType + "','" + sHSourceType + "'," + oMain.HDeptID.ToString() + "," + oMain.HSecManagerID.ToString() + "," + oMain.HKeeperID.ToString() + ",'" + oSystemParameter.omodel.Kf_OtherOutBill_MustQtyCtl + "'", "h_p_WMS_BeforeUpload_OtherOutBill"); |
| | | if (Ds == null || Ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | sErrMsg = "上传前判断数据完整性失败!"; |
| | | return false; |
| | | } |
| | | else |
| | | { |
| | | if (DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0][0]) == 1) |
| | | { |
| | | sErrMsg = "单据号:" + oMain.HBillNo + ",单据ID:" + oMain.HInterID + ";" + DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HRemark"]); |
| | | return false; |
| | | } |
| | | } |
| | | // |
| | | if (oSystemParameter.omodel.Kf_OtherOutBill_ERPMode.ToUpper() == "WISE") //判断同步模式是金蝶WISE |
| | | { |
| | |
| | | sErrMsg = "获取系统参数失败! " + sErrMsg; |
| | | return false; |
| | | } |
| | | //上传前判断 |
| | | SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); |
| | | DataSet Ds = oCn.RunProcReturn("exec h_p_WMS_BeforeUpload_POStockInBill " + oMain.HInterID.ToString() + ",'" + oMain.HBillNo + "','" + oMain.HBillType + "','" + sHSourceType + "'," + oMain.HDeptID.ToString() + "," + oMain.HSecManagerID.ToString() + "," + oMain.HKeeperID.ToString() + ",'" + oSystemParameter.omodel.Kf_POStockInBill_MustQtyCtl + "'", "h_p_WMS_BeforeUpload_POStockInBill"); |
| | | if (Ds == null || Ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | sErrMsg = "上传前判断数据完整性失败!"; |
| | | return false; |
| | | } |
| | | else |
| | | { |
| | | if (DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0][0]) == 1) |
| | | { |
| | | sErrMsg = "单据号:" + oMain.HBillNo + ",单据ID:" + oMain.HInterID + ";" + DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HRemark"]); |
| | | return false; |
| | | } |
| | | } |
| | | // |
| | | if (oSystemParameter.omodel.Kf_POStockInBill_ERPMode.ToUpper() == "WISE") //判断同步模式是金蝶WISE |
| | | { |
| | |
| | | sErrMsg = "获取系统参数失败! " + sErrMsg; |
| | | return false; |
| | | } |
| | | //上传前判断是否存在相同条码 |
| | | //上传前判断 |
| | | SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); |
| | | DataSet ds = oCn.RunProcReturn("exec h_p_WMS_UpLoadControl " + oMain.HInterID.ToString() + ",'" + oMain.HBillNo + "','" + oMain.HBillType + "'", "h_p_WMS_UpLoadControl"); |
| | | if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | | DataSet Ds = oCn.RunProcReturn("exec h_p_WMS_BeforeUpload_ProductInBill_MulSource " + oMain.HInterID.ToString() + ",'" + oMain.HBillNo + "','" + oMain.HBillType + "'", "h_p_WMS_BeforeUpload_ProductInBill_MulSource"); |
| | | if (Ds == null || Ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | sErrMsg = "上传前判断数据完整性失败!"; |
| | | return false; |
| | | } |
| | | else |
| | | { |
| | | if (DBUtility.ClsPub.isLong(ds.Tables[0].Rows[0][0]) == 1) |
| | | if (DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0][0]) == 1) |
| | | { |
| | | sErrMsg = "单据号:" + oMain.HBillNo + ",单据ID:" + oMain.HInterID + ";" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HRemark"]); |
| | | sErrMsg = "单据号:" + oMain.HBillNo + ",单据ID:" + oMain.HInterID + ";" + DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HRemark"]); |
| | | return false; |
| | | } |
| | | } |
| | | ////上传前判断是否存在相同条码 |
| | | //SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); |
| | | //DataSet ds = oCn.RunProcReturn("exec h_p_WMS_UpLoadControl " + oMain.HInterID.ToString() + ",'" + oMain.HBillNo + "','" + oMain.HBillType + "'", "h_p_WMS_UpLoadControl"); |
| | | //if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | | //{ |
| | | //} |
| | | //else |
| | | //{ |
| | | // if (DBUtility.ClsPub.isLong(ds.Tables[0].Rows[0][0]) == 1) |
| | | // { |
| | | // sErrMsg = "单据号:" + oMain.HBillNo + ",单据ID:" + oMain.HInterID + ";" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HRemark"]); |
| | | // return false; |
| | | // } |
| | | //} |
| | | |
| | | //产品入库单保存前进行倒冲仓负库存控制 |
| | | DataSet ds2 = oCn.RunProcReturn("exec h_p_IFCLD_CheckDaochong_Handian " + oMain.HInterID.ToString() + ",'" + oMain.HBillType + "'", "h_p_IFCLD_CheckDaochong_Handian"); |
| | |
| | | /// <returns></returns> |
| | | public bool SaveProductInBill_MulSource_CLD(Model.ClsKf_ProductInBillMain oMain, Pub_Class.ClsXt_SystemParameterMain oSystemParameterMain, ref string sHBillNo, ref string sErrMsg) |
| | | { |
| | | string sRemark = ""; |
| | | SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); |
| | | try |
| | | { |
| | |
| | | |
| | | //插入子表 |
| | | oCn.RunProc("EXEC h_p_Kf_ProductInBillSub_Insert " + oMain.HInterID.ToString() + ",'" + oMain.HBillNo + "'"); |
| | | |
| | | sRemark = sRemark + " ;写入子表" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss:ffff"); |
| | | //插入主表 |
| | | oCn.RunProc("Insert Into Kf_ICStockBillMain " + |
| | | "(HBillType,HBillSubType,HInterID,HBillNo,HDate,HMainSourceBillType" + |
| | |
| | | ", " + oMain.HSupID.ToString() + "," + oMain.HWHID.ToString() + "," + oMain.HSCWHID.ToString() + "," + oMain.HEmpID.ToString() + "," + oMain.HManagerID.ToString() + "," + oMain.HSecManagerID.ToString() + |
| | | ", " + oMain.HKeeperID.ToString() + "," + oMain.HDeptID.ToString() + ",'" + oMain.HExplanation + "','" + oMain.HInnerBillNo + "'," + DBUtility.ClsPub.BoolToString(oMain.HRedBlueFlag) + |
| | | ") "); |
| | | sRemark = sRemark + " ;写入主表" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss:ffff"); |
| | | //更新关联数量 |
| | | oCn.RunProc("exec h_p_Sc_UpDateICMORelation_Add " + oMain.HInterID.ToString()); |
| | | |
| | | sRemark = sRemark + " ;回填关联数量" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss:ffff"); |
| | | |
| | | if (oSystemParameterMain.Kf_ProductInBill_AutoCheck == "Y") //系统参数 自动审核 |
| | | { |
| | |
| | | //根据单据ID获取扫描的组织有哪几个 |
| | | string tt = ""; |
| | | Ds1 = oCn.RunProcReturn("exec h_p_Kf_GetOrgIDByTemp_CLD " + oMain.HInterID.ToString(), "h_p_Kf_GetOrgIDByTemp_CLD"); |
| | | |
| | | sRemark = sRemark + " ;获取组织个数" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss:ffff"); |
| | | |
| | | if (Ds1 == null || Ds1.Tables[0].Rows.Count == 0) |
| | | { |
| | |
| | | HOrgID = Pub_Class.ClsPub.isLong(Ds1.Tables[0].Rows[y][0]); |
| | | //根据TMP表 返回 子表信息 |
| | | Ds = oCn.RunProcReturn("exec h_p_Kf_GetProductInBillByOrgID_CLD " + oMain.HInterID.ToString() + ",'" + oMain.HBillNo + "'," + HOrgID.ToString(), "h_p_Kf_GetProductInBillByOrgID_CLD"); |
| | | |
| | | sRemark = sRemark + " ;获取API数据" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss:ffff"); |
| | | |
| | | if (Ds == null || Ds.Tables[0].Rows.Count == 0 || Ds.Tables[1].Rows.Count == 0) |
| | | { |
| | | sErrMsg = "获取子表信息失败!"; |
| | |
| | | "\"FPRDORGID\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HPRDORGID"]) + "\"}, " + |
| | | "\"FOwnerId0\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HOWNERID"]) + "\"}," + |
| | | "\"FDate\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FDate"]) + "\"," + |
| | | "\"FBillType\": {\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FBillType"]) + "\" " + |
| | | " }, \"FEntity\": [ "; |
| | | "\"FBillType\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FBillType"]) + "\"}," + |
| | | "\"FISENTRUST\":" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FISENTRUST"]) + "," + |
| | | "\"FEntity\": [ "; |
| | | sJson_Entry_PL = ""; |
| | | for (int i = 0; i < Ds.Tables[1].Rows.Count; i++) |
| | | { |
| | |
| | | ApiClient client = new ApiClient(Pub_Class.ClsPub.sCLOUDUrl); |
| | | string dbId = Pub_Class.ClsPub.sCLOUDAcc; //AotuTest117 |
| | | bool bLogin = client.Login(dbId, sCLOUDUseName, sCLOUDPsd, 2052); |
| | | |
| | | sRemark = sRemark + " ;获取验证CLOUD账号密码" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss:ffff"); |
| | | if (bLogin) |
| | | { |
| | | var result = client.Execute<string>("Kingdee.BOS.WebApi.ServicesStub.DynamicFormService.BatchSave", |
| | | new object[] { "PRD_INSTOCK", sJson }); //调用保存方式 |
| | | |
| | | ////生成单据后更新自定义字段 |
| | | oCn.RunProc("exec h_p_Sc_UpDateSelfFildProductIn_MulICMO '" + oMain.HBillNo + "'"); |
| | | oCn.RunProc("exec h_p_Sc_UpDateSelfFildProductIn_MulICMO '" + HBillNo + "'"); |
| | | |
| | | if (oSystemParameterMain.Kf_ProductInBill_AutoCheck == "Y") //系统参数 自动审核 |
| | | { |
| | |
| | | sErrMsg = "获取系统参数失败! " + sErrMsg; |
| | | return false; |
| | | } |
| | | //上传前判断 |
| | | SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); |
| | | DataSet Ds = oCn.RunProcReturn("exec h_p_WMS_BeforeUpload_ProductInBill " + oMain.HInterID.ToString() + ",'" + oMain.HBillNo + "','" + oMain.HBillType + "','" + sHSourceType + "'," + oMain.HDeptID.ToString() + "," + oMain.HSecManagerID.ToString() + "," + oMain.HKeeperID.ToString() + ",'" + oSystemParameter.omodel.Kf_ProductInBill_MustQtyCtl + "'", "h_p_WMS_BeforeUpload_ProductInBill"); |
| | | if (Ds == null || Ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | sErrMsg = "上传前判断数据完整性失败!"; |
| | | return false; |
| | | } |
| | | else |
| | | { |
| | | if (DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0][0]) == 1) |
| | | { |
| | | sErrMsg = "单据号:" + oMain.HBillNo + ",单据ID:" + oMain.HInterID + ";" + DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HRemark"]); |
| | | return false; |
| | | } |
| | | } |
| | | // |
| | | if (oSystemParameter.omodel.Kf_ProductInBill_ERPMode.ToUpper() == "WISE") //判断同步模式是金蝶WISE |
| | | { |
| | |
| | | [WebMethod] |
| | | public bool set_SaveProductInBill_CLD_New(Model.ClsKf_ProductInBillMain oMain, string sHSourceType, Pub_Class.ClsXt_SystemParameterMain oSystemParameterMain, ref string sErrMsg) |
| | | { |
| | | //上传前判断是否存在相同条码 |
| | | ////上传前判断是否存在相同条码 |
| | | SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); |
| | | DataSet ds = oCn.RunProcReturn("exec h_p_WMS_UpLoadControl " + oMain.HInterID.ToString() + ",'" + oMain.HBillNo + "','" + oMain.HBillType + "'", "h_p_WMS_UpLoadControl"); |
| | | if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | } |
| | | else |
| | | { |
| | | if (DBUtility.ClsPub.isLong(ds.Tables[0].Rows[0][0]) == 1) |
| | | { |
| | | sErrMsg = "单据号:" + oMain.HBillNo + ",单据ID:" + oMain.HInterID + ";" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HRemark"]); |
| | | return false; |
| | | } |
| | | } |
| | | //DataSet ds = oCn.RunProcReturn("exec h_p_WMS_UpLoadControl " + oMain.HInterID.ToString() + ",'" + oMain.HBillNo + "','" + oMain.HBillType + "'", "h_p_WMS_UpLoadControl"); |
| | | //if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | | //{ |
| | | //} |
| | | //else |
| | | //{ |
| | | // if (DBUtility.ClsPub.isLong(ds.Tables[0].Rows[0][0]) == 1) |
| | | // { |
| | | // sErrMsg = "单据号:" + oMain.HBillNo + ",单据ID:" + oMain.HInterID + ";" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HRemark"]); |
| | | // return false; |
| | | // } |
| | | //} |
| | | |
| | | if (sHSourceType == "3710") //生产订单 |
| | | { |
| | |
| | | [WebMethod] |
| | | public bool set_SavePonderationBillMain_Temp_BarCode(string sBarCode, Int64 HBillID, string HBillType, string HBillNo, string HMaker, Int64 HWhID, Int64 HSPID, Double HQty, bool HRedBlueFlag, bool SourceFlag, string HSourceBillNo, string HSourceBillType, Int64 HOWNERID, string HExpressNumber, ref string sHSourceBillNo, ref string sHSourceBillType, ref long sHSupID, ref string sHSupName, ref long sHDeptID, ref string sHDeptName, ref string sErrMsg) |
| | | { |
| | | string sRemark = ""; |
| | | SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); |
| | | DAL.ClsKF_PonderationBillMain_Temp_Ctl tem = new DAL.ClsKF_PonderationBillMain_Temp_Ctl(); |
| | | Model.ClsKF_PonderationBillMain_Temp model = new Model.ClsKF_PonderationBillMain_Temp(); |
| | |
| | | sErrMsg = "获取系统参数失败! " + sErrMsg; |
| | | return false; |
| | | } |
| | | sRemark = sRemark + "单据号:" + HBillNo + ",单据ID:" + HBillID + ";获取系统参数" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss:ffff"); |
| | | |
| | | //当单据参数是 多原单模式时, 则 SourceFlag 设置为 TRUE Sc_ICMOReportBill_MulSourceBill(韩电是) |
| | | if (HBillType == "3711" && oSystemParameter.omodel.Sc_ICMOReportBill_MulSourceBill=="Y") |
| | | { |
| | |
| | | //根据物料条码得到对应源单信息并将源单信息新增到条码出入库临时表,带出表头部门、供应商 |
| | | //h_p_WMS_BarCode_SourceBillType 带出原单信息 |
| | | DataSet ds1 = oCn.RunProcReturn("exec h_p_WMS_BarCode_SourceBillType " + HBillID.ToString() + ",'" + HBillType + "','" + sBarCode + "'", "h_p_WMS_BarCode_SourceBillType"); |
| | | |
| | | sRemark = sRemark + " ;入库获取源单信息" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss:ffff"); |
| | | |
| | | if (ds1 == null || ds1.Tables[0].Rows.Count == 0) |
| | | { |
| | | sErrMsg = "扫描物料条码后判断条码源单信息,未知错误!"; |
| | |
| | | // 将源单信息写入 临时缓存表 |
| | | if (tem.AddNew_Source(HBillID, HBillNo, HBillType, sHSourceBillNo, sHSourceBillType, sRedBlue, ref sErrMsg)) |
| | | { |
| | | |
| | | sRemark = sRemark + " ;入库写入源单信息" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss:ffff"); |
| | | } |
| | | else |
| | | { |
| | |
| | | { |
| | | DataSet dstt = oCn.RunProcReturn("exec h_p_WMS_GetOldBarCode_Insert " + HBillID.ToString() + ",'" + HBillType + "','" + sBarCode + "'," + HOWNERID, "h_p_WMS_GetOldBarCode_Insert"); |
| | | //DataSet dstt = oCn.RunProcReturn("exec h_p_WMS_GetOldBarCode " + HBillID.ToString() + ",'" + sBarCode + "' ", "h_p_WMS_GetOldBarCode"); |
| | | |
| | | sRemark = sRemark + " ;销售出库和退库、领料出库时,如果条码档案找不到就从旧条码从获取并同步至本地" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss:ffff"); |
| | | |
| | | if (dstt == null || dstt.Tables[0].Rows.Count == 0) |
| | | { |
| | | sErrMsg = "同步条码失败!"; |
| | |
| | | { |
| | | //获取TMP中的原单主内码和子内码 //判断该条码是否在原单列表中h_p_WMS_GetBarCodeSourceInterID |
| | | DataSet ds2 = oCn.RunProcReturn("exec h_p_WMS_GetBarCodeSourceInterID " + HBillID.ToString() + ",'" + sBarCode + "' ", "h_p_WMS_GetBarCodeSourceInterID"); |
| | | |
| | | sRemark = sRemark + " ;判断是否在源单中" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss:ffff"); |
| | | |
| | | if (ds2 == null || ds2.Tables[0].Rows.Count == 0) |
| | | { |
| | | sErrMsg = "扫描物料条码后有源单自动获取一行源单信息,未知错误!"; |
| | |
| | | { |
| | | //根据仓库ID,判断是否启用仓位 |
| | | DataSet ds3 = oCn.RunProcReturn(" select HSPFlag from Gy_Warehouse with(nolock) where HItemID= " + HWhID.ToString(), "Gy_Warehouse"); |
| | | |
| | | sRemark = sRemark + " ;出库判断仓库仓位是否已选择" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss:ffff"); |
| | | |
| | | if (ds3 == null || ds3.Tables[0].Rows.Count == 0) |
| | | { |
| | | sErrMsg = "仓库内码错误!"; |
| | |
| | | } |
| | | else |
| | | { |
| | | //判断条码库存 返回库存数量 仓库 仓位 |
| | | //判断条码库存(没在获取库存,根据发货通知单获取了原单的仓库仓位) 返回库存数量 仓库 仓位 |
| | | DAL.ClsKF_PonderationBillMain_Temp_View Tempdal = new DAL.ClsKF_PonderationBillMain_Temp_View(); |
| | | if (Tempdal.CheckQtyByBarCode(HBillID, HBillType, sBarCode, ref HWhID, ref HSPID, sRelQty, ref sRelQty)) |
| | | { |
| | | |
| | | } |
| | | else |
| | | { |
| | |
| | | sErrMsg = "库存不足,已获取实际库存数量!"; |
| | | } |
| | | } |
| | | sRemark = sRemark + " ;出库判断条码库存" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss:ffff"); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | //判断并获取 仓库 仓位信息(降等品 找到 降等品库) |
| | | DataSet ds4 = oCn.RunProcReturn("exec h_p_WMS_GetBillWHID " + HBillID.ToString() + ",'" + HBillType + "','" + sBarCode + "'," + HWhID.ToString() + "," + HSPID.ToString(), "h_p_WMS_GetBillWHID"); |
| | | |
| | | sRemark = sRemark + " ;判断并获取 仓库 仓位信息(降等品 找到 降等品库)" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss:ffff"); |
| | | |
| | | if (ds4 == null || ds4.Tables[0].Rows.Count == 0) |
| | | { |
| | | sErrMsg = "判断并获取仓库仓位信息,未知错误!"; |
| | |
| | | sErrMsg = sErrMsg; |
| | | return false; |
| | | } |
| | | sRemark = sRemark + " ;入库返回条码数量" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss:ffff"); |
| | | |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | //物料条码写入临时表时,判断仓库仓位是否正确 |
| | | DataSet ds5 = oCn.RunProcReturn("exec h_p_WMS_CheckWHandSP " + model.HWhID.ToString() + "," + model.HStockPlaceID.ToString(), "h_p_WMS_CheckWHandSP"); |
| | | |
| | | sRemark = sRemark + " ;判断仓库仓位是否正确" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss:ffff"); |
| | | |
| | | if (ds5 == null || ds5.Tables[0].Rows.Count == 0) |
| | | { |
| | | sErrMsg = "扫描物料条码存入临时表时判断仓库仓位是否正确,未知错误!"; |
| | |
| | | sErrMsg = "扫描失败!" + sErrMsg; |
| | | return false; |
| | | } |
| | | sRemark = sRemark + " ;写入缓存表" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss:ffff"); |
| | | LogService.Write("扫描物料条码" + sRemark); |
| | | |
| | | return true; |
| | | } |
| | | |
| | |
| | | } |
| | | //销售出库、销售退库模块扫码流程 飞龙专用 |
| | | if ((HBillType == "1205" || HBillType == "1247") && oSystemParameter.omodel.WMS_CampanyName == "飞龙") //系统参数 客户定制化名称 空白为通用 |
| | | { |
| | | ////将物料条码信息写入出入库条码临时表 |
| | | //if (set_SavePonderationBillMain_Temp_FeiLong(sBarCode, HBillID, HBillType, HBillNo, HMaker, HWhID, HSPID, HQty, HRedBlueFlag, SourceFlag, HSourceBillNo, HSourceBillType, HOWNERID, HExpressNumber, ref sHSourceBillNo, ref sHSourceBillType, ref sHSupID, ref sHSupName, ref sHDeptID, ref sHDeptName, ref sHBarType, ref sErrMsg)) |
| | | //{ |
| | | // oBar.HBarType = sHBarType; |
| | | // oBar.HSourceBillType = sHSourceBillType; |
| | | // oBar.HSourceBillNo = sHSourceBillNo; |
| | | // oBar.HSupID = sHSupID; |
| | | // oBar.HSupName = sHSupName; |
| | | // oBar.HDeptID = sHDeptID; |
| | | // oBar.HDeptName = sHDeptName; |
| | | //} |
| | | //else |
| | | //{ |
| | | // sErrMsg = "!" + sErrMsg; |
| | | return null; |
| | | //} |
| | | //return oBar; |
| | | { |
| | | return null; |
| | | } |
| | | //生产入库 多源单模式 |
| | | else if (HBillType == "1202" && oSystemParameter.omodel.Kf_ProductInBill_MulSourceBill == "Y") |
| | | { |
| | | //oBar = get_CheckTypeByBarCode_MulSourceBill(sBarCode, HBillID, HBillType, HBillNo, HMaker, HWhID, HSPID, HQty, HRedBlueFlag, SourceFlag, HSourceBillNo, HSourceBillType, HOWNERID, HExpressNumber, oSystemParameter.omodel, ref sErrMsg); |
| | | //if (oBar == null) |
| | | //{ |
| | | return null; |
| | | //} |
| | | //else |
| | | //{ |
| | | // return oBar; |
| | | //} |
| | | { |
| | | return null; |
| | | } |
| | | else |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | #region 发出确认单模块 调用方法 |
| | | |
| | | #region 扫描单据号条码 |
| | | |
| | | [WebMethod] |
| | | public bool set_SaveSendConfirmation_BarCode(Model.ClsKF_PonderationBillMain_Temp oMain, ref string sErrMsg) |
| | | { |
| | | SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); |
| | | DAL.ClsKF_PonderationBillMain_Temp_Ctl dal = new DAL.ClsKF_PonderationBillMain_Temp_Ctl(); |
| | | dal.oModel = oMain; |
| | | |
| | | DataSet Ds = oCn.RunProcReturn("exec h_p_KF_PonderationBillMain_Temp_Add_SendConfirmation " + oMain.HInterID.ToString() + ",'" + oMain.HBillNo + "','" + oMain.HBillType + "','" + oMain.HMaker + "','" + oMain.HBarCode + "'", "h_p_KF_PonderationBillMain_Temp_Add_SendConfirmation"); |
| | | if (Ds == null || Ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | sErrMsg = "扫描单据号条码发生错误!"; |
| | | return false; |
| | | } |
| | | else |
| | | { |
| | | if (DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0][0]) == 1) |
| | | { |
| | | sErrMsg = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HRemark"]); |
| | | return false; |
| | | } |
| | | } |
| | | return true; |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | #region 生成发出确认单 |
| | | |
| | | [WebMethod] |
| | | public bool set_SaveSendConfirmationBill_New(Int64 HInterID, string HBillNo, string HBillType, ref string sErrMsg) |
| | | { |
| | | SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); |
| | | |
| | | try |
| | | { |
| | | //oCn.BeginTran(); |
| | | //生成出门确认单 |
| | | DataSet Ds = oCn.RunProcReturn("exec h_p_Kf_SendConfirmationBill_Insert_New " + HInterID.ToString() + ",'" + HBillNo + "','" + HBillType + "'", "h_p_Kf_SendConfirmationBill_Insert_New"); |
| | | if (Ds == null || Ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | sErrMsg = "单据号:" + HBillNo + ",单据ID:" + HInterID + ",上传提交发出确认单,发生错误!"; |
| | | //oCn.RollBack(); |
| | | return false; |
| | | } |
| | | else |
| | | { |
| | | if (DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0][0]) == 1) |
| | | { |
| | | sErrMsg = "单据号:" + HBillNo + ",单据ID:" + HInterID + ";" + DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HRemark"]); |
| | | //oCn.RollBack(); |
| | | return false; |
| | | } |
| | | else |
| | | { |
| | | sErrMsg = "新增单据成功!"; |
| | | //oCn.Commit(); |
| | | return true; |
| | | } |
| | | } |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | sErrMsg = "单据号:" + HBillNo + ",单据ID:" + HInterID + ",生成发出确认单失败!" + e.Message; |
| | | //oCn.RollBack(); |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | |
| | | #endregion |
| | | |
| | | |
| | | #region 桌面条码生成外网版 |
| | | |
| | | [WebMethod] |