2022-10-18 17:32:45 +08:00
|
|
|
package com.rzyc.controller;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import com.common.utils.model.SingleResult;
|
|
|
|
|
import com.rzyc.config.MethodAnnotation;
|
|
|
|
|
import com.rzyc.model.EntDevice;
|
|
|
|
|
import com.rzyc.model.EntDeviceType;
|
2022-10-21 17:32:22 +08:00
|
|
|
import com.rzyc.model.dto.AddOrUpdateDeviceInspectionCycleDto;
|
2022-10-19 17:37:21 +08:00
|
|
|
import com.rzyc.model.dto.AddOrUpdateEntEquipmentDto;
|
2022-10-20 17:30:09 +08:00
|
|
|
import com.rzyc.model.dto.AddOrUpdateEntEquipmentTypeDto;
|
2022-10-21 17:32:22 +08:00
|
|
|
import com.rzyc.model.dto.AddOrUpdateInspectionRecordDto;
|
2022-10-18 17:32:45 +08:00
|
|
|
import com.rzyc.service.PcBusinessService;
|
|
|
|
|
import io.swagger.annotations.Api;
|
|
|
|
|
import io.swagger.annotations.ApiImplicitParam;
|
|
|
|
|
import io.swagger.annotations.ApiImplicitParams;
|
|
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
|
|
import org.springframework.stereotype.Controller;
|
|
|
|
|
import org.springframework.validation.annotation.Validated;
|
2022-10-20 17:30:09 +08:00
|
|
|
import org.springframework.web.bind.annotation.*;
|
2022-10-18 17:32:45 +08:00
|
|
|
|
|
|
|
|
import javax.validation.constraints.NotNull;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @author Xuwanxin
|
|
|
|
|
* @date 2022/10/18
|
|
|
|
|
*/
|
|
|
|
|
@Api(tags = "企业端设备模块接口")
|
|
|
|
|
@CrossOrigin("*")
|
|
|
|
|
@RequestMapping("equipment")
|
|
|
|
|
@Controller
|
|
|
|
|
@Validated
|
|
|
|
|
public class EnterpriseEquipmentController extends BaseController {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
PcBusinessService pcBusinessService;
|
|
|
|
|
|
|
|
|
|
public EnterpriseEquipmentController(PcBusinessService pcBusinessService) {
|
|
|
|
|
this.pcBusinessService = pcBusinessService;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 企业设备类型列表
|
|
|
|
|
* @param enterpriseId 企业id
|
|
|
|
|
* @return 企业设备类型列表
|
|
|
|
|
* @throws Exception
|
|
|
|
|
*/
|
2022-10-21 16:24:29 +08:00
|
|
|
/*@ApiOperation(value = "企业设备类型列表", notes = "企业设备类型列表")
|
2022-10-18 17:32:45 +08:00
|
|
|
@ApiImplicitParams({
|
|
|
|
|
@ApiImplicitParam(name = "enterpriseId", value = "公司id", required = true, dataType = "string")
|
|
|
|
|
})
|
|
|
|
|
@GetMapping(value = "/entEquipmentTypeList")
|
|
|
|
|
@PreAuthorize("hasAnyAuthority('entEquipmentTypeList','entEquipmentList:update')")
|
|
|
|
|
@MethodAnnotation(authorizations = {"entEquipmentTypeList","entEquipmentList:update"},name = "企业设备类型列表")
|
|
|
|
|
@ResponseBody
|
|
|
|
|
public SingleResult<List<EntDeviceType>> entEquipmentTypeList(@NotNull(message = "公司id不能为null") String enterpriseId)throws Exception{
|
|
|
|
|
return pcBusinessService.entEquipmentTypeList(enterpriseId);
|
2022-10-21 16:24:29 +08:00
|
|
|
}*/
|
2022-10-18 17:32:45 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 企业设备列表
|
|
|
|
|
* @param enterpriseId 企业id
|
|
|
|
|
* @param typeId 设备类型id
|
|
|
|
|
* @return 企业设备列表
|
|
|
|
|
* @throws Exception
|
|
|
|
|
*/
|
|
|
|
|
@ApiOperation(value = "企业设备列表", notes = "企业设备列表")
|
|
|
|
|
@ApiImplicitParams({
|
|
|
|
|
@ApiImplicitParam(name = "enterpriseId", value = "公司id", required = true, dataType = "string"),
|
|
|
|
|
@ApiImplicitParam(name = "typeId", value = "设备类型id", required = false, dataType = "string")
|
|
|
|
|
})
|
|
|
|
|
@GetMapping(value = "/entEquipmentList")
|
|
|
|
|
@PreAuthorize("hasAnyAuthority('entEquipmentList','entEquipmentList:update')")
|
|
|
|
|
@MethodAnnotation(authorizations = {"entEquipmentList","entEquipmentList:update"},name = "企业设备列表")
|
|
|
|
|
@ResponseBody
|
|
|
|
|
public SingleResult<List<EntDevice>> entEquipmentList(@NotNull(message = "公司id不能为null") String enterpriseId, String typeId)throws Exception{
|
|
|
|
|
return pcBusinessService.entEquipmentList(enterpriseId,typeId);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 企业设备保养和维修检查记录统计
|
|
|
|
|
* @param enterpriseId 企业id
|
|
|
|
|
* @param deviceId 设备id
|
|
|
|
|
* @return 企业设备列表
|
|
|
|
|
* @throws Exception
|
|
|
|
|
*/
|
|
|
|
|
@ApiOperation(value = "企业设备保养和维修检查记录统计", notes = "企业设备保养和维修检查记录统计")
|
|
|
|
|
@ApiImplicitParams({
|
|
|
|
|
@ApiImplicitParam(name = "enterpriseId", value = "公司id", required = true, dataType = "string"),
|
|
|
|
|
@ApiImplicitParam(name = "deviceId", value = "设备id", required = true, dataType = "string")
|
|
|
|
|
})
|
|
|
|
|
@GetMapping(value = "/entEquipmentStatistic")
|
|
|
|
|
@PreAuthorize("hasAnyAuthority('entEquipmentStatistic')")
|
|
|
|
|
@MethodAnnotation(authorizations = {"entEquipmentStatistic"},name = "企业设备保养和维修检查记录统计")
|
|
|
|
|
@ResponseBody
|
|
|
|
|
public SingleResult<List<EntDevice>> entEquipmentStatistic(@NotNull(message = "公司id不能为null") String enterpriseId, String deviceId)throws Exception{
|
|
|
|
|
return pcBusinessService.entEquipmentStatistic(enterpriseId,deviceId);
|
|
|
|
|
}
|
|
|
|
|
|
2022-10-20 17:30:09 +08:00
|
|
|
/**
|
|
|
|
|
* 新增设备类型,修改设备类型
|
|
|
|
|
* @return 新增设备类型,修改设备类型
|
|
|
|
|
* @throws Exception
|
|
|
|
|
*/
|
|
|
|
|
@ApiOperation(value = "新增设备类型,修改设备类型", notes = "新增设备类型,修改设备类型")
|
|
|
|
|
@PostMapping(value = "/addOrUpdateEntEquipmentType")
|
2022-10-21 17:32:22 +08:00
|
|
|
@PreAuthorize("hasAnyAuthority('entEquipmentType:update')")
|
|
|
|
|
@MethodAnnotation(authorizations = {"entEquipmentType:update"},name = "新增设备类型,修改设备类型")
|
2022-10-20 17:30:09 +08:00
|
|
|
@ResponseBody
|
|
|
|
|
public SingleResult addOrUpdateEntEquipmentType(@RequestBody AddOrUpdateEntEquipmentTypeDto addOrUpdateEntEquipmentTypeDto)throws Exception{
|
|
|
|
|
return pcBusinessService.addOrUpdateEntEquipmentType(addOrUpdateEntEquipmentTypeDto);
|
|
|
|
|
}
|
|
|
|
|
|
2022-10-19 17:37:21 +08:00
|
|
|
/**
|
|
|
|
|
* 新增设备,修改设备
|
|
|
|
|
* @return 新增设备,修改设备
|
|
|
|
|
* @throws Exception
|
|
|
|
|
*/
|
|
|
|
|
@ApiOperation(value = "新增设备,修改设备", notes = "新增设备,修改设备")
|
2022-10-20 17:30:09 +08:00
|
|
|
@PostMapping(value = "/addOrUpdateEntEquipment")
|
2022-10-21 17:32:22 +08:00
|
|
|
@PreAuthorize("hasAnyAuthority('entEquipment:update')")
|
|
|
|
|
@MethodAnnotation(authorizations = {"entEquipment:update"},name = "新增设备,修改设备")
|
2022-10-19 17:37:21 +08:00
|
|
|
@ResponseBody
|
2022-10-20 17:30:09 +08:00
|
|
|
public SingleResult addOrUpdateEntEquipment(@RequestBody AddOrUpdateEntEquipmentDto addOrUpdateEntEquipmentDto)throws Exception{
|
2022-10-19 17:37:21 +08:00
|
|
|
return pcBusinessService.addOrUpdateEntEquipment(addOrUpdateEntEquipmentDto);
|
|
|
|
|
}
|
|
|
|
|
|
2022-10-21 17:32:22 +08:00
|
|
|
/**
|
|
|
|
|
* 设备周期巡检
|
|
|
|
|
* @return 设备周期巡检
|
|
|
|
|
* @throws Exception
|
|
|
|
|
*/
|
|
|
|
|
@ApiOperation(value = "设备周期巡检", notes = "设备周期巡检")
|
|
|
|
|
@GetMapping(value = "/deviceInspectionCycle")
|
|
|
|
|
@PreAuthorize("hasAnyAuthority('deviceInspectionCycle','deviceInspectionCycle:update')")
|
|
|
|
|
@MethodAnnotation(authorizations = {"deviceInspectionCycle","deviceInspectionCycle:update'"},name = "设备维护周期")
|
|
|
|
|
@ApiImplicitParams({
|
|
|
|
|
@ApiImplicitParam(name = "inspectionName", value = "巡检名", required = false, dataType = "string")
|
|
|
|
|
})
|
|
|
|
|
@ResponseBody
|
|
|
|
|
public SingleResult deviceInspectionCycle(String inspectionName)throws Exception{
|
|
|
|
|
return pcBusinessService.deviceInspectionCycle(inspectionName);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 设备周期巡检-添加和修巡检项目
|
|
|
|
|
* @return 设备周期巡检-添加和修巡检项目
|
|
|
|
|
* @throws Exception
|
|
|
|
|
*/
|
|
|
|
|
@ApiOperation(value = "设备周期巡检-添加和修改巡检项目", notes = "设备周期巡检-添加和修巡检项目")
|
|
|
|
|
@PostMapping(value = "/addOrUpdateDeviceInspectionCycle")
|
|
|
|
|
@PreAuthorize("hasAnyAuthority('deviceInspectionCycle:update')")
|
|
|
|
|
@MethodAnnotation(authorizations = {"deviceInspectionCycle:update"},name = "设备周期巡检-添加和修巡检项目")
|
|
|
|
|
@ResponseBody
|
|
|
|
|
public SingleResult addOrUpdateDeviceInspectionCycle(@RequestBody AddOrUpdateDeviceInspectionCycleDto addOrUpdateDeviceInspectionCycleDto)throws Exception{
|
|
|
|
|
return pcBusinessService.addOrUpdateDeviceInspectionCycle(addOrUpdateDeviceInspectionCycleDto);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 设备巡检记录-添加和修改巡检记录
|
|
|
|
|
* @return 设备巡检记录-添加和修改巡检记录
|
|
|
|
|
* @throws Exception
|
|
|
|
|
*/
|
|
|
|
|
@ApiOperation(value = "设备巡检记录-添加和修改巡检记录", notes = "设备巡检记录-添加和修改巡检记录")
|
|
|
|
|
@PostMapping(value = "/addOrUpdateInspectionRecord")
|
|
|
|
|
@PreAuthorize("hasAnyAuthority('addOrUpdateInspectionRecord:update')")
|
|
|
|
|
@MethodAnnotation(authorizations = {"addOrUpdateInspectionRecord:update"},name = "设备巡检记录-添加和修改巡检记录")
|
|
|
|
|
@ResponseBody
|
|
|
|
|
public SingleResult addOrUpdateInspectionRecord(@RequestBody AddOrUpdateInspectionRecordDto addOrUpdateInspectionRecordDto)throws Exception{
|
|
|
|
|
return pcBusinessService.addOrUpdateInspectionRecord(addOrUpdateInspectionRecordDto);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 设备巡检记录
|
|
|
|
|
* @return 设备巡检记录
|
|
|
|
|
* @throws Exception
|
|
|
|
|
*/
|
|
|
|
|
@ApiOperation(value = "设备巡检记录", notes = "设备巡检记录")
|
|
|
|
|
@PostMapping(value = "/inspectionRecord")
|
|
|
|
|
@PreAuthorize("hasAnyAuthority('inspectionRecord,inspectionRecord:update')")
|
|
|
|
|
@MethodAnnotation(authorizations = {"inspectionRecord,inspectionRecord:update"},name = "设备巡检记录")
|
|
|
|
|
@ResponseBody
|
|
|
|
|
public SingleResult inspectionRecord(String inspectionRecordName)throws Exception{
|
|
|
|
|
return pcBusinessService.selectInspectionRecord(inspectionRecordName);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 备件列表
|
|
|
|
|
* @return 备件列表
|
|
|
|
|
* @throws Exception
|
|
|
|
|
*
|
|
|
|
|
**/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 备件列表-新增和修改
|
|
|
|
|
* @return 备件列表-新增和修改
|
|
|
|
|
* @throws Exception
|
|
|
|
|
*
|
|
|
|
|
**/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 保养计划
|
|
|
|
|
* @return 保养计划-新增和修改
|
|
|
|
|
* @throws Exception
|
|
|
|
|
*
|
|
|
|
|
**/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 保养计划列表
|
|
|
|
|
* @return 保养计划列表
|
|
|
|
|
* @throws Exception
|
|
|
|
|
*
|
|
|
|
|
**/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-10-19 17:37:21 +08:00
|
|
|
|
2022-10-18 17:32:45 +08:00
|
|
|
|
|
|
|
|
}
|