|
|
@@ -2491,36 +2491,52 @@ public class InsOrdersServiceImpl extends ServiceImpl<InsOrdersMapper, InsOrders
|
|
|
|
|
|
String quoteStartDateStr = orderQueryVo.getQuoteStartDateStr();
|
|
|
String quoteEndDateStr = orderQueryVo.getQuoteEndDateStr();
|
|
|
-
|
|
|
final int day = 30;
|
|
|
if("3".equals(orderQueryVo.getOrderStatus())){
|
|
|
- if((StringUtils.isEmpty(signStartDateStr) || StringUtils.isEmpty(signEndDateStr))) {
|
|
|
+ if ((StringUtils.isEmpty(signStartDateStr) || StringUtils.isEmpty(signEndDateStr)) && StringUtils.isEmpty(quoteStartDateStr)) {
|
|
|
throw new SystemException("导出已承保数据时,1.签单时间必填;2.选择的签单时间(开始日期-结束日期)>30天,导出时,按结束时间往前+30天的数据做导出");
|
|
|
+ }else if ((StringUtils.isEmpty(quoteStartDateStr) || StringUtils.isEmpty(quoteEndDateStr)) && StringUtils.isEmpty(signStartDateStr) ){
|
|
|
+ throw new SystemException("导出已承保数据时,1.录单时间必填;2.选择的录单时间(开始日期-结束日期)>30天,导出时,按结束时间往前+30天的数据做导出");
|
|
|
+ }
|
|
|
+ if(StringUtils.isNotEmpty(signStartDateStr)){
|
|
|
+ String time =this.getTimeDate(signStartDateStr,signEndDateStr,day);
|
|
|
+ if(StringUtils.isNotEmpty(time)){
|
|
|
+ orderQueryVo.setSignStartDateStr(time);
|
|
|
+ }
|
|
|
}
|
|
|
- DateTimeFormatter pattern = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
|
|
- LocalDate startDate = LocalDate.parse(signStartDateStr, pattern);
|
|
|
- LocalDate endDate = LocalDate.parse(signEndDateStr, pattern);
|
|
|
- long between = ChronoUnit.DAYS.between(startDate, endDate);
|
|
|
- if (between > day) {
|
|
|
- LocalDate localDate = endDate.minusDays(day);
|
|
|
- orderQueryVo.setSignStartDateStr(localDate.format(pattern));
|
|
|
+ if(StringUtils.isNotEmpty(quoteStartDateStr)){
|
|
|
+ String time =this.getTimeDate(quoteStartDateStr,quoteEndDateStr,day);
|
|
|
+ if(StringUtils.isNotEmpty(time)){
|
|
|
+ orderQueryVo.setQuoteStartDateStr(time);
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
+// DateTimeFormatter pattern = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
|
|
+// LocalDate startDate = LocalDate.parse(signStartDateStr, pattern);
|
|
|
+// LocalDate endDate = LocalDate.parse(signEndDateStr, pattern);
|
|
|
+// long between = ChronoUnit.DAYS.between(startDate, endDate);
|
|
|
+// if (between > day) {
|
|
|
+// LocalDate localDate = endDate.minusDays(day);
|
|
|
+// orderQueryVo.setSignStartDateStr(localDate.format(pattern));
|
|
|
+// }
|
|
|
}else{
|
|
|
if((StringUtils.isEmpty(quoteStartDateStr) || StringUtils.isEmpty(quoteEndDateStr))) {
|
|
|
throw new SystemException("导出非已承保数据时,1.录单时间必填;2.选择的录单时间(开始日期-结束日期)>30天,导出时,按结束时间往前+30天的数据做导出");
|
|
|
}
|
|
|
- DateTimeFormatter pattern = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
|
|
- LocalDate startDate = LocalDate.parse(quoteStartDateStr, pattern);
|
|
|
- LocalDate endDate = LocalDate.parse(quoteEndDateStr, pattern);
|
|
|
- long between = ChronoUnit.DAYS.between(startDate, endDate);
|
|
|
- if (between > day) {
|
|
|
- LocalDate localDate = endDate.minusDays(day);
|
|
|
- orderQueryVo.setQuoteStartDateStr(localDate.format(pattern));
|
|
|
+
|
|
|
+ String time = this.getTimeDate(quoteStartDateStr, quoteEndDateStr, day);
|
|
|
+ if (StringUtils.isNotEmpty(time)) {
|
|
|
+ orderQueryVo.setQuoteStartDateStr(time);
|
|
|
}
|
|
|
+// DateTimeFormatter pattern = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
|
|
+// LocalDate startDate = LocalDate.parse(quoteStartDateStr, pattern);
|
|
|
+// LocalDate endDate = LocalDate.parse(quoteEndDateStr, pattern);
|
|
|
+// long between = ChronoUnit.DAYS.between(startDate, endDate);
|
|
|
+// if (between > day) {
|
|
|
+// LocalDate localDate = endDate.minusDays(day);
|
|
|
+// orderQueryVo.setQuoteStartDateStr(localDate.format(pattern));
|
|
|
+// }
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
switch (orderLinkTypeConstants) {
|
|
|
case ORDER_LINK_TYPE_CONSTANTS_1:
|
|
|
agentUserIds = sysUserService.getUserIdsByLeaderId(orderQueryVo.getUserId());
|
|
|
@@ -2558,5 +2574,18 @@ public class InsOrdersServiceImpl extends ServiceImpl<InsOrdersMapper, InsOrders
|
|
|
throw new SystemException("文件导出失败");
|
|
|
}
|
|
|
|
|
|
+ private String getTimeDate(String startDateStr, String endDateStr, int day) {
|
|
|
+ DateTimeFormatter pattern = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
|
|
+ LocalDate startDate = LocalDate.parse(startDateStr, pattern);
|
|
|
+ LocalDate endDate = LocalDate.parse(endDateStr, pattern);
|
|
|
+ long between = ChronoUnit.DAYS.between(startDate, endDate);
|
|
|
+ if (between > day) {
|
|
|
+ LocalDate localDate = endDate.minusDays(day);
|
|
|
+ return localDate.format(pattern);
|
|
|
+ } else {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
}
|