fixbug 按次收费余额不足就下订单
音乐多次播放有问题,上传日志有问题
This commit is contained in:
@@ -16,28 +16,24 @@ public class LogService {
|
|||||||
|
|
||||||
private static SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
private static SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||||
|
|
||||||
static Session session;
|
public void uploadLog() {
|
||||||
|
|
||||||
public void uploadLog(String password) {
|
|
||||||
try {
|
try {
|
||||||
if (session == null) {
|
JSch jsch = new JSch();
|
||||||
JSch jsch = new JSch();
|
String serverIp = System.getProperty(NettyConstant.VENUE_SERVER_IP);
|
||||||
String serverIp = System.getProperty(NettyConstant.VENUE_SERVER_IP);
|
Session session = jsch.getSession("root", serverIp, 22);
|
||||||
session = jsch.getSession("root", serverIp, 22);
|
session.setPassword(System.getProperty(NettyConstant.VENUE_CHECK_PWD));
|
||||||
session.setPassword(System.getProperty(NettyConstant.VENUE_CHECK_PWD));
|
session.setConfig("StrictHostKeyChecking", "no");
|
||||||
session.setConfig("StrictHostKeyChecking", "no");
|
session.connect(3000);
|
||||||
session.connect(3000);
|
|
||||||
}
|
|
||||||
ChannelSftp sftp = (ChannelSftp) session.openChannel("sftp");
|
ChannelSftp sftp = (ChannelSftp) session.openChannel("sftp");
|
||||||
File file1 = new File("/home/venue/logs/common-default.log");
|
File file1 = new File("/home/venue/logs/common-default.log");
|
||||||
File file2 = new File("/home/venue/logs/common-error.log");
|
File file2 = new File("/home/venue/logs/common-error.log");
|
||||||
if (file1.exists() || file2.exists()) {
|
if (file1.exists() || file2.exists()) {
|
||||||
sftp.connect();
|
sftp.connect();
|
||||||
if (file1.exists()){
|
if (file1.exists()){
|
||||||
sftp.put(new FileInputStream(file1), "/home/uploadlog/" + System.getProperty(NettyConstant.VENUE_CLIENT_SN) + "-" + sdf.format(new Date()) + "-client-common.log");
|
sftp.put(new FileInputStream(file1), "/home/uploadlog/comm-" + System.getProperty(NettyConstant.VENUE_CLIENT_SN) + "-" + sdf.format(new Date()) + "-client.log");
|
||||||
}
|
}
|
||||||
if (file2.exists()) {
|
if (file2.exists()) {
|
||||||
sftp.put(new FileInputStream(file2), "/home/uploadlog/" + System.getProperty(NettyConstant.VENUE_CLIENT_SN) + "-" + sdf.format(new Date()) + "-client-error.log");
|
sftp.put(new FileInputStream(file2), "/home/uploadlog/error-" + System.getProperty(NettyConstant.VENUE_CLIENT_SN) + "-" + sdf.format(new Date()) + "-client.log");
|
||||||
}
|
}
|
||||||
logger.info("upload logs success");
|
logger.info("upload logs success");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ public class MessageService {
|
|||||||
|
|
||||||
private void sendLog() {
|
private void sendLog() {
|
||||||
LogService logService = new LogService();
|
LogService logService = new LogService();
|
||||||
logService.uploadLog(System.getProperty(NettyConstant.VENUE_CHECK_PWD));
|
logService.uploadLog();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -15,27 +15,24 @@ public enum PlayMusicService {
|
|||||||
private static ArrayListPlayList byeVoice = new ArrayListPlayList();
|
private static ArrayListPlayList byeVoice = new ArrayListPlayList();
|
||||||
// PlayList stopUsingVoice = new ArrayListPlayList();
|
// PlayList stopUsingVoice = new ArrayListPlayList();
|
||||||
|
|
||||||
static {
|
public void playHello(){
|
||||||
File hello = new File("/home/venue/client/hello.mp3");
|
File hello = new File("/home/venue/client/hello.mp3");
|
||||||
if (hello.exists()){
|
if (hello.exists()){
|
||||||
helloVoice.addAudioFile(hello);
|
helloVoice.addAudioFile(hello);
|
||||||
|
player.setPlayList(helloVoice);
|
||||||
|
player.play();
|
||||||
|
player.close();
|
||||||
}
|
}
|
||||||
File bye = new File("/home/venue/client/bye.mp3");
|
|
||||||
if (bye.exists()){
|
|
||||||
byeVoice.addAudioFile(bye);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void playHello(){
|
|
||||||
player.setPlayList(helloVoice);
|
|
||||||
player.play();
|
|
||||||
player.close();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void playBye(){
|
public void playBye(){
|
||||||
player.setPlayList(byeVoice);
|
File bye = new File("/home/venue/client/bye.mp3");
|
||||||
player.play();
|
if (bye.exists()){
|
||||||
player.close();
|
byeVoice.addAudioFile(bye);
|
||||||
|
player.setPlayList(byeVoice);
|
||||||
|
player.play();
|
||||||
|
player.close();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -259,9 +259,9 @@ public class VenueService extends BaseServiceImpl {
|
|||||||
if (effOrder <= 0) {
|
if (effOrder <= 0) {
|
||||||
// 单次订单已超时 需要重新付费
|
// 单次订单已超时 需要重新付费
|
||||||
synchronized (("scancode-in" + memberId).intern()) {
|
synchronized (("scancode-in" + memberId).intern()) {
|
||||||
createBarcodeTimeOrder(memberId,venueId,timePayHour);
|
|
||||||
if (memberService.isMoneyEnough(memberId, price)) {
|
if (memberService.isMoneyEnough(memberId, price)) {
|
||||||
logger.info("用户" + memberId + "使用余额核销订单");
|
logger.info("用户" + memberId + "使用余额核销订单");
|
||||||
|
createBarcodeTimeOrder(memberId,venueId,timePayHour);
|
||||||
createMemberMoneyLog(MoneyLogEnum.JOIN.value, price, memberId, 1, PayTypeEnum.BALANCE.value, null,
|
createMemberMoneyLog(MoneyLogEnum.JOIN.value, price, memberId, 1, PayTypeEnum.BALANCE.value, null,
|
||||||
venue.getId(), venue.getType());
|
venue.getId(), venue.getType());
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user