|
@@ -9,7 +9,9 @@ import io.swagger.annotations.ApiImplicitParams;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import lombok.AllArgsConstructor;
|
|
|
import org.apache.commons.lang.StringUtils;
|
|
|
+import org.springblade.business.entity.UserOpinionFile;
|
|
|
import org.springblade.business.entity.UserOpinionFlow;
|
|
|
+import org.springblade.business.service.IUserOpinionFileService;
|
|
|
import org.springblade.business.service.IUserOpinionFlowService;
|
|
|
import org.springblade.business.service.IUserOpinionService;
|
|
|
import org.springblade.business.vo.AssessmentUserVOS;
|
|
@@ -24,6 +26,7 @@ import org.springblade.core.tool.utils.DateUtil;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
import java.util.Date;
|
|
|
import java.util.List;
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
@RestController
|
|
|
@AllArgsConstructor
|
|
@@ -35,6 +38,8 @@ public class BusinessUserOpinionController {
|
|
|
|
|
|
private final IUserOpinionFlowService userOpinionFlowService;
|
|
|
|
|
|
+ private final IUserOpinionFileService userOpinionFileService;
|
|
|
+
|
|
|
/**
|
|
|
* 考核区分页
|
|
|
*/
|
|
@@ -57,6 +62,12 @@ public class BusinessUserOpinionController {
|
|
|
vo.setEndTime(endTime);
|
|
|
}
|
|
|
List<AssessmentUserVOS> result = this.userOpinionFlowService.queryUserAssessmentPage(vo);
|
|
|
+ result.forEach(vos -> {
|
|
|
+ List<UserOpinionFile> files = this.userOpinionFileService.selectUserOpinionFileByUserOpinionKey(vos.getUserOpinionId());
|
|
|
+ if(files != null && files.size() > 0){
|
|
|
+ vos.setFileUrlList(files.stream().map(UserOpinionFile::getFileUrl).distinct().collect(Collectors.toList()));
|
|
|
+ }
|
|
|
+ });
|
|
|
|
|
|
iPage.setTotal(count);
|
|
|
iPage.setRecords(result);
|
|
@@ -91,7 +102,8 @@ public class BusinessUserOpinionController {
|
|
|
@ApiImplicitParam(name = "newNumber", value = "当前流程次数", required = true),
|
|
|
@ApiImplicitParam(name = "currentLinkId", value = "当前环节ID", required = true)
|
|
|
})
|
|
|
- public R<Boolean> manageUserOperationStatus(@RequestParam String userOpinionId, @RequestParam Integer newNumber, @RequestParam String currentLinkId){
|
|
|
+ public R<Boolean> manageUserOperationStatus(@RequestParam String userOpinionId, @RequestParam Integer currentLink, @RequestParam Integer newNumber, @RequestParam String currentLinkId){
|
|
|
+
|
|
|
if(StringUtils.isEmpty(currentLinkId)){
|
|
|
return R.data(-1, false, "缺少currentLinkId参数");
|
|
|
}
|
|
@@ -99,36 +111,44 @@ public class BusinessUserOpinionController {
|
|
|
BladeUser user = AuthUtil.getUser();
|
|
|
//获取当前最新流程
|
|
|
List<UserOpinionFlowVO> flowVOS = this.userOpinionFlowService.queryCurrentUserOpinionFlowByUserOpinionId(userOpinionId, newNumber);
|
|
|
+
|
|
|
//找到当前环节的下一环节
|
|
|
Long nextLink = null, nextLinkEnd = null;
|
|
|
- for(int i = 0, l = flowVOS.size(); i < l; i ++){
|
|
|
- if(new Long(currentLinkId).equals(flowVOS.get(i).getId())){
|
|
|
- //找到下一个环节ID
|
|
|
- switch (i){
|
|
|
- case 1:
|
|
|
- //说明当前环节是提交"进入人工处理环节"操作
|
|
|
- nextLink = flowVOS.get(i + 1).getId();
|
|
|
- break;
|
|
|
- case 2:
|
|
|
- //说明当前环节是提交"已解决"操作
|
|
|
- nextLinkEnd = flowVOS.get(i + 1).getId();
|
|
|
- break;
|
|
|
- default:
|
|
|
- break;
|
|
|
+ if(new Integer("3").equals(currentLink)){
|
|
|
+ //直接提交完结
|
|
|
+ nextLink = flowVOS.get(2).getId();
|
|
|
+ nextLinkEnd = flowVOS.get(3).getId();
|
|
|
+ } else {
|
|
|
+ for(int i = 0, l = flowVOS.size(); i < l; i ++){
|
|
|
+ if(new Long(currentLinkId).equals(flowVOS.get(i).getId())){
|
|
|
+ //找到下一个环节ID
|
|
|
+ switch (i){
|
|
|
+ case 1:
|
|
|
+ //说明当前环节是提交"进入人工处理环节"操作
|
|
|
+ nextLink = flowVOS.get(i + 1).getId();
|
|
|
+ break;
|
|
|
+ case 2:
|
|
|
+ //说明当前环节是提交"已解决"操作
|
|
|
+ nextLinkEnd = flowVOS.get(i + 1).getId();
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ break;
|
|
|
}
|
|
|
- break;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
//将当前环节更改为已完成
|
|
|
boolean result = this.userOpinionFlowService.update(Wrappers.<UserOpinionFlow>lambdaUpdate().set(UserOpinionFlow::getIsCurrent, 2).set(UserOpinionFlow::getUpdateUser, user.getUserId()).set(UserOpinionFlow::getUpdateTime, new Date()).eq(UserOpinionFlow::getId, currentLinkId));
|
|
|
if(result){
|
|
|
if(nextLink != null && StringUtils.isNotEmpty(String.valueOf(nextLink))){
|
|
|
//提交"进入人工处理环节"操作
|
|
|
- result = this.userOpinionFlowService.update(Wrappers.<UserOpinionFlow>lambdaUpdate().set(UserOpinionFlow::getIsCurrent, 1).eq(UserOpinionFlow::getId, nextLink));
|
|
|
+ result = this.userOpinionFlowService.update(Wrappers.<UserOpinionFlow>lambdaUpdate().set(UserOpinionFlow::getUpdateTime, new Date()).set(UserOpinionFlow::getIsCurrent, new Integer("3").equals(currentLink) ? 2 : 1).eq(UserOpinionFlow::getId, nextLink));
|
|
|
}
|
|
|
if(nextLinkEnd != null && StringUtils.isNotEmpty(String.valueOf(nextLinkEnd))){
|
|
|
//提交"已解决"操作
|
|
|
- result = this.userOpinionFlowService.update(Wrappers.<UserOpinionFlow>lambdaUpdate().set(UserOpinionFlow::getIsCurrent, 2).eq(UserOpinionFlow::getId, nextLinkEnd));
|
|
|
+ result = this.userOpinionFlowService.update(Wrappers.<UserOpinionFlow>lambdaUpdate().set(UserOpinionFlow::getUpdateTime, new Date()).set(UserOpinionFlow::getIsCurrent, 2).eq(UserOpinionFlow::getId, nextLinkEnd));
|
|
|
}
|
|
|
return R.data(result);
|
|
|
}
|