add 问答库基础代码
This commit is contained in:
+176
@@ -0,0 +1,176 @@
|
||||
package com.jero.modules.laws.library.controller;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.modules.laws.library.entity.LawsAnswerLibrary;
|
||||
import com.jero.modules.laws.library.service.ILawsAnswerLibraryService;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import com.jero.common.system.base.controller.JeroController;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import com.jero.common.aspect.annotation.AutoLog;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.poi.ss.formula.functions.T;
|
||||
|
||||
|
||||
/**
|
||||
* @Description: 问答库-回答
|
||||
* @Author: jero-boot
|
||||
* @Date: 2023-09-28
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Api(tags="问答库-回答")
|
||||
@RestController
|
||||
@RequestMapping("/laws/library/lawsAnswerLibrary")
|
||||
@Slf4j
|
||||
public class LawsAnswerLibraryController extends JeroController<LawsAnswerLibrary, ILawsAnswerLibraryService> {
|
||||
@Autowired
|
||||
private ILawsAnswerLibraryService lawsAnswerLibraryService;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
* @param lawsAnswerLibrary
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "问答库-回答-分页列表查询")
|
||||
@ApiOperation(value="问答库-回答-分页列表查询", notes="问答库-回答-分页列表查询")
|
||||
@GetMapping(value = "/page")
|
||||
public Result<IPage<LawsAnswerLibrary>> queryPageList(LawsAnswerLibrary lawsAnswerLibrary,
|
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
IPage<LawsAnswerLibrary> pageList = lawsAnswerLibraryService.queryPage(lawsAnswerLibrary, pageNo, pageSize, req);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*
|
||||
* @param lawsAnswerLibrary
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "问答库-回答-列表查询")
|
||||
@ApiOperation(value="问答库-回答-列表查询", notes="问答库-回答-列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<List<LawsAnswerLibrary>> queryList(LawsAnswerLibrary lawsAnswerLibrary, HttpServletRequest req) {
|
||||
List<LawsAnswerLibrary> list = lawsAnswerLibraryService.queryList(lawsAnswerLibrary, req);
|
||||
return Result.OK(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @param lawsAnswerLibrary
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "问答库-回答-添加")
|
||||
@ApiOperation(value="问答库-回答-添加", notes="问答库-回答-添加")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<T> add(@Validated @RequestBody LawsAnswerLibrary lawsAnswerLibrary) {
|
||||
lawsAnswerLibraryService.add(lawsAnswerLibrary);
|
||||
return Result.OK("操作成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param lawsAnswerLibrary
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "问答库-回答-编辑")
|
||||
@ApiOperation(value="问答库-回答-编辑", notes="问答库-回答-编辑")
|
||||
@PostMapping(value = "/edit")
|
||||
public Result<T> edit(@Validated @RequestBody LawsAnswerLibrary lawsAnswerLibrary) {
|
||||
lawsAnswerLibraryService.editById(lawsAnswerLibrary);
|
||||
return Result.OK("操作成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param map
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "问答库-回答-通过id删除")
|
||||
@ApiOperation(value="问答库-回答-通过id删除", notes="问答库-回答-通过id删除")
|
||||
@PostMapping(value = "/delete")
|
||||
public Result<T> delete(@RequestBody Map<String, String> map) {
|
||||
if(!map.containsKey("id") || StringUtils.isEmpty(map.get("id"))){
|
||||
return Result.error("请选择数据!");
|
||||
}
|
||||
lawsAnswerLibraryService.deleteById(map.get("id"));
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param map
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "问答库-回答-批量删除")
|
||||
@ApiOperation(value="问答库-回答-批量删除", notes="问答库-回答-批量删除")
|
||||
@PostMapping(value = "/deleteBatch")
|
||||
public Result<T> deleteBatch(@RequestBody Map<String, String> map) {
|
||||
if(!map.containsKey("ids") || StringUtils.isEmpty(map.get("ids"))){
|
||||
return Result.error("请选择数据!");
|
||||
}
|
||||
this.lawsAnswerLibraryService.deleteByIds(Arrays.asList(map.get("ids").split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "问答库-回答-通过id查询")
|
||||
@ApiOperation(value="问答库-回答-通过id查询", notes="问答库-回答-通过id查询")
|
||||
@GetMapping(value = "/queryById")
|
||||
public Result<LawsAnswerLibrary> queryById(@RequestParam(name="id",required=true) String id) {
|
||||
LawsAnswerLibrary lawsAnswerLibrary = lawsAnswerLibraryService.queryById(id);
|
||||
if(lawsAnswerLibrary==null) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
return Result.OK(lawsAnswerLibrary);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel
|
||||
*
|
||||
* @param request
|
||||
* @param lawsAnswerLibrary
|
||||
*/
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, LawsAnswerLibrary lawsAnswerLibrary) {
|
||||
return super.exportXls(request, lawsAnswerLibrary, LawsAnswerLibrary.class, "问答库-回答");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过excel导入数据
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||
public Result<LawsAnswerLibrary> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
return super.importExcel(request, response, LawsAnswerLibrary.class);
|
||||
}
|
||||
|
||||
}
|
||||
+176
@@ -0,0 +1,176 @@
|
||||
package com.jero.modules.laws.library.controller;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.modules.laws.library.entity.LawsProblemLibrary;
|
||||
import com.jero.modules.laws.library.service.ILawsProblemLibraryService;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import com.jero.common.system.base.controller.JeroController;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import com.jero.common.aspect.annotation.AutoLog;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.poi.ss.formula.functions.T;
|
||||
|
||||
|
||||
/**
|
||||
* @Description: 问答库-问题
|
||||
* @Author: jero-boot
|
||||
* @Date: 2023-09-28
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Api(tags="问答库-问题")
|
||||
@RestController
|
||||
@RequestMapping("/laws/library/lawsProblemLibrary")
|
||||
@Slf4j
|
||||
public class LawsProblemLibraryController extends JeroController<LawsProblemLibrary, ILawsProblemLibraryService> {
|
||||
@Autowired
|
||||
private ILawsProblemLibraryService lawsProblemLibraryService;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
* @param lawsProblemLibrary
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "问答库-问题-分页列表查询")
|
||||
@ApiOperation(value="问答库-问题-分页列表查询", notes="问答库-问题-分页列表查询")
|
||||
@GetMapping(value = "/page")
|
||||
public Result<IPage<LawsProblemLibrary>> queryPageList(LawsProblemLibrary lawsProblemLibrary,
|
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
IPage<LawsProblemLibrary> pageList = lawsProblemLibraryService.queryPage(lawsProblemLibrary, pageNo, pageSize, req);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*
|
||||
* @param lawsProblemLibrary
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "问答库-问题-列表查询")
|
||||
@ApiOperation(value="问答库-问题-列表查询", notes="问答库-问题-列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<List<LawsProblemLibrary>> queryList(LawsProblemLibrary lawsProblemLibrary, HttpServletRequest req) {
|
||||
List<LawsProblemLibrary> list = lawsProblemLibraryService.queryList(lawsProblemLibrary, req);
|
||||
return Result.OK(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @param lawsProblemLibrary
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "问答库-问题-添加")
|
||||
@ApiOperation(value="问答库-问题-添加", notes="问答库-问题-添加")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<T> add(@Validated @RequestBody LawsProblemLibrary lawsProblemLibrary) {
|
||||
lawsProblemLibraryService.add(lawsProblemLibrary);
|
||||
return Result.OK("操作成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param lawsProblemLibrary
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "问答库-问题-编辑")
|
||||
@ApiOperation(value="问答库-问题-编辑", notes="问答库-问题-编辑")
|
||||
@PostMapping(value = "/edit")
|
||||
public Result<T> edit(@Validated @RequestBody LawsProblemLibrary lawsProblemLibrary) {
|
||||
lawsProblemLibraryService.editById(lawsProblemLibrary);
|
||||
return Result.OK("操作成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param map
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "问答库-问题-通过id删除")
|
||||
@ApiOperation(value="问答库-问题-通过id删除", notes="问答库-问题-通过id删除")
|
||||
@PostMapping(value = "/delete")
|
||||
public Result<T> delete(@RequestBody Map<String, String> map) {
|
||||
if(!map.containsKey("id") || StringUtils.isEmpty(map.get("id"))){
|
||||
return Result.error("请选择数据!");
|
||||
}
|
||||
lawsProblemLibraryService.deleteById(map.get("id"));
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param map
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "问答库-问题-批量删除")
|
||||
@ApiOperation(value="问答库-问题-批量删除", notes="问答库-问题-批量删除")
|
||||
@PostMapping(value = "/deleteBatch")
|
||||
public Result<T> deleteBatch(@RequestBody Map<String, String> map) {
|
||||
if(!map.containsKey("ids") || StringUtils.isEmpty(map.get("ids"))){
|
||||
return Result.error("请选择数据!");
|
||||
}
|
||||
this.lawsProblemLibraryService.deleteByIds(Arrays.asList(map.get("ids").split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "问答库-问题-通过id查询")
|
||||
@ApiOperation(value="问答库-问题-通过id查询", notes="问答库-问题-通过id查询")
|
||||
@GetMapping(value = "/queryById")
|
||||
public Result<LawsProblemLibrary> queryById(@RequestParam(name="id",required=true) String id) {
|
||||
LawsProblemLibrary lawsProblemLibrary = lawsProblemLibraryService.queryById(id);
|
||||
if(lawsProblemLibrary==null) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
return Result.OK(lawsProblemLibrary);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel
|
||||
*
|
||||
* @param request
|
||||
* @param lawsProblemLibrary
|
||||
*/
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, LawsProblemLibrary lawsProblemLibrary) {
|
||||
return super.exportXls(request, lawsProblemLibrary, LawsProblemLibrary.class, "问答库-问题");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过excel导入数据
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||
public Result<LawsProblemLibrary> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
return super.importExcel(request, response, LawsProblemLibrary.class);
|
||||
}
|
||||
|
||||
}
|
||||
+65
@@ -0,0 +1,65 @@
|
||||
package com.jero.modules.laws.library.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 lombok.Data;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
import com.jero.common.aspect.annotation.Dict;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
|
||||
|
||||
/**
|
||||
* @Description: 问答库-回答
|
||||
* @Author: jero-boot
|
||||
* @Date: 2023-09-28
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Data
|
||||
@TableName("laws_answer_library")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value="laws_answer_library对象", description="问答库-回答")
|
||||
public class LawsAnswerLibrary implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**主键ID*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@ApiModelProperty(value = "主键ID")
|
||||
private java.lang.String id;
|
||||
/**创建时间*/
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd")
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
private java.util.Date createTime;
|
||||
/**所属部门*/
|
||||
@Excel(name = "所属部门", width = 15)
|
||||
@ApiModelProperty(value = "所属部门")
|
||||
private java.lang.String orgCode;
|
||||
/**问题id*/
|
||||
@Excel(name = "问题id", width = 15)
|
||||
@ApiModelProperty(value = "问题id")
|
||||
private java.lang.String problemId;
|
||||
/**答案描述*/
|
||||
@Excel(name = "答案描述", width = 15)
|
||||
@ApiModelProperty(value = "答案描述")
|
||||
private java.lang.String answerDescription;
|
||||
/**是否置顶(0否,1是)*/
|
||||
@Excel(name = "是否置顶(0否,1是)", width = 15)
|
||||
@ApiModelProperty(value = "是否置顶(0否,1是)")
|
||||
private java.lang.Integer isTop;
|
||||
/**回答人id*/
|
||||
@Excel(name = "回答人id", width = 15)
|
||||
@ApiModelProperty(value = "回答人id")
|
||||
private java.lang.String userId;
|
||||
}
|
||||
+104
@@ -0,0 +1,104 @@
|
||||
package com.jero.modules.laws.library.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 lombok.Data;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
import com.jero.common.aspect.annotation.Dict;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
|
||||
|
||||
/**
|
||||
* @Description: 问答库-问题
|
||||
* @Author: jero-boot
|
||||
* @Date: 2023-09-28
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Data
|
||||
@TableName("laws_problem_library")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value="laws_problem_library对象", description="问答库-问题")
|
||||
public class LawsProblemLibrary implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**主键ID*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@ApiModelProperty(value = "主键ID")
|
||||
private java.lang.String id;
|
||||
/**创建人*/
|
||||
@ApiModelProperty(value = "创建人")
|
||||
private java.lang.String createBy;
|
||||
/**创建时间*/
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd")
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
private java.util.Date createTime;
|
||||
/**更新人*/
|
||||
@ApiModelProperty(value = "更新人")
|
||||
private java.lang.String updateBy;
|
||||
/**更新时间*/
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd")
|
||||
@ApiModelProperty(value = "更新时间")
|
||||
private java.util.Date updateTime;
|
||||
/**所属部门*/
|
||||
@Excel(name = "所属部门", width = 15)
|
||||
@ApiModelProperty(value = "所属部门")
|
||||
private java.lang.String orgCode;
|
||||
/**0表示未删除,1表示删除*/
|
||||
@Excel(name = "0表示未删除,1表示删除", width = 15)
|
||||
@ApiModelProperty(value = "0表示未删除,1表示删除")
|
||||
private java.lang.Integer delFlag;
|
||||
/**分类(国内1、海外2、企业3、其他4)*/
|
||||
@Excel(name = "分类(国内1、海外2、企业3、其他4)", width = 15)
|
||||
@ApiModelProperty(value = "分类(国内1、海外2、企业3、其他4)")
|
||||
private java.lang.String type;
|
||||
/**标准id*/
|
||||
@Excel(name = "标准id", width = 15)
|
||||
@ApiModelProperty(value = "标准id")
|
||||
private java.lang.String standardId;
|
||||
/**标准编号*/
|
||||
@Excel(name = "标准编号", width = 15)
|
||||
@ApiModelProperty(value = "标准编号")
|
||||
private java.lang.String standardNumber;
|
||||
/**标准名称*/
|
||||
@Excel(name = "标准名称", width = 15)
|
||||
@ApiModelProperty(value = "标准名称")
|
||||
private java.lang.String standardName;
|
||||
/**标题*/
|
||||
@Excel(name = "标题", width = 15)
|
||||
@ApiModelProperty(value = "标题")
|
||||
private java.lang.String title;
|
||||
/**项目*/
|
||||
@Excel(name = "项目", width = 15)
|
||||
@ApiModelProperty(value = "项目")
|
||||
private java.lang.String project;
|
||||
/**问题描述*/
|
||||
@Excel(name = "问题描述", width = 15)
|
||||
@ApiModelProperty(value = "问题描述")
|
||||
private java.lang.String problemDescription;
|
||||
/**附件*/
|
||||
@Excel(name = "附件", width = 15)
|
||||
@ApiModelProperty(value = "附件")
|
||||
private java.lang.String file;
|
||||
/**是否有人回答(0否,1是)*/
|
||||
@Excel(name = "是否有人回答(0否,1是)", width = 15)
|
||||
@ApiModelProperty(value = "是否有人回答(0否,1是)")
|
||||
private java.lang.Integer isAnswer;
|
||||
/**发帖人id*/
|
||||
@Excel(name = "发帖人id", width = 15)
|
||||
@ApiModelProperty(value = "发帖人id")
|
||||
private java.lang.String userId;
|
||||
}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
package com.jero.modules.laws.library.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.jero.modules.laws.library.entity.LawsAnswerLibrary;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* @Description: 问答库-回答
|
||||
* @Author: jero-boot
|
||||
* @Date: 2023-09-28
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface LawsAnswerLibraryMapper extends BaseMapper<LawsAnswerLibrary> {
|
||||
|
||||
}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
package com.jero.modules.laws.library.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.jero.modules.laws.library.entity.LawsProblemLibrary;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* @Description: 问答库-问题
|
||||
* @Author: jero-boot
|
||||
* @Date: 2023-09-28
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface LawsProblemLibraryMapper extends BaseMapper<LawsProblemLibrary> {
|
||||
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
<?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.jero.modules.laws.library.mapper.LawsAnswerLibraryMapper">
|
||||
<resultMap id="LawsAnswerLibraryResultMap" type="com.jero.modules.laws.library.entity.LawsAnswerLibrary">
|
||||
<id column="id" property="id" />
|
||||
<result column="create_time" property="createTime" />
|
||||
<result column="org_code" property="orgCode" />
|
||||
<result column="problem_id" property="problemId" />
|
||||
<result column="answer_description" property="answerDescription" />
|
||||
<result column="is_top" property="isTop" />
|
||||
<result column="user_id" property="userId" />
|
||||
</resultMap>
|
||||
</mapper>
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
<?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.jero.modules.laws.library.mapper.LawsProblemLibraryMapper">
|
||||
<resultMap id="LawsProblemLibraryResultMap" type="com.jero.modules.laws.library.entity.LawsProblemLibrary">
|
||||
<id column="id" property="id" />
|
||||
<result column="create_by" property="createBy" />
|
||||
<result column="create_time" property="createTime" />
|
||||
<result column="update_by" property="updateBy" />
|
||||
<result column="update_time" property="updateTime" />
|
||||
<result column="org_code" property="orgCode" />
|
||||
<result column="del_flag" property="delFlag" />
|
||||
<result column="type" property="type" />
|
||||
<result column="standard_id" property="standardId" />
|
||||
<result column="standard_number" property="standardNumber" />
|
||||
<result column="standard_name" property="standardName" />
|
||||
<result column="title" property="title" />
|
||||
<result column="project" property="project" />
|
||||
<result column="problem_description" property="problemDescription" />
|
||||
<result column="file" property="file" />
|
||||
<result column="is_answer" property="isAnswer" />
|
||||
<result column="user_id" property="userId" />
|
||||
</resultMap>
|
||||
</mapper>
|
||||
+76
@@ -0,0 +1,76 @@
|
||||
package com.jero.modules.laws.library.service;
|
||||
|
||||
import com.jero.modules.laws.library.entity.LawsAnswerLibrary;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: 问答库-回答
|
||||
* @Author: jero-boot
|
||||
* @Date: 2023-09-28
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface ILawsAnswerLibraryService extends IService<LawsAnswerLibrary> {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param lawsAnswerLibrary
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
IPage<LawsAnswerLibrary> queryPage(LawsAnswerLibrary lawsAnswerLibrary, Integer pageNo, Integer pageSize, HttpServletRequest req);
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*
|
||||
* @param lawsAnswerLibrary
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
List<LawsAnswerLibrary> queryList(LawsAnswerLibrary lawsAnswerLibrary, HttpServletRequest req);
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*
|
||||
* @param lawsAnswerLibrary
|
||||
* @return
|
||||
*/
|
||||
void add(LawsAnswerLibrary lawsAnswerLibrary);
|
||||
|
||||
/**
|
||||
* 更新
|
||||
*
|
||||
* @param lawsAnswerLibrary
|
||||
* @return
|
||||
*/
|
||||
void editById(LawsAnswerLibrary lawsAnswerLibrary);
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
void deleteById(String id);
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
void deleteByIds(List<String> ids);
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
LawsAnswerLibrary queryById(String id);
|
||||
}
|
||||
+76
@@ -0,0 +1,76 @@
|
||||
package com.jero.modules.laws.library.service;
|
||||
|
||||
import com.jero.modules.laws.library.entity.LawsProblemLibrary;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: 问答库-问题
|
||||
* @Author: jero-boot
|
||||
* @Date: 2023-09-28
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface ILawsProblemLibraryService extends IService<LawsProblemLibrary> {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param lawsProblemLibrary
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
IPage<LawsProblemLibrary> queryPage(LawsProblemLibrary lawsProblemLibrary, Integer pageNo, Integer pageSize, HttpServletRequest req);
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*
|
||||
* @param lawsProblemLibrary
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
List<LawsProblemLibrary> queryList(LawsProblemLibrary lawsProblemLibrary, HttpServletRequest req);
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*
|
||||
* @param lawsProblemLibrary
|
||||
* @return
|
||||
*/
|
||||
void add(LawsProblemLibrary lawsProblemLibrary);
|
||||
|
||||
/**
|
||||
* 更新
|
||||
*
|
||||
* @param lawsProblemLibrary
|
||||
* @return
|
||||
*/
|
||||
void editById(LawsProblemLibrary lawsProblemLibrary);
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
void deleteById(String id);
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
void deleteByIds(List<String> ids);
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
LawsProblemLibrary queryById(String id);
|
||||
}
|
||||
+115
@@ -0,0 +1,115 @@
|
||||
package com.jero.modules.laws.library.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.jero.modules.laws.library.entity.LawsAnswerLibrary;
|
||||
import com.jero.modules.laws.library.mapper.LawsAnswerLibraryMapper;
|
||||
import com.jero.modules.laws.library.service.ILawsAnswerLibraryService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import com.jero.common.exception.JeroBootException;
|
||||
import java.util.List;
|
||||
import java.util.Date;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.jero.common.system.query.QueryGenerator;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
|
||||
|
||||
/**
|
||||
* @Description: 问答库-回答
|
||||
* @Author: jero-boot
|
||||
* @Date: 2023-09-28
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Service
|
||||
@Transactional(rollbackFor = JeroBootException.class)
|
||||
public class LawsAnswerLibraryServiceImpl extends ServiceImpl<LawsAnswerLibraryMapper, LawsAnswerLibrary> implements ILawsAnswerLibraryService {
|
||||
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param lawsAnswerLibrary
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public IPage<LawsAnswerLibrary> queryPage(LawsAnswerLibrary lawsAnswerLibrary, Integer pageNo, Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
QueryWrapper<LawsAnswerLibrary> queryWrapper = QueryGenerator.initQueryWrapper(lawsAnswerLibrary, req.getParameterMap());
|
||||
Page<LawsAnswerLibrary> page = new Page<>(pageNo, pageSize);
|
||||
return page(page, queryWrapper);
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*
|
||||
* @param lawsAnswerLibrary
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<LawsAnswerLibrary> queryList(LawsAnswerLibrary lawsAnswerLibrary, HttpServletRequest req) {
|
||||
return list(QueryGenerator.initQueryWrapper(lawsAnswerLibrary, req.getParameterMap()));
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*
|
||||
* @param lawsAnswerLibrary
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public void add(LawsAnswerLibrary lawsAnswerLibrary) {
|
||||
Date now = new Date();
|
||||
lawsAnswerLibrary.setCreateTime(now);
|
||||
save(lawsAnswerLibrary);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新
|
||||
*
|
||||
* @param lawsAnswerLibrary
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public void editById(LawsAnswerLibrary lawsAnswerLibrary) {
|
||||
saveOrUpdate(lawsAnswerLibrary);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public void deleteById(String id) {
|
||||
removeById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public void deleteByIds(List<String> ids) {
|
||||
removeByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public LawsAnswerLibrary queryById(String id) {
|
||||
return getById(id);
|
||||
}
|
||||
}
|
||||
+118
@@ -0,0 +1,118 @@
|
||||
package com.jero.modules.laws.library.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.jero.modules.laws.library.entity.LawsProblemLibrary;
|
||||
import com.jero.modules.laws.library.mapper.LawsProblemLibraryMapper;
|
||||
import com.jero.modules.laws.library.service.ILawsProblemLibraryService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import com.jero.common.exception.JeroBootException;
|
||||
import java.util.List;
|
||||
import java.util.Date;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.jero.common.system.query.QueryGenerator;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
|
||||
|
||||
/**
|
||||
* @Description: 问答库-问题
|
||||
* @Author: jero-boot
|
||||
* @Date: 2023-09-28
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Service
|
||||
@Transactional(rollbackFor = JeroBootException.class)
|
||||
public class LawsProblemLibraryServiceImpl extends ServiceImpl<LawsProblemLibraryMapper, LawsProblemLibrary> implements ILawsProblemLibraryService {
|
||||
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param lawsProblemLibrary
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public IPage<LawsProblemLibrary> queryPage(LawsProblemLibrary lawsProblemLibrary, Integer pageNo, Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
QueryWrapper<LawsProblemLibrary> queryWrapper = QueryGenerator.initQueryWrapper(lawsProblemLibrary, req.getParameterMap());
|
||||
Page<LawsProblemLibrary> page = new Page<>(pageNo, pageSize);
|
||||
return page(page, queryWrapper);
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*
|
||||
* @param lawsProblemLibrary
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<LawsProblemLibrary> queryList(LawsProblemLibrary lawsProblemLibrary, HttpServletRequest req) {
|
||||
return list(QueryGenerator.initQueryWrapper(lawsProblemLibrary, req.getParameterMap()));
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*
|
||||
* @param lawsProblemLibrary
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public void add(LawsProblemLibrary lawsProblemLibrary) {
|
||||
Date now = new Date();
|
||||
lawsProblemLibrary.setCreateTime(now);
|
||||
lawsProblemLibrary.setUpdateTime(now);
|
||||
save(lawsProblemLibrary);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新
|
||||
*
|
||||
* @param lawsProblemLibrary
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public void editById(LawsProblemLibrary lawsProblemLibrary) {
|
||||
Date now = new Date();
|
||||
lawsProblemLibrary.setUpdateTime(now);
|
||||
saveOrUpdate(lawsProblemLibrary);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public void deleteById(String id) {
|
||||
removeById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public void deleteByIds(List<String> ids) {
|
||||
removeByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public LawsProblemLibrary queryById(String id) {
|
||||
return getById(id);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user