试验标准
This commit is contained in:
parent
bb582c76c2
commit
c4d5d1200f
|
|
@ -20,7 +20,7 @@ import java.util.Set;
|
|||
* @create 2021/2/9 14:41
|
||||
*/
|
||||
@SuppressWarnings("unused")
|
||||
@Component
|
||||
@Component(value = "ValidatorsUtils")
|
||||
public final class ValidatorsUtils {
|
||||
@Resource
|
||||
private Validator validator;
|
||||
|
|
|
|||
|
|
@ -1,10 +1,23 @@
|
|||
package com.bonus.aqgqj.basis.controller;
|
||||
|
||||
import com.bonus.aqgqj.annotation.DecryptAndVerify;
|
||||
import com.bonus.aqgqj.annotation.LogAnnotation;
|
||||
import com.bonus.aqgqj.basis.entity.dto.ParamsDto;
|
||||
import com.bonus.aqgqj.basis.entity.vo.ExperimentStandardVo;
|
||||
import com.bonus.aqgqj.basis.service.ExperimentStandardService;
|
||||
import com.bonus.aqgqj.model.Role;
|
||||
import com.bonus.aqgqj.system.vo.EncryptedReq;
|
||||
import com.bonus.aqgqj.utils.ServerResponse;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @className:ExperimentStandardController
|
||||
|
|
@ -15,8 +28,20 @@ import javax.annotation.Resource;
|
|||
*/
|
||||
@RestController
|
||||
@RequestMapping("/experimentStandard/")
|
||||
@Slf4j
|
||||
public class ExperimentStandardController {
|
||||
|
||||
@Resource(name = "ExperimentStandardService")
|
||||
private ExperimentStandardService service;
|
||||
|
||||
@PostMapping(value = "getList")
|
||||
@DecryptAndVerify(decryptedClass = ParamsDto.class)//加解密统一管理
|
||||
@LogAnnotation(operModul = "试验标准管理", operation = "查询列表", operDesc = "系统级事件",operType="查询")
|
||||
// @PreAuthorize("@pms.hasPermission('sys:experimentStandard:query')" )
|
||||
public ServerResponse getList(EncryptedReq<ParamsDto> data) {
|
||||
PageHelper.startPage(data.getData().getPage(), data.getData().getLimit());
|
||||
List<ExperimentStandardVo> list = service.getList(data.getData());
|
||||
PageInfo<ExperimentStandardVo> pageInfo = new PageInfo<>(list);
|
||||
return ServerResponse.createSuccessPage(pageInfo,data.getData().getPage(),data.getData().getLimit());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,14 +1,26 @@
|
|||
package com.bonus.aqgqj.basis.dao;
|
||||
|
||||
import com.bonus.aqgqj.basis.entity.dto.ParamsDto;
|
||||
import com.bonus.aqgqj.basis.entity.vo.ExperimentStandardVo;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @className:ExperimentStandardMapper
|
||||
* @author:cwchen
|
||||
* @date:2024-07-18-11:22
|
||||
* @version:1.0
|
||||
* @description:实验标准-mapper
|
||||
* @description:试验标准-mapper
|
||||
*/
|
||||
@Repository(value = "ExperimentStandardMapper")
|
||||
public interface ExperimentStandardMapper {
|
||||
/**
|
||||
* 试验标准列表
|
||||
* @param dto
|
||||
* @return List<ExperimentStandardVo>
|
||||
* @author cwchen
|
||||
* @date 2024/7/18 14:00
|
||||
*/
|
||||
List<ExperimentStandardVo> getList(ParamsDto dto);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
package com.bonus.aqgqj.basis.entity.dto;
|
||||
|
||||
import com.bonus.aqgqj.base.entity.PageEntity;
|
||||
|
||||
/**
|
||||
* @className:ExperimentStandardDto
|
||||
* @author:cwchen
|
||||
|
|
@ -7,5 +9,7 @@ package com.bonus.aqgqj.basis.entity.dto;
|
|||
* @version:1.0
|
||||
* @description:实验标准-dto
|
||||
*/
|
||||
public class ExperimentStandardDto {
|
||||
public class ExperimentStandardDto{
|
||||
|
||||
private String id;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,18 @@
|
|||
package com.bonus.aqgqj.basis.entity.dto;
|
||||
|
||||
import com.bonus.aqgqj.base.entity.PageEntity;
|
||||
|
||||
/**
|
||||
* @className:ParamsDto
|
||||
* @author:cwchen
|
||||
* @date:2024-07-18-13:51
|
||||
* @version:1.0
|
||||
* @description:params-dto
|
||||
*/
|
||||
public class ParamsDto extends PageEntity {
|
||||
|
||||
/**
|
||||
* 设备类型
|
||||
*/
|
||||
private String devTypeCode;
|
||||
}
|
||||
|
|
@ -1,14 +1,68 @@
|
|||
package com.bonus.aqgqj.basis.entity.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @className:ExperimentStandardVo
|
||||
* @author:cwchen
|
||||
* @date:2024-07-18-11:21
|
||||
* @version:1.0
|
||||
* @description:实验标准-vo
|
||||
* @description:试验标准-vo
|
||||
*/
|
||||
@Data
|
||||
public class ExperimentStandardVo {
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
private Long id;
|
||||
/**
|
||||
* 设备类型编码
|
||||
*/
|
||||
private String devTypeCode;
|
||||
/**
|
||||
* 设备类型名称
|
||||
*/
|
||||
private String devTypeName;
|
||||
/**
|
||||
* 设备规格型号
|
||||
*/
|
||||
private String devModule;
|
||||
/**
|
||||
* 实验地点编码
|
||||
*/
|
||||
private String experLocalCode;
|
||||
/**
|
||||
* 实验地点
|
||||
*/
|
||||
private String experLocal;
|
||||
/**
|
||||
* 删除状态
|
||||
*/
|
||||
@JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
|
||||
private Integer delFlag = 0;
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
|
||||
private Long createUser;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date createTime;
|
||||
/**
|
||||
* 修改人
|
||||
*/
|
||||
@JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
|
||||
private Long updateUser;
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date updateTime;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,11 +1,24 @@
|
|||
package com.bonus.aqgqj.basis.service;
|
||||
|
||||
import com.bonus.aqgqj.basis.entity.dto.ParamsDto;
|
||||
import com.bonus.aqgqj.basis.entity.vo.ExperimentStandardVo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @className:ExperimentStandardService
|
||||
* @author:cwchen
|
||||
* @date:2024-07-18-11:19
|
||||
* @version:1.0
|
||||
* @description:实验标准管理-service
|
||||
* @description:试验标准管理-service
|
||||
*/
|
||||
public interface ExperimentStandardService {
|
||||
/**
|
||||
* 试验标准列表
|
||||
* @param data
|
||||
* @return List<ExperimentStandardVo>
|
||||
* @author cwchen
|
||||
* @date 2024/7/18 13:58
|
||||
*/
|
||||
List<ExperimentStandardVo> getList(ParamsDto data);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,18 +1,23 @@
|
|||
package com.bonus.aqgqj.basis.service.impl;
|
||||
|
||||
import com.bonus.aqgqj.advice.ValidatorsUtils;
|
||||
import com.bonus.aqgqj.basis.dao.ExperimentStandardMapper;
|
||||
import com.bonus.aqgqj.basis.entity.dto.ParamsDto;
|
||||
import com.bonus.aqgqj.basis.entity.vo.ExperimentStandardVo;
|
||||
import com.bonus.aqgqj.basis.service.ExperimentStandardService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @className:ExperimentStandardServiceImpl
|
||||
* @author:cwchen
|
||||
* @date:2024-07-18-11:20
|
||||
* @version:1.0
|
||||
* @description:实验标准管理-impl
|
||||
* @description:试验标准管理-impl
|
||||
*/
|
||||
@Service(value = "ExperimentStandardService")
|
||||
@Slf4j
|
||||
|
|
@ -20,4 +25,19 @@ public class ExperimentStandardServiceImpl implements ExperimentStandardService
|
|||
|
||||
@Resource(name = "ExperimentStandardMapper")
|
||||
private ExperimentStandardMapper mapper;
|
||||
|
||||
@Resource(name = "ValidatorsUtils")
|
||||
private ValidatorsUtils validatorsUtils;
|
||||
|
||||
@Override
|
||||
public List<ExperimentStandardVo> getList(ParamsDto dto) {
|
||||
List<ExperimentStandardVo> list = new ArrayList<>();
|
||||
try {
|
||||
list = mapper.getList(dto);
|
||||
return list;
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString(),e);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,4 +3,17 @@
|
|||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.bonus.aqgqj.basis.dao.ExperimentStandardMapper">
|
||||
|
||||
<!--试验标准列表-->
|
||||
<select id="getList" resultType="com.bonus.aqgqj.basis.entity.vo.ExperimentStandardVo">
|
||||
SELECT id,
|
||||
dev_type_code AS devTypeCode,
|
||||
dev_type_name AS devTypeName,
|
||||
update_time AS updateTime
|
||||
FROM tb_exper_config
|
||||
<where>
|
||||
<if test="devTypeCode!=null and devTypeCode!=''">
|
||||
dev_type_code = #{devTypeCode}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
|||
Loading…
Reference in New Issue