commit
parent
ddcc9bf9c1
commit
be560924b5
@ -0,0 +1,105 @@
|
||||
package cn.iocoder.yudao.module.iot.controller.admin.deviceattributetype;
|
||||
|
||||
import cn.iocoder.yudao.module.iot.dal.dataobject.devicemodel.DeviceModelDO;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import javax.validation.constraints.*;
|
||||
import javax.validation.*;
|
||||
import javax.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import cn.iocoder.yudao.module.iot.controller.admin.deviceattributetype.vo.*;
|
||||
import cn.iocoder.yudao.module.iot.dal.dataobject.deviceattributetype.DeviceAttributeTypeDO;
|
||||
import cn.iocoder.yudao.module.iot.service.deviceattributetype.DeviceAttributeTypeService;
|
||||
|
||||
@Tag(name = "管理后台 - 采集点分类")
|
||||
@RestController
|
||||
@RequestMapping("/iot/device-attribute-type")
|
||||
@Validated
|
||||
public class DeviceAttributeTypeController {
|
||||
|
||||
@Resource
|
||||
private DeviceAttributeTypeService deviceAttributeTypeService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建采集点分类")
|
||||
@PreAuthorize("@ss.hasPermission('iot:device-attribute-type:create')")
|
||||
public CommonResult<Long> createDeviceAttributeType(@Valid @RequestBody DeviceAttributeTypeSaveReqVO createReqVO) {
|
||||
return success(deviceAttributeTypeService.createDeviceAttributeType(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新采集点分类")
|
||||
@PreAuthorize("@ss.hasPermission('iot:device-attribute-type:update')")
|
||||
public CommonResult<Boolean> updateDeviceAttributeType(@Valid @RequestBody DeviceAttributeTypeSaveReqVO updateReqVO) {
|
||||
deviceAttributeTypeService.updateDeviceAttributeType(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除采集点分类")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('iot:device-attribute-type:delete')")
|
||||
public CommonResult<Boolean> deleteDeviceAttributeType(@RequestParam("id") Long id) {
|
||||
deviceAttributeTypeService.deleteDeviceAttributeType(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得采集点分类")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('iot:device-attribute-type:query')")
|
||||
public CommonResult<DeviceAttributeTypeRespVO> getDeviceAttributeType(@RequestParam("id") Long id) {
|
||||
DeviceAttributeTypeDO deviceAttributeType = deviceAttributeTypeService.getDeviceAttributeType(id);
|
||||
return success(BeanUtils.toBean(deviceAttributeType, DeviceAttributeTypeRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得采集点分类分页")
|
||||
@PreAuthorize("@ss.hasPermission('iot:device-attribute-type:query')")
|
||||
public CommonResult<PageResult<DeviceAttributeTypeRespVO>> getDeviceAttributeTypePage(@Valid DeviceAttributeTypePageReqVO pageReqVO) {
|
||||
PageResult<DeviceAttributeTypeDO> pageResult = deviceAttributeTypeService.getDeviceAttributeTypePage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, DeviceAttributeTypeRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出采集点分类 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('iot:device-attribute-type:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportDeviceAttributeTypeExcel(@Valid DeviceAttributeTypePageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<DeviceAttributeTypeDO> list = deviceAttributeTypeService.getDeviceAttributeTypePage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "采集点分类.xls", "数据", DeviceAttributeTypeRespVO.class,
|
||||
BeanUtils.toBean(list, DeviceAttributeTypeRespVO.class));
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/list")
|
||||
@Operation(summary = "获得采集点分类列表")
|
||||
public CommonResult<List<DeviceAttributeTypeDO>> getDeviceModelList() {
|
||||
List<DeviceAttributeTypeDO> deviceAttributeTypeDOList = deviceAttributeTypeService.getDeviceAttributeTypeList();
|
||||
return success(deviceAttributeTypeDOList);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,31 @@
|
||||
package cn.iocoder.yudao.module.iot.controller.admin.deviceattributetype.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 采集点分类分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class DeviceAttributeTypePageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "分类编码")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "分类名称", example = "张三")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "备注", example = "随便")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
||||
@ -0,0 +1,35 @@
|
||||
package cn.iocoder.yudao.module.iot.controller.admin.deviceattributetype.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import com.alibaba.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - 采集点分类 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class DeviceAttributeTypeRespVO {
|
||||
|
||||
@Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "23550")
|
||||
@ExcelProperty("ID")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "分类编码", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("分类编码")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "分类名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三")
|
||||
@ExcelProperty("分类名称")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "备注", example = "随便")
|
||||
@ExcelProperty("备注")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
@ -0,0 +1,26 @@
|
||||
package cn.iocoder.yudao.module.iot.controller.admin.deviceattributetype.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
@Schema(description = "管理后台 - 采集点分类新增/修改 Request VO")
|
||||
@Data
|
||||
public class DeviceAttributeTypeSaveReqVO {
|
||||
|
||||
@Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "23550")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "分类编码", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "分类编码不能为空")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "分类名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三")
|
||||
@NotEmpty(message = "分类名称不能为空")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "备注", example = "随便")
|
||||
private String remark;
|
||||
|
||||
}
|
||||
@ -0,0 +1,104 @@
|
||||
package cn.iocoder.yudao.module.iot.controller.admin.devicemodel;
|
||||
|
||||
import cn.iocoder.yudao.module.iot.dal.dataobject.deviceattributetype.DeviceAttributeTypeDO;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import javax.validation.constraints.*;
|
||||
import javax.validation.*;
|
||||
import javax.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import cn.iocoder.yudao.module.iot.controller.admin.devicemodel.vo.*;
|
||||
import cn.iocoder.yudao.module.iot.dal.dataobject.devicemodel.DeviceModelDO;
|
||||
import cn.iocoder.yudao.module.iot.service.devicemodel.DeviceModelService;
|
||||
|
||||
@Tag(name = "管理后台 - 采集设备模型")
|
||||
@RestController
|
||||
@RequestMapping("/iot/device-model")
|
||||
@Validated
|
||||
public class DeviceModelController {
|
||||
|
||||
@Resource
|
||||
private DeviceModelService deviceModelService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建采集设备模型")
|
||||
@PreAuthorize("@ss.hasPermission('iot:device-model:create')")
|
||||
public CommonResult<Long> createDeviceModel(@Valid @RequestBody DeviceModelSaveReqVO createReqVO) {
|
||||
return success(deviceModelService.createDeviceModel(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新采集设备模型")
|
||||
@PreAuthorize("@ss.hasPermission('iot:device-model:update')")
|
||||
public CommonResult<Boolean> updateDeviceModel(@Valid @RequestBody DeviceModelSaveReqVO updateReqVO) {
|
||||
deviceModelService.updateDeviceModel(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除采集设备模型")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('iot:device-model:delete')")
|
||||
public CommonResult<Boolean> deleteDeviceModel(@RequestParam("id") Long id) {
|
||||
deviceModelService.deleteDeviceModel(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得采集设备模型")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('iot:device-model:query')")
|
||||
public CommonResult<DeviceModelRespVO> getDeviceModel(@RequestParam("id") Long id) {
|
||||
DeviceModelDO deviceModel = deviceModelService.getDeviceModel(id);
|
||||
return success(BeanUtils.toBean(deviceModel, DeviceModelRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得采集设备模型分页")
|
||||
@PreAuthorize("@ss.hasPermission('iot:device-model:query')")
|
||||
public CommonResult<PageResult<DeviceModelRespVO>> getDeviceModelPage(@Valid DeviceModelPageReqVO pageReqVO) {
|
||||
PageResult<DeviceModelDO> pageResult = deviceModelService.getDeviceModelPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, DeviceModelRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出采集设备模型 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('iot:device-model:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportDeviceModelExcel(@Valid DeviceModelPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<DeviceModelDO> list = deviceModelService.getDeviceModelPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "采集设备模型.xls", "数据", DeviceModelRespVO.class,
|
||||
BeanUtils.toBean(list, DeviceModelRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/list")
|
||||
@Operation(summary = "获得采集设备模型列表")
|
||||
public CommonResult<List<DeviceModelDO>> getDeviceModelList() {
|
||||
List<DeviceModelDO> deviceModelDOList = deviceModelService.getDeviceModelList();
|
||||
return success(deviceModelDOList);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,34 @@
|
||||
package cn.iocoder.yudao.module.iot.controller.admin.devicemodel.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 采集设备模型分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class DeviceModelPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "分类编码")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "分类名称", example = "赵六")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "通讯协议")
|
||||
private String protocol;
|
||||
|
||||
@Schema(description = "备注", example = "你说的对")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
||||
@ -0,0 +1,39 @@
|
||||
package cn.iocoder.yudao.module.iot.controller.admin.devicemodel.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import com.alibaba.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - 采集设备模型 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class DeviceModelRespVO {
|
||||
|
||||
@Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "30028")
|
||||
@ExcelProperty("ID")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "分类编码", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("分类编码")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "分类名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "赵六")
|
||||
@ExcelProperty("分类名称")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "通讯协议", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("通讯协议")
|
||||
private String protocol;
|
||||
|
||||
@Schema(description = "备注", example = "你说的对")
|
||||
@ExcelProperty("备注")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
@ -0,0 +1,30 @@
|
||||
package cn.iocoder.yudao.module.iot.controller.admin.devicemodel.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
@Schema(description = "管理后台 - 采集设备模型新增/修改 Request VO")
|
||||
@Data
|
||||
public class DeviceModelSaveReqVO {
|
||||
|
||||
@Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "30028")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "分类编码", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "分类编码不能为空")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "分类名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "赵六")
|
||||
@NotEmpty(message = "分类名称不能为空")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "通讯协议", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "通讯协议不能为空")
|
||||
private String protocol;
|
||||
|
||||
@Schema(description = "备注", example = "你说的对")
|
||||
private String remark;
|
||||
|
||||
}
|
||||
@ -0,0 +1,95 @@
|
||||
package cn.iocoder.yudao.module.iot.controller.admin.devicemodelattribute;
|
||||
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import javax.validation.constraints.*;
|
||||
import javax.validation.*;
|
||||
import javax.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import cn.iocoder.yudao.module.iot.controller.admin.devicemodelattribute.vo.*;
|
||||
import cn.iocoder.yudao.module.iot.dal.dataobject.devicemodelattribute.DeviceModelAttributeDO;
|
||||
import cn.iocoder.yudao.module.iot.service.devicemodelattribute.DeviceModelAttributeService;
|
||||
|
||||
@Tag(name = "管理后台 - 采集设备模型-点位管理")
|
||||
@RestController
|
||||
@RequestMapping("/iot/device-model-attribute")
|
||||
@Validated
|
||||
public class DeviceModelAttributeController {
|
||||
|
||||
@Resource
|
||||
private DeviceModelAttributeService deviceModelAttributeService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建采集设备模型-点位管理")
|
||||
@PreAuthorize("@ss.hasPermission('iot:device-model-attribute:create')")
|
||||
public CommonResult<Long> createDeviceModelAttribute(@Valid @RequestBody DeviceModelAttributeSaveReqVO createReqVO) {
|
||||
return success(deviceModelAttributeService.createDeviceModelAttribute(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新采集设备模型-点位管理")
|
||||
@PreAuthorize("@ss.hasPermission('iot:device-model-attribute:update')")
|
||||
public CommonResult<Boolean> updateDeviceModelAttribute(@Valid @RequestBody DeviceModelAttributeSaveReqVO updateReqVO) {
|
||||
deviceModelAttributeService.updateDeviceModelAttribute(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除采集设备模型-点位管理")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('iot:device-model-attribute:delete')")
|
||||
public CommonResult<Boolean> deleteDeviceModelAttribute(@RequestParam("id") Long id) {
|
||||
deviceModelAttributeService.deleteDeviceModelAttribute(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得采集设备模型-点位管理")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('iot:device-model-attribute:query')")
|
||||
public CommonResult<DeviceModelAttributeRespVO> getDeviceModelAttribute(@RequestParam("id") Long id) {
|
||||
DeviceModelAttributeDO deviceModelAttribute = deviceModelAttributeService.getDeviceModelAttribute(id);
|
||||
return success(BeanUtils.toBean(deviceModelAttribute, DeviceModelAttributeRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得采集设备模型-点位管理分页")
|
||||
@PreAuthorize("@ss.hasPermission('iot:device-model-attribute:query')")
|
||||
public CommonResult<PageResult<DeviceModelAttributeRespVO>> getDeviceModelAttributePage(@Valid DeviceModelAttributePageReqVO pageReqVO) {
|
||||
PageResult<DeviceModelAttributeDO> pageResult = deviceModelAttributeService.getDeviceModelAttributePage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, DeviceModelAttributeRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出采集设备模型-点位管理 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('iot:device-model-attribute:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportDeviceModelAttributeExcel(@Valid DeviceModelAttributePageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<DeviceModelAttributeDO> list = deviceModelAttributeService.getDeviceModelAttributePage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "采集设备模型-点位管理.xls", "数据", DeviceModelAttributeRespVO.class,
|
||||
BeanUtils.toBean(list, DeviceModelAttributeRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,49 @@
|
||||
package cn.iocoder.yudao.module.iot.controller.admin.devicemodelattribute.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 采集设备模型-点位管理分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class DeviceModelAttributePageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "点位编码")
|
||||
private String attributeCode;
|
||||
|
||||
@Schema(description = "点位名称", example = "芋艿")
|
||||
private String attributeName;
|
||||
|
||||
@Schema(description = "点位类型", example = "1")
|
||||
private String attributeType;
|
||||
|
||||
@Schema(description = "数据类型", example = "2")
|
||||
private String dataType;
|
||||
|
||||
@Schema(description = "寄存器地址")
|
||||
private String address;
|
||||
|
||||
@Schema(description = "单位")
|
||||
private String dataUnit;
|
||||
|
||||
@Schema(description = "倍率")
|
||||
private Double ratio;
|
||||
|
||||
@Schema(description = "备注", example = "你说的对")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "采集设备模型id", example = "16848")
|
||||
private Long deviceModelId;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
||||
@ -0,0 +1,59 @@
|
||||
package cn.iocoder.yudao.module.iot.controller.admin.devicemodelattribute.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import com.alibaba.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - 采集设备模型-点位管理 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class DeviceModelAttributeRespVO {
|
||||
|
||||
@Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "18518")
|
||||
@ExcelProperty("ID")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "点位编码", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("点位编码")
|
||||
private String attributeCode;
|
||||
|
||||
@Schema(description = "点位名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿")
|
||||
@ExcelProperty("点位名称")
|
||||
private String attributeName;
|
||||
|
||||
@Schema(description = "点位类型", example = "1")
|
||||
@ExcelProperty("点位类型")
|
||||
private String attributeType;
|
||||
|
||||
@Schema(description = "数据类型", example = "2")
|
||||
@ExcelProperty("数据类型")
|
||||
private String dataType;
|
||||
|
||||
@Schema(description = "寄存器地址")
|
||||
@ExcelProperty("寄存器地址")
|
||||
private String address;
|
||||
|
||||
@Schema(description = "单位")
|
||||
@ExcelProperty("单位")
|
||||
private String dataUnit;
|
||||
|
||||
@Schema(description = "倍率")
|
||||
@ExcelProperty("倍率")
|
||||
private Double ratio;
|
||||
|
||||
@Schema(description = "备注", example = "你说的对")
|
||||
@ExcelProperty("备注")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "采集设备模型id", requiredMode = Schema.RequiredMode.REQUIRED, example = "16848")
|
||||
@ExcelProperty("采集设备模型id")
|
||||
private Long deviceModelId;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
@ -0,0 +1,45 @@
|
||||
package cn.iocoder.yudao.module.iot.controller.admin.devicemodelattribute.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
@Schema(description = "管理后台 - 采集设备模型-点位管理新增/修改 Request VO")
|
||||
@Data
|
||||
public class DeviceModelAttributeSaveReqVO {
|
||||
|
||||
@Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "18518")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "点位编码", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "点位编码不能为空")
|
||||
private String attributeCode;
|
||||
|
||||
@Schema(description = "点位名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿")
|
||||
@NotEmpty(message = "点位名称不能为空")
|
||||
private String attributeName;
|
||||
|
||||
@Schema(description = "点位类型", example = "1")
|
||||
private String attributeType;
|
||||
|
||||
@Schema(description = "数据类型", example = "2")
|
||||
private String dataType;
|
||||
|
||||
@Schema(description = "寄存器地址")
|
||||
private String address;
|
||||
|
||||
@Schema(description = "单位")
|
||||
private String dataUnit;
|
||||
|
||||
@Schema(description = "倍率")
|
||||
private Double ratio;
|
||||
|
||||
@Schema(description = "备注", example = "你说的对")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "采集设备模型id", requiredMode = Schema.RequiredMode.REQUIRED, example = "16848")
|
||||
@NotNull(message = "采集设备模型id不能为空")
|
||||
private Long deviceModelId;
|
||||
|
||||
}
|
||||
@ -0,0 +1,43 @@
|
||||
package cn.iocoder.yudao.module.iot.dal.dataobject.deviceattributetype;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
|
||||
/**
|
||||
* 采集点分类 DO
|
||||
*
|
||||
* @author 内蒙必硕
|
||||
*/
|
||||
@TableName("iot_device_attribute_type")
|
||||
@KeySequence("iot_device_attribute_type_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class DeviceAttributeTypeDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 分类编码
|
||||
*/
|
||||
private String code;
|
||||
/**
|
||||
* 分类名称
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
}
|
||||
@ -0,0 +1,47 @@
|
||||
package cn.iocoder.yudao.module.iot.dal.dataobject.devicemodel;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
|
||||
/**
|
||||
* 采集设备模型 DO
|
||||
*
|
||||
* @author 内蒙必硕
|
||||
*/
|
||||
@TableName("iot_device_model")
|
||||
@KeySequence("iot_device_model_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class DeviceModelDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 分类编码
|
||||
*/
|
||||
private String code;
|
||||
/**
|
||||
* 分类名称
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 通讯协议
|
||||
*/
|
||||
private String protocol;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
}
|
||||
@ -0,0 +1,67 @@
|
||||
package cn.iocoder.yudao.module.iot.dal.dataobject.devicemodelattribute;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
|
||||
/**
|
||||
* 采集设备模型-点位管理 DO
|
||||
*
|
||||
* @author 内蒙必硕
|
||||
*/
|
||||
@TableName("iot_device_model_attribute")
|
||||
@KeySequence("iot_device_model_attribute_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class DeviceModelAttributeDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 点位编码
|
||||
*/
|
||||
private String attributeCode;
|
||||
/**
|
||||
* 点位名称
|
||||
*/
|
||||
private String attributeName;
|
||||
/**
|
||||
* 点位类型
|
||||
*/
|
||||
private String attributeType;
|
||||
/**
|
||||
* 数据类型
|
||||
*/
|
||||
private String dataType;
|
||||
/**
|
||||
* 寄存器地址
|
||||
*/
|
||||
private String address;
|
||||
/**
|
||||
* 单位
|
||||
*/
|
||||
private String dataUnit;
|
||||
/**
|
||||
* 倍率
|
||||
*/
|
||||
private Double ratio;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
/**
|
||||
* 采集设备模型id
|
||||
*/
|
||||
private Long deviceModelId;
|
||||
|
||||
}
|
||||
@ -0,0 +1,33 @@
|
||||
package cn.iocoder.yudao.module.iot.dal.mysql.deviceattributetype;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.module.iot.dal.dataobject.deviceattributetype.DeviceAttributeTypeDO;
|
||||
import cn.iocoder.yudao.module.iot.dal.dataobject.devicemodel.DeviceModelDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import cn.iocoder.yudao.module.iot.controller.admin.deviceattributetype.vo.*;
|
||||
|
||||
/**
|
||||
* 采集点分类 Mapper
|
||||
*
|
||||
* @author 内蒙必硕
|
||||
*/
|
||||
@Mapper
|
||||
public interface DeviceAttributeTypeMapper extends BaseMapperX<DeviceAttributeTypeDO> {
|
||||
|
||||
default PageResult<DeviceAttributeTypeDO> selectPage(DeviceAttributeTypePageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<DeviceAttributeTypeDO>()
|
||||
.eqIfPresent(DeviceAttributeTypeDO::getCode, reqVO.getCode())
|
||||
.likeIfPresent(DeviceAttributeTypeDO::getName, reqVO.getName())
|
||||
.eqIfPresent(DeviceAttributeTypeDO::getRemark, reqVO.getRemark())
|
||||
.betweenIfPresent(DeviceAttributeTypeDO::getCreateTime, reqVO.getCreateTime())
|
||||
.orderByDesc(DeviceAttributeTypeDO::getId));
|
||||
}
|
||||
|
||||
default List<DeviceAttributeTypeDO> select() {
|
||||
return selectList();
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,34 @@
|
||||
package cn.iocoder.yudao.module.iot.dal.mysql.devicemodel;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.module.iot.dal.dataobject.devicemodel.DeviceModelDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import cn.iocoder.yudao.module.iot.controller.admin.devicemodel.vo.*;
|
||||
|
||||
/**
|
||||
* 采集设备模型 Mapper
|
||||
*
|
||||
* @author 内蒙必硕
|
||||
*/
|
||||
@Mapper
|
||||
public interface DeviceModelMapper extends BaseMapperX<DeviceModelDO> {
|
||||
|
||||
default PageResult<DeviceModelDO> selectPage(DeviceModelPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<DeviceModelDO>()
|
||||
.eqIfPresent(DeviceModelDO::getCode, reqVO.getCode())
|
||||
.likeIfPresent(DeviceModelDO::getName, reqVO.getName())
|
||||
.eqIfPresent(DeviceModelDO::getProtocol, reqVO.getProtocol())
|
||||
.eqIfPresent(DeviceModelDO::getRemark, reqVO.getRemark())
|
||||
.betweenIfPresent(DeviceModelDO::getCreateTime, reqVO.getCreateTime())
|
||||
.orderByDesc(DeviceModelDO::getId));
|
||||
}
|
||||
|
||||
default List<DeviceModelDO> select() {
|
||||
return selectList();
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,35 @@
|
||||
package cn.iocoder.yudao.module.iot.dal.mysql.devicemodelattribute;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.module.iot.dal.dataobject.devicemodelattribute.DeviceModelAttributeDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import cn.iocoder.yudao.module.iot.controller.admin.devicemodelattribute.vo.*;
|
||||
|
||||
/**
|
||||
* 采集设备模型-点位管理 Mapper
|
||||
*
|
||||
* @author 内蒙必硕
|
||||
*/
|
||||
@Mapper
|
||||
public interface DeviceModelAttributeMapper extends BaseMapperX<DeviceModelAttributeDO> {
|
||||
|
||||
default PageResult<DeviceModelAttributeDO> selectPage(DeviceModelAttributePageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<DeviceModelAttributeDO>()
|
||||
.eqIfPresent(DeviceModelAttributeDO::getAttributeCode, reqVO.getAttributeCode())
|
||||
.likeIfPresent(DeviceModelAttributeDO::getAttributeName, reqVO.getAttributeName())
|
||||
.eqIfPresent(DeviceModelAttributeDO::getAttributeType, reqVO.getAttributeType())
|
||||
.eqIfPresent(DeviceModelAttributeDO::getDataType, reqVO.getDataType())
|
||||
.eqIfPresent(DeviceModelAttributeDO::getAddress, reqVO.getAddress())
|
||||
.eqIfPresent(DeviceModelAttributeDO::getDataUnit, reqVO.getDataUnit())
|
||||
.eqIfPresent(DeviceModelAttributeDO::getRatio, reqVO.getRatio())
|
||||
.eqIfPresent(DeviceModelAttributeDO::getRemark, reqVO.getRemark())
|
||||
.eqIfPresent(DeviceModelAttributeDO::getDeviceModelId, reqVO.getDeviceModelId())
|
||||
.betweenIfPresent(DeviceModelAttributeDO::getCreateTime, reqVO.getCreateTime())
|
||||
.orderByDesc(DeviceModelAttributeDO::getId));
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,62 @@
|
||||
package cn.iocoder.yudao.module.iot.service.deviceattributetype;
|
||||
|
||||
import java.util.*;
|
||||
import javax.validation.*;
|
||||
import cn.iocoder.yudao.module.iot.controller.admin.deviceattributetype.vo.*;
|
||||
import cn.iocoder.yudao.module.iot.dal.dataobject.deviceattributetype.DeviceAttributeTypeDO;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.module.iot.dal.dataobject.devicemodel.DeviceModelDO;
|
||||
|
||||
/**
|
||||
* 采集点分类 Service 接口
|
||||
*
|
||||
* @author 内蒙必硕
|
||||
*/
|
||||
public interface DeviceAttributeTypeService {
|
||||
|
||||
/**
|
||||
* 创建采集点分类
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Long createDeviceAttributeType(@Valid DeviceAttributeTypeSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新采集点分类
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateDeviceAttributeType(@Valid DeviceAttributeTypeSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除采集点分类
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteDeviceAttributeType(Long id);
|
||||
|
||||
/**
|
||||
* 获得采集点分类
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 采集点分类
|
||||
*/
|
||||
DeviceAttributeTypeDO getDeviceAttributeType(Long id);
|
||||
|
||||
/**
|
||||
* 获得采集点分类分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 采集点分类分页
|
||||
*/
|
||||
PageResult<DeviceAttributeTypeDO> getDeviceAttributeTypePage(DeviceAttributeTypePageReqVO pageReqVO);
|
||||
|
||||
/**
|
||||
* 获得采集点分类列表
|
||||
*
|
||||
* @return 采集点分类列表
|
||||
*/
|
||||
List<DeviceAttributeTypeDO> getDeviceAttributeTypeList();
|
||||
}
|
||||
@ -0,0 +1,81 @@
|
||||
package cn.iocoder.yudao.module.iot.service.deviceattributetype;
|
||||
|
||||
import cn.iocoder.yudao.module.iot.dal.dataobject.devicemodelattribute.DeviceModelAttributeDO;
|
||||
import org.springframework.stereotype.Service;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.*;
|
||||
import cn.iocoder.yudao.module.iot.controller.admin.deviceattributetype.vo.*;
|
||||
import cn.iocoder.yudao.module.iot.dal.dataobject.deviceattributetype.DeviceAttributeTypeDO;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
|
||||
import cn.iocoder.yudao.module.iot.dal.mysql.deviceattributetype.DeviceAttributeTypeMapper;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.module.iot.enums.ErrorCodeConstants.*;
|
||||
|
||||
/**
|
||||
* 采集点分类 Service 实现类
|
||||
*
|
||||
* @author 内蒙必硕
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class DeviceAttributeTypeServiceImpl implements DeviceAttributeTypeService {
|
||||
|
||||
@Resource
|
||||
private DeviceAttributeTypeMapper deviceAttributeTypeMapper;
|
||||
|
||||
@Override
|
||||
public Long createDeviceAttributeType(DeviceAttributeTypeSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
DeviceAttributeTypeDO deviceAttributeType = BeanUtils.toBean(createReqVO, DeviceAttributeTypeDO.class);
|
||||
deviceAttributeTypeMapper.insert(deviceAttributeType);
|
||||
// 返回
|
||||
return deviceAttributeType.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateDeviceAttributeType(DeviceAttributeTypeSaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validateDeviceAttributeTypeExists(updateReqVO.getId());
|
||||
// 更新
|
||||
DeviceAttributeTypeDO updateObj = BeanUtils.toBean(updateReqVO, DeviceAttributeTypeDO.class);
|
||||
deviceAttributeTypeMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteDeviceAttributeType(Long id) {
|
||||
// 校验存在
|
||||
validateDeviceAttributeTypeExists(id);
|
||||
// 删除
|
||||
deviceAttributeTypeMapper.deleteById(id);
|
||||
}
|
||||
|
||||
private void validateDeviceAttributeTypeExists(Long id) {
|
||||
if (deviceAttributeTypeMapper.selectById(id) == null) {
|
||||
throw exception(DEVICE_ATTRIBUTE_TYPE_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public DeviceAttributeTypeDO getDeviceAttributeType(Long id) {
|
||||
return deviceAttributeTypeMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<DeviceAttributeTypeDO> getDeviceAttributeTypePage(DeviceAttributeTypePageReqVO pageReqVO) {
|
||||
return deviceAttributeTypeMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<DeviceAttributeTypeDO> getDeviceAttributeTypeList() {
|
||||
return deviceAttributeTypeMapper.selectList();
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,61 @@
|
||||
package cn.iocoder.yudao.module.iot.service.devicemodel;
|
||||
|
||||
import java.util.*;
|
||||
import javax.validation.*;
|
||||
import cn.iocoder.yudao.module.iot.controller.admin.devicemodel.vo.*;
|
||||
import cn.iocoder.yudao.module.iot.dal.dataobject.deviceattributetype.DeviceAttributeTypeDO;
|
||||
import cn.iocoder.yudao.module.iot.dal.dataobject.devicemodel.DeviceModelDO;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
|
||||
/**
|
||||
* 采集设备模型 Service 接口
|
||||
*
|
||||
* @author 内蒙必硕
|
||||
*/
|
||||
public interface DeviceModelService {
|
||||
|
||||
/**
|
||||
* 创建采集设备模型
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Long createDeviceModel(@Valid DeviceModelSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新采集设备模型
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateDeviceModel(@Valid DeviceModelSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除采集设备模型
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteDeviceModel(Long id);
|
||||
|
||||
/**
|
||||
* 获得采集设备模型
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 采集设备模型
|
||||
*/
|
||||
DeviceModelDO getDeviceModel(Long id);
|
||||
|
||||
/**
|
||||
* 获得采集设备模型分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 采集设备模型分页
|
||||
*/
|
||||
PageResult<DeviceModelDO> getDeviceModelPage(DeviceModelPageReqVO pageReqVO);
|
||||
/**
|
||||
* 获得采集设备模型列表
|
||||
*
|
||||
* @return 采集设备模型列表
|
||||
*/
|
||||
List<DeviceModelDO> getDeviceModelList();
|
||||
}
|
||||
@ -0,0 +1,80 @@
|
||||
package cn.iocoder.yudao.module.iot.service.devicemodel;
|
||||
|
||||
import cn.iocoder.yudao.module.iot.dal.dataobject.deviceattributetype.DeviceAttributeTypeDO;
|
||||
import org.springframework.stereotype.Service;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.*;
|
||||
import cn.iocoder.yudao.module.iot.controller.admin.devicemodel.vo.*;
|
||||
import cn.iocoder.yudao.module.iot.dal.dataobject.devicemodel.DeviceModelDO;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
|
||||
import cn.iocoder.yudao.module.iot.dal.mysql.devicemodel.DeviceModelMapper;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.module.iot.enums.ErrorCodeConstants.*;
|
||||
|
||||
/**
|
||||
* 采集设备模型 Service 实现类
|
||||
*
|
||||
* @author 内蒙必硕
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class DeviceModelServiceImpl implements DeviceModelService {
|
||||
|
||||
@Resource
|
||||
private DeviceModelMapper deviceModelMapper;
|
||||
|
||||
@Override
|
||||
public Long createDeviceModel(DeviceModelSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
DeviceModelDO deviceModel = BeanUtils.toBean(createReqVO, DeviceModelDO.class);
|
||||
deviceModelMapper.insert(deviceModel);
|
||||
// 返回
|
||||
return deviceModel.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateDeviceModel(DeviceModelSaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validateDeviceModelExists(updateReqVO.getId());
|
||||
// 更新
|
||||
DeviceModelDO updateObj = BeanUtils.toBean(updateReqVO, DeviceModelDO.class);
|
||||
deviceModelMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteDeviceModel(Long id) {
|
||||
// 校验存在
|
||||
validateDeviceModelExists(id);
|
||||
// 删除
|
||||
deviceModelMapper.deleteById(id);
|
||||
}
|
||||
|
||||
private void validateDeviceModelExists(Long id) {
|
||||
if (deviceModelMapper.selectById(id) == null) {
|
||||
throw exception(DEVICE_MODEL_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public DeviceModelDO getDeviceModel(Long id) {
|
||||
return deviceModelMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<DeviceModelDO> getDeviceModelPage(DeviceModelPageReqVO pageReqVO) {
|
||||
return deviceModelMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DeviceModelDO> getDeviceModelList() {
|
||||
return deviceModelMapper.selectList();
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,55 @@
|
||||
package cn.iocoder.yudao.module.iot.service.devicemodelattribute;
|
||||
|
||||
import java.util.*;
|
||||
import javax.validation.*;
|
||||
import cn.iocoder.yudao.module.iot.controller.admin.devicemodelattribute.vo.*;
|
||||
import cn.iocoder.yudao.module.iot.dal.dataobject.devicemodelattribute.DeviceModelAttributeDO;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
|
||||
/**
|
||||
* 采集设备模型-点位管理 Service 接口
|
||||
*
|
||||
* @author 内蒙必硕
|
||||
*/
|
||||
public interface DeviceModelAttributeService {
|
||||
|
||||
/**
|
||||
* 创建采集设备模型-点位管理
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Long createDeviceModelAttribute(@Valid DeviceModelAttributeSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新采集设备模型-点位管理
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateDeviceModelAttribute(@Valid DeviceModelAttributeSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除采集设备模型-点位管理
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteDeviceModelAttribute(Long id);
|
||||
|
||||
/**
|
||||
* 获得采集设备模型-点位管理
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 采集设备模型-点位管理
|
||||
*/
|
||||
DeviceModelAttributeDO getDeviceModelAttribute(Long id);
|
||||
|
||||
/**
|
||||
* 获得采集设备模型-点位管理分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 采集设备模型-点位管理分页
|
||||
*/
|
||||
PageResult<DeviceModelAttributeDO> getDeviceModelAttributePage(DeviceModelAttributePageReqVO pageReqVO);
|
||||
|
||||
}
|
||||
@ -0,0 +1,77 @@
|
||||
package cn.iocoder.yudao.module.iot.service.devicemodelattribute;
|
||||
|
||||
import cn.iocoder.yudao.module.iot.dal.dataobject.deviceattributetype.DeviceAttributeTypeDO;
|
||||
import cn.iocoder.yudao.module.iot.dal.dataobject.devicemodel.DeviceModelDO;
|
||||
import org.springframework.stereotype.Service;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.*;
|
||||
import cn.iocoder.yudao.module.iot.controller.admin.devicemodelattribute.vo.*;
|
||||
import cn.iocoder.yudao.module.iot.dal.dataobject.devicemodelattribute.DeviceModelAttributeDO;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
|
||||
import cn.iocoder.yudao.module.iot.dal.mysql.devicemodelattribute.DeviceModelAttributeMapper;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.module.iot.enums.ErrorCodeConstants.*;
|
||||
|
||||
/**
|
||||
* 采集设备模型-点位管理 Service 实现类
|
||||
*
|
||||
* @author 内蒙必硕
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class DeviceModelAttributeServiceImpl implements DeviceModelAttributeService {
|
||||
|
||||
@Resource
|
||||
private DeviceModelAttributeMapper deviceModelAttributeMapper;
|
||||
|
||||
@Override
|
||||
public Long createDeviceModelAttribute(DeviceModelAttributeSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
DeviceModelAttributeDO deviceModelAttribute = BeanUtils.toBean(createReqVO, DeviceModelAttributeDO.class);
|
||||
deviceModelAttributeMapper.insert(deviceModelAttribute);
|
||||
// 返回
|
||||
return deviceModelAttribute.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateDeviceModelAttribute(DeviceModelAttributeSaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validateDeviceModelAttributeExists(updateReqVO.getId());
|
||||
// 更新
|
||||
DeviceModelAttributeDO updateObj = BeanUtils.toBean(updateReqVO, DeviceModelAttributeDO.class);
|
||||
deviceModelAttributeMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteDeviceModelAttribute(Long id) {
|
||||
// 校验存在
|
||||
validateDeviceModelAttributeExists(id);
|
||||
// 删除
|
||||
deviceModelAttributeMapper.deleteById(id);
|
||||
}
|
||||
|
||||
private void validateDeviceModelAttributeExists(Long id) {
|
||||
if (deviceModelAttributeMapper.selectById(id) == null) {
|
||||
throw exception(DEVICE_MODEL_ATTRIBUTE_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public DeviceModelAttributeDO getDeviceModelAttribute(Long id) {
|
||||
return deviceModelAttributeMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<DeviceModelAttributeDO> getDeviceModelAttributePage(DeviceModelAttributePageReqVO pageReqVO) {
|
||||
return deviceModelAttributeMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,55 @@
|
||||
package cn.iocoder.yudao.module.mes.controller.admin.energydevice;
|
||||
|
||||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
import cn.iocoder.yudao.module.mes.controller.admin.energydevice.vo.*;
|
||||
import cn.iocoder.yudao.module.mes.controller.admin.energytype.vo.EnergyTypePageReqVO;
|
||||
import cn.iocoder.yudao.module.mes.controller.admin.energytype.vo.EnergyTypeRespVO;
|
||||
import cn.iocoder.yudao.module.mes.dal.dataobject.energydevice.EnergyDeviceCheckRecordDO;
|
||||
import cn.iocoder.yudao.module.mes.dal.dataobject.energydevice.EnergyDeviceReportDO;
|
||||
import cn.iocoder.yudao.module.mes.dal.dataobject.energytype.EnergyTypeDO;
|
||||
import cn.iocoder.yudao.module.mes.service.energydevice.EnergyDeviceReportService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.Valid;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.EXPORT;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
@Tag(name = "管理后台 - 能耗报表")
|
||||
@RestController
|
||||
@RequestMapping("/mes/energy-report")
|
||||
@Validated
|
||||
public class EnergyDeviceReportController {
|
||||
|
||||
@Resource
|
||||
private EnergyDeviceReportService energyDeviceReportService;
|
||||
|
||||
// @PostMapping("/create")
|
||||
// @Operation(summary = "创建能源报表")
|
||||
// @PreAuthorize("@ss.hasPermission('mes:energy-device-report:create')")
|
||||
// public CommonResult<Long> createEnergyDeviceReport(@Valid @RequestBody EnergyDeviceReportSaveReqVO createReqVO) {
|
||||
// return success(energyDeviceReportService.createEnergyReportRecord(createReqVO));
|
||||
// }
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得抄表记录分页")
|
||||
@PreAuthorize("@ss.hasPermission('mes:energy-device-report:query')")
|
||||
public CommonResult<PageResult<EnergyDeviceReportRespVO>> getEnergyDeviceReportPage(@Valid EnergyDeviceReportPageReqVO pageReqVO) {
|
||||
PageResult<EnergyDeviceReportDO> pageResult = energyDeviceReportService.getEnergyDeviceReportPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, EnergyDeviceReportRespVO.class));
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,66 @@
|
||||
package cn.iocoder.yudao.module.mes.controller.admin.energydevice.vo;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 能源设备分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class EnergyDeviceReportPageReqVO extends PageParam {
|
||||
|
||||
|
||||
@Schema(description = "名称", example = "芋艿")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "编码")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "表ID", example = "1")
|
||||
private Long deviceId;
|
||||
|
||||
@Schema(description = "表名称", example = "水")
|
||||
private String deviceName;
|
||||
|
||||
@Schema(description = "能耗类型ID", example = "1")
|
||||
private Long deviceTypeId;
|
||||
|
||||
@Schema(description = "能耗类型名称", example = "水")
|
||||
private String deviceTypeName;
|
||||
|
||||
@Schema(description = "所属区域ID", example = "1")
|
||||
private Long orgId;
|
||||
|
||||
@Schema(description = "所属区域名称", example = "车间1")
|
||||
private String orgName;
|
||||
|
||||
@Schema(description = "消耗量", example = "1000")
|
||||
private String value;
|
||||
|
||||
@Schema(description = "单位", example = "1000")
|
||||
private String unitName;
|
||||
|
||||
@Schema(description = "计算规则", example = "车间1")
|
||||
private String rules;
|
||||
|
||||
@Schema(description = "开始时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] startTime;
|
||||
|
||||
@Schema(description = "结束时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime endTime;
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,71 @@
|
||||
package cn.iocoder.yudao.module.mes.controller.admin.energydevice.vo;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - 能耗报表 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class EnergyDeviceReportRespVO {
|
||||
|
||||
@Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "13646")
|
||||
@ExcelProperty("ID")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "名称", example = "芋艿")
|
||||
@ExcelProperty("名称")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "编码")
|
||||
@ExcelProperty("编码")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "表ID", example = "1")
|
||||
@ExcelProperty("能耗类型ID")
|
||||
private Long deviceId;
|
||||
|
||||
@Schema(description = "表名称", example = "水")
|
||||
@ExcelProperty("能耗类型名称")
|
||||
private String deviceName;
|
||||
|
||||
@Schema(description = "能耗类型ID", example = "1")
|
||||
@ExcelProperty("能耗类型ID")
|
||||
private Long deviceTypeId;
|
||||
|
||||
@Schema(description = "能耗类型名称", example = "水")
|
||||
@ExcelProperty("能耗类型名称")
|
||||
private String deviceTypeName;
|
||||
|
||||
@Schema(description = "所属区域ID", example = "1")
|
||||
@ExcelProperty("所属区域ID")
|
||||
private Long orgId;
|
||||
|
||||
@Schema(description = "所属区域名称", example = "车间1")
|
||||
@ExcelProperty("所属区域名称")
|
||||
private String orgName;
|
||||
|
||||
@Schema(description = "消耗量", example = "1000")
|
||||
@ExcelProperty("消耗量")
|
||||
private String value;
|
||||
|
||||
@Schema(description = "单位", example = "1000")
|
||||
@ExcelProperty("单位")
|
||||
private String unitName;
|
||||
|
||||
@Schema(description = "计算规则", example = "车间1")
|
||||
@ExcelProperty("计算规则")
|
||||
private String rules;
|
||||
|
||||
@Schema(description = "开始时间")
|
||||
@ExcelProperty("开始时间")
|
||||
private LocalDateTime startTime;
|
||||
|
||||
@Schema(description = "结束时间")
|
||||
@ExcelProperty("结束时间")
|
||||
private LocalDateTime endTime;
|
||||
}
|
||||
@ -0,0 +1,57 @@
|
||||
package cn.iocoder.yudao.module.mes.controller.admin.energydevice.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - 能耗报表新增/修改 Request VO")
|
||||
@Data
|
||||
public class EnergyDeviceReportSaveReqVO {
|
||||
|
||||
@Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "13646")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "名称", example = "芋艿")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "编码")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "表ID", example = "1")
|
||||
private Long deviceId;
|
||||
|
||||
@Schema(description = "表名称", example = "水")
|
||||
private String deviceName;
|
||||
|
||||
@Schema(description = "能耗类型ID", example = "1")
|
||||
private Long deviceTypeId;
|
||||
|
||||
@Schema(description = "能耗类型名称", example = "水")
|
||||
private String deviceTypeName;
|
||||
|
||||
@Schema(description = "所属区域ID", example = "1")
|
||||
private Long orgId;
|
||||
|
||||
@Schema(description = "所属区域名称", example = "车间1")
|
||||
private String orgName;
|
||||
|
||||
@Schema(description = "消耗量", example = "1000")
|
||||
private String value;
|
||||
|
||||
@Schema(description = "单位", example = "1000")
|
||||
private String unitName;
|
||||
|
||||
@Schema(description = "计算规则", example = "车间1")
|
||||
private String rules;
|
||||
|
||||
@Schema(description = "开始时间")
|
||||
private LocalDateTime startTime;
|
||||
|
||||
@Schema(description = "结束时间")
|
||||
private LocalDateTime endTime;
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,104 @@
|
||||
package cn.iocoder.yudao.module.mes.controller.admin.energytype;
|
||||
|
||||
import cn.iocoder.yudao.module.iot.dal.dataobject.devicemodel.DeviceModelDO;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import javax.validation.constraints.*;
|
||||
import javax.validation.*;
|
||||
import javax.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import cn.iocoder.yudao.module.mes.controller.admin.energytype.vo.*;
|
||||
import cn.iocoder.yudao.module.mes.dal.dataobject.energytype.EnergyTypeDO;
|
||||
import cn.iocoder.yudao.module.mes.service.energytype.EnergyTypeService;
|
||||
|
||||
@Tag(name = "管理后台 - 能耗类型")
|
||||
@RestController
|
||||
@RequestMapping("/mes/energy-type")
|
||||
@Validated
|
||||
public class EnergyTypeController {
|
||||
|
||||
@Resource
|
||||
private EnergyTypeService energyTypeService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建能耗类型")
|
||||
@PreAuthorize("@ss.hasPermission('mes:energy-type:create')")
|
||||
public CommonResult<Long> createEnergyType(@Valid @RequestBody EnergyTypeSaveReqVO createReqVO) {
|
||||
return success(energyTypeService.createEnergyType(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新能耗类型")
|
||||
@PreAuthorize("@ss.hasPermission('mes:energy-type:update')")
|
||||
public CommonResult<Boolean> updateEnergyType(@Valid @RequestBody EnergyTypeSaveReqVO updateReqVO) {
|
||||
energyTypeService.updateEnergyType(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除能耗类型")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('mes:energy-type:delete')")
|
||||
public CommonResult<Boolean> deleteEnergyType(@RequestParam("id") Long id) {
|
||||
energyTypeService.deleteEnergyType(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得能耗类型")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('mes:energy-type:query')")
|
||||
public CommonResult<EnergyTypeRespVO> getEnergyType(@RequestParam("id") Long id) {
|
||||
EnergyTypeDO energyType = energyTypeService.getEnergyType(id);
|
||||
return success(BeanUtils.toBean(energyType, EnergyTypeRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得能耗类型分页")
|
||||
@PreAuthorize("@ss.hasPermission('mes:energy-type:query')")
|
||||
public CommonResult<PageResult<EnergyTypeRespVO>> getEnergyTypePage(@Valid EnergyTypePageReqVO pageReqVO) {
|
||||
PageResult<EnergyTypeDO> pageResult = energyTypeService.getEnergyTypePage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, EnergyTypeRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出能耗类型 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('mes:energy-type:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportEnergyTypeExcel(@Valid EnergyTypePageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<EnergyTypeDO> list = energyTypeService.getEnergyTypePage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "能耗类型.xls", "数据", EnergyTypeRespVO.class,
|
||||
BeanUtils.toBean(list, EnergyTypeRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/list")
|
||||
@Operation(summary = "获得能耗类型列表")
|
||||
public CommonResult<List<EnergyTypeDO>> getEnergyTypeDOList() {
|
||||
List<EnergyTypeDO> energyTypeDOList = energyTypeService.getEnergyTypeList();
|
||||
return success(energyTypeDOList);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,39 @@
|
||||
package cn.iocoder.yudao.module.mes.controller.admin.energytype.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 能耗类型分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class EnergyTypePageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "能耗类型编码")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "能耗类型名称", example = "张三")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "单位")
|
||||
private String unit;
|
||||
|
||||
@Schema(description = "是否启用")
|
||||
private Boolean isEnable;
|
||||
|
||||
@Schema(description = "备注", example = "随便")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,43 @@
|
||||
package cn.iocoder.yudao.module.mes.controller.admin.energytype.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import com.alibaba.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - 能耗类型 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class EnergyTypeRespVO {
|
||||
|
||||
@Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "19123")
|
||||
@ExcelProperty("ID")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "能耗类型编码", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("能耗类型编码")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "能耗类型名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三")
|
||||
@ExcelProperty("能耗类型名称")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "单位", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("单位")
|
||||
private String unit;
|
||||
|
||||
@Schema(description = "是否启用", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("是否启用")
|
||||
private Boolean isEnable;
|
||||
|
||||
@Schema(description = "备注", example = "随便")
|
||||
@ExcelProperty("备注")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
@ -0,0 +1,35 @@
|
||||
package cn.iocoder.yudao.module.mes.controller.admin.energytype.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
@Schema(description = "管理后台 - 能耗类型新增/修改 Request VO")
|
||||
@Data
|
||||
public class EnergyTypeSaveReqVO {
|
||||
|
||||
@Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "19123")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "能耗类型编码", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "能耗类型编码不能为空")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "能耗类型名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三")
|
||||
@NotEmpty(message = "能耗类型名称不能为空")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "单位", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "单位不能为空")
|
||||
private String unit;
|
||||
|
||||
@Schema(description = "是否启用", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "是否启用不能为空")
|
||||
private Boolean isEnable;
|
||||
|
||||
@Schema(description = "备注", example = "随便")
|
||||
private String remark;
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,95 @@
|
||||
package cn.iocoder.yudao.module.mes.controller.admin.moldget;
|
||||
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import javax.validation.constraints.*;
|
||||
import javax.validation.*;
|
||||
import javax.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import cn.iocoder.yudao.module.mes.controller.admin.moldget.vo.*;
|
||||
import cn.iocoder.yudao.module.mes.dal.dataobject.moldget.MoldGetDO;
|
||||
import cn.iocoder.yudao.module.mes.service.moldget.MoldGetService;
|
||||
|
||||
@Tag(name = "管理后台 - 模具管理-领模申请")
|
||||
@RestController
|
||||
@RequestMapping("/mes/mold-get")
|
||||
@Validated
|
||||
public class MoldGetController {
|
||||
|
||||
@Resource
|
||||
private MoldGetService moldGetService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建模具管理-领模申请")
|
||||
@PreAuthorize("@ss.hasPermission('mes:mold-get:create')")
|
||||
public CommonResult<Long> createMoldGet(@Valid @RequestBody MoldGetSaveReqVO createReqVO) {
|
||||
return success(moldGetService.createMoldGet(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新模具管理-领模申请")
|
||||
@PreAuthorize("@ss.hasPermission('mes:mold-get:update')")
|
||||
public CommonResult<Boolean> updateMoldGet(@Valid @RequestBody MoldGetSaveReqVO updateReqVO) {
|
||||
moldGetService.updateMoldGet(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除模具管理-领模申请")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('mes:mold-get:delete')")
|
||||
public CommonResult<Boolean> deleteMoldGet(@RequestParam("id") Long id) {
|
||||
moldGetService.deleteMoldGet(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得模具管理-领模申请")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('mes:mold-get:query')")
|
||||
public CommonResult<MoldGetRespVO> getMoldGet(@RequestParam("id") Long id) {
|
||||
MoldGetDO moldGet = moldGetService.getMoldGet(id);
|
||||
return success(BeanUtils.toBean(moldGet, MoldGetRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得模具管理-领模申请分页")
|
||||
@PreAuthorize("@ss.hasPermission('mes:mold-get:query')")
|
||||
public CommonResult<PageResult<MoldGetRespVO>> getMoldGetPage(@Valid MoldGetPageReqVO pageReqVO) {
|
||||
PageResult<MoldGetDO> pageResult = moldGetService.getMoldGetPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, MoldGetRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出模具管理-领模申请 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('mes:mold-get:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportMoldGetExcel(@Valid MoldGetPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<MoldGetDO> list = moldGetService.getMoldGetPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "模具管理-领模申请.xls", "数据", MoldGetRespVO.class,
|
||||
BeanUtils.toBean(list, MoldGetRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,53 @@
|
||||
package cn.iocoder.yudao.module.mes.controller.admin.moldget.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 模具管理-领模申请分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class MoldGetPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "领模单号", example = "2476")
|
||||
private Long orderId;
|
||||
|
||||
@Schema(description = "模具编码")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "模具名称", example = "张三")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "状态")
|
||||
private String state;
|
||||
|
||||
@Schema(description = "领模人")
|
||||
private String person;
|
||||
|
||||
@Schema(description = "设备id", example = "1850")
|
||||
private Long deviceId;
|
||||
|
||||
@Schema(description = "设备名称", example = "李四")
|
||||
private String deviceName;
|
||||
|
||||
@Schema(description = "领取时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] getTime;
|
||||
|
||||
@Schema(description = "库管员")
|
||||
private String principal;
|
||||
|
||||
@Schema(description = "备注", example = "你猜")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
||||
@ -0,0 +1,63 @@
|
||||
package cn.iocoder.yudao.module.mes.controller.admin.moldget.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import com.alibaba.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - 模具管理-领模申请 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class MoldGetRespVO {
|
||||
|
||||
@Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "4831")
|
||||
@ExcelProperty("ID")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "领模单号", requiredMode = Schema.RequiredMode.REQUIRED, example = "2476")
|
||||
@ExcelProperty("领模单号")
|
||||
private Long orderId;
|
||||
|
||||
@Schema(description = "模具编码", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("模具编码")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "模具名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三")
|
||||
@ExcelProperty("模具名称")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "状态", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("状态")
|
||||
private String state;
|
||||
|
||||
@Schema(description = "领模人")
|
||||
@ExcelProperty("领模人")
|
||||
private String person;
|
||||
|
||||
@Schema(description = "设备id", example = "1850")
|
||||
@ExcelProperty("设备id")
|
||||
private Long deviceId;
|
||||
|
||||
@Schema(description = "设备名称", example = "李四")
|
||||
@ExcelProperty("设备名称")
|
||||
private String deviceName;
|
||||
|
||||
@Schema(description = "领取时间")
|
||||
@ExcelProperty("领取时间")
|
||||
private LocalDateTime getTime;
|
||||
|
||||
@Schema(description = "库管员")
|
||||
@ExcelProperty("库管员")
|
||||
private String principal;
|
||||
|
||||
@Schema(description = "备注", example = "你猜")
|
||||
@ExcelProperty("备注")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
@ -0,0 +1,51 @@
|
||||
package cn.iocoder.yudao.module.mes.controller.admin.moldget.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import javax.validation.constraints.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - 模具管理-领模申请新增/修改 Request VO")
|
||||
@Data
|
||||
public class MoldGetSaveReqVO {
|
||||
|
||||
@Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "4831")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "领模单号", requiredMode = Schema.RequiredMode.REQUIRED, example = "2476")
|
||||
@NotNull(message = "领模单号不能为空")
|
||||
private Long orderId;
|
||||
|
||||
@Schema(description = "模具编码", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "模具编码不能为空")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "模具名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三")
|
||||
@NotEmpty(message = "模具名称不能为空")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "状态", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "状态不能为空")
|
||||
private String state;
|
||||
|
||||
@Schema(description = "领模人")
|
||||
private String person;
|
||||
|
||||
@Schema(description = "设备id", example = "1850")
|
||||
private Long deviceId;
|
||||
|
||||
@Schema(description = "设备名称", example = "李四")
|
||||
private String deviceName;
|
||||
|
||||
@Schema(description = "领取时间")
|
||||
private LocalDateTime getTime;
|
||||
|
||||
@Schema(description = "库管员")
|
||||
private String principal;
|
||||
|
||||
@Schema(description = "备注", example = "你猜")
|
||||
private String remark;
|
||||
|
||||
}
|
||||
@ -0,0 +1,95 @@
|
||||
package cn.iocoder.yudao.module.mes.controller.admin.moldrecorditem;
|
||||
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import javax.validation.constraints.*;
|
||||
import javax.validation.*;
|
||||
import javax.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import cn.iocoder.yudao.module.mes.controller.admin.moldrecorditem.vo.*;
|
||||
import cn.iocoder.yudao.module.mes.dal.dataobject.moldrecorditem.MoldRecordItemDO;
|
||||
import cn.iocoder.yudao.module.mes.service.moldrecorditem.MoldRecordItemService;
|
||||
|
||||
@Tag(name = "管理后台 - 维保方案")
|
||||
@RestController
|
||||
@RequestMapping("/mes/mold-record-item")
|
||||
@Validated
|
||||
public class MoldRecordItemController {
|
||||
|
||||
@Resource
|
||||
private MoldRecordItemService moldRecordItemService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建维保方案")
|
||||
@PreAuthorize("@ss.hasPermission('mes:mold-record-item:create')")
|
||||
public CommonResult<Long> createMoldRecordItem(@Valid @RequestBody MoldRecordItemSaveReqVO createReqVO) {
|
||||
return success(moldRecordItemService.createMoldRecordItem(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新维保方案")
|
||||
@PreAuthorize("@ss.hasPermission('mes:mold-record-item:update')")
|
||||
public CommonResult<Boolean> updateMoldRecordItem(@Valid @RequestBody MoldRecordItemSaveReqVO updateReqVO) {
|
||||
moldRecordItemService.updateMoldRecordItem(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除维保方案")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('mes:mold-record-item:delete')")
|
||||
public CommonResult<Boolean> deleteMoldRecordItem(@RequestParam("id") Long id) {
|
||||
moldRecordItemService.deleteMoldRecordItem(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得维保方案")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('mes:mold-record-item:query')")
|
||||
public CommonResult<MoldRecordItemRespVO> getMoldRecordItem(@RequestParam("id") Long id) {
|
||||
MoldRecordItemDO moldRecordItem = moldRecordItemService.getMoldRecordItem(id);
|
||||
return success(BeanUtils.toBean(moldRecordItem, MoldRecordItemRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得维保方案分页")
|
||||
@PreAuthorize("@ss.hasPermission('mes:mold-record-item:query')")
|
||||
public CommonResult<PageResult<MoldRecordItemRespVO>> getMoldRecordItemPage(@Valid MoldRecordItemPageReqVO pageReqVO) {
|
||||
PageResult<MoldRecordItemDO> pageResult = moldRecordItemService.getMoldRecordItemPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, MoldRecordItemRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出维保方案 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('mes:mold-record-item:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportMoldRecordItemExcel(@Valid MoldRecordItemPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<MoldRecordItemDO> list = moldRecordItemService.getMoldRecordItemPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "维保方案.xls", "数据", MoldRecordItemRespVO.class,
|
||||
BeanUtils.toBean(list, MoldRecordItemRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,34 @@
|
||||
package cn.iocoder.yudao.module.mes.controller.admin.moldrecorditem.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 维保方案分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class MoldRecordItemPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "名称 ", example = "王五")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "类型", example = "2")
|
||||
private String type;
|
||||
|
||||
@Schema(description = "关联项目id", example = "26863")
|
||||
private String subjectId;
|
||||
|
||||
@Schema(description = "备注", example = "你说的对")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
||||
@ -0,0 +1,39 @@
|
||||
package cn.iocoder.yudao.module.mes.controller.admin.moldrecorditem.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import com.alibaba.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - 维保方案 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class MoldRecordItemRespVO {
|
||||
|
||||
@Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "21200")
|
||||
@ExcelProperty("ID")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "名称 ", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五")
|
||||
@ExcelProperty("名称 ")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
||||
@ExcelProperty("类型")
|
||||
private String type;
|
||||
|
||||
@Schema(description = "关联项目id", example = "26863")
|
||||
@ExcelProperty("关联项目id")
|
||||
private String subjectId;
|
||||
|
||||
@Schema(description = "备注", example = "你说的对")
|
||||
@ExcelProperty("备注")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
@ -0,0 +1,29 @@
|
||||
package cn.iocoder.yudao.module.mes.controller.admin.moldrecorditem.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
@Schema(description = "管理后台 - 维保方案新增/修改 Request VO")
|
||||
@Data
|
||||
public class MoldRecordItemSaveReqVO {
|
||||
|
||||
@Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "21200")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "名称 ", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五")
|
||||
@NotEmpty(message = "名称 不能为空")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
||||
@NotEmpty(message = "类型不能为空")
|
||||
private String type;
|
||||
|
||||
@Schema(description = "关联项目id", example = "26863")
|
||||
private String subjectId;
|
||||
|
||||
@Schema(description = "备注", example = "你说的对")
|
||||
private String remark;
|
||||
|
||||
}
|
||||
@ -0,0 +1,95 @@
|
||||
package cn.iocoder.yudao.module.mes.controller.admin.moldreturn;
|
||||
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import javax.validation.constraints.*;
|
||||
import javax.validation.*;
|
||||
import javax.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import cn.iocoder.yudao.module.mes.controller.admin.moldreturn.vo.*;
|
||||
import cn.iocoder.yudao.module.mes.dal.dataobject.moldreturn.MoldReturnDO;
|
||||
import cn.iocoder.yudao.module.mes.service.moldreturn.MoldReturnService;
|
||||
|
||||
@Tag(name = "管理后台 - 模具管理-模具入库")
|
||||
@RestController
|
||||
@RequestMapping("/mes/mold-return")
|
||||
@Validated
|
||||
public class MoldReturnController {
|
||||
|
||||
@Resource
|
||||
private MoldReturnService moldReturnService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建模具管理-模具入库")
|
||||
@PreAuthorize("@ss.hasPermission('mes:mold-return:create')")
|
||||
public CommonResult<Long> createMoldReturn(@Valid @RequestBody MoldReturnSaveReqVO createReqVO) {
|
||||
return success(moldReturnService.createMoldReturn(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新模具管理-模具入库")
|
||||
@PreAuthorize("@ss.hasPermission('mes:mold-return:update')")
|
||||
public CommonResult<Boolean> updateMoldReturn(@Valid @RequestBody MoldReturnSaveReqVO updateReqVO) {
|
||||
moldReturnService.updateMoldReturn(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除模具管理-模具入库")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('mes:mold-return:delete')")
|
||||
public CommonResult<Boolean> deleteMoldReturn(@RequestParam("id") Long id) {
|
||||
moldReturnService.deleteMoldReturn(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得模具管理-模具入库")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('mes:mold-return:query')")
|
||||
public CommonResult<MoldReturnRespVO> getMoldReturn(@RequestParam("id") Long id) {
|
||||
MoldReturnDO moldReturn = moldReturnService.getMoldReturn(id);
|
||||
return success(BeanUtils.toBean(moldReturn, MoldReturnRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得模具管理-模具入库分页")
|
||||
@PreAuthorize("@ss.hasPermission('mes:mold-return:query')")
|
||||
public CommonResult<PageResult<MoldReturnRespVO>> getMoldReturnPage(@Valid MoldReturnPageReqVO pageReqVO) {
|
||||
PageResult<MoldReturnDO> pageResult = moldReturnService.getMoldReturnPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, MoldReturnRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出模具管理-模具入库 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('mes:mold-return:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportMoldReturnExcel(@Valid MoldReturnPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<MoldReturnDO> list = moldReturnService.getMoldReturnPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "模具管理-模具入库.xls", "数据", MoldReturnRespVO.class,
|
||||
BeanUtils.toBean(list, MoldReturnRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,47 @@
|
||||
package cn.iocoder.yudao.module.mes.controller.admin.moldreturn.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 模具管理-模具入库分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class MoldReturnPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "领模单号", example = "14986")
|
||||
private Long orderId;
|
||||
|
||||
@Schema(description = "模具编码")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "模具名称", example = "王五")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "状态")
|
||||
private String state;
|
||||
|
||||
@Schema(description = "归还人")
|
||||
private String person;
|
||||
|
||||
@Schema(description = "入库时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] returnTime;
|
||||
|
||||
@Schema(description = "库管员")
|
||||
private String principal;
|
||||
|
||||
@Schema(description = "备注", example = "你说的对")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
||||
@ -0,0 +1,55 @@
|
||||
package cn.iocoder.yudao.module.mes.controller.admin.moldreturn.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import com.alibaba.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - 模具管理-模具入库 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class MoldReturnRespVO {
|
||||
|
||||
@Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "31438")
|
||||
@ExcelProperty("ID")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "领模单号", requiredMode = Schema.RequiredMode.REQUIRED, example = "14986")
|
||||
@ExcelProperty("领模单号")
|
||||
private Long orderId;
|
||||
|
||||
@Schema(description = "模具编码", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("模具编码")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "模具名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五")
|
||||
@ExcelProperty("模具名称")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "状态", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("状态")
|
||||
private String state;
|
||||
|
||||
@Schema(description = "归还人")
|
||||
@ExcelProperty("归还人")
|
||||
private String person;
|
||||
|
||||
@Schema(description = "入库时间")
|
||||
@ExcelProperty("入库时间")
|
||||
private LocalDateTime returnTime;
|
||||
|
||||
@Schema(description = "库管员")
|
||||
@ExcelProperty("库管员")
|
||||
private String principal;
|
||||
|
||||
@Schema(description = "备注", example = "你说的对")
|
||||
@ExcelProperty("备注")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
@ -0,0 +1,45 @@
|
||||
package cn.iocoder.yudao.module.mes.controller.admin.moldreturn.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import javax.validation.constraints.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - 模具管理-模具入库新增/修改 Request VO")
|
||||
@Data
|
||||
public class MoldReturnSaveReqVO {
|
||||
|
||||
@Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "31438")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "领模单号", requiredMode = Schema.RequiredMode.REQUIRED, example = "14986")
|
||||
@NotNull(message = "领模单号不能为空")
|
||||
private Long orderId;
|
||||
|
||||
@Schema(description = "模具编码", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "模具编码不能为空")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "模具名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五")
|
||||
@NotEmpty(message = "模具名称不能为空")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "状态", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "状态不能为空")
|
||||
private String state;
|
||||
|
||||
@Schema(description = "归还人")
|
||||
private String person;
|
||||
|
||||
@Schema(description = "入库时间")
|
||||
private LocalDateTime returnTime;
|
||||
|
||||
@Schema(description = "库管员")
|
||||
private String principal;
|
||||
|
||||
@Schema(description = "备注", example = "你说的对")
|
||||
private String remark;
|
||||
|
||||
}
|
||||
@ -0,0 +1,95 @@
|
||||
package cn.iocoder.yudao.module.mes.controller.admin.zjitem;
|
||||
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import javax.validation.constraints.*;
|
||||
import javax.validation.*;
|
||||
import javax.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import cn.iocoder.yudao.module.mes.controller.admin.zjitem.vo.*;
|
||||
import cn.iocoder.yudao.module.mes.dal.dataobject.zjitem.ZjItemDO;
|
||||
import cn.iocoder.yudao.module.mes.service.zjitem.ZjItemService;
|
||||
|
||||
@Tag(name = "管理后台 - 质量管理-检验项目")
|
||||
@RestController
|
||||
@RequestMapping("/mes/zj-item")
|
||||
@Validated
|
||||
public class ZjItemController {
|
||||
|
||||
@Resource
|
||||
private ZjItemService zjItemService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建质量管理-检验项目")
|
||||
@PreAuthorize("@ss.hasPermission('mes:zj-item:create')")
|
||||
public CommonResult<Long> createZjItem(@Valid @RequestBody ZjItemSaveReqVO createReqVO) {
|
||||
return success(zjItemService.createZjItem(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新质量管理-检验项目")
|
||||
@PreAuthorize("@ss.hasPermission('mes:zj-item:update')")
|
||||
public CommonResult<Boolean> updateZjItem(@Valid @RequestBody ZjItemSaveReqVO updateReqVO) {
|
||||
zjItemService.updateZjItem(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除质量管理-检验项目")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('mes:zj-item:delete')")
|
||||
public CommonResult<Boolean> deleteZjItem(@RequestParam("id") Long id) {
|
||||
zjItemService.deleteZjItem(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得质量管理-检验项目")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('mes:zj-item:query')")
|
||||
public CommonResult<ZjItemRespVO> getZjItem(@RequestParam("id") Long id) {
|
||||
ZjItemDO zjItem = zjItemService.getZjItem(id);
|
||||
return success(BeanUtils.toBean(zjItem, ZjItemRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得质量管理-检验项目分页")
|
||||
@PreAuthorize("@ss.hasPermission('mes:zj-item:query')")
|
||||
public CommonResult<PageResult<ZjItemRespVO>> getZjItemPage(@Valid ZjItemPageReqVO pageReqVO) {
|
||||
PageResult<ZjItemDO> pageResult = zjItemService.getZjItemPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, ZjItemRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出质量管理-检验项目 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('mes:zj-item:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportZjItemExcel(@Valid ZjItemPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<ZjItemDO> list = zjItemService.getZjItemPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "质量管理-检验项目.xls", "数据", ZjItemRespVO.class,
|
||||
BeanUtils.toBean(list, ZjItemRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,46 @@
|
||||
package cn.iocoder.yudao.module.mes.controller.admin.zjitem.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 质量管理-检验项目分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class ZjItemPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "检验类型", example = "1")
|
||||
private Long zjType;
|
||||
|
||||
@Schema(description = "名称", example = "芋艿")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "备注", example = "你说的对")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "作业方式")
|
||||
private String tool;
|
||||
|
||||
@Schema(description = "标准值")
|
||||
private Double standardVal;
|
||||
|
||||
@Schema(description = "单位")
|
||||
private String unit;
|
||||
|
||||
@Schema(description = "上限值")
|
||||
private Double upperVal;
|
||||
|
||||
@Schema(description = "下限值")
|
||||
private Double lowerVal;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
||||
@ -0,0 +1,55 @@
|
||||
package cn.iocoder.yudao.module.mes.controller.admin.zjitem.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import com.alibaba.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - 质量管理-检验项目 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class ZjItemRespVO {
|
||||
|
||||
@Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "18846")
|
||||
@ExcelProperty("ID")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "检验类型", example = "1")
|
||||
@ExcelProperty("检验类型")
|
||||
private Long zjType;
|
||||
|
||||
@Schema(description = "名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿")
|
||||
@ExcelProperty("名称")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "备注", example = "你说的对")
|
||||
@ExcelProperty("备注")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "作业方式")
|
||||
@ExcelProperty("作业方式")
|
||||
private String tool;
|
||||
|
||||
@Schema(description = "标准值")
|
||||
@ExcelProperty("标准值")
|
||||
private Double standardVal;
|
||||
|
||||
@Schema(description = "单位")
|
||||
@ExcelProperty("单位")
|
||||
private String unit;
|
||||
|
||||
@Schema(description = "上限值")
|
||||
@ExcelProperty("上限值")
|
||||
private Double upperVal;
|
||||
|
||||
@Schema(description = "下限值")
|
||||
@ExcelProperty("下限值")
|
||||
private Double lowerVal;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
@ -0,0 +1,40 @@
|
||||
package cn.iocoder.yudao.module.mes.controller.admin.zjitem.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
@Schema(description = "管理后台 - 质量管理-检验项目新增/修改 Request VO")
|
||||
@Data
|
||||
public class ZjItemSaveReqVO {
|
||||
|
||||
@Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "18846")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "检验类型", example = "1")
|
||||
private Long zjType;
|
||||
|
||||
@Schema(description = "名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿")
|
||||
@NotEmpty(message = "名称不能为空")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "备注", example = "你说的对")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "作业方式")
|
||||
private String tool;
|
||||
|
||||
@Schema(description = "标准值")
|
||||
private Double standardVal;
|
||||
|
||||
@Schema(description = "单位")
|
||||
private String unit;
|
||||
|
||||
@Schema(description = "上限值")
|
||||
private Double upperVal;
|
||||
|
||||
@Schema(description = "下限值")
|
||||
private Double lowerVal;
|
||||
|
||||
}
|
||||
@ -0,0 +1,95 @@
|
||||
package cn.iocoder.yudao.module.mes.controller.admin.zjschema;
|
||||
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import javax.validation.constraints.*;
|
||||
import javax.validation.*;
|
||||
import javax.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import cn.iocoder.yudao.module.mes.controller.admin.zjschema.vo.*;
|
||||
import cn.iocoder.yudao.module.mes.dal.dataobject.zjschema.ZjSchemaDO;
|
||||
import cn.iocoder.yudao.module.mes.service.zjschema.ZjSchemaService;
|
||||
|
||||
@Tag(name = "管理后台 - 检验方案")
|
||||
@RestController
|
||||
@RequestMapping("/mes/zj-schema")
|
||||
@Validated
|
||||
public class ZjSchemaController {
|
||||
|
||||
@Resource
|
||||
private ZjSchemaService zjSchemaService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建检验方案")
|
||||
@PreAuthorize("@ss.hasPermission('mes:zj-schema:create')")
|
||||
public CommonResult<Long> createZjSchema(@Valid @RequestBody ZjSchemaSaveReqVO createReqVO) {
|
||||
return success(zjSchemaService.createZjSchema(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新检验方案")
|
||||
@PreAuthorize("@ss.hasPermission('mes:zj-schema:update')")
|
||||
public CommonResult<Boolean> updateZjSchema(@Valid @RequestBody ZjSchemaSaveReqVO updateReqVO) {
|
||||
zjSchemaService.updateZjSchema(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除检验方案")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('mes:zj-schema:delete')")
|
||||
public CommonResult<Boolean> deleteZjSchema(@RequestParam("id") Long id) {
|
||||
zjSchemaService.deleteZjSchema(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得检验方案")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('mes:zj-schema:query')")
|
||||
public CommonResult<ZjSchemaRespVO> getZjSchema(@RequestParam("id") Long id) {
|
||||
ZjSchemaDO zjSchema = zjSchemaService.getZjSchema(id);
|
||||
return success(BeanUtils.toBean(zjSchema, ZjSchemaRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得检验方案分页")
|
||||
@PreAuthorize("@ss.hasPermission('mes:zj-schema:query')")
|
||||
public CommonResult<PageResult<ZjSchemaRespVO>> getZjSchemaPage(@Valid ZjSchemaPageReqVO pageReqVO) {
|
||||
PageResult<ZjSchemaDO> pageResult = zjSchemaService.getZjSchemaPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, ZjSchemaRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出检验方案 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('mes:zj-schema:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportZjSchemaExcel(@Valid ZjSchemaPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<ZjSchemaDO> list = zjSchemaService.getZjSchemaPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "检验方案.xls", "数据", ZjSchemaRespVO.class,
|
||||
BeanUtils.toBean(list, ZjSchemaRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,40 @@
|
||||
package cn.iocoder.yudao.module.mes.controller.admin.zjschema.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 检验方案分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class ZjSchemaPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "类型", example = "2")
|
||||
private String type;
|
||||
|
||||
@Schema(description = "名称", example = "李四")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "备注", example = "你猜")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "抽检方式")
|
||||
private String sampleMethod;
|
||||
|
||||
@Schema(description = "值")
|
||||
private Long val;
|
||||
|
||||
@Schema(description = "关联项目")
|
||||
private String item;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
||||
@ -0,0 +1,43 @@
|
||||
package cn.iocoder.yudao.module.mes.controller.admin.zjschema.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import com.alibaba.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - 检验方案 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class ZjSchemaRespVO {
|
||||
|
||||
@Schema(description = "类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
||||
@ExcelProperty("类型")
|
||||
private String type;
|
||||
|
||||
@Schema(description = "名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "李四")
|
||||
@ExcelProperty("名称")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "备注", example = "你猜")
|
||||
@ExcelProperty("备注")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "抽检方式")
|
||||
@ExcelProperty("抽检方式")
|
||||
private String sampleMethod;
|
||||
|
||||
@Schema(description = "值")
|
||||
@ExcelProperty("值")
|
||||
private Long val;
|
||||
|
||||
@Schema(description = "关联项目")
|
||||
@ExcelProperty("关联项目")
|
||||
private String item;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
@ -0,0 +1,36 @@
|
||||
package cn.iocoder.yudao.module.mes.controller.admin.zjschema.vo;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
@Schema(description = "管理后台 - 检验方案新增/修改 Request VO")
|
||||
@Data
|
||||
public class ZjSchemaSaveReqVO {
|
||||
|
||||
@Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "18846")
|
||||
@ExcelProperty("ID")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
||||
private String type;
|
||||
|
||||
@Schema(description = "名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "李四")
|
||||
@NotEmpty(message = "名称不能为空")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "备注", example = "你猜")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "抽检方式")
|
||||
private String sampleMethod;
|
||||
|
||||
@Schema(description = "值")
|
||||
private Long val;
|
||||
|
||||
@Schema(description = "关联项目")
|
||||
private String item;
|
||||
|
||||
}
|
||||
@ -0,0 +1,102 @@
|
||||
package cn.iocoder.yudao.module.mes.controller.admin.zjtype;
|
||||
|
||||
import cn.iocoder.yudao.module.iot.dal.dataobject.deviceattributetype.DeviceAttributeTypeDO;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import javax.validation.constraints.*;
|
||||
import javax.validation.*;
|
||||
import javax.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import cn.iocoder.yudao.module.mes.controller.admin.zjtype.vo.*;
|
||||
import cn.iocoder.yudao.module.mes.dal.dataobject.zjtype.ZjTypeDO;
|
||||
import cn.iocoder.yudao.module.mes.service.zjtype.ZjTypeService;
|
||||
|
||||
@Tag(name = "管理后台 - 质量管理-检验类型")
|
||||
@RestController
|
||||
@RequestMapping("/mes/zj-type")
|
||||
@Validated
|
||||
public class ZjTypeController {
|
||||
|
||||
@Resource
|
||||
private ZjTypeService zjTypeService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建质量管理-检验类型")
|
||||
@PreAuthorize("@ss.hasPermission('mes:zj-type:create')")
|
||||
public CommonResult<Long> createZjType(@Valid @RequestBody ZjTypeSaveReqVO createReqVO) {
|
||||
return success(zjTypeService.createZjType(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新质量管理-检验类型")
|
||||
@PreAuthorize("@ss.hasPermission('mes:zj-type:update')")
|
||||
public CommonResult<Boolean> updateZjType(@Valid @RequestBody ZjTypeSaveReqVO updateReqVO) {
|
||||
zjTypeService.updateZjType(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除质量管理-检验类型")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('mes:zj-type:delete')")
|
||||
public CommonResult<Boolean> deleteZjType(@RequestParam("id") Long id) {
|
||||
zjTypeService.deleteZjType(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得质量管理-检验类型")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('mes:zj-type:query')")
|
||||
public CommonResult<ZjTypeRespVO> getZjType(@RequestParam("id") Long id) {
|
||||
ZjTypeDO zjType = zjTypeService.getZjType(id);
|
||||
return success(BeanUtils.toBean(zjType, ZjTypeRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得质量管理-检验类型分页")
|
||||
@PreAuthorize("@ss.hasPermission('mes:zj-type:query')")
|
||||
public CommonResult<PageResult<ZjTypeRespVO>> getZjTypePage(@Valid ZjTypePageReqVO pageReqVO) {
|
||||
PageResult<ZjTypeDO> pageResult = zjTypeService.getZjTypePage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, ZjTypeRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出质量管理-检验类型 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('mes:zj-type:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportZjTypeExcel(@Valid ZjTypePageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<ZjTypeDO> list = zjTypeService.getZjTypePage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "质量管理-检验类型.xls", "数据", ZjTypeRespVO.class,
|
||||
BeanUtils.toBean(list, ZjTypeRespVO.class));
|
||||
}
|
||||
@GetMapping("/list")
|
||||
@Operation(summary = "获得检验类型列表")
|
||||
public CommonResult<List<ZjTypeDO>> getDeviceModelList() {
|
||||
List<ZjTypeDO> zjTypeDOListjTypeDOList = zjTypeService.getZjTypeList();
|
||||
return success(zjTypeDOListjTypeDOList);
|
||||
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,31 @@
|
||||
package cn.iocoder.yudao.module.mes.controller.admin.zjtype.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 质量管理-检验类型分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class ZjTypePageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "编码")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "名称", example = "张三")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "备注", example = "你说的对")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
||||
@ -0,0 +1,35 @@
|
||||
package cn.iocoder.yudao.module.mes.controller.admin.zjtype.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import com.alibaba.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - 质量管理-检验类型 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class ZjTypeRespVO {
|
||||
|
||||
@Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "23350")
|
||||
@ExcelProperty("ID")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "编码", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("编码")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三")
|
||||
@ExcelProperty("名称")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "备注", example = "你说的对")
|
||||
@ExcelProperty("备注")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
@ -0,0 +1,26 @@
|
||||
package cn.iocoder.yudao.module.mes.controller.admin.zjtype.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
@Schema(description = "管理后台 - 质量管理-检验类型新增/修改 Request VO")
|
||||
@Data
|
||||
public class ZjTypeSaveReqVO {
|
||||
|
||||
@Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "23350")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "编码", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "编码不能为空")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三")
|
||||
@NotEmpty(message = "名称不能为空")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "备注", example = "你说的对")
|
||||
private String remark;
|
||||
|
||||
}
|
||||
@ -0,0 +1,76 @@
|
||||
package cn.iocoder.yudao.module.mes.dal.dataobject.energydevice;
|
||||
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
import com.baomidou.mybatisplus.annotation.KeySequence;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 抄表记录 DO
|
||||
*
|
||||
* @author 内蒙必硕
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class EnergyDeviceReportDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
private Long id;
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 表ID
|
||||
*/
|
||||
private Long deviceId;
|
||||
/**
|
||||
* 表名称
|
||||
*/
|
||||
private String deviceName;
|
||||
/**
|
||||
* 能耗类型ID
|
||||
*/
|
||||
private Long deviceTypeId;
|
||||
/**
|
||||
* 能耗类型名称
|
||||
*/
|
||||
private String deviceTypeName;
|
||||
/**
|
||||
* 所属区域ID
|
||||
*/
|
||||
private Long orgId;
|
||||
/**
|
||||
* 所属区域名称
|
||||
*/
|
||||
private String orgName;
|
||||
/**
|
||||
* 消耗量
|
||||
*/
|
||||
private String value;
|
||||
/**
|
||||
* 计算规则
|
||||
*/
|
||||
private String unitName;
|
||||
/**
|
||||
* 开始时间
|
||||
*/
|
||||
private LocalDateTime startTime;
|
||||
/**
|
||||
* 结束时间
|
||||
*/
|
||||
private LocalDateTime endTime;
|
||||
}
|
||||
@ -0,0 +1,51 @@
|
||||
package cn.iocoder.yudao.module.mes.dal.dataobject.energytype;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
|
||||
/**
|
||||
* 能耗类型 DO
|
||||
*
|
||||
* @author 内蒙必硕
|
||||
*/
|
||||
@TableName("mes_energy_type")
|
||||
@KeySequence("mes_energy_type_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class EnergyTypeDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 能耗类型编码
|
||||
*/
|
||||
private String code;
|
||||
/**
|
||||
* 能耗类型名称
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 单位
|
||||
*/
|
||||
private String unit;
|
||||
/**
|
||||
* 是否启用
|
||||
*/
|
||||
private Boolean isEnable;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
}
|
||||
@ -0,0 +1,72 @@
|
||||
package cn.iocoder.yudao.module.mes.dal.dataobject.moldget;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
|
||||
/**
|
||||
* 模具管理-领模申请 DO
|
||||
*
|
||||
* @author 内蒙必硕
|
||||
*/
|
||||
@TableName("mes_mold_get")
|
||||
@KeySequence("mes_mold_get_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class MoldGetDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 领模单号
|
||||
*/
|
||||
private Long orderId;
|
||||
/**
|
||||
* 模具编码
|
||||
*/
|
||||
private String code;
|
||||
/**
|
||||
* 模具名称
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
private String state;
|
||||
/**
|
||||
* 领模人
|
||||
*/
|
||||
private String person;
|
||||
/**
|
||||
* 设备id
|
||||
*/
|
||||
private Long deviceId;
|
||||
/**
|
||||
* 设备名称
|
||||
*/
|
||||
private String deviceName;
|
||||
/**
|
||||
* 领取时间
|
||||
*/
|
||||
private LocalDateTime getTime;
|
||||
/**
|
||||
* 库管员
|
||||
*/
|
||||
private String principal;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
}
|
||||
@ -0,0 +1,47 @@
|
||||
package cn.iocoder.yudao.module.mes.dal.dataobject.moldrecorditem;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
|
||||
/**
|
||||
* 维保方案 DO
|
||||
*
|
||||
* @author 内蒙必硕
|
||||
*/
|
||||
@TableName("mes_mold_record_item")
|
||||
@KeySequence("mes_mold_record_item_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class MoldRecordItemDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 类型
|
||||
*/
|
||||
private String type;
|
||||
/**
|
||||
* 关联项目id
|
||||
*/
|
||||
private String subjectId;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
}
|
||||
@ -0,0 +1,64 @@
|
||||
package cn.iocoder.yudao.module.mes.dal.dataobject.moldreturn;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
|
||||
/**
|
||||
* 模具管理-模具入库 DO
|
||||
*
|
||||
* @author 内蒙必硕
|
||||
*/
|
||||
@TableName("mes_mold_return")
|
||||
@KeySequence("mes_mold_return_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class MoldReturnDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 领模单号
|
||||
*/
|
||||
private Long orderId;
|
||||
/**
|
||||
* 模具编码
|
||||
*/
|
||||
private String code;
|
||||
/**
|
||||
* 模具名称
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
private String state;
|
||||
/**
|
||||
* 归还人
|
||||
*/
|
||||
private String person;
|
||||
/**
|
||||
* 入库时间
|
||||
*/
|
||||
private LocalDateTime returnTime;
|
||||
/**
|
||||
* 库管员
|
||||
*/
|
||||
private String principal;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
}
|
||||
@ -0,0 +1,63 @@
|
||||
package cn.iocoder.yudao.module.mes.dal.dataobject.zjitem;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
|
||||
/**
|
||||
* 质量管理-检验项目 DO
|
||||
*
|
||||
* @author 内蒙必硕
|
||||
*/
|
||||
@TableName("mes_zj_item")
|
||||
@KeySequence("mes_zj_item_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class ZjItemDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 检验类型
|
||||
*/
|
||||
private Long zjType;
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
/**
|
||||
* 作业方式
|
||||
*/
|
||||
private String tool;
|
||||
/**
|
||||
* 标准值
|
||||
*/
|
||||
private Double standardVal;
|
||||
/**
|
||||
* 单位
|
||||
*/
|
||||
private String unit;
|
||||
/**
|
||||
* 上限值
|
||||
*/
|
||||
private Double upperVal;
|
||||
/**
|
||||
* 下限值
|
||||
*/
|
||||
private Double lowerVal;
|
||||
|
||||
}
|
||||
@ -0,0 +1,55 @@
|
||||
package cn.iocoder.yudao.module.mes.dal.dataobject.zjschema;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
|
||||
/**
|
||||
* 检验方案 DO
|
||||
*
|
||||
* @author 内蒙必硕
|
||||
*/
|
||||
@TableName("mes_zj_schema")
|
||||
@KeySequence("mes_zj_schema_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class ZjSchemaDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 类型
|
||||
*/
|
||||
private String type;
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
/**
|
||||
* 抽检方式
|
||||
*/
|
||||
private String sampleMethod;
|
||||
/**
|
||||
* 值
|
||||
*/
|
||||
private Long val;
|
||||
/**
|
||||
* 关联项目
|
||||
*/
|
||||
private String item;
|
||||
|
||||
}
|
||||
@ -0,0 +1,43 @@
|
||||
package cn.iocoder.yudao.module.mes.dal.dataobject.zjtype;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
|
||||
/**
|
||||
* 质量管理-检验类型 DO
|
||||
*
|
||||
* @author 内蒙必硕
|
||||
*/
|
||||
@TableName("mes_zj_type")
|
||||
@KeySequence("mes_zj_type_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class ZjTypeDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 编码
|
||||
*/
|
||||
private String code;
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
}
|
||||
@ -0,0 +1,31 @@
|
||||
package cn.iocoder.yudao.module.mes.dal.mysql.energydevice;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.module.mes.controller.admin.energydevice.vo.EnergyDeviceReportPageReqVO;
|
||||
import cn.iocoder.yudao.module.mes.dal.dataobject.energydevice.EnergyDeviceReportDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 抄表记录 Mapper
|
||||
*
|
||||
* @author 内蒙必硕
|
||||
*/
|
||||
@Mapper
|
||||
public interface EnergyDeviceReportMapper extends BaseMapperX<EnergyDeviceReportDO> {
|
||||
|
||||
default PageResult<EnergyDeviceReportDO> selectPage(EnergyDeviceReportPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<EnergyDeviceReportDO>()
|
||||
.eqIfPresent(EnergyDeviceReportDO::getDeviceId, reqVO.getDeviceId())
|
||||
.betweenIfPresent(EnergyDeviceReportDO::getStartTime, reqVO.getStartTime())
|
||||
.orderByDesc(EnergyDeviceReportDO::getId));
|
||||
}
|
||||
default PageResult<EnergyDeviceReportDO> selectPage(PageParam reqVO, Long deviceId) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<EnergyDeviceReportDO>()
|
||||
.eq(EnergyDeviceReportDO::getDeviceId, deviceId)
|
||||
.orderByDesc(EnergyDeviceReportDO::getId));
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,35 @@
|
||||
package cn.iocoder.yudao.module.mes.dal.mysql.energytype;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.module.iot.dal.dataobject.deviceattributetype.DeviceAttributeTypeDO;
|
||||
import cn.iocoder.yudao.module.mes.dal.dataobject.energytype.EnergyTypeDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import cn.iocoder.yudao.module.mes.controller.admin.energytype.vo.*;
|
||||
|
||||
/**
|
||||
* 能耗类型 Mapper
|
||||
*
|
||||
* @author 内蒙必硕
|
||||
*/
|
||||
@Mapper
|
||||
public interface EnergyTypeMapper extends BaseMapperX<EnergyTypeDO> {
|
||||
|
||||
default PageResult<EnergyTypeDO> selectPage(EnergyTypePageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<EnergyTypeDO>()
|
||||
.eqIfPresent(EnergyTypeDO::getCode, reqVO.getCode())
|
||||
.likeIfPresent(EnergyTypeDO::getName, reqVO.getName())
|
||||
.eqIfPresent(EnergyTypeDO::getUnit, reqVO.getUnit())
|
||||
.eqIfPresent(EnergyTypeDO::getIsEnable, reqVO.getIsEnable())
|
||||
.eqIfPresent(EnergyTypeDO::getRemark, reqVO.getRemark())
|
||||
.betweenIfPresent(EnergyTypeDO::getCreateTime, reqVO.getCreateTime())
|
||||
.orderByDesc(EnergyTypeDO::getId));
|
||||
}
|
||||
|
||||
default List<EnergyTypeDO> select() {
|
||||
return selectList();
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,36 @@
|
||||
package cn.iocoder.yudao.module.mes.dal.mysql.moldget;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.module.mes.dal.dataobject.moldget.MoldGetDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import cn.iocoder.yudao.module.mes.controller.admin.moldget.vo.*;
|
||||
|
||||
/**
|
||||
* 模具管理-领模申请 Mapper
|
||||
*
|
||||
* @author 内蒙必硕
|
||||
*/
|
||||
@Mapper
|
||||
public interface MoldGetMapper extends BaseMapperX<MoldGetDO> {
|
||||
|
||||
default PageResult<MoldGetDO> selectPage(MoldGetPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<MoldGetDO>()
|
||||
.eqIfPresent(MoldGetDO::getOrderId, reqVO.getOrderId())
|
||||
.eqIfPresent(MoldGetDO::getCode, reqVO.getCode())
|
||||
.likeIfPresent(MoldGetDO::getName, reqVO.getName())
|
||||
.eqIfPresent(MoldGetDO::getState, reqVO.getState())
|
||||
.eqIfPresent(MoldGetDO::getPerson, reqVO.getPerson())
|
||||
.eqIfPresent(MoldGetDO::getDeviceId, reqVO.getDeviceId())
|
||||
.likeIfPresent(MoldGetDO::getDeviceName, reqVO.getDeviceName())
|
||||
.betweenIfPresent(MoldGetDO::getGetTime, reqVO.getGetTime())
|
||||
.eqIfPresent(MoldGetDO::getPrincipal, reqVO.getPrincipal())
|
||||
.eqIfPresent(MoldGetDO::getRemark, reqVO.getRemark())
|
||||
.betweenIfPresent(MoldGetDO::getCreateTime, reqVO.getCreateTime())
|
||||
.orderByDesc(MoldGetDO::getId));
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,30 @@
|
||||
package cn.iocoder.yudao.module.mes.dal.mysql.moldrecorditem;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.module.mes.dal.dataobject.moldrecorditem.MoldRecordItemDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import cn.iocoder.yudao.module.mes.controller.admin.moldrecorditem.vo.*;
|
||||
|
||||
/**
|
||||
* 维保方案 Mapper
|
||||
*
|
||||
* @author 内蒙必硕
|
||||
*/
|
||||
@Mapper
|
||||
public interface MoldRecordItemMapper extends BaseMapperX<MoldRecordItemDO> {
|
||||
|
||||
default PageResult<MoldRecordItemDO> selectPage(MoldRecordItemPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<MoldRecordItemDO>()
|
||||
.likeIfPresent(MoldRecordItemDO::getName, reqVO.getName())
|
||||
.eqIfPresent(MoldRecordItemDO::getType, reqVO.getType())
|
||||
.eqIfPresent(MoldRecordItemDO::getSubjectId, reqVO.getSubjectId())
|
||||
.eqIfPresent(MoldRecordItemDO::getRemark, reqVO.getRemark())
|
||||
.betweenIfPresent(MoldRecordItemDO::getCreateTime, reqVO.getCreateTime())
|
||||
.orderByDesc(MoldRecordItemDO::getId));
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,34 @@
|
||||
package cn.iocoder.yudao.module.mes.dal.mysql.moldreturn;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.module.mes.dal.dataobject.moldreturn.MoldReturnDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import cn.iocoder.yudao.module.mes.controller.admin.moldreturn.vo.*;
|
||||
|
||||
/**
|
||||
* 模具管理-模具入库 Mapper
|
||||
*
|
||||
* @author 内蒙必硕
|
||||
*/
|
||||
@Mapper
|
||||
public interface MoldReturnMapper extends BaseMapperX<MoldReturnDO> {
|
||||
|
||||
default PageResult<MoldReturnDO> selectPage(MoldReturnPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<MoldReturnDO>()
|
||||
.eqIfPresent(MoldReturnDO::getOrderId, reqVO.getOrderId())
|
||||
.eqIfPresent(MoldReturnDO::getCode, reqVO.getCode())
|
||||
.likeIfPresent(MoldReturnDO::getName, reqVO.getName())
|
||||
.eqIfPresent(MoldReturnDO::getState, reqVO.getState())
|
||||
.eqIfPresent(MoldReturnDO::getPerson, reqVO.getPerson())
|
||||
.betweenIfPresent(MoldReturnDO::getReturnTime, reqVO.getReturnTime())
|
||||
.eqIfPresent(MoldReturnDO::getPrincipal, reqVO.getPrincipal())
|
||||
.eqIfPresent(MoldReturnDO::getRemark, reqVO.getRemark())
|
||||
.betweenIfPresent(MoldReturnDO::getCreateTime, reqVO.getCreateTime())
|
||||
.orderByDesc(MoldReturnDO::getId));
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,34 @@
|
||||
package cn.iocoder.yudao.module.mes.dal.mysql.zjitem;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.module.mes.dal.dataobject.zjitem.ZjItemDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import cn.iocoder.yudao.module.mes.controller.admin.zjitem.vo.*;
|
||||
|
||||
/**
|
||||
* 质量管理-检验项目 Mapper
|
||||
*
|
||||
* @author 内蒙必硕
|
||||
*/
|
||||
@Mapper
|
||||
public interface ZjItemMapper extends BaseMapperX<ZjItemDO> {
|
||||
|
||||
default PageResult<ZjItemDO> selectPage(ZjItemPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<ZjItemDO>()
|
||||
.eqIfPresent(ZjItemDO::getZjType, reqVO.getZjType())
|
||||
.likeIfPresent(ZjItemDO::getName, reqVO.getName())
|
||||
.eqIfPresent(ZjItemDO::getRemark, reqVO.getRemark())
|
||||
.eqIfPresent(ZjItemDO::getTool, reqVO.getTool())
|
||||
.eqIfPresent(ZjItemDO::getStandardVal, reqVO.getStandardVal())
|
||||
.eqIfPresent(ZjItemDO::getUnit, reqVO.getUnit())
|
||||
.eqIfPresent(ZjItemDO::getUpperVal, reqVO.getUpperVal())
|
||||
.eqIfPresent(ZjItemDO::getLowerVal, reqVO.getLowerVal())
|
||||
.betweenIfPresent(ZjItemDO::getCreateTime, reqVO.getCreateTime())
|
||||
.orderByDesc(ZjItemDO::getId));
|
||||
}
|
||||
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue