lyh
2025-04-09 d583272ee68f3f80e11fddf17769eea773ff9053
解决批量启动流程死锁问题,增加点检后异常保修
已修改3个文件
29 ■■■■ 文件已修改
lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EamInspectionOrderServiceImpl.java 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
lxzn-module-flowable/src/main/java/org/jeecg/modules/flowable/apithird/business/mapper/FlowMyBusinessMapper.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
lxzn-module-flowable/src/main/java/org/jeecg/modules/flowable/apithird/business/service/impl/FlowMyBusinessServiceImpl.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EamInspectionOrderServiceImpl.java
@@ -5,9 +5,12 @@
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.apache.shiro.SecurityUtils;
import org.flowable.engine.TaskService;
import org.flowable.task.api.Task;
import org.jeecg.common.api.vo.FileUploadResult;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.constant.CommonConstant;
import org.jeecg.common.system.vo.LoginUser;
@@ -76,7 +79,7 @@
        }else {
            eamInspectionOrder.setInspectionStatus(InspectionStatus.INIT.getCode());
        }
        save(eamInspectionOrder);
        //处理明细数据
        if(CollectionUtil.isNotEmpty(eamInspectionOrderRequest.getTableDetailList())) {
            eamInspectionOrderRequest.getTableDetailList().forEach(tableDetail -> {
@@ -85,6 +88,18 @@
            });
            eamInspectionOrderDetailService.saveBatch(eamInspectionOrderRequest.getTableDetailList());
        }
        //处理附件
        if(CollectionUtil.isNotEmpty(eamInspectionOrderRequest.getFileList())) {
            FileUploadResult fileUploadResult = eamInspectionOrderRequest.getFileList().get(0);
            ObjectMapper mapper = new ObjectMapper();
            try {
                String referenceFile = mapper.writeValueAsString(fileUploadResult);
                eamInspectionOrder.setImageFiles(referenceFile);
            } catch (JsonProcessingException e) {
                log.error("JSON转换失败:" + e.getMessage(), e);
            }
        }
        save(eamInspectionOrder);
        if (StrUtil.isNotBlank(eamInspectionOrderRequest.getOperator())){
            triggerProcess(eamInspectionOrder);
        }
lxzn-module-flowable/src/main/java/org/jeecg/modules/flowable/apithird/business/mapper/FlowMyBusinessMapper.java
@@ -4,6 +4,7 @@
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.jeecg.modules.flowable.apithird.business.dto.FlowMyBusinessDto;
import org.jeecg.modules.flowable.apithird.business.entity.FlowMyBusiness;
import org.jeecg.modules.flowable.domain.dto.FlowTaskDto;
@@ -31,4 +32,7 @@
     */
    IPage<FlowMyBusinessDto> PageList(@Param("page") Page page, @Param("flowMyBusinessDto") FlowMyBusinessDto flowMyBusinessDto);
    @Select("SELECT * FROM flow_my_business WITH (INDEX(idx_data_id)) \n" +
            "WHERE data_id = #{dataId}")
    FlowMyBusiness selectByDataId(String dataId);
}
lxzn-module-flowable/src/main/java/org/jeecg/modules/flowable/apithird/business/service/impl/FlowMyBusinessServiceImpl.java
@@ -14,7 +14,6 @@
import org.jeecg.modules.flowable.util.TimeUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Isolation;
import org.springframework.transaction.annotation.Transactional;
import java.util.Date;
@@ -58,13 +57,10 @@
        return null;
    }
    @Transactional(isolation = Isolation.READ_COMMITTED)    // 降低隔离级别
    @Transactional   // 降低隔离级别
    public FlowMyBusiness getByDataId(String dataId) {
        LambdaQueryWrapper<FlowMyBusiness> flowMyBusinessLambdaQueryWrapper = new LambdaQueryWrapper<>();
        flowMyBusinessLambdaQueryWrapper.eq(FlowMyBusiness::getDataId,dataId)
        ;
        //如果保存数据前未调用必调的FlowCommonService.initActBusiness方法,就会有问题
        FlowMyBusiness business = this.getOne(flowMyBusinessLambdaQueryWrapper);
        FlowMyBusiness business = flowMyBusinessMapper.selectByDataId(dataId);
        return business;
    }