Exe版本管理
This commit is contained in:
parent
0fa8649d69
commit
2be88a032b
@ -0,0 +1,169 @@
|
|||||||
|
package com.zhgd.xmgl.modules.basicdata.controller;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.zhgd.jeecg.common.api.vo.Result;
|
||||||
|
import com.zhgd.jeecg.common.system.query.QueryGenerator;
|
||||||
|
import com.zhgd.xmgl.modules.basicdata.service.IExeVersionService;
|
||||||
|
import com.zhgd.xmgl.modules.basicdata.entity.ExeVersion;
|
||||||
|
import com.zhgd.xmgl.util.MessageUtil;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiImplicitParam;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.apache.commons.collections.MapUtils;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Title: Controller
|
||||||
|
* @Description: Exe版本管理
|
||||||
|
* @author: pds
|
||||||
|
* @date: 2021-03-04
|
||||||
|
* @version: V1.0
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/xmgl/exeVersion")
|
||||||
|
@Slf4j
|
||||||
|
@Api(tags = "Exe版本管理相关Api")
|
||||||
|
public class ExeVersionController {
|
||||||
|
@Autowired
|
||||||
|
private IExeVersionService exeVersionService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页列表查询
|
||||||
|
* @param exeVersion
|
||||||
|
* @param pageNo
|
||||||
|
* @param pageSize
|
||||||
|
* @param req
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "分页列表查询Exe版本管理信息", notes = "分页列表查询Exe版本管理信息", httpMethod = "GET")
|
||||||
|
@GetMapping(value = "/list")
|
||||||
|
public Result<IPage<ExeVersion>> queryPageList(ExeVersion exeVersion,
|
||||||
|
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||||
|
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||||
|
HttpServletRequest req) {
|
||||||
|
Result<IPage<ExeVersion>> result = new Result<IPage<ExeVersion>>();
|
||||||
|
QueryWrapper<ExeVersion> queryWrapper = QueryGenerator.initQueryWrapper(exeVersion, req.getParameterMap());
|
||||||
|
Page<ExeVersion> page = new Page<ExeVersion>(pageNo, pageSize);
|
||||||
|
IPage<ExeVersion> pageList = exeVersionService.page(page, queryWrapper);
|
||||||
|
result.setSuccess(true);
|
||||||
|
result.setResult(pageList);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加
|
||||||
|
* @param exeVersion
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "添加Exe版本管理信息", notes = "添加Exe版本管理信息", httpMethod = "POST")
|
||||||
|
@PostMapping(value = "/add")
|
||||||
|
public Result<ExeVersion> add(@RequestBody ExeVersion exeVersion) {
|
||||||
|
Result<ExeVersion> result = new Result<ExeVersion>();
|
||||||
|
try {
|
||||||
|
QueryWrapper<ExeVersion> queryWrapper=new QueryWrapper<>();
|
||||||
|
exeVersionService.remove(queryWrapper);
|
||||||
|
exeVersionService.save(exeVersion);
|
||||||
|
result.successMsg(MessageUtil.get("addSucess"));
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("error:", e);
|
||||||
|
log.info(e.getMessage());
|
||||||
|
result.error500(MessageUtil.get("failErr"));
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 编辑
|
||||||
|
* @param exeVersion
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "编辑Exe版本管理信息", notes = "编辑Exe版本管理信息" , httpMethod="POST")
|
||||||
|
@PostMapping(value = "/edit")
|
||||||
|
public Result<ExeVersion> edit(@RequestBody ExeVersion exeVersion) {
|
||||||
|
Result<ExeVersion> result = new Result<ExeVersion>();
|
||||||
|
ExeVersion exeVersionEntity = exeVersionService.getById(exeVersion.getId());
|
||||||
|
if(exeVersionEntity==null) {
|
||||||
|
result.error500(MessageUtil.get("notFindErr"));
|
||||||
|
}else {
|
||||||
|
boolean ok = exeVersionService.updateById(exeVersion);
|
||||||
|
|
||||||
|
if(ok) {
|
||||||
|
result.successMsg(MessageUtil.get("editSucess"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过id删除
|
||||||
|
* @param
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "删除Exe版本管理信息", notes = "删除Exe版本管理信息", httpMethod = "POST")
|
||||||
|
@ApiImplicitParam(name = "id", value = "Exe版本管理ID", paramType = "body", required = true, dataType = "Integer")
|
||||||
|
@PostMapping(value = "/delete")
|
||||||
|
public Result<ExeVersion> delete(@RequestBody Map<String,Object> map) {
|
||||||
|
Result<ExeVersion> result = new Result<ExeVersion>();
|
||||||
|
ExeVersion exeVersion = exeVersionService.getById(MapUtils.getString(map,"id"));
|
||||||
|
if(exeVersion==null) {
|
||||||
|
result.error500(MessageUtil.get("notFindErr"));
|
||||||
|
}else {
|
||||||
|
boolean ok = exeVersionService.removeById(MapUtils.getString(map,"id"));
|
||||||
|
if(ok) {
|
||||||
|
result.successMsg(MessageUtil.get("deleteSucess"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过id查询
|
||||||
|
* @param
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "通过id查询Exe版本管理信息", notes = "通过id查询Exe版本管理信息", httpMethod = "POST")
|
||||||
|
@ApiImplicitParam(name = "id", value = "Exe版本管理ID", paramType = "body", required = true, dataType = "Integer")
|
||||||
|
@PostMapping(value = "/queryById")
|
||||||
|
public Result<ExeVersion> queryById(@RequestBody Map<String,Object> map) {
|
||||||
|
Result<ExeVersion> result = new Result<ExeVersion>();
|
||||||
|
ExeVersion exeVersion = exeVersionService.getById(MapUtils.getString(map,"id"));
|
||||||
|
if(exeVersion==null) {
|
||||||
|
result.error500(MessageUtil.get("notFindErr"));
|
||||||
|
}else {
|
||||||
|
result.setResult(exeVersion);
|
||||||
|
result.setSuccess(true);
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过id查询
|
||||||
|
* @param
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "查询一条Exe版本管理信息", notes = "查询一条Exe版本管理信息" , httpMethod="POST")
|
||||||
|
@PostMapping(value = "/getExeVersion")
|
||||||
|
public Result<ExeVersion> getExeVersion(@RequestBody ExeVersion exeVersion) {
|
||||||
|
Result<ExeVersion> result = new Result<ExeVersion>();
|
||||||
|
if (exeVersion.getId() == null) {
|
||||||
|
exeVersion.setId(2L);
|
||||||
|
}
|
||||||
|
ExeVersion exeVersionEntity = exeVersionService.getById(exeVersion.getId());
|
||||||
|
result.setResult(exeVersionEntity);
|
||||||
|
result.setSuccess(true);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,46 @@
|
|||||||
|
package com.zhgd.xmgl.modules.basicdata.entity;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||||
|
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||||
|
import lombok.Data;
|
||||||
|
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
/**
|
||||||
|
* @Description: Exe版本管理
|
||||||
|
* @author: pds
|
||||||
|
* @date: 2021-03-04
|
||||||
|
* @version: V1.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@TableName("exe_version")
|
||||||
|
@ApiModel(value="ExeVersion实体类",description="ExeVersion")
|
||||||
|
public class ExeVersion implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**id*/
|
||||||
|
@TableId(type = IdType.ASSIGN_ID)
|
||||||
|
@ApiModelProperty(value="id")
|
||||||
|
private Long id ;
|
||||||
|
/**版本号*/
|
||||||
|
@Excel(name = "版本号", width = 15)
|
||||||
|
@ApiModelProperty(value="版本号")
|
||||||
|
private String versionNo ;
|
||||||
|
/**下载地址*/
|
||||||
|
@Excel(name = "下载地址", width = 15)
|
||||||
|
@ApiModelProperty(value="下载地址")
|
||||||
|
private String downloadUrl ;
|
||||||
|
/**版本描述*/
|
||||||
|
@Excel(name = "版本描述", width = 15)
|
||||||
|
@ApiModelProperty(value="版本描述")
|
||||||
|
private String versionDescribe ;
|
||||||
|
/**版本名称*/
|
||||||
|
@Excel(name = "版本名称", width = 15)
|
||||||
|
@ApiModelProperty(value="版本名称")
|
||||||
|
private String versionName;
|
||||||
|
}
|
||||||
@ -0,0 +1,16 @@
|
|||||||
|
package com.zhgd.xmgl.modules.basicdata.mapper;
|
||||||
|
|
||||||
|
import com.zhgd.xmgl.modules.basicdata.entity.ExeVersion;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: Exe版本管理
|
||||||
|
* @author: pds
|
||||||
|
* @date: 2021-03-04
|
||||||
|
* @version: V1.0
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface ExeVersionMapper extends BaseMapper<ExeVersion> {
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,5 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.zhgd.xmgl.modules.basicdata.mapper.ExeVersionMapper">
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@ -0,0 +1,14 @@
|
|||||||
|
package com.zhgd.xmgl.modules.basicdata.service;
|
||||||
|
|
||||||
|
import com.zhgd.xmgl.modules.basicdata.entity.ExeVersion;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: Exe版本管理
|
||||||
|
* @author: pds
|
||||||
|
* @date: 2021-03-04
|
||||||
|
* @version: V1.0
|
||||||
|
*/
|
||||||
|
public interface IExeVersionService extends IService<ExeVersion> {
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,19 @@
|
|||||||
|
package com.zhgd.xmgl.modules.basicdata.service.impl;
|
||||||
|
|
||||||
|
import com.zhgd.xmgl.modules.basicdata.entity.ExeVersion;
|
||||||
|
import com.zhgd.xmgl.modules.basicdata.mapper.ExeVersionMapper;
|
||||||
|
import com.zhgd.xmgl.modules.basicdata.service.IExeVersionService;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: Exe版本管理
|
||||||
|
* @author: pds
|
||||||
|
* @date: 2021-03-04
|
||||||
|
* @version: V1.0
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class ExeVersionServiceImpl extends ServiceImpl<ExeVersionMapper, ExeVersion> implements IExeVersionService {
|
||||||
|
|
||||||
|
}
|
||||||
@ -80,6 +80,7 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
|
|||||||
|
|
||||||
http.authorizeRequests()
|
http.authorizeRequests()
|
||||||
//请求路径允许访问
|
//请求路径允许访问
|
||||||
|
.antMatchers("/xmgl/exeVersion/**").permitAll()
|
||||||
.antMatchers("/xmgl/pileFoundationInspectionCommissionForm/flow/add").permitAll()
|
.antMatchers("/xmgl/pileFoundationInspectionCommissionForm/flow/add").permitAll()
|
||||||
.antMatchers("/xmgl/workerAdmission/getUploadZipWorkAdmissions").permitAll()
|
.antMatchers("/xmgl/workerAdmission/getUploadZipWorkAdmissions").permitAll()
|
||||||
.antMatchers("/xmgl/safetyHatDev/**").permitAll()
|
.antMatchers("/xmgl/safetyHatDev/**").permitAll()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user