| | |
| | | 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; |
| | |
| | | } |
| | | @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); |
| | |
| | | |
| | | @Transactional |
| | | public int update(PrProductionProcess process){ |
| | | //流程名称不能重复 |
| | | if (processDao.exists(process.name, process.id)) { |
| | | throw new RuntimeException("流程名称不能重复"); |
| | | } |
| | | prepareProcess(process); |
| | | int count = processDao.updateByPrimaryKeySelective(process); |
| | | // 优化:只有当节点有变更时才删除并重新插入 |
| | |
| | | } |
| | | return null; |
| | | }).filter(work -> work != null).toList(); |
| | | workDao.insertMany(workList); |
| | | if(CollectionUtils.isNotEmpty(workList)){ |
| | | workDao.insertMany(workList); |
| | | } |
| | | } |
| | | |
| | | |
| | |
| | | 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){ |