Browse Source

0323.2

master
zhangye 6 years ago
parent
commit
cbaf14c0c9
  1. 4
      health/src/main/java/com/ccsens/health/api/ClockController.java
  2. 29
      health/src/main/java/com/ccsens/health/service/ClockService.java
  3. 2
      health/src/main/java/com/ccsens/health/service/IClockService.java

4
health/src/main/java/com/ccsens/health/api/ClockController.java

@ -79,9 +79,9 @@ public class ClockController {
@MustLogin
@ApiOperation(value = "生成场所二维码", notes = "")
@RequestMapping(value = "qrCode", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
public JsonResponse<String> getQRCode(@ApiParam @Validated @RequestBody QueryDto<JourneyDto.CreateQRCode> params) throws Exception {
public JsonResponse<ClockVo.SiteList> getQRCode(@ApiParam @Validated @RequestBody QueryDto<JourneyDto.CreateQRCode> params) throws Exception {
log.info("生成场所二维码");
String codePath = clockService.getQRCode(params);
ClockVo.SiteList codePath = clockService.getQRCode(params);
return JsonResponse.newInstance().ok(codePath);
}

29
health/src/main/java/com/ccsens/health/service/ClockService.java

@ -232,7 +232,9 @@ public class ClockService implements IClockService {
* @return
*/
@Override
public String getQRCode(QueryDto<JourneyDto.CreateQRCode> params) throws Exception {
public ClockVo.SiteList getQRCode(QueryDto<JourneyDto.CreateQRCode> params) throws Exception {
ClockVo.SiteList siteVo = new ClockVo.SiteList();
String qrcodePath = null;
JourneyDto.CreateQRCode createQRCode = params.getParam();
//根据id查找场馆信息
@ -266,8 +268,31 @@ public class ClockService implements IClockService {
//添加数据库
siteQrcodeDao.insertSelective(siteQrcode);
}
//返回的信息
siteVo.setId(site.getId());
siteVo.setSiteName(site.getSiteName());
siteVo.setSiteCode(site.getSiteCode());
siteVo.setLongitude(site.getLongitude());
siteVo.setLatitude(site.getLatitude());
//二维码
int a = createQRCode.getType() == 0 ? 1 : 0;
SiteQrcodeExample url = new SiteQrcodeExample();
url.createCriteria().andSiteIdEqualTo(createQRCode.getId())
.andOutOrInEqualTo((byte) a);
List<SiteQrcode> siteQrcodes = siteQrcodeDao.selectByExample(url);
if(a == 0){
siteVo.setOutUrl(qrcodePath);
if(CollectionUtil.isNotEmpty(siteQrcodes)){
siteVo.setInUrl(siteQrcodes.get(0).getQrcodePath());
}
}else {
siteVo.setInUrl(qrcodePath);
if(CollectionUtil.isNotEmpty(siteQrcodes)){
siteVo.setOutUrl(siteQrcodes.get(0).getQrcodePath());
}
}
return qrcodePath;
return siteVo;
}

2
health/src/main/java/com/ccsens/health/service/IClockService.java

@ -17,7 +17,7 @@ public interface IClockService {
List<ClockVo.SiteClockStatistics> getSiteClickStatistics(QueryDto<JourneyDto.StatisticsDate> params) throws Exception;
String getQRCode(QueryDto<JourneyDto.CreateQRCode> params) throws Exception;
ClockVo.SiteList getQRCode(QueryDto<JourneyDto.CreateQRCode> params) throws Exception;
PageInfo<ClockVo.SiteList> getAllSiteInfo(JourneyDto.Query query);

Loading…
Cancel
Save