localizer
parent
c6f6c8c6a5
commit
58a39b259e
|
|
@ -28,21 +28,25 @@ public class JsonTypeHandler implements TypeHandler<Object> {
|
|||
|
||||
}
|
||||
|
||||
private static Object getResult(String result) {
|
||||
return StrUtil.isBlank(result) || !result.startsWith("{") || !result.startsWith("[") ? result : Fastjson.toBean(result, Object.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getResult(ResultSet rs, String columnName) throws SQLException {
|
||||
String result = rs.getString(columnName);
|
||||
return StrUtil.isBlank(result) ? null : Fastjson.toBean(result, Object.class);
|
||||
return getResult(result);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getResult(ResultSet rs, int columnIndex) throws SQLException {
|
||||
String result = rs.getString(columnIndex);
|
||||
return StrUtil.isBlank(result) ? null : Fastjson.toBean(result, Object.class);
|
||||
return getResult(result);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getResult(CallableStatement cs, int columnIndex) throws SQLException {
|
||||
String result = cs.getString(columnIndex);
|
||||
return StrUtil.isBlank(result) ? null : Fastjson.toBean(result, Object.class);
|
||||
return getResult(result);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -61,6 +61,9 @@ public class ReusableHttpServletRequest extends HttpServletRequestWrapper {
|
|||
body = StrUtil.isBlank(body) ? "无" : body;
|
||||
}
|
||||
}
|
||||
if (requestURI.contains("/station/letter")) {
|
||||
return;
|
||||
}
|
||||
log.info("接口:{} {}\n请求头:{}\n请求参数:{}\n请求体:{}",
|
||||
method, requestURI, headerMap.isEmpty() ? "无" : Jackson.toJsonStr(headerMap), parameterMap.isEmpty() ? "无" : Jackson.toJsonStr(parameterMap), body);
|
||||
} catch (Throwable e) {
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@ package com.njzscloud.common.security.permission;
|
|||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.map.MapUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.njzscloud.common.core.jackson.Jackson;
|
||||
import com.njzscloud.common.security.contant.Constants;
|
||||
import com.njzscloud.common.security.contant.EndpointAccessModel;
|
||||
import com.njzscloud.common.security.ex.ForbiddenAccessException;
|
||||
|
|
@ -51,7 +50,7 @@ public abstract class PermissionManager {
|
|||
* 初始化本地权限缓存
|
||||
*/
|
||||
public final void init() {
|
||||
if (log.isDebugEnabled()) log.debug("初始化本地权限缓存");
|
||||
// if (log.isDebugEnabled()) log.debug("初始化本地权限缓存");
|
||||
if (CollUtil.isEmpty(PERMISSION_CACHE)) {
|
||||
try {
|
||||
PERMISSION_CACHE_LOCK.lock();
|
||||
|
|
@ -63,14 +62,14 @@ public abstract class PermissionManager {
|
|||
PERMISSION_CACHE_LOCK.unlock();
|
||||
}
|
||||
}
|
||||
if (log.isDebugEnabled()) log.debug("已初始化无需操作");
|
||||
// if (log.isDebugEnabled()) log.debug("已初始化无需操作");
|
||||
}
|
||||
|
||||
/**
|
||||
* 加载权限
|
||||
*/
|
||||
private void load0() {
|
||||
if (log.isDebugEnabled()) log.debug("开始加载权限");
|
||||
// if (log.isDebugEnabled()) log.debug("开始加载权限");
|
||||
|
||||
List<RolePermission> rolePermissions = load();
|
||||
|
||||
|
|
@ -107,9 +106,7 @@ public abstract class PermissionManager {
|
|||
FORBIDDEN_CACHE = forbiddenSet;
|
||||
PERMISSION_CACHE = permissionMap;
|
||||
|
||||
if (log.isDebugEnabled()) {
|
||||
log.debug("本地权限缓存已加载:\n{}", Jackson.toJsonStr(this.getAllRelation()));
|
||||
}
|
||||
// if (log.isDebugEnabled()) log.debug("本地权限缓存已加载:\n{}", Jackson.toJsonStr(this.getAllRelation()));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ public class PermissionSecurityMetaDataSource implements FilterInvocationSecurit
|
|||
String endpoint = method.toUpperCase() + " " + requestURI;
|
||||
|
||||
Assert.notEmpty(permission, () -> new MissingPermissionException(StrUtil.format("请求: 【{}】 未指定权限", endpoint)));
|
||||
if (log.isDebugEnabled()) log.debug("允许访问接口:【{}】的角色:【{}】", endpoint, permission);
|
||||
// if (log.isDebugEnabled()) log.debug("允许访问接口:【{}】的角色:【{}】", endpoint, permission);
|
||||
return permission;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@ package com.njzscloud.common.security.support;
|
|||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.core.util.URLUtil;
|
||||
import com.njzscloud.common.core.jackson.Jackson;
|
||||
import com.njzscloud.common.security.contant.Constants;
|
||||
import com.njzscloud.common.security.util.SecurityUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
|
@ -92,7 +91,7 @@ public class TokenSecurityContextRepository implements SecurityContextRepository
|
|||
userDetail = Constants.ANONYMOUS_USER;
|
||||
}
|
||||
|
||||
log.info("当前登录人信息:{}", Jackson.toJsonStr(userDetail));
|
||||
// log.info("当前登录人信息:{}", Jackson.toJsonStr(userDetail));
|
||||
|
||||
SecurityContext context = SecurityContextHolder.createEmptyContext();
|
||||
AuthenticationDetails details = AuthenticationDetails.create(request);
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package com.njzscloud.supervisory.biz.pojo.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.njzscloud.common.mp.support.handler.j.JsonTypeHandler;
|
||||
import com.njzscloud.supervisory.biz.constant.AuditStatus;
|
||||
import com.njzscloud.supervisory.biz.constant.BizObj;
|
||||
import lombok.Getter;
|
||||
|
|
@ -9,6 +10,7 @@ import lombok.experimental.Accessors;
|
|||
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 企业信息
|
||||
|
|
@ -69,11 +71,16 @@ public class BizCompanyEntity {
|
|||
*/
|
||||
private LocalDate licenseEndTime;
|
||||
|
||||
|
||||
/**
|
||||
* 法人名称
|
||||
*/
|
||||
private String legalRepresentative;
|
||||
|
||||
@TableField(typeHandler = JsonTypeHandler.class)
|
||||
private List<String> idcard;
|
||||
private LocalDate idcardStartTime;
|
||||
private LocalDate idcardEndTime;
|
||||
/**
|
||||
* 省; 代码
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ import lombok.ToString;
|
|||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 企业信息
|
||||
|
|
@ -56,7 +57,9 @@ public class AddBizCompanyParam {
|
|||
* 法人名称
|
||||
*/
|
||||
private String legalRepresentative;
|
||||
|
||||
private List<String> idcard;
|
||||
private LocalDate idcardStartTime;
|
||||
private LocalDate idcardEndTime;
|
||||
/**
|
||||
* 省; 代码
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -19,7 +19,10 @@ import com.njzscloud.supervisory.biz.pojo.entity.BizTruckEntity;
|
|||
import com.njzscloud.supervisory.biz.pojo.param.SearchTruckParam;
|
||||
import com.njzscloud.supervisory.biz.pojo.result.SearchCompanyResult;
|
||||
import com.njzscloud.supervisory.biz.pojo.result.SearchTruckResult;
|
||||
import com.njzscloud.supervisory.device.pojo.entity.DeviceLocalizerEntity;
|
||||
import com.njzscloud.supervisory.device.service.DeviceLocalizerService;
|
||||
import com.njzscloud.supervisory.sys.auth.pojo.result.MyResult;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
|
@ -31,15 +34,27 @@ import java.util.List;
|
|||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class BizTruckService extends ServiceImpl<BizTruckMapper, BizTruckEntity> implements IService<BizTruckEntity> {
|
||||
private final DeviceLocalizerService deviceLocalizerService;
|
||||
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*
|
||||
* @param bizTruckEntity 数据
|
||||
*/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void add(BizTruckEntity bizTruckEntity) {
|
||||
bizTruckEntity.setAuditStatus(AuditStatus.DaiShenHe);
|
||||
String gps = bizTruckEntity.getGps();
|
||||
if (StrUtil.isNotBlank(gps)) {
|
||||
long count = deviceLocalizerService.count(Wrappers.<DeviceLocalizerEntity>query().eq("terminal_id", gps));
|
||||
if (count == 0) {
|
||||
deviceLocalizerService.add(new DeviceLocalizerEntity().setTerminalId(gps));
|
||||
deviceLocalizerService.onApplicationReady();
|
||||
}
|
||||
}
|
||||
this.save(bizTruckEntity);
|
||||
}
|
||||
|
||||
|
|
@ -48,10 +63,19 @@ public class BizTruckService extends ServiceImpl<BizTruckMapper, BizTruckEntity>
|
|||
*
|
||||
* @param bizTruckEntity 数据
|
||||
*/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void modify(BizTruckEntity bizTruckEntity) {
|
||||
this.updateById(bizTruckEntity
|
||||
.setAuditStatus(AuditStatus.DaiShenHe)
|
||||
);
|
||||
BizTruckEntity bizTruck = this.getById(bizTruckEntity.getId());
|
||||
String gps = bizTruck.getGps();
|
||||
if (StrUtil.isNotBlank(gps)) {
|
||||
long count = deviceLocalizerService.count(Wrappers.<DeviceLocalizerEntity>query().eq("terminal_id", gps));
|
||||
if (count == 0) {
|
||||
deviceLocalizerService.add(new DeviceLocalizerEntity().setTerminalId(gps));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -389,7 +389,7 @@ public class TruckLocationTrackService extends ServiceImpl<TruckLocationTrackMap
|
|||
List<SseEmitter> emitterList = emitters.get(gpsId);
|
||||
lock.unlock();
|
||||
if (CollUtil.isEmpty(emitterList)) {
|
||||
log.info("未找到GPS {} 的实时数据订阅者", gpsId);
|
||||
// log.info("未找到GPS {} 的实时数据订阅者", gpsId);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -5,10 +5,7 @@ import com.njzscloud.supervisory.bs.service.StatisticsService;
|
|||
import com.njzscloud.supervisory.bs.service.SupervisionStatisticsService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.CrossOrigin;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
|
|
@ -24,7 +21,7 @@ public class StatisticsController {
|
|||
|
||||
@GetMapping("/obtain_data")
|
||||
public R<?> obtainData() throws Exception {
|
||||
long l = System.currentTimeMillis();
|
||||
// long l = System.currentTimeMillis();
|
||||
Map<String, Object> data = statisticsService.obtainData();
|
||||
return R.success(data);
|
||||
}
|
||||
|
|
@ -36,9 +33,15 @@ public class StatisticsController {
|
|||
|
||||
@GetMapping("/supervision/obtain_data")
|
||||
public R<?> obtainData1() {
|
||||
long l = System.currentTimeMillis();
|
||||
// long l = System.currentTimeMillis();
|
||||
Map<String, Object> data = supervisionStatisticsService.obtainData();
|
||||
return R.success(data);
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/first_page")
|
||||
public R<Map<String, Object>> firstPage(@RequestParam(value = "trendStatisticsType", required = false, defaultValue = "1") Integer trendStatisticsType) {
|
||||
return R.success(supervisionStatisticsService.firstPage(trendStatisticsType));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,8 +2,10 @@ package com.njzscloud.supervisory.bs.mapper;
|
|||
|
||||
import com.njzscloud.supervisory.bs.pojo.result.*;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Mapper
|
||||
public interface SupervisionStatisticsMapper {
|
||||
|
|
@ -27,4 +29,33 @@ public interface SupervisionStatisticsMapper {
|
|||
|
||||
List<Project> getProjects();
|
||||
|
||||
@SuppressWarnings("MybatisXMapperMethodInspection")
|
||||
Map<String, Object> dataStatistics();
|
||||
|
||||
@SuppressWarnings("MybatisXMapperMethodInspection")
|
||||
List<Map<String, Object>> warnTruck();
|
||||
|
||||
@SuppressWarnings("MybatisXMapperMethodInspection")
|
||||
Map<String, Object> truckStatistics();
|
||||
|
||||
@SuppressWarnings("MybatisXMapperMethodInspection")
|
||||
List<Map<String, Object>> projectStatistics();
|
||||
|
||||
@SuppressWarnings("MybatisXMapperMethodInspection")
|
||||
List<Map<String, Object>> trendStatistics(@Param("startTime") String startTime, @Param("endTime") String endTime);
|
||||
|
||||
@SuppressWarnings("MybatisXMapperMethodInspection")
|
||||
List<Map<String, Object>> categoryStatistics();
|
||||
|
||||
@SuppressWarnings("MybatisXMapperMethodInspection")
|
||||
Map<String, Object> orderStatistics();
|
||||
|
||||
@SuppressWarnings("MybatisXMapperMethodInspection")
|
||||
Map<String, Object> weightStatistics();
|
||||
|
||||
@SuppressWarnings("MybatisXMapperMethodInspection")
|
||||
Map<String, Object> userStatistics();
|
||||
|
||||
@SuppressWarnings("MybatisXMapperMethodInspection")
|
||||
List<Map<String, Object>> dataTable();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -320,4 +320,5 @@ public class ShouJuStatisticsService implements StatisticsService {
|
|||
public List<OrderInfo> obtainOrder(Long userId) {
|
||||
return statisticsMapper.obtainOrder(userId);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,15 +1,23 @@
|
|||
package com.njzscloud.supervisory.bs.service;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.map.MapUtil;
|
||||
import com.njzscloud.common.core.ex.Exceptions;
|
||||
import com.njzscloud.common.core.utils.GroupUtil;
|
||||
import com.njzscloud.supervisory.bs.mapper.SupervisionStatisticsMapper;
|
||||
import com.njzscloud.supervisory.bs.pojo.result.*;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.time.temporal.ChronoUnit;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.ArrayBlockingQueue;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import java.util.concurrent.ThreadPoolExecutor;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
@Slf4j
|
||||
@Service
|
||||
|
|
@ -17,6 +25,17 @@ import java.util.Map;
|
|||
public class SupervisionStatisticsService {
|
||||
private final SupervisionStatisticsMapper supervisionStatisticsMapper;
|
||||
|
||||
private final ThreadPoolExecutor threadPoolExecutor = new ThreadPoolExecutor(
|
||||
50,
|
||||
200,
|
||||
0L,
|
||||
TimeUnit.MILLISECONDS,
|
||||
new ArrayBlockingQueue<>(1000),
|
||||
(r, executor) -> {
|
||||
throw Exceptions.exception("服务器繁忙");
|
||||
}
|
||||
);
|
||||
|
||||
public Map<String, Object> obtainData() {
|
||||
|
||||
DispatchSummary dispatchSummary = supervisionStatisticsMapper.getDispatchSummary();
|
||||
|
|
@ -47,4 +66,192 @@ public class SupervisionStatisticsService {
|
|||
.build();
|
||||
}
|
||||
|
||||
public Map<String, Object> firstPage(Integer trendStatisticsType) {
|
||||
CompletableFuture<Map<String, Object>> dataStatisticsFuture = CompletableFuture.supplyAsync(supervisionStatisticsMapper::dataStatistics, threadPoolExecutor)
|
||||
.thenApply(dataStatistics -> {
|
||||
Double todayTotalWeight = MapUtil.getDouble(dataStatistics, "todayTotalWeight", 0.0);
|
||||
Double yesterdayTotalWeight = MapUtil.getDouble(dataStatistics, "yesterdayTotalWeight", 0.0);
|
||||
Double dayRate = yesterdayTotalWeight == 0 ? 100 : (todayTotalWeight - yesterdayTotalWeight) / yesterdayTotalWeight * 100;
|
||||
|
||||
Double currentMonthTotalWeight = MapUtil.getDouble(dataStatistics, "currentMonthTotalWeight", 0.0);
|
||||
Double lastMonthTotalWeight = MapUtil.getDouble(dataStatistics, "lastMonthTotalWeight", 0.0);
|
||||
Double monthRate = lastMonthTotalWeight == 0 ? 100 : (currentMonthTotalWeight - lastMonthTotalWeight) / lastMonthTotalWeight * 100;
|
||||
|
||||
Double todayFinishCount = MapUtil.getDouble(dataStatistics, "todayFinishCount", 0.0);
|
||||
Double todayTotalCount = MapUtil.getDouble(dataStatistics, "todayTotalCount", 0.0);
|
||||
Double todayFinishRate = todayTotalCount == 0 ? 100 : todayFinishCount / todayTotalCount * 100;
|
||||
|
||||
Double yesterdayFinishCount = MapUtil.getDouble(dataStatistics, "yesterdayFinishCount", 0.0);
|
||||
// Double yesterdayTotalCount = MapUtil.getDouble(dataStatistics, "yesterdayTotalCount", 0.0);
|
||||
// Double yesterdayFinishRate = yesterdayFinishCount == 0 ? 100 : yesterdayFinishCount / yesterdayTotalCount * 100;
|
||||
Double incFinishRate = yesterdayFinishCount == 0 ? 100 : (todayFinishCount - yesterdayFinishCount) / yesterdayFinishCount * 100;
|
||||
|
||||
Double todayWarnCount = MapUtil.getDouble(dataStatistics, "todayWarnCount", 0.0);
|
||||
Double yesterdayWarnCount = MapUtil.getDouble(dataStatistics, "yesterdayWarnCount", 0.0);
|
||||
Double warnRate = yesterdayWarnCount == 0 ? 100 : (todayWarnCount - yesterdayWarnCount) / yesterdayWarnCount * 100;
|
||||
|
||||
dataStatistics.put("dayRate", dayRate);
|
||||
dataStatistics.put("monthRate", monthRate);
|
||||
dataStatistics.put("finishRate", todayFinishRate);
|
||||
dataStatistics.put("incFinishRate", incFinishRate);
|
||||
dataStatistics.put("warnRate", warnRate);
|
||||
return dataStatistics;
|
||||
})
|
||||
.exceptionally(ex -> {
|
||||
log.error("数据获取失败", ex);
|
||||
return Collections.emptyMap();
|
||||
});
|
||||
|
||||
|
||||
CompletableFuture<List<Map<String, Object>>> warnTruckFuture = CompletableFuture.supplyAsync(supervisionStatisticsMapper::warnTruck, threadPoolExecutor)
|
||||
.exceptionally(ex -> {
|
||||
log.error("数据获取失败", ex);
|
||||
return Collections.emptyList();
|
||||
});
|
||||
|
||||
CompletableFuture<Map<String, Object>> truckStatisticsFuture = CompletableFuture.supplyAsync(supervisionStatisticsMapper::truckStatistics, threadPoolExecutor)
|
||||
.thenApply(truckStatistics -> {
|
||||
Integer offlineCount = MapUtil.getInt(truckStatistics, "offlineCount", 0);
|
||||
Integer totalCount = MapUtil.getInt(truckStatistics, "totalCount", 0);
|
||||
truckStatistics.put("onlineCount", totalCount - offlineCount);
|
||||
return truckStatistics;
|
||||
})
|
||||
.exceptionally(ex -> {
|
||||
log.error("数据获取失败", ex);
|
||||
return Collections.emptyMap();
|
||||
});
|
||||
|
||||
CompletableFuture<List<Map<String, Object>>> projectStatisticsFuture = CompletableFuture.supplyAsync(supervisionStatisticsMapper::projectStatistics, threadPoolExecutor)
|
||||
.exceptionally(ex -> {
|
||||
log.error("数据获取失败", ex);
|
||||
return Collections.emptyList();
|
||||
});
|
||||
|
||||
CompletableFuture<Map<String, Double>> trendStatisticsFuture = CompletableFuture.supplyAsync(() -> {
|
||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
||||
LocalDateTime now = LocalDateTime.now();
|
||||
LocalDateTime startTime = now.minusDays(7);
|
||||
LocalDateTime endTime = LocalDateTime.now();
|
||||
|
||||
if (trendStatisticsType == 2) {
|
||||
startTime = now.minusMonths(12);
|
||||
} else if (trendStatisticsType == 3) {
|
||||
startTime = now.minusYears(5);
|
||||
}
|
||||
List<Map<String, Object>> maps = supervisionStatisticsMapper.trendStatistics(startTime.format(formatter), endTime.format(formatter));
|
||||
Map<String, Double> res = new HashMap<>();
|
||||
if (trendStatisticsType == 2) {
|
||||
long months = ChronoUnit.MONTHS.between(startTime, endTime);
|
||||
Map<String, List<Map<String, Object>>> timepointMap = GroupUtil.k_a(maps, it -> {
|
||||
String timepoint = MapUtil.getStr(it, "timepoint", "");
|
||||
return DateUtil.format(DateUtil.parseDate(timepoint), "yyyy-MM");
|
||||
});
|
||||
|
||||
for (long l = 0; l < months; l++) {
|
||||
LocalDateTime localDateTime = startTime.plusMonths(l);
|
||||
String month = localDateTime.format(DateTimeFormatter.ofPattern("yyyy-MM"));
|
||||
List<Map<String, Object>> monthData = timepointMap.getOrDefault(month, Collections.emptyList());
|
||||
Optional<Integer> weight = monthData.stream()
|
||||
.map(it -> MapUtil.getInt(it, "weight", 0))
|
||||
.reduce(Integer::sum);
|
||||
|
||||
res.put(month, weight.orElse(0) / 1000.0);
|
||||
}
|
||||
|
||||
} else if (trendStatisticsType == 3) {
|
||||
long years = ChronoUnit.YEARS.between(startTime, endTime);
|
||||
Map<String, List<Map<String, Object>>> timepointMap = GroupUtil.k_a(maps, it -> {
|
||||
String timepoint = MapUtil.getStr(it, "timepoint", "");
|
||||
return DateUtil.format(DateUtil.parseDate(timepoint), "yyyy");
|
||||
});
|
||||
|
||||
for (long l = 0; l < years; l++) {
|
||||
LocalDateTime localDateTime = startTime.plusYears(l);
|
||||
String year = localDateTime.format(DateTimeFormatter.ofPattern("yyyy-MM"));
|
||||
List<Map<String, Object>> yearData = timepointMap.getOrDefault(year, Collections.emptyList());
|
||||
Optional<Integer> weight = yearData.stream()
|
||||
.map(it -> MapUtil.getInt(it, "weight", 0))
|
||||
.reduce(Integer::sum);
|
||||
|
||||
res.put(year, weight.orElse(0) / 1000.0);
|
||||
}
|
||||
} else {
|
||||
long days = ChronoUnit.DAYS.between(startTime, endTime);
|
||||
Map<String, List<Map<String, Object>>> timepointMap = GroupUtil.k_a(maps, it -> {
|
||||
String timepoint = MapUtil.getStr(it, "timepoint", "");
|
||||
return DateUtil.format(DateUtil.parseDate(timepoint), "yyyy-MM-dd");
|
||||
});
|
||||
|
||||
for (long l = 0; l < days; l++) {
|
||||
LocalDateTime localDateTime = startTime.plusYears(l);
|
||||
String day = localDateTime.format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
|
||||
List<Map<String, Object>> dayData = timepointMap.getOrDefault(day, Collections.emptyList());
|
||||
Optional<Integer> weight = dayData.stream()
|
||||
.map(it -> MapUtil.getInt(it, "weight", 0))
|
||||
.reduce(Integer::sum);
|
||||
|
||||
res.put(day, weight.orElse(0) / 1000.0);
|
||||
}
|
||||
}
|
||||
return res;
|
||||
}, threadPoolExecutor)
|
||||
.exceptionally(ex -> {
|
||||
log.error("数据获取失败", ex);
|
||||
return Collections.emptyMap();
|
||||
});
|
||||
CompletableFuture<List<Map<String, Object>>> categoryStatisticsFuture = CompletableFuture.supplyAsync(supervisionStatisticsMapper::categoryStatistics, threadPoolExecutor)
|
||||
.exceptionally(ex -> {
|
||||
log.error("数据获取失败", ex);
|
||||
return Collections.emptyList();
|
||||
});
|
||||
|
||||
CompletableFuture<Map<String, Object>> orderStatisticsFuture = CompletableFuture.supplyAsync(supervisionStatisticsMapper::orderStatistics, threadPoolExecutor)
|
||||
.exceptionally(ex -> {
|
||||
log.error("数据获取失败", ex);
|
||||
return Collections.emptyMap();
|
||||
});
|
||||
|
||||
CompletableFuture<Map<String, Object>> weightStatisticsFuture = CompletableFuture.supplyAsync(supervisionStatisticsMapper::weightStatistics, threadPoolExecutor)
|
||||
.exceptionally(ex -> {
|
||||
log.error("数据获取失败", ex);
|
||||
return Collections.emptyMap();
|
||||
});
|
||||
CompletableFuture<Map<String, Object>> userStatisticsFuture = CompletableFuture.supplyAsync(supervisionStatisticsMapper::userStatistics, threadPoolExecutor)
|
||||
.exceptionally(ex -> {
|
||||
log.error("数据获取失败", ex);
|
||||
return Collections.emptyMap();
|
||||
});
|
||||
CompletableFuture<List<Map<String, Object>>> dataTableFuture = CompletableFuture.supplyAsync(supervisionStatisticsMapper::dataTable, threadPoolExecutor)
|
||||
.exceptionally(ex -> {
|
||||
log.error("数据获取失败", ex);
|
||||
return Collections.emptyList();
|
||||
});
|
||||
|
||||
try {
|
||||
Map<String, Object> dataStatistics = dataStatisticsFuture.get();
|
||||
List<Map<String, Object>> warnTruck = warnTruckFuture.get();
|
||||
Map<String, Object> truckStatistics = truckStatisticsFuture.get();
|
||||
List<Map<String, Object>> projectStatistics = projectStatisticsFuture.get();
|
||||
Map<String, Double> trendStatistics = trendStatisticsFuture.get();
|
||||
List<Map<String, Object>> categoryStatistics = categoryStatisticsFuture.get();
|
||||
Map<String, Object> orderStatistics = orderStatisticsFuture.get();
|
||||
Map<String, Object> userStatistics = userStatisticsFuture.get();
|
||||
Map<String, Object> weightStatistics = weightStatisticsFuture.get();
|
||||
List<Map<String, Object>> dataTable = dataTableFuture.get();
|
||||
return MapUtil.<String, Object>builder()
|
||||
.put("dataStatistics", dataStatistics)
|
||||
.put("warnTruck", warnTruck)
|
||||
.put("truckStatistics", truckStatistics)
|
||||
.put("projectStatistics", projectStatistics)
|
||||
.put("trendStatistics", trendStatistics)
|
||||
.put("categoryStatistics", categoryStatistics)
|
||||
.put("orderStatistics", orderStatistics)
|
||||
.put("userStatistics", userStatistics)
|
||||
.put("weightStatistics", weightStatistics)
|
||||
.put("dataTable", dataTable)
|
||||
.build();
|
||||
} catch (Exception e) {
|
||||
throw Exceptions.exception(e, "数据获取失败");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ import java.util.List;
|
|||
|
||||
@Mapper
|
||||
public interface CustomerMapper {
|
||||
IPage<SearchCustomerResult> paging(@Param("page") Page<SearchCustomerResult> page, @Param("ew") QueryWrapper<Object> ew);
|
||||
IPage<SearchCustomerResult> paging(Page<SearchCustomerResult> page, @Param("ew") QueryWrapper<Object> ew);
|
||||
|
||||
List<ShortBargeInfoResult> shortBargeInfo(@Param("ew") QueryWrapper<Object> ew);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@ public class SearchCompanyResult {
|
|||
* 公司id
|
||||
*/
|
||||
private Long id;
|
||||
private String username;
|
||||
/**
|
||||
* 统一社会信用代码
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 定位器
|
||||
|
|
@ -70,8 +71,8 @@ public class DeviceLocalizerService extends ServiceImpl<DeviceLocalizerMapper, D
|
|||
@EventListener(ApplicationReadyEvent.class)
|
||||
public void onApplicationReady() {
|
||||
List<DeviceLocalizerEntity> localizerEntities = this.list();
|
||||
for (DeviceLocalizerEntity localizerEntity : localizerEntities) {
|
||||
String terminalId = localizerEntity.getTerminalId();
|
||||
List<String> collect = localizerEntities.stream().map(DeviceLocalizerEntity::getTerminalId).distinct().collect(Collectors.toList());
|
||||
for (String terminalId : collect) {
|
||||
Mqtt.subscribe(terminalId + "/online", this::heartbeat);
|
||||
Mqtt.subscribe(terminalId + "/device_info", this::updateDeviceLocalizerStatus);
|
||||
Mqtt.subscribe(terminalId + "/track_location_real", truckLocationTrackService::sendRealTimeData);
|
||||
|
|
|
|||
|
|
@ -709,23 +709,38 @@ public class OrderInfoService extends ServiceImpl<OrderInfoMapper, OrderInfoEnti
|
|||
stopTuqiangTrack(gpsId);
|
||||
}
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void cancel(Long orderId) {
|
||||
OrderInfoEntity orderInfo = this.getById(orderId);
|
||||
Assert.notNull(orderInfo, () -> Exceptions.clierr("订单不存在"));
|
||||
OrderStatus orderStatus = orderInfo.getOrderStatus();
|
||||
Assert.isTrue(orderStatus == OrderStatus.YiYuYue
|
||||
|| orderStatus == OrderStatus.DaiPaiDan
|
||||
|| orderStatus == OrderStatus.DaiJieDan
|
||||
, () -> Exceptions.clierr("当前订单状态,无法取消"));
|
||||
|| orderStatus == OrderStatus.DaiJieDan, () -> Exceptions.clierr("当前订单状态,无法取消"));
|
||||
this.updateById(new OrderInfoEntity()
|
||||
.setId(orderInfo.getId())
|
||||
.setOrderStatus(OrderStatus.YiQuXiao)
|
||||
);
|
||||
|
||||
// TODO 关闭 GPS 定位
|
||||
CompletableFuture.runAsync(() -> {
|
||||
Long truckId = orderInfo.getTruckId();
|
||||
if (truckId == null) {
|
||||
return;
|
||||
}
|
||||
BizTruckEntity truckInfo = baseMapper.getTruckInfo(truckId);
|
||||
if (truckInfo == null) {
|
||||
return;
|
||||
}
|
||||
String gpsId = truckInfo.getGps();
|
||||
if (StrUtil.isBlank(gpsId)) {
|
||||
return;
|
||||
}
|
||||
stopTuqiangTrack(gpsId);
|
||||
}).exceptionally(ex -> {
|
||||
log.error("数据获取失败", ex);
|
||||
return null;
|
||||
});
|
||||
}
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ import lombok.ToString;
|
|||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.List;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
|
|
@ -114,7 +115,9 @@ public class UserRegisterParam {
|
|||
* 法人名称
|
||||
*/
|
||||
private String legalRepresentative;
|
||||
|
||||
private List<String> idcard;
|
||||
private LocalDate idcardStartTime;
|
||||
private LocalDate idcardEndTime;
|
||||
/**
|
||||
* 省; 代码
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -3,6 +3,8 @@ package com.njzscloud.supervisory.sys.user.pojo.result;
|
|||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
public class UserAccountDetailResult {
|
||||
|
|
@ -24,6 +26,8 @@ public class UserAccountDetailResult {
|
|||
* 手机号
|
||||
*/
|
||||
private String phone;
|
||||
|
||||
private LocalDateTime regdate;
|
||||
/**
|
||||
* 微信 openid
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -56,15 +56,15 @@ mybatis-plus:
|
|||
port: 33061
|
||||
|
||||
wechat:
|
||||
app-id: wx3c06d9dd4e56c58d
|
||||
app-secret: ff280a71a4c06fc2956178f8c472ef96
|
||||
# app-id: wx989ea47a5ddf9bfb
|
||||
# app-secret: 66c98dc487a372acb4f1931b38fee8ff
|
||||
# app-id: wx3c06d9dd4e56c58d
|
||||
# app-secret: ff280a71a4c06fc2956178f8c472ef96
|
||||
app-id: wx989ea47a5ddf9bfb
|
||||
app-secret: 66c98dc487a372acb4f1931b38fee8ff
|
||||
base-url: https://api.weixin.qq.com
|
||||
pay:
|
||||
# 子商户配置
|
||||
sub-app-id: wx3c06d9dd4e56c58d
|
||||
# sub-app-id: wx989ea47a5ddf9bfb
|
||||
# sub-app-id: wx3c06d9dd4e56c58d
|
||||
sub-app-id: wx989ea47a5ddf9bfb
|
||||
sub-mch-id: 1900000100
|
||||
# API密钥(32位字符串)
|
||||
api-key: your-32-character-api-key-here
|
||||
|
|
|
|||
|
|
@ -66,6 +66,7 @@ spring:
|
|||
logging:
|
||||
level:
|
||||
com.njzscloud.common.sichen.TaskMapper: off
|
||||
com.njzscloud.supervisory.sys.stationletter: off
|
||||
com.njzscloud: debug
|
||||
|
||||
mybatis-plus:
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@
|
|||
create_time,
|
||||
modify_time,
|
||||
deleted,
|
||||
open,
|
||||
`open`,
|
||||
<if test="lng != null and lat != null">
|
||||
(6371 *
|
||||
ACOS(COS(RADIANS(lat)) * COS(RADIANS(#{lat})) *
|
||||
|
|
@ -59,5 +59,8 @@
|
|||
NULL distance
|
||||
</if>
|
||||
FROM biz_company
|
||||
WHERE deleted = 0
|
||||
AND `open` = 1
|
||||
AND station = 1
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
|||
|
|
@ -142,4 +142,236 @@
|
|||
ORDER BY g.create_time DESC
|
||||
LIMIT 10
|
||||
</select>
|
||||
<select id="dataStatistics" resultType="java.util.Map">
|
||||
SELECT MAX(IF(t = 1, c, 0)) todayTotalWeight,
|
||||
MAX(IF(t = 2, c, 0)) yesterdayTotalWeight,
|
||||
MAX(IF(t = 3, c, 0)) currentMonthTotalWeight,
|
||||
MAX(IF(t = 4, c, 0)) lastMonthTotalWeight,
|
||||
MAX(IF(t = 5, c, 0)) todayFinishCount,
|
||||
MAX(IF(t = 6, c, 0)) todayTotalCount,
|
||||
MAX(IF(t = 7, c, 0)) yesterdayFinishCount,
|
||||
MAX(IF(t = 8, c, 0)) yesterdayTotalCount,
|
||||
MAX(IF(t = 9, c, 0)) todayWarnCount,
|
||||
MAX(IF(t = 10, c, 0)) todayUnwarnCount,
|
||||
MAX(IF(t = 11, c, 0)) yesterdayWarnCount,
|
||||
MAX(IF(t = 12, c, 0)) yesterdayUnwarnCount
|
||||
FROM (SELECT ROUND(SUM(b.settle_weight) / 1000, 2) c, 1 t
|
||||
FROM order_info a
|
||||
INNER JOIN order_car_in_out b ON b.id = a.car_in_out_id
|
||||
WHERE a.deleted = 0
|
||||
AND a.order_status = 'YiWanCheng'
|
||||
AND b.out_time >= CURDATE()
|
||||
AND b.out_time <![CDATA[ < ]]> DATE_ADD(CURDATE(), INTERVAL 1 DAY)
|
||||
UNION ALL
|
||||
SELECT ROUND(SUM(b.settle_weight) / 1000, 2) c, 2 t
|
||||
FROM order_info a
|
||||
INNER JOIN order_car_in_out b ON b.id = a.car_in_out_id
|
||||
WHERE a.deleted = 0
|
||||
AND a.order_status = 'YiWanCheng'
|
||||
AND b.out_time >= DATE_SUB(CURDATE(), INTERVAL 1 DAY)
|
||||
AND b.out_time <![CDATA[ < ]]> CURDATE()
|
||||
UNION ALL
|
||||
SELECT ROUND(SUM(b.settle_weight) / 1000, 2) c, 3 t
|
||||
FROM order_info a
|
||||
INNER JOIN order_car_in_out b ON b.id = a.car_in_out_id
|
||||
WHERE a.deleted = 0
|
||||
AND a.order_status = 'YiWanCheng'
|
||||
AND b.out_time >= DATE_FORMAT(NOW(), '%Y-%m-01 00:00:00')
|
||||
AND b.out_time <![CDATA[ < ]]> DATE_ADD(DATE_FORMAT(NOW(), '%Y-%m-01'), INTERVAL 1 MONTH)
|
||||
UNION ALL
|
||||
SELECT ROUND(SUM(b.settle_weight) / 1000, 2) c, 4 t
|
||||
FROM order_info a
|
||||
INNER JOIN order_car_in_out b ON b.id = a.car_in_out_id
|
||||
WHERE a.deleted = 0
|
||||
AND a.order_status = 'YiWanCheng'
|
||||
AND b.out_time >= DATE_FORMAT(DATE_SUB(NOW(), INTERVAL 1 MONTH), '%Y-%m-01 00:00:00')
|
||||
AND b.out_time <![CDATA[ < ]]> DATE_FORMAT(NOW(), '%Y-%m-01 00:00:00')
|
||||
UNION ALL
|
||||
SELECT COUNT(*) c, 5 t
|
||||
FROM order_info a
|
||||
INNER JOIN order_car_in_out b ON b.id = a.car_in_out_id
|
||||
WHERE a.deleted = 0
|
||||
AND a.order_status = 'YiWanCheng'
|
||||
AND b.out_time >= CURDATE()
|
||||
AND b.out_time <![CDATA[ < ]]> DATE_ADD(CURDATE(), INTERVAL 1 DAY)
|
||||
UNION ALL
|
||||
SELECT COUNT(*) c, 6 t
|
||||
FROM order_info a
|
||||
INNER JOIN order_car_in_out b ON b.id = a.car_in_out_id
|
||||
WHERE a.deleted = 0
|
||||
AND a.order_status <![CDATA[ <> ]]> 'YiQuXiao'
|
||||
AND b.out_time >= CURDATE()
|
||||
AND b.out_time <![CDATA[ < ]]> DATE_ADD(CURDATE(), INTERVAL 1 DAY)
|
||||
UNION ALL
|
||||
SELECT COUNT(*) c, 7 t
|
||||
FROM order_info a
|
||||
INNER JOIN order_car_in_out b ON b.id = a.car_in_out_id
|
||||
WHERE a.deleted = 0
|
||||
AND a.order_status = 'YiWanCheng'
|
||||
AND b.out_time >= DATE_SUB(CURDATE(), INTERVAL 1 DAY)
|
||||
AND b.out_time <![CDATA[ < ]]> CURDATE()
|
||||
UNION ALL
|
||||
SELECT COUNT(*) c, 8 t
|
||||
FROM order_info a
|
||||
INNER JOIN order_car_in_out b ON b.id = a.car_in_out_id
|
||||
WHERE a.deleted = 0
|
||||
AND a.order_status <![CDATA[ <> ]]> 'YiQuXiao'
|
||||
AND b.out_time >= DATE_SUB(CURDATE(), INTERVAL 1 DAY)
|
||||
AND b.out_time <![CDATA[ < ]]> CURDATE()
|
||||
UNION ALL
|
||||
SELECT COUNT(*) c, 9 t
|
||||
FROM order_info a
|
||||
INNER JOIN order_car_in_out b ON b.id = a.car_in_out_id
|
||||
WHERE a.deleted = 0
|
||||
AND a.warn = 1
|
||||
AND b.out_time >= CURDATE()
|
||||
AND b.out_time <![CDATA[ < ]]> DATE_ADD(CURDATE(), INTERVAL 1 DAY)
|
||||
UNION ALL
|
||||
SELECT COUNT(*) c, 10 t
|
||||
FROM order_info a
|
||||
INNER JOIN order_car_in_out b ON b.id = a.car_in_out_id
|
||||
WHERE a.deleted = 0
|
||||
AND a.warn = 0
|
||||
AND b.out_time >= CURDATE()
|
||||
AND b.out_time <![CDATA[ < ]]> DATE_ADD(CURDATE(), INTERVAL 1 DAY)
|
||||
UNION ALL
|
||||
SELECT COUNT(*) c, 11 t
|
||||
FROM order_info a
|
||||
INNER JOIN order_car_in_out b ON b.id = a.car_in_out_id
|
||||
WHERE a.deleted = 0
|
||||
AND a.warn = 1
|
||||
AND b.out_time >= DATE_SUB(CURDATE(), INTERVAL 1 DAY)
|
||||
AND b.out_time <![CDATA[ < ]]> CURDATE()
|
||||
UNION ALL
|
||||
SELECT COUNT(*) c, 12 t
|
||||
FROM order_info a
|
||||
INNER JOIN order_car_in_out b ON b.id = a.car_in_out_id
|
||||
WHERE a.deleted = 0
|
||||
AND a.warn = 0
|
||||
AND b.out_time >= DATE_SUB(CURDATE(), INTERVAL 1 DAY)
|
||||
AND b.out_time <![CDATA[ < ]]> CURDATE()) tt
|
||||
</select>
|
||||
|
||||
<select id="warnTruck" resultType="java.util.Map">
|
||||
SELECT license_plate licensePlate,
|
||||
warn_content warnContent,
|
||||
last_time lastTime
|
||||
FROM (SELECT b.license_plate, '离线' warn_content, c.last_time
|
||||
FROM order_info a
|
||||
INNER JOIN biz_truck b ON b.id = a.truck_id AND b.deleted = 0
|
||||
INNER JOIN device_localizer c ON c.terminal_id = b.gps AND c.deleted = 0
|
||||
WHERE c.last_time <![CDATA[ < ]]> DATE_SUB(NOW(), INTERVAL 5 MINUTE)
|
||||
UNION ALL
|
||||
SELECT b.license_plate, c.warn_content, c.create_time last_time
|
||||
FROM order_info a
|
||||
INNER JOIN biz_truck b ON b.id = a.truck_id AND b.deleted = 0
|
||||
INNER JOIN biz_warn c ON c.order_id = a.id AND c.deleted = 0
|
||||
WHERE c.create_time >= CURDATE()
|
||||
AND c.create_time <![CDATA[ < ]]> DATE_ADD(CURDATE(), INTERVAL 1 DAY)) t
|
||||
ORDER BY last_time DESC
|
||||
LIMIT 50
|
||||
</select>
|
||||
<select id="truckStatistics" resultType="java.util.Map">
|
||||
SELECT MAX(IF(t_ = 1, c_, 0)) offlineCount,
|
||||
MAX(IF(t_ = 2, c_, 0)) totalCount
|
||||
FROM (SELECT COUNT(*) c_, 1 t_
|
||||
FROM device_localizer c
|
||||
WHERE c.last_time <![CDATA[ < ]]> DATE_SUB(NOW(), INTERVAL 5 MINUTE)
|
||||
AND c.deleted = 0
|
||||
UNION ALL
|
||||
SELECT COUNT(*) c_, 2 t_
|
||||
FROM device_localizer c
|
||||
WHERE c.deleted = 0) t
|
||||
</select>
|
||||
<select id="projectStatistics" resultType="java.util.Map">
|
||||
SELECT b.lng,
|
||||
b.lat,
|
||||
b.address,
|
||||
IFNULL(d.project_name, c.nickname) projectName
|
||||
FROM order_info a
|
||||
INNER JOIN order_cargo_place b ON b.id = a.cargo_place_id
|
||||
INNER JOIN sys_user c ON c.id = a.user_id
|
||||
LEFT JOIN biz_project d ON d.id = a.project_id
|
||||
WHERE a.deleted = 0
|
||||
LIMIT 50
|
||||
</select>
|
||||
<select id="trendStatistics" resultType="java.util.Map">
|
||||
SELECT b.settle_weight weight, DATE_FORMAT(b.out_time, '%Y-%m-%d %H:%i:%s') timepoint
|
||||
FROM order_info a
|
||||
INNER JOIN order_car_in_out b ON b.id = a.car_in_out_id
|
||||
WHERE a.deleted = 0
|
||||
AND a.order_status = 'YiWanCheng'
|
||||
AND b.out_time >= '${startTime}'
|
||||
AND b.out_time <![CDATA[ <= ]]> '${endTime}'
|
||||
</select>
|
||||
|
||||
<select id="categoryStatistics" resultType="java.util.Map">
|
||||
SELECT d.category_name categoryName, ROUND(SUM(b.settle_weight) / 1000, 2) weight
|
||||
FROM order_info a
|
||||
INNER JOIN order_car_in_out b ON b.id = a.car_in_out_id
|
||||
INNER JOIN order_goods c ON c.id = a.goods_id
|
||||
INNER JOIN goods_category d ON d.id = c.goods_category_id
|
||||
WHERE a.deleted = 0
|
||||
AND a.order_status = 'YiWanCheng'
|
||||
GROUP BY d.category_name
|
||||
</select>
|
||||
<select id="orderStatistics" resultType="java.util.Map">
|
||||
SELECT MAX(IF(t_ = 1, c_, 0)) totalCount,
|
||||
MAX(IF(t_ = 2, c_, 0)) incCount
|
||||
FROM (SELECT COUNT(*) c_, 1 t_
|
||||
FROM order_info a
|
||||
INNER JOIN order_car_in_out b ON b.id = a.car_in_out_id
|
||||
WHERE a.deleted = 0
|
||||
AND a.order_status = 'YiWanCheng'
|
||||
UNION ALL
|
||||
SELECT COUNT(*) c_, 2 t_
|
||||
FROM order_info a
|
||||
INNER JOIN order_car_in_out b ON b.id = a.car_in_out_id
|
||||
WHERE a.deleted = 0
|
||||
AND a.order_status = 'YiWanCheng'
|
||||
AND b.out_time >= CURDATE()
|
||||
AND b.out_time <![CDATA[ < ]]> DATE_ADD(CURDATE(), INTERVAL 1 DAY)) t
|
||||
</select>
|
||||
<select id="weightStatistics" resultType="java.util.Map">
|
||||
SELECT MAX(IF(t_ = 1, c_, 0)) totalWeight,
|
||||
MAX(IF(t_ = 2, c_, 0)) incWeight
|
||||
FROM (SELECT ROUND(SUM(b.settle_weight) / 1000, 2) c_, 1 t_
|
||||
FROM order_info a
|
||||
INNER JOIN order_car_in_out b ON b.id = a.car_in_out_id
|
||||
WHERE a.deleted = 0
|
||||
AND a.order_status = 'YiWanCheng'
|
||||
UNION ALL
|
||||
SELECT ROUND(SUM(b.settle_weight) / 1000, 2) c_, 2 t_
|
||||
FROM order_info a
|
||||
INNER JOIN order_car_in_out b ON b.id = a.car_in_out_id
|
||||
WHERE a.deleted = 0
|
||||
AND a.order_status = 'YiWanCheng'
|
||||
AND b.out_time >= CURDATE()
|
||||
AND b.out_time <![CDATA[ < ]]> DATE_ADD(CURDATE(), INTERVAL 1 DAY)) t
|
||||
</select>
|
||||
<select id="userStatistics" resultType="java.util.Map">
|
||||
SELECT MAX(IF(t_ = 1, c_, 0)) totalCount,
|
||||
MAX(IF(t_ = 2, c_, 0)) incCount
|
||||
FROM (SELECT COUNT(*) c_, 1 t_
|
||||
FROM sys_user
|
||||
WHERE biz_obj IN ('GeRen', 'WuYe', 'ShiGongDanWei', 'ChaiQian', 'SheQu')
|
||||
UNION ALL
|
||||
SELECT COUNT(*) c_, 2 t_
|
||||
FROM sys_user
|
||||
WHERE biz_obj IN ('GeRen', 'WuYe', 'ShiGongDanWei', 'ChaiQian', 'SheQu')
|
||||
AND create_time >= CURDATE()
|
||||
AND create_time <![CDATA[ < ]]> DATE_ADD(CURDATE(), INTERVAL 1 DAY)) t
|
||||
</select>
|
||||
<select id="dataTable" resultType="java.util.Map">
|
||||
SELECT ROUND(SUM(b.settle_weight) / 1000, 2) totalWeight, COUNT(*) totalCount
|
||||
FROM order_info a
|
||||
INNER JOIN order_car_in_out b ON b.id = a.car_in_out_id
|
||||
INNER JOIN order_cargo_place c ON c.id = a.cargo_place_id
|
||||
INNER JOIN order_goods d ON c.id = a.goods_id
|
||||
WHERE a.deleted = 0
|
||||
AND a.order_status = 'YiWanCheng'
|
||||
AND b.out_time >= CURDATE()
|
||||
AND b.out_time <![CDATA[ < ]]> DATE_ADD(CURDATE(), INTERVAL 1 DAY)
|
||||
GROUP BY c.area, d.goods_name
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
|||
|
|
@ -4,11 +4,12 @@
|
|||
<mapper namespace="com.njzscloud.supervisory.customer.mapper.CustomerMapper">
|
||||
|
||||
<resultMap id="SearchCompanyResultMap" autoMapping="true" type="com.njzscloud.supervisory.customer.pojo.result.SearchCompanyResult">
|
||||
<id column="company_id" property="id"/>
|
||||
<result column="contacts_phone" property="phone"/>
|
||||
<result column="company_id" property="id"/>
|
||||
<result column="audit_status" property="auditStatus" typeHandler="com.njzscloud.common.mp.support.handler.e.EnumTypeHandlerDealer"/>
|
||||
</resultMap>
|
||||
<resultMap id="SearchCustomerResultMap" autoMapping="true" type="com.njzscloud.supervisory.customer.pojo.result.SearchCustomerResult">
|
||||
<id column="id" property="id"/>
|
||||
<result column="biz_obj" property="bizObj" typeHandler="com.njzscloud.common.mp.support.handler.e.EnumTypeHandlerDealer"/>
|
||||
<result column="gender" property="gender" typeHandler="com.njzscloud.common.mp.support.handler.e.EnumTypeHandlerDealer"/>
|
||||
<association property="company" resultMap="SearchCompanyResultMap"/>
|
||||
|
|
|
|||
|
|
@ -129,7 +129,10 @@
|
|||
f.licence_start_time driver_licence_start_time,
|
||||
f.licence_end_time driver_licence_end_time,
|
||||
j.license_start_time trans_license_start_time,
|
||||
j.license_end_time trans_license_start_time
|
||||
j.license_end_time trans_license_start_time,
|
||||
g.idcard trans_idcard,
|
||||
g.idcard_start_time trans_idcard_start_time,
|
||||
g.idcard_end_time trans_idcard_end_time
|
||||
FROM order_info a
|
||||
LEFT JOIN order_cargo_place b ON b.id = a.cargo_place_id
|
||||
LEFT JOIN order_goods c ON c.id = a.goods_id
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@
|
|||
b.phone,
|
||||
a.station_id,
|
||||
b.open,
|
||||
b.company_name station_name
|
||||
b.station_name
|
||||
FROM station_manage a
|
||||
INNER JOIN biz_company b ON b.id = a.station_id AND b.station = 1 AND b.deleted = 0
|
||||
INNER JOIN sys_user c ON c.id = a.user_id AND c.deleted = 0
|
||||
|
|
@ -111,7 +111,7 @@
|
|||
b.open,
|
||||
b.phone,
|
||||
b.id station_id,
|
||||
b.company_name station_name
|
||||
b.station_name
|
||||
FROM biz_company b
|
||||
INNER JOIN sys_user c ON c.id = 1 AND c.deleted = 0
|
||||
WHERE b.station = 1
|
||||
|
|
|
|||
Loading…
Reference in New Issue