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
0ebbc829
Commit
0ebbc829
authored
Feb 19, 2021
by
谢希宇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
create by Strive
create date 2021/02/19
parent
71741eb0
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
99 additions
and
83 deletions
+99
-83
AuthenticationMapper.java
...a/com/cftech/authentication/dao/AuthenticationMapper.java
+5
-5
CouponrecordMapper.xml
...n/java/com/cftech/couponrecord/dao/CouponrecordMapper.xml
+2
-1
MobileCouponrecordController.java
...cftech/couponrecord/web/MobileCouponrecordController.java
+16
-1
OrderServiceImpl.java
.../java/com/cftech/order/service/impl/OrderServiceImpl.java
+76
-75
pom.xml
aidea-modules/product-into-wareroom-module/pom.xml
+0
-1
No files found.
aidea-modules/authentication-module/src/main/java/com/cftech/authentication/dao/AuthenticationMapper.java
View file @
0ebbc829
...
@@ -4,11 +4,11 @@ import com.cftech.authentication.model.Authentication;
...
@@ -4,11 +4,11 @@ import com.cftech.authentication.model.Authentication;
import
com.cftech.core.generic.GenericDao
;
import
com.cftech.core.generic.GenericDao
;
/**
/**
* 身份验证Mapper
* 身份验证Mapper
*
*
* @author Buyj
* @author Buyj
* @date: 2020-11-23 16:56
* @date: 2020-11-23 16:56
*/
*/
public
interface
AuthenticationMapper
extends
GenericDao
<
Authentication
>
{
public
interface
AuthenticationMapper
extends
GenericDao
<
Authentication
>
{
}
}
\ No newline at end of file
aidea-modules/couponrecord-module/src/main/java/com/cftech/couponrecord/dao/CouponrecordMapper.xml
View file @
0ebbc829
...
@@ -248,9 +248,10 @@
...
@@ -248,9 +248,10 @@
from t_aidea_coupon_record
from t_aidea_coupon_record
where id = #{id}
where id = #{id}
</select>
</select>
<select
id=
"buyingMedicineNumber"
parameterType=
"java.util.Map"
resultType=
"map"
>
<select
id=
"buyingMedicineNumber"
parameterType=
"java.util.Map"
resultType=
"map"
>
SELECT
SELECT
SUM(d.
number
) number
SUM(d.
drugs_num
) number
FROM t_order t
FROM t_order t
LEFT JOIN t_order_details d ON t.id = d.order_id
LEFT JOIN t_order_details d ON t.id = d.order_id
<include
refid=
"sqlWhere"
/>
<include
refid=
"sqlWhere"
/>
...
...
aidea-modules/couponrecord-module/src/main/java/com/cftech/couponrecord/web/MobileCouponrecordController.java
View file @
0ebbc829
...
@@ -3,12 +3,16 @@ package com.cftech.couponrecord.web;
...
@@ -3,12 +3,16 @@ package com.cftech.couponrecord.web;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.cftech.couponrecord.model.CouponrecordVo
;
import
com.cftech.couponrecord.model.CouponrecordVo
;
import
com.cftech.couponrecord.service.CouponrecordService
;
import
com.cftech.couponrecord.service.CouponrecordService
;
import
com.google.zxing.WriterException
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.MediaType
;
import
org.springframework.http.MediaType
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.io.IOException
;
/**
/**
* 2021年1月29日
* 2021年1月29日
*/
*/
...
@@ -48,5 +52,16 @@ public class MobileCouponrecordController {
...
@@ -48,5 +52,16 @@ public class MobileCouponrecordController {
return
couponrecordService
.
checkCouponDetails
(
vo
);
return
couponrecordService
.
checkCouponDetails
(
vo
);
}
}
@RequestMapping
(
value
=
"/testSendCouponRecord"
,
method
=
{
RequestMethod
.
GET
,
RequestMethod
.
POST
},
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
public
void
testSendCouponRecord
(
@RequestParam
String
openid
,
@RequestParam
Long
accountsId
)
{
try
{
couponrecordService
.
sendCouponRecord
(
openid
,
accountsId
);
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
catch
(
WriterException
e
)
{
e
.
printStackTrace
();
}
}
}
}
aidea-modules/order-module/src/main/java/com/cftech/order/service/impl/OrderServiceImpl.java
View file @
0ebbc829
...
@@ -158,73 +158,73 @@ public class OrderServiceImpl extends GenericServiceImpl<Order> implements Order
...
@@ -158,73 +158,73 @@ public class OrderServiceImpl extends GenericServiceImpl<Order> implements Order
Order
order
=
null
;
Order
order
=
null
;
boolean
flag
=
false
;
boolean
flag
=
false
;
for
(
int
i
=
0
;
i
<
jsonArray
.
size
();
i
++)
{
for
(
int
i
=
0
;
i
<
jsonArray
.
size
();
i
++)
{
JSONObject
obj
=
jsonArray
.
getJSONObject
(
i
);
JSONObject
obj
=
jsonArray
.
getJSONObject
(
i
);
params
.
put
(
"accountsId"
,
accountsId
);
params
.
put
(
"accountsId"
,
accountsId
);
params
.
put
(
"id"
,
obj
.
getLong
(
"id"
));
params
.
put
(
"id"
,
obj
.
getLong
(
"id"
));
params
.
put
(
"idDetail"
,
obj
.
getString
(
"idDetail"
));
params
.
put
(
"idDetail"
,
obj
.
getString
(
"idDetail"
));
params
.
put
(
"productId"
,
obj
.
getLong
(
"productId"
));
params
.
put
(
"productId"
,
obj
.
getLong
(
"productId"
));
params
.
put
(
"drugsNum"
,
obj
.
getLong
(
"drugsNum"
));
params
.
put
(
"drugsNum"
,
obj
.
getLong
(
"drugsNum"
));
params
.
put
(
"price"
,
obj
.
getDouble
(
"price"
));
params
.
put
(
"price"
,
obj
.
getDouble
(
"price"
));
params
.
put
(
"amount"
,
obj
.
getDouble
(
"amount"
));
params
.
put
(
"amount"
,
obj
.
getDouble
(
"amount"
));
params
.
put
(
"orderAmount"
,
obj
.
getDouble
(
"orderAmount"
));
params
.
put
(
"orderAmount"
,
obj
.
getDouble
(
"orderAmount"
));
//获取产品信息
//获取产品信息
ProductDto
productDtos
=
orderMapper
.
fetchProduct
(
params
);
ProductDto
productDtos
=
orderMapper
.
fetchProduct
(
params
);
if
(
order
==
null
)
{
id
=
obj
.
getLong
(
"id"
);
orderAmount
=
obj
.
getDouble
(
"orderAmount"
);
Conds
orderConds
=
new
Conds
();
if
(
order
==
null
)
{
orderConds
.
equal
(
"o.del_flag"
,
Constants
.
DEL_FLAG_0
);
id
=
obj
.
getLong
(
"id"
);
orderConds
.
equal
(
"o.id"
,
id
);
orderAmount
=
obj
.
getDouble
(
"orderAmount"
);
order
=
this
.
fetchSearchByConds
(
orderConds
);
if
(
order
!=
null
)
{
Conds
orderConds
=
new
Conds
();
order
.
setOrderAmount
(
orderAmount
);
orderConds
.
equal
(
"o.del_flag"
,
Constants
.
DEL_FLAG_0
);
}
else
{
orderConds
.
equal
(
"o.id"
,
id
);
rtnJson
.
put
(
"errorNo"
,
"1"
);
order
=
this
.
fetchSearchByConds
(
orderConds
);
return
rtnJson
;
if
(
order
!=
null
)
{
}
order
.
setOrderAmount
(
orderAmount
);
}
else
{
rtnJson
.
put
(
"errorNo"
,
"1"
);
return
rtnJson
;
}
}
}
orderDetailDto
=
new
OrderDetailDto
();
orderDetailDto
=
new
OrderDetailDto
();
orderDetailDto
.
setOrderId
(
id
);
orderDetailDto
.
setOrderId
(
id
);
orderDetailDto
.
setOrderCode
(
order
.
getNumber
());
orderDetailDto
.
setOrderCode
(
order
.
getNumber
());
orderDetailDto
.
setOpenid
(
order
.
getOpenid
());
orderDetailDto
.
setOpenid
(
order
.
getOpenid
());
orderDetailDto
.
setPrice
(
obj
.
getDouble
(
"price"
));
orderDetailDto
.
setPrice
(
obj
.
getDouble
(
"price"
));
orderDetailDto
.
setAmount
(
obj
.
getDouble
(
"amount"
));
orderDetailDto
.
setAmount
(
obj
.
getDouble
(
"amount"
));
orderDetailDto
.
setDrugsId
(
productDtos
.
getId
());
orderDetailDto
.
setDrugsId
(
productDtos
.
getId
());
orderDetailDto
.
setDrugsNum
(
obj
.
getLong
(
"drugsNum"
));
orderDetailDto
.
setDrugsNum
(
obj
.
getLong
(
"drugsNum"
));
orderDetailDto
.
setDrugsCode
(
productDtos
.
getProductNumber
());
orderDetailDto
.
setDrugsCode
(
productDtos
.
getProductNumber
());
orderDetailDto
.
setDrugsSku
(
productDtos
.
getFormat
());
orderDetailDto
.
setDrugsSku
(
productDtos
.
getFormat
());
orderDetailDto
.
setAccountsId
(
accountsId
);
orderDetailDto
.
setAccountsId
(
accountsId
);
Integer
result
=
this
.
saveDetill
(
orderDetailDto
);
Integer
result
=
this
.
saveDetill
(
orderDetailDto
);
if
(
result
>
0
)
{
if
(
result
>
0
)
{
flag
=
true
;
flag
=
true
;
}
}
}
}
//获取商户号订单内容
//获取商户号订单内容
if
(
flag
)
{
if
(
flag
)
{
JSONObject
mchObj
=
WechatPayUtils
.
genenatePay
(
order
);
JSONObject
mchObj
=
WechatPayUtils
.
genenatePay
(
order
);
if
(
mchObj
!=
null
)
{
if
(
mchObj
!=
null
)
{
order
.
setStatus
(
"1"
);
order
.
setStatus
(
"1"
);
order
.
setOrderTime
(
new
Date
());
order
.
setOrderTime
(
new
Date
());
order
.
setOrderAmount
(
orderAmount
);
order
.
setOrderAmount
(
orderAmount
);
order
.
setRemarks
(
mchObj
.
toString
());
order
.
setRemarks
(
mchObj
.
toString
());
boolean
bool
=
this
.
update
(
order
);
boolean
bool
=
this
.
update
(
order
);
if
(
bool
)
{
if
(
bool
)
{
rtnJson
.
put
(
"errorNo"
,
"0"
);
rtnJson
.
put
(
"errorNo"
,
"0"
);
rtnJson
.
put
(
"errorMsg"
,
"确认成功!"
);
rtnJson
.
put
(
"errorMsg"
,
"确认成功!"
);
return
rtnJson
;
return
rtnJson
;
}
}
else
{
//商户号调用失败抛出异常回滚
//new RuntimeException();
TransactionAspectSupport
.
currentTransactionStatus
().
setRollbackOnly
();
}
}
}
else
{
//商户号调用失败抛出异常回滚
//new RuntimeException();
TransactionAspectSupport
.
currentTransactionStatus
().
setRollbackOnly
();
}
}
}
rtnJson
.
put
(
"errorNo"
,
"1"
);
rtnJson
.
put
(
"errorNo"
,
"1"
);
return
rtnJson
;
return
rtnJson
;
...
@@ -361,9 +361,9 @@ public class OrderServiceImpl extends GenericServiceImpl<Order> implements Order
...
@@ -361,9 +361,9 @@ public class OrderServiceImpl extends GenericServiceImpl<Order> implements Order
public
JSONObject
invoice
(
InvoiceDto
invoiceDto
)
{
public
JSONObject
invoice
(
InvoiceDto
invoiceDto
)
{
JSONObject
jsonObject
=
new
JSONObject
();
JSONObject
jsonObject
=
new
JSONObject
();
MpAccountsEntity
mpAccountsEntity
=
null
;
MpAccountsEntity
mpAccountsEntity
=
null
;
if
(
StringUtils
.
isNotBlank
(
invoiceDto
.
getAppId
())){
if
(
StringUtils
.
isNotBlank
(
invoiceDto
.
getAppId
()))
{
mpAccountsEntity
=
mpAccountsService
.
getMpAccountsAppid
(
invoiceDto
.
getAppId
());
mpAccountsEntity
=
mpAccountsService
.
getMpAccountsAppid
(
invoiceDto
.
getAppId
());
}
else
{
}
else
{
jsonObject
.
put
(
"errorNo"
,
"2"
);
jsonObject
.
put
(
"errorNo"
,
"2"
);
jsonObject
.
put
(
"errorMsg"
,
"appId不能为空"
);
jsonObject
.
put
(
"errorMsg"
,
"appId不能为空"
);
return
jsonObject
;
return
jsonObject
;
...
@@ -374,26 +374,26 @@ public class OrderServiceImpl extends GenericServiceImpl<Order> implements Order
...
@@ -374,26 +374,26 @@ public class OrderServiceImpl extends GenericServiceImpl<Order> implements Order
conds
.
equal
(
"o.id"
,
invoiceDto
.
getId
());
conds
.
equal
(
"o.id"
,
invoiceDto
.
getId
());
conds
.
equal
(
"o.del_flag"
,
Constants
.
DEL_FLAG_0
);
conds
.
equal
(
"o.del_flag"
,
Constants
.
DEL_FLAG_0
);
List
<
Order
>
list
=
this
.
fetchSearchBy
(
conds
,
null
,
0
,
0
,
null
);
List
<
Order
>
list
=
this
.
fetchSearchBy
(
conds
,
null
,
0
,
0
,
null
);
if
(
list
.
size
()
>
0
)
{
if
(
list
.
size
()
>
0
)
{
for
(
Order
order
:
list
){
for
(
Order
order
:
list
)
{
SimpleDateFormat
format
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
SimpleDateFormat
format
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
order
.
setCreateTimeStr
(
format
.
format
(
order
.
getCreateTime
()));
order
.
setCreateTimeStr
(
format
.
format
(
order
.
getCreateTime
()));
//抬头类型为企业设置发票税号
//抬头类型为企业设置发票税号
String
unitTax
=
null
;
String
unitTax
=
null
;
if
(
invoiceDto
.
getType
().
equals
(
"1"
))
{
if
(
invoiceDto
.
getType
().
equals
(
"1"
))
{
unitTax
=
invoiceDto
.
getUnitTaxNumber
();
unitTax
=
invoiceDto
.
getUnitTaxNumber
();
}
}
String
str
=
invoiceUtil
.
startInvoice
(
order
,
order
.
getNickName
(),
invoiceDto
.
getEmail
(),
invoiceDto
.
getType
(),
"0"
,
unitTax
);
String
str
=
invoiceUtil
.
startInvoice
(
order
,
order
.
getNickName
(),
invoiceDto
.
getEmail
(),
invoiceDto
.
getType
(),
"0"
,
unitTax
);
JSONObject
json
=
JSON
.
parseObject
(
str
);
JSONObject
json
=
JSON
.
parseObject
(
str
);
if
(
StringUtils
.
isNotBlank
(
json
.
getString
(
"code"
))
&&
json
.
getString
(
"code"
).
equals
(
"E0000"
)){
if
(
StringUtils
.
isNotBlank
(
json
.
getString
(
"code"
))
&&
json
.
getString
(
"code"
).
equals
(
"E0000"
))
{
//开票成功 添加一条开票记录
//开票成功 添加一条开票记录
//流水号
//流水号
String
invoiceSerialNum
=
json
.
getJSONObject
(
"result"
).
getString
(
"invoiceSerialNum"
);
String
invoiceSerialNum
=
json
.
getJSONObject
(
"result"
).
getString
(
"invoiceSerialNum"
);
Invoice
invoice
=
new
Invoice
();
Invoice
invoice
=
new
Invoice
();
//发票抬头
//发票抬头
if
(
invoiceDto
.
getType
().
equals
(
"1"
))
{
if
(
invoiceDto
.
getType
().
equals
(
"1"
))
{
//抬头类型为公司则发票税号
//抬头类型为公司则发票税号
invoice
.
setUnitTaxNumber
(
invoiceDto
.
getUnitTaxNumber
());
invoice
.
setUnitTaxNumber
(
invoiceDto
.
getUnitTaxNumber
());
invoice
.
setStatus
(
"1"
);
invoice
.
setStatus
(
"1"
);
...
@@ -416,7 +416,7 @@ public class OrderServiceImpl extends GenericServiceImpl<Order> implements Order
...
@@ -416,7 +416,7 @@ public class OrderServiceImpl extends GenericServiceImpl<Order> implements Order
//更新是否开票状态
//更新是否开票状态
order
.
setConfirm
(
invoiceSerialNum
);
order
.
setConfirm
(
invoiceSerialNum
);
orderMapper
.
update
(
order
);
orderMapper
.
update
(
order
);
}
else
{
}
else
{
jsonObject
.
put
(
"errorNo"
,
1
);
jsonObject
.
put
(
"errorNo"
,
1
);
jsonObject
.
put
(
"errorMsg"
,
StringUtils
.
isNotBlank
(
json
.
getString
(
"describe"
))
?
json
.
getString
(
"describe"
)
:
json
.
getString
(
"describe"
));
jsonObject
.
put
(
"errorMsg"
,
StringUtils
.
isNotBlank
(
json
.
getString
(
"describe"
))
?
json
.
getString
(
"describe"
)
:
json
.
getString
(
"describe"
));
return
jsonObject
;
return
jsonObject
;
...
@@ -424,10 +424,10 @@ public class OrderServiceImpl extends GenericServiceImpl<Order> implements Order
...
@@ -424,10 +424,10 @@ public class OrderServiceImpl extends GenericServiceImpl<Order> implements Order
}
}
}
}
jsonObject
.
put
(
"errorNo"
,
0
);
jsonObject
.
put
(
"errorNo"
,
0
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
jsonObject
.
put
(
"errorNo"
,
"1"
);
jsonObject
.
put
(
"errorNo"
,
"1"
);
jsonObject
.
put
(
"errorMsg"
,
"程序异常"
);
jsonObject
.
put
(
"errorMsg"
,
"程序异常"
);
}
}
return
jsonObject
;
return
jsonObject
;
}
}
...
@@ -439,6 +439,7 @@ public class OrderServiceImpl extends GenericServiceImpl<Order> implements Order
...
@@ -439,6 +439,7 @@ public class OrderServiceImpl extends GenericServiceImpl<Order> implements Order
/**
/**
* 微信支付回调事件
* 微信支付回调事件
*
* @param request
* @param request
* @return
* @return
*/
*/
...
@@ -612,7 +613,7 @@ public class OrderServiceImpl extends GenericServiceImpl<Order> implements Order
...
@@ -612,7 +613,7 @@ public class OrderServiceImpl extends GenericServiceImpl<Order> implements Order
}
}
@Override
@Override
public
List
<
Map
<
String
,
String
>>
findWaitRemindOrders
(
Long
number
)
{
public
List
<
Map
<
String
,
String
>>
findWaitRemindOrders
(
Long
number
)
{
return
orderMapper
.
findWaitRemindOrders
(
number
);
return
orderMapper
.
findWaitRemindOrders
(
number
);
}
}
...
...
aidea-modules/product-into-wareroom-module/pom.xml
View file @
0ebbc829
...
@@ -16,5 +16,4 @@
...
@@ -16,5 +16,4 @@
<version>
1.0-SNAPSHOT
</version>
<version>
1.0-SNAPSHOT
</version>
</dependency>
</dependency>
</dependencies>
</dependencies>
</project>
</project>
\ 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