Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
A
Aidea
Project
Project
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
sa_aidea
Aidea
Commits
c0793357
Commit
c0793357
authored
Aug 24, 2021
by
马超
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(微问诊): 修改获取列表数据接口、修改获取药品详情的接口
parent
e65f1e0c
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
87 additions
and
14 deletions
+87
-14
FbusiDrug.java
...le/src/main/java/com/cftech/cdfortis/model/FbusiDrug.java
+1
-1
CdfortisController.java
...main/java/com/cftech/cdfortis/web/CdfortisController.java
+2
-2
PreDrugsMapper.xml
.../src/main/java/com/cftech/predrugs/dao/PreDrugsMapper.xml
+5
-5
PreDrugs.java
...ule/src/main/java/com/cftech/predrugs/model/PreDrugs.java
+1
-1
PrescriptionService.java
.../com/cftech/prescription/service/PrescriptionService.java
+7
-0
PrescriptionServiceImpl.java
...ch/prescription/service/impl/PrescriptionServiceImpl.java
+71
-5
No files found.
aidea-modules/prescription-module/src/main/java/com/cftech/cdfortis/model/FbusiDrug.java
View file @
c0793357
...
...
@@ -9,7 +9,7 @@ public class FbusiDrug implements Serializable {
private
String
drugId
;
private
String
drugName
;
private
String
drugCompany
;
private
Stri
ng
drugNum
;
private
Lo
ng
drugNum
;
private
String
apprNumber
;
private
String
spec
;
private
String
dosage
;
...
...
aidea-modules/prescription-module/src/main/java/com/cftech/cdfortis/web/CdfortisController.java
View file @
c0793357
...
...
@@ -111,8 +111,8 @@ public class CdfortisController {
public
JSONObject
getFbusiDetail
(
@RequestParam
String
presId
)
{
JSONObject
rtnJson
=
new
JSONObject
();
try
{
FbusiDetail
fbusiDetail
=
cdfortisService
.
getFbusiDetail
(
presId
);
setSuccResult
(
rtnJson
,
fbusiDetail
);
Prescription
preScription
=
prescriptionService
.
findPreScription
(
presId
);
setSuccResult
(
rtnJson
,
preScription
);
}
catch
(
Exception
e
)
{
handleException
(
rtnJson
,
e
);
}
...
...
aidea-modules/prescription-module/src/main/java/com/cftech/predrugs/dao/PreDrugsMapper.xml
View file @
c0793357
...
...
@@ -11,7 +11,7 @@
<result
column=
"spec"
property=
"spec"
/>
<result
column=
"appr_number"
property=
"apprNumber"
/>
<result
column=
"drug_num"
property=
"drugNum"
/>
<result
column=
"drug_compay"
property=
"drugCompay"
/>
<result
column=
"drug_compay"
property=
"drugCompa
n
y"
/>
<result
column=
"name"
property=
"name"
/>
<result
column=
"drug_id"
property=
"drugId"
/>
<result
column=
"parent_id"
property=
"parentId"
/>
...
...
@@ -62,7 +62,7 @@
spec,
appr_number,
drug_num,
drug_compay,
drug_compa
n
y,
name,
drug_id,
parent_id,
...
...
@@ -94,7 +94,7 @@
#{spec, jdbcType=VARCHAR},
#{apprNumber, jdbcType=VARCHAR},
#{drugNum, jdbcType=BIGINT},
#{drugCompay, jdbcType=VARCHAR},
#{drugCompa
n
y, jdbcType=VARCHAR},
#{name, jdbcType=VARCHAR},
#{drugId, jdbcType=VARCHAR},
#{parentId, jdbcType=BIGINT},
...
...
@@ -159,8 +159,8 @@
<if
test=
"drugNum != null"
>
drug_num = #{drugNum, jdbcType=BIGINT},
</if>
<if
test=
"drugCompay != null"
>
drug_compa
y = #{drugCompa
y, jdbcType=VARCHAR},
<if
test=
"drugCompa
n
y != null"
>
drug_compa
ny = #{drugCompan
y, jdbcType=VARCHAR},
</if>
<if
test=
"name != null"
>
name = #{name, jdbcType=VARCHAR},
...
...
aidea-modules/prescription-module/src/main/java/com/cftech/predrugs/model/PreDrugs.java
View file @
c0793357
...
...
@@ -43,7 +43,7 @@ public class PreDrugs implements Serializable {
private
String
price
;
/* 药品生产厂家 */
@ExportConfig
(
value
=
"药品生产厂家"
,
width
=
100
,
showLevel
=
1
)
private
String
drugCompay
;
private
String
drugCompa
n
y
;
/* 药品名称 */
@ExportConfig
(
value
=
"药品名称"
,
width
=
100
,
showLevel
=
1
)
private
String
name
;
...
...
aidea-modules/prescription-module/src/main/java/com/cftech/prescription/service/PrescriptionService.java
View file @
c0793357
...
...
@@ -35,5 +35,12 @@ public interface PrescriptionService extends GenericService<Prescription> {
*/
List
<
Prescription
>
findPreScriptionList
(
int
iDisplayStart
,
int
iDisplayLength
,
String
startTime
,
String
endTime
)
throws
Exception
;
/**
* 获取Prescription详情
* @param presId
* @return
*/
Prescription
findPreScription
(
String
presId
)
throws
Exception
;
}
aidea-modules/prescription-module/src/main/java/com/cftech/prescription/service/impl/PrescriptionServiceImpl.java
View file @
c0793357
package
com
.
cftech
.
prescription
.
service
.
impl
;
import
com.cftech.cdfortis.model.FbusiDetail
;
import
com.cftech.cdfortis.model.FbusiDrug
;
import
com.cftech.cdfortis.service.CdfortisService
;
import
com.cftech.core.scope.OrderType
;
import
com.cftech.core.sql.Sort
;
import
com.cftech.core.util.DateUtils
;
import
com.cftech.predrugs.model.PreDrugs
;
import
com.cftech.predrugs.service.PreDrugsService
;
import
com.cftech.prescription.model.Prescription
;
import
com.cftech.prescription.dao.PrescriptionMapper
;
import
com.cftech.prescription.service.PrescriptionService
;
import
com.cftech.core.generic.GenericDao
;
import
com.cftech.core.generic.GenericServiceImpl
;
import
com.cftech.core.sql.Conds
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Qualifier
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.StringUtils
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Set
;
import
java.util.*
;
import
java.util.stream.Collectors
;
/**
...
...
@@ -38,6 +40,9 @@ public class PrescriptionServiceImpl extends GenericServiceImpl<Prescription> im
@Autowired
CdfortisService
cdfortisService
;
@Autowired
PreDrugsService
preDrugsService
;
@Override
public
GenericDao
<
Prescription
>
getGenericMapper
()
{
return
prescriptionMapper
;
...
...
@@ -64,7 +69,7 @@ public class PrescriptionServiceImpl extends GenericServiceImpl<Prescription> im
}
Sort
sort
=
new
Sort
(
"create_time"
,
OrderType
.
DESC
);
// 查询在时间范围内的数据
//
TODO
查询在时间范围内的数据
Conds
listConds
=
new
Conds
();
// listConds.between("start_time", startTime, endTime);
List
<
Prescription
>
prescriptions
=
fetchSearchByPage
(
listConds
,
sort
,
iDisplayStart
,
iDisplayLength
);
...
...
@@ -101,4 +106,65 @@ public class PrescriptionServiceImpl extends GenericServiceImpl<Prescription> im
}
return
onLineList
;
}
@Override
public
Prescription
findPreScription
(
String
presId
)
throws
Exception
{
Prescription
prescription
=
fetchById
(
presId
);
if
(
prescription
!=
null
&&
!
StringUtils
.
isEmpty
(
prescription
.
getSymptom
()))
{
return
prescription
;
}
FbusiDetail
fbusiDetail
=
cdfortisService
.
getFbusiDetail
(
presId
);
if
(
fbusiDetail
==
null
)
{
throw
new
Exception
(
"找不到对应的处方数据"
);
}
if
(
prescription
==
null
)
{
// save数据
prescription
=
new
Prescription
();
BeanUtils
.
copyProperties
(
fbusiDetail
,
prescription
);
save
(
prescription
);
}
else
{
// update 数据
BeanUtils
.
copyProperties
(
fbusiDetail
,
prescription
);
update
(
prescription
);
}
handleFrug
(
fbusiDetail
,
prescription
);
return
prescription
;
}
/**
* 处理处方单中的药品信息逻辑(存在则更新,不存在则新增)
*
* @param fbusiDetail
* @param prescription
*/
private
void
handleFrug
(
FbusiDetail
fbusiDetail
,
Prescription
prescription
)
{
List
<
FbusiDrug
>
drugs
=
fbusiDetail
.
getDrugs
();
List
<
PreDrugs
>
preDrugsList
=
new
ArrayList
<>();
if
(
CollectionUtils
.
isEmpty
(
drugs
))
{
return
;
}
Conds
drugConds
=
new
Conds
();
drugConds
.
equal
(
"parent_id"
,
prescription
.
getId
());
int
count
=
preDrugsService
.
count
(
drugConds
);
if
(
count
!=
0
)
{
Sort
sort
=
new
Sort
(
"create_time"
,
OrderType
.
DESC
);
preDrugsList
=
preDrugsService
.
fetchSearchByPage
(
drugConds
,
sort
,
0
,
count
);
}
Map
<
String
,
PreDrugs
>
preDrugMap
=
preDrugsList
.
stream
().
collect
(
Collectors
.
toMap
(
PreDrugs:
:
getDrugId
,
preDrugs
->
preDrugs
));
for
(
FbusiDrug
fbusiDrug
:
drugs
)
{
PreDrugs
preDrug
=
new
PreDrugs
();
if
(
preDrugMap
.
containsKey
(
fbusiDrug
.
getDrugId
()))
{
preDrug
=
preDrugMap
.
get
(
fbusiDrug
.
getDrugId
());
BeanUtils
.
copyProperties
(
fbusiDrug
,
preDrug
);
preDrug
.
setName
(
fbusiDrug
.
getDrugName
());
preDrug
.
setParentId
(
prescription
.
getId
());
preDrugsService
.
update
(
preDrug
);
}
else
{
BeanUtils
.
copyProperties
(
fbusiDrug
,
preDrug
);
preDrug
.
setName
(
fbusiDrug
.
getDrugName
());
preDrug
.
setParentId
(
prescription
.
getId
());
preDrugsService
.
save
(
preDrug
);
}
}
}
}
\ No newline at end of file
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