修改根据根据零件号获取关键零部件名称接口
This commit is contained in:
+1
-1
@@ -201,7 +201,7 @@ public class LawsPartTypeController {
|
||||
@ApiOperationSupport(order = 2)
|
||||
@Translation
|
||||
public Result<List<LawsPartRelevance>> queryByPartNum(LawsPartType lawsPartType) {
|
||||
List<LawsPartRelevance> result = lawsPartTypeService.queryByPartNum(lawsPartType.getPartNum());
|
||||
List<LawsPartRelevance> result = lawsPartTypeService.queryByPartNum(lawsPartType);
|
||||
return Result.OK(result);
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -30,7 +30,7 @@ public interface ILawsPartTypeService extends IService<LawsPartType> {
|
||||
|
||||
ModelAndView export(LawsPartType lawsPartType, HttpServletRequest request);
|
||||
|
||||
List<LawsPartRelevance> queryByPartNum(String partNum);
|
||||
List<LawsPartRelevance> queryByPartNum(LawsPartType lawsPartType);
|
||||
|
||||
List<LawsPartType> queryByPartNumList(String partNum);
|
||||
}
|
||||
|
||||
+7
-2
@@ -189,15 +189,20 @@ public class LawsPartTypeServiceImpl extends ServiceImpl<LawsPartTypeMapper, Law
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<LawsPartRelevance> queryByPartNum(String partNum) {
|
||||
public List<LawsPartRelevance> queryByPartNum(LawsPartType lawsPartType) {
|
||||
if(StringUtils.isEmpty(lawsPartType.getPartNum())){
|
||||
throw new JeroBootException(ResultCommon.PARAMETER_NOT_RECOGNIZED);
|
||||
}
|
||||
LambdaQueryWrapper<LawsPartInfo> queryLawsPartInfo = new LambdaQueryWrapper<>();
|
||||
queryLawsPartInfo.eq(LawsPartInfo::getPartNum,partNum);
|
||||
queryLawsPartInfo.eq(LawsPartInfo::getPartNum,lawsPartType.getPartNum());
|
||||
LawsPartInfo lawsPartInfo = lawsPartInfoService.getOne(queryLawsPartInfo,false);
|
||||
if(Objects.isNull(lawsPartInfo)){
|
||||
throw new JeroBootException(ResultCommon.NO_CORRESPONDING_DATA_FOUND);
|
||||
}
|
||||
QueryWrapper<LawsPartRelevance> queryLawsPartRelevance = new QueryWrapper<>();
|
||||
queryLawsPartRelevance.gt("FIND_IN_SET('" + lawsPartInfo.getFndGpc() + "',fnd_gpc)", 0);
|
||||
queryLawsPartRelevance.like(!StringUtils.isEmpty(lawsPartType.getRegPartNameCn()),"reg_part_name_cn",
|
||||
lawsPartType.getRegPartNameCn());
|
||||
queryLawsPartRelevance.orderByDesc("create_time");
|
||||
List<LawsPartRelevance> lawsPartRelevanceList = lawsPartRelevanceService.list(queryLawsPartRelevance);
|
||||
if(CollectionUtils.isEmpty(lawsPartRelevanceList)){
|
||||
|
||||
Reference in New Issue
Block a user