|
@@ -25,6 +25,8 @@ import org.springframework.stereotype.Service;
|
|
import java.math.BigDecimal;
|
|
import java.math.BigDecimal;
|
|
import java.text.ParseException;
|
|
import java.text.ParseException;
|
|
import java.text.SimpleDateFormat;
|
|
import java.text.SimpleDateFormat;
|
|
|
|
+import java.time.LocalDate;
|
|
|
|
+import java.time.format.DateTimeFormatter;
|
|
import java.util.*;
|
|
import java.util.*;
|
|
import java.util.stream.Collectors;
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
@@ -658,15 +660,19 @@ public class CompanyServiceImpl implements CompanyService {
|
|
* @param recordStatus 企业状态
|
|
* @param recordStatus 企业状态
|
|
* @param regionCode 所属县区
|
|
* @param regionCode 所属县区
|
|
* @param siteID 所属驿站
|
|
* @param siteID 所属驿站
|
|
|
|
+ * @param createTimeBy 创建时间
|
|
* @return 企业VO列表
|
|
* @return 企业VO列表
|
|
*/
|
|
*/
|
|
@Override
|
|
@Override
|
|
public PageInfo<CompanyPostMapVo> getDataMapList(int pageIndex, int pageSize,
|
|
public PageInfo<CompanyPostMapVo> getDataMapList(int pageIndex, int pageSize,
|
|
String companyName, Integer maxDistance, Integer companyModel,
|
|
String companyName, Integer maxDistance, Integer companyModel,
|
|
Integer recordStatus, String regionCode, String siteID,
|
|
Integer recordStatus, String regionCode, String siteID,
|
|
- Double latitude, Double longitude) {
|
|
|
|
|
|
+ Double latitude, Double longitude,
|
|
|
|
+ String createTimeBy) {
|
|
PageHelper.startPage(pageIndex, pageSize);
|
|
PageHelper.startPage(pageIndex, pageSize);
|
|
- List<CompanyPostMapVo> dataMapList = companyCQuery.getDataMapList(companyName, maxDistance, companyModel, recordStatus, regionCode, siteID, latitude, longitude);
|
|
|
|
|
|
+ // 按要求获取到距离当前日期的时间
|
|
|
|
+ String createTime = getCreateTime(createTimeBy);
|
|
|
|
+ List<CompanyPostMapVo> dataMapList = companyCQuery.getDataMapList(companyName, maxDistance, companyModel, recordStatus, regionCode, siteID, latitude, longitude, createTime);
|
|
PageInfo<CompanyPostMapVo> result = new PageInfo<>(dataMapList);
|
|
PageInfo<CompanyPostMapVo> result = new PageInfo<>(dataMapList);
|
|
|
|
|
|
// 获取所有的企业ID
|
|
// 获取所有的企业ID
|
|
@@ -727,10 +733,46 @@ public class CompanyServiceImpl implements CompanyService {
|
|
public PageInfo<CompanyPostMapVo> getDataMapListByPostName(int pageIndex, int pageSize, String postName,
|
|
public PageInfo<CompanyPostMapVo> getDataMapListByPostName(int pageIndex, int pageSize, String postName,
|
|
Integer maxDistance, Integer companyModel, Integer recordStatus,
|
|
Integer maxDistance, Integer companyModel, Integer recordStatus,
|
|
String regionCode, String siteID, Double latitude,
|
|
String regionCode, String siteID, Double latitude,
|
|
- Double longitude) {
|
|
|
|
|
|
+ Double longitude, String createTimeBy) {
|
|
PageHelper.startPage(pageIndex, pageSize);
|
|
PageHelper.startPage(pageIndex, pageSize);
|
|
- List<CompanyPostMapVo> dataMapList = companyCQuery.getDataMapListByPostName(postName, maxDistance, companyModel, recordStatus, regionCode, siteID, latitude, longitude);
|
|
|
|
|
|
+ // 按要求获取到距离当前日期的时间
|
|
|
|
+ String createTime = getCreateTime(createTimeBy);
|
|
|
|
+ List<CompanyPostMapVo> dataMapList = companyCQuery.getDataMapListByPostName(postName, maxDistance, companyModel, recordStatus, regionCode, siteID, latitude, longitude, createTime);
|
|
PageInfo<CompanyPostMapVo> result = new PageInfo(dataMapList);
|
|
PageInfo<CompanyPostMapVo> result = new PageInfo(dataMapList);
|
|
return result;
|
|
return result;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 获取指定创建日期
|
|
|
|
+ */
|
|
|
|
+ public String getCreateTime(String by){
|
|
|
|
+ if (stringUtils.IsNullOrEmpty(by) || by.equals("all")){
|
|
|
|
+ return null;
|
|
|
|
+ }
|
|
|
|
+ LocalDate currentDate = LocalDate.now();
|
|
|
|
+ LocalDate resultDate = null;
|
|
|
|
+
|
|
|
|
+ switch (by){
|
|
|
|
+ case "3Day":
|
|
|
|
+ resultDate = currentDate.minusDays(3);
|
|
|
|
+ break;
|
|
|
|
+ case "1Week":
|
|
|
|
+ resultDate = currentDate.minusWeeks(1);
|
|
|
|
+ break;
|
|
|
|
+ case "1Month":
|
|
|
|
+ resultDate = currentDate.minusMonths(1);
|
|
|
|
+ break;
|
|
|
|
+ case "3Month":
|
|
|
|
+ resultDate = currentDate.minusMonths(3);
|
|
|
|
+ break;
|
|
|
|
+ case "Year":
|
|
|
|
+ resultDate = currentDate.minusYears(1);
|
|
|
|
+ break;
|
|
|
|
+ default:
|
|
|
|
+ return null;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
|
|
|
+ return resultDate.format(formatter);
|
|
|
|
+ }
|
|
}
|
|
}
|