|
@@ -0,0 +1,64 @@
|
|
|
|
|
+package com.zhongshu.card.server.core.service.paySetting;
|
|
|
|
|
+
|
|
|
|
|
+import com.github.microservice.net.ResultContent;
|
|
|
|
|
+import com.github.microservice.types.payment.PaymentType;
|
|
|
|
|
+import com.zhongshu.card.client.model.paySetting.paySetting.PayOrderSettingModel;
|
|
|
|
|
+import com.zhongshu.card.client.type.DataState;
|
|
|
|
|
+import com.zhongshu.card.server.core.dao.projectAbout.PayOrderSettingDao;
|
|
|
|
|
+import com.zhongshu.card.server.core.dao.projectAbout.ProjectPaySettingDao;
|
|
|
|
|
+import com.zhongshu.card.server.core.domain.paySetting.ProjectPaySetting;
|
|
|
|
|
+import com.zhongshu.card.server.core.service.base.SuperService;
|
|
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
+import org.apache.commons.lang3.ObjectUtils;
|
|
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
+import org.springframework.stereotype.Service;
|
|
|
|
|
+
|
|
|
|
|
+import java.util.ArrayList;
|
|
|
|
|
+import java.util.List;
|
|
|
|
|
+
|
|
|
|
|
+/**
|
|
|
|
|
+ * @author TRX
|
|
|
|
|
+ * @date 2024/11/12
|
|
|
|
|
+ */
|
|
|
|
|
+@Slf4j
|
|
|
|
|
+@Service
|
|
|
|
|
+public class PayOrderSettingService extends SuperService {
|
|
|
|
|
+
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private PayOrderSettingDao payOrderSettingDao;
|
|
|
|
|
+
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private ProjectPaySettingDao projectPaySettingDao;
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 得到用户的支付服务
|
|
|
|
|
+ *
|
|
|
|
|
+ * @return
|
|
|
|
|
+ */
|
|
|
|
|
+ public ResultContent<List<PayOrderSettingModel>> getUserPayOrderSetting() {
|
|
|
|
|
+ String userId = getCurrentUserId();
|
|
|
|
|
+ String projectOid = getCurrentProjectOid();
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ return ResultContent.buildSuccess();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public List<PaymentType> getProjectPayment(String projectOid) {
|
|
|
|
|
+ List<PaymentType> paymentTypes = new ArrayList<PaymentType>();
|
|
|
|
|
+ List<ProjectPaySetting> projectPaySettings = projectPaySettingDao.findByProjectOid(projectOid);
|
|
|
|
|
+ if (ObjectUtils.isNotEmpty(projectPaySettings)) {
|
|
|
|
|
+ for (ProjectPaySetting projectPaySetting : projectPaySettings) {
|
|
|
|
|
+ if (projectPaySetting.getState() != DataState.Enable) {
|
|
|
|
|
+ continue;
|
|
|
|
|
+ }
|
|
|
|
|
+ PaymentType channelType = projectPaySetting.getChannelType();
|
|
|
|
|
+// if (channelType == PaymentType.WeChat) {
|
|
|
|
|
+// channelType = PaymentType.UserWallet;
|
|
|
|
|
+// }
|
|
|
|
|
+ paymentTypes.add(channelType);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ return paymentTypes;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+}
|