1.修改来票台账详情接口,实时返回未来票数,未来票金额
2.未进行来票登记操作,同步未来票数,金额
3.字段数据类型修改
4.来票台账搜索当天记录sql语句
| | |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.IOException; |
| | | import java.math.BigDecimal; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | |
| | | IPage<PurchaseLedgerDto> purchaseLedgerDtoIPage = purchaseLedgerService.selectPurchaseLedgerListPage(page ,purchaseLedger); |
| | | //过滤掉approvalStatus=3的记录 |
| | | purchaseLedgerDtoIPage.getRecords().removeIf(purchaseLedgerDto -> purchaseLedgerDto.getApprovalStatus() == 3); |
| | | purchaseLedgerDtoIPage.getRecords().forEach(purchaseLedgerDto -> { |
| | | if (purchaseLedgerDto.getUnReceiptPaymentAmount().compareTo(BigDecimal.ZERO) == 0) { |
| | | purchaseLedgerDto.setUnReceiptPaymentAmount(purchaseLedgerDto.getContractAmount()); |
| | | } |
| | | }); |
| | | return AjaxResult.success(purchaseLedgerDtoIPage); |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | |
| | | @GetMapping("/getProductRecordById") |
| | | public AjaxResult getProductRecordById(Long id) { |
| | | if (id == null) { |
| | | @PostMapping("/getProductRecordById") |
| | | public AjaxResult getProductRecordById(@RequestBody ProductRecordDto productRecordDto) { |
| | | if (productRecordDto.getId() == null) { |
| | | return AjaxResult.error("参数错误"); |
| | | } |
| | | return AjaxResult.success(productRecordService.getProductRecordById(id)); |
| | | return AjaxResult.success(productRecordService.getProductRecordById(productRecordDto)); |
| | | } |
| | | |
| | | @ApiModelProperty("修改来票登记") |
| | |
| | | import com.ruoyi.sales.pojo.CommonFile; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.List; |
| | | |
| | | @Data |
| | |
| | | private String projectName; |
| | | private Long issUerId; |
| | | private String issUer; |
| | | /** |
| | | * 合同金额(产品含税总价) |
| | | */ |
| | | private BigDecimal contractAmount = BigDecimal.ZERO; |
| | | //增值税 |
| | | private String invoiceAmount = "0"; |
| | | |
| | | /** |
| | | * 已来票金额(发票金额) |
| | | */ |
| | | private BigDecimal invoiceTotal = BigDecimal.ZERO; |
| | | private BigDecimal invoiceAmount = BigDecimal.ZERO; |
| | | /** |
| | | * 发票号 |
| | | */ |
| | | private String invoiceNumber; |
| | | |
| | | private String unTicketsPrice = "0"; |
| | | private BigDecimal unTicketsPrice = BigDecimal.ZERO; |
| | | |
| | | private List<CommonFile> commonFiles; |
| | | |
| | |
| | | import com.ruoyi.purchase.pojo.ProductRecord; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 采购台账产品开票记录Mapper接口 |
| | | * |
| | |
| | | |
| | | IPage<ProductRecordDto> productRecordPage(Page page, @Param("c") TicketRegistrationDto ticketRegistrationDto); |
| | | |
| | | ProductRecordDto getProductRecordById(Long id); |
| | | List<ProductRecordDto> getProductRecordById(@Param("c") ProductRecordDto productRecordDto); |
| | | } |
| | |
| | | |
| | | AjaxResult updateRecord(ProductRecordDto productRecordDto); |
| | | |
| | | ProductRecordDto getProductRecordById(Long id); |
| | | ProductRecordDto getProductRecordById(ProductRecordDto productRecordDto); |
| | | } |
| | |
| | | } |
| | | |
| | | @Override |
| | | public ProductRecordDto getProductRecordById(Long id) { |
| | | ProductRecordDto productRecordDto = productRecordMapper.getProductRecordById(id); |
| | | return productRecordDto; |
| | | public ProductRecordDto getProductRecordById(ProductRecordDto productRecordDto) { |
| | | List<ProductRecordDto> productRecordDtoList = productRecordMapper.getProductRecordById(productRecordDto); |
| | | if(productRecordDtoList != null && productRecordDtoList.size() > 0){ |
| | | ProductRecordDto productRecordDto1 = productRecordDtoList.get(productRecordDtoList.size() - 1); |
| | | // 过滤出与传入的 productRecordDto 主键相同的记录 |
| | | ProductRecordDto productRecordDto2 = productRecordDtoList.stream().filter(item -> |
| | | item.getId().equals(productRecordDto.getId())) |
| | | .findFirst().orElse(null); |
| | | productRecordDto2.setFutureTickets(productRecordDto1.getFutureTickets()); |
| | | productRecordDto2.setFutureTicketsAmount(productRecordDto1.getFutureTicketsAmount()); |
| | | return productRecordDto2; |
| | | } |
| | | return null; |
| | | } |
| | | } |
| | |
| | | |
| | | LocalDateTime localDateTime = entryDate.toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime(); |
| | | salesLedgerProduct.setRegisterDate(localDateTime); |
| | | salesLedgerProduct.setFutureTickets(salesLedgerProduct.getQuantity()); |
| | | salesLedgerProduct.setFutureTicketsAmount(salesLedgerProduct.getTaxInclusiveTotalPrice()); |
| | | salesLedgerProductMapper.insert(salesLedgerProduct); |
| | | } |
| | | } |
| | |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.page.TableDataInfo; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | { |
| | | List<SalesLedgerProduct> list = salesLedgerProductService.selectSalesLedgerProductList(salesLedgerProduct); |
| | | list.forEach(item -> { |
| | | if (item.getFutureTickets().compareTo(BigDecimal.ZERO) == 0) { |
| | | item.setFutureTickets(item.getQuantity()); |
| | | } |
| | | if (item.getFutureTicketsAmount().compareTo(BigDecimal.ZERO) == 0) { |
| | | item.setFutureTicketsAmount(item.getTaxInclusiveTotalPrice()); |
| | | } |
| | | ProcurementPageDto procurementDto = new ProcurementPageDto(); |
| | | procurementDto.setSalesLedgerProductId(item.getId()); |
| | | procurementDto.setProductCategory(item.getProductCategory()); |
| | |
| | | /** |
| | | * 本次来票数 |
| | | */ |
| | | private BigDecimal ticketsNum; |
| | | private BigDecimal ticketsNum=BigDecimal.ZERO; |
| | | |
| | | /** |
| | | * 本次来票金额(元) |
| | | */ |
| | | private BigDecimal ticketsAmount; |
| | | private BigDecimal ticketsAmount=BigDecimal.ZERO; |
| | | |
| | | /** |
| | | * 未来票数 |
| | | */ |
| | | private BigDecimal futureTickets; |
| | | private BigDecimal futureTickets=BigDecimal.ZERO; |
| | | |
| | | /** |
| | | * 未来票金额(元) |
| | | */ |
| | | private BigDecimal futureTicketsAmount; |
| | | private BigDecimal futureTicketsAmount=BigDecimal.ZERO; |
| | | |
| | | @ApiModelProperty(value = "开票数") |
| | | private BigDecimal invoiceNum; |
| | |
| | | and pl.supplier_name like concat('%',#{c.supplierName},'%') |
| | | </if> |
| | | <if test="c.createdAtStart != null and c.createdAtStart != ''"> |
| | | and pr.created_at >= date_format(#{c.createdAtStart},'%Y-%m-%d hh:mm:ss') |
| | | and pr.created_at >= str_to_date(#{c.createdAtStart}, '%Y-%m-%d') |
| | | </if> |
| | | <if test="c.createdAtEnd != null and c.createdAtEnd != ''"> |
| | | and pr.created_at <= date_format(#{c.createdAtEnd},'%Y-%m-%d hh:mm:ss') |
| | | and pr.created_at < date_add(str_to_date(#{c.createdAtEnd}, '%Y-%m-%d'), interval 1 day) |
| | | </if> |
| | | <if test="c.purchaseContractNumber != null and c.purchaseContractNumber != ''"> |
| | | and tr.purchase_contract_number like concat('%',#{c.purchaseContractNumber},'%') |
| | |
| | | left join sales_ledger sl on sl.id = pl.sales_ledger_id |
| | | left join ticket_registration tr on tr.id = pr.ticket_registration_id |
| | | left join product_model pm on pm.id = pr.product_model_id |
| | | |
| | | WHERE type = 2 and pr.id = #{id} |
| | | WHERE type = 2 |
| | | <if test="c.purchaseLedgerId != null and c.purchaseLedgerId != ''"> |
| | | and pr.purchase_ledger_id = #{c.purchaseLedgerId} |
| | | </if> |
| | | <if test="c.productModelId != null and c.productModelId != ''"> |
| | | and pm.id = #{c.productModelId} |
| | | </if> |
| | | </select> |
| | | </mapper> |
| | |
| | | pl.supplier_name, |
| | | pl.project_name, |
| | | pl.contract_amount, |
| | | sum(pr.tickets_amount)as receipt_payment_amount, |
| | | pl.contract_amount-sum(pr.tickets_amount) AS unReceipt_payment_amount, |
| | | sum(tr.invoice_amount)as receipt_payment_amount, |
| | | pl.contract_amount-sum(tr.invoice_amount) AS unReceipt_payment_amount, |
| | | pl.entry_date, |
| | | pl.recorder_id, |
| | | pl.recorder_name, |
| | |
| | | pl.approval_status, |
| | | pl.payment_method |
| | | from purchase_ledger pl |
| | | left join sales_ledger_product slp on slp.sales_ledger_id = pl.id and slp.type=2 |
| | | left join product_record pr on pl.id = pr.purchase_ledger_id |
| | | left join ticket_registration tr on tr.id = pr.ticket_registration_id |
| | | left join supplier_manage sm on pl.supplier_id = sm.id |
| | | <where> |
| | | 1 = 1 |