记得上下班打卡 | 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
c093ab30
Commit
c093ab30
authored
Sep 18, 2021
by
胡佳晨
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
暂时提交
parent
51b22c43
Changes
13
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
234 additions
and
238 deletions
+234
-238
dev_import.sql
docu/dev_import.sql
+5
-0
KylinRedisConst.java
...com/liquidnet/service/kylin/constant/KylinRedisConst.java
+2
-0
ImportController.java
...admin/web/controller/zhengzai/kylin/ImportController.java
+4
-6
KylinPerformancesController.java
...ontroller/zhengzai/kylin/KylinPerformancesController.java
+17
-2
details.html
...ources/templates/zhengzai/kylin/performances/details.html
+7
-41
orderImport.html
...es/templates/zhengzai/kylin/performances/orderImport.html
+73
-142
performances.html
...s/templates/zhengzai/kylin/performances/performances.html
+0
-17
KylinOrderImportDto.java
.../client/admin/zhengzai/kylin/dto/KylinOrderImportDto.java
+15
-0
OrderOutLineVo.java
...idnet/client/admin/zhengzai/kylin/dto/OrderOutLineVo.java
+2
-0
IImportService.java
...t/client/admin/zhengzai/kylin/service/IImportService.java
+1
-1
ImportServiceImpl.java
.../admin/zhengzai/kylin/service/impl/ImportServiceImpl.java
+54
-15
DataUtils.java
...iquidnet/client/admin/zhengzai/kylin/utils/DataUtils.java
+36
-13
KylinOrderImport.java
.../com/liquidnet/service/kylin/entity/KylinOrderImport.java
+18
-1
No files found.
docu/dev_import.sql
View file @
c093ab30
...
...
@@ -2,9 +2,14 @@ drop table if exists kylin_order_import;
create
table
kylin_order_import
(
mid
bigint
unsigned
auto_increment
primary
key
,
import_id
varchar
(
64
)
default
''
comment
'id'
,
performance_id
varchar
(
64
)
default
''
comment
'演出id'
,
title
varchar
(
64
)
default
''
comment
'文件名称'
,
status
int
(
3
)
default
0
comment
'状态[0-处理中|1处理完成|2处理失败]'
,
error_count
int
default
0
comment
'失败条数'
,
success_count
int
default
0
comment
'成功条数'
,
all_count
int
default
0
comment
'总条数'
,
created_at
datetime
,
updated_at
datetime
,
comment
text
...
...
liquidnet-bus-api/liquidnet-service-kylin-api/src/main/java/com/liquidnet/service/kylin/constant/KylinRedisConst.java
View file @
c093ab30
...
...
@@ -27,6 +27,8 @@ public class KylinRedisConst {
public
static
final
String
ORDER_REFUND
=
"kylin:order:refund:orderRefundsId:"
;
public
static
final
String
ORDER_TRANSFER
=
"kylin:order:transfer:uid:"
;
//订单导入失败key
public
static
final
String
ORDER_IMPORT_FAIL
=
"kylin:order:import:fail:"
;
public
static
final
String
USERID_BUY_INFO
=
"kylin:buy:userId:"
;
public
static
final
String
IDCARD_BUY_INFO
=
"kylin:buy:idCard:"
;
...
...
liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-web/src/main/java/com/liquidnet/client/admin/web/controller/zhengzai/kylin/ImportController.java
View file @
c093ab30
...
...
@@ -24,8 +24,7 @@ public class ImportController {
*/
@GetMapping
(
"/template/OrderOutLine"
)
@ResponseBody
public
AjaxResult
importTemplateOrderOutLine
()
{
public
AjaxResult
importTemplateOrderOutLine
()
{
ExcelUtil
<
OrderOutLineVo
>
util
=
new
ExcelUtil
(
OrderOutLineVo
.
class
);
return
util
.
importTemplateExcel
(
"订单导入数据"
);
}
...
...
@@ -36,12 +35,11 @@ public class ImportController {
*/
@PostMapping
(
"/OrderOutLine/{performancesId}"
)
@ResponseBody
public
AjaxResult
importOrderOutLine
(
@PathVariable
(
"performancesId"
)
String
performancesId
,
MultipartFile
file
,
boolean
updateSupport
)
throws
Exception
{
public
AjaxResult
importOrderOutLine
(
@PathVariable
(
"performancesId"
)
String
performancesId
,
MultipartFile
file
,
boolean
updateSupport
)
throws
Exception
{
ExcelUtil
<
OrderOutLineVo
>
util
=
new
ExcelUtil
(
OrderOutLineVo
.
class
);
List
<
OrderOutLineVo
>
orderOutLineVoList
=
util
.
importExcel
(
file
.
getInputStream
());
String
operName
=
ShiroUtils
.
getSysUser
().
getLoginName
();
String
message
=
iImportService
.
importOrderOutLine
(
performancesId
,
orderOutLineVoList
,
updateSupport
,
operName
);
//
String operName = ShiroUtils.getSysUser().getLoginName();
String
message
=
iImportService
.
importOrderOutLine
(
performancesId
,
orderOutLineVoList
,
updateSupport
,
file
.
getName
()
);
return
AjaxResult
.
success
(
message
);
}
...
...
liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-web/src/main/java/com/liquidnet/client/admin/web/controller/zhengzai/kylin/KylinPerformancesController.java
View file @
c093ab30
...
...
@@ -7,6 +7,7 @@ import com.liquidnet.client.admin.common.core.controller.BaseController;
import
com.liquidnet.client.admin.common.core.domain.AjaxResult
;
import
com.liquidnet.client.admin.common.core.page.TableDataInfo
;
import
com.liquidnet.client.admin.common.enums.BusinessType
;
import
com.liquidnet.client.admin.zhengzai.kylin.dto.KylinOrderImportDto
;
import
com.liquidnet.client.admin.zhengzai.kylin.dto.PerformanceOrderStatisCountResp
;
import
com.liquidnet.commons.lang.util.JsonUtils
;
import
com.liquidnet.service.kylin.dao.PerformanceAdminListDao
;
...
...
@@ -213,11 +214,25 @@ public class KylinPerformancesController extends BaseController {
@GetMapping
(
value
=
"/orderImport/{performancesId}"
)
public
String
getOrderImport
(
@PathVariable
(
"performancesId"
)
String
performancesId
,
ModelMap
mmap
)
{
List
<
KylinOrderImport
>
result
=
kylinPerformancesService
.
getOrderImport
(
performancesId
);
mmap
.
put
(
"KylinOrderImport"
,
result
);
// List<KylinOrderImport> result = kylinPerformancesService.getOrderImport(performancesId);
// KylinOrderImportDto vo = new KylinOrderImportDto();
// vo.setKylinOrderImportList(result);
// vo.setPerformancesId(performancesId);
mmap
.
put
(
"performancesId"
,
performancesId
);
return
prefix
+
"/orderImport"
;
}
@PostMapping
(
value
=
"/orderImport/list/{performancesId}"
)
@ResponseBody
public
TableDataInfo
getOrderImportList
(
@PathVariable
(
"performancesId"
)
String
performancesId
,
ModelMap
mmap
)
{
List
<
KylinOrderImport
>
result
=
kylinPerformancesService
.
getOrderImport
(
performancesId
);
TableDataInfo
rspData
=
new
TableDataInfo
();
rspData
.
setCode
(
0
);
rspData
.
setRows
(
result
);
rspData
.
setTotal
(
result
.
size
());
return
rspData
;
}
//@RequiresPermissions("kylin:performances:view")
@PostMapping
(
value
=
"/transferConfig/change"
)
@ResponseBody
...
...
liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-web/src/main/resources/templates/zhengzai/kylin/performances/details.html
View file @
c093ab30
...
...
@@ -7,16 +7,14 @@
<div
class=
"wrapper wrapper-content animated fadeIn"
>
<div
class=
"row"
>
<div
class=
"col-sm-12"
>
<a
class=
"btn btn-warning"
onclick=
"$.table.importExcel()"
>
<i
class=
"fa fa-upload"
></i>
导入
</a>
<div
class=
"tabs-container"
>
<ul
class=
"nav nav-tabs"
>
<li
id=
"li-tab-2"
class=
"active"
><a
data-toggle=
"tab"
href=
"#tab-2"
aria-expanded=
"false"
>
演出详情
</a>
</li>
<li
id=
"li-tab-1"
><a
data-toggle=
"tab"
href=
"#tab-1"
aria-expanded=
"true"
id=
"tab-nav-1"
>
演出数据
</a>
</li>
<li
id=
"li-tab-6"
><a
data-toggle=
"tab"
href=
"#tab-6"
aria-expanded=
"false"
onclick=
"refundConfigInfo()"
>
退款管理
</a>
<li
id=
"li-tab-6"
><a
data-toggle=
"tab"
href=
"#tab-6"
aria-expanded=
"false"
onclick=
"refundConfigInfo()"
>
退款管理
</a>
</li>
<li
id=
"li-tab-7"
><a
data-toggle=
"tab"
href=
"#tab-7"
aria-expanded=
"false"
onclick=
"transferInfo()"
>
转赠配置
</a>
</li>
...
...
@@ -33,7 +31,6 @@
<div
id=
"tab-1"
class=
"tab-pane"
>
<div
class=
"panel-body"
>
<div
id=
"tab-1"
class=
"tab-pane"
>
<!-- <th:block th:include="../templates/zhengzai/kylin/performances/performancesStatic :: performancesStatic"/>-->
<iframe
id=
"tab_iframe_1"
name=
"tab_iframe_1"
marginwidth=
0
marginheight=
0
width=
100%
height=
800px
frameborder=
0
></iframe>
</div>
...
...
@@ -162,17 +159,6 @@
<span>
库存总量:
</span>
<span
th:text=
"${dict2.totalGeneral}"
></span>
</div>
<!-- <div>-->
<!-- <span>售票状态:</span>-->
<!-- <span th:if="${dict2.status == 1}">审核中</span>-->
<!-- <span th:if="${dict2.status == 3}">审核通过</span>-->
<!-- <span th:if="${dict2.status == 4}">未通过</span>-->
<!-- <span th:if="${dict2.status == 6}">在售</span>-->
<!-- <span th:if="${dict2.status == 7}">下架</span>-->
<!-- <span th:if="${dict2.status == 8}">售罄</span>-->
<!-- <span th:if="${dict2.status == 9}">未开始</span>-->
<!-- <span th:if="${dict2.status == 10}">已结束</span>-->
<!-- </div>-->
<div>
<span>
开始售票时间:
</span>
<span
th:text=
"${dict2.timeStart}"
></span>
...
...
@@ -251,7 +237,11 @@
</div>
<div
id=
"tab-8"
class=
"tab-pane"
>
<div
class=
"panel-body"
>
<iframe
id=
"order_import_iframe"
name=
"order_import_iframe"
marginwidth=
0
marginheight=
0
width=
100%
<form
class=
"form-horizontal m"
th:object=
"${kylinPerformanceMisVo}"
>
<input
name=
"title"
th:field=
"*{title}"
class=
"form-control"
type=
"text"
readonly
>
</form>
<iframe
id=
"order_import_iframe"
name=
"order_import_iframe"
marginwidth=
0
marginheight=
0
width=
100%
height=
800px
frameborder=
0
></iframe>
</div>
</div>
...
...
@@ -390,30 +380,6 @@
$
(
"#tab-nav-1"
).
bind
(
"click"
,
function
()
{
$
(
"#tab_iframe_1"
).
attr
(
"src"
,
prefix
+
"/performanceStatic/"
+
'[[${kylinPerformanceMisVo.performancesId}]]'
.
replaceAll
(
"
\"
"
,
""
));
});
var
options
=
{
importUrl
:
ctx
+
"import/OrderOutLine/"
+
'[[${kylinPerformanceMisVo.performancesId}]]'
.
replaceAll
(
"
\"
"
,
""
),
//导入
importTemplateUrl
:
ctx
+
"import/template/OrderOutLine"
//导出
}
$
.
table
.
init
(
options
)
</script>
<script
id=
"importTpl"
type=
"text/template"
>
<
form
enctype
=
"multipart/form-data"
class
=
"mt20 mb10"
>
<
div
class
=
"col-xs-offset-1"
>
<
input
type
=
"file"
id
=
"file"
name
=
"file"
/>
<
div
class
=
"mt10 pt5"
>
<
input
type
=
"checkbox"
id
=
"updateSupport"
name
=
"updateSupport"
title
=
"如果登录账户已经存在,更新这条数据。"
>
是否更新已经存在的用户数据
&
nbsp
;
<
a
onclick
=
"$.table.importTemplate()"
class
=
"btn btn-default btn-xs"
><
i
class
=
"fa fa-file-excel-o"
><
/i> 下载模板</
a
>
<
/div
>
<
font
color
=
"red"
class
=
"pull-left mt10"
>
提示:仅允许导入“
xls
”或“
xlsx
”格式文件!
<
/font
>
<
/div
>
<
/form
>
</script>
</body>
</html>
liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-web/src/main/resources/templates/zhengzai/kylin/performances/orderImport.html
View file @
c093ab30
...
...
@@ -9,69 +9,9 @@
<div
class=
"col-sm-12 search-collapse"
>
<form
id=
"formId"
>
<div
class=
"select-list"
>
<ul>
<li>
<label>
演出名称:
</label>
<input
type=
"text"
name=
"title"
/>
</li>
<li>
<label>
城市名称:
</label>
<input
type=
"text"
name=
"cityName"
/>
</li>
<li>
<label>
排序字段:
</label>
<select
name=
"orderItem"
>
<option
value=
"created_at"
>
创建时间
</option>
<option
value=
""
>
所有
</option>
<option
value=
"updated_at"
>
修改时间
</option>
</select>
</li>
<li>
<label>
排序方式:
</label>
<select
name=
"orderSc"
>
<option
value=
"desc"
>
倒序
</option>
<option
value=
""
>
所有
</option>
<option
value=
"asc"
>
正序
</option>
</select>
</li>
<li
style=
"visibility: hidden"
>
<label>
演出状态:
</label>
<select
name=
"status"
>
<option
value=
"-2"
>
全部
</option>
<option
value=
"1"
>
审核中
</option>
<option
value=
"3"
>
审核通过
</option>
<option
value=
"4"
>
审核拒绝
</option>
<option
value=
"6"
>
售卖
</option>
<option
value=
"7"
>
已下架
</option>
<option
value=
"8"
>
售罄
</option>
<option
value=
"9"
>
未开始
</option>
<option
value=
"10"
>
演出结束
</option>
</select>
</li>
<li>
<label>
审核状态:
</label>
<select
name=
"auditStatus"
>
<option
value=
"-2"
>
全部
</option>
<option
value=
"0"
>
审核中
</option>
<option
value=
"2"
>
审核拒绝
</option>
</select>
</li>
<li>
<label>
停售时间:
</label>
<select
name=
"stopSellDay"
>
<option
value=
"-2"
>
全部
</option>
<option
value=
"0"
>
今天
</option>
<option
value=
"1"
>
明天
</option>
<option
value=
"-1"
>
昨天
</option>
</select>
</li>
<li>
<a
class=
"btn btn-primary btn-rounded btn-sm"
onclick=
"$.table.search()"
><i
class=
"fa fa-search"
></i>
搜索
</a>
<a
class=
"btn btn-warning btn-rounded btn-sm"
onclick=
"$.form.reset()"
><i
class=
"fa fa-refresh"
></i>
重置
</a>
</li>
</ul>
<a
class=
"btn btn-warning"
onclick=
"$.table.importExcel()"
>
<i
class=
"fa fa-upload"
></i>
导入
</a>
</div>
</form>
</div>
...
...
@@ -83,85 +23,76 @@
</div>
<th:block
th:include=
"include :: footer"
/>
<script
th:inline=
"javascript"
>
// var detailFlag = [[${@permission.hasPermi('kylin:performances:detail')}]];
// var expertFlag = [[${@permission.hasPermi('kylin:performances:expert')}]];
// var prefix = ctx + "kylin/performances";
//
// $(function () {
// var options = {
// url: prefix + "/list",
// modalName: "演出",
// orderSc:"desc",
// orderItem:"created_at",
// columns: [{
// checkbox: true
// },
// {
// field: 'title',
// title: '演出名称'
// },
// {
// field: 'performancesId',
// title: '演出id'
// },
// {
// field: 'timeStart',
// title: '开演时间'
// },
// {
// field: 'totalGeneral',
// title: '供票总量'
// },
// {
// field: 'saleGeneral',
// title: '实销'
// },
// {
// field: 'surplusGeneral',
// title: '余票'
// },
// {
// field: 'totalSalePrice',
// title: '总销售款'
// },
// {
// field: 'statusName',
// title: '演出状态'
// },
// {
// field: 'rejectTxt',
// title: '拒绝理由'
// },
// {
// field: 'sort',
// title: '排序',
// sortable: true
// },
// {
// title: '操作',
// align: 'center',
// formatter: function (value, row, index) {
// var actions = [];
// if (row.auditStatus == 0) {
// actions.push('
<
a
class
=
"btn btn-success btn-xs ' + detailFlag + '"
href
=
"javascript:void(0)"
onclick
=
"$.operate.detailTab(
\
'' + row.performancesId + '
\
')"
><
i
class
=
"fa fa-edit"
><
/i>管理</
a
>
');
// }else{
// actions.push('
<
a
class
=
"btn btn-success btn-xs ' + detailFlag + '"
href
=
"javascript:void(0)"
onclick
=
"$.operate.detailTab(
\
'' + row.performancesId + '
\
')"
><
i
class
=
"fa fa-edit"
><
/i>查看</
a
>
');
// }
// if (row.syncDamai == 1) {
// actions.push('
<
a
class
=
"btn btn-warning btn-xs ' + expertFlag + '"
href
=
"javascript:void(0)"
onclick
=
"f(
\
'' + row.performancesId + '
\
')"
><
i
class
=
"fa fa-remove"
><
/i>同步</
a
>
');
// }
// return actions.join('');
// }
// }]
// };
// $.table.init(options);
// });
//
// function f(id) {
// $.post(prefix + "/sync/damai",{performancesId:id},function (res) {
// alert(res.msg)
// });
// }
var
prefix
=
ctx
+
"kylin/performances"
;
var
options
=
{
url
:
prefix
+
"/orderImport/list/"
+
'[[${performancesId}]]'
.
replaceAll
(
"
\"
"
,
""
),
importUrl
:
ctx
+
"import/OrderOutLine/"
+
'[[${performancesId}]]'
.
replaceAll
(
"
\"
"
,
""
),
//导入
importTemplateUrl
:
ctx
+
"import/template/OrderOutLine"
,
//导出
modalName
:
"订单"
,
orderSc
:
"desc"
,
orderItem
:
"created_at"
,
columns
:
[{
checkbox
:
true
},
{
field
:
'mid'
,
title
:
'id'
},
{
field
:
'title'
,
title
:
'文件名称'
},
{
field
:
'status'
,
title
:
'订单状态'
},
{
field
:
'allCount'
,
title
:
'总条数'
},
{
field
:
'errorCount'
,
title
:
'失败条数'
},
{
field
:
'successCount'
,
title
:
'成功条数'
},
{
field
:
'createdAt'
,
title
:
'导入时间'
},
{
field
:
'updatedAt'
,
title
:
'完成时间'
},
{
title
:
'操作'
,
align
:
'center'
,
formatter
:
function
(
value
,
row
,
index
)
{
var
actions
=
[];
actions
.
push
(
'<a class="btn btn-warning btn-xs" href="javascript:void(0)" onclick="f(
\'
'
+
row
.
mid
+
'
\'
)"><i class="fa fa-remove"></i>错误详情</a>'
);
return
actions
.
join
(
''
);
}
}]
};
$
.
table
.
init
(
options
);
</script>
<script
id=
"importTpl"
type=
"text/template"
>
<
form
enctype
=
"multipart/form-data"
class
=
"mt20 mb10"
>
<
div
class
=
"col-xs-offset-1"
>
<
input
type
=
"file"
id
=
"file"
name
=
"file"
/>
<
div
class
=
"mt10 pt5"
>
<
input
type
=
"checkbox"
id
=
"updateSupport"
name
=
"updateSupport"
title
=
"如果登录账户已经存在,更新这条数据。"
>
是否更新已经存在的用户数据
&
nbsp
;
<
a
onclick
=
"$.table.importTemplate()"
class
=
"btn btn-default btn-xs"
><
i
class
=
"fa fa-file-excel-o"
><
/i> 下载模板</
a
>
<
/div
>
<
font
color
=
"red"
class
=
"pull-left mt10"
>
提示:仅允许导入“
xls
”或“
xlsx
”格式文件!
<
/font
>
<
/div
>
<
/form
>
</script>
</body>
</html>
liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-web/src/main/resources/templates/zhengzai/kylin/performances/performances.html
View file @
c093ab30
...
...
@@ -75,23 +75,6 @@
</div>
</form>
</div>
<!-- <div class="btn-group-sm" id="toolbar" role="group">-->
<!-- <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="kylin:performances:add">-->
<!-- <i class="fa fa-plus"></i> 添加-->
<!-- </a>-->
<!-- <a class="btn btn-primary single disabled" onclick="$.operate.edit()"-->
<!-- shiro:hasPermission="kylin:performances:edit">-->
<!-- <i class="fa fa-edit"></i> 修改-->
<!-- </a>-->
<!-- <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()"-->
<!-- shiro:hasPermission="kylin:performances:remove">-->
<!-- <i class="fa fa-remove"></i> 删除-->
<!-- </a>-->
<!-- <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="kylin:performances:export">-->
<!-- <i class="fa fa-download"></i> 导出-->
<!-- </a>-->
<!-- </div>-->
<div
class=
"col-sm-12 select-table table-striped"
>
<table
id=
"bootstrap-table"
></table>
</div>
...
...
liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-zhengzai/src/main/java/com/liquidnet/client/admin/zhengzai/kylin/dto/KylinOrderImportDto.java
0 → 100644
View file @
c093ab30
package
com
.
liquidnet
.
client
.
admin
.
zhengzai
.
kylin
.
dto
;
import
com.liquidnet.service.kylin.entity.KylinOrderImport
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.util.List
;
@Data
public
class
KylinOrderImportDto
implements
Serializable
{
private
String
performancesId
;
private
List
<
KylinOrderImport
>
kylinOrderImportList
;
}
liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-zhengzai/src/main/java/com/liquidnet/client/admin/zhengzai/kylin/dto/OrderOutLineVo.java
View file @
c093ab30
...
...
@@ -23,4 +23,6 @@ public class OrderOutLineVo {
private
String
ticketType
;
@Excel
(
name
=
"快递票地址"
,
cellType
=
Excel
.
ColumnType
.
STRING
)
private
String
address
;
private
String
reason
;
}
liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-zhengzai/src/main/java/com/liquidnet/client/admin/zhengzai/kylin/service/IImportService.java
View file @
c093ab30
...
...
@@ -6,5 +6,5 @@ import java.util.List;
public
interface
IImportService
{
String
importOrderOutLine
(
String
performancesId
,
List
<
OrderOutLineVo
>
orderOutLineVoList
,
Boolean
updateSupport
,
String
oper
Name
);
String
importOrderOutLine
(
String
performancesId
,
List
<
OrderOutLineVo
>
orderOutLineVoList
,
Boolean
updateSupport
,
String
file
Name
);
}
liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-zhengzai/src/main/java/com/liquidnet/client/admin/zhengzai/kylin/service/impl/ImportServiceImpl.java
View file @
c093ab30
package
com
.
liquidnet
.
client
.
admin
.
zhengzai
.
kylin
.
service
.
impl
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.fasterxml.jackson.core.type.TypeReference
;
import
com.liquidnet.client.admin.common.exception.BusinessException
;
import
com.liquidnet.client.admin.common.utils.StringUtils
;
...
...
@@ -16,14 +17,8 @@ import com.liquidnet.service.kylin.dto.vo.middle.KylinTicketVo;
import
com.liquidnet.service.kylin.dto.vo.mongo.KylinOrderTicketEntitiesVo
;
import
com.liquidnet.service.kylin.dto.vo.mongo.KylinOrderTicketVo
;
import
com.liquidnet.service.kylin.dto.vo.mongo.KylinPerformanceVo
;
import
com.liquidnet.service.kylin.entity.KylinOrderTicketEntities
;
import
com.liquidnet.service.kylin.entity.KylinOrderTicketRelations
;
import
com.liquidnet.service.kylin.entity.KylinOrderTicketStatus
;
import
com.liquidnet.service.kylin.entity.KylinOrderTickets
;
import
com.liquidnet.service.kylin.mapper.KylinOrderTicketEntitiesMapper
;
import
com.liquidnet.service.kylin.mapper.KylinOrderTicketRelationsMapper
;
import
com.liquidnet.service.kylin.mapper.KylinOrderTicketStatusMapper
;
import
com.liquidnet.service.kylin.mapper.KylinOrderTicketsMapper
;
import
com.liquidnet.service.kylin.entity.*
;
import
com.liquidnet.service.kylin.mapper.*
;
import
com.liquidnet.service.kylin.service.admin.IKylinPerformancesAdminService
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -36,6 +31,7 @@ import org.springframework.util.MultiValueMap;
import
java.math.BigDecimal
;
import
java.time.LocalDateTime
;
import
java.time.format.DateTimeFormatter
;
import
java.util.ArrayList
;
import
java.util.List
;
@Service
...
...
@@ -60,20 +56,36 @@ public class ImportServiceImpl implements IImportService {
private
KylinOrderTicketRelationsMapper
orderTicketRelationsMapper
;
@Autowired
private
KylinOrderTicketEntitiesMapper
orderTicketEntitiesMapper
;
@Autowired
private
KylinOrderImportMapper
orderImportMapper
;
/**
* 导入订单数据
*/
public
String
importOrderOutLine
(
String
performancesId
,
List
<
OrderOutLineVo
>
orderOutLineVoList
,
Boolean
updateSupport
,
String
oper
Name
)
{
public
String
importOrderOutLine
(
String
performancesId
,
List
<
OrderOutLineVo
>
orderOutLineVoList
,
Boolean
updateSupport
,
String
file
Name
)
{
if
(
StringUtils
.
isNull
(
orderOutLineVoList
)
||
orderOutLineVoList
.
size
()
==
0
)
{
throw
new
BusinessException
(
"导入用户数据不能为空!"
);
}
String
importId
=
IDGenerator
.
nextSnowId
();
KylinOrderImport
orderImport
=
new
KylinOrderImport
();
orderImport
.
setImportId
(
importId
);
orderImport
.
setPerformanceId
(
performancesId
);
orderImport
.
setStatus
(
0
);
orderImport
.
setTitle
(
fileName
);
orderImport
.
setAllCount
(
0
);
orderImport
.
setErrorCount
(
0
);
orderImport
.
setSuccessCount
(
0
);
orderImport
.
setCreatedAt
(
LocalDateTime
.
now
());
orderImportMapper
.
insert
(
orderImport
);
int
successNum
=
0
;
int
failureNum
=
0
;
StringBuilder
successMsg
=
new
StringBuilder
();
StringBuilder
failureMsg
=
new
StringBuilder
();
KylinPerformanceVo
performanceData
=
dataUtils
.
getPerformanceVo
(
performancesId
);
List
<
OrderOutLineVo
>
vos
=
new
ArrayList
();
for
(
OrderOutLineVo
orderOutLineVo
:
orderOutLineVoList
)
{
//获取账号维度数据
String
enterMobile
=
orderOutLineVo
.
getEnterMobile
();
...
...
@@ -116,6 +128,14 @@ public class ImportServiceImpl implements IImportService {
}
}
if
(
ticketData
==
null
)
{
KylinOrderImport
orderImportFinal
=
new
KylinOrderImport
();
orderImportFinal
.
setPerformanceId
(
performancesId
);
orderImportFinal
.
setStatus
(
2
);
orderImportFinal
.
setAllCount
(
failureNum
+
successNum
);
orderImportFinal
.
setErrorCount
(
failureNum
+
successNum
);
orderImportFinal
.
setSuccessCount
(
0
);
orderImportFinal
.
setUpdatedAt
(
LocalDateTime
.
now
());
orderImportMapper
.
update
(
orderImportFinal
,
Wrappers
.
lambdaUpdate
(
KylinOrderImport
.
class
).
eq
(
KylinOrderImport:
:
getImportId
,
importId
));
return
"演出数据错误"
;
}
// 获取限购 实名
...
...
@@ -134,12 +154,16 @@ public class ImportServiceImpl implements IImportService {
//快递票判断
if
(
ticketType
.
equals
(
"express"
))
{
if
(
address
.
isEmpty
())
{
return
"快递票未填写收货地址"
;
orderOutLineVo
.
setReason
(
"快递票未填写收货地址"
);
vos
.
add
(
orderOutLineVo
);
// return "快递票未填写收货地址";
}
}
//实名判断
if
(
isTrueName
==
1
&&
(
enterIdCode
.
isEmpty
()
||
enterName
.
isEmpty
()))
{
return
"实名票未填写入场人"
;
orderOutLineVo
.
setReason
(
"实名票未填写入场人"
);
vos
.
add
(
orderOutLineVo
);
// return "实名票未填写入场人";
}
//学生票 判断
...
...
@@ -147,7 +171,9 @@ public class ImportServiceImpl implements IImportService {
if
(
isStudent
==
1
)
{
int
age
=
IDCard
.
getAgeByIdCard
(
enterIdCode
);
if
(
age
>
25
)
{
return
"年龄不符合"
;
//年龄超了
orderOutLineVo
.
setReason
(
"年龄不符合"
);
vos
.
add
(
orderOutLineVo
);
// return "年龄不符合";//年龄超了
}
}
}
...
...
@@ -156,12 +182,14 @@ public class ImportServiceImpl implements IImportService {
if
(
isTrueName
==
1
)
{
String
res1
=
orderUtils
.
judgeOrderLimit
(
performanceData
.
getType
(),
uid
,
enterIdCode
,
performancesId
,
ticketData
.
getTicketsId
(),
performanceLimit
,
performanceMemberLimit
,
ticketLimit
,
ticketMemberLimit
,
1
,
1
,
0
,
isTrueName
);
if
(!
res1
.
equals
(
""
))
{
return
res1
;
//乱七八糟异常
vos
.
add
(
orderOutLineVo
);
// return res1;//乱七八糟异常
}
}
else
{
String
res1
=
orderUtils
.
judgeOrderLimit
(
performanceData
.
getType
(),
uid
,
""
,
performancesId
,
ticketData
.
getTicketsId
(),
performanceLimit
,
performanceMemberLimit
,
ticketLimit
,
ticketMemberLimit
,
number
,
number
,
0
,
isTrueName
);
if
(!
res1
.
equals
(
""
))
{
return
res1
;
//乱七八糟异常
vos
.
add
(
orderOutLineVo
);
// return res1;//乱七八糟异常
}
}
try
{
...
...
@@ -172,6 +200,17 @@ public class ImportServiceImpl implements IImportService {
failureNum
++;
}
}
KylinOrderImport
orderImportFinal
=
new
KylinOrderImport
();
orderImportFinal
.
setPerformanceId
(
performancesId
);
orderImportFinal
.
setStatus
(
1
);
orderImportFinal
.
setAllCount
(
failureNum
+
successNum
);
orderImportFinal
.
setErrorCount
(
failureNum
);
orderImportFinal
.
setSuccessCount
(
successNum
);
orderImportFinal
.
setUpdatedAt
(
LocalDateTime
.
now
());
orderImportMapper
.
update
(
orderImportFinal
,
Wrappers
.
lambdaUpdate
(
KylinOrderImport
.
class
).
eq
(
KylinOrderImport:
:
getImportId
,
importId
));
dataUtils
.
setOrderImportFail
(
importId
,
vos
);
if
(
failureNum
>
0
)
{
failureMsg
.
insert
(
0
,
"很抱歉,导入失败!共 "
+
failureNum
+
" 条数据格式不正确,错误如下:"
);
throw
new
BusinessException
(
failureMsg
.
toString
());
...
...
liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-zhengzai/src/main/java/com/liquidnet/client/admin/zhengzai/kylin/utils/DataUtils.java
View file @
c093ab30
package
com
.
liquidnet
.
client
.
admin
.
zhengzai
.
kylin
.
utils
;
import
com.liquidnet.client.admin.zhengzai.kylin.dto.OrderOutLineVo
;
import
com.liquidnet.common.cache.redis.util.RedisUtil
;
import
com.liquidnet.service.kylin.constant.KylinRedisConst
;
import
com.liquidnet.service.kylin.dto.vo.express.KylinOrderExpressVo
;
...
...
@@ -88,8 +89,8 @@ public class DataUtils {
* @param performanceId
* @param isTrueName
*/
public
void
setPerformanceIsTrueName
(
String
performanceId
,
int
isTrueName
)
{
redisUtil
.
set
(
KylinRedisConst
.
PERFORMANCES_TRUE_NAME
+
performanceId
,
isTrueName
);
public
void
setPerformanceIsTrueName
(
String
performanceId
,
int
isTrueName
)
{
redisUtil
.
set
(
KylinRedisConst
.
PERFORMANCES_TRUE_NAME
+
performanceId
,
isTrueName
);
}
/**
...
...
@@ -120,7 +121,7 @@ public class DataUtils {
List
<
KylinOrderListVo
>
voList
=
mongoTemplate
.
find
(
Query
.
query
(
Criteria
.
where
(
"userId"
).
is
(
userId
))
.
with
(
Sort
.
by
(
Sort
.
Direction
.
DESC
,
"createdAt"
)).
limit
(
40
),
KylinOrderListVo
.
class
,
KylinOrderTicketVo
.
class
.
getSimpleName
());
for
(
KylinOrderListVo
item
:
voList
){
for
(
KylinOrderListVo
item
:
voList
)
{
item
.
setStatus
(
item
.
getStatus
());
}
redisUtil
.
set
(
KylinRedisConst
.
ORDER_LIST
+
userId
,
voList
);
...
...
@@ -165,6 +166,7 @@ public class DataUtils {
/**
* 删除 验票账号 redis
*
* @param checkUserId
*/
public
void
delCheckUserRedis
(
String
checkUserId
)
{
...
...
@@ -173,6 +175,7 @@ public class DataUtils {
/**
* 删除 验票账号关系 vo
*
* @param checkUserId
*/
public
void
delCheckUserRelationRedis
(
String
checkUserId
)
{
...
...
@@ -204,7 +207,7 @@ public class DataUtils {
//删除redis
redisUtil
.
del
(
KylinRedisConst
.
PERFORMANCES
+
performanceIds
);
// 大龙相关 演出列表
redisUtil
.
del
(
KylinRedisConst
.
PERFORMANCES_LIST_CITYNAME
+
vo
.
getCityName
());
redisUtil
.
del
(
KylinRedisConst
.
PERFORMANCES_LIST_CITYNAME
+
vo
.
getCityName
());
redisUtil
.
del
(
KylinRedisConst
.
PERFORMANCES_ROADLIST
+
vo
.
getRoadShowId
());
redisUtil
.
del
(
KylinRedisConst
.
PERFORMANCES_LIST_SYSTEM_RECOMMEND
);
redisUtil
.
del
(
KylinRedisConst
.
PERFORMANCES_LIST_RECOMMEND
);
...
...
@@ -239,11 +242,11 @@ public class DataUtils {
*/
public
int
getPerformanceIsTrueName
(
String
performanceId
)
{
Object
obj
=
redisUtil
.
get
(
KylinRedisConst
.
PERFORMANCES_TRUE_NAME
+
performanceId
);
if
(
obj
!=
null
)
{
return
(
int
)
obj
;
}
else
{
if
(
obj
!=
null
)
{
return
(
int
)
obj
;
}
else
{
int
isTrueName
=
getPerformanceVo
(
performanceId
).
getIsTrueName
();
redisUtil
.
set
(
KylinRedisConst
.
PERFORMANCES_TRUE_NAME
+
performanceId
,
isTrueName
);
redisUtil
.
set
(
KylinRedisConst
.
PERFORMANCES_TRUE_NAME
+
performanceId
,
isTrueName
);
return
isTrueName
;
}
}
...
...
@@ -288,7 +291,7 @@ public class DataUtils {
if
(
buyCount
>
0
)
{
redisUtil
.
incr
(
ticketIdKey
,
buyCount
);
redisUtil
.
incr
(
performanceIdKey
,
buyCount
);
}
else
{
}
else
{
redisUtil
.
decr
(
ticketIdKey
,
Math
.
abs
(
buyCount
));
redisUtil
.
decr
(
performanceIdKey
,
Math
.
abs
(
buyCount
));
}
...
...
@@ -296,6 +299,7 @@ public class DataUtils {
/**
* 演出订单快递信息
*
* @param orderId
* @param kylinOrderExpressVo
*/
...
...
@@ -303,6 +307,7 @@ public class DataUtils {
String
redisKey
=
KylinRedisConst
.
ORDER_EXPRESS_INFO
.
concat
(
orderId
);
redisUtil
.
set
(
redisKey
,
kylinOrderExpressVo
);
}
public
void
delOrderExpressInfo
(
String
orderId
)
{
String
redisKey
=
KylinRedisConst
.
ORDER_EXPRESS_INFO
.
concat
(
orderId
);
redisUtil
.
del
(
redisKey
);
...
...
@@ -311,19 +316,19 @@ public class DataUtils {
/**
* 退款redis
*/
public
void
delOrderRefundVo
(
List
<
String
>
orderRefundIds
){
public
void
delOrderRefundVo
(
List
<
String
>
orderRefundIds
)
{
for
(
String
id
:
orderRefundIds
)
{
redisUtil
.
del
(
KylinRedisConst
.
ORDER_REFUND
.
concat
(
id
));
}
}
public
void
delOrderRefundVoByOrderId
(
List
<
String
>
orderIds
)
{
public
void
delOrderRefundVoByOrderId
(
List
<
String
>
orderIds
)
{
for
(
String
id
:
orderIds
)
{
redisUtil
.
del
(
KylinRedisConst
.
ORDER_REFUND_BY_ORDER_ID
.
concat
(
id
));
}
}
public
void
delOrderIdUserIdRedis
(
List
<
String
>
orderTicketIdList
,
List
<
String
>
userIdList
)
{
public
void
delOrderIdUserIdRedis
(
List
<
String
>
orderTicketIdList
,
List
<
String
>
userIdList
)
{
redisUtil
.
delList
(
orderTicketIdList
);
redisUtil
.
delList
(
userIdList
);
}
...
...
@@ -340,7 +345,7 @@ public class DataUtils {
if
(
value
instanceof
BigDecimal
)
{
ret
=
(
BigDecimal
)
value
;
}
else
if
(
value
instanceof
String
)
{
String
str
=
((
String
)
value
).
replace
(
"元"
,
""
);
String
str
=
((
String
)
value
).
replace
(
"元"
,
""
);
ret
=
new
BigDecimal
(
str
);
}
else
if
(
value
instanceof
BigInteger
)
{
ret
=
new
BigDecimal
((
BigInteger
)
value
);
...
...
@@ -388,4 +393,22 @@ public class DataUtils {
return
0
;
}
}
//设置 订单导入错误数据
public
void
setOrderImportFail
(
String
importId
,
List
<
OrderOutLineVo
>
vos
)
{
String
redisKey
=
KylinRedisConst
.
ORDER_IMPORT_FAIL
.
concat
(
importId
);
redisUtil
.
set
(
redisKey
,
vos
);
}
//获取 订单导入错误数据
public
List
<
OrderOutLineVo
>
getOrderImportFail
(
String
importId
)
{
String
redisKey
=
KylinRedisConst
.
ORDER_IMPORT_FAIL
.
concat
(
importId
);
Object
obj
=
redisUtil
.
get
(
redisKey
);
if
(
obj
==
null
)
{
return
new
ArrayList
();
}
else
{
return
(
List
<
OrderOutLineVo
>)
obj
;
}
}
}
liquidnet-bus-do/liquidnet-service-kylin-do/src/main/java/com/liquidnet/service/kylin/entity/KylinOrderImport.java
View file @
c093ab30
...
...
@@ -14,6 +14,8 @@ public class KylinOrderImport implements Serializable {
@TableId
(
value
=
"mid"
,
type
=
IdType
.
AUTO
)
private
Integer
mid
;
private
String
importId
;
/**
* performance_id
*/
...
...
@@ -25,10 +27,25 @@ public class KylinOrderImport implements Serializable {
private
String
title
;
/**
* status '状态
[10-转赠订单可失效
]'
* status '状态
[0-处理中|1处理完成|2处理失败
]'
*/
private
Integer
status
;
/**
* error_count 失败条数
*/
private
Integer
errorCount
;
/**
* success_count 成功条数
*/
private
Integer
successCount
;
/**
* all_count 总条数
*/
private
Integer
allCount
;
/**
* created_at
*/
...
...
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