Browse Source

0308.1

master
zhangye 6 years ago
parent
commit
ceba838ae8
  1. 3
      health/src/main/java/com/ccsens/health/api/DebugController.java
  2. 19
      health/src/main/java/com/ccsens/health/service/ClockService.java
  3. 29
      util/src/main/java/com/ccsens/util/wx/WxXcxUtil.java

3
health/src/main/java/com/ccsens/health/api/DebugController.java

@ -38,6 +38,9 @@ public class DebugController {
color.b = "0";
WxXcxUtil.getWxCode("pages/user-code/user-code"
,"d=1217647686598135808",color,"/home/cloud/tall/uploads/qrCode/2020-03-07/158357267174.png");
// WxXcxUtil.getWxCodeTest("pages/user-code/user-code?d=1217647686598135808"
// ,"d=1217647686598135808",color,"/home/cloud/tall/uploads/qrCode/2020-03-07/158357267174.png");
return JsonResponse.newInstance().ok("完成");
}
}

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

@ -48,6 +48,7 @@ public class ClockService implements IClockService {
/**
* 场景扫码打卡
*
* @param params
*/
@Override
@ -69,6 +70,7 @@ public class ClockService implements IClockService {
/**
* 查看打卡记录
*
* @param params
* @return
*/
@ -92,6 +94,7 @@ public class ClockService implements IClockService {
/**
* 场所扫码统计
*
* @param
* @return
*/
@ -126,6 +129,7 @@ public class ClockService implements IClockService {
/**
* 获取场所的二维码
*
* @param params
* @return
*/
@ -186,20 +190,21 @@ public class ClockService implements IClockService {
@Override
public ClockVo.SiteInfo getSiteInfoById(Long siteQrcodeId) {
SiteQrcode siteQrcode = siteQrcodeDao.selectByPrimaryKey(siteQrcodeId);
Site site = new Site();
if(ObjectUtil.isNotNull(siteQrcode)) {
site = siteDao.selectByPrimaryKey(siteQrcode.getSiteId());
if (ObjectUtil.isNull(siteQrcode)) {
throw new BaseException(CodeEnum.NOT_SITE);
}
Site site = siteDao.selectByPrimaryKey(siteQrcode.getSiteId());
if (ObjectUtil.isNull(site)) {
throw new BaseException(CodeEnum.NOT_SITE);
}
ClockVo.SiteInfo siteInfo = null;
if(ObjectUtil.isNotNull(site)) {
siteInfo = new ClockVo.SiteInfo();
ClockVo.SiteInfo siteInfo = new ClockVo.SiteInfo();
siteInfo.setId(site.getId());
siteInfo.setSiteCode(site.getSiteCode());
siteInfo.setSiteName(site.getSiteName());
siteInfo.setLongitude(site.getLongitude());
siteInfo.setLatitude(site.getLatitude());
siteInfo.setType(siteQrcode.getOutOrIn());
}
return siteInfo;
}
}

29
util/src/main/java/com/ccsens/util/wx/WxXcxUtil.java

@ -64,6 +64,7 @@ public class WxXcxUtil {
public static class WechatCode{
public String scene;
public String page;
// public String path;
public Integer width;
public Boolean auto_color;
public LineColor line_color;
@ -74,6 +75,14 @@ public class WxXcxUtil {
public String g;
public String b;
}
public static class WechatCodeA{
public String path;
public Integer width;
public Boolean auto_color;
public LineColor line_color;
public Boolean is_hyaline;
}
/**
* Prepare pay
*/
@ -231,6 +240,7 @@ public class WxXcxUtil {
WechatCode wechatCode = new WechatCode();
wechatCode.page = page;
wechatCode.scene = scene;
// wechatCode.path = page+"?"+scene;
wechatCode.line_color = color;
@ -239,6 +249,25 @@ public class WxXcxUtil {
HttpsUtil.httpsRequest(url,"POST",postStr,path);
}
// /**
// * 获取小程序二维码/小程序码
// * @return
// * @throws Exception
// */
// public static void getWxCodeTest(String page,String scene,LineColor color,String path) throws Exception {
// String url = String.format(URL_GET_WX_CODE_C, WxGzhUtil.getAccessToken());
//
// WechatCodeA wechatCodeA = new WechatCodeA();
// wechatCodeA.path = page;
//// wechatCode.path = page+"?"+scene;
//
//// WechatCodeA.line_color = color;
//
// String postStr = JacksonUtil.beanToJson(wechatCodeA);
// System.out.println(postStr);
// HttpsUtil.httpsRequest(url,"POST",postStr,path);
// }
/**
* 统一下单
*/

Loading…
Cancel
Save