Fancy
2024-07-10 2bc94fed189ef2da4112f9f836343a6a579b93c6
pms-parent/pms-web-product/src/main/java/com/dy/pmsProduct/process/ProcessSv.java
@@ -15,6 +15,7 @@
import com.dy.pmsGlobal.pojoPr.PrWorkingInstruction;
import com.dy.pmsGlobal.util.UserUtil;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.dubbo.common.utils.PojoUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
@@ -63,6 +64,10 @@
    }
    @Transactional
    public int save(PrProductionProcess process){
        //流程名称不能重复
        if (processDao.exists(process.name, process.id)) {
            throw new RuntimeException("流程名称不能重复");
        }
        prepareProcess(process);
        int count = processDao.insertSelective(process);
        saveNodesAndInstructions(process);
@@ -71,6 +76,10 @@
    @Transactional
    public int update(PrProductionProcess process){
        //流程名称不能重复
        if (processDao.exists(process.name, process.id)) {
            throw new RuntimeException("流程名称不能重复");
        }
        prepareProcess(process);
        int count = processDao.updateByPrimaryKeySelective(process);
        // 优化:只有当节点有变更时才删除并重新插入
@@ -116,7 +125,9 @@
            }
            return null;
        }).filter(work -> work != null).toList();
        workDao.insertMany(workList);
        if(CollectionUtils.isNotEmpty(workList)){
            workDao.insertMany(workList);
        }
    }
@@ -159,8 +170,8 @@
        return rsVo ;
    }
    public List<Map<String,String>> queryAll(){
        return processDao.queryAll();
    public List<Map<String,String>> queryAll(Long proId){
        return processDao.queryAll(proId);
    }
    private void addUrl(PrWorkingInstruction ins){