|
|
@@ -32,15 +32,6 @@ public class HlwInvoiceServiceImpl extends ServiceImpl<HlwInvoiceMapper, HlwInvo
|
|
|
@Override
|
|
|
public Page<?> getPageList(Integer pageNo, Integer pageSize, HlwInvoice hlwInvoice, HttpServletRequest request) {
|
|
|
Page<Map<String, Object>> page = new Page<Map<String, Object>>();
|
|
|
- //获取请求路由路径
|
|
|
- String routeUrl = request.getServletPath();
|
|
|
- //获取当前登录用户
|
|
|
- LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
|
|
- List<String> companyCodeList = RoleDataUtils.findCompanyCodeList(sysUser.getUsername(), routeUrl, sysUser.getOrgCode());
|
|
|
- if (companyCodeList.size() == 0) {
|
|
|
- page.setRecords(Collections.emptyList());
|
|
|
- return page;
|
|
|
- }
|
|
|
//慧盈查询开票申请列表
|
|
|
String accessToken = OauthTokenUtils.getDayAccessToken();
|
|
|
String requestUrl = OauthApi.INVOICE_LIST;
|
|
|
@@ -70,4 +61,28 @@ public class HlwInvoiceServiceImpl extends ServiceImpl<HlwInvoiceMapper, HlwInvo
|
|
|
}
|
|
|
return page;
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public Map<String, Object> invoicePayment(HlwInvoice hlwInvoice, HttpServletRequest request) {
|
|
|
+ //慧盈查询开票申请列表
|
|
|
+ String accessToken = OauthTokenUtils.getDayAccessToken();
|
|
|
+ String requestUrl = OauthApi.INVOICE_CHECK_APPLY;
|
|
|
+ Map<String, Object> parameters = new HashMap<>();
|
|
|
+ parameters.put("idsList", hlwInvoice.getIdsList());
|
|
|
+ //数据加密
|
|
|
+ String biz_content = CryptTool.encode(JSONObject.toJSONString(parameters));
|
|
|
+ JSONObject jsonObject = OauthTokenUtils.doRequest(requestUrl, HttpsContants.POST, biz_content, accessToken);
|
|
|
+ log.info("能否开票===={}", jsonObject);
|
|
|
+ if (jsonObject != null) {
|
|
|
+ if (jsonObject.getBoolean(HttpsContants.SUCCESS_FLAG)) {
|
|
|
+ log.info("能否开票===={}", jsonObject);
|
|
|
+ JSONObject jsonObject1 = jsonObject.getJSONObject("result");
|
|
|
+ return jsonObject1;
|
|
|
+ } else {
|
|
|
+ throw new JeecgBootException("查询数据异常");
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ throw new JeecgBootException("查询数据异常");
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|