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