2024-09-16 半流程

pull/379/head
zhp 1 year ago
parent 4c8957660a
commit 8612fb5c39

@ -0,0 +1,34 @@
package com.ruoyi.system.api;
import com.ruoyi.common.core.constant.SecurityConstants;
import com.ruoyi.common.core.constant.ServiceNameConstants;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.domain.http.Merchant;
import com.ruoyi.system.api.factory.RemoteCustomerApplyLogFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestHeader;
import java.util.List;
/**
*
*
* @author ruoyi
*/
@FeignClient(contextId = "remoteCustomerApplyLogService", value = ServiceNameConstants.SYSTEM_SERVICE, fallbackFactory = RemoteCustomerApplyLogFallbackFactory.class)
public interface RemoteCustomerApplyLogService
{
/**
*
*
*
* @param merchantId
* @param source
* @return
*/
@GetMapping("/log/sum")
public R<Integer> sum(@PathVariable("merchantId") Long merchantId,@RequestHeader(SecurityConstants.FROM_SOURCE) String source);
}

@ -0,0 +1,33 @@
package com.ruoyi.system.api;
import com.ruoyi.common.core.constant.SecurityConstants;
import com.ruoyi.common.core.constant.ServiceNameConstants;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.domain.http.Merchant;
import com.ruoyi.system.api.domain.SysUser;
import com.ruoyi.system.api.factory.RemoteMerChantFallbackFactory;
import com.ruoyi.system.api.factory.RemoteUserFallbackFactory;
import com.ruoyi.system.api.model.LoginUser;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
*
*
* @author ruoyi
*/
@FeignClient(contextId = "remoteMerchantService", value = ServiceNameConstants.SYSTEM_SERVICE, fallbackFactory = RemoteMerChantFallbackFactory.class)
public interface RemoteMerchantService
{
/**
*
*
* @param source
* @return
*/
@GetMapping("/merchant/merchantList")
public R<List<Merchant>> merchantList(@RequestHeader(SecurityConstants.FROM_SOURCE) String source);
}

@ -0,0 +1,41 @@
package com.ruoyi.system.api.factory;
import com.ruoyi.common.core.constant.SecurityConstants;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.domain.http.Merchant;
import com.ruoyi.system.api.RemoteCustomerApplyLogService;
import com.ruoyi.system.api.RemoteMerchantService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestHeader;
import java.util.List;
/**
*
*
* @author ruoyi
*/
@Component
@Slf4j
public class RemoteCustomerApplyLogFallbackFactory implements FallbackFactory<RemoteCustomerApplyLogService>
{
@Override
public RemoteCustomerApplyLogService create(Throwable throwable)
{
log.error("用户服务调用失败:{}", throwable.getMessage());
return new RemoteCustomerApplyLogService()
{
@Override
public R<Integer> sum(@PathVariable("merchantId") Long merchantId, @RequestHeader(SecurityConstants.FROM_SOURCE) String source)
{
return R.fail("获取商户已申请数失败:" + throwable.getMessage());
}
};
}
}

@ -2,7 +2,6 @@ package com.ruoyi.system.api.factory;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.domain.http.Customer;
import com.ruoyi.common.core.web.domain.AjaxResult;
import com.ruoyi.system.api.RemoteCustomerService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.openfeign.FallbackFactory;

@ -0,0 +1,37 @@
package com.ruoyi.system.api.factory;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.domain.http.Merchant;
import com.ruoyi.system.api.RemoteMerchantService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;
import java.util.List;
/**
*
*
* @author ruoyi
*/
@Component
@Slf4j
public class RemoteMerChantFallbackFactory implements FallbackFactory<RemoteMerchantService>
{
@Override
public RemoteMerchantService create(Throwable throwable)
{
log.error("用户服务调用失败:{}", throwable.getMessage());
return new RemoteMerchantService()
{
@Override
public R<List<Merchant>> merchantList(String source)
{
return R.fail("获取用户失败:" + throwable.getMessage());
}
};
}
}

@ -1,3 +1,6 @@
com.ruoyi.system.api.factory.RemoteUserFallbackFactory
com.ruoyi.system.api.factory.RemoteLogFallbackFactory
com.ruoyi.system.api.factory.RemoteFileFallbackFactory
com.ruoyi.system.api.factory.RemoteCustomerFallbackFactory
com.ruoyi.system.api.factory.RemoteMerChantFallbackFactory
com.ruoyi.system.api.factory.RemoteCustomerApplyLogFallbackFactory

@ -1,4 +1,4 @@
package com.ruoyi.system.domain;
package com.ruoyi.common.core.domain.http;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

@ -22,6 +22,10 @@ public class Customer extends BaseEntity
/** $column.columnComment */
private Long id;
/**渠道ID**/
@Excel(name = "渠道ID")
private Long channelId;
/** 年龄 */
@Excel(name = "年龄")
private Integer age;

@ -0,0 +1,203 @@
package com.ruoyi.common.core.domain.http;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.core.annotation.Excel;
import com.ruoyi.common.core.web.domain.BaseEntity;
/**
* merchant
*
* @author ruoyi
* @date 2024-09-15
*/
@Data
public class Merchant extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** $column.columnComment */
private Long id;
/** 商户类型 1H5 2连登 3半流程 4全流程 */
@Excel(name = "商户类型 1H5 2连登 3半流程 4全流程")
private Long merchantType;
/** 商户名称 */
@Excel(name = "商户名称")
private String merchantName;
/** 商户描述 */
@Excel(name = "商户描述")
private String merchantDescribe;
/** 商户主体 */
@Excel(name = "商户主体")
private String merchantCompany;
/** logo文件地址 */
@Excel(name = "logo文件地址")
private String logo;
/** 是否上下架 */
@Excel(name = "是否上下架")
private Integer status;
/** 定量数 */
@Excel(name = "定量数")
private Integer limitNum;
/** 是否定量 0否 1是 */
@Excel(name = "是否定量 0否 1是")
private Integer limitType;
/** 渠道限制类型 0不限 1准入 2禁入 */
@Excel(name = "渠道限制类型 0不限 1准入 2禁入")
private Integer channelLimitType;
/** 渠道限制ID */
@Excel(name = "渠道限制ID")
private String channelLimit;
/** 渠道限制类型 0不限 1满足其一 2满足全部 */
@Excel(name = "渠道限制类型 0不限 1满足其一 2满足全部")
private Integer customerInfoFilterType;
/** 年龄限制开始 */
@Excel(name = "年龄限制开始")
private Integer ageLimitStart;
/** 年龄限制结束 */
@Excel(name = "年龄限制结束")
private Integer ageLimitEnd;
/** 手机号禁入号段英文逗号分隔 */
@Excel(name = "手机号禁入号段英文逗号分隔")
private String phoneLimit;
/** 无社保 */
@Excel(name = "无社保")
private Boolean socialSecurityNo;
/** 社保未满6个月 */
@Excel(name = "社保未满6个月")
private Boolean socialSecurityLow;
/** 社保6个月以上 */
@Excel(name = "社保6个月以上")
private Boolean socialSecurityHigh;
/** 无车 */
@Excel(name = "无车")
private Boolean carNo;
/** 有车 */
@Excel(name = "有车")
private Boolean carHave;
/** 保单缴纳不满一年 */
@Excel(name = "保单缴纳不满一年")
private Boolean guaranteeSlipLow;
/** 保单缴纳一年以上 */
@Excel(name = "保单缴纳一年以上")
private Boolean guaranteeSlipCentre;
/** 保单缴纳2年以上 */
@Excel(name = "保单缴纳2年以上")
private Boolean guaranteeSlipHigh;
/** 初中 */
@Excel(name = "初中")
private Boolean educationMiddle;
/** 高中 */
@Excel(name = "高中")
private Boolean educationHighSchool;
/** 中专 */
@Excel(name = "中专")
private Boolean educationPolytechnic;
/** 大专 */
@Excel(name = "大专")
private Boolean educationJuniorCollege;
/** 本科 */
@Excel(name = "本科")
private Boolean educationUndergraduateCourse;
/** 研究生及以上 */
@Excel(name = "研究生及以上")
private Boolean educationPostgraduate;
/** 公积金未满6个月 */
@Excel(name = "公积金未满6个月")
private Boolean accumulationFundLow;
/** 公积金满6个月以上 */
@Excel(name = "公积金满6个月以上")
private Boolean accumulationFundHigh;
/** 本地无房 */
@Excel(name = "本地无房")
private Boolean hourseNo;
/** 本地全款房 */
@Excel(name = "本地全款房")
private Boolean hourseFullPayment;
/** 本地按揭 */
@Excel(name = "本地按揭")
private Boolean hourseMortgaging;
/** 上班族 */
@Excel(name = "上班族")
private Boolean officeWorker;
/** 公务员 */
@Excel(name = "公务员")
private Boolean civilServant;
/** 私营业主 */
@Excel(name = "私营业主")
private Boolean privatePropertyOwners;
/** 个体户 */
@Excel(name = "个体户")
private Boolean selfEmployedPerson;
/** 其他职业 */
@Excel(name = "其他职业")
private Boolean otherOccupations;
/** 花呗5000以下 */
@Excel(name = "花呗5000以下")
private Boolean huaBeiLow;
/** 花呗5000-10000 */
@Excel(name = "花呗5000-10000")
private Boolean huaBeiMiddle;
/** 花呗10000以上 */
@Excel(name = "花呗10000以上")
private Boolean huaBeiHigh;
/** 白条5000以下 */
@Excel(name = "白条5000以下")
private Boolean baiTiaoLow;
/** 白条5000-10000 */
@Excel(name = "白条5000-10000")
private Boolean baiTiaoMiddle;
/** 白条10000以上 */
@Excel(name = "白条10000以上")
private Boolean baiTiaoHigh;
/** 芝麻分 */
@Excel(name = "芝麻分")
private Integer zhiMa;
}

