Procházet zdrojové kódy

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	FullCardServer/src/main/java/com/zhongshu/card/server/core/service/pay/WithdrawService.java
wujiefeng před 1 rokem
rodič
revize
fe37d25f75
28 změnil soubory, kde provedl 1017 přidání a 78 odebrání
  1. 46 0
      FullCardClient/src/main/java/com/zhongshu/card/client/model/org/OrganizationAboutPayChannelModel.java
  2. 2 0
      FullCardClient/src/main/java/com/zhongshu/card/client/model/paySetting/paySetting/OrgPayConfigModel.java
  3. 38 0
      FullCardClient/src/main/java/com/zhongshu/card/client/model/paySetting/paySetting/OrgPayShowSettingModel.java
  4. 64 0
      FullCardClient/src/main/java/com/zhongshu/card/client/model/paySetting/withdrawal/OrgWithdrawalModel.java
  5. 27 0
      FullCardClient/src/main/java/com/zhongshu/card/client/model/paySetting/withdrawal/OrgWithdrawalParam.java
  6. 65 0
      FullCardClient/src/main/java/com/zhongshu/card/client/model/projectAbout/PayChannelSimpleModel.java
  7. 19 0
      FullCardClient/src/main/java/com/zhongshu/card/client/model/quest/PsdParam.java
  8. 20 0
      FullCardClient/src/main/java/com/zhongshu/card/client/model/quest/QuestInfoModel.java
  9. 26 0
      FullCardClient/src/main/java/com/zhongshu/card/client/model/quest/QuestInfoParam.java
  10. 24 0
      FullCardClient/src/main/java/com/zhongshu/card/client/model/quest/QuestInfoSearch.java
  11. 29 0
      FullCardClient/src/main/java/com/zhongshu/card/client/model/quest/QuestInfoUpdateParam.java
  12. 20 0
      FullCardClient/src/main/java/com/zhongshu/card/client/model/quest/QuestTitleModel.java
  13. 7 0
      FullCardServer/src/main/java/com/zhongshu/card/server/core/controller/org/OrganizationUserController.java
  14. 8 5
      FullCardServer/src/main/java/com/zhongshu/card/server/core/controller/paySetting/ProjectPaySettingController.java
  15. 61 0
      FullCardServer/src/main/java/com/zhongshu/card/server/core/controller/quest/QuestInfoController.java
  16. 1 0
      FullCardServer/src/main/java/com/zhongshu/card/server/core/dao/projectAbout/ProjectOrgPaySettingInfoDao.java
  17. 22 0
      FullCardServer/src/main/java/com/zhongshu/card/server/core/dao/quest/QuestInfoDao.java
  18. 21 0
      FullCardServer/src/main/java/com/zhongshu/card/server/core/dao/quest/extend/QuestInfoDaoExtend.java
  19. 68 0
      FullCardServer/src/main/java/com/zhongshu/card/server/core/dao/quest/impl/QuestInfoDaoImpl.java
  20. 29 0
      FullCardServer/src/main/java/com/zhongshu/card/server/core/domain/quest/QuestInfo.java
  21. 28 0
      FullCardServer/src/main/java/com/zhongshu/card/server/core/service/org/OrganizationUserServiceImpl.java
  22. 79 70
      FullCardServer/src/main/java/com/zhongshu/card/server/core/service/pay/WithdrawService.java
  23. 13 0
      FullCardServer/src/main/java/com/zhongshu/card/server/core/service/paySetting/ProjectChannelConfigService.java
  24. 96 0
      FullCardServer/src/main/java/com/zhongshu/card/server/core/service/paySetting/ProjectPaySettingServiceImpl.java
  25. 186 0
      FullCardServer/src/main/java/com/zhongshu/card/server/core/service/quest/QuestService.java
  26. 1 1
      FullCardServer/src/main/java/com/zhongshu/card/server/core/service/user/UserAccountServiceImpl.java
  27. 13 0
      FullCardServer/src/main/java/com/zhongshu/card/server/core/util/CommonUtil.java
  28. 4 2
      FullCardServer/src/main/java/com/zhongshu/card/server/core/util/ExcelUtils.java

+ 46 - 0
FullCardClient/src/main/java/com/zhongshu/card/client/model/org/OrganizationAboutPayChannelModel.java

@@ -0,0 +1,46 @@
+package com.zhongshu.card.client.model.org;
+
+import com.github.microservice.auth.security.type.AuthType;
+import com.zhongshu.card.client.model.paySetting.paySetting.OrgPayShowSettingModel;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * 机构数据 最简单的模型
+ *
+ * @author TRX
+ * @date 2024/5/31
+ */
+@Data
+public class OrganizationAboutPayChannelModel {
+
+    @Schema(description = "数据ID")
+    private String id;
+
+    @Schema(description = "机构oid")
+    private String oid;
+
+    @Schema(description = "机构名称")
+    private String name;
+
+    @Schema(description = "编码、项目ID、机构编号")
+    private String code;
+
+    @Schema(description = "机构类型")
+    private AuthType authType = AuthType.Enterprise;
+
+    private String authTypeStr;
+
+    public String getAuthTypeStr() {
+        if (authType != null) {
+            return authType.getRemark();
+        }
+        return "";
+    }
+
+    private List<OrgPayShowSettingModel> payChannels = new ArrayList<>();
+
+}

+ 2 - 0
FullCardClient/src/main/java/com/zhongshu/card/client/model/paySetting/paySetting/OrgPayConfigModel.java

