|
|
|
@ -4,15 +4,15 @@ import com.fr.config.MarketConfig;
|
|
|
|
|
import com.fr.design.DesignerEnvManager; |
|
|
|
|
import com.fr.design.mainframe.burying.point.AbstractPointInfo; |
|
|
|
|
import com.fr.general.CloudCenter; |
|
|
|
|
import com.fr.json.JSON; |
|
|
|
|
import com.fr.json.JSONFactory; |
|
|
|
|
import com.fr.json.JSONObject; |
|
|
|
|
import com.fr.stable.StringUtils; |
|
|
|
|
import com.fr.stable.xml.XMLPrintWriter; |
|
|
|
|
import com.fr.stable.xml.XMLableReader; |
|
|
|
|
|
|
|
|
|
import java.text.SimpleDateFormat; |
|
|
|
|
import java.util.Calendar; |
|
|
|
|
import java.util.HashMap; |
|
|
|
|
import java.util.Map; |
|
|
|
|
import com.fr.third.joda.time.DateTime; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 对应一张模版的记录 |
|
|
|
@ -78,7 +78,7 @@ public class TemplateInfo extends AbstractPointInfo {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public static TemplateInfo newInstance(String templateID, String originID, String saveRecord) { |
|
|
|
|
String createTime = new SimpleDateFormat(SIMPLE_DATE_PATTRN).format(Calendar.getInstance().getTime()); |
|
|
|
|
String createTime = DateTime.now().toString(SIMPLE_DATE_PATTRN); |
|
|
|
|
return newInstance(templateID, originID, saveRecord, createTime); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -109,9 +109,9 @@ public class TemplateInfo extends AbstractPointInfo {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public long getSaveTime() { |
|
|
|
|
String save_record = (String) consumingMap.get(ATTR_SAVE_RECORD); |
|
|
|
|
JSONObject jo = new JSONObject(save_record); |
|
|
|
|
return jo.optLong("time"); |
|
|
|
|
String saveRecord = (String) consumingMap.get(ATTR_SAVE_RECORD); |
|
|
|
|
JSONObject jo = JSONFactory.createJSON(JSON.OBJECT, saveRecord); |
|
|
|
|
return jo.getLong("time"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public String getTemplateCreateTime() { |
|
|
|
@ -131,7 +131,7 @@ public class TemplateInfo extends AbstractPointInfo {
|
|
|
|
|
if (idleDayCount >= 0) { |
|
|
|
|
writer.attr(ATTR_DAY_COUNT, this.idleDayCount); |
|
|
|
|
} |
|
|
|
|
writer.attr(TEST_TEMPLATE_FLAG, this.isTestTemplate); |
|
|
|
|
writer.attr(TEST_TEMPLATE_FLAG, this.testTemplate); |
|
|
|
|
writeProcessMap(writer); |
|
|
|
|
writeConsumingMap(writer); |
|
|
|
|
|
|
|
|
@ -164,7 +164,7 @@ public class TemplateInfo extends AbstractPointInfo {
|
|
|
|
|
public void readXML(XMLableReader reader) { |
|
|
|
|
if (!reader.isChildNode()) { |
|
|
|
|
idleDayCount = reader.getAttrAsInt(ATTR_DAY_COUNT, 0); |
|
|
|
|
isTestTemplate = reader.getAttrAsBoolean(TEST_TEMPLATE_FLAG, false); |
|
|
|
|
testTemplate = reader.getAttrAsBoolean(TEST_TEMPLATE_FLAG, false); |
|
|
|
|
templateID = reader.getAttrAsString(ATTR_TEMPLATE_ID, StringUtils.EMPTY); |
|
|
|
|
originID = reader.getAttrAsString(ATTR_ORIGIN_ID, StringUtils.EMPTY); |
|
|
|
|
} else { |
|
|
|
@ -196,7 +196,7 @@ public class TemplateInfo extends AbstractPointInfo {
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public boolean isTestTemplate() { |
|
|
|
|
return isTestTemplate; |
|
|
|
|
return testTemplate; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public static boolean isTestTemplate(int reportType, int cellCount, int floatCount, int blockCount, int widgetCount) { |
|
|
|
@ -219,8 +219,8 @@ public class TemplateInfo extends AbstractPointInfo {
|
|
|
|
|
@Override |
|
|
|
|
public Map<String, String> getSendInfo() { |
|
|
|
|
Map<String, String> sendMap = new HashMap<>(); |
|
|
|
|
sendMap.put(CONSUMING_URL, new JSONObject(consumingMap).toString()); |
|
|
|
|
sendMap.put(PROCESS_URL, new JSONObject(processMap).toString()); |
|
|
|
|
sendMap.put(CONSUMING_URL, JSONFactory.createJSON(JSON.OBJECT, consumingMap).toString()); |
|
|
|
|
sendMap.put(PROCESS_URL, JSONFactory.createJSON(JSON.OBJECT, processMap).toString()); |
|
|
|
|
return sendMap; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|