Commit afa5fe89 authored by eddie.woo's avatar eddie.woo

Merge branch 'dev_mysql' of http://code.tech.tax.asia.pwcinternal.com/root/atms into dev_mysql

parents eeafc2a5 6452bee7
......@@ -53,6 +53,8 @@ public class SpringContextUtil implements ApplicationContextAware {
public static OrganizationMapper organizationMapper;
public static EnterpriseAccountSetOrgMapper enterpriseAccountSetOrgMapper;
public static AccountMappingMapper accountMappingMapper;
public static TrialBalanceMapper trialBalanceMapper;
public static AdjustmentTableMapper adjustmentTableMapper;
/**
* 获取bean
......@@ -106,5 +108,7 @@ public class SpringContextUtil implements ApplicationContextAware {
enterpriseAccountSetOrgMapper = webApplicationContext.getBean(EnterpriseAccountSetOrgMapper.class);
accountMappingMapper = webApplicationContext.getBean(AccountMappingMapper.class);
glBalanceMapper = webApplicationContext.getBean(GlBalanceMapper.class);
trialBalanceMapper = webApplicationContext.getBean(TrialBalanceMapper.class);
adjustmentTableMapper = webApplicationContext.getBean(AdjustmentTableMapper.class);
}
}
......@@ -37,6 +37,28 @@ public class OrganizationAccountingRateDto implements Serializable {
*/
private String organizationId;
/**
* Database Column Remarks:
* 期间
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column organization_accounting_rate.period
*
* @mbg.generated
*/
private Integer period;
/**
* Database Column Remarks:
* 汇率类型
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column organization_accounting_rate.convertion_type
*
* @mbg.generated
*/
private String convertionType;
/**
* Database Column Remarks:
* 货币自
......@@ -170,6 +192,54 @@ public class OrganizationAccountingRateDto implements Serializable {
this.organizationId = organizationId == null ? null : organizationId.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column organization_accounting_rate.period
*
* @return the value of organization_accounting_rate.period
*
* @mbg.generated
*/
public Integer getPeriod() {
return period;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column organization_accounting_rate.period
*
* @param period the value for organization_accounting_rate.period
*
* @mbg.generated
*/
public void setPeriod(Integer period) {
this.period = period;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column organization_accounting_rate.convertion_type
*
* @return the value of organization_accounting_rate.convertion_type
*
* @mbg.generated
*/
public String getConvertionType() {
return convertionType;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column organization_accounting_rate.convertion_type
*
* @param convertionType the value for organization_accounting_rate.convertion_type
*
* @mbg.generated
*/
public void setConvertionType(String convertionType) {
this.convertionType = convertionType == null ? null : convertionType.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column organization_accounting_rate.currency_from
......@@ -352,6 +422,8 @@ public class OrganizationAccountingRateDto implements Serializable {
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", organizationId=").append(organizationId);
sb.append(", period=").append(period);
sb.append(", convertionType=").append(convertionType);
sb.append(", currencyFrom=").append(currencyFrom);
sb.append(", currencyTo=").append(currencyTo);
sb.append(", startDate=").append(startDate);
......
package pwc.taxtech.atms.vat.service.impl.report.functions;
import com.alibaba.fastjson.JSON;
import org.apache.commons.collections.CollectionUtils;
import org.apache.poi.ss.formula.OperationEvaluationContext;
import org.apache.poi.ss.formula.WorkbookEvaluator;
import org.apache.poi.ss.formula.eval.*;
......@@ -138,29 +139,41 @@ public class FunctionBase {
dataSource.setPeriod(period);
dataSource.setProjectId(projectId);
SpringContextUtil.periodDataSourceMapper.insertSelective(dataSource);
for (Object obj : dataSourceList) {
if (obj.getClass() == java.util.ArrayList.class) {
for (Object obj2 : (ArrayList<Object>) obj) {
if(CollectionUtils.isNotEmpty(dataSourceList)){
for (Object obj : dataSourceList) {
if (obj.getClass() == java.util.ArrayList.class) {
for (Object obj2 : (ArrayList<Object>) obj) {
PeriodDataSourceDetail dataSourceDetail = new PeriodDataSourceDetail();
dataSourceDetail.setId(SpringContextUtil.distributedIdService.nextId());
dataSourceDetail.setDataSourceId(dataSourceId);
dataSourceDetail.setDataSourceType(formulaDataSourceDetailType.getCode());
dataSourceDetail.setItemValue(JSON.toJSONString(obj2));
dataSourceDetail.setPeriod(period);
dataSourceDetail.setProjectId(projectId);
SpringContextUtil.periodDataSourceDetailMapper.insertSelective(dataSourceDetail);
}
} else {
PeriodDataSourceDetail dataSourceDetail = new PeriodDataSourceDetail();
dataSourceDetail.setId(SpringContextUtil.distributedIdService.nextId());
dataSourceDetail.setDataSourceId(dataSourceId);
dataSourceDetail.setDataSourceType(formulaDataSourceDetailType.getCode());
dataSourceDetail.setItemValue(JSON.toJSONString(obj2));
dataSourceDetail.setItemValue(JSON.toJSONString(obj));
dataSourceDetail.setPeriod(period);
dataSourceDetail.setProjectId(projectId);
SpringContextUtil.periodDataSourceDetailMapper.insertSelective(dataSourceDetail);
}
} else {
PeriodDataSourceDetail dataSourceDetail = new PeriodDataSourceDetail();
dataSourceDetail.setId(SpringContextUtil.distributedIdService.nextId());
dataSourceDetail.setDataSourceId(dataSourceId);
dataSourceDetail.setDataSourceType(formulaDataSourceDetailType.getCode());
dataSourceDetail.setItemValue(JSON.toJSONString(obj));
dataSourceDetail.setPeriod(period);
dataSourceDetail.setProjectId(projectId);
SpringContextUtil.periodDataSourceDetailMapper.insertSelective(dataSourceDetail);
}
}else{
PeriodDataSourceDetail dataSourceDetail = new PeriodDataSourceDetail();
dataSourceDetail.setId(SpringContextUtil.distributedIdService.nextId());
dataSourceDetail.setDataSourceId(dataSourceId);
dataSourceDetail.setDataSourceType(formulaDataSourceDetailType.getCode());
dataSourceDetail.setItemValue("{}");
dataSourceDetail.setPeriod(period);
dataSourceDetail.setProjectId(projectId);
SpringContextUtil.periodDataSourceDetailMapper.insertSelective(dataSourceDetail);
}
return dataSourceId;
}
......
package pwc.taxtech.atms.vat.service.impl.report.functions;
import org.apache.commons.collections.CollectionUtils;
import org.apache.poi.ss.formula.OperationEvaluationContext;
import org.apache.poi.ss.formula.eval.NumberEval;
import org.apache.poi.ss.formula.eval.StringEval;
......@@ -56,6 +57,10 @@ public class WPTYPE extends FunctionBase implements FreeRefFunction {
cellTemplateDataList = agent.getCellTemplateByTypeAndIndex(formulaContext.getReportTemplateGroupId(),
formulaContext.getProjectId(), bo.getReportCode(), bo.getRowColumnIndex() - 1, bo.getTaxRate(), bo.getRevenueType(), bo.getTaxType(), bo.getColumnIndex() - 1,
formulaContext.getPeriod(), formulaContext.getOrganizationId(), queryDate, queryDate);
if(CollectionUtils.isEmpty(cellTemplateDataList)){
cellTemplateDataList = agent.getCellTemplateGroupDto(formulaContext.getReportTemplateGroupId(),
formulaContext.getProjectId(), bo.getReportCode(), ec.getRowIndex(), ec.getColumnIndex(), formulaContext.getPeriod());
}
MyAsserts.assertNotEmpty(cellTemplateDataList, Exceptions.BB_CELL_TEMP_NULL);
for (CellTemplatePerGroupDto cellTemplateData : cellTemplateDataList) {
int index = ec.getWorkbook().getSheetIndex(bo.getReportCode());
......@@ -74,11 +79,13 @@ public class WPTYPE extends FunctionBase implements FreeRefFunction {
} finally {
LOGGER.warn("[BB_Exception] error for bb cacls for {}", bo.toString());
Long dataSourceId = saveDataSource(ec, dataSource, FormulaDataSourceDetailType.ReportCellDataSourceDto,
cellValue, formulaContext.getPeriod(),
formulaContext.getReportTemplateGroupId(), ec.getColumnIndex(), ec.getRowIndex(),
formulaContext.getProjectId());
cellValue, formulaContext.getPeriod(),
formulaContext.getReportTemplateGroupId(), ec.getColumnIndex(), ec.getRowIndex(),
formulaContext.getProjectId());
saveFormulaBlock(formulaContext.getPeriod(), ec,
bo.getFormulaExpression(), cellValue, dataSourceId, formulaContext.getProjectId());
bo.getFormulaExpression(), cellValue, dataSourceId, formulaContext.getProjectId());
}
}
......
......@@ -41,15 +41,18 @@
<property name="rootInterface" value="pwc.taxtech.atms.MyMapper"/>
</javaClientGenerator>
<table tableName="organization_accounting_rate" domainObjectName="OrganizationAccountingRate">
<property name="useActualColumnNames" value="false"/>
<property name="ignoreQualifiersAtRuntime" value="true"/>
</table>
<table tableName="organization" domainObjectName="Organization">
<!--<table tableName="organization" domainObjectName="Organization">
<property name="useActualColumnNames" value="false"/>
<property name="ignoreQualifiersAtRuntime" value="true"/>
<columnOverride column="num_of_branches" javaType="java.lang.Integer" jdbcType="TINYINT"/>
</table>
<!--<table tableName="data_import_log" domainObjectName="DataImportLog">
<table tableName="data_import_log" domainObjectName="DataImportLog">
<property name="useActualColumnNames" value="false"/>
<property name="ignoreQualifiersAtRuntime" value="true"/>
<columnOverride column="type" javaType="java.lang.Integer" jdbcType="TINYINT"/>
......
......@@ -41,7 +41,17 @@
<property name="rootInterface" value="pwc.taxtech.atms.MyVatMapper" />
</javaClientGenerator>
<table tableName="revenue_config" domainObjectName="RevenueConfig">
<table tableName="certified_invoices_list" domainObjectName="CertifiedInvoicesList">
<property name="useActualColumnNames" value="false"/>
<property name="ignoreQualifiersAtRuntime" value="true"/>
</table>
<table tableName="invoice_record" domainObjectName="InvoiceRecord">
<property name="useActualColumnNames" value="false"/>
<property name="ignoreQualifiersAtRuntime" value="true"/>
</table>
<!--<table tableName="revenue_config" domainObjectName="RevenueConfig">
<property name="useActualColumnNames" value="false"/>
<property name="ignoreQualifiersAtRuntime" value="true"/>
<columnOverride column="account_type" javaType="java.lang.Integer" jdbcType="TINYINT"/>
......@@ -51,7 +61,7 @@
<columnOverride column="status" javaType="java.lang.Integer" jdbcType="TINYINT"/>
</table>
<!--<table tableName="invoice_data" domainObjectName="InvoiceData">-->
<table tableName="invoice_data" domainObjectName="InvoiceData">-->
<!--<property name="useActualColumnNames" value="false"/>-->
<!--<property name="ignoreQualifiersAtRuntime" value="true"/>-->
<!--<columnOverride column="count_type" javaType="java.lang.Integer" jdbcType="TINYINT"/>-->
......
......@@ -33,6 +33,28 @@ public class OrganizationAccountingRate extends BaseEntity implements Serializab
*/
private String organizationId;
/**
* Database Column Remarks:
* 期间
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column organization_accounting_rate.period
*
* @mbg.generated
*/
private Integer period;
/**
* Database Column Remarks:
* 汇率类型
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column organization_accounting_rate.convertion_type
*
* @mbg.generated
*/
private String convertionType;
/**
* Database Column Remarks:
* 货币自
......@@ -166,6 +188,54 @@ public class OrganizationAccountingRate extends BaseEntity implements Serializab
this.organizationId = organizationId == null ? null : organizationId.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column organization_accounting_rate.period
*
* @return the value of organization_accounting_rate.period
*
* @mbg.generated
*/
public Integer getPeriod() {
return period;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column organization_accounting_rate.period
*
* @param period the value for organization_accounting_rate.period
*
* @mbg.generated
*/
public void setPeriod(Integer period) {
this.period = period;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column organization_accounting_rate.convertion_type
*
* @return the value of organization_accounting_rate.convertion_type
*
* @mbg.generated
*/
public String getConvertionType() {
return convertionType;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column organization_accounting_rate.convertion_type
*
* @param convertionType the value for organization_accounting_rate.convertion_type
*
* @mbg.generated
*/
public void setConvertionType(String convertionType) {
this.convertionType = convertionType == null ? null : convertionType.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column organization_accounting_rate.currency_from
......@@ -348,6 +418,8 @@ public class OrganizationAccountingRate extends BaseEntity implements Serializab
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", organizationId=").append(organizationId);
sb.append(", period=").append(period);
sb.append(", convertionType=").append(convertionType);
sb.append(", currencyFrom=").append(currencyFrom);
sb.append(", currencyTo=").append(currencyTo);
sb.append(", startDate=").append(startDate);
......
......@@ -325,6 +325,136 @@ public class OrganizationAccountingRateExample {
return (Criteria) this;
}
public Criteria andPeriodIsNull() {
addCriterion("period is null");
return (Criteria) this;
}
public Criteria andPeriodIsNotNull() {
addCriterion("period is not null");
return (Criteria) this;
}
public Criteria andPeriodEqualTo(Integer value) {
addCriterion("period =", value, "period");
return (Criteria) this;
}
public Criteria andPeriodNotEqualTo(Integer value) {
addCriterion("period <>", value, "period");
return (Criteria) this;
}
public Criteria andPeriodGreaterThan(Integer value) {
addCriterion("period >", value, "period");
return (Criteria) this;
}
public Criteria andPeriodGreaterThanOrEqualTo(Integer value) {
addCriterion("period >=", value, "period");
return (Criteria) this;
}
public Criteria andPeriodLessThan(Integer value) {
addCriterion("period <", value, "period");
return (Criteria) this;
}
public Criteria andPeriodLessThanOrEqualTo(Integer value) {
addCriterion("period <=", value, "period");
return (Criteria) this;
}
public Criteria andPeriodIn(List<Integer> values) {
addCriterion("period in", values, "period");
return (Criteria) this;
}
public Criteria andPeriodNotIn(List<Integer> values) {
addCriterion("period not in", values, "period");
return (Criteria) this;
}
public Criteria andPeriodBetween(Integer value1, Integer value2) {
addCriterion("period between", value1, value2, "period");
return (Criteria) this;
}
public Criteria andPeriodNotBetween(Integer value1, Integer value2) {
addCriterion("period not between", value1, value2, "period");
return (Criteria) this;
}
public Criteria andConvertionTypeIsNull() {
addCriterion("convertion_type is null");
return (Criteria) this;
}
public Criteria andConvertionTypeIsNotNull() {
addCriterion("convertion_type is not null");
return (Criteria) this;
}
public Criteria andConvertionTypeEqualTo(String value) {
addCriterion("convertion_type =", value, "convertionType");
return (Criteria) this;
}
public Criteria andConvertionTypeNotEqualTo(String value) {
addCriterion("convertion_type <>", value, "convertionType");
return (Criteria) this;
}
public Criteria andConvertionTypeGreaterThan(String value) {
addCriterion("convertion_type >", value, "convertionType");
return (Criteria) this;
}
public Criteria andConvertionTypeGreaterThanOrEqualTo(String value) {
addCriterion("convertion_type >=", value, "convertionType");
return (Criteria) this;
}
public Criteria andConvertionTypeLessThan(String value) {
addCriterion("convertion_type <", value, "convertionType");
return (Criteria) this;
}
public Criteria andConvertionTypeLessThanOrEqualTo(String value) {
addCriterion("convertion_type <=", value, "convertionType");
return (Criteria) this;
}
public Criteria andConvertionTypeLike(String value) {
addCriterion("convertion_type like", value, "convertionType");
return (Criteria) this;
}
public Criteria andConvertionTypeNotLike(String value) {
addCriterion("convertion_type not like", value, "convertionType");
return (Criteria) this;
}
public Criteria andConvertionTypeIn(List<String> values) {
addCriterion("convertion_type in", values, "convertionType");
return (Criteria) this;
}
public Criteria andConvertionTypeNotIn(List<String> values) {
addCriterion("convertion_type not in", values, "convertionType");
return (Criteria) this;
}
public Criteria andConvertionTypeBetween(String value1, String value2) {
addCriterion("convertion_type between", value1, value2, "convertionType");
return (Criteria) this;
}
public Criteria andConvertionTypeNotBetween(String value1, String value2) {
addCriterion("convertion_type not between", value1, value2, "convertionType");
return (Criteria) this;
}
public Criteria andCurrencyFromIsNull() {
addCriterion("currency_from is null");
return (Criteria) this;
......
......@@ -8,6 +8,8 @@
-->
<id column="id" jdbcType="BIGINT" property="id" />
<result column="organization_id" jdbcType="VARCHAR" property="organizationId" />
<result column="period" jdbcType="INTEGER" property="period" />
<result column="convertion_type" jdbcType="VARCHAR" property="convertionType" />
<result column="currency_from" jdbcType="VARCHAR" property="currencyFrom" />
<result column="currency_to" jdbcType="VARCHAR" property="currencyTo" />
<result column="start_date" jdbcType="TIMESTAMP" property="startDate" />
......@@ -87,8 +89,8 @@
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
id, organization_id, currency_from, currency_to, start_date, end_date, rate, create_time,
update_time
id, organization_id, period, convertion_type, currency_from, currency_to, start_date,
end_date, rate, create_time, update_time
</sql>
<select id="selectByExample" parameterType="pwc.taxtech.atms.entity.OrganizationAccountingRateExample" resultMap="BaseResultMap">
<!--
......@@ -141,14 +143,14 @@
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
insert into organization_accounting_rate (id, organization_id, currency_from,
currency_to, start_date, end_date,
rate, create_time, update_time
)
values (#{id,jdbcType=BIGINT}, #{organizationId,jdbcType=VARCHAR}, #{currencyFrom,jdbcType=VARCHAR},
#{currencyTo,jdbcType=VARCHAR}, #{startDate,jdbcType=TIMESTAMP}, #{endDate,jdbcType=TIMESTAMP},
#{rate,jdbcType=REAL}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}
)
insert into organization_accounting_rate (id, organization_id, period,
convertion_type, currency_from, currency_to,
start_date, end_date, rate,
create_time, update_time)
values (#{id,jdbcType=BIGINT}, #{organizationId,jdbcType=VARCHAR}, #{period,jdbcType=INTEGER},
#{convertionType,jdbcType=VARCHAR}, #{currencyFrom,jdbcType=VARCHAR}, #{currencyTo,jdbcType=VARCHAR},
#{startDate,jdbcType=TIMESTAMP}, #{endDate,jdbcType=TIMESTAMP}, #{rate,jdbcType=REAL},
#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP})
</insert>
<insert id="insertSelective" parameterType="pwc.taxtech.atms.entity.OrganizationAccountingRate">
<!--
......@@ -163,6 +165,12 @@
<if test="organizationId != null">
organization_id,
</if>
<if test="period != null">
period,
</if>
<if test="convertionType != null">
convertion_type,
</if>
<if test="currencyFrom != null">
currency_from,
</if>
......@@ -192,6 +200,12 @@
<if test="organizationId != null">
#{organizationId,jdbcType=VARCHAR},
</if>
<if test="period != null">
#{period,jdbcType=INTEGER},
</if>
<if test="convertionType != null">
#{convertionType,jdbcType=VARCHAR},
</if>
<if test="currencyFrom != null">
#{currencyFrom,jdbcType=VARCHAR},
</if>
......@@ -238,6 +252,12 @@
<if test="record.organizationId != null">
organization_id = #{record.organizationId,jdbcType=VARCHAR},
</if>
<if test="record.period != null">
period = #{record.period,jdbcType=INTEGER},
</if>
<if test="record.convertionType != null">
convertion_type = #{record.convertionType,jdbcType=VARCHAR},
</if>
<if test="record.currencyFrom != null">
currency_from = #{record.currencyFrom,jdbcType=VARCHAR},
</if>
......@@ -272,6 +292,8 @@
update organization_accounting_rate
set id = #{record.id,jdbcType=BIGINT},
organization_id = #{record.organizationId,jdbcType=VARCHAR},
period = #{record.period,jdbcType=INTEGER},
convertion_type = #{record.convertionType,jdbcType=VARCHAR},
currency_from = #{record.currencyFrom,jdbcType=VARCHAR},
currency_to = #{record.currencyTo,jdbcType=VARCHAR},
start_date = #{record.startDate,jdbcType=TIMESTAMP},
......@@ -293,6 +315,12 @@
<if test="organizationId != null">
organization_id = #{organizationId,jdbcType=VARCHAR},
</if>
<if test="period != null">
period = #{period,jdbcType=INTEGER},
</if>
<if test="convertionType != null">
convertion_type = #{convertionType,jdbcType=VARCHAR},
</if>
<if test="currencyFrom != null">
currency_from = #{currencyFrom,jdbcType=VARCHAR},
</if>
......@@ -324,6 +352,8 @@
-->
update organization_accounting_rate
set organization_id = #{organizationId,jdbcType=VARCHAR},
period = #{period,jdbcType=INTEGER},
convertion_type = #{convertionType,jdbcType=VARCHAR},
currency_from = #{currencyFrom,jdbcType=VARCHAR},
currency_to = #{currencyTo,jdbcType=VARCHAR},
start_date = #{startDate,jdbcType=TIMESTAMP},
......
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