修改根据零件号获取关键零部件名称

This commit is contained in:
梁琦涛
2024-10-08 11:38:43 +08:00
parent ca05394a9e
commit 959d938ae0
@@ -13,9 +13,11 @@ import com.jero.common.system.base.controller.JeroController;
import com.jero.common.system.query.QueryGenerator;
import com.jero.common.system.vo.LoginUser;
import com.jero.modules.laws.part.constans.PartConstants;
import com.jero.modules.laws.part.entity.LawsPartInfo;
import com.jero.modules.laws.part.entity.LawsPartRelevance;
import com.jero.modules.laws.part.entity.LawsPartType;
import com.jero.modules.laws.part.mapper.LawsPartTypeMapper;
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;
@@ -45,6 +47,8 @@ public class LawsPartTypeServiceImpl extends ServiceImpl<LawsPartTypeMapper, Law
private LawsPartTypeMapper lawsPartTypeMapper;
@Resource
private ILawsPartRelevanceService lawsPartRelevanceService;
@Resource
private ILawsPartInfoService lawsPartInfoService;
@Override
public IPage<LawsPartType> queryPage(LawsPartType lawsPartType, Integer pageNo,
@@ -184,14 +188,14 @@ public class LawsPartTypeServiceImpl extends ServiceImpl<LawsPartTypeMapper, Law
@Override
public LawsPartRelevance queryByPartNum(String partNum) {
LambdaQueryWrapper<LawsPartType> queryLawsPartType = new LambdaQueryWrapper<>();
queryLawsPartType.eq(LawsPartType::getPartNum,partNum);
LawsPartType lawsPartType = getOne(queryLawsPartType,false);
if(Objects.isNull(lawsPartType)){
LambdaQueryWrapper<LawsPartInfo> queryLawsPartInfo = new LambdaQueryWrapper<>();
queryLawsPartInfo.eq(LawsPartInfo::getPartNum,partNum);
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(fnd_gpc," + lawsPartType.getFndGpc() + ")", 0);
queryLawsPartRelevance.gt("FIND_IN_SET(fnd_gpc,'" + lawsPartInfo.getFndGpc() + "')", 0);
LawsPartRelevance lawsPartRelevance = lawsPartRelevanceService.getOne(queryLawsPartRelevance,false);
if(Objects.isNull(lawsPartRelevance)){
throw new JeroBootException(ResultCommon.NO_CORRESPONDING_DATA_FOUND);