|
@@ -83,24 +83,24 @@ public class UnitServiceImpl implements UnitService {
|
|
|
|
|
|
@Override
|
|
|
public List<String> getBrandModelNameOrModelNumber(UnitDictBrandModelDto unitDictBrandModelDto) {
|
|
|
- if(StringUtils.isEmpty(unitDictBrandModelDto.getManufacture())){
|
|
|
- return unitDictConstantsService.getUnitDictBrandModelList(unitDictBrandModelDto);
|
|
|
+ if (StringUtils.isEmpty(unitDictBrandModelDto.getManufacture())) {
|
|
|
+ return unitDictConstantsService.getUnitDictBrandModelList(unitDictBrandModelDto);
|
|
|
}
|
|
|
String brandlistKey = ManagerRedisKeyConstant.build(ManagerRedisKeyConstant.IDGENERATOR_UDPB_KEY, unitDictBrandModelDto.getManufacture());
|
|
|
String val = cacheService.get(brandlistKey);
|
|
|
- if(StringUtils.isEmpty(val)){
|
|
|
+ if (StringUtils.isEmpty(val)) {
|
|
|
List<String> valueString = unitDictConstantsService.getUnitDictBrandModelList(unitDictBrandModelDto);
|
|
|
log.info("品牌对应型号 ===> " + JSON.toJSONString(valueString));
|
|
|
cacheService.add(brandlistKey, JSON.toJSONString(valueString));
|
|
|
return valueString;
|
|
|
}
|
|
|
- List<String> modelList = JSONArray.parseArray(val,String.class);
|
|
|
+ List<String> modelList = JSONArray.parseArray(val, String.class);
|
|
|
return modelList;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
- public boolean modificationUnit(UnitDto unitDto,Integer userId) {
|
|
|
+ public boolean modificationUnit(UnitDto unitDto, Integer userId) {
|
|
|
|
|
|
boolean flg = false;
|
|
|
// 处理主轴
|
|
@@ -185,7 +185,7 @@ public class UnitServiceImpl implements UnitService {
|
|
|
|
|
|
}
|
|
|
|
|
|
- if(unitGearboxPO!=null){
|
|
|
+ if (unitGearboxPO != null) {
|
|
|
// 处理齿轮箱轴承处理
|
|
|
if (!CollectionUtils.isEmpty(unitDto.getUnitGearDto().getUnitGearboxBearingsDtoList())) {
|
|
|
UnitGearboxBearingsPO unitGearboxBearingsPO = null;
|
|
@@ -309,4 +309,26 @@ public class UnitServiceImpl implements UnitService {
|
|
|
}
|
|
|
return unitVo;
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public boolean verifyUnitBearingByMillTypeCode(String millTypeCode) {
|
|
|
+
|
|
|
+ Example queryExample = new Example(UnitBearingsPO.class);
|
|
|
+ Example.Criteria criteria = queryExample.createCriteria();
|
|
|
+ criteria.andEqualTo("millTypeCode", millTypeCode);
|
|
|
+
|
|
|
+ return unitBearingsMapper.selectCountByExample(queryExample) > 0 ? false : true;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public boolean verifyUnitDynamoByMillTypeCode(String millTypeCode) {
|
|
|
+
|
|
|
+ Example queryExample = new Example(UnitDynamoPO.class);
|
|
|
+ Example.Criteria criteria = queryExample.createCriteria();
|
|
|
+ criteria.andEqualTo("millTypeCode", millTypeCode);
|
|
|
+
|
|
|
+ return unitDynamoMapper.selectCountByExample(queryExample) > 0 ? false : true;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
}
|