Commit 5fb95108 authored by 刘林's avatar 刘林

fix(jg):设备履历字段添加

parent 96b228a1
......@@ -43,9 +43,14 @@ public class BizRelationDataDto {
private Set<String> projectContraptionIds;
/**
* 创建人名称
* 更新人名称
*/
private String createUserName;
private String recUserName;
/**
* 更新人id
*/
private String recUserId;
/**
* 单位名称
......
......@@ -58,12 +58,6 @@ public class JgBizChangeLog extends BaseEntity {
private String oId;
/**
* 创建人名称
*/
@TableField("create_user_name")
private String createUserName;
/**
* 单位名称
*/
@TableField("unit_name")
......
......@@ -21,16 +21,14 @@ import org.springframework.transaction.event.TransactionalEventListener;
import org.typroject.tyboot.core.foundation.context.RequestContextModel;
import javax.annotation.PostConstruct;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.ExecutorService;
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
......@@ -124,20 +122,27 @@ public class ChangeLogInsertListener {
changeLog.setBizTable(bizTypeTableMap.get(changeLog.getBizType()));
changeLog.setRecDate(new Date());
changeLog.setRecUserId(event.getRequestContext().getExcutedUserId());
// todo 使用上下文这个作为id 便于其他业务和其进行关联
changeLog.setSequenceNbr(Long.parseLong(event.getRequestContext().getTraceId()));
bizChangeLogService.getBaseMapper().insert(changeLog);
String equId = event.getBizRelationData().getRecords().stream().findFirst().orElse(null);
String equId = Stream.concat(
Optional.ofNullable(event.getBizRelationData().getProjectContraptionIds()).orElse(Collections.emptySet()).stream(),
Optional.ofNullable(event.getBizRelationData().getRecords()).orElse(Collections.emptySet()).stream()
).findFirst().orElse(null);
String businessTypeName = BusinessTypeEnum
.findNameByEnumName(changeLog.getBizType())
.map(name -> "设备编辑_" + name)
.orElse("设备编辑");
jgResumeInfoService.createWithModel(JgResumeInfoDto.builder()
.applyNo(event.getBizRelationData().getBizId())
.businessType(BusinessTypeEnum.findNameByEnumName(bizTypeTableMap.get(changeLog.getBizType())).orElse("未知类型"))
.businessType(businessTypeName)
.businessId(event.getBizRelationData().getBizId())
.equId(equId)
.resumeType("1")
.changeLogId(String.valueOf(changeLog.getSequenceNbr()))
.approvalUnit(event.getBizRelationData().getUnitName())
.approvalUnitCode(event.getBizRelationData().getUnitCode())
.createUserName(event.getBizRelationData().getCreateUserName())
.createUserName(event.getBizRelationData().getRecUserName())
.createUserId(event.getBizRelationData().getRecUserId())
.status("正常")
.build());
return changeLog;
......
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