| | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.fzzy.igds.constant.Constant; |
| | | import com.fzzy.igds.constant.RedisConst; |
| | | import com.fzzy.igds.domain.Depot; |
| | | import com.fzzy.igds.domain.DepotStore; |
| | | import com.fzzy.igds.domain.Dept; |
| | | import com.fzzy.igds.mapper.DepotMapper; |
| | | import com.fzzy.igds.utils.ContextUtil; |
| | | import com.ruoyi.common.core.domain.entity.SysUser; |
| | | import com.ruoyi.common.core.redis.RedisCache; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import lombok.extern.slf4j.Slf4j; |
| | |
| | | private RedisCache redisCache; |
| | | @Resource |
| | | private DepotStoreService depotStoreService; |
| | | |
| | | @Resource |
| | | private CoreDeptService coreDeptService; |
| | | |
| | | /** |
| | | * 查询库区下仓库列表 |
| | |
| | | } |
| | | |
| | | return depotMapper.selectList(queryWrapper); |
| | | } |
| | | |
| | | /** |
| | | * 根据用户类型查询所有仓库,作为dorado的map回显使用 |
| | | * |
| | | * @param deptId |
| | | * @author sgj |
| | | * @since 2026/03/24 |
| | | */ |
| | | public List<Depot> getDepotByUserType(String deptId) { |
| | | List<Depot> result = new ArrayList<>(); |
| | | |
| | | if (StringUtils.isNotBlank(deptId)) { |
| | | //查公司下所有库区 |
| | | result = this.getData(null, deptId, false); |
| | | return result; |
| | | } |
| | | //获取当前登录人 |
| | | SysUser user = ContextUtil.getLoginUser(); |
| | | |
| | | if (Constant.USER_TYPE_10.equals(user.getUserType())) { |
| | | //监管用户,直接查询组织下所有库区 |
| | | result = this.getData(user.getCompanyId(), null, false); |
| | | return result; |
| | | } |
| | | if (Constant.USER_TYPE_20.equals(user.getUserType())) { |
| | | //银行用户,根据合同查询银行下所有库区 |
| | | List<Dept> deptByBank = coreDeptService.getDeptByBank(user.getUserData()); |
| | | for (Dept dept : deptByBank) { |
| | | result.addAll(this.getData(null, dept.getId(), false)); |
| | | } |
| | | return result; |
| | | } |
| | | if (Constant.USER_TYPE_30.equals(user.getUserType())) { |
| | | //库区用户 |
| | | if (ContextUtil.isDepotUser(user.getDeptId() + "")) { |
| | | //查询用户所属库区 |
| | | result = this.getData(null, user.getDeptId() + "", false); |
| | | } else { |
| | | //查询用户所属公司下所有库区 |
| | | result = this.getData(user.getCompanyId(), null, false); |
| | | } |
| | | return result; |
| | | } |
| | | return result; |
| | | } |
| | | |
| | | /** |
| | |
| | | lastData.setUpdateTime(new Date()); |
| | | lastData.setUpdateBy("系统定时统计"); |
| | | |
| | | |
| | | lastData.setDepotStatus(depot.getDepotStatus()); |
| | | lastData.setFoodVariety(depot.getFoodVariety()); |
| | | lastData.setFoodLevel(depot.getFoodLevel()); |
| | |
| | | lastData.setFoodLocationId(depot.getFoodLocationId()); |
| | | lastData.setFoodType(depot.getFoodType()); |
| | | lastData.setFoodYear(depot.getFoodYear()); |
| | | |
| | | |
| | | lastData.setStorageReal(depot.getStorageReal()); |
| | | lastData.setCreateTime(new Date()); //设置为最新时间,其他系统可以通过此时间查询数据是否有更新修改,同步到省平台接口。 |