Commit 8234757b authored by frank.xa.zhang's avatar frank.xa.zhang

change to periodXXX table

parent 698f9c26
...@@ -21,6 +21,7 @@ public class SpringContextUtil implements ApplicationContextAware { ...@@ -21,6 +21,7 @@ public class SpringContextUtil implements ApplicationContextAware {
public static FormulaAdminMapper formulaAdminMapper; public static FormulaAdminMapper formulaAdminMapper;
public static ReportMapper reportMapper; public static ReportMapper reportMapper;
public static CellDataMapper cellDataMapper; public static CellDataMapper cellDataMapper;
public static PeriodCellDataMapper periodCellDataMapper;
public static DistributedIdService distributedIdService; public static DistributedIdService distributedIdService;
public static PeriodFormulaBlockMapper formulaBlockMapper; public static PeriodFormulaBlockMapper formulaBlockMapper;
public static PeriodCellTemplateMapper periodCellTemplateMapper; public static PeriodCellTemplateMapper periodCellTemplateMapper;
...@@ -31,10 +32,13 @@ public class SpringContextUtil implements ApplicationContextAware { ...@@ -31,10 +32,13 @@ public class SpringContextUtil implements ApplicationContextAware {
public static ProjectDao projectDao; public static ProjectDao projectDao;
public static BalanceMapper balanceMapper; public static BalanceMapper balanceMapper;
public static DataSourceMapper dataSourceMapper; public static DataSourceMapper dataSourceMapper;
public static PeriodDataSourceMapper periodDataSourceMapper;
public static DataSourceDetailMapper dataSourceDetailMapper; public static DataSourceDetailMapper dataSourceDetailMapper;
public static PeriodDataSourceDetailMapper periodDataSourceDetailMapper;
public static PeriodFormulaBlockMapper periodFormulaBlockMapper; public static PeriodFormulaBlockMapper periodFormulaBlockMapper;
public static VatEnterpriseAccountDao vatEnterpriseAccountDao; public static VatEnterpriseAccountDao vatEnterpriseAccountDao;
public static VatEnterpriseAccountMapper vatEnterpriseAccountMapper; public static VatEnterpriseAccountMapper vatEnterpriseAccountMapper;
public static PeriodEnterpriseAccountMapper periodEnterpriseAccountMapper;
public static BalanceStdManualMapper balanceStdManualMapper; public static BalanceStdManualMapper balanceStdManualMapper;
public static OutputVatInvoiceMapper outputVATInvoiceMapper; public static OutputVatInvoiceMapper outputVATInvoiceMapper;
public static PeriodTaxRuleSettingMapper periodTaxRuleSettingMapper; public static PeriodTaxRuleSettingMapper periodTaxRuleSettingMapper;
...@@ -43,6 +47,7 @@ public class SpringContextUtil implements ApplicationContextAware { ...@@ -43,6 +47,7 @@ public class SpringContextUtil implements ApplicationContextAware {
public static AssetsListMapper assetsListMapper; public static AssetsListMapper assetsListMapper;
public static ProjectMapper projectMapper; public static ProjectMapper projectMapper;
public static CellDataSourceMapper cellDataSourceMapper; public static CellDataSourceMapper cellDataSourceMapper;
public static PeriodCellDataSourceMapper periodCellDataSourceMapper;
public static OrganizationMapper organizationMapper; public static OrganizationMapper organizationMapper;
/** /**
...@@ -62,6 +67,7 @@ public class SpringContextUtil implements ApplicationContextAware { ...@@ -62,6 +67,7 @@ public class SpringContextUtil implements ApplicationContextAware {
formulaAdminMapper = webApplicationContext.getBean(FormulaAdminMapper.class); formulaAdminMapper = webApplicationContext.getBean(FormulaAdminMapper.class);
reportMapper = webApplicationContext.getBean(ReportMapper.class); reportMapper = webApplicationContext.getBean(ReportMapper.class);
cellDataMapper = webApplicationContext.getBean(CellDataMapper.class); cellDataMapper = webApplicationContext.getBean(CellDataMapper.class);
periodCellDataMapper = webApplicationContext.getBean(PeriodCellDataMapper.class);
distributedIdService = webApplicationContext.getBean(DistributedIdService.class); distributedIdService = webApplicationContext.getBean(DistributedIdService.class);
formulaBlockMapper = webApplicationContext.getBean(PeriodFormulaBlockMapper.class); formulaBlockMapper = webApplicationContext.getBean(PeriodFormulaBlockMapper.class);
periodCellTemplateMapper = webApplicationContext.getBean(PeriodCellTemplateMapper.class); periodCellTemplateMapper = webApplicationContext.getBean(PeriodCellTemplateMapper.class);
...@@ -72,10 +78,13 @@ public class SpringContextUtil implements ApplicationContextAware { ...@@ -72,10 +78,13 @@ public class SpringContextUtil implements ApplicationContextAware {
projectDao = webApplicationContext.getBean(ProjectDao.class); projectDao = webApplicationContext.getBean(ProjectDao.class);
balanceMapper = webApplicationContext.getBean(BalanceMapper.class); balanceMapper = webApplicationContext.getBean(BalanceMapper.class);
dataSourceMapper = webApplicationContext.getBean(DataSourceMapper.class); dataSourceMapper = webApplicationContext.getBean(DataSourceMapper.class);
periodDataSourceMapper = webApplicationContext.getBean(PeriodDataSourceMapper.class);
dataSourceDetailMapper = webApplicationContext.getBean(DataSourceDetailMapper.class); dataSourceDetailMapper = webApplicationContext.getBean(DataSourceDetailMapper.class);
periodDataSourceDetailMapper = webApplicationContext.getBean(PeriodDataSourceDetailMapper.class);
periodFormulaBlockMapper = webApplicationContext.getBean(PeriodFormulaBlockMapper.class); periodFormulaBlockMapper = webApplicationContext.getBean(PeriodFormulaBlockMapper.class);
vatEnterpriseAccountDao = webApplicationContext.getBean(VatEnterpriseAccountDao.class); vatEnterpriseAccountDao = webApplicationContext.getBean(VatEnterpriseAccountDao.class);
vatEnterpriseAccountMapper = webApplicationContext.getBean(VatEnterpriseAccountMapper.class); vatEnterpriseAccountMapper = webApplicationContext.getBean(VatEnterpriseAccountMapper.class);
periodEnterpriseAccountMapper = webApplicationContext.getBean(PeriodEnterpriseAccountMapper.class);
balanceStdManualMapper = webApplicationContext.getBean(BalanceStdManualMapper.class); balanceStdManualMapper = webApplicationContext.getBean(BalanceStdManualMapper.class);
outputVATInvoiceMapper = webApplicationContext.getBean(OutputVatInvoiceMapper.class); outputVATInvoiceMapper = webApplicationContext.getBean(OutputVatInvoiceMapper.class);
periodTaxRuleSettingMapper = webApplicationContext.getBean(PeriodTaxRuleSettingMapper.class); periodTaxRuleSettingMapper = webApplicationContext.getBean(PeriodTaxRuleSettingMapper.class);
...@@ -84,6 +93,7 @@ public class SpringContextUtil implements ApplicationContextAware { ...@@ -84,6 +93,7 @@ public class SpringContextUtil implements ApplicationContextAware {
assetsListMapper = webApplicationContext.getBean(AssetsListMapper.class); assetsListMapper = webApplicationContext.getBean(AssetsListMapper.class);
projectMapper = webApplicationContext.getBean(ProjectMapper.class); projectMapper = webApplicationContext.getBean(ProjectMapper.class);
cellDataSourceMapper = webApplicationContext.getBean(CellDataSourceMapper.class); cellDataSourceMapper = webApplicationContext.getBean(CellDataSourceMapper.class);
periodCellDataSourceMapper = webApplicationContext.getBean(PeriodCellDataSourceMapper.class);
organizationMapper = webApplicationContext.getBean(OrganizationMapper.class); organizationMapper = webApplicationContext.getBean(OrganizationMapper.class);
} }
} }
package pwc.taxtech.atms.controller; package pwc.taxtech.atms.controller;
import org.apache.commons.lang3.StringUtils;
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.RequestMapping; import org.springframework.web.bind.annotation.*;
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.dto.OperationResultDto; import pwc.taxtech.atms.dto.OperationResultDto;
import pwc.taxtech.atms.vat.entity.CellComment; import pwc.taxtech.atms.vat.entity.CellComment;
import pwc.taxtech.atms.vat.entity.PeriodCellComment; import pwc.taxtech.atms.vat.entity.PeriodCellComment;
...@@ -21,7 +19,11 @@ public class CellCommentController { ...@@ -21,7 +19,11 @@ public class CellCommentController {
CellCommentServiceImpl cellCommentService; CellCommentServiceImpl cellCommentService;
@RequestMapping(value = "List", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_UTF8_VALUE) @RequestMapping(value = "List", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public OperationResultDto<List<PeriodCellComment>> getCellComments(@RequestParam("cellDataId") Optional<Long> cellDataId) { public OperationResultDto<List<PeriodCellComment>> getCellComments(@RequestParam("cellDataId") Optional<Long> cellDataId, @RequestHeader("from") String form) {
return cellCommentService.getCellComments(cellDataId); String projectId = StringUtils.EMPTY;
if (StringUtils.isNotBlank(form) && form.split("@").length > 0) {
projectId = form.split("@")[0];
}
return cellCommentService.getCellComments(cellDataId, projectId);
} }
} }
...@@ -6,6 +6,7 @@ import pwc.taxtech.atms.constant.DataSourceName; ...@@ -6,6 +6,7 @@ import pwc.taxtech.atms.constant.DataSourceName;
import pwc.taxtech.atms.constant.enums.FormulaDataSourceType; import pwc.taxtech.atms.constant.enums.FormulaDataSourceType;
import pwc.taxtech.atms.dpo.CellTemplatePerGroupDto; import pwc.taxtech.atms.dpo.CellTemplatePerGroupDto;
import pwc.taxtech.atms.vat.entity.CellData; import pwc.taxtech.atms.vat.entity.CellData;
import pwc.taxtech.atms.vat.entity.PeriodCellData;
import java.math.BigDecimal; import java.math.BigDecimal;
...@@ -47,7 +48,7 @@ public class ReportCellDataSourceDto extends DataSourceDto { ...@@ -47,7 +48,7 @@ public class ReportCellDataSourceDto extends DataSourceDto {
} }
public void extractFromGroup(BBParasBo bbParasBo, CurrentPeriodBo currentPeriodBo, public void extractFromGroup(BBParasBo bbParasBo, CurrentPeriodBo currentPeriodBo,
CellData cellData, CellTemplatePerGroupDto cellTemplateData) { PeriodCellData cellData, CellTemplatePerGroupDto cellTemplateData) {
this.name = DataSourceName.ReportDataSource; this.name = DataSourceName.ReportDataSource;
this.year = currentPeriodBo.curYear; this.year = currentPeriodBo.curYear;
this.period = currentPeriodBo.curPeriod; this.period = currentPeriodBo.curPeriod;
......
...@@ -3,6 +3,8 @@ package pwc.taxtech.atms.vat.dao; ...@@ -3,6 +3,8 @@ package pwc.taxtech.atms.vat.dao;
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.vat.dao.VatEnterpriseAccountMapper; import pwc.taxtech.atms.vat.dao.VatEnterpriseAccountMapper;
import pwc.taxtech.atms.vat.entity.PeriodEnterpriseAccount;
import pwc.taxtech.atms.vat.entity.PeriodEnterpriseAccountExample;
import pwc.taxtech.atms.vat.entity.VatEnterpriseAccount; import pwc.taxtech.atms.vat.entity.VatEnterpriseAccount;
import pwc.taxtech.atms.vat.entity.VatEnterpriseAccountExample; import pwc.taxtech.atms.vat.entity.VatEnterpriseAccountExample;
...@@ -11,11 +13,11 @@ import java.util.List; ...@@ -11,11 +13,11 @@ import java.util.List;
@Service @Service
public class VatEnterpriseAccountDao { public class VatEnterpriseAccountDao {
@Autowired @Autowired
VatEnterpriseAccountMapper vatEnterpriseAccountMapper; PeriodEnterpriseAccountMapper periodEnterpriseAccountMapper;
public List<VatEnterpriseAccount> getListByAccountCode(String accountCode) { public List<PeriodEnterpriseAccount> getListByAccountCode(String accountCode) {
VatEnterpriseAccountExample example = new VatEnterpriseAccountExample(); PeriodEnterpriseAccountExample example = new PeriodEnterpriseAccountExample();
example.createCriteria().andAcctCodeEqualTo(accountCode); example.createCriteria().andAcctCodeEqualTo(accountCode);
return vatEnterpriseAccountMapper.selectByExample(example); return periodEnterpriseAccountMapper.selectByExample(example);
} }
} }
...@@ -9,7 +9,7 @@ import java.util.Optional; ...@@ -9,7 +9,7 @@ import java.util.Optional;
@Service @Service
public class CellCommentServiceImpl extends VatAbstractService { public class CellCommentServiceImpl extends VatAbstractService {
public OperationResultDto<List<PeriodCellComment>> getCellComments(Optional<Long> cellDataId) { public OperationResultDto<List<PeriodCellComment>> getCellComments(Optional<Long> cellDataId,String projectId) {
OperationResultDto resultDto = new OperationResultDto(); OperationResultDto resultDto = new OperationResultDto();
try { try {
if (!cellDataId.isPresent() || cellDataId.get() == 0L) { if (!cellDataId.isPresent() || cellDataId.get() == 0L) {
...@@ -20,6 +20,7 @@ public class CellCommentServiceImpl extends VatAbstractService { ...@@ -20,6 +20,7 @@ public class CellCommentServiceImpl extends VatAbstractService {
PeriodCellCommentExample example = new PeriodCellCommentExample(); PeriodCellCommentExample example = new PeriodCellCommentExample();
example.createCriteria().andCellDataIdEqualTo(cellDataId.get()); example.createCriteria().andCellDataIdEqualTo(cellDataId.get());
example.createCriteria().andProjectIdEqualTo(projectId);
List<PeriodCellComment> cellComments = periodCellCommentMapper.selectByExample(example); List<PeriodCellComment> cellComments = periodCellCommentMapper.selectByExample(example);
resultDto.setResult(true); resultDto.setResult(true);
resultDto.setData(cellComments); resultDto.setData(cellComments);
......
...@@ -11,11 +11,9 @@ import pwc.taxtech.atms.entity.ProjectServiceType; ...@@ -11,11 +11,9 @@ import pwc.taxtech.atms.entity.ProjectServiceType;
import pwc.taxtech.atms.entity.ProjectServiceTypeExample; 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.ReportMapper; import pwc.taxtech.atms.vat.dao.ReportMapper;
import pwc.taxtech.atms.vat.entity.CellData; import pwc.taxtech.atms.vat.entity.*;
import pwc.taxtech.atms.vat.entity.CellDataExample;
import pwc.taxtech.atms.vat.entity.Report;
import pwc.taxtech.atms.vat.entity.ReportExample;
import java.util.List; import java.util.List;
...@@ -29,6 +27,8 @@ public class FormulaAgent extends VatAbstractService { ...@@ -29,6 +27,8 @@ public class FormulaAgent extends VatAbstractService {
public ReportMapper reportMapper; public ReportMapper reportMapper;
@Autowired @Autowired
public CellDataMapper cellDataMapper; public CellDataMapper cellDataMapper;
@Autowired
public PeriodCellDataMapper periodCellDataMapper;
public List<CellTemplatePerGroupDto> getCellTemplateGroupDto(Long templateGroupId, String projectId) { public List<CellTemplatePerGroupDto> getCellTemplateGroupDto(Long templateGroupId, String projectId) {
ProjectServiceTypeExample pst = new ProjectServiceTypeExample(); ProjectServiceTypeExample pst = new ProjectServiceTypeExample();
...@@ -60,10 +60,10 @@ public class FormulaAgent extends VatAbstractService { ...@@ -60,10 +60,10 @@ public class FormulaAgent extends VatAbstractService {
return null; return null;
} }
private CellData getCellDataListByTemplate(String templateId, Long reportId) { private PeriodCellData getCellDataListByTemplate(String templateId, Long reportId) {
CellDataExample dataExample = new CellDataExample(); PeriodCellDataExample dataExample = new PeriodCellDataExample();
dataExample.createCriteria().andCellTemplateIdEqualTo(Long.valueOf(templateId)).andReportIdEqualTo(reportId); dataExample.createCriteria().andCellTemplateIdEqualTo(Long.valueOf(templateId)).andReportIdEqualTo(reportId);
List<CellData> cellDataList = cellDataMapper.selectByExample(dataExample); List<PeriodCellData> cellDataList = periodCellDataMapper.selectByExample(dataExample);
if (cellDataList != null && !cellDataList.isEmpty()) return cellDataList.get(FIRST_OR_DEFAULT); if (cellDataList != null && !cellDataList.isEmpty()) return cellDataList.get(FIRST_OR_DEFAULT);
return null; return null;
...@@ -73,11 +73,11 @@ public class FormulaAgent extends VatAbstractService { ...@@ -73,11 +73,11 @@ public class FormulaAgent extends VatAbstractService {
return adminMp.getPastProjectId(year, orgId); return adminMp.getPastProjectId(year, orgId);
} }
public CellData getCellData(String templateId, String cellId, int periodId) { public PeriodCellData getCellData(String templateId, String cellId, int periodId) {
Report report = getReportByTemplate(templateId, periodId); Report report = getReportByTemplate(templateId, periodId);
MyAsserts.assertNotNull(report, Exceptions.BB_REPORT_NULL); MyAsserts.assertNotNull(report, Exceptions.BB_REPORT_NULL);
CellData cellData = getCellDataListByTemplate(cellId, report.getId()); PeriodCellData cellData = getCellDataListByTemplate(cellId, report.getId());
MyAsserts.assertNotNull(cellData, Exceptions.BB_CELL_DATA_NULL); MyAsserts.assertNotNull(cellData, Exceptions.BB_CELL_DATA_NULL);
return cellData; return cellData;
} }
......
...@@ -306,7 +306,7 @@ public class ReportGeneratorImpl extends VatAbstractService implements ReportGen ...@@ -306,7 +306,7 @@ public class ReportGeneratorImpl extends VatAbstractService implements ReportGen
Cell cell = row.getCell(colNum - 1); Cell cell = row.getCell(colNum - 1);
if (cell != null) { if (cell != null) {
//开始取值然后存放到DataSource //开始取值然后存放到DataSource
DataSource dataSource = new DataSource(); PeriodDataSource dataSource = new PeriodDataSource();
dataSource.setId(distributedIdService.nextId()); dataSource.setId(distributedIdService.nextId());
dataSource.setColumnIndex(colNum - 1); dataSource.setColumnIndex(colNum - 1);
dataSource.setRowIndex(rowNum - 1); dataSource.setRowIndex(rowNum - 1);
...@@ -329,7 +329,7 @@ public class ReportGeneratorImpl extends VatAbstractService implements ReportGen ...@@ -329,7 +329,7 @@ public class ReportGeneratorImpl extends VatAbstractService implements ReportGen
dataSource.setPeriod(period); dataSource.setPeriod(period);
dataSource.setCellTemplateId(periodCellTemplateConfig.getCellTemplateId()); dataSource.setCellTemplateId(periodCellTemplateConfig.getCellTemplateId());
dataSource.setType(FormulaDataSourceType.Report.getCode()); dataSource.setType(FormulaDataSourceType.Report.getCode());
dataSourceMapper.insertSelective(dataSource); periodDataSourceMapper.insertSelective(dataSource);
//这里有个问题就是DataSource的数据有了,但是celldatasource的数据没有,后面无法关联celldata和DataSource //这里有个问题就是DataSource的数据有了,但是celldatasource的数据没有,后面无法关联celldata和DataSource
//解决办法就是 在存DataSource的时候就先把celldata的数据加好 //解决办法就是 在存DataSource的时候就先把celldata的数据加好
//然后把celldatasource的数据也加好 //然后把celldatasource的数据也加好
...@@ -344,7 +344,7 @@ public class ReportGeneratorImpl extends VatAbstractService implements ReportGen ...@@ -344,7 +344,7 @@ public class ReportGeneratorImpl extends VatAbstractService implements ReportGen
.filter(a -> a.getCellTemplateId().equals(periodCellTemplateConfig.getCellTemplateId())) .filter(a -> a.getCellTemplateId().equals(periodCellTemplateConfig.getCellTemplateId()))
.findFirst(); .findFirst();
if (tempPeriodCellTemplate.isPresent()) { if (tempPeriodCellTemplate.isPresent()) {
CellData cellData = new CellData(); PeriodCellData cellData = new PeriodCellData();
Long cellDataId = distributedIdService.nextId(); Long cellDataId = distributedIdService.nextId();
cellData.setId(cellDataId); cellData.setId(cellDataId);
cellData.setReportId(reportId); cellData.setReportId(reportId);
...@@ -395,23 +395,23 @@ public class ReportGeneratorImpl extends VatAbstractService implements ReportGen ...@@ -395,23 +395,23 @@ public class ReportGeneratorImpl extends VatAbstractService implements ReportGen
cellData.setCreateTime(createTime); cellData.setCreateTime(createTime);
cellData.setUpdateBy("Admin"); cellData.setUpdateBy("Admin");
cellData.setUpdateTime(createTime); cellData.setUpdateTime(createTime);
cellDataMapper.insertSelective(cellData); periodCellDataMapper.insertSelective(cellData);
//after insert celldata, insert the celldatasource for link celldata and datasource //after insert celldata, insert the celldatasource for link celldata and datasource
DataSourceExample dataSourceExample = new DataSourceExample(); PeriodDataSourceExample dataSourceExample = new PeriodDataSourceExample();
dataSourceExample.createCriteria().andPeriodEqualTo(period) dataSourceExample.createCriteria().andPeriodEqualTo(period)
.andCellTemplateIdEqualTo(tempPeriodCellTemplate.get().getCellTemplateId()); .andCellTemplateIdEqualTo(tempPeriodCellTemplate.get().getCellTemplateId());
List<DataSource> dataSourceList = SpringContextUtil.dataSourceMapper.selectByExample(dataSourceExample); List<PeriodDataSource> dataSourceList = SpringContextUtil.periodDataSourceMapper.selectByExample(dataSourceExample);
for (int ii = 0; ii < dataSourceList.size(); ii++) { for (int ii = 0; ii < dataSourceList.size(); ii++) {
DataSource dataSource = dataSourceList.get(ii); PeriodDataSource dataSource = dataSourceList.get(ii);
CellDataSource cellDataSource = new CellDataSource(); PeriodCellDataSource cellDataSource = new PeriodCellDataSource();
cellDataSource.setId(distributedIdService.nextId()); cellDataSource.setId(distributedIdService.nextId());
cellDataSource.setCellTemplateId(tempPeriodCellTemplate.get().getCellTemplateId()); cellDataSource.setCellTemplateId(tempPeriodCellTemplate.get().getCellTemplateId());
cellDataSource.setCellDataId(cellDataId); cellDataSource.setCellDataId(cellDataId);
cellDataSource.setDataSourceId(dataSource.getId()); cellDataSource.setDataSourceId(dataSource.getId());
cellDataSource.setCreateTime(createTime); cellDataSource.setCreateTime(createTime);
cellDataSource.setUpdateTime(createTime); cellDataSource.setUpdateTime(createTime);
SpringContextUtil.cellDataSourceMapper.insertSelective(cellDataSource); SpringContextUtil.periodCellDataSourceMapper.insertSelective(cellDataSource);
} }
} }
} }
...@@ -587,7 +587,7 @@ public class ReportGeneratorImpl extends VatAbstractService implements ReportGen ...@@ -587,7 +587,7 @@ public class ReportGeneratorImpl extends VatAbstractService implements ReportGen
}); });
if (!parameter.isEmpty()) { if (!parameter.isEmpty()) {
List<PCTEntity> pctResults = cellDataMapper.queryByPCTs(parameter); List<PCTEntity> pctResults = periodCellDataMapper.queryByPCTs(parameter);
Map<PCTEntity, BigDecimal> pctCache = new HashMap<>(); Map<PCTEntity, BigDecimal> pctCache = new HashMap<>();
pctResults.forEach(m -> { pctResults.forEach(m -> {
BigDecimal data = null; BigDecimal data = null;
......
...@@ -20,6 +20,8 @@ public class VatAbstractService { ...@@ -20,6 +20,8 @@ public class VatAbstractService {
@Autowired @Autowired
public VatEnterpriseAccountMapper vatEnterpriseAccountMapper; public VatEnterpriseAccountMapper vatEnterpriseAccountMapper;
@Autowired @Autowired
public PeriodEnterpriseAccountMapper periodEnterpriseAccountMapper;
@Autowired
public VatStandardAccountMapper vatStandardAccountMapper; public VatStandardAccountMapper vatStandardAccountMapper;
@Autowired @Autowired
public InputVatInvoiceMapper inputVATInvoiceMapper; public InputVatInvoiceMapper inputVATInvoiceMapper;
...@@ -48,8 +50,12 @@ public class VatAbstractService { ...@@ -48,8 +50,12 @@ public class VatAbstractService {
@Autowired @Autowired
public DataSourceMapper dataSourceMapper; public DataSourceMapper dataSourceMapper;
@Autowired @Autowired
public PeriodDataSourceMapper periodDataSourceMapper;
@Autowired
public DataSourceDetailMapper dataSourceDetailMapper; public DataSourceDetailMapper dataSourceDetailMapper;
@Autowired @Autowired
public PeriodDataSourceDetailMapper periodDataSourceDetailMapper;
@Autowired
public TemplateGroupMapper templateGroupMapper; public TemplateGroupMapper templateGroupMapper;
@Autowired @Autowired
public DistributedIdService distributedIdService; public DistributedIdService distributedIdService;
...@@ -76,6 +82,8 @@ public class VatAbstractService { ...@@ -76,6 +82,8 @@ public class VatAbstractService {
@Autowired @Autowired
public CellDataMapper cellDataMapper; public CellDataMapper cellDataMapper;
@Autowired @Autowired
public PeriodCellDataMapper periodCellDataMapper;
@Autowired
public ModifiedReportCellMapper modifiedReportCellMapper; public ModifiedReportCellMapper modifiedReportCellMapper;
@Autowired @Autowired
public PeriodCellCommentMapper periodCellCommentMapper; public PeriodCellCommentMapper periodCellCommentMapper;
...@@ -85,5 +93,6 @@ public class VatAbstractService { ...@@ -85,5 +93,6 @@ public class VatAbstractService {
public FtpService ftpService; public FtpService ftpService;
@Autowired @Autowired
public CellDataSourceMapper cellDataSourceMapper; public CellDataSourceMapper cellDataSourceMapper;
@Autowired
public PeriodCellDataSourceMapper periodCellDataSourceMapper;
} }
...@@ -18,6 +18,7 @@ import pwc.taxtech.atms.dto.vatdto.ReportCellDataSourceDto; ...@@ -18,6 +18,7 @@ import pwc.taxtech.atms.dto.vatdto.ReportCellDataSourceDto;
import pwc.taxtech.atms.exception.Exceptions; import pwc.taxtech.atms.exception.Exceptions;
import pwc.taxtech.atms.exception.FormulaException; import pwc.taxtech.atms.exception.FormulaException;
import pwc.taxtech.atms.vat.entity.CellData; import pwc.taxtech.atms.vat.entity.CellData;
import pwc.taxtech.atms.vat.entity.PeriodCellData;
import java.lang.reflect.Field; import java.lang.reflect.Field;
import java.math.BigDecimal; import java.math.BigDecimal;
...@@ -107,7 +108,7 @@ public class BB extends FunctionBase implements FreeRefFunction { ...@@ -107,7 +108,7 @@ public class BB extends FunctionBase implements FreeRefFunction {
} }
// bo.disCount(); // bo.disCount();
CellData cellData = null; PeriodCellData cellData = null;
String projectId = agent.getPastProjectId(curPeriod.getCurYear(), String projectId = agent.getPastProjectId(curPeriod.getCurYear(),
formulaContext.getOrganizationId()); formulaContext.getOrganizationId());
......
...@@ -8,10 +8,7 @@ import pwc.taxtech.atms.common.util.SpringContextUtil; ...@@ -8,10 +8,7 @@ import pwc.taxtech.atms.common.util.SpringContextUtil;
import pwc.taxtech.atms.constant.enums.FormulaDataSourceDetailType; import pwc.taxtech.atms.constant.enums.FormulaDataSourceDetailType;
import pwc.taxtech.atms.constant.enums.KeyValueConfigResultType; import pwc.taxtech.atms.constant.enums.KeyValueConfigResultType;
import pwc.taxtech.atms.dto.vatdto.BSPLFormulaDataSourceDto; import pwc.taxtech.atms.dto.vatdto.BSPLFormulaDataSourceDto;
import pwc.taxtech.atms.vat.entity.Balance; import pwc.taxtech.atms.vat.entity.*;
import pwc.taxtech.atms.vat.entity.BalanceStdManual;
import pwc.taxtech.atms.vat.entity.VatEnterpriseAccount;
import pwc.taxtech.atms.vat.entity.VatStandardAccount;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.ArrayList; import java.util.ArrayList;
...@@ -94,7 +91,7 @@ public class FSJZ extends FunctionBase implements FreeRefFunction { ...@@ -94,7 +91,7 @@ public class FSJZ extends FunctionBase implements FreeRefFunction {
List<Object> formulaDataSourceDtoList = new ArrayList<>(); List<Object> formulaDataSourceDtoList = new ArrayList<>();
if (balanceStdManual != null) { if (balanceStdManual != null) {
List<VatEnterpriseAccount> vatEnterpriseAccountList = SpringContextUtil List<VatEnterpriseAccount> vatEnterpriseAccountList = SpringContextUtil
.vatEnterpriseAccountMapper .periodEnterpriseAccountMapper
.getListWithAccountCode(accountCode); .getListWithAccountCode(accountCode);
if (period == 99) { if (period == 99) {
val = new BigDecimal(((balanceStdManual.getYearDebitNet() != null ? balanceStdManual.getYearDebitNet() : 0).doubleValue() val = new BigDecimal(((balanceStdManual.getYearDebitNet() != null ? balanceStdManual.getYearDebitNet() : 0).doubleValue()
...@@ -140,7 +137,7 @@ public class FSJZ extends FunctionBase implements FreeRefFunction { ...@@ -140,7 +137,7 @@ public class FSJZ extends FunctionBase implements FreeRefFunction {
return new NumberEval(val.doubleValue()); return new NumberEval(val.doubleValue());
} else { } else {
//企业账套 //企业账套
List<VatEnterpriseAccount> vatEnterpriseAccountList = SpringContextUtil List<PeriodEnterpriseAccount> vatEnterpriseAccountList = SpringContextUtil
.vatEnterpriseAccountDao .vatEnterpriseAccountDao
.getListByAccountCode(accountCode); .getListByAccountCode(accountCode);
......
...@@ -10,9 +10,7 @@ import org.slf4j.LoggerFactory; ...@@ -10,9 +10,7 @@ import org.slf4j.LoggerFactory;
import pwc.taxtech.atms.common.util.SpringContextUtil; import pwc.taxtech.atms.common.util.SpringContextUtil;
import pwc.taxtech.atms.constant.enums.FormulaDataSourceDetailType; import pwc.taxtech.atms.constant.enums.FormulaDataSourceDetailType;
import pwc.taxtech.atms.constant.enums.FormulaDataSourceType; import pwc.taxtech.atms.constant.enums.FormulaDataSourceType;
import pwc.taxtech.atms.vat.entity.DataSource; import pwc.taxtech.atms.vat.entity.*;
import pwc.taxtech.atms.vat.entity.DataSourceDetail;
import pwc.taxtech.atms.vat.entity.PeriodFormulaBlock;
import pwc.taxtech.atms.vat.service.impl.FormulaAgent; import pwc.taxtech.atms.vat.service.impl.FormulaAgent;
import javax.tools.JavaCompiler; import javax.tools.JavaCompiler;
...@@ -111,7 +109,7 @@ public class FunctionBase { ...@@ -111,7 +109,7 @@ public class FunctionBase {
Long periodCellTemplateId = SpringContextUtil.periodCellTemplateMapper.getCellTemplateIdWithMap(map); Long periodCellTemplateId = SpringContextUtil.periodCellTemplateMapper.getCellTemplateIdWithMap(map);
Date creatime = new Date(); Date creatime = new Date();
DataSource dataSource = new DataSource(); PeriodDataSource dataSource = new PeriodDataSource();
Long dataSourceId = SpringContextUtil.distributedIdService.nextId(); Long dataSourceId = SpringContextUtil.distributedIdService.nextId();
dataSource.setId(dataSourceId); dataSource.setId(dataSourceId);
dataSource.setType(FormulaDataSourceType.Report.getCode()); dataSource.setType(FormulaDataSourceType.Report.getCode());
...@@ -128,24 +126,24 @@ public class FunctionBase { ...@@ -128,24 +126,24 @@ public class FunctionBase {
dataSource.setColumnName(""); dataSource.setColumnName("");
dataSource.setCellTemplateId(periodCellTemplateId); dataSource.setCellTemplateId(periodCellTemplateId);
dataSource.setPeriod(period); dataSource.setPeriod(period);
SpringContextUtil.dataSourceMapper.insertSelective(dataSource); SpringContextUtil.periodDataSourceMapper.insertSelective(dataSource);
for (Object obj : dataSourceList) { for (Object obj : dataSourceList) {
if (obj.getClass()==java.util.ArrayList.class) { if (obj.getClass()==java.util.ArrayList.class) {
for (Object obj2 : (ArrayList<Object>)obj) { for (Object obj2 : (ArrayList<Object>)obj) {
DataSourceDetail dataSourceDetail = new DataSourceDetail(); PeriodDataSourceDetail dataSourceDetail = new PeriodDataSourceDetail();
dataSourceDetail.setId(SpringContextUtil.distributedIdService.nextId()); dataSourceDetail.setId(SpringContextUtil.distributedIdService.nextId());
dataSourceDetail.setDataSourceId(dataSourceId); dataSourceDetail.setDataSourceId(dataSourceId);
dataSourceDetail.setDataSourceType(formulaDataSourceDetailType.getCode()); dataSourceDetail.setDataSourceType(formulaDataSourceDetailType.getCode());
dataSourceDetail.setItemValue(JSON.toJSONString(obj2)); dataSourceDetail.setItemValue(JSON.toJSONString(obj2));
SpringContextUtil.dataSourceDetailMapper.insertSelective(dataSourceDetail); SpringContextUtil.periodDataSourceDetailMapper.insertSelective(dataSourceDetail);
} }
} else { } else {
DataSourceDetail dataSourceDetail = new DataSourceDetail(); PeriodDataSourceDetail dataSourceDetail = new PeriodDataSourceDetail();
dataSourceDetail.setId(SpringContextUtil.distributedIdService.nextId()); dataSourceDetail.setId(SpringContextUtil.distributedIdService.nextId());
dataSourceDetail.setDataSourceId(dataSourceId); dataSourceDetail.setDataSourceId(dataSourceId);
dataSourceDetail.setDataSourceType(formulaDataSourceDetailType.getCode()); dataSourceDetail.setDataSourceType(formulaDataSourceDetailType.getCode());
dataSourceDetail.setItemValue(JSON.toJSONString(obj)); dataSourceDetail.setItemValue(JSON.toJSONString(obj));
SpringContextUtil.dataSourceDetailMapper.insertSelective(dataSourceDetail); SpringContextUtil.periodDataSourceDetailMapper.insertSelective(dataSourceDetail);
} }
} }
return dataSourceId; return dataSourceId;
......
package pwc.taxtech.atms.vat.dao; package pwc.taxtech.atms.vat.dao;
import java.util.List; import java.util.List;
import java.util.Set;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.session.RowBounds; import org.apache.ibatis.session.RowBounds;
import pwc.taxtech.atms.MyVatMapper; import pwc.taxtech.atms.MyVatMapper;
import pwc.taxtech.atms.vat.entity.PCTEntity;
import pwc.taxtech.atms.vat.entity.PeriodCellData; import pwc.taxtech.atms.vat.entity.PeriodCellData;
import pwc.taxtech.atms.vat.entity.PeriodCellDataExample; import pwc.taxtech.atms.vat.entity.PeriodCellDataExample;
...@@ -105,4 +109,20 @@ public interface PeriodCellDataMapper extends MyVatMapper { ...@@ -105,4 +109,20 @@ public interface PeriodCellDataMapper extends MyVatMapper {
* @mbg.generated * @mbg.generated
*/ */
int updateByPrimaryKey(PeriodCellData record); int updateByPrimaryKey(PeriodCellData record);
@Select("<script>" +
"SELECT " +
" R.PERIOD, C.CELL_TEMPLATE_ID AS CELLTEMPLATEID, DATA " +
"FROM " +
" PERIOD_CELL_DATA C, " +
" PERIOD_REPORT R " +
"WHERE " +
" C.REPORT_ID = R.ID AND " +
" " +
" <foreach item=\"item\" index=\"index\" collection=\"list\"" +
" open=\"(\" separator=\"OR\" close=\")\">" +
" ( R.PERIOD=#{item.period} AND C.CELL_TEMPLATE_ID=#{item.cellTemplateId} )" +
" </foreach>" +
"</script>")
List<PCTEntity> queryByPCTs(@Param("list") Set<PCTEntity> parameter);
} }
\ No newline at end of file
...@@ -5,6 +5,8 @@ import org.apache.ibatis.annotations.Mapper; ...@@ -5,6 +5,8 @@ import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.session.RowBounds; import org.apache.ibatis.session.RowBounds;
import pwc.taxtech.atms.MyVatMapper; import pwc.taxtech.atms.MyVatMapper;
import pwc.taxtech.atms.vat.dpo.DataSourceCellDataDto;
import pwc.taxtech.atms.vat.dpo.DataSourceExtendDto;
import pwc.taxtech.atms.vat.entity.PeriodDataSource; import pwc.taxtech.atms.vat.entity.PeriodDataSource;
import pwc.taxtech.atms.vat.entity.PeriodDataSourceExample; import pwc.taxtech.atms.vat.entity.PeriodDataSourceExample;
...@@ -105,4 +107,34 @@ public interface PeriodDataSourceMapper extends MyVatMapper { ...@@ -105,4 +107,34 @@ public interface PeriodDataSourceMapper extends MyVatMapper {
* @mbg.generated * @mbg.generated
*/ */
int updateByPrimaryKey(PeriodDataSource record); int updateByPrimaryKey(PeriodDataSource record);
void clearFormulaBlockWithPeriod(@Param("period") Integer period);
void clearTaxRuleSettingWithPeriod(@Param("period") Integer period);
void clearCellTemplateWithPeriod(@Param("period") Integer period, @Param("exceptReportTemplateIDs") String exceptReportTemplateIDs);
void clearCellTemplateConfigWithPeriod(@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 clearDataSourceWithPeriod(@Param("period") Integer period);
void clearDataSourceDetailWithPeriod(@Param("period") Integer period);
void clearCellDataSourceDataWithPeriod(@Param("period") Integer period);
void clearCellDataWithPeriod(@Param("exceptReportTemplateIDs") String exceptReportTemplateIDs, @Param("period") Integer period);
void clearReportWithPeriod(Integer period);
void clearDataWithPeriod(@Param("exceptReportTemplateIDs") String exceptReportTemplateIDs, @Param("period") Integer period);
List<DataSourceExtendDto> getFormulaDataSource(Long reportID);
List<DataSourceExtendDto> getManualDataSource(Long cellDataID);
DataSourceCellDataDto getManualDataSource2(Long dataSourceID);
} }
\ No newline at end of file
...@@ -7,6 +7,7 @@ import org.apache.ibatis.session.RowBounds; ...@@ -7,6 +7,7 @@ import org.apache.ibatis.session.RowBounds;
import pwc.taxtech.atms.MyVatMapper; import pwc.taxtech.atms.MyVatMapper;
import pwc.taxtech.atms.vat.entity.PeriodEnterpriseAccount; import pwc.taxtech.atms.vat.entity.PeriodEnterpriseAccount;
import pwc.taxtech.atms.vat.entity.PeriodEnterpriseAccountExample; import pwc.taxtech.atms.vat.entity.PeriodEnterpriseAccountExample;
import pwc.taxtech.atms.vat.entity.VatEnterpriseAccount;
@Mapper @Mapper
public interface PeriodEnterpriseAccountMapper extends MyVatMapper { public interface PeriodEnterpriseAccountMapper extends MyVatMapper {
...@@ -105,4 +106,7 @@ public interface PeriodEnterpriseAccountMapper extends MyVatMapper { ...@@ -105,4 +106,7 @@ public interface PeriodEnterpriseAccountMapper extends MyVatMapper {
* @mbg.generated * @mbg.generated
*/ */
int updateByPrimaryKey(PeriodEnterpriseAccount record); int updateByPrimaryKey(PeriodEnterpriseAccount record);
List<VatEnterpriseAccount> getListWithAccountCode(@Param("accountCode") String accountCode);
} }
\ No newline at end of file
...@@ -2,6 +2,7 @@ package pwc.taxtech.atms.vat.dpo; ...@@ -2,6 +2,7 @@ package pwc.taxtech.atms.vat.dpo;
import pwc.taxtech.atms.CommonUtils; import pwc.taxtech.atms.CommonUtils;
import pwc.taxtech.atms.vat.entity.DataSource; import pwc.taxtech.atms.vat.entity.DataSource;
import pwc.taxtech.atms.vat.entity.PeriodDataSource;
import java.util.List; import java.util.List;
...@@ -10,12 +11,12 @@ public class DataSourceExtendDto extends DataSource { ...@@ -10,12 +11,12 @@ public class DataSourceExtendDto extends DataSource {
private Long cellTemplateId; private Long cellTemplateId;
private Long cellDataId; private Long cellDataId;
private List<String> items; private List<String> items;
private DataSource dataSource; private PeriodDataSource dataSource;
private Long reportTemplateId; private Long reportTemplateId;
private Integer dataSourceType; private Integer dataSourceType;
public DataSource getDataSource() { public PeriodDataSource getDataSource() {
this.dataSource = new DataSource(); this.dataSource = new PeriodDataSource();
CommonUtils.copyProperties(this, dataSource); CommonUtils.copyProperties(this, dataSource);
return this.dataSource; return this.dataSource;
} }
...@@ -52,7 +53,7 @@ public class DataSourceExtendDto extends DataSource { ...@@ -52,7 +53,7 @@ public class DataSourceExtendDto extends DataSource {
this.items = items; this.items = items;
} }
public void setDataSource(DataSource dataSource) { public void setDataSource(PeriodDataSource dataSource) {
this.dataSource = dataSource; this.dataSource = dataSource;
} }
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="pwc.taxtech.atms.vat.dao.PeriodCellTemplateMapper">
</mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment