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