Merge remote-tracking branch 'origin/fourthStage' into fourthStage
This commit is contained in:
@@ -57,6 +57,11 @@ where process_definition_id like 'standard-assessment:%';
|
|||||||
# 标准法规征求意见流程结束
|
# 标准法规征求意见流程结束
|
||||||
|
|
||||||
# 项目合规评估流程开始
|
# 项目合规评估流程开始
|
||||||
|
# 更新是否可见
|
||||||
|
update process_node
|
||||||
|
set is_view = 0
|
||||||
|
where process_definition_id like 'project-assessment:%'
|
||||||
|
and xml_node_id in ('mkfzrxg');
|
||||||
# 更新是否可跳过
|
# 更新是否可跳过
|
||||||
update process_node
|
update process_node
|
||||||
set is_skip = 1
|
set is_skip = 1
|
||||||
|
|||||||
@@ -60,7 +60,8 @@ public class CsrfFilter implements Filter {
|
|||||||
|| url.contains("view")
|
|| url.contains("view")
|
||||||
|| url.contains("doc.html")
|
|| url.contains("doc.html")
|
||||||
|| url.contains("onlyOffice")
|
|| url.contains("onlyOffice")
|
||||||
|| url.contains("/srms/")){
|
|| url.contains("/srms/")
|
||||||
|
|| url.contains("downloadWithoutToken")){
|
||||||
chain.doFilter(request, response);
|
chain.doFilter(request, response);
|
||||||
}else{
|
}else{
|
||||||
String log = "";
|
String log = "";
|
||||||
|
|||||||
+10
-1
@@ -59,6 +59,8 @@ public class ActivitiController {
|
|||||||
@Resource
|
@Resource
|
||||||
private HistoryService historyService;
|
private HistoryService historyService;
|
||||||
@Resource
|
@Resource
|
||||||
|
private RuntimeService runtimeService;
|
||||||
|
@Resource
|
||||||
private TaskService taskService;
|
private TaskService taskService;
|
||||||
@Resource
|
@Resource
|
||||||
private ProcessNodeService processNodeService;
|
private ProcessNodeService processNodeService;
|
||||||
@@ -105,7 +107,7 @@ public class ActivitiController {
|
|||||||
map1.put("流程实例id:", processInstanceId);
|
map1.put("流程实例id:", processInstanceId);
|
||||||
map1.put("当前活动Id:", processInstance.getActivityId());
|
map1.put("当前活动Id:", processInstance.getActivityId());
|
||||||
|
|
||||||
String mainDrafter = map.get("mainDrafter").toString();
|
//String mainDrafter = map.get("mainDrafter").toString();
|
||||||
|
|
||||||
return Result.OK(map1);
|
return Result.OK(map1);
|
||||||
}
|
}
|
||||||
@@ -173,6 +175,13 @@ public class ActivitiController {
|
|||||||
return Result.OK();
|
return Result.OK();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GetMapping("/deleteProcessInstance")
|
||||||
|
@ApiOperation(value = "删除流程实例", notes = "删除流程实例")
|
||||||
|
public Result<Object> deleteProcessInstance(@RequestParam(value = "id", required = false) String id) {
|
||||||
|
runtimeService.deleteProcessInstance(id,"删除");
|
||||||
|
return Result.OK();
|
||||||
|
}
|
||||||
|
|
||||||
@GetMapping("/deleteDeployment")
|
@GetMapping("/deleteDeployment")
|
||||||
@ApiOperation(value = "删除已部署的流程定义", notes = "删除已部署的流程定义")
|
@ApiOperation(value = "删除已部署的流程定义", notes = "删除已部署的流程定义")
|
||||||
public Result<Object> deleteDeployment(@RequestParam(value = "id", required = false) String id) {
|
public Result<Object> deleteDeployment(@RequestParam(value = "id", required = false) String id) {
|
||||||
|
|||||||
+1
-1
@@ -128,7 +128,7 @@ public class MyGlobalEventListener implements ActivitiEventListener {
|
|||||||
wrapper.eq(ProcessNode::getNodeName,name);
|
wrapper.eq(ProcessNode::getNodeName,name);
|
||||||
wrapper.eq(ProcessNode::getIsView, YesOrNoEnum.YES.getValue());
|
wrapper.eq(ProcessNode::getIsView, YesOrNoEnum.YES.getValue());
|
||||||
int count = processNodeService.count(wrapper);
|
int count = processNodeService.count(wrapper);
|
||||||
if (count == 0){
|
if (count == 0 || "123".equals(assignee)){
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
//新增待审批记录
|
//新增待审批记录
|
||||||
|
|||||||
+1
@@ -12,6 +12,7 @@ public class ProcessProjectAssessCommon {
|
|||||||
public static final String DESIGN_ENGINEER_LIST = "designEngineerList";
|
public static final String DESIGN_ENGINEER_LIST = "designEngineerList";
|
||||||
public static final String DESIGN_ENGINEER_LIST_SIZE = "designEngineerListSize";
|
public static final String DESIGN_ENGINEER_LIST_SIZE = "designEngineerListSize";
|
||||||
public static final String PASS = "pass";
|
public static final String PASS = "pass";
|
||||||
|
public static final String SKIP = "skip";
|
||||||
public static final String EXECUTION_ID = "executionId";
|
public static final String EXECUTION_ID = "executionId";
|
||||||
//法规工程师发起
|
//法规工程师发起
|
||||||
public static final String FGGCSFQ = "fggcsfq";
|
public static final String FGGCSFQ = "fggcsfq";
|
||||||
|
|||||||
+10
@@ -911,5 +911,15 @@ public class ProcessProjectAssessService extends ServiceImpl<ProcessProjectAsses
|
|||||||
String parentExecutionId = (String) ThreadLocalUtil.get(ProcessProjectAssessCommon.EXECUTION_ID);
|
String parentExecutionId = (String) ThreadLocalUtil.get(ProcessProjectAssessCommon.EXECUTION_ID);
|
||||||
//delegateTask.setVariableLocal(ProcessProjectAssessCommon.EXECUTION_ID,parentExecutionId);
|
//delegateTask.setVariableLocal(ProcessProjectAssessCommon.EXECUTION_ID,parentExecutionId);
|
||||||
delegateTask.setFormKey(parentExecutionId);
|
delegateTask.setFormKey(parentExecutionId);
|
||||||
|
if ("123".equals(delegateTask.getAssignee())) {
|
||||||
|
runtimeService.setVariable(delegateTask.getExecutionId(),ProcessProjectAssessCommon.SKIP,true);
|
||||||
|
if (!delegateTask.getName().contains("自动")) {
|
||||||
|
Map<String, Object> variables = new HashMap<>();
|
||||||
|
variables.put(ProcessProjectAssessCommon.SKIP, true);
|
||||||
|
taskService.complete(delegateTask.getId(), variables);
|
||||||
|
}
|
||||||
|
}else {
|
||||||
|
runtimeService.setVariable(delegateTask.getExecutionId(),ProcessProjectAssessCommon.SKIP,false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+6
@@ -522,6 +522,12 @@ public class ProcessProjectStandardService extends ServiceImpl<ProcessProjectSta
|
|||||||
.filter(Objects::nonNull)
|
.filter(Objects::nonNull)
|
||||||
.distinct()
|
.distinct()
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
|
if (notInvolvedModuleOwnerList.size() == 0){
|
||||||
|
notInvolvedModuleOwnerList.add("123");
|
||||||
|
}
|
||||||
|
if (moduleOwnerList.size() == 0){
|
||||||
|
moduleOwnerList.add("123");
|
||||||
|
}
|
||||||
variables.put(ProcessProjectStandardCommon.NOT_INVOLVED_MODULE_OWNER_LIST, notInvolvedModuleOwnerList);
|
variables.put(ProcessProjectStandardCommon.NOT_INVOLVED_MODULE_OWNER_LIST, notInvolvedModuleOwnerList);
|
||||||
variables.put(ProcessProjectStandardCommon.NOT_INVOLVED_MODULE_OWNER_LIST_SIZE, notInvolvedModuleOwnerList.size());
|
variables.put(ProcessProjectStandardCommon.NOT_INVOLVED_MODULE_OWNER_LIST_SIZE, notInvolvedModuleOwnerList.size());
|
||||||
variables.put(ProcessProjectStandardCommon.MODULE_OWNER_LIST, moduleOwnerList);
|
variables.put(ProcessProjectStandardCommon.MODULE_OWNER_LIST, moduleOwnerList);
|
||||||
|
|||||||
+99
-98
@@ -24,120 +24,121 @@ import org.apache.commons.lang3.StringUtils;
|
|||||||
import org.apache.poi.ss.formula.functions.T;
|
import org.apache.poi.ss.formula.functions.T;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Description: 问答库-问题
|
* @Description: 问答库-问题
|
||||||
* @Author: jero-boot
|
* @Author: jero-boot
|
||||||
* @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
|
||||||
public class LawsProblemLibraryController extends JeroController<LawsProblemLibrary, ILawsProblemLibraryService> {
|
public class LawsProblemLibraryController extends JeroController<LawsProblemLibrary, ILawsProblemLibraryService> {
|
||||||
@Autowired
|
|
||||||
private ILawsProblemLibraryService lawsProblemLibraryService;
|
|
||||||
|
|
||||||
@AutoLog(value = "问答库-分页列表查询")
|
@Autowired
|
||||||
@ApiOperation(value="问答库-分页列表查询", notes="问答库-问题-分页列表查询")
|
private ILawsProblemLibraryService lawsProblemLibraryService;
|
||||||
@GetMapping(value = "/page")
|
|
||||||
@RequiresPermissions("businessSupport:questionAnswer:search")
|
|
||||||
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);
|
|
||||||
}
|
|
||||||
|
|
||||||
@AutoLog(value = "问答库-提出问题")
|
@AutoLog(value = "问答库-分页列表查询")
|
||||||
@ApiOperation(value="问答库-提出问题", notes="问答库-提出问题")
|
@ApiOperation(value = "问答库-分页列表查询", notes = "问答库-问题-分页列表查询")
|
||||||
@PostMapping(value = "/addProblem")
|
@GetMapping(value = "/page")
|
||||||
@RequiresPermissions("businessSupport:questionAnswer:quiz")
|
@RequiresPermissions("businessSupport:questionAnswer:search")
|
||||||
public Result<T> addProblem(@Validated @RequestBody LawsProblemLibrary lawsProblemLibrary) {
|
public Result<IPage<LawsProblemLibrary>> queryPageList(LawsProblemLibrary lawsProblemLibrary,
|
||||||
lawsProblemLibraryService.addProblem(lawsProblemLibrary);
|
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||||
return Result.OK(ResultCommon.OK);
|
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||||
}
|
HttpServletRequest req) {
|
||||||
|
IPage<LawsProblemLibrary> pageList = lawsProblemLibraryService.queryPage(lawsProblemLibrary, pageNo, pageSize, req);
|
||||||
|
return Result.OK(pageList);
|
||||||
|
}
|
||||||
|
|
||||||
@AutoLog(value = "国内标准-提出问题")
|
@AutoLog(value = "问答库-提出问题")
|
||||||
@ApiOperation(value="国内标准-提出问题", notes="国内标准-提出问题")
|
@ApiOperation(value = "问答库-提出问题", notes = "问答库-提出问题")
|
||||||
@PostMapping(value = "/addProblem/GB")
|
@PostMapping(value = "/addProblem")
|
||||||
@RequiresPermissions("domesticStandard:submitQuestion")
|
@RequiresPermissions("businessSupport:questionAnswer:quiz")
|
||||||
public Result<T> addProblemGB(@Validated @RequestBody LawsProblemLibrary lawsProblemLibrary) {
|
public Result<T> addProblem(@Validated @RequestBody LawsProblemLibrary lawsProblemLibrary) {
|
||||||
lawsProblemLibrary.setType("1");
|
lawsProblemLibraryService.addProblem(lawsProblemLibrary);
|
||||||
lawsProblemLibraryService.addProblem(lawsProblemLibrary);
|
return Result.OK(ResultCommon.OK);
|
||||||
return Result.OK(ResultCommon.OK);
|
}
|
||||||
}
|
|
||||||
|
|
||||||
@AutoLog(value = "海外标准-提出问题")
|
@AutoLog(value = "国内标准-提出问题")
|
||||||
@ApiOperation(value="海外标准-提出问题", notes="海外标准-提出问题")
|
@ApiOperation(value = "国内标准-提出问题", notes = "国内标准-提出问题")
|
||||||
@PostMapping(value = "/addProblem/FB")
|
@PostMapping(value = "/addProblem/GB")
|
||||||
@RequiresPermissions("overseasStandard:submitQuestion")
|
@RequiresPermissions("domesticStandard:submitQuestion")
|
||||||
public Result<T> addProblemFB(@Validated @RequestBody LawsProblemLibrary lawsProblemLibrary) {
|
public Result<T> addProblemGB(@Validated @RequestBody LawsProblemLibrary lawsProblemLibrary) {
|
||||||
lawsProblemLibrary.setType("2");
|
lawsProblemLibrary.setType("1");
|
||||||
lawsProblemLibraryService.addProblem(lawsProblemLibrary);
|
lawsProblemLibraryService.addProblem(lawsProblemLibrary);
|
||||||
return Result.OK(ResultCommon.OK);
|
return Result.OK(ResultCommon.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
@AutoLog(value = "企业标准-提出问题")
|
@AutoLog(value = "海外标准-提出问题")
|
||||||
@ApiOperation(value="企业标准-提出问题", notes="企业标准-提出问题")
|
@ApiOperation(value = "海外标准-提出问题", notes = "海外标准-提出问题")
|
||||||
@PostMapping(value = "/addProblem/QB")
|
@PostMapping(value = "/addProblem/FB")
|
||||||
@RequiresPermissions("enterpriseStandard:detail:submitQuestion")
|
@RequiresPermissions("overseasStandard:submitQuestion")
|
||||||
public Result<T> addProblemQB(@Validated @RequestBody LawsProblemLibrary lawsProblemLibrary) {
|
public Result<T> addProblemFB(@Validated @RequestBody LawsProblemLibrary lawsProblemLibrary) {
|
||||||
lawsProblemLibrary.setType("3");
|
lawsProblemLibrary.setType("2");
|
||||||
lawsProblemLibraryService.addProblem(lawsProblemLibrary);
|
lawsProblemLibraryService.addProblem(lawsProblemLibrary);
|
||||||
return Result.OK(ResultCommon.OK);
|
return Result.OK(ResultCommon.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
@AutoLog(value = "问答库-回答问题")
|
@AutoLog(value = "企业标准-提出问题")
|
||||||
@ApiOperation(value="问答库-回答问题", notes="问答库-回答问题")
|
@ApiOperation(value = "企业标准-提出问题", notes = "企业标准-提出问题")
|
||||||
@PostMapping(value = "/addAnswer")
|
@PostMapping(value = "/addProblem/QB")
|
||||||
@RequiresPermissions("quiz:detail:answerSubmit")
|
@RequiresPermissions("enterpriseStandard:detail:submitQuestion")
|
||||||
public Result<T> addAnswer(@Validated @RequestBody LawsAnswerLibrary lawsAnswerLibrary) {
|
public Result<T> addProblemQB(@Validated @RequestBody LawsProblemLibrary lawsProblemLibrary) {
|
||||||
lawsProblemLibraryService.addAnswer(lawsAnswerLibrary);
|
lawsProblemLibrary.setType("3");
|
||||||
return Result.OK(ResultCommon.OK);
|
lawsProblemLibraryService.addProblem(lawsProblemLibrary);
|
||||||
}
|
return Result.OK(ResultCommon.OK);
|
||||||
|
}
|
||||||
|
|
||||||
@AutoLog(value = "问答库-通过id查询")
|
@AutoLog(value = "问答库-回答问题")
|
||||||
@ApiOperation(value="问答库-通过id查询", notes="问答库-通过id查询")
|
@ApiOperation(value = "问答库-回答问题", notes = "问答库-回答问题")
|
||||||
@GetMapping(value = "/queryById")
|
@PostMapping(value = "/addAnswer")
|
||||||
@Translation
|
@RequiresPermissions("quiz:detail:answerSubmit")
|
||||||
@RequiresPermissions("businessSupport:questionAnswer:detail")
|
public Result<T> addAnswer(@Validated @RequestBody LawsAnswerLibrary lawsAnswerLibrary) {
|
||||||
public Result<LawsProblemLibrary> queryById(@RequestParam(name="id") String id) {
|
lawsProblemLibraryService.addAnswer(lawsAnswerLibrary);
|
||||||
LawsProblemLibrary lawsProblemLibrary = lawsProblemLibraryService.queryById(id);
|
return Result.OK(ResultCommon.OK);
|
||||||
return Result.OK(lawsProblemLibrary);
|
}
|
||||||
}
|
|
||||||
|
|
||||||
@AutoLog(value = "问答库-通过id删除问题")
|
@AutoLog(value = "问答库-通过id查询")
|
||||||
@ApiOperation(value="问答库-通过id删除问题", notes="问答库-通过id删除问题")
|
@ApiOperation(value = "问答库-通过id查询", notes = "问答库-通过id查询")
|
||||||
@PostMapping(value = "/deleteProblem")
|
@GetMapping(value = "/queryById")
|
||||||
@RequiresPermissions("businessSupport:questionAnswer:delete")
|
@Translation
|
||||||
public Result<T> deleteProblem(@RequestBody Map<String, String> map) {
|
@RequiresPermissions("businessSupport:questionAnswer:detail")
|
||||||
if(!map.containsKey("id") || StringUtils.isEmpty(map.get("id"))){
|
public Result<LawsProblemLibrary> queryById(@RequestParam(name = "id") String id) {
|
||||||
return Result.error(MessageUtils.getMessage(ResultCommon.SELECT_DATA));
|
LawsProblemLibrary lawsProblemLibrary = lawsProblemLibraryService.queryById(id);
|
||||||
}
|
return Result.OK(lawsProblemLibrary);
|
||||||
lawsProblemLibraryService.deleteProblem(map.get("id"));
|
}
|
||||||
return Result.OK(ResultCommon.OK);
|
|
||||||
}
|
|
||||||
|
|
||||||
@AutoLog(value = "问答库-通过id删除回答")
|
@AutoLog(value = "问答库-通过id删除问题")
|
||||||
@ApiOperation(value="问答库-通过id删除回答", notes="问答库-通过id删除回答")
|
@ApiOperation(value = "问答库-通过id删除问题", notes = "问答库-通过id删除问题")
|
||||||
@PostMapping(value = "/deleteAnswer")
|
@PostMapping(value = "/deleteProblem")
|
||||||
@RequiresPermissions("quiz:detail:deleteAnswer")
|
@RequiresPermissions("businessSupport:questionAnswer:delete")
|
||||||
public Result<T> deleteAnswer(@RequestBody Map<String, String> map) {
|
public Result<T> deleteProblem(@RequestBody Map<String, String> map) {
|
||||||
if(!map.containsKey("id") || StringUtils.isEmpty(map.get("id"))){
|
if (!map.containsKey("id") || StringUtils.isEmpty(map.get("id"))) {
|
||||||
return Result.error(MessageUtils.getMessage(ResultCommon.SELECT_DATA));
|
return Result.error(MessageUtils.getMessage(ResultCommon.SELECT_DATA));
|
||||||
}
|
}
|
||||||
lawsProblemLibraryService.deleteAnswer(map.get("id"));
|
lawsProblemLibraryService.deleteProblem(map.get("id"));
|
||||||
return Result.OK(ResultCommon.OK);
|
return Result.OK(ResultCommon.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
@AutoLog(value = "问答库-是否置顶")
|
@AutoLog(value = "问答库-通过id删除回答")
|
||||||
@ApiOperation(value="问答库-是否置顶", notes="问答库-是否置顶")
|
@ApiOperation(value = "问答库-通过id删除回答", notes = "问答库-通过id删除回答")
|
||||||
@GetMapping(value = "/isTop")
|
@PostMapping(value = "/deleteAnswer")
|
||||||
@RequiresPermissions("quiz:detail:topOrCancel")
|
@RequiresPermissions("quiz:detail:deleteAnswer")
|
||||||
public Result<T> isTop(@RequestParam(name="id") String id) {
|
public Result<T> deleteAnswer(@RequestBody Map<String, String> map) {
|
||||||
lawsProblemLibraryService.isTop(id);
|
if (!map.containsKey("id") || StringUtils.isEmpty(map.get("id"))) {
|
||||||
return Result.OK(ResultCommon.OK);
|
return Result.error(MessageUtils.getMessage(ResultCommon.SELECT_DATA));
|
||||||
}
|
}
|
||||||
|
lawsProblemLibraryService.deleteAnswer(map.get("id"));
|
||||||
|
return Result.OK(ResultCommon.OK);
|
||||||
|
}
|
||||||
|
|
||||||
|
@AutoLog(value = "问答库-是否置顶")
|
||||||
|
@ApiOperation(value = "问答库-是否置顶", notes = "问答库-是否置顶")
|
||||||
|
@GetMapping(value = "/isTop")
|
||||||
|
@RequiresPermissions("quiz:detail:topOrCancel")
|
||||||
|
public Result<T> isTop(@RequestParam(name = "id") String id) {
|
||||||
|
lawsProblemLibraryService.isTop(id);
|
||||||
|
return Result.OK(ResultCommon.OK);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+52
-3
@@ -1,5 +1,6 @@
|
|||||||
package com.jero.modules.laws.library.service.impl;
|
package com.jero.modules.laws.library.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
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.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
@@ -16,6 +17,7 @@ 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.ILawsAnswerLibraryService;
|
||||||
import com.jero.modules.laws.library.service.ILawsProblemLibraryService;
|
import com.jero.modules.laws.library.service.ILawsProblemLibraryService;
|
||||||
|
import com.jero.modules.sys.utils.UserUtils;
|
||||||
import com.jero.modules.system.entity.SysDepart;
|
import com.jero.modules.system.entity.SysDepart;
|
||||||
import com.jero.modules.system.entity.SysDictItem;
|
import com.jero.modules.system.entity.SysDictItem;
|
||||||
import com.jero.modules.system.entity.SysUser;
|
import com.jero.modules.system.entity.SysUser;
|
||||||
@@ -25,6 +27,7 @@ import org.apache.commons.collections4.CollectionUtils;
|
|||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.apache.shiro.SecurityUtils;
|
import org.apache.shiro.SecurityUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
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;
|
||||||
@@ -36,7 +39,9 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|||||||
import com.jero.common.system.query.QueryGenerator;
|
import com.jero.common.system.query.QueryGenerator;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
import javax.management.relation.Role;
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
|
||||||
@@ -44,7 +49,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|||||||
/**
|
/**
|
||||||
* @Description: 问答库-问题
|
* @Description: 问答库-问题
|
||||||
* @Author: jero-boot
|
* @Author: jero-boot
|
||||||
* @Date: 2023-09-28
|
* @Date: 2023-09-28
|
||||||
* @Version: V1.0
|
* @Version: V1.0
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
@@ -62,6 +67,12 @@ public class LawsProblemLibraryServiceImpl extends ServiceImpl<LawsProblemLibrar
|
|||||||
@Resource
|
@Resource
|
||||||
private SendMessageAPI sendMessageAPI;
|
private SendMessageAPI sendMessageAPI;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private ISysUserService userService;
|
||||||
|
|
||||||
|
@Value("${adminRoleCode}")
|
||||||
|
private String adminRoleCode;
|
||||||
|
|
||||||
@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) {
|
||||||
@@ -115,6 +126,12 @@ public class LawsProblemLibraryServiceImpl extends ServiceImpl<LawsProblemLibrar
|
|||||||
throw new JeroBootException(ResultCommon.EMPTY_COMMON, "problemId");
|
throw new JeroBootException(ResultCommon.EMPTY_COMMON, "problemId");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 处理水平越权 自己提的问题自己不能回复
|
||||||
|
LawsProblemLibrary problem = getById(lawsAnswerLibrary.getProblemId());
|
||||||
|
if (loginUser.getUsername().equals(problem.getCreateBy())) {
|
||||||
|
throw new JeroBootException(ResultCommon.NO_PERMISSION);
|
||||||
|
}
|
||||||
|
|
||||||
lawsAnswerLibrary.setUserId(loginUser.getId());
|
lawsAnswerLibrary.setUserId(loginUser.getId());
|
||||||
lawsAnswerLibrary.setOrgCode(loginUser.getOrgCode());
|
lawsAnswerLibrary.setOrgCode(loginUser.getOrgCode());
|
||||||
lawsAnswerLibrary.setIsTop(0);
|
lawsAnswerLibrary.setIsTop(0);
|
||||||
@@ -137,7 +154,7 @@ public class LawsProblemLibraryServiceImpl extends ServiceImpl<LawsProblemLibrar
|
|||||||
@Override
|
@Override
|
||||||
public LawsProblemLibrary queryById(String id) {
|
public LawsProblemLibrary queryById(String id) {
|
||||||
LawsProblemLibrary lawsProblemLibrary = getById(id);
|
LawsProblemLibrary lawsProblemLibrary = getById(id);
|
||||||
if(Objects.isNull(lawsProblemLibrary)) {
|
if (Objects.isNull(lawsProblemLibrary)) {
|
||||||
throw new JeroBootException(ResultCommon.NO_CORRESPONDING_DATA_FOUND);
|
throw new JeroBootException(ResultCommon.NO_CORRESPONDING_DATA_FOUND);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -183,6 +200,12 @@ public class LawsProblemLibraryServiceImpl extends ServiceImpl<LawsProblemLibrar
|
|||||||
**/
|
**/
|
||||||
@Override
|
@Override
|
||||||
public void deleteProblem(String id) {
|
public void deleteProblem(String id) {
|
||||||
|
// 处理水平越权 只有创建人可以删除问题
|
||||||
|
LoginUser currentUser = UserUtils.getCurrentUser();
|
||||||
|
LawsProblemLibrary problem = getById(id);
|
||||||
|
if (!currentUser.getUsername().equals(problem.getCreateBy())) {
|
||||||
|
throw new JeroBootException(ResultCommon.NO_PERMISSION);
|
||||||
|
}
|
||||||
removeById(id);
|
removeById(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -193,6 +216,19 @@ public class LawsProblemLibraryServiceImpl extends ServiceImpl<LawsProblemLibrar
|
|||||||
**/
|
**/
|
||||||
@Override
|
@Override
|
||||||
public void deleteAnswer(String id) {
|
public void deleteAnswer(String id) {
|
||||||
|
// 处理水平越权 管理员和创建者才可以删除所有评论 其他人只能删除自己的评论
|
||||||
|
LoginUser currentUser = UserUtils.getCurrentUser();
|
||||||
|
List<String> userRoleList = userService.getRole(currentUser.getUsername());
|
||||||
|
LawsAnswerLibrary answer = lawsAnswerLibraryService.getById(id);
|
||||||
|
LawsProblemLibrary problem = getById(answer.getProblemId());
|
||||||
|
// 如果是管理员权限 则跳过验证
|
||||||
|
List<String> adminRoleList = Arrays.asList(adminRoleCode.split(","));
|
||||||
|
// 如果不是管理员权限 且不是问题创建者 且不是回答创建者 则没有权限
|
||||||
|
if (adminRoleList.stream().noneMatch(userRoleList::contains)) {
|
||||||
|
if (!currentUser.getUsername().equals(problem.getCreateBy())) {
|
||||||
|
throw new JeroBootException(ResultCommon.NO_PERMISSION);
|
||||||
|
}
|
||||||
|
}
|
||||||
lawsAnswerLibraryService.removeById(id);
|
lawsAnswerLibraryService.removeById(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -204,9 +240,22 @@ public class LawsProblemLibraryServiceImpl extends ServiceImpl<LawsProblemLibrar
|
|||||||
@Override
|
@Override
|
||||||
public void isTop(String id) {
|
public void isTop(String id) {
|
||||||
LawsAnswerLibrary lawsAnswerLibrary = lawsAnswerLibraryService.getById(id);
|
LawsAnswerLibrary lawsAnswerLibrary = lawsAnswerLibraryService.getById(id);
|
||||||
if(Objects.isNull(lawsAnswerLibrary)) {
|
if (Objects.isNull(lawsAnswerLibrary)) {
|
||||||
throw new JeroBootException(ResultCommon.NO_CORRESPONDING_DATA_FOUND);
|
throw new JeroBootException(ResultCommon.NO_CORRESPONDING_DATA_FOUND);
|
||||||
}
|
}
|
||||||
|
// 处理水平越权 管理员和创建者才可以删除所有评论 其他人只能删除自己的评论
|
||||||
|
LoginUser currentUser = UserUtils.getCurrentUser();
|
||||||
|
List<String> userRoleList = userService.getRole(currentUser.getUsername());
|
||||||
|
// 如果是管理员权限 则跳过验证
|
||||||
|
List<String> adminRoleList = Arrays.asList(adminRoleCode.split(","));
|
||||||
|
// 如果不是管理员权限 且不是问题创建者 且不是回答创建者 则没有权限
|
||||||
|
if (adminRoleList.stream().noneMatch(userRoleList::contains)) {
|
||||||
|
LawsProblemLibrary problem = getById(lawsAnswerLibrary.getProblemId());
|
||||||
|
if (!currentUser.getUsername().equals(problem.getCreateBy())) {
|
||||||
|
throw new JeroBootException(ResultCommon.NO_PERMISSION);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (0 == lawsAnswerLibrary.getIsTop()) {
|
if (0 == lawsAnswerLibrary.getIsTop()) {
|
||||||
lawsAnswerLibrary.setIsTop(1);
|
lawsAnswerLibrary.setIsTop(1);
|
||||||
// 发送消息
|
// 发送消息
|
||||||
|
|||||||
+3
-1
@@ -158,7 +158,9 @@ public class LawsEvaluationNotMetServiceImpl extends ServiceImpl<LawsEvaluationN
|
|||||||
lawsEvaluationNotMet.setSource(source);
|
lawsEvaluationNotMet.setSource(source);
|
||||||
//如果待整改判断预警和超期
|
//如果待整改判断预警和超期
|
||||||
String state = lawsEvaluationNotMet.getState();
|
String state = lawsEvaluationNotMet.getState();
|
||||||
if (AssessCommon.TO_BE_RECTIFIED.equals(state)){
|
if (AssessCommon.TO_BE_RECTIFIED.equals(state)
|
||||||
|
||AssessCommon.OVERDUE.equals(state)
|
||||||
|
||AssessCommon.WARNING.equals(state)){
|
||||||
Date expectedTime = lawsEvaluationNotMet.getExpectedTime();
|
Date expectedTime = lawsEvaluationNotMet.getExpectedTime();
|
||||||
DateTime date = DateUtil.date();
|
DateTime date = DateUtil.date();
|
||||||
DateTime theDayBefore = DateUtil.offsetDay(date, 1);
|
DateTime theDayBefore = DateUtil.offsetDay(date, 1);
|
||||||
|
|||||||
@@ -98,6 +98,7 @@ public class SysCommonController {
|
|||||||
outputStream.write(buf, 0, len);
|
outputStream.write(buf, 0, len);
|
||||||
}
|
}
|
||||||
response.flushBuffer();
|
response.flushBuffer();
|
||||||
|
return;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error(e.getMessage());
|
log.error(e.getMessage());
|
||||||
response.setStatus(404);
|
response.setStatus(404);
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user