|
|
@@ -7,11 +7,16 @@ import com.ydtech.modules.admin.model.report.company.CompanyQutationCountDataDto
|
|
|
import com.ydtech.modules.admin.model.report.company.CompanyQutationCountDataQueryDto;
|
|
|
import com.ydtech.modules.admin.model.report.opetationData.QuotationCountDataDto;
|
|
|
import com.ydtech.modules.admin.service.CompanyDataReportService;
|
|
|
+import com.ydtech.modules.admin.utils.SliceUpDateUtil;
|
|
|
import com.ydtech.modules.order.dao.InsAreaCompanyMapper;
|
|
|
import com.ydtech.modules.order.entity.BasePageResult;
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
+import java.util.Date;
|
|
|
+import java.util.HashMap;
|
|
|
+
|
|
|
/**
|
|
|
* @version
|
|
|
* @author: hxl
|
|
|
@@ -49,10 +54,47 @@ public class CompanyDataReportServiceImpl implements CompanyDataReportService {
|
|
|
@Override
|
|
|
public BasePageResult<CompanyQutationCountDataDto> queryCompanyQutationCountDataPage(CompanyQutationCountDataQueryDto companyQutationCountDataQueryDto) {
|
|
|
Page<QuotationCountDataDto> page = new Page<>(companyQutationCountDataQueryDto.getPageNum(), companyQutationCountDataQueryDto.getPageSize());
|
|
|
+ //判断开始时间和结束时间是否为空,如果为空的走时间类型逻辑
|
|
|
+ HashMap<String, String> dateMapByType = getDateMapByType(companyQutationCountDataQueryDto.getDateType(), companyQutationCountDataQueryDto.getBeginDate(), companyQutationCountDataQueryDto.getEndDate());
|
|
|
+ companyQutationCountDataQueryDto.setBeginDate(dateMapByType.get("startDate"));
|
|
|
+ companyQutationCountDataQueryDto.setEndDate(dateMapByType.get("endDate"));
|
|
|
Page<CompanyQutationCountDataDto> resultSubOrder = insAreaCompanyMapper.queryCompanyQutationCountDataPage(companyQutationCountDataQueryDto, page);
|
|
|
return new BasePageResult<>(companyQutationCountDataQueryDto.getPageNum(), page.getSize(), resultSubOrder.getTotal(), page.getPages(),
|
|
|
resultSubOrder.getRecords());
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @version
|
|
|
+ * @author: hxl
|
|
|
+ * @Date: 2024/6/19 11:57
|
|
|
+ * @Description: 通过时间类型判断
|
|
|
+ */
|
|
|
+ private static HashMap<String,String> getDateMapByType(String type, String startDate, String endDate) {
|
|
|
+ HashMap<String,String> map =new HashMap<>();
|
|
|
+ String startDateStr="";
|
|
|
+ String endDateStr="";
|
|
|
+ if(StringUtils.isNotBlank(startDate) && StringUtils.isNotBlank(endDate)){
|
|
|
+ startDateStr= StringUtils.isNotBlank(startDate)?startDate+" 00:00:00":null;
|
|
|
+ endDateStr= StringUtils.isNotBlank(endDate)?endDate+" 23:59:59":null;
|
|
|
+ }else{
|
|
|
+ if("1".equals(type)){
|
|
|
+ // 一月内
|
|
|
+ startDateStr=SliceUpDateUtil.getBeforeDay(new Date(),2)+" 00:00:00";
|
|
|
+ endDateStr=SliceUpDateUtil.getBeforeDay(new Date(),0)+" 23:59:59";
|
|
|
+ }else if("2".equals(type)){
|
|
|
+ // 三月内
|
|
|
+ startDateStr=SliceUpDateUtil.getBeforeDay(new Date(),3)+" 00:00:00";
|
|
|
+ endDateStr=SliceUpDateUtil.getBeforeDay(new Date(),0)+" 23:59:59";
|
|
|
+ }else if("3".equals(type)){
|
|
|
+ // 近半年
|
|
|
+ startDateStr=SliceUpDateUtil.getBeforeDay(new Date(),6)+" 00:00:00";
|
|
|
+ endDateStr=SliceUpDateUtil.getBeforeDay(new Date(),0)+" 23:59:59";
|
|
|
+ }
|
|
|
+ }
|
|
|
+ map.put("startDate",startDateStr);
|
|
|
+ map.put("endDate",endDateStr);
|
|
|
+ return map;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
|