Przeglądaj źródła

导购用户更新信息只有导购一个身份才可以更新

njs 1 miesiąc temu
rodzic
commit
c0cd189214

+ 15 - 5
suishenbang-sync/suishenbang-sync-common/src/main/java/com/dgtly/sync/service/AnalysisDiyCustomerComponent.java

@@ -878,11 +878,21 @@ public class AnalysisDiyCustomerComponent {
                             sysUserExtMapper.updateSysUserExt(user.getSysUserExt());
                             }
                         }
-                        if(("019").equals(user.getSysUserExt().getCustomerCode().substring(0, 3)) && user.getSysUserExt().getIsCustomerManager() == "0"){
-                            user.getSysUserExt().setCustomerCode(customerCode);
-                            user.getSysUserExt().setOrgCode(customerCode);
-                            user.getSysUserExt().setOrgName(customerName);
-                            sysUserExtMapper.updateSysUserExt(user.getSysUserExt());
+                        if(("019").equals(user.getSysUserExt().getCustomerCode().substring(0, 3)) && ("0").equals(user.getSysUserExt().getIsCustomerManager())){
+                            String isCustomerManager = user.getSysUserExt().getIsCustomerManager();
+                            List<String> listManager = new ArrayList<>();
+                            String[] split = isCustomerManager.split(",");
+                            for (String s : split) {
+                                if(s !=null && !("").equals(s)){
+                                    listManager.add(s);
+                                }
+                            }
+                            if(listManager.size() == 1 ){
+                                user.getSysUserExt().setCustomerCode(customerCode);
+                                user.getSysUserExt().setOrgCode(customerCode);
+                                user.getSysUserExt().setOrgName(customerName);
+                                sysUserExtMapper.updateSysUserExt(user.getSysUserExt());
+                            }
                         }
                        /* if(user.getSysUserExt().getIsCustomerManager() !=null){
                             if(user.getSysUserExt().getIsCustomerManager().contains("0")){