Commit 4bcf8308 authored by tianbo's avatar tianbo

feat(jg): 添加履历记录删除标记功能

- 在BizRelationDataDto中新增needRecord字段控制是否需要保存时设置is_delete=1 - 在ChangeLogInsertListener中根据needRecord标记决定是否将履历记录设置为删除状态 - 在DefaultBizDataChangeHandler中判断超级编辑角色,为该角色设置needRecord为false - 修改JgResumeInfoController中的分页和列表查询方法,添加isDelete参数 - 更新JgResumeInfoServiceImpl中的查询方法实现,支持根据isDelete参数过滤结果
parent a34c449b
......@@ -61,4 +61,9 @@ public class BizRelationDataDto {
* 单据是否已经完成
*/
private Boolean bizIsFinished;
/**
* 是否需要保存时is_delete=1
*/
private Boolean needRecord = true;
}
package com.yeejoin.amos.boot.module.jg.biz.controller;
import com.yeejoin.amos.boot.module.jg.api.dto.JgResumeInfoDto;
import org.springframework.web.bind.annotation.RequestMapping;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.RestController;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import java.util.List;
import com.yeejoin.amos.boot.module.jg.api.dto.JgResumeInfoDto;
import com.yeejoin.amos.boot.module.jg.biz.service.impl.JgResumeInfoServiceImpl;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import javax.servlet.http.HttpServletRequest;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import javax.servlet.http.HttpServletRequest;
import java.util.List;
/**
* 监管履历信息表
......@@ -111,7 +110,7 @@ public class JgResumeInfoController extends BaseController {
Page<JgResumeInfoDto> page = new Page<>();
page.setCurrent(current);
page.setSize(size);
return ResponseHelper.buildResponse(jgResumeInfoServiceImpl.queryForJgResumeInfoPage(page, record));
return ResponseHelper.buildResponse(jgResumeInfoServiceImpl.queryForJgResumeInfoPage(page, record, false));
}
/**
......@@ -123,7 +122,7 @@ public class JgResumeInfoController extends BaseController {
@ApiOperation(httpMethod = "GET",value = "列表全部数据查询", notes = "列表全部数据查询")
@GetMapping(value = "/list")
public ResponseModel<List<JgResumeInfoDto>> selectForList() {
return ResponseHelper.buildResponse(jgResumeInfoServiceImpl.queryForJgResumeInfoList());
return ResponseHelper.buildResponse(jgResumeInfoServiceImpl.queryForJgResumeInfoList(false));
}
}
......@@ -29,7 +29,6 @@ import java.util.concurrent.Executors;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.stream.Collectors;
import java.util.stream.IntStream;
import java.util.stream.Stream;
/**
* @author Administrator
......@@ -133,6 +132,9 @@ public class ChangeLogInsertListener {
dto.setRecUserId(recUserId);
dto.setStatus("正常");
dto.setRoutePath(routePath);
if (!event.getBizRelationData().getNeedRecord()) {
dto.setIsDelete(true);
}
jgResumeInfoService.createWithModel(dto);
} catch (Exception e) {
log.error("插入设备履历日志异常,bizType: {}, 错误: {}", changeLog.getBizType(), e.getMessage(), e);
......
......@@ -18,8 +18,8 @@ import com.yeejoin.amos.boot.module.jg.biz.edit.process.equip.strategy.HandleRes
import com.yeejoin.amos.boot.module.jg.biz.edit.process.equip.strategy.IEquipChangeDataProcessStrategy;
import com.yeejoin.amos.boot.module.jg.biz.service.impl.JgBizChangeLogServiceImpl;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationEvent;
import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
......@@ -29,6 +29,9 @@ import java.util.stream.Collectors;
@Slf4j
public abstract class DefaultBizDataChangeHandler<U extends BaseBizDataChangeEvent> implements IBizDataChangeHandleStrategy {
@Value("${save.sa.id:2008843301616119809}")
public Long saRoleId;
public static String IS_REQUIRES_TEMPORARY_SAVE = "isRequiresTemporarySave";
public static String TEMPORARY_PIPELINES_DATA = "temporaryPipelinesData";
......@@ -100,6 +103,12 @@ public abstract class DefaultBizDataChangeHandler<U extends BaseBizDataChangeEve
bizRelationDataDto.setUnitCode(selectedOrgInfo.getCompany().getCompanyCode());
bizRelationDataDto.setUnitName(selectedOrgInfo.getCompany().getCompanyName());
bizRelationDataDto.setBizIsFinished(bizIsFinished(applyNo));
Map<Long, List<Long>> roles = selectedOrgInfo.getUserModel().getOrgRoleSeqs();
// 判断登录用户是否拥有超级编辑角色
List<Long> roleIds = roles.get(selectedOrgInfo.getCompany().getSequenceNbr());
if (roleIds.contains(saRoleId)) {
bizRelationDataDto.setNeedRecord(false);
}
if (!noPeatChangeFields.isEmpty()) {
eventPublisher.publish(new BaseBizDataChangeEvent(this, bizRelationDataDto, noPeatChangeFields, RequestContext.cloneRequestContext()));
} else {
......
......@@ -9,7 +9,7 @@ import com.yeejoin.amos.boot.module.jg.api.service.IJgResumeInfoService;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import java.util.Collection;
import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;
......@@ -25,8 +25,8 @@ public class JgResumeInfoServiceImpl extends BaseService<JgResumeInfoDto, JgResu
/**
* 分页查询
*/
public Page<JgResumeInfoDto> queryForJgResumeInfoPage(Page<JgResumeInfoDto> page, String equId) {
return this.queryForPage(page, null, false, equId);
public Page<JgResumeInfoDto> queryForJgResumeInfoPage(Page<JgResumeInfoDto> page, String equId, Boolean isDelete) {
return this.queryForPage(page, null, false, equId, isDelete);
}
public Page<JgResumeInfoDto> queryPageListByChangeIds(Page<JgResumeInfoDto> page, Set<String> equIds) {
......@@ -35,8 +35,8 @@ public class JgResumeInfoServiceImpl extends BaseService<JgResumeInfoDto, JgResu
/**
* 列表查询 示例
*/
public List<JgResumeInfoDto> queryForJgResumeInfoList() {
return this.queryForList("", false);
public List<JgResumeInfoDto> queryForJgResumeInfoList(Boolean isDelete) {
return this.queryForList("", false, isDelete);
}
public void saveBatchResume(List<JgResumeInfoDto> jgResumeInfoDtoList) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment