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
c5971914
Commit
c5971914
authored
Oct 31, 2019
by
Suvalue
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加医生疾病实现层
parent
c08d24e7
Show whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
165 additions
and
27 deletions
+165
-27
bsoft-api/src/main/java/com/bsoft/api/common/handlers/GlobalExceptionHandler.java
+1
-1
bsoft-api/src/main/java/com/bsoft/api/controller/SerDiseaseController.java
+19
-13
bsoft-api/src/main/java/com/bsoft/api/controller/SerDiseaseDocController.java
+12
-3
bsoft-api/src/main/java/com/bsoft/api/mapper/SerDiseaseDocRsMapper.java
+3
-0
bsoft-api/src/main/java/com/bsoft/api/mapper/SerDiseaseMapper.java
+5
-0
bsoft-api/src/main/java/com/bsoft/api/model/SysMenu.java
+2
-0
bsoft-api/src/main/java/com/bsoft/api/model/reqmodel/Disease.java
+3
-3
bsoft-api/src/main/java/com/bsoft/api/service/Impl/SerDiseaseDocServiceImpl.java
+20
-0
bsoft-api/src/main/java/com/bsoft/api/service/Impl/SerDiseaseServiceImpl.java
+24
-0
bsoft-api/src/main/java/com/bsoft/api/service/Impl/SysMenuServiceImpl.java
+1
-1
bsoft-api/src/main/java/com/bsoft/api/service/SerDiseaseDocService.java
+9
-0
bsoft-api/src/main/java/com/bsoft/api/service/SerDiseaseService.java
+11
-0
bsoft-api/src/main/java/com/bsoft/api/service/SysMenuService.java
+3
-0
bsoft-api/src/main/resources/mapper/SerDiseaseDocRsMapper.xml
+20
-4
bsoft-api/src/main/resources/mapper/SerDiseaseMapper.xml
+26
-0
bsoft-api/src/test/resources/generatorConfig.xml
+6
-2
No files found.
bsoft-api/src/main/java/com/bsoft/api/common/handlers/GlobalExceptionHandler.java
View file @
c5971914
...
...
@@ -30,7 +30,7 @@ public class GlobalExceptionHandler {
@ResponseBody
public
Object
defaultErrorHandler
(
HttpServletRequest
request
,
Exception
e
){
String
url
=
request
.
getRequestURI
();
log
.
error
(
url
+
"请求未知异常:"
+
e
.
get
Messag
e
(),
e
.
getStackTrace
());
log
.
error
(
url
+
"请求未知异常:"
+
e
.
get
Caus
e
(),
e
.
getStackTrace
());
return
Result
.
error
();
}
...
...
bsoft-api/src/main/java/com/bsoft/api/controller/SerDiseaseController.java
View file @
c5971914
...
...
@@ -4,19 +4,23 @@ import com.bsoft.api.common.Result;
import
com.bsoft.api.common.annotations.Token
;
import
com.bsoft.api.model.SerDisease
;
import
com.bsoft.api.model.reqmodel.Disease
;
import
com.bsoft.api.
model.respmodel.DiseaseLevel
;
import
com.bsoft.api.
service.SerDiseaseService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.ArrayList
;
import
java.util.List
;
@Api
(
tags
=
"疾病信息Api"
)
@RestController
public
class
SerDiseaseController
{
@Autowired
private
SerDiseaseService
serDiseaseService
;
/**
* 根据pageId查询板块数值
* @return
...
...
@@ -25,13 +29,13 @@ public class SerDiseaseController {
@PostMapping
(
"disease/level"
)
@Token
@ApiOperation
(
"根据等级查询疾病信息"
)
public
Object
getDiseaseByLevel
(
@RequestBody
Disease
.
Disease
By
Level
disease
)
throws
InterruptedException
{
return
Result
.
success
(
new
ArrayList
<
DiseaseLevel
>(){
public
Object
getDiseaseByLevel
(
@RequestBody
Disease
.
DiseaseLevel
disease
)
throws
InterruptedException
{
return
Result
.
success
(
new
ArrayList
<
com
.
bsoft
.
api
.
model
.
respmodel
.
DiseaseLevel
>(){
{
add
(
new
DiseaseLevel
(){{
setDiseaseLevelList
(
new
ArrayList
<
DiseaseLevel
>(){
add
(
new
com
.
bsoft
.
api
.
model
.
respmodel
.
DiseaseLevel
(){{
setDiseaseLevelList
(
new
ArrayList
<
com
.
bsoft
.
api
.
model
.
respmodel
.
DiseaseLevel
>(){
{
add
(
new
DiseaseLevel
());
add
(
new
com
.
bsoft
.
api
.
model
.
respmodel
.
DiseaseLevel
());
}
});
}});
...
...
@@ -40,17 +44,19 @@ public class SerDiseaseController {
}
@PostMapping
(
"disease/name"
)
@Token
//
@Token
@ApiOperation
(
"根据疾病名称查询疾病信息"
)
public
Object
getDiseaseByMdcName
(
@RequestBody
Disease
.
DiseaseByName
disease
)
throws
InterruptedException
{
return
Result
.
success
(
new
SerDisease
());
public
Object
getDiseaseByMdcName
(
@RequestBody
Disease
.
DiseaseName
disease
)
throws
InterruptedException
{
List
<
SerDisease
>
list
=
serDiseaseService
.
selectByMdcName
(
disease
.
getDate
().
toString
(),
disease
.
getMdcName
());
return
Result
.
success
(
list
);
}
@PostMapping
(
"disease/level/info"
)
@Token
@ApiOperation
(
"查询特定等级下所有数据以及子数据"
)
public
Object
getDiseaseByLevelSon
(
@RequestBody
Disease
.
DiseaseByLevelSon
disease
)
throws
InterruptedException
{
return
Result
.
success
(
new
SerDisease
());
// @Token
@ApiOperation
(
"查询特定等级下所有数据"
)
public
Object
getDiseaseByLevelSon
(
@RequestBody
Disease
.
DiseaseLevelSon
disease
)
throws
InterruptedException
{
List
<
SerDisease
>
list
=
serDiseaseService
.
selectByLevel
(
disease
.
getDate
().
toString
(),
disease
.
getLevel
().
intValue
());
return
Result
.
success
(
list
);
}
}
bsoft-api/src/main/java/com/bsoft/api/controller/SerDiseaseDocController.java
View file @
c5971914
...
...
@@ -4,20 +4,29 @@ import com.bsoft.api.common.Result;
import
com.bsoft.api.common.annotations.Token
;
import
com.bsoft.api.model.SerDiseaseDocRs
;
import
com.bsoft.api.model.reqmodel.DiseaseDoc
;
import
com.bsoft.api.service.SerDiseaseDocService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.List
;
@Api
(
tags
=
"疾病与医生关系信息Api"
)
@RestController
public
class
SerDiseaseDocController
{
@Autowired
private
SerDiseaseDocService
serDiseaseDocService
;
@PostMapping
(
"diseaseDoc"
)
@Token
@ApiOperation
(
"根据
疾病名称查询疾病
信息"
)
//
@Token
@ApiOperation
(
"根据
Code查询疾病关系
信息"
)
public
Object
getDiseaseDoc
(
@RequestBody
DiseaseDoc
disease
)
throws
InterruptedException
{
return
Result
.
success
(
new
SerDiseaseDocRs
());
List
<
SerDiseaseDocRs
>
list
=
serDiseaseDocService
.
getDiseaseDoc
(
disease
.
getDocCode
(),
disease
.
getMdcCode
(),
disease
.
getDeptCode
());
return
Result
.
success
(
list
);
}
}
bsoft-api/src/main/java/com/bsoft/api/mapper/SerDiseaseDocRsMapper.java
View file @
c5971914
package
com
.
bsoft
.
api
.
mapper
;
import
com.bsoft.api.model.SerDiseaseDocRs
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
...
...
@@ -14,5 +15,7 @@ public interface SerDiseaseDocRsMapper {
List
<
SerDiseaseDocRs
>
selectAll
();
List
<
SerDiseaseDocRs
>
selectByCode
(
@Param
(
"docCode"
)
String
docCode
,
@Param
(
"mdcCode"
)
String
mdcCode
,
@Param
(
"deptCode"
)
String
deptCode
);
int
updateByPrimaryKey
(
SerDiseaseDocRs
record
);
}
bsoft-api/src/main/java/com/bsoft/api/mapper/SerDiseaseMapper.java
View file @
c5971914
package
com
.
bsoft
.
api
.
mapper
;
import
com.bsoft.api.model.SerDisease
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
...
...
@@ -14,6 +15,10 @@ public interface SerDiseaseMapper {
List
<
SerDisease
>
selectAll
();
List
<
SerDisease
>
selectByMdcName
(
@Param
(
"date"
)
String
date
,
@Param
(
"mdcName"
)
String
mdcName
);
List
<
SerDisease
>
selectByLevel
(
@Param
(
"date"
)
String
date
,
@Param
(
"level"
)
Integer
level
);
int
updateByPrimaryKey
(
SerDisease
record
);
}
bsoft-api/src/main/java/com/bsoft/api/model/SysMenu.java
View file @
c5971914
...
...
@@ -92,4 +92,5 @@ public class SysMenu {
public
void
setParentId
(
Long
parentId
)
{
this
.
parentId
=
parentId
;
}
}
\ No newline at end of file
bsoft-api/src/main/java/com/bsoft/api/model/reqmodel/Disease.java
View file @
c5971914
...
...
@@ -8,7 +8,7 @@ public class Disease {
/**
* 等级查询疾病实体
*/
public
static
class
Disease
ByLevel
{
public
static
class
Disease
Level
{
@ApiModelProperty
(
value
=
"等级"
,
required
=
true
)
private
BigDecimal
level
;
@ApiModelProperty
(
value
=
"时间"
,
required
=
true
)
...
...
@@ -44,7 +44,7 @@ public class Disease {
/**
* 名称查询疾病实体
*/
public
static
class
Disease
ByName
{
public
static
class
Disease
Name
{
@ApiModelProperty
(
value
=
"时间"
,
required
=
true
)
private
BigDecimal
date
;
...
...
@@ -71,7 +71,7 @@ public class Disease {
/**
* 特定等级下所有数据以及子数据实体
*/
public
static
class
Disease
ByLevelSon
{
public
static
class
Disease
LevelSon
{
@ApiModelProperty
(
value
=
"等级"
,
required
=
true
)
private
BigDecimal
level
;
@ApiModelProperty
(
value
=
"时间"
,
required
=
true
)
...
...
bsoft-api/src/main/java/com/bsoft/api/service/Impl/SerDiseaseDocServiceImpl.java
0 → 100644
View file @
c5971914
package
com
.
bsoft
.
api
.
service
.
Impl
;
import
com.bsoft.api.mapper.SerDiseaseDocRsMapper
;
import
com.bsoft.api.model.SerDiseaseDocRs
;
import
com.bsoft.api.service.SerDiseaseDocService
;
import
org.springframework.stereotype.Service
;
import
javax.annotation.Resource
;
import
java.util.List
;
@Service
public
class
SerDiseaseDocServiceImpl
implements
SerDiseaseDocService
{
@Resource
private
SerDiseaseDocRsMapper
serDiseaseDocRsMapper
;
@Override
public
List
<
SerDiseaseDocRs
>
getDiseaseDoc
(
String
docCode
,
String
mdcCode
,
String
deptCode
)
throws
InterruptedException
{
return
serDiseaseDocRsMapper
.
selectByCode
(
docCode
,
mdcCode
,
deptCode
);
}
}
bsoft-api/src/main/java/com/bsoft/api/service/Impl/SerDiseaseServiceImpl.java
0 → 100644
View file @
c5971914
package
com
.
bsoft
.
api
.
service
.
Impl
;
import
com.bsoft.api.mapper.SerDiseaseMapper
;
import
com.bsoft.api.model.SerDisease
;
import
com.bsoft.api.service.SerDiseaseService
;
import
org.springframework.stereotype.Service
;
import
javax.annotation.Resource
;
import
java.util.List
;
@Service
public
class
SerDiseaseServiceImpl
implements
SerDiseaseService
{
@Resource
private
SerDiseaseMapper
serDiseaseMapper
;
@Override
public
List
<
SerDisease
>
selectByMdcName
(
String
date
,
String
mdcName
)
{
return
serDiseaseMapper
.
selectByMdcName
(
date
,
mdcName
);
}
@Override
public
List
<
SerDisease
>
selectByLevel
(
String
date
,
Integer
level
)
{
return
serDiseaseMapper
.
selectByLevel
(
date
,
level
);
}
}
bsoft-api/src/main/java/com/bsoft/api/service/Impl/SysMenuServiceImpl.java
View file @
c5971914
...
...
@@ -24,7 +24,7 @@ public class SysMenuServiceImpl implements SysMenuService {
SysMenuList
sysMenuList
=
new
SysMenuList
();
SysMenu
sysMenu
=
new
SysMenu
();
List
<
SysMenuList
>
list
=
sysMenuMapper
.
selectMenuByUser
(
userId
);
List
<
SysMenuList
>
resultList
=
getLevelData
(
list
,
Long
.
valueOf
(
0
));
List
<
SysMenuList
>
resultList
=
getLevelData
(
list
,
Long
.
valueOf
(
MENU_TOP_PARENT_ID
));
return
resultList
;
}
...
...
bsoft-api/src/main/java/com/bsoft/api/service/SerDiseaseDocService.java
0 → 100644
View file @
c5971914
package
com
.
bsoft
.
api
.
service
;
import
com.bsoft.api.model.SerDiseaseDocRs
;
import
java.util.List
;
public
interface
SerDiseaseDocService
{
List
<
SerDiseaseDocRs
>
getDiseaseDoc
(
String
docCode
,
String
mdcCode
,
String
deptCode
)
throws
InterruptedException
;
}
bsoft-api/src/main/java/com/bsoft/api/service/SerDiseaseService.java
0 → 100644
View file @
c5971914
package
com
.
bsoft
.
api
.
service
;
import
com.bsoft.api.model.SerDisease
;
import
java.util.List
;
public
interface
SerDiseaseService
{
List
<
SerDisease
>
selectByMdcName
(
String
date
,
String
mdcName
);
List
<
SerDisease
>
selectByLevel
(
String
date
,
Integer
level
);
}
bsoft-api/src/main/java/com/bsoft/api/service/SysMenuService.java
View file @
c5971914
...
...
@@ -6,5 +6,8 @@ import com.bsoft.api.model.respmodel.SysMenuList;
import
java.util.List
;
public
interface
SysMenuService
extends
ServiceBase
<
SysMenu
>
{
//顶级菜单的父级id
final
static
Integer
MENU_TOP_PARENT_ID
=
0
;
List
<
SysMenuList
>
getMenu
(
Long
userId
)
throws
Exception
;
}
bsoft-api/src/main/resources/mapper/SerDiseaseDocRsMapper.xml
View file @
c5971914
...
...
@@ -11,6 +11,7 @@
<result
column=
"DEPT_CODE"
jdbcType=
"VARCHAR"
property=
"deptCode"
/>
<result
column=
"DEPT_NAME"
jdbcType=
"VARCHAR"
property=
"deptName"
/>
</resultMap>
<delete
id=
"deleteByPrimaryKey"
parameterType=
"java.math.BigDecimal"
>
delete from LL.SER_DISEASE_DOC_RS
where ID = #{id,jdbcType=DECIMAL}
...
...
@@ -20,7 +21,7 @@
select SEQ_SER_DISEASE_DOC_RS_ID.nextval from dual
</selectKey>
insert into LL.SER_DISEASE_DOC_RS (ORG_ID, DOC_CODE, DOC_NAME,
MDC_CODE,
DATE
, DEPT_CODE,
MDC_CODE,
"DATE"
, DEPT_CODE,
DEPT_NAME)
values (#{orgId,jdbcType=DECIMAL}, #{docCode,jdbcType=VARCHAR}, #{docName,jdbcType=VARCHAR},
#{mdcCode,jdbcType=VARCHAR}, #{date,jdbcType=DECIMAL}, #{deptCode,jdbcType=VARCHAR},
...
...
@@ -32,18 +33,32 @@
DOC_CODE = #{docCode,jdbcType=VARCHAR},
DOC_NAME = #{docName,jdbcType=VARCHAR},
MDC_CODE = #{mdcCode,jdbcType=VARCHAR},
DATE
= #{date,jdbcType=DECIMAL},
"DATE"
= #{date,jdbcType=DECIMAL},
DEPT_CODE = #{deptCode,jdbcType=VARCHAR},
DEPT_NAME = #{deptName,jdbcType=VARCHAR}
where ID = #{id,jdbcType=DECIMAL}
</update>
<select
id=
"selectByPrimaryKey"
parameterType=
"java.math.BigDecimal"
resultMap=
"BaseResultMap"
>
select ID, ORG_ID, DOC_CODE, DOC_NAME, MDC_CODE,
DATE
, DEPT_CODE, DEPT_NAME
select ID, ORG_ID, DOC_CODE, DOC_NAME, MDC_CODE,
"DATE"
, DEPT_CODE, DEPT_NAME
from LL.SER_DISEASE_DOC_RS
where ID = #{id,jdbcType=DECIMAL}
</select>
<select
id=
"selectAll"
resultMap=
"BaseResultMap"
>
select ID, ORG_ID, DOC_CODE, DOC_NAME, MDC_CODE,
DATE
, DEPT_CODE, DEPT_NAME
select ID, ORG_ID, DOC_CODE, DOC_NAME, MDC_CODE,
"DATE"
, DEPT_CODE, DEPT_NAME
from LL.SER_DISEASE_DOC_RS
</select>
<select
id=
"selectByCode"
resultMap=
"BaseResultMap"
>
select ID, ORG_ID, DOC_CODE, DOC_NAME, MDC_CODE, "DATE", DEPT_CODE, DEPT_NAME
from LL.SER_DISEASE_DOC_RS
where 1=1
<if
test=
"docCode!=null"
>
and DOC_CODE = #{docCode,jdbcType=VARCHAR}
</if>
<if
test=
"mdcCode!=null"
>
and MDC_CODE = #{mdcCode,jdbcType=VARCHAR}
</if>
<if
test=
"deptCode!=null"
>
and DEPT_CODE = #{deptCode,jdbcType=VARCHAR}
</if>
</select>
</mapper>
\ No newline at end of file
bsoft-api/src/main/resources/mapper/SerDiseaseMapper.xml
View file @
c5971914
...
...
@@ -15,6 +15,7 @@
<result
column=
"ORG_ID"
jdbcType=
"DECIMAL"
property=
"orgId"
/>
<result
column=
"ORG_NAME"
jdbcType=
"VARCHAR"
property=
"orgName"
/>
</resultMap>
<delete
id=
"deleteByPrimaryKey"
parameterType=
"java.math.BigDecimal"
>
delete from LL.SER_DISEASE
where ID = #{id,jdbcType=DECIMAL}
...
...
@@ -58,4 +59,28 @@
PARENT_ID, LEVEL, ORG_ID, ORG_NAME
from LL.SER_DISEASE
</select>
<select
id=
"selectByMdcName"
resultMap=
"BaseResultMap"
>
select ID, CREATE_DATE, CREATE_USERID, STATE, MDC_CODE, MDC_NAME, "DATE", MDC_NUM,
PARENT_ID,"LEVEL", ORG_ID, ORG_NAME
from LL.SER_DISEASE
where 1 = 1
<if
test=
"date!=null"
>
and "DATE" = #{date,jdbcType=VARCHAR}
</if>
<if
test=
"mdcName!=null"
>
and MDC_NAME like '%'||#{mdcName,jdbcType=VARCHAR}||'%'
</if>
</select>
<select
id=
"selectByLevel"
resultMap=
"BaseResultMap"
>
select ID, CREATE_DATE, CREATE_USERID, STATE, MDC_CODE, MDC_NAME, "DATE", MDC_NUM,
PARENT_ID,"LEVEL", ORG_ID, ORG_NAME
from LL.SER_DISEASE
where 1 = 1
<if
test=
"date!=null"
>
and "DATE" = #{date,jdbcType=VARCHAR}
</if>
<if
test=
"level!=null"
>
and "LEVEL" = #{level,jdbcType=DECIMAL}
</if>
</select>
</mapper>
\ No newline at end of file
bsoft-api/src/test/resources/generatorConfig.xml
View file @
c5971914
...
...
@@ -11,6 +11,10 @@
<property
name=
"endingDelimiter"
value=
"`"
/>
<!-- 生成的文件编码 -->
<property
name=
"javaFileEncoding"
value=
"utf-8"
/>
<property
name=
"autoDelimitKeywords"
value=
"true"
/>
<property
name=
"beginningDelimiter"
value=
"""
/>
<property
name=
"endingDelimiter"
value=
"""
/>
<!-- 通过自定义插件类生成自定义注解和接口 -->
<!--<plugin type="com.suvalue.common.GenPlugin">-->
<!--<property enName="mappers" value="com.suvalue.demo.mapper.BaseMapper"/>-->
...
...
@@ -42,8 +46,8 @@
<!-- <!– 主键生成方式 –>-->
<!-- <generatedKey column="id" sqlStatement="select SEQ_SYS_USER_ID.nextval from dual" identity="true" />-->
<!-- </table>-->
<table
tableName=
"
DIC_DIM
"
schema=
"ll"
>
<generatedKey
column=
"id"
sqlStatement=
"select SEQ_
DIC_DIM
_ID.nextval from dual"
identity=
"true"
/>
<table
tableName=
"
SER_DISEASE_DOC_RS
"
schema=
"ll"
>
<generatedKey
column=
"id"
sqlStatement=
"select SEQ_
SER_DISEASE_DOC_RS
_ID.nextval from dual"
identity=
"true"
/>
</table>
<!-- <table tableName="DIC_IND" schema="ll" >-->
<!-- <generatedKey column="id" sqlStatement="select SEQ_DIC_IND_ID.nextval from dual" identity="true" />-->
...
...
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