Commit 0a860d94 authored by frank.xa.zhang's avatar frank.xa.zhang

add the code for KeyValueConfiguration

parent 636009bb
......@@ -6,6 +6,9 @@ import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.session.RowBounds;
import org.springframework.security.access.method.P;
import pwc.taxtech.atms.MyMapper;
import pwc.taxtech.atms.dto.AnalyticsModelDetail;
import pwc.taxtech.atms.dto.FinancialStatementDetail;
import pwc.taxtech.atms.dto.TaxReturnDetail;
import pwc.taxtech.atms.entitiy.KeyValueReference;
import pwc.taxtech.atms.entitiy.KeyValueReferenceExample;
......@@ -108,4 +111,10 @@ public interface KeyValueReferenceMapper extends MyMapper {
int updateByPrimaryKey(KeyValueReference record);
int deleteKeyValueReferenceByCellTemplate(@Param("templateDbID") String templateDbID);
List<FinancialStatementDetail> getFinancialStatementDetails(@Param("configurationID") String configurationID);
List<TaxReturnDetail> getTaxReturnDetails(@Param("configurationID") String configurationID);
List<AnalyticsModelDetail> getAnalyticsModelDetails(@Param("configurationID") String configurationID);
}
\ No newline at end of file
......@@ -59,4 +59,12 @@ public class AnalyticsModelDetail {
public void setIndustry(String industry) {
this.industry = industry;
}
public String getEntityID() {
return entityID;
}
public void setEntityID(String entityID) {
this.entityID = entityID;
}
}
......@@ -72,17 +72,38 @@ public class KeyValueConfigServiceImpl extends AbstractService implements KeyVal
@Override
public List<FinancialStatementDetail> getFinacialStatement(String configurationID) {
return null;
Map<String, String> jointObjectMap = new HashMap<>();
industryMapper.selectByExample(new IndustryExample()).forEach(a -> jointObjectMap.put(a.getID(), a.getName()));
List<FinancialStatementDetail> referenceFinance = keyValueReferenceMapper.getFinancialStatementDetails(configurationID);
for (FinancialStatementDetail item : referenceFinance) {
item.setIndustry(getNamesByIDs(item.getIndustry(), jointObjectMap));
}
return referenceFinance;
}
@Override
public List<TaxReturnDetail> getTaxReturn(String configurationID) {
return null;
Map<String, String> jointObjectMap = new HashMap<>();
industryMapper.selectByExample(new IndustryExample()).forEach(a -> jointObjectMap.put(a.getID(), a.getName()));
List<TaxReturnDetail> referenceTax = keyValueReferenceMapper.getTaxReturnDetails(configurationID);
for (TaxReturnDetail item : referenceTax) {
item.setIndustry(getNamesByIDs(item.getIndustry(), jointObjectMap));
}
return referenceTax;
}
@Override
public List<AnalyticsModelDetail> getAnalyticsModel(String configurationID) {
return null;
Map<String, String> industryList = new HashMap<>();
industryMapper.selectByExample(new IndustryExample()).forEach(a -> industryList.put(a.getID(), a.getName()));
Map<String, String> organization = new HashMap<>();
organizationMapper.selectByExample(new OrganizationExample()).forEach(a -> organization.put(a.getID(), a.getName()));
List<AnalyticsModelDetail> referenceModel = keyValueReferenceMapper.getAnalyticsModelDetails(configurationID);
for (AnalyticsModelDetail analyticsModelDetail : referenceModel) {
analyticsModelDetail.setIndustry(getNamesByIDs(analyticsModelDetail.getIndustry(), industryList));
analyticsModelDetail.setEntityName(getNamesByIDs(analyticsModelDetail.getEntityID(), organization));
}
return referenceModel;
}
@Override
......
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