¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.tms.controller; |
| | | |
| | | import cn.hutool.core.collection.CollectionUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.jeecg.common.api.vo.Result; |
| | | import org.jeecg.common.constant.CommonConstant; |
| | | import org.jeecg.modules.tms.entity.ToolsClassify; |
| | | import org.jeecg.modules.tms.entity.vo.ParaHolesToolsVo; |
| | | import org.jeecg.modules.tms.entity.vo.ParaMillToolVo; |
| | | import org.jeecg.modules.tms.entity.vo.ParaTurningToolsVo; |
| | | import org.jeecg.modules.tms.enums.ToolParaType; |
| | | import org.jeecg.modules.tms.service.*; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.util.List; |
| | | import java.util.regex.Matcher; |
| | | import java.util.regex.Pattern; |
| | | |
| | | @RestController |
| | | @RequestMapping("/tms/toolsToDnc") |
| | | public class ToolsToDncController { |
| | | |
| | | @Autowired |
| | | private IToolsClassifyService toolsClassifyService; |
| | | @Autowired |
| | | private IParaHoleToolsService paraHoleToolsService; |
| | | @Autowired |
| | | private IParaMillToolService paraMillToolService; |
| | | @Autowired |
| | | private IParaTurningToolsService paraTurningToolsService; |
| | | |
| | | /** |
| | | * éè¿å·¥å
·ç®ç§°/ç´å¾åæ°æ¥è¯¢å
·ä½å·¥å
·åæ°ä¿¡æ¯(ç»DNCæä¾æ¥å£)ï¼åæ°ç¤ºä¾ï¼3Eï¼3为工å
·ç´å¾åæ°ãE为å å·¥ä¸å¿åå
·ç®ç§°ï¼ |
| | | * @param param |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "éè¿å·¥å
·ç®ç§°/ç´å¾åæ°æ¥è¯¢å
·ä½å·¥å
·åæ°ä¿¡æ¯(ç»DNCæä¾æ¥å£)", notes = "éè¿å·¥å
·ç®ç§°/ç´å¾åæ°æ¥è¯¢å
·ä½å·¥å
·åæ°ä¿¡æ¯(ç»DNCæä¾æ¥å£)") |
| | | @GetMapping("/queryToolByParam") |
| | | public Result<?> queryToolByParam(@RequestParam("param") String param){ |
| | | // æ£å表达å¼ï¼ååé¨å为æ°åï¼æ¯æå°æ°ï¼ï¼ååé¨å为大åæå°å忝 |
| | | String regex = "^([\\d.]+)([A-Za-z]+)$"; |
| | | Pattern pattern = Pattern.compile(regex); |
| | | Matcher matcher = pattern.matcher(param); |
| | | if (matcher.find()) { |
| | | String diameter = matcher.group(1); |
| | | String toolAliasName = matcher.group(2); |
| | | |
| | | List<ToolsClassify> classifyList = toolsClassifyService.list(new LambdaQueryWrapper<ToolsClassify>() |
| | | .eq(ToolsClassify::getAliasLabel, toolAliasName) |
| | | .eq(ToolsClassify::getStatus, CommonConstant.STATUS_1)); |
| | | if (CollectionUtil.isEmpty(classifyList)) { |
| | | return Result.error("æªæ¾å°å¹é
çå·¥å
·åç±»"); |
| | | } |
| | | List<Object> toolList = CollectionUtil.newArrayList(); |
| | | for (ToolsClassify classify : classifyList) { |
| | | String paraTypeFlag = classify.getParaTypeFlag(); |
| | | ToolParaType toolParaType = ToolParaType.fromValue(paraTypeFlag); |
| | | if (toolParaType != null) { |
| | | switch (toolParaType) { |
| | | case HOLE: |
| | | List<ParaHolesToolsVo> paraHoleToolsList = paraHoleToolsService.selectByClassifyAndDiameter(classify.getId(), diameter); |
| | | toolList.addAll(paraHoleToolsList); |
| | | break; |
| | | case MILL: |
| | | List<ParaMillToolVo> paraMillToolList = paraMillToolService.selectByClassifyAndDiameter(classify.getId(), diameter); |
| | | toolList.addAll(paraMillToolList); |
| | | break; |
| | | case TURNING: |
| | | List<ParaTurningToolsVo> paraTurningToolsList = paraTurningToolsService.selectByClassifyAndDiameter(classify.getId(), diameter); |
| | | toolList.addAll(paraTurningToolsList); |
| | | break; |
| | | default: |
| | | } |
| | | } |
| | | } |
| | | return Result.OK(toolList); |
| | | } else { |
| | | return Result.error("åæ°æ ¼å¼ä¸æ£ç¡®"); |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | @Dict(dicCode = "tool_para_type") |
| | | private String paraTypeFlag; |
| | | |
| | | /**å å·¥ä¸å¿åå
·ç®ç§°*/ |
| | | @ApiModelProperty(value = "å å·¥ä¸å¿åå
·ç®ç§°") |
| | | private String aliasLabel; |
| | | |
| | | @ApiModelProperty(value = "å·¥å
·åç±»ç¼ç æ¹å¼") |
| | | private String encodingType; |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.tms.enums; |
| | | |
| | | import lombok.Getter; |
| | | |
| | | /** |
| | | * å·¥å
·åæ°ç±»åæä¸¾ |
| | | */ |
| | | @Getter |
| | | public enum ToolParaType { |
| | | GENERAL("1"),//éç¨åæ°æ è¯ |
| | | HOLE("2"),//åå å·¥åå
·åæ°æ è¯ |
| | | THREADING("3"),//èºçº¹åå
·åæ°æ è¯ |
| | | MILL("4"),//é£ååå
·åæ°æ è¯ |
| | | TURNING("5"),//车ååå
·åæ°æ è¯ |
| | | BLADE("6");//åçåæ°æ è¯ |
| | | |
| | | private final String value; |
| | | |
| | | private ToolParaType(String value) { |
| | | this.value = value; |
| | | } |
| | | |
| | | public static ToolParaType fromValue(String value) { |
| | | for (ToolParaType type : ToolParaType.values()) { |
| | | if (type.value.equals(value)) { |
| | | return type; |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | } |
| | |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.jeecg.modules.tms.entity.ParaHoleTools; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.jeecg.modules.tms.entity.vo.ParaHolesToolsVo; |
| | | |
| | | /** |
| | | * @Description: tms_para_hole_tools |
| | |
| | | */ |
| | | public interface ParaHoleToolsMapper extends BaseMapper<ParaHoleTools> { |
| | | |
| | | List<ParaHolesToolsVo> selectByClassifyAndDiameter(@Param("classifyId") String classifyId, |
| | | @Param("diameter") String diameter); |
| | | } |
| | |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.jeecg.modules.tms.entity.ParaMillTool; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.jeecg.modules.tms.entity.vo.ParaMillToolVo; |
| | | |
| | | /** |
| | | * @Description: tms_para_mill_tool |
| | |
| | | */ |
| | | public interface ParaMillToolMapper extends BaseMapper<ParaMillTool> { |
| | | |
| | | List<ParaMillToolVo> selectByClassifyAndDiameter(@Param("classifyId") String classifyId, |
| | | @Param("diameter") String diameter); |
| | | } |
| | |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.jeecg.modules.tms.entity.ParaTurningTools; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.jeecg.modules.tms.entity.vo.ParaTurningToolsVo; |
| | | |
| | | /** |
| | | * @Description: tms_para_turning_tools |
| | |
| | | */ |
| | | public interface ParaTurningToolsMapper extends BaseMapper<ParaTurningTools> { |
| | | |
| | | List<ParaTurningToolsVo> selectByClassifyAndDiameter(@Param("classifyId") String classifyId, |
| | | @Param("diameter") String diameter); |
| | | } |
| | |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="org.jeecg.modules.tms.mapper.ParaHoleToolsMapper"> |
| | | |
| | | <select id="selectByClassifyAndDiameter" resultType="org.jeecg.modules.tms.entity.vo.ParaHolesToolsVo"> |
| | | SELECT |
| | | t.id, |
| | | t.classify_id AS classifyId, |
| | | t2.classify_id AS classifyNum, |
| | | t2.type_name AS classifyName, |
| | | t1.id AS toolId, |
| | | t1.tool_code AS toolCode, |
| | | t.sign_code AS signCode, |
| | | t.chinese_name AS chineseName, |
| | | t.foreign_language_name AS foreignLanguageName, |
| | | t.standard_level AS standardLevel, |
| | | t.standard_code AS standardCode, |
| | | t.position_code AS positionCode, |
| | | t.tool_model AS toolModel, |
| | | t.diameter, |
| | | t.cone_angle AS coneAngle, |
| | | t.edge_length AS edgeLength, |
| | | t.total_length AS totalLength, |
| | | t.tool_material AS toolMaterial, |
| | | t.part_material AS partMaterial, |
| | | t.paintcoat_flag AS paintcoatFlag, |
| | | t.tool_pattern AS toolPattern, |
| | | t.handle_specifications AS handleSpecifications, |
| | | t.cooling_method AS coolingMethod, |
| | | t.technical_conditions AS technicalConditions, |
| | | t.conditions_info AS conditionsInfo, |
| | | t.brand, |
| | | t.types, |
| | | t.tolerance_class AS toleranceClass, |
| | | t.flute_form AS fluteForm, |
| | | t.handle_form AS handleForm, |
| | | t.blade_count AS bladeCount, |
| | | t.small_diameter AS smallDiameter, |
| | | t.chamfer_angle AS chamferAngle, |
| | | t.fitter_part AS fitterPart, |
| | | t.effective_length AS effectiveLength, |
| | | t.drill_diameter_range AS drillDiameterRange, |
| | | t.knife_diameter AS knifeDiameter, |
| | | t.bore_diameter AS boreDiameter, |
| | | t.connector_type AS connectorType, |
| | | t.slot_specification AS slotSpecification, |
| | | t.scope_of_application AS scopeOfApplication, |
| | | t.latest_boring_diameter AS latestBoringDiameter, |
| | | t.max_boring_diameter AS maxBoringDiameter, |
| | | t.processingmethod, |
| | | t.heads_number AS headsNumber, |
| | | t.adapt_holder AS adaptHolder |
| | | FROM tms_para_hole_tools t |
| | | LEFT JOIN tms_base_tools t1 on t.tool_code = t1.id |
| | | LEFT JOIN tms_tools_classify t2 on t.classify_id = t2.id |
| | | <where> |
| | | <if test="classifyId != null and classifyId != ''"> |
| | | AND t.classify_id = #{classifyId} |
| | | </if> |
| | | <if test="diameter != null and diameter != ''"> |
| | | AND t.diameter = #{diameter} |
| | | </if> |
| | | </where> |
| | | </select> |
| | | </mapper> |
| | |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="org.jeecg.modules.tms.mapper.ParaMillToolMapper"> |
| | | |
| | | <select id="selectByClassifyAndDiameter" resultType="org.jeecg.modules.tms.entity.vo.ParaMillToolVo"> |
| | | SELECT |
| | | t.id AS id, |
| | | t.classify_id AS classifyId, |
| | | t2.classify_id AS classifyNum, |
| | | t2.type_name AS classifyName, |
| | | t1.id AS toolId, |
| | | t.tool_code AS toolCode, |
| | | t.sign_code AS signCode, |
| | | t.chinese_name AS chineseName, |
| | | t.foreign_language_name AS foreignLanguageName, |
| | | t.standard_level AS standardLevel, |
| | | t.standard_code AS standardCode, |
| | | t.position_code AS positionCode, |
| | | t.tool_model AS toolModel, |
| | | t.diameter AS diameter, |
| | | t.nose_angle_r AS noseAngleR, |
| | | t.number_of_teeth AS numberOfTeeth, |
| | | t.edge_length AS edgeLength, |
| | | t.total_length AS totalLength, |
| | | t.tool_material AS toolMaterial, |
| | | t.part_material AS partMaterial, |
| | | t.paintcoat_flag AS paintcoatFlag, |
| | | t.tool_pattern AS toolPattern, |
| | | t.clamping_specifications AS clampingSpecifications, |
| | | t.cooling_method AS coolingMethod, |
| | | t.technical_conditions AS technicalConditions, |
| | | t.conditions_info AS conditionsInfo, |
| | | t.brand AS brand, |
| | | t.neck_diameter AS neckDiameter, |
| | | t.handle_form AS handleForm, |
| | | t.nose_angle_c AS noseAngleC, |
| | | t.angle_inside_r AS angleInsideR, |
| | | t.small_diameter AS smallDiameter, |
| | | t.tool_angle AS toolAngle, |
| | | t.handle_length AS handleLength, |
| | | t.main_angle_k AS mainAngleK, |
| | | t.deepest_depth AS deepestDepth, |
| | | t.adapt_blade AS adaptBlade, |
| | | t.handle_neck_form AS handleNeckForm, |
| | | t.handle_neck_length AS handleNeckLength, |
| | | t.size_specifications AS sizeSpecifications, |
| | | t.milling_head_form AS millingHeadForm, |
| | | t.overhanging_length AS overhangingLength, |
| | | t.cutting_edge_form AS cuttingEdgeForm, |
| | | t.number_patterns AS numberPatterns, |
| | | t.pitch AS pitch, |
| | | t.recently_diameter AS recentlyDiameter |
| | | FROM tms_para_mill_tool t |
| | | LEFT JOIN tms_base_tools t1 on t.tool_code = t1.id |
| | | LEFT JOIN tms_tools_classify t2 on t.classify_id = t2.id |
| | | <where> |
| | | <if test="classifyId != null and classifyId != ''"> |
| | | AND t.classify_id = #{classifyId} |
| | | </if> |
| | | <if test="diameter != null and diameter != ''"> |
| | | AND t.diameter = #{diameter} |
| | | </if> |
| | | </where> |
| | | </select> |
| | | </mapper> |
| | |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="org.jeecg.modules.tms.mapper.ParaTurningToolsMapper"> |
| | | |
| | | <select id="selectByClassifyAndDiameter" resultType="org.jeecg.modules.tms.entity.vo.ParaTurningToolsVo"> |
| | | SELECT |
| | | t.id AS id, |
| | | t.classify_id AS classifyId, |
| | | t2.classify_id AS classifyNum, |
| | | t2.type_name AS classifyName, |
| | | t1.id AS toolId, |
| | | t1.tool_code AS toolCode, |
| | | t.sign_code AS signCode, |
| | | t.chinese_name AS chineseName, |
| | | t.foreign_language_name AS foreignLanguageName, |
| | | t.standard_level AS standardLevel, |
| | | t.standard_code AS standardCode, |
| | | t.position_code AS positionCode, |
| | | t.tool_model AS toolModel, |
| | | t.head_specifications AS headSpecifications, |
| | | t.matching_number AS matchingNumber, |
| | | t.lead_angle AS leadAngle, |
| | | t.cross_sectional_size AS crossSectionalSize, |
| | | t.total_length AS totalLength, |
| | | t.cutting_direction AS cuttingDirection, |
| | | t.tool_material AS toolMaterial, |
| | | t.part_material AS partMaterial, |
| | | t.tool_pattern AS toolPattern, |
| | | t.paintcoat_flag AS paintcoatFlag, |
| | | t.technical_conditions AS technicalConditions, |
| | | t.conditions_info AS conditionsInfo, |
| | | t.brand AS brand, |
| | | t.types AS types, |
| | | t.knife_size AS knifeSize, |
| | | t.cooling_method AS coolingMethod, |
| | | t.holder_category AS holderCategory, |
| | | t.tool_diameter AS toolDiameter, |
| | | t.fastening_form AS fasteningForm, |
| | | t.boring_bar_diameter AS boringBarDiameter, |
| | | t.blade_length AS bladeLength, |
| | | t.blade_shape AS bladeShape, |
| | | t.blade_posterior AS bladePosterior, |
| | | t.bar_direction AS barDirection, |
| | | t.blade_height AS bladeHeight, |
| | | t.blade_wide AS bladeWide, |
| | | t.blade_size AS bladeSize, |
| | | t.knife_clip_model AS knifeClipModel, |
| | | t.clamping_method AS clampingMethod, |
| | | t.slot_width AS slotWidth, |
| | | t.small_diameter AS smallDiameter, |
| | | t.max_diameter AS maxDiameter, |
| | | t.max_depth AS maxDepth, |
| | | t.knife_bar_form AS knifeBarForm, |
| | | t.blade_thickness AS bladeThickness, |
| | | t.min_diameter AS minDiameter |
| | | FROM tms_para_turning_tools t |
| | | LEFT JOIN tms_base_tools t1 ON t.tool_code = t1.id |
| | | LEFT JOIN tms_tools_classify t2 on t.classify_id = t2.id |
| | | <where> |
| | | <if test="classifyId != null and classifyId != ''"> |
| | | AND t.classify_id = #{classifyId} |
| | | </if> |
| | | <if test="diameter != null and diameter != ''"> |
| | | AND t.diameter = #{diameter} |
| | | </if> |
| | | </where> |
| | | </select> |
| | | </mapper> |
| | |
| | | |
| | | import org.jeecg.modules.tms.entity.ParaHoleTools; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import org.jeecg.modules.tms.entity.vo.ParaHolesToolsVo; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Description: tms_para_hole_tools |
| | |
| | | */ |
| | | public interface IParaHoleToolsService extends IService<ParaHoleTools> { |
| | | |
| | | List<ParaHolesToolsVo> selectByClassifyAndDiameter(String classifyId, String diameter); |
| | | } |
| | |
| | | |
| | | import org.jeecg.modules.tms.entity.ParaMillTool; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import org.jeecg.modules.tms.entity.vo.ParaMillToolVo; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Description: tms_para_mill_tool |
| | |
| | | */ |
| | | public interface IParaMillToolService extends IService<ParaMillTool> { |
| | | |
| | | List<ParaMillToolVo> selectByClassifyAndDiameter(String classifyId, String diameter); |
| | | } |
| | |
| | | |
| | | import org.jeecg.modules.tms.entity.ParaTurningTools; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import org.jeecg.modules.tms.entity.vo.ParaTurningToolsVo; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Description: tms_para_turning_tools |
| | |
| | | */ |
| | | public interface IParaTurningToolsService extends IService<ParaTurningTools> { |
| | | |
| | | List<ParaTurningToolsVo> selectByClassifyAndDiameter(String classifyId, String diameter); |
| | | } |
| | |
| | | package org.jeecg.modules.tms.service.impl; |
| | | |
| | | import org.jeecg.modules.tms.entity.ParaHoleTools; |
| | | import org.jeecg.modules.tms.entity.vo.ParaHolesToolsVo; |
| | | import org.jeecg.modules.tms.mapper.ParaHoleToolsMapper; |
| | | import org.jeecg.modules.tms.service.IParaHoleToolsService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | |
| | | import java.util.Collections; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Description: tms_para_hole_tools |
| | |
| | | @Service |
| | | public class ParaHoleToolsServiceImpl extends ServiceImpl<ParaHoleToolsMapper, ParaHoleTools> implements IParaHoleToolsService { |
| | | |
| | | @Override |
| | | public List<ParaHolesToolsVo> selectByClassifyAndDiameter(String classifyId, String diameter) { |
| | | return this.baseMapper.selectByClassifyAndDiameter(classifyId, diameter); |
| | | } |
| | | } |
| | |
| | | package org.jeecg.modules.tms.service.impl; |
| | | |
| | | import org.jeecg.modules.tms.entity.ParaMillTool; |
| | | import org.jeecg.modules.tms.entity.vo.ParaMillToolVo; |
| | | import org.jeecg.modules.tms.mapper.ParaMillToolMapper; |
| | | import org.jeecg.modules.tms.service.IParaMillToolService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | |
| | | import java.util.Collections; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Description: tms_para_mill_tool |
| | |
| | | @Service |
| | | public class ParaMillToolServiceImpl extends ServiceImpl<ParaMillToolMapper, ParaMillTool> implements IParaMillToolService { |
| | | |
| | | @Override |
| | | public List<ParaMillToolVo> selectByClassifyAndDiameter(String classifyId, String diameter) { |
| | | return this.baseMapper.selectByClassifyAndDiameter(classifyId, diameter); |
| | | } |
| | | } |
| | |
| | | package org.jeecg.modules.tms.service.impl; |
| | | |
| | | import org.jeecg.modules.tms.entity.ParaTurningTools; |
| | | import org.jeecg.modules.tms.entity.vo.ParaTurningToolsVo; |
| | | import org.jeecg.modules.tms.mapper.ParaTurningToolsMapper; |
| | | import org.jeecg.modules.tms.service.IParaTurningToolsService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | |
| | | import java.util.Collections; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Description: tms_para_turning_tools |
| | |
| | | @Service |
| | | public class ParaTurningToolsServiceImpl extends ServiceImpl<ParaTurningToolsMapper, ParaTurningTools> implements IParaTurningToolsService { |
| | | |
| | | @Override |
| | | public List<ParaTurningToolsVo> selectByClassifyAndDiameter(String classifyId, String diameter) { |
| | | return this.baseMapper.selectByClassifyAndDiameter(classifyId, diameter); |
| | | } |
| | | } |