| | |
| | | |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.jeecg.weibo.exception.BusinessException; |
| | | import liquibase.pro.packaged.S; |
| | | import org.jeecg.modules.dnc.dto.ComponentHierarchy; |
| | | import org.jeecg.modules.dnc.dto.TransferPackage; |
| | | import org.jeecg.modules.dnc.entity.*; |
| | | import org.jeecg.modules.dnc.mapper.*; |
| | | import org.jeecg.modules.dnc.service.*; |
| | | import org.jeecg.modules.system.entity.MdcProduction; |
| | | import org.jeecg.modules.system.service.IMdcProductionService; |
| | | import org.jeecg.modules.system.service.ISysUserService; |
| | | import org.slf4j.Logger; |
| | |
| | | |
| | | private void savePermissionStreamNewList(List<PermissionStreamNew> permissionStreamNewList) { |
| | | for (PermissionStreamNew permissionStreamNew : permissionStreamNewList) { |
| | | if (permissionStreamNew.getUserId() != null) { |
| | | String id=sysUserService.getUserByName(permissionStreamNew.getUserId()).getId(); |
| | | if (id!=null){ |
| | | permissionStreamNew.setUserId(id); |
| | | if (permissionStreamNewMapper.selectById(permissionStreamNew.getId()) == null) { |
| | | if (permissionStreamNew.getUserId() != null) { |
| | | String id=sysUserService.getUserByName(permissionStreamNew.getUserId()).getId(); |
| | | if (id!=null){ |
| | | permissionStreamNew.setUserId(id); |
| | | } |
| | | } |
| | | } |
| | | if (permissionStreamNew.getDepartId() != null) { |
| | | String id=mdcProductionService.findByOrgCode(permissionStreamNew.getDepartId()).getId(); |
| | | if (id!=null){ |
| | | permissionStreamNew.setDepartId(id); |
| | | if (permissionStreamNew.getDepartId() != null) { |
| | | MdcProduction mdcProduction=mdcProductionService.findByOrgCode(permissionStreamNew.getDepartId()); |
| | | if (mdcProduction!=null){ |
| | | permissionStreamNew.setDepartId(mdcProduction.getId()); |
| | | } |
| | | } |
| | | permissionStreamNewMapper.insert(permissionStreamNew); |
| | | logger.debug("权限已保存: {}", permissionStreamNew.getId()); |
| | | } |
| | | permissionStreamNewMapper.insert(permissionStreamNew); |
| | | logger.debug("权限已保存: {}", permissionStreamNew.getId()); |
| | | } |
| | | //分批添加产品、部件、零件、工艺规程、工序、工步权限 |
| | | permissionStreamNewList.forEach(item -> { |
| | |
| | | workStepDepartmentService.save(workStepDepartment); |
| | | } |
| | | break; |
| | | default: |
| | | default: |
| | | } |
| | | }); |
| | | } |
| | |
| | | |
| | | private void saveGuideCardBatch(GuideCardBatch guideCardBatch) { |
| | | if (guideCardBatchMapper.selectById(guideCardBatch.getId()) == null) { |
| | | guideCardBatch.setFlowStatus("1"); |
| | | guideCardBatchMapper.insert(guideCardBatch); |
| | | logger.debug("刀片批次已保存: {}", guideCardBatch.getId()); |
| | | } else { |