add 问答库-相关功能接口
This commit is contained in:
-137
@@ -36,141 +36,4 @@ public class LawsAnswerLibraryController extends JeroController<LawsAnswerLibrar
|
|||||||
@Autowired
|
@Autowired
|
||||||
private ILawsAnswerLibraryService lawsAnswerLibraryService;
|
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);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+67
-110
@@ -6,6 +6,9 @@ import java.util.Map;
|
|||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import com.jero.common.api.vo.Result;
|
import com.jero.common.api.vo.Result;
|
||||||
|
import com.jero.common.util.MessageUtils;
|
||||||
|
import com.jero.modules.laws.common.constant.ResultCommon;
|
||||||
|
import com.jero.modules.laws.library.entity.LawsAnswerLibrary;
|
||||||
import com.jero.modules.laws.library.entity.LawsProblemLibrary;
|
import com.jero.modules.laws.library.entity.LawsProblemLibrary;
|
||||||
import com.jero.modules.laws.library.service.ILawsProblemLibraryService;
|
import com.jero.modules.laws.library.service.ILawsProblemLibraryService;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
@@ -28,7 +31,7 @@ import org.apache.poi.ss.formula.functions.T;
|
|||||||
* @Date: 2023-09-28
|
* @Date: 2023-09-28
|
||||||
* @Version: V1.0
|
* @Version: V1.0
|
||||||
*/
|
*/
|
||||||
@Api(tags="问答库-问题")
|
@Api(tags="问答库")
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/laws/library/lawsProblemLibrary")
|
@RequestMapping("/laws/library/lawsProblemLibrary")
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@@ -36,17 +39,8 @@ public class LawsProblemLibraryController extends JeroController<LawsProblemLibr
|
|||||||
@Autowired
|
@Autowired
|
||||||
private ILawsProblemLibraryService lawsProblemLibraryService;
|
private ILawsProblemLibraryService lawsProblemLibraryService;
|
||||||
|
|
||||||
/**
|
@AutoLog(value = "问答库-分页列表查询")
|
||||||
* 分页列表查询
|
@ApiOperation(value="问答库-分页列表查询", notes="问答库-问题-分页列表查询")
|
||||||
*
|
|
||||||
* @param lawsProblemLibrary
|
|
||||||
* @param pageNo
|
|
||||||
* @param pageSize
|
|
||||||
* @param req
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@AutoLog(value = "问答库-问题-分页列表查询")
|
|
||||||
@ApiOperation(value="问答库-问题-分页列表查询", notes="问答库-问题-分页列表查询")
|
|
||||||
@GetMapping(value = "/page")
|
@GetMapping(value = "/page")
|
||||||
public Result<IPage<LawsProblemLibrary>> queryPageList(LawsProblemLibrary lawsProblemLibrary,
|
public Result<IPage<LawsProblemLibrary>> queryPageList(LawsProblemLibrary lawsProblemLibrary,
|
||||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||||
@@ -56,121 +50,84 @@ public class LawsProblemLibraryController extends JeroController<LawsProblemLibr
|
|||||||
return Result.OK(pageList);
|
return Result.OK(pageList);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
@AutoLog(value = "问答库-提出问题")
|
||||||
* 列表查询
|
@ApiOperation(value="问答库-提出问题", notes="问答库-提出问题")
|
||||||
*
|
@PostMapping(value = "/addProblem")
|
||||||
* @param lawsProblemLibrary
|
public Result<T> addProblem(@Validated @RequestBody LawsProblemLibrary lawsProblemLibrary) {
|
||||||
* @param req
|
lawsProblemLibraryService.addProblem(lawsProblemLibrary);
|
||||||
* @return
|
return Result.OK(MessageUtils.getMessage(ResultCommon.OK));
|
||||||
*/
|
|
||||||
@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);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
@AutoLog(value = "国内标准-提出问题")
|
||||||
* 添加
|
@ApiOperation(value="国内标准-提出问题", notes="国内标准-提出问题")
|
||||||
*
|
@PostMapping(value = "/addProblem/GB")
|
||||||
* @param lawsProblemLibrary
|
public Result<T> addProblemGB(@Validated @RequestBody LawsProblemLibrary lawsProblemLibrary) {
|
||||||
* @return
|
lawsProblemLibrary.setType("1");
|
||||||
*/
|
lawsProblemLibraryService.addProblem(lawsProblemLibrary);
|
||||||
@AutoLog(value = "问答库-问题-添加")
|
return Result.OK(MessageUtils.getMessage(ResultCommon.OK));
|
||||||
@ApiOperation(value="问答库-问题-添加", notes="问答库-问题-添加")
|
|
||||||
@PostMapping(value = "/add")
|
|
||||||
public Result<T> add(@Validated @RequestBody LawsProblemLibrary lawsProblemLibrary) {
|
|
||||||
lawsProblemLibraryService.add(lawsProblemLibrary);
|
|
||||||
return Result.OK("操作成功!");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
@AutoLog(value = "海外标准-提出问题")
|
||||||
* 编辑
|
@ApiOperation(value="海外标准-提出问题", notes="海外标准-提出问题")
|
||||||
*
|
@PostMapping(value = "/addProblem/FB")
|
||||||
* @param lawsProblemLibrary
|
public Result<T> addProblemFB(@Validated @RequestBody LawsProblemLibrary lawsProblemLibrary) {
|
||||||
* @return
|
lawsProblemLibrary.setType("2");
|
||||||
*/
|
lawsProblemLibraryService.addProblem(lawsProblemLibrary);
|
||||||
@AutoLog(value = "问答库-问题-编辑")
|
return Result.OK(MessageUtils.getMessage(ResultCommon.OK));
|
||||||
@ApiOperation(value="问答库-问题-编辑", notes="问答库-问题-编辑")
|
|
||||||
@PostMapping(value = "/edit")
|
|
||||||
public Result<T> edit(@Validated @RequestBody LawsProblemLibrary lawsProblemLibrary) {
|
|
||||||
lawsProblemLibraryService.editById(lawsProblemLibrary);
|
|
||||||
return Result.OK("操作成功!");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
@AutoLog(value = "企业标准-提出问题")
|
||||||
* 通过id删除
|
@ApiOperation(value="企业标准-提出问题", notes="企业标准-提出问题")
|
||||||
*
|
@PostMapping(value = "/addProblem/QB")
|
||||||
* @param map
|
public Result<T> addProblemQB(@Validated @RequestBody LawsProblemLibrary lawsProblemLibrary) {
|
||||||
* @return
|
lawsProblemLibrary.setType("3");
|
||||||
*/
|
lawsProblemLibraryService.addProblem(lawsProblemLibrary);
|
||||||
@AutoLog(value = "问答库-问题-通过id删除")
|
return Result.OK(MessageUtils.getMessage(ResultCommon.OK));
|
||||||
@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("删除成功!");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
@AutoLog(value = "问答库-回答问题")
|
||||||
* 批量删除
|
@ApiOperation(value="问答库-回答问题", notes="问答库-回答问题")
|
||||||
*
|
@PostMapping(value = "/addAnswer")
|
||||||
* @param map
|
public Result<T> addAnswer(@Validated @RequestBody LawsAnswerLibrary lawsAnswerLibrary) {
|
||||||
* @return
|
lawsProblemLibraryService.addAnswer(lawsAnswerLibrary);
|
||||||
*/
|
return Result.OK(MessageUtils.getMessage(ResultCommon.OK));
|
||||||
@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("批量删除成功!");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
@AutoLog(value = "问答库-通过id查询")
|
||||||
* 通过id查询
|
@ApiOperation(value="问答库-通过id查询", notes="问答库-通过id查询")
|
||||||
*
|
|
||||||
* @param id
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@AutoLog(value = "问答库-问题-通过id查询")
|
|
||||||
@ApiOperation(value="问答库-问题-通过id查询", notes="问答库-问题-通过id查询")
|
|
||||||
@GetMapping(value = "/queryById")
|
@GetMapping(value = "/queryById")
|
||||||
public Result<LawsProblemLibrary> queryById(@RequestParam(name="id",required=true) String id) {
|
public Result<LawsProblemLibrary> queryById(@RequestParam(name="id") String id) {
|
||||||
LawsProblemLibrary lawsProblemLibrary = lawsProblemLibraryService.queryById(id);
|
LawsProblemLibrary lawsProblemLibrary = lawsProblemLibraryService.queryById(id);
|
||||||
if(lawsProblemLibrary==null) {
|
|
||||||
return Result.error("未找到对应数据");
|
|
||||||
}
|
|
||||||
return Result.OK(lawsProblemLibrary);
|
return Result.OK(lawsProblemLibrary);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
@AutoLog(value = "问答库-通过id删除问题")
|
||||||
* 导出excel
|
@ApiOperation(value="问答库-通过id删除问题", notes="问答库-通过id删除问题")
|
||||||
*
|
@PostMapping(value = "/deleteProblem")
|
||||||
* @param request
|
public Result<T> deleteProblem(@RequestBody Map<String, String> map) {
|
||||||
* @param lawsProblemLibrary
|
if(!map.containsKey("id") || StringUtils.isEmpty(map.get("id"))){
|
||||||
*/
|
return Result.error(MessageUtils.getMessage(ResultCommon.SELECT_DATA));
|
||||||
@RequestMapping(value = "/exportXls")
|
}
|
||||||
public ModelAndView exportXls(HttpServletRequest request, LawsProblemLibrary lawsProblemLibrary) {
|
lawsProblemLibraryService.deleteProblem(map.get("id"));
|
||||||
return super.exportXls(request, lawsProblemLibrary, LawsProblemLibrary.class, "问答库-问题");
|
return Result.OK(MessageUtils.getMessage(ResultCommon.OK));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
@AutoLog(value = "问答库-通过id删除回答")
|
||||||
* 通过excel导入数据
|
@ApiOperation(value="问答库-通过id删除回答", notes="问答库-通过id删除回答")
|
||||||
*
|
@PostMapping(value = "/deleteAnswer")
|
||||||
* @param request
|
public Result<T> deleteAnswer(@RequestBody Map<String, String> map) {
|
||||||
* @param response
|
if(!map.containsKey("id") || StringUtils.isEmpty(map.get("id"))){
|
||||||
* @return
|
return Result.error(MessageUtils.getMessage(ResultCommon.SELECT_DATA));
|
||||||
*/
|
}
|
||||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
lawsProblemLibraryService.deleteAnswer(map.get("id"));
|
||||||
public Result<LawsProblemLibrary> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
return Result.OK(MessageUtils.getMessage(ResultCommon.OK));
|
||||||
return super.importExcel(request, response, LawsProblemLibrary.class);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@AutoLog(value = "问答库-是否置顶")
|
||||||
|
@ApiOperation(value="问答库-是否置顶", notes="问答库-是否置顶")
|
||||||
|
@GetMapping(value = "/isTop")
|
||||||
|
public Result<T> isTop(@RequestParam(name="id") String id) {
|
||||||
|
lawsProblemLibraryService.isTop(id);
|
||||||
|
return Result.OK(MessageUtils.getMessage(ResultCommon.OK));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,6 +45,7 @@ public class LawsAnswerLibrary implements Serializable {
|
|||||||
/**所属部门*/
|
/**所属部门*/
|
||||||
@Excel(name = "所属部门", width = 15)
|
@Excel(name = "所属部门", width = 15)
|
||||||
@ApiModelProperty(value = "所属部门")
|
@ApiModelProperty(value = "所属部门")
|
||||||
|
@Dict(dictTable = "sys_depart", dicCode = "org_code", dicText = "depart_name")
|
||||||
private java.lang.String orgCode;
|
private java.lang.String orgCode;
|
||||||
/**问题id*/
|
/**问题id*/
|
||||||
@Excel(name = "问题id", width = 15)
|
@Excel(name = "问题id", width = 15)
|
||||||
@@ -61,5 +62,6 @@ public class LawsAnswerLibrary implements Serializable {
|
|||||||
/**回答人id*/
|
/**回答人id*/
|
||||||
@Excel(name = "回答人id", width = 15)
|
@Excel(name = "回答人id", width = 15)
|
||||||
@ApiModelProperty(value = "回答人id")
|
@ApiModelProperty(value = "回答人id")
|
||||||
|
@Dict(dictTable = "sys_user", dicCode = "id", dicText = "name_work_no")
|
||||||
private java.lang.String userId;
|
private java.lang.String userId;
|
||||||
}
|
}
|
||||||
|
|||||||
+15
@@ -4,7 +4,10 @@ import java.io.Serializable;
|
|||||||
import java.io.UnsupportedEncodingException;
|
import java.io.UnsupportedEncodingException;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
@@ -56,6 +59,7 @@ public class LawsProblemLibrary implements Serializable {
|
|||||||
/**所属部门*/
|
/**所属部门*/
|
||||||
@Excel(name = "所属部门", width = 15)
|
@Excel(name = "所属部门", width = 15)
|
||||||
@ApiModelProperty(value = "所属部门")
|
@ApiModelProperty(value = "所属部门")
|
||||||
|
@Dict(dictTable = "sys_depart", dicCode = "org_code", dicText = "depart_name")
|
||||||
private java.lang.String orgCode;
|
private java.lang.String orgCode;
|
||||||
/**0表示未删除,1表示删除*/
|
/**0表示未删除,1表示删除*/
|
||||||
@Excel(name = "0表示未删除,1表示删除", width = 15)
|
@Excel(name = "0表示未删除,1表示删除", width = 15)
|
||||||
@@ -64,6 +68,7 @@ public class LawsProblemLibrary implements Serializable {
|
|||||||
/**分类(国内1、海外2、企业3、其他4)*/
|
/**分类(国内1、海外2、企业3、其他4)*/
|
||||||
@Excel(name = "分类(国内1、海外2、企业3、其他4)", width = 15)
|
@Excel(name = "分类(国内1、海外2、企业3、其他4)", width = 15)
|
||||||
@ApiModelProperty(value = "分类(国内1、海外2、企业3、其他4)")
|
@ApiModelProperty(value = "分类(国内1、海外2、企业3、其他4)")
|
||||||
|
@Dict(dicCode = "problem_library_type")
|
||||||
private java.lang.String type;
|
private java.lang.String type;
|
||||||
/**标准id*/
|
/**标准id*/
|
||||||
@Excel(name = "标准id", width = 15)
|
@Excel(name = "标准id", width = 15)
|
||||||
@@ -100,5 +105,15 @@ public class LawsProblemLibrary implements Serializable {
|
|||||||
/**发帖人id*/
|
/**发帖人id*/
|
||||||
@Excel(name = "发帖人id", width = 15)
|
@Excel(name = "发帖人id", width = 15)
|
||||||
@ApiModelProperty(value = "发帖人id")
|
@ApiModelProperty(value = "发帖人id")
|
||||||
|
@Dict(dictTable = "sys_user", dicCode = "id", dicText = "name_work_no")
|
||||||
private java.lang.String userId;
|
private java.lang.String userId;
|
||||||
|
|
||||||
|
/**回答列表*/
|
||||||
|
@ApiModelProperty(value = "回答列表")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private List<LawsAnswerLibrary> answerList;
|
||||||
|
/**回答数*/
|
||||||
|
@ApiModelProperty(value = "回答数")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private Integer answerCount;
|
||||||
}
|
}
|
||||||
|
|||||||
-59
@@ -14,63 +14,4 @@ import java.util.List;
|
|||||||
*/
|
*/
|
||||||
public interface ILawsAnswerLibraryService extends IService<LawsAnswerLibrary> {
|
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);
|
|
||||||
}
|
}
|
||||||
|
|||||||
+40
-50
@@ -1,5 +1,6 @@
|
|||||||
package com.jero.modules.laws.library.service;
|
package com.jero.modules.laws.library.service;
|
||||||
|
|
||||||
|
import com.jero.modules.laws.library.entity.LawsAnswerLibrary;
|
||||||
import com.jero.modules.laws.library.entity.LawsProblemLibrary;
|
import com.jero.modules.laws.library.entity.LawsProblemLibrary;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
@@ -15,62 +16,51 @@ import java.util.List;
|
|||||||
public interface ILawsProblemLibraryService extends IService<LawsProblemLibrary> {
|
public interface ILawsProblemLibraryService extends IService<LawsProblemLibrary> {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 分页查询
|
* @Author: liao
|
||||||
*
|
* @Date: 2023/9/28 13:44
|
||||||
* @param lawsProblemLibrary
|
* @Description: 分页查询
|
||||||
* @param pageNo
|
**/
|
||||||
* @param pageSize
|
|
||||||
* @param req
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
IPage<LawsProblemLibrary> queryPage(LawsProblemLibrary lawsProblemLibrary, Integer pageNo, Integer pageSize, HttpServletRequest req);
|
IPage<LawsProblemLibrary> queryPage(LawsProblemLibrary lawsProblemLibrary, Integer pageNo, Integer pageSize, HttpServletRequest req);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 列表查询
|
* @Author: liao
|
||||||
*
|
* @Date: 2023/9/28 11:47
|
||||||
* @param lawsProblemLibrary
|
* @Description: 添加问题
|
||||||
* @param req
|
**/
|
||||||
* @return
|
void addProblem(LawsProblemLibrary lawsProblemLibrary);
|
||||||
*/
|
|
||||||
List<LawsProblemLibrary> queryList(LawsProblemLibrary lawsProblemLibrary, HttpServletRequest req);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 保存
|
* @Author: liao
|
||||||
*
|
* @Date: 2023/9/28 13:51
|
||||||
* @param lawsProblemLibrary
|
* @Description: 回答问题
|
||||||
* @return
|
**/
|
||||||
*/
|
void addAnswer(LawsAnswerLibrary lawsAnswerLibrary);
|
||||||
void add(LawsProblemLibrary lawsProblemLibrary);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 更新
|
* @Author: liao
|
||||||
*
|
* @Date: 2023/9/28 13:48
|
||||||
* @param lawsProblemLibrary
|
* @Description: 通过id查询
|
||||||
* @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);
|
LawsProblemLibrary queryById(String id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: liao
|
||||||
|
* @Date: 2023/9/28 13:44
|
||||||
|
* @Description: 根据id删除问题
|
||||||
|
**/
|
||||||
|
void deleteProblem(String id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: liao
|
||||||
|
* @Date: 2023/9/28 14:18
|
||||||
|
* @Description: 通过id删除回答
|
||||||
|
**/
|
||||||
|
void deleteAnswer(String id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: liao
|
||||||
|
* @Date: 2023/9/28 14:21
|
||||||
|
* @Description: 是否置顶
|
||||||
|
**/
|
||||||
|
void isTop(String id);
|
||||||
}
|
}
|
||||||
|
|||||||
-86
@@ -26,90 +26,4 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|||||||
@Transactional(rollbackFor = JeroBootException.class)
|
@Transactional(rollbackFor = JeroBootException.class)
|
||||||
public class LawsAnswerLibraryServiceImpl extends ServiceImpl<LawsAnswerLibraryMapper, LawsAnswerLibrary> implements ILawsAnswerLibraryService {
|
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);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
+113
-57
@@ -1,14 +1,29 @@
|
|||||||
package com.jero.modules.laws.library.service.impl;
|
package com.jero.modules.laws.library.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
|
import com.jero.common.api.vo.Result;
|
||||||
|
import com.jero.common.system.vo.LoginUser;
|
||||||
|
import com.jero.common.util.MessageUtils;
|
||||||
|
import com.jero.modules.laws.common.constant.ResultCommon;
|
||||||
|
import com.jero.modules.laws.common.service.ILawsCommonService;
|
||||||
|
import com.jero.modules.laws.common.vo.ManyStandardSelectionBox;
|
||||||
|
import com.jero.modules.laws.library.entity.LawsAnswerLibrary;
|
||||||
import com.jero.modules.laws.library.entity.LawsProblemLibrary;
|
import com.jero.modules.laws.library.entity.LawsProblemLibrary;
|
||||||
import com.jero.modules.laws.library.mapper.LawsProblemLibraryMapper;
|
import com.jero.modules.laws.library.mapper.LawsProblemLibraryMapper;
|
||||||
|
import com.jero.modules.laws.library.service.ILawsAnswerLibraryService;
|
||||||
import com.jero.modules.laws.library.service.ILawsProblemLibraryService;
|
import com.jero.modules.laws.library.service.ILawsProblemLibraryService;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.apache.shiro.SecurityUtils;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
import com.jero.common.exception.JeroBootException;
|
import com.jero.common.exception.JeroBootException;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.jero.common.system.query.QueryGenerator;
|
import com.jero.common.system.query.QueryGenerator;
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
@@ -26,16 +41,11 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|||||||
@Transactional(rollbackFor = JeroBootException.class)
|
@Transactional(rollbackFor = JeroBootException.class)
|
||||||
public class LawsProblemLibraryServiceImpl extends ServiceImpl<LawsProblemLibraryMapper, LawsProblemLibrary> implements ILawsProblemLibraryService {
|
public class LawsProblemLibraryServiceImpl extends ServiceImpl<LawsProblemLibraryMapper, LawsProblemLibrary> implements ILawsProblemLibraryService {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ILawsCommonService lawsCommonService;
|
||||||
|
@Autowired
|
||||||
|
private ILawsAnswerLibraryService lawsAnswerLibraryService;
|
||||||
|
|
||||||
/**
|
|
||||||
* 分页查询
|
|
||||||
*
|
|
||||||
* @param lawsProblemLibrary
|
|
||||||
* @param pageNo
|
|
||||||
* @param pageSize
|
|
||||||
* @param req
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public IPage<LawsProblemLibrary> queryPage(LawsProblemLibrary lawsProblemLibrary, Integer pageNo, Integer pageSize,
|
public IPage<LawsProblemLibrary> queryPage(LawsProblemLibrary lawsProblemLibrary, Integer pageNo, Integer pageSize,
|
||||||
HttpServletRequest req) {
|
HttpServletRequest req) {
|
||||||
@@ -45,74 +55,120 @@ public class LawsProblemLibraryServiceImpl extends ServiceImpl<LawsProblemLibrar
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 列表查询
|
* @Author: liao
|
||||||
*
|
* @Date: 2023/9/28 11:48
|
||||||
* @param lawsProblemLibrary
|
* @Description: 添加问题
|
||||||
* @param req
|
**/
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public List<LawsProblemLibrary> queryList(LawsProblemLibrary lawsProblemLibrary, HttpServletRequest req) {
|
public void addProblem(LawsProblemLibrary lawsProblemLibrary) {
|
||||||
return list(QueryGenerator.initQueryWrapper(lawsProblemLibrary, req.getParameterMap()));
|
LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||||
|
if (StringUtils.isBlank(lawsProblemLibrary.getTitle())) {
|
||||||
|
throw new JeroBootException(ResultCommon.EMPTY_COMMON, "title");
|
||||||
}
|
}
|
||||||
|
if (StringUtils.isBlank(lawsProblemLibrary.getStandardNumber())) {
|
||||||
|
throw new JeroBootException(ResultCommon.EMPTY_COMMON, "standardNumber");
|
||||||
|
}
|
||||||
|
if (StringUtils.isBlank(lawsProblemLibrary.getProblemDescription())) {
|
||||||
|
throw new JeroBootException(ResultCommon.EMPTY_COMMON, "problemDescription");
|
||||||
|
}
|
||||||
|
// 如果是国内、海外、企业
|
||||||
|
if (!"4".equals(lawsProblemLibrary.getType())) {
|
||||||
|
ManyStandardSelectionBox singleStandard = lawsCommonService.getSingleStandard(lawsProblemLibrary.getStandardNumber(), null);
|
||||||
|
lawsProblemLibrary.setStandardId(singleStandard.getId());
|
||||||
|
lawsProblemLibrary.setStandardName(singleStandard.getStandardName());
|
||||||
|
}
|
||||||
|
lawsProblemLibrary.setUserId(loginUser.getId());
|
||||||
|
lawsProblemLibrary.setOrgCode(loginUser.getOrgCode());
|
||||||
|
lawsProblemLibrary.setIsAnswer(0);
|
||||||
|
|
||||||
/**
|
|
||||||
* 保存
|
|
||||||
*
|
|
||||||
* @param lawsProblemLibrary
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public void add(LawsProblemLibrary lawsProblemLibrary) {
|
|
||||||
Date now = new Date();
|
|
||||||
lawsProblemLibrary.setCreateTime(now);
|
|
||||||
lawsProblemLibrary.setUpdateTime(now);
|
|
||||||
save(lawsProblemLibrary);
|
save(lawsProblemLibrary);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 更新
|
* @Author: liao
|
||||||
*
|
* @Date: 2023/9/28 13:51
|
||||||
* @param lawsProblemLibrary
|
* @Description: 回答问题
|
||||||
* @return
|
**/
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public void editById(LawsProblemLibrary lawsProblemLibrary) {
|
public void addAnswer(LawsAnswerLibrary lawsAnswerLibrary) {
|
||||||
Date now = new Date();
|
LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||||
lawsProblemLibrary.setUpdateTime(now);
|
if (StringUtils.isBlank(lawsAnswerLibrary.getProblemId())) {
|
||||||
saveOrUpdate(lawsProblemLibrary);
|
throw new JeroBootException(ResultCommon.EMPTY_COMMON, "problemId");
|
||||||
|
}
|
||||||
|
|
||||||
|
lawsAnswerLibrary.setUserId(loginUser.getId());
|
||||||
|
lawsAnswerLibrary.setOrgCode(loginUser.getOrgCode());
|
||||||
|
lawsAnswerLibrary.setIsTop(0);
|
||||||
|
lawsAnswerLibrary.setCreateTime(new Date());
|
||||||
|
|
||||||
|
lawsAnswerLibraryService.save(lawsAnswerLibrary);
|
||||||
|
|
||||||
|
// 更新问题的回答状态
|
||||||
|
LambdaUpdateWrapper<LawsProblemLibrary> updateWrapper = new LambdaUpdateWrapper<>();
|
||||||
|
updateWrapper.set(LawsProblemLibrary::getIsAnswer, 1);
|
||||||
|
updateWrapper.eq(LawsProblemLibrary::getId, lawsAnswerLibrary.getProblemId());
|
||||||
|
update(updateWrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过id删除
|
* @Author: liao
|
||||||
*
|
* @Date: 2023/9/28 13:48
|
||||||
* @param id
|
* @Description: 通过id查询
|
||||||
* @return
|
**/
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public void deleteById(String id) {
|
public LawsProblemLibrary queryById(String id) {
|
||||||
|
LawsProblemLibrary lawsProblemLibrary = getById(id);
|
||||||
|
if(Objects.isNull(lawsProblemLibrary)) {
|
||||||
|
throw new JeroBootException(ResultCommon.NO_CORRESPONDING_DATA_FOUND);
|
||||||
|
}
|
||||||
|
|
||||||
|
LambdaQueryWrapper<LawsAnswerLibrary> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
queryWrapper.eq(LawsAnswerLibrary::getProblemId, id);
|
||||||
|
queryWrapper.orderByDesc(LawsAnswerLibrary::getIsTop).orderByDesc(LawsAnswerLibrary::getCreateTime);
|
||||||
|
List<LawsAnswerLibrary> answerList = lawsAnswerLibraryService.list(queryWrapper);
|
||||||
|
|
||||||
|
lawsProblemLibrary.setAnswerList(answerList);
|
||||||
|
lawsProblemLibrary.setAnswerCount(answerList.size());
|
||||||
|
|
||||||
|
return lawsProblemLibrary;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: liao
|
||||||
|
* @Date: 2023/9/28 13:48
|
||||||
|
* @Description: 根据id删除问题
|
||||||
|
**/
|
||||||
|
@Override
|
||||||
|
public void deleteProblem(String id) {
|
||||||
removeById(id);
|
removeById(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量删除
|
* @Author: liao
|
||||||
*
|
* @Date: 2023/9/28 14:18
|
||||||
* @param ids
|
* @Description: 通过id删除回答
|
||||||
* @return
|
**/
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public void deleteByIds(List<String> ids) {
|
public void deleteAnswer(String id) {
|
||||||
removeByIds(ids);
|
lawsAnswerLibraryService.removeById(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过id查询
|
* @Author: liao
|
||||||
*
|
* @Date: 2023/9/28 14:21
|
||||||
* @param id
|
* @Description: 是否置顶
|
||||||
* @return
|
**/
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public LawsProblemLibrary queryById(String id) {
|
public void isTop(String id) {
|
||||||
return getById(id);
|
LawsAnswerLibrary lawsAnswerLibrary = lawsAnswerLibraryService.getById(id);
|
||||||
|
if(Objects.isNull(lawsAnswerLibrary)) {
|
||||||
|
throw new JeroBootException(ResultCommon.NO_CORRESPONDING_DATA_FOUND);
|
||||||
|
}
|
||||||
|
if (0 == lawsAnswerLibrary.getIsTop()) {
|
||||||
|
lawsAnswerLibrary.setIsTop(1);
|
||||||
|
} else {
|
||||||
|
lawsAnswerLibrary.setIsTop(0);
|
||||||
|
}
|
||||||
|
lawsAnswerLibraryService.updateById(lawsAnswerLibrary);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user