|
|
@@ -75,6 +75,60 @@ public class HlwInvoiceServiceImpl extends ServiceImpl<HlwInvoiceMapper, HlwInvo
|
|
|
return page;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 已开票列表
|
|
|
+ * @param pageNo
|
|
|
+ * @param pageSize
|
|
|
+ * @param hlwInvoice
|
|
|
+ * @param request
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public Page<?> alreadyInvoiceList(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.ALREADY_INVOICE_LIST;
|
|
|
+ Map<String, Object> parameters = new HashMap<>();
|
|
|
+ parameters.put("pageNo", pageNo);
|
|
|
+ parameters.put("pageSize", pageSize);
|
|
|
+ parameters.put("companyName", hlwInvoice.getCompanyName());
|
|
|
+ parameters.put("subcontractorName", hlwInvoice.getSubcontractorName());
|
|
|
+ parameters.put("invoiceCategoryName", hlwInvoice.getInvoiceCategoryName());
|
|
|
+ parameters.put("invoiceNumber", hlwInvoice.getInvoiceNumber());
|
|
|
+ parameters.put("invoiceStatus", hlwInvoice.getInvoiceStatus());
|
|
|
+ parameters.put("companyCodeList", companyCodeList);
|
|
|
+ //数据加密
|
|
|
+ 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");
|
|
|
+ List<Map<String, Object>> list = (List<Map<String, Object>>) jsonObject1.get("records");
|
|
|
+ log.info("已开票列表==={}", list);
|
|
|
+ page.setRecords(list);
|
|
|
+ page.setTotal(jsonObject1.getLong("total"));
|
|
|
+ } else {
|
|
|
+ throw new JeecgBootException("查询数据异常");
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ throw new JeecgBootException("查询数据异常");
|
|
|
+ }
|
|
|
+ return page;
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 创客付款单
|
|
|
* @param pageNo
|