master
leo 3 years ago
commit 7043853248

@ -94,6 +94,22 @@ namespace FactorySystemApi.Controllers
} }
else else
{ {
if (inParam.ContainsKey("SP")&&!inParam.ContainsKey("FPlmCode"))
{
inParam.Add("FPlmCode", inParam["SP"].ToString());
}
if (inParam.ContainsKey("SP_VERSION")&& !inParam.ContainsKey("FVersionCode"))
{
inParam.Add("FVersionCode", inParam["SP_VERSION"].ToString());
}
if (inParam.ContainsKey("SP_VALUE")&&!inParam.ContainsKey("FTestCode"))
{
inParam.Add("FTestCode", inParam["SP_VALUE"].ToString());
}
List<TFS_FieldInfo> fieldList = BaseBll.GetFileInfoList((int)Constant.FieldInfoType.); List<TFS_FieldInfo> fieldList = BaseBll.GetFileInfoList((int)Constant.FieldInfoType.);
TFS_Formula formula = new TFS_Formula(); TFS_Formula formula = new TFS_Formula();
List<PropertyInfo> propertys = formula.GetType().GetProperties().ToList(); List<PropertyInfo> propertys = formula.GetType().GetProperties().ToList();
@ -102,6 +118,7 @@ namespace FactorySystemApi.Controllers
PropertyInfo temp = propertys.Find(s => s.Name == field.FColumnFIeld); PropertyInfo temp = propertys.Find(s => s.Name == field.FColumnFIeld);
if (temp != null) temp.SetValue(formula, GetValueByName(inParam, field.FFieldName, field.FDefault)); if (temp != null) temp.SetValue(formula, GetValueByName(inParam, field.FFieldName, field.FDefault));
} }
if (string.IsNullOrEmpty(formula.FPlmCode)) if (string.IsNullOrEmpty(formula.FPlmCode))
{ {
apiResult.Error("FPlmCode不能为空"); apiResult.Error("FPlmCode不能为空");

@ -188,14 +188,8 @@ namespace FactorySystemApi.Controllers
{ {
//对接获取 //对接获取
//inParam.Add("FMdmCode", GetMdmCode(inParam)); //inParam.Add("FMdmCode", GetMdmCode(inParam));
var ts = DateTime.UtcNow - new DateTime(1970, 1, 1, 0, 0, 0, 0); //var ts = DateTime.UtcNow - new DateTime(1970, 1, 1, 0, 0, 0, 0);
inParam.Add("FMdmCode", ts.TotalSeconds.ToString("F0")); //inParam.Add("FMdmCode", ts.TotalSeconds.ToString("F0"));
if (!inParam.ContainsKey("FMdmCode") || string.IsNullOrEmpty(inParam["FMdmCode"].ToString().Trim()))
{
apiResult.Error("获取MDM失败");
}
else
{
try try
{ {
inParam.TryGetValue("FState", out object state); inParam.TryGetValue("FState", out object state);
@ -293,8 +287,8 @@ namespace FactorySystemApi.Controllers
//} //}
//开始BOM下载 //开始BOM下载
int dow= DockGetBomData(teamwork.FID, user.FID); int dow = DockGetBomData(teamwork.FID, user.FID);
if (dow > 0 || editMaterialList.Count()>0) if (dow > 0 || editMaterialList.Count() > 0)
{ {
MaterialTeamworkBll.HasMaterialTestCode(teamwork); MaterialTeamworkBll.HasMaterialTestCode(teamwork);
BaseBll.CreateTaskData2(teamwork.FID, user.FID, "1"); //新增物料分类事项 BaseBll.CreateTaskData2(teamwork.FID, user.FID, "1"); //新增物料分类事项
@ -326,11 +320,9 @@ namespace FactorySystemApi.Controllers
catch (Exception ex) catch (Exception ex)
{ {
//失败则把修改的更新回去 //失败则把修改的更新回去
MaterialTeamworkBll.UpdateFormula(inParam["FTestCode"].ToString(), inParam["FNewTestCode"].ToString(),0,0,string.Join(",",ids)); MaterialTeamworkBll.UpdateFormula(inParam["FTestCode"].ToString(), inParam["FNewTestCode"].ToString(), 0, 0, string.Join(",", ids));
throw; throw;
} }
}
}, apiResult, Request, inParam); }, apiResult, Request, inParam);
} }
@ -613,6 +605,10 @@ namespace FactorySystemApi.Controllers
OAService oAService = new OAService(); OAService oAService = new OAService();
specifList[0].Code = formula.FTestCode; specifList[0].Code = formula.FTestCode;
specifList[0].Version = formula.FVersionCode; specifList[0].Version = formula.FVersionCode;
specifList[0].SP = formula.FPlmCode;
specifList[0].SP_Version = formula.FVersionCode;
RestResult restResult = oAService.GetSpecificationsList(specifList.ToArray()); RestResult restResult = oAService.GetSpecificationsList(specifList.ToArray());
string bomStr = restResult.data == null ? "[]" : restResult.data.ToString(); string bomStr = restResult.data == null ? "[]" : restResult.data.ToString();
ExceptionHelper.AddSystemJournal(Request, specifList[0], restResult,user.FID, "DockGetBomData"); ExceptionHelper.AddSystemJournal(Request, specifList[0], restResult,user.FID, "DockGetBomData");
@ -683,6 +679,11 @@ namespace FactorySystemApi.Controllers
OAService oAService = new OAService(); OAService oAService = new OAService();
specifList[0].Code = teamwork.FNewTestCode; specifList[0].Code = teamwork.FNewTestCode;
specifList[0].Version = formula.FVersionCode; specifList[0].Version = formula.FVersionCode;
specifList[0].SP = formula.FPlmCode;
specifList[0].SP_Version = formula.FVersionCode;
RestResult restResult = oAService.GetSpecificationsList(specifList.ToArray()); RestResult restResult = oAService.GetSpecificationsList(specifList.ToArray());
string bomStr = restResult.data == null ? "[]" : restResult.data.ToString(); string bomStr = restResult.data == null ? "[]" : restResult.data.ToString();
ExceptionHelper.AddSystemJournal(Request, specifList[0], restResult, userId, "DockGetBomData"); ExceptionHelper.AddSystemJournal(Request, specifList[0], restResult, userId, "DockGetBomData");
@ -1152,7 +1153,7 @@ namespace FactorySystemApi.Controllers
} }
else else
{ {
dataList = MaterialTeamworkBll.GetTeamworkViewData(selectSql.Trim(','), whereSql, joinSql); dataList = MaterialTeamworkBll.GetHalfMaterialTeamworkViewData(selectSql.Trim(','), whereSql, joinSql);
dataList.Columns.Remove("FMaterialID"); dataList.Columns.Remove("FMaterialID");
if (intType == (int)Constant.TeamViewType.) if (intType == (int)Constant.TeamViewType.)
{ {

@ -448,6 +448,11 @@ namespace FactorySystemApi.Controllers
OAService oAService = new OAService(); OAService oAService = new OAService();
specifList[0].Code = formula.FTestCode; specifList[0].Code = formula.FTestCode;
specifList[0].Version = formula.FVersionCode; specifList[0].Version = formula.FVersionCode;
//修改
specifList[0].SP = formula.FPlmCode;
specifList[0].SP_Version = formula.FVersionCode;
RestResult restResult = oAService.GetSpecificationsList(specifList.ToArray()); RestResult restResult = oAService.GetSpecificationsList(specifList.ToArray());
string bomStr = restResult.data == null ? "[]" : restResult.data.ToString(); string bomStr = restResult.data == null ? "[]" : restResult.data.ToString();
ExceptionHelper.AddSystemJournal(Request, specifList[0], restResult,user.FID, "DockGetBomData"); ExceptionHelper.AddSystemJournal(Request, specifList[0], restResult,user.FID, "DockGetBomData");
@ -516,8 +521,14 @@ namespace FactorySystemApi.Controllers
{ {
TFS_Formula formula = BaseBll.GetTempModel<TFS_Formula>(teamwork.FFormulaID); TFS_Formula formula = BaseBll.GetTempModel<TFS_Formula>(teamwork.FFormulaID);
OAService oAService = new OAService(); OAService oAService = new OAService();
specifList[0].Code = formula.FTestCode; specifList[0].Code = formula.FTestCode;
specifList[0].Version = formula.FVersionCode; specifList[0].Version = formula.FVersionCode;
//修改
specifList[0].SP= formula.FPlmCode;
specifList[0].SP_Version= formula.FVersionCode;
RestResult restResult = oAService.GetSpecificationsList(specifList.ToArray()); RestResult restResult = oAService.GetSpecificationsList(specifList.ToArray());
string bomStr = restResult.data == null ? "[]" : restResult.data.ToString(); string bomStr = restResult.data == null ? "[]" : restResult.data.ToString();
ExceptionHelper.AddSystemJournal(Request, specifList[0], restResult, userId, "DockGetBomData"); ExceptionHelper.AddSystemJournal(Request, specifList[0], restResult, userId, "DockGetBomData");
@ -622,6 +633,19 @@ namespace FactorySystemApi.Controllers
{ {
foreach (BomModel item in dataList) foreach (BomModel item in dataList)
{ {
if (!string.IsNullOrWhiteSpace(item.SP))
{
item.Code = item.SP;
}
if (!string.IsNullOrWhiteSpace(item.SP_Version))
{
item.Version=item.SP_Version;
}
if (!string.IsNullOrWhiteSpace(item.SP_VALUE))
{
item.TestNO = item.SP_VALUE;
}
int dataId = random.Next(1, 99) * random.Next(1, 99); int dataId = random.Next(1, 99) * random.Next(1, 99);
dataId += random.Next(10, 99) * random.Next(10, 99) * 2; dataId += random.Next(10, 99) * random.Next(10, 99) * 2;
dataId += random.Next(1, 99) * random.Next(1, 99) * 10; dataId += random.Next(1, 99) * random.Next(1, 99) * 10;

@ -259,42 +259,6 @@
</Compile> </Compile>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<None Include="Connected Services\Sap_Bom\configuration91.svcinfo" />
<None Include="Connected Services\Sap_Bom\configuration.svcinfo" />
<Content Include="Connected Services\Sap_Bom\FactorySystemApi.Sap_Bom.dt_pp079_resHEAD.datasource">
<DependentUpon>Reference.svcmap</DependentUpon>
</Content>
<Content Include="Connected Services\Sap_Bom\FactorySystemApi.Sap_Bom.si_pp079_mcs_senderResponse.datasource">
<DependentUpon>Reference.svcmap</DependentUpon>
</Content>
<None Include="Connected Services\Sap_Bom\Reference.svcmap">
<Generator>WCF Proxy Generator</Generator>
<LastGenOutput>Reference.cs</LastGenOutput>
</None>
<None Include="Connected Services\Sap_ProductVersion\configuration91.svcinfo" />
<None Include="Connected Services\Sap_ProductVersion\configuration.svcinfo" />
<Content Include="Connected Services\Sap_ProductVersion\FactorySystemApi.Sap_ProductVersion.dt_pp080_resHEAD.datasource">
<DependentUpon>Reference.svcmap</DependentUpon>
</Content>
<Content Include="Connected Services\Sap_ProductVersion\FactorySystemApi.Sap_ProductVersion.si_pp080_mcs_senderResponse.datasource">
<DependentUpon>Reference.svcmap</DependentUpon>
</Content>
<None Include="Connected Services\Sap_ProductVersion\Reference.svcmap">
<Generator>WCF Proxy Generator</Generator>
<LastGenOutput>Reference.cs</LastGenOutput>
</None>
<None Include="Connected Services\Sap_ViewMaterial\configuration91.svcinfo" />
<None Include="Connected Services\Sap_ViewMaterial\configuration.svcinfo" />
<Content Include="Connected Services\Sap_ViewMaterial\FactorySystemApi.Sap_ViewMaterial.dt_mm104_res.datasource">
<DependentUpon>Reference.svcmap</DependentUpon>
</Content>
<Content Include="Connected Services\Sap_ViewMaterial\FactorySystemApi.Sap_ViewMaterial.si_mm104_mcs_senderResponse.datasource">
<DependentUpon>Reference.svcmap</DependentUpon>
</Content>
<None Include="Connected Services\Sap_ViewMaterial\Reference.svcmap">
<Generator>WCF Proxy Generator</Generator>
<LastGenOutput>Reference.cs</LastGenOutput>
</None>
<Content Include="favicon.ico" /> <Content Include="favicon.ico" />
<Content Include="Global.asax" /> <Content Include="Global.asax" />
<Content Include="Scripts\bootstrap.js" /> <Content Include="Scripts\bootstrap.js" />
@ -304,9 +268,6 @@
<Content Include="File\Material\副产物导入模板.xlsx" /> <Content Include="File\Material\副产物导入模板.xlsx" />
<Content Include="File\Material\替代料导入模板.xlsx" /> <Content Include="File\Material\替代料导入模板.xlsx" />
<Content Include="File\Material\物料信息补全导入模板.xlsx" /> <Content Include="File\Material\物料信息补全导入模板.xlsx" />
<None Include="Connected Services\Sap_Bom\si_pp079_mcs_sender.wsdl" />
<None Include="Connected Services\Sap_ProductVersion\si_pp080_mcs_sender.wsdl" />
<None Include="Connected Services\Sap_ViewMaterial\si_mm104_mcs_sender.wsdl" />
<None Include="Properties\Settings.settings"> <None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator> <Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput> <LastGenOutput>Settings.Designer.cs</LastGenOutput>
@ -451,11 +412,6 @@
<ItemGroup> <ItemGroup>
<WCFMetadata Include="Connected Services\" /> <WCFMetadata Include="Connected Services\" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<WCFMetadataStorage Include="Connected Services\Sap_Bom\" />
<WCFMetadataStorage Include="Connected Services\Sap_ProductVersion\" />
<WCFMetadataStorage Include="Connected Services\Sap_ViewMaterial\" />
</ItemGroup>
<PropertyGroup> <PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion> <VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath> <VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>

@ -636,6 +636,28 @@ namespace FactorySystemApi.Plm_Formula {
private string versionField; private string versionField;
public string SP { get
{
return this.codeField;
}
set
{
this.codeField = value;
}
}
public string SP_Version
{
get
{
return this.versionField;
}
set
{
this.versionField = value;
}
}
/// <remarks/> /// <remarks/>
public string Code { public string Code {
get { get {

@ -323,6 +323,18 @@ namespace FactorySystemBll
{2} where {1}", selectSql, whereSql, string.IsNullOrEmpty(joinSql) ? "" : joinSql); {2} where {1}", selectSql, whereSql, string.IsNullOrEmpty(joinSql) ? "" : joinSql);
return db.Ado.GetDataTable(strSql); return db.Ado.GetDataTable(strSql);
} }
/// <summary>
/// 获取协同视图结果信息
/// </summary>
public DataTable GetHalfMaterialTeamworkViewData(string selectSql, string whereSql, string joinSql = "")
{
SqlSugarClient db = AppSettingsHelper.GetSqlSugar();
string strSql = string.Format(@"select distinct {0},TFS_ViewMaterial.FMaterialID from TFS_HalfMaterialFTeamwork left join TFS_ViewMaterial on
TFS_HalfMaterialFTeamwork.FID=TFS_ViewMaterial.FHalfMaterialTeamID left join TFS_Material on TFS_Material.FID=TFS_ViewMaterial.FMaterialID
{2} where {1}", selectSql, whereSql, string.IsNullOrEmpty(joinSql) ? "" : joinSql);
return db.Ado.GetDataTable(strSql);
}
/// <summary> /// <summary>
/// 获取协同视图结果信息 /// 获取协同视图结果信息

@ -9,13 +9,33 @@ namespace FactorySystemModel.BusinessModel
Code = Name = Version = Type = Quantity = TestNO = ""; Code = Name = Version = Type = Quantity = TestNO = "";
Specifications = new List<BomModel>(); Specifications = new List<BomModel>();
} }
public string Code { get; set; } /// <summary>
/// PLM规格内码
/// </summary>
public string SP { get; set; }
public string Name { get; set; } public string Name { get; set; }
public string Version { get; set; }
/// <summary>
/// 规格英文名称
/// </summary>
public string EnName { get; set; }
/// <summary>
/// 版本号
/// </summary>
public string SP_Version { get; set; }
public string Type { get; set; } public string Type { get; set; }
/// <summary>
/// 实验号
/// </summary>
public string SP_VALUE { get; set; }
public string Code { get; set; }
public string Version { get; set; }
public string Quantity { get; set; } public string Quantity { get; set; }
public string TestNO { get; set; } public string TestNO { get; set; }
public List<BomModel> Specifications { get; set; } public List<BomModel> Specifications { get; set; }
} }
/// <summary> /// <summary>

Loading…
Cancel
Save