Commit b3ec20cc authored by frank.xa.zhang's avatar frank.xa.zhang

add new api for report generate with work flow and data save

parent 444ed5a1
......@@ -297,10 +297,7 @@
<columnOverride column="Path" javaType="java.lang.String" jdbcType="VARCHAR"/>
</table>
<table tableName="Report" domainObjectName="Report">
<property name="useActualColumnNames" value="true" />
<property name="ignoreQualifiersAtRuntime" value="true"/>
</table>
<table tableName="StandardAccount" domainObjectName="VatStandardAccount">
<property name="useActualColumnNames" value="true" />
......@@ -376,5 +373,8 @@
<columnOverride column="is_system_type" javaType="java.lang.Boolean"/>
<columnOverride column="is_active_association" javaType="java.lang.Boolean"/>
</table>
<table tableName="report" domainObjectName="Report">
<property name="ignoreQualifiersAtRuntime" value="true"/>
</table>
</context>
</generatorConfiguration>
\ No newline at end of file
rem see http://www.mybatis.org/generator/running/runningFromCmdLine.html
cd /d %~dp0
call java -classpath .;./* org.mybatis.generator.api.ShellRunner -configfile vatGeneratorConfig.xml -overwrite -verbose -tables period_cell_template_config
call java -classpath .;./* org.mybatis.generator.api.ShellRunner -configfile vatGeneratorConfig.xml -overwrite -verbose -tables cell_data
echo @@@@@@@@@@@ DONE @@@@@@@@@@@
pause
......@@ -2,14 +2,18 @@ package pwc.taxtech.atms.common;
import org.apache.commons.lang3.StringUtils;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
import org.apache.poi.ss.usermodel.*;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.List;
import java.util.Map;
import java.util.Optional;
public class POIUtil {
......@@ -42,7 +46,7 @@ public class POIUtil {
Row targetRow = targetSheet.createRow(r);
for (int c = row.getFirstCellNum(); c <= row.getLastCellNum(); c++) {
Cell cell = row.getCell(c);
if (null == cell){
if (null == cell) {
continue;
}
Cell targetCell = targetRow.createCell(c);
......
......@@ -25,4 +25,9 @@ public class ReportController {
public OperationResultDto updateConfig(@PathVariable String projectId, @PathVariable Integer period, @RequestParam String generator) {
return reportService.updateConfig(projectId, period, generator);
}
@RequestMapping(value = "generateByTotal/{projectId}/{ifDeleteManualDataSource}/{period}",method = RequestMethod.POST,produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public OperationResultDto generateAllData(@PathVariable String projectId,@PathVariable Boolean ifDeleteManualDataSource,@PathVariable Integer period,@RequestParam String generator){
return reportService.generateData(projectId,EnumServiceType.VAT,ifDeleteManualDataSource,period,null,generator);
}
}
......@@ -12,7 +12,7 @@ import pwc.taxtech.atms.vat.entity.ReportExample;
public interface ReportMapper extends MyVatMapper {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table Report
* This method corresponds to the database table report
*
* @mbg.generated
*/
......@@ -20,7 +20,7 @@ public interface ReportMapper extends MyVatMapper {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table Report
* This method corresponds to the database table report
*
* @mbg.generated
*/
......@@ -28,15 +28,15 @@ public interface ReportMapper extends MyVatMapper {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table Report
* This method corresponds to the database table report
*
* @mbg.generated
*/
int deleteByPrimaryKey(String ID);
int deleteByPrimaryKey(Long id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table Report
* This method corresponds to the database table report
*
* @mbg.generated
*/
......@@ -44,7 +44,7 @@ public interface ReportMapper extends MyVatMapper {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table Report
* This method corresponds to the database table report
*
* @mbg.generated
*/
......@@ -52,7 +52,7 @@ public interface ReportMapper extends MyVatMapper {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table Report
* This method corresponds to the database table report
*
* @mbg.generated
*/
......@@ -60,7 +60,7 @@ public interface ReportMapper extends MyVatMapper {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table Report
* This method corresponds to the database table report
*
* @mbg.generated
*/
......@@ -68,15 +68,15 @@ public interface ReportMapper extends MyVatMapper {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table Report
* This method corresponds to the database table report
*
* @mbg.generated
*/
Report selectByPrimaryKey(String ID);
Report selectByPrimaryKey(Long id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table Report
* This method corresponds to the database table report
*
* @mbg.generated
*/
......@@ -84,7 +84,7 @@ public interface ReportMapper extends MyVatMapper {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table Report
* This method corresponds to the database table report
*
* @mbg.generated
*/
......@@ -92,7 +92,7 @@ public interface ReportMapper extends MyVatMapper {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table Report
* This method corresponds to the database table report
*
* @mbg.generated
*/
......@@ -100,7 +100,7 @@ public interface ReportMapper extends MyVatMapper {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table Report
* This method corresponds to the database table report
*
* @mbg.generated
*/
......
......@@ -27,7 +27,7 @@ public class CellData implements Serializable {
*
* @mbg.generated
*/
private String reportId;
private Long reportId;
/**
*
......@@ -36,7 +36,7 @@ public class CellData implements Serializable {
*
* @mbg.generated
*/
private String cellTemplateId;
private Long cellTemplateId;
/**
*
......@@ -132,7 +132,7 @@ public class CellData implements Serializable {
*
* @mbg.generated
*/
public String getReportId() {
public Long getReportId() {
return reportId;
}
......@@ -144,8 +144,8 @@ public class CellData implements Serializable {
*
* @mbg.generated
*/
public void setReportId(String reportId) {
this.reportId = reportId == null ? null : reportId.trim();
public void setReportId(Long reportId) {
this.reportId = reportId;
}
/**
......@@ -156,7 +156,7 @@ public class CellData implements Serializable {
*
* @mbg.generated
*/
public String getCellTemplateId() {
public Long getCellTemplateId() {
return cellTemplateId;
}
......@@ -168,8 +168,8 @@ public class CellData implements Serializable {
*
* @mbg.generated
*/
public void setCellTemplateId(String cellTemplateId) {
this.cellTemplateId = cellTemplateId == null ? null : cellTemplateId.trim();
public void setCellTemplateId(Long cellTemplateId) {
this.cellTemplateId = cellTemplateId;
}
/**
......
......@@ -265,62 +265,52 @@ public class CellDataExample {
return (Criteria) this;
}
public Criteria andReportIdEqualTo(String value) {
public Criteria andReportIdEqualTo(Long value) {
addCriterion("report_id =", value, "reportId");
return (Criteria) this;
}
public Criteria andReportIdNotEqualTo(String value) {
public Criteria andReportIdNotEqualTo(Long value) {
addCriterion("report_id <>", value, "reportId");
return (Criteria) this;
}
public Criteria andReportIdGreaterThan(String value) {
public Criteria andReportIdGreaterThan(Long value) {
addCriterion("report_id >", value, "reportId");
return (Criteria) this;
}
public Criteria andReportIdGreaterThanOrEqualTo(String value) {
public Criteria andReportIdGreaterThanOrEqualTo(Long value) {
addCriterion("report_id >=", value, "reportId");
return (Criteria) this;
}
public Criteria andReportIdLessThan(String value) {
public Criteria andReportIdLessThan(Long value) {
addCriterion("report_id <", value, "reportId");
return (Criteria) this;
}
public Criteria andReportIdLessThanOrEqualTo(String value) {
public Criteria andReportIdLessThanOrEqualTo(Long value) {
addCriterion("report_id <=", value, "reportId");
return (Criteria) this;
}
public Criteria andReportIdLike(String value) {
addCriterion("report_id like", value, "reportId");
return (Criteria) this;
}
public Criteria andReportIdNotLike(String value) {
addCriterion("report_id not like", value, "reportId");
return (Criteria) this;
}
public Criteria andReportIdIn(List<String> values) {
public Criteria andReportIdIn(List<Long> values) {
addCriterion("report_id in", values, "reportId");
return (Criteria) this;
}
public Criteria andReportIdNotIn(List<String> values) {
public Criteria andReportIdNotIn(List<Long> values) {
addCriterion("report_id not in", values, "reportId");
return (Criteria) this;
}
public Criteria andReportIdBetween(String value1, String value2) {
public Criteria andReportIdBetween(Long value1, Long value2) {
addCriterion("report_id between", value1, value2, "reportId");
return (Criteria) this;
}
public Criteria andReportIdNotBetween(String value1, String value2) {
public Criteria andReportIdNotBetween(Long value1, Long value2) {
addCriterion("report_id not between", value1, value2, "reportId");
return (Criteria) this;
}
......@@ -335,62 +325,52 @@ public class CellDataExample {
return (Criteria) this;
}
public Criteria andCellTemplateIdEqualTo(String value) {
public Criteria andCellTemplateIdEqualTo(Long value) {
addCriterion("cell_template_id =", value, "cellTemplateId");
return (Criteria) this;
}
public Criteria andCellTemplateIdNotEqualTo(String value) {
public Criteria andCellTemplateIdNotEqualTo(Long value) {
addCriterion("cell_template_id <>", value, "cellTemplateId");
return (Criteria) this;
}
public Criteria andCellTemplateIdGreaterThan(String value) {
public Criteria andCellTemplateIdGreaterThan(Long value) {
addCriterion("cell_template_id >", value, "cellTemplateId");
return (Criteria) this;
}
public Criteria andCellTemplateIdGreaterThanOrEqualTo(String value) {
public Criteria andCellTemplateIdGreaterThanOrEqualTo(Long value) {
addCriterion("cell_template_id >=", value, "cellTemplateId");
return (Criteria) this;
}
public Criteria andCellTemplateIdLessThan(String value) {
public Criteria andCellTemplateIdLessThan(Long value) {
addCriterion("cell_template_id <", value, "cellTemplateId");
return (Criteria) this;
}
public Criteria andCellTemplateIdLessThanOrEqualTo(String value) {
public Criteria andCellTemplateIdLessThanOrEqualTo(Long value) {
addCriterion("cell_template_id <=", value, "cellTemplateId");
return (Criteria) this;
}
public Criteria andCellTemplateIdLike(String value) {
addCriterion("cell_template_id like", value, "cellTemplateId");
return (Criteria) this;
}
public Criteria andCellTemplateIdNotLike(String value) {
addCriterion("cell_template_id not like", value, "cellTemplateId");
return (Criteria) this;
}
public Criteria andCellTemplateIdIn(List<String> values) {
public Criteria andCellTemplateIdIn(List<Long> values) {
addCriterion("cell_template_id in", values, "cellTemplateId");
return (Criteria) this;
}
public Criteria andCellTemplateIdNotIn(List<String> values) {
public Criteria andCellTemplateIdNotIn(List<Long> values) {
addCriterion("cell_template_id not in", values, "cellTemplateId");
return (Criteria) this;
}
public Criteria andCellTemplateIdBetween(String value1, String value2) {
public Criteria andCellTemplateIdBetween(Long value1, Long value2) {
addCriterion("cell_template_id between", value1, value2, "cellTemplateId");
return (Criteria) this;
}
public Criteria andCellTemplateIdNotBetween(String value1, String value2) {
public Criteria andCellTemplateIdNotBetween(Long value1, Long value2) {
addCriterion("cell_template_id not between", value1, value2, "cellTemplateId");
return (Criteria) this;
}
......
......@@ -6,7 +6,7 @@ import java.util.Date;
/**
*
* This class was generated by MyBatis Generator.
* This class corresponds to the database table Report
* This class corresponds to the database table report
*
* @mbg.generated do_not_delete_during_merge
*/
......@@ -14,25 +14,25 @@ public class Report implements Serializable {
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column Report.ID
* This field corresponds to the database column report.id
*
* @mbg.generated
*/
private String ID;
private Long id;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column Report.TemplateID
* This field corresponds to the database column report.template_id
*
* @mbg.generated
*/
private String templateID;
private Long templateId;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column Report.Period
* This field corresponds to the database column report.period
*
* @mbg.generated
*/
......@@ -41,25 +41,25 @@ public class Report implements Serializable {
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column Report.ProjectID
* This field corresponds to the database column report.project_id
*
* @mbg.generated
*/
private String projectID;
private String projectId;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column Report.Creator
* This field corresponds to the database column report.create_by
*
* @mbg.generated
*/
private String creator;
private String createBy;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column Report.CreateTime
* This field corresponds to the database column report.create_time
*
* @mbg.generated
*/
......@@ -68,16 +68,16 @@ public class Report implements Serializable {
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column Report.Updater
* This field corresponds to the database column report.update_by
*
* @mbg.generated
*/
private String updater;
private String updateBy;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column Report.UpdateTime
* This field corresponds to the database column report.update_time
*
* @mbg.generated
*/
......@@ -85,7 +85,7 @@ public class Report implements Serializable {
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table Report
* This field corresponds to the database table report
*
* @mbg.generated
*/
......@@ -93,57 +93,57 @@ public class Report implements Serializable {
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column Report.ID
* This method returns the value of the database column report.id
*
* @return the value of Report.ID
* @return the value of report.id
*
* @mbg.generated
*/
public String getID() {
return ID;
public Long getId() {
return id;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column Report.ID
* This method sets the value of the database column report.id
*
* @param ID the value for Report.ID
* @param id the value for report.id
*
* @mbg.generated
*/
public void setID(String ID) {
this.ID = ID == null ? null : ID.trim();
public void setId(Long id) {
this.id = id;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column Report.TemplateID
* This method returns the value of the database column report.template_id
*
* @return the value of Report.TemplateID
* @return the value of report.template_id
*
* @mbg.generated
*/
public String getTemplateID() {
return templateID;
public Long getTemplateId() {
return templateId;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column Report.TemplateID
* This method sets the value of the database column report.template_id
*
* @param templateID the value for Report.TemplateID
* @param templateId the value for report.template_id
*
* @mbg.generated
*/
public void setTemplateID(String templateID) {
this.templateID = templateID == null ? null : templateID.trim();
public void setTemplateId(Long templateId) {
this.templateId = templateId;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column Report.Period
* This method returns the value of the database column report.period
*
* @return the value of Report.Period
* @return the value of report.period
*
* @mbg.generated
*/
......@@ -153,9 +153,9 @@ public class Report implements Serializable {
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column Report.Period
* This method sets the value of the database column report.period
*
* @param period the value for Report.Period
* @param period the value for report.period
*
* @mbg.generated
*/
......@@ -165,57 +165,57 @@ public class Report implements Serializable {
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column Report.ProjectID
* This method returns the value of the database column report.project_id
*
* @return the value of Report.ProjectID
* @return the value of report.project_id
*
* @mbg.generated
*/
public String getProjectID() {
return projectID;
public String getProjectId() {
return projectId;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column Report.ProjectID
* This method sets the value of the database column report.project_id
*
* @param projectID the value for Report.ProjectID
* @param projectId the value for report.project_id
*
* @mbg.generated
*/
public void setProjectID(String projectID) {
this.projectID = projectID == null ? null : projectID.trim();
public void setProjectId(String projectId) {
this.projectId = projectId == null ? null : projectId.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column Report.Creator
* This method returns the value of the database column report.create_by
*
* @return the value of Report.Creator
* @return the value of report.create_by
*
* @mbg.generated
*/
public String getCreator() {
return creator;
public String getCreateBy() {
return createBy;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column Report.Creator
* This method sets the value of the database column report.create_by
*
* @param creator the value for Report.Creator
* @param createBy the value for report.create_by
*
* @mbg.generated
*/
public void setCreator(String creator) {
this.creator = creator == null ? null : creator.trim();
public void setCreateBy(String createBy) {
this.createBy = createBy == null ? null : createBy.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column Report.CreateTime
* This method returns the value of the database column report.create_time
*
* @return the value of Report.CreateTime
* @return the value of report.create_time
*
* @mbg.generated
*/
......@@ -225,9 +225,9 @@ public class Report implements Serializable {
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column Report.CreateTime
* This method sets the value of the database column report.create_time
*
* @param createTime the value for Report.CreateTime
* @param createTime the value for report.create_time
*
* @mbg.generated
*/
......@@ -237,33 +237,33 @@ public class Report implements Serializable {
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column Report.Updater
* This method returns the value of the database column report.update_by
*
* @return the value of Report.Updater
* @return the value of report.update_by
*
* @mbg.generated
*/
public String getUpdater() {
return updater;
public String getUpdateBy() {
return updateBy;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column Report.Updater
* This method sets the value of the database column report.update_by
*
* @param updater the value for Report.Updater
* @param updateBy the value for report.update_by
*
* @mbg.generated
*/
public void setUpdater(String updater) {
this.updater = updater == null ? null : updater.trim();
public void setUpdateBy(String updateBy) {
this.updateBy = updateBy == null ? null : updateBy.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column Report.UpdateTime
* This method returns the value of the database column report.update_time
*
* @return the value of Report.UpdateTime
* @return the value of report.update_time
*
* @mbg.generated
*/
......@@ -273,9 +273,9 @@ public class Report implements Serializable {
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column Report.UpdateTime
* This method sets the value of the database column report.update_time
*
* @param updateTime the value for Report.UpdateTime
* @param updateTime the value for report.update_time
*
* @mbg.generated
*/
......@@ -285,7 +285,7 @@ public class Report implements Serializable {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table Report
* This method corresponds to the database table report
*
* @mbg.generated
*/
......@@ -295,13 +295,13 @@ public class Report implements Serializable {
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", ID=").append(ID);
sb.append(", templateID=").append(templateID);
sb.append(", id=").append(id);
sb.append(", templateId=").append(templateId);
sb.append(", period=").append(period);
sb.append(", projectID=").append(projectID);
sb.append(", creator=").append(creator);
sb.append(", projectId=").append(projectId);
sb.append(", createBy=").append(createBy);
sb.append(", createTime=").append(createTime);
sb.append(", updater=").append(updater);
sb.append(", updateBy=").append(updateBy);
sb.append(", updateTime=").append(updateTime);
sb.append("]");
return sb.toString();
......
......@@ -7,7 +7,7 @@ import java.util.List;
public class ReportExample {
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table Report
* This field corresponds to the database table report
*
* @mbg.generated
*/
......@@ -15,7 +15,7 @@ public class ReportExample {
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table Report
* This field corresponds to the database table report
*
* @mbg.generated
*/
......@@ -23,7 +23,7 @@ public class ReportExample {
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table Report
* This field corresponds to the database table report
*
* @mbg.generated
*/
......@@ -31,7 +31,7 @@ public class ReportExample {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table Report
* This method corresponds to the database table report
*
* @mbg.generated
*/
......@@ -41,7 +41,7 @@ public class ReportExample {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table Report
* This method corresponds to the database table report
*
* @mbg.generated
*/
......@@ -51,7 +51,7 @@ public class ReportExample {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table Report
* This method corresponds to the database table report
*
* @mbg.generated
*/
......@@ -61,7 +61,7 @@ public class ReportExample {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table Report
* This method corresponds to the database table report
*
* @mbg.generated
*/
......@@ -71,7 +71,7 @@ public class ReportExample {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table Report
* This method corresponds to the database table report
*
* @mbg.generated
*/
......@@ -81,7 +81,7 @@ public class ReportExample {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table Report
* This method corresponds to the database table report
*
* @mbg.generated
*/
......@@ -91,7 +91,7 @@ public class ReportExample {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table Report
* This method corresponds to the database table report
*
* @mbg.generated
*/
......@@ -101,7 +101,7 @@ public class ReportExample {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table Report
* This method corresponds to the database table report
*
* @mbg.generated
*/
......@@ -113,7 +113,7 @@ public class ReportExample {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table Report
* This method corresponds to the database table report
*
* @mbg.generated
*/
......@@ -127,7 +127,7 @@ public class ReportExample {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table Report
* This method corresponds to the database table report
*
* @mbg.generated
*/
......@@ -138,7 +138,7 @@ public class ReportExample {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table Report
* This method corresponds to the database table report
*
* @mbg.generated
*/
......@@ -150,7 +150,7 @@ public class ReportExample {
/**
* This class was generated by MyBatis Generator.
* This class corresponds to the database table Report
* This class corresponds to the database table report
*
* @mbg.generated
*/
......@@ -195,540 +195,520 @@ public class ReportExample {
criteria.add(new Criterion(condition, value1, value2));
}
public Criteria andIDIsNull() {
addCriterion("ID is null");
public Criteria andIdIsNull() {
addCriterion("id is null");
return (Criteria) this;
}
public Criteria andIDIsNotNull() {
addCriterion("ID is not null");
public Criteria andIdIsNotNull() {
addCriterion("id is not null");
return (Criteria) this;
}
public Criteria andIDEqualTo(String value) {
addCriterion("ID =", value, "ID");
public Criteria andIdEqualTo(Long value) {
addCriterion("id =", value, "id");
return (Criteria) this;
}
public Criteria andIDNotEqualTo(String value) {
addCriterion("ID <>", value, "ID");
public Criteria andIdNotEqualTo(Long value) {
addCriterion("id <>", value, "id");
return (Criteria) this;
}
public Criteria andIDGreaterThan(String value) {
addCriterion("ID >", value, "ID");
public Criteria andIdGreaterThan(Long value) {
addCriterion("id >", value, "id");
return (Criteria) this;
}
public Criteria andIDGreaterThanOrEqualTo(String value) {
addCriterion("ID >=", value, "ID");
public Criteria andIdGreaterThanOrEqualTo(Long value) {
addCriterion("id >=", value, "id");
return (Criteria) this;
}
public Criteria andIDLessThan(String value) {
addCriterion("ID <", value, "ID");
public Criteria andIdLessThan(Long value) {
addCriterion("id <", value, "id");
return (Criteria) this;
}
public Criteria andIDLessThanOrEqualTo(String value) {
addCriterion("ID <=", value, "ID");
public Criteria andIdLessThanOrEqualTo(Long value) {
addCriterion("id <=", value, "id");
return (Criteria) this;
}
public Criteria andIDLike(String value) {
addCriterion("ID like", value, "ID");
public Criteria andIdIn(List<Long> values) {
addCriterion("id in", values, "id");
return (Criteria) this;
}
public Criteria andIDNotLike(String value) {
addCriterion("ID not like", value, "ID");
public Criteria andIdNotIn(List<Long> values) {
addCriterion("id not in", values, "id");
return (Criteria) this;
}
public Criteria andIDIn(List<String> values) {
addCriterion("ID in", values, "ID");
public Criteria andIdBetween(Long value1, Long value2) {
addCriterion("id between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andIDNotIn(List<String> values) {
addCriterion("ID not in", values, "ID");
public Criteria andIdNotBetween(Long value1, Long value2) {
addCriterion("id not between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andIDBetween(String value1, String value2) {
addCriterion("ID between", value1, value2, "ID");
public Criteria andTemplateIdIsNull() {
addCriterion("template_id is null");
return (Criteria) this;
}
public Criteria andIDNotBetween(String value1, String value2) {
addCriterion("ID not between", value1, value2, "ID");
public Criteria andTemplateIdIsNotNull() {
addCriterion("template_id is not null");
return (Criteria) this;
}
public Criteria andTemplateIDIsNull() {
addCriterion("TemplateID is null");
public Criteria andTemplateIdEqualTo(Long value) {
addCriterion("template_id =", value, "templateId");
return (Criteria) this;
}
public Criteria andTemplateIDIsNotNull() {
addCriterion("TemplateID is not null");
public Criteria andTemplateIdNotEqualTo(Long value) {
addCriterion("template_id <>", value, "templateId");
return (Criteria) this;
}
public Criteria andTemplateIDEqualTo(String value) {
addCriterion("TemplateID =", value, "templateID");
public Criteria andTemplateIdGreaterThan(Long value) {
addCriterion("template_id >", value, "templateId");
return (Criteria) this;
}
public Criteria andTemplateIDNotEqualTo(String value) {
addCriterion("TemplateID <>", value, "templateID");
public Criteria andTemplateIdGreaterThanOrEqualTo(Long value) {
addCriterion("template_id >=", value, "templateId");
return (Criteria) this;
}
public Criteria andTemplateIDGreaterThan(String value) {
addCriterion("TemplateID >", value, "templateID");
public Criteria andTemplateIdLessThan(Long value) {
addCriterion("template_id <", value, "templateId");
return (Criteria) this;
}
public Criteria andTemplateIDGreaterThanOrEqualTo(String value) {
addCriterion("TemplateID >=", value, "templateID");
public Criteria andTemplateIdLessThanOrEqualTo(Long value) {
addCriterion("template_id <=", value, "templateId");
return (Criteria) this;
}
public Criteria andTemplateIDLessThan(String value) {
addCriterion("TemplateID <", value, "templateID");
public Criteria andTemplateIdIn(List<Long> values) {
addCriterion("template_id in", values, "templateId");
return (Criteria) this;
}
public Criteria andTemplateIDLessThanOrEqualTo(String value) {
addCriterion("TemplateID <=", value, "templateID");
public Criteria andTemplateIdNotIn(List<Long> values) {
addCriterion("template_id not in", values, "templateId");
return (Criteria) this;
}
public Criteria andTemplateIDLike(String value) {
addCriterion("TemplateID like", value, "templateID");
public Criteria andTemplateIdBetween(Long value1, Long value2) {
addCriterion("template_id between", value1, value2, "templateId");
return (Criteria) this;
}
public Criteria andTemplateIDNotLike(String value) {
addCriterion("TemplateID not like", value, "templateID");
return (Criteria) this;
}
public Criteria andTemplateIDIn(List<String> values) {
addCriterion("TemplateID in", values, "templateID");
return (Criteria) this;
}
public Criteria andTemplateIDNotIn(List<String> values) {
addCriterion("TemplateID not in", values, "templateID");
return (Criteria) this;
}
public Criteria andTemplateIDBetween(String value1, String value2) {
addCriterion("TemplateID between", value1, value2, "templateID");
return (Criteria) this;
}
public Criteria andTemplateIDNotBetween(String value1, String value2) {
addCriterion("TemplateID not between", value1, value2, "templateID");
public Criteria andTemplateIdNotBetween(Long value1, Long value2) {
addCriterion("template_id not between", value1, value2, "templateId");
return (Criteria) this;
}
public Criteria andPeriodIsNull() {
addCriterion("Period is null");
addCriterion("period is null");
return (Criteria) this;
}
public Criteria andPeriodIsNotNull() {
addCriterion("Period is not null");
addCriterion("period is not null");
return (Criteria) this;
}
public Criteria andPeriodEqualTo(Integer value) {
addCriterion("Period =", value, "period");
addCriterion("period =", value, "period");
return (Criteria) this;
}
public Criteria andPeriodNotEqualTo(Integer value) {
addCriterion("Period <>", value, "period");
addCriterion("period <>", value, "period");
return (Criteria) this;
}
public Criteria andPeriodGreaterThan(Integer value) {
addCriterion("Period >", value, "period");
addCriterion("period >", value, "period");
return (Criteria) this;
}
public Criteria andPeriodGreaterThanOrEqualTo(Integer value) {
addCriterion("Period >=", value, "period");
addCriterion("period >=", value, "period");
return (Criteria) this;
}
public Criteria andPeriodLessThan(Integer value) {
addCriterion("Period <", value, "period");
addCriterion("period <", value, "period");
return (Criteria) this;
}
public Criteria andPeriodLessThanOrEqualTo(Integer value) {
addCriterion("Period <=", value, "period");
addCriterion("period <=", value, "period");
return (Criteria) this;
}
public Criteria andPeriodIn(List<Integer> values) {
addCriterion("Period in", values, "period");
addCriterion("period in", values, "period");
return (Criteria) this;
}
public Criteria andPeriodNotIn(List<Integer> values) {
addCriterion("Period not in", values, "period");
addCriterion("period not in", values, "period");
return (Criteria) this;
}
public Criteria andPeriodBetween(Integer value1, Integer value2) {
addCriterion("Period between", value1, value2, "period");
addCriterion("period between", value1, value2, "period");
return (Criteria) this;
}
public Criteria andPeriodNotBetween(Integer value1, Integer value2) {
addCriterion("Period not between", value1, value2, "period");
addCriterion("period not between", value1, value2, "period");
return (Criteria) this;
}
public Criteria andProjectIDIsNull() {
addCriterion("ProjectID is null");
public Criteria andProjectIdIsNull() {
addCriterion("project_id is null");
return (Criteria) this;
}
public Criteria andProjectIDIsNotNull() {
addCriterion("ProjectID is not null");
public Criteria andProjectIdIsNotNull() {
addCriterion("project_id is not null");
return (Criteria) this;
}
public Criteria andProjectIDEqualTo(String value) {
addCriterion("ProjectID =", value, "projectID");
public Criteria andProjectIdEqualTo(String value) {
addCriterion("project_id =", value, "projectId");
return (Criteria) this;
}
public Criteria andProjectIDNotEqualTo(String value) {
addCriterion("ProjectID <>", value, "projectID");
public Criteria andProjectIdNotEqualTo(String value) {
addCriterion("project_id <>", value, "projectId");
return (Criteria) this;
}
public Criteria andProjectIDGreaterThan(String value) {
addCriterion("ProjectID >", value, "projectID");
public Criteria andProjectIdGreaterThan(String value) {
addCriterion("project_id >", value, "projectId");
return (Criteria) this;
}
public Criteria andProjectIDGreaterThanOrEqualTo(String value) {
addCriterion("ProjectID >=", value, "projectID");
public Criteria andProjectIdGreaterThanOrEqualTo(String value) {
addCriterion("project_id >=", value, "projectId");
return (Criteria) this;
}
public Criteria andProjectIDLessThan(String value) {
addCriterion("ProjectID <", value, "projectID");
public Criteria andProjectIdLessThan(String value) {
addCriterion("project_id <", value, "projectId");
return (Criteria) this;
}
public Criteria andProjectIDLessThanOrEqualTo(String value) {
addCriterion("ProjectID <=", value, "projectID");
public Criteria andProjectIdLessThanOrEqualTo(String value) {
addCriterion("project_id <=", value, "projectId");
return (Criteria) this;
}
public Criteria andProjectIDLike(String value) {
addCriterion("ProjectID like", value, "projectID");
public Criteria andProjectIdLike(String value) {
addCriterion("project_id like", value, "projectId");
return (Criteria) this;
}
public Criteria andProjectIDNotLike(String value) {
addCriterion("ProjectID not like", value, "projectID");
public Criteria andProjectIdNotLike(String value) {
addCriterion("project_id not like", value, "projectId");
return (Criteria) this;
}
public Criteria andProjectIDIn(List<String> values) {
addCriterion("ProjectID in", values, "projectID");
public Criteria andProjectIdIn(List<String> values) {
addCriterion("project_id in", values, "projectId");
return (Criteria) this;
}
public Criteria andProjectIDNotIn(List<String> values) {
addCriterion("ProjectID not in", values, "projectID");
public Criteria andProjectIdNotIn(List<String> values) {
addCriterion("project_id not in", values, "projectId");
return (Criteria) this;
}
public Criteria andProjectIDBetween(String value1, String value2) {
addCriterion("ProjectID between", value1, value2, "projectID");
public Criteria andProjectIdBetween(String value1, String value2) {
addCriterion("project_id between", value1, value2, "projectId");
return (Criteria) this;
}
public Criteria andProjectIDNotBetween(String value1, String value2) {
addCriterion("ProjectID not between", value1, value2, "projectID");
public Criteria andProjectIdNotBetween(String value1, String value2) {
addCriterion("project_id not between", value1, value2, "projectId");
return (Criteria) this;
}
public Criteria andCreatorIsNull() {
addCriterion("Creator is null");
public Criteria andCreateByIsNull() {
addCriterion("create_by is null");
return (Criteria) this;
}
public Criteria andCreatorIsNotNull() {
addCriterion("Creator is not null");
public Criteria andCreateByIsNotNull() {
addCriterion("create_by is not null");
return (Criteria) this;
}
public Criteria andCreatorEqualTo(String value) {
addCriterion("Creator =", value, "creator");
public Criteria andCreateByEqualTo(String value) {
addCriterion("create_by =", value, "createBy");
return (Criteria) this;
}
public Criteria andCreatorNotEqualTo(String value) {
addCriterion("Creator <>", value, "creator");
public Criteria andCreateByNotEqualTo(String value) {
addCriterion("create_by <>", value, "createBy");
return (Criteria) this;
}
public Criteria andCreatorGreaterThan(String value) {
addCriterion("Creator >", value, "creator");
public Criteria andCreateByGreaterThan(String value) {
addCriterion("create_by >", value, "createBy");
return (Criteria) this;
}
public Criteria andCreatorGreaterThanOrEqualTo(String value) {
addCriterion("Creator >=", value, "creator");
public Criteria andCreateByGreaterThanOrEqualTo(String value) {
addCriterion("create_by >=", value, "createBy");
return (Criteria) this;
}
public Criteria andCreatorLessThan(String value) {
addCriterion("Creator <", value, "creator");
public Criteria andCreateByLessThan(String value) {
addCriterion("create_by <", value, "createBy");
return (Criteria) this;
}
public Criteria andCreatorLessThanOrEqualTo(String value) {
addCriterion("Creator <=", value, "creator");
public Criteria andCreateByLessThanOrEqualTo(String value) {
addCriterion("create_by <=", value, "createBy");
return (Criteria) this;
}
public Criteria andCreatorLike(String value) {
addCriterion("Creator like", value, "creator");
public Criteria andCreateByLike(String value) {
addCriterion("create_by like", value, "createBy");
return (Criteria) this;
}
public Criteria andCreatorNotLike(String value) {
addCriterion("Creator not like", value, "creator");
public Criteria andCreateByNotLike(String value) {
addCriterion("create_by not like", value, "createBy");
return (Criteria) this;
}
public Criteria andCreatorIn(List<String> values) {
addCriterion("Creator in", values, "creator");
public Criteria andCreateByIn(List<String> values) {
addCriterion("create_by in", values, "createBy");
return (Criteria) this;
}
public Criteria andCreatorNotIn(List<String> values) {
addCriterion("Creator not in", values, "creator");
public Criteria andCreateByNotIn(List<String> values) {
addCriterion("create_by not in", values, "createBy");
return (Criteria) this;
}
public Criteria andCreatorBetween(String value1, String value2) {
addCriterion("Creator between", value1, value2, "creator");
public Criteria andCreateByBetween(String value1, String value2) {
addCriterion("create_by between", value1, value2, "createBy");
return (Criteria) this;
}
public Criteria andCreatorNotBetween(String value1, String value2) {
addCriterion("Creator not between", value1, value2, "creator");
public Criteria andCreateByNotBetween(String value1, String value2) {
addCriterion("create_by not between", value1, value2, "createBy");
return (Criteria) this;
}
public Criteria andCreateTimeIsNull() {
addCriterion("CreateTime is null");
addCriterion("create_time is null");
return (Criteria) this;
}
public Criteria andCreateTimeIsNotNull() {
addCriterion("CreateTime is not null");
addCriterion("create_time is not null");
return (Criteria) this;
}
public Criteria andCreateTimeEqualTo(Date value) {
addCriterion("CreateTime =", value, "createTime");
addCriterion("create_time =", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeNotEqualTo(Date value) {
addCriterion("CreateTime <>", value, "createTime");
addCriterion("create_time <>", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeGreaterThan(Date value) {
addCriterion("CreateTime >", value, "createTime");
addCriterion("create_time >", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeGreaterThanOrEqualTo(Date value) {
addCriterion("CreateTime >=", value, "createTime");
addCriterion("create_time >=", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeLessThan(Date value) {
addCriterion("CreateTime <", value, "createTime");
addCriterion("create_time <", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeLessThanOrEqualTo(Date value) {
addCriterion("CreateTime <=", value, "createTime");
addCriterion("create_time <=", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeIn(List<Date> values) {
addCriterion("CreateTime in", values, "createTime");
addCriterion("create_time in", values, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeNotIn(List<Date> values) {
addCriterion("CreateTime not in", values, "createTime");
addCriterion("create_time not in", values, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeBetween(Date value1, Date value2) {
addCriterion("CreateTime between", value1, value2, "createTime");
addCriterion("create_time between", value1, value2, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeNotBetween(Date value1, Date value2) {
addCriterion("CreateTime not between", value1, value2, "createTime");
addCriterion("create_time not between", value1, value2, "createTime");
return (Criteria) this;
}
public Criteria andUpdaterIsNull() {
addCriterion("Updater is null");
public Criteria andUpdateByIsNull() {
addCriterion("update_by is null");
return (Criteria) this;
}
public Criteria andUpdaterIsNotNull() {
addCriterion("Updater is not null");
public Criteria andUpdateByIsNotNull() {
addCriterion("update_by is not null");
return (Criteria) this;
}
public Criteria andUpdaterEqualTo(String value) {
addCriterion("Updater =", value, "updater");
public Criteria andUpdateByEqualTo(String value) {
addCriterion("update_by =", value, "updateBy");
return (Criteria) this;
}
public Criteria andUpdaterNotEqualTo(String value) {
addCriterion("Updater <>", value, "updater");
public Criteria andUpdateByNotEqualTo(String value) {
addCriterion("update_by <>", value, "updateBy");
return (Criteria) this;
}
public Criteria andUpdaterGreaterThan(String value) {
addCriterion("Updater >", value, "updater");
public Criteria andUpdateByGreaterThan(String value) {
addCriterion("update_by >", value, "updateBy");
return (Criteria) this;
}
public Criteria andUpdaterGreaterThanOrEqualTo(String value) {
addCriterion("Updater >=", value, "updater");
public Criteria andUpdateByGreaterThanOrEqualTo(String value) {
addCriterion("update_by >=", value, "updateBy");
return (Criteria) this;
}
public Criteria andUpdaterLessThan(String value) {
addCriterion("Updater <", value, "updater");
public Criteria andUpdateByLessThan(String value) {
addCriterion("update_by <", value, "updateBy");
return (Criteria) this;
}
public Criteria andUpdaterLessThanOrEqualTo(String value) {
addCriterion("Updater <=", value, "updater");
public Criteria andUpdateByLessThanOrEqualTo(String value) {
addCriterion("update_by <=", value, "updateBy");
return (Criteria) this;
}
public Criteria andUpdaterLike(String value) {
addCriterion("Updater like", value, "updater");
public Criteria andUpdateByLike(String value) {
addCriterion("update_by like", value, "updateBy");
return (Criteria) this;
}
public Criteria andUpdaterNotLike(String value) {
addCriterion("Updater not like", value, "updater");
public Criteria andUpdateByNotLike(String value) {
addCriterion("update_by not like", value, "updateBy");
return (Criteria) this;
}
public Criteria andUpdaterIn(List<String> values) {
addCriterion("Updater in", values, "updater");
public Criteria andUpdateByIn(List<String> values) {
addCriterion("update_by in", values, "updateBy");
return (Criteria) this;
}
public Criteria andUpdaterNotIn(List<String> values) {
addCriterion("Updater not in", values, "updater");
public Criteria andUpdateByNotIn(List<String> values) {
addCriterion("update_by not in", values, "updateBy");
return (Criteria) this;
}
public Criteria andUpdaterBetween(String value1, String value2) {
addCriterion("Updater between", value1, value2, "updater");
public Criteria andUpdateByBetween(String value1, String value2) {
addCriterion("update_by between", value1, value2, "updateBy");
return (Criteria) this;
}
public Criteria andUpdaterNotBetween(String value1, String value2) {
addCriterion("Updater not between", value1, value2, "updater");
public Criteria andUpdateByNotBetween(String value1, String value2) {
addCriterion("update_by not between", value1, value2, "updateBy");
return (Criteria) this;
}
public Criteria andUpdateTimeIsNull() {
addCriterion("UpdateTime is null");
addCriterion("update_time is null");
return (Criteria) this;
}
public Criteria andUpdateTimeIsNotNull() {
addCriterion("UpdateTime is not null");
addCriterion("update_time is not null");
return (Criteria) this;
}
public Criteria andUpdateTimeEqualTo(Date value) {
addCriterion("UpdateTime =", value, "updateTime");
addCriterion("update_time =", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeNotEqualTo(Date value) {
addCriterion("UpdateTime <>", value, "updateTime");
addCriterion("update_time <>", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeGreaterThan(Date value) {
addCriterion("UpdateTime >", value, "updateTime");
addCriterion("update_time >", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeGreaterThanOrEqualTo(Date value) {
addCriterion("UpdateTime >=", value, "updateTime");
addCriterion("update_time >=", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeLessThan(Date value) {
addCriterion("UpdateTime <", value, "updateTime");
addCriterion("update_time <", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeLessThanOrEqualTo(Date value) {
addCriterion("UpdateTime <=", value, "updateTime");
addCriterion("update_time <=", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeIn(List<Date> values) {
addCriterion("UpdateTime in", values, "updateTime");
addCriterion("update_time in", values, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeNotIn(List<Date> values) {
addCriterion("UpdateTime not in", values, "updateTime");
addCriterion("update_time not in", values, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeBetween(Date value1, Date value2) {
addCriterion("UpdateTime between", value1, value2, "updateTime");
addCriterion("update_time between", value1, value2, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeNotBetween(Date value1, Date value2) {
addCriterion("UpdateTime not between", value1, value2, "updateTime");
addCriterion("update_time not between", value1, value2, "updateTime");
return (Criteria) this;
}
}
/**
* This class was generated by MyBatis Generator.
* This class corresponds to the database table Report
* This class corresponds to the database table report
*
* @mbg.generated do_not_delete_during_merge
*/
......@@ -741,7 +721,7 @@ public class ReportExample {
/**
* This class was generated by MyBatis Generator.
* This class corresponds to the database table Report
* This class corresponds to the database table report
*
* @mbg.generated
*/
......
package pwc.taxtech.atms.vat.service;
import java.util.List;
public interface ReportGenerator {
String generateData(String projectId, List<Long> templateIds, Boolean ifDeleteManualDataSource, List<String> exceptCellTemplates,Integer periodParam, String generator);
}
......@@ -10,4 +10,6 @@ public interface ReportService {
OperationResultDto<List<ReportDto>> getReportTemplate(String projectID, EnumServiceType serviceType, Integer period);
OperationResultDto updateConfig(String projectId,Integer period,String generator);
OperationResultDto generateData(String projectId, EnumServiceType serviceType, Boolean ifDeleteManualDataSource, Integer periodParam, Integer reportType, String generator);
}
package pwc.taxtech.atms.vat.service.impl;
import org.apache.commons.lang.StringUtils;
import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
import org.apache.poi.ss.formula.functions.FreeRefFunction;
import org.apache.poi.ss.formula.udf.AggregatingUDFFinder;
import org.apache.poi.ss.formula.udf.DefaultUDFFinder;
import org.apache.poi.ss.formula.udf.UDFFinder;
import org.apache.poi.ss.usermodel.*;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import pwc.taxtech.atms.common.POIUtil;
import pwc.taxtech.atms.constant.enums.CellDataSourceType;
import pwc.taxtech.atms.service.impl.DistributedIDService;
import pwc.taxtech.atms.vat.dao.*;
import pwc.taxtech.atms.vat.entity.*;
import pwc.taxtech.atms.vat.service.ReportGenerator;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.*;
import java.util.stream.Collectors;
@Service
public class ReportGeneratorImpl implements ReportGenerator {
@Autowired
PeriodTemplateMapper periodTemplateMapper;
@Autowired
PeriodCellTemplateMapper periodCellTemplateMapper;
@Autowired
PeriodCellTemplateConfigMapper periodCellTemplateConfigMapper;
@Autowired
DistributedIDService distributedIDService;
@Autowired
ReportMapper reportMapper;
@Autowired
CellDataMapper cellDataMapper;
private static final Logger logger = LoggerFactory.getLogger(ReportGeneratorImpl.class);
@Override
public String generateData(String projectId, List<Long> templateIds, Boolean ifDeleteManualDataSource, List<String> exceptCellTemplates, Integer periodParam, String generator) {
Date createTime = new Date();
int period = periodParam != null ? periodParam : 0;
PeriodTemplateExample periodTemplateExample = new PeriodTemplateExample();
periodTemplateExample.createCriteria().andIdIn(templateIds);
List<PeriodTemplate> periodTemplateList = periodTemplateMapper.selectByExample(periodTemplateExample);
List<Long> periodTemplateIDList = periodTemplateList.stream().map(PeriodTemplate::getTemplateId).collect(Collectors.toList());
PeriodCellTemplateExample periodCellTemplateExample = new PeriodCellTemplateExample();
periodCellTemplateExample.createCriteria().andReportTemplateIdIn(periodTemplateIDList);
List<PeriodCellTemplate> periodCellTemplateList = periodCellTemplateMapper.selectByExample(periodCellTemplateExample);
PeriodCellTemplateConfigExample periodCellTemplateConfigExample = new PeriodCellTemplateConfigExample();
// only get formula config
periodCellTemplateConfigExample.createCriteria().andReportTemplateIdIn(periodTemplateIDList);
List<PeriodCellTemplateConfig> periodCellTemplateConfigList = periodCellTemplateConfigMapper.selectByExample(periodCellTemplateConfigExample);
Map<String, String> templateCodeAndPath = new HashMap<>();
periodTemplateList.forEach(a -> templateCodeAndPath.put(a.getCode(), getTemplatePath(a.getPath())));
Optional<Workbook> workbook = createWorkBookWithExcelFileList(templateCodeAndPath);
if (workbook != null) {
Workbook newWorkbook = workbook.get();
addFunctionsToWorkbook(newWorkbook);
int sheetCount = newWorkbook.getNumberOfSheets();
for (int i = 0; i < sheetCount; i++) {
Sheet sheet = newWorkbook.getSheetAt(i);
String code = sheet.getSheetName();
Optional<PeriodTemplate> periodTemplate = periodTemplateList.stream().filter(a -> a.getCode().equals(code)).findFirst();
Long templateID;
if (periodTemplate.isPresent()) {
templateID = periodTemplate.get().getTemplateId();
} else {
templateID = 0L;
}
if (templateID > 0) {
//todo: get cell template and cell template config with templateID
Map<PeriodCellTemplate, PeriodCellTemplateConfig> cellTemplatePeriodCellTemplateConfigMap = new HashMap<>();
List<PeriodCellTemplate> tempPeriodCellTemplateList = periodCellTemplateList.stream()
.filter(a -> a.getReportTemplateId().equals(templateID))
.collect(Collectors.toList());
tempPeriodCellTemplateList.forEach(a -> {
Optional<PeriodCellTemplateConfig> tempCellTemplateConfig = periodCellTemplateConfigList.stream()
.filter(item -> item.getCellTemplateId().equals(a.getCellTemplateId()) && item.getDataSourceType().equals(CellDataSourceType.Formula.getCode()))
.findFirst();
if (tempCellTemplateConfig != null) {
cellTemplatePeriodCellTemplateConfigMap.put(a, tempCellTemplateConfig.get());
}
});
cellTemplatePeriodCellTemplateConfigMap.forEach((k, v) -> {
Row row = sheet.getRow(k.getRowIndex());
if (null == row) {
sheet.createRow(k.getRowIndex());
}
Cell cell = row.getCell(k.getColumnIndex());
if (null == cell) {
row.createCell(k.getColumnIndex());
}
cell.setCellFormula(v.getFormula());
});
}
}
FormulaEvaluator evaluator = newWorkbook.getCreationHelper().createFormulaEvaluator();
evaluator.evaluateAll();
//todo:loop all the cell which existing in the cellTemplateConfig, save the data to DB
for (int i = 0; i < sheetCount; i++) {
Sheet sheet = newWorkbook.getSheetAt(i);
String code = sheet.getSheetName();
Optional<PeriodTemplate> periodTemplate = periodTemplateList.stream().filter(a -> a.getCode().equals(code)).findFirst();
Long templateID;
if (periodTemplate.isPresent()) {
templateID = periodTemplate.get().getTemplateId();
} else {
templateID = 0L;
}
if (templateID > 0) {
//todo: create report into DB
Report report = new Report();
Long reportID = distributedIDService.nextId();
report.setId(reportID);
report.setTemplateId(templateID);
report.setPeriod(period);
report.setProjectId(projectId);
report.setCreateBy("Admin");
report.setCreateTime(createTime);
report.setUpdateBy("Admin");
report.setUpdateTime(createTime);
reportMapper.insertSelective(report);
List<PeriodCellTemplateConfig> periodCellTemplateConfigs = periodCellTemplateConfigList.stream().filter(a -> a.getReportTemplateId().equals(templateID)).collect(Collectors.toList());
for (PeriodCellTemplateConfig periodCellTemplateConfig : periodCellTemplateConfigs) {
Optional<PeriodCellTemplate> tempPeriodCellTemplate = periodCellTemplateList.stream().filter(a->a.getCellTemplateId().equals(periodCellTemplateConfig.getCellTemplateId())).findFirst();
if (tempPeriodCellTemplate!=null){
CellData cellData = new CellData();
cellData.setId(distributedIDService.nextId());
cellData.setReportId(reportID);
cellData.setCellTemplateId(tempPeriodCellTemplate.get().getCellTemplateId());
String data;
if(sheet.getRow(tempPeriodCellTemplate.get().getRowIndex())!=null&&sheet.getRow(tempPeriodCellTemplate.get().getRowIndex()).getCell(tempPeriodCellTemplate.get().getColumnIndex())!=null){
data = sheet.getRow(tempPeriodCellTemplate.get().getRowIndex()).getCell(tempPeriodCellTemplate.get().getColumnIndex()).getStringCellValue();
}
else{
data = StringUtils.EMPTY;
}
cellData.setData(data);
cellData.setFormulaExp(StringUtils.EMPTY);
cellData.setCreateBy("Admin");
cellData.setCreateTime(createTime);
cellData.setUpdateBy("Admin");
cellData.setUpdateTime(createTime);
cellDataMapper.insertSelective(cellData);
}
}
}
}
} else {
return "GenerateReport failed";
}
return "generate report successful";
}
private String getTemplatePath(String path) {
String result;
String PREFIX_VALUE = "~";
if (path.startsWith(PREFIX_VALUE)) {
result = path.substring(1, path.length());
} else {
result = path;
}
return result;
}
/**
* 根据传入的模板code和模板路径创建workbook
*
* @param templates 模板code和模板路径 键值对
* @return 工作簿workbook
*/
private Optional<Workbook> createWorkBookWithExcelFileList(Map<String, String> templates) {
Workbook workbook = new XSSFWorkbook();
try {
String filePath = this.getClass().getResource("").toURI().getPath();
String tempPath = filePath.substring(0, filePath.indexOf("classes") + "\\classes".length());
templates.forEach((code, path) -> {
File file = new File(tempPath + path);
try {
Workbook tWorkbook = WorkbookFactory.create(file);
POIUtil.cloneSheet(tWorkbook.getSheetAt(0), workbook.createSheet(code));
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (InvalidFormatException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
});
return Optional.of(workbook);
} catch (Exception e) {
logger.error("createWorkBookWithExcelFileList error.", e);
}
return Optional.empty();
}
/**
* 注册所有的自定义方法到工作簿
*
* @param workbook 工作簿
*/
private void addFunctionsToWorkbook(Workbook workbook) {
String[] functionNames = {"functionName"};
FreeRefFunction[] functionImpls = {};
UDFFinder udfs = new DefaultUDFFinder(functionNames, functionImpls);
UDFFinder udfToolpack = new AggregatingUDFFinder(udfs);
workbook.addToolPack(udfToolpack);
}
}
......@@ -10,8 +10,10 @@ import pwc.taxtech.atms.entitiy.*;
import pwc.taxtech.atms.vat.entity.PeriodCellTemplate;
import pwc.taxtech.atms.vat.entity.PeriodCellTemplateConfig;
import pwc.taxtech.atms.vat.entity.PeriodTemplate;
import pwc.taxtech.atms.vat.entity.PeriodTemplateExample;
import pwc.taxtech.atms.vat.service.ReportService;
import javax.ws.rs.NotSupportedException;
import java.util.*;
import java.util.stream.Collectors;
......@@ -219,4 +221,50 @@ public class ReportServiceImpl extends VatAbstractService implements ReportServi
}
return null;
}
}
\ No newline at end of file
@Override
public OperationResultDto generateData(String projectId, EnumServiceType serviceType, Boolean ifDeleteManualDataSource, Integer periodParam, Integer reportType, String generator) {
OperationResultDto operationResultDto = new OperationResultDto();
if (serviceType.equals(EnumServiceType.VAT) && (periodParam == null && periodParam <= 0)) {
operationResultDto.setResultMsg("PeriodRequiredForVAT");
return operationResultDto;
}
if (serviceType != EnumServiceType.VAT) {
// 暂不支持非CIT/VAT service批量后端生成报表
throw new NotSupportedException();
}
int period = periodParam != null ? periodParam : 0;
String serviceTypeStr = serviceType.getCode().toString();
ProjectServiceTypeExample projectServiceTypeExample = new ProjectServiceTypeExample();
projectServiceTypeExample.createCriteria().andServiceTypeIDEqualTo(serviceTypeStr).andProjectIDEqualTo(projectId);
Optional<Long> templateGroupID = projectServiceTypeMapper.selectByExample(projectServiceTypeExample).stream().map(ProjectServiceType::getTemplateGroupID).findFirst();
if (templateGroupID == null) {
operationResultDto.setResultMsg("TemplateGroupNotExist");
return operationResultDto;
}
List<Long> templateIds;
if (reportType != null) {
PeriodTemplateExample periodTemplateExample = new PeriodTemplateExample();
periodTemplateExample.createCriteria().andTemplateGroupIdEqualTo(templateGroupID.get()).andPeriodEqualTo(period).andIsActiveAssociationEqualTo(true).andReportTypeEqualTo(reportType);
templateIds = periodTemplateMapper.selectByExample(periodTemplateExample).stream().map(PeriodTemplate::getId).collect(Collectors.toList());
} else {
PeriodTemplateExample periodTemplateExample = new PeriodTemplateExample();
periodTemplateExample.createCriteria().andTemplateGroupIdEqualTo(templateGroupID.get()).andPeriodEqualTo(period).andIsActiveAssociationEqualTo(true);
templateIds = periodTemplateMapper.selectByExample(periodTemplateExample).stream().map(PeriodTemplate::getId).collect(Collectors.toList());
}
String rslt = reportGenerator.generateData(projectId, templateIds, ifDeleteManualDataSource, null, periodParam, generator);
if (StringUtils.isBlank(rslt)) {
operationResultDto.setResultMsg("ReportGenerateFailed!");
return operationResultDto;
}
operationResultDto.setResult(true);
return operationResultDto;
}
}
......@@ -6,6 +6,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import pwc.taxtech.atms.dao.*;
import pwc.taxtech.atms.service.impl.DistributedIDService;
import pwc.taxtech.atms.vat.dao.*;
import pwc.taxtech.atms.vat.service.ReportGenerator;
public class VatAbstractService {
protected final Logger logger = LoggerFactory.getLogger(this.getClass());
......@@ -52,5 +53,7 @@ public class VatAbstractService {
CellTemplateConfigMapper cellTemplateConfigMapper;
@Autowired
EnterpriseAccountMapper enterpriseAccountMapper;
@Autowired
ReportGenerator reportGenerator;
}
......@@ -7,8 +7,8 @@
This element is automatically generated by MyBatis Generator, do not modify.
-->
<id column="id" jdbcType="BIGINT" property="id" />
<result column="report_id" jdbcType="VARCHAR" property="reportId" />
<result column="cell_template_id" jdbcType="VARCHAR" property="cellTemplateId" />
<result column="report_id" jdbcType="BIGINT" property="reportId" />
<result column="cell_template_id" jdbcType="BIGINT" property="cellTemplateId" />
<result column="data" jdbcType="VARCHAR" property="data" />
<result column="formula_exp" jdbcType="VARCHAR" property="formulaExp" />
<result column="create_by" jdbcType="VARCHAR" property="createBy" />
......@@ -145,7 +145,7 @@
"data", formula_exp, create_by,
create_time, update_by, update_time
)
values (#{id,jdbcType=BIGINT}, #{reportId,jdbcType=VARCHAR}, #{cellTemplateId,jdbcType=VARCHAR},
values (#{id,jdbcType=BIGINT}, #{reportId,jdbcType=BIGINT}, #{cellTemplateId,jdbcType=BIGINT},
#{data,jdbcType=VARCHAR}, #{formulaExp,jdbcType=VARCHAR}, #{createBy,jdbcType=VARCHAR},
#{createTime,jdbcType=TIMESTAMP}, #{updateBy,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP}
)
......@@ -190,10 +190,10 @@
#{id,jdbcType=BIGINT},
</if>
<if test="reportId != null">
#{reportId,jdbcType=VARCHAR},
#{reportId,jdbcType=BIGINT},
</if>
<if test="cellTemplateId != null">
#{cellTemplateId,jdbcType=VARCHAR},
#{cellTemplateId,jdbcType=BIGINT},
</if>
<if test="data != null">
#{data,jdbcType=VARCHAR},
......@@ -236,10 +236,10 @@
id = #{record.id,jdbcType=BIGINT},
</if>
<if test="record.reportId != null">
report_id = #{record.reportId,jdbcType=VARCHAR},
report_id = #{record.reportId,jdbcType=BIGINT},
</if>
<if test="record.cellTemplateId != null">
cell_template_id = #{record.cellTemplateId,jdbcType=VARCHAR},
cell_template_id = #{record.cellTemplateId,jdbcType=BIGINT},
</if>
<if test="record.data != null">
"data" = #{record.data,jdbcType=VARCHAR},
......@@ -271,8 +271,8 @@
-->
update cell_data
set id = #{record.id,jdbcType=BIGINT},
report_id = #{record.reportId,jdbcType=VARCHAR},
cell_template_id = #{record.cellTemplateId,jdbcType=VARCHAR},
report_id = #{record.reportId,jdbcType=BIGINT},
cell_template_id = #{record.cellTemplateId,jdbcType=BIGINT},
"data" = #{record.data,jdbcType=VARCHAR},
formula_exp = #{record.formulaExp,jdbcType=VARCHAR},
create_by = #{record.createBy,jdbcType=VARCHAR},
......@@ -291,10 +291,10 @@
update cell_data
<set>
<if test="reportId != null">
report_id = #{reportId,jdbcType=VARCHAR},
report_id = #{reportId,jdbcType=BIGINT},
</if>
<if test="cellTemplateId != null">
cell_template_id = #{cellTemplateId,jdbcType=VARCHAR},
cell_template_id = #{cellTemplateId,jdbcType=BIGINT},
</if>
<if test="data != null">
"data" = #{data,jdbcType=VARCHAR},
......@@ -323,8 +323,8 @@
This element is automatically generated by MyBatis Generator, do not modify.
-->
update cell_data
set report_id = #{reportId,jdbcType=VARCHAR},
cell_template_id = #{cellTemplateId,jdbcType=VARCHAR},
set report_id = #{reportId,jdbcType=BIGINT},
cell_template_id = #{cellTemplateId,jdbcType=BIGINT},
"data" = #{data,jdbcType=VARCHAR},
formula_exp = #{formulaExp,jdbcType=VARCHAR},
create_by = #{createBy,jdbcType=VARCHAR},
......
......@@ -6,14 +6,14 @@
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
<id column="ID" jdbcType="VARCHAR" property="ID" />
<result column="TemplateID" jdbcType="VARCHAR" property="templateID" />
<result column="Period" jdbcType="INTEGER" property="period" />
<result column="ProjectID" jdbcType="VARCHAR" property="projectID" />
<result column="Creator" jdbcType="VARCHAR" property="creator" />
<result column="CreateTime" jdbcType="TIMESTAMP" property="createTime" />
<result column="Updater" jdbcType="VARCHAR" property="updater" />
<result column="UpdateTime" jdbcType="TIMESTAMP" property="updateTime" />
<id column="id" jdbcType="BIGINT" property="id" />
<result column="template_id" jdbcType="BIGINT" property="templateId" />
<result column="period" jdbcType="INTEGER" property="period" />
<result column="project_id" jdbcType="VARCHAR" property="projectId" />
<result column="create_by" jdbcType="VARCHAR" property="createBy" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_by" jdbcType="VARCHAR" property="updateBy" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
</resultMap>
<sql id="Example_Where_Clause">
<!--
......@@ -86,7 +86,7 @@
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
ID, TemplateID, Period, ProjectID, Creator, CreateTime, Updater, UpdateTime
id, template_id, period, project_id, create_by, create_time, update_by, update_time
</sql>
<select id="selectByExample" parameterType="pwc.taxtech.atms.vat.entity.ReportExample" resultMap="BaseResultMap">
<!--
......@@ -98,7 +98,7 @@
distinct
</if>
<include refid="Base_Column_List" />
from Report
from report
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
......@@ -106,30 +106,30 @@
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
select
<include refid="Base_Column_List" />
from Report
where ID = #{ID,jdbcType=VARCHAR}
from report
where id = #{id,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
delete from Report
where ID = #{ID,jdbcType=VARCHAR}
delete from report
where id = #{id,jdbcType=BIGINT}
</delete>
<delete id="deleteByExample" parameterType="pwc.taxtech.atms.vat.entity.ReportExample">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
delete from Report
delete from report
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
......@@ -139,66 +139,66 @@
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
insert into Report (ID, TemplateID, Period,
ProjectID, Creator, CreateTime,
Updater, UpdateTime)
values (#{ID,jdbcType=VARCHAR}, #{templateID,jdbcType=VARCHAR}, #{period,jdbcType=INTEGER},
#{projectID,jdbcType=VARCHAR}, #{creator,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP},
#{updater,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP})
insert into report (id, template_id, period,
project_id, create_by, create_time,
update_by, update_time)
values (#{id,jdbcType=BIGINT}, #{templateId,jdbcType=BIGINT}, #{period,jdbcType=INTEGER},
#{projectId,jdbcType=VARCHAR}, #{createBy,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP},
#{updateBy,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP})
</insert>
<insert id="insertSelective" parameterType="pwc.taxtech.atms.vat.entity.Report">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
insert into Report
insert into report
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="ID != null">
ID,
<if test="id != null">
id,
</if>
<if test="templateID != null">
TemplateID,
<if test="templateId != null">
template_id,
</if>
<if test="period != null">
Period,
period,
</if>
<if test="projectID != null">
ProjectID,
<if test="projectId != null">
project_id,
</if>
<if test="creator != null">
Creator,
<if test="createBy != null">
create_by,
</if>
<if test="createTime != null">
CreateTime,
create_time,
</if>
<if test="updater != null">
Updater,
<if test="updateBy != null">
update_by,
</if>
<if test="updateTime != null">
UpdateTime,
update_time,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="ID != null">
#{ID,jdbcType=VARCHAR},
<if test="id != null">
#{id,jdbcType=BIGINT},
</if>
<if test="templateID != null">
#{templateID,jdbcType=VARCHAR},
<if test="templateId != null">
#{templateId,jdbcType=BIGINT},
</if>
<if test="period != null">
#{period,jdbcType=INTEGER},
</if>
<if test="projectID != null">
#{projectID,jdbcType=VARCHAR},
<if test="projectId != null">
#{projectId,jdbcType=VARCHAR},
</if>
<if test="creator != null">
#{creator,jdbcType=VARCHAR},
<if test="createBy != null">
#{createBy,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updater != null">
#{updater,jdbcType=VARCHAR},
<if test="updateBy != null">
#{updateBy,jdbcType=VARCHAR},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=TIMESTAMP},
......@@ -210,7 +210,7 @@
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
select count(*) from Report
select count(*) from report
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
......@@ -220,31 +220,31 @@
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
update Report
update report
<set>
<if test="record.ID != null">
ID = #{record.ID,jdbcType=VARCHAR},
<if test="record.id != null">
id = #{record.id,jdbcType=BIGINT},
</if>
<if test="record.templateID != null">
TemplateID = #{record.templateID,jdbcType=VARCHAR},
<if test="record.templateId != null">
template_id = #{record.templateId,jdbcType=BIGINT},
</if>
<if test="record.period != null">
Period = #{record.period,jdbcType=INTEGER},
period = #{record.period,jdbcType=INTEGER},
</if>
<if test="record.projectID != null">
ProjectID = #{record.projectID,jdbcType=VARCHAR},
<if test="record.projectId != null">
project_id = #{record.projectId,jdbcType=VARCHAR},
</if>
<if test="record.creator != null">
Creator = #{record.creator,jdbcType=VARCHAR},
<if test="record.createBy != null">
create_by = #{record.createBy,jdbcType=VARCHAR},
</if>
<if test="record.createTime != null">
CreateTime = #{record.createTime,jdbcType=TIMESTAMP},
create_time = #{record.createTime,jdbcType=TIMESTAMP},
</if>
<if test="record.updater != null">
Updater = #{record.updater,jdbcType=VARCHAR},
<if test="record.updateBy != null">
update_by = #{record.updateBy,jdbcType=VARCHAR},
</if>
<if test="record.updateTime != null">
UpdateTime = #{record.updateTime,jdbcType=TIMESTAMP},
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
</if>
</set>
<if test="_parameter != null">
......@@ -256,15 +256,15 @@
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
update Report
set ID = #{record.ID,jdbcType=VARCHAR},
TemplateID = #{record.templateID,jdbcType=VARCHAR},
Period = #{record.period,jdbcType=INTEGER},
ProjectID = #{record.projectID,jdbcType=VARCHAR},
Creator = #{record.creator,jdbcType=VARCHAR},
CreateTime = #{record.createTime,jdbcType=TIMESTAMP},
Updater = #{record.updater,jdbcType=VARCHAR},
UpdateTime = #{record.updateTime,jdbcType=TIMESTAMP}
update report
set id = #{record.id,jdbcType=BIGINT},
template_id = #{record.templateId,jdbcType=BIGINT},
period = #{record.period,jdbcType=INTEGER},
project_id = #{record.projectId,jdbcType=VARCHAR},
create_by = #{record.createBy,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=TIMESTAMP},
update_by = #{record.updateBy,jdbcType=VARCHAR},
update_time = #{record.updateTime,jdbcType=TIMESTAMP}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
......@@ -274,46 +274,46 @@
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
update Report
update report
<set>
<if test="templateID != null">
TemplateID = #{templateID,jdbcType=VARCHAR},
<if test="templateId != null">
template_id = #{templateId,jdbcType=BIGINT},
</if>
<if test="period != null">
Period = #{period,jdbcType=INTEGER},
period = #{period,jdbcType=INTEGER},
</if>
<if test="projectID != null">
ProjectID = #{projectID,jdbcType=VARCHAR},
<if test="projectId != null">
project_id = #{projectId,jdbcType=VARCHAR},
</if>
<if test="creator != null">
Creator = #{creator,jdbcType=VARCHAR},
<if test="createBy != null">
create_by = #{createBy,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
CreateTime = #{createTime,jdbcType=TIMESTAMP},
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updater != null">
Updater = #{updater,jdbcType=VARCHAR},
<if test="updateBy != null">
update_by = #{updateBy,jdbcType=VARCHAR},
</if>
<if test="updateTime != null">
UpdateTime = #{updateTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
</set>
where ID = #{ID,jdbcType=VARCHAR}
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="pwc.taxtech.atms.vat.entity.Report">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
update Report
set TemplateID = #{templateID,jdbcType=VARCHAR},
Period = #{period,jdbcType=INTEGER},
ProjectID = #{projectID,jdbcType=VARCHAR},
Creator = #{creator,jdbcType=VARCHAR},
CreateTime = #{createTime,jdbcType=TIMESTAMP},
Updater = #{updater,jdbcType=VARCHAR},
UpdateTime = #{updateTime,jdbcType=TIMESTAMP}
where ID = #{ID,jdbcType=VARCHAR}
update report
set template_id = #{templateId,jdbcType=BIGINT},
period = #{period,jdbcType=INTEGER},
project_id = #{projectId,jdbcType=VARCHAR},
create_by = #{createBy,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_by = #{updateBy,jdbcType=VARCHAR},
update_time = #{updateTime,jdbcType=TIMESTAMP}
where id = #{id,jdbcType=BIGINT}
</update>
<select id="selectByExampleWithRowbounds" parameterType="pwc.taxtech.atms.vat.entity.ReportExample" resultMap="BaseResultMap">
<!--
......@@ -325,7 +325,7 @@
distinct
</if>
<include refid="Base_Column_List" />
from Report
from report
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
......
package pwc.taxtech.atms.common;
import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
import org.apache.poi.ss.formula.eval.ValueEval;
import org.apache.poi.ss.formula.functions.FreeRefFunction;
import org.apache.poi.ss.formula.udf.AggregatingUDFFinder;
import org.apache.poi.ss.formula.udf.DefaultUDFFinder;
import org.apache.poi.ss.formula.udf.UDFFinder;
import org.apache.poi.ss.usermodel.*;
import org.apache.poi.ss.util.CellReference;
import java.io.*;
......
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