feat(techproc): 添加工艺流程创建人显示功能
This commit is contained in:
parent
7459f3766c
commit
114f79f3ad
@ -8,6 +8,8 @@ import jnpf.base.vo.PaginationVO;
|
||||
import jnpf.model.techproc.TechProcEntity;
|
||||
import jnpf.model.techproc.TechProcForm;
|
||||
import jnpf.model.techproc.TechProcPagination;
|
||||
import jnpf.permission.entity.UserEntity;
|
||||
import jnpf.permission.service.UserService;
|
||||
import jnpf.service.TechProcService;
|
||||
import jnpf.util.JsonUtil;
|
||||
import jnpf.util.StringUtil;
|
||||
@ -30,6 +32,9 @@ public class TechProcController {
|
||||
@Autowired
|
||||
private TechProcService techProcService;
|
||||
|
||||
@Autowired
|
||||
private UserService userService;
|
||||
|
||||
/**
|
||||
* 列表
|
||||
* @param techProcPagination 分页查询对象
|
||||
@ -39,6 +44,13 @@ public class TechProcController {
|
||||
@PostMapping("/getList")
|
||||
public ActionResult getList(@RequestBody TechProcPagination techProcPagination) {
|
||||
List<TechProcEntity> list = techProcService.getList(techProcPagination);
|
||||
// 查询创建人
|
||||
list.forEach(item -> {
|
||||
UserEntity userEntity = userService.getById(item.getCreatorUserId());
|
||||
if (userEntity != null) {
|
||||
item.setCreateUserName(userEntity.getRealName());
|
||||
}
|
||||
});
|
||||
List<Map<String, Object>> realList = list.stream()
|
||||
.map(JsonUtil::entityToMap)
|
||||
.collect(Collectors.toList());
|
||||
|
||||
@ -54,4 +54,7 @@ public class TechProcEntity {
|
||||
|
||||
@TableField(value = "remark", updateStrategy = FieldStrategy.IGNORED)
|
||||
private String remark;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String createUserName;
|
||||
}
|
||||
|
||||
@ -44,6 +44,7 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="remark" label="备注" align="center"/>
|
||||
<el-table-column prop="createUserName" label="创建人" align="center"/>
|
||||
<el-table-column prop="creatorTime" label="创建时间" align="center" :formatter="jnpf.tableDateFormat1"/>
|
||||
<el-table-column label="操作" fixed="right" align="center" width="100">
|
||||
<template slot-scope="scope">
|
||||
@ -182,4 +183,4 @@ export default {
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
</script>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user