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

Commit 53b86667 authored by 张国柄's avatar 张国柄

Merge remote-tracking branch 'origin/dev' into dev

parents 4375839e 9444f955
...@@ -13,9 +13,9 @@ ...@@ -13,9 +13,9 @@
<ul> <ul>
<li class="select-time"> <li class="select-time">
<label th:style="'width:120px'">请选择时间范围: </label> <label th:style="'width:120px'">请选择时间范围: </label>
<input th:field="${requestParam.timeBegin}" type="text" class="input-sm form-control" id="perStartTime" placeholder="开始日期" name="timeBegin"/> <input th:field="${requestParam.timeBegin}" type="text" class="input-sm form-control" id="startTime" placeholder="开始日期" name="timeBegin" required/>
<span>-</span> <span>-</span>
<input th:field="${requestParam.timeEnd}" type="text" class="input-sm form-control" id="perEndTime" placeholder="结束日期" name="timeEnd" readonly/> <input th:field="${requestParam.timeEnd}" type="text" class="input-sm form-control" id="endTime" placeholder="结束日期" name="timeEnd" required/>
</li> </li>
<li> <li>
<a class="btn btn-primary btn-rounded btn-sm" onclick="submit()"><i class="fa fa-search"></i>&nbsp;搜索</a> <a class="btn btn-primary btn-rounded btn-sm" onclick="submit()"><i class="fa fa-search"></i>&nbsp;搜索</a>
...@@ -275,65 +275,88 @@ ...@@ -275,65 +275,88 @@
var prefix = ctx + "kylin/performanceCalendar"; var prefix = ctx + "kylin/performanceCalendar";
var selectListUrl = ctx + "kylin/performanceCalendar/list"; var selectListUrl = ctx + "kylin/performanceCalendar/list";
function submit(){ function submit(){
var form = $("#formId"); if ($.validate.form()) {
form.action = selectListUrl; var form = $("#formId");
form.submit(); form.action = selectListUrl;
form.submit();
}
} }
$(function() {
<!-- laydate示例 -->
layui.use(['laydate'], function(){
var laydate = layui.laydate;
var monday = getMonday(new Date());
var mm = GetDateStr(monday,0);
var minSunday = GetDateStr(monday,6);
var maxSunday = GetDateStr(monday,7);
var startDate = laydate.render({
elem: '#perStartTime',
type:'date',
format: 'yyyy-MM-dd', //格式
min: mm, //最小可选择日期
range:false, //设置启用日期范围
// max: $('#perEndTime').val(),
// max: maxSunday,
theme: 'molv',
trigger: 'focus',
done: function(value, date) {
// 结束时间大于开始时间
if (value !== '') {
endDate.config.min.year = date.year;
endDate.config.min.month = date.month - 1;
endDate.config.min.date = date.date;
} else {
endDate.config.min.year = '';
endDate.config.min.month = '';
endDate.config.min.date = '';
}
}
});
var endDate = laydate.render({ var validate = $("#formId").validate({
elem: '#perEndTime', onkeyup: false,
min: $('#perStartTime').val(), rules:{
// max: maxSunday, timeBegin:{
theme: 'molv', required:true
trigger: 'focus', },
done: function(value, date) { timeEnd:{
// 开始时间小于结束时间 required:true
if (value !== '') { }
startDate.config.max.year = date.year; },
startDate.config.max.month = date.month - 1; messages:{
startDate.config.max.date = date.date; timeBegin: {
} else { required:"开始日期不为空!"
startDate.config.max.year = ''; },
startDate.config.max.month = ''; timeEnd:{
startDate.config.max.date = ''; required:"结束日期为空!"
} }
} }
}); });
}); // $(function() {
}); // <!-- laydate示例 -->
// layui.use(['laydate'], function(){
// var laydate = layui.laydate;
// var monday = getMonday(new Date());
// var mm = GetDateStr(monday,0);
// var minSunday = GetDateStr(monday,6);
// var maxSunday = GetDateStr(monday,7);
//
// var startDate = laydate.render({
// elem: '#perStartTime',
// type:'date',
// format: 'yyyy-MM-dd', //格式
// min: mm, //最小可选择日期
// range:false, //设置启用日期范围
// // max: $('#perEndTime').val(),
// // max: maxSunday,
// theme: 'molv',
// trigger: 'focus',
// done: function(value, date) {
// // 结束时间大于开始时间
// if (value !== '') {
// endDate.config.min.year = date.year;
// endDate.config.min.month = date.month - 1;
// endDate.config.min.date = date.date;
// } else {
// endDate.config.min.year = '';
// endDate.config.min.month = '';
// endDate.config.min.date = '';
// }
// }
// });
//
// var endDate = laydate.render({
// elem: '#perEndTime',
// min: $('#perStartTime').val(),
// // max: maxSunday,
// theme: 'molv',
// trigger: 'focus',
// done: function(value, date) {
// // 开始时间小于结束时间
// if (value !== '') {
// startDate.config.max.year = date.year;
// startDate.config.max.month = date.month - 1;
// startDate.config.max.date = date.date;
// } else {
// startDate.config.max.year = '';
// startDate.config.max.month = '';
// startDate.config.max.date = '';
// }
// }
// });
// });
// });
//获取当前日期的周一日期 //获取当前日期的周一日期
function getMonday( date ) { function getMonday( date ) {
var day = date.getDay() || 7; var day = date.getDay() || 7;
......
...@@ -34,9 +34,9 @@ ...@@ -34,9 +34,9 @@
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-2 control-label layui-required is-required">备注:</label> <label class="col-sm-2 control-label layui-required is-required">备注:</label>
<div class="col-sm-10"> <div class="col-sm-10">
<textarea name="reason" maxlength="500" class="form-control layui-required" rows="3"></textarea> <textarea name="reason" maxlength="500" class="form-control layui-required" rows="3"></textarea>
</div> </div>
</div> </div>
</form> </form>
...@@ -148,8 +148,9 @@ ...@@ -148,8 +148,9 @@
field: '', field: '',
title: '退款金额', title: '退款金额',
formatter: function (value, row, index) { formatter: function (value, row, index) {
var price = result.orderTicketVo.price; var canRefundedPrice = row.canRefundedPrice;
var html = '<input class="form-control entitiesPrice" type="number" min="0.01" max="'+price+'" name="entitiesPrice" value="'+price+'">'; var orderTicketEntitiesId = row.orderTicketEntitiesId;
var html = '<input id="' + orderTicketEntitiesId + '" class="form-control" type="number" min="0.01" max="' + canRefundedPrice + '" value="' + canRefundedPrice + '">';
return html; return html;
} }
}, },
...@@ -171,19 +172,25 @@ ...@@ -171,19 +172,25 @@
var reason = $('#form-post-add').find("[name='reason']").val(); var reason = $('#form-post-add').find("[name='reason']").val();
var orderTicketsId = $('#form-post-add').find("[name='orderTicketsId']").val(); var orderTicketsId = $('#form-post-add').find("[name='orderTicketsId']").val();
var rows = $.common.isEmpty(table.options.uniqueId) ? $.table.selectFirstColumns() : $.table.selectColumns(table.options.uniqueId); var rows = $.common.isEmpty(table.options.uniqueId) ? $.table.selectFirstColumns() : $.table.selectColumns(table.options.uniqueId);
if (!orderTicketsId || !reason || rows.length <= 0) { if (!orderTicketsId || !reason || rows.length <= 0) {
layer.msg("请完善数据"); layer.msg("请完善数据");
return false; return false;
} }
if ($.validate.form()) { if ($.validate.form()) {
var data = $('#form-post-add').serializeArray(); var data = $('#form-post-add').serializeArray();
data.push({"name":"ticketEntityIds","value":rows}); data.push({"name": "ticketEntityIds", "value": rows});
var entitiesPrice = $.table.selectColumns("price"); var entitiesPriceArray = [];
data.push({"name":"entitiesPrice","value":entitiesPrice}); for (i in rows) {
console.log(data) var idname = rows[i];
var entitiesPrice = $("#"+idname).val();
entitiesPriceArray.push(entitiesPrice);
}
data.push({"name": "entitiesPrice", "value": entitiesPriceArray});
$.operate.save(prefix + "/apply", data); $.operate.save(prefix + "/apply", data);
} }
} }
</script> </script>
</body> </body>
</html> </html>
...@@ -103,10 +103,13 @@ public class KylinOrderRefundsServiceImpl extends ServiceImpl<KylinOrderRefundsM ...@@ -103,10 +103,13 @@ public class KylinOrderRefundsServiceImpl extends ServiceImpl<KylinOrderRefundsM
} }
// TODO: 2021/6/16 是否能单独退快递飞 批量退款是否退快递费 现在做的是自动退剩余快递费 // TODO: 2021/6/16 是否能单独退快递飞 批量退款是否退快递费 现在做的是自动退剩余快递费
// 传的快递费不能大于实际的快递费=(支付的快递费-已退的快递费) // 传的快递费不能大于实际的快递费=(支付的快递费-已退的快递费)
double refundPriceExpressSum = kylinOrderRefundsMapper.RefundPriceExpressSum(// 已退快递费 Double refundPriceExpressSum = kylinOrderRefundsMapper.RefundPriceExpressSum(// 已退快递费
orderTicketsId, orderTicketsId,
KylinTableStatusConst.ORDER_REFUND_STATUS_CANCEL KylinTableStatusConst.ORDER_REFUND_STATUS_CANCEL
); );
if (null == refundPriceExpressSum) {
refundPriceExpressSum = 0.0;
}
if (null == refundApplyParam.getOrderRefundBatchesId() || refundApplyParam.getOrderRefundBatchesId().isEmpty()) { // 不是批量退款 if (null == refundApplyParam.getOrderRefundBatchesId() || refundApplyParam.getOrderRefundBatchesId().isEmpty()) { // 不是批量退款
if (RefundPriceExpress > (priceExpress - refundPriceExpressSum)) { if (RefundPriceExpress > (priceExpress - refundPriceExpressSum)) {
return ResponseDto.failure("快递费不能大于实际减去已退的快递费"); return ResponseDto.failure("快递费不能大于实际减去已退的快递费");
...@@ -145,7 +148,7 @@ public class KylinOrderRefundsServiceImpl extends ServiceImpl<KylinOrderRefundsM ...@@ -145,7 +148,7 @@ public class KylinOrderRefundsServiceImpl extends ServiceImpl<KylinOrderRefundsM
double onePrice = (priceActual - priceExpress) / allEntitiesCount;//单价 double onePrice = (priceActual - priceExpress) / allEntitiesCount;//单价
List<Double> realRefundPriceList = new ArrayList<>(); List<Double> realRefundPriceList = new ArrayList<>();
if (null == refundApplyParam.getOrderRefundBatchesId() || refundApplyParam.getOrderRefundBatchesId().isEmpty()) { // 不是批量退款 if (null == refundApplyParam.getOrderRefundBatchesId() || refundApplyParam.getOrderRefundBatchesId().isEmpty()) { // 不是批量退款
for (int i = 0; i <= ticketEntityIds.size(); i++) { for (int i = 0; i <= ticketEntityIds.size() -1; i++) {
Double price = entitiesPrice.get(i); Double price = entitiesPrice.get(i);
if (price < 0) { if (price < 0) {
return ResponseDto.failure("退款金额不能为0"); return ResponseDto.failure("退款金额不能为0");
...@@ -155,6 +158,9 @@ public class KylinOrderRefundsServiceImpl extends ServiceImpl<KylinOrderRefundsM ...@@ -155,6 +158,9 @@ public class KylinOrderRefundsServiceImpl extends ServiceImpl<KylinOrderRefundsM
KylinTableStatusConst.ORDER_REFUND_STATUS_CANCEL, KylinTableStatusConst.ORDER_REFUND_STATUS_CANCEL,
ticketEntityIds.get(i) ticketEntityIds.get(i)
); );
if (null == refundedPrice) {
refundedPrice = 0.0;
}
if (price > (onePrice - refundedPrice)) { if (price > (onePrice - refundedPrice)) {
return ResponseDto.failure("超过可退款金额"); return ResponseDto.failure("超过可退款金额");
} }
...@@ -162,12 +168,15 @@ public class KylinOrderRefundsServiceImpl extends ServiceImpl<KylinOrderRefundsM ...@@ -162,12 +168,15 @@ public class KylinOrderRefundsServiceImpl extends ServiceImpl<KylinOrderRefundsM
} }
realRefundPriceList = entitiesPrice; realRefundPriceList = entitiesPrice;
} else { // 批量 计算入场人订单可退金额 } else { // 批量 计算入场人订单可退金额
for (int i = 0; i <= ticketEntityIds.size(); i++) { for (int i = 0; i <= ticketEntityIds.size() - 1; i++) {
Double refundedPrice = kylinOrderTicketEntitiesMapper.getRefundEntitiesPrice(//已退 包含退款中 Double refundedPrice = kylinOrderTicketEntitiesMapper.getRefundEntitiesPrice(//已退 包含退款中
orderTicketsId, orderTicketsId,
KylinTableStatusConst.ORDER_REFUND_STATUS_CANCEL, KylinTableStatusConst.ORDER_REFUND_STATUS_CANCEL,
ticketEntityIds.get(i) ticketEntityIds.get(i)
); );
if (null == refundedPrice) {
refundedPrice = 0.0;
}
Double price = onePrice - refundedPrice; // 计算可退金额 Double price = onePrice - refundedPrice; // 计算可退金额
realRefundPriceList.add(price); realRefundPriceList.add(price);
} }
...@@ -378,12 +387,17 @@ public class KylinOrderRefundsServiceImpl extends ServiceImpl<KylinOrderRefundsM ...@@ -378,12 +387,17 @@ public class KylinOrderRefundsServiceImpl extends ServiceImpl<KylinOrderRefundsM
); );
double onePrice = (priceActual - priceExpress) / allEntitiesCount;//单价 double onePrice = (priceActual - priceExpress) / allEntitiesCount;//单价
for (KylinOrderTicketEntitiesDao entities : entitiesList) { for (KylinOrderTicketEntitiesDao entities : entitiesList) {
double refundedPrice = kylinOrderTicketEntitiesMapper.getRefundEntitiesPrice(//已退 包含退款中 Double refundedPrice = kylinOrderTicketEntitiesMapper.getRefundEntitiesPrice(//已退 包含退款中
kylinOrderTickets.getOrderTicketsId(), kylinOrderTickets.getOrderTicketsId(),
KylinTableStatusConst.ORDER_REFUND_STATUS_CANCEL, KylinTableStatusConst.ORDER_REFUND_STATUS_CANCEL,
entities.getOrderTicketEntitiesId() entities.getOrderTicketEntitiesId()
); );
double canRefundedPrice = onePrice - refundedPrice; double canRefundedPrice;
if (null != refundedPrice) {
canRefundedPrice = onePrice - refundedPrice;
} else {
canRefundedPrice = onePrice;
}
entities.setCanRefundedPrice(BigDecimal.valueOf(canRefundedPrice)); entities.setCanRefundedPrice(BigDecimal.valueOf(canRefundedPrice));
} }
} }
......
...@@ -168,7 +168,7 @@ public class KylinRefundsStatusServiceImpl { ...@@ -168,7 +168,7 @@ public class KylinRefundsStatusServiceImpl {
// 退款入场人表 // 退款入场人表
KylinOrderRefundEntities kylinOrderRefundEntities = new KylinOrderRefundEntities(); KylinOrderRefundEntities kylinOrderRefundEntities = new KylinOrderRefundEntities();
for (int i = 0; i <= ticketEntityIds.size(); i++) { for (int i = 0; i <= ticketEntityIds.size() - 1; i++) {
String orderRefundsEntitiesId = IDGenerator.nextSnowId().toString(); String orderRefundsEntitiesId = IDGenerator.nextSnowId().toString();
kylinOrderRefundEntities.setOrderRefundsEntitiesId(orderRefundsEntitiesId); kylinOrderRefundEntities.setOrderRefundsEntitiesId(orderRefundsEntitiesId);
kylinOrderRefundEntities.setOrderRefundsId(orderRefundsId); kylinOrderRefundEntities.setOrderRefundsId(orderRefundsId);
...@@ -379,6 +379,9 @@ public class KylinRefundsStatusServiceImpl { ...@@ -379,6 +379,9 @@ public class KylinRefundsStatusServiceImpl {
KylinTableStatusConst.ORDER_REFUND_STATUS_REFUNDED, KylinTableStatusConst.ORDER_REFUND_STATUS_REFUNDED,
entitiesId entitiesId
); );
if (null == refundedPrice) {
refundedPrice = 0.0;
}
KylinOrderRefundEntities refundEntitiesInfo = kylinOrderRefundsEntitiesMapper.selectOne( KylinOrderRefundEntities refundEntitiesInfo = kylinOrderRefundsEntitiesMapper.selectOne(
new QueryWrapper<KylinOrderRefundEntities>() new QueryWrapper<KylinOrderRefundEntities>()
.eq("order_refunds_id", refundInfo.getOrderRefundsId()) .eq("order_refunds_id", refundInfo.getOrderRefundsId())
......
...@@ -2,9 +2,11 @@ package com.liquidnet.client.admin.zhengzai.kylin.utils; ...@@ -2,9 +2,11 @@ package com.liquidnet.client.admin.zhengzai.kylin.utils;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.core.type.TypeReference;
import com.liquidnet.common.cache.redis.util.RedisUtil;
import com.liquidnet.commons.lang.util.DateUtil; import com.liquidnet.commons.lang.util.DateUtil;
import com.liquidnet.commons.lang.util.IDGenerator; import com.liquidnet.commons.lang.util.IDGenerator;
import com.liquidnet.commons.lang.util.JsonUtils; import com.liquidnet.commons.lang.util.JsonUtils;
import com.liquidnet.service.kylin.constant.KylinRedisConst;
import com.liquidnet.service.kylin.dto.param.PerformancePartnerVo; import com.liquidnet.service.kylin.dto.param.PerformancePartnerVo;
import com.liquidnet.service.kylin.dto.vo.middle.KylinBuyNoticeVo; import com.liquidnet.service.kylin.dto.vo.middle.KylinBuyNoticeVo;
import com.liquidnet.service.kylin.dto.vo.middle.KylinTicketTimesVo; import com.liquidnet.service.kylin.dto.vo.middle.KylinTicketTimesVo;
...@@ -47,6 +49,8 @@ public class PerformanceVoUtils { ...@@ -47,6 +49,8 @@ public class PerformanceVoUtils {
private DataUtils dataUtils; private DataUtils dataUtils;
@Autowired @Autowired
private MongoVoUtils mongoVoUtils; private MongoVoUtils mongoVoUtils;
@Autowired
private RedisUtil redisUtil;
@Autowired @Autowired
private KylinPerformancesMapper performancesMapper; private KylinPerformancesMapper performancesMapper;
...@@ -226,6 +230,8 @@ public class PerformanceVoUtils { ...@@ -226,6 +230,8 @@ public class PerformanceVoUtils {
KylinPerformanceRelations performanceRelations = new KylinPerformanceRelations(); KylinPerformanceRelations performanceRelations = new KylinPerformanceRelations();
BeanUtils.copyProperties(performanceUpdateMisVo, performanceRelations); BeanUtils.copyProperties(performanceUpdateMisVo, performanceRelations);
performances.setCityName((String) redisUtil.hget(KylinRedisConst.FIELDS + ":" + performanceRelations.getFieldId(), "city_name"));
performances.setCityId(Integer.parseInt((String) redisUtil.hget(KylinRedisConst.FIELDS + ":" + performanceRelations.getFieldId(), "city_id")));
performances.setCreatedAt(DateUtil.asLocalDateTime(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(performanceUpdateMisVo.getCreatedAt()))); performances.setCreatedAt(DateUtil.asLocalDateTime(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(performanceUpdateMisVo.getCreatedAt())));
performances.setTimeStart(DateUtil.asLocalDateTime(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(performanceUpdateMisVo.getTimeStart()))); performances.setTimeStart(DateUtil.asLocalDateTime(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(performanceUpdateMisVo.getTimeStart())));
performances.setTimeEnd(DateUtil.asLocalDateTime(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(performanceUpdateMisVo.getTimeEnd()))); performances.setTimeEnd(DateUtil.asLocalDateTime(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(performanceUpdateMisVo.getTimeEnd())));
......
...@@ -22,14 +22,14 @@ public class PerformanceOrderStatisticalDao { ...@@ -22,14 +22,14 @@ public class PerformanceOrderStatisticalDao {
private BigDecimal price; private BigDecimal price;
private Integer type; private Integer type;
private LocalDateTime useStart; private LocalDateTime useStart;
private BigDecimal totalGeneral; private BigDecimal totalGeneral = BigDecimal.ZERO;
private BigDecimal saleGeneral; private BigDecimal saleGeneral = BigDecimal.ZERO;
private BigDecimal surplusGeneral; private BigDecimal surplusGeneral = BigDecimal.ZERO;
private BigDecimal totalSalePrice; private BigDecimal totalSalePrice = BigDecimal.ZERO;
private BigDecimal totalExchange; private BigDecimal totalExchange = BigDecimal.ZERO;
private BigDecimal totalRefundGeneral; private BigDecimal totalRefundGeneral = BigDecimal.ZERO;
private BigDecimal totalRefundPrice; private BigDecimal totalRefundPrice = BigDecimal.ZERO;
private BigDecimal totalMemberNumber; private BigDecimal totalMemberNumber = BigDecimal.ZERO;
private BigDecimal totalPayingNumber; private BigDecimal totalPayingNumber = BigDecimal.ZERO;
private BigDecimal totalBuyUsers; private BigDecimal totalBuyUsers = BigDecimal.ZERO;
} }
...@@ -35,7 +35,7 @@ public interface KylinOrderRefundsMapper extends BaseMapper<KylinOrderRefunds> { ...@@ -35,7 +35,7 @@ public interface KylinOrderRefundsMapper extends BaseMapper<KylinOrderRefunds> {
@Param("ticketEntityIds") List<String> ticketEntityIds @Param("ticketEntityIds") List<String> ticketEntityIds
); );
double RefundPriceExpressSum( Double RefundPriceExpressSum(
@Param("orderTicketsId") String orderTicketsId, @Param("orderTicketsId") String orderTicketsId,
@Param("orderRefundStatusCancel") Integer orderRefundStatusCancel @Param("orderRefundStatusCancel") Integer orderRefundStatusCancel
); );
......
...@@ -149,17 +149,16 @@ ...@@ -149,17 +149,16 @@
) AS t ON p.performances_id = t.performance_id ) AS t ON p.performances_id = t.performance_id
LEFT JOIN( LEFT JOIN(
SELECT SELECT
sum(ot.number) AS 'sale_general' , (sum(ot.number)- sum(ot.refund_number)) AS 'sale_general' ,
sum(ot.price_actual) AS 'total_sale_price' , (sum(ot.price_actual) - sum(ot.price_refund)) AS 'total_sale_price' ,
ote.performance_id AS 'performance_id' otr.performance_id AS 'performance_id'
FROM FROM
kylin_order_tickets AS ot kylin_order_tickets AS ot
LEFT JOIN kylin_order_ticket_status AS ots ON ots.order_id = ot.order_tickets_id LEFT JOIN kylin_order_ticket_status AS ots ON ots.order_id = ot.order_tickets_id
LEFT JOIN kylin_order_ticket_entities AS ote ON ote.order_id = ot.order_tickets_id LEFT JOIN kylin_order_ticket_relations AS otr ON otr.order_id = ot.order_tickets_id
WHERE WHERE
ots.`status` = 0 ots.`status` = 1 and coupon_type ='no'
OR ots.`status` = 1 GROUP BY otr.performance_id
GROUP BY ote.performance_id
) AS ot ON ot.performance_id = p.performances_id ) AS ot ON ot.performance_id = p.performances_id
<where> <where>
<if test="title!=''"> <if test="title!=''">
...@@ -228,17 +227,16 @@ ...@@ -228,17 +227,16 @@
) AS t ON p.performances_id = t.performance_id ) AS t ON p.performances_id = t.performance_id
LEFT JOIN( LEFT JOIN(
SELECT SELECT
sum(ot.number) AS 'sale_general' , (sum(ot.number)- sum(ot.refund_number)) AS 'sale_general' ,
sum(ot.price_actual) AS 'total_sale_price' , (sum(ot.price_actual) - sum(ot.price_refund)) AS 'total_sale_price' ,
ote.performance_id AS 'performance_id' otr.performance_id AS 'performance_id'
FROM FROM
kylin_order_tickets AS ot kylin_order_tickets AS ot
LEFT JOIN kylin_order_ticket_status AS ots ON ots.order_id = ot.order_tickets_id LEFT JOIN kylin_order_ticket_status AS ots ON ots.order_id = ot.order_tickets_id
LEFT JOIN kylin_order_ticket_entities AS ote ON ote.order_id = ot.order_tickets_id LEFT JOIN kylin_order_ticket_relations AS otr ON otr.order_id = ot.order_tickets_id
WHERE WHERE
ots.`status` = 0 ots.`status` = 1 and coupon_type ='no'
OR ots.`status` = 1 GROUP BY otr.performance_id
GROUP BY ote.performance_id
) AS ot ON ot.performance_id = p.performances_id ) AS ot ON ot.performance_id = p.performances_id
<where> <where>
<if test="title!=''"> <if test="title!=''">
...@@ -381,7 +379,7 @@ ...@@ -381,7 +379,7 @@
(select t.performances_id from kylin_performances t where t.performances_id = ${performancesId}) AS kp (select t.performances_id from kylin_performances t where t.performances_id = ${performancesId}) AS kp
inner JOIN( inner JOIN(
SELECT SELECT
kote.performance_id AS 'performance_id', kotr.performance_id AS 'performance_id',
kotr.ticket_id, kotr.ticket_id,
sum(kot.number) AS 'total_sale_general' , sum(kot.number) AS 'total_sale_general' ,
sum(kot.price_actual) AS 'total_sale_price', sum(kot.price_actual) AS 'total_sale_price',
...@@ -391,26 +389,24 @@ ...@@ -391,26 +389,24 @@
sum(case when kots.`status` = 0 then kot.number else 0 end) total_paying_number sum(case when kots.`status` = 0 then kot.number else 0 end) total_paying_number
FROM FROM
kylin_order_ticket_relations kotr kylin_order_ticket_relations kotr
inner join kylin_order_tickets AS kot on kotr.ticket_id = kot.order_tickets_id inner join kylin_order_tickets AS kot on kotr.order_id = kot.order_tickets_id
inner JOIN kylin_order_ticket_status AS kots ON kots.order_id = kot.order_tickets_id inner JOIN kylin_order_ticket_status AS kots ON kots.order_id = kot.order_tickets_id
inner JOIN kylin_order_ticket_entities AS kote ON kote.order_id = kot.order_tickets_id
WHERE kotr.performance_id = ${performancesId} and (kots.`status` = 0 OR kots.`status` = 1) WHERE kotr.performance_id = ${performancesId} and (kots.`status` = 0 OR kots.`status` = 1)
) AS ot ON ot.performance_id = kp.performances_id ) AS ot ON ot.performance_id = kp.performances_id
inner join kylin_tickets kt on kt.tickets_id = ot.ticket_id inner join kylin_tickets kt on kt.tickets_id = ot.ticket_id
inner join kylin_ticket_status kts on kts.ticket_id = kt.tickets_id inner join kylin_ticket_status kts on kts.ticket_id = kt.tickets_id
inner JOIN( inner JOIN(
select t.performance_id,count(t.user_id) as 'total_buy_users' from( select t.performance_id,count(t.user_id) as 'total_buy_users' from(
SELECT SELECT
kotr.performance_id, kotr.performance_id,
kot.user_id kot.user_id
FROM FROM
kylin_order_ticket_relations kotr kylin_order_ticket_relations kotr
inner join kylin_order_tickets AS kot on kotr.ticket_id = kot.order_tickets_id inner join kylin_order_tickets AS kot on kotr.order_id = kot.order_tickets_id
inner JOIN kylin_order_ticket_status AS kots ON kots.order_id = kot.order_tickets_id inner JOIN kylin_order_ticket_status AS kots ON kots.order_id = kot.order_tickets_id
inner JOIN kylin_order_ticket_entities AS kote ON kote.order_id = kot.order_tickets_id WHERE kotr.performance_id = ${performancesId} and (kots.`status` = 0 OR kots.`status` = 1)
WHERE kotr.performance_id = ${performancesId} and (kots.`status` = 0 OR kots.`status` = 1) group by kotr.performance_id,kot.user_id
group by kotr.performance_id,kot.user_id ) t
) t
) AS ut ON ut.performance_id = kp.performances_id ) AS ut ON ut.performance_id = kp.performances_id
</select> </select>
<select id="orderList" resultMap="performanceOrderListDaoResult"> <select id="orderList" resultMap="performanceOrderListDaoResult">
......
...@@ -25,4 +25,12 @@ public class DataController { ...@@ -25,4 +25,12 @@ public class DataController {
Boolean result = data.performance(); Boolean result = data.performance();
return ResponseDto.success(result); return ResponseDto.success(result);
} }
@PostMapping("order")
@ApiOperation("订单数据迁移")
public ResponseDto<Boolean> order(int month) {
Boolean result = data.order(month);
return ResponseDto.success(result);
}
} }
...@@ -383,12 +383,12 @@ public class KylinOrderTicketsServiceImpl extends ServiceImpl<KylinOrderTicketsM ...@@ -383,12 +383,12 @@ public class KylinOrderTicketsServiceImpl extends ServiceImpl<KylinOrderTicketsM
//生成票 //生成票
KylinOrderTicketEntities orderTicketEntities = new KylinOrderTicketEntities(); KylinOrderTicketEntities orderTicketEntities = new KylinOrderTicketEntities();
String orderTicketEntitiesId = IDGenerator.nextSnowId().toString();
LinkedList<Object[]> sqlsDataD = null; LinkedList<Object[]> sqlsDataD = null;
sqlsDataD = new LinkedList<Object[]>(); sqlsDataD = new LinkedList<Object[]>();
sqls.add(SqlMapping.get("kylin_order_ticket_entities.add")); sqls.add(SqlMapping.get("kylin_order_ticket_entities.add"));
if (isTrueName == 1) { if (isTrueName == 1) {
for (AdamEntersVo enters : entersVoList) { for (AdamEntersVo enters : entersVoList) {
String orderTicketEntitiesId = IDGenerator.nextSnowId().toString();
orderTicketEntities.setOrderTicketEntitiesId(orderTicketEntitiesId); orderTicketEntities.setOrderTicketEntitiesId(orderTicketEntitiesId);
orderTicketEntities.setOrderId(orderTicketId); orderTicketEntities.setOrderId(orderTicketId);
orderTicketEntities.setTicketId(payOrderParam.getTicketId()); orderTicketEntities.setTicketId(payOrderParam.getTicketId());
...@@ -424,6 +424,7 @@ public class KylinOrderTicketsServiceImpl extends ServiceImpl<KylinOrderTicketsM ...@@ -424,6 +424,7 @@ public class KylinOrderTicketsServiceImpl extends ServiceImpl<KylinOrderTicketsM
} }
} else { } else {
for (int i = 0; i < payOrderParam.getNumber(); i++) { for (int i = 0; i < payOrderParam.getNumber(); i++) {
String orderTicketEntitiesId = IDGenerator.nextSnowId().toString();
orderTicketEntities.setOrderTicketEntitiesId(orderTicketEntitiesId); orderTicketEntities.setOrderTicketEntitiesId(orderTicketEntitiesId);
orderTicketEntities.setOrderId(orderTicketId); orderTicketEntities.setOrderId(orderTicketId);
orderTicketEntities.setTicketId(payOrderParam.getTicketId()); orderTicketEntities.setTicketId(payOrderParam.getTicketId());
......
...@@ -116,6 +116,9 @@ public class KylinRefundsStatusServiceImpl { ...@@ -116,6 +116,9 @@ public class KylinRefundsStatusServiceImpl {
KylinTableStatusConst.ORDER_REFUND_STATUS_REFUNDED, KylinTableStatusConst.ORDER_REFUND_STATUS_REFUNDED,
entitiesId entitiesId
); );
if (null == refundedPrice) {
refundedPrice = 0.0;
}
KylinOrderRefundEntities refundEntitiesInfo = kylinOrderRefundsEntitiesMapper.selectOne( KylinOrderRefundEntities refundEntitiesInfo = kylinOrderRefundsEntitiesMapper.selectOne(
new QueryWrapper<KylinOrderRefundEntities>() new QueryWrapper<KylinOrderRefundEntities>()
.eq("order_refunds_id", refundInfo.getOrderRefundsId()) .eq("order_refunds_id", refundInfo.getOrderRefundsId())
...@@ -293,7 +296,7 @@ public class KylinRefundsStatusServiceImpl { ...@@ -293,7 +296,7 @@ public class KylinRefundsStatusServiceImpl {
// 退款入场人表 // 退款入场人表
KylinOrderRefundEntities kylinOrderRefundEntities = new KylinOrderRefundEntities(); KylinOrderRefundEntities kylinOrderRefundEntities = new KylinOrderRefundEntities();
for (int i = 0; i <= ticketEntityIds.size(); i++) { for (int i = 0; i <= ticketEntityIds.size() - 1; i++) {
String orderRefundsEntitiesId = IDGenerator.nextSnowId().toString(); String orderRefundsEntitiesId = IDGenerator.nextSnowId().toString();
kylinOrderRefundEntities.setOrderRefundsEntitiesId(orderRefundsEntitiesId); kylinOrderRefundEntities.setOrderRefundsEntitiesId(orderRefundsEntitiesId);
kylinOrderRefundEntities.setOrderRefundsId(orderRefundsId); kylinOrderRefundEntities.setOrderRefundsId(orderRefundsId);
......
package com.liquidnet.service.kylin.timerTask; package com.liquidnet.service.kylin.timerTask;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.liquidnet.common.cache.redis.util.RedisUtil;
import com.liquidnet.commons.lang.util.DateUtil; import com.liquidnet.commons.lang.util.DateUtil;
import com.liquidnet.commons.lang.util.IDGenerator; import com.liquidnet.commons.lang.util.IDGenerator;
import com.liquidnet.commons.lang.util.JsonUtils; import com.liquidnet.commons.lang.util.JsonUtils;
import com.liquidnet.service.kylin.constant.KylinRedisConst;
import com.liquidnet.service.kylin.dto.param.PerformancePartnerVo; import com.liquidnet.service.kylin.dto.param.PerformancePartnerVo;
import com.liquidnet.service.kylin.dto.vo.middle.KylinTicketTimesVo; import com.liquidnet.service.kylin.dto.vo.middle.KylinTicketTimesVo;
import com.liquidnet.service.kylin.dto.vo.middle.KylinTicketVo; import com.liquidnet.service.kylin.dto.vo.middle.KylinTicketVo;
...@@ -48,6 +50,8 @@ public class PerformanceVoTask { ...@@ -48,6 +50,8 @@ public class PerformanceVoTask {
@Autowired @Autowired
private DataUtils dataUtils; private DataUtils dataUtils;
@Autowired @Autowired
private RedisUtil redisUtil;
@Autowired
private MongoVoUtils mongoVoUtils; private MongoVoUtils mongoVoUtils;
@Autowired @Autowired
...@@ -239,6 +243,8 @@ public class PerformanceVoTask { ...@@ -239,6 +243,8 @@ public class PerformanceVoTask {
performances.setCreatedAt(DateUtil.asLocalDateTime(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(kylinPerformanceMisVo.getCreatedAt()))); performances.setCreatedAt(DateUtil.asLocalDateTime(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(kylinPerformanceMisVo.getCreatedAt())));
performances.setTimeStart(DateUtil.asLocalDateTime(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(kylinPerformanceMisVo.getTimeStart()))); performances.setTimeStart(DateUtil.asLocalDateTime(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(kylinPerformanceMisVo.getTimeStart())));
performances.setTimeEnd(DateUtil.asLocalDateTime(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(kylinPerformanceMisVo.getTimeEnd()))); performances.setTimeEnd(DateUtil.asLocalDateTime(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(kylinPerformanceMisVo.getTimeEnd())));
performances.setCityName((String) redisUtil.hget(KylinRedisConst.FIELDS + ":" + performanceRelations.getFieldId(), "city_name"));
performances.setCityId(Integer.parseInt((String) redisUtil.hget(KylinRedisConst.FIELDS + ":" + performanceRelations.getFieldId(), "city_id")));
performances.setUpdatedAt(updatedAt); performances.setUpdatedAt(updatedAt);
performanceStatus.setPerformanceId(performances.getPerformancesId()); performanceStatus.setPerformanceId(performances.getPerformancesId());
......
...@@ -55,7 +55,7 @@ public class MongoVoUtils { ...@@ -55,7 +55,7 @@ public class MongoVoUtils {
//场地相关数据 //场地相关数据
KylinFields fields = new KylinFields(); KylinFields fields = new KylinFields();
String cityName = (String) redisUtil.hget(KylinRedisConst.FIELDS + ":" + p3.getFieldId(), "city_name"); String cityName = (String) redisUtil.hget(KylinRedisConst.FIELDS + ":" + p3.getFieldId(), "city_name");
fields.setCityId(null); fields.setCityId(Integer.parseInt((String) redisUtil.hget(KylinRedisConst.FIELDS + ":" + p3.getFieldId(), "city_id")));
fields.setLatitude((String) redisUtil.hget(KylinRedisConst.FIELDS + ":" + p3.getFieldId(), "latitude")); fields.setLatitude((String) redisUtil.hget(KylinRedisConst.FIELDS + ":" + p3.getFieldId(), "latitude"));
fields.setLongitude((String) redisUtil.hget(KylinRedisConst.FIELDS + ":" + p3.getFieldId(), "longitude")); fields.setLongitude((String) redisUtil.hget(KylinRedisConst.FIELDS + ":" + p3.getFieldId(), "longitude"));
fields.setCityName((String) redisUtil.hget(KylinRedisConst.FIELDS + ":" + p3.getFieldId(), "city_name")); fields.setCityName((String) redisUtil.hget(KylinRedisConst.FIELDS + ":" + p3.getFieldId(), "city_name"));
......
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