@@ -25,10 +25,8 @@ | |||
</ItemGroup> | |||
<ItemGroup> | |||
<Folder Include="Services\DeviceService\" /> | |||
<Folder Include="Services\MaterialService\" /> | |||
<Folder Include="Services\RecipesService\" /> | |||
<Folder Include="Services\CustomCodeService\" /> | |||
<Folder Include="Services\SystemService\" /> | |||
</ItemGroup> | |||
@@ -7,7 +7,7 @@ | |||
/// 描 述 : | |||
/// </summary> | |||
[SugarTable("final_info")] | |||
public class Pztj_FinalsInfoEntity : DEntityBase | |||
public class FinalInfoEntity : DEntityBase | |||
{ | |||
/// <summary> | |||
/// 成品编号 |
@@ -7,7 +7,7 @@ | |||
/// 描 述 : | |||
/// </summary> | |||
[SugarTable("material_Info")] | |||
public class Pztj_MaterialsInfoEntity : DEntityBase | |||
public class MaterialInfoEntity : DEntityBase | |||
{ | |||
/// <summary> | |||
/// 原料名称 |
@@ -1,22 +0,0 @@ | |||
namespace BPA.MES.Base.Application.Entitys | |||
{ | |||
/// <summary> | |||
/// 名 称 :胖子天骄桶管理 | |||
/// 创 建 人 :yangxiao | |||
/// 创建时间 : 2023/7/14 11:33:10 | |||
/// 描 述 : | |||
/// </summary> | |||
[SugarTable("bucket_info")] | |||
public class Pztj_BucketInfoEntity : DEntityBase | |||
{ | |||
/// <summary> | |||
/// 桶名称 | |||
/// </summary> | |||
public string Name { get; set; } | |||
/// <summary> | |||
/// 桶编号 | |||
/// </summary> | |||
public string Code { get; set; } | |||
} | |||
} |
@@ -1,25 +0,0 @@ | |||
namespace BPA.MES.Base.Application.Entitys | |||
{ | |||
/// <summary> | |||
/// 名 称 :桶原料记录 | |||
/// 创 建 人 :yangxiao | |||
/// 创建时间 : 2023/7/14 11:47:33 | |||
/// 描 述 : | |||
/// </summary> | |||
[SugarTable("bucket_material_record")] | |||
public class Pztj_BucketMaterialsRecordEntity : DEntityBase | |||
{ | |||
/// <summary> | |||
/// 桶Id | |||
/// </summary> | |||
public string BucketId { get; set; } | |||
/// <summary> | |||
/// 物料Id | |||
/// </summary> | |||
public string MaterialId { get; set; } | |||
/// <summary> | |||
/// 添加时间 | |||
/// </summary> | |||
public DateTime? CreateTime { get; set; } | |||
} | |||
} |
@@ -1,41 +0,0 @@ | |||
namespace BPA.MES.Base.Application.Entitys | |||
{ | |||
/// <summary> | |||
/// 名 称 :工艺路线 | |||
/// 创 建 人 :yangxiao | |||
/// 创建时间 : 2023/7/17 17:01:26 | |||
/// 描 述 : | |||
/// </summary> | |||
[SugarTable("craft_Steps")] | |||
public class Pztj_CraftStepsEntity : DEntityBase | |||
{ | |||
/// <summary> | |||
/// 步骤Id | |||
/// </summary> | |||
public string CraftId { get; set; } | |||
/// <summary> | |||
/// 步骤 | |||
/// </summary> | |||
public string Step { get; set; } | |||
/// <summary> | |||
/// 名称 | |||
/// </summary> | |||
public string Name { get; set; } | |||
/// <summary> | |||
/// 单位 | |||
/// </summary> | |||
public string Unit { get; set; } | |||
/// <summary> | |||
/// 功能参数 | |||
/// </summary> | |||
public string Value { get; set; } | |||
/// <summary> | |||
/// 功能值 物料信息 | |||
/// </summary> | |||
public string Materials { get; set; } | |||
/// <summary> | |||
/// 功能描述 | |||
/// </summary> | |||
public string Describe { get; set; } | |||
} | |||
} |
@@ -1,25 +0,0 @@ | |||
namespace BPA.MES.Base.Application.Entitys | |||
{ | |||
/// <summary> | |||
/// 名 称 :胖子天骄工艺基础信息 | |||
/// 创 建 人 :yangxiao | |||
/// 创建时间 : 2023/7/14 14:43:37 | |||
/// 描 述 : | |||
/// </summary> | |||
[SugarTable("craft_info")] | |||
public class Pztj_CraftsInfoEntity : DEntityBase | |||
{ | |||
/// <summary> | |||
/// 工艺名称 | |||
/// </summary> | |||
public string Name { get; set; } | |||
/// <summary> | |||
/// 设备区分 | |||
/// </summary> | |||
public DeviceTypeEnum DeviceType { get; set; } | |||
/// <summary> | |||
/// 工艺描述 | |||
/// </summary> | |||
public string Description { get; set; } | |||
} | |||
} |
@@ -1,39 +0,0 @@ | |||
namespace BPA.MES.Base.Application.Entitys | |||
{ | |||
/// <summary> | |||
/// 名 称 :胖子天骄设备基础表 | |||
/// 创 建 人 :yangxiao | |||
/// 创建时间 : 2023/7/14 11:26:34 | |||
/// 描 述 : | |||
/// </summary> | |||
[SugarTable("device_info")] | |||
public class Pztj_DevicesInfoEntity: DEntityBase | |||
{ | |||
/// <summary> | |||
/// 名称 | |||
/// </summary> | |||
[Required(ErrorMessage = "名称不能为空")] | |||
public string Name { get; set; } | |||
/// <summary> | |||
/// 编码 | |||
/// </summary> | |||
[Required(ErrorMessage = "编码不能为空")] | |||
public string Code { get; set; } | |||
/// <summary> | |||
/// 设备类型 | |||
/// </summary> | |||
public string DeviceType { get; set; } | |||
/// <summary> | |||
/// 设备描述 | |||
/// </summary> | |||
public string Describe { get; set; } | |||
/// <summary> | |||
/// 设备维保时间 | |||
/// </summary> | |||
public string RepairDate { get; set; } | |||
/// <summary> | |||
/// 设备创建时间 | |||
/// </summary> | |||
public string CreateTime { get; set; } | |||
} | |||
} |
@@ -1,21 +0,0 @@ | |||
namespace BPA.MES.Base.Application.Entitys | |||
{ | |||
/// <summary> | |||
/// 名 称 :产线设备 | |||
/// 创 建 人 :yangxiao | |||
/// 创建时间 : 2023/7/20 16:45:05 | |||
/// 描 述 : | |||
/// </summary> | |||
[SugarTable("productline_devices")] | |||
public class Pztj_LineDevicesEntity : DEntityBase | |||
{ | |||
/// <summary> | |||
/// 产线Id | |||
/// </summary> | |||
public string LineId { get; set; } | |||
/// <summary> | |||
/// 产线设备 | |||
/// </summary> | |||
public string DeviceId { get; set; } | |||
} | |||
} |
@@ -1,21 +0,0 @@ | |||
namespace BPA.MES.Base.Application.Entitys | |||
{ | |||
/// <summary> | |||
/// 名 称 :产线料仓 | |||
/// 创 建 人 :yangxiao | |||
/// 创建时间 :2023/7/20 16:45:40 | |||
/// 描 述 : | |||
/// </summary> | |||
[SugarTable("productline_stocks")] | |||
public class Pztj_LineStocksEntity : DEntityBase | |||
{ | |||
/// <summary> | |||
/// 产线Id | |||
/// </summary> | |||
public string LineId { get; set; } | |||
/// <summary> | |||
/// 产线料仓 | |||
/// </summary> | |||
public string StockId { get; set; } | |||
} | |||
} |
@@ -1,30 +0,0 @@ | |||
namespace BPA.MES.Base.Application.Entitys | |||
{ | |||
/// <summary> | |||
/// 名 称 :胖子天骄料仓管理 | |||
/// 创 建 人 :yangxiao | |||
/// 创建时间 : 2023/7/14 11:31:34 | |||
/// 描 述 : | |||
/// </summary> | |||
[SugarTable("stock_info")] | |||
public class Pztj_StockInfoEntity : DEntityBase | |||
{ | |||
/// <summary> | |||
/// 料仓编码 | |||
/// </summary> | |||
public string Code { get; set; } | |||
/// <summary> | |||
/// 料仓名称 | |||
/// </summary> | |||
public string Name { get; set; } | |||
/// <summary> | |||
/// 物料Id | |||
/// </summary> | |||
public string MaterialId { get; set; } | |||
/// <summary> | |||
/// 料仓容积 | |||
/// </summary> | |||
public string Volume { get; set; } | |||
} | |||
} |
@@ -7,7 +7,7 @@ | |||
/// 描 述 : | |||
/// </summary> | |||
[SugarTable("work_info")] | |||
public class Pztj_WorkInfoEntity : DEntityBase | |||
public class WorkInfoEntity : DEntityBase | |||
{ | |||
/// <summary> | |||
/// 工单名称 |
@@ -7,7 +7,7 @@ | |||
/// 描 述 : | |||
/// </summary> | |||
[SugarTable("work_info_item")] | |||
public class Pztj_WorkInfoItemEntity : DEntityBase | |||
public class WorkInfoItemEntity : DEntityBase | |||
{ | |||
/// <summary> | |||
/// 工单名称 |
@@ -7,7 +7,7 @@ | |||
/// 描 述 : | |||
/// </summary> | |||
[SugarTable("work_info_status")] | |||
public class Pztj_WorkInfoStatusEntity : DEntityBase | |||
public class WorkInfoStatusEntity : DEntityBase | |||
{ | |||
/// <summary> | |||
/// 工单Id |
@@ -1,18 +0,0 @@ | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
using System.Text; | |||
using System.Threading.Tasks; | |||
namespace BPA.MES.Base.Application.Entitys.Base | |||
{ | |||
/// <summary> | |||
/// 名 称 : | |||
/// 创 建 人 :yangxiao | |||
/// 创建时间 : 2023/7/31 15:06:00 | |||
/// 描 述 : | |||
/// </summary> | |||
public class DeviceParmEntity | |||
{ | |||
} | |||
} |
@@ -1,22 +0,0 @@ | |||
namespace BPA.MES.Base.Application.Entitys | |||
{ | |||
/// <summary> | |||
/// 名 称 :设备配方表 | |||
/// 创 建 人 :yangxiao | |||
/// 创建时间 :2023/3/2 13:57:00 | |||
/// 描 述 : | |||
/// </summary> | |||
[SugarTable("devices_recipes")] | |||
public class DeviceRecipeEntity : DEntityBase | |||
{ | |||
/// <summary> | |||
/// 设备Id | |||
/// </summary> | |||
public string DeviceId { get; set; } | |||
/// <summary> | |||
/// 配方Id | |||
/// </summary> | |||
public string RecipesId { get; set; } | |||
} | |||
} |
@@ -1,21 +0,0 @@ | |||
namespace BPA.MES.Base.Application.Entitys | |||
{ | |||
/// <summary> | |||
/// 名 称 :分组信息 | |||
/// 创 建 人 :yangxiao | |||
/// 创建时间 : 2023/3/10 14:01:15 | |||
/// 描 述 : | |||
/// </summary> | |||
[SugarTable("group_info")] | |||
public class GroupInfoEntity: DEntityBase | |||
{ | |||
/// <summary> | |||
/// 名称 | |||
/// </summary> | |||
public string Name { get; set; } | |||
/// <summary> | |||
/// 介绍 | |||
/// </summary> | |||
public string Des { get; set; } | |||
} | |||
} |
@@ -1,31 +0,0 @@ | |||
namespace BPA.MES.Base.Application.Entitys | |||
{ | |||
/// <summary> | |||
/// 名 称 :物料 | |||
/// 创 建 人 :yangxiao | |||
/// 创建时间 :2023/3/2 13:52:00 | |||
/// 描 述 : | |||
/// </summary> | |||
[SugarTable("materials_info")] | |||
public class MaterialsInfoEntity: DEntityBase | |||
{ | |||
/// <summary> | |||
/// 名称 | |||
/// </summary> | |||
[Required(ErrorMessage = "名称不能为空")] | |||
public string Name { get; set; } | |||
/// <summary> | |||
/// 编码 | |||
/// </summary> | |||
[Required(ErrorMessage = "编码不能为空")] | |||
public string Code { get; set; } | |||
/// <summary> | |||
/// 单位 | |||
/// </summary> | |||
public string Unit { get; set; } | |||
/// <summary> | |||
/// 每秒出水量(g) | |||
/// </summary> | |||
public string Wos { get; set; } | |||
} | |||
} |
@@ -24,6 +24,7 @@ | |||
/// <summary> | |||
/// 描述 | |||
/// </summary> | |||
[SugarColumn(IsIgnore = true)] | |||
public string Describe { get; set; } | |||
} | |||
} |
@@ -1,21 +0,0 @@ | |||
namespace BPA.MES.Base.Application.Entitys | |||
{ | |||
/// <summary> | |||
/// 名 称 :配方分组 | |||
/// 创 建 人 :yangxiao | |||
/// 创建时间 : 2023/3/10 14:56:03 | |||
/// 描 述 : | |||
/// </summary> | |||
[SugarTable("recipes_group")] | |||
public class RecipesGroupEntity | |||
{ | |||
/// <summary> | |||
/// 组Id | |||
/// </summary> | |||
public string GroupId { get; set; } | |||
/// <summary> | |||
/// 产品Id | |||
/// </summary> | |||
public string RecipesId { get; set; } | |||
} | |||
} |
@@ -1,30 +0,0 @@ | |||
namespace BPA.MES.Base.Application.Entitys | |||
{ | |||
/// <summary> | |||
/// 名 称 :店铺信息 | |||
/// 创 建 人 :yangxiao | |||
/// 创建时间 : 2023/3/2 13:52:13 | |||
/// 描 述 : | |||
/// </summary> | |||
[SugarTable("store_info")] | |||
public class StoreInfoEntity : DEntityBase | |||
{ | |||
/// <summary> | |||
/// 名称 | |||
/// </summary> | |||
[Required(ErrorMessage = "名称不能为空")] | |||
public string Name { get; set; } | |||
/// <summary> | |||
/// 地址 | |||
/// </summary> | |||
public string Address { get; set; } | |||
/// <summary> | |||
/// 联系电话 | |||
/// </summary> | |||
public string Phone { get; set; } | |||
/// <summary> | |||
/// 负责人 | |||
/// </summary> | |||
public string Directors { get; set; } | |||
} | |||
} |
@@ -1,23 +1,25 @@ | |||
namespace BPA.MES.Base.Application.Entitys | |||
{ | |||
/// <summary> | |||
/// 名 称 :设备 | |||
/// 名 称 : | |||
/// 创 建 人 :yangxiao | |||
/// 创建时间 :2023/3/2 13:51:45 | |||
/// 创建时间 : 2023/7/31 18:23:50 | |||
/// 描 述 : | |||
/// </summary> | |||
[SugarTable("devices_info")] | |||
public class DevicesInfoEntity: DEntityBase | |||
[SugarTable("template")] | |||
public class TemplateEntity : DEntityBase | |||
{ | |||
/// <summary> | |||
/// 名称 | |||
/// </summary> | |||
[Required(ErrorMessage = "名称不能为空")] | |||
public string Name { get; set; } | |||
/// <summary> | |||
/// 编码 | |||
/// </summary> | |||
[Required(ErrorMessage = "编码不能为空")] | |||
public string Code { get; set; } | |||
/// <summary> | |||
/// 描述 | |||
/// </summary> | |||
public string Des { get; set; } | |||
} | |||
} |
@@ -1,75 +0,0 @@ | |||
namespace BPA.MES.Base.Application.Services | |||
{ | |||
/// <summary> | |||
/// 名 称 : | |||
/// 创 建 人 :yangxiao | |||
/// 创建时间 : 2023/7/17 15:43:00 | |||
/// 描 述 : | |||
/// </summary> | |||
public class BucketInfoDto | |||
{ | |||
/// <summary> | |||
/// 桶名称 | |||
/// </summary> | |||
public string Name { get; set; } | |||
/// <summary> | |||
/// 桶编号 | |||
/// </summary> | |||
public string Code { get; set; } | |||
} | |||
/// <summary> | |||
/// 增加 | |||
/// </summary> | |||
public class BucketInfoAddInput : BucketInfoDto | |||
{ | |||
} | |||
/// <summary> | |||
/// 更新 | |||
/// </summary> | |||
public class BucketInfoUpdateInput : BucketInfoDto | |||
{ | |||
/// <summary> | |||
/// 主键 | |||
/// </summary> | |||
public string Id { get; set; } | |||
} | |||
/// <summary> | |||
/// 删除 | |||
/// </summary> | |||
public class BucketInfoDelInput | |||
{ | |||
/// <summary> | |||
/// 主键 | |||
/// </summary> | |||
public string Id { get; set; } | |||
} | |||
/// <summary> | |||
/// 分页 | |||
/// </summary> | |||
public class BucketInfoQueryPageInput : RequestPage | |||
{ | |||
/// <summary> | |||
/// 名称 | |||
/// </summary> | |||
public string Name { get; set; } | |||
/// <summary> | |||
/// 编码 | |||
/// </summary> | |||
public string Code { get; set; } | |||
} | |||
/// <summary> | |||
/// 输出 | |||
/// </summary> | |||
public class BucketInfoOutput : BucketInfoDto | |||
{ | |||
/// <summary> | |||
/// 主键 | |||
/// </summary> | |||
public string Id { get; set; } | |||
/// <summary> | |||
/// 当前原料名称 | |||
/// </summary> | |||
public string MaterialName { get; set; } | |||
} | |||
} |
@@ -1,85 +0,0 @@ | |||
namespace BPA.MES.Base.Application.Services | |||
{ | |||
/// <summary> | |||
/// 名 称 : | |||
/// 创 建 人 :yangxiao | |||
/// 创建时间 : 2023/7/17 17:29:52 | |||
/// 描 述 : | |||
/// </summary> | |||
public class BucketMaterialsRecordDto | |||
{ | |||
/// <summary> | |||
/// 桶Id | |||
/// </summary> | |||
public string BucketId { get; set; } | |||
/// <summary> | |||
/// 物料Id | |||
/// </summary> | |||
public string MaterialId { get; set; } | |||
/// <summary> | |||
/// 添加时间 | |||
/// </summary> | |||
public DateTime? CreateTime { get; set; } | |||
} | |||
public class BucketMaterialsRecordAddInput : BucketMaterialsRecordDto | |||
{ | |||
} | |||
/// <summary> | |||
/// 更新 | |||
/// </summary> | |||
public class BucketMaterialsRecordUpdateInput : BucketMaterialsRecordDto | |||
{ | |||
/// <summary> | |||
/// 主键 | |||
/// </summary> | |||
public string Id { get; set; } | |||
} | |||
/// <summary> | |||
/// 删除 | |||
/// </summary> | |||
public class BucketMaterialsRecordDelInput | |||
{ | |||
/// <summary> | |||
/// 主键 | |||
/// </summary> | |||
public string Id { get; set; } | |||
} | |||
/// <summary> | |||
/// 分页 | |||
/// </summary> | |||
public class BucketMaterialsRecordQueryPageInput : RequestPage | |||
{ | |||
/// <summary> | |||
/// 名称 | |||
/// </summary> | |||
public string Name { get; set; } | |||
/// <summary> | |||
/// 编码 | |||
/// </summary> | |||
public string Code { get; set; } | |||
/// <summary> | |||
/// 桶Id | |||
/// </summary> | |||
public string BucketId { get; set; } | |||
} | |||
/// <summary> | |||
/// 输出 | |||
/// </summary> | |||
public class BucketMaterialsRecordOutput : BucketMaterialsRecordDto | |||
{ | |||
/// <summary> | |||
/// 主键 | |||
/// </summary> | |||
public string Id { get; set; } | |||
/// <summary> | |||
/// 原料名称 | |||
/// </summary> | |||
public string MaterialName { get; set; } | |||
/// <summary> | |||
/// 桶名称 | |||
/// </summary> | |||
public string BucketName { get; set; } | |||
} | |||
} |
@@ -1,147 +0,0 @@ | |||
namespace BPA.MES.Base.Application.Services | |||
{ | |||
/// <summary> | |||
/// 名 称 :桶服务 | |||
/// 创 建 人 :yangxiao | |||
/// 创建时间 :2023/3/2 16:11:04 | |||
/// 描 述 :基础数据管理 | |||
/// </summary> | |||
[ApiDescriptionSettings("基础数据管理", Order = 3, Tag = "桶服务", Name = "BucketInfo", KeepName = true, SplitCamelCase = true, KeepVerb = true)] | |||
public class BucketInfoService : IBucketInfoService, ITransient, IDynamicApiController | |||
{ | |||
private readonly ISqlSugarClient _dbContext; | |||
public BucketInfoService(ISqlSugarClient db) | |||
{ | |||
_dbContext = db; | |||
} | |||
/// <summary> | |||
/// 增加 | |||
/// </summary> | |||
/// <param name="input"></param> | |||
/// <returns></returns> | |||
[HttpPost] | |||
public async Task<bool> Add(BucketInfoAddInput input) | |||
{ | |||
var r_entity = await _dbContext.Queryable<Pztj_BucketInfoEntity>().FirstAsync(x => x.Name == input.Name || x.Code == input.Code); | |||
if (r_entity != null) | |||
{ | |||
throw Oops.Bah("名称已存在!"); | |||
} | |||
Pztj_BucketInfoEntity entity = input.Adapt<Pztj_BucketInfoEntity>(); | |||
return await _dbContext.Insertable(entity).IgnoreColumns(ignoreNullColumn: true).ExecuteCommandIdentityIntoEntityAsync(); | |||
} | |||
/// <summary> | |||
/// 删除 | |||
/// </summary> | |||
/// <param name="input"></param> | |||
/// <returns></returns> | |||
/// <exception cref="NotImplementedException"></exception> | |||
[HttpPost] | |||
public async Task<bool> Del(BucketInfoDelInput input) | |||
{ | |||
var res = await _dbContext.Deleteable<Pztj_BucketInfoEntity>().Where(x => x.Id == input.Id).ExecuteCommandHasChangeAsync(); | |||
return res; | |||
} | |||
/// <summary> | |||
/// 详情 | |||
/// </summary> | |||
/// <param name="Id"></param> | |||
/// <returns></returns> | |||
/// <exception cref="NotImplementedException"></exception> | |||
[HttpGet] | |||
public async Task<BucketInfoOutput> Detail(string Id) | |||
{ | |||
var entity = await _dbContext.Queryable<Pztj_BucketInfoEntity>().FirstAsync(x => x.Id == Id); | |||
BucketInfoOutput output = entity.Adapt<BucketInfoOutput>(); | |||
return output; | |||
} | |||
/// <summary> | |||
/// 列表 | |||
/// </summary> | |||
/// <returns></returns> | |||
/// <exception cref="NotImplementedException"></exception> | |||
[HttpGet] | |||
public async Task<List<BucketInfoOutput>> List() | |||
{ | |||
var entity = await _dbContext.Queryable<Pztj_BucketInfoEntity>().ToListAsync(); | |||
List<BucketInfoOutput> output = entity.Adapt<List<BucketInfoOutput>>(); | |||
return output; | |||
} | |||
/// <summary> | |||
/// 分页 | |||
/// </summary> | |||
/// <param name="input"></param> | |||
/// <returns></returns> | |||
[HttpPost] | |||
public async Task<SqlSugarPagedList<BucketInfoOutput>> PagedList(BucketInfoQueryPageInput input) | |||
{ | |||
var entity = await _dbContext.Queryable<Pztj_BucketInfoEntity>() | |||
.LeftJoin<Pztj_BucketMaterialsRecordEntity>((a,b)=>a.Id==b.BucketId && b.Id == SqlFunc.Subqueryable<Pztj_BucketMaterialsRecordEntity>().Where(s => s.BucketId == a.Id).OrderByDesc(s => s.CreateTime).Select(s => s.Id)) | |||
.LeftJoin<Pztj_MaterialsInfoEntity>((a,b,c)=>b.MaterialId==c.Id) | |||
.Select((a,b,c)=>new BucketInfoOutput | |||
{ | |||
Id = a.Id.SelectAll(), | |||
MaterialName = c.Name | |||
}) | |||
.ToPagedListAsync(input.PageIndex, input.PageSize); | |||
SqlSugarPagedList<BucketInfoOutput> output = entity.Adapt<SqlSugarPagedList<BucketInfoOutput>>(); | |||
return output; | |||
} | |||
/// <summary> | |||
/// 下拉 | |||
/// </summary> | |||
/// <returns></returns> | |||
/// <exception cref="NotImplementedException"></exception> | |||
[HttpGet] | |||
public async Task<dynamic> SelectList() | |||
{ | |||
var entity = await _dbContext.Queryable<Pztj_BucketInfoEntity>().Select(x => new | |||
{ | |||
key = x.Id, | |||
value = x.Name | |||
}).ToListAsync(); | |||
return entity; | |||
} | |||
/// <summary> | |||
/// 更新 | |||
/// </summary> | |||
/// <param name="input"></param> | |||
/// <returns></returns> | |||
/// <exception cref="NotImplementedException"></exception> | |||
[HttpPost] | |||
public async Task<bool> Update(BucketInfoUpdateInput input) | |||
{ | |||
var isExit =await _dbContext.Queryable<Pztj_BucketInfoEntity>().Where(x => x.Id != input.Id && (x.Name == input.Name || x.Code == input.Code)).FirstAsync(); | |||
if (isExit != null) | |||
{ | |||
throw Oops.Bah("名称或编码已存在!"); | |||
} | |||
Pztj_BucketInfoEntity entity = input.Adapt<Pztj_BucketInfoEntity>(); | |||
var res = await _dbContext.Updateable(entity).IgnoreColumns(true).ExecuteCommandHasChangeAsync(); | |||
return res; | |||
} | |||
///// <summary> | |||
///// 根据桶Id查询记录 | |||
///// </summary> | |||
///// <param name="bucketId"></param> | |||
///// <returns></returns> | |||
//public async Task<BucketMaterialsRecordOutput> RecordList(string bucketId) | |||
//{ | |||
// var entity = await _dbContext.Queryable<Pztj_BucketMaterialsRecordEntity>() | |||
// .LeftJoin<Pztj_MaterialsInfoEntity>((a, b) => a.MaterialId == b.Id) | |||
// .Select((a, b) => new BucketMaterialsRecordOutput | |||
// { | |||
// Id = a.Id.SelectAll(), | |||
// MaterialName = b.Name | |||
// }) | |||
// .ToListAsync(); | |||
// SqlSugarPagedList<BucketMaterialsRecordOutput> output = entity.Adapt<SqlSugarPagedList<BucketMaterialsRecordOutput>>(); | |||
// return output; | |||
//} | |||
} | |||
} | |||
@@ -1,103 +0,0 @@ | |||
namespace BPA.MES.Base.Application.Services | |||
{ | |||
/// <summary> | |||
/// 名 称 :桶记录 | |||
/// 创 建 人 :yangxiao | |||
/// 创建时间 :2023/3/2 16:11:04 | |||
/// 描 述 :基础数据管理 | |||
/// </summary> | |||
[ApiDescriptionSettings("基础数据管理", Order = 3, Tag = "桶服务", Name = "BucketMaterialsRecord", KeepName = true, SplitCamelCase = true, KeepVerb = true)] | |||
public class BucketMaterialsRecordServcie : IBucketMaterialsRecordService, ITransient, IDynamicApiController | |||
{ | |||
private readonly ISqlSugarClient _dbContext; | |||
public BucketMaterialsRecordServcie(ISqlSugarClient db) | |||
{ | |||
_dbContext = db; | |||
} | |||
/// <summary> | |||
/// 增加 | |||
/// </summary> | |||
/// <param name="input"></param> | |||
/// <returns></returns> | |||
[HttpPost] | |||
public async Task<bool> Add(BucketMaterialsRecordAddInput input) | |||
{ | |||
Pztj_BucketMaterialsRecordEntity entity = input.Adapt<Pztj_BucketMaterialsRecordEntity>(); | |||
return await _dbContext.Insertable(entity).IgnoreColumns(ignoreNullColumn: true).ExecuteCommandIdentityIntoEntityAsync(); | |||
} | |||
/// <summary> | |||
/// 删除 | |||
/// </summary> | |||
/// <param name="input"></param> | |||
/// <returns></returns> | |||
/// <exception cref="NotImplementedException"></exception> | |||
[HttpPost] | |||
public async Task<bool> Del(BucketMaterialsRecordDelInput input) | |||
{ | |||
var res = await _dbContext.Deleteable<Pztj_BucketMaterialsRecordEntity>().Where(x => x.Id == input.Id).ExecuteCommandHasChangeAsync(); | |||
return res; | |||
} | |||
/// <summary> | |||
/// 详情 | |||
/// </summary> | |||
/// <param name="Id"></param> | |||
/// <returns></returns> | |||
/// <exception cref="NotImplementedException"></exception> | |||
[HttpGet] | |||
public async Task<BucketMaterialsRecordOutput> Detail(string Id) | |||
{ | |||
var entity = await _dbContext.Queryable<Pztj_BucketMaterialsRecordEntity>().FirstAsync(x => x.Id == Id); | |||
BucketMaterialsRecordOutput output = entity.Adapt<BucketMaterialsRecordOutput>(); | |||
return output; | |||
} | |||
/// <summary> | |||
/// 列表 | |||
/// </summary> | |||
/// <returns></returns> | |||
/// <exception cref="NotImplementedException"></exception> | |||
[HttpGet] | |||
public async Task<List<BucketMaterialsRecordOutput>> List() | |||
{ | |||
var entity = await _dbContext.Queryable<Pztj_BucketMaterialsRecordEntity>().ToListAsync(); | |||
List<BucketMaterialsRecordOutput> output = entity.Adapt<List<BucketMaterialsRecordOutput>>(); | |||
return output; | |||
} | |||
/// <summary> | |||
/// 分页 | |||
/// </summary> | |||
/// <param name="input"></param> | |||
/// <returns></returns> | |||
[HttpPost] | |||
public async Task<SqlSugarPagedList<BucketMaterialsRecordOutput>> PagedList(BucketMaterialsRecordQueryPageInput input) | |||
{ | |||
var entity = await _dbContext.Queryable<Pztj_BucketMaterialsRecordEntity>() | |||
.LeftJoin<Pztj_BucketInfoEntity>((a,b)=>a.BucketId==b.Id) | |||
.LeftJoin<Pztj_MaterialsInfoEntity>((a,b,c)=>a.MaterialId==c.Id) | |||
.WhereIF(!string.IsNullOrEmpty(input.BucketId),(a,b,c)=>a.BucketId==input.BucketId) | |||
.OrderByDescending((a,b,c)=>a.CreateTime) | |||
.Select((a,b,c)=>new BucketMaterialsRecordOutput | |||
{ | |||
Id = a.Id.SelectAll(), | |||
MaterialName = c.Name, | |||
BucketName = b.Name | |||
}) | |||
.ToPagedListAsync(input.PageIndex, input.PageSize); | |||
SqlSugarPagedList<BucketMaterialsRecordOutput> output = entity.Adapt<SqlSugarPagedList<BucketMaterialsRecordOutput>>(); | |||
return output; | |||
} | |||
/// <summary> | |||
/// 更新 | |||
/// </summary> | |||
/// <param name="input"></param> | |||
/// <returns></returns> | |||
/// <exception cref="NotImplementedException"></exception> | |||
[HttpPost] | |||
public async Task<bool> Update(BucketMaterialsRecordUpdateInput input) | |||
{ | |||
Pztj_BucketMaterialsRecordEntity entity = input.Adapt<Pztj_BucketMaterialsRecordEntity>(); | |||
var res = await _dbContext.Updateable(entity).IgnoreColumns(true).ExecuteCommandHasChangeAsync(); | |||
return res; | |||
} | |||
} | |||
} |
@@ -1,43 +0,0 @@ | |||
namespace BPA.MES.Base.Application.Services | |||
{ | |||
/// <summary> | |||
/// 名 称 :桶记录 | |||
/// 创 建 人 :yangxiao | |||
/// 创建时间 : 2023/7/17 17:37:03 | |||
/// 描 述 : | |||
/// </summary> | |||
public interface IBucketMaterialsRecordService | |||
{ | |||
/// <summary> | |||
/// 增加 | |||
/// </summary> | |||
/// <returns></returns> | |||
Task<bool> Add(BucketMaterialsRecordAddInput input); | |||
/// <summary> | |||
/// 移除 | |||
/// </summary> | |||
/// <returns></returns> | |||
Task<bool> Del(BucketMaterialsRecordDelInput input); | |||
/// <summary> | |||
/// 更新 | |||
/// </summary> | |||
/// <returns></returns> | |||
Task<bool> Update(BucketMaterialsRecordUpdateInput input); | |||
/// <summary> | |||
/// 不分页列表 | |||
/// </summary> | |||
/// <returns></returns> | |||
Task<List<BucketMaterialsRecordOutput>> List(); | |||
/// <summary> | |||
/// 分页列表 | |||
/// </summary> | |||
/// <returns></returns> | |||
Task<SqlSugarPagedList<BucketMaterialsRecordOutput>> PagedList(BucketMaterialsRecordQueryPageInput input); | |||
/// <summary> | |||
/// 查询单条 | |||
/// </summary> | |||
/// <param name="Id"></param> | |||
/// <returns></returns> | |||
Task<BucketMaterialsRecordOutput> Detail(string Id); | |||
} | |||
} |
@@ -1,86 +0,0 @@ | |||
namespace BPA.MES.Base.Application.Services | |||
{ | |||
/// <summary> | |||
/// 名 称 :产品分组 | |||
/// 创 建 人 :yangxiao | |||
/// 创建时间 : 2023/3/10 13:59:43 | |||
/// 描 述 : | |||
/// </summary> | |||
public class CraftsInfoDto | |||
{ | |||
/// <summary> | |||
/// 工艺名称 | |||
/// </summary> | |||
[Required(ErrorMessage = "设备类型不能为空")] | |||
public string Name { get; set; } | |||
/// <summary> | |||
/// 设备类型 0:炒锅 1:反应釜 | |||
/// </summary> | |||
[Required(ErrorMessage = "设备类型不能为空")] | |||
public string DeviceType { get; set; } | |||
/// <summary> | |||
/// 工艺描述 | |||
/// </summary> | |||
public string Description { get; set; } | |||
} | |||
/// <summary> | |||
/// 增加 | |||
/// </summary> | |||
public class CraftsInfoAddInput : CraftsInfoDto | |||
{ | |||
} | |||
/// <summary> | |||
/// 更新 | |||
/// </summary> | |||
public class CraftsInfoUpdateInput : CraftsInfoDto | |||
{ | |||
/// <summary> | |||
/// 主键 | |||
/// </summary> | |||
public string Id { get; set; } | |||
} | |||
/// <summary> | |||
/// 删除 | |||
/// </summary> | |||
public class CraftsInfoDelInput | |||
{ | |||
/// <summary> | |||
/// 主键 | |||
/// </summary> | |||
public string Id { get; set; } | |||
} | |||
/// <summary> | |||
/// 分页 | |||
/// </summary> | |||
public class CraftsInfoQueryPageInput : RequestPage | |||
{ | |||
/// <summary> | |||
/// 名称 | |||
/// </summary> | |||
public string Name { get; set; } | |||
/// <summary> | |||
/// 设备类型 0:炒锅 1:反应釜 | |||
/// </summary> | |||
[Required(ErrorMessage = "设备类型不能为空")] | |||
public DeviceTypeEnum DeviceType { get; set; } | |||
} | |||
/// <summary> | |||
/// 不分页 | |||
/// </summary> | |||
public class CraftsInfoQueryInput | |||
{ | |||
} | |||
/// <summary> | |||
/// 输出 | |||
/// </summary> | |||
public class CraftsInfoOutput : CraftsInfoDto | |||
{ | |||
/// <summary> | |||
/// 主键 | |||
/// </summary> | |||
/// <example></example> | |||
public string Id { get; set; } | |||
} | |||
} |
@@ -1,95 +0,0 @@ | |||
namespace BPA.MES.Base.Application.Services | |||
{ | |||
/// <summary> | |||
/// 名 称 :产线管理 | |||
/// 创 建 人 :yangxiao | |||
/// 创建时间 : 2023/7/18 14:03:27 | |||
/// 描 述 : | |||
/// </summary> | |||
public class CraftsStepsDto | |||
{ | |||
/// <summary> | |||
/// 步骤Id | |||
/// </summary> | |||
public string CraftId { get; set; } | |||
/// <summary> | |||
/// 步骤 | |||
/// </summary> | |||
public string Step { get; set; } | |||
/// <summary> | |||
/// 名称 | |||
/// </summary> | |||
public string Name { get; set; } | |||
/// <summary> | |||
/// 单位 | |||
/// </summary> | |||
public string Unit { get; set; } | |||
/// <summary> | |||
/// 功能参数 | |||
/// </summary> | |||
public string Value { get; set; } | |||
/// <summary> | |||
/// 功能值 物料信息 | |||
/// </summary> | |||
public string Materials { get; set; } | |||
/// <summary> | |||
/// 功能描述 | |||
/// </summary> | |||
public string Describe { get; set; } | |||
} | |||
/// <summary> | |||
/// 增加 | |||
/// </summary> | |||
public class CraftsStepsAddInput : CraftsStepsDto | |||
{ | |||
} | |||
/// <summary> | |||
/// 更新 | |||
/// </summary> | |||
public class CraftsStepsUpdateInput : CraftsStepsDto | |||
{ | |||
/// <summary> | |||
/// 主键 | |||
/// </summary> | |||
public string Id { get; set; } | |||
} | |||
/// <summary> | |||
/// 删除 | |||
/// </summary> | |||
public class CraftsStepsDelInput | |||
{ | |||
/// <summary> | |||
/// 主键 | |||
/// </summary> | |||
public string Id { get; set; } | |||
} | |||
/// <summary> | |||
/// 分页 | |||
/// </summary> | |||
public class CraftsStepsQueryPageInput : RequestPage | |||
{ | |||
/// <summary> | |||
/// 名称 | |||
/// </summary> | |||
public string Name { get; set; } | |||
/// <summary> | |||
/// 编码 | |||
/// </summary> | |||
public string Code { get; set; } | |||
/// <summary> | |||
/// 工艺Id | |||
/// </summary> | |||
public string CraftId { get; set; } | |||
} | |||
/// <summary> | |||
/// 输出 | |||
/// </summary> | |||
public class CraftsStepsOutput : CraftsStepsDto | |||
{ | |||
/// <summary> | |||
/// 主键 | |||
/// </summary> | |||
public string Id { get; set; } | |||
} | |||
} |
@@ -1,118 +0,0 @@ | |||
namespace BPA.MES.Base.Application.Services | |||
{ | |||
/// <summary> | |||
/// 名 称 :工艺信息 | |||
/// 创 建 人 :yangxiao | |||
/// 创建时间 :2023/3/10 14:03:06 | |||
/// 描 述 :配方工艺管理 | |||
/// </summary> | |||
[ApiDescriptionSettings("配方工艺管理", Order = 0, Tag = "工艺服务", Name = "CraftsInfo", KeepName = true, SplitCamelCase = true, KeepVerb = true)] | |||
public class CraftsInfoService : ICraftsInfoService, ITransient, IDynamicApiController | |||
{ | |||
private readonly ISqlSugarClient _dbContext; | |||
public CraftsInfoService(ISqlSugarClient db) | |||
{ | |||
_dbContext = db; | |||
} | |||
/// <summary> | |||
/// 增加 | |||
/// </summary> | |||
/// <param name="input"></param> | |||
/// <returns></returns> | |||
[HttpPost] | |||
public async Task<bool> Add(CraftsInfoAddInput input) | |||
{ | |||
Pztj_CraftsInfoEntity entity = await _dbContext.Queryable<Pztj_CraftsInfoEntity>().FirstAsync(x => x.Name ==input.Name); | |||
if (entity != null) | |||
{ | |||
throw Oops.Bah("名称已存在!"); | |||
} | |||
entity = input.Adapt<Pztj_CraftsInfoEntity>(); | |||
return await _dbContext.Insertable(entity).IgnoreColumns(ignoreNullColumn: true).ExecuteCommandIdentityIntoEntityAsync(); | |||
} | |||
/// <summary> | |||
/// 删除 | |||
/// </summary> | |||
/// <param name="input"></param> | |||
/// <returns></returns> | |||
/// <exception cref="NotImplementedException"></exception> | |||
[HttpPost] | |||
public async Task<bool> Del(CraftsInfoDelInput input) | |||
{ | |||
var res = await _dbContext.Deleteable<Pztj_CraftsInfoEntity>().Where(x=>x.Id==input.Id).ExecuteCommandHasChangeAsync(); | |||
return res; | |||
} | |||
/// <summary> | |||
/// 详情 | |||
/// </summary> | |||
/// <param name="Id"></param> | |||
/// <returns></returns> | |||
/// <exception cref="NotImplementedException"></exception> | |||
[HttpGet] | |||
public async Task<CraftsInfoOutput> Detail(string Id) | |||
{ | |||
var entity = await _dbContext.Queryable<Pztj_CraftsInfoEntity>().FirstAsync(); | |||
CraftsInfoOutput output = entity.Adapt<CraftsInfoOutput>(); | |||
return output; | |||
} | |||
/// <summary> | |||
/// 列表 | |||
/// </summary> | |||
/// <returns></returns> | |||
/// <exception cref="NotImplementedException"></exception> | |||
[HttpPost, AllowAnonymous] | |||
public async Task<List<CraftsInfoOutput>> List(CraftsInfoQueryInput input) | |||
{ | |||
var entity = await _dbContext.Queryable<Pztj_CraftsInfoEntity>().ToListAsync(); | |||
List<CraftsInfoOutput> output = entity.Adapt<List<CraftsInfoOutput>>(); | |||
return output; | |||
} | |||
/// <summary> | |||
/// 分页 | |||
/// </summary> | |||
/// <param name="input"></param> | |||
/// <returns></returns> | |||
[HttpPost] | |||
public async Task<SqlSugarPagedList<CraftsInfoOutput>> PagedList(CraftsInfoQueryPageInput input) | |||
{ | |||
var entity = await _dbContext.Queryable<Pztj_CraftsInfoEntity>() | |||
.Where(x=>x.DeviceType == input.DeviceType) | |||
.WhereIF(!string.IsNullOrEmpty(input.Name),x=>x.Name.Contains(input.Name)) | |||
.ToPagedListAsync(input.PageIndex, input.PageSize); | |||
SqlSugarPagedList<CraftsInfoOutput> output = entity.Adapt<SqlSugarPagedList<CraftsInfoOutput>>(); | |||
return output; | |||
} | |||
/// <summary> | |||
/// 下拉 | |||
/// </summary> | |||
/// <returns></returns> | |||
[HttpGet] | |||
public async Task<dynamic> SelectList() | |||
{ | |||
var entity = await _dbContext.Queryable<Pztj_CraftsInfoEntity>().Select(x => new | |||
{ | |||
key = x.Id, | |||
value = x.Name | |||
}).ToListAsync(); | |||
return entity; | |||
} | |||
/// <summary> | |||
/// 更新 | |||
/// </summary> | |||
/// <param name="input"></param> | |||
/// <returns></returns> | |||
/// <exception cref="NotImplementedException"></exception> | |||
[HttpPost] | |||
public async Task<bool> Update(CraftsInfoUpdateInput input) | |||
{ | |||
var entity = await _dbContext.Queryable<Pztj_CraftsInfoEntity>().FirstAsync(x => x.Id != input.Id && x.Name == input.Name); | |||
if (entity != null) | |||
{ | |||
throw Oops.Bah("名称已存在!"); | |||
} | |||
entity = input.Adapt<Pztj_CraftsInfoEntity>(); | |||
var res = await _dbContext.Updateable(entity).IgnoreColumns(true).ExecuteCommandHasChangeAsync(); | |||
return res; | |||
} | |||
} | |||
} |
@@ -1,48 +0,0 @@ | |||
namespace BPA.MES.Base.Application.Services | |||
{ | |||
/// <summary> | |||
/// 名 称 :工艺信息 | |||
/// 创 建 人 :yangxiao | |||
/// 创建时间 :2023/3/10 14:03:21 | |||
/// 描 述 : | |||
/// </summary> | |||
public interface ICraftsInfoService | |||
{ | |||
/// <summary> | |||
/// 增加 | |||
/// </summary> | |||
/// <returns></returns> | |||
Task<bool> Add(CraftsInfoAddInput input); | |||
/// <summary> | |||
/// 移除 | |||
/// </summary> | |||
/// <returns></returns> | |||
Task<bool> Del(CraftsInfoDelInput input); | |||
/// <summary> | |||
/// 更新 | |||
/// </summary> | |||
/// <returns></returns> | |||
Task<bool> Update(CraftsInfoUpdateInput input); | |||
/// <summary> | |||
/// 不分页列表 | |||
/// </summary> | |||
/// <returns></returns> | |||
Task<List<CraftsInfoOutput>> List(CraftsInfoQueryInput Input); | |||
/// <summary> | |||
/// 分页列表 | |||
/// </summary> | |||
/// <returns></returns> | |||
Task<SqlSugarPagedList<CraftsInfoOutput>> PagedList(CraftsInfoQueryPageInput input); | |||
/// <summary> | |||
/// 下拉列表 | |||
/// </summary> | |||
/// <returns></returns> | |||
Task<dynamic> SelectList(); | |||
/// <summary> | |||
/// 查询单条 | |||
/// </summary> | |||
/// <param name="Id"></param> | |||
/// <returns></returns> | |||
Task<CraftsInfoOutput> Detail(string Id); | |||
} | |||
} |
@@ -1,48 +0,0 @@ | |||
namespace BPA.MES.Base.Application.Services | |||
{ | |||
/// <summary> | |||
/// 名 称 :产线管理 | |||
/// 创 建 人 :yangxiao | |||
/// 创建时间 :2023/7/18 14:05:16 | |||
/// 描 述 : | |||
/// </summary> | |||
public interface ICraftsStepsService | |||
{ | |||
/// <summary> | |||
/// 增加 | |||
/// </summary> | |||
/// <returns></returns> | |||
Task<bool> Add(CraftsStepsAddInput input); | |||
/// <summary> | |||
/// 移除 | |||
/// </summary> | |||
/// <returns></returns> | |||
Task<bool> Del(CraftsStepsDelInput input); | |||
/// <summary> | |||
/// 更新 | |||
/// </summary> | |||
/// <returns></returns> | |||
Task<bool> Update(CraftsStepsUpdateInput input); | |||
/// <summary> | |||
/// 不分页列表 | |||
/// </summary> | |||
/// <returns></returns> | |||
Task<List<CraftsStepsOutput>> List(); | |||
/// <summary> | |||
/// 分页列表 | |||
/// </summary> | |||
/// <returns></returns> | |||
Task<SqlSugarPagedList<CraftsStepsOutput>> PagedList(CraftsStepsQueryPageInput input); | |||
/// <summary> | |||
/// 下拉列表 | |||
/// </summary> | |||
/// <returns></returns> | |||
Task<dynamic> SelectList(); | |||
/// <summary> | |||
/// 查询单条 | |||
/// </summary> | |||
/// <param name="Id"></param> | |||
/// <returns></returns> | |||
Task<CraftsStepsOutput> Detail(string Id); | |||
} | |||
} |
@@ -1,99 +0,0 @@ | |||
namespace BPA.MES.Base.Application.Services | |||
{ | |||
/// <summary> | |||
/// 名 称 :设备Dto类 | |||
/// 创 建 人 :yangxiao | |||
/// 创建时间 : 2023/3/2 16:12:06 | |||
/// 描 述 : | |||
/// </summary> | |||
public class DeviceRecipeDto : DeviceRecipeEntity | |||
{ | |||
} | |||
/// <summary> | |||
/// 增加 | |||
/// </summary> | |||
public class DeviceRecipeAddInput : DeviceRecipeDto | |||
{ | |||
} | |||
/// <summary> | |||
/// 更新 | |||
/// </summary> | |||
public class DeviceRecipeUpdateInput : DeviceRecipeDto | |||
{ | |||
} | |||
/// <summary> | |||
/// 删除 | |||
/// </summary> | |||
public class DeviceRecipeDelInput | |||
{ | |||
/// <summary> | |||
/// 主键 | |||
/// </summary> | |||
public string Id { get; set; } | |||
} | |||
/// <summary> | |||
/// 不分页 | |||
/// </summary> | |||
public class DeviceRecipeQueryInput | |||
{ | |||
/// <summary> | |||
/// 设备Id | |||
/// </summary> | |||
public string DeviceId { get; set; } | |||
} | |||
/// <summary> | |||
/// 分页 | |||
/// </summary> | |||
public class DeviceRecipeQueryPageInput : RequestPage | |||
{ | |||
} | |||
public class DeviceRecipeBatchAddInput | |||
{ | |||
/// <summary> | |||
/// 设备Id | |||
/// </summary> | |||
public string DeviceId { get; set; } | |||
/// <summary> | |||
/// 配方数组 | |||
/// </summary> | |||
public List<string> RecipesIds { get; set; } = new(); | |||
} | |||
/// <summary> | |||
/// 输出 | |||
/// </summary> | |||
public class DeviceRecipeOutput : DeviceRecipeDto | |||
{ | |||
/// <summary> | |||
/// 设备名称 | |||
/// </summary> | |||
public string DeviceName { get; set; } | |||
/// <summary> | |||
/// 配方名称 | |||
/// </summary> | |||
public string RecipeName { get; set; } | |||
/// <summary> | |||
/// 配方代码 | |||
/// </summary> | |||
public string RecipeCode { get; set; } | |||
/// <summary> | |||
/// 分组Id | |||
/// </summary> | |||
public string GroupId { get; set; } | |||
/// <summary> | |||
/// 分组名称 | |||
/// </summary> | |||
public string GroupName { get; set; } | |||
/// <summary> | |||
/// 配方图片地址 | |||
/// </summary> | |||
public string RecipesPic { get; set; } | |||
} | |||
} |
@@ -1,88 +0,0 @@ | |||
namespace BPA.MES.Base.Application.Services | |||
{ | |||
/// <summary> | |||
/// 名 称 :设备Dto类 | |||
/// 创 建 人 :yangxiao | |||
/// 创建时间 : 2023/3/2 16:12:06 | |||
/// 描 述 : | |||
/// </summary> | |||
public class DevicesInfoDto | |||
{ | |||
/// <summary> | |||
/// 名称 | |||
/// </summary> | |||
/// <example>设备名称</example> | |||
[Required(ErrorMessage = "名称不能为空")] | |||
public string Name { get; set; } | |||
/// <summary> | |||
/// 编码 | |||
/// </summary> | |||
[Required(ErrorMessage = "编码不能为空")] | |||
public string Code { get; set; } | |||
/// <summary> | |||
/// 设备类型 | |||
/// </summary> | |||
public string DeviceType { get; set; } | |||
/// <summary> | |||
/// 设备描述 | |||
/// </summary> | |||
/// <example>设备描述</example> | |||
public string Describe { get; set; } | |||
/// <summary> | |||
/// 设备维保时间 | |||
/// </summary> | |||
/// <example>2023-7-17</example> | |||
public string RepairDate { get; set; } | |||
} | |||
/// <summary> | |||
/// 增加 | |||
/// </summary> | |||
public class DevicesInfoAddInput : DevicesInfoDto | |||
{ | |||
} | |||
/// <summary> | |||
/// 更新 | |||
/// </summary> | |||
public class DevicesInfoUpdateInput : DevicesInfoDto | |||
{ | |||
/// <summary> | |||
/// 主键 | |||
/// </summary> | |||
public string Id { get; set; } | |||
} | |||
/// <summary> | |||
/// 删除 | |||
/// </summary> | |||
public class DevicesInfoDelInput | |||
{ | |||
/// <summary> | |||
/// 主键 | |||
/// </summary> | |||
public string Id { get; set; } | |||
} | |||
/// <summary> | |||
/// 分页 | |||
/// </summary> | |||
public class DevicesInfoQueryPageInput : RequestPage | |||
{ | |||
/// <summary> | |||
/// 名称 | |||
/// </summary> | |||
public string Name { get; set; } | |||
/// <summary> | |||
/// 编码 | |||
/// </summary> | |||
public string Code { get; set; } | |||
} | |||
/// <summary> | |||
/// 输出 | |||
/// </summary> | |||
public class DevicesInfoOutput : DevicesInfoDto | |||
{ | |||
/// <summary> | |||
/// 主键 | |||
/// </summary> | |||
public string Id { get; set; } | |||
} | |||
} |
@@ -1,144 +0,0 @@ | |||
namespace BPA.MES.Base.Application.Services | |||
{ | |||
/// <summary> | |||
/// 名 称 :设备服务 | |||
/// 创 建 人 :yangxiao | |||
/// 创建时间 :2023/3/2 16:11:04 | |||
/// 描 述 :基础信息管理 | |||
/// </summary> | |||
[ApiDescriptionSettings("基础数据管理", Name = "DeviceRecipe", Tag = "设备服务", KeepName = true, SplitCamelCase = true, KeepVerb = true)] | |||
public class DeviceRecipeService : IDeviceRecipeService, ITransient, IDynamicApiController | |||
{ | |||
private readonly ISqlSugarClient _dbContext; | |||
public DeviceRecipeService(ISqlSugarClient db) | |||
{ | |||
_dbContext = db; | |||
} | |||
/// <summary> | |||
/// 增加 | |||
/// </summary> | |||
/// <param name="input"></param> | |||
/// <returns></returns> | |||
[HttpPost] | |||
public async Task<bool> Add(DeviceRecipeAddInput input) | |||
{ | |||
var r_entity = await _dbContext.Queryable<DeviceRecipeEntity>().FirstAsync(x => x.DeviceId == input.DeviceId && x.RecipesId==input.RecipesId); | |||
if (r_entity != null) | |||
{ | |||
throw Oops.Bah("名称已存在!"); | |||
} | |||
DeviceRecipeEntity entity = input.Adapt<DeviceRecipeEntity>(); | |||
return await _dbContext.Insertable(entity).IgnoreColumns(ignoreNullColumn: true).ExecuteCommandIdentityIntoEntityAsync(); | |||
} | |||
/// <summary> | |||
/// 批量下发配方 | |||
/// </summary> | |||
/// <param name="input"></param> | |||
/// <returns></returns> | |||
/// <exception cref="NotImplementedException"></exception> | |||
public async Task<bool> BatchUpdate(DeviceRecipeBatchAddInput input) | |||
{ | |||
bool result = false; | |||
List<DeviceRecipeEntity> dr_entitys = new(); | |||
foreach (var item in input.RecipesIds) | |||
{ | |||
DeviceRecipeEntity entity = new(); | |||
entity.RecipesId = item; | |||
entity.DeviceId = input.DeviceId; | |||
dr_entitys.Add(entity); | |||
} | |||
try | |||
{ | |||
_dbContext.Ado.BeginTran(); | |||
await _dbContext.Deleteable<DeviceRecipeEntity>().Where(x => x.DeviceId == input.DeviceId).ExecuteCommandAsync(); | |||
if (input.RecipesIds.Any()) | |||
{ | |||
await _dbContext.Insertable(dr_entitys).ExecuteCommandAsync(); | |||
} | |||
_dbContext.Ado.CommitTran(); | |||
result = true; | |||
} | |||
catch (Exception ex) | |||
{ | |||
throw Oops.Bah("更新失败!"); | |||
} | |||
return result; | |||
} | |||
/// <summary> | |||
/// 删除 | |||
/// </summary> | |||
/// <param name="input"></param> | |||
/// <returns></returns> | |||
/// <exception cref="NotImplementedException"></exception> | |||
[HttpPost] | |||
public async Task<bool> Del(DeviceRecipeDelInput input) | |||
{ | |||
var res = await _dbContext.Deleteable<DeviceRecipeEntity>().Where(x => x.Id == input.Id).ExecuteCommandHasChangeAsync(); | |||
return res; | |||
} | |||
/// <summary> | |||
/// 详情 | |||
/// </summary> | |||
/// <param name="Id"></param> | |||
/// <returns></returns> | |||
/// <exception cref="NotImplementedException"></exception> | |||
[HttpGet] | |||
public async Task<DeviceRecipeOutput> Detail(string Id) | |||
{ | |||
var entity = await _dbContext.Queryable<DeviceRecipeEntity>().FirstAsync(x => x.Id == Id); | |||
DeviceRecipeOutput output = entity.Adapt<DeviceRecipeOutput>(); | |||
return output; | |||
} | |||
/// <summary> | |||
/// 列表 | |||
/// </summary> | |||
/// <returns></returns> | |||
/// <exception cref="NotImplementedException"></exception> | |||
[HttpPost,AllowAnonymous] | |||
public async Task<List<DeviceRecipeOutput>> List(DeviceRecipeQueryInput input) | |||
{ | |||
var output = await _dbContext.Queryable<DeviceRecipeEntity>() | |||
.LeftJoin<RecipesInfoEntity>((a,b)=>a.RecipesId==b.Id) | |||
.LeftJoin<RecipesGroupEntity>((a,b,c)=>a.RecipesId==c.RecipesId) | |||
.LeftJoin<GroupInfoEntity>((a, b, c,d)=>c.GroupId==d.Id) | |||
.WhereIF(!string.IsNullOrEmpty(input.DeviceId),a=>a.DeviceId==input.DeviceId) | |||
.Select((a, b, c,d) => new DeviceRecipeOutput | |||
{ | |||
DeviceId = a.DeviceId, | |||
RecipeName = b.Name, | |||
RecipeCode = b.Code, | |||
RecipesId = a.RecipesId, | |||
GroupId = c.GroupId, | |||
GroupName = d.Name | |||
}) | |||
.ToListAsync(); | |||
return output; | |||
} | |||
/// <summary> | |||
/// 分页 | |||
/// </summary> | |||
/// <param name="input"></param> | |||
/// <returns></returns> | |||
[HttpPost] | |||
public async Task<SqlSugarPagedList<DeviceRecipeOutput>> PagedList(DeviceRecipeQueryPageInput input) | |||
{ | |||
var entity = await _dbContext.Queryable<DeviceRecipeEntity>() | |||
.ToPagedListAsync(input.PageIndex, input.PageSize); | |||
SqlSugarPagedList<DeviceRecipeOutput> output = entity.Adapt<SqlSugarPagedList<DeviceRecipeOutput>>(); | |||
return output; | |||
} | |||
/// <summary> | |||
/// 更新 | |||
/// </summary> | |||
/// <param name="input"></param> | |||
/// <returns></returns> | |||
/// <exception cref="NotImplementedException"></exception> | |||
[HttpPost] | |||
public async Task<bool> Update(DeviceRecipeUpdateInput input) | |||
{ | |||
var res = await _dbContext.Updateable<DeviceRecipeEntity>().ExecuteCommandHasChangeAsync(); | |||
return res; | |||
} | |||
} | |||
} |
@@ -1,119 +0,0 @@ | |||
namespace BPA.MES.Base.Application.Services | |||
{ | |||
/// <summary> | |||
/// 名 称 :设备服务 | |||
/// 创 建 人 :yangxiao | |||
/// 创建时间 :2023/3/2 16:11:04 | |||
/// 描 述 :基础数据管理 | |||
/// </summary> | |||
[ApiDescriptionSettings("基础数据管理",Order = 0, Tag = "设备服务", Name = "DevicesInfo", KeepName = true, SplitCamelCase = true, KeepVerb = true)] | |||
public class DevicesInfoService : IDevicesInfoService, ITransient, IDynamicApiController | |||
{ | |||
private readonly ISqlSugarClient _dbContext; | |||
public DevicesInfoService(ISqlSugarClient db) | |||
{ | |||
_dbContext = db; | |||
} | |||
/// <summary> | |||
/// 增加 | |||
/// </summary> | |||
/// <param name="input"></param> | |||
/// <returns></returns> | |||
[HttpPost] | |||
public async Task<bool> Add(DevicesInfoAddInput input) | |||
{ | |||
var r_entity = await _dbContext.Queryable<Pztj_DevicesInfoEntity>().FirstAsync(x => x.Name == input.Name || x.Code == input.Code); | |||
if (r_entity != null) | |||
{ | |||
throw Oops.Bah("名称或编码已存在!"); | |||
} | |||
Pztj_DevicesInfoEntity entity = input.Adapt<Pztj_DevicesInfoEntity>(); | |||
return await _dbContext.Insertable(entity).IgnoreColumns(ignoreNullColumn: true).ExecuteCommandIdentityIntoEntityAsync(); | |||
} | |||
/// <summary> | |||
/// 删除 | |||
/// </summary> | |||
/// <param name="input"></param> | |||
/// <returns></returns> | |||
/// <exception cref="NotImplementedException"></exception> | |||
[HttpPost] | |||
public async Task<bool> Del(DevicesInfoDelInput input) | |||
{ | |||
var res = await _dbContext.Deleteable<Pztj_DevicesInfoEntity>().Where(x => x.Id == input.Id).ExecuteCommandHasChangeAsync(); | |||
return res; | |||
} | |||
/// <summary> | |||
/// 详情 | |||
/// </summary> | |||
/// <param name="Id"></param> | |||
/// <returns></returns> | |||
/// <exception cref="NotImplementedException"></exception> | |||
[HttpGet] | |||
public async Task<DevicesInfoOutput> Detail(string Id) | |||
{ | |||
var entity = await _dbContext.Queryable<Pztj_DevicesInfoEntity>().FirstAsync(x => x.Id == Id); | |||
DevicesInfoOutput output = entity.Adapt<DevicesInfoOutput>(); | |||
return output; | |||
} | |||
/// <summary> | |||
/// 列表 | |||
/// </summary> | |||
/// <returns></returns> | |||
/// <exception cref="NotImplementedException"></exception> | |||
[HttpGet] | |||
public async Task<List<DevicesInfoOutput>> List() | |||
{ | |||
var entity = await _dbContext.Queryable<Pztj_DevicesInfoEntity>().ToListAsync(); | |||
List<DevicesInfoOutput> output = entity.Adapt<List<DevicesInfoOutput>>(); | |||
return output; | |||
} | |||
/// <summary> | |||
/// 分页 | |||
/// </summary> | |||
/// <param name="input"></param> | |||
/// <returns></returns> | |||
[HttpPost] | |||
public async Task<SqlSugarPagedList<DevicesInfoOutput>> PagedList(DevicesInfoQueryPageInput input) | |||
{ | |||
var entity = await _dbContext.Queryable<Pztj_DevicesInfoEntity>() | |||
.WhereIF(!string.IsNullOrEmpty(input.Name),x=>x.Name.Contains(input.Name)) | |||
.WhereIF(!string.IsNullOrEmpty(input.Code), x => x.Name.Contains(input.Code)) | |||
.ToPagedListAsync(input.PageIndex, input.PageSize); | |||
SqlSugarPagedList<DevicesInfoOutput> output = entity.Adapt<SqlSugarPagedList<DevicesInfoOutput>>(); | |||
return output; | |||
} | |||
/// <summary> | |||
/// 下拉 | |||
/// </summary> | |||
/// <returns></returns> | |||
/// <exception cref="NotImplementedException"></exception> | |||
[HttpGet] | |||
public async Task<dynamic> SelectList() | |||
{ | |||
var entity = await _dbContext.Queryable<Pztj_DevicesInfoEntity>().Select(x => new | |||
{ | |||
key = x.Id, | |||
value = x.Name | |||
}).ToListAsync(); | |||
return entity; | |||
} | |||
/// <summary> | |||
/// 更新 | |||
/// </summary> | |||
/// <param name="input"></param> | |||
/// <returns></returns> | |||
/// <exception cref="NotImplementedException"></exception> | |||
[HttpPost] | |||
public async Task<bool> Update(DevicesInfoUpdateInput input) | |||
{ | |||
var isExit =await _dbContext.Queryable<Pztj_DevicesInfoEntity>().Where(x => x.Id != input.Id && (x.Name == input.Name || x.Code == input.Code)).FirstAsync(); | |||
if (isExit != null) | |||
{ | |||
throw Oops.Bah("名称或编码已存在!"); | |||
} | |||
Pztj_DevicesInfoEntity entity = input.Adapt<Pztj_DevicesInfoEntity>(); | |||
var res = await _dbContext.Updateable(entity).IgnoreColumns(true).ExecuteCommandHasChangeAsync(); | |||
return res; | |||
} | |||
} | |||
} |
@@ -1,49 +0,0 @@ | |||
namespace BPA.MES.Base.Application.Services | |||
{ | |||
/// <summary> | |||
/// 名 称 :设备配方服务 | |||
/// 创 建 人 :yangxiao | |||
/// 创建时间 :2023/3/2 18:30:58 | |||
/// 描 述 : | |||
/// </summary> | |||
public interface IDeviceRecipeService | |||
{ | |||
/// <summary> | |||
/// 增加 | |||
/// </summary> | |||
/// <returns></returns> | |||
Task<bool> Add(DeviceRecipeAddInput input); | |||
/// <summary> | |||
/// 移除 | |||
/// </summary> | |||
/// <returns></returns> | |||
Task<bool> Del(DeviceRecipeDelInput input); | |||
/// <summary> | |||
/// 更新 | |||
/// </summary> | |||
/// <returns></returns> | |||
Task<bool> Update(DeviceRecipeUpdateInput input); | |||
/// <summary> | |||
/// 不分页列表 | |||
/// </summary> | |||
/// <returns></returns> | |||
Task<List<DeviceRecipeOutput>> List(DeviceRecipeQueryInput input); | |||
/// <summary> | |||
/// 分页列表 | |||
/// </summary> | |||
/// <returns></returns> | |||
Task<SqlSugarPagedList<DeviceRecipeOutput>> PagedList(DeviceRecipeQueryPageInput input); | |||
/// <summary> | |||
/// 查询单条 | |||
/// </summary> | |||
/// <param name="Id"></param> | |||
/// <returns></returns> | |||
Task<DeviceRecipeOutput> Detail(string Id); | |||
/// <summary> | |||
/// 批量下发配方 | |||
/// </summary> | |||
/// <param name="input"></param> | |||
/// <returns></returns> | |||
Task<bool> BatchUpdate(DeviceRecipeBatchAddInput input); | |||
} | |||
} |
@@ -1,48 +0,0 @@ | |||
namespace BPA.MES.Base.Application.Services | |||
{ | |||
/// <summary> | |||
/// 名 称 :设备服务 | |||
/// 创 建 人 :yangxiao | |||
/// 创建时间 :2023/3/2 18:30:58 | |||
/// 描 述 : | |||
/// </summary> | |||
public interface IDevicesInfoService | |||
{ | |||
/// <summary> | |||
/// 增加 | |||
/// </summary> | |||
/// <returns></returns> | |||
Task<bool> Add(DevicesInfoAddInput input); | |||
/// <summary> | |||
/// 移除 | |||
/// </summary> | |||
/// <returns></returns> | |||
Task<bool> Del(DevicesInfoDelInput input); | |||
/// <summary> | |||
/// 更新 | |||
/// </summary> | |||
/// <returns></returns> | |||
Task<bool> Update(DevicesInfoUpdateInput input); | |||
/// <summary> | |||
/// 不分页列表 | |||
/// </summary> | |||
/// <returns></returns> | |||
Task<List<DevicesInfoOutput>> List(); | |||
/// <summary> | |||
/// 分页列表 | |||
/// </summary> | |||
/// <returns></returns> | |||
Task<SqlSugarPagedList<DevicesInfoOutput>> PagedList(DevicesInfoQueryPageInput input); | |||
/// <summary> | |||
/// 下拉列表 | |||
/// </summary> | |||
/// <returns></returns> | |||
Task<dynamic> SelectList(); | |||
/// <summary> | |||
/// 查询单条 | |||
/// </summary> | |||
/// <param name="Id"></param> | |||
/// <returns></returns> | |||
Task<DevicesInfoOutput> Detail(string Id); | |||
} | |||
} |
@@ -79,9 +79,5 @@ | |||
/// 配方名称 | |||
/// </summary> | |||
public string RecipeName { get; set; } | |||
/// <summary> | |||
/// 工艺名称 | |||
/// </summary> | |||
public string CraftName { get; set; } | |||
} | |||
} |
@@ -22,12 +22,12 @@ | |||
[HttpPost] | |||
public async Task<bool> Add(FinalsInfoAddInput input) | |||
{ | |||
var r_entity = await _dbContext.Queryable<Pztj_FinalsInfoEntity>().FirstAsync(x => x.Name == input.Name); | |||
var r_entity = await _dbContext.Queryable<FinalInfoEntity>().FirstAsync(x => x.Name == input.Name); | |||
if (r_entity != null) | |||
{ | |||
throw Oops.Bah("名称已存在!"); | |||
} | |||
Pztj_FinalsInfoEntity entity = input.Adapt<Pztj_FinalsInfoEntity>(); | |||
FinalInfoEntity entity = input.Adapt<FinalInfoEntity>(); | |||
return await _dbContext.Insertable(entity).IgnoreColumns(ignoreNullColumn: true).ExecuteCommandIdentityIntoEntityAsync(); | |||
} | |||
/// <summary> | |||
@@ -39,7 +39,7 @@ | |||
[HttpPost] | |||
public async Task<bool> Del(FinalsInfoDelInput input) | |||
{ | |||
var res = await _dbContext.Deleteable<Pztj_FinalsInfoEntity>().Where(x => x.Id == input.Id).ExecuteCommandHasChangeAsync(); | |||
var res = await _dbContext.Deleteable<FinalInfoEntity>().Where(x => x.Id == input.Id).ExecuteCommandHasChangeAsync(); | |||
return res; | |||
} | |||
/// <summary> | |||
@@ -51,7 +51,7 @@ | |||
[HttpGet] | |||
public async Task<FinalsInfoOutput> Detail(string Id) | |||
{ | |||
var entity = await _dbContext.Queryable<Pztj_FinalsInfoEntity>().FirstAsync(x => x.Id == Id); | |||
var entity = await _dbContext.Queryable<FinalInfoEntity>().FirstAsync(x => x.Id == Id); | |||
FinalsInfoOutput output = entity.Adapt<FinalsInfoOutput>(); | |||
return output; | |||
} | |||
@@ -63,7 +63,7 @@ | |||
[HttpGet] | |||
public async Task<List<FinalsInfoOutput>> List() | |||
{ | |||
var entity = await _dbContext.Queryable<Pztj_FinalsInfoEntity>().ToListAsync(); | |||
var entity = await _dbContext.Queryable<FinalInfoEntity>().ToListAsync(); | |||
List<FinalsInfoOutput> output = entity.Adapt<List<FinalsInfoOutput>>(); | |||
return output; | |||
} | |||
@@ -75,16 +75,14 @@ | |||
[HttpPost] | |||
public async Task<SqlSugarPagedList<FinalsInfoOutput>> PagedList(FinalsInfoQueryPageInput input) | |||
{ | |||
var entity = await _dbContext.Queryable<Pztj_FinalsInfoEntity>() | |||
.LeftJoin<Pztj_CraftsInfoEntity>((a,b)=>a.CraftId==b.Id) | |||
.LeftJoin<RecipesInfoEntity>((a, b, c) => a.RecipeId == c.Id) | |||
var entity = await _dbContext.Queryable<FinalInfoEntity>() | |||
.LeftJoin<RecipesInfoEntity>((a, b) => a.RecipeId == b.Id) | |||
.WhereIF(!string.IsNullOrEmpty(input.Name),a=>a.Name.Contains(input.Name)) | |||
.WhereIF(!string.IsNullOrEmpty(input.Code), a => a.Name.Contains(input.Code)) | |||
.Select((a,b,c)=> new FinalsInfoOutput | |||
.Select((a,b)=> new FinalsInfoOutput | |||
{ | |||
Id = a.Id.SelectAll(), | |||
RecipeName = c.Name, | |||
CraftName = b.Name | |||
RecipeName = b.Name, | |||
}) | |||
.ToPagedListAsync(input.PageIndex, input.PageSize); | |||
SqlSugarPagedList<FinalsInfoOutput> output = entity.Adapt<SqlSugarPagedList<FinalsInfoOutput>>(); | |||
@@ -98,7 +96,7 @@ | |||
[HttpGet] | |||
public async Task<dynamic> SelectList() | |||
{ | |||
var entity = await _dbContext.Queryable<Pztj_FinalsInfoEntity>().Select(x => new | |||
var entity = await _dbContext.Queryable<FinalInfoEntity>().Select(x => new | |||
{ | |||
key = x.Id, | |||
value = x.Name | |||
@@ -114,7 +112,7 @@ | |||
[HttpPost] | |||
public async Task<bool> Update(FinalsInfoUpdateInput input) | |||
{ | |||
Pztj_FinalsInfoEntity entity = input.Adapt<Pztj_FinalsInfoEntity>(); | |||
FinalInfoEntity entity = input.Adapt<FinalInfoEntity>(); | |||
var res = await _dbContext.Updateable(entity).IgnoreColumns(true).ExecuteCommandHasChangeAsync(); | |||
return res; | |||
} | |||
@@ -22,12 +22,12 @@ | |||
[HttpPost] | |||
public async Task<bool> Add(MaterialsInfoAddInput input) | |||
{ | |||
var r_entity = await _dbContext.Queryable<Pztj_MaterialsInfoEntity>().FirstAsync(x => x.Name == input.Name); | |||
var r_entity = await _dbContext.Queryable<MaterialInfoEntity>().FirstAsync(x => x.Name == input.Name); | |||
if (r_entity != null) | |||
{ | |||
throw Oops.Bah("名称已存在!"); | |||
} | |||
Pztj_MaterialsInfoEntity entity = input.Adapt<Pztj_MaterialsInfoEntity>(); | |||
MaterialInfoEntity entity = input.Adapt<MaterialInfoEntity>(); | |||
return await _dbContext.Insertable(entity).IgnoreColumns(ignoreNullColumn: true).ExecuteCommandIdentityIntoEntityAsync(); | |||
} | |||
/// <summary> | |||
@@ -39,7 +39,7 @@ | |||
[HttpPost] | |||
public async Task<bool> Del(MaterialsInfoDelInput input) | |||
{ | |||
var res = await _dbContext.Deleteable<Pztj_MaterialsInfoEntity>().Where(x => x.Id == input.Id).ExecuteCommandHasChangeAsync(); | |||
var res = await _dbContext.Deleteable<MaterialInfoEntity>().Where(x => x.Id == input.Id).ExecuteCommandHasChangeAsync(); | |||
return res; | |||
} | |||
/// <summary> | |||
@@ -51,7 +51,7 @@ | |||
[HttpGet] | |||
public async Task<MaterialsInfoOutput> Detail(string Id) | |||
{ | |||
var entity = await _dbContext.Queryable<Pztj_MaterialsInfoEntity>().FirstAsync(x => x.Id == Id); | |||
var entity = await _dbContext.Queryable<MaterialInfoEntity>().FirstAsync(x => x.Id == Id); | |||
MaterialsInfoOutput output = entity.Adapt<MaterialsInfoOutput>(); | |||
return output; | |||
} | |||
@@ -63,7 +63,7 @@ | |||
[HttpGet] | |||
public async Task<List<MaterialsInfoOutput>> List() | |||
{ | |||
var entity = await _dbContext.Queryable<Pztj_MaterialsInfoEntity>().ToListAsync(); | |||
var entity = await _dbContext.Queryable<MaterialInfoEntity>().ToListAsync(); | |||
List<MaterialsInfoOutput> output = entity.Adapt<List<MaterialsInfoOutput>>(); | |||
return output; | |||
} | |||
@@ -75,7 +75,7 @@ | |||
[HttpPost] | |||
public async Task<SqlSugarPagedList<MaterialsInfoOutput>> PagedList(MaterialsInfoQueryPageInput input) | |||
{ | |||
var entity = await _dbContext.Queryable<Pztj_MaterialsInfoEntity>() | |||
var entity = await _dbContext.Queryable<MaterialInfoEntity>() | |||
.WhereIF(!string.IsNullOrEmpty(input.Name),x=>x.Name.Contains(input.Name)) | |||
.WhereIF(!string.IsNullOrEmpty(input.Code), x => x.Code.Contains(input.Code)) | |||
.ToPagedListAsync(input.PageIndex, input.PageSize); | |||
@@ -90,7 +90,7 @@ | |||
[HttpGet] | |||
public async Task<dynamic> SelectList() | |||
{ | |||
var entity = await _dbContext.Queryable<Pztj_MaterialsInfoEntity>().Select(x => new | |||
var entity = await _dbContext.Queryable<MaterialInfoEntity>().Select(x => new | |||
{ | |||
key = x.Id, | |||
value = x.Name | |||
@@ -106,8 +106,8 @@ | |||
[HttpPost] | |||
public async Task<bool> Update(MaterialsInfoUpdateInput input) | |||
{ | |||
var entity = await _dbContext.Queryable<Pztj_MaterialsInfoEntity>().Where(x => x.Id == input.Id).FirstAsync(); | |||
entity = input.Adapt<Pztj_MaterialsInfoEntity>(); | |||
var entity = await _dbContext.Queryable<MaterialInfoEntity>().Where(x => x.Id == input.Id).FirstAsync(); | |||
entity = input.Adapt<MaterialInfoEntity>(); | |||
var res = await _dbContext.Updateable(entity).IgnoreColumns(true).ExecuteCommandHasChangeAsync(); | |||
return res; | |||
} | |||
@@ -1,68 +0,0 @@ | |||
namespace BPA.MES.Base.Application.Services | |||
{ | |||
/// <summary> | |||
/// 名 称 :产品分组 | |||
/// 创 建 人 :yangxiao | |||
/// 创建时间 : 2023/3/10 13:59:43 | |||
/// 描 述 : | |||
/// </summary> | |||
public class GroupInfoDto | |||
{ | |||
/// <summary> | |||
/// 名称 | |||
/// </summary> | |||
public string Name { get; set; } | |||
/// <summary> | |||
/// 介绍 | |||
/// </summary> | |||
public string Des { get; set; } | |||
} | |||
/// <summary> | |||
/// 增加 | |||
/// </summary> | |||
public class GroupInfoAddInput : GroupInfoDto | |||
{ | |||
} | |||
/// <summary> | |||
/// 更新 | |||
/// </summary> | |||
public class GroupInfoUpdateInput : GroupInfoDto | |||
{ | |||
/// <summary> | |||
/// 主键 | |||
/// </summary> | |||
public string Id { get; set; } | |||
} | |||
/// <summary> | |||
/// 删除 | |||
/// </summary> | |||
public class GroupInfoDelInput | |||
{ | |||
/// <summary> | |||
/// 主键 | |||
/// </summary> | |||
public string Id { get; set; } | |||
} | |||
/// <summary> | |||
/// 分页 | |||
/// </summary> | |||
public class GroupInfoQueryPageInput : RequestPage | |||
{ | |||
/// <summary> | |||
/// 名称 | |||
/// </summary> | |||
public string Name { get; set; } | |||
} | |||
/// <summary> | |||
/// 输出 | |||
/// </summary> | |||
public class GroupInfoOutput : GroupInfoDto | |||
{ | |||
/// <summary> | |||
/// 主键 | |||
/// </summary> | |||
/// <example></example> | |||
public string Id { get; set; } | |||
} | |||
} |
@@ -1,76 +0,0 @@ | |||
namespace BPA.MES.Base.Application.Services | |||
{ | |||
/// <summary> | |||
/// 名 称 :产线设备 | |||
/// 创 建 人 :yangxiao | |||
/// 创建时间 : 2023/7/20 17:00:32 | |||
/// 描 述 : | |||
/// </summary> | |||
public class ProductLineDeviceDto | |||
{ | |||
/// <summary> | |||
/// 产线Id | |||
/// </summary> | |||
public string LineId { get; set; } | |||
/// <summary> | |||
/// 产线设备 | |||
/// </summary> | |||
public string DeviceId { get; set; } | |||
} | |||
public class ProductLineDeviceAddInput: ProductLineDeviceDto { | |||
} | |||
/// <summary> | |||
/// 产线设备分页 | |||
/// </summary> | |||
public class ProductLineDeviceQueryPageInput : RequestPage | |||
{ | |||
/// <summary> | |||
/// 名称 | |||
/// </summary> | |||
public string Name { get; set; } | |||
/// <summary> | |||
/// 产线Id | |||
/// </summary> | |||
public string LineId { get; set; } | |||
} | |||
/// <summary> | |||
/// 删除产线设备 | |||
/// </summary> | |||
public class ProductLineDeviceDelInput: ProductLineDeviceDto | |||
{ | |||
/// <summary> | |||
/// 主键 | |||
/// </summary> | |||
public string Id { get; set; } | |||
} | |||
/// <summary> | |||
/// 产线设备关联信息 | |||
/// </summary> | |||
public class ProductLineDeviceOutput: ProductLineDeviceDto | |||
{ | |||
/// <summary> | |||
/// 主键 | |||
/// </summary> | |||
public string Id { get; set; } | |||
/// <summary> | |||
/// 名称 | |||
/// </summary> | |||
/// <example>设备名称</example> | |||
public string DeviceName { get; set; } | |||
/// <summary> | |||
/// 编码 | |||
/// </summary> | |||
public string DeviceCode { get; set; } | |||
/// <summary> | |||
/// 设备类型 | |||
/// </summary> | |||
public string DeviceType { get; set; } | |||
/// <summary> | |||
/// 设备描述 | |||
/// </summary> | |||
/// <example>设备描述</example> | |||
public string Describe { get; set; } | |||
} | |||
} |
@@ -1,76 +0,0 @@ | |||
namespace BPA.MES.Base.Application.Services | |||
{ | |||
/// <summary> | |||
/// 名 称 :产线管理 | |||
/// 创 建 人 :yangxiao | |||
/// 创建时间 : 2023/7/18 14:03:27 | |||
/// 描 述 : | |||
/// </summary> | |||
public class ProductLineDto | |||
{ | |||
/// <summary> | |||
/// 产线名称 | |||
/// </summary> | |||
public string Name { get; set; } | |||
/// <summary> | |||
/// 产线编码 | |||
/// </summary> | |||
public string Code { get; set; } | |||
/// <summary> | |||
/// 产线描述 | |||
/// </summary> | |||
public string Describe { get; set; } | |||
} | |||
/// <summary> | |||
/// 增加 | |||
/// </summary> | |||
public class ProductLineAddInput : ProductLineDto | |||
{ | |||
} | |||
/// <summary> | |||
/// 更新 | |||
/// </summary> | |||
public class ProductLineUpdateInput : ProductLineDto | |||
{ | |||
/// <summary> | |||
/// 主键 | |||
/// </summary> | |||
public string Id { get; set; } | |||
} | |||
/// <summary> | |||
/// 删除 | |||
/// </summary> | |||
public class ProductLineDelInput | |||
{ | |||
/// <summary> | |||
/// 主键 | |||
/// </summary> | |||
public string Id { get; set; } | |||
} | |||
/// <summary> | |||
/// 分页 | |||
/// </summary> | |||
public class ProductLineQueryPageInput : RequestPage | |||
{ | |||
/// <summary> | |||
/// 名称 | |||
/// </summary> | |||
public string Name { get; set; } | |||
/// <summary> | |||
/// 编码 | |||
/// </summary> | |||
public string Code { get; set; } | |||
} | |||
/// <summary> | |||
/// 输出 | |||
/// </summary> | |||
public class ProductLineOutput : ProductLineDto | |||
{ | |||
/// <summary> | |||
/// 主键 | |||
/// </summary> | |||
public string Id { get; set; } | |||
} | |||
} |
@@ -1,69 +0,0 @@ | |||
namespace BPA.MES.Base.Application.Services | |||
{ | |||
/// <summary> | |||
/// 名 称 : | |||
/// 创 建 人 :yangxiao | |||
/// 创建时间 : 2023/7/20 18:25:18 | |||
/// 描 述 : | |||
/// </summary> | |||
public class ProductLineStockDto | |||
{ | |||
/// <summary> | |||
/// 产线Id | |||
/// </summary> | |||
public string LineId { get; set; } | |||
/// <summary> | |||
/// 产线设备 | |||
/// </summary> | |||
public string StockId { get; set; } | |||
} | |||
public class ProductLineStockAddInput : ProductLineStockDto | |||
{ | |||
} | |||
/// <summary> | |||
/// 产线设备分页 | |||
/// </summary> | |||
public class ProductLineStockQueryPageInput : RequestPage | |||
{ | |||
/// <summary> | |||
/// 名称 | |||
/// </summary> | |||
public string Name { get; set; } | |||
/// <summary> | |||
/// 产线Id | |||
/// </summary> | |||
public string LineId { get; set; } | |||
} | |||
/// <summary> | |||
/// 删除产线设备 | |||
/// </summary> | |||
public class ProductLineStockDelInput : ProductLineStockDto | |||
{ | |||
/// <summary> | |||
/// 主键 | |||
/// </summary> | |||
public string Id { get; set; } | |||
} | |||
/// <summary> | |||
/// 产线设备关联信息 | |||
/// </summary> | |||
public class ProductLineStockOutput : ProductLineStockDto | |||
{ | |||
/// <summary> | |||
/// 主键 | |||
/// </summary> | |||
public string Id { get; set; } | |||
/// <summary> | |||
/// 名称 | |||
/// </summary> | |||
/// <example>设备名称</example> | |||
public string StockName { get; set; } | |||
/// <summary> | |||
/// 编码 | |||
/// </summary> | |||
public string StockCode { get; set; } | |||
} | |||
} | |||
@@ -1,116 +0,0 @@ | |||
namespace BPA.MES.Base.Application.Services | |||
{ | |||
/// <summary> | |||
/// 名 称 :分组信息 | |||
/// 创 建 人 :yangxiao | |||
/// 创建时间 :2023/3/10 14:03:06 | |||
/// 描 述 : | |||
/// </summary> | |||
[ApiDescriptionSettings("产线管理", Order = 0, Name = "GroupInfo", Tag = "分组服务", KeepName = true, SplitCamelCase = true, KeepVerb = true)] | |||
public class GroupInfoService : IGroupInfoService, ITransient, IDynamicApiController | |||
{ | |||
private readonly ISqlSugarClient _dbContext; | |||
public GroupInfoService(ISqlSugarClient db) | |||
{ | |||
_dbContext = db; | |||
} | |||
/// <summary> | |||
/// 增加 | |||
/// </summary> | |||
/// <param name="input"></param> | |||
/// <returns></returns> | |||
[HttpPost] | |||
public async Task<bool> Add(GroupInfoAddInput input) | |||
{ | |||
GroupInfoEntity entity = await _dbContext.Queryable<GroupInfoEntity>().FirstAsync(x => x.Name == input.Name); | |||
if (entity != null) | |||
{ | |||
throw Oops.Bah("名称已存在!"); | |||
} | |||
entity = input.Adapt<GroupInfoEntity>(); | |||
return await _dbContext.Insertable(entity).IgnoreColumns(ignoreNullColumn: true).ExecuteCommandIdentityIntoEntityAsync(); | |||
} | |||
/// <summary> | |||
/// 删除 | |||
/// </summary> | |||
/// <param name="input"></param> | |||
/// <returns></returns> | |||
/// <exception cref="NotImplementedException"></exception> | |||
[HttpPost] | |||
public async Task<bool> Del(GroupInfoDelInput input) | |||
{ | |||
var res = await _dbContext.Deleteable<GroupInfoEntity>().Where(x=>x.Id==input.Id).ExecuteCommandHasChangeAsync(); | |||
return res; | |||
} | |||
/// <summary> | |||
/// 详情 | |||
/// </summary> | |||
/// <param name="Id"></param> | |||
/// <returns></returns> | |||
/// <exception cref="NotImplementedException"></exception> | |||
[HttpGet] | |||
public async Task<GroupInfoOutput> Detail(string Id) | |||
{ | |||
var entity = await _dbContext.Queryable<GroupInfoEntity>().FirstAsync(); | |||
GroupInfoOutput output = entity.Adapt<GroupInfoOutput>(); | |||
return output; | |||
} | |||
/// <summary> | |||
/// 列表 | |||
/// </summary> | |||
/// <returns></returns> | |||
/// <exception cref="NotImplementedException"></exception> | |||
[HttpPost, AllowAnonymous] | |||
public async Task<List<GroupInfoOutput>> List() | |||
{ | |||
var entity = await _dbContext.Queryable<GroupInfoEntity>().ToListAsync(); | |||
List<GroupInfoOutput> output = entity.Adapt<List<GroupInfoOutput>>(); | |||
return output; | |||
} | |||
/// <summary> | |||
/// 分页 | |||
/// </summary> | |||
/// <param name="input"></param> | |||
/// <returns></returns> | |||
[HttpPost] | |||
public async Task<SqlSugarPagedList<GroupInfoOutput>> PagedList(GroupInfoQueryPageInput input) | |||
{ | |||
var entity = await _dbContext.Queryable<GroupInfoEntity>() | |||
.ToPagedListAsync(input.PageIndex, input.PageSize); | |||
SqlSugarPagedList<GroupInfoOutput> output = entity.Adapt<SqlSugarPagedList<GroupInfoOutput>>(); | |||
return output; | |||
} | |||
/// <summary> | |||
/// 下拉 | |||
/// </summary> | |||
/// <returns></returns> | |||
[HttpGet] | |||
public async Task<dynamic> SelectList() | |||
{ | |||
var entity = await _dbContext.Queryable<GroupInfoEntity>().Select(x => new | |||
{ | |||
key = x.Id, | |||
value = x.Name | |||
}).ToListAsync(); | |||
return entity; | |||
} | |||
/// <summary> | |||
/// 更新 | |||
/// </summary> | |||
/// <param name="input"></param> | |||
/// <returns></returns> | |||
/// <exception cref="NotImplementedException"></exception> | |||
[HttpPost] | |||
public async Task<bool> Update(GroupInfoUpdateInput input) | |||
{ | |||
var entity = await _dbContext.Queryable<GroupInfoEntity>().FirstAsync(x => x.Id != input.Id && x.Name == input.Name); | |||
if (entity != null) | |||
{ | |||
throw Oops.Bah("名称已存在!"); | |||
} | |||
entity = input.Adapt<GroupInfoEntity>(); | |||
var res = await _dbContext.Updateable(entity).IgnoreColumns(true).ExecuteCommandHasChangeAsync(); | |||
return res; | |||
} | |||
} | |||
} |
@@ -1,48 +0,0 @@ | |||
namespace BPA.MES.Base.Application.Services | |||
{ | |||
/// <summary> | |||
/// 名 称 :分组信息 | |||
/// 创 建 人 :yangxiao | |||
/// 创建时间 :2023/3/10 14:03:21 | |||
/// 描 述 : | |||
/// </summary> | |||
public interface IGroupInfoService | |||
{ | |||
/// <summary> | |||
/// 增加 | |||
/// </summary> | |||
/// <returns></returns> | |||
Task<bool> Add(GroupInfoAddInput input); | |||
/// <summary> | |||
/// 移除 | |||
/// </summary> | |||
/// <returns></returns> | |||
Task<bool> Del(GroupInfoDelInput input); | |||
/// <summary> | |||
/// 更新 | |||
/// </summary> | |||
/// <returns></returns> | |||
Task<bool> Update(GroupInfoUpdateInput input); | |||
/// <summary> | |||
/// 不分页列表 | |||
/// </summary> | |||
/// <returns></returns> | |||
Task<List<GroupInfoOutput>> List(); | |||
/// <summary> | |||
/// 下拉列表 | |||
/// </summary> | |||
/// <returns></returns> | |||
Task<dynamic> SelectList(); | |||
/// <summary> | |||
/// 分页列表 | |||
/// </summary> | |||
/// <returns></returns> | |||
Task<SqlSugarPagedList<GroupInfoOutput>> PagedList(GroupInfoQueryPageInput input); | |||
/// <summary> | |||
/// 查询单条 | |||
/// </summary> | |||
/// <param name="Id"></param> | |||
/// <returns></returns> | |||
Task<GroupInfoOutput> Detail(string Id); | |||
} | |||
} |
@@ -1,100 +0,0 @@ | |||
namespace BPA.MES.Base.Application.Services | |||
{ | |||
/// <summary> | |||
/// 名 称 :产线管理 | |||
/// 创 建 人 :yangxiao | |||
/// 创建时间 :2023/7/18 14:05:16 | |||
/// 描 述 : | |||
/// </summary> | |||
public interface IProductLineService | |||
{ | |||
/// <summary> | |||
/// 增加 | |||
/// </summary> | |||
/// <returns></returns> | |||
Task<bool> Add(ProductLineAddInput input); | |||
/// <summary> | |||
/// 移除 | |||
/// </summary> | |||
/// <returns></returns> | |||
Task<bool> Del(ProductLineDelInput input); | |||
/// <summary> | |||
/// 更新 | |||
/// </summary> | |||
/// <returns></returns> | |||
Task<bool> Update(ProductLineUpdateInput input); | |||
/// <summary> | |||
/// 不分页列表 | |||
/// </summary> | |||
/// <returns></returns> | |||
Task<List<ProductLineOutput>> List(); | |||
/// <summary> | |||
/// 分页列表 | |||
/// </summary> | |||
/// <returns></returns> | |||
Task<SqlSugarPagedList<ProductLineOutput>> PagedList(ProductLineQueryPageInput input); | |||
/// <summary> | |||
/// 下拉列表 | |||
/// </summary> | |||
/// <returns></returns> | |||
Task<dynamic> SelectList(); | |||
/// <summary> | |||
/// 查询单条 | |||
/// </summary> | |||
/// <param name="Id"></param> | |||
/// <returns></returns> | |||
Task<ProductLineOutput> Detail(string Id); | |||
/// <summary> | |||
/// 产线添加设备 | |||
/// </summary> | |||
/// <returns></returns> | |||
Task<bool> AddDevice(ProductLineDeviceAddInput input); | |||
/// <summary> | |||
/// 产线删除设备 | |||
/// </summary> | |||
/// <returns></returns> | |||
Task<bool> DeleteDevice(ProductLineDeviceDelInput input); | |||
///// <summary> | |||
///// 产线更新设备 | |||
///// </summary> | |||
///// <returns></returns> | |||
//Task<bool> UpdateDevice(string DeviceId); | |||
/// <summary> | |||
/// 产线设备不分页 | |||
/// </summary> | |||
/// <returns></returns> | |||
Task<List<ProductLineDeviceOutput>> DeviceList(); | |||
/// <summary> | |||
/// 产线设备分页 | |||
/// </summary> | |||
/// <returns></returns> | |||
Task<SqlSugarPagedList<ProductLineDeviceOutput>> DevicePageList(ProductLineDeviceQueryPageInput input); | |||
/// <summary> | |||
/// 产线添加料仓 | |||
/// </summary> | |||
/// <returns></returns> | |||
Task<bool> AddStock(ProductLineStockAddInput input); | |||
/// <summary> | |||
/// 产线删除料仓 | |||
/// </summary> | |||
/// <returns></returns> | |||
Task<bool> DeleteStock(ProductLineStockDelInput input); | |||
///// <summary> | |||
///// 产线更新料仓 | |||
///// </summary> | |||
///// <returns></returns> | |||
//Task<bool> UpdateStock(string StockId); | |||
/// <summary> | |||
/// 产线料仓不分页 | |||
/// </summary> | |||
/// <returns></returns> | |||
Task<List<ProductLineStockOutput>> StockList(); | |||
/// <summary> | |||
/// 产线料仓分页 | |||
/// </summary> | |||
/// <returns></returns> | |||
Task<SqlSugarPagedList<ProductLineStockOutput>> StockPageList(ProductLineStockQueryPageInput input); | |||
} | |||
} |
@@ -1,241 +0,0 @@ | |||
namespace BPA.MES.Base.Application.Services | |||
{ | |||
/// <summary> | |||
/// 名 称 :产线服务 | |||
/// 创 建 人 :yangxiao | |||
/// 创建时间 :2023/3/2 16:11:04 | |||
/// 描 述 :基础数据管理 | |||
/// </summary> | |||
[ApiDescriptionSettings("产线管理", Order = 0, Name = "ProductLine", Tag = "产线服务", KeepName = true, SplitCamelCase = true, KeepVerb = true)] | |||
public class ProductLineService : IProductLineService, ITransient, IDynamicApiController | |||
{ | |||
private readonly ISqlSugarClient _dbContext; | |||
public ProductLineService(ISqlSugarClient db) | |||
{ | |||
_dbContext = db; | |||
} | |||
/// <summary> | |||
/// 增加 | |||
/// </summary> | |||
/// <param name="input"></param> | |||
/// <returns></returns> | |||
[HttpPost] | |||
public async Task<bool> Add(ProductLineAddInput input) | |||
{ | |||
var r_entity = await _dbContext.Queryable<ProductLineEntity>().FirstAsync(x => x.Name == input.Name); | |||
if (r_entity != null) | |||
{ | |||
throw Oops.Bah("名称已存在!"); | |||
} | |||
ProductLineEntity entity = input.Adapt<ProductLineEntity>(); | |||
return await _dbContext.Insertable(entity).IgnoreColumns(ignoreNullColumn: true).ExecuteCommandIdentityIntoEntityAsync(); | |||
} | |||
/// <summary> | |||
/// 删除 | |||
/// </summary> | |||
/// <param name="input"></param> | |||
/// <returns></returns> | |||
/// <exception cref="NotImplementedException"></exception> | |||
[HttpPost] | |||
public async Task<bool> Del(ProductLineDelInput input) | |||
{ | |||
var res = await _dbContext.Deleteable<ProductLineEntity>().Where(x => x.Id == input.Id).ExecuteCommandHasChangeAsync(); | |||
return res; | |||
} | |||
/// <summary> | |||
/// 详情 | |||
/// </summary> | |||
/// <param name="Id"></param> | |||
/// <returns></returns> | |||
/// <exception cref="NotImplementedException"></exception> | |||
[HttpGet] | |||
public async Task<ProductLineOutput> Detail(string Id) | |||
{ | |||
var entity = await _dbContext.Queryable<ProductLineEntity>().FirstAsync(x => x.Id == Id); | |||
ProductLineOutput output = entity.Adapt<ProductLineOutput>(); | |||
return output; | |||
} | |||
/// <summary> | |||
/// 列表 | |||
/// </summary> | |||
/// <returns></returns> | |||
/// <exception cref="NotImplementedException"></exception> | |||
[HttpGet] | |||
public async Task<List<ProductLineOutput>> List() | |||
{ | |||
var entity = await _dbContext.Queryable<ProductLineEntity>().ToListAsync(); | |||
List<ProductLineOutput> output = entity.Adapt<List<ProductLineOutput>>(); | |||
return output; | |||
} | |||
/// <summary> | |||
/// 分页 | |||
/// </summary> | |||
/// <param name="input"></param> | |||
/// <returns></returns> | |||
[HttpPost] | |||
public async Task<SqlSugarPagedList<ProductLineOutput>> PagedList(ProductLineQueryPageInput input) | |||
{ | |||
var entity = await _dbContext.Queryable<ProductLineEntity>() | |||
.WhereIF(!string.IsNullOrEmpty(input.Name), x => x.Name.Contains(input.Name)) | |||
.WhereIF(!string.IsNullOrEmpty(input.Code), x => x.Name.Contains(input.Code)) | |||
.ToPagedListAsync(input.PageIndex, input.PageSize); | |||
SqlSugarPagedList<ProductLineOutput> output = entity.Adapt<SqlSugarPagedList<ProductLineOutput>>(); | |||
return output; | |||
} | |||
/// <summary> | |||
/// 下拉 | |||
/// </summary> | |||
/// <returns></returns> | |||
/// <exception cref="NotImplementedException"></exception> | |||
[HttpGet] | |||
public async Task<dynamic> SelectList() | |||
{ | |||
var entity = await _dbContext.Queryable<ProductLineEntity>().Select(x => new | |||
{ | |||
key = x.Id, | |||
value = x.Name | |||
}).ToListAsync(); | |||
return entity; | |||
} | |||
/// <summary> | |||
/// 更新 | |||
/// </summary> | |||
/// <param name="input"></param> | |||
/// <returns></returns> | |||
/// <exception cref="NotImplementedException"></exception> | |||
[HttpPost] | |||
public async Task<bool> Update(ProductLineUpdateInput input) | |||
{ | |||
var isExit =await _dbContext.Queryable<ProductLineEntity>().Where(x => x.Id != input.Id && (x.Name == input.Name || x.Code == input.Code)).FirstAsync(); | |||
if (isExit != null) | |||
{ | |||
throw Oops.Bah("名称或编码已存在!"); | |||
} | |||
ProductLineEntity entity = input.Adapt<ProductLineEntity>(); | |||
var res = await _dbContext.Updateable(entity).IgnoreColumns(true).ExecuteCommandHasChangeAsync(); | |||
return res; | |||
} | |||
/// <summary> | |||
/// 产线添加设备 | |||
/// </summary> | |||
/// <returns></returns> | |||
[HttpPost] | |||
public async Task<bool> AddDevice(ProductLineDeviceAddInput input) | |||
{ | |||
var r_entity = await _dbContext.Queryable<Pztj_LineDevicesEntity>().FirstAsync(x => x.DeviceId == input.DeviceId); | |||
if (r_entity != null) | |||
{ | |||
throw Oops.Bah("设备已存在!"); | |||
} | |||
Pztj_LineDevicesEntity entity = input.Adapt<Pztj_LineDevicesEntity>(); | |||
return await _dbContext.Insertable(entity).IgnoreColumns(ignoreNullColumn: true).ExecuteCommandIdentityIntoEntityAsync(); | |||
} | |||
/// <summary> | |||
/// 产线删除设备 | |||
/// </summary> | |||
/// <returns></returns> | |||
[HttpPost] | |||
public async Task<bool> DeleteDevice(ProductLineDeviceDelInput input) | |||
{ | |||
var res = await _dbContext.Deleteable<Pztj_LineDevicesEntity>().Where(x => x.Id == input.Id).ExecuteCommandHasChangeAsync(); | |||
return res; | |||
} | |||
/// <summary> | |||
/// 产线设备不分页 | |||
/// </summary> | |||
/// <returns></returns> | |||
[HttpGet] | |||
public async Task<List<ProductLineDeviceOutput>> DeviceList() | |||
{ | |||
var entity = await _dbContext.Queryable<Pztj_LineDevicesEntity>().ToListAsync(); | |||
List<ProductLineDeviceOutput> output = entity.Adapt<List<ProductLineDeviceOutput>>(); | |||
return output; | |||
} | |||
/// <summary> | |||
/// 产线设备分页 | |||
/// </summary> | |||
/// <returns></returns> | |||
[HttpPost] | |||
public async Task<SqlSugarPagedList<ProductLineDeviceOutput>> DevicePageList(ProductLineDeviceQueryPageInput input) | |||
{ | |||
var entity = await _dbContext.Queryable<Pztj_LineDevicesEntity>() | |||
.LeftJoin<Pztj_DevicesInfoEntity>((a,b)=>a.DeviceId==b.Id) | |||
.WhereIF(!string.IsNullOrEmpty(input.Name), (a, b) => b.Name.Contains(input.Name)) | |||
.Where((a, b) => a.LineId == input.LineId) | |||
.Select((a,b)=>new ProductLineDeviceOutput | |||
{ | |||
DeviceId = a.DeviceId, | |||
DeviceCode = b.Code, | |||
DeviceName = b.Name, | |||
Describe = b.Describe, | |||
DeviceType = b.DeviceType, | |||
Id = a.Id, | |||
LineId = a.LineId | |||
}) | |||
.ToPagedListAsync(input.PageIndex, input.PageSize); | |||
return entity; | |||
} | |||
/// <summary> | |||
/// 产线添加料仓 | |||
/// </summary> | |||
/// <returns></returns> | |||
[HttpPost] | |||
public async Task<bool> AddStock(ProductLineStockAddInput input) | |||
{ | |||
var r_entity = await _dbContext.Queryable<Pztj_LineStocksEntity>().FirstAsync(x => x.StockId == input.StockId); | |||
if (r_entity != null) | |||
{ | |||
throw Oops.Bah("设备已存在!"); | |||
} | |||
Pztj_LineStocksEntity entity = input.Adapt<Pztj_LineStocksEntity>(); | |||
return await _dbContext.Insertable(entity).IgnoreColumns(ignoreNullColumn: true).ExecuteCommandIdentityIntoEntityAsync(); | |||
} | |||
/// <summary> | |||
/// 产线删除料仓 | |||
/// </summary> | |||
/// <returns></returns> | |||
[HttpPost] | |||
public async Task<bool> DeleteStock(ProductLineStockDelInput input) | |||
{ | |||
var res = await _dbContext.Deleteable<Pztj_LineStocksEntity>().Where(x => x.Id == input.Id).ExecuteCommandHasChangeAsync(); | |||
return res; | |||
} | |||
/// <summary> | |||
/// 产线料仓不分页 | |||
/// </summary> | |||
/// <returns></returns> | |||
[HttpGet] | |||
public async Task<List<ProductLineStockOutput>> StockList() | |||
{ | |||
var entity = await _dbContext.Queryable<Pztj_LineStocksEntity>().ToListAsync(); | |||
List<ProductLineStockOutput> output = entity.Adapt<List<ProductLineStockOutput>>(); | |||
return output; | |||
} | |||
/// <summary> | |||
/// 产线料仓分页 | |||
/// </summary> | |||
/// <returns></returns> | |||
[HttpPost] | |||
public async Task<SqlSugarPagedList<ProductLineStockOutput>> StockPageList(ProductLineStockQueryPageInput input) | |||
{ | |||
var entity = await _dbContext.Queryable<Pztj_LineStocksEntity>() | |||
.LeftJoin<Pztj_StockInfoEntity>((a, b) => a.StockId == b.Id) | |||
.WhereIF(!string.IsNullOrEmpty(input.Name), (a, b) => b.Name.Contains(input.Name)) | |||
.Where((a, b) => a.LineId == input.LineId) | |||
.Select((a, b) => new ProductLineStockOutput | |||
{ | |||
StockId = a.StockId, | |||
StockCode = b.Code, | |||
StockName = b.Name, | |||
Id = a.Id, | |||
LineId = a.LineId | |||
}) | |||
.ToPagedListAsync(input.PageIndex, input.PageSize); | |||
return entity; | |||
} | |||
} | |||
} | |||
@@ -72,13 +72,5 @@ | |||
/// </summary> | |||
public string GroupId { get; set; } | |||
} | |||
public class RecipesGroupInput : RecipesGroupEntity | |||
{ | |||
/// <summary> | |||
/// 主键 | |||
/// </summary> | |||
/// <example></example> | |||
public string Id { get; set; } | |||
} | |||
} |
@@ -44,11 +44,6 @@ | |||
/// <param name="Id"></param> | |||
/// <returns></returns> | |||
Task<RecipesInfoOutput> Detail(string Id); | |||
/// <summary> | |||
/// 更改物料分组 | |||
/// </summary> | |||
/// <param name="input"></param> | |||
/// <returns></returns> | |||
Task<bool> ChangeGroup(RecipesGroupInput input); | |||
} | |||
} |
@@ -86,7 +86,7 @@ | |||
{ | |||
var output = await _dbContext.Queryable<RecipeMaterialEntity>() | |||
.LeftJoin<RecipesInfoEntity>((a,b)=>a.RecipesId==b.Id) | |||
.LeftJoin<Pztj_MaterialsInfoEntity>((a,b,c)=>a.MaterialId==c.Id) | |||
.LeftJoin<MaterialInfoEntity>((a,b,c)=>a.MaterialId==c.Id) | |||
.WhereIF(!string.IsNullOrEmpty(input.RecipesId),(a,b,c)=>a.RecipesId==input.RecipesId) | |||
.Select((a,b,c)=>new RecipeMaterialOutput | |||
{ | |||
@@ -76,9 +76,6 @@ | |||
public async Task<SqlSugarPagedList<RecipesInfoOutput>> PagedList(RecipesInfoQueryPageInput input) | |||
{ | |||
var entity = await _dbContext.Queryable<RecipesInfoEntity>() | |||
.LeftJoin<RecipesGroupEntity>((a,b)=>a.Id==b.RecipesId) | |||
.WhereIF(!string.IsNullOrEmpty(input.Name), (a, b) => a.Name.Contains(input.Name)) | |||
.WhereIF(!string.IsNullOrEmpty(input.GroupId), (a, b) => b.GroupId==input.GroupId) | |||
.Select<RecipesInfoOutput>() | |||
.ToPagedListAsync(input.PageIndex, input.PageSize); | |||
SqlSugarPagedList<RecipesInfoOutput> output = entity.Adapt<SqlSugarPagedList<RecipesInfoOutput>>(); | |||
@@ -117,20 +114,5 @@ | |||
var res = await _dbContext.Updateable(entity).IgnoreColumns(true).ExecuteCommandHasChangeAsync(); | |||
return res; | |||
} | |||
[HttpPost] | |||
public async Task<bool> ChangeGroup(RecipesGroupInput input) | |||
{ | |||
var isExit =await _dbContext.Queryable<RecipesGroupEntity>().FirstAsync(x=>x.RecipesId==input.RecipesId); | |||
var entity = input.Adapt<RecipesGroupEntity>(); | |||
if (isExit==null) | |||
{ | |||
return await _dbContext.Insertable(entity).ExecuteCommandIdentityIntoEntityAsync(); | |||
} | |||
else | |||
{ | |||
return await _dbContext.Updateable(entity).IgnoreColumns(true).Where(x => x.RecipesId == input.RecipesId).ExecuteCommandHasChangeAsync(); | |||
} | |||
} | |||
} | |||
} |
@@ -1,49 +0,0 @@ | |||
namespace BPA.MES.Base.Application.Services | |||
{ | |||
/// <summary> | |||
/// 名 称 :料仓服务 | |||
/// 创 建 人 :yangxiao | |||
/// 创建时间 : 2023/7/17 15:32:17 | |||
/// 描 述 : | |||
/// </summary> | |||
public interface IStockInfoService | |||
{ | |||
/// <summary> | |||
/// 增加 | |||
/// </summary> | |||
/// <returns></returns> | |||
Task<bool> Add(StockInfoAddInput input); | |||
/// <summary> | |||
/// 移除 | |||
/// </summary> | |||
/// <returns></returns> | |||
Task<bool> Del(StockInfoDelInput input); | |||
/// <summary> | |||
/// 更新 | |||
/// </summary> | |||
/// <returns></returns> | |||
Task<bool> Update(StockInfoUpdateInput input); | |||
/// <summary> | |||
/// 不分页列表 | |||
/// </summary> | |||
/// <returns></returns> | |||
Task<List<StockInfoOutput>> List(); | |||
/// <summary> | |||
/// 分页列表 | |||
/// </summary> | |||
/// <returns></returns> | |||
Task<SqlSugarPagedList<StockInfoOutput>> PagedList(StockInfoQueryPageInput input); | |||
/// <summary> | |||
/// 下拉列表 | |||
/// </summary> | |||
/// <returns></returns> | |||
Task<dynamic> SelectList(); | |||
/// <summary> | |||
/// 查询单条 | |||
/// </summary> | |||
/// <param name="Id"></param> | |||
/// <returns></returns> | |||
Task<StockInfoOutput> Detail(string Id); | |||
} | |||
} |
@@ -1,123 +0,0 @@ | |||
namespace BPA.MES.Base.Application.Services | |||
{ | |||
/// <summary> | |||
/// 名 称 :料仓服务 | |||
/// 创 建 人 :yangxiao | |||
/// 创建时间 :2023/3/2 16:11:04 | |||
/// 描 述 :基础数据管理 | |||
/// </summary> | |||
[ApiDescriptionSettings("基础数据管理", Order = 1, Name = "StockInfo", Tag = "料仓服务", KeepName = true, SplitCamelCase = true, KeepVerb = true)] | |||
public class StockInfoService : IStockInfoService, ITransient, IDynamicApiController | |||
{ | |||
private readonly ISqlSugarClient _dbContext; | |||
public StockInfoService(ISqlSugarClient db) | |||
{ | |||
_dbContext = db; | |||
} | |||
/// <summary> | |||
/// 增加 | |||
/// </summary> | |||
/// <param name="input"></param> | |||
/// <returns></returns> | |||
[HttpPost] | |||
public async Task<bool> Add(StockInfoAddInput input) | |||
{ | |||
var r_entity = await _dbContext.Queryable<Pztj_StockInfoEntity>().FirstAsync(x => x.Name == input.Name || x.Code==input.Code); | |||
if (r_entity != null) | |||
{ | |||
throw Oops.Bah("名称或编码已存在!"); | |||
} | |||
Pztj_StockInfoEntity entity = input.Adapt<Pztj_StockInfoEntity>(); | |||
return await _dbContext.Insertable(entity).IgnoreColumns(ignoreNullColumn: true).ExecuteCommandIdentityIntoEntityAsync(); | |||
} | |||
/// <summary> | |||
/// 删除 | |||
/// </summary> | |||
/// <param name="input"></param> | |||
/// <returns></returns> | |||
/// <exception cref="NotImplementedException"></exception> | |||
[HttpPost] | |||
public async Task<bool> Del(StockInfoDelInput input) | |||
{ | |||
var res = await _dbContext.Deleteable<Pztj_StockInfoEntity>().Where(x => x.Id == input.Id).ExecuteCommandHasChangeAsync(); | |||
return res; | |||
} | |||
/// <summary> | |||
/// 详情 | |||
/// </summary> | |||
/// <param name="Id"></param> | |||
/// <returns></returns> | |||
/// <exception cref="NotImplementedException"></exception> | |||
[HttpGet] | |||
public async Task<StockInfoOutput> Detail(string Id) | |||
{ | |||
var entity = await _dbContext.Queryable<Pztj_StockInfoEntity>().FirstAsync(x => x.Id == Id); | |||
StockInfoOutput output = entity.Adapt<StockInfoOutput>(); | |||
return output; | |||
} | |||
/// <summary> | |||
/// 列表 | |||
/// </summary> | |||
/// <returns></returns> | |||
/// <exception cref="NotImplementedException"></exception> | |||
[HttpGet] | |||
public async Task<List<StockInfoOutput>> List() | |||
{ | |||
var entity = await _dbContext.Queryable<Pztj_StockInfoEntity>().ToListAsync(); | |||
List<StockInfoOutput> output = entity.Adapt<List<StockInfoOutput>>(); | |||
return output; | |||
} | |||
/// <summary> | |||
/// 分页 | |||
/// </summary> | |||
/// <param name="input"></param> | |||
/// <returns></returns> | |||
[HttpPost] | |||
public async Task<SqlSugarPagedList<StockInfoOutput>> PagedList(StockInfoQueryPageInput input) | |||
{ | |||
var entity = await _dbContext.Queryable<Pztj_StockInfoEntity>() | |||
.LeftJoin<Pztj_MaterialsInfoEntity>((a,b)=>a.MaterialId==b.Id) | |||
.Select((a,b)=>new StockInfoOutput | |||
{ | |||
Id=a.Id.SelectAll(), | |||
MaterialName= b.Name | |||
}) | |||
.ToPagedListAsync(input.PageIndex, input.PageSize); | |||
SqlSugarPagedList<StockInfoOutput> output = entity.Adapt<SqlSugarPagedList<StockInfoOutput>>(); | |||
return output; | |||
} | |||
/// <summary> | |||
/// 下拉 | |||
/// </summary> | |||
/// <returns></returns> | |||
/// <exception cref="NotImplementedException"></exception> | |||
[HttpGet] | |||
public async Task<dynamic> SelectList() | |||
{ | |||
var entity = await _dbContext.Queryable<Pztj_StockInfoEntity>().Select(x => new | |||
{ | |||
key = x.Id, | |||
value = x.Name | |||
}).ToListAsync(); | |||
return entity; | |||
} | |||
/// <summary> | |||
/// 更新 | |||
/// </summary> | |||
/// <param name="input"></param> | |||
/// <returns></returns> | |||
/// <exception cref="NotImplementedException"></exception> | |||
[HttpPost] | |||
public async Task<bool> Update(StockInfoUpdateInput input) | |||
{ | |||
var isExit =await _dbContext.Queryable<Pztj_StockInfoEntity>().Where(x => x.Id != input.Id && (x.Name==input.Name || x.Code==input.Code)).FirstAsync(); | |||
if (isExit != null) | |||
{ | |||
throw Oops.Bah("名称或编码已存在!"); | |||
} | |||
Pztj_StockInfoEntity entity = input.Adapt<Pztj_StockInfoEntity>(); | |||
var res = await _dbContext.Updateable(entity).IgnoreColumns(true).ExecuteCommandHasChangeAsync(); | |||
return res; | |||
} | |||
} | |||
} |
@@ -1,41 +1,47 @@ | |||
namespace BPA.MES.Base.Application.Services | |||
namespace BPA.MES.Base.Application.Services.Template | |||
{ | |||
/// <summary> | |||
/// 名 称 : 料仓服务 | |||
/// 名 称 : | |||
/// 创 建 人 :yangxiao | |||
/// 创建时间 : 2023/7/17 15:27:20 | |||
/// 创建时间 : 2023/7/31 18:04:53 | |||
/// 描 述 : | |||
/// </summary> | |||
public class StockInfoDto | |||
public class TemplateDto | |||
{ | |||
/// <summary> | |||
/// 料仓编码 | |||
/// </summary> | |||
public string Code { get; set; } | |||
/// <summary> | |||
/// 料仓名称 | |||
/// 名称 | |||
/// </summary> | |||
public string Name { get; set; } | |||
/// <summary> | |||
/// 物料Id | |||
/// 编码 | |||
/// </summary> | |||
public string MaterialId { get; set; } | |||
public string Code { get; set; } | |||
/// <summary> | |||
/// 料仓容积 | |||
/// 描述 | |||
/// </summary> | |||
public string Volume { get; set; } | |||
public string Des { get; set; } | |||
} | |||
/// <summary> | |||
/// 增加 | |||
/// </summary> | |||
public class StockInfoAddInput : StockInfoDto | |||
public class TemplateAddInput: TemplateDto | |||
{ | |||
} | |||
/// <summary> | |||
/// 更新 | |||
/// 修改 | |||
/// </summary> | |||
public class TemplateUpdateInput : TemplateDto | |||
{ | |||
/// <summary> | |||
/// 主键 | |||
/// </summary> | |||
public string Id { get; set; } | |||
} | |||
/// <summary> | |||
/// 刪除 | |||
/// </summary> | |||
public class StockInfoUpdateInput : StockInfoDto | |||
public class TemplateDelInput | |||
{ | |||
/// <summary> | |||
/// 主键 | |||
@@ -43,9 +49,9 @@ | |||
public string Id { get; set; } | |||
} | |||
/// <summary> | |||
/// 删除 | |||
/// 普通查询条件 | |||
/// </summary> | |||
public class StockInfoDelInput | |||
public class TemplateQueryInput | |||
{ | |||
/// <summary> | |||
/// 主键 | |||
@@ -53,10 +59,11 @@ | |||
public string Id { get; set; } | |||
} | |||
/// <summary> | |||
/// 分页 | |||
/// 分页查询条件 | |||
/// </summary> | |||
public class StockInfoQueryPageInput : RequestPage | |||
public class TemplateQueryPageInput : RequestPage | |||
{ | |||
/// <summary> | |||
/// 名称 | |||
/// </summary> | |||
@@ -69,15 +76,12 @@ | |||
/// <summary> | |||
/// 输出 | |||
/// </summary> | |||
public class StockInfoOutput : StockInfoDto | |||
public class TemplateOutput: TemplateDto | |||
{ | |||
/// <summary> | |||
/// 主键 | |||
/// </summary> | |||
public string Id { get; set; } | |||
/// <summary> | |||
/// 物料Name | |||
/// </summary> | |||
public string MaterialName { get; set; } | |||
//下面增加多的数据 | |||
} | |||
} |
@@ -1,38 +1,44 @@ | |||
namespace BPA.MES.Base.Application.Services | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
using System.Text; | |||
using System.Threading.Tasks; | |||
namespace BPA.MES.Base.Application.Services.Template | |||
{ | |||
/// <summary> | |||
/// 名 称 : | |||
/// 创 建 人 :yangxiao | |||
/// 创建时间 : 2023/7/17 15:43:10 | |||
/// 创建时间 : 2023/7/31 18:02:57 | |||
/// 描 述 : | |||
/// </summary> | |||
public interface IBucketInfoService | |||
public interface ITemplateService | |||
{ | |||
/// <summary> | |||
/// 增加 | |||
/// </summary> | |||
/// <returns></returns> | |||
Task<bool> Add(BucketInfoAddInput input); | |||
Task<bool> Add(TemplateAddInput input); | |||
/// <summary> | |||
/// 移除 | |||
/// 删除 | |||
/// </summary> | |||
/// <returns></returns> | |||
Task<bool> Del(BucketInfoDelInput input); | |||
Task<bool> Del(TemplateDelInput input); | |||
/// <summary> | |||
/// 更新 | |||
/// </summary> | |||
/// <returns></returns> | |||
Task<bool> Update(BucketInfoUpdateInput input); | |||
Task<bool> Update(TemplateUpdateInput input); | |||
/// <summary> | |||
/// 不分页列表 | |||
/// </summary> | |||
/// <returns></returns> | |||
Task<List<BucketInfoOutput>> List(); | |||
Task<List<TemplateOutput>> List(TemplateQueryInput input); | |||
/// <summary> | |||
/// 分页列表 | |||
/// </summary> | |||
/// <returns></returns> | |||
Task<SqlSugarPagedList<BucketInfoOutput>> PagedList(BucketInfoQueryPageInput input); | |||
Task<SqlSugarPagedList<TemplateOutput>> PagedList(TemplateQueryPageInput input); | |||
/// <summary> | |||
/// 下拉列表 | |||
/// </summary> | |||
@@ -43,6 +49,6 @@ | |||
/// </summary> | |||
/// <param name="Id"></param> | |||
/// <returns></returns> | |||
Task<BucketInfoOutput> Detail(string Id); | |||
Task<TemplateOutput> Detail(string Id); | |||
} | |||
} |
@@ -1,16 +1,16 @@ | |||
namespace BPA.MES.Base.Application.Services | |||
namespace BPA.MES.Base.Application.Services.Template | |||
{ | |||
/// <summary> | |||
/// 名 称 :工艺路线服务 | |||
/// 名 称 : | |||
/// 创 建 人 :yangxiao | |||
/// 创建时间 :2023/3/2 16:11:04 | |||
/// 描 述 :CraftsInfo 工艺管理 CraftsSteps工艺步骤管理 | |||
/// 创建时间 : 2023/7/31 18:03:25 | |||
/// 描 述 : | |||
/// </summary> | |||
[ApiDescriptionSettings("配方工艺管理", Order = 0, Tag = "工艺服务", Name = "CraftsSteps", KeepName = true, SplitCamelCase = true, KeepVerb = true)] | |||
public class CraftsStepsService : ICraftsStepsService, ITransient, IDynamicApiController | |||
[ApiDescriptionSettings("我是分组名称-模板", Name = "Template", Tag = "我的名字叫模板", KeepName = true, SplitCamelCase = true, KeepVerb = true)] | |||
public class TemplateService : ITemplateService, ITransient, IDynamicApiController | |||
{ | |||
private readonly ISqlSugarClient _dbContext; | |||
public CraftsStepsService(ISqlSugarClient db) | |||
public TemplateService(ISqlSugarClient db) | |||
{ | |||
_dbContext = db; | |||
} | |||
@@ -20,14 +20,14 @@ | |||
/// <param name="input"></param> | |||
/// <returns></returns> | |||
[HttpPost] | |||
public async Task<bool> Add(CraftsStepsAddInput input) | |||
public async Task<bool> Add(TemplateAddInput input) | |||
{ | |||
var r_entity = await _dbContext.Queryable<Pztj_CraftStepsEntity>().FirstAsync(x => x.Name == input.Name); | |||
var r_entity = await _dbContext.Queryable<TemplateEntity>().FirstAsync(x => x.Name == input.Name); | |||
if (r_entity != null) | |||
{ | |||
throw Oops.Bah("名称已存在!"); | |||
} | |||
Pztj_CraftStepsEntity entity = input.Adapt<Pztj_CraftStepsEntity>(); | |||
TemplateEntity entity = input.Adapt<TemplateEntity>(); | |||
return await _dbContext.Insertable(entity).IgnoreColumns(ignoreNullColumn: true).ExecuteCommandIdentityIntoEntityAsync(); | |||
} | |||
/// <summary> | |||
@@ -37,9 +37,9 @@ | |||
/// <returns></returns> | |||
/// <exception cref="NotImplementedException"></exception> | |||
[HttpPost] | |||
public async Task<bool> Del(CraftsStepsDelInput input) | |||
public async Task<bool> Del(TemplateDelInput input) | |||
{ | |||
var res = await _dbContext.Deleteable<Pztj_CraftStepsEntity>().Where(x => x.Id == input.Id).ExecuteCommandHasChangeAsync(); | |||
var res = await _dbContext.Deleteable<TemplateEntity>().Where(x => x.Id == input.Id).ExecuteCommandHasChangeAsync(); | |||
return res; | |||
} | |||
/// <summary> | |||
@@ -49,10 +49,10 @@ | |||
/// <returns></returns> | |||
/// <exception cref="NotImplementedException"></exception> | |||
[HttpGet] | |||
public async Task<CraftsStepsOutput> Detail(string Id) | |||
public async Task<TemplateOutput> Detail(string Id) | |||
{ | |||
var entity = await _dbContext.Queryable<Pztj_CraftStepsEntity>().FirstAsync(x => x.Id == Id); | |||
CraftsStepsOutput output = entity.Adapt<CraftsStepsOutput>(); | |||
var entity = await _dbContext.Queryable<TemplateEntity>().FirstAsync(x => x.Id == Id); | |||
TemplateOutput output = entity.Adapt<TemplateOutput>(); | |||
return output; | |||
} | |||
/// <summary> | |||
@@ -60,11 +60,11 @@ | |||
/// </summary> | |||
/// <returns></returns> | |||
/// <exception cref="NotImplementedException"></exception> | |||
[HttpGet] | |||
public async Task<List<CraftsStepsOutput>> List() | |||
[HttpPost] | |||
public async Task<List<TemplateOutput>> List(TemplateQueryInput input) | |||
{ | |||
var entity = await _dbContext.Queryable<Pztj_CraftStepsEntity>().ToListAsync(); | |||
List<CraftsStepsOutput> output = entity.Adapt<List<CraftsStepsOutput>>(); | |||
var entity = await _dbContext.Queryable<TemplateEntity>().ToListAsync(); | |||
List<TemplateOutput> output = entity.Adapt<List<TemplateOutput>>(); | |||
return output; | |||
} | |||
/// <summary> | |||
@@ -73,13 +73,13 @@ | |||
/// <param name="input"></param> | |||
/// <returns></returns> | |||
[HttpPost] | |||
public async Task<SqlSugarPagedList<CraftsStepsOutput>> PagedList(CraftsStepsQueryPageInput input) | |||
public async Task<SqlSugarPagedList<TemplateOutput>> PagedList(TemplateQueryPageInput input) | |||
{ | |||
var entity = await _dbContext.Queryable<Pztj_CraftStepsEntity>() | |||
var entity = await _dbContext.Queryable<TemplateEntity>() | |||
.WhereIF(!string.IsNullOrEmpty(input.Name), x => x.Name.Contains(input.Name)) | |||
.WhereIF(!string.IsNullOrEmpty(input.CraftId), x => x.CraftId == input.CraftId) | |||
.WhereIF(!string.IsNullOrEmpty(input.Code), x => x.Code.Contains(input.Code)) | |||
.ToPagedListAsync(input.PageIndex, input.PageSize); | |||
SqlSugarPagedList<CraftsStepsOutput> output = entity.Adapt<SqlSugarPagedList<CraftsStepsOutput>>(); | |||
SqlSugarPagedList<TemplateOutput> output = entity.Adapt<SqlSugarPagedList<TemplateOutput>>(); | |||
return output; | |||
} | |||
/// <summary> | |||
@@ -90,7 +90,7 @@ | |||
[HttpGet] | |||
public async Task<dynamic> SelectList() | |||
{ | |||
var entity = await _dbContext.Queryable<Pztj_CraftStepsEntity>().Select(x => new | |||
var entity = await _dbContext.Queryable<TemplateEntity>().Select(x => new | |||
{ | |||
key = x.Id, | |||
value = x.Name | |||
@@ -104,17 +104,12 @@ | |||
/// <returns></returns> | |||
/// <exception cref="NotImplementedException"></exception> | |||
[HttpPost] | |||
public async Task<bool> Update(CraftsStepsUpdateInput input) | |||
public async Task<bool> Update(TemplateUpdateInput input) | |||
{ | |||
var isExit =await _dbContext.Queryable<Pztj_CraftStepsEntity>().Where(x => x.Id != input.Id && x.Name == input.Name).FirstAsync(); | |||
if (isExit != null) | |||
{ | |||
throw Oops.Bah("名称或编码已存在!"); | |||
} | |||
Pztj_CraftStepsEntity entity = input.Adapt<Pztj_CraftStepsEntity>(); | |||
var entity = await _dbContext.Queryable<TemplateEntity>().Where(x => x.Id == input.Id).FirstAsync(); | |||
entity = input.Adapt<TemplateEntity>(); | |||
var res = await _dbContext.Updateable(entity).IgnoreColumns(true).ExecuteCommandHasChangeAsync(); | |||
return res; | |||
} | |||
} | |||
} | |||
@@ -124,14 +124,9 @@ | |||
public WorkInfoDetailOutput() | |||
{ | |||
CraftList = new(); | |||
MaterialList = new(); | |||
} | |||
/// <summary> | |||
/// 工艺步骤 | |||
/// </summary> | |||
public List<Pztj_CraftStepsEntity> CraftList { get; set; } | |||
/// <summary> | |||
/// 物料信息 | |||
/// </summary> | |||
public List<RecipeMaterialEntity> MaterialList { get; set; } | |||
@@ -27,12 +27,12 @@ namespace BPA.MES.Base.Application.Services.WorkInfoService.Services | |||
public async Task<bool> Add(WorkInfoAddInput input) | |||
{ | |||
bool result = false; | |||
Pztj_WorkInfoEntity entity = input.Adapt<Pztj_WorkInfoEntity>(); | |||
WorkInfoEntity entity = input.Adapt<WorkInfoEntity>(); | |||
try | |||
{ | |||
_dbContext.Ado.BeginTran(); | |||
await _dbContext.Insertable(entity).IgnoreColumns(ignoreNullColumn: true).ExecuteCommandAsync(); | |||
Pztj_WorkInfoStatusEntity pztj_WorkInfoStatusEntity = new() | |||
WorkInfoStatusEntity pztj_WorkInfoStatusEntity = new() | |||
{ | |||
Status = WorkOrderStatusEnum.Draft, | |||
WorkId = entity.Id | |||
@@ -57,7 +57,7 @@ namespace BPA.MES.Base.Application.Services.WorkInfoService.Services | |||
[HttpPost] | |||
public async Task<bool> Del(WorkInfoDelInput input) | |||
{ | |||
var res = await _dbContext.Deleteable<Pztj_WorkInfoEntity>().Where(x => x.Id == input.Id).ExecuteCommandHasChangeAsync(); | |||
var res = await _dbContext.Deleteable<WorkInfoEntity>().Where(x => x.Id == input.Id).ExecuteCommandHasChangeAsync(); | |||
return res; | |||
} | |||
/// <summary> | |||
@@ -69,10 +69,10 @@ namespace BPA.MES.Base.Application.Services.WorkInfoService.Services | |||
[HttpGet] | |||
public async Task<WorkInfoDetailOutput> Detail(string Id) | |||
{ | |||
var entity = await _dbContext.Queryable<Pztj_WorkInfoEntity>() | |||
.LeftJoin<Pztj_FinalsInfoEntity>((a, b) => a.FinalId == b.Id) | |||
var entity = await _dbContext.Queryable<WorkInfoEntity>() | |||
.LeftJoin<FinalInfoEntity>((a, b) => a.FinalId == b.Id) | |||
.LeftJoin<ProductLineEntity>((a, b, c) => a.LineId == c.Id) | |||
.LeftJoin<Pztj_WorkInfoStatusEntity>((a, b, c, d) => d.Id == SqlFunc.Subqueryable<Pztj_WorkInfoStatusEntity>().Where(s => s.WorkId == a.Id).OrderByDesc(s => s.CreateTime).Select(s => s.Id)) | |||
.LeftJoin<WorkInfoStatusEntity>((a, b, c, d) => d.Id == SqlFunc.Subqueryable<WorkInfoStatusEntity>().Where(s => s.WorkId == a.Id).OrderByDesc(s => s.CreateTime).Select(s => s.Id)) | |||
.Where((a, b, c, d) => a.Id == Id) | |||
.Select((a, b, c, d) => new WorkInfoDetailOutput | |||
{ | |||
@@ -85,18 +85,6 @@ namespace BPA.MES.Base.Application.Services.WorkInfoService.Services | |||
{ | |||
throw Oops.Bah("没有找到工单信息!"); | |||
} | |||
//获取成品信息 | |||
var finainfo = await _dbContext.Queryable<Pztj_FinalsInfoEntity>().FirstAsync(x => x.Id == entity.FinalId); | |||
if (finainfo==null) | |||
{ | |||
throw Oops.Bah("没有找到成品信息!"); | |||
} | |||
//获取工艺步骤 | |||
var craftlist = await _dbContext.Queryable<Pztj_CraftStepsEntity>().Where(x => x.CraftId == finainfo.CraftId).ToListAsync(); | |||
//获取物料信息 | |||
var materiallist = await _dbContext.Queryable<RecipeMaterialEntity>().Where(x => x.RecipesId == finainfo.RecipeId).ToListAsync(); | |||
entity.CraftList = craftlist; | |||
entity.MaterialList = materiallist; | |||
return entity; | |||
} | |||
/// <summary> | |||
@@ -107,10 +95,10 @@ namespace BPA.MES.Base.Application.Services.WorkInfoService.Services | |||
[HttpGet] | |||
public async Task<List<WorkInfoOutput>> List(WorkInfoQueryInput input) | |||
{ | |||
var entity = await _dbContext.Queryable<Pztj_WorkInfoEntity>() | |||
.LeftJoin<Pztj_FinalsInfoEntity>((a, b) => a.FinalId == b.Id) | |||
var entity = await _dbContext.Queryable<WorkInfoEntity>() | |||
.LeftJoin<FinalInfoEntity>((a, b) => a.FinalId == b.Id) | |||
.LeftJoin<ProductLineEntity>((a, b, c) => a.LineId == c.Id) | |||
.LeftJoin<Pztj_WorkInfoStatusEntity>((a, b, c, d) => d.Id == SqlFunc.Subqueryable<Pztj_WorkInfoStatusEntity>().Where(s => s.WorkId == a.Id).OrderByDesc(s => s.CreateTime).Select(s => s.Id)) | |||
.LeftJoin<WorkInfoStatusEntity>((a, b, c, d) => d.Id == SqlFunc.Subqueryable<WorkInfoStatusEntity>().Where(s => s.WorkId == a.Id).OrderByDesc(s => s.CreateTime).Select(s => s.Id)) | |||
.WhereIF(!string.IsNullOrEmpty(input.Name), (a, b, c, d) => b.Name.Contains(input.Name)) | |||
.WhereIF(!string.IsNullOrEmpty(input.Id), (a, b, c, d) => a.Id.Contains(input.Id)) | |||
.Select((a, b, c, d) => new WorkInfoOutput | |||
@@ -130,10 +118,10 @@ namespace BPA.MES.Base.Application.Services.WorkInfoService.Services | |||
[HttpPost] | |||
public async Task<SqlSugarPagedList<WorkInfoOutput>> PagedList(WorkInfoQueryPageInput input) | |||
{ | |||
var entity = await _dbContext.Queryable<Pztj_WorkInfoEntity>() | |||
.LeftJoin<Pztj_FinalsInfoEntity>((a, b) => a.FinalId == b.Id) | |||
var entity = await _dbContext.Queryable<WorkInfoEntity>() | |||
.LeftJoin<FinalInfoEntity>((a, b) => a.FinalId == b.Id) | |||
.LeftJoin<ProductLineEntity>((a, b, c) => a.LineId == c.Id) | |||
.LeftJoin<Pztj_WorkInfoStatusEntity>((a, b, c, d) => d.Id == SqlFunc.Subqueryable<Pztj_WorkInfoStatusEntity>().Where(s => s.WorkId == a.Id).OrderByDesc(s => s.CreateTime).Select(s => s.Id)) | |||
.LeftJoin<WorkInfoStatusEntity>((a, b, c, d) => d.Id == SqlFunc.Subqueryable<WorkInfoStatusEntity>().Where(s => s.WorkId == a.Id).OrderByDesc(s => s.CreateTime).Select(s => s.Id)) | |||
.WhereIF(!string.IsNullOrEmpty(input.Name), (a, b, c, d) => b.Name.Contains(input.Name)) | |||
.WhereIF(!string.IsNullOrEmpty(input.Id), (a, b, c, d) => a.Id.Contains(input.Id)) | |||
.Select((a, b, c, d) => new WorkInfoOutput | |||
@@ -162,7 +150,7 @@ namespace BPA.MES.Base.Application.Services.WorkInfoService.Services | |||
WorkId = workId, | |||
Status = WorkOrderStatusEnum.Issued | |||
}); | |||
var entity = await _dbContext.Queryable<Pztj_WorkInfoEntity>().FirstAsync(x => x.Id == workId); | |||
var entity = await _dbContext.Queryable<WorkInfoEntity>().FirstAsync(x => x.Id == workId); | |||
if (res) | |||
{ | |||
await _MQTTService.MqttPublish(entity, Topics.WorkOrderPush, MessageID.WorkOrderIssued); | |||
@@ -177,7 +165,7 @@ namespace BPA.MES.Base.Application.Services.WorkInfoService.Services | |||
[HttpGet] | |||
public async Task<dynamic> SelectList() | |||
{ | |||
var entity = await _dbContext.Queryable<Pztj_WorkInfoEntity>().Select(x => new | |||
var entity = await _dbContext.Queryable<WorkInfoEntity>().Select(x => new | |||
{ | |||
key = x.Id, | |||
value = x.Name | |||
@@ -193,7 +181,7 @@ namespace BPA.MES.Base.Application.Services.WorkInfoService.Services | |||
[HttpPost] | |||
public async Task<bool> Update(WorkInfoUpdateInput input) | |||
{ | |||
Pztj_WorkInfoEntity entity = input.Adapt<Pztj_WorkInfoEntity>(); | |||
WorkInfoEntity entity = input.Adapt<WorkInfoEntity>(); | |||
var res = await _dbContext.Updateable(entity).IgnoreColumns(true).ExecuteCommandHasChangeAsync(); | |||
return res; | |||
} | |||
@@ -206,7 +194,7 @@ namespace BPA.MES.Base.Application.Services.WorkInfoService.Services | |||
[HttpPost] | |||
public async Task<bool> UpdateStatus(WorkInfoStatusUpdateInput input) | |||
{ | |||
Pztj_WorkInfoStatusEntity entity = input.Adapt<Pztj_WorkInfoStatusEntity>(); | |||
WorkInfoStatusEntity entity = input.Adapt<WorkInfoStatusEntity>(); | |||
var res = await _dbContext.Insertable(entity).IgnoreColumns(true).ExecuteCommandIdentityIntoEntityAsync(); | |||
return res; | |||
} | |||
@@ -218,7 +206,7 @@ namespace BPA.MES.Base.Application.Services.WorkInfoService.Services | |||
[HttpPost] | |||
public async Task<bool> ForcedEnd(string workId) | |||
{ | |||
Pztj_WorkInfoStatusEntity entity = new() | |||
WorkInfoStatusEntity entity = new() | |||
{ | |||
WorkId = workId, | |||
Status = WorkOrderStatusEnum.Completed | |||
@@ -234,7 +222,7 @@ namespace BPA.MES.Base.Application.Services.WorkInfoService.Services | |||
[HttpGet] | |||
public async Task<List<WorkInfoStatusOutput>> StatusList(string workId) | |||
{ | |||
var entitys = await _dbContext.Queryable<Pztj_WorkInfoStatusEntity>().Where(x => x.WorkId == workId).ToListAsync(); | |||
var entitys = await _dbContext.Queryable<WorkInfoStatusEntity>().Where(x => x.WorkId == workId).ToListAsync(); | |||
List<WorkInfoStatusOutput> list = entitys.Adapt<List<WorkInfoStatusOutput>>(); | |||
return list; | |||
} | |||
@@ -22,7 +22,7 @@ | |||
"environmentVariables": { | |||
"ASPNETCORE_ENVIRONMENT": "Development" | |||
}, | |||
"applicationUrl": "http://192.168.1.243:5002", | |||
"applicationUrl": "http://localhost:5000", | |||
"dotnetRunMessages": true | |||
}, | |||
"Docker": { | |||
@@ -10,7 +10,7 @@ | |||
"AllowedHosts": "*", | |||
"ConnectionConfigs": [ | |||
{ | |||
"ConnectionString": "server=10.2.1.254;Port=3306;Database=bpa_pztj_mes;Uid=root;Pwd=BapAdmin123456.;", | |||
"ConnectionString": "server=10.2.1.254;Port=3306;Database=bpa_jxj_mes;Uid=root;Pwd=BapAdmin123456.;", | |||
"DbType": "MySql", | |||
"IsAutoCloseConnection": true | |||
} | |||
@@ -9,19 +9,19 @@ const Settings: LayoutSettings & { | |||
title?:any | |||
} = { | |||
navTheme: 'light', | |||
colorPrimary: '#13C2C2', | |||
colorPrimary: '#1890ff', | |||
layout: 'mix', | |||
contentWidth: 'Fluid', | |||
fixedHeader: false, | |||
fixSiderbar: true, | |||
colorWeak: false, | |||
title: "胖子天骄中控管理系统", | |||
title: "吉香居中控管理系统", | |||
menu: { | |||
locale: false, // 禁用多语言功能 | |||
}, | |||
pwa: false, | |||
splitMenus:false, | |||
logo: './logo.png', | |||
iconfontUrl: '', | |||
}; | |||
@@ -6,7 +6,7 @@ | |||
export default { | |||
dev: { | |||
'/api/': { | |||
target: 'http://192.168.1.243:5002', | |||
target: 'http://localhost:5000', | |||
pathRewrite: { | |||
'/api': '/api' | |||
}, | |||
@@ -5,48 +5,36 @@ | |||
{ | |||
icon: 'SettingOutlined', | |||
path: '/system', | |||
locale:false, | |||
name: '系统管理', | |||
routes: [ | |||
{ path: '/system/account', name: '账号管理', component: './system/account' }, | |||
{ path: '/system/account', name: '账号管理', locale:false, component: './system/account' }, | |||
{ path: '/system/user', name: '人员管理', component: './system/user' }, | |||
{ path: '/system/role', name: '角色管理', component: './system/role' }, | |||
{ path: '/system/module', name: '模块管理', component: './system/module' }, | |||
{ path: '/system/authTemplate', name: '权限管理', component: './system/authTemplate' }, | |||
{ path: '/system/role', name: '角色管理',locale:false, component: './system/role' }, | |||
{ path: '/system/module', name: '模块管理', locale:false,component: './system/module' }, | |||
{ path: '/system/authTemplate', name: '权限管理',locale:false, component: './system/authTemplate' }, | |||
], | |||
}, | |||
{ | |||
path: '/base', icon: 'SettingOutlined', name: '基础数据管理', | |||
routes: [{ path: '/base/deviceinfo', name: '设备管理', component: './deviceInfo/index' }, | |||
{ path: '/base/stock', name: '料仓管理', component: './stock/index' }, | |||
{ path: '/base/materials', name: '原料管理', component: './materials/index' }, | |||
{ path: '/base/bucket', name: '桶管理', component: './bucket/index' }, | |||
{ path: '/base/final', name: '成品管理', component: './final/index' }, | |||
] | |||
}, | |||
{ | |||
path: '/line', icon: 'SettingOutlined', name: '产线管理', | |||
routes: [ | |||
{ path: '/line/manufacturing', name: '产线设备管理', component: './manufacturing/index' }, | |||
{ path: '/line/group', name: '分组', component: './group/index' } | |||
] | |||
}, | |||
{ | |||
path: '/recipeCraft', icon: 'SettingOutlined', name: '配方工艺管理', | |||
icon: 'SettingOutlined', | |||
path: '/model', | |||
locale:false, | |||
name: '工厂建模', | |||
routes: [ | |||
{ path: '/recipeCraft/recipe', name: '配方管理', component: './recipe/index' }, | |||
{ path: '/recipeCraft/pot', name: '炒锅工艺', component: './craftInfo/pot' }, | |||
{ path: '/recipeCraft/kettle', name: '反应釜工艺', component: './craftInfo/kettle' } | |||
] | |||
{ path: '/model/product', name: '产品', component: './template' }, | |||
{ path: '/model/material', name: '物料', component: './template' }, | |||
{ path: '/model/recipe', name: '配方管理', component: './template' }, | |||
], | |||
}, | |||
{ path: '/work', icon: 'SettingOutlined', name: '工单管理', component: './workInfo/index' }, | |||
{ | |||
path: '/data', icon: 'SettingOutlined', name: '数据服务', | |||
icon: 'SettingOutlined', | |||
path: '/turn', | |||
name: '生产管理', | |||
routes: [ | |||
{ path: '/data/log1', name: '操作日志', component: './logs/index' }, | |||
{ path: '/data/log2', name: '运行日志', component: './logs/index' }, | |||
{ path: '/data/log3', name: '报警日志', component: './logs/index' }, | |||
{ path: '/data/log4', name: '数据采集', component: './logs/index' } | |||
] | |||
{ path: '/turn/order', name: '产品', component: './template' }, | |||
{ path: '/turn/board', name: '物料', component: './template' }, | |||
{ path: '/turn/materialBom', name: '配方管理', component: './template' }, | |||
], | |||
}, | |||
{ path: '*', layout: false, component: './404' }, | |||
]; |
@@ -49,7 +49,7 @@ | |||
], | |||
"dependencies": { | |||
"@ant-design/icons": "^4.8.0", | |||
"@ant-design/pro-components": "^2.3.44", | |||
"@ant-design/pro-components": "^2.6.10", | |||
"@ant-design/pro-layout": "^7.8.3", | |||
"@ant-design/use-emotion-css": "1.0.4", | |||
"@umijs/route-utils": "^2.2.2", | |||
@@ -1,132 +0,0 @@ | |||
import { request } from '@umijs/max'; | |||
export default { | |||
/** | |||
* 新增 | |||
* @param parms | |||
* @returns | |||
*/ | |||
Add(parms: BucketTypes.Info) { | |||
return request('/api/bucketinfo/add', { | |||
method: 'POST', | |||
data: { | |||
...parms, | |||
}, | |||
}); | |||
}, | |||
/** | |||
* 删除 | |||
* @param parms | |||
* @returns | |||
*/ | |||
Del(parms: BucketTypes.BucketInfoDelInput) { | |||
return request(`/api/bucketinfo/del`, { | |||
method: 'POST', | |||
data: { | |||
...parms, | |||
}, | |||
}); | |||
}, | |||
/** | |||
* 修改 | |||
* @param parms | |||
* @returns | |||
*/ | |||
Update(parms: BucketTypes.Info) { | |||
return request('/api/bucketinfo/update', { | |||
method: 'POST', | |||
data: { | |||
...parms, | |||
}, | |||
}); | |||
}, | |||
/** | |||
* 详情 | |||
* @param parms | |||
* @returns | |||
*/ | |||
Detail(id: string) { | |||
return request(`/api/bucketinfo/detail?id=${id}`, { | |||
method: 'GET' | |||
}); | |||
}, | |||
/** | |||
* 获取列表 | |||
* @param parms | |||
* @returns | |||
*/ | |||
List() { | |||
return request('/api/bucketinfo/list', { | |||
method: 'POST' | |||
}); | |||
}, | |||
/** | |||
* 未绑定的设备列表 | |||
* @param parms | |||
* @returns | |||
*/ | |||
UnBindList() { | |||
return request('/api/bucketinfo/UnBindList', { | |||
method: 'GET' | |||
}); | |||
}, | |||
/** | |||
* 分页查询 | |||
* @param parms | |||
* @returns | |||
*/ | |||
PagedList(parms: BucketTypes.Page) { | |||
return request('/api/bucketinfo/pagedlist', { | |||
method: 'POST', | |||
data: { | |||
...parms, | |||
}, | |||
}); | |||
}, | |||
/** | |||
* 批量更新 | |||
* @param parms | |||
* @returns | |||
*/ | |||
BatchUpdate(parms: BucketTypes.BatchAdd) { | |||
return request('/api/bucketrecipe/batchupdate', { | |||
method: 'POST', | |||
data: parms | |||
}); | |||
}, | |||
/** | |||
* 根据设备Id查询配方信息 | |||
* @param parms | |||
* @returns | |||
*/ | |||
RecipeList(id: string){ | |||
return request('api/bucketrecipe/list', { | |||
method: 'POST', | |||
data: { | |||
bucketId: id | |||
} | |||
}); | |||
}, | |||
// 根据桶id查询桶的物料记录 | |||
materialtrecored(parms: BucketTypes.BucketMaterialsRecordQueryPageInput){ | |||
return request('/api/bucketmaterialsrecord/pagedlist',{ | |||
method: 'POST', | |||
data:{...parms} | |||
}) | |||
}, | |||
// materialtrecored(){ | |||
// return request('/api/bucketmaterialsrecord/list',{ | |||
// method: 'GET', | |||
// }) | |||
// } | |||
} | |||
@@ -1,119 +0,0 @@ | |||
import { request } from '@umijs/max'; | |||
export default { | |||
/** | |||
* 新增 | |||
* @param parms | |||
* @returns | |||
*/ | |||
Add(parms: DeviceTypes.Info) { | |||
return request('/api/devicesinfo/add', { | |||
method: 'POST', | |||
data: { | |||
...parms, | |||
}, | |||
}); | |||
}, | |||
/** | |||
* 删除 | |||
* @param parms | |||
* @returns | |||
*/ | |||
Del(parms: DeviceTypes.DeviceInfoDelInput) { | |||
return request(`/api/devicesinfo/del`, { | |||
method: 'POST', | |||
data: { | |||
...parms, | |||
}, | |||
}); | |||
}, | |||
/** | |||
* 修改 | |||
* @param parms | |||
* @returns | |||
*/ | |||
Update(parms: DeviceTypes.Info) { | |||
return request('/api/devicesinfo/update', { | |||
method: 'POST', | |||
data: { | |||
...parms, | |||
}, | |||
}); | |||
}, | |||
/** | |||
* 详情 | |||
* @param parms | |||
* @returns | |||
*/ | |||
Detail(id: string) { | |||
return request(`/api/devicesinfo/detail?id=${id}`, { | |||
method: 'GET' | |||
}); | |||
}, | |||
/** | |||
* 获取列表 | |||
* @param parms | |||
* @returns | |||
*/ | |||
List() { | |||
return request('/api/devicesinfo/list', { | |||
method: 'POST' | |||
}); | |||
}, | |||
/** | |||
* 未绑定的设备列表 | |||
* @param parms | |||
* @returns | |||
*/ | |||
UnBindList() { | |||
return request('/api/devicesinfo/UnBindList', { | |||
method: 'GET' | |||
}); | |||
}, | |||
/** | |||
* 分页查询 | |||
* @param parms | |||
* @returns | |||
*/ | |||
PagedList(parms: DeviceTypes.Page) { | |||
return request('/api/devicesinfo/pagedlist', { | |||
method: 'POST', | |||
data: { | |||
...parms, | |||
}, | |||
}); | |||
}, | |||
/** | |||
* 批量更新 | |||
* @param parms | |||
* @returns | |||
*/ | |||
BatchUpdate(parms: DeviceTypes.BatchAdd) { | |||
return request('/api/devicerecipe/batchupdate', { | |||
method: 'POST', | |||
data: parms | |||
}); | |||
}, | |||
/** | |||
* 根据设备Id查询配方信息 | |||
* @param parms | |||
* @returns | |||
*/ | |||
RecipeList(id: string){ | |||
return request(' api/devicerecipe/list', { | |||
method: 'POST', | |||
data: { | |||
deviceId: id | |||
} | |||
}); | |||
}, | |||
// 设备下拉 | |||
selectlist(){ | |||
return request('/api/devicesinfo/selectlist',{ | |||
method:'GET' | |||
}) | |||
} | |||
} |
@@ -1,334 +0,0 @@ | |||
import { request } from '@umijs/max'; | |||
export default { | |||
/** | |||
* 物料列表 | |||
* @param params | |||
* @returns | |||
*/ | |||
MaterialList(params: MaterialTypes.MaterialPageListParams) { | |||
return request('/erp/material/Material/GetMaterialPage', { | |||
method: 'POST', | |||
data: { | |||
...params | |||
} | |||
}); | |||
}, | |||
/** | |||
* 根据Id获取物料信息 | |||
* @param id | |||
*/ | |||
GetMaterialById(id: string) { | |||
return request(`/erp/material/Material/GetMaterialById?id=${id}`, { | |||
method: 'GET' | |||
}); | |||
}, | |||
/** | |||
* 新增物料 | |||
* @param params | |||
* @returns | |||
*/ | |||
AddMaterial(params: MaterialTypes.MaterialItemEA) { | |||
return request('/erp/material/Material/AddMaterial', { | |||
method: 'POST', | |||
data: { | |||
...params | |||
} | |||
}); | |||
}, | |||
/** | |||
* 修改物料 | |||
* @param params | |||
* @returns | |||
*/ | |||
UpdateMaterial(params: MaterialTypes.MaterialItemEA) { | |||
return request('/erp/material/Material/UpdateMaterial', { | |||
method: 'POST', | |||
data: { | |||
...params | |||
} | |||
}); | |||
}, | |||
/** | |||
* 修改物料价格 | |||
* @param params | |||
* @returns | |||
*/ | |||
UpdateMateriaPrice(params: MaterialTypes.MaterialPriceParams) { | |||
return request('/erp/material/Material/UpdateMateriaPrice', { | |||
method: 'POST', | |||
data: { | |||
...params | |||
} | |||
}); | |||
}, | |||
/** | |||
* 扩展属性分页列表 | |||
* @param params | |||
* @returns | |||
*/ | |||
GetExtendAttributePage(params: MaterialTypes.ExtendAttributePageParams) { | |||
return request('/erp/material/ExtendAttribute/GetExtendAttributePage', { | |||
method: 'POST', | |||
data: { | |||
...params | |||
} | |||
}); | |||
}, | |||
/** | |||
* 添加扩展属性 | |||
* @param params | |||
* @returns | |||
*/ | |||
AddExtendAttribute(params: MaterialTypes.ExtendAttributeItem) { | |||
return request('/erp/material/ExtendAttribute/AddExtendAttribute', { | |||
method: 'POST', | |||
data: { | |||
...params | |||
} | |||
}); | |||
}, | |||
/** | |||
* 修改扩展属性 | |||
* @param params | |||
*/ | |||
UpdateExtendAttribute(params: MaterialTypes.ExtendAttributeItem) { | |||
return request('/erp/material/ExtendAttribute/UpdateExtendAttribute', { | |||
method: 'POST', | |||
data: { | |||
...params | |||
} | |||
}); | |||
}, | |||
/** | |||
* 根据获取扩展属性id获取扩展属性 | |||
* @param id | |||
* @returns | |||
*/ | |||
GetExtendAttributeById(id: string) { | |||
return request(`/erp/material/ExtendAttribute/GetExtendAttributeById?id=${id}`, { | |||
method: 'GET' | |||
}); | |||
}, | |||
/** | |||
* 根据物料ID查询物料扩展属性列表 | |||
* @param materialId | |||
* @returns | |||
*/ | |||
GetMaterialExtendAttributeById(materialId: string) { | |||
return request(`/erp/material/MaterialExtend/GetMaterialExtendAttributeById?input=${materialId}`, { | |||
method: 'GET' | |||
}); | |||
}, | |||
/** | |||
* 新增物料的扩展属性信息 | |||
* @param params | |||
* @returns | |||
*/ | |||
AddMaterialExtendAttribute(params: MaterialTypes.MaterialExtendAttributeItem) { | |||
return request('/erp/material/MaterialExtend/AddMaterialExtendAttribute', { | |||
method: 'POST', | |||
data: { | |||
...params | |||
} | |||
}); | |||
}, | |||
/** | |||
* 编辑物料的扩展属性信息 | |||
* @param params | |||
*/ | |||
UpdateMaterialExtendAttribute(params: MaterialTypes.MaterialExtendAttributeItem) { | |||
return request('/erp/material/MaterialExtend/UpdateMaterialExtendAttribute', { | |||
method: 'POST', | |||
data: { | |||
...params | |||
} | |||
}); | |||
}, | |||
/** | |||
* 获取物料类型分页列表 | |||
* @param params | |||
*/ | |||
GetMaterialTypePage(params: MaterialTypes.MaterialTypeParams) { | |||
return request('/erp/material/MaterialType/GetMaterialTypePage', { | |||
method: 'POST', | |||
data: { | |||
...params | |||
} | |||
}); | |||
}, | |||
/** | |||
* 新增物料类型 | |||
* @param params | |||
* @returns | |||
*/ | |||
AddMaterialType(params: MaterialTypes.MaterialType) { | |||
return request('/erp/material/MaterialType/AddMaterialType', { | |||
method: 'POST', | |||
data: { | |||
...params | |||
} | |||
}); | |||
}, | |||
/** | |||
* 更新物料类型 | |||
* @param params | |||
* @returns | |||
*/ | |||
UpdateMaterialType(params: MaterialTypes.MaterialType) { | |||
return request('/erp/material/MaterialType/UpdateMaterialType', { | |||
method: 'POST', | |||
data: { | |||
...params | |||
} | |||
}); | |||
}, | |||
/** | |||
* 根据物料类型Id获取物料的拓展信息 | |||
* @param id | |||
*/ | |||
GetMaterialTypeExtendAttributeById(id: string) { | |||
return request(`/erp/material/MaterialType/GetMaterialTypeExtendAttributeById?Id=${id}`, { | |||
method: 'GET' | |||
}); | |||
}, | |||
/** | |||
* 新增物料类型的拓展信息 | |||
* @param params | |||
* @returns | |||
*/ | |||
AddMaterialTypeExtendAttribute(params: MaterialTypes.MaterialTypeExtend) { | |||
return request('/erp/material/MaterialTypeExtend/AddMaterialTypeExtendAttribute', { | |||
method: 'POST', | |||
data: { | |||
...params | |||
} | |||
}); | |||
}, | |||
/** | |||
* 更新物料类型扩展信息 | |||
* @param params | |||
* @returns | |||
*/ | |||
UpdateMaterialTypeExtendAttribute(params: MaterialTypes.MaterialTypeExtend) { | |||
return request('/erp/material/MaterialTypeExtend/UpdateMaterialTypeExtendAttribute', { | |||
method: 'POST', | |||
data: { | |||
...params | |||
} | |||
}); | |||
}, | |||
/** | |||
* 根据物料Id查询物料的修改记录 | |||
* @param params | |||
* @returns | |||
*/ | |||
MeterialModifyPage(params: MaterialTypes.MaterialModifyPageParams) { | |||
return request(`/erp/material/MeterialModify/MeterialModifyPage`, { | |||
method: 'POST', | |||
data: { | |||
...params | |||
} | |||
}); | |||
}, | |||
/** | |||
* 新增物料修改记录 | |||
* @param params | |||
* @returns | |||
*/ | |||
AddMeterialModify(params: MaterialTypes.MaterialModify) { | |||
return request('/erp/material/MeterialModify/AddMeterialModify', { | |||
method: 'POST', | |||
data: { | |||
...params | |||
} | |||
}); | |||
}, | |||
/** | |||
* 根据物料Id获取物料单位的换算列表 | |||
* @param id | |||
* @returns | |||
*/ | |||
GetUnitTransformationsById(id: string) { | |||
return request(`/erp/material/UnitTransformation/GetUnitTransformationsById?Id=${id}`, { | |||
method: 'GET' | |||
}); | |||
}, | |||
/** | |||
* 添加物料换算 | |||
* @param params | |||
* @returns | |||
*/ | |||
AddUnitTransformation(params: MaterialTypes.MaterialUnitTransform) { | |||
return request('/erp/material/UnitTransformation/AddUnitTransformation', { | |||
method: 'POST', | |||
data: { | |||
...params | |||
} | |||
}); | |||
}, | |||
/** | |||
* 编辑物料换算 | |||
* @param params | |||
* @returns | |||
*/ | |||
UpdateUnitTransformation(params: MaterialTypes.MaterialUnitTransform) { | |||
return request('/erp/material/UnitTransformation/UpdateUnitTransformation', { | |||
method: 'POST', | |||
data: { | |||
...params | |||
} | |||
}); | |||
}, | |||
/** | |||
* 导出物料模板 | |||
* @param materialTypeId | |||
* @returns | |||
*/ | |||
MaterialTemplateExport(materialTypeId: string) { | |||
return request(`/erp/material/Material/MaterialTemplateExport?materialTypeId=${materialTypeId}`, { | |||
method: 'GET', | |||
responseType: 'blob' | |||
}); | |||
}, | |||
/** | |||
* 导出物料数据 | |||
* @param params | |||
* @returns | |||
*/ | |||
MaterialDataExport(params: MaterialTypes.ExportMaterialParams) { | |||
return request('/erp/material/Material/MaterialDataExport', { | |||
method: 'POST', | |||
responseType: 'blob', | |||
data: { | |||
...params | |||
} | |||
}); | |||
} | |||
} |
@@ -1,119 +0,0 @@ | |||
import { request } from '@umijs/max'; | |||
export default { | |||
/** | |||
* 新增料仓 | |||
* @param parms | |||
* @returns | |||
*/ | |||
Add(parms: StockTypes.Info) { | |||
return request('/api/stockinfo/add', { | |||
method: 'POST', | |||
data: { | |||
...parms, | |||
}, | |||
}); | |||
}, | |||
/** | |||
* 删除 | |||
* @param parms | |||
* @returns | |||
*/ | |||
Del(parms: StockTypes.StockInfoDelInput) { | |||
return request(`/api/stockinfo/del`, { | |||
method: 'POST', | |||
data: { | |||
...parms, | |||
}, | |||
}); | |||
}, | |||
/** | |||
* 修改 | |||
* @param parms | |||
* @returns | |||
*/ | |||
Update(parms: StockTypes.Info) { | |||
return request('/api/stockinfo/update', { | |||
method: 'POST', | |||
data: { | |||
...parms, | |||
}, | |||
}); | |||
}, | |||
/** | |||
* 详情 | |||
* @param parms | |||
* @returns | |||
*/ | |||
Detail(id: string) { | |||
return request(`/api/stockinfo/detail?id=${id}`, { | |||
method: 'GET' | |||
}); | |||
}, | |||
/** | |||
* 获取列表 | |||
* @param parms | |||
* @returns | |||
*/ | |||
List() { | |||
return request('/api/stockinfo/list', { | |||
method: 'POST' | |||
}); | |||
}, | |||
/** | |||
* 未绑定的设备列表 | |||
* @param parms | |||
* @returns | |||
*/ | |||
UnBindList() { | |||
return request('/api/stockinfo/UnBindList', { | |||
method: 'GET' | |||
}); | |||
}, | |||
/** | |||
* 分页查询 | |||
* @param parms | |||
* @returns | |||
*/ | |||
PagedList(parms: StockTypes.Page) { | |||
return request('/api/stockinfo/pagedlist', { | |||
method: 'POST', | |||
data: { | |||
...parms, | |||
}, | |||
}); | |||
}, | |||
// /** | |||
// * 批量更新 | |||
// * @param parms | |||
// * @returns | |||
// */ | |||
// BatchUpdate(parms: StockTypes.BatchAdd) { | |||
// return request('/api/Stockrecipe/batchupdate', { | |||
// method: 'POST', | |||
// data: parms | |||
// }); | |||
// }, | |||
/** | |||
* 根据设备Id查询配方信息 | |||
* @param parms | |||
* @returns | |||
*/ | |||
RecipeList(id: string){ | |||
return request(' api/stockrecipe/list', { | |||
method: 'POST', | |||
data: { | |||
StockId: id | |||
} | |||
}); | |||
}, | |||
// 料仓下拉列表 | |||
selectlist(){ | |||
return request('/api/stockinfo/selectlist',{ | |||
method :'GET' | |||
}) | |||
} | |||
} |
@@ -0,0 +1,67 @@ | |||
declare namespace template { | |||
/** | |||
* 基类 | |||
*/ | |||
type base_dto = { | |||
/** | |||
* 编码 | |||
*/ | |||
code?: null | string; | |||
/** | |||
* 描述 | |||
*/ | |||
des?: null | string; | |||
/** | |||
* 名称 | |||
*/ | |||
name?: null | string; | |||
} | |||
/** | |||
* 增加输入参数 | |||
*/ | |||
type addInput = base_dto | |||
/** | |||
* 更新输入参数 | |||
*/ | |||
interface updateInput extends base_dto { | |||
/** | |||
* 主键 | |||
*/ | |||
id: string | |||
} | |||
/** | |||
* 删除输入参数 | |||
*/ | |||
interface delInput { | |||
/** | |||
* 主键 | |||
*/ | |||
id: string | |||
} | |||
/** | |||
* 查询输入参数 | |||
*/ | |||
interface queryParms { | |||
/** | |||
* 名称 | |||
*/ | |||
name?: null | string; | |||
} | |||
/** | |||
* 查询分页输入参数 | |||
*/ | |||
interface queryPage { | |||
pageIndex: number, | |||
pageSize: number, | |||
name:string | |||
} | |||
/** | |||
* 查询输出参数 | |||
*/ | |||
interface output extends base_dto { | |||
/** | |||
* 主键 | |||
*/ | |||
id: string | |||
} | |||
} |
@@ -0,0 +1,83 @@ | |||
import { request } from '@umijs/max'; | |||
export default { | |||
/** | |||
* 新增 | |||
* @param parms | |||
* @returns | |||
*/ | |||
Add(parms: template.addInput) { | |||
return request('/api/template/add', { | |||
method: 'POST', | |||
data: { | |||
...parms, | |||
}, | |||
}); | |||
}, | |||
/** | |||
* 删除 | |||
* @param parms | |||
* @returns | |||
*/ | |||
Del(parms: template.delInput) { | |||
return request(`/api/template/del`, { | |||
method: 'POST', | |||
data: { | |||
...parms, | |||
}, | |||
}); | |||
}, | |||
/** | |||
* 修改 | |||
* @param parms | |||
* @returns | |||
*/ | |||
Update(parms: template.updateInput) { | |||
return request('/api/template/update', { | |||
method: 'POST', | |||
data: { | |||
...parms, | |||
}, | |||
}); | |||
}, | |||
/** | |||
* 详情 | |||
* @param parms | |||
* @returns | |||
*/ | |||
Detail(id: string) { | |||
return request(`/api/template/detail?id=${id}`, { | |||
method: 'GET' | |||
}); | |||
}, | |||
/** | |||
* 获取列表 | |||
* @param parms | |||
* @returns | |||
*/ | |||
List(parms: template.queryParms) { | |||
return request('/api/template/list', { | |||
method: 'POST', | |||
data: { | |||
...parms, | |||
}, | |||
}); | |||
}, | |||
/** | |||
* 分页查询 | |||
* @param parms | |||
* @returns | |||
*/ | |||
PagedList(parms: template.queryPage) { | |||
return request('/api/template/pagedlist', { | |||
method: 'POST', | |||
data: { | |||
...parms, | |||
}, | |||
}); | |||
}, | |||
} | |||
@@ -1,125 +0,0 @@ | |||
import { Pztj_CraftStepsAddInput } from './../types/Crafts.d'; | |||
import { request } from '@umijs/max'; | |||
// 工艺 | |||
export default { | |||
/** | |||
* 新增 | |||
* @param parms | |||
* @returns | |||
*/ | |||
Add(parms: CraftsTypes.Info) { | |||
return request('/api/craftsinfo/add', { | |||
method: 'POST', | |||
data: { | |||
...parms, | |||
}, | |||
}); | |||
}, | |||
/** | |||
* 删除 | |||
* @param parms | |||
* @returns | |||
*/ | |||
Del(parms: CraftsTypes.craftsInfoDelInput) { | |||
return request(`/api/craftsinfo/del`, { | |||
method: 'POST', | |||
data: { | |||
...parms, | |||
}, | |||
}); | |||
}, | |||
/** | |||
* 修改 | |||
* @param parms | |||
* @returns | |||
*/ | |||
Update(parms: CraftsTypes.Info) { | |||
return request('/api/craftsinfo/update', { | |||
method: 'POST', | |||
data: { | |||
...parms, | |||
}, | |||
}); | |||
}, | |||
/** | |||
* 详情 | |||
* @param parms | |||
* @returns | |||
*/ | |||
Detail(id: string) { | |||
return request(`/api/craftsinfo/detail?id=${id}`, { | |||
method: 'GET' | |||
}); | |||
}, | |||
/** | |||
* 获取列表 | |||
* @param parms | |||
* @returns | |||
*/ | |||
List() { | |||
return request('/api/craftsinfo/list', { | |||
method: 'POST' | |||
}); | |||
}, | |||
/** | |||
* 未绑定的设备列表 | |||
* @param parms | |||
* @returns | |||
*/ | |||
UnBindList() { | |||
return request('/api/craftsinfo/UnBindList', { | |||
method: 'GET' | |||
}); | |||
}, | |||
/** | |||
* 分页查询 | |||
* @param parms | |||
* @returns | |||
*/ | |||
PagedList(parms: CraftsTypes.Page) { | |||
return request('/api/craftsinfo/pagedlist', { | |||
method: 'POST', | |||
data: { | |||
...parms, | |||
}, | |||
}); | |||
}, | |||
/** | |||
* 批量更新 | |||
* @param parms | |||
* @returns | |||
*/ | |||
BatchUpdate(parms: CraftsTypes.BatchAdd) { | |||
return request('/api/craftsrecipe/batchupdate', { | |||
method: 'POST', | |||
data: parms | |||
}); | |||
}, | |||
// 下拉 | |||
selectlist() { | |||
return request('/api/craftsinfo/selectlist', { | |||
method: 'GET', | |||
}) | |||
}, | |||
BatchAdd(parms :CraftsTypes.Pztj_CraftStepsAddInput[]){ | |||
return request('',{ | |||
method: 'POST', | |||
data:{...parms} | |||
}) | |||
}, | |||
//根据工艺查询步骤 | |||
craftsStepPage(parms: CraftsTypes.Pztj_CraftStepsPageInput){ | |||
return request(`/api/craftssteps/pagedlist`, { | |||
method: 'POST', | |||
data:{...parms} | |||
}) | |||
} | |||
} | |||
@@ -1,123 +0,0 @@ | |||
import { request } from '@umijs/max'; | |||
export default { | |||
/** | |||
* 新增 | |||
* @param parms | |||
* @returns | |||
*/ | |||
Add(parms: FinalTypes.Info) { | |||
return request('/api/finalsinfo/add', { | |||
method: 'POST', | |||
data: { | |||
...parms, | |||
}, | |||
}); | |||
}, | |||
/** | |||
* 删除 | |||
* @param parms | |||
* @returns | |||
*/ | |||
Del(parms: FinalTypes.FinalInfoDelInput) { | |||
return request(`/api/finalsinfo/del`, { | |||
method: 'POST', | |||
data: { | |||
...parms, | |||
}, | |||
}); | |||
}, | |||
/** | |||
* 修改 | |||
* @param parms | |||
* @returns | |||
*/ | |||
Update(parms: FinalTypes.Info) { | |||
return request('/api/finalsinfo/update', { | |||
method: 'POST', | |||
data: { | |||
...parms, | |||
}, | |||
}); | |||
}, | |||
/** | |||
* 详情 | |||
* @param parms | |||
* @returns | |||
*/ | |||
Detail(id: string) { | |||
return request(`/api/finalsinfo/detail?id=${id}`, { | |||
method: 'GET' | |||
}); | |||
}, | |||
/** | |||
* 获取列表 | |||
* @param parms | |||
* @returns | |||
*/ | |||
List() { | |||
return request('/api/finalsinfo/list', { | |||
method: 'POST' | |||
}); | |||
}, | |||
/** | |||
* 获取列表 | |||
* @param parms | |||
* @returns | |||
*/ | |||
SelectList() { | |||
return request('/api/finalsinfo/selectlist', { | |||
method: 'GET' | |||
}); | |||
}, | |||
/** | |||
* 未绑定的设备列表 | |||
* @param parms | |||
* @returns | |||
*/ | |||
UnBindList() { | |||
return request('/api/finalsinfo/UnBindList', { | |||
method: 'GET' | |||
}); | |||
}, | |||
/** | |||
* 分页查询 | |||
* @param parms | |||
* @returns | |||
*/ | |||
PagedList(parms: FinalTypes.Page) { | |||
return request('/api/finalsinfo/pagedlist', { | |||
method: 'POST', | |||
data: { | |||
...parms, | |||
}, | |||
}); | |||
}, | |||
/** | |||
* 批量更新 | |||
* @param parms | |||
* @returns | |||
*/ | |||
BatchUpdate(parms: FinalTypes.BatchAdd) { | |||
return request('/api/finalsinfo/batchupdate', { | |||
method: 'POST', | |||
data: parms | |||
}); | |||
}, | |||
/** | |||
* 根据设备Id查询配方信息 | |||
* @param parms | |||
* @returns | |||
*/ | |||
RecipeList(id: string){ | |||
return request(' api/finalsinfo/list', { | |||
method: 'POST', | |||
data: { | |||
deviceId: id | |||
} | |||
}); | |||
} | |||
} |
@@ -1,60 +0,0 @@ | |||
import { request } from '@umijs/max'; | |||
export default { | |||
//创建分组 | |||
Add(parms: GroupInfoTypes.Info) { | |||
return request('/api/groupinfo/add', { | |||
method: 'POST', | |||
data: { | |||
...parms, | |||
}, | |||
}); | |||
}, | |||
//删除 | |||
Del(parms: GroupInfoTypes.Info) { | |||
return request(`/api/groupinfo/del`, { | |||
method: 'POST', | |||
data: { | |||
...parms, | |||
}, | |||
}); | |||
}, | |||
//修改 | |||
Update(parms: GroupInfoTypes.Info) { | |||
return request('/api/groupinfo/update', { | |||
method: 'POST', | |||
data: { | |||
...parms, | |||
}, | |||
}); | |||
}, | |||
//列表 | |||
List() { | |||
return request('/api/groupinfo/list', { | |||
method: 'POST', | |||
}); | |||
}, | |||
/** | |||
* 分页查询 | |||
* @param parms | |||
* @returns | |||
*/ | |||
PagedList(parms: GroupInfoTypes.Page) { | |||
return request('/api/groupinfo/pagedlist', { | |||
method: 'POST', | |||
data: { | |||
...parms, | |||
}, | |||
}); | |||
}, | |||
// 下拉 | |||
selectlist() { | |||
return request('/api/groupinfo/selectlist', { | |||
method: 'GET' | |||
} | |||
) | |||
} | |||
} | |||
@@ -1,70 +0,0 @@ | |||
import { request } from '@umijs/max'; | |||
export default { | |||
//创建 | |||
Add(parms: MaterialsTypes.Info) { | |||
return request('/api/materialsinfo/add', { | |||
method: 'POST', | |||
data: { | |||
...parms, | |||
}, | |||
}); | |||
}, | |||
//删除 | |||
Del(parms: MaterialsTypes.MaterialsInfoDelInput) { | |||
return request(`/api/materialsinfo/del`, { | |||
method: 'POST', | |||
data: { | |||
...parms, | |||
}, | |||
}); | |||
}, | |||
//修改 | |||
Update(parms: MaterialsTypes.Info) { | |||
return request('/api/materialsinfo/update', { | |||
method: 'POST', | |||
data: { | |||
...parms, | |||
}, | |||
}); | |||
}, | |||
//获取列表 | |||
List() { | |||
return request('/api/materialsinfo/list', { | |||
method: 'GET', | |||
}); | |||
}, | |||
// 下拉列表 | |||
selectlist(){ | |||
return request ('/api/materialsinfo/selectlist' ,{ | |||
method:'GET' | |||
}) | |||
}, | |||
/** | |||
* 分页查询 | |||
* @param parms | |||
* @returns | |||
*/ | |||
PagedList(parms: MaterialsTypes.Page) { | |||
return request('/api/materialsinfo/pagedlist', { | |||
method: 'POST', | |||
data: { | |||
...parms, | |||
}, | |||
}); | |||
} | |||
} | |||
@@ -1,115 +0,0 @@ | |||
import { request } from '@umijs/max'; | |||
export default { | |||
//创建产线 | |||
Add(parms: ProductlineTypes.Info) { | |||
return request('/api/productline/add', { | |||
method: 'POST', | |||
data: { | |||
...parms, | |||
}, | |||
}); | |||
}, | |||
//删除 | |||
Del(parms: ProductlineTypes.Info) { | |||
return request(`/api/productline/del`, { | |||
method: 'POST', | |||
data: { | |||
...parms, | |||
}, | |||
}); | |||
}, | |||
//修改 | |||
Update(parms: ProductlineTypes.Info) { | |||
return request('/api/productline/update', { | |||
method: 'POST', | |||
data: { | |||
...parms, | |||
}, | |||
}); | |||
}, | |||
//列表 | |||
List() { | |||
return request('/api/productline/list', { | |||
method: 'GET', | |||
}); | |||
}, | |||
/** | |||
* 分页查询 | |||
* @param parms | |||
* @returns | |||
*/ | |||
PagedList(parms: ProductlineTypes.Page) { | |||
return request('/api/productline/pagedlist', { | |||
method: 'POST', | |||
data: { | |||
...parms, | |||
}, | |||
}); | |||
}, | |||
// 下拉列表 | |||
selectlist() { | |||
return request('/api/productline/selectlist', { | |||
method: 'GET', | |||
}); | |||
}, | |||
// 产线添加设备 | |||
adddevice(parms:ProductlineTypes.Productlinedevice){ | |||
return request('/api/productline/adddevice',{ | |||
method :'POST', | |||
data:{ | |||
...parms, | |||
} | |||
}) | |||
}, | |||
// 产线添加料仓 | |||
addstock(parms:ProductlineTypes.Productlinestock){ | |||
return request('/api/productline/addstock',{ | |||
method :'POST', | |||
data:{ | |||
...parms, | |||
} | |||
}) | |||
}, | |||
// 产线设备分页 | |||
devicepagelist(parms:ProductlineTypes.Productionlinepaging){ | |||
return request('/api/productline/devicepagelist',{ | |||
method:'POST', | |||
data:{ | |||
...parms | |||
} | |||
}) | |||
}, | |||
// 产线料仓分页 | |||
stockpagelist(parms:ProductlineTypes.Productionlinestockpaging){ | |||
return request('/api/productline/stockpagelist',{ | |||
method:'POST', | |||
data:{ | |||
...parms | |||
} | |||
}) | |||
}, | |||
// 产线删除设备 | |||
deletedevice(parms:ProductlineTypes.Productionlinedeletiondevice){ | |||
return request('/api/productline/deletedevice',{ | |||
method:'POST', | |||
data:{ | |||
...parms | |||
} | |||
}) | |||
}, | |||
// 产线删除料仓 | |||
deletestock(parms:ProductlineTypes.Productionlinedeletstock){ | |||
return request('',{ | |||
method:'POST', | |||
data:{ | |||
...parms | |||
} | |||
}) | |||
} | |||
} | |||
@@ -1,90 +0,0 @@ | |||
import { request } from '@umijs/max'; | |||
export default { | |||
//创建配方 | |||
Add(parms: RecipeTypes.Info) { | |||
return request('/api/recipesinfo/add', { | |||
method: 'POST', | |||
data: { | |||
...parms, | |||
}, | |||
}); | |||
}, | |||
//删除 | |||
Del(parms: RecipeTypes.Info) { | |||
return request(`/api/recipesinfo/del`, { | |||
method: 'POST', | |||
data: { | |||
...parms, | |||
}, | |||
}); | |||
}, | |||
//修改角色 | |||
Update(parms: RecipeTypes.Info) { | |||
return request('/api/recipesinfo/update', { | |||
method: 'POST', | |||
data: { | |||
...parms, | |||
}, | |||
}); | |||
}, | |||
//获取角色列表 | |||
List() { | |||
return request('/api/recipesinfo/list', { | |||
method: 'GET', | |||
}); | |||
}, | |||
/** | |||
* 角色分页查询 | |||
* @param parms | |||
* @returns | |||
*/ | |||
PagedList(parms: RecipeTypes.Page) { | |||
return request('/api/recipesinfo/pagedlist', { | |||
method: 'POST', | |||
data: { | |||
...parms, | |||
}, | |||
}); | |||
}, | |||
/** | |||
* 获取配方物料列表 | |||
* @param parms | |||
* @returns | |||
*/ | |||
MaterialList(parms:RecipeMaterialTypes.Info ){ | |||
return request('/api/recipematerial/list', { | |||
method: 'POST', | |||
data: { | |||
...parms, | |||
}, | |||
}); | |||
}, | |||
//批量创建物料信息 | |||
BatchAdd(parms: RecipeMaterialTypes.Info[]){ | |||
return request('/api/recipematerial/batchadd', { | |||
method: 'POST', | |||
data: parms | |||
}); | |||
}, | |||
//更改分组 | |||
ChangeGroup(parms: RecipeTypes.RecipesGroupInput){ | |||
return request('/api/recipesinfo/changegroup', { | |||
method: 'POST', | |||
data: parms | |||
}); | |||
}, | |||
// 下拉 | |||
selectlist() { | |||
return request('/api/recipesinfo/selectlist', { | |||
method: 'GET', | |||
}) | |||
} | |||
} | |||
@@ -1,59 +0,0 @@ | |||
import { request } from '@umijs/max'; | |||
export default { | |||
//创建 | |||
Add(parms: StoreTypes.StoreInfo) { | |||
return request('/api/storeinfo/add', { | |||
method: 'POST', | |||
data: { | |||
...parms, | |||
}, | |||
}); | |||
}, | |||
//删除 | |||
Del(parms: StoreTypes.StoreInfo) { | |||
return request(`/api/storeinfo/del`, { | |||
method: 'POST', | |||
data: { | |||
...parms, | |||
}, | |||
}); | |||
}, | |||
//修改角色 | |||
Update(parms: StoreTypes.StoreInfo) { | |||
return request('/api/storeinfo/update', { | |||
method: 'POST', | |||
data: { | |||
...parms, | |||
}, | |||
}); | |||
}, | |||
//获取角色列表 | |||
List() { | |||
return request('/api/storeinfo/list', { | |||
method: 'GET', | |||
}); | |||
}, | |||
/** | |||
* 角色分页查询 | |||
* @param parms | |||
* @returns | |||
*/ | |||
PagedList(parms: StoreTypes.StoreInfo) { | |||
return request('/api/storeinfo/pagedlist', { | |||
method: 'POST', | |||
data: { | |||
...parms, | |||
}, | |||
}); | |||
} | |||
} | |||
@@ -0,0 +1,204 @@ | |||
/** | |||
* 设备基础信息管理 | |||
* @param Page | |||
* @returns | |||
*/ | |||
import type { ActionType, ProColumns } from '@ant-design/pro-components'; | |||
import { ProTable } from '@ant-design/pro-components'; | |||
import { Button, Modal, Form, Input, message, Popconfirm, Tag} from 'antd'; | |||
import { useRef, useState, useEffect } from 'react'; | |||
import AccountAPI from '@/api/sys/accountService'; | |||
export default () => { | |||
//表单 | |||
const [typeForm] = Form.useForm(); | |||
const [modelTitle, setModelTitle] = useState<string>(); | |||
//编辑/新增弹窗 | |||
const [isModalOpen, setIsModalOpen] = useState(false); | |||
const actionRef = useRef<ActionType>(); | |||
const columns: ProColumns<Account.TBAccountDTO>[] = [ | |||
{ | |||
title: '账号', | |||
dataIndex: 'account', | |||
ellipsis: true, | |||
}, | |||
{ | |||
title: '操作', | |||
valueType: 'option', | |||
key: 'option', | |||
render: (_, record) => [ | |||
<Button | |||
key="edit" | |||
type="primary" ghost | |||
onClick={async () => { | |||
setIsModalOpen(true); | |||
setModelTitle('编辑信息'); | |||
const copyFormData = JSON.parse(JSON.stringify(record)); | |||
copyFormData.state = copyFormData.state === '0' ? true : false; | |||
typeForm.setFieldsValue(copyFormData); | |||
}} | |||
> | |||
编辑 | |||
</Button>, | |||
<Popconfirm | |||
key="del" | |||
title="确定要删除此条数据吗?" | |||
onConfirm={() => { | |||
const EnablejsonData: Account.TBAccountDTO = { | |||
id: record.id, | |||
name: '', | |||
code: '' | |||
}; | |||
AccountAPI.Del(EnablejsonData).then((r) => { | |||
if (r.statusCode === 200) { | |||
message.success(r.statusCode === 200 ? '删除成功' : r.message); | |||
actionRef.current?.reload(); | |||
} | |||
}); | |||
}} | |||
onCancel={() => { | |||
message.info('已取消删除'); | |||
}} | |||
okText="确认" | |||
cancelText="关闭" | |||
> | |||
<Button type="primary" danger ghost>删除</Button> | |||
</Popconfirm>, | |||
], | |||
}, | |||
]; | |||
/* | |||
初始化 | |||
*/ | |||
useEffect(() => { | |||
// 下拉列表信息 | |||
const RegionDataList = () => { | |||
}; | |||
RegionDataList(); | |||
}, []); | |||
/* | |||
*表单提交 | |||
*/ | |||
const OnSubmit = async (values: Account.TBAccountDTO) => { | |||
if (values.id) { | |||
const response = await AccountAPI.Update(values); | |||
if (response.statusCode === 200) { | |||
message.success('修改成功'); | |||
actionRef.current?.reload(); | |||
setIsModalOpen(false); | |||
} else { | |||
message.error(response.errors || '修改失败'); | |||
} | |||
} else { | |||
const response = await AccountAPI.Add(values); | |||
console.log('response', response); | |||
if (response.statusCode === 200) { | |||
message.success('添加成功'); | |||
actionRef.current?.reload(); | |||
setIsModalOpen(false); | |||
} else { | |||
message.error(response.errors || '添加失败'); | |||
} | |||
} | |||
}; | |||
return ( | |||
<> | |||
<ProTable<Account.TBAccountDTO> | |||
key="myTable" | |||
columns={columns} | |||
actionRef={actionRef} | |||
cardBordered | |||
request={async (params = {}) => { | |||
const jsonData: DeviceTypes.Page = { | |||
pageIndex: params.current || 1, | |||
pageSize: params.pageSize || 10, | |||
name: params.name || '', | |||
id: '', | |||
code: '' | |||
}; | |||
const response = await AccountAPI.PagedList(jsonData); | |||
if (response.statusCode === 200) { | |||
return { | |||
data: response.data.items, | |||
success: true, | |||
total: response.data.total, | |||
}; | |||
} else { | |||
return { | |||
data: [], | |||
success: false, | |||
total: 0, | |||
}; | |||
} | |||
}} | |||
rowKey="id" | |||
pagination={{ | |||
pageSize: 10, | |||
}} | |||
dateFormatter="string" | |||
headerTitle="设备列表" | |||
toolBarRender={() => [ | |||
<Button | |||
key="button" | |||
type="primary" | |||
onClick={() => { | |||
typeForm.resetFields(); | |||
setIsModalOpen(true); | |||
setModelTitle('新增信息'); | |||
}} | |||
> | |||
新建 | |||
</Button>, | |||
]} | |||
/> | |||
<Modal | |||
key="01" | |||
width={800} | |||
title={<Tag color="#cd201f">{modelTitle}</Tag>} | |||
open={isModalOpen} | |||
onCancel={() => { | |||
setIsModalOpen(false); | |||
}} | |||
footer={[ | |||
<Button | |||
key="back" | |||
onClick={() => { | |||
setIsModalOpen(false); | |||
}} | |||
> | |||
返回 | |||
</Button>, | |||
<Button key="submit" form="myForm" type="primary" htmlType="submit"> | |||
提交 | |||
</Button>, | |||
]} | |||
> | |||
<Form | |||
form={typeForm} | |||
name="basic" | |||
id="myForm" | |||
labelCol={{ span: 4 }} | |||
wrapperCol={{ span: 12 }} | |||
onFinish={OnSubmit} | |||
autoComplete="off" | |||
> | |||
<Form.Item label="id" name="id" hidden> | |||
<Input /> | |||
</Form.Item> | |||
<Form.Item | |||
label="账号" | |||
name="name" | |||
rules={[{ required: true, message: '此项为必填项!' }]} | |||
> | |||
<Input /> | |||
</Form.Item> | |||
</Form> | |||
</Modal> | |||
</> | |||
); | |||
}; | |||
@@ -1,75 +0,0 @@ | |||
import { request } from '@umijs/max'; | |||
export default { | |||
//创建分组 | |||
Add(parms: WorkInfoTypes.WorkInfoAddInput) { | |||
return request('/api/workinfo/add', { | |||
method: 'POST', | |||
data: { | |||
...parms, | |||
}, | |||
}); | |||
}, | |||
//删除 | |||
Del(parms: WorkInfoTypes.WorkInfoDelInput) { | |||
return request(`/api/workinfo/del`, { | |||
method: 'POST', | |||
data: { | |||
...parms, | |||
}, | |||
}); | |||
}, | |||
//修改 | |||
Update(parms: WorkInfoTypes.WorkInfoUpdateInput) { | |||
return request('/api/workinfo/update', { | |||
method: 'POST', | |||
data: { | |||
...parms, | |||
}, | |||
}); | |||
}, | |||
//列表 | |||
List() { | |||
return request('/api/workinfo/list', { | |||
method: 'POST', | |||
}); | |||
}, | |||
/** | |||
* 分页查询 | |||
* @param parms | |||
* @returns | |||
*/ | |||
PagedList(parms: WorkInfoTypes.Page) { | |||
return request('/api/workinfo/pagedlist', { | |||
method: 'POST', | |||
data: { | |||
...parms, | |||
}, | |||
}); | |||
}, | |||
Publish(workId: string){ | |||
return request(`/api/workinfo/publish/${workId}`, { | |||
method: 'POST' | |||
}); | |||
}, | |||
UpdateStatus(parms:WorkInfoTypes.WorkInfoStatusUpdateInput){ | |||
return request('/api/workinfo/ForcedEnd', { | |||
method: 'POST', | |||
data: { | |||
...parms, | |||
}, | |||
}); | |||
}, | |||
ForcedEnd(workId: string){ | |||
return request(`/api/workinfo/forcedend/${workId}`, { | |||
method: 'POST' | |||
}); | |||
}, | |||
UpdateStatusList(workId:string){ | |||
return request(`/api/workinfo/statuslist/${workId}`, { | |||
method: 'GET' | |||
}); | |||
} | |||
} | |||
@@ -5,7 +5,7 @@ import defaultSettings from '../config/defaultSettings'; | |||
import { errorConfig } from './requestErrorConfig'; | |||
import HeaderRight from './components/HeaderRight'; | |||
import { history } from '@umijs/max'; | |||
import UserAPI from '@/api/User'; | |||
import UserAPI from '@/api/sys/User'; | |||
import React from 'react'; | |||
import * as Icon from '@ant-design/icons'; | |||
const isDev = process.env.NODE_ENV === 'development'; | |||
@@ -21,6 +21,7 @@ const loopMenuItem = (menus: MenuDataItem[]): MenuDataItem[] => { | |||
const formartRoutes = (menuTree: any[]) => { | |||
menuTree.forEach((item) => { | |||
item.path = item.url; | |||
item.locale = false; | |||
if (item.children && item.children.length > 0 && item.category < 2) { | |||
formartRoutes(item.children); | |||
} else { | |||
@@ -74,32 +75,36 @@ export const layout: RunTimeLayoutConfig = ({ initialState }) => { | |||
content: '黑菠萝科技研发部', | |||
}, | |||
token: { | |||
colorBgAppListIconHover: 'rgba(0,0,0,0.06)', | |||
colorTextAppListIconHover: 'rgba(255,255,255,0.95)', | |||
colorTextAppListIcon: 'rgba(255,255,255,0.85)', | |||
sider: { | |||
colorBgCollapsedButton: '#13C2C2', | |||
colorTextCollapsedButtonHover: 'rgba(0,0,0,0.65)', | |||
colorTextCollapsedButton: 'rgba(0,0,0,0.45)', | |||
colorMenuBackground: '#000', | |||
colorBgMenuItemCollapsedHover: 'rgba(0,0,0,0.06)', | |||
colorBgMenuItemCollapsedSelected: '#13C2C2', | |||
colorMenuItemDivider: 'rgba(255,255,255,0.15)', | |||
colorBgMenuItemHover: '#F5222D', | |||
colorBgMenuItemSelected: '#13C2C2', | |||
colorTextMenuSelected: '#fff', | |||
colorTextMenuItemHover: 'rgba(255,255,255,0.75)', | |||
colorTextMenu: 'rgba(255,255,255,0.75)', | |||
colorTextMenuSecondary: 'rgba(255,255,255,0.65)', | |||
colorTextMenuTitle: 'rgba(255,255,255,0.95)', | |||
colorTextMenuActive: 'rgba(255,255,255,0.95)', | |||
// colorBgAppListIconHover: 'rgba(0,0,0,0.06)', | |||
// colorTextAppListIconHover: 'rgba(255,255,255,0.95)', | |||
colorTextAppListIcon: 'rgba(255,255,255,0.85)', | |||
sider: { | |||
// colorBgCollapsedButton: '#13C2C2', | |||
// colorTextCollapsedButtonHover: 'rgba(0,0,0,0.65)', | |||
// colorTextCollapsedButton: 'rgba(0,0,0,0.45)', | |||
colorMenuBackground: '#fff', | |||
// colorBgMenuItemCollapsedHover: 'rgba(0,0,0,0.06)', | |||
// colorBgMenuItemCollapsedSelected: '#13C2C2', | |||
colorMenuItemDivider: defaultSettings.colorPrimary, | |||
// colorBgMenuItemHover: '#F5222D', | |||
colorBgMenuItemSelected: defaultSettings.colorPrimary, | |||
colorTextMenuSelected: '#000', | |||
// colorTextMenuItemHover: 'rgba(255,255,255,0.75)', | |||
colorTextMenu: '#000', | |||
// colorTextMenuSecondary: 'rgba(255,255,255,0.65)', | |||
// colorTextMenuTitle: 'rgba(255,255,255,0.95)', | |||
// colorTextMenuActive: 'rgba(255,255,255,0.95)', | |||
colorTextSubMenuSelected: '#fff', | |||
}, | |||
}, | |||
header: { | |||
colorBgHeader: '#000000', | |||
colorMenuBackground: '#fff', | |||
colorHeaderTitle: '#13C2C2', | |||
colorBgHeader: '#000', | |||
colorMenuBackground: '#000', | |||
colorHeaderTitle: '#ffffff', | |||
}, | |||
pageContainer:{ | |||
paddingInlinePageContainerContent: 20, | |||
paddingBlockPageContainerContent:10 | |||
} | |||
}, | |||
footerRender: () => <Footer />, | |||
onPageChange: () => { | |||
@@ -7,7 +7,7 @@ import type { MenuProps } from 'antd'; | |||
import md5 from 'js-md5' | |||
import { history, useModel } from "@umijs/max"; | |||
import Password from 'antd/es/input/Password'; | |||
import userAPI from "@/api/User"; | |||
import userAPI from "@/api/sys/User"; | |||
const HeaderRight: React.FC = () => { | |||
@@ -1,4 +1,3 @@ | |||
@primary-color: #F5222D; | |||
html, | |||
body, | |||
#root { | |||
@@ -37,7 +36,9 @@ ul, | |||
ol { | |||
list-style: none; | |||
} | |||
.ant-tabs-tab{ | |||
border-radius:0px 0px !important; | |||
} | |||
@media (max-width: 768px) { | |||
.ant-table { | |||
width: 100%; | |||
@@ -1,12 +0,0 @@ | |||
.qrcodebox{ | |||
display: flex; | |||
flex-direction: column; | |||
text-align: center; | |||
align-items: center; | |||
} | |||
.btn1 { | |||
display: block; | |||
} |
@@ -1,505 +0,0 @@ | |||
// 桶管理 | |||
import './index.less' | |||
import type { ActionType, ProColumns } from '@ant-design/pro-components'; | |||
import { ProTable } from '@ant-design/pro-components'; | |||
import { Button, Modal, Form, Input, message, Popconfirm, Tag, QRCode, Table } from 'antd'; | |||
import { useRef, useState } from 'react'; | |||
import type { ColumnsType } from 'antd/es/table'; | |||
import BucketInfoAPI from '@/api/Bucket'; | |||
import { multiply } from 'lodash'; | |||
const bucket = () => { | |||
//表单 | |||
// eslint-disable-next-line react-hooks/rules-of-hooks | |||
const [typeForm] = Form.useForm(); | |||
// 下拉列表 | |||
// eslint-disable-next-line react-hooks/rules-of-hooks | |||
const [modelTitle, setModelTitle] = useState<string>(); | |||
//编辑/新增弹窗 | |||
// eslint-disable-next-line react-hooks/rules-of-hooks | |||
const [isModalOpen, setIsModalOpen] = useState(false); | |||
// eslint-disable-next-line react-hooks/rules-of-hooks | |||
const actionRef = useRef<ActionType>(); | |||
// 二维码下载弹窗 | |||
// eslint-disable-next-line react-hooks/rules-of-hooks | |||
const [isopenshow, setopenshow] = useState(false); | |||
// 下载回显的数据 | |||
// eslint-disable-next-line react-hooks/rules-of-hooks | |||
const [information, setinformation] = useState<BucketTypes.Info>({ | |||
id: '', | |||
name: '', | |||
code: '', | |||
}); | |||
// 桶记录弹窗 | |||
// eslint-disable-next-line react-hooks/rules-of-hooks | |||
const [isrecord, setrecord] = useState(false) | |||
const columns: ProColumns<BucketTypes.Info>[] = [ | |||
{ | |||
title: 'id', | |||
dataIndex: 'id', | |||
tip: '规则名称是唯一的 key', | |||
hideInSearch: true, | |||
hideInTable: true, | |||
}, | |||
{ | |||
title: '桶名称', | |||
dataIndex: 'name', | |||
ellipsis: true, | |||
align: 'center', | |||
}, | |||
{ | |||
title: '桶编号', | |||
dataIndex: 'code', | |||
hideInSearch: true, | |||
ellipsis: true, | |||
align: 'center', | |||
}, | |||
{ | |||
title: '当前原料', | |||
dataIndex: 'materialName', | |||
ellipsis: true, | |||
hideInSearch: true, | |||
align: 'center', | |||
}, | |||
{ | |||
title: '桶二维码', | |||
dataIndex: 'type', | |||
align: 'center', | |||
ellipsis: true, | |||
hideInSearch: true, | |||
width: 160, | |||
render: (_, record) => { | |||
return ( | |||
<div className='qrcodebox'> | |||
<div id="myqrcode" > | |||
<QRCode size={120} bordered={false} value={record.code} /> | |||
</div> | |||
{/* 下载二维码点击事件 */} | |||
<a onClick={() => { | |||
const canvas = document.getElementById('myqrcode')?.querySelector<HTMLCanvasElement>('canvas'); | |||
if (canvas) { | |||
const url = canvas.toDataURL(); | |||
const a = document.createElement('a'); | |||
a.download = 'QRCode.png'; | |||
a.href = url; | |||
document.body.appendChild(a); | |||
a.click(); | |||
document.body.removeChild(a); | |||
} | |||
}}>下载</a> | |||
</div> | |||
) | |||
} | |||
}, | |||
{ | |||
title: '桶类型', | |||
dataIndex: 'lx', | |||
ellipsis: true, | |||
align: 'center', | |||
hideInSearch: true, | |||
}, | |||
{ | |||
title: '桶容积', | |||
dataIndex: 'rj', | |||
align: 'center', | |||
ellipsis: true, | |||
hideInSearch: true, | |||
}, | |||
{ | |||
title: '操作', | |||
valueType: 'option', | |||
key: 'option', | |||
width: 220, | |||
render: (_, record) => [ | |||
<Button | |||
key="edit" | |||
type="primary" ghost | |||
className='btn1' | |||
onClick={async () => { | |||
setIsModalOpen(true); | |||
setModelTitle('编辑信息'); | |||
const copyFormData = JSON.parse(JSON.stringify(record)); | |||
console.log(copyFormData); | |||
copyFormData.state = copyFormData.state === '0'; | |||
typeForm.setFieldsValue(copyFormData); | |||
}} | |||
> | |||
编辑 | |||
</Button>, | |||
// <Button | |||
// key="xz" | |||
// type="primary" ghost | |||
// onClick={async () => { | |||
// setopenshow(true); | |||
// setinformation(record) | |||
// }} | |||
// > | |||
// 下载 | |||
// </Button>, | |||
<Button | |||
key="jl" | |||
type="primary" ghost | |||
className='btn2' | |||
onClick={async () => { | |||
setrecord(true) | |||
setinformation(record); | |||
// eslint-disable-next-line @typescript-eslint/no-use-before-define | |||
await chart(record); | |||
}} | |||
> | |||
记录 | |||
</Button>, | |||
<Popconfirm | |||
key="del" | |||
title="确定要删除此条数据吗?" | |||
onConfirm={() => { | |||
const EnablejsonData: BucketTypes.Info = { | |||
id: record.id, | |||
name: '', | |||
code: '', | |||
}; | |||
BucketInfoAPI.Del(EnablejsonData).then((r:MyResponse.Content) => { | |||
if (r.statusCode === 200) { | |||
message.success(r.statusCode === 200 ? '删除成功' : r.message); | |||
// 重新加载页面 | |||
actionRef.current?.reload(); | |||
} | |||
}); | |||
}} | |||
onCancel={() => { | |||
message.info('已取消删除'); | |||
}} | |||
okText="确认" | |||
cancelText="关闭" | |||
> | |||
<Button type="primary" danger ghost className='btn3'>删除</Button> | |||
</Popconfirm > | |||
], | |||
}, | |||
]; | |||
// 定义桶记录里面的列表 | |||
const data: ColumnsType<BucketTypes.Info> = [ | |||
{ | |||
title: '', | |||
dataIndex: 'id', | |||
render: () => null, | |||
}, | |||
{ | |||
title: '工单ID', | |||
dataIndex: 'code', | |||
// key: 'code22', | |||
align: 'center' | |||
}, | |||
{ | |||
title: '工单名称', | |||
dataIndex: 'name', | |||
// key: 'age', | |||
align: 'center', | |||
ellipsis: true, | |||
}, | |||
{ | |||
title: '原料', | |||
dataIndex: 'materialName', | |||
// key: 'age1', | |||
align: 'center' | |||
}, | |||
{ | |||
title: '原料重量', | |||
dataIndex: 'age2', | |||
// key: 'age2', | |||
align: 'center' | |||
}, | |||
{ | |||
title: '时间', | |||
dataIndex: 'createTime', | |||
// key: 'age3', | |||
align: 'center' | |||
}, | |||
]; | |||
// eslint-disable-next-line react-hooks/rules-of-hooks | |||
// const [aaadata, setaaadata] = useState() | |||
// 桶记录内的列表状态 | |||
// eslint-disable-next-line react-hooks/rules-of-hooks | |||
const [condition, setcondition] = useState() | |||
// 定义一个桶函数 | |||
const chart = async (record: any) => { | |||
// 自定义属性 | |||
const chartcheet: BucketTypes.BucketMaterialsRecordQueryPageInput = { | |||
pageIndex: 1, | |||
pageSize: 10, | |||
bucketId: record.id, | |||
// name: '', | |||
// id: '', | |||
// code: '' | |||
}; | |||
try { | |||
// 调用接口 | |||
const response = await BucketInfoAPI.materialtrecored(chartcheet); | |||
// 如果调用成功 | |||
if (response.statusCode === 200) { | |||
console.log(response); | |||
// 将数据更新到列表最新状态 | |||
setcondition(response.data.items); | |||
} | |||
} catch (error) { | |||
console.error('Error fetching data:', error); | |||
} | |||
} | |||
// 表单提交 | |||
const OnSubmit = async (values: BucketTypes.Info) => { | |||
if (values.id) { | |||
const response = await BucketInfoAPI.Update(values); | |||
if (response.statusCode === 200) { | |||
message.success('修改成功'); | |||
actionRef.current?.reload(); | |||
setIsModalOpen(false); | |||
} else { | |||
message.error(JSON.stringify(response.errors) || '修改失败'); | |||
} | |||
} else { | |||
const response = await BucketInfoAPI.Add(values); | |||
console.log('response', response); | |||
if (response.statusCode === 200) { | |||
message.success('添加成功'); | |||
actionRef.current?.reload(); | |||
setIsModalOpen(false); | |||
} else { | |||
message.error(JSON.stringify(response.errors) || '添加失败'); | |||
} | |||
} | |||
}; | |||
return ( | |||
<> | |||
<ProTable<BucketTypes.Info> | |||
key="myTable" | |||
columns={columns} | |||
actionRef={actionRef} | |||
cardBordered | |||
request={async (params = {}) => { | |||
const jsonData: BucketTypes.Page = { | |||
pageIndex: params.current || 1, | |||
pageSize: params.pageSize || 10, | |||
name: params.name || '', | |||
id: '', | |||
code: '', | |||
}; | |||
const response = await BucketInfoAPI.PagedList(jsonData); | |||
if (response.statusCode === 200) { | |||
return { | |||
data: response.data.items, | |||
success: true, | |||
total: response.data.total, | |||
}; | |||
} else { | |||
return { | |||
data: [], | |||
success: false, | |||
total: 0, | |||
}; | |||
} | |||
}} | |||
rowKey="id" | |||
pagination={{ | |||
pageSize: 10, | |||
}} | |||
dateFormatter="string" | |||
headerTitle="桶列表" | |||
toolBarRender={() => [ | |||
<Button | |||
key="button" | |||
type="primary" | |||
onClick={() => { | |||
typeForm.resetFields(); | |||
setIsModalOpen(true); | |||
setModelTitle('新增桶'); | |||
}} | |||
> | |||
新增桶 | |||
</Button>, | |||
]} | |||
/> | |||
<Modal | |||
key="01" | |||
width={800} | |||
title={<Tag color="#cd201f">{modelTitle}</Tag>} | |||
open={isModalOpen} | |||
onCancel={() => { | |||
setIsModalOpen(false); | |||
}} | |||
footer={[ | |||
<Button | |||
key="back" | |||
onClick={() => { | |||
setIsModalOpen(false); | |||
}} | |||
> | |||
返回 | |||
</Button>, | |||
<Button key="submit" form="bucketForm" type="primary" htmlType="submit"> | |||
提交 | |||
</Button>, | |||
]} | |||
> | |||
<Form | |||
form={typeForm} | |||
name="basic" | |||
id="bucketForm" | |||
// lCol={{ span: 4 }} | |||
wrapperCol={{ span: 12 }} | |||
onFinish={OnSubmit} | |||
autoComplete="off" | |||
> | |||
<Form.Item label="id" name="id" hidden> | |||
<Input /> | |||
</Form.Item> | |||
<Form.Item | |||
label="桶名称" | |||
name="name" | |||
rules={[{ required: true, message: '此项为必填项!' }]} | |||
> | |||
<Input /> | |||
</Form.Item> | |||
<Form.Item label="桶编号" name="code" rules={[{ required: true, message: '此项为必填项!' }]} > | |||
<Input /> | |||
</Form.Item> | |||
{/* <Form.Item label="当前原料" name="code2" rules={[{ required: true, message: '此项为必填项!' }]} > | |||
<Input /> | |||
</Form.Item> | |||
<Form.Item label="桶二维码" name="des" > | |||
<Input /> | |||
</Form.Item> */} | |||
<Form.Item label="桶类型" name="lx" rules={[{ required: true, message: '此项为必填项!' }]} > | |||
<Input /> | |||
</Form.Item> | |||
<Form.Item label="桶容积" name="rj" rules={[{ required: true, message: '此项为必填项!' }]} > | |||
<Input /> | |||
</Form.Item> | |||
</Form> | |||
</Modal> | |||
{/* 下载二维码 */} | |||
<Modal | |||
key="xzModal" | |||
width={400} | |||
title={<Tag color="#cd201f">二维码</Tag>} | |||
open={isopenshow} | |||
onCancel={() => { | |||
setopenshow(false); | |||
}} | |||
footer={[ | |||
<Button | |||
key="back" | |||
onClick={() => { | |||
setopenshow(false); | |||
}} | |||
> | |||
返回 | |||
</Button>, | |||
]} | |||
> | |||
<div className='container'> | |||
<div className='left'> | |||
<div >桶编号 : {information?.code}</div> | |||
<div >桶名称 : {information?.name}</div> | |||
<div >当前原料 : </div> | |||
</div> | |||
<div className='right'> | |||
<div id="myqrcode" > | |||
<QRCode value={information?.code} style={{ border: 'none' }} /> | |||
</div> | |||
</div> | |||
</div> | |||
</Modal> | |||
{/* 桶记录 */} | |||
<Modal | |||
key="tjl01" | |||
width={800} | |||
title={<Tag color="#cd201f">桶记录</Tag>} | |||
open={isrecord} | |||
onCancel={() => { | |||
setrecord(false) | |||
}} | |||
footer={[ | |||
<Button | |||
key="back" | |||
onClick={() => { | |||
setrecord(false) | |||
}} | |||
> | |||
返回 | |||
</Button>, | |||
]} | |||
> | |||
<div> | |||
<div>桶编号 : {information?.code} </div> | |||
<div>桶名称 :{information?.name} </div> | |||
<Table columns={data} dataSource={condition} /> | |||
</div> | |||
</Modal> | |||
</> | |||
); | |||
}; | |||
export default bucket; |