Commit 9372ce69 authored by neo's avatar neo

[dev] add projectid for get cell tenplate

parent 78034487
......@@ -76,8 +76,12 @@ public class ReportController {
}
@RequestMapping(value = "getCellTemplateConfig/{reportTemplateId}/{period}/{rowIndex}/{columnIndex}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public OperationResultDto<PeriodCellTemplateConfig> getCellTemplateConfig(@PathVariable Long reportTemplateId, @PathVariable Integer period, @PathVariable int rowIndex, @PathVariable int columnIndex) {
return reportService.getCellTemplateConfig(reportTemplateId, period, rowIndex, columnIndex);
public OperationResultDto<PeriodCellTemplateConfig> getCellTemplateConfig(@PathVariable Long reportTemplateId,
@PathVariable Integer period,
@PathVariable int rowIndex,
@PathVariable int columnIndex,
@RequestHeader("from") String projectId) {
return reportService.getCellTemplateConfig(reportTemplateId, period, rowIndex, columnIndex, projectId);
}
@RequestMapping(value = "getStdAccountByIndustry/{industryId}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
......@@ -90,12 +94,12 @@ public class ReportController {
}
@RequestMapping(value = "getCellAccountRange/{reportTemplateId}/{period}/{rowIndex}/{columnIndex}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public OperationResultDto<List<VatEnterpriseAccountResultDto>> getCellAccountRange(@PathVariable Long reportTemplateId, @PathVariable Integer period, @PathVariable int rowIndex, @PathVariable int columnIndex,@RequestHeader String from) {
public OperationResultDto<List<VatEnterpriseAccountResultDto>> getCellAccountRange(@PathVariable Long reportTemplateId, @PathVariable Integer period, @PathVariable int rowIndex, @PathVariable int columnIndex, @RequestHeader String from) {
String projectId = StringUtils.EMPTY;
if (StringUtils.isNotBlank(from) && from.split("@").length > 0) {
projectId = from.split("@")[0];
}
return reportService.getCellAccountRange(reportTemplateId, period, rowIndex, columnIndex,projectId);
return reportService.getCellAccountRange(reportTemplateId, period, rowIndex, columnIndex, projectId);
}
@RequestMapping(value = "addCellManualData", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
......
......@@ -28,7 +28,8 @@ public interface ReportService {
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,String porjectId);
OperationResultDto<List<VatEnterpriseAccount>> getStdAccountByIndustry(String industryId,String projectId);
......
......@@ -515,7 +515,7 @@ public class ReportGeneratorImpl extends VatAbstractService implements ReportGen
}
List<PeriodCellTemplateConfigExtendDto> periodCellTemplateConfigExtendDtos =
periodCellTemplateConfigMapper.getPeriodCellTemplateConfigExtendDtos(templateIdList, period);
periodCellTemplateConfigMapper.getPeriodCellTemplateConfigExtendDtos(templateIdList, period, projectId);
fixedPCTParsedFormula(periodCellTemplateConfigExtendDtos, projectId, period);
List<CellCalcInfoDto> cellCalcInfoDtos = new ArrayList<>();
......
......@@ -686,7 +686,8 @@ public class ReportServiceImpl extends VatAbstractService implements ReportServi
}
@Override
public OperationResultDto<PeriodCellTemplateConfig> getCellTemplateConfig(Long reportTemplateId, Integer periodParam, int rowIndex, int columnIndex) {
public OperationResultDto<PeriodCellTemplateConfig> getCellTemplateConfig(Long reportTemplateId, Integer periodParam,
int rowIndex, int columnIndex,String projectId) {
OperationResultDto resultDto = new OperationResultDto();
try {
int period = periodParam != null ? periodParam : 0;
......@@ -697,7 +698,8 @@ public class ReportServiceImpl extends VatAbstractService implements ReportServi
return resultDto;
}
PeriodCellTemplateConfig periodCellTemplateConfig = periodCellTemplateConfigMapper.getConfigWithReportTemplateId(reportTemplateId, period, rowIndex, columnIndex);
PeriodCellTemplateConfig periodCellTemplateConfig = periodCellTemplateConfigMapper
.getConfigWithReportTemplateId(reportTemplateId, period, rowIndex, columnIndex, projectId);
if (periodCellTemplateConfig == null) {
resultDto.setResult(false);
resultDto.setResultMsg("no config for this template!");
......@@ -746,7 +748,7 @@ public class ReportServiceImpl extends VatAbstractService implements ReportServi
int period = periodParam == null ? 0 : periodParam;
PeriodCellTemplateConfig periodCellTemplateConfig =
periodCellTemplateConfigMapper.getConfigWithReportTemplateId(reportTemplateId, period, rowIndex, columnIndex);
periodCellTemplateConfigMapper.getConfigWithReportTemplateId(reportTemplateId, period, rowIndex, columnIndex, projectId);
if (periodCellTemplateConfig == null || StringUtils.isBlank(periodCellTemplateConfig.getAccountCodes())) {
resultDto.setResult(false);
return resultDto;
......
......@@ -110,10 +110,11 @@ public interface PeriodCellTemplateConfigMapper extends MyVatMapper {
void batchInsert(List<PeriodCellTemplateConfig> list);
List<PeriodCellTemplateConfigExtendDto> getPeriodCellTemplateConfigExtendDtos(@Param("list") List<Long> list, @Param("period") Integer period);
List<PeriodCellTemplateConfigExtendDto> getPeriodCellTemplateConfigExtendDtos(@Param("list") List<Long> list, @Param("period") Integer period,
@Param("projectId") String projectId);
PeriodCellTemplateConfig getConfigWithReportTemplateId(@Param("reportTemplateId") Long reportTemplateId,
@Param("period") Integer period, @Param("rowIndex") int rowIndex,
@Param("columnIndex") int columnIndex);
@Param("columnIndex") int columnIndex, @Param("projectId") String projectId);
}
\ No newline at end of file
......@@ -209,6 +209,7 @@
#{item}
</foreach>
AND CELL_TEMPLATE.PERIOD = #{period,jdbcType=INTEGER}
AND CELL_TEMPLATE.PROJECT_ID = #{projectId,jdbcType=VARCHAR}
</select>
<select id="getConfigWithReportTemplateId" resultType="pwc.taxtech.atms.vat.entity.PeriodCellTemplateConfig">
......@@ -229,6 +230,7 @@
AND CT.PERIOD = #{period,jdbcType = INTEGER}
AND CTC.DATA_SOURCE_TYPE = 2
AND CTC.PERIOD= #{period,jdbcType = INTEGER} AND ROWNUM = 1
AND CT.PROJECT_ID = #{projectId,jdbcType=VARCHAR}
</select>
</mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment