|
@@ -13,6 +13,7 @@ import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
|
|
|
+import java.net.URLDecoder;
|
|
|
import java.util.*;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
@@ -78,7 +79,7 @@ public class IndicatorDictionaryServiceImpl extends ServiceImpl<IndicatorDiction
|
|
|
|
|
|
@Transactional
|
|
|
@Override
|
|
|
- public boolean dictionarySaveBatch(List<IndicatorDictionaryDTO> dictionarys) {
|
|
|
+ public boolean dictionarySaveBatch(List<IndicatorDictionaryDTO> dictionarys) throws Exception{
|
|
|
|
|
|
|
|
|
boolean b = false;
|
|
@@ -90,6 +91,10 @@ public class IndicatorDictionaryServiceImpl extends ServiceImpl<IndicatorDiction
|
|
|
}
|
|
|
|
|
|
for (IndicatorDictionary i : dto.getList()) {
|
|
|
+
|
|
|
+ String decode = URLDecoder.decode(i.getFormula(), "UTF-8");
|
|
|
+ String formula = decode.replaceAll(" ", "+");
|
|
|
+
|
|
|
if (null != i && (null == i.getId() || "".equals(i.getId().trim()))) {
|
|
|
QueryWrapper<IndicatorDictionary> qw = new QueryWrapper<>();
|
|
|
qw.lambda().eq(IndicatorDictionary::getIndicatorId, i.getIndicatorId());
|
|
@@ -100,11 +105,13 @@ public class IndicatorDictionaryServiceImpl extends ServiceImpl<IndicatorDiction
|
|
|
throw new CustomException("当前属性code已存在");
|
|
|
}
|
|
|
i.setChildCode(dto.getChildCode());
|
|
|
+ i.setFormula(formula);
|
|
|
i.setChildName(dto.getChildName());
|
|
|
i.setCreateTime(new Date());
|
|
|
i.setOptionName(null == CacheContext.ddNameMap.get(i.getOptionCode()) ? "未知属性" : CacheContext.ddNameMap.get(i.getOptionCode()));
|
|
|
} else {
|
|
|
i.setChildCode(dto.getChildCode());
|
|
|
+ i.setFormula(formula);
|
|
|
i.setChildName(dto.getChildName());
|
|
|
i.setOptionName(null == CacheContext.ddNameMap.get(i.getOptionCode()) ? "未知属性" : CacheContext.ddNameMap.get(i.getOptionCode()));
|
|
|
i.setUpdateTime(new Date());
|