Commit 200136ac by zhiwj

门店自定义字段

parent aecb7d8d
......@@ -39,6 +39,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.math.BigDecimal;
import java.util.*;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.TimeUnit;
......@@ -1344,16 +1345,19 @@ public class StoreApiServiceImpl implements StoreApiService {
for (StoreExtendDTO extendDTO : storeExtendDTOList) {
String key = "enterprise:store:storeField:" + enterpriseId + ":" + extendDTO.getStoreFieldId();
Object existObj = RedisUtil.getCache(key);
if (existObj != null && extendDTO.getStoreFieldType().intValue() != StoreFieldTypeEnum.TEXT.getCode()) {
if (extendDTO.getStoreFieldType().intValue() == StoreFieldTypeEnum.DATE.getCode()) {
if (existObj != null && extendDTO.getStoreFieldType() != StoreFieldTypeEnum.TEXT.getCode()) {
if (extendDTO.getStoreFieldType() == StoreFieldTypeEnum.DATE.getCode()) {
String value = null;
if(StringUtils.isNotBlank(extendDTO.getValue())){
value = extendDTO.getValue().replaceAll("-", "").
replaceAll(":", "").replaceAll(" ", "");
}
jsonObject.put(existObj.toString(), value == null ? 0l : Long.valueOf(value));
} else if (extendDTO.getStoreFieldType().intValue() == StoreFieldTypeEnum.CHECK.getCode()) {
} else if (extendDTO.getStoreFieldType() == StoreFieldTypeEnum.CHECK.getCode()) {
jsonObject.put(existObj.toString(), StringUtils.isBlank(extendDTO.getValue()) ? 0 : Stream.of(extendDTO.getValue().split(",")).map(Long::valueOf).collect(Collectors.toList()));
} else if (extendDTO.getStoreFieldType() == StoreFieldTypeEnum.REAL_NUMBER.getCode()) {
jsonObject.put(existObj.toString(), StringUtils.isBlank(extendDTO.getValue()) ? 0 : new BigDecimal(extendDTO.getValue()).multiply(new BigDecimal(100000)).longValue());
} else {
jsonObject.put(existObj.toString(), StringUtils.isBlank(extendDTO.getValue()) ? 0 : Long.valueOf(extendDTO.getValue()));
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment