buhuazhen
5 天以前 cb84f5453ad54f710e76fc9d1edf6a2c2113ac13
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
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);
    }
}