Example #1
0
        public void QueryPlansByConditions(RestServiceRequest request, RestServiceResponse <InspectionPlan[]> response)
        {
            response.Paging = request.Paging;

            response.Body = _InspectionPlanRepository.QueryPlansByConditions(request.Paging,
                                                                             request.GetValue("Id", 0),
                                                                             request.GetValue("DeviceNumber"));
        }
Example #2
0
        public void QueryBriefDevices(RestServiceRequest request, RestServiceResponse <DeviceInfo[]> response)
        {
            response.Paging = request.Paging;

            response.Body = DeviceInfoTransfer.BuildDeviceInfos(_DeviceInfoRepository.QueryDeviceInfos(
                                                                    request.Paging,
                                                                    request.GetValue("DeviceNumber"),
                                                                    request.GetValue("DeviceName")));
        }
Example #3
0
        public void QueryDeviceCheckpoints(RestServiceRequest request, RestServiceResponse <DeviceCheckpoint[]> response)
        {
            response.Paging = request.Paging;

            response.Body = DeviceCheckpointTransfer.BuildDeviceCheckpoints(_DeviceCheckpointRepository.QueryDeviceCheckpoints(
                                                                                request.Paging,
                                                                                request.GetValue <int>("DeviceCheckpointId", 0),
                                                                                request.GetValue("DeviceNumber")));
        }
Example #4
0
        public void QueryDeviceSpareParts(RestServiceRequest request, RestServiceResponse <DeviceSparePart[]> response)
        {
            response.Paging = request.Paging;

            response.Body = DeviceSparePartTransfer.BuildDeviceSpareParts(_DeviceSparePartRepository.QueryDeviceSpareParts(
                                                                              request.Paging,
                                                                              request.GetValue("SparePartNumber"),
                                                                              request.GetValue("DeviceNumber")));
        }
Example #5
0
        public void QueryRecordsByConditions(RestServiceRequest request, RestServiceResponse <DeviceRepairRecord[]> response)
        {
            response.Paging = request.Paging;

            response.Body = _DeviceRepairRecordRepository.QueryRecordsByConditions(request.Paging,
                                                                                   request.GetValue("Id", 0),
                                                                                   request.GetValue <string>("DeviceNumber", null),
                                                                                   request.GetValue <string>("Statuses", null).SplitByChar(','),
                                                                                   request.GetValue <string>("StartTime", null),
                                                                                   request.GetValue <string>("EndTime", null));
        }
Example #6
0
        public void QueryDetailDevices(RestServiceRequest request, RestServiceResponse <DeviceInfo[]> response)
        {
            response.Paging = request.Paging;

            var deviceInfos = DeviceInfoTransfer.BuildDeviceInfos(_DeviceInfoRepository.QueryDeviceInfos(
                                                                      request.Paging,
                                                                      request.GetValue("DeviceNumber"),
                                                                      request.GetValue("DeviceName")));

            var deviceCheckpoints = DeviceCheckpointTransfer.BuildDeviceCheckpoints(
                _DeviceCheckpointRepository.QueryDeviceCheckpoints(deviceInfos.Select(x => x.DeviceNumber).ToArray()));

            var deviceSparePartDeviceInfoMappings = DeviceSparePartDeviceInfoMappingTransfer.BuildDeviceSparePartDeviceInfoMappings(
                _DeviceSparePartRepository.QueryDeviceSpareParts(deviceInfos.Select(x => x.DeviceNumber).ToArray()));

            foreach (var deviceInfo in deviceInfos)
            {
                deviceInfo.DeviceCheckpoints = deviceCheckpoints.Where(x => x.DeviceInfo != null && x.DeviceInfo.DeviceNumber == deviceInfo.DeviceNumber).ToArray();
                deviceInfo.DeviceSpareParts  = deviceSparePartDeviceInfoMappings.Where(x => x.DeviceInfo != null && x.DeviceInfo.DeviceNumber == deviceInfo.DeviceNumber)
                                               .Select(x => x.DeviceSparePart).ToArray();
            }

            response.Body = deviceInfos;
        }