bug
This commit is contained in:
@@ -109,11 +109,6 @@ public partial class BasMaterial : BaseEntity<string>
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public int? fifo_interval_days { get; set; }
|
public int? fifo_interval_days { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 物料规格型号
|
|
||||||
/// </summary>
|
|
||||||
// public string? material_standard { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 海关编码
|
/// 海关编码
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -275,7 +270,12 @@ public partial class BasMaterial : BaseEntity<string>
|
|||||||
public string container_no { get; set; }
|
public string container_no { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 规格型号
|
/// 物料规格
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string? material_specification { get; set; }
|
public string? material_specification { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 物料型号
|
||||||
|
/// </summary>
|
||||||
|
public string? material_standard { get; set; }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,22 +0,0 @@
|
|||||||
using JNPF.Common.Contracts;
|
|
||||||
using SqlSugar;
|
|
||||||
|
|
||||||
namespace Tnb.ProductionMgr.Entities.Entity
|
|
||||||
{
|
|
||||||
[SugarTable("ERP_BD_MATERIAL")]
|
|
||||||
public class ErpBdMaterial: BaseEntity<string>
|
|
||||||
{
|
|
||||||
public string CODE { get; set; }
|
|
||||||
public string PK_ORG { get; set; }
|
|
||||||
public string NAME { get; set; }
|
|
||||||
public string MATERIALSPEC { get; set; }
|
|
||||||
public string MATERIALTYPE { get; set; }
|
|
||||||
public string PK_MEASDOC { get; set; }
|
|
||||||
public string MEASRATE { get; set; }
|
|
||||||
public string FMEASDOC { get; set; }
|
|
||||||
public string VID { get; set; }
|
|
||||||
public string MEANAME { get; set; }
|
|
||||||
public string FMEANAME { get; set; }
|
|
||||||
public string AID { get; set; }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,56 @@
|
|||||||
|
using JNPF.Common.Contracts;
|
||||||
|
using SqlSugar;
|
||||||
|
|
||||||
|
namespace Tnb.ProductionMgr.Entities.Entity.ErpEntity
|
||||||
|
{
|
||||||
|
[SugarTable("ERP_BD_MATERIAL")]
|
||||||
|
public class ErpBdMaterial
|
||||||
|
{
|
||||||
|
public string ID { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 物料编码
|
||||||
|
/// </summary>
|
||||||
|
public string CODE { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 组织id
|
||||||
|
/// </summary>
|
||||||
|
public string PK_ORG { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 物料名称
|
||||||
|
/// </summary>
|
||||||
|
public string NAME { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 物料规格
|
||||||
|
/// </summary>
|
||||||
|
public string MATERIALSPEC { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 物料型号
|
||||||
|
/// </summary>
|
||||||
|
public string MATERIALTYPE { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 主单位
|
||||||
|
/// </summary>
|
||||||
|
public string PK_MEASDOC { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 换算率
|
||||||
|
/// </summary>
|
||||||
|
public string MEASRATE { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 副单位
|
||||||
|
/// </summary>
|
||||||
|
public string FMEASDOC { get; set; }
|
||||||
|
public string VID { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 主单位中文
|
||||||
|
/// </summary>
|
||||||
|
public string MEANAME { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 副单位中文
|
||||||
|
/// </summary>
|
||||||
|
public string FMEANAME { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 物料主键+物料主单位
|
||||||
|
/// </summary>
|
||||||
|
public string AID { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
using SqlSugar;
|
||||||
|
|
||||||
|
namespace Tnb.ProductionMgr.Entities.Entity.ErpEntity
|
||||||
|
{
|
||||||
|
|
||||||
|
[SugarTable("ERP_BD_MEASDOC")]
|
||||||
|
public class ErpBdMeasdoc
|
||||||
|
{
|
||||||
|
public string ID { get; set; }
|
||||||
|
public string CODE { get; set; }
|
||||||
|
public string NAME { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -11,6 +11,7 @@ using JNPF.Extras.CollectiveOAuth.Models;
|
|||||||
using JNPF.Extras.CollectiveOAuth.Utils;
|
using JNPF.Extras.CollectiveOAuth.Utils;
|
||||||
using JNPF.FriendlyException;
|
using JNPF.FriendlyException;
|
||||||
using JNPF.Logging;
|
using JNPF.Logging;
|
||||||
|
using JNPF.Systems.Entitys.System;
|
||||||
using JNPF.Systems.Interfaces.Permission;
|
using JNPF.Systems.Interfaces.Permission;
|
||||||
using JNPF.Systems.Interfaces.System;
|
using JNPF.Systems.Interfaces.System;
|
||||||
using Microsoft.AspNetCore.Authorization;
|
using Microsoft.AspNetCore.Authorization;
|
||||||
@@ -32,6 +33,8 @@ using Tnb.WarehouseMgr.Entities;
|
|||||||
using Tnb.ProductionMgr.Entities;
|
using Tnb.ProductionMgr.Entities;
|
||||||
using Tnb.ProductionMgr.Interfaces;
|
using Tnb.ProductionMgr.Interfaces;
|
||||||
using Tnb.ProductionMgr.Entities.Dto.PrdManage;
|
using Tnb.ProductionMgr.Entities.Dto.PrdManage;
|
||||||
|
using Tnb.ProductionMgr.Entities.Entity;
|
||||||
|
using Tnb.ProductionMgr.Entities.Entity.ErpEntity;
|
||||||
|
|
||||||
namespace Tnb.ProductionMgr
|
namespace Tnb.ProductionMgr
|
||||||
{
|
{
|
||||||
@@ -408,6 +411,7 @@ namespace Tnb.ProductionMgr
|
|||||||
|
|
||||||
int cs01Count = await _redisData.TryGetValueByKeyField<int>("YTCS", "EmptyNo_CS01");
|
int cs01Count = await _redisData.TryGetValueByKeyField<int>("YTCS", "EmptyNo_CS01");
|
||||||
int cs03Count = await _redisData.TryGetValueByKeyField<int>("YTCS", "EmptyNo_CS03");
|
int cs03Count = await _redisData.TryGetValueByKeyField<int>("YTCS", "EmptyNo_CS03");
|
||||||
|
Log.Information($"注塑定点配送cs01数量:{cs01Count},cs03数量:{cs03Count}");
|
||||||
|
|
||||||
List<String> eqpIds = equipments.Select(x => x.id).ToList();
|
List<String> eqpIds = equipments.Select(x => x.id).ToList();
|
||||||
List<EqpDaq> eqpDaqs = await _db.Queryable<EqpDaq>().Where(x => eqpIds.Contains(x.equip_id) && x.label_name.Contains("允许入空箱")).ToListAsync();
|
List<EqpDaq> eqpDaqs = await _db.Queryable<EqpDaq>().Where(x => eqpIds.Contains(x.equip_id) && x.label_name.Contains("允许入空箱")).ToListAsync();
|
||||||
@@ -667,6 +671,58 @@ namespace Tnb.ProductionMgr
|
|||||||
[AllowAnonymous]
|
[AllowAnonymous]
|
||||||
public async Task<String> SyncBaseData()
|
public async Task<String> SyncBaseData()
|
||||||
{
|
{
|
||||||
|
var mysqlDb = _db.AsTenant().GetConnection("erpdb");
|
||||||
|
List<ErpBdMaterial> list = await mysqlDb.Queryable<ErpBdMaterial>().ToListAsync();
|
||||||
|
List<ErpExtendField> erpExtendFields = await _db.Queryable<ErpExtendField>().ToListAsync();
|
||||||
|
List<BasMaterial> materials = await _db.Queryable<BasMaterial>().ToListAsync();
|
||||||
|
List<BasMaterial> insertMaterial = new List<BasMaterial>();
|
||||||
|
List<ErpExtendField> insertExtendFields = new List<ErpExtendField>();
|
||||||
|
foreach (ErpBdMaterial erpBdMaterial in list)
|
||||||
|
{
|
||||||
|
if (erpExtendFields.All(x => x.cmaterialoid != erpBdMaterial.ID))
|
||||||
|
{
|
||||||
|
insertMaterial.Add(new BasMaterial()
|
||||||
|
{
|
||||||
|
id = SnowflakeIdHelper.NextId(),
|
||||||
|
name = erpBdMaterial.NAME,
|
||||||
|
code = erpBdMaterial.CODE,
|
||||||
|
org_id = WmsWareHouseConst.AdministratorOrgId,
|
||||||
|
material_specification = erpBdMaterial.MATERIALSPEC,
|
||||||
|
material_standard = erpBdMaterial.MATERIALTYPE
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return "true";
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 同步单位
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpGet]
|
||||||
|
[AllowAnonymous]
|
||||||
|
public async Task<String> SyncUnit()
|
||||||
|
{
|
||||||
|
// var mysqlDb = _db.AsTenant().GetConnection("erpdb");
|
||||||
|
// List<ErpBdMeasdoc> list = await mysqlDb.Queryable<ErpBdMeasdoc>().ToListAsync();
|
||||||
|
// List<ErpExtendField> erpExtendFields = await _db.Queryable<ErpExtendField>().ToListAsync();
|
||||||
|
// List<DictionaryDataEntity> insertMaterial = new List<DictionaryDataEntity>();
|
||||||
|
// List<ErpExtendField> insertExtendFields = new List<ErpExtendField>();
|
||||||
|
// foreach (ErpBdMaterial erpBdMaterial in list)
|
||||||
|
// {
|
||||||
|
// if (erpExtendFields.All(x => x.cmaterialoid != erpBdMaterial.ID))
|
||||||
|
// {
|
||||||
|
// insertMaterial.Add(new BasMaterial()
|
||||||
|
// {
|
||||||
|
// id = SnowflakeIdHelper.NextId(),
|
||||||
|
// name = erpBdMaterial.NAME,
|
||||||
|
// code = erpBdMaterial.CODE,
|
||||||
|
// org_id = WmsWareHouseConst.AdministratorOrgId,
|
||||||
|
// material_specification = erpBdMaterial.MATERIALSPEC,
|
||||||
|
// material_standard = erpBdMaterial.MATERIALTYPE
|
||||||
|
// });
|
||||||
|
// }
|
||||||
|
// }
|
||||||
return "true";
|
return "true";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -828,7 +828,10 @@ namespace Tnb.WarehouseMgr
|
|||||||
ids.Add(wmsMaterialTransfer.warehouse_outstock);
|
ids.Add(wmsMaterialTransfer.warehouse_outstock);
|
||||||
ids.Add(wmsMaterialTransfer.warehouse_instock);
|
ids.Add(wmsMaterialTransfer.warehouse_instock);
|
||||||
ids.Add(wmsMaterialTransferd.material_id);
|
ids.Add(wmsMaterialTransferd.material_id);
|
||||||
ids.Add(unitData.Id);
|
if (unitData != null)
|
||||||
|
{
|
||||||
|
ids.Add(unitData.Id);
|
||||||
|
}
|
||||||
List<ErpExtendField> erpExtendFields = await _db.Queryable<ErpExtendField>().Where(x=>ids.Contains(x.table_id)).ToListAsync();
|
List<ErpExtendField> erpExtendFields = await _db.Queryable<ErpExtendField>().Where(x=>ids.Contains(x.table_id)).ToListAsync();
|
||||||
|
|
||||||
ErpExtendField erpOrg = erpExtendFields.Find(x => x.table_id == (wmsMaterialTransfer.org_id ?? WmsWareHouseConst.AdministratorOrgId));
|
ErpExtendField erpOrg = erpExtendFields.Find(x => x.table_id == (wmsMaterialTransfer.org_id ?? WmsWareHouseConst.AdministratorOrgId));
|
||||||
@@ -838,7 +841,7 @@ namespace Tnb.WarehouseMgr
|
|||||||
Dictionary<string, object> erpRequestData = new Dictionary<string, object>();
|
Dictionary<string, object> erpRequestData = new Dictionary<string, object>();
|
||||||
string nowStr = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
|
string nowStr = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
|
||||||
erpRequestData.Add("billmaker",erpCreateId);
|
erpRequestData.Add("billmaker",erpCreateId);
|
||||||
erpRequestData.Add("cdptid","1001A1100000000JRLI1A100");// 先写死
|
erpRequestData.Add("cdptid","1001A1100000000JRLI1");// 先写死
|
||||||
erpRequestData.Add("cdptvid","0001A11000000007GGO8");// 先写死
|
erpRequestData.Add("cdptvid","0001A11000000007GGO8");// 先写死
|
||||||
erpRequestData.Add("corpoid",erpOrg.corpoid);
|
erpRequestData.Add("corpoid",erpOrg.corpoid);
|
||||||
erpRequestData.Add("corpvid",erpOrg.corpoid);
|
erpRequestData.Add("corpvid",erpOrg.corpoid);
|
||||||
@@ -865,7 +868,7 @@ namespace Tnb.WarehouseMgr
|
|||||||
["cmaterialvid"] = erpExtendFields.Find(x=>x.table_id==wmsMaterialTransferd.material_id)?.cmaterialvid ?? "",
|
["cmaterialvid"] = erpExtendFields.Find(x=>x.table_id==wmsMaterialTransferd.material_id)?.cmaterialvid ?? "",
|
||||||
["corpoid"] = erpOrg.corpoid,
|
["corpoid"] = erpOrg.corpoid,
|
||||||
["corpvid"] = erpOrg.corpvid,
|
["corpvid"] = erpOrg.corpvid,
|
||||||
["crowno"] = (dList.FindIndex(x=>x.id==wmsMaterialTransferd.id)+1) * 10,
|
["crowno"] = wmsMaterialTransferd.lineno,
|
||||||
["csourcebillbid"] = wmsMaterialTransferd.erp_line_pk,
|
["csourcebillbid"] = wmsMaterialTransferd.erp_line_pk,
|
||||||
["csourcebillhid"] = wmsMaterialTransfer.erp_pk,
|
["csourcebillhid"] = wmsMaterialTransfer.erp_pk,
|
||||||
["cunitid"] = erpExtendFields.Find(x=>x.table_id==unitData.Id)?.cunitid ?? "",
|
["cunitid"] = erpExtendFields.Find(x=>x.table_id==unitData.Id)?.cunitid ?? "",
|
||||||
|
|||||||
@@ -20,8 +20,15 @@
|
|||||||
//Oracle
|
//Oracle
|
||||||
//"DefaultConnection": "Data Source=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST={0})(PORT={1}))(CONNECT_DATA=(SERVER = DEDICATED)(SERVICE_NAME={2})));User Id={3};Password={4}"
|
//"DefaultConnection": "Data Source=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST={0})(PORT={1}))(CONNECT_DATA=(SERVER = DEDICATED)(SERVICE_NAME={2})));User Id={3};Password={4}"
|
||||||
//PostgreSQL
|
//PostgreSQL
|
||||||
"DefaultConnection": "server={0};port={1};database={2};uid={3};pwd={4};pooling=true;KeepAlive=60;ConnectionLifetime=300;MaxPoolSize=320;"
|
"DefaultConnection": "server={0};port={1};database={2};uid={3};pwd={4};pooling=true;KeepAlive=60;ConnectionLifetime=300;MaxPoolSize=320;",
|
||||||
//MySql
|
//MySql
|
||||||
//"DefaultConnection": "server={0};port={1};database={2};uid={3};pwd={4};sslmode=none;pooling=true;charset=utf8mb4;allowLoadLocalInfile=true;allowPublicKeyRetrieval=true"
|
//"DefaultConnection": "server={0};port={1};database={2};uid={3};pwd={4};sslmode=none;pooling=true;charset=utf8mb4;allowLoadLocalInfile=true;allowPublicKeyRetrieval=true"
|
||||||
|
"ConfigList": [
|
||||||
|
{
|
||||||
|
"ServiceName":"erpdb",
|
||||||
|
"dbType":"Oracle",
|
||||||
|
"connectionStr":"Data Source=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.1.11)(PORT=1521))(CONNECT_DATA=(SERVER = DEDICATED)(SERVICE_NAME=orcl)));User Id=BIP0201;Password=BIP0201"
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user