This commit is contained in:
2024-07-17 17:22:31 +08:00
parent 757bdf8cb9
commit e16a2dfe37
6 changed files with 58 additions and 46 deletions

View File

@@ -1724,7 +1724,7 @@ namespace Tnb.ProductionMgr
// }
// 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>()
{
[WmsWareHouseConst.XUELUGUAN1XIAN] = "ZZ-01-02",
@@ -2129,22 +2129,22 @@ namespace Tnb.ProductionMgr
// throw Oops.Bah(x2ServerResult.Msg);
// }
Dictionary<string, string> dicCommand4 = new(StringComparer.OrdinalIgnoreCase)
{
["DevName"] = "外包装箱码垛线",
["token"] = _eleCtlCfg.token,
["TagName"] = dic2[prdMoTask.workline_id],
["Value"] = "0",
};
Log.Information($"清除提报码垛数参数:{JsonConvert.SerializeObject(dicCommand4)}");
string responseresult2 = await HttpClientHelper.GetRequestAsync(_eleCtlCfg.WriteTagUrl, dicCommand4);
Log.Information($"清除提报码垛数返回结果:{responseresult2}");
X2ServerResult x2ServerResult2 = JsonConvert.DeserializeObject<X2ServerResult>(responseresult2);
if (x2ServerResult2.Result != X2ServerResult.Ok)
{
throw Oops.Bah(x2ServerResult2.Msg);
}
// Dictionary<string, string> dicCommand4 = new(StringComparer.OrdinalIgnoreCase)
// {
// ["DevName"] = "外包装箱码垛线",
// ["token"] = _eleCtlCfg.token,
// ["TagName"] = dic2[prdMoTask.workline_id],
// ["Value"] = "0",
// };
//
// Log.Information($"清除提报码垛数参数:{JsonConvert.SerializeObject(dicCommand4)}");
// string responseresult2 = await HttpClientHelper.GetRequestAsync(_eleCtlCfg.WriteTagUrl, dicCommand4);
// Log.Information($"清除提报码垛数返回结果:{responseresult2}");
// X2ServerResult x2ServerResult2 = JsonConvert.DeserializeObject<X2ServerResult>(responseresult2);
// if (x2ServerResult2.Result != X2ServerResult.Ok)
// {
// throw Oops.Bah(x2ServerResult2.Msg);
// }
}
if (basMaterial.category_id.Contains("ZSJ") || basMaterial.category_id.Contains("DGJCJ"))

View File

