Merge remote-tracking branch 'origin/dev_New_pro' into dev_New_pro
| | |
| | | import com.ruoyi.account.bean.dto.StatementAccountDto; |
| | | import com.ruoyi.account.bean.vo.StatementAccountVo; |
| | | import com.ruoyi.account.pojo.AccountStatement; |
| | | import com.ruoyi.purchase.dto.VatDto; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | |
| | | |
| | | |
| | | IPage<StatementAccountVo> listPageAccountStatement(Page page, @Param("req") StatementAccountDto statementAccountDto); |
| | | |
| | | IPage<VatDto> selectVatDtoPage(Page page, @Param("month") String month); |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.basic.service.ISupplierService; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log; |
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.purchase.dto.VatDto; |
| | | import com.ruoyi.purchase.service.PurchaseReportService; |
| | | import com.ruoyi.purchase.vo.PurchaseReportVo; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.util.List; |
| | | |
| | | @RestController |
| | | @Tag(name = "éè´æ¥è¡¨") |
| | | @RequestMapping("/purchase/report") |
| | |
| | | public class AccountingReportController { |
| | | |
| | | private final ISupplierService supplierService; |
| | | private final PurchaseReportService purchaseReportService; |
| | | |
| | | |
| | | @GetMapping("/list") |
| | | @Log(title = "éè´æ¥è¡¨-项ç®å©æ¶¦", businessType = BusinessType.OTHER) |
| | | public AjaxResult list(Page page) { |
| | | return AjaxResult.success(); |
| | | public R list(Page page, String customerName) { |
| | | return R.ok(purchaseReportService.list(page,customerName)); |
| | | } |
| | | |
| | | @Log(title = "éè´æ¥è¡¨-项ç®å©æ¶¦å¯¼åº", businessType = BusinessType.EXPORT) |
| | | @PostMapping("/export") |
| | | @Operation(summary = "éè´æ¥è¡¨-项ç®å©æ¶¦å¯¼åº") |
| | | public void export(HttpServletResponse response) { |
| | | public void export(HttpServletResponse response, String customerName) { |
| | | List<PurchaseReportVo> list = purchaseReportService.list(new Page(1,-1),customerName).getRecords(); |
| | | ExcelUtil<PurchaseReportVo> util = new ExcelUtil<>(PurchaseReportVo.class); |
| | | util.exportExcel(response, list , "项ç®å©æ¶¦"); |
| | | |
| | | } |
| | | |
| | | @Log(title = "éè´æ¥è¡¨-å¢å¼ç¨æ¯å¯¹", businessType = BusinessType.OTHER) |
| | | @GetMapping("/listVat") |
| | | public AjaxResult listVat(Page page,String month) { |
| | | return AjaxResult.success(); |
| | | public R listVat(Page page,String month) { |
| | | return R.ok(purchaseReportService.listVat(page,month)); |
| | | } |
| | | |
| | | @Log(title = "éè´æ¥è¡¨-å¢å¼ç¨æ¯å¯¹", businessType = BusinessType.EXPORT) |
| | | @PostMapping("/exportTwo") |
| | | @Operation(summary = "éè´æ¥è¡¨-å¢å¼ç¨æ¯å¯¹") |
| | | public void exportTwo(HttpServletResponse response) { |
| | | public void exportTwo(HttpServletResponse response,String month) { |
| | | List<VatDto> list = purchaseReportService.listVat(new Page(1,-1),month).getRecords(); |
| | | ExcelUtil<VatDto> util = new ExcelUtil<>(VatDto.class); |
| | | util.exportExcel(response, list , "å¢å¼ç¨æ¯å¯¹"); |
| | | } |
| | | |
| | | @GetMapping("/supplierTransactions") |
| | |
| | | package com.ruoyi.purchase.dto; |
| | | |
| | | import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Excel; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDate; |
| | | |
| | | @Data |
| | | @Schema(name = "VatDto", description = "管ç驾驶è±--å¢å¼ç¨æ¯å¯¹åæ°") |
| | | @ExcelIgnoreUnannotated |
| | | public class VatDto { |
| | | |
| | | //æä»½ |
| | | @Excel(name = "æä»½") |
| | | @Schema(description = "æä»½") |
| | | private String month ; |
| | | |
| | | //è¿é¡¹ç¨ |
| | | @Excel(name = "è¿é¡¹ç¨é¢") |
| | | @Excel(name = "é项ç¨é¢") |
| | | @Schema(description = "é项ç¨é¢") |
| | | private BigDecimal jTaxAmount; |
| | | |
| | | //éé¡¹ç¨ |
| | | @Excel(name = "é项ç¨é¢") |
| | | @Excel(name = "è¿é¡¹ç¨é¢") |
| | | @Schema(description = "è¿é¡¹ç¨é¢") |
| | | private BigDecimal xTaxAmount; |
| | | |
| | | @Excel(name = "é-è¿") |
| | | @Schema(description = "é-è¿") |
| | | private BigDecimal taxAmount; |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.purchase.service; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.purchase.dto.VatDto; |
| | | import com.ruoyi.purchase.vo.PurchaseReportVo; |
| | | |
| | | public interface PurchaseReportService { |
| | | |
| | | IPage<PurchaseReportVo> list(Page page, String customerName); |
| | | |
| | | IPage<VatDto> listVat(Page page, String month); |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.purchase.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.account.mapper.AccountStatementMapper; |
| | | import com.ruoyi.purchase.dto.VatDto; |
| | | import com.ruoyi.purchase.service.PurchaseReportService; |
| | | import com.ruoyi.purchase.vo.PurchaseReportVo; |
| | | import com.ruoyi.sales.mapper.SalesLedgerMapper; |
| | | import lombok.RequiredArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | |
| | | @Service |
| | | @Slf4j |
| | | @RequiredArgsConstructor |
| | | public class PurchaseReportServiceImpl implements PurchaseReportService { |
| | | |
| | | private final SalesLedgerMapper salesLedgerMapper; |
| | | private final AccountStatementMapper accountStatementMapper; |
| | | |
| | | @Override |
| | | public IPage<PurchaseReportVo> list(Page page, String customerName) { |
| | | return salesLedgerMapper.selectPurchaseReportVoPage(page, customerName); |
| | | } |
| | | |
| | | @Override |
| | | public IPage<VatDto> listVat(Page page, String month) { |
| | | return accountStatementMapper.selectVatDtoPage(page, month); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.purchase.vo; |
| | | |
| | | import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Excel; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | @Data |
| | | @Schema(name = "PurchaseReportVo", description = "管ç驾驶è±--项ç®å©æ¶¦åæ°") |
| | | @ExcelIgnoreUnannotated |
| | | public class PurchaseReportVo { |
| | | |
| | | @Schema(description = "éå®ååå·") |
| | | @Excel(name = "éå®ååå·") |
| | | private String customerContractNo; |
| | | |
| | | @Schema(description = "客æ·åç§°") |
| | | @Excel(name = "客æ·åç§°") |
| | | private String customerName; |
| | | |
| | | @Schema(description = "项ç®åç§°") |
| | | @Excel(name = "项ç®åç§°") |
| | | private String projectName; |
| | | |
| | | @Excel(name = "ååéé¢") |
| | | @Schema(description = "ååéé¢") |
| | | private BigDecimal contractAmount; |
| | | |
| | | @Excel(name = "éè´éé¢") |
| | | @Schema(description = "éè´éé¢") |
| | | private BigDecimal purchaseAmount; |
| | | |
| | | @Schema(description = "婿¶¦") |
| | | @Excel(name = "婿¶¦") |
| | | private BigDecimal balance; |
| | | |
| | | @Schema(description = "婿¶¦ç") |
| | | @Excel(name = "婿¶¦ç") |
| | | private BigDecimal balanceRatio; |
| | | |
| | | |
| | | } |
| | |
| | | import com.ruoyi.quality.service.IQualityInspectService; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import jakarta.validation.Valid; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.util.CollectionUtils; |
| | | import org.springframework.web.bind.annotation.*; |
| | |
| | | @PostMapping("/submit") |
| | | @Operation(summary = "æäº¤æ£éª") |
| | | @Log(title = "æäº¤æ£éª", businessType = BusinessType.OTHER) |
| | | public R<?> submit(@Valid @RequestBody QualityInspect qualityInspect) { |
| | | public R<?> submit(@RequestBody QualityInspect qualityInspect) { |
| | | return R.ok(qualityInspectService.submit(qualityInspect)); |
| | | } |
| | | |
| | |
| | | import com.ruoyi.dto.DateQueryDto; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Excel; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import jakarta.validation.constraints.NotNull; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serial; |
| | |
| | | * ç±»å«(0:åæææ£éª;1:è¿ç¨æ£éª;2:åºåæ£éª) |
| | | */ |
| | | @Excel(name = "ç±»å«",readConverterExp = "0=åæææ£éª,1=è¿ç¨æ£éª,2=åºåæ£éª") |
| | | @NotNull(message = "ç±»å«ä¸è½ä¸ºç©º") |
| | | private Integer inspectType; |
| | | |
| | | /** |
| | |
| | | /** |
| | | * å
³è产åid |
| | | */ |
| | | @NotNull(message = "产åidä¸è½ä¸ºç©º") |
| | | private Long productId; |
| | | |
| | | /** |
| | |
| | | |
| | | @Excel(name = "åæ ¼æ°é") |
| | | @TableField("qualified_quantity") |
| | | @NotNull(message = "åæ ¼æ°éä¸è½ä¸ºç©º") |
| | | private BigDecimal qualifiedQuantity; |
| | | |
| | | @Excel(name = "ä¸åæ ¼æ°é") |
| | | @TableField("unqualified_quantity") |
| | | @NotNull(message = "ä¸åæ ¼æ°éä¸è½ä¸ºç©º") |
| | | private BigDecimal unqualifiedQuantity; |
| | | |
| | | /** |
| | |
| | | import com.deepoove.poi.XWPFTemplate; |
| | | import com.deepoove.poi.config.Configure; |
| | | import com.ruoyi.common.enums.StockInQualifiedRecordTypeEnum; |
| | | import com.ruoyi.common.exception.ServiceException; |
| | | import com.ruoyi.common.utils.HackLoopTableRenderPolicy; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.procurementrecord.service.ProcurementRecordService; |
| | |
| | | @Override |
| | | public int submit(QualityInspect inspect) { |
| | | QualityInspect qualityInspect = qualityInspectMapper.selectById(inspect.getId()); |
| | | |
| | | //æäº¤åå¿
须夿æ¯å¦åæ ¼ |
| | | if (ObjectUtils.isNull(qualityInspect.getCheckResult())) { |
| | | throw new RuntimeException("请å
夿æ¯å¦åæ ¼"); |
| | | throw new ServiceException("请å
夿æ¯å¦åæ ¼"); |
| | | } |
| | | |
| | | if (ObjectUtils.isNull(qualityInspect.getQualifiedQuantity())) { |
| | | throw new RuntimeException("åæ ¼æ°éä¸è½ä¸ºç©º"); |
| | | throw new ServiceException("åæ ¼æ°éä¸è½ä¸ºç©º"); |
| | | } |
| | | |
| | | if (ObjectUtils.isNull(qualityInspect.getUnqualifiedQuantity())) { |
| | | throw new RuntimeException("ä¸åæ ¼æ°éä¸è½ä¸ºç©º"); |
| | | throw new ServiceException("ä¸åæ ¼æ°éä¸è½ä¸ºç©º"); |
| | | } |
| | | |
| | | // åºååæ ¼æ°é以åä¸åæ ¼å¤çè¿è¡å¯¹åºçå¤ç |
| | | Assert.isTrue(qualityInspect.getQuantity().compareTo(qualityInspect.getQualifiedQuantity().add(qualityInspect.getUnqualifiedQuantity())) == 0,"è¯·æ£æ¥åæ ¼æ°éåä¸åæ ¼æ°éï¼éè¦åæ ¼æ°é+ä¸åæ ¼æ°é䏿»æ°ä¿æä¸è´"); |
| | | // å¦æåæ ¼æ°é为空ï¼è®¾ä¸º0 |
| | | if (qualityInspect.getQualifiedQuantity() == null) { |
| | | qualityInspect.setQualifiedQuantity(BigDecimal.ZERO); |
| | | } |
| | | |
| | | // 妿ä¸åæ ¼æ°é为空ï¼è®¾ä¸º0 |
| | | if (qualityInspect.getUnqualifiedQuantity() == null) { |
| | | qualityInspect.setUnqualifiedQuantity(BigDecimal.ZERO); |
| | | } |
| | | |
| | | // åæ ¼ç´æ¥å
¥åº |
| | | if(qualityInspect.getQualifiedQuantity().compareTo(BigDecimal.ZERO) > 0){ |
| | | //åæ ¼ç´æ¥å
¥åº |
| | | // stockUtils.addStock(qualityInspect.getProductModelId(), qualityInspect.getQuantity(), StockInQualifiedRecordTypeEnum.QUALITYINSPECT_STOCK_IN.getCode(), qualityInspect.getId()); |
| | | //ä»
æ·»å å
¥åºè®°å½ |
| | | StockInventoryDto stockInventoryDto = new StockInventoryDto(); |
| | | //妿æ¯éè´è´¨æ£åæ ¼å
¥åºéç¨CUSTOMIZATION_UNSTOCK_OUT,å
¶ä½åæ ¼å
¥åºéç¨QUALITYINSPECT_STOCK_IN |
| | |
| | | qualityInspect.getProductModelId())); |
| | | stockInventoryService.addStockInRecordOnly(stockInventoryDto); |
| | | } |
| | | // ä¸åæ ¼å¤ç |
| | | if(qualityInspect.getUnqualifiedQuantity().compareTo(BigDecimal.ZERO) > 0){ |
| | | QualityUnqualified qualityUnqualified = new QualityUnqualified(); |
| | | BeanUtils.copyProperties(qualityInspect, qualityUnqualified); |
| | |
| | | import com.baomidou.mybatisplus.core.toolkit.support.SFunction; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.home.dto.IncomeExpenseAnalysisDto; |
| | | import com.ruoyi.purchase.vo.PurchaseReportVo; |
| | | import com.ruoyi.sales.dto.SalesLedgerDto; |
| | | import com.ruoyi.sales.dto.SalesTrendDto; |
| | | import com.ruoyi.sales.dto.StatisticsTableDto; |
| | |
| | | List<SalesTrendDto> statisticsTable(@Param("statisticsTableDto")StatisticsTableDto statisticsTableDto); |
| | | |
| | | IPage<SalesLedgerDto> listSalesLedgerAndShipped(Page page, @Param("ew") SalesLedgerDto salesLedgerDto); |
| | | |
| | | IPage<PurchaseReportVo> selectPurchaseReportVoPage(Page page, @Param("customerName") String customerName); |
| | | |
| | | } |
| | |
| | | import com.ruoyi.stock.dto.StockInventoryDto; |
| | | import com.ruoyi.stock.dto.StockUninventoryDto; |
| | | import com.ruoyi.stock.execl.StockInRecordExportData; |
| | | import com.ruoyi.production.mapper.ProductionOrderPickMapper; |
| | | import com.ruoyi.production.pojo.ProductionOrderPick; |
| | | import com.ruoyi.stock.mapper.StockInRecordMapper; |
| | | import com.ruoyi.stock.mapper.StockInventoryMapper; |
| | | import com.ruoyi.stock.mapper.StockUninventoryMapper; |
| | |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.List; |
| | | |
| | | @Service |
| | |
| | | private StockInRecordMapper stockInRecordMapper; |
| | | private StockInventoryMapper stockInventoryMapper; |
| | | private StockUninventoryMapper stockUninventoryMapper; |
| | | private ProductionOrderPickMapper productionOrderPickMapper; |
| | | |
| | | @Override |
| | | public IPage<StockInRecordDto> listPage(Page page, StockInRecordDto stockInRecordDto) { |
| | |
| | | } |
| | | stockInRecord.setApprovalStatus(approvalStatus); |
| | | stockInRecordMapper.updateById(stockInRecord); |
| | | |
| | | // 审æ¹é©³åæ¶ï¼å¦ææ¯ç产éæå
¥åºï¼éè¦åæ»é¢æè®°å½çéææ°é |
| | | if (ReviewStatusEnum.REJECTED.getCode().equals(approvalStatus) && |
| | | StockInQualifiedRecordTypeEnum.FEED_RETURN_IN.getCode().equals(stockInRecord.getRecordType())) { |
| | | // æ¾å°å¯¹åºçé¢æè®°å½ |
| | | ProductionOrderPick productionOrderPick = productionOrderPickMapper.selectById(stockInRecord.getRecordId()); |
| | | if (productionOrderPick != null) { |
| | | // 忻鿿°é |
| | | BigDecimal returnQty = productionOrderPick.getReturnQty(); |
| | | if (returnQty == null) { |
| | | returnQty = BigDecimal.ZERO; |
| | | } |
| | | BigDecimal newReturnQty = returnQty.subtract(stockInRecord.getStockInNum()); |
| | | if (newReturnQty.compareTo(BigDecimal.ZERO) < 0) { |
| | | newReturnQty = BigDecimal.ZERO; |
| | | } |
| | | productionOrderPick.setReturnQty(newReturnQty); |
| | | // éæ°è®¡ç®å®é
ç¨é |
| | | BigDecimal actualQty = productionOrderPick.getQuantity().add( |
| | | productionOrderPick.getFeedingQty() != null ? productionOrderPick.getFeedingQty() : BigDecimal.ZERO) |
| | | .subtract(newReturnQty); |
| | | productionOrderPick.setActualQty(actualQty); |
| | | productionOrderPick.setReturned(newReturnQty.compareTo(BigDecimal.ZERO) > 0); |
| | | productionOrderPickMapper.updateById(productionOrderPick); |
| | | } |
| | | } |
| | | |
| | | // 审æ¹éè¿æ¶ï¼åºåå¢å |
| | | if (ReviewStatusEnum.APPROVED.getCode().equals(approvalStatus)) { |
| | | if ("0".equals(stockInRecord.getType())) { |
| | |
| | | main: |
| | | allow-circular-references: true |
| | | profiles: |
| | | active: dev |
| | | active: dev-pro |
| | | langchain4j: |
| | | mcp: |
| | | # MCP æå¡ç«¯å°åï¼æ ¹æ®å®é
é¨ç½²ç MCP æå¡è°æ´ï¼ |
| | |
| | | </if> |
| | | ORDER BY lj.statement_month DESC |
| | | </select> |
| | | <select id="selectVatDtoPage" resultType="com.ruoyi.purchase.dto.VatDto"> |
| | | SELECT |
| | | month, |
| | | jTaxAmount, |
| | | xTaxAmount, |
| | | (jTaxAmount - xTaxAmount) AS taxAmount |
| | | FROM ( |
| | | SELECT |
| | | month, |
| | | SUM(IF(type = 'purchase', tax_price, 0)) AS xTaxAmount, |
| | | SUM(IF(type = 'sales', tax_price, 0)) AS jTaxAmount |
| | | FROM ( |
| | | SELECT |
| | | DATE_FORMAT(issue_date, '%Y-%m') AS month, |
| | | tax_price, |
| | | 'sales' AS type |
| | | FROM account_sales_invoice |
| | | WHERE status != 1 |
| | | UNION ALL |
| | | SELECT |
| | | DATE_FORMAT(issue_date, '%Y-%m') AS month, |
| | | tax_price, |
| | | 'purchase' AS type |
| | | FROM account_purchase_invoice |
| | | WHERE status != 1 |
| | | ) AS all_data |
| | | GROUP BY month |
| | | ) AS TT |
| | | <where> |
| | | <if test="month != null"> |
| | | and TT.month = #{month} |
| | | </if> |
| | | </where> |
| | | ORDER BY TT.month |
| | | </select> |
| | | </mapper> |
| | |
| | | </if> |
| | | order by sl.execution_date desc |
| | | </select> |
| | | <select id="selectPurchaseReportVoPage" resultType="com.ruoyi.purchase.vo.PurchaseReportVo"> |
| | | select sl.sales_contract_no customerContractNo, |
| | | c.customer_name, |
| | | sl.project_name, |
| | | sl.contract_amount contractAmount, |
| | | pl.contract_amount purchaseAmount, |
| | | sl.contract_amount-pl.contract_amount balance, |
| | | (sl.contract_amount-pl.contract_amount)/sl.contract_amount balanceRatio |
| | | from sales_ledger sl |
| | | left join purchase_ledger pl on sl.id = pl.sales_ledger_id |
| | | left join customer c on sl.customer_id = c.id |
| | | where 1=1 |
| | | <if test="customerName != null and customerName != '' "> |
| | | and c.customer_name like concat('%',#{customerName},'%') |
| | | </if> |
| | | </select> |
| | | |
| | | </mapper> |