/// <summary> /// 工具账务操作 /// </summary> /// <param name="ctx">数据上下文</param> /// <param name="billNo">单据号</param> /// <param name="goodsID">物品ID</param> /// <param name="provider">供应商</param> /// <param name="operationCount">操作数量</param> /// <param name="workID">操作人员ID</param> void ToolsOperation(DepotManagementDataContext ctx, string billNo, int goodsID, string provider, decimal operationCount, string workID) { IToolsManage serverTools = ServerModule.ServerModuleFactory.GetServerModule <IToolsManage>(); if (serverTools.IsTools(goodsID)) { Service_Manufacture_WorkShop.IWorkShopBasic serverWSBasic = Service_Manufacture_WorkShop.ServerModuleFactory.GetServerModule <Service_Manufacture_WorkShop.IWorkShopBasic>(); IPersonnelInfoServer serverPersonnel = ServerModuleFactory.GetServerModule <IPersonnelInfoServer>(); View_HR_Personnel viewPersonnel = serverPersonnel.GetPersonnelInfo(workID); WS_WorkShopCode tempWSCode = serverWSBasic.GetPersonnelWorkShop(workID); S_MachineAccount_Tools toolsInfo = new S_MachineAccount_Tools(); toolsInfo.GoodsID = goodsID; toolsInfo.Provider = provider; toolsInfo.StockCount = -operationCount; if (tempWSCode != null) { toolsInfo.StorageCode = tempWSCode.WSCode; } else { toolsInfo.StorageCode = viewPersonnel.部门编码; } serverTools.OpertionInfo(ctx, toolsInfo); serverTools.DayToDayAccount(ctx, toolsInfo, billNo); } }
/// <summary> /// 工具出库业务的处理 /// </summary> /// <param name="ctx">数据上下文</param> /// <param name="fetchGoodsDetailInfo">出库业务对象</param> void FetchToolsInfo(DepotManagementDataContext ctx, S_FetchGoodsDetailBill fetchGoodsDetailInfo) { if (fetchGoodsDetailInfo == null) { return; } IToolsManage serverTools = ServerModule.ServerModuleFactory.GetServerModule <IToolsManage>(); if (serverTools.IsTools(ctx, fetchGoodsDetailInfo.GoodsID)) { if (fetchGoodsDetailInfo.StorageID != null && fetchGoodsDetailInfo.StorageID.Trim().Length > 0) { S_MachineAccount_Tools toolsInfo_Storage = new S_MachineAccount_Tools(); toolsInfo_Storage.GoodsID = fetchGoodsDetailInfo.GoodsID; toolsInfo_Storage.Provider = fetchGoodsDetailInfo.Provider; toolsInfo_Storage.StockCount = -(decimal)fetchGoodsDetailInfo.FetchCount; toolsInfo_Storage.StorageCode = fetchGoodsDetailInfo.StorageID; serverTools.OpertionInfo(ctx, toolsInfo_Storage); serverTools.DayToDayAccount(ctx, toolsInfo_Storage, fetchGoodsDetailInfo.FetchBIllID); } CE_SubsidiaryOperationType operationType = (CE_SubsidiaryOperationType)Enum.ToObject(typeof(CE_SubsidiaryOperationType), fetchGoodsDetailInfo.OperationType); if (operationType != CE_SubsidiaryOperationType.营销出库 && operationType != CE_SubsidiaryOperationType.营销退库) { S_MachineAccount_Tools toolsInfo_Department = new S_MachineAccount_Tools(); toolsInfo_Department.GoodsID = fetchGoodsDetailInfo.GoodsID; toolsInfo_Department.Provider = fetchGoodsDetailInfo.Provider; toolsInfo_Department.StockCount = (decimal)fetchGoodsDetailInfo.FetchCount; toolsInfo_Department.StorageCode = UniversalFunction.GetPersonnelInfo(ctx, fetchGoodsDetailInfo.FillInPersonnel).部门编码; serverTools.OpertionInfo(ctx, toolsInfo_Department); serverTools.DayToDayAccount(ctx, toolsInfo_Department, fetchGoodsDetailInfo.FetchBIllID); } } }
/// <summary> /// 工具入库业务的处理 /// </summary> /// <param name="ctx">数据上下文</param> /// <param name="indepotDetailInfo">入库业务对象</param> void InDepotToolsInfo(DepotManagementDataContext ctx, S_InDepotDetailBill indepotDetailInfo) { if (indepotDetailInfo == null) { return; } IToolsManage serverTools = ServerModule.ServerModuleFactory.GetServerModule <IToolsManage>(); if (serverTools.IsTools(indepotDetailInfo.GoodsID)) { S_MachineAccount_Tools toolsInfo = new S_MachineAccount_Tools(); toolsInfo.GoodsID = indepotDetailInfo.GoodsID; toolsInfo.Provider = indepotDetailInfo.Provider; toolsInfo.StockCount = (decimal)indepotDetailInfo.InDepotCount; toolsInfo.StorageCode = indepotDetailInfo.StorageID; serverTools.OpertionInfo(ctx, toolsInfo); serverTools.DayToDayAccount(ctx, toolsInfo, indepotDetailInfo.InDepotBillID); } }