|
|
|
@ -115,6 +115,18 @@ public class UdiProductServiceImpl implements UdiProductService {
|
|
|
|
|
if (udiProductEntity.getId() == null) {
|
|
|
|
|
udiProductEntity.setId(IdUtil.getSnowflakeNextId());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//医保编码解析
|
|
|
|
|
String catalogcode = udiProductEntity.getCatalogcode();
|
|
|
|
|
if (catalogcode.length() >= 7){
|
|
|
|
|
Integer catalogcode1 = Integer.valueOf(catalogcode.substring(1, 3));
|
|
|
|
|
Integer catalogcode2 = Integer.valueOf(catalogcode1 + catalogcode.substring(3, 5));
|
|
|
|
|
Integer catalogcode3 = Integer.valueOf(catalogcode2 + catalogcode.substring(5, 7));
|
|
|
|
|
udiProductEntity.setCatalogCode1(catalogcode1);
|
|
|
|
|
udiProductEntity.setCatalogCode2(catalogcode2);
|
|
|
|
|
udiProductEntity.setCatalogCode3(catalogcode3);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return udiProductDao.insertUdiInfo(udiProductEntity);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -136,12 +148,33 @@ public class UdiProductServiceImpl implements UdiProductService {
|
|
|
|
|
if (StrUtil.isEmpty(udiProductEntity.getUuid()))
|
|
|
|
|
return false;
|
|
|
|
|
udiProductEntity.setUpdateTime(new Date());
|
|
|
|
|
//医保编码解析
|
|
|
|
|
String catalogcode = udiProductEntity.getCatalogcode();
|
|
|
|
|
if (catalogcode.length() >= 7){
|
|
|
|
|
Integer catalogcode1 = Integer.valueOf(catalogcode.substring(1, 3));
|
|
|
|
|
Integer catalogcode2 = Integer.valueOf(catalogcode1 + catalogcode.substring(3, 5));
|
|
|
|
|
Integer catalogcode3 = Integer.valueOf(catalogcode2 + catalogcode.substring(5, 7));
|
|
|
|
|
udiProductEntity.setCatalogCode1(catalogcode1);
|
|
|
|
|
udiProductEntity.setCatalogCode2(catalogcode2);
|
|
|
|
|
udiProductEntity.setCatalogCode3(catalogcode3);
|
|
|
|
|
}
|
|
|
|
|
return udiProductDao.updateUdiInfoByUuid(udiProductEntity);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public boolean updateUdiInfoById(UdiProductEntity udiProductEntity) {
|
|
|
|
|
udiProductEntity.setUpdateTime(new Date());
|
|
|
|
|
//医保编码解析
|
|
|
|
|
String catalogcode = udiProductEntity.getCatalogcode();
|
|
|
|
|
if (catalogcode.length() >= 7){
|
|
|
|
|
Integer catalogcode1 = Integer.valueOf(catalogcode.substring(1, 3));
|
|
|
|
|
Integer catalogcode2 = Integer.valueOf(catalogcode1 + catalogcode.substring(3, 5));
|
|
|
|
|
Integer catalogcode3 = Integer.valueOf(catalogcode2 + catalogcode.substring(5, 7));
|
|
|
|
|
udiProductEntity.setCatalogCode1(catalogcode1);
|
|
|
|
|
udiProductEntity.setCatalogCode2(catalogcode2);
|
|
|
|
|
udiProductEntity.setCatalogCode3(catalogcode3);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return udiProductDao.updateUdiInfoById(udiProductEntity);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|