设备管理-设备资质

dev2.0
黄泽腾 2 years ago
parent a77d2ca199
commit ceb2ac74a8

@ -1,15 +1,49 @@
package com.glxp.api.controller.inv; 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.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 lombok.extern.slf4j.Slf4j;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.util.List;
/** /**
* *
*/ */
@Slf4j @Slf4j
@RestController @RestController
public class DeviceAssetCertController extends BaseController { public class DeviceAssetCertController extends BaseController {
@Resource
private DeviceAssetCertService deviceAssetCertService;
// @AuthRuleAnnotation("")
@GetMapping("/inv/device/cert/filter")
public BaseResponse filterDeviceCert(FilterInvCertRequest filterInvCertRequest) {
List<DeviceAssetCertEntity> deviceAssetCertEntityList
= deviceAssetCertService.filterDeviceCert(filterInvCertRequest);
PageInfo<DeviceAssetCertEntity> pageInfo;
pageInfo = new PageInfo<>(deviceAssetCertEntityList);
PageSimpleResponse<DeviceAssetCertEntity> pageSimpleResponse = new PageSimpleResponse<>();
pageSimpleResponse.setTotal(pageInfo.getTotal());
pageSimpleResponse.setList(deviceAssetCertEntityList);
return ResultVOUtils.success(pageSimpleResponse);
}
} }

@ -66,7 +66,7 @@ public class SupCertController {
private SystemPDFModuleService systemPDFModuleService; private SystemPDFModuleService systemPDFModuleService;
@AuthRuleAnnotation("") // @AuthRuleAnnotation("")
@GetMapping("/sup/company/cert/filter") @GetMapping("/sup/company/cert/filter")
public BaseResponse filterCompanyCert(FilterSupCertRequest filterSupCertRequest, public BaseResponse filterCompanyCert(FilterSupCertRequest filterSupCertRequest,
BindingResult bindingResult) { BindingResult bindingResult) {

@ -2,8 +2,16 @@ package com.glxp.api.dao.inv;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.glxp.api.entity.inv.DeviceAssetCertEntity; 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 org.apache.ibatis.annotations.Mapper;
import java.util.List;
@Mapper @Mapper
public interface DeviceAssetCertMapper extends BaseMapper<DeviceAssetCertEntity> { public interface DeviceAssetCertMapper extends BaseMapper<DeviceAssetCertEntity> {
List<DeviceAssetCertEntity> filterCompanyCert(FilterInvCertRequest filterInvCertRequest);
} }

@ -89,7 +89,7 @@ public class DeviceAssetCertEntity implements Serializable {
* *
*/ */
@TableField(value = "updateUser") @TableField(value = "updateUser")
private Date updateUser; private String updateUser;
/** /**
* *

@ -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;
/**
* 12
*/
@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;
}

@ -2,8 +2,10 @@ package com.glxp.api.service.inv;
import com.glxp.api.common.res.BaseResponse; import com.glxp.api.common.res.BaseResponse;
import com.glxp.api.entity.inv.DeptDeviceDetailEntity; 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.AddDeptDeviceRequest;
import com.glxp.api.req.inv.FilterDeptDeviceRequest; import com.glxp.api.req.inv.FilterDeptDeviceRequest;
import com.glxp.api.req.inv.FilterInvCertRequest;
import com.glxp.api.res.inv.DeptDeviceDetailResponse; import com.glxp.api.res.inv.DeptDeviceDetailResponse;
import java.util.List; import java.util.List;

@ -1,10 +1,17 @@
package com.glxp.api.service.inv; 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 org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.glxp.api.entity.inv.DeviceAssetCertEntity; import com.glxp.api.entity.inv.DeviceAssetCertEntity;
import com.glxp.api.dao.inv.DeviceAssetCertMapper;
import java.util.List;
@Service @Service
public class DeviceAssetCertService extends ServiceImpl<DeviceAssetCertMapper, DeviceAssetCertEntity> { public interface DeviceAssetCertService extends IService<DeviceAssetCertEntity> {
List<DeviceAssetCertEntity> filterDeviceCert(FilterInvCertRequest filterInvCertRequest);
} }

@ -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<DeviceAssetCertMapper, DeviceAssetCertEntity> implements DeviceAssetCertService {
@Resource
DeviceAssetCertMapper deviceAssetCertMapper;
@Override
public List<DeviceAssetCertEntity> 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);
}
}

@ -16,7 +16,7 @@
<result column="remark" jdbcType="VARCHAR" property="remark" /> <result column="remark" jdbcType="VARCHAR" property="remark" />
<result column="createUser" jdbcType="VARCHAR" property="createUser" /> <result column="createUser" jdbcType="VARCHAR" property="createUser" />
<result column="createTime" jdbcType="TIMESTAMP" property="createTime" /> <result column="createTime" jdbcType="TIMESTAMP" property="createTime" />
<result column="updateUser" jdbcType="TIMESTAMP" property="updateUser" /> <result column="updateUser" jdbcType="VARCHAR" property="updateUser" />
<result column="updateTime" jdbcType="TIMESTAMP" property="updateTime" /> <result column="updateTime" jdbcType="TIMESTAMP" property="updateTime" />
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
@ -24,4 +24,30 @@
id, devCodeFk, `name`, code, filePath, vailDate, expireDate, `status`, `type`, remark, id, devCodeFk, `name`, code, filePath, vailDate, expireDate, `status`, `type`, remark,
`createUser`, createTime, updateUser, updateTime `createUser`, createTime, updateUser, updateTime
</sql> </sql>
<select id="filterCompanyCert" parameterType="com.glxp.api.req.inv.FilterInvCertRequest"
resultType="com.glxp.api.entity.inv.DeviceAssetCertEntity">
select * from device_asset_cert
<where>
<if test="devCodeFk != '' and devCodeFk!=null">
and devCodeFk = #{devCodeFk}
</if>
<if test="name != '' and name!=null">
and name = #{name}
</if>
<if test="code != '' and code!=null">
and code = #{code}
</if>
<if test="status != '' and status!=null">
and status = #{status}
</if>
<if test="type != '' and type!=null">
and `type` = #{type}
</if>
</where>
ORDER BY id DESC
</select>
</mapper> </mapper>

Loading…
Cancel
Save