This commit is contained in:
lijiaqi 2023-08-09 16:19:37 +08:00
parent 638087080e
commit 5777bf84ba
12 changed files with 64 additions and 19 deletions

View File

@ -1,4 +1,3 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ExternalStorageConfigurationManager" enabled="true" />
<component name="MavenProjectsManager">

View File

@ -119,6 +119,7 @@ public class NoticeController extends BaseController {
@ApiImplicitParam(name = "column", value = "排序字段 字段名"),
@ApiImplicitParam(name = "orderBy", value = "排序顺序 降序desc升序asc"),
@ApiImplicitParam(name = "type", value = "user:通知公告dept:通知管理"),
@ApiImplicitParam(name = "isUrgent", value = "是否紧急")
})
@ApiOperationSupport(
responses = @DynamicResponseParameters(properties = {
@ -126,7 +127,7 @@ public class NoticeController extends BaseController {
}),
order = 6
)
public AjaxResult noticePages(String value, String column, String orderBy, String type) {
return noticeService.noticePages(getPage(), value, column, orderBy,type);
public AjaxResult noticePages(String value, String column, String orderBy, String type,Boolean isUrgent) {
return noticeService.noticePages(getPage(), value, column, orderBy,type,isUrgent);
}
}

View File

@ -38,4 +38,7 @@ public class Notice extends BaseEntity{
@ApiModelProperty(value = "发布部门")
private String deptId;
@ApiModelProperty(value = "是否紧急")
private Boolean isUrgent;
}

View File

@ -3,6 +3,7 @@ package com.ydool.integrated.service;
import cn.dev33.satoken.stp.StpUtil;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.ObjUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@ -134,14 +135,14 @@ public class NoticeService extends BaseService<NoticeMapper, Notice> {
* @param orderBy
* @return
*/
public AjaxResult noticePages(Page page, String value, String column, String orderBy, String type) {
public AjaxResult noticePages(Page page, String value, String column, String orderBy, String type, Boolean isUrgent) {
QueryWrapper<Notice> qw = new QueryWrapper<Notice>();
qw.lambda().and(
StrUtil.isNotBlank(value), query -> {
query.like(Notice::getTitle, value)
.or().like(Notice::getContent, value);
}
);
).eq(ObjUtil.isNotNull(isUrgent), Notice::getIsUrgent, isUrgent);
String loginId = StpUtil.getLoginIdAsString();
//通知管理 只能看到本部门的

View File

@ -4,6 +4,7 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
@Data
public class NoticeVo {
@ -25,4 +26,8 @@ public class NoticeVo {
@ApiModelProperty(value = "接收人 为空请传[]", required = true)
@NotBlank(message = "接收人 为空请传[]")
private String userIds;
@ApiModelProperty(value = "是否紧急", required = true)
@NotNull(message = "是否紧急不能为空")
private Boolean isUrgent;
}

View File

@ -55,13 +55,13 @@ public class WorkFlowController extends BaseController {
/**
* 删除流程
* 撤销流程
*
* @param id
* @return
*/
@DeleteMapping(value = "remove")
@ApiOperation(value = "删除流程")
@ApiOperation(value = "撤销流程")
@ApiImplicitParam(name = "id", value = "Id")
@ApiOperationSupport(order = 2)
public AjaxResult removeWorkFlow(String id) {

View File

@ -39,7 +39,7 @@ public class WorkFlowDto extends WorkFlow {
@ApiModelProperty(value = "是否审批人")
private Boolean isApprove;
@ApiModelProperty(value = "是否填写人")
@ApiModelProperty(value = "是否填写人")
private Boolean isWrite;
@ApiModelProperty(value = "是否能重新发起")

View File

@ -2,6 +2,8 @@ package com.ydool.oa.workFlow.data.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.ydool.common.base.BaseEntity;
import com.ydool.oa.workFlow.enums.WorkFlowStepStatusEnum;
import com.ydool.oa.workFlow.enums.WorkFlowStepTypeEnum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@ -59,4 +61,14 @@ public class WorkFlowStepLog extends BaseEntity {
this.status = workFlowStep.getStatus();
this.remarks = workFlowStep.getRemarks();
}
public WorkFlowStepLog(WorkFlow workFlow) {
this.flowId = workFlow.getId();
this.data = workFlow.getData();
this.step = 2;
this.stepType = WorkFlowStepTypeEnum.END.getType();
this.userId = workFlow.getUserId();
this.status = WorkFlowStepStatusEnum.DONE.getStatus();
this.remarks = "撤回流程";
}
}

View File

@ -72,7 +72,7 @@ public interface WorkFlowWrapper extends BaseWrapper<WorkFlow, WorkFlowDto> {
List<WorkFlowStepLogDto> workFlowStepLogDtoList = WorkFlowStepLogWrapper.INSTANCE.toDto(workFlowStepLogList);
dto.setWorkFlowStepLogs(workFlowStepLogDtoList);
if (WorkFlowStepTypeEnum.END.getType().equals(obj.getStepType()) && WorkFlowStatusEnum.REFUSE.getStatus().equals(obj.getStatus())) {
if (WorkFlowStepTypeEnum.END.getType().equals(obj.getStepType()) && (WorkFlowStatusEnum.REFUSE.getStatus().equals(obj.getStatus()) || WorkFlowStatusEnum.WITHDRAW.getStatus().equals(obj.getStatus()))) {
dto.setIsReStart(true);
} else {
dto.setIsReStart(false);
@ -89,7 +89,7 @@ public interface WorkFlowWrapper extends BaseWrapper<WorkFlow, WorkFlowDto> {
dto.setIsApprove(false);
dto.setIsWrite(false);
dto.setIsRepair(false);
if (!WorkFlowStepTypeEnum.END.getType().equals(obj.getStepType())) {
if (count > 0 && WorkFlowStepTypeEnum.APPROVAL.getType().equals(obj.getStepType())) {
dto.setIsApprove(true);
}
@ -97,6 +97,7 @@ public interface WorkFlowWrapper extends BaseWrapper<WorkFlow, WorkFlowDto> {
if (count > 0 && WorkFlowStepTypeEnum.WRITE.getType().equals(obj.getStepType())) {
dto.setIsWrite(true);
}
}
if (obj.getType().equals(WorkFlowTypeEnum.BUDGET.getType()) && obj.getStatus().equals(WorkFlowStatusEnum.PASS.getStatus()) && StrUtil.isBlank(obj.getWorkFlowId())) {
dto.setIsRepair(true);

View File

@ -12,7 +12,13 @@ public enum WorkFlowStatusEnum {
/**
* 通过
*/
PASS("PASS", "通过");
PASS("PASS", "通过"),
/**
* 撤回
*/
WITHDRAW("WITHDRAW", "撤回"),
;
/**
* 流程状态

View File

@ -20,7 +20,9 @@ public enum WorkFlowStepStatusEnum {
/**
* 结束
*/
DONE("DONE", "结束");
DONE("DONE", "结束"),
;
/**
* 流程状态

View File

@ -203,16 +203,31 @@ public class WorkFlowService extends BaseService<WorkFlowMapper, WorkFlow> {
/**
* 删除流程
* 撤销流程
*
* @param id
* @return
*/
@Transactional(rollbackFor = Exception.class)
public AjaxResult removeWorkFlow(String id) {
if (StrUtil.isBlank(id)) return AjaxResult.fail("id不能为空");
WorkFlow workFlow = getById(id);
if (ObjectUtil.isNull(workFlow)) return AjaxResult.fail("该流程不存在");
return removeById(id) ? AjaxResult.ok().msg("删除成功") : AjaxResult.fail("删除失败");
if (workFlow.getStep() > 2) {
return AjaxResult.fail("该流程已进入审批流程,无法撤回");
}
if (!workFlow.getUserId().equals(StpUtil.getLoginIdAsString())) {
return AjaxResult.fail("您不是该流程的发起人,无法撤回");
}
workFlow.setStatus(WorkFlowStatusEnum.WITHDRAW.getStatus());
workFlow.setStepType(WorkFlowStepTypeEnum.END.getType());
boolean flag = updateById(workFlow);
WorkFlowStepLog workFlowStepLog = new WorkFlowStepLog(workFlow);
flag = workFlowStepLogService.save(workFlowStepLog);
return flag ? AjaxResult.ok().msg("撤回成功") : AjaxResult.fail("撤回失败");
}