Browse Source

Merge remote-tracking branch 'origin/master'

LiFei 4 years ago
parent
commit
882ec2a3fe

+ 31 - 23
happy-boot-module-powerjob/src/main/java/org/jeecg/modules/hlgaccount/service/impl/HlgAccountDetailServiceImpl.java

@@ -738,32 +738,40 @@ public class HlgAccountDetailServiceImpl extends ServiceImpl<HlgAccountDetailMap
     @Override
     public Page<HlgAccountDetail> pageManagerListApi(Integer pageNo, Integer pageSize, HlgAccountDetail hlgAccountDetail, HttpServletRequest req) {
         Page<HlgAccountDetail> page = new Page<>(pageNo, pageSize);
-        //收支明细列表
-        String accessToken = OauthTokenUtils.getDayAccessToken();
-        String requestUrl = OauthApi.companyAccountDetailList;
-        Map<String, Object> parameters = new HashMap<>();
-        parameters.put("pageNo", pageNo);
-        parameters.put("pageSize", pageSize);
-        parameters.put("subcontractorId", hlgAccountDetail.getSubcontractorId());
-        parameters.put("cpType", hlgAccountDetail.getCpType());
-        parameters.put("companyId", hlgAccountDetail.getCompanyId());
-        //数据加密
-        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<HlgAccountDetail> list = (List<HlgAccountDetail>) jsonObject1.get("records");
-                log.info("收支明细列表数组==={}", list);
-                page.setRecords(list);
-                page.setTotal(jsonObject1.getLong("total"));
+        //获取当前登录用户
+        LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
+        QueryWrapper<HlgCompany> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("sys_org_code", sysUser.getOrgCode());
+        HlgCompany hlgCompany = hlgCompanyService.getOne(queryWrapper);
+        if (hlgCompany != null) {
+            //收支明细列表
+            String accessToken = OauthTokenUtils.getDayAccessToken();
+            String requestUrl = OauthApi.companyAccountDetailList;
+            Map<String, Object> parameters = new HashMap<>();
+            parameters.put("pageNo", pageNo);
+            parameters.put("pageSize", pageSize);
+            parameters.put("subcontractorId", hlgAccountDetail.getSubcontractorId());
+            parameters.put("cpType", hlgAccountDetail.getCpType());
+            parameters.put("companyId", hlgAccountDetail.getCompanyId());
+            parameters.put("companyCode", hlgCompany.getCompanyCode());
+            //数据加密
+            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<HlgAccountDetail> list = (List<HlgAccountDetail>) jsonObject1.get("records");
+                    log.info("收支明细列表数组==={}", list);
+                    page.setRecords(list);
+                    page.setTotal(jsonObject1.getLong("total"));
+                } else {
+                    throw new JeecgBootException("查询数据异常");
+                }
             } else {
                 throw new JeecgBootException("查询数据异常");
             }
-        } else {
-            throw new JeecgBootException("查询数据异常");
         }
         return page;
     }

+ 4 - 4
happy-boot-module-powerjob/src/main/java/org/jeecg/modules/hlgaccount/service/impl/HlgAccountServiceImpl.java

@@ -143,7 +143,7 @@ public class HlgAccountServiceImpl extends ServiceImpl<HlgAccountMapper, HlgAcco
      */
     @Override
     public Result<?> getSubcontractorBankInformation(Integer subcontractorId, Integer cpType) {
-        List list = new ArrayList();
+        Map map = new HashMap();
         String accessToken = OauthTokenUtils.getDayAccessToken();
         String requestUrl = OauthApi.SUBCONTRACTOR_BANK_INFO;
         Map<String, Object> parameters = new HashMap<>();
@@ -156,14 +156,14 @@ public class HlgAccountServiceImpl extends ServiceImpl<HlgAccountMapper, HlgAcco
         if (jsonObject != null) {
             if (jsonObject.getBoolean(HttpsContants.SUCCESS_FLAG)) {
                 log.info("服务商银行卡信息===={}", jsonObject);
-                list = (List) jsonObject.get("result");
-                log.info("服务商银行卡信息==={}", list);
+                map = (Map) jsonObject.get("result");
+                log.info("服务商银行卡信息==={}", map);
             } else {
                 throw new JeecgBootException("查询数据异常");
             }
         } else {
             throw new JeecgBootException("查询数据异常");
         }
-        return Result.ok(list);
+        return Result.ok(map);
     }
 }