| | |
| | | import com.product.device.config.DeviceCode; |
| | | import com.product.device.config.DeviceConst; |
| | | import com.product.device.service.CommonInspectionService; |
| | | import com.product.device.service.DeviceInspectionConfigService; |
| | | import com.product.device.service.DeviceMainenanceService; |
| | | import com.product.device.service.DeviceMaintenanceRecordService; |
| | | import com.product.device.service.DeviceManagerService; |
| | | import com.product.device.service.idel.IDeviceArchivesService; |
| | | import com.product.device.service.idel.IDeviceInspectionService; |
| | | import com.product.device.service.idel.IDeviceMainenanceService; |
| | | import com.product.device.service.idel.IDeviceMaintenanceRecordService; |
| | | import com.product.mobile.core.config.MobileCoreCode; |
| | | import com.product.mobile.core.config.MobileCoreConst; |
| | | import com.product.module.sys.entity.SystemUser; |
| | | import com.product.module.sys.version.ApiVersion; |
| | | import com.product.task.device.service.DeviceManagerTaskService; |
| | | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | |
| | | DeviceManagerService deviceManagerService; |
| | | @Autowired |
| | | DeviceMainenanceService deviceMainenanceService; |
| | | |
| | | @Autowired |
| | | CommonInspectionService commonInspectionService; |
| | | |
| | | @Autowired |
| | | DeviceMaintenanceRecordService deviceMaintenanceRecordService; |
| | | |
| | | @Autowired |
| | | DeviceInspectionConfigService deviceInspectionConfigService; |
| | | /** |
| | | * 任务列表 |
| | | * |
| | |
| | | SpringMVCContextHolder.getSystemLogger().error(MobileCoreCode.SYSTEM_FORM_COUNT.getValue(), MobileCoreCode.SYSTEM_FORM_COUNT.getText()); |
| | | return this.error(MobileCoreCode.SYSTEM_FORM_COUNT.getValue(), MobileCoreCode.SYSTEM_FORM_COUNT.getText()); |
| | | } |
| | | String result=OK_List(deviceManagerTaskService.getsPersionNewTask(curUser)); |
| | | String result=OK_List(deviceManagerTaskService.getPersionNewTask(curUser)); |
| | | System.out.println(result); |
| | | return result; |
| | | } catch (BaseException e) { |
| | |
| | | fse.remove("uuid"); |
| | | String uuid=service.saveDeviceFailure(fse); |
| | | System.out.println(uuid); |
| | | return !StringUtils.isEmpty(uuid)? this.OK_Add(uuid):this.error(new BaseException(DeviceCode.DEVICE_CREATE_FAILURE_ERROR)); |
| | | return !StringUtils.isEmpty(uuid)? this.OK_Add(uuid):this.error(new BaseException(DeviceCode.DEVICE_MAINTENANCE_CONTENT_DEL_FAIL)); |
| | | } catch (BaseException e) { |
| | | e.printStackTrace(); |
| | | return error(e); |
| | |
| | | SpringMVCContextHolder.getSystemLogger().error(String.valueOf(DeviceCode.SYSTEM_FORM_NODATA)); |
| | | return this.error(DeviceCode.SYSTEM_FORM_NODATA); |
| | | } |
| | | if (fse.getString(DeviceConst.DEVICE_NUMBER)==null && fse.getString(DeviceConst.UUID)==null) { |
| | | SpringMVCContextHolder.getSystemLogger().error(String.valueOf(DeviceCode.SYSTEM_FORM_NODATA)); |
| | | return this.error(DeviceCode.SYSTEM_FORM_NODATA); |
| | | } |
| | | String result=OK_List(deviceInspectionConfigService.findInspectionSettingForApp(fse)); |
| | | |
| | | // String result=result_OK_List(commonInspectionService.findDeviceSetting(fse.getString(DeviceConst.UUID))); |
| | | return result; |
| | | } catch (BaseException e) { |
| | | e.printStackTrace(); |
| | | return error(e); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | return error(DeviceCode.DEVICE_CREATE_INSPECTION_ERROR); |
| | | } |
| | | } |
| | | /** |
| | | * 设备点检记录 |
| | | * @throws IOException |
| | | */ |
| | | @RequestMapping(value = "/findDeviceInspection/{version}", method = RequestMethod.POST) |
| | | @ApiVersion(1) |
| | | public String findDevcInspection(HttpServletRequest request) { |
| | | |
| | | String result=result_OK_List(commonInspectionService.findDeviceSetting(fse.getString(DeviceConst.DEVICE_CODE))); |
| | | try { |
| | | FieldSetEntity fse = null; |
| | | Object bean = request.getAttribute(CoreConst.API_POST_REQUEST_DATA); |
| | | if (bean != null) { |
| | | RequestParameterEntity reqp = (RequestParameterEntity) bean; |
| | | fse = reqp.getFormData(); |
| | | } |
| | | if (bean == null || fse == null) { |
| | | SpringMVCContextHolder.getSystemLogger().error(String.valueOf(DeviceCode.SYSTEM_FORM_NODATA)); |
| | | return this.error(DeviceCode.SYSTEM_FORM_NODATA); |
| | | } |
| | | if (fse.getString(DeviceConst.DEVICE_NUMBER)==null && fse.getString(DeviceConst.UUID)==null) { |
| | | SpringMVCContextHolder.getSystemLogger().error(String.valueOf(DeviceCode.SYSTEM_FORM_NODATA)); |
| | | return this.error(DeviceCode.SYSTEM_FORM_NODATA); |
| | | } |
| | | String result=OK_List(deviceInspectionConfigService.findInspectionSettingForApp(fse)); |
| | | |
| | | // String result=result_OK_List(commonInspectionService.findDeviceSetting(fse.getString(DeviceConst.UUID))); |
| | | return result; |
| | | } catch (BaseException e) { |
| | | e.printStackTrace(); |
| | |
| | | return this.error(DeviceCode.SYSTEM_FORM_NODATA); |
| | | } |
| | | |
| | | String result=result_OK_List(deviceMainenanceService.findDeviceMaintenanceSetting(fse.getString(DeviceConst.DEVICE_CODE),fse.getString("type"))); |
| | | String result=result_OK_List(deviceMainenanceService.findDeviceMaintenanceSetting(fse.getString(DeviceConst.UUID),fse.getString("type"))); |
| | | return result; |
| | | } catch (BaseException e) { |
| | | e.printStackTrace(); |
| | |
| | | } |
| | | } |
| | | /** |
| | | * 设备保养配置 |
| | | * 设备点检信息保存 |
| | | * @throws IOException |
| | | */ |
| | | @RequestMapping(value = "/save-inspection/{version}", method = RequestMethod.POST) |
| | |
| | | return error(DeviceCode.DEVICE_CREATE_INSPECTION_ERROR); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 设备保养信息保存 |
| | | * @throws IOException |
| | | */ |
| | | @RequestMapping(value = "/save-maintenance/{version}", method = RequestMethod.POST) |
| | | @ApiVersion(1) |
| | | public String saveDevcieMaintenanceController(HttpServletRequest request) { |
| | | |
| | | try { |
| | | FieldSetEntity fse = null; |
| | | Object bean = request.getAttribute(CoreConst.API_POST_REQUEST_DATA); |
| | | if (bean != null) { |
| | | RequestParameterEntity reqp = (RequestParameterEntity) bean; |
| | | fse = reqp.getFormData(); |
| | | } |
| | | if (bean == null || fse == null) { |
| | | SpringMVCContextHolder.getSystemLogger().error(String.valueOf(DeviceCode.SYSTEM_FORM_NODATA)); |
| | | return this.error(DeviceCode.SYSTEM_FORM_NODATA); |
| | | } |
| | | IDeviceMaintenanceRecordService Service = (IDeviceMaintenanceRecordService) getProxyInstance(deviceMaintenanceRecordService); |
| | | String uuid=Service.saveMaintenanceDevice(fse); |
| | | if(uuid!=null) { |
| | | return this.OK_Add(uuid); |
| | | }else { |
| | | return error(DeviceCode.DEVICE_CREATE_INSPECTION_ERROR); |
| | | } |
| | | |
| | | } catch (BaseException e) { |
| | | e.printStackTrace(); |
| | | return error(e); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | return error(DeviceCode.DEVICE_CREATE_INSPECTION_ERROR); |
| | | } |
| | | } |
| | | |
| | | } |