Commit 070c5ba1 authored by neo.wang's avatar neo.wang

Merge branch 'dev_oracle_neo' into 'dev_oracle'

Dev oracle neo

See merge request root/atms!139
parents a4a0b300 a2d938f7
......@@ -79,8 +79,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)
......
package pwc.taxtech.atms.dto.formula;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;
public class FormulaParamConfigDto {
@JsonProperty("ID")
public String id;
public String name;
public String displayFormat;
......
......@@ -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;
......
......@@ -113,13 +113,14 @@ public class FormulaHelper {
return rtn;
}
public static Long getCellTemplateIdWithTemplateCodeAndColumnIndexAndRowIndex(String templateCode, int columnIndex, int rowIndex,int period, FormulaContext formulaContext) {
Map<String,Object> map = new HashMap<>();
map.put("code",templateCode);
map.put("templateGroupId",formulaContext.getReportTemplateGroupId());
map.put("period",period);
map.put("columnIndex",columnIndex);
map.put("rowIndex",rowIndex);
public static Long getCellTemplateIdWithTemplateCodeAndColumnIndexAndRowIndex(String templateCode, int columnIndex, int rowIndex, int period, FormulaContext formulaContext) {
Map<String, Object> map = new HashMap<>();
map.put("code", templateCode);
map.put("templateGroupId", formulaContext.getReportTemplateGroupId());
map.put("period", period);
map.put("columnIndex", columnIndex);
map.put("rowIndex", rowIndex);
map.put("projectId", formulaContext.getProjectId());
return SpringContextUtil.periodCellTemplateMapper.getCellTemplateIdWithMap(map);
}
}
......@@ -110,6 +110,7 @@ public class FunctionBase {
map.put("period", period);
map.put("columnIndex", colNum);
map.put("rowIndex", rowNum);
map.put("projectId", projectId);
Long periodCellTemplateId = SpringContextUtil.periodCellTemplateMapper.getCellTemplateIdWithMap(map);
Date creatime = new Date();
......
......@@ -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
......@@ -202,6 +202,7 @@
(
CELL_TEMPLATE.CELL_TEMPLATE_ID = CONFIG.CELL_TEMPLATE_ID
AND CELL_TEMPLATE.PERIOD = CONFIG.PERIOD
AND CELL_TEMPLATE.PROJECT_ID = CONFIG.PROJECT_ID
)
WHERE
CELL_TEMPLATE.REPORT_TEMPLATE_ID IN
......@@ -209,6 +210,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">
......@@ -221,14 +223,15 @@
JOIN
PERIOD_CELL_TEMPLATE_CONFIG CTC
ON
CT.CELL_TEMPLATE_ID = CTC.CELL_TEMPLATE_ID
CT.CELL_TEMPLATE_ID = CTC.CELL_TEMPLATE_ID AND CT.PROJECT_ID=CTC.PROJECT_ID
WHERE
CT.REPORT_TEMPLATE_ID = #{reportTemplateId,jdbcType=BIGINT}
AND CT.ROW_INDEX = #{rowIndex,jdbcType = INTEGER}
AND CT.COLUMN_INDEX = #{columnIndex,jdbcType = INTEGER}
AND CT.PERIOD = #{period,jdbcType = INTEGER}
AND CTC.DATA_SOURCE_TYPE = 2
AND CTC.PERIOD= #{period,jdbcType = INTEGER} LIMIT 1
AND CTC.PERIOD= #{period,jdbcType = INTEGER} AND ROWNUM = 1
AND CT.PROJECT_ID = #{projectId,jdbcType=VARCHAR}
</select>
</mapper>
\ No newline at end of file
......@@ -96,6 +96,8 @@
AND A.COLUMN_INDEX = #{columnIndex,jdbcType=INTEGER}
AND A.ROW_INDEX = #{rowIndex,jdbcType=INTEGER}
AND A.PERIOD = #{period,jdbcType=INTEGER}
AND A.PROJECT_ID=#{projectId,jdbcType=VARCHAR}
AND B.PROJECT_ID=#{projectId,jdbcType=VARCHAR}
</select>
<select id="getDataType" resultType="java.lang.Integer">
......
......@@ -258,15 +258,17 @@
JOIN
PERIOD_CELL_DATA_SOURCE CDS
ON
DS.ID = CDS.DATA_SOURCE_ID
DS.ID = CDS.DATA_SOURCE_ID AND DS.PROJECT_ID=CDS.PROJECT_ID
JOIN
PERIOD_CELL_DATA CD
ON
CDS.CELL_DATA_ID = CD.ID
AND CDS.PROJECT_ID=CD.PROJECT_ID
JOIN
PERIOD_REPORT RPT
ON
CD.REPORT_ID= RPT.ID
AND CD.PROJECT_ID=RPT.PROJECT_ID
WHERE
CD.REPORT_ID = #{reportID,jdbcType=BIGINT}
......@@ -298,7 +300,7 @@
JOIN
PERIOD_DATA_SOURCE DS
ON
CDS.DATA_SOURCE_ID = DS.ID
CDS.DATA_SOURCE_ID = DS.ID AND CDS.PROJECT_ID = DS.PROJECT_ID
WHERE
DS.TYPE = 10
AND CDS.CELL_DATA_ID = #{cellDataID,jdbcType=BIGINT}
......@@ -332,7 +334,7 @@
JOIN
PERIOD_CELL_DATA_SOURCE CELLDATASOURCE
ON
CELLDATA.ID = CELLDATASOURCE.CELL_DATA_ID
CELLDATA.ID = CELLDATASOURCE.CELL_DATA_ID AND CELLDATA.PROJECT_ID = CELLDATASOURCE.PROJECT_ID
WHERE
CELLDATASOURCE.DATA_SOURCE_ID = #{dataSourceID,jdbcType=BIGINT} LIMIT 1
</select>
......
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