From ceb2ac74a86f6dac13840d71176c131defa9c885 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E6=B3=BD=E8=85=BE?= <1178634255@qq.com> Date: Fri, 25 Aug 2023 09:29:56 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=BE=E5=A4=87=E7=AE=A1=E7=90=86-=E8=AE=BE?= =?UTF-8?q?=E5=A4=87=E8=B5=84=E8=B4=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../inv/DeviceAssetCertController.java | 34 +++++++ .../purchase/SupCertController.java | 2 +- .../api/dao/inv/DeviceAssetCertMapper.java | 8 ++ .../api/entity/inv/DeviceAssetCertEntity.java | 2 +- .../api/req/inv/FilterInvCertRequest.java | 99 +++++++++++++++++++ .../service/inv/DeptDeviceDetailService.java | 2 + .../service/inv/DeviceAssetCertService.java | 13 ++- .../inv/impl/DeviceAssetCertServiceImpl.java | 37 +++++++ .../mapper/inv/DeviceAssetCertMapper.xml | 28 +++++- 9 files changed, 219 insertions(+), 6 deletions(-) create mode 100644 src/main/java/com/glxp/api/req/inv/FilterInvCertRequest.java create mode 100644 src/main/java/com/glxp/api/service/inv/impl/DeviceAssetCertServiceImpl.java diff --git a/src/main/java/com/glxp/api/controller/inv/DeviceAssetCertController.java b/src/main/java/com/glxp/api/controller/inv/DeviceAssetCertController.java index 4dd49b56..dae7c9d4 100644 --- a/src/main/java/com/glxp/api/controller/inv/DeviceAssetCertController.java +++ b/src/main/java/com/glxp/api/controller/inv/DeviceAssetCertController.java @@ -1,15 +1,49 @@ package com.glxp.api.controller.inv; +import com.github.pagehelper.PageInfo; +import com.glxp.api.annotation.AuthRuleAnnotation; +import com.glxp.api.common.enums.ResultEnum; +import com.glxp.api.common.res.BaseResponse; +import com.glxp.api.common.util.ResultVOUtils; import com.glxp.api.controller.BaseController; +import com.glxp.api.entity.inv.DeviceAssetCertEntity; +import com.glxp.api.entity.purchase.SupCertEntity; +import com.glxp.api.req.inv.FilterInvCertRequest; +import com.glxp.api.req.purchase.FilterSupCertRequest; +import com.glxp.api.res.PageSimpleResponse; +import com.glxp.api.service.inv.DeviceAssetCertService; +import com.glxp.api.service.purchase.SupCertService; import lombok.extern.slf4j.Slf4j; +import org.springframework.validation.BindingResult; +import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RestController; +import javax.annotation.Resource; +import java.util.List; + /** * 设备资质证书,技术材料相关 */ @Slf4j @RestController public class DeviceAssetCertController extends BaseController { + @Resource + private DeviceAssetCertService deviceAssetCertService; +// @AuthRuleAnnotation("") + @GetMapping("/inv/device/cert/filter") + public BaseResponse filterDeviceCert(FilterInvCertRequest filterInvCertRequest) { + + List deviceAssetCertEntityList + = deviceAssetCertService.filterDeviceCert(filterInvCertRequest); + PageInfo pageInfo; + pageInfo = new PageInfo<>(deviceAssetCertEntityList); + PageSimpleResponse pageSimpleResponse = new PageSimpleResponse<>(); + pageSimpleResponse.setTotal(pageInfo.getTotal()); + pageSimpleResponse.setList(deviceAssetCertEntityList); + return ResultVOUtils.success(pageSimpleResponse); + } + + } diff --git a/src/main/java/com/glxp/api/controller/purchase/SupCertController.java b/src/main/java/com/glxp/api/controller/purchase/SupCertController.java index ed446907..b2d0fa0b 100644 --- a/src/main/java/com/glxp/api/controller/purchase/SupCertController.java +++ b/src/main/java/com/glxp/api/controller/purchase/SupCertController.java @@ -66,7 +66,7 @@ public class SupCertController { private SystemPDFModuleService systemPDFModuleService; - @AuthRuleAnnotation("") +// @AuthRuleAnnotation("") @GetMapping("/sup/company/cert/filter") public BaseResponse filterCompanyCert(FilterSupCertRequest filterSupCertRequest, BindingResult bindingResult) { diff --git a/src/main/java/com/glxp/api/dao/inv/DeviceAssetCertMapper.java b/src/main/java/com/glxp/api/dao/inv/DeviceAssetCertMapper.java index 12e126bd..e42b596e 100644 --- a/src/main/java/com/glxp/api/dao/inv/DeviceAssetCertMapper.java +++ b/src/main/java/com/glxp/api/dao/inv/DeviceAssetCertMapper.java @@ -2,8 +2,16 @@ package com.glxp.api.dao.inv; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.glxp.api.entity.inv.DeviceAssetCertEntity; +import com.glxp.api.entity.purchase.SupCertEntity; +import com.glxp.api.req.inv.FilterInvCertRequest; +import com.glxp.api.req.purchase.FilterSupCertRequest; import org.apache.ibatis.annotations.Mapper; +import java.util.List; + @Mapper public interface DeviceAssetCertMapper extends BaseMapper { + + List filterCompanyCert(FilterInvCertRequest filterInvCertRequest); + } diff --git a/src/main/java/com/glxp/api/entity/inv/DeviceAssetCertEntity.java b/src/main/java/com/glxp/api/entity/inv/DeviceAssetCertEntity.java index 948f4002..54f0681a 100644 --- a/src/main/java/com/glxp/api/entity/inv/DeviceAssetCertEntity.java +++ b/src/main/java/com/glxp/api/entity/inv/DeviceAssetCertEntity.java @@ -89,7 +89,7 @@ public class DeviceAssetCertEntity implements Serializable { * 更新人 */ @TableField(value = "updateUser") - private Date updateUser; + private String updateUser; /** * 更新时间 diff --git a/src/main/java/com/glxp/api/req/inv/FilterInvCertRequest.java b/src/main/java/com/glxp/api/req/inv/FilterInvCertRequest.java new file mode 100644 index 00000000..813d4d3b --- /dev/null +++ b/src/main/java/com/glxp/api/req/inv/FilterInvCertRequest.java @@ -0,0 +1,99 @@ +package com.glxp.api.req.inv; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.glxp.api.util.page.ListPageRequest; +import lombok.Data; + +import java.time.LocalDateTime; + +/** + * 查询部门设备明细接口参数 + */ +@Data +public class FilterInvCertRequest extends ListPageRequest { + /** + * + */ + @TableId(value = "id") + private Long id; + + /** + * 设备资产编码外键 + */ + @TableField(value = "devCodeFk") + private String devCodeFk; + + /** + * 证书名称 + */ + @TableField(value = "name") + private String name; + + /** + * 证书编码 + */ + @TableField(value = "code") + private String code; + + /** + * 文件路径 + */ + @TableField(value = "filePath") + private String filePath; + + /** + * 生效期 + */ + @TableField(value = "vailDate") + private LocalDateTime vailDate; + + /** + * 失效期 + */ + @TableField(value = "expireDate") + private LocalDateTime expireDate; + + /** + * 证书状态 + */ + @TableField(value = "status") + private Integer status; + + /** + * 证书类型(1:资质证书;2:技术材料) + */ + @TableField(value = "type") + private Integer type; + + /** + * 备注说明 + */ + @TableField(value = "remark") + private String remark; + + /** + * 创建人 + */ + @TableField(value = "createUser") + private String createUser; + + /** + * 创建时间 + */ + @TableField(value = "createTime") + private LocalDateTime createTime; + + /** + * 更新人 + */ + @TableField(value = "updateUser") + private String updateUser; + + /** + * 更新时间 + */ + @TableField(value = "updateTime") + private LocalDateTime updateTime; + +} diff --git a/src/main/java/com/glxp/api/service/inv/DeptDeviceDetailService.java b/src/main/java/com/glxp/api/service/inv/DeptDeviceDetailService.java index d215a20c..dd55310a 100644 --- a/src/main/java/com/glxp/api/service/inv/DeptDeviceDetailService.java +++ b/src/main/java/com/glxp/api/service/inv/DeptDeviceDetailService.java @@ -2,8 +2,10 @@ package com.glxp.api.service.inv; import com.glxp.api.common.res.BaseResponse; import com.glxp.api.entity.inv.DeptDeviceDetailEntity; +import com.glxp.api.entity.inv.DeviceAssetCertEntity; import com.glxp.api.req.inv.AddDeptDeviceRequest; import com.glxp.api.req.inv.FilterDeptDeviceRequest; +import com.glxp.api.req.inv.FilterInvCertRequest; import com.glxp.api.res.inv.DeptDeviceDetailResponse; import java.util.List; diff --git a/src/main/java/com/glxp/api/service/inv/DeviceAssetCertService.java b/src/main/java/com/glxp/api/service/inv/DeviceAssetCertService.java index ded0133a..771256ce 100644 --- a/src/main/java/com/glxp/api/service/inv/DeviceAssetCertService.java +++ b/src/main/java/com/glxp/api/service/inv/DeviceAssetCertService.java @@ -1,10 +1,17 @@ package com.glxp.api.service.inv; +import com.baomidou.mybatisplus.extension.service.IService; +import com.glxp.api.req.inv.FilterInvCertRequest; import org.springframework.stereotype.Service; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.glxp.api.entity.inv.DeviceAssetCertEntity; -import com.glxp.api.dao.inv.DeviceAssetCertMapper; + + +import java.util.List; + @Service -public class DeviceAssetCertService extends ServiceImpl { +public interface DeviceAssetCertService extends IService { + List filterDeviceCert(FilterInvCertRequest filterInvCertRequest); + + } diff --git a/src/main/java/com/glxp/api/service/inv/impl/DeviceAssetCertServiceImpl.java b/src/main/java/com/glxp/api/service/inv/impl/DeviceAssetCertServiceImpl.java new file mode 100644 index 00000000..a7c000c1 --- /dev/null +++ b/src/main/java/com/glxp/api/service/inv/impl/DeviceAssetCertServiceImpl.java @@ -0,0 +1,37 @@ +package com.glxp.api.service.inv.impl; + + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.github.pagehelper.PageHelper; +import com.glxp.api.dao.inv.DeviceAssetCertMapper; +import com.glxp.api.entity.inv.DeviceAssetCertEntity; +import com.glxp.api.req.inv.FilterInvCertRequest; +import com.glxp.api.service.inv.DeviceAssetCertService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import javax.annotation.Resource; +import java.util.Collections; +import java.util.List; + +@Slf4j +@Service +@Transactional(rollbackFor = Exception.class) +public class DeviceAssetCertServiceImpl extends ServiceImpl implements DeviceAssetCertService { + @Resource + DeviceAssetCertMapper deviceAssetCertMapper; + + + @Override + public List filterDeviceCert(FilterInvCertRequest filterInvCertRequest) { + if (filterInvCertRequest == null) { + return Collections.emptyList(); + } + if (filterInvCertRequest.getPage() != null) { + int offset = (filterInvCertRequest.getPage() - 1) * filterInvCertRequest.getLimit(); + PageHelper.offsetPage(offset, filterInvCertRequest.getLimit()); + } + return deviceAssetCertMapper.filterCompanyCert(filterInvCertRequest); + } +} diff --git a/src/main/resources/mybatis/mapper/inv/DeviceAssetCertMapper.xml b/src/main/resources/mybatis/mapper/inv/DeviceAssetCertMapper.xml index a9318788..68731380 100644 --- a/src/main/resources/mybatis/mapper/inv/DeviceAssetCertMapper.xml +++ b/src/main/resources/mybatis/mapper/inv/DeviceAssetCertMapper.xml @@ -16,7 +16,7 @@ - + @@ -24,4 +24,30 @@ id, devCodeFk, `name`, code, filePath, vailDate, expireDate, `status`, `type`, remark, `createUser`, createTime, updateUser, updateTime + + +