|
|
|
|
@ -205,6 +205,65 @@ namespace FactorySystemApi.Controllers
|
|
|
|
|
}, apiResult, Request);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 保存视图编辑的内容
|
|
|
|
|
/// </summary>
|
|
|
|
|
[HttpPost]
|
|
|
|
|
public ApiResult UpdateBatchById3(Dictionary<string, object> inParam)
|
|
|
|
|
{
|
|
|
|
|
var apiResult = new ApiResult();
|
|
|
|
|
return ExceptionHelper.TryReturnException(() =>
|
|
|
|
|
{
|
|
|
|
|
if (Request.Properties["token"] is ApiAuthInfo user)
|
|
|
|
|
{
|
|
|
|
|
inParam.TryGetValue("TFS_ViewMaterial", out object viewObj);
|
|
|
|
|
inParam.TryGetValue("TFS_Material", out object materialObj);
|
|
|
|
|
inParam.TryGetValue("TFS_MaterialInfo", out object infoObj);
|
|
|
|
|
List<Dictionary<string, object>> viewList = JsonConvert.DeserializeObject<List<Dictionary<string, object>>>(JsonConvert.SerializeObject(viewObj));
|
|
|
|
|
List<Dictionary<string, object>> materialList = JsonConvert.DeserializeObject<List<Dictionary<string, object>>>(JsonConvert.SerializeObject(materialObj));
|
|
|
|
|
List<Dictionary<string, object>> infoList = JsonConvert.DeserializeObject<List<Dictionary<string, object>>>(JsonConvert.SerializeObject(infoObj));
|
|
|
|
|
int teamId = int.Parse(inParam["FTeamID"].ToString());
|
|
|
|
|
int viewType = int.Parse(inParam["FViewType"].ToString());
|
|
|
|
|
apiResult.Data = _viewBll.UpdateBatchById3(viewList, materialList, infoList, teamId, viewType, user.FID);
|
|
|
|
|
|
|
|
|
|
if (viewType == 10)
|
|
|
|
|
{
|
|
|
|
|
// 创建物料视图事项
|
|
|
|
|
TFS_HalfMaterialFTeamwork teamwork = BaseBll.GetTempModel<TFS_HalfMaterialFTeamwork>(teamId);
|
|
|
|
|
List<Dictionary<string, object>> vml = _viewBll.GetListByTeamId(teamId, viewType, user.FID, out List<int> materialId, out string FGuaranteePeriod, out string FStorageConditions, true);
|
|
|
|
|
Dictionary<int, string> hasNewView = new Dictionary<int, string>();
|
|
|
|
|
|
|
|
|
|
if (vml != null)
|
|
|
|
|
{
|
|
|
|
|
foreach (Dictionary<string, object> row in vml)
|
|
|
|
|
{
|
|
|
|
|
int materialType = (int)(long)row["FViewType"];
|
|
|
|
|
string factoryId = row["FFactoryID"].ToString();
|
|
|
|
|
|
|
|
|
|
if (materialType == 2 || materialType == 3 || materialType == 4 || materialType == 5)
|
|
|
|
|
{
|
|
|
|
|
if (hasNewView.ContainsKey(materialType))
|
|
|
|
|
{
|
|
|
|
|
hasNewView[materialType] = hasNewView[materialType] + factoryId + ",";
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
hasNewView.Add(materialType, factoryId + ",");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
HalfMaterialTeamworkBll TeamworkBll = new HalfMaterialTeamworkBll();
|
|
|
|
|
TeamworkBll.CreateMaterialTask(hasNewView, teamwork, user.FID);
|
|
|
|
|
}
|
|
|
|
|
BaseBll.CreateTaskData2(teamId, user.FID, "3");
|
|
|
|
|
|
|
|
|
|
BaseBll.UpdateTeamProcess2(teamwork.FID, (int)Constant.HalfMaterialProcessType.物料分类, 3, 2);
|
|
|
|
|
BaseBll.UpdateTeamProcess2(teamwork.FID, (int)Constant.HalfMaterialProcessType.物料编辑, 2, 1);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}, apiResult, Request);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 保存视图编辑的内容(物料新增条线)
|
|
|
|
|
/// </summary>
|
|
|
|
|
|