Explorar o código

Merge remote-tracking branch 'origin/master'

LiFei %!s(int64=4) %!d(string=hai) anos
pai
achega
17a92a66d4

+ 21 - 0
happy-cloud-auth/src/main/java/org/jeecg/modules/api/controller/HlwCompanyAccountController.java

@@ -72,4 +72,25 @@ public class HlwCompanyAccountController {
         Result<?> result = hlwCompanyAccountServiceClient.getSubcontractorBankInfo(jsonObject);
         return result;
     }
+
+    /**
+     * 获取企业所有服务商数据
+     *
+     * @param json
+     * @return
+     */
+    @AutoLog(value = "企业账户明细-获取企业所有服务商数据")
+    @ApiOperation(value = "企业账户明细-获取企业所有服务商数据", notes = "企业账户明细-获取企业所有服务商数据")
+    @PostMapping(value = "/allSubcontractorData")
+    public Result<?> getAllSubcontractorData(@RequestBody String json) {
+        log.info("json========{}", json);
+        //数据解密
+        json = CryptTool.decode(json);
+        JSONObject jsonObject = JSONObject.parseObject(json);
+        //获取应用信息
+        OauthApplication oauthApplication = authService.getApplication(SecurityUtils.getClient());
+        jsonObject.put("applicationId", oauthApplication.getApplicationId());
+        Result<?> result = hlwCompanyAccountServiceClient.getAllSubcontractorData(jsonObject);
+        return result;
+    }
 }

+ 9 - 0
happy-cloud-auth/src/main/java/org/jeecg/modules/feign/client/HlwCompanyAccountServiceClient.java

@@ -38,4 +38,13 @@ public interface HlwCompanyAccountServiceClient {
      */
     @PostMapping(value = "/wisdom/hlwCompanyAccount/api/getSubcontractorBankInfo")
     Result<?> getSubcontractorBankInfo(JSONObject jsonObject);
+
+    /**
+     * 获取企业所有服务商数据
+     *
+     * @param jsonObject
+     * @return
+     */
+    @PostMapping(value = "/wisdom/hlwCompanyAccount/api/getAllSubcontractorData")
+    Result<?> getAllSubcontractorData(JSONObject jsonObject);
 }

+ 5 - 0
happy-cloud-auth/src/main/java/org/jeecg/modules/feign/client/fallback/HlwCompanyAccountServiceClientFallbackImpl.java

@@ -27,4 +27,9 @@ public class HlwCompanyAccountServiceClientFallbackImpl implements HlwCompanyAcc
     public Result<?> getSubcontractorBankInfo(JSONObject jsonObject) {
         return Result.error("查询失败");
     }
+
+    @Override
+    public Result<?> getAllSubcontractorData(JSONObject jsonObject) {
+        return Result.error("查询失败");
+    }
 }

+ 22 - 0
happy-cloud-wisdom/happy-cloud-wisdom-biz/src/main/java/org/jeecg/modules/api/controller/HlwCompanyAccountApiController.java

@@ -8,9 +8,11 @@ import lombok.extern.slf4j.Slf4j;
 import org.jeecg.common.api.vo.Result;
 import org.jeecg.common.aspect.annotation.AutoLog;
 import org.jeecg.common.system.base.controller.JeecgController;
+import org.jeecg.modules.hlwaccount.entity.HlwCompany;
 import org.jeecg.modules.hlwaccount.entity.HlwCompanyAccount;
 import org.jeecg.modules.hlwaccount.service.IHlwCompanyAccountDetailService;
 import org.jeecg.modules.hlwaccount.service.IHlwCompanyAccountService;
+import org.jeecg.modules.hlwaccount.service.IHlwCompanyService;
 import org.jeecg.modules.hlwpayment.entity.HlwPayment;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.PostMapping;
@@ -32,6 +34,8 @@ public class HlwCompanyAccountApiController extends JeecgController<HlwCompanyAc
 
     @Autowired
     private IHlwCompanyAccountDetailService hlwCompanyAccountDetailService;
