提交1
This commit is contained in:
parent
49fb58805a
commit
ae514ccf65
65
DOAN.Model/MES/base/BaseWorkRoute.cs
Normal file
65
DOAN.Model/MES/base/BaseWorkRoute.cs
Normal file
@ -0,0 +1,65 @@
|
||||
namespace DOAN.Model.MES.base_
|
||||
{
|
||||
/// <summary>
|
||||
/// 工艺路线
|
||||
/// </summary>
|
||||
[SugarTable("base_work_route")]
|
||||
public class BaseWorkRoute
|
||||
{
|
||||
/// <summary>
|
||||
/// 主键
|
||||
/// </summary>
|
||||
[SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
|
||||
public int Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 名称
|
||||
/// </summary>
|
||||
public string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 编号
|
||||
/// </summary>
|
||||
public string Code { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 工艺流程图原始json数据,用来进行复现
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "logic_flow_data")]
|
||||
public string LogicFlowData { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 状态
|
||||
/// </summary>
|
||||
public int? Status { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 备注
|
||||
/// </summary>
|
||||
public string Remark { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 创建人
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "cREATED_BY")]
|
||||
public string CreatedBy { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 创建时间
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "cREATED_TIME")]
|
||||
public DateTime? CreatedTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 更新人
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "uPDATED_BY")]
|
||||
public string UpdatedBy { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 更新时间
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "uPDATED_TIME")]
|
||||
public DateTime? UpdatedTime { get; set; }
|
||||
}
|
||||
}
|
||||
43
DOAN.Model/MES/base/Dto/BaseWorkRouteDto.cs
Normal file
43
DOAN.Model/MES/base/Dto/BaseWorkRouteDto.cs
Normal file
@ -0,0 +1,43 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace DOAN.Model.MES.base_.Dto
|
||||
{
|
||||
/// <summary>
|
||||
/// 工艺路线查询对象
|
||||
/// </summary>
|
||||
public class BaseWorkRouteQueryDto : PagerInfo
|
||||
{
|
||||
public string Name { get; set; }
|
||||
|
||||
public string Code { get; set; }
|
||||
|
||||
public int? Status { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 工艺路线输入输出对象
|
||||
/// </summary>
|
||||
public class BaseWorkRouteDto
|
||||
{
|
||||
[Required(ErrorMessage = "主键不能为空")]
|
||||
public int Id { get; set; }
|
||||
|
||||
public string Name { get; set; }
|
||||
|
||||
public string Code { get; set; }
|
||||
|
||||
public string LogicFlowData { get; set; }
|
||||
|
||||
public int? Status { get; set; }
|
||||
|
||||
public string Remark { get; set; }
|
||||
|
||||
public string CreatedBy { get; set; }
|
||||
|
||||
public DateTime? CreatedTime { get; set; }
|
||||
|
||||
public string UpdatedBy { get; set; }
|
||||
|
||||
public DateTime? UpdatedTime { get; set; }
|
||||
}
|
||||
}
|
||||
84
DOAN.Service/MES/base/BaseWorkRouteService.cs
Normal file
84
DOAN.Service/MES/base/BaseWorkRouteService.cs
Normal file
@ -0,0 +1,84 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using DOAN.Model;
|
||||
using DOAN.Model.MES.base_;
|
||||
using DOAN.Model.MES.base_.Dto;
|
||||
using DOAN.Repository;
|
||||
using DOAN.Service.Business.IBusinessService;
|
||||
using Infrastructure.Attribute;
|
||||
using Infrastructure.Extensions;
|
||||
using SqlSugar;
|
||||
|
||||
namespace DOAN.Service.Business
|
||||
{
|
||||
/// <summary>
|
||||
/// 工艺路线Service业务层处理
|
||||
/// </summary>
|
||||
[AppService(ServiceType = typeof(IBaseWorkRouteService), ServiceLifetime = LifeTime.Transient)]
|
||||
public class BaseWorkRouteService : BaseService<BaseWorkRoute>, IBaseWorkRouteService
|
||||
{
|
||||
/// <summary>
|
||||
/// 查询工艺路线列表
|
||||
/// </summary>
|
||||
/// <param name="parm"></param>
|
||||
/// <returns></returns>
|
||||
public PagedInfo<BaseWorkRouteDto> GetList(BaseWorkRouteQueryDto parm)
|
||||
{
|
||||
var predicate = Expressionable
|
||||
.Create<BaseWorkRoute>()
|
||||
.AndIF(!string.IsNullOrEmpty(parm.Name), it => it.Name.Contains(parm.Name))
|
||||
.AndIF(!string.IsNullOrEmpty(parm.Code), it => it.Code.Contains(parm.Code))
|
||||
.AndIF(parm.Status > -1, it => it.Status == parm.Status);
|
||||
var response = Queryable()
|
||||
.Where(predicate.ToExpression())
|
||||
.ToPage<BaseWorkRoute, BaseWorkRouteDto>(parm);
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取详情
|
||||
/// </summary>
|
||||
/// <param name="Id"></param>
|
||||
/// <returns></returns>
|
||||
public BaseWorkRoute GetInfo(int Id)
|
||||
{
|
||||
var response = Queryable().Where(x => x.Id == Id).First();
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加工艺路线
|
||||
/// </summary>
|
||||
/// <param name="model"></param>
|
||||
/// <returns></returns>
|
||||
public BaseWorkRoute AddBaseWorkRoute(BaseWorkRoute model)
|
||||
{
|
||||
return Context.Insertable(model).ExecuteReturnEntity();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改工艺路线
|
||||
/// </summary>
|
||||
/// <param name="model"></param>
|
||||
/// <returns></returns>
|
||||
public int UpdateBaseWorkRoute(BaseWorkRoute model)
|
||||
{
|
||||
//var response = Update(w => w.Id == model.Id, it => new BaseWorkRoute()
|
||||
//{
|
||||
// Name = model.Name,
|
||||
// Status = model.Status,
|
||||
// Remark = model.Remark,
|
||||
// CreatedBy = model.CreatedBy,
|
||||
// CreatedTime = model.CreatedTime,
|
||||
// UpdatedBy = model.UpdatedBy,
|
||||
// UpdatedTime = model.UpdatedTime,
|
||||
// Code = model.Code,
|
||||
// LogicFlowData = model.LogicFlowData,
|
||||
//});
|
||||
//return response;
|
||||
return Update(model, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
22
DOAN.Service/MES/base/IService/IBaseWorkRouteService.cs
Normal file
22
DOAN.Service/MES/base/IService/IBaseWorkRouteService.cs
Normal file
@ -0,0 +1,22 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using DOAN.Model;
|
||||
using DOAN.Model.MES.base_;
|
||||
using DOAN.Model.MES.base_.Dto;
|
||||
|
||||
namespace DOAN.Service.Business.IBusinessService
|
||||
{
|
||||
/// <summary>
|
||||
/// 工艺路线service接口
|
||||
/// </summary>
|
||||
public interface IBaseWorkRouteService : IBaseService<BaseWorkRoute>
|
||||
{
|
||||
PagedInfo<BaseWorkRouteDto> GetList(BaseWorkRouteQueryDto parm);
|
||||
|
||||
BaseWorkRoute GetInfo(int Id);
|
||||
|
||||
BaseWorkRoute AddBaseWorkRoute(BaseWorkRoute parm);
|
||||
|
||||
int UpdateBaseWorkRoute(BaseWorkRoute parm);
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user