Commit bbdfde78 by zxw

通道加全局异常

充电台仓库切换
parent 8f20143f
......@@ -7,6 +7,7 @@ using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading;
using System.Windows.Forms;
......@@ -20,6 +21,14 @@ namespace JmpServiceMgr
[STAThread]
static void Main()
{
//设置应用程序处理异常方式:ThreadException处理
Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException);
//处理UI线程异常
Application.ThreadException += new System.Threading.ThreadExceptionEventHandler(Application_ThreadException);
//处理非UI线程异常
AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);
//Thread.Sleep(10000);
MessageBoxEx.EnableGlass = false;
Application.EnableVisualStyles();
......@@ -66,5 +75,43 @@ namespace JmpServiceMgr
Application.Run(new FrmMgr());
}
}
static void Application_ThreadException(object sender, System.Threading.ThreadExceptionEventArgs e)
{
string str = GetExceptionMsg(e.Exception, e.ToString());
//MessageBox.Show(str, "系统错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
Log.ErrorLog(str);
}
static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
{
string str = GetExceptionMsg(e.ExceptionObject as Exception, e.ToString());
//MessageBox.Show(str, "系统错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
Log.ErrorLog(str);
}
/// <summary>
/// 生成自定义异常消息
/// </summary>
/// <param name="ex">异常对象</param>
/// <param name="backStr">备用异常消息:当ex为null时有效</param>
/// <returns>异常字符串文本</returns>
static string GetExceptionMsg(Exception ex, string backStr)
{
StringBuilder sb = new StringBuilder();
sb.AppendLine("****************************异常文本****************************");
sb.AppendLine("【出现时间】:" + DateTime.Now.ToString());
if (ex != null)
{
sb.AppendLine("【异常类型】:" + ex.GetType().Name);
sb.AppendLine("【异常信息】:" + ex.Message);
sb.AppendLine("【堆栈调用】:" + ex.StackTrace);
}
else
{
sb.AppendLine("【未处理异常】:" + backStr);
}
sb.AppendLine("***************************************************************");
return sb.ToString();
}
}
}
......@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.2.16.09270")]
[assembly: AssemblyFileVersion("1.2.16.09270")]
[assembly: AssemblyVersion("1.2.17.10190")]
[assembly: AssemblyFileVersion("1.2.17.10190")]
......@@ -96,7 +96,7 @@ namespace LiteChannel.Commons
{
appCode = appCode
});
var json = HttpPost(LiteCaChe.SysConfig.DomainUrl + LiteCaChe.SysConfig.SoftUpdate, parame);
var json = HttpPost(LiteCaChe.SysConfig.DomainUrl + Config.SoftUpdate, parame);
if (string.IsNullOrEmpty(json))
{
Log.WorkLog("获取更新信息失败", "更新失败");
......@@ -151,7 +151,7 @@ namespace LiteChannel.Commons
version = LiteCaChe.SysConfig.ApiVersion,
orgId = LiteCaChe.OrgId,
});
var json = HttpPost(LiteCaChe.SysConfig.DomainUrl + LiteCaChe.SysConfig.GetEquInfo, param);
var json = HttpPost(LiteCaChe.SysConfig.DomainUrl + Config.GetEquInfo, param);
if (string.IsNullOrEmpty(json))
{
Log.WorkLog("获取获取装备基础信息失败", "获取失败");
......@@ -184,11 +184,14 @@ namespace LiteChannel.Commons
/// 获取仓库信息
/// </summary>
/// <returns></returns>
public static List<store_info> GetStoreInfos()
public static List<store_info> GetStoreInfos(string orgId)
{
try
{
var body_par = string.Empty;
var body_par = JsonConvert.SerializeObject(new
{
orgizationId = orgId
});
var body_result = GetBody(body_par);
if (body_result == null)
{
......@@ -206,7 +209,7 @@ namespace LiteChannel.Commons
version = LiteCaChe.SysConfig.ApiVersion,
orgId = LiteCaChe.OrgId,
});
var json = HttpPost(LiteCaChe.SysConfig.DomainUrl + LiteCaChe.SysConfig.GetStoreInfo, param);
var json = HttpPost(LiteCaChe.SysConfig.DomainUrl + Config.GetStoreInfo, param);
if (string.IsNullOrEmpty(json))
{
Log.WorkLog("获取获取仓库基础信息失败", "获取失败");
......@@ -267,7 +270,7 @@ namespace LiteChannel.Commons
version = LiteCaChe.SysConfig.ApiVersion,
orgId = LiteCaChe.OrgId,
});
var json = HttpPost(LiteCaChe.SysConfig.DomainUrl + LiteCaChe.SysConfig.GetOrderInfo, param);
var json = HttpPost(LiteCaChe.SysConfig.DomainUrl + Config.GetOrderInfo, param);
if (string.IsNullOrEmpty(json))
{
Log.WorkLog("获取获取单据信息失败", "获取失败");
......@@ -329,7 +332,7 @@ namespace LiteChannel.Commons
version = LiteCaChe.SysConfig.ApiVersion,
orgId = LiteCaChe.OrgId,
});
var json = HttpPost(LiteCaChe.SysConfig.DomainUrl + LiteCaChe.SysConfig.GetOrderDetail, param);
var json = HttpPost(LiteCaChe.SysConfig.DomainUrl + Config.GetOrderDetail, param);
if (string.IsNullOrEmpty(json))
{
Log.WorkLog("获取获取单据明细信息失败", "获取失败");
......@@ -432,7 +435,7 @@ namespace LiteChannel.Commons
version = LiteCaChe.SysConfig.ApiVersion,
orgId = LiteCaChe.OrgId,
});
var json = HttpPost(LiteCaChe.SysConfig.DomainUrl + LiteCaChe.SysConfig.GetPolices, param);
var json = HttpPost(LiteCaChe.SysConfig.DomainUrl + Config.GetPolices, param);
if (string.IsNullOrEmpty(json))
{
return default;
......@@ -518,7 +521,7 @@ namespace LiteChannel.Commons
else
{
var _url = LiteCaChe.SysConfig.DomainUrl + LiteCaChe.SysConfig.UploadFace;
var _url = LiteCaChe.SysConfig.DomainUrl + Config.UploadFace;
using (HttpClient client = new HttpClient())
{
var postContent = new MultipartFormDataContent();
......@@ -596,7 +599,7 @@ namespace LiteChannel.Commons
version = LiteCaChe.SysConfig.ApiVersion,
orgId = LiteCaChe.OrgId,
});
var json = HttpPost(LiteCaChe.SysConfig.DomainUrl + LiteCaChe.SysConfig.UpdateFinger, param);
var json = HttpPost(LiteCaChe.SysConfig.DomainUrl + Config.UpdateFinger, param);
if (string.IsNullOrEmpty(json))
{
return false;
......@@ -666,7 +669,7 @@ namespace LiteChannel.Commons
version = LiteCaChe.SysConfig.ApiVersion,
orgId = LiteCaChe.OrgId,
});
var json = HttpPost(LiteCaChe.SysConfig.DomainUrl + LiteCaChe.SysConfig.UploadUrl, param);
var json = HttpPost(LiteCaChe.SysConfig.DomainUrl + Config.UploadUrl, param);
if (string.IsNullOrEmpty(json))
{
Log.WorkLog("装备入库失败", "入库失败");
......@@ -782,7 +785,7 @@ namespace LiteChannel.Commons
version = LiteCaChe.SysConfig.ApiVersion,
orgId = LiteCaChe.OrgId,
});
var json = HttpPost(LiteCaChe.SysConfig.DomainUrl + LiteCaChe.SysConfig.UploadUrl, param);
var json = HttpPost(LiteCaChe.SysConfig.DomainUrl + Config.UploadUrl, param);
//Log.DebugLog("jsonres" + json);
......@@ -877,7 +880,7 @@ namespace LiteChannel.Commons
version = LiteCaChe.SysConfig.ApiVersion,
orgId = LiteCaChe.OrgId,
});
var json = HttpPost(LiteCaChe.SysConfig.DomainUrl + LiteCaChe.SysConfig.GetEpcListByBoxMarkEpc, param);
var json = HttpPost(LiteCaChe.SysConfig.DomainUrl + Config.GetEpcListByBoxMarkEpc, param);
if (string.IsNullOrEmpty(json))
{
return default;
......@@ -939,7 +942,7 @@ namespace LiteChannel.Commons
version = LiteCaChe.SysConfig.ApiVersion,
orgId = LiteCaChe.OrgId,
});
var json = HttpPost(LiteCaChe.SysConfig.DomainUrl + LiteCaChe.SysConfig.GetWarehouseById, param);
var json = HttpPost(LiteCaChe.SysConfig.DomainUrl + Config.GetWarehouseById, param);
if (string.IsNullOrEmpty(json))
{
return default;
......@@ -1004,7 +1007,7 @@ namespace LiteChannel.Commons
version = LiteCaChe.SysConfig.ApiVersion,
orgId = LiteCaChe.OrgId,
});
var json = HttpPost(LiteCaChe.SysConfig.DomainUrl + LiteCaChe.SysConfig.SetWarehouseState, param);
var json = HttpPost(LiteCaChe.SysConfig.DomainUrl + Config.SetWarehouseState, param);
if (string.IsNullOrEmpty(json))
{
return default;
......@@ -1068,7 +1071,7 @@ namespace LiteChannel.Commons
version = LiteCaChe.SysConfig.ApiVersion,
orgId = LiteCaChe.OrgId,
});
var json = HttpPost(LiteCaChe.SysConfig.DomainUrl + LiteCaChe.SysConfig.GetInvListByEpc, param);
var json = HttpPost(LiteCaChe.SysConfig.DomainUrl + Config.GetInvListByEpc, param);
if (string.IsNullOrEmpty(json))
{
Log.WorkLog("根据EPC集合获取物资信息失败", "入库失败");
......@@ -1132,7 +1135,7 @@ namespace LiteChannel.Commons
version = LiteCaChe.SysConfig.ApiVersion,
orgId = LiteCaChe.OrgId,
});
var json = HttpPost(LiteCaChe.SysConfig.DomainUrl + LiteCaChe.SysConfig.OpenOrderWorkUrl, param);
var json = HttpPost(LiteCaChe.SysConfig.DomainUrl + Config.OpenOrderWorkUrl, param);
if (string.IsNullOrEmpty(json))
{
Log.WorkLog("开启单据失败,请重试", "开启单据失败");
......@@ -1195,7 +1198,7 @@ namespace LiteChannel.Commons
version = LiteCaChe.SysConfig.ApiVersion,
orgId = LiteCaChe.OrgId,
});
var json = HttpPost(LiteCaChe.SysConfig.DomainUrl + LiteCaChe.SysConfig.CloseOrderUrl, param);
var json = HttpPost(LiteCaChe.SysConfig.DomainUrl + Config.CloseOrderUrl, param);
if (string.IsNullOrEmpty(json))
{
Log.WorkLog("关闭单据失败,请重试", "关闭单据失败");
......
......@@ -79,183 +79,24 @@ namespace LiteChannel
}
}
//public class Config : ViewModelBase
//{
// private string _domainUrl = string.Empty;
// private string _userLogin = string.Empty;
// private string _appTitle = string.Empty;
// private string _appCode = string.Empty;
// private string _softUpdate = string.Empty;
// private int _appVersion = 100;
// /// <summary>
// /// 接口域名
// /// </summary>
// public string DomainUrl
// {
// get
// {
// return _domainUrl;
// }
// set
// {
// _domainUrl = value;
// RaisePropertyChanged();
// }
// }
// /// <summary>
// /// 登录
// /// </summary>
// public string UserLogin
// {
// get
// {
// return _userLogin;
// }
// set
// {
// _userLogin = value;
// RaisePropertyChanged();
// }
// }
// public string AppTitle
// {
// get
// {
// return _appTitle;
// }
// set
// {
// _appTitle = value;
// RaisePropertyChanged();
// }
// }
// public int AppVersion
// {
// get
// {
// return _appVersion;
// }
// set
// {
// _appVersion = value;
// RaisePropertyChanged();
// }
// }
// public string AppCode
// {
// get
// {
// return _appCode;
// }
// set
// {
// _appCode = value;
// RaisePropertyChanged();
// }
// }
// public string SoftUpdate
// {
// get
// {
// return _softUpdate;
// }
// set
// {
// _softUpdate = value;
// RaisePropertyChanged();
// }
// }
// private string _equInfo = string.Empty;
// public string GetEquInfo
// {
// get { return _equInfo; }
// set { _equInfo = value; }
// }
// private string _storeInfo = string.Empty;
// public string GetStoreInfo
// {
// get { return _storeInfo; }
// set { _storeInfo = value; }
// }
// private string _orderInfo = string.Empty;
// public string GetOrderInfo
// {
// get { return _orderInfo; }
// set { _orderInfo = value; }
// }
// private string _orderDetail = string.Empty;
// public string GetOrderDetail
// {
// get { return _orderDetail; }
// set { _orderDetail = value; }
// }
// private string _comMouth = string.Empty;
// public string ComMouth
// {
// get { return _comMouth; }
// set { _comMouth = value; }
// }
// private string _warehouseID = string.Empty;
// public string WarehouseID
// {
// get { return _warehouseID; }
// set { _warehouseID = value; }
// }
// private string _uploadUrl = string.Empty;
// public string UploadUrl
// {
// get { return _uploadUrl; }
// set { _uploadUrl = value; }
// }
// private string _openOrderWorkUrl = string.Empty;
// public string OpenOrderWorkUrl
// {
// get { return _openOrderWorkUrl; }
// set { _openOrderWorkUrl = value; }
// }
// public string ApiVersion { get; set; }
// public string AppKey { get; set; }
// public string SecretKey { get; set; }
// public string GetPolices { get; set; }
// private string faceAddress = string.Empty;
// public string FaceAddress
// {
// get { return faceAddress; }
// set { faceAddress = value; }
// }
// private string faceUser = string.Empty;
// public string FaceUser
// {
// get { return faceUser; }
// set { faceUser = value; }
// }
// private string facePwd = string.Empty;
// public string FacePwd
// {
// get { return facePwd; }
// set { facePwd = value; }
// }
// private string facePort = string.Empty;
// public string FacePort
// {
// get { return facePort; }
// set { facePort = value; }
// }
// public string UploadFace { get; set; }
// public string UpdateFinger { get; set; }
// public bool IsUseFace
// {
// get; set;
// }
// [JsonIgnore]
// public static new bool IsInDesignModeStatic { get; }
//}
public class Config : ViewModelBase
{
public const string SoftUpdate = "/api/SoftUpdate/GetLastUpdate";
public const string GetEquInfo = "/api/EquipmentDetail/GetListEquipmentDetail";
public const string GetStoreInfo = "/api/Warehouse/GetListOrgWarehouse";
public const string GetOrderInfo = "/api/Inventory/GetOrderInfo";
public const string GetOrderDetail = "/api/Inventory/GetOrderDetail";
public const string OpenOrderWorkUrl = "/api/Inventory/OpenThisOrderAndCloseOther";
public const string UploadUrl = "/api/Inventory/UploadRFIDNew";
public const string CloseOrderUrl = "/api/Inventory/CloseOrder";
public const string GetPolices = "/api/ChannelCfg/GetOrgStaff";
public const string UploadFace = "/api/ChannelCfg/UploadFace";
public const string UpdateFinger = "/api/ChannelCfg/UpdateFinger";
public const string GetInvListByEpc = "/api/Inventory/GetInvListByEpc";
public const string GetWarehouseById = "/api/Warehouse/GetWarehouseById";
public const string SetWarehouseState = "/api/Inventory/SetWarehouseState";
public const string GetEpcListByBoxMarkEpc = "/api/EquipmentBoxMark/GetEpcListByBoxMarkEpc";
public Config()
{
AppTitle = "充电台出入库v" + Application.ResourceAssembly.GetName().Version;
......@@ -264,35 +105,20 @@ namespace LiteChannel
DomainUrl = "http://41.190.20.132:18761/api/service";
UserLogin = "http://41.190.20.132:10004/auth/userLogin";
SoftUpdate = "/api/SoftUpdate/GetLastUpdate";
GetEquInfo = "/api/EquipmentDetail/GetListEquipmentDetail";
GetStoreInfo = "/api/Warehouse/GetListWarehouse";
GetOrderInfo = "/api/Inventory/GetOrderInfo";
GetOrderDetail = "/api/Inventory/GetOrderDetail";
ComMouth = "COM4";
WarehouseID = "d8192b23-0ec9-4b2e-a47d-f6780a66a880";
UploadUrl = "/api/Inventory/UploadRFIDNew";
OpenOrderWorkUrl = "/api/Inventory/OpenThisOrderAndCloseOther";
CloseOrderUrl = "/api/Inventory/CloseOrder";
ApiVersion = "1.0";
AppKey = "q6t0lEKOmMg5Tm+dg3XdZQ==";
SecretKey = "ba4d855b3b83eab441a51ea9bd9d9671";
GetPolices = "/api/ChannelCfg/GetOrgStaff";
FaceAddress = "192.168.8.35";
FaceUser = "admin";
FacePwd = "junmp123";
FacePort = "8000";
UploadFace = "/api/ChannelCfg/UploadFace";
UpdateFinger = "/api/ChannelCfg/UpdateFinger";
IsUseFace = true;
IsEnabledShelf = false;
ShelfAddress = "http://192.168.3.128:38080/api/BoundDocuments";
GetInvListByEpc = "/api/Inventory/GetInvListByEpc";
IsAutoUpdate = true;
AutoUpdateTime = 0;
GetWarehouseById = "/api/Warehouse/GetWarehouseById";
SetWarehouseState = "/api/Inventory/SetWarehouseState";
GetEpcListByBoxMarkEpc = "/api/EquipmentBoxMark/GetEpcListByBoxMarkEpc";
}
/// <summary>
/// 接口域名
......@@ -308,37 +134,20 @@ namespace LiteChannel
public string AppVersion { get; set; }
[JsonIgnore]
public string AppCode { get; set; }
public string SoftUpdate { get; set; }
public string GetEquInfo { get; set; }
public string GetStoreInfo { get; set; }
public string GetOrderInfo { get; set; }
public string GetOrderDetail { get; set; }
public string ComMouth { get; set; }
public string WarehouseID { get; set; }
public string UploadUrl { get; set; }
public string OpenOrderWorkUrl { get; set; }
public string CloseOrderUrl { get; set; }
public string ApiVersion { get; set; }
public string AppKey { get; set; }
public string SecretKey { get; set; }
public string GetPolices { get; set; }
public string FaceAddress { get; set; }
public string FaceUser { get; set; }
public string FacePwd { get; set; }
public string FacePort { get; set; }
public string UploadFace { get; set; }
public string UpdateFinger { get; set; }
public bool IsUseFace { get; set; }
public bool IsEnabledShelf { get; set; }
public string ShelfAddress { get; set; }
public string GetInvListByEpc { get; set; }
public string GetWarehouseById { get; set; }
public string SetWarehouseState { get; set; }
/// <summary>
/// 是否自动更新
/// </summary>
......@@ -350,8 +159,6 @@ namespace LiteChannel
[JsonIgnore]
public static new bool IsInDesignModeStatic { get; }
public string GetEpcListByBoxMarkEpc { get; set; }
}
public class respone_user
{
......
......@@ -14,6 +14,7 @@
<Grid x:Name="g_main">
<Grid.RowDefinitions>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="0.1*"/>
<RowDefinition Height="0.3*"/>
<RowDefinition Height="0.3*"/>
<RowDefinition Height="0.5*"/>
......@@ -24,9 +25,20 @@
<ColumnDefinition Width="0.5*"/>
<ColumnDefinition Width="0.5*"/>
</Grid.ColumnDefinitions>
<Button Grid.Row="1" Grid.Column="1" Margin="10,10,10,10" Click="OnInStore_Click" pu:ButtonHelper.Icon="&#xf085;" Content="入库" FontFamily="{StaticResource FontAwesome}" pu:ButtonHelper.CornerRadius="5" FontSize="30"></Button>
<Button Grid.Row="1" Grid.Column="2" Margin="10,10,10,10" Click="OnOutStore_Click" pu:ButtonHelper.Icon="&#xf085;" Content="出库" FontFamily="{StaticResource FontAwesome}" pu:ButtonHelper.CornerRadius="5" FontSize="30"></Button>
<Button Grid.Row="2" Grid.Column="1" Grid.ColumnSpan="2" Click="OnClose_Click" pu:ButtonHelper.Icon="&#xf2d3;" Margin="10,10,10,10" Content="退出系统" FontFamily="{StaticResource FontAwesome}" pu:ButtonHelper.CornerRadius="5" FontSize="24" Background="#C8FF0000" pu:ButtonHelper.HoverBrush="#FF0000" ></Button>
<ComboBox Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="2" x:Name="cbo_warehouse"
Width="auto" Height="50" Margin="10,0,10,0"
HorizontalAlignment="Stretch" VerticalAlignment="Center"
FontSize="20"
MaxDropDownHeight="400"
pu:ComboBoxHelper.ItemHeight="50"
pu:ComboBoxHelper.HoverBackground="#1EB5B5B5"
pu:ComboBoxHelper.SelectedBackground="#32B5B5B5"
pu:ComboBoxHelper.IsSearchTextBoxVisible="True"
pu:ComboBoxHelper.SearchTextChanged="cbo_warehouse_SearchTextChanged"
pu:ComboBoxHelper.SearchTextBoxWatermark="在此搜索仓库..." SelectionChanged="cbo_warehouse_SelectionChanged"></ComboBox>
<Button Grid.Row="2" Grid.Column="1" Margin="10,10,10,10" Click="OnInStore_Click" pu:ButtonHelper.Icon="&#xf085;" Content="入库" FontFamily="{StaticResource FontAwesome}" pu:ButtonHelper.CornerRadius="5" FontSize="30"></Button>
<Button Grid.Row="2" Grid.Column="2" Margin="10,10,10,10" Click="OnOutStore_Click" pu:ButtonHelper.Icon="&#xf085;" Content="出库" FontFamily="{StaticResource FontAwesome}" pu:ButtonHelper.CornerRadius="5" FontSize="30"></Button>
<Button Grid.Row="3" Grid.Column="1" Grid.ColumnSpan="2" Click="OnClose_Click" pu:ButtonHelper.Icon="&#xf2d3;" Margin="10,10,10,10" Content="退出系统" FontFamily="{StaticResource FontAwesome}" pu:ButtonHelper.CornerRadius="5" FontSize="24" Background="#C8FF0000" pu:ButtonHelper.HoverBrush="#FF0000" ></Button>
</Grid>
</pu:WindowX>
......@@ -32,6 +32,7 @@ namespace LiteChannel
/// </summary>
public partial class MainWindow : WindowX, IComponentConnector
{
private List<store_info> StoreList { get; set; }
public MainWindow()
{
InitializeComponent();
......@@ -113,10 +114,18 @@ namespace LiteChannel
});
}
}
private void MainWindowLoaded(object sender, RoutedEventArgs e)
{
StoreList = HttpHelper.GetStoreInfos(LiteCaChe.OrgId);
cbo_warehouse.ItemsSource = StoreList;
cbo_warehouse.DisplayMemberPath = "name";
cbo_warehouse.SelectedValuePath = "id";
cbo_warehouse.SelectedIndex = 0;
//开始同步人员
if (LiteCaChe.SysConfig.IsUseFace)
{
......@@ -138,6 +147,18 @@ namespace LiteChannel
}
private void cbo_warehouse_SearchTextChanged(object sender, Panuon.UI.Silver.Core.SearchTextChangedEventArgs e)
{
if (!IsLoaded)
return;
cbo_warehouse.ItemsSource = StoreList.Where(t => t.name.Contains(e.Text));
}
private void cbo_warehouse_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
LiteCaChe.SysConfig.WarehouseID = cbo_warehouse.SelectedValue?.ToString() ?? "";
}
private void OnOutStore_Click(object sender, RoutedEventArgs e)
{
var from = new OutWindow();
......
......@@ -36,16 +36,11 @@ namespace LiteChannel
//int.TryParse(txt_ver.Text, out int ver);
LiteCaChe.SysConfig.UserLogin = txt_login.Text;
LiteCaChe.SysConfig.AppCode = txt_code.Text;
LiteCaChe.SysConfig.GetOrderDetail = txt_detail.Text;
LiteCaChe.SysConfig.DomainUrl = txt_domain.Text;
LiteCaChe.SysConfig.GetEquInfo = txt_equ.Text;
LiteCaChe.SysConfig.GetOrderInfo = txt_order.Text;
LiteCaChe.SysConfig.GetStoreInfo = txt_store.Text;
//LiteCaChe.SysConfig.AppTitle = txt_title.Text;
LiteCaChe.SysConfig.SoftUpdate = txt_update.Text;
//LiteCaChe.SysConfig.AppVersion = ver;
LiteCaChe.SysConfig.ComMouth = cbo_com.Text;
LiteCaChe.SysConfig.WarehouseID = cbo_warehouse.SelectedValue?.ToString() ?? "";
//LiteCaChe.SysConfig.WarehouseID = cbo_warehouse.SelectedValue?.ToString() ?? "";
LiteCaChe.SysConfig.FaceAddress = txt_ip.Text;
LiteCaChe.SysConfig.FacePort = txt_port.Text;
......@@ -59,8 +54,6 @@ namespace LiteChannel
LiteCaChe.SysConfig.IsEnabledShelf = cbo_shelf.Text == "启用";
LiteCaChe.SysConfig.ShelfAddress = txt_shelf.Text;
LiteCaChe.SysConfig.GetInvListByEpc = txt_getInvListByEpc.Text;
LiteCaChe.SysConfig.IsAutoUpdate = cb_autoUpdate.IsChecked == true;
LiteCaChe.SysConfig.AutoUpdateTime = cbb_autoUpdate.SelectedIndex;
......@@ -74,32 +67,27 @@ namespace LiteChannel
this.Close();
}
private void OnRefresh_Click(object sender, RoutedEventArgs e)
{
StoreList = HttpHelper.GetStoreInfos();
cbo_warehouse.ItemsSource = StoreList;
}
//private void OnRefresh_Click(object sender, RoutedEventArgs e)
//{
// StoreList = HttpHelper.GetStoreInfos();
// cbo_warehouse.ItemsSource = StoreList;
//}
private void OnWindow_Loaded(object sender, RoutedEventArgs e)
{
cbo_com.ItemsSource = SerialPort.GetPortNames();
StoreList = HttpHelper.GetStoreInfos();
cbo_warehouse.ItemsSource = StoreList;
cbo_warehouse.DisplayMemberPath = "name";
cbo_warehouse.SelectedValuePath = "id";
//StoreList = HttpHelper.GetStoreInfos();
//cbo_warehouse.ItemsSource = StoreList;
//cbo_warehouse.DisplayMemberPath = "name";
//cbo_warehouse.SelectedValuePath = "id";
txt_login.Text = LiteCaChe.SysConfig.UserLogin;
txt_code.Text = LiteCaChe.SysConfig.AppCode;
txt_detail.Text = LiteCaChe.SysConfig.GetOrderDetail;
txt_domain.Text = LiteCaChe.SysConfig.DomainUrl;
txt_equ.Text = LiteCaChe.SysConfig.GetEquInfo;
txt_order.Text = LiteCaChe.SysConfig.GetOrderInfo;
txt_store.Text = LiteCaChe.SysConfig.GetStoreInfo;
txt_title.Text = LiteCaChe.SysConfig.AppTitle;
txt_update.Text = LiteCaChe.SysConfig.SoftUpdate;
txt_ver.Text = LiteCaChe.SysConfig.AppVersion.ToString();
cbo_com.Text = LiteCaChe.SysConfig.ComMouth;
cbo_warehouse.SelectedValue = LiteCaChe.SysConfig.WarehouseID;
//cbo_warehouse.SelectedValue = LiteCaChe.SysConfig.WarehouseID;
txt_ip.Text = LiteCaChe.SysConfig.FaceAddress;
txt_port.Text = LiteCaChe.SysConfig.FacePort;
......@@ -113,8 +101,6 @@ namespace LiteChannel
cbo_shelf.SelectedIndex = LiteCaChe.SysConfig.IsEnabledShelf ? 0 : 1;
txt_shelf.Text = LiteCaChe.SysConfig.ShelfAddress;
txt_getInvListByEpc.Text = LiteCaChe.SysConfig.GetInvListByEpc;
cb_autoUpdate.IsChecked = LiteCaChe.SysConfig.IsAutoUpdate;
if (cb_autoUpdate.IsChecked == true)
{
......@@ -129,15 +115,15 @@ namespace LiteChannel
IsLoaded = true;
}
private void cbo_warehouse_SearchTextChanged(object sender, Panuon.UI.Silver.Core.SearchTextChangedEventArgs e)
{
if (!IsLoaded)
return;
//private void cbo_warehouse_SearchTextChanged(object sender, Panuon.UI.Silver.Core.SearchTextChangedEventArgs e)
//{
// if (!IsLoaded)
// return;
cbo_warehouse.ItemsSource = StoreList.Where(t => t.name.Contains(e.Text));
// cbo_warehouse.ItemsSource = StoreList.Where(t => t.name.Contains(e.Text));
}
//}
private void OnSldCornerRadius_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)
{
......
......@@ -96,7 +96,7 @@ namespace LiteChannelWinXP.Commons
{
appCode = appCode
});
var json = HttpPost(LiteCaChe.SysConfig.DomainUrl + LiteCaChe.SysConfig.SoftUpdate, parame);
var json = HttpPost(LiteCaChe.SysConfig.DomainUrl + Config.SoftUpdate, parame);
if (string.IsNullOrEmpty(json))
{
Log.WorkLog("获取更新信息失败", "更新失败");
......@@ -151,7 +151,7 @@ namespace LiteChannelWinXP.Commons
version = LiteCaChe.SysConfig.ApiVersion,
orgId = LiteCaChe.OrgId,
});
var json = HttpPost(LiteCaChe.SysConfig.DomainUrl + LiteCaChe.SysConfig.GetEquInfo, param);
var json = HttpPost(LiteCaChe.SysConfig.DomainUrl + Config.GetEquInfo, param);
if (string.IsNullOrEmpty(json))
{
Log.WorkLog("获取获取装备基础信息失败", "获取失败");
......@@ -209,7 +209,7 @@ namespace LiteChannelWinXP.Commons
version = LiteCaChe.SysConfig.ApiVersion,
orgId = LiteCaChe.OrgId,
});
var json = HttpPost(LiteCaChe.SysConfig.DomainUrl + LiteCaChe.SysConfig.GetStoreInfo, param);
var json = HttpPost(LiteCaChe.SysConfig.DomainUrl + Config.GetStoreInfo, param);
if (string.IsNullOrEmpty(json))
{
Log.WorkLog("获取获取仓库基础信息失败", "获取失败");
......@@ -270,7 +270,7 @@ namespace LiteChannelWinXP.Commons
version = LiteCaChe.SysConfig.ApiVersion,
orgId = LiteCaChe.OrgId,
});
var json = HttpPost(LiteCaChe.SysConfig.DomainUrl + LiteCaChe.SysConfig.GetOrderInfo, param);
var json = HttpPost(LiteCaChe.SysConfig.DomainUrl + Config.GetOrderInfo, param);
if (string.IsNullOrEmpty(json))
{
Log.WorkLog("获取获取单据信息失败", "获取失败");
......@@ -332,7 +332,7 @@ namespace LiteChannelWinXP.Commons
version = LiteCaChe.SysConfig.ApiVersion,
orgId = LiteCaChe.OrgId,
});
var json = HttpPost(LiteCaChe.SysConfig.DomainUrl + LiteCaChe.SysConfig.GetOrderDetail, param);
var json = HttpPost(LiteCaChe.SysConfig.DomainUrl + Config.GetOrderDetail, param);
if (string.IsNullOrEmpty(json))
{
Log.WorkLog("获取获取单据明细信息失败", "获取失败");
......@@ -435,7 +435,7 @@ namespace LiteChannelWinXP.Commons
version = LiteCaChe.SysConfig.ApiVersion,
orgId = LiteCaChe.OrgId,
});
var json = HttpPost(LiteCaChe.SysConfig.DomainUrl + LiteCaChe.SysConfig.GetPolices, param);
var json = HttpPost(LiteCaChe.SysConfig.DomainUrl + Config.GetPolices, param);
if (string.IsNullOrEmpty(json))
{
return default;
......@@ -521,7 +521,7 @@ namespace LiteChannelWinXP.Commons
else
{
var _url = LiteCaChe.SysConfig.DomainUrl + LiteCaChe.SysConfig.UploadFace;
var _url = LiteCaChe.SysConfig.DomainUrl + Config.UploadFace;
using (HttpClient client = new HttpClient())
{
var postContent = new MultipartFormDataContent();
......@@ -599,7 +599,7 @@ namespace LiteChannelWinXP.Commons
version = LiteCaChe.SysConfig.ApiVersion,
orgId = LiteCaChe.OrgId,
});
var json = HttpPost(LiteCaChe.SysConfig.DomainUrl + LiteCaChe.SysConfig.UpdateFinger, param);
var json = HttpPost(LiteCaChe.SysConfig.DomainUrl + Config.UpdateFinger, param);
if (string.IsNullOrEmpty(json))
{
return false;
......@@ -669,7 +669,7 @@ namespace LiteChannelWinXP.Commons
version = LiteCaChe.SysConfig.ApiVersion,
orgId = LiteCaChe.OrgId,
});
var json = HttpPost(LiteCaChe.SysConfig.DomainUrl + LiteCaChe.SysConfig.UploadUrl, param);
var json = HttpPost(LiteCaChe.SysConfig.DomainUrl + Config.UploadUrl, param);
if (string.IsNullOrEmpty(json))
{
Log.WorkLog("装备入库失败", "入库失败");
......@@ -785,7 +785,7 @@ namespace LiteChannelWinXP.Commons
version = LiteCaChe.SysConfig.ApiVersion,
orgId = LiteCaChe.OrgId,
});
var json = HttpPost(LiteCaChe.SysConfig.DomainUrl + LiteCaChe.SysConfig.UploadUrl, param);
var json = HttpPost(LiteCaChe.SysConfig.DomainUrl + Config.UploadUrl, param);
//Log.DebugLog("jsonres" + json);
......@@ -880,7 +880,7 @@ namespace LiteChannelWinXP.Commons
version = LiteCaChe.SysConfig.ApiVersion,
orgId = LiteCaChe.OrgId,
});
var json = HttpPost(LiteCaChe.SysConfig.DomainUrl + LiteCaChe.SysConfig.GetEpcListByBoxMarkEpc, param);
var json = HttpPost(LiteCaChe.SysConfig.DomainUrl + Config.GetEpcListByBoxMarkEpc, param);
if (string.IsNullOrEmpty(json))
{
return default;
......@@ -942,7 +942,7 @@ namespace LiteChannelWinXP.Commons
version = LiteCaChe.SysConfig.ApiVersion,
orgId = LiteCaChe.OrgId,
});
var json = HttpPost(LiteCaChe.SysConfig.DomainUrl + LiteCaChe.SysConfig.GetWarehouseById, param);
var json = HttpPost(LiteCaChe.SysConfig.DomainUrl + Config.GetWarehouseById, param);
if (string.IsNullOrEmpty(json))
{
return default;
......@@ -1007,7 +1007,7 @@ namespace LiteChannelWinXP.Commons
version = LiteCaChe.SysConfig.ApiVersion,
orgId = LiteCaChe.OrgId,
});
var json = HttpPost(LiteCaChe.SysConfig.DomainUrl + LiteCaChe.SysConfig.SetWarehouseState, param);
var json = HttpPost(LiteCaChe.SysConfig.DomainUrl + Config.SetWarehouseState, param);
if (string.IsNullOrEmpty(json))
{
return default;
......@@ -1071,7 +1071,7 @@ namespace LiteChannelWinXP.Commons
version = LiteCaChe.SysConfig.ApiVersion,
orgId = LiteCaChe.OrgId,
});
var json = HttpPost(LiteCaChe.SysConfig.DomainUrl + LiteCaChe.SysConfig.GetInvListByEpc, param);
var json = HttpPost(LiteCaChe.SysConfig.DomainUrl + Config.GetInvListByEpc, param);
if (string.IsNullOrEmpty(json))
{
Log.WorkLog("根据EPC集合获取物资信息失败", "入库失败");
......@@ -1135,7 +1135,7 @@ namespace LiteChannelWinXP.Commons
version = LiteCaChe.SysConfig.ApiVersion,
orgId = LiteCaChe.OrgId,
});
var json = HttpPost(LiteCaChe.SysConfig.DomainUrl + LiteCaChe.SysConfig.OpenOrderWorkUrl, param);
var json = HttpPost(LiteCaChe.SysConfig.DomainUrl + Config.OpenOrderWorkUrl, param);
if (string.IsNullOrEmpty(json))
{
Log.WorkLog("开启单据失败,请重试", "开启单据失败");
......@@ -1198,7 +1198,7 @@ namespace LiteChannelWinXP.Commons
version = LiteCaChe.SysConfig.ApiVersion,
orgId = LiteCaChe.OrgId,
});
var json = HttpPost(LiteCaChe.SysConfig.DomainUrl + LiteCaChe.SysConfig.CloseOrderUrl, param);
var json = HttpPost(LiteCaChe.SysConfig.DomainUrl + Config.CloseOrderUrl, param);
if (string.IsNullOrEmpty(json))
{
Log.WorkLog("关闭单据失败,请重试", "关闭单据失败");
......
......@@ -74,6 +74,23 @@ namespace LiteChannelWinXP
public class Config
{
public const string SoftUpdate = "/api/SoftUpdate/GetLastUpdate";
public const string GetEquInfo = "/api/EquipmentDetail/GetListEquipmentDetail";
public const string GetStoreInfo = "/api/Warehouse/GetListOrgWarehouse";
public const string GetOrderInfo = "/api/Inventory/GetOrderInfo";
public const string GetOrderDetail = "/api/Inventory/GetOrderDetail";
public const string OpenOrderWorkUrl = "/api/Inventory/OpenThisOrderAndCloseOther";
public const string UploadUrl = "/api/Inventory/UploadRFIDNew";
public const string CloseOrderUrl = "/api/Inventory/CloseOrder";
public const string GetPolices = "/api/ChannelCfg/GetOrgStaff";
public const string UploadFace = "/api/ChannelCfg/UploadFace";
public const string UpdateFinger = "/api/ChannelCfg/UpdateFinger";
public const string GetInvListByEpc = "/api/Inventory/GetInvListByEpc";
public const string GetWarehouseById = "/api/Warehouse/GetWarehouseById";
public const string SetWarehouseState = "/api/Inventory/SetWarehouseState";
public const string GetEpcListByBoxMarkEpc = "/api/EquipmentBoxMark/GetEpcListByBoxMarkEpc";
public Config()
{
AppTitle = "充电台入库-WinXP v" + FileVersionInfo.GetVersionInfo(Process.GetCurrentProcess().MainModule.FileName).FileVersion;
......@@ -82,35 +99,21 @@ namespace LiteChannelWinXP
DomainUrl = "http://41.190.20.132:18761/api/service";
UserLogin = "http://41.190.20.132:10004/auth/userLogin";
SoftUpdate = "/api/SoftUpdate/GetLastUpdate";
GetEquInfo = "/api/EquipmentDetail/GetListEquipmentDetail";
GetStoreInfo = "/api/Warehouse/GetListWarehouse";
GetOrderInfo = "/api/Inventory/GetOrderInfo";
GetOrderDetail = "/api/Inventory/GetOrderDetail";
ComMouth = "COM4";
WarehouseID = "d8192b23-0ec9-4b2e-a47d-f6780a66a880";
UploadUrl = "/api/Inventory/UploadRFIDNew";
OpenOrderWorkUrl = "/api/Inventory/OpenThisOrderAndCloseOther";
CloseOrderUrl = "/api/Inventory/CloseOrder";
//WarehouseID = "d8192b23-0ec9-4b2e-a47d-f6780a66a880";
ApiVersion = "1.0";
AppKey = "q6t0lEKOmMg5Tm+dg3XdZQ==";
SecretKey = "ba4d855b3b83eab441a51ea9bd9d9671";
GetPolices = "/api/ChannelCfg/GetOrgStaff";
FaceAddress = "192.168.8.35";
FaceUser = "admin";
FacePwd = "junmp123";
FacePort = "8000";
UploadFace = "/api/ChannelCfg/UploadFace";
UpdateFinger = "/api/ChannelCfg/UpdateFinger";
IsUseFace = true;
IsEnabledShelf = false;
ShelfAddress = "http://192.168.3.128:38080/api/BoundDocuments";
GetInvListByEpc = "/api/Inventory/GetInvListByEpc";
IsAutoUpdate = true;
AutoUpdateTime = 0;
GetWarehouseById = "/api/Warehouse/GetWarehouseById";
SetWarehouseState = "/api/Inventory/SetWarehouseState";
GetEpcListByBoxMarkEpc = "/api/EquipmentBoxMark/GetEpcListByBoxMarkEpc";
}
/// <summary>
/// 接口域名
......@@ -126,37 +129,20 @@ namespace LiteChannelWinXP
public string AppVersion { get; set; }
[JsonIgnore]
public string AppCode { get; set; }
public string SoftUpdate { get; set; }
public string GetEquInfo { get; set; }
public string GetStoreInfo { get; set; }
public string GetOrderInfo { get; set; }
public string GetOrderDetail { get; set; }
public string ComMouth { get; set; }
public string WarehouseID { get; set; }
public string UploadUrl { get; set; }
public string OpenOrderWorkUrl { get; set; }
public string CloseOrderUrl { get; set; }
public string ApiVersion { get; set; }
public string AppKey { get; set; }
public string SecretKey { get; set; }
public string GetPolices { get; set; }
public string FaceAddress { get; set; }
public string FaceUser { get; set; }
public string FacePwd { get; set; }
public string FacePort { get; set; }
public string UploadFace { get; set; }
public string UpdateFinger { get; set; }
public bool IsUseFace { get; set; }
public bool IsEnabledShelf { get; set; }
public string ShelfAddress { get; set; }
public string GetInvListByEpc { get; set; }
public string GetWarehouseById { get; set; }
public string SetWarehouseState { get; set; }
/// <summary>
/// 是否自动更新
/// </summary>
......@@ -165,11 +151,6 @@ namespace LiteChannelWinXP
/// 自动更新时间(小时)
/// </summary>
public int AutoUpdateTime { get; set; }
[JsonIgnore]
public static new bool IsInDesignModeStatic { get; }
public string GetEpcListByBoxMarkEpc { get; set; }
}
public class respone_user
{
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论