Commit 626738d6 authored by jiaorz's avatar jiaorz

车辆信息统计

parent 902edcc8
...@@ -31,6 +31,7 @@ public class BranchCompanyVehicleCountBiz extends BaseBiz<BranchCompanyVehicleCo ...@@ -31,6 +31,7 @@ public class BranchCompanyVehicleCountBiz extends BaseBiz<BranchCompanyVehicleCo
} }
public ObjectRestResponse<PageDataVO<BranchCompanyVehicleCount>> findAll(BranchCompanyVehicleCountDTO branchCompanyVehicleCountDTO) { public ObjectRestResponse<PageDataVO<BranchCompanyVehicleCount>> findAll(BranchCompanyVehicleCountDTO branchCompanyVehicleCountDTO) {
vehicleInformationDownloadBiz.addAll();
Integer pageNo = branchCompanyVehicleCountDTO.getPage() == null ? 1 : branchCompanyVehicleCountDTO.getPage(); Integer pageNo = branchCompanyVehicleCountDTO.getPage() == null ? 1 : branchCompanyVehicleCountDTO.getPage();
Integer pageSize = branchCompanyVehicleCountDTO.getLimit() == null ? 10 : branchCompanyVehicleCountDTO.getLimit(); Integer pageSize = branchCompanyVehicleCountDTO.getLimit() == null ? 10 : branchCompanyVehicleCountDTO.getLimit();
Integer type = branchCompanyVehicleCountDTO.getType() == null ? 1 : branchCompanyVehicleCountDTO.getType(); Integer type = branchCompanyVehicleCountDTO.getType() == null ? 1 : branchCompanyVehicleCountDTO.getType();
...@@ -46,7 +47,7 @@ public class BranchCompanyVehicleCountBiz extends BaseBiz<BranchCompanyVehicleCo ...@@ -46,7 +47,7 @@ public class BranchCompanyVehicleCountBiz extends BaseBiz<BranchCompanyVehicleCo
} }
Query query = new Query(branchCompanyVehicleCountDTO); Query query = new Query(branchCompanyVehicleCountDTO);
PageDataVO<BranchCompanyVehicleCount> pageDataVO = PageDataVO.pageInfo(query, () -> mapper.getAllByParam(query.getSuper())); PageDataVO<BranchCompanyVehicleCount> pageDataVO = PageDataVO.pageInfo(query, () -> mapper.getAllByParam(query.getSuper()));
return ObjectRestResponse.succ(pageDataVO); return ObjectRestResponse.succ();
} }
public int getCurrentMonthLastDay() { public int getCurrentMonthLastDay() {
......
...@@ -11,6 +11,7 @@ import com.xxfc.platform.vehicle.pojo.BranchCompanyVehicleCountVo; ...@@ -11,6 +11,7 @@ import com.xxfc.platform.vehicle.pojo.BranchCompanyVehicleCountVo;
import com.xxfc.platform.vehicle.pojo.ResultVehicleVo; import com.xxfc.platform.vehicle.pojo.ResultVehicleVo;
import com.xxfc.platform.vehicle.pojo.VehicleExcelVo; import com.xxfc.platform.vehicle.pojo.VehicleExcelVo;
import com.xxfc.platform.vehicle.pojo.VehiclePageQueryVo; import com.xxfc.platform.vehicle.pojo.VehiclePageQueryVo;
import com.xxfc.platform.vehicle.util.DateUtils;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.beanutils.BeanUtilsBean; import org.apache.commons.beanutils.BeanUtilsBean;
import org.apache.commons.beanutils.PropertyUtils; import org.apache.commons.beanutils.PropertyUtils;
...@@ -99,25 +100,35 @@ public class VehicleInformationDownloadBiz extends BaseBiz<VehicleMapper, Vehicl ...@@ -99,25 +100,35 @@ public class VehicleInformationDownloadBiz extends BaseBiz<VehicleMapper, Vehicl
} }
public List<BranchCompanyVehicleCountVo> getAllVehicleInfo() { public void getAllVehicleInfo() {
Map<String, Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
map.put("", DateTime.now().toString(DEFAULT_DATE_TIME_FORMATTER)); map.put("startTime", DateTime.now().withMillis(DateUtils.getStartOfDay()).toString(DEFAULT_DATE_TIME_FORMATTER));
map.put("", DateTime.now().toString(DEFAULT_DATE_TIME_FORMATTER)); map.put("endTime", DateTime.now().withMillis(DateUtils.getEndOfDay()).toString(DEFAULT_DATE_TIME_FORMATTER));
return vehicleBiz.getAllVehicleInfo(map); add(map);
} }
public void addAll() {
DateTime dateTime = DateTime.parse("2019-10-01 00:00:00", DEFAULT_DATE_TIME_FORMATTER);
DateTime dateTime1 = DateTime.parse("2019-10-01 23:59:59", DEFAULT_DATE_TIME_FORMATTER);
for (int i = 0; i < 52; i++) {
Map<String, Object> map = new HashMap<>();
map.put("startTime", dateTime.plusDays(i).toString(DEFAULT_DATE_TIME_FORMATTER));
map.put("endTime", dateTime1.plusDays(i).toString(DEFAULT_DATE_TIME_FORMATTER));
add(map);
}
}
public void add(Map<String, Object> param) { public void add(Map<String, Object> param) {
List<BranchCompanyVehicleCountVo> branchCompanyVehicleCountVos = vehicleBiz.getAllVehicleInfo(param); List<BranchCompanyVehicleCountVo> branchCompanyVehicleCountVos = vehicleBiz.getAllVehicleInfo(param);
branchCompanyVehicleCountVos.parallelStream().forEach(result->{ branchCompanyVehicleCountVos.forEach(result->{
try { try {
BranchCompanyVehicleCount branchCompanyVehicleCount = new BranchCompanyVehicleCount(); if (result != null) {
branchCompanyVehicleCount.setCompanyName(result.getParkBranchCompanyName()); BranchCompanyVehicleCount branchCompanyVehicleCount = new BranchCompanyVehicleCount();
branchCompanyVehicleCount.setVehicleNum(result.getCount()); branchCompanyVehicleCount.setCompanyName(result.getParkBranchCompanyName());
DateTime dateTime = DateTime.now(); branchCompanyVehicleCount.setVehicleNum(result.getCount());
String dateStr = dateTime.toString(DATE_TIME_FORMATTER); branchCompanyVehicleCount.setCountDate(DateTime.parse(param.get("startTime").toString().split(" ")[0]).toDate());
branchCompanyVehicleCount.setCountDate(DateTime.parse(dateStr).toDate()); branchCompanyVehicleCountBiz.add(branchCompanyVehicleCount);
branchCompanyVehicleCountBiz.add(branchCompanyVehicleCount); }
} catch (Exception e) { } catch (Exception e) {
log.error(e.getMessage(), e); log.error(e.getMessage(), e);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment