| | |
| | | } |
| | | |
| | | /** |
| | | * 获取node的历史列表(同一个父节点下,同名的所有节点) |
| | | * 获取试切节点node的历史列表(零组件号,工序号,工序版本,机床组) |
| | | * @param pkgNode node |
| | | * @return 历史列表,报错节点本身 |
| | | */ |
| | | public List<NcNode> getNodeHistory(NcNode pkgNode) { |
| | | public List<NcNode> getTryNodeHistory(NcNode pkgNode) { |
| | | return this.lambdaQuery().eq(NcNode::getDrawingNo,pkgNode.getDrawingNo()) |
| | | .eq(NcNode::getProcessNo,pkgNode.getProcessNo()) |
| | | .eq(NcNode::getProcessEdition,pkgNode.getProcessEdition()) |
| | | .eq(NcNode::getMachineGroupCode,pkgNode.getMachineGroupCode()) |
| | | .likeLeft(NcNode::getParentIds,"0,1,") |
| | | .list();//.ne(NcNode::getId,pkgNode.getId()) |
| | | /* |
| | | return this.lambdaQuery().eq(NcNode::getParentId,pkgNode.getParentId()) |
| | | .eq(NcNode::getName,pkgNode.getName()).list();//.ne(NcNode::getId,pkgNode.getId()) |
| | | |
| | | */ |
| | | } |
| | | |
| | | /** |
| | | * 计算历史序号,根据零组件号,工序号,工序版次,机床组查询,查询道则使用该历史编号,查询不到使用新生成的 |
| | | */ |
| | | public long calculateHistorySerial(NcNode pkgNode) { |
| | | NcNode node = this.lambdaQuery().eq(NcNode::getNodeType,NcNode.TYPE_PROGRAM_PACKAGE).eq(NcNode::getDrawingNo,pkgNode.getDrawingNo()) |
| | | .eq(NcNode::getProcessNo,pkgNode.getProcessNo()).eq(NcNode::getProcessEdition,pkgNode.getProcessEdition()) |
| | | .eq(NcNode::getMachineGroupCode,pkgNode.getMachineGroupCode()).last("limit 1").one(); |
| | | |
| | | if(node != null && node.getHisSerial()!=null){ |
| | | return node.getHisSerial(); |
| | | }else{ |
| | | //以往没有,生成一个新的 |
| | | return System.currentTimeMillis();//使用当前毫秒数 |
| | | } |
| | | } |
| | | |
| | | public int calculateVersionNumber(NcNode pkgNode) { |
| | | NcNode node = this.lambdaQuery().eq(NcNode::getNodeType,NcNode.TYPE_PROGRAM_PACKAGE).eq(NcNode::getDrawingNo,pkgNode.getDrawingNo()) |
| | | .eq(NcNode::getProcessNo,pkgNode.getProcessNo()).eq(NcNode::getProcessEdition,pkgNode.getProcessEdition()) |
| | | .eq(NcNode::getMachineGroupCode,pkgNode.getMachineGroupCode()).last("limit 1").one(); |
| | | |
| | | if(node != null && node.getVersionNumber()!=null){ |
| | | return node.getVersionNumber()+1; |
| | | }else{ |
| | | //以往没有,生成一个新的 |
| | | return 1; |
| | | } |
| | | } |
| | | /** |
| | | * 生成程序包名/程序名称 |
| | | * @param drawingNo 零组件号 |
| | |
| | | * @param programPkgNode 偏离单的程序包名节点 |
| | | * @return 序号 |
| | | */ |
| | | /* |
| | | public long getDeviationSerialForNode(NcNode programPkgNode) { |
| | | return lambdaQuery().eq(NcNode::getNodeType,NcNode.TYPE_PROGRAM_PACKAGE) |
| | | .eq(NcNode::getName,programPkgNode.getName()) |
| | |
| | | .le(NcNode::getCreateTime,programPkgNode.getCreateTime()) //时间小于等于当前节点 |
| | | .count(); |
| | | } |
| | | */ |
| | | |
| | | /** |
| | | * 根据上级节点id,移动下面的加工机床节点 |
| | |
| | | public void deleteMachineNodeByParentId(Long parentId) { |
| | | baseMapper.deleteMachineNodeByParentId(parentId); |
| | | } |
| | | |
| | | /** |
| | | * 删除所偶非最新版本的数据(hodeHIs里面已经保存过) |
| | | */ |
| | | public void deleteOldEditionNodeData() { |
| | | baseMapper.deleteOldEditionNodeData(); |
| | | } |
| | | } |