This commit is contained in:
zc
2026-02-06 15:20:25 +08:00
parent 49037cf063
commit 8a51bd9ed7
2 changed files with 526 additions and 504 deletions

View File

@@ -615,10 +615,10 @@ public class CardController {
@ApiOperation("实时接口")
public JSONObject real(@RequestBody JSONObject json) {
JSONObject result = new JSONObject();
Gson gson = new Gson();
System.out.println("实时接口=========" + json);
//如果有记录时则要处理记录后再应答保存后的id回传给设备方便设备对记录作标志 cardpwd FFFFFFFFFFFF
String api=json.get("api")+"";
String api = json.getString("api");
//判断是否是人员查询接口
if ("infoquery".equals(api)) {
//判断人员查询是否成功
JSONObject params = JSONObject.parseObject(JSONObject.toJSONString(json.get("params")));
@@ -701,10 +701,11 @@ public class CardController {
result.put("msg", msg);
return result;
}
//判断是否是无点餐接口
if ("posonline".equals(api)) {
//无点餐时上传
JSONObject params = JSONObject.parseObject(JSONObject.toJSONString(json.get("params")));
String devId=json.get("dev_id")+"";
String devId = json.getString("dev_id");
SysPeople people = new SysPeople();
//总金额
Long amount = Long.parseLong(params.get("amount") + "");//交易金额
@@ -952,8 +953,7 @@ public class CardController {
throw new RuntimeException(e);
}
}
}
else{
} else {
result.put("tts", "余次不足");
JSONObject obj = new JSONObject();
obj.put("line", "余次不足");
@@ -1394,12 +1394,12 @@ public class CardController {
System.out.println("人脸设备实时控制=========" + json);
JSONObject result = new JSONObject();
JSONObject params = JSONObject.parseObject(JSONObject.toJSONString(json.get("params")));
String account_id=params.get("pay_code")+"";
String devId=json.get("dev_id")+"";
String account_id = params.getString("pay_code");
String devId = json.getString("dev_id");
SysPeople people = peopleService.selectSysPeopleById(Long.parseLong(account_id));
SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
SimpleDateFormat sdf2 = new SimpleDateFormat("yyyy-MM-dd");
Date startDate=new Date(Long.parseLong(params.get("sign_time")+""));
Date startDate = new Date(params.getLong("sign_time"));
String timeType = "";
Long timeId = 0L;
try {

View File

@@ -1,21 +1,43 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<include resource="org/springframework/boot/logging/logback/base.xml" />
<logger name="org.springframework.web" level="INFO"/>
<logger name="org.springboot.sample" level="TRACE" />
<configuration scan="true" scanPeriod="60 seconds" debug="false">
<!-- 日志存放路径 -->
<property name="log.path" value="logs/thxf" />
<!-- 日志输出格式 -->
<property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n" />
<!-- 开发、测试环境 -->
<springProfile name="dev,test">
<logger name="org.springframework.web" level="INFO"/>
<logger name="org.springboot.sample" level="INFO" />
<logger name="io.renren" level="DEBUG" />
</springProfile>
<!-- 控制台输出 -->
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>${log.pattern}</pattern>
</encoder>
</appender>
<!-- 生产环境 -->
<springProfile name="prod">
<logger name="org.springframework.web" level="ERROR"/>
<logger name="org.springboot.sample" level="ERROR" />
<logger name="io.renren" level="ERROR" />
</springProfile>
<!-- 系统日志输出 -->
<appender name="file_all" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${log.path}/xf.log</file>
<!-- 循环政策:基于时间创建日志文件 -->
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- 日志文件名格式 -->
<fileNamePattern>${log.path}/xf.%d{yyyy-MM-dd}.log</fileNamePattern>
<!-- 日志最大的历史 60天 -->
<maxHistory>60</maxHistory>
</rollingPolicy>
<encoder>
<pattern>${log.pattern}</pattern>
</encoder>
</appender>
<!-- 系统模块日志级别控制 -->
<logger name="io.renren" level="info" />
<!-- Spring日志级别控制 -->
<logger name="org.springframework" level="warn" />
<root level="info">
<appender-ref ref="console" />
</root>
<!--系统操作日志-->
<root level="info">
<appender-ref ref="file_all" />
</root>
</configuration>