添加项目文件。

master
leo 3 years ago
parent 31a3e21508
commit 38baee10f2

@ -0,0 +1,43 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.3.32929.385
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FactorySystemApi", "FactorySystemApi\FactorySystemApi.csproj", "{7107DC39-2E93-425F-A4D8-C50768DE573C}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FactorySystemBll", "FactorySystemBll\FactorySystemBll.csproj", "{DE5CA953-C5F7-4DF4-81B2-9C3D89849DC5}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FactorySystemCommon", "FactorySystemCommon\FactorySystemCommon.csproj", "{EA8E8FC2-B255-4931-BBAE-7862F0173CD3}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FactorySystemModel", "FactorySystemModel\FactorySystemModel.csproj", "{2C1A44D9-D4BA-464E-832B-6108595892D6}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{7107DC39-2E93-425F-A4D8-C50768DE573C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7107DC39-2E93-425F-A4D8-C50768DE573C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7107DC39-2E93-425F-A4D8-C50768DE573C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7107DC39-2E93-425F-A4D8-C50768DE573C}.Release|Any CPU.Build.0 = Release|Any CPU
{DE5CA953-C5F7-4DF4-81B2-9C3D89849DC5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{DE5CA953-C5F7-4DF4-81B2-9C3D89849DC5}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DE5CA953-C5F7-4DF4-81B2-9C3D89849DC5}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DE5CA953-C5F7-4DF4-81B2-9C3D89849DC5}.Release|Any CPU.Build.0 = Release|Any CPU
{EA8E8FC2-B255-4931-BBAE-7862F0173CD3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{EA8E8FC2-B255-4931-BBAE-7862F0173CD3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{EA8E8FC2-B255-4931-BBAE-7862F0173CD3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{EA8E8FC2-B255-4931-BBAE-7862F0173CD3}.Release|Any CPU.Build.0 = Release|Any CPU
{2C1A44D9-D4BA-464E-832B-6108595892D6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2C1A44D9-D4BA-464E-832B-6108595892D6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2C1A44D9-D4BA-464E-832B-6108595892D6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2C1A44D9-D4BA-464E-832B-6108595892D6}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {B08F9A5A-D49A-4071-B561-D9A1AC7A1B54}
EndGlobalSection
EndGlobal

@ -0,0 +1,153 @@
using FactorySystemBll;
using FactorySystemCommon;
using FactorySystemModel.BusinessModel;
using FactorySystemModel.EnumModel;
using FactorySystemModel.ResponseModel;
using FactorySystemModel.SqlSugarModel;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Text;
using System.Web.Http.Controllers;
using System.Web.Http.Filters;
using System.Xml;
namespace FactorySystemApi
{
/// <summary>
/// 授权
/// </summary>
public class UserLoginFilter : AuthorizationFilterAttribute
{
/// <summary>
/// 指示指定的控件是否已获得授权
/// </summary>
public override void OnAuthorization(HttpActionContext actionContext)
{
try
{
//验证Referrer
string ApiRealNameUrl = AppSettingsHelper.GetAppSettingVal("ApiRealNameUrl");
if (!string.IsNullOrEmpty(ApiRealNameUrl))
{
string[] ApiRealNameUrls = ApiRealNameUrl.Split(',');
string requestHost = actionContext.Request.Headers.Referrer.Host;
bool isRealUrl = false;
for (int i = 0; i < ApiRealNameUrls.Length && !isRealUrl; i++)
{
Uri apiUrl = new Uri(ApiRealNameUrls[i]);
if (apiUrl.Host == requestHost) isRealUrl = true;
}
if (!isRealUrl) throw new Exception("请求失败,不在授权访问内");
}
//验证接口配置
if (actionContext.ControllerContext.ControllerDescriptor.GetCustomAttributes<UserLoginFilter>().Count > 0)
{
if (actionContext.ActionDescriptor.GetCustomAttributes<NoCheckUserLogin>().Count > 0) { return; }
}
else { return; }
string token = "";
//前端请求api时会将token存放在名为"auth"的请求头中
var authHeader = from t in actionContext.Request.Headers where t.Key == "token" select t.Value.FirstOrDefault();
if (authHeader == null || string.IsNullOrEmpty(token = authHeader.FirstOrDefault()))
{
authHeader = from t in actionContext.Request.Headers where t.Key == "ticket" select t.Value.FirstOrDefault();
if (authHeader != null && !string.IsNullOrEmpty(token = authHeader.FirstOrDefault()))
{
token = CasLogin(token, AppSettingsHelper.GetAppSettingVal("Cas_ReUrl"));
actionContext.Request.Properties.Add("reticket", token);
}
else
{
throw new Exception("登录超时,请重新登录");
}
}
//解密
ApiAuthInfo authInfo = JWTHelper.Decrypt<ApiAuthInfo>(token);
if (authInfo == null || !DateTime.TryParse(authInfo.FExpireTime, out DateTime expireTime) || DateTime.Compare(expireTime, DateTime.Now) < 0)
{
throw new Exception("登录超时,请重新登录");
}
actionContext.Request.Properties.Add("token", authInfo);
}
catch (Exception ex)
{
string errorMsg = string.Format("{1}", Environment.NewLine, ex.Message.ToString());
ExceptionHelper.WriteMessage(errorMsg, 2);
ApiResult errResult = new ApiResult().CustomError((int)Constant.ApiResultCode., errorMsg);
if (ex.Message == "登录超时,请重新登录")
{
errResult.Ticket = AppSettingsHelper.GetAppSettingVal("Cas_OAUrl") + "login?appid=testsso&service=" + AppSettingsHelper.GetAppSettingVal("Cas_ReUrl");
}
string tempStr = JsonConvert.SerializeObject(errResult);
actionContext.Response = new HttpResponseMessage() { Content = new StringContent(tempStr, Encoding.GetEncoding("UTF-8"), "application/json") };
}
}
/// <summary>
/// OA登录信息对接
/// </summary>
private string CasLogin(string ticket, string refUrl)
{
string valUrl = AppSettingsHelper.GetAppSettingVal("Cas_OAUrl");
valUrl += string.Format(@"serviceValidate?ticket={0}&service={1}", ticket, refUrl);
try
{
StreamReader Reader = new StreamReader(new WebClient().OpenRead(valUrl));
string resp = Reader.ReadToEnd();
ExceptionHelper.AddSystemJournal(null, valUrl, resp, -1, "CasLoginLog");
XmlDocument xmlDoc = new XmlDocument();
xmlDoc.LoadXml(resp);
string userid = "";
XmlNamespaceManager nsmgr = new XmlNamespaceManager(xmlDoc.NameTable);
nsmgr.AddNamespace("cas", "http://www.yale.edu/tp/cas");
if (xmlDoc.SelectSingleNode("/cas:serviceResponse/cas:authenticationSuccess/cas:attributes", nsmgr) != null)
{
XmlNode root = xmlDoc.SelectSingleNode("/cas:serviceResponse/cas:authenticationSuccess/cas:attributes", nsmgr);
userid = root.SelectSingleNode("cas:workcode", nsmgr) == null ? "" : root.SelectSingleNode("cas:workcode", nsmgr).InnerText;
}
if (!string.IsNullOrEmpty(userid))
{
TUser user = BaseBll.GetTempModel<TUser>(string.Format("FDockID='{0}'", userid.Replace("'", "\"")));
if (user != null)
{
ApiAuthInfo apiAuthInfo = new ApiAuthInfo()
{
FID = user.FID,
FName = user.FName,
FUser = user.FUser,
FExpireTime = DateTime.Now.AddDays(30).ToString("yyyy-MM-dd HH:mm:ss")
};
Dictionary<string, object> updateModel = new Dictionary<string, object>();
updateModel.Add("FID", user.FID);
updateModel.Add("FLoginDate", DateTime.Now);
BaseBll.UpdateDataModel(updateModel, "TUser");
return JWTHelper.Encryption(apiAuthInfo);
}
}
}
catch (Exception ex)
{
ExceptionHelper.AddSystemJournal(null, valUrl, ex.Message, -1, "CasLoginLog");
throw new Exception("OA获取用户信息报错请重新登录");
}
throw new Exception("登录超时,请重新登录");
}
}
/// <summary>
/// 不需要授权
/// </summary>
public class NoCheckUserLogin : Attribute
{ }
}

@ -0,0 +1,13 @@
using System.Web;
using System.Web.Mvc;
namespace FactorySystemApi
{
public class FilterConfig
{
public static void RegisterGlobalFilters(GlobalFilterCollection filters)
{
filters.Add(new HandleErrorAttribute());
}
}
}

@ -0,0 +1,23 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Routing;
namespace FactorySystemApi
{
public class RouteConfig
{
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapRoute(
name: "Default",
url: "{controller}/{action}/{id}",
defaults: new { controller = "Swagger", action = "Index", id = UrlParameter.Optional }
);
}
}
}

@ -0,0 +1,39 @@
using System.Web.Http;
using WebActivatorEx;
using Swashbuckle.Application;
using System.Linq;
using System.Reflection;
using FactorySystemApi;
using FactorySystemApi.Controllers;
[assembly: PreApplicationStartMethod(typeof(SwaggerConfig), "Register")]
namespace FactorySystemApi
{
public class SwaggerConfig
{
public static void Register()
{
var thisAssembly = typeof(SwaggerConfig).Assembly;
GlobalConfiguration.Configuration
.EnableSwagger(c =>
{
c.SingleApiVersion("v1", "Å䷽Эͬ½Ó¿ÚÎĵµ");
c.OperationFilter<HttpAuthHeaderFilter>();
c.IncludeXmlComments(string.Format("{0}/bin/FactorySystemModel.xml", System.AppDomain.CurrentDomain.BaseDirectory));
c.IncludeXmlComments(string.Format("{0}/bin/FactorySystemApi.xml", System.AppDomain.CurrentDomain.BaseDirectory));
c.ResolveConflictingActions(apiDescriptions => apiDescriptions.First());
c.CustomProvider((defaultProvider) => new SwaggerCacheProvider(defaultProvider, string.Format("{0}/bin/FactorySystemApi.XML",System.AppDomain.CurrentDomain.BaseDirectory)));
c.ResolveConflictingActions(apiDescriptions => apiDescriptions.First());
})
.EnableSwaggerUi(c =>
{
c.InjectJavaScript(Assembly.GetExecutingAssembly(), "FactorySystemApi.Scripts.swagger.js");
});
}
}
}

@ -0,0 +1,18 @@
using System.Web.Http;
namespace FactorySystemApi
{
public static class WebApiConfig
{
public static void Register(HttpConfiguration config)
{
// Web API 路由
config.MapHttpAttributeRoutes();
config.Routes.MapHttpRoute(
name: "DefaultApi",
routeTemplate: "api/{controller}/{action}",
defaults: new { id = RouteParameter.Optional }
);
}
}
}

@ -0,0 +1,404 @@
using FactorySystemBll;
using FactorySystemCommon;
using FactorySystemModel.BusinessModel;
using FactorySystemModel.ResponseModel;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Data;
using System.IO;
using System.Linq;
using System.Net;
using System.Text;
using System.Web;
using System.Web.Http;
namespace FactorySystemApi.Controllers
{
/// <summary>
/// 基础接口
/// </summary>
[UserLoginFilter]
public class BaseController<T> : ApiController
{
/// <summary>
/// 数据处理层
/// </summary>
public readonly BaseBll BaseBll = new BaseBll();
#region 公共接口-开始
/// <summary>
/// (通用)获取信息
/// </summary>
[HttpPost]
public virtual ApiResult GetDataModel(Dictionary<string, object> inParam)
{
ApiResult apiResult = new ApiResult
{
Data = -1
};
return ExceptionHelper.TryReturnException(() =>
{
inParam.TryGetValue("FID", out object dataId);
apiResult.Data = BaseBll.GetTempDict<T>(dataId == null ? -1 : int.Parse(dataId.ToString()), inParam.ContainsKey("FKey") ? inParam["FKey"].ToString() : "");
}, apiResult, Request, inParam);
}
/// <summary>
/// (通用)新增信息
/// </summary>
[HttpPost]
public virtual ApiResult InsertDataModel(Dictionary<string, object> insertData)
{
ApiResult apiResult = new ApiResult
{
Data = -1
};
return ExceptionHelper.TryReturnException(() =>
{
//表可新增字段
if (!string.IsNullOrEmpty(InsertField))
{
insertData = GetDictByField(insertData, InsertField);
}
//新增数据
if (insertData.Count > 1)
{
//设置用户字段
ApiAuthInfo user = Request.Properties["token"] as ApiAuthInfo;
if (insertData.ContainsKey("FAddUser")) { insertData["FAddUser"] = user.FID; }
if (insertData.ContainsKey("FEditUser")) { insertData["FEditUser"] = user.FID; }
else { insertData.Add("FEditUser", user.FID); }
if (insertData.ContainsKey("FEditDate")) { insertData["FEditDate"] = DateTime.Now; }
else { insertData.Add("FEditDate", DateTime.Now); }
apiResult.Data = BaseBll.InsertDataModel(insertData, typeof(T).Name);
}
}, apiResult, Request, insertData);
}
/// <summary>
/// (通用)修改信息
/// </summary>
[HttpPost]
public virtual ApiResult UpdateDataModel(Dictionary<string, object> updateModel)
{
ApiResult apiResult = new ApiResult();
return ExceptionHelper.TryReturnException(() =>
{
ApiAuthInfo user = Request.Properties["token"] as ApiAuthInfo;
updateModel.Remove("FEditUser");
updateModel.Remove("FEditDate");
updateModel.Add("FEditUser", user.FID);
updateModel.Add("FEditDate", DateTime.Now);
apiResult.Data = UpdateData(updateModel);
}, apiResult, Request, updateModel);
}
/// <summary>
/// (通用)删除信息
/// </summary>
[HttpPost]
public ApiResult DeleteDataById(Dictionary<string, object> updateModel)
{
ApiResult apiResult = new ApiResult();
return ExceptionHelper.TryReturnException(() =>
{
apiResult.Data = BaseBll.DeleteDataById(updateModel, typeof(T).Name);
}, apiResult, Request, updateModel);
}
/// <summary>
/// (通用)列表分页
/// </summary>
[HttpPost]
public ApiResult GetPageList(Dictionary<string, object> pageParam)
{
return GetTPageList<T>(pageParam);
}
/// <summary>
///(通用)模板上传
/// </summary>
[HttpPost]
public ApiResult UploadTempFile(int FType, int FFuncType)
{
ApiResult apiResult = new ApiResult();
List<string> fileList = new List<string>();
return ExceptionHelper.TryReturnException(() =>
{
var files = HttpContext.Current.Request.Files;
if (files != null && files.Count > 0)
{
string typeName = "";
switch (FType)
{
case 2://物料
typeName = "Material";
break;
case 1://配方
default:
typeName = "Formula";
break;
}
ApiAuthInfo authInfo = Request.Properties["token"] as ApiAuthInfo;
string[] exts = ".xlsx,.xls".Split(',');
string saveBase = string.Format("/Upload/{0}/" + authInfo.FID + "/", typeName);
saveBase = System.Web.Hosting.HostingEnvironment.MapPath(saveBase);
if (!Directory.Exists(saveBase)) Directory.CreateDirectory(saveBase);
for (int i = 0; i < files.Count; i++)
{
string ext = Path.GetExtension(files[i].FileName).ToLower();
if (Array.IndexOf(exts, ext) != -1)
{
string filePath = saveBase + DateTime.Now.ToString("yyyyMMddHHmmssfff") + "_" + i + ext;
files[i].SaveAs(filePath);
fileList.Add(filePath);
}
}
ApiAuthInfo user = Request.Properties["token"] as ApiAuthInfo;
apiResult.Data = CheckUploadFile(fileList, FFuncType, user.FID);
}
}, apiResult, Request, new { FType, FFuncType, FileList = fileList });
}
/// <summary>
/// (临时)创建表
/// </summary>
[HttpPost]
[NoCheckUserLogin]
[NonAction]
public ApiResult CreateSqlSugarModel(Dictionary<string, object> updateModel)
{
ApiResult apiResult = new ApiResult();
return ExceptionHelper.TryReturnException(() =>
{
updateModel.TryGetValue("FAuth", out object apiAuth);
if (apiAuth == null || apiAuth.ToString() != (DateTime.Now.ToString("yyyyMMdd-") + DateTime.Now.DayOfYear))
{
apiResult.Message = "认证信息错误";
}
else
{
updateModel.TryGetValue("FName", out object tableName);
BaseBll.CreateSqlSugarModel(tableName == null ? "TFS_" : tableName.ToString());
}
}, apiResult, Request, updateModel);
}
#endregion 公共接口-结束
#region 内部方法-开始
/// <summary>
/// 可修改字段,非空则只有这些字段是可以修改的
/// </summary>
internal string UpdateField = string.Empty;
/// <summary>
/// 插入字段,非空则这些字段是必须的,默认值自己数据库设置
/// </summary>
internal string InsertField = string.Empty;
/// <summary>
/// (通用)修改信息
/// </summary>
/// <param name="updateModel">修改数据</param>
/// <param name="tableName">表名</param>
/// <param name="canOptField">权限→ null不限制反之只能改这几个值</param>
protected int UpdateData(Dictionary<string, object> updateModel, string canOptField = null, string tableName = null)
{
//表可修改字段
if (!string.IsNullOrEmpty(UpdateField))
{
updateModel = GetDictByField(updateModel, UpdateField);
}
//权限可修改字段
if (canOptField != null)
{
updateModel = GetDictByField(updateModel, canOptField);
}
//修改数据
if (updateModel.ContainsKey("FID") && updateModel.Count > 1)
{
return BaseBll.UpdateDataModel(updateModel, string.IsNullOrEmpty(tableName) ? typeof(T).Name : tableName) > 0 ? 1 : 0;
}
return 0;
}
/// <summary>
/// 模板文件处理
/// </summary>
protected virtual object CheckUploadFile(List<string> fileList, int funcType, int userId)
{
return fileList;
}
/// <summary>
/// 筛选字段
/// </summary>
protected Dictionary<string, object> GetDictByField(Dictionary<string, object> updateModel, string fieldKey)
{
Dictionary<string, object> tempDict = new Dictionary<string, object>();
if (updateModel.Count > 0)
{
string[] fieldKeys = (fieldKey.Trim() + ",FID").Split(',');
foreach (string fieldName in fieldKeys)
{
if (!string.IsNullOrEmpty(fieldName) && updateModel.TryGetValue(fieldName, out object fieldVal))
{
tempDict.Add(fieldName, fieldVal);
}
}
}
return tempDict;
}
/// <summary>
/// (通用)获取列表分页
/// </summary>
protected ApiResult GetTPageList<TT>(Dictionary<string, object> pageParam, string searchKey = null, string orderBy = "FID desc")
{
ApiResult apiResult = new ApiResult();
return ExceptionHelper.TryReturnException(() =>
{
apiResult.Data = new
{
List = BaseBll.GetPageList<TT>(pageParam, out int totalCount, searchKey, orderBy),
Total = totalCount
};
}, apiResult, Request, pageParam);
}
/// <summary>
/// 根据名称查找值
/// </summary>
protected string GetValueByName(Dictionary<string, object> inParam, string name, string nullVal = "")
{
List<string> names = name.Split(',').ToList();
for (int i = 0; i < names.Count(); i++)
{
if (inParam.TryGetValue(names[i], out object result))
{
return result == null ? "" : result.ToString().Trim();
}
}
return nullVal;
}
/// <summary>
/// 根据名称查找值
/// </summary>
protected string GetValueByName(DataRow dr, List<string> items, string name, string nullVal = "")
{
List<string> names = name.Split(',').ToList();
for (int i = 0; i < names.Count(); i++)
{
if (items.IndexOf(names[i]) != -1)
{
try { return dr[names[i]].ToString().Trim(); }
catch (Exception) { }
}
}
return nullVal;
}
/// <summary>
/// 获取MDM代码
/// </summary>
public string GetMdmCode(Dictionary<string, object> inParam)
{
string logMessage = "";
string jObject = "";
try
{
JObject jo = new JObject
{
{ "systemCode", "mdm" },
{ "gdCode", "sap_material" },
{ "masterData",
new JArray
{
new JObject
{
{ "id", Guid.NewGuid().ToString() },//随机生成值,不可重复
{ "sap_flag_system", "香精" },//固定
{ "sap_material_basicunit#code", GetValueByName(inParam, "FWeightUnit") },//必填
{ "sap_material_busvol", "" },
{ "sap_material_code", "" },
{ "sap_material_code_2", "" },
{ "sap_material_code_flag", "Y" },//固定
{ "sap_material_ex_code", GetValueByName(inParam, "FTestCode") },//试验号,可不填
{ "sap_material_fame", "" },
{ "sap_material_grossweight", "" },
{ "sap_material_grouptype#code", GetValueByName(inParam, "FMaterialGroup,FGroup")}, //必填
{ "sap_material_lable#code", "" },
{ "sap_material_models", "" },
{ "sap_material_models_text", "" },
{ "sap_material_name", GetValueByName(inParam, "FSaleCode,FName")}, //必填
{ "sap_material_netweight", "" },
{ "sap_material_type#code", GetValueByName(inParam, "FType,FMaterialType") },//固定,必填
{ "sap_material_volunit#code", "" },
{ "sap_material_weightunit#code", "" }
}
}
}
};
jObject = jo.ToString();
WebRequest webRequest = WebRequest.Create(AppSettingsHelper.GetAppSettingVal("Mdm_Url"));
HttpWebRequest httpRequest = webRequest as HttpWebRequest;
httpRequest.UserAgent = "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.2; .NET CLR 1.1.4322; .NET CLR 2.0.50727)";
httpRequest.ContentType = "application/json";
httpRequest.Method = "post";
httpRequest.Headers.Add("mdmtoken", "ac9b7db8-9661-461d-b5b2-ed66f33a1d69");
httpRequest.Headers.Add("tenantid", "tenant");
Encoding encoding = Encoding.GetEncoding("utf-8");
byte[] bytesToPost = encoding.GetBytes(jObject);
httpRequest.ContentLength = bytesToPost.Length;
Stream requestStream = httpRequest.GetRequestStream();
requestStream.Write(bytesToPost, 0, bytesToPost.Length);
requestStream.Close();
Stream responseStream = httpRequest.GetResponse().GetResponseStream();
using (StreamReader responseReader = new StreamReader(responseStream, Encoding.GetEncoding("utf-8")))
{
logMessage = responseReader.ReadToEnd();
}
responseStream.Close();
ExceptionHelper.AddSystemJournal(Request, new
{
inParam,
jObject
}, logMessage, -1, "GetMdmCode");
}
catch (Exception ex)
{
ExceptionHelper.AddSystemJournal(Request, new
{
inParam,
jObject
}, new
{
Resule = logMessage,
Error = ex.Message
}, -1, "GetMdmCode");
}
try
{
if (logMessage.IndexOf("success") != -1)
{
MDMResponseModel resModel = JsonConvert.DeserializeObject<MDMResponseModel>(logMessage);
if (resModel.success)
{
List<MDMDataResponseModel> datas = JsonConvert.DeserializeObject<List<MDMDataResponseModel>>(resModel.data);
return datas.Count > 0 ? datas.First().mdm_code : "";
}
}
}
catch (Exception) { }
return "";
}
#endregion 内部方法-结束
}
}

@ -0,0 +1,208 @@
using FactorySystemBll;
using FactorySystemCommon;
using FactorySystemModel.BusinessModel;
using FactorySystemModel.ResponseModel;
using FactorySystemModel.SqlSugarModel;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web.Http;
namespace FactorySystemApi.Controllers
{
/// <summary>
/// 公共接口
/// </summary>
[UserLoginFilter]
public class CommonController : BaseController<TFunction>
{
private readonly CommonBll CommonBll = new CommonBll();
/// <summary>
/// 获取配置集合
/// </summary>
[HttpPost]
public ApiResult GetBasicList(Dictionary<string, object> inParam)
{
ApiResult apiResult = new ApiResult();
return ExceptionHelper.TryReturnException(() =>
{
if (inParam.TryGetValue("FType", out object objType) && int.TryParse(objType.ToString(), out int intType))
{
apiResult.Data = CommonBll.GetBasicList(intType);
}
}, apiResult, Request, inParam);
}
/// <summary>
/// 获取模板信息
/// </summary>
[HttpPost]
public ApiResult GetTempFile(Dictionary<string, object> inParam)
{
ApiResult apiResult = new ApiResult();
return ExceptionHelper.TryReturnException(() =>
{
inParam.TryGetValue("FType", out object objType);
objType = objType ?? "";
string filePath = "/File/{0}/{1}.xlsx";
switch (objType.ToString())
{
case "2":
filePath = string.Format(filePath, "Material", "SAP物料导入模板");
break;
case "3":
filePath = string.Format(filePath, "Material", "替代料导入模板");
break;
case "4":
filePath = string.Format(filePath, "Material", "副产物导入模板");
break;
case "5":
filePath = string.Format(filePath, "Material", "物料信息补全导入模板");
break;
case "1"://配方导入模板
default:
filePath = string.Format(filePath, "Formula", "配方导入模板");
break;
}
apiResult.Data = Request.RequestUri.AbsoluteUri.Replace(Request.RequestUri.AbsolutePath, "").Trim('/') + filePath;
}, apiResult, Request, inParam);
}
/// <summary>
/// 验证用户权限
/// </summary>
[HttpPost]
public ApiResult CheckIsHasPower(Dictionary<string, object> inParam)
{
ApiResult apiResult = new ApiResult();
return ExceptionHelper.TryReturnException(() =>
{
Dictionary<string, object> outParam = new Dictionary<string, object>();
List<int> funcList = new List<int>();
inParam.TryGetValue("FType", out object oType);
if (null != inParam)
{
inParam.Remove("FType");
int.TryParse(oType.ToString(), out int iType);
ApiAuthInfo user = Request.Properties["token"] as ApiAuthInfo;
funcList = CommonBll.CheckIsHasPower(iType, user.FID);
}
foreach (var item in inParam)
{
bool has = funcList.Contains(int.Parse(item.Key.Replace("P", "")));
outParam.Add(item.Key, has);
}
apiResult.Data = outParam;
}, apiResult, Request, inParam);
}
/// <summary>
/// 获取数据选择值
/// </summary>
[HttpPost]
public ApiResult GetDataCodeList(Dictionary<string, object> inParam)
{
ApiResult apiResult = new ApiResult();
return ExceptionHelper.TryReturnException(() =>
{
if (inParam.TryGetValue("FType", out object oType))
{
string[] typeIds = oType.ToString().Split(',');
List<TDataCode> codeList = CommonBll.GetDataCodeList(typeIds);
Dictionary<string, object> outParam = new Dictionary<string, object>();
foreach (var item in codeList.GroupBy(s => s.FType))
{
outParam.Add("FType" + item.Key, item.Select(s => new { s.FID, s.FName, s.FValue }));
}
apiResult.Data = outParam;
}
else
{
apiResult.Data = CommonBll.GetDataCodeList(null);
}
}, apiResult, Request, inParam);
}
/// <summary>
/// 修改数据值状态
/// </summary>
[HttpPost]
public ApiResult StateDataCode(Dictionary<string, object> inParam)
{
ApiResult apiResult = new ApiResult();
return ExceptionHelper.TryReturnException(() =>
{
inParam.TryGetValue("FID", out object dataId);
ApiAuthInfo user = Request.Properties["token"] as ApiAuthInfo;
apiResult.Data = CommonBll.StateDataCode(int.Parse(dataId.ToString()), user.FID);
}, apiResult, Request, inParam);
}
/// <summary>
/// 删除系统配置值
/// </summary>
[HttpPost]
public ApiResult DeleteDataCode(Dictionary<string, object> inParam)
{
ApiResult apiResult = new ApiResult();
return ExceptionHelper.TryReturnException(() =>
{
apiResult.Data = BaseBll.DeleteDataById(inParam, "TDataCode", true);
}, apiResult, Request, inParam);
}
/// <summary>
/// 设置系统配置值
/// </summary>
[HttpPost]
public ApiResult ChangeDataCode(Dictionary<string, object> inParam)
{
ApiResult apiResult = new ApiResult();
return ExceptionHelper.TryReturnException(() =>
{
ApiAuthInfo user = Request.Properties["token"] as ApiAuthInfo;
inParam.Add("FDateOpt", DateTime.Now);
inParam.Add("FUserOpt", user.FID);
if (inParam.ContainsKey("FID"))
{
apiResult.Data = BaseBll.UpdateDataModel(inParam, "TDataCode");
}
else
{
apiResult.Data = BaseBll.InsertDataModel(inParam, "TDataCode");
}
}, apiResult, Request, inParam);
}
/// <summary>
/// 获取配置集合
/// </summary>
[HttpPost]
public ApiResult GetConfigList(Dictionary<string, object> inParam)
{
ApiResult apiResult = new ApiResult();
return ExceptionHelper.TryReturnException(() =>
{
apiResult.Data = CommonBll.GetConfigList();
}, apiResult, Request, inParam);
}
/// <summary>
/// 获取系统配置值
/// </summary>
[HttpPost]
public ApiResult GetConfigValue(Dictionary<string, object> inParam)
{
ApiResult apiResult = new ApiResult();
return ExceptionHelper.TryReturnException(() =>
{
inParam.TryGetValue("FID", out object dataId);
apiResult.Data = CommonBll.GetConfigValue(int.Parse(dataId.ToString()));
}, apiResult, Request, inParam);
}
}
}

@ -0,0 +1,52 @@
using FactorySystemBll;
using FactorySystemCommon;
using FactorySystemModel.ResponseModel;
using FactorySystemModel.SqlSugarModel;
using System.Collections.Generic;
using System.Web.Http;
namespace FactorySystemApi.Controllers
{
/// <summary>
/// 工厂接口
/// </summary>
[UserLoginFilter]
public class FactoryController : BaseController<TFS_Factory>
{
private readonly FactoryBll FactoryBll = new FactoryBll();
/// <summary>
/// 初始化
/// </summary>
public FactoryController()
{
//设置可新增、修改字段
InsertField = UpdateField = "FName,FCode,FType,FFactoryID,FChargePerson,FPhone,FState,FEditUser,FEditDate";
}
/// <summary>
/// 获取工厂集合
/// </summary>
[HttpPost]
public ApiResult GetFactoryList()
{
ApiResult apiResult = new ApiResult();
return ExceptionHelper.TryReturnException(() =>
{
apiResult.Data = FactoryBll.GetFactoryList();
}, apiResult, Request);
}
/// <summary>
/// 验证工厂代码是否重复
/// </summary>
[HttpPost]
public ApiResult CheckHasCode(Dictionary<string, object> insertData)
{
ApiResult apiResult = new ApiResult();
return ExceptionHelper.TryReturnException(() =>
{
apiResult.Data = FactoryBll.CheckHasCode(insertData);
}, apiResult, Request);
}
}
}

@ -0,0 +1,20 @@
using FactorySystemModel.SqlSugarModel;
namespace FactorySystemApi.Controllers
{
/// <summary>
/// 视图字段关系接口(入库)
/// </summary>
[UserLoginFilter]
public class FieldController : BaseController<TFS_FieldInfo>
{
/// <summary>
/// 初始化
/// </summary>
public FieldController()
{
//设置可修改字段
UpdateField = "";
}
}
}

@ -0,0 +1,234 @@
using FactorySystemBll;
using FactorySystemCommon;
using FactorySystemModel.BusinessModel;
using FactorySystemModel.ResponseModel;
using FactorySystemModel.SqlSugarModel;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Reflection;
using System.Web.Http;
using FactorySystemModel.EnumModel;
using FactorySystemModel.RequestModel;
namespace FactorySystemApi.Controllers
{
/// <summary>
/// 配方接口
/// </summary>
[UserLoginFilter]
public class FormulaController : BaseController<TFS_Formula>
{
/// <summary>
/// 数据处理层
/// </summary>
public readonly FormulaBll FormulaBll = new FormulaBll();
/// <summary>
/// 初始化
/// </summary>
public FormulaController()
{
//设置可修改字段
UpdateField = "";
}
/// <summary>
/// 分业请求
/// </summary>
[HttpPost]
public ApiResult GetFormulaPageList(FormulaQuery fq)
{
ApiResult apiResult = new ApiResult();
return ExceptionHelper.TryReturnException(() =>
{
apiResult.Data = new
{
List = FormulaBll.GetList(fq, out var totalNumber),
Total = totalNumber
};
}, apiResult, Request);
}
/// <summary>
/// 对接配方数据(对方写入)
/// </summary>
[HttpPost]
public ApiResult DockingRecipeData(Dictionary<string, object> inParam)
{
ApiResult apiResult = new ApiResult();
apiResult.Data = 0;
return ExceptionHelper.TryReturnException(() =>
{
if (inParam == null)
{
apiResult.Error("未接收到参数");
}
else
{
List<TFS_FieldInfo> fieldList = BaseBll.GetFileInfoList((int)Constant.FieldInfoType.);
TFS_Formula formula = new TFS_Formula();
List<PropertyInfo> propertys = formula.GetType().GetProperties().ToList();
foreach (var field in fieldList)
{
PropertyInfo temp = propertys.Find(s => s.Name == field.FColumnFIeld);
if (temp != null) temp.SetValue(formula, GetValueByName(inParam, field.FFieldName, field.FDefault));
}
if (string.IsNullOrEmpty(formula.FPlmCode))
{
apiResult.Error("FPlmCode不能为空");
}
else if (string.IsNullOrEmpty(formula.FVersionCode))
{
apiResult.Error("FVersionCode不能为空");
}
else if (string.IsNullOrEmpty(formula.FName))
{
apiResult.Error("FName不能为空");
}
else if (string.IsNullOrEmpty(formula.FType))
{
apiResult.Error("FType不能为空");
}
/**
* 20230401
*
* FConversionPersonnel
* BOM FBomVersionCode
* **/
else if (string.IsNullOrEmpty(formula.FConversionPersonnel))
{
apiResult.Error("FConversionPersonnel不能为空");
}
else if (string.IsNullOrEmpty(formula.FBomVersionCode))
{
apiResult.Error("FBomVersionCode不能为空");
}
else
{
int userId = -1;
if (Request.Properties.ContainsKey("token"))
{
userId = Request.Properties["token"] is ApiAuthInfo user ? user.FID : userId;
apiResult.Data = FormulaBll.DockingRecipeData(new List<TFS_Formula>() { formula }, userId);
}
else
{
apiResult.Error("token信息不存在");
}
}
}
}, apiResult, Request, inParam);
}
/// <summary>
/// 对接SAP配方同步
/// </summary>
[HttpPost]
public ApiResult DockSapFormula()
{
ApiResult apiResult = new ApiResult
{
Data = 0
};
int result = 0;
return ExceptionHelper.TryReturnException(() =>
{
Sap_Formula.dt_pp062_reqDATA[] reqDatas = new Sap_Formula.dt_pp062_reqDATA[1] {
new Sap_Formula.dt_pp062_reqDATA()
{
SOURCESYS = "MCS",
TARGETSYS = "SAP"
}
};
List<TFS_Factory> factoryList = FactoryBll.GetFactoryList();
if (factoryList.Count > 0)
{
ApiAuthInfo user = Request.Properties["token"] as ApiAuthInfo;
Sap_Formula.si_pp062_bc_senderService sapService = new Sap_Formula.si_pp062_bc_senderService()
{
Credentials = new System.Net.NetworkCredential()
{
UserName = AppSettingsHelper.GetAppSettingVal("Sap_UserName"),
Password = AppSettingsHelper.GetAppSettingVal("Sap_Password")
}
};
foreach (TFS_Factory factory in factoryList)
{
reqDatas[0].UPDATETIME = DateTime.Now.ToString("yyyyMMddHHmmss");
reqDatas[0].WERKS = factory.FCode;
try
{
Sap_Formula.dt_pp062_res resData = sapService.si_pp062_bc_sender(reqDatas);
ExceptionHelper.AddSystemJournal(Request, reqDatas, resData);
List<TFS_Formula> formulaList = new List<TFS_Formula>();
if (resData != null && resData.DATA != null && resData.DATA.Length > 0)
{
foreach (var item in resData.DATA)
{
formulaList.Add(new TFS_Formula()
{
FFactoryID = factory.FID,
FFactoryCode = factory.FCode,
FName = string.IsNullOrEmpty(item.MAKTX) ? "" : item.MAKTX,
FTestCode = string.IsNullOrEmpty(item.MATNR) ? "" : item.MATNR,
FAddDate = DateTime.Now,
FEditUser = user.FID
});
}
}
if (formulaList.Count > 0) result += FormulaBll.DockSapFormula(formulaList);
}
catch (Exception ex)
{
ExceptionHelper.AddSystemJournal(Request, reqDatas, ex.Message);
}
}
}
apiResult.Data = result;
}, apiResult, Request, null);
}
#region 内部方法
/// <summary>
/// 模板上传处理(重构父方法)
/// </summary>
protected override object CheckUploadFile(List<string> fileList, int funcType, int userId)
{
if (funcType <= 1)
{
List<TFS_Formula> formulas = new List<TFS_Formula>();
List<TFS_FieldInfo> fieldList = BaseBll.GetFileInfoList((int)Constant.FieldInfoType.);
List<PropertyInfo> formulaProp = typeof(TFS_Formula).GetTypeInfo().GetProperties().ToList();
PropertyInfo temp = null;
foreach (string filePath in fileList)
{
DataTable dt = NPOIHelper.ImportExceltoDt(filePath);
List<string> items = new List<string>();
for (int i = 0; i < dt.Columns.Count; i++)
{
items.Add(dt.Columns[i].ColumnName);
}
foreach (DataRow dr in dt.Rows)
{
TFS_Formula formula = new TFS_Formula();
foreach (var field in fieldList)
{
if ((temp = formulaProp.Find(s => s.Name.Equals(field.FColumnFIeld))) != null)
{
temp.SetValue(formula, GetValueByName(dr, items, field.FFieldName, field.FDefault));
}
}
formulas.Add(formula);
}
}
return FormulaBll.DockingRecipeData(formulas, userId);
}
return fileList;
}
#endregion
}
}

@ -0,0 +1,490 @@
using FactorySystemBll;
using FactorySystemCommon;
using FactorySystemModel.BusinessModel;
using FactorySystemModel.ResponseModel;
using FactorySystemModel.SqlSugarModel;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Reflection;
using System.Web.Http;
using FactorySystemModel.EnumModel;
using System.IO;
namespace FactorySystemApi.Controllers
{
/// <summary>
/// 物料接口
/// </summary>
[UserLoginFilter]
public class MaterialController : BaseController<TFS_Material>
{
/// <summary>
/// 数据处理层
/// </summary>
public readonly MaterialBll MaterialBll = new MaterialBll();
/// <summary>
/// 初始化
/// </summary>
public MaterialController()
{
//设置可修改字段
UpdateField = "FSuccedaneumID,FSuccedaneumInfo,FSuccedaneumType,FSuccedaneumCode,FFuProductsID,FFuProductsInfo,FFuProductsType,FFuProductsCode,FFuProductsCount";
}
/// <summary>
/// 对接SAP物料同步
/// </summary>
[HttpPost]
public ApiResult DockSapMaterial()
{
ApiResult apiResult = new ApiResult
{
Data = 0
};
int result = 0;
return ExceptionHelper.TryReturnException(() =>
{
List<TFS_Factory> factoryList = FactoryBll.GetFactoryList();
if (factoryList.Count > 0)
{
ApiAuthInfo user = Request.Properties["token"] as ApiAuthInfo;
Sap_Material1.si_mm100_mcs_senderService sapService = new Sap_Material1.si_mm100_mcs_senderService()
{
Credentials = new System.Net.NetworkCredential()
{
UserName = AppSettingsHelper.GetAppSettingVal("Sap_UserName"),
Password = AppSettingsHelper.GetAppSettingVal("Sap_Password")
}
};
Sap_Material1.dt_mm100_req reqDatas = new Sap_Material1.dt_mm100_req();
//委外在前面
factoryList = factoryList.OrderBy(s => s.FType).ToList();
foreach (TFS_Factory factory in factoryList)
{
reqDatas.WERKS = factory.FCode;
try
{
Sap_Material1.dt_mm100_res resData = sapService.si_mm100_mcs_sender(reqDatas);
ExceptionHelper.AddSystemJournal(Request, reqDatas, resData);
List<TFS_Material> materialList = new List<TFS_Material>();
if (resData != null && resData.DATA != null && resData.DATA.Length > 0)
{
foreach (var item in resData.DATA)
{
string name = string.IsNullOrEmpty(item.EXTWG) ? item.MAKTX : item.EXTWG;
materialList.Add(new TFS_Material()
{
FFactoryID = factory.FID,
FFactoryCode = factory.FCode,
FName = string.IsNullOrEmpty(name) ? "" : item.MAKTX,
FCode = string.IsNullOrEmpty(item.MATNR) ? "" : item.MATNR,
FTestCode = string.IsNullOrEmpty(item.BISMT) ? "" : item.BISMT,
FBaseUnit = string.IsNullOrEmpty(item.MEINS) ? "" : item.MEINS,
FMaterialGroup = string.IsNullOrEmpty(item.MATKL) ? "" : item.MATKL,
FAddDate = DateTime.Now,
FEditUser = user.FID,
FType = string.IsNullOrEmpty(item.ZCATEG) ? "" : item.ZCATEG,//产品分类
FMaterialType = string.IsNullOrEmpty(item.MTART) ? "" : item.MTART,//物料类型
});
}
}
if (materialList.Count > 0) result += MaterialBll.DockSapMaterial(materialList, user.FID);
}
catch (Exception ex)
{
ExceptionHelper.AddSystemJournal(Request, reqDatas, ex.Message);
}
}
apiResult.Data = result;
}
}, apiResult, Request, null);
}
/// <summary>
/// 对接物料数据(对方写入)
/// </summary>
[HttpPost]
public ApiResult DockingMaterialData(Dictionary<string, object> inParam)
{
ApiResult apiResult = new ApiResult();
return ExceptionHelper.TryReturnException(() =>
{
if (inParam == null)
{
apiResult.Error("未接收到参数");
}
else
{
List<TFS_FieldInfo> fieldList = BaseBll.GetFileInfoList((int)Constant.FieldInfoType.);
TFS_Material material = new TFS_Material();
List<PropertyInfo> propertys = material.GetType().GetProperties().ToList();
foreach (var field in fieldList)
{
PropertyInfo temp = propertys.Find(s => s.Name == field.FColumnFIeld);
if (temp != null) temp.SetValue(material, GetValueByName(inParam, field.FFieldName, field.FDefault));
}
if (string.IsNullOrEmpty(material.FCode))
{
apiResult.Error("FCode不能为空");
}
else if (string.IsNullOrEmpty(material.FName))
{
apiResult.Error("FName不能为空");
}
else if (string.IsNullOrEmpty(material.FMaterialGroup))
{
apiResult.Error("FMaterialGroup不能为空");
}
else
{
int userId = -1;
if (Request.Properties.ContainsKey("token"))
{
userId = Request.Properties["token"] is ApiAuthInfo user ? user.FID : userId;
List<PropertyInfo> mainProp = typeof(TFS_Material).GetTypeInfo().GetProperties().ToList();
apiResult.Data = MaterialBll.DockingRecipeData(new List<TFS_Material>() { material }, mainProp, userId);
}
else
{
apiResult.Error("token信息不存在");
}
}
}
}, apiResult, Request, inParam);
}
/// <summary>
/// 对接MDM获取物料PLM码
/// </summary>
[HttpPost]
public ApiResult DockMDMGetPlmCode(Dictionary<string, object> inParam)
{
ApiResult apiResult = new ApiResult();
return ExceptionHelper.TryReturnException(() =>
{
apiResult.Data = GetMdmCode(inParam);
}, apiResult, Request, inParam);
}
/// <summary>
/// 物料查询接口(对方查询)
/// </summary>
[HttpPost]
public ApiResult SearchMaterialData(Dictionary<string, object> inParam)
{
ApiResult apiResult = new ApiResult();
return ExceptionHelper.TryReturnException(() =>
{
if (inParam == null || inParam.Count < 0)
{
apiResult.Error("未接收到参数");
}
else if (inParam.ContainsKey("FType"))
{
apiResult.Data = MaterialBll.SearchMaterialData2(inParam);
}
else
{
apiResult.Error("缺少FType参数");
}
}, apiResult, Request, inParam);
}
/// <summary>
/// 导出视图
/// </summary>
/// <returns></returns>
public ApiResult DownMateialView(Dictionary<string,object> inParam)
{
ApiResult apiResult = new ApiResult();
return ExceptionHelper.TryReturnException(() =>
{
if (inParam.ContainsKey("FID"))
{
inParam.TryGetValue("FViewType", out object objType);
//string FType = null == objType ? Constant.TeamViewType.物料视图.ToString() : objType.ToString();
//string selectSql = "", joinSql = "", whereSql = string.Format("TFS_FTeamwork.FID={0} ", inParam["FTeamID"]);
string basePath = AppDomain.CurrentDomain.BaseDirectory.Trim('\\');
string savePath = basePath + string.Format("\\File\\Temp\\{0}_{1}\\", inParam["FID"], "View");
if (!Directory.Exists(savePath)) Directory.CreateDirectory(savePath);
string tempPath = savePath.Replace("\\File\\Temp\\", "\\File\\View\\");
if (!Directory.Exists(tempPath)) Directory.CreateDirectory(tempPath);
savePath += ".xlsx";
bool hasFinish = inParam.ContainsKey("FFinish");
if (hasFinish) savePath = savePath.Replace("\\File\\Temp\\", "\\File\\View\\");
if (!File.Exists(savePath) || !hasFinish)
{
MaterialBll.CreateExeclFile(inParam["FName"].ToString(), savePath, "", "", "", inParam["FID"].ToString(), "");
}
else
{
File.Delete(basePath + string.Format("\\File\\Temp\\{0}_{1}\\", inParam["FID"], "View"));
MaterialBll.CreateExeclFile(inParam["FName"].ToString(), savePath, "", "", "", inParam["FID"].ToString(), "");
}
string url = Request.RequestUri.AbsoluteUri.Replace(Request.RequestUri.AbsolutePath, "") + savePath.Replace(basePath, "").Replace("\\", "/").Replace(".xlsx", inParam["FName"].ToString() + ".xlsx");
apiResult.Data = url;
}
else
{
apiResult.Error("视图信息获取失败");
}
}, apiResult, Request, inParam);
}
/// <summary>
/// 导出SAP视图
/// </summary>
/// <returns></returns>
public ApiResult DownSAP(Dictionary<string, object> inParam)
{
ApiResult apiResult = new ApiResult();
return ExceptionHelper.TryReturnException(() =>
{
if (inParam.ContainsKey("FID"))
{
inParam.TryGetValue("FViewType", out object objType);
//string FType = null == objType ? Constant.TeamViewType.物料视图.ToString() : objType.ToString();
//string selectSql = "", joinSql = "", whereSql = string.Format("TFS_FTeamwork.FID={0} ", inParam["FTeamID"]);
string basePath = AppDomain.CurrentDomain.BaseDirectory.Trim('\\');
string savePath = basePath + string.Format("\\File\\Temp\\{0}_{1}\\", inParam["FID"], "SAP");
if (!Directory.Exists(savePath)) Directory.CreateDirectory(savePath);
string tempPath = savePath.Replace("\\File\\Temp\\", "\\File\\View\\");
if (!Directory.Exists(tempPath)) Directory.CreateDirectory(tempPath);
savePath += ".xlsx";
bool hasFinish = inParam.ContainsKey("FFinish");
if (hasFinish) savePath = savePath.Replace("\\File\\Temp\\", "\\File\\View\\");
if (!File.Exists(savePath) || !hasFinish)
{
MaterialBll.CreateExeclFileSAP(inParam["FName"].ToString(), savePath, "", "", "", inParam["FID"].ToString(), "");
}
else
{
File.Delete(basePath + string.Format("\\File\\Temp\\{0}_{1}\\", inParam["FID"], "SAP"));
MaterialBll.CreateExeclFileSAP(inParam["FName"].ToString(), savePath, "", "", "", inParam["FID"].ToString(), "");
}
string url = Request.RequestUri.AbsoluteUri.Replace(Request.RequestUri.AbsolutePath, "") + savePath.Replace(basePath, "").Replace("\\", "/").Replace(".xlsx", inParam["FName"].ToString() + ".xlsx");
apiResult.Data = url;
}
else
{
apiResult.Error("物料信息获取失败");
}
}, apiResult, Request, inParam);
}
/// <summary>
///
/// </summary>
/// <param name="inParam"></param>
/// <returns></returns>
public ApiResult DownViewAll(Dictionary<string, object> inParam)
{
ApiResult apiResult = new ApiResult();
return ExceptionHelper.TryReturnException(() =>
{
string str = inParam["FType"].ToString() == "1" ? "视图" : "物料视图";
inParam.TryGetValue("FViewType", out object objType);
//string FType = null == objType ? Constant.TeamViewType.物料视图.ToString() : objType.ToString();
//string selectSql = "", joinSql = "", whereSql = string.Format("TFS_FTeamwork.FID={0} ", inParam["FTeamID"]);
string basePath = AppDomain.CurrentDomain.BaseDirectory.Trim('\\');
string savePath = basePath + string.Format("\\File\\Temp\\{0}\\", str);
if (!Directory.Exists(savePath)) Directory.CreateDirectory(savePath);
string tempPath = savePath.Replace("\\File\\Temp\\", "\\File\\View\\");
if (!Directory.Exists(tempPath)) Directory.CreateDirectory(tempPath);
savePath += ".xlsx";
bool hasFinish = inParam.ContainsKey("FFinish");
if (hasFinish) savePath = savePath.Replace("\\File\\Temp\\", "\\File\\View\\");
if (!File.Exists(savePath) || !hasFinish)
{
MaterialBll.CreateExeclFileALL(inParam["FType"].ToString(), savePath);
}
else
{
File.Delete(basePath + string.Format("\\File\\Temp\\{0}\\", "", str));
MaterialBll.CreateExeclFileALL(inParam["FType"].ToString(), savePath);
}
string url = Request.RequestUri.AbsoluteUri.Replace(Request.RequestUri.AbsolutePath, "") + savePath.Replace(basePath, "").Replace("\\", "/").Replace(".xlsx", str+".xlsx");
apiResult.Data = url;
}, apiResult, Request, inParam);
}
#region 内部方法
/// <summary>
/// 模板上传处理(重构父方法)
/// </summary>
protected override object CheckUploadFile(List<string> fileList, int funcType, int userId)
{
//替代料导入、副产物导入
List<TFS_Material> mainList;
List<PropertyInfo> mainProp;
if (funcType == 2 || funcType == 3)
{
GetFuMaterialFromFile(fileList, funcType, out mainList, out mainProp, out List<TFS_FieldInfo> fieldList);
if (funcType == 3) return MaterialBll.InsertBatchFuMaterialData(mainList, mainProp, fieldList, userId);
else return MaterialBll.InsertBatchTiMaterialData(mainList, mainProp, fieldList, userId);
}
else if (funcType == 4)
{
//物料信息补全导入
GetMaterialInfoFromFile(fileList, out mainList, out List<TFS_MaterialInfo> infoList, out mainProp, out List<PropertyInfo> childProp, out List<TFS_FieldInfo> fieldList);
return MaterialBll.InsertBatchInfoMaterialData(mainList, infoList, mainProp, childProp, fieldList, userId);
}
else if (funcType <= 1)
{
//物料导入
GetMaterialFromFile(fileList, out mainList, out List<TFS_ViewMaterial> childList, out mainProp, out List<PropertyInfo> childProp);
return MaterialBll.DockingRecipeData(mainList, mainProp, userId) + MaterialBll.DockingRecipeData(childList, childProp, userId);
}
return fileList;
}
/// <summary>
/// 信息补全模板
/// </summary>
private void GetMaterialInfoFromFile(List<string> fileList, out List<TFS_Material> mainList, out List<TFS_MaterialInfo> infoList,
out List<PropertyInfo> mainProp, out List<PropertyInfo> childProp, out List<TFS_FieldInfo> fieldList)
{
mainList = new List<TFS_Material>();
infoList = new List<TFS_MaterialInfo>();
fieldList = BaseBll.GetFileInfoList((int)Constant.FieldInfoType.);
mainProp = typeof(TFS_Material).GetTypeInfo().GetProperties().ToList();
childProp = typeof(TFS_MaterialInfo).GetTypeInfo().GetProperties().ToList();
PropertyInfo temp = null;
foreach (string filePath in fileList)
{
DataTable dt = NPOIHelper.ImportExceltoDt(filePath);
List<string> items = new List<string>();
for (int i = 0; i < dt.Columns.Count; i++)
{
items.Add(dt.Columns[i].ColumnName);
}
foreach (DataRow dr in dt.Rows)
{
TFS_Material main = new TFS_Material();
TFS_MaterialInfo child = new TFS_MaterialInfo();
foreach (var field in fieldList)
{
string value = GetValueByName(dr, items, field.FFieldName, field.FDefault);
if ((temp = mainProp.Find(s => s.Name.Equals(field.FColumnFIeld))) != null) temp.SetValue(main, value);
if ((temp = childProp.Find(s => s.Name.Equals(field.FColumnFIeld))) != null) temp.SetValue(child, value);
}
if (!string.IsNullOrEmpty(main.FCode))
{
mainList.Add(main);
infoList.Add(child);
}
}
}
}
/// <summary>
/// 根据导入文件生成两个表集合
/// </summary>
private void GetMaterialFromFile(List<string> fileList, out List<TFS_Material> mainList, out List<TFS_ViewMaterial> childList, out List<PropertyInfo> mainProp, out List<PropertyInfo> childProp)
{
mainList = new List<TFS_Material>();
childList = new List<TFS_ViewMaterial>();
List<TFS_FieldInfo> fieldList = BaseBll.GetFileInfoList((int)Constant.FieldInfoType.);
mainProp = typeof(TFS_Material).GetTypeInfo().GetProperties().ToList();
childProp = typeof(TFS_ViewMaterial).GetTypeInfo().GetProperties().ToList();
PropertyInfo temp = null;
foreach (string filePath in fileList)
{
DataTable dt = NPOIHelper.ImportExceltoDt(filePath);
List<string> items = new List<string>();
for (int i = 0; i < dt.Columns.Count; i++)
{
items.Add(dt.Columns[i].ColumnName);
}
foreach (DataRow dr in dt.Rows)
{
//物料表
TFS_Material main = new TFS_Material();
//视图表
TFS_ViewMaterial view = new TFS_ViewMaterial()
{
FViewType = (int)Constant.ViewType.
};
foreach (var field in fieldList)
{
string value = GetValueByName(dr, items, field.FFieldName, field.FDefault);
if ((temp = mainProp.Find(s => s.Name.Equals(field.FColumnFIeld))) != null)
{
temp.SetValue(main, value);
}
if ((temp = childProp.Find(s => s.Name.Equals(field.FColumnFIeld))) != null)
{
temp.SetValue(view, value);
}
}
if (!string.IsNullOrEmpty(main.FCode))
{
mainList.Add(main);
childList.Add(view);
}
}
}
}
/// <summary>
/// 根据导入文件生成副产物关系表
/// </summary>
private void GetFuMaterialFromFile(List<string> fileList, int funcType, out List<TFS_Material> mainList, out List<PropertyInfo> mainProp,
out List<TFS_FieldInfo> fieldList)
{
mainList = new List<TFS_Material>();
fieldList = BaseBll.GetFileInfoList(funcType == 2 ? (int)Constant.FieldInfoType. : (int)Constant.FieldInfoType.);
mainProp = typeof(TFS_Material).GetTypeInfo().GetProperties().ToList();
PropertyInfo temp = null;
foreach (string filePath in fileList)
{
DataTable dt = NPOIHelper.ImportExceltoDt(filePath);
List<string> items = new List<string>();
for (int i = 0; i < dt.Columns.Count; i++)
{
items.Add(dt.Columns[i].ColumnName);
}
foreach (DataRow dr in dt.Rows)
{
TFS_Material main = new TFS_Material();
foreach (var field in fieldList)
{
string value = GetValueByName(dr, items, field.FFieldName, field.FDefault);
if ((temp = mainProp.Find(s => s.Name.Equals(field.FColumnFIeld))) != null) temp.SetValue(main, value);
}
if (!string.IsNullOrEmpty(main.FCode))
{
if (funcType != 2 && !string.IsNullOrEmpty(main.FFuProductsCode))
{
mainList.Add(main);
}
else if (funcType == 2 && !string.IsNullOrEmpty(main.FSuccedaneumCode))
{
mainList.Add(main);
}
}
}
}
}
#endregion
}
}

@ -0,0 +1,136 @@
using FactorySystemBll;
using FactorySystemCommon;
using FactorySystemModel.BusinessModel;
using FactorySystemModel.ResponseModel;
using FactorySystemModel.SqlSugarModel;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Reflection;
using System.Web.Http;
using FactorySystemModel.EnumModel;
namespace FactorySystemApi.Controllers
{
/// <summary>
/// 物料分类接口
/// </summary>
[UserLoginFilter]
public class MaterialTypeController : BaseController<TFS_MaterialType>
{
/// <summary>
/// 数据处理层
/// </summary>
public readonly MaterialTypeBll MaterialTypeBll = new MaterialTypeBll();
/// <summary>
/// 初始化
/// </summary>
public MaterialTypeController()
{
}
/// <summary>
/// 获取信息数据
/// </summary>
[HttpPost]
public ApiResult GetInfoData(Dictionary<string, object> inParam)
{
ApiResult apiResult = new ApiResult();
return ExceptionHelper.TryReturnException(() =>
{
int dataId = int.Parse(inParam["FDataID"].ToString());
int dataType = int.Parse(inParam["FType"].ToString());
string sqlWhere = string.Format("FDataID={0} and FType={1}", dataId, dataType);
apiResult.Data = BaseBll.GetTempModel<TFS_MaterialInfo>(sqlWhere);
}, apiResult, Request, inParam);
}
/// <summary>
/// 修改信息数据
/// </summary>
[HttpPost]
public ApiResult ChangeInfoData(Dictionary<string, object> inParam)
{
ApiResult apiResult = new ApiResult();
return ExceptionHelper.TryReturnException(() =>
{
inParam.Remove("FAddUser");
inParam.Remove("FAddDate");
inParam.Remove("FEditUser");
inParam.Remove("FEditDate");
ApiAuthInfo user = Request.Properties["token"] as ApiAuthInfo;
if (inParam.ContainsKey("FID"))
{
inParam.Add("FEditUser", user.FID);
inParam.Add("FEditDate", DateTime.Now);
apiResult.Data = BaseBll.UpdateDataModel(inParam, "TFS_MaterialInfo");
}
else
{
inParam.Add("FEditUser", user.FID);
inParam.Add("FAddDate", DateTime.Now);
apiResult.Data = BaseBll.InsertDataModel(inParam, "TFS_MaterialInfo");
}
}, apiResult, Request, inParam);
}
/// <summary>
/// 模板上传处理(重构父方法)
/// </summary>
protected override object CheckUploadFile(List<string> fileList, int funcType, int userId)
{
if (funcType == 1)
{
GetMaterialTypeFromFile(fileList, out List<TFS_MaterialInfo> mainList, out List<PropertyInfo> mainProp);
return MaterialTypeBll.InsertBatchMaterialTypeData(mainList, mainProp, userId);
}
return fileList;
}
/// <summary>
/// 获取分类信息
/// </summary>
private void GetMaterialTypeFromFile(List<string> fileList, out List<TFS_MaterialInfo> mainList, out List<PropertyInfo> mainProp)
{
mainList = new List<TFS_MaterialInfo>();
List<TFS_FieldInfo> fieldList = BaseBll.GetFileInfoList((int)Constant.FieldInfoType.);
mainProp = typeof(TFS_MaterialInfo).GetTypeInfo().GetProperties().ToList();
PropertyInfo temp = null;
foreach (string filePath in fileList)
{
DataTable dt = NPOIHelper.ImportExceltoDt(filePath);
List<string> items = new List<string>();
for (int i = 0; i < dt.Columns.Count; i++)
{
items.Add(dt.Columns[i].ColumnName);
}
foreach (DataRow dr in dt.Rows)
{
TFS_MaterialInfo main = new TFS_MaterialInfo();
foreach (TFS_FieldInfo field in fieldList)
{
string value = GetValueByName(dr, items, field.FFieldName, field.FDefault);
if ((temp = mainProp.Find(s => s.Name.Equals(field.FColumnFIeld))) != null) temp.SetValue(main, value);
}
{
//一二级分类处理
if (string.IsNullOrEmpty(main.FQualityTest2)) main.FQualityTest2 = "";
TFS_FieldInfo type1 = fieldList.Find(s => s.FColumnFIeld == "FTypeName1");
string name = type1 != null ? GetValueByName(dr, items, type1.FFieldName, type1.FDefault) : "";
if (string.IsNullOrEmpty(name)) continue;
main.FQualityTest2 += "&$&||&$&" + name;
type1 = fieldList.Find(s => s.FColumnFIeld == "FTypeName2");
name = type1 != null ? GetValueByName(dr, items, type1.FFieldName, type1.FDefault) : "";
if (string.IsNullOrEmpty(name)) continue;
main.FQualityTest2 += "&$&||&$&" + name;
}
mainList.Add(main);
}
}
}
}
}

@ -0,0 +1,55 @@
using System.Collections.Generic;
using System.Web.Http;
using FactorySystemBll;
using FactorySystemCommon;
using FactorySystemModel.BusinessModel;
using FactorySystemModel.ResponseModel;
namespace FactorySystemApi.Controllers
{
/// <summary>
/// 操作日志
/// </summary>
[UserLoginFilter]
public class OperateLogController : ApiController
{
private readonly OperateLogBll _operateLogBll = new OperateLogBll();
/// <summary>
/// 获取分页
/// </summary>
[HttpPost]
public ApiResult GetPageList(Dictionary<string, object> inParam)
{
var apiResult = new ApiResult();
return ExceptionHelper.TryReturnException(() =>
{
apiResult.Data = new
{
List = _operateLogBll.GetPageList(inParam, out int totalCount),
Total = totalCount
};
}, apiResult, Request);
}
/// <summary>
/// 保存操作日志
/// </summary>
[HttpPost]
public ApiResult Save(Dictionary<string, object> inParams)
{
var teamId = int.Parse(inParams["teamId"].ToString());
var type = int.Parse(inParams["type"].ToString());
var desc = inParams["desc"].ToString();
var apiResult = new ApiResult();
return ExceptionHelper.TryReturnException(() =>
{
if (Request.Properties["token"] is ApiAuthInfo user)
{
OperateLogBll.Add(teamId, type, desc, user.FID);
}
}, apiResult, Request);
}
}
}

@ -0,0 +1,298 @@
using FactorySystemBll;
using FactorySystemCommon;
using FactorySystemModel.BusinessModel;
using FactorySystemModel.EnumModel;
using FactorySystemModel.ResponseModel;
using FactorySystemModel.SqlSugarModel;
using Newtonsoft.Json;
using SqlSugar.Extensions;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Reflection;
using System.Web.Http;
namespace FactorySystemApi.Controllers
{
/// <summary>
/// 包材接口
/// </summary>
[UserLoginFilter]
public class PackageController : BaseController<TFS_PackageMain>
{
private readonly PackageBll PackageBll = new PackageBll();
/// <summary>
/// 初始化
/// </summary>
public PackageController()
{
//设置可新增、修改字段
InsertField = UpdateField = "FFactory,FCode,FSpecs,FSize,FNetWeight,FGrossWeight,FEditUser,FEditDate";
}
/// <summary>
/// 获取子项集合
/// </summary>
[HttpPost]
public ApiResult GetPackageChildList(Dictionary<string, object> pageParam)
{
return GetTPageList<TFS_PackageChild>(pageParam);
}
/// <summary>
/// 删除子项信息
/// </summary>
[HttpPost]
public ApiResult DeletePackageChild(Dictionary<string, object> deleteParam)
{
ApiResult apiResult = new ApiResult();
return ExceptionHelper.TryReturnException(() =>
{
apiResult.Data = BaseBll.DeleteDataById(deleteParam, "TFS_PackageChild");
}, apiResult, Request, deleteParam);
}
/// <summary>
/// 不补充包材信息
/// </summary>
[HttpPost]
public ApiResult NoSupplyPackageChild(Dictionary<string, object> inParam)
{
ApiResult apiResult = new ApiResult();
return ExceptionHelper.TryReturnException(() =>
{
apiResult.Data = PackageBll.NoSupplyPackageChild(inParam);
}, apiResult, Request, inParam);
}
/// <summary>
/// 获取包材信息
/// </summary>
[HttpPost]
public ApiResult GetPackageInfo(Dictionary<string, object> inParam)
{
ApiResult apiResult = new ApiResult();
return ExceptionHelper.TryReturnException(() =>
{
inParam.TryGetValue("FTeamID", out object objTeamId);
apiResult.Data = PackageBll.GetPackageInfo(int.Parse(objTeamId.ToString()));
}, apiResult, Request, inParam);
}
/// <summary>
/// 操作包材信息(包含主子)
/// </summary>
[HttpPost]
public ApiResult UpdatePackageData(Dictionary<string, object> inParam)
{
ApiResult apiResult = new ApiResult();
int mainId = -1;
return ExceptionHelper.TryReturnException(() =>
{
ApiAuthInfo user = Request.Properties["token"] as ApiAuthInfo;
if (inParam.ContainsKey("FEditUser")) inParam.Remove("FEditUser");
inParam.Add("FEditUser", user.FID);
// 20230404 需求变更:增加包材新增、修改入口(自包材清单)
if (inParam.ContainsKey("FOperateType"))
{
mainId = UpdatePackage(inParam);
}
else
{
mainId = PackageBll.UpdatePackageData(inParam);
if (mainId > 0 && inParam.TryGetValue("FChild", out object childStr))
{
List<TFS_PackageChild> childList = JsonConvert.DeserializeObject<List<TFS_PackageChild>>(childStr.ToString());
if (childList.Count > 0)
{
if (childList[0].FID <= 0)
{
inParam.Remove("FID");
inParam.Add("FID", mainId);
PackageBll.InsertChildData(inParam, childList);
}
//当都有子项代码的时候则完成
if (childList.Find(s => string.IsNullOrEmpty(s.FCode)) == null)
{
PackageBll.TaskCompleted(inParam);
}
}
}
}
apiResult.Data = mainId;
}, apiResult, Request, inParam);
}
/**
* 20230404
*
*
* FOperateType1
* **/
private int UpdatePackage(Dictionary<string, object> inParam)
{
object oOperateType;
string sOperateType;
int mainId = -1;
inParam.TryGetValue("FOperateType", out oOperateType);
sOperateType = oOperateType.ToString();
if ("1".Equals(sOperateType))
{
mainId = PackageBll.UpdatePackage(inParam);
inParam.Remove("FID");
inParam.Add("FID", mainId);
if (mainId > 0 && inParam.TryGetValue("FChild", out object childStr))
{
List<TFS_PackageChild> childList = JsonConvert.DeserializeObject<List<TFS_PackageChild>>(childStr.ToString());
List<TFS_PackageChild> oldChildren = null;
List<TFS_PackageChild> newChildren = null;
if (childList.Count > 0)
{
// 将子项列表拆分成新旧两个列表
// 当FID > 0时判断为已存在的子项
oldChildren = childList.Where(o => o.FID > 0).ToList();
// 当FID <= 0时判断为新的子项
newChildren = childList.Where(n => n.FID <= 0).ToList();
if (oldChildren != null && oldChildren.Count > 0)
{
PackageBll.UpdatePackageChild(inParam, oldChildren);
}
if (newChildren != null && newChildren.Count > 0)
{
PackageBll.InsertPackageChild(inParam, newChildren);
}
}
}
}
return mainId;
}
/// <summary>
/// 对接子项代码
/// </summary>
[HttpPost]
public ApiResult DockMDMCode(Dictionary<string, object> inParam)
{
ApiResult apiResult = new ApiResult();
return ExceptionHelper.TryReturnException(() =>
{
apiResult.Data = -1;
List<TFS_PackageChild> childList = JsonConvert.DeserializeObject<List<TFS_PackageChild>>(inParam["FList"].ToString());
if (childList != null && childList.Count > 0)
{
var tempList2 = childList.Where(s => s.FMaterialID > 0).ToList();
childList = childList.Where(s => s.FMaterialID < 0).ToList();
foreach (var item in childList)
{
Dictionary<string, object> temp = new Dictionary<string, object>();
temp.Add("FName", item.FName);
temp.Add("FGroup", item.FGroup);
temp.Add("FWeightUnit", item.FUnit);
temp.Add("FType", "ZMAT");
item.FCode = GetMdmCode(temp);
}
foreach (var item in tempList2)
{
Dictionary<string, object> temp = new Dictionary<string, object>();
temp.Add("FName", item.FName);
temp.Add("FGroup", item.FGroup);
temp.Add("FWeightUnit", item.FUnit);
temp.Add("FType", "ZMAT");
item.FCode = item.FCode;
}
childList = childList.Where(s => s.FMaterialID < 0 && !string.IsNullOrEmpty(s.FCode)).ToList();
tempList2 = tempList2.Where(s => s.FMaterialID > 0 && !string.IsNullOrEmpty(s.FCode)).ToList();
if (childList != null && childList.Count > 0)
{
ApiAuthInfo user = Request.Properties["token"] as ApiAuthInfo;
apiResult.Data = PackageBll.DockChildCode(inParam, childList, user.FID);
}
else if (tempList2 != null && tempList2.Count > 0)
{
ApiAuthInfo user = Request.Properties["token"] as ApiAuthInfo;
apiResult.Data = PackageBll.DockChildCode(inParam, tempList2, user.FID);
}
else
{
apiResult.CustomError((int)Constant.ApiResultCode., "对接失败,请稍后再试");
}
}
}, apiResult, Request, inParam);
}
/// <summary>
/// 模板上传处理(重构父方法)
/// </summary>
protected override object CheckUploadFile(List<string> fileList, int funcType, int userId)
{
if (funcType == 1)
{
GetPackageFromFile(fileList, out List<TFS_PackageMain> mainList, out List<TFS_PackageChild> childList);
return PackageBll.InsertBatchPackageData(mainList, childList, userId);
}
return fileList;
}
/// <summary>
/// 梳理包材导入文件
/// </summary>
private void GetPackageFromFile(List<string> fileList, out List<TFS_PackageMain> mainList, out List<TFS_PackageChild> childList)
{
mainList = new List<TFS_PackageMain>();
childList = new List<TFS_PackageChild>();
List<PropertyInfo> mainProp = typeof(TFS_PackageMain).GetTypeInfo().GetProperties().ToList();
List<PropertyInfo> childProp = typeof(TFS_PackageChild).GetTypeInfo().GetProperties().ToList();
List<TFS_FieldInfo> fieldList = BaseBll.GetFileInfoList((int)Constant.FieldInfoType.);
PropertyInfo temp = null;
foreach (string filePath in fileList)
{
DataTable dt = NPOIHelper.ImportExceltoDt(filePath);
List<string> items = new List<string>();
for (int i = 0; i < dt.Columns.Count; i++)
{
items.Add(dt.Columns[i].ColumnName);
}
foreach (DataRow dr in dt.Rows)
{
TFS_PackageMain main = new TFS_PackageMain();
TFS_PackageChild child = new TFS_PackageChild();
foreach (TFS_FieldInfo field in fieldList)
{
string value = GetValueByName(dr, items, field.FFieldName, field.FDefault);
string[] temps = field.FColumnFIeld.Split('.');
if ((temp = mainProp.Find(s => s.Name.Equals(temps.Last()))) != null)
{
if (temps.Length == 1 || temps[0] == "TFS_PackageMain")
{
temp.SetValue(main, value);
}
}
if ((temp = childProp.Find(s => s.Name.Equals(temps.Last()))) != null)
{
if (temps.Length == 1 || temps[0] == "TFS_PackageChild")
{
temp.SetValue(child, value);
}
}
}
if (!string.IsNullOrEmpty(main.FCode))
{
mainList.Add(main);
childList.Add(child);
}
}
}
}
}
}

@ -0,0 +1,37 @@
using Swashbuckle.Swagger;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Http;
using System.Web.Http.Description;
using System.Web.Http.Filters;
namespace FactorySystemApi.Controllers
{
/// <summary>
/// swagger 增加 AUTH 选项
/// </summary>
public class HttpAuthHeaderFilter : IOperationFilter
{
/// <summary>
/// 应用
/// </summary>
/// <param name="operation"></param>
/// <param name="schemaRegistry"></param>
/// <param name="apiDescription"></param>
public void Apply(Operation operation, SchemaRegistry schemaRegistry, ApiDescription apiDescription)
{
if (operation.parameters == null)
operation.parameters = new List<Parameter>();
var filterPipeline = apiDescription.ActionDescriptor.GetFilterPipeline(); //判断是否添加权限过滤器
var isAuthorized = filterPipeline.Select(filterInfo => filterInfo.Instance).Any(filter => filter is IAuthorizationFilter); //判断是否允许匿名方法
var allowAnonymous = apiDescription.ActionDescriptor.GetCustomAttributes<AllowAnonymousAttribute>().Any();
if (isAuthorized && !allowAnonymous)
{
operation.parameters.Add(new Parameter { name = "token", @in = "header", description = "用户登录token", required = false, type = "string" });
}
}
}
}

@ -0,0 +1,89 @@
using Swashbuckle.Swagger;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Web;
using System.Xml;
namespace FactorySystemApi.Controllers
{
/// <summary>
/// swagger显示控制器的描述
/// </summary>
public class SwaggerCacheProvider : ISwaggerProvider
{
private readonly ISwaggerProvider _swaggerProvider;
private static ConcurrentDictionary<string, SwaggerDocument> _cache = new ConcurrentDictionary<string, SwaggerDocument>();
private readonly string _xml;
/// <summary>
///
/// </summary>
/// <param name="swaggerProvider"></param>
/// <param name="xml">xml文档路径</param>
public SwaggerCacheProvider(ISwaggerProvider swaggerProvider, string xml)
{
_swaggerProvider = swaggerProvider;
_xml = xml;
}
public SwaggerDocument GetSwagger(string rootUrl, string apiVersion)
{
var cacheKey = string.Format("{0}_{1}", rootUrl, apiVersion);
SwaggerDocument srcDoc = null;
//只读取一次
if (!_cache.TryGetValue(cacheKey, out srcDoc))
{
srcDoc = _swaggerProvider.GetSwagger(rootUrl, apiVersion);
srcDoc.vendorExtensions = new Dictionary<string, object> { { "ControllerDesc", GetControllerDesc() } };
_cache.TryAdd(cacheKey, srcDoc);
}
return srcDoc;
}
/// <summary>
/// 从API文档中读取控制器描述
/// </summary>
/// <returns>所有控制器描述</returns>
public ConcurrentDictionary<string, string> GetControllerDesc()
{
string xmlpath = _xml;
ConcurrentDictionary<string, string> controllerDescDict = new ConcurrentDictionary<string, string>();
if (File.Exists(xmlpath))
{
XmlDocument xmldoc = new XmlDocument();
xmldoc.Load(xmlpath);
string type = string.Empty, path = string.Empty, controllerName = string.Empty;
string[] arrPath;
int length = -1, cCount = "Controller".Length;
XmlNode summaryNode = null;
foreach (XmlNode node in xmldoc.SelectNodes("//member"))
{
type = node.Attributes["name"].Value;
if (type.StartsWith("T:"))
{
//控制器
arrPath = type.Split('.');
length = arrPath.Length;
controllerName = arrPath[length - 1];
if (controllerName.EndsWith("Controller"))
{
//获取控制器注释
summaryNode = node.SelectSingleNode("summary");
string key = controllerName.Remove(controllerName.Length - cCount, cCount);
if (summaryNode != null && !string.IsNullOrEmpty(summaryNode.InnerText) && !controllerDescDict.ContainsKey(key))
{
controllerDescDict.TryAdd(key, summaryNode.InnerText.Trim());
}
}
}
}
}
return controllerDescDict;
}
}
}

@ -0,0 +1,25 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;
using System.Web.Mvc;
namespace FactorySystemApi.Controllers
{
/// <summary>
/// Swagger接口文档
/// </summary>
public class SwaggerController : Controller
{
/// <summary>
/// 接口文档首页
/// </summary>
/// <returns></returns>
public ActionResult Index()
{
return Redirect("/Swagger/ui/index");
}
}
}

@ -0,0 +1,182 @@
using System;
using System.Collections.Generic;
using System.Web.Http;
using FactorySystemApi.Sap_Group;
using FactorySystemBll;
using FactorySystemCommon;
using FactorySystemModel.BusinessModel;
using FactorySystemModel.EnumModel;
using FactorySystemModel.RequestModel;
using FactorySystemModel.ResponseModel;
using FactorySystemModel.SqlSugarModel;
namespace FactorySystemApi.Controllers
{
/// <summary>
/// 任务
/// </summary>
[UserLoginFilter]
public class TaskController : ApiController
{
private readonly TaskBll _taskBll = new TaskBll();
/// <summary>
/// 根据当前用户获取任务列表
/// </summary>
[HttpPost]
public ApiResult GetPageList(TaskQuery tq)
{
ApiResult apiResult = new ApiResult();
return ExceptionHelper.TryReturnException(() =>
{
if (tq.FIsUser && Request.Properties["token"] is ApiAuthInfo user)
{
tq.FUserID = user.FID.ToString();
}
apiResult.Data = new
{
List = _taskBll.GetList(tq, out var totalNumber),
Total = totalNumber
};
}, apiResult, Request);
}
/// <summary>
/// 物料组复核
/// </summary>
[HttpPost]
public ApiResult ReviewMaterialGroup(Dictionary<string, object> inParam)
{
ApiResult apiResult = new ApiResult();
return ExceptionHelper.TryReturnException(() =>
{
ApiAuthInfo user = Request.Properties["token"] as ApiAuthInfo;
apiResult.Data = _taskBll.ReviewMaterialGroup(inParam, user.FID);
}, apiResult, Request);
}
/// <summary>
/// 组编号申请
/// </summary>
[HttpPost]
public ApiResult DockMaterialGroup(Dictionary<string, object> inParam)
{
ApiResult apiResult = new ApiResult();
return ExceptionHelper.TryReturnException(() =>
{
apiResult.Data = 0;
List<TFS_ViewMaterial> viewList = _taskBll.GetDockGroupView(inParam);
if (viewList.Count > 0)
{
ApiAuthInfo user = Request.Properties["token"] as ApiAuthInfo;
try
{
List<Sap_Group.dt_pp071_reqHEAD> itemList = new List<Sap_Group.dt_pp071_reqHEAD>();
foreach (TFS_ViewMaterial view in viewList)
{
TFS_Material material = BaseBll.GetTempModel<TFS_Material>(view.FMaterialID);
Sap_Group.dt_pp071_reqHEAD reqHead = new Sap_Group.dt_pp071_reqHEAD
{
WERKS = view.FFactoryCode,//工厂
DATUV = "20210101",//生效日期
MATNR = string.IsNullOrEmpty(view.FBaseMaterialCode) ? material.FCode : view.FBaseMaterialCode,//物料
PLNAL = "1",//组计数器
VERWE = "1",//用途
STATU = "4",//状态
LOSVN = "0",//从批量
LOSBS = "99999999",//到批量
KTEXT = material.FCraftPathDesc,//工艺路线描述
ITEM = new Sap_Group.dt_pp071_reqHEADITEM[1]
};
bool is4 = view.FViewType == (int)Constant.ViewType.;
reqHead.ITEM[0] = new Sap_Group.dt_pp071_reqHEADITEM()
{
BMSCH = view.FViewType == (int)Constant.ViewType. ? "100" : "100000", //基本数量
PLNME = view.FViewType == (int)Constant.ViewType. ? "KG" : "G", //工序单位
VORNR = "0010", //工序编号
ARBPL = material.FWorkCenter, //工作中心
STEUS = "ZP01", //控制码
LTXA1 = material.FCraftDesc, //工序描述
VGW01 = is4 ? "0.01" : "1", //人工(直接)
VGE01 = "H", //人工直接工时单位
VGW02 = "", // 人工(间接)?
VGE02 = "", //人工间接工时单位?
VGW03 = "", //机器工时
VGE03 = "H", //机器工时单位
VGW04 = is4 ? "0.01" : "100", //电
VGE04 = "KWH", //电单位
VGW05 = "", //水?
VGE05 = "", //水单位?
VGW06 = is4 ? "0.01" : "100", //蒸汽
VGE06 = "TO", //蒸汽单位
VGW07 = is4 ? "0.01" : "100", //物耗仓储运输
VGE07 = "H", //物耗仓储运输单位
VGW08 = is4 ? "0.01" : "100", //其他
VGE08 = "H", //其他单位
VGW09 = "", //环保支出?
VGE09 = "", //环保支出单位?
};
itemList.Add(reqHead);
}
Sap_Group.si_pp071_mcs_senderService sapService = new Sap_Group.si_pp071_mcs_senderService()
{
Credentials = new System.Net.NetworkCredential()
{
UserName = AppSettingsHelper.GetAppSettingVal("Sap_UserName"),
Password = AppSettingsHelper.GetAppSettingVal("Sap_Password")
}
};
Sap_Group.dt_pp071_req reqDatas = new Sap_Group.dt_pp071_req()
{
SOURCESYS = "MCS",
TARGETSYS = "SAP",
UPDATETIME = DateTime.Now.ToString("yyyyMMddHHmmss"),
HEAD = itemList.ToArray()
};
Sap_Group.dt_pp071_resDATA[] resData = sapService.si_pp071_mcs_sender(reqDatas);
ExceptionHelper.AddSystemJournal(Request, reqDatas, resData);
for (int i = 0; i < viewList.Count; i++)
{
viewList[i].FGroupCode = (string.IsNullOrEmpty(resData[i].PLNNR) || resData[i].PLNNR == "null") ? "" : resData[i].PLNNR;
}
if (viewList.Find(s => string.IsNullOrEmpty(s.FGroupCode)) == null)
{
OperateLogBll.Add(viewList[0].FTeamID, (int)Constant.TaskType., "组编号申请对接成功", user.FID);
apiResult.Data = _taskBll.DockMaterialGroup(viewList, user.FID);
}
else
{
string errorMsg = "";
foreach (dt_pp071_resDATA res in resData)
{
errorMsg += res.MATNR + " " + res.MSGTX;
}
OperateLogBll.Add(viewList[0].FTeamID, (int)Constant.TaskType., "组编号申请对接失败:" + errorMsg + "。", user.FID);
apiResult.Data = 0;
}
}
catch (Exception ex)
{
ExceptionHelper.WriteMessage("组编号申请对接失败:" + ex.Message, 1);
OperateLogBll.Add(viewList[0].FTeamID, (int)Constant.TaskType., "组编号申请对接失败:" + ex.Message, user.FID);
}
}
}, apiResult, Request, inParam);
}
/// <summary>
/// 确认流程完成
/// </summary>
[HttpPost]
public ApiResult SureTeamWork(Dictionary<string, object> inParam)
{
ApiResult apiResult = new ApiResult();
return ExceptionHelper.TryReturnException(() =>
{
ApiAuthInfo user = Request.Properties["token"] as ApiAuthInfo;
apiResult.Data = _taskBll.SureTeamWork(int.Parse(inParam["FTeamID"].ToString()));
}, apiResult, Request);
}
}
}

File diff suppressed because it is too large Load Diff

@ -0,0 +1,283 @@
using FactorySystemBll;
using FactorySystemCommon;
using FactorySystemModel.BusinessModel;
using FactorySystemModel.ResponseModel;
using FactorySystemModel.SqlSugarModel;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web.Http;
namespace FactorySystemApi.Controllers
{
/// <summary>
/// 用户接口
/// </summary>
[UserLoginFilter]
public class UserController : BaseController<TUser>
{
private readonly UserBll UserBll = new UserBll();
/// <summary>
/// 初始化
/// </summary>
public UserController()
{
//设置可新增、修改字段
InsertField = UpdateField = "FFactoryID,FUser,FName,FPassword,FRoleID,FRoleName,FSex,FPhone,FEmail,FState,FRemark,FEditUser,FEditDate,FFactoryList,FRoleList";
}
/// <summary>
/// 获取首页数量信息
/// </summary>
[HttpPost]
public ApiResult GetHomeTopCount(Dictionary<string, object> inParam)
{
ApiResult apiResult = new ApiResult();
return ExceptionHelper.TryReturnException(() =>
{
ApiAuthInfo user = Request.Properties["token"] as ApiAuthInfo;
apiResult.Data = UserBll.GetHomeTopCount(user.FID);
}, apiResult, Request, inParam);
}
/// <summary>
/// 获取角色列表分页
/// </summary>
[HttpPost]
public ApiResult GetRolePageList(Dictionary<string, object> pageParam)
{
return GetTPageList<TRole>(pageParam);
}
/// <summary>
/// 获取角色集合
/// </summary>
[HttpPost]
public ApiResult GetRoleList(Dictionary<string, object> inParam)
{
ApiResult apiResult = new ApiResult();
return ExceptionHelper.TryReturnException(() =>
{
apiResult.Data = UserBll.GetRoleList();
}, apiResult, Request, inParam);
}
/// <summary>
/// 新增角色信息
/// </summary>
[HttpPost]
public ApiResult InsertRoleModel(Dictionary<string, object> insertParam)
{
ApiResult apiResult = new ApiResult();
return ExceptionHelper.TryReturnException(() =>
{
//设置用户字段
ApiAuthInfo user = Request.Properties["token"] as ApiAuthInfo;
insertParam = GetDictByField(insertParam, "FCode,FName,FRemark");
insertParam.Add("FAddUser", user.FID);
insertParam.Add("FEditUser", user.FID);
insertParam.Add("FAddDate", DateTime.Now);
insertParam.Add("FEditDate", DateTime.Now);
apiResult.Data = BaseBll.InsertDataModel(insertParam, "TRole");
}, apiResult, Request, insertParam);
}
/// <summary>
/// 修改角色信息
/// </summary>
[HttpPost]
public ApiResult UpdateRoleModel(Dictionary<string, object> updateParam)
{
ApiResult apiResult = new ApiResult();
return ExceptionHelper.TryReturnException(() =>
{
ApiAuthInfo user = Request.Properties["token"] as ApiAuthInfo;
updateParam = GetDictByField(updateParam, "FCode,FName,FRemark");
updateParam.Add("FEditUser", user.FID);
updateParam.Add("FEditDate", DateTime.Now);
apiResult.Data = BaseBll.UpdateDataModel(updateParam, "TRole") > 0 ? 1 : 0;
}, apiResult, Request, updateParam);
}
/// <summary>
/// 删除角色信息
/// </summary>
[HttpPost]
public ApiResult DeleteRoleModel(Dictionary<string, object> deleteParam)
{
ApiResult apiResult = new ApiResult();
return ExceptionHelper.TryReturnException(() =>
{
apiResult.Data = BaseBll.DeleteDataById(deleteParam, "TRole");
}, apiResult, Request, deleteParam);
}
/// <summary>
/// 获取菜单集合
/// </summary>
[HttpPost]
public ApiResult GetMenuList(Dictionary<string, object> selectData)
{
ApiResult apiResult = new ApiResult();
return ExceptionHelper.TryReturnException(() =>
{
ApiAuthInfo user = Request.Properties["token"] as ApiAuthInfo;
object roleId = null;
if (selectData != null) selectData.TryGetValue("FRoleId", out roleId);
bool wantAll = selectData != null && selectData.ContainsKey("FRoleSet");
apiResult.Data = UserBll.GetMenuList(user.FID, roleId == null ? "" : roleId.ToString(), wantAll);
}, apiResult, Request);
}
/// <summary>
/// 获取权限信息(非菜单)
/// </summary>
[HttpPost]
public ApiResult GetBasicRoleList(Dictionary<string, object> selectData)
{
ApiResult apiResult = new ApiResult();
return ExceptionHelper.TryReturnException(() =>
{
ApiAuthInfo user = Request.Properties["token"] as ApiAuthInfo;
if (selectData != null)
{
bool wantAll = selectData != null && selectData.ContainsKey("FRoleSet");
selectData.TryGetValue("FRoleType", out object roleType);
selectData.TryGetValue("FViewType", out object viewType);
selectData.TryGetValue("FRoleId", out object roleId);
apiResult.Data = UserBll.GetBasicRoleList(roleId, int.Parse(roleType.ToString()), viewType != null ? viewType.ToString() : "", user.FID, wantAll);
}
else
{
apiResult.Data = new List<string>();
}
}, apiResult, Request);
}
/// <summary>
/// 保存权限信息
/// </summary>
[HttpPost]
public ApiResult SaveRolePower(Dictionary<string, object> saveData)
{
ApiResult apiResult = new ApiResult();
return ExceptionHelper.TryReturnException(() =>
{
ApiAuthInfo user = Request.Properties["token"] as ApiAuthInfo;
int result = 0;
if (saveData != null && saveData.TryGetValue("FRoleId", out object roleId))
{
List<string> menuIds = null;
if (saveData.TryGetValue("FMenuId", out object menuId) && menuId != null)
{
menuIds = menuId.ToString().Trim(',').Split(',').ToList();
}
List<string> viewIds = null;
if (saveData.TryGetValue("FViewId", out object viewId) && viewId != null)
{
viewIds = viewId.ToString().Trim(',').Split(',').ToList();
}
List<string> termIds = null;
if (saveData.TryGetValue("FTermId", out object termId) && termId != null)
{
termIds = termId.ToString().Trim(',').Split(',').ToList();
}
List<string> editIds = null;
if (saveData.TryGetValue("FEditId", out object editId) && editId != null)
{
editIds = editId.ToString().Trim(',').Split(',').ToList();
}
List<string> editIds2 = null;
if (saveData.TryGetValue("FEditId2", out object editId2) && editId2 != null)
{
editIds2 = editId2.ToString().Trim(',').Split(',').ToList();
}
result = UserBll.SaveRolePower(user.FID.ToString(), int.Parse(roleId.ToString()), menuIds, viewIds, termIds, editIds, editIds2);
}
apiResult.Data = result;
}, apiResult, Request);
}
/// <summary>
/// 登录(仅开发测试)
/// </summary>
[HttpPost]
[NoCheckUserLogin]
public ApiResult Login()
{
ApiResult apiResult = new ApiResult();
return ExceptionHelper.TryReturnException(() =>
{
ApiAuthInfo apiAuthInfo = new ApiAuthInfo()
{
FID = 2,
FName = "李洪伟",
FUser = "HB1100283",
FExpireTime = DateTime.Now.AddDays(100).ToString("yyyy-MM-dd HH:mm:ss")
};
apiResult.Data = JWTHelper.Encryption(apiAuthInfo);
}, apiResult, Request);
}
/// <summary>
/// 登出
/// </summary>
[HttpPost]
public ApiResult LoginOut()
{
ApiResult apiResult = new ApiResult();
return ExceptionHelper.TryReturnException(() =>
{
apiResult.Data = AppSettingsHelper.GetAppSettingVal("Cas_OAUrl") + "logout?appid=testsso&service=" + AppSettingsHelper.GetAppSettingVal("Cas_ReUrl");
ExceptionHelper.AddSystemJournal(null, apiResult.Data, "注销退出", -1, "LoginOut");
}, apiResult, Request);
}
/// <summary>
/// 获取权限配置
/// </summary>
/// <param name="userid"></param>
/// <returns></returns>
[HttpPost]
public ApiResult GetPower(string userid)
{
ApiResult apiResult = new ApiResult();
return ExceptionHelper.TryReturnException(() => {
apiResult.Data = UserBll.GetPower(userid).ToList();
}, apiResult, Request);
//return UserBll.GetPower(userid).ToList();
}
/// <summary>
/// 创建角色关系
/// </summary>
/// <param name="list"></param>
/// <returns></returns>
[HttpPost]
public ApiResult CreatePower(Dictionary<string, List<FPower>> list)
{
ApiResult apiResult = new ApiResult();
return ExceptionHelper.TryReturnException(() =>
{
apiResult.Data = UserBll.CreateFPower(list.Values.ToList()[0].ToList());
}, apiResult, Request);
}
/// <summary>
/// 获取权限列表
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult GetPowerList()
{
ApiResult apiResult = new ApiResult();
return ExceptionHelper.TryReturnException(() =>
{
apiResult.Data = UserBll.GetFPowerList();
}, apiResult, Request);
}
}
}

@ -0,0 +1,84 @@
using System.Collections.Generic;
using System.Web.Http;
using FactorySystemBll;
using FactorySystemCommon;
using FactorySystemModel.BusinessModel;
using FactorySystemModel.ResponseModel;
using FactorySystemModel.SqlSugarModel;
using Newtonsoft.Json;
namespace FactorySystemApi.Controllers
{
/// <summary>
/// 视图接口
/// </summary>
[UserLoginFilter]
public class ViewController : BaseController<TFS_ViewMaterial>
{
private readonly ViewBll _viewBll = new ViewBll();
/// <summary>
/// 根据协同ID获取物料视图
/// </summary>
[HttpPost]
public ApiResult GetListByTeamId(Dictionary<string, object> inParam)
{
var apiResult = new ApiResult();
return ExceptionHelper.TryReturnException(() =>
{
if (Request.Properties["token"] is ApiAuthInfo user)
{
int teamId = int.Parse(inParam["teamId"].ToString());
int viewType = int.Parse(inParam["viewType"].ToString());
apiResult.Data = new
{
columns = _viewBll.GetColumns(),
rows = _viewBll.GetListByTeamId(teamId, viewType, user.FID, out List<int> materialId, out string FGuaranteePeriod, out string FStorageConditions, !inParam.ContainsKey("FAllView")),
infos = _viewBll.GetMaterialInfoList(materialId, FGuaranteePeriod, FStorageConditions, user.FID),
types = _viewBll.GetMaterialTypeList()
};
}
}, apiResult, Request);
}
/// <summary>
/// 保存视图编辑的内容
/// </summary>
[HttpPost]
public ApiResult UpdateBatchById(List<Dictionary<string, object>> rows)
{
var apiResult = new ApiResult();
return ExceptionHelper.TryReturnException(() =>
{
if (Request.Properties["token"] is ApiAuthInfo user)
{
apiResult.Data = _viewBll.UpdateBatchById(rows, user.FID);
}
}, apiResult, Request);
}
/// <summary>
/// 保存视图编辑的内容
/// </summary>
[HttpPost]
public ApiResult UpdateBatchById2(Dictionary<string, object> inParam)
{
var apiResult = new ApiResult();
return ExceptionHelper.TryReturnException(() =>
{
if (Request.Properties["token"] is ApiAuthInfo user)
{
inParam.TryGetValue("TFS_ViewMaterial", out object viewObj);
inParam.TryGetValue("TFS_Material", out object materialObj);
inParam.TryGetValue("TFS_MaterialInfo", out object infoObj);
List<Dictionary<string, object>> viewList = JsonConvert.DeserializeObject<List<Dictionary<string, object>>>(JsonConvert.SerializeObject(viewObj));
List<Dictionary<string, object>> materialList = JsonConvert.DeserializeObject<List<Dictionary<string, object>>>(JsonConvert.SerializeObject(materialObj));
List<Dictionary<string, object>> infoList = JsonConvert.DeserializeObject<List<Dictionary<string, object>>>(JsonConvert.SerializeObject(infoObj));
int teamId = int.Parse(inParam["FTeamID"].ToString());
int viewType = int.Parse(inParam["FViewType"].ToString());
_viewBll.UpdateBatchById2(viewList, materialList, infoList, teamId, viewType, user.FID);
}
}, apiResult, Request);
}
}
}

@ -0,0 +1,84 @@
using System.Collections.Generic;
using System.Web.Http;
using FactorySystemBll;
using FactorySystemCommon;
using FactorySystemModel.BusinessModel;
using FactorySystemModel.ResponseModel;
using FactorySystemModel.SqlSugarModel;
using Newtonsoft.Json;
namespace FactorySystemApi.Controllers
{
/// <summary>
/// 视图接口
/// </summary>
[UserLoginFilter]
public class View2Controller : BaseController<TFS_MaterialInfo>
{
private readonly ViewBll _viewBll = new ViewBll();
/// <summary>
/// 根据协同ID获取物料视图
/// </summary>
[HttpPost]
public ApiResult GetListByTeamId(Dictionary<string, object> inParam)
{
var apiResult = new ApiResult();
return ExceptionHelper.TryReturnException(() =>
{
if (Request.Properties["token"] is ApiAuthInfo user)
{
int teamId = int.Parse(inParam["teamId"].ToString());
int viewType = int.Parse(inParam["viewType"].ToString());
apiResult.Data = new
{
columns = _viewBll.GetColumns(),
rows = _viewBll.GetListByTeamId(teamId, viewType, user.FID, out List<int> materialId, out string FGuaranteePeriod, out string FStorageConditions, !inParam.ContainsKey("FAllView")),
infos = _viewBll.GetMaterialInfoList(materialId, FGuaranteePeriod, FStorageConditions, user.FID),
types = _viewBll.GetMaterialTypeList()
};
}
}, apiResult, Request);
}
/// <summary>
/// 保存视图编辑的内容
/// </summary>
[HttpPost]
public ApiResult UpdateBatchById(List<Dictionary<string, object>> rows)
{
var apiResult = new ApiResult();
return ExceptionHelper.TryReturnException(() =>
{
if (Request.Properties["token"] is ApiAuthInfo user)
{
apiResult.Data = _viewBll.UpdateBatchById(rows, user.FID);
}
}, apiResult, Request);
}
/// <summary>
/// 保存视图编辑的内容
/// </summary>
[HttpPost]
public ApiResult UpdateBatchById2(Dictionary<string, object> inParam)
{
var apiResult = new ApiResult();
return ExceptionHelper.TryReturnException(() =>
{
if (Request.Properties["token"] is ApiAuthInfo user)
{
inParam.TryGetValue("TFS_ViewMaterial", out object viewObj);
inParam.TryGetValue("TFS_Material", out object materialObj);
inParam.TryGetValue("TFS_MaterialInfo", out object infoObj);
List<Dictionary<string, object>> viewList = JsonConvert.DeserializeObject<List<Dictionary<string, object>>>(JsonConvert.SerializeObject(viewObj));
List<Dictionary<string, object>> materialList = JsonConvert.DeserializeObject<List<Dictionary<string, object>>>(JsonConvert.SerializeObject(materialObj));
List<Dictionary<string, object>> infoList = JsonConvert.DeserializeObject<List<Dictionary<string, object>>>(JsonConvert.SerializeObject(infoObj));
int teamId = int.Parse(inParam["FTeamID"].ToString());
int viewType = int.Parse(inParam["FViewType"].ToString());
_viewBll.UpdateBatchById2(viewList, materialList, infoList, teamId, viewType, user.FID);
}
}, apiResult, Request);
}
}
}

@ -0,0 +1,433 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.2.0.1\build\net45\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props" Condition="Exists('..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.2.0.1\build\net45\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props')" />
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>
</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{7107DC39-2E93-425F-A4D8-C50768DE573C}</ProjectGuid>
<ProjectTypeGuids>{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>FactorySystemApi</RootNamespace>
<AssemblyName>FactorySystemApi</AssemblyName>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<MvcBuildViews>false</MvcBuildViews>
<UseIISExpress>true</UseIISExpress>
<Use64BitIISExpress />
<IISExpressSSLPort />
<IISExpressAnonymousAuthentication />
<IISExpressWindowsAuthentication />
<IISExpressUseClassicPipelineMode />
<UseGlobalApplicationHostFile />
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<DocumentationFile>bin\FactorySystemApi.xml</DocumentationFile>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Aspose.Cells, Version=22.8.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56, processorArchitecture=MSIL">
<HintPath>..\packages\Aspose.Cells.22.8.0\lib\net40\Aspose.Cells.dll</HintPath>
</Reference>
<Reference Include="Microsoft.AspNetCore.Http.Abstractions, Version=1.1.2.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.AspNetCore.Http.Abstractions.1.1.2\lib\net451\Microsoft.AspNetCore.Http.Abstractions.dll</HintPath>
</Reference>
<Reference Include="Microsoft.AspNetCore.Http.Extensions, Version=1.1.2.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.AspNetCore.Http.Extensions.1.1.2\lib\net451\Microsoft.AspNetCore.Http.Extensions.dll</HintPath>
</Reference>
<Reference Include="Microsoft.AspNetCore.Http.Features, Version=1.1.2.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.AspNetCore.Http.Features.1.1.2\lib\net451\Microsoft.AspNetCore.Http.Features.dll</HintPath>
</Reference>
<Reference Include="Microsoft.CSharp" />
<Reference Include="Microsoft.Extensions.Configuration.Abstractions, Version=1.1.2.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Extensions.Configuration.Abstractions.1.1.2\lib\netstandard1.0\Microsoft.Extensions.Configuration.Abstractions.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Extensions.DependencyInjection.Abstractions, Version=1.1.1.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Extensions.DependencyInjection.Abstractions.1.1.1\lib\netstandard1.0\Microsoft.Extensions.DependencyInjection.Abstractions.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Extensions.FileProviders.Abstractions, Version=1.1.1.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Extensions.FileProviders.Abstractions.1.1.1\lib\netstandard1.0\Microsoft.Extensions.FileProviders.Abstractions.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Extensions.Options, Version=1.1.2.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Extensions.Options.1.1.2\lib\netstandard1.0\Microsoft.Extensions.Options.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Extensions.Primitives, Version=1.1.1.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Extensions.Primitives.1.1.1\lib\netstandard1.0\Microsoft.Extensions.Primitives.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Net.Http.Headers, Version=1.1.2.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Net.Http.Headers.1.1.2\lib\netstandard1.1\Microsoft.Net.Http.Headers.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="SqlSugar, Version=5.1.0.0, Culture=neutral, PublicKeyToken=null" />
<Reference Include="Swashbuckle.Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=cd1bb07a5ac7c7bc, processorArchitecture=MSIL">
<HintPath>..\packages\Swashbuckle.Core.5.6.0\lib\net40\Swashbuckle.Core.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Buffers, Version=4.0.1.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Buffers.4.3.0\lib\netstandard1.1\System.Buffers.dll</HintPath>
</Reference>
<Reference Include="System.ComponentModel.Composition" />
<Reference Include="System.Data" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System.Drawing" />
<Reference Include="System.EnterpriseServices" />
<Reference Include="System.IO.Compression" />
<Reference Include="System.Numerics" />
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=4.0.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.4.3.0\lib\netstandard1.0\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
</Reference>
<Reference Include="System.Runtime.InteropServices.RuntimeInformation, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Runtime.InteropServices.RuntimeInformation.4.3.0\lib\net45\System.Runtime.InteropServices.RuntimeInformation.dll</HintPath>
</Reference>
<Reference Include="System.ServiceModel" />
<Reference Include="System.Text.Encodings.Web, Version=4.0.1.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Text.Encodings.Web.4.3.1\lib\netstandard1.0\System.Text.Encodings.Web.dll</HintPath>
</Reference>
<Reference Include="System.Web.DynamicData" />
<Reference Include="System.Web.Entity" />
<Reference Include="System.Web.ApplicationServices" />
<Reference Include="System.ComponentModel.DataAnnotations" />
<Reference Include="System.Web" />
<Reference Include="System.Web.Abstractions" />
<Reference Include="System.Web.Extensions" />
<Reference Include="System.Web.Routing" />
<Reference Include="System.Web.Services" />
<Reference Include="System.Xml" />
<Reference Include="System.Configuration" />
<Reference Include="System.Runtime.Serialization" />
<Reference Include="Microsoft.Web.Infrastructure, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<Private>True</Private>
<HintPath>..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll</HintPath>
</Reference>
<Reference Include="System.Net.Http">
</Reference>
<Reference Include="System.Net.Http.Formatting, Version=5.2.7.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.AspNet.WebApi.Client.5.2.7\lib\net45\System.Net.Http.Formatting.dll</HintPath>
</Reference>
<Reference Include="System.Net.Http.WebRequest">
</Reference>
<Reference Include="System.Web.Helpers, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<Private>True</Private>
<HintPath>..\packages\Microsoft.AspNet.WebPages.3.2.7\lib\net45\System.Web.Helpers.dll</HintPath>
</Reference>
<Reference Include="System.Web.Http, Version=5.2.7.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.AspNet.WebApi.Core.5.2.7\lib\net45\System.Web.Http.dll</HintPath>
</Reference>
<Reference Include="System.Web.Http.WebHost, Version=5.2.7.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.AspNet.WebApi.WebHost.5.2.7\lib\net45\System.Web.Http.WebHost.dll</HintPath>
</Reference>
<Reference Include="System.Web.Mvc, Version=5.2.7.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<Private>True</Private>
<HintPath>..\packages\Microsoft.AspNet.Mvc.5.2.7\lib\net45\System.Web.Mvc.dll</HintPath>
</Reference>
<Reference Include="System.Web.Optimization">
<HintPath>..\packages\Microsoft.AspNet.Web.Optimization.1.1.3\lib\net40\System.Web.Optimization.dll</HintPath>
</Reference>
<Reference Include="System.Web.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<Private>True</Private>
<HintPath>..\packages\Microsoft.AspNet.Razor.3.2.7\lib\net45\System.Web.Razor.dll</HintPath>
</Reference>
<Reference Include="System.Web.WebPages, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<Private>True</Private>
<HintPath>..\packages\Microsoft.AspNet.WebPages.3.2.7\lib\net45\System.Web.WebPages.dll</HintPath>
</Reference>
<Reference Include="System.Web.WebPages.Deployment, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<Private>True</Private>
<HintPath>..\packages\Microsoft.AspNet.WebPages.3.2.7\lib\net45\System.Web.WebPages.Deployment.dll</HintPath>
</Reference>
<Reference Include="System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<Private>True</Private>
<HintPath>..\packages\Microsoft.AspNet.WebPages.3.2.7\lib\net45\System.Web.WebPages.Razor.dll</HintPath>
</Reference>
<Reference Include="System.Xml.Linq" />
<Reference Include="WebActivatorEx, Version=2.0.0.0, Culture=neutral, PublicKeyToken=7b26dc2a43f6a0d4, processorArchitecture=MSIL">
<HintPath>..\packages\WebActivatorEx.2.0\lib\net40\WebActivatorEx.dll</HintPath>
</Reference>
<Reference Include="WebGrease">
<Private>True</Private>
<HintPath>..\packages\WebGrease.1.6.0\lib\WebGrease.dll</HintPath>
</Reference>
<Reference Include="Antlr3.Runtime">
<Private>True</Private>
<HintPath>..\packages\Antlr.3.5.0.2\lib\Antlr3.Runtime.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Reference Include="Microsoft.CodeDom.Providers.DotNetCompilerPlatform">
<HintPath>..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.2.0.1\lib\net45\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="App_Start\ApiAuthorizeAttribute.cs" />
<Compile Include="App_Start\FilterConfig.cs" />
<Compile Include="App_Start\RouteConfig.cs" />
<Compile Include="App_Start\SwaggerConfig.cs" />
<Compile Include="App_Start\WebApiConfig.cs" />
<Compile Include="Controllers\CommonController.cs" />
<Compile Include="Controllers\BaseController.cs" />
<Compile Include="Controllers\MaterialTypeController.cs" />
<Compile Include="Controllers\OperateLogController.cs" />
<Compile Include="Controllers\TaskController.cs" />
<Compile Include="Controllers\TeamworkController.cs" />
<Compile Include="Controllers\PackageController.cs" />
<Compile Include="Controllers\MaterialController.cs" />
<Compile Include="Controllers\FormulaController.cs" />
<Compile Include="Controllers\SwaggerHelper\HttpAuthHeaderFilter.cs" />
<Compile Include="Controllers\SwaggerHelper\SwaggerCacheProvider.cs" />
<Compile Include="Controllers\SwaggerHelper\SwaggerController.cs" />
<Compile Include="Controllers\FactoryController.cs" />
<Compile Include="Controllers\FieldController.cs" />
<Compile Include="Controllers\View2Controller.cs" />
<Compile Include="Controllers\ViewController.cs" />
<Compile Include="Controllers\UserController.cs" />
<Compile Include="Global.asax.cs">
<DependentUpon>Global.asax</DependentUpon>
</Compile>
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
<DependentUpon>Settings.settings</DependentUpon>
</Compile>
<Compile Include="Web References\Plm_Formula\Reference.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Reference.map</DependentUpon>
</Compile>
<Compile Include="Web References\Sap_Formula\Reference.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Reference.map</DependentUpon>
</Compile>
<Compile Include="Web References\Sap_Group\Reference.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Reference.map</DependentUpon>
</Compile>
<Compile Include="Web References\Sap_Material1\Reference.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Reference.map</DependentUpon>
</Compile>
<Compile Include="Web References\WeChatMsg\Reference.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Reference.map</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<Content Include="favicon.ico" />
<Content Include="Global.asax" />
<Content Include="Scripts\bootstrap.js" />
<Content Include="Scripts\bootstrap.min.js" />
<Content Include="File\Formula\配方导入模板.xlsx" />
<Content Include="File\Material\SAP物料导入模板.xlsx" />
<Content Include="File\Material\副产物导入模板.xlsx" />
<Content Include="File\Material\替代料导入模板.xlsx" />
<Content Include="File\Material\物料信息补全导入模板.xlsx" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<None Include="Scripts\jquery-3.4.1.intellisense.js" />
<Content Include="Scripts\jquery-3.4.1.js" />
<Content Include="Scripts\jquery-3.4.1.min.js" />
<Content Include="Scripts\jquery-3.4.1.slim.js" />
<Content Include="Scripts\jquery-3.4.1.slim.min.js" />
<Content Include="Scripts\modernizr-2.8.3.js" />
<None Include="Web References\Plm_Formula\OAService.disco" />
<Content Include="Web References\WeChatMsg\Reference.map">
<Generator>MSDiscoCodeGenerator</Generator>
<LastGenOutput>Reference.cs</LastGenOutput>
</Content>
<None Include="Web References\Plm_Formula\OAService.wsdl" />
<None Include="Web References\Plm_Formula\Reference.map">
<Generator>MSDiscoCodeGenerator</Generator>
<LastGenOutput>Reference.cs</LastGenOutput>
</None>
<Content Include="Web References\Plm_Formula\RestResult.datasource">
<DependentUpon>Reference.map</DependentUpon>
</Content>
<Content Include="Web References\Sap_Material1\dt_mm100_res.datasource">
<DependentUpon>Reference.map</DependentUpon>
</Content>
<Content Include="Web References\Sap_Material1\Reference.map">
<Generator>MSDiscoCodeGenerator</Generator>
<LastGenOutput>Reference.cs</LastGenOutput>
</Content>
<None Include="Web References\Sap_Material1\si_mm100_mcs_sender.wsdl" />
<None Include="Web References\WeChatMsg\SendPlmMsgInterface.disco" />
<Content Include="Web.config" />
<Content Include="Web.Debug.config">
<DependentUpon>Web.config</DependentUpon>
</Content>
<Content Include="Web.Release.config">
<DependentUpon>Web.config</DependentUpon>
</Content>
<None Include="Web References\Sap_Formula\Reference.map">
<Generator>MSDiscoCodeGenerator</Generator>
<LastGenOutput>Reference.cs</LastGenOutput>
</None>
<Content Include="Web References\Sap_Formula\dt_pp062_res1.datasource">
<DependentUpon>Reference.map</DependentUpon>
</Content>
<None Include="Web References\Sap_Formula\si_pp062_bc_sender.wsdl" />
<Content Include="Web References\Sap_Group\dt_pp071_resDATA.datasource">
<DependentUpon>Reference.map</DependentUpon>
</Content>
<None Include="Web References\Sap_Group\Reference.map">
<Generator>MSDiscoCodeGenerator</Generator>
<LastGenOutput>Reference.cs</LastGenOutput>
</None>
<None Include="Web References\Sap_Group\si_pp071_mcs_sender.wsdl" />
<None Include="Web References\WeChatMsg\SendPlmMsgInterface.wsdl" />
</ItemGroup>
<ItemGroup>
<Folder Include="App_Data\" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
<Content Include="Scripts\jquery-3.4.1.slim.min.map" />
<Content Include="Scripts\jquery-3.4.1.min.map" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\FactorySystemBll\FactorySystemBll.csproj">
<Project>{de5ca953-c5f7-4df4-81b2-9c3d89849dc5}</Project>
<Name>FactorySystemBll</Name>
</ProjectReference>
<ProjectReference Include="..\FactorySystemCommon\FactorySystemCommon.csproj">
<Project>{ea8e8fc2-b255-4931-bbae-7862f0173cd3}</Project>
<Name>FactorySystemCommon</Name>
</ProjectReference>
<ProjectReference Include="..\FactorySystemModel\FactorySystemModel.csproj">
<Project>{2c1a44d9-d4ba-464e-832b-6108595892d6}</Project>
<Name>FactorySystemModel</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<WebReferences Include="Web References\" />
</ItemGroup>
<ItemGroup>
<WebReferenceUrl Include="http://dd.hbflavor.com:8099/PlmMsg/SendPlmMsgInterface.asmx">
<UrlBehavior>Dynamic</UrlBehavior>
<RelPath>Web References\WeChatMsg\</RelPath>
<UpdateFromURL>http://dd.hbflavor.com:8099/PlmMsg/SendPlmMsgInterface.asmx</UpdateFromURL>
<ServiceLocationURL>
</ServiceLocationURL>
<CachedDynamicPropName>
</CachedDynamicPropName>
<CachedAppSettingsObjectName>Settings</CachedAppSettingsObjectName>
<CachedSettingsPropName>FactorySystemApi_WeChatMsg_SendPLMMsgInterface</CachedSettingsPropName>
</WebReferenceUrl>
<WebReferenceUrl Include="http://sappoqas.hbglobal.com:50000/dir/wsdl%3fp=ic/20d87a69c09f303695c195ca7731a2c9">
<UrlBehavior>Dynamic</UrlBehavior>
<RelPath>Web References\Sap_Formula\</RelPath>
<UpdateFromURL>http://sappoqas.hbglobal.com:50000/dir/wsdl%3fp=ic/20d87a69c09f303695c195ca7731a2c9</UpdateFromURL>
<ServiceLocationURL>
</ServiceLocationURL>
<CachedDynamicPropName>
</CachedDynamicPropName>
<CachedAppSettingsObjectName>Settings</CachedAppSettingsObjectName>
<CachedSettingsPropName>SAP_Formula</CachedSettingsPropName>
</WebReferenceUrl>
<WebReferenceUrl Include="http://sappoqas.hbglobal.com:50000/dir/wsdl%3fp=ic/e07e48bca18c3ffa84b2e1cc3d2ca0b6">
<UrlBehavior>Dynamic</UrlBehavior>
<RelPath>Web References\Sap_Group\</RelPath>
<UpdateFromURL>http://sappoqas.hbglobal.com:50000/dir/wsdl%3fp=ic/e07e48bca18c3ffa84b2e1cc3d2ca0b6</UpdateFromURL>
<ServiceLocationURL>
</ServiceLocationURL>
<CachedDynamicPropName>
</CachedDynamicPropName>
<CachedAppSettingsObjectName>Settings</CachedAppSettingsObjectName>
<CachedSettingsPropName>Sap_Group</CachedSettingsPropName>
</WebReferenceUrl>
<WebReferenceUrl Include="http://sappoqas.hbglobal.com:50000/dir/wsdl%3fp=ic/e90f0ead833c328aba271c10a4d823e2">
<UrlBehavior>Dynamic</UrlBehavior>
<RelPath>Web References\Sap_Material1\</RelPath>
<UpdateFromURL>http://sappoqas.hbglobal.com:50000/dir/wsdl%3fp=ic/e90f0ead833c328aba271c10a4d823e2</UpdateFromURL>
<ServiceLocationURL>
</ServiceLocationURL>
<CachedDynamicPropName>
</CachedDynamicPropName>
<CachedAppSettingsObjectName>Settings</CachedAppSettingsObjectName>
<CachedSettingsPropName>FactorySystemApi_Sap_Material1_si_mm100_mcs_senderService</CachedSettingsPropName>
</WebReferenceUrl>
<WebReferenceUrl Include="https://plmtest.hbflavor.com/PlmWebService/OAService.asmx">
<UrlBehavior>Dynamic</UrlBehavior>
<RelPath>Web References\Plm_Formula\</RelPath>
<UpdateFromURL>https://plmtest.hbflavor.com/PlmWebService/OAService.asmx</UpdateFromURL>
<ServiceLocationURL>
</ServiceLocationURL>
<CachedDynamicPropName>
</CachedDynamicPropName>
<CachedAppSettingsObjectName>Settings</CachedAppSettingsObjectName>
<CachedSettingsPropName>Plm_Formula</CachedSettingsPropName>
</WebReferenceUrl>
</ItemGroup>
<ItemGroup>
<WCFMetadata Include="Connected Services\" />
</ItemGroup>
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
</PropertyGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<Import Project="$(VSToolsPath)\WebApplications\Microsoft.WebApplication.targets" Condition="'$(VSToolsPath)' != ''" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" Condition="false" />
<Target Name="MvcBuildViews" AfterTargets="AfterBuild" Condition="'$(MvcBuildViews)'=='true'">
<AspNetCompiler VirtualPath="temp" PhysicalPath="$(WebProjectOutputDir)" />
</Target>
<ProjectExtensions>
<VisualStudio>
<FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}">
<WebProjectProperties>
<UseIIS>True</UseIIS>
<AutoAssignPort>True</AutoAssignPort>
<DevelopmentServerPort>58178</DevelopmentServerPort>
<DevelopmentServerVPath>/</DevelopmentServerVPath>
<IISUrl>http://localhost:58178/</IISUrl>
<NTLMAuthentication>False</NTLMAuthentication>
<UseCustomServer>False</UseCustomServer>
<CustomServerUrl>
</CustomServerUrl>
<SaveServerSettingsInUserFile>False</SaveServerSettingsInUserFile>
</WebProjectProperties>
</FlavorProperties>
</VisualStudio>
</ProjectExtensions>
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>这台计算机上缺少此项目引用的 NuGet 程序包。使用“NuGet 程序包还原”可下载这些程序包。有关更多信息,请参见 http://go.microsoft.com/fwlink/?LinkID=322105。缺少的文件是 {0}。</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.2.0.1\build\net45\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.2.0.1\build\net45\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props'))" />
</Target>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target> -->
</Project>

@ -0,0 +1 @@
<%@ Application Codebehind="Global.asax.cs" Inherits="FactorySystemApi.WebApiApplication" Language="C#" %>

@ -0,0 +1,25 @@
using System.Web;
using System.Web.Http;
using System.Web.Mvc;
using System.Web.Routing;
namespace FactorySystemApi
{
/// <summary>
///
/// </summary>
public class WebApiApplication : HttpApplication
{
/// <summary>
/// Æô¶¯
/// </summary>
protected void Application_Start()
{
AreaRegistration.RegisterAllAreas();
GlobalConfiguration.Configure(WebApiConfig.Register);
FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
RouteConfig.RegisterRoutes(RouteTable.Routes);
}
}
}

@ -0,0 +1,35 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// 有关程序集的常规信息是通过以下项进行控制的
// 控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("FactorySystemApi")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("FactorySystemApi")]
[assembly: AssemblyCopyright("版权所有(C) 2022")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// 将 ComVisible 设置为 false 将使此程序集中的类型
// 对 COM 组件不可见。如果需要
// 从 COM 访问此程序集中的某个类型,请针对该类型将 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]
// 如果此项目向 COM 公开,则下列 GUID 用于 typelib 的 ID
[assembly: Guid("0d587e8b-cd19-43f8-b3ff-21a7c89f250a")]
// 程序集的版本信息由下列四个值组成:
//
// 主版本
// 次版本
// 内部版本号
// 修订版本
//
// 你可以指定所有值,也可以让修订版本和内部版本号采用默认值,
// 方法是按如下所示使用 "*":
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

@ -0,0 +1,81 @@
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本:4.0.30319.42000
//
// 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,这些更改将会丢失。
// </auto-generated>
//------------------------------------------------------------------------------
namespace FactorySystemApi.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.3.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default {
get {
return defaultInstance;
}
}
[global::System.Configuration.ApplicationScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.SpecialSettingAttribute(global::System.Configuration.SpecialSetting.WebServiceUrl)]
[global::System.Configuration.DefaultSettingValueAttribute("http://dd.hbflavor.com:28888/PlmMsg/SendPLMMsgInterface.asmx")]
public string WeChatMsg {
get {
return ((string)(this["WeChatMsg"]));
}
}
[global::System.Configuration.ApplicationScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.SpecialSettingAttribute(global::System.Configuration.SpecialSetting.WebServiceUrl)]
[global::System.Configuration.DefaultSettingValueAttribute("https://plmtest.hbflavor.com/PlmWebService/OAService.asmx")]
public string Plm_Formula {
get {
return ((string)(this["Plm_Formula"]));
}
}
[global::System.Configuration.ApplicationScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("http://sappoqas.hbglobal.com:50000/XISOAPAdapter/MessageServlet?senderParty=&send" +
"erService=ZMCS_FLAVOR&receiverParty=&receiverService=&interface=si_mm100_mcs_sen" +
"der&interfaceNamespace=http%3A%2F%2Fwww.zmc.com%2Fflavor%2Fmm")]
public string Sap_Material {
get {
return ((string)(this["Sap_Material"]));
}
}
[global::System.Configuration.ApplicationScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.SpecialSettingAttribute(global::System.Configuration.SpecialSetting.WebServiceUrl)]
[global::System.Configuration.DefaultSettingValueAttribute("http://sappoqas.hbglobal.com:50000/XISOAPAdapter/MessageServlet?senderParty=&send" +
"erService=ZMCS_FLAVOR&receiverParty=&receiverService=&interface=si_pp062_bc_send" +
"er&interfaceNamespace=http%3A%2F%2Fwww.zmc.com%2Fflavor%2Fpp")]
public string SAP_Formula {
get {
return ((string)(this["SAP_Formula"]));
}
}
[global::System.Configuration.ApplicationScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.SpecialSettingAttribute(global::System.Configuration.SpecialSetting.WebServiceUrl)]
[global::System.Configuration.DefaultSettingValueAttribute("http://sappoqas.hbglobal.com:50000/XISOAPAdapter/MessageServlet?senderParty=&send" +
"erService=ZMCS_FLAVOR&receiverParty=&receiverService=&interface=si_pp071_mcs_sen" +
"der&interfaceNamespace=http%3A%2F%2Fwww.zmc.com%2Fflavor%2Fpp")]
public string Sap_Group {
get {
return ((string)(this["Sap_Group"]));
}
}
}
}

@ -0,0 +1,21 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="FactorySystemApi.Properties" GeneratedClassName="Settings">
<Profiles />
<Settings>
<Setting Name="WeChatMsg" Type="(Web Service URL)" Scope="Application">
<Value Profile="(Default)">http://dd.hbflavor.com:28888/PlmMsg/SendPLMMsgInterface.asmx</Value>
</Setting>
<Setting Name="Plm_Formula" Type="(Web Service URL)" Scope="Application">
<Value Profile="(Default)">https://plmtest.hbflavor.com/PlmWebService/OAService.asmx</Value>
</Setting>
<Setting Name="Sap_Material" Type="System.String" Scope="Application">
<Value Profile="(Default)">http://sappoqas.hbglobal.com:50000/XISOAPAdapter/MessageServlet?senderParty=&amp;senderService=ZMCS_FLAVOR&amp;receiverParty=&amp;receiverService=&amp;interface=si_mm100_mcs_sender&amp;interfaceNamespace=http%3A%2F%2Fwww.zmc.com%2Fflavor%2Fmm</Value>
</Setting>
<Setting Name="SAP_Formula" Type="(Web Service URL)" Scope="Application">
<Value Profile="(Default)">http://sappoqas.hbglobal.com:50000/XISOAPAdapter/MessageServlet?senderParty=&amp;senderService=ZMCS_FLAVOR&amp;receiverParty=&amp;receiverService=&amp;interface=si_pp062_bc_sender&amp;interfaceNamespace=http%3A%2F%2Fwww.zmc.com%2Fflavor%2Fpp</Value>
</Setting>
<Setting Name="Sap_Group" Type="(Web Service URL)" Scope="Application">
<Value Profile="(Default)">http://sappoqas.hbglobal.com:50000/XISOAPAdapter/MessageServlet?senderParty=&amp;senderService=ZMCS_FLAVOR&amp;receiverParty=&amp;receiverService=&amp;interface=si_pp071_mcs_sender&amp;interfaceNamespace=http%3A%2F%2Fwww.zmc.com%2Fflavor%2Fpp</Value>
</Setting>
</Settings>
</SettingsFile>

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<discovery xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.xmlsoap.org/disco/">
<contractRef ref="https://plmtest.hbflavor.com/PlmWebService/OAService.asmx?wsdl" docRef="https://plmtest.hbflavor.com/PlmWebService/OAService.asmx" xmlns="http://schemas.xmlsoap.org/disco/scl/" />
<soap address="https://plmtest.hbflavor.com/PlmWebService/OAService.asmx" xmlns:q1="http://tempuri.org/" binding="q1:OAServiceSoap" xmlns="http://schemas.xmlsoap.org/disco/soap/" />
<soap address="https://plmtest.hbflavor.com/PlmWebService/OAService.asmx" xmlns:q2="http://tempuri.org/" binding="q2:OAServiceSoap12" xmlns="http://schemas.xmlsoap.org/disco/soap/" />
</discovery>

@ -0,0 +1,349 @@
<?xml version="1.0" encoding="utf-8"?>
<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:tns="http://tempuri.org/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" targetNamespace="http://tempuri.org/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
<wsdl:types>
<s:schema elementFormDefault="qualified" targetNamespace="http://tempuri.org/">
<s:element name="CreateMaterialSpec">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="oa" type="tns:OAMateral_New" />
</s:sequence>
</s:complexType>
</s:element>
<s:complexType name="OAMateral_New">
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="Factory" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="Amount" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="No" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="RawMaterialDescription" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="EnglishName" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="OtherNames" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="BotanicalSpeciesName" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="BotanicalFamily" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="CAS_No" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="FL_No" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="FEMA_No" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="NAS_No" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="CoE_No" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="EINECS_No" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="JECFA_No" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="EU_Additive_No" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="INS" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="CNS" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="Description" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="EmpiricalFormula" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="MW" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="AcidValue" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="AerobicPlateCount" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="Aldehyde" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="Appearance" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="Ash_total" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="Assay" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="BoilingPointOrBoilingRange" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="Coliform" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="FlashPoint" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="HeavyMetals_As" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="AsHeavyMetals_asPbhTotal" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="InsolubleMatter" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="LC50" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="LogP" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="LossOnDrying" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="MeltingPointOrMeltingRange" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="Methanol" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="Specific_OpticalRotation" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="RefractiveIndex" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="EvaporationResidue" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="BurningResidue" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="Solubility" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="RelativeDensity" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="VapourPressure" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="Viscosity" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="Odor" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="Moisture" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="AromaThresholdValues" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="TasteThresholdValues" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="FragranceNotes" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="NaturalOccurrence" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="Synthesis" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="Remarks" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="ReferenceStandard" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="MDM_code" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="SAP_Name" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="Supplier" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="PurchasePrice" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="Halal" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="Kosher" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="Allergen" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="irradiation" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="GeneticallyModified" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="RMC" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="category" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="OldCode" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="OldCode2" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="RawMaterialResource" type="s:string" />
</s:sequence>
</s:complexType>
<s:element name="CreateMaterialSpecResponse">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="CreateMaterialSpecResult" type="tns:RestResult" />
</s:sequence>
</s:complexType>
</s:element>
<s:complexType name="RestResult">
<s:sequence>
<s:element minOccurs="1" maxOccurs="1" name="code" type="s:int" />
<s:element minOccurs="0" maxOccurs="1" name="message" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="data" />
</s:sequence>
</s:complexType>
<s:complexType name="Specifications">
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="Code" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="Version" type="s:string" />
</s:sequence>
</s:complexType>
<s:complexType name="OAProject">
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="HB_HBBT" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="HB_SQR" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="HB_SQRQ" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="HB_SQBM" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="HB_SSGS" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="HB_YWBK" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="HB_SMMC" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="HB_XMHZXZ" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="HB_XMLX" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="HB_XMJB" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="HB_XMBJ" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="HB_XMJZ" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="HB_KHFL" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="HB_XMBH" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="HB_XMURLDZ" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="HB_XMJD" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="HB_YFBMLD" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="HB_YYBMLD" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="HB_TXS" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="HB_YYGCS" type="s:string" />
</s:sequence>
</s:complexType>
<s:element name="MySoapHeader" type="tns:MySoapHeader" />
<s:complexType name="MySoapHeader">
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="UserName" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="PassWord" type="s:string" />
</s:sequence>
<s:anyAttribute />
</s:complexType>
<s:element name="OAProjectDataToPLM">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="oAProject" type="tns:OAProject" />
</s:sequence>
</s:complexType>
</s:element>
<s:element name="OAProjectDataToPLMResponse">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="OAProjectDataToPLMResult" type="tns:RestResult" />
</s:sequence>
</s:complexType>
</s:element>
<s:element name="OAworkflowToPLM">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="oAWorkFlowInfo" type="tns:OAWorkFlowInfo" />
<s:element minOccurs="0" maxOccurs="1" name="oAWorkFlowInfoDetial_list" type="tns:ArrayOfOAWorkFlowInfoDetial" />
</s:sequence>
</s:complexType>
</s:element>
<s:complexType name="OAWorkFlowInfo">
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="ShortDescription" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="userWorkCode" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="ApplicationDays" type="s:string" />
</s:sequence>
</s:complexType>
<s:complexType name="ArrayOfOAWorkFlowInfoDetial">
<s:sequence>
<s:element minOccurs="0" maxOccurs="unbounded" name="OAWorkFlowInfoDetial" nillable="true" type="tns:OAWorkFlowInfoDetial" />
</s:sequence>
</s:complexType>
<s:complexType name="OAWorkFlowInfoDetial">
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="SpecificationValue_ITEM" type="s:string" />
<s:element minOccurs="1" maxOccurs="1" name="ifAllow" type="s:int" />
<s:element minOccurs="1" maxOccurs="1" name="AllowRevision" type="s:int" />
</s:sequence>
</s:complexType>
<s:element name="OAworkflowToPLMResponse">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="OAworkflowToPLMResult" type="tns:RestResult" />
</s:sequence>
</s:complexType>
</s:element>
<s:element name="GetSpecificationsList">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="Specificationinfo" type="tns:ArrayOfSpecifications" />
</s:sequence>
</s:complexType>
</s:element>
<s:complexType name="ArrayOfSpecifications">
<s:sequence>
<s:element minOccurs="0" maxOccurs="unbounded" name="Specifications" nillable="true" type="tns:Specifications" />
</s:sequence>
</s:complexType>
<s:element name="GetSpecificationsListResponse">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="GetSpecificationsListResult" type="tns:RestResult" />
</s:sequence>
</s:complexType>
</s:element>
</s:schema>
</wsdl:types>
<wsdl:message name="CreateMaterialSpecSoapIn">
<wsdl:part name="parameters" element="tns:CreateMaterialSpec" />
</wsdl:message>
<wsdl:message name="CreateMaterialSpecSoapOut">
<wsdl:part name="parameters" element="tns:CreateMaterialSpecResponse" />
</wsdl:message>
<wsdl:message name="CreateMaterialSpecMySoapHeader">
<wsdl:part name="MySoapHeader" element="tns:MySoapHeader" />
</wsdl:message>
<wsdl:message name="OAProjectDataToPLMSoapIn">
<wsdl:part name="parameters" element="tns:OAProjectDataToPLM" />
</wsdl:message>
<wsdl:message name="OAProjectDataToPLMSoapOut">
<wsdl:part name="parameters" element="tns:OAProjectDataToPLMResponse" />
</wsdl:message>
<wsdl:message name="OAProjectDataToPLMMySoapHeader">
<wsdl:part name="MySoapHeader" element="tns:MySoapHeader" />
</wsdl:message>
<wsdl:message name="OAworkflowToPLMSoapIn">
<wsdl:part name="parameters" element="tns:OAworkflowToPLM" />
</wsdl:message>
<wsdl:message name="OAworkflowToPLMSoapOut">
<wsdl:part name="parameters" element="tns:OAworkflowToPLMResponse" />
</wsdl:message>
<wsdl:message name="OAworkflowToPLMMySoapHeader">
<wsdl:part name="MySoapHeader" element="tns:MySoapHeader" />
</wsdl:message>
<wsdl:message name="GetSpecificationsListSoapIn">
<wsdl:part name="parameters" element="tns:GetSpecificationsList" />
</wsdl:message>
<wsdl:message name="GetSpecificationsListSoapOut">
<wsdl:part name="parameters" element="tns:GetSpecificationsListResponse" />
</wsdl:message>
<wsdl:portType name="OAServiceSoap">
<wsdl:operation name="CreateMaterialSpec">
<wsdl:input message="tns:CreateMaterialSpecSoapIn" />
<wsdl:output message="tns:CreateMaterialSpecSoapOut" />
</wsdl:operation>
<wsdl:operation name="OAProjectDataToPLM">
<wsdl:input message="tns:OAProjectDataToPLMSoapIn" />
<wsdl:output message="tns:OAProjectDataToPLMSoapOut" />
</wsdl:operation>
<wsdl:operation name="OAworkflowToPLM">
<wsdl:input message="tns:OAworkflowToPLMSoapIn" />
<wsdl:output message="tns:OAworkflowToPLMSoapOut" />
</wsdl:operation>
<wsdl:operation name="GetSpecificationsList">
<wsdl:input message="tns:GetSpecificationsListSoapIn" />
<wsdl:output message="tns:GetSpecificationsListSoapOut" />
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="OAServiceSoap" type="tns:OAServiceSoap">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" />
<wsdl:operation name="CreateMaterialSpec">
<soap:operation soapAction="http://tempuri.org/CreateMaterialSpec" style="document" />
<wsdl:input>
<soap:body use="literal" />
<soap:header message="tns:CreateMaterialSpecMySoapHeader" part="MySoapHeader" use="literal" />
</wsdl:input>
<wsdl:output>
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="OAProjectDataToPLM">
<soap:operation soapAction="http://tempuri.org/OAProjectDataToPLM" style="document" />
<wsdl:input>
<soap:body use="literal" />
<soap:header message="tns:OAProjectDataToPLMMySoapHeader" part="MySoapHeader" use="literal" />
</wsdl:input>
<wsdl:output>
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="OAworkflowToPLM">
<soap:operation soapAction="http://tempuri.org/OAworkflowToPLM" style="document" />
<wsdl:input>
<soap:body use="literal" />
<soap:header message="tns:OAworkflowToPLMMySoapHeader" part="MySoapHeader" use="literal" />
</wsdl:input>
<wsdl:output>
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="GetSpecificationsList">
<soap:operation soapAction="http://tempuri.org/GetSpecificationsList" style="document" />
<wsdl:input>
<soap:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:binding name="OAServiceSoap12" type="tns:OAServiceSoap">
<soap12:binding transport="http://schemas.xmlsoap.org/soap/http" />
<wsdl:operation name="CreateMaterialSpec">
<soap12:operation soapAction="http://tempuri.org/CreateMaterialSpec" style="document" />
<wsdl:input>
<soap12:body use="literal" />
<soap12:header message="tns:CreateMaterialSpecMySoapHeader" part="MySoapHeader" use="literal" />
</wsdl:input>
<wsdl:output>
<soap12:body use="literal" />
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="OAProjectDataToPLM">
<soap12:operation soapAction="http://tempuri.org/OAProjectDataToPLM" style="document" />
<wsdl:input>
<soap12:body use="literal" />
<soap12:header message="tns:OAProjectDataToPLMMySoapHeader" part="MySoapHeader" use="literal" />
</wsdl:input>
<wsdl:output>
<soap12:body use="literal" />
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="OAworkflowToPLM">
<soap12:operation soapAction="http://tempuri.org/OAworkflowToPLM" style="document" />
<wsdl:input>
<soap12:body use="literal" />
<soap12:header message="tns:OAworkflowToPLMMySoapHeader" part="MySoapHeader" use="literal" />
</wsdl:input>
<wsdl:output>
<soap12:body use="literal" />
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="GetSpecificationsList">
<soap12:operation soapAction="http://tempuri.org/GetSpecificationsList" style="document" />
<wsdl:input>
<soap12:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap12:body use="literal" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="OAService">
<wsdl:port name="OAServiceSoap" binding="tns:OAServiceSoap">
<soap:address location="https://plmtest.hbflavor.com/PlmWebService/OAService.asmx" />
</wsdl:port>
<wsdl:port name="OAServiceSoap12" binding="tns:OAServiceSoap12">
<soap12:address location="https://plmtest.hbflavor.com/PlmWebService/OAService.asmx" />
</wsdl:port>
</wsdl:service>
</wsdl:definitions>

File diff suppressed because it is too large Load Diff

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<DiscoveryClientResultsFile xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Results>
<DiscoveryClientResult referenceType="System.Web.Services.Discovery.ContractReference" url="https://plmtest.hbflavor.com/PlmWebService/OAService.asmx?wsdl" filename="OAService.wsdl" />
<DiscoveryClientResult referenceType="System.Web.Services.Discovery.DiscoveryDocumentReference" url="https://plmtest.hbflavor.com/PlmWebService/OAService.asmx?disco" filename="OAService.disco" />
</Results>
</DiscoveryClientResultsFile>

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
This file is automatically generated by Visual Studio .Net. It is
used to store generic object data source configuration information.
Renaming the file extension or editing the content of this file may
cause the file to be unrecognizable by the program.
-->
<GenericObjectDataSource DisplayName="RestResult" Version="1.0" xmlns="urn:schemas-microsoft-com:xml-msdatasource">
<TypeInfo>FactorySystemApi.Plm_Formula.RestResult, Web References.Plm_Formula.Reference.cs.dll, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null</TypeInfo>
</GenericObjectDataSource>

@ -0,0 +1,438 @@
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本:4.0.30319.42000
//
// 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,这些更改将会丢失。
// </auto-generated>
//------------------------------------------------------------------------------
//
// 此源代码是由 Microsoft.VSDesigner 4.0.30319.42000 版自动生成。
//
#pragma warning disable 1591
namespace FactorySystemApi.Sap_Formula {
using System;
using System.Web.Services;
using System.Diagnostics;
using System.Web.Services.Protocols;
using System.Xml.Serialization;
using System.ComponentModel;
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.9032.0")]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Web.Services.WebServiceBindingAttribute(Name="si_pp062_bc_senderBinding", Namespace="http://www.zmc.com/flavor/pp")]
public partial class si_pp062_bc_senderService : System.Web.Services.Protocols.SoapHttpClientProtocol {
private System.Threading.SendOrPostCallback si_pp062_bc_senderOperationCompleted;
private bool useDefaultCredentialsSetExplicitly;
/// <remarks/>
public si_pp062_bc_senderService() {
this.Url = global::FactorySystemApi.Properties.Settings.Default.SAP_Formula;
if ((this.IsLocalFileSystemWebService(this.Url) == true)) {
this.UseDefaultCredentials = true;
this.useDefaultCredentialsSetExplicitly = false;
}
else {
this.useDefaultCredentialsSetExplicitly = true;
}
}
public new string Url {
get {
return base.Url;
}
set {
if ((((this.IsLocalFileSystemWebService(base.Url) == true)
&& (this.useDefaultCredentialsSetExplicitly == false))
&& (this.IsLocalFileSystemWebService(value) == false))) {
base.UseDefaultCredentials = false;
}
base.Url = value;
}
}
public new bool UseDefaultCredentials {
get {
return base.UseDefaultCredentials;
}
set {
base.UseDefaultCredentials = value;
this.useDefaultCredentialsSetExplicitly = true;
}
}
/// <remarks/>
public event si_pp062_bc_senderCompletedEventHandler si_pp062_bc_senderCompleted;
/// <remarks/>
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://sap.com/xi/WebService/soap1.1", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Bare)]
[return: System.Xml.Serialization.XmlElementAttribute("mt_pp062_res", Namespace="http://www.zmc.com/flavor/pp")]
public dt_pp062_res si_pp062_bc_sender([System.Xml.Serialization.XmlArrayAttribute(Namespace="http://www.zmc.com/flavor/pp")] [System.Xml.Serialization.XmlArrayItemAttribute("DATA", Form=System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable=false)] dt_pp062_reqDATA[] mt_pp062_req) {
object[] results = this.Invoke("si_pp062_bc_sender", new object[] {
mt_pp062_req});
return ((dt_pp062_res)(results[0]));
}
/// <remarks/>
public void si_pp062_bc_senderAsync(dt_pp062_reqDATA[] mt_pp062_req) {
this.si_pp062_bc_senderAsync(mt_pp062_req, null);
}
/// <remarks/>
public void si_pp062_bc_senderAsync(dt_pp062_reqDATA[] mt_pp062_req, object userState) {
if ((this.si_pp062_bc_senderOperationCompleted == null)) {
this.si_pp062_bc_senderOperationCompleted = new System.Threading.SendOrPostCallback(this.Onsi_pp062_bc_senderOperationCompleted);
}
this.InvokeAsync("si_pp062_bc_sender", new object[] {
mt_pp062_req}, this.si_pp062_bc_senderOperationCompleted, userState);
}
private void Onsi_pp062_bc_senderOperationCompleted(object arg) {
if ((this.si_pp062_bc_senderCompleted != null)) {
System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
this.si_pp062_bc_senderCompleted(this, new si_pp062_bc_senderCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
}
}
/// <remarks/>
public new void CancelAsync(object userState) {
base.CancelAsync(userState);
}
private bool IsLocalFileSystemWebService(string url) {
if (((url == null)
|| (url == string.Empty))) {
return false;
}
System.Uri wsUri = new System.Uri(url);
if (((wsUri.Port >= 1024)
&& (string.Compare(wsUri.Host, "localHost", System.StringComparison.OrdinalIgnoreCase) == 0))) {
return true;
}
return false;
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.9032.0")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true, Namespace="http://www.hbflavor.com/pp")]
public partial class dt_pp062_reqDATA {
private string sOURCESYSField;
private string tARGETSYSField;
private string uPDATETIMEField;
private string mATNRField;
private string wERKSField;
private string sTLANField;
private string sTLALField;
private string eRDAT_SField;
private string eRDAT_EField;
private string zCATEGField;
private string lKENZField;
private string dATUVField;
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string SOURCESYS {
get {
return this.sOURCESYSField;
}
set {
this.sOURCESYSField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string TARGETSYS {
get {
return this.tARGETSYSField;
}
set {
this.tARGETSYSField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string UPDATETIME {
get {
return this.uPDATETIMEField;
}
set {
this.uPDATETIMEField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string MATNR {
get {
return this.mATNRField;
}
set {
this.mATNRField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string WERKS {
get {
return this.wERKSField;
}
set {
this.wERKSField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string STLAN {
get {
return this.sTLANField;
}
set {
this.sTLANField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string STLAL {
get {
return this.sTLALField;
}
set {
this.sTLALField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string ERDAT_S {
get {
return this.eRDAT_SField;
}
set {
this.eRDAT_SField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string ERDAT_E {
get {
return this.eRDAT_EField;
}
set {
this.eRDAT_EField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string ZCATEG {
get {
return this.zCATEGField;
}
set {
this.zCATEGField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string LKENZ {
get {
return this.lKENZField;
}
set {
this.lKENZField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string DATUV {
get {
return this.dATUVField;
}
set {
this.dATUVField = value;
}
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.9032.0")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://www.hbflavor.com/pp")]
public partial class dt_pp062_res {
private string mSGTYField;
private string mSGTXField;
private dt_pp062_resDATA[] dATAField;
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string MSGTY {
get {
return this.mSGTYField;
}
set {
this.mSGTYField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string MSGTX {
get {
return this.mSGTXField;
}
set {
this.mSGTXField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute("DATA", Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public dt_pp062_resDATA[] DATA {
get {
return this.dATAField;
}
set {
this.dATAField = value;
}
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.9032.0")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true, Namespace="http://www.hbflavor.com/pp")]
public partial class dt_pp062_resDATA {
private string mATNRField;
private string mAKTXField;
private string wERKSField;
private string sTLANField;
private string sTLALField;
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string MATNR {
get {
return this.mATNRField;
}
set {
this.mATNRField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string MAKTX {
get {
return this.mAKTXField;
}
set {
this.mAKTXField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string WERKS {
get {
return this.wERKSField;
}
set {
this.wERKSField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string STLAN {
get {
return this.sTLANField;
}
set {
this.sTLANField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string STLAL {
get {
return this.sTLALField;
}
set {
this.sTLALField = value;
}
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.9032.0")]
public delegate void si_pp062_bc_senderCompletedEventHandler(object sender, si_pp062_bc_senderCompletedEventArgs e);
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.9032.0")]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
public partial class si_pp062_bc_senderCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
private object[] results;
internal si_pp062_bc_senderCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) :
base(exception, cancelled, userState) {
this.results = results;
}
/// <remarks/>
public dt_pp062_res Result {
get {
this.RaiseExceptionIfNecessary();
return ((dt_pp062_res)(this.results[0]));
}
}
}
}
#pragma warning restore 1591

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<DiscoveryClientResultsFile xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Results>
<DiscoveryClientResult referenceType="System.Web.Services.Discovery.ContractReference" url="http://sappoqas.hbglobal.com:50000/dir/wsdl?p=ic/20d87a69c09f303695c195ca7731a2c9" filename="si_pp062_bc_sender.wsdl" />
</Results>
</DiscoveryClientResultsFile>

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
This file is automatically generated by Visual Studio .Net. It is
used to store generic object data source configuration information.
Renaming the file extension or editing the content of this file may
cause the file to be unrecognizable by the program.
-->
<GenericObjectDataSource DisplayName="dt_pp062_res" Version="1.0" xmlns="urn:schemas-microsoft-com:xml-msdatasource">
<TypeInfo>FactorySystemApi.Sap_Formula.dt_pp062_res, Web References.Sap_Formula.Reference.cs.dll, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null</TypeInfo>
</GenericObjectDataSource>

@ -0,0 +1,204 @@
<?xml version="1.0" encoding="utf-8"?>
<wsdl:definitions xmlns:p1="http://www.zmc.com/flavor/pp" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" name="si_pp062_bc_sender" targetNamespace="http://www.zmc.com/flavor/pp" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
<wsdl:documentation />
<wsp:UsingPolicy wsdl:required="true" />
<wsp:Policy wsu:Id="OP_si_pp062_bc_sender" />
<wsdl:types>
<xsd:schema xmlns="http://www.hbflavor.com/pp" targetNamespace="http://www.hbflavor.com/pp" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:complexType name="dt_pp062_res">
<xsd:annotation>
<xsd:documentation xml:lang="EN">response数据类型</xsd:documentation>
<xsd:appinfo source="http://sap.com/xi/VersionID">001603eb0edc11ed97a60000001b7af6</xsd:appinfo>
</xsd:annotation>
<xsd:sequence>
<xsd:element minOccurs="0" name="MSGTY" type="xsd:string">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">b5c8cca8a67c11ec88cb6018953d3d57</xsd:appinfo>
<xsd:documentation>消息类型</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element minOccurs="0" name="MSGTX" type="xsd:string">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">44e2cd7a71b811ecb8f7e86a642def83</xsd:appinfo>
<xsd:documentation>消息文本</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element minOccurs="0" maxOccurs="unbounded" name="DATA">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">44e2f07871b811ecb430e86a642def83</xsd:appinfo>
<xsd:documentation>销售与订单明细对应</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:sequence>
<xsd:element minOccurs="0" name="MATNR" type="xsd:string">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">e594a547a99411ec89a36018953d3d57</xsd:appinfo>
<xsd:documentation>父项物料</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element minOccurs="0" name="MAKTX" type="xsd:string">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">44e2cd8171b811ecc217e86a642def83</xsd:appinfo>
<xsd:documentation>物料描述</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element minOccurs="0" name="WERKS" type="xsd:string">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">85c192e1a65e11ec90d86018953d3d57</xsd:appinfo>
<xsd:documentation>工厂</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element minOccurs="0" name="STLAN" type="xsd:string">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">b5a1faa0a65e11ec99e16018953d3d57</xsd:appinfo>
<xsd:documentation>BOM 用途</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element minOccurs="0" name="STLAL" type="xsd:string">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">909f10fba26e11ecb31b6018953d3d57</xsd:appinfo>
<xsd:documentation>可选BOM</xsd:documentation>
</xsd:annotation>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="dt_pp062_req">
<xsd:annotation>
<xsd:documentation xml:lang="EN">request数据类型</xsd:documentation>
<xsd:appinfo source="http://sap.com/xi/VersionID">732ebfde0ed911edcda30000001b7af6</xsd:appinfo>
</xsd:annotation>
<xsd:sequence>
<xsd:element minOccurs="0" maxOccurs="unbounded" name="DATA">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">3d982b0a66e311ec9012e86a642def83</xsd:appinfo>
<xsd:documentation>输入数据</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:sequence>
<xsd:element minOccurs="0" name="SOURCESYS" type="xsd:string">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">ab218671a99311ec86886018953d3d57</xsd:appinfo>
<xsd:documentation>源系统ID</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element minOccurs="0" name="TARGETSYS" type="xsd:string">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">ab218672a99311ecb30c6018953d3d57</xsd:appinfo>
<xsd:documentation>目标系统ID</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element minOccurs="0" name="UPDATETIME" type="xsd:string">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">ab218673a99311ecb0fb6018953d3d57</xsd:appinfo>
<xsd:documentation>数据时间戳</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element minOccurs="0" name="MATNR" type="xsd:string">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">ab218674a99311ec8a466018953d3d57</xsd:appinfo>
<xsd:documentation>物料</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element minOccurs="0" name="WERKS" type="xsd:string">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">ab218675a99311ecc5bd6018953d3d57</xsd:appinfo>
<xsd:documentation>工厂</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element minOccurs="0" name="STLAN" type="xsd:string">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">ab218676a99311ecba976018953d3d57</xsd:appinfo>
<xsd:documentation>BOM用途</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element minOccurs="0" name="STLAL" type="xsd:string">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">617e0829af0011ec867d6018953d3d57</xsd:appinfo>
<xsd:documentation>可选BOM</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element minOccurs="0" name="ERDAT_S" type="xsd:string">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">ab218677a99311ec90676018953d3d57</xsd:appinfo>
<xsd:documentation>BOM更新起始日期</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element minOccurs="0" name="ERDAT_E" type="xsd:string">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">ab218678a99311eca97d6018953d3d57</xsd:appinfo>
<xsd:documentation>BOM更新结束日期</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element minOccurs="0" name="ZCATEG" type="xsd:string">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">ab218679a99311ecb06f6018953d3d57</xsd:appinfo>
<xsd:documentation>产品分类</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element minOccurs="0" name="LKENZ" type="xsd:string">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">ab21867aa99311ecb6f16018953d3d57</xsd:appinfo>
<xsd:documentation>BOM删除标识</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element minOccurs="0" name="DATUV" type="xsd:string">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">ab21867ba99311eccac26018953d3d57</xsd:appinfo>
<xsd:documentation>有效期自</xsd:documentation>
</xsd:annotation>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:schema>
<xsd:schema xmlns="http://www.zmc.com/flavor/pp" xmlns:p5="http://www.hbflavor.com/pp" targetNamespace="http://www.zmc.com/flavor/pp" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:import namespace="http://www.hbflavor.com/pp" />
<xsd:element name="mt_pp062_res" type="p5:dt_pp062_res" />
<xsd:element name="mt_pp062_req" type="p5:dt_pp062_req" />
</xsd:schema>
</wsdl:types>
<wsdl:message name="mt_pp062_req">
<wsdl:documentation />
<wsdl:part name="mt_pp062_req" element="p1:mt_pp062_req" />
</wsdl:message>
<wsdl:message name="mt_pp062_res">
<wsdl:documentation />
<wsdl:part name="mt_pp062_res" element="p1:mt_pp062_res" />
</wsdl:message>
<wsdl:portType name="si_pp062_bc_sender">
<wsdl:documentation />
<wsdl:operation name="si_pp062_bc_sender">
<wsdl:documentation />
<wsp:Policy>
<wsp:PolicyReference URI="#OP_si_pp062_bc_sender" />
</wsp:Policy>
<wsdl:input message="p1:mt_pp062_req" />
<wsdl:output message="p1:mt_pp062_res" />
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="si_pp062_bc_senderBinding" type="p1:si_pp062_bc_sender">
<binding transport="http://schemas.xmlsoap.org/soap/http" xmlns="http://schemas.xmlsoap.org/wsdl/soap/" />
<wsdl:operation name="si_pp062_bc_sender">
<operation soapAction="http://sap.com/xi/WebService/soap1.1" xmlns="http://schemas.xmlsoap.org/wsdl/soap/" />
<wsdl:input>
<body use="literal" xmlns="http://schemas.xmlsoap.org/wsdl/soap/" />
</wsdl:input>
<wsdl:output>
<body use="literal" xmlns="http://schemas.xmlsoap.org/wsdl/soap/" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="si_pp062_bc_senderService">
<wsdl:port name="HTTP_Port" binding="p1:si_pp062_bc_senderBinding">
<address location="http://sappoqas.hbglobal.com:50000/XISOAPAdapter/MessageServlet?senderParty=&amp;senderService=ZMCS_FLAVOR&amp;receiverParty=&amp;receiverService=&amp;interface=si_pp062_bc_sender&amp;interfaceNamespace=http%3A%2F%2Fwww.zmc.com%2Fflavor%2Fpp" xmlns="http://schemas.xmlsoap.org/wsdl/soap/" />
</wsdl:port>
<wsdl:port name="HTTPS_Port" binding="p1:si_pp062_bc_senderBinding">
<address location="https://sappoqas.hbglobal.com:50001/XISOAPAdapter/MessageServlet?senderParty=&amp;senderService=ZMCS_FLAVOR&amp;receiverParty=&amp;receiverService=&amp;interface=si_pp062_bc_sender&amp;interfaceNamespace=http%3A%2F%2Fwww.zmc.com%2Fflavor%2Fpp" xmlns="http://schemas.xmlsoap.org/wsdl/soap/" />
</wsdl:port>
</wsdl:service>
</wsdl:definitions>

@ -0,0 +1,760 @@
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本:4.0.30319.42000
//
// 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,这些更改将会丢失。
// </auto-generated>
//------------------------------------------------------------------------------
//
// 此源代码是由 Microsoft.VSDesigner 4.0.30319.42000 版自动生成。
//
#pragma warning disable 1591
namespace FactorySystemApi.Sap_Group {
using System;
using System.Web.Services;
using System.Diagnostics;
using System.Web.Services.Protocols;
using System.Xml.Serialization;
using System.ComponentModel;
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.9032.0")]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Web.Services.WebServiceBindingAttribute(Name="si_pp071_mcs_senderBinding", Namespace="http://www.zmc.com/flavor/pp")]
public partial class si_pp071_mcs_senderService : System.Web.Services.Protocols.SoapHttpClientProtocol {
private System.Threading.SendOrPostCallback si_pp071_mcs_senderOperationCompleted;
private bool useDefaultCredentialsSetExplicitly;
/// <remarks/>
public si_pp071_mcs_senderService() {
this.Url = global::FactorySystemApi.Properties.Settings.Default.Sap_Group;
if ((this.IsLocalFileSystemWebService(this.Url) == true)) {
this.UseDefaultCredentials = true;
this.useDefaultCredentialsSetExplicitly = false;
}
else {
this.useDefaultCredentialsSetExplicitly = true;
}
}
public new string Url {
get {
return base.Url;
}
set {
if ((((this.IsLocalFileSystemWebService(base.Url) == true)
&& (this.useDefaultCredentialsSetExplicitly == false))
&& (this.IsLocalFileSystemWebService(value) == false))) {
base.UseDefaultCredentials = false;
}
base.Url = value;
}
}
public new bool UseDefaultCredentials {
get {
return base.UseDefaultCredentials;
}
set {
base.UseDefaultCredentials = value;
this.useDefaultCredentialsSetExplicitly = true;
}
}
/// <remarks/>
public event si_pp071_mcs_senderCompletedEventHandler si_pp071_mcs_senderCompleted;
/// <remarks/>
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://sap.com/xi/WebService/soap1.1", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Bare)]
[return: System.Xml.Serialization.XmlArrayAttribute("mt_pp071_res", Namespace="http://www.zmc.com/flavor/pp")]
[return: System.Xml.Serialization.XmlArrayItemAttribute("DATA", Form=System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable=false)]
public dt_pp071_resDATA[] si_pp071_mcs_sender([System.Xml.Serialization.XmlElementAttribute(Namespace="http://www.zmc.com/flavor/pp")] dt_pp071_req mt_pp071_req) {
object[] results = this.Invoke("si_pp071_mcs_sender", new object[] {
mt_pp071_req});
return ((dt_pp071_resDATA[])(results[0]));
}
/// <remarks/>
public void si_pp071_mcs_senderAsync(dt_pp071_req mt_pp071_req) {
this.si_pp071_mcs_senderAsync(mt_pp071_req, null);
}
/// <remarks/>
public void si_pp071_mcs_senderAsync(dt_pp071_req mt_pp071_req, object userState) {
if ((this.si_pp071_mcs_senderOperationCompleted == null)) {
this.si_pp071_mcs_senderOperationCompleted = new System.Threading.SendOrPostCallback(this.Onsi_pp071_mcs_senderOperationCompleted);
}
this.InvokeAsync("si_pp071_mcs_sender", new object[] {
mt_pp071_req}, this.si_pp071_mcs_senderOperationCompleted, userState);
}
private void Onsi_pp071_mcs_senderOperationCompleted(object arg) {
if ((this.si_pp071_mcs_senderCompleted != null)) {
System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
this.si_pp071_mcs_senderCompleted(this, new si_pp071_mcs_senderCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
}
}
/// <remarks/>
public new void CancelAsync(object userState) {
base.CancelAsync(userState);
}
private bool IsLocalFileSystemWebService(string url) {
if (((url == null)
|| (url == string.Empty))) {
return false;
}
System.Uri wsUri = new System.Uri(url);
if (((wsUri.Port >= 1024)
&& (string.Compare(wsUri.Host, "localHost", System.StringComparison.OrdinalIgnoreCase) == 0))) {
return true;
}
return false;
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.9032.0")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://www.hbflavor.com/pp")]
public partial class dt_pp071_req {
private string sOURCESYSField;
private string tARGETSYSField;
private string uPDATETIMEField;
private dt_pp071_reqHEAD[] hEADField;
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string SOURCESYS {
get {
return this.sOURCESYSField;
}
set {
this.sOURCESYSField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string TARGETSYS {
get {
return this.tARGETSYSField;
}
set {
this.tARGETSYSField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string UPDATETIME {
get {
return this.uPDATETIMEField;
}
set {
this.uPDATETIMEField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute("HEAD", Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public dt_pp071_reqHEAD[] HEAD {
get {
return this.hEADField;
}
set {
this.hEADField = value;
}
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.9032.0")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true, Namespace="http://www.hbflavor.com/pp")]
public partial class dt_pp071_reqHEAD {
private string wERKSField;
private string dATUVField;
private string mATNRField;
private string pLNALField;
private string vERWEField;
private string sTATUField;
private string lOSVNField;
private string lOSBSField;
private string kTEXTField;
private dt_pp071_reqHEADITEM[] iTEMField;
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string WERKS {
get {
return this.wERKSField;
}
set {
this.wERKSField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string DATUV {
get {
return this.dATUVField;
}
set {
this.dATUVField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string MATNR {
get {
return this.mATNRField;
}
set {
this.mATNRField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string PLNAL {
get {
return this.pLNALField;
}
set {
this.pLNALField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string VERWE {
get {
return this.vERWEField;
}
set {
this.vERWEField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string STATU {
get {
return this.sTATUField;
}
set {
this.sTATUField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string LOSVN {
get {
return this.lOSVNField;
}
set {
this.lOSVNField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string LOSBS {
get {
return this.lOSBSField;
}
set {
this.lOSBSField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string KTEXT {
get {
return this.kTEXTField;
}
set {
this.kTEXTField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute("ITEM", Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public dt_pp071_reqHEADITEM[] ITEM {
get {
return this.iTEMField;
}
set {
this.iTEMField = value;
}
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.9032.0")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true, Namespace="http://www.hbflavor.com/pp")]
public partial class dt_pp071_reqHEADITEM {
private string bMSCHField;
private string pLNMEField;
private string vORNRField;
private string aRBPLField;
private string sTEUSField;
private string lTXA1Field;
private string vGW01Field;
private string vGE01Field;
private string vGW02Field;
private string vGE02Field;
private string vGW03Field;
private string vGE03Field;
private string vGW04Field;
private string vGE04Field;
private string vGW05Field;
private string vGE05Field;
private string vGW06Field;
private string vGE06Field;
private string vGW07Field;
private string vGE07Field;
private string vGW08Field;
private string vGE08Field;
private string vGW09Field;
private string vGE09Field;
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string BMSCH {
get {
return this.bMSCHField;
}
set {
this.bMSCHField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string PLNME {
get {
return this.pLNMEField;
}
set {
this.pLNMEField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string VORNR {
get {
return this.vORNRField;
}
set {
this.vORNRField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string ARBPL {
get {
return this.aRBPLField;
}
set {
this.aRBPLField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string STEUS {
get {
return this.sTEUSField;
}
set {
this.sTEUSField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string LTXA1 {
get {
return this.lTXA1Field;
}
set {
this.lTXA1Field = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string VGW01 {
get {
return this.vGW01Field;
}
set {
this.vGW01Field = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string VGE01 {
get {
return this.vGE01Field;
}
set {
this.vGE01Field = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string VGW02 {
get {
return this.vGW02Field;
}
set {
this.vGW02Field = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string VGE02 {
get {
return this.vGE02Field;
}
set {
this.vGE02Field = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string VGW03 {
get {
return this.vGW03Field;
}
set {
this.vGW03Field = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string VGE03 {
get {
return this.vGE03Field;
}
set {
this.vGE03Field = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string VGW04 {
get {
return this.vGW04Field;
}
set {
this.vGW04Field = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string VGE04 {
get {
return this.vGE04Field;
}
set {
this.vGE04Field = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string VGW05 {
get {
return this.vGW05Field;
}
set {
this.vGW05Field = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string VGE05 {
get {
return this.vGE05Field;
}
set {
this.vGE05Field = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string VGW06 {
get {
return this.vGW06Field;
}
set {
this.vGW06Field = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string VGE06 {
get {
return this.vGE06Field;
}
set {
this.vGE06Field = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string VGW07 {
get {
return this.vGW07Field;
}
set {
this.vGW07Field = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string VGE07 {
get {
return this.vGE07Field;
}
set {
this.vGE07Field = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string VGW08 {
get {
return this.vGW08Field;
}
set {
this.vGW08Field = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string VGE08 {
get {
return this.vGE08Field;
}
set {
this.vGE08Field = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string VGW09 {
get {
return this.vGW09Field;
}
set {
this.vGW09Field = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string VGE09 {
get {
return this.vGE09Field;
}
set {
this.vGE09Field = value;
}
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.9032.0")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true, Namespace="http://www.hbflavor.com/pp")]
public partial class dt_pp071_resDATA {
private string mSGTYField;
private string mSGTXField;
private string pLNNRField;
private string pLNALField;
private string mATNRField;
private string wERKSField;
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string MSGTY {
get {
return this.mSGTYField;
}
set {
this.mSGTYField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string MSGTX {
get {
return this.mSGTXField;
}
set {
this.mSGTXField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string PLNNR {
get {
return this.pLNNRField;
}
set {
this.pLNNRField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string PLNAL {
get {
return this.pLNALField;
}
set {
this.pLNALField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string MATNR {
get {
return this.mATNRField;
}
set {
this.mATNRField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string WERKS {
get {
return this.wERKSField;
}
set {
this.wERKSField = value;
}
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.9032.0")]
public delegate void si_pp071_mcs_senderCompletedEventHandler(object sender, si_pp071_mcs_senderCompletedEventArgs e);
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.9032.0")]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
public partial class si_pp071_mcs_senderCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
private object[] results;
internal si_pp071_mcs_senderCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) :
base(exception, cancelled, userState) {
this.results = results;
}
/// <remarks/>
public dt_pp071_resDATA[] Result {
get {
this.RaiseExceptionIfNecessary();
return ((dt_pp071_resDATA[])(this.results[0]));
}
}
}
}
#pragma warning restore 1591

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<DiscoveryClientResultsFile xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Results>
<DiscoveryClientResult referenceType="System.Web.Services.Discovery.ContractReference" url="http://sappoqas.hbglobal.com:50000/dir/wsdl?p=ic/e07e48bca18c3ffa84b2e1cc3d2ca0b6" filename="si_pp071_mcs_sender.wsdl" />
</Results>
</DiscoveryClientResultsFile>

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
This file is automatically generated by Visual Studio .Net. It is
used to store generic object data source configuration information.
Renaming the file extension or editing the content of this file may
cause the file to be unrecognizable by the program.
-->
<GenericObjectDataSource DisplayName="dt_pp071_resDATA" Version="1.0" xmlns="urn:schemas-microsoft-com:xml-msdatasource">
<TypeInfo>FactorySystemApi.Sap_Group.dt_pp071_resDATA, Web References.Sap_Group.Reference.cs.dll, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null</TypeInfo>
</GenericObjectDataSource>

@ -0,0 +1,352 @@
<?xml version="1.0" encoding="utf-8"?>
<wsdl:definitions xmlns:p1="http://www.zmc.com/flavor/pp" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" name="si_pp071_mcs_sender" targetNamespace="http://www.zmc.com/flavor/pp" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
<wsdl:documentation />
<wsp:UsingPolicy wsdl:required="true" />
<wsp:Policy wsu:Id="OP_si_pp071_mcs_sender" />
<wsdl:types>
<xsd:schema xmlns="http://www.hbflavor.com/pp" targetNamespace="http://www.hbflavor.com/pp" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:complexType name="dt_pp071_res">
<xsd:annotation>
<xsd:documentation xml:lang="EN">response数据类型</xsd:documentation>
<xsd:appinfo source="http://sap.com/xi/VersionID">721939b013bb11ed901d0000001b7af6</xsd:appinfo>
</xsd:annotation>
<xsd:sequence>
<xsd:element minOccurs="0" maxOccurs="unbounded" name="DATA">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">44e2f07871b811ecb430e86a642def83</xsd:appinfo>
<xsd:documentation>销售与订单明细对应</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:sequence>
<xsd:element minOccurs="0" name="MSGTY" type="xsd:string">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">e594a547a99411ec89a36018953d3d57</xsd:appinfo>
<xsd:documentation>消息类型</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element minOccurs="0" name="MSGTX" type="xsd:string">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">f0b3d3fd12f811ed9c646018953d3d57</xsd:appinfo>
<xsd:documentation>消息文本</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element minOccurs="0" name="PLNNR" type="xsd:string">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">f0b3d3fe12f811ed90ee6018953d3d57</xsd:appinfo>
<xsd:documentation>工艺路线组</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element minOccurs="0" name="PLNAL" type="xsd:string">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">44e2cd8171b811ecc217e86a642def83</xsd:appinfo>
<xsd:documentation>组计数器</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element minOccurs="0" name="MATNR" type="xsd:string">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">85c192e1a65e11ec90d86018953d3d57</xsd:appinfo>
<xsd:documentation>物料</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element minOccurs="0" name="WERKS" type="xsd:string">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">71f4c5b113bb11edc3af6018953d3d57</xsd:appinfo>
<xsd:documentation>工厂</xsd:documentation>
</xsd:annotation>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="dt_pp071_req">
<xsd:annotation>
<xsd:documentation xml:lang="EN">request数据类型</xsd:documentation>
<xsd:appinfo source="http://sap.com/xi/VersionID">9847a7fa12f311ed93080000001b7af6</xsd:appinfo>
</xsd:annotation>
<xsd:sequence>
<xsd:element name="SOURCESYS" type="xsd:string">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">40f38bac12f011ed80536018953d3d57</xsd:appinfo>
<xsd:documentation>源系统ID</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="TARGETSYS" type="xsd:string">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">40f38bad12f011ed8ac56018953d3d57</xsd:appinfo>
<xsd:documentation>目标系统ID</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="UPDATETIME" type="xsd:string">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">40f38bae12f011edcace6018953d3d57</xsd:appinfo>
<xsd:documentation>数据时间戳</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element minOccurs="0" maxOccurs="unbounded" name="HEAD">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">40f38bb412f011eda7036018953d3d57</xsd:appinfo>
<xsd:documentation>工艺路线抬头表</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:sequence>
<xsd:element name="WERKS" type="xsd:string">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">40f38baf12f011ed8f076018953d3d57</xsd:appinfo>
<xsd:documentation>工厂</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="DATUV" type="xsd:string">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">40f38bb012f011edb0256018953d3d57</xsd:appinfo>
<xsd:documentation>生效日期</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="MATNR" type="xsd:string">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">40f38bb112f011edc3816018953d3d57</xsd:appinfo>
<xsd:documentation>物料</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="PLNAL" type="xsd:string">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">40f38bb212f011edc52a6018953d3d57</xsd:appinfo>
<xsd:documentation>组计数器</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="VERWE" type="xsd:string">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">40f38bb312f011ed98766018953d3d57</xsd:appinfo>
<xsd:documentation>用途</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="STATU" type="xsd:string">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">7d5fd91a12f011ed94616018953d3d57</xsd:appinfo>
<xsd:documentation>状态</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="LOSVN" type="xsd:string">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">8b121c6112f011edc9416018953d3d57</xsd:appinfo>
<xsd:documentation>从批量</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="LOSBS" type="xsd:string">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">98d7af0d12f011ed81786018953d3d57</xsd:appinfo>
<xsd:documentation>到批量</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="KTEXT" type="xsd:string">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">b23ce2f912f011edb4276018953d3d57</xsd:appinfo>
<xsd:documentation>工艺路线描述</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element minOccurs="0" maxOccurs="unbounded" name="ITEM">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">cf06554a12f011edc1616018953d3d57</xsd:appinfo>
<xsd:documentation>工艺路线行项目表</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:sequence>
<xsd:element name="BMSCH" type="xsd:string">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">df5ce45312f011edaf6c6018953d3d57</xsd:appinfo>
<xsd:documentation>基本数量</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="PLNME" type="xsd:string">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">f5c0361b12f011ed9f636018953d3d57</xsd:appinfo>
<xsd:documentation>工序单位</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="VORNR" type="xsd:string">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">040b340b12f111ed8c936018953d3d57</xsd:appinfo>
<xsd:documentation>工序编号</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="ARBPL" type="xsd:string">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">57cfeb1512f211ed95606018953d3d57</xsd:appinfo>
<xsd:documentation>工作中心</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="STEUS" type="xsd:string">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">917a453d12f211ed99c56018953d3d57</xsd:appinfo>
<xsd:documentation>控制码</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="LTXA1" type="xsd:string">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">9f695ef712f211ed83b06018953d3d57</xsd:appinfo>
<xsd:documentation>工序描述</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="VGW01" type="xsd:string">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">b04fc7e812f211ed9e486018953d3d57</xsd:appinfo>
<xsd:documentation>人工(直接)</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="VGE01" type="xsd:string">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">2542cb4212f311eda7336018953d3d57</xsd:appinfo>
<xsd:documentation>人工直接工时单位</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="VGW02" type="xsd:string">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">576985b112f311edbf296018953d3d57</xsd:appinfo>
<xsd:documentation>人工(间接)</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="VGE02" type="xsd:string">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">576985b212f311edc1d16018953d3d57</xsd:appinfo>
<xsd:documentation>人工间接工时单位</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="VGW03" type="xsd:string">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">66b8795b12f311edba5b6018953d3d57</xsd:appinfo>
<xsd:documentation>机器工时</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="VGE03" type="xsd:string">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">983a1c4312f311eda6a46018953d3d57</xsd:appinfo>
<xsd:documentation>机器工时单位</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="VGW04" type="xsd:string">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">a4a9253212f311eda1666018953d3d57</xsd:appinfo>
<xsd:documentation></xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="VGE04" type="xsd:string">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">b343491212f311edc4026018953d3d57</xsd:appinfo>
<xsd:documentation>电单位</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="VGW05" type="xsd:string">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">c2899bbc12f311edcbf76018953d3d57</xsd:appinfo>
<xsd:documentation></xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="VGE05" type="xsd:string">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">d313f48d12f311ed8f656018953d3d57</xsd:appinfo>
<xsd:documentation>水单位</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="VGW06" type="xsd:string">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">e098fd0e12f311ed83896018953d3d57</xsd:appinfo>
<xsd:documentation>蒸汽</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="VGE06" type="xsd:string">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">ffa010eb12f311edb09b6018953d3d57</xsd:appinfo>
<xsd:documentation>蒸汽单位</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="VGW07" type="xsd:string">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">0ccabca912f411ed83336018953d3d57</xsd:appinfo>
<xsd:documentation>物耗仓储运输</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="VGE07" type="xsd:string">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">185679c412f411edbc656018953d3d57</xsd:appinfo>
<xsd:documentation>物耗仓储运输单位</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="VGW08" type="xsd:string">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">24469ea312f411edc4646018953d3d57</xsd:appinfo>
<xsd:documentation>其他</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="VGE08" type="xsd:string">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">32dc809312f411ed93076018953d3d57</xsd:appinfo>
<xsd:documentation>其他单位</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="VGW09" type="xsd:string">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">3f74274012f411edb0346018953d3d57</xsd:appinfo>
<xsd:documentation>环保支出</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="VGE09" type="xsd:string">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">4c6e4b7912f411edb06a6018953d3d57</xsd:appinfo>
<xsd:documentation>环保支出单位</xsd:documentation>
</xsd:annotation>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:schema>
<xsd:schema xmlns="http://www.zmc.com/flavor/pp" xmlns:p5="http://www.hbflavor.com/pp" targetNamespace="http://www.zmc.com/flavor/pp" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:import namespace="http://www.hbflavor.com/pp" />
<xsd:element name="mt_pp071_res" type="p5:dt_pp071_res" />
<xsd:element name="mt_pp071_req" type="p5:dt_pp071_req" />
</xsd:schema>
</wsdl:types>
<wsdl:message name="mt_pp071_req">
<wsdl:documentation />
<wsdl:part name="mt_pp071_req" element="p1:mt_pp071_req" />
</wsdl:message>
<wsdl:message name="mt_pp071_res">
<wsdl:documentation />
<wsdl:part name="mt_pp071_res" element="p1:mt_pp071_res" />
</wsdl:message>
<wsdl:portType name="si_pp071_mcs_sender">
<wsdl:documentation />
<wsdl:operation name="si_pp071_mcs_sender">
<wsdl:documentation />
<wsp:Policy>
<wsp:PolicyReference URI="#OP_si_pp071_mcs_sender" />
</wsp:Policy>
<wsdl:input message="p1:mt_pp071_req" />
<wsdl:output message="p1:mt_pp071_res" />
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="si_pp071_mcs_senderBinding" type="p1:si_pp071_mcs_sender">
<binding transport="http://schemas.xmlsoap.org/soap/http" xmlns="http://schemas.xmlsoap.org/wsdl/soap/" />
<wsdl:operation name="si_pp071_mcs_sender">
<operation soapAction="http://sap.com/xi/WebService/soap1.1" xmlns="http://schemas.xmlsoap.org/wsdl/soap/" />
<wsdl:input>
<body use="literal" xmlns="http://schemas.xmlsoap.org/wsdl/soap/" />
</wsdl:input>
<wsdl:output>
<body use="literal" xmlns="http://schemas.xmlsoap.org/wsdl/soap/" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="si_pp071_mcs_senderService">
<wsdl:port name="HTTP_Port" binding="p1:si_pp071_mcs_senderBinding">
<address location="http://sappoqas.hbglobal.com:50000/XISOAPAdapter/MessageServlet?senderParty=&amp;senderService=ZMCS_FLAVOR&amp;receiverParty=&amp;receiverService=&amp;interface=si_pp071_mcs_sender&amp;interfaceNamespace=http%3A%2F%2Fwww.zmc.com%2Fflavor%2Fpp" xmlns="http://schemas.xmlsoap.org/wsdl/soap/" />
</wsdl:port>
<wsdl:port name="HTTPS_Port" binding="p1:si_pp071_mcs_senderBinding">
<address location="https://sappoqas.hbglobal.com:50001/XISOAPAdapter/MessageServlet?senderParty=&amp;senderService=ZMCS_FLAVOR&amp;receiverParty=&amp;receiverService=&amp;interface=si_pp071_mcs_sender&amp;interfaceNamespace=http%3A%2F%2Fwww.zmc.com%2Fflavor%2Fpp" xmlns="http://schemas.xmlsoap.org/wsdl/soap/" />
</wsdl:port>
</wsdl:service>
</wsdl:definitions>

@ -0,0 +1,425 @@
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本:4.0.30319.42000
//
// 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,这些更改将会丢失。
// </auto-generated>
//------------------------------------------------------------------------------
//
// 此源代码是由 Microsoft.VSDesigner 4.0.30319.42000 版自动生成。
//
#pragma warning disable 1591
namespace FactorySystemApi.Sap_Material1 {
using System;
using System.Web.Services;
using System.Diagnostics;
using System.Web.Services.Protocols;
using System.Xml.Serialization;
using System.ComponentModel;
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.9032.0")]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Web.Services.WebServiceBindingAttribute(Name="si_mm100_mcs_senderBinding", Namespace="http://www.zmc.com/flavor/mm")]
public partial class si_mm100_mcs_senderService : System.Web.Services.Protocols.SoapHttpClientProtocol {
private System.Threading.SendOrPostCallback si_mm100_mcs_senderOperationCompleted;
private bool useDefaultCredentialsSetExplicitly;
/// <remarks/>
public si_mm100_mcs_senderService() {
this.Url = global::FactorySystemApi.Properties.Settings.Default.Sap_Material;
if ((this.IsLocalFileSystemWebService(this.Url) == true)) {
this.UseDefaultCredentials = true;
this.useDefaultCredentialsSetExplicitly = false;
}
else {
this.useDefaultCredentialsSetExplicitly = true;
}
}
public new string Url {
get {
return base.Url;
}
set {
if ((((this.IsLocalFileSystemWebService(base.Url) == true)
&& (this.useDefaultCredentialsSetExplicitly == false))
&& (this.IsLocalFileSystemWebService(value) == false))) {
base.UseDefaultCredentials = false;
}
base.Url = value;
}
}
public new bool UseDefaultCredentials {
get {
return base.UseDefaultCredentials;
}
set {
base.UseDefaultCredentials = value;
this.useDefaultCredentialsSetExplicitly = true;
}
}
/// <remarks/>
public event si_mm100_mcs_senderCompletedEventHandler si_mm100_mcs_senderCompleted;
/// <remarks/>
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://sap.com/xi/WebService/soap1.1", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Bare)]
[return: System.Xml.Serialization.XmlElementAttribute("mt_mm100_res", Namespace="http://www.zmc.com/flavor/mm")]
public dt_mm100_res si_mm100_mcs_sender([System.Xml.Serialization.XmlElementAttribute(Namespace="http://www.zmc.com/flavor/mm")] dt_mm100_req mt_mm100_req) {
object[] results = this.Invoke("si_mm100_mcs_sender", new object[] {
mt_mm100_req});
return ((dt_mm100_res)(results[0]));
}
/// <remarks/>
public void si_mm100_mcs_senderAsync(dt_mm100_req mt_mm100_req) {
this.si_mm100_mcs_senderAsync(mt_mm100_req, null);
}
/// <remarks/>
public void si_mm100_mcs_senderAsync(dt_mm100_req mt_mm100_req, object userState) {
if ((this.si_mm100_mcs_senderOperationCompleted == null)) {
this.si_mm100_mcs_senderOperationCompleted = new System.Threading.SendOrPostCallback(this.Onsi_mm100_mcs_senderOperationCompleted);
}
this.InvokeAsync("si_mm100_mcs_sender", new object[] {
mt_mm100_req}, this.si_mm100_mcs_senderOperationCompleted, userState);
}
private void Onsi_mm100_mcs_senderOperationCompleted(object arg) {
if ((this.si_mm100_mcs_senderCompleted != null)) {
System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
this.si_mm100_mcs_senderCompleted(this, new si_mm100_mcs_senderCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
}
}
/// <remarks/>
public new void CancelAsync(object userState) {
base.CancelAsync(userState);
}
private bool IsLocalFileSystemWebService(string url) {
if (((url == null)
|| (url == string.Empty))) {
return false;
}
System.Uri wsUri = new System.Uri(url);
if (((wsUri.Port >= 1024)
&& (string.Compare(wsUri.Host, "localHost", System.StringComparison.OrdinalIgnoreCase) == 0))) {
return true;
}
return false;
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.9032.0")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://www.hbflavor.com/mm")]
public partial class dt_mm100_req {
private string wERKSField;
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string WERKS {
get {
return this.wERKSField;
}
set {
this.wERKSField = value;
}
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.9032.0")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://www.hbflavor.com/mm")]
public partial class dt_mm100_res {
private string mSGTYField;
private string mSGTXField;
private dt_mm100_resDATA[] dATAField;
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string MSGTY {
get {
return this.mSGTYField;
}
set {
this.mSGTYField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string MSGTX {
get {
return this.mSGTXField;
}
set {
this.mSGTXField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute("DATA", Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public dt_mm100_resDATA[] DATA {
get {
return this.dATAField;
}
set {
this.dATAField = value;
}
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.9032.0")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true, Namespace="http://www.hbflavor.com/mm")]
public partial class dt_mm100_resDATA {
private string mATNRField;
private string wERKSField;
private string bISMTField;
private string mEINSField;
private string eXTWGField;
private string mATKLField;
private string mTARTField;
private string zCATEGField;
private string mSTDEField;
private string vOLEHField;
private string gROESField;
private string nUMTPField;
private string eKGRPField;
private string mAKTXField;
private string zJWLHField;
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string MATNR {
get {
return this.mATNRField;
}
set {
this.mATNRField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string WERKS {
get {
return this.wERKSField;
}
set {
this.wERKSField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string BISMT {
get {
return this.bISMTField;
}
set {
this.bISMTField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string MEINS {
get {
return this.mEINSField;
}
set {
this.mEINSField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string EXTWG {
get {
return this.eXTWGField;
}
set {
this.eXTWGField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string MATKL {
get {
return this.mATKLField;
}
set {
this.mATKLField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string MTART {
get {
return this.mTARTField;
}
set {
this.mTARTField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string ZCATEG {
get {
return this.zCATEGField;
}
set {
this.zCATEGField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string MSTDE {
get {
return this.mSTDEField;
}
set {
this.mSTDEField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string VOLEH {
get {
return this.vOLEHField;
}
set {
this.vOLEHField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string GROES {
get {
return this.gROESField;
}
set {
this.gROESField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string NUMTP {
get {
return this.nUMTPField;
}
set {
this.nUMTPField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string EKGRP {
get {
return this.eKGRPField;
}
set {
this.eKGRPField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string MAKTX {
get {
return this.mAKTXField;
}
set {
this.mAKTXField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string ZJWLH {
get {
return this.zJWLHField;
}
set {
this.zJWLHField = value;
}
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.9032.0")]
public delegate void si_mm100_mcs_senderCompletedEventHandler(object sender, si_mm100_mcs_senderCompletedEventArgs e);
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.9032.0")]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
public partial class si_mm100_mcs_senderCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
private object[] results;
internal si_mm100_mcs_senderCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) :
base(exception, cancelled, userState) {
this.results = results;
}
/// <remarks/>
public dt_mm100_res Result {
get {
this.RaiseExceptionIfNecessary();
return ((dt_mm100_res)(this.results[0]));
}
}
}
}
#pragma warning restore 1591

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<DiscoveryClientResultsFile xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Results>
<DiscoveryClientResult referenceType="System.Web.Services.Discovery.ContractReference" url="http://sappoqas.hbglobal.com:50000/dir/wsdl?p=ic/e90f0ead833c328aba271c10a4d823e2" filename="si_mm100_mcs_sender.wsdl" />
</Results>
</DiscoveryClientResultsFile>

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
This file is automatically generated by Visual Studio .Net. It is
used to store generic object data source configuration information.
Renaming the file extension or editing the content of this file may
cause the file to be unrecognizable by the program.
-->
<GenericObjectDataSource DisplayName="dt_mm100_res" Version="1.0" xmlns="urn:schemas-microsoft-com:xml-msdatasource">
<TypeInfo>FactorySystemApi.Sap_Material1.dt_mm100_res, Web References.Sap_Material1.Reference.cs.dll, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null</TypeInfo>
</GenericObjectDataSource>

@ -0,0 +1,188 @@
<?xml version="1.0" encoding="utf-8"?>
<wsdl:definitions xmlns:p1="http://www.zmc.com/flavor/mm" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" name="si_mm100_mcs_sender" targetNamespace="http://www.zmc.com/flavor/mm" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
<wsdl:documentation />
<wsp:UsingPolicy wsdl:required="true" />
<wsp:Policy wsu:Id="OP_si_mm100_mcs_sender" />
<wsdl:types>
<xsd:schema xmlns="http://www.hbflavor.com/mm" targetNamespace="http://www.hbflavor.com/mm" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:complexType name="dt_mm100_req">
<xsd:annotation>
<xsd:documentation xml:lang="EN">输入参数DT</xsd:documentation>
<xsd:appinfo source="http://sap.com/xi/VersionID">322e5698147d11edbe950000001b7af6</xsd:appinfo>
</xsd:annotation>
<xsd:sequence>
<xsd:element minOccurs="0" name="WERKS" type="xsd:string">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">7fb5b0ee147d11ed953a6018953d3d57</xsd:appinfo>
<xsd:documentation>工厂</xsd:documentation>
</xsd:annotation>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="dt_mm100_res">
<xsd:annotation>
<xsd:documentation xml:lang="EN">输出参数DT</xsd:documentation>
<xsd:appinfo source="http://sap.com/xi/VersionID">2bb8c3b23fc911ed8c900000001b7af6</xsd:appinfo>
</xsd:annotation>
<xsd:sequence>
<xsd:element minOccurs="0" name="MSGTY" type="xsd:string">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">6ac9183608c211ed84376018953d3d57</xsd:appinfo>
<xsd:documentation>返回消息类型</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element minOccurs="0" name="MSGTX" type="xsd:string">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">8bf4845308c211ed9d7d6018953d3d57</xsd:appinfo>
<xsd:documentation>返回消息</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element minOccurs="0" maxOccurs="unbounded" name="DATA">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">56cf530e147e11eda4fb6018953d3d57</xsd:appinfo>
<xsd:documentation>返回结果</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:sequence>
<xsd:element minOccurs="0" name="MATNR" type="xsd:string">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">c6ae2940147e11edaf1d6018953d3d57</xsd:appinfo>
<xsd:documentation>物料编码</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element minOccurs="0" name="WERKS" type="xsd:string">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">c6ae57b7147e11ed96be6018953d3d57</xsd:appinfo>
<xsd:documentation>工厂</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element minOccurs="0" name="BISMT" type="xsd:string">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">c6ae57b8147e11edcdc26018953d3d57</xsd:appinfo>
<xsd:documentation>试验号</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element minOccurs="0" name="MEINS" type="xsd:string">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">d46e142d147e11edb03e6018953d3d57</xsd:appinfo>
<xsd:documentation>基本计量单位</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element minOccurs="0" name="EXTWG" type="xsd:string">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">f88ba33d147e11edaf9d6018953d3d57</xsd:appinfo>
<xsd:documentation>物料描述(中文)</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element minOccurs="0" name="MATKL" type="xsd:string">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">045bebc7147f11edbb606018953d3d57</xsd:appinfo>
<xsd:documentation>物料组</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element minOccurs="0" name="MTART" type="xsd:string">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">1079e79d147f11ed9ec86018953d3d57</xsd:appinfo>
<xsd:documentation>物料类型</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element minOccurs="0" name="ZCATEG" type="xsd:string">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">2ba7d5953fc911eda0eb6018953d3d57</xsd:appinfo>
<xsd:documentation>产品分类</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element minOccurs="0" name="MSTDE" type="xsd:string">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">54a52a2c147f11edce2e6018953d3d57</xsd:appinfo>
<xsd:documentation>有效起始期</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element minOccurs="0" name="VOLEH" type="xsd:string">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">63ee3cf6147f11edaa0b6018953d3d57</xsd:appinfo>
<xsd:documentation>体积单位</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element minOccurs="0" name="GROES" type="xsd:string">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">6d91735d147f11ed9b3c6018953d3d57</xsd:appinfo>
<xsd:documentation>大小/量纲</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element minOccurs="0" name="NUMTP" type="xsd:string">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">916704d7147f11edc6536018953d3d57</xsd:appinfo>
<xsd:documentation>EAN类别</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element minOccurs="0" name="EKGRP" type="xsd:string">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">916704d8147f11edad416018953d3d57</xsd:appinfo>
<xsd:documentation>采购组</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element minOccurs="0" name="MAKTX" type="xsd:string">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">a0c8348c147f11ed93de6018953d3d57</xsd:appinfo>
<xsd:documentation>物料描述(英文)</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element minOccurs="0" name="ZJWLH" type="xsd:string">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">cdd63db4147f11edb4966018953d3d57</xsd:appinfo>
<xsd:documentation>工厂旧物料号</xsd:documentation>
</xsd:annotation>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:schema>
<xsd:schema xmlns="http://www.zmc.com/flavor/mm" xmlns:p10="http://www.hbflavor.com/mm" targetNamespace="http://www.zmc.com/flavor/mm" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:import namespace="http://www.hbflavor.com/mm" />
<xsd:element name="mt_mm100_res" type="p10:dt_mm100_res" />
<xsd:element name="mt_mm100_req" type="p10:dt_mm100_req" />
</xsd:schema>
</wsdl:types>
<wsdl:message name="mt_mm100_req">
<wsdl:documentation />
<wsdl:part name="mt_mm100_req" element="p1:mt_mm100_req" />
</wsdl:message>
<wsdl:message name="mt_mm100_res">
<wsdl:documentation />
<wsdl:part name="mt_mm100_res" element="p1:mt_mm100_res" />
</wsdl:message>
<wsdl:portType name="si_mm100_mcs_sender">
<wsdl:documentation />
<wsdl:operation name="si_mm100_mcs_sender">
<wsdl:documentation />
<wsp:Policy>
<wsp:PolicyReference URI="#OP_si_mm100_mcs_sender" />
</wsp:Policy>
<wsdl:input message="p1:mt_mm100_req" />
<wsdl:output message="p1:mt_mm100_res" />
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="si_mm100_mcs_senderBinding" type="p1:si_mm100_mcs_sender">
<binding transport="http://schemas.xmlsoap.org/soap/http" xmlns="http://schemas.xmlsoap.org/wsdl/soap/" />
<wsdl:operation name="si_mm100_mcs_sender">
<operation soapAction="http://sap.com/xi/WebService/soap1.1" xmlns="http://schemas.xmlsoap.org/wsdl/soap/" />
<wsdl:input>
<body use="literal" xmlns="http://schemas.xmlsoap.org/wsdl/soap/" />
</wsdl:input>
<wsdl:output>
<body use="literal" xmlns="http://schemas.xmlsoap.org/wsdl/soap/" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="si_mm100_mcs_senderService">
<wsdl:port name="HTTP_Port" binding="p1:si_mm100_mcs_senderBinding">
<address location="http://sappoqas.hbglobal.com:50000/XISOAPAdapter/MessageServlet?senderParty=&amp;senderService=ZMCS_FLAVOR&amp;receiverParty=&amp;receiverService=&amp;interface=si_mm100_mcs_sender&amp;interfaceNamespace=http%3A%2F%2Fwww.zmc.com%2Fflavor%2Fmm" xmlns="http://schemas.xmlsoap.org/wsdl/soap/" />
</wsdl:port>
<wsdl:port name="HTTPS_Port" binding="p1:si_mm100_mcs_senderBinding">
<address location="https://sappoqas.hbglobal.com:50001/XISOAPAdapter/MessageServlet?senderParty=&amp;senderService=ZMCS_FLAVOR&amp;receiverParty=&amp;receiverService=&amp;interface=si_mm100_mcs_sender&amp;interfaceNamespace=http%3A%2F%2Fwww.zmc.com%2Fflavor%2Fmm" xmlns="http://schemas.xmlsoap.org/wsdl/soap/" />
</wsdl:port>
</wsdl:service>
</wsdl:definitions>

@ -0,0 +1,154 @@
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本:4.0.30319.42000
//
// 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,这些更改将会丢失。
// </auto-generated>
//------------------------------------------------------------------------------
//
// 此源代码是由 Microsoft.VSDesigner 4.0.30319.42000 版自动生成。
//
#pragma warning disable 1591
namespace FactorySystemApi.WeChatMsg {
using System;
using System.Web.Services;
using System.Diagnostics;
using System.Web.Services.Protocols;
using System.Xml.Serialization;
using System.ComponentModel;
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Web.Services.WebServiceBindingAttribute(Name="SendPLMMsgInterfaceSoap", Namespace="http://tempuri.org/")]
public partial class SendPLMMsgInterface : System.Web.Services.Protocols.SoapHttpClientProtocol {
private System.Threading.SendOrPostCallback SendMsgOperationCompleted;
private bool useDefaultCredentialsSetExplicitly;
/// <remarks/>
public SendPLMMsgInterface() {
this.Url = global::FactorySystemApi.Properties.Settings.Default.WeChatMsg;
if ((this.IsLocalFileSystemWebService(this.Url) == true)) {
this.UseDefaultCredentials = true;
this.useDefaultCredentialsSetExplicitly = false;
}
else {
this.useDefaultCredentialsSetExplicitly = true;
}
}
public new string Url {
get {
return base.Url;
}
set {
if ((((this.IsLocalFileSystemWebService(base.Url) == true)
&& (this.useDefaultCredentialsSetExplicitly == false))
&& (this.IsLocalFileSystemWebService(value) == false))) {
base.UseDefaultCredentials = false;
}
base.Url = value;
}
}
public new bool UseDefaultCredentials {
get {
return base.UseDefaultCredentials;
}
set {
base.UseDefaultCredentials = value;
this.useDefaultCredentialsSetExplicitly = true;
}
}
/// <remarks/>
public event SendMsgCompletedEventHandler SendMsgCompleted;
/// <remarks/>
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/SendMsg", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
public string SendMsg(string userid, string message, string send_system) {
object[] results = this.Invoke("SendMsg", new object[] {
userid,
message,
send_system});
return ((string)(results[0]));
}
/// <remarks/>
public void SendMsgAsync(string userid, string message, string send_system) {
this.SendMsgAsync(userid, message, send_system, null);
}
/// <remarks/>
public void SendMsgAsync(string userid, string message, string send_system, object userState) {
if ((this.SendMsgOperationCompleted == null)) {
this.SendMsgOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSendMsgOperationCompleted);
}
this.InvokeAsync("SendMsg", new object[] {
userid,
message,
send_system}, this.SendMsgOperationCompleted, userState);
}
private void OnSendMsgOperationCompleted(object arg) {
if ((this.SendMsgCompleted != null)) {
System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
this.SendMsgCompleted(this, new SendMsgCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
}
}
/// <remarks/>
public new void CancelAsync(object userState) {
base.CancelAsync(userState);
}
private bool IsLocalFileSystemWebService(string url) {
if (((url == null)
|| (url == string.Empty))) {
return false;
}
System.Uri wsUri = new System.Uri(url);
if (((wsUri.Port >= 1024)
&& (string.Compare(wsUri.Host, "localHost", System.StringComparison.OrdinalIgnoreCase) == 0))) {
return true;
}
return false;
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")]
public delegate void SendMsgCompletedEventHandler(object sender, SendMsgCompletedEventArgs e);
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
public partial class SendMsgCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
private object[] results;
internal SendMsgCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) :
base(exception, cancelled, userState) {
this.results = results;
}
/// <remarks/>
public string Result {
get {
this.RaiseExceptionIfNecessary();
return ((string)(this.results[0]));
}
}
}
}
#pragma warning restore 1591

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<DiscoveryClientResultsFile xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Results>
<DiscoveryClientResult referenceType="System.Web.Services.Discovery.DiscoveryDocumentReference" url="http://dd.hbflavor.com:8099/PlmMsg/SendPlmMsgInterface.asmx?disco" filename="SendPlmMsgInterface.disco" />
<DiscoveryClientResult referenceType="System.Web.Services.Discovery.ContractReference" url="http://dd.hbflavor.com:8099/PlmMsg/SendPlmMsgInterface.asmx?wsdl" filename="SendPlmMsgInterface.wsdl" />
</Results>
</DiscoveryClientResultsFile>

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<discovery xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.xmlsoap.org/disco/">
<contractRef ref="http://dd.hbflavor.com:8099/PlmMsg/SendPlmMsgInterface.asmx?wsdl" docRef="http://dd.hbflavor.com:8099/PlmMsg/SendPlmMsgInterface.asmx" xmlns="http://schemas.xmlsoap.org/disco/scl/" />
<soap address="http://dd.hbflavor.com:8099/PlmMsg/SendPlmMsgInterface.asmx" xmlns:q1="http://tempuri.org/" binding="q1:SendPLMMsgInterfaceSoap" xmlns="http://schemas.xmlsoap.org/disco/soap/" />
<soap address="http://dd.hbflavor.com:8099/PlmMsg/SendPlmMsgInterface.asmx" xmlns:q2="http://tempuri.org/" binding="q2:SendPLMMsgInterfaceSoap12" xmlns="http://schemas.xmlsoap.org/disco/soap/" />
</discovery>

@ -0,0 +1,67 @@
<?xml version="1.0" encoding="utf-8"?>
<wsdl:definitions xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:tns="http://tempuri.org/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" targetNamespace="http://tempuri.org/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
<wsdl:types>
<s:schema elementFormDefault="qualified" targetNamespace="http://tempuri.org/">
<s:element name="SendMsg">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="userid" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="message" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="send_system" type="s:string" />
</s:sequence>
</s:complexType>
</s:element>
<s:element name="SendMsgResponse">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="SendMsgResult" type="s:string" />
</s:sequence>
</s:complexType>
</s:element>
</s:schema>
</wsdl:types>
<wsdl:message name="SendMsgSoapIn">
<wsdl:part name="parameters" element="tns:SendMsg" />
</wsdl:message>
<wsdl:message name="SendMsgSoapOut">
<wsdl:part name="parameters" element="tns:SendMsgResponse" />
</wsdl:message>
<wsdl:portType name="SendPLMMsgInterfaceSoap">
<wsdl:operation name="SendMsg">
<wsdl:input message="tns:SendMsgSoapIn" />
<wsdl:output message="tns:SendMsgSoapOut" />
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="SendPLMMsgInterfaceSoap" type="tns:SendPLMMsgInterfaceSoap">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" />
<wsdl:operation name="SendMsg">
<soap:operation soapAction="http://tempuri.org/SendMsg" style="document" />
<wsdl:input>
<soap:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:binding name="SendPLMMsgInterfaceSoap12" type="tns:SendPLMMsgInterfaceSoap">
<soap12:binding transport="http://schemas.xmlsoap.org/soap/http" />
<wsdl:operation name="SendMsg">
<soap12:operation soapAction="http://tempuri.org/SendMsg" style="document" />
<wsdl:input>
<soap12:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap12:body use="literal" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="SendPLMMsgInterface">
<wsdl:port name="SendPLMMsgInterfaceSoap" binding="tns:SendPLMMsgInterfaceSoap">
<soap:address location="http://dd.hbflavor.com:8099/PlmMsg/SendPlmMsgInterface.asmx" />
</wsdl:port>
<wsdl:port name="SendPLMMsgInterfaceSoap12" binding="tns:SendPLMMsgInterfaceSoap12">
<soap12:address location="http://dd.hbflavor.com:8099/PlmMsg/SendPlmMsgInterface.asmx" />
</wsdl:port>
</wsdl:service>
</wsdl:definitions>

@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- For more information on using Web.config transformation visit https://go.microsoft.com/fwlink/?LinkId=301874 -->
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
<!--
在下例中“SetAttributes”转换将更改
“connectionString”的值仅在“Match”定位器找到值为“MyDB”的
特性“name”时使用“ReleaseSQLServer”。
<connectionStrings>
<add name="MyDB"
connectionString="Data Source=ReleaseSQLServer;Initial Catalog=MyReleaseDB;Integrated Security=True"
xdt:Transform="SetAttributes" xdt:Locator="Match(name)"/>
</connectionStrings>
-->
<system.web>
<!--
在以下示例中,"Replace" 转换将替换 Web.config 文件的
整个 <customErrors> 节。
请注意,由于在 <system.web> 节点下只有一个
customErrors 节,因此无需使用 "xdt:Locator" 属性。
<customErrors defaultRedirect="GenericError.htm"
mode="RemoteOnly" xdt:Transform="Replace">
<error statusCode="500" redirect="InternalError.htm"/>
</customErrors>
-->
</system.web>
</configuration>

@ -0,0 +1,31 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- For more information on using Web.config transformation visit https://go.microsoft.com/fwlink/?LinkId=301874 -->
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
<!--
在下例中“SetAttributes”转换将更改
“connectionString”的值仅在“Match”定位器找到值为“MyDB”的
特性“name”时使用“ReleaseSQLServer”。
<connectionStrings>
<add name="MyDB"
connectionString="Data Source=ReleaseSQLServer;Initial Catalog=MyReleaseDB;Integrated Security=True"
xdt:Transform="SetAttributes" xdt:Locator="Match(name)"/>
</connectionStrings>
-->
<system.web>
<compilation xdt:Transform="RemoveAttributes(debug)" />
<!--
在以下示例中,"Replace" 转换将替换 Web.config 文件的
整个 <customErrors> 节。
请注意,由于在 <system.web> 节点下只有一个
customErrors 节,因此无需使用 "xdt:Locator" 属性。
<customErrors defaultRedirect="GenericError.htm"
mode="RemoteOnly" xdt:Transform="Replace">
<error statusCode="500" redirect="InternalError.htm"/>
</customErrors>
-->
</system.web>
</configuration>

@ -0,0 +1,135 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
For more information on how to configure your ASP.NET application, please visit
https://go.microsoft.com/fwlink/?LinkId=301879
-->
<configuration>
<configSections>
<sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<section name="FactorySystemApi.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</sectionGroup>
</configSections>
<appSettings>
<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=120.55.81.57;uid=sa;pwd=1qaz@WSX;database=FactorySystem" />
<add key="Sap_UserName" value="mcs_con" />
<add key="SendWeChatMsg" value="1" />
<add key="Sap_Password" value="abcd1234" />
<add key="Cas_AppId" value="testsso" />
<add key="Cas_OAUrl" value="http://10.10.128.20/esc-sso/" />
<add key="Cas_ReUrl" value="http://2.0.1.18:3000" />
<add key="Mdm_Token" value="ac9b7db8-9661-461d-b5b2-ed66f33a1d69" />
<add key="Mdm_Url" value="http://10.10.141.80:8080/iuapmdm/cxf/mdmrs/newcenter/newCenterService/insertMd" />
<add key="Mdm_Tid" value="tenan" />
<!--发送微信消息1是0否-->
<add key="SendWeChatMsg" value="0" />
<add key="webpages:Version" value="3.0.0.0" />
<add key="webpages:Enabled" value="false" />
<add key="ClientValidationEnabled" value="true" />
<add key="UnobtrusiveJavaScriptEnabled" value="true" />
</appSettings>
<!--
有关 web.config 更改的说明,请参见 http://go.microsoft.com/fwlink/?LinkId=235367。
可在 <httpRuntime> 标记上设置以下特性。
<system.Web>
<httpRuntime targetFramework="4.5.2" />
</system.Web>
-->
<system.web>
<compilation debug="true" targetFramework="4.8" />
<httpRuntime targetFramework="4.5" />
</system.web>
<system.webServer>
<handlers>
<add name="OPTIONS" path="*" verb="OPTIONS" modules="ProtocolSupportModule" resourceType="Unspecified" />
<remove name="ExtensionlessUrlHandler-Integrated-4.0" />
<remove name="TRACEVerbHandler" />
<add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="*" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" />
</handlers>
<httpProtocol>
<!--跨域配置开始-->
<customHeaders>
<add name="Access-Control-Allow-Origin" value="*" />
<add name="Access-Control-Allow-Methods" value="GET,POST,OPTIONS" />
<add name="Access-Control-Allow-Headers" value="*" />
<add name="Access-Control-Request-Methods" value="GET,POST,OPTIONS" />
</customHeaders>
<!--跨域配置结束-->
</httpProtocol>
</system.webServer>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Antlr3.Runtime" publicKeyToken="eb42632606e9261f" />
<bindingRedirect oldVersion="0.0.0.0-3.5.0.2" newVersion="3.5.0.2" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" culture="neutral" publicKeyToken="30ad4fe6b2a6aeed" />
<bindingRedirect oldVersion="0.0.0.0-13.0.0.0" newVersion="13.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Optimization" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="1.1.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="WebGrease" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="0.0.0.0-1.6.5135.21930" newVersion="1.6.5135.21930" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-5.2.7.0" newVersion="5.2.7.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Http" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.2.7.0" newVersion="5.2.7.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Net.Http.Formatting" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.2.7.0" newVersion="5.2.7.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
<system.codedom>
<compilers>
<compiler language="c#;cs;csharp" extension=".cs" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=2.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:6 /nowarn:1659;1699;1701" />
<compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.VBCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=2.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:14 /nowarn:41008 /define:_MYTYPE=\&quot;Web\&quot; /optionInfer+" />
</compilers>
</system.codedom>
<applicationSettings>
<FactorySystemApi.Properties.Settings>
<setting name="WeChatMsg" serializeAs="String">
<value>http://dd.hbflavor.com:8099/PlmMsg/SendPlmMsgInterface.asmx</value>
</setting>
<setting name="Plm_Formula" serializeAs="String">
<value>https://plmtest.hbflavor.com/PlmWebService/OAService.asmx</value>
</setting>
<setting name="Sap_Material" serializeAs="String">
<value>http://sappoqas.hbglobal.com:50000/XISOAPAdapter/MessageServlet?senderParty=&amp;senderService=ZMCS_FLAVOR&amp;receiverParty=&amp;receiverService=&amp;interface=si_mm100_mcs_sender&amp;interfaceNamespace=http%3A%2F%2Fwww.zmc.com%2Fflavor%2Fmm</value>
</setting>
<setting name="SAP_Formula" serializeAs="String">
<value>http://sappoqas.hbglobal.com:50000/XISOAPAdapter/MessageServlet?senderParty=&amp;senderService=ZMCS_FLAVOR&amp;receiverParty=&amp;receiverService=&amp;interface=si_pp062_bc_sender&amp;interfaceNamespace=http%3A%2F%2Fwww.zmc.com%2Fflavor%2Fpp</value>
</setting>
<setting name="Sap_Group" serializeAs="String">
<value>http://sappoqas.hbglobal.com:50000/XISOAPAdapter/MessageServlet?senderParty=&amp;senderService=ZMCS_FLAVOR&amp;receiverParty=&amp;receiverService=&amp;interface=si_pp071_mcs_sender&amp;interfaceNamespace=http%3A%2F%2Fwww.zmc.com%2Fflavor%2Fpp</value>
</setting>
</FactorySystemApi.Properties.Settings>
</applicationSettings>
</configuration>

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

@ -0,0 +1,76 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Antlr" version="3.5.0.2" targetFramework="net45" />
<package id="Aspose.Cells" version="22.8.0" targetFramework="net48" />
<package id="bootstrap" version="3.4.1" targetFramework="net45" />
<package id="jQuery" version="3.4.1" targetFramework="net45" />
<package id="Microsoft.AspNet.Mvc" version="5.2.7" targetFramework="net45" />
<package id="Microsoft.AspNet.Mvc.zh-Hans" version="5.2.7" targetFramework="net45" />
<package id="Microsoft.AspNet.Razor" version="3.2.7" targetFramework="net45" />
<package id="Microsoft.AspNet.Razor.zh-Hans" version="3.2.7" targetFramework="net45" />
<package id="Microsoft.AspNet.Web.Optimization" version="1.1.3" targetFramework="net45" />
<package id="Microsoft.AspNet.Web.Optimization.zh-Hans" version="1.1.3" targetFramework="net45" />
<package id="Microsoft.AspNet.WebApi" version="5.2.7" targetFramework="net45" />
<package id="Microsoft.AspNet.WebApi.Client" version="5.2.7" targetFramework="net45" />
<package id="Microsoft.AspNet.WebApi.Client.zh-Hans" version="5.2.7" targetFramework="net45" />
<package id="Microsoft.AspNet.WebApi.Core" version="5.2.7" targetFramework="net45" />
<package id="Microsoft.AspNet.WebApi.Core.zh-Hans" version="5.2.7" targetFramework="net45" />
<package id="Microsoft.AspNet.WebApi.HelpPage" version="5.2.7" targetFramework="net45" />
<package id="Microsoft.AspNet.WebApi.WebHost" version="5.2.7" targetFramework="net45" />
<package id="Microsoft.AspNet.WebApi.WebHost.zh-Hans" version="5.2.7" targetFramework="net45" />
<package id="Microsoft.AspNet.WebPages" version="3.2.7" targetFramework="net45" />
<package id="Microsoft.AspNet.WebPages.zh-Hans" version="3.2.7" targetFramework="net45" />
<package id="Microsoft.AspNetCore.Http.Abstractions" version="1.1.2" targetFramework="net452" />
<package id="Microsoft.AspNetCore.Http.Extensions" version="1.1.2" targetFramework="net452" />
<package id="Microsoft.AspNetCore.Http.Features" version="1.1.2" targetFramework="net452" />
<package id="Microsoft.CodeDom.Providers.DotNetCompilerPlatform" version="2.0.1" targetFramework="net45" requireReinstallation="true" />
<package id="Microsoft.Extensions.Configuration.Abstractions" version="1.1.2" targetFramework="net452" />
<package id="Microsoft.Extensions.DependencyInjection.Abstractions" version="1.1.1" targetFramework="net452" />
<package id="Microsoft.Extensions.FileProviders.Abstractions" version="1.1.1" targetFramework="net452" />
<package id="Microsoft.Extensions.Options" version="1.1.2" targetFramework="net452" />
<package id="Microsoft.Extensions.Primitives" version="1.1.1" targetFramework="net452" />
<package id="Microsoft.Net.Http.Headers" version="1.1.2" targetFramework="net452" />
<package id="Microsoft.NETCore.Platforms" version="1.1.0" targetFramework="net452" />
<package id="Microsoft.Web.Infrastructure" version="1.0.0.0" targetFramework="net45" />
<package id="Modernizr" version="2.8.3" targetFramework="net45" />
<package id="NETStandard.Library" version="1.6.1" targetFramework="net452" />
<package id="Newtonsoft.Json" version="13.0.1" targetFramework="net48" />
<package id="Swashbuckle.Core" version="5.6.0" targetFramework="net45" />
<package id="System.Buffers" version="4.3.0" targetFramework="net452" />
<package id="System.Collections" version="4.3.0" targetFramework="net452" />
<package id="System.Collections.Concurrent" version="4.3.0" targetFramework="net452" />
<package id="System.ComponentModel" version="4.3.0" targetFramework="net452" />
<package id="System.Diagnostics.Contracts" version="4.3.0" targetFramework="net452" />
<package id="System.Diagnostics.Debug" version="4.3.0" targetFramework="net452" />
<package id="System.Diagnostics.Tools" version="4.3.0" targetFramework="net452" />
<package id="System.Diagnostics.Tracing" version="4.3.0" targetFramework="net452" requireReinstallation="true" />
<package id="System.Globalization" version="4.3.0" targetFramework="net452" />
<package id="System.IO" version="4.3.0" targetFramework="net452" requireReinstallation="true" />
<package id="System.IO.Compression" version="4.3.0" targetFramework="net452" requireReinstallation="true" />
<package id="System.Linq" version="4.3.0" targetFramework="net452" requireReinstallation="true" />
<package id="System.Linq.Expressions" version="4.3.0" targetFramework="net452" requireReinstallation="true" />
<package id="System.Net.Http" version="4.3.0" targetFramework="net452" requireReinstallation="true" />
<package id="System.Net.Primitives" version="4.3.0" targetFramework="net452" />
<package id="System.ObjectModel" version="4.3.0" targetFramework="net452" />
<package id="System.Reflection" version="4.3.0" targetFramework="net452" requireReinstallation="true" />
<package id="System.Reflection.Extensions" version="4.3.0" targetFramework="net452" />
<package id="System.Reflection.Primitives" version="4.3.0" targetFramework="net452" />
<package id="System.Resources.ResourceManager" version="4.3.0" targetFramework="net452" />
<package id="System.Runtime" version="4.3.0" targetFramework="net452" requireReinstallation="true" />
<package id="System.Runtime.CompilerServices.Unsafe" version="4.3.0" targetFramework="net452" />
<package id="System.Runtime.Extensions" version="4.3.0" targetFramework="net452" requireReinstallation="true" />
<package id="System.Runtime.InteropServices" version="4.3.0" targetFramework="net452" requireReinstallation="true" />
<package id="System.Runtime.InteropServices.RuntimeInformation" version="4.3.0" targetFramework="net452" />
<package id="System.Runtime.Numerics" version="4.3.0" targetFramework="net452" />
<package id="System.Text.Encoding" version="4.3.0" targetFramework="net452" />
<package id="System.Text.Encoding.Extensions" version="4.3.0" targetFramework="net452" />
<package id="System.Text.Encodings.Web" version="4.3.1" targetFramework="net452" />
<package id="System.Text.RegularExpressions" version="4.3.0" targetFramework="net452" requireReinstallation="true" />
<package id="System.Threading" version="4.3.0" targetFramework="net452" />
<package id="System.Threading.Tasks" version="4.3.0" targetFramework="net452" />
<package id="System.Threading.Timer" version="4.3.0" targetFramework="net452" />
<package id="System.Xml.ReaderWriter" version="4.3.0" targetFramework="net452" requireReinstallation="true" />
<package id="System.Xml.XDocument" version="4.3.0" targetFramework="net452" />
<package id="WebActivatorEx" version="2.0" targetFramework="net45" />
<package id="WebGrease" version="1.6.0" targetFramework="net45" />
</packages>

@ -0,0 +1,433 @@
using FactorySystemCommon;
using FactorySystemModel.BusinessModel;
using FactorySystemModel.EnumModel;
using FactorySystemModel.SqlSugarModel;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Web;
namespace FactorySystemBll
{
public class BaseBll
{
/// <summary>
/// 修改数据信息
/// </summary>
public static int UpdateDataModel(Dictionary<string, object> updateModel, string tableName)
{
return AppSettingsHelper.GetSqlSugar().Updateable(updateModel).AS(tableName).WhereColumns("FID").ExecuteCommand();
}
/// <summary>
/// 修改数据信息
/// </summary>
public static int UpdateDataModel(dynamic updateModel)
{
return AppSettingsHelper.GetSqlSugar().Updateable(updateModel).ExecuteCommand();
}
/// <summary>
/// 删除数据信息
/// </summary>
public int DeleteDataById(Dictionary<string, object> updateModel, string tableName, bool realDel = false)
{
if (updateModel.TryGetValue("FID", out object objId) || updateModel.TryGetValue("dataId", out objId))
{
if (updateModel.ContainsKey("dataId")) updateModel.Remove("dataId");
if (updateModel.ContainsKey("FID")) updateModel.Remove("FID");
if (realDel)
{
return AppSettingsHelper.GetSqlSugar().Deleteable<object>().AS(tableName).Where("FID=" + objId).ExecuteCommand();
}
else
{
updateModel.Add("FDeleted", (int)Constant.DeleteCode.);
return AppSettingsHelper.GetSqlSugar().Updateable(updateModel).AS(tableName).Where("FID=" + objId).ExecuteCommand();
}
}
return 0;
}
/// <summary>
/// 删除数据信息
/// </summary>
public int DeleteDataById(int dataId, string tableName, bool realDel = false)
{
Dictionary<string, object> updateModel = new Dictionary<string, object>();
updateModel.Add("FID", dataId);
return DeleteDataById(updateModel, tableName, realDel);
}
/// <summary>
/// 新增数据信息
/// </summary>
public int InsertDataModel(Dictionary<string, object> insertData, string tableName)
{
var model= AppSettingsHelper.GetSqlSugar().Insertable(insertData).AS(tableName).ExecuteReturnIdentity();
return model;
}
/// <summary>
/// 公共列表接口(前缀未Or_的为或条件检索后缀为ID的是多唯一编号检索)
/// </summary>
public object GetPageList<T>(Dictionary<string, object> updateModel, out int totalCount, string selectKey = null, string orderBy = "FID desc")
{
totalCount = 0;
int pageIndex = 1, pageSize = 15;
List<string> paramName = new List<string>() { "FDeleted!=1" };
List<SugarParameter> paramVal = new List<SugarParameter>();
if (updateModel != null && updateModel.Count > 0)
{
List<string> orList = new List<string>();
if (updateModel.TryGetValue("FPageOrderBy", out object orderBy2))
{
updateModel.Remove("FPageOrderBy");
orderBy = HttpUtility.UrlEncode(orderBy2.ToString());
if (string.IsNullOrEmpty(orderBy)) orderBy = "FID desc";
}
foreach (var item in updateModel)
{
if (item.Key == "FPageIndex" || item.Key == "PageIndex")
{
int.TryParse(item.Value.ToString(), out pageIndex);
}
else if (item.Key == "FPageSize" || item.Key == "PageSize")
{
int.TryParse(item.Value.ToString(), out pageSize);
}
else
{
try
{
string keyVal = "@" + item.Key;
string keyName = item.Key;
if (item.Key.EndsWith("ID")) keyVal = "','+" + keyVal + "+','";
if (item.Key.StartsWith("Or_"))
{
keyName = keyName.Replace("Or_", "");
keyVal = keyVal.Replace("Or_", "");
orList.Add("','+cast(" + keyName + " as varchar(400))+',' like '%'+" + keyVal + "+'%'");
}
else
{
paramName.Add("','+cast(" + keyName + " as varchar(400))+',' like '%'+" + keyVal + "+'%'");
}
paramVal.Add(new SugarParameter("@" + keyName, item.Value.ToString()));
}
catch (Exception) { }
}
}
if (orList.Count() > 0) paramName.Add("(" + string.Join(" or ", orList) + ")");
}
SqlSugarClient db = AppSettingsHelper.GetSqlSugar();
var temp = db.Queryable<T>().Where(string.Join(" and ", paramName), paramVal).OrderBy(orderBy);
if (!string.IsNullOrEmpty(selectKey)) temp = temp.Select(selectKey);
return temp.ToPageList(pageIndex, pageSize, ref totalCount);
}
/// <summary>
/// 根据类型获取字段对应关系
/// </summary>
public List<TFS_FieldInfo> GetFileInfoList(int typeId)
{
return AppSettingsHelper.GetSqlSugar().Queryable<TFS_FieldInfo>().Where(s => s.FDeleted != (int)Constant.DeleteCode.
&& s.FType == typeId).OrderBy(s => s.FOrder).ToList();
}
/// <summary>
/// 根据键获取设置值
/// </summary>
public string GetSettingByKey(string setKey)
{
TFS_Setting setting = AppSettingsHelper.GetSqlSugar().Queryable<TFS_Setting>().Where(s => s.FState == 1 && s.FKey == setKey)
.OrderBy(s => s.FID, OrderByType.Desc).First();
if (setting != null) return setting.FValue;
return "";
}
/// <summary>
/// 根据键获取数据
/// </summary>
public static T GetTempModel<T>(int dataId, string keys = "")
{
if (string.IsNullOrEmpty(keys))
return AppSettingsHelper.GetSqlSugar().Queryable<T>().Where("FID=" + dataId).First();
return AppSettingsHelper.GetSqlSugar().Queryable<T>().Where("FID=" + dataId).Select(keys).First();
}
/// <summary>
/// 根据键获取数据
/// </summary>
public static T GetTempModel<T>(string where, string keys = "")
{
if (string.IsNullOrEmpty(keys))
return AppSettingsHelper.GetSqlSugar().Queryable<T>().Where(where).First();
return AppSettingsHelper.GetSqlSugar().Queryable<T>().Where(where).Select(keys).First();
}
/// <summary>
/// 根据键获取数据
/// </summary>
public Dictionary<string, object> GetTempDict<T>(int dataId, string keys = "")
{
if (string.IsNullOrEmpty(keys))
return AppSettingsHelper.GetSqlSugar().Queryable<T>().Where("FID=" + dataId).ToDictionaryList().FirstOrDefault();
return AppSettingsHelper.GetSqlSugar().Queryable<T>().Where("FID=" + dataId).Select<dynamic>(keys).ToDictionaryList().FirstOrDefault();
}
/// <summary>
/// 事项变更修改流程进度
/// proProgress事项文字类型对应F+proProgress
/// proState事项状态0未开始1进行中2已完成
/// </summary>
public void UpdateTeamProcess(int teamId, int proType, int proProgress, int proState = -1, string appWhere = "1=1")
{
SqlSugarClient db = AppSettingsHelper.GetSqlSugar();
TBasicCode basicCode = db.Queryable<TBasicCode>().Where(s => s.FValue == proType.ToString()
&& s.FType == (int)Constant.BasicCode.).First();
if (basicCode != null)
{
Dictionary<string, object> updateModel = new Dictionary<string, object>();
switch (proProgress)
{
case 1:
updateModel.Add("FDesc", basicCode.F1);
break;
case 2:
updateModel.Add("FDesc", basicCode.F2);
break;
case 3:
updateModel.Add("FDesc", basicCode.F3);
break;
case 4:
updateModel.Add("FDesc", basicCode.F4);
break;
case 5:
updateModel.Add("FDesc", basicCode.F5);
break;
}
if (proState > 0)
{
updateModel.Add("FState", proState);
if (proState == 1) updateModel.Add("FStartDate", DateTime.Now);
else if (proState == 2) updateModel.Add("FFinishDate", DateTime.Now);
}
updateModel.Add("FProgress", proProgress);
db.Updateable<TFS_FTeamProcess>(updateModel).Where(s => s.FTeamID == teamId && s.FType == proType)
.Where(appWhere).ExecuteCommand();
}
}
/// <summary>
/// 创建数据库表
/// </summary>
public void CreateSqlSugarModel(string likeName)
{
string porPath = AppDomain.CurrentDomain.BaseDirectory.Trim('\\') + "\\SqlSugarModel";
porPath = porPath.Replace("/", "\\").Replace("FactorySystemApi\\FactorySystemApi", "FactorySystemApi\\FactorySystemModel");
string nameSpace = "FactorySystemModel.SqlSugarModel";
AppSettingsHelper.GetSqlSugar().DbFirst.Where(it => it.Contains(likeName)).IsCreateAttribute().CreateClassFile(porPath, nameSpace);
}
/// <summary>
/// 创建事项
/// </summary>
public static void CreateTaskData(int teamId, int userId, string taskTypes, string factoryId = "", bool onceMore = true, SqlSugarClient db = null)
{
List<TFS_Task> insertList = new List<TFS_Task>();
List<TFS_Task> updateList = new List<TFS_Task>();
List<MessageDto> messageList = new List<MessageDto>();
try
{
if (db == null) db = AppSettingsHelper.GetSqlSugar();
List<string> taskTypeList = taskTypes.Split(',').ToList();
List<TBasicCode> basicCodeList = db.Queryable<TBasicCode>().Where(s => s.FType == (int)Constant.BasicCode.
&& s.FState == 1 && taskTypeList.Contains(s.FValue)).ToList();
PropertyInfo[] basicCodeProps = typeof(TBasicCode).GetProperties();
for (int i = 0; i < taskTypeList.Count; i++)
{
TBasicCode basicCode = basicCodeList.Find(s => s.FValue == taskTypeList[i]);
if (basicCode == null) continue;
string[] temps = basicCode.FRemark.Split('_');
int temp0 = int.Parse(temps[0]), funcType = -1;
string taskDesc = basicCode.F1;
List<string> funcVal = new List<string>();
switch (temp0)
{
case (int)Constant.BasicCode.:
funcType = (int)Constant.RoleType.;
funcVal.Add(temps[1]);
break;
case (int)Constant.BasicCode.:
funcType = (int)Constant.RoleType.;
string tType = temps[1];
funcVal = db.Queryable<TBasicCode>().Where(s => s.FType == (int)Constant.BasicCode. &&
s.F1 == tType && s.FState == 1).Select(s => s.FValue).ToList();
break;
}
if (funcType > 0)
{
List<TUser> users = db.Queryable<TUser, TRole_Right>((a, b) => new JoinQueryInfos(JoinType.Left, a.FRoleID == b.FRoleID))
.Where((a, b) => a.FState == 1 && a.FDeleted != 1 && b.FType == funcType && funcVal.Contains(b.FFunctionID.ToString()))
.Where(string.IsNullOrEmpty(factoryId) ? "1=1" : string.Format("a.FFactoryID in({0})", factoryId))
.GroupBy("a.FID,a.FFactoryID,a.FName,a.FUser").Select<TUser>("a.FID,a.FFactoryID,a.FName,a.FUser").ToList();
if (users.Count() > 0)
{
if (string.IsNullOrEmpty(factoryId))
{
TFS_Task newTask = new TFS_Task()
{
FName = basicCode.FName,
FDesc = taskDesc,
FTeamID = teamId,
FEditUser = userId,
FFactoryID = -1,
FAddDate = DateTime.Now,
FCanEdit = 1,
FEditDate = DateTime.Now,
FType = int.Parse(basicCode.FValue),
FUserID = string.Join(",", users.GroupBy(ss => ss.FID).Select(sss => sss.Key)),
FUserName = string.Join("、", users.GroupBy(ss => ss.FName).Select(sss => sss.Key)),
FState = 1
};
TFS_Task oldTask = db.Queryable<TFS_Task>().Where(s => s.FTeamID == teamId && s.FType == newTask.FType
&& s.FFactoryID == newTask.FFactoryID).First();
if (oldTask == null)
{
insertList.Add(newTask);
messageList.Add(new MessageDto()
{
message = newTask.FDesc,
userId = string.Join(",", users.GroupBy(ss => ss.FDockID).Select(sss => sss.Key))
});
}
else
{
oldTask.FUserID = newTask.FUserID;
updateList.Add(oldTask);
}
}
else
{
foreach (var factory in users.GroupBy(s => s.FFactoryID))
{
TFS_Task newTask = new TFS_Task()
{
FName = basicCode.FName,
FDesc = taskDesc,
FTeamID = teamId,
FEditUser = userId,
FFactoryID = factory.Key,
FAddDate = DateTime.Now,
FCanEdit = 1,
FEditDate = DateTime.Now,
FType = int.Parse(basicCode.FValue),
FUserID = string.Join(",", factory.GroupBy(ss => ss.FID).Select(sss => sss.Key)),
FUserName = string.Join("、", factory.GroupBy(ss => ss.FName).Select(sss => sss.Key)),
FState = 1
};
TFS_Task oldTask = db.Queryable<TFS_Task>().Where(s => s.FTeamID == teamId && s.FType == newTask.FType
&& s.FFactoryID == factory.Key).First();
if (oldTask == null)
{
insertList.Add(newTask);
messageList.Add(new MessageDto()
{
message = newTask.FDesc,
userId = string.Join(",", factory.GroupBy(ss => ss.FDockID).Select(sss => sss.Key))
});
}
else
{
oldTask.FUserID = newTask.FUserID;
updateList.Add(oldTask);
}
}
}
}
}
}
if (insertList.Count() > 0)
{
db.Insertable(insertList).ExecuteCommand();
SendWeChatMessage(messageList);
}
if (updateList.Count() > 0) db.Updateable(updateList).ExecuteCommand();
}
catch (Exception ex)
{
if (onceMore)
{
CreateTaskData(teamId, userId, taskTypes, factoryId, false);
}
else
{
insertList.AddRange(updateList);
ExceptionHelper.AddSystemJournal(null, insertList, ex.Message, userId, "TeamworkBll.CreateTaskData");
}
}
}
/// <summary>
/// 发送微信消息
/// </summary>
public static void SendWeChatMessage(List<MessageDto> messageList)
{
if (!AppSettingsHelper.GetAppSettingVal("SendWeChatMsg").Equals("1")) return;
WeChatMsg.SendPLMMsgInterface ws = new WeChatMsg.SendPLMMsgInterface();
string tempResult = "";
foreach (MessageDto msg in messageList)
{
foreach (string userId in msg.userId.Split(','))
{
try
{
tempResult = ws.SendMsg(userId, msg.message, "FMC");
}
catch (Exception)
{
ExceptionHelper.AddSystemJournal(null, msg, tempResult, -1, "BaseController.SendWeChatMessage");
}
}
}
}
/// <summary>
/// 事项变更SQL语句
/// </summary>
public static string GetTaskSql(int taskId, int taskState, int teamId = -1, int taskType = -1, int taskEdit = -1, string sqlAppend = "")
{
string updateSql = string.Format("a.FState={0}", taskState);
if (taskState == 2) updateSql += ",FFinishDate=isnull(a.FFinishDate, getdate())";
if (taskEdit > 0) updateSql += string.Format(",a.FCanEdit={0}", taskEdit);
List<string> whereSql = new List<string>();
if (taskId > 0) whereSql.Add(string.Format("a.FID={0}", taskId));
if (teamId > 0) whereSql.Add(string.Format("a.FTeamID={0}", teamId));
if (taskType > 0) whereSql.Add(string.Format("a.FType={0}", taskType));
if (whereSql.Count == 0 && string.IsNullOrEmpty(sqlAppend)) return "";
if (!string.IsNullOrEmpty(sqlAppend) && whereSql.Count > 0) sqlAppend = " and " + sqlAppend;
return string.Format(@"update a set {0} from TFS_Task a where {1} {2};", updateSql, string.Join(" and ", whereSql), sqlAppend);
}
/// <summary>
/// 流程变更SQL语句
/// </summary>
public static string GetProcessSql(int teamId, int proType, string viewDesc, int proState, string sqlAppend = "")
{
string timeSql = proState.ToString();
if (proState == 1) timeSql += ",FStartDate=getdate()";
else if (proState == 2) timeSql += ",FFinishDate=getdate()";
return string.Format(@"update a set a.FDesc=(select {2} from TBasicCode where FType=34 and FValue={1}),
FState={3} from TFS_FTeamProcess a where a.FTeamID={0} {5} and FType={1} {4};", teamId,
proType, viewDesc, timeSql, sqlAppend, proState > 0 ? ("and FState<" + proState) : "");
}
}
}

@ -0,0 +1,78 @@
using FactorySystemCommon;
using FactorySystemModel.BusinessModel;
using FactorySystemModel.SqlSugarModel;
using SqlSugar;
using System.Collections.Generic;
namespace FactorySystemBll
{
public class CommonBll
{
/// <summary>
/// 获取配置信息
/// </summary>
public object GetBasicList(int type)
{
if (type == -1) return AppSettingsHelper.GetSqlSugar().Queryable<TBasicCode>().Where(s => s.FState == 1).OrderBy("FType,FOrder").ToList();
return AppSettingsHelper.GetSqlSugar().Queryable<TBasicCode>().Where(s => s.FType == type && s.FState == 1).ToList();
}
/// <summary>
/// 获取用户某类型权限
/// </summary>
public List<int> CheckIsHasPower(int roleType, int userId)
{
return AppSettingsHelper.GetSqlSugar().Queryable<TRole_Right>().Where(string.Format("FRoleID in(select FRoleID from TUser where FID={0})", userId))
.Where(s => s.FType == roleType).Select<int>("FFunctionID").ToList();
}
/// <summary>
/// 获取数据选择值
/// </summary>
public List<TDataCode> GetDataCodeList(string[] types)
{
if (types == null || types.Length == 0)
return AppSettingsHelper.GetSqlSugar().Queryable<TDataCode>().OrderBy("FType,FOrder").ToList();
return AppSettingsHelper.GetSqlSugar().Queryable<TDataCode>().Where(s => s.FState == 1
&& SqlFunc.ContainsArray(types, s.FType)).OrderBy(s => s.FOrder).ToList();
}
/// <summary>
/// 获取系统配置
/// </summary>
public object GetConfigList(string key = "", int dataId = -1)
{
SqlSugarClient db = AppSettingsHelper.GetSqlSugar();
if (string.IsNullOrEmpty(key) && dataId <= 0)
return db.Queryable<TFS_Config>().Select<dynamic>("FID,FName,FKey").ToList();
return db.Queryable<TFS_Config>().WhereIF(!string.IsNullOrEmpty(key), s => s.FKey == key)
.WhereIF(!string.IsNullOrEmpty(key), s => s.FKey == key)
.WhereIF(dataId > 0, s => s.FID == dataId).First();
}
/// <summary>
/// 获取系统配置值
/// </summary>
public string GetConfigValue(int dataId)
{
string result = "";
TFS_Config config = GetConfigList("", dataId) as TFS_Config;
if (config != null)
{
BaseClass bc = JWTHelper.Decrypt<BaseClass>(config.FValue, config.FKey);
if (bc != null) result = bc.value;
}
return result;
}
/// <summary>
/// 修改数据值状态
/// </summary>
public int StateDataCode(int dataId, int userId)
{
string sqlStr = string.Format(@"update TDataCode set FUserOpt={1},FDateOpt=getdate(),
FState=(case FState when '1' then '0' else '1' end) where FID={0}", dataId, userId);
return AppSettingsHelper.GetSqlSugar().Ado.ExecuteCommand(sqlStr);
}
}
}

@ -0,0 +1,39 @@
using FactorySystemCommon;
using FactorySystemModel.SqlSugarModel;
using SqlSugar;
using System.Collections.Generic;
using FactorySystemModel.EnumModel;
namespace FactorySystemBll
{
public class FactoryBll
{
/// <summary>
/// 获取配置信息
/// </summary>
public static List<TFS_Factory> GetFactoryList()
{
int isDelete = (int)Constant.DeleteCode.;
return AppSettingsHelper.GetSqlSugar().Queryable<TFS_Factory>().Where(s => s.FDeleted != isDelete).ToList();
}
/// <summary>
/// 验证工厂代码是否重复
/// </summary>
public object CheckHasCode(Dictionary<string, object> insertData)
{
SqlSugarClient db = AppSettingsHelper.GetSqlSugar();
int isDelete = (int)Constant.DeleteCode.;
string code = insertData["FCode"].ToString();
if (int.TryParse(insertData["FID"].ToString(), out int dataId) && dataId > 0)
{
return AppSettingsHelper.GetSqlSugar().Queryable<TFS_Factory>().Where(s => s.FDeleted != isDelete
&& s.FCode == code && s.FID != dataId).Count();
}
else
{
return AppSettingsHelper.GetSqlSugar().Queryable<TFS_Factory>().Where(s => s.FDeleted != isDelete && s.FCode == code).Count();
}
}
}
}

@ -0,0 +1,124 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{DE5CA953-C5F7-4DF4-81B2-9C3D89849DC5}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>FactorySystemBll</RootNamespace>
<AssemblyName>FactorySystemBll</AssemblyName>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="SqlSugar, Version=5.1.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\SqlSugar.5.1.0\lib\SqlSugar.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.EnterpriseServices" />
<Reference Include="System.Web" />
<Reference Include="System.Web.Services" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="MaterialTypeBll.cs" />
<Compile Include="OperateLogBll.cs" />
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
<DependentUpon>Settings.settings</DependentUpon>
</Compile>
<Compile Include="TaskBll.cs" />
<Compile Include="TeamworkBll.cs" />
<Compile Include="MaterialBll.cs" />
<Compile Include="FormulaBll.cs" />
<Compile Include="UserBll.cs" />
<Compile Include="FactoryBll.cs" />
<Compile Include="CommonBll.cs" />
<Compile Include="BaseBll.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="PackageBll.cs" />
<Compile Include="ViewBll.cs" />
<Compile Include="Web References\WeChatMsg\Reference.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Reference.map</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<None Include="app.config" />
<None Include="packages.config" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<None Include="Web References\WeChatMsg\Reference.map">
<Generator>MSDiscoCodeGenerator</Generator>
<LastGenOutput>Reference.cs</LastGenOutput>
</None>
<None Include="Web References\WeChatMsg\SendPlmMsgInterface.wsdl" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\FactorySystemCommon\FactorySystemCommon.csproj">
<Project>{EA8E8FC2-B255-4931-BBAE-7862F0173CD3}</Project>
<Name>FactorySystemCommon</Name>
</ProjectReference>
<ProjectReference Include="..\FactorySystemModel\FactorySystemModel.csproj">
<Project>{2C1A44D9-D4BA-464E-832B-6108595892D6}</Project>
<Name>FactorySystemModel</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<WCFMetadata Include="Connected Services\" />
</ItemGroup>
<ItemGroup>
<WebReferences Include="Web References\" />
</ItemGroup>
<ItemGroup>
<WebReferenceUrl Include="http://dd.hbflavor.com:8099/PlmMsg/SendPlmMsgInterface.asmx">
<UrlBehavior>Dynamic</UrlBehavior>
<RelPath>Web References\WeChatMsg\</RelPath>
<UpdateFromURL>http://dd.hbflavor.com:8099/PlmMsg/SendPlmMsgInterface.asmx</UpdateFromURL>
<ServiceLocationURL>
</ServiceLocationURL>
<CachedDynamicPropName>
</CachedDynamicPropName>
<CachedAppSettingsObjectName>Settings</CachedAppSettingsObjectName>
<CachedSettingsPropName>WeChatMsg</CachedSettingsPropName>
</WebReferenceUrl>
</ItemGroup>
<ItemGroup>
<None Include="Web References\WeChatMsg\SendPlmMsgInterface.disco" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

@ -0,0 +1,227 @@
using FactorySystemCommon;
using FactorySystemModel.SqlSugarModel;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using FactorySystemModel.EnumModel;
using FactorySystemModel.RequestModel;
using FactorySystemModel.ResponseModel;
namespace FactorySystemBll
{
public class FormulaBll
{
/// <summary>
/// 获取配置信息
/// </summary>
public object GetBasicList(int type)
{
return AppSettingsHelper.GetSqlSugar().Queryable<TBasicCode>().Where(s => s.FType == type && s.FState == 1).ToList();
}
public List<FormulaRow> GetList(FormulaQuery tr, out int totalNumber)
{
totalNumber = 0;
var db = AppSettingsHelper.GetSqlSugar();
return db.Queryable<TFS_Formula>().Where(s => s.FTestCode != "")
.WhereIF(tr.FName != null, s => s.FName.Contains(tr.FName) || s.FPlmCode.Contains(tr.FPlmCode) || s.FTestCode.Contains(tr.FTestCode) || s.FVersionCode.Contains(tr.FVersionCode))
.Select<FormulaRow>("*").ToPageList(tr.FPageIndex, tr.FPageSize, ref totalNumber);
}
/// <summary>
/// 配方数据比对
/// </summary>
public int DockingRecipeData(List<TFS_Formula> formulaList, int userId)
{
formulaList = formulaList.Where(s => !string.IsNullOrEmpty(s.FPlmCode)).ToList();
if (formulaList.Count == 0) return 1;
SqlSugarClient db = AppSettingsHelper.GetSqlSugar();
List<TFS_Formula> updateList = new List<TFS_Formula>();
List<TFS_Formula> insertList = new List<TFS_Formula>();
List<TFS_Factory> factorys = db.Queryable<TFS_Factory>().OrderBy(s => s.FDeleted).ToList();
List<TFS_Material> materials = db.Queryable<TFS_Material>().OrderBy(s => s.FDeleted).ToList();
List<TBasicCode> typeList = db.Queryable<TBasicCode>().Where(s => s.FType == (int)Constant.BasicCode.).ToList();
//根据PLM码分组
foreach (var item in formulaList.GroupBy(s => s.FPlmCode))
{
List<TFS_Formula> formulas = db.Queryable<TFS_Formula>().Where(s => s.FPlmCode == item.Key
&& s.FDeleted != (int)Constant.DeleteCode.).ToList();
List<TFS_Formula> temps = item.Where(s1 => !string.IsNullOrEmpty(s1.FVersionCode.Trim())).ToList();
if (temps.Count > 0)//版本号非空
{
//根据版本号分组
foreach (var item2 in item.GroupBy(ss => ss.FVersionCode.Trim()))
{
TFS_Formula formula = formulas.Find(d => d.FVersionCode == item2.Key.Trim());
if (formula == null) formula = formulas.Find(d => d.FVersionCode == "");
TFS_Formula temp = item2.FirstOrDefault();
if (formula != null)
{
formula.FName = temp.FName.Trim();
formula.FDesc = (string.IsNullOrEmpty(temp.FDesc) ? formula.FDesc : temp.FDesc).Trim();
formula.FType = (string.IsNullOrEmpty(temp.FType) ? formula.FType : temp.FType).Trim();
formula.FTestCode = (string.IsNullOrEmpty(temp.FTestCode) ? formula.FTestCode : temp.FTestCode).Trim();
formula.FProductCode = (string.IsNullOrEmpty(temp.FProductCode) ? formula.FProductCode : temp.FProductCode).Trim();
formula.FFactoryCode = (string.IsNullOrEmpty(temp.FFactoryCode) ? formula.FFactoryCode : temp.FFactoryCode).Trim();
formula.FVersionCode = (string.IsNullOrEmpty(temp.FVersionCode) ? formula.FVersionCode : temp.FVersionCode).Trim();
if (!string.IsNullOrEmpty(formula.FFactoryCode))
{
TFS_Factory factory = factorys.Find(s => s.FCode == formula.FFactoryCode);
if (factory == null) factory = factorys.Find(s => s.FName == formula.FFactoryCode);
if (factory == null) formula.FFactoryID = -1;
else formula.FFactoryID = factory.FID;
}
formula.FEditDate = DateTime.Now;
formula.FEditUser = userId;
/**
* 20230401
*
* FConversionPersonnel
* FDevDate
* BOM FBomVersionCode
* **/
formula.FConversionPersonnel = (string.IsNullOrEmpty(temp.FConversionPersonnel) ? formula.FConversionPersonnel : temp.FConversionPersonnel).Trim();
formula.FDevDate = DateTime.Now;
formula.FBomVersionCode = (string.IsNullOrEmpty(temp.FBomVersionCode) ? formula.FBomVersionCode : temp.FBomVersionCode).Trim();
// 20230401 根据试验号获取生产号
if (materials != null && materials.Count > 0)
{
TFS_Material material = materials.Find(m => m.FTestCode == formula.FTestCode);
if (material != null && !string.IsNullOrEmpty(material.FCode))
{
formula.FProductCode = material.FCode;
}
}
TBasicCode bType = typeList.Find(s => s.FName == formula.FType || s.FValue == formula.FType);
if (bType != null) formula.FType = bType.FValue;
updateList.Add(formula);
}
else
{
if (!string.IsNullOrEmpty(temp.FFactoryCode))
{
TFS_Factory factory = factorys.Find(s => s.FCode == temp.FFactoryCode);
if (factory == null) factory = factorys.Find(s => s.FName == temp.FFactoryCode);
if (factory == null) temp.FFactoryID = -1;
else temp.FFactoryID = factory.FID;
}
temp.FID = -1;
temp.FAddDate = temp.FEditDate = DateTime.Now;
temp.FEditUser = userId;
/**
* 20230401
*
* FConversionPersonnel
* FDevDate
* BOM FBomVersionCode
* **/
temp.FDevDate = DateTime.Now;
// 20230401 根据试验号获取生产号
if (materials != null && materials.Count > 0)
{
TFS_Material material = materials.Find(m => m.FTestCode == temp.FTestCode);
if (material != null && !string.IsNullOrEmpty(material.FCode))
{
temp.FProductCode = material.FCode;
}
}
TBasicCode bType = typeList.Find(s => s.FName == temp.FType || s.FValue == temp.FType);
if (bType != null) temp.FType = bType.FValue;
insertList.Add(temp);
}
}
}
else if (formulas == null || formulas.Count == 0)
{
TFS_Formula temp = item.FirstOrDefault();
temp.FAddDate = temp.FEditDate = DateTime.Now;
temp.FEditUser = userId;
/**
* 20230401
*
* FConversionPersonnel
* FDevDate
* BOM FBomVersionCode
* **/
temp.FDevDate = DateTime.Now;
// 20230401 根据试验号获取生产号
if (materials != null && materials.Count > 0)
{
TFS_Material material = materials.Find(m => m.FTestCode == temp.FTestCode);
if (material != null && !string.IsNullOrEmpty(material.FCode))
{
temp.FProductCode = material.FCode;
}
}
insertList.Add(temp);
}
}
try
{
db.BeginTran();
if (updateList.Count > 0)
{
for (int i = 0; i < updateList.Count; i++)
{
db.Updateable(updateList[i]).IgnoreColumns(true).ExecuteCommand();
}
}
if (insertList.Count > 0)
{
for (int i = 0; i < insertList.Count; i++)
{
db.Insertable(insertList[i]).IgnoreColumns(true).ExecuteCommand();
}
}
db.CommitTran();
return 1;
}
catch (Exception)
{
db.RollbackTran();
}
return 0;
}
/// <summary>
/// 对接SAP配方同步
/// </summary>
public int DockSapFormula(List<TFS_Formula> formulaList)
{
SqlSugarClient db = AppSettingsHelper.GetSqlSugar();
int okCount = 0;
db.BeginTran();
try
{
foreach (TFS_Formula item in formulaList)
{
TFS_Formula temp = db.Queryable<TFS_Formula>().Where(s => s.FName == item.FName && s.FFactoryID == item.FFactoryID
&& s.FTestCode == item.FTestCode).First();
if (string.IsNullOrEmpty(item.FType)) item.FType = "";
if (temp == null) okCount += db.Insertable(item).IgnoreColumns(true).ExecuteCommand();
}
db.CommitTran();
}
catch (Exception ex)
{
ExceptionHelper.AddSystemJournal(null, formulaList, ex.Message, -1, "DockSapFormulaDb");
db.RollbackTran();
}
return okCount;
}
}
}

File diff suppressed because it is too large Load Diff

@ -0,0 +1,74 @@
using FactorySystemCommon;
using FactorySystemModel.SqlSugarModel;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
namespace FactorySystemBll
{
public class MaterialTypeBll
{
/// <summary>
/// 导入分类
/// </summary>
public int InsertBatchMaterialTypeData(List<TFS_MaterialInfo> mainList, List<PropertyInfo> mainProp, int userId)
{
int result = 0;
SqlSugarClient db = AppSettingsHelper.GetSqlSugar();
foreach (TFS_MaterialInfo item in mainList)
{
item.FQualityTest2 = item.FQualityTest2.Replace("~", "@$&|&$@").Replace("&$&||&$&", "~");
string[] typeNames = item.FQualityTest2.Split('~');
item.FQualityTest2 = typeNames[0].Replace("@$&|&$@", "~");
typeNames[1] = typeNames[1].Replace("@$&|&$@", "~");
typeNames[2] = typeNames[2].Replace("@$&|&$@", "~");
string typeName = typeNames[1];
List<int> typeTemps1 = db.Queryable<TFS_MaterialType>().Where(s => s.FName == typeName && s.FDepth == 1
&& s.FDeleted != 1).Select(s => s.FID).ToList();
if (typeTemps1.Count == 0) typeTemps1 = new List<int>() { CreateType(db, typeNames[1], 1, userId).FID };
typeName = typeNames[2];
TFS_MaterialType typeTemp2 = db.Queryable<TFS_MaterialType>().Where(s => s.FName == typeName &&
s.FDepth == 2 && s.FDeleted != 1 && typeTemps1.Contains(s.FParentID)).First();
if (typeTemp2 == null) typeTemp2 = CreateType(db, typeNames[2], 2, userId, typeTemps1.First());
item.FType = 1;
item.FDataID = typeTemp2.FID;
TFS_MaterialInfo dbInfo = db.Queryable<TFS_MaterialInfo>().Where(s => s.FType == 1 && s.FDataID == typeTemp2.FID).First();
if (dbInfo == null)
{
item.FAddUser = userId;
item.FID = db.Insertable(item).IgnoreColumns(true).ExecuteReturnIdentity();
}
else
{
item.FID = dbInfo.FID;
item.FEditUser = userId;
item.FEditDate = DateTime.Now;
db.Updateable(item).IgnoreColumns(true).ExecuteCommand();
}
result += 1;
}
ExceptionHelper.AddSystemJournal(null, mainList, result, userId, "InsertBatchMaterialTypeData");
return result;
}
private TFS_MaterialType CreateType(SqlSugarClient db, string name, int depth = 1, int userId = -1, int parentId = -1)
{
TFS_MaterialType temp = new TFS_MaterialType()
{
FName = name,
FDepth = depth,
FParentID = parentId,
FState = 1,
FAddUser = userId
};
temp.FID = db.Insertable(temp).ExecuteReturnIdentity();
return temp;
}
}
}

@ -0,0 +1,69 @@
using System;
using System.Collections.Generic;
using FactorySystemCommon;
using FactorySystemModel.SqlSugarModel;
using SqlSugar;
namespace FactorySystemBll
{
public class OperateLogBll
{
public object GetPageList(Dictionary<string, object> inParam, out int totalCount, string orderBy = "a.FID desc")
{
totalCount = 0;
int pageIndex = 1, pageSize = 10;
List<string> paramName = new List<string>() { "FDeleted!=1" };
List<SugarParameter> paramVal = new List<SugarParameter>();
if (inParam != null && inParam.Count > 0)
{
foreach (var item in inParam)
{
if (item.Key == "FPageIndex" || item.Key == "PageIndex")
{
int.TryParse(item.Value.ToString(), out pageIndex);
}
else if (item.Key == "FPageSize" || item.Key == "PageSize")
{
int.TryParse(item.Value.ToString(), out pageSize);
}
else
{
try
{
//检索,全转成字符串
paramName.Add(item.Key + "=@" + item.Key);
paramVal.Add(new SugarParameter("@" + item.Key, item.Value.ToString()));
}
catch (Exception) { }
}
}
}
SqlSugarClient db = AppSettingsHelper.GetSqlSugar();
var temp = db.Queryable<TFS_OperateLog, TUser>((a, b) => new JoinQueryInfos(JoinType.Left, a.FAddUser == b.FID))
.Where(string.Join(" and ", paramName), paramVal).OrderBy(orderBy).Select<dynamic>("a.*,b.FName as FOptUser");
return temp.ToPageList(pageIndex, pageSize, ref totalCount);
}
/// <summary>
/// 保存日志
/// </summary>
/// <param name="teamId">协同ID</param>
/// <param name="type">来源类型</param>
/// <param name="desc">描述</param>
/// <param name="userId">操作人</param>
public static void Add(int teamId, int type, string desc, int userId)
{
var db = AppSettingsHelper.GetSqlSugar();
db.Insertable(new TFS_OperateLog
{
FTeamID = teamId,
FType = type,
FDesc = desc,
FAddUser = userId,
FAddDate = DateTime.Now
}).ExecuteCommand();
}
}
}

@ -0,0 +1,473 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using FactorySystemCommon;
using FactorySystemModel.EnumModel;
using FactorySystemModel.SqlSugarModel;
using Newtonsoft.Json;
using SqlSugar;
namespace FactorySystemBll
{
public class PackageBll
{
/// <summary>
/// 获取包材信息
/// </summary>
public object GetPackageInfo(int teamId)
{
SqlSugarClient db = AppSettingsHelper.GetSqlSugar();
TFS_FTeamwork teamwork = db.Queryable<TFS_FTeamwork>().Where(s => s.FID == teamId).First();
TFS_PackageMain main;
if (teamwork.FPackID > 0) main = db.Queryable<TFS_PackageMain>().Where(s => s.FID == teamwork.FPackID).First();
else main = db.Queryable<TFS_PackageMain>().Where(string.Format("FID=(select FPackID from TFS_FTeamwork where FID={0})", teamId)).First();
if (main != null)
{
List<TFS_PackageChild> childs = db.Queryable<TFS_PackageChild>().Where(s => s.FPackageID == teamwork.FPackID && s.FDeleted != 1).ToList();
return new
{
Main = main,
FCode = teamwork.FPackCode,
List = childs.Count == 0 ? new List<TFS_PackageChild>() : childs
};
}
return new { FCode = teamwork.FPackCode };
}
/// <summary>
/// 修改包材主信息
/// </summary>
public int UpdatePackageData(Dictionary<string, object> inParam)
{
int mainId = -1;
try
{
SqlSugarClient db = AppSettingsHelper.GetSqlSugar();
TFS_PackageMain main = db.Queryable<TFS_PackageMain>().Where(s => s.FCode == inParam["FCode"].ToString()).First();
if (main == null)
{
main = new TFS_PackageMain();
SetFieldVal(typeof(TFS_PackageMain).GetProperties(), main, inParam);
main.FID = db.Insertable(main).AS("TFS_PackageMain").IgnoreColumns(true).ExecuteReturnIdentity();
}
else
{
SetFieldVal(typeof(TFS_PackageMain).GetProperties(), main, inParam);
inParam.Add("FEditDate", DateTime.Now);
db.Updateable(main).AS("TFS_PackageMain").Where(s => s.FID == main.FID).ExecuteCommand();
}
mainId = main.FID;
int teamId = int.Parse(inParam["FTeamID"].ToString());
//2022-10-08 所谓的成品字段值是包材的规格、毛重、净重
db.Ado.ExecuteCommand(string.Format(@"update a set a.FBaseSpecification=isnull(b.FSpecs,''),
a.FBaseGrossWeight=isnull(b.FGrossWeight,''),a.FBaseNetWeight=isnull(b.FNetWeight,'') from
TFS_ViewMaterial a,TFS_PackageMain b where a.FTeamID={0} and b.FID={1} and a.FViewType=1", teamId, mainId));
db.Updateable<TFS_FTeamwork>(new { FPackID = mainId, FPackCode = main.FCode }).Where(s => s.FID == teamId).ExecuteCommand();
}
catch (Exception) { }
return mainId;
}
/**
* 20230404
*
*
* FOperateType1
* FOperateType == 1
* **/
public int UpdatePackage(Dictionary<string, object> inParam)
{
int mainId = -1;
try
{
SqlSugarClient db = AppSettingsHelper.GetSqlSugar();
TFS_PackageMain main = db.Queryable<TFS_PackageMain>().Where(s => s.FCode == inParam["FCode"].ToString()).First();
if (main == null)
{
main = new TFS_PackageMain();
SetFieldVal(typeof(TFS_PackageMain).GetProperties(), main, inParam);
main.FID = db.Insertable(main).AS("TFS_PackageMain").IgnoreColumns(true).ExecuteReturnIdentity();
}
else
{
SetFieldVal(typeof(TFS_PackageMain).GetProperties(), main, inParam);
inParam.Add("FEditDate", DateTime.Now);
db.Updateable(main).AS("TFS_PackageMain").Where(s => s.FID == main.FID).ExecuteCommand();
}
mainId = main.FID;
}
catch (Exception) { }
return mainId;
}
/// <summary>
/// 不补充包材信息
/// </summary>
public int NoSupplyPackageChild(Dictionary<string, object> inParam)
{
//直接进度完成不让修改
int teamId = int.Parse(inParam["FTeamID"].ToString());
string taskSql = BaseBll.GetTaskSql(-1, 2, teamId, (int)Constant.TaskType., 2);
SqlSugarClient db = AppSettingsHelper.GetSqlSugar();
int result = db.Ado.ExecuteCommand(taskSql);
TeamworkBll.ChangeTeamProcess(teamId, db);
return result;
}
/// <summary>
/// 包材子项新增
/// </summary>
public int InsertChildData(Dictionary<string, object> inParam, List<TFS_PackageChild> childList)
{
SqlSugarClient db = AppSettingsHelper.GetSqlSugar();
db.BeginTran();
int childId = -1;
try
{
int userId = int.Parse(inParam["FEditUser"].ToString());
int mainId = int.Parse(inParam["FID"].ToString());
int teamId = int.Parse(inParam["FTeamID"].ToString());
{
List<TFS_PackageChild> updateList = childList.Where(s => s.FID > 0).ToList();
//删除已删除的
List<int> updateIds = updateList.Count > 0 ? updateList.Select(s => s.FID).ToList() : new List<int>() { -1 };
db.Updateable<TFS_PackageChild>(new { FDeleted = 1, FEditUser = userId, FEditDate = DateTime.Now })
.Where(s => !updateIds.Contains(s.FID) && s.FPackageID == mainId && s.FDeleted != 1).ExecuteCommand();
}
TFS_FTeamwork teamwork = db.Queryable<TFS_FTeamwork>().Where(s => s.FID == teamId).First();
bool hasTask = false;//是否创建“新子项包材申请”
List<int> viewFactory = new List<int>();//视图分工厂
foreach (TFS_PackageChild child in childList)
{
child.FPackageID = mainId;
child.FEditUser = userId;
if (child.FID <= 0)
{
if (child.FMaterialID <= 0) child.FMaterialID = -1;
child.FID = db.Insertable(child).IgnoreColumns(true).ExecuteReturnIdentity();
}
if (child.FMaterialID > 0)
{
TFS_Material material = null;
List<TFS_ViewMaterial> viewList = db.Queryable<TFS_ViewMaterial>().Where(s => s.FMaterialID == child.FMaterialID
&& s.FDeleted != 1).ToList();
bool hasCreate = false;
if (viewList.Find(s => s.FFactoryID == teamwork.FCreateFactoryID) == null)
{
hasCreate = true;
if (viewFactory.IndexOf(teamwork.FCreateFactoryID) == -1) viewFactory.Add(teamwork.FCreateFactoryID);
if (material == null) db.Queryable<TFS_Material>().Where(s => s.FID == child.FMaterialID).First();
TFS_ViewMaterial view = SetViewVal(material, teamwork, userId);
view.FFactoryCode = teamwork.FCreateFactoryCode;
view.FFactoryID = teamwork.FCreateFactoryID;
db.Insertable(view).IgnoreColumns(true).ExecuteCommand();
}
if (viewList.Find(s => s.FFactoryID == teamwork.FProdFactoryID) == null)
{
if (viewFactory.IndexOf(teamwork.FProdFactoryID) == -1) viewFactory.Add(teamwork.FProdFactoryID);
if (material == null) db.Queryable<TFS_Material>().Where(s => s.FID == child.FMaterialID).First();
TFS_ViewMaterial view = SetViewVal(material, teamwork, userId);
view.FFactoryCode = teamwork.FProdFactoryCode;
view.FFactoryID = teamwork.FProdFactoryID;
if (hasCreate) view.FQualityType4 = "05";
else view.FQualityType1 = "01";
db.Insertable(view).IgnoreColumns(true).ExecuteCommand();
}
}
else
{
hasTask = true;
}
}
//删除视图
db.Deleteable<TFS_ViewMaterial>().Where(s => s.FTeamID == teamId && s.FViewType == (int)Constant.ViewType.)
.Where(string.Format("FMaterialID not in(select FMaterialID from TFS_PackageChild where FPackageID={0} and FDeleted!=1)", mainId))
.ExecuteCommand();
if (hasTask)
{
BaseBll.CreateTaskData(teamId, userId, "10");
}
if (viewFactory.Count > 0)
{
BaseBll.CreateTaskData(teamId, userId, "11", string.Join(",", viewFactory));
}
db.CommitTran();
}
catch (Exception)
{
db.RollbackTran();
}
return childId;
}
/**
* 20230404
*
*
* FOperateType1
* FOperateType == 1
* **/
// 新的包材子项新增
public void InsertPackageChild(Dictionary<string, object> inParam, List<TFS_PackageChild> childList)
{
try
{
SqlSugarClient db = AppSettingsHelper.GetSqlSugar();
int userId = int.Parse(inParam["FEditUser"].ToString());
int mainId = int.Parse(inParam["FID"].ToString());
foreach (TFS_PackageChild child in childList)
{
child.FPackageID = mainId;
child.FEditUser = userId;
db.Insertable(child).IgnoreColumns(true).ExecuteReturnIdentity();
}
}
catch (Exception ex)
{
}
}
// 新的包材子项更新(包括逻辑删除)
public void UpdatePackageChild(Dictionary<string, object> inParam, List<TFS_PackageChild> childList)
{
try
{
SqlSugarClient db = AppSettingsHelper.GetSqlSugar();
int userId = int.Parse(inParam["FEditUser"].ToString());
int mainId = int.Parse(inParam["FID"].ToString());
foreach (TFS_PackageChild child in childList)
{
child.FEditUser = userId;
child.FEditDate = DateTime.Now;
}
db.Updateable<TFS_PackageChild>(childList).ExecuteCommand();
//db.Updateable<TFS_PackageChild>(new {
// FEditUser = userId,
// FEditDate = DateTime.Now
//}).Where(s => s.FPackageID == mainId && s.FDeleted != 1).ExecuteCommand();
}
catch (Exception ex)
{
}
}
/// <summary>
/// 导入包材
/// </summary>
public object InsertBatchPackageData(List<TFS_PackageMain> mainList, List<TFS_PackageChild> childList, int userId)
{
int result = 0;
SqlSugarClient db = AppSettingsHelper.GetSqlSugar();
List<TFS_PackageMain> mainList2 = new List<TFS_PackageMain>();
List<TFS_PackageChild> childList2 = new List<TFS_PackageChild>();
for (int i = 0; i < mainList.Count; i++)
{
TFS_PackageMain item = mainList[i];
TFS_PackageMain main = db.Queryable<TFS_PackageMain>().Where(s => s.FCode == item.FCode).First();
if (main == null)
{
main = item;
main.FEditUser = userId;
main.FFactoryID = -1;
main.FID = db.Insertable(main).IgnoreColumns(true).ExecuteReturnIdentity();
}
else if (mainList2.Find(s => s.FID == main.FID) == null)
{
main.FFactoryCode = string.IsNullOrEmpty(item.FFactoryCode) ? main.FFactoryCode : item.FFactoryCode;
main.FCode = string.IsNullOrEmpty(item.FCode) ? main.FCode : item.FCode;
main.FBomUnit = string.IsNullOrEmpty(item.FBomUnit) ? main.FBomUnit : item.FBomUnit;
main.FRemark = string.IsNullOrEmpty(item.FRemark) ? main.FRemark : item.FRemark;
main.FSpecs = string.IsNullOrEmpty(item.FSpecs) ? main.FSpecs : item.FSpecs;
main.FNetWeight = GetWeight2(string.IsNullOrEmpty(item.FNetWeight) ? main.FNetWeight : item.FNetWeight);
main.FGrossWeight = GetWeight2(string.IsNullOrEmpty(item.FGrossWeight) ? main.FGrossWeight : item.FGrossWeight);
main.FSize = string.IsNullOrEmpty(item.FSize) ? main.FSize : item.FSize;
main.FVolume = string.IsNullOrEmpty(item.FVolume) ? main.FVolume : item.FVolume;
db.Updateable(main).ExecuteCommand();
}
TFS_PackageChild item2 = childList[i];
TFS_PackageChild child = db.Queryable<TFS_PackageChild>().Where(s => s.FCode == item2.FCode && s.FPackageID == main.FID).First();
TFS_Material material = db.Queryable<TFS_Material>().Where(s => s.FCode == item2.FCode).First();
if (child == null)
{
child = item2;
child.FPackageID = main.FID;
child.FMaterialID = material != null ? material.FID : -1;
child.FEditUser = userId;
child.FID = db.Insertable(child).IgnoreColumns(true).ExecuteReturnIdentity();
}
else
{
child.FPackageID = main.FID;
child.FMaterialID = material != null ? material.FID : -1;
child.FName = !string.IsNullOrEmpty(item2.FName) ? item2.FName : child.FName;
child.FCode = !string.IsNullOrEmpty(item2.FCode) ? item2.FCode : child.FCode;
child.FCount = !string.IsNullOrEmpty(item2.FCount) ? item2.FCount : child.FCount;
child.FUnit = !string.IsNullOrEmpty(item2.FUnit) ? item2.FUnit : child.FUnit;
child.FGroup = !string.IsNullOrEmpty(item2.FGroup) ? item2.FGroup : child.FGroup;
child.FOutSize = !string.IsNullOrEmpty(item2.FOutSize) ? item2.FOutSize : child.FOutSize;
child.FWeight = !string.IsNullOrEmpty(item2.FWeight) ? item2.FWeight : child.FWeight;
db.Updateable(child).ExecuteCommand();
}
mainList2.Add(main);
childList2.Add(child);
result += 1;
}
ExceptionHelper.AddSystemJournal(null, new { mainList, childList }, new { mainList2, childList2 }, userId, "InsertBatchPackageData");
return result;
}
private string GetWeight2(string weight)
{
if (string.IsNullOrEmpty(weight)) return "";
try
{
if (decimal.TryParse(weight, out decimal dWeight))
{
return Math.Round(dWeight, 2, MidpointRounding.AwayFromZero).ToString("f2");
}
}
catch (Exception) { }
return weight;
}
/// <summary>
/// 包材新增完成
/// </summary>
public void TaskCompleted(Dictionary<string, object> inParam)
{
int taskId = int.Parse(inParam["FTaskID"].ToString()); ;
int teamId = int.Parse(inParam["FTeamID"].ToString());
string taskSql = BaseBll.GetTaskSql(taskId, 2, teamId, (int)Constant.TaskType.);
SqlSugarClient db = AppSettingsHelper.GetSqlSugar();
db.Ado.ExecuteCommand(taskSql);
TeamworkBll.ChangeTeamProcess(teamId, db);
}
/// <summary>
/// 对接子项代码
/// </summary>
public object DockChildCode(Dictionary<string, object> inParam, List<TFS_PackageChild> childs, int userId)
{
SqlSugarClient db = AppSettingsHelper.GetSqlSugar();
db.BeginTran();
int result = 0;
try
{
int teamId = int.Parse(inParam["FTeamID"].ToString());
TFS_FTeamwork teamwork = db.Queryable<TFS_FTeamwork>().Where(s => s.FID == teamId).First();
foreach (var item in childs)
{
TFS_Material material = new TFS_Material()
{
FName = item.FName,
FType = "40",
FTestCode = "",
FFactoryID = teamwork.FCreateFactoryID,
FFactoryCode = teamwork.FCreateFactoryCode,
FMaterialGroup = item.FGroup,
FBaseUnit = item.FUnit,
FCode = item.FCode
};
material.FID = db.Insertable(material).IgnoreColumns(true).ExecuteReturnIdentity();
item.FAddDate = null;
item.FMaterialID = material.FID;
item.FCode = material.FCode;
item.FEditUser = userId;
item.FEditDate = DateTime.Now;
if (item.FID > 0) result += db.Updateable(item).IgnoreColumns(true).ExecuteCommand() + 1;
else result += db.Insertable(item).IgnoreColumns(true).ExecuteCommand() + 1;
TFS_ViewMaterial view = SetViewVal(material, teamwork, userId);
view.FBaseMaterialGroup = string.IsNullOrEmpty(material.FMaterialGroup) ? item.FGroup : "";
view.FFactoryCode = teamwork.FCreateFactoryCode;
view.FFactoryID = teamwork.FCreateFactoryID;
view.FBaseBasicMeter = material.FBaseUnit;
result += db.Insertable(view).IgnoreColumns(true).ExecuteCommand();
if (teamwork.FCreateFactoryID != teamwork.FProdFactoryID)
{
view.FFactoryCode = teamwork.FProdFactoryCode;
view.FFactoryID = teamwork.FProdFactoryID;
result += db.Insertable(view).IgnoreColumns(true).ExecuteCommand();
}
}
string taskSql = BaseBll.GetTaskSql(-1, 2, teamId, (int)Constant.TaskType., 2,
string.Format("(select count(1) from TFS_PackageChild where FPackageID={0} and FDeleted!=1 and FMaterialID<1)=0",
inParam["FID"].ToString()));
if (!string.IsNullOrEmpty(taskSql))
{
db.Ado.ExecuteCommand(taskSql);
TeamworkBll.ChangeTeamProcess(teamId, db);
}
string factory = teamwork.FCreateFactoryID.ToString();
if (teamwork.FCreateFactoryID != teamwork.FProdFactoryID) factory += "," + teamwork.FProdFactoryID;
BaseBll.CreateTaskData(teamId, userId, "11", factory, true, db);
db.CommitTran();
}
catch (Exception)
{
db.RollbackTran();
}
return result;
}
/// <summary>
/// 设置视图值
/// </summary>
private TFS_ViewMaterial SetViewVal(TFS_Material material, TFS_FTeamwork teamwork, int userId)
{
TFS_ViewMaterial view = new TFS_ViewMaterial()
{
FMaterialID = material.FID,
FTeamID = teamwork.FID,
FViewType = (int)Constant.ViewType.,
FLevel = 1,
FEditUser = userId,
FAddDate = DateTime.Now,
FBaseMaterialCode = string.IsNullOrEmpty(material.FPlmCode) ? material.FCode : material.FPlmCode,
FBaseTestCode = material.FTestCode,
FBaseMaterialDesc = material.FName
};
return view;
}
/// <summary>
/// 类属性赋值
/// </summary>
private void SetFieldVal(PropertyInfo[] props, object dataObj, Dictionary<string, object> inParam)
{
foreach (PropertyInfo prop in props)
{
if (inParam.ContainsKey(prop.Name))
{
object value = inParam[prop.Name];
if (prop.PropertyType.Name == "Decimal")
{
prop.SetValue(dataObj, ((decimal)value).ToString("#0.00"));
}
else if (prop.PropertyType.Name == "Int32" || prop.PropertyType.Name == "Int64")
{
prop.SetValue(dataObj, int.Parse(value.ToString()));
}
else
{
prop.SetValue(dataObj, value);
}
}
}
}
}
}

@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// 有关程序集的一般信息由以下
// 控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("FactorySystemBll")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("FactorySystemBll")]
[assembly: AssemblyCopyright("Copyright © 2022")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// 将 ComVisible 设置为 false 会使此程序集中的类型
//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
//请将此类型的 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
[assembly: Guid("de5ca953-c5f7-4df4-81b2-9c3d89849dc5")]
// 程序集的版本信息由下列四个值组成:
//
// 主版本
// 次版本
// 生成号
// 修订号
//
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

@ -0,0 +1,36 @@
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本:4.0.30319.42000
//
// 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,这些更改将会丢失。
// </auto-generated>
//------------------------------------------------------------------------------
namespace FactorySystemBll.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.3.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default {
get {
return defaultInstance;
}
}
[global::System.Configuration.ApplicationScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.SpecialSettingAttribute(global::System.Configuration.SpecialSetting.WebServiceUrl)]
[global::System.Configuration.DefaultSettingValueAttribute("http://dd.hbflavor.com:28888/PlmMsg/SendPLMMsgInterface.asmx")]
public string WeChatMsg {
get {
return ((string)(this["WeChatMsg"]));
}
}
}
}

@ -0,0 +1,9 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="FactorySystemBll.Properties" GeneratedClassName="Settings">
<Profiles />
<Settings>
<Setting Name="WeChatMsg" Type="(Web Service URL)" Scope="Application">
<Value Profile="(Default)">http://dd.hbflavor.com:28888/PlmMsg/SendPLMMsgInterface.asmx</Value>
</Setting>
</Settings>
</SettingsFile>

@ -0,0 +1,202 @@
using System;
using System.Collections.Generic;
using System.Linq;
using FactorySystemCommon;
using FactorySystemModel.EnumModel;
using FactorySystemModel.RequestModel;
using FactorySystemModel.ResponseModel;
using FactorySystemModel.SqlSugarModel;
using Newtonsoft.Json;
using SqlSugar;
namespace FactorySystemBll
{
public class TaskBll
{
/// <summary>
/// 获取任务列表
/// </summary>
public List<TaskRow> GetList(TaskQuery tq, out int totalNumber)
{
totalNumber = 0;
var db = AppSettingsHelper.GetSqlSugar();
return db.Queryable<TFS_Task, TFS_FTeamwork, TBasicCode>((a, b, c) => new JoinQueryInfos(JoinType.Inner, a.FTeamID == b.FID,
JoinType.Inner, c.FType == 33 && a.FType == int.Parse(c.FValue)))
// 事项状态
.WhereIF(tq.FState > 0 && tq.FState != 99, (a, b) => a.FState == tq.FState)
// 事项状态
.WhereIF(tq.FState == 99, (a, b) => a.FState <= 1)
// 销售号
.WhereIF(tq.FSaleCode != null, (a, b) => b.FSaleCode.Contains(tq.FSaleCode))
// 当前流程
.WhereIF(tq.FType > 0, (a, b) => a.FType == tq.FType)
// 发起时间1
.WhereIF(tq.FDateRange != null && tq.FDateRange[0] != "", (a, b) => a.FAddDate >= DateTime.Parse(tq.FDateRange[0]))
.WhereIF(tq.FDateRange != null && tq.FDateRange[1] != "", (a, b) => a.FAddDate <= DateTime.Parse(tq.FDateRange[1]))
// 责任人
.WhereIF(tq.FUserID != null, a => (',' + a.FUserID + ',').Contains(',' + tq.FUserID + ','))
// 协同
.WhereIF(tq.FTeamID > 0, a => a.FTeamID == tq.FTeamID).OrderBy((a, b, c) => a.FID, OrderByType.Desc)
.Select<TaskRow>("a.*,b.FSaleCode,b.FFormulaTestCode as FTestCode,b.FMdmCode,b.FFormulaName,b.FMaterialHalfIDs,cast(substring(c.FRemark,4,1)as int)as FViewType")
.ToPageList(tq.FPageIndex, tq.FPageSize, ref totalNumber);
}
/// <summary>
/// 物料组复核
/// </summary>
public int ReviewMaterialGroup(Dictionary<string, object> inParam, int userId)
{
int result = 0;
int teamId = int.Parse(inParam["FTeamID"].ToString());
int taskId = int.Parse(inParam["FTaskID"].ToString());
List<TFS_ViewMaterial> viewList = JsonConvert.DeserializeObject<List<TFS_ViewMaterial>>(inParam["FList"].ToString());
SqlSugarClient db = AppSettingsHelper.GetSqlSugar();
if (viewList.Count > 0)
{
foreach (var view in viewList)
{
result += db.Updateable<TFS_ViewMaterial>(new { FBaseMaterialGroup = view.FBaseMaterialGroup })
.Where(s => s.FID == view.FID && s.FTeamID == teamId && s.FViewType == (int)Constant.ViewType.)
.ExecuteCommand();
}
}
string taskSql = BaseBll.GetTaskSql(taskId, 2, teamId, (int)Constant.TaskType., 1);
if (!string.IsNullOrEmpty(taskSql))
{
taskSql += BaseBll.GetProcessSql(teamId, (int)Constant.ProcessType., "F2", 1);
result += db.Ado.ExecuteCommand(taskSql);
TeamworkBll.ChangeTeamProcess(teamId, db);
BaseBll.CreateTaskData(teamId, userId, "13");
}
return result;
}
/// <summary>
/// 组编号申请获取视图
/// </summary>
public List<TFS_ViewMaterial> GetDockGroupView(Dictionary<string, object> inParam)
{
int teamId = int.Parse(inParam["FTeamID"].ToString());
SqlSugarClient db = AppSettingsHelper.GetSqlSugar();
TFS_FTeamwork teamwork = db.Queryable<TFS_FTeamwork>().Where(s => s.FID == teamId).First();
List<int> viewType = new List<int>
{
(int)Constant.ViewType.,
(int)Constant.ViewType.,
(int)Constant.ViewType.
};
return db.Queryable<TFS_ViewMaterial>().Where(s => s.FTeamID == teamId && s.FFactoryID == teamwork.FProdFactoryID
&& SqlFunc.IsNullOrEmpty(s.FGroupCode) && viewType.Contains(s.FViewType)).ToList();
}
/// <summary>
/// 组编号申请处理视图
/// </summary>
public int DockMaterialGroup(List<TFS_ViewMaterial> viewList, int userId)
{
int result = 0;
SqlSugarClient db = AppSettingsHelper.GetSqlSugar();
db.BeginTran();
try
{
int teamId = viewList.First().FTeamID;
foreach (var view in viewList)
{
result += db.Updateable<TFS_ViewMaterial>(new { FGroupCode = view.FGroupCode, FEditUser = userId, FEditDate = DateTime.Now })
.Where(s => s.FTeamID == teamId && s.FMaterialID == view.FMaterialID && s.FViewType == view.FViewType).ExecuteCommand();
}
string taskSql = BaseBll.GetTaskSql(-1, 2, teamId, (int)Constant.TaskType., 2);
taskSql += BaseBll.GetProcessSql(teamId, (int)Constant.ProcessType., "F3", 2);
db.Ado.ExecuteCommand(taskSql);
TeamworkBll.ChangeTeamProcess(viewList.First().FTeamID, db);
db.CommitTran();
}
catch (Exception)
{
db.RollbackTran();
}
return result;
}
/// <summary>
/// 确认流程完成
/// </summary>
public int SureTeamWork(int teamId)
{
return AppSettingsHelper.GetSqlSugar().Ado.ExecuteCommand(string.Format(@"
if(select count(1) from TFS_Task where FTeamID={0} and FState!=2)=0
begin
update TFS_Task set FCanEdit=2 where FCanEdit!=2 and FTeamID={0};
update TFS_Task set FState=2,FFinishDate=getdate() where FState!=2 and FTeamID={0};
update TFS_FTeamProcess set FState=2,FFinishDate=getdate() where FState!=2 and FTeamID={0};
update TFS_FTeamwork set FProgress='100' where FID=36 and FProgress!='100'
end", teamId));
}
/// <summary>
/// 根据事项状态,进行下一步操作
/// </summary>
public void CheckTeamProcess(int teamId, int taskType, int userId)
{
string strSql = "";
int stateOk = 2;//完成状态
switch (taskType)
{
case (int)Constant.TaskType.:
strSql = string.Format(@"update TFS_FTeamProcess set FState={1} where FType={3} and FTeamID={0} and
(select count(1) from TFS_Task where FTeamID={0} and FType={2} and FState!={1})=0 and FState!={1};",
teamId, stateOk, taskType, (int)Constant.ProcessType.);
break;
case (int)Constant.TaskType.:
strSql = string.Format(@"update TFS_FTeamProcess set FState={1} where FType={3} and FTeamID={0} and
(select count(1) from TFS_Task where FTeamID={0} and FType={2} and FState!={1})=0 and FState!={1};",
teamId, stateOk, taskType, (int)Constant.ProcessType.BOM);
break;
case (int)Constant.TaskType.:
case (int)Constant.TaskType.:
string taskType2 = "3,12";
strSql = string.Format(@"update TFS_FTeamProcess set FState={1} where FType={3} and FTeamID={0} and
(select count(1) from TFS_Task where FTeamID={0} and FType in ({2}) and FState!={1})=0 and FState!={1};",
teamId, stateOk, taskType2, (int)Constant.ProcessType.);
break;
case (int)Constant.TaskType.:
case (int)Constant.TaskType.:
case (int)Constant.TaskType.:
string taskType1 = "4,5,6";
strSql = string.Format(@"update TFS_FTeamProcess set FState={1} where FType={3} and FTeamID={0} and
(select count(1) from TFS_Task where FTeamID={0} and FType in ({2}) and FState!={1})=0 and FState!={1};",
teamId, stateOk, taskType1, (int)Constant.ProcessType.);
break;
case (int)Constant.TaskType.:
strSql += BaseBll.GetProcessSql(teamId, (int)Constant.ProcessType., "F3", 2);
break;
case (int)Constant.TaskType.:
//事项设置不可修改、协同进度100%、流程设置完成
strSql += string.Format("update TFS_Task set FCanEdit=0 where FTeamID={0};", teamId);
strSql += string.Format("update TFS_FTeamwork set FProgress='100' where FID={0};", teamId);
strSql += BaseBll.GetProcessSql(teamId, (int)Constant.ProcessType., "F3", 2);
break;
}
//2022-10要求新增配方进度完成视图全部完成
strSql += string.Format(@"update TFS_FTeamProcess set FState={1} where FType={3} and FTeamID={0} and
(select count(1) from TFS_Task where FTeamID={0} and FType in ({2}) and FState!={1})=0 and FState!={1};",
teamId, stateOk, "3,4,5,6,7,11", (int)Constant.ProcessType.);
if (!string.IsNullOrEmpty(strSql)) strSql += ";";
SqlSugarClient db = AppSettingsHelper.GetSqlSugar();
//若流程除了最后个都完成
if (db.Queryable<TFS_FTeamProcess>().Where(s => s.FTeamID == teamId && s.FState != stateOk
&& s.FType != (int)Constant.ProcessType.).Count() == 0)
{
strSql += BaseBll.GetProcessSql(teamId, (int)Constant.ProcessType., "F2", 1);
BaseBll.CreateTaskData(teamId, userId, "13");
}
db.Ado.ExecuteCommand(strSql);
//更改协同进度
TeamworkBll.ChangeTeamProcess(teamId);
}
}
}

@ -0,0 +1,618 @@
using FactorySystemCommon;
using FactorySystemModel.BusinessModel;
using FactorySystemModel.EnumModel;
using FactorySystemModel.SqlSugarModel;
using Newtonsoft.Json;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Linq.Expressions;
using System.Reflection;
namespace FactorySystemBll
{
public class TeamworkBll
{
/// <summary>
/// 公共列表接口
/// </summary>
public object GetTeamworkPageList(Dictionary<string, object> inParam, int userId, out int totalCount)
{
totalCount = 0;
int pageIndex = 1, pageSize = 15;
List<string> paramName = new List<string>() { "FDeleted!=1" };
List<SugarParameter> paramVal = new List<SugarParameter>();
if (inParam != null && inParam.Count > 0)
{
foreach (var item in inParam)
{
if (item.Key == "FPageIndex" || item.Key == "PageIndex")
{
int.TryParse(item.Value.ToString(), out pageIndex);
}
else if (item.Key == "FPageSize" || item.Key == "PageSize")
{
int.TryParse(item.Value.ToString(), out pageSize);
}
else if (item.Key == "FAddDate" || item.Key == "AddDate")
{
paramName.Add("convert(varchar(10),FAddDate,120)=@FAddDate");
paramVal.Add(new SugarParameter("@FAddDate", item.Value.ToString()));
}
else if (item.Key == "FDataType" || item.Key == "DataType")
{
if (item.Value.ToString() == "1")//我发起的
{
paramName.Add("FAddUser=@FAddUser");
paramVal.Add(new SugarParameter("@FAddUser", userId));
}
else if (item.Value.ToString() == "2")//我参与的
{
paramName.Add(string.Format(@"FID in(select distinct FTeamID from TFS_FTeamProcess where ','+FChargeID+',' like '%,{0},%'
union select distinct FTeamID from TFS_Task where ',' + FUserID + ',' like '%,{0},%')", userId));
}
}
else if (item.Key == "FProgress" || item.Key == "FProgress")
{
string pVal = item.Value.ToString();
if (!string.IsNullOrEmpty(pVal))
{
if (pVal == "100" || pVal == "100%")
{
paramName.Add("FProgress='100'");
}
else
{
paramName.Add("FProgress!='100'");
}
}
}
else
{
//检索,全转成字符串
paramName.Add("','+cast(" + item.Key + " as varchar)+',' like '%'+@" + item.Key + "+'%'");
paramVal.Add(new SugarParameter("@" + item.Key, item.Value.ToString()));
}
}
}
string searchKey = "a.FID,a.FSaleCode,a.FTestCode,a.FViewType,a.FMdmCode,a.FFormulaID,a.FWeightUnit,a.FBomState,a.FProgress," +
"a.FDeleted,a.FAddUser,a.FAddDate,a.FEditDate,b.FName FAddUserName,a.FFormulaName,a.FFormulaTestCode,a.FMaterialHalfIDs";
SqlSugarClient db = AppSettingsHelper.GetSqlSugar();
var temp = db.Queryable<TFS_FTeamwork, TUser>((a, b) => new JoinQueryInfos(JoinType.Left, a.FAddUser == b.FID)).Select(searchKey);
List<TFS_FTeamwork> resultList = db.Queryable(temp).Where(string.Join(" and ", paramName), paramVal)
.OrderBy("FID desc").ToPageList(pageIndex, pageSize, ref totalCount);
if (resultList.Count() > 0)
{
List<int> teamIds = resultList.Select(s => s.FID).ToList();
List<TFS_Task> taskList = db.Queryable<TFS_Task>().Where(s => teamIds.Contains(s.FTeamID) && s.FState == 1)
.Select("FTeamID,FType,FName").GroupBy("FTeamID,FType,FName").OrderBy("FType").ToList();
if (taskList.Count() > 0)
{
foreach (TFS_FTeamwork item in resultList)
{
item.FTaskList = taskList.Where(s => s.FTeamID == item.FID).ToList();
}
}
}
return resultList;
}
/// <summary>
/// 创建流程(仅仅创建,进度各个事项判断)
/// </summary>
public int CreateProcessData(int teamId, int userId)
{
SqlSugarClient db = AppSettingsHelper.GetSqlSugar();
try
{
List<TBasicCode> typeList = db.Queryable<TBasicCode>().Where(s => s.FType == (int)Constant.BasicCode. && s.FState == 1).ToList();
List<TFS_FTeamProcess> taskList = new List<TFS_FTeamProcess>();
foreach (var item in typeList)
{
TFS_FTeamProcess process = new TFS_FTeamProcess()
{
FState = 0,//默认未开始
FProgress = 1,//默认F1文字
FDesc = item.F1,
FTeamID = teamId,
FName = item.FName,
FEditUser = userId,
FAddDate = DateTime.Now,
FEditDate = DateTime.Now,
FType = int.Parse(item.FValue),
FGroup = int.Parse(item.FCode),
FChargeID = "",
FChargeName = ""
};
List<TUser> users = null;
int proType = int.Parse(item.FValue);
switch (proType)
{
case (int)Constant.ProcessType.:
string funcIds1 = "1,2,3";//36
users = db.Queryable<TUser>().Where(string.Format(@"FState=1 and FRoleID in(select distinct FRoleID from
TRole_Right where FType={1} and FFunctionID in({0}))", funcIds1, (int)Constant.RoleType.事项权限)).ToList();
break;
case (int)Constant.ProcessType.:
string funcIds2 = "1";//30
users = db.Queryable<TUser>().Where(string.Format(@"FState=1 and FRoleID in(select distinct FRoleID from
TRole_Right where FType={1} and FFunctionID in(select FValue from TBasicCode where FType={0} and F1={2}))",
(int)Constant.BasicCode., (int)Constant.RoleType., funcIds2)).ToList();
break;
case (int)Constant.ProcessType.:
string funcIds3 = "2,3,4";//30
users = db.Queryable<TUser>().Where(string.Format(@"FState=1 and FRoleID in(select distinct FRoleID from
TRole_Right where FType={1} and FFunctionID in(select FValue from TBasicCode where FType={0} and F1 in({2})))",
(int)Constant.BasicCode., (int)Constant.RoleType., funcIds3)).ToList();
break;
case (int)Constant.ProcessType.:
string funcIds4 = "5";//30
users = db.Queryable<TUser>().Where(string.Format(@"FState=1 and FRoleID in(select distinct FRoleID from
TRole_Right where FType={1} and FFunctionID in(select FValue from TBasicCode where FType={0} and F1={2}))",
(int)Constant.BasicCode., (int)Constant.RoleType., funcIds4)).ToList();
break;
case (int)Constant.ProcessType.:
string funcIds5 = "2,7";//39
users = db.Queryable<TUser>().Where(string.Format(@"FState=1 and FRoleID in(select distinct FRoleID from
TRole_Right where FType={1} and FFunctionID in({0}))", funcIds5, (int)Constant.RoleType.视图权限)).ToList();
break;
case (int)Constant.ProcessType.线:
string funcIds6 = "3,8";//39
users = db.Queryable<TUser>().Where(string.Format(@"FState=1 and FRoleID in(select distinct FRoleID from
TRole_Right where FType={1} and FFunctionID in({0}))", funcIds6, (int)Constant.RoleType.视图权限)).ToList();
break;
case (int)Constant.ProcessType.:
string funcIds7 = "4,9";//39
users = db.Queryable<TUser>().Where(string.Format(@"FState=1 and FRoleID in(select distinct FRoleID from
TRole_Right where FType={1} and FFunctionID in({0}))", funcIds7, (int)Constant.RoleType.视图权限)).ToList();
break;
case (int)Constant.ProcessType.BOM:
string funcIds8 = "5,6";//36
users = db.Queryable<TUser>().Where(string.Format(@"FState=1 and (FRoleID in(select distinct FRoleID from
TRole_Right where FType={1} and FFunctionID in(select FValue from TBasicCode where FType={0} and F1={2}))
or FRoleID in(select distinct FRoleID from TRole_Right where FType={3} and FFunctionID in({4})) )",
(int)Constant.BasicCode., (int)Constant.RoleType., (int)Constant.ViewType.,
(int)Constant.RoleType., funcIds8)).ToList();
break;
case (int)Constant.ProcessType.:
string funcIds9 = "7";//36
users = db.Queryable<TUser>().Where(string.Format(@"FState=1 and FRoleID in(select distinct FRoleID from
TRole_Right where FType={1} and FFunctionID in({0}))", funcIds9, (int)Constant.RoleType.事项权限)).ToList();
break;
}
if (users != null && users.Count > 0)
{
foreach (var user in users)
{
process.FChargeID += user.FID + ",";
process.FChargeName += user.FName + "、";
}
process.FChargeID = process.FChargeID.Trim(',');
process.FChargeName = process.FChargeName.Trim('、');
}
else
{
process.FChargeName = "暂无";
process.FChargeID = "-1";
}
taskList.Add(process);
}
if (taskList.Count() > 0) return db.Insertable(taskList).ExecuteCommand();
}
catch (Exception)
{
//创建失败,删除
db.Deleteable<TFS_FTeamProcess>().Where(s => s.FTeamID == teamId).ExecuteCommand();
}
return 0;
}
/// <summary>
/// 旧配方处理流程进度
/// </summary>
public void HasMaterialTestCode(TFS_FTeamwork teamInfo)
{
string proSql = BaseBll.GetProcessSql(teamInfo.FID, (int)Constant.ProcessType., "F5", 2);
proSql += BaseBll.GetProcessSql(teamInfo.FID, (int)Constant.ProcessType., "F5", 2);
proSql += BaseBll.GetProcessSql(teamInfo.FID, (int)Constant.ProcessType., "F3", 2);
proSql += BaseBll.GetProcessSql(teamInfo.FID, (int)Constant.ProcessType.线, "F3", 2);
proSql += BaseBll.GetProcessSql(teamInfo.FID, (int)Constant.ProcessType., "F4", 2);
AppSettingsHelper.GetSqlSugar().Ado.ExecuteCommand(proSql.Trim(';'));
ChangeTeamProcess(teamInfo.FID);
}
/// <summary>
/// 获取协同视图字段信息
/// </summary>
public List<TFS_ViewFieldInfo> GetTeamworkViewField(int intType)
{
return AppSettingsHelper.GetSqlSugar().Queryable<TFS_ViewFieldInfo>().Where(s => s.FType == intType
&& s.FDeleted != (int)Constant.DeleteCode.).OrderBy(s => s.FOrder).ToList();
}
/// <summary>
/// 获取协同视图结果信息
/// </summary>
public DataTable GetTeamworkViewData(string selectSql, string whereSql, string joinSql = "")
{
SqlSugarClient db = AppSettingsHelper.GetSqlSugar();
string strSql = string.Format(@"select distinct {0},TFS_ViewMaterial.FMaterialID from TFS_FTeamwork left join TFS_ViewMaterial on
TFS_FTeamwork.FID=TFS_ViewMaterial.FTeamID 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>
public DataTable GetTeamworkViewData2(string selectSql, string whereSql, string joinSql = "")
{
SqlSugarClient db = AppSettingsHelper.GetSqlSugar();
string strSql = string.Format(@"select distinct {0},TFS_ViewMaterial.FMaterialID from TFS_ViewMaterial
left join TFS_Material on TFS_Material.FID=TFS_ViewMaterial.FMaterialID
left join TFS_MaterialInfo on TFS_ViewMaterial.FMaterialID=TFS_MaterialInfo.FDataID and TFS_MaterialInfo.FType=2
left join TFS_PackageChild on TFS_PackageChild.FMaterialID =TFS_ViewMaterial.FMaterialID
{2} where {1}", selectSql, whereSql, string.IsNullOrEmpty(joinSql) ? "" : joinSql);
return db.Ado.GetDataTable(strSql);
}
/// <summary>
/// BOM梳理结果数据处理
/// </summary>
public bool AnalysisBomData(List<TFS_Material> mateList, List<TFS_ViewMaterial> viewList, int teamId, int userId, string formulaIds, string halfIds)
{
SqlSugarClient db = AppSettingsHelper.GetSqlSugar();
db.BeginTran();
try
{
viewList = viewList.OrderBy(s => s.FLevel).ToList();
List<TFS_Material> formulaList = new List<TFS_Material>();
TFS_FTeamwork teamInfo = db.Queryable<TFS_FTeamwork>().Where(s => s.FID == teamId).First();
TFS_Factory factory = null;
string proSql = "";
Dictionary<int, string> hasNewView = new Dictionary<int, string>();
for (int i = 0; i < viewList.Count; i++)
{
TFS_ViewMaterial vItem = viewList[i];
TFS_Material mItem = mateList.Find(s => s.FID == vItem.FBomMaterialID);
int oldId = mItem.FID, oldParent = mItem.FParentID;
Expression<Func<TFS_Material, bool>> expression;
if (string.IsNullOrEmpty(mItem.FCode)) expression = s => s.FPlmCode == mItem.FPlmCode && s.FVersionCode == mItem.FVersionCode;
else expression = s => s.FCode == mItem.FCode && s.FVersionCode == mItem.FVersionCode;
TFS_Material mData = db.Queryable<TFS_Material>().Where(expression).First();
if (mData == null)//没物料新增物料
{
if (factory == null)
{
string tempSql = @"select * from TFS_Factory where FID=(select FFactoryID from TUser where FID={0})";
factory = db.SqlQueryable<TFS_Factory>(string.Format(tempSql, userId)).First();
}
if (factory != null)
{
mItem.FFactoryID = factory.FID;
mItem.FFactoryCode = factory.FCode;
}
mItem.FID = db.Insertable(mItem).IgnoreColumns(true).ExecuteReturnIdentity();
//if (vItem.FLevel > 1) formulaIds += "," + mItem.FID;
}
else
{
string name = string.IsNullOrEmpty(mData.FName) ? mItem.FName : mData.FName;
viewList[i].FBaseMaterialDesc = name;
mItem = mData;
}
//formulaIds = formulaIds.Replace(oldId.ToString(), mItem.FID.ToString());
halfIds = halfIds.Replace(oldId.ToString(), mItem.FID.ToString());
bool hasCreate = false;
bool isAddFormula = false;
//是否有委外视图
TFS_ViewMaterial vData = db.Queryable<TFS_ViewMaterial>().Where(s => s.FFactoryID == teamInfo.FCreateFactoryID
&& s.FMaterialID == mItem.FID).First();
if (vData == null)
{
hasCreate = isAddFormula = true;
vItem.FFactoryID = teamInfo.FCreateFactoryID;
vItem.FFactoryCode = teamInfo.FCreateFactoryCode;
vItem.FTeamID = teamInfo.FID;
vItem.FMaterialID = mItem.FID;
vItem.FBaseMaterialGroup = mItem.FMaterialGroup;
vItem.FBaseBasicMeter = mItem.FBaseUnit;
db.Insertable(vItem).IgnoreColumns(true).ExecuteCommand();
if (!hasNewView.ContainsKey(vItem.FViewType)) hasNewView.Add(vItem.FViewType, vItem.FFactoryID.ToString() + ",");
else hasNewView[vItem.FViewType] = hasNewView[vItem.FViewType] + vItem.FFactoryID.ToString() + ",";
}
//是否有工厂视图
vData = db.Queryable<TFS_ViewMaterial>().Where(s => s.FFactoryID == teamInfo.FProdFactoryID && s.FMaterialID == mItem.FID).First();
if (vData == null)
{
isAddFormula = true;
vItem.FFactoryID = teamInfo.FProdFactoryID;
vItem.FFactoryCode = teamInfo.FProdFactoryCode;
vItem.FTeamID = teamInfo.FID;
vItem.FMaterialID = mItem.FID;
vItem.FBaseMaterialGroup = mItem.FMaterialGroup;
vItem.FBaseBasicMeter = mItem.FBaseUnit;
//所谓固定字段,但是分工厂且视图还不一样
if (vItem.FViewType == (int)Constant.ViewType. || vItem.FViewType == (int)Constant.ViewType.
|| vItem.FViewType == (int)Constant.ViewType.)
{
vItem.FQualityType3 = "04";
vItem.FQualityType5 = "09";
}
else if (vItem.FViewType == (int)Constant.ViewType.)
{
if (hasCreate) vItem.FQualityType4 = "05";
}
else if (vItem.FViewType == (int)Constant.ViewType.)
{
if (hasCreate) vItem.FQualityType4 = "05";
else vItem.FQualityType1 = "01";
}
db.Insertable(vItem).IgnoreColumns(true).ExecuteCommand();
if (!hasNewView.ContainsKey(vItem.FViewType)) hasNewView.Add(vItem.FViewType, vItem.FFactoryID.ToString() + ",");
else hasNewView[vItem.FViewType] = hasNewView[vItem.FViewType] + vItem.FFactoryID.ToString() + ",";
}
mItem.FIsNew = isAddFormula;
mItem.FOldID = oldId;
mItem.FLevelID = vItem.FLevel;
mItem.FParentID = oldParent;
if (mItem.FLevelID >= 1) formulaList.Add(mItem);
}
formulaIds = "";
//2022-09-27生成BOM层级关系生成配方视图的时候再根据这个处理父子
List<BomFormulaDto> bfList = new List<BomFormulaDto>();
if (formulaList.Count > 0)
{
foreach (TFS_Material first in formulaList.Where(s => s.FLevelID == 1))
{
bfList.Add(new BomFormulaDto() { mId = first.FID, isNew = first.FIsNew, childs = GetBomFormulaChild(first, formulaList, out string fids) });
formulaIds += first.FID + "," + fids;
}
}
if (hasNewView.Count() > 0)
{
hasNewView.OrderBy(s => s.Key);
string facoryIds = ""; bool hasOther = false;
foreach (var item in hasNewView)
{
//创建视图事项
string factorys = item.Value.Trim(',');
BaseBll.CreateTaskData(teamInfo.FID, userId, (item.Key + 2).ToString(), factorys);
facoryIds += factorys;
if (item.Key != (int)Constant.ViewType.) hasOther = true;
}
if (hasNewView.ContainsKey((int)Constant.ViewType.))
{
proSql += BaseBll.GetProcessSql(teamInfo.FID, (int)Constant.ProcessType., "F2", 1);
}
else
{
proSql += BaseBll.GetProcessSql(teamInfo.FID, (int)Constant.ProcessType., "F4", 2);
}
if (hasOther)
{
proSql += BaseBll.GetProcessSql(teamInfo.FID, (int)Constant.ProcessType., "F2", 1);
}
else
{
proSql += BaseBll.GetProcessSql(teamInfo.FID, (int)Constant.ProcessType., "F4", 2);
}
if (hasNewView.ContainsKey((int)Constant.ViewType.) || hasNewView.ContainsKey((int)Constant.ViewType.)
|| hasNewView.ContainsKey((int)Constant.ViewType.))
{
proSql += string.Format("update TFS_FTeamwork set FViewType=FViewType+',3,4' where FID={0};", teamInfo.FID);
BaseBll.CreateTaskData(teamId, userId, "8");
}
proSql += BaseBll.GetProcessSql(teamInfo.FID, (int)Constant.ProcessType., "F2", 1);
}
else
{
proSql += BaseBll.GetProcessSql(teamInfo.FID, (int)Constant.ProcessType., "F2", 2);
proSql += BaseBll.GetProcessSql(teamInfo.FID, (int)Constant.ProcessType., "F4", 2);
proSql += BaseBll.GetProcessSql(teamInfo.FID, (int)Constant.ProcessType., "F4", 2);
}
//下面两个要根据包材判断先改成进行中hasNewView == 0 && 包材是旧的,完成
int pVersion = (hasNewView.Count == 0 && teamInfo.FPackID < 1) ? 2 : 1;
proSql += BaseBll.GetProcessSql(teamInfo.FID, (int)Constant.ProcessType.线, "F2", pVersion);
proSql += BaseBll.GetProcessSql(teamInfo.FID, (int)Constant.ProcessType., "F2", pVersion);
string updateSql = "";
formulaIds = formulaIds.Replace(",,", ",").Replace(",,", ",").Replace(",,", ",").Trim(',');
if (!string.IsNullOrEmpty(formulaIds))
{
updateSql += string.Format("FMaterialFormulaIDs='{0}',FViewType=FViewType+',2',", formulaIds);
updateSql += string.Format("FBomFormula='{0}',", JsonConvert.SerializeObject(bfList));
}
if (!string.IsNullOrEmpty(halfIds)) updateSql += string.Format("FMaterialHalfIDs='{0}',", halfIds);
if (!string.IsNullOrEmpty(updateSql)) proSql += string.Format("update TFS_FTeamwork set {1} where FID={0};", teamInfo.FID, updateSql.Trim(','));
proSql += BaseBll.GetTaskSql(-1, 2, teamId, (int)Constant.TaskType.BOM, 2);
db.Ado.ExecuteCommand(proSql.Trim(';'));
db.CommitTran();
}
catch (Exception ex)
{
db.RollbackTran();
return false;
}
return true;
}
private List<BomFormulaDto> GetBomFormulaChild(TFS_Material first, List<TFS_Material> formulaList, out string fids)
{
List<BomFormulaDto> dtoList = new List<BomFormulaDto>();
List<TFS_Material> temps = formulaList.Where(s => s.FParentID == first.FOldID).ToList();
fids = "";
if (temps != null && temps.Count > 0)
{
foreach (TFS_Material item in temps)
{
if (first.FIsNew || item.FIsNew) fids += item.FID + ",";//父级新则子一级全部都要、自己是新
dtoList.Add(new BomFormulaDto() { mId = item.FID, isNew = item.FIsNew, childs = GetBomFormulaChild(item, formulaList, out string nextIds) });
if (!string.IsNullOrEmpty(nextIds)) fids += nextIds + ",";
}
}
return dtoList;
}
/// <summary>
/// 创建成品视图和包材判断
/// </summary>
public bool CreateProductView(TFS_FTeamwork teamInfo, List<TFS_Material> materialList, int userId)
{
SqlSugarClient db = AppSettingsHelper.GetSqlSugar();
db.BeginTran();
try
{
TFS_PackageMain package = null;
string proSql = "";
//包材信息判断
{
//string packCode = teamInfo.FPackCode;
//List<string> names = teamInfo.FSaleCode.Split('-').ToList();
//string name = names.Where(s => s.Contains("@")).FirstOrDefault();
//if (string.IsNullOrEmpty(name))
//{
// name = names.Where(s => s.Contains("□")).FirstOrDefault();
// if (!string.IsNullOrEmpty(name)) packCode = name.Substring(0, name.IndexOf("□"));
//}
//else
//{
// packCode = name.Substring(0, name.IndexOf("@"));
//}
//if (!string.IsNullOrEmpty(packCode))
//{
// teamInfo.FPackCode = packCode;
//}
package = db.Queryable<TFS_PackageMain>().Where(s => s.FCode == teamInfo.FPackCode).OrderBy(s => s.FID, OrderByType.Desc).First();
if (package == null)
{
db.Updateable<TFS_FTeamwork>(new { FPackCode = teamInfo.FPackCode }).Where(s => s.FID == teamInfo.FID).ExecuteCommand();
//BaseBll.CreateTaskData(teamInfo.FID, userId, "9");//新增新包材事项
proSql += BaseBll.GetProcessSql(teamInfo.FID, (int)Constant.ProcessType.BOM, "F2", 0);//新包材流程进行中
} else
{
db.Updateable<TFS_FTeamwork>(new { FPackID = package.FID, FPackCode = teamInfo.FPackCode }).Where(s => s.FID == teamInfo.FID).ExecuteCommand();
proSql += BaseBll.GetProcessSql(teamInfo.FID, (int)Constant.ProcessType.BOM, "F3", 0);//新包材流程完成
}
if (materialList != null && materialList.Count > 0)
{
TFS_Material material = materialList.Find(s => s.FType == "20");//默认取第一个20的没找到取第一个
if (material == null) material = materialList.FirstOrDefault();
db.Updateable<TFS_FTeamwork>(new { FMaterialHalfIDs = material.FID }).Where(s => s.FID == teamInfo.FID).ExecuteCommand();
}
}
//物料和成品视图
{
TFS_Material mainMater = new TFS_Material()
{
FName = teamInfo.FSaleCode,
FDesc = teamInfo.FSaleCode,
FType = "10",
FCode = teamInfo.FMdmCode,
FTestCode = teamInfo.FFormulaTestCode,
FFactoryID = teamInfo.FCreateFactoryID,
FFactoryCode = teamInfo.FCreateFactoryCode,
FEditUser = userId
};
mainMater.FID = db.Insertable(mainMater).IgnoreColumns(true).ExecuteReturnIdentity();
TFS_ViewMaterial mainView = new TFS_ViewMaterial()
{
FMaterialID = mainMater.FID,
FTeamID = teamInfo.FID,
FFactoryID = teamInfo.FCreateFactoryID,
FFactoryCode = teamInfo.FCreateFactoryCode,
FViewType = (int)Constant.ViewType.,
FLevel = 1,
FEditUser = userId,
FBaseMaterialCode = teamInfo.FMdmCode,
FBaseTestCode = teamInfo.FTestCode,
FBaseBasicMeter = teamInfo.FWeightUnit,
FBaseMaterialDesc = teamInfo.FSaleCode,
FBaseMaterialGroup = teamInfo.FMaterialGroup,
//默认值不同
FOrganizeMaterialType = teamInfo.FMaterialType,
FAccountPriceUnit = "1",
FAccountAccessType = "3000",
FAccountSaleOrderInventory = "3010",
FAccountCostAccountBatch = "1",
//2022-10-08 所谓的成品字段值是包材的规格、毛重、净重
FBaseSpecification = package != null ? package.FSpecs : "",
FBaseGrossWeight = package != null ? package.FGrossWeight : "",
FBaseNetWeight = package != null ? package.FNetWeight : ""
};
db.Insertable(mainView).IgnoreColumns(true).ExecuteCommand();
if (teamInfo.FProdFactoryID != teamInfo.FCreateFactoryID)
{
mainView.FFactoryID = teamInfo.FProdFactoryID;
mainView.FFactoryCode = teamInfo.FProdFactoryCode;
db.Insertable(mainView).IgnoreColumns(true).ExecuteCommand();
}
//成品视图
//BaseBll.CreateTaskData(teamInfo.FID, userId, "3", teamInfo.FCreateFactoryID + "," + teamInfo.FProdFactoryID);
}
//成品视图物料组复核,有权限的所有
//BaseBll.CreateTaskData(teamInfo.FID, userId, "12");
//修改流程状态(协同发起完成,成品视图进行中)
//proSql += BaseBll.GetProcessSql(teamInfo.FID, (int)Constant.ProcessType.协同发起, "F2", 1);
//proSql += BaseBll.GetProcessSql(teamInfo.FID, (int)Constant.ProcessType.成品视图, "F2", 1);
proSql += BaseBll.GetTaskSql(-1, 2, teamInfo.FID, (int)Constant.TaskType., 2);
proSql = proSql.Trim(';');
int result = db.Ado.ExecuteCommand(proSql);
db.CommitTran();
}
catch (Exception ex)
{
db.RollbackTran();
return false;
}
return true;
}
/// <summary>
/// 判断物料表里有这个实验号的数量
/// </summary>
public List<TFS_Material> CheckMaterialListByTest(string testCode, string versionCode)
{
return AppSettingsHelper.GetSqlSugar().Queryable<TFS_Material>().Where(s => s.FTestCode == testCode && s.FVersionCode == versionCode).ToList();
}
/// <summary>
/// 更新协同主信息进度
/// </summary>
public static void ChangeTeamProcess(int teamId, SqlSugarClient db = null)
{
if (db == null) db = AppSettingsHelper.GetSqlSugar();
db.Ado.ExecuteCommand(string.Format(@"
declare @process1 int;
set @process1=(select count(1) from TFS_FTeamProcess where FTeamID={0} and FState=2)*8;
set @process1+=(select count(1) from TFS_Task where FTeamID={0} and FState=2)*5;
update TFS_FTeamwork set FProgress=(case when @process1>99 then '99' else @process1 end)
where FID={0} and FProgress!='100';
", teamId));
}
/// <summary>
/// 更具描述查询是否有重复名称
/// </summary>
/// <param name="name"></param>
/// <returns></returns>
public bool CheckTeamName(string name)
{
SqlSugarClient db = AppSettingsHelper.GetSqlSugar();
return db.Queryable<TFS_FTeamwork>().Any(m => m.FSaleCode == name&&m.FDeleted!= (int)Constant.DeleteCode.);
}
}
}

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save