修改根据根据零件号获取关键零部件名称接口
This commit is contained in:
+2
-2
@@ -200,8 +200,8 @@ public class LawsPartTypeController {
|
||||
@GetMapping(value = "/queryByPartNum")
|
||||
@ApiOperationSupport(order = 2)
|
||||
@Translation
|
||||
public Result<LawsPartRelevance> queryByPartNum(LawsPartType lawsPartType) {
|
||||
LawsPartRelevance result = lawsPartTypeService.queryByPartNum(lawsPartType.getPartNum());
|
||||
public Result<List<LawsPartRelevance>> queryByPartNum(LawsPartType lawsPartType) {
|
||||
List<LawsPartRelevance> result = lawsPartTypeService.queryByPartNum(lawsPartType.getPartNum());
|
||||
return Result.OK(result);
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -30,7 +30,7 @@ public interface ILawsPartTypeService extends IService<LawsPartType> {
|
||||
|
||||
ModelAndView export(LawsPartType lawsPartType, HttpServletRequest request);
|
||||
|
||||
LawsPartRelevance queryByPartNum(String partNum);
|
||||
List<LawsPartRelevance> queryByPartNum(String partNum);
|
||||
|
||||
List<LawsPartType> queryByPartNumList(String partNum);
|
||||
}
|
||||
|
||||
+7
-5
@@ -20,6 +20,7 @@ import com.jero.modules.laws.part.service.ILawsPartInfoService;
|
||||
import com.jero.modules.laws.part.service.ILawsPartRelevanceService;
|
||||
import com.jero.modules.laws.part.service.ILawsPartTypeService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.shiro.SecurityUtils;
|
||||
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
|
||||
@@ -188,7 +189,7 @@ public class LawsPartTypeServiceImpl extends ServiceImpl<LawsPartTypeMapper, Law
|
||||
}
|
||||
|
||||
@Override
|
||||
public LawsPartRelevance queryByPartNum(String partNum) {
|
||||
public List<LawsPartRelevance> queryByPartNum(String partNum) {
|
||||
LambdaQueryWrapper<LawsPartInfo> queryLawsPartInfo = new LambdaQueryWrapper<>();
|
||||
queryLawsPartInfo.eq(LawsPartInfo::getPartNum,partNum);
|
||||
LawsPartInfo lawsPartInfo = lawsPartInfoService.getOne(queryLawsPartInfo,false);
|
||||
@@ -197,11 +198,12 @@ public class LawsPartTypeServiceImpl extends ServiceImpl<LawsPartTypeMapper, Law
|
||||
}
|
||||
QueryWrapper<LawsPartRelevance> queryLawsPartRelevance = new QueryWrapper<>();
|
||||
queryLawsPartRelevance.gt("FIND_IN_SET('" + lawsPartInfo.getFndGpc() + "',fnd_gpc)", 0);
|
||||
LawsPartRelevance lawsPartRelevance = lawsPartRelevanceService.getOne(queryLawsPartRelevance,false);
|
||||
if(Objects.isNull(lawsPartRelevance)){
|
||||
throw new JeroBootException(ResultCommon.NO_CORRESPONDING_DATA_FOUND);
|
||||
queryLawsPartRelevance.orderByDesc("create_time");
|
||||
List<LawsPartRelevance> lawsPartRelevanceList = lawsPartRelevanceService.list(queryLawsPartRelevance);
|
||||
if(CollectionUtils.isEmpty(lawsPartRelevanceList)){
|
||||
throw new JeroBootException(lawsPartInfo.getPartName() + "没有绑定数据,请联系标准管理员维护绑定关系。");
|
||||
}
|
||||
return lawsPartRelevance;
|
||||
return lawsPartRelevanceList;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user