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

View File

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