123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806 |
- using AutoMapper;
- using BizService;
- using Microsoft.Extensions.Logging;
- using MiniExcelLibs;
- using Model.Dto;
- using Model.Entities;
- using PLCTool.Pdf;
- using Prism.Commands;
- using Prism.Mvvm;
- using Prism.Services.Dialogs;
- using QuestPDF.Infrastructure;
- using QuestPDF;
- using System;
- using System.Collections.Generic;
- using System.Collections.ObjectModel;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using Newtonsoft.Json;
- using QuestPDF.Fluent;
- using System.Windows;
- using Prism.Regions;
- namespace PLCTool.ViewModels.BusinessManageViewModel
- {
-
- public class ResultQueryViewModel : BindableBase,INavigationAware
- {
- private readonly IRegionManager _regionManager;
- private readonly IBasicDeviceService _iBasicDeviceService;
- private readonly IBasicDeviceKindService _iBasicDeviceKindService;
- private readonly IBasicProjectService _iBasicProjectService;
- private readonly IBasicPlcTestSchemeService _basicPlcTestSchemeService;
- private readonly IBizTestRecordDtlService _iBizTestRecordDtlService;
- private readonly IBizTestRecordService _iBizTestRecordService;
- private readonly IBasicPlcTestSchemeDtlService _iBasicPlcTestSchemeDtlService;
- private readonly IMapper _mapper;
- private readonly IDialogService _dialog;
- private readonly ILogger _logger;
- private List<DeviceDtlWithResultModel> allDeviceAndSchResultList = new List<DeviceDtlWithResultModel>();//所有设备,并带有测试方案
- private List<DeviceDtlWithResultModel> allDeviceList = new List<DeviceDtlWithResultModel>();//所有方案
- private List<DeviceDtlWithResultModel> conditionDevices = new List<DeviceDtlWithResultModel>();//符合条件的方案
- private string selectProjectName;
- public ResultQueryViewModel(IBasicDeviceService iBasicDeviceService, IBasicDeviceKindService iBasicDeviceKindService, IBasicProjectService iBasicProjectService, IBasicPlcTestSchemeService basicPlcTestSchemeService, IBizTestRecordDtlService iBizTestRecordDtlService, IBizTestRecordService iBizTestRecordService, IBasicPlcTestSchemeDtlService iBasicPlcTestSchemeDtlService, IRegionManager regionManager,IMapper mapper, IDialogService dialog, ILogger logger)
- {
- _iBasicDeviceService = iBasicDeviceService;
- _iBasicDeviceKindService = iBasicDeviceKindService;
- _iBasicProjectService = iBasicProjectService;
- _basicPlcTestSchemeService = basicPlcTestSchemeService;
- _iBizTestRecordService= iBizTestRecordService;
- _iBizTestRecordDtlService= iBizTestRecordDtlService;
- _iBasicPlcTestSchemeDtlService = iBasicPlcTestSchemeDtlService;
- _regionManager = regionManager;
- _mapper = mapper;
- _dialog = dialog;
- _logger = logger;
- QueryCommand = new DelegateCommand<object>(Query);
- ExportCommand = new DelegateCommand<string>(Export);
- CheckDetailCommand = new DelegateCommand<object>(CheckDetail);
- ResetCommand = new DelegateCommand<object>(Reset);
- OnLoadCommand = new DelegateCommand(OnLoad);
- PdfReportCommand = new DelegateCommand<object>(CreatePdf);
- UnqualifiedCommand = new DelegateCommand<object>(RetryTest);
- DgSelectChangeCommand = new DelegateCommand<object>(DgSelect);
- GoBackCommand = new DelegateCommand<object>(GoBack);
- }
- #region 私有方法
- /// <summary>
- /// 重新测试不合格项
- /// </summary>
- /// <param name="obj"></param>
- private void RetryTest(object obj)
- {
- object[] multiObj = obj as object[];
- //测试方案明细主键ID
- long id = (long)multiObj[0];
- long deviceId = (long)multiObj[1];
- DialogParameters parm = new DialogParameters();
- parm.Add("Key", id);
- parm.Add("Key2", deviceId);
- //弹出详情对话框
- //弹出详情对话框
- _dialog.ShowDialog("RetryTestView", parm, async callback =>
- {
- if (callback.Result == ButtonResult.OK)
- {
- //更新表格,重新获取
- }
- });
- }
- /// <summary>
- /// 加载页面
- /// </summary>
- private void OnLoad()
- {
- DeviceKindNameList.Clear();
- DeviceKindNameList.Add("---");
- ProjectNameList.Clear();
- ProjectNameList.Add("---");
- var Kinds = _iBasicDeviceKindService.FindAllDeviceKind();
- foreach (var kind in Kinds)
- {
- DeviceKindNameList.Add(kind);
- }
- var projects = _iBasicProjectService.FindAllProject();
- foreach (var project in projects)
- {
- ProjectNameList.Add(project);
- }
- DeviceKindName = "---";
- ProjectName = "---";
- GetProjectConfig();
- }
- private void Reset(object obj)
- {
- DeviceNo = string.Empty;
- DeviceName = string.Empty;
- DeviceKindName = "---";
- ProjectName = "---";
- StartTime = string.Empty;
- EndTime = string.Empty;
- }
- /// <summary>
- /// 查看详情
- /// </summary>
- /// <param name="obj"></param>
- private void CheckDetail(object obj)
- {
- //recordID
- long id = Convert.ToInt64(obj);
- DialogParameters parm = new DialogParameters();
- parm.Add("Key", id);
- //弹出详情对话框
- //弹出详情对话框
- _dialog.ShowDialog("TestResultDetailView", parm, async callback =>
- {
- if (callback.Result == ButtonResult.OK)
- {
- //更新表格,重新获取
- //GetContent();
- }
- });
- }
- /// <summary>
- /// 查询
- /// </summary>
- /// <param name="obj"></param>
- private void Query(object obj)
- {
- if ((!string.IsNullOrEmpty(StartTime)) && (!string.IsNullOrEmpty(EndTime)))
- {
- if (Convert.ToDateTime(StartTime) > Convert.ToDateTime(EndTime))
- {
- MessageBox.Show("起始时间大于结束时间,请重新输入", "确认", MessageBoxButton.OK, MessageBoxImage.Warning);
- return;
- }
- }
- conditionDevices = (from a in allDeviceList
- where (string.IsNullOrEmpty(DeviceName) ? true : (a.DeviceName == DeviceName))
- && (string.IsNullOrEmpty(DeviceNo) ? true : (a.DeviceNo == DeviceNo))
- && ((DeviceKindName == "---") ? true : (a.DeviceKindName == DeviceKindName))
- && ((ProjectName == "---") ? true : (a.ProjectName == ProjectName))
- && (EndTime == string.Empty ? true : (a.CreateTime < Convert.ToDateTime(EndTime)) && (Convert.ToDateTime(StartTime) < a.CreateTime))
- select a).ToList();
- //默认显示的第一页
- conditionDevices = conditionDevices.OrderBy(x => x.DeviceId).ToList();
- Getpage();
- }
- private void Export(string obj)
- {
- using (System.Windows.Forms.SaveFileDialog saveFileDialog = new System.Windows.Forms.SaveFileDialog()
- {
- //设置文件类型
- //书写规则例如:txt files(*.txt)|*.txt
- Filter = "Excel files(*.xlsx)|*.xlsx|All files(*.*)|*.*",
- //设置默认文件名(可以不设置)
- FileName = "项目配置表",
- //获取或设置一个值,该值指示如果用户省略扩展名,文件对话框是否自动在文件名中添加扩展名。(可以不设置)
- AddExtension = true,
- //保存对话框是否记忆上次打开的目录
- RestoreDirectory = true
- })
- {
- // Show save file dialog box
- //点了保存按钮进入
- if (saveFileDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
- {
- try
- {
- //获得文件路径
- string localFilePath = saveFileDialog.FileName.ToString();
- //获取文件内容
- MiniExcel.SaveAs(localFilePath, DeviceResultItemList);
- }
- catch (Exception ex)
- {
- _logger.LogError(ex.ToString());
- }
- }
- }
- }
- /// <summary>
- /// 单元格查看
- /// </summary>
- /// <param name="obj"></param>
- private void DgSelect(object obj)
- {
- DeviceDtlWithResultModel dtlSch = (DeviceDtlWithResultModel)obj;
- if (dtlSch != null)
- {
- SchItemResultList = new ObservableCollection<DeviceDtlWithResultModel>(allDeviceAndSchResultList.FindAll(x => ((x.ProjectName == dtlSch.ProjectName) && (x.DeviceName == dtlSch.DeviceName))));
- }
- }
- /// <summary>
- /// 返回界面
- /// </summary>
- /// <param name="obj"></param>
- /// <exception cref="NotImplementedException"></exception>
- private void GoBack(object obj)
- {
- _regionManager.Regions["ContentRegion"].RequestNavigate("ProjectTestResultView");
- }
- /// <summary>
- /// 获取所有项目
- /// </summary>
- private void GetProjectConfig()
- {
- allDeviceAndSchResultList.Clear();
- allDeviceList.Clear();
- conditionDevices.Clear();
-
- //所有测试方案
- var schlist = _basicPlcTestSchemeService.QueryList();
- var schDtoList = _mapper.Map<List<bas_plc_test_scheme>, List<BasicPlcTestSchemeDto>>(schlist);
- //测试记录中的所有设备
- var deviceIds=_iBizTestRecordService.QueryList().Select(X => X.device_id).Distinct();
- foreach (var deviceId in deviceIds)
- {
- List<DateTime> startDateTimes = new List<DateTime>();
- List<DateTime> endDateTimes = new List<DateTime>();
- var deviceMsg = _iBasicDeviceService.Find(((int)deviceId));
- if(deviceMsg != null)
- {
- string deviceKind = _iBasicDeviceKindService.Find((int)deviceMsg.device_kind_id)?.devicekind_name;
- string projectName = _iBasicProjectService.Find((int)deviceMsg.project_id)?.project_name;
- //记录设备下的方案通过个数
- int deviceCountResult = 0;
- string deviceTestResult = string.Empty;
- //查找哦记录有的方案
-
- var recordMsgs=_iBizTestRecordService.FindRecordByDeviceId(deviceId);
- foreach ( var sch in recordMsgs)
- {
- string testStatus = "已完成";
- long schId=(long)_basicPlcTestSchemeService.FindByNameAndType(sch.scheme_name, deviceKind)?.scheme_id;
- //计算测试结果
- string testResult = string.Empty;
- int countResult = 0;
- var records = _iBizTestRecordDtlService.FindRecordDetailByRecordID(sch.record_id);
- //
- var schDtls=_iBasicPlcTestSchemeDtlService.FindAllBySchId(schId);
- //循环所有测试项,有一个不合格,则整个测试方案不合格
- foreach(var dtl in schDtls)
- {
- //选取开始时间最大的一个数据,查看测试结果
- long schDtId = dtl.scheme_dtl_id;
- var findRecords=records.FindAll(x => x.scheme_dtl_id == schDtId).OrderByDescending(x=>x.start_test_time).ToArray();
- if(findRecords.Length>0)
- {
- int result = (int)findRecords[0]?.test_result.Value;
- if(result==0)
- {
- testResult = "不通过";
- break;
- }
- else
- {
- countResult++;
- }
- }
- //如果在测试记录中没有找到这个测试项,表示没有测试完所有的测试项)
- var findSchDtl = records.FirstOrDefault(x => x.scheme_dtl_id == schDtId);
- if(findSchDtl==null)
- {
- testStatus = "未完成";
- }
- }
- //测试结果
- if(countResult== schDtls.Count)
- {
- testResult = "通过";
- }
-
- //计算这个设备是否通过
- if(testResult == "通过")
- {
- deviceCountResult++;
- }
- //加入时间集合
- startDateTimes.Add(sch.start_test_time.Value);
- endDateTimes.Add(sch.finish_test_time.Value);
- //把
- allDeviceAndSchResultList.Add(new DeviceDtlWithResultModel()
- {
- RecordId = sch.record_id,
- DeviceId = deviceMsg.device_id,
- DeviceNo = deviceMsg.device_no,
- DeviceName = deviceMsg.device_name,
- DeviceKindName = deviceKind,
- ProjectName = projectName,
- StartTestTime =(DateTime) startDateTimes?.Min(),//取最小时间
- FinishTestTime = (DateTime)endDateTimes?.Max(),//取最大时间
- TestResult = testResult,
- SchemeName = sch.scheme_name,
- SchemeId = schId,
- CreateTime = sch.start_test_time.Value,
- CreateBy=sch.create_by,
- Remark=sch.remark,
- TestStatus=testStatus,
- });
- }
- //计算这个设备是否所有的方案都通过
- if ((deviceCountResult!=0)&&(deviceCountResult == recordMsgs.Count))
- {
- deviceTestResult = "通过";
- }
- else
- {
- deviceTestResult = "不通过";
- }
- //只添加选择的项目
- if (projectName == selectProjectName)
- {
- //这里不添加方案名称
- allDeviceList.Add(new DeviceDtlWithResultModel()
- {
- DeviceId = deviceMsg.device_id,
- DeviceNo = deviceMsg.device_no,
- DeviceName = deviceMsg.device_name,
- DeviceKindName = deviceKind,
- ProjectName = projectName,
- StartTestTime = startDateTimes.Min(),//取最小时间
- CreateTime=deviceMsg.create_time,
- CreateBy=deviceMsg.create_by,
- TestResult = deviceTestResult
- });
- conditionDevices.Add(new DeviceDtlWithResultModel()
- {
- DeviceId = deviceMsg.device_id,
- DeviceNo = deviceMsg.device_no,
- DeviceName = deviceMsg.device_name,
- DeviceKindName = deviceKind,
- ProjectName = projectName,
- StartTestTime = startDateTimes.Min(),//取最小时间
- CreateTime = deviceMsg.create_time,
- CreateBy = deviceMsg.create_by,
- TestResult = deviceTestResult
- });
- }
-
- }
- }
- conditionDevices = conditionDevices.OrderBy(x => x.DeviceId).ToList();
- Getpage();
- }
- /// <summary>
- /// 获取页面
- /// </summary>
- private void Getpage()
- {
- CurrentPage = 1;
- TotalCount = conditionDevices.Count;
- CurrentPageChanged();
- }
- /// <summary>
- /// 页面变化
- /// </summary>
- private void CurrentPageChanged()
- {
- DeviceResultItemList.Clear();
- foreach (var i in conditionDevices.Skip((CurrentPage - 1) * CountPerPage).Take(CountPerPage))
- {
- DeviceResultItemList.Add(i);
- }
- }
- /// <summary>
- /// 生成pdf
- /// </summary>
- /// <param name="obj"></param>
- public void CreatePdf(object obj)
- {
- List<biz_test_record_dtl> allRecordDtls = new List<biz_test_record_dtl>();
- object[] multiObj = obj as object[];
- //测试结果和设备id
- string testResult = (string)multiObj[0];
- long deviceId = (long)multiObj[1];
- //项目名称
- string projectName = (string)multiObj[2];
- //查找recordid
- var recordMsgs=_iBizTestRecordService.FindRecordByDeviceId((int)deviceId);
- //查找这个id的所有测试记录
- foreach(var recordMsg in recordMsgs)
- {
- //一条reoordid对应可能有多次测试记录
- var recordDtls = _iBizTestRecordDtlService.FindRecordDetailByRecordID(recordMsg.record_id);
- foreach(var record in recordDtls)
- {
- allRecordDtls.Add(record);
- }
-
- }
- //查找详细记录
-
- string deviceName = _iBasicDeviceService.Find((int)deviceId).device_name;
- try
- {
- Settings.License = LicenseType.Community;
- var model = GetReportPLCInfo(projectName,deviceName, allRecordDtls,testResult);
- var document = new InvoiceDocument(model);
- //pdf名称为轴编号+时间
- //输出文件
- using (System.Windows.Forms.SaveFileDialog saveFileDialog = new System.Windows.Forms.SaveFileDialog()
- {
- //设置文件类型
- //书写规则例如:txt files(*.txt)|*.txt
- Filter = "pdf文件|*.pdf",
- //设置默认文件名(可以不设置)
- FileName = "报表" + string.Format("{0:yyyyMMddHHmm}", DateTime.Now),
- //获取或设置一个值,该值指示如果用户省略扩展名,文件对话框是否自动在文件名中添加扩展名。(可以不设置)
- AddExtension = true,
- //保存对话框是否记忆上次打开的目录
- RestoreDirectory = true
- })
- {
- //点了保存按钮进入
- if (saveFileDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
- {
- //获得文件路径
- string localFilePath = saveFileDialog.FileName.ToString();
- document.GeneratePdf(localFilePath);
- }
- }
- }
- catch (Exception ex)
- {
- _logger.LogError(ex.ToString());
- }
- }
- /// <summary>
- /// pdf报告相关信息
- /// </summary>
- /// <param name="schDtlId"></param>
- /// <returns></returns>
- private InvoiceModel GetReportPLCInfo(string projectName,string deviceName,List<biz_test_record_dtl> recordDtls,string testResult)
- {
- //测试方案明细主键ID
- InvoiceModel invoiceModel = new InvoiceModel();
- invoiceModel.ReportPLCModels = new List<ReportPLCModel>();
- invoiceModel.ProjectName = projectName;
- invoiceModel.DeviceName = deviceName;
- foreach (var each in recordDtls)
- {
- long recordId = each.record_id.Value;
- long schDtlid = each.scheme_dtl_id;
- var schDtlRelt = _iBasicPlcTestSchemeDtlService.Find((int)schDtlid);
- if(schDtlRelt != null)
- {
- //查找方案名
- long schId = schDtlRelt.scheme_id.Value;
- string schEachName = _basicPlcTestSchemeService.Find((int)schId)?.scheme_name;
- string schItemName = schDtlRelt.item_name;
- string schItemType = string.Empty;
- int typeNo = schDtlRelt.item_type.Value;
- switch (typeNo)
- {
- case 0:
- schItemType = "前置项";
- break;
- case 1:
- schItemType = "PLC点位测试项";
- break;
- case 2:
- schItemType = "Robot动作测试";
- break;
- }
- //根据测试结果明细
- if (each != null)
- { //前置项结果解析
- string preconStr = each.precondition_final?.ToString();
- if (!string.IsNullOrEmpty(preconStr))
- {
- JsonModel preconditionModel = JsonConvert.DeserializeObject<JsonModel>(preconStr);
- foreach (var detail in preconditionModel.DetailInfo)
- {
- invoiceModel.ReportPLCModels.Add(new ReportPLCModel()
- {
- SchName= schEachName,
- ItemName = schItemName,
- ItemType = schItemType,
- Type = "前置项",
- JudgeType = preconditionModel.ItemType,
- SelectLogic = preconditionModel.ItemLogical,
- Detail = preconditionModel.Description,
- Id = detail.Id,
- PlcAddress = detail.PlcAddress,
- PlcItem = detail.PlcItem,
- PlcValue = detail.PlcValue,
- Remark = detail.Remark,
- TestTime = detail.TestTime,
- RealValue = detail.RealValue,
- TestResult = detail.TestResult,
- });
- }
- }
- //输入项解析
- string inStr = each.action_final?.ToString();
- if (!string.IsNullOrEmpty(inStr))
- {
- JsonModel inModel = JsonConvert.DeserializeObject<JsonModel>(inStr);
- foreach (var detail in inModel.DetailInfo)
- {
- invoiceModel.ReportPLCModels.Add(new ReportPLCModel()
- {
- SchName = schEachName,
- ItemName = schItemName,
- ItemType = schItemType,
- Type = "输入项",
- JudgeType = inModel.ItemType,
- SelectLogic = inModel.ItemLogical,
- Detail = inModel.Description,
- Id = detail.Id,
- PlcAddress = detail.PlcAddress,
- PlcItem = detail.PlcItem,
- PlcValue = detail.PlcValue,
- Remark = detail.Remark,
- TestTime = detail.TestTime,
- RealValue = detail.RealValue,
- TestResult = detail.TestResult,
- });
- }
- }
- //输出项解析
- string outStr = each.judgement_result_final?.ToString();
- if (!string.IsNullOrEmpty(outStr))
- {
- JsonModel outModel = JsonConvert.DeserializeObject<JsonModel>(outStr);
- foreach (var detail in outModel.DetailInfo)
- {
- invoiceModel.ReportPLCModels.Add(new ReportPLCModel()
- {
- SchName = schEachName,
- ItemName = schItemName,
- ItemType = schItemType,
- Type = "结果项",
- JudgeType = outModel.ItemType,
- SelectLogic = outModel.ItemLogical,
- Detail = outModel.Description,
- Id = detail.Id,
- PlcAddress = detail.PlcAddress,
- PlcItem = detail.PlcItem,
- PlcValue = detail.PlcValue,
- Remark = detail.Remark,
- TestTime = detail.TestTime,
- RealValue = detail.RealValue,
- TestResult = detail.TestResult,
- });
- }
- }
- }
- }
-
- }
- //判断方案结果是否通过
- //var testCount = allDeviceList.FindAll(X => X.SchemeName == findSch.scheme_name && X.TestResult == "通过")?.Count;
- //if (testCount == allResult.Count)
- //{
- // invoiceModel.FinalReuslt = "通过";
- //}
- //else
- //{
- // invoiceModel.FinalReuslt = "不通过";
- //}
- invoiceModel.FinalReuslt = testResult;
- return invoiceModel;
- }
- public void OnNavigatedTo(NavigationContext navigationContext)
- {
- //编辑
- var getMsg = navigationContext.Parameters.GetValues<string>("Key");
- ///值不为空,表示修改,为空表示新增
- if (getMsg != null)
- {
- foreach (var item in getMsg)
- {
- selectProjectName = item;
- }
- }
- }
- public bool IsNavigationTarget(NavigationContext navigationContext)
- {
- return true;
- }
- public void OnNavigatedFrom(NavigationContext navigationContext)
- {
-
- }
- #endregion
- #region 命令绑定
- public DelegateCommand<object> QueryCommand { set; get; }
- public DelegateCommand<string> ExportCommand { set; get; }
- public DelegateCommand<object> ResetCommand { set; get; }
- public DelegateCommand OnLoadCommand { set; get; }
- public DelegateCommand<object> CheckDetailCommand { set; get; }
- public DelegateCommand<object> UnqualifiedCommand { set; get; }
-
- public DelegateCommand<object> PdfReportCommand { set; get; }
- public DelegateCommand<object> DgSelectChangeCommand { set; get; }
- public DelegateCommand<object> GoBackCommand { set; get; }
- #endregion
- #region 数据绑定
- private ObservableCollection<DeviceDtlWithResultModel> deviceResultItemList = new ObservableCollection<DeviceDtlWithResultModel>();
- public ObservableCollection<DeviceDtlWithResultModel> DeviceResultItemList
- {
- get { return deviceResultItemList; }
- set { deviceResultItemList = value; RaisePropertyChanged(); }
- }
- private ObservableCollection<DeviceDtlWithResultModel> schItemResultList = new ObservableCollection<DeviceDtlWithResultModel>();
- public ObservableCollection<DeviceDtlWithResultModel> SchItemResultList
- {
- get { return schItemResultList; }
- set { schItemResultList = value; RaisePropertyChanged(); }
- }
-
- /// <summary>
- /// 设备编号
- /// </summary>
- private string devicedNo;
- public string DeviceNo
- {
- get { return devicedNo; }
- set { devicedNo = value; RaisePropertyChanged(); }
- }
- /// <summary>
- /// 设备类型名称
- /// </summary>
- private string deviceName;
- public string DeviceName
- {
- get { return deviceName; }
- set { deviceName = value; RaisePropertyChanged(); }
- }
- private string projectName;
- public string ProjectName
- {
- get { return projectName; }
- set { projectName = value; RaisePropertyChanged(); }
- }
- private string deviceKindName;
- public string DeviceKindName
- {
- get { return deviceKindName; }
- set { deviceKindName = value; RaisePropertyChanged(); }
- }
- /// <summary>
- /// 项目名称
- /// </summary>
- private ObservableCollection<string> projectNameList = new ObservableCollection<string>();
- public ObservableCollection<string> ProjectNameList
- {
- get { return projectNameList; }
- set { projectNameList = value; RaisePropertyChanged(); }
- }
- /// <summary>
- /// 开始时间
- /// </summary>
- private string startTime = DateTime.Now.AddDays(-1).ToString();
- public string StartTime
- {
- get { return startTime; }
- set { startTime = value; RaisePropertyChanged(); }
- }
- private string endTime = DateTime.Now.ToString();
- public string EndTime
- {
- get { return endTime; }
- set { endTime = value; RaisePropertyChanged(); }
- }
- /// <summary>
- /// 设备类型
- /// </summary>
- private ObservableCollection<string> deviceKindNameList = new ObservableCollection<string>();
- public ObservableCollection<string> DeviceKindNameList
- {
- get { return deviceKindNameList; }
- set { deviceKindNameList = value; RaisePropertyChanged(); }
- }
- /// <summary>
- /// 总条数
- /// </summary>
- private int totalCount;
- public int TotalCount
- {
- get { return totalCount; }
- set { totalCount = value; RaisePropertyChanged(); CurrentPageChanged(); }
- }
- /// <summary>
- /// 每页数量
- /// </summary>
- private int countPerPage = 15;
- public int CountPerPage
- {
- get { return countPerPage; }
- set { countPerPage = value; RaisePropertyChanged(); CurrentPageChanged(); }
- }
- /// <summary>
- /// 单前页
- /// </summary>
- private int currentPage = 1;
- public int CurrentPage
- {
- get { return currentPage; }
- set { currentPage = value; RaisePropertyChanged(); CurrentPageChanged(); }
- }
- #endregion
- }
- }
|