修改焊工合格项目视图及质量人员管理接口
This commit is contained in:
parent
2914b96cd6
commit
514deb15aa
|
|
@ -0,0 +1,65 @@
|
|||
|
||||
ALTER VIEW [dbo].[View_Welder_WelderQualify]
|
||||
AS
|
||||
/*******焊工资质***********/
|
||||
SELECT WelderQualify.WelderQualifyId,
|
||||
WelderQualify.WelderId,
|
||||
WelderQualify.QualificationItem,
|
||||
WelderQualify.LimitDate,
|
||||
WelderQualify.CheckDate,
|
||||
WelderQualify.ThicknessMin,
|
||||
WelderQualify.ThicknessMax,
|
||||
WelderQualify.SizesMin,
|
||||
WelderQualify.SizesMax,
|
||||
WelderQualify.ThicknessMin2,
|
||||
WelderQualify.IsAudit,
|
||||
WelderQualify.AuditMan,
|
||||
WelderQualify.AuditDate,
|
||||
WelderQualify.ThicknessMax2,
|
||||
WelderQualify.SizesMin2,
|
||||
WelderQualify.SizesMax2,
|
||||
(CASE WHEN WelderQualify.ThicknessMin is null THEN '不可焊'
|
||||
else ((CASE WHEN WelderQualify.ThicknessMin>0 THEN CONVERT(VARCHAR(5),CAST(WelderQualify.ThicknessMin AS REAL))
|
||||
else '不限' end)+' ~ '+
|
||||
(CASE WHEN WelderQualify.ThicknessMax>0 THEN CONVERT(VARCHAR(5),CAST(WelderQualify.ThicknessMax AS REAL))
|
||||
else '不限' end)
|
||||
) end) as Thickness,
|
||||
(CASE WHEN WelderQualify.SizesMin is null THEN '不可焊'
|
||||
else ((CASE WHEN WelderQualify.SizesMin>0 THEN CONVERT(VARCHAR(5),CAST(WelderQualify.SizesMin AS REAL))
|
||||
else '不限' end)+' ~ '+
|
||||
(CASE WHEN WelderQualify.SizesMax>0 THEN CONVERT(VARCHAR(5),CAST(WelderQualify.SizesMax AS REAL))
|
||||
else '不限' end)
|
||||
) end) as Sizes,
|
||||
(CASE WHEN WelderQualify.ThicknessMin2 is null THEN '不可焊'
|
||||
else ((CASE WHEN WelderQualify.ThicknessMin2>0 THEN CONVERT(VARCHAR(5),CAST(WelderQualify.ThicknessMin2 AS REAL))
|
||||
else '不限' end)+' ~ '+
|
||||
(CASE WHEN WelderQualify.ThicknessMax2>0 THEN CONVERT(VARCHAR(5),CAST(WelderQualify.ThicknessMax2 AS REAL))
|
||||
else '不限' end)
|
||||
) end) as Thickness2,
|
||||
(CASE WHEN WelderQualify.SizesMin2 is null THEN '不可焊'
|
||||
else ((CASE WHEN WelderQualify.SizesMin2>0 THEN CONVERT(VARCHAR(5),CAST(WelderQualify.SizesMin2 AS REAL))
|
||||
else '不限' end)+' ~ '+
|
||||
(CASE WHEN WelderQualify.SizesMax2>0 THEN CONVERT(VARCHAR(5),CAST(WelderQualify.SizesMax2 AS REAL))
|
||||
else '不限' end)
|
||||
) end) as Sizes2,
|
||||
|
||||
WelderQualify.Remark,
|
||||
Welder.WelderCode,
|
||||
Welder.PersonName,
|
||||
WelderQualify.WeldingMethod,
|
||||
WelderQualify.WeldingLocation,
|
||||
WelderQualify.MaterialType,
|
||||
WelderQualify.IsPrintShow,
|
||||
WelderQualify.WeldType,
|
||||
WelderQualify.WelderMode,
|
||||
WelderQualify.IsCanWeldG
|
||||
FROM Welder_WelderQualify AS WelderQualify
|
||||
LEFT JOIN SitePerson_Person AS Welder ON Welder.PersonId=WelderQualify.WelderId
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
GO
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
--ADD BY gaofei 2022-09-15
|
||||
1,修改焊工合格项目视图
|
||||
2,修改质量移动端人员管理接口
|
||||
--END
|
||||
|
||||
|
|
@ -1,4 +1,5 @@
|
|||
using System.Collections.Generic;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace BLL
|
||||
|
|
@ -186,5 +187,498 @@ namespace BLL
|
|||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 获取焊工合格项目
|
||||
public static Model.View_Welder_WelderQualify GetWelderQualify(string welderQualifyId)
|
||||
{
|
||||
using (var db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
Model.View_Welder_WelderQualify x = db.View_Welder_WelderQualify.FirstOrDefault(e => e.WelderQualifyId == welderQualifyId);
|
||||
x.WelderQualifyId = x.WelderQualifyId;
|
||||
x.WelderId = x.WelderId;
|
||||
x.QualificationItem = x.QualificationItem;
|
||||
x.LimitDate = x.LimitDate;
|
||||
x.CheckDate = x.CheckDate;
|
||||
x.ThicknessMin = x.ThicknessMin;
|
||||
x.ThicknessMax = x.ThicknessMax;
|
||||
x.SizesMin = x.SizesMin;
|
||||
x.SizesMax = x.SizesMax;
|
||||
x.ThicknessMin2 = x.ThicknessMin2;
|
||||
x.IsAudit = x.IsAudit;
|
||||
x.AuditMan = x.AuditMan;
|
||||
x.AuditDate = x.AuditDate;
|
||||
x.ThicknessMax2 = x.ThicknessMax2;
|
||||
x.SizesMin2 = x.SizesMin2;
|
||||
x.SizesMax2 = x.SizesMax2;
|
||||
x.Thickness = x.Thickness;
|
||||
x.Sizes = x.Sizes;
|
||||
x.Thickness2 = x.Thickness2;
|
||||
x.Sizes2 = x.Sizes2;
|
||||
x.Remark = x.Remark;
|
||||
x.WelderCode = x.WelderCode;
|
||||
x.PersonName = x.PersonName;
|
||||
x.WeldingMethod = x.WeldingMethod;
|
||||
x.WeldingLocation = x.WeldingLocation;
|
||||
x.MaterialType = x.MaterialType;
|
||||
x.IsPrintShow = x.IsPrintShow;
|
||||
x.WeldType = x.WeldType;
|
||||
x.WelderMode = x.WelderMode;
|
||||
x.IsCanWeldG = x.IsCanWeldG;
|
||||
x.PersonName = x.PersonName;
|
||||
return x;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 获取焊工合格项目分析取值
|
||||
public static Model.View_Welder_WelderQualify AnalysisQualificationItem(string qualificationItem)
|
||||
{
|
||||
using (var db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
Model.View_Welder_WelderQualify x = new Model.View_Welder_WelderQualify();
|
||||
string weldMethod = string.Empty;
|
||||
string materialType = string.Empty;
|
||||
string location = string.Empty;
|
||||
string weldType = string.Empty;
|
||||
bool isCanWeldG = true;
|
||||
string thicknessMin = string.Empty;
|
||||
string thicknessMax = string.Empty;
|
||||
string sizesMin = string.Empty;
|
||||
string sizesMax = string.Empty;
|
||||
string thicknessMin2 = string.Empty;
|
||||
string thicknessMax2 = string.Empty;
|
||||
string sizesMin2 = string.Empty;
|
||||
string sizesMax2 = string.Empty;
|
||||
string[] queProject = qualificationItem.Trim().Split('-');
|
||||
try
|
||||
{
|
||||
// 焊接方法和钢材类型
|
||||
weldMethod = queProject[0];
|
||||
if (queProject.Count() > 1)
|
||||
{
|
||||
if (queProject[1].Trim() == ("FeI") || queProject[1].Trim() == ("FeⅠ"))
|
||||
{
|
||||
materialType = "FeⅠ";
|
||||
}
|
||||
|
||||
else if (queProject[1].Trim() == ("FeII") || queProject[1].Trim() == ("FeⅡ"))
|
||||
{
|
||||
materialType = "FeⅡ,FeⅠ";
|
||||
|
||||
}
|
||||
else if (queProject[1].Trim() == ("FeIII") || queProject[1].Trim() == ("FeⅢ"))
|
||||
{
|
||||
materialType = "FeⅢ,FeⅡ,FeⅠ";
|
||||
|
||||
}
|
||||
else if (queProject[1].Trim() == ("FeIV") || queProject[1].Trim() == ("FeⅣ"))
|
||||
{
|
||||
materialType = "FeⅣ";
|
||||
}
|
||||
else
|
||||
{
|
||||
materialType = queProject[1].Trim();
|
||||
}
|
||||
}
|
||||
|
||||
if (queProject.Count() > 2)
|
||||
{
|
||||
// 焊接位置
|
||||
if (queProject[2].Contains("6G"))
|
||||
{
|
||||
location = "ALL";
|
||||
}
|
||||
else if (queProject[2].Contains("2G"))
|
||||
{
|
||||
location = "1G,2G";
|
||||
}
|
||||
else if (queProject[2].Contains("3G"))
|
||||
{
|
||||
location = "1G,2G,3G";
|
||||
}
|
||||
else if (queProject[2].Contains("4G"))
|
||||
{
|
||||
location = "1G,3G,4G";
|
||||
}
|
||||
else if (queProject[2].Contains("5G"))
|
||||
{
|
||||
location = "1G,2G,3G,5G";
|
||||
}
|
||||
|
||||
else if (queProject[2].Contains("6FG"))
|
||||
{
|
||||
location = "ALL";
|
||||
}
|
||||
else if (queProject[2].Contains("5FG"))
|
||||
{
|
||||
location = "2FG,5FG";
|
||||
}
|
||||
else if (queProject[2].Contains("4FG"))
|
||||
{
|
||||
location = "2FG,4FG";
|
||||
}
|
||||
else
|
||||
{
|
||||
location = queProject[2];
|
||||
}
|
||||
|
||||
if (queProject[2].Contains("1G") || queProject[2].Contains("1F") || queProject[2].Contains("2FR") || queProject[2].Contains("2FRG"))
|
||||
{
|
||||
isCanWeldG = false;
|
||||
}
|
||||
|
||||
// 1-对接,2-角焊缝,3-支管连接焊缝
|
||||
if (queProject[2].Contains("F"))
|
||||
{
|
||||
weldType = "角焊缝";
|
||||
}
|
||||
else
|
||||
{
|
||||
weldType = "对接焊缝,角焊缝";
|
||||
}
|
||||
}
|
||||
if (queProject.Count() > 3)
|
||||
{
|
||||
// 壁厚和外径
|
||||
string[] strs = queProject[3].Split('/');
|
||||
int thickness = Convert.ToInt32(strs[0]);
|
||||
int sizes = 0;
|
||||
if (strs.Count() == 2)
|
||||
{
|
||||
sizes = Convert.ToInt32(strs[1]);
|
||||
}
|
||||
|
||||
if (queProject[2].Contains("1G") || queProject[2].Contains("2G") || queProject[2].Contains("5G") || queProject[2].Contains("5GX") || queProject[2].Contains("6G") || queProject[2].Contains("6GX"))
|
||||
{
|
||||
//壁厚算法
|
||||
//对接焊缝算法 B类
|
||||
if (weldMethod != "OFW")
|
||||
{
|
||||
if (thickness < 12)
|
||||
{
|
||||
thicknessMin = "不限";
|
||||
thicknessMax = (thickness * 2).ToString();
|
||||
}
|
||||
else
|
||||
{
|
||||
thicknessMin = "不限";
|
||||
thicknessMax = "不限";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
thicknessMin = "不限";
|
||||
thicknessMax = thickness.ToString();
|
||||
}
|
||||
//角焊缝算法 非B类
|
||||
thicknessMin2 = "不限";
|
||||
thicknessMax2 = "不限";
|
||||
|
||||
//管径算法
|
||||
//对接焊缝算法 B类
|
||||
if (sizes < 25)
|
||||
{
|
||||
sizesMin = sizes.ToString();
|
||||
sizesMax = "不限";
|
||||
}
|
||||
else if (sizes >= 25 && sizes < 76)
|
||||
{
|
||||
sizesMin = "25";
|
||||
sizesMax = "不限";
|
||||
}
|
||||
else
|
||||
{
|
||||
sizesMin = "76";
|
||||
sizesMax = "不限";
|
||||
}
|
||||
//角焊缝算法 非B类
|
||||
sizesMin2 = "不限";
|
||||
sizesMax2 = "不限";
|
||||
|
||||
}
|
||||
if (queProject[2].Contains("1F") || queProject[2].Contains("2F") || queProject[2].Contains("2FR") || queProject[2].Contains("4F") || queProject[2].Contains("5F")
|
||||
|| queProject[2].Contains("2FRG") || queProject[2].Contains("2FG") || queProject[2].Contains("4FG") || queProject[2].Contains("5FG") || queProject[2].Contains("6FG"))
|
||||
{
|
||||
//壁厚算法
|
||||
//对接焊缝算法 B类
|
||||
thicknessMin = "0";
|
||||
thicknessMax = "0";
|
||||
//角焊缝算法 非B类
|
||||
if (strs.Length == 2) //外径为:非none(管材),即外径和壁厚间有/
|
||||
{
|
||||
thicknessMin2 = "不限";
|
||||
thicknessMax2 = "不限";
|
||||
}
|
||||
else //外径为:none(管材),即外径和壁厚间没有/
|
||||
{
|
||||
if (thickness < 5)
|
||||
{
|
||||
thicknessMin2 = thickness.ToString();
|
||||
thicknessMax2 = (thickness * 2).ToString();
|
||||
}
|
||||
else if (thickness >= 5 && thickness < 10)
|
||||
{
|
||||
thicknessMin2 = "不限";
|
||||
thicknessMax2 = "不限";
|
||||
}
|
||||
}
|
||||
//管径算法
|
||||
//对接焊缝算法 B类
|
||||
sizesMin = "0";
|
||||
sizesMax = "0";
|
||||
//角焊缝算法 非B类
|
||||
if (strs.Length == 2) //外径为:非none(管材),即外径和壁厚间有/
|
||||
{
|
||||
if (sizes < 25)
|
||||
{
|
||||
sizesMin2 = sizes.ToString();
|
||||
sizesMax2 = "不限";
|
||||
}
|
||||
else if (sizes >= 25 && sizes < 76)
|
||||
{
|
||||
sizesMin2 = "25";
|
||||
sizesMax2 = "不限";
|
||||
}
|
||||
else
|
||||
{
|
||||
sizesMin2 = "76";
|
||||
sizesMax2 = "不限";
|
||||
}
|
||||
}
|
||||
else //外径为:none(管材),即外径和壁厚间没有/
|
||||
{
|
||||
sizesMin2 = "76";
|
||||
sizesMax2 = "不限";
|
||||
}
|
||||
}
|
||||
//string[] thickSize = queProject[3].Split('/');
|
||||
//if (weldMethod != "OFW")
|
||||
//{
|
||||
// if (thickSize.Count() == 2)
|
||||
// {
|
||||
// int thick = Convert.ToInt32(thickSize[0]);
|
||||
// if (thick < 12)
|
||||
// {
|
||||
// //thicknessMax = "≤" + thick * 2;
|
||||
// thicknessMax = thick * 2;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// thicknessMax = 0;
|
||||
// }
|
||||
|
||||
// int size = Convert.ToInt32(thickSize[1]);
|
||||
// if (size < 25)
|
||||
// {
|
||||
// //sizesMin = "≥" + size;
|
||||
// sizesMin = size;
|
||||
// }
|
||||
// else if (size >= 25 && size < 76)
|
||||
// {
|
||||
// //sizesMin = "≥25";
|
||||
// sizesMin = 25;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// //sizesMin = "≥76";
|
||||
// sizesMin = 76;
|
||||
// }
|
||||
// }
|
||||
// else if (thickSize.Count() == 1)
|
||||
// {
|
||||
// thicknessMax = 0;
|
||||
// //sizesMin = "≥76";
|
||||
// sizesMin = 76;
|
||||
// }
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// int thick = Convert.ToInt32(thickSize[0]);
|
||||
// thicknessMax = thick;
|
||||
// sizesMin = 0;
|
||||
//}
|
||||
}
|
||||
x.QualificationItem = qualificationItem;
|
||||
x.WeldingMethod = weldMethod;
|
||||
x.MaterialType = materialType;
|
||||
x.WeldingLocation = location;
|
||||
x.Thickness = thicknessMin + "$" + thicknessMax;
|
||||
x.Sizes = sizesMin + "$" + sizesMax;
|
||||
x.Thickness2 = thicknessMin2 + "$" + thicknessMax2;
|
||||
x.Sizes2 = sizesMin2 + "$" + sizesMax2;
|
||||
x.WeldType = weldType;
|
||||
x.IsCanWeldG = isCanWeldG;
|
||||
return x;
|
||||
}
|
||||
catch
|
||||
{
|
||||
x.QualificationItem = "请录入规范数据!";
|
||||
return x;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 保存焊工合格项目
|
||||
public static void AddWelderQualifyForApi(Model.View_Welder_WelderQualify WelderQualify)
|
||||
{
|
||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
Model.Welder_WelderQualify newWelderQualify = new Model.Welder_WelderQualify();
|
||||
newWelderQualify.WelderQualifyId = SQLHelper.GetNewID(typeof(Model.Welder_WelderQualify));
|
||||
newWelderQualify.WelderId = WelderQualify.WelderId;
|
||||
newWelderQualify.QualificationItem = WelderQualify.QualificationItem;
|
||||
newWelderQualify.CheckDate = Funs.GetNewDateTime(WelderQualify.CheckDate.ToString());
|
||||
newWelderQualify.LimitDate = Funs.GetNewDateTime(WelderQualify.LimitDate.ToString());
|
||||
newWelderQualify.WeldingMethod = WelderQualify.WeldingMethod;
|
||||
newWelderQualify.MaterialType = WelderQualify.MaterialType;
|
||||
newWelderQualify.WeldingLocation = WelderQualify.WeldingLocation;
|
||||
if (!string.IsNullOrEmpty(WelderQualify.Thickness))
|
||||
{
|
||||
string[] strs = WelderQualify.Thickness.Split('$');
|
||||
if (strs.Length == 2)
|
||||
{
|
||||
newWelderQualify.ThicknessMin = GetDecimalByStr(strs[0]);
|
||||
newWelderQualify.ThicknessMax = GetDecimalByStr(strs[1]);
|
||||
}
|
||||
}
|
||||
if (!string.IsNullOrEmpty(WelderQualify.Sizes))
|
||||
{
|
||||
string[] strs = WelderQualify.Sizes.Split('$');
|
||||
if (strs.Length == 2)
|
||||
{
|
||||
newWelderQualify.SizesMin = GetDecimalByStr(strs[0]);
|
||||
newWelderQualify.SizesMax = GetDecimalByStr(strs[1]);
|
||||
}
|
||||
}
|
||||
if (!string.IsNullOrEmpty(WelderQualify.Thickness2))
|
||||
{
|
||||
string[] strs = WelderQualify.Thickness2.Split('$');
|
||||
if (strs.Length == 2)
|
||||
{
|
||||
newWelderQualify.ThicknessMin2 = GetDecimalByStr(strs[0]);
|
||||
newWelderQualify.ThicknessMax2 = GetDecimalByStr(strs[1]);
|
||||
}
|
||||
}
|
||||
if (!string.IsNullOrEmpty(WelderQualify.Sizes2))
|
||||
{
|
||||
string[] strs = WelderQualify.Sizes.Split('$');
|
||||
if (strs.Length == 2)
|
||||
{
|
||||
newWelderQualify.SizesMin2 = GetDecimalByStr(strs[0]);
|
||||
newWelderQualify.SizesMax2 = GetDecimalByStr(strs[1]);
|
||||
}
|
||||
}
|
||||
newWelderQualify.WeldType = WelderQualify.WeldType;
|
||||
newWelderQualify.IsCanWeldG = WelderQualify.IsCanWeldG;
|
||||
newWelderQualify.IsAudit = null;
|
||||
newWelderQualify.AuditMan = null;
|
||||
newWelderQualify.AuditDate = null;
|
||||
newWelderQualify.WelderMode = WelderQualify.WelderMode;
|
||||
db.Welder_WelderQualify.InsertOnSubmit(newWelderQualify);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
public static void UpdateWelderQualifyForApi(Model.View_Welder_WelderQualify WelderQualify)
|
||||
{
|
||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
Model.Welder_WelderQualify newWelderQualify = db.Welder_WelderQualify.FirstOrDefault(e => e.WelderQualifyId == WelderQualify.WelderQualifyId);
|
||||
if (newWelderQualify != null)
|
||||
{
|
||||
newWelderQualify.WelderId = WelderQualify.WelderId;
|
||||
newWelderQualify.QualificationItem = WelderQualify.QualificationItem;
|
||||
newWelderQualify.CheckDate = Funs.GetNewDateTime(WelderQualify.CheckDate.ToString());
|
||||
newWelderQualify.LimitDate = Funs.GetNewDateTime(WelderQualify.LimitDate.ToString());
|
||||
newWelderQualify.WeldingMethod = WelderQualify.WeldingMethod;
|
||||
newWelderQualify.MaterialType = WelderQualify.MaterialType;
|
||||
newWelderQualify.WeldingLocation = WelderQualify.WeldingLocation;
|
||||
if (!string.IsNullOrEmpty(WelderQualify.Thickness))
|
||||
{
|
||||
string[] strs = WelderQualify.Thickness.Split('$');
|
||||
if (strs.Length == 2)
|
||||
{
|
||||
newWelderQualify.ThicknessMin = GetDecimalByStr(strs[0]);
|
||||
newWelderQualify.ThicknessMax = GetDecimalByStr(strs[1]);
|
||||
}
|
||||
}
|
||||
if (!string.IsNullOrEmpty(WelderQualify.Sizes))
|
||||
{
|
||||
string[] strs = WelderQualify.Sizes.Split('$');
|
||||
if (strs.Length == 2)
|
||||
{
|
||||
newWelderQualify.SizesMin = GetDecimalByStr(strs[0]);
|
||||
newWelderQualify.SizesMax = GetDecimalByStr(strs[1]);
|
||||
}
|
||||
}
|
||||
if (!string.IsNullOrEmpty(WelderQualify.Thickness2))
|
||||
{
|
||||
string[] strs = WelderQualify.Thickness2.Split('$');
|
||||
if (strs.Length == 2)
|
||||
{
|
||||
newWelderQualify.ThicknessMin2 = GetDecimalByStr(strs[0]);
|
||||
newWelderQualify.ThicknessMax2 = GetDecimalByStr(strs[1]);
|
||||
}
|
||||
}
|
||||
if (!string.IsNullOrEmpty(WelderQualify.Sizes2))
|
||||
{
|
||||
string[] strs = WelderQualify.Sizes.Split('$');
|
||||
if (strs.Length == 2)
|
||||
{
|
||||
newWelderQualify.SizesMin2 = GetDecimalByStr(strs[0]);
|
||||
newWelderQualify.SizesMax2 = GetDecimalByStr(strs[1]);
|
||||
}
|
||||
}
|
||||
newWelderQualify.WeldType = WelderQualify.WeldType;
|
||||
newWelderQualify.IsCanWeldG = WelderQualify.IsCanWeldG;
|
||||
newWelderQualify.IsAudit = null;
|
||||
newWelderQualify.AuditMan = null;
|
||||
newWelderQualify.AuditDate = null;
|
||||
newWelderQualify.WelderMode = WelderQualify.WelderMode;
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static decimal? GetDecimalByStr(string str)
|
||||
{
|
||||
if (str == "0")
|
||||
{
|
||||
return null;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (str == "不限")
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
return Convert.ToDecimal(str);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 审核焊工合格项目
|
||||
public static string AuditWelderQualify(string welderQualifyId,string personId)
|
||||
{
|
||||
string str = string.Empty;
|
||||
using (var db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
Model.Welder_WelderQualify x = db.Welder_WelderQualify.FirstOrDefault(e => e.WelderQualifyId == welderQualifyId);
|
||||
if (x != null)
|
||||
{
|
||||
x.IsAudit = true;
|
||||
x.AuditMan = personId;
|
||||
x.AuditDate = DateTime.Now;
|
||||
db.SubmitChanges();
|
||||
str = "审核成功";
|
||||
}
|
||||
}
|
||||
return str;
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1142,5 +1142,23 @@ namespace BLL
|
|||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 审核焊工
|
||||
public static string AuditWelder(string projectId, string personId)
|
||||
{
|
||||
string str = string.Empty;
|
||||
using (var db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
Model.SitePerson_Person x = db.SitePerson_Person.FirstOrDefault(e => e.ProjectId == projectId && e.PersonId == personId);
|
||||
if (x != null)
|
||||
{
|
||||
x.IsWeldAudit = true;
|
||||
db.SubmitChanges();
|
||||
str = "审核成功";
|
||||
}
|
||||
}
|
||||
return str;
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
|
@ -228619,6 +228619,8 @@ namespace Model
|
|||
|
||||
private string _WeldType;
|
||||
|
||||
private string _WelderMode;
|
||||
|
||||
private System.Nullable<bool> _IsCanWeldG;
|
||||
|
||||
public View_Welder_WelderQualify()
|
||||
|
|
@ -229073,6 +229075,22 @@ namespace Model
|
|||
}
|
||||
}
|
||||
|
||||
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_WelderMode", DbType="NVarChar(10)")]
|
||||
public string WelderMode
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._WelderMode;
|
||||
}
|
||||
set
|
||||
{
|
||||
if ((this._WelderMode != value))
|
||||
{
|
||||
this._WelderMode = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_IsCanWeldG", DbType="Bit")]
|
||||
public System.Nullable<bool> IsCanWeldG
|
||||
{
|
||||
|
|
|
|||
|
|
@ -79,6 +79,28 @@ namespace Mvc.Controllers
|
|||
APIUpLoadFileService.SaveAttachUrl(toDoItem);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 审核焊工
|
||||
/// </summary>
|
||||
/// <param name="projectId"></param>
|
||||
/// <param name="personId"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet]
|
||||
public ResponseData<string> AuditWelder(string projectId, string personId)
|
||||
{
|
||||
ResponseData<string> res = new ResponseData<string>();
|
||||
res.resultValue = BLL.SitePerson_PersonService.AuditWelder(projectId, personId);
|
||||
if (!string.IsNullOrEmpty(res.resultValue))
|
||||
{
|
||||
res.successful = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
res.successful = false;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 焊工合格项目列表
|
||||
/// </summary>
|
||||
|
|
@ -96,5 +118,89 @@ namespace Mvc.Controllers
|
|||
res.resultValue = BLL.WelderQualifyService.GetWelderQualifyListDataForApi(personId, index, page);
|
||||
return res;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据WelderQualifyId获取焊工合格项目详情
|
||||
/// </summary>
|
||||
/// <param name="welderQualifyId"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet]
|
||||
public ResponseData<View_Welder_WelderQualify> GetWelderQualify(string welderQualifyId)
|
||||
{
|
||||
ResponseData<View_Welder_WelderQualify> res = new ResponseData<View_Welder_WelderQualify>();
|
||||
View_Welder_WelderQualify welderQualify = BLL.WelderQualifyService.GetWelderQualify(welderQualifyId);
|
||||
res.successful = true;
|
||||
res.resultValue = BeanUtil.CopyOjbect<View_Welder_WelderQualify>(welderQualify, true);
|
||||
return res;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据焊工合格项目分析对应业务取值
|
||||
/// </summary>
|
||||
/// <param name="qualificationItem"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet]
|
||||
public ResponseData<View_Welder_WelderQualify> AnalysisQualificationItem(string qualificationItem)
|
||||
{
|
||||
ResponseData<View_Welder_WelderQualify> res = new ResponseData<View_Welder_WelderQualify>();
|
||||
View_Welder_WelderQualify welderQualify = BLL.WelderQualifyService.AnalysisQualificationItem(qualificationItem);
|
||||
res.successful = true;
|
||||
res.resultValue = BeanUtil.CopyOjbect<View_Welder_WelderQualify>(welderQualify, true);
|
||||
return res;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 保存焊工合格项目
|
||||
/// </summary>
|
||||
/// <param name="welderQualify"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public ResponseData<string> SaveWelderQualify([FromBody] Model.View_Welder_WelderQualify welderQualify)
|
||||
{
|
||||
ResponseData<string> res = new ResponseData<string>();
|
||||
try
|
||||
{
|
||||
if (string.IsNullOrEmpty(welderQualify.WelderQualifyId))
|
||||
{
|
||||
BLL.WelderQualifyService.AddWelderQualifyForApi(welderQualify);
|
||||
}
|
||||
else
|
||||
{
|
||||
BLL.WelderQualifyService.UpdateWelderQualifyForApi(welderQualify);
|
||||
}
|
||||
res.resultValue = welderQualify.WelderQualifyId;
|
||||
|
||||
res.successful = true;
|
||||
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
res.resultHint = e.StackTrace;
|
||||
res.successful = false;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 审核焊工合格项目
|
||||
/// </summary>
|
||||
/// <param name="welderQualifyId"></param>
|
||||
/// <param name="personId"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet]
|
||||
public ResponseData<string> AuditWelderQualify(string welderQualifyId, string personId)
|
||||
{
|
||||
ResponseData<string> res = new ResponseData<string>();
|
||||
res.resultValue = BLL.WelderQualifyService.AuditWelderQualify(welderQualifyId, personId);
|
||||
if (!string.IsNullOrEmpty(res.resultValue))
|
||||
{
|
||||
res.successful = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
res.successful = false;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue