fix:电子税局登陆相关接口修改为请求体传key和id

jianshui-ui
路明慧 1 year ago
parent f6e77745e1
commit 1f4687f32c
  1. 44
      jianshui-admin/src/main/java/com/jianshui/api/controller/http/invoice/v1/InvoiceFrontController.java
  2. 2
      jianshui-invoice-all/src/main/java/com/jianshui/invoiceall/service/impl/InvoiceAllImpl.java
  3. BIN
      jianshui-ui/dist.zip

@ -35,19 +35,19 @@ public class InvoiceFrontController {
@ApiImplicitParam(name = "secret", value = "身份认证Key", dataType = "java.lang.String", example = "LTEO+oOgWMsuQAOUglqXuQ==", required = true),
@ApiImplicitParam(name = "params", value = "请求体", dataType = "java.lang.String", required = true)
})
@PostMapping("/rpaLogin/{identity}/{secret}")
public Object rpaLogin(@RequestBody Map<String,Object> params,@PathVariable("identity") String identity, @PathVariable("secret") String secret) {
@PostMapping("/rpaLogin")
public Object rpaLogin(@RequestBody Map<String,Object> params) {
JSONObject paramJson = new JSONObject(params);
log.debug("rpaLogin param{} identity:{} secret:{}", paramJson.toJSONString(), identity, secret);
log.debug("rpaLogin param{}", paramJson.toJSONString());
//参数校验
if (StringUtils.isBlank(identity)){
if (StringUtils.isBlank(paramJson.getString("identity"))){
return AjaxResult.error("公司ID不能为空");
}
if (StringUtils.isBlank(secret)){
if (StringUtils.isBlank(paramJson.getString("secret"))){
return AjaxResult.error("公司Key不能为空");
}
@ -83,8 +83,8 @@ public class InvoiceFrontController {
paramJson.put("ffm","sms_login");
}
Companyservice companyservice = iCompanyserviceService.selectCompanyserviceByIdentity(identity);
if (companyservice == null || !secret.equals(companyservice.getSecret())) {
Companyservice companyservice = iCompanyserviceService.selectCompanyserviceByIdentity(paramJson.getString("identity"));
if (companyservice == null || !paramJson.getString("secret").equals(companyservice.getSecret())) {
return AjaxResult.error(ErrorCode.COMPANY_NOT_FOUND);
}
@ -100,9 +100,13 @@ public class InvoiceFrontController {
@ApiImplicitParam(name = "identity", value = "身份认证", dataType = "java.lang.String", example = "1130", required = true),
@ApiImplicitParam(name = "secret", value = "身份认证Key", dataType = "java.lang.String", example = "LTEO+oOgWMsuQAOUglqXuQ==", required = true)
})
@PostMapping("/queryRpaTaxAccount/{identity}/{secret}")
public Object queryRpaTaxAccount(@PathVariable("identity") String identity, @PathVariable("secret") String secret ){
@PostMapping("/queryRpaTaxAccount")
public Object queryRpaTaxAccount(@RequestBody Map<String,Object> params){
JSONObject paramJson = new JSONObject(params);
String identity = paramJson.getString("identity");
String secret = paramJson.getString("secret");
log.debug("queryRpaTaxAccount param identity:{} secret:{}",identity,secret);
//参数校验
if (StringUtils.isBlank(identity)){
@ -130,12 +134,14 @@ public class InvoiceFrontController {
@ApiImplicitParam(name = "secret", value = "身份认证Key", dataType = "java.lang.String", example = "LTEO+oOgWMsuQAOUglqXuQ==", required = true),
@ApiImplicitParam(name = "yhm", value = "电子税局登陆账号", dataType = "java.lang.String", required = true)
})
@PostMapping("/getRpaQrCode/{identity}/{secret}")
public Object getRpaQrCode(@RequestBody Map<String,Object> params,@PathVariable("identity") String identity, @PathVariable("secret") String secret ) {
@PostMapping("/getRpaQrCode")
public Object getRpaQrCode(@RequestBody Map<String,Object> params) {
JSONObject paramJson = new JSONObject(params);
log.debug("getRpaQrCode param params:{} identity:{} secret:{}", paramJson,identity,secret);
log.debug("getRpaQrCode param params:{}", paramJson);
String identity = paramJson.getString("identity");
String secret = paramJson.getString("secret");
//参数校验
if (StringUtils.isBlank(identity)){
return AjaxResult.error("公司ID不能为空");
@ -145,9 +151,9 @@ public class InvoiceFrontController {
return AjaxResult.error("公司Key不能为空");
}
if (StringUtils.isBlank(paramJson.getString("yhm"))){
return AjaxResult.error("电子税局登录名不能为空");
}
// if (StringUtils.isBlank(paramJson.getString("yhm"))){
// return AjaxResult.error("电子税局登录名不能为空");
// }
Companyservice companyservice = iCompanyserviceService.selectCompanyserviceByIdentity(identity);
@ -168,12 +174,14 @@ public class InvoiceFrontController {
@ApiImplicitParam(name = "secret", value = "身份认证Key", dataType = "java.lang.String", example = "LTEO+oOgWMsuQAOUglqXuQ==", required = true),
@ApiImplicitParam(name = "params", value = "请求体", dataType = "java.lang.String", required = true)
})
@PostMapping("/getRpaAuthStatus/{identity}/{secret}")
public Object getRpaAuthStatus(@RequestBody Map<String,Object> params, @PathVariable("identity") String identity, @PathVariable("secret") String secret ) {
@PostMapping("/getRpaAuthStatus")
public Object getRpaAuthStatus(@RequestBody Map<String,Object> params) {
JSONObject paramJson = new JSONObject(params);
log.debug("getRpaAuthStatus param{} identity:{} secret:{}", paramJson.toJSONString(), identity, secret);
log.debug("getRpaAuthStatus param{}", paramJson.toJSONString());
String identity = paramJson.getString("identity");
String secret = paramJson.getString("secret");
//参数校验
if (StringUtils.isBlank(identity)){

@ -171,7 +171,7 @@ public class InvoiceAllImpl implements IInvoiceAll {
} catch (Exception e) {
e.printStackTrace();
log.error("【金四服务类】【金财数科】【用户登记】API请求异常,外部报文返回code非0000。错误信息:{}", e.getMessage());
log.error("【金四服务类】【金财数科】【用户登记】API请求异常,外部报文返回code非0000。错误信息:{}", e);
return AjaxResult.error(ErrorCode.INCOME_ERROR);
}

Binary file not shown.
Loading…
Cancel
Save