客户订单api
This commit is contained in:
parent
1fc4704282
commit
0ee184d394
@ -6,6 +6,7 @@ using System.ComponentModel.DataAnnotations;
|
||||
namespace MineTec.ProManager.BOM_Production.Dto
|
||||
{
|
||||
[AutoMapFrom(typeof(Entitys.Order.BOM_Production.BOM_Production))]
|
||||
|
||||
public class BOM_ProductionDto : EntityDto<Guid>
|
||||
{
|
||||
/// <summary>
|
||||
|
@ -6,6 +6,7 @@ using System.ComponentModel.DataAnnotations;
|
||||
namespace MineTec.ProManager.BOM_Production.Dto
|
||||
{
|
||||
[AutoMapTo(typeof(Entitys.Order.BOM_Production.BOM_Production))]
|
||||
|
||||
public class CreateUpdateBOM_ProductionDto : EntityDto<Guid>
|
||||
{
|
||||
/// <summary>
|
||||
|
@ -1,10 +1,125 @@
|
||||
using System;
|
||||
using Abp.Application.Services;
|
||||
using Abp.Application.Services.Dto;
|
||||
using Abp.Collections.Extensions;
|
||||
using Abp.Domain.Repositories;
|
||||
using MineTec.ProManager.Commd;
|
||||
using MineTec.ProManager.CustomerOrder.Dto;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace MineTec.ProManager.CustomerOrder
|
||||
{
|
||||
class CustomerOrderAppService
|
||||
|
||||
public class CustomerOrderAppService : AsyncCrudAppService<Entitys.Order.CustomerOrder.CustomerOrder, CustomerOrderDto, Guid, PagedResultRequestDto,
|
||||
CreateUpdateCustomerOrder, CreateUpdateCustomerOrder>, ICustomerOrderAppService
|
||||
|
||||
{
|
||||
private readonly IRepository<Entitys.Order.CustomerOrder.CustomerOrder, Guid> _CustomerOrderRepository;
|
||||
|
||||
public CustomerOrderAppService(IRepository<Entitys.Order.CustomerOrder.CustomerOrder, Guid> repository, IRepository<Entitys.Order.CustomerOrder.CustomerOrder, Guid> CustomerOrderRepository)
|
||||
: base(repository)
|
||||
{
|
||||
_CustomerOrderRepository = CustomerOrderRepository;
|
||||
}
|
||||
|
||||
public OutputBase CreateCustomerOrder(CreateUpdateCustomerOrder input)
|
||||
{
|
||||
var result = new OutputBase();
|
||||
try
|
||||
{
|
||||
var entity = _CustomerOrderRepository.GetAll().FirstOrDefault(a => a.ordername == input.ordername && a.isdelete == 0);
|
||||
if (entity == null)
|
||||
{
|
||||
_CustomerOrderRepository.InsertAndGetId(ObjectMapper.Map<Entitys.Order.CustomerOrder.CustomerOrder>(input));
|
||||
//base.CreateAsync(input);
|
||||
result.code = 1;//成功
|
||||
result.msg = "保存成功!";
|
||||
}
|
||||
else
|
||||
{
|
||||
result.code = 2;//重复
|
||||
result.msg = "已经存在相同的订单名称,请修改!";
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
result.code = 0;//失败
|
||||
result.msg = e.Message;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public OutputBase CheckCustomerOrder(CreateUpdateCustomerOrder input)
|
||||
{
|
||||
var result = new OutputBase();
|
||||
try
|
||||
{
|
||||
var entity = _CustomerOrderRepository.GetAll().FirstOrDefault(a => a.ordername == input.ordername && a.isdelete == 0);
|
||||
if (entity == null)
|
||||
{
|
||||
result.code = 1;//成功
|
||||
result.msg = "无重复数据!";
|
||||
}
|
||||
else
|
||||
{
|
||||
result.code = 2;//重复
|
||||
result.msg = "已经存在相同的订单名称,请修改!";
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
result.code = 0;//失败
|
||||
result.msg = e.Message;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public CustomerOrderOutPut GetAllCustomerOrder(GetAllCustomerOrder input)
|
||||
{
|
||||
var result = new CustomerOrderOutPut();
|
||||
try
|
||||
{
|
||||
var query = _CustomerOrderRepository.GetAll().Where(t => t.isdelete != 1).WhereIf(!string.IsNullOrEmpty(input.ordername), t => t.ordername.Contains(input.ordername)).WhereIf(!string.IsNullOrEmpty(input.suppliername), t => t.suppliername.Contains(input.suppliername)).WhereIf(!string.IsNullOrEmpty(input.clientname), t => t.clientname.Contains(input.clientname));
|
||||
var bomcount = query.Count();
|
||||
var bomlist = query.ToList();
|
||||
var list = ObjectMapper.Map<List<CustomerOrderDto>>(bomlist);
|
||||
result.code = 0;
|
||||
result.count = bomcount;
|
||||
result.data = list;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
result.msg = ex.Message;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public OutputBase UpdateCustomerOrder(UpdateCustomerOrder input)
|
||||
{
|
||||
var result = new OutputBase();
|
||||
try
|
||||
{
|
||||
var query = _CustomerOrderRepository.GetAll().FirstOrDefault(a => a.Id == input.id);
|
||||
if (input.isdelete == 1)
|
||||
{
|
||||
query.isdelete = 1;
|
||||
}
|
||||
query.updatetime = DateTime.Now;
|
||||
query.updateuserid = input.updateuserid;
|
||||
query.updateusername = input.updateusername;
|
||||
|
||||
result.code = 1;//1成功0失败
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
result.code = 0;
|
||||
result.msg = ex.Message;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,202 @@
|
||||
using Abp.Application.Services.Dto;
|
||||
using Abp.AutoMapper;
|
||||
using System;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace MineTec.ProManager.CustomerOrder.Dto
|
||||
{
|
||||
[AutoMapTo(typeof(Entitys.Order.CustomerOrder.CustomerOrder))]
|
||||
|
||||
public class CreateUpdateCustomerOrder : EntityDto<Guid>
|
||||
{
|
||||
/// <summary>
|
||||
/// 创建日期
|
||||
/// </summary>
|
||||
public DateTime? createtime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 创建人ID
|
||||
/// </summary>
|
||||
[StringLength(50)]
|
||||
public string createuserid { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 创建人姓名
|
||||
/// </summary>
|
||||
[StringLength(50)]
|
||||
public string createusername { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 修改日期
|
||||
/// </summary>
|
||||
public DateTime? updatetime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 修改人ID
|
||||
/// </summary>
|
||||
[StringLength(50)]
|
||||
public string updateuserid { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 修改人名称
|
||||
/// </summary>
|
||||
[StringLength(50)]
|
||||
public string updateusername { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 订单名称
|
||||
/// </summary>
|
||||
[StringLength(50)]
|
||||
public string ordername { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 供方ID
|
||||
/// </summary>
|
||||
[StringLength(50)]
|
||||
public string supplierid { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 供方名称
|
||||
/// </summary>
|
||||
[StringLength(50)]
|
||||
public string suppliername { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 供方地址
|
||||
/// </summary>
|
||||
[StringLength(200)]
|
||||
public string supplier_address { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 供方社会统一信用代码
|
||||
/// </summary>
|
||||
[StringLength(100)]
|
||||
public string supplier_creditcode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 供方开户银行
|
||||
/// </summary>
|
||||
[StringLength(50)]
|
||||
public string supplier_bank { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 供方账号
|
||||
/// </summary>
|
||||
[StringLength(50)]
|
||||
public string supplier_bankaccount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 供方电话
|
||||
/// </summary>
|
||||
[StringLength(50)]
|
||||
public string supplier_telnum { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 供方传真
|
||||
/// </summary>
|
||||
[StringLength(50)]
|
||||
public string supplier_fax { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 供方联系人
|
||||
/// </summary>
|
||||
[StringLength(50)]
|
||||
public string supplier_contactperson { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 供方手机号
|
||||
/// </summary>
|
||||
[StringLength(50)]
|
||||
public string supplier_phonenum { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 供方邮箱
|
||||
/// </summary>
|
||||
[StringLength(50)]
|
||||
public string supplier_email { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 需方ID
|
||||
/// </summary>
|
||||
[StringLength(50)]
|
||||
public string clientid { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 需方名称
|
||||
/// </summary>
|
||||
[StringLength(50)]
|
||||
public string clientname { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 需方地址
|
||||
/// </summary>
|
||||
[StringLength(200)]
|
||||
public string client_address { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 需方社会统一信用代码
|
||||
/// </summary>
|
||||
[StringLength(100)]
|
||||
public string client_creditcode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 需方开户银行
|
||||
/// </summary>
|
||||
[StringLength(50)]
|
||||
public string client_bank { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 需方账号
|
||||
/// </summary>
|
||||
[StringLength(50)]
|
||||
public string client_bankaccount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 需方电话
|
||||
/// </summary>
|
||||
[StringLength(50)]
|
||||
public string client_telnum { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 需方传真
|
||||
/// </summary>
|
||||
[StringLength(50)]
|
||||
public string client_fax { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 需方联系人
|
||||
/// </summary>
|
||||
[StringLength(50)]
|
||||
public string client_contactperson { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 需方手机号
|
||||
/// </summary>
|
||||
[StringLength(50)]
|
||||
public string client_phonenum { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 需方邮箱
|
||||
/// </summary>
|
||||
[StringLength(50)]
|
||||
public string client_email { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 备注
|
||||
/// </summary>
|
||||
[StringLength(500)]
|
||||
public string remark { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///是否关联附件:0 否, 1 是
|
||||
/// </summary>
|
||||
public int isannex { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///是否删除:0 否, 1 是
|
||||
/// </summary>
|
||||
public int isdelete { get; set; }
|
||||
|
||||
public DateTime CreationTime { get; set; }
|
||||
}
|
||||
}
|
@ -0,0 +1,202 @@
|
||||
using Abp.Application.Services.Dto;
|
||||
using Abp.AutoMapper;
|
||||
using System;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace MineTec.ProManager.CustomerOrder.Dto
|
||||
{
|
||||
[AutoMapFrom(typeof(Entitys.Order.CustomerOrder.CustomerOrder))]
|
||||
|
||||
public class CustomerOrderDto : EntityDto<Guid>
|
||||
{
|
||||
/// <summary>
|
||||
/// 创建日期
|
||||
/// </summary>
|
||||
public DateTime? createtime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 创建人ID
|
||||
/// </summary>
|
||||
[StringLength(50)]
|
||||
public string createuserid { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 创建人姓名
|
||||
/// </summary>
|
||||
[StringLength(50)]
|
||||
public string createusername { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 修改日期
|
||||
/// </summary>
|
||||
public DateTime? updatetime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 修改人ID
|
||||
/// </summary>
|
||||
[StringLength(50)]
|
||||
public string updateuserid { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 修改人名称
|
||||
/// </summary>
|
||||
[StringLength(50)]
|
||||
public string updateusername { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 订单名称
|
||||
/// </summary>
|
||||
[StringLength(50)]
|
||||
public string ordername { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 供方ID
|
||||
/// </summary>
|
||||
[StringLength(50)]
|
||||
public string supplierid { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 供方名称
|
||||
/// </summary>
|
||||
[StringLength(50)]
|
||||
public string suppliername { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 供方地址
|
||||
/// </summary>
|
||||
[StringLength(200)]
|
||||
public string supplier_address { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 供方社会统一信用代码
|
||||
/// </summary>
|
||||
[StringLength(100)]
|
||||
public string supplier_creditcode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 供方开户银行
|
||||
/// </summary>
|
||||
[StringLength(50)]
|
||||
public string supplier_bank { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 供方账号
|
||||
/// </summary>
|
||||
[StringLength(50)]
|
||||
public string supplier_bankaccount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 供方电话
|
||||
/// </summary>
|
||||
[StringLength(50)]
|
||||
public string supplier_telnum { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 供方传真
|
||||
/// </summary>
|
||||
[StringLength(50)]
|
||||
public string supplier_fax { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 供方联系人
|
||||
/// </summary>
|
||||
[StringLength(50)]
|
||||
public string supplier_contactperson { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 供方手机号
|
||||
/// </summary>
|
||||
[StringLength(50)]
|
||||
public string supplier_phonenum { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 供方邮箱
|
||||
/// </summary>
|
||||
[StringLength(50)]
|
||||
public string supplier_email { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 需方ID
|
||||
/// </summary>
|
||||
[StringLength(50)]
|
||||
public string clientid { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 需方名称
|
||||
/// </summary>
|
||||
[StringLength(50)]
|
||||
public string clientname { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 需方地址
|
||||
/// </summary>
|
||||
[StringLength(200)]
|
||||
public string client_address { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 需方社会统一信用代码
|
||||
/// </summary>
|
||||
[StringLength(100)]
|
||||
public string client_creditcode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 需方开户银行
|
||||
/// </summary>
|
||||
[StringLength(50)]
|
||||
public string client_bank { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 需方账号
|
||||
/// </summary>
|
||||
[StringLength(50)]
|
||||
public string client_bankaccount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 需方电话
|
||||
/// </summary>
|
||||
[StringLength(50)]
|
||||
public string client_telnum { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 需方传真
|
||||
/// </summary>
|
||||
[StringLength(50)]
|
||||
public string client_fax { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 需方联系人
|
||||
/// </summary>
|
||||
[StringLength(50)]
|
||||
public string client_contactperson { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 需方手机号
|
||||
/// </summary>
|
||||
[StringLength(50)]
|
||||
public string client_phonenum { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 需方邮箱
|
||||
/// </summary>
|
||||
[StringLength(50)]
|
||||
public string client_email { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 备注
|
||||
/// </summary>
|
||||
[StringLength(500)]
|
||||
public string remark { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///是否关联附件:0 否, 1 是
|
||||
/// </summary>
|
||||
public int isannex { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///是否删除:0 否, 1 是
|
||||
/// </summary>
|
||||
public int isdelete { get; set; }
|
||||
|
||||
public DateTime CreationTime { get; set; }
|
||||
}
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
using MineTec.ProManager.Commd;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace MineTec.ProManager.CustomerOrder.Dto
|
||||
{
|
||||
public class CustomerOrderOutPut : OutputBase
|
||||
{
|
||||
public List<CustomerOrderDto> data { get; set; }
|
||||
}
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
using Abp.Application.Services.Dto;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace MineTec.ProManager.CustomerOrder.Dto
|
||||
{
|
||||
|
||||
public class GetAllCustomerOrder : PagedResultRequestDto
|
||||
{
|
||||
public string ordername { get; set; } //用于订单名称搜索
|
||||
|
||||
public string suppliername { get; set; } //用于供方搜索
|
||||
|
||||
public string clientname { get; set; } //用于需方搜索
|
||||
}
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace MineTec.ProManager.CustomerOrder.Dto
|
||||
{
|
||||
public class UpdateCustomerOrder
|
||||
{
|
||||
public Guid id { get; set; } //主键
|
||||
|
||||
public string updateuserid { get; set; }//更新用户ID
|
||||
|
||||
public string updateusername { get; set; }//更新用户姓名
|
||||
|
||||
public int isdelete { get; set; }//是否删除
|
||||
}
|
||||
}
|
@ -1,10 +1,18 @@
|
||||
using System;
|
||||
using Abp.Application.Services;
|
||||
using Abp.Application.Services.Dto;
|
||||
using MineTec.ProManager.CustomerOrder.Dto;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace MineTec.ProManager.CustomerOrder
|
||||
{
|
||||
class ICustomerOrderAppService
|
||||
public interface ICustomerOrderAppService : IAsyncCrudAppService<//定义了CRUD方法
|
||||
CustomerOrderDto, //用来展示客户订单表单信息
|
||||
Guid, //客户订单实体的主键
|
||||
PagedResultRequestDto, //获取客户订单列表的时候用于分页
|
||||
CreateUpdateCustomerOrder, //用于创建客户订单
|
||||
CreateUpdateCustomerOrder> //用于更新客户订单
|
||||
{
|
||||
}
|
||||
}
|
||||
|
@ -1,10 +1,91 @@
|
||||
using System;
|
||||
using Abp.Application.Services;
|
||||
using Abp.Application.Services.Dto;
|
||||
using Abp.Collections.Extensions;
|
||||
using Abp.Domain.Repositories;
|
||||
using MineTec.ProManager.Commd;
|
||||
using MineTec.ProManager.CustomerOrderDetails.Dto;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace MineTec.ProManager.CustomerOrderDetails
|
||||
{
|
||||
class CustomerOrderDetailsAppService
|
||||
public class CustomerOrderDetailsAppService : AsyncCrudAppService<Entitys.Order.CustomerOrder.CustomerOrderDetails, CustomerOrderDetailsDto, Guid, PagedResultRequestDto,
|
||||
CreateUpdateCustomerOrderDetailsDto, CreateUpdateCustomerOrderDetailsDto>, ICustomerOrderDetailsAppService
|
||||
|
||||
{
|
||||
private readonly IRepository<Entitys.Order.CustomerOrder.CustomerOrderDetails, Guid> _CustomerOrderDetailsRepository;
|
||||
|
||||
public CustomerOrderDetailsAppService(IRepository<Entitys.Order.CustomerOrder.CustomerOrderDetails, Guid> repository, IRepository<Entitys.Order.CustomerOrder.CustomerOrderDetails, Guid> CustomerOrderDetailsRepository)
|
||||
: base(repository)
|
||||
{
|
||||
_CustomerOrderDetailsRepository = CustomerOrderDetailsRepository;
|
||||
}
|
||||
|
||||
public OutputBase CreateCustomerOrderDetails(CreateUpdateCustomerOrderDetailsDto input)
|
||||
{
|
||||
var result = new OutputBase();
|
||||
try
|
||||
{
|
||||
_CustomerOrderDetailsRepository.InsertAndGetId(ObjectMapper.Map<Entitys.Order.CustomerOrder.CustomerOrderDetails>(input));
|
||||
//base.CreateAsync(input);
|
||||
result.code = 1;//成功
|
||||
result.msg = "保存成功!";
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
result.code = 0;//失败
|
||||
result.msg = e.Message;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public CustomerOrderDetailsOutPut GetAllCustomerOrderDetails(GetAllCustomerOrderDetails input)
|
||||
{
|
||||
var result = new CustomerOrderDetailsOutPut();
|
||||
try
|
||||
{
|
||||
var query = base.CreateFilteredQuery(input).Where(t => t.isdelete != 1)
|
||||
.WhereIf(!string.IsNullOrEmpty(input.customerorderid), t => t.customerorderid == input.customerorderid);
|
||||
var CustomerOrderDetailscount = query.Count();
|
||||
var CustomerOrderDetailslist = query.ToList();
|
||||
var list = ObjectMapper.Map<List<CustomerOrderDetailsDto>>(CustomerOrderDetailslist);
|
||||
result.code = 0;
|
||||
result.count = CustomerOrderDetailscount;
|
||||
result.data = list;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
result.msg = ex.Message;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public OutputBase UpdateCustomerOrderDetails(UpdateCustomerOrderDetails input)
|
||||
{
|
||||
var result = new OutputBase();
|
||||
try
|
||||
{
|
||||
var query = _CustomerOrderDetailsRepository.GetAll().FirstOrDefault(a => a.Id == input.id);
|
||||
if (input.isdelete == 1)
|
||||
{
|
||||
query.isdelete = 1;
|
||||
}
|
||||
query.updatetime = DateTime.Now;
|
||||
query.updateuserid = input.updateuserid;
|
||||
query.updateusername = input.updateusername;
|
||||
|
||||
result.code = 1;//1成功0失败
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
result.code = 0;
|
||||
result.msg = ex.Message;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,122 @@
|
||||
using Abp.Application.Services.Dto;
|
||||
using Abp.AutoMapper;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Text;
|
||||
|
||||
namespace MineTec.ProManager.CustomerOrderDetails.Dto
|
||||
{
|
||||
[AutoMapTo(typeof(Entitys.Order.CustomerOrder.CustomerOrderDetails))]
|
||||
|
||||
public class CreateUpdateCustomerOrderDetailsDto : EntityDto<Guid>
|
||||
{
|
||||
/// <summary>
|
||||
/// 创建日期
|
||||
/// </summary>
|
||||
public DateTime? createtime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 创建人ID
|
||||
/// </summary>
|
||||
[StringLength(50)]
|
||||
public string createuserid { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 创建人姓名
|
||||
/// </summary>
|
||||
[StringLength(50)]
|
||||
public string createusername { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 修改日期
|
||||
/// </summary>
|
||||
public DateTime? updatetime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 修改人ID
|
||||
/// </summary>
|
||||
[StringLength(50)]
|
||||
public string updateuserid { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 修改人名称
|
||||
/// </summary>
|
||||
[StringLength(50)]
|
||||
public string updateusername { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 主表ID
|
||||
/// </summary>
|
||||
[StringLength(50)]
|
||||
public string customerorderid { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 代码
|
||||
/// </summary>
|
||||
[StringLength(100)]
|
||||
public string code { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 所选BOMID
|
||||
/// </summary>
|
||||
[StringLength(50)]
|
||||
public string bomid { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 所选BOM名称
|
||||
/// </summary>
|
||||
[StringLength(100)]
|
||||
public string bomname { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 规格型号
|
||||
/// </summary>
|
||||
[StringLength(100)]
|
||||
public string model { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 单位
|
||||
/// </summary>
|
||||
[StringLength(100)]
|
||||
public string unit { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 数量
|
||||
/// </summary>
|
||||
public decimal? quantity { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 单价
|
||||
/// </summary>
|
||||
public decimal? price { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 金额
|
||||
/// </summary>
|
||||
public decimal? amount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 交货日期
|
||||
/// </summary>
|
||||
public DateTime? deliverydates { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 备注
|
||||
/// </summary>
|
||||
[StringLength(500)]
|
||||
public string remark { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///是否关联附件:0 否, 1 是
|
||||
/// </summary>
|
||||
public int isannex { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///是否删除:0 否, 1 是
|
||||
/// </summary>
|
||||
public int isdelete { get; set; }
|
||||
|
||||
public DateTime CreationTime { get; set; }
|
||||
}
|
||||
}
|
@ -0,0 +1,122 @@
|
||||
using Abp.Application.Services.Dto;
|
||||
using Abp.AutoMapper;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Text;
|
||||
|
||||
namespace MineTec.ProManager.CustomerOrderDetails.Dto
|
||||
{
|
||||
[AutoMapFrom(typeof(Entitys.Order.CustomerOrder.CustomerOrderDetails))]
|
||||
|
||||
public class CustomerOrderDetailsDto : EntityDto<Guid>
|
||||
{
|
||||
/// <summary>
|
||||
/// 创建日期
|
||||
/// </summary>
|
||||
public DateTime? createtime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 创建人ID
|
||||
/// </summary>
|
||||
[StringLength(50)]
|
||||
public string createuserid { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 创建人姓名
|
||||
/// </summary>
|
||||
[StringLength(50)]
|
||||
public string createusername { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 修改日期
|
||||
/// </summary>
|
||||
public DateTime? updatetime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 修改人ID
|
||||
/// </summary>
|
||||
[StringLength(50)]
|
||||
public string updateuserid { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 修改人名称
|
||||
/// </summary>
|
||||
[StringLength(50)]
|
||||
public string updateusername { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 主表ID
|
||||
/// </summary>
|
||||
[StringLength(50)]
|
||||
public string customerorderid { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 代码
|
||||
/// </summary>
|
||||
[StringLength(100)]
|
||||
public string code { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 所选BOMID
|
||||
/// </summary>
|
||||
[StringLength(50)]
|
||||
public string bomid { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 所选BOM名称
|
||||
/// </summary>
|
||||
[StringLength(100)]
|
||||
public string bomname { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 规格型号
|
||||
/// </summary>
|
||||
[StringLength(100)]
|
||||
public string model { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 单位
|
||||
/// </summary>
|
||||
[StringLength(100)]
|
||||
public string unit { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 数量
|
||||
/// </summary>
|
||||
public decimal? quantity { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 单价
|
||||
/// </summary>
|
||||
public decimal? price { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 金额
|
||||
/// </summary>
|
||||
public decimal? amount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 交货日期
|
||||
/// </summary>
|
||||
public DateTime? deliverydates { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 备注
|
||||
/// </summary>
|
||||
[StringLength(500)]
|
||||
public string remark { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///是否关联附件:0 否, 1 是
|
||||
/// </summary>
|
||||
public int isannex { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///是否删除:0 否, 1 是
|
||||
/// </summary>
|
||||
public int isdelete { get; set; }
|
||||
|
||||
public DateTime CreationTime { get; set; }
|
||||
}
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
using MineTec.ProManager.Commd;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace MineTec.ProManager.CustomerOrderDetails.Dto
|
||||
{
|
||||
|
||||
public class CustomerOrderDetailsOutPut : OutputBase
|
||||
{
|
||||
public List<CustomerOrderDetailsDto> data { get; set; }
|
||||
}
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
using Abp.Application.Services.Dto;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace MineTec.ProManager.CustomerOrderDetails.Dto
|
||||
{
|
||||
public class GetAllCustomerOrderDetails : PagedResultRequestDto
|
||||
{
|
||||
public string customerorderid { get; set; }//用于关联CustomerOrder主表ID搜索
|
||||
|
||||
public string bomname { get; set; } //用于bom名称搜索
|
||||
|
||||
public string code { get; set; } //用于代码搜索
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace MineTec.ProManager.CustomerOrderDetails.Dto
|
||||
{
|
||||
public class UpdateCustomerOrderDetails
|
||||
{
|
||||
public Guid id { get; set; } //主键
|
||||
|
||||
public string updateuserid { get; set; }//更新用户ID
|
||||
|
||||
public string updateusername { get; set; }//更新用户姓名
|
||||
|
||||
public int isdelete { get; set; }//是否删除
|
||||
|
||||
}
|
||||
}
|
@ -1,10 +1,18 @@
|
||||
using System;
|
||||
using Abp.Application.Services;
|
||||
using Abp.Application.Services.Dto;
|
||||
using MineTec.ProManager.CustomerOrderDetails.Dto;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace MineTec.ProManager.CustomerOrderDetails
|
||||
{
|
||||
class ICustomerOrderDetailsAppService
|
||||
public interface ICustomerOrderDetailsAppService : IAsyncCrudAppService<//定义了CRUD方法
|
||||
CustomerOrderDetailsDto, //用来展示CustomerOrderDetails表单信息
|
||||
Guid, //CustomerOrderDetails实体的主键
|
||||
PagedResultRequestDto, //获取BOMDetails_Production列表的时候用于分页
|
||||
CreateUpdateCustomerOrderDetailsDto, //用于创建CustomerOrderDetails表单
|
||||
CreateUpdateCustomerOrderDetailsDto> //用于更新CustomerOrderDetails表单
|
||||
{
|
||||
}
|
||||
}
|
||||
|
@ -13,8 +13,4 @@
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\MineTec.ProManager.Core\MineTec.ProManager.Core.csproj" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="CustomerOrderDetails\Dto\" />
|
||||
<Folder Include="CustomerOrder\Dto\" />
|
||||
</ItemGroup>
|
||||
</Project>
|
Loading…
x
Reference in New Issue
Block a user