|
|
|
@ -106,16 +106,16 @@ public class UdiProductServiceImpl implements UdiProductService {
|
|
|
|
|
public boolean insertUdiInfo(UdiProductEntity udiProductEntity) {
|
|
|
|
|
if (udiProductEntity.getId() == null) {
|
|
|
|
|
udiProductEntity.setId(IdUtil.getSnowflakeNextId());
|
|
|
|
|
if(StrUtil.isNotBlank(udiProductEntity.getCpmctymc())){
|
|
|
|
|
try {
|
|
|
|
|
String pinyin= PinyinUtils.converterToFirstSpell(udiProductEntity.getCpmctymc());
|
|
|
|
|
udiProductEntity.setPinyinInitial(pinyin);
|
|
|
|
|
}catch (Exception e){
|
|
|
|
|
logger.error(ExceptionUtils.getStackTrace(e));
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
if(StrUtil.isNotBlank(udiProductEntity.getCpmctymc()) && StrUtil.isBlank(udiProductEntity.getPinyinInitial())){
|
|
|
|
|
try {
|
|
|
|
|
String pinyin= PinyinUtils.converterToFirstSpell(udiProductEntity.getCpmctymc());
|
|
|
|
|
udiProductEntity.setPinyinInitial(pinyin);
|
|
|
|
|
}catch (Exception e){
|
|
|
|
|
logger.error(ExceptionUtils.getStackTrace(e));
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
return udiProductDao.insertUdiInfo(udiProductEntity);
|
|
|
|
|
}
|
|
|
|
|