فهرست منبع

人员自定义字段修改

yurk 2 سال پیش
والد
کامیت
6926040a84

+ 5 - 5
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/SubUserCustomController.java

@@ -58,7 +58,6 @@ public class SubUserCustomController {
         Integer companyId = userMapper.selectById(request.getHeader("token")).getCompanyId();
         List<UserCustom> userCustomList = userCustomMapper.selectList(new QueryWrapper<UserCustom>().eq("company_id", companyId));
         Integer num=null;
-        Object result=null;
         for(int i=0;i<userCustomList.size();i++){
             if(subUserCustom.getUserCustomId().equals(userCustomList.get(i).getId())){
                 num=i;
@@ -66,6 +65,7 @@ public class SubUserCustomController {
         }
         List<User> userList = userMapper.selectList(new QueryWrapper<User>().eq("company_id", companyId));
         for(User user:userList) {
+            Object result=null;
             switch (num){
                 case 0:
                     result=user.getPlate1();
@@ -83,10 +83,10 @@ public class SubUserCustomController {
                     result=user.getPlate5();
                     break;
             }
-        }
-        if(result!=null){
-            httpRespMsg.setError("当前配置下已存在数据");
-            return httpRespMsg;
+            if(result!=null && !result.equals("") &&result.equals(subUserCustom.getName())){
+                httpRespMsg.setError("当前配置["+subUserCustom.getName()+"]已使用");
+                return httpRespMsg;
+            }
         }
         subUserCustomService.removeById(id);
         return new HttpRespMsg();

+ 2 - 2
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/UserCustomController.java

@@ -84,8 +84,8 @@ public class UserCustomController {
                     result=user.getPlate5();
                     break;
             }
-            if(result!=null){
-                httpRespMsg.setError("当前配置下已存在数据");
+            if(result!=null && !result.equals("")){
+                httpRespMsg.setError("当前配置已被使用");
                 return httpRespMsg;
             }
         }