1.完善预约过期处理定时任务

2.对接闸机程序(添加权限、添加访客、获取二维码)
3.将请求参数、url 存储便于后面定时任务重试
main
862857010@qq.com 2 years ago
parent 084e5198aa
commit 3b4b950f4c
  1. 3
      src/main/java/com/cjy/StartUp.java
  2. 16
      src/main/java/com/cjy/back/ybsjAppointment/dao/YbsjyAppointmentRecordMapper.java
  3. 14
      src/main/java/com/cjy/back/ybsjAppointment/dao/YbsjyAppointmentRecordMapper.xml
  4. 20
      src/main/java/com/cjy/back/ybsjAppointment/dao/YbsjyAppointmentSettingMapper.java
  5. 9
      src/main/java/com/cjy/back/ybsjAppointment/dao/YbsjyAppointmentSettingMapper.xml
  6. 44
      src/main/java/com/cjy/back/ybsjAppointment/entity/AppointmentRequestTurnstileLogEntity.java
  7. 14
      src/main/java/com/cjy/back/ybsjAppointment/service/YbsjyAppointmentRecordService.java
  8. 21
      src/main/java/com/cjy/back/ybsjAppointment/service/impl/YbsjyAppointmentRecordImpl.java
  9. 79
      src/main/java/com/cjy/back/ybsjAppointment/service/impl/YbsjyAppointmentSettingServiceImpl.java
  10. 33
      src/main/java/com/cjy/back/ybsjAppointment/task/HandleExpiredAppointmentsTask.java
  11. 20
      src/main/java/com/cjy/back/ybsjAppointment/utils/DateUtil.java
  12. 100
      src/main/java/com/cjy/util/HttpUtil.java
  13. 10
      src/main/resources/application.properties

