Merge branch 'dev' of https://git.tuotong-tech.com/tnb/tnb.server into dev
This commit is contained in:
@@ -0,0 +1,22 @@
|
|||||||
|
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; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1724,7 +1724,7 @@ namespace Tnb.ProductionMgr
|
|||||||
// }
|
// }
|
||||||
|
|
||||||
// report.warehouse_id = WmsWareHouseConst.WAREHOUSE_JXK_ID;
|
// report.warehouse_id = WmsWareHouseConst.WAREHOUSE_JXK_ID;
|
||||||
report.warehouse_id = WmsWareHouseConst.WAREHOUSE_SLDMJC_ID;
|
report.warehouse_id = WmsWareHouseConst.WAREHOUSE_DMJC_ID;
|
||||||
Dictionary<string, string> worklineWarehouseDic = new Dictionary<string, string>()
|
Dictionary<string, string> worklineWarehouseDic = new Dictionary<string, string>()
|
||||||
{
|
{
|
||||||
[WmsWareHouseConst.XUELUGUAN1XIAN] = "ZZ-01-02",
|
[WmsWareHouseConst.XUELUGUAN1XIAN] = "ZZ-01-02",
|
||||||
@@ -2129,22 +2129,22 @@ namespace Tnb.ProductionMgr
|
|||||||
// throw Oops.Bah(x2ServerResult.Msg);
|
// throw Oops.Bah(x2ServerResult.Msg);
|
||||||
// }
|
// }
|
||||||
|
|
||||||
Dictionary<string, string> dicCommand4 = new(StringComparer.OrdinalIgnoreCase)
|
// Dictionary<string, string> dicCommand4 = new(StringComparer.OrdinalIgnoreCase)
|
||||||
{
|
// {
|
||||||
["DevName"] = "外包装箱码垛线",
|
// ["DevName"] = "外包装箱码垛线",
|
||||||
["token"] = _eleCtlCfg.token,
|
// ["token"] = _eleCtlCfg.token,
|
||||||
["TagName"] = dic2[prdMoTask.workline_id],
|
// ["TagName"] = dic2[prdMoTask.workline_id],
|
||||||
["Value"] = "0",
|
// ["Value"] = "0",
|
||||||
};
|
// };
|
||||||
|
//
|
||||||
Log.Information($"清除提报码垛数参数:{JsonConvert.SerializeObject(dicCommand4)}");
|
// Log.Information($"清除提报码垛数参数:{JsonConvert.SerializeObject(dicCommand4)}");
|
||||||
string responseresult2 = await HttpClientHelper.GetRequestAsync(_eleCtlCfg.WriteTagUrl, dicCommand4);
|
// string responseresult2 = await HttpClientHelper.GetRequestAsync(_eleCtlCfg.WriteTagUrl, dicCommand4);
|
||||||
Log.Information($"清除提报码垛数成返回结果:{responseresult2}");
|
// Log.Information($"清除提报码垛数返回结果:{responseresult2}");
|
||||||
X2ServerResult x2ServerResult2 = JsonConvert.DeserializeObject<X2ServerResult>(responseresult2);
|
// X2ServerResult x2ServerResult2 = JsonConvert.DeserializeObject<X2ServerResult>(responseresult2);
|
||||||
if (x2ServerResult2.Result != X2ServerResult.Ok)
|
// if (x2ServerResult2.Result != X2ServerResult.Ok)
|
||||||
{
|
// {
|
||||||
throw Oops.Bah(x2ServerResult2.Msg);
|
// throw Oops.Bah(x2ServerResult2.Msg);
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
if (basMaterial.category_id.Contains("ZSJ") || basMaterial.category_id.Contains("DGJCJ"))
|
if (basMaterial.category_id.Contains("ZSJ") || basMaterial.category_id.Contains("DGJCJ"))
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ using Newtonsoft.Json;
|
|||||||
using Newtonsoft.Json.Linq;
|
using Newtonsoft.Json.Linq;
|
||||||
using SqlSugar;
|
using SqlSugar;
|
||||||
using Tnb.BasicData;
|
using Tnb.BasicData;
|
||||||
|
using Tnb.BasicData.Entities;
|
||||||
using Tnb.ProductionMgr.Entities;
|
using Tnb.ProductionMgr.Entities;
|
||||||
using Tnb.ProductionMgr.Entities.Dto;
|
using Tnb.ProductionMgr.Entities.Dto;
|
||||||
using Tnb.ProductionMgr.Interfaces;
|
using Tnb.ProductionMgr.Interfaces;
|
||||||
@@ -89,27 +90,28 @@ namespace Tnb.ProductionMgr
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
ISqlSugarClient db = _repository.AsSugarClient();
|
ISqlSugarClient db = _repository.AsSugarClient();
|
||||||
SqlSugarPagedList<ReportRecordListOutput> result = await db.Queryable<PrdReportRecord>()
|
SqlSugarPagedList<ReportRecordListOutput> result = await db.Queryable<PrdMoTask>()
|
||||||
.LeftJoin<DictionaryDataEntity>((a, b) => a.mo_task_type == b.Id)
|
.LeftJoin<PrdMo>((a,b)=>a.mo_id==b.id)
|
||||||
.LeftJoin<DictionaryDataEntity>((a, b, c) => a.status == c.EnCode)
|
.LeftJoin<DictionaryDataEntity>((a, b,c) => b.mo_type == c.Id)
|
||||||
.LeftJoin<PrdMoTask>((a, b, c, d) => a.mo_task_id == d.id)
|
.LeftJoin<DictionaryDataEntity>((a, b, c,d) => a.mo_task_status == d.EnCode && d.DictionaryTypeId==DictConst.PrdTaskStatusTypeId)
|
||||||
|
.LeftJoin<BasMaterial>((a,b,c,d,e)=>a.material_id==e.id)
|
||||||
.WhereIF(!string.IsNullOrEmpty(moTaskCode), (a, b, c) => a.mo_task_code.Contains(moTaskCode))
|
.WhereIF(!string.IsNullOrEmpty(moTaskCode), (a, b, c) => a.mo_task_code.Contains(moTaskCode))
|
||||||
.Select((a, b, c, d) => new ReportRecordListOutput
|
.Select((a, b, c, d,e) => new ReportRecordListOutput
|
||||||
{
|
{
|
||||||
id = a.id,
|
id = a.id,
|
||||||
masterial_code = a.masterial_code,
|
masterial_code = e.code,
|
||||||
mo_code = a.mo_code,
|
mo_code = b.mo_code,
|
||||||
masterial_name = a.masterial_name,
|
masterial_name = e.name,
|
||||||
mo_task_code = a.mo_task_code,
|
mo_task_code = a.mo_task_code,
|
||||||
mo_task_id = a.mo_task_code,
|
mo_task_id = a.mo_task_code,
|
||||||
mo_task_id_id = a.mo_task_id,
|
mo_task_id_id = a.id,
|
||||||
mo_task_type = b.FullName,
|
mo_task_type = c.FullName,
|
||||||
plan_end_date = a.plan_end_date == null ? "" : a.plan_end_date.Value.ToString("yyyy-mm-dd"),
|
plan_end_date = a.estimated_end_date == null ? "" : a.estimated_end_date.Value.ToString("yyyy-mm-dd"),
|
||||||
plan_start_date = a.plan_start_date == null ? "" : a.plan_start_date.Value.ToString("yyyy-mm-dd"),
|
plan_start_date = a.estimated_start_date == null ? "" : a.estimated_start_date.Value.ToString("yyyy-mm-dd"),
|
||||||
plan_qty = d.scheduled_qty,
|
plan_qty = a.scheduled_qty,
|
||||||
reported_work_qty = a.reported_work_qty,
|
reported_work_qty = a.reported_work_qty,
|
||||||
completed_qty = SqlFunc.IsNull(d.reported_work_qty, 0) + SqlFunc.IsNull(d.scrap_qty, 0),
|
completed_qty = SqlFunc.IsNull(a.reported_work_qty, 0) + SqlFunc.IsNull(a.scrap_qty, 0),
|
||||||
status = c.FullName,
|
status = d.FullName,
|
||||||
tablefield107 = SqlFunc.Subqueryable<PrdReport>()
|
tablefield107 = SqlFunc.Subqueryable<PrdReport>()
|
||||||
.LeftJoin<UserEntity>((x, y) => x.create_id == y.Id)
|
.LeftJoin<UserEntity>((x, y) => x.create_id == y.Id)
|
||||||
.Where(x => x.mo_task_code == a.mo_task_code).ToList((x, y) => new ReportRecordListChildrenOutput
|
.Where(x => x.mo_task_code == a.mo_task_code).ToList((x, y) => new ReportRecordListChildrenOutput
|
||||||
@@ -149,11 +151,11 @@ namespace Tnb.ProductionMgr
|
|||||||
|
|
||||||
_ = await db.Insertable<PrdReport>(prdReports).ExecuteCommandAsync();
|
_ = await db.Insertable<PrdReport>(prdReports).ExecuteCommandAsync();
|
||||||
|
|
||||||
int? sum = prdReports.Sum(x => x.reported_qty);
|
// int? sum = prdReports.Sum(x => x.reported_qty);
|
||||||
_ = await db.Updateable<PrdReportRecord>()
|
// _ = await db.Updateable<PrdReportRecord>()
|
||||||
.SetColumns(x => x.completed_qty == x.completed_qty + sum)
|
// .SetColumns(x => x.completed_qty == x.completed_qty + sum)
|
||||||
.SetColumns(x => x.reported_work_qty == x.reported_work_qty + sum)
|
// .SetColumns(x => x.reported_work_qty == x.reported_work_qty + sum)
|
||||||
.Where(x => x.id == input.data["id"].ToString()).ExecuteCommandAsync();
|
// .Where(x => x.id == input.data["id"].ToString()).ExecuteCommandAsync();
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -513,7 +513,10 @@ namespace Tnb.ProductionMgr
|
|||||||
return msg;
|
return msg;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 自动提报
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
[AllowAnonymous]
|
[AllowAnonymous]
|
||||||
public async Task<String> AutoPrdReport()
|
public async Task<String> AutoPrdReport()
|
||||||
@@ -655,6 +658,17 @@ namespace Tnb.ProductionMgr
|
|||||||
|
|
||||||
return "true";
|
return "true";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 同步基础数据
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpGet]
|
||||||
|
[AllowAnonymous]
|
||||||
|
public async Task<String> SyncBaseData()
|
||||||
|
{
|
||||||
|
return "true";
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -27,10 +27,6 @@
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public const string WAREHOUSE_ZCC_ID = "33780009364245";
|
public const string WAREHOUSE_ZCC_ID = "33780009364245";
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 四楼待灭菌仓
|
|
||||||
/// </summary>
|
|
||||||
public const string WAREHOUSE_SLDMJC_ID = "35412479754517";
|
|
||||||
/// <summary>
|
|
||||||
/// 四楼解析库
|
/// 四楼解析库
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public const string WAREHOUSE_JXK_ID = "26103367464997";
|
public const string WAREHOUSE_JXK_ID = "26103367464997";
|
||||||
|
|||||||
@@ -2427,8 +2427,8 @@ namespace Tnb.WarehouseMgr
|
|||||||
["cbodytranstypecode"] = "4A-01",
|
["cbodytranstypecode"] = "4A-01",
|
||||||
["cbodywarehouseid"] = erpExtendFields.Find(x=>x.table_id==wmsMaterialTransfer.warehouse_instock)?.cotherwhid ?? "",
|
["cbodywarehouseid"] = erpExtendFields.Find(x=>x.table_id==wmsMaterialTransfer.warehouse_instock)?.cotherwhid ?? "",
|
||||||
["cgeneralbid"] = erpExtendFields.Find(x=>x.table_id==wmsMaterialTransfer.warehouse_instock)?.cotherwhid ?? "",
|
["cgeneralbid"] = erpExtendFields.Find(x=>x.table_id==wmsMaterialTransfer.warehouse_instock)?.cotherwhid ?? "",
|
||||||
["cgeneralbid"] = item.erp_line_pk ?? "",
|
["cgeneralbid"] = item.erp_line_pk,
|
||||||
["cgeneralhid"] = wmsMaterialTransfer.erp_pk ?? "",
|
["cgeneralhid"] = wmsMaterialTransfer.erp_pk,
|
||||||
["cmaterialoid"] = erpExtendFields.Find(x=>x.table_id==item.material_id)?.cmaterialoid ?? "",
|
["cmaterialoid"] = erpExtendFields.Find(x=>x.table_id==item.material_id)?.cmaterialoid ?? "",
|
||||||
["cmaterialvid"] = erpExtendFields.Find(x=>x.table_id==item.material_id)?.cmaterialvid ?? "",
|
["cmaterialvid"] = erpExtendFields.Find(x=>x.table_id==item.material_id)?.cmaterialvid ?? "",
|
||||||
["corpoid"] = erpOrg.corpoid,
|
["corpoid"] = erpOrg.corpoid,
|
||||||
|
|||||||
@@ -866,8 +866,8 @@ namespace Tnb.WarehouseMgr
|
|||||||
["corpoid"] = erpOrg.corpoid,
|
["corpoid"] = erpOrg.corpoid,
|
||||||
["corpvid"] = erpOrg.corpvid,
|
["corpvid"] = erpOrg.corpvid,
|
||||||
["crowno"] = (dList.FindIndex(x=>x.id==wmsMaterialTransferd.id)+1) * 10,
|
["crowno"] = (dList.FindIndex(x=>x.id==wmsMaterialTransferd.id)+1) * 10,
|
||||||
["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 ?? "",
|
||||||
["cvendorid"] = "",
|
["cvendorid"] = "",
|
||||||
["cvendorvid"] = "",
|
["cvendorvid"] = "",
|
||||||
|
|||||||
@@ -33,6 +33,26 @@ public static class ConfigureSqlSugarExtensions
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
foreach (var item in conn.ConfigList)
|
||||||
|
{
|
||||||
|
connectConfigList.Add(new ConnectionConfig
|
||||||
|
{
|
||||||
|
ConnectionString = item.connectionStr,
|
||||||
|
DbType = item.dbType,
|
||||||
|
IsAutoCloseConnection = true,
|
||||||
|
ConfigId = item.ServiceName,
|
||||||
|
InitKeyType = InitKeyType.Attribute,
|
||||||
|
MoreSettings = new ConnMoreSettings()
|
||||||
|
{
|
||||||
|
IsAutoRemoveDataCache = true, // 自动清理缓存
|
||||||
|
IsAutoToUpper = false,
|
||||||
|
//PgSqlIsAutoToLower = false,
|
||||||
|
DisableNvarchar = true
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
services.AddSqlSugar(connectConfigList, client =>
|
services.AddSqlSugar(connectConfigList, client =>
|
||||||
{
|
{
|
||||||
//connectConfigList.ForEach(config =>
|
//connectConfigList.ForEach(config =>
|
||||||
|
|||||||
@@ -48,4 +48,6 @@ public sealed class ConnectionStringsOptions : IConfigurableOptions
|
|||||||
public string DefaultConnection { get; set; }
|
public string DefaultConnection { get; set; }
|
||||||
|
|
||||||
public string ConnectString { get { return string.Format(DefaultConnection, Host, Port, DBName, UserName, Password); } }
|
public string ConnectString { get { return string.Format(DefaultConnection, Host, Port, DBName, UserName, Password); } }
|
||||||
|
|
||||||
|
public List<DBConnectionConfig> ConfigList { get; set; }
|
||||||
}
|
}
|
||||||
@@ -11,6 +11,7 @@ using JNPF.Systems.Entitys.Permission;
|
|||||||
using Microsoft.AspNetCore.Authorization;
|
using Microsoft.AspNetCore.Authorization;
|
||||||
using Microsoft.AspNetCore.Cors;
|
using Microsoft.AspNetCore.Cors;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
using Newtonsoft.Json;
|
||||||
using Npgsql.TypeHandlers;
|
using Npgsql.TypeHandlers;
|
||||||
using SqlSugar;
|
using SqlSugar;
|
||||||
using Tnb.ProductionMgr.Entities.Entity;
|
using Tnb.ProductionMgr.Entities.Entity;
|
||||||
@@ -93,7 +94,9 @@ public class TestService : IDynamicApiController, ITransient
|
|||||||
[AllowAnonymous]
|
[AllowAnonymous]
|
||||||
public string test1()
|
public string test1()
|
||||||
{
|
{
|
||||||
return "测试成功";
|
var mysqlDb = _sugar.GetConnection("erpdb");
|
||||||
|
List<ErpBdMaterial> list = mysqlDb.Queryable<ErpBdMaterial>().ToList();
|
||||||
|
return JsonConvert.SerializeObject(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
@@ -150,4 +153,83 @@ public class TestService : IDynamicApiController, ITransient
|
|||||||
public string name { get; set; }
|
public string name { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[SugarTable("bas_factory_config")]
|
||||||
|
public partial class BasFactoryConfig2 : BaseEntity<string>
|
||||||
|
{
|
||||||
|
public BasFactoryConfig2()
|
||||||
|
{
|
||||||
|
id = SnowflakeIdHelper.NextId();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 名称
|
||||||
|
/// </summary>
|
||||||
|
public string name { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// key
|
||||||
|
/// </summary>
|
||||||
|
public string code { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 值
|
||||||
|
/// </summary>
|
||||||
|
public string value { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 是否启用
|
||||||
|
/// </summary>
|
||||||
|
public int enabled { 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; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 排序
|
||||||
|
/// </summary>
|
||||||
|
public long? ordinal { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 是否系统
|
||||||
|
/// </summary>
|
||||||
|
public int? is_system { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 流程任务Id
|
||||||
|
/// </summary>
|
||||||
|
public string? f_flowtaskid { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 流程引擎Id
|
||||||
|
/// </summary>
|
||||||
|
public string? f_flowid { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user