Commit 225e4abf authored by frank.xa.zhang's avatar frank.xa.zhang

add parameter for some method

parent bdddb3a5
......@@ -37,7 +37,10 @@ public class ReportController {
}
@RequestMapping(value = "updateConfig/{projectId}/{ifDeleteManualDataSource}/{period}", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public OperationResultDto updateConfig(@PathVariable String projectId, @PathVariable Boolean ifDeleteManualDataSource, @PathVariable Integer period, @RequestParam String generator) {
public OperationResultDto updateConfig(@PathVariable String projectId,
@PathVariable Boolean ifDeleteManualDataSource,
@PathVariable Integer period,
@RequestParam String generator) {
return reportService.updateConfig(projectId, period, ifDeleteManualDataSource, generator);
// OperationResultDto operationResultDto = new OperationResultDto();
// operationResultDto.setResult(true);
......@@ -90,12 +93,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)
......
......@@ -157,7 +157,7 @@ public class ReportServiceImpl extends VatAbstractService implements ReportServi
// dataSourceMapper.clearDataSourceWithPeriod(period);
// dataSourceMapper.clearCellDataWithPeriod(strExceptTemplateIds, period);
// dataSourceMapper.clearReportWithPeriod(period);
periodDataSourceMapper.clearDataWithPeriod(strExceptTemplateIds, period);
periodDataSourceMapper.clearDataWithPeriod(strExceptTemplateIds, period,projectId);
// 根据templategroupid 把 template 插入到 periodTemplate
TemplateExample example = new TemplateExample();
example.createCriteria().andTemplateGroupIdEqualTo(templateGroupId);
......
......@@ -130,7 +130,7 @@ public interface PeriodDataSourceMapper extends MyVatMapper {
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);
......
......@@ -119,78 +119,109 @@
</delete>
<delete id="clearDataWithPeriod">
DELETE FROM
PERIOD_FORMULA_BLOCK
DELETE
FROM
PERIOD_FORMULA_BLOCK
WHERE
PERIOD= #{period,jdbcType=INTEGER} ;
DELETE FROM
PERIOD_TAX_RULE_SETTING
PERIOD = #{period,jdbcType=INTEGER}
AND PROJECT_ID = #{projectId,jdbcType=NVARCHAR};
DELETE
FROM
PERIOD_TAX_RULE_SETTING
WHERE
PERIOD= #{period,jdbcType=INTEGER} ;
DELETE FROM
PERIOD_CELL_TEMPLATE
PERIOD = #{period,jdbcType=INTEGER}
AND PROJECT_ID = #{projectId,jdbcType=NVARCHAR};
DELETE
FROM
PERIOD_CELL_TEMPLATE
WHERE
PERIOD= #{period,jdbcType=INTEGER}
AND REPORT_TEMPLATE_ID NOT IN (
${exceptReportTemplateIDs}
)
;
DELETE FROM
PERIOD_CELL_TEMPLATE_CONFIG
PERIOD = #{period,jdbcType=INTEGER}
AND REPORT_TEMPLATE_ID NOT IN (${exceptReportTemplateIDs})
AND PROJECT_ID = #{projectId,jdbcType=NVARCHAR};
DELETE
FROM
PERIOD_CELL_TEMPLATE_CONFIG
WHERE
PERIOD= #{period,jdbcType=INTEGER}
AND REPORT_TEMPLATE_ID NOT IN (
${exceptReportTemplateIDs}
)
;
DELETE FROM
PERIOD_TEMPLATE
PERIOD = #{period,jdbcType=INTEGER}
AND REPORT_TEMPLATE_ID NOT IN (${exceptReportTemplateIDs})
AND PROJECT_ID = #{projectId,jdbcType=NVARCHAR};
DELETE
FROM
PERIOD_TEMPLATE
WHERE
PERIOD= #{period,jdbcType=INTEGER}
AND TEMPLATE_ID NOT IN (
${exceptReportTemplateIDs}
)
;
DELETE FROM
PERIOD_TAX_PAYER_REPORT_RULE
PERIOD = #{period,jdbcType=INTEGER}
AND TEMPLATE_ID NOT IN (${exceptReportTemplateIDs})
AND PROJECT_ID = #{projectId,jdbcType=NVARCHAR};
DELETE
FROM
PERIOD_TAX_PAYER_REPORT_RULE
WHERE
PERIOD= #{period,jdbcType=INTEGER} ;
PERIOD = #{period,jdbcType=INTEGER}
AND PROJECT_ID = #{projectId,jdbcType=NVARCHAR};
DELETE
D FROM
DATA_SOURCE_DETAIL D
JOIN
DATA_SOURCE F
ON
D.DATA_SOURCE_ID = F.ID
FROM
PERIOD_DATA_SOURCE_DETAIL D
WHERE
F.PERIOD = #{period,jdbcType=INTEGER} ;
D .DATA_SOURCE_ID IN (
SELECT
DATA_SOURCE_ID
FROM
PERIOD_DATA_SOURCE_DETAIL E
JOIN Period_DATA_SOURCE F ON E .DATA_SOURCE_ID = F. ID
WHERE
F.PERIOD = #{period,jdbcType=INTEGER}
)
AND PROJECT_ID = #{projectId,jdbcType=NVARCHAR};
DELETE
D FROM
CELL_DATA_SOURCE D
JOIN
DATA_SOURCE F
ON
D.DATA_SOURCE_ID = F.ID
FROM
Period_CELL_DATA_SOURCE D
WHERE
F.PERIOD = #{period,jdbcType=INTEGER} ;
D .DATA_SOURCE_ID IN (
SELECT
DATA_SOURCE_ID
FROM
Period_CELL_DATA_SOURCE E
JOIN period_DATA_SOURCE F ON E .DATA_SOURCE_ID = F. ID
WHERE
F.PERIOD = #{period,jdbcType=INTEGER}
)
AND PROJECT_ID = #{projectId,jdbcType=NVARCHAR};
DELETE
D FROM
DATA_SOURCE D
FROM
period_DATA_SOURCE D
WHERE
D.PERIOD = #{period,jdbcType=INTEGER} ;
D .PERIOD = #{period,jdbcType=INTEGER}
AND PROJECT_ID = #{projectId,jdbcType=NVARCHAR};
DELETE
C FROM
CELL_DATA C
JOIN
REPORT R
ON
C.REPORT_ID=R.ID
FROM
period_CELL_DATA C
WHERE
R.PERIOD = #{period,jdbcType=INTEGER} ;
DELETE FROM
REPORT
REPORT_ID IN (
SELECT
report_id
FROM
PERIOD_CELL_DATA E
JOIN period_REPORT R ON E .REPORT_ID = R. ID
WHERE
R.PERIOD = #{period,jdbcType=INTEGER}
)
AND PROJECT_ID = #{projectId,jdbcType=NVARCHAR};
DELETE
FROM
period_REPORT
WHERE
PERIOD= #{period,jdbcType=INTEGER} ;
PERIOD = #{period,jdbcType=INTEGER}
AND PROJECT_ID = #{projectId,jdbcType=NVARCHAR};
</delete>
<resultMap id="DataSourceExtendDtoMap" type="pwc.taxtech.atms.vat.dpo.DataSourceExtendDto">
......
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