Commit ebe177ae 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/common/util/SpringContextUtil.java
#	atms-api/src/main/java/pwc/taxtech/atms/vat/service/impl/FormulaAgent.java
#	atms-api/src/main/java/pwc/taxtech/atms/vat/service/impl/ReportServiceImpl.java
#	atms-api/src/main/java/pwc/taxtech/atms/vat/service/impl/VatAbstractService.java
#	atms-api/src/main/java/pwc/taxtech/atms/vat/service/impl/report/functions/FSJZ.java
#	atms-api/src/main/java/pwc/taxtech/atms/vat/service/impl/report/functions/FunctionBase.java
#	atms-dao/src/main/java/pwc/taxtech/atms/vat/dao/PeriodStandardAccountMapper.java
parents 8234757b 68fdc975
...@@ -19,7 +19,7 @@ public class SpringContextUtil implements ApplicationContextAware { ...@@ -19,7 +19,7 @@ public class SpringContextUtil implements ApplicationContextAware {
private static ApplicationContext webApplicationContext; private static ApplicationContext webApplicationContext;
public static FormulaAdminMapper formulaAdminMapper; public static FormulaAdminMapper formulaAdminMapper;
public static ReportMapper reportMapper; public static PeriodReportMapper reportMapper;
public static CellDataMapper cellDataMapper; public static CellDataMapper cellDataMapper;
public static PeriodCellDataMapper periodCellDataMapper; public static PeriodCellDataMapper periodCellDataMapper;
public static DistributedIdService distributedIdService; public static DistributedIdService distributedIdService;
...@@ -27,7 +27,6 @@ public class SpringContextUtil implements ApplicationContextAware { ...@@ -27,7 +27,6 @@ public class SpringContextUtil implements ApplicationContextAware {
public static PeriodCellTemplateMapper periodCellTemplateMapper; public static PeriodCellTemplateMapper periodCellTemplateMapper;
public static ProjectServiceTypeMapper projectServiceTypeMapper; public static ProjectServiceTypeMapper projectServiceTypeMapper;
public static PeriodTemplateMapper periodTemplateMapper; public static PeriodTemplateMapper periodTemplateMapper;
public static VatStandardAccountMapper vatStandardAccountMapper;
public static PeriodStandardAccountMapper periodStandardAccountMapper; public static PeriodStandardAccountMapper periodStandardAccountMapper;
public static ProjectDao projectDao; public static ProjectDao projectDao;
public static BalanceMapper balanceMapper; public static BalanceMapper balanceMapper;
...@@ -65,7 +64,7 @@ public class SpringContextUtil implements ApplicationContextAware { ...@@ -65,7 +64,7 @@ public class SpringContextUtil implements ApplicationContextAware {
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException { public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
webApplicationContext = applicationContext; webApplicationContext = applicationContext;
formulaAdminMapper = webApplicationContext.getBean(FormulaAdminMapper.class); formulaAdminMapper = webApplicationContext.getBean(FormulaAdminMapper.class);
reportMapper = webApplicationContext.getBean(ReportMapper.class); reportMapper = webApplicationContext.getBean(PeriodReportMapper.class);
cellDataMapper = webApplicationContext.getBean(CellDataMapper.class); cellDataMapper = webApplicationContext.getBean(CellDataMapper.class);
periodCellDataMapper = webApplicationContext.getBean(PeriodCellDataMapper.class); periodCellDataMapper = webApplicationContext.getBean(PeriodCellDataMapper.class);
distributedIdService = webApplicationContext.getBean(DistributedIdService.class); distributedIdService = webApplicationContext.getBean(DistributedIdService.class);
...@@ -73,7 +72,7 @@ public class SpringContextUtil implements ApplicationContextAware { ...@@ -73,7 +72,7 @@ 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);
vatStandardAccountMapper = webApplicationContext.getBean(VatStandardAccountMapper.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);
......
...@@ -13,6 +13,7 @@ import org.springframework.web.multipart.MultipartHttpServletRequest; ...@@ -13,6 +13,7 @@ import org.springframework.web.multipart.MultipartHttpServletRequest;
import pwc.taxtech.atms.constant.enums.EnumModule; import pwc.taxtech.atms.constant.enums.EnumModule;
import pwc.taxtech.atms.dpo.PagingResultDto; import pwc.taxtech.atms.dpo.PagingResultDto;
import pwc.taxtech.atms.dto.vatdto.ImportOutputInvoiceDto; import pwc.taxtech.atms.dto.vatdto.ImportOutputInvoiceDto;
import pwc.taxtech.atms.dto.vatdto.OutputInvoice;
import pwc.taxtech.atms.dto.vatdto.QueryEvidenceDto; import pwc.taxtech.atms.dto.vatdto.QueryEvidenceDto;
import pwc.taxtech.atms.service.IdentityService; import pwc.taxtech.atms.service.IdentityService;
import pwc.taxtech.atms.thirdparty.ExcelUtil; import pwc.taxtech.atms.thirdparty.ExcelUtil;
...@@ -48,7 +49,7 @@ public class OutputInvoiceController { ...@@ -48,7 +49,7 @@ public class OutputInvoiceController {
private FileUploadAdapter fileUploadAdapter; private FileUploadAdapter fileUploadAdapter;
@RequestMapping(value = "queryOutputInvoiceList", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE) @RequestMapping(value = "queryOutputInvoiceList", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public PagingResultDto<OutputVATInvoiceInfoDto> queryOutputInvoiceList(@RequestBody QueryOutputDto queryDto) { public PagingResultDto<OutputInvoice> queryOutputInvoiceList(@RequestBody QueryOutputDto queryDto) {
return outputInvoiceService.queryOutputInvoiceList(queryDto); return outputInvoiceService.queryOutputInvoiceList(queryDto);
} }
......
...@@ -2,7 +2,13 @@ package pwc.taxtech.atms.controller; ...@@ -2,7 +2,13 @@ package pwc.taxtech.atms.controller;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType; 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.constant.enums.EnumServiceType;
import pwc.taxtech.atms.dpo.ReportDto; import pwc.taxtech.atms.dpo.ReportDto;
import pwc.taxtech.atms.dto.OperationResultDto; import pwc.taxtech.atms.dto.OperationResultDto;
...@@ -48,24 +54,24 @@ public class ReportController { ...@@ -48,24 +54,24 @@ public class ReportController {
} }
@RequestMapping(value = "reportData/{reportId}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_UTF8_VALUE) @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(); OperationResultDto resultDto = new OperationResultDto();
if (reportId == null || reportId == 0L) { if (reportId == null || reportId == 0L) {
resultDto.setResult(false); resultDto.setResult(false);
return resultDto; 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) @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(); OperationResultDto resultDto = new OperationResultDto();
if (templateId == null || templateId == 0L || period == null || period == 0) { if (templateId == null || templateId == 0L || period == null || period == 0) {
resultDto.setResult(false); resultDto.setResult(false);
resultDto.setResultMsg("templateId or period is invalid"); resultDto.setResultMsg("templateId or period is invalid");
return resultDto; 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) @RequestMapping(value = "getCellTemplateConfig/{reportTemplateId}/{period}/{rowIndex}/{columnIndex}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
...@@ -84,8 +90,8 @@ public class ReportController { ...@@ -84,8 +90,8 @@ public class ReportController {
} }
@RequestMapping(value = "addCellManualData", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE) @RequestMapping(value = "addCellManualData", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public OperationResultDto addCellManualDataSource(@RequestBody ManualDataSourceDto data) { public OperationResultDto addCellManualDataSource(@RequestBody ManualDataSourceDto data, @RequestHeader String from) {
return reportService.addCellManualDataSource(data); return reportService.addCellManualDataSource(data, from);
} }
@RequestMapping(value = "addDataSource", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE) @RequestMapping(value = "addDataSource", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
......
...@@ -2,7 +2,6 @@ package pwc.taxtech.atms.service.impl; ...@@ -2,7 +2,6 @@ package pwc.taxtech.atms.service.impl;
import com.google.common.base.Predicate; import com.google.common.base.Predicate;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import org.mybatis.spring.SqlSessionTemplate;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -15,7 +14,6 @@ import pwc.taxtech.atms.dao.ProjectClientMapper; ...@@ -15,7 +14,6 @@ import pwc.taxtech.atms.dao.ProjectClientMapper;
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.dao.ServiceTypeMapper; import pwc.taxtech.atms.dao.ServiceTypeMapper;
import pwc.taxtech.atms.dao.StandardAccountMapper;
import pwc.taxtech.atms.dao.TemplateGroupMapper; import pwc.taxtech.atms.dao.TemplateGroupMapper;
import pwc.taxtech.atms.dpo.ProjectDisplayDto; import pwc.taxtech.atms.dpo.ProjectDisplayDto;
import pwc.taxtech.atms.dto.FieldsMapper; import pwc.taxtech.atms.dto.FieldsMapper;
...@@ -26,9 +24,7 @@ import pwc.taxtech.atms.dto.taxadmin.AddProjectResult; ...@@ -26,9 +24,7 @@ import pwc.taxtech.atms.dto.taxadmin.AddProjectResult;
import pwc.taxtech.atms.dto.taxadmin.ProjectYearParam; import pwc.taxtech.atms.dto.taxadmin.ProjectYearParam;
import pwc.taxtech.atms.entity.*; import pwc.taxtech.atms.entity.*;
import pwc.taxtech.atms.entity.ProjectClientExample.Criteria; import pwc.taxtech.atms.entity.ProjectClientExample.Criteria;
import pwc.taxtech.atms.service.OperationLogService;
import pwc.taxtech.atms.service.ProjectService; import pwc.taxtech.atms.service.ProjectService;
import pwc.taxtech.atms.vat.dao.VatStandardAccountMapper;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Calendar; import java.util.Calendar;
...@@ -64,17 +60,6 @@ public class ProjectServiceImpl implements ProjectService { ...@@ -64,17 +60,6 @@ public class ProjectServiceImpl implements ProjectService {
@Autowired @Autowired
private ProjectServiceTypeMapper projectServiceTypeMapper; private ProjectServiceTypeMapper projectServiceTypeMapper;
@Autowired
private OperationLogService operationLogService;
@Autowired
private SqlSessionTemplate dynamicSqlSessionTemplate;
@Autowired
private StandardAccountMapper standardAccountMapper;
@Autowired
private VatStandardAccountMapper vatStandardAccountMapper;
@Value("${jdbc_admin_db}") @Value("${jdbc_admin_db}")
private String adminDbName; private String adminDbName;
......
...@@ -24,9 +24,9 @@ public interface ReportService { ...@@ -24,9 +24,9 @@ public interface ReportService {
List<CellTemplateReferenceDto> getTemplateReferences(int period); 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); OperationResultDto<PeriodCellTemplateConfig> getCellTemplateConfig(Long reportTemplateId, Integer periodParam, int rowIndex, int columnIndex);
...@@ -40,7 +40,7 @@ public interface ReportService { ...@@ -40,7 +40,7 @@ public interface ReportService {
* @param data 数据源数据 * @param data 数据源数据
* @return 添加结果 * @return 添加结果
*/ */
OperationResultDto addCellManualDataSource(ManualDataSourceDto data); OperationResultDto addCellManualDataSource(ManualDataSourceDto data, String projectId);
OperationResultDto<String> addDataSource(DataSourceDto datasource); OperationResultDto<String> addDataSource(DataSourceDto datasource);
......
...@@ -12,8 +12,12 @@ import pwc.taxtech.atms.entity.ProjectServiceTypeExample; ...@@ -12,8 +12,12 @@ import pwc.taxtech.atms.entity.ProjectServiceTypeExample;
import pwc.taxtech.atms.exception.Exceptions; import pwc.taxtech.atms.exception.Exceptions;
import pwc.taxtech.atms.vat.dao.CellDataMapper; import pwc.taxtech.atms.vat.dao.CellDataMapper;
import pwc.taxtech.atms.vat.dao.PeriodCellDataMapper; import pwc.taxtech.atms.vat.dao.PeriodCellDataMapper;
import pwc.taxtech.atms.vat.dao.ReportMapper;
import pwc.taxtech.atms.vat.entity.*; import pwc.taxtech.atms.vat.entity.*;
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.PeriodReport;
import pwc.taxtech.atms.vat.entity.PeriodReportExample;
import java.util.List; import java.util.List;
...@@ -24,7 +28,7 @@ public class FormulaAgent extends VatAbstractService { ...@@ -24,7 +28,7 @@ public class FormulaAgent extends VatAbstractService {
@Autowired @Autowired
public FormulaAdminMapper adminMp; public FormulaAdminMapper adminMp;
@Autowired @Autowired
public ReportMapper reportMapper; public PeriodReportMapper periodReportMapper;
@Autowired @Autowired
public CellDataMapper cellDataMapper; public CellDataMapper cellDataMapper;
@Autowired @Autowired
...@@ -50,11 +54,11 @@ public class FormulaAgent extends VatAbstractService { ...@@ -50,11 +54,11 @@ public class FormulaAgent extends VatAbstractService {
return cellTemplates; return cellTemplates;
} }
private Report getReportByTemplate(String templateId, Integer periodId) { private PeriodReport getReportByTemplate(String templateId, Integer periodId, String projectId) {
ReportExample example = new ReportExample(); PeriodReportExample example = new PeriodReportExample();
example.createCriteria().andTemplateIdEqualTo(Long.valueOf(templateId)) example.createCriteria().andProjectIdEqualTo(projectId).andTemplateIdEqualTo(Long.valueOf(templateId))
.andPeriodEqualTo(periodId); .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); if (reports != null && !reports.isEmpty()) return reports.get(FIRST_OR_DEFAULT);
return null; return null;
...@@ -73,8 +77,8 @@ public class FormulaAgent extends VatAbstractService { ...@@ -73,8 +77,8 @@ public class FormulaAgent extends VatAbstractService {
return adminMp.getPastProjectId(year, orgId); return adminMp.getPastProjectId(year, orgId);
} }
public PeriodCellData getCellData(String templateId, String cellId, int periodId) { public PeriodCellData getCellData(String templateId, String cellId, int periodId, String projectId) {
Report report = getReportByTemplate(templateId, periodId); PeriodReport report = getReportByTemplate(templateId, periodId, projectId);
MyAsserts.assertNotNull(report, Exceptions.BB_REPORT_NULL); MyAsserts.assertNotNull(report, Exceptions.BB_REPORT_NULL);
PeriodCellData cellData = getCellDataListByTemplate(cellId, report.getId()); PeriodCellData cellData = getCellDataListByTemplate(cellId, report.getId());
......
...@@ -15,12 +15,10 @@ import org.reflections.util.Utils; ...@@ -15,12 +15,10 @@ import org.reflections.util.Utils;
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.common.CommonUtils; import pwc.taxtech.atms.common.CommonUtils;
import pwc.taxtech.atms.common.PagingList;
import pwc.taxtech.atms.constant.enums.EnumTbImportType; import pwc.taxtech.atms.constant.enums.EnumTbImportType;
import pwc.taxtech.atms.dpo.PagingResultDto; import pwc.taxtech.atms.dpo.PagingResultDto;
import pwc.taxtech.atms.dto.OperationResultDto; import pwc.taxtech.atms.dto.OperationResultDto;
import pwc.taxtech.atms.dto.vatdto.ImportOutputInvoiceDto; import pwc.taxtech.atms.dto.vatdto.ImportOutputInvoiceDto;
import pwc.taxtech.atms.dto.vatdto.InputInvoice;
import pwc.taxtech.atms.dto.vatdto.OutputInvoice; import pwc.taxtech.atms.dto.vatdto.OutputInvoice;
import pwc.taxtech.atms.dto.vatdto.QueryEvidenceDto; import pwc.taxtech.atms.dto.vatdto.QueryEvidenceDto;
import pwc.taxtech.atms.vat.dao.ImportFileMapper; import pwc.taxtech.atms.vat.dao.ImportFileMapper;
...@@ -53,18 +51,8 @@ public class OutputInvoiceServiceImpl extends VatAbstractService { ...@@ -53,18 +51,8 @@ public class OutputInvoiceServiceImpl extends VatAbstractService {
@Autowired @Autowired
private SqlSessionTemplate dynamicSqlSessionTemplate; private SqlSessionTemplate dynamicSqlSessionTemplate;
public PagingResultDto<OutputVATInvoiceInfoDto> queryOutputInvoiceList(QueryOutputDto queryDto) { public PagingResultDto<OutputInvoice> queryOutputInvoiceList(QueryOutputDto queryDto) {
PagingResultDto<OutputVATInvoiceInfoDto> qResult = new PagingResultDto<>(); return get("", queryDto.getPeriodStart(), queryDto.getPageInfo().getPageIndex(), queryDto.getPageInfo().getPageSize());
qResult.setPageInfo(queryDto.getPageInfo());
qResult.setList(new ArrayList<>());
List<OutputVATInvoiceInfoDto> finalList = getQueryList(queryDto);
qResult.getPageInfo().setTotalCount(finalList.size());
if (finalList.size() > 0) {
PagingList pagingList = new PagingList(finalList, qResult.getPageInfo());
qResult.setList(pagingList.getPagingList());
}
return qResult;
} }
private PagingResultDto<OutputInvoice> get(String code, int period, int page, int size) { private PagingResultDto<OutputInvoice> get(String code, int period, int page, int size) {
...@@ -121,7 +109,7 @@ public class OutputInvoiceServiceImpl extends VatAbstractService { ...@@ -121,7 +109,7 @@ public class OutputInvoiceServiceImpl extends VatAbstractService {
OutputVatInvoiceExample example = new OutputVatInvoiceExample(); OutputVatInvoiceExample example = new OutputVatInvoiceExample();
example.createCriteria().andPeriodIdEqualTo(period.intValue()); example.createCriteria().andPeriodIdEqualTo(period.intValue());
dtoResult.setReturnCode(Long.valueOf(outputVATInvoiceMapper.countByExample(example)).intValue()); dtoResult.setReturnCode(Long.valueOf(outputVATInvoiceMapper.countByExample(example)).intValue());
}else { } else {
dtoResult.setReturnCode(0); dtoResult.setReturnCode(0);
} }
...@@ -294,7 +282,7 @@ public class OutputInvoiceServiceImpl extends VatAbstractService { ...@@ -294,7 +282,7 @@ public class OutputInvoiceServiceImpl extends VatAbstractService {
public List<OutputVatInvoiceItem> QueryOutputInvoiceItemList(String invoiceId) { public List<OutputVatInvoiceItem> QueryOutputInvoiceItemList(String invoiceId) {
OutputVatInvoiceItemExample example = new OutputVatInvoiceItemExample(); OutputVatInvoiceItemExample example = new OutputVatInvoiceItemExample();
example.createCriteria().andInvoiceIdEqualTo(invoiceId); example.createCriteria().andInvoiceIdEqualTo(invoiceId);
List<OutputVatInvoiceItem> result=outputVATInvoiceItemMapper.selectByExample(example); List<OutputVatInvoiceItem> result = outputVATInvoiceItemMapper.selectByExample(example);
result.stream().sorted(Comparator.comparing(OutputVatInvoiceItem::getSeqNo)); result.stream().sorted(Comparator.comparing(OutputVatInvoiceItem::getSeqNo));
return result; return result;
} }
......
...@@ -49,6 +49,7 @@ import java.util.regex.Matcher; ...@@ -49,6 +49,7 @@ import java.util.regex.Matcher;
import java.util.regex.Pattern; import java.util.regex.Pattern;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import static pwc.taxtech.atms.common.util.SpringContextUtil.reportMapper;
import static pwc.taxtech.atms.constant.Constant.EMPTY; import static pwc.taxtech.atms.constant.Constant.EMPTY;
@Component @Component
...@@ -70,7 +71,7 @@ public class ReportGeneratorImpl extends VatAbstractService implements ReportGen ...@@ -70,7 +71,7 @@ public class ReportGeneratorImpl extends VatAbstractService implements ReportGen
Project project = projectMapper.selectByPrimaryKey(projectId); Project project = projectMapper.selectByPrimaryKey(projectId);
PeriodTemplateExample periodTemplateExample = new PeriodTemplateExample(); PeriodTemplateExample periodTemplateExample = new PeriodTemplateExample();
periodTemplateExample.createCriteria().andIdIn(templateIds); periodTemplateExample.createCriteria().andProjectIdEqualTo(projectId).andPeriodEqualTo(period).andIdIn(templateIds);
List<PeriodTemplate> periodTemplateList = periodTemplateMapper.selectByExample(periodTemplateExample); List<PeriodTemplate> periodTemplateList = periodTemplateMapper.selectByExample(periodTemplateExample);
List<Long> periodTemplateIdList = periodTemplateList.stream() List<Long> periodTemplateIdList = periodTemplateList.stream()
.map(PeriodTemplate::getTemplateId) .map(PeriodTemplate::getTemplateId)
...@@ -196,7 +197,7 @@ public class ReportGeneratorImpl extends VatAbstractService implements ReportGen ...@@ -196,7 +197,7 @@ public class ReportGeneratorImpl extends VatAbstractService implements ReportGen
if (templateId > 0) { if (templateId > 0) {
//todo: create report into DB //todo: create report into DB
Report report = new Report(); PeriodReport report = new PeriodReport();
Long reportId = distributedIdService.nextId(); Long reportId = distributedIdService.nextId();
report.setId(reportId); report.setId(reportId);
report.setTemplateId(templateId); report.setTemplateId(templateId);
...@@ -206,6 +207,7 @@ public class ReportGeneratorImpl extends VatAbstractService implements ReportGen ...@@ -206,6 +207,7 @@ public class ReportGeneratorImpl extends VatAbstractService implements ReportGen
report.setCreateTime(createTime); report.setCreateTime(createTime);
report.setUpdateBy("Admin"); report.setUpdateBy("Admin");
report.setUpdateTime(createTime); report.setUpdateTime(createTime);
report.setProjectId(projectId);
reportMapper.insertSelective(report); reportMapper.insertSelective(report);
List<PeriodCellTemplateConfig> periodCellTemplateConfigs = periodCellTemplateConfigList.stream() List<PeriodCellTemplateConfig> periodCellTemplateConfigs = periodCellTemplateConfigList.stream()
...@@ -247,12 +249,13 @@ public class ReportGeneratorImpl extends VatAbstractService implements ReportGen ...@@ -247,12 +249,13 @@ public class ReportGeneratorImpl extends VatAbstractService implements ReportGen
.map(PeriodCellTemplateConfig::getCellTemplateId) .map(PeriodCellTemplateConfig::getCellTemplateId)
.collect(Collectors.toList()); .collect(Collectors.toList());
if (cellTemplateConfigIds.size() > 0) { if (cellTemplateConfigIds.size() > 0) {
periodFormulaBlockMapper.updateReportId(reportId, cellTemplateConfigIds, period); periodFormulaBlockMapper.updateReportId(reportId, cellTemplateConfigIds, period, projectId);
} }
for (PeriodCellTemplateConfig periodCellTemplateConfig : periodCellTemplateConfigs) { for (PeriodCellTemplateConfig periodCellTemplateConfig : periodCellTemplateConfigs) {
PeriodFormulaBlockExample periodFormulaBlockExample2 = new PeriodFormulaBlockExample(); PeriodFormulaBlockExample periodFormulaBlockExample2 = new PeriodFormulaBlockExample();
periodFormulaBlockExample2.createCriteria() periodFormulaBlockExample2.createCriteria()
.andProjectIdEqualTo(projectId)
.andCellTemplateIdEqualTo(periodCellTemplateConfig.getCellTemplateId()) .andCellTemplateIdEqualTo(periodCellTemplateConfig.getCellTemplateId())
.andReportIdEqualTo(reportId) .andReportIdEqualTo(reportId)
.andPeriodEqualTo(period); .andPeriodEqualTo(period);
...@@ -261,11 +264,11 @@ public class ReportGeneratorImpl extends VatAbstractService implements ReportGen ...@@ -261,11 +264,11 @@ public class ReportGeneratorImpl extends VatAbstractService implements ReportGen
//TODO:如果formula 为 ND(100) +ND(22) ,需要使用正则表达式拆分出自定义公式,然后根据自定义公式取formulablock 的数据进行替换 //TODO:如果formula 为 ND(100) +ND(22) ,需要使用正则表达式拆分出自定义公式,然后根据自定义公式取formulablock 的数据进行替换
String regex = "[A-Z]*\\([\\-A-Za-z0-9\\\"\\,\\.\\u4e00-\\u9fa5\\%]*\\)"; String regex = "[A-Z]*\\([\\-A-Za-z0-9\\\"\\,\\.\\u4e00-\\u9fa5\\%]*\\)";
Pattern p = Pattern.compile(regex); Pattern p = Pattern.compile(regex);
String sourceFormula = StringUtils.isNotBlank(periodCellTemplateConfig.getKeyValueParsedFormula())? String sourceFormula = StringUtils.isNotBlank(periodCellTemplateConfig.getKeyValueParsedFormula()) ?
periodCellTemplateConfig.getKeyValueParsedFormula(): periodCellTemplateConfig.getKeyValueParsedFormula() :
periodCellTemplateConfig.getFormula(); periodCellTemplateConfig.getFormula();
String resultFormula = StringUtils.isNotBlank(periodCellTemplateConfig.getKeyValueParsedFormula())? String resultFormula = StringUtils.isNotBlank(periodCellTemplateConfig.getKeyValueParsedFormula()) ?
periodCellTemplateConfig.getKeyValueParsedFormula(): periodCellTemplateConfig.getKeyValueParsedFormula() :
periodCellTemplateConfig.getFormula(); periodCellTemplateConfig.getFormula();
Matcher m = p.matcher(sourceFormula); Matcher m = p.matcher(sourceFormula);
Boolean isFind = false; Boolean isFind = false;
......
...@@ -369,13 +369,16 @@ public class ReportServiceImpl extends VatAbstractService implements ReportServi ...@@ -369,13 +369,16 @@ public class ReportServiceImpl extends VatAbstractService implements ReportServi
PeriodTemplateExample periodTemplateExample = new PeriodTemplateExample(); PeriodTemplateExample periodTemplateExample = new PeriodTemplateExample();
periodTemplateExample.createCriteria() periodTemplateExample.createCriteria()
.andTemplateGroupIdEqualTo(templateGroupId.get()) .andTemplateGroupIdEqualTo(templateGroupId.get())
.andProjectIdEqualTo(projectId)
.andPeriodEqualTo(period) .andPeriodEqualTo(period)
.andIsActiveAssociationEqualTo(true) .andIsActiveAssociationEqualTo(true)
.andReportTypeEqualTo(reportType); .andReportTypeEqualTo(reportType);
templateIds = periodTemplateMapper.selectByExample(periodTemplateExample).stream().map(PeriodTemplate::getId).collect(Collectors.toList()); templateIds = periodTemplateMapper.selectByExample(periodTemplateExample).stream().map(PeriodTemplate::getId).collect(Collectors.toList());
} else { } else {
PeriodTemplateExample periodTemplateExample = new PeriodTemplateExample(); 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()); templateIds = periodTemplateMapper.selectByExample(periodTemplateExample).stream().map(PeriodTemplate::getId).collect(Collectors.toList());
} }
...@@ -398,11 +401,11 @@ public class ReportServiceImpl extends VatAbstractService implements ReportServi ...@@ -398,11 +401,11 @@ public class ReportServiceImpl extends VatAbstractService implements ReportServi
} }
@Override @Override
public OperationResultDto<ReportDataDto> getCellData(Long reportId) { public OperationResultDto<ReportDataDto> getCellData(Long reportId, String projectId) {
OperationResultDto resultDto = new OperationResultDto(); OperationResultDto resultDto = new OperationResultDto();
ReportDataDto dataDto = new ReportDataDto(); ReportDataDto dataDto = new ReportDataDto();
try { try {
Report report = reportMapper.selectByPrimaryKey(reportId); PeriodReport report = periodReportMapper.selectByPrimaryKey(reportId);
if (report == null) { if (report == null) {
resultDto.setResult(false); resultDto.setResult(false);
resultDto.setResultMsg("NoReport"); resultDto.setResultMsg("NoReport");
...@@ -410,7 +413,7 @@ public class ReportServiceImpl extends VatAbstractService implements ReportServi ...@@ -410,7 +413,7 @@ public class ReportServiceImpl extends VatAbstractService implements ReportServi
} }
PeriodTemplateExample example = new PeriodTemplateExample(); 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(); Optional<PeriodTemplate> reportTemplate = periodTemplateMapper.selectByExample(example).stream().findFirst();
if (!reportTemplate.isPresent()) { if (!reportTemplate.isPresent()) {
resultDto.setResult(false); resultDto.setResult(false);
...@@ -427,6 +430,7 @@ public class ReportServiceImpl extends VatAbstractService implements ReportServi ...@@ -427,6 +430,7 @@ public class ReportServiceImpl extends VatAbstractService implements ReportServi
PeriodTemplateExample periodTemplateExample = new PeriodTemplateExample(); PeriodTemplateExample periodTemplateExample = new PeriodTemplateExample();
periodTemplateExample.createCriteria() periodTemplateExample.createCriteria()
.andProjectIdEqualTo(projectId)
.andTemplateGroupIdEqualTo(reportTemplate.get().getTemplateGroupId()) .andTemplateGroupIdEqualTo(reportTemplate.get().getTemplateGroupId())
.andPeriodEqualTo(report.getPeriod()) .andPeriodEqualTo(report.getPeriod())
.andIsActiveAssociationEqualTo(true); .andIsActiveAssociationEqualTo(true);
...@@ -442,7 +446,8 @@ public class ReportServiceImpl extends VatAbstractService implements ReportServi ...@@ -442,7 +446,8 @@ public class ReportServiceImpl extends VatAbstractService implements ReportServi
List<PeriodCellData> currentCellDataList = periodCellDataMapper.selectByExample(cellDataExample); List<PeriodCellData> currentCellDataList = periodCellDataMapper.selectByExample(cellDataExample);
PeriodFormulaBlockExample periodFormulaBlockExample = new PeriodFormulaBlockExample(); PeriodFormulaBlockExample periodFormulaBlockExample = new PeriodFormulaBlockExample();
periodFormulaBlockExample.createCriteria().andPeriodEqualTo(report.getPeriod()).andReportIdEqualTo(reportId); periodFormulaBlockExample.createCriteria().andProjectIdEqualTo(projectId).andPeriodEqualTo(report.getPeriod())
.andReportIdEqualTo(reportId);
List<PeriodFormulaBlock> formulaBlocks = periodFormulaBlockMapper.selectByExample(periodFormulaBlockExample); List<PeriodFormulaBlock> formulaBlocks = periodFormulaBlockMapper.selectByExample(periodFormulaBlockExample);
dataDto.setFormulaBlocks(formulaBlocks); dataDto.setFormulaBlocks(formulaBlocks);
//todo: 关键字数据源稍后再加 //todo: 关键字数据源稍后再加
...@@ -606,12 +611,12 @@ public class ReportServiceImpl extends VatAbstractService implements ReportServi ...@@ -606,12 +611,12 @@ public class ReportServiceImpl extends VatAbstractService implements ReportServi
} }
@Override @Override
public OperationResultDto<ReportDto> getReportByTemplate(Long templateId, Integer period) { public OperationResultDto<ReportDto> getReportByTemplate(Long templateId, Integer period, String projectId) {
OperationResultDto resultDto = new OperationResultDto(); OperationResultDto resultDto = new OperationResultDto();
try { try {
ReportExample example = new ReportExample(); PeriodReportExample example = new PeriodReportExample();
example.createCriteria().andTemplateIdEqualTo(templateId).andPeriodEqualTo(period); example.createCriteria().andProjectIdEqualTo(projectId).andTemplateIdEqualTo(templateId).andPeriodEqualTo(period);
Optional<Report> report = reportMapper.selectByExample(example).stream().findFirst(); Optional<PeriodReport> report = periodReportMapper.selectByExample(example).stream().findFirst();
if (report.isPresent()) { if (report.isPresent()) {
resultDto.setResult(true); resultDto.setResult(true);
ReportDto reportDto = new ReportDto(); ReportDto reportDto = new ReportDto();
...@@ -719,7 +724,7 @@ public class ReportServiceImpl extends VatAbstractService implements ReportServi ...@@ -719,7 +724,7 @@ public class ReportServiceImpl extends VatAbstractService implements ReportServi
} }
@Override @Override
public OperationResultDto addCellManualDataSource(ManualDataSourceDto data) { public OperationResultDto addCellManualDataSource(ManualDataSourceDto data, String projectId) {
OperationResultDto operationResultDto = new OperationResultDto(); OperationResultDto operationResultDto = new OperationResultDto();
try { try {
...@@ -808,9 +813,9 @@ public class ReportServiceImpl extends VatAbstractService implements ReportServi ...@@ -808,9 +813,9 @@ public class ReportServiceImpl extends VatAbstractService implements ReportServi
templateId = periodCellTemplate.get().getReportTemplateId(); 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. //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(); PeriodReportExample reportExample = new PeriodReportExample();
reportExample.createCriteria().andTemplateIdEqualTo(templateId).andPeriodEqualTo(data.getPeriod()); reportExample.createCriteria().andProjectIdEqualTo(projectId).andTemplateIdEqualTo(templateId).andPeriodEqualTo(data.getPeriod());
Optional<Report> report = reportMapper.selectByExample(reportExample).stream().findFirst(); Optional<PeriodReport> report = periodReportMapper.selectByExample(reportExample).stream().findFirst();
if (report.isPresent()) { if (report.isPresent()) {
Long reportId = report.get().getId(); Long reportId = report.get().getId();
PeriodCellDataExample cellDataExample = new PeriodCellDataExample(); PeriodCellDataExample cellDataExample = new PeriodCellDataExample();
......
...@@ -20,10 +20,9 @@ public class VatAbstractService { ...@@ -20,10 +20,9 @@ public class VatAbstractService {
@Autowired @Autowired
public VatEnterpriseAccountMapper vatEnterpriseAccountMapper; public VatEnterpriseAccountMapper vatEnterpriseAccountMapper;
@Autowired @Autowired
public PeriodStandardAccountMapper periodStandardAccountMapper;
public PeriodEnterpriseAccountMapper periodEnterpriseAccountMapper; public PeriodEnterpriseAccountMapper periodEnterpriseAccountMapper;
@Autowired @Autowired
public VatStandardAccountMapper vatStandardAccountMapper;
@Autowired
public InputVatInvoiceMapper inputVATInvoiceMapper; public InputVatInvoiceMapper inputVATInvoiceMapper;
@Autowired @Autowired
public OutputVatInvoiceMapper outputVATInvoiceMapper; public OutputVatInvoiceMapper outputVATInvoiceMapper;
...@@ -78,7 +77,7 @@ public class VatAbstractService { ...@@ -78,7 +77,7 @@ public class VatAbstractService {
@Autowired @Autowired
public PeriodFormulaBlockMapper periodFormulaBlockMapper; public PeriodFormulaBlockMapper periodFormulaBlockMapper;
@Autowired @Autowired
public ReportMapper reportMapper; public PeriodReportMapper periodReportMapper;
@Autowired @Autowired
public CellDataMapper cellDataMapper; public CellDataMapper cellDataMapper;
@Autowired @Autowired
......
...@@ -115,7 +115,7 @@ public class BB extends FunctionBase implements FreeRefFunction { ...@@ -115,7 +115,7 @@ public class BB extends FunctionBase implements FreeRefFunction {
MyAsserts.assertNotEmpty(projectId, Exceptions.PROJECT_EMPTY); MyAsserts.assertNotEmpty(projectId, Exceptions.PROJECT_EMPTY);
cellData = agent.getCellData(cellTemplateData.getReportTemplateId(), cellData = agent.getCellData(cellTemplateData.getReportTemplateId(),
cellTemplateData.getCellTemplateId(), curPeriod.getCurPeriod()); cellTemplateData.getCellTemplateId(), curPeriod.getCurPeriod(), formulaContext.getProjectId());
nullCellDto.extractFromGroup(bo, curPeriod, cellData, cellTemplateData); nullCellDto.extractFromGroup(bo, curPeriod, cellData, cellTemplateData);
// todo: fix datasource name by templateList(neo) // todo: fix datasource name by templateList(neo)
...@@ -141,7 +141,7 @@ public class BB extends FunctionBase implements FreeRefFunction { ...@@ -141,7 +141,7 @@ public class BB extends FunctionBase implements FreeRefFunction {
cellValue, formulaContext.getPeriod(), cellValue, formulaContext.getPeriod(),
formulaContext.getReportTemplateGroupId(), bo.getColumnIndex() - 1, bo.getRowIndex() - 1); formulaContext.getReportTemplateGroupId(), bo.getColumnIndex() - 1, bo.getRowIndex() - 1);
saveFormulaBlock(formulaContext.getPeriod(), ec, saveFormulaBlock(formulaContext.getPeriod(), ec,
bo.expression(), bo.expressionData(), dataSourceId); bo.expression(), bo.expressionData(), dataSourceId, formulaContext.getProjectId());
} }
} }
} }
......
...@@ -64,8 +64,8 @@ public class FSJZ extends FunctionBase implements FreeRefFunction { ...@@ -64,8 +64,8 @@ public class FSJZ extends FunctionBase implements FreeRefFunction {
if (accountType == 0) { if (accountType == 0) {
//标准账套 //标准账套
VatStandardAccount vatStandardAccount = SpringContextUtil.vatStandardAccountMapper.selectOneByAccountCode(accountCode); VatStandardAccount vatStandardAccount = SpringContextUtil.periodStandardAccountMapper.selectOneByAccountCode(accountCode,
//VatStandardAccount vatStandardAccount = SpringContextUtil.periodStandardAccountMapper.selectOneByAccountCode(accountCode); formulaContext.getProjectId());
if (vatStandardAccount == null) { if (vatStandardAccount == null) {
return NumberEval.ZERO; return NumberEval.ZERO;
} }
...@@ -130,9 +130,9 @@ public class FSJZ extends FunctionBase implements FreeRefFunction { ...@@ -130,9 +130,9 @@ 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());
//save formulablock //save formulablock
saveFormulaBlock(period, ec, formulaExpression, val, dataSourceId); saveFormulaBlock(period, ec, formulaExpression, val, dataSourceId, formulaContext.getProjectId());
return new NumberEval(val.doubleValue()); return new NumberEval(val.doubleValue());
} else { } else {
...@@ -194,9 +194,9 @@ public class FSJZ extends FunctionBase implements FreeRefFunction { ...@@ -194,9 +194,9 @@ 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());
//save formulablock //save formulablock
saveFormulaBlock(period, ec, formulaExpression, val, dataSourceId); saveFormulaBlock(period, ec, formulaExpression, val, dataSourceId, formulaContext.getProjectId());
return new NumberEval(val.doubleValue()); return new NumberEval(val.doubleValue());
} }
} }
......
...@@ -36,10 +36,10 @@ public class FWND extends FunctionBase implements FreeRefFunction { ...@@ -36,10 +36,10 @@ public class FWND extends FunctionBase implements FreeRefFunction {
example.createCriteria().andOrganizationIdEqualTo(formulaContext.getOrganizationId()).andYearEqualTo(year); example.createCriteria().andOrganizationIdEqualTo(formulaContext.getOrganizationId()).andYearEqualTo(year);
List<Project> projects = SpringContextUtil.projectMapper.selectByExample(example); List<Project> projects = SpringContextUtil.projectMapper.selectByExample(example);
if (projects != null && projects.size() > 0) { if (projects != null && projects.size() > 0) {
saveFormulaBlock(0, ec, formulaExpression, new BigDecimal("1"), 0L); saveFormulaBlock(0, ec, formulaExpression, new BigDecimal("1"), 0L, formulaContext.getProjectId());
return new NumberEval(1); return new NumberEval(1);
} else { } else {
saveFormulaBlock(0, ec, formulaExpression, new BigDecimal("0"), 0L); saveFormulaBlock(0, ec, formulaExpression, new BigDecimal("0"), 0L, formulaContext.getProjectId());
return new NumberEval(0); return new NumberEval(0);
} }
} }
......
...@@ -2,12 +2,9 @@ package pwc.taxtech.atms.vat.service.impl.report.functions; ...@@ -2,12 +2,9 @@ package pwc.taxtech.atms.vat.service.impl.report.functions;
import pwc.taxtech.atms.common.util.SpringContextUtil; import pwc.taxtech.atms.common.util.SpringContextUtil;
import pwc.taxtech.atms.constant.enums.KeyValueConfigResultType; 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.math.BigDecimal;
import java.util.HashMap; import java.util.HashMap;
import java.util.List;
import java.util.Map; import java.util.Map;
public class FormulaHelper { public class FormulaHelper {
......
...@@ -13,10 +13,12 @@ import pwc.taxtech.atms.constant.enums.FormulaDataSourceType; ...@@ -13,10 +13,12 @@ import pwc.taxtech.atms.constant.enums.FormulaDataSourceType;
import pwc.taxtech.atms.vat.entity.*; import pwc.taxtech.atms.vat.entity.*;
import pwc.taxtech.atms.vat.service.impl.FormulaAgent; import pwc.taxtech.atms.vat.service.impl.FormulaAgent;
import javax.tools.JavaCompiler;
import java.lang.reflect.Array;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.*; import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class FunctionBase { public class FunctionBase {
protected final Logger logger = LoggerFactory.getLogger(this.getClass()); protected final Logger logger = LoggerFactory.getLogger(this.getClass());
...@@ -150,11 +152,12 @@ public class FunctionBase { ...@@ -150,11 +152,12 @@ public class FunctionBase {
} }
public void saveFormulaBlock(int period, OperationEvaluationContext ec, public void saveFormulaBlock(int period, OperationEvaluationContext ec,
String formulaExpression, BigDecimal val, Long dataSourceId) { String formulaExpression, BigDecimal val, Long dataSourceId, String projectId) {
Long cellTemplateId = getCellTemplateId(period, ec); Long cellTemplateId = getCellTemplateId(period, ec);
Date creatime = new Date(); Date creatime = new Date();
PeriodFormulaBlock periodFormulaBlock = new PeriodFormulaBlock(); PeriodFormulaBlock periodFormulaBlock = new PeriodFormulaBlock();
periodFormulaBlock.setId(SpringContextUtil.distributedIdService.nextId()); periodFormulaBlock.setId(SpringContextUtil.distributedIdService.nextId());
periodFormulaBlock.setProjectId(projectId);
periodFormulaBlock.setPeriod(period); periodFormulaBlock.setPeriod(period);
periodFormulaBlock.setReportId(0L); periodFormulaBlock.setReportId(0L);
periodFormulaBlock.setCellTemplateId(cellTemplateId); periodFormulaBlock.setCellTemplateId(cellTemplateId);
...@@ -169,10 +172,11 @@ public class FunctionBase { ...@@ -169,10 +172,11 @@ public class FunctionBase {
} }
public void saveFormulaBlock(int period, OperationEvaluationContext ec, public void saveFormulaBlock(int period, OperationEvaluationContext ec,
String formulaExpression, String val, Long dataSourceId) { String formulaExpression, String val, Long dataSourceId, String projectId) {
Long cellTemplateId = getCellTemplateId(period, ec); Long cellTemplateId = getCellTemplateId(period, ec);
Date creatime = new Date(); Date creatime = new Date();
PeriodFormulaBlock periodFormulaBlock = new PeriodFormulaBlock(); PeriodFormulaBlock periodFormulaBlock = new PeriodFormulaBlock();
periodFormulaBlock.setProjectId(projectId);
periodFormulaBlock.setId(SpringContextUtil.distributedIdService.nextId()); periodFormulaBlock.setId(SpringContextUtil.distributedIdService.nextId());
periodFormulaBlock.setPeriod(period); periodFormulaBlock.setPeriod(period);
periodFormulaBlock.setReportId(0L); periodFormulaBlock.setReportId(0L);
......
...@@ -69,11 +69,11 @@ public class GZSD extends FunctionBase implements FreeRefFunction { ...@@ -69,11 +69,11 @@ public class GZSD extends FunctionBase implements FreeRefFunction {
List<PeriodTaxRuleSetting> taxRuleSettings = List<PeriodTaxRuleSetting> taxRuleSettings =
SpringContextUtil.periodTaxRuleSettingMapper.getTaxRuleSetting(formulaContext.getOrganizationId(), 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(); Optional<PeriodTaxRuleSetting> matchedRule = taxRuleSettings.stream().filter(a -> a.getIsDefault() != Constant.IsDefault.Yes).findFirst();
if (!matchedRule.isPresent()) { 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()) { if (!matchedRule.isPresent()) {
NumberFormat nf = NumberFormat.getPercentInstance(); NumberFormat nf = NumberFormat.getPercentInstance();
...@@ -89,7 +89,7 @@ public class GZSD extends FunctionBase implements FreeRefFunction { ...@@ -89,7 +89,7 @@ public class GZSD extends FunctionBase implements FreeRefFunction {
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());
saveFormulaBlock(formulaContext.getPeriod(), ec, formulaExpression, decimal_zero, dataSourceId); saveFormulaBlock(formulaContext.getPeriod(), ec, formulaExpression, decimal_zero, dataSourceId, formulaContext.getProjectId());
return NumberEval.ZERO; return NumberEval.ZERO;
} }
} }
...@@ -112,7 +112,7 @@ public class GZSD extends FunctionBase implements FreeRefFunction { ...@@ -112,7 +112,7 @@ public class GZSD extends FunctionBase implements FreeRefFunction {
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());
saveFormulaBlock(formulaContext.getPeriod(), ec, formulaExpression, val, dataSourceId); saveFormulaBlock(formulaContext.getPeriod(), ec, formulaExpression, val, dataSourceId, formulaContext.getProjectId());
return new NumberEval(val.doubleValue()); return new NumberEval(val.doubleValue());
} else { } else {
//todo: @本期应(实)纳税额 ,@GDZC.BQ.QMYE 这种类型的数据,重新计算,按照keyvalue的配置 //todo: @本期应(实)纳税额 ,@GDZC.BQ.QMYE 这种类型的数据,重新计算,按照keyvalue的配置
...@@ -131,7 +131,7 @@ public class GZSD extends FunctionBase implements FreeRefFunction { ...@@ -131,7 +131,7 @@ public class GZSD extends FunctionBase implements FreeRefFunction {
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());
saveFormulaBlock(formulaContext.getPeriod(), ec, formulaExpression, decimal_zero, dataSourceId); saveFormulaBlock(formulaContext.getPeriod(), ec, formulaExpression, decimal_zero, dataSourceId, formulaContext.getProjectId());
return NumberEval.ZERO; return NumberEval.ZERO;
} }
......
...@@ -13,7 +13,12 @@ import pwc.taxtech.atms.dto.vatdto.InputInvoiceDataSourceDto; ...@@ -13,7 +13,12 @@ import pwc.taxtech.atms.dto.vatdto.InputInvoiceDataSourceDto;
import pwc.taxtech.atms.vat.entity.InputVatInvoice; import pwc.taxtech.atms.vat.entity.InputVatInvoice;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.*; import java.util.ArrayList;
import java.util.Calendar;
import java.util.Collections;
import java.util.Comparator;
import java.util.Date;
import java.util.List;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/// <summary> /// <summary>
...@@ -58,13 +63,13 @@ public class JXFP extends FunctionBase implements FreeRefFunction { ...@@ -58,13 +63,13 @@ public class JXFP extends FunctionBase implements FreeRefFunction {
certificationPeriod = getPeriod(certificationPeriod, yearOffset); certificationPeriod = getPeriod(certificationPeriod, yearOffset);
if (yearOffset < 0) { if (yearOffset < 0) {
saveFormulaBlock(period,ec,formulaExpression,new BigDecimal("0.0"),0L); saveFormulaBlock(period, ec, formulaExpression, new BigDecimal("0.0"), 0L, formulaContext.getProjectId());
return NumberEval.ZERO; return NumberEval.ZERO;
} }
period = getPeriod(period, yearOffset); period = getPeriod(period, yearOffset);
if (yearOffset < 0) { if (yearOffset < 0) {
saveFormulaBlock(period,ec,formulaExpression,new BigDecimal("0.0"),0L); saveFormulaBlock(period, ec, formulaExpression, new BigDecimal("0.0"), 0L, formulaContext.getProjectId());
return NumberEval.ZERO; return NumberEval.ZERO;
} }
...@@ -94,13 +99,13 @@ public class JXFP extends FunctionBase implements FreeRefFunction { ...@@ -94,13 +99,13 @@ public class JXFP extends FunctionBase implements FreeRefFunction {
inputVATInvoices = SpringContextUtil.inputVatInvoiceDao.getInputVATInvoice(period, invoiceType, null, inputVATInvoices = SpringContextUtil.inputVatInvoiceDao.getInputVATInvoice(period, invoiceType, null,
null, Constant.InputInvoiceCertificationResult.NotPass); null, Constant.InputInvoiceCertificationResult.NotPass);
} else { } else {
saveFormulaBlock(period,ec,formulaExpression,new BigDecimal("0.0"),0L); saveFormulaBlock(period, ec, formulaExpression, new BigDecimal("0.0"), 0L, formulaContext.getProjectId());
return NumberEval.ZERO; return NumberEval.ZERO;
} }
if (certificationPeriod != -99 && certificationPeriod != 99 if (certificationPeriod != -99 && certificationPeriod != 99
&& (certificationPeriod < 1 || certificationPeriod > 12)) { && (certificationPeriod < 1 || certificationPeriod > 12)) {
saveFormulaBlock(period,ec,formulaExpression,new BigDecimal("0.0"),0L); saveFormulaBlock(period, ec, formulaExpression, new BigDecimal("0.0"), 0L, formulaContext.getProjectId());
return NumberEval.ZERO; return NumberEval.ZERO;
} else if (!formulaContext.getIsYear()) { } else if (!formulaContext.getIsYear()) {
if (certificationPeriod == -99) { if (certificationPeriod == -99) {
...@@ -154,25 +159,29 @@ public class JXFP extends FunctionBase implements FreeRefFunction { ...@@ -154,25 +159,29 @@ 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());
saveFormulaBlock(formulaContext.getPeriod(), ec, formulaExpression, BigDecimal.valueOf(val), dataSourceId); saveFormulaBlock(formulaContext.getPeriod(), ec, formulaExpression, BigDecimal.valueOf(val), dataSourceId,
formulaContext.getProjectId());
return new NumberEval(val); return new NumberEval(val);
} else if (resultType == 1) { } else if (resultType == 1) {
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());
saveFormulaBlock(formulaContext.getPeriod(), ec, formulaExpression, BigDecimal.valueOf(val), dataSourceId); saveFormulaBlock(formulaContext.getPeriod(), ec, formulaExpression, BigDecimal.valueOf(val), dataSourceId,
formulaContext.getProjectId());
return new NumberEval(val); return new NumberEval(val);
} else if (resultType == 2) { } else if (resultType == 2) {
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());
saveFormulaBlock(period, ec, formulaExpression, BigDecimal.valueOf(val), dataSourceId); saveFormulaBlock(period, ec, formulaExpression, BigDecimal.valueOf(val), dataSourceId,
formulaContext.getProjectId());
return new NumberEval(val); return new NumberEval(val);
} }
saveFormulaBlock(period,ec,formulaExpression,new BigDecimal("0.0"),0L); saveFormulaBlock(period, ec, formulaExpression, new BigDecimal("0.0"), 0L,
formulaContext.getProjectId());
return NumberEval.ZERO; return NumberEval.ZERO;
} }
} }
...@@ -14,7 +14,11 @@ import pwc.taxtech.atms.dto.vatdto.InputInvoiceDetailDataSourceDto; ...@@ -14,7 +14,11 @@ import pwc.taxtech.atms.dto.vatdto.InputInvoiceDetailDataSourceDto;
import pwc.taxtech.atms.vat.dpo.InputVATInvoiceResultDto; import pwc.taxtech.atms.vat.dpo.InputVATInvoiceResultDto;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.*; import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import java.util.stream.Collectors; import java.util.stream.Collectors;
...@@ -84,7 +88,7 @@ public class JXFPMX extends FunctionBase implements FreeRefFunction { ...@@ -84,7 +88,7 @@ public class JXFPMX extends FunctionBase implements FreeRefFunction {
if (!goodsName.equals("99")) { if (!goodsName.equals("99")) {
inputInvoice = inputInvoice.stream() inputInvoice = inputInvoice.stream()
.filter(a -> a.getGoodsMapping() != null&&a.getGoodsMapping().getStdGoodsName()!=null && a.getGoodsMapping().getStdGoodsName().equals(goodsName)) .filter(a -> a.getGoodsMapping() != null && a.getGoodsMapping().getStdGoodsName() != null && a.getGoodsMapping().getStdGoodsName().equals(goodsName))
.collect(Collectors.toList()); .collect(Collectors.toList());
} }
...@@ -133,15 +137,15 @@ public class JXFPMX extends FunctionBase implements FreeRefFunction { ...@@ -133,15 +137,15 @@ 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());
saveFormulaBlock(period, ec, formulaExpression, new BigDecimal(val), dataSourceId); 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());
saveFormulaBlock(period, ec, formulaExpression, new BigDecimal(val), dataSourceId); saveFormulaBlock(period, ec, formulaExpression, new BigDecimal(val), dataSourceId, formulaContext.getProjectId());
return new NumberEval(val); return new NumberEval(val);
} }
......
...@@ -7,7 +7,7 @@ import org.apache.poi.ss.formula.eval.ValueEval; ...@@ -7,7 +7,7 @@ import org.apache.poi.ss.formula.eval.ValueEval;
import org.apache.poi.ss.formula.functions.FreeRefFunction; import org.apache.poi.ss.formula.functions.FreeRefFunction;
import pwc.taxtech.atms.common.util.SpringContextUtil; import pwc.taxtech.atms.common.util.SpringContextUtil;
import pwc.taxtech.atms.constant.Constant; 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.Calendar;
import java.util.Date; import java.util.Date;
...@@ -56,7 +56,7 @@ public class ProjectContext extends FunctionBase implements FreeRefFunction { ...@@ -56,7 +56,7 @@ public class ProjectContext extends FunctionBase implements FreeRefFunction {
, formulaContext.getPeriod(), calendar.get(Calendar.DAY_OF_MONTH), formulaContext.getYear() , formulaContext.getPeriod(), calendar.get(Calendar.DAY_OF_MONTH), formulaContext.getYear()
, formulaContext.getPeriod(), calendar2.get(Calendar.DAY_OF_MONTH))); , formulaContext.getPeriod(), calendar2.get(Calendar.DAY_OF_MONTH)));
case "FillForm": case "FillForm":
Report report = SpringContextUtil.reportMapper.selectByPrimaryKey(formulaContext.getReportId()); PeriodReport report = SpringContextUtil.reportMapper.selectByPrimaryKey(formulaContext.getReportId());
if (report != null) { if (report != null) {
return new StringEval(String.format(Constant.ReportBuildInStringFormat.FillForm, report.getUpdateTime().getYear() return new StringEval(String.format(Constant.ReportBuildInStringFormat.FillForm, report.getUpdateTime().getYear()
, report.getUpdateTime().getMonth(), report.getUpdateTime().getDay())); , report.getUpdateTime().getMonth(), report.getUpdateTime().getDay()));
......
...@@ -115,15 +115,15 @@ public class XXFP extends FunctionBase implements FreeRefFunction { ...@@ -115,15 +115,15 @@ 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());
saveFormulaBlock(period, ec, formulaExpression, new BigDecimal(val), dataSoureId); 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());
saveFormulaBlock(period, ec, formulaExpression, new BigDecimal(val), dataSoureId); saveFormulaBlock(period, ec, formulaExpression, new BigDecimal(val), dataSoureId, formulaContext.getProjectId());
return new NumberEval(val); return new NumberEval(val);
} }
return NumberEval.ZERO; return NumberEval.ZERO;
......
...@@ -129,7 +129,7 @@ public class ZC extends FunctionBase implements FreeRefFunction { ...@@ -129,7 +129,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());
saveFormulaBlock(0, ec, formulaExpression, totalData, dataSourceId); saveFormulaBlock(0, ec, formulaExpression, totalData, dataSourceId, formulaContext.getProjectId());
return new NumberEval(totalData.doubleValue()); return new NumberEval(totalData.doubleValue());
} }
} }
...@@ -119,7 +119,7 @@ public interface DataSourceMapper extends MyVatMapper { ...@@ -119,7 +119,7 @@ public interface DataSourceMapper extends MyVatMapper {
void clearTemplateWithPeriod(@Param("period") Integer period, @Param("exceptReportTemplateIDs") String exceptReportTemplateIDs); void clearTemplateWithPeriod(@Param("period") Integer period, @Param("exceptReportTemplateIDs") String exceptReportTemplateIDs);
void clearTaxPayerReportWithPeriod(@Param("period") Integer period); void clearTaxPayerReportWithPeriod(@Param("period") Integer period, @Param("projectId") String projectId);
void clearDataSourceWithPeriod(@Param("period") Integer period); void clearDataSourceWithPeriod(@Param("period") Integer period);
...@@ -131,7 +131,8 @@ public interface DataSourceMapper extends MyVatMapper { ...@@ -131,7 +131,8 @@ public interface DataSourceMapper extends MyVatMapper {
void clearReportWithPeriod(Integer period); void clearReportWithPeriod(Integer period);
void clearDataWithPeriod(@Param("exceptReportTemplateIDs") String exceptReportTemplateIDs, @Param("period") Integer period); void clearDataWithPeriod(@Param("exceptReportTemplateIDs") String exceptReportTemplateIDs, @Param("period") Integer period,
@Param("projectId") String projectId);
List<DataSourceExtendDto> getFormulaDataSource(Long reportID); List<DataSourceExtendDto> getFormulaDataSource(Long reportID);
......
...@@ -107,5 +107,6 @@ public interface PeriodFormulaBlockMapper extends MyVatMapper { ...@@ -107,5 +107,6 @@ public interface PeriodFormulaBlockMapper extends MyVatMapper {
*/ */
int updateByPrimaryKey(PeriodFormulaBlock record); int updateByPrimaryKey(PeriodFormulaBlock record);
void updateReportId(@Param("reportId") Long reportId, @Param("cellTemplateConfigIds") List<Long> cellTemplateConfigIds, @Param("period") Integer period); void updateReportId(@Param("reportId") Long reportId, @Param("cellTemplateConfigIds") List<Long> cellTemplateConfigIds,
@Param("period") Integer period, @Param("projectId") String projectId);
} }
\ No newline at end of file
package pwc.taxtech.atms.vat.dao; package pwc.taxtech.atms.vat.dao;
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;
...@@ -9,6 +8,9 @@ import pwc.taxtech.atms.vat.dpo.TrialBalanceDto; ...@@ -9,6 +8,9 @@ import pwc.taxtech.atms.vat.dpo.TrialBalanceDto;
import pwc.taxtech.atms.vat.entity.PeriodStandardAccount; import pwc.taxtech.atms.vat.entity.PeriodStandardAccount;
import pwc.taxtech.atms.vat.entity.PeriodStandardAccountExample; import pwc.taxtech.atms.vat.entity.PeriodStandardAccountExample;
import pwc.taxtech.atms.vat.entity.VatStandardAccount; import pwc.taxtech.atms.vat.entity.VatStandardAccount;
import pwc.taxtech.atms.vat.entity.VatStandardAccount;
import java.util.List;
@Mapper @Mapper
public interface PeriodStandardAccountMapper extends MyVatMapper { public interface PeriodStandardAccountMapper extends MyVatMapper {
...@@ -108,7 +110,8 @@ public interface PeriodStandardAccountMapper extends MyVatMapper { ...@@ -108,7 +110,8 @@ public interface PeriodStandardAccountMapper extends MyVatMapper {
*/ */
int updateByPrimaryKey(PeriodStandardAccount record); int updateByPrimaryKey(PeriodStandardAccount record);
List<TrialBalanceDto> selectProjectStandardAccountLeftJoinBalanceStdManual(@Param("fromMonth") String fromMonth, @Param("toMonth") String toMonth); List<TrialBalanceDto> selectProjectStandardAccountLeftJoinBalanceStdManual(@Param("fromMonth") String fromMonth, @Param("toMonth") String toMonth,
@Param("projectId") String projectId);
VatStandardAccount selectOneByAccountCode(@Param("accountCode") String accountCode); 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 { ...@@ -109,5 +109,6 @@ public interface PeriodTaxRuleSettingMapper extends MyVatMapper {
List<PeriodTaxRuleSetting> getTaxRuleSetting(@Param("organizationId") String organizationId, 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"?> <?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"> <!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.PeriodTaxPayerReportRuleMapper"> <mapper namespace="pwc.taxtech.atms.vat.dao.apper">
<resultMap id="BaseResultMap" type="pwc.taxtech.atms.vat.entity.PeriodTaxPayerReportRule"> <resultMap id="BaseResultMap" type="pwc.taxtech.atms.vat.entity.PeriodTaxPayerReportRule">
<!-- <!--
WARNING - @mbg.generated WARNING - @mbg.generated
......
...@@ -59,7 +59,8 @@ ...@@ -59,7 +59,8 @@
DELETE FROM DELETE FROM
PERIOD_TAX_PAYER_REPORT_RULE PERIOD_TAX_PAYER_REPORT_RULE
WHERE WHERE
PERIOD= #{period,jdbcType=INTEGER} ; PERIOD= #{period,jdbcType=INTEGER}
AND PROJECT_ID= #{projectId,jdbcType=VARCHAR} ;
</delete> </delete>
<delete id="clearDataSourceWithPeriod"> <delete id="clearDataSourceWithPeriod">
...@@ -155,7 +156,8 @@ ...@@ -155,7 +156,8 @@
DELETE FROM DELETE FROM
PERIOD_TAX_PAYER_REPORT_RULE PERIOD_TAX_PAYER_REPORT_RULE
WHERE WHERE
PERIOD= #{period,jdbcType=INTEGER} ; PERIOD= #{period,jdbcType=INTEGER}
AND PROJECT_ID= #{projectId,jdbcType=VARCHAR};
DELETE DELETE
D FROM D FROM
DATA_SOURCE_DETAIL D DATA_SOURCE_DETAIL D
...@@ -279,12 +281,14 @@ ...@@ -279,12 +281,14 @@
<association property="cellData" javaType="pwc.taxtech.atms.vat.entity.CellData"> <association property="cellData" javaType="pwc.taxtech.atms.vat.entity.CellData">
<id column="CELL_DATA_ID" jdbcType="BIGINT" property="id"/> <id column="CELL_DATA_ID" jdbcType="BIGINT" property="id"/>
<result column="CELL_DATA_DATA" property="data" javaType="java.lang.String" jdbcType="VARCHAR"/> <result column="CELL_DATA_DATA" property="data" javaType="java.lang.String" jdbcType="VARCHAR"/>
<result column="CELL_DATA_TEMPLATE_ID" property="cellTemplateId" javaType="java.lang.Long" jdbcType="BIGINT"/> <result column="CELL_DATA_TEMPLATE_ID" property="cellTemplateId" javaType="java.lang.Long"
jdbcType="BIGINT"/>
<result column="CELL_DATA_REPORT_ID" property="reportId" javaType="java.lang.Long" jdbcType="BIGINT"/> <result column="CELL_DATA_REPORT_ID" property="reportId" javaType="java.lang.Long" jdbcType="BIGINT"/>
</association> </association>
<association property="cellDataSource" javaType="pwc.taxtech.atms.vat.entity.CellDataSource"> <association property="cellDataSource" javaType="pwc.taxtech.atms.vat.entity.CellDataSource">
<id column="CELL_DATA_SOURCE_ID" jdbcType="BIGINT" property="id"/> <id column="CELL_DATA_SOURCE_ID" jdbcType="BIGINT" property="id"/>
<result column="CELL_DATA_SOURCE_OPERATION_TYPE" property="operationType" javaType="java.lang.Integer" jdbcType="INTEGER"/> <result column="CELL_DATA_SOURCE_OPERATION_TYPE" property="operationType" javaType="java.lang.Integer"
jdbcType="INTEGER"/>
</association> </association>
</resultMap> </resultMap>
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
REPORT_ID= #{reportId,jdbcType=BIGINT} REPORT_ID= #{reportId,jdbcType=BIGINT}
WHERE WHERE
PERIOD= #{period,jdbcType=INTEGER} PERIOD= #{period,jdbcType=INTEGER}
AND PROJECT_ID= #{projectId,jdbcType=INTEGER}
AND CELL_TEMPLATE_ID IN AND CELL_TEMPLATE_ID IN
<foreach collection="cellTemplateConfigIds" open="(" close=")" separator="," item="item"> <foreach collection="cellTemplateConfigIds" open="(" close=")" separator="," item="item">
#{item} #{item}
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!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.PeriodStandardAccountMapper"> <mapper namespace="pwc.taxtech.atms.vat.dao.PeriodStandardAccountMapper">
<resultMap id="TrialBalanceDto" type="pwc.taxtech.atms.vat.dpo.TrialBalanceDto"> <resultMap id="TrialBalanceDto" type="pwc.taxtech.atms.dto.vatdto.TrialBalanceDto">
<id column="BalanceId" jdbcType="VARCHAR" property="balanceId"/> <id column="BalanceId" jdbcType="VARCHAR" property="balanceId"/>
<result column="PERIOD_ID" jdbcType="INTEGER" property="periodId"/> <result column="PERIOD_ID" jdbcType="INTEGER" property="periodId"/>
<result column="ACCT_CODE" jdbcType="VARCHAR" property="acctCode"/> <result column="ACCT_CODE" jdbcType="VARCHAR" property="acctCode"/>
...@@ -52,13 +52,14 @@ ...@@ -52,13 +52,14 @@
A.ACCT_PROP, A.ACCT_PROP,
A.DIRECTION A.DIRECTION
FROM FROM
STANDARD_ACCOUNT A PERIOD_STANDARD_ACCOUNT A
JOIN JOIN
BALANCE_STD_MANUAL B PERIOD_BALANCE_STD_MANUAL B
ON ON
A.`CODE` = B.ACCT_CODE A.`CODE` = B.ACCT_CODE
WHERE WHERE
1=1 1=1
AND A.PROJECT_ID= #{projectId,jdbcType=VARCHAR}
<if test="fromMonth!=null"> <if test="fromMonth!=null">
AND B.PERIOD_ID &gt;= #{fromMonth,jdbcType=VARCHAR} AND B.PERIOD_ID &gt;= #{fromMonth,jdbcType=VARCHAR}
</if> </if>
...@@ -73,9 +74,11 @@ ...@@ -73,9 +74,11 @@
SELECT SELECT
* *
FROM FROM
STANDARD_ACCOUNT A PERIOD_STANDARD_ACCOUNT A
WHERE WHERE
A.CODE= #{accountCode,jdbcType=VARCHAR} LIMIT 1 A.CODE= #{accountCode,jdbcType=VARCHAR}
AND A.PROJECT_ID= #{projectId,jdbcType=VARCHAR}
LIMIT 1
</select> </select>
</mapper> </mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?> <?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"> <!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"> <resultMap id="TrialBalanceDto" type="pwc.taxtech.atms.vat.dpo.TrialBalanceDto">
<id column="BalanceId" jdbcType="VARCHAR" property="balanceId"/> <id column="BalanceId" jdbcType="VARCHAR" property="balanceId"/>
<result column="PERIOD_ID" jdbcType="INTEGER" property="periodId"/> <result column="PERIOD_ID" jdbcType="INTEGER" property="periodId"/>
<result column="ACCT_CODE" jdbcType="VARCHAR" property="acctCode"/> <result column="ACCT_CODE" jdbcType="VARCHAR" property="acctCode"/>
......
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
) )
AND TRS.NAME = #{taxName,jdbcType=VARCHAR} AND TRS.NAME = #{taxName,jdbcType=VARCHAR}
AND TRS.PERIOD = #{period,jdbcType=INTEGER} AND TRS.PERIOD = #{period,jdbcType=INTEGER}
AND TRS.PROJECT_ID = #{projectId,jdbcType=INTEGER}
</select> </select>
</mapper> </mapper>
\ No newline at end of file
...@@ -560,14 +560,14 @@ ...@@ -560,14 +560,14 @@
columnDefs: [ columnDefs: [
{ name: $translate.instant('ImportErrorPopUpNoCol'), width: '7%', cellTemplate: '<div class="ui-grid-cell-contents"><span>{{row.entity.index}}<span></div>' }, { name: $translate.instant('ImportErrorPopUpNoCol'), width: '7%', cellTemplate: '<div class="ui-grid-cell-contents"><span>{{row.entity.index}}<span></div>' },
{ name: $translate.instant('InvoiceQJ'), width: '10.5%', cellTemplate: '<div class="ui-grid-cell-contents"><span>{{row.entity.periodID}}<span></div>' }, { name: $translate.instant('InvoiceQJ'), width: '10.5%', cellTemplate: '<div class="ui-grid-cell-contents"><span>{{row.entity.periodID}}<span></div>' },
{ name: $translate.instant('InvoiceKPRQ'), width: '10.5%', cellTemplate: '<div class="ui-grid-cell-contents"><span>{{row.entity.invoiceDate | date:"yyyy-MM-dd"}}<span></div>' }, { name: $translate.instant('InvoiceKPRQ'), width: '10.5%', cellTemplate: '<div class="ui-grid-cell-contents"><span>{{row.entity.kprq | date:"yyyy-MM-dd"}}<span></div>' },
{ name: $translate.instant('InvoiceFPDM'), width: '10.5%', cellTemplate: '<div class="ui-grid-cell-contents"><span title="{{row.entity.invoiceCode}}">{{row.entity.invoiceCode}}</span></div>' }, { name: $translate.instant('InvoiceFPDM'), width: '10.5%', cellTemplate: '<div class="ui-grid-cell-contents"><span title="{{row.entity.fpdm}}">{{row.entity.fpdm}}</span></div>' },
{ name: $translate.instant('InvoiceFPHM'), width: '10.5%', cellTemplate: '<div class="ui-grid-cell-contents"><span title="{{row.entity.invoiceNumber}}">{{row.entity.invoiceNumber}}</span></div>' }, { name: $translate.instant('InvoiceFPHM'), width: '10.5%', cellTemplate: '<div class="ui-grid-cell-contents"><span title="{{row.entity.fphm}}">{{row.entity.fphm}}</span></div>' },
{ name: $translate.instant('InvoiceGHFSH'), width: '12%', cellTemplate: '<div class="ui-grid-cell-contents"><span title="{{row.entity.sellerTaxNumber}}">{{row.entity.sellerTaxNumber}}</span></div>' }, { name: $translate.instant('InvoiceGHFSH'), width: '12%', cellTemplate: '<div class="ui-grid-cell-contents"><span title="{{row.entity.xfsh}}">{{row.entity.xfsh}}</span></div>' },
{ name: $translate.instant('InvoiceFPLX'), width: '10.5%', cellTemplate: '<div class="ui-grid-cell-contents"><span title="{{row.entity.sellerTaxName}}">{{grid.appScope.typeToString(row.entity.invoiceType)}}</span></div>' }, { name: $translate.instant('InvoiceFPLX'), width: '10.5%', cellTemplate: '<div class="ui-grid-cell-contents"><span title="{{row.entity.fplx}}">{{grid.appScope.typeToString(row.entity.fplx)}}</span></div>' },
{ name: $translate.instant('InvoiceJE'), width: '10.5%', cellTemplate: '<div class="ui-grid-cell-contents"><span>{{row.entity.amount}}</span></div>' }, { name: $translate.instant('InvoiceJE'), width: '10.5%', cellTemplate: '<div class="ui-grid-cell-contents"><span>{{row.entity.hjje}}</span></div>' },
{ name: $translate.instant('InvoiceSE'), width: '10.5%', cellTemplate: '<div class="ui-grid-cell-contents"><span>{{row.entity.taxAmount}}</span></div>' }, { name: $translate.instant('InvoiceSE'), width: '10.5%', cellTemplate: '<div class="ui-grid-cell-contents"><span>{{row.entity.hjse}}</span></div>' },
{ name: $translate.instant('InvoiceRZRQ'), width: '10.5%', cellTemplate: '<div class="ui-grid-cell-contents"><span>{{row.entity.certificationDate | date:"yyyy-MM-dd"}}</span></div>' }, { name: $translate.instant('InvoiceRZRQ'), width: '10.5%', cellTemplate: '<div class="ui-grid-cell-contents"><span>{{row.entity.rzsj | date:"yyyy-MM-dd"}}</span></div>' },
{ name: $translate.instant('InvoiceRZJG'), width: '10.5%', cellTemplate: '<div class="ui-grid-cell-contents"><span>{{row.entity.certificationResult}}</span></div>' } { name: $translate.instant('InvoiceRZJG'), width: '10.5%', cellTemplate: '<div class="ui-grid-cell-contents"><span>{{row.entity.certificationResult}}</span></div>' }
], ],
onRegisterApi: function (gridApi) { onRegisterApi: function (gridApi) {
......
...@@ -468,27 +468,27 @@ ...@@ -468,27 +468,27 @@
}, },
{ {
name: $translate.instant('InvoiceDate'), width: '10%', name: $translate.instant('InvoiceDate'), width: '10%',
cellTemplate: '<div class="ui-grid-cell-contents" ><span>{{row.entity.invoiceDate | date:"yyyy-MM-dd"}}</span></div>' cellTemplate: '<div class="ui-grid-cell-contents" ><span>{{row.entity.kprq | date:"yyyy-MM-dd"}}</span></div>'
}, },
{ {
name: $translate.instant('InvoiceType'), width: '10%', name: $translate.instant('InvoiceType'), width: '10%',
cellTemplate: '<div class="ui-grid-cell-contents" title="{{grid.appScope.typeToString(row.entity.invoiceType)}}"><span>{{grid.appScope.typeToString(row.entity.invoiceType)}}<span></div>' cellTemplate: '<div class="ui-grid-cell-contents" title="{{grid.appScope.typeToString(row.entity.fplxdm)}}"><span>{{grid.appScope.typeToString(row.entity.fplxdm)}}<span></div>'
}, },
{ {
name: $translate.instant('ClassCode'), width: '10%', name: $translate.instant('ClassCode'), width: '10%',
cellTemplate: '<div class="ui-grid-cell-contents" title="{{row.entity.classCode}}"><span>{{row.entity.classCode}}<span></div>' cellTemplate: '<div class="ui-grid-cell-contents" title="{{row.entity.fpdm}}"><span>{{row.entity.fpdm}}<span></div>'
}, },
{ {
name: $translate.instant('InvoiceNumber'), width: '10%', name: $translate.instant('InvoiceNumber'), width: '10%',
cellTemplate: '<div class="ui-grid-cell-contents" title="{{row.entity.invoiceNumber}}"><span>{{row.entity.invoiceNumber}}</span></div>' cellTemplate: '<div class="ui-grid-cell-contents" title="{{row.entity.fphm}}"><span>{{row.entity.fphm}}</span></div>'
}, },
{ {
name: $translate.instant('BuyerName'), width: '15%', name: $translate.instant('BuyerName'), width: '15%',
cellTemplate: '<div class="ui-grid-cell-contents" title="{{row.entity.buyerName}}"><span>{{row.entity.buyerName}}</span></div>' cellTemplate: '<div class="ui-grid-cell-contents" title="{{row.entity.gfmc}}"><span>{{row.entity.gfmc}}</span></div>'
}, },
{ {
name: $translate.instant('BuyerTaxNumber'), width: '15%', name: $translate.instant('BuyerTaxNumber'), width: '15%',
cellTemplate: '<div class="ui-grid-cell-contents" title="{{row.entity.buyerTaxNumber}}"><span>{{row.entity.buyerTaxNumber}}</span></div>' cellTemplate: '<div class="ui-grid-cell-contents" title="{{row.entity.gfsh}}"><span>{{row.entity.gfsh}}</span></div>'
}, },
//{ //{
// name: $translate.instant('BankAccount'), width: '10%', // name: $translate.instant('BankAccount'), width: '10%',
...@@ -500,11 +500,11 @@ ...@@ -500,11 +500,11 @@
//}, //},
{ {
name: $translate.instant('Amount'), width: '8%', headerCellClass: 'right', name: $translate.instant('Amount'), width: '8%', headerCellClass: 'right',
cellTemplate: '<div class="ui-grid-cell-contents right" title="{{row.entity.amount}}"><span>{{row.entity.amount}}</span></div>' cellTemplate: '<div class="ui-grid-cell-contents right" title="{{row.entity.hjje}}"><span>{{row.entity.hjje}}</span></div>'
}, },
{ {
name: $translate.instant('TaxAmount'), width: '8%', headerCellClass: 'right', name: $translate.instant('TaxAmount'), width: '8%', headerCellClass: 'right',
cellTemplate: '<div class="ui-grid-cell-contents right" title="{{row.entity.taxAmount}}"><span>{{row.entity.taxAmount}}</span></div>' cellTemplate: '<div class="ui-grid-cell-contents right" title="{{row.entity.hjse}}"><span>{{row.entity.hjse}}</span></div>'
} }
]; ];
......
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