Bladeren bron

我的产品导入新增时角色判断bug的处理

hejq 8 jaren geleden
bovenliggende
commit
c2dae52b8e

+ 2 - 2
src/main/java/com/uas/platform/b2b/service/impl/ProductUsersServiceImpl.java

@@ -107,7 +107,7 @@ public class ProductUsersServiceImpl implements ProductUsersService {
                 List<Role> roles = roleService.findByEnUUAndUserUU(enuu, useruu);
                 if(!CollectionUtils.isEmpty(roles)) {
                     for(Role role : roles) {
-                        if(role.getName().equals("业务员") || role.getName().equals("销售经理")) {
+                        if(role.getDesc().equals("业务员") || role.getDesc().equals("销售经理")) {
                             prodInfo.setIsSale(Constant.YES);
                         } else  if(role.getName().equals("采购员")) {
                             prodInfo.setIsPurchase(Constant.YES);
@@ -255,7 +255,7 @@ public class ProductUsersServiceImpl implements ProductUsersService {
                             List<Role> roles = roleService.findByEnUUAndUserUU(enuu, useruu);
                             if(!CollectionUtils.isEmpty(roles)) {
                                 for(Role role : roles) {
-                                    if(role.getName().equals("业务员") || role.getName().equals("销售经理")) {
+                                    if(role.getDesc().equals("业务员") || role.getDesc().equals("销售经理")) {
                                         product.setIsSale(Constant.YES);
                                     } else if(role.getName().equals("采购员")) {
                                         product.setIsPurchase(Constant.YES);

+ 1 - 1
src/main/java/com/uas/platform/b2b/service/impl/RoleServiceImpl.java

@@ -136,7 +136,7 @@ public class RoleServiceImpl implements RoleService {
 
     @Override
     public List<Role> findByEnUUAndUserUU(Long enUU, Long userUU) {
-	    String sql = "select s.role_enuu enUU,s.role_name name,s.role_id id from sec$roles s left join sec$userrole r " +
+	    String sql = "select s.role_enuu enUU,s.role_desc as \"desc\",s.role_name name,s.role_id id from sec$roles s left join sec$userrole r " +
                 "on s.role_id = r.role_id where s.role_enuu = " + enUU +" and r.user_uu = " + userUU;
 	    List<Role> roles = commonDao.query(sql, Role.class);
         return roles;