| | |
| | | package com.ruoyi.sales.service.impl; |
| | | |
| | | import com.alibaba.excel.EasyExcel; |
| | | import com.alibaba.excel.ExcelWriter; |
| | | import com.alibaba.excel.write.metadata.WriteSheet; |
| | | import com.alibaba.excel.write.metadata.fill.FillConfig; |
| | | import com.alibaba.excel.write.metadata.fill.FillWrapper; |
| | | 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.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.deepoove.poi.XWPFTemplate; |
| | | import com.deepoove.poi.config.Configure; |
| | | import com.ruoyi.account.pojo.AccountIncome; |
| | | import com.ruoyi.account.service.AccountIncomeService; |
| | | import com.ruoyi.basic.mapper.CustomerMapper; |
| | | import com.ruoyi.basic.mapper.ProductMapper; |
| | | import com.ruoyi.basic.mapper.ProductModelMapper; |
| | | import com.ruoyi.basic.pojo.Customer; |
| | | import com.ruoyi.basic.pojo.ProductModel; |
| | | import com.ruoyi.common.enums.FileNameType; |
| | | import com.ruoyi.common.exception.base.BaseException; |
| | | import com.ruoyi.common.utils.DateUtils; |
| | | import com.ruoyi.common.utils.HackLoopTableRenderPolicy; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.device.execl.DeviceMaintenanceExeclDto; |
| | | import com.ruoyi.framework.security.LoginUser; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.other.mapper.TempFileMapper; |
| | | import com.ruoyi.other.pojo.TempFile; |
| | | import com.ruoyi.production.mapper.*; |
| | | import com.ruoyi.production.pojo.*; |
| | | import com.ruoyi.production.service.ProductionProductMainService; |
| | | import com.ruoyi.project.system.domain.SysDept; |
| | | import com.ruoyi.project.system.domain.SysUser; |
| | | import com.ruoyi.project.system.mapper.SysDeptMapper; |
| | | import com.ruoyi.project.system.mapper.SysUserMapper; |
| | | import com.ruoyi.quality.mapper.QualityInspectMapper; |
| | | import com.ruoyi.quality.pojo.QualityInspect; |
| | | import com.ruoyi.sales.dto.*; |
| | | import com.ruoyi.sales.mapper.*; |
| | | import com.ruoyi.sales.pojo.*; |
| | | import com.ruoyi.sales.service.ISalesLedgerProductService; |
| | | import com.ruoyi.sales.service.ISalesLedgerService; |
| | | import com.ruoyi.stock.mapper.StockInventoryMapper; |
| | | import lombok.RequiredArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.io.FilenameUtils; |
| | |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import java.io.IOException; |
| | | import java.io.InputStream; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.*; |
| | | import java.lang.reflect.Field; |
| | | import java.math.BigDecimal; |
| | | import java.math.RoundingMode; |
| | | import java.net.URLEncoder; |
| | | import java.nio.charset.StandardCharsets; |
| | | import java.nio.file.Files; |
| | | import java.nio.file.Path; |
| | | import java.nio.file.Paths; |
| | |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | | import java.time.YearMonth; |
| | | import java.time.ZoneId; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.*; |
| | | import java.util.concurrent.TimeUnit; |
| | | import java.util.function.Function; |
| | | import java.util.stream.Collectors; |
| | | import java.util.zip.ZipEntry; |
| | | import java.util.zip.ZipOutputStream; |
| | | |
| | | /** |
| | | * 销售台账Service业务层处理 |
| | |
| | | |
| | | private final QualityInspectMapper qualityInspectMapper; |
| | | |
| | | private final StockInventoryMapper stockInventoryMapper; |
| | | |
| | | private ISalesLedgerProductService salesLedgerProductService; |
| | | |
| | | |
| | | @Autowired |
| | | private SysDeptMapper sysDeptMapper; |
| | | |
| | |
| | | private ProductMapper productMapper; |
| | | @Autowired |
| | | private ProductStructureMapper productStructureMapper; |
| | | ; |
| | | @Autowired |
| | | private ProductionProductMainService productionProductMainService; |
| | | ; |
| | | |
| | | @Override |
| | | public List<SalesLedger> selectSalesLedgerList(SalesLedgerDto salesLedgerDto) { |
| | |
| | | product.setTempNoInvoiceNum(product.getNoInvoiceNum()); |
| | | product.setRegister(SecurityUtils.getLoginUser().getUser().getNickName()); |
| | | product.setRegisterDate(LocalDateTime.now()); |
| | | // 发货信息 |
| | | ShippingInfo shippingInfo = shippingInfoMapper.selectOne(new LambdaQueryWrapper<ShippingInfo>() |
| | | .eq(ShippingInfo::getSalesLedgerProductId, product.getId()) |
| | | .orderByDesc(ShippingInfo::getCreateTime) |
| | | .last("limit 1")); |
| | | if (shippingInfo != null) { |
| | | product.setShippingStatus(shippingInfo.getStatus()); |
| | | } |
| | | |
| | | ProductModel productModel = productModelMapper.selectById(product.getProductModelId()); |
| | | product.setMaterialCode(productModel.getMaterialCode()); |
| | | } |
| | | |
| | | // 3.查询上传文件 |
| | |
| | | resultDto.setSalesLedgerFiles(salesLedgerFiles); |
| | | } |
| | | return resultDto; |
| | | } |
| | | |
| | | @Override |
| | | public void exportShippingNote(HttpServletResponse response, List<Long> ids) { |
| | | log.info("开始导出送货单,台账ID列表: {}", ids); |
| | | |
| | | // 参数校验 |
| | | if (ids == null || ids.isEmpty()) { |
| | | throw new BaseException("请选择要导出的销售台账"); |
| | | } |
| | | |
| | | List<SalesLedger> salesLedgerList = salesLedgerMapper.selectList( |
| | | Wrappers.<SalesLedger>lambdaQuery() |
| | | .in(SalesLedger::getId, ids) |
| | | ); |
| | | |
| | | if (salesLedgerList.isEmpty()) { |
| | | throw new BaseException("未找到对应销售台账数据"); |
| | | } |
| | | |
| | | response.setContentType("application/zip"); |
| | | response.setHeader("Content-Disposition", "attachment;filename=送货单.zip"); |
| | | response.setHeader("Access-Control-Expose-Headers", "Content-Disposition"); |
| | | |
| | | try (ZipOutputStream zos = new ZipOutputStream(response.getOutputStream())) { |
| | | |
| | | for (SalesLedger ledger : salesLedgerList) { |
| | | log.info("处理合同号: {}", ledger.getSalesContractNo()); |
| | | |
| | | // 查询明细 |
| | | SalesLedgerProduct cond = new SalesLedgerProduct(); |
| | | cond.setSalesLedgerId(ledger.getId()); |
| | | List<SalesLedgerProduct> productList = salesLedgerProductServiceImpl.selectSalesLedgerProductList(cond); |
| | | |
| | | // 自动序号+物料编码赋值 |
| | | for (int i = 0; i < productList.size(); i++) { |
| | | SalesLedgerProduct product = productList.get(i); |
| | | if (product != null) { |
| | | product.setSerialNumber(i + 1); |
| | | product.setOrderNo(ledger.getSalesContractNo()); |
| | | Long productModelId = product.getProductModelId(); |
| | | if (productModelId != null) { |
| | | ProductModel productModel = productModelMapper.selectById(productModelId); |
| | | if (productModel != null) { |
| | | product.setMaterialCode(productModel.getMaterialCode()); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | // 关联客户信息 |
| | | Customer customer = customerMapper.selectById(ledger.getCustomerId()); |
| | | |
| | | // 计算总合计 |
| | | BigDecimal totalQuantity = BigDecimal.ZERO; |
| | | for (SalesLedgerProduct product : productList) { |
| | | totalQuantity = totalQuantity.add(product.getQuantity() == null ? BigDecimal.ZERO : product.getQuantity()); |
| | | } |
| | | |
| | | // 组装顶部静态数据 |
| | | Map<String, Object> dataMap = new HashMap<>(); |
| | | dataMap.put("customerName", ledger.getCustomerName()); |
| | | dataMap.put("companyAddress", customer.getCompanyAddress()); |
| | | dataMap.put("contactPerson", customer.getContactPerson()); |
| | | dataMap.put("contactPhone", customer.getContactPhone()); |
| | | dataMap.put("companyPhone", customer.getCompanyPhone()); |
| | | dataMap.put("salesContractNo", ledger.getSalesContractNo()); |
| | | dataMap.put("deliveryDate", formatDate(LocalDate.now())); |
| | | |
| | | ByteArrayOutputStream bos = new ByteArrayOutputStream(); |
| | | InputStream templateIs = this.getClass().getResourceAsStream("/static/shipping-note.xlsx"); |
| | | |
| | | ExcelWriter writer = EasyExcel.write(bos).withTemplate(templateIs).build(); |
| | | WriteSheet sheet = EasyExcel.writerSheet().build(); |
| | | |
| | | // 先填充数据(包括合计) |
| | | Map<String, Object> totalMap = new HashMap<>(); |
| | | totalMap.put("totalQuantity", totalQuantity); |
| | | dataMap.putAll(totalMap); |
| | | writer.fill(dataMap, sheet); |
| | | |
| | | // 再填充产品列表 |
| | | if (!productList.isEmpty()) { |
| | | FillConfig fillConfig = FillConfig.builder() |
| | | .forceNewRow(Boolean.TRUE) |
| | | .build(); |
| | | writer.fill(productList, fillConfig, sheet); |
| | | } |
| | | |
| | | writer.finish(); |
| | | templateIs.close(); |
| | | |
| | | // 打包ZIP |
| | | String excelName = String.format("送货单_%s.xlsx", |
| | | Optional.ofNullable(ledger.getSalesContractNo()).orElse(String.valueOf(ledger.getId()))); |
| | | ZipEntry entry = new ZipEntry(excelName); |
| | | zos.putNextEntry(entry); |
| | | zos.write(bos.toByteArray()); |
| | | zos.closeEntry(); |
| | | bos.close(); |
| | | } |
| | | |
| | | zos.finish(); |
| | | log.info("批量导出完成,共{}份送货单", salesLedgerList.size()); |
| | | |
| | | } catch (BaseException e) { |
| | | log.error("导出失败:{}", e.getMessage(), e); |
| | | throw e; |
| | | } catch (Exception e) { |
| | | log.error("导出异常", e); |
| | | throw new BaseException("导出失败:" + e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | public static String formatDate(LocalDate date) { |
| | | if (date == null) { |
| | | return null; |
| | | } |
| | | return date.format(DateTimeFormatter.ofPattern("yyyy-MM-dd")); |
| | | } |
| | | |
| | | @Override |
| | |
| | | |
| | | @Override |
| | | public List<MonthlyAmountDto> getAmountHalfYear(Integer type) { |
| | | |
| | | LocalDate now = LocalDate.now(); |
| | | LocalDateTime currentDateTime = LocalDateTime.now(); |
| | | |
| | | // 根据 type 确定查询的时间间隔(天数)和总查询天数 |
| | | int daysPerPeriod; |
| | | int totalDays; |
| | | switch (type) { |
| | | case 1: |
| | | daysPerPeriod = 5; // 每5天查一次 |
| | | totalDays = 30; // 6次 × 5天 = 30天 |
| | | break; |
| | | case 2: |
| | | daysPerPeriod = 15; // 每15天查一次 |
| | | totalDays = 90; // 6次 × 15天 = 90天 |
| | | break; |
| | | case 3: |
| | | daysPerPeriod = 30; // 每30天查一次 |
| | | totalDays = 180; // 6次 × 30天 = 180天 |
| | | break; |
| | | default: |
| | | throw new IllegalArgumentException("Invalid type value: " + type); |
| | | } |
| | | |
| | | List<MonthlyAmountDto> result = new ArrayList<>(); |
| | | |
| | | // 循环6次,每次查询一个时间段的数据 |
| | | for (int i = 0; i < 6; i++) { |
| | | // 计算当前时间段的起始和结束时间 |
| | | LocalDateTime endTime = currentDateTime.minusDays(i * daysPerPeriod); |
| | | LocalDateTime startTime = endTime.minusDays(daysPerPeriod); |
| | | for (int i = 5; i >= 0; i--) { |
| | | YearMonth yearMonth = YearMonth.from(now.minusMonths(i)); |
| | | LocalDateTime startTime = yearMonth.atDay(1).atStartOfDay(); |
| | | LocalDateTime endTime = yearMonth.atEndOfMonth().atTime(23, 59, 59); |
| | | |
| | | // 查询回款金额 |
| | | // 回款金额 |
| | | LambdaQueryWrapper<ReceiptPayment> receiptPaymentQuery = new LambdaQueryWrapper<>(); |
| | | receiptPaymentQuery |
| | | .ge(ReceiptPayment::getCreateTime, startTime) |
| | | .lt(ReceiptPayment::getCreateTime, endTime); |
| | | List<ReceiptPayment> receiptPayments = receiptPaymentMapper.selectList(receiptPaymentQuery); |
| | | .le(ReceiptPayment::getCreateTime, endTime); |
| | | |
| | | // 查询开票金额 |
| | | LambdaQueryWrapper<InvoiceLedger> invoiceLedgerQuery = new LambdaQueryWrapper<>(); |
| | | invoiceLedgerQuery |
| | | .ge(InvoiceLedger::getCreateTime, startTime) |
| | | .lt(InvoiceLedger::getCreateTime, endTime); |
| | | List<InvoiceLedger> invoiceLedgers = invoiceLedgerMapper.selectList(invoiceLedgerQuery); |
| | | List<ReceiptPayment> receiptPayments = |
| | | receiptPaymentMapper.selectList(receiptPaymentQuery); |
| | | |
| | | // 计算回款总额 |
| | | BigDecimal receiptAmount = receiptPayments.stream() |
| | | .map(ReceiptPayment::getReceiptPaymentAmount) |
| | | .filter(Objects::nonNull) |
| | | .reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | |
| | | // 计算开票总额 |
| | | // 开票金额 |
| | | LambdaQueryWrapper<InvoiceLedger> invoiceLedgerQuery = new LambdaQueryWrapper<>(); |
| | | invoiceLedgerQuery |
| | | .ge(InvoiceLedger::getCreateTime, startTime) |
| | | .le(InvoiceLedger::getCreateTime, endTime); |
| | | |
| | | List<InvoiceLedger> invoiceLedgers = |
| | | invoiceLedgerMapper.selectList(invoiceLedgerQuery); |
| | | |
| | | BigDecimal invoiceAmount = invoiceLedgers.stream() |
| | | .map(InvoiceLedger::getInvoiceTotal) |
| | | .filter(Objects::nonNull) |
| | | .reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | |
| | | // 构造返回的 DTO |
| | | MonthlyAmountDto dto = new MonthlyAmountDto(); |
| | | dto.setMonth(startTime.format(DateTimeFormatter.ofPattern("yyyy-MM-dd")) + " ~ " + |
| | | endTime.format(DateTimeFormatter.ofPattern("yyyy-MM-dd"))); |
| | | dto.setMonth(yearMonth.format(DateTimeFormatter.ofPattern("yyyy-MM"))); |
| | | dto.setReceiptAmount(receiptAmount); |
| | | dto.setInvoiceAmount(invoiceAmount); |
| | | |
| | | result.add(dto); |
| | | } |
| | | |
| | | // 反转列表,使时间顺序从早到晚 |
| | | Collections.reverse(result); |
| | | return result; |
| | | } |
| | | |
| | |
| | | // // 产品大类数据 |
| | | // List<Product> productList = productMapper.selectList(new LambdaQueryWrapper<Product>().in(Product::getProductName, |
| | | // salesLedgerProductImportDtoList.stream().map(SalesLedgerImportDto::getProductCategory).collect(Collectors.toList()))); |
| | | List<Map<String,Object>> list = productModelMapper.getProductAndModelList(); |
| | | List<Map<String, Object>> list = productModelMapper.getProductAndModelList(); |
| | | // 录入人数据 |
| | | List<SysUser> sysUsers = sysUserMapper.selectList(new LambdaQueryWrapper<SysUser>().in(SysUser::getNickName, |
| | | salesLedgerImportDtoList.stream().map(SalesLedgerImportDto::getEntryPerson).collect(Collectors.toList()))); |
| | |
| | | SalesLedger salesLedger1 = salesLedgerMapper.selectOne(new LambdaQueryWrapper<SalesLedger>() |
| | | .eq(SalesLedger::getSalesContractNo, salesLedgerImportDto.getSalesContractNo()) |
| | | .last("LIMIT 1")); |
| | | if(salesLedger1 != null){ |
| | | if (salesLedger1 != null) { |
| | | continue; |
| | | } |
| | | SalesLedger salesLedger = new SalesLedger(); |
| | |
| | | throw new RuntimeException("销售单号:" + salesLedgerImportDto.getSalesContractNo() + ",无对应产品数据!"); |
| | | salesLedger.setContractAmount(salesLedgerProductImportDtos.stream() |
| | | .map(SalesLedgerProductImportDto::getTaxInclusiveTotalPrice) |
| | | .reduce(BigDecimal.ZERO,BigDecimal::add)); |
| | | .reduce(BigDecimal.ZERO, BigDecimal::add)); |
| | | salesLedgerMapper.insert(salesLedger); |
| | | |
| | | |
| | |
| | | salesLedgerProduct.setApproveStatus(0); |
| | | salesLedgerProduct.setPendingInvoiceTotal(salesLedgerProductImportDto.getTaxInclusiveTotalPrice()); |
| | | salesLedgerProductMapper.insert(salesLedgerProduct); |
| | | // 添加生产数据 |
| | | salesLedgerProductServiceImpl.addProductionData(salesLedgerProduct); |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | // 删除发货台账记录 |
| | | List<ShippingInfo> shippingInfos = shippingInfoMapper.selectList(new LambdaQueryWrapper<ShippingInfo>() |
| | | .eq(ShippingInfo::getSalesLedgerId, idList)); |
| | | if(CollectionUtils.isNotEmpty(shippingInfos)){ |
| | | .in(ShippingInfo::getSalesLedgerId, idList)); |
| | | if (CollectionUtils.isNotEmpty(shippingInfos)) { |
| | | shippingInfoServiceImpl.delete(shippingInfos.stream().map(ShippingInfo::getId).collect(Collectors.toList())); |
| | | } |
| | | // 删除附件表 |
| | | commonFileService.deleteByBusinessIds(idList, FileNameType.SALE.getValue()); |
| | | |
| | | // 删除生产管控数据 |
| | | // 删除生产订单数据 |
| | | 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); |
| | | //查询生产报工id |
| | | ArrayList<Long> mainIdList = productionProductMainService.listMain(idList); |
| | | if (CollectionUtils.isNotEmpty(mainIdList)) { |
| | | mainIdList.stream().forEach(mainId -> { |
| | | productionProductMainService.removeProductMain(mainId); |
| | | }); |
| | | } |
| | | // 2. 再删除主表数据 |
| | | return salesLedgerMapper.deleteBatchIds(idList); |
| | | } |
| | |
| | | // 4. 处理子表数据 |
| | | List<SalesLedgerProduct> productList = salesLedgerDto.getProductData(); |
| | | if (productList != null && !productList.isEmpty()) { |
| | | handleSalesLedgerProducts(salesLedger.getId(), productList, salesLedgerDto.getType()); |
| | | handleSalesLedgerProducts(salesLedger.getId(), productList, salesLedgerDto.getType(), salesLedgerDto.isProduce()); |
| | | updateMainContractAmount( |
| | | salesLedger.getId(), |
| | | productList, |
| | |
| | | } |
| | | |
| | | |
| | | private void handleSalesLedgerProducts(Long salesLedgerId, List<SalesLedgerProduct> products, Integer type) { |
| | | private void handleSalesLedgerProducts(Long salesLedgerId, List<SalesLedgerProduct> products, Integer type, boolean isProduce) { |
| | | // 按ID分组,区分新增和更新的记录 |
| | | Map<Boolean, List<SalesLedgerProduct>> partitionedProducts = products.stream() |
| | | .peek(p -> p.setSalesLedgerId(salesLedgerId)) |
| | |
| | | List<SalesLedgerProduct> updateList = partitionedProducts.get(true); |
| | | List<SalesLedgerProduct> insertList = partitionedProducts.get(false); |
| | | |
| | | // List<StockInventoryDto> stockInventoryDtos = stockInventoryMapper.selectProductList(); |
| | | |
| | | // 执行更新操作 |
| | | if (!updateList.isEmpty()) { |
| | | for (SalesLedgerProduct product : updateList) { |
| | | // // 查询库存数量 |
| | | // SalesLedgerProduct oldProduct = salesLedgerProductMapper.selectById(product.getId()); |
| | | // BigDecimal quantityChange = product.getQuantity().subtract(oldProduct.getQuantity()); |
| | | // |
| | | // // 如果数量增加了,检查库存 |
| | | // if (quantityChange.compareTo(BigDecimal.ZERO) > 0) { |
| | | // for (StockInventoryDto stockInventoryDto : stockInventoryDtos) { |
| | | // if (stockInventoryDto.getProductId().equals(product.getId())) { |
| | | // if (quantityChange.compareTo(stockInventoryDto.getQualitity()) > 0) { |
| | | // throw new RuntimeException("库存不足"); |
| | | // } |
| | | // break; |
| | | // } |
| | | // } |
| | | // } |
| | | product.setType(type); |
| | | salesLedgerProductMapper.updateById(product); |
| | | } |
| | |
| | | // 执行插入操作 |
| | | if (!insertList.isEmpty()) { |
| | | for (SalesLedgerProduct salesLedgerProduct : insertList) { |
| | | // for (StockInventoryDto stockInventoryDto : stockInventoryDtos) { |
| | | // if (stockInventoryDto.getProductId().equals(salesLedgerProduct.getId())) { |
| | | // if (salesLedgerProduct.getQuantity().compareTo(stockInventoryDto.getQualitity()) > 0) { |
| | | // throw new RuntimeException("库存不足"); |
| | | // } |
| | | // } |
| | | // } |
| | | salesLedgerProduct.setType(type); |
| | | salesLedgerProduct.setNoInvoiceNum(salesLedgerProduct.getQuantity()); |
| | | salesLedgerProduct.setNoInvoiceAmount(salesLedgerProduct.getTaxInclusiveTotalPrice()); |
| | | salesLedgerProduct.setPendingInvoiceTotal(salesLedgerProduct.getTaxInclusiveTotalPrice()); |
| | | salesLedgerProductMapper.insert(salesLedgerProduct); |
| | | // 添加生产数据 |
| | | salesLedgerProductServiceImpl.addProductionData(salesLedgerProduct); |
| | | if (isProduce) { |
| | | salesLedgerProductServiceImpl.addProductionData(salesLedgerProduct); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | throw new RuntimeException("动态更新主表金额失败", e); |
| | | } |
| | | } |
| | | } |
| | | } |