|
|
@@ -765,4 +765,41 @@ public class HwPlatformCompanyServiceImpl extends ServiceImpl<HwPlatformCompanyM
|
|
|
}
|
|
|
return page;
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public String companyInvoiceInfoAdd(HlwCompanyInvoiceInformation hlwCompanyInvoiceInformation) {
|
|
|
+ LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
|
|
+ HwPlatformCompany hwPlatformCompany=getByOrgCode(sysUser.getOrgCode());
|
|
|
+ String accessToken = OauthTokenUtils.getDayAccessToken();
|
|
|
+ String requestUrl = OauthApi.COMPANY_INVOICE_INFO_ADD;
|
|
|
+ Map<String, Object> parameters = new HashMap<>();
|
|
|
+ parameters.put("invoiceTitle", hlwCompanyInvoiceInformation.getInvoiceTitle());
|
|
|
+ parameters.put("dutyParagraph", hlwCompanyInvoiceInformation.getDutyParagraph());
|
|
|
+ parameters.put("accountBank", hlwCompanyInvoiceInformation.getAccountBank());
|
|
|
+ parameters.put("account", hlwCompanyInvoiceInformation.getAccount());
|
|
|
+ parameters.put("registerAddress", hlwCompanyInvoiceInformation.getRegisterAddress());
|
|
|
+ parameters.put("registerPhone", hlwCompanyInvoiceInformation.getRegisterPhone());
|
|
|
+ parameters.put("companyCode", hwPlatformCompany.getCompanyCode());
|
|
|
+ parameters.put("createBy", sysUser.getUsername());
|
|
|
+ log.info("param============{}", JSONObject.toJSONString(parameters));
|
|
|
+ //数据加密
|
|
|
+ String biz_content = CryptTool.encode(JSONObject.toJSONString(parameters));
|
|
|
+ JSONObject jsonObject = OauthTokenUtils.doRequest(requestUrl, HttpsContants.POST, biz_content, accessToken);
|
|
|
+ log.info("jsonObject===={}", jsonObject);
|
|
|
+ if (jsonObject != null) {
|
|
|
+ if (jsonObject.getBoolean("success")) {
|
|
|
+ log.info("开票资料新增===={}", jsonObject);
|
|
|
+ String msg = jsonObject.getString("message");
|
|
|
+ return msg;
|
|
|
+ } else {
|
|
|
+ String msg = jsonObject.getString("message");
|
|
|
+ //抛出异常
|
|
|
+ throw new JeecgBootException(msg);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ throw new JeecgBootException("操作失败");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
}
|