@@ -14,6 +14,8 @@ import lombok.NoArgsConstructor;
 @NoArgsConstructor
 public class OrgPayConfigModel {
 
+    private String id;
+
     @Schema(description = "账户/名称")
     private String name;
 

+ 38 - 0
FullCardClient/src/main/java/com/zhongshu/card/client/model/paySetting/paySetting/OrgPayShowSettingModel.java

@@ -0,0 +1,38 @@
+package com.zhongshu.card.client.model.paySetting.paySetting;
+
+import com.github.microservice.types.payment.PaymentType;
+import com.zhongshu.card.client.model.projectAbout.PayChannelConfigModel;
+import com.zhongshu.card.client.model.projectAbout.PayChannelSimpleModel;
+import com.zhongshu.card.client.type.DataState;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ * @author TRX
+ * @date 2024/7/26
+ */
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+public class OrgPayShowSettingModel {
+
+    @Schema(description = "项目的支付渠道设置")
+    private PaymentType channelType;
+
+    private String channelTypeStr;
+
+    public String getChannelTypeStr() {
+        if (channelType != null) {
+            return channelType.getRemark();
+        }
+        return "";
+    }
+
+    private PaymentType paymentType;
+
+    @Schema(description = "关联的支付产品信息")
+    private PayChannelSimpleModel payChannelConfigModel;
+
+}

+ 64 - 0
FullCardClient/src/main/java/com/zhongshu/card/client/model/paySetting/withdrawal/OrgWithdrawalModel.java

@@ -0,0 +1,64 @@
+package com.zhongshu.card.client.model.paySetting.withdrawal;
+
+import com.zhongshu.card.client.model.paySetting.paySetting.OrgPayConfigModel;
+import com.zhongshu.card.client.type.paySetting.WithdrawMethodType;
+import com.zhongshu.card.client.type.paySetting.WithdrawType;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.math.BigDecimal;
+
+/**
+ * web 机构 提现的信息
+ *
+ * @author TRX
+ * @date 2024/12/3
+ */
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+public class OrgWithdrawalModel {
+
+    @Schema(description = "机构的账号信息")
+    private OrgPayConfigModel orgPayConfigModel;
+
+    //------------------------------提现规则 --------------------
+    @Schema(description = "提现规则类型")
+    private WithdrawType withdrawType;
+
+    private String withdrawTypeStr;
+
+    public String getWithdrawTypeStr() {
+        if (withdrawType != null) {
+            return withdrawType.getRemark();
+        }
+        return "";
+    }
+
+    @Schema(description = "提现方式")
+    private WithdrawMethodType withdrawMethodType;
+
+    private String withdrawMethodTypeStr;
+
+    public String getWithdrawMethodTypeStr() {
+        if (withdrawMethodType != null) {
+            return withdrawMethodType.getRemark();
+        }
+        return "";
+    }
+
+    @Schema(description = "最小的提现额度")
+    private Long minWithdraw = 0L;
+
+    @Schema(description = "最大的提现额度")
+    private Long maxWithdraw = 0L;
+
+    @Schema(description = "余额,分")
+    private Long balance = 0L;
+
+    @Schema(description = "余额,元")
+    private BigDecimal withdrawAmount = BigDecimal.ZERO;
+
+}

+ 27 - 0
FullCardClient/src/main/java/com/zhongshu/card/client/model/paySetting/withdrawal/OrgWithdrawalParam.java

@@ -0,0 +1,27 @@
+package com.zhongshu.card.client.model.paySetting.withdrawal;
+
+import com.github.microservice.types.payment.PaymentType;
+import com.zhongshu.card.client.model.base.ProjectOidParam;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ * 查询结构可提现的参数
+ *
+ * @author TRX
+ * @date 2024/12/3
+ */
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+public class OrgWithdrawalParam extends ProjectOidParam {
+
+    @Schema(description = "支付渠道")
+    private PaymentType paymentType;
+
+    @Schema(description = "机构oid")
+    private String oid;
+
+}

+ 65 - 0
FullCardClient/src/main/java/com/zhongshu/card/client/model/projectAbout/PayChannelSimpleModel.java

@@ -0,0 +1,65 @@
+package com.zhongshu.card.client.model.projectAbout;
+
+import com.github.microservice.types.payment.PaymentChannelType;
+import com.github.microservice.types.payment.PaymentType;
+import com.zhongshu.card.client.type.DataState;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ * 项目的 支付渠道配置模型
+ *
+ * @author TRX
+ * @date 2024/9/27
+ */
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+public class PayChannelSimpleModel {
+
+    private String id;
+
+    @Schema(description = "支付产品名称")
+    private String name;
+
+    @Schema(description = "logo")
+    private String logo;
+
+    @Schema(description = "支付类型")
+    private PaymentType paymentType;
+
+    private String paymentTypeStr;
+
+    public String getPaymentTypeStr() {
+        if (paymentType != null) {
+            return paymentType.getRemark();
+        }
+        return "";
+    }
+
+    private String paymentChannelTypeName;
+
+    public String getPaymentChannelTypeName() {
+        if (paymentChannelType != null) {
+            return paymentChannelType.name();
+        }
+        return "";
+    }
+
+    @Schema(description = "支付类型")
+    private PaymentChannelType paymentChannelType;
+
+    private String paymentChannelTypeStr;
+
+    public String getPaymentChannelTypeStr() {
+        if (paymentChannelType != null) {
+            return paymentChannelType.getRemark();
+        }
+        return "";
+    }
+
+    @Schema(description = "汇率说明")
+    private String rateMark;
+}

+ 19 - 0
FullCardClient/src/main/java/com/zhongshu/card/client/model/quest/PsdParam.java

@@ -0,0 +1,19 @@
+package com.zhongshu.card.client.model.quest;
+
+import com.zhongshu.card.client.model.base.IDParam;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ * @author TRX
+ * @date 2024/11/29
+ */
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+public class PsdParam extends IDParam {
+
+    private String psd;
+
+}

+ 20 - 0
FullCardClient/src/main/java/com/zhongshu/card/client/model/quest/QuestInfoModel.java

@@ -0,0 +1,20 @@
+package com.zhongshu.card.client.model.quest;
+
+import com.zhongshu.card.client.model.base.SuperModel;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ * @author TRX
+ * @date 2024/11/29
+ */
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+public class QuestInfoModel extends SuperModel {
+
+    private String name;
+
+    private Object data;
+}

+ 26 - 0
FullCardClient/src/main/java/com/zhongshu/card/client/model/quest/QuestInfoParam.java

@@ -0,0 +1,26 @@
+package com.zhongshu.card.client.model.quest;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ * @author TRX
+ * @date 2024/11/29
+ */
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+public class QuestInfoParam {
+
+    @Schema(description = "", hidden = true)
+    private String id;
+
+    private String name;
+
+    private Object data;
+
+    private String uuid;
+
+}

+ 24 - 0
FullCardClient/src/main/java/com/zhongshu/card/client/model/quest/QuestInfoSearch.java

@@ -0,0 +1,24 @@
+package com.zhongshu.card.client.model.quest;
+
+import com.zhongshu.card.client.model.base.SuperSearch;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ * @author TRX
+ * @date 2024/11/29
+ */
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+public class QuestInfoSearch extends SuperSearch {
+
+    private String name;
+
+    private String keyWord;
+
+    @Schema(description = "操作密码")
+    private String psd;
+}

+ 29 - 0
FullCardClient/src/main/java/com/zhongshu/card/client/model/quest/QuestInfoUpdateParam.java

@@ -0,0 +1,29 @@
+package com.zhongshu.card.client.model.quest;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ * @author TRX
+ * @date 2024/11/29
+ */
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+public class QuestInfoUpdateParam {
+
+    @Schema(description = "", hidden = true)
+    private String id;
+
+    @Schema(description = "密码")
+    private String psd;
+
+    @Schema(description = "问卷名称")
+    private String name;
+
+    @Schema(description = "数据")
+    private Object data;
+
+}

+ 20 - 0
FullCardClient/src/main/java/com/zhongshu/card/client/model/quest/QuestTitleModel.java

@@ -0,0 +1,20 @@
+package com.zhongshu.card.client.model.quest;
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ * @author TRX
+ * @date 2024/11/29
+ */
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+public class QuestTitleModel {
+
+    private String questionId;
+
+    private String question;
+
+}

+ 7 - 0
FullCardServer/src/main/java/com/zhongshu/card/server/core/controller/org/OrganizationUserController.java

@@ -128,4 +128,11 @@ public class OrganizationUserController {
         organizationUserService.exportProjectUser(request, response, param);
     }
 
+    @ResourceAuth(value = "user", type = AuthType.User)
+    @Operation(summary = "查询当前用户的在项目的机构列表", description = "查询当前用户的在项目的机构列表")
+    @RequestMapping(value = {"getCurrentOrgs"}, method = {RequestMethod.POST})
+    public ResultContent getCurrentOrgs(@RequestBody ProjectOidParam param) {
+        return organizationUserService.getCurrentOrgs(param.getProjectOid());
+    }
+
 }

+ 8 - 5
FullCardServer/src/main/java/com/zhongshu/card/server/core/controller/paySetting/ProjectPaySettingController.java

@@ -7,12 +7,10 @@ import com.zhongshu.card.client.model.base.IDParam;
 import com.zhongshu.card.client.model.base.ProjectOidParam;
 import com.zhongshu.card.client.model.org.BelongOigParam;
 import com.zhongshu.card.client.model.paySetting.payConfig.FrictionlessUnionConfigParam;
-import com.zhongshu.card.client.model.paySetting.payConfig.LaKaLaCollectionConfig;
 import com.zhongshu.card.client.model.paySetting.payConfig.LaKaLaCollectionConfigParam;
 import com.zhongshu.card.client.model.paySetting.paySetting.*;
+import com.zhongshu.card.client.model.paySetting.withdrawal.OrgWithdrawalParam;
 import com.zhongshu.card.client.model.payment.PaymentTypeParam;
-import com.zhongshu.card.client.model.projectAbout.PayChannelConfigAllPayModel;
-import com.zhongshu.card.client.model.projectAbout.PayChannelConfigSearch;
 import com.zhongshu.card.client.type.DataState;
 import com.zhongshu.card.server.core.service.paySetting.ProjectPaySettingServiceImpl;
 import io.swagger.v3.oas.annotations.Operation;
@@ -20,7 +18,6 @@ import io.swagger.v3.oas.annotations.Parameter;
 import io.swagger.v3.oas.annotations.tags.Tag;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.data.domain.Page;
-import org.springframework.data.domain.PageRequest;
 import org.springframework.data.domain.Pageable;
 import org.springframework.data.web.PageableDefault;
 import org.springframework.http.MediaType;
@@ -31,7 +28,6 @@ import org.springframework.web.bind.annotation.RequestMethod;
 import org.springframework.web.bind.annotation.RestController;
 
 import javax.validation.Valid;
-import java.util.ArrayList;
 import java.util.List;
 
 /**
@@ -172,4 +168,11 @@ public class ProjectPaySettingController {
         return projectPaySettingService.saveUnionPayConfig(param);
     }
 
+    @ResourceAuth(value = "user", type = AuthType.User)
+    @Operation(summary = "选择机构查询提现的数据", description = "选择机构查询提现的数据")
+    @RequestMapping(value = {"getOrgWithdrawal"}, method = {RequestMethod.POST})
+    public ResultContent getOrgWithdrawal(@RequestBody OrgWithdrawalParam param) {
+        return projectPaySettingService.getOrgWithdrawal(param);
+    }
+
 }

+ 61 - 0
FullCardServer/src/main/java/com/zhongshu/card/server/core/controller/quest/QuestInfoController.java

@@ -0,0 +1,61 @@
+package com.zhongshu.card.server.core.controller.quest;
+
+import com.github.microservice.net.ResultContent;
+import com.zhongshu.card.client.model.quest.*;
+import com.zhongshu.card.server.core.service.quest.QuestService;
+import io.swagger.v3.oas.annotations.Operation;
+import io.swagger.v3.oas.annotations.Parameter;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import jakarta.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletResponse;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.domain.Page;
+import org.springframework.data.domain.Pageable;
+import org.springframework.data.web.PageableDefault;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * @author TRX
+ * @date 2024/6/5
+ */
+@RestController
+@RequestMapping("/questInfo")
+@Tag(name = "问卷调查")
+public class QuestInfoController {
+
+    @Autowired
+    private QuestService questService;
+
+    @Operation(summary = "添加问卷结果", description = "添加问卷结果")
+    @RequestMapping(value = "saveInfo", method = {RequestMethod.POST})
+    public ResultContent saveInfo(@RequestBody QuestInfoParam param) {
+        return this.questService.saveInfo(param);
+    }
+
+    @Operation(summary = "编辑问卷结果", description = "添加问卷结果")
+    @RequestMapping(value = "updateInfo", method = {RequestMethod.POST})
+    public ResultContent updateInfo(@RequestBody QuestInfoUpdateParam param) {
+        return this.questService.updateInfo(param);
+    }
+
+    @Operation(summary = "删除", description = "删除")
+    @RequestMapping(value = "deleteById", method = {RequestMethod.POST})
+    public ResultContent deleteById(@RequestBody PsdParam param) {
+        return this.questService.deleteById(param);
+    }
+
+    @Operation(summary = "列表-分页查询", description = "列表-分页查询")
+    @RequestMapping(value = {"page"}, method = {RequestMethod.POST})
+    public ResultContent<Page<QuestInfoModel>> page(@Parameter(hidden = true) @PageableDefault(page = 0, size = 10) Pageable pageable, @Parameter(required = false) QuestInfoSearch param) {
+        return questService.page(param, pageable);
+    }
+
+    @RequestMapping(value = "exportData", method = RequestMethod.POST)
+    @Operation(summary = "导出数据", description = "导出数据")
+    public void exportData(HttpServletRequest request, HttpServletResponse response, QuestInfoSearch param) throws Exception {
+        questService.exportData(request, response, param);
+    }
+}

