Merge branch 'dev' of https://git.tuotong-tech.com/tnb/tnb.server into dev
This commit is contained in:
@@ -439,12 +439,12 @@ namespace Tnb.QcMgr
|
||||
|
||||
if (list.IsEmpty())
|
||||
{
|
||||
throw Oops.Bah("未找到质检方案");
|
||||
throw Oops.Bah($"{entity.triggerevent.ToString()}未找到质检方案");
|
||||
}
|
||||
|
||||
if (list.Count > 1)
|
||||
{
|
||||
throw Oops.Bah("找到多个质检方案");
|
||||
throw Oops.Bah($"{entity.triggerevent.ToString()}找到多个质检方案");
|
||||
}
|
||||
|
||||
// List<string> removes = new();
|
||||
|
||||
@@ -156,11 +156,11 @@ namespace Tnb.QcMgr
|
||||
checknum = !string.IsNullOrEmpty(QcCheckExecH.checknum) ? int.Parse(QcCheckExecH.checknum) : 0,
|
||||
worker_name = userEntity?.RealName ?? "",
|
||||
bill_code = QcCheckExecH.bill_code,
|
||||
carry_code = prdReport?.material_box_code,
|
||||
carry_code = prdReport!=null ? prdReport.material_box_code : "",
|
||||
};
|
||||
if (!string.IsNullOrEmpty(CheckTaskOut.workid))
|
||||
{
|
||||
CheckTaskOut.workname = db.Queryable<OrganizeEntity>().Where(p => p.Id == CheckTaskOut.workid).First().FullName;
|
||||
CheckTaskOut.workname = db.Queryable<OrganizeEntity>().Where(p => p.Id == CheckTaskOut.workid).First()?.FullName;
|
||||
}
|
||||
|
||||
CheckTaskOut.checktypes = new List<CheckExecTypeOut>();
|
||||
@@ -195,7 +195,8 @@ namespace Tnb.QcMgr
|
||||
Item.setData.errorcause = new List<Error>();
|
||||
foreach (string str in strs)
|
||||
{
|
||||
Item.setData.errorcause.Add(new Error { id = str, name = QcErrorCauses.Where(p => p.id == str).First().name! });
|
||||
if (string.IsNullOrEmpty(str) || str == "null") continue;
|
||||
Item.setData.errorcause.Add(new Error { id = str, name = QcErrorCauses.Where(p => p.id == str).First()?.name! });
|
||||
}
|
||||
}
|
||||
if (!string.IsNullOrEmpty(QcCheckExecD.errorlevel))
|
||||
@@ -204,7 +205,8 @@ namespace Tnb.QcMgr
|
||||
Item.setData.errorlevel = new List<Error>();
|
||||
foreach (string str in strs)
|
||||
{
|
||||
Item.setData.errorlevel.Add(new Error { id = str, name = QcErrorLevels.Where(p => p.id == str).First().name! });
|
||||
if (string.IsNullOrEmpty(str) || str == "null") continue;
|
||||
Item.setData.errorlevel.Add(new Error { id = str, name = QcErrorLevels.Where(p => p.id == str).First()?.name! });
|
||||
}
|
||||
}
|
||||
Item.setData.remark = QcCheckExecD.remark!;
|
||||
|
||||
@@ -2655,6 +2655,9 @@ namespace Tnb.WarehouseMgr
|
||||
string erpCreateId = erpExtendFields.Find(x=>x.table_id==wmsMaterialTransfer.create_id)?.user_id ?? "";
|
||||
ErpExtendField erpOrg = erpExtendFields.Find(x => x.table_id == (wmsMaterialTransfer.org_id ?? WmsWareHouseConst.AdministratorOrgId));
|
||||
string nowStr = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
|
||||
List<WmsErpWarehouserelaH> erpWarehouserelaHs = await _db.Queryable<WmsErpWarehouserelaH>().Where(x=>x.id!=null).ToListAsync();
|
||||
BasWarehouse basWarehouse = await db.Queryable<BasWarehouse>().SingleAsync(x=>x.id==wmsMaterialTransfer.warehouse_instock);
|
||||
string whcode = basWarehouse?.whcode ?? "";
|
||||
|
||||
List<Dictionary<string, object>> requestData = new List<Dictionary<string, object>>();
|
||||
Dictionary<string, object> erpRequestData = new Dictionary<string, object>();
|
||||
@@ -2665,7 +2668,8 @@ namespace Tnb.WarehouseMgr
|
||||
erpRequestData.Add("creationtime",nowStr);
|
||||
erpRequestData.Add("creator",erpCreateId);
|
||||
erpRequestData.Add("ctrantypeid","0001H11000000000D30Z");
|
||||
erpRequestData.Add("cwarehouseid",erpExtendFields.Find(x=>x.table_id==wmsMaterialTransfer.warehouse_instock)?.cotherwhid ?? "");
|
||||
// erpRequestData.Add("cwarehouseid",erpExtendFields.Find(x=>x.table_id==wmsMaterialTransfer.warehouse_instock)?.cotherwhid ?? "");
|
||||
erpRequestData.Add("cwarehouseid",erpWarehouserelaHs.Find(x => x.wms_warehousecode == whcode)?.erp_warehouseid ?? "");
|
||||
erpRequestData.Add("cwhsmanagerid","");
|
||||
erpRequestData.Add("dbilldate",nowStr);
|
||||
erpRequestData.Add("dmakedate",nowStr);
|
||||
@@ -2681,8 +2685,8 @@ namespace Tnb.WarehouseMgr
|
||||
erpRequestDataDetails.Add(new Dictionary<string, object>()
|
||||
{
|
||||
["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 ?? "",
|
||||
["cbodywarehouseid"] = erpWarehouserelaHs.Find(x => x.wms_warehousecode == whcode)?.erp_warehouseid ?? "",
|
||||
["cgeneralbid"] = erpWarehouserelaHs.Find(x => x.wms_warehousecode == whcode)?.erp_warehouseid ?? "",
|
||||
["cgeneralbid"] = null,
|
||||
["cgeneralhid"] = null,
|
||||
["cmaterialoid"] = erpExtendFields.Find(x=>x.table_id==item.material_id)?.cmaterialoid ?? "",
|
||||
|
||||
@@ -1033,7 +1033,13 @@ namespace Tnb.WarehouseMgr
|
||||
|
||||
ErpExtendField erpOrg = erpExtendFields.Find(x => x.table_id == (wmsMaterialTransfer.org_id ?? WmsWareHouseConst.AdministratorOrgId));
|
||||
string erpCreateId = erpExtendFields.Find(x => x.table_id == wmsMaterialTransfer.create_id)?.user_id ?? "";
|
||||
|
||||
List<WmsErpWarehouserelaH> erpWarehouserelaHs = await _db.Queryable<WmsErpWarehouserelaH>().Where(x=>x.id!=null).ToListAsync();
|
||||
BasWarehouse outWarehouse = await _db.Queryable<BasWarehouse>().SingleAsync(x=>x.id==wmsMaterialTransfer.warehouse_outstock);
|
||||
BasWarehouse inWarehouse = await _db.Queryable<BasWarehouse>().SingleAsync(x=>x.id==wmsMaterialTransfer.warehouse_instock);
|
||||
string inwhcode = inWarehouse?.whcode ?? "";
|
||||
string outwhcode = outWarehouse?.whcode ?? "";
|
||||
|
||||
|
||||
List<Dictionary<string, object>> requestData = new List<Dictionary<string, object>>();
|
||||
Dictionary<string, object> erpRequestData = new Dictionary<string, object>();
|
||||
string nowStr = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
|
||||
@@ -1043,11 +1049,12 @@ namespace Tnb.WarehouseMgr
|
||||
erpRequestData.Add("corpoid", erpOrg.corpoid);
|
||||
erpRequestData.Add("corpvid", erpOrg.corpoid);
|
||||
erpRequestData.Add("cothercalbodyoid", erpOrg.pk_org);
|
||||
erpRequestData.Add("cotherwhid", erpExtendFields.Find(x => x.table_id == wmsMaterialTransfer.warehouse_instock)?.cotherwhid ?? "");
|
||||
// erpRequestData.Add("cotherwhid", erpExtendFields.Find(x => x.table_id == wmsMaterialTransfer.warehouse_instock)?.cotherwhid ?? "");
|
||||
erpRequestData.Add("cotherwhid", erpWarehouserelaHs.Find(x => x.wms_warehousecode == inwhcode)?.erp_warehouseid ?? "");
|
||||
erpRequestData.Add("creationtime", nowStr);
|
||||
erpRequestData.Add("creator", erpCreateId);
|
||||
erpRequestData.Add("ctrantypeid", "0001H11000000000D31W");
|
||||
erpRequestData.Add("cwarehouseid", erpExtendFields.Find(x => x.table_id == wmsMaterialTransfer.warehouse_outstock)?.cotherwhid ?? "");
|
||||
erpRequestData.Add("cwarehouseid", erpWarehouserelaHs.Find(x => x.wms_warehousecode == outwhcode)?.erp_warehouseid ?? "");
|
||||
erpRequestData.Add("dbilldate", nowStr);
|
||||
erpRequestData.Add("dmakedate", nowStr);
|
||||
erpRequestData.Add("ntotalnum", wmsCarryCodes.Sum(r => r.codeqty));
|
||||
@@ -1060,7 +1067,7 @@ namespace Tnb.WarehouseMgr
|
||||
erpRequestDataDetails.Add(new Dictionary<string, object>()
|
||||
{
|
||||
["cbodytranstypecode"] = "4I-01",
|
||||
["cbodywarehouseid"] = erpExtendFields.Find(x => x.table_id == wmsMaterialTransfer.warehouse_outstock)?.cotherwhid ?? "",
|
||||
["cbodywarehouseid"] = erpWarehouserelaHs.Find(x => x.wms_warehousecode == outwhcode)?.erp_warehouseid ?? "",
|
||||
["cmaterialoid"] = erpExtendFields.Find(x => x.table_id == wmsMaterialTransferd.material_id)?.cmaterialoid ?? "",
|
||||
["cmaterialvid"] = erpExtendFields.Find(x => x.table_id == wmsMaterialTransferd.material_id)?.cmaterialvid ?? "",
|
||||
["corpoid"] = erpOrg.corpoid,
|
||||
|
||||
@@ -582,6 +582,7 @@ public class OrganizeService : IOrganizeService, IDynamicApiController, ITransie
|
||||
|
||||
// 删除该组织和角色关联数据
|
||||
await _repository.AsSugarClient().Deleteable<OrganizeRelationEntity>().Where(x => x.OrganizeId == id && x.ObjectType == "Role").ExecuteCommandAsync();
|
||||
await _repository.AsSugarClient().Deleteable<OrganizeRelationEntity>().Where(x => x.OrganizeId == id && x.ObjectType == "Eqp").ExecuteCommandAsync();
|
||||
|
||||
_db.CommitTran();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user