宜都城投资产数据同步插件 修复日期解析问题
This commit is contained in:
@@ -2,6 +2,7 @@ package com.seeyon.apps.src_ydctdatasync.datamap;
|
||||
|
||||
import com.seeyon.apps.src_ydctdatasync.dao.MyJdbcAgent;
|
||||
import com.seeyon.apps.src_ydctdatasync.utils.EnumMapUtils;
|
||||
import com.seeyon.apps.src_ydctdatasync.utils.TimeUtils;
|
||||
|
||||
import java.text.DateFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
@@ -78,8 +79,8 @@ public abstract class AbstractAssetDataMapMode extends AbstractDataMapMode{
|
||||
targetMap.put("产权证号",sourceMap.get("property_certificate_no"));//填充产权证号
|
||||
targetMap.put("产权人",sourceMap.get("property_owner"));//填充产权人
|
||||
try {
|
||||
targetMap.put("资产获取日期",df.format((Date)sourceMap.get("house_receipt_date")));//填充资产获取日期
|
||||
targetMap.put("登记时间",df.format((Date)sourceMap.get("property_registration_time")));//填充登记时间
|
||||
targetMap.put("资产获取日期",df.format(TimeUtils.convertLocalDateTime2Date(sourceMap.get("house_receipt_date"))));//填充资产获取日期
|
||||
targetMap.put("登记时间",df.format(TimeUtils.convertLocalDateTime2Date(sourceMap.get("property_registration_time"))));//填充登记时间
|
||||
}catch (NullPointerException e) {
|
||||
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.seeyon.apps.src_ydctdatasync.datamap;
|
||||
|
||||
|
||||
import com.seeyon.apps.src_ydctdatasync.utils.EnumMapUtils;
|
||||
import com.seeyon.apps.src_ydctdatasync.utils.TimeUtils;
|
||||
|
||||
import java.text.DateFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
@@ -60,7 +61,7 @@ public class ContractBillMode extends AbstractFeeDataMapMode{
|
||||
targetMap.put("应收金额",sourceMap.get("bill_amount")); //填充应收金额
|
||||
targetMap.put("本次实收金额",sourceMap.get("bill_amount")); //填充本次实收金额
|
||||
try {
|
||||
targetMap.put("住保-账单生成日期",df.format((Date)sourceMap.get("trade_reconciliation_time"))); //填充账单生成日期
|
||||
targetMap.put("住保-账单生成日期",df.format(TimeUtils.convertLocalDateTime2Date(sourceMap.get("trade_reconciliation_time")))); //填充账单生成日期
|
||||
}catch (NullPointerException e) {
|
||||
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.seeyon.apps.src_ydctdatasync.datamap;
|
||||
|
||||
import com.seeyon.apps.src_ydctdatasync.dao.KsQueryDao;
|
||||
import com.seeyon.apps.src_ydctdatasync.utils.EnumMapUtils;
|
||||
import com.seeyon.apps.src_ydctdatasync.utils.TimeUtils;
|
||||
|
||||
import java.text.DateFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
@@ -66,8 +67,8 @@ public class ContractMode extends AbstractContractDataMapMode {
|
||||
targetMap.put("签订单位",sourceMap.get("a_name"));//填充签订单位
|
||||
targetMap.put("合同金额",sourceMap.get("contract_total_amount"));//合同金额
|
||||
try {
|
||||
targetMap.put("合同开始日期",df.format((Date)sourceMap.get("tenant_start_time")));//合同开始日期
|
||||
targetMap.put("合同截止日期",df.format((Date)sourceMap.get("tenant_end_time")));//合同截止日期
|
||||
targetMap.put("合同开始日期",df.format(TimeUtils.convertLocalDateTime2Date(sourceMap.get("tenant_start_time"))));//合同开始日期
|
||||
targetMap.put("合同截止日期",df.format(TimeUtils.convertLocalDateTime2Date(sourceMap.get("tenant_end_time"))));//合同截止日期
|
||||
}catch (NullPointerException e) {
|
||||
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.seeyon.apps.src_ydctdatasync.datamap;
|
||||
|
||||
import com.seeyon.apps.src_ydctdatasync.utils.EnumMapUtils;
|
||||
import com.seeyon.apps.src_ydctdatasync.utils.TimeUtils;
|
||||
|
||||
import java.text.DateFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
@@ -39,9 +40,9 @@ public class HydropowerRechargeDataMapMode extends AbstractFeeDataMapMode{
|
||||
|
||||
targetMap.put("收支类型",sourceMap.get("incomeOrCost")); //填充收支类型
|
||||
try {
|
||||
targetMap.put("到账日期",df.format((Date)sourceMap.get("recharge_time"))); //填充到账日期
|
||||
targetMap.put("住保-账单生成日期",df.format((Date)sourceMap.get("recharge_time"))); //填充账单生成日期
|
||||
targetMap.put("实收日期",df.format((Date)sourceMap.get("recharge_time"))); //填充实收日期
|
||||
targetMap.put("到账日期",df.format(TimeUtils.convertLocalDateTime2Date(sourceMap.get("recharge_time")))); //填充到账日期
|
||||
targetMap.put("住保-账单生成日期",df.format(TimeUtils.convertLocalDateTime2Date(sourceMap.get("recharge_time")))); //填充账单生成日期
|
||||
targetMap.put("实收日期",df.format(TimeUtils.convertLocalDateTime2Date(sourceMap.get("recharge_time")))); //填充实收日期
|
||||
}catch (NullPointerException e) {
|
||||
|
||||
}
|
||||
|
||||
@@ -127,7 +127,7 @@ public class YdzbDataSyncQuartz extends AbstractQuartzTask implements Disposable
|
||||
Date startDate = null;
|
||||
Date endDate = null;
|
||||
try {
|
||||
if (arg0 != null) {
|
||||
if (!"".equals(arg0) && arg0 != null) {
|
||||
String[] splits = arg0.split(",");
|
||||
for (int i = 0; i < splits.length; i++) {
|
||||
if(i == 0) {
|
||||
|
||||
@@ -3,6 +3,8 @@ package com.seeyon.apps.src_ydctdatasync.utils;
|
||||
import java.text.DateFormat;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.ZoneId;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.TimeZone;
|
||||
@@ -133,6 +135,18 @@ public class TimeUtils {
|
||||
return c.getTime();
|
||||
}
|
||||
|
||||
public static Date convertLocalDateTime2Date(Object date) {
|
||||
if(date instanceof Date) {
|
||||
return (Date)date;
|
||||
}else if(date instanceof LocalDateTime) {
|
||||
LocalDateTime time = (LocalDateTime) date;
|
||||
// 将LocalDateTime转换为Instant
|
||||
ZoneId zoneId = ZoneId.systemDefault(); // 获取系统默认时区
|
||||
return Date.from(time.atZone(zoneId).toInstant());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 所在月的结束
|
||||
* @param date
|
||||
|
||||
Reference in New Issue
Block a user