载具绑定物料接口
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Tnb.WarehouseMgr.Entities.Dto.Inputs
|
||||
{
|
||||
public class BindCarryCodeInput
|
||||
{
|
||||
public string carry_id { get; set; }
|
||||
public string barcode { get; set; }
|
||||
public decimal codeqty { get; set; }
|
||||
public string material_id { get; set; }
|
||||
public string material_code { get; set; }
|
||||
public string material_name { get; set; }
|
||||
public string location_id { get; set; } = "";
|
||||
public string location_code { get; set; } = "";
|
||||
public string code_batch { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
using Tnb.WarehouseMgr.Entities;
|
||||
using Tnb.WarehouseMgr.Entities.Dto.Inputs;
|
||||
|
||||
namespace Tnb.WarehouseMgr.Interfaces
|
||||
{
|
||||
@@ -13,5 +14,7 @@ namespace Tnb.WarehouseMgr.Interfaces
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
Task<Task<int>> UpdateNullCarry(WmsCarryH carryObj, Func<WmsCarryH, Task<int>>? updateTask = null);
|
||||
|
||||
Task<Tnb.WarehouseMgr.Entities.Dto.Outputs.Result> BindCarryMaterial(BindCarryCodeInput input);
|
||||
}
|
||||
}
|
||||
@@ -288,6 +288,11 @@ namespace Tnb.WarehouseMgr
|
||||
|
||||
SqlSugarClient cyDb = _db.CopyNew();
|
||||
|
||||
string sss = cyDb.Queryable<WmsCarryH>().LeftJoin<WmsCarryCode>((a, b) => a.id == b.carry_id)
|
||||
.LeftJoin<BasLocation>((a, b, c) => a.location_id == c.id)
|
||||
.Where(whereExpr)
|
||||
//.OrderByIF((a,b,c)=>SqlFunc.IsNullOrEmpty())
|
||||
.OrderBy("a.location_code,layers,loc_line,loc_column").ToSqlString();
|
||||
|
||||
|
||||
List<Tuple<string, WmsCarryH, WmsCarryCode, BasLocation>> items = cyDb.Queryable<WmsCarryH>().LeftJoin<WmsCarryCode>((a, b) => a.id == b.carry_id)
|
||||
|
||||
@@ -14,13 +14,16 @@ using JNPF.VisualDev.Interfaces;
|
||||
using Mapster;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using SqlSugar;
|
||||
using Tnb.BasicData.Entities;
|
||||
using Tnb.Common.Utils;
|
||||
using Tnb.WarehouseMgr.Entities;
|
||||
using Tnb.WarehouseMgr.Entities.Consts;
|
||||
using Tnb.WarehouseMgr.Entities.Dto;
|
||||
using Tnb.WarehouseMgr.Entities.Dto.Inputs;
|
||||
using Tnb.WarehouseMgr.Entities.Dto.Outputs;
|
||||
using Tnb.WarehouseMgr.Entities.Entity;
|
||||
using Tnb.WarehouseMgr.Entities.Enums;
|
||||
using Tnb.WarehouseMgr.Interfaces;
|
||||
|
||||
@@ -299,5 +302,44 @@ namespace Tnb.WarehouseMgr
|
||||
input.barCodes = input.barCodes.OrderBy(o => o).ToList();
|
||||
base.BarCodePrint(input.barCodes, input.copies,"");
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 载具绑定物料
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
/// <exception cref="ArgumentNullException"></exception>
|
||||
[HttpPost]
|
||||
public async Task<Tnb.WarehouseMgr.Entities.Dto.Outputs.Result> BindCarryMaterial(BindCarryCodeInput input)
|
||||
{
|
||||
try
|
||||
{
|
||||
WmsCarryCode wmsCarryCode = new WmsCarryCode();
|
||||
wmsCarryCode.org_id = WmsWareHouseConst.AdministratorOrgId;
|
||||
wmsCarryCode.create_time = DateTime.Now;
|
||||
wmsCarryCode.carry_id = input.carry_id;
|
||||
wmsCarryCode.barcode = input.barcode;
|
||||
wmsCarryCode.codeqty = input.codeqty;
|
||||
wmsCarryCode.material_id = input.material_id;
|
||||
wmsCarryCode.material_code = input.material_code;
|
||||
wmsCarryCode.material_name = input.material_name;
|
||||
wmsCarryCode.location_id = input.location_id;
|
||||
wmsCarryCode.location_code = input.location_code;
|
||||
wmsCarryCode.code_batch = input.code_batch;
|
||||
await _db.Insertable<WmsCarryCode>(wmsCarryCode).ExecuteCommandAsync();
|
||||
|
||||
// todo 绑定记录表
|
||||
|
||||
|
||||
return await ToApiResult(HttpStatusCode.OK, "成功");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logger.LogInformation(ex.Message);
|
||||
Logger.LogInformation(ex.StackTrace);
|
||||
return await ToApiResult(HttpStatusCode.InternalServerError, ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -308,6 +308,7 @@ namespace Tnb.WarehouseMgr
|
||||
|
||||
BasMaterial basMaterial = await _db.Queryable<BasMaterial>().FirstAsync(it => it.id == input.material_id);
|
||||
WmsCarryCode wmsCarryCode = new WmsCarryCode();
|
||||
wmsCarryCode.create_time = DateTime.Now;
|
||||
wmsCarryCode.carry_id = wmsCarryH.id;
|
||||
wmsCarryCode.barcode = wmsCarryH.carry_code;
|
||||
wmsCarryCode.codeqty = input.qty;
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
"ConnectionStrings": {
|
||||
"ConfigId": "default",
|
||||
"DBType": "PostgreSQL", //MySql;SqlServer;Oracle;PostgreSQL;Dm;Kdbndp;Sqlite;
|
||||
"Host": "192.168.11.109",
|
||||
//"Host": "127.0.0.1",
|
||||
//"Host": "192.168.11.109",
|
||||
"Host": "127.0.0.1",
|
||||
"Port": "5432",
|
||||
//"DBName": "tianyi_db",
|
||||
//"UserName": "postgres",
|
||||
|
||||
Reference in New Issue
Block a user