供应商列表
This commit is contained in:
		
							parent
							
								
									85a8e290f5
								
							
						
					
					
						commit
						a305147524
					
				| 
						 | 
					@ -5,10 +5,6 @@ package com.bonus.common.houqin.constant;
 | 
				
			||||||
 * @author bns_han
 | 
					 * @author bns_han
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
public class GlobalConstants {
 | 
					public class GlobalConstants {
 | 
				
			||||||
    /**
 | 
					 | 
				
			||||||
     * super admin role key
 | 
					 | 
				
			||||||
     */
 | 
					 | 
				
			||||||
    public static final String SUPER_ADMIN_ROLE_KEY = "admin";
 | 
					 | 
				
			||||||
    /**
 | 
					    /**
 | 
				
			||||||
     * 字符串 MSIE
 | 
					     * 字符串 MSIE
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -28,6 +28,7 @@ import com.bonus.common.houqin.constant.GlobalConstants;
 | 
				
			||||||
import com.bonus.common.houqin.constant.LeConstants;
 | 
					import com.bonus.common.houqin.constant.LeConstants;
 | 
				
			||||||
import com.bonus.common.houqin.i18n.I18n;
 | 
					import com.bonus.common.houqin.i18n.I18n;
 | 
				
			||||||
import com.bonus.common.security.utils.SecurityUtils;
 | 
					import com.bonus.common.security.utils.SecurityUtils;
 | 
				
			||||||
 | 
					import com.bonus.system.api.domain.SysUser;
 | 
				
			||||||
import com.bonus.system.api.model.LoginUser;
 | 
					import com.bonus.system.api.model.LoginUser;
 | 
				
			||||||
import org.springframework.beans.factory.annotation.Autowired;
 | 
					import org.springframework.beans.factory.annotation.Autowired;
 | 
				
			||||||
import org.springframework.context.annotation.Lazy;
 | 
					import org.springframework.context.annotation.Lazy;
 | 
				
			||||||
| 
						 | 
					@ -77,6 +78,12 @@ public class MgrAuthApi {
 | 
				
			||||||
//      return this.getTenantOrg(excludeMiddle, DelFlagEnum.DEL_FALSE.key());
 | 
					//      return this.getTenantOrg(excludeMiddle, DelFlagEnum.DEL_FALSE.key());
 | 
				
			||||||
//   }
 | 
					//   }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					   public boolean isSuperAdmin() {
 | 
				
			||||||
 | 
					      MgrUserAuthPO authPO = this.getUserAuthPO();
 | 
				
			||||||
 | 
					      String roleCode = authPO.getRoleCode();
 | 
				
			||||||
 | 
					      return SysUser.isAdmin(SecurityUtils.getUserId()); // || roleCode.startsWith(RoleCodeV2Enum.ROLE_ADMIN.key()) && roleCode.split("&&").length <= 1;
 | 
				
			||||||
 | 
					   }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
   public MgrUserAuthPO getUserAuthPO() {
 | 
					   public MgrUserAuthPO getUserAuthPO() {
 | 
				
			||||||
      MgrUserAuthPO userAuthPO = new MgrUserAuthPO();
 | 
					      MgrUserAuthPO userAuthPO = new MgrUserAuthPO();
 | 
				
			||||||
      LoginUser user = SecurityUtils.getLoginUser();
 | 
					      LoginUser user = SecurityUtils.getLoginUser();
 | 
				
			||||||
| 
						 | 
					@ -90,7 +97,7 @@ public class MgrAuthApi {
 | 
				
			||||||
      String roleCodeResult = null;
 | 
					      String roleCodeResult = null;
 | 
				
			||||||
      for (String roleCode : roleSet) {
 | 
					      for (String roleCode : roleSet) {
 | 
				
			||||||
         roleCodeResult = roleCode;
 | 
					         roleCodeResult = roleCode;
 | 
				
			||||||
         if (roleCode.startsWith(RoleCodeV2Enum.ROLE_ADMIN.key()) || GlobalConstants.SUPER_ADMIN_ROLE_KEY.equals(roleCode)) {
 | 
					         if (roleCode.startsWith(RoleCodeV2Enum.ROLE_ADMIN.key()) || SysUser.isAdmin(SecurityUtils.getUserId())) {
 | 
				
			||||||
            roleType = MgrRoleTypeV2Enum.ROLE_ADMIN.getKey();
 | 
					            roleType = MgrRoleTypeV2Enum.ROLE_ADMIN.getKey();
 | 
				
			||||||
//            if (CharSequenceUtil.split(roleCode, "&&").size() > 1) {
 | 
					//            if (CharSequenceUtil.split(roleCode, "&&").size() > 1) {
 | 
				
			||||||
//               roleType = MgrRoleTypeV2Enum.ROLE_ADMIN.getKey();
 | 
					//               roleType = MgrRoleTypeV2Enum.ROLE_ADMIN.getKey();
 | 
				
			||||||
| 
						 | 
					@ -132,7 +139,8 @@ public class MgrAuthApi {
 | 
				
			||||||
      if (!filterOtherRole) {
 | 
					      if (!filterOtherRole) {
 | 
				
			||||||
         return CollUtil.newArrayList(new AllocCanteenTreeVO[0]);
 | 
					         return CollUtil.newArrayList(new AllocCanteenTreeVO[0]);
 | 
				
			||||||
      } else if (!ObjectUtil.equal(mgrUserAuthPO.getRoleType(), MgrRoleTypeV2Enum.ROLE_ADMIN.getKey())
 | 
					      } else if (!ObjectUtil.equal(mgrUserAuthPO.getRoleType(), MgrRoleTypeV2Enum.ROLE_ADMIN.getKey())
 | 
				
			||||||
              && !ObjectUtil.equal(mgrUserAuthPO.getRoleCode(), GlobalConstants.SUPER_ADMIN_ROLE_KEY)
 | 
					              //&& !ObjectUtil.equal(mgrUserAuthPO.getRoleCode(), GlobalConstants.SUPER_ADMIN_ROLE_KEY)
 | 
				
			||||||
 | 
					              && !SysUser.isAdmin(SecurityUtils.getUserId())
 | 
				
			||||||
              && !ObjectUtil.equal(mgrUserAuthPO.getRoleType(), MgrRoleTypeV2Enum.ROLE_ORG.getKey())) {
 | 
					              && !ObjectUtil.equal(mgrUserAuthPO.getRoleType(), MgrRoleTypeV2Enum.ROLE_ORG.getKey())) {
 | 
				
			||||||
         return this.mgrRoleCanteenMapper.getTenantCanteen(excludeMiddle, tenantId, mgrUserAuthPO, delFlag);
 | 
					         return this.mgrRoleCanteenMapper.getTenantCanteen(excludeMiddle, tenantId, mgrUserAuthPO, delFlag);
 | 
				
			||||||
      } else {
 | 
					      } else {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -6,6 +6,7 @@ import com.bonus.canteen.core.auth.enums.RoleCodeV2Enum;
 | 
				
			||||||
import com.bonus.common.core.exception.ServiceException;
 | 
					import com.bonus.common.core.exception.ServiceException;
 | 
				
			||||||
import com.bonus.common.houqin.constant.GlobalConstants;
 | 
					import com.bonus.common.houqin.constant.GlobalConstants;
 | 
				
			||||||
import com.bonus.common.security.utils.SecurityUtils;
 | 
					import com.bonus.common.security.utils.SecurityUtils;
 | 
				
			||||||
 | 
					import com.bonus.system.api.domain.SysUser;
 | 
				
			||||||
import net.sf.jsqlparser.expression.Expression;
 | 
					import net.sf.jsqlparser.expression.Expression;
 | 
				
			||||||
import net.sf.jsqlparser.expression.HexValue;
 | 
					import net.sf.jsqlparser.expression.HexValue;
 | 
				
			||||||
import net.sf.jsqlparser.expression.operators.conditional.AndExpression;
 | 
					import net.sf.jsqlparser.expression.operators.conditional.AndExpression;
 | 
				
			||||||
| 
						 | 
					@ -88,7 +89,7 @@ public class LeNiuDataPermissionHandler {
 | 
				
			||||||
   private String getSqlByAliasAndPermissionType(Long userId, String roleCode, DataPermissionTypeEnum permissionType, String alias) {
 | 
					   private String getSqlByAliasAndPermissionType(Long userId, String roleCode, DataPermissionTypeEnum permissionType, String alias) {
 | 
				
			||||||
      StringBuilder sb = new StringBuilder();
 | 
					      StringBuilder sb = new StringBuilder();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      if (roleCode.startsWith(RoleCodeV2Enum.ROLE_ADMIN.key()) || GlobalConstants.SUPER_ADMIN_ROLE_KEY.equals(roleCode)) {
 | 
					      if (roleCode.startsWith(RoleCodeV2Enum.ROLE_ADMIN.key()) || SysUser.isAdmin(SecurityUtils.getUserId())) {
 | 
				
			||||||
         return "";
 | 
					         return "";
 | 
				
			||||||
      } else {
 | 
					      } else {
 | 
				
			||||||
           if (ObjectUtil.equal(DataPermissionTypeEnum.PERMISSION_ORG, permissionType)) {
 | 
					           if (ObjectUtil.equal(DataPermissionTypeEnum.PERMISSION_ORG, permissionType)) {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,5 +1,6 @@
 | 
				
			||||||
package com.bonus.canteen.core.drp.api;
 | 
					package com.bonus.canteen.core.drp.api;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import cn.hutool.core.collection.CollUtil;
 | 
				
			||||||
import cn.hutool.core.util.ObjectUtil;
 | 
					import cn.hutool.core.util.ObjectUtil;
 | 
				
			||||||
import com.bonus.canteen.core.auth.api.MgrAuthApi;
 | 
					import com.bonus.canteen.core.auth.api.MgrAuthApi;
 | 
				
			||||||
import com.bonus.canteen.core.drp.mapper.DrpSupplierMapper;
 | 
					import com.bonus.canteen.core.drp.mapper.DrpSupplierMapper;
 | 
				
			||||||
| 
						 | 
					@ -46,21 +47,21 @@ public class DrpAuthorityApi {
 | 
				
			||||||
//   public MgrUserAuthPO getUserAuthPO() {
 | 
					//   public MgrUserAuthPO getUserAuthPO() {
 | 
				
			||||||
//      return this.mgrAuthApi.getUserAuthPO();
 | 
					//      return this.mgrAuthApi.getUserAuthPO();
 | 
				
			||||||
//   }
 | 
					//   }
 | 
				
			||||||
//
 | 
					
 | 
				
			||||||
//   public List<Long> authAreaList(List<Long> areaIdList) {
 | 
					   public List<Long> authAreaList(List<Long> areaIdList) {
 | 
				
			||||||
//      if (this.mgrAuthApi.isSuperAdmin()) {
 | 
					      if (this.mgrAuthApi.isSuperAdmin()) {
 | 
				
			||||||
//         return areaIdList;
 | 
					         return areaIdList;
 | 
				
			||||||
//      } else {
 | 
					      } else {
 | 
				
			||||||
//         List<Long> authArea = this.mgrAuthApi.getTenantAreaIdList();
 | 
					         List<Long> authArea = this.mgrAuthApi.getTenantAreaIdList();
 | 
				
			||||||
//         if (CollUtil.isEmpty(areaIdList)) {
 | 
					         if (CollUtil.isEmpty(areaIdList)) {
 | 
				
			||||||
//            return authArea;
 | 
					            return authArea;
 | 
				
			||||||
//         } else {
 | 
					         } else {
 | 
				
			||||||
//            authArea.retainAll(areaIdList);
 | 
					            authArea.retainAll(areaIdList);
 | 
				
			||||||
//            return (List)(CollUtil.isEmpty(authArea) ? CollUtil.newArrayList(new Long[]{-1L}) : authArea);
 | 
					            return (List)(CollUtil.isEmpty(authArea) ? CollUtil.newArrayList(new Long[]{-1L}) : authArea);
 | 
				
			||||||
//         }
 | 
					         }
 | 
				
			||||||
//      }
 | 
					      }
 | 
				
			||||||
//   }
 | 
					   }
 | 
				
			||||||
//
 | 
					
 | 
				
			||||||
//   public Long getAreaByDeviceSn(String machineSn) {
 | 
					//   public Long getAreaByDeviceSn(String machineSn) {
 | 
				
			||||||
//      try {
 | 
					//      try {
 | 
				
			||||||
//         return ((DeviceBind)this.deviceApi.listBindByDeviceSn(machineSn).get(0)).getAreaId();
 | 
					//         return ((DeviceBind)this.deviceApi.listBindByDeviceSn(machineSn).get(0)).getAreaId();
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,7 @@
 | 
				
			||||||
 | 
					package com.bonus.canteen.core.drp.service;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import com.baomidou.mybatisplus.extension.service.IService;
 | 
				
			||||||
 | 
					import com.bonus.canteen.core.drp.model.DrpSupplierCategory;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					public interface DrpSupplierCategoryService extends IService<DrpSupplierCategory> {
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,11 @@
 | 
				
			||||||
 | 
					package com.bonus.canteen.core.drp.service.impl;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 | 
				
			||||||
 | 
					import com.bonus.canteen.core.drp.mapper.DrpSupplierCategoryMapper;
 | 
				
			||||||
 | 
					import com.bonus.canteen.core.drp.model.DrpSupplierCategory;
 | 
				
			||||||
 | 
					import com.bonus.canteen.core.drp.service.DrpSupplierCategoryService;
 | 
				
			||||||
 | 
					import org.springframework.stereotype.Service;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					@Service
 | 
				
			||||||
 | 
					public class DrpSupplierCategoryServiceImpl extends ServiceImpl<DrpSupplierCategoryMapper, DrpSupplierCategory> implements DrpSupplierCategoryService {
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -28,6 +28,7 @@ import com.bonus.canteen.core.drp.model.DrpSupplierCategory;
 | 
				
			||||||
import com.bonus.canteen.core.drp.model.DrpSupplierDeliver;
 | 
					import com.bonus.canteen.core.drp.model.DrpSupplierDeliver;
 | 
				
			||||||
import com.bonus.canteen.core.drp.model.DrpSupplierQualification;
 | 
					import com.bonus.canteen.core.drp.model.DrpSupplierQualification;
 | 
				
			||||||
import com.bonus.canteen.core.drp.po.CategoryModel;
 | 
					import com.bonus.canteen.core.drp.po.CategoryModel;
 | 
				
			||||||
 | 
					import com.bonus.canteen.core.drp.service.DrpSupplierCategoryService;
 | 
				
			||||||
import com.bonus.canteen.core.drp.service.DrpSupplierDeliverService;
 | 
					import com.bonus.canteen.core.drp.service.DrpSupplierDeliverService;
 | 
				
			||||||
import com.bonus.canteen.core.drp.service.DrpSupplierQualificationService;
 | 
					import com.bonus.canteen.core.drp.service.DrpSupplierQualificationService;
 | 
				
			||||||
import com.bonus.canteen.core.drp.service.DrpSupplierService;
 | 
					import com.bonus.canteen.core.drp.service.DrpSupplierService;
 | 
				
			||||||
| 
						 | 
					@ -65,9 +66,9 @@ public class DrpSupplierServiceImpl extends ServiceImpl<DrpSupplierMapper, DrpSu
 | 
				
			||||||
   @Autowired
 | 
					   @Autowired
 | 
				
			||||||
   @Lazy
 | 
					   @Lazy
 | 
				
			||||||
   private DrpSupplierCategoryMapper drpSupplierCategoryMapper;
 | 
					   private DrpSupplierCategoryMapper drpSupplierCategoryMapper;
 | 
				
			||||||
//   @Autowired
 | 
					   @Autowired
 | 
				
			||||||
//   @Lazy
 | 
					   @Lazy
 | 
				
			||||||
//   private DrpSupplierCategoryService drpSupplierCategoryService;
 | 
					   private DrpSupplierCategoryService drpSupplierCategoryService;
 | 
				
			||||||
   @Autowired
 | 
					   @Autowired
 | 
				
			||||||
   @Lazy
 | 
					   @Lazy
 | 
				
			||||||
   private DrpSupplierQualificationMapper drpSupplierQualificationMapper;
 | 
					   private DrpSupplierQualificationMapper drpSupplierQualificationMapper;
 | 
				
			||||||
| 
						 | 
					@ -454,22 +455,22 @@ public class DrpSupplierServiceImpl extends ServiceImpl<DrpSupplierMapper, DrpSu
 | 
				
			||||||
//      }
 | 
					//      }
 | 
				
			||||||
//
 | 
					//
 | 
				
			||||||
//   }
 | 
					//   }
 | 
				
			||||||
//
 | 
					
 | 
				
			||||||
//   protected void insertSupplierCategoryBatch(List<Long> categoryIdList, Long supplierId) {
 | 
					   protected void insertSupplierCategoryBatch(List<Long> categoryIdList, Long supplierId) {
 | 
				
			||||||
//      List<DrpSupplierCategory> supplierCategoryList = new ArrayList();
 | 
					      List<DrpSupplierCategory> supplierCategoryList = new ArrayList();
 | 
				
			||||||
//      Iterator var4 = categoryIdList.iterator();
 | 
					      Iterator var4 = categoryIdList.iterator();
 | 
				
			||||||
//
 | 
					
 | 
				
			||||||
//      while(var4.hasNext()) {
 | 
					      while(var4.hasNext()) {
 | 
				
			||||||
//         Long categoryId = (Long)var4.next();
 | 
					         Long categoryId = (Long)var4.next();
 | 
				
			||||||
//         DrpSupplierCategory supplierCategory = new DrpSupplierCategory();
 | 
					         DrpSupplierCategory supplierCategory = new DrpSupplierCategory();
 | 
				
			||||||
//         supplierCategory.setSupplierId(supplierId);
 | 
					         supplierCategory.setSupplierId(supplierId);
 | 
				
			||||||
//         supplierCategory.setCategoryId(categoryId);
 | 
					         supplierCategory.setCategoryId(categoryId);
 | 
				
			||||||
//         supplierCategoryList.add(supplierCategory);
 | 
					         supplierCategoryList.add(supplierCategory);
 | 
				
			||||||
//      }
 | 
					      }
 | 
				
			||||||
//
 | 
					
 | 
				
			||||||
//      this.drpSupplierCategoryService.saveBatch(supplierCategoryList);
 | 
					      this.drpSupplierCategoryService.saveBatch(supplierCategoryList);
 | 
				
			||||||
//   }
 | 
					   }
 | 
				
			||||||
//
 | 
					
 | 
				
			||||||
//   public List<DrpMaterialSupplierVO> getMaterialSupplier(DrpMaterialInfoDTO content) {
 | 
					//   public List<DrpMaterialSupplierVO> getMaterialSupplier(DrpMaterialInfoDTO content) {
 | 
				
			||||||
//      List drpMaterialSupplierList;
 | 
					//      List drpMaterialSupplierList;
 | 
				
			||||||
//      if (!ObjectUtil.isNull(content.getConfigType()) && !ObjectUtil.equal(content.getConfigType(), 1)) {
 | 
					//      if (!ObjectUtil.isNull(content.getConfigType()) && !ObjectUtil.equal(content.getConfigType(), 1)) {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue