Sfoglia il codice sorgente

Merge remote-tracking branch 'origin/master'

master
zouhantao 1 settimana fa
parent
commit
8787fb91e3

+ 1
- 2
gly-base-core/src/main/java/cn/com/taiji/core/model/comm/protocol/ods/oqs/issue/OqsUserQueryRequest.java Vedi File



private Integer customerIdType;//用户证件类型 private Integer customerIdType;//用户证件类型
private String customerIdNum;//用户证件号 private String customerIdNum;//用户证件号

private String customerId;// 用户编号 private String customerId;// 用户编号

private String mobile;//手机号 private String mobile;//手机号
private String department;//部门名称


public OqsUserQueryRequest() { public OqsUserQueryRequest() {
super(OqsIssueCmd.USERQUERY); super(OqsIssueCmd.USERQUERY);

+ 5
- 1
gly-base-core/src/main/java/cn/com/taiji/core/repo/jpa/basic/QtkCustomerInfoRepo.java Vedi File

QtkCustomerInfo findByCustomerIdTypeAndCustomerIdNum(IdType customerIdType, String customerIdNum); QtkCustomerInfo findByCustomerIdTypeAndCustomerIdNum(IdType customerIdType, String customerIdNum);


@Query("from QtkCustomerInfo where customerIdNum = ?1 and customerIdType = ?2 and userType = ?3") @Query("from QtkCustomerInfo where customerIdNum = ?1 and customerIdType = ?2 and userType = ?3")
QtkCustomerInfo findByCustomerIdNumAndCustomerIdTypeAndUserType(String customerIdNum, Integer customerIdType, Integer userType);
QtkCustomerInfo findByCustomerIdNumAndCustomerIdTypeAndUserType(String customerIdNum, IdType customerIdType, Integer userType);


@Query("select customerId from QtkCustomerInfo where customerIdNum = ?1") @Query("select customerId from QtkCustomerInfo where customerIdNum = ?1")
List<String> findCustomerIdByIdNum(String customerIdNum); List<String> findCustomerIdByIdNum(String customerIdNum);
@Query(" from QtkCustomerInfo where agentIdType = ?1 and agentIdNum =?2 order by customerId") @Query(" from QtkCustomerInfo where agentIdType = ?1 and agentIdNum =?2 order by customerId")
public List<QtkCustomerInfo> listByAgentInfo(IdType agentIdType, String agentIdNum); public List<QtkCustomerInfo> listByAgentInfo(IdType agentIdType, String agentIdNum);


@Query("from QtkCustomerInfo where customerIdNum = ?1 and customerIdType = ?2 and department = ?3")
QtkCustomerInfo findByCustomerIdNumAndCustomerIdTypeAndDepartment(String customerIdNum, IdType customerIdType, String department);


} }

+ 17
- 30
zhywpt-service-ods/src/main/java/cn/com/taiji/ods/manager/oqs/issue/UserQueryManagerImpl.java Vedi File

import cn.com.taiji.common.pub.LambdaTools; import cn.com.taiji.common.pub.LambdaTools;
import cn.com.taiji.core.entity.basic.QtkCustomerInfo; import cn.com.taiji.core.entity.basic.QtkCustomerInfo;
import cn.com.taiji.core.entity.dict.basic.IdType; import cn.com.taiji.core.entity.dict.basic.IdType;
import cn.com.taiji.core.entity.dict.basic.UserType;
import cn.com.taiji.core.model.comm.protocol.ods.oqs.issue.OqsUserQueryRequest; import cn.com.taiji.core.model.comm.protocol.ods.oqs.issue.OqsUserQueryRequest;
import cn.com.taiji.core.model.comm.protocol.ods.oqs.issue.OqsUserQueryResponse; import cn.com.taiji.core.model.comm.protocol.ods.oqs.issue.OqsUserQueryResponse;
import cn.com.taiji.core.model.comm.protocol.valid.GlyServiceError; import cn.com.taiji.core.model.comm.protocol.valid.GlyServiceError;
@Override @Override
public OqsUserQueryResponse serviceHandle(OqsUserQueryRequest req) throws ServiceHandleException { public OqsUserQueryResponse serviceHandle(OqsUserQueryRequest req) throws ServiceHandleException {
logger.info("老库、新库用户查询开始{},参数{}", LocalDateTime.now(),req.toJson()); logger.info("老库、新库用户查询开始{},参数{}", LocalDateTime.now(),req.toJson());
Result result = new Result(new DsiCustomerInfo(), new QtkCustomerInfo());
Result result;
if (!StringUtils.isEmpty(req.getCustomerId())){ if (!StringUtils.isEmpty(req.getCustomerId())){
result = findByCustomerId(req); result = findByCustomerId(req);
}else if(!StringUtils.isEmpty(req.getCustomerIdNum()) && !Optional.ofNullable(req.getCustomerIdType()).isEmpty()){
}else if(!StringUtils.isEmpty(req.getCustomerIdNum()) && req.getCustomerIdType() != null){
result = findByCustomerIdTypeAndCustomerIdNum(req); result = findByCustomerIdTypeAndCustomerIdNum(req);
}else if (!StringUtils.isEmpty(req.getMobile())){ }else if (!StringUtils.isEmpty(req.getMobile())){
return listCustomerInfoByMobile(req); return listCustomerInfoByMobile(req);
return res; return res;
} }


// public static void main(String[] args) {
// List<QtkCustomerInfo> l = new ArrayList<>();
// QtkCustomerInfo c1 = new QtkCustomerInfo();
// c1.setUpdateTime(LocalDateTime.of(2021, 1, 1, 1, 1));
// QtkCustomerInfo c2 = new QtkCustomerInfo();
// c2.setUpdateTime(LocalDateTime.of(2020, 1, 1, 1, 1));
// QtkCustomerInfo c3 = new QtkCustomerInfo();
// c3.setUpdateTime(LocalDateTime.of(2022, 1, 1, 1, 1));
// l.add(c1);
// l.add(c2);
// l.add(c3);
// List<QtkCustomerInfo> collect = l.stream().sorted(new Comparator<QtkCustomerInfo>() {
// @Override
// public int compare(QtkCustomerInfo o1, QtkCustomerInfo o2) {
// return o1.getUpdateTime().isAfter(o2.getUpdateTime()) ? 1 : -1;
// }
// }.reversed()).collect(Collectors.toList());
// collect.forEach(c -> System.out.println(c.getUpdateTime()));
// }

private Result findByCustomerId(OqsUserQueryRequest req) { private Result findByCustomerId(OqsUserQueryRequest req) {
QtkCustomerInfo qtkCustomerInfo = new QtkCustomerInfo();
qtkCustomerInfo = qtkCustomerInfoRepo.findByCustomerId(req.getCustomerId());
QtkCustomerInfo qtkCustomerInfo = qtkCustomerInfoRepo.findByCustomerId(req.getCustomerId());
DsiCustomerInfo dsiCustomerInfo = dsiCustomerInfoRepo.findByCustomerId(req.getCustomerId()); DsiCustomerInfo dsiCustomerInfo = dsiCustomerInfoRepo.findByCustomerId(req.getCustomerId());
return new Result(dsiCustomerInfo, qtkCustomerInfo); return new Result(dsiCustomerInfo, qtkCustomerInfo);
} }


private Result findByCustomerIdTypeAndCustomerIdNum(OqsUserQueryRequest req) {
new QtkCustomerInfo();
QtkCustomerInfo qtkCustomerInfo =
qtkCustomerInfoRepo.findByCustomerIdTypeAndCustomerIdNum(IdType.findByCode(req.getCustomerIdType()), req.getCustomerIdNum());
DsiCustomerInfo dsiCustomerInfo =
dsiCustomerInfoRepo.findByCustomerIdNumAndCustomerIdType(req.getCustomerIdNum(), req.getCustomerIdType());
private Result findByCustomerIdTypeAndCustomerIdNum(OqsUserQueryRequest req) throws ServiceHandleException {
QtkCustomerInfo qtkCustomerInfo = null;
DsiCustomerInfo dsiCustomerInfo = null;
if (IdType.judgeUserType(req.getCustomerIdType()).equals(UserType.PERSONAL_USER)) {
qtkCustomerInfo = qtkCustomerInfoRepo.findByCustomerIdTypeAndCustomerIdNum(IdType.findByCode(req.getCustomerIdType()), req.getCustomerIdNum());
dsiCustomerInfo = dsiCustomerInfoRepo.findByCustomerIdNumAndCustomerIdType(req.getCustomerIdNum(), req.getCustomerIdType());
}else{
if(StringUtils.isEmpty(req.getDepartment())){
throw GlyServiceError.FORMAT_VALIDATE_ERR.toHandleException("单位用户部门名称不能为空");
}
qtkCustomerInfo = qtkCustomerInfoRepo.findByCustomerIdNumAndCustomerIdTypeAndDepartment(req.getCustomerIdNum(), IdType.findByCode(req.getCustomerIdType()), req.getDepartment());
dsiCustomerInfo = dsiCustomerInfoRepo.findByCustomerIdNumAndCustomerIdTypeAndDepartment(req.getCustomerIdNum(), req.getCustomerIdType(), req.getDepartment());
}
return new Result(dsiCustomerInfo, qtkCustomerInfo); return new Result(dsiCustomerInfo, qtkCustomerInfo);
} }



Loading…
Annulla
Salva