+ 1 - 0
FullCardServer/src/main/java/com/zhongshu/card/server/core/dao/projectAbout/ProjectOrgPaySettingInfoDao.java

@@ -22,4 +22,5 @@ public interface ProjectOrgPaySettingInfoDao extends MongoDao<ProjectOrgPaySetti
 
     ProjectOrgPaySettingInfo findTopByBelongOigAndProjectOidAndChannelType(String belongOig, String projectOid, PaymentType channelType);
 
+    ProjectOrgPaySettingInfo findTopByBelongOigAndProjectOidAndChannelTypeAndIsDefault(String belongOig, String projectOid, PaymentType channelType, Boolean isDefault);
 }

+ 22 - 0
FullCardServer/src/main/java/com/zhongshu/card/server/core/dao/quest/QuestInfoDao.java

@@ -0,0 +1,22 @@
+package com.zhongshu.card.server.core.dao.quest;
+
+import com.github.microservice.components.data.mongo.mongo.dao.MongoDao;
+import com.zhongshu.card.server.core.dao.devices.extend.DeviceInfoDaoExtend;
+import com.zhongshu.card.server.core.dao.quest.extend.QuestInfoDaoExtend;
+import com.zhongshu.card.server.core.domain.devices.DeviceInfo;
+import com.zhongshu.card.server.core.domain.quest.QuestInfo;
+
+import java.util.List;
+
+/**
+ * 设备Dao
+ *
+ * @author TRX
+ * @date 2024/3/21
+ */
+public interface QuestInfoDao extends MongoDao<QuestInfo>, QuestInfoDaoExtend {
+
+    QuestInfo findTopById(String id);
+
+    QuestInfo findTopByUuid(String uuid);
+}

+ 21 - 0
FullCardServer/src/main/java/com/zhongshu/card/server/core/dao/quest/extend/QuestInfoDaoExtend.java

@@ -0,0 +1,21 @@
+package com.zhongshu.card.server.core.dao.quest.extend;
+
+import com.zhongshu.card.client.model.devices.DeviceInfoSearch;
+import com.zhongshu.card.client.model.quest.QuestInfoSearch;
+import com.zhongshu.card.server.core.domain.devices.DeviceInfo;
+import com.zhongshu.card.server.core.domain.quest.QuestInfo;
+import org.springframework.data.domain.Page;
+import org.springframework.data.domain.Pageable;
+
+/**
+ * 设备管理
+ *
+ * @Author TRX
+ * @CreateDate: 2023/7/7
+ * @Version: 1.0
+ */
+public interface QuestInfoDaoExtend {
+
+    Page<QuestInfo> page(Pageable pageable, QuestInfoSearch param);
+
+}

+ 68 - 0
FullCardServer/src/main/java/com/zhongshu/card/server/core/dao/quest/impl/QuestInfoDaoImpl.java

@@ -0,0 +1,68 @@
+package com.zhongshu.card.server.core.dao.quest.impl;
+
+import com.github.microservice.components.data.mongo.mongo.helper.DBHelper;
+import com.zhongshu.card.client.model.quest.QuestInfoSearch;
+import com.zhongshu.card.server.core.dao.BaseImpl;
+import com.zhongshu.card.server.core.dao.quest.extend.QuestInfoDaoExtend;
+import com.zhongshu.card.server.core.domain.quest.QuestInfo;
+import com.zhongshu.card.server.core.util.CommonUtil;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.domain.Page;
+import org.springframework.data.domain.Pageable;
+import org.springframework.data.domain.Sort;
+import org.springframework.data.mongodb.core.MongoTemplate;
+import org.springframework.data.mongodb.core.query.Criteria;
+import org.springframework.data.mongodb.core.query.Query;
+import org.springframework.util.CollectionUtils;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.regex.Pattern;
+
+/**
+ * @Author TRX
+ * @CreateDate: 2023/4/12
+ * @Version: 1.0
+ */
+public class QuestInfoDaoImpl extends BaseImpl implements QuestInfoDaoExtend {
+
+    @Autowired
+    private MongoTemplate mongoTemplate;
+
+    @Autowired
+    private DBHelper dbHelper;
+
+    @Override
+    public Page<QuestInfo> page(Pageable pageable, QuestInfoSearch param) {
+        param.setOid("");
+        Criteria criteria = buildCriteria(param);
+
+        if (!CommonUtil.longIsEmpty(param.getStartTime()) && !CommonUtil.longIsEmpty(param.getEndTime())) {
+            criteria.and("createTime").gte(param.getStartTime()).lte(param.getEndTime());
+        }
+
+        // 模糊搜索
+        List<Criteria> criterias = new ArrayList<>();
+        if (StringUtils.isNotEmpty(param.getName())) {
+            Pattern pattern = Pattern.compile("^.*" + param.getName() + ".*$");
+            criterias.add(Criteria.where("name").is(pattern));
+        }
+
+        if (!CollectionUtils.isEmpty(criterias)) {
+            criteria.andOperator(criterias.toArray(new Criteria[]{}));
+        }
+
+        if (StringUtils.isNotEmpty(param.getKeyWord())) {
+            Pattern pattern = Pattern.compile("^.*" + param.getKeyWord() + ".*$");
+            criteria.orOperator(
+                    Criteria.where("name").regex(pattern)
+            );
+        }
+        Sort sort = buildSort(param);
+        Query query = Query.query(criteria);
+        query.with(sort);
+        return dbHelper.pages(query, pageable, QuestInfo.class);
+    }
+
+}

+ 29 - 0
FullCardServer/src/main/java/com/zhongshu/card/server/core/domain/quest/QuestInfo.java

@@ -0,0 +1,29 @@
+package com.zhongshu.card.server.core.domain.quest;
+
+import com.zhongshu.card.server.core.domain.base.SuperMain;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+import org.springframework.data.mongodb.core.mapping.Document;
+
+/**
+ * @author TRX
+ * @date 2024/11/29
+ */
+@Data
+@Builder
+@Document
+@AllArgsConstructor
+@NoArgsConstructor
+public class QuestInfo extends SuperMain {
+
+    @Schema(description = "问卷名称")
+    private String name;
+
+    @Schema(description = "问题及答案")
+    private Object data;
+
+    private String uuid;
+}

+ 28 - 0
FullCardServer/src/main/java/com/zhongshu/card/server/core/service/org/OrganizationUserServiceImpl.java

@@ -12,6 +12,7 @@ import com.google.common.collect.Lists;
 import com.zhongshu.card.client.model.base.ProjectOidParam;
 import com.zhongshu.card.client.model.org.*;
 import com.zhongshu.card.client.model.orgModel.OrgBindUserAllParam;
+import com.zhongshu.card.client.model.paySetting.paySetting.OrgPayShowSettingModel;
 import com.zhongshu.card.client.model.school.ExcelUserParam;
 import com.zhongshu.card.client.model.school.ImportResultModel;
 import com.zhongshu.card.client.model.school.RegisterBindSchoolParam;
@@ -27,6 +28,7 @@ import com.zhongshu.card.server.core.model.org.OrgBindUserParam;
 import com.zhongshu.card.server.core.service.base.SuperService;
 import com.zhongshu.card.server.core.service.devices.DevicePermissEventService;
 import com.zhongshu.card.server.core.service.orgManager.OrganizationManagerServiceImpl;
+import com.zhongshu.card.server.core.service.paySetting.ProjectPaySettingServiceImpl;
 import com.zhongshu.card.server.core.service.school.DictInfoServiceImpl;
 import com.zhongshu.card.server.core.service.user.DepartmentServiceImpl;
 import com.zhongshu.card.server.core.service.user.RoleServiceImpl;
