|
@@ -248,6 +248,9 @@ public class UnitDictConstantsServiceImpl extends BaseServiceImpl<UnitDictConsta
|
|
|
UnitDictBrandModelPO po = new UnitDictBrandModelPO();
|
|
|
BeanUtil.copyProperties(unitDictBrandModelDto, po);
|
|
|
po.setCreateTime(new Date());
|
|
|
+
|
|
|
+ // redis删除
|
|
|
+ delBrandRedisKey(unitDictBrandModelDto.getManufacture());
|
|
|
return unitDictBrandModelMapper.insertUseGeneratedKeys(po) > 0;
|
|
|
}
|
|
|
|
|
@@ -260,6 +263,9 @@ public class UnitDictConstantsServiceImpl extends BaseServiceImpl<UnitDictConsta
|
|
|
Example queryExample = new Example(UnitDictBrandModelPO.class);
|
|
|
Example.Criteria criteria = queryExample.createCriteria();
|
|
|
criteria.andEqualTo("id", unitDictBrandModelUpdateDto.getId());
|
|
|
+
|
|
|
+ // redis删除
|
|
|
+ delBrandRedisKey(unitDictBrandModelUpdateDto.getManufacture());
|
|
|
return unitDictBrandModelMapper.updateByExampleSelective(po, queryExample) > 0;
|
|
|
}
|
|
|
|
|
@@ -289,5 +295,14 @@ public class UnitDictConstantsServiceImpl extends BaseServiceImpl<UnitDictConsta
|
|
|
return count > 0 ? true : false;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 删除品牌对应型号
|
|
|
+ * @param brandKey
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ private void delBrandRedisKey(String brandKey){
|
|
|
+ String brandlistKey = ManagerRedisKeyConstant.build(ManagerRedisKeyConstant.IDGENERATOR_UDPB_KEY, brandKey);
|
|
|
+ cacheService.delete(brandlistKey);
|
|
|
+ }
|
|
|
|
|
|
}
|