记得上下班打卡 | git大法好,push需谨慎

Commit 00d73f09 authored by anjiabin's avatar anjiabin
parents dc406c1b 8d12e6ee
...@@ -5,9 +5,9 @@ import com.liquidnet.service.kylin.dto.vo.tmp.CourierListVo; ...@@ -5,9 +5,9 @@ import com.liquidnet.service.kylin.dto.vo.tmp.CourierListVo;
public interface DamaiService { public interface DamaiService {
//同步演出 //同步演出
ResponseDto<Boolean> sycPerformance(String performanceId); Boolean sycPerformance(String performanceId);
//同步场次 //同步场次
ResponseDto<Boolean> sycTimes(String timeId); Boolean sycTimes(String timeId);
//同步票 //同步票
ResponseDto<Boolean> sycTicket(String ticketId); Boolean sycTicket(String ticketId);
} }
...@@ -8,6 +8,7 @@ import com.liquidnet.client.admin.common.core.domain.AjaxResult; ...@@ -8,6 +8,7 @@ import com.liquidnet.client.admin.common.core.domain.AjaxResult;
import com.liquidnet.client.admin.common.core.page.TableDataInfo; import com.liquidnet.client.admin.common.core.page.TableDataInfo;
import com.liquidnet.client.admin.common.json.JSON; import com.liquidnet.client.admin.common.json.JSON;
import com.liquidnet.client.admin.zhengzai.kylin.dto.PerformanceOrderStatisCountResp; import com.liquidnet.client.admin.zhengzai.kylin.dto.PerformanceOrderStatisCountResp;
import com.liquidnet.client.admin.zhengzai.kylin.service.impl.KylinDamaiServiceImpl;
import com.liquidnet.client.admin.zhengzai.kylin.service.impl.KylinPerformancesAdminServiceImpl; import com.liquidnet.client.admin.zhengzai.kylin.service.impl.KylinPerformancesAdminServiceImpl;
import com.liquidnet.commons.lang.util.JsonUtils; import com.liquidnet.commons.lang.util.JsonUtils;
import com.liquidnet.service.kylin.dao.PerformanceAdminListDao; import com.liquidnet.service.kylin.dao.PerformanceAdminListDao;
...@@ -43,6 +44,9 @@ public class KylinPerformancesController extends BaseController { ...@@ -43,6 +44,9 @@ public class KylinPerformancesController extends BaseController {
@Autowired @Autowired
private KylinPerformancesAdminServiceImpl kylinPerformancesService; private KylinPerformancesAdminServiceImpl kylinPerformancesService;
@Autowired
private KylinDamaiServiceImpl damaiService;
@RequiresPermissions("kylin:performances:view") @RequiresPermissions("kylin:performances:view")
@GetMapping() @GetMapping()
public String performances() { public String performances() {
...@@ -161,4 +165,12 @@ public class KylinPerformancesController extends BaseController { ...@@ -161,4 +165,12 @@ public class KylinPerformancesController extends BaseController {
boolean result = kylinPerformancesService.changeSysDamai(data); boolean result = kylinPerformancesService.changeSysDamai(data);
return toAjax(result); return toAjax(result);
} }
@RequiresPermissions("kylin:performances:damai")
@PostMapping(value = "/sync/damai")
@ResponseBody
public AjaxResult syncDamai(@RequestParam("performancesId") String performancesId) {
boolean result = damaiService.sycPerformance(performancesId);
return toAjax(result);
}
} }
<!DOCTYPE html> <!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro"> <html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head> <head>
<th:block th:include="include :: header('演出列表')" /> <th:block th:include="include :: header('演出列表')"/>
</head> </head>
<body class="gray-bg"> <body class="gray-bg">
<div class="container-div"> <div class="container-div">
<div class="row"> <div class="row">
<div class="col-sm-12 search-collapse"> <div class="col-sm-12 search-collapse">
<form id="formId"> <form id="formId">
<div class="select-list"> <div class="select-list">
<ul> <ul>
<li> <li>
<label>演出名称:</label> <label>演出名称:</label>
<input type="text" name="title"/> <input type="text" name="title"/>
</li> </li>
<li> <li>
<label>城市名称:</label> <label>城市名称:</label>
<input type="text" name="cityName"/> <input type="text" name="cityName"/>
</li> </li>
<li> <li>
<label>排序字段:</label> <label>排序字段:</label>
<select name="orderItem"> <select name="orderItem">
<option value="">所有</option> <option value="">所有</option>
<option value="created_at">创建时间</option> <option value="created_at">创建时间</option>
<option value="updatedAt">修改时间</option> <option value="updatedAt">修改时间</option>
</select> </select>
</li> </li>
<li> <li>
<label>排序方式:</label> <label>排序方式:</label>
<select name="orderSc"> <select name="orderSc">
<option value="">所有</option> <option value="">所有</option>
<option value="asc">正序</option> <option value="asc">正序</option>
<option value="desc">倒序</option> <option value="desc">倒序</option>
</select> </select>
</li> </li>
<li> <li>
<label>演出状态:</label> <label>演出状态:</label>
<select name="status"> <select name="status">
<option value="-2">全部</option> <option value="-2">全部</option>
<option value="1">审核中</option> <option value="1">审核中</option>
<option value="3">审核通过</option> <option value="3">审核通过</option>
<option value="4">审核拒绝</option> <option value="4">审核拒绝</option>
<option value="6">售卖</option> <option value="6">售卖</option>
<option value="7">已下架</option> <option value="7">已下架</option>
<option value="8">演出结束</option> <option value="8">演出结束</option>
</select> </select>
</li> </li>
<li> <li>
<label>审核状态:</label> <label>审核状态:</label>
<select name="auditStatus"> <select name="auditStatus">
<option value="-2">全部</option> <option value="-2">全部</option>
<option value="0">审核中</option> <option value="0">审核中</option>
<option value="2">审核拒绝</option> <option value="2">审核拒绝</option>
</select> </select>
</li> </li>
<li> <li>
<label>停售时间:</label> <label>停售时间:</label>
<select name="stopSellDay"> <select name="stopSellDay">
<option value="-2">全部</option> <option value="-2">全部</option>
<option value="0">今天</option> <option value="0">今天</option>
<option value="1">明天</option> <option value="1">明天</option>
<option value="-1">昨天</option> <option value="-1">昨天</option>
</select> </select>
</li> </li>
<li> <li>
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a> <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a> class="fa fa-search"></i>&nbsp;搜索</a>
</li> <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i
</ul> class="fa fa-refresh"></i>&nbsp;重置</a>
</div> </li>
</form> </ul>
</div> </div>
</form>
</div>
<div class="btn-group-sm" id="toolbar" role="group"> <div class="btn-group-sm" id="toolbar" role="group">
<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="kylin:performances:add"> <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="kylin:performances:add">
<i class="fa fa-plus"></i> 添加 <i class="fa fa-plus"></i> 添加
</a> </a>
<a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="kylin:performances:edit"> <a class="btn btn-primary single disabled" onclick="$.operate.edit()"
<i class="fa fa-edit"></i> 修改 shiro:hasPermission="kylin:performances:edit">
</a> <i class="fa fa-edit"></i> 修改
<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="kylin:performances:remove"> </a>
<i class="fa fa-remove"></i> 删除 <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()"
</a> shiro:hasPermission="kylin:performances:remove">
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="kylin:performances:export"> <i class="fa fa-remove"></i> 删除
<i class="fa fa-download"></i> 导出 </a>
</a> <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="kylin:performances:export">
</div> <i class="fa fa-download"></i> 导出
<div class="col-sm-12 select-table table-bordered"> </a>
<table id="bootstrap-table"></table> </div>
</div> <div class="col-sm-12 select-table table-bordered">
<table id="bootstrap-table"></table>
</div> </div>
</div> </div>
<th:block th:include="include :: footer" /> </div>
<script th:inline="javascript"> <th:block th:include="include :: footer"/>
var detailFlag = [[${@permission.hasPermi('kylin:performances:detail')}]]; <script th:inline="javascript">
var expertFlag = [[${@permission.hasPermi('kylin:performances:expert')}]]; var detailFlag = [[${@permission.hasPermi('kylin:performances:detail')}]];
var prefix = ctx + "kylin/performances"; var expertFlag = [[${@permission.hasPermi('kylin:performances:expert')}]];
var prefix = ctx + "kylin/performances";
$(function() { $(function () {
var options = { var options = {
url: prefix + "/list", url: prefix + "/list",
detailUrl: prefix + "/details/{id}", detailUrl: prefix + "/details/{id}",
createUrl: prefix + "/add", createUrl: prefix + "/add",
updateUrl: prefix + "/edit/{id}", updateUrl: prefix + "/edit/{id}",
removeUrl: prefix + "/remove", removeUrl: prefix + "/remove",
exportUrl: prefix + "/export", exportUrl: prefix + "/export",
// sortName: "sort", // sortName: "sort",
modalName: "演出", modalName: "演出",
columns: [{ columns: [{
checkbox: true checkbox: true
}, },
{ {
field: 'title', field: 'title',
title: '演出名称' title: '演出名称'
...@@ -142,10 +146,6 @@ ...@@ -142,10 +146,6 @@
field: 'rejectTxt', field: 'rejectTxt',
title: '拒绝理由' title: '拒绝理由'
}, },
// {
// field: 'provinceName',
// title: '转增状态'
// },
{ {
field: 'sort', field: 'sort',
title: '排序', title: '排序',
...@@ -154,16 +154,24 @@ ...@@ -154,16 +154,24 @@
{ {
title: '操作', title: '操作',
align: 'center', align: 'center',
formatter: function(value, row, index) { formatter: function (value, row, index) {
var actions = []; var actions = [];
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> '); 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> ');
actions.push('<a class="btn btn-danger btn-xs ' + expertFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.mid + '\')"><i class="fa fa-remove"></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(''); return actions.join('');
} }
}] }]
}; };
$.table.init(options); $.table.init(options);
});
function f(id) {
$.post(prefix + "/sync/damai",{performancesId:id},function (res) {
alert(res.msg)
}); });
</script> }
</script>
</body> </body>
</html> </html>
\ No newline at end of file
...@@ -46,17 +46,17 @@ public class KylinDamaiServiceImpl extends ServiceImpl<KylinRoadShowsMapper, Kyl ...@@ -46,17 +46,17 @@ public class KylinDamaiServiceImpl extends ServiceImpl<KylinRoadShowsMapper, Kyl
@Override @Override
public ResponseDto<Boolean> sycPerformance(String performanceId) { public Boolean sycPerformance(String performanceId) {
return null; return false;
} }
@Override @Override
public ResponseDto<Boolean> sycTimes(String timeId) { public Boolean sycTimes(String timeId) {
return null; return false;
} }
@Override @Override
public ResponseDto<Boolean> sycTicket(String ticketId) { public Boolean sycTicket(String ticketId) {
return null; return false;
} }
} }
...@@ -19,6 +19,7 @@ public class PerformanceAdminListDao { ...@@ -19,6 +19,7 @@ public class PerformanceAdminListDao {
private Integer saleGeneral; private Integer saleGeneral;
private Integer totalSalePrice; private Integer totalSalePrice;
private Integer surplusGeneral; private Integer surplusGeneral;
private Integer syncDamai;
private String rejectTxt; private String rejectTxt;
private Integer sort; private Integer sort;
private String createdAt; private String createdAt;
......
...@@ -73,6 +73,11 @@ public class KylinOrderTickets implements Serializable { ...@@ -73,6 +73,11 @@ public class KylinOrderTickets implements Serializable {
*/ */
private String orderType; private String orderType;
/**
* 下单来源
*/
private String orderSource;
/** /**
* 下单版本 * 下单版本
*/ */
......
...@@ -34,6 +34,7 @@ ...@@ -34,6 +34,7 @@
<result column="sort" property="sort"/> <result column="sort" property="sort"/>
<result column="audit_time" property="auditTime"/> <result column="audit_time" property="auditTime"/>
<result column="sponsor" property="sponsor"/> <result column="sponsor" property="sponsor"/>
<result column="sync_damai" property="syncDamai"/>
<result column="created_at" property="createdAt"/> <result column="created_at" property="createdAt"/>
</resultMap> </resultMap>
...@@ -178,6 +179,7 @@ ...@@ -178,6 +179,7 @@
p.type, p.type,
p.time_start , p.time_start ,
p.time_end , p.time_end ,
ps.sync_damai ,
IFNULL(t.total_general , 0) AS 'total_general' , IFNULL(t.total_general , 0) AS 'total_general' ,
IFNULL(ot.sale_general , 0) AS 'sale_general' , IFNULL(ot.sale_general , 0) AS 'sale_general' ,
IFNULL(ot.total_sale_price , 0) AS 'total_sale_price' , IFNULL(ot.total_sale_price , 0) AS 'total_sale_price' ,
......
...@@ -419,6 +419,7 @@ CREATE TABLE `kylin_order_tickets` ...@@ -419,6 +419,7 @@ CREATE TABLE `kylin_order_tickets`
`pay_code` varchar(255) NOT NULL DEFAULT '' COMMENT '支付单号', `pay_code` varchar(255) NOT NULL DEFAULT '' COMMENT '支付单号',
`qr_code` varchar(255) NOT NULL DEFAULT '' COMMENT '二维码地址', `qr_code` varchar(255) NOT NULL DEFAULT '' COMMENT '二维码地址',
`order_type` varchar(255) NOT NULL DEFAULT '' COMMENT '下单方式', `order_type` varchar(255) NOT NULL DEFAULT '' COMMENT '下单方式',
`order_source` varchar(255) NOT NULL DEFAULT '' COMMENT '下单来源',
`order_version` varchar(255) NOT NULL DEFAULT '' COMMENT '下单版本', `order_version` varchar(255) NOT NULL DEFAULT '' COMMENT '下单版本',
`number` int(32) NOT NULL DEFAULT 0 COMMENT '数量', `number` int(32) NOT NULL DEFAULT 0 COMMENT '数量',
`price` decimal(8, 2) NOT NULL DEFAULT '0.00' COMMENT '单价', `price` decimal(8, 2) NOT NULL DEFAULT '0.00' COMMENT '单价',
......
...@@ -38,6 +38,7 @@ import java.util.*; ...@@ -38,6 +38,7 @@ import java.util.*;
import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentHashMap;
import java.util.function.Function; import java.util.function.Function;
import java.util.function.Predicate; import java.util.function.Predicate;
import java.util.regex.Pattern;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@Api(tags = "验票") @Api(tags = "验票")
...@@ -105,13 +106,15 @@ public class KylinStationController { ...@@ -105,13 +106,15 @@ public class KylinStationController {
@ApiOperation(value = "演出列表") @ApiOperation(value = "演出列表")
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "mod", value = "模块[recent-近期的,over-历史]", allowableValues = "recent,over"), @ApiImplicitParam(type = "form", required = true, dataType = "String", name = "mod", value = "模块[recent-近期的,over-历史]", allowableValues = "recent,over"),
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "match", value = "匹配字符[title|cityName|fieldName]"),
@ApiImplicitParam(type = "form", required = true, dataType = "Integer", name = "pageNo", value = "页码", example = "1"), @ApiImplicitParam(type = "form", required = true, dataType = "Integer", name = "pageNo", value = "页码", example = "1"),
@ApiImplicitParam(type = "form", required = true, dataType = "Integer", name = "pageSize", value = "页记录数", example = "5"), @ApiImplicitParam(type = "form", required = true, dataType = "Integer", name = "pageSize", value = "页记录数", example = "5"),
}) })
@GetMapping("performances") @GetMapping("performances")
public ResponseDto<PageInfo<KylinStationPerformanceVo>> performances(@RequestParam String mod, public ResponseDto<PageInfo<KylinStationPerformanceVo>> performances(@RequestParam String mod,
@RequestParam(defaultValue = "1", required = false) int pageNo, @RequestParam(required = false) String match,
@RequestParam(defaultValue = "5", required = false) int pageSize) { @RequestParam(defaultValue = "1", required = false) int pageNo,
@RequestParam(defaultValue = "5", required = false) int pageSize) {
List<KylinStationPerformanceVo> voList = new ArrayList<>(); List<KylinStationPerformanceVo> voList = new ArrayList<>();
String currentUid = CurrentUtil.getCurrentUid(); String currentUid = CurrentUtil.getCurrentUid();
long count = 0; long count = 0;
...@@ -124,25 +127,34 @@ public class KylinStationController { ...@@ -124,25 +127,34 @@ public class KylinStationController {
if (!CollectionUtils.isEmpty(performanceRelationList)) { if (!CollectionUtils.isEmpty(performanceRelationList)) {
LocalDateTime tmpDt = LocalDateTime.of(LocalDate.now(), LocalTime.of(0, 0, 0, 0)); LocalDateTime tmpDt = LocalDateTime.of(LocalDate.now(), LocalTime.of(0, 0, 0, 0));
String tmpDtStr = DateUtil.format(tmpDt, DateUtil.Formatter.yyyyMMddHHmmss); String tmpDtStr = DateUtil.format(tmpDt, DateUtil.Formatter.yyyyMMddHHmmss);
Query performancesVoQuery = Query.query(Criteria.where("performancesId").in( Criteria criteria = Criteria.where("performancesId").in(
performanceRelationList.stream().map(CheckPerformanceRelationParam::getPerformanceId).toArray() performanceRelationList.stream().map(CheckPerformanceRelationParam::getPerformanceId).toArray()
)); );
switch (mod) { switch (mod) {
case "recent": case "recent":
log.info(":::performances/recent:{}", currentUid); log.debug(":::performances/recent:{},match:{}", currentUid, match);
performancesVoQuery.addCriteria(Criteria.where("timeEnd").gt(tmpDtStr)); criteria.andOperator(Criteria.where("timeEnd").gt(tmpDtStr));
break; break;
// case "down": // case "down":
// log.info(":::performances/down:{}", currentUid); // log.info(":::performances/down:{}", currentUid);
// break; // break;
case "over": case "over":
log.info(":::performances/over:{}", currentUid); log.info(":::performances/over:{}", currentUid);
performancesVoQuery.addCriteria(Criteria.where("timeEnd").lte(tmpDtStr)); criteria.andOperator(Criteria.where("timeEnd").lte(tmpDtStr));
break; break;
default: default:
log.info(":::performances/default:{}", currentUid); log.info(":::performances/default:{}", currentUid);
return ResponseDto.success(new PageInfo<>()); return ResponseDto.success(new PageInfo<>());
} }
if (StringUtils.isNotBlank(match)) {
Pattern pattern = Pattern.compile("^.*" + match + ".*$", Pattern.CASE_INSENSITIVE);
criteria.orOperator(
Criteria.where("title").regex(pattern),
Criteria.where("cityName").regex(pattern),
Criteria.where("fieldName").regex(pattern)
);
}
Query performancesVoQuery = Query.query(criteria);
count = mongoTemplate.count(performancesVoQuery, KylinPerformanceVo.class.getSimpleName()); count = mongoTemplate.count(performancesVoQuery, KylinPerformanceVo.class.getSimpleName());
if (count <= 0) return ResponseDto.success(new PageInfo<>()); if (count <= 0) return ResponseDto.success(new PageInfo<>());
...@@ -178,6 +190,8 @@ public class KylinStationController { ...@@ -178,6 +190,8 @@ public class KylinStationController {
List<KylinStationTicketVo> ticketVoList = new ArrayList<>(); List<KylinStationTicketVo> ticketVoList = new ArrayList<>();
BigDecimal priceSum = BigDecimal.ZERO;
int number = 0, checkedNum = 0, remainderNum = 0;
for (Map.Entry<String, List<KylinOrderTicketEntitiesVo>> entry : performanceTicketEntitiesVoMap.entrySet()) { for (Map.Entry<String, List<KylinOrderTicketEntitiesVo>> entry : performanceTicketEntitiesVoMap.entrySet()) {
KylinTicketVo ticketVo = performanceTicketMap.get(entry.getKey()); KylinTicketVo ticketVo = performanceTicketMap.get(entry.getKey());
...@@ -200,9 +214,23 @@ public class KylinStationController { ...@@ -200,9 +214,23 @@ public class KylinStationController {
List<KylinOrderTicketEntitiesVo> remainderEntitiesVoList = subStatusPerformanceTicketEntitiesVoMap.get(0); List<KylinOrderTicketEntitiesVo> remainderEntitiesVoList = subStatusPerformanceTicketEntitiesVoMap.get(0);
stationTicketVo.setRemainderNum(CollectionUtils.isEmpty(remainderEntitiesVoList) ? 0 : remainderEntitiesVoList.size()); stationTicketVo.setRemainderNum(CollectionUtils.isEmpty(remainderEntitiesVoList) ? 0 : remainderEntitiesVoList.size());
number += stationTicketVo.getNumber();
checkedNum += stationTicketVo.getCheckedNum();
remainderNum += stationTicketVo.getRemainderNum();
priceSum = priceSum.add(stationTicketVo.getPriceSum());
ticketVoList.add(stationTicketVo); ticketVoList.add(stationTicketVo);
} }
KylinStationTicketVo sumTicketVo = KylinStationTicketVo.getNew();
sumTicketVo.setTicketId("TT");
sumTicketVo.setTitle("合计");
sumTicketVo.setPriceSum(priceSum);
sumTicketVo.setNumber(number);
sumTicketVo.setCheckedNum(checkedNum);
sumTicketVo.setRemainderNum(remainderNum);
ticketVoList.add(sumTicketVo);
r.setTicketVoList(ticketVoList); r.setTicketVoList(ticketVoList);
r.setCanDownTime(performanceRelationMap.get(r.getPerformancesId())); r.setCanDownTime(performanceRelationMap.get(r.getPerformancesId()));
}); });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment