mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-05-08 12:00:11 +08:00
update 添加时间工具类
This commit is contained in:
@@ -1,5 +1,141 @@
|
||||
002212025100216092510819735989514358784
|
||||
002212025100216494510819746140195753984
|
||||
002212025100211594410819673151119028224
|
||||
002212025100213081910819690412575670272
|
||||
002212025100213554410819702347450773504
|
||||
002212025092522524610817300778411462656
|
||||
002212025092523381210817312211484381184
|
||||
002212025092601015510817333280098480128
|
||||
002212025092605040010817394205119447040
|
||||
002212025092606182910817412949334286336
|
||||
002212025092606283410817415485092900864
|
||||
002212025092606320010817416349857419264
|
||||
002212025092606472410817420223817416704
|
||||
002212025092606533410817421777744281600
|
||||
002212025092606551910817422215214215168
|
||||
002212025092607014510817423836484845568
|
||||
002212025092607103010817426039769513984
|
||||
002212025092607114710817426360587776000
|
||||
002212025092607181110817427970810130432
|
||||
002212025092607283610817430592267218944
|
||||
002212025092607330310817431714629267456
|
||||
002212025092607443110817434600184737792
|
||||
002212025092607470210817435231280394240
|
||||
002212025092607472410817435325526700032
|
||||
002212025092607555310817437459504242688
|
||||
002212025092608012310817438842039107584
|
||||
002212025092608235510817444513182859264
|
||||
002212025092608360110817447558478266368
|
||||
002212025092608403710817448716433309696
|
||||
002212025092609001210817453646720376832
|
||||
002212025092609075410817455582949519360
|
||||
002212025092609080710817455637798436864
|
||||
002212025092609122710817456726278885376
|
||||
002212025092609142010817457201518993408
|
||||
002212025092609345210817462370805583872
|
||||
002212025092609352610817462513231572992
|
||||
002212025092609392110817463499425542144
|
||||
002212025092610111110817471506553053184
|
||||
002212025092610300210817476250265186304
|
||||
002212025092610335810817477240380833792
|
||||
002212025092610461810817480345155649536
|
||||
002212025092610595510817483774011748352
|
||||
002212025092611014510817484233174491136
|
||||
002212025092611044910817485007464128512
|
||||
002212025092611194410817488758472126464
|
||||
002212025092611290110817491095056130048
|
||||
002212025092611433210817494747938410496
|
||||
002212025092611501610817496441996664832
|
||||
002212025092611550210817497643622821888
|
||||
002212025092611552910817497755774320640
|
||||
002212025092611560610817497912691621888
|
||||
002212025092611571910817498219530412032
|
||||
002212025092611585210817498606702268416
|
||||
002212025092612055210817500369916219392
|
||||
002212025092612081010817500949912817664
|
||||
002212025092612121410817501973256032256
|
||||
002212025092612122210817502004008525824
|
||||
002212025092612123510817502058383777792
|
||||
002212025092612141310817502469869862912
|
||||
002212025092612244110817505106405171200
|
||||
002212025092612251010817505225737605120
|
||||
002212025092612294310817506372015726592
|
||||
002212025092612294310817506373315964928
|
||||
002212025092612362710817508066912862208
|
||||
002212025092612415110817509424554536960
|
||||
002212025092612551310817512788558462976
|
||||
002212025092613015510817514474538635264
|
||||
002212025092613072010817515837700173824
|
||||
002212025092613082410817516108530429952
|
||||
002212025092613152310817517864551297024
|
||||
002212025092613251110817520328079802368
|
||||
002212025092613254110817520455683256320
|
||||
002212025092613593310817528977678508032
|
||||
002212025092614023410817529739422687232
|
||||
002212025092614083410817531247455178752
|
||||
002212025092614121810817532188845735936
|
||||
002212025092614135610817532597245259776
|
||||
002212025092614173410817533514787180544
|
||||
002212025092614195710817534110638387200
|
||||
002212025092614231710817534950858141696
|
||||
002212025092614463810817540826650083328
|
||||
002212025092614515110817542140159430656
|
||||
002212025092614582310817543784670380032
|
||||
002212025092615112110817547047977607169
|
||||
002212025092615175910817548716693590016
|
||||
002212025092615202310817549323123138560
|
||||
002212025092615403810817554419231866880
|
||||
002212025092615555710817558271821561856
|
||||
002212025092616030610817560070297030656
|
||||
002212025092616080310817561314822836224
|
||||
002212025092616120610817562335112290304
|
||||
002212025092616155210817563284652531712
|
||||
002212025092616225510817565056901156864
|
||||
002212025092616241910817565411214991360
|
||||
002212025092616304910817567047287300096
|
||||
002212025092616375510817568834597384192
|
||||
002212025092616394710817569303705116672
|
||||
002212025092616465110817571082945658880
|
||||
002212025092616540010817572881123618816
|
||||
002212025092616564710817573580108271616
|
||||
002212025092616574410817573821368836096
|
||||
002212025092617003610817574541266743296
|
||||
002212025092617061910817575980156436480
|
||||
002212025092617101510817576968808411136
|
||||
002212025092617134110817577835439538176
|
||||
002212025092617273710817581340678279168
|
||||
002212025092617321210817582495349186560
|
||||
002212025092617333510817582841446236160
|
||||
002212025092617345310817583167838580736
|
||||
002212025092617390310817584217526059008
|
||||
002212025092617445210817585681229406208
|
||||
002212025092617464610817586160675962880
|
||||
002212025092617560210817588492063064064
|
||||
002212025092617563610817588633004097536
|
||||
002212025092617584210817589163516604416
|
||||
002212025092618000010817589490299166720
|
||||
002212025092618061810817591074533781504
|
||||
002212025092618380910817599089915531264
|
||||
002212025092618483310817601709288038400
|
||||
002212025092618542510817603184256835584
|
||||
002212025092619023710817605249721016320
|
||||
002212025092619045110817605810038083584
|
||||
002212025092619062310817606195288961024
|
||||
002212025092619111010817607400782266368
|
||||
002212025092619193210817609505593061376
|
||||
002212025092619193710817609524907978752
|
||||
002212025092619225310817610349063557120
|
||||
002212025092619252610817610991110524928
|
||||
002212025092619264910817611337136558080
|
||||
002212025092619290210817611895289225216
|
||||
002212025092619490910817616958728646656
|
||||
002212025092619494110817617090832453632
|
||||
002212025092619551710817618501150556160
|
||||
002212025092620062310817621294707703808
|
||||
002212025092620135710817623198037028864
|
||||
002212025092620222510817625331318464512
|
||||
002212025092620272710817626597281337344
|
||||
002212025092620420310817630272376651776
|
||||
002212025092621112910817637676828954624
|
||||
002212025092621354910817643801028395008
|
||||
002212025092621413910817645268435312640
|
||||
002212025092621444910817646066690895872
|
||||
002212025092622084610817652092584701952
|
||||
002212025092622254910817656386289655808
|
||||
002212025092622443210817661095251091456
|
||||
002212025092622525010817663181866991616
|
||||
@@ -379,6 +379,52 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取指定日期的开始时间
|
||||
* @param dateTime
|
||||
* @return
|
||||
*/
|
||||
public static String parseToStartOfDay(String dateTime) {
|
||||
if (dateTime == null || dateTime.trim().isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
String trimmed = dateTime.trim();
|
||||
|
||||
// 判断是否包含时间部分
|
||||
if (trimmed.contains(":")) {
|
||||
// 包含时间部分,按完整日期时间格式解析
|
||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
||||
return DateUtils.formatDateTime(LocalDateTime.parse(trimmed, formatter).toLocalDate().atStartOfDay());
|
||||
} else {
|
||||
// 不包含时间部分,按日期格式解析
|
||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
||||
return DateUtils.formatDateTime(LocalDate.parse(trimmed, formatter).atStartOfDay());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取指定日期的结束时间
|
||||
* @param dateTime
|
||||
* @return
|
||||
*/
|
||||
public static String parseToEndOfDay(String dateTime) {
|
||||
if (dateTime == null || dateTime.trim().isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
String trimmed = dateTime.trim();
|
||||
|
||||
// 判断是否包含时间部分
|
||||
if (trimmed.contains(":")) {
|
||||
// 包含时间部分,按完整日期时间格式解析
|
||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
||||
return DateUtils.formatDateTime(LocalDateTime.parse(trimmed, formatter).toLocalDate().atTime(LocalTime.MAX));
|
||||
} else {
|
||||
// 不包含时间部分,按日期格式解析
|
||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
||||
return DateUtils.formatDateTime(LocalDate.parse(trimmed, formatter).atTime(LocalTime.MAX));
|
||||
}
|
||||
}
|
||||
|
||||
public enum IntervalType {
|
||||
DAY,
|
||||
HOUR,
|
||||
|
||||
@@ -2585,45 +2585,6 @@ public class OrderBasicInfoServiceImpl implements OrderBasicInfoService {
|
||||
// return resultList;
|
||||
// }
|
||||
|
||||
public static void main(String[] args) {
|
||||
List<StationSplitConfig> stationSplitConfigList = new ArrayList<>();
|
||||
StationSplitConfig a = new StationSplitConfig();
|
||||
a.setAdapayMemberId("11111");
|
||||
a.setFeeFlag("1");
|
||||
stationSplitConfigList.add(a);
|
||||
|
||||
StationSplitConfig b = new StationSplitConfig();
|
||||
b.setAdapayMemberId("22222");
|
||||
b.setFeeFlag("0");
|
||||
stationSplitConfigList.add(b);
|
||||
|
||||
StationSplitConfig c = new StationSplitConfig();
|
||||
c.setAdapayMemberId("33333");
|
||||
c.setFeeFlag("0");
|
||||
stationSplitConfigList.add(c);
|
||||
|
||||
stationSplitConfigList = stationSplitConfigList.stream()
|
||||
.sorted(Comparator.comparing(
|
||||
StationSplitConfig :: getFeeFlag
|
||||
))
|
||||
.collect(Collectors.toList());
|
||||
|
||||
System.out.println(stationSplitConfigList);
|
||||
|
||||
// BigDecimal orderElectricityAmount = new BigDecimal("100");
|
||||
// BigDecimal orderServiceAmount = new BigDecimal("50");;
|
||||
//
|
||||
// BigDecimal remainElectricityAmount = orderElectricityAmount;
|
||||
// BigDecimal remainServiceAmount = orderServiceAmount;
|
||||
//
|
||||
// for (int i = 0; i < 5; i++) {
|
||||
// remainElectricityAmount = remainElectricityAmount.subtract(BigDecimal.valueOf(20));
|
||||
// remainServiceAmount = remainServiceAmount.subtract(BigDecimal.valueOf(10));
|
||||
// }
|
||||
// System.out.println("需要分账的电费金额:" + orderElectricityAmount + ", 剩余电费金额" + remainElectricityAmount);
|
||||
// System.out.println("需要分账的服务费金额:" + orderServiceAmount + ", 剩余服务费金额" + remainServiceAmount);
|
||||
}
|
||||
|
||||
/**
|
||||
* 执行订单退款/新退款方法
|
||||
*/
|
||||
@@ -5793,6 +5754,8 @@ public class OrderBasicInfoServiceImpl implements OrderBasicInfoService {
|
||||
*/
|
||||
@Override
|
||||
public List<OrderPaymentDetailVO> getSplitOrders(QueryOrderSplitRecordDTO dto) {
|
||||
dto.setStartTime(DateUtils.parseToStartOfDay(dto.getStartTime()));
|
||||
dto.setEndTime(DateUtils.parseToEndOfDay(dto.getEndTime()));
|
||||
return orderBasicInfoMapper.getSplitOrders(dto);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user