修复二维码健身房参数问题

This commit is contained in:
limqhz
2020-06-30 20:13:19 +08:00
parent 972f91c73c
commit d8dea80696

View File

@@ -1,5 +1,6 @@
package com.sv.service.oms;
import com.enums.VenueTypeEnum;
import com.github.pagehelper.PageHelper;
import com.sv.dto.oms.VenueOmsDTO;
import com.sv.entity.Platform;
@@ -195,8 +196,14 @@ public class VenueService extends BaseServiceImpl {
@Transactional(rollbackFor = Exception.class)
public void generateCodeUrl(Integer venueId) {
Venue venue = findById(venueId);
Integer venueType = venue.getType();
Platform platform = platformService.findById(1);
InputStream inputStream = WxXCXService.getNewInstance(platform.getAppId(), platform.getSecret(), "wx_xcx_token", cacheService).getXCXQrCode("pages/basketballGym/index", venueId.toString(), "1280");
InputStream inputStream = null;
if (venueType.equals(VenueTypeEnum.BASKETBALL.value)){
inputStream = WxXCXService.getNewInstance(platform.getAppId(), platform.getSecret(), "wx_xcx_token", cacheService).getXCXQrCode("pages/basketballGym/index", venueId.toString(), "1280");
}else {
inputStream = WxXCXService.getNewInstance(platform.getAppId(), platform.getSecret(), "wx_xcx_token", cacheService).getXCXQrCode("pages/gymnasium/index", venueId.toString(), "1280");
}
String url = ossClientUtil.uploadImg(inputStream, "qrcode.png");
venue.setCodeUrl(url);
venueMapper.update(venue);