添加功能
This commit is contained in:
parent
04e861f208
commit
b88b468bb4
|
@ -0,0 +1,174 @@
|
|||
package org.jeecg.modules.kc.kcSuggestions.controller;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
import java.io.IOException;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URLDecoder;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.system.query.QueryGenerator;
|
||||
import org.jeecg.common.util.oConvertUtils;
|
||||
import org.jeecg.modules.kc.kcSuggestions.entity.KcSuggestions;
|
||||
import org.jeecg.modules.kc.kcSuggestions.service.IKcSuggestionsService;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import org.jeecgframework.poi.excel.ExcelImportUtil;
|
||||
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
|
||||
import org.jeecgframework.poi.excel.entity.ExportParams;
|
||||
import org.jeecgframework.poi.excel.entity.ImportParams;
|
||||
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
|
||||
import org.jeecg.common.system.base.controller.JeecgController;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import org.springframework.web.multipart.MultipartHttpServletRequest;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
|
||||
/**
|
||||
* @Description: kc_suggestions
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2023-04-09
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Api(tags="kc_suggestions")
|
||||
@RestController
|
||||
@RequestMapping("/kcSuggestions/kcSuggestions")
|
||||
@Slf4j
|
||||
public class KcSuggestionsController extends JeecgController<KcSuggestions, IKcSuggestionsService> {
|
||||
@Autowired
|
||||
private IKcSuggestionsService kcSuggestionsService;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
* @param kcSuggestions
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
//@AutoLog(value = "kc_suggestions-分页列表查询")
|
||||
@ApiOperation(value="kc_suggestions-分页列表查询", notes="kc_suggestions-分页列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<IPage<KcSuggestions>> queryPageList(KcSuggestions kcSuggestions,
|
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
QueryWrapper<KcSuggestions> queryWrapper = QueryGenerator.initQueryWrapper(kcSuggestions, req.getParameterMap());
|
||||
Page<KcSuggestions> page = new Page<KcSuggestions>(pageNo, pageSize);
|
||||
IPage<KcSuggestions> pageList = kcSuggestionsService.page(page, queryWrapper);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @param kcSuggestions
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "kc_suggestions-添加")
|
||||
@ApiOperation(value="kc_suggestions-添加", notes="kc_suggestions-添加")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<String> add(@RequestBody KcSuggestions kcSuggestions) {
|
||||
kcSuggestionsService.save(kcSuggestions);
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param kcSuggestions
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "kc_suggestions-编辑")
|
||||
@ApiOperation(value="kc_suggestions-编辑", notes="kc_suggestions-编辑")
|
||||
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
|
||||
public Result<String> edit(@RequestBody KcSuggestions kcSuggestions) {
|
||||
kcSuggestionsService.updateById(kcSuggestions);
|
||||
return Result.OK("编辑成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "kc_suggestions-通过id删除")
|
||||
@ApiOperation(value="kc_suggestions-通过id删除", notes="kc_suggestions-通过id删除")
|
||||
@DeleteMapping(value = "/delete")
|
||||
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
|
||||
kcSuggestionsService.removeById(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "kc_suggestions-批量删除")
|
||||
@ApiOperation(value="kc_suggestions-批量删除", notes="kc_suggestions-批量删除")
|
||||
@DeleteMapping(value = "/deleteBatch")
|
||||
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
||||
this.kcSuggestionsService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
//@AutoLog(value = "kc_suggestions-通过id查询")
|
||||
@ApiOperation(value="kc_suggestions-通过id查询", notes="kc_suggestions-通过id查询")
|
||||
@GetMapping(value = "/queryById")
|
||||
public Result<KcSuggestions> queryById(@RequestParam(name="id",required=true) String id) {
|
||||
KcSuggestions kcSuggestions = kcSuggestionsService.getById(id);
|
||||
if(kcSuggestions==null) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
return Result.OK(kcSuggestions);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel
|
||||
*
|
||||
* @param request
|
||||
* @param kcSuggestions
|
||||
*/
|
||||
@RequiresPermissions("kcSuggestions:kc_suggestions:exportXls")
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, KcSuggestions kcSuggestions) {
|
||||
return super.exportXls(request, kcSuggestions, KcSuggestions.class, "kc_suggestions");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过excel导入数据
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("kcSuggestions:kc_suggestions:importExcel")
|
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
return super.importExcel(request, response, KcSuggestions.class);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,71 @@
|
|||
package org.jeecg.modules.kc.kcSuggestions.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.util.Date;
|
||||
import java.math.BigDecimal;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import lombok.Data;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
import org.jeecg.common.aspect.annotation.Dict;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* @Description: kc_suggestions
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2023-04-09
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Data
|
||||
@TableName("kc_suggestions")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value="kc_suggestions对象", description="kc_suggestions")
|
||||
public class KcSuggestions implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**id*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@ApiModelProperty(value = "id")
|
||||
private java.lang.String id;
|
||||
/**提交人id*/
|
||||
@Excel(name = "提交人id", width = 15)
|
||||
@ApiModelProperty(value = "提交人id")
|
||||
private java.lang.String userid;
|
||||
/**提交人姓名*/
|
||||
@Excel(name = "提交人姓名", width = 15)
|
||||
@ApiModelProperty(value = "提交人姓名")
|
||||
private java.lang.String username;
|
||||
/**意见建议内容*/
|
||||
@Excel(name = "意见建议内容", width = 15)
|
||||
@ApiModelProperty(value = "意见建议内容")
|
||||
private java.lang.String suggestions;
|
||||
/**反馈内容*/
|
||||
@Excel(name = "反馈内容", width = 15)
|
||||
@ApiModelProperty(value = "反馈内容")
|
||||
private java.lang.String feedback;
|
||||
/**反馈人id*/
|
||||
@Excel(name = "反馈人id", width = 15)
|
||||
@ApiModelProperty(value = "反馈人id")
|
||||
private java.lang.String feedbackuserid;
|
||||
/**反馈人姓名*/
|
||||
@Excel(name = "反馈人姓名", width = 15)
|
||||
@ApiModelProperty(value = "反馈人姓名")
|
||||
private java.lang.String feedbackusername;
|
||||
/**提交时间*/
|
||||
@Excel(name = "提交时间", width = 15)
|
||||
@ApiModelProperty(value = "提交时间")
|
||||
private java.lang.String suggestionstime;
|
||||
/**反馈时间*/
|
||||
@Excel(name = "反馈时间", width = 15)
|
||||
@ApiModelProperty(value = "反馈时间")
|
||||
private java.lang.String feedbacktime;
|
||||
}
|
|
@ -0,0 +1,17 @@
|
|||
package org.jeecg.modules.kc.kcSuggestions.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.jeecg.modules.kc.kcSuggestions.entity.KcSuggestions;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* @Description: kc_suggestions
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2023-04-09
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface KcSuggestionsMapper extends BaseMapper<KcSuggestions> {
|
||||
|
||||
}
|
|
@ -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="org.jeecg.modules.kc.kcSuggestions.mapper.KcSuggestionsMapper">
|
||||
|
||||
</mapper>
|
|
@ -0,0 +1,14 @@
|
|||
package org.jeecg.modules.kc.kcSuggestions.service;
|
||||
|
||||
import org.jeecg.modules.kc.kcSuggestions.entity.KcSuggestions;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* @Description: kc_suggestions
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2023-04-09
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface IKcSuggestionsService extends IService<KcSuggestions> {
|
||||
|
||||
}
|
|
@ -0,0 +1,19 @@
|
|||
package org.jeecg.modules.kc.kcSuggestions.service.impl;
|
||||
|
||||
import org.jeecg.modules.kc.kcSuggestions.entity.KcSuggestions;
|
||||
import org.jeecg.modules.kc.kcSuggestions.mapper.KcSuggestionsMapper;
|
||||
import org.jeecg.modules.kc.kcSuggestions.service.IKcSuggestionsService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
|
||||
/**
|
||||
* @Description: kc_suggestions
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2023-04-09
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Service
|
||||
public class KcSuggestionsServiceImpl extends ServiceImpl<KcSuggestionsMapper, KcSuggestions> implements IKcSuggestionsService {
|
||||
|
||||
}
|
Loading…
Reference in New Issue