Commit a96649e9 by lzxry

合同编号格式化取数字bugfix

parent 39d0bf62
...@@ -15,6 +15,7 @@ import tkio.repository.AccountRepository; ...@@ -15,6 +15,7 @@ import tkio.repository.AccountRepository;
import tkio.repository.AppRepository; import tkio.repository.AppRepository;
import tkio.service.AccountFlowRestrictService; import tkio.service.AccountFlowRestrictService;
import util.DateUtil; import util.DateUtil;
import util.StringUtil;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.math.BigInteger; import java.math.BigInteger;
...@@ -55,7 +56,6 @@ public class TrackingFlowTask { ...@@ -55,7 +56,6 @@ public class TrackingFlowTask {
tkioFlowRepository.deleteByEmail(calculationFlow.getEmail()); tkioFlowRepository.deleteByEmail(calculationFlow.getEmail());
String email = calculationFlow.getEmail(); String email = calculationFlow.getEmail();
//查询用户下所有appkey //查询用户下所有appkey
try{ try{
Account account = accountRepository.findByEmail(email); Account account = accountRepository.findByEmail(email);
List<Account> accountList = accountRepository.findByRootParent(account.getRootParent()); List<Account> accountList = accountRepository.findByRootParent(account.getRootParent());
...@@ -325,8 +325,9 @@ public class TrackingFlowTask { ...@@ -325,8 +325,9 @@ public class TrackingFlowTask {
contractsArray[j] = contractsArray[j+1]; contractsArray[j] = contractsArray[j+1];
contractsArray[j + 1] = temp; contractsArray[j + 1] = temp;
}else if(DateUtil.getDate(contractsArray[j].getStartDate()).getTime() == DateUtil.getDate(contractsArray[j + 1].getStartDate()).getTime()){ }else if(DateUtil.getDate(contractsArray[j].getStartDate()).getTime() == DateUtil.getDate(contractsArray[j + 1].getStartDate()).getTime()){
String contractCode = contractsArray[j].getContractCode().replaceAll("BJ-TKIO-", "").replaceAll("-", "");
String contractCodeMin = contractsArray[j + 1].getContractCode().replaceAll("BJ-TKIO-", "").replaceAll("-", ""); String contractCode = StringUtil.matchNumber(contractsArray[j].getContractCode());
String contractCodeMin = StringUtil.matchNumber(contractsArray[j+ 1].getContractCode());
if(Long.valueOf(contractCode)>Long.valueOf(contractCodeMin)){ if(Long.valueOf(contractCode)>Long.valueOf(contractCodeMin)){
Contract temp = contractsArray[j]; Contract temp = contractsArray[j];
contractsArray[j] = contractsArray[j+1]; contractsArray[j] = contractsArray[j+1];
......
...@@ -302,4 +302,21 @@ public class StringUtil { ...@@ -302,4 +302,21 @@ public class StringUtil {
return resultList; return resultList;
} }
/**
* 功能描述:
* @author liyin
* @date 2020/10/30
*/
public static String matchNumber(String str) {
str = str.trim();
String str2 = "";
if (str != null && !"".equals(str)) {
for (int i = 0; i < str.length(); i++) {
if (str.charAt(i) >= 48 && str.charAt(i) <= 57) {
str2 += str.charAt(i);
}
}
}
return str2;
}
} }
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