记得上下班打卡 | git大法好,push需谨慎
Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
liquidnet-bus-v1
Project
Project
Details
Activity
Releases
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
董敬伟
liquidnet-bus-v1
Commits
ae873e8f
Commit
ae873e8f
authored
Apr 17, 2024
by
jiangxiulong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
某演出快递票批量申请未退快递费bug临时数据处理
parent
75e795f9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
111 additions
and
2 deletions
+111
-2
JxlDataKylinRefundController.java
...rm/controller/A_fskfsfs/JxlDataKylinRefundController.java
+107
-0
SweetMathUtil.java
...et/src/main/java/com/liquidnet/service/SweetMathUtil.java
+4
-2
No files found.
liquidnet-bus-service/liquidnet-service-platform/liquidnet-service-platform-impl/src/main/java/com/liquidnet/service/platform/controller/A_fskfsfs/JxlDataKylinRefundController.java
0 → 100644
View file @
ae873e8f
package
com
.
liquidnet
.
service
.
platform
.
controller
.
A_fskfsfs
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.liquidnet.common.cache.redis.util.RedisDataSourceUtil
;
import
com.liquidnet.service.base.ResponseDto
;
import
com.liquidnet.service.kylin.constant.KylinRedisConst
;
import
com.liquidnet.service.kylin.dto.vo.returns.KylinOrderRefundsVo
;
import
com.liquidnet.service.kylin.entity.KylinOrderRefunds
;
import
com.liquidnet.service.kylin.mapper.KylinOrderRefundsMapper
;
import
com.mysql.cj.jdbc.result.ResultSetImpl
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.extern.slf4j.Slf4j
;
import
org.bson.Document
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.data.mongodb.core.MongoTemplate
;
import
org.springframework.data.mongodb.core.query.Criteria
;
import
org.springframework.data.mongodb.core.query.Query
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.math.BigDecimal
;
import
java.sql.Connection
;
import
java.sql.DriverManager
;
import
java.sql.PreparedStatement
;
/**
* 临时数据处理
*
* @author jiangxiulong
*/
@Api
(
tags
=
"临时数据处理"
)
@RestController
@RequestMapping
(
"fskfsfs"
)
@Slf4j
public
class
JxlDataKylinRefundController
{
@Value
(
"${spring.datasource.url}"
)
private
String
SQL_URL
;
@Value
(
"${spring.datasource.username}"
)
private
String
SQL_USER
;
@Value
(
"${spring.datasource.password}"
)
private
String
SQL_PWD
;
@Autowired
private
KylinOrderRefundsMapper
kylinOrderRefundsMapper
;
@Autowired
private
MongoTemplate
mongoTemplate
;
@Autowired
private
RedisDataSourceUtil
redisDataSourceUtil
;
@GetMapping
(
"KR001"
)
@ApiOperation
(
"某演出快递票批量申请未退快递费bug临时数据处理"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
type
=
"query"
,
dataType
=
"String"
,
name
=
"performancesId"
,
value
=
"演出id"
,
required
=
true
),
})
public
ResponseDto
P001
(
@RequestParam
(
"performancesId"
)
String
performancesId
)
{
try
{
String
sql
=
"select aa.created_at, aa.order_tickets_id, aa.price, bb.price_actual,bb.number,count(1) as ssrefund_number, bb.price_express as b_price_express, aa.price_express, type, aa.order_refunds_id, bb.order_code\n"
+
"from kylin_order_refunds as aa\n"
+
" join kylin_order_tickets as bb on aa.order_tickets_id = bb.order_tickets_id\n"
+
"where bb.performance_title = '2024武汉草莓音乐节'\n"
+
" and bb.get_ticket_type = 'express'\n"
+
" and aa.price_express != bb.price_express\n"
+
" and aa.status = 0\n"
+
"group by bb.order_code, bb.number\n"
+
"HAVING\n"
+
" COUNT(1) = bb.number;"
;
Connection
connection
=
DriverManager
.
getConnection
(
SQL_URL
,
SQL_USER
,
SQL_PWD
);
PreparedStatement
preparedStatement
=
connection
.
prepareStatement
(
sql
);
ResultSetImpl
row
=
(
ResultSetImpl
)
preparedStatement
.
executeQuery
();
while
(
row
.
next
())
{
String
order_tickets_id
=
row
.
getString
(
"order_tickets_id"
);
String
order_refunds_id
=
row
.
getString
(
"order_refunds_id"
);
BigDecimal
b_price_express
=
row
.
getBigDecimal
(
"b_price_express"
);
// mysql
KylinOrderRefunds
aNew
=
KylinOrderRefunds
.
getNew
();
aNew
.
setPriceExpress
(
b_price_express
);
kylinOrderRefundsMapper
.
update
(
aNew
,
Wrappers
.
lambdaUpdate
(
KylinOrderRefunds
.
class
)
.
eq
(
KylinOrderRefunds:
:
getOrderRefundsId
,
order_refunds_id
)
);
// mongodb
mongoTemplate
.
getCollection
(
KylinOrderRefundsVo
.
class
.
getSimpleName
()).
updateOne
(
Query
.
query
(
Criteria
.
where
(
"orderRefundsId"
).
is
(
order_refunds_id
)).
getQueryObject
(),
new
Document
(
"$set"
,
new
Document
(
"priceExpress"
,
b_price_express
))
);
// redis
redisDataSourceUtil
.
getRedisKylinUtil
().
del
(
KylinRedisConst
.
ORDER_REFUND_BY_ORDER_ID
+
order_tickets_id
);
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
return
ResponseDto
.
success
();
}
}
liquidnet-bus-service/liquidnet-service-sweet/src/main/java/com/liquidnet/service/SweetMathUtil.java
View file @
ae873e8f
...
@@ -40,11 +40,13 @@ public class SweetMathUtil {
...
@@ -40,11 +40,13 @@ public class SweetMathUtil {
public
static
void
main
(
String
[]
args
)
{
public
static
void
main
(
String
[]
args
)
{
// 演出
// 演出
// getIndex("kylin:performances:id:3593259032328560647540949");
getIndex
(
"kylin:order:refund:orderId:3723449311084462082823529"
);
// getIndex("kylin:performances:id:3702399965296353283844790");
// getIndex("adam:info:enters:2028906701014466564961253");
// getIndex("adam:info:enters:2028906701014466564961253");
getIndex
(
"adam:info:certification:1450202200409261446"
);
//
getIndex("adam:info:certification:1450202200409261446");
// getIndex("kylin:performances:roadShowId:5936345");
// getIndex("kylin:performances:roadShowId:5936345");
// getIndex("kylin:performances:roadShowId:570");
// getIndex("kylin:performances:roadShowId:570");
// getIndex("goblin:order:3480736209173708801750595");
...
...
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