Commit 9e7efe14 authored by neo.wang's avatar neo.wang

Merge branch 'dev_oracle_neo' into 'dev_oracle'

Dev oracle neo

See merge request root/atms!123
parents 5d382a4d e890c39b
......@@ -19,14 +19,14 @@ public class SpringContextUtil implements ApplicationContextAware {
private static ApplicationContext webApplicationContext;
public static FormulaAdminMapper formulaAdminMapper;
public static ReportMapper reportMapper;
public static PeriodReportMapper reportMapper;
public static CellDataMapper cellDataMapper;
public static DistributedIdService distributedIdService;
public static PeriodFormulaBlockMapper formulaBlockMapper;
public static PeriodCellTemplateMapper periodCellTemplateMapper;
public static ProjectServiceTypeMapper projectServiceTypeMapper;
public static PeriodTemplateMapper periodTemplateMapper;
public static VatStandardAccountMapper vatStandardAccountMapper;
public static PeriodStandardAccountMapper periodStandardAccountMapper;
public static ProjectDao projectDao;
public static BalanceMapper balanceMapper;
public static DataSourceMapper dataSourceMapper;
......@@ -59,14 +59,14 @@ public class SpringContextUtil implements ApplicationContextAware {
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
webApplicationContext = applicationContext;
formulaAdminMapper = webApplicationContext.getBean(FormulaAdminMapper.class);
reportMapper = webApplicationContext.getBean(ReportMapper.class);
reportMapper = webApplicationContext.getBean(PeriodReportMapper.class);
cellDataMapper = webApplicationContext.getBean(CellDataMapper.class);
distributedIdService = webApplicationContext.getBean(DistributedIdService.class);
formulaBlockMapper = webApplicationContext.getBean(PeriodFormulaBlockMapper.class);
periodCellTemplateMapper = webApplicationContext.getBean(PeriodCellTemplateMapper.class);
projectServiceTypeMapper = webApplicationContext.getBean(ProjectServiceTypeMapper.class);
periodTemplateMapper = webApplicationContext.getBean(PeriodTemplateMapper.class);
vatStandardAccountMapper = webApplicationContext.getBean(VatStandardAccountMapper.class);
periodStandardAccountMapper = webApplicationContext.getBean(PeriodStandardAccountMapper.class);
projectDao = webApplicationContext.getBean(ProjectDao.class);
balanceMapper = webApplicationContext.getBean(BalanceMapper.class);
dataSourceMapper = webApplicationContext.getBean(DataSourceMapper.class);
......
......@@ -2,7 +2,13 @@ package pwc.taxtech.atms.controller;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import pwc.taxtech.atms.constant.enums.EnumServiceType;
import pwc.taxtech.atms.dpo.ReportDto;
import pwc.taxtech.atms.dto.OperationResultDto;
......@@ -48,24 +54,24 @@ public class ReportController {
}
@RequestMapping(value = "reportData/{reportId}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public OperationResultDto<ReportDataDto> getReportData(@PathVariable Long reportId) {
public OperationResultDto<ReportDataDto> getReportData(@PathVariable Long reportId, @RequestHeader String from) {
OperationResultDto resultDto = new OperationResultDto();
if (reportId == null || reportId == 0L) {
resultDto.setResult(false);
return resultDto;
}
return reportService.getCellData(reportId);
return reportService.getCellData(reportId, from);
}
@RequestMapping(value = "report/{templateId}/{period}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public OperationResultDto<ReportDto> getReportByTemplate(@PathVariable Long templateId, @PathVariable Integer period) {
public OperationResultDto<ReportDto> getReportByTemplate(@PathVariable Long templateId, @PathVariable Integer period, @RequestHeader String from) {
OperationResultDto resultDto = new OperationResultDto();
if (templateId == null || templateId == 0L || period == null || period == 0) {
resultDto.setResult(false);
resultDto.setResultMsg("templateId or period is invalid");
return resultDto;
}
return reportService.getReportByTemplate(templateId, period);
return reportService.getReportByTemplate(templateId, period, from);
}
@RequestMapping(value = "getCellTemplateConfig/{reportTemplateId}/{period}/{rowIndex}/{columnIndex}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
......@@ -84,8 +90,8 @@ public class ReportController {
}
@RequestMapping(value = "addCellManualData", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public OperationResultDto addCellManualDataSource(@RequestBody ManualDataSourceDto data) {
return reportService.addCellManualDataSource(data);
public OperationResultDto addCellManualDataSource(@RequestBody ManualDataSourceDto data, @RequestHeader String from) {
return reportService.addCellManualDataSource(data, from);
}
@RequestMapping(value = "addDataSource", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
......
......@@ -2,7 +2,6 @@ package pwc.taxtech.atms.service.impl;
import com.google.common.base.Predicate;
import com.google.common.collect.Lists;
import org.mybatis.spring.SqlSessionTemplate;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -15,7 +14,6 @@ import pwc.taxtech.atms.dao.ProjectClientMapper;
import pwc.taxtech.atms.dao.ProjectMapper;
import pwc.taxtech.atms.dao.ProjectServiceTypeMapper;
import pwc.taxtech.atms.dao.ServiceTypeMapper;
import pwc.taxtech.atms.dao.StandardAccountMapper;
import pwc.taxtech.atms.dao.TemplateGroupMapper;
import pwc.taxtech.atms.dpo.ProjectDisplayDto;
import pwc.taxtech.atms.dto.FieldsMapper;
......@@ -26,9 +24,7 @@ import pwc.taxtech.atms.dto.taxadmin.AddProjectResult;
import pwc.taxtech.atms.dto.taxadmin.ProjectYearParam;
import pwc.taxtech.atms.entity.*;
import pwc.taxtech.atms.entity.ProjectClientExample.Criteria;
import pwc.taxtech.atms.service.OperationLogService;
import pwc.taxtech.atms.service.ProjectService;
import pwc.taxtech.atms.vat.dao.VatStandardAccountMapper;
import java.util.ArrayList;
import java.util.Calendar;
......@@ -64,17 +60,6 @@ public class ProjectServiceImpl implements ProjectService {
@Autowired
private ProjectServiceTypeMapper projectServiceTypeMapper;
@Autowired
private OperationLogService operationLogService;
@Autowired
private SqlSessionTemplate dynamicSqlSessionTemplate;
@Autowired
private StandardAccountMapper standardAccountMapper;
@Autowired
private VatStandardAccountMapper vatStandardAccountMapper;
@Value("${jdbc_admin_db}")
private String adminDbName;
......
......@@ -24,9 +24,9 @@ public interface ReportService {
List<CellTemplateReferenceDto> getTemplateReferences(int period);
OperationResultDto<ReportDataDto> getCellData(Long reportId);
OperationResultDto<ReportDataDto> getCellData(Long reportId, String porjectId);
OperationResultDto<ReportDto> getReportByTemplate(Long templateId, Integer period);
OperationResultDto<ReportDto> getReportByTemplate(Long templateId, Integer period, String projectId);
OperationResultDto<PeriodCellTemplateConfig> getCellTemplateConfig(Long reportTemplateId, Integer periodParam, int rowIndex, int columnIndex);
......@@ -40,7 +40,7 @@ public interface ReportService {
* @param data 数据源数据
* @return 添加结果
*/
OperationResultDto addCellManualDataSource(ManualDataSourceDto data);
OperationResultDto addCellManualDataSource(ManualDataSourceDto data, String projectId);
OperationResultDto<String> addDataSource(DataSourceDto datasource);
......
......@@ -11,11 +11,11 @@ import pwc.taxtech.atms.entity.ProjectServiceType;
import pwc.taxtech.atms.entity.ProjectServiceTypeExample;
import pwc.taxtech.atms.exception.Exceptions;
import pwc.taxtech.atms.vat.dao.CellDataMapper;
import pwc.taxtech.atms.vat.dao.ReportMapper;
import pwc.taxtech.atms.vat.dao.PeriodReportMapper;
import pwc.taxtech.atms.vat.entity.CellData;
import pwc.taxtech.atms.vat.entity.CellDataExample;
import pwc.taxtech.atms.vat.entity.Report;
import pwc.taxtech.atms.vat.entity.ReportExample;
import pwc.taxtech.atms.vat.entity.PeriodReport;
import pwc.taxtech.atms.vat.entity.PeriodReportExample;
import java.util.List;
......@@ -26,7 +26,7 @@ public class FormulaAgent extends VatAbstractService {
@Autowired
public FormulaAdminMapper adminMp;
@Autowired
public ReportMapper reportMapper;
public PeriodReportMapper periodReportMapper;
@Autowired
public CellDataMapper cellDataMapper;
......@@ -50,11 +50,11 @@ public class FormulaAgent extends VatAbstractService {
return cellTemplates;
}
private Report getReportByTemplate(String templateId, Integer periodId) {
ReportExample example = new ReportExample();
example.createCriteria().andTemplateIdEqualTo(Long.valueOf(templateId))
private PeriodReport getReportByTemplate(String templateId, Integer periodId, String projectId) {
PeriodReportExample example = new PeriodReportExample();
example.createCriteria().andProjectIdEqualTo(projectId).andTemplateIdEqualTo(Long.valueOf(templateId))
.andPeriodEqualTo(periodId);
List<Report> reports = reportMapper.selectByExample(example);
List<PeriodReport> reports = periodReportMapper.selectByExample(example);
if (reports != null && !reports.isEmpty()) return reports.get(FIRST_OR_DEFAULT);
return null;
......@@ -73,8 +73,8 @@ public class FormulaAgent extends VatAbstractService {
return adminMp.getPastProjectId(year, orgId);
}
public CellData getCellData(String templateId, String cellId, int periodId) {
Report report = getReportByTemplate(templateId, periodId);
public CellData getCellData(String templateId, String cellId, int periodId, String projectId) {
PeriodReport report = getReportByTemplate(templateId, periodId, projectId);
MyAsserts.assertNotNull(report, Exceptions.BB_REPORT_NULL);
CellData cellData = getCellDataListByTemplate(cellId, report.getId());
......
......@@ -49,6 +49,7 @@ import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
import static pwc.taxtech.atms.common.util.SpringContextUtil.reportMapper;
import static pwc.taxtech.atms.constant.Constant.EMPTY;
@Component
......@@ -70,7 +71,7 @@ public class ReportGeneratorImpl extends VatAbstractService implements ReportGen
Project project = projectMapper.selectByPrimaryKey(projectId);
PeriodTemplateExample periodTemplateExample = new PeriodTemplateExample();
periodTemplateExample.createCriteria().andIdIn(templateIds);
periodTemplateExample.createCriteria().andProjectIdEqualTo(projectId).andPeriodEqualTo(period).andIdIn(templateIds);
List<PeriodTemplate> periodTemplateList = periodTemplateMapper.selectByExample(periodTemplateExample);
List<Long> periodTemplateIdList = periodTemplateList.stream()
.map(PeriodTemplate::getTemplateId)
......@@ -196,7 +197,7 @@ public class ReportGeneratorImpl extends VatAbstractService implements ReportGen
if (templateId > 0) {
//todo: create report into DB
Report report = new Report();
PeriodReport report = new PeriodReport();
Long reportId = distributedIdService.nextId();
report.setId(reportId);
report.setTemplateId(templateId);
......@@ -206,6 +207,7 @@ public class ReportGeneratorImpl extends VatAbstractService implements ReportGen
report.setCreateTime(createTime);
report.setUpdateBy("Admin");
report.setUpdateTime(createTime);
report.setProjectId(projectId);
reportMapper.insertSelective(report);
List<PeriodCellTemplateConfig> periodCellTemplateConfigs = periodCellTemplateConfigList.stream()
......
......@@ -367,13 +367,16 @@ public class ReportServiceImpl extends VatAbstractService implements ReportServi
PeriodTemplateExample periodTemplateExample = new PeriodTemplateExample();
periodTemplateExample.createCriteria()
.andTemplateGroupIdEqualTo(templateGroupId.get())
.andProjectIdEqualTo(projectId)
.andPeriodEqualTo(period)
.andIsActiveAssociationEqualTo(true)
.andReportTypeEqualTo(reportType);
templateIds = periodTemplateMapper.selectByExample(periodTemplateExample).stream().map(PeriodTemplate::getId).collect(Collectors.toList());
} else {
PeriodTemplateExample periodTemplateExample = new PeriodTemplateExample();
periodTemplateExample.createCriteria().andTemplateGroupIdEqualTo(templateGroupId.get()).andPeriodEqualTo(period).andIsActiveAssociationEqualTo(true);
periodTemplateExample.createCriteria().andTemplateGroupIdEqualTo(templateGroupId.get())
.andProjectIdEqualTo(projectId)
.andPeriodEqualTo(period).andIsActiveAssociationEqualTo(true);
templateIds = periodTemplateMapper.selectByExample(periodTemplateExample).stream().map(PeriodTemplate::getId).collect(Collectors.toList());
}
......@@ -396,11 +399,11 @@ public class ReportServiceImpl extends VatAbstractService implements ReportServi
}
@Override
public OperationResultDto<ReportDataDto> getCellData(Long reportId) {
public OperationResultDto<ReportDataDto> getCellData(Long reportId, String projectId) {
OperationResultDto resultDto = new OperationResultDto();
ReportDataDto dataDto = new ReportDataDto();
try {
Report report = reportMapper.selectByPrimaryKey(reportId);
PeriodReport report = periodReportMapper.selectByPrimaryKey(reportId);
if (report == null) {
resultDto.setResult(false);
resultDto.setResultMsg("NoReport");
......@@ -408,7 +411,7 @@ public class ReportServiceImpl extends VatAbstractService implements ReportServi
}
PeriodTemplateExample example = new PeriodTemplateExample();
example.createCriteria().andTemplateIdEqualTo(report.getTemplateId()).andPeriodEqualTo(report.getPeriod());
example.createCriteria().andProjectIdEqualTo(projectId).andTemplateIdEqualTo(report.getTemplateId()).andPeriodEqualTo(report.getPeriod());
Optional<PeriodTemplate> reportTemplate = periodTemplateMapper.selectByExample(example).stream().findFirst();
if (!reportTemplate.isPresent()) {
resultDto.setResult(false);
......@@ -425,6 +428,7 @@ public class ReportServiceImpl extends VatAbstractService implements ReportServi
PeriodTemplateExample periodTemplateExample = new PeriodTemplateExample();
periodTemplateExample.createCriteria()
.andProjectIdEqualTo(projectId)
.andTemplateGroupIdEqualTo(reportTemplate.get().getTemplateGroupId())
.andPeriodEqualTo(report.getPeriod())
.andIsActiveAssociationEqualTo(true);
......@@ -604,12 +608,12 @@ public class ReportServiceImpl extends VatAbstractService implements ReportServi
}
@Override
public OperationResultDto<ReportDto> getReportByTemplate(Long templateId, Integer period) {
public OperationResultDto<ReportDto> getReportByTemplate(Long templateId, Integer period, String projectId) {
OperationResultDto resultDto = new OperationResultDto();
try {
ReportExample example = new ReportExample();
example.createCriteria().andTemplateIdEqualTo(templateId).andPeriodEqualTo(period);
Optional<Report> report = reportMapper.selectByExample(example).stream().findFirst();
PeriodReportExample example = new PeriodReportExample();
example.createCriteria().andProjectIdEqualTo(projectId).andTemplateIdEqualTo(templateId).andPeriodEqualTo(period);
Optional<PeriodReport> report = periodReportMapper.selectByExample(example).stream().findFirst();
if (report.isPresent()) {
resultDto.setResult(true);
ReportDto reportDto = new ReportDto();
......@@ -717,7 +721,7 @@ public class ReportServiceImpl extends VatAbstractService implements ReportServi
}
@Override
public OperationResultDto addCellManualDataSource(ManualDataSourceDto data) {
public OperationResultDto addCellManualDataSource(ManualDataSourceDto data, String projectId) {
OperationResultDto operationResultDto = new OperationResultDto();
try {
......@@ -806,9 +810,9 @@ public class ReportServiceImpl extends VatAbstractService implements ReportServi
templateId = periodCellTemplate.get().getReportTemplateId();
}
//3. use the template id get the reportid, use the reportid get the celltemplateids, then use the celltemplateids and cell name get the datasource which should be updated.
ReportExample reportExample = new ReportExample();
reportExample.createCriteria().andTemplateIdEqualTo(templateId).andPeriodEqualTo(data.getPeriod());
Optional<Report> report = reportMapper.selectByExample(reportExample).stream().findFirst();
PeriodReportExample reportExample = new PeriodReportExample();
reportExample.createCriteria().andProjectIdEqualTo(projectId).andTemplateIdEqualTo(templateId).andPeriodEqualTo(data.getPeriod());
Optional<PeriodReport> report = periodReportMapper.selectByExample(reportExample).stream().findFirst();
if (report.isPresent()) {
Long reportId = report.get().getId();
CellDataExample cellDataExample = new CellDataExample();
......
......@@ -20,7 +20,7 @@ public class VatAbstractService {
@Autowired
public VatEnterpriseAccountMapper vatEnterpriseAccountMapper;
@Autowired
public VatStandardAccountMapper vatStandardAccountMapper;
public PeriodStandardAccountMapper periodStandardAccountMapper;
@Autowired
public InputVatInvoiceMapper inputVATInvoiceMapper;
@Autowired
......@@ -72,7 +72,7 @@ public class VatAbstractService {
@Autowired
public PeriodFormulaBlockMapper periodFormulaBlockMapper;
@Autowired
public ReportMapper reportMapper;
public PeriodReportMapper periodReportMapper;
@Autowired
public CellDataMapper cellDataMapper;
@Autowired
......
......@@ -114,7 +114,7 @@ public class BB extends FunctionBase implements FreeRefFunction {
MyAsserts.assertNotEmpty(projectId, Exceptions.PROJECT_EMPTY);
cellData = agent.getCellData(cellTemplateData.getReportTemplateId(),
cellTemplateData.getCellTemplateId(), curPeriod.getCurPeriod());
cellTemplateData.getCellTemplateId(), curPeriod.getCurPeriod(), formulaContext.getProjectId());
nullCellDto.extractFromGroup(bo, curPeriod, cellData, cellTemplateData);
// todo: fix datasource name by templateList(neo)
......
......@@ -67,7 +67,8 @@ public class FSJZ extends FunctionBase implements FreeRefFunction {
if (accountType == 0) {
//标准账套
VatStandardAccount vatStandardAccount = SpringContextUtil.vatStandardAccountMapper.selectOneByAccountCode(accountCode);
VatStandardAccount vatStandardAccount = SpringContextUtil.periodStandardAccountMapper.selectOneByAccountCode(accountCode,
formulaContext.getProjectId());
if (vatStandardAccount == null) {
return NumberEval.ZERO;
}
......@@ -132,7 +133,7 @@ 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());
//save formulablock
saveFormulaBlock(period, ec, formulaExpression, val, dataSourceId);
......@@ -196,7 +197,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());
//save formulablock
saveFormulaBlock(period, ec, formulaExpression, val, dataSourceId);
return new NumberEval(val.doubleValue());
......
......@@ -2,12 +2,9 @@ package pwc.taxtech.atms.vat.service.impl.report.functions;
import pwc.taxtech.atms.common.util.SpringContextUtil;
import pwc.taxtech.atms.constant.enums.KeyValueConfigResultType;
import pwc.taxtech.atms.vat.entity.PeriodTemplate;
import pwc.taxtech.atms.vat.entity.PeriodTemplateExample;
import java.math.BigDecimal;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class FormulaHelper {
......
......@@ -69,11 +69,11 @@ public class GZSD extends FunctionBase implements FreeRefFunction {
List<PeriodTaxRuleSetting> taxRuleSettings =
SpringContextUtil.periodTaxRuleSettingMapper.getTaxRuleSetting(formulaContext.getOrganizationId(),
taxName, formulaContext.getPeriod());
taxName, formulaContext.getPeriod(), formulaContext.getProjectId());
Optional<PeriodTaxRuleSetting> matchedRule = taxRuleSettings.stream().filter(a -> a.getIsDefault() != Constant.IsDefault.Yes).findFirst();
if (!matchedRule.isPresent()) {
matchedRule = Optional.ofNullable(taxRuleSettings.size()>0?taxRuleSettings.get(0):null);
matchedRule = Optional.ofNullable(taxRuleSettings.size() > 0 ? taxRuleSettings.get(0) : null);
if (!matchedRule.isPresent()) {
NumberFormat nf = NumberFormat.getPercentInstance();
......
......@@ -7,7 +7,7 @@ import org.apache.poi.ss.formula.eval.ValueEval;
import org.apache.poi.ss.formula.functions.FreeRefFunction;
import pwc.taxtech.atms.common.util.SpringContextUtil;
import pwc.taxtech.atms.constant.Constant;
import pwc.taxtech.atms.vat.entity.Report;
import pwc.taxtech.atms.vat.entity.PeriodReport;
import java.util.Calendar;
import java.util.Date;
......@@ -56,7 +56,7 @@ public class ProjectContext extends FunctionBase implements FreeRefFunction {
, formulaContext.getPeriod(), calendar.get(Calendar.DAY_OF_MONTH), formulaContext.getYear()
, formulaContext.getPeriod(), calendar2.get(Calendar.DAY_OF_MONTH)));
case "FillForm":
Report report = SpringContextUtil.reportMapper.selectByPrimaryKey(formulaContext.getReportId());
PeriodReport report = SpringContextUtil.reportMapper.selectByPrimaryKey(formulaContext.getReportId());
if (report != null) {
return new StringEval(String.format(Constant.ReportBuildInStringFormat.FillForm, report.getUpdateTime().getYear()
, report.getUpdateTime().getMonth(), report.getUpdateTime().getDay()));
......
package pwc.taxtech.atms.vat.dao;
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.dpo.TrialBalanceDto;
import pwc.taxtech.atms.vat.entity.PeriodStandardAccount;
import pwc.taxtech.atms.vat.entity.PeriodStandardAccountExample;
import pwc.taxtech.atms.vat.entity.VatStandardAccount;
import java.util.List;
@Mapper
public interface PeriodStandardAccountMapper extends MyVatMapper {
......@@ -105,4 +108,9 @@ public interface PeriodStandardAccountMapper extends MyVatMapper {
* @mbg.generated
*/
int updateByPrimaryKey(PeriodStandardAccount record);
List<TrialBalanceDto> selectProjectStandardAccountLeftJoinBalanceStdManual(@Param("fromMonth") String fromMonth, @Param("toMonth") String toMonth,
@Param("projectId") String projectId);
VatStandardAccount selectOneByAccountCode(@Param("accountCode") String accountCode, @Param("projectId") String projectId);
}
\ No newline at end of file
......@@ -109,5 +109,6 @@ public interface PeriodTaxRuleSettingMapper extends MyVatMapper {
List<PeriodTaxRuleSetting> getTaxRuleSetting(@Param("organizationId") String organizationId,
@Param("taxName") String taxName, @Param("period") int period);
@Param("taxName") String taxName, @Param("period") int period,
@Param("projectId") String projectId);
}
\ No newline at end of file
package pwc.taxtech.atms.vat.dao;
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.Report;
import pwc.taxtech.atms.vat.entity.ReportExample;
@Mapper
public interface ReportMapper extends MyVatMapper {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table TAX_PROJECT.REPORT
*
* @mbg.generated
*/
long countByExample(ReportExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table TAX_PROJECT.REPORT
*
* @mbg.generated
*/
int deleteByExample(ReportExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table TAX_PROJECT.REPORT
*
* @mbg.generated
*/
int deleteByPrimaryKey(Long id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table TAX_PROJECT.REPORT
*
* @mbg.generated
*/
int insert(Report record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table TAX_PROJECT.REPORT
*
* @mbg.generated
*/
int insertSelective(Report record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table TAX_PROJECT.REPORT
*
* @mbg.generated
*/
List<Report> selectByExampleWithRowbounds(ReportExample example, RowBounds rowBounds);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table TAX_PROJECT.REPORT
*
* @mbg.generated
*/
List<Report> selectByExample(ReportExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table TAX_PROJECT.REPORT
*
* @mbg.generated
*/
Report selectByPrimaryKey(Long id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table TAX_PROJECT.REPORT
*
* @mbg.generated
*/
int updateByExampleSelective(@Param("record") Report record, @Param("example") ReportExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table TAX_PROJECT.REPORT
*
* @mbg.generated
*/
int updateByExample(@Param("record") Report record, @Param("example") ReportExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table TAX_PROJECT.REPORT
*
* @mbg.generated
*/
int updateByPrimaryKeySelective(Report record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table TAX_PROJECT.REPORT
*
* @mbg.generated
*/
int updateByPrimaryKey(Report record);
}
\ No newline at end of file
package pwc.taxtech.atms.vat.dao;
import java.util.List;
import java.util.Map;
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.dpo.TrialBalanceDto;
import pwc.taxtech.atms.vat.entity.VatStandardAccount;
import pwc.taxtech.atms.vat.entity.VatStandardAccountExample;
@Mapper
public interface VatStandardAccountMapper extends MyVatMapper {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table TAX_PROJECT. StandardAccount
*
* @mbg.generated
*/
long countByExample(VatStandardAccountExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table TAX_PROJECT. StandardAccount
*
* @mbg.generated
*/
int deleteByExample(VatStandardAccountExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table TAX_PROJECT. StandardAccount
*
* @mbg.generated
*/
int deleteByPrimaryKey(String id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table TAX_PROJECT. StandardAccount
*
* @mbg.generated
*/
int insert(VatStandardAccount record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table TAX_PROJECT. StandardAccount
*
* @mbg.generated
*/
int insertSelective(VatStandardAccount record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table TAX_PROJECT. StandardAccount
*
* @mbg.generated
*/
List<VatStandardAccount> selectByExampleWithRowbounds(VatStandardAccountExample example, RowBounds rowBounds);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table TAX_PROJECT. StandardAccount
*
* @mbg.generated
*/
List<VatStandardAccount> selectByExample(VatStandardAccountExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table TAX_PROJECT. StandardAccount
*
* @mbg.generated
*/
VatStandardAccount selectByPrimaryKey(String id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table TAX_PROJECT. StandardAccount
*
* @mbg.generated
*/
int updateByExampleSelective(@Param("record") VatStandardAccount record, @Param("example") VatStandardAccountExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table TAX_PROJECT. StandardAccount
*
* @mbg.generated
*/
int updateByExample(@Param("record") VatStandardAccount record, @Param("example") VatStandardAccountExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table TAX_PROJECT. StandardAccount
*
* @mbg.generated
*/
int updateByPrimaryKeySelective(VatStandardAccount record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table TAX_PROJECT. StandardAccount
*
* @mbg.generated
*/
int updateByPrimaryKey(VatStandardAccount record);
List<TrialBalanceDto> selectProjectStandardAccountLeftJoinBalanceStdManual(@Param("fromMonth") String fromMonth, @Param("toMonth") String toMonth);
VatStandardAccount selectOneByAccountCode(@Param("accountCode") String accountCode);
}
\ No newline at end of file
package pwc.taxtech.atms.vat.entity;
import java.io.Serializable;
import java.util.Date;
/**
*
* This class was generated by MyBatis Generator.
* This class corresponds to the database table TAX_PROJECT.REPORT
*
* @mbg.generated do_not_delete_during_merge
*/
public class Report implements Serializable {
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column TAX_PROJECT.REPORT.ID
*
* @mbg.generated
*/
private Long id;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column TAX_PROJECT.REPORT.TEMPLATE_ID
*
* @mbg.generated
*/
private Long templateId;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column TAX_PROJECT.REPORT.PERIOD
*
* @mbg.generated
*/
private Integer period;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column TAX_PROJECT.REPORT.PROJECT_ID
*
* @mbg.generated
*/
private String projectId;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column TAX_PROJECT.REPORT.CREATE_BY
*
* @mbg.generated
*/
private String createBy;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column TAX_PROJECT.REPORT.CREATE_TIME
*
* @mbg.generated
*/
private Date createTime;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column TAX_PROJECT.REPORT.UPDATE_BY
*
* @mbg.generated
*/
private String updateBy;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column TAX_PROJECT.REPORT.UPDATE_TIME
*
* @mbg.generated
*/
private Date updateTime;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table TAX_PROJECT.REPORT
*
* @mbg.generated
*/
private static final long serialVersionUID = 1L;
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column TAX_PROJECT.REPORT.ID
*
* @return the value of TAX_PROJECT.REPORT.ID
*
* @mbg.generated
*/
public Long getId() {
return id;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column TAX_PROJECT.REPORT.ID
*
* @param id the value for TAX_PROJECT.REPORT.ID
*
* @mbg.generated
*/
public void setId(Long id) {
this.id = id;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column TAX_PROJECT.REPORT.TEMPLATE_ID
*
* @return the value of TAX_PROJECT.REPORT.TEMPLATE_ID
*
* @mbg.generated
*/
public Long getTemplateId() {
return templateId;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column TAX_PROJECT.REPORT.TEMPLATE_ID
*
* @param templateId the value for TAX_PROJECT.REPORT.TEMPLATE_ID
*
* @mbg.generated
*/
public void setTemplateId(Long templateId) {
this.templateId = templateId;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column TAX_PROJECT.REPORT.PERIOD
*
* @return the value of TAX_PROJECT.REPORT.PERIOD
*
* @mbg.generated
*/
public Integer getPeriod() {
return period;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column TAX_PROJECT.REPORT.PERIOD
*
* @param period the value for TAX_PROJECT.REPORT.PERIOD
*
* @mbg.generated
*/
public void setPeriod(Integer period) {
this.period = period;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column TAX_PROJECT.REPORT.PROJECT_ID
*
* @return the value of TAX_PROJECT.REPORT.PROJECT_ID
*
* @mbg.generated
*/
public String getProjectId() {
return projectId;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column TAX_PROJECT.REPORT.PROJECT_ID
*
* @param projectId the value for TAX_PROJECT.REPORT.PROJECT_ID
*
* @mbg.generated
*/
public void setProjectId(String projectId) {
this.projectId = projectId == null ? null : projectId.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column TAX_PROJECT.REPORT.CREATE_BY
*
* @return the value of TAX_PROJECT.REPORT.CREATE_BY
*
* @mbg.generated
*/
public String getCreateBy() {
return createBy;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column TAX_PROJECT.REPORT.CREATE_BY
*
* @param createBy the value for TAX_PROJECT.REPORT.CREATE_BY
*
* @mbg.generated
*/
public void setCreateBy(String createBy) {
this.createBy = createBy == null ? null : createBy.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column TAX_PROJECT.REPORT.CREATE_TIME
*
* @return the value of TAX_PROJECT.REPORT.CREATE_TIME
*
* @mbg.generated
*/
public Date getCreateTime() {
return createTime;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column TAX_PROJECT.REPORT.CREATE_TIME
*
* @param createTime the value for TAX_PROJECT.REPORT.CREATE_TIME
*
* @mbg.generated
*/
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column TAX_PROJECT.REPORT.UPDATE_BY
*
* @return the value of TAX_PROJECT.REPORT.UPDATE_BY
*
* @mbg.generated
*/
public String getUpdateBy() {
return updateBy;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column TAX_PROJECT.REPORT.UPDATE_BY
*
* @param updateBy the value for TAX_PROJECT.REPORT.UPDATE_BY
*
* @mbg.generated
*/
public void setUpdateBy(String updateBy) {
this.updateBy = updateBy == null ? null : updateBy.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column TAX_PROJECT.REPORT.UPDATE_TIME
*
* @return the value of TAX_PROJECT.REPORT.UPDATE_TIME
*
* @mbg.generated
*/
public Date getUpdateTime() {
return updateTime;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column TAX_PROJECT.REPORT.UPDATE_TIME
*
* @param updateTime the value for TAX_PROJECT.REPORT.UPDATE_TIME
*
* @mbg.generated
*/
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table TAX_PROJECT.REPORT
*
* @mbg.generated
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", templateId=").append(templateId);
sb.append(", period=").append(period);
sb.append(", projectId=").append(projectId);
sb.append(", createBy=").append(createBy);
sb.append(", createTime=").append(createTime);
sb.append(", updateBy=").append(updateBy);
sb.append(", updateTime=").append(updateTime);
sb.append("]");
return sb.toString();
}
}
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="pwc.taxtech.atms.vat.dao.VatStandardAccountMapper">
<mapper namespace="pwc.taxtech.atms.vat.dao.PeriodStandardAccountMapper">
<resultMap id="TrialBalanceDto" type="pwc.taxtech.atms.dto.vatdto.TrialBalanceDto">
<id column="BalanceId" jdbcType="VARCHAR" property="balanceId"/>
......@@ -52,13 +52,14 @@
A.ACCT_PROP,
A.DIRECTION
FROM
STANDARD_ACCOUNT A
PERIOD_STANDARD_ACCOUNT A
JOIN
BALANCE_STD_MANUAL B
PERIOD_BALANCE_STD_MANUAL B
ON
A.`CODE` = B.ACCT_CODE
WHERE
1=1
AND A.PROJECT_ID= #{projectId,jdbcType=VARCHAR}
<if test="fromMonth!=null">
AND B.PERIOD_ID &gt;= #{fromMonth,jdbcType=VARCHAR}
</if>
......@@ -73,9 +74,11 @@
SELECT
*
FROM
STANDARD_ACCOUNT A
PERIOD_STANDARD_ACCOUNT A
WHERE
A.CODE= #{accountCode,jdbcType=VARCHAR} LIMIT 1
A.CODE= #{accountCode,jdbcType=VARCHAR}
AND A.PROJECT_ID= #{projectId,jdbcType=VARCHAR}
LIMIT 1
</select>
</mapper>
\ No newline at end of file
......@@ -20,6 +20,7 @@
)
AND TRS.NAME = #{taxName,jdbcType=VARCHAR}
AND TRS.PERIOD = #{period,jdbcType=INTEGER}
AND TRS.PROJECT_ID = #{projectId,jdbcType=INTEGER}
</select>
</mapper>
\ No newline at end of file
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