@@ -13,6 +13,7 @@ using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using SqlSugar;
using Tnb.BasicData;
using Tnb.BasicData.Entities;
using Tnb.ProductionMgr.Entities;
using Tnb.ProductionMgr.Entities.Dto;
using Tnb.ProductionMgr.Interfaces;
@@ -89,27 +90,28 @@ namespace Tnb.ProductionMgr
}
}
ISqlSugarClient db = _repository.AsSugarClient();
SqlSugarPagedList<ReportRecordListOutput> result = await db.Queryable<PrdReportRecord>()
.LeftJoin<DictionaryDataEntity>((a, b) => a.mo_task_type == b.Id)
.LeftJoin<DictionaryDataEntity>((a, b, c) => a.status == c.EnCode)
.LeftJoin<PrdMoTask>((a, b, c, d) => a.mo_task_id == d.id)
SqlSugarPagedList<ReportRecordListOutput> result = await db.Queryable<PrdMoTask>()
.LeftJoin<PrdMo>((a,b)=>a.mo_id==b.id)
.LeftJoin<DictionaryDataEntity>((a, b,c) => b.mo_type == c.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))
.Select((a, b, c, d) => new ReportRecordListOutput
.Select((a, b, c, d,e) => new ReportRecordListOutput
{
id = a.id,
masterial_code = a.masterial_code,
mo_code = a.mo_code,
masterial_name = a.masterial_name,
masterial_code = e.code,
mo_code = b.mo_code,
masterial_name = e.name,
mo_task_code = a.mo_task_code,
mo_task_id = a.mo_task_code,
mo_task_id_id = a.mo_task_id,
mo_task_type = b.FullName,
plan_end_date = a.plan_end_date == null ? "" : a.plan_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_qty = d.scheduled_qty,
mo_task_id_id = a.id,
mo_task_type = c.FullName,
plan_end_date = a.estimated_end_date == null ? "" : a.estimated_end_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 = a.scheduled_qty,
reported_work_qty = a.reported_work_qty,
completed_qty = SqlFunc.IsNull(d.reported_work_qty, 0) + SqlFunc.IsNull(d.scrap_qty, 0),
status = c.FullName,
completed_qty = SqlFunc.IsNull(a.reported_work_qty, 0) + SqlFunc.IsNull(a.scrap_qty, 0),
status = d.FullName,
tablefield107 = SqlFunc.Subqueryable<PrdReport>()
.LeftJoin<UserEntity>((x, y) => x.create_id == y.Id)
.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();
int? sum = prdReports.Sum(x => x.reported_qty);
_ = await db.Updateable<PrdReportRecord>()
.SetColumns(x => x.completed_qty == x.completed_qty + sum)
.SetColumns(x => x.reported_work_qty == x.reported_work_qty + sum)
.Where(x => x.id == input.data["id"].ToString()).ExecuteCommandAsync();
// int? sum = prdReports.Sum(x => x.reported_qty);
// _ = await db.Updateable<PrdReportRecord>()
// .SetColumns(x => x.completed_qty == x.completed_qty + sum)
// .SetColumns(x => x.reported_work_qty == x.reported_work_qty + sum)
// .Where(x => x.id == input.data["id"].ToString()).ExecuteCommandAsync();
});

View File

@@ -513,7 +513,10 @@ namespace Tnb.ProductionMgr
return msg;
}
/// <summary>
/// 自动提报
/// </summary>
/// <returns></returns>
[HttpGet]
[AllowAnonymous]
public async Task<String> AutoPrdReport()
@@ -655,6 +658,17 @@ namespace Tnb.ProductionMgr
return "true";
}
/// <summary>
/// 同步基础数据
/// </summary>
/// <returns></returns>
[HttpGet]
[AllowAnonymous]
public async Task<String> SyncBaseData()
{
return "true";
}
}
}

View File

@@ -27,10 +27,6 @@
/// </summary>
public const string WAREHOUSE_ZCC_ID = "33780009364245";
/// <summary>
/// 四楼待灭菌仓
/// </summary>
public const string WAREHOUSE_SLDMJC_ID = "35412479754517";
/// <summary>
/// 四楼解析库
/// </summary>
public const string WAREHOUSE_JXK_ID = "26103367464997";

View File

@@ -2396,8 +2396,8 @@ namespace Tnb.WarehouseMgr
["cbodytranstypecode"] = "4A-01",
["cbodywarehouseid"] = 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 ?? "",
["cgeneralhid"] = wmsMaterialTransfer.erp_pk ?? "",
["cgeneralbid"] = item.erp_line_pk,
["cgeneralhid"] = wmsMaterialTransfer.erp_pk,
["cmaterialoid"] = erpExtendFields.Find(x=>x.table_id==item.material_id)?.cmaterialoid ?? "",
["cmaterialvid"] = erpExtendFields.Find(x=>x.table_id==item.material_id)?.cmaterialvid ?? "",
["corpoid"] = erpOrg.corpoid,

View File

@@ -678,8 +678,8 @@ namespace Tnb.WarehouseMgr
["corpoid"] = erpOrg.corpoid,
["corpvid"] = erpOrg.corpvid,
["crowno"] = (dList.FindIndex(x=>x.id==wmsMaterialTransferd.id)+1) * 10,
["csourcebillbid"] = wmsMaterialTransferd.erp_line_pk ?? "",
["csourcebillhid"] = wmsMaterialTransfer.erp_pk ?? "",
["csourcebillbid"] = wmsMaterialTransferd.erp_line_pk,
["csourcebillhid"] = wmsMaterialTransfer.erp_pk,
["cunitid"] = erpExtendFields.Find(x=>x.table_id==unitData.Id)?.cunitid ?? "",
["cvendorid"] = "",
["cvendorvid"] = "",