单位类型
This commit is contained in:
parent
0b32de19b3
commit
70640139b2
|
|
@ -46,7 +46,7 @@ public class BmProjectController extends BaseController
|
|||
* 查询标段工程管理列表
|
||||
*/
|
||||
@ApiOperation(value = "查询标段工程管理列表")
|
||||
//@RequiresPermissions("basic:project:list")
|
||||
@RequiresPermissions("basic:project:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(BmProject bmProject)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -60,8 +60,8 @@ public class BmProject extends BaseEntity
|
|||
@NotBlank(message = "工程类型不能为空")
|
||||
private String proType;
|
||||
|
||||
@ApiModelProperty(value = "工程编码")
|
||||
@Excel(name = "i8工程编码")
|
||||
@ApiModelProperty(value = "工程编号")
|
||||
@Excel(name = "工程编号")
|
||||
@Size(max=60, message = "工程编号长度不能超过60")
|
||||
private String proCode;
|
||||
|
||||
|
|
|
|||
|
|
@ -15,7 +15,6 @@ import com.bonus.common.core.web.domain.AjaxResult;
|
|||
import com.bonus.common.security.utils.SecurityUtils;
|
||||
import com.bonus.material.purchase.config.RemoteConfig;
|
||||
import com.bonus.system.api.RemoteDeptService;
|
||||
import com.bonus.system.api.RemoteDictDataService;
|
||||
import com.bonus.system.api.domain.SysDept;
|
||||
import com.fasterxml.jackson.databind.DeserializationFeature;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
|
|
@ -72,8 +71,32 @@ public class BmUnitServiceImpl implements IBmUnitService
|
|||
public List<BmUnit> selectBmUnitList(BmUnit bmUnit)
|
||||
{
|
||||
List<BmUnit> bmUnitList = bmUnitMapper.selectBmUnitList(bmUnit);
|
||||
Long[] array = bmUnitList.stream()
|
||||
// 提取 createBy 字段
|
||||
.map(BmUnit::getCreateBy)
|
||||
.map(createBy -> {
|
||||
try {
|
||||
// 转换为 Long
|
||||
return Long.parseLong(createBy);
|
||||
} catch (NumberFormatException e) {
|
||||
// 处理转换失败的情况,可以返回 null
|
||||
return null;
|
||||
}
|
||||
})
|
||||
// 过滤掉 null 值
|
||||
.filter(value -> value != null)
|
||||
// 转换为 Long[] 数组
|
||||
.toArray(Long[]::new);
|
||||
Map<Long, String> nickNameMap = remoteConfig.getUserName(array);
|
||||
if (CollectionUtils.isNotEmpty(bmUnitList)) {
|
||||
bmUnitList.forEach(item -> {
|
||||
// 更新 createBy 为 nickName
|
||||
String createBy = item.getCreateBy();
|
||||
if (StringUtils.isNotBlank(createBy)) {
|
||||
Long createById = Long.parseLong(createBy);
|
||||
String nickName = nickNameMap.get(createById);
|
||||
item.setCreateBy(nickName != null ? nickName : createBy);
|
||||
}
|
||||
extracted(item);
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -98,7 +98,8 @@ public class PurchaseBindServiceImpl implements IPurchaseBindService {
|
|||
})
|
||||
// 过滤掉 null 值
|
||||
.filter(value -> value != null)
|
||||
.toArray(Long[]::new);// 转换为 Long[] 数组
|
||||
// 转换为 Long[] 数组
|
||||
.toArray(Long[]::new);
|
||||
Map<Long, String> nickNameMap = remoteConfig.getUserName(array);
|
||||
Map<String, String> labelMap = remoteConfig.getDictValue("purchase_task_status");
|
||||
// 更新 list 中每个 PurchaseVo 对象的 name 字段
|
||||
|
|
@ -108,7 +109,7 @@ public class PurchaseBindServiceImpl implements IPurchaseBindService {
|
|||
if (StringUtils.isNotBlank(createBy)) {
|
||||
Long createById = Long.parseLong(createBy);
|
||||
String nickName = nickNameMap.get(createById);
|
||||
purchaseVo.setCreateBy(nickName != null ? nickName : createBy); // 设置为 nickName 或原值
|
||||
purchaseVo.setCreateBy(nickName != null ? nickName : createBy);
|
||||
}
|
||||
// 更新状态名称
|
||||
Integer status = purchaseVo.getStatus();
|
||||
|
|
|
|||
Loading…
Reference in New Issue