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

Loading…
Cancel
Save