|
@ -29,7 +29,6 @@ import org.apache.poi.ss.usermodel.Workbook; |
|
|
import org.apache.poi.xssf.usermodel.XSSFRow; |
|
|
import org.apache.poi.xssf.usermodel.XSSFRow; |
|
|
import org.apache.poi.xssf.usermodel.XSSFSheet; |
|
|
import org.apache.poi.xssf.usermodel.XSSFSheet; |
|
|
import org.apache.poi.xssf.usermodel.XSSFWorkbook; |
|
|
import org.apache.poi.xssf.usermodel.XSSFWorkbook; |
|
|
import org.springframework.beans.factory.annotation.Value; |
|
|
|
|
|
import org.springframework.data.redis.core.ZSetOperations; |
|
|
import org.springframework.data.redis.core.ZSetOperations; |
|
|
import org.springframework.stereotype.Service; |
|
|
import org.springframework.stereotype.Service; |
|
|
import org.springframework.transaction.annotation.Propagation; |
|
|
import org.springframework.transaction.annotation.Propagation; |
|
@ -76,8 +75,6 @@ public class ScreenService implements IScreenService { |
|
|
private SendMsg sendMsg; |
|
|
private SendMsg sendMsg; |
|
|
@Resource |
|
|
@Resource |
|
|
private RedisUtil redisUtil; |
|
|
private RedisUtil redisUtil; |
|
|
@Value("${spring.profiles.active}") |
|
|
|
|
|
private String active; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* 创建游戏 |
|
|
* 创建游戏 |
|
@ -123,8 +120,7 @@ public class ScreenService implements IScreenService { |
|
|
gameRecord.setUrl(gameUrl + gameType.getScreenUrl() + "?id=" + gameRecord.getId()); |
|
|
gameRecord.setUrl(gameUrl + gameType.getScreenUrl() + "?id=" + gameRecord.getId()); |
|
|
// gameRecord.setQrCodeUrl(gameUrl + gameRecord.getId() + File.separator + gameType.getClientUrl());
|
|
|
// gameRecord.setQrCodeUrl(gameUrl + gameRecord.getId() + File.separator + gameType.getClientUrl());
|
|
|
|
|
|
|
|
|
log.info("active:{}", active); |
|
|
if("1".equalsIgnoreCase(PropUtil.openWx)){ |
|
|
if ("prod".equals(active)) { |
|
|
|
|
|
//生成二维码
|
|
|
//生成二维码
|
|
|
String fileName = "/gameQrCode/" + DateUtil.today() + "/" + System.currentTimeMillis() + ".png"; |
|
|
String fileName = "/gameQrCode/" + DateUtil.today() + "/" + System.currentTimeMillis() + ".png"; |
|
|
String path = WebConstant.UPLOAD_PATH_BASE + fileName; |
|
|
String path = WebConstant.UPLOAD_PATH_BASE + fileName; |
|
@ -137,6 +133,7 @@ public class ScreenService implements IScreenService { |
|
|
//给一个默认测试的
|
|
|
//给一个默认测试的
|
|
|
gameRecord.setQrCodeUrl(PropUtil.qrCode + "/gameQrCode/2020-08-19/1597822577181.png"); |
|
|
gameRecord.setQrCodeUrl(PropUtil.qrCode + "/gameQrCode/2020-08-19/1597822577181.png"); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
//查找此任务下的游戏配置表
|
|
|
//查找此任务下的游戏配置表
|
|
|
byte businessType = 8; |
|
|
byte businessType = 8; |
|
|
if( GameConstant.GAME_TYPE_SP.equalsIgnoreCase(memberGame.getGameType())){ |
|
|
if( GameConstant.GAME_TYPE_SP.equalsIgnoreCase(memberGame.getGameType())){ |
|
@ -876,7 +873,20 @@ public class ScreenService implements IScreenService { |
|
|
default:break; |
|
|
default:break; |
|
|
} |
|
|
} |
|
|
gameRecordNew.setUrl(gameUrl + gameType.getScreenUrl() + "?id=" + gameRecordNew.getId()); |
|
|
gameRecordNew.setUrl(gameUrl + gameType.getScreenUrl() + "?id=" + gameRecordNew.getId()); |
|
|
gameRecordNew.setQrCodeUrl(gameUrl+ gameRecordNew.getId() + File.separator + gameType.getClientUrl()); |
|
|
// gameRecordNew.setQrCodeUrl(gameUrl+ gameRecordNew.getId() + File.separator + gameType.getClientUrl());
|
|
|
|
|
|
if("1".equalsIgnoreCase(PropUtil.openWx)){ |
|
|
|
|
|
//生成二维码
|
|
|
|
|
|
String fileName = "/gameQrCode/" + DateUtil.today() + "/" + System.currentTimeMillis() + ".png"; |
|
|
|
|
|
String path = WebConstant.UPLOAD_PATH_BASE + fileName; |
|
|
|
|
|
WxXcxUtil.getWxCode(WebConstant.QRCODE_GAME |
|
|
|
|
|
, "id=" + gameRecord.getId() + "&type=" + gameType.getCode(), null, path,gameType.getCode()); |
|
|
|
|
|
gameRecord.setQrCodeUrl(PropUtil.qrCode + fileName); |
|
|
|
|
|
log.info("调用微信生成二维码"); |
|
|
|
|
|
} else { |
|
|
|
|
|
log.info("测试环境,不调用生成二维码"); |
|
|
|
|
|
//给一个默认测试的
|
|
|
|
|
|
gameRecord.setQrCodeUrl(PropUtil.qrCode + "/gameQrCode/2020-08-19/1597822577181.png"); |
|
|
|
|
|
} |
|
|
gameRecordDao.insertSelective(gameRecordNew); |
|
|
gameRecordDao.insertSelective(gameRecordNew); |
|
|
//修改购买的游戏的使用次数
|
|
|
//修改购买的游戏的使用次数
|
|
|
gameUserPay.setUsedCount(gameUserPay.getUsedCount() + 1); |
|
|
gameUserPay.setUsedCount(gameUserPay.getUsedCount() + 1); |
|
@ -915,6 +925,7 @@ public class ScreenService implements IScreenService { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
chromeMessageDto.setReceivers(messageUserList); |
|
|
chromeMessageDto.setReceivers(messageUserList); |
|
|
|
|
|
log.info("再玩一次发送消息:{}",chromeMessageDto); |
|
|
messageService.sendGameMessageWithGetUrl(chromeMessageDto,userIdSet); |
|
|
messageService.sendGameMessageWithGetUrl(chromeMessageDto,userIdSet); |
|
|
|
|
|
|
|
|
return gameRecordNew.getUrl(); |
|
|
return gameRecordNew.getUrl(); |
|
|