feat(stock): 添加通过ID查询库存功能
| | |
| | | public R thawStock(@RequestBody StockInventoryDto stockInventoryDto) { |
| | | return R.ok(stockInventoryService.thawStock(stockInventoryDto)); |
| | | } |
| | | |
| | | @GetMapping("/getById") |
| | | @ApiOperation("通过id查询库存") |
| | | public R getById(Long id) { |
| | | return R.ok(stockInventoryService.getStcokById(id)); |
| | | } |
| | | } |
| | |
| | | List<Map<String, Object>> selectDailyStockOutCounts(@Param("rootCategoryId") Long rootCategoryId, @Param("startDate") String startDate, @Param("endDate") String endDate); |
| | | |
| | | BigDecimal selectTotalByDate( @Param("now") LocalDate now); |
| | | |
| | | StockInventoryDto getStcokById(@Param("id") Long id); |
| | | } |
| | |
| | | Boolean frozenStock(StockInventoryDto stockInventoryDto); |
| | | |
| | | Boolean thawStock(StockInventoryDto stockInventoryDto); |
| | | |
| | | StockInventoryDto getStcokById(Long id); |
| | | } |
| | |
| | | stockInventory.setLockedQuantity(stockInventory.getLockedQuantity().subtract(stockInventoryDto.getLockedQuantity())); |
| | | return this.updateById(stockInventory); |
| | | } |
| | | |
| | | @Override |
| | | public StockInventoryDto getStcokById(Long id) { |
| | | return stockInventoryMapper.getStcokById( id); |
| | | } |
| | | } |
| | |
| | | GROUP BY DATE(sor.create_time) |
| | | ORDER BY DATE(sor.create_time) ASC |
| | | </select> |
| | | <select id="getStcokById" resultType="com.ruoyi.stock.dto.StockInventoryDto"> |
| | | select si.id, |
| | | si.qualitity, |
| | | COALESCE(si.locked_quantity, 0) as locked_quantity, |
| | | si.product_model_id, |
| | | si.create_time, |
| | | si.update_time, |
| | | COALESCE(si.warn_num, 0) as warn_num, |
| | | si.version, |
| | | (si.qualitity - COALESCE(si.locked_quantity, 0)) as un_locked_quantity, |
| | | pm.model, |
| | | si.remark, |
| | | pm.unit, |
| | | p.product_name, |
| | | pm.url, |
| | | pm.height, |
| | | pm.box_num, |
| | | pm. dollar_price, |
| | | pm.tax_inclusive_unit_price, |
| | | si.create_by |
| | | from stock_inventory si |
| | | left join product_model pm on si.product_model_id = pm.id |
| | | left join product p on pm.product_id = p.id |
| | | where si.id = #{id} |
| | | </select> |
| | | |
| | | </mapper> |