Commit 37cd797e authored by neo's avatar neo

[dev] add pct entity to entity pacage

parent 97cbf54d
......@@ -10,6 +10,7 @@ import org.apache.ibatis.session.RowBounds;
import pwc.taxtech.atms.MyVatMapper;
import pwc.taxtech.atms.vat.entity.CellData;
import pwc.taxtech.atms.vat.entity.CellDataExample;
import pwc.taxtech.atms.vat.entity.PCTEntity;
import pwc.taxtech.atms.vat.service.impl.ReportGeneratorImpl;
@Mapper
......@@ -124,5 +125,5 @@ public interface CellDataMapper extends MyVatMapper {
" ( r.period=#{item.period} and c.cell_template_id=#{item.cellTemplateId} )" +
" </foreach>" +
"</script>")
List<ReportGeneratorImpl.PCTEntity> queryByPCTs(@Param("list") Set<ReportGeneratorImpl.PCTEntity> parameter);
List<PCTEntity> queryByPCTs(@Param("list") Set<PCTEntity> parameter);
}
\ No newline at end of file
package pwc.taxtech.atms.vat.entity;
import java.math.BigDecimal;
public class PCTEntity {
Integer period;
Long cellTemplateId;
BigDecimal data;
public Integer getPeriod() {
return period;
}
public void setPeriod(Integer period) {
this.period = period;
}
public Long getCellTemplateId() {
return cellTemplateId;
}
public void setCellTemplateId(Long cellTemplateId) {
this.cellTemplateId = cellTemplateId;
}
public BigDecimal getData() {
return data;
}
public void setData(BigDecimal data) {
this.data = data;
}
public PCTEntity(String pctStr) {
String[] pct = pctStr.split(":");
this.period = Integer.parseInt(pct[0]);
this.cellTemplateId = Long.parseLong(pct[1]);
}
@Override
public int hashCode() {
return (period + "" + cellTemplateId).hashCode();
}
@Override
public boolean equals(Object obj) {
PCTEntity target = (PCTEntity) obj;
return period.intValue() == target.period.intValue()
&& cellTemplateId.longValue() == target.cellTemplateId.longValue();
}
}
......@@ -568,7 +568,7 @@ public class ReportGeneratorImpl extends VatAbstractService implements ReportGen
List<PCTEntity> pctResults = cellDataMapper.queryByPCTs(parameter);
Map<PCTEntity, BigDecimal> pctCache = new HashMap<>();
pctResults.forEach(m -> {
pctCache.put(m, m.data);
pctCache.put(m, m.getData());
});
configMapToPCTs.forEach((k, v) -> {
......@@ -600,27 +600,5 @@ public class ReportGeneratorImpl extends VatAbstractService implements ReportGen
return stringBuilder.toString();
}
public static class PCTEntity {
Integer period;
Long cellTemplateId;
BigDecimal data;
public PCTEntity(String pctStr) {
String[] pct = pctStr.split(":");
this.period = Integer.parseInt(pct[0]);
this.cellTemplateId = Long.parseLong(pct[1]);
}
@Override
public int hashCode() {
return (period + "" + cellTemplateId).hashCode();
}
@Override
public boolean equals(Object obj) {
PCTEntity target = (PCTEntity) obj;
return period.intValue() == target.period.intValue()
&& cellTemplateId.longValue() == target.cellTemplateId.longValue();
}
}
}
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