| | |
| | | QueryWrapper<Quantity> queryWrapper = new QueryWrapper<>(); |
| | | |
| | | param.setCompanyId(ContextUtil.getCompanyId()); |
| | | param.setDeptId(ContextUtil.subDeptId(null)); |
| | | queryWrapper.eq("company_id", param.getCompanyId()); |
| | | queryWrapper.eq("dept_id", param.getDeptId()); |
| | | |
| | | //库区检索 |
| | | if (StringUtils.isNotBlank(param.getDeptId())) { |
| | | queryWrapper.like("dept_id", param.getDeptId()); |
| | | } |
| | | //仓库检索 |
| | | if (StringUtils.isNotBlank(param.getDepotId())) { |
| | | queryWrapper.eq("depot_id", param.getDepotId()); |
| | |
| | | } |
| | | |
| | | /** |
| | | * 查询数据列表 |
| | | * @param depotId |
| | | * @param limit 查询条数 |
| | | * @return |
| | | */ |
| | | public List<Quantity> getQuantityList(String depotId, Integer limit) { |
| | | if (StringUtils.isEmpty(depotId)) { |
| | | return null; |
| | | } |
| | | |
| | | QueryWrapper<Quantity> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.eq("depot_id", depotId); |
| | | queryWrapper.orderByDesc("receive_date"); |
| | | queryWrapper.last("LIMIT " + limit); |
| | | |
| | | return quantityMapper.selectList(queryWrapper); |
| | | } |
| | | |
| | | /** |
| | | * 保存数据 |
| | | * |
| | | * @param data |
| | | */ |
| | | public void saveData(Quantity data) { |
| | | |
| | | data.setUpdateBy(ContextUtil.getLoginUserName()); |
| | | data.setUpdateTime(new Date()); |
| | | |
| | | if(StringUtils.isBlank(data.getCreateBy())){ |
| | | data.setCreateBy(ContextUtil.getLoginUserName()); |
| | | data.setCreateTime(new Date()); |
| | | } |
| | | quantityMapper.insert(data); |
| | | } |
| | | |
| | | /** |
| | | * 查询配置信息,根据库区编码获取 |
| | | * |
| | | * @param companyId |