| | |
| | | package com.ruoyi.sales.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; |
| | |
| | | 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.production.mapper.*; |
| | | import com.ruoyi.production.pojo.*; |
| | | import com.ruoyi.project.system.domain.SysDept; |
| | | import com.ruoyi.project.system.mapper.SysDeptMapper; |
| | | import com.ruoyi.sales.dto.MonthlyAmountDto; |
| | |
| | | private final InvoiceRegistrationProductMapper invoiceRegistrationProductMapper; |
| | | |
| | | private final InvoiceRegistrationMapper invoiceRegistrationMapper; |
| | | |
| | | private final ProductOrderMapper productOrderMapper; |
| | | |
| | | private final ProcessRouteMapper processRouteMapper; |
| | | |
| | | private final ProcessRouteItemMapper processRouteItemMapper; |
| | | |
| | | private final ProductProcessRouteItemMapper productProcessRouteItemMapper; |
| | | |
| | | @Autowired |
| | | private SysDeptMapper sysDeptMapper; |
| | |
| | | salesLedgerProduct.setNoInvoiceNum(salesLedgerProduct.getQuantity()); |
| | | salesLedgerProduct.setNoInvoiceAmount(salesLedgerProduct.getTaxInclusiveTotalPrice()); |
| | | salesLedgerProductMapper.insert(salesLedgerProduct); |
| | | |
| | | ProductOrder productOrder = new ProductOrder(); |
| | | productOrder.setSalesLedgerId(salesLedgerProduct.getSalesLedgerId()); |
| | | productOrder.setProductModelId(salesLedgerProduct.getId()); |
| | | productOrder.setNpsNo("SC" + String.format("%08d", salesLedgerProduct.getId())); |
| | | productOrderMapper.insert(productOrder); |
| | | |
| | | ProcessRoute processRoute = processRouteMapper.selectOne(new QueryWrapper<ProcessRoute>().lambda().eq(ProcessRoute::getProductModelId, salesLedgerProduct.getProductModelId())); |
| | | if (processRoute != null) { |
| | | List<ProcessRouteItem> processRouteItems = processRouteItemMapper.selectList(new QueryWrapper<ProcessRouteItem>().lambda().eq(ProcessRouteItem::getRouteId, processRoute.getId())); |
| | | for (ProcessRouteItem processRouteItem : processRouteItems) { |
| | | ProductProcessRouteItem productProcessRouteItem = new ProductProcessRouteItem(); |
| | | productProcessRouteItem.setProductModelId(productOrder.getProductModelId()); |
| | | productProcessRouteItem.setProcessId(processRouteItem.getProcessId()); |
| | | productProcessRouteItem.setRouteId(productOrder.getId()); |
| | | productProcessRouteItemMapper.insert(productProcessRouteItem); |
| | | } |
| | | productOrder.setRouteId(processRoute.getId()); |
| | | productOrderMapper.updateById(productOrder); |
| | | } |
| | | } |
| | | } |
| | | } |