Commit 9372ce69 authored by neo's avatar neo

[dev] add projectid for get cell tenplate

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