Commit 9e2a6a9a authored by neo.wang's avatar neo.wang

Merge branch 'dev_oracle_neo' into 'dev_oracle'

Dev oracle neo

See merge request root/atms!136
parents 2fe7e9f1 e2447c96
...@@ -4,8 +4,8 @@ import com.fasterxml.jackson.annotation.JsonProperty; ...@@ -4,8 +4,8 @@ import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Getter; import lombok.Getter;
import lombok.Setter; import lombok.Setter;
import pwc.taxtech.atms.dto.CellTemplateConfigDto; import pwc.taxtech.atms.dto.CellTemplateConfigDto;
import pwc.taxtech.atms.vat.entity.ModifiedReportCell;
import pwc.taxtech.atms.vat.entity.PeriodCellTemplateConfig; import pwc.taxtech.atms.vat.entity.PeriodCellTemplateConfig;
import pwc.taxtech.atms.vat.entity.PeriodModifiedReportCell;
import java.util.List; import java.util.List;
...@@ -58,7 +58,7 @@ public class CellCalcInfoDto { ...@@ -58,7 +58,7 @@ public class CellCalcInfoDto {
private Boolean isModified; private Boolean isModified;
//用户直接修改单元格的信息 //用户直接修改单元格的信息
private ModifiedReportCell modifiedReportCell; private PeriodModifiedReportCell modifiedReportCell;
private List<CellVoucherDatasourceDto> dataVoucherList; private List<CellVoucherDatasourceDto> dataVoucherList;
......
...@@ -4,7 +4,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; ...@@ -4,7 +4,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Getter; import lombok.Getter;
import lombok.Setter; import lombok.Setter;
import pwc.taxtech.atms.dto.CellTemplateConfigDto; import pwc.taxtech.atms.dto.CellTemplateConfigDto;
import pwc.taxtech.atms.vat.entity.ModifiedReportCell; import pwc.taxtech.atms.vat.entity.PeriodModifiedReportCell;
import java.util.List; import java.util.List;
...@@ -55,7 +55,7 @@ public class CellDataDto { ...@@ -55,7 +55,7 @@ public class CellDataDto {
private Boolean isModified; private Boolean isModified;
//用户直接修改单元格的信息 //用户直接修改单元格的信息
private ModifiedReportCell modifiedReportCell; private PeriodModifiedReportCell modifiedReportCell;
private List<CellVoucherDatasourceDto> dataVoucherList; private List<CellVoucherDatasourceDto> dataVoucherList;
......
...@@ -69,7 +69,7 @@ public class ReportGeneratorImpl extends VatAbstractService implements ReportGen ...@@ -69,7 +69,7 @@ public class ReportGeneratorImpl extends VatAbstractService implements ReportGen
int period = periodParam != null ? periodParam : 0; int period = periodParam != null ? periodParam : 0;
Project project = projectMapper.selectByPrimaryKey(projectId); Project project = projectMapper.selectByPrimaryKey(projectId);
if(templateIds.isEmpty())templateIds.add(Long.MAX_VALUE); if (templateIds.isEmpty()) templateIds.add(Long.MAX_VALUE);
PeriodTemplateExample periodTemplateExample = new PeriodTemplateExample(); PeriodTemplateExample periodTemplateExample = new PeriodTemplateExample();
periodTemplateExample.createCriteria().andProjectIdEqualTo(projectId).andPeriodEqualTo(period).andIdIn(templateIds); periodTemplateExample.createCriteria().andProjectIdEqualTo(projectId).andPeriodEqualTo(period).andIdIn(templateIds);
...@@ -81,7 +81,7 @@ public class ReportGeneratorImpl extends VatAbstractService implements ReportGen ...@@ -81,7 +81,7 @@ public class ReportGeneratorImpl extends VatAbstractService implements ReportGen
Long templateGroupId = periodTemplateList.size() > 0 ? periodTemplateList.get(0).getTemplateGroupId() : 0; Long templateGroupId = periodTemplateList.size() > 0 ? periodTemplateList.get(0).getTemplateGroupId() : 0;
PeriodCellTemplateExample periodCellTemplateExample = new PeriodCellTemplateExample(); PeriodCellTemplateExample periodCellTemplateExample = new PeriodCellTemplateExample();
if(periodTemplateIdList.isEmpty())periodTemplateIdList.add(Long.MAX_VALUE); if (periodTemplateIdList.isEmpty()) periodTemplateIdList.add(Long.MAX_VALUE);
periodCellTemplateExample.createCriteria().andProjectIdEqualTo(projectId).andReportTemplateIdIn(periodTemplateIdList).andPeriodEqualTo(period); periodCellTemplateExample.createCriteria().andProjectIdEqualTo(projectId).andReportTemplateIdIn(periodTemplateIdList).andPeriodEqualTo(period);
List<PeriodCellTemplate> periodCellTemplateList = periodCellTemplateMapper.selectByExample(periodCellTemplateExample); List<PeriodCellTemplate> periodCellTemplateList = periodCellTemplateMapper.selectByExample(periodCellTemplateExample);
...@@ -401,6 +401,7 @@ public class ReportGeneratorImpl extends VatAbstractService implements ReportGen ...@@ -401,6 +401,7 @@ public class ReportGeneratorImpl extends VatAbstractService implements ReportGen
cellData.setUpdateBy("Admin"); cellData.setUpdateBy("Admin");
cellData.setUpdateTime(createTime); cellData.setUpdateTime(createTime);
cellData.setProjectId(projectId); cellData.setProjectId(projectId);
cellData.setPeriod(period);
periodCellDataMapper.insertSelective(cellData); periodCellDataMapper.insertSelective(cellData);
//after insert celldata, insert the celldatasource for link celldata and datasource //after insert celldata, insert the celldatasource for link celldata and datasource
...@@ -506,7 +507,7 @@ public class ReportGeneratorImpl extends VatAbstractService implements ReportGen ...@@ -506,7 +507,7 @@ public class ReportGeneratorImpl extends VatAbstractService implements ReportGen
workbook.addToolPack(udfToolpack); workbook.addToolPack(udfToolpack);
} }
public List<CellCalcInfoDto> getCellCalcInfo(List<Long> templateIdList, Integer periodParam,String projectId) { public List<CellCalcInfoDto> getCellCalcInfo(List<Long> templateIdList, Integer periodParam, String projectId) {
//already finished by 20180711 //already finished by 20180711
int period = 0; int period = 0;
if (periodParam != null) { if (periodParam != null) {
...@@ -516,7 +517,7 @@ public class ReportGeneratorImpl extends VatAbstractService implements ReportGen ...@@ -516,7 +517,7 @@ public class ReportGeneratorImpl extends VatAbstractService implements ReportGen
List<PeriodCellTemplateConfigExtendDto> periodCellTemplateConfigExtendDtos = List<PeriodCellTemplateConfigExtendDto> periodCellTemplateConfigExtendDtos =
periodCellTemplateConfigMapper.getPeriodCellTemplateConfigExtendDtos(templateIdList, period); periodCellTemplateConfigMapper.getPeriodCellTemplateConfigExtendDtos(templateIdList, period);
fixedPCTParsedFormula(periodCellTemplateConfigExtendDtos,projectId); fixedPCTParsedFormula(periodCellTemplateConfigExtendDtos, projectId, period);
List<CellCalcInfoDto> cellCalcInfoDtos = new ArrayList<>(); List<CellCalcInfoDto> cellCalcInfoDtos = new ArrayList<>();
periodCellTemplateConfigExtendDtos.stream().collect(Collectors.groupingBy(a -> periodCellTemplateConfigExtendDtos.stream().collect(Collectors.groupingBy(a ->
new CellTemplateConfigGroupDto(a.getColumnIndex(), a.getRowIndex() new CellTemplateConfigGroupDto(a.getColumnIndex(), a.getRowIndex()
...@@ -548,7 +549,7 @@ public class ReportGeneratorImpl extends VatAbstractService implements ReportGen ...@@ -548,7 +549,7 @@ public class ReportGeneratorImpl extends VatAbstractService implements ReportGen
return cellCalcInfoDtos; return cellCalcInfoDtos;
} }
private void fixedPCTParsedFormula(List<PeriodCellTemplateConfigExtendDto> periodCellTemplateConfigExtendDtos,String projectId) { private void fixedPCTParsedFormula(List<PeriodCellTemplateConfigExtendDto> periodCellTemplateConfigExtendDtos, String projectId, int period) {
Map<String, List<PCTEntity>> formulaMapToPCT = new HashMap<>(); Map<String, List<PCTEntity>> formulaMapToPCT = new HashMap<>();
Map<PeriodCellTemplateConfig, List<String>> configMapToPCTs = new HashMap<>(); Map<PeriodCellTemplateConfig, List<String>> configMapToPCTs = new HashMap<>();
Set<PCTEntity> parameter = new HashSet<>(); Set<PCTEntity> parameter = new HashSet<>();
...@@ -595,7 +596,7 @@ public class ReportGeneratorImpl extends VatAbstractService implements ReportGen ...@@ -595,7 +596,7 @@ public class ReportGeneratorImpl extends VatAbstractService implements ReportGen
}); });
if (!parameter.isEmpty()) { if (!parameter.isEmpty()) {
List<PCTEntity> pctResults = periodCellDataMapper.queryByPCTs(parameter,projectId); List<PCTEntity> pctResults = periodCellDataMapper.queryByPCTs(parameter, projectId);
Map<PCTEntity, BigDecimal> pctCache = new HashMap<>(); Map<PCTEntity, BigDecimal> pctCache = new HashMap<>();
pctResults.forEach(m -> { pctResults.forEach(m -> {
BigDecimal data = null; BigDecimal data = null;
......
...@@ -620,9 +620,9 @@ public class ReportServiceImpl extends VatAbstractService implements ReportServi ...@@ -620,9 +620,9 @@ public class ReportServiceImpl extends VatAbstractService implements ReportServi
cellDataDtoList.add(cellDataDto); cellDataDtoList.add(cellDataDto);
}); });
ModifiedReportCellExample modifiedReportCellExample = new ModifiedReportCellExample(); PeriodModifiedReportCellExample modifiedReportCellExample = new PeriodModifiedReportCellExample();
modifiedReportCellExample.createCriteria().andReportIdEqualTo(reportId); modifiedReportCellExample.createCriteria().andReportIdEqualTo(reportId);
List<ModifiedReportCell> modifiedReportCellList = modifiedReportCellMapper.selectByExample(modifiedReportCellExample); List<PeriodModifiedReportCell> modifiedReportCellList = periodModifiedReportCellMapper.selectByExample(modifiedReportCellExample);
modifiedReportCellList.forEach(mrc -> { modifiedReportCellList.forEach(mrc -> {
Optional<CellDataDto> cdd = cellDataDtoList.stream() Optional<CellDataDto> cdd = cellDataDtoList.stream()
.filter(cellDataDto -> cellDataDto.getReportId().equals(mrc.getReportId()) .filter(cellDataDto -> cellDataDto.getReportId().equals(mrc.getReportId())
......
...@@ -84,7 +84,7 @@ public class VatAbstractService { ...@@ -84,7 +84,7 @@ public class VatAbstractService {
@Autowired @Autowired
public PeriodCellDataMapper periodCellDataMapper; public PeriodCellDataMapper periodCellDataMapper;
@Autowired @Autowired
public ModifiedReportCellMapper modifiedReportCellMapper; public PeriodModifiedReportCellMapper periodModifiedReportCellMapper;
@Autowired @Autowired
public PeriodCellCommentMapper periodCellCommentMapper; public PeriodCellCommentMapper periodCellCommentMapper;
@Autowired @Autowired
......
package pwc.taxtech.atms.vat.dao;
import java.util.List;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.session.RowBounds;
import pwc.taxtech.atms.MyVatMapper;
import pwc.taxtech.atms.vat.entity.ModifiedReportCell;
import pwc.taxtech.atms.vat.entity.ModifiedReportCellExample;
@Mapper
public interface ModifiedReportCellMapper extends MyVatMapper {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table TAX_PROJECT.MODIFIED_REPORT_CELL
*
* @mbg.generated
*/
long countByExample(ModifiedReportCellExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table TAX_PROJECT.MODIFIED_REPORT_CELL
*
* @mbg.generated
*/
int deleteByExample(ModifiedReportCellExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table TAX_PROJECT.MODIFIED_REPORT_CELL
*
* @mbg.generated
*/
int deleteByPrimaryKey(Long id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table TAX_PROJECT.MODIFIED_REPORT_CELL
*
* @mbg.generated
*/
int insert(ModifiedReportCell record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table TAX_PROJECT.MODIFIED_REPORT_CELL
*
* @mbg.generated
*/
int insertSelective(ModifiedReportCell record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table TAX_PROJECT.MODIFIED_REPORT_CELL
*
* @mbg.generated
*/
List<ModifiedReportCell> selectByExampleWithRowbounds(ModifiedReportCellExample example, RowBounds rowBounds);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table TAX_PROJECT.MODIFIED_REPORT_CELL
*
* @mbg.generated
*/
List<ModifiedReportCell> selectByExample(ModifiedReportCellExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table TAX_PROJECT.MODIFIED_REPORT_CELL
*
* @mbg.generated
*/
ModifiedReportCell selectByPrimaryKey(Long id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table TAX_PROJECT.MODIFIED_REPORT_CELL
*
* @mbg.generated
*/
int updateByExampleSelective(@Param("record") ModifiedReportCell record, @Param("example") ModifiedReportCellExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table TAX_PROJECT.MODIFIED_REPORT_CELL
*
* @mbg.generated
*/
int updateByExample(@Param("record") ModifiedReportCell record, @Param("example") ModifiedReportCellExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table TAX_PROJECT.MODIFIED_REPORT_CELL
*
* @mbg.generated
*/
int updateByPrimaryKeySelective(ModifiedReportCell record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table TAX_PROJECT.MODIFIED_REPORT_CELL
*
* @mbg.generated
*/
int updateByPrimaryKey(ModifiedReportCell record);
}
\ No newline at end of file
package pwc.taxtech.atms.vat.dao; package pwc.taxtech.atms.vat.dao;
import java.util.List;
import java.util.Set;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select; import org.apache.ibatis.annotations.Select;
...@@ -12,6 +9,9 @@ import pwc.taxtech.atms.vat.entity.PCTEntity; ...@@ -12,6 +9,9 @@ import pwc.taxtech.atms.vat.entity.PCTEntity;
import pwc.taxtech.atms.vat.entity.PeriodCellData; import pwc.taxtech.atms.vat.entity.PeriodCellData;
import pwc.taxtech.atms.vat.entity.PeriodCellDataExample; import pwc.taxtech.atms.vat.entity.PeriodCellDataExample;
import java.util.List;
import java.util.Set;
@Mapper @Mapper
public interface PeriodCellDataMapper extends MyVatMapper { public interface PeriodCellDataMapper extends MyVatMapper {
/** /**
...@@ -117,13 +117,13 @@ public interface PeriodCellDataMapper extends MyVatMapper { ...@@ -117,13 +117,13 @@ public interface PeriodCellDataMapper extends MyVatMapper {
" PERIOD_CELL_DATA C, " + " PERIOD_CELL_DATA C, " +
" PERIOD_REPORT R " + " PERIOD_REPORT R " +
"WHERE " + "WHERE " +
" C.REPORT_ID = R.ID AND " + " C.REPORT_ID = R.ID" +
" and C.PROJECT_ID = #{projectId} " + " AND C.PROJECT_ID = #{projectId} AND " +
" " + " " +
" <foreach item=\"item\" index=\"index\" collection=\"list\"" + " <foreach item=\"item\" index=\"index\" collection=\"list\"" +
" open=\"(\" separator=\"OR\" close=\")\">" + " open=\"(\" separator=\"OR\" close=\")\">" +
" ( R.PERIOD=#{item.period} AND C.CELL_TEMPLATE_ID=#{item.cellTemplateId} )" + " ( R.PERIOD=#{item.period} AND C.CELL_TEMPLATE_ID=#{item.cellTemplateId} )" +
" </foreach>" + " </foreach>" +
"</script>") "</script>")
List<PCTEntity> queryByPCTs(@Param("list") Set<PCTEntity> parameter,@Param("projectId") String projectId); List<PCTEntity> queryByPCTs(@Param("list") Set<PCTEntity> parameter, @Param("projectId") String projectId);
} }
\ No newline at end of file
...@@ -91,7 +91,7 @@ ...@@ -91,7 +91,7 @@
A.REPORT_TEMPLATE_ID = B.TEMPLATE_ID A.REPORT_TEMPLATE_ID = B.TEMPLATE_ID
WHERE WHERE
B.CODE = #{code,jdbcType=VARCHAR} B.CODE = #{code,jdbcType=VARCHAR}
AND B.TEMPLATE_GROUP_ID = #{templateGroupID,jdbcType=INTEGER} AND B.TEMPLATE_GROUP_ID = #{templateGroupId,jdbcType=INTEGER}
AND B.PERIOD = #{period,jdbcType=INTEGER} AND B.PERIOD = #{period,jdbcType=INTEGER}
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}
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<update id="updateReportId"> <update id="updateReportId">
UPDATE UPDATE
PERIOD_PERIOD_FORMULA_BLOCK PERIOD_FORMULA_BLOCK
SET SET
REPORT_ID= #{reportId,jdbcType=BIGINT} REPORT_ID= #{reportId,jdbcType=BIGINT}
WHERE WHERE
......
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