@ -0,0 +1,483 @@
package com.ruoyi.common.core.utils;
import java.text.SimpleDateFormat;
import java.time.*;
import java.time.format.DateTimeFormatter;
import java.time.temporal.ChronoUnit;
import java.time.temporal.TemporalAdjusters;
import java.util.*;
/**
* @program: JieYiHua-Cloud
* @description:
* @author: LiYu
* @create: 2021-08-04 15:45
**/
public class LocalDateTimeUtils {
/**
*
*
* @param localDate
* @return
*/
public static LocalDateTime getMondayForThisWeek(LocalDate localDate) {
LocalDateTime monday = LocalDateTime.of(localDate, LocalTime.MIN).with(DayOfWeek.MONDAY);
return monday;
}
/**
*
*
* @param localDate
* @return
*/
public static LocalDateTime getSundayForThisWeek(LocalDate localDate) {
LocalDateTime sunday = LocalDateTime.of(localDate, LocalTime.MIN).with(DayOfWeek.SUNDAY);
return sunday;
}
/**
*
*
* @param localDate
* @return
*/
public static LocalDateTime getMondayForNextWeek(LocalDate localDate) {
LocalDateTime monday = LocalDateTime.of(localDate, LocalTime.MIN).plusWeeks(1).with(DayOfWeek.MONDAY);
return monday;
}
/**
*
*
* @param localDate
* @return
*/
public static LocalDateTime getSundayForNextWeek(LocalDate localDate) {
LocalDateTime sunday = LocalDateTime.of(localDate, LocalTime.MIN).plusWeeks(1).with(DayOfWeek.SUNDAY);
return sunday;
}
/**
* "yyyy-MM-dd HH:mm:ss"LocalDateTime
*
* @param dateStr
* @return
*/
public static LocalDateTime getLocalDateTimeFromString(String dateStr) {
LocalDateTime localDateTime = LocalDateTime.parse(dateStr, DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
return localDateTime;
}
/**
* "yyyy-MM-ddTHH:mm:ss"LocalDateTime
*
* @param dateStr
* @return
*/
public static LocalDateTime getLocalDateTimeFromString2(String dateStr) {
LocalDateTime localDateTime = LocalDateTime.parse(dateStr, DateTimeFormatter.ofPattern("yyyy-MM-dd w hh:mm:ss"));
return localDateTime;
}
/**
* LocalDateTime"yyyy-MM-dd HH:mm:ss"
*
* @param localDateTime
* @return
*/
public static String getStringFromLocalDateTime(LocalDateTime localDateTime) {
String localDateTimeStr = localDateTime.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
return localDateTimeStr;
}
/**
* LocalDateTime"yyyy-MM-dd"
*
* @param localDateTime
* @return
*/
public static String getStringFromLocalDateTime2(LocalDateTime localDateTime) {
if (localDateTime == null) { return null; }
return localDateTime.format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
}
/**
* LocalDateTime"yyyy-MM-dd HH"
*
* @param localDateTime
* @return
*/
public static String getStringFromLocalDateTime4(LocalDateTime localDateTime) {
if (localDateTime == null) { return null; }
return localDateTime.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH"));
}
/**
* LocalDateTime"yyyy-MM"
*/
public static String getStringFromLocalDateTime3(LocalDateTime localDateTime) {
if (localDateTime == null) {
return null;
}
return localDateTime.format(DateTimeFormatter.ofPattern("yyyy-MM"));
}
/**
* DateLocalDateTime
*
* @param date
* @return
*/
public static LocalDateTime getLocalDateTimeFromDate(Date date) {
LocalDateTime localDateTime = date.toInstant().atOffset(ZoneOffset.of("+8")).toLocalDateTime();
return localDateTime;
}
/**
* LocalDateTimeDate
*
* @param localDateTime
* @return
*/
public static Date getDateFromLocalDateTime(LocalDateTime localDateTime) {
Date date = Date.from(localDateTime.toInstant(ZoneOffset.of("+8")));
return date;
}
/**
* 00:00:00
*
* @param localDateTime
* @return
*/
public static LocalDateTime getLocalDateTimeForBegin(LocalDateTime localDateTime) {
LocalDateTime begin = LocalDateTime.of(localDateTime.toLocalDate(), LocalTime.MIN);
return begin;
}
/**
* 23:59:59
*
* @param localDateTime
* @return
*/
public static LocalDateTime getLocalDateTimeForEnd(LocalDateTime localDateTime) {
LocalDateTime end = LocalDateTime.of(localDateTime.toLocalDate(), LocalTime.MAX);
return end;
}
/**
* ()LocalDateTime
*
* @param timestamp
* @return
*/
public static LocalDateTime getLocalDateTimeFromTimestamp(Long timestamp) {
LocalDateTime localDateTime = LocalDateTime.ofEpochSecond(timestamp / 1000, 0, ZoneOffset.ofHours(8));
return localDateTime;
}
/**
* LocalDateTime()
*
* @param localDateTime
* @return
*/
public static Long getTimestampFromLocalDateTime(LocalDateTime localDateTime) {
Long timestamp = localDateTime.toInstant(ZoneOffset.of("+8")).toEpochMilli();
return timestamp;
}
/**
* () yyyy-MM-dd HH:mm:ss
* @param timestamp
* @return
*/
public static String getStringFromTimestamp(Long timestamp) {
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
return dateFormat.format(timestamp);
}
/**
*
*
* @return
*/
public static LocalDateTime getFirstDayOfMonth() {
return LocalDateTime.of(LocalDate.from(LocalDateTime.now().with(TemporalAdjusters.firstDayOfMonth())), LocalTime.MIN);
}
/**
*
*
* @param localDateTime
* @return
*/
public static LocalDateTime getTheBeginningOfTheMonth(LocalDateTime localDateTime) {
return LocalDateTime.of(LocalDate.from(localDateTime.with(TemporalAdjusters.firstDayOfMonth())), LocalTime.MIN);
}
/**
*
*
* @return
*/
public static LocalDateTime getLastDay() {
return LocalDateTime.of(LocalDate.from(LocalDateTime.now().with(TemporalAdjusters.lastDayOfMonth())), LocalTime.MAX);
}
public static LocalDateTime getTheEndOfTheMonth(LocalDateTime localDateTime) {
return LocalDateTime.of(LocalDate.from(localDateTime.with(TemporalAdjusters.lastDayOfMonth())), LocalTime.MAX);
}
/**
*
*
* @param startTime
* @param endTime
* @return
*/
public static Long getTimeDifference(LocalDateTime startTime, LocalDateTime endTime) {
Duration duration = Duration.between(startTime, endTime);
return duration.toMinutes() * 60;
}
/**
*
*
* @param localDateTime
* @return
*/
public static Long timeDifferenceByDay(LocalDateTime localDateTime) {
LocalDateTime now = LocalDateTime.now();
Duration duration = Duration.between(localDateTime, now);
return duration.toDays();
}
/**
*
*
* @param startingTime
* @param endTime
* @return
*/
public static Long twoDayInterval(LocalDateTime startingTime, LocalDateTime endTime) {
Duration duration = Duration.between(startingTime, endTime);
return duration.toDays();
}
/**
*
*
* @param localDateTime
* @return
*/
public static String toTheVernacular(LocalDateTime localDateTime) {
return localDateTime.getYear() + "年" + localDateTime.getMonthValue() + "月" + localDateTime.getDayOfMonth() + "日";
}
/**
*
*
* @return
*/
public static LocalDateTime getYesterdaySDate() {
return LocalDateTime.now().plusDays(1);
}
/**
*
*
* @return
*/
public static LocalDateTime getMinusDays() {
return LocalDateTime.now().minusDays(1);
}
/**
*
*
* @return
*/
public static LocalDateTime getPlusDays() {
return LocalDateTime.now().plusDays(1);
}
/**
*
*
* @return
*/
public static LocalDateTime startThisYear() {
return LocalDateTime.of(LocalDate.from(LocalDateTime.now().with(TemporalAdjusters.firstDayOfYear())), LocalTime.MIN);
}
/**
* 2019-05-06 >
*
* @param datetime
* @return
*/
public static int dateToWeek(LocalDateTime datetime) {
//获取当前时间
LocalDateTime currentDate = LocalDateTime.now();
//获取当前周
int week = currentDate.getDayOfWeek().getValue();
System.out.println("获取当前周:" + week);
return week;
}
public static void main(String[] args) {
System.out.println(twoDayInterval(LocalDateTime.now(),LocalDateTime.now()));
System.out.println(getNowBeforeHourTime(-24L));
}
/**
*
*
* @return
*/
public static LocalDateTime getTodayStartTime() {
return getLocalDateTimeForBegin(LocalDateTime.now());
}
/**
*
*
* @return
*/
public static LocalDateTime getTodayEndTime() {
return getLocalDateTimeForEnd(LocalDateTime.now());
}
/**
*
*
* @param startingTime
* @param endTime
* @return
*/
public static List<String> allTimeApart(String startingTime, String endTime) {
Long size = LocalDateTimeUtils.twoDayInterval(LocalDateTimeUtils.getLocalDateTimeFromString(startingTime), LocalDateTimeUtils.getLocalDateTimeFromString(endTime));
List<String> list = new ArrayList<>(Math.toIntExact(size));
LocalDateTime time = getLocalDateTimeFromString(endTime);
for (int i = 0; i <= size; i++) {
LocalDateTime localDateTime = time.minusDays(i);
list.add(getStringFromLocalDateTime2(localDateTime));
}
return list;
}
/**
* 09:00-18:00
* @param
* @return
*/
public static boolean setFirstLogTime(){
SimpleDateFormat formatter = new SimpleDateFormat("HH:mm");//获取时,分
//当前系统时间
Date data = new Date();
String dateString = formatter.format(data);
String format = "HH:mm";
try{
Date nowTime = new SimpleDateFormat(format).parse(dateString);
Date startTime = new SimpleDateFormat(format).parse("09:00");
Date endTime = new SimpleDateFormat(format).parse("18:00");
return isEffectiveDate(nowTime, startTime, endTime);
}catch (Exception e){
e.printStackTrace();
return false;
}
}
/**
* [startTime, endTime]
*
* @param nowTime
* @param startTime
* @param endTime
* @return
*/
public static boolean isEffectiveDate(Date nowTime, Date startTime, Date endTime) {
if (nowTime.getTime() == startTime.getTime() || nowTime.getTime() == endTime.getTime()) {
return true;
}
Calendar date = Calendar.getInstance();
date.setTime(nowTime);
Calendar begin = Calendar.getInstance();
begin.setTime(startTime);
Calendar end = Calendar.getInstance();
end.setTime(endTime);
if (date.after(begin) && date.before(end)) {
return true;
} else {
return false;
}
}
/**
*
* @param date yyyy-MM-dd
* @return
*/
public static boolean afterDate(LocalDateTime date){
//针对好享管家图片相反
String times = "2022-08-23";
DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-MM-dd");
//把String转为LocalDate
LocalDate localTime=LocalDate.parse(times,dtf);
//判断当前日期是否大于指定日期
return date.toLocalDate().isAfter(localTime);
}
/**
*
* @param hour
* @return
*/
public static LocalDateTime getNowBeforeHourTime(Long hour){
LocalDateTime localDateTime = LocalDateTime.now(ZoneId.systemDefault());
return localDateTime.plusHours(hour);
}
public static Long timeDifferenceByLocalDate(LocalDateTime localDateTime) {
LocalDate toLocalDate = localDateTime.toLocalDate();
LocalDate now = LocalDate.now();
long until = toLocalDate.until(now, ChronoUnit.DAYS);
return toLocalDate.until(now, ChronoUnit.DAYS);
}
/**
*
* @param localDateTime
* @return
*/
public static boolean isToday(LocalDateTime localDateTime) {
return localDateTime.toLocalDate().equals(LocalDate.now());
}
/**
*
* @param localDateTime
* @param day
* @return
*/
public static boolean isDay(LocalDateTime localDateTime,Long day) {
return localDateTime.toLocalDate().equals(LocalDate.now().plusDays(day));
}
public static long getTimeStamp(String dateTime){
LocalDateTime time = LocalDateTimeUtils.getLocalDateTimeFromString(dateTime);
return time.atZone(ZoneId.systemDefault()).toInstant().toEpochMilli();
}
}

@ -1,9 +1,456 @@
package com.ruoyi.common.core.utils.match;
import com.ruoyi.common.core.domain.http.Customer;
import com.ruoyi.common.core.domain.http.Merchant;
import lombok.extern.slf4j.Slf4j;
import java.util.Objects;
@Slf4j
public class MatchQualification {
/**
*
* @param customer
* @param merchant
* openInfoFilter 0:, 1:1, 2:
*
* @return
*/
public static Boolean doesItMatchProduct(Customer customer, Merchant merchant) {
// if (Objects.isNull(merchant)){
// return true;
// }
//
// if (Objects.isNull(merchant.getCustomerInfoFilterType()) || merchant.getCustomerInfoFilterType() == 0){
// return true;
// }
//
// //满足1个
// boolean openOne = merchant.getCustomerInfoFilterType() == 1;
// //满足所有
// boolean openAll = merchant.getCustomerInfoFilterType() == 2;
// //结果
// boolean result = false;
//
// String userInfo = customer.getId() + "-" + customer.getChannelId() + "-" + merchant.getId();
//
// //社保
// if (merchant.getSocialSecurityHigh() || merchant.getSocialSecurityNo() ||merchant.getSocialSecurityLow()) {
// if (openAll && Objects.isNull(customer.getSocialSecurity())){
// log.info("资质匹配筛选, 配置[满足所有]-社保为空, 匹配不通过, 结束匹配, 用户id-渠道id-渠道名称-产品id:{}", userInfo);
// return false;
// }
//
// Integer infoByCode = customer.getSocialSecurity();
// if (Objects.nonNull(customer.getSocialSecurity())) {
// if (merchant.getSocialSecurityNo()) {
// if (customer.getSocialSecurity()==merchant.getSocialSecurityNo())) {
// result = true;
// }
// }
//
// if (merchant.getSocialSecurityLow()) {
// if (customer.getSocialSecurity().equals(CustomerSocialSecurityType.GREAT_SOCIAL_SECURITY.getCode())) {
// result = true;
// }
// }
//
// //条件为 满足一个即可, 恰巧现在就有满足的, 则返回true通过
// if (openOne && result) {
//// log.info("资质匹配筛选, 配置[满足其一]-社保:{}, 匹配通过, 结束匹配, 用户id-渠道id-渠道名称-产品id:{}", userDetailsDTO.getSocialSecurity() + "-" + infoByCode, userInfo);
// return result;
// }
// }
//
// //条件为 满足全部, 恰巧现在这个不满足, 则返回false(不通过)
// if (openAll && !result) {
// log.info("资质匹配筛选, 配置[满足所有]-社保:{}, 匹配不通过, 结束匹配, 用户id-渠道id-渠道名称-产品id:{}", userDetailsDTO.getSocialSecurity() + "-" + infoByCode, userInfo);
// return false;
// }
// }
//
// //公积金
// if (productLimit.getSmallProvidentFund() || productLimit.getGreatProvidentFund()) {
// if (openAll && Objects.isNull(userDetailsDTO.getProvidentFund())){
// log.info("资质匹配筛选, 配置[满足所有]-公积金为空, 匹配不通过, 结束匹配, 用户id-渠道id-渠道名称-产品id:{}", userInfo);
// return false;
// }
//
// //判断结果置默认
// result = false;
// String infoByCode = CustomerProvidentFundType.getInfoByCode(userDetailsDTO.getProvidentFund());
// if (Objects.nonNull(userDetailsDTO.getProvidentFund())) {
// if (productLimit.getSmallProvidentFund()) {
// if (userDetailsDTO.getProvidentFund().equals(CustomerProvidentFundType.SMALL_PROVIDENT_FUND.getCode())) {
// result = true;
// }
// }
//
// if (productLimit.getGreatProvidentFund()) {
// if (userDetailsDTO.getProvidentFund().equals(CustomerProvidentFundType.GREAT_PROVIDENT_FUND.getCode())) {
// result = true;
// }
// }
//
// //条件为 满足一个即可, 恰巧现在就有满足的, 则返回true通过
// if (openOne && result) {
//// log.info("资质匹配筛选, 配置[满足其一]-公积金:{}, 匹配通过, 结束匹配, 用户id-渠道id-渠道名称-产品id:{}", userDetailsDTO.getProvidentFund() + "-" + infoByCode, userInfo);
// return result;
// }
// }
//
// //条件为 满足全部, 恰巧现在这个不满足, 则返回false(不通过)
// if (openAll && !result) {
//// log.info("资质匹配筛选, 配置[满足所有]-公积金:{}, 匹配不通过, 结束匹配, 用户id-渠道id-渠道名称-产品id:{}", userDetailsDTO.getProvidentFund() + "-" + infoByCode, userInfo);
// return false;
// }
// }
//
// //车产
// if (productLimit.getHavaCar()) {
// if (openAll && Objects.isNull(userDetailsDTO.getCarProduction())){
// log.info("资质匹配筛选, 配置[满足所有]-车产为空, 匹配不通过, 结束匹配, 用户id-渠道id-渠道名称-产品id:{}", userInfo);
// return false;
// }
//
// //判断结果置默认
// result = false;
// String infoByCode = CustomerCarProductionType.getInfoByCode(userDetailsDTO.getCarProduction());
// if (Objects.nonNull(userDetailsDTO.getCarProduction())) {
// if (userDetailsDTO.getCarProduction().equals(CustomerCarProductionType.HAVE_CAR.getCode())) {
// result = true;
// }
//
// //条件为 满足一个即可, 恰巧现在就有满足的, 则返回true通过
// if (openOne && result) {
// log.info("资质匹配筛选, 配置[满足其一]-车产:{}, 匹配通过, 结束匹配, 用户id-渠道id-渠道名称-产品id:{}", userDetailsDTO.getCarProduction() + "-" + infoByCode, userInfo);
// return result;
// }
// }
//
// //条件为 满足全部, 恰巧现在这个不满足, 则返回false(不通过)
// if (openAll && !result) {
// log.info("资质匹配筛选, 配置[满足所有]-车产:{}, 匹配不通过, 结束匹配, 用户id-渠道id-渠道名称-产品id:{}", userDetailsDTO.getCarProduction() + "-" + infoByCode, userInfo);
// return false;
// }
// }
//
// //房产
// if (productLimit.getHaveMortgageRoom() || productLimit.getHaveFullRoom()) {
// if (openAll && Objects.isNull(userDetailsDTO.getEstate())){
// log.info("资质匹配筛选, 配置[满足所有]-房产为空, 匹配不通过, 结束匹配, 用户id-渠道id-渠道名称-产品id:{}", userInfo);
// return false;
// }
//
// //判断结果置默认
// result = false;
// String infoByCode = CustomerEstateType.getInfoByCode(userDetailsDTO.getEstate());
// if (Objects.nonNull(userDetailsDTO.getEstate())) {
// if (productLimit.getHaveMortgageRoom()){
// if (userDetailsDTO.getEstate().equals(CustomerEstateType.HAVE_PROPERTY.getCode())){
// result = true;
// }
// }
//
// if (productLimit.getHaveFullRoom()){
// if (userDetailsDTO.getEstate().equals(CustomerEstateType.FULL_PAYMENT_FOR_HOUSING.getCode())){
// result = true;
// }
// }
//
// //条件为 满足一个即可, 恰巧现在就有满足的, 则返回true通过
// if (openOne && result) {
//// log.info("资质匹配筛选, 配置[满足其一]-房产:{}, 匹配通过, 结束匹配, 用户id-渠道id-渠道名称-产品id:{}", userDetailsDTO.getEstate() + "-" + infoByCode, userInfo);
// return result;
// }
// }
//
// //条件为 满足全部, 恰巧现在这个不满足, 则返回false(不通过)
// if (openAll && !result) {
// log.info("资质匹配筛选, 配置[满足所有]-房产:{}, 匹配不通过, 结束匹配, 用户id-渠道id-渠道名称-产品id:{}", userDetailsDTO.getEstate() + "-" + infoByCode, userInfo);
// return false;
// }
// }
//
// //保单
// if (productLimit.getPolicyLessThanOneYear() || productLimit.getPolicyPaymentForOneYear() || productLimit.getPolicyPaymentForTwoYear()) {
// if (openAll && Objects.isNull(userDetailsDTO.getPersonalInsurance())){
// log.info("资质匹配筛选, 配置[满足所有]-保单为空, 匹配不通过, 结束匹配, 用户id-渠道id-渠道名称-产品id:{}", userInfo);
// return false;
// }
//
// //判断结果置默认
// result = false;
// String infoByCode = CustomerInsurancePolicyType.getInfoByCode(userDetailsDTO.getPersonalInsurance());
// if (Objects.nonNull(userDetailsDTO.getPersonalInsurance())) {
// if (productLimit.getPolicyLessThanOneYear()) {
// if (userDetailsDTO.getPersonalInsurance().equals(CustomerInsurancePolicyType.POLICY_LESS_THAN_ONE_YEAR.getCode())) {
// result = true;
// }
// }
//
// if (productLimit.getPolicyPaymentForOneYear()) {
// if (userDetailsDTO.getPersonalInsurance().equals(CustomerInsurancePolicyType.POLICY_PAYMENT_FOR_ONE_YEAR.getCode())) {
// result = true;
// }
// }
//
// if (productLimit.getPolicyPaymentForTwoYear()) {
// if (userDetailsDTO.getPersonalInsurance().equals(CustomerInsurancePolicyType.POLICY_PAYMENT_FOR_TWO_YEAR.getCode())) {
// result = true;
// }
// }
//
// //条件为 满足一个即可, 恰巧现在就有满足的, 则返回true通过
// if (openOne && result) {
// log.info("资质匹配筛选, 配置[满足其一]-保单:{}, 匹配通过, 结束匹配, 用户id-渠道id-渠道名称-产品id:{}", userDetailsDTO.getPersonalInsurance() + "-" + infoByCode, userInfo);
// return result;
// }
// }
//
// //条件为 满足全部, 恰巧现在这个不满足, 则返回false(不通过)
// if (openAll && !result) {
// log.info("资质匹配筛选, 配置[满足所有]-保单:{}, 匹配不通过, 结束匹配, 用户id-渠道id-渠道名称-产品id:{}", userDetailsDTO.getPersonalInsurance() + "-" + infoByCode, userInfo);
// return false;
// }
// }
//
// //芝麻分
// if (Objects.nonNull(productLimit.getSesame())){
// if (openAll && Objects.isNull(userDetailsDTO.getSesame())){
// log.info("资质匹配筛选, 配置[满足所有]-芝麻分为空, 匹配不通过, 结束匹配, 用户id-渠道id-渠道名称-产品id:{}", userInfo);
// return false;
// }
//
// //判断结果置默认
// result = false;
// if (Objects.nonNull(userDetailsDTO.getSesame())) {
// if (userDetailsDTO.getSesame() >= productLimit.getSesame()){
// result = true;
// }
//
// //条件为 满足一个即可, 恰巧现在就有满足的, 则返回true通过
// if (openOne && result) {
// log.info("资质匹配筛选, 配置[满足其一]-芝麻分:{}, 匹配通过, 结束匹配, 用户id-渠道id-渠道名称-产品id:{}", userDetailsDTO.getSesame(), userInfo);
// return result;
// }
// }
//
// //条件为 满足全部, 恰巧现在这个不满足, 则返回false(不通过)
// if (openAll && !result) {
// log.info("资质匹配筛选, 配置[满足所有]-芝麻分:{}, 匹配不通过, 结束匹配, 用户id-渠道id-渠道名称-产品id:{}", userDetailsDTO.getSesame(), userInfo);
// return false;
// }
// }
//
// //职业
// if (productLimit.getOfficeWorker() ||
// productLimit.getCivilServant() ||
// productLimit.getPrivateOwners() ||
// productLimit.getSmallPrivateBusiness() ||
// productLimit.getOtherOccupations()) {
//
// if (openAll && Objects.isNull(userDetailsDTO.getProfessionalIdentity())){
// log.info("资质匹配筛选, 配置[满足所有]-职业为空, 匹配不通过, 结束匹配, 用户id-渠道id-渠道名称-产品id:{}", userInfo);
// return false;
// }
//
// //判断结果置默认
// result = false;
// String infoByCode = CustomerProfessionalIdentityType.getInfoByCode(userDetailsDTO.getProfessionalIdentity());
// if (Objects.nonNull(userDetailsDTO.getProfessionalIdentity())) {
// if (productLimit.getOfficeWorker()){
// if (userDetailsDTO.getProfessionalIdentity().equals(CustomerProfessionalIdentityType.OFFICE_WORKER.getCode())) {
// result = true;
// }
// }
//
// if (productLimit.getCivilServant()){
// if (userDetailsDTO.getProfessionalIdentity().equals(CustomerProfessionalIdentityType.CIVIL_SERVANT.getCode())) {
// result = true;
// }
// }
//
// if (productLimit.getPrivateOwners()){
// if (userDetailsDTO.getProfessionalIdentity().equals(CustomerProfessionalIdentityType.PRIVATE_OWNERS.getCode())) {
// result = true;
// }
// }
//
// if (productLimit.getSmallPrivateBusiness()){
// if (userDetailsDTO.getProfessionalIdentity().equals(CustomerProfessionalIdentityType.SMALL_PRIVATE_BUSINESS.getCode())) {
// result = true;
// }
// }
//
// if (productLimit.getOtherOccupations()){
// if (userDetailsDTO.getProfessionalIdentity().equals(CustomerProfessionalIdentityType.OTHER_OCCUPATIONS.getCode())) {
// result = true;
// }
// }
//
// //条件为 满足一个即可, 恰巧现在就有满足的, 则返回true通过
// if (openOne && result) {
// log.info("资质匹配筛选, 配置[满足其一]-职业:{}, 匹配通过, 结束匹配, 用户id-渠道id-渠道名称-产品id:{}", userDetailsDTO.getProfessionalIdentity() + "-" + infoByCode, userInfo);
// return result;
// }
// }
//
// //条件为 满足全部, 恰巧现在这个不满足, 则返回false(不通过)
// if (openAll && !result) {
// log.info("资质匹配筛选, 配置[满足所有]-职业:{}, 匹配不通过, 结束匹配, 用户id-渠道id-渠道名称-产品id:{}", userDetailsDTO.getProfessionalIdentity() + "-" + infoByCode, userInfo);
// return false;
// }
// }
//
// //学历 字典映射 1: "初中及以下,2: "高中",3: "中专",4: "大专",5: "本科",6: "研究生及以上"
// if (productLimit.getJuniorMiddleSchool() ||
// productLimit.getSeniorMiddleSchool() ||
// productLimit.getMiddleSchool() ||
// productLimit.getCollege() ||
// productLimit.getUndergraduate() ||
// productLimit.getPostgraduate()) {
//
// if (openAll && Objects.isNull(userDetailsDTO.getEducation())){
// log.info("资质匹配筛选, 配置[满足所有]-学历为空, 匹配不通过, 结束匹配, 用户id-渠道id-渠道名称-产品id:{}", userInfo);
// return false;
// }
//
// //判断结果置默认
// result = false;
// String infoByCode = getEducationByCode(userDetailsDTO.getEducation());
// if (Objects.nonNull(userDetailsDTO.getEducation())) {
// if (productLimit.getJuniorMiddleSchool() && userDetailsDTO.getEducation() == 1) { //初中
// result = true;
// }
//
// if (productLimit.getSeniorMiddleSchool() && userDetailsDTO.getEducation() == 2) { //高中
// result = true;
// }
//
// if (productLimit.getMiddleSchool() && userDetailsDTO.getEducation() == 3) { //中专
// result = true;
// }
//
// if (productLimit.getCollege() && userDetailsDTO.getEducation() == 4) { //大专
// result = true;
// }
//
// if (productLimit.getUndergraduate() && userDetailsDTO.getEducation() == 5) { //本科
// result = true;
// }
//
// if (productLimit.getPostgraduate() && userDetailsDTO.getEducation() == 6) { //研究生
// result = true;
// }
//
// //条件为 满足一个即可, 恰巧现在就有满足的, 则返回true通过
// if (openOne && result) {
// log.info("资质匹配筛选, 配置[满足其一]-学历:{}, 匹配通过, 结束匹配, 用户id-渠道id-渠道名称-产品id:{}", userDetailsDTO.getEducation() + "-" + infoByCode, userInfo);
// return result;
// }
// }
//
// //条件为 满足全部, 恰巧现在这个不满足, 则返回false(不通过)
// if (openAll && !result) {
// log.info("资质匹配筛选, 配置[满足所有]-学历:{}, 匹配不通过, 结束匹配, 用户id-渠道id-渠道名称-产品id:{}", userDetailsDTO.getEducation() + "-" + infoByCode, userInfo);
// return false;
// }
// }
//
// //白条可用额度 字典映射 1: 无额度,2: 2000以下,3: 2000-10000,4: 大于10000
// if (productLimit.getBaiTiaoLevelOne() ||
// productLimit.getBaiTiaoLevelTwo() ||
// productLimit.getBaiTiaoLevelThree()) {
//
// if (openAll && Objects.isNull(userDetailsDTO.getBaiTiaoQuota())){
// log.info("资质匹配筛选, 配置[满足所有]-白条为空, 匹配不通过, 结束匹配, 用户id-渠道id-渠道名称-产品id:{}", userInfo);
// return false;
// }
//
// //判断结果置默认
// result = false;
// String infoByCode = getBaiTiaoByCode(userDetailsDTO.getBaiTiaoQuota());
// if (Objects.nonNull(userDetailsDTO.getBaiTiaoQuota())) {
// if (productLimit.getBaiTiaoLevelOne() && userDetailsDTO.getBaiTiaoQuota() == 2) { //2000以下
// result = true;
// }
//
// if (productLimit.getBaiTiaoLevelTwo() && userDetailsDTO.getBaiTiaoQuota() == 3) { //2000-10000
// result = true;
// }
//
// if (productLimit.getBaiTiaoLevelThree() && userDetailsDTO.getBaiTiaoQuota() == 4) { //大于10000
// result = true;
// }
//
// //条件为 满足一个即可, 恰巧现在就有满足的, 则返回true通过
// if (openOne && result) {
// log.info("资质匹配筛选, 配置[满足其一]-白条:{}, 匹配通过, 结束匹配, 用户id-渠道id-渠道名称-产品id:{}", userDetailsDTO.getBaiTiaoQuota() + "-" + infoByCode, userInfo);
// return result;
// }
// }
//
// //条件为 满足全部, 恰巧现在这个不满足, 则返回false(不通过)
// if (openAll && !result) {
// log.info("资质匹配筛选, 配置[满足所有]-白条:{}, 匹配不通过, 结束匹配, 用户id-渠道id-渠道名称-产品id:{}", userDetailsDTO.getBaiTiaoQuota() + "-" + infoByCode, userInfo);
// return false;
// }
// }
//
// //花呗可用额度 字典映射 1: 无额度,2: 2000以下,3: 2000-10000,4: 大于10000
// if (productLimit.getHuaBeiLevelOne() ||
// productLimit.getHuaBeiLevelTwo() ||
// productLimit.getHuaBeiLevelThree()) {
//
// if (openAll && Objects.isNull(userDetailsDTO.getHuaBeiQuota())){
// log.info("资质匹配筛选, 配置[满足所有]-花呗为空, 匹配不通过, 结束匹配, 用户id-渠道id-渠道名称-产品id:{}", userInfo);
// return false;
// }
//
// //判断结果置默认
// result = false;
// String infoByCode = getBaiTiaoByCode(userDetailsDTO.getHuaBeiQuota());
// if (Objects.nonNull(userDetailsDTO.getHuaBeiQuota())) {
// if (productLimit.getHuaBeiLevelOne() && userDetailsDTO.getHuaBeiQuota() == 2) { //2000以下
// result = true;
// }
//
// if (productLimit.getHuaBeiLevelTwo() && userDetailsDTO.getHuaBeiQuota() == 3) { //2000-10000
// result = true;
// }
//
// if (productLimit.getHuaBeiLevelThree() && userDetailsDTO.getHuaBeiQuota() == 4) { //大于10000
// result = true;
// }
//
// //条件为 满足一个即可, 恰巧现在就有满足的, 则返回true通过
// if (openOne && result) {
// log.info("资质匹配筛选, 配置[满足其一]-花呗:{}, 匹配通过, 结束匹配, 用户id-渠道id-渠道名称-产品id:{}", userDetailsDTO.getHuaBeiQuota() + "-" + infoByCode, userInfo);
// return result;
// }
// }
//
// //条件为 满足全部, 恰巧现在这个不满足, 则返回false(不通过)
// if (openAll && !result) {
// log.info("资质匹配筛选, 配置[满足所有]-花呗:{}, 匹配不通过, 结束匹配, 用户id-渠道id-渠道名称-产品id:{}", userDetailsDTO.getHuaBeiQuota() + "-" + infoByCode, userInfo);
// return false;
// }
// }
//
// //满足其一, 但结果为false, 则不通过
// if (openOne && !result){
//// log.info("资质匹配筛选, 配置[满足其一]-未匹配成功, 匹配不通过, 结束匹配, 用户id-渠道id-渠道名称-产品id:{}", userInfo);
// return result;
// }
//
// if (openAll && result){
// log.info("资质匹配筛选, 配置[满足所有]-匹配成功, 匹配通过, 结束匹配, 用户id-渠道id-渠道名称-产品id:{}", userInfo);
// return result;
// }
//
// log.info("资质匹配筛选, 此行日志我觉得不会输出, 用户id-渠道id-渠道名称-产品id:{}", userInfo);
return true;
}
}

@ -129,6 +129,17 @@ public class BaseController
return rows > 0 ? AjaxResult.success() : AjaxResult.error();
}
/**
*
*
* @param rows
* @return
*/
protected AjaxResult toAjax(Long rows)
{
return rows > 0 ? AjaxResult.success() : AjaxResult.error();
}
/**
*
*

@ -57,6 +57,14 @@
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</dependency>
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-common-redis</artifactId>
</dependency>
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-common-security</artifactId>
</dependency>
</dependencies>

@ -1,14 +1,16 @@
package com.ruoyi.btc;
import com.ruoyi.common.security.annotation.EnableRyFeignClients;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
/**
*
*
*
* @author ruoyi
*/
@EnableRyFeignClients
@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class })
public class RuoYiBtcApplication
{

@ -5,30 +5,38 @@ import com.alibaba.fastjson.JSONObject;
import com.ruoyi.btc.domain.ComPublicHalfDto;
import com.ruoyi.btc.domain.CustomerInfoDto;
import com.ruoyi.btc.service.ISysPublicHalfService;
import com.ruoyi.common.core.constant.CacheConstants;
import com.ruoyi.common.core.constant.SecurityConstants;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.domain.http.Channel;
import com.ruoyi.common.core.domain.http.Customer;
import com.ruoyi.common.core.domain.http.Merchant;
import com.ruoyi.common.core.utils.SecureUtils;
import com.ruoyi.common.core.utils.StringUtils;
import com.ruoyi.common.core.web.domain.AjaxResult;
import com.ruoyi.common.redis.service.RedisService;
import com.ruoyi.system.api.RemoteCustomerApplyLogService;
import com.ruoyi.system.api.RemoteCustomerService;
import com.ruoyi.system.api.RemoteMerchantService;
import lombok.RequiredArgsConstructor;
import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.*;
import java.util.stream.Collectors;
/**
*
*
* @author ruoyi
*/
@Primary
@Service
@RequiredArgsConstructor
public class SysPublicHalfServiceImpl implements ISysPublicHalfService
{
private final RemoteCustomerService remoteCustomerService;
private final RemoteMerchantService remoteMerchantService;
private final RemoteCustomerApplyLogService remoteCustomerApplyLogService;
private final RedisService redisService;
/**
*
@ -37,9 +45,14 @@ public class SysPublicHalfServiceImpl implements ISysPublicHalfService
@Override
public AjaxResult check(ComPublicHalfDto comPublicHalfDto) {
//校验 IP地址是否正常 渠道标识是否存在 数据是否为空
if (StringUtils.isEmpty(comPublicHalfDto.getChannelSignature())){
return AjaxResult.error("渠道标识不能未空");
}
Channel channel = redisService.getCacheObject(CacheConstants.CHANNEL_SIGN + comPublicHalfDto.getChannelSignature());
if (channel==null||channel.getId()==null){
return AjaxResult.error("渠道不存在");
}
if (StringUtils.isEmpty(comPublicHalfDto.getData())){
return AjaxResult.error("加密数据不能为空");
}
@ -57,6 +70,7 @@ public class SysPublicHalfServiceImpl implements ISysPublicHalfService
//转化字段未数据库中资质字段 并保存 用户未实名状态 一并保存用户申请记录 未申请状态
Customer customer = new Customer();
BeanUtil.copyProperties(customerInfoDto,customer);
customer.setChannelId(channel.getId());
customer.setActurlName(customerInfoDto.getNameMd5());
customer.setFirstLoginTime(new Date());
customer.setLastLoginTime(new Date());
@ -68,11 +82,51 @@ public class SysPublicHalfServiceImpl implements ISysPublicHalfService
}else {
remoteCustomerService.add(customer,SecurityConstants.INNER);
}
//匹配资质 造轮子 返回多个符合的商户
//TODO 暂时不做 目前下游暂时不需要 匹配资质 造轮子 返回多个符合的商户
List<Merchant> merchants = matchMerchant(customer);
//结束返回上游结果
return null;
Map<String,Boolean> re = new HashMap<>();
if (merchants.size()>0){
re.put("data",true);
return AjaxResult.success(re);
}
re.put("data",false);
return AjaxResult.success(re);
}
/**
*
* @param customer
*/
private List<Merchant> matchMerchant(Customer customer) {
R<List<Merchant>> listR = remoteMerchantService.merchantList(SecurityConstants.INNER);
if (listR.getCode()!=200){
return new ArrayList<>();
}
List<Merchant> merchants = new ArrayList<>();
for (Merchant merchant:listR.getData()) {
//限量判定
R<Integer> sum = remoteCustomerApplyLogService.sum(merchant.getId(), SecurityConstants.INNER);
if (merchant.getLimitType()==1&&merchant.getLimitNum()<=sum.getData()){
continue;
}
if (customer.getAge()<merchant.getAgeLimitStart()||customer.getAge()>merchant.getAgeLimitEnd()){
continue;
}
if (merchant.getChannelLimitType()==1||merchant.getChannelLimitType()==2){
List<Long> list = Arrays.asList(merchant.getChannelLimit().split(",")).stream().map(val->Long.parseLong(val)).collect(Collectors.toList());
if (merchant.getChannelLimitType()==1&& !list.contains(customer.getChannelId())){
continue;
}
if (merchant.getChannelLimitType()==2&& list.contains(customer.getChannelId())){
continue;
}
}
merchants.add(merchant);
}
return merchants;
}
/**

@ -1,7 +1,6 @@
package com.ruoyi.system.controller;
import java.util.List;
import java.io.IOException;
import javax.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
@ -15,7 +14,7 @@ import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.log.annotation.Log;
import com.ruoyi.common.log.enums.BusinessType;
import com.ruoyi.common.security.annotation.RequiresPermissions;
import com.ruoyi.system.domain.Channel;
import com.ruoyi.common.core.domain.http.Channel;
import com.ruoyi.system.service.IChannelService;
import com.ruoyi.common.core.web.controller.BaseController;
import com.ruoyi.common.core.web.domain.AjaxResult;

@ -3,15 +3,11 @@ package com.ruoyi.system.controller;
import java.util.List;
import java.io.IOException;
import javax.servlet.http.HttpServletResponse;
import com.ruoyi.common.core.constant.SecurityConstants;
import com.ruoyi.common.core.domain.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import com.ruoyi.common.log.annotation.Log;
import com.ruoyi.common.log.enums.BusinessType;
import com.ruoyi.common.security.annotation.RequiresPermissions;
@ -47,6 +43,18 @@ public class CustomerApplyLogController extends BaseController
return getDataTable(list);
}
/**
*
*
*
* @param merchantId
* @param source
* @return
*/
@GetMapping("/log/sum")
public R<Integer> sum(@PathVariable("merchantId") Long merchantId, @RequestHeader(SecurityConstants.FROM_SOURCE) String source){
return R.ok(customerApplyLogService.getApplySum(merchantId));
}
/**
*
*/

@ -1,23 +1,17 @@
package com.ruoyi.system.controller;
import java.util.List;
import java.io.IOException;
import javax.servlet.http.HttpServletResponse;
import com.ruoyi.common.core.constant.SecurityConstants;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.system.service.IChannelService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import com.ruoyi.common.log.annotation.Log;
import com.ruoyi.common.log.enums.BusinessType;
import com.ruoyi.common.security.annotation.RequiresPermissions;
import com.ruoyi.system.domain.Merchant;
import com.ruoyi.common.core.domain.http.Merchant;
import com.ruoyi.system.service.IMerchantService;
import com.ruoyi.common.core.web.controller.BaseController;
import com.ruoyi.common.core.web.domain.AjaxResult;
@ -52,6 +46,16 @@ public class MerchantController extends BaseController
return getDataTable(list);
}
/**
*
*
* @return
*/
@GetMapping("/merchantList")
public R<List<Merchant>> merchantList(){
return merchantService.getMerchantList();
}
/**
*
*/

@ -1,642 +0,0 @@
package com.ruoyi.system.domain;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.core.annotation.Excel;
import com.ruoyi.common.core.web.domain.BaseEntity;
/**
* merchant
*
* @author ruoyi
* @date 2024-09-15
*/
public class Merchant extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** $column.columnComment */
private Long id;
/** 商户类型 1H5 2连登 3半流程 4全流程 */
@Excel(name = "商户类型 1H5 2连登 3半流程 4全流程")
private Long merchantType;
/** 商户名称 */
@Excel(name = "商户名称")
private String merchantName;
/** 商户描述 */
@Excel(name = "商户描述")
private String merchantDescribe;
/** 商户主体 */
@Excel(name = "商户主体")
private String merchantCompany;
/** logo文件地址 */
@Excel(name = "logo文件地址")
private Long logo;
/** 是否上下架 */
@Excel(name = "是否上下架")
private Long status;
/** 定量数 */
@Excel(name = "定量数")
private String limitNum;
/** 是否定量 0否 1是 */
@Excel(name = "是否定量 0否 1是")
private Long limitType;
/** 渠道限制类型 0不限 1准入 2禁入 */
@Excel(name = "渠道限制类型 0不限 1准入 2禁入")
private Long channelLimitType;
/** 年龄限制开始 */
@Excel(name = "年龄限制开始")
private Long ageLimitStart;
/** 年龄限制结束 */
@Excel(name = "年龄限制结束")
private Long ageLimitEnd;
/** 手机号禁入号段英文逗号分隔 */
@Excel(name = "手机号禁入号段英文逗号分隔")
private String phoneLimit;
/** 无社保 */
@Excel(name = "无社保")
private Long socialSecurityNo;
/** 社保未满6个月 */
@Excel(name = "社保未满6个月")
private Long socialSecurityLow;
/** 社保6个月以上 */
@Excel(name = "社保6个月以上")
private Long socialSecurityHigh;
/** 无车 */
@Excel(name = "无车")
private Long carNo;
/** 有车 */
@Excel(name = "有车")
private Long carHave;
/** 保单缴纳不满一年 */
@Excel(name = "保单缴纳不满一年")
private Long guaranteeSlipLow;
/** 保单缴纳一年以上 */
@Excel(name = "保单缴纳一年以上")
private Long guaranteeSlipCentre;
/** 保单缴纳2年以上 */
@Excel(name = "保单缴纳2年以上")
private Long guaranteeSlipHigh;
/** 初中 */
@Excel(name = "初中")
private Long educationMiddle;
/** 高中 */
@Excel(name = "高中")
private Long educationHighSchool;
/** 中专 */
@Excel(name = "中专")
private Long educationPolytechnic;
/** 大专 */
@Excel(name = "大专")
private Long educationJuniorCollege;
/** 本科 */
@Excel(name = "本科")
private Long educationUndergraduateCourse;
/** 研究生及以上 */
@Excel(name = "研究生及以上")
private Long educationPostgraduate;
/** 公积金未满6个月 */
@Excel(name = "公积金未满6个月")
private Long accumulationFundLow;
/** 公积金满6个月以上 */
@Excel(name = "公积金满6个月以上")
private Long accumulationFundHigh;
/** 本地无房 */
@Excel(name = "本地无房")
private Long hourseNo;
/** 本地全款房 */
@Excel(name = "本地全款房")
private Long hourseFullPayment;
/** 本地按揭 */
@Excel(name = "本地按揭")
private Long hourseMortgaging;
/** 上班族 */
@Excel(name = "上班族")
private Long officeWorker;
/** 公务员 */
@Excel(name = "公务员")
private Long civilServant;
/** 私营业主 */
@Excel(name = "私营业主")
private Long privatePropertyOwners;
/** 个体户 */
@Excel(name = "个体户")
private Long selfEmployedPerson;
/** 其他职业 */
@Excel(name = "其他职业")
private Long otherOccupations;
/** 花呗5000以下 */
@Excel(name = "花呗5000以下")
private Long huaBeiLow;
/** 花呗5000-10000 */
@Excel(name = "花呗5000-10000")
private Long huaBeiMiddle;
/** 花呗10000以上 */
@Excel(name = "花呗10000以上")
private Long huaBeiHigh;
/** 白条5000以下 */
@Excel(name = "白条5000以下")
private Long baiTiaoLow;
/** 白条5000-10000 */
@Excel(name = "白条5000-10000")
private Long baiTiaoMiddle;
/** 白条10000以上 */
@Excel(name = "白条10000以上")
private Long baiTiaoHigh;
/** 芝麻分 */
@Excel(name = "芝麻分")
private Long zhiMa;
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
public void setMerchantType(Long merchantType)
{
this.merchantType = merchantType;
}
public Long getMerchantType()
{
return merchantType;
}
public void setMerchantName(String merchantName)
{
this.merchantName = merchantName;
}
public String getMerchantName()
{
return merchantName;
}
public void setMerchantDescribe(String merchantDescribe)
{
this.merchantDescribe = merchantDescribe;
}
public String getMerchantDescribe()
{
return merchantDescribe;
}
public void setMerchantCompany(String merchantCompany)
{
this.merchantCompany = merchantCompany;
}
public String getMerchantCompany()
{
return merchantCompany;
}
public void setLogo(Long logo)
{
this.logo = logo;
}
public Long getLogo()
{
return logo;
}
public void setStatus(Long status)
{
this.status = status;
}
public Long getStatus()
{
return status;
}
public void setLimitNum(String limitNum)
{
this.limitNum = limitNum;
}
public String getLimitNum()
{
return limitNum;
}
public void setLimitType(Long limitType)
{
this.limitType = limitType;
}
public Long getLimitType()
{
return limitType;
}
public void setChannelLimitType(Long channelLimitType)
{
this.channelLimitType = channelLimitType;
}
public Long getChannelLimitType()
{
return channelLimitType;
}
public void setAgeLimitStart(Long ageLimitStart)
{
this.ageLimitStart = ageLimitStart;
}
public Long getAgeLimitStart()
{
return ageLimitStart;
}
public void setAgeLimitEnd(Long ageLimitEnd)
{
this.ageLimitEnd = ageLimitEnd;
}
public Long getAgeLimitEnd()
{
return ageLimitEnd;
}
public void setPhoneLimit(String phoneLimit)
{
this.phoneLimit = phoneLimit;
}
public String getPhoneLimit()
{
return phoneLimit;
}
public void setSocialSecurityNo(Long socialSecurityNo)
{
this.socialSecurityNo = socialSecurityNo;
}
public Long getSocialSecurityNo()
{
return socialSecurityNo;
}
public void setSocialSecurityLow(Long socialSecurityLow)
{
this.socialSecurityLow = socialSecurityLow;
}
public Long getSocialSecurityLow()
{
return socialSecurityLow;
}
public void setSocialSecurityHigh(Long socialSecurityHigh)
{
this.socialSecurityHigh = socialSecurityHigh;
}
public Long getSocialSecurityHigh()
{
return socialSecurityHigh;
}
public void setCarNo(Long carNo)
{
this.carNo = carNo;
}
public Long getCarNo()
{
return carNo;
}
public void setCarHave(Long carHave)
{
this.carHave = carHave;
}
public Long getCarHave()
{
return carHave;
}
public void setGuaranteeSlipLow(Long guaranteeSlipLow)
{
this.guaranteeSlipLow = guaranteeSlipLow;
}
public Long getGuaranteeSlipLow()
{
return guaranteeSlipLow;
}
public void setGuaranteeSlipCentre(Long guaranteeSlipCentre)
{
this.guaranteeSlipCentre = guaranteeSlipCentre;
}
public Long getGuaranteeSlipCentre()
{
return guaranteeSlipCentre;
}
public void setGuaranteeSlipHigh(Long guaranteeSlipHigh)
{
this.guaranteeSlipHigh = guaranteeSlipHigh;
}
public Long getGuaranteeSlipHigh()
{
return guaranteeSlipHigh;
}
public void setEducationMiddle(Long educationMiddle)
{
this.educationMiddle = educationMiddle;
}
public Long getEducationMiddle()
{
return educationMiddle;
}
public void setEducationHighSchool(Long educationHighSchool)
{
this.educationHighSchool = educationHighSchool;
}
public Long getEducationHighSchool()
{
return educationHighSchool;
}
public void setEducationPolytechnic(Long educationPolytechnic)
{
this.educationPolytechnic = educationPolytechnic;
}
public Long getEducationPolytechnic()
{
return educationPolytechnic;
}
public void setEducationJuniorCollege(Long educationJuniorCollege)
{
this.educationJuniorCollege = educationJuniorCollege;
}
public Long getEducationJuniorCollege()
{
return educationJuniorCollege;
}
public void setEducationUndergraduateCourse(Long educationUndergraduateCourse)
{
this.educationUndergraduateCourse = educationUndergraduateCourse;
}
public Long getEducationUndergraduateCourse()
{
return educationUndergraduateCourse;
}
public void setEducationPostgraduate(Long educationPostgraduate)
{
this.educationPostgraduate = educationPostgraduate;
}
public Long getEducationPostgraduate()
{
return educationPostgraduate;
}
public void setAccumulationFundLow(Long accumulationFundLow)
{
this.accumulationFundLow = accumulationFundLow;
}
public Long getAccumulationFundLow()
{
return accumulationFundLow;
}
public void setAccumulationFundHigh(Long accumulationFundHigh)
{
this.accumulationFundHigh = accumulationFundHigh;
}
public Long getAccumulationFundHigh()
{
return accumulationFundHigh;
}
public void setHourseNo(Long hourseNo)
{
this.hourseNo = hourseNo;
}
public Long getHourseNo()
{
return hourseNo;
}
public void setHourseFullPayment(Long hourseFullPayment)
{
this.hourseFullPayment = hourseFullPayment;
}
public Long getHourseFullPayment()
{
return hourseFullPayment;
}
public void setHourseMortgaging(Long hourseMortgaging)
{
this.hourseMortgaging = hourseMortgaging;
}
public Long getHourseMortgaging()
{
return hourseMortgaging;
}
public void setOfficeWorker(Long officeWorker)
{
this.officeWorker = officeWorker;
}
public Long getOfficeWorker()
{
return officeWorker;
}
public void setCivilServant(Long civilServant)
{
this.civilServant = civilServant;
}
public Long getCivilServant()
{
return civilServant;
}
public void setPrivatePropertyOwners(Long privatePropertyOwners)
{
this.privatePropertyOwners = privatePropertyOwners;
}
public Long getPrivatePropertyOwners()
{
return privatePropertyOwners;
}
public void setSelfEmployedPerson(Long selfEmployedPerson)
{
this.selfEmployedPerson = selfEmployedPerson;
}
public Long getSelfEmployedPerson()
{
return selfEmployedPerson;
}
public void setOtherOccupations(Long otherOccupations)
{
this.otherOccupations = otherOccupations;
}
public Long getOtherOccupations()
{
return otherOccupations;
}
public void setHuaBeiLow(Long huaBeiLow)
{
this.huaBeiLow = huaBeiLow;
}
public Long getHuaBeiLow()
{
return huaBeiLow;
}
public void setHuaBeiMiddle(Long huaBeiMiddle)
{
this.huaBeiMiddle = huaBeiMiddle;
}
public Long getHuaBeiMiddle()
{
return huaBeiMiddle;
}
public void setHuaBeiHigh(Long huaBeiHigh)
{
this.huaBeiHigh = huaBeiHigh;
}
public Long getHuaBeiHigh()
{
return huaBeiHigh;
}
public void setBaiTiaoLow(Long baiTiaoLow)
{
this.baiTiaoLow = baiTiaoLow;
}
public Long getBaiTiaoLow()
{
return baiTiaoLow;
}
public void setBaiTiaoMiddle(Long baiTiaoMiddle)
{
this.baiTiaoMiddle = baiTiaoMiddle;
}
public Long getBaiTiaoMiddle()
{
return baiTiaoMiddle;
}
public void setBaiTiaoHigh(Long baiTiaoHigh)
{
this.baiTiaoHigh = baiTiaoHigh;
}
public Long getBaiTiaoHigh()
{
return baiTiaoHigh;
}
public void setZhiMa(Long zhiMa)
{
this.zhiMa = zhiMa;
}
public Long getZhiMa()
{
return zhiMa;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("merchantType", getMerchantType())
.append("merchantName", getMerchantName())
.append("merchantDescribe", getMerchantDescribe())
.append("merchantCompany", getMerchantCompany())
.append("logo", getLogo())
.append("status", getStatus())
.append("limitNum", getLimitNum())
.append("limitType", getLimitType())
.append("channelLimitType", getChannelLimitType())
.append("ageLimitStart", getAgeLimitStart())
.append("ageLimitEnd", getAgeLimitEnd())
.append("phoneLimit", getPhoneLimit())
.append("socialSecurityNo", getSocialSecurityNo())
.append("socialSecurityLow", getSocialSecurityLow())
.append("socialSecurityHigh", getSocialSecurityHigh())
.append("carNo", getCarNo())
.append("carHave", getCarHave())
.append("guaranteeSlipLow", getGuaranteeSlipLow())
.append("guaranteeSlipCentre", getGuaranteeSlipCentre())
.append("guaranteeSlipHigh", getGuaranteeSlipHigh())
.append("educationMiddle", getEducationMiddle())
.append("educationHighSchool", getEducationHighSchool())
.append("educationPolytechnic", getEducationPolytechnic())
.append("educationJuniorCollege", getEducationJuniorCollege())
.append("educationUndergraduateCourse", getEducationUndergraduateCourse())
.append("educationPostgraduate", getEducationPostgraduate())
.append("accumulationFundLow", getAccumulationFundLow())
.append("accumulationFundHigh", getAccumulationFundHigh())
.append("hourseNo", getHourseNo())
.append("hourseFullPayment", getHourseFullPayment())
.append("hourseMortgaging", getHourseMortgaging())
.append("officeWorker", getOfficeWorker())
.append("civilServant", getCivilServant())
.append("privatePropertyOwners", getPrivatePropertyOwners())
.append("selfEmployedPerson", getSelfEmployedPerson())
.append("otherOccupations", getOtherOccupations())
.append("huaBeiLow", getHuaBeiLow())
.append("huaBeiMiddle", getHuaBeiMiddle())
.append("huaBeiHigh", getHuaBeiHigh())
.append("baiTiaoLow", getBaiTiaoLow())
.append("baiTiaoMiddle", getBaiTiaoMiddle())
.append("baiTiaoHigh", getBaiTiaoHigh())
.append("zhiMa", getZhiMa())
.append("createTime", getCreateTime())
.append("updateTime", getUpdateTime())
.append("remark", getRemark())
.toString();
}
}

