Commit 0d4a1072 authored by gary's avatar gary

1、fixbug

parent 0f65d57f
...@@ -26,6 +26,7 @@ import java.io.IOException; ...@@ -26,6 +26,7 @@ import java.io.IOException;
import java.lang.reflect.Field; import java.lang.reflect.Field;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.*; import java.util.*;
import java.util.stream.Collectors;
/** /**
* @Auther: Gary J Li * @Auther: Gary J Li
...@@ -65,7 +66,6 @@ public class DataInitTest extends CommonIT { ...@@ -65,7 +66,6 @@ public class DataInitTest extends CommonIT {
e.printStackTrace(); e.printStackTrace();
} }
JSONObject object = JSONObject.parseObject(input); JSONObject object = JSONObject.parseObject(input);
Map<String, Object> orgs = object.getInnerMap(); Map<String, Object> orgs = object.getInnerMap();
Map<String, Object> failList = new HashMap<>(); Map<String, Object> failList = new HashMap<>();
...@@ -104,7 +104,13 @@ public class DataInitTest extends CommonIT { ...@@ -104,7 +104,13 @@ public class DataInitTest extends CommonIT {
equityInfo.setPayableContributionProportion(Float.valueOf((investmentRadio.replace("%", "")))); equityInfo.setPayableContributionProportion(Float.valueOf((investmentRadio.replace("%", ""))));
} }
} else if ("payableCapitalContributionAmount".equals(OrgKV.Map.get(eK))) { } else if ("payableCapitalContributionAmount".equals(OrgKV.Map.get(eK))) {
equityInfo.setPayableCapitalContributionAmount((long) Double.parseDouble(((String) eV).trim())); String payableCapitalContributionAmount = ((String) eV).trim();
if(payableCapitalContributionAmount.contains(",")){
double res = Arrays.asList(payableCapitalContributionAmount.split(",")).stream().mapToDouble(Double::parseDouble).sum();
equityInfo.setPayableCapitalContributionAmount((long) res);
}else{
equityInfo.setPayableCapitalContributionAmount("-".equals(payableCapitalContributionAmount) ?0:(long) Double.parseDouble(payableCapitalContributionAmount));
}
} else if ("investorName".equals(OrgKV.Map.get(eK))) { } else if ("investorName".equals(OrgKV.Map.get(eK))) {
String investorName = (String) eV; String investorName = (String) eV;
if (investorName.contains("公司")) { if (investorName.contains("公司")) {
...@@ -127,14 +133,14 @@ public class DataInitTest extends CommonIT { ...@@ -127,14 +133,14 @@ public class DataInitTest extends CommonIT {
double res = Arrays.asList(investmentAmountStr.split(",")).stream().mapToDouble(Double::parseDouble).sum(); double res = Arrays.asList(investmentAmountStr.split(",")).stream().mapToDouble(Double::parseDouble).sum();
equityInfo.setInvestmentAmount((long) res); equityInfo.setInvestmentAmount((long) res);
}else{ }else{
equityInfo.setInvestmentAmount((long) Double.parseDouble(investmentAmountStr)); equityInfo.setInvestmentAmount("-".equals(investmentAmountStr) ?0:(long) Double.parseDouble(investmentAmountStr));
} }
if(equityInfo.getPayableCapitalContributionAmount()==null){ if(equityInfo.getPayableCapitalContributionAmount()==null){
if(investmentAmountStr.contains(",")){ if(investmentAmountStr.contains(",")){
double res = Arrays.asList(investmentAmountStr.split(",")).stream().mapToDouble(Double::parseDouble).sum(); double res = Arrays.asList(investmentAmountStr.split(",")).stream().mapToDouble(Double::parseDouble).sum();
equityInfo.setPayableCapitalContributionAmount((long) res); equityInfo.setPayableCapitalContributionAmount((long) res);
}else{ }else{
equityInfo.setPayableCapitalContributionAmount((long) Double.parseDouble(investmentAmountStr)); equityInfo.setPayableCapitalContributionAmount("-".equals(investmentAmountStr) ?0:(long) Double.parseDouble(investmentAmountStr));
} }
} }
} else if (null != OrgKV.Map.get(eK)) { } else if (null != OrgKV.Map.get(eK)) {
...@@ -170,7 +176,13 @@ public class DataInitTest extends CommonIT { ...@@ -170,7 +176,13 @@ public class DataInitTest extends CommonIT {
equityInfo.setPayableContributionProportion(Float.valueOf((investmentRadio.replace("%", "")))); equityInfo.setPayableContributionProportion(Float.valueOf((investmentRadio.replace("%", ""))));
} }
} else if ("payableCapitalContributionAmount".equals(OrgKV.Map.get(eK))) { } else if ("payableCapitalContributionAmount".equals(OrgKV.Map.get(eK))) {
equityInfo.setPayableCapitalContributionAmount((long) Double.parseDouble(((String) eV).trim())); String payableCapitalContributionAmount = ((String) eV).trim();
if(payableCapitalContributionAmount.contains(",")){
double res = Arrays.asList(payableCapitalContributionAmount.split(",")).stream().mapToDouble(Double::parseDouble).sum();
equityInfo.setPayableCapitalContributionAmount((long) res);
}else{
equityInfo.setPayableCapitalContributionAmount("-".equals(payableCapitalContributionAmount) ?0:(long) Double.parseDouble(payableCapitalContributionAmount));
}
} else if ("investorName".equals(OrgKV.Map.get(eK))) { } else if ("investorName".equals(OrgKV.Map.get(eK))) {
String investorName = (String) eV; String investorName = (String) eV;
if (investorName.contains("公司")) { if (investorName.contains("公司")) {
...@@ -193,14 +205,14 @@ public class DataInitTest extends CommonIT { ...@@ -193,14 +205,14 @@ public class DataInitTest extends CommonIT {
double res = Arrays.asList(investmentAmountStr.split(",")).stream().mapToDouble(Double::parseDouble).sum(); double res = Arrays.asList(investmentAmountStr.split(",")).stream().mapToDouble(Double::parseDouble).sum();
equityInfo.setInvestmentAmount((long) res); equityInfo.setInvestmentAmount((long) res);
}else{ }else{
equityInfo.setInvestmentAmount((long) Double.parseDouble(investmentAmountStr)); equityInfo.setInvestmentAmount("-".equals(investmentAmountStr) ?0:(long) Double.parseDouble(investmentAmountStr));
} }
if(equityInfo.getPayableCapitalContributionAmount()==null){ if(equityInfo.getPayableCapitalContributionAmount()==null){
if(investmentAmountStr.contains(",")){ if(investmentAmountStr.contains(",")){
double res = Arrays.asList(investmentAmountStr.split(",")).stream().mapToDouble(Double::parseDouble).sum(); double res = Arrays.asList(investmentAmountStr.split(",")).stream().mapToDouble(Double::parseDouble).sum();
equityInfo.setPayableCapitalContributionAmount((long) res); equityInfo.setPayableCapitalContributionAmount((long) res);
}else{ }else{
equityInfo.setPayableCapitalContributionAmount((long) Double.parseDouble(investmentAmountStr)); equityInfo.setPayableCapitalContributionAmount("-".equals(investmentAmountStr) ?0:(long) Double.parseDouble(investmentAmountStr));
} }
} }
} else if (null != OrgKV.Map.get(eK)) { } else if (null != OrgKV.Map.get(eK)) {
...@@ -323,6 +335,7 @@ public class DataInitTest extends CommonIT { ...@@ -323,6 +335,7 @@ public class DataInitTest extends CommonIT {
} }
}); });
} catch (Exception e) { } catch (Exception e) {
logger.error(String.format("机构:[%s]导入异常",orgK),e);
failMsg.append(e.getMessage()+"\n"); failMsg.append(e.getMessage()+"\n");
failList.putIfAbsent(orgK, orgV); failList.putIfAbsent(orgK, orgV);
} }
...@@ -346,9 +359,20 @@ public class DataInitTest extends CommonIT { ...@@ -346,9 +359,20 @@ public class DataInitTest extends CommonIT {
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); e.printStackTrace();
} }
System.out.println(String.format("成功条数[%s]", orgs.size()));
System.out.println(String.format("失败条数[%s]", failList.size())); System.out.println(String.format("失败条数[%s]", failList.size()));
} }
@Test
public void syncOrg(){
List<String> taxPayNums= organizationMapper.selectByExample(new OrganizationExample()).stream().map(Organization::getTaxPayerNumber).collect(Collectors.toList());
/**
* 1、taxPayNums http 滴滴oa接口同步机构的信息
* 2、逐条update,记录更新失败或未更新上的taxPayNum
* 3、失败的再次处理
*/
}
private void setProperty(Object obj, String propertyName, Object value) { private void setProperty(Object obj, String propertyName, Object value) {
try{ try{
Class c = obj.getClass(); Class c = obj.getClass();
......
...@@ -98,7 +98,7 @@ ...@@ -98,7 +98,7 @@
</div> </div>
<div class="form-group"> <div class="form-group">
<div class="col-sm-12"> <div class="col-sm-12">
<span class="">{{'LegalPersonName' | translate}}:{{selectCompanyExtra.legalPersonName}}</span> <span class="">{{'LegalPersonName' | translate}}:{{selectCompany.legalPersonName}}</span>
</div> </div>
</div> </div>
<div class="form-group" ng-show="!isInternational"> <div class="form-group" ng-show="!isInternational">
...@@ -121,8 +121,8 @@ ...@@ -121,8 +121,8 @@
</div> </div>
<div class="form-group" ng-show="!isInternational"> <div class="form-group" ng-show="!isInternational">
<div class="col-sm-12"> <div class="col-sm-12">
<span class="control-label"> {{'RegistrationLocation' | translate}}:<span <span class="control-label"> {{'RegistrationAddress' | translate}}:<span
title="{{selectCompany.registrationLocation}}">{{selectCompany.registrationLocation }}</span></span> title="{{selectCompany.registerAddress}}">{{selectCompany.registerAddress }}</span></span>
</div> </div>
</div> </div>
<div class="form-group" > <div class="form-group" >
...@@ -184,7 +184,7 @@ ...@@ -184,7 +184,7 @@
</div> </div>
<div class="form-group" > <div class="form-group" >
<div class="col-sm-12"> <div class="col-sm-12">
<span class="control-label"> {{'RegistrationLocationEn' | translate}}:<span <span class="control-label"> {{'RegistrationAddressEn' | translate}}:<span
title="{{selectCompany.registrationLocationEn}}">{{selectCompany.registrationLocationEn }}</span></span> title="{{selectCompany.registrationLocationEn}}">{{selectCompany.registrationLocationEn }}</span></span>
</div> </div>
</div> </div>
......
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