/// <summary> pass /// 添加联盟店采购申请 /// </summary> /// <param name="applyStock"></param> /// <param name="stockDetailInfos"> </param> /// <returns></returns> public int AddApplyStock(ApplyStockInfo applyStock, IList <ApplyStockDetailInfo> stockDetailInfos) { string msg; var applyStockBll = new ApplyStockBLL(GlobalConfig.DB.FromType.Write); return(applyStockBll.Add(applyStock, stockDetailInfos, out msg)); }
public void AddTest() { var applyStockInfo = new ApplyStockInfo { ApplyId = new Guid("955B8D16-E84E-436A-B08A-2210AA6C1BBB"), ParentApplyId = Guid.Empty, FilialeId = _shopId, FilialeName = "联盟店O2O", TradeCode = "04SPH1408291440", DateCreated = DateTime.Now, WarehouseId = _warehouseId, StockState = (int)ApplyStockState.Delivering, CompanyId = new Guid("06B30857-82F5-45F5-8768-79BD4211806C"), CompanyName = "可得公司(ERP)", CompanyWarehouseId = new Guid("B5BCDF6E-95D5-4AEE-9B19-6EE218255C05"), Transactor = "111202", Description = "联盟店采购申请", PurchaseType = 2 }; IList <ApplyStockDetailInfo> applyStockDetailInfoList = new List <ApplyStockDetailInfo> { //new ApplyStockDetailInfo // { // ApplyId = applyStockInfo.ApplyId, // GoodsId = new Guid("2BB7E671-4F33-4BD2-BC61-F95530068F6B"), // GoodsName = "盘点测试13(勿动)", // CompGoodsID = new Guid("83B8CD4E-C2B7-4D7E-855A-7A9825BDBB17"), // Price =55, // Units = "盒", // Specification = "光度:平光", // Quantity = 5, // ShopFilialeId = applyStockInfo.FilialeId, // Description = "联盟店采购" // }, new ApplyStockDetailInfo { ApplyId = applyStockInfo.ApplyId, GoodsId = new Guid("B6A5294B-0C79-4A59-A314-CD239F414EAC"), GoodsName = "博士伦季抛", CompGoodsID = new Guid("DF6FCC28-A9CC-4B7D-94F1-E421C088E43A"), Price = 10, Units = "盒", Specification = "-0.50", Quantity = 1, ShopFilialeId = applyStockInfo.FilialeId, Description = "联盟店采购" } }; if (applyStockDetailInfoList.Count > 0) { applyStockInfo.SubtotalQuantity = applyStockDetailInfoList.Sum(act => act.Quantity); string msg; int actual = _target.Add(applyStockInfo, applyStockDetailInfoList, out msg); Assert.IsTrue(actual > 4); } //Assert.Inconclusive("验证此测试方法的正确性。"); }
/// <summary> /// 确认收获异常,原采购完成,生成新采购 /// </summary> /// <param name="applyId"></param> /// <param name="storageRecord"></param> /// <param name="storageRecordDetail"></param> /// <param name="applyStock"></param> /// <param name="stockDetailInfos"></param> /// <param name="list"></param> /// <returns></returns> public int ShopConfirmPurchaseOrder(Guid applyId, StorageRecordInfo storageRecord, IList <StorageRecordDetailInfo> storageRecordDetail, ApplyStockInfo applyStock, IList <ApplyStockDetailInfo> stockDetailInfos, IList <ReckoningInfo> list) { string msg; return(ApplyStockBLL.WriteInstance.ShopConfirmPurchaseOrder(applyId, storageRecord, storageRecordDetail, applyStock, stockDetailInfos, list, out msg)); }
public void GetConfirmErrorMsgTest() { //A001PH14090515009 ApplyStockInfo applyStockInfo = _target.GetApplyInfoByTradeCode("A001PH14090515004"); IList <ApplyStockDetailInfo> applyStockDetailInfoList = _target.FindDetailList(applyStockInfo.ApplyId); Dictionary <Guid, string> actual = _target.GetConfirmErrorMsg(applyStockInfo, applyStockDetailInfoList); Assert.IsTrue(actual != null && actual.Count > 0); //Assert.Inconclusive("验证此测试方法的正确性。"); }
public void ShopConfirmPurchaseOrderTest() { var applyId = new Guid(""); StorageRecordInfo storageRecord = null; IList <StorageRecordDetailInfo> storageRecordDetail = null; ApplyStockInfo applyStock = null; IList <ApplyStockDetailInfo> stockDetailInfos = null; string msg; int actual = _target.ShopConfirmPurchaseOrder(applyId, storageRecord, storageRecordDetail, applyStock, stockDetailInfos, out msg); Assert.IsNull(actual >= 0); //Assert.AreEqual(expected, actual); //Assert.Inconclusive("验证此测试方法的正确性。"); }
public int AddNewApplyStock(ApplyStockInfo applyStockInfo, IList <ApplyStockDetailInfo> applyStockDetailInfoList, IDictionary <Guid, decimal> settledics, out string errorMsg) { var isalliance = FilialeManager.IsAllianceShopFiliale(applyStockInfo.FilialeId, out errorMsg); if (isalliance)//联盟店 { if (applyStockInfo.CompanyWarehouseId == Guid.Empty) { applyStockInfo.PurchaseType = (int)PurchaseType.FromPurchase; } var filialeInfo = FilialeManager.Get(applyStockInfo.CompanyId); applyStockInfo.CompanyName = filialeInfo != null && filialeInfo.ID != Guid.Empty ? filialeInfo.Name : "-"; //新增加盟店采购申请添加时待确认 if (applyStockInfo.StockState >= (int)ApplyStockState.Delivering) { var goodsIds = applyStockDetailInfoList.Select(ent => ent.CompGoodsID).Distinct().ToList(); var goodsInfos = _goodsInfoSao.GetGoodsListByGoodsIds(goodsIds); if (goodsInfos == null || goodsInfos.Count != goodsIds.Count) { errorMsg = "GMS商品信息获取失败"; return(-1); } var hostingFilialeId = WMSSao.GetHostingFilialeIdByWarehouseIdGoodsTypes(applyStockInfo.CompanyWarehouseId, applyStockInfo.CompanyId, goodsInfos.Select(ent => ent.GoodsType).Distinct()); if (hostingFilialeId == Guid.Empty) { errorMsg = "获取仓库对应的物流公司失败"; return(-1); } var flag = IsMatchSendCondition(applyStockInfo, applyStockDetailInfoList, hostingFilialeId, goodsInfos.ToDictionary(k => k.GoodsId, v => v), settledics, out errorMsg); //确认不通过修改采购申请状态为等待确认 if (!flag) { applyStockInfo.StockState = (int)ApplyStockState.Confirming; } } } if (_applyStockDao.Insert(applyStockInfo) && _applyStockDao.InsertDetail(applyStockDetailInfoList) > 0) { errorMsg = ""; return(applyStockInfo.StockState); } errorMsg = "添加申请明细时失败"; return(-1); }
/// <summary> /// 新增一条门店采购申请记录 /// </summary> /// <param name="info"></param> /// <returns></returns> public bool Insert(ApplyStockInfo info) { const string SQL = @" IF EXISTS(SELECT 0 FROM [Shopfront_ApplyStock] WHERE ApplyId=@ApplyId) BEGIN UPDATE [Shopfront_ApplyStock] SET SubtotalQuantity=@SubtotalQuantity WHERE ApplyId=@ApplyId END ELSE BEGIN INSERT INTO [Shopfront_ApplyStock] (ApplyId,ParentApplyId,TradeCode,FilialeId,FilialeName,WarehouseId,CompanyId,CompanyName,CompanyWarehouseId,DateCreated,Transactor,Description,SubtotalQuantity,StockState,PurchaseType,Direction) VALUES (@ApplyId,@ParentApplyId,@TradeCode,@FilialeId,@FilialeName,@WarehouseId,@CompanyId,@CompanyName,@CompanyWarehouseId,@DateCreated,@Transactor,@Description,@SubtotalQuantity,@StockState,@PurchaseType,@Direction) END "; using (SqlConnection conn = Databases.GetSqlConnection(GlobalConfig.ERP_DB_NAME, false)) { return(conn.Execute(SQL, new { ApplyId = info.ApplyId, ParentApplyId = info.ParentApplyId, TradeCode = info.TradeCode, FilialeId = info.FilialeId, FilialeName = info.FilialeName, CompanyId = info.CompanyId, CompanyName = info.CompanyName, WarehouseId = info.WarehouseId, CompanyWarehouseId = info.CompanyWarehouseId, DateCreated = info.DateCreated, Transactor = info.Transactor, Description = info.Description, SubtotalQuantity = info.SubtotalQuantity, StockState = info.StockState, PurchaseType = info.PurchaseType, Direction = info.Direction, }) > 0); } }
/// <summary> /// 新增门店采购单 /// </summary> /// <param name="applyStockInfo"></param> /// <param name="applyStockDetailInfoList"></param> /// <param name="errorMsg"> </param> /// <returns>采购申请状态</returns> public int Add(ApplyStockInfo applyStockInfo, IList <ApplyStockDetailInfo> applyStockDetailInfoList, out string errorMsg) { int state = -1; try { var isalliance = FilialeManager.IsAllianceShopFiliale(applyStockInfo.FilialeId, out errorMsg); if (isalliance)//联盟店 { if (applyStockInfo.CompanyWarehouseId == Guid.Empty) { applyStockInfo.PurchaseType = (int)PurchaseType.FromPurchase; } var filialeInfo = FilialeManager.Get(applyStockInfo.CompanyId); applyStockInfo.CompanyName = filialeInfo != null && filialeInfo.ID != Guid.Empty ? filialeInfo.Name : "-"; //新增加盟店采购申请添加时待确认 if (applyStockInfo.StockState >= (int)ApplyStockState.Delivering) { var goodsIds = applyStockDetailInfoList.Select(ent => ent.CompGoodsID).Distinct().ToList(); var goodsInfos = _goodsInfoSao.GetGoodsListByGoodsIds(goodsIds); if (goodsInfos == null || goodsInfos.Count != goodsIds.Count) { errorMsg = "GMS商品信息获取失败"; return(state); } var hostingFilialeId = WMSSao.GetHostingFilialeIdByWarehouseIdGoodsTypes(applyStockInfo.CompanyWarehouseId, applyStockInfo.CompanyId, goodsInfos.Select(ent => ent.GoodsType).Distinct()); if (hostingFilialeId == Guid.Empty) { errorMsg = "获取仓库对应的物流公司失败"; return(state); } var settleDics = _grossSettlementDal.GetLatestUnitPriceListByMultiGoods(hostingFilialeId, goodsIds); var flag = IsMatchSendCondition(applyStockInfo, applyStockDetailInfoList, hostingFilialeId, goodsInfos.ToDictionary(k => k.GoodsId, v => v), settleDics, out errorMsg); //确认不通过修改采购申请状态为等待确认 if (!flag) { applyStockInfo.StockState = (int)ApplyStockState.Confirming; } } } using (var ts = new TransactionScope(TransactionScopeOption.Required)) { bool isSuccess = _applyStockDao.Insert(applyStockInfo); if (isSuccess) { if (_applyStockDao.InsertDetail(applyStockDetailInfoList) > 0) { state = applyStockInfo.StockState; } else { isSuccess = false; errorMsg = "添加申请明细时失败"; } } else { errorMsg = "添加申请记录失败"; } if (isSuccess) { ts.Complete(); } } return(state); } catch (Exception exp) { SAL.LogCenter.LogService.LogError(string.Format("新增采购申请报错: applyStockInfo={0}, applyStockDetailInfoList={1}", new Framework.Core.Serialize.JsonSerializer().Serialize(applyStockInfo), new Framework.Core.Serialize.JsonSerializer().Serialize(applyStockDetailInfoList)), "采购管理", exp); errorMsg = exp.Message; return(-1); } }
/// <summary> /// 确认收获异常,原采购完成,生成新采购 /// </summary> /// <param name="applyId"></param> /// <param name="storageRecord"></param> /// <param name="storageRecordDetail"></param> /// <param name="applyStock"></param> /// <param name="stockDetailInfos"></param> /// <param name="list"></param> /// <param name="msg"> </param> /// <returns></returns> public int ShopConfirmPurchaseOrder(Guid applyId, StorageRecordInfo storageRecord, IList <StorageRecordDetailInfo> storageRecordDetail, ApplyStockInfo applyStock, IList <ApplyStockDetailInfo> stockDetailInfos, IList <ReckoningInfo> list, out string msg) { int state = 0; //获取商品特定时间下最近的结算价存档 var applyInfo = _applyStockDao.FindById(applyId); if (applyInfo == null) { msg = "门店要货申请记录未找到!"; return(-1); } IDictionary <Guid, decimal> dicAvgSettlePrice; using (var scope = new TransactionScope()) { var isError = storageRecord != null && storageRecordDetail != null && storageRecordDetail.Count != 0; var stockState = isError ? (int)ApplyStockState.CheckPending : (int)ApplyStockState.Finished; var flag = UpdateApplyStockState(applyInfo, stockState, false, out dicAvgSettlePrice, out msg); if (flag) { if (isError) { try { _storageManager.NewAddStorageRecordAndDetailList(storageRecord, storageRecordDetail, out msg); } catch (Exception ex) { state = -1; SAL.LogCenter.LogService.LogError(string.Format("ERP服务门店确认收获添加库存记录失败,applyID={0},storageRecord={1},storageRecordDetail={2},applyStock={3},stockDetailInfos={4},reckoningList={5}", applyId, new Framework.Core.Serialize.JsonSerializer().Serialize(storageRecord), new Framework.Core.Serialize.JsonSerializer().Serialize(storageRecordDetail), new Framework.Core.Serialize.JsonSerializer().Serialize(applyStock), new Framework.Core.Serialize.JsonSerializer().Serialize(stockDetailInfos), new Framework.Core.Serialize.JsonSerializer().Serialize(list)), "门店管理", ex); } } if (state == 0 && applyStock != null && stockDetailInfos != null && stockDetailInfos.Count != 0) { state = AddNewApplyStock(applyStock, stockDetailInfos, dicAvgSettlePrice, out msg); } if (state >= 0) { bool result = true; if (list != null && list.Count > 0) { foreach (var reckoningInfo in list) { string error; var sucess = _reckoning.Insert(reckoningInfo, out error); if (!sucess) { result = false; msg = "插入往来帐失败!"; break; } } } if (result) { scope.Complete(); } else { state = -1; SAL.LogCenter.LogService.LogError(string.Format("ERP服务门店确认收获更改状态失败,applyID={0},storageRecord={1},storageRecordDetail={2},applyStock={3},stockDetailInfos={4},reckoningList={5}", applyId, new Framework.Core.Serialize.JsonSerializer().Serialize(storageRecord), new Framework.Core.Serialize.JsonSerializer().Serialize(storageRecordDetail), new Framework.Core.Serialize.JsonSerializer().Serialize(applyStock), new Framework.Core.Serialize.JsonSerializer().Serialize(stockDetailInfos), new Framework.Core.Serialize.JsonSerializer().Serialize(list)), "门店管理"); } } } else { state = -1; SAL.LogCenter.LogService.LogError(string.Format("ERP服务门店确认收获更改状态失败,applyID={0},storageRecord={1},storageRecordDetail={2},applyStock={3},stockDetailInfos={4},reckoningList={5}", applyId, new Framework.Core.Serialize.JsonSerializer().Serialize(storageRecord), new Framework.Core.Serialize.JsonSerializer().Serialize(storageRecordDetail), new Framework.Core.Serialize.JsonSerializer().Serialize(applyStock), new Framework.Core.Serialize.JsonSerializer().Serialize(stockDetailInfos), new Framework.Core.Serialize.JsonSerializer().Serialize(list)), "门店管理"); } } return(state); }
/// <summary> /// 判断是否满足发货条件 /// </summary> /// <param name="applyStockInfo"></param> /// <param name="applyStockDetailInfoList"></param> /// <param name="hostingFilialeId"></param> /// <param name="goodsDics"></param> /// <param name="dicAvgSettlePrice"></param> /// <param name="errorMsg"></param> /// <returns></returns> public bool IsMatchSendCondition(ApplyStockInfo applyStockInfo, IList <ApplyStockDetailInfo> applyStockDetailInfoList, Guid hostingFilialeId, Dictionary <Guid, Model.Goods.GoodsInfo> goodsDics, IDictionary <Guid, decimal> dicAvgSettlePrice, out string errorMsg) { errorMsg = string.Empty; //获取子商品列表(for获取商品库存和销量) var realGoodsIds = applyStockDetailInfoList.Select(act => act.GoodsId).Distinct().ToList(); var flag = false; //2、发货量限制在可得15天外库存,如果采购数大于该库存手动确认 //当前库存-获取最近15天每日销量 var start = DateTime.Now.AddDays(-15); var end = DateTime.Now.AddDays(-1); var stockCurrent = WMSSao.GoodsEffitiveStock(applyStockInfo.CompanyWarehouseId, null, realGoodsIds, hostingFilialeId); var saleGoodsIds = _daySalesStatistics.GetRealGoodsDaySales(applyStockInfo.CompanyWarehouseId, applyStockInfo.CompanyId, new DateTime(start.Year, start.Month, start.Day), new DateTime(end.Year, end.Month, end.Day), realGoodsIds); if (stockCurrent != null && stockCurrent.Count > 0) { bool isNeedeConfirm = false; foreach (var realGoodsId in realGoodsIds) { var dataList = applyStockDetailInfoList.Where(act => act.GoodsId == realGoodsId).ToList(); var stock = stockCurrent.Count > 0 && stockCurrent.ContainsKey(realGoodsId) ? stockCurrent[realGoodsId] : 0; var sale = saleGoodsIds.FirstOrDefault(act => act.Key == realGoodsId); var tempFlag = stock - (sale != null ? sale.Value : 0) > dataList.Sum(act => act.Quantity); if (!isNeedeConfirm || flag) { flag = tempFlag; } isNeedeConfirm = true; if (!tempFlag) { foreach (var applyStockDetailInfo in dataList) { applyStockDetailInfo.IsComfirmed = true; applyStockDetailInfo.ComfirmTips = "当前库存<可得15天外销量"; } } } } if (flag) { //获取商品采购设置列表 var purchaseSetList = _purchaseSet.GetPurchaseSetInfoList(goodsDics.Keys, applyStockInfo.CompanyWarehouseId, hostingFilialeId); if (purchaseSetList == null || purchaseSetList.Count == 0) { errorMsg = "采购商品全部未绑定商品采购设置!"; return(false); } foreach (var goodsInfo in goodsDics.Values) { var dataList = applyStockDetailInfoList.Where(act => act.CompGoodsID == goodsInfo.GoodsId && !act.IsComfirmed).ToList(); string content = string.Empty; //1、判断是否存在护理液等特殊商品 if (goodsInfo.GoodsType == (int)GoodsType.LensSolution || goodsInfo.GoodsType == (int)GoodsType.CareProducts || goodsInfo.GoodsType == (int)GoodsType.NoSet) { flag = false; content = "护理液/用品或未设置等特殊商品"; } if (flag) { var setInfo = purchaseSetList.FirstOrDefault(act => act.GoodsId == goodsInfo.GoodsId); if (goodsInfo.ExpandInfo != null && setInfo != null) { //3、加盟价<=成本价*5% && 加盟价<=采购价/年返点 需手动确认,采购状态为待确认 if (goodsInfo.ExpandInfo.JoinPrice > (dicAvgSettlePrice.ContainsKey(goodsInfo.GoodsId) ? dicAvgSettlePrice[goodsInfo.GoodsId] : 0) * decimal.Parse("0.05")) { if (goodsInfo.ExpandInfo.YearDiscount == 0) { continue; } if (goodsInfo.ExpandInfo.JoinPrice > (setInfo.PurchasePrice / goodsInfo.ExpandInfo.YearDiscount)) { continue; } content = "加盟价<=采购价/年返点"; } else { content = "加盟价<=成本价*5%"; } } flag = false; } if (content.Length > 0) { foreach (var applyStockDetailInfo in dataList) { applyStockDetailInfo.IsComfirmed = true; applyStockDetailInfo.ComfirmTips = content; } } } } return(flag); }
public bool UpdateApplyStockState(ApplyStockInfo applyInfo, int state, bool alliance, out IDictionary <Guid, decimal> settleDics, out string msg) { msg = string.Empty; var dics = new Dictionary <Guid, string>(); settleDics = new Dictionary <Guid, decimal>(); if (state == (int)ApplyStockState.Delivering && !alliance) { var detailList = FindDetailList(applyInfo.ApplyId); var goodsIds = detailList.Select(ent => ent.CompGoodsID).Distinct().ToList(); var goodsInfos = _goodsInfoSao.GetGoodsListByGoodsIds(goodsIds); if (goodsInfos == null || goodsInfos.Count != goodsIds.Count) { msg = "GMS商品信息获取失败"; return(false); } var hostingFilialeId = WMSSao.GetHostingFilialeIdByWarehouseIdGoodsTypes(applyInfo.CompanyWarehouseId, applyInfo.CompanyId, goodsInfos.Select(ent => ent.GoodsType).Distinct()); if (hostingFilialeId == Guid.Empty) { msg = "获取仓库对应的物流公司失败"; return(false); } settleDics = _grossSettlementDal.GetLatestUnitPriceListByMultiGoods(hostingFilialeId, goodsIds); var result = IsMatchSendCondition(applyInfo, detailList, hostingFilialeId, goodsInfos.ToDictionary(k => k.GoodsId, v => v), settleDics, out msg); if (!result) { //更新采购申请信息 state = (int)ApplyStockState.Confirming; dics = detailList.Where(act => act.IsComfirmed).ToDictionary(k => k.GoodsId, v => v.ComfirmTips); } } bool flag = _applyStockDao.UpdateApplyStockState(applyInfo.ApplyId, state); //修改明细中商品需确认标识 if (flag && dics.Count > 0) { if (dics.Select(dic => _applyStockDao.UpdateDetailTips(applyInfo.ApplyId, dic.Key, dic.Value, true)).Any(result => !result)) { flag = false; } } if (!flag) { msg = "修改对应门店采购申请状态失败!"; } else { if (alliance) { string message; var parenId = FilialeManager.GetShopHeadFilialeId(applyInfo.FilialeId); //联盟店备注格式:[XX] var result = ShopSao.UpdatePurchaseState(parenId, applyInfo.ApplyId, state, string.Empty, out message); if (!result) { msg = message; flag = false; } } } return(flag); }
/// <summary> /// 联盟店出库审核 /// </summary> /// <param name="stockId"></param> /// <param name="goodsStockList"></param> /// <param name="semiStock"></param> /// <param name="dicGoods"></param> /// <param name="goodsInfoList"></param> /// <param name="errorMsg"></param> /// <returns></returns> public bool IsSuccess(Guid stockId, IList <StorageRecordDetailInfo> goodsStockList, StorageRecordInfo semiStock, Dictionary <Guid, ERP.Model.Goods.GoodsInfo> dicGoods, List <ERP.Model.Goods.GoodsInfo> goodsInfoList, out string errorMsg) { var isSuccess = false; using (var ts = new TransactionScope(TransactionScopeOption.Required)) { try { foreach (StorageRecordDetailInfo gsi in goodsStockList) { gsi.Quantity = -gsi.Quantity; _current.AddToStockRequirementDetail(semiStock, new[] { gsi }, "调拨出库-[编辑]", "操作人:111202", -Math.Abs(gsi.Quantity)); } string description = "[受理通过] 111202" + "[" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "]"; var stockInfo = semiStock; stockInfo.DateCreated = DateTime.Now; stockInfo.StockType = (int)StorageType.TransferStockOut; stockInfo.Transactor = "111202"; _storageManager.Insert(stockInfo, goodsStockList, semiStock.TradeCode, dicGoods); _storageManager.SetStateStorageRecord(stockId, StorageState.Pass, description); //更新结算价 foreach (var goodsInfo in goodsInfoList) { _storageManager.UpdateStorageRecordDetailToSettlementPrice(stockId, goodsInfo.GoodsId, goodsInfo.ExpandInfo.SettlementPrice, goodsInfo.ExpandInfo.JoinPrice); } //同步新增门店的入库申请 ApplyStockInfo shopApplyStockInfo = null; ShopExchangedApplyInfo exchangedApplyInfo = null; if (semiStock.OriginalCode.Contains("HH-SH")) //换货出库 { exchangedApplyInfo = _exchangedApplyBll.GetShopExchangedApplyInfoByApplyNo(semiStock.OriginalCode); } else //采购出库 { shopApplyStockInfo = _target.GetApplyInfoByTradeCode(semiStock.OriginalCode); } if (shopApplyStockInfo != null || exchangedApplyInfo != null) { if (shopApplyStockInfo != null) { //修改采购申请状态 isSuccess = _target.UpdateApplyStockState(shopApplyStockInfo.ApplyId, (int)ApplyStockState.Finishing, false, out errorMsg); } else { isSuccess = _exchangedApplyBll.SetShopExchangedState(exchangedApplyInfo.ApplyID, (byte)ExchangedState.Bartering, "换货出库", out errorMsg) > 0; } if (isSuccess) { //提交事务操作 ts.Complete(); } } else { errorMsg = "找不到与之相对应的采购/换货申请记录"; } } catch (Exception ex) { errorMsg = string.Format("审核失败!{0}", ex.Message); } } return(isSuccess); }