fix: 采集的是科学计数法日期的特殊处理

main
huangfeng 3 months ago
parent 0a337daa20
commit abbc8d7b31

@ -20,6 +20,7 @@ import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.math.BigDecimal;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
@ -301,13 +302,13 @@ public class DataServiceImpl implements DataService {
} else if (Constants.Text.equalsIgnoreCase(type)) { } else if (Constants.Text.equalsIgnoreCase(type)) {
value = "'" + value + "'"; value = "'" + value + "'";
} else if (Constants.DateTime.equalsIgnoreCase(type)) { } else if (Constants.DateTime.equalsIgnoreCase(type)) {
if (value.length() == 10) { BigDecimal bigval = new BigDecimal(value);
value = value + "000"; Long ts = bigval.longValue();
if (ts.toString().length() < 11) {
ts = ts * 1000;
} }
if (value.length() == 13) { Date date = new Date(ts);
Date date = new Date(Long.parseLong(value));
value = DateUtil.format(date); value = DateUtil.format(date);
}
value = "'" + value + "'"; value = "'" + value + "'";
} }
if (count > 0) { if (count > 0) {

Loading…
Cancel
Save