Skip to content

Commit

Permalink
Merge pull request #617 from WeBankFinTech/dev
Browse files Browse the repository at this point in the history
fix contract store id sequence
  • Loading branch information
mingzhenliu authored Jun 2, 2021
2 parents 0c98316 + 88fc83e commit b99b81d
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,9 @@ public void insertStoreItem(long storeId, String storeName, String StoreName_en,
String StoreIcon, String StoreDesc, String StoreDetail,String StoreDesc_en,
String StoreDetail_en)
{
log.info("insert storeItem id:{},storeName:{}", storeId, storeName);
if (contractStoreRepository.exists(storeId)) {
log.info("insertStoreItem skip storeId:{} storeName:{} already exist", storeId, storeName);
log.info("insertStoreItem skip storeId:{} already exist", storeId);
return;
}
StoreItem storeItem = new StoreItem();
Expand All @@ -73,7 +74,7 @@ public void insertStoreItem(long storeId, String storeName, String StoreName_en,
}

public void initContractFolderItem() {
Integer contractFolderIndex = 1;
int contractFolderIndex = 1;
insertContractFolderItem(contractFolderIndex++,toolboxId,"Tools",
"工具箱中有常用的工具合约",
"工具箱中有常用的工具合约",
Expand Down Expand Up @@ -108,9 +109,9 @@ public void initContractFolderItem() {
public void insertContractFolderItem(long contractFolderId, long storeId, String contractFolderName, String contractFolderDesc, String contractFolderDetail,
String contractFolderDesc_en, String contractFolderDetail_en)
{
log.info("insert contractFolderItem id:{},contractFolderName:{} ", contractFolderId, contractFolderName);
if (contractFolderRepository.exists(contractFolderId)) {
log.info("insertContractFolderItem skip contractFolderId:{} contractFolderName:{} storeId:{} already exist",
contractFolderId, contractFolderName, storeId);
log.info("insertContractFolderItem skip contractFolderId:{} already exist", contractFolderId);
return;
}
ContractFolderItem contractFolderItem = new ContractFolderItem();
Expand All @@ -127,7 +128,7 @@ public void insertContractFolderItem(long contractFolderId, long storeId, String
}

public void initContractItem() {
Integer contractIndex = 1;
int contractIndex = 1;
//tools
insertContractItem(contractIndex++,toolboxId,"Address",ToolsConstantContext.ADDRESS_SOURCE,
ToolsConstantContext.ADDRESS_MD,ToolsConstantContext.ADDRESS_MD);
Expand Down Expand Up @@ -193,9 +194,9 @@ public void initContractItem() {
public void insertContractItem(long contractId, long contractFolderId, String contractName, String contractSrc,
String contractDesc, String contractDesc_en)
{
log.info("insert contractItem id:{},contractName:{}", contractId, contractName);
if (contractItemRepository.exists(contractId)) {
log.debug("insertContractItem skip contractId:{} contractName:{} contractFolderId:{} already exist",
contractId, contractName, contractFolderId);
log.info("insertContractItem skip contractId:{} already exist", contractId);
return;
}
ContractItem contractItem = new ContractItem();
Expand All @@ -215,23 +216,6 @@ public void initPresetData()
initContractItem();
initContractFolderItem();
initStoreItem();
// List<ContractItem> contracts = contractItemRepository.findAll();
// if(contracts.size() <= 0)
// {
// initContractItem();
// }
//
// List<ContractFolderItem> contractFolderItemList = contractFolderRepository.findAll();
// if(contractFolderItemList.size() <= 0)
// {
// initContractFolderItem();
// }
//
// List<StoreItem> storeItemList = contractStoreRepository.findAll();
// if(storeItemList.size() <= 0)
// {
// initStoreItem();
// }
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
})
public class ContractFolderItem {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private Long contractFolderId;
private Long storeId;
private String contractFolderName;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
})
public class ContractItem {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private Long contractId;
private Long contractFolderId;
private String contractName;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
})
public class StoreItem {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private Long storeId;
private String storeName;
private String storeName_en;
Expand Down

0 comments on commit b99b81d

Please sign in to comment.