Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
commit
c2e8bce942
@ -69,7 +69,7 @@ public class LogFormController {
|
||||
if (form != null) {
|
||||
|
||||
//获取规则信息
|
||||
LogRuleDO logRuleDO = logRuleService.getLogRule(form.getRuleId());
|
||||
LogRuleDO logRuleDO = logRuleService.getLogRule(form.getId());
|
||||
|
||||
//设置日志类型
|
||||
logFormRespVO.setType(logRuleDO.getType());
|
||||
|
@ -72,11 +72,11 @@ public class LogRuleController {
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得日志规则")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@Parameter(name = "formId", description = "日志模板编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('system:log-rule:query')")
|
||||
public CommonResult<LogRuleRespVO> getLogRule(@RequestParam("id") Long id) {
|
||||
public CommonResult<LogRuleRespVO> getLogRule(@RequestParam("formId") Long formId) {
|
||||
|
||||
LogRuleDO logRule = logRuleService.getLogRule(id);
|
||||
LogRuleDO logRule = logRuleService.getLogRule(formId);
|
||||
|
||||
return success(BeanUtils.toBean(logRule, LogRuleRespVO.class));
|
||||
}
|
||||
|
@ -6,13 +6,16 @@ import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
|
||||
@Schema(description = "管理后台 - 动态表单分页 Request VO")
|
||||
@Schema(description = "管理后台 - 动态模板分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class LogFormPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "表单名称", example = "芋道")
|
||||
@Schema(description = "模板名称", example = "芋道")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "模板状态", example = "0")
|
||||
private Integer status;
|
||||
|
||||
}
|
||||
|
@ -3,7 +3,6 @@ package cn.iocoder.yudao.module.system.dal.mysql.worklog;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.QueryWrapperX;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.worklog.vo.form.LogFormPageReqVO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.worklog.LogFormDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
@ -14,9 +13,10 @@ import java.util.List;
|
||||
public interface LogFormMapper extends BaseMapperX<LogFormDO> {
|
||||
|
||||
default PageResult<LogFormDO> selectPage(LogFormPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new QueryWrapperX<LogFormDO>()
|
||||
.likeIfPresent("name", reqVO.getName())
|
||||
.orderByDesc("id"));
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<LogFormDO>()
|
||||
.likeIfPresent(LogFormDO::getName, reqVO.getName())
|
||||
.eqIfPresent(LogFormDO::getStatus, reqVO.getStatus())
|
||||
.orderByDesc(LogFormDO::getId));
|
||||
}
|
||||
|
||||
default PageResult<LogFormDO> selectPageByRule(LogFormPageReqVO reqVO, List<Long> formIds) {
|
||||
|
@ -93,7 +93,7 @@ public class LogInstanceServiceImpl implements LogInstanceService {
|
||||
//获取部门信息
|
||||
AdminUserDO adminUserDO = adminUserService.getUser(userId);
|
||||
//获取规则信息
|
||||
LogRuleDO logRuleDO = logRuleService.getLogRule(logFormDo.getRuleId());
|
||||
LogRuleDO logRuleDO = logRuleService.getLogRule(logFormDo.getId());
|
||||
|
||||
//设置发起人用户编号
|
||||
logInstance.setStartUserId(userId);
|
||||
@ -184,7 +184,7 @@ public class LogInstanceServiceImpl implements LogInstanceService {
|
||||
endTime = endTime.split(",")[1];
|
||||
}
|
||||
|
||||
if (LocalTime.now().isBefore(LocalTime.parse(endTime))) {
|
||||
if (LocalTime.now().isAfter(LocalTime.parse(endTime))) {
|
||||
throw exception(LOG_NOT_UPDATE);
|
||||
}
|
||||
|
||||
|
@ -40,10 +40,10 @@ public interface LogRuleService {
|
||||
/**
|
||||
* 获得日志规则
|
||||
*
|
||||
* @param id 编号
|
||||
* @param formId 模板编号
|
||||
* @return 日志规则
|
||||
*/
|
||||
LogRuleDO getLogRule(Long id);
|
||||
LogRuleDO getLogRule(Long formId);
|
||||
|
||||
/**
|
||||
* 获得日志规则分页
|
||||
@ -56,16 +56,16 @@ public interface LogRuleService {
|
||||
/**
|
||||
* 通过规则ids获取规则
|
||||
*
|
||||
* @param ruleIds
|
||||
* @return
|
||||
* @param ruleIds 规则编号组
|
||||
* @return 规则列表
|
||||
*/
|
||||
List<LogRuleDO> getLogRuleByIds(List<Long> ruleIds);
|
||||
|
||||
/**
|
||||
* 通过模版id获取规则
|
||||
*
|
||||
* @param formId
|
||||
* @return
|
||||
* @param formId 日志模板编号
|
||||
* @return 日志规则
|
||||
*/
|
||||
LogRuleDO getLogRuleByFormId(Long formId);
|
||||
}
|
@ -103,8 +103,8 @@ public class LogRuleServiceImpl implements LogRuleService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public LogRuleDO getLogRule(Long id) {
|
||||
return logRuleMapper.selectById(id);
|
||||
public LogRuleDO getLogRule(Long formId) {
|
||||
return logRuleMapper.selectOne(LogRuleDO:: getFormId, formId);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -116,8 +116,7 @@
|
||||
LEFT JOIN work_log_read as e ON a.id = e.log_instance_id and e.read_user_id = #{userId}
|
||||
LEFT JOIN work_log_read as c ON a.id = c.log_instance_id and c.read_status = 1
|
||||
LEFT JOIN work_log_read as d ON a.id = d.log_instance_id and d.read_status = 0
|
||||
where
|
||||
1=1
|
||||
<where>
|
||||
<if test="logId != null">
|
||||
and a.id = #{logId}
|
||||
</if>
|
||||
@ -127,11 +126,8 @@
|
||||
<if test="reqVO.deptId != null">
|
||||
and a.dept_id = #{reqVO.deptId}
|
||||
</if>
|
||||
<if test="reqVO.startUserName != null">
|
||||
and a.start_user_name = #{reqVO.startUserName}
|
||||
</if>
|
||||
<if test="reqVO.startUserName != null">
|
||||
and a.start_user_name = #{reqVO.startUserName}
|
||||
<if test="reqVO.startUserId != null">
|
||||
and a.start_user_id = #{reqVO.startUserId}
|
||||
</if>
|
||||
<if test="reqVO.createTime != null">
|
||||
and a.create_time BETWEEN #{reqVO.createTime[0]} and #{reqVO.createTime[1]}
|
||||
@ -145,6 +141,7 @@
|
||||
<if test="pagingType == 1">
|
||||
and a.start_user_id = #{userId}
|
||||
</if>
|
||||
</where>
|
||||
GROUP BY a.id,e.read_status
|
||||
ORDER BY a.create_time DESC
|
||||
</select>
|
||||
|
Loading…
Reference in New Issue
Block a user