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