仓库管理_物料管理:初始化
This commit is contained in:
parent
2099805a6b
commit
d193f3fc52
@ -0,0 +1,82 @@
|
||||
using Infrastructure.Extensions;
|
||||
using JinianNet.JNTemplate;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.IdentityModel.Tokens;
|
||||
using ZR.Admin.WebApi.Extensions;
|
||||
using ZR.Model.Dto;
|
||||
using ZR.Model.MES.qu;
|
||||
using ZR.Model.MES.wms;
|
||||
using ZR.Model.MES.wms.Dto;
|
||||
using ZR.Service.mes.wms;
|
||||
using ZR.Service.mes.wms.IService;
|
||||
using static System.Runtime.InteropServices.JavaScript.JSType;
|
||||
|
||||
namespace ZR.Admin.WebApi.Controllers.mes.wms
|
||||
{
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 退库模块
|
||||
/// </summary>
|
||||
[Route("/mes/wm/exitwarehouse")]
|
||||
public class WMExitwarehouseController : BaseController
|
||||
{
|
||||
private readonly IWMExitwarehouseService Exitwarehouse;
|
||||
public WMExitwarehouseController(IWMExitwarehouseService Exitwarehouse) {
|
||||
this.Exitwarehouse = Exitwarehouse;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 一般退库
|
||||
/// </summary>
|
||||
/// <param name="original"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("common")]
|
||||
public IActionResult ExitwarehouseCommmon(string originalCode)
|
||||
{
|
||||
string msg = null;
|
||||
bool data = Exitwarehouse.ExitwarehouseCommmon(originalCode);
|
||||
if (data)
|
||||
{
|
||||
msg = "退库成功";
|
||||
}
|
||||
else
|
||||
{
|
||||
msg = "箱子不在仓库中";
|
||||
}
|
||||
return ToResponse(new ApiResult(200, msg, data));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 7 判断箱子是否存在成品库仓库里
|
||||
/// </summary>
|
||||
/// <param name="PatchCode"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("is_existed_warehouse")]
|
||||
public IActionResult IsExistedWarehouse(string originalCode = "")
|
||||
{
|
||||
if (string.IsNullOrEmpty(originalCode))
|
||||
{
|
||||
|
||||
return ToResponse(new ApiResult(200, "传入为空", false));
|
||||
}
|
||||
string msg = null;
|
||||
bool data = this.Exitwarehouse.IsExistedWarehouse(originalCode);
|
||||
if (data)
|
||||
{
|
||||
msg = "存在";
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
msg = "不存在";
|
||||
}
|
||||
|
||||
return ToResponse(new ApiResult(200, msg, data));
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@ -113,23 +113,23 @@ namespace ZR.Admin.WebApi.Controllers.mes.wms
|
||||
return ToResponse(new ApiResult(200, "传入为空", false));
|
||||
}
|
||||
string msg = "";
|
||||
bool data = false;
|
||||
|
||||
string createName = HttpContext.GetName();
|
||||
|
||||
int status = this.wm_entryWarehousing_productService.IntoProductwarehouse(wmgoodsDto, createName);
|
||||
if (status == 0)
|
||||
int num = this.wm_entryWarehousing_productService.IntoProductwarehouse(wmgoodsDto, createName);
|
||||
if (num == 0)
|
||||
{
|
||||
msg = "数据插入异常";
|
||||
data = false;
|
||||
|
||||
|
||||
}
|
||||
else if (status == 1)
|
||||
else if (num >= 1)
|
||||
{
|
||||
msg = "success";
|
||||
data = true;
|
||||
msg = "成功入库"+num+"个";
|
||||
|
||||
|
||||
}
|
||||
return ToResponse(new ApiResult(200, msg, data));
|
||||
return ToResponse(new ApiResult(200, msg, num));
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取库位已经存在箱子
|
||||
|
||||
113
ZR.Admin.WebApi/Controllers/mes/wms/WmMaterialController.cs
Normal file
113
ZR.Admin.WebApi/Controllers/mes/wms/WmMaterialController.cs
Normal file
@ -0,0 +1,113 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using ZR.Model.Dto;
|
||||
|
||||
using ZR.Admin.WebApi.Extensions;
|
||||
using ZR.Admin.WebApi.Filters;
|
||||
using ZR.Service.mes.wms.IService;
|
||||
using ZR.Model.MES.wms.Dto;
|
||||
using ZR.Model.MES.wms;
|
||||
using Org.BouncyCastle.Crypto;
|
||||
|
||||
//创建时间:2024-03-16
|
||||
namespace ZR.Admin.WebApi.Controllers
|
||||
{
|
||||
/// <summary>
|
||||
/// 物料记录表增删改查
|
||||
/// </summary>
|
||||
[Verify]
|
||||
[Route("/mes/wm/WmMaterial")]
|
||||
public class WmMaterialController : BaseController
|
||||
{
|
||||
/// <summary>
|
||||
/// 物料记录表接口
|
||||
/// </summary>
|
||||
private readonly IWmMaterialService _WmMaterialService;
|
||||
|
||||
public WmMaterialController(IWmMaterialService WmMaterialService)
|
||||
{
|
||||
_WmMaterialService = WmMaterialService;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查询物料记录表列表
|
||||
/// </summary>
|
||||
/// <param name="parm"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("list")]
|
||||
[ActionPermissionFilter(Permission = "wms:wmmaterial:list")]
|
||||
public IActionResult QueryWmMaterial([FromQuery] WmMaterialQueryDto parm)
|
||||
{
|
||||
var response = _WmMaterialService.GetList(parm);
|
||||
return SUCCESS(response);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 查询物料记录表详情
|
||||
/// </summary>
|
||||
/// <param name="Id"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("{Id}")]
|
||||
[ActionPermissionFilter(Permission = "wms:wmmaterial:query")]
|
||||
public IActionResult GetWmMaterial(string Id)
|
||||
{
|
||||
var response = _WmMaterialService.GetInfo(Id);
|
||||
|
||||
var info = response.Adapt<WmMaterial>();
|
||||
return SUCCESS(info);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加物料记录表
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[ActionPermissionFilter(Permission = "wms:wmmaterial:add")]
|
||||
[Log(Title = "物料记录表", BusinessType = BusinessType.INSERT)]
|
||||
public IActionResult AddWmMaterial([FromBody] WmMaterialDto parm)
|
||||
{
|
||||
var modal = parm.Adapt<WmMaterial>().ToCreate(HttpContext);
|
||||
|
||||
var response = _WmMaterialService.AddWmMaterial(modal);
|
||||
|
||||
return SUCCESS(response);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 更新物料记录表
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpPut]
|
||||
[ActionPermissionFilter(Permission = "wms:wmmaterial:edit")]
|
||||
[Log(Title = "物料记录表", BusinessType = BusinessType.UPDATE)]
|
||||
public IActionResult UpdateWmMaterial([FromBody] WmMaterialDto parm)
|
||||
{
|
||||
var modal = parm.Adapt<WmMaterial>().ToUpdate(HttpContext);
|
||||
var response = _WmMaterialService.UpdateWmMaterial(modal);
|
||||
|
||||
return ToResponse(response);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 删除物料记录表
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpDelete("{ids}")]
|
||||
[ActionPermissionFilter(Permission = "wms:wmmaterial:delete")]
|
||||
[Log(Title = "物料记录表", BusinessType = BusinessType.DELETE)]
|
||||
public IActionResult DeleteWmMaterial(string ids)
|
||||
{
|
||||
long[] idsArr = Tools.SpitLongArrary(ids);
|
||||
if (idsArr.Length <= 0) { return ToResponse(ApiResult.Error($"删除失败Id 不能为空")); }
|
||||
|
||||
|
||||
var response = _WmMaterialService.Delete(idsArr);
|
||||
|
||||
return ToResponse(response);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@ -1,4 +1,5 @@
|
||||
using JinianNet.JNTemplate;
|
||||
using System.Net.NetworkInformation;
|
||||
using ZR.Common;
|
||||
|
||||
namespace ZR.Admin.WebApi.Extensions
|
||||
@ -14,6 +15,29 @@ namespace ZR.Admin.WebApi.Extensions
|
||||
Console.WriteLine(content);
|
||||
Console.ForegroundColor = ConsoleColor.Blue;
|
||||
|
||||
// 获取本地计算机的所有网络接口信息
|
||||
NetworkInterface[] networkInterfaces = NetworkInterface.GetAllNetworkInterfaces();
|
||||
|
||||
foreach (NetworkInterface networkInterface in networkInterfaces)
|
||||
{
|
||||
// 过滤出活动的网络接口
|
||||
if (networkInterface.OperationalStatus == OperationalStatus.Up)
|
||||
{
|
||||
// 获取网络接口的IP属性
|
||||
IPInterfaceProperties ipProperties = networkInterface.GetIPProperties();
|
||||
UnicastIPAddressInformationCollection ipAddresses = ipProperties.UnicastAddresses;
|
||||
|
||||
foreach (UnicastIPAddressInformation ipAddress in ipAddresses)
|
||||
{
|
||||
// 输出IPv4地址
|
||||
if (ipAddress.Address.AddressFamily == System.Net.Sockets.AddressFamily.InterNetwork)
|
||||
{
|
||||
Console.WriteLine("本机ip: "+ipAddress.Address.ToString());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -11,7 +11,7 @@
|
||||
{
|
||||
|
||||
//外网连接服务器
|
||||
"Conn": "Data Source=127.0.0.01;User ID=root;Password=123456;Initial Catalog=ZrAdmin;",
|
||||
"Conn": "Data Source=127.0.0.1;User ID=root;Password=123456;Initial Catalog=ZrAdmin;",
|
||||
|
||||
//外网连接服务器
|
||||
//"Conn": "Data Source=47.116.122.230;Port=3307;User ID=root;Password=123456;Initial Catalog=ZrAdmin;",
|
||||
@ -26,7 +26,7 @@
|
||||
//代码生成数据库配置
|
||||
"CodeGenDbConfig": {
|
||||
//代码生成连接字符串,注意{dbName}为固定格式,不要填写数据库名
|
||||
"Conn": "Data Source=47.116.122.230;Port=3307;User ID=root;Password=123456;Initial Catalog={dbName};",
|
||||
"Conn": "Data Source=127.0.0.1;Port=3306;User ID=root;Password=123456;Initial Catalog={dbName};",
|
||||
"DbType": 0,
|
||||
"IsAutoCloseConnection": true,
|
||||
"DbName": "ZrAdmin" //代码生成默认连接数据库
|
||||
|
||||
Binary file not shown.
@ -32,6 +32,8 @@ namespace ZR.Common
|
||||
return infoIdss;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 根据日期获取星期几
|
||||
/// </summary>
|
||||
|
||||
59
ZR.Model/MES/wms/Dto/WmMaterialDto.cs
Normal file
59
ZR.Model/MES/wms/Dto/WmMaterialDto.cs
Normal file
@ -0,0 +1,59 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace ZR.Model.MES.wms.Dto
|
||||
{
|
||||
/// <summary>
|
||||
/// 物料记录表查询对象
|
||||
/// </summary>
|
||||
public class WmMaterialQueryDto : PagerInfo
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 物料记录表输入输出对象
|
||||
/// </summary>
|
||||
public class WmMaterialDto
|
||||
{
|
||||
|
||||
public string Id { get; set; }
|
||||
|
||||
public string Partnumber { get; set; }
|
||||
|
||||
public string U8InventoryCode { get; set; }
|
||||
|
||||
public string BlankNum { get; set; }
|
||||
|
||||
public string Unit { get; set; }
|
||||
|
||||
public string ProductName { get; set; }
|
||||
|
||||
public string Color { get; set; }
|
||||
|
||||
public string Specification { get; set; }
|
||||
|
||||
public string Description { get; set; }
|
||||
|
||||
public string Version { get; set; }
|
||||
|
||||
public string Remarks { get; set; }
|
||||
|
||||
public int? Sort { get; set; }
|
||||
|
||||
public string Search1 { get; set; }
|
||||
|
||||
public string Search2 { get; set; }
|
||||
|
||||
public int? Status { get; set; }
|
||||
|
||||
public string CreatedBy { get; set; }
|
||||
|
||||
public DateTime? CreatedTime { get; set; }
|
||||
|
||||
public string UpdatedBy { get; set; }
|
||||
|
||||
public DateTime? UpdatedTime { get; set; }
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
59
ZR.Model/MES/wms/WmCustom.cs
Normal file
59
ZR.Model/MES/wms/WmCustom.cs
Normal file
@ -0,0 +1,59 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using SqlSugar;
|
||||
namespace ZR.Model.MES.wms
|
||||
{
|
||||
/// <summary>
|
||||
/// 客户信息
|
||||
///</summary>
|
||||
[SugarTable("wm_custom")]
|
||||
public class WmCustom
|
||||
{
|
||||
/// <summary>
|
||||
/// 主键
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName="id" ,IsPrimaryKey = true ,IsIdentity = true )]
|
||||
public int Id { get; set; }
|
||||
/// <summary>
|
||||
/// 客户代码
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName="custom_no" )]
|
||||
public string CustomNo { get; set; }
|
||||
/// <summary>
|
||||
/// 客户名称
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName="custom_name" )]
|
||||
public string CustomName { get; set; }
|
||||
/// <summary>
|
||||
/// 客户地址
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName="custom_address" )]
|
||||
public string CustomAddress { get; set; }
|
||||
/// <summary>
|
||||
/// 备注
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName="remark" )]
|
||||
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; }
|
||||
}
|
||||
}
|
||||
64
ZR.Model/MES/wms/WmInLog.cs
Normal file
64
ZR.Model/MES/wms/WmInLog.cs
Normal file
@ -0,0 +1,64 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using SqlSugar;
|
||||
namespace ZR.Model.MES.wms
|
||||
{
|
||||
/// <summary>
|
||||
/// 入库日志(U8上传)
|
||||
///</summary>
|
||||
[SugarTable("wm_in_log")]
|
||||
public class WmInLog
|
||||
{
|
||||
/// <summary>
|
||||
/// 主键(雪花生产)
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName="id" )]
|
||||
public string Id { get; set; }
|
||||
/// <summary>
|
||||
/// u8库存编码
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName="u8_inventory_code" )]
|
||||
public string U8InventoryCode { get; set; }
|
||||
/// <summary>
|
||||
/// 仓库编号
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName="wm_info_id" )]
|
||||
public string WmInfoId { get; set; }
|
||||
/// <summary>
|
||||
/// mes内码
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName="package_code" )]
|
||||
public string PackageCode { get; set; }
|
||||
/// <summary>
|
||||
/// 批次号
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName="code" )]
|
||||
public string Code { get; set; }
|
||||
/// <summary>
|
||||
/// 数量
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName="number" )]
|
||||
public string Number { 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; }
|
||||
}
|
||||
}
|
||||
109
ZR.Model/MES/wms/WmMaterial.cs
Normal file
109
ZR.Model/MES/wms/WmMaterial.cs
Normal file
@ -0,0 +1,109 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using SqlSugar;
|
||||
namespace ZR.Model.MES.wms
|
||||
{
|
||||
/// <summary>
|
||||
/// 物料记录表
|
||||
///</summary>
|
||||
[SugarTable("wm_material")]
|
||||
public class WmMaterial
|
||||
{
|
||||
/// <summary>
|
||||
/// 主键G
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName="id" ,IsPrimaryKey = true )]
|
||||
public string Id { get; set; }
|
||||
/// <summary>
|
||||
/// 物料号(零件号)
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName="partnumber")]
|
||||
public string Partnumber { get; set; }
|
||||
/// <summary>
|
||||
/// U8库存编码
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName="u8_inventory_code")]
|
||||
public string U8InventoryCode { get; set; }
|
||||
/// <summary>
|
||||
/// 毛坯号
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName="blank_num" )]
|
||||
public string BlankNum { get; set; }
|
||||
/// <summary>
|
||||
/// 单位
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName="unit" )]
|
||||
public string Unit { get; set; }
|
||||
/// <summary>
|
||||
/// 产品描述(产品名称)
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName="product_name" )]
|
||||
public string ProductName { get; set; }
|
||||
/// <summary>
|
||||
/// 产品颜色
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName="color" )]
|
||||
public string Color { get; set; }
|
||||
/// <summary>
|
||||
/// 规格(左右脚)
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName="specification" )]
|
||||
public string Specification { get; set; }
|
||||
/// <summary>
|
||||
/// 显示描述(产品描述+颜色+规格)
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName="description" )]
|
||||
public string Description { get; set; }
|
||||
/// <summary>
|
||||
/// 版本号
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName="version" )]
|
||||
public string Version { get; set; }
|
||||
/// <summary>
|
||||
/// 备注
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName="remarks" )]
|
||||
public string Remarks { get; set; }
|
||||
/// <summary>
|
||||
/// 排序(特殊排序)
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName="sort" )]
|
||||
public int? Sort { get; set; }
|
||||
/// <summary>
|
||||
/// 便捷搜索字段1
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName="search1" )]
|
||||
public string Search1 { get; set; }
|
||||
/// <summary>
|
||||
/// 便捷搜索字段2
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName="search2" )]
|
||||
public string Search2 { get; set; }
|
||||
/// <summary>
|
||||
/// 状态(0-不可见 1-可见)
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName="status" )]
|
||||
public int? Status { 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; }
|
||||
}
|
||||
}
|
||||
129
ZR.Model/MES/wms/WmOutOrder.cs
Normal file
129
ZR.Model/MES/wms/WmOutOrder.cs
Normal file
@ -0,0 +1,129 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using SqlSugar;
|
||||
namespace ZR.Model.MES.wms
|
||||
{
|
||||
/// <summary>
|
||||
/// 出货单(物料+客户)
|
||||
///</summary>
|
||||
[SugarTable("wm_out_order")]
|
||||
public class WmOutOrder
|
||||
{
|
||||
/// <summary>
|
||||
/// 主键G
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName="id" ,IsPrimaryKey = true )]
|
||||
public string Id { get; set; }
|
||||
/// <summary>
|
||||
/// 出货单号(雪花算法)
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName="shipment_num" )]
|
||||
public string ShipmentNum { get; set; }
|
||||
/// <summary>
|
||||
/// 客户id
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName="custom_id" )]
|
||||
public string CustomId { get; set; }
|
||||
/// <summary>
|
||||
/// 客户代码
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName="custom_no" )]
|
||||
public string CustomNo { get; set; }
|
||||
/// <summary>
|
||||
/// 客户名称
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName="custom_name" )]
|
||||
public string CustomName { get; set; }
|
||||
/// <summary>
|
||||
/// 客户地址
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName="custom_address" )]
|
||||
public string CustomAddress { get; set; }
|
||||
/// <summary>
|
||||
/// 物料号(零件号)
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName="partnumber" )]
|
||||
public string Partnumber { get; set; }
|
||||
/// <summary>
|
||||
/// 单位
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName="unit" )]
|
||||
public string Unit { get; set; }
|
||||
/// <summary>
|
||||
/// 产品描述(产品名称)
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName="product_name" )]
|
||||
public string ProductName { get; set; }
|
||||
/// <summary>
|
||||
/// 产品颜色
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName="color" )]
|
||||
public string Color { get; set; }
|
||||
/// <summary>
|
||||
/// 规格(左右脚)
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName="specification" )]
|
||||
public string Specification { get; set; }
|
||||
/// <summary>
|
||||
/// 显示描述(产品描述+颜色+规格)
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName="description" )]
|
||||
public string Description { get; set; }
|
||||
/// <summary>
|
||||
/// 版本号
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName="version" )]
|
||||
public string Version { get; set; }
|
||||
/// <summary>
|
||||
/// 备注
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName="remarks" )]
|
||||
public string Remarks { get; set; }
|
||||
/// <summary>
|
||||
/// 状态(0-不可见 1-可见)
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName="status" )]
|
||||
public int? Status { get; set; }
|
||||
/// <summary>
|
||||
/// 年
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName="year" )]
|
||||
public int? Year { get; set; }
|
||||
/// <summary>
|
||||
/// 周
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName="week" )]
|
||||
public int? Week { get; set; }
|
||||
/// <summary>
|
||||
/// 日
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName="date" )]
|
||||
public int? Date { get; set; }
|
||||
/// <summary>
|
||||
/// 要货数量
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName="number" )]
|
||||
public int? Number { 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; }
|
||||
}
|
||||
}
|
||||
@ -8,6 +8,10 @@
|
||||
<Compile Remove="mes\md\MdMaterialReceiptService.cs" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Remove="mes\wms\IService\IWMExitwarehouseService.cs~RFf4cb4c.TMP" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="AutoMapper.Extensions.Microsoft.DependencyInjection" Version="12.0.1" />
|
||||
</ItemGroup>
|
||||
|
||||
26
ZR.Service/mes/wms/IService/IWMExitwarehouseService.cs
Normal file
26
ZR.Service/mes/wms/IService/IWMExitwarehouseService.cs
Normal file
@ -0,0 +1,26 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ZR.Service.mes.wms.IService
|
||||
{
|
||||
public interface IWMExitwarehouseService
|
||||
{
|
||||
/// <summary>
|
||||
/// 一般退库
|
||||
/// </summary>
|
||||
/// <param name="original"></param>
|
||||
/// <returns></returns>
|
||||
public bool ExitwarehouseCommmon(string original);
|
||||
/// <summary>
|
||||
/// 判断箱子是否存在陈平库中
|
||||
/// </summary>
|
||||
/// <param name="originalCode"></param>
|
||||
/// <returns></returns>
|
||||
|
||||
public bool IsExistedWarehouse(string originalCode);
|
||||
|
||||
}
|
||||
}
|
||||
24
ZR.Service/mes/wms/IService/IWmMaterialService.cs
Normal file
24
ZR.Service/mes/wms/IService/IWmMaterialService.cs
Normal file
@ -0,0 +1,24 @@
|
||||
using System;
|
||||
using ZR.Model;
|
||||
using ZR.Model.Dto;
|
||||
using System.Collections.Generic;
|
||||
using ZR.Model.MES.wms;
|
||||
using ZR.Model.MES.wms.Dto;
|
||||
|
||||
namespace ZR.Service.mes.wms.IService
|
||||
{
|
||||
/// <summary>
|
||||
/// 物料记录表service接口
|
||||
/// </summary>
|
||||
public interface IWmMaterialService : IBaseService<WmMaterial>
|
||||
{
|
||||
PagedInfo<WmMaterialDto> GetList(WmMaterialQueryDto parm);
|
||||
|
||||
WmMaterial GetInfo(string Id);
|
||||
|
||||
WmMaterial AddWmMaterial(WmMaterial parm);
|
||||
|
||||
int UpdateWmMaterial(WmMaterial parm);
|
||||
|
||||
}
|
||||
}
|
||||
115
ZR.Service/mes/wms/WMExitwarehouseService.cs
Normal file
115
ZR.Service/mes/wms/WMExitwarehouseService.cs
Normal file
@ -0,0 +1,115 @@
|
||||
using Infrastructure.Attribute;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using ZR.Model.MES.pro;
|
||||
using ZR.Model.MES.wms;
|
||||
using ZR.Model.MES.wms.Dto;
|
||||
using ZR.Service.mes.wms.IService;
|
||||
|
||||
namespace ZR.Service.mes.wms
|
||||
{
|
||||
|
||||
[AppService(ServiceType = typeof(IWMExitwarehouseService), ServiceLifetime = LifeTime.Transient)]
|
||||
public class WMExitwarehouseService : BaseService<WmInfo>, IWMExitwarehouseService
|
||||
{
|
||||
private NLog.Logger logger = NLog.LogManager.GetCurrentClassLogger();
|
||||
//普通入库
|
||||
public bool ExitwarehouseCommmon(string original)
|
||||
{
|
||||
ResultionPackageCodeDto packageCode = ResolutionPackagecode(original);
|
||||
string patchCode = packageCode.PatchCode;
|
||||
|
||||
|
||||
int result = Context.Deleteable<WmGoodsNowProduction>().Where(it => it.PackageCodeClient == patchCode).ExecuteCommand();
|
||||
|
||||
if (result == 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 判断箱子是否在成品库中
|
||||
/// </summary>
|
||||
/// <param name="PatchCode"></param>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="NotImplementedException"></exception>
|
||||
public bool IsExistedWarehouse(string originalCode)
|
||||
{
|
||||
ResultionPackageCodeDto resultionPackage = ResolutionPackagecode(originalCode);
|
||||
|
||||
return Context.Queryable<WmGoodsNowProduction>().Where(it => it.PackageCodeClient == resultionPackage.PatchCode).Any();
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 解析外箱标签码
|
||||
/// </summary>
|
||||
/// <param name="packagecode"></param>
|
||||
/// <returns></returns>
|
||||
private ResultionPackageCodeDto ResolutionPackagecode(string packagecode)
|
||||
{
|
||||
ResultionPackageCodeDto resultionPackageCode = new ResultionPackageCodeDto();
|
||||
try
|
||||
{
|
||||
resultionPackageCode.originalCode = packagecode;
|
||||
|
||||
// todo 解析外箱标签码
|
||||
string[] splitstr = packagecode.Split('^');
|
||||
resultionPackageCode.PatchCode = splitstr[0].Substring(5);
|
||||
|
||||
//todo 解析零件号
|
||||
string partnumber = splitstr[1].Substring(11);
|
||||
//int length = lingshi.Length - 2;
|
||||
//string partnumber = lingshi.Substring(0, length);
|
||||
resultionPackageCode.PartNumner = partnumber;
|
||||
//todo 解析工单号
|
||||
string workoderidid = splitstr[2].Substring(7);
|
||||
resultionPackageCode.WorkoderID = workoderidid;
|
||||
//todo 生产描述
|
||||
resultionPackageCode.ProductionTime = "20" + workoderidid.Substring(0, 6);
|
||||
//todo 解析箱子中产品数量
|
||||
string product_num = splitstr[3].Substring(4);
|
||||
resultionPackageCode.Quantity = product_num;
|
||||
//todo 产品描述 partnumber
|
||||
// ProWorklplan_v2 plan= Context.Queryable<ProWorklplan_v2>().Where(it => it.Partnumber == partnumber).First();
|
||||
//if(plan != null)
|
||||
// {
|
||||
// resultionPackageCode.ProductionDescribe = plan.ProductName;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// resultionPackageCode.ProductionDescribe = "生产计划无此零件号";
|
||||
// }
|
||||
ProWorkorder_v2 workorder = Context.Queryable<ProWorkorder_v2>().Where(it => it.FinishedPartNumber == partnumber).First();
|
||||
|
||||
if (workorder != null)
|
||||
{
|
||||
resultionPackageCode.ProductionDescribe = workorder.ProductDescription;
|
||||
}
|
||||
else
|
||||
{
|
||||
resultionPackageCode.ProductionDescribe = "生产工单无此零件号";
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
logger.Error($"外箱标签码,解析失败 {ex.Message}");
|
||||
|
||||
}
|
||||
|
||||
return resultionPackageCode;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -10,6 +10,8 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading.Tasks;
|
||||
using ZR.Model.mes.pro;
|
||||
using ZR.Model.MES.pro;
|
||||
using ZR.Model.MES.qu;
|
||||
using ZR.Model.MES.wms;
|
||||
using ZR.Model.MES.wms.Dto;
|
||||
@ -218,17 +220,25 @@ namespace ZR.Service.mes.wms
|
||||
string product_num = splitstr[3].Substring(4);
|
||||
resultionPackageCode.Quantity = product_num;
|
||||
//todo 产品描述 partnumber
|
||||
ProWorklplan_v2 plan= Context.Queryable<ProWorklplan_v2>().Where(it => it.Partnumber == partnumber).First();
|
||||
if(plan != null)
|
||||
// ProWorklplan_v2 plan= Context.Queryable<ProWorklplan_v2>().Where(it => it.Partnumber == partnumber).First();
|
||||
//if(plan != null)
|
||||
// {
|
||||
// resultionPackageCode.ProductionDescribe = plan.ProductName;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// resultionPackageCode.ProductionDescribe = "生产计划无此零件号";
|
||||
// }
|
||||
ProWorkorder_v2 workorder= Context.Queryable<ProWorkorder_v2>().Where(it => it.FinishedPartNumber == partnumber).First();
|
||||
|
||||
if (workorder != null)
|
||||
{
|
||||
resultionPackageCode.ProductionDescribe = plan.ProductName;
|
||||
resultionPackageCode.ProductionDescribe = workorder.ProductDescription;
|
||||
}
|
||||
else
|
||||
{
|
||||
resultionPackageCode.ProductionDescribe = "生产计划无此零件号";
|
||||
resultionPackageCode.ProductionDescribe = "生产工单无此零件号";
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
98
ZR.Service/mes/wms/WmMaterialService.cs
Normal file
98
ZR.Service/mes/wms/WmMaterialService.cs
Normal file
@ -0,0 +1,98 @@
|
||||
using System;
|
||||
using SqlSugar;
|
||||
using Infrastructure.Attribute;
|
||||
using Infrastructure.Extensions;
|
||||
using ZR.Model;
|
||||
using ZR.Model.Dto;
|
||||
|
||||
using ZR.Repository;
|
||||
|
||||
using System.Linq;
|
||||
using ZR.Service.mes.wms.IService;
|
||||
using ZR.Model.MES.wms;
|
||||
using ZR.Model.MES.wms.Dto;
|
||||
|
||||
namespace ZR.Service.mes.wms
|
||||
{
|
||||
/// <summary>
|
||||
/// 物料记录表Service业务层处理
|
||||
/// </summary>
|
||||
[AppService(ServiceType = typeof(IWmMaterialService), ServiceLifetime = LifeTime.Transient)]
|
||||
public class WmMaterialService : BaseService<WmMaterial>, IWmMaterialService
|
||||
{
|
||||
/// <summary>
|
||||
/// 查询物料记录表列表
|
||||
/// </summary>
|
||||
/// <param name="parm"></param>
|
||||
/// <returns></returns>
|
||||
public PagedInfo<WmMaterialDto> GetList(WmMaterialQueryDto parm)
|
||||
{
|
||||
var predicate = Expressionable.Create<WmMaterial>();
|
||||
|
||||
var response = Queryable()
|
||||
.Where(predicate.ToExpression())
|
||||
.ToPage<WmMaterial, WmMaterialDto>(parm);
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 获取详情
|
||||
/// </summary>
|
||||
/// <param name="Id"></param>
|
||||
/// <returns></returns>
|
||||
public WmMaterial GetInfo(string Id)
|
||||
{
|
||||
var response = Queryable()
|
||||
.Where(x => x.Id == Id)
|
||||
.First();
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加物料记录表
|
||||
/// </summary>
|
||||
/// <param name="model"></param>
|
||||
/// <returns></returns>
|
||||
public WmMaterial AddWmMaterial(WmMaterial model)
|
||||
{
|
||||
model.Id= SnowFlakeSingle.Instance.NextId().ToString();
|
||||
return Context.Insertable(model).ExecuteReturnEntity();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改物料记录表
|
||||
/// </summary>
|
||||
/// <param name="model"></param>
|
||||
/// <returns></returns>
|
||||
public int UpdateWmMaterial(WmMaterial model)
|
||||
{
|
||||
//var response = Update(w => w.Id == model.Id, it => new WmMaterial()
|
||||
//{
|
||||
// Partnumber = model.Partnumber,
|
||||
// U8InventoryCode = model.U8InventoryCode,
|
||||
// BlankNum = model.BlankNum,
|
||||
// Unit = model.Unit,
|
||||
// ProductName = model.ProductName,
|
||||
// Color = model.Color,
|
||||
// Specification = model.Specification,
|
||||
// Description = model.Description,
|
||||
// Version = model.Version,
|
||||
// Remarks = model.Remarks,
|
||||
// Sort = model.Sort,
|
||||
// Search1 = model.Search1,
|
||||
// Search2 = model.Search2,
|
||||
// Status = model.Status,
|
||||
// CreatedBy = model.CreatedBy,
|
||||
// CreatedTime = model.CreatedTime,
|
||||
// UpdatedBy = model.UpdatedBy,
|
||||
// UpdatedTime = model.UpdatedTime,
|
||||
//});
|
||||
//return response;
|
||||
return Update(model, true);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user