Commit 6ea28e55 by 宋振民

feat:新增病例清单报表

parent a820efe6
...@@ -16,6 +16,7 @@ import org.springframework.web.bind.annotation.RestController; ...@@ -16,6 +16,7 @@ import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore; import springfox.documentation.annotations.ApiIgnore;
import java.util.List; import java.util.List;
import java.util.Map;
@Api(tags = "板块数值Api") @Api(tags = "板块数值Api")
@RestController @RestController
...@@ -57,4 +58,32 @@ public class BlockValuesController { ...@@ -57,4 +58,32 @@ public class BlockValuesController {
List<BlockValue> list = blockValuesService.getBlockValuesByPageCodeNew(userId,blockValues.getPageCode(),blockValues.getDim()); List<BlockValue> list = blockValuesService.getBlockValuesByPageCodeNew(userId,blockValues.getPageCode(),blockValues.getDim());
return Result.success(list); return Result.success(list);
} }
/**
* 根据Page获取自定义报表标题信息
*
* @return
* @throws Exception
*/
@PostMapping("customBlockValues")
@Token
@ApiOperation("根据Page获取报表标题信息")
public Object getCustomBlockValuesByPageCode(@ApiIgnore @CurrentUser Long userId,@RequestBody BlockValuesNew blockValues) throws InterruptedException {
Map<String, List> titleMap = blockValuesService.getCustomBlockValuesByPageCode(userId, blockValues.getPageCode(), blockValues.getDim());
return Result.success(titleMap);
}
/**
* 查询自定义报表开关状态
*
* @return
* @throws Exception
*/
@PostMapping("customBlockValuesState")
@Token
@ApiOperation("查询自定义报表开关状态")
public Object getCustomBlockTitlesState() throws InterruptedException {
boolean state = blockValuesService.getCustomBlockState();
return Result.success(state);
}
} }
\ No newline at end of file
package com.hs.api.mapper; package com.hs.api.mapper;
import com.hs.api.model.SerCustomPageField;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -7,4 +9,8 @@ public interface BlockValuesMapper { ...@@ -7,4 +9,8 @@ public interface BlockValuesMapper {
List<Map<String,Object>> selectByWhere(String tableName,String whereSql); List<Map<String,Object>> selectByWhere(String tableName,String whereSql);
List<Map<String,Object>> selectByWhereNew(Map<String,String> map); List<Map<String,Object>> selectByWhereNew(Map<String,String> map);
List<SerCustomPageField> selectCustomBlockInd();
int selectCustomBlockState();
} }
package com.hs.api.model;
import java.util.Date;
import java.util.List;
public class SerCustomPageField {
private Long id;
private Date createDate;
private Long createUserid;
private Short state;
private String pageId;
private String hosCode;
private String indName;
private String indCode;
private String indField;
private int type;
private int xh;
private int describe;
private List<SerCustomPageField> children;
private String parentIndCode;
private boolean display;
public Date getCreateDate() {
return createDate;
}
public void setCreateDate(Date createDate) {
this.createDate = createDate;
}
public Long getCreateUserid() {
return createUserid;
}
public void setCreateUserid(Long createUserid) {
this.createUserid = createUserid;
}
public Short getState() {
return state;
}
public void setState(Short state) {
this.state = state;
}
public String getPageId() {
return pageId;
}
public void setPageId(String pageId) {
this.pageId = pageId;
}
public String getHosCode() {
return hosCode;
}
public void setHosCode(String hosCode) {
this.hosCode = hosCode;
}
public String getIndName() {
return indName;
}
public void setIndName(String indName) {
this.indName = indName;
}
public String getIndCode() {
return indCode;
}
public void setIndCode(String indCode) {
this.indCode = indCode;
}
public String getIndField() {
return indField;
}
public void setIndField(String indField) {
this.indField = indField;
}
public int getType() {
return type;
}
public void setType(int type) {
this.type = type;
}
public int getXh() {
return xh;
}
public void setXh(int xh) {
this.xh = xh;
}
public int getDescribe() {
return describe;
}
public void setDescribe(int describe) {
this.describe = describe;
}
public boolean isDisplay() {
return display;
}
public void setDisplay(boolean display) {
this.display = display;
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getParentIndCode() {
return parentIndCode;
}
public void setParentIndCode(String parentIndCode) {
this.parentIndCode = parentIndCode;
}
public List<SerCustomPageField> getChildren() {
return children;
}
public void setChildren(List<SerCustomPageField> children) {
this.children = children;
}
}
\ No newline at end of file
...@@ -9,4 +9,8 @@ public interface BlockValuesService { ...@@ -9,4 +9,8 @@ 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(Long userId,Integer pageCode,Map<String,String> dim) throws InterruptedException; List<BlockValue> getBlockValuesByPageCodeNew(Long userId,Integer pageCode,Map<String,String> dim) throws InterruptedException;
Map<String,List> getCustomBlockValuesByPageCode(Long userId,Integer pageCode,Map<String,String> dim) throws InterruptedException;
boolean getCustomBlockState();
} }
package com.hs.api.service.Impl; package com.hs.api.service.Impl;
import com.hs.api.common.exceptions.DBConfigurationError; import com.hs.api.common.exceptions.DBConfigurationError;
import com.hs.api.mapper.BlockValuesMapper;
import com.hs.api.mapper.SerPageBlockRsMapper; import com.hs.api.mapper.SerPageBlockRsMapper;
import com.hs.api.mapper.SerPageMapper; import com.hs.api.mapper.SerPageMapper;
import com.hs.api.model.SerCustomPageField;
import com.hs.api.model.SerPage; import com.hs.api.model.SerPage;
import com.hs.api.model.SerPageBlockRs; import com.hs.api.model.SerPageBlockRs;
import com.hs.api.model.respmodel.BlockValue; import com.hs.api.model.respmodel.BlockValue;
...@@ -14,6 +16,8 @@ import org.springframework.stereotype.Service; ...@@ -14,6 +16,8 @@ import org.springframework.stereotype.Service;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.*; import java.util.*;
import java.util.concurrent.CountDownLatch; import java.util.concurrent.CountDownLatch;
import java.util.stream.Collector;
import java.util.stream.Collectors;
@Service @Service
public class BlockValuesServiceImpl implements BlockValuesService { public class BlockValuesServiceImpl implements BlockValuesService {
...@@ -23,6 +27,8 @@ public class BlockValuesServiceImpl implements BlockValuesService { ...@@ -23,6 +27,8 @@ public class BlockValuesServiceImpl implements BlockValuesService {
@Resource @Resource
private SerPageMapper serPageMapper; private SerPageMapper serPageMapper;
@Resource @Resource
private BlockValuesMapper blockValuesMapper;
@Resource
private AsynBlockValuesService asynBlockValuesServiceImpl; private AsynBlockValuesService asynBlockValuesServiceImpl;
...@@ -155,6 +161,20 @@ public class BlockValuesServiceImpl implements BlockValuesService { ...@@ -155,6 +161,20 @@ public class BlockValuesServiceImpl implements BlockValuesService {
} }
@Override
public Map<String,List> getCustomBlockValuesByPageCode(Long userId, Integer pageCode, Map<String, String> dim) throws InterruptedException {
Map resultMap = new HashMap();
List<SerCustomPageField> indList = blockValuesMapper.selectCustomBlockInd();
resultMap.put("titles",indList);
return resultMap;
}
@Override
public boolean getCustomBlockState() {
int count = blockValuesMapper.selectCustomBlockState();
return count>0?true:false;
}
private static void remove(Object obj, Iterator iterator) { private static void remove(Object obj, Iterator iterator) {
if (obj instanceof String) { if (obj instanceof String) {
String str = (String) obj; String str = (String) obj;
......
#### \u6D4B\u8BD5\u73AF\u5883 ################################################### #### \u6D4B\u8BD5\u73AF\u5883 ###################################################
#spring.datasource.url=jdbc:mysql://192.168.3.110:3366/hospital?useUnicode=true&characterEncoding=utf8&useSSL=false&autoReconnect=true&rewriteBatchedStatements=TRUE&serverTimezone=UTC #spring.datasource.url=jdbc:mysql://192.168.3.110:3366/hospital?useUnicode=true&characterEncoding=utf8&useSSL=false&autoReconnect=true&rewriteBatchedStatements=TRUE&serverTimezone=UTC
spring.datasource.url=jdbc:mysql://192.192.185.122:3306/wy1103?useUnicode=true&characterEncoding=utf8&useSSL=false&autoReconnect=true&rewriteBatchedStatements=TRUE&serverTimezone=UTC spring.datasource.url=jdbc:mysql://192.168.18.176:3306/scml_sy2.1_org?useUnicode=true&characterEncoding=utf8&useSSL=false&autoReconnect=true&rewriteBatchedStatements=TRUE&serverTimezone=UTC
spring.datasource.username=root spring.datasource.username=root
spring.datasource.password=HEshi@2020 spring.datasource.password=Suvalue2016
spring.datasource.driver-class-name=com.mysql.jdbc.Driver spring.datasource.driver-class-name=com.mysql.jdbc.Driver
spring.datasource.druid.initial-size=1 spring.datasource.druid.initial-size=1
......
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.hs.api.mapper.BlockValuesMapper"> <mapper namespace="com.hs.api.mapper.BlockValuesMapper">
<resultMap id="CustomResultMap" type="com.hs.api.model.SerCustomPageField">
<result column="ID" jdbcType="DECIMAL" property="id"/>
<result column="STATE" jdbcType="DECIMAL" property="state"/>
<result column="IND_NAME" jdbcType="VARCHAR" property="indName"/>
<result column="IND_CODE" jdbcType="VARCHAR" property="indCode"/>
<result column="IND_FIELD" jdbcType="VARCHAR" property="indField"/>
<result column="XH" jdbcType="INTEGER" property="xh"/>
<result column="DESCRIBE" jdbcType="VARCHAR" property="describe"/>
<result column="PARENT_IND_CODE" jdbcType="VARCHAR" property="parentIndCode"/>
<result column="DISPLAY" jdbcType="BOOLEAN" property="display"/>
<collection property="children" ofType="com.hs.api.model.SerCustomPageField"
column="id" javaType="ArrayList">
<result column="CHILD_ID" jdbcType="DECIMAL" property="id"/>
<result column="CHILD_STATE" jdbcType="DECIMAL" property="state"/>
<result column="CHILD_IND_NAME" jdbcType="VARCHAR" property="indName"/>
<result column="CHILD_IND_CODE" jdbcType="VARCHAR" property="indCode"/>
<result column="CHILD_IND_FIELD" jdbcType="VARCHAR" property="indField"/>
<result column="CHILD_TYPE" jdbcType="INTEGER" property="type"/>
<result column="CHILD_XH" jdbcType="INTEGER" property="xh"/>
<result column="CHILD_DESCRIBE" jdbcType="VARCHAR" property="describe"/>
<result column="CHILD_PARENT_IND_CODE" jdbcType="VARCHAR" property="parentIndCode"/>
<result column="CHILD_DISPLAY" jdbcType="BOOLEAN" property="display"/>
</collection>
</resultMap>
<select id="selectByWhere" resultType="java.util.Map"> <select id="selectByWhere" resultType="java.util.Map">
select * select *
from ${tableName} ${whereSql} from ${tableName} ${whereSql}
...@@ -9,4 +33,40 @@ ...@@ -9,4 +33,40 @@
select * select *
from ${tableName} ${whereSql} from ${tableName} ${whereSql}
</select> </select>
<select id="selectCustomBlockInd" resultMap="CustomResultMap">
SELECT
rhi.*,
rhii.id CHILD_ID,
rhii.state CHILD_STATE,
rhii.create_date CHILD_CREATE_DATE,
rhii.create_userid CHILD_CREATE_USERID,
rhii.page_id CHILD_PAGE_ID,
rhii.hos_code CHILD_HOS_CODE,
rhii.ind_name CHILD_IND_NAME,
rhii.ind_code CHILD_IND_CODE,
rhii.ind_field CHILD_IND_FIELD,
rhii.type CHILD_TYPE,
rhii.xh CHILD_XH,
rhii.describe CHILD_DESCRIBE,
rhii.parent_ind_code CHILD_PARENT_IND_CODE,
rhii.display CHILD_DISPLAY,
rhii.xh CHILD_XH,
rhii.IND_NAME CHILD_IND_NAME,
rhii.IND_FIELD CHILD_IND_FIELD
FROM
report_hos_ind_info rhi
LEFT JOIN report_hos_ind_info rhii ON rhi.IND_CODE = rhii.PARENT_IND_CODE
WHERE
rhi.state = 1
AND rhi.PARENT_IND_CODE = ''
OR rhi.PARENT_IND_CODE IS NULL
ORDER BY
rhi.xh,
rhii.xh
</select>
<select id="selectCustomBlockState" resultType="int">
select count(*)
from report_hos_ind_info
where state = 1
</select>
</mapper> </mapper>
\ No newline at end of file
...@@ -2,11 +2,16 @@ package com.hs.api; ...@@ -2,11 +2,16 @@ package com.hs.api;
import org.junit.Test; import org.junit.Test;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.test.context.junit4.SpringRunner; import org.springframework.test.context.junit4.SpringRunner;
@RunWith(SpringRunner.class)
@SpringBootTest @SpringBootTest
@SpringBootApplication
@MapperScan("com.hs.api.mapper")
@ComponentScan(basePackages = {"com.hs.common.config", "com.hs.api"})
public class BsoftApiApplicationTests { public class BsoftApiApplicationTests {
@Test @Test
......
package com.hs.api.service;
import com.hs.api.BsoftApiApplicationTests;
import com.hs.api.model.respmodel.BlockValue;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@RunWith(SpringRunner.class)
@SpringBootTest(classes = BsoftApiApplicationTests.class)
public class BlockValuesServiceTest {
@Autowired
BlockValuesService blockValuesService;
@Test
public void testBlockVlues() {
Long userId = 1L;
Integer pageCode = 12;
Map<String,String> dim = new HashMap<>();
dim.put("KSBM","普外科");
dim.put("ZBZBM","I61:SS");
dim.put("TIME","202011");
try {
Map<String, List> map = blockValuesService.getCustomBlockValuesByPageCode(userId, pageCode, dim);
System.out.println(map);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
@Test
public void testBlockState() {
boolean state = blockValuesService.getCustomBlockState();
System.out.println(state);
}
}
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