bug
This commit is contained in:
@@ -0,0 +1,98 @@
|
||||
namespace Tnb.ProductionMgr.Entities.Dto.PrdManage
|
||||
{
|
||||
public class PrdRawMaterialBarcodeListDto
|
||||
{
|
||||
public string id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 单据编号
|
||||
/// </summary>
|
||||
public string bill_code { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 料仓id
|
||||
/// </summary>
|
||||
public string equip_id { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 机台id
|
||||
/// </summary>
|
||||
public string equip_ids { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 截料阀
|
||||
/// </summary>
|
||||
public string stop_valve { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 物料id
|
||||
/// </summary>
|
||||
public string? material_id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 1 料仓原料条码 2 机台原料
|
||||
/// </summary>
|
||||
public string type { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否更新
|
||||
/// </summary>
|
||||
public string is_update { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 吸料完成
|
||||
/// </summary>
|
||||
public string absorb_material_finish { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 管道状态
|
||||
/// </summary>
|
||||
public int piping_status { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 开始时间
|
||||
/// </summary>
|
||||
public string start_time { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 结束时间
|
||||
/// </summary>
|
||||
public string end_time { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 备注
|
||||
/// </summary>
|
||||
public string? remark { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 创建用户
|
||||
/// </summary>
|
||||
public string? create_id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 创建时间
|
||||
/// </summary>
|
||||
public DateTime? create_time { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 修改用户
|
||||
/// </summary>
|
||||
public string? modify_id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 修改时间
|
||||
/// </summary>
|
||||
public DateTime? modify_time { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 所属组织
|
||||
/// </summary>
|
||||
public string? org_id { get; set; }
|
||||
|
||||
public string equip_id_id { get; set; }
|
||||
|
||||
public string material_id_id { get; set; }
|
||||
|
||||
public string f_flowid { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -2,14 +2,17 @@ using JNPF;
|
||||
using JNPF.Common.Core.Manager;
|
||||
using JNPF.Common.Dtos.VisualDev;
|
||||
using JNPF.Common.Extension;
|
||||
using JNPF.Common.Filter;
|
||||
using JNPF.Common.Security;
|
||||
using JNPF.DependencyInjection;
|
||||
using JNPF.DynamicApiController;
|
||||
using JNPF.FriendlyException;
|
||||
using JNPF.Logging;
|
||||
using JNPF.Systems.Entitys.System;
|
||||
using JNPF.Systems.Interfaces.System;
|
||||
using JNPF.VisualDev;
|
||||
using JNPF.VisualDev.Entitys;
|
||||
using JNPF.VisualDev.Entitys.Dto.VisualDevModelData;
|
||||
using JNPF.VisualDev.Interfaces;
|
||||
using Mapster;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
@@ -26,6 +29,7 @@ using Tnb.Common.Utils;
|
||||
using Tnb.WarehouseMgr.Entities.Consts;
|
||||
using HttpClientHelper = Tnb.Common.Utils.HttpClientHelper;
|
||||
using Tnb.Common.Redis;
|
||||
using Tnb.ProductionMgr.Entities.Dto.PrdManage;
|
||||
|
||||
namespace Tnb.ProductionMgr
|
||||
{
|
||||
@@ -65,6 +69,40 @@ namespace Tnb.ProductionMgr
|
||||
_runService = runService;
|
||||
_redisData = redisData;
|
||||
OverideFuncs.UpdateAsync = Update;
|
||||
OverideFuncs.GetListAsync = GetList;
|
||||
}
|
||||
|
||||
private async Task<dynamic> GetList(VisualDevModelListQueryInput input)
|
||||
{
|
||||
Dictionary<string, object>? queryJson = !string.IsNullOrEmpty(input.queryJson) ? Newtonsoft.Json.JsonConvert.DeserializeObject<Dictionary<string, object>>(input.queryJson) : new Dictionary<string, object>();
|
||||
string billCode = queryJson.ContainsKey("bill_code") ? queryJson["bill_code"].ToString() : "";
|
||||
string equipTypeId = queryJson.ContainsKey("f_flowid") ? queryJson["f_flowid"].ToString() : "";
|
||||
string isUpdate = queryJson.ContainsKey("is_update") ? queryJson["is_update"].ToString() : "";
|
||||
|
||||
SqlSugarPagedList<PrdRawMaterialBarcodeListDto> result = await _db.Queryable<PrdRawMaterialBarcode>()
|
||||
.LeftJoin<BasMaterial>((a, b) => a.material_id == b.id)
|
||||
.LeftJoin<EqpEquipment>((a, b,c) => a.equip_id == c.id)
|
||||
.LeftJoin<EqpEquipType>((a,b,c,d)=>c.equip_type_id==d.id)
|
||||
.WhereIF(!string.IsNullOrEmpty(billCode),(a,b,c)=>a.bill_code.Contains(billCode))
|
||||
.WhereIF(!string.IsNullOrEmpty(equipTypeId),(a,b,c)=>c.equip_type_id==equipTypeId)
|
||||
.WhereIF(!string.IsNullOrEmpty(isUpdate),(a,b,c)=>a.is_update.ToString()==isUpdate)
|
||||
.Where((a,b,c)=>a.type=="1")
|
||||
.Select((a, b, c,d) => new PrdRawMaterialBarcodeListDto
|
||||
{
|
||||
id = a.id,
|
||||
bill_code = a.bill_code,
|
||||
equip_id = c.name,
|
||||
material_id = b.name,
|
||||
absorb_material_finish = a.absorb_material_finish==1 ? "是" : "否",
|
||||
is_update = a.is_update==1 ? "是" : "否",
|
||||
start_time = a.start_time!=null ? a.start_time.Value.ToString(DbTimeFormat.SS) : "",
|
||||
end_time = a.end_time!=null ? a.end_time.Value.ToString(DbTimeFormat.SS) : "",
|
||||
remark = a.remark,
|
||||
f_flowid = d.name,
|
||||
equip_id_id = c.id,
|
||||
material_id_id = b.id
|
||||
}).ToPagedListAsync(input.currentPage, int.MaxValue);
|
||||
return PageResult<PrdRawMaterialBarcodeListDto>.SqlSugarPageResult(result);
|
||||
}
|
||||
|
||||
private async Task<dynamic> Update(string id, VisualDevModelDataUpInput visualDevModelDataUpInput)
|
||||
@@ -199,7 +237,7 @@ namespace Tnb.ProductionMgr
|
||||
public async Task<dynamic> AsyncMaterialWarhouse()
|
||||
{
|
||||
List<string> equipIds = await _db.Queryable<PrdRawMaterialBarcode>().Where(x=>x.type=="1").Select(x=>x.equip_id).ToListAsync();
|
||||
List<EqpEquipment> equipments = await _db.Queryable<EqpEquipment>().Where(x=>!equipIds.Contains(x.id) && x.code.StartsWith("abc")).ToListAsync();
|
||||
List<EqpEquipment> equipments = await _db.Queryable<EqpEquipment>().Where(x=>!equipIds.Contains(x.id) && x.code.StartsWith("JZGL")).ToListAsync();
|
||||
|
||||
List<PrdRawMaterialBarcode> insertList = new List<PrdRawMaterialBarcode>();
|
||||
if (equipments != null && !equipments.IsEmpty())
|
||||
|
||||
Reference in New Issue
Block a user