质量巡检数据同步
This commit is contained in:
parent
90f344f71c
commit
8fe3da3c9e
|
|
@ -315,6 +315,7 @@
|
||||||
<Compile Include="CQMS\WBS\WorkPackageProjectService.cs" />
|
<Compile Include="CQMS\WBS\WorkPackageProjectService.cs" />
|
||||||
<Compile Include="CQMS\WBS\WorkPackageService.cs" />
|
<Compile Include="CQMS\WBS\WorkPackageService.cs" />
|
||||||
<Compile Include="DataShare\APIDataShareSyncService.cs" />
|
<Compile Include="DataShare\APIDataShareSyncService.cs" />
|
||||||
|
<Compile Include="DataShare\CQMS\APICheckControlSyncService.cs" />
|
||||||
<Compile Include="DataShare\HSSE\APICheckSpecialSyncService.cs" />
|
<Compile Include="DataShare\HSSE\APICheckSpecialSyncService.cs" />
|
||||||
<Compile Include="DataShare\HSSE\APIHazardRegisterSyncService.cs" />
|
<Compile Include="DataShare\HSSE\APIHazardRegisterSyncService.cs" />
|
||||||
<Compile Include="DataShare\HSSE\APILicenseSyncService.cs" />
|
<Compile Include="DataShare\HSSE\APILicenseSyncService.cs" />
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,538 @@
|
||||||
|
using Newtonsoft.Json.Linq;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Configuration;
|
||||||
|
using System.IO;
|
||||||
|
using System.Net.Http;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using Model;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using RestSharp;
|
||||||
|
using System.Net;
|
||||||
|
|
||||||
|
|
||||||
|
namespace BLL
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 质量巡检同步服务
|
||||||
|
/// </summary>
|
||||||
|
public class APICheckControlSyncService
|
||||||
|
{
|
||||||
|
#region 根据项目、单位获取质量巡检列表
|
||||||
|
/// <summary>
|
||||||
|
/// 根据项目、单位获取质量巡检列表
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="projectId">项目ID</param>
|
||||||
|
/// <param name="unitId">单位ID</param>
|
||||||
|
/// <param name="dataId">数据ID(可选,用于单条数据同步)</param>
|
||||||
|
/// <returns>质量巡检数据列表</returns>
|
||||||
|
public static List<Model.CheckControlSyncItem> GetCheckControlListsByProjectIdUnitIdPage(
|
||||||
|
string projectId, string unitId, string dataId = "")
|
||||||
|
{
|
||||||
|
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||||
|
{
|
||||||
|
var list = from x in db.Check_CheckControl
|
||||||
|
where x.ProjectId == projectId
|
||||||
|
select x;
|
||||||
|
|
||||||
|
if (!string.IsNullOrEmpty(unitId))
|
||||||
|
{
|
||||||
|
list = list.Where(x => x.UnitId == unitId);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!string.IsNullOrEmpty(dataId))
|
||||||
|
{
|
||||||
|
list = list.Where(x => x.CheckControlCode == dataId);
|
||||||
|
}
|
||||||
|
|
||||||
|
var dataList = (from x in list
|
||||||
|
join unit in db.Base_Unit on x.UnitId equals unit.UnitId into unitTemp
|
||||||
|
from unit in unitTemp.DefaultIfEmpty()
|
||||||
|
join pro in db.Base_CNProfessional on x.CNProfessionalCode equals pro.CNProfessionalId into proTemp
|
||||||
|
from pro in proTemp.DefaultIfEmpty()
|
||||||
|
join uw in db.WBS_UnitWork on x.UnitWorkId equals uw.UnitWorkId into uwTemp
|
||||||
|
from uw in uwTemp.DefaultIfEmpty()
|
||||||
|
join qqt in db.Base_QualityQuestionType on x.QuestionType equals qqt.QualityQuestionTypeId into qqtTemp
|
||||||
|
from qqt in qqtTemp.DefaultIfEmpty()
|
||||||
|
join u1 in db.Sys_User on x.CheckMan equals u1.UserId into u1Temp
|
||||||
|
from u1 in u1Temp.DefaultIfEmpty()
|
||||||
|
join u2 in db.Sys_User on x.SubmitMan equals u2.UserId into u2Temp
|
||||||
|
from u2 in u2Temp.DefaultIfEmpty()
|
||||||
|
join pu in db.Base_Unit on x.ProposeUnitId equals pu.UnitId into puTemp
|
||||||
|
from pu in puTemp.DefaultIfEmpty()
|
||||||
|
join att in db.AttachFile on x.CheckControlCode equals att.ToKeyId into attTemp
|
||||||
|
from att in attTemp.DefaultIfEmpty()
|
||||||
|
join attRe in db.AttachFile on x.CheckControlCode + "r" equals attRe.ToKeyId into attReTemp
|
||||||
|
from attRe in attReTemp.DefaultIfEmpty()
|
||||||
|
select new CheckControlSyncItem
|
||||||
|
{
|
||||||
|
CheckControlCode = x.CheckControlCode,
|
||||||
|
ProjectId = x.ProjectId,
|
||||||
|
UnitWorkId = x.UnitWorkId,
|
||||||
|
UnitWorkName = uw.UnitWorkName,
|
||||||
|
UnitId = x.UnitId,
|
||||||
|
UnitName = unit.UnitName,
|
||||||
|
CheckDate = x.CheckDate,
|
||||||
|
CheckMan = x.CheckMan,
|
||||||
|
CheckManName = u1.UserName,
|
||||||
|
CheckSite = x.CheckSite,
|
||||||
|
DocCode = x.DocCode,
|
||||||
|
CNProfessionalCode = x.CNProfessionalCode,
|
||||||
|
CNProfessionalName = pro.ProfessionalName,
|
||||||
|
QuestionType = x.QuestionType,
|
||||||
|
QuestionTypeName = qqt.QualityQuestionType,
|
||||||
|
QuestionDef = x.QuestionDef,
|
||||||
|
RectifyOpinion = x.RectifyOpinion,
|
||||||
|
LimitDate = x.LimitDate,
|
||||||
|
AttachUrl = att.AttachUrl,
|
||||||
|
HandleWay = x.HandleWay,
|
||||||
|
RectifyDate = x.RectifyDate,
|
||||||
|
ReAttachUrl = attRe.AttachUrl,
|
||||||
|
State = x.State,
|
||||||
|
IsSubmit = x.IsSubmit,
|
||||||
|
SubmitMan = x.SubmitMan,
|
||||||
|
SubmitManName = u2.UserName,
|
||||||
|
IsOK = x.IsOK,
|
||||||
|
ProposeUnitId = x.ProposeUnitId,
|
||||||
|
ProposeUnitName = pu.UnitName,
|
||||||
|
SaveHandleMan = x.SaveHandleMan,
|
||||||
|
DataSource = "1"
|
||||||
|
}).ToList();
|
||||||
|
|
||||||
|
return dataList;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
#region 拉取质量巡检数据
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 拉取质量巡检数据
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>处理结果消息</returns>
|
||||||
|
public static string getCheckControlLists(string projectId = "")
|
||||||
|
{
|
||||||
|
int code = 0;
|
||||||
|
string message = "";
|
||||||
|
try
|
||||||
|
{
|
||||||
|
string CollCropCode = string.Empty;
|
||||||
|
string unitId = string.Empty;
|
||||||
|
var thisUnit = CommonService.GetIsThisUnit(); //当前单位
|
||||||
|
if (thisUnit != null)
|
||||||
|
{
|
||||||
|
CollCropCode = thisUnit.CollCropCode; //社会统一信用代码
|
||||||
|
unitId = thisUnit.UnitId;
|
||||||
|
}
|
||||||
|
|
||||||
|
var ProjectList = (from x in Funs.DB.Base_Project
|
||||||
|
where (x.IsDelete == null || x.IsDelete == false) &&
|
||||||
|
x.SubjectUnit != null && x.SubjectProject != null
|
||||||
|
select x).ToList();
|
||||||
|
if (!string.IsNullOrEmpty(projectId))
|
||||||
|
{
|
||||||
|
ProjectList = ProjectList.Where(x => x.ProjectId == projectId).ToList();
|
||||||
|
}
|
||||||
|
if (ProjectList.Count > 0)
|
||||||
|
{
|
||||||
|
foreach (var project in ProjectList)
|
||||||
|
{
|
||||||
|
string SubjectUnitId = project.SubjectUnit; //集团的单位id
|
||||||
|
string SubjectProjectId = project.SubjectProject; //集团的项目id
|
||||||
|
|
||||||
|
//获取对应单位的apiurl地址
|
||||||
|
var Url = BLL.UnitService.getUnitApiUrlByUnitId(SubjectUnitId);
|
||||||
|
var ApiUrl = "";
|
||||||
|
var WebUrl = "";
|
||||||
|
if (!string.IsNullOrEmpty(Url))
|
||||||
|
{
|
||||||
|
var urls = Url.Split(',');
|
||||||
|
ApiUrl = urls[0];
|
||||||
|
if (urls.Length > 1)
|
||||||
|
{
|
||||||
|
WebUrl = urls[1];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
string url = "/api/CheckControlSync/getCheckControlListByProjectIdAndCollCropCode?projectId=" +
|
||||||
|
SubjectProjectId + "&collCropCode=" + CollCropCode;
|
||||||
|
string baseurl = ApiUrl + url;
|
||||||
|
string contenttype = "application/json;charset=unicode";
|
||||||
|
var strJosn = APIGetHttpService.Http(baseurl, "GET", contenttype, null, null);
|
||||||
|
|
||||||
|
if (!string.IsNullOrEmpty(strJosn))
|
||||||
|
{
|
||||||
|
JObject obj = JObject.Parse(strJosn);
|
||||||
|
code = Funs.GetNewIntOrZero(obj["code"].ToString());
|
||||||
|
message = obj["message"].ToString();
|
||||||
|
|
||||||
|
if (code == 1)
|
||||||
|
{
|
||||||
|
var getData = JsonConvert.DeserializeObject<List<CheckControlSyncItem>>(obj["data"].ToString());
|
||||||
|
if (getData.Count() > 0)
|
||||||
|
{
|
||||||
|
ProcessCheckControlData(getData, project.ProjectId, unitId, WebUrl, "pull");
|
||||||
|
}
|
||||||
|
message = "获取成功:同步质量巡检数" + getData.Count().ToString() + "条";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
message = "获取失败:" + ex.Message;
|
||||||
|
ErrLogInfo.WriteLog("质量巡检获取!", ex);
|
||||||
|
}
|
||||||
|
|
||||||
|
return message;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
#region 推送质量巡检数据
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 推送质量巡检数据
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="projectId">项目ID</param>
|
||||||
|
/// <param name="dataId">数据ID(可选,用于单条数据推送)</param>
|
||||||
|
/// <returns>推送结果</returns>
|
||||||
|
public static ReturnData pushCheckControlLists(string projectId, string dataId = "")
|
||||||
|
{
|
||||||
|
Model.ReturnData responeData = new Model.ReturnData();
|
||||||
|
responeData.code = 0;
|
||||||
|
responeData.message = string.Empty;
|
||||||
|
var project = Funs.DB.Base_Project.FirstOrDefault(x => x.ProjectId == projectId);
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (project != null)
|
||||||
|
{
|
||||||
|
//获取质量巡检数据
|
||||||
|
var items = GetCheckControlListsByProjectIdUnitIdPage(projectId, "", dataId);
|
||||||
|
|
||||||
|
if (items.Count() > 0)
|
||||||
|
{
|
||||||
|
var thisUnit = CommonService.GetIsThisUnit(); //当前单位
|
||||||
|
var apiurl = "/api/CheckControlSync/SaveCheckControlSyncData";
|
||||||
|
|
||||||
|
//总包单位接口地址
|
||||||
|
var Url = BLL.UnitService.getUnitApiUrlByUnitId(project.SubjectUnit);
|
||||||
|
var ApiUrl = "";
|
||||||
|
var WebUrl = "";
|
||||||
|
|
||||||
|
if (!string.IsNullOrEmpty(Url))
|
||||||
|
{
|
||||||
|
var urls = Url.Split(',');
|
||||||
|
ApiUrl = urls[0];
|
||||||
|
if (urls.Length > 1)
|
||||||
|
{
|
||||||
|
WebUrl = urls[1];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var pushData = new CheckControlSyncData
|
||||||
|
{
|
||||||
|
CollCropCode = thisUnit.CollCropCode, //分包单位社会统一信用码
|
||||||
|
ProjectId = project.SubjectProject, //主包项目Id
|
||||||
|
UnitDomain = Funs.SGGLUrl, //分包单位域名地址【文件存储地址】
|
||||||
|
Items = items //质量巡检数据
|
||||||
|
};
|
||||||
|
|
||||||
|
var pushContent = JsonConvert.SerializeObject(pushData);
|
||||||
|
string baseurl = ApiUrl + apiurl;
|
||||||
|
string contenttype = "application/json;charset=unicode";
|
||||||
|
var returndata = APIGetHttpService.Http(baseurl, "Post", contenttype, null, pushContent);
|
||||||
|
|
||||||
|
if (!string.IsNullOrEmpty(returndata))
|
||||||
|
{
|
||||||
|
JObject obj = JObject.Parse(returndata);
|
||||||
|
string code = obj["code"].ToString();
|
||||||
|
string message = obj["message"].ToString();
|
||||||
|
responeData.code = int.Parse(code);
|
||||||
|
responeData.message = message;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
responeData.code = 0;
|
||||||
|
responeData.message = "当前没有质量巡检数据";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
responeData.message = "同步到总包单位失败!";
|
||||||
|
ErrLogInfo.WriteLog("【质量巡检】同步到总包单位失败!", ex);
|
||||||
|
}
|
||||||
|
|
||||||
|
return responeData;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
#region 接收保存质量巡检数据
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 接收保存质量巡检数据
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="items">质量巡检同步数据</param>
|
||||||
|
/// <returns>处理结果消息</returns>
|
||||||
|
public static string SaveCheckControlSyncData(Model.CheckControlSyncData items)
|
||||||
|
{
|
||||||
|
int code = 0;
|
||||||
|
string message = "";
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (items.Items.Count > 0 || items.Items.Count > 0)
|
||||||
|
{
|
||||||
|
var CollCropCode = items.CollCropCode; //分包单位社会统一信用码
|
||||||
|
var ProjectId = items.ProjectId; //总包项目Id
|
||||||
|
var UnitDomain = items.UnitDomain; //分包单位域名地址【文件存储地址】
|
||||||
|
|
||||||
|
var unit = Funs.DB.Base_Unit.FirstOrDefault(x => x.CollCropCode == CollCropCode); //根据CollCropCode获取单位id
|
||||||
|
if (unit == null)
|
||||||
|
{
|
||||||
|
message = "总包单位不存在本单位,请登录总包系统检查维护本单位信息!";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
//判断主包项目是否存在
|
||||||
|
var porject = BLL.ProjectService.GetProjectByProjectId(ProjectId);
|
||||||
|
if (porject == null)
|
||||||
|
{
|
||||||
|
message = "总包单位不存在本项目,请检查总包项目关联是否正确!";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ProcessCheckControlData(items.Items, ProjectId, unit.UnitId, UnitDomain, "push");
|
||||||
|
message = "数据推送成功!";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
message = "暂无质量巡检数据!";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
throw ex;
|
||||||
|
}
|
||||||
|
|
||||||
|
return message;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
#region 处理质量巡检数据的新增或更新逻辑
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 处理质量巡检数据的新增或更新逻辑
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="getData">质量巡检数据列表</param>
|
||||||
|
/// <param name="projectId">项目id</param>
|
||||||
|
/// <param name="unitId">单位ID</param>
|
||||||
|
/// <param name="WebUrl">Web地址</param>
|
||||||
|
///
|
||||||
|
private static void ProcessCheckControlData(
|
||||||
|
List<Model.CheckControlSyncItem> getData,
|
||||||
|
string projectId,
|
||||||
|
string unitId,
|
||||||
|
string WebUrl, string type)
|
||||||
|
{
|
||||||
|
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||||
|
{
|
||||||
|
foreach (var item in getData)
|
||||||
|
{
|
||||||
|
Model.Check_CheckControl model = db.Check_CheckControl.FirstOrDefault(x => x.CheckControlCode == item.CheckControlCode);
|
||||||
|
|
||||||
|
if (model == null)
|
||||||
|
{
|
||||||
|
//新增
|
||||||
|
Model.Check_CheckControl newModel = new Model.Check_CheckControl
|
||||||
|
{
|
||||||
|
CheckControlCode = item.CheckControlCode,
|
||||||
|
ProjectId = projectId,
|
||||||
|
UnitWorkId = APIDataShareSyncService.getUnitWorkId(item.UnitWorkName, projectId),
|
||||||
|
UnitId = getUnitIdByUnitName(item.UnitName) ?? unitId,
|
||||||
|
CheckDate = item.CheckDate,
|
||||||
|
CheckMan = APIDataShareSyncService.getUserId(item.CheckManName),
|
||||||
|
CheckSite = item.CheckSite,
|
||||||
|
DocCode = item.DocCode,
|
||||||
|
CNProfessionalCode = getCNProfessionalId(item.CNProfessionalName),
|
||||||
|
QuestionType = getQualityQuestionTypeId(item.QuestionTypeName, projectId),
|
||||||
|
QuestionDef = item.QuestionDef,
|
||||||
|
RectifyOpinion = item.RectifyOpinion,
|
||||||
|
LimitDate = item.LimitDate,
|
||||||
|
AttachUrl = item.AttachUrl,
|
||||||
|
HandleWay = item.HandleWay,
|
||||||
|
RectifyDate = item.RectifyDate,
|
||||||
|
ReAttachUrl = item.ReAttachUrl,
|
||||||
|
State = item.State,
|
||||||
|
IsSubmit = item.IsSubmit,
|
||||||
|
SubmitMan = APIDataShareSyncService.getUserId(item.SubmitManName),
|
||||||
|
IsOK = item.IsOK,
|
||||||
|
ProposeUnitId = getUnitIdByUnitName(item.ProposeUnitName),
|
||||||
|
SaveHandleMan = item.SaveHandleMan
|
||||||
|
};
|
||||||
|
if (type == "pull")
|
||||||
|
{
|
||||||
|
newModel.DataSource = item.DataSource;
|
||||||
|
}
|
||||||
|
db.Check_CheckControl.InsertOnSubmit(newModel);
|
||||||
|
db.SubmitChanges();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
//更新
|
||||||
|
model.ProjectId = projectId;
|
||||||
|
model.UnitWorkId = APIDataShareSyncService.getUnitWorkId(item.UnitWorkName, projectId);
|
||||||
|
model.UnitId = getUnitIdByUnitName(item.UnitName) ?? unitId;
|
||||||
|
model.CheckDate = item.CheckDate;
|
||||||
|
model.CheckMan = APIDataShareSyncService.getUserId(item.CheckManName);
|
||||||
|
model.CheckSite = item.CheckSite;
|
||||||
|
model.DocCode = item.DocCode;
|
||||||
|
model.CNProfessionalCode = getCNProfessionalId(item.CNProfessionalName);
|
||||||
|
model.QuestionType = getQualityQuestionTypeId(item.QuestionTypeName, projectId);
|
||||||
|
model.QuestionDef = item.QuestionDef;
|
||||||
|
model.RectifyOpinion = item.RectifyOpinion;
|
||||||
|
model.LimitDate = item.LimitDate;
|
||||||
|
model.AttachUrl = item.AttachUrl;
|
||||||
|
model.HandleWay = item.HandleWay;
|
||||||
|
model.RectifyDate = item.RectifyDate;
|
||||||
|
model.ReAttachUrl = item.ReAttachUrl;
|
||||||
|
model.State = item.State;
|
||||||
|
model.IsSubmit = item.IsSubmit;
|
||||||
|
model.SubmitMan = APIDataShareSyncService.getUserId(item.SubmitManName);
|
||||||
|
model.IsOK = item.IsOK;
|
||||||
|
model.ProposeUnitId = getUnitIdByUnitName(item.ProposeUnitName);
|
||||||
|
model.SaveHandleMan = item.SaveHandleMan;
|
||||||
|
if (type == "pull")
|
||||||
|
{
|
||||||
|
model.DataSource = item.DataSource;
|
||||||
|
}
|
||||||
|
db.SubmitChanges();
|
||||||
|
}
|
||||||
|
|
||||||
|
//处理整改前附件
|
||||||
|
if (!string.IsNullOrEmpty(item.AttachUrl))
|
||||||
|
{
|
||||||
|
APIDataShareSyncService.OperationAttachFile(WebUrl, item.CheckControlCode,
|
||||||
|
BLL.Const.CheckListMenuId, item.AttachUrl);
|
||||||
|
}
|
||||||
|
|
||||||
|
//处理整改后附件
|
||||||
|
if (!string.IsNullOrEmpty(item.ReAttachUrl))
|
||||||
|
{
|
||||||
|
APIDataShareSyncService.OperationAttachFile(WebUrl, item.CheckControlCode + "R",
|
||||||
|
BLL.Const.CheckListMenuId, item.ReAttachUrl);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
#region 辅助映射方法
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取质量问题类型ID(不存在则创建)
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="questionTypeName">问题类型名称</param>
|
||||||
|
/// <param name="projectId">项目ID</param>
|
||||||
|
/// <returns>问题类型ID</returns>
|
||||||
|
private static string getQualityQuestionTypeId(string questionTypeName, string projectId)
|
||||||
|
{
|
||||||
|
string questionTypeId = null;
|
||||||
|
if (!string.IsNullOrEmpty(questionTypeName))
|
||||||
|
{
|
||||||
|
var qqt = Funs.DB.Base_QualityQuestionType.FirstOrDefault(x => x.QualityQuestionType == questionTypeName);
|
||||||
|
if (qqt == null)
|
||||||
|
{
|
||||||
|
//不存在则创建
|
||||||
|
Model.Base_QualityQuestionType newQqt = new Model.Base_QualityQuestionType
|
||||||
|
{
|
||||||
|
QualityQuestionTypeId = SQLHelper.GetNewID(typeof(Model.Base_QualityQuestionType)),
|
||||||
|
QualityQuestionType = questionTypeName
|
||||||
|
};
|
||||||
|
QualityQuestionTypeService.AddQualityQuestionType(newQqt);
|
||||||
|
questionTypeId = newQqt.QualityQuestionTypeId;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
questionTypeId = qqt.QualityQuestionTypeId;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return questionTypeId;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取专业ID(不存在则创建)
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="ProfessionalName"></param>
|
||||||
|
/// <param name="projectId"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
private static string getCNProfessionalId(string ProfessionalName)
|
||||||
|
{
|
||||||
|
string Id = null;
|
||||||
|
if (!string.IsNullOrEmpty(ProfessionalName))
|
||||||
|
{
|
||||||
|
var names = ProfessionalName.Split(',');
|
||||||
|
List<string> IdList = new List<string>();
|
||||||
|
foreach (var name in names)
|
||||||
|
{
|
||||||
|
var cnProfessional = Funs.DB.Base_CNProfessional.Where(x =>
|
||||||
|
x.ProfessionalName == name).ToList();
|
||||||
|
if (cnProfessional.Count == 0)
|
||||||
|
{
|
||||||
|
Model.Base_CNProfessional newCnProfessional = new Model.Base_CNProfessional
|
||||||
|
{
|
||||||
|
CNProfessionalId = SQLHelper.GetNewID(typeof(Model.WBS_UnitWork)),
|
||||||
|
ProfessionalName = name,
|
||||||
|
};
|
||||||
|
CNProfessionalService.AddCNProfessional(newCnProfessional);
|
||||||
|
IdList.Add(newCnProfessional.CNProfessionalId);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
IdList.Add(cnProfessional.FirstOrDefault().CNProfessionalId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Id = string.Join(",", IdList);
|
||||||
|
}
|
||||||
|
|
||||||
|
return Id;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取单位ID(根据名称)
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="unitName">单位名称</param>
|
||||||
|
/// <returns>单位ID</returns>
|
||||||
|
private static string getUnitIdByUnitName(string unitName)
|
||||||
|
{
|
||||||
|
string unitId = null;
|
||||||
|
if (!string.IsNullOrEmpty(unitName))
|
||||||
|
{
|
||||||
|
var unit = Funs.DB.Base_Unit.FirstOrDefault(x => x.UnitName == unitName);
|
||||||
|
if (unit != null)
|
||||||
|
{
|
||||||
|
unitId = unit.UnitId;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return unitId;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,192 @@
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System;
|
||||||
|
|
||||||
|
namespace Model
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 质量巡检同步数据容器
|
||||||
|
/// </summary>
|
||||||
|
public class CheckControlSyncData
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 公司社会统一信用代码
|
||||||
|
/// </summary>
|
||||||
|
public string CollCropCode { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 项目id
|
||||||
|
/// </summary>
|
||||||
|
public string ProjectId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 分包单位程序访问地址
|
||||||
|
/// </summary>
|
||||||
|
public string UnitDomain { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 质量巡检数据列表
|
||||||
|
/// </summary>
|
||||||
|
public List<CheckControlSyncItem> Items { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 质量巡检数据项
|
||||||
|
/// </summary>
|
||||||
|
public class CheckControlSyncItem
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 主键
|
||||||
|
/// </summary>
|
||||||
|
public string CheckControlCode { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 项目ID
|
||||||
|
/// </summary>
|
||||||
|
public string ProjectId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 单位工程ID
|
||||||
|
/// </summary>
|
||||||
|
public string UnitWorkId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 单位工程名称
|
||||||
|
/// </summary>
|
||||||
|
public string UnitWorkName { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 单位ID
|
||||||
|
/// </summary>
|
||||||
|
public string UnitId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 单位名称
|
||||||
|
/// </summary>
|
||||||
|
public string UnitName { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 检查日期
|
||||||
|
/// </summary>
|
||||||
|
public DateTime? CheckDate { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 检查人ID
|
||||||
|
/// </summary>
|
||||||
|
public string CheckMan { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 检查人姓名
|
||||||
|
/// </summary>
|
||||||
|
public string CheckManName { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 检查部位
|
||||||
|
/// </summary>
|
||||||
|
public string CheckSite { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 单据编号
|
||||||
|
/// </summary>
|
||||||
|
public string DocCode { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 专业代码
|
||||||
|
/// </summary>
|
||||||
|
public string CNProfessionalCode { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 专业名称
|
||||||
|
/// </summary>
|
||||||
|
public string CNProfessionalName { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 问题类型ID
|
||||||
|
/// </summary>
|
||||||
|
public string QuestionType { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 问题类型名称
|
||||||
|
/// </summary>
|
||||||
|
public string QuestionTypeName { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 问题描述
|
||||||
|
/// </summary>
|
||||||
|
public string QuestionDef { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 整改意见
|
||||||
|
/// </summary>
|
||||||
|
public string RectifyOpinion { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 限期整改日期
|
||||||
|
/// </summary>
|
||||||
|
public DateTime? LimitDate { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 整改前附件URL
|
||||||
|
/// </summary>
|
||||||
|
public string AttachUrl { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 处理方式
|
||||||
|
/// </summary>
|
||||||
|
public string HandleWay { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 整改日期
|
||||||
|
/// </summary>
|
||||||
|
public DateTime? RectifyDate { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 整改后附件URL
|
||||||
|
/// </summary>
|
||||||
|
public string ReAttachUrl { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 流程状态(0-重新编制,1-总包编制,...,7-审批完成)
|
||||||
|
/// </summary>
|
||||||
|
public string State { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 是否提交
|
||||||
|
/// </summary>
|
||||||
|
public bool? IsSubmit { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 提交人ID
|
||||||
|
/// </summary>
|
||||||
|
public string SubmitMan { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 提交人姓名
|
||||||
|
/// </summary>
|
||||||
|
public string SubmitManName { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 是否合格
|
||||||
|
/// </summary>
|
||||||
|
public bool? IsOK { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 提出单位ID
|
||||||
|
/// </summary>
|
||||||
|
public string ProposeUnitId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 提出单位名称
|
||||||
|
/// </summary>
|
||||||
|
public string ProposeUnitName { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 保存处理人
|
||||||
|
/// </summary>
|
||||||
|
public string SaveHandleMan { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 数据来源(1-同步数据)
|
||||||
|
/// </summary>
|
||||||
|
public string DataSource { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,142 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
namespace Model
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 质量会议同步数据容器
|
||||||
|
/// </summary>
|
||||||
|
public class CqmsMeetingSyncData
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 公司社会统一信用代码
|
||||||
|
/// </summary>
|
||||||
|
public string CollCropCode { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 项目id
|
||||||
|
/// </summary>
|
||||||
|
public string ProjectId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 分包单位程序访问地址
|
||||||
|
/// </summary>
|
||||||
|
public string UnitDomain { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 质量会议数据列表
|
||||||
|
/// </summary>
|
||||||
|
public List<CqmsMeetingSyncItem> Items { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 质量会议数据项
|
||||||
|
/// </summary>
|
||||||
|
public class CqmsMeetingSyncItem
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 主键
|
||||||
|
/// </summary>
|
||||||
|
public string MeetingId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 会议编码
|
||||||
|
/// </summary>
|
||||||
|
public string MeetingCode { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 会议名称
|
||||||
|
/// </summary>
|
||||||
|
public string MeetingName { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 项目ID
|
||||||
|
/// </summary>
|
||||||
|
public string ProjectId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 单位ID
|
||||||
|
/// </summary>
|
||||||
|
public string UnitId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 单位名称
|
||||||
|
/// </summary>
|
||||||
|
public string UnitName { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 会议日期
|
||||||
|
/// </summary>
|
||||||
|
public DateTime? MeetingDate { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 会议时长
|
||||||
|
/// </summary>
|
||||||
|
public decimal? MeetingHours { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 会议地点
|
||||||
|
/// </summary>
|
||||||
|
public string MeetingPlace { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 主持人ID
|
||||||
|
/// </summary>
|
||||||
|
public string MeetingHostMan { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 主持人姓名
|
||||||
|
/// </summary>
|
||||||
|
public string MeetingHostManName { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 其他主持人
|
||||||
|
/// </summary>
|
||||||
|
public string MeetingHostManOther { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 参会人数
|
||||||
|
/// </summary>
|
||||||
|
public int? AttentPersonNum { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 参会人员(姓名列表,逗号分隔)
|
||||||
|
/// </summary>
|
||||||
|
public string AttentPerson { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 参会人员ID(ID列表,逗号分隔)
|
||||||
|
/// </summary>
|
||||||
|
public string AttentPersonIds { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 会议内容(HTML编码)
|
||||||
|
/// </summary>
|
||||||
|
public string MeetingContents { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 编制人ID
|
||||||
|
/// </summary>
|
||||||
|
public string CompileMan { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 编制人姓名
|
||||||
|
/// </summary>
|
||||||
|
public string CompileManName { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 编制日期
|
||||||
|
/// </summary>
|
||||||
|
public DateTime? CompileDate { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 状态(整数,2表示完成)
|
||||||
|
/// </summary>
|
||||||
|
public string States { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 数据来源(1-同步数据)
|
||||||
|
/// </summary>
|
||||||
|
public string DataSource { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,162 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
namespace Model
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 质量计量器具同步数据容器
|
||||||
|
/// </summary>
|
||||||
|
public class InspectionMachineSyncData
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 公司社会统一信用代码
|
||||||
|
/// </summary>
|
||||||
|
public string CollCropCode { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 项目id
|
||||||
|
/// </summary>
|
||||||
|
public string ProjectId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 分包单位程序访问地址
|
||||||
|
/// </summary>
|
||||||
|
public string UnitDomain { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 质量计量器具数据列表
|
||||||
|
/// </summary>
|
||||||
|
public List<InspectionMachineSyncItem> Items { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 质量计量器具数据项
|
||||||
|
/// </summary>
|
||||||
|
public class InspectionMachineSyncItem
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 主键
|
||||||
|
/// </summary>
|
||||||
|
public string InspectionMachineId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 计量器具编码
|
||||||
|
/// </summary>
|
||||||
|
public string InspectionMachineCode { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 计量器具名称
|
||||||
|
/// </summary>
|
||||||
|
public string InspectionMachineName { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 规格型号
|
||||||
|
/// </summary>
|
||||||
|
public string SpecificationModel { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 数量
|
||||||
|
/// </summary>
|
||||||
|
public int? UnitsCount { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 类别
|
||||||
|
/// </summary>
|
||||||
|
public string SType { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 检验类型
|
||||||
|
/// </summary>
|
||||||
|
public string InspectionType { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 检验日期
|
||||||
|
/// </summary>
|
||||||
|
public DateTime? InspectionDate { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 下次检验日期
|
||||||
|
/// </summary>
|
||||||
|
public DateTime? NextTestDate { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 检验周期
|
||||||
|
/// </summary>
|
||||||
|
public string TestCycle { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 是否校验合格
|
||||||
|
/// </summary>
|
||||||
|
public bool? IsCheckOK { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 是否在校验期内
|
||||||
|
/// </summary>
|
||||||
|
public bool? IsVerification { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 审批状态
|
||||||
|
/// </summary>
|
||||||
|
public string Status { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 是否在场
|
||||||
|
/// </summary>
|
||||||
|
public bool? IsOnSite { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 离场日期
|
||||||
|
/// </summary>
|
||||||
|
public DateTime? LeaveDate { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 单位ID
|
||||||
|
/// </summary>
|
||||||
|
public string UnitId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 单位名称
|
||||||
|
/// </summary>
|
||||||
|
public string UnitName { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 专业ID
|
||||||
|
/// </summary>
|
||||||
|
public string CNProfessionalId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 专业名称
|
||||||
|
/// </summary>
|
||||||
|
public string CNProfessionalName { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 编制人ID
|
||||||
|
/// </summary>
|
||||||
|
public string CompileMan { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 编制人姓名
|
||||||
|
/// </summary>
|
||||||
|
public string CompileManName { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 编制日期
|
||||||
|
/// </summary>
|
||||||
|
public DateTime? CompileDate { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 附件URL
|
||||||
|
/// </summary>
|
||||||
|
public string AttachUrl { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 项目ID
|
||||||
|
/// </summary>
|
||||||
|
public string ProjectId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 数据来源(1-同步数据)
|
||||||
|
/// </summary>
|
||||||
|
public string DataSource { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -57635,6 +57635,8 @@ namespace Model
|
||||||
|
|
||||||
private string _ReasonAnalysis;
|
private string _ReasonAnalysis;
|
||||||
|
|
||||||
|
private string _DataSource;
|
||||||
|
|
||||||
private EntityRef<Base_Project> _Base_Project;
|
private EntityRef<Base_Project> _Base_Project;
|
||||||
|
|
||||||
private EntityRef<Sys_User> _Sys_User;
|
private EntityRef<Sys_User> _Sys_User;
|
||||||
|
|
@ -57697,6 +57699,8 @@ namespace Model
|
||||||
partial void OnIsUpdateChanged();
|
partial void OnIsUpdateChanged();
|
||||||
partial void OnReasonAnalysisChanging(string value);
|
partial void OnReasonAnalysisChanging(string value);
|
||||||
partial void OnReasonAnalysisChanged();
|
partial void OnReasonAnalysisChanged();
|
||||||
|
partial void OnDataSourceChanging(string value);
|
||||||
|
partial void OnDataSourceChanged();
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
public Check_CheckControl()
|
public Check_CheckControl()
|
||||||
|
|
@ -58235,6 +58239,26 @@ namespace Model
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_DataSource", DbType="Char(1)")]
|
||||||
|
public string DataSource
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return this._DataSource;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if ((this._DataSource != value))
|
||||||
|
{
|
||||||
|
this.OnDataSourceChanging(value);
|
||||||
|
this.SendPropertyChanging();
|
||||||
|
this._DataSource = value;
|
||||||
|
this.SendPropertyChanged("DataSource");
|
||||||
|
this.OnDataSourceChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
[global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_Check_CheckControl_Base_Project", Storage="_Base_Project", ThisKey="ProjectId", OtherKey="ProjectId", IsForeignKey=true)]
|
[global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_Check_CheckControl_Base_Project", Storage="_Base_Project", ThisKey="ProjectId", OtherKey="ProjectId", IsForeignKey=true)]
|
||||||
public Base_Project Base_Project
|
public Base_Project Base_Project
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -219,9 +219,12 @@
|
||||||
<Compile Include="CQMS\SteelItem.cs" />
|
<Compile Include="CQMS\SteelItem.cs" />
|
||||||
<Compile Include="CQMS\UnitWork.cs" />
|
<Compile Include="CQMS\UnitWork.cs" />
|
||||||
<Compile Include="CQMS\WelderItem.cs" />
|
<Compile Include="CQMS\WelderItem.cs" />
|
||||||
|
<Compile Include="DataShare\CheckControlSyncData.cs" />
|
||||||
<Compile Include="DataShare\CheckSpecialSyncData.cs" />
|
<Compile Include="DataShare\CheckSpecialSyncData.cs" />
|
||||||
<Compile Include="DataShare\ClassMeetingData.cs" />
|
<Compile Include="DataShare\ClassMeetingData.cs" />
|
||||||
|
<Compile Include="DataShare\CqmsMeetingSyncData.cs" />
|
||||||
<Compile Include="DataShare\HazardRegisterSyncData.cs" />
|
<Compile Include="DataShare\HazardRegisterSyncData.cs" />
|
||||||
|
<Compile Include="DataShare\InspectionMachineSyncData.cs" />
|
||||||
<Compile Include="DataShare\LicenseManagerData.cs" />
|
<Compile Include="DataShare\LicenseManagerData.cs" />
|
||||||
<Compile Include="DataShare\PersonSyncData.cs" />
|
<Compile Include="DataShare\PersonSyncData.cs" />
|
||||||
<Compile Include="DoorServer\AbsenceDutyItem.cs" />
|
<Compile Include="DoorServer\AbsenceDutyItem.cs" />
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,136 @@
|
||||||
|
using BLL;
|
||||||
|
using System;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Web.Http;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace WebAPI.Controllers
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 质量巡检同步控制器
|
||||||
|
/// </summary>
|
||||||
|
public class CheckControlSyncController : ApiController
|
||||||
|
{
|
||||||
|
#region 拉取质量巡检数据
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 拉取质量巡检数据
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>响应数据</returns>
|
||||||
|
[HttpGet]
|
||||||
|
public Model.ResponeData getCheckControlLists()
|
||||||
|
{
|
||||||
|
var responeData = new Model.ResponeData();
|
||||||
|
try
|
||||||
|
{
|
||||||
|
responeData.code = 1;
|
||||||
|
responeData.data = APICheckControlSyncService.getCheckControlLists();
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
responeData.code = 0;
|
||||||
|
responeData.message = ex.Message;
|
||||||
|
}
|
||||||
|
|
||||||
|
return responeData;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
#region 获取质量巡检数据根据项目id和单位统一社会代码
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取质量巡检数据根据项目id和单位统一社会代码
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="projectId">项目ID</param>
|
||||||
|
/// <param name="collCropCode">单位社会统一信用代码</param>
|
||||||
|
/// <returns>响应数据</returns>
|
||||||
|
[HttpGet]
|
||||||
|
public Model.ResponeData getCheckControlListByProjectIdAndCollCropCode(string projectId, string collCropCode)
|
||||||
|
{
|
||||||
|
var responeData = new Model.ResponeData();
|
||||||
|
try
|
||||||
|
{
|
||||||
|
responeData.code = 1;
|
||||||
|
var unit = BLL.Funs.DB.Base_Unit.FirstOrDefault(x => x.CollCropCode == collCropCode);
|
||||||
|
if (unit != null)
|
||||||
|
{
|
||||||
|
responeData.data = APICheckControlSyncService.GetCheckControlListsByProjectIdUnitIdPage(projectId, unit.UnitId);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
responeData.code = 0;
|
||||||
|
responeData.message = "未找到对应单位";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
responeData.code = 0;
|
||||||
|
responeData.message = ex.Message;
|
||||||
|
}
|
||||||
|
|
||||||
|
return responeData;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
#region 推送质量巡检数据
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 推送质量巡检数据
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="projectId">项目ID</param>
|
||||||
|
/// <param name="dataId">数据ID(可选)</param>
|
||||||
|
/// <returns>响应数据</returns>
|
||||||
|
[HttpPost]
|
||||||
|
public Model.ResponeData pushCheckControlLists(string projectId, string dataId)
|
||||||
|
{
|
||||||
|
var responeData = new Model.ResponeData();
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var returndata = APICheckControlSyncService.pushCheckControlLists(projectId, dataId);
|
||||||
|
responeData.code = returndata.code;
|
||||||
|
responeData.message = returndata.message;
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
responeData.code = 0;
|
||||||
|
responeData.message = ex.Message;
|
||||||
|
}
|
||||||
|
|
||||||
|
return responeData;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
#region 接收保存质量巡检数据
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 接收保存质量巡检数据
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="newItem">质量巡检同步数据</param>
|
||||||
|
/// <returns>响应数据</returns>
|
||||||
|
[HttpPost]
|
||||||
|
public Model.ResponeData SaveCheckControlSyncData([FromBody] Model.CheckControlSyncData newItem)
|
||||||
|
{
|
||||||
|
var responeData = new Model.ResponeData();
|
||||||
|
try
|
||||||
|
{
|
||||||
|
responeData.code = 1;
|
||||||
|
responeData.message = APICheckControlSyncService.SaveCheckControlSyncData(newItem);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
responeData.code = 0;
|
||||||
|
responeData.message = ex.Message;
|
||||||
|
}
|
||||||
|
|
||||||
|
return responeData;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -10,7 +10,7 @@
|
||||||
<add key="ClientValidationEnabled" value="true" />
|
<add key="ClientValidationEnabled" value="true" />
|
||||||
<add key="UnobtrusiveJavaScriptEnabled" value="true" />
|
<add key="UnobtrusiveJavaScriptEnabled" value="true" />
|
||||||
<!--连接字符串-->
|
<!--连接字符串-->
|
||||||
<add key="ConnectionString" value="Server=.;Database=SGGLDB_WH;Integrated Security=False;User ID=sa;Password=1111;MultipleActiveResultSets=true;Connect Timeout=1200" />
|
<add key="ConnectionString" value="Server=.\MSSQLSERVER2022;Database=SGGLDB_WH;Integrated Security=False;User ID=sa;Password=1111;MultipleActiveResultSets=true;Connect Timeout=1200" />
|
||||||
<!--版本号-->
|
<!--版本号-->
|
||||||
<add key="SystemVersion" value="WebApi_V2019-08-27-001" />
|
<add key="SystemVersion" value="WebApi_V2019-08-27-001" />
|
||||||
<!--附件上传物理路径-->
|
<!--附件上传物理路径-->
|
||||||
|
|
|
||||||
|
|
@ -156,6 +156,7 @@
|
||||||
<Compile Include="Controllers\CQMS\PerformanceController.cs" />
|
<Compile Include="Controllers\CQMS\PerformanceController.cs" />
|
||||||
<Compile Include="Controllers\CQMS\QualityAssuranceController.cs" />
|
<Compile Include="Controllers\CQMS\QualityAssuranceController.cs" />
|
||||||
<Compile Include="Controllers\CQMS\WBSController.cs" />
|
<Compile Include="Controllers\CQMS\WBSController.cs" />
|
||||||
|
<Compile Include="Controllers\DataShare\CQMS\CheckControlSyncController.cs" />
|
||||||
<Compile Include="Controllers\DataShare\HSSE\CheckSpecialSyncController.cs" />
|
<Compile Include="Controllers\DataShare\HSSE\CheckSpecialSyncController.cs" />
|
||||||
<Compile Include="Controllers\DataShare\HSSE\HazardRegisterSyncController.cs" />
|
<Compile Include="Controllers\DataShare\HSSE\HazardRegisterSyncController.cs" />
|
||||||
<Compile Include="Controllers\DataShare\HSSE\LicenseSyncController.cs" />
|
<Compile Include="Controllers\DataShare\HSSE\LicenseSyncController.cs" />
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue