diff --git a/jianshui-admin/src/main/java/com/jianshui/api/controller/http/invoiceall/v1/InvoiceAllController.java b/jianshui-admin/src/main/java/com/jianshui/api/controller/http/invoiceall/v1/InvoiceAllController.java index 36e2837..88bee24 100644 --- a/jianshui-admin/src/main/java/com/jianshui/api/controller/http/invoiceall/v1/InvoiceAllController.java +++ b/jianshui-admin/src/main/java/com/jianshui/api/controller/http/invoiceall/v1/InvoiceAllController.java @@ -6,13 +6,15 @@ import com.jianshui.common.core.domain.entity.Companyservice; import com.jianshui.common.enums.ErrorCode; import com.jianshui.common.utils.StringUtils; import com.jianshui.invoiceall.domain.dto.*; +import com.jianshui.invoiceall.domain.dto.jcsk.AutonomousAuthorizationDTO; +import com.jianshui.invoiceall.domain.dto.jcsk.InvoiceAllSubmitNoteDTO; import com.jianshui.invoiceall.factory.IInvoceiAllServiceFactory; import com.jianshui.invoiceall.factory.IInvoiceAllRequestFactory; import com.jianshui.invoiceall.factory.IInvoiceAllResponseFactory; +import com.jianshui.invoiceall.service.AutonomousSqService; import com.jianshui.invoiceall.service.IInvoiceAll; import com.jianshui.invoiceall.service.IInvoiceAllRequestService; import com.jianshui.invoiceall.service.IInvoiceAllResponseService; -import com.jianshui.invoiceall.service.impl.InvoiceAllImpl; import com.jianshui.invoiceall.service.impl.adapter.request.AisinoIncomeRequestAdapterImpl; import com.jianshui.invoiceall.service.impl.adapter.response.AisinoIncomeResponseAdapterImpl; import com.jianshui.system.service.ICompanyserviceService; @@ -23,9 +25,7 @@ import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiOperation; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletRequest; @@ -55,10 +55,44 @@ public class InvoiceAllController { @Autowired private IInvoceiAllServiceFactory iInvoceiAllServiceFactory; + @Autowired + private AutonomousSqService autonomousSqService; //入口报文适配器标志 这个东西是AisinoIncomeRequestAdapterImpl 中间的那块儿 private final static String SERVICE_KEY = "invoiceall"; + + + @ApiOperation("自主授权") + @ApiImplicitParams({ + @ApiImplicitParam(name = "identity", value = "身份认证", dataType = "java.lang.Void", example = "1130", required = true), + @ApiImplicitParam(name = "inoviceAllQdLoginDTO", value = "请求体",dataType = "java.lang.Void", required = true)}) + @PostMapping("/api/invoice_all/v1/autonomousAuthorization") + public Object autonomousAuthorization(@RequestBody AutonomousAuthorizationDTO autonomousAuthorization) throws Exception{ + return autonomousSqService.autonomousAuthorization(autonomousAuthorization); + } + + @ApiOperation("全电登录") + @ApiImplicitParams({ + @ApiImplicitParam(name = "identity", value = "身份认证", dataType = "java.lang.Void", example = "1130", required = true), + @ApiImplicitParam(name = "inoviceAllQdLoginDTO", value = "请求体",dataType = "java.lang.Void", required = true)}) + @PostMapping("/api/invoice_all/v1/qdLogin") + public Object qdLogin(@RequestBody InoviceAllQdLoginDTO inoviceAllQdLoginDTO) throws Exception{ + return autonomousSqService.qdLogin(inoviceAllQdLoginDTO); + } + + + @ApiOperation("提交短信验证码") + @ApiImplicitParams({ + @ApiImplicitParam(name = "identity", value = "身份认证", dataType = "java.lang.Void", example = "1130", required = true), + @ApiImplicitParam(name = "inoviceAllQdLoginDTO", value = "请求体",dataType = "java.lang.Void", required = true)}) + @PostMapping("/api/invoice_all/v1/submitNote") + public Object submitNote(@RequestBody InvoiceAllSubmitNoteDTO invoiceAllSubmitNoteDTO) throws Exception{ + return autonomousSqService.submitNote(invoiceAllSubmitNoteDTO); + } + + + @ApiOperation("用户登记接口") @ApiImplicitParams({ @ApiImplicitParam(name = "identity", value = "身份认证", dataType = "java.lang.Void", example = "1130", required = true), @@ -79,8 +113,9 @@ public class InvoiceAllController { JSONObject requestBody = incomeRequestService.decrypt(request, companyservice); // 指定请求实例 - String serviceKey = serviceManageService.getCompanyServiceSupplier(SERVICE_KEY, companyservice.getCompanyid()); - IInvoiceAll invoiceAllService = iInvoceiAllServiceFactory.getService(serviceKey); + IInvoiceAll invoiceAllService = iInvoceiAllServiceFactory.getService("elephant_invoiceall"); + + InvoiceAllYhdjDTO invoiceAllYhdjDTO = requestBody.toJavaObject(InvoiceAllYhdjDTO.class); AjaxResult result = invoiceAllService.registration(companyservice, invoiceAllYhdjDTO); diff --git a/jianshui-invoice-all/src/main/java/com/jianshui/invoiceall/domain/dto/InoviceAllQdLoginDTO.java b/jianshui-invoice-all/src/main/java/com/jianshui/invoiceall/domain/dto/InoviceAllQdLoginDTO.java new file mode 100644 index 0000000..d072396 --- /dev/null +++ b/jianshui-invoice-all/src/main/java/com/jianshui/invoiceall/domain/dto/InoviceAllQdLoginDTO.java @@ -0,0 +1,35 @@ +package com.jianshui.invoiceall.domain.dto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import javax.validation.constraints.NotEmpty; + +/** + * @author xingze + * @date 2023/8/13 + * 全电登录dto + */ +@Data +@ApiModel("全电登录dto") +public class InoviceAllQdLoginDTO { + @ApiModelProperty(value = "纳税人识别号") + @NotEmpty + private String nsrsbh; + @ApiModelProperty(value = "登录类型,1账密(短信验证码)登录,2扫码登录") + @NotEmpty + private String loginType; + @ApiModelProperty(value = "纳税人地区,省份全拼,陕西为shaanxi") + @NotEmpty + private String nsrdq; + @ApiModelProperty(value = "流水号,调用回调地址时必填,保持唯一性,建议nsrsbh+gsnsyhm+timestamp") + private String traceno; + @ApiModelProperty(value = "回调函数,post请求,回调报文格式:{“code”:”S000”,”data”:{},”msg”:”登录成功”,”success”:true,”trace”:””}" + + "接收短信、二维码、结果通知,post请求。自主授权必填,托管中间号非必填") + private String callback; + @ApiModelProperty(value = "是否全电登录,默认true") + private String qd; + @ApiModelProperty(value = "纳税人登录信息") + private InvoiceAllNsrInfoDTO nsrInfo; +} diff --git a/jianshui-invoice-all/src/main/java/com/jianshui/invoiceall/domain/dto/InvoiceAllNsrInfoDTO.java b/jianshui-invoice-all/src/main/java/com/jianshui/invoiceall/domain/dto/InvoiceAllNsrInfoDTO.java new file mode 100644 index 0000000..1a63da5 --- /dev/null +++ b/jianshui-invoice-all/src/main/java/com/jianshui/invoiceall/domain/dto/InvoiceAllNsrInfoDTO.java @@ -0,0 +1,32 @@ +package com.jianshui.invoiceall.domain.dto; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import javax.validation.constraints.NotEmpty; + +/** + * @author xingze + * @date 2023/8/13 + * 纳税人信息 + */ +@Data +public class InvoiceAllNsrInfoDTO { + @ApiModelProperty(value = "登录身份,参考身份字典") + private String dlsf; + @ApiModelProperty(value = "登录身份密码") + @NotEmpty + private String dlsfmm; + @ApiModelProperty(value = "中间号或接收短信的手机号,涉及到短信验证码的省份必填") + private String zjh; + @ApiModelProperty(value = "登录密码") + @NotEmpty + private String gsnsmm; + @ApiModelProperty(value = "身份证件号码") + private String sfzjhm; + @ApiModelProperty(value = "登录账号") + @NotEmpty + private String gsnsyhm; + @ApiModelProperty(value = "办税人姓名") + private String bsryxz; +} diff --git a/jianshui-invoice-all/src/main/java/com/jianshui/invoiceall/domain/dto/jcsk/AutonomousAuthorizationDTO.java b/jianshui-invoice-all/src/main/java/com/jianshui/invoiceall/domain/dto/jcsk/AutonomousAuthorizationDTO.java new file mode 100644 index 0000000..162666f --- /dev/null +++ b/jianshui-invoice-all/src/main/java/com/jianshui/invoiceall/domain/dto/jcsk/AutonomousAuthorizationDTO.java @@ -0,0 +1,23 @@ +package com.jianshui.invoiceall.domain.dto.jcsk; + +import lombok.Data; + +/** + * @author xingze + * @date 2023/8/14 + * 自主授权回调参数 + */ +@Data +public class AutonomousAuthorizationDTO { + // 响应码 + private String code; + // 响应数据 + private Object data; + // 返回信息 + private String msg; + // 响应结果 + private Boolean success; + // 流水号 + private String trace; + +} diff --git a/jianshui-invoice-all/src/main/java/com/jianshui/invoiceall/domain/dto/jcsk/InvoiceAllSubmitNoteDTO.java b/jianshui-invoice-all/src/main/java/com/jianshui/invoiceall/domain/dto/jcsk/InvoiceAllSubmitNoteDTO.java new file mode 100644 index 0000000..329a895 --- /dev/null +++ b/jianshui-invoice-all/src/main/java/com/jianshui/invoiceall/domain/dto/jcsk/InvoiceAllSubmitNoteDTO.java @@ -0,0 +1,29 @@ +package com.jianshui.invoiceall.domain.dto.jcsk; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import javax.validation.constraints.NotEmpty; + +/** + * @author xingze + * @date 2023/8/13 + * 短信验证码dto + */ +@Data +public class InvoiceAllSubmitNoteDTO { + @ApiModelProperty(value = "流水号,调用回调地址时必填,保持唯一性,建议nsrsbh+gsnsyhm+timestamp") + private String traceno; + + @ApiModelProperty(value = "纳税人识别号") + @NotEmpty + private String nsrsbh; + + @ApiModelProperty(value = "短信验证码") + @NotEmpty + private String smsCode; + + @ApiModelProperty(value = "中间号/手机号") + @NotEmpty + private String zjh; +} diff --git a/jianshui-invoice-all/src/main/java/com/jianshui/invoiceall/service/AutonomousSqService.java b/jianshui-invoice-all/src/main/java/com/jianshui/invoiceall/service/AutonomousSqService.java new file mode 100644 index 0000000..1ce6179 --- /dev/null +++ b/jianshui-invoice-all/src/main/java/com/jianshui/invoiceall/service/AutonomousSqService.java @@ -0,0 +1,36 @@ +package com.jianshui.invoiceall.service; + +import com.jianshui.common.core.domain.AjaxResult; +import com.jianshui.invoiceall.domain.dto.InoviceAllQdLoginDTO; +import com.jianshui.invoiceall.domain.dto.jcsk.AutonomousAuthorizationDTO; +import com.jianshui.invoiceall.domain.dto.jcsk.InvoiceAllSubmitNoteDTO; + +/** + * @author xingze + * @date 2023/8/13 + * 自主授权service + */ +public interface AutonomousSqService { + + /** + * 功能描述: 全电登录 + * @param inoviceAllQdLoginDTO + * @return : com.jianshui.common.core.domain.AjaxResult + */ + AjaxResult qdLogin(InoviceAllQdLoginDTO inoviceAllQdLoginDTO); + + /** + * 功能描述: 提交短信验证码 + * @param invoiceAllSubmitNoteDTO + * @return : com.jianshui.common.core.domain.AjaxResult + */ + + AjaxResult submitNote(InvoiceAllSubmitNoteDTO invoiceAllSubmitNoteDTO); + + /** + * 功能描述: 自主授权 + * @param autonomousAuthorization + * @return : java.lang.Object + */ + Object autonomousAuthorization(AutonomousAuthorizationDTO autonomousAuthorization); +} diff --git a/jianshui-invoice-all/src/main/java/com/jianshui/invoiceall/service/IInvoiceAll.java b/jianshui-invoice-all/src/main/java/com/jianshui/invoiceall/service/IInvoiceAll.java index c51c25b..50b6cad 100644 --- a/jianshui-invoice-all/src/main/java/com/jianshui/invoiceall/service/IInvoiceAll.java +++ b/jianshui-invoice-all/src/main/java/com/jianshui/invoiceall/service/IInvoiceAll.java @@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONObject; import com.jianshui.common.core.domain.AjaxResult; import com.jianshui.common.core.domain.entity.Companyservice; import com.jianshui.invoiceall.domain.dto.*; +import com.jianshui.invoiceall.domain.dto.jcsk.InvoiceAllSubmitNoteDTO; import org.yaml.snakeyaml.extensions.compactnotation.CompactConstructor; /** @@ -150,4 +151,5 @@ public interface IInvoiceAll { /** 查询蓝字发票可红冲金额*/ AjaxResult queryInvoiceBeRed(Companyservice companyservice, InvoiceAllCanRedDTO invoiceAllCanRedDTO); + } diff --git a/jianshui-invoice-all/src/main/java/com/jianshui/invoiceall/service/impl/AutonomousSqServiceImpl.java b/jianshui-invoice-all/src/main/java/com/jianshui/invoiceall/service/impl/AutonomousSqServiceImpl.java new file mode 100644 index 0000000..db8cd6a --- /dev/null +++ b/jianshui-invoice-all/src/main/java/com/jianshui/invoiceall/service/impl/AutonomousSqServiceImpl.java @@ -0,0 +1,181 @@ +package com.jianshui.invoiceall.service.impl; + +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.bean.copier.CopyOptions; +import cn.hutool.json.JSONObject; +import cn.hutool.json.JSONUtil; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.jianshui.common.core.domain.AjaxResult; +import com.jianshui.common.core.domain.entity.Companyservice; +import com.jianshui.common.enums.ErrorCode; +import com.jianshui.common.utils.ValidateUtils; +import com.jianshui.common.utils.http.HttpUtils; +import com.jianshui.invoiceall.domain.dto.InoviceAllQdLoginDTO; +import com.jianshui.invoiceall.domain.dto.jcsk.AutonomousAuthorizationDTO; +import com.jianshui.invoiceall.domain.dto.jcsk.InvoiceAllSubmitNoteDTO; +import com.jianshui.invoiceall.service.AutonomousSqService; +import com.jianshui.system.domain.InvoiceAllApiLog; +import com.jianshui.system.domain.InvoiceAllLoginResult; +import com.jianshui.system.domain.InvoiceAllYhdj; +import com.jianshui.system.mapper.CompanyserviceMapper; +import com.jianshui.system.mapper.InvoiceAllApiLogMapper; +import com.jianshui.system.mapper.InvoiceAllLoginResultMapper; +import com.jianshui.system.mapper.InvoiceAllYhdjMapper; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.Date; + +/** + * @author xingze + * @date 2023/8/13 + */ +@Service +@Slf4j +public class AutonomousSqServiceImpl implements AutonomousSqService { + @Autowired + private InvoiceAllApiLogMapper allApiLogMapper; + + @Autowired + private InvoiceAllYhdjMapper yhdjMapper; + + @Autowired + private InvoiceAllLoginResultMapper invoiceAllLoginResultMapper; + @Autowired + private CompanyserviceMapper companyserviceMapper; + + /** + * 功能描述: 自主授权回调接口 + * + * @param autonomousAuthorization + * @return : java.lang.Object + */ + @Override + public Object autonomousAuthorization(AutonomousAuthorizationDTO autonomousAuthorization) { + // 存流水号 + InvoiceAllLoginResult invoiceAllLoginResult = new InvoiceAllLoginResult(); + BeanUtil.copyProperties(autonomousAuthorization,invoiceAllLoginResult); + int count = invoiceAllLoginResultMapper.insertInvoiceAllLoginResult(invoiceAllLoginResult); + if (count > 0){ + log.info("全电登录接口,登录返回信息保存成功,信息为:{}",JSONUtil.toJsonStr(invoiceAllLoginResult)); + }else { + log.error("全电登录接口,登录返回信息失败,信息为:{}",JSONUtil.toJsonStr(invoiceAllLoginResult)); + } + return AjaxResult.success(); + } + + /** + * 功能描述: 全电登录 + * + * @param inoviceAllQdLoginDTO + * @return : com.jianshui.common.core.domain.AjaxResult + */ + @Override + public AjaxResult qdLogin(InoviceAllQdLoginDTO inoviceAllQdLoginDTO) { + // 全电登录 + ValidateUtils.validate(inoviceAllQdLoginDTO); + Companyservice companyservice = companyserviceMapper.selectCompanyserviceByTaxcode(inoviceAllQdLoginDTO.getNsrsbh()); + if (BeanUtil.isEmpty(inoviceAllQdLoginDTO.getNsrInfo())) { + return AjaxResult.error("传入报文错误,请检查,纳税人信息为空!"); + } + ValidateUtils.validate(inoviceAllQdLoginDTO.getNsrInfo()); + // 流水号(唯一) + String qqlsh = inoviceAllQdLoginDTO.getNsrsbh() + inoviceAllQdLoginDTO.getNsrInfo().getGsnsyhm() + System.currentTimeMillis(); + inoviceAllQdLoginDTO.setTraceno(qqlsh); + try { + // 回调地址 + inoviceAllQdLoginDTO.setCallback("http://dev.goldentaxcloud.com:8081/api/invoice_all/v1/autonomousAuthorization"); + String result = HttpUtils.sendJsonPost("http://221.222.184.98:8880/login/getLogin2", inoviceAllQdLoginDTO); + // 用户信息封装 + InvoiceAllYhdj yhdj = BeanUtil.copyProperties(inoviceAllQdLoginDTO, InvoiceAllYhdj.class); + yhdj.setDlsfmm(inoviceAllQdLoginDTO.getNsrInfo().getGsnsmm()); + yhdj.setBsrysfzjhm(inoviceAllQdLoginDTO.getNsrInfo().getSfzjhm()); + yhdj.setDlzh(inoviceAllQdLoginDTO.getNsrInfo().getGsnsyhm()); + yhdj.setBsryxm(inoviceAllQdLoginDTO.getNsrInfo().getBsryxz()); + QueryWrapper yhdjQueryWrapper = new QueryWrapper<>(); + yhdjQueryWrapper.eq("nsrsbh", yhdj.getNsrsbh()); + yhdjQueryWrapper.eq("identity", companyservice.getIdentity()); + InvoiceAllYhdj yhdjTemp = yhdjMapper.selectOne(yhdjQueryWrapper); + // 日志信息 + InvoiceAllApiLog invoiceAllApiLog = new InvoiceAllApiLog(); + invoiceAllApiLog.setCreateTime(new Date()); + invoiceAllApiLog.setCompany(companyservice.getSellertax()); + invoiceAllApiLog.setIdentityId(companyservice.getIdentity()); + invoiceAllApiLog.setUrl("http://221.222.184.98:8880/login/getLogin2"); + invoiceAllApiLog.setSendMsg(JSONUtil.toJsonStr(inoviceAllQdLoginDTO)); + invoiceAllApiLog.setRequestId(qqlsh); + allApiLogMapper.insert(invoiceAllApiLog); + // 更新记录表 + if (BeanUtil.isNotEmpty(yhdjTemp)) { + BeanUtil.copyProperties(yhdj, yhdjTemp, CopyOptions.create().setIgnoreNullValue(true)); + yhdjTemp.setUpdateTime(new Date()); + yhdjMapper.updateInvoiceAllYhdj(yhdjTemp); + } else { + yhdj.setCreateTime(new Date()); + yhdj.setIdentity(companyservice.getIdentity()); + yhdjMapper.insertInvoiceAllYhdj(yhdj); + } + } catch (Exception e) { + e.printStackTrace(); + log.error("【金四服务类】【金财数科】【全电登录】API请求异常,外部报文返回code非S000。错误信息:{}", e.getMessage()); + return AjaxResult.error(ErrorCode.INCOME_ERROR); + } + return AjaxResult.success(qqlsh); + } + + /** + * 功能描述: 提交短信验证码 + * + * @param invoiceAllSubmitNoteDTO + * @return : com.jianshui.common.core.domain.AjaxResult + */ + @Override + public AjaxResult submitNote(InvoiceAllSubmitNoteDTO invoiceAllSubmitNoteDTO) { + // 全电登录 + ValidateUtils.validate(invoiceAllSubmitNoteDTO); + Companyservice companyservice = companyserviceMapper.selectCompanyserviceByTaxcode(invoiceAllSubmitNoteDTO.getNsrsbh()); + // 根据流水号获取登录结果 + InvoiceAllLoginResult invoiceAllLogin = invoiceAllLoginResultMapper.findByQqlsh(invoiceAllSubmitNoteDTO.getTraceno()); + if (invoiceAllLogin == null){ + return AjaxResult.error("未查询到相关信息,请确认后输入"); + } + if ("S000".equals(invoiceAllLogin.getCode())){ + JSONObject result = new JSONObject(); + try { + // 请求封装 + String sendFormPost = HttpUtils.sendJsonPost("http://221.222.184.98:8880/login/submitSms", invoiceAllSubmitNoteDTO); + result = JSONUtil.parseObj(sendFormPost); + String code = result.get("code") != null ? result.get("code").toString() : ""; + String msg = result.get("msg") != null ? result.get("msg").toString() : ""; + String data = result.get("data") != null ? result.get("data").toString() : ""; + + if ("S000".equals(code)) { + // 调用日志封装 + InvoiceAllApiLog invoiceAllApiLog = new InvoiceAllApiLog(); + invoiceAllApiLog.setCreateTime(new Date()); + invoiceAllApiLog.setCompany(companyservice.getSellertax()); + invoiceAllApiLog.setIdentityId(companyservice.getIdentity()); + invoiceAllApiLog.setUrl("http://221.222.184.98:8880/login/submitSms"); + invoiceAllApiLog.setSendMsg(JSONUtil.toJsonStr(invoiceAllSubmitNoteDTO)); + invoiceAllApiLog.setResultMsg(data); + JSONObject dataObject = JSONUtil.parseObj(data); + String tokenId = dataObject.get("dzfp-ssotoken") != null ? dataObject.get("dzfp-ssotoken").toString() : ""; + invoiceAllApiLog.setRequestId(tokenId); + allApiLogMapper.insert(invoiceAllApiLog); + } else { + return AjaxResult.error(msg); + } + + } catch (Exception e) { + e.printStackTrace(); + log.error("【金四服务类】【金财数科】【全电登录】API请求异常,外部报文返回code非S000。错误信息:{}", e.getMessage()); + return AjaxResult.error(ErrorCode.INCOME_ERROR); + } + return AjaxResult.success(result); + }else { + return AjaxResult.error("登录失败,请重新登录"); + } + } + +} diff --git a/jianshui-invoice-all/src/main/java/com/jianshui/invoiceall/service/impl/InvoiceAllImpl.java b/jianshui-invoice-all/src/main/java/com/jianshui/invoiceall/service/impl/InvoiceAllImpl.java index ef32d13..2b7db05 100644 --- a/jianshui-invoice-all/src/main/java/com/jianshui/invoiceall/service/impl/InvoiceAllImpl.java +++ b/jianshui-invoice-all/src/main/java/com/jianshui/invoiceall/service/impl/InvoiceAllImpl.java @@ -102,7 +102,7 @@ public class InvoiceAllImpl implements IInvoiceAll { String data = result.get("data") != null ? result.get("data").toString() : ""; if ("0000".equals(code)) { - InvoiceAllYhdj yhdj = BeanUtil.copyProperties(yhdjDTO, InvoiceAllYhdj.class); + InvoiceAllYhdj yhdj = BeanUtil.copyProperties(yhdjDTO.getJsonData(), InvoiceAllYhdj.class); QueryWrapper yhdjQueryWrapper = new QueryWrapper<>(); yhdjQueryWrapper.eq("nsrsbh", yhdj.getNsrsbh()); diff --git a/jianshui-invoice/src/main/java/com/jianshui/invoice/utils/JcskTest.java b/jianshui-invoice/src/main/java/com/jianshui/invoice/utils/JcskTest.java index 71c6186..4a99974 100644 --- a/jianshui-invoice/src/main/java/com/jianshui/invoice/utils/JcskTest.java +++ b/jianshui-invoice/src/main/java/com/jianshui/invoice/utils/JcskTest.java @@ -19,8 +19,9 @@ public class JcskTest { // String key = "Nlc6k8hs+KIPiTLxih3IZw=="; // 1486 // String key = "HwHDdrtl8VkuZ/K+mLn0lA=="; // 1235 // String key = "5lkC/Y5cRCtdzeroilBYFw=="; // 1246 - String key = "ubDUJvWWr26KTYHfzz02KA=="; // 1247 -// String key = "kpP/pYUBGWdIRNFswh+1Qg=="; // 1240 +// String key = "ubDUJvWWr26KTYHfzz02KA=="; // 1247 +// String key = "uIawjnF+dXZa60h8cyI/MA=="; // 1483 + String key = "W45KUNcF+EA9rodLz96V2w=="; // 1487 String order = ""; @@ -139,6 +140,29 @@ public class JcskTest { " }\n" + "}";*/ + order = "{ \n" + + " \"appkey\": \"935248bf224f6c8431cdc1969f029519\",\n" + + " \"async\": false,\n" + + " \"bsrysfzjhm\":\"510402199507272626\",\n" + + " \"serviceId\": \"yhdj\",\n" + + " \"dqbm\": \"guangdong\",\n" + + " \"nsrsbh\": \"91440101MA59C5NT7A\",\n" + + " \"jsonData\": {\n" + + " \"bsryxm\": \"毕夏\",\n" + + " \"dlsf\": \"3\",\n" + + " \"dlsfmm\": \"19950727Bks\",\n" + + " \"dlfs\": \"2\",\n" + + " \"dlmm\": \"19950727Bks\",\n" + + " \"dlzh\": \"18620263597\",\n" + + " \"nsrmc\": \"中交(广州)铁道设计研究院有限公司\",\n" + + " \"nsrsbh\": \"91440101MA59C5NT7A\",\n" + + " \"bsrysfzjhm\": \"510402199507272626\",\n" + + " \"bsrysjhm\": \"18620263597\",\n" + + " \"zjh\": \"18620263597\",\n" + + " \"loginType\": \"1\"\n" + + " }\n" + + "}"; + System.out.println(order); m = AisinoInvoiceDecryptUtil.encrypt(order, key); System.out.println("-------------------用户登记-----------------------------"); @@ -250,6 +274,15 @@ public class JcskTest { " \"nsrsbh\": \"92370214MACAAEK16E\",\n" + " \"serviceId\": \"hqrlsbewm\"\n" + "}"; + + order = "{\n" + + " \"appkey\": \"935248bf224f6c8431cdc1969f029519\",\n" + + " \"dqbm\":\"guangdong\",\n" + + " \"async\": false,\n" + + " \"bsrysfzjhm\":\"510402199507272626\",\n" + + " \"nsrsbh\": \"91440101MA59C5NT7A\",\n" + + " \"serviceId\": \"hqrlsbewm\"\n" + + "}"; System.out.println(order); m = AisinoInvoiceDecryptUtil.encrypt(order, key); System.out.println("-------------------获取人脸识别二维码-----------------------------"); @@ -355,6 +388,17 @@ public class JcskTest { order = "{\"appkey\":\"GAu2XyVU4AYiqzPuoVGi4g==\",\"async\":true,\"bsrysfzjhm\":\"440823199706182127\",\"dqbm\":\"guangdong\",\"nsrsbh\":\"91440101MA59P8FD4N\",\"serviceId\":\"fpewmxz\",\"jsonData\":{\"fphm\":\"23442000000082558477\",\"kprq\":\"2023-05-31 09:31:01\"},\"fphm\":\"23442000000082558477\",\"kprq\":\"2023-05-31 09:31:01\"}"; + order = "{\n" + + " \t\"requestId\": \"20230809@2b817d95-4c35-4cc6-b6b6-1b1d8fbb5389\",\n" + + "}"; + + order="{\n" + + "\"GMFSBH\": \"91370181MA3UQT3180\",\n" + + "\"PCH\": \"0827f998cdfd40b0a5626150520b4dea\",\n" + + "\"QRBZ\": \"1\",\n" + + "\"TJSJ\": \"\",\n" + + "\"taxNo\": \"91370181MA3UQT3180\"\n" + + "}"; System.out.println(order); m = AisinoInvoiceDecryptUtil.encrypt(order, key); System.out.println("-------------------获取发票下载地址-----------------------------"); diff --git a/jianshui-system/src/main/java/com/jianshui/system/domain/InvoiceAllLoginResult.java b/jianshui-system/src/main/java/com/jianshui/system/domain/InvoiceAllLoginResult.java new file mode 100644 index 0000000..9d43025 --- /dev/null +++ b/jianshui-system/src/main/java/com/jianshui/system/domain/InvoiceAllLoginResult.java @@ -0,0 +1,109 @@ +package com.jianshui.system.domain; + +import com.jianshui.common.annotation.Excel; +import com.jianshui.common.core.domain.BaseEntity; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +/** + * 全电登录结果信息对象 invoice_all_login_result + * + * @author jianshui + * @date 2023-08-14 + */ +public class InvoiceAllLoginResult extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 响应码 */ + @Excel(name = "响应码") + private String code; + + /** 响应数据 */ + @Excel(name = "响应数据") + private String data; + + /** 返回信息 */ + @Excel(name = "返回信息") + private String msg; + + /** 响应结果 true成功 false失败 */ + @Excel(name = "响应结果 true成功 false失败") + private Integer success; + + /** 流水号 */ + @Excel(name = "流水号") + private String trace; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setCode(String code) + { + this.code = code; + } + + public String getCode() + { + return code; + } + public void setData(String data) + { + this.data = data; + } + + public String getData() + { + return data; + } + public void setMsg(String msg) + { + this.msg = msg; + } + + public String getMsg() + { + return msg; + } + public void setSuccess(Integer success) + { + this.success = success; + } + + public Integer getSuccess() + { + return success; + } + public void setTrace(String trace) + { + this.trace = trace; + } + + public String getTrace() + { + return trace; + } + + @Override + public String toString() { + return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("code", getCode()) + .append("data", getData()) + .append("msg", getMsg()) + .append("success", getSuccess()) + .append("trace", getTrace()) + .append("createTime", getCreateTime()) + .append("updateTime", getUpdateTime()) + .toString(); + } +} diff --git a/jianshui-system/src/main/java/com/jianshui/system/mapper/InvoiceAllLoginResultMapper.java b/jianshui-system/src/main/java/com/jianshui/system/mapper/InvoiceAllLoginResultMapper.java new file mode 100644 index 0000000..312cda6 --- /dev/null +++ b/jianshui-system/src/main/java/com/jianshui/system/mapper/InvoiceAllLoginResultMapper.java @@ -0,0 +1,69 @@ +package com.jianshui.system.mapper; + +import java.util.List; +import com.jianshui.system.domain.InvoiceAllLoginResult; +import org.apache.ibatis.annotations.Param; + +/** + * 全电登录结果信息Mapper接口 + * + * @author jianshui + * @date 2023-08-14 + */ +public interface InvoiceAllLoginResultMapper +{ + /** + * 查询全电登录结果信息 + * + * @param id 全电登录结果信息主键 + * @return 全电登录结果信息 + */ + public InvoiceAllLoginResult selectInvoiceAllLoginResultById(Long id); + + /** + * 查询全电登录结果信息列表 + * + * @param invoiceAllLoginResult 全电登录结果信息 + * @return 全电登录结果信息集合 + */ + public List selectInvoiceAllLoginResultList(InvoiceAllLoginResult invoiceAllLoginResult); + + /** + * 新增全电登录结果信息 + * + * @param invoiceAllLoginResult 全电登录结果信息 + * @return 结果 + */ + public int insertInvoiceAllLoginResult(InvoiceAllLoginResult invoiceAllLoginResult); + + /** + * 修改全电登录结果信息 + * + * @param invoiceAllLoginResult 全电登录结果信息 + * @return 结果 + */ + public int updateInvoiceAllLoginResult(InvoiceAllLoginResult invoiceAllLoginResult); + + /** + * 删除全电登录结果信息 + * + * @param id 全电登录结果信息主键 + * @return 结果 + */ + public int deleteInvoiceAllLoginResultById(Long id); + + /** + * 批量删除全电登录结果信息 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteInvoiceAllLoginResultByIds(Long[] ids); + + /** + * 功能描述: + * @param qqlsh + * @return : com.jianshui.system.domain.InvoiceAllLoginResult + */ + InvoiceAllLoginResult findByQqlsh(@Param("qqlsh") String qqlsh); +} diff --git a/jianshui-system/src/main/resources/mapper/system/InvoiceAllLoginResultMapper.xml b/jianshui-system/src/main/resources/mapper/system/InvoiceAllLoginResultMapper.xml new file mode 100644 index 0000000..b2d0111 --- /dev/null +++ b/jianshui-system/src/main/resources/mapper/system/InvoiceAllLoginResultMapper.xml @@ -0,0 +1,87 @@ + + + + + + + + + + + + + + + + + select id, code, data, msg, success, trace, create_time, update_time from invoice_all_login_result + + + + + + + + + insert into invoice_all_login_result + + code, + data, + msg, + success, + trace, + create_time, + update_time, + + + #{code}, + #{data}, + #{msg}, + #{success}, + #{trace}, + #{createTime}, + #{updateTime}, + + + + + update invoice_all_login_result + + code = #{code}, + data = #{data}, + msg = #{msg}, + success = #{success}, + trace = #{trace}, + create_time = #{createTime}, + update_time = #{updateTime}, + + where id = #{id} + + + + delete from invoice_all_login_result where id = #{id} + + + + delete from invoice_all_login_result where id in + + #{id} + + + \ No newline at end of file