[!NOTE]
分享课程系统,客户平台投诉系统
主要框架:
Springboot
,mybatis
,Activiti
,soap
,Element-UI
,Vue
主要功能:用户可以对不同的平台,例如美团、学习通、饿了么等进行投诉(
Springboot
,mybatis
),工作管理员会对该投诉信息进行审批(Activiti
),若审批通过,通过soap
服务传递给对应平台提供的接口,对不同的平台设置了ProcessTime处理投诉的变量,模拟处理时间,当服务启动默认有工作人员在处理,当处理时间为0时,表示投诉处理完成,通过请求将对应ID的投诉信息返回。
系统框架
登录界面
用户申请投诉
管理员界面
- 投诉信息管理
- 代办任务管理
Activiti bpmn图
代码展示
- 投诉信息审批阶段的判断
@PostMapping("/judge")
public String judge(@RequestBody Map<String, String> requestData) {
String username = requestData.get("username");
String varible = requestData.get("varible");
String taskId = requestData.get("taskId");
if (username.equals("boss")) {
System.out.println("———————————————————————————————————————阿斯顿发射点———————ASDFASDF");
ProcessEngine processEngine = ProcessEngines.getDefaultProcessEngine();
RuntimeService runtimeService = processEngine.getRuntimeService();
TaskService taskService = processEngine.getTaskService();
Task task = taskService.createTaskQuery().taskId(taskId).singleResult();
Object variable = runtimeService.getVariable(task.getProcessInstanceId(), "complainRequest");
if (varible.equals("0")) {
if (variable != null) {
try {
// 将 JSON 字符串转换回 ComplainRequest 对象
ObjectMapper objectMapper = new ObjectMapper();
Complain complain = objectMapper.readValue(variable.toString(), Complain.class);
jdbcTemplate.update(UPDATE_SQL2, complain.getId());
process(complain);
} catch (Exception e) {
System.out.println("Error deserializing complainRequest: " + e.getMessage());
e.printStackTrace();
}
} else {
System.out.println("complainRequest is null or not of type ComplainRequest");
}
taskService.complete(task.getId());
return "succuess";
}else {
if (variable != null) {
try {
// 将 JSON 字符串转换回 ComplainRequest 对象
ObjectMapper objectMapper = new ObjectMapper();
Complain complain = objectMapper.readValue(variable.toString(), Complain.class);
jdbcTemplate.update(UPDATE_SQL3, complain.getId());
process(complain);
} catch (Exception e) {
System.out.println("Error deserializing complainRequest: " + e.getMessage());
e.printStackTrace();
}
} else {
System.out.println("complainRequest is null or not of type ComplainRequest");
}
taskService.complete(task.getId());
return "succuess";
}
}
else{
ProcessEngine processEngine = ProcessEngines.getDefaultProcessEngine();
TaskService taskService = processEngine.getTaskService();
Task task = taskService.createTaskQuery().taskId(taskId).singleResult();
RuntimeService runtimeService = processEngine.getRuntimeService();
Object variable = runtimeService.getVariable(task.getProcessInstanceId(), "complainRequest");
taskService.setVariable(taskId, "judge", varible);
taskService.complete(task.getId());
if (varible.equals("0")) {
if (variable != null) {
try {
// 将 JSON 字符串转换回 ComplainRequest 对象
ObjectMapper objectMapper = new ObjectMapper();
Complain complain = objectMapper.readValue(variable.toString(), Complain.class);
jdbcTemplate.update(UPDATE_SQL2, complain.getId());
process(complain);
} catch (Exception e) {
System.out.println("Error deserializing complainRequest: " + e.getMessage());
e.printStackTrace();
}
} else {
System.out.println("complainRequest is null or not of type ComplainRequest");
}
return "success"; //
}
return "success";
}
标签:vue,activiti,System,element,println,taskService,variable,complain,complainReques
From: https://blog.csdn.net/weixin_51908696/article/details/143607889