Commit 4a3bd0c9 by 何文超

Merge branch 'developer' of…

Merge branch 'developer' of http://115.159.76.241/base_platform_enterprise/gic-webapp-plug into developer
parents c6bc06b6 e80d8736
......@@ -27,8 +27,7 @@ import org.springframework.context.annotation.ImportResource;
"classpath*:dubbo-setting.xml",
"classpath*:dubbo-gic-webapp-plug.xml",
"classpath*:spring-interceptor.xml",
"classpath*:redis-init.xml",
"classpath:web-common-spring.xml"
"classpath*:redis-init.xml"
})
public class Main {
......
package com.gic.plug.web.controller;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.gic.api.base.commons.ServiceResponse;
......@@ -13,21 +24,10 @@ import com.gic.redis.data.util.RedisUtil;
import com.gic.store.constant.StoreFieldDateEnum;
import com.gic.store.constant.StoreFieldTextEnum;
import com.gic.store.constant.StoreFieldTypeEnum;
import com.gic.store.constant.StoreGroupConstant;
import com.gic.store.dto.StoreFieldDTO;
import com.gic.store.dto.StoreFieldSelectDTO;
import com.gic.store.service.StoreFieldApiService;
import com.gic.store.service.StoreFieldSelectApiService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @author guojx
......@@ -91,7 +91,8 @@ public class StoreFieldController {
@RequestMapping("/list-store-field")
public RestResponse listStoreField(String search) {
Integer enterpriseId = UserDetailUtils.getUserDetail().getEnterpriseId();
ServiceResponse<List<StoreFieldDTO>> result = storeFieldApiService.listStoreField(StoreGroupConstant.TEST_ENTERPRISE_ID, search);
ServiceResponse<List<StoreFieldDTO>> result = storeFieldApiService
.listStoreField(UserDetailUtils.getUserDetail().getEnterpriseInfo().getEnterpriseId(), search);
if (result.isSuccess()) {
return RestResponse.success(transferDtoToVo(result.getResult(), enterpriseId));
......@@ -102,7 +103,8 @@ public class StoreFieldController {
@RequestMapping("/list-store-field-select")
public RestResponse listStoreFieldSelect(String search, Integer storeFieldId) {
ServiceResponse<List<StoreFieldSelectDTO>> result = storeFieldSelectApiService.listStoreFieldSelect(storeFieldId, search);
ServiceResponse<List<StoreFieldSelectDTO>> result = storeFieldSelectApiService
.listStoreFieldSelect(storeFieldId, search);
if (result.isSuccess()) {
return RestResponse.success(EntityUtil.changeEntityListNew(StoreFieldSelectVO.class, result.getResult()));
} else {
......@@ -111,16 +113,16 @@ public class StoreFieldController {
}
private List<StoreFieldRegionVO> transferDtoToVo(List<StoreFieldDTO> dtoList, Integer enterpriseId) {
String key = "enterprise:store:storeField:"+enterpriseId+":";
String key = "enterprise:store:storeField:" + enterpriseId + ":";
List<StoreFieldRegionVO> voList = new ArrayList<>(dtoList.size());
for (StoreFieldDTO dto : dtoList) {
//不需要文本类型字段
if (dto.getStoreFieldType().intValue() != StoreFieldTypeEnum.TEXT.getCode()) {
Object obj = RedisUtil.getCache(key+dto.getStoreFieldId());
if(obj != null){
Object obj = RedisUtil.getCache(key + dto.getStoreFieldId());
if (obj != null) {
StoreFieldRegionVO vo = EntityUtil.changeEntityNew(StoreFieldRegionVO.class, dto);
vo.setStoreFieldKey(obj.toString());
if(vo.getStoreFieldType().intValue() == StoreFieldTypeEnum.DATE.getCode()){
if (vo.getStoreFieldType().intValue() == StoreFieldTypeEnum.DATE.getCode()) {
JSONObject json = JSON.parseObject(dto.getStoreFieldDetail());
vo.setDateType(json.getIntValue("dateType"));
}
......
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