| | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.math.BigDecimal; |
| | | import java.util.ArrayList; |
| | | import java.util.Collection; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | import java.util.concurrent.atomic.AtomicInteger; |
| | |
| | | public AjaxResult getProductInventory(SalesLedgerProduct salesLedgerProduct){ |
| | | List<SalesLedgerProduct> list = salesLedgerProductService.selectSalesLedgerProductList(salesLedgerProduct); |
| | | if(CollectionUtils.isEmpty(list)){ |
| | | return AjaxResult.error("该产品不存在"); |
| | | throw new RuntimeException("该产品不存在"); |
| | | } |
| | | List<ProcurementPageDto> procurementPageDtoList = new ArrayList<>(); |
| | | list.forEach(item -> { |
| | |
| | | procurementPageDtoList.addAll(procurementPageDtoIPage.getRecords()); |
| | | }); |
| | | if(!CollectionUtils.isEmpty(procurementPageDtoList)){ |
| | | return AjaxResult.error("该产品库存不存在"); |
| | | throw new RuntimeException("该产品库存不存在"); |
| | | } |
| | | AtomicInteger num = new AtomicInteger(); |
| | | list.forEach(item -> { |
| | |
| | | } |
| | | return AjaxResult.error("该产品库存不足"); |
| | | } |
| | | |
| | | /** |
| | | * 根据采购合同号查询详情 |
| | | */ |
| | | @GetMapping("/getSalesByCode") |
| | | public AjaxResult getSalesByCode(SalesLedgerDto salesLedgerDto) { |
| | | return AjaxResult.success(salesLedgerService.getSalesByCode(salesLedgerDto)); |
| | | } |
| | | } |