| | |
| | | import com.ruoyi.procurementrecord.dto.ProcurementPageDto; |
| | | import com.ruoyi.procurementrecord.dto.ProcurementPageDtoCopy; |
| | | import com.ruoyi.procurementrecord.service.ProcurementRecordService; |
| | | import com.ruoyi.sales.dto.SalesLedgerProductDto; |
| | | import com.ruoyi.sales.pojo.SalesLedgerProduct; |
| | | import com.ruoyi.sales.service.ISalesLedgerProductService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | private ISalesLedgerProductService salesLedgerProductService; |
| | | @Autowired |
| | | private ProcurementRecordService procurementRecordService; |
| | | |
| | | |
| | | /** |
| | | * 回款登记分页查询 |
| | | */ |
| | | @GetMapping("/listPageSalesLedger") |
| | | public AjaxResult listPage(Page page, SalesLedgerProductDto salesLedgerProduct) { |
| | | IPage<SalesLedgerProductDto> list = salesLedgerProductService.listPage(page,salesLedgerProduct); |
| | | return AjaxResult.success(list); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 付款登记分页查询 |
| | | */ |
| | | @GetMapping("/listPagePurchaseLedger") |
| | | public AjaxResult listPagePurchaseLedger(Page page, SalesLedgerProductDto salesLedgerProduct) { |
| | | IPage<SalesLedgerProductDto> list = salesLedgerProductService.listPagePurchaseLedger(page,salesLedgerProduct); |
| | | return AjaxResult.success(list); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 查询产品信息列表 |
| | | */ |
| | |
| | | procurementDto.setSalesLedgerProductId(item.getId()); |
| | | procurementDto.setProductCategory(item.getProductCategory()); |
| | | IPage<ProcurementPageDtoCopy> result = procurementRecordService.listPageCopyByProduction(new Page<>(1,-1), procurementDto); |
| | | ProcurementPageDtoCopy procurementDtoCopy = result.getRecords().get(0); |
| | | if(item.getQuantity().compareTo(procurementDtoCopy.getInboundNum0())>=0){ |
| | | item.setApproveStatus(1); |
| | | salesLedgerProductService.addOrUpdateSalesLedgerProduct(item); |
| | | if(result.getRecords().size()>0) { |
| | | ProcurementPageDtoCopy procurementDtoCopy = result.getRecords().get(0); |
| | | if (item.getQuantity().compareTo(procurementDtoCopy.getInboundNum0()) >= 0) { |
| | | item.setApproveStatus(1); |
| | | salesLedgerProductService.addOrUpdateSalesLedgerProduct(item); |
| | | } |
| | | } |
| | | }); |
| | | return AjaxResult.success(list); |