|
|
@@ -4,6 +4,7 @@ import com.github.microservice.net.ResultContent;
|
|
|
import com.github.microservice.types.payment.PaymentChannelType;
|
|
|
import com.github.microservice.types.payment.PaymentType;
|
|
|
import com.zhongshu.card.client.model.paySetting.payConfig.LaKaLaCollectionConf;
|
|
|
+import com.zhongshu.card.client.model.paySetting.paySetting.UnionFrictionlessSettingModel;
|
|
|
import com.zhongshu.card.client.model.paySetting.paySetting.UnionFrictionlessSettingParam;
|
|
|
import com.zhongshu.card.server.core.dao.org.OrganizationDao;
|
|
|
import com.zhongshu.card.server.core.dao.projectAbout.UnionFrictionlessSettingDao;
|
|
|
@@ -19,6 +20,10 @@ import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
+import java.util.ArrayList;
|
|
|
+import java.util.List;
|
|
|
+import java.util.stream.Collectors;
|
|
|
+
|
|
|
/**
|
|
|
* 项目的无感支付设置
|
|
|
*
|
|
|
@@ -53,7 +58,8 @@ public class UnionFrictionlessSettingService extends SuperService {
|
|
|
if (StringUtils.isEmpty(projectOid)) {
|
|
|
return ResultContent.buildFail(String.format("projectOid不能为空"));
|
|
|
}
|
|
|
- PayChannelConfig payChannelConfig = projectChannelConfigService.getProjectPayChannel(projectOid, PaymentChannelType.SecretFreePayment);
|
|
|
+ PayChannelConfig payChannelConfig = projectChannelConfigService
|
|
|
+ .getProjectPayChannel(projectOid, PaymentChannelType.SecretFreePayment);
|
|
|
if (ObjectUtils.isEmpty(payChannelConfig)) {
|
|
|
return ResultContent.buildFail(String.format("当前项目未配置%s",
|
|
|
PaymentChannelType.SecretFreePayment.getRemark()));
|
|
|
@@ -83,4 +89,41 @@ public class UnionFrictionlessSettingService extends SuperService {
|
|
|
return ResultContent.buildSuccess();
|
|
|
}
|
|
|
|
|
|
+ public ResultContent deleteInfo(String id) {
|
|
|
+ UnionFrictionlessSetting entity = unionFrictionlessSettingDao.findTopById(id);
|
|
|
+ if (ObjectUtils.isEmpty(entity)) {
|
|
|
+ return ResultContent.buildFail(String.format("数据不存在:%s", id));
|
|
|
+ }
|
|
|
+ unionFrictionlessSettingDao.delete(entity);
|
|
|
+ return ResultContent.buildSuccess();
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 得到项目所有的无感支付配置
|
|
|
+ *
|
|
|
+ * @param projectOid
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public ResultContent<List<UnionFrictionlessSettingModel>> getProjectSecretFree(String projectOid) {
|
|
|
+ List<UnionFrictionlessSettingModel> models = new ArrayList<>();
|
|
|
+ Organization projectInfo = organizationDao.findTopByOid(projectOid);
|
|
|
+ if (ObjectUtils.isNotEmpty(projectInfo)) {
|
|
|
+ List<UnionFrictionlessSetting> list = unionFrictionlessSettingDao.findByProjectInfo(projectInfo);
|
|
|
+ if (ObjectUtils.isNotEmpty(list)) {
|
|
|
+ models = list.stream().map(this::toModel).collect(Collectors.toList());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return ResultContent.buildSuccess(models);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ public UnionFrictionlessSettingModel toModel(UnionFrictionlessSetting entity) {
|
|
|
+ UnionFrictionlessSettingModel model = null;
|
|
|
+ if (ObjectUtils.isNotEmpty(entity)) {
|
|
|
+ model = new UnionFrictionlessSettingModel();
|
|
|
+ BeanUtils.copyProperties(entity, model);
|
|
|
+ }
|
|
|
+ return model;
|
|
|
+ }
|
|
|
+
|
|
|
}
|