Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
sv-springboot
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
bsoft
sv-springboot
Commits
6ea28e55
Commit
6ea28e55
authored
Jan 28, 2021
by
宋振民
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:新增病例清单报表
parent
a820efe6
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
331 additions
and
3 deletions
+331
-3
hs-api/src/main/java/com/hs/api/controller/BlockValuesController.java
+30
-0
hs-api/src/main/java/com/hs/api/mapper/BlockValuesMapper.java
+6
-0
hs-api/src/main/java/com/hs/api/model/SerCustomPageField.java
+158
-0
hs-api/src/main/java/com/hs/api/service/BlockValuesService.java
+4
-0
hs-api/src/main/java/com/hs/api/service/Impl/BlockValuesServiceImpl.java
+20
-0
hs-api/src/main/resources/application-test.properties
+2
-2
hs-api/src/main/resources/mapper/BlockValuesMapper.xml
+61
-0
hs-api/src/test/java/com/hs/api/BsoftApiApplicationTests.java
+6
-1
hs-api/src/test/java/com/hs/api/service/BlockValuesServiceTest.java
+44
-0
No files found.
hs-api/src/main/java/com/hs/api/controller/BlockValuesController.java
View file @
6ea28e55
...
...
@@ -16,6 +16,7 @@ import org.springframework.web.bind.annotation.RestController;
import
springfox.documentation.annotations.ApiIgnore
;
import
java.util.List
;
import
java.util.Map
;
@Api
(
tags
=
"板块数值Api"
)
@RestController
...
...
@@ -57,4 +58,32 @@ public class BlockValuesController {
List
<
BlockValue
>
list
=
blockValuesService
.
getBlockValuesByPageCodeNew
(
userId
,
blockValues
.
getPageCode
(),
blockValues
.
getDim
());
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
hs-api/src/main/java/com/hs/api/mapper/BlockValuesMapper.java
View file @
6ea28e55
package
com
.
hs
.
api
.
mapper
;
import
com.hs.api.model.SerCustomPageField
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -7,4 +9,8 @@ public interface BlockValuesMapper {
List
<
Map
<
String
,
Object
>>
selectByWhere
(
String
tableName
,
String
whereSql
);
List
<
Map
<
String
,
Object
>>
selectByWhereNew
(
Map
<
String
,
String
>
map
);
List
<
SerCustomPageField
>
selectCustomBlockInd
();
int
selectCustomBlockState
();
}
hs-api/src/main/java/com/hs/api/model/SerCustomPageField.java
0 → 100644
View file @
6ea28e55
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
hs-api/src/main/java/com/hs/api/service/BlockValuesService.java
View file @
6ea28e55
...
...
@@ -9,4 +9,8 @@ public interface BlockValuesService {
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
;
Map
<
String
,
List
>
getCustomBlockValuesByPageCode
(
Long
userId
,
Integer
pageCode
,
Map
<
String
,
String
>
dim
)
throws
InterruptedException
;
boolean
getCustomBlockState
();
}
hs-api/src/main/java/com/hs/api/service/Impl/BlockValuesServiceImpl.java
View file @
6ea28e55
package
com
.
hs
.
api
.
service
.
Impl
;
import
com.hs.api.common.exceptions.DBConfigurationError
;
import
com.hs.api.mapper.BlockValuesMapper
;
import
com.hs.api.mapper.SerPageBlockRsMapper
;
import
com.hs.api.mapper.SerPageMapper
;
import
com.hs.api.model.SerCustomPageField
;
import
com.hs.api.model.SerPage
;
import
com.hs.api.model.SerPageBlockRs
;
import
com.hs.api.model.respmodel.BlockValue
;
...
...
@@ -14,6 +16,8 @@ import org.springframework.stereotype.Service;
import
javax.annotation.Resource
;
import
java.util.*
;
import
java.util.concurrent.CountDownLatch
;
import
java.util.stream.Collector
;
import
java.util.stream.Collectors
;
@Service
public
class
BlockValuesServiceImpl
implements
BlockValuesService
{
...
...
@@ -23,6 +27,8 @@ public class BlockValuesServiceImpl implements BlockValuesService {
@Resource
private
SerPageMapper
serPageMapper
;
@Resource
private
BlockValuesMapper
blockValuesMapper
;
@Resource
private
AsynBlockValuesService
asynBlockValuesServiceImpl
;
...
...
@@ -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
)
{
if
(
obj
instanceof
String
)
{
String
str
=
(
String
)
obj
;
...
...
hs-api/src/main/resources/application-test.properties
View file @
6ea28e55
#### \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.1
92.185.122:3306/wy1103
?useUnicode=true&characterEncoding=utf8&useSSL=false&autoReconnect=true&rewriteBatchedStatements=TRUE&serverTimezone=UTC
spring.datasource.url
=
jdbc:mysql://192.1
68.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.password
=
HEshi@2020
spring.datasource.password
=
Suvalue2016
spring.datasource.driver-class-name
=
com.mysql.jdbc.Driver
spring.datasource.druid.initial-size
=
1
...
...
hs-api/src/main/resources/mapper/BlockValuesMapper.xml
View file @
6ea28e55
<?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">
<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 *
from ${tableName} ${whereSql}
...
...
@@ -9,4 +33,40 @@
select *
from ${tableName} ${whereSql}
</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>
\ No newline at end of file
hs-api/src/test/java/com/hs/api/BsoftApiApplicationTests.java
View file @
6ea28e55
...
...
@@ -2,11 +2,16 @@ package com.hs.api;
import
org.junit.Test
;
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.context.annotation.ComponentScan
;
import
org.springframework.test.context.junit4.SpringRunner
;
@RunWith
(
SpringRunner
.
class
)
@SpringBootTest
@SpringBootApplication
@MapperScan
(
"com.hs.api.mapper"
)
@ComponentScan
(
basePackages
=
{
"com.hs.common.config"
,
"com.hs.api"
})
public
class
BsoftApiApplicationTests
{
@Test
...
...
hs-api/src/test/java/com/hs/api/service/BlockValuesServiceTest.java
0 → 100644
View file @
6ea28e55
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
);
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment