| | |
| | | import com.product.device.service.CommonInspectionService; |
| | | import com.product.device.service.DeviceInspectionConfigService; |
| | | import com.product.device.service.DeviceMainenanceService; |
| | | import com.product.device.service.DeviceMaintenancePlanService; |
| | | import com.product.device.service.DeviceMaintenanceRecordService; |
| | | import com.product.device.service.DeviceManagerService; |
| | | import com.product.device.service.idel.IDeviceInspectionService; |
| | |
| | | @RestController |
| | | @RequestMapping("/api/mobile/device") |
| | | public class DeviceManagerController extends AbstractBaseController { |
| | | |
| | | |
| | | @Autowired |
| | | DeviceMaintenancePlanService deviceMaintenancePlanService; |
| | | @Autowired |
| | | DeviceManagerTaskService deviceManagerTaskService; |
| | | @Autowired |
| | |
| | | return this.error(DeviceCode.SYSTEM_FORM_NODATA); |
| | | } |
| | | |
| | | String result=result_OK_List(deviceMainenanceService.findDeviceMaintenanceSetting(fse.getString(DeviceConst.DEVICE_UUID),fse.getString("type"))); |
| | | String result=result_OK_List(deviceMainenanceService.findDeviceMaintenanceSetting(fse.getString(DeviceConst.DEVICE_UUID),fse.getString("type"),fse.getString("plan_uuid"))); |
| | | return result; |
| | | } catch (BaseException e) { |
| | | e.printStackTrace(); |
| | |
| | | return error(new BaseException(e)); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 保养人员领取保养任务 |
| | | * @throws IOException |
| | | */ |
| | | @RequestMapping(value = "/receive-task/{version}", method = RequestMethod.POST) |
| | | @ApiVersion(1) |
| | | public String receiveTask(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 || fse.getObject("plan_uuid")==null) { |
| | | SpringMVCContextHolder.getSystemLogger().error(String.valueOf(DeviceCode.SYSTEM_FORM_NODATA)); |
| | | return this.error(DeviceCode.SYSTEM_FORM_NODATA); |
| | | } |
| | | Object b= deviceMaintenancePlanService.receivePlanTask(fse.getString("plan_uuid")); |
| | | |
| | | return this.OK(); |
| | | |
| | | } catch (BaseException e) { |
| | | e.printStackTrace(); |
| | | return error(e); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | return error(new BaseException(e)); |
| | | } |
| | | } |
| | | /** |
| | | * 保养人员开始保养打卡,更新计划任务状态和电梯状态 |
| | | * |
| | | * @throws IOException |
| | | */ |
| | | @RequestMapping(value = "/status-update/{version}", method = RequestMethod.POST) |
| | | @ApiVersion(1) |
| | | public String statusUpdate(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 || (fse.getObject("plan_uuid")==null && fse.getObject("device_uuid")==null)) { |
| | | SpringMVCContextHolder.getSystemLogger().error(String.valueOf(DeviceCode.SYSTEM_FORM_NODATA)); |
| | | return this.error(DeviceCode.SYSTEM_FORM_NODATA); |
| | | } |
| | | |
| | | deviceMaintenancePlanService.statusUpdate(fse.getString("plan_uuid"),fse.getString("device_uuid"),fse.getString("maintenance_type")); |
| | | |
| | | return this.OK(); |
| | | |
| | | } catch (BaseException e) { |
| | | e.printStackTrace(); |
| | | return error(e); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | return error(new BaseException(e)); |
| | | } |
| | | } |
| | | } |