فهرست منبع

编辑开票资料

LiFei 3 سال پیش
والد
کامیت
a831f94262

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

@@ -716,4 +716,23 @@ public class HwPlatformCompanyController {
             return Result.error(e.getMessage());
         }
     }
+
+
+    /**
+     * 编辑开票资料
+     *
+     * @param hlwCompanyInvoiceInformation
+     * @return
+     */
+    @PutMapping(value = "/companyInvoiceInfoEdit")
+    @LimitSubmit(key = "companyInvoiceInfoEdit:%s")
+    public Result<?> companyInvoiceInfoEdit(@RequestBody HlwCompanyInvoiceInformation hlwCompanyInvoiceInformation) {
+        try {
+            String message=hwPlatformCompanyService.companyInvoiceInfoEdit(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

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

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

@@ -801,5 +801,37 @@ public class HwPlatformCompanyServiceImpl extends ServiceImpl<HwPlatformCompanyM
         }
     }
 
-
+    @Override
+    public String companyInvoiceInfoEdit(HlwCompanyInvoiceInformation hlwCompanyInvoiceInformation) {
+        LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
+        String accessToken = OauthTokenUtils.getDayAccessToken();
+        String requestUrl = OauthApi.COMPANY_INVOICE_INFO_EDIT;
+        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("companyId", hlwCompanyInvoiceInformation.getCompanyId());
+        parameters.put("updateBy", 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("操作失败");
+        }
+    }
 }