| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.basic.pojo.ProductModel; |
| | | import com.ruoyi.basic.service.IProductService; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.procurementrecord.utils.StockUtils; |
| | | import com.ruoyi.production.mapper.*; |
| | |
| | | import com.ruoyi.technology.mapper.TechnologyRoutingMapper; |
| | | import com.ruoyi.technology.pojo.TechnologyRouting; |
| | | import org.apache.commons.lang3.BooleanUtils; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | |
| | | private StockUtils stockUtils; |
| | | @Autowired |
| | | private StockInventoryMapper stockInventoryMapper; |
| | | @Autowired |
| | | private IProductService productService; |
| | | |
| | | @Override |
| | | public SalesLedgerProduct selectSalesLedgerProductById(Long id) { |
| | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public int addOrUpdateSalesLedgerProduct(SalesLedgerProduct salesLedgerProduct) { |
| | | |
| | | // 销售台账(type=1)手工录入产品大类/规格型号时,自动注册到产品维护(统一挂「成品」大类下) |
| | | if (Integer.valueOf(1).equals(salesLedgerProduct.getType())) { |
| | | ProductModel productModel = productService.ensureProductHierarchy( |
| | | salesLedgerProduct.getProductCategory(), |
| | | salesLedgerProduct.getSpecificationModel(), |
| | | salesLedgerProduct.getUnit()); |
| | | if (productModel != null) { |
| | | salesLedgerProduct.setProductId(productModel.getProductId()); |
| | | salesLedgerProduct.setProductModelId(productModel.getId()); |
| | | } |
| | | } |
| | | |
| | | int result; |
| | | Long salesLedgerId = salesLedgerProduct.getSalesLedgerId(); |
| | | if (salesLedgerProduct.getId() == null) { |