| | |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.mdm.basesetting.machine.vo.MachineQueryVO; |
| | | import org.springblade.mdm.basesetting.machine.vo.MachineVO; |
| | | import org.springblade.mdm.program.entity.NcProgram; |
| | | import org.springblade.mdm.program.service.NcNodeService; |
| | | import org.springblade.mdm.program.service.NcProgramService; |
| | | import org.springblade.mdm.program.vo.NcNodeProgramQueryVO; |
| | | import org.springblade.mdm.program.vo.NcNodeProgramVO; |
| | | import org.springblade.mdm.program.vo.NcNodeVO; |
| | |
| | | @Tag(name = "程序节点", description = "程序节点") |
| | | @Slf4j |
| | | public class NcNodeController { |
| | | |
| | | private final NcProgramService ncProgramService; |
| | | private final NcNodeService ncNodeService; |
| | | |
| | | /** |
| | |
| | | @Operation(summary = "懒加载列表", description = "程序目录树形结构") |
| | | public R<List<NcNodeVO>> lazyList(Long parentId) { |
| | | List<NcNodeVO> list = ncNodeService.lazyList(parentId); |
| | | if(list != null && !list.isEmpty()) { |
| | | for(NcNodeVO ncNodeVO : list) { |
| | | if(!"70".equals(ncNodeVO.getNodeType())){ |
| | | break; |
| | | } |
| | | NcProgram program = ncProgramService.getByBindNodeId(ncNodeVO.getId()); |
| | | if(program != null) { |
| | | ncNodeVO.setProcessEdition(program.getProcessEdition()); |
| | | ncNodeVO.setDrawingNo(program.getDrawingNo()); |
| | | ncNodeVO.setMachineCode(program.getMachineCode()); |
| | | ncNodeVO.setProcessName(program.getProcessName()); |
| | | } |
| | | } |
| | | |
| | | } |
| | | return R.data(list); |
| | | } |
| | | |
| | |
| | | /** |
| | | * 工序,如“精铣” |
| | | */ |
| | | //private String processName; |
| | | private String processName; |
| | | /** |
| | | * 备注 |
| | | */ |
| | |
| | | </select> |
| | | |
| | | <sql id="all_columns">id,tenant_id,name,parent_id,node_type,status,create_dept,is_deleted,create_time,create_user,update_time,update_user</sql> |
| | | <sql id="all_columns_n">n.id,n.tenant_id,n.name,n.parent_id,n.node_type,n.status,n.create_dept,n.is_deleted,n.create_time,n.create_user,n.update_time,n.update_user</sql> |
| | | <sql id="all_columns_n">n.id,n.tenant_id,n.name,n.parent_id,n.node_type,n.description,n.remark,n.status,n.create_dept,n.is_deleted,n.create_time,n.create_user,n.update_time,n.update_user</sql> |
| | | <select id="lazyList" resultType="org.springblade.mdm.program.vo.NcNodeVO"> |
| | | select <include refid="all_columns_n"/>,u.name create_user_name,( |
| | | SELECT |
| | |
| | | import java.text.DecimalFormat; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Optional; |
| | | |
| | | /** |
| | | * 工作流服务实现类 |
| | |
| | | prog.setProcessEdition(uploadVO.getProcessEdition()); |
| | | prog.setIsLastEdition(1); |
| | | prog.setMachineCode(uploadVO.getMachineCode()); |
| | | prog.setProcessName(uploadVO.getProcessName()); |
| | | boolean isTextFile = false; |
| | | try { |
| | | isTextFile = FileContentUtil.isTextFile(file.getInputStream()); |
| | |
| | | |
| | | return dirPath+File.separator+prog.getName(); |
| | | } |
| | | |
| | | /** |
| | | * |
| | | * @param bindNcNodeId |
| | | * @return |
| | | */ |
| | | public NcProgram getByBindNodeId(Long bindNcNodeId) { |
| | | |
| | | LambdaQueryWrapper<NcProgram> wrapper = new LambdaQueryWrapper<>(); |
| | | wrapper.eq(NcProgram::getBindNcNodeId, bindNcNodeId); |
| | | wrapper.eq(NcProgram::getIsLastEdition,1); |
| | | |
| | | Optional<NcProgram> progOpt = this.getOneOpt(wrapper); |
| | | |
| | | return progOpt.orElse(null); |
| | | } |
| | | } |
| | |
| | | private String remark; |
| | | @Schema(description = "创建用户名称") |
| | | private String createUserName; |
| | | |
| | | @Schema(description = "工序,如“精铣”,程序文件节点的属性") |
| | | private String processName; |
| | | @Schema(description = "工序版本,程序文件节点的属性") |
| | | private String processEdition; |
| | | @Schema(description = "零组件号/图号,程序文件节点的属性") |
| | | private String drawingNo; |
| | | } |