package com.ruoyi.projectManagement.service.impl; import com.ruoyi.common.enums.SaleEnum; import com.ruoyi.projectManagement.service.InfoService; import com.ruoyi.projectManagement.service.impl.handle.ContractInfoHandleService; import com.ruoyi.projectManagement.service.impl.handle.InfoHandleService; import com.ruoyi.projectManagement.service.impl.handle.ShippingAddressHandleService; import com.ruoyi.projectManagement.vo.SaveInfoVo; import com.ruoyi.sales.service.ISalesLedgerService; import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; /** * @author buhuazhen * @date 2026/3/9 * @email 3038525872@qq.com */ @Service @RequiredArgsConstructor @Transactional(readOnly = true) public class InfoServiceImpl implements InfoService { private final InfoHandleService infoHandleService; private final ContractInfoHandleService contractInfoHandleService; private final ShippingAddressHandleService shippingAddressHandleService; private final ISalesLedgerService salesLedgerService; @Transactional(rollbackFor = Exception.class) @Override public void save(SaveInfoVo saveInfoVo) { // 保存主信息 Long infoId = infoHandleService.save(saveInfoVo.getInfo()); shippingAddressHandleService.save(infoId, saveInfoVo.getShippingAddress()); contractInfoHandleService.save(infoId, saveInfoVo.getContractInfo()); salesLedgerService.handleSalesLedgerProducts(infoId, saveInfoVo.getSalesLedgerProductList(), SaleEnum.MANAGEMENT); } }