diff --git a/FactorySystemApi/Controllers/ViewController.cs b/FactorySystemApi/Controllers/ViewController.cs index c49687d..016c66b 100644 --- a/FactorySystemApi/Controllers/ViewController.cs +++ b/FactorySystemApi/Controllers/ViewController.cs @@ -348,7 +348,7 @@ namespace FactorySystemApi.Controllers BaseBll.UpdateTeamProcess2(teamwork.FID, (int)Constant.HalfMaterialProcessType.物料编辑, 2, 2); TFS_HalfMaterialTask tFS_HalfMaterialTask = BaseBll.GetTempModel(string.Format("FTeamID={0} AND FType=3", teamId)); - + halfMaterialTaskBll.CloseHalfMaterialTask2(teamId, user.FID, (int)Constant.HalfMaterialProcessType.物料编辑); if (tFS_HalfMaterialTask == null) { BaseBll.CreateTaskData2(teamwork.FID, user.FID, "3"); diff --git a/FactorySystemApi/Web.config b/FactorySystemApi/Web.config index 44a69b0..2c76d2c 100644 --- a/FactorySystemApi/Web.config +++ b/FactorySystemApi/Web.config @@ -12,8 +12,8 @@ - - + + diff --git a/FactorySystemBll/HalfMaterialTaskBll.cs b/FactorySystemBll/HalfMaterialTaskBll.cs index 2370037..4c7bf9d 100644 --- a/FactorySystemBll/HalfMaterialTaskBll.cs +++ b/FactorySystemBll/HalfMaterialTaskBll.cs @@ -47,7 +47,7 @@ namespace FactorySystemBll public int CloseHalfMaterialTask(int teamId, int userId, int type) { SqlSugarClient db = AppSettingsHelper.GetSqlSugar(); - List taskList = db.Queryable().Where(s => s.FType == type && s.FTeamID == teamId && s.FState == 1).ToList(); + List taskList = db.Queryable().Where(s => s.FType == type && s.FTeamID == teamId).ToList(); int result = 0; if (taskList != null && taskList.Count > 0) @@ -61,7 +61,32 @@ namespace FactorySystemBll result = db.Updateable(fmt).IgnoreColumns(true).WhereColumns("FID").ExecuteCommand(); } + return result; + } + + /// + /// 关闭任务当是可以编辑 + /// + /// + /// + /// + /// + public int CloseHalfMaterialTask2(int teamId, int userId, int type) + { + SqlSugarClient db = AppSettingsHelper.GetSqlSugar(); + List taskList = db.Queryable().Where(s => s.FType == type && s.FTeamID == teamId && s.FState == 1).ToList(); + int result = 0; + if (taskList != null && taskList.Count > 0) + { + TFS_HalfMaterialTask fmt = taskList[0]; + + fmt.FState = 2; + fmt.FEditUser = userId; + fmt.FEditDate = DateTime.Now; + + result = db.Updateable(fmt).IgnoreColumns(true).WhereColumns("FID").ExecuteCommand(); + } return result; } } diff --git a/FactorySystemBll/HalfMaterialTeamworkBll.cs b/FactorySystemBll/HalfMaterialTeamworkBll.cs index 46710b4..754a788 100644 --- a/FactorySystemBll/HalfMaterialTeamworkBll.cs +++ b/FactorySystemBll/HalfMaterialTeamworkBll.cs @@ -792,11 +792,11 @@ namespace FactorySystemBll if (string.IsNullOrWhiteSpace(idList)) { - sql = string.Format("update TFS_Material set FTestCode='{0}' WHERE FID in ({1});update TFS_ViewMaterial set FHalfMaterialTeamID={2} WHERE FMaterialID in ({1})", testCode2, string.Join(",", ids), temId); + sql = string.Format("update TFS_Material set FTestCode='{0}' WHERE FID in ({1});update TFS_ViewMaterial set FHalfMaterialTeamID={2} WHERE FMaterialID in ({1});update TFS_MaterialInfo set FTestCode='{0}' WHERE FDataID IN({1})", testCode2, string.Join(",", ids), temId); } else { - sql = string.Format("update TFS_Material set FTestCode='{0}' WHERE FID in ({1})", testCode, idList); + sql = string.Format("update TFS_Material set FTestCode='{0}' WHERE FID in ({1});update TFS_MaterialInfo set FTestCode='{0}' WHERE FDataID IN({1})", testCode, idList); } if (materialList.Count() > 0) { diff --git a/FactorySystemBll/ViewBll.cs b/FactorySystemBll/ViewBll.cs index fda3cc5..8925e8b 100644 --- a/FactorySystemBll/ViewBll.cs +++ b/FactorySystemBll/ViewBll.cs @@ -239,7 +239,7 @@ namespace FactorySystemBll if (viewType == 10) { viewList = db.Queryable((a, b) => - new JoinQueryInfos(JoinType.Inner, a.FMaterialID == b.FID)) + new JoinQueryInfos(JoinType.Left, a.FMaterialID == b.FID)) .Where((a, b) => a.FTeamID == teamId) .Where((a, b) => a.FTeamType == teamType) .WhereIF(currUser != null, (a, b) => a.FFactoryID == currUser.FFactoryID) @@ -250,7 +250,7 @@ namespace FactorySystemBll else { viewList = db.Queryable((a, b) => - new JoinQueryInfos(JoinType.Inner, a.FMaterialID == b.FID)) + new JoinQueryInfos(JoinType.Left, a.FMaterialID == b.FID)) .Where((a, b) => a.FTeamID == teamId) .Where((a, b) => a.FTeamType == teamType) .WhereIF(currUser != null, (a, b) => a.FFactoryID == currUser.FFactoryID) @@ -411,7 +411,8 @@ namespace FactorySystemBll FAddUser = userId, FType2 = temp.FTypeID2, FMaterialGroup = temp.FMaterialGroup, - FMaterialType = temp.FMaterialType + FMaterialType = temp.FMaterialType, + FTestCode= temp.FTestCode }; db.Insertable(info).IgnoreColumns(true).ExecuteCommand(); }