@ -13,6 +13,7 @@ import org.springframework.context.annotation.EnableMBeanExport;
import org.springframework.context.annotation.Import;
import org.springframework.context.annotation.ImportResource;
import org.springframework.jmx.support.RegistrationPolicy;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.transaction.annotation.EnableTransactionManagement;
import java.util.Date;
@ -27,7 +28,7 @@ import java.util.Timer;
// jmx 管理
@EnableMBeanExport(registration = RegistrationPolicy.IGNORE_EXISTING)
@MapperScan({"com.cjy.*.dao","com.cjy.*.*.dao"})
@EnableScheduling
public class StartUp extends SpringBootServletInitializer {
@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {

@ -71,7 +71,7 @@ public interface YbsjyAppointmentRecordMapper {
/**
* 获取当天预约且核销的预约数据
* 获取当天预约且核销的预约数据
*/
List<AppointmentPersonVO> getAppointmentNotWrittenOffRecord();
@ -81,4 +81,18 @@ public interface YbsjyAppointmentRecordMapper {
* @return
*/
int updateAppointmentRecordSate(Long id);
/**
* 获取未核销数量
* @param id
* @return
*/
int getNotWrittenOffCount(Long id);
/**
* 修改预约单状态
* @param Id
* @return
*/
int updateDocumentsSate(Long Id);
}

@ -24,7 +24,10 @@
where appointment_documents_id = #{id}
</update>
<update id="updateAppointmentRecordSate">
update ybsj_appointment_people_info set expired_state=1,write_off=3 where id=#{id}
update ybsj_appointment_people_info set expired_state=1,write_off=3,update_by=NOW() where id=#{id}
</update>
<update id="updateDocumentsSate">
update ybsj_appointment_documents_info set appointment_documents_write_off =1,update_by=NOW() where id=#{id}
</update>
<select id="getAppointmentRecordListByPage" resultType="java.util.Map">
@ -93,7 +96,8 @@
reservation_code as reservationCode,
write_off as writeOff,
write_off_date as writeOffDate,
qr_content as qrContent
qr_content as qrContent,
expired_state as expired_state
from ybsj_appointment_people_info
where appointment_documents_id = #{id}
</select>
@ -209,6 +213,10 @@
LEFT JOIN ybsj_appointment_time_info t2 on t1.appointment_time_info_id=t2.id
WHERE
t1.write_off_date IS NULL
AND t1.appointment_date = CURDATE() and write_off =0 and del_flag!=2
and t1.write_off =0 and t1.del_flag!=2
-- AND t1.appointment_date = CURDATE()
</select>
<select id="getNotWrittenOffCount" resultType="java.lang.Integer">
select count(*) from ybsj_appointment_people_info WHERE appointment_documents_id=#{id} and write_off=0
</select>
</mapper>

@ -1,5 +1,6 @@
package com.cjy.back.ybsjAppointment.dao;
import com.cjy.back.ybsjAppointment.entity.AppointmentRequestTurnstileLogEntity;
import com.cjy.back.ybsjAppointment.entity.AppointmentTimeInfoEntity;
import com.cjy.back.ybsjAppointment.entity.YbsjyAppointmentSettingEntity;
import com.cjy.back.ybsjAppointment.entity.vo.AppletsAppointmentListVO;
@ -159,5 +160,24 @@ public interface YbsjyAppointmentSettingMapper {
*/
int saveAppointmentPeopleInfo(@Param("list") List<AppointmentPersonVO> list);
/**
* 获取预约单中的每个人是否有过预约
* @param appointmentTimeInfoId
* @param appointmentPersonVOS
* @param date
* @return
*/
int getReservationInformation(@Param("appointmentTimeInfoId") Long appointmentTimeInfoId, @Param("list") List<AppointmentPersonVO> appointmentPersonVOS,@Param("date") String date);
/**
* 保存 请求闸机 日志 便于定时任务重试
* @param appointmentRequestTurnstileLogEntity
* @return
*/
int saveAppointmentRequestTurnstileLog(AppointmentRequestTurnstileLogEntity appointmentRequestTurnstileLogEntity);
/**
* 获取当天 未核销的预约订单数量
*/
int getNotWrittenOffAppointmentDocumentsCount(@Param("date") String date,@Param("unionId") String unionId);
}

@ -42,6 +42,10 @@
</foreach>
</insert>
<insert id="saveAppointmentRequestTurnstileLog">
INSERT INTO ybsj_appointment_request_turnstile_log (request_url, request_params, response_body, state)
VALUES ( #{requestUrl}, #{requestParams}, #{responseBody}, #{state})
</insert>
<update id="updateAppointmentSetting">
update ybsj_appointment_setting
<trim prefix="SET" suffixOverrides=",">
@ -167,9 +171,12 @@
</select>
<select id="getReservationInformation" resultType="java.lang.Integer">
select count(*) from ybsj_appointment_people_info where
appointment_time_info_id=#{appointmentTimeInfoId} and appointment_date=#{date} and documents_number in
appointment_time_info_id=#{appointmentTimeInfoId} and appointment_date=#{date} and write_off=0 and documents_number in
<foreach collection="list" item="item" open="(" separator="," close=")">
#{item.documentsNumber}
</foreach>
</select>
<select id="getNotWrittenOffAppointmentDocumentsCount" resultType="java.lang.Integer">
select count(*) from ybsj_appointment_documents_info where appointment_date=#{date} and union_id=#{unionId} and appointment_documents_write_off=0
</select>
</mapper>

@ -0,0 +1,44 @@
package com.cjy.back.ybsjAppointment.entity;
/**
* @author liangjiawei
* @createDate 2023/7/31
*/
public class AppointmentRequestTurnstileLogEntity {
private String requestUrl;
private String requestParams;
private String responseBody;
private String state;
public String getRequestUrl() {
return requestUrl;
}
public void setRequestUrl(String requestUrl) {
this.requestUrl = requestUrl;
}
public String getRequestParams() {
return requestParams;
}
public void setRequestParams(String requestParams) {
this.requestParams = requestParams;
}
public String getResponseBody() {
return responseBody;
}
public void setResponseBody(String responseBody) {
this.responseBody = responseBody;
}
public String getState() {
return state;
}
public void setState(String state) {
this.state = state;
}
}

@ -74,4 +74,18 @@ public interface YbsjyAppointmentRecordService {
* @return
*/
int updateAppointmentRecordSate(Long id);
/**
* 获取未核销的数量
* @param id
* @return
*/
int getNotWrittenOffCount(Long id);
/**
* 修改预约单状态
* @param id
* @return
*/
int updateDocumentsSate(Long id);
}

@ -281,4 +281,25 @@ public class YbsjyAppointmentRecordImpl implements YbsjyAppointmentRecordService
public int updateAppointmentRecordSate(Long id) {
return ybsjyAppointmentRecordMapper.updateAppointmentRecordSate(id);
}
/**
* 获取未核销数量
* @param id
* @return
*/
@Override
public int getNotWrittenOffCount(Long id) {
return ybsjyAppointmentRecordMapper.getNotWrittenOffCount(id);
}
/**
* 修改预约单状态
* @param id
* @return
*/
@Override
public int updateDocumentsSate(Long id) {
return ybsjyAppointmentRecordMapper.updateDocumentsSate(id);
}
}

@ -1,7 +1,9 @@
package com.cjy.back.ybsjAppointment.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.cjy.back.ybsjAppointment.dao.YbsjyAppointmentRecordMapper;
import com.cjy.back.ybsjAppointment.dao.YbsjyAppointmentSettingMapper;
import com.cjy.back.ybsjAppointment.entity.AppointmentRequestTurnstileLogEntity;
import com.cjy.back.ybsjAppointment.entity.AppointmentTimeInfoEntity;
import com.cjy.back.ybsjAppointment.entity.YbsjyAppointmentSettingEntity;
import com.cjy.back.ybsjAppointment.entity.vo.*;
@ -9,8 +11,10 @@ import com.cjy.back.ybsjAppointment.service.YbsjyAppointmentSettingService;
import com.cjy.back.ybsjAppointment.utils.AppointmentNumberUtil;
import com.cjy.back.ybsjAppointment.utils.DateUtil;
import com.cjy.common.PageWrapper;
import com.cjy.util.HttpUtil;
import com.cjy.util.ServerResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -29,6 +33,16 @@ public class YbsjyAppointmentSettingServiceImpl implements YbsjyAppointmentSetti
@Autowired
YbsjyAppointmentRecordMapper ybsjyAppointmentRecordMapper;
@Value("${turnstile.url}")
private String turnstileUrl;
@Value("${turnstile.addAccessRight}")
private String addAccessRight;
@Value("${turnstile.addVisitor}")
private String addVisitor;
@Value("${turnstile.updateQRCodev}")
private String updateQRCodev;
/**
* 预约设置添加
*
@ -205,6 +219,10 @@ public class YbsjyAppointmentSettingServiceImpl implements YbsjyAppointmentSetti
@Override
@Transactional
public ServerResponse reservationNow(ReservationNowVO reservationNowVO) {
// 先判断是否有未核销的预约单 如果有未核销的订单则提示请先取消或者等待 预约过期
if(ybsjyAppointmentSettingMapper.getNotWrittenOffAppointmentDocumentsCount(reservationNowVO.getAppointmentDate(),reservationNowVO.getUnionId()) >0){
return ServerResponse.createByError("预约失败,有待核销的预约单。请先取消订单或等待订单过期!");
}
//获取该时间段预约了多少人
int reservedCount = ybsjyAppointmentSettingMapper.getAppointmentCount(reservationNowVO.getAppointmentTimeInfoId(),reservationNowVO.getAppointmentDate());
AppointmentTimeInfoEntity appointmentTimeInfoEntity = ybsjyAppointmentSettingMapper.getPeriodInfo(reservationNowVO.getAppointmentTimeInfoId());
@ -218,7 +236,6 @@ public class YbsjyAppointmentSettingServiceImpl implements YbsjyAppointmentSetti
return ServerResponse.createByError("预约失败,当前时间大于预约时段的结束时间");
} else {
//生成预约单
appointmentFormVO.setAppointmentNumber(AppointmentNumberUtil.generateOrderNumber());
appointmentFormVO.setAppointmentCount(reservationNowVO.getAppointmentPersonList().size());
appointmentFormVO.setAppointmentDate(reservationNowVO.getAppointmentDate());
@ -227,6 +244,7 @@ public class YbsjyAppointmentSettingServiceImpl implements YbsjyAppointmentSetti
appointmentFormVO.setCreateBy(reservationNowVO.getUnionId());
appointmentFormVO.setScenicId(reservationNowVO.getScenicId());
}
} else {
//生成预约单
appointmentFormVO.setAppointmentNumber(AppointmentNumberUtil.generateOrderNumber());
@ -237,23 +255,72 @@ public class YbsjyAppointmentSettingServiceImpl implements YbsjyAppointmentSetti
appointmentFormVO.setCreateBy(reservationNowVO.getUnionId());
appointmentFormVO.setScenicId(reservationNowVO.getScenicId());
}
//插入预约单
ybsjyAppointmentSettingMapper.saveAppointmentDocumentsInfo(appointmentFormVO);
//这里还需要判断一下预约人中是否有过预约的
if(ybsjyAppointmentSettingMapper.getReservationInformation(reservationNowVO.getAppointmentTimeInfoId(),reservationNowVO.getAppointmentPersonList(),reservationNowVO.getAppointmentDate()) >0){
return ServerResponse.createByError("预约失败,预约单中有人已预约。");
}
//插入预约单
ybsjyAppointmentSettingMapper.saveAppointmentDocumentsInfo(appointmentFormVO);
//插入预约人信息表
reservationNowVO.getAppointmentPersonList().stream().forEach(item ->{
item.setReservationCode(AppointmentNumberUtil.generateOrderNumber());
item.setAppointmentTimeInfoId(reservationNowVO.getAppointmentTimeInfoId());
item.setAppointmentDocumentsId(appointmentFormVO.getId());
item.setAppointmentDate(reservationNowVO.getAppointmentDate());
//设置权限
Map<String,String> map= new HashMap<>();
map.put("idCard",item.getDocumentsNumber());
map.put("startTime",item.getAppointmentDate()+" " +reservationNowVO.getStartTime()+":00");
map.put("endTime",item.getAppointmentDate()+" " +reservationNowVO.getEndTime()+":00");
String responseString =HttpUtil.sendPost(turnstileUrl+addAccessRight,map);
//记录访问日志
JSONObject accessRightResponseJson = JSONObject.parseObject(responseString);
//记录访问日志
AppointmentRequestTurnstileLogEntity addAccessRightAppointmentRequestTurnstileLogEntity=new AppointmentRequestTurnstileLogEntity();
addAccessRightAppointmentRequestTurnstileLogEntity.setRequestUrl(turnstileUrl+addAccessRight);
addAccessRightAppointmentRequestTurnstileLogEntity.setRequestParams(map.toString());
addAccessRightAppointmentRequestTurnstileLogEntity.setResponseBody(responseString);
addAccessRightAppointmentRequestTurnstileLogEntity.setState(accessRightResponseJson.get("code").toString());
ybsjyAppointmentSettingMapper.saveAppointmentRequestTurnstileLog(addAccessRightAppointmentRequestTurnstileLogEntity);
//添加访客
Map<String,String> map1= new HashMap<>();
map1.put("idCard",item.getDocumentsNumber());
map1.put("startTime",item.getAppointmentDate()+" " +reservationNowVO.getStartTime()+":00");
map1.put("endTime",item.getAppointmentDate()+" " +reservationNowVO.getEndTime()+":00");
String addVisitorResponseString = HttpUtil.sendPost(turnstileUrl+addVisitor,map1);
JSONObject addVisitorResponseJson = JSONObject.parseObject(addVisitorResponseString);
//记录访问日志
AppointmentRequestTurnstileLogEntity VisitorResponseJsonAppointmentRequestTurnstileLogEntity=new AppointmentRequestTurnstileLogEntity();
VisitorResponseJsonAppointmentRequestTurnstileLogEntity.setRequestUrl(turnstileUrl+addVisitor);
VisitorResponseJsonAppointmentRequestTurnstileLogEntity.setRequestParams(map1.toString());
VisitorResponseJsonAppointmentRequestTurnstileLogEntity.setResponseBody(addVisitorResponseString);
VisitorResponseJsonAppointmentRequestTurnstileLogEntity.setState(addVisitorResponseJson.get("code").toString());
ybsjyAppointmentSettingMapper.saveAppointmentRequestTurnstileLog(VisitorResponseJsonAppointmentRequestTurnstileLogEntity);
//获取二维码信息
Map<String,String> map2= new HashMap<>();
map2.put("idCard",item.getDocumentsNumber());
map2.put("endTime",item.getAppointmentDate()+" " +reservationNowVO.getEndTime()+":00");
String updateQRCodevResponseString = HttpUtil.sendPost(turnstileUrl+updateQRCodev,map2);
JSONObject json = JSONObject.parseObject(updateQRCodevResponseString);
JSONObject json1= JSONObject.parseObject(json.get("data").toString());
//记录访问日志
AppointmentRequestTurnstileLogEntity appointmentRequestTurnstileLogEntity=new AppointmentRequestTurnstileLogEntity();
appointmentRequestTurnstileLogEntity.setRequestUrl(turnstileUrl+updateQRCodev);
appointmentRequestTurnstileLogEntity.setRequestParams(map2.toString());
appointmentRequestTurnstileLogEntity.setResponseBody(updateQRCodevResponseString);
appointmentRequestTurnstileLogEntity.setState(json.get("code").toString());
ybsjyAppointmentSettingMapper.saveAppointmentRequestTurnstileLog(appointmentRequestTurnstileLogEntity);
item.setQrContent(json1.get("二维码信息").toString());
});
ybsjyAppointmentSettingMapper.saveAppointmentPeopleInfo(reservationNowVO.getAppointmentPersonList());
//设置权限
//
}else {
return ServerResponse.createByError("预约失败,预约人数已满");
}
@ -309,4 +376,6 @@ public class YbsjyAppointmentSettingServiceImpl implements YbsjyAppointmentSetti
appointmentDocumentsDetails.setList(list);
return ServerResponse.createBySuccess(appointmentDocumentsDetails);
}
}

@ -4,6 +4,7 @@ import com.cjy.back.ybsjAppointment.entity.vo.AppointmentPersonVO;
import com.cjy.back.ybsjAppointment.service.YbsjyAppointmentRecordService;
import com.cjy.back.ybsjAppointment.utils.DateUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import java.util.List;
@ -20,23 +21,29 @@ public class HandleExpiredAppointmentsTask {
/**
* 处理过期预约人信息
*
* 一小时扫描一次
*/
@Scheduled(cron = "0 0/60 * * * ?")
// @Scheduled(cron = "0 0/1 * * * ?")
public void handleExpiredAppointments() {
// 第一步先获取到 当天 未核销的数据
List<AppointmentPersonVO> list = ybsjyAppointmentRecordService.getAppointmentNotWrittenOffRecord();
list.stream().forEach(item -> {
//如果当前时间大于结束时间
if (DateUtil.isAfterEndTime(item.getEndTime())) {
//就将该数据修改取消 且是过期的
ybsjyAppointmentRecordService.updateAppointmentRecordSate(item.getId());
// List<AppointmentPersonVO> appointmentPersonVOList=ybsjyAppointmentRecordService.getAppointmentRecordByAppointmentDocumentsId(item.getAppointmentDocumentsId());
if (!list.isEmpty()) {
list.stream().forEach(item -> {
//如果当前时间大于结束时间
if (DateUtil.isAfterEndDateTime(item.getAppointmentDate() +" " +item.getEndTime())) {
//就将该数据修改取消 且是过期的
ybsjyAppointmentRecordService.updateAppointmentRecordSate(item.getId());
//未核销数量
int notWrittenOffCount = ybsjyAppointmentRecordService.getNotWrittenOffCount(item.getAppointmentDocumentsId());
//如果该单子未核销数量为0 则表示单子都是处理过的状态 可以把单子修改为已核销
if (notWrittenOffCount == 0) {
//修改预约单状态
ybsjyAppointmentRecordService.updateDocumentsSate(item.getAppointmentDocumentsId());
}
}
});
}
}
});
}
/**
* 处理过期预约单
*/
}

@ -2,6 +2,7 @@ package com.cjy.back.ybsjAppointment.utils;
import java.time.DayOfWeek;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;
import java.time.format.DateTimeFormatter;
@ -52,7 +53,24 @@ public class DateUtil {
}
}
public static boolean isAfterEndDateTime(String endTime) {
// 获取当前时间
LocalDateTime currentTime = LocalDateTime.now();
// 解析结束时间
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm");
LocalDateTime endTimeParsed = LocalDateTime.parse(endTime, formatter);
// 判断当前时间是否大于结束时间
if (currentTime.isAfter(endTimeParsed)) {
return true;
} else {
return false;
}
}
public static void main(String[] args) {
System.out.println(DateUtil.isAfterEndTime("09:00"));
System.out.println(DateUtil.isAfterEndDateTime("2023-07-30 09:00"));
}
}

