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
8bab67be
Commit
8bab67be
authored
Sep 13, 2021
by
谢希宇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:修改bug,增加收费功能;
parent
936c375e
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
55 changed files
with
1565 additions
and
319 deletions
+1565
-319
ConsultSheetMapper.xml
...n/java/com/cftech/consultsheet/dao/ConsultSheetMapper.xml
+17
-5
ConsultSheet.java
...main/java/com/cftech/consultsheet/model/ConsultSheet.java
+2
-0
ConsultSheetService.java
.../com/cftech/consultsheet/service/ConsultSheetService.java
+1
-1
ConsultSheetServiceImpl.java
...ch/consultsheet/service/impl/ConsultSheetServiceImpl.java
+3
-4
MobileConsultSheetController.java
...cftech/consultsheet/web/MobileConsultSheetController.java
+0
-8
TxMapUtils.java
...le/src/main/java/com/cftech/hospital/util/TxMapUtils.java
+1
-1
MsgrecordMapper.xml
...rc/main/java/com/cftech/msgrecord/dao/MsgrecordMapper.xml
+1
-1
pom.xml
aidea-modules/order-module/pom.xml
+11
-0
OrderMapper.xml
...module/src/main/java/com/cftech/order/dao/OrderMapper.xml
+12
-3
Order.java
...er-module/src/main/java/com/cftech/order/model/Order.java
+5
-1
OrderService.java
.../src/main/java/com/cftech/order/service/OrderService.java
+24
-17
OrderServiceImpl.java
.../java/com/cftech/order/service/impl/OrderServiceImpl.java
+69
-27
MobileOrderController.java
...main/java/com/cftech/order/web/MobileOrderController.java
+29
-25
pom.xml
aidea-modules/pom.xml
+1
-0
pom.xml
aidea-modules/prescription-module-web/pom.xml
+0
-1
deployform.html
...-web/src/main/webapp/WEB-INF/views/deploy/deployform.html
+10
-12
deploylist.html
...-web/src/main/webapp/WEB-INF/views/deploy/deploylist.html
+26
-9
prescriptionlist.html
...n/webapp/WEB-INF/views/prescription/prescriptionlist.html
+62
-24
pom.xml
aidea-modules/prescription-module/pom.xml
+9
-0
FbusiDetail.java
.../src/main/java/com/cftech/cdfortis/model/FbusiDetail.java
+1
-1
FbusiDrug.java
...le/src/main/java/com/cftech/cdfortis/model/FbusiDrug.java
+1
-0
CdfortisServiceImpl.java
...com/cftech/cdfortis/service/impl/CdfortisServiceImpl.java
+1
-2
DeployMapper.java
...ule/src/main/java/com/cftech/deploy/dao/DeployMapper.java
+6
-0
DeployMapper.xml
...dule/src/main/java/com/cftech/deploy/dao/DeployMapper.xml
+24
-14
Deploy.java
...-module/src/main/java/com/cftech/deploy/model/Deploy.java
+35
-4
DeployService.java
...rc/main/java/com/cftech/deploy/service/DeployService.java
+14
-1
DeployServiceImpl.java
...ava/com/cftech/deploy/service/impl/DeployServiceImpl.java
+17
-2
MobileDeployController.java
...in/java/com/cftech/deploy/web/MobileDeployController.java
+4
-4
PrescriptionMapper.xml
...n/java/com/cftech/prescription/dao/PrescriptionMapper.xml
+129
-8
SynPrescriptBillJob.java
...java/com/cftech/prescription/job/SynPrescriptBillJob.java
+68
-0
SynPrescriptRefundJob.java
...va/com/cftech/prescription/job/SynPrescriptRefundJob.java
+87
-0
Prescription.java
...main/java/com/cftech/prescription/model/Prescription.java
+66
-2
PrescriptionService.java
.../com/cftech/prescription/service/PrescriptionService.java
+7
-0
PrescriptionServiceImpl.java
...ch/prescription/service/impl/PrescriptionServiceImpl.java
+86
-8
PrescriptionController.java
...a/com/cftech/prescription/web/PrescriptionController.java
+23
-3
pom.xml
aidea-modules/product-module/pom.xml
+3
-4
ProductServiceImpl.java
...a/com/cftech/product/service/impl/ProductServiceImpl.java
+2
-5
reportlist.html
...-web/src/main/webapp/WEB-INF/views/report/reportlist.html
+9
-21
ReportMapper.xml
...dule/src/main/java/com/cftech/report/dao/ReportMapper.xml
+46
-36
ReportJob.java
...module/src/main/java/com/cftech/report/job/ReportJob.java
+6
-5
Report.java
...-module/src/main/java/com/cftech/report/model/Report.java
+18
-16
ReportPeopleInfo.java
...c/main/java/com/cftech/report/model/ReportPeopleInfo.java
+10
-0
ReportController.java
...src/main/java/com/cftech/report/web/ReportController.java
+1
-1
pom.xml
aidea-modules/wechat-pay-module/pom.xml
+14
-0
HashKit.java
...y-module/src/main/java/com.cftech.wechat/pay/HashKit.java
+1
-1
Md5Utils.java
...-module/src/main/java/com.cftech.wechat/pay/Md5Utils.java
+1
-1
WechatPay.java
...module/src/main/java/com.cftech.wechat/pay/WechatPay.java
+1
-1
WechatPayUtils.java
...e/src/main/java/com.cftech.wechat/pay/WechatPayUtils.java
+378
-0
WechatRefundDescryptUtils.java
...java/com.cftech.wechat/pay/WechatRefundDescryptUtils.java
+154
-0
common-test.properties
cftech-common-web/src/main/resources/common-test.properties
+13
-3
common.properties
cftech-common-web/src/main/resources/common.properties
+11
-1
CfarticleServiceImpl.java
...tech/cms/cfarticle/service/impl/CfarticleServiceImpl.java
+35
-33
ArticleMapper.xml
...src/main/java/com/cftech/mp/article/dao/ArticleMapper.xml
+2
-2
MultiCustserviceMapper.xml
.../com/cftech/mp/custservice/dao/MultiCustserviceMapper.xml
+1
-1
pom.xml
pom.xml
+7
-0
No files found.
aidea-modules/consult-module/src/main/java/com/cftech/consultsheet/dao/ConsultSheetMapper.xml
View file @
8bab67be
...
...
@@ -32,6 +32,7 @@
<result
column=
"address_id"
property=
"addressId"
></result>
<result
column=
"audit_time"
property=
"auditTime"
></result>
<result
column=
"followup_hospital"
property=
"followupHospital"
></result>
<result
column=
"pre_id"
property=
"preId"
></result>
</resultMap>
<sql
id=
"sqlWhere"
>
...
...
@@ -92,7 +93,8 @@
a.audit_time auditTime,
b.`name` pharmaName,
c.`name` customerName,
a.followup_hospital followupHospital
a.followup_hospital followupHospital,
a.pre_id preId
</sql>
<sql
id=
"sqlCol"
>
...
...
@@ -113,7 +115,8 @@
consult_id consultId,
status,
drugs_id drugsId,
address_id addressId
address_id addressId,
pre_id preId
</sql>
<insert
id=
"save"
parameterType=
"com.cftech.consultsheet.model.ConsultSheet"
useGeneratedKeys=
"true"
...
...
@@ -147,7 +150,8 @@
member_id,
order_id,
address_id,
audit_time
audit_time,
pre_id
)
values
(
...
...
@@ -178,13 +182,18 @@
#{memberId, jdbcType=BIGINT},
#{orderId, jdbcType=BIGINT},
#{addressId, jdbcType=VARCHAR},
#{auditTime, jdbcType=TIMESTAMP}
#{auditTime, jdbcType=TIMESTAMP},
#{preId, jdbcType=BIGINT}
)
</insert>
<select
id=
"fetchById"
parameterType=
"java.lang.Long"
resultType=
"com.cftech.consultsheet.model.ConsultSheet"
>
SELECT
<include
refid=
"sqlColumns"
/>
, d.name pharmacist, e.org_name hospital, f.store fansAlias, f.nickname nickName,
<include
refid=
"sqlColumns"
/>
,
d.name pharmacist,
e.org_name hospital,
f.store fansAlias,
f.nickname nickName,
m.status isThree,
m.invitcode randomNo,
ou.org_name firstHospital
...
...
@@ -354,6 +363,9 @@
<if
test=
"followupHospital != null"
>
followup_hospital = #{followupHospital, jdbcType=VARCHAR},
</if>
<if
test=
"preId != null"
>
pre_id = #{preId, jdbcType=VARCHAR},
</if>
</set>
where id=#{id,jdbcType=BIGINT}
</update>
...
...
aidea-modules/consult-module/src/main/java/com/cftech/consultsheet/model/ConsultSheet.java
View file @
8bab67be
...
...
@@ -74,6 +74,8 @@ public class ConsultSheet extends UserSheet implements Serializable {
private
Long
orderId
;
/* 随访医院 */
private
String
followupHospital
;
/* 所属处方单Id */
private
Long
preId
;
/**
* 审核时间
...
...
aidea-modules/consult-module/src/main/java/com/cftech/consultsheet/service/ConsultSheetService.java
View file @
8bab67be
...
...
@@ -74,7 +74,7 @@ public interface ConsultSheetService extends GenericService<ConsultSheet> {
* 咨询单消息推送
* @param consultSheet
*/
void
sendQyWechatMassage
(
ConsultSheet
consultSheet
);
void
sendQyWechatMassage
(
ConsultSheet
consultSheet
)
throws
Exception
;
/**
* 通过咨询单/订单编码获取对应客服信息
...
...
aidea-modules/consult-module/src/main/java/com/cftech/consultsheet/service/impl/ConsultSheetServiceImpl.java
View file @
8bab67be
...
...
@@ -208,7 +208,7 @@ public class ConsultSheetServiceImpl extends GenericServiceImpl<ConsultSheet> im
*
* @return
*/
private
boolean
memberProcess
(
String
openid
,
ConsultSheet
consultSheet
)
{
private
boolean
memberProcess
(
String
openid
,
ConsultSheet
consultSheet
)
throws
Exception
{
//1、查询用户是否复购
Conds
conds
=
new
Conds
();
conds
.
equal
(
"o.del_flag"
,
Constants
.
DEL_FLAG_0
);
...
...
@@ -259,10 +259,9 @@ public class ConsultSheetServiceImpl extends GenericServiceImpl<ConsultSheet> im
*
* @return
*/
private
boolean
firstCustomerProcess
(
ConsultSheet
consultSheet
)
{
private
boolean
firstCustomerProcess
(
ConsultSheet
consultSheet
)
throws
Exception
{
first:
for
(
int
i
=
0
,
y
=
arr
.
length
;
i
<
y
;
i
++)
{
Conds
conds
=
new
Conds
();
conds
.
equal
(
"t.del_flag"
,
Constants
.
DEL_FLAG_0
);
conds
.
equal
(
"t.user_type"
,
arr
[
i
]);
//1:药师; 2:客服
...
...
@@ -340,7 +339,7 @@ public class ConsultSheetServiceImpl extends GenericServiceImpl<ConsultSheet> im
/**
* 推送企业微信消息
*/
public
void
sendQyWechatMassage
(
ConsultSheet
consultSheet
)
{
public
void
sendQyWechatMassage
(
ConsultSheet
consultSheet
)
throws
Exception
{
Long
accounts
=
Long
.
parseLong
(
SystemConfig
.
p
.
getProperty
(
"QY_SEND_APPID"
));
MpAccountsEntity
accountsEntity
=
mpAccountsService
.
getDetail
(
accounts
);
Long
agenId
=
Long
.
parseLong
(
accountsEntity
.
getAgentId
());
...
...
aidea-modules/consult-module/src/main/java/com/cftech/consultsheet/web/MobileConsultSheetController.java
View file @
8bab67be
...
...
@@ -55,12 +55,4 @@ public class MobileConsultSheetController {
public
JSONObject
byBillFindCustomerService
(
@RequestParam
String
billCode
)
{
return
consultSheetService
.
byBillFindCustomerService
(
billCode
);
}
@RequestMapping
(
value
=
"/test"
,
method
=
{
RequestMethod
.
POST
},
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
public
void
test
(
Long
id
)
{
ConsultSheet
consultSheet
=
consultSheetService
.
fetchById
(
id
);
consultSheetService
.
sendQyWechatMassage
(
consultSheet
);
}
}
aidea-modules/hospital-module/src/main/java/com/cftech/hospital/util/TxMapUtils.java
View file @
8bab67be
...
...
@@ -3,8 +3,8 @@ package com.cftech.hospital.util;
import
com.alibaba.fastjson.JSONObject
;
import
com.cftech.core.util.StringUtils
;
import
com.cftech.core.util.SystemConfig
;
import
com.cftech.order.pay.HashKit
;
import
com.cftech.waybill.utils.CloseableHttpEntity
;
import
com.cftech.wechat.pay.HashKit
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.http.client.ClientProtocolException
;
import
org.apache.http.client.config.RequestConfig
;
...
...
aidea-modules/msgrecord-module/src/main/java/com/cftech/msgrecord/dao/MsgrecordMapper.xml
View file @
8bab67be
...
...
@@ -93,7 +93,7 @@
#{tofrom, jdbcType=VARCHAR},
#{tolist, jdbcType=VARCHAR},
#{roomid, jdbcType=VARCHAR},
#{msgtime, jdbcType=
DATETIME
},
#{msgtime, jdbcType=
TIMESTAMP
},
#{msgType, jdbcType=VARCHAR},
#{content, jdbcType=VARCHAR},
#{mediaPath, jdbcType=VARCHAR},
...
...
aidea-modules/order-module/pom.xml
View file @
8bab67be
...
...
@@ -12,6 +12,11 @@
<artifactId>
order-module
</artifactId>
<dependencies>
<dependency>
<groupId>
com.cftech
</groupId>
<artifactId>
wechat-pay-module
</artifactId>
<version>
1.0-SNAPSHOT
</version>
</dependency>
<dependency>
<groupId>
com.cftech
</groupId>
<artifactId>
order-detail-module
</artifactId>
...
...
@@ -48,5 +53,11 @@
<version>
1.0-SNAPSHOT
</version>
<scope>
compile
</scope>
</dependency>
<dependency>
<groupId>
com.cftech
</groupId>
<artifactId>
prescription-module
</artifactId>
<version>
1.0-SNAPSHOT
</version>
<scope>
compile
</scope>
</dependency>
</dependencies>
</project>
\ No newline at end of file
aidea-modules/order-module/src/main/java/com/cftech/order/dao/OrderMapper.xml
View file @
8bab67be
...
...
@@ -37,6 +37,7 @@
<result
column=
"order_time"
property=
"orderTime"
/>
<result
column=
"remind_type"
property=
"remindType"
/>
<result
column=
"pay_type"
property=
"payType"
/>
<result
column=
"cash_fee"
property=
"cashFee"
/>
</resultMap>
<sql
id=
"sqlWhere"
>
...
...
@@ -94,7 +95,8 @@
m.`name` memberName,
CONVERT ( AES_DECRYPT( m.phone, 'aideakey' ) USING UTF8 ) memberPhone,
a.address,
a.pay_type
a.pay_type,
a.cash_fee
</sql>
<sql
id=
"Column"
>
...
...
@@ -147,7 +149,8 @@
order_time,
cancel_time,
remind_type,
pay_type
pay_type,
cash_fee
)
values
(
...
...
@@ -182,7 +185,8 @@
#{orderTime, jdbcType=TIMESTAMP},
#{cancelTime, jdbcType=TIMESTAMP},
#{remindType, jdbcType=VARCHAR},
#{payType, jdbcType=VARCHAR}
#{payType, jdbcType=VARCHAR},
#{cashFee, jdbcType=DECIMAL}
)
</insert>
<update
id=
"deleteAll"
>
...
...
@@ -213,6 +217,7 @@
DATE_FORMAT(aw.create_time, '%Y-%m-%d %H:%i:%s') sendExpressDateStr,
DATE_FORMAT(aw.accept_express_date, '%Y-%m-%d %H:%i:%s') acceptExpressDateStr,
o.pay_time payTime,
o.cash_fee cashFee,
qyu.name storageManageName
from
t_order o
...
...
@@ -313,6 +318,7 @@
o.remind_type remindType,
o.remarks,
o.accounts_id accountsId,
o.cash_fee cashFee,
t.id as productId,
GROUP_CONCAT(t.product_number SEPARATOR ',') productNumber,
GROUP_CONCAT(t.common_name SEPARATOR ',') productName,
...
...
@@ -477,6 +483,9 @@
<if
test=
"payType != null"
>
pay_type = #{payType, jdbcType=VARCHAR},
</if>
<if
test=
"cashFee != null"
>
cash_fee = #{cashFee, jdbcType=DECIMAL},
</if>
</set>
where id=#{id,jdbcType=BIGINT}
</update>
...
...
aidea-modules/order-module/src/main/java/com/cftech/order/model/Order.java
View file @
8bab67be
...
...
@@ -29,9 +29,11 @@ public class Order extends OrderDetail implements Serializable {
/* 付款回调详情 */
@ExportConfig
(
value
=
"付款回调详情"
,
width
=
100
,
showLevel
=
1
)
private
String
payStatus
;
/* 付款金额 */
/* 付款金额
(微信付款总金额)
*/
@ExportConfig
(
value
=
"付款金额"
,
width
=
100
,
showLevel
=
1
)
private
Double
payAmount
;
/* 付款现金金额(微信付款现金部分) */
private
Double
cashFee
;
/* 订单金额 */
@ExportConfig
(
value
=
"订单金额"
,
width
=
100
,
showLevel
=
1
)
private
Double
orderAmount
;
...
...
@@ -149,6 +151,8 @@ public class Order extends OrderDetail implements Serializable {
private
boolean
isFirst
;
/**
* 搜索字段
*/
...
...
aidea-modules/order-module/src/main/java/com/cftech/order/service/OrderService.java
View file @
8bab67be
...
...
@@ -94,20 +94,12 @@ public interface OrderService extends GenericService<Order> {
Integer
updateRemindType
(
Long
id
,
String
option
);
/**
* 回调微信支付状态
* @param request
* @return
*/
String
callBackPayStatus
(
HttpServletRequest
request
);
/**
* 获取移动端jsapi支付参数
* @param orderId
* @param openId
* 获取路由信息
* @param appId
* @param orderCode
* @return
*/
String
findOrderPayParams
(
String
orderId
,
String
openId
,
String
appId
,
String
prepayId
);
JSONObject
findRouteDetails
(
String
appId
,
String
orderCode
);
/**
* 发送微信消息
...
...
@@ -117,16 +109,31 @@ public interface OrderService extends GenericService<Order> {
boolean
sendQyWechatMassage
(
Long
id
,
String
msgType
);
/**
* 获取路由信息
* @param appId
* @param orderCode
* 获取等待提醒的订单发送客服跟进提醒消息
* @return
*/
JSONObject
findRouteDetails
(
String
appId
,
String
orderCode
);
List
<
Map
<
String
,
String
>>
findWaitRemindOrders
(
Long
number
);
/**
* 获取等待提醒的订单发送客服跟进提醒消息
* 回调微信支付信息
* @param request
* @return
*/
List
<
Map
<
String
,
String
>>
findWaitRemindOrders
(
Long
number
);
String
wechatPayCallback
(
HttpServletRequest
request
);
/**
* 回调微信退款信息
* @param request
* @return
*/
String
wechatRefundCallback
(
HttpServletRequest
request
);
/**
* 获取移动端jsapi支付参数
* @param openId
* @param appId
* @return
*/
String
findOrderPayParams
(
String
openId
,
String
appId
,
String
prepayId
);
}
aidea-modules/order-module/src/main/java/com/cftech/order/service/impl/OrderServiceImpl.java
View file @
8bab67be
This diff is collapsed.
Click to expand it.
aidea-modules/order-module/src/main/java/com/cftech/order/web/MobileOrderController.java
View file @
8bab67be
package
com
.
cftech
.
order
.
web
;
import
com.alibaba.fastjson.JSONObject
;
import
com.cftech.core.sql.Conds
;
import
com.cftech.core.util.Constants
;
import
com.cftech.invoice.model.InvoiceDto
;
import
com.cftech.order.model.Order
;
import
com.cftech.order.model.OrderMobileDto
;
import
com.cftech.order.service.OrderService
;
import
lombok.extern.slf4j.Slf4j
;
...
...
@@ -13,7 +10,6 @@ import org.springframework.http.MediaType;
import
org.springframework.web.bind.annotation.*
;
import
javax.servlet.http.HttpServletRequest
;
import
java.util.List
;
/**
* @author :licc
...
...
@@ -77,41 +73,49 @@ public class MobileOrderController {
}
/**
* 订单回调方法
* 获取路由信息
* @param appId
* @param orderCode
* @return
*/
@RequestMapping
(
value
=
"/findRouteDetails"
,
method
=
RequestMethod
.
POST
,
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
public
JSONObject
findRouteDetails
(
@RequestParam
String
appId
,
@RequestParam
String
orderCode
)
{
return
orderService
.
findRouteDetails
(
appId
,
orderCode
);
}
/**
* 微信订单支付回调
* @return
*/
@RequestMapping
(
value
=
"/wechatPayCallback"
,
method
=
{
RequestMethod
.
POST
,
RequestMethod
.
GET
})
public
String
wechatPayCallback
(
HttpServletRequest
request
)
{
log
.
info
(
" wechatCallback 已触发微信付款回调!"
);
return
orderService
.
wechatPayCallback
(
request
);
}
/**
* 微信订单退款回调
* @return
*/
@RequestMapping
(
value
=
"/wechatCallback"
,
method
=
{
RequestMethod
.
POST
,
RequestMethod
.
GET
})
public
String
wechatCallback
(
HttpServletRequest
request
)
{
@RequestMapping
(
value
=
"/wechat
Refund
Callback"
,
method
=
{
RequestMethod
.
POST
,
RequestMethod
.
GET
})
public
String
wechat
Refund
Callback
(
HttpServletRequest
request
)
{
log
.
info
(
" wechatCallback 已触发微信付款回调!"
);
return
orderService
.
callBackPayStatus
(
request
);
return
orderService
.
wechatRefundCallback
(
request
);
}
/**
* 获取微信付款加密参数
* @param orderId
* @param openId
* @param appId
* @param prepayId
* @return
*/
@RequestMapping
(
value
=
"/findOrderPayParams"
,
method
=
RequestMethod
.
POST
,
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
public
String
findOrderPayParams
(
@RequestParam
String
orderId
,
@RequestParam
String
openId
,
public
String
findOrderPayParams
(
@RequestParam
String
openId
,
@RequestParam
String
appId
,
@RequestParam
String
prepayId
)
{
return
orderService
.
findOrderPayParams
(
orderId
,
openId
,
appId
,
prepayId
);
}
/**
* 获取路由信息
* @param appId
* @param orderCode
* @return
*/
@RequestMapping
(
value
=
"/findRouteDetails"
,
method
=
RequestMethod
.
POST
,
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
public
JSONObject
findRouteDetails
(
@RequestParam
String
appId
,
@RequestParam
String
orderCode
)
{
return
orderService
.
findRouteDetails
(
appId
,
orderCode
);
return
orderService
.
findOrderPayParams
(
openId
,
appId
,
prepayId
);
}
}
aidea-modules/pom.xml
View file @
8bab67be
...
...
@@ -12,6 +12,7 @@
<artifactId>
aidea-modules
</artifactId>
<packaging>
pom
</packaging>
<modules>
<module>
wechat-pay-module
</module>
<module>
consult-module
</module>
<module>
consult-module-web
</module>
<module>
product-classify-module
</module>
...
...
aidea-modules/prescription-module-web/pom.xml
View file @
8bab67be
...
...
@@ -26,5 +26,4 @@
<finalName>
prescription-module-web
</finalName>
</build>
</project>
\ No newline at end of file
aidea-modules/prescription-module-web/src/main/webapp/WEB-INF/views/deploy/deployform.html
View file @
8bab67be
...
...
@@ -56,12 +56,12 @@
<section
class=
"content-header"
>
<h1>
处方单
列表
管理
<small>
处方单
列表
</small>
处方单
收费设置
管理
<small>
处方单
收费设置
</small>
</h1>
<ol
class=
"breadcrumb"
>
<li><a
href=
"#"
><i
class=
"fa fa-dashboard"
></i>
首页
</a></li>
<li><a
class=
"active"
>
处方单
列表
</a></li>
<li><a
class=
"active"
>
处方单
收费设置
</a></li>
</ol>
</section>
...
...
@@ -77,26 +77,26 @@
<div
class=
"box-body"
>
<div
class=
"form-group form-md-line-input col-md-12"
>
<label>
是否开启支付
</label>
<select
name=
"
takeType
"
class=
"form-control pull-right"
>
<select
name=
"
isPay
"
class=
"form-control pull-right"
>
<option
label=
"关闭"
value=
"0"
>
关闭
</option>
<option
label=
"开启"
value=
"
周
"
#
if
($
data
.
isPay =
=
'
1
')
selected
#
end
>
开启
</option>
<option
label=
"开启"
value=
"
1
"
#
if
($
data
.
isPay =
=
'
1
')
selected
#
end
>
开启
</option>
</select>
</div>
<div
class=
"form-group form-md-line-input col-md-12"
>
<label>
支付类型
</label>
<select
name=
"
takeTyp
e"
class=
"form-control pull-right"
>
<select
name=
"
isThirdPhas
e"
class=
"form-control pull-right"
>
<option
label=
"全部"
value=
"0"
>
全部
</option>
<option
label=
"三期"
value=
"1"
#
if
($
data
.
is
Pay
=
=
'
1
')
selected
#
end
>
三期
</option>
<option
label=
"非三期"
value=
"
1"
#
if
($
data
.
isPay
=
=
'
2
')
selected
#
end
>
非三期
</option>
<option
label=
"三期"
value=
"1"
#
if
($
data
.
is
ThirdPhase
=
=
'
1
')
selected
#
end
>
三期
</option>
<option
label=
"非三期"
value=
"
2"
#
if
($
data
.
isThirdPhase
=
=
'
2
')
selected
#
end
>
非三期
</option>
</select>
</div>
<div
class=
"form-group form-md-line-input col-md-12"
>
<label>
支付金额
</label>
<input
name=
"
listHtml
"
class=
"form-control"
type=
"number"
<input
name=
"
amount
"
class=
"form-control"
type=
"number"
onkeyup=
"this.value=this.value.replace(/[^\d\.\d{0,2}]/g,'')"
value=
"
1
"
/>
value=
"
${data.amount}
"
/>
</div>
</div>
...
...
@@ -203,12 +203,10 @@
initFormCtrl
();
}
return
{
//main function to initiate the module
init
:
function
()
{
initForm
();
}
};
}();
</script>
...
...
aidea-modules/prescription-module-web/src/main/webapp/WEB-INF/views/deploy/deploylist.html
View file @
8bab67be
...
...
@@ -60,12 +60,12 @@
<section
class=
"content-header"
>
<h1>
处方单
列表
管理
<small>
处方单列表
</small>
处方单
收费设置
管理
<small>
处方单
收费设置
列表
</small>
</h1>
<ol
class=
"breadcrumb"
>
<li><a><i
class=
"fa fa-dashboard"
></i>
首页
</a></li>
<li><a
class=
"active"
>
处方单
列表
管理列表
</a></li>
<li><a
class=
"active"
>
处方单
收费设置
管理列表
</a></li>
</ol>
</section>
...
...
@@ -78,7 +78,8 @@
<div
class=
"box-header"
>
<form
id=
"seachTableForm"
action=
"#springUrl('/a/deploy/list')"
method=
"get"
>
<div
class=
"col-xs-5"
>
<a
href=
"#springUrl('/a/deploy/form')"
class=
"btn btn-primary"
>
新增
</a>
<span
style=
"font-size: 18px;"
>
温馨提示:
</span><span
style=
"color:red;font-size: 18px;"
>
请于晚上10点之后调整对应配置
</span>
<!-- <a href="#springUrl('/a/deploy/form')" class="btn btn-primary">新增</a>-->
</div>
</form>
</div>
<!-- /.box-header -->
...
...
@@ -91,8 +92,6 @@
<th>
支付状态
</th>
<th>
支付人员类型
</th>
<th>
支付金额
</th>
<!-- <th>是否检测</th>-->
<th>
名称
</th>
<th>
创建时间
</th>
<th>
操作
</th>
</tr>
...
...
@@ -200,7 +199,7 @@
"mData"
:
"isThirdPhase"
},
{
"mData"
:
"
isExamination
"
"mData"
:
"
amount
"
},
{
"mData"
:
"createTime"
...
...
@@ -220,20 +219,38 @@
{
"aTargets"
:
[
2
],
"mData"
:
"isPay"
,
"mRender"
:
function
(
a
,
b
,
c
,
d
)
{
if
(
a
==
'0'
)
{
return
"关闭"
;
}
else
if
(
a
==
'1'
)
{
return
"开启"
;
}
return
''
;
}
},
{
"aTargets"
:
[
3
],
"mData"
:
"isThirdPhase"
,
"mRender"
:
function
(
a
,
b
,
c
,
d
)
{
if
(
a
==
'0'
)
{
return
"全部"
;
}
else
if
(
a
==
'1'
)
{
return
"三期"
;
}
else
if
(
a
==
'2'
)
{
return
"非三期"
;
}
return
''
;
}
},
{
"aTargets"
:
[
4
],
"aTargets"
:
[
5
],
"mData"
:
"createTime"
,
"mRender"
:
function
(
a
,
b
,
c
,
d
)
{
return
formatDates
(
a
,
"yyyy-MM-dd HH:mm:ss"
);
}
},
{
"aTargets"
:
[
5
],
"aTargets"
:
[
6
],
"mData"
:
"id"
,
"mRender"
:
function
(
a
,
b
,
c
,
d
)
{
return
'<a href="#springUrl("/a/deploy/form?id='
+
c
.
id
+
'")" data-id="'
+
c
.
id
+
'" data-action="view">修改</a>'
;
...
...
aidea-modules/prescription-module-web/src/main/webapp/WEB-INF/views/prescription/prescriptionlist.html
View file @
8bab67be
...
...
@@ -78,11 +78,13 @@
<div
class=
"box-header"
>
<form
id=
"seachTableForm"
action=
"#springUrl('/a/prescription/list')"
method=
"get"
>
<div
class=
"col-xs-5"
>
<div
class=
"col-xs-2"
>
<input
type=
"text"
class=
"form-control"
name=
"number"
placeholder=
"处方编码"
>
</div>
<button
type=
"button"
class=
"search btn btn-primary"
>
搜索
</button>
#if($shiro.hasPermission("qy:prescription:edit"))
<a
href=
"#springUrl('/a/prescription/form')"
class=
"btn btn-primary"
>
新增
</a>
<!-- <a href="#springUrl('/a/prescription/exportExcel')" class="btn btn-primary">导出</a>-->
<!-- <a onclick="importExcel();" class="btn btn-primary">导入</a>-->
#end
</div>
</form>
...
...
@@ -94,14 +96,15 @@
<td
hidden=
"true"
>
Id
</td>
<th>
处方编号
</th>
<th>
咨询单编号
</th>
<th>
药店编号
</th>
<th>
医院名称
</th>
<th>
药店名称
</th>
<th>
用户姓名
</th>
<th>
用户手机号码
</th>
<th>
医生开方状态
</th>
<th>
本次处方开方时间
</th>
<th>
处方状态
</th>
<th>
姓名
</th>
<th>
手机号码
</th>
<th>
openId
</th>
<th>
开方状态
</th>
<th>
开方时间
</th>
<th>
支付编码
</th>
<th>
付款状态
</th>
<th>
付费金额
</th>
<th>
付费时间
</th>
<th>
操作
</th>
...
...
@@ -148,6 +151,8 @@
<!-- AdminLTE for demo purposes -->
<script
src=
"common/js/cfapp.js"
></script>
<script>
var
csrf
=
'${_csrf.token}'
;
var
csrf_header
=
'${_csrf.headerName}'
;
function
formatDates
(
now
)
{
var
now
=
new
Date
(
now
);
var
year
=
now
.
getFullYear
();
...
...
@@ -206,9 +211,6 @@
{
"mData"
:
"consultNo"
},
{
"mData"
:
"storeId"
},
{
"mData"
:
"hospitalName"
},
...
...
@@ -221,6 +223,9 @@
{
"mData"
:
"custPhone"
},
{
"mData"
:
"openid"
},
{
"mData"
:
"docStatus"
},
...
...
@@ -228,13 +233,16 @@
"mData"
:
"createTime"
},
{
"mData"
:
"status"
"mData"
:
"prepayId"
},
{
"mData"
:
"payStatus"
},
{
"mData"
:
"pay
mentPrice
"
"mData"
:
"pay
Amount
"
},
{
"mData"
:
"pay
mentDat
e"
"mData"
:
"pay
Tim
e"
},
{
"mData"
:
"id"
...
...
@@ -253,6 +261,8 @@
return
'未审核'
;
}
else
if
(
a
==
'2'
)
{
return
'审核拒绝'
;
}
else
{
return
""
;
}
}
},
...
...
@@ -261,27 +271,54 @@
"mData"
:
"createTime"
,
"mRender"
:
function
(
a
,
b
,
c
,
d
)
{
return
formatDates
(
a
,
"yyyy-MM-dd HH:mm:ss"
);
}
},
{
"aTargets"
:
[
10
],
"mData"
:
"prepayId"
,
"mRender"
:
function
(
a
,
b
,
c
,
d
)
{
if
(
a
!=
null
&&
a
!=
''
)
{
return
a
;
}
else
{
return
'无需支付'
;
}
}
},
{
// set default column settings
'targets'
:
[
10
],
'targets'
:
[
11
],
"mData"
:
"payStatus"
,
"mRender"
:
function
(
a
,
b
,
c
,
d
)
{
if
(
a
==
'0'
)
{
return
'未
审核
'
;
return
'未
支付
'
;
}
else
if
(
a
==
'1'
)
{
return
'
审核通过
'
;
return
'
已支付
'
;
}
else
if
(
a
==
'2'
)
{
return
'审核拒绝'
;
return
'已退款'
}
else
{
return
""
;
}
}
},
{
"aTargets"
:
[
13
],
"mData"
:
"payTime"
,
"mRender"
:
function
(
a
,
b
,
c
,
d
)
{
if
(
a
!=
null
)
{
return
formatDates
(
a
,
"yyyy-MM-dd HH:mm:ss"
);
}
else
{
return
""
;
}
}
},
{
"aTargets"
:
[
14
],
"mData"
:
"id"
,
"mRender"
:
function
(
a
,
b
,
c
,
d
)
{
var
html
=
''
;
html
+=
'<a href="#springUrl("/a/prescription/form?id='
+
a
+
'")" class="btn green">查看</a>'
;
if
(
c
.
payStatus
==
'1'
&&
c
.
description
!=
'1'
)
{
//已支付且 单据不为待确认
html
+=
'<a onclick="refund(`'
+
a
+
'`)" class="btn green">退款</a>'
;
}
return
html
;
}
}
...
...
@@ -307,21 +344,22 @@
Cfapp
.
init
();
function
re
moveData
(
data
)
{
function
re
fund
(
data
)
{
Cfapp
.
confirm
({
message
:
"确定要
删除
吗"
,
message
:
"确定要
退款
吗"
,
btnoktext
:
"确定"
,
btncanceltext
:
"取消"
,
success
:
function
()
{
$
.
ajax
({
type
:
"POST"
,
url
:
"#springUrl('/a/prescription/delete')"
,
data
:
{
id
:
data
},
url
:
"#springUrl('/a/prescription/refund')"
,
data
:
{
id
:
data
,
_csrf
:
csrf
,
_csrf_header
:
csrf_header
,},
dataType
:
"json"
,
success
:
function
(
data
)
{
if
(
data
.
errorNo
==
0
)
{
Cfapp
.
alert
({
message
:
"
删除
成功"
,
message
:
"
退款
成功"
,
btntext
:
"确定"
,
success
:
function
()
{
location
.
href
=
"#springUrl('/a/prescription/list')"
;
...
...
aidea-modules/prescription-module/pom.xml
View file @
8bab67be
...
...
@@ -10,4 +10,13 @@
<modelVersion>
4.0.0
</modelVersion>
<artifactId>
prescription-module
</artifactId>
<dependencies>
<dependency>
<groupId>
com.cftech
</groupId>
<artifactId>
wechat-pay-module
</artifactId>
<version>
1.0-SNAPSHOT
</version>
</dependency>
</dependencies>
</project>
\ No newline at end of file
aidea-modules/prescription-module/src/main/java/com/cftech/cdfortis/model/FbusiDetail.java
View file @
8bab67be
...
...
@@ -7,6 +7,7 @@ import java.util.List;
@Data
public
class
FbusiDetail
implements
Serializable
{
private
String
id
;
private
String
storeId
;
private
String
hospitalName
;
...
...
@@ -33,5 +34,4 @@ public class FbusiDetail implements Serializable {
private
List
<
FbusiDrug
>
drugs
;
private
List
<
FbusiDrug
>
drugList
;
}
aidea-modules/prescription-module/src/main/java/com/cftech/cdfortis/model/FbusiDrug.java
View file @
8bab67be
...
...
@@ -6,6 +6,7 @@ import java.io.Serializable;
@Data
public
class
FbusiDrug
implements
Serializable
{
private
String
drugId
;
private
String
drugName
;
private
String
drugCompany
;
...
...
aidea-modules/prescription-module/src/main/java/com/cftech/cdfortis/service/impl/CdfortisServiceImpl.java
View file @
8bab67be
...
...
@@ -119,8 +119,7 @@ public class CdfortisServiceImpl implements CdfortisService {
urlParam
.
put
(
"token"
,
cdfortisTokenUtil
.
getToken
());
urlParam
.
put
(
"orderId"
,
orderId
);
// 请求获取数据
String
data
=
CdfortisResponseUtil
.
request
(
getFbusiInfoByOrderIdUrl
,
CdfortisConstant
.
METHOD_GET
,
urlParam
,
null
,
null
);
String
data
=
CdfortisResponseUtil
.
request
(
getFbusiInfoByOrderIdUrl
,
CdfortisConstant
.
METHOD_GET
,
urlParam
,
null
,
null
);
if
(
StringUtils
.
isEmpty
(
data
))
{
return
null
;
}
...
...
aidea-modules/prescription-module/src/main/java/com/cftech/deploy/dao/DeployMapper.java
View file @
8bab67be
...
...
@@ -2,6 +2,7 @@ package com.cftech.deploy.dao;
import
com.cftech.deploy.model.Deploy
;
import
com.cftech.core.generic.GenericDao
;
import
org.apache.ibatis.annotations.Param
;
/**
* 处方单列表Mapper
...
...
@@ -11,4 +12,9 @@ import com.cftech.core.generic.GenericDao;
*/
public
interface
DeployMapper
extends
GenericDao
<
Deploy
>
{
/**
* 是否三期患者
* @return
*/
Integer
byOpenidFindEmployeeIsPhase
(
@Param
(
"openid"
)
String
openid
);
}
\ No newline at end of file
aidea-modules/prescription-module/src/main/java/com/cftech/deploy/dao/DeployMapper.xml
View file @
8bab67be
...
...
@@ -7,6 +7,7 @@
<result
column=
"name"
property=
"name"
/>
<result
column=
"is_pay"
property=
"isPay"
/>
<result
column=
"is_third_phase"
property=
"isThirdPhase"
/>
<result
column=
"amount"
property=
"amount"
/>
<result
column=
"is_examination"
property=
"isExamination"
/>
<result
column=
"number"
property=
"number"
/>
<result
column=
"accounts_id"
property=
"accountsId"
/>
...
...
@@ -52,6 +53,7 @@
name,
is_pay,
is_third_phase,
amount,
is_examination,
number,
accounts_id,
...
...
@@ -77,6 +79,7 @@
#{name, jdbcType=VARCHAR},
#{isPay, jdbcType=VARCHAR},
#{isThirdPhase, jdbcType=VARCHAR},
#{amount, jdbcType=DECIMAL},
#{isExamination, jdbcType=VARCHAR},
#{number, jdbcType=VARCHAR},
#{accountsId, jdbcType=BIGINT},
...
...
@@ -100,7 +103,6 @@
<select
id=
"count"
parameterType=
"java.util.Map"
resultType=
"java.lang.Integer"
>
SELECT COUNT(1) FROM t_aidea_platform_config
<include
refid=
"sqlWhere"
/>
</select>
<select
id=
"fetchSearchByPage"
parameterType=
"java.util.Map"
resultMap=
"resultMap"
>
...
...
@@ -127,6 +129,9 @@
<if
test=
"isThirdPhase != null"
>
is_third_phase = #{isThirdPhase, jdbcType=VARCHAR},
</if>
<if
test=
"amount != null"
>
amount = #{amount, jdbcType=DECIMAL},
</if>
<if
test=
"isExamination != null"
>
is_examination = #{isExamination, jdbcType=VARCHAR},
</if>
...
...
@@ -163,4 +168,9 @@
set del_flag=1
where id = #{id,jdbcType=BIGINT}
</update>
<select
id=
"byOpenidFindEmployeeIsPhase"
parameterType=
"java.lang.String"
resultType=
"java.lang.Integer"
>
SELECT COUNT(1) FROM wx_mp_member
WHERE status = '1' AND del_flag = '0' AND open_id = #{openid, jdbcType=VARCHAR}
</select>
</mapper>
\ No newline at end of file
aidea-modules/prescription-module/src/main/java/com/cftech/deploy/model/Deploy.java
View file @
8bab67be
...
...
@@ -4,6 +4,7 @@ import com.cftech.core.poi.ExportConfig;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.math.BigDecimal
;
import
java.util.Date
;
/**
...
...
@@ -17,35 +18,65 @@ public class Deploy implements Serializable {
/* 主键id */
private
Long
id
;
/* 名称 */
@ExportConfig
(
value
=
"名称"
,
width
=
100
,
showLevel
=
1
)
private
String
name
;
/* 是否支付 */
@ExportConfig
(
value
=
"是否支付"
,
width
=
100
,
showLevel
=
1
)
/**
* 是否开启支付
* 0:关闭; 1:开启
*/
@ExportConfig
(
value
=
"是否开启支付"
,
width
=
100
,
showLevel
=
1
)
private
String
isPay
;
/* 是否三期 */
@ExportConfig
(
value
=
"是否三期"
,
width
=
100
,
showLevel
=
1
)
/**
* 患者类型
* 0:全部; 1:三期; 2:非三期
*/
@ExportConfig
(
value
=
"患者类型"
,
width
=
100
,
showLevel
=
1
)
private
String
isThirdPhase
;
/**
* 付款金额
*/
@ExportConfig
(
value
=
"付款金额"
,
width
=
100
,
showLevel
=
1
)
private
BigDecimal
amount
;
/* 是否检测 */
@ExportConfig
(
value
=
"是否检测"
,
width
=
100
,
showLevel
=
1
)
private
String
isExamination
;
/* 编码 */
@ExportConfig
(
value
=
"编码"
,
width
=
100
,
showLevel
=
1
)
private
String
number
;
/* 所属的账号 */
private
Long
accountsId
;
/* 删除标识 */
private
boolean
delFlag
;
/* 状态 */
private
String
status
;
/* 创建时间 */
private
Date
createTime
;
/* 更新时间 */
private
Date
updateTime
;
/* 备注 */
private
String
description
;
/* 创建人 */
private
Long
createBy
;
/* 更新人 */
private
Long
updateBy
;
...
...
aidea-modules/prescription-module/src/main/java/com/cftech/deploy/service/DeployService.java
View file @
8bab67be
...
...
@@ -18,5 +18,18 @@ public interface DeployService extends GenericService<Deploy> {
* @param openId
* @return
*/
JSONObject
findDeloyEntity
(
String
appId
,
String
openId
);
JSONObject
findDeployEntity
(
String
appId
,
String
openId
);
/**
* 获取系统配置实体
* @return
*/
Deploy
findEntity
();
/**
* 查询是否三期客户
* @param openid
* @return
*/
boolean
byOpenidFindEmployeeIsPhase
(
String
openid
);
}
aidea-modules/prescription-module/src/main/java/com/cftech/deploy/service/impl/DeployServiceImpl.java
View file @
8bab67be
...
...
@@ -31,12 +31,12 @@ public class DeployServiceImpl extends GenericServiceImpl<Deploy> implements Dep
}
@Override
public
JSONObject
findDeloyEntity
(
String
appId
,
String
openId
)
{
public
JSONObject
findDe
p
loyEntity
(
String
appId
,
String
openId
)
{
JSONObject
retObj
=
new
JSONObject
();
Conds
conds
=
new
Conds
();
conds
.
equal
(
"del_flag"
,
Constants
.
DEL_FLAG_0
);
Deploy
deploy
=
this
.
fetchSearchByConds
(
conds
);
if
(
deploy
=
=
null
)
{
if
(
deploy
!
=
null
)
{
retObj
.
put
(
"errorNo"
,
0
);
retObj
.
put
(
"data"
,
deploy
);
}
else
{
...
...
@@ -45,4 +45,19 @@ public class DeployServiceImpl extends GenericServiceImpl<Deploy> implements Dep
}
return
retObj
;
}
@Override
public
Deploy
findEntity
()
{
Conds
conds
=
new
Conds
();
conds
.
equal
(
"del_flag"
,
Constants
.
DEL_FLAG_0
);
Deploy
deploy
=
this
.
fetchSearchByConds
(
conds
);
return
deploy
;
}
@Override
public
boolean
byOpenidFindEmployeeIsPhase
(
String
openid
)
{
Integer
integer
=
deployMapper
.
byOpenidFindEmployeeIsPhase
(
openid
);
return
integer
.
intValue
()
>
0
;
}
}
\ No newline at end of file
aidea-modules/prescription-module/src/main/java/com/cftech/deploy/web/MobileDeployController.java
View file @
8bab67be
...
...
@@ -20,9 +20,9 @@ public class MobileDeployController {
* @param openId
* @return
*/
@RequestMapping
(
value
=
"findDeloyEntity"
,
method
=
{
RequestMethod
.
POST
},
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
public
JSONObject
findDeloyEntity
(
@RequestParam
String
appId
,
@RequestMapping
(
value
=
"findDe
p
loyEntity"
,
method
=
{
RequestMethod
.
POST
},
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
public
JSONObject
findDe
p
loyEntity
(
@RequestParam
String
appId
,
@RequestParam
String
openId
)
{
return
deployService
.
findDeloyEntity
(
appId
,
openId
);
return
deployService
.
findDe
p
loyEntity
(
appId
,
openId
);
}
}
aidea-modules/prescription-module/src/main/java/com/cftech/prescription/dao/PrescriptionMapper.xml
View file @
8bab67be
...
...
@@ -33,6 +33,19 @@
<result
column=
"create_by"
property=
"createBy"
/>
<result
column=
"update_by"
property=
"updateBy"
/>
<result
column=
"openid"
property=
"openid"
/>
<result
column=
"prepay_id"
property=
"prepayId"
/>
<result
column=
"trade_no"
property=
"tradeNo"
/>
<result
column=
"pay_status"
property=
"payStatus"
/>
<result
column=
"pay_amount"
property=
"payAmount"
/>
<result
column=
"cash_fee"
property=
"cashFee"
/>
<result
column=
"pay_time"
property=
"payTime"
/>
<result
column=
"pay_remark"
property=
"payRemark"
/>
<result
column=
"consultNo"
property=
"consultNo"
/>
<result
column=
"refund_id"
property=
"refundId"
/>
<result
column=
"refund_no"
property=
"refundNo"
/>
<result
column=
"refund_case_fee"
property=
"refundCaseFee"
/>
<result
column=
"refund_time"
property=
"refundTime"
/>
<result
column=
"refund_remark"
property=
"refundRemark"
/>
</resultMap>
<sql
id=
"sqlWhere"
>
...
...
@@ -92,7 +105,19 @@
description,
create_by,
update_by,
openid
openid,
prepay_id,
trade_no,
pay_status,
pay_amount,
cash_fee,
pay_time,
pay_remark,
refund_id,
refund_no,
refund_case_fee,
refund_time,
refund_remark
</sql>
<sql
id=
"listColumns"
>
...
...
@@ -125,12 +150,23 @@
t.description,
t.create_by,
t.update_by,
t.openid
t.openid,
t.prepay_id,
t.trade_no,
t.pay_status,
t.pay_amount,
t.cash_fee,
t.pay_time,
t.pay_remark,
t.refund_id,
t.refund_no,
t.refund_case_fee,
t.refund_time,
t.refund_remark
</sql>
<insert
id=
"save"
parameterType=
"com.cftech.prescription.model.Prescription"
useGeneratedKeys=
"true"
keyProperty=
"id"
>
<insert
id=
"save"
parameterType=
"com.cftech.prescription.model.Prescription"
useGeneratedKeys=
"true"
keyProperty=
"id"
>
insert into t_aidea_prescription
(
<include
refid=
"sqlColumns"
/>
...
...
@@ -166,13 +202,25 @@
#{description, jdbcType=VARCHAR},
#{createBy, jdbcType=BIGINT},
#{updateBy, jdbcType=BIGINT},
#{openid, jdbcType=VARCHAR}
#{openid, jdbcType=VARCHAR},
#{prepayId, jdbcType=VARCHAR},
#{tradeNo, jdbcType=VARCHAR},
#{payStatus, jdbcType=VARCHAR},
#{payAmount, jdbcType=DECIMAL},
#{cashFee, jdbcType=DECIMAL},
#{payTime, jdbcType=TIMESTAMP},
#{payRemark, jdbcType=VARCHAR},
#{refundId, jdbcType=VARCHAR},
#{refundNo, jdbcType=VARCHAR},
#{refundCaseFee, jdbcType=DECIMAL},
#{refundTime, jdbcType=TIMESTAMP},
#{refundRemark, jdbcType=VARCHAR}
)
</insert>
<select
id=
"fetchById"
parameterType=
"java.lang.Long"
resultMap=
"resultMap"
>
SELECT
<include
refid=
"
sql
Columns"
/>
<include
refid=
"
list
Columns"
/>
FROM t_aidea_prescription t
WHERE t.id=#{id}
</select>
...
...
@@ -185,8 +233,9 @@
<select
id=
"fetchSearchByPage"
parameterType=
"java.util.Map"
resultMap=
"resultMap"
>
SELECT
<include
refid=
"listColumns"
/>
<include
refid=
"listColumns"
/>
, c.consult_id consultNo
FROM t_aidea_prescription t
LEFT JOIN t_aidea_consult_sheet c ON t.id = c.pre_id AND c.del_flag = '0'
<include
refid=
"sqlWhere"
/>
<if
test=
"sort!=null"
>
ORDER BY ${sort.param} ${sort.type}
</if>
<if
test=
"limit>0"
>
limit #{offset},#{limit}
</if>
...
...
@@ -282,6 +331,42 @@
<if
test=
"openid != null"
>
openid = #{openid, jdbcType=BIGINT},
</if>
<if
test=
"prepayId != null"
>
prepay_Id = #{prepayId, jdbcType=VARCHAR},
</if>
<if
test=
"tradeNo != null"
>
trade_no = #{tradeNo, jdbcType=VARCHAR},
</if>
<if
test=
"payStatus != null"
>
pay_status = #{payStatus, jdbcType=VARCHAR},
</if>
<if
test=
"payAmount != null"
>
pay_amount = #{payAmount, jdbcType=DECIMAL},
</if>
<if
test=
"cashFee != null"
>
cash_fee = #{cashFee, jdbcType=DECIMAL},
</if>
<if
test=
"payTime != null"
>
pay_time = #{payTime, jdbcType=TIMESTAMP},
</if>
<if
test=
"payRemark != null"
>
pay_remark = #{payRemark, jdbcType=VARCHAR},
</if>
<if
test=
"refundId != null"
>
refund_id = #{refundId, jdbcType=VARCHAR},
</if>
<if
test=
"refundNo != null"
>
refund_no = #{refundNo, jdbcType=VARCHAR},
</if>
<if
test=
"refundCaseFee != null"
>
refund_case_fee = #{refundCaseFee, jdbcType=DECIMAL},
</if>
<if
test=
"refundTime != null"
>
refund_time = #{refundTime, jdbcType=TIMESTAMP},
</if>
<if
test=
"refundRemark != null"
>
refund_remark = #{refundRemark, jdbcType=VARCHAR},
</if>
</set>
where id=#{id,jdbcType=BIGINT}
</update>
...
...
@@ -384,7 +469,43 @@
<if
test=
"openid != null"
>
openid = #{openid, jdbcType=BIGINT},
</if>
<if
test=
"prepayId != null"
>
prepay_Id = #{prepayId, jdbcType=VARCHAR},
</if>
<if
test=
"tradeNo != null"
>
trade_no = #{tradeNo, jdbcType=VARCHAR},
</if>
<if
test=
"payStatus != null"
>
pay_status = #{payStatus, jdbcType=VARCHAR},
</if>
<if
test=
"payAmount != null"
>
pay_amount = #{payAmount, jdbcType=DECIMAL},
</if>
<if
test=
"cashFee != null"
>
cash_fee = #{cashFee, jdbcType=DECIMAL},
</if>
<if
test=
"payTime != null"
>
pay_time = #{payTime, jdbcType=TIMESTAMP},
</if>
<if
test=
"payRemark != null"
>
pay_remark = #{payRemark, jdbcType=VARCHAR},
</if>
<if
test=
"refundId != null"
>
refund_id = #{refundId, jdbcType=VARCHAR},
</if>
<if
test=
"refundNo != null"
>
refund_no = #{refundNo, jdbcType=VARCHAR},
</if>
<if
test=
"refundCaseFee != null"
>
refund_case_fee = #{refundCaseFee, jdbcType=DECIMAL},
</if>
<if
test=
"refundTime != null"
>
refund_time = #{refundTime, jdbcType=TIMESTAMP},
</if>
<if
test=
"refundRemark != null"
>
refund_remark = #{refundRemark, jdbcType=VARCHAR},
</if>
</set>
where
number = #{number,jdbcType=VARCHAR}
WHERE
number = #{number,jdbcType=VARCHAR}
</update>
</mapper>
\ No newline at end of file
aidea-modules/prescription-module/src/main/java/com/cftech/prescription/job/SynPrescriptBillJob.java
0 → 100644
View file @
8bab67be
package
com
.
cftech
.
prescription
.
job
;
import
com.cftech.accounts.model.SysJob
;
import
com.cftech.accounts.service.JobService
;
import
com.cftech.core.sql.Conds
;
import
com.cftech.core.util.Constants
;
import
com.cftech.core.util.SpringContextHolder
;
import
com.cftech.core.util.SystemConfig
;
import
com.cftech.prescription.model.Prescription
;
import
com.cftech.prescription.service.PrescriptionService
;
import
lombok.extern.slf4j.Slf4j
;
import
org.quartz.Job
;
import
org.quartz.JobDataMap
;
import
org.quartz.JobExecutionContext
;
import
org.quartz.JobExecutionException
;
import
java.text.SimpleDateFormat
;
import
java.util.List
;
@Slf4j
public
class
SynPrescriptBillJob
implements
Job
{
@Override
public
void
execute
(
JobExecutionContext
context
)
throws
JobExecutionException
{
boolean
isCluster
=
Boolean
.
valueOf
(
SystemConfig
.
p
.
getProperty
(
"quartz.isCluster"
));
if
(!
isCluster
)
{
return
;
}
executePrescript
();
//获得明细数据
JobDataMap
jobInfo
=
context
.
getJobDetail
().
getJobDataMap
();
String
id
=
jobInfo
.
get
(
"uid"
)
==
null
?
""
:
jobInfo
.
getString
(
"uid"
);
//这个也是ID主键
log
.
info
(
"任务ID:"
+
id
);
//执行更新操作
if
(
context
.
getNextFireTime
()
!=
null
)
{
log
.
info
(
"同步更新处方单任务:下次执行时间====="
+
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
).
format
(
context
.
getNextFireTime
())
+
"=============="
);
}
else
{
JobService
jobService
=
SpringContextHolder
.
getBean
(
JobService
.
class
);
SysJob
sysJob
=
new
SysJob
();
sysJob
.
setJobuid
(
id
);
sysJob
.
setStatus
(
"0"
);
jobService
.
updateStatus
(
sysJob
);
log
.
info
(
"同步更新处方单任务,已执行完成!"
);
}
}
private
void
executePrescript
()
{
try
{
PrescriptionService
prescriptionService
=
SpringContextHolder
.
getBean
(
PrescriptionService
.
class
);
Conds
conds
=
new
Conds
();
conds
.
equal
(
"t.del_flag"
,
Constants
.
DEL_FLAG_0
);
conds
.
equal
(
"t.description"
,
"1"
);
//提交状态 为返回
//conds.equal("DATE_FORMAT(t.create_time ,'%Y-%m-%d')", DateUtils.getDate());//获取当天
List
<
Prescription
>
prescriptionList
=
prescriptionService
.
fetchSearchByPage
(
conds
,
null
,
0
,
0
);
for
(
Prescription
prescript:
prescriptionList
)
{
prescriptionService
.
findPreScriptionByOrderId
(
prescript
.
getNumber
());
}
}
catch
(
Exception
e
)
{
log
.
error
(
"同步更新处方单任务执行失败,{}"
+
e
.
getMessage
());
e
.
printStackTrace
();
}
}
}
aidea-modules/prescription-module/src/main/java/com/cftech/prescription/job/SynPrescriptRefundJob.java
0 → 100644
View file @
8bab67be
package
com
.
cftech
.
prescription
.
job
;
import
com.alibaba.fastjson.JSONObject
;
import
com.cftech.accounts.model.MpAccountsEntity
;
import
com.cftech.accounts.model.SysJob
;
import
com.cftech.accounts.service.JobService
;
import
com.cftech.accounts.service.MpAccountsService
;
import
com.cftech.base.codingrule.utils.CodingruleUtils
;
import
com.cftech.core.sql.Conds
;
import
com.cftech.core.util.Constants
;
import
com.cftech.core.util.SpringContextHolder
;
import
com.cftech.core.util.SystemConfig
;
import
com.cftech.prescription.model.Prescription
;
import
com.cftech.prescription.service.PrescriptionService
;
import
com.cftech.wechat.pay.WechatPay
;
import
com.cftech.wechat.pay.WechatPayUtils
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.quartz.Job
;
import
org.quartz.JobDataMap
;
import
org.quartz.JobExecutionContext
;
import
org.quartz.JobExecutionException
;
import
java.text.SimpleDateFormat
;
import
java.util.Date
;
import
java.util.List
;
@Slf4j
public
class
SynPrescriptRefundJob
implements
Job
{
@Override
public
void
execute
(
JobExecutionContext
context
)
throws
JobExecutionException
{
boolean
isCluster
=
Boolean
.
valueOf
(
SystemConfig
.
p
.
getProperty
(
"quartz.isCluster"
));
if
(!
isCluster
)
{
return
;
}
executeRefund
();
//获得明细数据
JobDataMap
jobInfo
=
context
.
getJobDetail
().
getJobDataMap
();
String
id
=
jobInfo
.
get
(
"uid"
)
==
null
?
""
:
jobInfo
.
getString
(
"uid"
);
//这个也是ID主键
log
.
info
(
"任务ID:"
+
id
);
//执行更新操作
if
(
context
.
getNextFireTime
()
!=
null
)
{
log
.
info
(
"同步更新处方单任务:下次执行时间====="
+
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
).
format
(
context
.
getNextFireTime
())
+
"=============="
);
}
else
{
JobService
jobService
=
SpringContextHolder
.
getBean
(
JobService
.
class
);
SysJob
sysJob
=
new
SysJob
();
sysJob
.
setJobuid
(
id
);
sysJob
.
setStatus
(
"0"
);
jobService
.
updateStatus
(
sysJob
);
log
.
info
(
"同步更新处方单任务,已执行完成!"
);
}
}
private
void
executeRefund
()
{
PrescriptionService
prescriptionService
=
SpringContextHolder
.
getBean
(
PrescriptionService
.
class
);
MpAccountsService
accountsService
=
SpringContextHolder
.
getBean
(
MpAccountsService
.
class
);
CodingruleUtils
codingruleUtils
=
SpringContextHolder
.
getBean
(
CodingruleUtils
.
class
);
Conds
conds
=
new
Conds
();
conds
.
equal
(
"t.del_flag"
,
Constants
.
DEL_FLAG_0
);
conds
.
equal
(
"t.pay_status"
,
"1"
);
//已支付
conds
.
in
(
"t.description"
,
new
String
[]{
"0"
,
"2"
});
//0: 临时状态 2:返回状态
MpAccountsEntity
accountsEntity
=
accountsService
.
getMpAccountsAppid
(
SystemConfig
.
p
.
getProperty
(
"WX_MP_SERVER_APPID"
));
List
<
Prescription
>
prescriptionList
=
prescriptionService
.
fetchSearchByPage
(
conds
,
null
,
0
,
0
);
for
(
Prescription
prescript:
prescriptionList
)
{
if
(
StringUtils
.
equals
(
prescript
.
getDocStatus
(),
"0"
))
{
//单据已审核通过
continue
;
}
String
refundNumber
=
codingruleUtils
.
getNumber
(
accountsEntity
.
getId
(),
WechatPay
.
class
.
getName
());
JSONObject
result
=
WechatPayUtils
.
generateRefund
(
prescript
.
getNumber
(),
refundNumber
,
prescript
.
getCashFee
(),
null
);
if
(
result
!=
null
&&
result
.
containsKey
(
"refund_id"
))
{
prescript
.
setPayStatus
(
"2"
);
//已退款
prescript
.
setRefundId
(
result
.
getString
(
"refund_id"
));
prescript
.
setRefundNo
(
result
.
getString
(
"out_refund_no"
));
prescript
.
setRefundCaseFee
(
result
.
getBigDecimal
(
"refund_fee"
));
prescript
.
setRefundTime
(
new
Date
());
prescript
.
setRefundRemark
(
result
.
toString
());
prescriptionService
.
update
(
prescript
);
}
}
}
}
aidea-modules/prescription-module/src/main/java/com/cftech/prescription/model/Prescription.java
View file @
8bab67be
...
...
@@ -99,18 +99,82 @@ public class Prescription implements Serializable {
private
Long
createBy
;
/* 更新人 */
private
Long
updateBy
;
/**
* 付款字段
*/
/* 微信订单id */
private
String
prepayId
;
/* 交易单号 */
private
String
tradeNo
;
/* 支付状态 */
private
String
payStatus
;
/* 付款金额 */
private
BigDecimal
payAmount
;
/* 付款金额现金部分 */
private
BigDecimal
cashFee
;
/* 付款时间 */
private
Date
payTime
;
/* 付款回调描述 */
private
String
payRemark
;
private
String
refundId
;
private
String
refundNo
;
private
BigDecimal
refundCaseFee
;
private
Date
refundTime
;
private
String
refundRemark
;
/**
* 展示字段
*/
private
String
consultNo
;
private
BigDecimal
paymentPrice
;
private
String
paymentDate
;
public
Prescription
()
{
this
.
delFlag
=
false
;
this
.
status
=
"0"
;
}
@Override
public
String
toString
()
{
return
"Prescription{"
+
"id="
+
id
+
", number='"
+
number
+
'\''
+
", openid='"
+
openid
+
'\''
+
", minProgramNo='"
+
minProgramNo
+
'\''
+
", storeId='"
+
storeId
+
'\''
+
", hospitalName='"
+
hospitalName
+
'\''
+
", storeName='"
+
storeName
+
'\''
+
", custName='"
+
custName
+
'\''
+
", weight='"
+
weight
+
'\''
+
", custSex='"
+
custSex
+
'\''
+
", custPhone='"
+
custPhone
+
'\''
+
", symptom='"
+
symptom
+
'\''
+
", syptmFlag='"
+
syptmFlag
+
'\''
+
", doctorName='"
+
doctorName
+
'\''
+
", doctorDpmtName='"
+
doctorDpmtName
+
'\''
+
", docStatus='"
+
docStatus
+
'\''
+
", docResult='"
+
docResult
+
'\''
+
", pharmName='"
+
pharmName
+
'\''
+
", pharmStatus='"
+
pharmStatus
+
'\''
+
", result='"
+
result
+
'\''
+
", guoms='"
+
guoms
+
'\''
+
", age='"
+
age
+
'\''
+
", presUrl='"
+
presUrl
+
'\''
+
", accountsId="
+
accountsId
+
", delFlag="
+
delFlag
+
", status='"
+
status
+
'\''
+
", createTime="
+
createTime
+
", updateTime="
+
updateTime
+
", description='"
+
description
+
'\''
+
", createBy="
+
createBy
+
", updateBy="
+
updateBy
+
", prepayId='"
+
prepayId
+
'\''
+
", tradeNo='"
+
tradeNo
+
'\''
+
", payStatus='"
+
payStatus
+
'\''
+
", payAmount="
+
payAmount
+
", payTime="
+
payTime
+
", payRemark='"
+
payRemark
+
'\''
+
", consultNo='"
+
consultNo
+
'\''
+
'}'
;
}
}
\ No newline at end of file
aidea-modules/prescription-module/src/main/java/com/cftech/prescription/service/PrescriptionService.java
View file @
8bab67be
...
...
@@ -74,4 +74,11 @@ public interface PrescriptionService extends GenericService<Prescription> {
* @throws Exception
*/
Prescription
findPreScriptionByOrderId
(
String
orderId
)
throws
Exception
;
/**
* 退款
* @param id
* @return
*/
boolean
refund
(
String
id
);
}
aidea-modules/prescription-module/src/main/java/com/cftech/prescription/service/impl/PrescriptionServiceImpl.java
View file @
8bab67be
...
...
@@ -12,6 +12,8 @@ import com.cftech.core.sql.Sort;
import
com.cftech.core.util.Constants
;
import
com.cftech.core.util.DateUtils
;
import
com.cftech.core.util.SystemConfig
;
import
com.cftech.deploy.model.Deploy
;
import
com.cftech.deploy.service.DeployService
;
import
com.cftech.predrugs.model.PreDrugs
;
import
com.cftech.predrugs.service.PreDrugsService
;
import
com.cftech.prescription.model.Prescription
;
...
...
@@ -20,7 +22,10 @@ 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
com.cftech.wechat.pay.WechatPay
;
import
com.cftech.wechat.pay.WechatPayUtils
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.jetbrains.annotations.NotNull
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -28,8 +33,8 @@ import org.springframework.beans.factory.annotation.Qualifier;;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.CollectionUtils
;
import
java.math.BigDecimal
;
import
java.util.List
;
import
org.springframework.util.StringUtils
;
import
java.util.*
;
import
java.util.stream.Collectors
;
...
...
@@ -60,11 +65,38 @@ public class PrescriptionServiceImpl extends GenericServiceImpl<Prescription> im
@Autowired
PreDrugsService
preDrugsService
;
@Autowired
DeployService
deployService
;
@Override
public
GenericDao
<
Prescription
>
getGenericMapper
()
{
return
prescriptionMapper
;
}
@Override
public
boolean
refund
(
String
id
)
{
try
{
MpAccountsEntity
accountsEntity
=
accountsService
.
getMpAccountsAppid
(
SystemConfig
.
p
.
getProperty
(
"WX_MP_SERVER_APPID"
));
String
refundNumber
=
codingruleUtils
.
getNumber
(
accountsEntity
.
getId
(),
WechatPay
.
class
.
getName
());
Prescription
prescription
=
this
.
fetchById
(
id
);
JSONObject
result
=
WechatPayUtils
.
generateRefund
(
prescription
.
getNumber
(),
refundNumber
,
prescription
.
getCashFee
(),
null
);
if
(
result
!=
null
&&
result
.
containsKey
(
"refund_id"
))
{
prescription
.
setPayStatus
(
"2"
);
//已退款
prescription
.
setRefundId
(
result
.
getString
(
"refund_id"
));
prescription
.
setRefundNo
(
result
.
getString
(
"out_refund_no"
));
prescription
.
setRefundCaseFee
(
result
.
getBigDecimal
(
"refund_fee"
));
prescription
.
setRefundTime
(
new
Date
());
prescription
.
setRefundRemark
(
result
.
toString
());
this
.
update
(
prescription
);
return
true
;
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
return
false
;
}
return
false
;
}
@Override
public
JSONObject
generatePre
(
String
appId
,
String
openId
)
{
JSONObject
retObj
=
new
JSONObject
();
...
...
@@ -76,7 +108,7 @@ public class PrescriptionServiceImpl extends GenericServiceImpl<Prescription> im
//获取当前用户当天开取的处方单
Conds
conds
=
new
Conds
();
conds
.
equal
(
"t.description"
,
0
);
//临时
订
单
conds
.
equal
(
"t.description"
,
0
);
//临时
处方
单
conds
.
equal
(
"DATE_FORMAT(t.create_time ,'%Y-%m-%d')"
,
DateUtils
.
getDate
());
conds
.
equal
(
"t.openid"
,
openId
);
Prescription
prescription
=
this
.
fetchSearchByConds
(
conds
);
...
...
@@ -86,6 +118,7 @@ public class PrescriptionServiceImpl extends GenericServiceImpl<Prescription> im
data
.
put
(
"productNo"
,
params
.
get
(
"productNumber"
));
data
.
put
(
"unit"
,
params
.
get
(
"unit"
));
data
.
put
(
"storeNo"
,
storeNo
);
data
.
put
(
"prepayId"
,
prescription
.
getPrepayId
());
retObj
.
put
(
"errorNo"
,
0
);
retObj
.
put
(
"data"
,
data
);
...
...
@@ -100,6 +133,18 @@ public class PrescriptionServiceImpl extends GenericServiceImpl<Prescription> im
prescription
.
setDescription
(
"0"
);
if
(
this
.
save
(
prescription
))
{
JSONObject
data
=
new
JSONObject
();
log
.
info
(
"处方单申请订单号:prescription={}"
+
prescription
.
toString
());
JSONObject
result
=
generatePrescriptPayBill
(
prescription
);
if
(
result
!=
null
&&
result
.
containsKey
(
"prepay_id"
))
{
prescription
.
setPrepayId
(
result
.
getString
(
"prepay_id"
));
this
.
update
(
prescription
);
data
.
put
(
"prepayId"
,
result
.
getString
(
"prepay_id"
));
}
else
{
data
.
put
(
"prepayId"
,
null
);
}
data
.
put
(
"prescriptionNo"
,
number
);
data
.
put
(
"productNo"
,
params
.
get
(
"productNumber"
));
data
.
put
(
"unit"
,
params
.
get
(
"unit"
));
...
...
@@ -112,13 +157,38 @@ public class PrescriptionServiceImpl extends GenericServiceImpl<Prescription> im
}
}
catch
(
Exception
e
)
{
retObj
.
put
(
"errorNo"
,
1
);
retObj
.
put
(
"errorMsg"
,
"生成处方单接口失败"
);
retObj
.
put
(
"errorMsg"
,
"生成处方单接口失败
!
"
);
log
.
error
(
"生成处方单接口失败:{}"
,
e
.
getMessage
());
e
.
printStackTrace
();
}
return
retObj
;
}
/**
* 是否生成支付单据
* @param prescription
*/
private
JSONObject
generatePrescriptPayBill
(
Prescription
prescription
)
{
JSONObject
jsonObject
=
null
;
//是否付款实体
Deploy
deploy
=
deployService
.
findEntity
();
//支付 ispay==1 开启支付
if
(
deploy
!=
null
&&
StringUtils
.
equals
(
deploy
.
getIsPay
(),
"1"
)
&&
deploy
.
getAmount
().
compareTo
(
new
BigDecimal
(
0
))
==
1
)
{
if
(
StringUtils
.
equals
(
deploy
.
getIsThirdPhase
(),
"0"
))
{
//全部人员支付
jsonObject
=
WechatPayUtils
.
generatePay
(
prescription
.
getOpenid
(),
prescription
.
getNumber
(),
deploy
.
getAmount
());
}
else
{
//获取人员是否为三期客户
boolean
result
=
deployService
.
byOpenidFindEmployeeIsPhase
(
prescription
.
getOpenid
());
if
(
result
&&
StringUtils
.
equals
(
deploy
.
getIsThirdPhase
(),
"1"
))
{
//三期客户支付
jsonObject
=
WechatPayUtils
.
generatePay
(
prescription
.
getOpenid
(),
prescription
.
getNumber
(),
deploy
.
getAmount
());
}
else
if
(!
result
&&
StringUtils
.
equals
(
deploy
.
getIsThirdPhase
(),
"2"
))
{
//非三期客户支付
jsonObject
=
WechatPayUtils
.
generatePay
(
prescription
.
getOpenid
(),
prescription
.
getNumber
(),
deploy
.
getAmount
());
}
}
}
return
jsonObject
;
}
@Override
public
JSONObject
updatePrescription
(
String
appId
,
String
openId
,
String
number
)
{
JSONObject
retObj
=
new
JSONObject
();
...
...
@@ -167,9 +237,14 @@ public class PrescriptionServiceImpl extends GenericServiceImpl<Prescription> im
retObj
.
put
(
"data"
,
prescription
);
}
else
{
prescription
=
this
.
findPreScriptionByOrderId
(
prescription
.
getNumber
());
if
(
prescription
==
null
)
{
retObj
.
put
(
"errorNo"
,
1
);
retObj
.
put
(
"errorMsg"
,
"暂无单据"
);
}
else
{
retObj
.
put
(
"errorNo"
,
0
);
retObj
.
put
(
"data"
,
prescription
);
}
}
}
catch
(
Exception
e
)
{
retObj
.
put
(
"errorNo"
,
1
);
e
.
printStackTrace
();
...
...
@@ -267,11 +342,14 @@ public class PrescriptionServiceImpl extends GenericServiceImpl<Prescription> im
return
handlePrescription
(
fbusiDetail
,
orderId
);
}
@NotNull
//@NotNull
private
Prescription
handlePrescription
(
FbusiDetail
fbusiDetail
,
String
number
)
throws
Exception
{
if
(
fbusiDetail
==
null
)
{
throw
new
Exception
(
"找不到对应的处方数据(暂无数据)"
);
Prescription
prescription
=
new
Prescription
();
prescription
.
setNumber
(
number
);
//通过编码更新
prescription
.
setDescription
(
"2"
);
//已返回
prescriptionMapper
.
updateByNumber
(
prescription
);
return
null
;
}
//更新
Prescription
prescription
=
new
Prescription
();
...
...
aidea-modules/prescription-module/src/main/java/com/cftech/prescription/web/PrescriptionController.java
View file @
8bab67be
...
...
@@ -8,14 +8,13 @@ import com.cftech.core.scope.OrderType;
import
com.cftech.core.sql.Conds
;
import
com.cftech.core.sql.Sort
;
import
com.cftech.core.util.Constants
;
import
com.cftech.sys.security.PermissionSign
;
import
com.cftech.sys.security.UserUtils
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.shiro.authz.annotation.RequiresPermissions
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.ui.Model
;
import
org.springframework.util.StringUtils
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
org.springframework.web.multipart.MultipartFile
;
...
...
@@ -104,7 +103,10 @@ public class PrescriptionController {
Long
accountsId
=
UserUtils
.
getmpaccounts
(
request
);
Conds
conds
=
new
Conds
();
conds
.
equal
(
"t.del_flag"
,
Constants
.
DEL_FLAG_0
);
conds
.
equal
(
"t.description"
,
"2"
);
conds
.
in
(
"t.description"
,
new
String
[]
{
"1"
,
"2"
});
//1、提交状态 2、返回状态
if
(
StringUtils
.
isNotBlank
(
prescription
.
getNumber
()))
{
conds
.
like
(
"t.number"
,
prescription
.
getNumber
());
}
Sort
sort
=
new
Sort
(
"t.create_time"
,
OrderType
.
DESC
);
List
<
Prescription
>
list
=
prescriptionService
.
fetchSearchByPage
(
conds
,
sort
,
iDisplayStart
,
iDisplayLength
);
...
...
@@ -131,6 +133,24 @@ public class PrescriptionController {
return
rtnJosn
;
}
//删除数据
@RequiresPermissions
(
value
=
PRESCRIPTION_EDIT
)
@RequestMapping
(
"/refund"
)
@ResponseBody
public
JSONObject
refund
(
String
id
)
{
JSONObject
rtnJosn
=
new
JSONObject
();
try
{
if
(
prescriptionService
.
refund
(
id
))
{
rtnJosn
.
put
(
"errorNo"
,
0
);
}
else
{
rtnJosn
.
put
(
"errorNo"
,
1
);
}
}
catch
(
Exception
e
)
{
rtnJosn
.
put
(
"errorNo"
,
1
);
}
return
rtnJosn
;
}
@RequestMapping
(
"/exportExcel"
)
@RequiresPermissions
(
value
=
PRESCRIPTION_VIEW
)
public
void
exportExcel
(
HttpServletRequest
request
,
HttpServletResponse
response
)
{
...
...
aidea-modules/product-module/pom.xml
View file @
8bab67be
...
...
@@ -18,17 +18,17 @@
</dependency>
<dependency>
<groupId>
com.cftech
</groupId>
<artifactId>
product-
classify
-module
</artifactId>
<artifactId>
product-
detail
-module
</artifactId>
<version>
1.0-SNAPSHOT
</version>
</dependency>
<dependency>
<groupId>
com.cftech
</groupId>
<artifactId>
product-
into-wareroom
-module
</artifactId>
<artifactId>
product-
classify
-module
</artifactId>
<version>
1.0-SNAPSHOT
</version>
</dependency>
<dependency>
<groupId>
com.cftech
</groupId>
<artifactId>
product-
detail
-module
</artifactId>
<artifactId>
product-
into-wareroom
-module
</artifactId>
<version>
1.0-SNAPSHOT
</version>
</dependency>
<dependency>
...
...
@@ -39,5 +39,4 @@
</dependency>
</dependencies>
</project>
\ No newline at end of file
aidea-modules/product-module/src/main/java/com/cftech/product/service/impl/ProductServiceImpl.java
View file @
8bab67be
...
...
@@ -51,10 +51,10 @@ public class ProductServiceImpl extends GenericServiceImpl<Product> implements P
private
ProductMapper
productMapper
;
@Autowired
private
Product
IntoWareroomMapper
productIntoWareroom
Mapper
;
private
Product
DetailMapper
productDetail
Mapper
;
@Autowired
private
Product
DetailMapper
productDetail
Mapper
;
private
Product
IntoWareroomMapper
productIntoWareroom
Mapper
;
@Autowired
private
CodingruleUtils
codingruleUtils
;
...
...
@@ -143,7 +143,6 @@ public class ProductServiceImpl extends GenericServiceImpl<Product> implements P
System
.
out
.
println
(
Product
.
class
.
getName
());
// 2、 生成入库单
ProductIntoWareroom
productIntoWareroom
=
new
ProductIntoWareroom
();
productIntoWareroom
.
setAccountsId
(
product
.
getAccountsId
());
...
...
@@ -175,8 +174,6 @@ public class ProductServiceImpl extends GenericServiceImpl<Product> implements P
productDetailMapper
.
save
(
productDetail
);
}
}
return
true
;
}
...
...
aidea-modules/reportform-module-web/src/main/webapp/WEB-INF/views/report/reportlist.html
View file @
8bab67be
...
...
@@ -151,19 +151,16 @@
<th
style=
"width: 50px"
>
大区
</th>
<th
style=
"width: 50px"
>
省份
</th>
<th
style=
"width: 50px"
>
城市
</th>
<th
style=
"width: 65px"
>
医院
</th>
<th
style=
"width: 65px"
>
扫码
医院
</th>
<th
style=
"width: 60px"
>
销售代表
</th>
<th
style=
"width: 50px"
>
科室
</th>
<th
style=
"width: 60px"
>
医生姓名
</th>
<th
style=
"width: 60px"
>
医生职称
</th>
<th
style=
"width: 50px"
>
性别
</th>
<th
style=
"width: 80px"
>
医生手机号
</th>
<th
style=
"width: 65px"
>
入组医院
</th>
<th
style=
"width: 60px"
>
处方医院
</th>
<th
style=
"width: 60px"
>
处方医生
</th>
<th
style=
"width: 80px"
>
咨询单编码
</th>
<th
style=
"width: 120px"
>
需求清单编码
</th>
<th
style=
"width: 60px"
>
用户姓名
</th>
<th
style=
"width: 80px"
>
用户手机号
</th>
<th
style=
"width: 80px"
>
患者类型
</th>
<th
style=
"width: 60px"
>
产品名称
</th>
<th
style=
"width: 60px"
>
购买数量
</th>
<th
style=
"width: 60px"
>
付款时间
</th>
...
...
@@ -285,18 +282,6 @@
{
"mData"
:
"department"
},
{
"mData"
:
"doctorName"
},
{
"mData"
:
"doctorTitle"
},
{
"mData"
:
"sex"
},
{
"mData"
:
"doctorPhone"
},
{
"mData"
:
"cfHospital"
},
...
...
@@ -315,6 +300,9 @@
{
"mData"
:
"phone"
},
{
"mData"
:
"isThree"
},
{
"mData"
:
"productName"
},
...
...
@@ -337,7 +325,7 @@
},
{
"aTargets"
:
[
1
9
],
"aTargets"
:
[
1
6
],
"mData"
:
"fkTime"
,
"mRender"
:
function
(
a
,
b
,
c
,
d
)
{
if
(
a
==
''
||
a
==
null
)
{
...
...
@@ -348,7 +336,7 @@
}
},
{
"aTargets"
:
[
20
],
"aTargets"
:
[
17
],
"mData"
:
"fhTime"
,
"mRender"
:
function
(
a
,
b
,
c
,
d
)
{
if
(
a
==
''
||
a
==
null
)
{
...
...
@@ -359,7 +347,7 @@
}
},
{
"aTargets"
:
[
21
],
"aTargets"
:
[
18
],
"mData"
:
"sjTime"
,
"mRender"
:
function
(
a
,
b
,
c
,
d
)
{
if
(
a
==
''
||
a
==
null
)
{
...
...
aidea-modules/reportform-module/src/main/java/com/cftech/report/dao/ReportMapper.xml
View file @
8bab67be
...
...
@@ -20,6 +20,7 @@
<result
column=
"order_number"
property=
"orderNumber"
/>
<result
column=
"user_name"
property=
"userName"
/>
<result
column=
"phone"
property=
"phone"
/>
<result
column=
"is_three"
property=
"isThree"
/>
<result
column=
"product_name"
property=
"productName"
/>
<result
column=
"drugs_num"
property=
"drugsNum"
/>
<result
column=
"fk_time"
property=
"fkTime"
/>
...
...
@@ -49,6 +50,8 @@
<result
column=
"fhTime"
property=
"fhTime"
/>
<result
column=
"sjTime"
property=
"sjTime"
/>
<result
column=
"openId"
property=
"openId"
/>
<result
column=
"department"
property=
"department"
/>
<result
column=
"isThree"
property=
"isThree"
/>
</resultMap>
<resultMap
id=
"resultMapCodeInfo"
type=
"com.cftech.report.model.ReportCode"
>
...
...
@@ -114,6 +117,7 @@
order_number,
user_name,
phone,
is_three,
product_name,
drugs_num,
fk_time,
...
...
@@ -155,6 +159,7 @@
#{orderNumber, jdbcType=VARCHAR},
#{userName, jdbcType=VARCHAR},
#{phone, jdbcType=VARCHAR},
#{isThree, jdbcType=VARCHAR},
#{productName, jdbcType=VARCHAR},
#{drugsNum, jdbcType=VARCHAR},
#{fkTime , jdbcType=TIMESTAMP},
...
...
@@ -247,6 +252,9 @@
<if
test=
"phone != null"
>
phone = #{phone, jdbcType=VARCHAR},
</if>
<if
test=
"isThree != null"
>
is_three = #{isThree, jdbcType=VARCHAR},
</if>
<if
test=
"productName != null"
>
product_name = #{productName, jdbcType=VARCHAR},
</if>
...
...
@@ -292,7 +300,7 @@
</update>
<!--查询报表人员信息-->
<select
id=
"selectReportPeopleInfo"
resultMap=
"resultMapPeopleInfo"
parameterType=
"java.util.Map
"
>
<select
id=
"selectReportPeopleInfo"
parameterType=
"java.util.Map"
resultMap=
"resultMapPeopleInfo
"
>
SELECT
product.common_name productName,
detail.drugs_num drugsNum,
...
...
@@ -305,15 +313,17 @@
ord.pay_time fkTime,
waybill.send_express_date fhTime,
waybill.accept_express_date sjTime,
ord.openid openId
ord.openid openId,
org.org_name department,
memb.status isThree
FROM
t_order_details detail
LEFT JOIN t_aidea_product product ON product.id = detail.drugs_id AND product.del_flag = 0
LEFT JOIN t_order ord ON ord.id = detail.order_id
LEFT JOIN t_aidea_consult_sheet consult ON consult.order_id = ord.id
LEFT JOIN t_
qyuser qyuser ON qyuser.id = consult.past_records
LEFT JOIN
t_orgunit org1 ON org1.id = consult.allergy
LEFT JOIN t_
aidea_waybill waybill ON waybill.order_id = org1.id
LEFT JOIN t_
aidea_waybill waybill ON waybill.order_id = ord.id
LEFT JOIN
wx_mp_member memb ON memb.open_id = consult.open_id AND memb.del_flag = 0
LEFT JOIN t_
orgunit org ON memb.storeid = org.id AND org.del_flag = 0 AND org.is_three_phase = 1
<include
refid=
"sqlWhere"
/>
<if
test=
"sort!=null"
>
ORDER BY ${sort.param} ${sort.type}
</if>
</select>
...
...
aidea-modules/reportform-module/src/main/java/com/cftech/report/job/ReportJob.java
View file @
8bab67be
...
...
@@ -45,8 +45,7 @@ public class ReportJob implements Job {
private
static
String
REGION_LONG_ID
=
SystemConfig
.
p
.
getProperty
(
"REGION_LONG_ID"
);
@Override
public
void
execute
(
JobExecutionContext
context
)
throws
JobExecutionException
{
boolean
isCluster
=
Boolean
.
valueOf
(
SystemConfig
.
p
.
getProperty
(
"quartz.isCluster"
));
public
void
execute
(
JobExecutionContext
context
)
throws
JobExecutionException
{
boolean
isCluster
=
Boolean
.
valueOf
(
SystemConfig
.
p
.
getProperty
(
"quartz.isCluster"
));
if
(!
isCluster
)
{
return
;
}
...
...
@@ -79,6 +78,8 @@ public class ReportJob implements Job {
report
.
setConsultNumber
(
reportPeopleInfo
.
getConsultNumber
());
report
.
setUserName
(
reportPeopleInfo
.
getUserName
());
report
.
setPhone
(
reportPeopleInfo
.
getPhone
());
report
.
setDepartment
(
reportPeopleInfo
.
getDepartment
());
report
.
setIsThree
(
StringUtils
.
equals
(
reportPeopleInfo
.
getIsThree
(),
"1"
)
?
"三期"
:
""
);
report
.
setCfDoctor
(
reportPeopleInfo
.
getCfDoctor
());
report
.
setCfHospital
(
reportPeopleInfo
.
getCfHospital
());
report
.
setFkTime
(
reportPeopleInfo
.
getFkTime
());
...
...
@@ -178,9 +179,9 @@ public class ReportJob implements Job {
report
.
setSalesRepresent
(
sb
.
toString
());
}
break
;
case
8
:
//科室
report
.
setDepartment
(
item
.
getOrgName
());
break
;
//
case 8://科室
//
report.setDepartment(item.getOrgName());
//
break;
}
});
}
...
...
aidea-modules/reportform-module/src/main/java/com/cftech/report/model/Report.java
View file @
8bab67be
...
...
@@ -26,27 +26,15 @@ public class Report implements Serializable {
/* 城市 */
@ExportConfig
(
value
=
"城市"
,
width
=
100
,
showLevel
=
1
)
private
String
city
;
/* 医院 */
@ExportConfig
(
value
=
"扫码医院"
,
width
=
100
,
showLevel
=
1
)
private
String
hospital
;
/* 销售代表 */
@ExportConfig
(
value
=
"销售代表"
,
width
=
100
,
showLevel
=
1
)
private
String
salesRepresent
;
/* 医院 */
@ExportConfig
(
value
=
"医院"
,
width
=
100
,
showLevel
=
1
)
private
String
hospital
;
/* 科室 */
@ExportConfig
(
value
=
"
科室
"
,
width
=
100
,
showLevel
=
1
)
@ExportConfig
(
value
=
"
入组医院
"
,
width
=
100
,
showLevel
=
1
)
private
String
department
;
/* 医生姓名 */
@ExportConfig
(
value
=
"医生姓名"
,
width
=
100
,
showLevel
=
1
)
private
String
doctorName
;
/* 医生职称 */
@ExportConfig
(
value
=
"医生职称"
,
width
=
100
,
showLevel
=
1
)
private
String
doctorTitle
;
/* 性别 */
@ExportConfig
(
value
=
"性别"
,
width
=
100
,
showLevel
=
1
)
private
String
sex
;
/* 医生手机号码 */
@ExportConfig
(
value
=
"医生手机号码"
,
width
=
100
,
showLevel
=
1
)
private
String
doctorPhone
;
/* 处方医院 */
@ExportConfig
(
value
=
"处方医院"
,
width
=
100
,
showLevel
=
1
)
private
String
cfHospital
;
...
...
@@ -66,6 +54,9 @@ public class Report implements Serializable {
@ExportConfig
(
value
=
"用户手机号码"
,
width
=
100
,
showLevel
=
1
)
private
String
phone
;
/* 产品名称 */
@ExportConfig
(
value
=
"患者类型"
,
width
=
100
,
showLevel
=
1
)
private
String
isThree
;
/* 产品名称 */
@ExportConfig
(
value
=
"产品名称"
,
width
=
100
,
showLevel
=
1
)
private
String
productName
;
/* 购买数量 */
...
...
@@ -80,6 +71,7 @@ public class Report implements Serializable {
/* 收件时间 */
@ExportConfig
(
value
=
"收件时间"
,
width
=
100
,
showLevel
=
1
,
dateFormat
=
"yyyy-MM-dd HH:mm"
)
private
Date
sjTime
;
/* 所属的账号 */
private
Long
accountsId
;
/* 删除标识 */
...
...
@@ -101,6 +93,16 @@ public class Report implements Serializable {
*/
private
String
openId
;
/* 医生姓名 */
private
String
doctorName
;
/* 医生职称 */
private
String
doctorTitle
;
/* 性别 */
private
String
sex
;
/* 医生手机号码 */
private
String
doctorPhone
;
public
Report
()
{
this
.
delFlag
=
false
;
this
.
status
=
"0"
;
...
...
aidea-modules/reportform-module/src/main/java/com/cftech/report/model/ReportPeopleInfo.java
View file @
8bab67be
...
...
@@ -60,4 +60,14 @@ public class ReportPeopleInfo {
*/
private
String
openId
;
/**
* 入组医院
*/
private
String
department
;
/**
* 1:三期患者 反之不是
*/
private
String
isThree
;
}
aidea-modules/reportform-module/src/main/java/com/cftech/report/web/ReportController.java
View file @
8bab67be
...
...
@@ -105,7 +105,7 @@ public class ReportController {
Conds
conds
=
new
Conds
();
conds
.
equal
(
"del_flag"
,
Constants
.
DEL_FLAG_0
);
//conds.equal("accounts_id", accountsId);
Sort
sort
=
new
Sort
(
"
create_time
"
,
OrderType
.
DESC
);
Sort
sort
=
new
Sort
(
"
order_number
"
,
OrderType
.
DESC
);
if
(!
StringUtils
.
isEmpty
(
report
.
getRegion
())){
conds
.
like
(
"region"
,
report
.
getRegion
());
...
...
aidea-modules/wechat-pay-module/pom.xml
0 → 100644
View file @
8bab67be
<?xml version="1.0" encoding="UTF-8"?>
<project
xmlns=
"http://maven.apache.org/POM/4.0.0"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
>
<parent>
<artifactId>
aidea-modules
</artifactId>
<groupId>
com.cftech
</groupId>
<version>
1.0-SNAPSHOT
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<artifactId>
wechat-pay-module
</artifactId>
</project>
\ No newline at end of file
aidea-modules/
order-module/src/main/java/com/cftech/order
/pay/HashKit.java
→
aidea-modules/
wechat-pay-module/src/main/java/com.cftech.wechat
/pay/HashKit.java
View file @
8bab67be
package
com
.
cftech
.
order
.
pay
;
package
com
.
cftech
.
wechat
.
pay
;
import
java.security.MessageDigest
;
import
java.security.SecureRandom
;
...
...
aidea-modules/
order-module/src/main/java/com/cftech/order
/pay/Md5Utils.java
→
aidea-modules/
wechat-pay-module/src/main/java/com.cftech.wechat
/pay/Md5Utils.java
View file @
8bab67be
package
com
.
cftech
.
order
.
pay
;
package
com
.
cftech
.
wechat
.
pay
;
import
java.security.MessageDigest
;
...
...
aidea-modules/
order-module/src/main/java/com/cftech/order
/pay/WechatPay.java
→
aidea-modules/
wechat-pay-module/src/main/java/com.cftech.wechat
/pay/WechatPay.java
View file @
8bab67be
package
com
.
cftech
.
order
.
pay
;
package
com
.
cftech
.
wechat
.
pay
;
import
lombok.Data
;
...
...
aidea-modules/
order-module/src/main/java/com/cftech/order
/pay/WechatPayUtils.java
→
aidea-modules/
wechat-pay-module/src/main/java/com.cftech.wechat
/pay/WechatPayUtils.java
View file @
8bab67be
This diff is collapsed.
Click to expand it.
aidea-modules/wechat-pay-module/src/main/java/com.cftech.wechat/pay/WechatRefundDescryptUtils.java
0 → 100644
View file @
8bab67be
package
com
.
cftech
.
wechat
.
pay
;
import
lombok.extern.slf4j.Slf4j
;
import
org.dom4j.Document
;
import
org.dom4j.DocumentHelper
;
import
org.dom4j.Element
;
import
javax.crypto.Cipher
;
import
javax.crypto.NoSuchPaddingException
;
import
javax.crypto.spec.SecretKeySpec
;
import
java.security.InvalidKeyException
;
import
java.security.MessageDigest
;
import
java.security.NoSuchAlgorithmException
;
import
java.security.Security
;
import
java.util.Base64
;
/**
* 暂时废弃
*/
@Slf4j
public
class
WechatRefundDescryptUtils
{
private
static
final
String
ALGORITHM
=
"AES"
;
/**
* 加解密算法/工作模式/填充方式
*/
private
static
final
String
ALGORITHM_MODE_PADDING
=
"AES/ECB/PKCS7Padding"
;
// public static String decryptData(String base64Data, String lowMad5Key) throws Exception {
// SecretKeySpec key = new SecretKeySpec(lowMad5Key.getBytes(), ALGORITHM);
// Security.addProvider(new BouncyCastleProvider());
// Cipher cipher = Cipher.getInstance(ALGORITHM_MODE_PADDING);
// cipher.init(Cipher.DECRYPT_MODE, key);
// Base64.Decoder decoder = Base64.getDecoder();
// String newData = new String(decoder.decode(base64Data), "ISO-8859-1");
// return new String(cipher.doFinal(newData.getBytes("ISO-8859-1")), "utf-8");
// }
//
// public static String MD5(String data) throws Exception {
// MessageDigest md = MessageDigest.getInstance("MD5");
// byte[] array = md.digest(data.getBytes("UTF-8"));
// StringBuilder sb = new StringBuilder();
// byte[] var4 = array;
// int var5 = array.length;
// for (int var6 = 0; var6 < var5; ++var6) {
// byte item = var4[var6];
// sb.append(Integer.toHexString(item & 255 | 256).substring(1, 3));
// }
// return sb.toString().toUpperCase();
// }
/**
* req_info解密后的示例:
* <root>
* <out_refund_no><![CDATA[131811191610442717309]]></out_refund_no>
* <out_trade_no><![CDATA[71106718111915575302817]]></out_trade_no>
* <refund_account><![CDATA[REFUND_SOURCE_RECHARGE_FUNDS]]></refund_account>
* <refund_fee><![CDATA[3960]]></refund_fee>
* <refund_id><![CDATA[50000408942018111907145868882]]></refund_id>
* <refund_recv_accout><![CDATA[支付用户零钱]]></refund_recv_accout>
* <refund_request_source><![CDATA[API]]></refund_request_source>
* <refund_status><![CDATA[SUCCESS]]></refund_status>
* <settlement_refund_fee><![CDATA[3960]]></settlement_refund_fee>
* <settlement_total_fee><![CDATA[3960]]></settlement_total_fee>
* <success_time><![CDATA[2018-11-19 16:24:13]]></success_time>
* <total_fee><![CDATA[3960]]></total_fee>
* <transaction_id><![CDATA[4200000215201811190261405420]]></transaction_id>
* </root>
* @param args
* @throws Exception
*
* Base64.Decoder decoder = Base64.getDecoder();
* String newData = new String(decoder.decode(base64Data), "ISO-8859-1");
* return new String(cipher.doFinal(newData.getBytes("ISO-8859-1")), "utf-8")
* ————————————————
* 版权声明:本文为CSDN博主「sugarit」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
* 原文链接:https://blog.csdn.net/Charles_lxx/article/details/105427815
*/
//示例:不可以直接用,已经把KEY值修改,需要根据实际进行操作
public
static
void
main
(
String
[]
args
)
throws
Exception
{
String
reqInfo
=
"cbRfjwOKrLQCOjAU0v1Ac6cDJQhK6349ngVplZHLe010obV59BJ75z05eUzG+Um3Zk9WxNO6jtk60bBDkMLmf4dZk41wSbyx/GiNNcRp3g0GdUMjGjhlyJgMAKiLbmVwcPEQnOoikcCbwGd0VmOdWcTk67kDlE4ssYW6pgBXp5bSBVotuar2Wxi0z20HGgsz7dcIVELP9+JfGwuiVV9xkhO8sPbEO4SIO2qhkRQ0QzbDYgn9gU1Iprzv6wGxFh+Bm/lJWuiBGwhFCT2fq1xEF1nDPEyW3LOWq4daCegXpvTXoXLZp9Xp6zcdxiDCsLgj8yj+q7ZNmVNt1vTUR94ZQAI1UAtCqK+1dI89DZdbifU7o0fVm/9WQqjcOIo4WemUJU7WfCsyHXBVvx8lZezoQc5ZGZOqTEZJCVKV6OF5iqvlNnZJ1byPg7BfHZnmbIjdETFMIOkq3oPicshnNlVZ9g08DvesDZzG/KJzI8NBMFfXNMjSJyuemsZ/0jFJRtKDOWoCQetWox+mORa5BPrMwvibTLkPZL0okvnyrJgFwGtE4BFTdnN/+cfuUISXMTbeZv6UjRJwD9y8B+wi4wTSUC1QXjlZEkV+RgBNnJD/n13NWUK1nlrwev/RHLsgjoMSYnF0mYec8g1BCyW0POcp4iEDaRVMrjQnACyyeMncSxA+KawdoFEOqMuAITv3B0Q9iZOTpI7yqnpquWiphXMuKovJgLp4vnPqerMMthTeaQ/rfVVO/U6Z4K/heTZKT2Y0y7kQP2GS+r/N5Qvu+J0sihJ8opoZ0AJ7ktwGrzcmkIq/DCCtAfgdAT8x3rtSXA4f8pb7WqFssdGRqgzMZR1jlcz3LD5+Du+BWK5QmyCeynywd9b6s7oYdyU0aI75LrT5EBOtEHAMGi2rmwb1X2wlEd3g4gCr2l1EEA4dUTdhsqynG0w64VHWJkvJgTOdmzMPWYksLu463qcy6dN44WuNBG0aw7uEQQIUXeRhDEwCBQVmzXNLzwQ6wHv6O9j7yvkvZll3SuGw7bbsfdSdAfQkJkLCj/MHuEKUauiV0mQS/2M="
;
String
mchkey
=
"4bcd5546d65f4d88bf1ba549436e0e9f"
;
//String ab = decryptData(a, MD5("4bcd5546d65f4d88bf1ba549436e0e9f").toLowerCase());
String
result
=
""
;
Base64
.
Decoder
decoder
=
Base64
.
getDecoder
();
byte
[]
base64ByteArr
=
decoder
.
decode
(
reqInfo
);
String
key
=
getMD5
(
mchkey
).
toLowerCase
();
SecretKeySpec
secretKeySpec
=
new
SecretKeySpec
(
key
.
getBytes
(),
"AES"
);
//Security.addProvider(new BouncyCastleProvider());
try
{
Cipher
cipher
=
Cipher
.
getInstance
(
"AES/ECB/PKCS7Padding"
);
cipher
.
init
(
Cipher
.
DECRYPT_MODE
,
secretKeySpec
);
result
=
new
String
(
cipher
.
doFinal
(
base64ByteArr
));
System
.
out
.
println
(
"解密结果:{}"
+
result
);
}
catch
(
NoSuchAlgorithmException
e
)
{
e
.
printStackTrace
();
}
catch
(
NoSuchPaddingException
e
)
{
e
.
printStackTrace
();
}
catch
(
InvalidKeyException
e
)
{
e
.
printStackTrace
();
}
Document
doc
=
DocumentHelper
.
parseText
(
result
);
Element
rootElt
=
doc
.
getRootElement
();
String
result_code
=
rootElt
.
elementTextTrim
(
"out_trade_no"
);
String
return_code
=
rootElt
.
elementTextTrim
(
"out_refund_no"
);
System
.
out
.
println
(
result
);
System
.
out
.
println
(
result_code
+
"====="
+
return_code
);
}
public
static
String
getMD5
(
String
str
)
{
try
{
MessageDigest
md
=
MessageDigest
.
getInstance
(
"MD5"
);
String
result
=
MD5
(
str
,
md
);
return
result
;
}
catch
(
NoSuchAlgorithmException
e
)
{
e
.
printStackTrace
();
return
""
;
}
}
public
static
String
MD5
(
String
strSrc
,
MessageDigest
md
)
{
byte
[]
bt
=
strSrc
.
getBytes
();
md
.
update
(
bt
);
String
strDes
=
bytes2Hex
(
md
.
digest
());
return
strDes
;
}
public
static
String
bytes2Hex
(
byte
[]
bts
)
{
StringBuffer
des
=
new
StringBuffer
();
String
tmp
=
null
;
for
(
int
i
=
0
;
i
<
bts
.
length
;
i
++)
{
tmp
=
(
Integer
.
toHexString
(
bts
[
i
]
&
0xFF
));
if
(
tmp
.
length
()
==
1
)
{
des
.
append
(
"0"
);
}
des
.
append
(
tmp
);
}
return
des
.
toString
();
}
}
cftech-common-web/src/main/resources/common-test.properties
View file @
8bab67be
...
...
@@ -80,13 +80,13 @@ LOG_URL=http://www.michang-tech.com.cn:6989/log/addlog
#\u6821\u9A8C\u5151\u6362\u5BC6\u7801KEY
MEMBER_PASSWORD_KEY
=
DONGCHANGINT9527;
list.refreshtoken
=
true
jwt.domain
=
localhost
jwt.domain
=
pd.shxrtech.com
#\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD
jwt.duration
=
86400000
#\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u03AAtrue
security.secure
=
false
#\u662F\u5426\u96C6\u7FA4 master\u4E3Atrue
quartz.isCluster
=
fals
e
quartz.isCluster
=
tru
e
#\u987A\u4E30\u7269\u6D41\u914D\u7F6E\u4FE1\u606F\u53C2\u6570
#\u987A\u4E30\u5BA2\u6237\u7F16\u7801
...
...
@@ -128,8 +128,18 @@ mch.mch_id=1604243615
mch.spbill_id
=
47.103.35.182
#\u5546\u6237\u53F7\u5BC6\u94A5
mch.secret_key
=
4bcd5546d65f4d88bf1ba549436e0e9f
#\u5546\u6237\u53F7\u652F\u4ED8\u63A5\u53E3
mch.pay_url
=
https://api.mch.weixin.qq.com/pay/unifiedorder
#\u5546\u6237\u53F7\u9000\u6B3E\u63A5\u53E3
msh.refund_url
=
https://api.mch.weixin.qq.com/secapi/pay/refund
#\u5546\u6237\u53F7\u4ED8\u6B3E\u6210\u529F\u56DE\u8C03url
mch.notify_url
=
https://pd.shxrtech.com/aidea/mobile/auth/order/wechatCallback
mch.notify_url
=
https://pd.shxrtech.com/aidea/mobile/auth/order/wechatPayCallback
#\u5546\u6237\u53F7\u9000\u6B3E\u6210\u529F\u56DE\u8C03url
mch.refund_notify_url
=
https://pd.shxrtech.com/aidea/mobile/auth/order/wechatRefundCallback
#\u8BC1\u4E66\u5E8F\u5217\u53F7
mch.queue_no
=
4CB908135B122F41E127F6B60E41349E43A725C7
#\u8BC1\u4E66\u8DEF\u5F84
mch.cert_path
=
/mydata/wechatSdk/apiclient_cert.p12
#\u4ED8\u6B3E\u754C\u9762\u6807\u9898
mch.title
=
\u
8BFA
\u
5EB7
\u5927\u
836F
\u
623F
\u
54A8
\u
8BE2
\u
5E73
\u
53F0
...
...
cftech-common-web/src/main/resources/common.properties
View file @
8bab67be
...
...
@@ -129,8 +129,18 @@ mch.mch_id=1604243615
mch.spbill_id
=
58.220.99.125
#\u5546\u6237\u53F7\u5BC6\u94A5
mch.secret_key
=
4bcd5546d65f4d88bf1ba549436e0e9f
#\u5546\u6237\u53F7\u652F\u4ED8\u63A5\u53E3
mch.pay_url
=
https://api.mch.weixin.qq.com/pay/unifiedorder
#\u5546\u6237\u53F7\u9000\u6B3E\u63A5\u53E3
msh.refund_url
=
https://api.mch.weixin.qq.com/secapi/pay/refund
#\u5546\u6237\u53F7\u4ED8\u6B3E\u6210\u529F\u56DE\u8C03url
mch.notify_url
=
https://pe.aidea.com.cn/aidea/mobile/auth/order/wechatCallback
mch.notify_url
=
https://pd.shxrtech.com/aidea/mobile/auth/order/wechatPayCallback
#\u5546\u6237\u53F7\u9000\u6B3E\u6210\u529F\u56DE\u8C03url
mch.refund_notify_url
=
https://pd.shxrtech.com/aidea/mobile/auth/order/wechatRefundCallback
#\u8BC1\u4E66\u5E8F\u5217\u53F7
mch.queue_no
=
4CB908135B122F41E127F6B60E41349E43A725C7
#\u8BC1\u4E66\u8DEF\u5F84
mch.cert_path
=
/mydata/wechatSdk/apiclient_cert.p12
#\u4ED8\u6B3E\u754C\u9762\u6807\u9898
mch.title
=
\u
8BFA
\u
5EB7
\u5927\u
836F
\u
623F
\u
54A8
\u
8BE2
\u
5E73
\u
53F0
...
...
cms-modules/cms-core-module/src/main/java/com/cftech/cms/cfarticle/service/impl/CfarticleServiceImpl.java
View file @
8bab67be
...
...
@@ -41,6 +41,7 @@ public class CfarticleServiceImpl extends GenericServiceImpl<Cfarticle> implemen
private
CfarticleMapper
cfarticleMapper
;
@Autowired
private
MpAccountsService
mpAccountsService
;
@Override
public
GenericDao
<
Cfarticle
>
getGenericMapper
()
{
return
cfarticleMapper
;
...
...
@@ -91,9 +92,9 @@ public class CfarticleServiceImpl extends GenericServiceImpl<Cfarticle> implemen
long
recommended
=
jsonObject
.
getLong
(
"recommended"
);
long
whetherBanner
=
jsonObject
.
getLong
(
"whetherBanner"
);
long
article
=
jsonObject
.
getLong
(
"article"
);
SimpleDateFormat
format
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
SimpleDateFormat
format
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
String
updateTime
=
format
.
format
(
new
Date
());
Integer
integer
=
cfarticleMapper
.
updatecom
(
id
,
recommended
,
whetherBanner
,
article
,
updateTime
);
Integer
integer
=
cfarticleMapper
.
updatecom
(
id
,
recommended
,
whetherBanner
,
article
,
updateTime
);
if
(
integer
>
0
)
{
rtnJson
.
put
(
"errorNo"
,
"0"
);
rtnJson
.
put
(
"errorMsg"
,
"修改成功"
);
...
...
@@ -105,12 +106,12 @@ public class CfarticleServiceImpl extends GenericServiceImpl<Cfarticle> implemen
}
@Override
public
JSONObject
recommended
(
Long
id
,
String
appId
)
{
public
JSONObject
recommended
(
Long
id
,
String
appId
)
{
JSONObject
rtnJson
=
new
JSONObject
();
try
{
MpAccountsEntity
mpAccountsAppid
=
mpAccountsService
.
getMpAccountsAppid
(
appId
);
List
<
CfarticleVO
>
recommended
=
cfarticleMapper
.
recommended
(
id
);
if
(
recommended
.
size
()
>
0
)
{
if
(
recommended
.
size
()
>
0
)
{
for
(
CfarticleVO
cfarticleVO
:
recommended
)
{
String
contents
=
ESAPI
.
encoder
().
decodeForHTML
(
cfarticleVO
.
getContent
());
String
unCond
=
HtmlUtils
.
htmlUnescape
(
contents
);
...
...
@@ -130,9 +131,10 @@ public class CfarticleServiceImpl extends GenericServiceImpl<Cfarticle> implemen
return
rtnJson
;
}
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Override
public
JSONObject
reading
(
Long
id
,
String
appId
)
{
public
JSONObject
reading
(
Long
id
,
String
appId
)
{
JSONObject
rtnJson
=
new
JSONObject
();
int
count
=
1
;
try
{
...
...
@@ -140,18 +142,18 @@ public class CfarticleServiceImpl extends GenericServiceImpl<Cfarticle> implemen
CfarticleVO
reading
=
cfarticleMapper
.
saveReading
(
id
);
Long
recommended
=
reading
.
getRecommended
();
Long
redings
=
reading
.
getReading
();
if
(
redings
==
null
)
{
count
+=
0
;
}
else
{
count
+=
redings
;
if
(
redings
==
null
)
{
count
+=
0
;
}
else
{
count
+=
redings
;
}
Integer
integer
=
cfarticleMapper
.
reading
(
id
,
count
);
if
(
integer
>
0
)
{
Integer
integer
=
cfarticleMapper
.
reading
(
id
,
count
);
if
(
integer
>
0
)
{
CfarticleVO
saveReading
=
cfarticleMapper
.
saveReading
(
id
);
rtnJson
.
put
(
"errorNo"
,
"0"
);
rtnJson
.
put
(
"data"
,
saveReading
.
getReading
());
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
rtnJson
.
put
(
"errorNo"
,
"1"
);
rtnJson
.
put
(
"errorMsg"
,
"系统异常"
);
...
...
@@ -160,20 +162,20 @@ public class CfarticleServiceImpl extends GenericServiceImpl<Cfarticle> implemen
}
@Override
public
JSONObject
geteway
(
String
title
,
String
appId
,
Long
page
,
Long
pageSize
)
{
public
JSONObject
geteway
(
String
title
,
String
appId
,
Long
page
,
Long
pageSize
)
{
JSONObject
rtnJson
=
new
JSONObject
();
try
{
MpAccountsEntity
mpAccountsAppid
=
mpAccountsService
.
getMpAccountsAppid
(
appId
);
List
<
Cfarticle
>
cfarticles
=
cfarticleMapper
.
gateway
(
title
,
page
,
pageSize
);
if
(
cfarticles
==
null
)
{
List
<
Cfarticle
>
cfarticles
=
cfarticleMapper
.
gateway
(
title
,
page
,
pageSize
);
if
(
cfarticles
==
null
)
{
rtnJson
.
put
(
"errorNo"
,
"1"
);
rtnJson
.
put
(
"errorMsg"
,
"查询失败"
);
rtnJson
.
put
(
"errorMsg"
,
"查询失败"
);
return
rtnJson
;
}
rtnJson
.
put
(
"errorNo"
,
"0"
);
rtnJson
.
put
(
"
errorMsg"
,
cfarticles
);
rtnJson
.
put
(
"
data"
,
cfarticles
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
rtnJson
.
put
(
"errorNo"
,
"1"
);
rtnJson
.
put
(
"errorMsg"
,
"系统异常"
);
...
...
@@ -187,15 +189,15 @@ public class CfarticleServiceImpl extends GenericServiceImpl<Cfarticle> implemen
try
{
MpAccountsEntity
mpAccountsAppid
=
mpAccountsService
.
getMpAccountsAppid
(
appId
);
List
<
columnVO
>
column
=
cfarticleMapper
.
column
();
if
(
column
==
null
)
{
if
(
column
==
null
)
{
rtnJson
.
put
(
"errorNo"
,
"1"
);
rtnJson
.
put
(
"errorMsg"
,
"查询失败"
);
rtnJson
.
put
(
"errorMsg"
,
"查询失败"
);
return
rtnJson
;
}
rtnJson
.
put
(
"errorNo"
,
"0"
);
rtnJson
.
put
(
"
errorMsg"
,
column
);
rtnJson
.
put
(
"
data"
,
column
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
rtnJson
.
put
(
"errorNo"
,
"1"
);
rtnJson
.
put
(
"errorMsg"
,
"系统异常"
);
...
...
@@ -204,20 +206,20 @@ public class CfarticleServiceImpl extends GenericServiceImpl<Cfarticle> implemen
}
@Override
public
JSONObject
columnDetails
(
Long
id
,
String
appId
,
Long
page
,
Long
pageSize
,
String
title
)
{
public
JSONObject
columnDetails
(
Long
id
,
String
appId
,
Long
page
,
Long
pageSize
,
String
title
)
{
JSONObject
rtnJson
=
new
JSONObject
();
try
{
MpAccountsEntity
mpAccountsAppid
=
mpAccountsService
.
getMpAccountsAppid
(
appId
);
List
<
CfarticleVO
>
cfarticleVOS
=
cfarticleMapper
.
columnDetails
(
id
,
page
,
pageSize
,
title
);
if
(
cfarticleVOS
==
null
)
{
List
<
CfarticleVO
>
cfarticleVOS
=
cfarticleMapper
.
columnDetails
(
id
,
page
,
pageSize
,
title
);
if
(
cfarticleVOS
==
null
)
{
rtnJson
.
put
(
"errorNo"
,
"1"
);
rtnJson
.
put
(
"errorMsg"
,
"查询失败"
);
rtnJson
.
put
(
"errorMsg"
,
"查询失败"
);
return
rtnJson
;
}
rtnJson
.
put
(
"errorNo"
,
"0"
);
rtnJson
.
put
(
"data"
,
cfarticleVOS
);
rtnJson
.
put
(
"data"
,
cfarticleVOS
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
rtnJson
.
put
(
"errorNo"
,
"1"
);
rtnJson
.
put
(
"errorMsg"
,
"系统异常"
);
...
...
@@ -232,7 +234,7 @@ public class CfarticleServiceImpl extends GenericServiceImpl<Cfarticle> implemen
Integer
integer
=
cfarticleMapper
.
selectcom
();
rtnJson
.
put
(
"errorNo"
,
"0"
);
rtnJson
.
put
(
"data"
,
integer
);
rtnJson
.
put
(
"data"
,
integer
);
return
rtnJson
;
}
...
...
@@ -242,7 +244,7 @@ public class CfarticleServiceImpl extends GenericServiceImpl<Cfarticle> implemen
Integer
banner
=
cfarticleMapper
.
selectBanner
();
rtnJson
.
put
(
"errorNo"
,
"0"
);
rtnJson
.
put
(
"data"
,
banner
);
rtnJson
.
put
(
"data"
,
banner
);
return
rtnJson
;
}
...
...
mp-modules/mp-article-module/src/main/java/com/cftech/mp/article/dao/ArticleMapper.xml
View file @
8bab67be
...
...
@@ -114,7 +114,7 @@
media_id = #{media_id, jdbcType=VARCHAR},
</if>
<if
test=
"update_time != null"
>
update_time = #{update_time, jdbcType=
DATETIME
},
update_time = #{update_time, jdbcType=
TIMESTAMP
},
</if>
<if
test=
"news_item != null"
>
news_item = #{news_item},
...
...
@@ -129,7 +129,7 @@
status = #{status, jdbcType=VARCHAR},
</if>
<if
test=
"createTime != null"
>
create_time = #{createTime, jdbcType=
DATETIME
},
create_time = #{createTime, jdbcType=
TIMESTAMP
},
</if>
<if
test=
"description != null"
>
description = #{description, jdbcType=VARCHAR},
...
...
mp-modules/mp-customservice-module/src/main/java/com/cftech/mp/custservice/dao/MultiCustserviceMapper.xml
View file @
8bab67be
...
...
@@ -142,7 +142,7 @@
status = #{status, jdbcType=VARCHAR},
</if>
<if
test=
"createTime != null"
>
create_time = #{createTime, jdbcType=
DATETIME
},
create_time = #{createTime, jdbcType=
TIMESTAMP
},
</if>
<if
test=
"description != null"
>
description = #{description, jdbcType=VARCHAR},
...
...
pom.xml
View file @
8bab67be
...
...
@@ -144,6 +144,7 @@
<antisamy.version>
1.5.7
</antisamy.version>
<joda.version>
2.9.6
</joda.version>
<kaptcha.version>
0.0.9
</kaptcha.version>
<hutool.version>
5.7.11
</hutool.version>
</properties>
<dependencies>
...
...
@@ -935,6 +936,12 @@
<version>
V1.1.1
</version>
</dependency>
<dependency>
<groupId>
cn.hutool
</groupId>
<artifactId>
hutool-all
</artifactId>
<version>
${hutool.version}
</version>
</dependency>
</dependencies>
<build>
<resources>
...
...
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