leo 2 years ago
commit 0878253397

@ -345,7 +345,7 @@ namespace FactorySystemApi.Controllers
BaseBll.UpdateTeamProcess2(teamwork.FID, (int)Constant.HalfMaterialProcessType., 2, 2); BaseBll.UpdateTeamProcess2(teamwork.FID, (int)Constant.HalfMaterialProcessType., 2, 2);
TFS_HalfMaterialTask tFS_HalfMaterialTask = BaseBll.GetTempModel<TFS_HalfMaterialTask>(string.Format("FTeamID={0} AND FType=3", teamId)); TFS_HalfMaterialTask tFS_HalfMaterialTask = BaseBll.GetTempModel<TFS_HalfMaterialTask>(string.Format("FTeamID={0} AND FType=3", teamId));
halfMaterialTaskBll.CloseHalfMaterialTask2(teamId, user.FID, (int)Constant.HalfMaterialProcessType.);
if (tFS_HalfMaterialTask == null) if (tFS_HalfMaterialTask == null)
{ {
BaseBll.CreateTaskData2(teamwork.FID, user.FID, "3"); BaseBll.CreateTaskData2(teamwork.FID, user.FID, "3");

@ -12,8 +12,8 @@
<appSettings> <appSettings>
<add key="ApiAuthSecretKey" value="zhkxfs" /> <add key="ApiAuthSecretKey" value="zhkxfs" />
<!--<add key="ConnectionString" value="server=49.235.68.145,3456;uid=sa;pwd=zhenxuan@2019;database=FactorySystem" />--> <!--<add key="ConnectionString" value="server=49.235.68.145,3456;uid=sa;pwd=zhenxuan@2019;database=FactorySystem" />-->
<add key="ConnectionString" value="server=192.168.8.157,12580;uid=tfs;pwd=tfs2022;database=FactorySystem" />
<add key="ConnectionString" value="server=120.55.81.57;uid=sa;pwd=1qaz@WSX;database=FactorySystem" /> <!--<add key="ConnectionString" value="server=120.55.81.57;uid=sa;pwd=1qaz@WSX;database=FactorySystem" />-->
<add key="Sap_UserName" value="mcs_con" /> <add key="Sap_UserName" value="mcs_con" />
<add key="Sap_Upload_UserName" value="chenjie" /> <add key="Sap_Upload_UserName" value="chenjie" />

@ -47,7 +47,7 @@ namespace FactorySystemBll
public int CloseHalfMaterialTask(int teamId, int userId, int type) public int CloseHalfMaterialTask(int teamId, int userId, int type)
{ {
SqlSugarClient db = AppSettingsHelper.GetSqlSugar(); SqlSugarClient db = AppSettingsHelper.GetSqlSugar();
List<TFS_HalfMaterialTask> taskList = db.Queryable<TFS_HalfMaterialTask>().Where(s => s.FType == type && s.FTeamID == teamId && s.FState == 1).ToList(); List<TFS_HalfMaterialTask> taskList = db.Queryable<TFS_HalfMaterialTask>().Where(s => s.FType == type && s.FTeamID == teamId).ToList();
int result = 0; int result = 0;
if (taskList != null && taskList.Count > 0) if (taskList != null && taskList.Count > 0)
@ -61,7 +61,32 @@ namespace FactorySystemBll
result = db.Updateable(fmt).IgnoreColumns(true).WhereColumns("FID").ExecuteCommand(); result = db.Updateable(fmt).IgnoreColumns(true).WhereColumns("FID").ExecuteCommand();
} }
return result;
}
/// <summary>
/// 关闭任务当是可以编辑
/// </summary>
/// <param name="teamId"></param>
/// <param name="userId"></param>
/// <param name="type"></param>
/// <returns></returns>
public int CloseHalfMaterialTask2(int teamId, int userId, int type)
{
SqlSugarClient db = AppSettingsHelper.GetSqlSugar();
List<TFS_HalfMaterialTask> taskList = db.Queryable<TFS_HalfMaterialTask>().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; return result;
} }
} }

@ -792,11 +792,11 @@ namespace FactorySystemBll
if (string.IsNullOrWhiteSpace(idList)) 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 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) if (materialList.Count() > 0)
{ {

@ -239,7 +239,7 @@ namespace FactorySystemBll
if (viewType == 10) if (viewType == 10)
{ {
viewList = db.Queryable<TFS_ViewMaterial, TFS_Material>((a, b) => viewList = db.Queryable<TFS_ViewMaterial, TFS_Material>((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.FTeamID == teamId)
.Where((a, b) => a.FTeamType == teamType) .Where((a, b) => a.FTeamType == teamType)
.WhereIF(currUser != null, (a, b) => a.FFactoryID == currUser.FFactoryID) .WhereIF(currUser != null, (a, b) => a.FFactoryID == currUser.FFactoryID)
@ -250,7 +250,7 @@ namespace FactorySystemBll
else else
{ {
viewList = db.Queryable<TFS_ViewMaterial, TFS_Material>((a, b) => viewList = db.Queryable<TFS_ViewMaterial, TFS_Material>((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.FTeamID == teamId)
.Where((a, b) => a.FTeamType == teamType) .Where((a, b) => a.FTeamType == teamType)
.WhereIF(currUser != null, (a, b) => a.FFactoryID == currUser.FFactoryID) .WhereIF(currUser != null, (a, b) => a.FFactoryID == currUser.FFactoryID)
@ -411,7 +411,8 @@ namespace FactorySystemBll
FAddUser = userId, FAddUser = userId,
FType2 = temp.FTypeID2, FType2 = temp.FTypeID2,
FMaterialGroup = temp.FMaterialGroup, FMaterialGroup = temp.FMaterialGroup,
FMaterialType = temp.FMaterialType FMaterialType = temp.FMaterialType,
FTestCode= temp.FTestCode
}; };
db.Insertable(info).IgnoreColumns(true).ExecuteCommand(); db.Insertable(info).IgnoreColumns(true).ExecuteCommand();
} }

Loading…
Cancel
Save