@@ -114,6 +116,8 @@ public class OrganizationUserServiceImpl extends SuperService {
 
     @Autowired
     private DevicePermissEventService devicePermissEventService;
+    @Autowired
+    private ProjectPaySettingServiceImpl projectPaySettingServiceImpl;
 
     /**
      * 添加编辑用户 添加机构用户 (包括角色 部门 职位等信息)
@@ -537,6 +541,30 @@ public class OrganizationUserServiceImpl extends SuperService {
         return ResultContent.buildSuccess();
     }
 
+    /**
+     * 得到当前用户在项目加入的机构
+     *
+     * @param projectOid
+     * @return
+     */
+    public ResultContent getCurrentOrgs(String projectOid) {
+        List<OrganizationAboutPayChannelModel> models = new ArrayList<>();
+        String userId = getCurrentUserId();
+        List<OrganizationUser> list = getUserOrgList(userId, projectOid);
+        if (ObjectUtils.isNotEmpty(list)) {
+            // 项目的支付渠道
+            List<OrgPayShowSettingModel> payChannels = projectPaySettingServiceImpl.getProjectEnablePay(projectOid);
+
+            models = list.stream().map(it -> {
+                OrganizationAboutPayChannelModel model = new OrganizationAboutPayChannelModel();
+                BeanUtils.copyProperties(it.getOrganization(), model);
+                model.setPayChannels(payChannels);
+                return model;
+            }).collect(Collectors.toUnmodifiableList());
+        }
+        return ResultContent.buildSuccess(models);
+    }
+
     /**
      * 查询用户在项目中的 绑定的机构数据列表
      *

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

@@ -95,17 +95,17 @@ public class WithdrawService extends SuperService {
     /**
      * 查询可提现余额
      */
-    public Object queryWithdrawAmount(String projectOid, String oid){
-        if (StringUtils.isBlank(projectOid)){
+    public Object queryWithdrawAmount(String projectOid, String oid) {
+        if (StringUtils.isBlank(projectOid)) {
             projectOid = getCurrentProjectOid();
         }
 
-        if (StringUtils.isBlank(oid)){
+        if (StringUtils.isBlank(oid)) {
             oid = getCurrentOid();
         }
         PayAccount settleAccount = payAccountService.getOrgChildren(projectOid, oid, PaymentChannelType.Settle);
         ResultContent<GeneralLedgerQueryModel> ledgerQueryModelResultContent = generalLedgerService.get(settleAccount.getLedgerId());
-        if (!ledgerQueryModelResultContent.getState().equals(ResultState.Success)){
+        if (!ledgerQueryModelResultContent.getState().equals(ResultState.Success)) {
             return com.github.microservice.net.ResultContent.buildFail("提现账本数据不存在");
         }
         return ResultContent.buildContent(ledgerQueryModelResultContent.getContent().getBalance());
@@ -114,12 +114,12 @@ public class WithdrawService extends SuperService {
     /**
      * 查询当前支付渠道可提现余额
      */
-    public com.github.microservice.net.ResultContent queryWithdrawAmount(String projectOid, String oid, PaymentType paymentType){
-        if (StringUtils.isBlank(projectOid)){
+    public com.github.microservice.net.ResultContent<Long> queryWithdrawAmount(String projectOid, String oid, PaymentType paymentType) {
+        if (StringUtils.isBlank(projectOid)) {
             projectOid = getCurrentProjectOid();
         }
 
-        if (StringUtils.isBlank(oid)){
+        if (StringUtils.isBlank(oid)) {
             oid = getCurrentOid();
         }
         return queryWithdrawAmountByPaymentType(projectOid, oid, paymentType);
@@ -132,19 +132,19 @@ public class WithdrawService extends SuperService {
     @SneakyThrows
     private com.github.microservice.net.ResultContent<Long> queryWithdrawAmountByPaymentType(String projectOid, String oid, PaymentType paymentType) {
 
-        if (paymentType.equals(PaymentType.UnionFrictionlessPay)){
+        if (paymentType.equals(PaymentType.UnionFrictionlessPay)) {
             String orgAccount = orgPayAccountService.queryOgPayAccount(oid, paymentType);
             String projectAccount = orgPayAccountService.queryOgPayAccount(projectOid, paymentType);
 
             ResultContent<AccountModel> accountModelResultContent = payProductAccountService.get(orgAccount);
 
-            if (!accountModelResultContent.getState().equals(ResultState.Success)){
+            if (!accountModelResultContent.getState().equals(ResultState.Success)) {
                 return com.github.microservice.net.ResultContent.buildFail(accountModelResultContent.getMsg());
             }
 
-            ChinaumsSenselessConf conf = (ChinaumsSenselessConf)accountModelResultContent.getContent().getConf();
+            ChinaumsSenselessConf conf = (ChinaumsSenselessConf) accountModelResultContent.getContent().getConf();
             String withdrawMchId = conf.getWithdrawMchId();
-            if (StringUtils.isEmpty(withdrawMchId)){
+            if (StringUtils.isEmpty(withdrawMchId)) {
                 return com.github.microservice.net.ResultContent.buildFail("未配置提现商户号");
             }
 
@@ -152,12 +152,12 @@ public class WithdrawService extends SuperService {
             parameter.setAccountName(projectAccount);
             parameter.setMeta(Map.of("mchntNo", withdrawMchId));
             ResultContent<Object> resultContent = senselessPayService.withdrawAmountQuery(parameter);
-            if (!resultContent.getState().equals(ResultState.Success)){
+            if (!resultContent.getState().equals(ResultState.Success)) {
                 return com.github.microservice.net.ResultContent.buildFail(resultContent.getMsg());
             }
             String data = JsonUtil.toJson(resultContent.getContent());
             Map map = JsonUtil.toObject(data, Map.class);
-            if (!map.get("respCode").equals("000000")){
+            if (!map.get("respCode").equals("000000")) {
                 return com.github.microservice.net.ResultContent.buildFail((String) map.get("respDesc"));
             }
             return com.github.microservice.net.ResultContent.buildContent(Long.parseLong((String) map.get("tzWithdrawAmt")));
@@ -168,7 +168,7 @@ public class WithdrawService extends SuperService {
         queryTransactionLogModel.setFilter(Map.of("meta.paymentType", paymentType));
         queryTransactionLogModel.setGeneralLedgerId(new String[]{settleAccount.getLedgerId()});
         ResultContent<TransactionLogAggregateRetModel> aggregateRetModelResultContent = transactionLogService.aggregateAmount(queryTransactionLogModel);
-        if (!aggregateRetModelResultContent.getState().equals(ResultState.Success)){
+        if (!aggregateRetModelResultContent.getState().equals(ResultState.Success)) {
             return com.github.microservice.net.ResultContent.buildFail(aggregateRetModelResultContent.getMsg());
         }
         long amount = aggregateRetModelResultContent.getContent().getStatistics().getCreditCount() + aggregateRetModelResultContent.getContent().getStatistics().getDebitCount();
@@ -178,44 +178,44 @@ public class WithdrawService extends SuperService {
     /**
      * 发起提现
      */
-    public Object withdrawApply(WithdrawParam param){
+    public Object withdrawApply(WithdrawParam param) {
         String projectOid = param.getProjectOid();
         String oid = param.getOid();
         String userId = param.getUserId();
         PaymentType paymentType = param.getPaymentType();
         BigDecimal amount = param.getAmount();
 
-        if (StringUtils.isBlank(projectOid)){
+        if (StringUtils.isBlank(projectOid)) {
             projectOid = getCurrentProjectOid();
         }
 
-        if (StringUtils.isBlank(oid)){
+        if (StringUtils.isBlank(oid)) {
             oid = getCurrentOid();
         }
 
-        if (StringUtils.isBlank(userId)){
+        if (StringUtils.isBlank(userId)) {
             userId = getCurrentUserId();
         }
 
         List<UserAccount> userAccounts = userAccountService.getUserAccounts(List.of(userId));
-        if (userAccounts==null || userAccounts.isEmpty()){
+        if (userAccounts == null || userAccounts.isEmpty()) {
             return com.github.microservice.net.ResultContent.buildFail("用户信息不存在");
         }
 
         //校验提现金额是否大约可以提现金额
         com.github.microservice.net.ResultContent<Long> resultContent = queryWithdrawAmountByPaymentType(projectOid, oid, paymentType);
 
-        if (!resultContent.getState().equals(com.github.microservice.net.ResultState.Success)){
+        if (!resultContent.getState().equals(com.github.microservice.net.ResultState.Success)) {
             return com.github.microservice.net.ResultContent.buildFail(resultContent.getMsg());
         }
         Long waitAmount = resultContent.getContent();
-        if (amount.compareTo(new BigDecimal(waitAmount))>0){
+        if (amount.compareTo(new BigDecimal(waitAmount)) > 0) {
             return com.github.microservice.net.ResultContent.buildFail("大于可提现金额");
         }
         //获取支付配置 为线上或者线下
         ProjectMainPaySetting projectMainPaySetting = projectMainPaySettingService.getProjectMainPaySetting(projectOid, paymentType);
         OrgPayConfigModel orgPayConfig = projectPaySettingService.getOrgPayConfig(projectOid, oid, paymentType);
-        if (null == orgPayConfig || null == projectMainPaySetting){
+        if (null == orgPayConfig || null == projectMainPaySetting) {
             return com.github.microservice.net.ResultContent.buildFail("支付产品未配置完成");
         }
         //支付中心划账:机构-已结算子账户- 机构-已冻结金额+
@@ -243,7 +243,7 @@ public class WithdrawService extends SuperService {
         destinationTransaction.setMeta(Map.of("paymentType", paymentType, "paymentChannelType", paymentType.getChannelType(), "description", "提现冻结"));
         transferModel.setDestinations(new TransferTransactionsModel.GeneralLedgerTransaction[]{destinationTransaction});
         ResultContent<List<TransactionLogModel>> transfer = transactionLogService.transfer(transferModel);
-        if (!transfer.getState().equals(ResultState.Success)){
+        if (!transfer.getState().equals(ResultState.Success)) {
             return com.github.microservice.net.ResultContent.buildFail(transfer.getMsg());
         }
         //创建流程
@@ -269,24 +269,33 @@ public class WithdrawService extends SuperService {
      * 审核
      */
     @SneakyThrows
-    public com.github.microservice.net.ResultContent withdraw(ProcessWithdrawParam param){
+    public com.github.microservice.net.ResultContent withdraw(ProcessWithdrawParam param) {
         String userId = param.getUserId();
-        if (StringUtils.isBlank(userId)){
+        if (StringUtils.isBlank(userId)) {
             userId = getCurrentUserId();
         }
+        String projectOid = getCurrentProjectOid();
+        if (StringUtils.isBlank(projectOid)) {
+            return com.github.microservice.net.ResultContent.buildFail("当前项目oid为空");
+        }
+        boolean isProjectManager = userOrgPermissService.userIsProjectManager(projectOid, userId);
+        if (!isProjectManager) {
+            return com.github.microservice.net.ResultContent.buildFail("无操作权限");
+        }
+
         List<UserAccount> userAccounts = userAccountService.getUserAccounts(List.of(userId));
-        if (userAccounts==null || userAccounts.isEmpty()){
+        if (userAccounts == null || userAccounts.isEmpty()) {
             return com.github.microservice.net.ResultContent.buildFail("用户信息不存在");
         }
         //TODO 判断权限?
 
         //获取提现订单数据
         WithdrawOrder withdrawOrder = withdrawOrderDao.findTop1ById(param.getId());
-        if (withdrawOrder == null){
+        if (withdrawOrder == null) {
             return com.github.microservice.net.ResultContent.buildFail("数据不存在");
         }
         //判断状态是否为待审核
-        if (!withdrawOrder.getAuditStatus().equals(AuditStatus.Wait)){
+        if (!withdrawOrder.getAuditStatus().equals(AuditStatus.Wait)) {
             return com.github.microservice.net.ResultContent.buildFail("只能操作处理中的订单");
         }
 
@@ -298,24 +307,24 @@ public class WithdrawService extends SuperService {
         withdrawOrder.setAttachFile(param.getAttachFile());
 
         //TODO 审批通过, 判断当前可提现余额是否大于提现订单金额
-        if (param.getStatus().equals(AuditStatus.Success)){//审批通过
+        if (param.getStatus().equals(AuditStatus.Success)) {//审批通过
             withdrawOrder.setAuditStatus(AuditStatus.Success);
             withdrawOrder.setSort(AuditStatus.Success.getSort());
             //判断是否线上提现,调用支付渠道对应的提现接口
             if (withdrawOrder.getWithdrawMethodType().equals(WithdrawMethodType.OnLine)) {
                 return onlineWithdraw(withdrawOrder, userAccounts.get(0), settleAccount, withdrawFrozenAccount);
-            }else {
+            } else {
                 //划账,机构已冻结金额- 项目无感支付+
                 TransferTransactionsModel transferTransactionsModel = buildTransferModel(projectAccount, withdrawFrozenAccount, withdrawOrder.getOrderNo(),
                         withdrawOrder.getAmount(), TransactionType.Withdrawal,
                         Map.of("paymentType", withdrawOrder.getPaymentType(), "paymentChannelType", withdrawOrder.getPaymentType().getChannelType(), "description", "提现"));
                 ResultContent<List<TransactionLogModel>> transferResult = transactionLogService.transfer(transferTransactionsModel);
-                if (!transferResult.getState().equals(ResultState.Success)){
+                if (!transferResult.getState().equals(ResultState.Success)) {
                     return com.github.microservice.net.ResultContent.buildFail(transferResult.getMsg());
                 }
                 withdrawOrder.setWithdrawTransactionLogs(transferResult.getContent());
             }
-        }else if (param.getStatus().equals(AuditStatus.Fail)){ //审批拒绝
+        } else if (param.getStatus().equals(AuditStatus.Fail)) { //审批拒绝
             withdrawOrder.setAuditStatus(AuditStatus.Fail);
             withdrawOrder.setSort(AuditStatus.Fail.getSort());
             //划账退回金额: 机构已冻结金额- 机构已结算 +
@@ -323,7 +332,7 @@ public class WithdrawService extends SuperService {
                     withdrawOrder.getAmount(), TransactionType.WithdrawRefund,
                     Map.of("paymentType", withdrawOrder.getPaymentType(), "paymentChannelType", withdrawOrder.getPaymentType().getChannelType(), "description", "提现退回"));
             ResultContent<List<TransactionLogModel>> transfer = transactionLogService.transfer(transferTransactionsModel);
-            if (!transfer.getState().equals(ResultState.Success)){
+            if (!transfer.getState().equals(ResultState.Success)) {
                 return com.github.microservice.net.ResultContent.buildFail("余额退回失败");
             }
             withdrawOrder.setWithdrawTransactionLogs(transfer.getContent());
@@ -339,39 +348,39 @@ public class WithdrawService extends SuperService {
 
     @SneakyThrows
     private com.github.microservice.net.ResultContent onlineWithdraw(WithdrawOrder withdrawOrder, UserAccount userAccount, PayAccount settleAccount, PayAccount withdrawFrozenAccount) {
-        switch (withdrawOrder.getPaymentType()){
-            case UnionFrictionlessPay-> {
+        switch (withdrawOrder.getPaymentType()) {
+            case UnionFrictionlessPay -> {
                 String orgAccount = orgPayAccountService.queryOgPayAccount(withdrawOrder.getOid(), PaymentType.UnionFrictionlessPay);
                 String projectPayAccount = orgPayAccountService.queryOgPayAccount(withdrawOrder.getProjectOid(), PaymentType.UnionFrictionlessPay);
 
                 ResultContent<AccountModel> accountModelResultContent = payProductAccountService.get(orgAccount);
 
-                if (!accountModelResultContent.getState().equals(ResultState.Success)){
+                if (!accountModelResultContent.getState().equals(ResultState.Success)) {
                     return com.github.microservice.net.ResultContent.buildFail(accountModelResultContent.getMsg());
                 }
 
-                ChinaumsSenselessConf conf = (ChinaumsSenselessConf)accountModelResultContent.getContent().getConf();
+                ChinaumsSenselessConf conf = (ChinaumsSenselessConf) accountModelResultContent.getContent().getConf();
                 String withdrawMchId = conf.getWithdrawMchId();
-                if (StringUtils.isEmpty(withdrawMchId)){
+                if (StringUtils.isEmpty(withdrawMchId)) {
                     return com.github.microservice.net.ResultContent.buildFail("未配置提现商户号");
                 }
 
                 PayProductParameter<Object> parameter = new PayProductParameter<>();
                 parameter.setAccountName(projectPayAccount);
-                parameter.setMeta(Map.of("mchntNo", withdrawMchId,"orderNo", withdrawOrder.getOrderNo(), "amount", withdrawOrder.getAmount().toString()));
+                parameter.setMeta(Map.of("mchntNo", withdrawMchId, "orderNo", withdrawOrder.getOrderNo(), "amount", withdrawOrder.getAmount().toString()));
                 ResultContent<Object> withdrawRet = senselessPayService.withdraw(parameter);
                 withdrawOrder.setExpand(withdrawRet.getContent());
 
                 Map bodyMap = JsonUtil.toObject(JsonUtil.toJson(withdrawRet.getContent()), Map.class);
 
-                if (!bodyMap.get("respCode").equals("000000")){//银联提现失败
+                if (!bodyMap.get("respCode").equals("000000")) {//银联提现失败
                     withdrawOrder.setWithdrawStatusDesc("银行处理失败");
                     //划账退回金额: 机构已冻结金额- 机构已结算 +
                     TransferTransactionsModel transferTransactionsModel = buildTransferModel(settleAccount, withdrawFrozenAccount, withdrawOrder.getOrderNo(),
                             withdrawOrder.getAmount(), TransactionType.WithdrawRefund,
                             Map.of("paymentType", withdrawOrder.getPaymentType(), "paymentChannelType", withdrawOrder.getPaymentType().getChannelType(), "description", "提现退回"));
                     ResultContent<List<TransactionLogModel>> transfer = transactionLogService.transfer(transferTransactionsModel);
-                    if (!transfer.getState().equals(ResultState.Success)){
+                    if (!transfer.getState().equals(ResultState.Success)) {
                         withdrawOrder.setWithdrawStatusDesc("银行处理失败,余额退回失败");
                         withdrawOrderDao.save(withdrawOrder);
                         return com.github.microservice.net.ResultContent.buildFail("银行处理失败,余额退回失败");
@@ -380,7 +389,7 @@ public class WithdrawService extends SuperService {
                     withdrawOrder.setWithdrawStatus(WithdrawStatus.Fail);
                     withdrawOrderDao.save(withdrawOrder);
                     return com.github.microservice.net.ResultContent.buildFail((String) bodyMap.get("respDesc"));
-                }else {
+                } else {
                     withdrawOrder.setWithdrawStatus(WithdrawStatus.Accepted);
                     withdrawOrder.setWithdrawStatusDesc("银行已受理");
                 }
@@ -389,7 +398,7 @@ public class WithdrawService extends SuperService {
                 withdrawOrder.setProcessTime(System.currentTimeMillis());
                 withdrawOrderDao.save(withdrawOrder);
                 WithdrawStatus w = ExecuteQueueUtil.execute(1440, index -> {
-                    return Map.of(1, 1000L, 2, 3000L, 3, 5000L, 4, 5000L, 5, 5000L).getOrDefault(index, 60*1000L);
+                    return Map.of(1, 1000L, 2, 3000L, 3, 5000L, 4, 5000L, 5, 5000L).getOrDefault(index, 60 * 1000L);
                 }, data -> {
                     var result = new ExecuteQueueUtil.Result<WithdrawStatus>();
                     com.github.microservice.net.ResultContent<WithdrawStatus> resultContent = withdrawQuery(withdrawOrder.getId());
@@ -404,7 +413,7 @@ public class WithdrawService extends SuperService {
                     }
                     result.setData(withdrawStatus);
                     long time = System.currentTimeMillis() - data.getStartTime();
-                    if (time>3000L){
+                    if (time > 3000L) {
                         result.setAsync(true);
                         return result;
                     }
@@ -416,7 +425,7 @@ public class WithdrawService extends SuperService {
         return com.github.microservice.net.ResultContent.buildFail("该支付产品不支持线上提现方式");
     }
 
-    private TransferTransactionsModel buildTransferModel(PayAccount credit, PayAccount debit, String orderNo, BigDecimal amount, TransactionType type, Map<String, Object> meta){
+    private TransferTransactionsModel buildTransferModel(PayAccount credit, PayAccount debit, String orderNo, BigDecimal amount, TransactionType type, Map<String, Object> meta) {
         TransferTransactionsModel transferModel = new TransferTransactionsModel();
         //构建出账账户
         TransferTransactionsModel.GeneralLedgerTransaction sourceTransaction = new TransferTransactionsModel.GeneralLedgerTransaction();
@@ -445,17 +454,17 @@ public class WithdrawService extends SuperService {
     public com.github.microservice.net.ResultContent page(Pageable pageable, WithdrawPageParam param) {
         String userId = getCurrentUserId();
         String projectOid = param.getProjectOid();
-        if (StringUtils.isBlank(projectOid)){
+        if (StringUtils.isBlank(projectOid)) {
             projectOid = getCurrentProjectOid();
         }
         boolean isProjectManager = userOrgPermissService.userIsProjectManager(projectOid, userId);
-        if (isProjectManager){
+        if (isProjectManager) {
             Page<WithdrawOrder> page = withdrawOrderDao.page(pageable, projectOid, null, param.getStartTime(), param.getEndTime(), param.getSearch());
             return com.github.microservice.net.ResultContent.buildContent(PageEntityUtil.concurrent2PageModel(page, this::toModel));
         }
         List<String> userManagerOids = userOrgPermissService.getUserManagerOids(projectOid, userId);
 
-        if (userManagerOids==null || userManagerOids.isEmpty()){
+        if (userManagerOids == null || userManagerOids.isEmpty()) {
             return com.github.microservice.net.ResultContent.buildContent(PageEntityUtil.buildEmptyPage(pageable));
         }
 
@@ -463,9 +472,9 @@ public class WithdrawService extends SuperService {
         return com.github.microservice.net.ResultContent.buildContent(PageEntityUtil.concurrent2PageModel(page, this::toModel));
     }
 
-    private WithdrawOrderModel toModel(WithdrawOrder withdrawOrder){
+    private WithdrawOrderModel toModel(WithdrawOrder withdrawOrder) {
         WithdrawOrderModel model = new WithdrawOrderModel();
-        if (withdrawOrder!=null){
+        if (withdrawOrder != null) {
             BeanUtils.copyProperties(withdrawOrder, model);
         }
         return model;
@@ -476,14 +485,14 @@ public class WithdrawService extends SuperService {
      * 查询提现状态
      */
     @SneakyThrows
-    public com.github.microservice.net.ResultContent<WithdrawStatus> withdrawQuery(String id){
+    public com.github.microservice.net.ResultContent<WithdrawStatus> withdrawQuery(String id) {
         //获取提现订单数据
         WithdrawOrder withdrawOrder = withdrawOrderDao.findTop1ById(id);
-        if (withdrawOrder == null){
+        if (withdrawOrder == null) {
             return com.github.microservice.net.ResultContent.buildFail("数据不存在");
         }
 
-        if (!WithdrawStatus.Accepted.equals(withdrawOrder.getWithdrawStatus())){
+        if (!WithdrawStatus.Accepted.equals(withdrawOrder.getWithdrawStatus())) {
             return com.github.microservice.net.ResultContent.buildContent(withdrawOrder.getWithdrawStatus());
         }
 
@@ -492,7 +501,7 @@ public class WithdrawService extends SuperService {
         PayAccount settleAccount = payAccountService.getOrgChildren(withdrawOrder.getProjectOid(), withdrawOrder.getOid(), PaymentChannelType.Settle);
 
 
-        switch (withdrawOrder.getPaymentType()){
+        switch (withdrawOrder.getPaymentType()) {
             case UnionFrictionlessPay -> {
 
                 String orgAccount = orgPayAccountService.queryOgPayAccount(withdrawOrder.getOid(), PaymentType.UnionFrictionlessPay);
@@ -500,39 +509,39 @@ public class WithdrawService extends SuperService {
 
                 ResultContent<AccountModel> accountModelResultContent = payProductAccountService.get(orgAccount);
 
-                if (!accountModelResultContent.getState().equals(ResultState.Success)){
+                if (!accountModelResultContent.getState().equals(ResultState.Success)) {
                     return com.github.microservice.net.ResultContent.buildFail(accountModelResultContent.getMsg());
                 }
 
-                ChinaumsSenselessConf conf = (ChinaumsSenselessConf)accountModelResultContent.getContent().getConf();
+                ChinaumsSenselessConf conf = (ChinaumsSenselessConf) accountModelResultContent.getContent().getConf();
                 String withdrawMchId = conf.getWithdrawMchId();
-                if (StringUtils.isEmpty(withdrawMchId)){
+                if (StringUtils.isEmpty(withdrawMchId)) {
                     return com.github.microservice.net.ResultContent.buildFail("未配置提现商户号");
                 }
 
                 PayProductParameter<Object> parameter = new PayProductParameter<>();
                 parameter.setAccountName(projectPayAccount);
 
-                parameter.setMeta(Map.of("mchntNo", withdrawMchId,"orderNo", withdrawOrder.getOrderNo(), "transDate", DateUtils.paresTime(withdrawOrder.getCreateTime(), DateUtils.patternyyyyMMDD)));
+                parameter.setMeta(Map.of("mchntNo", withdrawMchId, "orderNo", withdrawOrder.getOrderNo(), "transDate", DateUtils.paresTime(withdrawOrder.getCreateTime(), DateUtils.patternyyyyMMDD)));
 
                 ResultContent<Object> resultContent = senselessPayService.withdrawQuery(parameter);
-                if (!resultContent.getState().equals(ResultState.Success)){
+                if (!resultContent.getState().equals(ResultState.Success)) {
                     return com.github.microservice.net.ResultContent.buildFail("银联请求失败");
                 }
                 String json = JsonUtil.toJson(resultContent.getContent());
                 Map map = JsonUtil.toObject(json, Map.class);
 
-                if (!map.get("respCode").equals("000000")){//查询成功
+                if (!map.get("respCode").equals("000000")) {//查询成功
                     return com.github.microservice.net.ResultContent.buildFail("银联请求错误");
                 }
                 String status = (String) map.get("status");
-                if (status.equals("-1") || status.equals("0") || status.equals("1") || status.equals("2") || status.equals("6")){
+                if (status.equals("-1") || status.equals("0") || status.equals("1") || status.equals("2") || status.equals("6")) {
                     return com.github.microservice.net.ResultContent.buildContent(WithdrawStatus.Accepted);
                 }
 
-                if (status.equals("3")){
+                if (status.equals("3")) {
                     boolean update = withdrawOrderDao.updateWithdrawStatus(withdrawOrder.getId(), WithdrawStatus.Success, (String) map.get("desc"));
-                    if (!update){
+                    if (!update) {
                         return com.github.microservice.net.ResultContent.buildFail("系统繁忙请重试");
                     }
                     //TODO 处理账单
@@ -541,7 +550,7 @@ public class WithdrawService extends SuperService {
                             withdrawOrder.getAmount(), TransactionType.Withdrawal,
                             Map.of("paymentType", withdrawOrder.getPaymentType(), "paymentChannelType", withdrawOrder.getPaymentType().getChannelType(), "description", "提现"));
                     ResultContent<List<TransactionLogModel>> transferResult = transactionLogService.transfer(transferTransactionsModel);
-                    if (!transferResult.getState().equals(ResultState.Success)){
+                    if (!transferResult.getState().equals(ResultState.Success)) {
                         return com.github.microservice.net.ResultContent.buildFail(transferResult.getMsg());
                     }
                     withdrawOrder.setWithdrawTransactionLogs(transferResult.getContent());
@@ -549,9 +558,9 @@ public class WithdrawService extends SuperService {
                     return com.github.microservice.net.ResultContent.buildContent(WithdrawStatus.Success);
                 }
 
-                if (status.equals("4")){
+                if (status.equals("4")) {
                     boolean update = withdrawOrderDao.updateWithdrawStatus(withdrawOrder.getId(), WithdrawStatus.Fail, (String) map.get("desc"));
-                    if (!update){
+                    if (!update) {
                         return com.github.microservice.net.ResultContent.buildFail("系统繁忙请重试");
                     }
                     //TODO 处理账单
@@ -559,7 +568,7 @@ public class WithdrawService extends SuperService {
                             withdrawOrder.getAmount(), TransactionType.WithdrawRefund,
                             Map.of("paymentType", withdrawOrder.getPaymentType(), "paymentChannelType", withdrawOrder.getPaymentType().getChannelType(), "description", "提现退回"));
                     ResultContent<List<TransactionLogModel>> transfer = transactionLogService.transfer(transferTransactionsModel);
-                    if (!transfer.getState().equals(ResultState.Success)){
+                    if (!transfer.getState().equals(ResultState.Success)) {
                         return com.github.microservice.net.ResultContent.buildFail("余额退回失败");
                     }
                     withdrawOrder.setWithdrawTransactionLogs(transfer.getContent());
@@ -574,7 +583,7 @@ public class WithdrawService extends SuperService {
     /**
      * 查询详情
      */
-    public Object queryDetailById(String id){
+    public Object queryDetailById(String id) {
         WithdrawOrder withdrawOrder = withdrawOrderDao.findTop1ById(id);
         WithdrawOrderModel model = toModel(withdrawOrder);
 
@@ -615,14 +624,14 @@ public class WithdrawService extends SuperService {
         return model;
     }
 
-    public Object queryDetailByOrderNo(String orderNo){
+    public Object queryDetailByOrderNo(String orderNo) {
         return null;
     }
 
     /**
      * 处理银联无感支付,提现结果通知回调
      */
-    public Object handleWithdrawMessage(){
+    public Object handleWithdrawMessage() {
         return null;
     }
 }

+ 13 - 0
FullCardServer/src/main/java/com/zhongshu/card/server/core/service/paySetting/ProjectChannelConfigService.java

@@ -178,6 +178,10 @@ public class ProjectChannelConfigService extends SuperService {
         return toModel(getProjectPayChannel(paymentType));
     }
 
+    public PayChannelSimpleModel getProjectPayChannelSimpleModel(PaymentType paymentType) {
+        return toSimpleModel(getProjectPayChannel(paymentType));
+    }
+
     /**
      * 改变状态
      *
@@ -225,6 +229,15 @@ public class ProjectChannelConfigService extends SuperService {
         return model;
     }
 
+    public PayChannelSimpleModel toSimpleModel(PayChannelConfig entity) {
+        PayChannelSimpleModel model = null;
+        if (ObjectUtils.isNotEmpty(entity)) {
+            model = new PayChannelSimpleModel();
+            BeanUtils.copyProperties(entity, model);
+        }
+        return model;
+    }
+
     public PayChannelConfigAllPayModel toAllModel(PayChannelConfig entity) {
         PayChannelConfigAllPayModel model = null;
         if (ObjectUtils.isNotEmpty(entity)) {

+ 96 - 0
FullCardServer/src/main/java/com/zhongshu/card/server/core/service/paySetting/ProjectPaySettingServiceImpl.java

@@ -17,7 +17,10 @@ import com.zhongshu.card.client.model.paySetting.payConfig.FrictionlessUnionConf
 import com.zhongshu.card.client.model.paySetting.payConfig.LaKaLaCollectionConfig;
 import com.zhongshu.card.client.model.paySetting.payConfig.LaKaLaCollectionConfigParam;
 import com.zhongshu.card.client.model.paySetting.paySetting.*;
+import com.zhongshu.card.client.model.paySetting.withdrawal.OrgWithdrawalModel;
+import com.zhongshu.card.client.model.paySetting.withdrawal.OrgWithdrawalParam;
 import com.zhongshu.card.client.model.payment.PaymentTypeParam;
+import com.zhongshu.card.client.model.projectAbout.PayChannelSimpleModel;
 import com.zhongshu.card.client.type.DataState;
 import com.zhongshu.card.server.core.dao.org.OrganizationDao;
 import com.zhongshu.card.server.core.dao.projectAbout.PayChannelConfigDao;
@@ -30,8 +33,11 @@ import com.zhongshu.card.server.core.domain.paySetting.ProjectMainPaySetting;
 import com.zhongshu.card.server.core.domain.paySetting.ProjectOrgPaySettingInfo;
 import com.zhongshu.card.server.core.domain.paySetting.ProjectPaySetting;
 import com.zhongshu.card.server.core.service.base.SuperService;
+import com.zhongshu.card.server.core.service.pay.WithdrawService;
+import com.zhongshu.card.server.core.service.payment.PayCallService;
 import com.zhongshu.card.server.core.util.AesUtils;
 import com.zhongshu.card.server.core.util.BeanUtils;
+import com.zhongshu.card.server.core.util.CommonUtil;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.ObjectUtils;
 import org.apache.commons.lang3.StringUtils;
@@ -40,6 +46,7 @@ import org.springframework.data.domain.Page;
 import org.springframework.data.domain.Pageable;
 import org.springframework.data.mongodb.gridfs.GridFsTemplate;
 import org.springframework.stereotype.Service;
+import org.springframework.util.Assert;
 import org.springframework.web.multipart.MultipartFile;
 
 import java.util.ArrayList;
@@ -83,6 +90,15 @@ public class ProjectPaySettingServiceImpl extends SuperService {
     @Autowired
     private ProjectMainPaySettingDao projectMainPaySettingDao;
 
+    @Autowired
+    private PayCallService payCallService;
+
+    @Autowired
+    private ProjectMainPaySettingService projectMainPaySettingService;
+
+    @Autowired
+    private WithdrawService withdrawService;
+
     /**
      * 关联支付渠道
      *
@@ -170,6 +186,32 @@ public class ProjectPaySettingServiceImpl extends SuperService {
         return ResultContent.buildSuccess();
     }
 
+    /**
+     * 得到项目可用的支付渠道
+     *
+     * @param projectOid
+     * @return
+     */
+    public List<OrgPayShowSettingModel> getProjectEnablePay(String projectOid) {
+        List<ProjectPaySetting> list = projectPaySettingDao.findByProjectOidAndState(projectOid, DataState.Enable);
+        List<OrgPayShowSettingModel> models = new ArrayList<>();
+        if (ObjectUtils.isNotEmpty(list)) {
+            models = list.stream().map(it -> {
+                OrgPayShowSettingModel model = new OrgPayShowSettingModel();
+                model.setChannelType(payCallService.turnPaymentType(it.getChannelType()));
+
+                // 支付产品信息
+                PayChannelSimpleModel payChannelConfigModel = projectChannelConfigService.getProjectPayChannelSimpleModel(it.getChannelType());
+                model.setPayChannelConfigModel(payChannelConfigModel);
+                if (ObjectUtils.isNotEmpty(payChannelConfigModel)) {
+                    model.setPaymentType(payChannelConfigModel.getPaymentType());
+                }
+                return model;
+            }).collect(Collectors.toUnmodifiableList());
+        }
+        return models;
+    }
+
     //-----------------------------通用配置方法 start----------------------------
 
     /**
@@ -454,6 +496,60 @@ public class ProjectPaySettingServiceImpl extends SuperService {
         return model;
     }
 
+    /**
+     * 项目中 机构提现 查询数据
+     *
+     * @param param
+     * @return
+     */
+    public ResultContent<OrgWithdrawalModel> getOrgWithdrawal(OrgWithdrawalParam param) {
+        Assert.isNull(param.getPaymentType(), "paymentType不能为空");
+
+        OrgWithdrawalModel model = new OrgWithdrawalModel();
+        //1. 查询提现账号信息
+        OrgPayConfigModel orgPayConfigModel = getOrgPayConfig(param.getProjectOid(), param.getOid(), param.getPaymentType(), Boolean.TRUE);
+        model.setOrgPayConfigModel(orgPayConfigModel);
+
+        // 查询项目的提现限制
+        ProjectMainPaySetting projectMainPaySetting = projectMainPaySettingService.getProjectMainPaySetting(param.getProjectOid(), param.getPaymentType());
+        if (projectMainPaySetting != null) {
+            model.setWithdrawType(projectMainPaySetting.getWithdrawType());
+            model.setWithdrawMethodType(projectMainPaySetting.getWithdrawMethodType());
+            model.setMaxWithdraw(projectMainPaySetting.getMaxWithdraw());
+            model.setMinWithdraw(projectMainPaySetting.getMinWithdraw());
+        }
+        // 查询提现余额
+        com.github.microservice.net.ResultContent<Long> content = withdrawService.queryWithdrawAmount(param.getProjectOid(), param.getOid(), param.getPaymentType());
+        if (content.getState() == com.github.microservice.net.ResultState.Success) {
+            Long number = content.getContent();
+            if (number != null) {
+                model.setBalance(number);
+                model.setWithdrawAmount(CommonUtil.turnLongMoney2Big(number));
+            }
+        }
+
+        return ResultContent.buildSuccess(model);
+    }
+
+    /**
+     * 查找结构在项目的支付配置参数
+     *
+     * @param projectOid
+     * @param oid
+     * @param paymentType
+     * @param isMain
+     * @return
+     */
+    public OrgPayConfigModel getOrgPayConfig(String projectOid, String oid, PaymentType paymentType, Boolean isMain) {
+        OrgPayConfigModel model = null;
+        ProjectOrgPaySettingInfo temp = projectPaySettingInfoDao.findTopByBelongOigAndProjectOidAndChannelTypeAndIsDefault(oid, projectOid, paymentType, isMain);
+        if (ObjectUtils.isNotEmpty(temp)) {
+            model = new OrgPayConfigModel();
+            BeanUtils.copyProperties(temp, model);
+        }
+        return model;
+    }
+
     public ResultContent initChangeDefault(String id, String belongOig, String projectOid, PaymentType paymentType) {
 //        List<ProjectOrgPaySettingInfo> list = projectPaySettingInfoDao.findByBelongOigAndProjectOidAndChannelType(belongOig, projectOid, paymentType);
 //        if (ObjectUtils.isNotEmpty(list)) {

+ 186 - 0
FullCardServer/src/main/java/com/zhongshu/card/server/core/service/quest/QuestService.java

@@ -0,0 +1,186 @@
+package com.zhongshu.card.server.core.service.quest;
+
+import com.github.microservice.components.data.base.util.PageEntityUtil;
+import com.github.microservice.net.ResultContent;
+import com.zhongshu.card.client.model.quest.*;
+import com.zhongshu.card.client.utils.DateUtils;
+import com.zhongshu.card.server.core.dao.quest.QuestInfoDao;
+import com.zhongshu.card.server.core.domain.quest.QuestInfo;
+import com.zhongshu.card.server.core.util.BeanUtils;
+import com.zhongshu.card.server.core.util.ExcelUtils;
+import com.zhongshu.card.server.core.util.excel.CommonExeclParam;
+import com.zhongshu.card.server.core.util.excel.CommonExeclTd;
+import jakarta.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletResponse;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.ObjectUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.data.domain.Page;
+import org.springframework.data.domain.PageRequest;
+import org.springframework.data.domain.Pageable;
+import org.springframework.stereotype.Service;
+import org.springframework.util.Assert;
+
+import java.util.*;
+import java.util.stream.Collectors;
+
+/**
+ * @author TRX
+ * @date 2024/11/29
+ */
+@Slf4j
+@Service
+public class QuestService {
+
+    @Value("${quest.psd}")
+    public String psd = "";
+
+    @Autowired
+    private QuestInfoDao questInfoDao;
+
+    public ResultContent saveInfo(QuestInfoParam param) {
+        if (StringUtils.isNotEmpty(param.getUuid())) {
+            QuestInfo temp = questInfoDao.findTopByUuid(param.getUuid());
+            if (ObjectUtils.isNotEmpty(temp)) {
+                return ResultContent.buildFail("不能重复提交哦");
+            }
+        }
+        QuestInfo entity = new QuestInfo();
+        BeanUtils.copyProperties(param, entity);
+        questInfoDao.save(entity);
+        return ResultContent.buildSuccess();
+    }
+
+    public ResultContent updateInfo(QuestInfoUpdateParam param) {
+        QuestInfo entity = questInfoDao.findTopById(param.getId());
+        if (ObjectUtils.isEmpty(entity)) {
+            return ResultContent.buildFail("数据不存在");
+        }
+        if (StringUtils.isEmpty(param.getPsd())) {
+            return ResultContent.buildFail("操作密码为空");
+        }
+        if (!param.getPsd().equals(psd)) {
+            return ResultContent.buildFail("密码错误");
+        }
+
+        BeanUtils.copyProperties(param, entity);
+        questInfoDao.save(entity);
+        return ResultContent.buildSuccess();
+    }
+
+    public ResultContent<Page<QuestInfoModel>> page(QuestInfoSearch param, Pageable pageable) {
+        if (StringUtils.isEmpty(param.getPsd())) {
+            return ResultContent.buildFail("操作密码为空");
+        }
+        if (!param.getPsd().equals(psd)) {
+            return ResultContent.buildFail("密码错误");
+        }
+        List<Long> times = param.getTimes();
+        if (ObjectUtils.isNotEmpty(times) && times.size() == 2) {
+            Long startTime = times.get(0);
+            startTime = DateUtils.getDayStartTime(startTime);
+            Long endTime = times.get(1);
+            endTime = DateUtils.getDayEndTime(endTime);
+            param.setStartTime(startTime);
+            param.setEndTime(endTime);
+        }
+        Page<QuestInfo> page = questInfoDao.page(pageable, param);
+        return ResultContent.buildSuccess(PageEntityUtil.concurrent2PageModel(page, this::toModel));
+    }
+
+    public ResultContent deleteById(PsdParam param) {
+        Assert.hasText(param.getPsd(), "psd不能为空");
+        if (!param.getPsd().equals(psd)) {
+            return ResultContent.buildFail("密码错误");
+        }
+        QuestInfo entity = questInfoDao.findTopById(param.getId());
+        if (ObjectUtils.isEmpty(entity)) {
+            return ResultContent.buildFail("数据不存在");
+        }
+        questInfoDao.delete(entity);
+        return ResultContent.buildSuccess();
+    }
+
+    public void exportData(HttpServletRequest request, HttpServletResponse response, QuestInfoSearch param) throws Exception {
+        Assert.hasText(param.getPsd(), "psd不能为空");
+        if (!param.getPsd().equals(psd)) {
+            throw new Exception("密码错误");
+        }
+        Pageable pageable = PageRequest.of(0, Integer.MAX_VALUE);
+        Page<QuestInfo> page = questInfoDao.page(pageable, param);
+        List<Map<String, Object>> maps = new ArrayList<>();
+
+        HashMap<String, String> titleMap = new HashMap<>();
+        List<QuestTitleModel> titles = new ArrayList<>();
+        if (page.getContent() != null) {
+            List<QuestInfo> list = page.getContent();
+            maps = list.parallelStream().map(it -> {
+                Map<String, Object> map = new HashMap<>();
+                try {
+                    Object data = it.getData();
+                    if (data != null) {
+                        List<LinkedHashMap> linkedHashMaps = (List<LinkedHashMap>) data;
+                        for (LinkedHashMap linkedHashMap : linkedHashMaps) {
+                            String questionId = linkedHashMap.get("questionId").toString();
+                            if (!titleMap.containsKey(questionId)) {
+                                QuestTitleModel titleModel = new QuestTitleModel();
+                                titleModel.setQuestionId(questionId);
+                                String question = linkedHashMap.get("question").toString();
+                                titleModel.setQuestion(question);
+                                titles.add(titleModel);
+                                titleMap.put(questionId, question);
+                            }
+                            Object answer = linkedHashMap.get("answer");
+                            String value = "";
+                            if (answer != null) {
+                                if (answer instanceof LinkedHashMap<?, ?>) {
+                                    LinkedHashMap tempMap = (LinkedHashMap) answer;
+                                    value = tempMap.get("value").toString();
+                                    if (tempMap.containsKey("supplementary")) {
+                                        if (StringUtils.isNotEmpty(value)) {
+                                            value += "  补充: " + tempMap.get("supplementary").toString();
+                                        } else {
+                                            value += tempMap.get("supplementary").toString();
+                                        }
+                                    }
+                                } else if (answer instanceof String) {
+                                    value = answer.toString();
+                                } else {
+                                    value = answer.toString();
+                                }
+                            }
+                            map.put(questionId, value);
+                        }
+                    }
+                } catch (Exception e) {
+                    e.printStackTrace();
+                }
+                map.put("timeStr", DateUtils.paresTime(it.getCreateTime(), DateUtils.patternyyyyMis));
+                return map;
+            }).collect(Collectors.toList());
+        }
+
+        CommonExeclParam execlParam = new CommonExeclParam();
+        execlParam.setTitle(String.format("问卷调查"));
+        execlParam.setStartRow(2);
+        execlParam.setDatas(maps);
+        List<CommonExeclTd> tds = new ArrayList<>();
+        for (QuestTitleModel titleModel : titles) {
+            tds.add(CommonExeclTd.build(titleModel.getQuestion(), titleModel.getQuestionId(), 8));
+        }
+        tds.add(CommonExeclTd.build("时间", "timeStr"));
+        execlParam.setTds(tds);
+        ExcelUtils.commonExecuteExcel(request, response, execlParam);
+    }
+
+    private QuestInfoModel toModel(QuestInfo entity) {
+        QuestInfoModel model = new QuestInfoModel();
+        if (ObjectUtils.isNotEmpty(entity)) {
+            BeanUtils.copyProperties(entity, model);
+        }
+        return model;
+    }
+
+}

+ 1 - 1
FullCardServer/src/main/java/com/zhongshu/card/server/core/service/user/UserAccountServiceImpl.java

@@ -164,7 +164,7 @@ public class UserAccountServiceImpl extends SuperService implements UserAccountS
             userCountDao.save(userAccount);
         } else {
             // 编辑
-            BeanUtils.copyPropertiesWithoutNull(param, userAccount);
+             BeanUtils.copyPropertiesWithoutNull(param, userAccount);
             String realName = param.getRealName();
             if (StringUtils.isEmpty(realName)) {
                 realName = param.getName();

+ 13 - 0
FullCardServer/src/main/java/com/zhongshu/card/server/core/util/CommonUtil.java

@@ -186,6 +186,19 @@ public class CommonUtil {
         return str;
     }
 
+    public static BigDecimal turnLongMoney2Big(Long amount) {
+        if (amount == null) {
+            return BigDecimal.ZERO;
+        }
+        BigDecimal str = BigDecimal.ZERO;
+        try {
+            str = BigDecimal.valueOf(amount).divide(new BigDecimal(100), 2, RoundingMode.HALF_UP);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return str;
+    }
+
     /**
      * 2个Long是否相等
      *

+ 4 - 2
FullCardServer/src/main/java/com/zhongshu/card/server/core/util/ExcelUtils.java

@@ -302,8 +302,10 @@ public class ExcelUtils {
             }
             row.setHeight((short) 600);
             ExcelUtils.getCellByRow(row, 0, cellStyleTop, downFileName);
-            CellRangeAddress region = new CellRangeAddress(0, 0, 0, tds.size() - 1);
-            newSheet.addMergedRegion(region);
+            if (ObjectUtils.isNotEmpty(tds) && tds.size() > 1) {
+                CellRangeAddress region = new CellRangeAddress(0, 0, 0, tds.size() - 1);
+                newSheet.addMergedRegion(region);
+            }
         }
 
         XSSFCellStyle cellStyle = wb.createCellStyle();