| | |
| | | @ApiModelProperty(value = "ä¿®æ¹ç¨æ·") |
| | | private Integer updateUser; |
| | | |
| | | private Integer id; |
| | | private Long id; |
| | | } |
| | |
| | | @Autowired |
| | | private ProcurementRecordService procurementRecordService; |
| | | |
| | | |
| | | @GetMapping("/productlist") |
| | | @Log(title = "éè´å
¥åº-å
¥åºç®¡ç-æ°å¢å
¥åºæ¥è¯¢", businessType = BusinessType.OTHER) |
| | | public AjaxResult list(ProcurementDto procurementDto) { |
| | |
| | | private Integer id; // 产åid |
| | | private BigDecimal inboundQuantity; // å
¥åºæ°é |
| | | private BigDecimal warnNum; // é¢è¦æ°éï¼éè´å
¥åºææï¼ |
| | | //åä»· |
| | | private BigDecimal unitPrice; |
| | | private BigDecimal totalPrice; |
| | | } |
| | |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Excel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | |
| | | @Excel(name = "å
¥åºæ°é") |
| | | private BigDecimal inboundNum; |
| | | |
| | | /** |
| | | * å
¥åºåä»· |
| | | */ |
| | | @ApiModelProperty(value = "å
¥åºåä»·") |
| | | @Excel(name = "å
¥åºåä»·") |
| | | private BigDecimal unitPrice; |
| | | |
| | | /** |
| | | * å
¥åºæ»ä»· |
| | | */ |
| | | @ApiModelProperty(value = "å
¥åºæ»ä»·") |
| | | @Excel(name = "å
¥åºæ»ä»·") |
| | | private BigDecimal totalPrice; |
| | | |
| | | @Excel(name = "é¢è¦æ°é") |
| | | private BigDecimal warnNum; |
| | | |
| | |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Excel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | |
| | | private BigDecimal inboundNum; |
| | | |
| | | /** |
| | | * å
¥åºåä»· |
| | | */ |
| | | @ApiModelProperty(value = "å
¥åºåä»·") |
| | | @Excel(name = "å
¥åºåä»·") |
| | | private BigDecimal unitPrice; |
| | | |
| | | /** |
| | | * å
¥åºæ»ä»· |
| | | */ |
| | | @ApiModelProperty(value = "å
¥åºæ»ä»·") |
| | | @Excel(name = "å
¥åºæ»ä»·") |
| | | private BigDecimal totalPrice; |
| | | |
| | | /** |
| | | * å¾
åºåºæ°é |
| | | */ |
| | | @Excel(name = "å¾
åºåºæ°é") |
| | |
| | | * åºåºæ°é |
| | | */ |
| | | @Excel(name = "åºåºæ°é") |
| | | private BigDecimal totalInboundNum; |
| | | private BigDecimal totalInboundNum = BigDecimal.ZERO; |
| | | |
| | | /** |
| | | * æä½åºåæ°é |
| | |
| | | private BigDecimal inboundNum; |
| | | |
| | | /** |
| | | * åä»· |
| | | */ |
| | | @Excel(name = "åä»·") |
| | | private BigDecimal unitPrice; |
| | | |
| | | /** |
| | | * æ»ä»· |
| | | */ |
| | | @Excel(name = "æ»ä»·") |
| | | private BigDecimal totalPrice; |
| | | |
| | | /** |
| | | * åºå
¥åºæ¶é´ |
| | | */ |
| | | // @Excel(name = "åºåºæ¶é´") |
| | |
| | | @Excel(name = "ä¸å«ç¨æ»ä»·") |
| | | private BigDecimal taxExclusiveTotalPrice; |
| | | |
| | | /** |
| | | * ç©åç±»å |
| | | */ |
| | | private String itemType; |
| | | } |
| | |
| | | |
| | | private List<Integer> ids; |
| | | |
| | | /** |
| | | * åºåºç±»å 1-éè´ 2-éå® 3-èªå®ä¹ |
| | | */ |
| | | private Integer type; |
| | | |
| | | } |
| | |
| | | package com.ruoyi.procurementrecord.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.procurementrecord.pojo.CustomStorage; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | /** |
| | | * @author :yys |
| | | * @date : 2025/11/10 13:11 |
| | | */ |
| | | public interface CustomStorageMapper extends BaseMapper<CustomStorage> { |
| | | IPage<CustomStorage> listPageCopyByCustom(Page page,@Param("req") CustomStorage customStorageLambdaQueryWrapper); |
| | | } |
| | |
| | | */ |
| | | @Excel(name = "åºåºæ°é") |
| | | @TableField(exist = false) |
| | | private BigDecimal totalInboundNum; |
| | | private BigDecimal totalInboundNum = BigDecimal.ZERO; |
| | | // ç©åç±»å |
| | | @Excel(name = "ç©åç±»å") |
| | | private String itemType; |
| | |
| | | package com.ruoyi.procurementrecord.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Excel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Builder; |
| | | import lombok.Data; |
| | | |
| | |
| | | */ |
| | | private BigDecimal inboundNum; |
| | | |
| | | |
| | | /** |
| | | * åºåºç±»å 1-éè´ 2-éå® 3-èªå®ä¹ |
| | | */ |
| | |
| | | private BigDecimal inboundNum; |
| | | |
| | | /** |
| | | * åä»· |
| | | */ |
| | | private BigDecimal unitPrice; |
| | | |
| | | /** |
| | | * æ»ä»· |
| | | */ |
| | | private BigDecimal totalPrice; |
| | | |
| | | /** |
| | | * é¢è¦æ°é |
| | | */ |
| | | private BigDecimal warnNum; |
| | |
| | | procurementRecordMapper.deleteBatchIds(procurementRecordStorageById.stream().map(ProcurementRecordStorage::getId).collect(Collectors.toList())); |
| | | // å 餿æå¯¹åºçåºåºè®°å½ |
| | | LambdaQueryWrapper<ProcurementRecordOut> procurementRecordOutLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | | procurementRecordOutLambdaQueryWrapper.in(ProcurementRecordOut::getProcurementRecordStorageId, procurementDto.getIds()); |
| | | procurementRecordOutLambdaQueryWrapper.in(ProcurementRecordOut::getProcurementRecordStorageId, procurementDto.getIds()) |
| | | .eq(ProcurementRecordOut::getType,procurementDto.getType()); |
| | | List<ProcurementRecordOut> procurementRecordOuts = procurementRecordOutMapper.selectList(procurementRecordOutLambdaQueryWrapper); |
| | | if(!CollectionUtils.isEmpty(procurementRecordOuts)){ |
| | | procurementRecordOutMapper.deleteBatchIds(procurementRecordOuts.stream().map(ProcurementRecordOut::getId).collect(Collectors.toList())); |
| | |
| | | // å¦ææ²¡æç¸å
³çåºåºè®°å½ï¼è·³è¿è¯¥æ¡æ°æ® |
| | | if(CollectionUtils.isEmpty(collect1)){ |
| | | dto.setInboundNum0(dto.getInboundNum()); |
| | | dto.setTotalInboundNum(BigDecimal.ZERO); |
| | | continue; |
| | | } |
| | | |
| | |
| | | dto.setTotalInboundNum(totalInboundNum); |
| | | // å¾
åºåºæ°é = æ»æ°é - å·²åºåºæ°é |
| | | dto.setInboundNum0(dto.getInboundNum().subtract(totalInboundNum)); |
| | | // åºåä»·å¼ |
| | | if(dto.getUnitPrice() != null){ |
| | | dto.setTotalPrice(dto.getTotalInboundNum().multiply(dto.getUnitPrice())); |
| | | } |
| | | } |
| | | return procurementPageDtoCopyIPage; |
| | | } |
| | | |
| | | @Override |
| | | public IPage<CustomStorage> listPageCopyByCustom(Page page, CustomStorage customStorage) { |
| | | LambdaQueryWrapper<CustomStorage> customStorageLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | | customStorageLambdaQueryWrapper.groupBy(CustomStorage::getProductCategory, CustomStorage::getSpecificationModel); |
| | | if(customStorage != null){ |
| | | if(!StringUtils.isEmpty(customStorage.getSupplierName())){ |
| | | customStorageLambdaQueryWrapper.like(CustomStorage::getSupplierName, customStorage.getSupplierName()); |
| | | } |
| | | // çéå
¥åºæ¶é´ |
| | | if(customStorage.getInboundDate() != null){ |
| | | customStorageLambdaQueryWrapper.eq(CustomStorage::getInboundDate, customStorage.getInboundDate()); |
| | | } |
| | | if(!StringUtils.isEmpty(customStorage.getProductCategory())){ |
| | | customStorageLambdaQueryWrapper.like(CustomStorage::getProductCategory, customStorage.getProductCategory()); |
| | | } |
| | | } |
| | | customStorageLambdaQueryWrapper.orderByDesc(CustomStorage::getInboundDate); |
| | | IPage<CustomStorage> pageList = customStorageMapper.selectPage(page, customStorageLambdaQueryWrapper); |
| | | // LambdaQueryWrapper<CustomStorage> customStorageLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | | // customStorageLambdaQueryWrapper.groupBy(CustomStorage::getProductCategory, CustomStorage::getSpecificationModel,CustomStorage::getTaxInclusiveUnitPrice); |
| | | // if(customStorage != null){ |
| | | // if(!StringUtils.isEmpty(customStorage.getSupplierName())){ |
| | | // customStorageLambdaQueryWrapper.like(CustomStorage::getSupplierName, customStorage.getSupplierName()); |
| | | // } |
| | | // // çéå
¥åºæ¶é´ |
| | | // if(customStorage.getInboundDate() != null){ |
| | | // customStorageLambdaQueryWrapper.eq(CustomStorage::getInboundDate, customStorage.getInboundDate()); |
| | | // } |
| | | // if(!StringUtils.isEmpty(customStorage.getProductCategory())){ |
| | | // customStorageLambdaQueryWrapper.like(CustomStorage::getProductCategory, customStorage.getProductCategory()); |
| | | // } |
| | | // } |
| | | // customStorageLambdaQueryWrapper.orderByDesc(CustomStorage::getInboundDate); |
| | | IPage<CustomStorage> pageList = customStorageMapper.listPageCopyByCustom(page, customStorage); |
| | | |
| | | List<CustomStorage> procurementPageDtoCopyList = pageList.getRecords(); |
| | | // 计ç®å¾
å
¥åºæ°é |
| | | // æ¥è¯¢éè´è®°å½å·²å
¥åºæ°é |
| | |
| | | // å¦ææ²¡æç¸å
³çåºåºè®°å½ï¼è·³è¿è¯¥æ¡æ°æ® |
| | | if(CollectionUtils.isEmpty(collect1)){ |
| | | dto.setInboundNum0(dto.getInboundNum()); |
| | | dto.setTotalInboundNum(BigDecimal.ZERO); |
| | | continue; |
| | | } |
| | | |
| | |
| | | dto.setTotalInboundNum(totalInboundNum); |
| | | // å¾
åºåºæ°é = æ»æ°é - å·²åºåºæ°é |
| | | dto.setInboundNum0(dto.getInboundNum().subtract(totalInboundNum)); |
| | | // åºåä»·å¼ |
| | | if(dto.getTaxInclusiveUnitPrice() != null){ |
| | | dto.setTaxInclusiveTotalPrice(dto.getInboundNum0().multiply(dto.getTaxInclusiveUnitPrice())); |
| | | } |
| | | } |
| | | pageList.setRecords(procurementPageDtoCopyList); |
| | | return pageList; |
| | |
| | | .inboundNum(detail.getInboundQuantity()) |
| | | .type(procurementDto.getType()) |
| | | .warnNum(detail.getWarnNum()) |
| | | .unitPrice(detail.getUnitPrice()) |
| | | .totalPrice(detail.getInboundQuantity().multiply(detail.getUnitPrice())) |
| | | .createTime(LocalDateTime.now()) |
| | | .createUser(loginUser.getUserId()) |
| | | .updateTime(LocalDateTime.now()) |
| | |
| | | for (ProcurementPageDtoCopy dto : procurementPageDtoCopyList) { |
| | | // æ ¹æ®éè´å°è´¦IDçé对åºçåºåºè®°å½ |
| | | List<ProcurementRecordOut> collect1 = procurementRecords.stream() |
| | | .filter(ProcurementRecordOut -> ProcurementRecordOut.getProcurementRecordStorageId().equals(dto.getId())) |
| | | .filter(ProcurementRecordOut -> ProcurementRecordOut.getProcurementRecordStorageId().equals(dto.getId()) && ProcurementRecordOut.getType().equals(1)) |
| | | .collect(Collectors.toList()); |
| | | |
| | | // å¦ææ²¡æç¸å
³çåºåºè®°å½ï¼è·³è¿è¯¥æ¡æ°æ® |
| | | if(CollectionUtils.isEmpty(collect1)){ |
| | | dto.setInboundNum0(dto.getInboundNum()); |
| | | dto.setTotalInboundNum(BigDecimal.ZERO); |
| | | continue; |
| | | } |
| | | |
| | |
| | | dto.setTotalInboundNum(totalInboundNum); |
| | | // å¾
åºåºæ°é = æ»æ°é - å·²åºåºæ°é |
| | | dto.setInboundNum0(dto.getInboundNum().subtract(totalInboundNum)); |
| | | // åºåä»·å¼ |
| | | if(dto.getUnitPrice() != null){ |
| | | dto.setTotalPrice(dto.getInboundNum0().multiply(dto.getUnitPrice())); |
| | | } |
| | | } |
| | | return procurementPageDtoCopyIPage; |
| | | } |
| | |
| | | * çäº§çæº |
| | | */ |
| | | private String speculativeTradingName; |
| | | /** |
| | | * 产线 |
| | | */ |
| | | @ApiModelProperty(value = "产线") |
| | | private String productionLine; |
| | | |
| | | /** |
| | | * è§æ ¼åå· |
| | |
| | | @ApiModelProperty(value = "çäº§æ¥æ") |
| | | private String schedulingDate; |
| | | |
| | | |
| | | /** |
| | | * å
¥åºåä»· |
| | | */ |
| | | @ApiModelProperty(value = "å
¥åºåä»·") |
| | | private BigDecimal unitPrice; |
| | | |
| | | /** |
| | | * å
¥åºæ»ä»· |
| | | */ |
| | | @ApiModelProperty(value = "å
¥åºæ»ä»·") |
| | | private BigDecimal totalPrice; |
| | | } |
| | |
| | | @Excel(name = "çäº§çæº") |
| | | private String speculativeTradingName; |
| | | |
| | | @ApiModelProperty(value = "产线") |
| | | @Excel(name = "产线") |
| | | private String productionLine; |
| | | |
| | | @ApiModelProperty(value = "å¼å§æ¶é´") |
| | | private String entryDateStart; |
| | | |
| | |
| | | private String speculativeTradingName; |
| | | |
| | | /** |
| | | * 产线 |
| | | */ |
| | | private String productionLine; |
| | | |
| | | /** |
| | | * 派工人åç§° |
| | | */ |
| | | private String schedulingUserName; |
| | |
| | | i++; |
| | | continue; |
| | | } |
| | | String productionLine = ""; |
| | | switch (name.get()){ |
| | | case "çæº1": |
| | | productionLine = "产线1"; |
| | | break; |
| | | case "çæº2": |
| | | productionLine = "产线2"; |
| | | break; |
| | | case "çæº3": |
| | | productionLine = "产线3"; |
| | | break; |
| | | case "çæº4": |
| | | productionLine = "产线4"; |
| | | break; |
| | | } |
| | | SalesLedgerScheduling salesLedgerScheduling = SalesLedgerScheduling.builder() |
| | | .salesLedgerId(productionDispatchAddDto.getSalesLedgerId()) |
| | | .salesLedgerProductId(productionDispatchAddDto.getSalesLedgerProductId()) |
| | | .speculativeTradingName(name.get()) |
| | | .productionLine(productionLine) |
| | | .schedulingUserId(sysUser.getUserId()) |
| | | .schedulingUserName(sysUser.getNickName()) |
| | | .schedulingNum(productionDispatchAddDto.getSchedulingNum()) |
| | |
| | | Details details1 = new Details(); |
| | | details1.setInboundQuantity(productionReportDto.getFinishedNum()); |
| | | details1.setId(Integer.parseInt(salesLedgerWork.getSalesLedgerProductId().toString())); |
| | | details1.setUnitPrice(productionReportDto.getUnitPrice()); |
| | | details1.setTotalPrice(productionReportDto.getTotalPrice()); |
| | | details.add(details1); |
| | | procurementRecordOutAdd.setDetails(details); |
| | | procurementRecordService.add(procurementRecordOutAdd); |
| | |
| | | import com.ruoyi.project.system.domain.SysUser; |
| | | import com.ruoyi.project.system.mapper.SysUserMapper; |
| | | import com.ruoyi.purchase.dto.PurchaseLedgerDto; |
| | | import com.ruoyi.purchase.mapper.PaymentRegistrationMapper; |
| | | import com.ruoyi.purchase.mapper.ProductRecordMapper; |
| | | import com.ruoyi.purchase.mapper.PurchaseLedgerMapper; |
| | | import com.ruoyi.purchase.mapper.TicketRegistrationMapper; |
| | | import com.ruoyi.purchase.pojo.PaymentRegistration; |
| | | import com.ruoyi.purchase.pojo.ProductRecord; |
| | | import com.ruoyi.purchase.pojo.PurchaseLedger; |
| | | import com.ruoyi.purchase.pojo.TicketRegistration; |
| | |
| | | private final TicketRegistrationMapper ticketRegistrationMapper; |
| | | |
| | | private final ProductRecordMapper productRecordMapper; |
| | | |
| | | private final PaymentRegistrationMapper paymentRegistrationMapper; |
| | | |
| | | private final InvoiceRegistrationProductMapper invoiceRegistrationProductMapper; |
| | | |
| | |
| | | salesLedgerProductMapper.delete(queryWrapper); |
| | | // æ¹éå é¤å
³èçéè´å°è´¦çæ¥ç¥¨ç»è®° |
| | | LambdaQueryWrapper<TicketRegistration> ticketRegistrationLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | | ticketRegistrationLambdaQueryWrapper.in(TicketRegistration::getSalesLedgerId,ids); |
| | | ticketRegistrationLambdaQueryWrapper.in(TicketRegistration::getPurchaseLedgerId,ids); |
| | | ticketRegistrationMapper.delete(ticketRegistrationLambdaQueryWrapper); |
| | | // æ¹éå é¤å
³èçéè´å°è´¦çæ¥ç¥¨ç»è®°è®°å½ |
| | | LambdaQueryWrapper<ProductRecord> productRecordLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | | productRecordLambdaQueryWrapper.in(ProductRecord::getPurchaseLedgerId,ids); |
| | | productRecordMapper.delete(productRecordLambdaQueryWrapper); |
| | | // æ¹éå é¤ä»æ¬¾ç»è®° |
| | | LambdaQueryWrapper<PaymentRegistration> paymentRegistrationLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | | paymentRegistrationLambdaQueryWrapper.in(PaymentRegistration::getPurchaseLedgerId,ids); |
| | | paymentRegistrationMapper.delete(paymentRegistrationLambdaQueryWrapper); |
| | | // æ¹éå é¤éè´å°è´¦ |
| | | return purchaseLedgerMapper.deleteBatchIds(Arrays.asList(ids)); |
| | | } |
| | |
| | | import com.ruoyi.purchase.mapper.ProductRecordMapper; |
| | | import com.ruoyi.purchase.mapper.PurchaseLedgerMapper; |
| | | import com.ruoyi.purchase.mapper.TicketRegistrationMapper; |
| | | import com.ruoyi.purchase.pojo.PaymentRegistration; |
| | | import com.ruoyi.purchase.pojo.ProductRecord; |
| | | import com.ruoyi.purchase.pojo.PurchaseLedger; |
| | | import com.ruoyi.purchase.pojo.TicketRegistration; |
| | |
| | | Path formalFilePath = formalDirPath.resolve(formalFilename); |
| | | |
| | | try { |
| | | // æ§è¡æä»¶è¿ç§»ï¼ä½¿ç¨ååæä½ç¡®ä¿å®å
¨æ§ï¼ |
| | | // Files.move( |
| | | // Paths.get(tempFile.getTempPath()), |
| | | // formalFilePath, |
| | | // StandardCopyOption.REPLACE_EXISTING, |
| | | // StandardCopyOption.ATOMIC_MOVE |
| | | // ); |
| | | |
| | | // ååç§»å¨å¤±è´¥ï¼ä½¿ç¨å¤å¶+å é¤ |
| | | Files.copy(Paths.get(tempFile.getTempPath()), formalFilePath, StandardCopyOption.REPLACE_EXISTING); |
| | | Files.deleteIfExists(Paths.get(tempFile.getTempPath())); |
| | |
| | | // å°äºçäº0å é¤ ï¼å¤§äº0ä¿®æ¹ |
| | | if(subtract.compareTo(BigDecimal.ZERO) <= 0){ |
| | | ticketRegistrationMapper.deleteById(ticketRegistrations.get(0)); |
| | | // å é¤ä»æ¬¾æµæ°´è®°å½ |
| | | paymentRegistrationMapper.delete(new LambdaQueryWrapper<PaymentRegistration>().eq(PaymentRegistration::getTicketRegistrationId, ticketRegistrations.get(0).getId())); |
| | | }else if(subtract.compareTo(BigDecimal.ZERO) > 0){ |
| | | ticketRegistrations.get(0).setInvoiceAmount(subtract); |
| | | ticketRegistrationMapper.updateById(ticketRegistrations.get(0)); |
| | |
| | | package com.ruoyi.sales.controller; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | 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.sales.dto.InvoiceLedgerDto; |
| | | import com.ruoyi.sales.dto.InvoiceRegistrationProductDto; |
| | | import com.ruoyi.sales.mapper.InvoiceLedgerFileMapper; |
| | | import com.ruoyi.sales.mapper.InvoiceRegistrationProductMapper; |
| | | import com.ruoyi.sales.pojo.InvoiceRegistrationProduct; |
| | | import com.ruoyi.sales.service.InvoiceLedgerService; |
| | | import io.jsonwebtoken.lang.Collections; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | |
| | | |
| | | @Autowired |
| | | private InvoiceRegistrationProductMapper invoiceRegistrationProductMapper; |
| | | |
| | | @Autowired |
| | | private InvoiceLedgerFileMapper invoiceLedgerFileMapper; |
| | | |
| | | /** |
| | | * å¼ç¥¨å°è´¦æ°å¢ |
| | |
| | | } |
| | | |
| | | /** |
| | | * å¼ç¥¨å°è´¦æä»¶å é¤ |
| | | */ |
| | | @DeleteMapping("/delFile") |
| | | @Log(title = "å¼ç¥¨å°è´¦", businessType = BusinessType.DELETE) |
| | | public AjaxResult invoiceLedgerDelFile(@RequestBody List<Integer> ids) { |
| | | if(Collections.isEmpty(ids)) return AjaxResult.error("è¯·éæ©è¦å é¤çæä»¶"); |
| | | invoiceLedgerFileMapper.deleteBatchIds(ids); |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * å¼ç¥¨å°è´¦æä»¶ä¸ä¼ |
| | | * @param file |
| | | * @return |
| | |
| | | @Data |
| | | public class InvoiceLedgerFile { |
| | | |
| | | @ApiModelProperty(value = "æä»¶ID") |
| | | private Long id; |
| | | |
| | | @ApiModelProperty(value = "æä»¶åç§°") |
| | | private String name; |
| | | |
| | |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.other.mapper.TempFileMapper; |
| | | import com.ruoyi.other.pojo.TempFile; |
| | | import com.ruoyi.production.mapper.SalesLedgerProductionAccountingMapper; |
| | | import com.ruoyi.production.mapper.SalesLedgerSchedulingMapper; |
| | | import com.ruoyi.production.mapper.SalesLedgerWorkMapper; |
| | | import com.ruoyi.production.pojo.SalesLedgerProductionAccounting; |
| | | import com.ruoyi.production.pojo.SalesLedgerScheduling; |
| | | import com.ruoyi.production.pojo.SalesLedgerWork; |
| | | import com.ruoyi.project.system.domain.SysDept; |
| | | import com.ruoyi.project.system.mapper.SysDeptMapper; |
| | | import com.ruoyi.sales.dto.MonthlyAmountDto; |
| | |
| | | private final InvoiceLedgerMapper invoiceLedgerMapper; |
| | | |
| | | private final SalesLedgerSchedulingMapper salesLedgerSchedulingMapper; |
| | | |
| | | private final SalesLedgerWorkMapper salesLedgerWorkMapper; |
| | | |
| | | private final SalesLedgerProductionAccountingMapper salesLedgerProductionAccountingMapper; |
| | | |
| | | private final InvoiceRegistrationProductMapper invoiceRegistrationProductMapper; |
| | | |
| | | private final InvoiceRegistrationMapper invoiceRegistrationMapper; |
| | | |
| | | @Autowired |
| | | private SysDeptMapper sysDeptMapper; |
| | |
| | | if (CollectionUtils.isEmpty(idList)) { |
| | | return 0; |
| | | } |
| | | // ç产订åæå¾
æäº§æ°æ®ï¼å°è´¦ä¸å¯å é¤ |
| | | LambdaQueryWrapper<SalesLedgerScheduling> salesLedgerSchedulingLambdaQueryWrapper = new LambdaQueryWrapper<SalesLedgerScheduling>() |
| | | .in(SalesLedgerScheduling::getSalesLedgerId, idList); |
| | | if (salesLedgerSchedulingMapper.selectCount(salesLedgerSchedulingLambdaQueryWrapper) > 0) { |
| | | throw new BaseException("ææäº§æ°æ®ï¼ä¸å¯å é¤"); |
| | | } |
| | | // å é¤éå®ç®¡çæ°æ® |
| | | // 1. å
å é¤åè¡¨æ°æ® |
| | | LambdaQueryWrapper<SalesLedgerProduct> productWrapper = new LambdaQueryWrapper<>(); |
| | | productWrapper.in(SalesLedgerProduct::getSalesLedgerId, idList); |
| | | salesLedgerProductMapper.delete(productWrapper); |
| | | |
| | | LambdaQueryWrapper<InvoiceRegistrationProduct> wrapper = new LambdaQueryWrapper<>(); |
| | | wrapper.in(InvoiceRegistrationProduct::getSalesLedgerId, idList); |
| | | List<InvoiceRegistrationProduct> invoiceRegistrationProducts = invoiceRegistrationProductMapper.selectList(wrapper); |
| | | List<Integer> invoiceLedgerIds = new ArrayList<>(); |
| | | if(CollectionUtils.isNotEmpty(invoiceRegistrationProducts)){ |
| | | LambdaQueryWrapper<InvoiceLedger> wrapperOne = new LambdaQueryWrapper<>(); |
| | | wrapperOne.in(InvoiceLedger::getInvoiceRegistrationProductId, invoiceRegistrationProducts.stream().map(InvoiceRegistrationProduct::getId).collect(Collectors.toList())); |
| | | List<InvoiceLedger> invoiceLedgers = invoiceLedgerMapper.selectList(wrapperOne); |
| | | if(CollectionUtils.isNotEmpty(invoiceLedgers)){ |
| | | invoiceLedgerIds = invoiceLedgers.stream().map(InvoiceLedger::getId).collect(Collectors.toList()); |
| | | } |
| | | invoiceLedgerMapper.delete(wrapperOne); |
| | | } |
| | | invoiceRegistrationProductMapper.delete(wrapper); |
| | | LambdaQueryWrapper<InvoiceRegistration> wrapperTwo = new LambdaQueryWrapper<>(); |
| | | wrapperTwo.in(InvoiceRegistration::getSalesLedgerId, idList); |
| | | invoiceRegistrationMapper.delete(wrapperTwo); |
| | | |
| | | if(CollectionUtils.isNotEmpty(invoiceLedgerIds)){ |
| | | LambdaQueryWrapper<ReceiptPayment> wrapperTree = new LambdaQueryWrapper<>(); |
| | | wrapperTree.in(ReceiptPayment::getInvoiceLedgerId, invoiceLedgerIds); |
| | | receiptPaymentMapper.delete(wrapperTree); |
| | | } |
| | | |
| | | |
| | | // å é¤çäº§ç®¡æ§æ°æ® |
| | | // å é¤çäº§è®¢åæ°æ® |
| | | LambdaQueryWrapper<SalesLedgerScheduling> in = new LambdaQueryWrapper<SalesLedgerScheduling>() |
| | | .in(SalesLedgerScheduling::getSalesLedgerId, idList); |
| | | salesLedgerSchedulingMapper.delete(in); |
| | | // å é¤çäº§æ´¾å·¥æ°æ® |
| | | LambdaQueryWrapper<SalesLedgerWork> workOrderWrapper = new LambdaQueryWrapper<>(); |
| | | workOrderWrapper.in(SalesLedgerWork::getSalesLedgerId, idList); |
| | | salesLedgerWorkMapper.delete(workOrderWrapper); |
| | | // å é¤ç产æ¥å·¥æ°æ® |
| | | LambdaQueryWrapper<SalesLedgerProductionAccounting> reportWrapper = new LambdaQueryWrapper<>(); |
| | | reportWrapper.in(SalesLedgerProductionAccounting::getSalesLedgerId, idList); |
| | | salesLedgerProductionAccountingMapper.delete(reportWrapper); |
| | | // 2. åå é¤ä¸»è¡¨æ°æ® |
| | | return salesLedgerMapper.deleteBatchIds(idList); |
| | | } |
| | |
| | | accessKey: admin |
| | | secretKey: 12345678 |
| | | preview-expiry: 24 # é¢è§å°åé»è®¤24å°æ¶ |
| | | default-bucket: uploadPath |
| | | default-bucket: jxc |
| | | # ç¨æ·é
ç½® |
| | | user: |
| | | password: |
| | |
| | | and dl.device_model like concat('%',#{deviceRepairDto.deviceModel},'%') |
| | | </if> |
| | | <if test="deviceRepairDto.status != null"> |
| | | and dl.status = #{deviceRepairDto.status} |
| | | and dr.status = #{deviceRepairDto.status} |
| | | </if> |
| | | <if test="deviceRepairDto.remark != null"> |
| | | and dr.remark like concat('%',#{deviceRepairDto.remark},'%') |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.ruoyi.procurementrecord.mapper.CustomStorageMapper"> |
| | | |
| | | <select id="listPageCopyByCustom" resultType="com.ruoyi.procurementrecord.pojo.CustomStorage"> |
| | | select *, |
| | | sum(inbound_num) as inboundNum, |
| | | sum(inbound_num) as inboundNum0, |
| | | sum(tax_inclusive_total_price) as taxInclusiveTotalPrice |
| | | from custom_storage |
| | | <where> |
| | | <if test="req.productCategory != null and req.productCategory != ''"> |
| | | and product_category like concat('%',#{req.productCategory},'%') |
| | | </if> |
| | | <if test="req.supplierName !=null and req.supplierName != ''"> |
| | | and supplier_name like concat('%',#{req.supplierName},'%') |
| | | </if> |
| | | <if test="req.inboundDate !=null"> |
| | | and inbound_date like concat('%',#{req.inboundDate},'%') |
| | | </if> |
| | | |
| | | </where> |
| | | group by product_category, specification_model, tax_inclusive_unit_price |
| | | order by inbound_date desc |
| | | </select> |
| | | </mapper> |
| | |
| | | t2.tax_inclusive_unit_price, |
| | | (t1.inbound_num * t2.tax_inclusive_unit_price) as taxInclusiveTotalPrice, |
| | | (t1.inbound_num * t2.tax_inclusive_unit_price - t1.inbound_num * t2.tax_inclusive_unit_price * t2.tax_rate / 100) as taxExclusiveTotalPrice, |
| | | t1.unit_price, |
| | | t1.total_price, |
| | | t1.inbound_batches, |
| | | t1.inbound_num, |
| | | t1.inbound_num as inboundNum0, |
| | |
| | | t2.tax_inclusive_total_price, |
| | | t2.tax_exclusive_total_price, |
| | | t1.inbound_batches, |
| | | t1.unit_price as unitPrice, |
| | | sum(t1.total_price) as totalPrice, |
| | | sum(t1.inbound_num) as inboundNum, |
| | | sum(t1.inbound_num) as inboundNum0, |
| | | t1.inbound_num as totalInboundNum, |
| | | t1.create_time, |
| | | t1.update_time, |
| | | t1.create_by, |
| | |
| | | and t1.create_time <= #{req.endDate} |
| | | </if> |
| | | </where> |
| | | group by t3.supplier_name,t2.product_category,t2.specification_model |
| | | group by t2.product_category,t2.specification_model,t1.unit_price |
| | | order by t1.create_time desc |
| | | </select> |
| | | <select id="listCopy" resultType="com.ruoyi.procurementrecord.dto.ProcurementPageDtoCopy"> |
| | |
| | | t2.tax_inclusive_unit_price, |
| | | (t1.inbound_num * t2.tax_inclusive_unit_price) as taxInclusiveTotalPrice, |
| | | (t1.inbound_num * t2.tax_inclusive_unit_price - t1.inbound_num * t2.tax_inclusive_unit_price * t2.tax_rate / 100) as taxExclusiveTotalPrice, |
| | | t1.unit_price, |
| | | t1.total_price, |
| | | t1.inbound_batches, |
| | | t1.inbound_num, |
| | | t1.inbound_num as inboundNum0, |
| | |
| | | t2.tax_inclusive_total_price, |
| | | t2.tax_exclusive_total_price, |
| | | t1.inbound_batches, |
| | | sum(t1.total_price) as totalPrice, |
| | | t1.unit_price, |
| | | sum(t1.inbound_num) as inboundNum, |
| | | sum(t1.inbound_num) as inboundNum0, |
| | | t1.inbound_num as totalInboundNum, |
| | | t1.create_time, |
| | | t1.update_time, |
| | | t1.create_by, |
| | |
| | | and t1.create_time <= #{req.endDate} |
| | | </if> |
| | | </where> |
| | | group by t2.product_category,t2.specification_model |
| | | group by t2.product_category,t2.specification_model,t1.unit_price |
| | | order by t1.create_time desc |
| | | </select> |
| | | </mapper> |
| | |
| | | t1.inbound_num, |
| | | t1.create_time, |
| | | t1.create_by, |
| | | t2.warn_num |
| | | t2.warn_num, |
| | | t4.unit_price, |
| | | t4.unit_price * t1.inbound_num as totalPrice |
| | | from procurement_record_out t1 |
| | | left join sales_ledger_product t2 on t2.id = t1.sales_ledger_product_id and t2.type = 2 |
| | | left join purchase_ledger t3 on t3.id = t2.sales_ledger_id |
| | | left join procurement_record_storage t4 on t4.id = t1.procurement_record_storage_id |
| | | <where> |
| | | and t1.type = 1 |
| | | <if test="req.supplierName != null and req.supplierName != ''"> |
| | |
| | | t2.tax_exclusive_total_price, |
| | | t1.inbound_num, |
| | | t1.create_time, |
| | | t1.create_by |
| | | t1.create_by, |
| | | t4.unit_price, |
| | | t4.unit_price * t1.inbound_num as totalPrice |
| | | from procurement_record_out t1 |
| | | left join sales_ledger_product t2 on t2.id = t1.sales_ledger_product_id and t2.type = 1 |
| | | left join sales_ledger t3 on t3.id = t2.sales_ledger_id |
| | | left join procurement_record_storage t4 on t4.id = t1.procurement_record_storage_id |
| | | <where> |
| | | and t1.type = 2 |
| | | <if test="req.customerName != null and req.customerName != ''"> |
| | |
| | | t2.unit, |
| | | t2.tax_rate, |
| | | t2.tax_inclusive_unit_price, |
| | | t2.tax_inclusive_total_price, |
| | | t2.tax_inclusive_unit_price * t1.inbound_num as totalPrice, |
| | | t2.tax_exclusive_total_price, |
| | | t1.inbound_num, |
| | | t1.create_time, |
| | | t1.create_by |
| | | t1.create_by, |
| | | t2.item_type |
| | | from procurement_record_out t1 |
| | | left join custom_storage t2 on t2.id = t1.procurement_record_storage_id |
| | | <where> |
| | |
| | | T1.customer_name, |
| | | t3.product_category, |
| | | t3.specification_model, |
| | | t3.unit |
| | | t3.unit, |
| | | T2.production_line |
| | | FROM |
| | | sales_ledger_scheduling T2 |
| | | LEFT JOIN sales_ledger T1 ON T1.id = T2.sales_ledger_id |
| | |
| | | <if test="qualityInspect.entryDateEnd != null and qualityInspect.entryDateEnd != '' "> |
| | | AND check_time <= DATE_FORMAT(#{qualityInspect.entryDateEnd},'%Y-%m-%d') |
| | | </if> |
| | | ORDER BY check_time DESC |
| | | </select> |
| | | <select id="qualityInspectExport" resultType="com.ruoyi.quality.pojo.QualityInspect"> |
| | | SELECT |