Selaa lähdekoodia

Merge remote-tracking branch 'origin/master'

master
zouhantao 6 päivää sitten
vanhempi
commit
8787fb91e3

+ 1
- 2
gly-base-core/src/main/java/cn/com/taiji/core/model/comm/protocol/ods/oqs/issue/OqsUserQueryRequest.java Näytä tiedosto

@@ -14,10 +14,9 @@ public class OqsUserQueryRequest extends AbstractSignTypeRequest<OqsUserQueryRes

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

private String customerId;// 用户编号

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

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

+ 5
- 1
gly-base-core/src/main/java/cn/com/taiji/core/repo/jpa/basic/QtkCustomerInfoRepo.java Näytä tiedosto

@@ -18,7 +18,7 @@ public interface QtkCustomerInfoRepo extends AbstractJpaRepo<QtkCustomerInfo, St
QtkCustomerInfo findByCustomerIdTypeAndCustomerIdNum(IdType customerIdType, String customerIdNum);

@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")
List<String> findCustomerIdByIdNum(String customerIdNum);
@@ -29,4 +29,8 @@ public interface QtkCustomerInfoRepo extends AbstractJpaRepo<QtkCustomerInfo, St
@Query(" from QtkCustomerInfo where agentIdType = ?1 and agentIdNum =?2 order by customerId")
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 Näytä tiedosto

@@ -5,6 +5,7 @@ import cn.com.taiji.common.manager.net.http.ServiceHandleException;
import cn.com.taiji.common.pub.LambdaTools;
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.UserType;
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.valid.GlyServiceError;
@@ -29,10 +30,10 @@ public class UserQueryManagerImpl extends AbstractManager implements UserQueryMa
@Override
public OqsUserQueryResponse serviceHandle(OqsUserQueryRequest req) throws ServiceHandleException {
logger.info("老库、新库用户查询开始{},参数{}", LocalDateTime.now(),req.toJson());
Result result = new Result(new DsiCustomerInfo(), new QtkCustomerInfo());
Result result;
if (!StringUtils.isEmpty(req.getCustomerId())){
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);
}else if (!StringUtils.isEmpty(req.getMobile())){
return listCustomerInfoByMobile(req);
@@ -84,39 +85,25 @@ public class UserQueryManagerImpl extends AbstractManager implements UserQueryMa
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) {
QtkCustomerInfo qtkCustomerInfo = new QtkCustomerInfo();
qtkCustomerInfo = qtkCustomerInfoRepo.findByCustomerId(req.getCustomerId());
QtkCustomerInfo qtkCustomerInfo = qtkCustomerInfoRepo.findByCustomerId(req.getCustomerId());
DsiCustomerInfo dsiCustomerInfo = dsiCustomerInfoRepo.findByCustomerId(req.getCustomerId());
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);
}


Loading…
Peruuta
Tallenna