diff --git a/hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/emParam/entity/ParamBackupsEntity.java b/hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/emParam/entity/ParamBackupsEntity.java index d59b118..bc9d0bb 100644 --- a/hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/emParam/entity/ParamBackupsEntity.java +++ b/hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/emParam/entity/ParamBackupsEntity.java @@ -35,6 +35,11 @@ public class ParamBackupsEntity extends TenantEntity implements Serializable { @NotBlank(message = "设备编号不能为空",groups = {Create.class}) private String emCode; + @ApiModelProperty("设备名称") + @QueryField(condition = SqlCondition.LIKE) + @NotBlank(message = "设备名称不能为空",groups = {Create.class}) + private String emName; + @ApiModelProperty("是否延迟发布") @QueryField(condition = SqlCondition.EQUAL) private Boolean delay; diff --git a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/maintenance/entity/OperMaintenanceLibraryEntity.java b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/maintenance/entity/OperMaintenanceLibraryEntity.java index a096afa..71054f0 100644 --- a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/maintenance/entity/OperMaintenanceLibraryEntity.java +++ b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/maintenance/entity/OperMaintenanceLibraryEntity.java @@ -8,6 +8,8 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import lombok.EqualsAndHashCode; +import org.springblade.core.mp.support.QueryField; +import org.springblade.core.mp.support.SqlCondition; import org.springblade.core.tenant.mp.TenantEntity; import org.springframework.format.annotation.DateTimeFormat; @@ -31,11 +33,13 @@ public class OperMaintenanceLibraryEntity extends TenantEntity { * 库编码 */ @ApiModelProperty(value = "库编码,后台自动生成") + @QueryField(condition = SqlCondition.LIKE) private String libraryCode; /** * 设备编码 */ @ApiModelProperty(value = "设备编码,多个按,分隔") + @QueryField(condition = SqlCondition.EQUAL) private String emCode; @ApiModelProperty(value = "维护模式 01=人员 02=值班") @@ -54,12 +58,14 @@ public class OperMaintenanceLibraryEntity extends TenantEntity { * 维护类型 01=定期试验 02=定期保养 03=定期操作 04=其他 */ @ApiModelProperty(value = "维护类型 01=定期试验 02=定期保养 03=定期操作 04=其他") + @QueryField(condition = SqlCondition.EQUAL) private String typeCode; /** * 流程key */ @ApiModelProperty(value = "流程key") + @QueryField(condition = SqlCondition.EQUAL) private String procDefId; /** * 周期(单位:小时) @@ -102,6 +108,7 @@ public class OperMaintenanceLibraryEntity extends TenantEntity { * 执行人员,多个人员之间用英文逗号分隔 */ @ApiModelProperty(value = "执行人员,多个人员之间用英文逗号分隔,并且字符串首尾都必须有一个英文逗号") + @QueryField(condition = SqlCondition.LIKE) private String disposers; @ApiModelProperty(value = "生成计划时间,仅在后台业务使用") @@ -121,4 +128,8 @@ public class OperMaintenanceLibraryEntity extends TenantEntity { @JsonSerialize(nullsUsing = NullSerializer.class) private Long messageTemplateId; + @ApiModelProperty("创建机构") + @QueryField(condition = SqlCondition.LIKE) + private Long createDept; + } diff --git a/hzims-service/equipment/src/main/java/com/hnac/hzims/emParam/controller/ParamBackupsDetailController.java b/hzims-service/equipment/src/main/java/com/hnac/hzims/emParam/controller/ParamBackupsDetailController.java index febbb87..fffab3a 100644 --- a/hzims-service/equipment/src/main/java/com/hnac/hzims/emParam/controller/ParamBackupsDetailController.java +++ b/hzims-service/equipment/src/main/java/com/hnac/hzims/emParam/controller/ParamBackupsDetailController.java @@ -26,7 +26,7 @@ public class ParamBackupsDetailController extends BladeController { private final IParamBackupsDetailService paramBackupsDetailService; @GetMapping("/getBackupsParamTree") - @ApiOperation("") + @ApiOperation("获取备份参数树形结构") @ApiOperationSupport(order = 1) public R> getBackupsParamTree(@RequestParam @ApiParam("备份ID") Long backupsId) { return R.data(paramBackupsDetailService.getBackupsParamTree(backupsId)); diff --git a/hzims-service/equipment/src/main/resources/db/2.0.0.sql.1 b/hzims-service/equipment/src/main/resources/db/2.0.0.sql.1 index 0583b76..132af94 100644 --- a/hzims-service/equipment/src/main/resources/db/2.0.0.sql.1 +++ b/hzims-service/equipment/src/main/resources/db/2.0.0.sql.1 @@ -24,4 +24,6 @@ CREATE TABLE `hzims_em_video_banding` ( -- 参数分组还原添加字段 alter table `HZIMS_PARAM_BACKUPS_DETAIL` add column `model_classify_id` BIGINT(20) COMMENT '参数分组'; alter table `HZIMS_PARAM_BACKUPS_DETAIL` add column `model_classify_name` BIGINT(20) COMMENT '参数分组名称'; -alter table `HZIMS_PARAM_BACKUPS_DETAIL` modify column `model_classify_name` varchar(100) NULL COMMENT '参数分组名称'; \ No newline at end of file +alter table `HZIMS_PARAM_BACKUPS_DETAIL` modify column `model_classify_name` varchar(100) NULL COMMENT '参数分组名称'; +alter table `HZIMS_PARAM_BACKUPS` add column `em_name` varchar(100) COMMENT '设备名称'; +update HZIMS_PARAM_BACKUPS pb,HZIMS_EM_INFO ei set pb.EM_NAME = ei.`NAME` WHERE pb.EM_CODE = ei.NUMBER; \ No newline at end of file diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/service/IOperMaintenanceLibraryService.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/service/IOperMaintenanceLibraryService.java index f274145..b50070b 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/service/IOperMaintenanceLibraryService.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/service/IOperMaintenanceLibraryService.java @@ -1,6 +1,8 @@ package com.hnac.hzims.operational.maintenance.service; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; +import com.hnac.hzims.common.support.constants.Order; import com.hnac.hzims.operational.maintenance.dto.OperMaintenanceLibraryDTO; import com.hnac.hzims.operational.maintenance.entity.OperMaintenanceLibraryEntity; import com.hnac.hzims.operational.maintenance.vo.OperMaintenanceLibraryVO; @@ -8,6 +10,8 @@ import org.springblade.core.mp.base.BaseService; import org.springblade.core.mp.support.Query; import org.springblade.core.tool.api.R; +import java.util.HashMap; + /** * 服务类 * @@ -28,4 +32,12 @@ public interface IOperMaintenanceLibraryService extends BaseService getQueryWrapper(OperMaintenanceLibraryEntity req) { + HashMap sort = new HashMap() {{ + put("create_time", Order.DESC); + }}; + LambdaQueryWrapper queryWrapper = com.hnac.hzims.common.support.utils.Condition.getQueryWrapper(req,OperMaintenanceLibraryEntity.class,sort); + return queryWrapper; + } + } diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/service/impl/OperMaintenanceLibraryServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/service/impl/OperMaintenanceLibraryServiceImpl.java index 0751fc1..d7ec498 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/service/impl/OperMaintenanceLibraryServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/service/impl/OperMaintenanceLibraryServiceImpl.java @@ -3,6 +3,7 @@ package com.hnac.hzims.operational.maintenance.service.impl; import com.baomidou.mybatisplus.core.conditions.Wrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; +import com.hnac.hzims.common.support.constants.Order; import com.hnac.hzims.operational.maintenance.dto.OperMaintenanceLibraryDTO; import com.hnac.hzims.operational.maintenance.entity.OperMaintenanceLibraryEntity; import com.hnac.hzims.operational.maintenance.mapper.OperMaintenanceLibraryMapper; @@ -27,6 +28,7 @@ import org.springframework.stereotype.Service; import java.time.YearMonth; import java.util.Arrays; import java.util.Date; +import java.util.HashMap; import java.util.List; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; @@ -61,25 +63,7 @@ public class OperMaintenanceLibraryServiceImpl extends BaseServiceImpl> list(OperMaintenanceLibraryDTO req, Query query) { - Wrapper queryWrapper = new LambdaQueryWrapper() {{ - orderByDesc(OperMaintenanceLibraryEntity::getCreateTime); - if (StringUtils.isNotBlank(req.getLibraryCode())) { - like(OperMaintenanceLibraryEntity::getLibraryCode, req.getLibraryCode()); - } - if (StringUtils.isNotBlank(req.getEmCode())) { - like(OperMaintenanceLibraryEntity::getEmCode, req.getEmCode()); - } - if (StringUtils.isNotBlank(req.getTypeCode())) { - eq(OperMaintenanceLibraryEntity::getTypeCode, req.getTypeCode()); - } - if (StringUtils.isNotBlank(req.getProcDefId())) { - eq(OperMaintenanceLibraryEntity::getProcDefId, req.getProcDefId()); - } - if (StringUtils.isNotBlank(req.getDisposers())) { - like(OperMaintenanceLibraryEntity::getDisposers, "," + req.getDisposers() + ","); - } - }}; - IPage pages = super.page(Condition.getPage(query), queryWrapper); + IPage pages = super.page(Condition.getPage(query), this.getQueryWrapper(BeanUtil.copy(req, OperMaintenanceLibraryEntity.class))); pages.setRecords(OperMaintenanceLibraryWrapper.build().listVO(pages.getRecords())); return R.data(pages); }