Commit 59027d3a authored by guangjing.gao's avatar guangjing.gao

移除主键生成格式,新建对象

parent bde9923a
...@@ -26,7 +26,7 @@ public class CustomerInfoEntity extends PartitionEntity implements Serializable ...@@ -26,7 +26,7 @@ public class CustomerInfoEntity extends PartitionEntity implements Serializable
@Id @Id
@Column(name = "ID", nullable = false) @Column(name = "ID", nullable = false)
@GeneratedValue(strategy = GenerationType.IDENTITY) // @GeneratedValue(strategy = GenerationType.IDENTITY)
private long id; private long id;
@Column(name = "CUSTOMER_ID", nullable = false) @Column(name = "CUSTOMER_ID", nullable = false)
......
...@@ -25,7 +25,7 @@ public class CustomerLoginEntity extends PartitionEntity implements Serializable ...@@ -25,7 +25,7 @@ public class CustomerLoginEntity extends PartitionEntity implements Serializable
@Id @Id
@Column(name = "ID", nullable = false) @Column(name = "ID", nullable = false)
@GeneratedValue(strategy = GenerationType.IDENTITY) // @GeneratedValue(strategy = GenerationType.IDENTITY)
private long id; private long id;
@Column(name = "INSTITUTION_ID", nullable = false, length = 4) @Column(name = "INSTITUTION_ID", nullable = false, length = 4)
......
...@@ -27,7 +27,7 @@ public class ProductLoginEntity extends PartitionEntity implements Serializable ...@@ -27,7 +27,7 @@ public class ProductLoginEntity extends PartitionEntity implements Serializable
@Id @Id
@Column(name = "ID", nullable = false) @Column(name = "ID", nullable = false)
@GeneratedValue(strategy = GenerationType.IDENTITY) // @GeneratedValue(strategy = GenerationType.IDENTITY)
private long id; private long id;
@Column(name = "CUSTOMER_ID", nullable = false) @Column(name = "CUSTOMER_ID", nullable = false)
......
...@@ -50,11 +50,11 @@ public class OauthLoginInfoServiceImpl implements IOauthLoginInfoService { ...@@ -50,11 +50,11 @@ public class OauthLoginInfoServiceImpl implements IOauthLoginInfoService {
String productId = oauthClientDetailsEntity.getProductId(); String productId = oauthClientDetailsEntity.getProductId();
String phoneNo = user.getPhoneNo(); String phoneNo = user.getPhoneNo();
Long userId = user.getId(); Long userId = user.getId();
ProductLoginEntity productLoginEntity = productLoginRepository.findFirstByInstitutionIdAndProductIdAndPhoneNo(institutionId, productId, phoneNo); ProductLoginEntity findProductLoginEntity = productLoginRepository.findFirstByInstitutionIdAndProductIdAndPhoneNo(institutionId, productId, phoneNo);
log.info("=findProductLoginEntity -> {}", JSON.toJSONString(productLoginEntity)); log.info("=findProductLoginEntity -> {}", JSON.toJSONString(findProductLoginEntity));
long uuid = 0L; long uuid = 0L;
// 如果找不到该用户就创建 // 如果找不到该用户就创建
if (productLoginEntity == null) { if (findProductLoginEntity == null) {
// 添加用户到产品登录表 // 添加用户到产品登录表
long customerId = atomicSequencer.nextId(); long customerId = atomicSequencer.nextId();
// long id = session.nextId(); // long id = session.nextId();
...@@ -63,7 +63,7 @@ public class OauthLoginInfoServiceImpl implements IOauthLoginInfoService { ...@@ -63,7 +63,7 @@ public class OauthLoginInfoServiceImpl implements IOauthLoginInfoService {
uuid = RandomSequencer.randomUUID(customerId); uuid = RandomSequencer.randomUUID(customerId);
ProductLoginEntity entity = new ProductLoginEntity(); ProductLoginEntity entity = new ProductLoginEntity();
Integer partitionKey = atomicSequencer.partitionKey(customerId); Integer partitionKey = atomicSequencer.partitionKey(customerId);
productLoginEntity = EntityBuilder.productLogin(productId, institutionId, phoneNo, customerId, customerName, partitionKey, id); ProductLoginEntity productLoginEntity = EntityBuilder.productLogin(productId, institutionId, phoneNo, customerId, customerName, partitionKey, id);
productLoginEntity.setExtensionAccountId(userId); productLoginEntity.setExtensionAccountId(userId);
log.info("=addLoginInfo=save begin productLoginRepository={}", JSON.toJSONString(productLoginEntity)); log.info("=addLoginInfo=save begin productLoginRepository={}", JSON.toJSONString(productLoginEntity));
productLoginRepository.save(productLoginEntity); productLoginRepository.save(productLoginEntity);
......
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