|
@@ -993,6 +993,102 @@ public class WarehouseBaseInfoServiceImpl extends ServiceImpl<WarehouseBaseInfoM
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 查看自己负责的常用仓库
|
|
|
|
+ * @param compId
|
|
|
|
+ * @param personCharge
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ @Override
|
|
|
|
+ public List<WarehouseBaseInfo> selectWarehouseSelfApp(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("delete_flag", "0");
|
|
|
|
+ warehouseBaseInfoWrapper.andNew().eq("person_phone", personCharge).or()
|
|
|
|
+ .like("other_person_charge", personCharge);
|
|
|
|
+ List<WarehouseBaseInfo> warehouseBaseInfoList=this.selectList(warehouseBaseInfoWrapper);
|
|
|
|
+ if (!CollectionUtils.isEmpty(warehouseBaseInfoList)){
|
|
|
|
+ for (WarehouseBaseInfo warehouseBaseInfo:warehouseBaseInfoList) {
|
|
|
|
+ //查潮粮单价已审核的数据
|
|
|
|
+// List<PurchasePrice> purchasePriceList=purchasePriceService.selectList(new EntityWrapper<PurchasePrice>()
|
|
|
|
+// .eq("warehouse_id",warehouseBaseInfo.getId())
|
|
|
|
+// .eq("status_flag","3"));
|
|
|
|
+// if (!CollectionUtils.isEmpty(purchasePriceList)){
|
|
|
|
+// warehouseBaseInfo.setPurchasePriceList(purchasePriceList);
|
|
|
|
+// }
|
|
|
|
+ Map<String, Object> pageView = new HashMap<>();
|
|
|
|
+ pageView.put("warehouseName", warehouseBaseInfo.getWarehouseName());
|
|
|
|
+ pageView.put("compId", warehouseBaseInfo.getCompId());
|
|
|
|
+ // 查询质检信息包括已删除的
|
|
|
|
+ Integer dataCount = baseMapper.getCountByCondition(pageView);
|
|
|
|
+ warehouseBaseInfo.setCount(dataCount);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ else {
|
|
|
|
+ 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().equals("财务")|| commonRole.getRoleName().equals("出纳")|| commonRole.getRoleName().equals("系统管理员")|| commonRole.getRoleName().contains("总")){
|
|
|
|
+ List<WarehouseBaseInfo> warehouseBaseInfoList1 = this.selectList(new EntityWrapper<WarehouseBaseInfo>()
|
|
|
|
+ .eq("comp_id", compId)
|
|
|
|
+ .eq("delete_flag", "0"));
|
|
|
|
+ for (WarehouseBaseInfo warehouseBaseInfo:warehouseBaseInfoList1){
|
|
|
|
+ warehouseBaseInfo.setFlag("全部");
|
|
|
|
+ //查潮粮单价已审核的数据
|
|
|
|
+// List<PurchasePrice> purchasePriceList=purchasePriceService.selectList(new EntityWrapper<PurchasePrice>()
|
|
|
|
+// .eq("warehouse_id",warehouseBaseInfo.getId())
|
|
|
|
+// .eq("status_flag","3"));
|
|
|
|
+// if (!CollectionUtils.isEmpty(purchasePriceList)){
|
|
|
|
+// warehouseBaseInfo.setPurchasePriceList(purchasePriceList);
|
|
|
|
+// }
|
|
|
|
+ Map<String, Object> pageView = new HashMap<>();
|
|
|
|
+ pageView.put("warehouseName", warehouseBaseInfo.getWarehouseName());
|
|
|
|
+ pageView.put("compId", warehouseBaseInfo.getCompId());
|
|
|
|
+ // 查询质检信息包括已删除的
|
|
|
|
+ Integer dataCount = baseMapper.getCountByCondition(pageView);
|
|
|
|
+ warehouseBaseInfo.setCount(dataCount);
|
|
|
|
+ warehouseBaseInfoList.add(warehouseBaseInfo);
|
|
|
|
+ }
|
|
|
|
+ break;
|
|
|
|
+// return warehouseBaseInfoList;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if (!CollectionUtils.isEmpty(warehouseBaseInfoList)) {
|
|
|
|
+ for (WarehouseBaseInfo warehouseBaseInfo : warehouseBaseInfoList) {
|
|
|
|
+ List<WarehousePositionStorageInfo> temp = new ArrayList();
|
|
|
|
+ // 以库位为维度查询
|
|
|
|
+ List<WarehousePositionInfo> warehousePositionInfos = warehousePositionInfoService.selectList(new EntityWrapper<WarehousePositionInfo>()
|
|
|
|
+ .eq("base_id", warehouseBaseInfo.getId()));
|
|
|
|
+ if (!CollectionUtils.isEmpty(warehousePositionInfos)) {
|
|
|
|
+ for (WarehousePositionInfo warehousePositionInfo:warehousePositionInfos) {
|
|
|
|
+ //查询仓库内的货名
|
|
|
|
+ List<WarehousePositionStorageInfo> warehousePositionStorageInfos = warehousePositionStorageInfoService.selectList(new EntityWrapper<WarehousePositionStorageInfo>()
|
|
|
|
+ .eq("position_id", warehousePositionInfo.getId()));
|
|
|
|
+ if (!CollectionUtils.isEmpty(warehousePositionStorageInfos)){
|
|
|
|
+ for (WarehousePositionStorageInfo warehousePositionStorageInfo:warehousePositionStorageInfos){
|
|
|
|
+ temp.add(warehousePositionStorageInfo);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ warehouseBaseInfo.setGoodsNameInfos(temp);
|
|
|
|
+ warehouseBaseInfo.setPositionInfos(warehousePositionInfos);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ return warehouseBaseInfoList;
|
|
|
|
+ }
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 查看自己负责的常用仓库
|
|
* 查看自己负责的常用仓库
|
|
* @param compId
|
|
* @param compId
|
|
@@ -1008,7 +1104,7 @@ public class WarehouseBaseInfoServiceImpl extends ServiceImpl<WarehouseBaseInfoM
|
|
personCharge = AuthSecurityUtils.getStaffById(AuthSecurityUtils.getCurrentUserId()).getStaffMobilePhone();
|
|
personCharge = AuthSecurityUtils.getStaffById(AuthSecurityUtils.getCurrentUserId()).getStaffMobilePhone();
|
|
}
|
|
}
|
|
Wrapper<WarehouseBaseInfo> warehouseBaseInfoWrapper = new EntityWrapper<>();
|
|
Wrapper<WarehouseBaseInfo> warehouseBaseInfoWrapper = new EntityWrapper<>();
|
|
- warehouseBaseInfoWrapper.eq("comp_id", compId)
|
|
|
|
|
|
+ warehouseBaseInfoWrapper.eq("comp_id", compId)
|
|
.eq("warehouse_type","1").eq("delete_flag", "0");
|
|
.eq("warehouse_type","1").eq("delete_flag", "0");
|
|
warehouseBaseInfoWrapper.andNew().eq("person_phone", personCharge).or()
|
|
warehouseBaseInfoWrapper.andNew().eq("person_phone", personCharge).or()
|
|
.like("other_person_charge", personCharge);
|
|
.like("other_person_charge", personCharge);
|