64 changed files with 1914 additions and 653 deletions
@ -0,0 +1,40 @@ |
|||||
|
using System.ComponentModel.DataAnnotations; |
||||
|
using Win_in.Sfs.Shared.Domain; |
||||
|
using Win_in.Sfs.Shared.Domain.Shared; |
||||
|
|
||||
|
namespace Win_in.Sfs.Basedata.Application.Contracts; |
||||
|
|
||||
|
|
||||
|
|
||||
|
[Display(Name = "器具容量占用信息")] |
||||
|
|
||||
|
public class EquipmentLocCapDTO : SfsBaseDataDTOBase, IHasCode |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// 器具代码
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "器具代码")] |
||||
|
public string Code { get; set; } |
||||
|
/// 占用百分比
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "占用百分比")] |
||||
|
public decimal Percent { get; set; } |
||||
|
|
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 零件号
|
||||
|
/// </summary>
|
||||
|
public string PartCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 录入数量
|
||||
|
/// </summary>
|
||||
|
public decimal Qty { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 标包数量
|
||||
|
/// </summary>
|
||||
|
public decimal StdQty { get; set; } |
||||
|
|
||||
|
|
||||
|
} |
@ -0,0 +1,31 @@ |
|||||
|
using System.ComponentModel.DataAnnotations; |
||||
|
using Win_in.Sfs.Shared.Domain; |
||||
|
using Win_in.Sfs.Shared.Domain.Shared; |
||||
|
|
||||
|
namespace Win_in.Sfs.Basedata.Application.Contracts; |
||||
|
|
||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
|
||||
|
[Display(Name = "器具库位关系")] |
||||
|
|
||||
|
public class EquipmentLocDTO : SfsBaseDataDTOBase, IHasCode |
||||
|
{ |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 器具编号
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "器具代码")] |
||||
|
[Required(ErrorMessage = "{0}是必填项")] |
||||
|
public string Code { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库位编号
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "库位代码")] |
||||
|
[Required(ErrorMessage = "{0}是必填项")] |
||||
|
public string LocCode { get; set; } |
||||
|
|
||||
|
|
||||
|
|
||||
|
} |
@ -0,0 +1,73 @@ |
|||||
|
using System.ComponentModel.DataAnnotations; |
||||
|
using Win_in.Sfs.Shared.Domain; |
||||
|
using Win_in.Sfs.Shared.Domain.Shared; |
||||
|
|
||||
|
namespace Win_in.Sfs.Basedata.Application.Contracts; |
||||
|
|
||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
|
||||
|
[Display(Name = "器具零件关系信息")] |
||||
|
|
||||
|
public class EquipmentPartCodeDTO : SfsBaseDataDTOBase, IHasCode |
||||
|
{ |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 器具代号
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "器具代码")] |
||||
|
[Required(ErrorMessage = "{0}是必填项")] |
||||
|
public string Code { get; set; } |
||||
|
|
||||
|
|
||||
|
///// <summary>
|
||||
|
///// 型号
|
||||
|
///// </summary>
|
||||
|
//[Display(Name = "型号")]
|
||||
|
//public string Model { get; set; } = string.Empty;
|
||||
|
/// <summary>
|
||||
|
/// 库位编号
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "零件代码")] |
||||
|
[Required(ErrorMessage = "{0}是必填项")] |
||||
|
public string PartCode { get; set; } |
||||
|
|
||||
|
|
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 标包数量
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "标包数")] |
||||
|
[Required(ErrorMessage = "{0}是必填项")] |
||||
|
public decimal StdQty { get; set; } |
||||
|
|
||||
|
|
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 单位
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "单位")] |
||||
|
public string Unit { get; set; } |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 状态
|
||||
|
/// </summary>
|
||||
|
|
||||
|
//[Display(Name = "状态")]
|
||||
|
//public int State { get; set; } = 0;
|
||||
|
|
||||
|
///// <summary>
|
||||
|
///// 创建人
|
||||
|
///// </summary>
|
||||
|
//[Display(Name = "创建人")]
|
||||
|
//public string Creator { get; set; }
|
||||
|
|
||||
|
///// <summary>
|
||||
|
///// 创建时间
|
||||
|
///// </summary>
|
||||
|
//[Display(Name = "创建时间")]
|
||||
|
//public DateTime CreatTime { get; set; } = DateTime.Now;
|
||||
|
} |
@ -0,0 +1,19 @@ |
|||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using System.ComponentModel.DataAnnotations; |
||||
|
using System.Linq; |
||||
|
using System.Text; |
||||
|
using System.Threading.Tasks; |
||||
|
|
||||
|
namespace Win_in.Sfs.Basedata.Equipments.DTOs; |
||||
|
[Display(Name = "器具校验信息")] |
||||
|
public class EquipmentRecordErrorDTO |
||||
|
{ |
||||
|
[Display(Name = "器具代码")] |
||||
|
public string EqptCode { set; get; } |
||||
|
[Display(Name = "零件代码")] |
||||
|
public string PartCode { set; get; } |
||||
|
[Display(Name = "错误信息")] |
||||
|
public string Error { set; get; } |
||||
|
|
||||
|
} |
@ -0,0 +1,33 @@ |
|||||
|
using System.Collections.Generic; |
||||
|
using System.Threading.Tasks; |
||||
|
using Microsoft.AspNetCore.Mvc; |
||||
|
using Win_in.Sfs.Shared.Application.Contracts; |
||||
|
using Win_in.Sfs.Shared.Domain.Shared; |
||||
|
|
||||
|
namespace Win_in.Sfs.Basedata.Application.Contracts; |
||||
|
|
||||
|
public interface IEquipmentLocAppService |
||||
|
: ISfsBaseDataAppServiceBase<EquipmentLocDTO, SfsBaseDataRequestInputBase, EquipmentLocEditInput> |
||||
|
, ISfsGetByCodeAppService<EquipmentLocDTO> |
||||
|
, ISfsCheckAppService<EquipmentLocCheckInput> |
||||
|
, ISfsUpsertAppService<EquipmentLocEditInput> |
||||
|
{ |
||||
|
|
||||
|
|
||||
|
Task<List<EquipmentLocDTO>> GetEquipmentLocAsync(List<string> p_ls); |
||||
|
|
||||
|
|
||||
|
//Task<bool> CheckItemIsAvailable(string itemCode);
|
||||
|
//[HttpGet("check-item-is-available-no-select-sql")]
|
||||
|
//void CheckItemIsAvailable(EquipmentLocDTO EquipmentLocDTO);
|
||||
|
|
||||
|
//Task<List<EquipmentLocDTO>> GetListByNameAsync(string name);
|
||||
|
|
||||
|
//Task<EquipmentLocDTO> GetOrAddAsync(EquipmentLocEditInput input);
|
||||
|
|
||||
|
//Task<EnumItemManageType> GetManageTypeAsync(string itemCode);
|
||||
|
//Task<Dictionary<string, EnumItemManageType>> GetManageTypesAsync(List<string> itemCodes);
|
||||
|
|
||||
|
//Task UpsertAsyncByInterface(EquipmentLocEditInput input);
|
||||
|
//Task UpsertStdPackQtyAsync(string itemCode, decimal stdpackqty);
|
||||
|
} |
@ -0,0 +1,28 @@ |
|||||
|
using System.Collections.Generic; |
||||
|
using System.Threading.Tasks; |
||||
|
using Microsoft.AspNetCore.Mvc; |
||||
|
using Win_in.Sfs.Shared.Application.Contracts; |
||||
|
using Win_in.Sfs.Shared.Domain.Shared; |
||||
|
|
||||
|
namespace Win_in.Sfs.Basedata.Application.Contracts; |
||||
|
|
||||
|
public interface IEquipmentLocCapAppService |
||||
|
: ISfsBaseDataAppServiceBase<EquipmentLocCapDTO, SfsBaseDataRequestInputBase, EquipmentLocCapEditInput> |
||||
|
, ISfsGetByCodeAppService<EquipmentLocCapDTO> |
||||
|
, ISfsCheckAppService<EquipmentLocCapCheckInput> |
||||
|
, ISfsUpsertAppService<EquipmentLocCapEditInput> |
||||
|
{ |
||||
|
//Task<bool> CheckItemIsAvailable(string itemCode);
|
||||
|
//[HttpGet("check-item-is-available-no-select-sql")]
|
||||
|
//void CheckItemIsAvailable(EquipmentLocCapDTO EquipmentLocCapDTO);
|
||||
|
|
||||
|
//Task<List<EquipmentLocCapDTO>> GetListByNameAsync(string name);
|
||||
|
|
||||
|
//Task<EquipmentLocCapDTO> GetOrAddAsync(EquipmentLocCapEditInput input);
|
||||
|
|
||||
|
//Task<EnumItemManageType> GetManageTypeAsync(string itemCode);
|
||||
|
//Task<Dictionary<string, EnumItemManageType>> GetManageTypesAsync(List<string> itemCodes);
|
||||
|
|
||||
|
//Task UpsertAsyncByInterface(EquipmentLocCapEditInput input);
|
||||
|
//Task UpsertStdPackQtyAsync(string itemCode, decimal stdpackqty);
|
||||
|
} |
@ -0,0 +1,31 @@ |
|||||
|
using System.Collections.Generic; |
||||
|
using System.Threading.Tasks; |
||||
|
using Microsoft.AspNetCore.Mvc; |
||||
|
using Win_in.Sfs.Shared.Application.Contracts; |
||||
|
using Win_in.Sfs.Shared.Domain.Shared; |
||||
|
|
||||
|
namespace Win_in.Sfs.Basedata.Application.Contracts; |
||||
|
|
||||
|
public interface IEquipmentPartCodeAppService |
||||
|
: ISfsBaseDataAppServiceBase<EquipmentPartCodeDTO, SfsBaseDataRequestInputBase, EquipmentPartCodeEditInput> |
||||
|
, ISfsGetByCodeAppService<EquipmentPartCodeDTO> |
||||
|
|
||||
|
, ISfsUpsertAppService<EquipmentPartCodeEditInput> |
||||
|
{ |
||||
|
|
||||
|
|
||||
|
Task<List<EquipmentPartCodeDTO>> GetEquipmentPartCodesAsync(List<string> p_ls); |
||||
|
//Task<bool> CheckItemIsAvailable(string itemCode);
|
||||
|
//[HttpGet("check-item-is-available-no-select-sql")]
|
||||
|
//void CheckItemIsAvailable(EquipmentPartCodeDTO EquipmentPartCodeDTO);
|
||||
|
|
||||
|
//Task<List<EquipmentPartCodeDTO>> GetListByNameAsync(string name);
|
||||
|
|
||||
|
//Task<EquipmentPartCodeDTO> GetOrAddAsync(EquipmentPartCodeEditInput input);
|
||||
|
|
||||
|
//Task<EnumItemManageType> GetManageTypeAsync(string itemCode);
|
||||
|
//Task<Dictionary<string, EnumItemManageType>> GetManageTypesAsync(List<string> itemCodes);
|
||||
|
|
||||
|
//Task UpsertAsyncByInterface(EquipmentPartCodeEditInput input);
|
||||
|
//Task UpsertStdPackQtyAsync(string itemCode, decimal stdpackqty);
|
||||
|
} |
@ -0,0 +1,20 @@ |
|||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using System.ComponentModel.DataAnnotations; |
||||
|
using Win_in.Sfs.Shared.Domain.Shared; |
||||
|
|
||||
|
namespace Win_in.Sfs.Basedata.Application.Contracts; |
||||
|
|
||||
|
public class EquipmentLocCapCheckInput |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// 器具代码
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "器具代码")] |
||||
|
public string Code { get; set; } |
||||
|
/// 占用百分比
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "占用百分比")] |
||||
|
public decimal Percent { get; set; } |
||||
|
|
||||
|
} |
@ -0,0 +1,20 @@ |
|||||
|
using System; |
||||
|
using System.ComponentModel.DataAnnotations; |
||||
|
using Win_in.Sfs.Shared.Domain; |
||||
|
using Win_in.Sfs.Shared.Domain.Shared; |
||||
|
using Win_in.Sfs.Shared.Domain.Shared.Enums.Basedata; |
||||
|
|
||||
|
namespace Win_in.Sfs.Basedata.Application.Contracts; |
||||
|
|
||||
|
public class EquipmentLocCapEditInput : SfsBaseDataCreateOrUpdateInputBase |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// 器具代码
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "器具代码")] |
||||
|
public string Code { get; set; } |
||||
|
/// 占用百分比
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "占用百分比")] |
||||
|
public decimal Percent { get; set; } |
||||
|
} |
@ -0,0 +1,38 @@ |
|||||
|
using System; |
||||
|
using System.ComponentModel.DataAnnotations; |
||||
|
|
||||
|
using Win_in.Sfs.Shared.Domain.Shared.Enums.Basedata; |
||||
|
|
||||
|
namespace Win_in.Sfs.Basedata.Application.Contracts; |
||||
|
|
||||
|
[Display(Name = "器具容量")] |
||||
|
public class EquipmentLocCapImportInput : SfsBaseDataImportInputBase |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// 器具代码
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "器具代码")] |
||||
|
public string Code { get; set; } |
||||
|
/// 占用百分比
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "占用百分比")] |
||||
|
public decimal Percent { get; set; } |
||||
|
//[Display(Name = "零件代码")]
|
||||
|
|
||||
|
//public string PartCode { get; set; }
|
||||
|
|
||||
|
//[Display(Name = "当前数量")]
|
||||
|
///// <summary>
|
||||
|
///// 录入数量
|
||||
|
///// </summary>
|
||||
|
//public decimal Qty { get; set; }
|
||||
|
//[Display(Name = "标包数量")]
|
||||
|
///// <summary>
|
||||
|
///// 标包数量
|
||||
|
///// </summary>
|
||||
|
//public decimal StdQty { get; set; }
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
} |
@ -0,0 +1,27 @@ |
|||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using System.ComponentModel.DataAnnotations; |
||||
|
using Win_in.Sfs.Shared.Domain.Shared; |
||||
|
|
||||
|
namespace Win_in.Sfs.Basedata.Application.Contracts; |
||||
|
|
||||
|
public class EquipmentLocCheckInput |
||||
|
{ |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 器具编号
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "器具代码")] |
||||
|
[Required(ErrorMessage = "{0}是必填项")] |
||||
|
public string Code { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库位编号
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "库位代码")] |
||||
|
[Required(ErrorMessage = "{0}是必填项")] |
||||
|
public string LocCode { get; set; } |
||||
|
|
||||
|
|
||||
|
|
||||
|
} |
@ -0,0 +1,28 @@ |
|||||
|
using System; |
||||
|
using System.ComponentModel.DataAnnotations; |
||||
|
using Win_in.Sfs.Shared.Domain; |
||||
|
using Win_in.Sfs.Shared.Domain.Shared; |
||||
|
|
||||
|
namespace Win_in.Sfs.Basedata.Application.Contracts; |
||||
|
|
||||
|
public class EquipmentLocEditInput : SfsBaseDataCreateOrUpdateInputBase |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// 器具编号
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "器具代码")] |
||||
|
[Required(ErrorMessage = "{0}是必填项")] |
||||
|
public string Code { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库位编号
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "库位代码")] |
||||
|
[Required(ErrorMessage = "{0}是必填项")] |
||||
|
public string LocCode { get; set; } |
||||
|
|
||||
|
[Display(Name = "状态")] |
||||
|
public int State { get; set; } = 0; |
||||
|
|
||||
|
|
||||
|
} |
@ -0,0 +1,33 @@ |
|||||
|
using System; |
||||
|
using System.ComponentModel.DataAnnotations; |
||||
|
using Win_in.Sfs.Shared.Application.Contracts; |
||||
|
using Win_in.Sfs.Shared.Domain; |
||||
|
using Win_in.Sfs.Shared.Domain.Shared; |
||||
|
|
||||
|
namespace Win_in.Sfs.Basedata.Application.Contracts; |
||||
|
|
||||
|
[Display(Name = "器具")] |
||||
|
public class EquipmentLocImportInput : SfsBaseDataImportInputBase |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// 器具编号
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "器具代码")] |
||||
|
[Required(ErrorMessage = "{0}是必填项")] |
||||
|
public string Code { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库位编号
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "库位代码")] |
||||
|
[Required(ErrorMessage = "{0}是必填项")] |
||||
|
public string LocCode { get; set; } |
||||
|
|
||||
|
|
||||
|
[Display(Name = "状态")] |
||||
|
public int State { get; set; } = 0; |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
} |
@ -0,0 +1,43 @@ |
|||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using System.ComponentModel.DataAnnotations; |
||||
|
using Win_in.Sfs.Shared.Domain.Shared; |
||||
|
|
||||
|
namespace Win_in.Sfs.Basedata.Application.Contracts; |
||||
|
|
||||
|
public class EquipmentPartCodeCheckInput |
||||
|
{ |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 器具代号
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "器具代码")] |
||||
|
[Required(ErrorMessage = "{0}是必填项")] |
||||
|
public string Code { get; set; } |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
///// <summary>
|
||||
|
///// 型号
|
||||
|
///// </summary>
|
||||
|
//[Display(Name = "型号")]
|
||||
|
//public string Model { get; set; } = string.Empty;
|
||||
|
/// <summary>
|
||||
|
/// 库位编号
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "零件代码")] |
||||
|
[Required(ErrorMessage = "{0}是必填项")] |
||||
|
public string PartCode { get; set; } |
||||
|
|
||||
|
|
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 标包数量
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "标包数")] |
||||
|
[Required(ErrorMessage = "{0}是必填项")] |
||||
|
public decimal StdQty { get; set; } |
||||
|
|
||||
|
|
||||
|
} |
@ -0,0 +1,53 @@ |
|||||
|
using System; |
||||
|
using System.ComponentModel.DataAnnotations; |
||||
|
using Win_in.Sfs.Shared.Domain; |
||||
|
using Win_in.Sfs.Shared.Domain.Shared; |
||||
|
|
||||
|
namespace Win_in.Sfs.Basedata.Application.Contracts; |
||||
|
|
||||
|
public class EquipmentPartCodeEditInput : SfsBaseDataCreateOrUpdateInputBase |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// 器具代号
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "器具代码")] |
||||
|
[Required(ErrorMessage = "{0}是必填项")] |
||||
|
public string Code { get; set; } |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
///// <summary>
|
||||
|
///// 型号
|
||||
|
///// </summary>
|
||||
|
//[Display(Name = "型号")]
|
||||
|
//public string Model { get; set; } = string.Empty;
|
||||
|
/// <summary>
|
||||
|
/// 库位编号
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "零件代码")] |
||||
|
[Required(ErrorMessage = "{0}是必填项")] |
||||
|
public string PartCode { get; set; } |
||||
|
|
||||
|
|
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 标包数量
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "标包数")] |
||||
|
[Required(ErrorMessage = "{0}是必填项")] |
||||
|
public decimal StdQty { get; set; } |
||||
|
|
||||
|
|
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 标包数量
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "单位")] |
||||
|
[Required(ErrorMessage = "{0}是必填项")] |
||||
|
public string Unit { get; set; } |
||||
|
|
||||
|
[Display(Name = "状态")] |
||||
|
public int State { get; set; } = 0; |
||||
|
|
||||
|
} |
@ -0,0 +1,60 @@ |
|||||
|
using System; |
||||
|
using System.ComponentModel.DataAnnotations; |
||||
|
using Win_in.Sfs.Shared.Application.Contracts; |
||||
|
using Win_in.Sfs.Shared.Domain; |
||||
|
using Win_in.Sfs.Shared.Domain.Shared; |
||||
|
|
||||
|
namespace Win_in.Sfs.Basedata.Application.Contracts; |
||||
|
|
||||
|
[Display(Name = "器具")] |
||||
|
public class EquipmentPartCodeImportInput : SfsBaseDataImportInputBase |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// 器具代号
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "器具代码")] |
||||
|
[Required(ErrorMessage = "{0}是必填项")] |
||||
|
public string Code { get; set; } |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
///// <summary>
|
||||
|
///// 型号
|
||||
|
///// </summary>
|
||||
|
//[Display(Name = "型号")]
|
||||
|
//public string Model { get; set; } = string.Empty;
|
||||
|
/// <summary>
|
||||
|
/// 库位编号
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "零件代码")] |
||||
|
[Required(ErrorMessage = "{0}是必填项")] |
||||
|
public string PartCode { get; set; } |
||||
|
|
||||
|
|
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 标包数量
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "标包数")] |
||||
|
[Required(ErrorMessage = "{0}是必填项")] |
||||
|
public decimal StdQty { get; set; } |
||||
|
|
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 标包数量
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "单位")] |
||||
|
[Required(ErrorMessage = "{0}是必填项")] |
||||
|
public string Unit { get; set; } |
||||
|
|
||||
|
|
||||
|
[Display(Name = "状态")] |
||||
|
public int State { get; set; } = 0; |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
} |
@ -0,0 +1,95 @@ |
|||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using System.ComponentModel.DataAnnotations; |
||||
|
using System.IO; |
||||
|
using System.Linq; |
||||
|
using System.Linq.Expressions; |
||||
|
using System.Threading; |
||||
|
using System.Threading.Tasks; |
||||
|
using Microsoft.AspNetCore.Authorization; |
||||
|
using Microsoft.AspNetCore.Http; |
||||
|
using Microsoft.AspNetCore.Mvc; |
||||
|
using Volo.Abp; |
||||
|
using Volo.Abp.Application.Dtos; |
||||
|
using Volo.Abp.Caching; |
||||
|
using Volo.Abp.Domain.Repositories; |
||||
|
using Volo.Abp.Validation; |
||||
|
using Win_in.Sfs.Basedata.Application.Contracts; |
||||
|
using Win_in.Sfs.Basedata.Domain; |
||||
|
using Win_in.Sfs.Basedata.Domain.Shared; |
||||
|
using Win_in.Sfs.Shared.Application.Contracts; |
||||
|
using Win_in.Sfs.Shared.Application.Contracts.ExportAndImport; |
||||
|
using Win_in.Sfs.Shared.Domain; |
||||
|
using Win_in.Sfs.Shared.Domain.Shared; |
||||
|
|
||||
|
namespace Win_in.Sfs.Basedata.Application; |
||||
|
|
||||
|
[Authorize] |
||||
|
[Route($"{BasedataConsts.RootPath}EquipmentLoc")] |
||||
|
public class EquipmentLocAppService |
||||
|
: SfsBaseDataWithCodeAppServiceBase<EquipmentLoc, EquipmentLocDTO, SfsBaseDataRequestInputBase, EquipmentLocEditInput, EquipmentLocImportInput> |
||||
|
, IEquipmentLocAppService |
||||
|
{ |
||||
|
//private readonly ItemValidator _itemValidator;
|
||||
|
private readonly IEquipmentLocManager _manager; |
||||
|
private new readonly IEquipmentLocRepository _repository; |
||||
|
private readonly IExportImportService _importService; |
||||
|
|
||||
|
public EquipmentLocAppService( |
||||
|
IEquipmentLocRepository repository, |
||||
|
IDistributedCache<EquipmentLocDTO> cache, |
||||
|
IExportImportService importService, |
||||
|
// ItemValidator itemValidator,
|
||||
|
IEquipmentLocManager manager) |
||||
|
: base(repository, cache) |
||||
|
{ |
||||
|
_importService=importService; |
||||
|
_repository = repository; |
||||
|
//_itemValidator = itemValidator;
|
||||
|
_manager = manager; |
||||
|
base.CreatePolicyName = EquipmentPermissions.Create; |
||||
|
base.UpdatePolicyName = EquipmentPermissions.Update; |
||||
|
base.DeletePolicyName = EquipmentPermissions.Delete; |
||||
|
} |
||||
|
|
||||
|
[HttpPost("check")] |
||||
|
//[Authorize(ErpLocationPermissions.Default)]
|
||||
|
|
||||
|
public virtual async Task CheckAsync(string code, EquipmentLocCheckInput input) |
||||
|
{ |
||||
|
await Task.CompletedTask.ConfigureAwait(false); |
||||
|
} |
||||
|
|
||||
|
[HttpPost("upsert")] |
||||
|
|
||||
|
public virtual async Task UpsertAsync(EquipmentLocEditInput input) |
||||
|
{ |
||||
|
var entity = ObjectMapper.Map<EquipmentLocEditInput, EquipmentLoc>(input); |
||||
|
await _repository.UpsertAsync(entity).ConfigureAwait(false); |
||||
|
} |
||||
|
[HttpPost] |
||||
|
[Route("")] |
||||
|
public override async Task<EquipmentLocDTO> CreateAsync(EquipmentLocEditInput input) |
||||
|
{ |
||||
|
var first= _repository.WithDetails().FirstOrDefault(p => p.Code == input.Code && p.LocCode==input.LocCode); |
||||
|
if (first == null) |
||||
|
{ |
||||
|
var entity = ObjectMapper.Map<EquipmentLocEditInput, EquipmentLoc>(input); |
||||
|
await _repository.UpsertAsync(entity).ConfigureAwait(false); |
||||
|
var entity1=_repository.WithDetails().FirstOrDefault(p => p.Code == input.Code && p.LocCode == input.LocCode); |
||||
|
return ObjectMapper.Map<EquipmentLoc,EquipmentLocDTO>(entity1); |
||||
|
} |
||||
|
else |
||||
|
{ |
||||
|
throw new UserFriendlyException($"已存在器具代码{input.Code}和库位{input.LocCode}关系!"); |
||||
|
} |
||||
|
} |
||||
|
[HttpPost] |
||||
|
[Route("GetEquipmentLocs")] |
||||
|
public async Task<List<EquipmentLocDTO>> GetEquipmentLocAsync(List<string> p_ls) |
||||
|
{ |
||||
|
var query=await _repository.GetQueryableAsync().ConfigureAwait(false); |
||||
|
var list =query.Where(p => p_ls.Contains(p.Code)); |
||||
|
return ObjectMapper.Map< List<EquipmentLoc> ,List<EquipmentLocDTO>>(list.ToList()); |
||||
|
} |
||||
|
} |
@ -0,0 +1,34 @@ |
|||||
|
using AutoMapper; |
||||
|
using Volo.Abp.AutoMapper; |
||||
|
using Win_in.Sfs.Basedata.Application.Contracts; |
||||
|
using Win_in.Sfs.Basedata.Domain; |
||||
|
|
||||
|
namespace Win_in.Sfs.Basedata.Application; |
||||
|
|
||||
|
public partial class BasedataApplicationAutoMapperProfile : Profile |
||||
|
{ |
||||
|
private void EquipmentLocAutoMapperProfile() |
||||
|
{ |
||||
|
CreateMap<EquipmentLoc, EquipmentLocDTO>() |
||||
|
|
||||
|
.ReverseMap(); |
||||
|
|
||||
|
CreateMap<EquipmentLocImportInput, EquipmentLoc>() |
||||
|
.IgnoreAuditedObjectProperties() |
||||
|
.Ignore(x => x.TenantId) |
||||
|
.Ignore(x => x.Remark) |
||||
|
.Ignore(x => x.ExtraProperties) |
||||
|
.Ignore(x => x.ConcurrencyStamp) |
||||
|
.Ignore(x=>x.State) |
||||
|
.ForMember(p =>p.Code, p => p.MapFrom(q =>q.Code)) ; |
||||
|
|
||||
|
//CreateMap<EquipmentLoc, EquipmentLocImportInput>()
|
||||
|
|
||||
|
//CreateMap<EquipmentLoc, EquipmentLocForDongyangExportDTO>()
|
||||
|
// .Ignore(x => x.ItemCategory)
|
||||
|
// .Ignore(x => x.Color);
|
||||
|
CreateMap<EquipmentLocEditInput, EquipmentLoc>() |
||||
|
.IgnoreAuditedObjectProperties() |
||||
|
.Ignore(x => x.ConcurrencyStamp).Ignore(x => x.Id); |
||||
|
} |
||||
|
} |
@ -0,0 +1,70 @@ |
|||||
|
using System.Linq; |
||||
|
using System.Threading.Tasks; |
||||
|
using Microsoft.AspNetCore.Authorization; |
||||
|
using Microsoft.AspNetCore.Mvc; |
||||
|
using Volo.Abp; |
||||
|
using Volo.Abp.Caching; |
||||
|
using Win_in.Sfs.Basedata.Application.Contracts; |
||||
|
using Win_in.Sfs.Basedata.Domain; |
||||
|
using Win_in.Sfs.Basedata.Domain.Shared; |
||||
|
using Win_in.Sfs.Shared.Application.Contracts.ExportAndImport; |
||||
|
namespace Win_in.Sfs.Basedata.Application; |
||||
|
|
||||
|
[Authorize] |
||||
|
[Route($"{BasedataConsts.RootPath}EquipmentLocCap")] |
||||
|
public class EquipmentLocCapAppService |
||||
|
: SfsBaseDataWithCodeAppServiceBase<EquipmentLocCap, EquipmentLocCapDTO, SfsBaseDataRequestInputBase, EquipmentLocCapEditInput, EquipmentLocCapImportInput> |
||||
|
, IEquipmentLocCapAppService |
||||
|
{ |
||||
|
private readonly IEquipmentLocCapManager _manager; |
||||
|
private new readonly IEquipmentLocCapRepository _repository; |
||||
|
private readonly IExportImportService _importService; |
||||
|
public EquipmentLocCapAppService( |
||||
|
IEquipmentLocCapRepository repository, |
||||
|
IDistributedCache<EquipmentLocCapDTO> cache, |
||||
|
IExportImportService importService, |
||||
|
IEquipmentLocCapManager manager) |
||||
|
: base(repository, cache) |
||||
|
{ |
||||
|
_importService=importService; |
||||
|
_repository = repository; |
||||
|
_manager = manager; |
||||
|
base.CreatePolicyName = EquipmentPermissions.Create; |
||||
|
base.UpdatePolicyName = EquipmentPermissions.Update; |
||||
|
base.DeletePolicyName = EquipmentPermissions.Delete; |
||||
|
} |
||||
|
|
||||
|
[HttpPost("check")] |
||||
|
//[Authorize(ErpLocationPermissions.Default)]
|
||||
|
public virtual async Task CheckAsync(string code, EquipmentLocCapCheckInput input) |
||||
|
{ |
||||
|
await Task.CompletedTask.ConfigureAwait(false); |
||||
|
} |
||||
|
[HttpPost("upsert")] |
||||
|
|
||||
|
public virtual async Task UpsertAsync(EquipmentLocCapEditInput input) |
||||
|
{ |
||||
|
var entity = ObjectMapper.Map<EquipmentLocCapEditInput, EquipmentLocCap>(input); |
||||
|
await _repository.UpsertAsync(entity).ConfigureAwait(false); |
||||
|
} |
||||
|
|
||||
|
[HttpPost] |
||||
|
[Route("")] |
||||
|
public override async Task<EquipmentLocCapDTO> CreateAsync(EquipmentLocCapEditInput input) |
||||
|
{ |
||||
|
var query =await _repository.GetQueryableAsync().ConfigureAwait(false); |
||||
|
var first=query.FirstOrDefault(p => p.Code == input.Code); |
||||
|
if (first == null) |
||||
|
{ |
||||
|
var entity = ObjectMapper.Map<EquipmentLocCapEditInput, EquipmentLocCap>(input); |
||||
|
entity.Code = string.Format("{0}{1}", "Q", entity.Code); |
||||
|
await _repository.UpsertAsync(entity).ConfigureAwait(false); |
||||
|
var entity1=_repository.WithDetails().FirstOrDefault(p => p.Code == input.Code); |
||||
|
return ObjectMapper.Map<EquipmentLocCap,EquipmentLocCapDTO>(entity1); |
||||
|
} |
||||
|
else |
||||
|
{ |
||||
|
throw new UserFriendlyException($"已存在器具编号{input.Code}!"); |
||||
|
} |
||||
|
} |
||||
|
} |
@ -0,0 +1,43 @@ |
|||||
|
using AutoMapper; |
||||
|
using Volo.Abp.AutoMapper; |
||||
|
using Win_in.Sfs.Basedata.Application.Contracts; |
||||
|
using Win_in.Sfs.Basedata.Domain; |
||||
|
|
||||
|
namespace Win_in.Sfs.Basedata.Application; |
||||
|
|
||||
|
public partial class BasedataApplicationAutoMapperProfile : Profile |
||||
|
{ |
||||
|
private void EquipmentLocCapAutoMapperProfile() |
||||
|
{ |
||||
|
CreateMap<EquipmentLocCap, EquipmentLocCapDTO>() |
||||
|
.IgnoreAuditedObjectProperties() |
||||
|
|
||||
|
.ReverseMap(); |
||||
|
|
||||
|
CreateMap<EquipmentLocCapImportInput, EquipmentLocCap>() |
||||
|
.IgnoreAuditedObjectProperties() |
||||
|
.Ignore(x => x.TenantId) |
||||
|
.Ignore(x => x.Remark) |
||||
|
.Ignore(x => x.ExtraProperties) |
||||
|
.Ignore(x => x.ConcurrencyStamp) |
||||
|
.Ignore(x => x.StdQty) |
||||
|
.Ignore(x => x.PartCode) |
||||
|
.Ignore(x => x.Qty) |
||||
|
.Ignore(x => x.ConcurrencyStamp) |
||||
|
|
||||
|
|
||||
|
.ForMember(p => p.Code, p => p.MapFrom(q =>q.Code)); |
||||
|
|
||||
|
//CreateMap<EquipmentLocCap, EquipmentLocCapImportInput>()
|
||||
|
|
||||
|
//CreateMap<EquipmentLocCap, EquipmentLocCapForDongyangExportDTO>()
|
||||
|
// .Ignore(x => x.ItemCategory)
|
||||
|
// .Ignore(x => x.Color);
|
||||
|
CreateMap<EquipmentLocCapEditInput, EquipmentLocCap>() |
||||
|
.IgnoreAuditedObjectProperties() |
||||
|
.Ignore(x => x.StdQty) |
||||
|
.Ignore(x => x.PartCode) |
||||
|
.Ignore(x => x.Qty) |
||||
|
.Ignore(x => x.ConcurrencyStamp).Ignore(x => x.Id); |
||||
|
} |
||||
|
} |
@ -0,0 +1,109 @@ |
|||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using System.ComponentModel.DataAnnotations; |
||||
|
using System.IO; |
||||
|
using System.Linq; |
||||
|
using System.Linq.Expressions; |
||||
|
using System.Threading; |
||||
|
using System.Threading.Tasks; |
||||
|
using Microsoft.AspNetCore.Authorization; |
||||
|
using Microsoft.AspNetCore.Http; |
||||
|
using Microsoft.AspNetCore.Mvc; |
||||
|
using Volo.Abp; |
||||
|
using Volo.Abp.Application.Dtos; |
||||
|
using Volo.Abp.Caching; |
||||
|
using Volo.Abp.Domain.Repositories; |
||||
|
using Volo.Abp.ObjectMapping; |
||||
|
using Volo.Abp.Validation; |
||||
|
using Win_in.Sfs.Basedata.Application.Contracts; |
||||
|
using Win_in.Sfs.Basedata.Domain; |
||||
|
using Win_in.Sfs.Basedata.Domain.Shared; |
||||
|
using Win_in.Sfs.Shared.Application.Contracts; |
||||
|
using Win_in.Sfs.Shared.Application.Contracts.ExportAndImport; |
||||
|
using Win_in.Sfs.Shared.Domain; |
||||
|
using Win_in.Sfs.Shared.Domain.Shared; |
||||
|
|
||||
|
namespace Win_in.Sfs.Basedata.Application; |
||||
|
|
||||
|
[Authorize] |
||||
|
[Route($"{BasedataConsts.RootPath}EquipmentPartCode")] |
||||
|
public class EquipmentPartCodeAppService |
||||
|
: SfsBaseDataWithCodeAppServiceBase<EquipmentPartCode, EquipmentPartCodeDTO, SfsBaseDataRequestInputBase, EquipmentPartCodeEditInput, EquipmentPartCodeImportInput> |
||||
|
, IEquipmentPartCodeAppService |
||||
|
{ |
||||
|
private readonly IEquipmentPartCodeManager _manager; |
||||
|
private new readonly IEquipmentPartCodeRepository _repository; |
||||
|
private readonly IExportImportService _importService; |
||||
|
|
||||
|
public EquipmentPartCodeAppService( |
||||
|
IEquipmentPartCodeRepository repository, |
||||
|
IDistributedCache<EquipmentPartCodeDTO> cache, |
||||
|
IExportImportService importService, |
||||
|
|
||||
|
IEquipmentPartCodeManager manager) |
||||
|
: base(repository, cache) |
||||
|
{ |
||||
|
_importService=importService; |
||||
|
_repository = repository; |
||||
|
_manager = manager; |
||||
|
base.CreatePolicyName = EquipmentPermissions.Create; |
||||
|
base.UpdatePolicyName = EquipmentPermissions.Update; |
||||
|
base.DeletePolicyName = EquipmentPermissions.Delete; |
||||
|
} |
||||
|
|
||||
|
[HttpPost("check")] |
||||
|
//[Authorize(ErpLocationPermissions.Default)]
|
||||
|
|
||||
|
public virtual async Task CheckAsync(string code, EquipmentPartCodeCheckInput input) |
||||
|
{ |
||||
|
await Task.CompletedTask.ConfigureAwait(false); |
||||
|
} |
||||
|
|
||||
|
[HttpPost("upsert")] |
||||
|
|
||||
|
public virtual async Task UpsertAsync(EquipmentPartCodeEditInput input) |
||||
|
{ |
||||
|
var entity = ObjectMapper.Map<EquipmentPartCodeEditInput, EquipmentPartCode>(input); |
||||
|
|
||||
|
await _repository.UpsertAsync(entity).ConfigureAwait(false); |
||||
|
} |
||||
|
|
||||
|
[HttpPost] |
||||
|
[Route("")] |
||||
|
public override async Task<EquipmentPartCodeDTO> CreateAsync(EquipmentPartCodeEditInput input) |
||||
|
{ |
||||
|
var first= _repository.WithDetails().FirstOrDefault(p => p.Code == input.Code && p.PartCode==input.PartCode); |
||||
|
if (first == null) |
||||
|
{ |
||||
|
var entity = ObjectMapper.Map<EquipmentPartCodeEditInput, EquipmentPartCode>(input); |
||||
|
|
||||
|
await _repository.UpsertAsync(entity).ConfigureAwait(false); |
||||
|
var entity1=_repository.WithDetails().FirstOrDefault(p => p.Code == input.Code && p.PartCode == input.PartCode); |
||||
|
return ObjectMapper.Map<EquipmentPartCode,EquipmentPartCodeDTO>(entity1); |
||||
|
} |
||||
|
else |
||||
|
{ |
||||
|
throw new UserFriendlyException($"已存在器具代码{input.Code}和零件代码{input.PartCode}关系!"); |
||||
|
} |
||||
|
} |
||||
|
[HttpPost] |
||||
|
[Route("GetEquipmentPartCodes")] |
||||
|
public async Task<List<EquipmentPartCodeDTO>> GetEquipmentPartCodesAsync(List<string> p_ls) |
||||
|
{ |
||||
|
var query = await _repository.GetQueryableAsync().ConfigureAwait(false); |
||||
|
var list = query.Where(p => p_ls.Contains(p.Code)); |
||||
|
|
||||
|
return ObjectMapper.Map<List<EquipmentPartCode>, List<EquipmentPartCodeDTO>>(list.ToList()); |
||||
|
|
||||
|
} |
||||
|
protected override async Task ValidateImportModelAsync(EquipmentPartCodeImportInput importInput, List<ValidationResult> validationRresult) |
||||
|
{ |
||||
|
await base.CheckItemBasicItemCodeAsync(importInput.Code, validationRresult).ConfigureAwait(false); |
||||
|
|
||||
|
//await base.CheckComponentAndComponentQtyAsync(importInput.Component, importInput.ComponentQty, validationRresult).ConfigureAwait(false);
|
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
} |
@ -0,0 +1,35 @@ |
|||||
|
using AutoMapper; |
||||
|
using Volo.Abp.AutoMapper; |
||||
|
using Win_in.Sfs.Basedata.Application.Contracts; |
||||
|
using Win_in.Sfs.Basedata.Domain; |
||||
|
|
||||
|
namespace Win_in.Sfs.Basedata.Application; |
||||
|
|
||||
|
public partial class BasedataApplicationAutoMapperProfile : Profile |
||||
|
{ |
||||
|
private void EquipmentPartCodeAutoMapperProfile() |
||||
|
{ |
||||
|
CreateMap<EquipmentPartCode, EquipmentPartCodeDTO>() |
||||
|
|
||||
|
.ReverseMap(); |
||||
|
|
||||
|
CreateMap<EquipmentPartCodeImportInput, EquipmentPartCode>() |
||||
|
.IgnoreAuditedObjectProperties() |
||||
|
.Ignore(x => x.TenantId) |
||||
|
.Ignore(x => x.Remark) |
||||
|
.Ignore(x => x.ExtraProperties) |
||||
|
.Ignore(x => x.ConcurrencyStamp) |
||||
|
.ForMember(p =>p.Code, p => p.MapFrom(q =>q.Code)) |
||||
|
|
||||
|
; |
||||
|
|
||||
|
//CreateMap<EquipmentPartCode, EquipmentPartCodeImportInput>()
|
||||
|
|
||||
|
//CreateMap<EquipmentPartCode, EquipmentPartCodeForDongyangExportDTO>()
|
||||
|
// .Ignore(x => x.ItemCategory)
|
||||
|
// .Ignore(x => x.Color);
|
||||
|
CreateMap<EquipmentPartCodeEditInput, EquipmentPartCode>() |
||||
|
.IgnoreAuditedObjectProperties() |
||||
|
.Ignore(x => x.ConcurrencyStamp).Ignore(x => x.Id); |
||||
|
} |
||||
|
} |
@ -0,0 +1,36 @@ |
|||||
|
using System; |
||||
|
using System.ComponentModel.DataAnnotations; |
||||
|
using Win_in.Sfs.Shared.Domain; |
||||
|
using Win_in.Sfs.Shared.Domain.Entities; |
||||
|
using Win_in.Sfs.Shared.Domain.Shared; |
||||
|
using Win_in.Sfs.Shared.Domain.Shared.Enums.Basedata; |
||||
|
|
||||
|
namespace Win_in.Sfs.Basedata.Domain; |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 物品基本信息
|
||||
|
/// </summary>
|
||||
|
public class EquipmentLoc : SfsBaseDataAggregateRootBase, IHasCode |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// 器具代码
|
||||
|
/// </summary>
|
||||
|
public string Code { get; set; } |
||||
|
///// <summary>
|
||||
|
///// 类型
|
||||
|
///// </summary>
|
||||
|
//public EquipmentType Type { get; set; }
|
||||
|
///// <summary>
|
||||
|
///// 型号
|
||||
|
///// </summary>
|
||||
|
//public EquipmentModel Model { get; set; }
|
||||
|
/// <summary>
|
||||
|
/// 库位代码
|
||||
|
/// </summary>
|
||||
|
public string LocCode { get; set; } |
||||
|
/// <summary>
|
||||
|
/// 状态
|
||||
|
/// </summary>
|
||||
|
public int State { get; set; } |
||||
|
|
||||
|
} |
@ -0,0 +1,36 @@ |
|||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using System.Linq; |
||||
|
using System.Text; |
||||
|
using System.Threading.Tasks; |
||||
|
using Win_in.Sfs.Shared.Domain; |
||||
|
|
||||
|
namespace Win_in.Sfs.Basedata.Domain; |
||||
|
|
||||
|
|
||||
|
public class EquipmentLocCap:SfsAggregateRootBase, IHasCode |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// 器具代码
|
||||
|
/// </summary>
|
||||
|
public string Code { get; set; } |
||||
|
/// <summary>
|
||||
|
/// 零件号
|
||||
|
/// </summary>
|
||||
|
public string PartCode { get; set; } |
||||
|
/// <summary>
|
||||
|
/// 占用百分比
|
||||
|
/// </summary>
|
||||
|
public decimal Percent { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 录入数量
|
||||
|
/// </summary>
|
||||
|
public decimal Qty { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 标包数量
|
||||
|
/// </summary>
|
||||
|
public decimal StdQty { get; set; } |
||||
|
|
||||
|
} |
@ -0,0 +1,38 @@ |
|||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using System.Linq; |
||||
|
using System.Threading.Tasks; |
||||
|
using Volo.Abp; |
||||
|
using Volo.Abp.Domain.Services; |
||||
|
|
||||
|
using Win_in.Sfs.Shared.Domain.Shared; |
||||
|
|
||||
|
|
||||
|
namespace Win_in.Sfs.Basedata.Domain; |
||||
|
|
||||
|
public class EquipmentLocCapManager : DomainService, IEquipmentLocCapManager |
||||
|
{ |
||||
|
private readonly IEquipmentLocCapRepository _repository; |
||||
|
|
||||
|
|
||||
|
public EquipmentLocCapManager(IEquipmentLocCapRepository repository |
||||
|
|
||||
|
) |
||||
|
{ |
||||
|
_repository = repository; |
||||
|
|
||||
|
} |
||||
|
|
||||
|
|
||||
|
public Task ImportDataAsync(List<EquipmentLocCap> entities, List<EquipmentLocCap> deleteEntities = null) |
||||
|
{ |
||||
|
throw new NotImplementedException(); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
private async Task SetDetailAsync(List<EquipmentLocCap> details) |
||||
|
{ |
||||
|
|
||||
|
} |
||||
|
} |
@ -0,0 +1,29 @@ |
|||||
|
using System.Collections.Generic; |
||||
|
using System.Threading.Tasks; |
||||
|
using Volo.Abp.Domain.Services; |
||||
|
|
||||
|
namespace Win_in.Sfs.Basedata.Domain; |
||||
|
|
||||
|
public class EquipmentLocManager : DomainService, IEquipmentLocManager |
||||
|
{ |
||||
|
private readonly IEquipmentLocRepository _repository; |
||||
|
|
||||
|
public EquipmentLocManager(IEquipmentLocRepository repository) |
||||
|
{ |
||||
|
_repository = repository; |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 执行导入
|
||||
|
/// </summary>
|
||||
|
public virtual async Task ImportDataAsync(List<EquipmentLoc> mergeEntities, List<EquipmentLoc> deleteEntities = null) |
||||
|
{ |
||||
|
if (deleteEntities != null && deleteEntities.Count > 0) |
||||
|
{ |
||||
|
await _repository.BulkDeleteAsync(deleteEntities).ConfigureAwait(false); |
||||
|
} |
||||
|
|
||||
|
await _repository.BulkMergeAsync(mergeEntities).ConfigureAwait(false); |
||||
|
} |
||||
|
} |
||||
|
|
@ -0,0 +1,44 @@ |
|||||
|
using System; |
||||
|
using System.ComponentModel.DataAnnotations; |
||||
|
using Win_in.Sfs.Shared.Domain; |
||||
|
using Win_in.Sfs.Shared.Domain.Entities; |
||||
|
using Win_in.Sfs.Shared.Domain.Shared; |
||||
|
using Win_in.Sfs.Shared.Domain.Shared.Enums.Basedata; |
||||
|
|
||||
|
namespace Win_in.Sfs.Basedata.Domain; |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 器具基本信息
|
||||
|
/// </summary>
|
||||
|
public class EquipmentPartCode : SfsBaseDataAggregateRootBase, IHasCode |
||||
|
{ |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 器具编号
|
||||
|
/// </summary>
|
||||
|
public string Code { get; set; } |
||||
|
///// <summary>
|
||||
|
///// 类型
|
||||
|
///// </summary>
|
||||
|
//public EquipmentType Type { get; set; }
|
||||
|
///// <summary>
|
||||
|
///// 型号
|
||||
|
///// </summary>
|
||||
|
//public EquipmentModel Model { get; set; }
|
||||
|
/// <summary>
|
||||
|
/// 库位编号
|
||||
|
/// </summary>
|
||||
|
public string PartCode { get; set; } |
||||
|
/// <summary>
|
||||
|
/// 数量
|
||||
|
/// </summary>
|
||||
|
public decimal StdQty { get; set; } |
||||
|
/// <summary>
|
||||
|
/// 状态
|
||||
|
/// </summary>
|
||||
|
public int State { get; set; } |
||||
|
/// <summary>
|
||||
|
/// 单位
|
||||
|
/// </summary>
|
||||
|
public string Unit { get; set; } |
||||
|
} |
@ -0,0 +1,29 @@ |
|||||
|
using System.Collections.Generic; |
||||
|
using System.Threading.Tasks; |
||||
|
using Volo.Abp.Domain.Services; |
||||
|
|
||||
|
namespace Win_in.Sfs.Basedata.Domain; |
||||
|
|
||||
|
public class EquipmentPartCodeManager : DomainService, IEquipmentPartCodeManager |
||||
|
{ |
||||
|
private readonly IEquipmentPartCodeRepository _repository; |
||||
|
|
||||
|
public EquipmentPartCodeManager(IEquipmentPartCodeRepository repository) |
||||
|
{ |
||||
|
_repository = repository; |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 执行导入
|
||||
|
/// </summary>
|
||||
|
public virtual async Task ImportDataAsync(List<EquipmentPartCode> mergeEntities, List<EquipmentPartCode> deleteEntities = null) |
||||
|
{ |
||||
|
if (deleteEntities != null && deleteEntities.Count > 0) |
||||
|
{ |
||||
|
await _repository.BulkDeleteAsync(deleteEntities).ConfigureAwait(false); |
||||
|
} |
||||
|
|
||||
|
await _repository.BulkMergeAsync(mergeEntities).ConfigureAwait(false); |
||||
|
} |
||||
|
} |
||||
|
|
@ -0,0 +1,13 @@ |
|||||
|
using System; |
||||
|
using System.Threading.Tasks; |
||||
|
using Win_in.Sfs.Shared.Domain; |
||||
|
|
||||
|
|
||||
|
namespace Win_in.Sfs.Basedata.Domain; |
||||
|
|
||||
|
public interface IEquipmentLocCapManager : IBulkImportService<EquipmentLocCap> |
||||
|
{ |
||||
|
//Task OpenDetailAsync(Guid id, Guid detailId);
|
||||
|
//Task CloseDetailAsync(Guid id, Guid detailId);
|
||||
|
//Task<bool> CheckIsCloseAsync(string number, string supplierCode, string itemCode);
|
||||
|
} |
@ -0,0 +1,11 @@ |
|||||
|
using System.Threading.Tasks; |
||||
|
using Volo.Abp.Domain.Services; |
||||
|
using Win_in.Sfs.Shared.Domain; |
||||
|
|
||||
|
|
||||
|
namespace Win_in.Sfs.Basedata.Domain; |
||||
|
|
||||
|
public interface IEquipmentLocCapRepository : ISfsBaseDataRepositoryBase<EquipmentLocCap>, ISfsBulkRepositoryBase<EquipmentLocCap> |
||||
|
{ |
||||
|
Task UpsertAsync(EquipmentLocCap newData); |
||||
|
} |
@ -0,0 +1,8 @@ |
|||||
|
using Volo.Abp.Domain.Services; |
||||
|
using Win_in.Sfs.Shared.Domain; |
||||
|
|
||||
|
namespace Win_in.Sfs.Basedata.Domain; |
||||
|
|
||||
|
public interface IEquipmentLocManager : IDomainService, IBulkImportService<EquipmentLoc> |
||||
|
{ |
||||
|
} |
@ -0,0 +1,13 @@ |
|||||
|
using System.Threading.Tasks; |
||||
|
using Win_in.Sfs.Shared.Domain; |
||||
|
|
||||
|
namespace Win_in.Sfs.Basedata.Domain; |
||||
|
|
||||
|
public interface IEquipmentLocRepository : ISfsBaseDataRepositoryBase<EquipmentLoc>, ISfsBulkRepositoryBase<EquipmentLoc> |
||||
|
{ |
||||
|
public Task UpsertAsync(EquipmentLoc entity); |
||||
|
|
||||
|
public Task InsertAutoSaveAsync(EquipmentLoc entity); |
||||
|
|
||||
|
public Task UpsertAsyncByInterface(EquipmentLoc entity); |
||||
|
} |
@ -0,0 +1,8 @@ |
|||||
|
using Volo.Abp.Domain.Services; |
||||
|
using Win_in.Sfs.Shared.Domain; |
||||
|
|
||||
|
namespace Win_in.Sfs.Basedata.Domain; |
||||
|
|
||||
|
public interface IEquipmentPartCodeManager : IDomainService, IBulkImportService<EquipmentPartCode> |
||||
|
{ |
||||
|
} |
@ -0,0 +1,13 @@ |
|||||
|
using System.Threading.Tasks; |
||||
|
using Win_in.Sfs.Shared.Domain; |
||||
|
|
||||
|
namespace Win_in.Sfs.Basedata.Domain; |
||||
|
|
||||
|
public interface IEquipmentPartCodeRepository : ISfsBaseDataRepositoryBase<EquipmentPartCode>, ISfsBulkRepositoryBase<EquipmentPartCode> |
||||
|
{ |
||||
|
public Task UpsertAsync(EquipmentPartCode entity); |
||||
|
|
||||
|
public Task InsertAutoSaveAsync(EquipmentPartCode entity); |
||||
|
|
||||
|
public Task UpsertAsyncByInterface(EquipmentPartCode entity); |
||||
|
} |
@ -0,0 +1,66 @@ |
|||||
|
using System; |
||||
|
using System.Threading.Tasks; |
||||
|
using Microsoft.EntityFrameworkCore; |
||||
|
using Volo.Abp.EntityFrameworkCore; |
||||
|
using Win_in.Sfs.Basedata.Domain; |
||||
|
using Win_in.Sfs.Shared.Domain; |
||||
|
|
||||
|
namespace Win_in.Sfs.Basedata.EntityFrameworkCore; |
||||
|
|
||||
|
public class EquipmentLocCapEfCoreRepository : SfsBaseDataEfCoreRepositoryBase<BasedataDbContext, EquipmentLocCap>, IEquipmentLocCapRepository, ISfsBulkRepositoryBase<EquipmentLocCap> |
||||
|
{ |
||||
|
public EquipmentLocCapEfCoreRepository(IDbContextProvider<BasedataDbContext> dbContextProvider) : base(dbContextProvider) |
||||
|
{ |
||||
|
} |
||||
|
public virtual async Task UpsertAsyncByInterface(EquipmentLocCap entity) |
||||
|
{ |
||||
|
var dbSet = await GetDbSetAsync().ConfigureAwait(false); |
||||
|
|
||||
|
|
||||
|
|
||||
|
var exist = await dbSet.FirstOrDefaultAsync(p => p.Code == entity.Code).ConfigureAwait(false); |
||||
|
if (exist == null) |
||||
|
{ |
||||
|
var insRet = await InsertAsync(entity).ConfigureAwait(false); |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
} |
||||
|
else |
||||
|
{ |
||||
|
exist.Qty = entity.Qty; |
||||
|
exist.StdQty = entity.StdQty; |
||||
|
exist.Percent = entity.Percent; |
||||
|
exist.LastModificationTime = DateTimeOffset.Now.DateTime; |
||||
|
|
||||
|
} |
||||
|
} |
||||
|
public virtual async Task UpsertAsync(EquipmentLocCap entity) |
||||
|
{ |
||||
|
var dbSet = await GetDbSetAsync().ConfigureAwait(false); |
||||
|
|
||||
|
var exist = await dbSet.FirstOrDefaultAsync(p => p.Code == entity.Code).ConfigureAwait(false); |
||||
|
if (exist == null) |
||||
|
{ |
||||
|
var insRet = await InsertAsync(entity).ConfigureAwait(false); |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
} |
||||
|
else |
||||
|
{ |
||||
|
exist.Qty = entity.Qty; |
||||
|
exist.StdQty = entity.StdQty; |
||||
|
exist.Percent = entity.Percent; |
||||
|
exist.LastModificationTime = DateTimeOffset.Now.DateTime; |
||||
|
|
||||
|
} |
||||
|
} |
||||
|
|
||||
|
public virtual async Task InsertAutoSaveAsync(EquipmentLocCap entity) |
||||
|
{ |
||||
|
_ = await InsertAsync(entity, true, GetCancellationToken()).ConfigureAwait(false); |
||||
|
} |
||||
|
} |
@ -0,0 +1,40 @@ |
|||||
|
using Microsoft.EntityFrameworkCore; |
||||
|
using Volo.Abp.EntityFrameworkCore.Modeling; |
||||
|
using Win_in.Sfs.Basedata.Domain; |
||||
|
using Win_in.Sfs.Shared.Domain.Shared; |
||||
|
using Win_in.Sfs.Shared.EntityFrameworkCore; |
||||
|
|
||||
|
namespace Win_in.Sfs.Basedata.EntityFrameworkCore; |
||||
|
|
||||
|
public static class EquipmentLocDbContextModelCreatingExtensions |
||||
|
{ |
||||
|
public static void ConfigureEquipmentLoc(this ModelBuilder builder, BasedataModelBuilderConfigurationOptions options) |
||||
|
{ |
||||
|
builder.Entity<EquipmentLoc>(b => |
||||
|
{ |
||||
|
//Configure table & schema name
|
||||
|
b.ToTable(options.TablePrefix + nameof(EquipmentLoc), options.Schema); |
||||
|
//Configure ABP properties
|
||||
|
b.ConfigureByConvention(); |
||||
|
//Configure Sfs base properties
|
||||
|
b.ConfigureSfsBase(); |
||||
|
|
||||
|
//Properties
|
||||
|
b.Property(q => q.Code).IsRequired().HasMaxLength(SfsPropertyConst.CodeLength).IsRequired(true); |
||||
|
b.Property(q => q.LocCode).IsRequired().HasMaxLength(SfsPropertyConst.CodeLength).IsRequired(true); |
||||
|
|
||||
|
|
||||
|
|
||||
|
//Relations
|
||||
|
//None
|
||||
|
|
||||
|
//Indexes
|
||||
|
b.HasIndex(q => new { q.Code ,q.LocCode}).IsUnique(); |
||||
|
}); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 器具编号
|
||||
|
/// </summary>
|
@ -0,0 +1,54 @@ |
|||||
|
using System; |
||||
|
using System.Threading.Tasks; |
||||
|
using Microsoft.EntityFrameworkCore; |
||||
|
using Volo.Abp.EntityFrameworkCore; |
||||
|
using Win_in.Sfs.Basedata.Domain; |
||||
|
using Win_in.Sfs.Shared.Domain; |
||||
|
|
||||
|
namespace Win_in.Sfs.Basedata.EntityFrameworkCore; |
||||
|
|
||||
|
public class EquipmentLocEfCoreRepository : SfsBaseDataEfCoreRepositoryBase<BasedataDbContext, EquipmentLoc>, IEquipmentLocRepository, ISfsBulkRepositoryBase<EquipmentLoc> |
||||
|
{ |
||||
|
public EquipmentLocEfCoreRepository(IDbContextProvider<BasedataDbContext> dbContextProvider) : base(dbContextProvider) |
||||
|
{ |
||||
|
} |
||||
|
public virtual async Task UpsertAsyncByInterface(EquipmentLoc entity) |
||||
|
{ |
||||
|
var dbSet = await GetDbSetAsync().ConfigureAwait(false); |
||||
|
var exist = await dbSet.FirstOrDefaultAsync(p => p.Code == entity.Code).ConfigureAwait(false); |
||||
|
if (exist == null) |
||||
|
{ |
||||
|
var insRet = await InsertAsync(entity).ConfigureAwait(false); |
||||
|
} |
||||
|
else |
||||
|
{ |
||||
|
exist.State = entity.State; |
||||
|
|
||||
|
exist.LastModificationTime = DateTimeOffset.Now.DateTime; |
||||
|
|
||||
|
} |
||||
|
} |
||||
|
public virtual async Task UpsertAsync(EquipmentLoc entity) |
||||
|
{ |
||||
|
var dbSet = await GetDbSetAsync().ConfigureAwait(false); |
||||
|
var exist = await dbSet.FirstOrDefaultAsync(p => p.Code == entity.Code).ConfigureAwait(false); |
||||
|
if (exist == null) |
||||
|
{ |
||||
|
var insRet = await InsertAsync(entity).ConfigureAwait(false); |
||||
|
} |
||||
|
else |
||||
|
{ |
||||
|
exist.State = entity.State; |
||||
|
|
||||
|
exist.LastModificationTime = DateTimeOffset.Now.DateTime; |
||||
|
|
||||
|
} |
||||
|
|
||||
|
|
||||
|
} |
||||
|
|
||||
|
public virtual async Task InsertAutoSaveAsync(EquipmentLoc entity) |
||||
|
{ |
||||
|
_ = await InsertAsync(entity, true, GetCancellationToken()).ConfigureAwait(false); |
||||
|
} |
||||
|
} |
@ -0,0 +1,40 @@ |
|||||
|
using Microsoft.EntityFrameworkCore; |
||||
|
using Volo.Abp.EntityFrameworkCore.Modeling; |
||||
|
using Win_in.Sfs.Basedata.Domain; |
||||
|
using Win_in.Sfs.Shared.Domain.Shared; |
||||
|
using Win_in.Sfs.Shared.EntityFrameworkCore; |
||||
|
|
||||
|
namespace Win_in.Sfs.Basedata.EntityFrameworkCore; |
||||
|
|
||||
|
public static class EquipmentPartCodeDbContextModelCreatingExtensions |
||||
|
{ |
||||
|
public static void ConfigureEquipmentPartCode(this ModelBuilder builder, BasedataModelBuilderConfigurationOptions options) |
||||
|
{ |
||||
|
builder.Entity<EquipmentPartCode>(b => |
||||
|
{ |
||||
|
//Configure table & schema name
|
||||
|
b.ToTable(options.TablePrefix + nameof(EquipmentPartCode), options.Schema); |
||||
|
//Configure ABP properties
|
||||
|
b.ConfigureByConvention(); |
||||
|
//Configure Sfs base properties
|
||||
|
b.ConfigureSfsBase(); |
||||
|
|
||||
|
//Properties
|
||||
|
b.Property(q => q.Code).IsRequired().HasMaxLength(SfsPropertyConst.CodeLength).IsRequired(true); |
||||
|
b.Property(q => q.PartCode).HasMaxLength(SfsPropertyConst.CodeLength).IsRequired(true); |
||||
|
|
||||
|
|
||||
|
|
||||
|
//Relations
|
||||
|
//None
|
||||
|
|
||||
|
//Indexes
|
||||
|
b.HasIndex(q => new { q.Code,q.PartCode }).IsUnique(); |
||||
|
}); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 器具编号
|
||||
|
/// </summary>
|
@ -0,0 +1,68 @@ |
|||||
|
using System; |
||||
|
using System.Threading.Tasks; |
||||
|
using Microsoft.EntityFrameworkCore; |
||||
|
using Volo.Abp.EntityFrameworkCore; |
||||
|
using Win_in.Sfs.Basedata.Domain; |
||||
|
using Win_in.Sfs.Shared.Domain; |
||||
|
|
||||
|
namespace Win_in.Sfs.Basedata.EntityFrameworkCore; |
||||
|
|
||||
|
public class EquipmentPartCodeEfCoreRepository : SfsBaseDataEfCoreRepositoryBase<BasedataDbContext, EquipmentPartCode>, IEquipmentPartCodeRepository, ISfsBulkRepositoryBase<EquipmentPartCode> |
||||
|
{ |
||||
|
public EquipmentPartCodeEfCoreRepository(IDbContextProvider<BasedataDbContext> dbContextProvider) : base(dbContextProvider) |
||||
|
{ |
||||
|
} |
||||
|
public virtual async Task UpsertAsyncByInterface(EquipmentPartCode entity) |
||||
|
{ |
||||
|
var dbSet = await GetDbSetAsync().ConfigureAwait(false); |
||||
|
var exist = await dbSet.FirstOrDefaultAsync(p => p.Code== entity.Code).ConfigureAwait(false); |
||||
|
if (exist == null) |
||||
|
{ |
||||
|
var insRet = await InsertAsync(entity).ConfigureAwait(false); |
||||
|
} |
||||
|
else |
||||
|
{ |
||||
|
exist.State = entity.State; |
||||
|
|
||||
|
exist.LastModificationTime = DateTimeOffset.Now.DateTime; |
||||
|
|
||||
|
} |
||||
|
} |
||||
|
public virtual async Task UpsertAsync(EquipmentPartCode entity) |
||||
|
{ |
||||
|
var dbSet = await GetDbSetAsync().ConfigureAwait(false); |
||||
|
var exist = await dbSet.FirstOrDefaultAsync(p => p.Code == entity.Code).ConfigureAwait(false); |
||||
|
if (exist == null) |
||||
|
{ |
||||
|
var insRet = await InsertAsync(entity).ConfigureAwait(false); |
||||
|
} |
||||
|
else |
||||
|
{ |
||||
|
exist.State = entity.State; |
||||
|
|
||||
|
exist.LastModificationTime = DateTimeOffset.Now.DateTime; |
||||
|
|
||||
|
} |
||||
|
|
||||
|
// var context = await GetDbContextAsync();
|
||||
|
// await context.SingleMergeAsync(entity, options =>
|
||||
|
// {
|
||||
|
// //业务主键,可以是联合主键
|
||||
|
// options.ColumnPrimaryKeyExpression = c => new
|
||||
|
// {
|
||||
|
// c.Code
|
||||
|
// };
|
||||
|
// //需要在更新时忽略的属性
|
||||
|
// options.IgnoreOnMergeUpdateExpression = c => new
|
||||
|
// {
|
||||
|
// c.Id,
|
||||
|
// c.ManageType,
|
||||
|
// };
|
||||
|
// });
|
||||
|
} |
||||
|
|
||||
|
public virtual async Task InsertAutoSaveAsync(EquipmentPartCode entity) |
||||
|
{ |
||||
|
_ = await InsertAsync(entity, true, GetCancellationToken()).ConfigureAwait(false); |
||||
|
} |
||||
|
} |
@ -0,0 +1,37 @@ |
|||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using System.ComponentModel.DataAnnotations; |
||||
|
using System.Linq; |
||||
|
using System.Text; |
||||
|
using System.Threading.Tasks; |
||||
|
|
||||
|
namespace Win_in.Sfs.Shared.Domain.Shared.Enums.Basedata; |
||||
|
public enum EnumEquipmentType |
||||
|
{ |
||||
|
[Display(Name = "小")] |
||||
|
Small =0, |
||||
|
[Display(Name = "大")] |
||||
|
Large =1, |
||||
|
[Display(Name = "超大")] |
||||
|
Oversized =2 |
||||
|
} |
||||
|
|
||||
|
public enum EnumEquipmentModel |
||||
|
{ |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 内部
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "内部")] |
||||
|
Internal = 0, |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 外部
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "外部")] |
||||
|
External = 1, |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
} |
@ -0,0 +1,13 @@ |
|||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using System.Linq; |
||||
|
using System.Text; |
||||
|
using System.Threading.Tasks; |
||||
|
|
||||
|
namespace Win_in.Sfs.Shared.Domain.Shared.Enums.Store.Statuses; |
||||
|
public enum EnumEquipmentRecordType |
||||
|
{ |
||||
|
Bind=0, |
||||
|
UnBind=1 |
||||
|
|
||||
|
} |
Loading…
Reference in new issue