Commit 4f23bed8 by Seniorious

1

parent dbc01356
......@@ -4,6 +4,7 @@ using APIs.Req;
using Autofac.Core;
using AutoMapper;
using Common;
using Common.Global;
using Common.Utility.Model;
using Common.Utility.RabbitMQ;
using Microsoft.AspNetCore.Mvc;
......@@ -21,6 +22,7 @@ using SqlSugar;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Diagnostics.Metrics;
using System.Drawing;
using System.Drawing.Imaging;
using System.Linq;
......@@ -28,6 +30,7 @@ using System.Linq.Expressions;
using System.Runtime.InteropServices;
using System.Security.Cryptography;
using System.Security.Cryptography.Xml;
using static Common.HttpHelper;
using static Dm.net.buffer.ByteArrayBuffer;
using static Microsoft.AspNetCore.Razor.Language.TagHelperMetadata;
using static System.Net.Mime.MediaTypeNames;
......@@ -56,12 +59,15 @@ namespace APIs.Controllers
private readonly IPrintService _printService;
private readonly IPoliceFingerService _policeFingerService;
private readonly IPoliceInfoService _policeInfoService;
private readonly IBussinessInventoryService _bussinessInventoryService;
private readonly IBussinessInventoryDetailService _bussinessInventoryDetailService;
public BaseInfoController(IMapper mapper,IPoliceService policeService, IEquipmentTypeService equipmentTypeService,
IEquipmentSizeService equipmentSizeService,ICarService carService, IInventoryService inventoryService,
IInvService invService, IUsersService usersService, ILogService logService, IDevHistoryService devHistoryService,
IDevService devService, IWarehouseService warehouseService, IOrderService orderService, ISupplierService supplierService,
IThisInfoService thisInfoService, IPrintService printService, IPoliceFingerService policeFingerService, IPoliceInfoService policeInfoService)
IThisInfoService thisInfoService, IPrintService printService, IPoliceFingerService policeFingerService, IPoliceInfoService policeInfoService,
IBussinessInventoryService bussinessInventoryService, IBussinessInventoryDetailService bussinessInventoryDetailService)
{
_carService = carService;
_equipmentSizeService = equipmentSizeService;
......@@ -80,10 +86,114 @@ namespace APIs.Controllers
_printService = printService;
_policeFingerService = policeFingerService;
_policeInfoService = policeInfoService;
_bussinessInventoryService = bussinessInventoryService;
_bussinessInventoryDetailService = bussinessInventoryDetailService;
Mapper = mapper;
}
/// <summary>
/// 手持机获取盘点单据
/// </summary>
/// <param name="req"></param>
/// <returns></returns>
[HttpPost]
public async Task<ApiResult> GetInventoryOrder([FromBody] GetInventoryOrderReq req)
{
try
{
#region
if (string.IsNullOrEmpty(req.warehouseId))
{
return new ApiResult
{
code = ResultCode.OPERATE_FAILED.Code,
msg = "参数不正确",
};
}
if(await _orderService.QueryOne(s => s.orderState != 1 && s.bussinessType.Equals("purchase")) != null)
{
return new ApiResult
{
code = ResultCode.OPERATE_FAILED.Code,
msg = "存在未记账结算的采购单据",
};
}
if (await _orderService.QueryOne(s => s.orderState == 2) != null)
{
return new ApiResult
{
code = ResultCode.OPERATE_FAILED.Code,
msg = "存在未关闭的单据",
};
}
#endregion
var BIOrderMain = await _bussinessInventoryService.QueryOneOrderDesc(s => s.warehouseId.Equals(req.warehouseId) && s.inventoryState.Equals("waitting"), c => c.createTime);
BussinessInventory? rs = await _bussinessInventoryService.GenerateInventoryOrder(BIOrderMain);
if(rs == null)
{
return new ApiResult
{
code = ResultCode.OPERATE_FAILED.Code,
msg = "子单生成失败",
};
}
#region 上报平台单据已开始
string param = JsonConvert.SerializeObject(new
{
orderId = rs.id,
detailList = rs.DetailList
});
var json = HttpHelper.HttpPost(AdminGlobalContext.jyzbConfig.Url + "BussinessInventory/Start", param);
if (string.IsNullOrEmpty(json))
{
await _bussinessInventoryService.OrderRollBack(rs);
return new ApiResult
{
code = ResultCode.OPERATE_FAILED.Code,
msg = "无法连接至平台",
};
}
var httpRes = JsonConvert.DeserializeObject<res<string>>(json);
if (httpRes.code != "10000")
{
await _bussinessInventoryService.OrderRollBack(rs);
return new ApiResult
{
code = ResultCode.OPERATE_FAILED.Code,
msg = "上报平台失败",
};
}
#endregion
var src = new ApiResult
{
code = ResultCode.OPERATE_SUCCESS.Code,
msg = ResultCode.OPERATE_SUCCESS.Msg,
data = JsonConvert.SerializeObject(rs),
};
return src;
}
catch (Exception ex)
{
var error = new ApiResult
{
code = ResultCode.OPERATE_FAILED.Code,
msg = ex.Message,
};
return error;
}
}
/// <summary>
/// 手持机上传单据操作结果
/// </summary>
/// <returns></returns>
......@@ -92,6 +202,15 @@ namespace APIs.Controllers
{
try
{
if (await _bussinessInventoryService.QueryOne(s => s.inventoryState.Equals("running")) != null)
{
return new ApiResult
{
code = ResultCode.OPERATE_FAILED.Code,
msg = "正在盘点 禁止出入库",
};
}
var src = new ApiResult
{
......@@ -191,7 +310,70 @@ namespace APIs.Controllers
}
/// <summary>
/// 通过人脸机人员标识获取警员信息
/// 更新警员人脸图片地址
/// </summary>
/// <returns></returns>
[HttpPost]
public async Task<ApiResult> UpdateHKPicture([FromBody] UpdateHKPictureReq req)
{
try
{
if (req == null)
{
return new ApiResult
{
code = ResultCode.OPERATE_SUCCESS.Code,
msg = "无效参数",
};
}else if (string.IsNullOrEmpty(req.policeId))
{
return new ApiResult
{
code = ResultCode.OPERATE_SUCCESS.Code,
msg = "警员ID为空",
};
}
var policeinfo = await _policeInfoService.QueryOne(s => s.id.Equals(req.policeId));
if (policeinfo != null)
{
policeinfo.photo = req.photo;
var rs = await _policeInfoService.Update(policeinfo);
return rs ? new ApiResult
{
code = ResultCode.OPERATE_SUCCESS.Code,
msg = ResultCode.OPERATE_SUCCESS.Msg,
} : new ApiResult
{
code = ResultCode.OPERATE_FAILED.Code,
msg = "更新地址失败",
}; ;
}
else
{
return new ApiResult
{
code = ResultCode.OPERATE_FAILED.Code,
msg = "无匹配警员信息",
};
}
}
catch (Exception ex)
{
var error = new ApiResult
{
code = ResultCode.OPERATE_FAILED.Code,
msg = ex.Message,
};
return error;
}
}
/// <summary>
/// 人脸机通过人员标识获取警员信息
/// </summary>
/// <returns></returns>
[HttpPost]
......@@ -328,6 +510,15 @@ namespace APIs.Controllers
}
#endregion
if(await _bussinessInventoryService.QueryOne(s => s.inventoryState.Equals("running")) != null)
{
return new ApiResult
{
code = ResultCode.OPERATE_FAILED.Code,
msg = "正在盘点 禁止出入库",
};
}
var myOrder = await _orderService.QueryOne(s => s.orderState == 2);//单据
var warehouse = await _warehouseService.QueryOne(s => s.id.Equals(req.warehouseId));
var warehouseInvtory = await _inventoryService.Query(s => !s.bussinessState.Equals("destruction") && !s.state.Equals("2") && s.locationId.Equals(req.warehouseId));//仓库装备
......@@ -668,7 +859,7 @@ namespace APIs.Controllers
//读取图片
string imageBytes = "";
string url = $"LogPictures/{req.pid}.jpg";
string url = $"LogPictures/{req.pid}";
using (FileStream fileStream = new FileStream(url, FileMode.Open))
{
using (BinaryReader reader = new BinaryReader(fileStream))
......
......@@ -14,4 +14,15 @@
{
public int hkDevice { get; set; }
}
public class UpdateHKPictureReq
{
public string policeId { get; set; }
public string photo { get; set; }
}
public class GetInventoryOrderReq
{
public string warehouseId { get; set; }
}
}
......@@ -75,6 +75,8 @@ namespace APIs
services.AddScoped<ISupplierService, SupplierService>();
services.AddScoped<IPoliceInfoService, PoliceInfoService>();
services.AddScoped<IPoliceFingerService, PoliceFingerService>();
services.AddScoped<IBussinessInventoryService, BussinessInventoryService>();
services.AddScoped<IBussinessInventoryDetailService, BussinessInventoryDetailService>();
#endregion
#region Repository
......@@ -99,6 +101,8 @@ namespace APIs
services.AddScoped<ISupplierRepository, SupplierRepository>();
services.AddScoped<IPoliceInfoRepository, PoliceInfoRepository>();
services.AddScoped<IPoliceFingerRepository, PoliceFingerRepository>();
services.AddScoped<IBussinessInventoryRepository, BussinessInventoryRepository>();
services.AddScoped<IBussinessInventoryDetailRepository, BussinessInventoryDetailRepository>();
#endregion
#region 注册RabbitMQ消费者
......@@ -158,6 +162,11 @@ namespace APIs
rabbits.Password = configuration.GetSection("RabbitMQConfig:Password").Value;
AdminGlobalContext.RabbitMQConfig = rabbits;
jyzbConfig jyzb = new jyzbConfig();
jyzb.Url = configuration.GetSection("jyzbConfig:Url").Value;
jyzb.OrgId = configuration.GetSection("jyzbConfig:OrgId").Value;
jyzb.OrgName = configuration.GetSection("jyzbConfig:OrgName").Value;
AdminGlobalContext.jyzbConfig = jyzb;
}
#endregion
......
......@@ -41,6 +41,13 @@
"QueueName": "cabinet",
//虚拟交换机名称
"ExchangeName": "uploadRecords"
},
"jyzbConfig": {
//3.0平台地址
"Url": "http://192.168.3.188:10030",
//组织机构ID
"OrgId": "1369509498032811869",
//组织机构名称
"OrgName": "宁波市公安局"
}
}
......@@ -16,5 +16,7 @@ namespace Common.Global
/// RabbitMQ配置
/// </summary>
public static RabbitMQConfig RabbitMQConfig { get; set; }
public static jyzbConfig jyzbConfig { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Common.Global
{
public class jyzbConfig
{
public string Url { get; set; }
public string OrgId { get; set; }
public string OrgName { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Text;
using System.Threading.Tasks;
namespace Common
{
public class HttpHelper
{
public static string HttpPost(string strUrl, string json = "")
{
try
{
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(strUrl);
request.Method = "POST";
if (!string.IsNullOrEmpty(json))
{
request.ContentType = "application/json";
byte[] data = Encoding.UTF8.GetBytes(json);
request.ContentLength = data.Length;
using (Stream reqStream = request.GetRequestStream())
{
reqStream.Write(data, 0, data.Length);
reqStream.Close();
}
}
else { request.ContentLength = 0; }
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
Stream responseStream = response.GetResponseStream();
StreamReader streamReader = new StreamReader(responseStream, Encoding.UTF8);
string retString = streamReader.ReadToEnd();
streamReader.Close();
responseStream.Close();
response.Close();
return retString;
}
catch (Exception ex)
{
return string.Empty;
}
}
public static string HttpGet(string strUrl)
{
try
{
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(strUrl);
request.Method = "GET";
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
Stream responseStream = response.GetResponseStream();
StreamReader streamReader = new StreamReader(responseStream, Encoding.UTF8);
string retString = streamReader.ReadToEnd();
streamReader.Close();
responseStream.Close();
response.Close();
return retString;
}
catch (Exception ex)
{
return string.Empty;
}
}
public class res<T> where T : class
{
public string code { get; set; }
public string message { get; set; }
public T data { get; set; }
public string timestamp { get; set; }
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using Models;
using SqlSugar;
namespace Models.Table
{
/// <summary>
///
///</summary>
[SugarTable("bussiness_inventory")]
public class BussinessInventory : BaseTable
{
/// <summary>
///
///</summary>
[SugarColumn(ColumnName="id" ,IsPrimaryKey = true )]
public long id { get; set; }
/// <summary>
/// 订单号
///</summary>
[SugarColumn(ColumnName="order_num" )]
public string orderNum { get; set; }
/// <summary>
/// 年度
///</summary>
[SugarColumn(ColumnName="year" )]
public int? year { get; set; }
/// <summary>
/// 月份
///</summary>
[SugarColumn(ColumnName="month" )]
public int? month { get; set; }
/// <summary>
/// 申请时间
///</summary>
[SugarColumn(ColumnName="apply_time" )]
public DateTime? applyTime { get; set; }
/// <summary>
/// 仓库id
///</summary>
[SugarColumn(ColumnName="warehouse_id" )]
public string warehouseId { get; set; }
/// <summary>
/// 仓库名称
///</summary>
[SugarColumn(ColumnName="warehouse_name" )]
public string warehouseName { get; set; }
/// <summary>
/// 组织机构Id
///</summary>
[SugarColumn(ColumnName="org_id" )]
public long? orgId { get; set; }
/// <summary>
/// 组织机构名称
///</summary>
[SugarColumn(ColumnName="org_name" )]
public string orgName { get; set; }
/// <summary>
/// 盘点状态,waitting等待盘点,running盘点中,finished完成,cancel取消,close结算
///</summary>
[SugarColumn(ColumnName="inventory_state" )]
public string inventoryState { get; set; }
/// <summary>
/// 盘点类型,0全盘,1按类别盘点,2按照号型盘点
///</summary>
[SugarColumn(ColumnName="inventory_type" )]
public string inventoryType { get; set; }
/// <summary>
/// 类别id汇总,用逗号分割
///</summary>
[SugarColumn(ColumnName="rules" )]
public string rules { get; set; }
/// <summary>
/// 展示汇总(不返回)
///</summary>
[SugarColumn(ColumnName="rules_json" )]
public string rulesJson { get; set; }
/// <summary>
/// 应盘总数
///</summary>
[SugarColumn(ColumnName="total_num" )]
public int? totalNum { get; set; }
/// <summary>
/// 实际总数
///</summary>
[SugarColumn(ColumnName="actual_num" )]
public int? actualNum { get; set; }
/// <summary>
/// 亏损总数
///</summary>
[SugarColumn(ColumnName="add_num" )]
public int? addNum { get; set; }
/// <summary>
/// 盈余总数
///</summary>
[SugarColumn(ColumnName="delete_num" )]
public int? deleteNum { get; set; }
/// <summary>
/// 盘点结果,ready未开始,surplus盈余,loss亏损,normal正常,surplus&amp;loss既有盈余,也有亏损
///</summary>
[SugarColumn(ColumnName="result" )]
public string result { get; set; }
/// <summary>
/// 原有epc备份(不返回)
///</summary>
[SugarColumn(ColumnName="epc_back" )]
public string epcBack { get; set; }
/// <summary>
/// 需要更新的epc汇总
///</summary>
[SugarColumn(ColumnName="epc_update" )]
public string epcUpdate { get; set; }
[Navigate(NavigateType.OneToMany, nameof(BussinessInventoryDetail.inventoryId))]
public List<BussinessInventoryDetail> DetailList { get; set; } = new List<BussinessInventoryDetail>();
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using Models;
using SqlSugar;
namespace Models.Table
{
/// <summary>
///
///</summary>
[SugarTable("bussiness_inventory_detail")]
public class BussinessInventoryDetail : BaseTable
{
/// <summary>
///
///</summary>
[SugarColumn(ColumnName="id" ,IsPrimaryKey = true ,IsIdentity = true )]
public long id { get; set; }
/// <summary>
/// 盘点表主键
///</summary>
[SugarColumn(ColumnName="inventory_id" )]
public long? inventoryId { get; set; }
/// <summary>
/// 装备类型id
///</summary>
[SugarColumn(ColumnName="type_id" )]
public string typeId { get; set; }
/// <summary>
/// 装备类型名称
///</summary>
[SugarColumn(ColumnName="type_name" )]
public string typeName { get; set; }
/// <summary>
/// 装备号型id
///</summary>
[SugarColumn(ColumnName="size_id" )]
public string sizeId { get; set; }
/// <summary>
/// 装备号型名称
///</summary>
[SugarColumn(ColumnName="size_name" )]
public string sizeName { get; set; }
/// <summary>
/// 在库数(包含报废区)
///</summary>
[SugarColumn(ColumnName="stock_number" )]
public int? stockNumber { get; set; }
/// <summary>
/// 在库金额(暂不使用)
///</summary>
[SugarColumn(ColumnName="stock_price" )]
public decimal? stockPrice { get; set; }
/// <summary>
/// 修正后的在库数量
///</summary>
[SugarColumn(ColumnName="fix_number" )]
public int? fixNumber { get; set; }
/// <summary>
/// 差距金额
///</summary>
[SugarColumn(ColumnName="fix_price" )]
public decimal? fixPrice { get; set; }
/// <summary>
/// 差距数量
/// 默认值: 0
///</summary>
[SugarColumn(ColumnName="num" )]
public int? num { get; set; }
/// <summary>
/// 状态.0正常,1盈余,2亏损
///</summary>
[SugarColumn(ColumnName="state" )]
public int? state { get; set; }
}
}
......@@ -13,27 +13,28 @@ namespace Models.SqlModel
public class EquipmentType : BaseTable
{
[SugarColumn(IsIdentity = true, IsPrimaryKey = true)]
public string id { get; set; }
public String id { get; set; }
public string name { get; set; }
public String name { get; set; }
public String unit { get; set; }
public string unit { get; set; }
[SugarColumn(ColumnName = "unit_type")]
public String? unitType { get; set; }
public string unitType { get; set; }
public String? code { get; set; }
public string code { get; set; }
[SugarColumn(ColumnName = "parent_id")]
public String? parentId { get; set; }
public string parentId { get; set; }
[SugarColumn(ColumnName = "parent_ids")]
public String? parentIds { get; set; }
public string parentIds { get; set; }
public string state { get; set; }
public String? state { get; set; }
public string note { get; set; }
public String? note { get; set; }
public string type { get; set; }
public String? type { get; set; }
public decimal? price { get; set; }
}
}
......
using Models.Table;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Repositories.IRepository.IBussiness
{
public interface IBussinessInventoryDetailRepository : IBaseRepository<BussinessInventoryDetail>
{
}
}
using Models.Table;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Repositories.IRepository.IBussiness
{
public interface IBussinessInventoryRepository : IBaseRepository<BussinessInventory>
{
Task<BussinessInventory>? GenerateInventoryOrder(BussinessInventory myBIOrder);
async Task<bool> OrderRollBack(BussinessInventory myBIOrder);
}
}
......@@ -42,7 +42,6 @@ namespace Repositories.Repository
}
public async Task<bool> DeleteByIds(int[] ids)
{
using (var context = _db.GetDbClient())
......
using Models.Table;
using Repositories.IRepository.IBussiness;
using Repositories.IRepository.IUnitOfWork;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Repositories.Repository.Bussiness
{
public class BussinessInventoryDetailRepository : BaseRepository<BussinessInventoryDetail>, IBussinessInventoryDetailRepository
{
public BussinessInventoryDetailRepository(ILocalSugarUnitOfWork sugarUnitOfWork) : base(sugarUnitOfWork)
{
}
}
}
using AutoMapper;
using Models.Table;
using Repositories.IRepository.IBussiness;
using Repositories.IRepository.IUnitOfWork;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Repositories.Repository.Bussiness
{
public class BussinessInventoryRepository : BaseRepository<BussinessInventory>, IBussinessInventoryRepository
{
protected readonly ILocalSugarUnitOfWork _suger;
public IMapper mapper;
public BussinessInventoryRepository(ILocalSugarUnitOfWork sugarUnitOfWork) : base(sugarUnitOfWork)
{
_suger = sugarUnitOfWork;
}
public async Task<BussinessInventory>? GenerateInventoryOrder(BussinessInventory myBIOrder)
{
using (var context = _suger.GetDbClient())
{
try
{
List<Inventory> inventory = new List<Inventory>();
switch (myBIOrder.inventoryType)
{
case "0"://全盘
inventory = await context.Queryable<Inventory>()
.Where(s => s.locationId.Equals(myBIOrder.warehouseId) && !s.bussinessState.Equals("destruction") && !s.equState.Equals("destory"))
.ToListAsync();
break;
case "1"://类别盘点
if (string.IsNullOrEmpty(myBIOrder.rules))
{
return null;
}
List<string> types = myBIOrder.rules.Split(',').ToList();
inventory = await context.Queryable<Inventory>()
.Where(s => s.locationId.Equals(myBIOrder.warehouseId) && !s.bussinessState.Equals("destruction") && !s.equState.Equals("destory")
&& types.Contains(s.typeId))
.ToListAsync();
break;
case "2"://号型盘点
if (string.IsNullOrEmpty(myBIOrder.rules))
{
return null;
}
List<string> sizes = myBIOrder.rules.Split(',').ToList();
inventory = await context.Queryable<Inventory>()
.Where(s => s.locationId.Equals(myBIOrder.warehouseId) && !s.bussinessState.Equals("destruction") && !s.equState.Equals("destory")
&& sizes.Contains(s.sizeId))
.ToListAsync();
break;
default:
return null;
}
List<BussinessInventoryDetail> classifyInventory = inventory
.GroupBy(s => new { s.typeId, s.typeName, s.sizeId, s.sizeName })
.Select(s => new BussinessInventoryDetail
{
inventoryId = myBIOrder.id,
typeId = s.Key.typeId,
typeName = s.Key.typeName,
sizeId = s.Key.sizeId,
sizeName = s.Key.sizeName,
stockNumber = s.Count(),
createTime = DateTime.Now,
updateTime = DateTime.Now,
fixNumber = 0,
fixPrice = 0,
num = 0,
})
.ToList();
context.BeginTran();
context.Insertable(classifyInventory).ExecuteCommand();
myBIOrder.totalNum = classifyInventory.Sum(s => s.stockNumber);
myBIOrder.updateTime = DateTime.Now;
myBIOrder.inventoryState = "running";
context.Updateable(myBIOrder).UpdateColumns(it => new { it.totalNum, it.updateTime, it.inventoryState }).ExecuteCommand();
context.CommitTran();
var rs = myBIOrder;
rs.DetailList = classifyInventory;
return rs;
}
catch (Exception e)
{
return null;
}
}
}
public async Task<bool> OrderRollBack(BussinessInventory myBIOrder)
{
using (var context = _suger.GetDbClient())
{
try
{
context.BeginTran();
myBIOrder.updateTime = DateTime.Now;
myBIOrder.inventoryState = "waitting";
context.Updateable(myBIOrder).UpdateColumns(it => new { it.updateTime, it.inventoryState }).ExecuteCommand();
context.Deleteable<BussinessInventoryDetail>().Where(it => it.inventoryId == myBIOrder.id).ExecuteCommand();
context.CommitTran();
return true;
}
catch (Exception e)
{
return false;
}
}
}
}
}
using Models.Table;
using Repositories.IRepository.IBussiness;
using Services.Interface;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Services
{
public class BussinessInventoryDetailService : BaseService<BussinessInventoryDetail>, IBussinessInventoryDetailService
{
private readonly IBussinessInventoryDetailRepository _bussinessInventoryDetailRepository;
public BussinessInventoryDetailService(IBussinessInventoryDetailRepository bussinessInventoryDetailRepository)
{
base.BaseDal = bussinessInventoryDetailRepository;
_bussinessInventoryDetailRepository = bussinessInventoryDetailRepository;
}
}
}
using AutoMapper;
using Models.Table;
using Repositories.IRepository.IBussiness;
using Repositories.Repository.Bussiness;
using Services.Interface;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Services
{
public class BussinessInventoryService : BaseService<BussinessInventory>, IBussinessInventoryService
{
private readonly IBussinessInventoryRepository _bussinessInventoryRepository;
private readonly IBussinessInventoryDetailRepository _bussinessInventoryDetailRepository;
public IMapper mapper;
public BussinessInventoryService(IBussinessInventoryRepository bussinessInventoryRepository, IBussinessInventoryDetailRepository bussinessInventoryDetailRepository, IMapper _mapper)
{
base.BaseDal = bussinessInventoryRepository;
_bussinessInventoryRepository = bussinessInventoryRepository;
_bussinessInventoryDetailRepository = bussinessInventoryDetailRepository;
mapper = _mapper;
}
public Task<BussinessInventory>? GenerateInventoryOrder(BussinessInventory myBIOrder)
{
return _bussinessInventoryRepository.GenerateInventoryOrder(myBIOrder);
}
public async Task<bool> OrderRollBack(BussinessInventory myBIOrder)
{
return _bussinessInventoryRepository.OrderRollBack(myBIOrder);
}
}
}
using Models.Table;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Services.Interface
{
public interface IBussinessInventoryDetailService : IBaseServices<BussinessInventoryDetail>
{
}
}
using Models.Table;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Services.Interface
{
public interface IBussinessInventoryService : IBaseServices<BussinessInventory>
{
Task<BussinessInventory>? GenerateInventoryOrder(BussinessInventory myBIOrder);
async Task<bool> OrderRollBack(BussinessInventory myBIOrder);
}
}
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论