Commit 46c5d3a4 by ddx

add query errorcode log

parent 1c1e7e49
...@@ -1021,8 +1021,7 @@ public class InvoiceFileServiceImpl implements InvoiceFileService { ...@@ -1021,8 +1021,7 @@ public class InvoiceFileServiceImpl implements InvoiceFileService {
ResponseContent ret = HttpHelper.postJsonEntity(FileConstants.taxQueryUrl, json.toString()); ResponseContent ret = HttpHelper.postJsonEntity(FileConstants.taxQueryUrl, json.toString());
resultJson = JSONObject.parseObject(ret.getContent()); resultJson = JSONObject.parseObject(ret.getContent());
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); log.info(uuidFlag + " taxno is " + taxno + " queryTokenInfo is error! ", e);
log.info(uuidFlag + " taxno is " + taxno + " queryTokenInfo is error! " + e);
} }
log.info(uuidFlag + " taxno is " + taxno + " queryTokenInfo request result:" + (resultJson == null ? "null" : resultJson.toJSONString())); log.info(uuidFlag + " taxno is " + taxno + " queryTokenInfo request result:" + (resultJson == null ? "null" : resultJson.toJSONString()));
return resultJson; return resultJson;
......
...@@ -12,8 +12,8 @@ import java.util.Map; ...@@ -12,8 +12,8 @@ import java.util.Map;
public class UserManageTest { public class UserManageTest {
String accessKeyID = "echangcheng"; String accessKeyID = "edaxiang";
static String accessKeySecret = "echangcheng#@rrwea2"; static String accessKeySecret = "edaxiang#@f26ads";
static String host = "https://api.taxservices.cn"; static String host = "https://api.taxservices.cn";
...@@ -36,8 +36,8 @@ public class UserManageTest { ...@@ -36,8 +36,8 @@ public class UserManageTest {
param.put("timeStamp",timeStamp); param.put("timeStamp",timeStamp);
param.put("version","1.0"); param.put("version","1.0");
param.put("signature",getSign(signStr)); param.put("signature",getSign(signStr));
param.put("taxno","915106002051041291"); param.put("taxno","91500105MAEHWYHM39");
param.put("taxType","0"); param.put("taxType","1");
System.out.println(url); System.out.println(url);
ResponseContent ret = HttpHelper.postJsonEntity(url,JSON.toJSONString(param)); ResponseContent ret = HttpHelper.postJsonEntity(url,JSON.toJSONString(param));
System.out.println(ret.getContent()); System.out.println(ret.getContent());
......
...@@ -633,11 +633,13 @@ public class TkTokenServiceImpl implements TkTokenService { ...@@ -633,11 +633,13 @@ public class TkTokenServiceImpl implements TkTokenService {
@Override @Override
public JsonResult<TkTokenRemarkLog> queryTokenErrorInfo(TkToken tkToken) { public JsonResult<TkTokenRemarkLog> queryTokenErrorInfo(TkToken tkToken) {
JsonResult<TkTokenRemarkLog> jsonResult = new JsonResult<>(); JsonResult<TkTokenRemarkLog> jsonResult = new JsonResult<>();
String uuId = UUIDGenerator.generate();
logger.info(uuId + " queryTokenErrorInfo userCode is " + tkToken.getUserCode() + " ,taxno is " + tkToken.getTaxno());
TkTokenRemarkLogExample example = new TkTokenRemarkLogExample(); TkTokenRemarkLogExample example = new TkTokenRemarkLogExample();
example.createCriteria().andTaxnoEqualTo(tkToken.getTaxno()).andUserCodeEqualTo(tkToken.getUserCode()); example.createCriteria().andTaxnoEqualTo(tkToken.getTaxno()).andUserCodeEqualTo(tkToken.getUserCode());
TkTokenRemarkLog tkTokenRemarkLog = tkTokenRemarkLogService.getOne(example); TkTokenRemarkLog tkTokenRemarkLog = tkTokenRemarkLogService.getOne(example);
logger.info(uuId + " queryTokenErrorInfo errorResult is " + (null==tkTokenRemarkLog?"no find error!":tkTokenRemarkLog.getTokenCode()+tkTokenRemarkLog.getRemarks()));
//检测是否在token表存在 //检测是否在token表存在
String tokenFlag = "0"; String tokenFlag = "0";
TkTokenExample tokenExample = new TkTokenExample(); TkTokenExample tokenExample = new TkTokenExample();
...@@ -646,13 +648,14 @@ public class TkTokenServiceImpl implements TkTokenService { ...@@ -646,13 +648,14 @@ public class TkTokenServiceImpl implements TkTokenService {
if(tokenCount>0) { if(tokenCount>0) {
tokenFlag = "1"; tokenFlag = "1";
} }
if(null != tkTokenRemarkLog && getStopFlag(tkTokenRemarkLog.getTokenCode(), tkToken.getUserType(), tkToken.getTokenStatus())){ if(null != tkTokenRemarkLog){
tkTokenRemarkLog.setTokenDate(tkTokenRemarkLog.getUpdateDate() != null ? new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(tkTokenRemarkLog.getUpdateDate()) : ""); tkTokenRemarkLog.setTokenDate(tkTokenRemarkLog.getUpdateDate() != null ? new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(tkTokenRemarkLog.getUpdateDate()) : "");
} else { } else {
tkTokenRemarkLog = new TkTokenRemarkLog(); tkTokenRemarkLog = new TkTokenRemarkLog();
} }
tkTokenRemarkLog.setTokenFlag(tokenFlag); tkTokenRemarkLog.setTokenFlag(tokenFlag);
jsonResult.setData(tkTokenRemarkLog); jsonResult.setData(tkTokenRemarkLog);
logger.info(uuId + " queryTokenErrorInfo last result is " + JSON.toJSONString(jsonResult));
return jsonResult; return jsonResult;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment