Commit 8c4f8b55 authored by frank.xa.zhang's avatar frank.xa.zhang

fixed datasource detail collect, then go to font-end put it to UI

parent e6bd41d9
......@@ -32,17 +32,14 @@ public class DataSourceDto {
// 1: Number, 2: Percentage, 3: Boolean, 4: String
Integer resultType;
Integer type;
String keyValueDataID;
String creator;
Date createTime;
String updater;
Date updateTime;
String cellDataID;
List<String> items;
String projectID;
String serviceTypeID;
}
......@@ -4,10 +4,13 @@ import lombok.Getter;
import lombok.Setter;
import pwc.taxtech.atms.vat.entity.DataSource;
import java.util.List;
@Getter
@Setter
public class DataSourceExtendDto extends DataSource {
private Integer operationType;
private Long cellTemplateID;
private Long cellDataID;
private List<String> items;
}
......@@ -291,8 +291,8 @@ public class ReportGeneratorImpl extends VatAbstractService implements ReportGen
//after insert celldata, insert the celldatasource for link celldata and datasource
DataSourceExample dataSourceExample = new DataSourceExample();
dataSourceExample.createCriteria().andPeriodEqualTo(period);
dataSourceExample.createCriteria().andCellTemplateIdEqualTo(tempPeriodCellTemplate.get().getCellTemplateId());
dataSourceExample.createCriteria().andPeriodEqualTo(period)
.andCellTemplateIdEqualTo(tempPeriodCellTemplate.get().getCellTemplateId());
List<DataSource> dataSourceList = SpringContextUtil.dataSourceMapper.selectByExample(dataSourceExample);
for (int ii = 0; ii < dataSourceList.size(); ii++) {
DataSource dataSource = dataSourceList.get(ii);
......
......@@ -333,7 +333,6 @@ public class ReportServiceImpl extends VatAbstractService implements ReportServi
.andIsActiveAssociationEqualTo(true);
List<PeriodTemplate> reportTemplates = periodTemplateMapper.selectByExample(example);
List<Long> templateIDs = new ArrayList<>();
templateIDs.add(report.getTemplateId());
List<CellCalcInfoDto> cellCfgList = reportGenerator.getCellCalcInfo(templateIDs, report.getPeriod());
......@@ -344,7 +343,7 @@ public class ReportServiceImpl extends VatAbstractService implements ReportServi
List<CellData> currentCellDataList = cellDataMapper.selectByExample(cellDataExample);
PeriodFormulaBlockExample periodFormulaBlockExample = new PeriodFormulaBlockExample();
periodFormulaBlockExample.createCriteria().andPeriodEqualTo(report.getPeriod());
periodFormulaBlockExample.createCriteria().andPeriodEqualTo(report.getPeriod()).andReportIdEqualTo(reportId);
List<PeriodFormulaBlock> formulaBlocks = periodFormulaBlockMapper.selectByExample(periodFormulaBlockExample);
dataDto.setFormulaBlocks(formulaBlocks);
//todo: 关键字数据源稍后再加
......@@ -379,6 +378,17 @@ public class ReportServiceImpl extends VatAbstractService implements ReportServi
//公式计算数据源 20180711 完成
List<DataSourceExtendDto> manualDataSourceList = dataSourceMapper.getFormulaDataSource(reportId);
//loop the datasource to add datasource detail information
for (DataSourceExtendDto dseo : manualDataSourceList) {
//dseo.getCellDataID()
DataSourceDetailExample dataSourceDetailExample = new DataSourceDetailExample();
dataSourceDetailExample.createCriteria().andDataSourceIdEqualTo(dseo.getId());
List<DataSourceDetail> dataSourceDetailList = dataSourceDetailMapper.selectByExample(dataSourceDetailExample);
List<String> itemValues = new ArrayList<>();
dataSourceDetailList.forEach(a -> itemValues.add(a.getItemValue()));
dseo.setItems(itemValues);
}
Map<Long, DataSourceDto> datasource = new IdentityHashMap<>();
manualDataSourceList.forEach(a -> {
DataSourceDto dataSourceDto = new DataSourceDto();
......@@ -389,6 +399,8 @@ public class ReportServiceImpl extends VatAbstractService implements ReportServi
dataSourceDto.setDataSourceType(a.getType());
dataSourceDto.setDescription(a.getDescription());
dataSourceDto.setCreateTime(a.getCreateTime());
dataSourceDto.setType(a.getType());
dataSourceDto.setItems(a.getItems());
datasource.put(a.getCellTemplateID(), dataSourceDto);
});
dataDto.setManualDataSources(datasource);
......
......@@ -9,12 +9,10 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import pwc.taxtech.atms.common.util.SpringContextUtil;
import pwc.taxtech.atms.constant.enums.FormulaDataSourceDetailType;
import pwc.taxtech.atms.vat.entity.DataSource;
import pwc.taxtech.atms.vat.entity.DataSourceDetail;
import pwc.taxtech.atms.vat.entity.PeriodCellTemplateExample;
import pwc.taxtech.atms.vat.entity.PeriodFormulaBlock;
import pwc.taxtech.atms.vat.entity.*;
import pwc.taxtech.atms.vat.service.impl.FormulaAgent;
import java.lang.reflect.Type;
import java.math.BigDecimal;
import java.util.Date;
import java.util.HashMap;
......
......@@ -88,7 +88,7 @@ public class GZSD extends FunctionBase implements FreeRefFunction {
List<FormulaDataSourceDto> dataSourceDtoList = new ArrayList<>();
FormulaDataSourceDto formulaDataSourceDto = new FormulaDataSourceDto();
formulaDataSourceDto.setOperationType(EnumOperationType.Single.getCode());
formulaDataSourceDto.setType(FormulaDataSourceType.Other.getCode());
formulaDataSourceDto.setType(FormulaDataSourceType.Report.getCode());
formulaDataSourceDto.setResultType(KeyValueConfigResultType.Percentage.getCode());
formulaDataSourceDto.setAmount(matchedRule.get().getTaxRate());
formulaDataSourceDto.setName(nf.format(matchedRule.get().getTaxRate()));
......
......@@ -1046,7 +1046,7 @@
// $scope.isShowUpdateCell = false;
//}
});
}
};
var loadCellData = function (period) {
if ($scope.isBSPL) {
......
......@@ -40,7 +40,6 @@
}
}
if ($scope.hasTaxReturnPermission && $scope.hasQueryTaxReturnPermission) {
// 获取 申报表 Report Template
var taxRtnGrp = {
......
......@@ -13,7 +13,9 @@
<div class="divider"></div>
<div ng-show="group.isExpand" class="animate-show-hide">
<div class="li tree" ng-repeat="menu in group.children">
<a ui-sref-active="active" data-template-id="{{menu.id}}" ng-class="{'active':selectedTemplateId===menu.id}" ui-sref=".reportView({ id: menu.reportId, templateid: menu.id, name:menu.name,templatecode:menu.code })" ng-bind-html="::menu.name"></a>
<a ui-sref-active="active" data-template-id="{{menu.id}}" ng-class="{'active':selectedTemplateId===menu.id}"
ui-sref=".reportView({ id: menu.reportId, templateid: menu.id, name:menu.name,templatecode:menu.code })"
ng-bind-html="::menu.name"></a>
</div>
</div>
</li>
......
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