@ -1,7 +1,10 @@
package com.ruoyi.system.mapper;
import java.util.List;
import com.ruoyi.system.domain.Channel;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.common.core.domain.http.Channel;
import com.ruoyi.system.domain.CustomerApplyLog;
/**
* Mapper
@ -9,7 +12,7 @@ import com.ruoyi.system.domain.Channel;
* @author ruoyi
* @date 2024-09-15
*/
public interface ChannelMapper
public interface ChannelMapper extends BaseMapper<Channel>
{
/**
*

@ -1,6 +1,9 @@
package com.ruoyi.system.mapper;
import java.util.List;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.common.core.domain.http.Merchant;
import com.ruoyi.system.domain.CustomerApplyLog;
/**
@ -9,7 +12,7 @@ import com.ruoyi.system.domain.CustomerApplyLog;
* @author ruoyi
* @date 2024-09-15
*/
public interface CustomerApplyLogMapper
public interface CustomerApplyLogMapper extends BaseMapper<CustomerApplyLog>
{
/**
*

@ -1,7 +1,10 @@
package com.ruoyi.system.mapper;
import java.util.List;
import com.ruoyi.system.domain.Merchant;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.common.core.domain.http.Customer;
import com.ruoyi.common.core.domain.http.Merchant;
/**
* Mapper
@ -9,7 +12,7 @@ import com.ruoyi.system.domain.Merchant;
* @author ruoyi
* @date 2024-09-15
*/
public interface MerchantMapper
public interface MerchantMapper extends BaseMapper<Merchant>
{
/**
*

@ -1,7 +1,7 @@
package com.ruoyi.system.service;
import java.util.List;
import com.ruoyi.system.domain.Channel;
import com.ruoyi.common.core.domain.http.Channel;
/**
* Service

@ -1,6 +1,8 @@
package com.ruoyi.system.service;
import java.util.List;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ruoyi.system.domain.CustomerApplyLog;
/**
@ -9,7 +11,7 @@ import com.ruoyi.system.domain.CustomerApplyLog;
* @author ruoyi
* @date 2024-09-15
*/
public interface ICustomerApplyLogService
public interface ICustomerApplyLogService extends IService<CustomerApplyLog>
{
/**
*
@ -58,4 +60,11 @@ public interface ICustomerApplyLogService
* @return
*/
public int deleteCustomerApplyLogById(Long id);
/**
*
* @param merchantId
* @return
*/
Integer getApplySum(Long merchantId);
}

@ -1,7 +1,11 @@
package com.ruoyi.system.service;
import java.util.List;
import com.ruoyi.system.domain.Merchant;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.domain.http.Customer;
import com.ruoyi.common.core.domain.http.Merchant;
/**
* Service
@ -9,7 +13,7 @@ import com.ruoyi.system.domain.Merchant;
* @author ruoyi
* @date 2024-09-15
*/
public interface IMerchantService
public interface IMerchantService extends IService<Merchant>
{
/**
*
@ -58,4 +62,11 @@ public interface IMerchantService
* @return
*/
public int deleteMerchantById(Long id);
/**
*
* @return
*/
R<List<Merchant>> getMerchantList();
}

@ -11,7 +11,7 @@ import org.apache.commons.lang3.RandomStringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;
import com.ruoyi.system.domain.Channel;
import com.ruoyi.common.core.domain.http.Channel;
import com.ruoyi.system.service.IChannelService;
import org.springframework.transaction.annotation.Transactional;

@ -1,7 +1,12 @@
package com.ruoyi.system.service.impl;
import java.util.List;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.IService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.core.utils.DateUtils;
import com.ruoyi.common.core.utils.LocalDateTimeUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.CustomerApplyLogMapper;
@ -15,7 +20,7 @@ import com.ruoyi.system.service.ICustomerApplyLogService;
* @date 2024-09-15
*/
@Service
public class CustomerApplyLogServiceImpl implements ICustomerApplyLogService
public class CustomerApplyLogServiceImpl extends ServiceImpl<CustomerApplyLogMapper, CustomerApplyLog> implements IService<CustomerApplyLog>,ICustomerApplyLogService
{
@Autowired
private CustomerApplyLogMapper customerApplyLogMapper;
@ -93,4 +98,20 @@ public class CustomerApplyLogServiceImpl implements ICustomerApplyLogService
{
return customerApplyLogMapper.deleteCustomerApplyLogById(id);
}
/**
*
* @param merchantId
* @return
*/
@Override
public Integer getApplySum(Long merchantId) {
Long aLong = customerApplyLogMapper.selectCount(
new LambdaQueryWrapper<CustomerApplyLog>()
.eq(CustomerApplyLog::getMerchantId, merchantId)
.eq(CustomerApplyLog::getOrderStatus, 0)
.ge(CustomerApplyLog::getCreateTime, LocalDateTimeUtils.getDateFromLocalDateTime(LocalDateTimeUtils.getTodayStartTime()))
.le(CustomerApplyLog::getCreateTime, LocalDateTimeUtils.getDateFromLocalDateTime(LocalDateTimeUtils.getTodayEndTime())));
return aLong.intValue();
}
}

@ -1,11 +1,19 @@
package com.ruoyi.system.service.impl;
import java.util.List;
import cn.hutool.core.collection.CollectionUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.IService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.domain.http.Customer;
import com.ruoyi.common.core.utils.DateUtils;
import com.ruoyi.system.mapper.CustomerMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.MerchantMapper;
import com.ruoyi.system.domain.Merchant;
import com.ruoyi.common.core.domain.http.Merchant;
import com.ruoyi.system.service.IMerchantService;
/**
@ -15,7 +23,7 @@ import com.ruoyi.system.service.IMerchantService;
* @date 2024-09-15
*/
@Service
public class MerchantServiceImpl implements IMerchantService
public class MerchantServiceImpl extends ServiceImpl<MerchantMapper, Merchant> implements IService<Merchant>,IMerchantService
{
@Autowired
private MerchantMapper merchantMapper;
@ -93,4 +101,17 @@ public class MerchantServiceImpl implements IMerchantService
{
return merchantMapper.deleteMerchantById(id);
}
/**
*
* @return
*/
@Override
public R<List<Merchant>> getMerchantList() {
List<Merchant> merchants = merchantMapper.selectList(new LambdaQueryWrapper<Merchant>().eq(Merchant::getStatus, true));
if (CollectionUtil.isEmpty(merchants)){
return R.fail();
}
return R.ok(merchants);
}
}

@ -4,7 +4,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.system.mapper.ChannelMapper">
<resultMap type="com.ruoyi.system.domain.Channel" id="ChannelResult">
<resultMap type="com.ruoyi.common.core.domain.http.Channel" id="ChannelResult">
<result property="id" column="id" />
<result property="channelName" column="channel_name" />
<result property="channelSign" column="channel_sign" />
@ -24,7 +24,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<sql id="selectChannelIdName">
select id, channel_name, channel_sign from channel
</sql>
<select id="selectChannelList" parameterType="com.ruoyi.system.domain.Channel" resultMap="ChannelResult">
<select id="selectChannelList" parameterType="com.ruoyi.common.core.domain.http.Channel" resultMap="ChannelResult">
<include refid="selectChannelVo"/>
<where>
<if test="channelName != null and channelName != ''"> and channel_name like concat('%', #{channelName}, '%')</if>
@ -42,7 +42,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where id = #{id}
</select>
<insert id="insertChannel" parameterType="com.ruoyi.system.domain.Channel" useGeneratedKeys="true" keyProperty="id">
<insert id="insertChannel" parameterType="com.ruoyi.common.core.domain.http.Channel" useGeneratedKeys="true" keyProperty="id">
insert into channel
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="channelName != null">channel_name,</if>
@ -70,7 +70,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</trim>
</insert>
<update id="updateChannel" parameterType="com.ruoyi.system.domain.Channel">
<update id="updateChannel" parameterType="com.ruoyi.common.core.domain.http.Channel">
update channel
<trim prefix="SET" suffixOverrides=",">
<if test="channelName != null">channel_name = #{channelName},</if>

@ -4,7 +4,7 @@
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.system.mapper.MerchantMapper">
<resultMap type="com.ruoyi.system.domain.Merchant" id="MerchantResult">
<resultMap type="com.ruoyi.common.core.domain.http.Merchant" id="MerchantResult">
<result property="id" column="id" />
<result property="merchantType" column="merchant_type" />
<result property="merchantName" column="merchant_name" />
@ -58,7 +58,7 @@
select id, merchant_type, merchant_name, merchant_describe, merchant_company, logo, status, limit_num, limit_type, channel_limit_type, age_limit_start, age_limit_end, phone_limit, social_security_no, social_security_low, social_security_high, car_no, car_have, guarantee_slip_low, guarantee_slip_centre, guarantee_slip_high, education_middle, education_high_school, education_polytechnic, education_junior_college, education_undergraduate_course, education_postgraduate, accumulation_fund_low, accumulation_fund_high, hourse_no, hourse_full_payment, hourse_mortgaging, office_worker, civil_servant, private_property_owners, self_employed_person, other_occupations, hua_bei_low, hua_bei_middle, hua_bei_high, bai_tiao_low, bai_tiao_middle, bai_tiao_high, zhi_ma, create_time, update_time, remark from merchant
</sql>
<select id="selectMerchantList" parameterType="com.ruoyi.system.domain.Merchant" resultMap="MerchantResult">
<select id="selectMerchantList" parameterType="com.ruoyi.common.core.domain.http.Merchant" resultMap="MerchantResult">
<include refid="selectMerchantVo"/>
<where>
<if test="merchantType != null "> and merchant_type = #{merchantType}</if>
@ -112,7 +112,7 @@
where id = #{id}
</select>
<insert id="insertMerchant" parameterType="com.ruoyi.system.domain.Merchant" useGeneratedKeys="true" keyProperty="id">
<insert id="insertMerchant" parameterType="com.ruoyi.common.core.domain.http.Merchant" useGeneratedKeys="true" keyProperty="id">
insert into merchant
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="merchantType != null">merchant_type,</if>
@ -212,7 +212,7 @@
</trim>
</insert>
<update id="updateMerchant" parameterType="com.ruoyi.system.domain.Merchant">
<update id="updateMerchant" parameterType="com.ruoyi.common.core.domain.http.Merchant">
update merchant
<trim prefix="SET" suffixOverrides=",">
<if test="merchantType != null">merchant_type = #{merchantType},</if>

Loading…
Cancel
Save