| | |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.procurementrecord.dto.ProcurementPageDto; |
| | | import com.ruoyi.procurementrecord.dto.ProcurementPageDtoCopy; |
| | | import com.ruoyi.procurementrecord.service.ProcurementRecordService; |
| | | import com.ruoyi.sales.pojo.SalesLedgerProduct; |
| | | import com.ruoyi.sales.service.ISalesLedgerProductService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | { |
| | | @Autowired |
| | | private ISalesLedgerProductService salesLedgerProductService; |
| | | |
| | | @Autowired |
| | | private ProcurementRecordService procurementRecordService; |
| | | /** |
| | | * 查询产品信息列表 |
| | | */ |
| | | @GetMapping("/list") |
| | | public List<SalesLedgerProduct> list(SalesLedgerProduct salesLedgerProduct) |
| | | public AjaxResult list(SalesLedgerProduct salesLedgerProduct) |
| | | { |
| | | List<SalesLedgerProduct> list = salesLedgerProductService.selectSalesLedgerProductList(salesLedgerProduct); |
| | | return list; |
| | | list.forEach(item -> { |
| | | ProcurementPageDto procurementDto = new ProcurementPageDto(); |
| | | procurementDto.setSalesLedgerProductId(item.getId()); |
| | | procurementDto.setProductCategory(item.getProductCategory()); |
| | | IPage<ProcurementPageDtoCopy> result = procurementRecordService.listPageCopyByProduction(new Page<>(1,-1), procurementDto); |
| | | 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); |
| | | } |
| | | |
| | | /** |