Merge remote-tracking branch 'origin/master'
| | |
| | | create_user varchar(255) not null comment 'å½å
¥äºº', |
| | | update_user varchar(255) not null comment 'æ´æ°äºº', |
| | | tenant_id bigint not null comment 'ç§æ·id' |
| | | ); |
| | | ); |
| | | |
| | | |
| | | alter table purchase_ledger |
| | | add payment_method varchar(255) null; |
| | | alter table sales_ledger |
| | | add payment_method varchar(255) null; |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.common.enums; |
| | | |
| | | public enum FileNameType { |
| | | |
| | | SALE(1), // éå® |
| | | PURCHASE(2), // éè´ |
| | | INVOICE(3), //å票 |
| | | PURCHASELEDGER(4); // |
| | | |
| | | private final int value; |
| | | |
| | | FileNameType(int value) { |
| | | this.value = value; |
| | | } |
| | | |
| | | public int getValue() { |
| | | return value; |
| | | |
| | | } |
| | | |
| | | // æ ¹æ®æ´æ°å¼è·å对åºçæä¸¾å¼ |
| | | public static FileNameType fromValue(int value) { |
| | | for (FileNameType type : FileNameType.values()) { |
| | | if (type.getValue() == value) { |
| | | return type; |
| | | } |
| | | } |
| | | throw new IllegalArgumentException("Invalid value: " + value); |
| | | } |
| | | } |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.common.enums; |
| | | |
| | | |
| | | public enum SalesLedgerType { |
| | | SALES_LEDGER_TYPE_SALES_LEDGER(1, "éå®å°è´¦"), |
| | | SALES_LEDGER_TYPE_PURCHASE_LEDGER(2, "éè´å°è´¦"); |
| | | |
| | | private final Integer value; |
| | | private final String label; |
| | | |
| | | SalesLedgerType(Integer value, String label) { |
| | | this.value = value; |
| | | this.label = label; |
| | | } |
| | | |
| | | public Integer getValue() { |
| | | return value; |
| | | } |
| | | |
| | | public String getLabel() { |
| | | return label; |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®å¼è·å对åºçæä¸¾ |
| | | */ |
| | | public static SalesLedgerType fromValue(Integer value) { |
| | | for (SalesLedgerType type : values()) { |
| | | if (type.getValue().equals(value)) { |
| | | return type; |
| | | } |
| | | } |
| | | throw new IllegalArgumentException("æªç¥ç SalesLedgerType å¼: " + value); |
| | | } |
| | | } |
| | |
| | | import org.apache.commons.lang3.ArrayUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.ArrayList; |
| | |
| | | deviceLedgerService.export(response, ids); |
| | | } |
| | | |
| | | @PostMapping("import") |
| | | @ApiModelProperty("导å
¥è®¾å¤å°è´¦") |
| | | public AjaxResult importData(MultipartFile file) { |
| | | Boolean b = deviceLedgerService.importData(file); |
| | | if (b) { |
| | | return AjaxResult.success("导å
¥æå"); |
| | | } |
| | | return AjaxResult.error("导å
¥å¤±è´¥"); |
| | | } |
| | | |
| | | |
| | | @GetMapping("getDeviceLedger") |
| | | @ApiModelProperty("è·å设å¤å°è´¦") |
| | | public AjaxResult getDeviceLedger( ) { |
| | |
| | | import com.ruoyi.device.dto.DeviceLedgerDto; |
| | | import com.ruoyi.device.pojo.DeviceLedger; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.ArrayList; |
| | |
| | | AjaxResult updateDeviceLedger(DeviceLedger deviceLedger); |
| | | |
| | | void export(HttpServletResponse response, Long[] ids); |
| | | |
| | | Boolean importData(MultipartFile file); |
| | | } |
| | |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.ArrayList; |
| | |
| | | } |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public Boolean importData(MultipartFile file) { |
| | | return null; |
| | | } |
| | | } |
| | |
| | | private TempFileService tempFileService; |
| | | |
| | | @PostMapping("/upload") |
| | | public AjaxResult uploadFile(MultipartFile file, String type) { |
| | | public AjaxResult uploadFile(MultipartFile file, Integer type) { |
| | | try { |
| | | return AjaxResult.success(tempFileService.uploadFile(file, type)); |
| | | } catch (Exception e) { |
| | |
| | | private String originalName; // åå§æä»¶å |
| | | private String tempPath; // 临æ¶åå¨è·¯å¾ |
| | | private LocalDateTime expireTime; // è¿ææ¶é´ |
| | | private String type; // å
³è表类å |
| | | private Integer type; // å
³è表类å |
| | | } |
| | |
| | | import java.io.IOException; |
| | | |
| | | public interface TempFileService { |
| | | TempFile uploadFile(MultipartFile file,String type) throws IOException; |
| | | TempFile uploadFile(MultipartFile file,Integer type) throws IOException; |
| | | } |
| | |
| | | |
| | | // ä¸ä¼ å°ä¸´æ¶ç®å½ |
| | | @Override |
| | | public TempFile uploadFile(MultipartFile file,String type) throws IOException { |
| | | public TempFile uploadFile(MultipartFile file,Integer type) throws IOException { |
| | | // 1. çæä¸´æ¶æä»¶IDåè·¯å¾ |
| | | String tempId = UUID.randomUUID().toString(); |
| | | Path tempFilePath = Paths.get(tempDir, tempId + "_" + file.getOriginalFilename()); |
| | |
| | | } |
| | | |
| | | @PostMapping("/upload") |
| | | public AjaxResult uploadFile(MultipartFile file, Long id, String type) { |
| | | public AjaxResult uploadFile(MultipartFile file, Long id, Integer type) { |
| | | try { |
| | | return AjaxResult.success(commonFileService.uploadFile(file, id, type)); |
| | | } catch (Exception e) { |
| | |
| | | * æ¥è¯¢éè´å°è´¦å表 |
| | | */ |
| | | @GetMapping("/listPage") |
| | | public IPage<PurchaseLedger> listPage(Page page, PurchaseLedger purchaseLedger) { |
| | | return purchaseLedgerService.selectPurchaseLedgerListPage(page ,purchaseLedger); |
| | | public AjaxResult listPage(Page page, PurchaseLedgerDto purchaseLedger) { |
| | | return AjaxResult.success(purchaseLedgerService.selectPurchaseLedgerListPage(page ,purchaseLedger)); |
| | | } |
| | | |
| | | @ApiOperation("çæéè´åºåå·") |
| | |
| | | import com.ruoyi.purchase.service.IProductRecordService; |
| | | import com.ruoyi.purchase.service.ITicketRegistrationService; |
| | | import com.ruoyi.sales.service.ICommonFileService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.web.bind.annotation.*; |
| | |
| | | @RestController |
| | | @RequestMapping("/purchase/registration") |
| | | @AllArgsConstructor |
| | | @Api(tags = "æ¥ç¥¨ç»è®°") |
| | | public class TicketRegistrationController extends BaseController { |
| | | |
| | | private ITicketRegistrationService ticketRegistrationService; |
| | |
| | | } |
| | | |
| | | @PostMapping("/upload") |
| | | public AjaxResult uploadFile(MultipartFile file, Long id, String type) { |
| | | public AjaxResult uploadFile(MultipartFile file, Long id, Integer type) { |
| | | try { |
| | | return AjaxResult.success(commonFileService.uploadFile(file, id, type)); |
| | | } catch (Exception e) { |
| | |
| | | public IPage<TicketRegistration> listPage(Page page, TicketRegistration ticketRegistration) { |
| | | return ticketRegistrationService.selectTicketRegistrationListPage(page,ticketRegistration); |
| | | } |
| | | |
| | | @ApiModelProperty("æ ¹æ®idæ¥è¯¢æ¥æ¼ç»è®°") |
| | | @GetMapping("/getPuargeById") |
| | | public AjaxResult getPuargeById(Long id) { |
| | | return AjaxResult.success(ticketRegistrationService.getPuargeById( id)); |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | package com.ruoyi.purchase.dto; |
| | | |
| | | import com.ruoyi.purchase.pojo.ProductRecord; |
| | | import com.ruoyi.sales.pojo.CommonFile; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | public class ProductRecordDto extends ProductRecord { |
| | |
| | | private String invoiceNumber; |
| | | |
| | | private String unTicketsPrice; |
| | | |
| | | private List<CommonFile> commonFiles; |
| | | } |
| | |
| | | package com.ruoyi.purchase.dto; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.ruoyi.sales.pojo.CommonFile; |
| | | import com.ruoyi.sales.pojo.SalesLedgerProduct; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | |
| | | */ |
| | | private Long ticketRegistrationId; |
| | | |
| | | /** |
| | | * ååéé¢ï¼äº§åå«ç¨æ»ä»·ï¼ |
| | | */ |
| | | private BigDecimal contractAmount = BigDecimal.ZERO; |
| | | |
| | | |
| | | @TableField(exist = false) |
| | | @ApiModelProperty("æ¥ç¥¨éé¢") |
| | | private BigDecimal receiptPaymentAmount = BigDecimal.ZERO; |
| | | |
| | | @ApiModelProperty("æªæ¥ç¥¨éé¢") |
| | | @TableField(exist = false) |
| | | private BigDecimal unReceiptPaymentAmount =BigDecimal.ZERO; |
| | | |
| | | @ApiModelProperty("æä»¶ç±»å å 4") |
| | | @TableField(exist = false) |
| | | private Integer type; |
| | | |
| | | |
| | | @ApiModelProperty(value = "仿¬¾æ¹å¼") |
| | | private String paymentMethod; |
| | | |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.ruoyi.purchase.dto.PurchaseLedgerDto; |
| | | import com.ruoyi.purchase.pojo.PurchaseLedger; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | |
| | | |
| | | int updateContractAmountById(@Param("id") Long id, @Param("totalTaxInclusiveAmount") BigDecimal totalTaxInclusiveAmount); |
| | | |
| | | IPage<PurchaseLedger> selectPurchaseLedgerListPage(IPage ipage, @Param("c") PurchaseLedger purchaseLedger); |
| | | IPage<PurchaseLedgerDto> selectPurchaseLedgerListPage(IPage ipage, @Param("c") PurchaseLedgerDto purchaseLedger); |
| | | } |
| | |
| | | @TableField(exist = false) |
| | | private String unReceiptPaymentAmount; |
| | | |
| | | @ApiModelProperty("æä»¶ç±»å å 4") |
| | | @TableField(exist = false) |
| | | private Integer type; |
| | | |
| | | |
| | | |
| | | @ApiModelProperty(value = "仿¬¾æ¹å¼") |
| | | private String paymentMethod; |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | PurchaseLedgerDto getPurchaseNoById(Long id); |
| | | |
| | | IPage<PurchaseLedger> selectPurchaseLedgerListPage(IPage ipage, PurchaseLedger purchaseLedger); |
| | | IPage<PurchaseLedgerDto> selectPurchaseLedgerListPage(IPage ipage, PurchaseLedgerDto purchaseLedger); |
| | | |
| | | List<InvoiceRegistrationProduct> getProductBySalesNo(Long id); |
| | | |
| | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.purchase.dto.PurchaseLedgerDto; |
| | | import com.ruoyi.purchase.dto.TicketRegistrationDto; |
| | | import com.ruoyi.purchase.pojo.TicketRegistration; |
| | | |
| | |
| | | List getTicketNo(TicketRegistrationDto ticketRegistrationDto); |
| | | |
| | | IPage<TicketRegistration> selectTicketRegistrationListPage(Page page, TicketRegistration ticketRegistration); |
| | | |
| | | PurchaseLedgerDto getPuargeById(Long id); |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.enums.FileNameType; |
| | | import com.ruoyi.common.utils.bean.BeanUtils; |
| | | import com.ruoyi.other.mapper.TempFileMapper; |
| | | import com.ruoyi.project.system.domain.SysUser; |
| | |
| | | // æ¹éæ¥è¯¢è¿äºå票å
³èçæä»¶ä¿¡æ¯ |
| | | LambdaQueryWrapper<CommonFile> fileQueryWrapper = new LambdaQueryWrapper<>(); |
| | | fileQueryWrapper.in(CommonFile::getCommonId, invoiceIds) |
| | | .eq(CommonFile::getType,"3"); |
| | | .eq(CommonFile::getType, FileNameType.INVOICE.getValue()); |
| | | List<CommonFile> fileList = commonFileMapper.selectList(fileQueryWrapper); |
| | | |
| | | // å°æä»¶ä¿¡æ¯æ å°å°å¯¹åºçå票ID |
| | |
| | | // æ¥è¯¢ä¸ä¼ æä»¶ |
| | | LambdaQueryWrapper<CommonFile> commonFileLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | | commonFileLambdaQueryWrapper.eq(CommonFile::getCommonId, invoicePurchaseDto.getId()) |
| | | .eq(CommonFile::getType, "3"); |
| | | .eq(CommonFile::getType, FileNameType.INVOICE.getValue()); |
| | | List<CommonFile> commonFiles = commonFileMapper.selectList(commonFileLambdaQueryWrapper); |
| | | resultDto.setCommonFiles(commonFiles); |
| | | return resultDto; |
| | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.enums.FileNameType; |
| | | import com.ruoyi.purchase.dto.ProductRecordDto; |
| | | import com.ruoyi.purchase.dto.TicketRegistrationDto; |
| | | import com.ruoyi.purchase.mapper.ProductRecordMapper; |
| | | import com.ruoyi.purchase.pojo.ProductRecord; |
| | | import com.ruoyi.purchase.service.IProductRecordService; |
| | | import com.ruoyi.sales.mapper.CommonFileMapper; |
| | | import com.ruoyi.sales.pojo.CommonFile; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | |
| | | @AllArgsConstructor |
| | | public class ProductRecordServiceImpl extends ServiceImpl<ProductRecordMapper, ProductRecord> implements IProductRecordService { |
| | | |
| | | @Autowired |
| | | private ProductRecordMapper productRecordMapper; |
| | | |
| | | @Autowired |
| | | private CommonFileMapper commonFileMapper; |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | |
| | | |
| | | @Override |
| | | public IPage<ProductRecordDto> productRecordPage(Page page, TicketRegistrationDto ticketRegistrationDto) { |
| | | |
| | | return productRecordMapper.productRecordPage(page, ticketRegistrationDto); |
| | | IPage<ProductRecordDto> productRecordDtoIPage = productRecordMapper.productRecordPage(page, ticketRegistrationDto); |
| | | productRecordDtoIPage.getRecords().forEach(productRecordDto -> { |
| | | productRecordDto.setCommonFiles(commonFileMapper.selectList(new LambdaQueryWrapper<CommonFile>().eq(CommonFile::getCommonId, productRecordDto.getTicketRegistrationId()) |
| | | .eq(CommonFile::getType, FileNameType.PURCHASELEDGER.getValue()))); |
| | | }); |
| | | return productRecordDtoIPage; |
| | | } |
| | | |
| | | } |
| | |
| | | import com.ruoyi.basic.pojo.Product; |
| | | import com.ruoyi.basic.pojo.ProductModel; |
| | | import com.ruoyi.basic.pojo.SupplierManage; |
| | | import com.ruoyi.common.enums.FileNameType; |
| | | import com.ruoyi.common.exception.base.BaseException; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | |
| | | fileRecord.setName(originalFilename); |
| | | fileRecord.setUrl(formalFilePath.toString()); |
| | | fileRecord.setCreateTime(LocalDateTime.now()); |
| | | fileRecord.setType("2"); |
| | | fileRecord.setType(FileNameType.PURCHASE.getValue()); |
| | | commonFileMapper.insert(fileRecord); |
| | | |
| | | // å é¤ä¸´æ¶æä»¶è®°å½ |
| | |
| | | // æ¹éå é¤å
³èçéè´å°è´¦äº§å |
| | | LambdaQueryWrapper<SalesLedgerProduct> queryWrapper = new LambdaQueryWrapper<>(); |
| | | queryWrapper.in(SalesLedgerProduct::getSalesLedgerId, ids) |
| | | .eq(SalesLedgerProduct::getType, "2"); |
| | | .eq(SalesLedgerProduct::getType, 2); |
| | | salesLedgerProductMapper.delete(queryWrapper); |
| | | // æ¹éå é¤å
³èçéè´å°è´¦çæ¥ç¥¨ç»è®° |
| | | LambdaQueryWrapper<TicketRegistration> ticketRegistrationLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | |
| | | } |
| | | // å建并填å
DTO |
| | | PurchaseLedgerDto resultDto = new PurchaseLedgerDto(); |
| | | resultDto.setSalesLedgerId(purchaseLedger.getSalesLedgerId()); |
| | | resultDto.setSalesContractNoId(purchaseLedger.getSalesLedgerId()); |
| | | resultDto.setSalesContractNo(purchaseLedger.getSalesContractNo()); |
| | | resultDto.setSupplierName(purchaseLedger.getSupplierName()); |
| | |
| | | public PurchaseLedgerDto getPurchaseNoById(Long id) { |
| | | PurchaseLedgerDto purchaseLedgerDto = new PurchaseLedgerDto(); |
| | | PurchaseLedger purchaseLedger = purchaseLedgerMapper.selectById(id); |
| | | |
| | | BeanUtils.copyProperties(purchaseLedger, purchaseLedgerDto); |
| | | // TicketRegistration ticketRegistration = ticketRegistrationMapper.selectOne(new LambdaQueryWrapper<TicketRegistration>().eq(TicketRegistration::getPurchaseLedgerId, id)); |
| | | // if (ticketRegistration != null) { |
| | |
| | | } |
| | | |
| | | @Override |
| | | public IPage<PurchaseLedger> selectPurchaseLedgerListPage(IPage ipage, PurchaseLedger purchaseLedger) { |
| | | |
| | | return purchaseLedgerMapper.selectPurchaseLedgerListPage(ipage, purchaseLedger); |
| | | public IPage<PurchaseLedgerDto> selectPurchaseLedgerListPage(IPage ipage, PurchaseLedgerDto purchaseLedger) { |
| | | IPage<PurchaseLedgerDto> purchaseLedgerDtoIPage = purchaseLedgerMapper.selectPurchaseLedgerListPage(ipage, purchaseLedger); |
| | | purchaseLedgerDtoIPage.getRecords().forEach(purchaseLedgerDto -> { |
| | | List<CommonFile> commonFiles = commonFileMapper.selectList(new LambdaQueryWrapper<CommonFile>().eq(CommonFile::getCommonId, purchaseLedgerDto.getId()).eq(CommonFile::getType, FileNameType.PURCHASELEDGER.getValue())); |
| | | purchaseLedgerDto.setSalesLedgerFiles(commonFiles); |
| | | }); |
| | | return purchaseLedgerDtoIPage; |
| | | } |
| | | |
| | | @Override |
| | |
| | | import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.enums.FileNameType; |
| | | import com.ruoyi.common.enums.SalesLedgerType; |
| | | import com.ruoyi.common.exception.base.BaseException; |
| | | import com.ruoyi.common.utils.DateUtils; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | |
| | | import com.ruoyi.other.mapper.TempFileMapper; |
| | | import com.ruoyi.other.pojo.TempFile; |
| | | import com.ruoyi.purchase.dto.PaymentRegistrationDto; |
| | | import com.ruoyi.purchase.dto.PurchaseLedgerDto; |
| | | import com.ruoyi.purchase.dto.TicketRegistrationDto; |
| | | import com.ruoyi.purchase.mapper.PaymentRegistrationMapper; |
| | | import com.ruoyi.purchase.mapper.ProductRecordMapper; |
| | |
| | | import com.ruoyi.sales.mapper.SalesLedgerProductMapper; |
| | | import com.ruoyi.sales.pojo.CommonFile; |
| | | import com.ruoyi.sales.pojo.SalesLedgerProduct; |
| | | import com.ruoyi.sales.service.ISalesLedgerProductService; |
| | | import com.ruoyi.sales.service.impl.SalesLedgerProductServiceImpl; |
| | | import lombok.RequiredArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.io.FilenameUtils; |
| | |
| | | private final TempFileMapper tempFileMapper; |
| | | |
| | | private final ProductRecordMapper productRecordMapper; |
| | | |
| | | @Autowired |
| | | private ISalesLedgerProductService salesLedgerProductService; |
| | | |
| | | @Autowired |
| | | private PaymentRegistrationMapper paymentRegistrationMapper; |
| | |
| | | queryWrapper.like(TicketRegistration::getPurchaseContractNumber, ticketRegistration.getPurchaseContractNumber()) |
| | | .like(TicketRegistration::getSupplierName, ticketRegistration.getSupplierName()); |
| | | } |
| | | if (!ObjectUtils.isEmpty(ticketRegistration.getIssueDateStart())&&!ObjectUtils.isEmpty(ticketRegistration.getIssueDateEnd())) { |
| | | queryWrapper.between(TicketRegistration::getIssueDate,LocalDate.parse(ticketRegistration.getIssueDateStart(), DateTimeFormatter.ofPattern("yyyy-MM-dd")), LocalDate.parse(ticketRegistration.getIssueDateEnd(), DateTimeFormatter.ofPattern("yyyy-MM-dd"))); |
| | | if (!ObjectUtils.isEmpty(ticketRegistration.getIssueDateStart()) && !ObjectUtils.isEmpty(ticketRegistration.getIssueDateEnd())) { |
| | | queryWrapper.between(TicketRegistration::getIssueDate, LocalDate.parse(ticketRegistration.getIssueDateStart(), DateTimeFormatter.ofPattern("yyyy-MM-dd")), LocalDate.parse(ticketRegistration.getIssueDateEnd(), DateTimeFormatter.ofPattern("yyyy-MM-dd"))); |
| | | } |
| | | IPage<TicketRegistration> ticketRegistrationIPage = ticketRegistrationMapper.selectPage(page, queryWrapper); |
| | | // 计ç®å·²ä»æ¬¾éé¢ |
| | |
| | | return ticketRegistrationIPage; |
| | | } |
| | | |
| | | @Override |
| | | public PurchaseLedgerDto getPuargeById(Long id) { |
| | | PurchaseLedger purchaseLedger = purchaseLedgerMapper.selectById(id); |
| | | PurchaseLedgerDto purchaseLedgerDto = new PurchaseLedgerDto(); |
| | | BeanUtils.copyProperties(purchaseLedger, purchaseLedgerDto); |
| | | SalesLedgerProduct salesLedgerProduct = new SalesLedgerProduct(); |
| | | salesLedgerProduct.setSalesLedgerId(id); |
| | | salesLedgerProduct.setType(SalesLedgerType.SALES_LEDGER_TYPE_SALES_LEDGER.getValue()); |
| | | List<SalesLedgerProduct> salesLedgerProducts = salesLedgerProductService.selectSalesLedgerProductList(salesLedgerProduct); |
| | | purchaseLedgerDto.setProductData(salesLedgerProducts); |
| | | List<CommonFile> commonFiles = commonFileMapper.selectList(new LambdaQueryWrapper<CommonFile>() |
| | | .eq(CommonFile::getType, FileNameType.PURCHASELEDGER.getValue()) |
| | | .eq(CommonFile::getCommonId, id)); |
| | | purchaseLedgerDto.setSalesLedgerFiles(commonFiles); |
| | | return purchaseLedgerDto; |
| | | } |
| | | |
| | | private void handleSalesLedgerProducts(Long salesLedgerId, List<SalesLedgerProduct> products, Integer type) { |
| | | if (products == null || products.isEmpty()) { |
| | | return; |
| | |
| | | * æ¥è¯¢äº§åä¿¡æ¯å表 |
| | | */ |
| | | @GetMapping("/list") |
| | | public List<SalesLedgerProduct> list(SalesLedgerProduct salesLedgerProduct) |
| | | public AjaxResult list(SalesLedgerProduct salesLedgerProduct) |
| | | { |
| | | List<SalesLedgerProduct> list = salesLedgerProductService.selectSalesLedgerProductList(salesLedgerProduct); |
| | | return list; |
| | | return AjaxResult.success(list); |
| | | } |
| | | |
| | | /** |
| | |
| | | private LocalDate executionDate; |
| | | |
| | | private Boolean status; |
| | | |
| | | @ApiModelProperty(value = "仿¬¾æ¹å¼") |
| | | private String paymentMethod; |
| | | } |
| | |
| | | private String url; |
| | | |
| | | /** å
³è表 */ |
| | | private String type; |
| | | private Integer type; |
| | | |
| | | /** å建æ¶é´ */ |
| | | @TableField(fill = FieldFill.INSERT) |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.sales.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.FieldFill; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.time.LocalDateTime; |
| | | |
| | | @Data |
| | | public class PurchaseLedgerFile { |
| | | |
| | | @ApiModelProperty(value = "æä»¶åç§°") |
| | | private String name; |
| | | |
| | | @ApiModelProperty(value = "æä»¶è·¯å¾") |
| | | private String url; |
| | | |
| | | @ApiModelProperty(value = "æä»¶å¤§å°") |
| | | private int fileSize; |
| | | |
| | | @ApiModelProperty(value = "å¼ç¥¨å°è´¦ID") |
| | | private Integer purchaseLedgerId; |
| | | |
| | | @ApiModelProperty(value = "å建æ¶é´") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private LocalDateTime createTime; |
| | | |
| | | @ApiModelProperty(value = "ä¿®æ¹æ¶é´") |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private LocalDateTime updateTime; |
| | | |
| | | @ApiModelProperty(value = "åå»ºç¨æ·") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Integer createUser; |
| | | |
| | | @ApiModelProperty(value = "ä¿®æ¹ç¨æ·") |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private Integer updateUser; |
| | | |
| | | @ApiModelProperty(value = "ç§æ·ID") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Long tenantId; |
| | | } |
| | |
| | | @TableField(exist = false) |
| | | @ApiModelProperty(value = "å·²å¼ç¥¨éé¢(å
)") |
| | | private BigDecimal invoiceTotal; |
| | | |
| | | @ApiModelProperty(value = "仿¬¾æ¹å¼") |
| | | private String paymentMethod; |
| | | } |
| | | |
| | |
| | | |
| | | int deleteSalesLedgerByIds(Long[] ids); |
| | | |
| | | CommonFile uploadFile(MultipartFile file, Long id, String type) throws IOException; |
| | | CommonFile uploadFile(MultipartFile file, Long id, Integer type) throws IOException; |
| | | |
| | | int delCommonFileByIds(Long[] ids); |
| | | } |
| | |
| | | } |
| | | |
| | | @Override |
| | | public CommonFile uploadFile(MultipartFile file, Long id, String type) throws IOException { |
| | | public CommonFile uploadFile(MultipartFile file, Long id, Integer type) throws IOException { |
| | | // 1. çææ£å¼æä»¶IDåè·¯å¾ |
| | | String tempId = UUID.randomUUID().toString(); |
| | | Path tempFilePath = Paths.get(uploadDir, tempId + "_" + file.getOriginalFilename()); |
| | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.basic.mapper.CustomerMapper; |
| | | import com.ruoyi.basic.pojo.Customer; |
| | | import com.ruoyi.common.enums.FileNameType; |
| | | import com.ruoyi.common.exception.base.BaseException; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | |
| | | fileRecord.setName(originalFilename); |
| | | fileRecord.setUrl(formalFilePath.toString()); |
| | | fileRecord.setCreateTime(LocalDateTime.now()); |
| | | fileRecord.setType("1"); |
| | | //éå® |
| | | fileRecord.setType(FileNameType.SALE.getValue()); |
| | | commonFileMapper.insert(fileRecord); |
| | | |
| | | // å é¤ä¸´æ¶æä»¶è®°å½ |
| | |
| | | |
| | | <select id="productRecordPage" resultType="com.ruoyi.purchase.dto.ProductRecordDto"> |
| | | SELECT |
| | | distinct |
| | | sl.sales_contract_no, |
| | | sl.customer_contract_no, |
| | | sl.customer_name, |
| | |
| | | tr.invoice_number, |
| | | ROUND(pr.tickets_amount/(1+pr.tax_rate/100),2 ) as un_tickets_price, |
| | | ROUND(pr.tickets_amount-pr.tickets_amount/(1+pr.tax_rate/100),2 )as invoice_amount |
| | | |
| | | FROM product_record pr |
| | | left join purchase_ledger pl on pl.id = pr.purchase_ledger_id |
| | | left join sales_ledger sl on sl.id = pl.sales_ledger_id |
| | | left join ticket_registration tr on tr.purchase_ledger_id = pl.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 |
| | | <if test="c.salesContractNo != null and c.salesContractNo != ''"> |
| | |
| | | SET contract_amount = #{totalTaxInclusiveAmount} |
| | | WHERE id = #{id} |
| | | </update> |
| | | <select id="selectPurchaseLedgerListPage" resultType="com.ruoyi.purchase.pojo.PurchaseLedger"> |
| | | <select id="selectPurchaseLedgerListPage" resultType="com.ruoyi.purchase.dto.PurchaseLedgerDto"> |
| | | select |
| | | pl.id, |
| | | pl.purchase_contract_number , |