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
083058b2
Commit
083058b2
authored
Aug 25, 2021
by
马超
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(微问诊): 上传成功后更新药品上传状态
parent
73b231dc
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
77 additions
and
4 deletions
+77
-4
CdfortisServiceImpl.java
...com/cftech/cdfortis/service/impl/CdfortisServiceImpl.java
+7
-0
CdfortisController.java
...main/java/com/cftech/cdfortis/web/CdfortisController.java
+18
-0
cdfortis.http
...ules/prescription-module/src/main/test/http/cdfortis.http
+10
-0
ProductMapper.java
...e/src/main/java/com/cftech/product/dao/ProductMapper.java
+6
-0
ProductMapper.xml
...le/src/main/java/com/cftech/product/dao/ProductMapper.xml
+21
-4
Product.java
...odule/src/main/java/com/cftech/product/model/Product.java
+2
-0
ProductService.java
.../main/java/com/cftech/product/service/ProductService.java
+8
-0
ProductServiceImpl.java
...a/com/cftech/product/service/impl/ProductServiceImpl.java
+5
-0
No files found.
aidea-modules/prescription-module/src/main/java/com/cftech/cdfortis/service/impl/CdfortisServiceImpl.java
View file @
083058b2
...
...
@@ -129,6 +129,13 @@ public class CdfortisServiceImpl implements CdfortisService {
return
JSONObject
.
parseObject
(
data
,
FbusiDetail
.
class
);
}
/**
* 通过订单号获取图文详情
*
* @param orderId
* @return
* @throws Exception
*/
@Override
public
FbusiDetail
getFbusiDetailByOrderId
(
String
orderId
)
throws
Exception
{
String
getFbusiInfoByOrderIdUrl
=
SystemConfig
.
p
.
getProperty
(
"cdfortis.get_fbusi_info_by_order_id_url"
);
...
...
aidea-modules/prescription-module/src/main/java/com/cftech/cdfortis/web/CdfortisController.java
View file @
083058b2
...
...
@@ -8,11 +8,15 @@ import com.cftech.cdfortis.util.CdfortisTokenUtil;
import
com.cftech.prescription.model.Prescription
;
import
com.cftech.prescription.service.PrescriptionService
;
import
com.cftech.product.model.Product
;
import
com.cftech.product.service.ProductService
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
/**
* 微问诊相关接口调用Controller
...
...
@@ -35,6 +39,9 @@ public class CdfortisController {
@Autowired
PrescriptionService
prescriptionService
;
@Autowired
ProductService
productService
;
/**
* 获取微问诊token
*
...
...
@@ -69,6 +76,17 @@ public class CdfortisController {
Object
data
=
""
;
if
(!
isAllSuccess
)
{
JSONArray
failedDataArr
=
dataJsonObj
.
getJSONArray
(
"failedData"
);
// List转map,key是productNumber、value是product本身
List
<
String
>
productNumberList
=
productList
.
stream
()
.
map
(
Product:
:
getProductNumber
)
.
collect
(
Collectors
.
toList
());
// 遍历上传失败的数据,排除掉
for
(
int
i
=
0
;
i
<
failedDataArr
.
size
();
i
++)
{
String
erpId
=
failedDataArr
.
getJSONObject
(
i
).
getString
(
"erpId"
);
productNumberList
.
remove
(
erpId
);
}
productService
.
updateUploadFlag
(
productNumberList
,
true
);
data
=
failedDataArr
;
}
setSuccResult
(
rtnJson
,
data
);
...
...
aidea-modules/prescription-module/src/main/test/http/cdfortis.http
View file @
083058b2
...
...
@@ -7,12 +7,22 @@ Content-Type: application/json
[
{
"id": "22",
"approveNumber": "国药准字Z10910006",
"format": "10g/袋",
"price": "39.80",
"productNumber": "PD202011040006",
"productName": "番泻叶颗粒",
"manufacturer": "江苏艾迪药业股份有限公司"
},
{
"id": "24",
"approveNumber": "国药准字XXXX",
"format": "75mg/片",
"price": "1.00",
"productNumber": "6901028193498",
"productName": "艾邦德®",
"manufacturer": "江苏艾迪药业股份有限公司"
}
]
...
...
aidea-modules/product-module/src/main/java/com/cftech/product/dao/ProductMapper.java
View file @
083058b2
...
...
@@ -30,4 +30,10 @@ public interface ProductMapper extends GenericDao<Product> {
* @return
*/
List
<
Product
>
selectProduct
(
Map
<
String
,
Object
>
params
);
/**
*
* @param productNumberList
*/
void
updateUploadFlag
(
@Param
(
"productNumberList"
)
List
<
String
>
productNumberList
,
@Param
(
"uploadFlag"
)
int
uploadFlag
);
}
\ No newline at end of file
aidea-modules/product-module/src/main/java/com/cftech/product/dao/ProductMapper.xml
View file @
083058b2
...
...
@@ -36,6 +36,7 @@
<result
column=
"unit"
property=
"unit"
/>
<result
column=
"invoice_code"
property=
"invoiceCode"
/>
<result
column=
"deviation"
property=
"deviation"
/>
<result
column=
"upload_flag"
property=
"uploadFlag"
/>
</resultMap>
<sql
id=
"sqlWhere"
>
...
...
@@ -98,7 +99,8 @@
isreading,
unit,
invoice_code,
deviation
deviation,
upload_flag
</sql>
<sql
id=
"productList"
>
...
...
@@ -127,7 +129,8 @@
t.reading,
t.isreading,
t.invoice_code invoiceCode,
t.deviation
t.deviation,
t.upload_flag AS uploadFlag
</sql>
<insert
id=
"save"
parameterType=
"com.cftech.product.model.Product"
useGeneratedKeys=
"true"
...
...
@@ -171,6 +174,7 @@
#{unit,jdbcType=VARCHAR},
#{invoiceCode,jdbcType=VARCHAR},
#{deviation, jdbcType=BIGINT}
#{uploadFlag, jdbcType=TINYINT}
)
</insert>
...
...
@@ -220,7 +224,8 @@
a.is_rs isRs,
a.reading reading,
a.invoice_code,
a.deviation
a.deviation,
a.upload_flag uploadFlag
FROM
t_aidea_product a
LEFT JOIN t_aidea_product_classify b ON a.classify_id = b.id
...
...
@@ -260,7 +265,8 @@
a.product_number productNumber,
a.is_rs isRs,
a.reading reading,
a.invoice_code
a.invoice_code,
a.upload_flag uploadFlag
FROM
t_aidea_product a
LEFT JOIN t_aidea_product_classify b ON FIND_IN_SET(b.id,a.classify_id)
...
...
@@ -376,6 +382,9 @@
<if
test=
"deviation != null"
>
deviation = #{deviation, jdbcType=BIGINT}
</if>
<if
test=
"uploadFlag != null"
>
upload_flag = #{uploadFlag, jdbcType=TINYINT}
</if>
</set>
where id=#{id,jdbcType=BIGINT}
</update>
...
...
@@ -383,6 +392,14 @@
<update
id=
"delete"
parameterType=
"java.lang.Long"
>
update t_aidea_product set del_flag=1 where id=#{id,jdbcType=BIGINT}
</update>
<update
id=
"updateUploadFlag"
>
update t_aidea_product set upload_flag=#{uploadFlag} where product_number IN
<foreach
item=
"item"
index=
"index"
collection=
"productNumberList"
open=
"("
separator=
","
close=
")"
>
#{item}
</foreach>
</update>
<!-- 根据ID查询商品详情!-->
<select
id=
"product"
resultType=
"com.cftech.product.model.ProductVO"
>
select
...
...
aidea-modules/product-module/src/main/java/com/cftech/product/model/Product.java
View file @
083058b2
...
...
@@ -164,6 +164,8 @@ public class Product implements Serializable {
private
Long
updateBy
;
/* 偏移量 */
private
Long
deviation
;
/* 上传标识 */
private
boolean
uploadFlag
;
public
Product
()
{
this
.
delFlag
=
false
;
...
...
aidea-modules/product-module/src/main/java/com/cftech/product/service/ProductService.java
View file @
083058b2
...
...
@@ -43,4 +43,12 @@ public interface ProductService extends GenericService<Product> {
* @return
*/
List
<
Product
>
selectProduct
(
Conds
conds
,
Sort
sort
,
int
pageSize
,
int
pageNo
,
List
<
String
>
classifyId
);
/**
* 更新上传标识
*
* @param productNumberList
* @param uploadFlag
*/
void
updateUploadFlag
(
List
<
String
>
productNumberList
,
boolean
uploadFlag
);
}
aidea-modules/product-module/src/main/java/com/cftech/product/service/impl/ProductServiceImpl.java
View file @
083058b2
...
...
@@ -200,5 +200,10 @@ public class ProductServiceImpl extends GenericServiceImpl<Product> implements P
return
productMapper
.
selectProduct
(
params
);
}
@Override
public
void
updateUploadFlag
(
List
<
String
>
productNumberList
,
boolean
uploadFlag
)
{
productMapper
.
updateUploadFlag
(
productNumberList
,
uploadFlag
?
1
:
0
);
}
}
\ 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