Commit b202a470 authored by frank.xa.zhang's avatar frank.xa.zhang

Merge branch 'dev_oracle' into dev_oracle_frank

# Conflicts:
#	atms-api/src/main/java/pwc/taxtech/atms/vat/service/impl/ReportServiceImpl.java
#	atms-dao/src/main/java/pwc/taxtech/atms/vat/dao/PeriodDataSourceMapper.java
#	atms-dao/src/main/resources/pwc/taxtech/atms/vat/dao/extends/PeriodDataSourceExtendsMapper.xml
parents 225e4abf 1730f6ac
...@@ -14,6 +14,15 @@ ...@@ -14,6 +14,15 @@
</parent> </parent>
<dependencies> <dependencies>
<!-- https://mvnrepository.com/artifact/com.oracle/ojdbc6 -->
<dependency>
<groupId>com.oracle</groupId>
<artifactId>ojdbc</artifactId>
<version>0.0.1</version>
</dependency>
<dependency> <dependency>
<groupId>pwc.taxtech.atms</groupId> <groupId>pwc.taxtech.atms</groupId>
<artifactId>atms-dao</artifactId> <artifactId>atms-dao</artifactId>
......
...@@ -9,6 +9,8 @@ import pwc.taxtech.atms.dao.OrganizationMapper; ...@@ -9,6 +9,8 @@ import pwc.taxtech.atms.dao.OrganizationMapper;
import pwc.taxtech.atms.dao.ProjectDao; import pwc.taxtech.atms.dao.ProjectDao;
import pwc.taxtech.atms.dao.ProjectMapper; import pwc.taxtech.atms.dao.ProjectMapper;
import pwc.taxtech.atms.dao.ProjectServiceTypeMapper; import pwc.taxtech.atms.dao.ProjectServiceTypeMapper;
import pwc.taxtech.atms.invoice.InputInvoiceMapper;
import pwc.taxtech.atms.invoice.OutputInvoiceMapper;
import pwc.taxtech.atms.service.impl.DistributedIdService; import pwc.taxtech.atms.service.impl.DistributedIdService;
import pwc.taxtech.atms.vat.dao.*; import pwc.taxtech.atms.vat.dao.*;
...@@ -30,19 +32,21 @@ public class SpringContextUtil implements ApplicationContextAware { ...@@ -30,19 +32,21 @@ public class SpringContextUtil implements ApplicationContextAware {
public static PeriodStandardAccountMapper periodStandardAccountMapper; public static PeriodStandardAccountMapper periodStandardAccountMapper;
public static ProjectDao projectDao; public static ProjectDao projectDao;
public static BalanceMapper balanceMapper; public static BalanceMapper balanceMapper;
public static DataSourceMapper dataSourceMapper; // public static DataSourceMapper dataSourceMapper;
public static PeriodDataSourceMapper periodDataSourceMapper; public static PeriodDataSourceMapper periodDataSourceMapper;
public static DataSourceDetailMapper dataSourceDetailMapper; // public static DataSourceDetailMapper dataSourceDetailMapper;
public static PeriodDataSourceDetailMapper periodDataSourceDetailMapper; public static PeriodDataSourceDetailMapper periodDataSourceDetailMapper;
public static PeriodFormulaBlockMapper periodFormulaBlockMapper; public static PeriodFormulaBlockMapper periodFormulaBlockMapper;
public static VatEnterpriseAccountDao vatEnterpriseAccountDao; public static VatEnterpriseAccountDao vatEnterpriseAccountDao;
public static VatEnterpriseAccountMapper vatEnterpriseAccountMapper; public static VatEnterpriseAccountMapper vatEnterpriseAccountMapper;
public static PeriodEnterpriseAccountMapper periodEnterpriseAccountMapper; public static PeriodEnterpriseAccountMapper periodEnterpriseAccountMapper;
public static BalanceStdManualMapper balanceStdManualMapper; public static BalanceStdManualMapper balanceStdManualMapper;
public static OutputVatInvoiceMapper outputVATInvoiceMapper; // public static OutputVatInvoiceMapper outputVATInvoiceMapper;
public static OutputInvoiceMapper outputInvoiceMapper;
public static PeriodTaxRuleSettingMapper periodTaxRuleSettingMapper; public static PeriodTaxRuleSettingMapper periodTaxRuleSettingMapper;
public static InputVatInvoiceDao inputVatInvoiceDao; public static InputInvoiceDao inputInvoiceDao;
public static InputVatInvoiceMapper inputVATInvoiceMapper; // public static InputVatInvoiceMapper inputVATInvoiceMapper;
public static InputInvoiceMapper inputInvoiceMapper;
public static AssetsListMapper assetsListMapper; public static AssetsListMapper assetsListMapper;
public static ProjectMapper projectMapper; public static ProjectMapper projectMapper;
public static CellDataSourceMapper cellDataSourceMapper; public static CellDataSourceMapper cellDataSourceMapper;
...@@ -72,23 +76,23 @@ public class SpringContextUtil implements ApplicationContextAware { ...@@ -72,23 +76,23 @@ public class SpringContextUtil implements ApplicationContextAware {
periodCellTemplateMapper = webApplicationContext.getBean(PeriodCellTemplateMapper.class); periodCellTemplateMapper = webApplicationContext.getBean(PeriodCellTemplateMapper.class);
projectServiceTypeMapper = webApplicationContext.getBean(ProjectServiceTypeMapper.class); projectServiceTypeMapper = webApplicationContext.getBean(ProjectServiceTypeMapper.class);
periodTemplateMapper = webApplicationContext.getBean(PeriodTemplateMapper.class); periodTemplateMapper = webApplicationContext.getBean(PeriodTemplateMapper.class);
periodStandardAccountMapper = webApplicationContext.getBean(PeriodStandardAccountMapper.class); // periodStandardAccountMapper = webApplicationContext.getBean(PeriodStandardAccountMapper.class);
periodStandardAccountMapper = webApplicationContext.getBean(PeriodStandardAccountMapper.class); periodStandardAccountMapper = webApplicationContext.getBean(PeriodStandardAccountMapper.class);
projectDao = webApplicationContext.getBean(ProjectDao.class); projectDao = webApplicationContext.getBean(ProjectDao.class);
balanceMapper = webApplicationContext.getBean(BalanceMapper.class); balanceMapper = webApplicationContext.getBean(BalanceMapper.class);
dataSourceMapper = webApplicationContext.getBean(DataSourceMapper.class); // dataSourceMapper = webApplicationContext.getBean(DataSourceMapper.class);
periodDataSourceMapper = webApplicationContext.getBean(PeriodDataSourceMapper.class); periodDataSourceMapper = webApplicationContext.getBean(PeriodDataSourceMapper.class);
dataSourceDetailMapper = webApplicationContext.getBean(DataSourceDetailMapper.class); // dataSourceDetailMapper = webApplicationContext.getBean(DataSourceDetailMapper.class);
periodDataSourceDetailMapper = webApplicationContext.getBean(PeriodDataSourceDetailMapper.class); periodDataSourceDetailMapper = webApplicationContext.getBean(PeriodDataSourceDetailMapper.class);
periodFormulaBlockMapper = webApplicationContext.getBean(PeriodFormulaBlockMapper.class); periodFormulaBlockMapper = webApplicationContext.getBean(PeriodFormulaBlockMapper.class);
vatEnterpriseAccountDao = webApplicationContext.getBean(VatEnterpriseAccountDao.class); vatEnterpriseAccountDao = webApplicationContext.getBean(VatEnterpriseAccountDao.class);
vatEnterpriseAccountMapper = webApplicationContext.getBean(VatEnterpriseAccountMapper.class); vatEnterpriseAccountMapper = webApplicationContext.getBean(VatEnterpriseAccountMapper.class);
periodEnterpriseAccountMapper = webApplicationContext.getBean(PeriodEnterpriseAccountMapper.class); periodEnterpriseAccountMapper = webApplicationContext.getBean(PeriodEnterpriseAccountMapper.class);
balanceStdManualMapper = webApplicationContext.getBean(BalanceStdManualMapper.class); balanceStdManualMapper = webApplicationContext.getBean(BalanceStdManualMapper.class);
outputVATInvoiceMapper = webApplicationContext.getBean(OutputVatInvoiceMapper.class); outputInvoiceMapper = webApplicationContext.getBean(OutputInvoiceMapper.class);
periodTaxRuleSettingMapper = webApplicationContext.getBean(PeriodTaxRuleSettingMapper.class); periodTaxRuleSettingMapper = webApplicationContext.getBean(PeriodTaxRuleSettingMapper.class);
inputVatInvoiceDao = webApplicationContext.getBean(InputVatInvoiceDao.class); inputInvoiceDao = webApplicationContext.getBean(InputInvoiceDao.class);
inputVATInvoiceMapper = webApplicationContext.getBean(InputVatInvoiceMapper.class); inputInvoiceMapper = webApplicationContext.getBean(InputInvoiceMapper.class);
assetsListMapper = webApplicationContext.getBean(AssetsListMapper.class); assetsListMapper = webApplicationContext.getBean(AssetsListMapper.class);
projectMapper = webApplicationContext.getBean(ProjectMapper.class); projectMapper = webApplicationContext.getBean(ProjectMapper.class);
cellDataSourceMapper = webApplicationContext.getBean(CellDataSourceMapper.class); cellDataSourceMapper = webApplicationContext.getBean(CellDataSourceMapper.class);
......
...@@ -4,8 +4,8 @@ import com.fasterxml.jackson.annotation.JsonProperty; ...@@ -4,8 +4,8 @@ import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Getter; import lombok.Getter;
import lombok.Setter; import lombok.Setter;
import pwc.taxtech.atms.dto.CellTemplateConfigDto; import pwc.taxtech.atms.dto.CellTemplateConfigDto;
import pwc.taxtech.atms.vat.entity.ModifiedReportCell;
import pwc.taxtech.atms.vat.entity.PeriodCellTemplateConfig; import pwc.taxtech.atms.vat.entity.PeriodCellTemplateConfig;
import pwc.taxtech.atms.vat.entity.PeriodModifiedReportCell;
import java.util.List; import java.util.List;
...@@ -58,7 +58,7 @@ public class CellCalcInfoDto { ...@@ -58,7 +58,7 @@ public class CellCalcInfoDto {
private Boolean isModified; private Boolean isModified;
//用户直接修改单元格的信息 //用户直接修改单元格的信息
private ModifiedReportCell modifiedReportCell; private PeriodModifiedReportCell modifiedReportCell;
private List<CellVoucherDatasourceDto> dataVoucherList; private List<CellVoucherDatasourceDto> dataVoucherList;
......
...@@ -4,7 +4,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; ...@@ -4,7 +4,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Getter; import lombok.Getter;
import lombok.Setter; import lombok.Setter;
import pwc.taxtech.atms.dto.CellTemplateConfigDto; import pwc.taxtech.atms.dto.CellTemplateConfigDto;
import pwc.taxtech.atms.vat.entity.ModifiedReportCell; import pwc.taxtech.atms.vat.entity.PeriodModifiedReportCell;
import java.util.List; import java.util.List;
...@@ -55,7 +55,7 @@ public class CellDataDto { ...@@ -55,7 +55,7 @@ public class CellDataDto {
private Boolean isModified; private Boolean isModified;
//用户直接修改单元格的信息 //用户直接修改单元格的信息
private ModifiedReportCell modifiedReportCell; private PeriodModifiedReportCell modifiedReportCell;
private List<CellVoucherDatasourceDto> dataVoucherList; private List<CellVoucherDatasourceDto> dataVoucherList;
......
...@@ -15,10 +15,22 @@ import pwc.taxtech.atms.dto.OperationResultDto; ...@@ -15,10 +15,22 @@ import pwc.taxtech.atms.dto.OperationResultDto;
import pwc.taxtech.atms.dto.TemplateDto; import pwc.taxtech.atms.dto.TemplateDto;
import pwc.taxtech.atms.dto.UpateNameParam; import pwc.taxtech.atms.dto.UpateNameParam;
import pwc.taxtech.atms.dto.vatdto.TemplateByGroupDto; import pwc.taxtech.atms.dto.vatdto.TemplateByGroupDto;
import pwc.taxtech.atms.entity.*; import pwc.taxtech.atms.entity.CellTemplate;
import pwc.taxtech.atms.entity.CellTemplateExample;
import pwc.taxtech.atms.entity.Project;
import pwc.taxtech.atms.entity.ProjectExample;
import pwc.taxtech.atms.entity.Template;
import pwc.taxtech.atms.entity.TemplateExample;
import pwc.taxtech.atms.entity.TemplateGroup;
import pwc.taxtech.atms.entity.TemplateGroupExample;
import pwc.taxtech.atms.service.TemplateService; import pwc.taxtech.atms.service.TemplateService;
import java.util.*; import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import static java.util.stream.Collectors.groupingBy; import static java.util.stream.Collectors.groupingBy;
...@@ -234,32 +246,32 @@ public class TemplateServiceImpl extends AbstractService implements TemplateServ ...@@ -234,32 +246,32 @@ public class TemplateServiceImpl extends AbstractService implements TemplateServ
@Override @Override
public OperationResultDto<List<TemplateByGroupDto>> getByGroupId(Long templateGroupId, String projectId) { public OperationResultDto<List<TemplateByGroupDto>> getByGroupId(Long templateGroupId, String projectId) {
OperationResultDto result = new OperationResultDto(); OperationResultDto result = new OperationResultDto();
Long bspl = getBSPLTemplateGroup(projectId); // Long bspl = getVatTemplateGroup(projectId);
TemplateExample example = new TemplateExample(); TemplateExample example = new TemplateExample();
List<Long> ids = new ArrayList<>(); List<Long> ids = new ArrayList<>();
ids.add(templateGroupId); ids.add(templateGroupId);
if(!bspl.equals(null)) { // if(!bspl.equals(null)) {
ids.add(bspl); // ids.add(bspl);
} // }
example.createCriteria().andTemplateGroupIdIn(ids); example.createCriteria().andTemplateGroupIdIn(ids);
example.setOrderByClause(" order_index"); example.setOrderByClause("order_index");
List<Template> templates = templateMapper.selectByExample(example); List<Template> templates = templateMapper.selectByExample(example);
List<TemplateByGroupDto> wrappList = new ArrayList<>(); List<TemplateByGroupDto> wrappList = new ArrayList<>();
if (bspl != null) { // if (bspl != null) {
TemplateByGroupDto bsplGroup = new TemplateByGroupDto(); // TemplateByGroupDto bsplGroup = new TemplateByGroupDto();
bsplGroup.setId(bspl); // bsplGroup.setId(bspl);
bsplGroup.setName(TemplateGroupType.FinancialReturn.name()); // bsplGroup.setName(TemplateGroupType.FinancialReturn.name());
List<TemplateDto> templateDtos = new ArrayList<>(); // List<TemplateDto> templateDtos = new ArrayList<>();
//
templates.stream().filter(x -> x.getTemplateGroupId().equals(bspl)).collect(Collectors.toList()).forEach(a -> { // templates.stream().filter(x -> x.getTemplateGroupId().equals(bspl)).collect(Collectors.toList()).forEach(a -> {
TemplateDto templateDto = new TemplateDto(); // TemplateDto templateDto = new TemplateDto();
CommonUtils.copyProperties(a, templateDto); // CommonUtils.copyProperties(a, templateDto);
templateDtos.add(templateDto); // templateDtos.add(templateDto);
}); // });
bsplGroup.setChildren(templateDtos); // bsplGroup.setChildren(templateDtos);
bsplGroup.setOrderIndex(1); // bsplGroup.setOrderIndex(1);
wrappList.add(bsplGroup); // wrappList.add(bsplGroup);
} // }
if (templateGroupId != null) { if (templateGroupId != null) {
TemplateByGroupDto taxReturnGroup = new TemplateByGroupDto(); TemplateByGroupDto taxReturnGroup = new TemplateByGroupDto();
...@@ -276,7 +288,7 @@ public class TemplateServiceImpl extends AbstractService implements TemplateServ ...@@ -276,7 +288,7 @@ public class TemplateServiceImpl extends AbstractService implements TemplateServ
wrappList.add(taxReturnGroup); wrappList.add(taxReturnGroup);
} }
if (bspl != null || templateGroupId != null) { if (templateGroupId != null) {
result.setResult(true); result.setResult(true);
result.setData(wrappList); result.setData(wrappList);
} else { } else {
...@@ -285,7 +297,7 @@ public class TemplateServiceImpl extends AbstractService implements TemplateServ ...@@ -285,7 +297,7 @@ public class TemplateServiceImpl extends AbstractService implements TemplateServ
return result; return result;
} }
private Long getBSPLTemplateGroup(String projectId) { private Long getVatTemplateGroup(String projectId) {
ProjectExample example = new ProjectExample(); ProjectExample example = new ProjectExample();
example.createCriteria().andIdEqualTo(projectId); example.createCriteria().andIdEqualTo(projectId);
List<Project> projects = projectMapper.selectByExample(example); List<Project> projects = projectMapper.selectByExample(example);
...@@ -295,10 +307,12 @@ public class TemplateServiceImpl extends AbstractService implements TemplateServ ...@@ -295,10 +307,12 @@ public class TemplateServiceImpl extends AbstractService implements TemplateServ
} }
List<TemplateGroup> allTemplateGroups = templateGroupMapper.selectByExample(new TemplateGroupExample()); List<TemplateGroup> allTemplateGroups = templateGroupMapper.selectByExample(new TemplateGroupExample());
Optional<TemplateGroup> bsplTemplateGroup = allTemplateGroups.stream().filter(a -> a.getIndustryIds().equals(industryId) && a.getGroupType().equals(TemplateGroupType.FinancialReturn.getCode())).findFirst(); Optional<TemplateGroup> bsplTemplateGroup = allTemplateGroups.stream().filter(a -> a.getIndustryIds().equals(industryId)
&& a.getGroupType().equals(TemplateGroupType.TaxReturn.getCode())).findFirst();
if (!bsplTemplateGroup.isPresent()) { if (!bsplTemplateGroup.isPresent()) {
bsplTemplateGroup = allTemplateGroups.stream().filter(a -> a.getIndustryIds().contains(industryId.get()) && a.getGroupType().equals(TemplateGroupType.FinancialReturn.getCode())).findFirst(); bsplTemplateGroup = allTemplateGroups.stream().filter(a -> a.getIndustryIds().contains(industryId.get())
&& a.getGroupType().equals(TemplateGroupType.TaxReturn.getCode())).findFirst();
} }
if (!bsplTemplateGroup.isPresent()) { if (!bsplTemplateGroup.isPresent()) {
......
...@@ -3,17 +3,18 @@ package pwc.taxtech.atms.vat.dao; ...@@ -3,17 +3,18 @@ package pwc.taxtech.atms.vat.dao;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import pwc.taxtech.atms.invoice.InputInvoiceMapper;
import pwc.taxtech.atms.vat.entity.InputVatInvoice; import pwc.taxtech.atms.vat.entity.InputVatInvoice;
import pwc.taxtech.atms.vat.entity.InputVatInvoiceExample; import pwc.taxtech.atms.vat.entity.InputVatInvoiceExample;
import java.util.List; import java.util.List;
@Service @Service
public class InputVatInvoiceDao { public class InputInvoiceDao {
@Autowired @Autowired
InputVatInvoiceMapper inputVATInvoiceMapper; InputInvoiceMapper inputInvoiceMapper;
public List<InputVatInvoice> getInputVATInvoice(Integer period, Integer invoiceType, String checkPass, String scanPass, String notPass) { public List<InputVatInvoice> getInputInvoice(Integer period, Integer invoiceType, String checkPass, String scanPass, String notPass) {
InputVatInvoiceExample example = new InputVatInvoiceExample(); InputVatInvoiceExample example = new InputVatInvoiceExample();
InputVatInvoiceExample.Criteria criteria = example.createCriteria(); InputVatInvoiceExample.Criteria criteria = example.createCriteria();
InputVatInvoiceExample.Criteria criteria1 = example.createCriteria(); InputVatInvoiceExample.Criteria criteria1 = example.createCriteria();
...@@ -37,6 +38,6 @@ public class InputVatInvoiceDao { ...@@ -37,6 +38,6 @@ public class InputVatInvoiceDao {
example.or(criteria1); example.or(criteria1);
} }
return inputVATInvoiceMapper.selectByExample(example); return inputInvoiceMapper.selectByExample(example);
} }
} }
...@@ -69,6 +69,7 @@ public class ReportGeneratorImpl extends VatAbstractService implements ReportGen ...@@ -69,6 +69,7 @@ public class ReportGeneratorImpl extends VatAbstractService implements ReportGen
int period = periodParam != null ? periodParam : 0; int period = periodParam != null ? periodParam : 0;
Project project = projectMapper.selectByPrimaryKey(projectId); Project project = projectMapper.selectByPrimaryKey(projectId);
if (templateIds.isEmpty()) templateIds.add(Long.MAX_VALUE);
PeriodTemplateExample periodTemplateExample = new PeriodTemplateExample(); PeriodTemplateExample periodTemplateExample = new PeriodTemplateExample();
periodTemplateExample.createCriteria().andProjectIdEqualTo(projectId).andPeriodEqualTo(period).andIdIn(templateIds); periodTemplateExample.createCriteria().andProjectIdEqualTo(projectId).andPeriodEqualTo(period).andIdIn(templateIds);
...@@ -80,12 +81,13 @@ public class ReportGeneratorImpl extends VatAbstractService implements ReportGen ...@@ -80,12 +81,13 @@ public class ReportGeneratorImpl extends VatAbstractService implements ReportGen
Long templateGroupId = periodTemplateList.size() > 0 ? periodTemplateList.get(0).getTemplateGroupId() : 0; Long templateGroupId = periodTemplateList.size() > 0 ? periodTemplateList.get(0).getTemplateGroupId() : 0;
PeriodCellTemplateExample periodCellTemplateExample = new PeriodCellTemplateExample(); PeriodCellTemplateExample periodCellTemplateExample = new PeriodCellTemplateExample();
periodCellTemplateExample.createCriteria().andReportTemplateIdIn(periodTemplateIdList).andPeriodEqualTo(period); if (periodTemplateIdList.isEmpty()) periodTemplateIdList.add(Long.MAX_VALUE);
periodCellTemplateExample.createCriteria().andProjectIdEqualTo(projectId).andReportTemplateIdIn(periodTemplateIdList).andPeriodEqualTo(period);
List<PeriodCellTemplate> periodCellTemplateList = periodCellTemplateMapper.selectByExample(periodCellTemplateExample); List<PeriodCellTemplate> periodCellTemplateList = periodCellTemplateMapper.selectByExample(periodCellTemplateExample);
PeriodCellTemplateConfigExample periodCellTemplateConfigExample = new PeriodCellTemplateConfigExample(); PeriodCellTemplateConfigExample periodCellTemplateConfigExample = new PeriodCellTemplateConfigExample();
// only get formula config // only get formula config
periodCellTemplateConfigExample.createCriteria().andReportTemplateIdIn(periodTemplateIdList).andPeriodEqualTo(period); periodCellTemplateConfigExample.createCriteria().andProjectIdEqualTo(projectId).andReportTemplateIdIn(periodTemplateIdList).andPeriodEqualTo(period);
List<PeriodCellTemplateConfig> periodCellTemplateConfigList = List<PeriodCellTemplateConfig> periodCellTemplateConfigList =
periodCellTemplateConfigMapper.selectByExample(periodCellTemplateConfigExample); periodCellTemplateConfigMapper.selectByExample(periodCellTemplateConfigExample);
...@@ -287,7 +289,7 @@ public class ReportGeneratorImpl extends VatAbstractService implements ReportGen ...@@ -287,7 +289,7 @@ public class ReportGeneratorImpl extends VatAbstractService implements ReportGen
//如果有正则匹配就进行更新公式解析 //如果有正则匹配就进行更新公式解析
// if (isFind) { // if (isFind) {
periodCellTemplateConfig.setParsedFormula(resultFormula); periodCellTemplateConfig.setParsedFormula(resultFormula);
periodCellTemplateConfigMapper.updateByPrimaryKey(periodCellTemplateConfig); periodCellTemplateConfigMapper.updateByPrimaryKeySelective(periodCellTemplateConfig);
// } // }
String regexNormalCell = "[A-Z]{1,2}((?!0)[0-9]{1,3})"; String regexNormalCell = "[A-Z]{1,2}((?!0)[0-9]{1,3})";
...@@ -399,6 +401,7 @@ public class ReportGeneratorImpl extends VatAbstractService implements ReportGen ...@@ -399,6 +401,7 @@ public class ReportGeneratorImpl extends VatAbstractService implements ReportGen
cellData.setUpdateBy("Admin"); cellData.setUpdateBy("Admin");
cellData.setUpdateTime(createTime); cellData.setUpdateTime(createTime);
cellData.setProjectId(projectId); cellData.setProjectId(projectId);
cellData.setPeriod(period);
periodCellDataMapper.insertSelective(cellData); periodCellDataMapper.insertSelective(cellData);
//after insert celldata, insert the celldatasource for link celldata and datasource //after insert celldata, insert the celldatasource for link celldata and datasource
...@@ -415,6 +418,8 @@ public class ReportGeneratorImpl extends VatAbstractService implements ReportGen ...@@ -415,6 +418,8 @@ public class ReportGeneratorImpl extends VatAbstractService implements ReportGen
cellDataSource.setDataSourceId(dataSource.getId()); cellDataSource.setDataSourceId(dataSource.getId());
cellDataSource.setCreateTime(createTime); cellDataSource.setCreateTime(createTime);
cellDataSource.setUpdateTime(createTime); cellDataSource.setUpdateTime(createTime);
cellDataSource.setPeriod(period);
cellDataSource.setProjectId(projectId);
SpringContextUtil.periodCellDataSourceMapper.insertSelective(cellDataSource); SpringContextUtil.periodCellDataSourceMapper.insertSelective(cellDataSource);
} }
} }
...@@ -502,7 +507,7 @@ public class ReportGeneratorImpl extends VatAbstractService implements ReportGen ...@@ -502,7 +507,7 @@ public class ReportGeneratorImpl extends VatAbstractService implements ReportGen
workbook.addToolPack(udfToolpack); workbook.addToolPack(udfToolpack);
} }
public List<CellCalcInfoDto> getCellCalcInfo(List<Long> templateIdList, Integer periodParam,String projectId) { public List<CellCalcInfoDto> getCellCalcInfo(List<Long> templateIdList, Integer periodParam, String projectId) {
//already finished by 20180711 //already finished by 20180711
int period = 0; int period = 0;
if (periodParam != null) { if (periodParam != null) {
...@@ -512,7 +517,7 @@ public class ReportGeneratorImpl extends VatAbstractService implements ReportGen ...@@ -512,7 +517,7 @@ public class ReportGeneratorImpl extends VatAbstractService implements ReportGen
List<PeriodCellTemplateConfigExtendDto> periodCellTemplateConfigExtendDtos = List<PeriodCellTemplateConfigExtendDto> periodCellTemplateConfigExtendDtos =
periodCellTemplateConfigMapper.getPeriodCellTemplateConfigExtendDtos(templateIdList, period); periodCellTemplateConfigMapper.getPeriodCellTemplateConfigExtendDtos(templateIdList, period);
fixedPCTParsedFormula(periodCellTemplateConfigExtendDtos,projectId); fixedPCTParsedFormula(periodCellTemplateConfigExtendDtos, projectId, period);
List<CellCalcInfoDto> cellCalcInfoDtos = new ArrayList<>(); List<CellCalcInfoDto> cellCalcInfoDtos = new ArrayList<>();
periodCellTemplateConfigExtendDtos.stream().collect(Collectors.groupingBy(a -> periodCellTemplateConfigExtendDtos.stream().collect(Collectors.groupingBy(a ->
new CellTemplateConfigGroupDto(a.getColumnIndex(), a.getRowIndex() new CellTemplateConfigGroupDto(a.getColumnIndex(), a.getRowIndex()
...@@ -544,7 +549,7 @@ public class ReportGeneratorImpl extends VatAbstractService implements ReportGen ...@@ -544,7 +549,7 @@ public class ReportGeneratorImpl extends VatAbstractService implements ReportGen
return cellCalcInfoDtos; return cellCalcInfoDtos;
} }
private void fixedPCTParsedFormula(List<PeriodCellTemplateConfigExtendDto> periodCellTemplateConfigExtendDtos,String projectId) { private void fixedPCTParsedFormula(List<PeriodCellTemplateConfigExtendDto> periodCellTemplateConfigExtendDtos, String projectId, int period) {
Map<String, List<PCTEntity>> formulaMapToPCT = new HashMap<>(); Map<String, List<PCTEntity>> formulaMapToPCT = new HashMap<>();
Map<PeriodCellTemplateConfig, List<String>> configMapToPCTs = new HashMap<>(); Map<PeriodCellTemplateConfig, List<String>> configMapToPCTs = new HashMap<>();
Set<PCTEntity> parameter = new HashSet<>(); Set<PCTEntity> parameter = new HashSet<>();
...@@ -591,7 +596,7 @@ public class ReportGeneratorImpl extends VatAbstractService implements ReportGen ...@@ -591,7 +596,7 @@ public class ReportGeneratorImpl extends VatAbstractService implements ReportGen
}); });
if (!parameter.isEmpty()) { if (!parameter.isEmpty()) {
List<PCTEntity> pctResults = periodCellDataMapper.queryByPCTs(parameter,projectId); List<PCTEntity> pctResults = periodCellDataMapper.queryByPCTs(parameter, projectId);
Map<PCTEntity, BigDecimal> pctCache = new HashMap<>(); Map<PCTEntity, BigDecimal> pctCache = new HashMap<>();
pctResults.forEach(m -> { pctResults.forEach(m -> {
BigDecimal data = null; BigDecimal data = null;
......
...@@ -47,8 +47,8 @@ public class VatAbstractService { ...@@ -47,8 +47,8 @@ public class VatAbstractService {
public PeriodCellTemplateMapper periodCellTemplateMapper; public PeriodCellTemplateMapper periodCellTemplateMapper;
@Autowired @Autowired
public PeriodCellTemplateConfigMapper periodCellTemplateConfigMapper; public PeriodCellTemplateConfigMapper periodCellTemplateConfigMapper;
@Autowired // @Autowired
public DataSourceMapper dataSourceMapper; // public DataSourceMapper dataSourceMapper;
@Autowired @Autowired
public PeriodDataSourceMapper periodDataSourceMapper; public PeriodDataSourceMapper periodDataSourceMapper;
@Autowired @Autowired
...@@ -84,7 +84,7 @@ public class VatAbstractService { ...@@ -84,7 +84,7 @@ public class VatAbstractService {
@Autowired @Autowired
public PeriodCellDataMapper periodCellDataMapper; public PeriodCellDataMapper periodCellDataMapper;
@Autowired @Autowired
public ModifiedReportCellMapper modifiedReportCellMapper; public PeriodModifiedReportCellMapper periodModifiedReportCellMapper;
@Autowired @Autowired
public PeriodCellCommentMapper periodCellCommentMapper; public PeriodCellCommentMapper periodCellCommentMapper;
@Autowired @Autowired
......
...@@ -17,7 +17,6 @@ import pwc.taxtech.atms.dto.vatdto.CurrentPeriodBo; ...@@ -17,7 +17,6 @@ import pwc.taxtech.atms.dto.vatdto.CurrentPeriodBo;
import pwc.taxtech.atms.dto.vatdto.ReportCellDataSourceDto; import pwc.taxtech.atms.dto.vatdto.ReportCellDataSourceDto;
import pwc.taxtech.atms.exception.Exceptions; import pwc.taxtech.atms.exception.Exceptions;
import pwc.taxtech.atms.exception.FormulaException; import pwc.taxtech.atms.exception.FormulaException;
import pwc.taxtech.atms.vat.entity.CellData;
import pwc.taxtech.atms.vat.entity.PeriodCellData; import pwc.taxtech.atms.vat.entity.PeriodCellData;
import java.lang.reflect.Field; import java.lang.reflect.Field;
...@@ -139,7 +138,8 @@ public class BB extends FunctionBase implements FreeRefFunction { ...@@ -139,7 +138,8 @@ public class BB extends FunctionBase implements FreeRefFunction {
LOGGER.warn("error for bb cacls for {} and current for {}", bo.toString(), curPeriod.toString()); LOGGER.warn("error for bb cacls for {} and current for {}", bo.toString(), curPeriod.toString());
Long dataSourceId = saveDataSource(ec, dataSource, FormulaDataSourceDetailType.ReportCellDataSourceDto, Long dataSourceId = saveDataSource(ec, dataSource, FormulaDataSourceDetailType.ReportCellDataSourceDto,
cellValue, formulaContext.getPeriod(), cellValue, formulaContext.getPeriod(),
formulaContext.getReportTemplateGroupId(), bo.getColumnIndex() - 1, bo.getRowIndex() - 1); formulaContext.getReportTemplateGroupId(), bo.getColumnIndex() - 1, bo.getRowIndex() - 1,
formulaContext.getProjectId());
saveFormulaBlock(formulaContext.getPeriod(), ec, saveFormulaBlock(formulaContext.getPeriod(), ec,
bo.expression(), bo.expressionData(), dataSourceId, formulaContext.getProjectId()); bo.expression(), bo.expressionData(), dataSourceId, formulaContext.getProjectId());
} }
......
...@@ -8,7 +8,11 @@ import pwc.taxtech.atms.common.util.SpringContextUtil; ...@@ -8,7 +8,11 @@ import pwc.taxtech.atms.common.util.SpringContextUtil;
import pwc.taxtech.atms.constant.enums.FormulaDataSourceDetailType; import pwc.taxtech.atms.constant.enums.FormulaDataSourceDetailType;
import pwc.taxtech.atms.constant.enums.KeyValueConfigResultType; import pwc.taxtech.atms.constant.enums.KeyValueConfigResultType;
import pwc.taxtech.atms.dto.vatdto.BSPLFormulaDataSourceDto; import pwc.taxtech.atms.dto.vatdto.BSPLFormulaDataSourceDto;
import pwc.taxtech.atms.vat.entity.*; import pwc.taxtech.atms.vat.entity.Balance;
import pwc.taxtech.atms.vat.entity.BalanceStdManual;
import pwc.taxtech.atms.vat.entity.PeriodEnterpriseAccount;
import pwc.taxtech.atms.vat.entity.VatEnterpriseAccount;
import pwc.taxtech.atms.vat.entity.VatStandardAccount;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.ArrayList; import java.util.ArrayList;
...@@ -92,7 +96,7 @@ public class FSJZ extends FunctionBase implements FreeRefFunction { ...@@ -92,7 +96,7 @@ public class FSJZ extends FunctionBase implements FreeRefFunction {
if (balanceStdManual != null) { if (balanceStdManual != null) {
List<VatEnterpriseAccount> vatEnterpriseAccountList = SpringContextUtil List<VatEnterpriseAccount> vatEnterpriseAccountList = SpringContextUtil
.periodEnterpriseAccountMapper .periodEnterpriseAccountMapper
.getListWithAccountCode(accountCode,formulaContext.getProjectId(),period); .getListWithAccountCode(accountCode, formulaContext.getProjectId(), period);
if (period == 99) { if (period == 99) {
val = new BigDecimal(((balanceStdManual.getYearDebitNet() != null ? balanceStdManual.getYearDebitNet() : 0).doubleValue() val = new BigDecimal(((balanceStdManual.getYearDebitNet() != null ? balanceStdManual.getYearDebitNet() : 0).doubleValue()
- (balanceStdManual.getYearCreditNet() != null ? balanceStdManual.getYearCreditNet() : 0).doubleValue()) - (balanceStdManual.getYearCreditNet() != null ? balanceStdManual.getYearCreditNet() : 0).doubleValue())
...@@ -130,7 +134,8 @@ public class FSJZ extends FunctionBase implements FreeRefFunction { ...@@ -130,7 +134,8 @@ public class FSJZ extends FunctionBase implements FreeRefFunction {
} }
//todo: sava data //todo: sava data
//save datasource //save datasource
Long dataSourceId = saveDataSource(ec, formulaDataSourceDtoList, FormulaDataSourceDetailType.BSPLFormulaDataSourceDto, val, period, formulaContext.getReportTemplateGroupId()); Long dataSourceId = saveDataSource(ec, formulaDataSourceDtoList, FormulaDataSourceDetailType.BSPLFormulaDataSourceDto,
val, period, formulaContext.getReportTemplateGroupId(), formulaContext.getProjectId());
//save formulablock //save formulablock
saveFormulaBlock(period, ec, formulaExpression, val, dataSourceId, formulaContext.getProjectId()); saveFormulaBlock(period, ec, formulaExpression, val, dataSourceId, formulaContext.getProjectId());
...@@ -194,7 +199,7 @@ public class FSJZ extends FunctionBase implements FreeRefFunction { ...@@ -194,7 +199,7 @@ public class FSJZ extends FunctionBase implements FreeRefFunction {
//todo: sava data //todo: sava data
//save datasource //save datasource
Long dataSourceId = saveDataSource(ec, dsList, FormulaDataSourceDetailType.BSPLFormulaDataSourceDto, val, Long dataSourceId = saveDataSource(ec, dsList, FormulaDataSourceDetailType.BSPLFormulaDataSourceDto, val,
period, formulaContext.getReportTemplateGroupId()); period, formulaContext.getReportTemplateGroupId(), formulaContext.getProjectId());
//save formulablock //save formulablock
saveFormulaBlock(period, ec, formulaExpression, val, dataSourceId, formulaContext.getProjectId()); saveFormulaBlock(period, ec, formulaExpression, val, dataSourceId, formulaContext.getProjectId());
return new NumberEval(val.doubleValue()); return new NumberEval(val.doubleValue());
......
...@@ -10,7 +10,9 @@ import org.slf4j.LoggerFactory; ...@@ -10,7 +10,9 @@ import org.slf4j.LoggerFactory;
import pwc.taxtech.atms.common.util.SpringContextUtil; import pwc.taxtech.atms.common.util.SpringContextUtil;
import pwc.taxtech.atms.constant.enums.FormulaDataSourceDetailType; import pwc.taxtech.atms.constant.enums.FormulaDataSourceDetailType;
import pwc.taxtech.atms.constant.enums.FormulaDataSourceType; import pwc.taxtech.atms.constant.enums.FormulaDataSourceType;
import pwc.taxtech.atms.vat.entity.*; import pwc.taxtech.atms.vat.entity.PeriodDataSource;
import pwc.taxtech.atms.vat.entity.PeriodDataSourceDetail;
import pwc.taxtech.atms.vat.entity.PeriodFormulaBlock;
import pwc.taxtech.atms.vat.service.impl.FormulaAgent; import pwc.taxtech.atms.vat.service.impl.FormulaAgent;
import java.math.BigDecimal; import java.math.BigDecimal;
...@@ -91,13 +93,13 @@ public class FunctionBase { ...@@ -91,13 +93,13 @@ public class FunctionBase {
} }
public Long saveDataSource(OperationEvaluationContext ec, List<Object> dataSourceList, public Long saveDataSource(OperationEvaluationContext ec, List<Object> dataSourceList,
FormulaDataSourceDetailType formulaDataSourceDetailType, BigDecimal val, int period, Long templateGroupId) { FormulaDataSourceDetailType formulaDataSourceDetailType, BigDecimal val, int period, Long templateGroupId, String projectId) {
return saveDataSource(ec, dataSourceList, formulaDataSourceDetailType, val, period, templateGroupId, null, null); return saveDataSource(ec, dataSourceList, formulaDataSourceDetailType, val, period, templateGroupId, null, null, projectId);
} }
public Long saveDataSource(OperationEvaluationContext ec, List<Object> dataSourceList, public Long saveDataSource(OperationEvaluationContext ec, List<Object> dataSourceList,
FormulaDataSourceDetailType formulaDataSourceDetailType, BigDecimal val, FormulaDataSourceDetailType formulaDataSourceDetailType, BigDecimal val,
int period, Long templateGroupId, Integer colNumP, Integer rowNumP) { int period, Long templateGroupId, Integer colNumP, Integer rowNumP, String projectId) {
String reportCode = ec.getWorkbook().getSheetName(ec.getSheetIndex()); String reportCode = ec.getWorkbook().getSheetName(ec.getSheetIndex());
int colNum = ec.getColumnIndex(); int colNum = ec.getColumnIndex();
int rowNum = ec.getRowIndex(); int rowNum = ec.getRowIndex();
...@@ -117,26 +119,29 @@ public class FunctionBase { ...@@ -117,26 +119,29 @@ public class FunctionBase {
dataSource.setType(FormulaDataSourceType.Report.getCode()); dataSource.setType(FormulaDataSourceType.Report.getCode());
dataSource.setName("ReportDataSource"); dataSource.setName("ReportDataSource");
dataSource.setAmount(val); dataSource.setAmount(val);
dataSource.setDescription(""); dataSource.setDescription("描述");
dataSource.setCreateBy("Admin"); dataSource.setCreateBy("Admin");
dataSource.setUpdateBy("Admin"); dataSource.setUpdateBy("Admin");
dataSource.setCreateTime(creatime); dataSource.setCreateTime(creatime);
dataSource.setUpdateTime(creatime); dataSource.setUpdateTime(creatime);
dataSource.setRowIndex(rowNumP == null ? ec.getRowIndex() : rowNumP); dataSource.setRowIndex(rowNumP == null ? ec.getRowIndex() : rowNumP);
dataSource.setColumnIndex(colNumP == null ? ec.getColumnIndex() : colNumP); dataSource.setColumnIndex(colNumP == null ? ec.getColumnIndex() : colNumP);
dataSource.setRowName(""); dataSource.setRowName("行名");
dataSource.setColumnName(""); dataSource.setColumnName("列名");
dataSource.setCellTemplateId(periodCellTemplateId); dataSource.setCellTemplateId(periodCellTemplateId);
dataSource.setPeriod(period); dataSource.setPeriod(period);
dataSource.setProjectId(projectId);
SpringContextUtil.periodDataSourceMapper.insertSelective(dataSource); SpringContextUtil.periodDataSourceMapper.insertSelective(dataSource);
for (Object obj : dataSourceList) { for (Object obj : dataSourceList) {
if (obj.getClass()==java.util.ArrayList.class) { if (obj.getClass() == java.util.ArrayList.class) {
for (Object obj2 : (ArrayList<Object>)obj) { for (Object obj2 : (ArrayList<Object>) obj) {
PeriodDataSourceDetail dataSourceDetail = new PeriodDataSourceDetail(); PeriodDataSourceDetail dataSourceDetail = new PeriodDataSourceDetail();
dataSourceDetail.setId(SpringContextUtil.distributedIdService.nextId()); dataSourceDetail.setId(SpringContextUtil.distributedIdService.nextId());
dataSourceDetail.setDataSourceId(dataSourceId); dataSourceDetail.setDataSourceId(dataSourceId);
dataSourceDetail.setDataSourceType(formulaDataSourceDetailType.getCode()); dataSourceDetail.setDataSourceType(formulaDataSourceDetailType.getCode());
dataSourceDetail.setItemValue(JSON.toJSONString(obj2)); dataSourceDetail.setItemValue(JSON.toJSONString(obj2));
dataSourceDetail.setPeriod(period);
dataSourceDetail.setProjectId(projectId);
SpringContextUtil.periodDataSourceDetailMapper.insertSelective(dataSourceDetail); SpringContextUtil.periodDataSourceDetailMapper.insertSelective(dataSourceDetail);
} }
} else { } else {
...@@ -145,6 +150,8 @@ public class FunctionBase { ...@@ -145,6 +150,8 @@ public class FunctionBase {
dataSourceDetail.setDataSourceId(dataSourceId); dataSourceDetail.setDataSourceId(dataSourceId);
dataSourceDetail.setDataSourceType(formulaDataSourceDetailType.getCode()); dataSourceDetail.setDataSourceType(formulaDataSourceDetailType.getCode());
dataSourceDetail.setItemValue(JSON.toJSONString(obj)); dataSourceDetail.setItemValue(JSON.toJSONString(obj));
dataSourceDetail.setPeriod(period);
dataSourceDetail.setProjectId(projectId);
SpringContextUtil.periodDataSourceDetailMapper.insertSelective(dataSourceDetail); SpringContextUtil.periodDataSourceDetailMapper.insertSelective(dataSourceDetail);
} }
} }
......
...@@ -88,7 +88,7 @@ public class GZSD extends FunctionBase implements FreeRefFunction { ...@@ -88,7 +88,7 @@ public class GZSD extends FunctionBase implements FreeRefFunction {
dataSourceDtoList.add(formulaDataSourceDto); dataSourceDtoList.add(formulaDataSourceDto);
Long dataSourceId = saveDataSource(ec, Collections.singletonList(dataSourceDtoList), Long dataSourceId = saveDataSource(ec, Collections.singletonList(dataSourceDtoList),
FormulaDataSourceDetailType.FormulaDataSourceDto, decimal_zero, formulaContext.getPeriod(), FormulaDataSourceDetailType.FormulaDataSourceDto, decimal_zero, formulaContext.getPeriod(),
formulaContext.getReportTemplateGroupId()); formulaContext.getReportTemplateGroupId(), formulaContext.getProjectId());
saveFormulaBlock(formulaContext.getPeriod(), ec, formulaExpression, decimal_zero, dataSourceId, formulaContext.getProjectId()); saveFormulaBlock(formulaContext.getPeriod(), ec, formulaExpression, decimal_zero, dataSourceId, formulaContext.getProjectId());
return NumberEval.ZERO; return NumberEval.ZERO;
} }
...@@ -111,7 +111,7 @@ public class GZSD extends FunctionBase implements FreeRefFunction { ...@@ -111,7 +111,7 @@ public class GZSD extends FunctionBase implements FreeRefFunction {
dataSourceDtoList.add(formulaDataSourceDto); dataSourceDtoList.add(formulaDataSourceDto);
Long dataSourceId = saveDataSource(ec, Collections.singletonList(dataSourceDtoList), Long dataSourceId = saveDataSource(ec, Collections.singletonList(dataSourceDtoList),
FormulaDataSourceDetailType.FormulaDataSourceDto, val, formulaContext.getPeriod(), FormulaDataSourceDetailType.FormulaDataSourceDto, val, formulaContext.getPeriod(),
formulaContext.getReportTemplateGroupId()); formulaContext.getReportTemplateGroupId(), formulaContext.getProjectId());
saveFormulaBlock(formulaContext.getPeriod(), ec, formulaExpression, val, dataSourceId, formulaContext.getProjectId()); saveFormulaBlock(formulaContext.getPeriod(), ec, formulaExpression, val, dataSourceId, formulaContext.getProjectId());
return new NumberEval(val.doubleValue()); return new NumberEval(val.doubleValue());
} else { } else {
...@@ -130,7 +130,7 @@ public class GZSD extends FunctionBase implements FreeRefFunction { ...@@ -130,7 +130,7 @@ public class GZSD extends FunctionBase implements FreeRefFunction {
dataSourceDtoList.add(formulaDataSourceDto); dataSourceDtoList.add(formulaDataSourceDto);
Long dataSourceId = saveDataSource(ec, Collections.singletonList(dataSourceDtoList), Long dataSourceId = saveDataSource(ec, Collections.singletonList(dataSourceDtoList),
FormulaDataSourceDetailType.FormulaDataSourceDto, decimal_zero, formulaContext.getPeriod(), FormulaDataSourceDetailType.FormulaDataSourceDto, decimal_zero, formulaContext.getPeriod(),
formulaContext.getReportTemplateGroupId()); formulaContext.getReportTemplateGroupId(), formulaContext.getProjectId());
saveFormulaBlock(formulaContext.getPeriod(), ec, formulaExpression, decimal_zero, dataSourceId, formulaContext.getProjectId()); saveFormulaBlock(formulaContext.getPeriod(), ec, formulaExpression, decimal_zero, dataSourceId, formulaContext.getProjectId());
return NumberEval.ZERO; return NumberEval.ZERO;
......
...@@ -81,22 +81,22 @@ public class JXFP extends FunctionBase implements FreeRefFunction { ...@@ -81,22 +81,22 @@ public class JXFP extends FunctionBase implements FreeRefFunction {
List<InputVatInvoice> inputVATInvoices; List<InputVatInvoice> inputVATInvoices;
if (authenticationType == 1 && formulaContext.getIsYear()) { if (authenticationType == 1 && formulaContext.getIsYear()) {
inputVATInvoices = SpringContextUtil.inputVatInvoiceDao.getInputVATInvoice(null, invoiceType, inputVATInvoices = SpringContextUtil.inputInvoiceDao.getInputInvoice(null, invoiceType,
Constant.InputInvoiceCertificationResult.CheckPass, Constant.InputInvoiceCertificationResult.ScanPass, Constant.InputInvoiceCertificationResult.CheckPass, Constant.InputInvoiceCertificationResult.ScanPass,
null); null);
} else if (authenticationType == 1) { } else if (authenticationType == 1) {
inputVATInvoices = SpringContextUtil.inputVatInvoiceDao.getInputVATInvoice(period, invoiceType, inputVATInvoices = SpringContextUtil.inputInvoiceDao.getInputInvoice(period, invoiceType,
Constant.InputInvoiceCertificationResult.CheckPass, Constant.InputInvoiceCertificationResult.ScanPass, Constant.InputInvoiceCertificationResult.CheckPass, Constant.InputInvoiceCertificationResult.ScanPass,
null); null);
} }
// 认证未通过与未认证暂认为是同一个意思 // 认证未通过与未认证暂认为是同一个意思
else if ((authenticationType == 1 || authenticationType == 2) && formulaContext.getIsYear()) { else if ((authenticationType == 1 || authenticationType == 2) && formulaContext.getIsYear()) {
inputVATInvoices = SpringContextUtil.inputVatInvoiceDao.getInputVATInvoice(null, invoiceType, inputVATInvoices = SpringContextUtil.inputInvoiceDao.getInputInvoice(null, invoiceType,
null, null, Constant.InputInvoiceCertificationResult.NotPass); null, null, Constant.InputInvoiceCertificationResult.NotPass);
} }
// 认证未通过与未认证暂认为是同一个意思 // 认证未通过与未认证暂认为是同一个意思
else if (authenticationType == 0 || authenticationType == 2) { else if (authenticationType == 0 || authenticationType == 2) {
inputVATInvoices = SpringContextUtil.inputVatInvoiceDao.getInputVATInvoice(period, invoiceType, null, inputVATInvoices = SpringContextUtil.inputInvoiceDao.getInputInvoice(period, invoiceType, null,
null, Constant.InputInvoiceCertificationResult.NotPass); null, Constant.InputInvoiceCertificationResult.NotPass);
} else { } else {
saveFormulaBlock(period, ec, formulaExpression, new BigDecimal("0.0"), 0L, formulaContext.getProjectId()); saveFormulaBlock(period, ec, formulaExpression, new BigDecimal("0.0"), 0L, formulaContext.getProjectId());
...@@ -159,7 +159,8 @@ public class JXFP extends FunctionBase implements FreeRefFunction { ...@@ -159,7 +159,8 @@ public class JXFP extends FunctionBase implements FreeRefFunction {
double val = dataSource.stream().mapToDouble(a -> a.getAmount().doubleValue()).sum(); double val = dataSource.stream().mapToDouble(a -> a.getAmount().doubleValue()).sum();
Long dataSourceId = saveDataSource(ec, Collections.singletonList(dataSource), Long dataSourceId = saveDataSource(ec, Collections.singletonList(dataSource),
FormulaDataSourceDetailType.InputInvoiceDataSourceDto, FormulaDataSourceDetailType.InputInvoiceDataSourceDto,
BigDecimal.valueOf(val), formulaContext.getPeriod(), formulaContext.getReportTemplateGroupId()); BigDecimal.valueOf(val), formulaContext.getPeriod(), formulaContext.getReportTemplateGroupId(),
formulaContext.getProjectId());
saveFormulaBlock(formulaContext.getPeriod(), ec, formulaExpression, BigDecimal.valueOf(val), dataSourceId, saveFormulaBlock(formulaContext.getPeriod(), ec, formulaExpression, BigDecimal.valueOf(val), dataSourceId,
formulaContext.getProjectId()); formulaContext.getProjectId());
return new NumberEval(val); return new NumberEval(val);
...@@ -167,7 +168,7 @@ public class JXFP extends FunctionBase implements FreeRefFunction { ...@@ -167,7 +168,7 @@ public class JXFP extends FunctionBase implements FreeRefFunction {
double val = dataSource.stream().mapToDouble(a -> a.getTaxAmount().doubleValue()).sum(); double val = dataSource.stream().mapToDouble(a -> a.getTaxAmount().doubleValue()).sum();
Long dataSourceId = saveDataSource(ec, Collections.singletonList(dataSource), Long dataSourceId = saveDataSource(ec, Collections.singletonList(dataSource),
FormulaDataSourceDetailType.InputInvoiceDataSourceDto, FormulaDataSourceDetailType.InputInvoiceDataSourceDto,
BigDecimal.valueOf(val), formulaContext.getPeriod(), formulaContext.getReportTemplateGroupId()); BigDecimal.valueOf(val), formulaContext.getPeriod(), formulaContext.getReportTemplateGroupId(), formulaContext.getProjectId());
saveFormulaBlock(formulaContext.getPeriod(), ec, formulaExpression, BigDecimal.valueOf(val), dataSourceId, saveFormulaBlock(formulaContext.getPeriod(), ec, formulaExpression, BigDecimal.valueOf(val), dataSourceId,
formulaContext.getProjectId()); formulaContext.getProjectId());
return new NumberEval(val); return new NumberEval(val);
...@@ -175,7 +176,7 @@ public class JXFP extends FunctionBase implements FreeRefFunction { ...@@ -175,7 +176,7 @@ public class JXFP extends FunctionBase implements FreeRefFunction {
double val = dataSource.size(); double val = dataSource.size();
Long dataSourceId = saveDataSource(ec, Collections.singletonList(dataSource), Long dataSourceId = saveDataSource(ec, Collections.singletonList(dataSource),
FormulaDataSourceDetailType.InputInvoiceDataSourceDto, FormulaDataSourceDetailType.InputInvoiceDataSourceDto,
BigDecimal.valueOf(val), formulaContext.getPeriod(), formulaContext.getReportTemplateGroupId()); BigDecimal.valueOf(val), formulaContext.getPeriod(), formulaContext.getReportTemplateGroupId(), formulaContext.getProjectId());
saveFormulaBlock(period, ec, formulaExpression, BigDecimal.valueOf(val), dataSourceId, saveFormulaBlock(period, ec, formulaExpression, BigDecimal.valueOf(val), dataSourceId,
formulaContext.getProjectId()); formulaContext.getProjectId());
return new NumberEval(val); return new NumberEval(val);
......
...@@ -84,7 +84,7 @@ public class JXFPMX extends FunctionBase implements FreeRefFunction { ...@@ -84,7 +84,7 @@ public class JXFPMX extends FunctionBase implements FreeRefFunction {
} }
String dbName = SpringContextUtil.projectDao.getDbNameWithYearAndOrgId(formulaContext.getOrganizationId(), curYear); String dbName = SpringContextUtil.projectDao.getDbNameWithYearAndOrgId(formulaContext.getOrganizationId(), curYear);
List<InputVATInvoiceResultDto> inputInvoice = SpringContextUtil.inputVATInvoiceMapper.getInputVATInvoiceResultDto(dbName); List<InputVATInvoiceResultDto> inputInvoice = SpringContextUtil.inputInvoiceMapper.getInputVATInvoiceResultDto(dbName);
if (!goodsName.equals("99")) { if (!goodsName.equals("99")) {
inputInvoice = inputInvoice.stream() inputInvoice = inputInvoice.stream()
...@@ -137,14 +137,14 @@ public class JXFPMX extends FunctionBase implements FreeRefFunction { ...@@ -137,14 +137,14 @@ public class JXFPMX extends FunctionBase implements FreeRefFunction {
double val = dataSouce.stream().mapToDouble(a -> a.getAmount().doubleValue()).sum(); double val = dataSouce.stream().mapToDouble(a -> a.getAmount().doubleValue()).sum();
Long dataSourceId = saveDataSource(ec, Collections.singletonList(dataSouce), Long dataSourceId = saveDataSource(ec, Collections.singletonList(dataSouce),
FormulaDataSourceDetailType.InputInvoiceDetailDataSourceDto, FormulaDataSourceDetailType.InputInvoiceDetailDataSourceDto,
new BigDecimal(val), period, formulaContext.getReportTemplateGroupId()); new BigDecimal(val), period, formulaContext.getReportTemplateGroupId(), formulaContext.getProjectId());
saveFormulaBlock(period, ec, formulaExpression, new BigDecimal(val), dataSourceId, formulaContext.getProjectId()); saveFormulaBlock(period, ec, formulaExpression, new BigDecimal(val), dataSourceId, formulaContext.getProjectId());
return new NumberEval(val); return new NumberEval(val);
} else if (amountType == 1) { } else if (amountType == 1) {
double val = dataSouce.stream().mapToDouble(a -> a.getTaxAmount().doubleValue()).sum(); double val = dataSouce.stream().mapToDouble(a -> a.getTaxAmount().doubleValue()).sum();
Long dataSourceId = saveDataSource(ec, Collections.singletonList(dataSouce), Long dataSourceId = saveDataSource(ec, Collections.singletonList(dataSouce),
FormulaDataSourceDetailType.InputInvoiceDetailDataSourceDto, FormulaDataSourceDetailType.InputInvoiceDetailDataSourceDto,
new BigDecimal(val), period, formulaContext.getReportTemplateGroupId()); new BigDecimal(val), period, formulaContext.getReportTemplateGroupId(), formulaContext.getProjectId());
saveFormulaBlock(period, ec, formulaExpression, new BigDecimal(val), dataSourceId, formulaContext.getProjectId()); saveFormulaBlock(period, ec, formulaExpression, new BigDecimal(val), dataSourceId, formulaContext.getProjectId());
return new NumberEval(val); return new NumberEval(val);
} }
......
...@@ -71,7 +71,7 @@ public class XXFP extends FunctionBase implements FreeRefFunction { ...@@ -71,7 +71,7 @@ public class XXFP extends FunctionBase implements FreeRefFunction {
} }
String dbName = SpringContextUtil.projectDao.getDbNameWithYearAndOrgId(formulaContext.getOrganizationId(), curYear); String dbName = SpringContextUtil.projectDao.getDbNameWithYearAndOrgId(formulaContext.getOrganizationId(), curYear);
List<OutputVATInvoiceDto> outputInvoice = SpringContextUtil.outputVATInvoiceMapper.getVatInvoiceWithItems(dbName); List<OutputVATInvoiceDto> outputInvoice = SpringContextUtil.outputInvoiceMapper.getVatInvoiceWithItems(dbName);
if (invoiceType != 99) { if (invoiceType != 99) {
outputInvoice = outputInvoice.stream() outputInvoice = outputInvoice.stream()
...@@ -115,14 +115,14 @@ public class XXFP extends FunctionBase implements FreeRefFunction { ...@@ -115,14 +115,14 @@ public class XXFP extends FunctionBase implements FreeRefFunction {
double val = dataSource.stream().mapToDouble(a -> a.getAmount().doubleValue()).sum(); double val = dataSource.stream().mapToDouble(a -> a.getAmount().doubleValue()).sum();
Long dataSoureId = saveDataSource(ec, Collections.singletonList(dataSource), Long dataSoureId = saveDataSource(ec, Collections.singletonList(dataSource),
FormulaDataSourceDetailType.OutputInvoiceDataSourceDto, FormulaDataSourceDetailType.OutputInvoiceDataSourceDto,
new BigDecimal(val), period, formulaContext.getReportTemplateGroupId()); new BigDecimal(val), period, formulaContext.getReportTemplateGroupId(), formulaContext.getProjectId());
saveFormulaBlock(period, ec, formulaExpression, new BigDecimal(val), dataSoureId, formulaContext.getProjectId()); saveFormulaBlock(period, ec, formulaExpression, new BigDecimal(val), dataSoureId, formulaContext.getProjectId());
return new NumberEval(val); return new NumberEval(val);
} else if (amountType == 1) { } else if (amountType == 1) {
double val = dataSource.stream().mapToDouble(a -> a.getTaxAmount().doubleValue()).sum(); double val = dataSource.stream().mapToDouble(a -> a.getTaxAmount().doubleValue()).sum();
Long dataSoureId = saveDataSource(ec, Collections.singletonList(dataSource), Long dataSoureId = saveDataSource(ec, Collections.singletonList(dataSource),
FormulaDataSourceDetailType.OutputInvoiceDataSourceDto, FormulaDataSourceDetailType.OutputInvoiceDataSourceDto,
new BigDecimal(val), period, formulaContext.getReportTemplateGroupId()); new BigDecimal(val), period, formulaContext.getReportTemplateGroupId(), formulaContext.getProjectId());
saveFormulaBlock(period, ec, formulaExpression, new BigDecimal(val), dataSoureId, formulaContext.getProjectId()); saveFormulaBlock(period, ec, formulaExpression, new BigDecimal(val), dataSoureId, formulaContext.getProjectId());
return new NumberEval(val); return new NumberEval(val);
} }
......
...@@ -128,7 +128,7 @@ public class ZC extends FunctionBase implements FreeRefFunction { ...@@ -128,7 +128,7 @@ public class ZC extends FunctionBase implements FreeRefFunction {
} }
Long dataSourceId = saveDataSource(ec, Collections.singletonList(dataSource), Long dataSourceId = saveDataSource(ec, Collections.singletonList(dataSource),
FormulaDataSourceDetailType.AssetDetailDataSourceDto, FormulaDataSourceDetailType.AssetDetailDataSourceDto,
totalData, formulaContext.getPeriod(), formulaContext.getReportTemplateGroupId()); totalData, formulaContext.getPeriod(), formulaContext.getReportTemplateGroupId(), formulaContext.getProjectId());
saveFormulaBlock(0, ec, formulaExpression, totalData, dataSourceId, formulaContext.getProjectId()); saveFormulaBlock(0, ec, formulaExpression, totalData, dataSourceId, formulaContext.getProjectId());
return new NumberEval(totalData.doubleValue()); return new NumberEval(totalData.doubleValue());
} }
......
...@@ -26,6 +26,11 @@ ...@@ -26,6 +26,11 @@
</property> </property>
</bean> </bean>
<bean id="datasource2" class="com.alibaba.druid.pool.DruidDataSource">
<property name="url" value="${jdbc2_url}" />
<property name="username" value="${jdbc2_username}" />
<property name="password" value="${jdbc2_password}" />
</bean>
<!-- **************************************************************** --> <!-- **************************************************************** -->
<!-- 启用注解, 启用component-scan --> <!-- 启用注解, 启用component-scan -->
<!-- **************************************************************** --> <!-- **************************************************************** -->
...@@ -35,6 +40,12 @@ ...@@ -35,6 +40,12 @@
<import resource="applicationContext-datasource.xml" /> <import resource="applicationContext-datasource.xml" />
<bean id="sqlSessionFactory2" class="org.mybatis.spring.SqlSessionFactoryBean">
<property name="dataSource" ref="datasource2"/>
<property name="configLocation" value="classpath:sqlMapConfig.xml"/>
<property name="mapperLocations" value="classpath*:pwc/taxtech/atms/invoice/*Mapper.xml"/>
</bean>
<bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean"> <bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
<property name="dataSource" ref="dataSource" /> <property name="dataSource" ref="dataSource" />
<property name="configLocation" value="classpath:sqlMapConfig.xml" /> <property name="configLocation" value="classpath:sqlMapConfig.xml" />
...@@ -49,6 +60,13 @@ ...@@ -49,6 +60,13 @@
<constructor-arg ref="sqlSessionFactory" /> <constructor-arg ref="sqlSessionFactory" />
</bean> </bean>
<bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
<property name="basePackage" value="pwc.taxtech.atms.invoice" />
<property name="sqlSessionFactoryBeanName" value="sqlSessionFactory2"/>
</bean>
<bean id="transactionManager2" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="datasource2" />
</bean>
<!-- <bean class="org.mybatis.spring.mapper.MapperScannerConfigurer"> <property name="basePackage" value="pwc.taxtech.atms" /> </bean> --> <!-- <bean class="org.mybatis.spring.mapper.MapperScannerConfigurer"> <property name="basePackage" value="pwc.taxtech.atms" /> </bean> -->
<bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager"> <bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
......
...@@ -4,6 +4,12 @@ jdbc_password=taxadmin2018 ...@@ -4,6 +4,12 @@ jdbc_password=taxadmin2018
#jdbc_password=111111 #jdbc_password=111111
jdbc_admin_db=tax_admin jdbc_admin_db=tax_admin
jdbc2_url=jdbc:oracle:thin:@10.158.230.144:11521:XE
jdbc2_user=pwc_invoice
jdbc2_password=pwc_invoice
#jdbc_password=111111
jdbc2_admin_db=pwc_invoice
jdbc_url_demo=jdbc:mysql://10.158.230.144:3306/demo_db_name?useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true&useSSL=false jdbc_url_demo=jdbc:mysql://10.158.230.144:3306/demo_db_name?useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true&useSSL=false
mail_jdbc_url=jdbc:sqlserver://192.168.1.102:1434;DatabaseName=MAILMaster mail_jdbc_url=jdbc:sqlserver://192.168.1.102:1434;DatabaseName=MAILMaster
......
package pwc.taxtech.atms.vat.dao; package pwc.taxtech.atms.invoice;
import java.util.List;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.session.RowBounds; import org.apache.ibatis.session.RowBounds;
import pwc.taxtech.atms.MyVatMapper; import pwc.taxtech.atms.MyVatMapper;
import pwc.taxtech.atms.vat.entity.ModifiedReportCell; import pwc.taxtech.atms.vat.dpo.CellInvoiceDto;
import pwc.taxtech.atms.vat.entity.ModifiedReportCellExample; import pwc.taxtech.atms.vat.dpo.InputInvoicePreviewQueryParam;
import pwc.taxtech.atms.vat.dpo.InputVATInvoiceItemExtendDto;
import pwc.taxtech.atms.vat.dpo.InputVATInvoiceResultDto;
import pwc.taxtech.atms.vat.entity.InputVatInvoice;
import pwc.taxtech.atms.vat.entity.InputVatInvoiceExample;
import java.util.List;
@Mapper @Mapper
public interface ModifiedReportCellMapper extends MyVatMapper { public interface InputInvoiceMapper extends MyVatMapper {
/** /**
* This method was generated by MyBatis Generator. * This method was generated by MyBatis Generator.
* This method corresponds to the database table TAX_PROJECT.MODIFIED_REPORT_CELL * This method corresponds to the database table TAX_PROJECT. INPUT_VAT_INVOICE
* *
* @mbg.generated * @mbg.generated
*/ */
long countByExample(ModifiedReportCellExample example); long countByExample(InputVatInvoiceExample example);
/** /**
* This method was generated by MyBatis Generator. * This method was generated by MyBatis Generator.
* This method corresponds to the database table TAX_PROJECT.MODIFIED_REPORT_CELL * This method corresponds to the database table TAX_PROJECT. INPUT_VAT_INVOICE
* *
* @mbg.generated * @mbg.generated
*/ */
int deleteByExample(ModifiedReportCellExample example); int deleteByExample(InputVatInvoiceExample example);
/** /**
* This method was generated by MyBatis Generator. * This method was generated by MyBatis Generator.
* This method corresponds to the database table TAX_PROJECT.MODIFIED_REPORT_CELL * This method corresponds to the database table TAX_PROJECT. INPUT_VAT_INVOICE
* *
* @mbg.generated * @mbg.generated
*/ */
int deleteByPrimaryKey(Long id); int deleteByPrimaryKey(String id);
/** /**
* This method was generated by MyBatis Generator. * This method was generated by MyBatis Generator.
* This method corresponds to the database table TAX_PROJECT.MODIFIED_REPORT_CELL * This method corresponds to the database table TAX_PROJECT. INPUT_VAT_INVOICE
* *
* @mbg.generated * @mbg.generated
*/ */
int insert(ModifiedReportCell record); int insert(InputVatInvoice record);
/** /**
* This method was generated by MyBatis Generator. * This method was generated by MyBatis Generator.
* This method corresponds to the database table TAX_PROJECT.MODIFIED_REPORT_CELL * This method corresponds to the database table TAX_PROJECT. INPUT_VAT_INVOICE
* *
* @mbg.generated * @mbg.generated
*/ */
int insertSelective(ModifiedReportCell record); int insertSelective(InputVatInvoice record);
/** /**
* This method was generated by MyBatis Generator. * This method was generated by MyBatis Generator.
* This method corresponds to the database table TAX_PROJECT.MODIFIED_REPORT_CELL * This method corresponds to the database table TAX_PROJECT. INPUT_VAT_INVOICE
* *
* @mbg.generated * @mbg.generated
*/ */
List<ModifiedReportCell> selectByExampleWithRowbounds(ModifiedReportCellExample example, RowBounds rowBounds); List<InputVatInvoice> selectByExampleWithRowbounds(InputVatInvoiceExample example, RowBounds rowBounds);
/** /**
* This method was generated by MyBatis Generator. * This method was generated by MyBatis Generator.
* This method corresponds to the database table TAX_PROJECT.MODIFIED_REPORT_CELL * This method corresponds to the database table TAX_PROJECT. INPUT_VAT_INVOICE
* *
* @mbg.generated * @mbg.generated
*/ */
List<ModifiedReportCell> selectByExample(ModifiedReportCellExample example); List<InputVatInvoice> selectByExample(InputVatInvoiceExample example);
/** /**
* This method was generated by MyBatis Generator. * This method was generated by MyBatis Generator.
* This method corresponds to the database table TAX_PROJECT.MODIFIED_REPORT_CELL * This method corresponds to the database table TAX_PROJECT. INPUT_VAT_INVOICE
* *
* @mbg.generated * @mbg.generated
*/ */
ModifiedReportCell selectByPrimaryKey(Long id); InputVatInvoice selectByPrimaryKey(String id);
/** /**
* This method was generated by MyBatis Generator. * This method was generated by MyBatis Generator.
* This method corresponds to the database table TAX_PROJECT.MODIFIED_REPORT_CELL * This method corresponds to the database table TAX_PROJECT. INPUT_VAT_INVOICE
* *
* @mbg.generated * @mbg.generated
*/ */
int updateByExampleSelective(@Param("record") ModifiedReportCell record, @Param("example") ModifiedReportCellExample example); int updateByExampleSelective(@Param("record") InputVatInvoice record, @Param("example") InputVatInvoiceExample example);
/** /**
* This method was generated by MyBatis Generator. * This method was generated by MyBatis Generator.
* This method corresponds to the database table TAX_PROJECT.MODIFIED_REPORT_CELL * This method corresponds to the database table TAX_PROJECT. INPUT_VAT_INVOICE
* *
* @mbg.generated * @mbg.generated
*/ */
int updateByExample(@Param("record") ModifiedReportCell record, @Param("example") ModifiedReportCellExample example); int updateByExample(@Param("record") InputVatInvoice record, @Param("example") InputVatInvoiceExample example);
/** /**
* This method was generated by MyBatis Generator. * This method was generated by MyBatis Generator.
* This method corresponds to the database table TAX_PROJECT.MODIFIED_REPORT_CELL * This method corresponds to the database table TAX_PROJECT. INPUT_VAT_INVOICE
* *
* @mbg.generated * @mbg.generated
*/ */
int updateByPrimaryKeySelective(ModifiedReportCell record); int updateByPrimaryKeySelective(InputVatInvoice record);
/** /**
* This method was generated by MyBatis Generator. * This method was generated by MyBatis Generator.
* This method corresponds to the database table TAX_PROJECT.MODIFIED_REPORT_CELL * This method corresponds to the database table TAX_PROJECT. INPUT_VAT_INVOICE
* *
* @mbg.generated * @mbg.generated
*/ */
int updateByPrimaryKey(ModifiedReportCell record); int updateByPrimaryKey(InputVatInvoice record);
long getInputVATInvoiceCountByCondition(@Param("paras") InputInvoicePreviewQueryParam param);
List<InputVatInvoice> getInputVATInvoiceCountByConditionWithPaging(@Param("paras") InputInvoicePreviewQueryParam param,
@Param("limitFrom") int limitFrom);
List<InputVATInvoiceResultDto> getInputVATInvoiceResultDto(@Param("dbName") String dbName);
List<CellInvoiceDto> selectInputInvoiceWithItem();
InputVATInvoiceItemExtendDto selectInvoiceExtendDto(@Param("invoiceItemId") String invoiceItemId);
} }
\ No newline at end of file
package pwc.taxtech.atms.vat.dao; package pwc.taxtech.atms.vat.dao;
import java.util.List;
import java.util.Set;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select; import org.apache.ibatis.annotations.Select;
...@@ -12,6 +9,9 @@ import pwc.taxtech.atms.vat.entity.PCTEntity; ...@@ -12,6 +9,9 @@ import pwc.taxtech.atms.vat.entity.PCTEntity;
import pwc.taxtech.atms.vat.entity.PeriodCellData; import pwc.taxtech.atms.vat.entity.PeriodCellData;
import pwc.taxtech.atms.vat.entity.PeriodCellDataExample; import pwc.taxtech.atms.vat.entity.PeriodCellDataExample;
import java.util.List;
import java.util.Set;
@Mapper @Mapper
public interface PeriodCellDataMapper extends MyVatMapper { public interface PeriodCellDataMapper extends MyVatMapper {
/** /**
...@@ -117,13 +117,13 @@ public interface PeriodCellDataMapper extends MyVatMapper { ...@@ -117,13 +117,13 @@ public interface PeriodCellDataMapper extends MyVatMapper {
" PERIOD_CELL_DATA C, " + " PERIOD_CELL_DATA C, " +
" PERIOD_REPORT R " + " PERIOD_REPORT R " +
"WHERE " + "WHERE " +
" C.REPORT_ID = R.ID AND " + " C.REPORT_ID = R.ID" +
" and C.PROJECT_ID = #{projectId} " + " AND C.PROJECT_ID = #{projectId} AND " +
" " + " " +
" <foreach item=\"item\" index=\"index\" collection=\"list\"" + " <foreach item=\"item\" index=\"index\" collection=\"list\"" +
" open=\"(\" separator=\"OR\" close=\")\">" + " open=\"(\" separator=\"OR\" close=\")\">" +
" ( R.PERIOD=#{item.period} AND C.CELL_TEMPLATE_ID=#{item.cellTemplateId} )" + " ( R.PERIOD=#{item.period} AND C.CELL_TEMPLATE_ID=#{item.cellTemplateId} )" +
" </foreach>" + " </foreach>" +
"</script>") "</script>")
List<PCTEntity> queryByPCTs(@Param("list") Set<PCTEntity> parameter,@Param("projectId") String projectId); List<PCTEntity> queryByPCTs(@Param("list") Set<PCTEntity> parameter, @Param("projectId") String projectId);
} }
\ No newline at end of file
package pwc.taxtech.atms.vat.dpo; package pwc.taxtech.atms.vat.dpo;
import pwc.taxtech.atms.CommonUtils; import pwc.taxtech.atms.CommonUtils;
import pwc.taxtech.atms.vat.entity.DataSource;
import pwc.taxtech.atms.vat.entity.PeriodDataSource; import pwc.taxtech.atms.vat.entity.PeriodDataSource;
import java.util.List; import java.util.List;
public class DataSourceExtendDto extends DataSource { public class DataSourceExtendDto extends PeriodDataSource {
private Integer operationType; private Integer operationType;
private Long cellTemplateId; private Long cellTemplateId;
private Long cellDataId; private Long cellDataId;
......
...@@ -5,20 +5,10 @@ ...@@ -5,20 +5,10 @@
<select id="getSumOfBalance" resultType="java.math.BigDecimal"> <select id="getSumOfBalance" resultType="java.math.BigDecimal">
SELECT SELECT
IFNULL ( IFNULL (
SUM ( SUM(
( ( IFNULL ( a.DEBIT_NET, 0 ) - IFNULL ( a.CREDIT_NET, 0 ) ) * #{ direction,,
IFNULL ( jdbcType = INTEGER }
a.DEBIT_NET, ),
0
)
-IFNULL (
a.CREDIT_NET,
0
)
)
* #{direction,,jdbcType=INTEGER}
)
,
0 0
) )
FROM FROM
...@@ -34,19 +24,9 @@ ...@@ -34,19 +24,9 @@
SELECT SELECT
IFNULL ( IFNULL (
( (
( ( IFNULL ( a.DEBIT_NET, 0 ) - IFNULL ( a.CREDIT_NET, 0 ) ) * #{ direction,,
IFNULL ( jdbcType = INTEGER }
a.DEBIT_NET, ),
0
)
-IFNULL (
a.CREDIT_NET,
0
)
)
* #{direction,,jdbcType=INTEGER}
)
,
0 0
) )
FROM FROM
......
...@@ -258,6 +258,7 @@ var app = angular.module('adminApp', ['ui.tree', 'ui.bootstrap', 'ui.bootstrap.t ...@@ -258,6 +258,7 @@ var app = angular.module('adminApp', ['ui.tree', 'ui.bootstrap', 'ui.bootstrap.t
// part names for modules // part names for modules
// AppPart is for the translation of application level, not for a module for a business logic. // AppPart is for the translation of application level, not for a module for a business logic.
appPart: 'app', appPart: 'app',
vat:'vat',
// other parts for business logic // other parts for business logic
//worklist: 'worklist', //worklist: 'worklist',
//registration: 'registration', //registration: 'registration',
......
This diff is collapsed.
This diff is collapsed.
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