Browse Source

我的产品库关联企业产品新增时处理角色关系绑定错误的bug

hejq 8 years ago
parent
commit
e2fe6b7ef5

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

@@ -112,7 +112,7 @@ public class ProductUsersServiceImpl implements ProductUsersService {
                     for(Role role : roles) {
                         if(role.getDesc().equals("业务员") || role.getDesc().equals("销售经理")) {
                             prodInfo.setIsSale(Constant.YES);
-                        } else  if(role.getName().equals("采购员")) {
+                        } else  if(role.getDesc().equals("采购员")) {
                             prodInfo.setIsPurchase(Constant.YES);
                         }
                     }
@@ -264,7 +264,7 @@ public class ProductUsersServiceImpl implements ProductUsersService {
                                 for(Role role : roles) {
                                     if(role.getDesc().equals("业务员") || role.getDesc().equals("销售经理")) {
                                         product.setIsSale(Constant.YES);
-                                    } else if(role.getName().equals("采购员")) {
+                                    } else if(role.getDesc().equals("采购员")) {
                                         product.setIsPurchase(Constant.YES);
                                     }
                                 }
@@ -331,7 +331,7 @@ public class ProductUsersServiceImpl implements ProductUsersService {
 					        product.setIsSale(Constant.YES);
 					        productDao.save(product);
 				        }
-			        } else if(role.getName().equals("采购员")) {
+			        } else if(role.getDesc().equals("采购员")) {
 				        if(product.getIsPurchase() == null || product.getIsPurchase().equals(Constant.NO)) {
 					        product.setIsPurchase(Constant.YES);
 					        productDao.save(product);