change - 监控单元类型添加是编号校验问题,添加监控单元编号时不能和已有编号任意字符重复

main
wenjy 3 years ago
parent 5262d2ad6f
commit 7169f305d1

@ -3,6 +3,8 @@ package com.ruoyi.web.controller.base;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import com.ruoyi.common.constant.UserConstants;
import com.ruoyi.common.core.domain.Ztree;
@ -190,7 +192,8 @@ public class BaseMonitorunitTypeController extends BaseController {
@ResponseBody
public String checkMonitorUnitTypeIdUnique(BaseMonitorunitType baseMonitorunitType){
List<BaseMonitorunitType> baseMonitorunitTypes = baseMonitorunitTypeService.selectBaseMonitorunitTypeList(baseMonitorunitType);
if(baseMonitorunitTypes.size() > 0){
List<BaseMonitorunitType> collect = baseMonitorunitTypes.stream().filter(x -> x.getMonitorunittypeId().equals(baseMonitorunitType.getMonitorunittypeId())).collect(Collectors.toList());
if(collect.size() > 0){
return UserConstants.DEPT_NAME_NOT_UNIQUE;
}
return UserConstants.DEPT_NAME_UNIQUE;

Loading…
Cancel
Save