@ -5,6 +5,7 @@ import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLConnection;
import java.net.URLEncoder;
import java.nio.charset.Charset;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
@ -16,10 +17,17 @@ import org.apache.http.Header;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.HttpStatus;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.HttpClient;
import org.apache.http.client.config.RequestConfig;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.util.EntityUtils;
import org.apache.log4j.Logger;
/**
@ -498,5 +506,97 @@ public class HttpUtil {
System.err.println("result:" + result);
return result;
}
public static String doGet(String url) {
CloseableHttpClient httpClient = null;
CloseableHttpResponse response = null;
String result = "";
try {
//通过默认配置创建一个httpClient实例
httpClient = HttpClients.createDefault();
//创建httpGet远程连接实例
org.apache.http.client.methods.HttpGet httpGet = new HttpGet(url);
//httpGet.addHeader("Connection", "keep-alive");
//设置请求头信息
httpGet.addHeader("Accept", "application/json");
//配置请求参数
RequestConfig requestConfig = RequestConfig.custom()
.setConnectTimeout(35000) //设置连接主机服务超时时间
.setConnectionRequestTimeout(35000)//设置请求超时时间
.setSocketTimeout(60000)//设置数据读取超时时间
.build();
//为httpGet实例设置配置
httpGet.setConfig(requestConfig);
//执行get请求得到返回对象
response = httpClient.execute(httpGet);
//通过返回对象获取返回数据
HttpEntity entity = response.getEntity();
//通过EntityUtils中的toString方法将结果转换为字符串,后续根据需要处理对应的reponse code
result = EntityUtils.toString(entity);
System.out.println(result);
} catch (ClientProtocolException e) {
e.printStackTrace();
} catch (IOException ioe) {
ioe.printStackTrace();
} catch (Exception e) {
e.printStackTrace();
} finally {
//关闭资源
if (response != null) {
try {
response.close();
} catch (IOException ioe) {
ioe.printStackTrace();
}
}
if (httpClient != null) {
try {
httpClient.close();
} catch (IOException ioe) {
ioe.printStackTrace();
}
}
}
return result;
}
public static String sendPost(String url, Map<String, String> params) {
try {
StringBuilder requestBody = new StringBuilder();
for (Map.Entry<String, String> entry : params.entrySet()) {
requestBody.append("\"").append(entry.getKey()).append("\":\"").append(entry.getValue()).append("\",");
}
requestBody.deleteCharAt(requestBody.length() - 1); // 删除最后一个逗号
requestBody.insert(0, "{").append("}");
URL obj = new URL(url);
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
con.setDoOutput(true);
con.setRequestProperty("Content-Type", "application/json");
OutputStream os = con.getOutputStream();
os.write(requestBody.toString().getBytes());
os.flush();
os.close();
int responseCode = con.getResponseCode();
if (responseCode == HttpURLConnection.HTTP_OK) {
BufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream(), Charset.forName("UTF-8")));
String inputLine;
StringBuilder response = new StringBuilder();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println("response " + response.toString());
return response.toString();
} else {
System.out.println("Error occurred. Response code: " + responseCode);
}
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
}

@ -187,4 +187,12 @@ HKappkey=25620685
#秘钥appSecret
HKappSecret=Acvnz7SPTq4wPRSSg7az
#协议
HKxieyi=http://
HKxieyi=http://
turnstile.url =http://192.168.130.155:33307
turnstile.addAccessRight = /access/addAccessRight
turnstile.addVisitor = /access/addVisitor
turnstile.updateQRCodev = /access/updateQRCode

Loading…
Cancel
Save