Commit 4c3f2885 authored by zhangyingbin's avatar zhangyingbin

新增许可信息框架

parent af8e88df
package com.yeejoin.amos.boot.module.ugp.api.dto;
import com.baomidou.mybatisplus.annotation.TableName;
import java.util.Date;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
* 单位许可信息表
*
* @author duanwei
* @date 2022-11-30
*/
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value="TzUgpUnitLicence对象", description="单位许可信息表")
public class UnitLicenceDto extends BaseDto {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "单位编码")
private String unitCode;
@ApiModelProperty(value = "单位名称")
private String unitName;
@ApiModelProperty(value = "许可地址")
private String licAddress;
@ApiModelProperty(value = "证书类型")
private String certType;
@ApiModelProperty(value = "证书类型code")
private String certTypeCode;
@ApiModelProperty(value = "证书编号")
private String certNo;
@ApiModelProperty(value = "有效期至")
private Date expiryDate;
@ApiModelProperty(value = "发证日期")
private Date issueDate;
@ApiModelProperty(value = "发证机关")
private String approvedOrgan;
@ApiModelProperty(value = "发证机关code")
private String approvedOrganCode;
@ApiModelProperty(value = "变更日期")
private Date changeDate;
@ApiModelProperty(value = "许可方式/许可状态")
private String applyType;
@ApiModelProperty(value = "许可方式/许可状态code")
private String applyTypeCode;
@ApiModelProperty(value = "许可评审方式")
private String appraisalType;
@ApiModelProperty(value = "许可评审方式code")
private String appraisalTypeCode;
@ApiModelProperty(value = "备注")
private String remark;
@ApiModelProperty(value = "许可项目/检验类型/设备品种编码")
private String itemCode;
@ApiModelProperty(value = "许可项目/检验类型/设备品种")
private String itemCodeName;
@ApiModelProperty(value = "许可子项目/检验项目/充装介质类别code")
private String subItemCode;
@ApiModelProperty(value = "许可子项目/检验项目/充装介质类别")
private String subItemName;
@ApiModelProperty(value = "许可参数/充装介质名称")
private String parameter;
@ApiModelProperty(value = "参数code")
private String parameterCode;
@ApiModelProperty(value = "固定检验地址")
private String itemAddress;
}
package com.yeejoin.amos.boot.module.ugp.api.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.util.Date;
/**
* 单位许可信息表
*
* @author duanwei
* @date 2022-11-30
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("tz_ugp_unit_licence")
@ApiModel(value="TzUgpUnitLicence对象", description="单位许可信息表")
public class UnitLicence extends BaseEntity {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "单位编码")
private String unitCode;
@ApiModelProperty(value = "单位名称")
private String unitName;
@ApiModelProperty(value = "许可地址")
private String licAddress;
@ApiModelProperty(value = "证书类型")
private String certType;
@ApiModelProperty(value = "证书类型code")
private String certTypeCode;
@ApiModelProperty(value = "证书编号")
private String certNo;
@ApiModelProperty(value = "有效期至")
private Date expiryDate;
@ApiModelProperty(value = "发证日期")
private Date issueDate;
@ApiModelProperty(value = "发证机关")
private String approvedOrgan;
@ApiModelProperty(value = "发证机关code")
private String approvedOrganCode;
@ApiModelProperty(value = "变更日期")
private Date changeDate;
@ApiModelProperty(value = "许可方式/许可状态")
private String applyType;
@ApiModelProperty(value = "许可方式/许可状态code")
private String applyTypeCode;
@ApiModelProperty(value = "许可评审方式")
private String appraisalType;
@ApiModelProperty(value = "许可评审方式code")
private String appraisalTypeCode;
@ApiModelProperty(value = "备注")
private String remark;
@ApiModelProperty(value = "许可项目/检验类型/设备品种编码")
private String itemCode;
@ApiModelProperty(value = "许可项目/检验类型/设备品种")
private String itemCodeName;
@ApiModelProperty(value = "许可子项目/检验项目/充装介质类别code")
private String subItemCode;
@ApiModelProperty(value = "许可子项目/检验项目/充装介质类别")
private String subItemName;
@ApiModelProperty(value = "许可参数/充装介质名称")
private String parameter;
@ApiModelProperty(value = "参数code")
private String parameterCode;
@ApiModelProperty(value = "固定检验地址")
private String itemAddress;
}
package com.yeejoin.amos.boot.module.ugp.api.mapper;
import com.yeejoin.amos.boot.module.ugp.api.entity.UnitLicence;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* 单位许可信息表 Mapper 接口
*
* @author duanwei
* @date 2022-11-30
*/
public interface UnitLicenceMapper extends BaseMapper<UnitLicence> {
}
package com.yeejoin.amos.boot.module.ugp.api.service;
import com.yeejoin.amos.boot.module.ugp.api.entity.UnitLicence;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* 单位许可信息表 服务类
*
* @author duanwei
* @date 2022-11-30
*/
public interface IUnitLicenceService extends IService<UnitLicence> {
}
package com.yeejoin.amos.boot.module.ugp.biz.controller;
import com.yeejoin.amos.boot.biz.common.utils.NameUtils;
import com.yeejoin.amos.boot.module.ugp.api.entity.UnitLicence;
import com.yeejoin.amos.boot.module.ugp.api.service.IUnitLicenceService;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestMapping;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.Api;
import org.apache.commons.lang3.StringUtils;
import org.springframework.web.bind.annotation.RestController;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.springframework.beans.factory.annotation.Autowired;
import javax.servlet.http.HttpServletRequest;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import java.util.Arrays;
/**
* 单位许可信息表
*
* @author duanwei
* @date 2022-11-30
*/
@RestController
@Api(tags = "单位许可信息表Api")
@RequestMapping(value = "/tz-ugp-unit-licence", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public class UnitLicenceController {
@Autowired
IUnitLicenceService iUnitLicenceService;
/**
* 新增单位许可信息表
* @return
*/
@RequestMapping(value = "/save", method = RequestMethod.POST)
@ApiOperation(httpMethod = "POST", value = "新增单位许可信息表", notes = "新增单位许可信息表")
public boolean saveTzUgpUnitLicence(HttpServletRequest request, @RequestBody UnitLicence unitLicence){
return iUnitLicenceService.save(unitLicence);
}
/**
* 根据id删除
* @param id
* @return
*/
@RequestMapping(value = "/{id}", method = RequestMethod.DELETE)
@ApiOperation(httpMethod = "DELETE", value = "根据id删除", notes = "根据id删除")
public boolean deleteById(HttpServletRequest request, @PathVariable Long id){
return iUnitLicenceService.removeById(id);
}
/**
* 修改单位许可信息表
* @return
*/
@RequestMapping(value = "/updateById", method = RequestMethod.PUT)
@ApiOperation(httpMethod = "PUT", value = "修改单位许可信息表", notes = "修改单位许可信息表")
public boolean updateByIdTzUgpUnitLicence(HttpServletRequest request, @RequestBody UnitLicence unitLicence){
return iUnitLicenceService.updateById(unitLicence);
}
/**
* 根据id查询
* @param id
* @return
*/
@RequestMapping(value = "/{id}", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "根据id查询", notes = "根据id查询")
public UnitLicence selectById(HttpServletRequest request, @PathVariable Long id){
return iUnitLicenceService.getById(id);
}
/**
* 列表分页查询
* @return
*/
@RequestMapping(value = "/list", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "列表分页查询", notes = "列表分页查询")
public IPage<UnitLicence> listPage(String pageNum, String pageSize,
UnitLicence unitLicence){
Page<UnitLicence> pageBean;
QueryWrapper<UnitLicence> tzUgpUnitLicenceQueryWrapper = new QueryWrapper<>();
Class<? extends UnitLicence> aClass = unitLicence.getClass();
Arrays.stream(aClass.getDeclaredFields()).forEach(field -> {
try {
field.setAccessible(true);
Object o = field.get(unitLicence);
if (o != null) {
Class<?> type = field.getType();
String name = NameUtils.camel2Underline(field.getName());
if (type.equals(Integer.class)) {
Integer fileValue = (Integer) field.get(unitLicence);
tzUgpUnitLicenceQueryWrapper.eq(name, fileValue);
} else if (type.equals(Long.class)) {
Long fileValue = (Long) field.get(unitLicence);
tzUgpUnitLicenceQueryWrapper.eq(name, fileValue);
} else if (type.equals(String.class)) {
String fileValue = (String) field.get(unitLicence);
tzUgpUnitLicenceQueryWrapper.eq(name, fileValue);
} else {
String fileValue = (String) field.get(unitLicence);
tzUgpUnitLicenceQueryWrapper.eq(name, fileValue);
}
}
}catch (Exception e) {
}
});
IPage<UnitLicence> page;
if (StringUtils.isBlank(pageNum) ||StringUtils.isBlank(pageSize)) {
pageBean = new Page<>(0, Long.MAX_VALUE);
}else{
pageBean = new Page<>(Integer.parseInt(pageNum), Integer.parseInt(pageSize));
}
page = iUnitLicenceService.page(pageBean, tzUgpUnitLicenceQueryWrapper);
return page;
}
}
package com.yeejoin.amos.boot.module.ugp.biz.service.impl;
import com.yeejoin.amos.boot.module.ugp.api.entity.UnitLicence;
import com.yeejoin.amos.boot.module.ugp.api.mapper.UnitLicenceMapper;
import com.yeejoin.amos.boot.module.ugp.api.service.IUnitLicenceService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
/**
* 单位许可信息表 服务实现类
*
* @author duanwei
* @date 2022-11-30
*/
@Service
public class UnitLicenceServiceImpl extends ServiceImpl<UnitLicenceMapper, UnitLicence> implements IUnitLicenceService {
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment