Merge branch 'dev' of https://git.tuotong-tech.com/tnb/tnb.server into dev
This commit is contained in:
@@ -190,7 +190,7 @@ namespace Tnb.ProductionMgr
|
|||||||
mo_status = ee.FullName,
|
mo_status = ee.FullName,
|
||||||
remark = aa.remark,
|
remark = aa.remark,
|
||||||
})
|
})
|
||||||
}).ToPagedListAsync(input.currentPage, int.MaxValue);
|
}).ToPagedListAsync(input.currentPage, input.pageSize);
|
||||||
return PageResult<PrdMoListOuput>.SqlSugarPageResult(result);
|
return PageResult<PrdMoListOuput>.SqlSugarPageResult(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1985,7 +1985,6 @@ namespace Tnb.ProductionMgr
|
|||||||
throw Oops.Bah("提报数量为正数");
|
throw Oops.Bah("提报数量为正数");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
report = input.Adapt<PrdReport>();
|
report = input.Adapt<PrdReport>();
|
||||||
report.id = SnowflakeIdHelper.NextId();
|
report.id = SnowflakeIdHelper.NextId();
|
||||||
report.org_id = WmsWareHouseConst.AdministratorOrgId;
|
report.org_id = WmsWareHouseConst.AdministratorOrgId;
|
||||||
@@ -2379,21 +2378,27 @@ namespace Tnb.ProductionMgr
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if(db==null) db = _repository.AsSugarClient();
|
if (db == null) db = _repository.AsSugarClient();
|
||||||
if(report==null) report = await db.Queryable<PrdReport>().FirstAsync(it => it.id==input.report_id && !SqlFunc.IsNullOrEmpty(it.id));
|
if (report == null)
|
||||||
PrdMoTask? prdMoTask = await db.Queryable<PrdMoTask>().FirstAsync(x => x.id == report.mo_task_id && !SqlFunc.IsNullOrEmpty(x.id));
|
report = await db.Queryable<PrdReport>()
|
||||||
|
.FirstAsync(it => it.id == input.report_id && !SqlFunc.IsNullOrEmpty(it.id));
|
||||||
|
PrdMoTask? prdMoTask = await db.Queryable<PrdMoTask>()
|
||||||
|
.FirstAsync(x => x.id == report.mo_task_id && !SqlFunc.IsNullOrEmpty(x.id));
|
||||||
EqpEquipment equip = await db.Queryable<EqpEquipment>().SingleAsync(x => x.id == prdMoTask.eqp_id);
|
EqpEquipment equip = await db.Queryable<EqpEquipment>().SingleAsync(x => x.id == prdMoTask.eqp_id);
|
||||||
BasMaterial basMaterial = await db.Queryable<BasMaterial>().SingleAsync(x => x.id == prdMoTask.material_id);
|
BasMaterial basMaterial =
|
||||||
WmsCarryH wmsCarryH = await db.Queryable<WmsCarryH>().FirstAsync(x=>x.carry_code==report.material_box_code);
|
await db.Queryable<BasMaterial>().SingleAsync(x => x.id == prdMoTask.material_id);
|
||||||
BasLocation location = await db.Queryable<BasLocation>().FirstAsync(x=>x.location_code==report.location_code);
|
WmsCarryH wmsCarryH = await db.Queryable<WmsCarryH>()
|
||||||
|
.FirstAsync(x => x.carry_code == report.material_box_code);
|
||||||
|
BasLocation location = await db.Queryable<BasLocation>()
|
||||||
|
.FirstAsync(x => x.location_code == report.location_code);
|
||||||
PrdMo prdMo = await db.Queryable<PrdMo>().SingleAsync(x => x.id == prdMoTask.mo_id);
|
PrdMo prdMo = await db.Queryable<PrdMo>().SingleAsync(x => x.id == prdMoTask.mo_id);
|
||||||
|
|
||||||
await db.Updateable<PrdReport>()
|
await db.Updateable<PrdReport>()
|
||||||
.SetColumns(x => x.check_result == input.check_result)
|
.SetColumns(x => x.check_result == input.check_result)
|
||||||
.Where(x => x.id == input.report_id)
|
.Where(x => x.id == input.report_id)
|
||||||
.ExecuteCommandAsync();
|
.ExecuteCommandAsync();
|
||||||
|
|
||||||
|
|
||||||
BindCarryCodeInput bindCarryCodeInput = new BindCarryCodeInput();
|
BindCarryCodeInput bindCarryCodeInput = new BindCarryCodeInput();
|
||||||
bindCarryCodeInput.carry_id = wmsCarryH.id;
|
bindCarryCodeInput.carry_id = wmsCarryH.id;
|
||||||
bindCarryCodeInput.barcode = report.barcode;
|
bindCarryCodeInput.barcode = report.barcode;
|
||||||
@@ -2407,12 +2412,13 @@ namespace Tnb.ProductionMgr
|
|||||||
bindCarryCodeInput.create_id = _userManager?.UserId ?? WmsWareHouseConst.AdministratorUserId;
|
bindCarryCodeInput.create_id = _userManager?.UserId ?? WmsWareHouseConst.AdministratorUserId;
|
||||||
|
|
||||||
Log.Information($"载具绑定参数:${JsonConvert.SerializeObject(bindCarryCodeInput)}");
|
Log.Information($"载具绑定参数:${JsonConvert.SerializeObject(bindCarryCodeInput)}");
|
||||||
Tnb.WarehouseMgr.Entities.Dto.Outputs.Result result1 = await _wmsCarryService.BindCarryMaterial(bindCarryCodeInput);
|
Tnb.WarehouseMgr.Entities.Dto.Outputs.Result result1 =
|
||||||
|
await _wmsCarryService.BindCarryMaterial(bindCarryCodeInput);
|
||||||
if (result1.code != HttpStatusCode.OK)
|
if (result1.code != HttpStatusCode.OK)
|
||||||
{
|
{
|
||||||
throw Oops.Bah(result1.msg);
|
throw Oops.Bah(result1.msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
WmsPrdInstockInput wmsPrdInstockInput = new WmsPrdInstockInput();
|
WmsPrdInstockInput wmsPrdInstockInput = new WmsPrdInstockInput();
|
||||||
wmsPrdInstockInput.prd_bill_code = prdMo.mo_code;
|
wmsPrdInstockInput.prd_bill_code = prdMo.mo_code;
|
||||||
wmsPrdInstockInput.material_id = prdMoTask.material_id;
|
wmsPrdInstockInput.material_id = prdMoTask.material_id;
|
||||||
@@ -2433,7 +2439,7 @@ namespace Tnb.ProductionMgr
|
|||||||
startlocation_id = location.id,
|
startlocation_id = location.id,
|
||||||
carry_id = wmsCarryH.id,
|
carry_id = wmsCarryH.id,
|
||||||
};
|
};
|
||||||
|
|
||||||
if (prdMoTask.schedule_type == 1)
|
if (prdMoTask.schedule_type == 1)
|
||||||
{
|
{
|
||||||
wmsPrdInstockInput.prdInstockCodes.Add(new WmsPrdInstockCodeInput()
|
wmsPrdInstockInput.prdInstockCodes.Add(new WmsPrdInstockCodeInput()
|
||||||
@@ -2462,10 +2468,11 @@ namespace Tnb.ProductionMgr
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Log.Information($"生产入库参数:${JsonConvert.SerializeObject(wmsPrdInstockInput)}");
|
Log.Information($"生产入库参数:${JsonConvert.SerializeObject(wmsPrdInstockInput)}");
|
||||||
Tnb.WarehouseMgr.Entities.Dto.Outputs.Result result2 = await _wmsPrdInstockHService.PrdInstock(wmsPrdInstockInput, db);
|
Tnb.WarehouseMgr.Entities.Dto.Outputs.Result result2 =
|
||||||
|
await _wmsPrdInstockHService.PrdInstock(wmsPrdInstockInput, db);
|
||||||
if (result2 != null)
|
if (result2 != null)
|
||||||
{
|
{
|
||||||
Log.Information($"生产入库接口返回参数:${JsonConvert.SerializeObject(result2)}");
|
Log.Information($"生产入库接口返回参数:${JsonConvert.SerializeObject(result2)}");
|
||||||
@@ -2473,98 +2480,111 @@ namespace Tnb.ProductionMgr
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
Log.Information($"生产入库接口返回参数为null");
|
Log.Information($"生产入库接口返回参数为null");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (result2.code != HttpStatusCode.OK)
|
if (result2.code != HttpStatusCode.OK)
|
||||||
{
|
{
|
||||||
throw Oops.Bah(result2.msg !=null ? result2.msg : "生产入库接口报错");
|
throw Oops.Bah(result2.msg != null ? result2.msg : "生产入库接口报错");
|
||||||
}
|
}
|
||||||
|
|
||||||
//来源erp需要调接口
|
//来源erp需要调接口
|
||||||
if (prdMo.mo_source == "1")
|
if (prdMo.mo_source == "1")
|
||||||
{
|
{
|
||||||
List<DictionaryDataEntity> unitDatas = await db.Queryable<DictionaryTypeEntity>()
|
List<DictionaryDataEntity> unitDatas = await db.Queryable<DictionaryTypeEntity>()
|
||||||
.LeftJoin<DictionaryDataEntity>((x, y) => x.Id == y.DictionaryTypeId)
|
.LeftJoin<DictionaryDataEntity>((x, y) => x.Id == y.DictionaryTypeId)
|
||||||
.Where((x, y) => x.EnCode == DictConst.MeasurementUnit && y.EnCode==report.unit_id)
|
.Where((x, y) => x.EnCode == DictConst.MeasurementUnit && y.EnCode == report.unit_id)
|
||||||
.Select((x, y) => y)
|
.Select((x, y) => y)
|
||||||
.ToListAsync();
|
.ToListAsync();
|
||||||
|
|
||||||
List<string> erpExtendIds = new List<string>();
|
List<string> erpExtendIds = new List<string>();
|
||||||
erpExtendIds.Add(_userManager.UserId);
|
erpExtendIds.Add(_userManager.UserId);
|
||||||
erpExtendIds.Add(WmsWareHouseConst.AdministratorOrgId);
|
erpExtendIds.Add(WmsWareHouseConst.AdministratorOrgId);
|
||||||
erpExtendIds.Add(report.material_id);
|
erpExtendIds.Add(report.material_id);
|
||||||
// erpExtendIds.Add(report.unit_id);
|
// erpExtendIds.Add(report.unit_id);
|
||||||
erpExtendIds.AddRange(unitDatas.Select(x => x.Id).ToList());
|
erpExtendIds.AddRange(unitDatas.Select(x => x.Id).ToList());
|
||||||
|
|
||||||
List<ErpExtendField> erpExtendFields = await _db.Queryable<ErpExtendField>().Where(x=>erpExtendIds.Contains(x.table_id)).ToListAsync();
|
List<ErpExtendField> erpExtendFields = await _db.Queryable<ErpExtendField>()
|
||||||
string erpCreateId = erpExtendFields.Find(x=>x.table_id==_userManager.UserId)?.user_id ?? "";
|
.Where(x => erpExtendIds.Contains(x.table_id)).ToListAsync();
|
||||||
ErpExtendField erpOrg = erpExtendFields.Find(x => x.table_id == (WmsWareHouseConst.AdministratorOrgId));
|
string erpCreateId = erpExtendFields.Find(x => x.table_id == _userManager.UserId)?.user_id ?? "";
|
||||||
|
ErpExtendField erpOrg =
|
||||||
|
erpExtendFields.Find(x => x.table_id == (WmsWareHouseConst.AdministratorOrgId));
|
||||||
string nowStr = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
|
string nowStr = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
|
||||||
|
|
||||||
|
|
||||||
List<Dictionary<string, object>> requestData = new List<Dictionary<string, object>>();
|
List<Dictionary<string, object>> requestData = new List<Dictionary<string, object>>();
|
||||||
Dictionary<string, object> erpRequestData = new Dictionary<string, object>();
|
Dictionary<string, object> erpRequestData = new Dictionary<string, object>();
|
||||||
erpRequestData.Add("auditer",erpCreateId);
|
erpRequestData.Add("auditer", erpCreateId);
|
||||||
erpRequestData.Add("billmaker",erpCreateId);
|
erpRequestData.Add("billmaker", erpCreateId);
|
||||||
erpRequestData.Add("cdeptid","1001A1100000001JFOPQ");//部门先写死
|
erpRequestData.Add("cdeptid", "1001A1100000001JFOPQ"); //部门先写死
|
||||||
erpRequestData.Add("cdeptvid","0001A1100000000AOMIQ");//部门先写死
|
erpRequestData.Add("cdeptvid", "0001A1100000000AOMIQ"); //部门先写死
|
||||||
erpRequestData.Add("taudittime",nowStr);
|
erpRequestData.Add("taudittime", nowStr);
|
||||||
erpRequestData.Add("creationtime",nowStr);
|
erpRequestData.Add("creationtime", nowStr);
|
||||||
erpRequestData.Add("creator",erpCreateId);
|
erpRequestData.Add("creator", erpCreateId);
|
||||||
erpRequestData.Add("dbilldate",nowStr);
|
erpRequestData.Add("dbilldate", nowStr);
|
||||||
erpRequestData.Add("dmakedate",nowStr);
|
erpRequestData.Add("dmakedate", nowStr);
|
||||||
erpRequestData.Add("pk_org",erpOrg.pk_org);
|
erpRequestData.Add("pk_org", erpOrg.pk_org);
|
||||||
erpRequestData.Add("pk_org_v",erpOrg.pk_org_v);
|
erpRequestData.Add("pk_org_v", erpOrg.pk_org_v);
|
||||||
erpRequestData.Add("vtrantypecode","55A4-01");
|
erpRequestData.Add("vtrantypecode", "55A4-01");
|
||||||
erpRequestData.Add("vtrantypeid","0001A11000000002LVX8");
|
erpRequestData.Add("vtrantypeid", "0001A11000000002LVX8");
|
||||||
erpRequestData.Add("vdef1",null);//todo 倒冲日期
|
erpRequestData.Add("vdef1", null); //todo 倒冲日期
|
||||||
erpRequestData.Add("vdef2",null);
|
erpRequestData.Add("vdef2", null);
|
||||||
erpRequestData.Add("report_id",report.id);
|
erpRequestData.Add("report_id", report.id);
|
||||||
|
|
||||||
|
|
||||||
List<Dictionary<string, object>> erpRequestDataDetails = new List<Dictionary<string, object>>();
|
List<Dictionary<string, object>> erpRequestDataDetails = new List<Dictionary<string, object>>();
|
||||||
erpRequestDataDetails.Add(new Dictionary<string, object>()
|
erpRequestDataDetails.Add(new Dictionary<string, object>()
|
||||||
{
|
{
|
||||||
["cbdeptid"] = "1001A1100000001JFOPQ",//部门先写死
|
["cbdeptid"] = "1001A1100000001JFOPQ", //部门先写死
|
||||||
["cbdeptvid"] = "0001A1100000000AOMIQ",//部门先写死
|
["cbdeptvid"] = "0001A1100000000AOMIQ", //部门先写死
|
||||||
["cbmainmaterialid"] = erpExtendFields.Find(x=>x.table_id==report.material_id)?.cmaterialoid ?? "",
|
["cbmainmaterialid"] =
|
||||||
["cbmainmaterialvid"] = erpExtendFields.Find(x=>x.table_id==report.material_id)?.cmaterialvid ?? "",
|
erpExtendFields.Find(x => x.table_id == report.material_id)?.cmaterialoid ?? "",
|
||||||
["cbmaterialid"] = erpExtendFields.Find(x=>x.table_id==report.material_id)?.cmaterialvid ?? "",
|
["cbmainmaterialvid"] =
|
||||||
["cbmaterialvid"] = erpExtendFields.Find(x=>x.table_id==report.material_id)?.cmaterialvid ?? "",
|
erpExtendFields.Find(x => x.table_id == report.material_id)?.cmaterialvid ?? "",
|
||||||
|
["cbmaterialid"] = erpExtendFields.Find(x => x.table_id == report.material_id)?.cmaterialvid ??
|
||||||
|
"",
|
||||||
|
["cbmaterialvid"] = erpExtendFields.Find(x => x.table_id == report.material_id)?.cmaterialvid ??
|
||||||
|
"",
|
||||||
["cbmobid"] = prdMo.erp_line_pk,
|
["cbmobid"] = prdMo.erp_line_pk,
|
||||||
["cbmoid"] = prdMo.erp_mo_pk,
|
["cbmoid"] = prdMo.erp_mo_pk,
|
||||||
// ["cbunitid"] = erpExtendFields.Find(x=>x.table_id==report.unit_id)?.cunitid ?? "",
|
// ["cbunitid"] = erpExtendFields.Find(x=>x.table_id==report.unit_id)?.cunitid ?? "",
|
||||||
// ["cbastunitid"] = erpExtendFields.Find(x=>x.table_id==report.unit_id)?.cunitid ?? "",
|
// ["cbastunitid"] = erpExtendFields.Find(x=>x.table_id==report.unit_id)?.cunitid ?? "",
|
||||||
["cbunitid"] = erpExtendFields.Find(x => x.table_id == (unitDatas.Find(x=>x.EnCode==report.unit_id)?.Id ?? ""))?.cunitid ?? "",
|
["cbunitid"] = erpExtendFields.Find(x =>
|
||||||
["cbastunitid"] = erpExtendFields.Find(x => x.table_id == (unitDatas.Find(x=>x.EnCode==report.unit_id)?.Id ?? ""))?.cunitid ?? "",
|
x.table_id == (unitDatas.Find(x => x.EnCode == report.unit_id)?.Id ?? ""))?.cunitid ?? "",
|
||||||
|
["cbastunitid"] = erpExtendFields.Find(x =>
|
||||||
|
x.table_id == (unitDatas.Find(x => x.EnCode == report.unit_id)?.Id ?? ""))?.cunitid ?? "",
|
||||||
["nbplanwrnum"] = report.reported_qty,
|
["nbplanwrnum"] = report.reported_qty,
|
||||||
["nbwrnum"] = report.reported_qty,
|
["nbwrnum"] = report.reported_qty,
|
||||||
["tbendtime"] = nowStr,
|
["tbendtime"] = nowStr,
|
||||||
["tbstarttime"] = prdMoTask.act_start_date!=null ? prdMoTask.act_start_date.Value.ToString("yyyy-MM-dd HH:mm:ss") : "",
|
["tbstarttime"] = prdMoTask.act_start_date != null
|
||||||
|
? prdMoTask.act_start_date.Value.ToString("yyyy-MM-dd HH:mm:ss")
|
||||||
|
: "",
|
||||||
["vbinbatchcode"] = report.batch,
|
["vbinbatchcode"] = report.batch,
|
||||||
["vbmobillcode"] = prdMo.mo_code,
|
["vbmobillcode"] = prdMo.mo_code,
|
||||||
["vbmorowno"] = prdMo.erp_lineno,
|
["vbmorowno"] = prdMo.erp_lineno,
|
||||||
["vbrowno"] = prdMo.erp_lineno,
|
["vbrowno"] = prdMo.erp_lineno,
|
||||||
|
|
||||||
});
|
});
|
||||||
erpRequestData.Add("AggWrDtl",erpRequestDataDetails);
|
erpRequestData.Add("AggWrDtl", erpRequestDataDetails);
|
||||||
requestData.Add(erpRequestData);
|
requestData.Add(erpRequestData);
|
||||||
|
|
||||||
BasFactoryConfig config = await _db.Queryable<BasFactoryConfig>().FirstAsync(x => x.enabled == 1 && x.key == FactoryConfigConst.BIPURL);
|
BasFactoryConfig config = await _db.Queryable<BasFactoryConfig>()
|
||||||
|
.FirstAsync(x => x.enabled == 1 && x.key == FactoryConfigConst.BIPURL);
|
||||||
ThirdWebapiRecord thirdWebapiRecord = new ThirdWebapiRecord();
|
ThirdWebapiRecord thirdWebapiRecord = new ThirdWebapiRecord();
|
||||||
thirdWebapiRecord.id = SnowflakeIdHelper.NextId();
|
thirdWebapiRecord.id = SnowflakeIdHelper.NextId();
|
||||||
thirdWebapiRecord.third_name = WmsWareHouseConst.BIP;
|
thirdWebapiRecord.third_name = WmsWareHouseConst.BIP;
|
||||||
thirdWebapiRecord.name = "生产报告";
|
thirdWebapiRecord.name = "生产报告";
|
||||||
thirdWebapiRecord.method = "POST";
|
thirdWebapiRecord.method = "POST";
|
||||||
thirdWebapiRecord.url = config.value+"uapws/rest/pwrnew/save";
|
// thirdWebapiRecord.url = config.value + "uapws/rest/pwrnew/save";
|
||||||
// thirdWebapiRecord.url = WmsWareHouseConst.BIP_DOMAIN+"uapws/rest/pwrnew/save";
|
thirdWebapiRecord.url = WmsWareHouseConst.BIP_DOMAIN+"uapws/rest/pwrnew/save";
|
||||||
thirdWebapiRecord.request_data = JsonConvert.SerializeObject(erpRequestData);
|
thirdWebapiRecord.request_data = JsonConvert.SerializeObject(erpRequestData);
|
||||||
thirdWebapiRecord.create_time = DateTime.Now;
|
thirdWebapiRecord.create_time = DateTime.Now;
|
||||||
thirdWebapiRecord.remark = $"载具编号:{report?.material_box_code ?? ""}";
|
thirdWebapiRecord.remark = $"载具编号:{report?.material_box_code ?? ""}";
|
||||||
await _db.Insertable(thirdWebapiRecord).ExecuteCommandAsync();
|
await _db.Insertable(thirdWebapiRecord).ExecuteCommandAsync();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (prdMoTask.schedule_type == 2)
|
if (prdMoTask.schedule_type == 2)
|
||||||
{
|
{
|
||||||
// Dictionary<string, string> dicCommand2 = new(StringComparer.OrdinalIgnoreCase)
|
// Dictionary<string, string> dicCommand2 = new(StringComparer.OrdinalIgnoreCase)
|
||||||
@@ -2582,7 +2602,7 @@ 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"] = "外包装箱码垛线",
|
||||||
@@ -2601,6 +2621,20 @@ namespace Tnb.ProductionMgr
|
|||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// if (basMaterial.category_id.Contains("CGJCJ"))
|
||||||
|
// {
|
||||||
|
// EqpEquipment equipment = await _db.Queryable<EqpEquipment>().SingleAsync(x => x.id == prdMoTask.eqp_id);
|
||||||
|
// if (!string.IsNullOrEmpty(equipment.downmat_location_id))
|
||||||
|
// {
|
||||||
|
// BasLocation downmatLocation = await _db.Queryable<BasLocation>().SingleAsync(x=>x.id==equipment.downmat_location_id);
|
||||||
|
// await _db.Updateable<WmsCarryH>()
|
||||||
|
// .SetColumns(x => x.location_code == downmatLocation.location_code)
|
||||||
|
// .SetColumns(x => x.location_id == downmatLocation.id)
|
||||||
|
// .Where(x => x.carry_code == report.material_box_code)
|
||||||
|
// .ExecuteCommandAsync();
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
if (basMaterial.category_id.Contains("ZSJ") || basMaterial.category_id.Contains("DGJCJ"))
|
if (basMaterial.category_id.Contains("ZSJ") || basMaterial.category_id.Contains("DGJCJ"))
|
||||||
{
|
{
|
||||||
EqpEquipment equipment = await _db.Queryable<EqpEquipment>().SingleAsync(x => x.id == prdMoTask.eqp_id);
|
EqpEquipment equipment = await _db.Queryable<EqpEquipment>().SingleAsync(x => x.id == prdMoTask.eqp_id);
|
||||||
|
|||||||
@@ -45,6 +45,7 @@ namespace Tnb.QcMgr
|
|||||||
private readonly IWmsSaleService _wmsSaleService;
|
private readonly IWmsSaleService _wmsSaleService;
|
||||||
private readonly IWmsPurchaseService _wmsPurchaseService;
|
private readonly IWmsPurchaseService _wmsPurchaseService;
|
||||||
private readonly IPrdMoTaskService _prdMoTaskService;
|
private readonly IPrdMoTaskService _prdMoTaskService;
|
||||||
|
private static SemaphoreSlim prdreportSemaphore = new(1);
|
||||||
public OverideVisualDevFunc OverideFuncs { get; } = new OverideVisualDevFunc();
|
public OverideVisualDevFunc OverideFuncs { get; } = new OverideVisualDevFunc();
|
||||||
public QcCheckTaskService(ISqlSugarRepository<QcCheckExecH> repository,
|
public QcCheckTaskService(ISqlSugarRepository<QcCheckExecH> repository,
|
||||||
IUserManager userManager,
|
IUserManager userManager,
|
||||||
@@ -257,6 +258,7 @@ namespace Tnb.QcMgr
|
|||||||
[HttpPost]
|
[HttpPost]
|
||||||
public async Task SaveData(CheckTaskInput CheckTaskInput)
|
public async Task SaveData(CheckTaskInput CheckTaskInput)
|
||||||
{
|
{
|
||||||
|
await prdreportSemaphore.WaitAsync();
|
||||||
ISqlSugarClient db = _repository.AsSugarClient();
|
ISqlSugarClient db = _repository.AsSugarClient();
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@@ -270,6 +272,8 @@ namespace Tnb.QcMgr
|
|||||||
{ "checking", 32 },
|
{ "checking", 32 },
|
||||||
};
|
};
|
||||||
QcCheckExecH QcCheckExecH = await db.Queryable<QcCheckExecH>().Where(p => p.id == CheckTaskInput.mainid).FirstAsync();
|
QcCheckExecH QcCheckExecH = await db.Queryable<QcCheckExecH>().Where(p => p.id == CheckTaskInput.mainid).FirstAsync();
|
||||||
|
if (QcCheckExecH == null)
|
||||||
|
throw Oops.Bah($"未找到质检任务:{CheckTaskInput.mainid}");
|
||||||
DictionaryTypeEntity DictionaryType = await db.Queryable<DictionaryTypeEntity>().Where(p => p.FullName == "质检状态").FirstAsync();
|
DictionaryTypeEntity DictionaryType = await db.Queryable<DictionaryTypeEntity>().Where(p => p.FullName == "质检状态").FirstAsync();
|
||||||
DictionaryDataEntity DictionaryData = await db.Queryable<DictionaryDataEntity>().Where(p => p.DictionaryTypeId == DictionaryType.Id && p.FullName == "已完成").FirstAsync();
|
DictionaryDataEntity DictionaryData = await db.Queryable<DictionaryDataEntity>().Where(p => p.DictionaryTypeId == DictionaryType.Id && p.FullName == "已完成").FirstAsync();
|
||||||
QcCheckExecH.checknum = CheckTaskInput.checknum;
|
QcCheckExecH.checknum = CheckTaskInput.checknum;
|
||||||
@@ -347,6 +351,19 @@ namespace Tnb.QcMgr
|
|||||||
QcCheckExecH.qty = int.Parse(CheckTaskInput.checknum) - rqty;
|
QcCheckExecH.qty = int.Parse(CheckTaskInput.checknum) - rqty;
|
||||||
QcCheckExecH.rqty = rqty;
|
QcCheckExecH.rqty = rqty;
|
||||||
_ = await db.Updateable(QcCheckExecH).ExecuteCommandAsync();
|
_ = await db.Updateable(QcCheckExecH).ExecuteCommandAsync();
|
||||||
|
await db.Updateable<QcCheckExecH>()
|
||||||
|
.SetColumns(x => x.checknum == QcCheckExecH.checknum)
|
||||||
|
.SetColumns(x => x.status == QcCheckExecH.status)
|
||||||
|
.SetColumns(x => x.result == QcCheckExecH.result)
|
||||||
|
.SetColumns(x => x.execuser == QcCheckExecH.execuser)
|
||||||
|
.SetColumns(x => x.exectime == QcCheckExecH.exectime)
|
||||||
|
.SetColumns(x => x.check_type == QcCheckExecH.check_type)
|
||||||
|
.SetColumns(x => x.remark == QcCheckExecH.remark)
|
||||||
|
.SetColumns(x => x.attachment == QcCheckExecH.attachment)
|
||||||
|
.SetColumns(x => x.qty == QcCheckExecH.qty)
|
||||||
|
.SetColumns(x => x.rqty == QcCheckExecH.rqty)
|
||||||
|
.Where(x => x.id == CheckTaskInput.mainid)
|
||||||
|
.ExecuteCommandAsync();
|
||||||
_ = await db.Deleteable(QcCheckExecDdel).ExecuteCommandAsync();
|
_ = await db.Deleteable(QcCheckExecDdel).ExecuteCommandAsync();
|
||||||
_ = await db.Insertable(QcCheckExecDinsert).ExecuteCommandAsync();
|
_ = await db.Insertable(QcCheckExecDinsert).ExecuteCommandAsync();
|
||||||
//出厂检
|
//出厂检
|
||||||
@@ -450,6 +467,9 @@ namespace Tnb.QcMgr
|
|||||||
Log.Error(e.Message,e);
|
Log.Error(e.Message,e);
|
||||||
throw Oops.Oh("执行失败:"+e.Message);
|
throw Oops.Oh("执行失败:"+e.Message);
|
||||||
}
|
}
|
||||||
|
finally{
|
||||||
|
prdreportSemaphore.Release();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -445,8 +445,8 @@ namespace Tnb.WarehouseMgr
|
|||||||
thirdWebapiRecord.third_name = WmsWareHouseConst.BIP;
|
thirdWebapiRecord.third_name = WmsWareHouseConst.BIP;
|
||||||
thirdWebapiRecord.name = "产成品入库";
|
thirdWebapiRecord.name = "产成品入库";
|
||||||
thirdWebapiRecord.method = "POST";
|
thirdWebapiRecord.method = "POST";
|
||||||
thirdWebapiRecord.url = config.value + "uapws/rest/productin/save";
|
// thirdWebapiRecord.url = config.value + "uapws/rest/productin/save";
|
||||||
// thirdWebapiRecord.url = WmsWareHouseConst.BIP_DOMAIN + "uapws/rest/transIn/save";
|
thirdWebapiRecord.url = WmsWareHouseConst.BIP_DOMAIN + "uapws/rest/transIn/save";
|
||||||
thirdWebapiRecord.request_data = JsonConvert.SerializeObject(requestData);
|
thirdWebapiRecord.request_data = JsonConvert.SerializeObject(requestData);
|
||||||
thirdWebapiRecord.create_time = DateTime.Now;
|
thirdWebapiRecord.create_time = DateTime.Now;
|
||||||
thirdWebapiRecord.remark = $"载具编号:{prdReport?.material_box_code ?? ""}";
|
thirdWebapiRecord.remark = $"载具编号:{prdReport?.material_box_code ?? ""}";
|
||||||
|
|||||||
@@ -180,6 +180,7 @@ namespace Tnb.WarehouseMgr
|
|||||||
["pk_org"] = erpOrg.pk_org,
|
["pk_org"] = erpOrg.pk_org,
|
||||||
["pk_org_v"] = erpOrg.pk_org_v,
|
["pk_org_v"] = erpOrg.pk_org_v,
|
||||||
["vbatchcode"] = item.code_batch,
|
["vbatchcode"] = item.code_batch,
|
||||||
|
["vdef19"] = item.code_batch,
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user