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

Commit 8bb4314f authored by wangyifan's avatar wangyifan

Merge branch 'master' into dev-wyf-1.5

parents 953e6dae ab2b517e
package com.liquidnet.service.kylin.service.other; package com.liquidnet.service.kylin.service.other;
import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.kylin.entity.KylinTicketTimes; import com.liquidnet.service.kylin.entity.KylinTicketTimes;
import com.liquidnet.service.kylin.entity.KylinTickets; import com.liquidnet.service.kylin.entity.KylinTickets;
...@@ -15,4 +16,7 @@ public interface DamaiService { ...@@ -15,4 +16,7 @@ public interface DamaiService {
//订单 //订单
Boolean sycOrder(long timeId, String ticketsId, long ticketsmId,long ticketIdMemberKey); Boolean sycOrder(long timeId, String ticketsId, long ticketsmId,long ticketIdMemberKey);
//定时同步大麦(扫描所有开启同步的演出)
ResponseDto<Boolean> scheduledSyncDamai();
} }
...@@ -7,66 +7,72 @@ ...@@ -7,66 +7,72 @@
<div class="wrapper wrapper-content animated fadeInRight ibox-content"> <div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-damai-edit" th:object="${kylinPerformanceDamaiVo}"> <form class="form-horizontal m" id="form-damai-edit" th:object="${kylinPerformanceDamaiVo}">
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label is-required">performances_id</label> <label class="col-sm-3 control-label">演出ID</label>
<div class="col-sm-8"> <div class="col-sm-8">
<input name="performancesId" th:field="*{performancesId}" class="form-control" type="text" readonly> <input name="performancesId" th:field="*{performancesId}" class="form-control" type="text" readonly>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label is-required">演出名称:</label> <label class="col-sm-3 control-label">演出名称:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<input name="title" th:field="*{title}" class="form-control" type="text" readonly> <input name="title" th:field="*{title}" class="form-control" type="text" readonly>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label is-required">是否同步</label> <label class="col-sm-3 control-label is-required">是否开启同步大麦</label>
<div class="col-sm-8" th:if="*{syncDamai==1}"> <div class="col-sm-8" th:if="*{syncDamai==1}">
<div class="radio check-box"> <div class="radio check-box">
<input type="radio" value="1" name="performance_sync_damai" checked>同步</label> <input type="radio" value="1" name="performance_sync_damai" checked>开启同步</label>
</div> </div>
<div class="radio check-box"> <div class="radio check-box">
<input type="radio" value="0" name="performance_sync_damai">同步</label> <input type="radio" value="0" name="performance_sync_damai">关闭同步</label>
</div> </div>
</div> </div>
<div class="col-sm-8" th:if="*{syncDamai==0}"> <div class="col-sm-8" th:if="*{syncDamai==0}">
<div class="radio check-box"> <div class="radio check-box">
<input type="radio" value="1" name="performance_sync_damai">同步</label> <input type="radio" value="1" name="performance_sync_damai">开启同步</label>
</div> </div>
<div class="radio check-box"> <div class="radio check-box">
<input type="radio" value="0" name="performance_sync_damai" checked>同步</label> <input type="radio" value="0" name="performance_sync_damai" checked>关闭同步</label>
</div> </div>
</div> </div>
</div> </div>
<div th:each="tickets : ${kylinPerformanceDamaiVo.damaiTickets}"> <div class="form-group">
<div class="form-group"> <label class="col-sm-3 control-label"></label>
<label class="col-sm-3 control-label is-required">票种名称:</label> <div class="col-sm-8">
<div class="col-sm-8"> <span style="color: #EF9C26;font-size: 14px;">说明:开启同步大麦后,该演出的票务订单每隔一分钟同步大麦一次,直至售票结束;"开启后再关闭"需注意关闭同步后产生的的演出订单信息,及时对订单信息进行处理,避免订单信息遗漏导致的的客诉问题</span>
<input name="title" th:value="${tickets.title}" class="form-control" type="text" readonly>
<input name="ticketsId" th:value="${tickets.ticketsId}" class="form-control" type="hidden" required>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">是否同步:</label>
<div class="col-sm-8" th:if="${tickets.syncDamai==1}">
<div class="radio check-box">
<input type="radio" value="1" th:name="'ticket_syncDamai:'+${tickets.ticketsId}"
checked>同步</label>
</div>
<div class="radio check-box">
<input type="radio" value="0" th:name="'ticket_syncDamai:'+${tickets.ticketsId}">不同步</label>
</div>
</div>
<div class="col-sm-8" th:if="${tickets.syncDamai==0}">
<div class="radio check-box">
<input type="radio" value="1" th:name="'ticket_syncDamai:'+${tickets.ticketsId}">同步</label>
</div>
<div class="radio check-box">
<input type="radio" value="0" th:name="'ticket_syncDamai:'+${tickets.ticketsId}" checked>
不同步</label>
</div>
</div>
</div> </div>
</div> </div>
<!-- <div th:each="tickets : ${kylinPerformanceDamaiVo.damaiTickets}">-->
<!-- <div class="form-group">-->
<!-- <label class="col-sm-3 control-label is-required">票种名称:</label>-->
<!-- <div class="col-sm-8">-->
<!-- <input name="title" th:value="${tickets.title}" class="form-control" type="text" readonly>-->
<!-- <input name="ticketsId" th:value="${tickets.ticketsId}" class="form-control" type="hidden" required>-->
<!-- </div>-->
<!-- </div>-->
<!-- <div class="form-group">-->
<!-- <label class="col-sm-3 control-label is-required">是否同步:</label>-->
<!-- <div class="col-sm-8" th:if="${tickets.syncDamai==1}">-->
<!-- <div class="radio check-box">-->
<!-- <input type="radio" value="1" th:name="'ticket_syncDamai:'+${tickets.ticketsId}"-->
<!-- checked>同步</label>-->
<!-- </div>-->
<!-- <div class="radio check-box">-->
<!-- <input type="radio" value="0" th:name="'ticket_syncDamai:'+${tickets.ticketsId}">不同步</label>-->
<!-- </div>-->
<!-- </div>-->
<!-- <div class="col-sm-8" th:if="${tickets.syncDamai==0}">-->
<!-- <div class="radio check-box">-->
<!-- <input type="radio" value="1" th:name="'ticket_syncDamai:'+${tickets.ticketsId}">同步</label>-->
<!-- </div>-->
<!-- <div class="radio check-box">-->
<!-- <input type="radio" value="0" th:name="'ticket_syncDamai:'+${tickets.ticketsId}" checked>-->
<!-- 不同步</label>-->
<!-- </div>-->
<!-- </div>-->
<!-- </div>-->
<!-- </div>-->
<button type="button" class="btn btn-w-m btn-success" onclick="submitHandler()"> <button type="button" class="btn btn-w-m btn-success" onclick="submitHandler()">
修改 修改
...@@ -89,15 +95,15 @@ ...@@ -89,15 +95,15 @@
status: parseInt($("input[name^='performance_sync_damai']:checked").val()) status: parseInt($("input[name^='performance_sync_damai']:checked").val())
} }
paramList.push(param) paramList.push(param)
var ticketObj = JSON.parse('[[${kylinPerformanceDamaiVo.damaiTickets}]]'); // var ticketObj = JSON.parse('[[${kylinPerformanceDamaiVo.damaiTickets}]]');
$.each(ticketObj, function (i, damaiTickets) { // $.each(ticketObj, function (i, damaiTickets) {
var param = { // var param = {
id:damaiTickets.ticketsId, // id:damaiTickets.ticketsId,
type:"ticket", // type:"ticket",
status:parseInt($("input[name^='ticket_syncDamai:"+damaiTickets.ticketsId+"']:checked").val()) // status:parseInt($("input[name^='ticket_syncDamai:"+damaiTickets.ticketsId+"']:checked").val())
} // }
paramList.push(param) // paramList.push(param)
}); // });
$.operate.post(prefix + "/damai/change", $.operate.post(prefix + "/damai/change",
{params:JSON.stringify(paramList)}, {params:JSON.stringify(paramList)},
......
...@@ -385,6 +385,7 @@ ...@@ -385,6 +385,7 @@
const auditStatus = '[[${kylinPerformanceMisVo.auditStatus}]]'; const auditStatus = '[[${kylinPerformanceMisVo.auditStatus}]]';
const status = '[[${kylinPerformanceMisVo.status}]]'; const status = '[[${kylinPerformanceMisVo.status}]]';
const fieldStatus = '[[${kylinPerformanceMisVo.fieldAuditStatus}]]'; const fieldStatus = '[[${kylinPerformanceMisVo.fieldAuditStatus}]]';
const type = '[[${kylinPerformanceMisVo.type}]]';
const endTime = new Date('[[${kylinPerformanceMisVo.timeEnd}]]'.replaceAll("\"", "")).valueOf(); const endTime = new Date('[[${kylinPerformanceMisVo.timeEnd}]]'.replaceAll("\"", "")).valueOf();
const now = new Date().valueOf(); const now = new Date().valueOf();
// const et = new Date(endTime.replaceAll("\"", "")).valueOf(); // const et = new Date(endTime.replaceAll("\"", "")).valueOf();
...@@ -427,7 +428,7 @@ ...@@ -427,7 +428,7 @@
} }
var damaiFlag = [[${@permission.hasPermi('kylin:performances:damai')}]]; var damaiFlag = [[${@permission.hasPermi('kylin:performances:damai')}]];
if (damaiFlag == "hidden") { if (damaiFlag == "hidden" || type != 101) {
document.getElementById("li-tab-5").style.display = "none"; document.getElementById("li-tab-5").style.display = "none";
} }
...@@ -443,7 +444,7 @@ ...@@ -443,7 +444,7 @@
var orderImportFlag = [[${@permission.hasPermi('kylin:performances:orderImport')}]]; var orderImportFlag = [[${@permission.hasPermi('kylin:performances:orderImport')}]];
if (orderImportFlag == "hidden") { if (orderImportFlag == "hidden") {
document.getElementById("li-tab-8").style.display = "none"; document.getElementById("li-tab-8"). style.display = "none";
} }
var payTxt = [[${@permission.hasPermi('kylin:performances:payTxt')}]]; var payTxt = [[${@permission.hasPermi('kylin:performances:payTxt')}]];
......
...@@ -156,9 +156,9 @@ ...@@ -156,9 +156,9 @@
} else { } 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> '); 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) { // 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>'); // 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('');
} }
}] }]
......
...@@ -6,6 +6,7 @@ import com.liquidnet.client.admin.common.utils.DateUtils; ...@@ -6,6 +6,7 @@ import com.liquidnet.client.admin.common.utils.DateUtils;
import com.liquidnet.client.admin.zhengzai.kylin.utils.DataUtils; import com.liquidnet.client.admin.zhengzai.kylin.utils.DataUtils;
import com.liquidnet.client.admin.zhengzai.kylin.utils.TaobaoTicketUtils; import com.liquidnet.client.admin.zhengzai.kylin.utils.TaobaoTicketUtils;
import com.liquidnet.commons.lang.util.IDGenerator; import com.liquidnet.commons.lang.util.IDGenerator;
import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.kylin.dao.OrderPushDamaiDto; import com.liquidnet.service.kylin.dao.OrderPushDamaiDto;
import com.liquidnet.service.kylin.entity.*; import com.liquidnet.service.kylin.entity.*;
import com.liquidnet.service.kylin.mapper.*; import com.liquidnet.service.kylin.mapper.*;
...@@ -337,6 +338,11 @@ public class KylinDamaiServiceImpl extends ServiceImpl<KylinRoadShowsMapper, Kyl ...@@ -337,6 +338,11 @@ public class KylinDamaiServiceImpl extends ServiceImpl<KylinRoadShowsMapper, Kyl
} }
} }
@Override
public ResponseDto<Boolean> scheduledSyncDamai() {
return null;
}
public static void main(String[] args) { public static void main(String[] args) {
Long a=IDGenerator.getDamaiCode("1360935572095672321307852"); Long a=IDGenerator.getDamaiCode("1360935572095672321307852");
......
package com.liquidnet.service.kylin.entity; package com.liquidnet.service.kylin.entity;
import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import java.math.BigDecimal; import java.math.BigDecimal;
...@@ -141,6 +142,26 @@ public class KylinOrderTicketEntities implements Serializable ,Cloneable { ...@@ -141,6 +142,26 @@ public class KylinOrderTicketEntities implements Serializable ,Cloneable {
}; };
} }
private Integer isDamaiPushSynced;
private Integer isDamaiWithdrawSynced;
/** 以下字段均为非数据库字段,仅定时同步大麦查询时携带,不参与 MyBatis-Plus 自动 INSERT/UPDATE **/
@TableField(exist = false)
private Integer syncType;
@TableField(exist = false)
private String timePay;
@TableField(exist = false)
private Integer isMember;
@TableField(exist = false)
private String getTicketType;
@TableField(exist = false)
private Integer transferStatus;
private static final KylinOrderTicketEntities obj = new KylinOrderTicketEntities(); private static final KylinOrderTicketEntities obj = new KylinOrderTicketEntities();
public static KylinOrderTicketEntities getNew() { public static KylinOrderTicketEntities getNew() {
try { try {
......
...@@ -160,6 +160,13 @@ public class KylinPerformanceStatus implements Serializable ,Cloneable{ ...@@ -160,6 +160,13 @@ public class KylinPerformanceStatus implements Serializable ,Cloneable{
*/ */
private Integer fieldAuditStatus; private Integer fieldAuditStatus;
/**
* 该演出的场地场次票种基础信息是否已推过大麦 0否 1是
*/
private Integer isDamaiBasicSynced;
/** /**
* 创建时间 * 创建时间
*/ */
......
...@@ -2,6 +2,7 @@ package com.liquidnet.service.kylin.mapper; ...@@ -2,6 +2,7 @@ package com.liquidnet.service.kylin.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.liquidnet.service.kylin.dao.*; import com.liquidnet.service.kylin.dao.*;
import com.liquidnet.service.kylin.entity.KylinOrderTicketEntities;
import com.liquidnet.service.kylin.entity.KylinOrderTickets; import com.liquidnet.service.kylin.entity.KylinOrderTickets;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
...@@ -61,4 +62,13 @@ public interface KylinOrderTicketsMapper extends BaseMapper<KylinOrderTickets> { ...@@ -61,4 +62,13 @@ public interface KylinOrderTicketsMapper extends BaseMapper<KylinOrderTickets> {
List<String> getAgentIdListByPerId(@Param("performancesId") String performancesId); List<String> getAgentIdListByPerId(@Param("performancesId") String performancesId);
Map selectNumAndPrice(@Param("performancesId") String performancesId, @Param("ticketsId") String ticketsId); Map selectNumAndPrice(@Param("performancesId") String performancesId, @Param("ticketsId") String ticketsId);
List<KylinOrderTicketEntities> getDamaiOrderSyncList(@Param("performanceId") String performanceId);
int updateDamaiPushSyncStatus(@Param("ids") List<String> ids, @Param("status") Integer status);
int updateDamaiWithdrawSyncStatus(@Param("ids") List<String> ids, @Param("status") Integer status);
// 撤单场景:一次 SQL 同时更新推单和撤单状态(减少数据库操作)
int updateDamaiWithdrawAndPushSyncStatus(@Param("ids") List<String> ids, @Param("status") Integer status);
} }
...@@ -5,6 +5,7 @@ import com.liquidnet.service.kylin.dao.*; ...@@ -5,6 +5,7 @@ import com.liquidnet.service.kylin.dao.*;
import com.liquidnet.service.kylin.dao.report.KylinPerformanceSubscribeStatisticalDao; import com.liquidnet.service.kylin.dao.report.KylinPerformanceSubscribeStatisticalDao;
import com.liquidnet.service.kylin.dao.report.KylinPerformanceSubscribeTicketStatisticalDao; import com.liquidnet.service.kylin.dao.report.KylinPerformanceSubscribeTicketStatisticalDao;
import com.liquidnet.service.kylin.dao.report.KylinPerformancesDto; import com.liquidnet.service.kylin.dao.report.KylinPerformancesDto;
import com.liquidnet.service.kylin.entity.KylinPerformanceStatus;
import com.liquidnet.service.kylin.entity.KylinPerformances; import com.liquidnet.service.kylin.entity.KylinPerformances;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
...@@ -126,4 +127,8 @@ public interface KylinPerformancesMapper extends BaseMapper<KylinPerformances> { ...@@ -126,4 +127,8 @@ public interface KylinPerformancesMapper extends BaseMapper<KylinPerformances> {
* @date 2024/3/21 18:02 * @date 2024/3/21 18:02
*/ */
void updatePerformanceSubscribePushById(@Param("ids")List<Integer> ids); void updatePerformanceSubscribePushById(@Param("ids")List<Integer> ids);
List<KylinPerformanceStatus> getDamaiSyncPerformances();
int updateDamaiBasicSynced(@Param("performancesId") String performancesId, @Param("val") Integer val);
} }
...@@ -577,4 +577,55 @@ WHERE kotr.performance_id = #{performanceId} ...@@ -577,4 +577,55 @@ WHERE kotr.performance_id = #{performanceId}
AND kots.status IN (1, 3, 6) AND kots.status IN (1, 3, 6)
AND kots.transfer_status in (0, 1, 3, 5); AND kots.transfer_status in (0, 1, 3, 5);
</select> </select>
<select id="getDamaiOrderSyncList" resultType="com.liquidnet.service.kylin.entity.KylinOrderTicketEntities">
SELECT ote.order_ticket_entities_id, ote.time_id, ote.ticket_id, ote.performance_id,
ote.enter_name, ote.enter_id_code, ote.enter_type, ote.enter_mobile, ote.is_payment,
ote.is_damai_push_synced,
ot.time_pay, ot.order_tickets_id AS order_id, ot.get_ticket_type,
otr.is_member,
ots.transfer_status,
CASE
WHEN ote.is_payment = 1 AND ote.is_damai_push_synced IN (0, 3) THEN 1
WHEN (ote.is_payment IN (2, 3) OR ots.transfer_status IN (2, 6)) AND ote.is_damai_withdraw_synced IN (0, 3) THEN 2
END AS sync_type
FROM kylin_order_ticket_entities ote
LEFT JOIN kylin_order_tickets ot ON ote.order_id = ot.order_tickets_id
LEFT JOIN kylin_order_ticket_relations otr ON otr.order_id = ot.order_tickets_id
LEFT JOIN kylin_order_ticket_status ots ON ots.order_id = ot.order_tickets_id
WHERE ote.performance_id = #{performanceId}
AND (
(ote.is_payment = 1 AND ote.is_damai_push_synced IN (0, 3))
OR
((ote.is_payment IN (2, 3) OR ots.transfer_status IN (2, 6)) AND ote.is_damai_withdraw_synced IN (0, 3))
)
LIMIT 200
</select>
<update id="updateDamaiPushSyncStatus">
UPDATE kylin_order_ticket_entities
SET is_damai_push_synced = #{status}
WHERE order_ticket_entities_id IN
<foreach collection="ids" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</update>
<update id="updateDamaiWithdrawSyncStatus">
UPDATE kylin_order_ticket_entities
SET is_damai_withdraw_synced = #{status}
WHERE order_ticket_entities_id IN
<foreach collection="ids" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</update>
<!-- 撤单场景:一次 SQL 同时更新推单和撤单状态,减少数据库操作 -->
<update id="updateDamaiWithdrawAndPushSyncStatus">
UPDATE kylin_order_ticket_entities
SET is_damai_withdraw_synced = #{status}, is_damai_push_synced = #{status}
WHERE order_ticket_entities_id IN
<foreach collection="ids" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</update>
</mapper> </mapper>
...@@ -1327,4 +1327,17 @@ GROUP BY user_mobile,tickets_id; ...@@ -1327,4 +1327,17 @@ GROUP BY user_mobile,tickets_id;
#{id} #{id}
</foreach> </foreach>
</update> </update>
<select id="getDamaiSyncPerformances" resultType="com.liquidnet.service.kylin.entity.KylinPerformanceStatus">
SELECT kps.performance_id, kps.is_damai_basic_synced
FROM kylin_performance_status kps
LEFT JOIN kylin_performances kp ON kp.performances_id = kps.performance_id
WHERE 1=1
AND kps.sync_damai = 1
-- AND kps.status IN (3, 6, 7, 8, 9, 10)
AND kp.time_end > NOW()
</select>
<update id="updateDamaiBasicSynced">
UPDATE kylin_performance_status SET is_damai_basic_synced = #{val} WHERE performance_id = #{performancesId}
</update>
</mapper> </mapper>
...@@ -10,10 +10,8 @@ import org.springframework.web.bind.annotation.PutMapping; ...@@ -10,10 +10,8 @@ import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
@Component @Component
@FeignClient(name = "liquidnet-service-platform", @FeignClient(name = "liquidnet-service-platform", contextId = "FeignPlatformTaskClient", path = "", url = "${liquidnet.service.platform.url}",
contextId = "FeignPlatformTaskClient", path = "", // url = "",
url = "${liquidnet.service.platform.url}",
// url = "",
fallback = FallbackFactory.Default.class) fallback = FallbackFactory.Default.class)
public interface FeignPlatformTaskClient { public interface FeignPlatformTaskClient {
...@@ -31,23 +29,29 @@ public interface FeignPlatformTaskClient { ...@@ -31,23 +29,29 @@ public interface FeignPlatformTaskClient {
@GetMapping("platform/performance/line") @GetMapping("platform/performance/line")
ResponseDto<Boolean> performanceLine(); ResponseDto<Boolean> performanceLine();
/** /**
* 定时开票提醒 * 定时开票提醒
*
* @author zjp * @author zjp
* @return: com.liquidnet.service.base.ResponseDto<java.lang.Boolean> * @return: com.liquidnet.service.base.ResponseDto<java.lang.Boolean>
* @date 2024/3/21 18:03 * @date 2024/3/21 18:03
*/ */
@GetMapping("platform/performance/subscribePush") @GetMapping("platform/performance/subscribePush")
ResponseDto<Boolean> performanceSubscribePush(); ResponseDto<Boolean> performanceSubscribePush();
/* /*
* @description: 自动处理退款失败 * @description: 自动处理退款失败
*
* @author: zjp * @author: zjp
*
* @date: 2025/4/27 14:28 * @date: 2025/4/27 14:28
*
* @param: [] * @param: []
*
* @return: com.liquidnet.service.base.ResponseDto<java.lang.Boolean> * @return: com.liquidnet.service.base.ResponseDto<java.lang.Boolean>
**/ **/
@GetMapping("platform/refund/failRefund") @GetMapping("platform/refund/failRefund")
ResponseDto<Boolean> failRefund(); ResponseDto<Boolean> failRefund();
} }
...@@ -5,6 +5,7 @@ import feign.hystrix.FallbackFactory; ...@@ -5,6 +5,7 @@ import feign.hystrix.FallbackFactory;
import org.springframework.cloud.openfeign.FeignClient; import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
@Component @Component
...@@ -29,4 +30,7 @@ public interface FeignPlatformApiClient { ...@@ -29,4 +30,7 @@ public interface FeignPlatformApiClient {
@RequestParam("pageSize") Integer pageSize @RequestParam("pageSize") Integer pageSize
); );
@PostMapping("platform/damai/scheduledSync")
ResponseDto<Boolean> scheduledSyncDamai();
} }
...@@ -11,8 +11,10 @@ import org.springframework.stereotype.Component; ...@@ -11,8 +11,10 @@ import org.springframework.stereotype.Component;
* XxlJob开发示例(Bean模式) * XxlJob开发示例(Bean模式)
* <p> * <p>
* 开发步骤: * 开发步骤:
* 1、在Spring Bean实例中,开发Job方法,方式格式要求为 "public ReturnT<String> execute(String param)" * 1、在Spring Bean实例中,开发Job方法,方式格式要求为 "public ReturnT<String> execute(String
* 2、为Job方法添加注解 "@XxlJob(value="自定义jobhandler名称", init = "JobHandler初始化方法", destroy = "JobHandler销毁方法")",注解value值对应的是调度中心新建任务的JobHandler属性的值。 * param)"
* 2、为Job方法添加注解 "@XxlJob(value="自定义jobhandler名称", init = "JobHandler初始化方法",
* destroy = "JobHandler销毁方法")",注解value值对应的是调度中心新建任务的JobHandler属性的值。
* 3、执行日志:需要通过 "XxlJobLogger.log" 打印执行日志; * 3、执行日志:需要通过 "XxlJobLogger.log" 打印执行日志;
*/ */
@Component @Component
...@@ -56,7 +58,8 @@ public class KylinTaskHandler { ...@@ -56,7 +58,8 @@ public class KylinTaskHandler {
@XxlJob(value = "sev-platform:checkTransferOrderHandler") @XxlJob(value = "sev-platform:checkTransferOrderHandler")
public void checkTransferOrderHandler() { public void checkTransferOrderHandler() {
try { try {
XxlJobHelper.handleSuccess("结果:" + feignPlatformTaskClient.checkTransferOrder(Integer.parseInt(XxlJobHelper.getJobParam())).getData()); XxlJobHelper.handleSuccess("结果:" + feignPlatformTaskClient
.checkTransferOrder(Integer.parseInt(XxlJobHelper.getJobParam())).getData());
} catch (Exception e) { } catch (Exception e) {
XxlJobHelper.log(e); XxlJobHelper.log(e);
XxlJobHelper.handleFail(); XxlJobHelper.handleFail();
...@@ -82,14 +85,15 @@ public class KylinTaskHandler { ...@@ -82,14 +85,15 @@ public class KylinTaskHandler {
XxlJobHelper.handleFail(); XxlJobHelper.handleFail();
} }
} }
/** /**
* 开票提醒定时推送 * 开票提醒定时推送
*
* @author zjp * @author zjp
* @param null * @param null
* @return: null * @return: null
* @date 2024/3/21 15:32 * @date 2024/3/21 15:32
*/ */
@XxlJob(value = "sev-platform:performanceSubscribePush") @XxlJob(value = "sev-platform:performanceSubscribePush")
public void performanceSubscribePush() { public void performanceSubscribePush() {
try { try {
...@@ -102,6 +106,7 @@ public class KylinTaskHandler { ...@@ -102,6 +106,7 @@ public class KylinTaskHandler {
/** /**
* 退款失败自动处理 * 退款失败自动处理
*
* @author zjp * @author zjp
* @param null * @param null
* @return: null * @return: null
...@@ -116,4 +121,5 @@ public class KylinTaskHandler { ...@@ -116,4 +121,5 @@ public class KylinTaskHandler {
XxlJobHelper.handleFail(); XxlJobHelper.handleFail();
} }
} }
} }
...@@ -153,4 +153,14 @@ public class PlatformTaskHandler { ...@@ -153,4 +153,14 @@ public class PlatformTaskHandler {
XxlJobHelper.handleFail(); XxlJobHelper.handleFail();
} }
} }
@XxlJob(value = "sev-platform:scheduledSyncDamai")
public void scheduledSyncDamaiHandler() {
try {
XxlJobHelper.handleSuccess("定时大麦同步结果:" + feignPlatformApiClient.scheduledSyncDamai().getData());
} catch (Exception e) {
XxlJobHelper.log(e);
XxlJobHelper.handleFail();
}
}
} }
-- 1. 商演同步大麦开关设计及防复推
ALTER TABLE `kylin_performance_status`
ADD COLUMN `is_damai_basic_synced` tinyint(2) DEFAULT 0 COMMENT '该演出的场地场次票种基础信息是否已推过大麦 0否 1是';
-- 2. 入场人基本门票粒度的分离式同步流转追踪设计
ALTER TABLE `kylin_order_ticket_entities`
ADD COLUMN `is_damai_push_synced` tinyint(2) DEFAULT 0 COMMENT '正向推单至大麦状态: 0=待推(默认) 1=推送中 2=推送成功 3=推送失败',
ADD COLUMN `is_damai_withdraw_synced` tinyint(2) DEFAULT 0 COMMENT '逆向撤单(退单/转赠)至大麦状态: 0=待推(默认/初始) 1=推送中 2=推送成功 3=推送失败';
...@@ -139,6 +139,20 @@ ...@@ -139,6 +139,20 @@
<artifactId>liquident-common-erp</artifactId> <artifactId>liquident-common-erp</artifactId>
<version>1.0-SNAPSHOT</version> <version>1.0-SNAPSHOT</version>
</dependency> </dependency>
<dependency>
<groupId>com.liquidnet</groupId>
<artifactId>liquidnet-service-kylin-do</artifactId>
<version>1.0-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>taobao-sdk-id</groupId>
<artifactId>taobao-sdk</artifactId>
<version>1.0.0</version>
<type>jar</type>
<scope>system</scope>
<systemPath>${project.basedir}/lib/taobao-sdk-java-auto_1600401599540-20210607.jar</systemPath>
</dependency>
</dependencies> </dependencies>
<build> <build>
......
package com.liquidnet.service.platform.controller;
import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.kylin.service.other.DamaiService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("/platform/damai")
public class PlatformDamaiController {
@Autowired
private DamaiService damaiService;
@ApiOperation("定时同步大麦(扫描所有开启同步的演出)")
@PostMapping(value = "/scheduledSync")
public ResponseDto<Boolean> scheduledSyncDamai() {
return damaiService.scheduledSyncDamai();
}
}
...@@ -524,4 +524,16 @@ public class DataUtils { ...@@ -524,4 +524,16 @@ public class DataUtils {
log.error("回退券ERROR:{}", e); log.error("回退券ERROR:{}", e);
} }
} }
// 【场地】获取详情
public SlimeFieldsVo getFieldsVoByFieldId(String fieldId) {
String key = SlimeRedisConst.INFO_FIELD.concat(fieldId);
long s = System.currentTimeMillis();
SlimeFieldsVo vo = (SlimeFieldsVo) redisDataSourceUtil.getRedisKylinUtil().get(key);
if (null == vo) {
vo = mongoTemplate.findOne(Query.query(Criteria.where("fieldId").is(fieldId)), SlimeFieldsVo.class, SlimeFieldsVo.class.getSimpleName());
redisDataSourceUtil.getRedisKylinUtil().set(SlimeRedisConst.INFO_FIELD.concat(fieldId), vo);
}
return vo;
}
} }
package com.liquidnet.service.platform.utils;
import org.apache.commons.lang3.time.DateFormatUtils;
import java.lang.management.ManagementFactory;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
/**
* 时间工具类
*
* @author ruoyi
*/
public class DateUtils extends org.apache.commons.lang3.time.DateUtils
{
public static String YYYY = "yyyy";
public static String YYYY_MM = "yyyy-MM";
public static String YYYY_MM_DD = "yyyy-MM-dd";
public static String YYYYMMDDHHMMSS = "yyyyMMddHHmmss";
public static String YYYY_MM_DD_HH_MM_SS = "yyyy-MM-dd HH:mm:ss";
private static String[] parsePatterns = {
"yyyy-MM-dd", "yyyy-MM-dd HH:mm:ss", "yyyy-MM-dd HH:mm", "yyyy-MM",
"yyyy/MM/dd", "yyyy/MM/dd HH:mm:ss", "yyyy/MM/dd HH:mm", "yyyy/MM",
"yyyy.MM.dd", "yyyy.MM.dd HH:mm:ss", "yyyy.MM.dd HH:mm", "yyyy.MM"};
/**
* 获取当前Date型日期
*
* @return Date() 当前日期
*/
public static Date getNowDate()
{
return new Date();
}
/**
* 获取当前日期, 默认格式为yyyy-MM-dd
*
* @return String
*/
public static String getDate()
{
return dateTimeNow(YYYY_MM_DD);
}
public static final String getTime()
{
return dateTimeNow(YYYY_MM_DD_HH_MM_SS);
}
public static final String dateTimeNow()
{
return dateTimeNow(YYYYMMDDHHMMSS);
}
public static final String dateTimeNow(final String format)
{
return parseDateToStr(format, new Date());
}
public static final String dateTime(final Date date)
{
return parseDateToStr(YYYY_MM_DD, date);
}
public static final String parseDateToStr(final String format, final Date date)
{
return new SimpleDateFormat(format).format(date);
}
public static final Date dateTime(final String format, final String ts)
{
try
{
return new SimpleDateFormat(format).parse(ts);
}
catch (ParseException e)
{
throw new RuntimeException(e);
}
}
/**
* 日期路径 即年/月/日 如2018/08/08
*/
public static final String datePath()
{
Date now = new Date();
return DateFormatUtils.format(now, "yyyy/MM/dd");
}
/**
* 日期路径 即年/月/日 如20180808
*/
public static final String dateTime()
{
Date now = new Date();
return DateFormatUtils.format(now, "yyyyMMdd");
}
/**
* 日期型字符串转化为日期 格式
*/
public static Date parseDate(Object str)
{
if (str == null)
{
return null;
}
try
{
return parseDate(str.toString(), parsePatterns);
}
catch (ParseException e)
{
return null;
}
}
/**
* 获取服务器启动时间
*/
public static Date getServerStartDate()
{
long time = ManagementFactory.getRuntimeMXBean().getStartTime();
return new Date(time);
}
/**
* 计算相差天数
*/
public static int differentDaysByMillisecond(Date date1, Date date2)
{
return Math.abs((int) ((date2.getTime() - date1.getTime()) / (1000 * 3600 * 24)));
}
/**
* 计算两个时间差
*/
public static String getDatePoor(Date endDate, Date nowDate)
{
long nd = 1000 * 24 * 60 * 60;
long nh = 1000 * 60 * 60;
long nm = 1000 * 60;
// long ns = 1000;
// 获得两个时间的毫秒时间差异
long diff = endDate.getTime() - nowDate.getTime();
// 计算差多少天
long day = diff / nd;
// 计算差多少小时
long hour = diff % nd / nh;
// 计算差多少分钟
long min = diff % nd % nh / nm;
// 计算差多少秒//输出结果
// long sec = diff % nd % nh % nm / ns;
return day + "天" + hour + "小时" + min + "分钟";
}
}
package com.liquidnet.service.platform.utils;
import com.liquidnet.commons.lang.util.IDGenerator;
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.mongo.KylinOrderTicketEntitiesVo;
import com.liquidnet.service.kylin.dto.vo.mongo.KylinOrderTicketVo;
import com.liquidnet.service.kylin.dto.vo.mongo.KylinPerformanceVo;
import com.taobao.api.DefaultTaobaoClient;
import com.taobao.api.TaobaoClient;
import com.taobao.api.request.AlibabaDamaiMevOpenWithdrawticketRequest;
import com.taobao.api.response.AlibabaDamaiMevOpenWithdrawticketResponse;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
@Slf4j
public class TaobaoTicketUtils {
private String URL = "http://gw.api.taobao.com/router/rest";
private String APPKEY = "27542597";
private String SECRET = "900025efc616fd2446344bb8fa21d039";
private String SUPPLIER_SECRET = "444d0752439f921a75eaf5951a8bc03c";
private Long SYSTEM_ID = 15669L;
// private String url = "http://gw.api.tbsandbox.com/router/rest";
// private String appkey = "4272";
// private String secret = "0ebbcccfee18d7ad1aebc5b135ffa906";
private TaobaoClient client = null;
public TaobaoClient initTaobaoClient() {
if (client == null) {
client = new DefaultTaobaoClient(URL, APPKEY, SECRET);
}
return client;
}
public String getSupplierSecret() {
return SUPPLIER_SECRET;
}
public Long getSystemId() {
return SYSTEM_ID;
}
/**
* @param timesId 场次的id
* @param orderEntitiesId 入场人的id
* @return
*/
public boolean withdrawDamaiOrder(long timesId, long orderEntitiesId) {
try {
TaobaoClient client = initTaobaoClient();
AlibabaDamaiMevOpenWithdrawticketRequest req = new AlibabaDamaiMevOpenWithdrawticketRequest();
AlibabaDamaiMevOpenWithdrawticketRequest.TicketIdOpenParam obj1 = new AlibabaDamaiMevOpenWithdrawticketRequest.TicketIdOpenParam();
obj1.setPerformId(timesId);// 场次id
obj1.setVoucherId(orderEntitiesId);// 票单号 入场人id
obj1.setSupplierSecret(SUPPLIER_SECRET);
obj1.setSystemId(SYSTEM_ID);
req.setTicketIdOpenParam(obj1);
AlibabaDamaiMevOpenWithdrawticketResponse rsp = client.execute(req);
return rsp.getResult().getSuccess();
} catch (Exception e) {
return false;
}
}
public boolean refundDamaiOrder(KylinOrderTicketVo orderData, KylinPerformanceVo vo) {
try {
int isSysDamai = 0;
for (int x = 0; x < vo.getTicketTimeList().size(); x++) {
KylinTicketTimesVo timeItem = vo.getTicketTimeList().get(x);
for (int y = 0; y < timeItem.getTicketList().size(); y++) {
KylinTicketVo ticketItem = timeItem.getTicketList().get(y);
if (ticketItem.getTicketsId().equals(orderData.getTicketId())) {
isSysDamai = ticketItem.getSysDamai();
break;
}
}
}
if (isSysDamai == 1) {
List<KylinOrderTicketEntitiesVo> listData = orderData.getEntitiesVoList();
for (int i = 0; i < listData.size(); i++) {
KylinOrderTicketEntitiesVo item = listData.get(i);
long ticketTimesKey;
if (item.getTicketId().length() > 13) {
ticketTimesKey = Long.valueOf(IDGenerator.getDamaiCode(item.getTimeId()));
} else {
ticketTimesKey = Long.parseLong(item.getTimeId());
}
long orderTicketEntitiesKey;
// if (item.getOrderTicketEntitiesId().length() > 13) {
// orderTicketEntitiesKey =
// Long.valueOf(IDGenerator.getDamaiCode(item.getOrderTicketEntitiesId()));
// } else {
// orderTicketEntitiesKey = Long.valueOf(item.getOrderTicketEntitiesId());//票单号
// 入场人id
// }
if (orderData.getIsMember() == 1) {
orderTicketEntitiesKey = Long.valueOf(
IDGenerator.getDamaiCode(item.getOrderTicketEntitiesId()).toString().concat("010"));
} else {
orderTicketEntitiesKey = Long.valueOf(
IDGenerator.getDamaiCode(item.getOrderTicketEntitiesId()).toString().concat("020"));
}
if (item.getIsPayment() == 2) {
withdrawDamaiOrder(ticketTimesKey, orderTicketEntitiesKey);
}
}
return true;
}
return true;
} catch (Exception e) {
log.info("REFUND DAMAI ERROR = {}", e);
return false;
}
}
}
...@@ -256,6 +256,7 @@ public class KylinPerformancesPartnerServiceImpl implements IKylinPerformancesPa ...@@ -256,6 +256,7 @@ public class KylinPerformancesPartnerServiceImpl implements IKylinPerformancesPa
performancePartnerVo.setIsTrueName(step2Param.getIsTrueName()); performancePartnerVo.setIsTrueName(step2Param.getIsTrueName());
performancePartnerVo.setLimitCount(step2Param.getLimitCount()); performancePartnerVo.setLimitCount(step2Param.getLimitCount());
performancePartnerVo.setIdCount(step2Param.getIdCount()); performancePartnerVo.setIdCount(step2Param.getIdCount());
performancePartnerVo.setCreatedAt(createdAt.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))); performancePartnerVo.setCreatedAt(createdAt.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
performancePartnerVo.setIsSubmit(step2Param.getIsSubmit()); performancePartnerVo.setIsSubmit(step2Param.getIsSubmit());
// performancePartnerVo.setStatusSell(1); // performancePartnerVo.setStatusSell(1);
...@@ -352,6 +353,7 @@ public class KylinPerformancesPartnerServiceImpl implements IKylinPerformancesPa ...@@ -352,6 +353,7 @@ public class KylinPerformancesPartnerServiceImpl implements IKylinPerformancesPa
performancePartnerVo.setIsTrueName(step2Param.getIsTrueName()); performancePartnerVo.setIsTrueName(step2Param.getIsTrueName());
performancePartnerVo.setLimitCount(step2Param.getLimitCount()); performancePartnerVo.setLimitCount(step2Param.getLimitCount());
performancePartnerVo.setIdCount(step2Param.getIdCount()); performancePartnerVo.setIdCount(step2Param.getIdCount());
performancePartnerVo.setCreatedAt(now.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))); performancePartnerVo.setCreatedAt(now.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
performancePartnerVo.setUpdatedAt(now.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))); performancePartnerVo.setUpdatedAt(now.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
performancePartnerVo.setIsSubmit(step2Param.getIsSubmit()); performancePartnerVo.setIsSubmit(step2Param.getIsSubmit());
...@@ -484,6 +486,7 @@ public class KylinPerformancesPartnerServiceImpl implements IKylinPerformancesPa ...@@ -484,6 +486,7 @@ public class KylinPerformancesPartnerServiceImpl implements IKylinPerformancesPa
vo.setIsTrueName(step2Param.getIsTrueName()); vo.setIsTrueName(step2Param.getIsTrueName());
vo.setLimitCount(step2Param.getLimitCount()); vo.setLimitCount(step2Param.getLimitCount());
vo.setIdCount(step2Param.getIdCount()); vo.setIdCount(step2Param.getIdCount());
mongoSlimeUtils.updateKylinPerformanceVoById(vo); mongoSlimeUtils.updateKylinPerformanceVoById(vo);
redisSlimeUtils.delPerformanceVo(performanceId); redisSlimeUtils.delPerformanceVo(performanceId);
......
...@@ -294,6 +294,7 @@ public class PerformanceUtils { ...@@ -294,6 +294,7 @@ public class PerformanceUtils {
} else { } else {
performanceStatus.setStatusSell(1); performanceStatus.setStatusSell(1);
} }
performanceRelations.setPerformanceId(performances.getPerformancesId()); performanceRelations.setPerformanceId(performances.getPerformancesId());
performanceRelations.setPerformanceRelationsId(IDGenerator.nextSnowId()); performanceRelations.setPerformanceRelationsId(IDGenerator.nextSnowId());
......
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