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

fixed the formula project context and remove some unused data in DB

need add the bspl report in the system
parent 19fc07f0
......@@ -43,7 +43,7 @@ public final class Constant {
public static final String IMAGE_FORMART_ = "png";
public static final String EMPTY = "";
public static final String DateTimeFormate = "{0}年{1}月";
public static final String DateTimeFormate = "%d年%d月";
public static class DataSourceName {
public static final String KeyValueDataSource = "KeyValueDataSource";
......@@ -73,8 +73,9 @@ public final class Constant {
}
public static class ReportBuildInStringFormat {
public static final String TimeInterval = "税款所属时间: 自{0}年{1}月{2}日至{0}年{1}月{3}日";
public static final String FillForm = "填表日期: {0}年{1}月{2}日";
public static final String TaxPayer = "纳税人名称: {0}";
public static final String TimeInterval = "税款所属时间: 自%d年%d月%d日至%d年%d月%d日";
public static final String FillForm = "填表日期: %d年%d月%d日";
public static final String FillFormStr = "填表日期: %s年%s月%s日";
public static final String TaxPayer = "纳税人名称: %s";
}
}
\ No newline at end of file
......@@ -211,6 +211,8 @@ public class ReportServiceImpl extends VatAbstractService implements ReportServi
// periodCellTemplateConfig.setValidationDescription(cellTemplateConfig.getValidationDescription());
// periodCellTemplateConfig.setVoucherKeyword(cellTemplateConfig.getVoucherKeyword());
periodCellTemplateConfig.setCellTemplateConfigId(cellTemplateConfig.getId());
periodCellTemplateConfig.setKeyValueParsedFormula(StringUtils.EMPTY);
if (cellTemplateConfig.getFormula().startsWith("@")) {
//todo: get the keyvalue from table add to keyvalue parsed formula
KeyValueConfigExample keyValueConfigExample = new KeyValueConfigExample();
......
......@@ -58,14 +58,15 @@ public class ProjectContext extends FunctionBase implements FreeRefFunction {
calendar.setTime(beginOfPeriod);
calendar2.setTime(endOfPeriod);
return new StringEval(String.format(Constant.ReportBuildInStringFormat.TimeInterval, formulaContext.getYear()
, formulaContext.getPeriod(), calendar.get(Calendar.DAY_OF_MONTH), calendar2.get(Calendar.DAY_OF_MONTH)));
, formulaContext.getPeriod(), calendar.get(Calendar.DAY_OF_MONTH), formulaContext.getYear()
, formulaContext.getPeriod(), calendar2.get(Calendar.DAY_OF_MONTH)));
case "FillForm":
Report report = SpringContextUtil.reportMapper.selectByPrimaryKey(formulaContext.getReportID());
if (report != null) {
return new StringEval(String.format(Constant.ReportBuildInStringFormat.FillForm, report.getUpdateTime().getYear()
, report.getUpdateTime().getMonth(), report.getUpdateTime().getDay()));
} else {
return new StringEval(String.format(Constant.ReportBuildInStringFormat.FillForm, " ", " ", " "));
return new StringEval(String.format(Constant.ReportBuildInStringFormat.FillFormStr, " ", " ", " "));
}
case "TaxPayerNo":
String taxPayerNo = SpringContextUtil.organizationMapper.selectByPrimaryKey(formulaContext.getOrganizationID()).getTaxPayerNumber();
......
......@@ -282,28 +282,26 @@
AND Name IN ('通用行业' ,'房地产业', '资产管理', '银行及其他金融服务业')
</select>
<resultMap id="TemplateGroup" type="pwc.taxtech.atms.entitiy.Template">
<resultMap id="TemplateGroup" type="pwc.taxtech.atms.entitiy.TemplateGroup">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
<id column="id" jdbcType="BIGINT" property="id" />
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="code" jdbcType="VARCHAR" property="code" />
<result column="path" jdbcType="VARCHAR" property="path" />
<result column="report_type" jdbcType="INTEGER" property="reportType" />
<result column="template_group_id" jdbcType="BIGINT" property="templateGroupId" />
<result column="order_index" jdbcType="INTEGER" property="orderIndex" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="service_type_id" jdbcType="VARCHAR" property="serviceTypeId" />
<result column="industry_ids" jdbcType="VARCHAR" property="industryIds" />
<result column="pay_tax_type" jdbcType="INTEGER" property="payTaxType" />
<result column="group_type" jdbcType="INTEGER" property="groupType" />
<result column="copy_from" jdbcType="BIGINT" property="copyFrom" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="is_system_type" jdbcType="INTEGER" property="isSystemType" />
<result column="is_active_association" jdbcType="INTEGER" property="isActiveAssociation" />
<result column="parent_id" jdbcType="VARCHAR" property="parentId" />
<result column="create_by" jdbcType="VARCHAR" property="createBy" />
<result column="update_by" jdbcType="VARCHAR" property="updateBy" />
</resultMap>
<select id="getTemplateGroup" resultMap="TemplateGroup">
SELECT *
SELECT b.*
FROM Industry a
JOIN template_group b
ON a.ID = b.industry_ids
......
......@@ -631,7 +631,8 @@
parsed_validation,
validation_description,
voucher_keyword,
cell_template_config_id
cell_template_config_id,
key_value_parsed_formula
)
VALUES
<foreach collection="list" item="item" separator=",">
......@@ -658,7 +659,8 @@
,#{item.parsedValidation,jdbcType=VARCHAR}
,#{item.validationDescription,jdbcType=VARCHAR}
,#{item.voucherKeyword,jdbcType=VARCHAR}
,#{item.cellTemplateConfigId,jdbcType=INTEGER})
,#{item.cellTemplateConfigId,jdbcType=INTEGER}
,#{item.keyValueParsedFormula,jdbcType=VARCHAR})
</foreach>
</insert>
<resultMap extends="BaseResultMap" id="periodCellTemplateConfigExtendDtoMap" type="pwc.taxtech.atms.dto.vatdto.PeriodCellTemplateConfigExtendDto">
......
......@@ -32,10 +32,19 @@ public class DataMigration extends CommonIT {
private List<Map<String, Object>> cellTemplate20180622List;
//1. 这个是原本的id
String templateGroupId = "'FA37FBE3-31D0-4A5C-9356-CF66FE8CE76D'";
String templateGroupId = "'3916DCBA-B8B5-4C99-BF65-FF85F6A5FBE7'";
//2.这个是新的templategroupid
Long templateGroupIdLong = 15081298737631232L;
Long templateGroupIdLong = 16207462143234048L;
@Test
public void doMigration(){
doMigrationTemplateGroup();
doMigrationTemplate();
doMigrationCellTemplate();
doMigrationCellTemplateConfig();
}
@Test
public void doMigrationTemplateGroup() {
......@@ -46,7 +55,8 @@ public class DataMigration extends CommonIT {
TemplateGroup templateGroup;
for (Map<String, Object> item : queryForList) {
templateGroup = new TemplateGroup();
templateGroup.setId(distributedIDService.nextId());
this.templateGroupIdLong = distributedIDService.nextId();
templateGroup.setId(this.templateGroupIdLong);
templateGroup.setName((MapUtils.getString(item, "Name")));
templateGroup.setServiceTypeId((MapUtils.getString(item, "ServiceTypeID")));
templateGroup.setIndustryIds((MapUtils.getString(item, "IndustryIDs")));
......@@ -194,7 +204,9 @@ public class DataMigration extends CommonIT {
// .findFirst().get();
Template template = templates.stream()
.filter(a -> a.getName().equals(name) && a.getCode().equals(code) && a.getCreateTime().equals(DateUtils.strToDateLong(createTime)) && a.getTemplateGroupId().equals(templateGroupIdLong))
.filter(a -> a.getName().equals(name) && a.getCode().equals(code)
&& a.getCreateTime().equals(DateUtils.strToDateLong(createTime))
&& a.getTemplateGroupId().equals(templateGroupIdLong))
.findFirst().get();
//sql = "SELECT id from template a WHERE create_time='" + createTime + "' AND `name`='" + name + "' AND code='" + code + "'";
//System.out.println(sql);
......
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