ganzi-api/inventory-ent/src/main/java/com/rzyc/controller/EnterpriseEquipmentController.java

427 lines
18 KiB
Java
Raw Normal View History

package com.rzyc.controller;
import com.common.utils.model.Pager;
import com.common.utils.model.SingleResult;
import com.common.utils.pager.PageOperation;
import com.github.pagehelper.Page;
import com.rzyc.config.MethodAnnotation;
import com.rzyc.model.EntDevice;
import com.rzyc.model.EntDeviceType;
import com.rzyc.model.EntOperatingInstruction;
import com.rzyc.model.dto.*;
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.apache.ibatis.annotations.Param;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.stereotype.Controller;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
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
*/
@ApiOperation(value = "企业设备类型列表", notes = "企业设备类型列表")
@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);
}
/**
* 企业设备列表
* @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 Object entEquipmentList(@NotNull(message = "公司id不能为null") String enterpriseId, String typeId,Integer page,Integer pageSize)throws Exception{
return pcBusinessService.entEquipmentList(enterpriseId,typeId,page,pageSize);
}
/**
* 企业设备保养和维修检查记录统计
* @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);
}
/**
* 新增设备类型,修改设备类型
* @return 新增设备类型,修改设备类型
* @throws Exception
*/
@ApiOperation(value = "新增设备类型,修改设备类型", notes = "新增设备类型,修改设备类型")
@PostMapping(value = "/addOrUpdateEntEquipmentType")
@PreAuthorize("hasAnyAuthority('entEquipmentType:update')")
@MethodAnnotation(authorizations = {"entEquipmentType:update"},name = "新增设备类型,修改设备类型")
@ResponseBody
public SingleResult addOrUpdateEntEquipmentType(@RequestBody AddOrUpdateEntEquipmentTypeDto addOrUpdateEntEquipmentTypeDto)throws Exception{
return pcBusinessService.addOrUpdateEntEquipmentType(addOrUpdateEntEquipmentTypeDto);
}
/**
* 新增设备,修改设备
* @return 新增设备,修改设备
* @throws Exception
*/
@ApiOperation(value = "新增设备,修改设备", notes = "新增设备,修改设备")
@PostMapping(value = "/addOrUpdateEntEquipment")
@PreAuthorize("hasAnyAuthority('entEquipment:update')")
@MethodAnnotation(authorizations = {"entEquipment:update"},name = "新增设备,修改设备")
@ResponseBody
public SingleResult addOrUpdateEntEquipment(@RequestBody AddOrUpdateEntEquipmentDto addOrUpdateEntEquipmentDto)throws Exception{
return pcBusinessService.addOrUpdateEntEquipment(addOrUpdateEntEquipmentDto);
}
/**
* 设备周期巡检
* @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 Object deviceInspectionCycle(String inspectionName,Integer page,Integer pageSize)throws Exception{
return pcBusinessService.deviceInspectionCycle(inspectionName,page,pageSize);
}
/**
* 设备周期巡检-添加和修巡检项目
* @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 = "/addOrUpdateInspectionAddOrRecord")
@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 Object inspectionRecord(String inspectionRecordName,Integer page,Integer pageSize)throws Exception{
return pcBusinessService.selectInspectionRecord(inspectionRecordName,page,pageSize);
}
/**
* 备件列表
* @return 备件列表
* @throws Exception
**/
@ApiOperation(value = "备件列表", notes = "备件列表")
@GetMapping(value = "/sparePartList")
@PreAuthorize("hasAnyAuthority('sparePartList','sparePartList:update')")
@MethodAnnotation(authorizations = {"sparePartList","sparePartList:update"},name = "备件列表")
@ResponseBody
public Object sparePartList(String name,Integer page,Integer pageSize)throws Exception{
return pcBusinessService.sparePartList(name,page,pageSize);
}
/**
* 备件列表-新增和修改
* @return 备件列表-新增和修改
* @throws Exception
**/
@ApiOperation(value = "备件列表-新增和修改", notes = "备件列表-新增和修改")
@PostMapping(value = "/sparePartAddOrUpdate")
@PreAuthorize("hasAnyAuthority('sparePartList:update')")
@MethodAnnotation(authorizations = {"sparePartList:update"},name = "备件列表-新增和修改")
@ResponseBody
public SingleResult sparePartUpdate(SparePartDto sparePartDto)throws Exception{
return pcBusinessService.sparePartUpdate(sparePartDto);
}
/**
* 保养计划-新增和修改
* @return 保养计划-新增和修改
* @throws Exception
**/
@ApiOperation(value = "保养计划-新增和修改", notes = "保养计划-新增和修改")
@PostMapping(value = "/entDeviceMaintenancePlanAddOrUpdate")
@PreAuthorize("hasAnyAuthority('entDeviceMaintenancePlan:update')")
@MethodAnnotation(authorizations = {"entDeviceMaintenancePlan:update"},name = "保养计划-新增和修改")
@ResponseBody
public SingleResult entDeviceMaintenancePlanUpdate(EntDeviceMaintenancePlanDto deviceMaintenancePlanDto)throws Exception{
return pcBusinessService.entDeviceMaintenancePlanUpdate(deviceMaintenancePlanDto);
}
/**
* 保养计划列表
* @return 保养计划列表
* @throws Exception
**/
@ApiOperation(value = "保养计划列表", notes = "保养计划列表")
@GetMapping(value = "/entDeviceMaintenancePlan")
@PreAuthorize("hasAnyAuthority('entDeviceMaintenancePlan','entDeviceMaintenancePlan:update')")
@MethodAnnotation(authorizations = {"entDeviceMaintenancePlan","entDeviceMaintenancePlan:update"},name = "保养计划列表")
@ResponseBody
public Object entDeviceMaintenancePlan(Integer page,Integer pageSize)throws Exception{
return pcBusinessService.entDeviceMaintenancePlan(page,pageSize);
}
/**
* 保养记录-新增和修改
* @return 保养记录-新增和修改
* @throws Exception
**/
@ApiOperation(value = "保养记录-新增和修改", notes = "保养记录-新增和修改")
@PostMapping(value = "/entDeviceMaintenanceRecordAddOrUpdate")
@PreAuthorize("hasAnyAuthority('entDeviceMaintenanceRecord:update')")
@MethodAnnotation(authorizations = {"entDeviceMaintenanceRecord:update"},name = "保养记录-新增和修改")
@ResponseBody
public SingleResult entDeviceMaintenanceRecordUpdate(EntDeviceMaintenanceRecordDto entDeviceMaintenanceRecordDto)throws Exception{
return pcBusinessService.entDeviceMaintenanceRecordUpdate(entDeviceMaintenanceRecordDto);
}
/**
* 保养记录
* @return 保养记录
* @throws Exception
**/
@ApiOperation(value = "保养记录", notes = "保养记录")
@GetMapping(value = "/entDeviceMaintenanceRecord")
@PreAuthorize("hasAnyAuthority('entDeviceMaintenanceRecord','entDeviceMaintenanceRecord:update')")
@MethodAnnotation(authorizations = {"entDeviceMaintenanceRecord","entDeviceMaintenanceRecord:update"},name = "保养记录")
@ResponseBody
public SingleResult entDeviceMaintenanceRecord(Integer page,Integer pageSize)throws Exception{
return pcBusinessService.entDeviceMaintenanceRecord(page,pageSize);
}
/**
* 送检记录
* @return 送检记录
* @throws Exception
**/
@ApiOperation(value = "送检记录", notes = "送检记录")
@GetMapping(value = "/inspectionRecord")
@PreAuthorize("hasAnyAuthority('inspectionRecord','inspectionRecord:update')")
@MethodAnnotation(authorizations = {"inspectionRecord","inspectionRecord:update"},name = "送检记录")
@ResponseBody
public Object inspectionRecord(@Param("startTime") String startTime, @Param("endTime")String endTime,Integer page,Integer pageSize)throws Exception{
return pcBusinessService.inspectionRecord(startTime,endTime,page,pageSize);
}
/**
* 送检操作
* @return 送检操作
* @throws Exception
**/
@ApiOperation(value = "送检操作", notes = "送检操作")
@PostMapping(value = "/submitInspection")
@PreAuthorize("hasAnyAuthority('inspectionRecord:update')")
@MethodAnnotation(authorizations = {"inspectionRecord:update"},name = "送检操作")
@ResponseBody
public SingleResult submitInspection(InspectionRecordDto inspectionRecordDto)throws Exception{
return pcBusinessService.submitInspection(inspectionRecordDto);
}
/**
* 维修计划
* @return 维修计划
* @throws Exception
**/
@ApiOperation(value = "维修计划", notes = "维修计划")
@GetMapping(value = "/repairPlan")
@PreAuthorize("hasAnyAuthority('repairPlan','repairPlan:update')")
@MethodAnnotation(authorizations = {"repairPlan","repairPlan:update"},name = "维修计划")
@ResponseBody
public Object repairPlan(Integer page,Integer pageSize)throws Exception{
return pcBusinessService.repairPlan(page,pageSize);
}
/**
* 维修计划-新增,修改
* @return 维修计划-新增,修改
* @throws Exception
**/
@ApiOperation(value = "维修计划-新增,修改", notes = "维修计划-新增,修改")
@GetMapping(value = "/repairPlanAddOrUpdate")
@PreAuthorize("hasAnyAuthority('repairPlan:update')")
@MethodAnnotation(authorizations = {"repairPlan:update"},name = "维修计划-新增,修改")
@ResponseBody
public SingleResult repairPlanAddOrUpdate(EntRepairPlanDto entRepairPlanDto)throws Exception{
return pcBusinessService.repairPlanUpdate(entRepairPlanDto);
}
/**
* 维修记录
* @return 维修记录
* @throws Exception
**/
@ApiOperation(value = "维修记录", notes = "维修记录")
@GetMapping(value = "/repairRecord")
@PreAuthorize("hasAnyAuthority('repairRecord','repairRecord:update')")
@MethodAnnotation(authorizations = {"repairRecord","repairRecord:update"},name = "维修记录")
@ResponseBody
public Object repairRecord(Integer page,Integer pageSize)throws Exception{
return pcBusinessService.repairRecord(page,pageSize);
}
/**
* 报修记录
* @return 报修记录
* @throws Exception
**/
@ApiOperation(value = "报修记录", notes = "报修记录")
@GetMapping(value = "/reportRecord")
@PreAuthorize("hasAnyAuthority('reportRecord','reportRecord:update')")
@MethodAnnotation(authorizations = {"reportRecord","reportRecord:update"},name = "报修记录")
@ResponseBody
public Object reportRecord(Integer page,Integer pageSize)throws Exception{
return pcBusinessService.reportRecord(page,pageSize);
}
/**
* 新增报修
* @throws Exception
**/
@ApiOperation(value = "新增报修", notes = "新增报修")
@PostMapping(value = "/addOrUpdateReportRecord")
@PreAuthorize("hasAnyAuthority('reportRecord:update')")
@MethodAnnotation(authorizations = {"reportRecord:update"},name = "新增报修")
@ResponseBody
public SingleResult addOrUpdateReportRecord(@RequestBody ReportRecordDto reportRecordDto)throws Exception{
return pcBusinessService.addOrUpdateReportRecord(reportRecordDto);
}
/**
* 设备安标
*
* */
/**
* 操作规程
*
* */
@ApiOperation(value = "操作规程", notes = "操作规程")
@GetMapping(value = "/operatingInstructions")
@PreAuthorize("hasAnyAuthority('operatingInstructions','operatingInstructions:update')")
@MethodAnnotation(authorizations = {"operatingInstructions","operatingInstructions:update"},name = "操作规程")
@ResponseBody
public Object operatingInstructions(@RequestBody OperatingInstructionDto operatingInstructionDto)throws Exception{
return pcBusinessService.operatingInstructions(operatingInstructionDto);
}
/**
* 新增,修改操作规程
*
* */
@ApiOperation(value = "新增,修改操作规程", notes = "新增,修改操作规程")
@PostMapping(value = "/operatingInstructionsAddOrUpdate")
@PreAuthorize("hasAnyAuthority('operatingInstructions:update')")
@MethodAnnotation(authorizations = {"operatingInstructions:update"},name = "新增,修改操作规程")
@ResponseBody
public SingleResult operatingInstructionsAddOrUpdate(@RequestBody OperatingInstructionsDto operatingInstructionsDto)throws Exception{
return pcBusinessService.operatingInstructionsAddOrUpdate(operatingInstructionsDto);
}
}