新增非空判断, 调整日志位置

This commit is contained in:
andy 2025-08-27 10:12:45 +08:00
parent b7ca5fcffd
commit 3d5a53ef71
2 changed files with 5 additions and 4 deletions

View File

@ -200,10 +200,10 @@ public class PunchTheClockServiceImpl implements PunchTheClockService {
public String recordFace(String json){ public String recordFace(String json){
//解析收到的数据 //解析收到的数据
JSONObject jsonObject = JSONObject.parseObject(json); JSONObject jsonObject = JSONObject.parseObject(json);
log.info("获取打卡信息{}", jsonObject.toString());
String userId = jsonObject.getString("user_id"); String userId = jsonObject.getString("user_id");
String sn = jsonObject.getString("sn"); String sn = jsonObject.getString("sn");
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
SimpleDateFormat sdfd = new SimpleDateFormat("yyyy-MM-dd");
Date date = null; //打卡时间 Date date = null; //打卡时间
try{ try{
date = sdf.parse(jsonObject.getString("recog_time")); date = sdf.parse(jsonObject.getString("recog_time"));
@ -219,7 +219,6 @@ public class PunchTheClockServiceImpl implements PunchTheClockService {
//根据顺序获取打卡规则 //根据顺序获取打卡规则
EqButton eqButton = bt_list.get(Integer.parseInt(button)-1); EqButton eqButton = bt_list.get(Integer.parseInt(button)-1);
String rules = eqButton.getName(); //打卡规则 String rules = eqButton.getName(); //打卡规则
log.info("获取打卡信息{}", jsonObject.toString());
Map<String, PunchTheClockStrategyExchangeProcessor> mqttRequestExchangeProcessorMap = applicationContext.getBeansOfType(PunchTheClockStrategyExchangeProcessor.class); Map<String, PunchTheClockStrategyExchangeProcessor> mqttRequestExchangeProcessorMap = applicationContext.getBeansOfType(PunchTheClockStrategyExchangeProcessor.class);
for (PunchTheClockStrategyExchangeProcessor processor : mqttRequestExchangeProcessorMap.values()) { for (PunchTheClockStrategyExchangeProcessor processor : mqttRequestExchangeProcessorMap.values()) {
if(processor.accept(sn)){ if(processor.accept(sn)){

View File

@ -112,14 +112,16 @@ public class KingdeeRequestUtils {
Map<String, Object> resultMap = Collections.emptyMap(); Map<String, Object> resultMap = Collections.emptyMap();
if(resultArray != null && resultArray.size() > 0){ if(resultArray != null && resultArray.size() > 0){
JSONObject result = resultArray.getJSONObject(0); JSONObject result = resultArray.getJSONObject(0);
if(result != null){
resultMap.put("FSTAFFID", result.getInteger("FSTAFFID")); resultMap.put("FSTAFFID", result.getInteger("FSTAFFID"));
} }
}
return JSON.toJSONString(resultMap); return JSON.toJSONString(resultMap);
} }
private static JSONArray request(Map<String, String> params, BaseEnum paramEnum){ private static JSONArray request(Map<String, String> params, BaseEnum paramEnum){
log.error("{}====> 接口调用, 参数为:{} ", paramEnum.getDes(), JSON.toJSONString(params)); log.info("{}====> 接口调用, 参数为:{} ", paramEnum.getDes(), JSON.toJSONString(params));
String requestParam = buildParams(params, paramEnum); String requestParam = buildParams(params, paramEnum);
String resultJson = ""; String resultJson = "";