+    @Autowired
+    private IHlwCompanyService hlwCompanyService;
 
     /**
      * 企业账户明细-列表
@@ -66,4 +70,22 @@ public class HlwCompanyAccountApiController extends JeecgController<HlwCompanyAc
         return result;
     }
 
+    /**
+     * 获取企业所有服务商数据
+     *
+     * @param jsonObject
+     * @return
+     */
+    @AutoLog(value = "企业账户明细-获取企业所有服务商数据")
+    @ApiOperation(value = "企业账户明细-获取企业所有服务商数据", notes = "企业账户明细-获取企业所有服务商数据")
+    @PostMapping(value = "/getAllSubcontractorData")
+    public Result<?> getAllSubcontractorData(@RequestBody JSONObject jsonObject) {
+        String companyCode = jsonObject.getString("companyCode");
+        log.info("companyCode========={}", companyCode);
+        //根据companyCode获取HlwCompany实体
+        HlwCompany hlwCompany = hlwCompanyService.getByCompanyCode(companyCode);
+        //获取请求参数
+        Result<?> result = hlwCompanyAccountDetailService.getAllSubcontractorData(hlwCompany);
+        return result;
+    }
 }

+ 4 - 0
happy-cloud-wisdom/happy-cloud-wisdom-biz/src/main/java/org/jeecg/modules/hlwaccount/service/IHlwCompanyAccountDetailService.java

@@ -1,8 +1,10 @@
 package org.jeecg.modules.hlwaccount.service;
 
+import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import org.jeecg.common.api.vo.Result;
+import org.jeecg.modules.hlwaccount.entity.HlwCompany;
 import org.jeecg.modules.hlwaccount.entity.HlwCompanyAccount;
 import org.jeecg.modules.hlwaccount.entity.HlwCompanyAccountDetail;
 import com.baomidou.mybatisplus.extension.service.IService;
@@ -32,4 +34,6 @@ public interface IHlwCompanyAccountDetailService extends IService<HlwCompanyAcco
     Result<?> detailList(HlwCompanyAccount hlwCompanyAccount);
 
     Result<?> getSubcontractorBankInfo(HlwCompanyAccount hlwCompanyAccount);
+
+    Result<?> getAllSubcontractorData(HlwCompany hlwCompany);
 }

+ 24 - 0
happy-cloud-wisdom/happy-cloud-wisdom-biz/src/main/java/org/jeecg/modules/hlwaccount/service/impl/HlwCompanyAccountDetailServiceImpl.java

@@ -1,5 +1,6 @@
 package org.jeecg.modules.hlwaccount.service.impl;
 
+import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@@ -13,6 +14,8 @@ import org.jeecg.modules.hlwaccount.service.IHlwCompanyCpService;
 import org.jeecg.modules.hlwaccount.service.IHlwCompanySubcontractorService;
 import org.jeecg.modules.hlwcpmanager.entity.HlwCpSubcontractorBankAccount;
 import org.jeecg.modules.hlwcpmanager.service.IHlwCpSubcontractorBankAccountService;
+import org.jeecg.modules.hlworder.entity.HlwRequirement;
+import org.jeecg.modules.hlworder.service.IHlwRequirementService;
 import org.jeecg.modules.hlwpayment.entity.HlwPayment;
 import org.jeecg.modules.hlwpayment.service.IHlwPaymentService;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -45,6 +48,8 @@ public class HlwCompanyAccountDetailServiceImpl extends ServiceImpl<HlwCompanyAc
     private IHlwCompanyCpService hlwCompanyCpService;
     @Autowired
     private IHlwPaymentService hlwPaymentService;
+    @Autowired
+    private IHlwRequirementService hlwRequirementService;
 
     @Override
     public Page<HlwCompanyAccountDetail> pageList(Page<HlwCompanyAccountDetail> page, HlwCompanyAccountDetail hlwCompanyAccountDetail, QueryWrapper<HlwCompanyAccountDetail> queryWrapper) {
@@ -383,4 +388,23 @@ public class HlwCompanyAccountDetailServiceImpl extends ServiceImpl<HlwCompanyAc
         map.put("bankList", list);
         return Result.ok(map);
     }
+
+    /**
+     * 获取企业所有服务商数据
+     *
+     * @param hlwCompany
+     * @return
+     */
+    @Override
+    public Result<?> getAllSubcontractorData(HlwCompany hlwCompany) {
+        Map<String, Object> map = new HashMap<>();
+        //已付款订单数
+        QueryWrapper<HlwPayment> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("application_id", hlwCompany.getApplicationId());
+        queryWrapper.eq("company_id", hlwCompany.getId());
+        queryWrapper.eq("status", 3);
+        int count = hlwPaymentService.count(queryWrapper);
+        map.put("paymentCount", count);
+        return Result.ok(map);
+    }
 }