TRX преди 1 година
родител
ревизия
d389e2e80a

+ 16 - 9
FullCardServer/src/main/java/com/zhongshu/card/server/core/controller/pay/withdraw/WithdrawController.java

@@ -23,11 +23,18 @@ public class WithdrawController {
     @Autowired
     private WithdrawService withdrawService;
 
+    @ResourceAuth(value = "user", type = AuthType.User)
+    @Operation(summary = "查询项目下所有账户可提案余额", description = "查询项目下所有账户可提案余额")
+    @RequestMapping(value = "queryProjectWithdrawAmount", method = RequestMethod.GET)
+    public Object queryProjectWithdrawAmount(@RequestParam(value = "projectId", required = false) String projectOid) {
+        return withdrawService.queryWithdrawAmount(projectOid);
+    }
+
     @ResourceAuth(value = "user", type = AuthType.User)
     @Operation(summary = "查询账户可提案余额", description = "顶部数据及资金概况-折线图")
     @RequestMapping(value = "queryWithdrawAmount", method = RequestMethod.GET)
     public Object queryWithdrawAmount(@RequestParam(value = "projectId", required = false) String projectOid,
-                                      @RequestParam(value = "oid", required = false) String oid){
+            @RequestParam(value = "oid", required = false) String oid) {
         return withdrawService.queryWithdrawAmount(projectOid, oid);
     }
 
@@ -35,44 +42,44 @@ public class WithdrawController {
     @Operation(summary = "查询渠道可提案余额", description = "顶部数据及资金概况-折线图")
     @RequestMapping(value = "queryWithdrawAmountByPayment", method = RequestMethod.GET)
     public Object queryWithdrawAmountByPayment(@RequestParam(value = "projectId", required = false) String projectOid,
-                                      @RequestParam(value = "oid", required = false) String oid,
-                                      @RequestParam("paymentType") PaymentType paymentType){
+            @RequestParam(value = "oid", required = false) String oid,
+            @RequestParam("paymentType") PaymentType paymentType) {
         return withdrawService.queryWithdrawAmount(projectOid, oid, paymentType);
     }
 
     @ResourceAuth(value = "user", type = AuthType.User)
     @Operation(summary = "发起提现", description = "发起提现")
     @RequestMapping(value = "withdrawApply", method = RequestMethod.POST)
-    public Object withdrawApply(@RequestBody WithdrawParam param){
+    public Object withdrawApply(@RequestBody WithdrawParam param) {
         return withdrawService.withdrawApply(param);
     }
 
     @ResourceAuth(value = "user", type = AuthType.User)
     @Operation(summary = "审核提现", description = "审核提现")
     @RequestMapping(value = "withdraw", method = RequestMethod.POST)
-    public Object withdraw(@RequestBody ProcessWithdrawParam param){
+    public Object withdraw(@RequestBody ProcessWithdrawParam param) {
         return withdrawService.withdraw(param);
     }
 
     @ResourceAuth(value = "user", type = AuthType.User)
     @Operation(summary = "分页查询-提现记录", description = "查询收入账单-年月日汇总")
     @RequestMapping(value = "page", method = RequestMethod.POST)
-    public Object page(@Parameter(hidden = true) @PageableDefault(page = 0, size = 10)Pageable pageable,
-                       @Parameter(required = false) WithdrawPageParam param){
+    public Object page(@Parameter(hidden = true) @PageableDefault(page = 0, size = 10) Pageable pageable,
+            @Parameter(required = false) WithdrawPageParam param) {
         return withdrawService.page(pageable, param);
     }
 
     @ResourceAuth(value = "user", type = AuthType.User)
     @Operation(summary = "查询提现状态", description = "查询提现状态")
     @RequestMapping(value = "withdrawQuery", method = RequestMethod.GET)
-    public Object withdrawQuery(@RequestParam("id") String id){
+    public Object withdrawQuery(@RequestParam("id") String id) {
         return withdrawService.withdrawQuery(id);
     }
 
     @ResourceAuth(value = "user", type = AuthType.User)
     @Operation(summary = "查询提现订单详情", description = "查询提现状态")
     @RequestMapping(value = "queryDetailById", method = RequestMethod.GET)
-    public Object queryDetailById(@RequestParam("id") String id){
+    public Object queryDetailById(@RequestParam("id") String id) {
         return withdrawService.queryDetailById(id);
     }
 }

+ 2 - 1
FullCardServer/src/main/java/com/zhongshu/card/server/core/service/devices/DeviceInfoServiceImpl.java

@@ -297,13 +297,14 @@ public class DeviceInfoServiceImpl extends SuperService implements DeviceInfoSer
             }
         }
 
-        if(ObjectUtils.isNotEmpty(organization)) {
+        if (ObjectUtils.isNotEmpty(organization)) {
             // 检查设备关联的机构,是否可以收款
             ResultContent resultContent = orgPaySettingJudgmentService.checkOrgPaySetting(deviceInfo.getProjectOid(), deviceInfo.getBeLongOid());
             if (resultContent.isFailed()) {
                 return ResultContent.buildFail(resultContent.getMsg());
             }
         }
+        deviceInfo.setAboutInfo(param.getAboutInfo());
 
         deviceInfoDao.save(deviceInfo);
         return ResultContent.buildSuccess();

+ 24 - 2
FullCardServer/src/main/java/com/zhongshu/card/server/core/service/pay/WithdrawService.java

@@ -33,8 +33,8 @@ import com.zhongshu.card.server.core.domain.org.UserAccount;
 import com.zhongshu.card.server.core.domain.pay.PayAccount;
 import com.zhongshu.card.server.core.domain.pay.WithdrawOrder;
 import com.zhongshu.card.server.core.domain.paySetting.ProjectMainPaySetting;
-import com.zhongshu.card.server.core.model.pay.UnionFrictionlessPayFinishModel;
 import com.zhongshu.card.server.core.service.base.SuperService;
+import com.zhongshu.card.server.core.service.org.OrganizationUserServiceImpl;
 import com.zhongshu.card.server.core.service.org.UserOrgPermissService;
 import com.zhongshu.card.server.core.service.paySetting.OrgPayAccountService;
 import com.zhongshu.card.server.core.service.paySetting.ProjectMainPaySettingService;
@@ -43,6 +43,7 @@ import com.zhongshu.card.server.core.service.user.UserAccountServiceImpl;
 import com.zhongshu.card.server.core.util.BeanUtils;
 import com.zhongshu.card.server.core.util.CommonUtil;
 import lombok.SneakyThrows;
+import org.apache.commons.lang3.ObjectUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.data.domain.Page;
@@ -50,7 +51,6 @@ import org.springframework.data.domain.Pageable;
 import org.springframework.stereotype.Service;
 
 import java.math.BigDecimal;
-import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.List;
 import java.util.Map;
@@ -91,6 +91,28 @@ public class WithdrawService extends SuperService {
     @Autowired
     PayProductAccountService payProductAccountService;
 
+    @Autowired
+    private OrganizationUserServiceImpl organizationUserService;
+
+    /**
+     * 查询当前在项目下所有的可提现的金额
+     *
+     * @param projectOid
+     * @return
+     */
+    public ResultContent<Long> queryWithdrawAmount(String projectOid) {
+        Long total = 0L;
+        if (StringUtils.isEmpty(projectOid)) {
+            projectOid = getCurrentProjectOid();
+        }
+        String userId = getCurrentUserId();
+        // 查询用户加入的所有机构
+        List<String> oids = organizationUserService.getUserOrgListOids(userId, projectOid);
+        if (ObjectUtils.isNotEmpty(oids)) {
+
+        }
+        return ResultContent.buildContent(total);
+    }
 
     /**
      * 查询可提现余额

+ 11 - 3
FullCardServer/src/main/java/com/zhongshu/card/server/core/service/scene/RoleSceneInfoService.java

@@ -172,12 +172,12 @@ public class RoleSceneInfoService extends SuperService {
         if (content.isSuccess()) {
             List<RoleSimpleModel> roles = content.getContent();
             if (ObjectUtils.isNotEmpty(roles)) {
-
                 List<SceneInfoAboutComModel> models = new ArrayList<>();
+
                 List<String> roleIds = roles.stream().map(it -> it.getId()).collect(Collectors.toUnmodifiableList());
                 List<RoleSceneInfo> list = roleSceneInfoDao.findByRoleIdInOrderBySortAsc(roleIds);
                 if (ObjectUtils.isNotEmpty(list)) {
-                    list.parallelStream().forEach(it -> {
+                    list.stream().forEach(it -> {
                         SceneInfo sceneInfo = it.getSceneInfo();
                         ProjectSceneInfo projectSceneInfo = it.getProjectSceneInfo();
                         if (ObjectUtils.isNotEmpty(projectSceneInfo) && ObjectUtils.isNotEmpty(sceneInfo)) {
@@ -187,8 +187,16 @@ public class RoleSceneInfoService extends SuperService {
                         }
                     });
                 }
+                List<SceneInfoAboutComModel> reModels = new ArrayList<>();
+                HashMap<String, String> map = new HashMap<>();
+                for (SceneInfoAboutComModel model : models) {
+                    if(!map.containsKey(model.getId())) {
+                        map.put(model.getId(), model.getName());
+                        reModels.add(model);
+                    }
+                }
                 // 去重
-                return models.stream().distinct().collect(Collectors.toUnmodifiableList());
+                return reModels;
             }
         }
         return Lists.newArrayList();