Commit 1de86716 by 肖小磊

init

parent ee3e83ba

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.25420.1
VisualStudioVersion = 14.0.23107.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FTM.API", "FTM.API\FTM.API.csproj", "{110745E8-6004-46CA-8499-6977998C0408}"
EndProject
......@@ -31,6 +31,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Service", "Service", "{E15A
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FTM.RunAzcopy", "FTM.RunAzcopy\FTM.RunAzcopy.csproj", "{6B8E9D69-2E48-4894-9558-D8E528B94881}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RedPosService", "RedPosService\RedPosService.csproj", "{9854F955-3005-4260-B2D6-D9F9354BA8D2}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
......@@ -85,6 +87,10 @@ Global
{6B8E9D69-2E48-4894-9558-D8E528B94881}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6B8E9D69-2E48-4894-9558-D8E528B94881}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6B8E9D69-2E48-4894-9558-D8E528B94881}.Release|Any CPU.Build.0 = Release|Any CPU
{9854F955-3005-4260-B2D6-D9F9354BA8D2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9854F955-3005-4260-B2D6-D9F9354BA8D2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9854F955-3005-4260-B2D6-D9F9354BA8D2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9854F955-3005-4260-B2D6-D9F9354BA8D2}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
......
......@@ -21,6 +21,7 @@ namespace FTM.API.Controllers
public class StoreController : ApiControllerBase
{
public IStoreService StoreService { get; set; }
public IRedPosService RedPosService { get; set; }
/// <summary>
......@@ -68,6 +69,20 @@ namespace FTM.API.Controllers
return new HttpResponse<GoMaxH5Response>() { Data = response };
}
/// <summary>
/// 查询门店
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[Route("Store/GoMaxH5/RedPos"), HttpGet]
public HttpResponse<List<RedPosItem>> RedPos()
{
var response = RedPosService.GetRedPostList();
return new HttpResponse<List<RedPosItem>>() { Data = response };
}
/// <summary>
/// 查询门店
/// </summary>
......
......@@ -289,7 +289,7 @@ namespace FTM.Common
{
writer.Write(string.Format("{0}{1}{0}{2}",
(quotesRequired || escapeQuotes ? "\"" : string.Empty),
"'" + fieldValue,
fieldValue,
(i < (fields.Count - 1) ? "," : string.Empty)));
}
else
......
......@@ -48,6 +48,7 @@
<Compile Include="IFuncationRepository.cs" />
<Compile Include="ILogRepository.cs" />
<Compile Include="IPosRepository.cs" />
<Compile Include="IRedPosRepository.cs" />
<Compile Include="IRoleRepository.cs" />
<Compile Include="IStatisticsRepository.cs" />
<Compile Include="IStoreRepository.cs" />
......
......@@ -53,5 +53,7 @@ namespace FTM.IRepository
List<string> OffilinePos();
List<string> OfflineSC();
Dictionary<string, List<string>> GetAllPos();
}
}
\ No newline at end of file
using FTM.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace FTM.IRepository
{
public interface IRedPosRepository
{
void AddRePos(RedPosItem item);
List<RedPosItem> GetRedPostList();
}
}
......@@ -45,6 +45,7 @@
<Compile Include="ICustomBatService.cs" />
<Compile Include="IDBMMonitorReportService.cs" />
<Compile Include="IFunctionService.cs" />
<Compile Include="IRedPosService.cs" />
<Compile Include="IStaffService.cs" />
<Compile Include="IStoreService.cs" />
<Compile Include="ITaskProgressService.cs" />
......
......@@ -59,5 +59,9 @@ namespace FTM.IService
List<string> OffilinePos();
List<string> OfflineSC();
Dictionary<string, List<string>> GetAllPos();
}
}
\ No newline at end of file
using FTM.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace FTM.IService
{
public interface IRedPosService
{
void AddRedPos(String StoreID, String PosID);
List<RedPosItem> GetRedPostList();
}
}
\ No newline at end of file
......@@ -33,5 +33,7 @@ namespace FTM.IService
string GetStoreIDByPreIP(string PreIP);
bool UpdateStoreZeroClient(string StoreID, string ZeroClient);
GoMaxH5Response GetGoaxH5RedInfo(string StoreID, string PosID);
}
}
......@@ -62,6 +62,8 @@
<Compile Include="PosDetailDM.cs" />
<Compile Include="POSDM.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="RedPosItem.cs" />
<Compile Include="RedPosQuestionItem.cs" />
<Compile Include="RoleFunctionItem.cs" />
<Compile Include="RoleItem.cs" />
<Compile Include="StaffInfo.cs" />
......
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace FTM.Model
{
public class RedPosItem
{
public string StoreID { get; set; }
public string StoreName { get; set; }
public string PosID { get; set; }
public string Type { get; set; }
public string NetStatus { get; set; }
public string BusinessDate { get; set; }
public string RunStatus { get; set; }
public string LoginStaus { get; set; }
public string ScreenVersion { get; set; }
public List<RedPosQuestionItem> Questions { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace FTM.Model
{
public class RedPosQuestionItem
{
public string StoreID { get; set; }
public string PosID { get; set; }
public string Face { get; set; }
public string Question { get; set; }
public string Solution { get; set; }
}
}
......@@ -35,5 +35,7 @@ namespace FTM.Model
public string SOKPicSize;
public int TaskStatus;
public decimal? MemoryFree;
public string BeginTime;
public string EndTime;
}
}
......@@ -55,6 +55,7 @@
<Compile Include="LogRepository.cs" />
<Compile Include="PosRepository.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="RedPosRepository.cs" />
<Compile Include="RoleRepository.cs" />
<Compile Include="StaffRepository.cs" />
<Compile Include="StatisticsRepository.cs" />
......
......@@ -263,7 +263,7 @@ namespace FTM.Repository
,t.PosID, p.Type
,p.State,s.StoreID,s.Name AS StoreName
,p.Np6Version,p.ScreenVersion,t.Status as TaskStatus
,p.Np6ExeVersion,p.SOKPicVer,p.SelfSoft,p.ForkVersion,t.ErrorMsg,p.IP
,p.Np6ExeVersion,p.SOKPicVer,p.SelfSoft,p.ForkVersion,t.ErrorMsg,p.IP,t.BeginTime,t.EndTime
FROM dbo.FTM_Task_Pos t WITH (NOLOCK)
LEFT JOIN dbo.FTM_POS p WITH (NOLOCK)
ON t.StoreID=p.StoreID and t.PosID = p.PosID
......@@ -282,7 +282,7 @@ namespace FTM.Repository
a.rowNumber,a.PosID,a.Type,a.State
,a.StoreID,a.StoreName,a.Np6Version,a.Np6ExeVersion
,a.SOKPicVer,a.SelfSoft,a.ForkVersion
,a.ErrorMsg,a.IP,a.ScreenVersion,TaskStatus
,a.ErrorMsg,a.IP,a.ScreenVersion,TaskStatus,a.BeginTime,a.EndTime
FROM a
where
rowNumber between @pageSize * (@pageIndex-1) +1 and @pageIndex * @pageSize";
......@@ -582,5 +582,28 @@ namespace FTM.Repository
return lst;
}
}
public Dictionary<string, List<string>> GetAllPos()
{
Dictionary<string, List<string>> dic = new Dictionary<string, List<string>>();
using (var db = ClusterConfig.db_default_config_new.CreateDbManager())
{
string sql = "select storeid,posid from ftm_pos";
var dt = db.SetCommand(sql).ExecuteDataTable();
foreach (DataRow dr in dt.Rows)
{
string storid = Convert.ToString(dr["storeid"]);
string posid = Convert.ToString(dr["posid"]);
if (!dic.ContainsKey(storid))
{
dic.Add(storid, new List<string> { });
}
dic[storid].Add(posid);
}
}
return dic;
}
}
}
\ No newline at end of file
using FTM.IRepository;
using FTM.Model;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace FTM.Repository
{
public class RedPosRepository : IRedPosRepository
{
public void AddRePos(RedPosItem item)
{
using (var db = ClusterConfig.db_default_config_new.CreateDbManager())
{
string sql = @"
IF EXISTS(SELECT 1 FROM RedPos WHERE StoreID=@StoreID and PosID=@PosID)
BEGIN
DELETE FROM RedPosQuestion WHERE StoreID = @StoreID and PosID = @PosID
DELETE FROM RedPos WHERE StoreID = @StoreID and PosID = @PosID
END
INSERT INTO RedPos(StoreID,PosID,StoreName,BusinessDate,LoginStaus,NetStatus,RunStatus,ScreenVersion,[Type])
VALUES(@StoreID,@PosID,@StoreName,@BusinessDate,@LoginStaus,@NetStatus,@RunStatus,@ScreenVersion,@Type);";
db.SetCommand(sql,
db.Parameter("@StoreID", item.StoreID, DbType.String),
db.Parameter("@PosID", item.PosID, DbType.String),
db.Parameter("@StoreName", item.StoreName, DbType.String),
db.Parameter("@BusinessDate", item.BusinessDate, DbType.String),
db.Parameter("@LoginStaus", item.LoginStaus, DbType.String),
db.Parameter("@NetStatus", item.NetStatus, DbType.String),
db.Parameter("@RunStatus", item.RunStatus, DbType.String),
db.Parameter("@ScreenVersion", item.ScreenVersion, DbType.String),
db.Parameter("@Type", item.Type, DbType.String)
).ExecuteNonQuery();
foreach (RedPosQuestionItem question in item.Questions)
{
sql = @"INSERT INTO RedPosQuestion(StoreID,PosID,Face,Question,Solution)VALUES(@StoreID, @PosID, @Face, @Question, @Solution)";
db.SetCommand(sql,
db.Parameter("@StoreID", item.StoreID, DbType.String),
db.Parameter("@PosID", item.PosID, DbType.String),
db.Parameter("@Face", question.Face, DbType.String),
db.Parameter("@Question", question.Question, DbType.String),
db.Parameter("@Solution", question.Solution, DbType.String)
).ExecuteNonQuery();
}
}
}
public List<RedPosItem> GetRedPostList()
{
List<RedPosItem> lst = new List<RedPosItem>();
using (var db = ClusterConfig.db_default_config_new.CreateDbManager())
{
string sql_post = "select * from RedPos";
string sql_question = "select * from RedPosQuestion";
lst = db.SetCommand(sql_post).ExecuteList<RedPosItem>();
var question_lst = db.SetCommand(sql_question).ExecuteList<RedPosQuestionItem>();
foreach (RedPosItem red_pos in lst)
{
red_pos.Questions = question_lst.Where(p => p.StoreID == red_pos.StoreID && p.PosID == red_pos.PosID).ToList();
}
}
return lst;
}
}
}
......@@ -136,11 +136,12 @@ namespace FTM.Repository
response.StoreName = Convert.ToString(reader["Name"]);
}
reader.Close();
sql = "SELECT PosID,state,EditDate,Type,ScreenVersion FROM FTM_Pos WITH(NOLOCK) WHERE StoreID=@StoreID order by PosID";
sql = "SELECT PosID,state,EditDate,Type,ScreenVersion FROM FTM_Pos WITH(NOLOCK) WHERE StoreID=@StoreID ";
if (!string.IsNullOrEmpty(PosID))
{
sql += " AND PosID=@PosID";
}
sql += " order by PosID ";
reader = db.SetCommand(sql
, db.Parameter("@StoreID", StoreID, DbType.String)
, db.Parameter("@PosID", PosID, DbType.String)).ExecuteReader();
......
......@@ -11,7 +11,7 @@ namespace FTM.RunAzcopy
{
static void Main(string[] args)
{
HttpHelper helper = new HttpHelper();
string qq= TripleDes.Encrypt("GM38S00mer@*");
}
}
......
......@@ -84,7 +84,8 @@ namespace FTM.Service
//TODO StatusCode变化
return new ComplexResponse
{
StatusCode = result ? StateCode.Ok : StateCode.ParamError
StatusCode = result ? StateCode.Ok : StateCode.ParamError,
next_check = Config.NextCheck
};
}
......@@ -169,14 +170,22 @@ namespace FTM.Service
model.SOKPicVer = request.sok_pic_ver ?? model.SOKPicVer;
model.SOKPicSize = request.sok_pic_size ?? model.SOKPicSize;
model.SokLastDate = request.soklastdate ?? model.SokLastDate;
if (model.SokLastDate < DateTime.Parse("1/1/1753"))
{
model.SokLastDate = DateTime.Parse("01/01/1970");
}
if (model.SokLastDate > DateTime.Parse("12/31/9999"))
{
model.SokLastDate = DateTime.Now;
}
//if (model.SokLastDate.HasValue)
//{
// if (model.SokLastDate < DateTime.Parse("1/1/1753"))
// {
// model.SokLastDate = DateTime.Parse("01/01/1970");
// }
// if (model.SokLastDate > DateTime.Parse("12/31/9999"))
// {
// model.SokLastDate = DateTime.Now;
// }
//}
//else
//{
// model.SokLastDate = DateTime.Parse("01/01/1970");
//}
model.SelfSoft = request.fork_ver ?? model.ForkVersion;
......@@ -289,6 +298,7 @@ namespace FTM.Service
{
response.ErrorMessage = "not find taskpos";
}
response.next_check = Config.NextCheck;
return response;
}
......
......@@ -58,6 +58,7 @@
<Compile Include="GenerateCodeService.cs" />
<Compile Include="PosService.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="RedPosService.cs" />
<Compile Include="RoleService.cs" />
<Compile Include="StaffService.cs" />
<Compile Include="StatisticsService.cs" />
......
......@@ -136,5 +136,10 @@ namespace FTM.Service
{
return PosRepository.QueryTaskPosExcel(TaskID);
}
public Dictionary<string, List<string>> GetAllPos()
{
return PosRepository.GetAllPos();
}
}
}
\ No newline at end of file
using FTM.IRepository;
using FTM.IService;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using FTM.Model;
using FTM.Http.Response;
namespace FTM.Service
{
public class RedPosService : IRedPosService
{
public IRedPosRepository RedPosRepository { get; set; }
public IStoreService StoreService { get; set; }
public void AddRedPos(String StoreID, String PosID)
{
GoMaxH5Response response = StoreService.GetGoaxH5RedInfo(StoreID, PosID);
if (response == null || response.FaultPosList == null || response.FaultPosList.Count == 0)
{
return;
}
RedPosItem item = new RedPosItem();
item.StoreID = StoreID;
item.PosID = PosID;
item.BusinessDate = response.FaultPosList[0].BusinessDate;
item.LoginStaus = response.FaultPosList[0].LoginStaus;
item.NetStatus = response.FaultPosList[0].NetStatus;
item.RunStatus = response.FaultPosList[0].RunStatus;
item.ScreenVersion = response.FaultPosList[0].ScreenVersion;
item.StoreName = response.StoreName;
item.Type = response.FaultPosList[0].Type;
item.Questions = new List<RedPosQuestionItem>();
foreach (QuestionItem question in response.FaultPosList[0].Questions)
{
item.Questions.Add(new RedPosQuestionItem { Face = question.Face, Question = question.Question, Solution = question.Solution });
}
RedPosRepository.AddRePos(item);
}
public List<RedPosItem> GetRedPostList()
{
return RedPosRepository.GetRedPostList();
}
}
}
......@@ -16,6 +16,106 @@ namespace FTM.Service
public IStoreRepository StoreRepository { get; set; }
public ITaskProgressRepository TaskProgressRepository { get; set; }
public GoMaxH5Response GetGoaxH5RedInfo(string StoreID, string PosID)
{
GoMaxH5Response response = StoreRepository.GetGoaxH5Info(StoreID, PosID);
for (int i = 0; i < response.FaultPosList.Count; i++)
{
FaultPos pos = response.FaultPosList[i];
List<QuestionItem> question = new List<QuestionItem>();
pos.Questions = new List<QuestionItem>();
if (pos.Type.ToUpper() == "SC")
{
if (SCRed(StoreID, pos.PostID, pos.NetStatus, out question))
{
pos.LightSort = -100;
pos.RunStatus = "red";
pos.Questions = question;
}
else
{
response.FaultPosList.RemoveAt(i);
i--;
}
}
else if (pos.Type.ToUpper() == "SOK")
{
if (SOKRed(StoreID, pos.PostID, pos.NetStatus, out question))
{
pos.LightSort = -100;
pos.RunStatus = "red";
pos.Questions = question;
}
else
{
response.FaultPosList.RemoveAt(i);
i--;
}
}
else if (pos.Type.ToUpper() == "KVS")
{
if (KVSRed(StoreID, pos.PostID, pos.NetStatus, out question))
{
pos.LightSort = -100;
pos.RunStatus = "red";
pos.Questions = question;
}
else
{
response.FaultPosList.RemoveAt(i);
i--;
}
}
else if (pos.PostID.ToUpper() == "POS01")
{
if (POS01Red(StoreID, pos.PostID, pos.NetStatus, out question))
{
pos.LightSort = -100;
pos.RunStatus = "red";
pos.Questions = question;
}
else
{
response.FaultPosList.RemoveAt(i);
i--;
}
}
else if (pos.PostID.ToUpper() == "BACKROOM" || pos.PostID.ToUpper() == "CREW" || pos.PostID.ToUpper() == "MDS" || pos.Type.ToUpper() == "DMB")
{
if (SpecialRed(StoreID, pos.PostID, pos.NetStatus, out question))
{
pos.LightSort = -100;
pos.RunStatus = "red";
pos.Questions = question;
}
else
{
response.FaultPosList.RemoveAt(i);
i--;
}
}
else
{
if (OtherRed(StoreID, pos.PostID, pos.NetStatus, out question))
{
pos.LightSort = -100;
pos.RunStatus = "red";
pos.Questions = question;
}
else
{
response.FaultPosList.RemoveAt(i);
i--;
}
}
pos.Sort = GetSort(pos.PostID);
SetPosName(pos);
}
response.FaultPosList = response.FaultPosList.OrderBy(p => p.LightSort).ThenBy(p => p.Sort).ToList();
return response;
}
public GoMaxH5Response GetGoaxH5Info(string StoreID, string PosID)
{
GoMaxH5Response response = StoreRepository.GetGoaxH5Info(StoreID, PosID);
......
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
</startup>
<appSettings>
<add key="encryptPassword" value="20V7Ovq+CZO9fV/oMMkG41G1k7HscNlV" />
<add key="db_default" value="server=115.159.142.32,9528;initial catalog=FTMNew;uid=zhuihutest;pwd=#pwd#;application name=ftmapi;Max Pool Size=512" />
<!--<add key="db_default" value="server=10.126.226.37,9528;initial catalog=FTM_new;uid=ftmuser;pwd=#pwd#;application name=ftmapi;Max Pool Size=1024" />-->
<add key="gomax_log" value="server=10.126.226.37,9528;initial catalog=GoMaxLog;uid=ftmuser;pwd=#pwd#;application name=ftmapi;Max Pool Size=1024" />
<!--<add key="db_default_new" value="server=115.159.142.32,9528;initial catalog=FTMNew;uid=zhuihutest;pwd=#pwd#;application name=ftmapi;Max Pool Size=512" />-->
<!--<add key="encryptPassword" value="TUHeyBz9VS9GqCqIY6eebw==" />-->
<!--<add key="db_default_new" value="server=10.126.226.37;initial catalog=FTM_new;uid=ftmuser;pwd=#pwd#;application name=ftmapi;Max Pool Size=1024" />-->
<add key="AppSecret" value="7A4F72642861C11F680B3EF9E4B3111C" />
<add key="alert_email_to" value="yunfeng.chen@freemud.cn" />
<add key="alert_email_subject" value="Mcd GC Service Error" />
<add key="next_check" value="10" />
<add key="status_code_success" value="100" />
<add key="status_code_param_error" value="21" />
<add key="status_code_error" value="0" />
<add key="weblog_enable" value="true" />
<add key="excel_exportPath" value="http://localhost:58947/Attach/PosExcel/" />
<add key="InsertFile_Normal" value="bat\normal.bat" />
<add key="InsertFile_CODUpdate" value="bat\ngcod_update.bat" />
<!--<add key="InsertFile_CODUpdate" value="bat\patch_update.bat" />-->
<!--<add key="InsertFile_POS_VXLUpdate" value="bat\pos_vxl_update.bat" />-->
<add key="InsertFile_POS_VXLUpdate" value="bat\pos_vxl_update.bat" />
<add key="InsertFile_ScreenUpdate" value="bat\screen_update.bat" />
<add key="InsertFile_SOK0Update" value="bat\sok_update0.bat" />
<add key="InsertFile_SOK1Update" value="bat\sok_update1.bat" />
<add key="InsertFile_SOK2Update" value="bat\sok_update2.bat" />
<add key="InsertFile_ForkUpdate" value="bat\fork_update.bat" />
<add key="InsertFile_ScreenSync" value="bat\jw_syn.bat" />
<add key="InsertFile_POSDBUpdate" value="bat\posdb_update.bat" />
<add key="InsertFile_STLDUpload" value="bat\stld_task.bat" />
<add key="try_times" value="1" />
<add key="Origins" value="http://115.159.142.32:19999,http://10.126.226.37:8000,http://10.126.226.37" />
<add key="scDownloadPathFormatter" value="http://{0}:33333/{1}" />
<add key="restart_delay" value="100" />
<add key="loginAuth" value="true" />
<add key="CookieDomain" value="localhost" />
<add key="cookieExpire" value="1440" />
<add key="smallfile" value="Uploadfiles/2016-09/20160904182322.test.zip" />
<add key="EnableScDownload" value="false" />
<add key="PortalDomain" value="http://localhost:58947/" />
<add key="CodFilePath" value="E:\project\GoMaxBack\GoMax\FTM.API\Uploadfiles\cod-1020.zip" />
<add key="IndependentTaskType" value="1,2" />
<add key="RTMForPos_PREFIX" value="TW" />
</appSettings>
</configuration>
\ No newline at end of file
using System;
using System.Collections.Generic;
using System.Linq;
using System.ServiceProcess;
using System.Text;
using System.Threading.Tasks;
namespace RedPosService
{
static class Program
{
/// <summary>
/// 应用程序的主入口点。
/// </summary>
static void Main()
{
RedPosProcessor.test();
// ServiceBase[] ServicesToRun;
//ServicesToRun = new ServiceBase[]
//{
// new Service1()
//};
//ServiceBase.Run(ServicesToRun);
}
}
}
namespace RedPosService
{
partial class ProjectInstaller
{
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
/// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region 组件设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 - 不要修改
/// 使用代码编辑器修改此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.serviceProcessInstaller1 = new System.ServiceProcess.ServiceProcessInstaller();
this.serviceInstaller1 = new System.ServiceProcess.ServiceInstaller();
//
// serviceProcessInstaller1
//
this.serviceProcessInstaller1.Password = null;
this.serviceProcessInstaller1.Username = null;
//
// serviceInstaller1
//
this.serviceInstaller1.DisplayName = "RedPosService";
this.serviceInstaller1.ServiceName = "RedPosService";
//
// ProjectInstaller
//
this.Installers.AddRange(new System.Configuration.Install.Installer[] {
this.serviceProcessInstaller1,
this.serviceInstaller1});
}
#endregion
private System.ServiceProcess.ServiceProcessInstaller serviceProcessInstaller1;
private System.ServiceProcess.ServiceInstaller serviceInstaller1;
}
}
\ No newline at end of file
using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Configuration.Install;
using System.Linq;
using System.Threading.Tasks;
namespace RedPosService
{
[RunInstaller(true)]
public partial class ProjectInstaller : System.Configuration.Install.Installer
{
public ProjectInstaller()
{
InitializeComponent();
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="serviceProcessInstaller1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="serviceInstaller1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>279, 17</value>
</metadata>
<metadata name="$this.TrayLargeIcon" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
</root>
\ No newline at end of file
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// 有关程序集的一般信息由以下
// 控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("RedPosService")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("HP Inc.")]
[assembly: AssemblyProduct("RedPosService")]
[assembly: AssemblyCopyright("Copyright © HP Inc. 2018")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
//将 ComVisible 设置为 false 将使此程序集中的类型
//对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型,
//请将此类型的 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
[assembly: Guid("9854f955-3005-4260-b2d6-d9f9354ba8d2")]
// 程序集的版本信息由下列四个值组成:
//
// 主版本
// 次版本
// 生成号
// 修订号
//
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值,
// 方法是按如下所示使用“*”: :
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
using Autofac;
using FTM.IService;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
namespace RedPosService
{
public class RedPosProcessor
{
public static void test()
{
var builder = new ContainerBuilder();
var iServices = Assembly.Load("FTM.IService");
var services = Assembly.Load("FTM.Service");
var iRepository = Assembly.Load("FTM.IRepository");
var repository = Assembly.Load("FTM.Repository");
builder.RegisterAssemblyTypes(iServices, services).AsImplementedInterfaces().PropertiesAutowired();
builder.RegisterAssemblyTypes(iRepository, repository).AsImplementedInterfaces().PropertiesAutowired();
using (var container = builder.Build())
{
IRedPosService service = container.Resolve<IRedPosService>();
IPostService pos = container.Resolve<IPostService>();
Dictionary<string, List<string>> poses = pos.GetAllPos();
foreach (KeyValuePair<string, List<string>> sotre_pos in poses)
{
foreach (string posid in sotre_pos.Value)
{
service.AddRedPos(sotre_pos.Key, posid);
}
}
}
}
}
}
\ No newline at end of file
namespace RedPosService
{
partial class RedPosService
{
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
/// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region 组件设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 - 不要修改
/// 使用代码编辑器修改此方法的内容。
/// </summary>
private void InitializeComponent()
{
components = new System.ComponentModel.Container();
this.ServiceName = "Service1";
}
#endregion
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Linq;
using System.ServiceProcess;
using System.Text;
using System.Threading.Tasks;
namespace RedPosService
{
public partial class RedPosService : ServiceBase
{
public RedPosService()
{
InitializeComponent();
}
protected override void OnStart(string[] args)
{
}
protected override void OnStop()
{
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" 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>{9854F955-3005-4260-B2D6-D9F9354BA8D2}</ProjectGuid>
<OutputType>WinExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>RedPosService</RootNamespace>
<AssemblyName>RedPosService</AssemblyName>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<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' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Autofac, Version=4.6.0.0, Culture=neutral, PublicKeyToken=17863af14b0044da, processorArchitecture=MSIL">
<HintPath>..\packages\Autofac.4.6.0\lib\net45\Autofac.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Configuration.Install" />
<Reference Include="System.Core" />
<Reference Include="System.Management" />
<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.ServiceProcess" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="ProjectInstaller.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="ProjectInstaller.Designer.cs">
<DependentUpon>ProjectInstaller.cs</DependentUpon>
</Compile>
<Compile Include="RedPosProcessor.cs" />
<Compile Include="RedPosService.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="RedPosService.Designer.cs">
<DependentUpon>RedPosService.cs</DependentUpon>
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\FTM.Common\FTM.Common.csproj">
<Project>{772c0fd4-c6b9-4411-b98e-fcaf40fecf3b}</Project>
<Name>FTM.Common</Name>
</ProjectReference>
<ProjectReference Include="..\FTM.IRepository\FTM.IRepository.csproj">
<Project>{83597cca-5f05-4a4f-be5a-ff08317f05ba}</Project>
<Name>FTM.IRepository</Name>
</ProjectReference>
<ProjectReference Include="..\FTM.IService\FTM.IService.csproj">
<Project>{77217cf6-b890-4da8-88ae-10cef564c053}</Project>
<Name>FTM.IService</Name>
</ProjectReference>
<ProjectReference Include="..\FTM.Model\FTM.Model.csproj">
<Project>{34936c3e-531d-4c15-90a3-6553b6fc54ee}</Project>
<Name>FTM.Model</Name>
</ProjectReference>
<ProjectReference Include="..\FTM.Repository\FTM.Repository.csproj">
<Project>{62bb95f5-9422-471b-8585-c2a61e74c9f6}</Project>
<Name>FTM.Repository</Name>
</ProjectReference>
<ProjectReference Include="..\FTM.Service\FTM.Service.csproj">
<Project>{4b868758-14dd-4d65-a38b-82a8f17eaad5}</Project>
<Name>FTM.Service</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="ProjectInstaller.resx">
<DependentUpon>ProjectInstaller.cs</DependentUpon>
</EmbeddedResource>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- 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>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Autofac" version="4.6.0" targetFramework="net452" />
</packages>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment