liyong
2026-04-28 f2c7c2aca847fda1b96387938a9dcd511daf1461
src/main/java/com/ruoyi/production/service/impl/ProductionProductMainServiceImpl.java
@@ -31,6 +31,7 @@
import com.ruoyi.quality.mapper.*;
import com.ruoyi.quality.pojo.*;
import com.ruoyi.quality.service.IQualityInspectService;
import com.ruoyi.sales.mapper.SalesLedgerMapper;
import lombok.AllArgsConstructor;
import org.springframework.aop.framework.AopContext;
import org.springframework.stereotype.Service;
@@ -52,6 +53,7 @@
@Transactional(rollbackFor = Exception.class)
public class ProductionProductMainServiceImpl extends ServiceImpl<ProductionProductMainMapper, ProductionProductMain> implements ProductionProductMainService {
    private final SalesLedgerMapper salesLedgerMapper;
    private IQualityInspectService qualityInspectService;
    private ProductionProductMainMapper productionProductMainMapper;
@@ -102,7 +104,6 @@
        LocalDateTime now = LocalDateTime.now();
        ProductWorkOrder productWorkOrder = productWorkOrderMapper.selectById(dto.getWorkOrderId());
        SysUser user = userMapper.selectUserById(dto.getUserId());
        ProductionProductMain productionProductMain = new ProductionProductMain();
        //当前工艺路线对应的工序详情
        ProductProcessRouteItem productProcessRouteItem = productProcessRouteItemMapper.selectById(dto.getProductProcessRouteItemId());
@@ -150,8 +151,9 @@
        productionProductMain.setTeamIds(dto.getTeamList().stream().map(ProductionProductMainDto.Team::getUserId).map(String::valueOf).collect(Collectors.joining(",")));
        productionProductMain.setTeamNames(dto.getTeamList().stream().map(ProductionProductMainDto.Team::getUserName).collect(Collectors.joining(",")));
        productionProductMain.setUserId(dto.getTeamList().get(0).getUserId());
        productionProductMain.setUserName(dto.getTeamList().get(0).getUserName());
        //报工人 是 谁报工就是是谁
        productionProductMain.setUserId(SecurityUtils.getUserId());
        productionProductMain.setUserName(SecurityUtils.getLoginUser().getNickName());
@@ -167,8 +169,8 @@
            productionProductMain.setStartTime(productWorkOrder.getStartProductTime());
            productionProductMain.setEndTime(now);
        }
        productionProductMain.setDeviceId(productProcess.getDeviceId());
        productionProductMain.setDeviceName(productProcess.getDeviceName());
        productionProductMain.setDeviceId(dto.getDeviceId());
        productionProductMain.setDeviceName(dto.getDeviceName());
        productionProductMainMapper.insert(productionProductMain);
        /*新增报工投入表*/
        List<ProductStructureDto> productStructureDtos = productStructureMapper.listBybomAndProcess(productProcessRoute.getBomId(), productProcess.getId());