Commit b74abfcf by Suvalue

板块指数接口调整

parent bed28007
package com.bsoft.api.controller; package com.bsoft.api.controller;
import com.bsoft.api.common.Result; import com.bsoft.api.common.Result;
import com.bsoft.api.common.annotations.CurrentUser;
import com.bsoft.api.common.annotations.Token; import com.bsoft.api.common.annotations.Token;
import com.bsoft.api.model.reqmodel.BlockValues; import com.bsoft.api.model.reqmodel.BlockValues;
import com.bsoft.api.model.reqmodel.BlockValuesNew; import com.bsoft.api.model.reqmodel.BlockValuesNew;
...@@ -28,6 +29,7 @@ public class BlockValuesController { ...@@ -28,6 +29,7 @@ public class BlockValuesController {
/** /**
* 根据pageId查询板块数值 * 根据pageId查询板块数值
*
* @return * @return
* @throws Exception * @throws Exception
*/ */
...@@ -37,22 +39,23 @@ public class BlockValuesController { ...@@ -37,22 +39,23 @@ public class BlockValuesController {
@ApiOperation("根据Page查询板块数值") @ApiOperation("根据Page查询板块数值")
public Object getBlockValuesByPageID(@RequestBody BlockValues blockValues) throws InterruptedException { public Object getBlockValuesByPageID(@RequestBody BlockValues blockValues) throws InterruptedException {
List<BlockValue> list= blockValuesService.getBlockValuesByPageCode(blockValues.getPageCode(), List<BlockValue> list = blockValuesService.getBlockValuesByPageCode(blockValues.getPageCode(),
blockValues.getDisease(), blockValues.getDoctor(),blockValues.getDepartment(),blockValues.getTime()); blockValues.getDisease(),blockValues.getDoctor(),blockValues.getDepartment(),blockValues.getTime());
return Result.success(list); return Result.success(list);
} }
/** /**
* 根据pageId查询板块数值 * 根据pageId查询板块数值
*
* @return * @return
* @throws Exception * @throws Exception
*/ */
@PostMapping("blockValuesNew") @PostMapping("blockValuesNew")
@Token @Token
@ApiOperation("根据Page查询板块数值") @ApiOperation("根据Page查询板块数值")
public Object getBlockValuesByPageIDNew(@RequestBody BlockValuesNew blockValues) throws InterruptedException { public Object getBlockValuesByPageIDNew(@ApiIgnore @CurrentUser Long userId,@RequestBody BlockValuesNew blockValues) throws InterruptedException {
List<BlockValue> list= blockValuesService.getBlockValuesByPageCodeNew(blockValues.getPageCode(),blockValues.getDim()); List<BlockValue> list = blockValuesService.getBlockValuesByPageCodeNew(userId,blockValues.getPageCode(),blockValues.getDim());
return Result.success(list); return Result.success(list);
} }
} }
\ No newline at end of file
...@@ -6,7 +6,7 @@ import java.util.List; ...@@ -6,7 +6,7 @@ import java.util.List;
import java.util.Map; import java.util.Map;
public interface BlockValuesService { public interface BlockValuesService {
List<BlockValue> getBlockValuesByPageCode(Integer pageCode, Integer disease, Integer doctor, Integer department, Integer time) throws InterruptedException; List<BlockValue> getBlockValuesByPageCode(Integer pageCode,Integer disease,Integer doctor,Integer department,Integer time) throws InterruptedException;
List<BlockValue> getBlockValuesByPageCodeNew(Integer pageCode, Map<String,String> dim) throws InterruptedException; List<BlockValue> getBlockValuesByPageCodeNew(Long userId,Integer pageCode,Map<String,String> dim) throws InterruptedException;
} }
...@@ -98,7 +98,7 @@ public class BlockValuesServiceImpl implements BlockValuesService { ...@@ -98,7 +98,7 @@ public class BlockValuesServiceImpl implements BlockValuesService {
} }
@Override @Override
public List<BlockValue> getBlockValuesByPageCodeNew(Integer pageCode,Map<String,String> dim) throws InterruptedException { public List<BlockValue> getBlockValuesByPageCodeNew(Long userId,Integer pageCode,Map<String,String> dim) throws InterruptedException {
/** /**
* 1.根据pageCode查询所有对应的pageId * 1.根据pageCode查询所有对应的pageId
* 查询要求为pageCode为当前pageCode,相同pageId的所有数据有且仅有DIM_ID为 * 查询要求为pageCode为当前pageCode,相同pageId的所有数据有且仅有DIM_ID为
...@@ -122,6 +122,10 @@ public class BlockValuesServiceImpl implements BlockValuesService { ...@@ -122,6 +122,10 @@ public class BlockValuesServiceImpl implements BlockValuesService {
for(Iterator iterator = inFields.iterator();iterator.hasNext();){ for(Iterator iterator = inFields.iterator();iterator.hasNext();){
Object obj = iterator.next(); Object obj = iterator.next();
Object value = dim.get(obj); Object value = dim.get(obj);
if(value instanceof String){
String valueNew = dim.get(obj);
dim.put(String.valueOf(obj),valueNew.trim());
}
remove(value,iterator); remove(value,iterator);
} }
...@@ -131,6 +135,9 @@ public class BlockValuesServiceImpl implements BlockValuesService { ...@@ -131,6 +135,9 @@ public class BlockValuesServiceImpl implements BlockValuesService {
throw new DBConfigurationError("页面维度配置表错误,请联系管理员"); throw new DBConfigurationError("页面维度配置表错误,请联系管理员");
} }
//将用户信息配置进参数
dim.put("USER",String.valueOf(userId));
SerPage page = pageList.get(0); SerPage page = pageList.get(0);
//根据pageId查询所有板块 //根据pageId查询所有板块
......
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