Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
Z
zhiliao
Project
Project
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
Graph
比较
统计图
议题
0
议题
0
列表
看板
标记
Milestones
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
注册表
注册表
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
svn
zhiliao
Commits
de6e409c
提交
de6e409c
authored
9月 09, 2020
作者:
renjiancai
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
--no commit message
上级
7f7bf08c
隐藏空白字符变更
内嵌
并排
正在显示
10 个修改的文件
包含
100 行增加
和
46 行删除
+100
-46
FgOrderController.java
.../java/com/zrqx/order/fg/controller/FgOrderController.java
+5
-0
FgOrderMapper.java
...src/main/java/com/zrqx/order/fg/mapper/FgOrderMapper.java
+4
-0
FgOrderService.java
...c/main/java/com/zrqx/order/fg/service/FgOrderService.java
+7
-1
FgOrderServiceImpl.java
...in/java/com/zrqx/order/fg/service/FgOrderServiceImpl.java
+6
-0
FgBoostActivityController.java
...g/controller/BoostActivity/FgBoostActivityController.java
+27
-6
FgBargainingMapper.java
...rqx/resource/fg/mapper/bargaining/FgBargainingMapper.java
+14
-0
FgBargainingSerivceImpl.java
...source/fg/service/bargaining/FgBargainingSerivceImpl.java
+13
-32
FgBargainingService.java
...x/resource/fg/service/bargaining/FgBargainingService.java
+8
-7
FgOrderClient.java
...ain/java/com/zrqx/core/client/order/fg/FgOrderClient.java
+10
-0
FgOrderClientHystric.java
...a/com/zrqx/core/client/order/fg/FgOrderClientHystric.java
+6
-0
没有找到文件。
app/order/src/main/java/com/zrqx/order/fg/controller/FgOrderController.java
浏览文件 @
de6e409c
...
...
@@ -270,4 +270,9 @@ public class FgOrderController {
pageParam
.
setOrderBy
(
"payTime desc,createTime desc"
);
}
}
@ApiOperation
(
"远程调用已购买的数量"
)
@GetMapping
(
"/list/buyCount"
)
public
CallBack
<
Integer
>
buyCount
(
String
oid
){
return
CallBack
.
success
(
fgOrderService
.
buyCount
(
oid
));
}
}
app/order/src/main/java/com/zrqx/order/fg/mapper/FgOrderMapper.java
浏览文件 @
de6e409c
...
...
@@ -294,4 +294,8 @@ public interface FgOrderMapper extends BaseMapper<Order>{
+
"select * from ord_order b where status=0 and DATE_SUB(NOW(), INTERVAL #{date} MINUTE)>b.createTime; "
+
"</script>"
)
List
<
Order
>
queryAllWaitPayAndTimeout
(
@Param
(
"date"
)
String
date
);
@Select
(
"<script>"
+
"SELECT count(*) from ord_orderinfo info INNER JOIN ord_order der on info.orderid=der.id where goodsid={oid} and der.status=6"
+
"</script>"
)
Integer
BuyGoodsCount
(
String
oid
);
}
app/order/src/main/java/com/zrqx/order/fg/service/FgOrderService.java
浏览文件 @
de6e409c
...
...
@@ -188,7 +188,13 @@ public interface FgOrderService extends BaseService<Order, Integer>{
* @date: 2019年2月18日 下午1:42:55
*/
List
<
GoodsForm
>
listBuy
();
/**
* 远程调用获取已购总数量
* @return
* @author rjc
* @date: 2020年9月9日 下午3:38:50
*/
Integer
buyCount
(
String
oid
);
/**
* 查询已购买的商品信息
* @return
...
...
app/order/src/main/java/com/zrqx/order/fg/service/FgOrderServiceImpl.java
浏览文件 @
de6e409c
...
...
@@ -1032,6 +1032,12 @@ public class FgOrderServiceImpl extends BaseServiceImpl<Order, Integer> implemen
return
GoodsTypeStartEnum
.
ELECTRONIC
;
}
}
@Override
public
Integer
buyCount
(
String
oid
)
{
Integer
count
=
fgOrderMapper
.
BuyGoodsCount
(
oid
);
return
null
;
}
}
app/resource/src/main/java/com/zrqx/resource/fg/controller/BoostActivity/FgBoostActivityController.java
浏览文件 @
de6e409c
package
com
.
zrqx
.
resource
.
fg
.
controller
.
BoostActivity
;
import
java.math.BigDecimal
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
com.zrqx.core.client.order.fg.FgOrderClient
;
import
com.zrqx.core.util.response.CallBack
;
import
com.zrqx.resource.commons.form.fg.bargaining.BargainingForm
;
import
com.zrqx.resource.commons.form.fg.exchange.ExchangeForm
;
import
com.zrqx.resource.commons.model.bargaining.Bargaining
;
import
com.zrqx.resource.fg.service.bargaining.FgBargainingSerivceImpl
;
import
com.zrqx.resource.commons.model.courcelibrary.CourseLibrary
;
import
com.zrqx.resource.commons.vo.fg.bargaining.FgCourseBargainingListVO
;
import
com.zrqx.resource.fg.service.bargaining.FgBargainingService
;
import
com.zrqx.resource.fg.service.courselibrary.FgCourseLibraryService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
...
...
@@ -27,7 +30,10 @@ public class FgBoostActivityController {
@Autowired
private
FgBargainingService
fgBargainingSerivce
;
@Autowired
private
FgCourseLibraryService
service
;
@Autowired
private
FgOrderClient
fgOrderClient
;
@ApiOperation
(
value
=
"分享兑现"
,
notes
=
"分享兑现"
)
@GetMapping
(
value
=
"/save"
)
...
...
@@ -36,7 +42,22 @@ public class FgBoostActivityController {
return
CallBack
.
success
(
null
);
}
@ApiOperation
(
value
=
"助力活动资源"
,
notes
=
"助力活动资源1:0.01 ,2:49.9"
)
@GetMapping
(
value
=
"/get"
)
public
CallBack
<
FgCourseBargainingListVO
>
get
(
Integer
type
)
{
FgCourseBargainingListVO
vo
=
new
FgCourseBargainingListVO
();
CourseLibrary
courseLibrary
=
service
.
selectByPrimaryKey
(
"9931dd5889c811eaaea80050569033dc"
);
//获取购买数量
CallBack
<
Integer
>
buyCount
=
fgOrderClient
.
buyCount
(
courseLibrary
.
getId
());
//获取库存 1(0.01) 2(49.9)
Integer
num
=
fgBargainingSerivce
.
getStockNum
(
type
);
vo
.
setName
(
courseLibrary
.
getName
());
vo
.
setId
(
courseLibrary
.
getId
());
vo
.
setPurchased
(
buyCount
.
getData
());
vo
.
setRealPrice
(
new
BigDecimal
(
0.01
));
vo
.
setPrice
(
courseLibrary
.
getPrice
());
vo
.
setStock
(
num
);
return
CallBack
.
success
(
vo
);
}
}
app/resource/src/main/java/com/zrqx/resource/fg/mapper/bargaining/FgBargainingMapper.java
浏览文件 @
de6e409c
package
com
.
zrqx
.
resource
.
fg
.
mapper
.
bargaining
;
import
org.apache.ibatis.annotations.Param
;
import
org.apache.ibatis.annotations.Select
;
import
com.zrqx.core.mapper.BaseMapper
;
import
com.zrqx.resource.commons.model.bargaining.Bargaining
;
/**
* 兑换表
*/
public
interface
FgBargainingMapper
extends
BaseMapper
<
Bargaining
>{
@Select
(
"<script>"
+
"<if test='type == 1' >"
+
"SELECT COUNT(*) from("
+
"SELECT COUNT(*) from res_bargaining where type=1 GROUP BY shareMemberId HAVING COUNT(*)>=9) num"
+
"</if>"
+
"<if test='type == 2' >"
+
"SELECT COUNT(*) from("
+
"SELECT COUNT(*) from res_bargaining where type=2 GROUP BY shareMemberId HAVING COUNT(*)>=4) num"
+
"</if>"
+
"</script>"
)
Integer
getStockNum
(
@Param
(
"type"
)
Integer
type
);
}
app/resource/src/main/java/com/zrqx/resource/fg/service/bargaining/FgBargainingSerivceImpl.java
浏览文件 @
de6e409c
package
com
.
zrqx
.
resource
.
fg
.
service
.
bargaining
;
import
java.util.Date
;
import
java.util.List
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.logging.log4j.util.Strings
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
com.zrqx.core.client.form.order.GoodsForm
;
import
com.zrqx.core.client.form.order.OrderInfo
;
import
com.zrqx.core.client.member.fg.OrganClient
;
import
com.zrqx.core.client.order.fg.FgOrderClient
;
import
com.zrqx.core.commons.form.LoginMemberInfo
;
import
com.zrqx.core.commons.redis.Redis
;
import
com.zrqx.core.enums.BooleanStatusEnum
;
import
com.zrqx.core.enums.GoodsTypeEnum
;
import
com.zrqx.core.enums.resource.LibraryStatusEnum
;
import
com.zrqx.core.enums.resource.ReadOrShoppingCartTypeEnum
;
import
com.zrqx.core.enums.resource.article.ReadTextPowerEnum
;
import
com.zrqx.core.enums.resource.image.ImagePromptMessageEnum
;
import
com.zrqx.core.exception.BaseException
;
import
com.zrqx.core.mapper.BaseMapper
;
import
com.zrqx.core.service.BaseServiceImpl
;
import
com.zrqx.core.util.response.CallBack
;
import
com.zrqx.resource.commons.form.fg.bargaining.BargainingForm
;
import
com.zrqx.resource.commons.form.fg.exchange.ExchangeForm
;
import
com.zrqx.resource.commons.model.bargaining.Bargaining
;
import
com.zrqx.resource.commons.model.exchange.Exchange
;
import
com.zrqx.resource.commons.model.imagelibrary.ImageLibrary
;
import
com.zrqx.resource.commons.model.imagelibrary.ImageLibraryDiyType
;
import
com.zrqx.resource.commons.vo.fg.imagelibrary.FgImageLibraryVO
;
import
com.zrqx.resource.fg.manage.memberconllection.FgMemberConllectionManage
;
import
com.zrqx.resource.fg.mapper.bargaining.FgBargainingMapper
;
import
com.zrqx.resource.fg.mapper.exchange.FgExchangeMapper
;
import
com.zrqx.resource.fg.mapper.imagelibrary.FgImageLibraryDiyTypeRelationMapper
;
import
com.zrqx.resource.fg.mapper.imagelibrary.FgImageLibraryMapper
;
import
com.zrqx.resource.fg.mapper.record.FgRecordMapper
;
import
com.zrqx.resource.fg.service.ebook.FgEbookServiceImpl
;
import
tk.mybatis.mapper.entity.Example
;
/**
* 分享库
...
...
@@ -73,6 +41,19 @@ public class FgBargainingSerivceImpl extends
}
@Override
public
Integer
getStockNum
(
Integer
type
)
{
Integer
stockNum
=
mapper
.
getStockNum
(
type
);
if
(
type
==
1
)
{
stockNum
=
50
-
stockNum
;
}
else
{
stockNum
=
100
-
stockNum
;
}
return
stockNum
;
}
...
...
app/resource/src/main/java/com/zrqx/resource/fg/service/bargaining/FgBargainingService.java
浏览文件 @
de6e409c
package
com
.
zrqx
.
resource
.
fg
.
service
.
bargaining
;
import
java.util.List
;
import
com.zrqx.core.client.form.order.OrderInfo
;
import
com.zrqx.core.service.BaseService
;
import
com.zrqx.resource.commons.form.fg.bargaining.BargainingForm
;
import
com.zrqx.resource.commons.form.fg.exchange.ExchangeForm
;
import
com.zrqx.resource.commons.model.bargaining.Bargaining
;
import
com.zrqx.resource.commons.model.exchange.Exchange
;
import
com.zrqx.resource.commons.model.imagelibrary.ImageLibrary
;
import
com.zrqx.resource.commons.vo.fg.imagelibrary.FgImageLibraryVO
;
/**
* 分享库
...
...
@@ -21,5 +14,13 @@ public interface FgBargainingService extends BaseService<Bargaining,String>{
* @date: 2020年09月03日 下午3:57:47
*/
boolean
updateorsave
(
BargainingForm
form
);
/**
* 获取库存数量
* @param type
* @return
* @author rjc
* @date: 2020年9月9日 下午4:33:54
*/
Integer
getStockNum
(
Integer
type
);
}
core/src/main/java/com/zrqx/core/client/order/fg/FgOrderClient.java
浏览文件 @
de6e409c
...
...
@@ -93,4 +93,14 @@ public interface FgOrderClient {
*/
@PostMapping
(
"/fg/order/receive/pay_callback"
)
CallBack
<
Boolean
>
returnPayResult
(
@RequestBody
PayResultForm
form
);
/**
* 获取已购买数量
* @param oid
* @return
* @author rjc
* @date: 2020年9月9日 下午3:50:58
*/
@GetMapping
(
"/list/buyCount"
)
public
CallBack
<
Integer
>
buyCount
(
@RequestParam
(
"oid"
)
String
oid
);
}
core/src/main/java/com/zrqx/core/client/order/fg/FgOrderClientHystric.java
浏览文件 @
de6e409c
...
...
@@ -62,5 +62,11 @@ public class FgOrderClientHystric implements FgOrderClient {
return
null
;
}
@Override
public
CallBack
<
Integer
>
buyCount
(
String
oid
)
{
logger
.
info
(
"调用订单服务失败"
);
return
CallBack
.
fail
();
}
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论