|
@@ -3,6 +3,13 @@ package com.yh.saas.plugin.yiliangyiyun.service.impl;
|
|
|
import com.baomidou.mybatisplus.mapper.EntityWrapper;
|
|
|
import com.baomidou.mybatisplus.mapper.Wrapper;
|
|
|
import com.fasterxml.jackson.databind.BeanProperty;
|
|
|
+import com.winsea.svc.base.base.entity.CommonRole;
|
|
|
+import com.winsea.svc.base.base.entity.CommonStaff;
|
|
|
+import com.winsea.svc.base.base.entity.CommonStaffRole;
|
|
|
+import com.winsea.svc.base.base.service.ICommonRoleService;
|
|
|
+import com.winsea.svc.base.base.service.ICommonStaffRoleService;
|
|
|
+import com.winsea.svc.base.base.service.ICommonStaffService;
|
|
|
+import com.winsea.svc.base.security.util.AuthSecurityUtils;
|
|
|
import com.yh.saas.common.support.util.IdGenerator;
|
|
|
import com.yh.saas.common.support.util.StringUtils;
|
|
|
import com.yh.saas.plugin.yiliangyiyun.constant.NumberConstant;
|
|
@@ -54,6 +61,12 @@ public class WarehouseBaseInfoServiceImpl extends ServiceImpl<WarehouseBaseInfoM
|
|
|
private IPurchasePriceService purchasePriceService;
|
|
|
@Autowired
|
|
|
private IContractGoodsInfoService contractGoodsInfoService;
|
|
|
+ @Autowired
|
|
|
+ private ICommonStaffService commonStaffService;
|
|
|
+ @Autowired
|
|
|
+ private ICommonStaffRoleService commonStaffRoleService;
|
|
|
+ @Autowired
|
|
|
+ private ICommonRoleService commonRoleService;
|
|
|
|
|
|
/**
|
|
|
* 仓库管理页面列表
|
|
@@ -735,10 +748,16 @@ public class WarehouseBaseInfoServiceImpl extends ServiceImpl<WarehouseBaseInfoM
|
|
|
*/
|
|
|
@Override
|
|
|
public List<WarehouseBaseInfo> selectWarehouseSelf(String compId, String personCharge) {
|
|
|
+ if(compId == null || compId.isEmpty()){
|
|
|
+ compId = AuthSecurityUtils.getStaffById(AuthSecurityUtils.getCurrentUserId()).getCompId();
|
|
|
+ }
|
|
|
+ if(personCharge == null || personCharge.isEmpty()){
|
|
|
+ personCharge = AuthSecurityUtils.getStaffById(AuthSecurityUtils.getCurrentUserId()).getStaffMobilePhone();
|
|
|
+ }
|
|
|
Wrapper<WarehouseBaseInfo> warehouseBaseInfoWrapper = new EntityWrapper<>();
|
|
|
warehouseBaseInfoWrapper.eq("comp_id", compId)
|
|
|
.eq("warehouse_type","1").eq("delete_flag", "0");
|
|
|
- warehouseBaseInfoWrapper.andNew().eq("person_charge", personCharge).or()
|
|
|
+ warehouseBaseInfoWrapper.andNew().eq("person_phone", personCharge).or()
|
|
|
.like("other_person_charge", personCharge);
|
|
|
List<WarehouseBaseInfo> warehouseBaseInfoList=this.selectList(warehouseBaseInfoWrapper);
|
|
|
if (!CollectionUtils.isEmpty(warehouseBaseInfoList)){
|
|
@@ -759,14 +778,25 @@ public class WarehouseBaseInfoServiceImpl extends ServiceImpl<WarehouseBaseInfoM
|
|
|
}
|
|
|
}
|
|
|
else {
|
|
|
- List<WarehouseBaseInfo> warehouseBaseInfoList1 = this.selectList(new EntityWrapper<WarehouseBaseInfo>()
|
|
|
- .eq("comp_id", compId)
|
|
|
- .eq("warehouse_type","1")
|
|
|
- .eq("delete_flag", "0"));
|
|
|
- for (WarehouseBaseInfo warehouseBaseInfo:warehouseBaseInfoList1){
|
|
|
- warehouseBaseInfo.setFlag("全部");
|
|
|
+ String staffId = AuthSecurityUtils.getStaffById(AuthSecurityUtils.getCurrentUserId()).getStaffId();
|
|
|
+ List<CommonStaffRole> staffRoles = commonStaffRoleService.selectList(new EntityWrapper<CommonStaffRole>().eq("staff_id",staffId));
|
|
|
+ List<CommonRole> list = new ArrayList<>();
|
|
|
+ for(CommonStaffRole commonStaffRole : staffRoles){
|
|
|
+ list.add(commonRoleService.selectById(commonStaffRole.getRoleId()));
|
|
|
+ }
|
|
|
+ for(CommonRole commonRole : list){
|
|
|
+ if(commonRole.getRoleName().equals("决策人") || commonRole.getRoleName().equals("系统管理员")|| commonRole.getRoleName().contains("总")){
|
|
|
+ List<WarehouseBaseInfo> warehouseBaseInfoList1 = this.selectList(new EntityWrapper<WarehouseBaseInfo>()
|
|
|
+ .eq("comp_id", compId)
|
|
|
+ .eq("warehouse_type","1")
|
|
|
+ .eq("delete_flag", "0"));
|
|
|
+ for (WarehouseBaseInfo warehouseBaseInfo:warehouseBaseInfoList1){
|
|
|
+ warehouseBaseInfo.setFlag("全部");
|
|
|
+ }
|
|
|
+ warehouseBaseInfoList=warehouseBaseInfoList1;
|
|
|
+ return warehouseBaseInfoList;
|
|
|
+ }
|
|
|
}
|
|
|
- warehouseBaseInfoList=warehouseBaseInfoList1;
|
|
|
}
|
|
|
return warehouseBaseInfoList;
|
|
|
}
|