Commit 36c3c0bbe55ae189730ea07bcbc28db73825eefe

Authored by chenhang4442024
1 parent 7803cc94

避免最初dictory中没有生产科时无法在创建生产科用户的同时创建生产科daodictory中

src/main/java/com/order/erp/service/admin/impl/AdminUserServiceImpl.java
@@ -230,15 +230,16 @@ public class AdminUserServiceImpl extends ServiceImpl<AdminUserMapper, AdminUser @@ -230,15 +230,16 @@ public class AdminUserServiceImpl extends ServiceImpl<AdminUserMapper, AdminUser
230 dictionaryVO.setSort(count+1); 230 dictionaryVO.setSort(count+1);
231 dictionaryService.add(dictionaryVO); 231 dictionaryService.add(dictionaryVO);
232 } 232 }
233 - }  
234 - DictionaryVO dictionaryVO = new DictionaryVO();  
235 - dictionaryVO.setRemark("生产科");  
236 - dictionaryVO.setDictCode("productionDepartment");  
237 - dictionaryVO.setDictName("生产科");  
238 - dictionaryVO.setDictValue(adminUserVO.getNickName());  
239 - int count = dictionaryService.count();  
240 - dictionaryVO.setSort(count+1);  
241 - dictionaryService.add(dictionaryVO); 233 + }else {
  234 + DictionaryVO dictionaryVO = new DictionaryVO();
  235 + dictionaryVO.setRemark("生产科");
  236 + dictionaryVO.setDictCode("productionDepartment");
  237 + dictionaryVO.setDictName("生产科");
  238 + dictionaryVO.setDictValue(adminUserVO.getNickName());
  239 + int count = dictionaryService.count();
  240 + dictionaryVO.setSort(count + 1);
  241 + dictionaryService.add(dictionaryVO);
  242 + }
242 } 243 }
243 return ServerResult.success(); 244 return ServerResult.success();
244 } 245 }