maven
2025-10-21 3240968279b2960b05071db0ac4e950955a69dfd
src/main/java/com/ruoyi/procurementrecord/service/impl/ProcurementRecordServiceImpl.java
@@ -16,6 +16,7 @@
import com.ruoyi.project.system.domain.SysUser;
import com.ruoyi.project.system.mapper.SysUserMapper;
import com.ruoyi.sales.mapper.SalesLedgerProductMapper;
import com.ruoyi.sales.pojo.SalesLedgerProduct;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
@@ -176,6 +177,12 @@
        DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
        String entryDateStr = procurementDto.getEntryDate() + " 00:00:00";
        String createTimeStr = procurementDto.getCreateTime() + " 00:00:00";
        SalesLedgerProduct salesLedgerProduct = salesLedgerProductMapper.selectById(procurementDto.getSalesLedgerProductId());
        if(salesLedgerProduct == null){
            throw new RuntimeException("销售台账产品不存在");
        }
        salesLedgerProduct.setMinStock(procurementDto.getMinStock());
        salesLedgerProductMapper.updateById(salesLedgerProduct);
        ProcurementRecordStorage procurementRecordStorageById = getProcurementRecordById(procurementDto.getId());
        procurementRecordStorageById.setCreateBy(sysUser.getNickName());
        procurementRecordStorageById.setCreateUser(sysUser.getUserId());