Commit 53306eef authored by 王向伟's avatar 王向伟

用户信息枚举类型添加描述,导出配置添加orderCallback

parent 400be065
......@@ -9,6 +9,7 @@ import cn.quantgroup.cashloanflowboss.spi.clf.model.KANoticeType;
import cn.quantgroup.cashloanflowboss.spi.clf.service.CLFCenterService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.stereotype.Service;
......@@ -161,10 +162,15 @@ public class ChannelConfServiceImpl implements ChannelConfService {
}
String channelPublicKey = addInfo.getPublicKey();
if(StringUtils.isBlank(channelPublicKey)){
//没有key直接跳过
return true;
}
ChannelSecurityKey channelSecurityKey = clfCenterService.findChannelSecurityByChannelId(channelConf.getChannelId());
if (Objects.isNull(channelSecurityKey)) {
channelSecurityKey = new ChannelSecurityKey();
channelSecurityKey.setIsActive(true);
channelSecurityKey.setChannelId(channelConf.getChannelId());
channelSecurityKey.setCreatedAt(new Timestamp(System.currentTimeMillis()));
}
channelSecurityKey.setChannelPublicKey(channelPublicKey);
......@@ -196,6 +202,7 @@ public class ChannelConfServiceImpl implements ChannelConfService {
List<ChannelApplyInfoStrategy> channelApplyInfoStrategies = clfCenterService.findChannelApplyInfoStrategyByChannelId(channelId);
ChannelSecurityKey channelSecurityKey = clfCenterService.findChannelSecurityByChannelId(channelId);
List<ClfOrderCallBack> orderCallBackList = clfCenterService.findClfOrderCallBackByChannelId(channelId);
StringJoiner joiner = new StringJoiner("\n");
if (Objects.nonNull(channelConfiguration)) {
joiner.add(generateInsertSql(channelConfiguration));
......@@ -213,6 +220,11 @@ public class ChannelConfServiceImpl implements ChannelConfService {
if (Objects.nonNull(channelSecurityKey)) {
joiner.add(generateInsertSql(channelSecurityKey));
}
if (CollectionUtils.isNotEmpty(orderCallBackList)) {
for (ClfOrderCallBack orderCallBack : orderCallBackList) {
joiner.add(generateInsertSql(orderCallBack));
}
}
return joiner.toString();
}
......
......@@ -3,11 +3,11 @@ package cn.quantgroup.cashloanflowboss.api.customer.service.impl;
import cn.quantgroup.cashloanflowboss.api.customer.entity.CustomerInfo;
import cn.quantgroup.cashloanflowboss.api.customer.service.ICustomerService;
import cn.quantgroup.cashloanflowboss.component.route.ServiceRoute;
import cn.quantgroup.cashloanflowboss.core.base.ServiceResult;
import cn.quantgroup.cashloanflowboss.spi.clf.entity.ClfOrderMapping;
import cn.quantgroup.cashloanflowboss.spi.clf.repository.ClfOrderMappingRepository;
import cn.quantgroup.cashloanflowboss.spi.spiderCenter.SpiderCenter;
import cn.quantgroup.cashloanflowboss.spi.user.service.UserSysService;
import cn.quantgroup.cashloanflowboss.utils.EnumInfoUtil;
import cn.quantgroup.user.retbean.*;
import cn.quantgroup.user.vo.UserSysResult;
import lombok.extern.slf4j.Slf4j;
......@@ -181,17 +181,20 @@ public class CustomerService implements ICustomerService {
return;
}
info.setIncome(xUserExtInfo.getIncomeEnum().name());
info.setIncomeRange(xUserExtInfo.getIncomeRangeEnum().name());
info.setOccupation(xUserExtInfo.getOccupationEnum().name());
info.setEducation(xUserExtInfo.getEducationEnum().name());
info.setIncome(EnumInfoUtil.Income(xUserExtInfo.getIncomeEnum()));
info.setIncomeRange(EnumInfoUtil.incomeRange(xUserExtInfo.getIncomeRangeEnum()));
info.setOccupation(EnumInfoUtil.occupation(xUserExtInfo.getOccupationEnum()));
info.setEducation(EnumInfoUtil.education(xUserExtInfo.getEducationEnum()));
info.setHasCar(xUserExtInfo.getHasCar());
info.setHasSocialSecurity(xUserExtInfo.getHasSocialSecurity());
info.setHasHouse(xUserExtInfo.getHasHouse());
info.setHasCreditCard(xUserExtInfo.getHasCar());
info.setMarryStatus(xUserExtInfo.getMarryStatus().name());
info.setMarryStatus(EnumInfoUtil.maritalStatus(xUserExtInfo.getMarryStatus()));
}
private void populateDetail(CustomerInfo info, XUserDetail xUserDetail) {
String logStr = "CustomerService.populateDetail";
log.info("{} xUser填充客户信息 xUser={}", logStr, xUserDetail);
......
......@@ -6,6 +6,8 @@ import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;
import java.util.List;
/**
* function:
* date: 2019/8/7
......@@ -20,5 +22,5 @@ public interface ClfOrderCallbackRepository extends JpaRepository<ClfOrderCallBa
ClfOrderCallBack findByCallbackStatusAndRegisteredFrom(String callbackState, Long channelId);
List<ClfOrderCallBack> findByRegisteredFrom(Long registeredFrom);
}
......@@ -52,4 +52,7 @@ public interface CLFCenterService {
ChannelSecurityKey findChannelSecurityByChannelId(Long channelId);
List<ClfOrderCallBack> findClfOrderCallBackByChannelId(Long channelId);
}
......@@ -189,4 +189,9 @@ public class CLFCenterServiceImpl implements CLFCenterService {
public ChannelSecurityKey findChannelSecurityByChannelId(Long channelId) {
return channelSecurityKeyRepository.findByChannelId(channelId);
}
@Override
public List<ClfOrderCallBack> findClfOrderCallBackByChannelId(Long channelId) {
return clfOrderCallbackRepository.findByRegisteredFrom(channelId);
}
}
......@@ -58,7 +58,7 @@ public class UserExtInfo implements Serializable {
xUserExtInfo.setEducationEnum(cn.quantgroup.motan.enums.EducationEnum.valueOf(this.educationEnum.name()));
xUserExtInfo.setIncomeEnum(cn.quantgroup.motan.enums.IncomeEnum.valueOf(this.incomeEnum.name()));
xUserExtInfo.setIncomeRangeEnum(cn.quantgroup.motan.enums.IncomeRangeEnum.valueOf(this.incomeRangeEnum.name()));
xUserExtInfo.setOccupationEnum(cn.quantgroup.motan.enums.OccupationEnum.valueOf(this.occupationEnum.name()));
xUserExtInfo.setOccupationEnum(cn.quantgroup.motan.enums.OccupationEnum.valueOf(this.occupation.name()));
xUserExtInfo.setHasCar(this.hasCar);
xUserExtInfo.setHasSocialSecurity(this.hasSocialSecurity);
xUserExtInfo.setHasCreditCard(this.hasCreditCard);
......
package cn.quantgroup.cashloanflowboss.utils;
import cn.quantgroup.user.enums.*;
/**
* @author Wang Xiangwei
* @version 2020/7/27
*/
public class EnumInfoUtil {
public static String Income(IncomeEnum incomeEnum) {
switch (incomeEnum) {
case UNKNOWN:
return incomeEnum.name() + "(未知)";
case CASH:
return incomeEnum.name() + "(现金计算)";
case PAY_CARD:
return incomeEnum.name() + "(工资卡)";
case CASH_AND_PAY_CARD:
return incomeEnum.name() + "(混合)";
}
return null;
}
public static String incomeRange(IncomeRangeEnum incomeRangeEnum) {
switch (incomeRangeEnum) {
case UNKNOWN:return incomeRangeEnum.name()+"(暂无)";
case BELOW_1000:return incomeRangeEnum.name()+"(小于1000元)";
case BELOW_3000:return incomeRangeEnum.name()+"(1000至3000元)";
case BELOW_5000:return incomeRangeEnum.name()+"(3000至5000元)";
case BELOW_8000:return incomeRangeEnum.name()+"(5000至8000元)";
case BELOW_10000:return incomeRangeEnum.name()+"(8000至10000元)";
case BELOW_15000:return incomeRangeEnum.name()+"(10000至15000元)";
case BELOW_20000:return incomeRangeEnum.name()+"(15000至20000元)";
case ABOVE_20000:return incomeRangeEnum.name()+"(大于20000元)";
}
return null;
}
public static String occupation(OccupationEnum occupationEnum) {
switch (occupationEnum) {
case UNKNOWN:return occupationEnum.name()+"(暂未填写)";
case WORKER:return occupationEnum.name()+"(工人)";
case TEACHER:return occupationEnum.name()+"(教师)";
case WHITE_COLLAR:return occupationEnum.name()+"(白领)";
case STUDENT:return occupationEnum.name()+"(学生)";
case CAREER_BUILDER:return occupationEnum.name()+"(创业者)";
case SELF_EMPLOYER:return occupationEnum.name()+"(个体户)";
case EMPLOYEE:return occupationEnum.name()+"(公司职员)";
case BISUNESS_ENTITY:return occupationEnum.name()+"(企业法人)";
case ONLINE_STORE_OWNER:return occupationEnum.name()+"(网店店主)";
case UNEMPLOYED:return occupationEnum.name()+"(暂无职业)";
case OTHER:return occupationEnum.name()+"(其他)";
}
return null;
}
public static String education(EducationEnum educationEnum) {
switch (educationEnum){
case UNKNOWN:return educationEnum.name()+"(暂无)";
case MASTER:return educationEnum.name()+"(硕士及以上)";
case UNDER_GRADUATE:return educationEnum.name()+"(本科)";
case JUNIOR_COLLEGE:return educationEnum.name()+"(大专)";
case TECHNICAL_SECONDARY_SCHOOL:return educationEnum.name()+"(中专)";
case TECHNICAL_SCHOOL:return educationEnum.name()+"(技校)";
case HIGH_SCHOOL:return educationEnum.name()+"(技校)";
case MIDDLE_SCHOOL:return educationEnum.name()+"(初中)";
case PRIMARY_SCHOOL:return educationEnum.name()+"(小学)";
case OTHER:return educationEnum.name()+"(其他)";
}
return null;
}
public static String maritalStatus(MaritalStatus maritalStatus) {
switch (maritalStatus){
case UNKNOWN:return maritalStatus.name()+"(未知)";
case SINGLE:return maritalStatus.name()+"(未婚)";
case MARRIED:return maritalStatus.name()+"(已婚)";
case DIVORCED:return maritalStatus.name()+"(离异)";
case WINDOWED:return maritalStatus.name()+"(丧偶)";
case OTHER:return maritalStatus.name()+"(其他)";
}
return null;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment