LiFei пре 3 година
родитељ
комит
a2a83a5ecf

+ 19 - 0
happy-boot-module-flexjob/src/main/java/org/jeecg/modules/saasmanager/controller/HwPlatformCompanyController.java

@@ -697,4 +697,23 @@ public class HwPlatformCompanyController {
         result.setResult(pageList);
         return result;
     }
+
+
+    /**
+     * 新增开票资料
+     *
+     * @param hlwCompanyInvoiceInformation
+     * @return
+     */
+    @PostMapping(value = "/companyInvoiceInfoAdd")
+    @LimitSubmit(key = "companyInvoiceInfoAdd:%s")
+    public Result<?> companyInvoiceInfoAdd(@RequestBody HlwCompanyInvoiceInformation hlwCompanyInvoiceInformation) {
+        try {
+            String message=hwPlatformCompanyService.companyInvoiceInfoAdd(hlwCompanyInvoiceInformation);
+            return Result.ok(message);
+        } catch (Exception e) {
+            log.error(e.getMessage(), e);
+            return Result.error(e.getMessage());
+        }
+    }
 }

+ 2 - 0
happy-boot-module-flexjob/src/main/java/org/jeecg/modules/saasmanager/service/IHwPlatformCompanyService.java

@@ -48,4 +48,6 @@ public interface IHwPlatformCompanyService extends IService<HwPlatformCompany> {
     String companyUploadContract(HwCompanyUploadContract hwCompanyUploadContract);
 
     Page<?> companyInvoiceInfoList(Integer pageNo, Integer pageSize, HlwCompanyInvoiceInformation hlwCompanyInvoiceInformation, HttpServletRequest req);
+
+    String companyInvoiceInfoAdd(HlwCompanyInvoiceInformation hlwCompanyInvoiceInformation);
 }

+ 37 - 0
happy-boot-module-flexjob/src/main/java/org/jeecg/modules/saasmanager/service/impl/HwPlatformCompanyServiceImpl.java

@@ -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("操作失败");
+        }
+    }
+
+
 }

+ 6 - 0
happy-boot-module-settlement/src/main/java/org/jeecg/common/utils/OauthApi.java

@@ -172,6 +172,12 @@ public interface OauthApi {
     //开票资料列表
     public static final String COMPANY_INVOICE_INFO_LIST = "/oauth/hlwCompanyInvoiceInfo/list";
 
+    //开票资料新增
+    public static final String COMPANY_INVOICE_INFO_ADD = "/oauth/hlwCompanyInvoiceInfo/add";
+
+    //开票资料编辑
+    public static final String COMPANY_INVOICE_INFO_EDIT = "/oauth/hlwCompanyInvoiceInfo/edit";
+
     //校验能否一起开票
     public static final String INVOICE_CHECK_APPLY = "/oauth/hlwInvoice/checkApply";