| | |
| | | |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.dataInterchange.api.feignClient.UPExgMsgRealLocationClient; |
| | | import com.ruoyi.dataInterchange.api.vo.GnssDataVo; |
| | | import com.ruoyi.dataInterchange.api.vo.OrderTravelVo; |
| | | import org.springframework.cloud.openfeign.FallbackFactory; |
| | | |
| | |
| | | |
| | | @Override |
| | | public UPExgMsgRealLocationClient create(Throwable cause) { |
| | | return new UPExgMsgRealLocationClient(){ |
| | | |
| | | @Override |
| | | return new UPExgMsgRealLocationClient() { |
| | | |
| | | @Override |
| | | public R<List<OrderTravelVo>> getOrderTravel(String vehicleNo, Long start, Long end) { |
| | | return R.fail("获取订单行程轨迹失败:" + cause.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public R<GnssDataVo> getVehicleSpeed(String vehicleNo) { |
| | | return R.fail("获取司机的最新定位信息失败:" + cause.getMessage()); |
| | | } |
| | | }; |
| | | } |
| | | } |
| | |
| | | import com.ruoyi.common.core.constant.ServiceNameConstants; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.dataInterchange.api.factory.UPExgMsgRealLocationClientFallbackFactory; |
| | | import com.ruoyi.dataInterchange.api.vo.GnssDataVo; |
| | | import com.ruoyi.dataInterchange.api.vo.OrderTravelVo; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | |
| | | import java.util.List; /** |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2025/3/24 19:06 |
| | | */ |
| | |
| | | public interface UPExgMsgRealLocationClient { |
| | | |
| | | |
| | | |
| | | /** |
| | | * 获取订单行程轨迹 |
| | | * |
| | | * @param vehicleNo |
| | | * @param start |
| | | * @param end |
| | |
| | | */ |
| | | @PostMapping("/upExgMsgRealLocation/getOrderTravel") |
| | | R<List<OrderTravelVo>> getOrderTravel(@RequestParam("vehicleNo") String vehicleNo, @RequestParam("start") Long start, |
| | | @RequestParam("end") Long end); |
| | | @RequestParam("end") Long end); |
| | | |
| | | |
| | | /** |
| | | * 获取司机的最新定位信息 |
| | | * |
| | | * @param vehicleNo |
| | | * @return |
| | | */ |
| | | @PostMapping("/upExgMsgRealLocation/getVehicleSpeed") |
| | | R<GnssDataVo> getVehicleSpeed(@RequestParam("vehicleNo") String vehicleNo); |
| | | } |
New file |
| | |
| | | package com.ruoyi.dataInterchange.api.vo; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * 车辆定位信息 |
| | | * |
| | | * @author zhibing.pu |
| | | * @Date 2025/2/24 11:56 |
| | | */ |
| | | @Data |
| | | public class GnssDataVo { |
| | | /** |
| | | * 定位信息是否使用国家测绘局批准的地图表米插件进行加密 |
| | | * 加密标识 |
| | | * 1:已加密 |
| | | * 0:未加密 |
| | | */ |
| | | private int encrypt; |
| | | /** |
| | | * 日月年 |
| | | */ |
| | | private String date; |
| | | /** |
| | | * 时分秒 |
| | | */ |
| | | private String time; |
| | | /** |
| | | * 经度 |
| | | */ |
| | | private int lon; |
| | | /** |
| | | * 纬度 |
| | | */ |
| | | private int lat; |
| | | /** |
| | | * 速度 |
| | | */ |
| | | private int vec1; |
| | | /** |
| | | * 行驶记录速度 |
| | | */ |
| | | private int vec2; |
| | | /** |
| | | * 车辆当前总里程数 |
| | | */ |
| | | private int vec3; |
| | | /** |
| | | * 方向 |
| | | */ |
| | | private int direction; |
| | | /** |
| | | * 海拔高度 |
| | | */ |
| | | private int altitude; |
| | | /** |
| | | * 车辆状态 |
| | | */ |
| | | private int state; |
| | | /** |
| | | * 报警状态 |
| | | */ |
| | | private int alarm; |
| | | } |
| | |
| | | import com.ruoyi.common.core.annotation.Excel; |
| | | import com.ruoyi.common.core.annotation.Excel.ColumnType; |
| | | import com.ruoyi.common.core.web.domain.BaseEntity; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import org.apache.commons.lang3.builder.ToStringBuilder; |
| | | import org.apache.commons.lang3.builder.ToStringStyle; |
| | | |
| | | import javax.validation.constraints.NotBlank; |
| | | import javax.validation.constraints.Size; |
| | | import java.util.List; |
| | | import java.util.Set; |
| | | |
| | | /** |
| | | * 角色表 sys_role |
| | | * |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class SysRole extends BaseEntity |
| | | { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** 角色ID */ |
| | | @Excel(name = "角色序号", cellType = ColumnType.NUMERIC) |
| | | @TableField("role_id") |
| | | private Long roleId; |
| | | |
| | | /** 角色名称 */ |
| | | @Excel(name = "角色名称") |
| | | @TableField("role_name") |
| | | private String roleName; |
| | | |
| | | /** 角色权限 */ |
| | | @Excel(name = "角色权限") |
| | | @TableField("role_key") |
| | | private String roleKey; |
| | | |
| | | /** 数据范围(1:所有数据权限;2:自定义数据权限;3:本部门数据权限;4:本部门及以下数据权限;5:仅本人数据权限) */ |
| | | @Excel(name = "数据范围", readConverterExp = "1=所有数据权限,2=自定义数据权限,3=本部门数据权限,4=本部门及以下数据权限,5=仅本人数据权限") |
| | | @TableField("data_scope") |
| | | private String dataScope; |
| | | |
| | | |
| | | /** 角色状态(0正常 1停用) */ |
| | | @Excel(name = "角色状态", readConverterExp = "0=正常,1=停用") |
| | | private String status; |
| | | /** |
| | | * 门店id |
| | | */ |
| | | @TableField("shop_id") |
| | | private Integer shopId; |
| | | |
| | | /** 删除标志(0代表存在 2代表删除) */ |
| | | @TableField("del_flag") |
| | | private String delFlag; |
| | | |
| | | /** 用户是否存在此角色标识 默认不存在 */ |
| | | @TableField(exist = false) |
| | | private boolean flag = false; |
| | | |
| | | /** 菜单组 */ |
| | | @TableField(exist = false) |
| | | private Long[] menuIds; |
| | | |
| | | /** 部门组(数据权限) */ |
| | | @TableField(exist = false) |
| | | private Long[] deptIds; |
| | | |
| | | /** 角色菜单权限 */ |
| | | @TableField(exist = false) |
| | | private Set<String> permissions; |
| | | @ApiModelProperty(value = "站点名称") |
| | | @TableField(exist = false) |
| | | private List<String> siteNames; |
| | | |
| | | @TableField(exist = false) |
| | | private Long number; |
| | | |
| | | |
| | | public SysRole() |
| | | { |
| | | |
| | | } |
| | | |
| | | public SysRole(Long roleId) |
| | | { |
| | | this.roleId = roleId; |
| | | } |
| | | |
| | | public Long getRoleId() |
| | | { |
| | | return roleId; |
| | | } |
| | | |
| | | public void setRoleId(Long roleId) |
| | | { |
| | | this.roleId = roleId; |
| | | } |
| | | |
| | | public boolean isAdmin() |
| | | { |
| | | return isAdmin(this.roleId); |
| | | } |
| | | |
| | | public static boolean isAdmin(Long roleId) |
| | | { |
| | | return roleId != null && 1L == roleId; |
| | | } |
| | | |
| | | @NotBlank(message = "角色名称不能为空") |
| | | @Size(min = 0, max = 30, message = "角色名称长度不能超过30个字符") |
| | | public String getRoleName() |
| | | { |
| | | return roleName; |
| | | } |
| | | |
| | | public void setRoleName(String roleName) |
| | | { |
| | | this.roleName = roleName; |
| | | } |
| | | |
| | | @NotBlank(message = "权限字符不能为空") |
| | | @Size(min = 0, max = 100, message = "权限字符长度不能超过100个字符") |
| | | public String getRoleKey() |
| | | { |
| | | return roleKey; |
| | | } |
| | | |
| | | public void setRoleKey(String roleKey) |
| | | { |
| | | this.roleKey = roleKey; |
| | | } |
| | | |
| | | public String getDataScope() |
| | | { |
| | | return dataScope; |
| | | } |
| | | |
| | | public void setDataScope(String dataScope) |
| | | { |
| | | this.dataScope = dataScope; |
| | | } |
| | | |
| | | public String getStatus() |
| | | { |
| | | return status; |
| | | } |
| | | |
| | | public void setStatus(String status) |
| | | { |
| | | this.status = status; |
| | | } |
| | | |
| | | public String getDelFlag() |
| | | { |
| | | return delFlag; |
| | | } |
| | | |
| | | public void setDelFlag(String delFlag) |
| | | { |
| | | this.delFlag = delFlag; |
| | | } |
| | | |
| | | public boolean isFlag() |
| | | { |
| | | return flag; |
| | | } |
| | | |
| | | public void setFlag(boolean flag) |
| | | { |
| | | this.flag = flag; |
| | | } |
| | | |
| | | public Long[] getMenuIds() |
| | | { |
| | | return menuIds; |
| | | } |
| | | |
| | | public void setMenuIds(Long[] menuIds) |
| | | { |
| | | this.menuIds = menuIds; |
| | | } |
| | | |
| | | public Long[] getDeptIds() |
| | | { |
| | | return deptIds; |
| | | } |
| | | |
| | | public void setDeptIds(Long[] deptIds) |
| | | { |
| | | this.deptIds = deptIds; |
| | | } |
| | | |
| | | public Set<String> getPermissions() |
| | | { |
| | | return permissions; |
| | | } |
| | | |
| | | public void setPermissions(Set<String> permissions) |
| | | { |
| | | this.permissions = permissions; |
| | | } |
| | | |
| | | public List<String> getSiteNames() { |
| | | return siteNames; |
| | | } |
| | | |
| | | public void setSiteNames(List<String> siteNames) { |
| | | this.siteNames = siteNames; |
| | | } |
| | | |
| | | public Long getNumber() { |
| | | return number; |
| | | } |
| | | |
| | | public void setNumber(Long number) { |
| | | this.number = number; |
| | | } |
| | | |
| | | public Integer getShopId() { |
| | | return shopId; |
| | | } |
| | | |
| | | public void setShopId(Integer shopId) { |
| | | this.shopId = shopId; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) |
| | | .append("roleId", getRoleId()) |
| | | .append("roleName", getRoleName()) |
| | | .append("roleKey", getRoleKey()) |
| | | .append("dataScope", getDataScope()) |
| | | .append("status", getStatus()) |
| | | .append("delFlag", getDelFlag()) |
| | | .append("createBy", getCreateBy()) |
| | | .append("createTime", getCreateTime()) |
| | | .append("updateBy", getUpdateBy()) |
| | | .append("updateTime", getUpdateTime()) |
| | | .append("remark", getRemark()) |
| | | .toString(); |
| | | } |
| | | public class SysRole extends BaseEntity { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 角色ID |
| | | */ |
| | | @Excel(name = "角色序号", cellType = ColumnType.NUMERIC) |
| | | @TableField("role_id") |
| | | private Long roleId; |
| | | |
| | | /** |
| | | * 角色名称 |
| | | */ |
| | | @Excel(name = "角色名称") |
| | | @TableField("role_name") |
| | | private String roleName; |
| | | |
| | | /** |
| | | * 备注 |
| | | */ |
| | | @Excel(name = "备注") |
| | | @TableField("remark") |
| | | private String remark; |
| | | |
| | | /** |
| | | * 角色权限 |
| | | */ |
| | | @Excel(name = "角色权限") |
| | | @TableField("role_key") |
| | | private String roleKey; |
| | | |
| | | /** |
| | | * 数据范围(1:所有数据权限;2:自定义数据权限;3:本部门数据权限;4:本部门及以下数据权限;5:仅本人数据权限) |
| | | */ |
| | | @Excel(name = "数据范围", readConverterExp = "1=所有数据权限,2=自定义数据权限,3=本部门数据权限,4=本部门及以下数据权限,5=仅本人数据权限") |
| | | @TableField("data_scope") |
| | | private String dataScope; |
| | | |
| | | |
| | | /** |
| | | * 角色状态(0正常 1停用) |
| | | */ |
| | | @Excel(name = "角色状态", readConverterExp = "0=正常,1=停用") |
| | | private String status; |
| | | |
| | | /** |
| | | * 删除标志(0代表存在 2代表删除) |
| | | */ |
| | | @TableField("del_flag") |
| | | private String delFlag; |
| | | |
| | | /** |
| | | * 用户是否存在此角色标识 默认不存在 |
| | | */ |
| | | @TableField(exist = false) |
| | | private boolean flag = false; |
| | | |
| | | /** |
| | | * 菜单组 |
| | | */ |
| | | @TableField(exist = false) |
| | | private Long[] menuIds; |
| | | |
| | | /** |
| | | * 部门组(数据权限) |
| | | */ |
| | | @TableField(exist = false) |
| | | private Long[] deptIds; |
| | | |
| | | /** |
| | | * 角色菜单权限 |
| | | */ |
| | | @TableField(exist = false) |
| | | private Set<String> permissions; |
| | | |
| | | |
| | | public SysRole() { |
| | | |
| | | } |
| | | |
| | | public SysRole(Long roleId) { |
| | | this.roleId = roleId; |
| | | } |
| | | |
| | | public static boolean isAdmin(Long roleId) { |
| | | return roleId != null && 1L == roleId; |
| | | } |
| | | |
| | | public Long getRoleId() { |
| | | return roleId; |
| | | } |
| | | |
| | | public void setRoleId(Long roleId) { |
| | | this.roleId = roleId; |
| | | } |
| | | |
| | | public boolean isAdmin() { |
| | | return isAdmin(this.roleId); |
| | | } |
| | | |
| | | @NotBlank(message = "角色名称不能为空") |
| | | @Size(min = 0, max = 30, message = "角色名称长度不能超过30个字符") |
| | | public String getRoleName() { |
| | | return roleName; |
| | | } |
| | | |
| | | public void setRoleName(String roleName) { |
| | | this.roleName = roleName; |
| | | } |
| | | |
| | | @NotBlank(message = "权限字符不能为空") |
| | | @Size(min = 0, max = 100, message = "权限字符长度不能超过100个字符") |
| | | public String getRoleKey() { |
| | | return roleKey; |
| | | } |
| | | |
| | | public void setRoleKey(String roleKey) { |
| | | this.roleKey = roleKey; |
| | | } |
| | | |
| | | public String getDataScope() { |
| | | return dataScope; |
| | | } |
| | | |
| | | public void setDataScope(String dataScope) { |
| | | this.dataScope = dataScope; |
| | | } |
| | | |
| | | public String getStatus() { |
| | | return status; |
| | | } |
| | | |
| | | public void setStatus(String status) { |
| | | this.status = status; |
| | | } |
| | | |
| | | public String getDelFlag() { |
| | | return delFlag; |
| | | } |
| | | |
| | | public void setDelFlag(String delFlag) { |
| | | this.delFlag = delFlag; |
| | | } |
| | | |
| | | public boolean isFlag() { |
| | | return flag; |
| | | } |
| | | |
| | | public void setFlag(boolean flag) { |
| | | this.flag = flag; |
| | | } |
| | | |
| | | public Long[] getMenuIds() { |
| | | return menuIds; |
| | | } |
| | | |
| | | public void setMenuIds(Long[] menuIds) { |
| | | this.menuIds = menuIds; |
| | | } |
| | | |
| | | public Long[] getDeptIds() { |
| | | return deptIds; |
| | | } |
| | | |
| | | public void setDeptIds(Long[] deptIds) { |
| | | this.deptIds = deptIds; |
| | | } |
| | | |
| | | public Set<String> getPermissions() { |
| | | return permissions; |
| | | } |
| | | |
| | | public void setPermissions(Set<String> permissions) { |
| | | this.permissions = permissions; |
| | | } |
| | | |
| | | @Override |
| | | public String getRemark() { |
| | | return remark; |
| | | } |
| | | |
| | | @Override |
| | | public void setRemark(String remark) { |
| | | this.remark = remark; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) |
| | | .append("roleId", getRoleId()) |
| | | .append("roleName", getRoleName()) |
| | | .append("roleKey", getRoleKey()) |
| | | .append("dataScope", getDataScope()) |
| | | .append("status", getStatus()) |
| | | .append("delFlag", getDelFlag()) |
| | | .append("createBy", getCreateBy()) |
| | | .append("createTime", getCreateTime()) |
| | | .append("updateBy", getUpdateBy()) |
| | | .append("updateTime", getUpdateTime()) |
| | | .append("remark", getRemark()) |
| | | .toString(); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.api.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2025/3/27 17:20 |
| | | */ |
| | | @Data |
| | | @ApiModel |
| | | @TableName("t_car_type") |
| | | public class CarType { |
| | | /** |
| | | * 主键 |
| | | */ |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | /** |
| | | * 名称 |
| | | */ |
| | | @TableField("name") |
| | | @ApiModelProperty("名称") |
| | | private String name; |
| | | /** |
| | | * 图标 |
| | | */ |
| | | @TableField("icon") |
| | | @ApiModelProperty("图标") |
| | | private String icon; |
| | | /** |
| | | * 车辆数 |
| | | */ |
| | | @TableField("car_num") |
| | | @ApiModelProperty("车辆数") |
| | | private Integer carNum; |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.api.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import lombok.Data; |
| | | |
| | | import java.time.LocalDateTime; |
| | | |
| | | /** |
| | | * 投诉 |
| | | * |
| | | * @author zhibing.pu |
| | | * @Date 2025/3/27 17:46 |
| | | */ |
| | | @Data |
| | | @TableName("t_complain") |
| | | public class Complain { |
| | | /** |
| | | * 主键 |
| | | */ |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | /** |
| | | * 车辆id |
| | | */ |
| | | @TableField("car_id") |
| | | private Integer carId; |
| | | /** |
| | | * 司机id |
| | | */ |
| | | @TableField("driver_id") |
| | | private Integer driverId; |
| | | /** |
| | | * 企业id |
| | | */ |
| | | @TableField("enterprise_id") |
| | | private Integer enterpriseId; |
| | | /** |
| | | * 投诉人电话 |
| | | */ |
| | | @TableField("complain_phone") |
| | | private String complainPhone; |
| | | /** |
| | | * 投诉内容 |
| | | */ |
| | | @TableField("content") |
| | | private String content; |
| | | /** |
| | | * 投诉时间 |
| | | */ |
| | | @TableField("complain_time") |
| | | private String complainTime; |
| | | /** |
| | | * 处理状态 |
| | | */ |
| | | @TableField("treatment_state") |
| | | private String treatmentState; |
| | | /** |
| | | * 处理人 |
| | | */ |
| | | @TableField("treatment_user") |
| | | private String treatmentUser; |
| | | /** |
| | | * 处理时间 |
| | | */ |
| | | @TableField("treatment_time") |
| | | private String treatmentTime; |
| | | /** |
| | | * 处理描述 |
| | | */ |
| | | @TableField("treatment_remark") |
| | | private String treatmentRemark; |
| | | /** |
| | | * 添加时间 |
| | | */ |
| | | @TableField("create_time") |
| | | private LocalDateTime createTime; |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.time.LocalDateTime; |
| | |
| | | * @Date 2025/3/17 16:12 |
| | | */ |
| | | @Data |
| | | @ApiModel |
| | | @TableName("t_driver") |
| | | public class Driver { |
| | | /** |
| | | * 主键 |
| | | */ |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | @ApiModelProperty("主键") |
| | | private Integer id; |
| | | /** |
| | | * 姓名 |
| | | */ |
| | | @TableField("name") |
| | | @ApiModelProperty("姓名") |
| | | private String name; |
| | | /** |
| | | * 手机号 |
| | | */ |
| | | @TableField("phone") |
| | | @ApiModelProperty("手机号") |
| | | private String phone; |
| | | /** |
| | | * 所属企业id |
| | | */ |
| | | @TableField("enterprise_id") |
| | | @ApiModelProperty("所属企业id") |
| | | private Integer enterpriseId; |
| | | /** |
| | | * 驾驶证号 |
| | | */ |
| | | @TableField("driving_license_number") |
| | | @ApiModelProperty("驾驶证号") |
| | | private String drivingLicenseNumber; |
| | | /** |
| | | * 通讯地址 |
| | | */ |
| | | @TableField("mailing_address") |
| | | @ApiModelProperty("通讯地址") |
| | | private String mailingAddress; |
| | | /** |
| | | * 紧急联系人 |
| | | */ |
| | | @TableField("emergency_contact") |
| | | @ApiModelProperty("紧急联系人") |
| | | private String emergencyContact; |
| | | /** |
| | | * 紧急联系电话 |
| | | */ |
| | | @TableField("emergency_phone") |
| | | @ApiModelProperty("紧急联系电话") |
| | | private String emergencyPhone; |
| | | /** |
| | | * 紧急联系人通讯地址 |
| | | */ |
| | | @TableField("emergency_mailing_address") |
| | | @ApiModelProperty("紧急联系人通讯地址") |
| | | private String emergencyMailingAddress; |
| | | /** |
| | | * 婚姻状况 |
| | | */ |
| | | @TableField("marital_status") |
| | | @ApiModelProperty("婚姻状况") |
| | | private String maritalStatus; |
| | | /** |
| | | * 性别 |
| | | */ |
| | | @TableField("gender") |
| | | @ApiModelProperty("性别") |
| | | private String gender; |
| | | /** |
| | | * 出生日期 |
| | | */ |
| | | @TableField("birthday") |
| | | @ApiModelProperty("出生日期") |
| | | private String birthday; |
| | | /** |
| | | * 国籍 |
| | | */ |
| | | @TableField("nation") |
| | | @ApiModelProperty("国籍") |
| | | private String nation; |
| | | /** |
| | | * 民族 |
| | | */ |
| | | @TableField("nationality") |
| | | @ApiModelProperty("民族") |
| | | private String nationality; |
| | | /** |
| | | * 外语 |
| | | */ |
| | | @TableField("foreign_languages") |
| | | @ApiModelProperty("外语") |
| | | private String foreignLanguages; |
| | | /** |
| | | * 学历 |
| | | */ |
| | | @TableField("education") |
| | | @ApiModelProperty("学历") |
| | | private String education; |
| | | /** |
| | | * 户籍登记机关 |
| | | */ |
| | | @TableField("household_registration_authority") |
| | | @ApiModelProperty("户籍登记机关") |
| | | private String householdRegistrationAuthority; |
| | | /** |
| | | * 户籍所在地 |
| | | */ |
| | | @TableField("domicile") |
| | | @ApiModelProperty("户籍所在地") |
| | | private String domicile; |
| | | /** |
| | | * 签约公司 |
| | | */ |
| | | @TableField("contracting_company") |
| | | @ApiModelProperty("签约公司") |
| | | private String contractingCompany; |
| | | /** |
| | | * 驾驶员照片 |
| | | */ |
| | | @TableField("avatar_file") |
| | | @ApiModelProperty("驾驶员照片") |
| | | private String avatarFile; |
| | | /** |
| | | * 驾驶证照片 |
| | | */ |
| | | @TableField("driving_licence_file") |
| | | @ApiModelProperty("驾驶证照片") |
| | | private String drivingLicenceFile; |
| | | /** |
| | | * 准驾车型 |
| | | */ |
| | | @TableField("quasi_driving_type") |
| | | @ApiModelProperty("准驾车型") |
| | | private String quasiDrivingType; |
| | | /** |
| | | * 初次领取驾驶证日期 |
| | | */ |
| | | @TableField("first_license_date") |
| | | @ApiModelProperty("初次领取驾驶证日期") |
| | | private String firstLicenseDate; |
| | | /** |
| | | * 驾驶证有效开始时间 |
| | | */ |
| | | @TableField("driving_licence_start") |
| | | @ApiModelProperty("驾驶证有效开始时间") |
| | | private String drivingLicenceStart; |
| | | /** |
| | | * 驾驶证有效期结束时间 |
| | | */ |
| | | @TableField("driving_licence_end") |
| | | @ApiModelProperty("驾驶证有效期结束时间") |
| | | private String drivingLicenceEnd; |
| | | /** |
| | | * 是否是巡游出租车 |
| | | */ |
| | | @TableField("cruise_taxi") |
| | | @ApiModelProperty("是否是巡游出租车") |
| | | private String cruiseTaxi; |
| | | /** |
| | | * 资格证号 |
| | | */ |
| | | @TableField("certification") |
| | | @ApiModelProperty("资格证号") |
| | | private String certification; |
| | | /** |
| | | * 资格证发证日期 |
| | | */ |
| | | @TableField("certification_issue_date") |
| | | @ApiModelProperty("资格证发证日期") |
| | | private String certificationIssueDate; |
| | | /** |
| | | * 初次领取资格证日期 |
| | | */ |
| | | @TableField("first_license_certification") |
| | | @ApiModelProperty("初次领取资格证日期") |
| | | private String firstLicenseCertification; |
| | | /** |
| | | * 资格证有效期开始时间 |
| | | */ |
| | | @TableField("certification_start") |
| | | @ApiModelProperty("资格证有效期开始时间") |
| | | private String certificationStart; |
| | | /** |
| | | * 资格证有效期结束时间 |
| | | */ |
| | | @TableField("certification_end") |
| | | @ApiModelProperty("资格证有效期结束时间") |
| | | private String certificationEnd; |
| | | /** |
| | | * 资格证发证机构名称 |
| | | */ |
| | | @TableField("orgName") |
| | | @ApiModelProperty("资格证发证机构名称") |
| | | private String orgName; |
| | | /** |
| | | * 司机平台注册日期 |
| | | */ |
| | | @TableField("registration_date") |
| | | @ApiModelProperty("司机平台注册日期") |
| | | private String registrationDate; |
| | | /** |
| | | * 司机是都在黑名单中 |
| | | */ |
| | | @TableField("blacklist") |
| | | @ApiModelProperty("司机是都在黑名单中") |
| | | private String blacklist; |
| | | /** |
| | | * 专职驾驶员 |
| | | */ |
| | | @TableField("full_time_driver") |
| | | @ApiModelProperty("专职驾驶员") |
| | | private String fullTimeDriver; |
| | | /** |
| | | * 营运类型 |
| | | */ |
| | | @TableField("operation_type") |
| | | @ApiModelProperty("营运类型") |
| | | private String operationType; |
| | | /** |
| | | * 合同有效期开始时间 |
| | | */ |
| | | @TableField("contract_life_start") |
| | | @ApiModelProperty("合同有效期开始时间") |
| | | private String contractLifeStart; |
| | | /** |
| | | * 合同有效期结束时间 |
| | | */ |
| | | @TableField("contract_life_end") |
| | | @ApiModelProperty("合同有效期结束时间") |
| | | private String contractLifeEnd; |
| | | /** |
| | | * 状态(1=有效,2=无效) |
| | | */ |
| | | @TableField("status") |
| | | @ApiModelProperty("状态(1=有效,2=无效)") |
| | | private Integer status; |
| | | /** |
| | | * 标识(1=新增,2=修改) |
| | | */ |
| | | @TableField("flag") |
| | | @ApiModelProperty("标识(1=新增,2=修改)") |
| | | private Integer flag; |
| | | /** |
| | | * 更新时间 |
| | | */ |
| | | @TableField("update_time") |
| | | @ApiModelProperty("更新时间") |
| | | private LocalDateTime updateTime; |
| | | /** |
| | | * 车牌号 |
| | | */ |
| | | @TableField("vehicle_number") |
| | | @ApiModelProperty("车牌号") |
| | | private String vehicleNumber; |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.api.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDateTime; |
| | | |
| | | /** |
| | | * 车辆预警 |
| | | * |
| | | * @author zhibing.pu |
| | | * @Date 2025/3/27 14:26 |
| | | */ |
| | | @Data |
| | | @TableName("t_warn") |
| | | public class Warn { |
| | | /** |
| | | * 主键 |
| | | */ |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | /** |
| | | * 车辆id |
| | | */ |
| | | @TableField("car_id") |
| | | private Integer carId; |
| | | /** |
| | | * 司机id |
| | | */ |
| | | @TableField("driver_id") |
| | | private Integer driverId; |
| | | /** |
| | | * 企业id |
| | | */ |
| | | @TableField("enterprise_id") |
| | | private Integer enterpriseId; |
| | | /** |
| | | * 持续报警 |
| | | */ |
| | | @TableField("keep_warn") |
| | | private String keepWarn; |
| | | /** |
| | | * 终端号 |
| | | */ |
| | | @TableField("terminal_number") |
| | | private String terminalNumber; |
| | | /** |
| | | * 报警开始时间 |
| | | */ |
| | | @TableField("start_time") |
| | | private String startTime; |
| | | /** |
| | | * 报警结束时间 |
| | | */ |
| | | @TableField("end_time") |
| | | private String endTime; |
| | | /** |
| | | * 持续时间(s) |
| | | */ |
| | | @TableField("keep_time") |
| | | private Integer keepTime; |
| | | /** |
| | | * 持续里程(km) |
| | | */ |
| | | @TableField("keep_distance") |
| | | private BigDecimal keepDistance; |
| | | /** |
| | | * 报警类型 |
| | | */ |
| | | @TableField("warn_type") |
| | | private String warnType; |
| | | /** |
| | | * 报警次数 |
| | | */ |
| | | @TableField("warn_number") |
| | | private Integer warnNumber; |
| | | /** |
| | | * 当前速度 |
| | | */ |
| | | @TableField("speed") |
| | | private BigDecimal speed; |
| | | /** |
| | | * 经度 |
| | | */ |
| | | @TableField("longitude") |
| | | private String longitude; |
| | | /** |
| | | * 纬度 |
| | | */ |
| | | @TableField("latitude") |
| | | private String latitude; |
| | | /** |
| | | * 详细地址 |
| | | */ |
| | | @TableField("address") |
| | | private String address; |
| | | /** |
| | | * 处理状态 |
| | | */ |
| | | @TableField("treatment_state") |
| | | private String treatmentState; |
| | | /** |
| | | * 处理人 |
| | | */ |
| | | @TableField("treatment_user") |
| | | private String treatmentUser; |
| | | /** |
| | | * 处理时间 |
| | | */ |
| | | @TableField("treatment_time") |
| | | private String treatmentTime; |
| | | /** |
| | | * 处理描述 |
| | | */ |
| | | @TableField("treatment_remark") |
| | | private String treatmentRemark; |
| | | /** |
| | | * 添加时间 |
| | | */ |
| | | @TableField("create_time") |
| | | private LocalDateTime createTime; |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.dataInterchange.api.feignClient.PlaybackMsgClient; |
| | | import com.ruoyi.dataInterchange.api.feignClient.RealVideoMsgClient; |
| | |
| | | import com.ruoyi.dataInterchange.api.vo.UPPlaybackMsgStartupAckVo; |
| | | import com.ruoyi.dataInterchange.api.vo.UPRealvideoMsgStartupAckVo; |
| | | import com.ruoyi.system.api.model.Car; |
| | | import com.ruoyi.system.api.model.CarType; |
| | | import com.ruoyi.system.api.model.Driver; |
| | | import com.ruoyi.system.api.model.Enterprise; |
| | | import com.ruoyi.system.query.*; |
| | | import com.ruoyi.system.service.ICarService; |
| | | import com.ruoyi.system.service.ICarTypeService; |
| | | import com.ruoyi.system.service.IDriverService; |
| | | import com.ruoyi.system.service.IEnterpriseService; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | |
| | | @Resource |
| | | private UPExgMsgRealLocationClient upExgMsgRealLocationClient; |
| | | |
| | | @Resource |
| | | private ICarTypeService carTypeService; |
| | | |
| | | |
| | | @GetMapping("/getCarList") |
| | | @ApiOperation(value = "获取车辆列表", tags = {"车辆管理"}) |
| | |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "车辆id", name = "id", required = true) |
| | | }) |
| | | public R<Car> getCarInfo(@PathVariable("id") Integer id){ |
| | | public R<Car> getCarInfo(@PathVariable("id") Integer id) { |
| | | Car car = carService.getById(id); |
| | | if(null == car){ |
| | | if (null == car) { |
| | | return R.fail("失败"); |
| | | } |
| | | Driver driver = driverService.getOne(new LambdaQueryWrapper<Driver>().eq(Driver::getVehicleNumber, car.getVehicleNumber()).eq(Driver::getStatus, 1)); |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | @GetMapping("/getRealVideo/{id}") |
| | | @ApiOperation(value = "获取实时音视频", tags = {"车辆管理"}) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "车辆id", name = "id", required = true) |
| | | }) |
| | | public R<RealVideoResp> getRealVideo(@PathVariable("id") Integer id){ |
| | | public R<RealVideoResp> getRealVideo(@PathVariable("id") Integer id) { |
| | | Car car = carService.getById(id); |
| | | if(null == car){ |
| | | if (null == car) { |
| | | return R.fail("失败"); |
| | | } |
| | | Enterprise enterprise = enterpriseService.getById(car.getEnterpriseId()); |
| | | R<UPRealvideoMsgStartupAckVo> msgStartupAckVoR = realVideoMsgClient.startupRealVideo(Integer.valueOf(enterprise.getCode()), car.getVehicleNumber()); |
| | | if(200 == msgStartupAckVoR.getCode()){ |
| | | if (200 == msgStartupAckVoR.getCode()) { |
| | | UPRealvideoMsgStartupAckVo data = msgStartupAckVoR.getData(); |
| | | RealVideoResp resp = new RealVideoResp(); |
| | | resp.setServerIp(data.getServerIP()); |
| | |
| | | |
| | | @GetMapping("/getPlaybackVideo") |
| | | @ApiOperation(value = "获取音视频回放", tags = {"车辆管理"}) |
| | | public R<RealVideoResp> getPlaybackVideo(PlaybackVideoReq req){ |
| | | public R<RealVideoResp> getPlaybackVideo(PlaybackVideoReq req) { |
| | | Car car = carService.getById(req.getId()); |
| | | if(null == car){ |
| | | if (null == car) { |
| | | return R.fail("失败"); |
| | | } |
| | | Enterprise enterprise = enterpriseService.getById(car.getEnterpriseId()); |
| | | R<UPPlaybackMsgStartupAckVo> startupAckVoR = playbackMsgClient.playbackMsgStartup(Integer.valueOf(enterprise.getCode()), car.getVehicleNumber(), |
| | | req.getStartTime(), req.getEndTime()); |
| | | if(200 == startupAckVoR.getCode()){ |
| | | if (200 == startupAckVoR.getCode()) { |
| | | UPPlaybackMsgStartupAckVo data = startupAckVoR.getData(); |
| | | RealVideoResp resp = new RealVideoResp(); |
| | | resp.setServerIp(data.getServerIP()); |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @GetMapping("/playbackMsgControl") |
| | | @ApiOperation(value = "音视频回放远程控制", tags = {"车辆管理"}) |
| | | public R playbackMsgControl(PlaybackMsgControlReq req){ |
| | | public R playbackMsgControl(PlaybackMsgControlReq req) { |
| | | Car car = carService.getById(req.getId()); |
| | | if(null == car){ |
| | | if (null == car) { |
| | | return R.fail("失败"); |
| | | } |
| | | Enterprise enterprise = enterpriseService.getById(car.getEnterpriseId()); |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @GetMapping("/getCarTravel") |
| | | @ApiOperation(value = "获取车辆行程轨迹", tags = {"车辆管理"}) |
| | | public R<List<OrderTravelVo>> getCarTravel(CarTravelReq req){ |
| | | public R<List<OrderTravelVo>> getCarTravel(CarTravelReq req) { |
| | | Car car = carService.getOne(new LambdaQueryWrapper<Car>().eq(Car::getVehicleNumber, req.getVehicleNumber())); |
| | | Long startTime; |
| | | Long endTime; |
| | | if(null != req.getStartTime() && null != req.getEndTime()){ |
| | | if (null != req.getStartTime() && null != req.getEndTime()) { |
| | | startTime = req.getStartTime(); |
| | | endTime = req.getEndTime(); |
| | | }else{ |
| | | } else { |
| | | LocalDateTime now = LocalDateTime.now(); |
| | | startTime = now.minusMinutes(1).toEpochSecond(ZoneOffset.ofHours(8)); |
| | | endTime = now.toEpochSecond(ZoneOffset.ofHours(8)); |
| | |
| | | R<List<OrderTravelVo>> orderTravel = upExgMsgRealLocationClient.getOrderTravel(car.getVehicleNumber(), startTime, endTime); |
| | | return orderTravel; |
| | | } |
| | | |
| | | |
| | | @GetMapping("/getCarTypeList") |
| | | @ApiOperation(value = "获取车辆类型列表数据", tags = {"车辆类型"}) |
| | | public R<List<CarType>> getCarTypeList(String name) { |
| | | List<CarType> list = carTypeService.list(new LambdaQueryWrapper<CarType>().like(StringUtils.isNotEmpty(name), CarType::getName, name)); |
| | | return R.ok(list); |
| | | } |
| | | |
| | | |
| | | @GetMapping("/getCarCount") |
| | | @ApiOperation(value = "获取各种车辆类型车辆总数", tags = {"首页"}) |
| | | public R<List<CarType>> getCarCount() { |
| | | List<CarType> list = carTypeService.list(); |
| | | return R.ok(list); |
| | | } |
| | | |
| | | |
| | | @GetMapping("/getCarStatusCount") |
| | | @ApiOperation(value = "获取车辆状态汇总数据和公司总数等", tags = {"首页"}) |
| | | public R<CarStatusCount> getCarStatusCount() { |
| | | List<Car> list = carService.list(); |
| | | long online = list.stream().filter(s -> s.getStatus() == 1).count(); |
| | | long offline = list.stream().filter(s -> s.getStatus() == 3).count(); |
| | | long breakdown = list.stream().filter(s -> s.getStatus() == 4).count(); |
| | | long abnormal = list.stream().filter(s -> s.getStatus() == 2).count(); |
| | | CarStatusCount carStatusCount = new CarStatusCount(); |
| | | carStatusCount.setOffline(offline); |
| | | carStatusCount.setOnline(online); |
| | | carStatusCount.setBreakdown(breakdown); |
| | | carStatusCount.setAbnormal(abnormal); |
| | | long enterprise = enterpriseService.count(); |
| | | carStatusCount.setEnterprise(enterprise); |
| | | carStatusCount.setCar(list.size()); |
| | | long driver = driverService.count(); |
| | | carStatusCount.setDriver(driver); |
| | | return R.ok(carStatusCount); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.controller; |
| | | |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.system.query.ComplainListReq; |
| | | import com.ruoyi.system.query.ComplainListResp; |
| | | import com.ruoyi.system.service.IComplainService; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2025/3/27 18:07 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/complain") |
| | | public class ComplainController { |
| | | |
| | | @Resource |
| | | private IComplainService complainService; |
| | | |
| | | |
| | | @GetMapping("/getComplainList") |
| | | @ApiOperation(value = "获取投诉记录列表", tags = {"投诉记录"}) |
| | | public R<PageInfo<ComplainListResp>> getComplainList(ComplainListReq complainListReq) { |
| | | PageInfo<ComplainListResp> page = complainService.getComplainList(complainListReq); |
| | | return R.ok(page); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.controller; |
| | | |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.system.api.model.Driver; |
| | | import com.ruoyi.system.query.DriverListReq; |
| | | import com.ruoyi.system.query.DriverListResp; |
| | | import com.ruoyi.system.service.IDriverService; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2025/3/27 16:20 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/driver") |
| | | public class DriverController { |
| | | |
| | | @Resource |
| | | private IDriverService driverService; |
| | | |
| | | @GetMapping("/getDriverList") |
| | | @ApiOperation(value = "获取司机列表", tags = {"司机管理"}) |
| | | public R<PageInfo<DriverListResp>> getDriverList(DriverListReq driverListReq) { |
| | | PageInfo<DriverListResp> page = driverService.getDriverList(driverListReq); |
| | | return R.ok(page); |
| | | } |
| | | |
| | | |
| | | @GetMapping("/getDriverInfo/{id}") |
| | | @ApiOperation(value = "获取司机详情", tags = {"司机管理"}) |
| | | public R<Driver> getDriverInfo(@PathVariable("id") Integer id) { |
| | | Driver driver = driverService.getById(id); |
| | | return R.ok(driver); |
| | | } |
| | | } |
| | |
| | | import com.ruoyi.system.api.model.GetSysRoleByIds; |
| | | import com.ruoyi.system.domain.SysMenus; |
| | | import com.ruoyi.system.domain.SysRoleMenu; |
| | | import com.ruoyi.system.domain.SysUserRole; |
| | | import com.ruoyi.system.domain.dto.RoleAddDto; |
| | | import com.ruoyi.system.domain.dto.RoleUpdateDto; |
| | | import com.ruoyi.system.domain.vo.RoleInfoVo; |
| | |
| | | private ISysUserService sysUserService; |
| | | |
| | | |
| | | @ApiOperation(value = "获取角色列表", tags = {"管理后台-账号管理", "门店后台-账号管理"}) |
| | | @ApiOperation(value = "获取角色列表", tags = {"管理后台-权限管理"}) |
| | | @GetMapping("/list") |
| | | public AjaxResult list() { |
| | | Long userid = tokenService.getLoginUser().getUserid(); |
| | | SysUser sysUser = sysUserService.getById(userid); |
| | | LambdaQueryWrapper<SysRole> wrapper = new LambdaQueryWrapper<SysRole>() |
| | | .ne(SysRole::getRoleId, 2) |
| | | .eq(SysRole::getDelFlag, 0) |
| | | .eq(SysRole::getStatus, 0); |
| | | if (sysUser.getRoleType() == 2) { |
| | | wrapper.eq(SysRole::getShopId, sysUser.getObjectId()); |
| | | } else { |
| | | wrapper.isNull(SysRole::getShopId); |
| | | } |
| | | List<SysRole> list = roleService.list(wrapper); |
| | | return AjaxResult.success(list); |
| | | } |
| | |
| | | |
| | | @ResponseBody |
| | | @GetMapping("/listPage") |
| | | @ApiOperation(value = "获取角色列表", tags = {"管理后台-权限管理", "门店后台-权限管理"}) |
| | | @ApiOperation(value = "获取角色列表", tags = {"角色管理"}) |
| | | public AjaxResult listPage(String name, BasePage basePage) { |
| | | PageInfo<SysRole> pageInfo = new PageInfo<>(basePage.getPageCurr(), basePage.getPageSize()); |
| | | LambdaQueryWrapper<SysRole> wrapper = new LambdaQueryWrapper<SysRole>().eq(SysRole::getStatus, 0).eq(SysRole::getDelFlag, 0); |
| | | if (StringUtils.isNotEmpty(name)) { |
| | | wrapper.like(SysRole::getRoleName, name); |
| | | } |
| | | Long userid = tokenService.getLoginUser().getUserid(); |
| | | SysUser sysUser = sysUserService.getById(userid); |
| | | if (sysUser.getRoleType() == 2) { |
| | | wrapper.eq(SysRole::getShopId, sysUser.getObjectId()); |
| | | } else { |
| | | wrapper.isNull(SysRole::getShopId); |
| | | } |
| | | wrapper.ne(SysRole::getRoleId, 2);//过滤门店管理员 |
| | | PageInfo<SysRole> page = roleService.page(pageInfo, wrapper.orderByDesc(SysRole::getCreateTime)); |
| | | for (SysRole record : page.getRecords()) { |
| | | long count = sysUserRoleService.count(new LambdaQueryWrapper<SysUserRole>().eq(SysUserRole::getRoleId, record.getRoleId())); |
| | | record.setNumber(count); |
| | | } |
| | | return AjaxResult.success(page); |
| | | } |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/roleAdd") |
| | | @ApiOperation(value = "添加角色", tags = {"管理后台-权限管理", "门店后台-权限管理"}) |
| | | @ApiOperation(value = "添加角色", tags = {"角色管理"}) |
| | | public AjaxResult roleAdd(@Validated @RequestBody RoleAddDto dto) { |
| | | SysRole role = new SysRole(); |
| | | role.setRoleName(dto.getRoleName()); |
| | | LambdaQueryWrapper<SysRole> wrapper = Wrappers.lambdaQuery(SysRole.class) |
| | | .eq(SysRole::getRoleName, dto.getRoleName()).eq(SysRole::getDelFlag, 0); |
| | | Long userid = tokenService.getLoginUser().getUserid(); |
| | | SysUser sysUser = sysUserService.getById(userid); |
| | | if (sysUser.getRoleType() == 2) { |
| | | wrapper.eq(SysRole::getShopId, sysUser.getObjectId()); |
| | | } |
| | | |
| | | long count = roleService.count(wrapper); |
| | | if (count > 0) { |
| | | return AjaxResult.error("角色已存在,请重新输入"); |
| | |
| | | role.setRemark(dto.getRemark()); |
| | | role.setCreateBy(SecurityUtils.getUsername()); |
| | | role.setCreateTime(new Date()); |
| | | |
| | | if (sysUser.getRoleType() == 2) { |
| | | role.setShopId(sysUser.getObjectId()); |
| | | } |
| | | roleService.insertRole(role); |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | |
| | | @GetMapping("/roleInfo") |
| | | @ApiOperation(value = "角色详情", tags = {"管理后台-权限管理"}) |
| | | @ApiOperation(value = "角色详情", tags = {"角色管理"}) |
| | | public AjaxResult roleInfo(@RequestParam Long id) { |
| | | SysRole role = roleService.selectRoleById(id); |
| | | RoleInfoVo roleInfoVo = new RoleInfoVo(); |
| | |
| | | |
| | | |
| | | @PostMapping("/roleUpdate") |
| | | @ApiOperation(value = "编辑角色", tags = {"管理后台-权限管理"}) |
| | | @ApiOperation(value = "编辑角色", tags = {"角色管理"}) |
| | | public AjaxResult roleUpdate(@Validated @RequestBody RoleUpdateDto dto) { |
| | | SysRole role = new SysRole(); |
| | | role.setRoleName(dto.getRoleName()); |
| | |
| | | ArrayList<SysRoleMenu> sysRoleMenus = new ArrayList<>(); |
| | | List<Long> menuIds = dto.getMenuIds(); |
| | | // 移除原来的权限菜单 |
| | | if (menuIds.contains(1061L)) { |
| | | sysRoleMenuMapper.delete(new LambdaQueryWrapper<SysRoleMenu>() |
| | | .eq(SysRoleMenu::getRoleId, dto.getRoleId())); |
| | | } else { |
| | | sysRoleMenuMapper.delete(new LambdaQueryWrapper<SysRoleMenu>() |
| | | .eq(SysRoleMenu::getRoleId, dto.getRoleId()) |
| | | .ne(SysRoleMenu::getMenuId, 1061L) |
| | | .ne(SysRoleMenu::getMenuId, 1062L) |
| | | .ne(SysRoleMenu::getMenuId, 1065L) |
| | | .ne(SysRoleMenu::getMenuId, 1073L) |
| | | .ne(SysRoleMenu::getMenuId, 1161L) |
| | | .ne(SysRoleMenu::getMenuId, 1203L) |
| | | ); |
| | | } |
| | | sysRoleMenuMapper.delete(new LambdaQueryWrapper<SysRoleMenu>() |
| | | .eq(SysRoleMenu::getRoleId, dto.getRoleId()) |
| | | ); |
| | | for (Long menuId : menuIds) { |
| | | SysRoleMenu sysRoleMenu = new SysRoleMenu(); |
| | | sysRoleMenu.setMenuId(menuId); |
| | |
| | | */ |
| | | @Log(title = "角色管理", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{roleIds}") |
| | | @ApiOperation(value = "删除角色", tags = {"管理后台-权限管理"}) |
| | | @ApiOperation(value = "删除角色", tags = {"角色管理"}) |
| | | public AjaxResult remove(@PathVariable Long[] roleIds) { |
| | | return toAjax(roleService.deleteRoleByIds(roleIds)); |
| | | } |
| | |
| | | * 获取用户列表 |
| | | */ |
| | | @GetMapping("/list") |
| | | @ApiOperation(value = "获取系统用户列表", tags = {"管理后台-账号管理", "门店后台-部门管理"}) |
| | | public AjaxResult list(GetSysUserList getSysUserList) { |
| | | @ApiOperation(value = "获取系统用户列表", tags = {"用户管理"}) |
| | | public AjaxResult<PageInfo<SysUser>> list(GetSysUserList getSysUserList) { |
| | | PageInfo<SysUser> pageInfo = new PageInfo<>(getSysUserList.getPageCurr(), getSysUserList.getPageSize()); |
| | | PageInfo<SysUser> page = userService.getList(pageInfo, getSysUserList); |
| | | return AjaxResult.success(page); |
| | |
| | | * 获取用户选择列表 |
| | | */ |
| | | @PostMapping("/getChangeUserList") |
| | | @ApiOperation(value = "获取用户选择列表", tags = {"管理后台-获取用户选择列表", "门店后台-部门管理"}) |
| | | @ApiOperation(value = "获取用户选择列表", tags = {"管理后台-获取用户选择列表"}) |
| | | public AjaxResult<PageInfo<SysUser>> getChangeUserList(@RequestBody ChangeUserQuery query) { |
| | | return AjaxResult.success(userService.getChangeUserList(query)); |
| | | } |
| | |
| | | */ |
| | | @Log(title = "用户管理", businessType = BusinessType.INSERT) |
| | | @PostMapping("/add") |
| | | @ApiOperation(value = "添加系统用户", tags = {"管理后台-账号管理", "门店后台-部门管理"}) |
| | | @ApiOperation(value = "添加系统用户", tags = {"用户管理"}) |
| | | public AjaxResult add(@RequestBody SysUser user) { |
| | | user.setUserName(user.getPhonenumber()); |
| | | Long userid = tokenService.getLoginUser().getUserid(); |
| | | SysUser sysUser1 = userService.getById(userid); |
| | | if (!org.springframework.util.StringUtils.hasLength(user.getNickName())) { |
| | | user.setNickName(user.getPhonenumber()); |
| | | } |
| | | if (StringUtils.isNotEmpty(user.getPhonenumber()) && !userService.checkPhoneUnique(user)) { |
| | | return error("手机号已开通账号"); |
| | | } |
| | | if (StringUtils.isNotEmpty(user.getUserName()) && !userService.checkUserNameUnique(user)) { |
| | | return error("登录账号重复"); |
| | | } |
| | | user.setPassword(SecurityUtils.encryptPassword("123456")); |
| | | user.setDelFlag("0"); |
| | | user.setCreateTime(new Date()); |
| | | userService.save(user); |
| | | SysUserRole userRole = new SysUserRole(); |
| | | userRole.setUserId(user.getUserId()); |
| | | userRole.setRoleId(user.getRoleId()); |
| | | sysUserRoleService.save(userRole); |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | |
| | | /** |
| | | * 根据用户编号获取详细信息 |
| | | */ |
| | | @ApiOperation(value = "获取用户详情", tags = {"管理后台-账号管理", "门店后台-部门管理"}) |
| | | @ApiOperation(value = "获取用户详情", tags = {"用户管理"}) |
| | | @GetMapping("/getInfo/{userId}") |
| | | public AjaxResult getInfo(@PathVariable Long userId) { |
| | | userService.checkUserDataScope(userId); |
| | |
| | | */ |
| | | @Log(title = "用户管理", businessType = BusinessType.UPDATE) |
| | | @PutMapping("/update") |
| | | @ApiOperation(value = "编辑系统用户", tags = {"管理后台-账号管理", "门店后台-部门管理"}) |
| | | @ApiOperation(value = "编辑系统用户", tags = {"用户管理"}) |
| | | public AjaxResult edit(@Validated @RequestBody SysUser user) { |
| | | user.setUserName(user.getPhonenumber()); |
| | | if (!org.springframework.util.StringUtils.hasLength(user.getNickName())) { |
| | | user.setNickName(user.getPhonenumber()); |
| | | } |
| | | R<Integer> admin = this.isAdmin(user.getUserId()); |
| | | Integer data = admin.getData(); |
| | | if (data == null || data != 1) { |
| | | SysUserRole one = sysUserRoleService.getOne(new LambdaQueryWrapper<SysUserRole>().eq(SysUserRole::getUserId, user.getUserId())); |
| | | one.setRoleId(user.getRoleId()); |
| | | sysUserRoleService.updateSysUserRole(one); |
| | | } |
| | | userService.checkUserAllowed(user); |
| | | userService.checkUserDataScope(user.getUserId()); |
| | | SysUser sysUser = userService.getOne(Wrappers.lambdaQuery(SysUser.class) |
| | |
| | | return error("登录账号重复"); |
| | | } |
| | | user.setUpdateBy(SecurityUtils.getUsername()); |
| | | if (user.getPassword() != null && !"".equals(user.getPassword())) { |
| | | user.setPassword(SecurityUtils.encryptPassword(user.getPassword())); |
| | | user.setPassword(SecurityUtils.encryptPassword(MD5Generator.generateMD5("a123456"))); |
| | | |
| | | user.setPassWordUpdate(new Date()); |
| | | } |
| | | if (user.getPhonenumber() != null) { |
| | | user.setUserName(user.getPhonenumber()); |
| | | } |
| | | user.setUpdateBy(SecurityUtils.getUsername()); |
| | | user.setUpdateTime(new Date()); |
| | | userService.updateUser(user); |
| | | user = userService.getById(user.getUserId()); |
| | | //添加门店员工关系数据 |
| | | if (2 == user.getRoleType()) { |
| | | UserShop one = userShopService.getOne(new LambdaQueryWrapper<UserShop>().eq(UserShop::getUserId, user.getUserId()).eq(UserShop::getShopId, user.getObjectId())); |
| | | one.setUserId(user.getUserId()); |
| | | one.setShopId(user.getObjectId()); |
| | | one.setRoleType(one.getRoleType()); |
| | | one.setRoleId(user.getRoleId()); |
| | | one.setDeptId(user.getDeptId()); |
| | | one.setNickName(user.getNickName()); |
| | | userShopService.updateById(one); |
| | | } |
| | | |
| | | SysUserRole one = sysUserRoleService.getOne(new LambdaQueryWrapper<SysUserRole>().eq(SysUserRole::getUserId, user.getUserId())); |
| | | one.setRoleId(user.getRoleId()); |
| | | sysUserRoleService.updateSysUserRole(one); |
| | | return success(); |
| | | } |
| | | |
| | |
| | | */ |
| | | @Log(title = "用户管理", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{userIds}") |
| | | @ApiOperation(value = "删除系统用户", tags = {"管理后台-账号管理", "门店后台-部门管理"}) |
| | | @ApiOperation(value = "删除系统用户", tags = {"用户管理"}) |
| | | public AjaxResult remove(@PathVariable Long[] userIds) { |
| | | if (ArrayUtils.contains(userIds, SecurityUtils.getUserId())) { |
| | | return error("当前用户不能删除"); |
| | |
| | | |
| | | |
| | | @PostMapping("/shopUserStart") |
| | | @ApiOperation(value = "账号管理--禁用/启用", tags = {"管理后台-账号管理", "门店后台-部门管理"}) |
| | | @ApiOperation(value = "账号管理--禁用/启用", tags = {"用户管理"}) |
| | | public AjaxResult shopUserStart(@RequestBody ShopUserStart shopUserStart) { |
| | | if (shopUserStart.getUserId() == null) { |
| | | return AjaxResult.error("userId不能为空"); |
| | |
| | | */ |
| | | @Log(title = "用户管理", businessType = BusinessType.UPDATE) |
| | | @PutMapping("/resetPwd") |
| | | @ApiOperation(value = "重置密码", tags = {"管理后台-账号管理", "门店后台-部门管理"}) |
| | | @ApiOperation(value = "重置密码", tags = {"用户管理"}) |
| | | public AjaxResult resetPwd(@RequestBody SysUser user) { |
| | | userService.checkUserAllowed(user); |
| | | userService.checkUserDataScope(user.getUserId()); |
| | | |
| | | user.setPassword(SecurityUtils.encryptPassword(MD5Generator.generateMD5("a123456"))); |
| | | user.setPassword(SecurityUtils.encryptPassword(MD5Generator.generateMD5("123456"))); |
| | | user.setUpdateBy(SecurityUtils.getUsername()); |
| | | return toAjax(userService.resetPwd(user)); |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.dataInterchange.api.feignClient.UPExgMsgRealLocationClient; |
| | | import com.ruoyi.dataInterchange.api.vo.GnssDataVo; |
| | | import com.ruoyi.system.api.model.Car; |
| | | import com.ruoyi.system.api.model.Warn; |
| | | import com.ruoyi.system.query.CarWarnInfoResp; |
| | | import com.ruoyi.system.query.CarWarnListReq; |
| | | import com.ruoyi.system.query.CarWarnListResp; |
| | | import com.ruoyi.system.query.WarnResp; |
| | | import com.ruoyi.system.service.ICarService; |
| | | import com.ruoyi.system.service.IWarnService; |
| | | import com.ruoyi.system.util.GDMapGeocodingUtil; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDateTime; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2025/3/27 14:38 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/warn") |
| | | public class WarnController { |
| | | |
| | | |
| | | @Resource |
| | | private IWarnService warnService; |
| | | |
| | | @Resource |
| | | private ICarService carService; |
| | | |
| | | |
| | | @Resource |
| | | private UPExgMsgRealLocationClient upExgMsgRealLocationClient; |
| | | |
| | | |
| | | @GetMapping("/getCarWarnList") |
| | | @ApiOperation(value = "获取车辆预警列表数据", tags = {"车辆管理", "预警记录", "首页"}) |
| | | public R<PageInfo<CarWarnListResp>> getCarWarnList(CarWarnListReq carWarnListReq) { |
| | | PageInfo<CarWarnListResp> pageInfo = warnService.getCarWarnList(carWarnListReq); |
| | | return R.ok(pageInfo); |
| | | } |
| | | |
| | | |
| | | @GetMapping("/getCarWarnInfo") |
| | | @ApiOperation(value = "获取车辆预警详情数据", tags = {"车辆管理", "预警记录"}) |
| | | public R<CarWarnInfoResp> getCarWarnInfo(@PathVariable("vehicleNumber") String vehicleNumber) { |
| | | Car car = carService.getOne(new LambdaQueryWrapper<Car>().eq(Car::getVehicleNumber, vehicleNumber)); |
| | | if (null == car) { |
| | | return R.ok(); |
| | | } |
| | | String time = LocalDateTime.now().minusMinutes(15).format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")); |
| | | List<Warn> list = warnService.list(new LambdaQueryWrapper<Warn>().eq(Warn::getCarId, car.getId()).lt(Warn::getStartTime, time).orderByDesc(Warn::getCreateTime)); |
| | | CarWarnInfoResp carWarnInfoResp = new CarWarnInfoResp(); |
| | | carWarnInfoResp.setVehicleNumber(vehicleNumber); |
| | | GnssDataVo gnssDataVo = upExgMsgRealLocationClient.getVehicleSpeed(vehicleNumber).getData(); |
| | | carWarnInfoResp.setSpeed(new BigDecimal(gnssDataVo.getVec1())); |
| | | Map<String, String> geocode = null; |
| | | try { |
| | | geocode = GDMapGeocodingUtil.geocode(Double.valueOf(gnssDataVo.getLon() / 1000000).toString(), Double.valueOf(gnssDataVo.getLat() / 1000000).toString()); |
| | | } catch (Exception e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | String address = geocode.get("address"); |
| | | carWarnInfoResp.setNowAddress(address); |
| | | List<WarnResp> warnList = new ArrayList<>(); |
| | | for (Warn warn : list) { |
| | | WarnResp warnResp = new WarnResp(); |
| | | warnResp.setWarnType(warn.getWarnType()); |
| | | warnResp.setWarnTime(warn.getStartTime()); |
| | | warnResp.setSpeed(warn.getSpeed()); |
| | | warnResp.setLon(new BigDecimal(warn.getLongitude())); |
| | | warnResp.setLat(new BigDecimal(warn.getLatitude())); |
| | | warnResp.setAddress(warn.getAddress()); |
| | | warnList.add(warnResp); |
| | | } |
| | | carWarnInfoResp.setWarnList(warnList); |
| | | return R.ok(carWarnInfoResp); |
| | | } |
| | | |
| | | |
| | | public R<List<Map<String, Object>>> getWarnGroupCount() { |
| | | |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.system.api.model.CarType; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2025/3/27 17:22 |
| | | */ |
| | | public interface CarTypeMapper extends BaseMapper<CarType> { |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.system.api.model.Complain; |
| | | import com.ruoyi.system.query.ComplainListReq; |
| | | import com.ruoyi.system.query.ComplainListResp; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2025/3/27 18:05 |
| | | */ |
| | | public interface ComplainMapper extends BaseMapper<Complain> { |
| | | |
| | | |
| | | /** |
| | | * 获取投诉记录列表 |
| | | * |
| | | * @param pageInfo |
| | | * @param complainListReq |
| | | * @return |
| | | */ |
| | | PageInfo<ComplainListResp> getComplainList(PageInfo<ComplainListResp> pageInfo, @Param("item") ComplainListReq complainListReq); |
| | | } |
| | |
| | | package com.ruoyi.system.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.system.api.model.Driver; |
| | | import com.ruoyi.system.query.DriverListReq; |
| | | import com.ruoyi.system.query.DriverListResp; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2025/3/17 16:25 |
| | | */ |
| | | public interface DriverMapper extends BaseMapper<Driver> { |
| | | |
| | | |
| | | /** |
| | | * 获取司机列表数据 |
| | | * |
| | | * @param pageInfo |
| | | * @param driverListReq |
| | | * @return |
| | | */ |
| | | PageInfo<DriverListResp> getDriverList(PageInfo<DriverListResp> pageInfo, @Param("item") DriverListReq driverListReq); |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.system.api.model.Warn; |
| | | import com.ruoyi.system.query.CarWarnListReq; |
| | | import com.ruoyi.system.query.CarWarnListResp; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2025/3/27 14:34 |
| | | */ |
| | | public interface WarnMapper extends BaseMapper<Warn> { |
| | | |
| | | |
| | | /** |
| | | * 获取车联预警列表 |
| | | * |
| | | * @param pageInfo |
| | | * @param carWarnListReq |
| | | * @return |
| | | */ |
| | | PageInfo<CarWarnListResp> getCarWarnList(PageInfo<CarWarnListResp> pageInfo, @Param("item") CarWarnListReq carWarnListReq); |
| | | |
| | | |
| | | /** |
| | | * 获取预警汇总统计最高的10类报警数据 |
| | | * |
| | | * @return |
| | | */ |
| | | List<Map<String, Object>> getWarnGroupCount(); |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.query; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2025/3/27 19:13 |
| | | */ |
| | | @Data |
| | | @ApiModel |
| | | public class CarStatusCount { |
| | | @ApiModelProperty("在线") |
| | | private long online; |
| | | @ApiModelProperty("离线") |
| | | private long offline; |
| | | @ApiModelProperty("故障") |
| | | private long breakdown; |
| | | @ApiModelProperty("异常") |
| | | private long abnormal; |
| | | @ApiModelProperty("公司数据") |
| | | private long enterprise; |
| | | @ApiModelProperty("车辆总数") |
| | | private long car; |
| | | @ApiModelProperty("司机总数") |
| | | private long driver; |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.query; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2025/3/27 17:18 |
| | | */ |
| | | @Data |
| | | @ApiModel |
| | | public class CarTypeResp { |
| | | @ApiModelProperty("ID") |
| | | private Integer id; |
| | | @ApiModelProperty("图标") |
| | | private String icon; |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.query; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2025/3/27 15:28 |
| | | */ |
| | | @Data |
| | | @ApiModel |
| | | public class CarWarnInfoResp { |
| | | @ApiModelProperty("车牌号") |
| | | private String vehicleNumber; |
| | | @ApiModelProperty("当前车速") |
| | | private BigDecimal speed; |
| | | @ApiModelProperty("当前位置") |
| | | private String nowAddress; |
| | | @ApiModelProperty("抓拍照片") |
| | | private String imageUrl; |
| | | @ApiModelProperty("报警列表") |
| | | private List<WarnResp> warnList; |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.query; |
| | | |
| | | import com.ruoyi.common.core.web.page.BasePage; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2025/3/27 14:40 |
| | | */ |
| | | @Data |
| | | @ApiModel |
| | | public class CarWarnListReq extends BasePage { |
| | | @ApiModelProperty(value = "预警类型") |
| | | private String warnType; |
| | | @ApiModelProperty(value = "车辆号牌") |
| | | private String vehicleNumber; |
| | | @ApiModelProperty(value = "驾驶员姓名") |
| | | private String driverName; |
| | | @ApiModelProperty(value = "公司名称") |
| | | private String enterpriseName; |
| | | @ApiModelProperty(value = "预警开始时间") |
| | | private String startTime; |
| | | @ApiModelProperty(value = "预警结束时间") |
| | | private String endTime; |
| | | @ApiModelProperty("处理状态") |
| | | private String treatmentState; |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.query; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; /** |
| | | * @author zhibing.pu |
| | | * @Date 2025/3/27 13:49 |
| | | */ |
| | | @Data |
| | | @ApiModel |
| | | public class CarWarnListResp { |
| | | @ApiModelProperty("车辆名称") |
| | | private String carName; |
| | | @ApiModelProperty("车牌号") |
| | | private String vehicleNumber; |
| | | @ApiModelProperty("持续报警") |
| | | private String keepWarn; |
| | | @ApiModelProperty("驾驶员名称") |
| | | private String driverName; |
| | | @ApiModelProperty("所属公司") |
| | | private String enterpriseName; |
| | | @ApiModelProperty("终端编号") |
| | | private String terminalNumber; |
| | | @ApiModelProperty("开始报警时间") |
| | | private String startTime; |
| | | @ApiModelProperty("结束报警时间") |
| | | private String endTime; |
| | | @ApiModelProperty("持续时长") |
| | | private Integer keepTime; |
| | | @ApiModelProperty("持续里程") |
| | | private BigDecimal keepDistance; |
| | | @ApiModelProperty("报警类型") |
| | | private String warnType; |
| | | @ApiModelProperty("报警次数") |
| | | private Integer warnNumber; |
| | | @ApiModelProperty("处理状态") |
| | | private String treatmentState; |
| | | @ApiModelProperty("处理人") |
| | | private String treatmentUser; |
| | | @ApiModelProperty("处理时间") |
| | | private String treatmentTime; |
| | | @ApiModelProperty("处理描述") |
| | | private String treatmentRemark; |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.query; |
| | | |
| | | import com.ruoyi.common.core.web.page.BasePage; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2025/3/27 18:10 |
| | | */ |
| | | @Data |
| | | @ApiModel |
| | | public class ComplainListReq extends BasePage { |
| | | @ApiModelProperty("投诉人电话") |
| | | private String complainPhone; |
| | | @ApiModelProperty("车牌号") |
| | | private String vehicleNumber; |
| | | @ApiModelProperty("驾驶员名称") |
| | | private String driverName; |
| | | @ApiModelProperty("所属公司") |
| | | private String enterpriseName; |
| | | @ApiModelProperty(value = "投诉开始时间") |
| | | private String startTime; |
| | | @ApiModelProperty(value = "投诉结束时间") |
| | | private String endTime; |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.query; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2025/3/27 18:08 |
| | | */ |
| | | @Data |
| | | @ApiModel |
| | | public class ComplainListResp { |
| | | @ApiModelProperty("车辆名称") |
| | | private String carName; |
| | | @ApiModelProperty("车牌号") |
| | | private String vehicleNumber; |
| | | @ApiModelProperty("投诉内容") |
| | | private String content; |
| | | @ApiModelProperty("投诉人电话") |
| | | private String complainPhone; |
| | | @ApiModelProperty("驾驶员名称") |
| | | private String driverName; |
| | | @ApiModelProperty("所属公司") |
| | | private String enterpriseName; |
| | | @ApiModelProperty("投诉时间") |
| | | private String complainTime; |
| | | @ApiModelProperty("处理状态") |
| | | private String treatmentState; |
| | | @ApiModelProperty("处理人") |
| | | private String treatmentUser; |
| | | @ApiModelProperty("处理时间") |
| | | private String treatmentTime; |
| | | @ApiModelProperty("处理描述") |
| | | private String treatmentRemark; |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.query; |
| | | |
| | | import com.ruoyi.common.core.web.page.BasePage; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2025/3/27 16:28 |
| | | */ |
| | | @Data |
| | | @ApiModel |
| | | public class DriverListReq extends BasePage { |
| | | @ApiModelProperty(value = "司机姓名") |
| | | private String driverName; |
| | | @ApiModelProperty(value = "所属公司") |
| | | private String enterpriseName; |
| | | @ApiModelProperty(value = "驾驶员手机号") |
| | | private String phone; |
| | | @ApiModelProperty(value = "紧急联系人") |
| | | private String emergencyContact; |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.query; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2025/3/27 16:21 |
| | | */ |
| | | @Data |
| | | @ApiModel |
| | | public class DriverListResp { |
| | | @ApiModelProperty(value = "ID") |
| | | private Integer id; |
| | | @ApiModelProperty(value = "司机姓名") |
| | | private String driverName; |
| | | @ApiModelProperty(value = "所属公司") |
| | | private String enterpriseName; |
| | | @ApiModelProperty(value = "机动车驾驶证号") |
| | | private String drivingLicenseNumber; |
| | | @ApiModelProperty(value = "通信地址") |
| | | private String mailingAddress; |
| | | @ApiModelProperty(value = "紧急联系人") |
| | | private String emergencyContact; |
| | | @ApiModelProperty(value = "紧急联系人电话") |
| | | private String emergencyPhone; |
| | | @ApiModelProperty(value = "驾驶员手机号") |
| | | private String phone; |
| | | @ApiModelProperty("签约公司") |
| | | private String contractingCompany; |
| | | } |
| | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2024/8/10 14:10 |
| | |
| | | private String phonenumber; |
| | | @ApiModelProperty(value = "所属部门") |
| | | private Integer deptId; |
| | | private Integer objectId; |
| | | @ApiModelProperty(value = "角色id") |
| | | private Integer roleId; |
| | | @ApiModelProperty(value = "状态 0=正常,1=停用") |
| | | private Integer status; |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.query; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2025/3/27 15:30 |
| | | */ |
| | | @Data |
| | | @ApiModel |
| | | public class WarnResp { |
| | | @ApiModelProperty("报警类型") |
| | | private String warnType; |
| | | @ApiModelProperty("行驶速度") |
| | | private BigDecimal speed; |
| | | @ApiModelProperty("报警时间") |
| | | private String warnTime; |
| | | @ApiModelProperty("经度") |
| | | private BigDecimal lon; |
| | | @ApiModelProperty("纬度") |
| | | private BigDecimal lat; |
| | | @ApiModelProperty("地址") |
| | | private String address; |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.system.api.model.CarType; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2025/3/27 17:22 |
| | | */ |
| | | public interface ICarTypeService extends IService<CarType> { |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.system.api.model.Complain; |
| | | import com.ruoyi.system.query.ComplainListReq; |
| | | import com.ruoyi.system.query.ComplainListResp; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2025/3/27 18:05 |
| | | */ |
| | | public interface IComplainService extends IService<Complain> { |
| | | |
| | | |
| | | /** |
| | | * 获取投诉记录列表数据 |
| | | * |
| | | * @param complainListReq |
| | | * @return |
| | | */ |
| | | PageInfo<ComplainListResp> getComplainList(ComplainListReq complainListReq); |
| | | } |
| | |
| | | package com.ruoyi.system.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.system.api.model.Driver; |
| | | import com.ruoyi.system.query.DriverListReq; |
| | | import com.ruoyi.system.query.DriverListResp; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | |
| | | * 定时任务获取新驾驶员数据 |
| | | */ |
| | | void taskSaveNewDriver(); |
| | | |
| | | |
| | | /** |
| | | * 获取司机列表数据 |
| | | * |
| | | * @param driverListReq |
| | | * @return |
| | | */ |
| | | PageInfo<DriverListResp> getDriverList(DriverListReq driverListReq); |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.system.api.model.Warn; |
| | | import com.ruoyi.system.query.CarWarnListReq; |
| | | import com.ruoyi.system.query.CarWarnListResp; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2025/3/27 14:35 |
| | | */ |
| | | public interface IWarnService extends IService<Warn> { |
| | | |
| | | |
| | | /** |
| | | * 获取车辆预警列表 |
| | | * |
| | | * @param carWarnListReq |
| | | * @return |
| | | */ |
| | | PageInfo<CarWarnListResp> getCarWarnList(CarWarnListReq carWarnListReq); |
| | | |
| | | |
| | | /** |
| | | * 获取预警汇总统计最高的10类报警数据 |
| | | * |
| | | * @return |
| | | */ |
| | | List<Map<String, Object>> getWarnGroupCount(); |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.system.api.model.CarType; |
| | | import com.ruoyi.system.mapper.CarTypeMapper; |
| | | import com.ruoyi.system.service.ICarTypeService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2025/3/27 17:22 |
| | | */ |
| | | @Service |
| | | public class CarTypeServiceImpl extends ServiceImpl<CarTypeMapper, CarType> implements ICarTypeService { |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.system.api.model.Complain; |
| | | import com.ruoyi.system.mapper.ComplainMapper; |
| | | import com.ruoyi.system.query.ComplainListReq; |
| | | import com.ruoyi.system.query.ComplainListResp; |
| | | import com.ruoyi.system.service.IComplainService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2025/3/27 18:06 |
| | | */ |
| | | @Service |
| | | public class ComplainServiceImpl extends ServiceImpl<ComplainMapper, Complain> implements IComplainService { |
| | | |
| | | |
| | | /** |
| | | * 获取投诉记录列表数据 |
| | | * |
| | | * @param complainListReq |
| | | * @return |
| | | */ |
| | | @Override |
| | | public PageInfo<ComplainListResp> getComplainList(ComplainListReq complainListReq) { |
| | | PageInfo<ComplainListResp> pageInfo = new PageInfo<>(complainListReq.getPageCurr(), complainListReq.getPageSize()); |
| | | return this.baseMapper.getComplainList(pageInfo, complainListReq); |
| | | } |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.dataInterchange.api.feignClient.UPExgMsgReportDriverInfoClient; |
| | | import com.ruoyi.dataInterchange.api.vo.UPExgMsgReportDriverInfoVo; |
| | | import com.ruoyi.system.api.model.Driver; |
| | | import com.ruoyi.system.api.model.Enterprise; |
| | | import com.ruoyi.system.mapper.DriverMapper; |
| | | import com.ruoyi.system.query.DriverListReq; |
| | | import com.ruoyi.system.query.DriverListResp; |
| | | import com.ruoyi.system.service.IDriverService; |
| | | import com.ruoyi.system.service.IEnterpriseService; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | } |
| | | this.saveBatch(driverList); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取司机列表 |
| | | * |
| | | * @param driverListReq |
| | | * @return |
| | | */ |
| | | @Override |
| | | public PageInfo<DriverListResp> getDriverList(DriverListReq driverListReq) { |
| | | PageInfo<DriverListResp> pageInfo = new PageInfo<>(driverListReq.getPageCurr(), driverListReq.getPageSize()); |
| | | return this.baseMapper.getDriverList(pageInfo, driverListReq); |
| | | } |
| | | } |
| | |
| | | import com.ruoyi.system.api.domain.SysDept; |
| | | import com.ruoyi.system.api.domain.SysRole; |
| | | import com.ruoyi.system.api.domain.SysUser; |
| | | import com.ruoyi.system.api.model.UserShop; |
| | | import com.ruoyi.system.api.query.ChangeUserQuery; |
| | | import com.ruoyi.system.domain.SysPost; |
| | | import com.ruoyi.system.domain.SysUserPost; |
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.validation.Validator; |
| | | import java.util.*; |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | |
| | | @Service |
| | | public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> implements ISysUserService { |
| | | private static final Logger log = LoggerFactory.getLogger(SysUserServiceImpl.class); |
| | | |
| | | @Resource |
| | | private SysUserMapper userMapper; |
| | | |
| | | @Resource |
| | | private SysRoleMapper roleMapper; |
| | | |
| | | @Resource |
| | | private SysPostMapper postMapper; |
| | | |
| | | @Resource |
| | | private SysUserRoleMapper userRoleMapper; |
| | | |
| | | @Resource |
| | | private SysUserPostMapper userPostMapper; |
| | | |
| | | @Resource |
| | | private ISysConfigService configService; |
| | | |
| | | @Resource |
| | | protected Validator validator; |
| | | |
| | | @Resource |
| | | private SysUserMapper userMapper; |
| | | @Resource |
| | | private SysRoleMapper roleMapper; |
| | | @Resource |
| | | private SysPostMapper postMapper; |
| | | @Resource |
| | | private SysUserRoleMapper userRoleMapper; |
| | | @Resource |
| | | private SysUserPostMapper userPostMapper; |
| | | @Resource |
| | | private ISysConfigService configService; |
| | | @Resource |
| | | private ISysUserRoleService sysUserRoleService; |
| | | |
| | |
| | | |
| | | @Resource |
| | | private TokenService tokenService; |
| | | |
| | | |
| | | @Lazy |
| | | @Resource |
| | | private ISysDeptService deptService; |
| | |
| | | public SysUser selectUserByUserName(String userName) { |
| | | return userMapper.selectUserByUserName(userName); |
| | | } |
| | | |
| | | @Override |
| | | public SysUser selectUserShopByUserName(String userName) { |
| | | return userMapper.selectUserShopByUserName(userName); |
| | |
| | | public int resetUserPwd(String userName, String password) { |
| | | return userMapper.resetUserPwd(userName, password); |
| | | } |
| | | |
| | | @Override |
| | | public int resetUserShopPwd(String userName, String password) { |
| | | return userMapper.resetUserShopPwd(userName, password); |
| | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void deleteUserByIds(Long[] userIds) { |
| | | Long userid = tokenService.getLoginUser().getUserid(); |
| | | SysUser sysUser = this.getById(userid); |
| | | for (Long userId : userIds) { |
| | | for (Long userId : userIds) { |
| | | checkUserAllowed(new SysUser(userId)); |
| | | } |
| | | List<SysUser> sysUsers = this.listByIds(Arrays.asList(userIds)); |
| | | for (SysUser user : sysUsers) { |
| | | if(2 == user.getRoleType()){ |
| | | userShopService.remove(new LambdaQueryWrapper<UserShop>().eq(UserShop::getUserId, user.getUserId()).eq(UserShop::getShopId, sysUser.getObjectId())); |
| | | }else{ |
| | | userMapper.deleteUserById(user.getUserId()); |
| | | } |
| | | userMapper.deleteUserById(user.getUserId()); |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | @Override |
| | | public PageInfo<SysUser> getList(PageInfo<SysUser> pageInfo, GetSysUserList getSysUserList) { |
| | | Long userid = tokenService.getLoginUser().getUserid(); |
| | | SysUser sysUser1 = this.getById(userid); |
| | | if(sysUser1.getRoleType() == 2){ |
| | | getSysUserList.setObjectId(sysUser1.getObjectId()); |
| | | } |
| | | List<SysUser> list = this.baseMapper.getList(pageInfo, getSysUserList); |
| | | for (SysUser sysUser : list) { |
| | | if(sysUser.getRoleType() == 2){ |
| | | UserShop userShop = userShopService.getOne(new LambdaQueryWrapper<UserShop>().eq(UserShop::getShopId, sysUser1.getObjectId()).eq(UserShop::getUserId, sysUser.getUserId())); |
| | | SysRole sysRole = roleMapper.selectRoleById(userShop.getRoleId()); |
| | | Long[] roleIds = new Long[]{userShop.getRoleId()}; |
| | | sysUser.setNickName(userShop.getNickName()); |
| | | sysUser.setRoleIds(roleIds); |
| | | sysUser.setRoleNames(Arrays.asList(sysRole.getRoleName())); |
| | | SysDept sysDept = deptService.selectDeptById(userShop.getDeptId()); |
| | | sysUser.setDept(sysDept); |
| | | }else{ |
| | | List<SysUserRole> list1 = sysUserRoleService.list(new LambdaQueryWrapper<SysUserRole>().eq(SysUserRole::getUserId, sysUser.getUserId())); |
| | | List<String> roleNames = new ArrayList<>(); |
| | | for (SysUserRole sysUserRole : list1) { |
| | | SysRole sysRole = sysRoleService.selectRoleById(sysUserRole.getRoleId()); |
| | | if(null == sysRole){ |
| | | continue; |
| | | } |
| | | roleNames.add(sysRole.getRoleName()); |
| | | List<SysUserRole> list1 = sysUserRoleService.list(new LambdaQueryWrapper<SysUserRole>().eq(SysUserRole::getUserId, sysUser.getUserId())); |
| | | List<String> roleNames = new ArrayList<>(); |
| | | for (SysUserRole sysUserRole : list1) { |
| | | SysRole sysRole = sysRoleService.selectRoleById(sysUserRole.getRoleId()); |
| | | if (null == sysRole) { |
| | | continue; |
| | | } |
| | | Long[] roleIds = new Long[]{}; |
| | | sysUser.setRoleIds(list1.stream().map(SysUserRole::getRoleId).collect(Collectors.toList()).toArray(roleIds)); |
| | | sysUser.setRoleNames(roleNames); |
| | | SysDept sysDept = deptService.selectDeptById(sysUser.getDeptId()); |
| | | sysUser.setDept(sysDept); |
| | | roleNames.add(sysRole.getRoleName()); |
| | | } |
| | | Long[] roleIds = new Long[]{}; |
| | | sysUser.setRoleIds(list1.stream().map(SysUserRole::getRoleId).collect(Collectors.toList()).toArray(roleIds)); |
| | | sysUser.setRoleNames(roleNames); |
| | | SysDept sysDept = deptService.selectDeptById(sysUser.getDeptId()); |
| | | sysUser.setDept(sysDept); |
| | | } |
| | | return pageInfo.setRecords(list); |
| | | } |
| | |
| | | public PageInfo<SysUser> getChangeUserList(ChangeUserQuery query) { |
| | | Long userid = tokenService.getLoginUser().getUserid(); |
| | | SysUser sysUser1 = this.getById(userid); |
| | | if(sysUser1.getRoleType() == 2){ |
| | | if (sysUser1.getRoleType() == 2) { |
| | | query.setObjectId(sysUser1.getObjectId()); |
| | | } |
| | | PageInfo<SysUser> pageInfo = new PageInfo<>(query.getPageCurr(), query.getPageSize()); |
New file |
| | |
| | | package com.ruoyi.system.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.system.api.model.Warn; |
| | | import com.ruoyi.system.mapper.WarnMapper; |
| | | import com.ruoyi.system.query.CarWarnListReq; |
| | | import com.ruoyi.system.query.CarWarnListResp; |
| | | import com.ruoyi.system.service.IWarnService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2025/3/27 14:36 |
| | | */ |
| | | @Service |
| | | public class WarnServiceImpl extends ServiceImpl<WarnMapper, Warn> implements IWarnService { |
| | | |
| | | |
| | | /** |
| | | * 获取车辆预警 |
| | | * |
| | | * @param carWarnListReq |
| | | * @return |
| | | */ |
| | | @Override |
| | | public PageInfo<CarWarnListResp> getCarWarnList(CarWarnListReq carWarnListReq) { |
| | | PageInfo<CarWarnListResp> pageInfo = new PageInfo<>(carWarnListReq.getPageCurr(), carWarnListReq.getPageCurr()); |
| | | return this.baseMapper.getCarWarnList(pageInfo, carWarnListReq); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取预警汇总统计最高的10类报警数据 |
| | | * |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<Map<String, Object>> getWarnGroupCount() { |
| | | return this.baseMapper.getWarnGroupCount(); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.util; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.ruoyi.common.core.utils.HttpUtils; |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 高德地图的地理编码工具类 |
| | | */ |
| | | public class GDMapGeocodingUtil { |
| | | |
| | | private static String key = "d963b3048d5662b970de1bd41ebdac5e"; |
| | | |
| | | |
| | | /** |
| | | * 将行政区域名称转化为坐标 |
| | | * |
| | | * @param province |
| | | * @param city |
| | | * @param county |
| | | * @param address |
| | | * @return |
| | | */ |
| | | public static Map<String, Object> geocoding(String province, String city, String county, String address) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | if (StringUtils.isEmpty(province)) { |
| | | map.put("status", -1); |
| | | map.put("data", "省不能为空"); |
| | | return map; |
| | | } |
| | | if ((StringUtils.isEmpty(city) && StringUtils.isNotEmpty(county)) || (StringUtils.isEmpty(city) && StringUtils.isNotEmpty(address))) { |
| | | map.put("status", -1); |
| | | map.put("data", "市不能为空"); |
| | | return map; |
| | | } |
| | | if ((StringUtils.isEmpty(county) && StringUtils.isNotEmpty(address))) { |
| | | map.put("status", -1); |
| | | map.put("data", "县/区不能为空"); |
| | | return map; |
| | | } |
| | | |
| | | String url = "https://restapi.amap.com/v3/geocode/geo?key=" + key + "&output=JSON"; |
| | | url += "&address=" + province + (StringUtils.isNotEmpty(city) ? city : "") + (StringUtils.isNotEmpty(county) ? county : "") + (StringUtils.isNotEmpty(address) ? address : ""); |
| | | String forObject = HttpUtils.sendGet(url); |
| | | JSONObject jsonObject = JSON.parseObject(forObject); |
| | | String status = jsonObject.getString("status"); |
| | | List<String> list = new ArrayList<>(); |
| | | |
| | | // gdInterfaceService.saveData("https://restapi.amap.com/v3/geocode/geo", "行政区域转经纬度"); |
| | | |
| | | if (status.equals("1")) { |
| | | JSONArray geocodes = jsonObject.getJSONArray("geocodes"); |
| | | for (int i = 0; i < geocodes.size(); i++) { |
| | | String location = geocodes.getJSONObject(i).getString("location"); |
| | | list.add(location); |
| | | } |
| | | } |
| | | map.put("status", 0); |
| | | map.put("data", list); |
| | | return map; |
| | | } |
| | | |
| | | |
| | | public static Map<String, Object> geocoding(String address) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | String url = "https://restapi.amap.com/v3/geocode/geo?key=" + key + "&output=JSON&address=" + address; |
| | | String forObject = HttpUtils.sendGet(url); |
| | | JSONObject jsonObject = JSON.parseObject(forObject); |
| | | String status = jsonObject.getString("status"); |
| | | List<String> list = new ArrayList<>(); |
| | | |
| | | // gdInterfaceService.saveData("https://restapi.amap.com/v3/geocode/geo", "行政区域转经纬度"); |
| | | |
| | | if (status.equals("1")) { |
| | | JSONArray geocodes = jsonObject.getJSONArray("geocodes"); |
| | | for (int i = 0; i < geocodes.size(); i++) { |
| | | String location = geocodes.getJSONObject(i).getString("location"); |
| | | list.add(location); |
| | | } |
| | | } |
| | | map.put("status", 0); |
| | | map.put("data", list); |
| | | return map; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 根据经纬度获取行政区域信息 |
| | | * |
| | | * @param lon |
| | | * @param lan |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | public static Map<String, String> geocode(String lon, String lan) throws Exception { |
| | | String url = "https://restapi.amap.com/v3/geocode/regeo?key=" + key + "&location=" + lon + "," + lan; |
| | | String forObject = HttpUtils.sendGet(url); |
| | | JSONObject jsonObject = JSON.parseObject(forObject); |
| | | Map<String, String> map = new HashMap<>(); |
| | | |
| | | // gdInterfaceService.saveData("https://restapi.amap.com/v3/geocode/regeo", "经纬度转行政区域"); |
| | | |
| | | if (jsonObject.getString("status").equals("1")) { |
| | | JSONObject regeocode = jsonObject.getJSONObject("regeocode"); |
| | | JSONObject addressComponent = regeocode.getJSONObject("addressComponent"); |
| | | String address = regeocode.getString("formatted_address"); |
| | | map.put("address", address); |
| | | String code = addressComponent.getString("adcode"); |
| | | String province = addressComponent.getString("province"); |
| | | String city = addressComponent.getString("city"); |
| | | String district = addressComponent.getString("district"); |
| | | map.put("province", province); |
| | | map.put("provinceCode", code.substring(0, 2) + "0000"); |
| | | map.put("city", city); |
| | | map.put("cityCode", code.substring(0, 4) + "00"); |
| | | map.put("district", district); |
| | | map.put("districtCode", code); |
| | | } |
| | | return map; |
| | | } |
| | | } |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8" ?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.ruoyi.system.mapper.CarTypeMapper"> |
| | | |
| | | |
| | | </mapper> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8" ?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.ruoyi.system.mapper.ComplainMapper"> |
| | | |
| | | |
| | | <select id="getComplainList" resultType="com.ruoyi.system.query.ComplainListResp"> |
| | | select |
| | | b.vehicle_name as carName, |
| | | b.vehicle_number as vehicleNumber, |
| | | a.content, |
| | | a.complain_phone as complainPhone, |
| | | c.name as driverName, |
| | | d.name as enterpriseName, |
| | | a.complain_time as complainTime, |
| | | a.treatment_state as treatmentState, |
| | | a.treatment_user as treatmentUser, |
| | | a.treatment_time as treatmentTime, |
| | | a.treatment_remark as treatmentRemark |
| | | from t_complain a |
| | | left join t_car b on (a.car_id = b.id) |
| | | left join t_driver c on (a.driver_id = c.id) |
| | | left join t_enterprise d on (a.enterprise_id = d.id) |
| | | <where> |
| | | <if test="null != item.complainPhone and '' != item.complainPhone"> |
| | | and a.complain_phone like CONCAT('%', #{item.complainPhone}, '%') |
| | | </if> |
| | | <if test="null != item.vehicleNumber and '' != item.vehicleNumber"> |
| | | and b.vehicle_number like CONCAT('%', #{item.vehicleNumber}, '%') |
| | | </if> |
| | | <if test="null != item.driverName and '' != item.driverName"> |
| | | and c.name like CONCAT('%', #{item.driverName}, '%') |
| | | </if> |
| | | <if test="null != item.enterpriseName and '' != item.enterpriseName"> |
| | | and d.name like CONCAT('%', #{item.enterpriseName}, '%') |
| | | </if> |
| | | <if test="null != item.startTime and '' != item.startTime"> |
| | | and a.complain_time >= #{item.startTime} |
| | | </if> |
| | | <if test="null != item.endTime and '' != item.endTime"> |
| | | and a.complain_time <= #{item.endTime} |
| | | </if> |
| | | </where> |
| | | order by a.create_time desc |
| | | </select> |
| | | </mapper> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8" ?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.ruoyi.system.mapper.DriverMapper"> |
| | | |
| | | |
| | | <select id="getDriverList" resultType="com.ruoyi.system.query.DriverListResp"> |
| | | select a.id, |
| | | a.nameas driverName, |
| | | b.name as enterpriseName, |
| | | a.driving_license_number as drivingLicenseNumber, |
| | | a.mailing_address as mailingAddress, |
| | | a.emergency_contact as emergencyContact, |
| | | a.emergency_phone as emergencyPhone, |
| | | a.phone, |
| | | a.contracting_company as contractingCompany |
| | | from t_driver a |
| | | left join t_enterprise b on (a.enterprise_id = b.id) |
| | | <where> |
| | | <if test="null != item.driverName and '' != item.driverName"> |
| | | and a.name like CONCAT('%', #{item.driverName}, '%') |
| | | </if> |
| | | <if test="null != item.enterpriseName and '' != item.enterpriseName"> |
| | | and b.name like CONCAT('%', #{item.enterpriseName}, '%') |
| | | </if> |
| | | <if test="null != item.phone and '' != item.phone"> |
| | | and a.phone like CONCAT('%', #{item.phone}, '%') |
| | | </if> |
| | | <if test="null != item.emergencyContact and '' != item.emergencyContact"> |
| | | and a.emergency_contact like CONCAT('%', #{item.emergencyContact}, '%') |
| | | </if> |
| | | </where> |
| | | order by a.update_time desc |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | <?xml version="1.0" encoding="UTF-8" ?> |
| | | <!DOCTYPE mapper |
| | | PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.ruoyi.system.mapper.SysUserMapper"> |
| | | |
| | | <resultMap type="com.ruoyi.system.api.domain.SysUser" id="SysUserResult"> |
| | | <id property="userId" column="user_id" /> |
| | | <result property="deptId" column="dept_id" /> |
| | | <result property="userName" column="user_name" /> |
| | | <result property="nickName" column="nick_name" /> |
| | | <result property="email" column="email" /> |
| | | <result property="phonenumber" column="phonenumber" /> |
| | | <result property="sex" column="sex" /> |
| | | <result property="avatar" column="avatar" /> |
| | | <result property="password" column="password" /> |
| | | <result property="status" column="status" /> |
| | | <result property="delFlag" column="del_flag" /> |
| | | <result property="loginIp" column="login_ip" /> |
| | | <result property="loginDate" column="login_date" /> |
| | | <result property="createBy" column="create_by" /> |
| | | <result property="createTime" column="create_time" /> |
| | | <result property="updateBy" column="update_by" /> |
| | | <result property="updateTime" column="update_time" /> |
| | | <result property="forbiddenRemark" column="forbidden_remark"/> |
| | | <result property="remark" column="remark" /> |
| | | <result property="roleType" column="role_type" /> |
| | | <result property="objectId" column="objectId" /> |
| | | <association property="dept" column="dept_id" javaType="com.ruoyi.system.api.domain.SysDept" resultMap="deptResult" /> |
| | | <collection property="roles" javaType="java.util.List" resultMap="RoleResult" /> |
| | | </resultMap> |
| | | |
| | | <resultMap id="deptResult" type="com.ruoyi.system.api.domain.SysDept"> |
| | | <id property="deptId" column="dept_id" /> |
| | | <result property="parentId" column="parent_id" /> |
| | | <result property="deptName" column="dept_name" /> |
| | | <result property="ancestors" column="ancestors" /> |
| | | <result property="orderNum" column="order_num" /> |
| | | <result property="leader" column="leader" /> |
| | | <result property="status" column="dept_status" /> |
| | | </resultMap> |
| | | <resultMap type="com.ruoyi.system.api.domain.SysUser" id="SysUserResult"> |
| | | <id property="userId" column="user_id"/> |
| | | <result property="deptId" column="dept_id"/> |
| | | <result property="userName" column="user_name"/> |
| | | <result property="nickName" column="nick_name"/> |
| | | <result property="email" column="email"/> |
| | | <result property="phonenumber" column="phonenumber"/> |
| | | <result property="sex" column="sex"/> |
| | | <result property="avatar" column="avatar"/> |
| | | <result property="password" column="password"/> |
| | | <result property="status" column="status"/> |
| | | <result property="delFlag" column="del_flag"/> |
| | | <result property="loginIp" column="login_ip"/> |
| | | <result property="loginDate" column="login_date"/> |
| | | <result property="createBy" column="create_by"/> |
| | | <result property="createTime" column="create_time"/> |
| | | <result property="updateBy" column="update_by"/> |
| | | <result property="updateTime" column="update_time"/> |
| | | <result property="forbiddenRemark" column="forbidden_remark"/> |
| | | <result property="remark" column="remark"/> |
| | | <result property="roleType" column="role_type"/> |
| | | <result property="objectId" column="objectId"/> |
| | | <association property="dept" column="dept_id" javaType="com.ruoyi.system.api.domain.SysDept" |
| | | resultMap="deptResult"/> |
| | | <collection property="roles" javaType="java.util.List" resultMap="RoleResult"/> |
| | | </resultMap> |
| | | |
| | | <resultMap id="RoleResult" type="com.ruoyi.system.api.domain.SysRole"> |
| | | <id property="roleId" column="role_id" /> |
| | | <result property="roleName" column="role_name" /> |
| | | <result property="roleKey" column="role_key" /> |
| | | <result property="dataScope" column="data_scope" /> |
| | | <result property="status" column="role_status" /> |
| | | </resultMap> |
| | | <resultMap id="deptResult" type="com.ruoyi.system.api.domain.SysDept"> |
| | | <id property="deptId" column="dept_id"/> |
| | | <result property="parentId" column="parent_id"/> |
| | | <result property="deptName" column="dept_name"/> |
| | | <result property="ancestors" column="ancestors"/> |
| | | <result property="orderNum" column="order_num"/> |
| | | <result property="leader" column="leader"/> |
| | | <result property="status" column="dept_status"/> |
| | | </resultMap> |
| | | |
| | | <resultMap id="RoleResult" type="com.ruoyi.system.api.domain.SysRole"> |
| | | <id property="roleId" column="role_id"/> |
| | | <result property="roleName" column="role_name"/> |
| | | <result property="roleKey" column="role_key"/> |
| | | <result property="dataScope" column="data_scope"/> |
| | | <result property="status" column="role_status"/> |
| | | </resultMap> |
| | | |
| | | <sql id="selectUserVo"> |
| | | select u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.avatar, u.phonenumber, u.password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.role_type, u.create_by, u.create_time, u.remark, |
| | | d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.status as dept_status, |
| | | r.role_id, r.role_name, r.role_key, r.data_scope, r.status as role_status ,u.role_type as roleType,u.objectId AS objectId |
| | | from sys_user u |
| | | left join sys_dept d on u.dept_id = d.dept_id |
| | | left join sys_user_role ur on u.user_id = ur.user_id |
| | | left join sys_role r on r.role_id = ur.role_id |
| | | </sql> |
| | | |
| | | <select id="selectUserList" parameterType="com.ruoyi.system.api.domain.SysUser" resultMap="SysUserResult"> |
| | | select u.user_id, u.dept_id, u.nick_name, u.user_name, u.email, u.avatar, u.phonenumber, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, d.dept_name, d.leader from sys_user u |
| | | select u.user_id, |
| | | u.dept_id, |
| | | u.user_name, |
| | | u.nick_name, |
| | | u.email, |
| | | u.avatar, |
| | | u.phonenumber, |
| | | u.password, |
| | | u.sex, |
| | | u.status, |
| | | u.del_flag, |
| | | u.login_ip, |
| | | u.login_date, |
| | | u.role_type, |
| | | u.create_by, |
| | | u.create_time, |
| | | u.remark, |
| | | d.dept_id, |
| | | d.parent_id, |
| | | d.ancestors, |
| | | d.dept_name, |
| | | d.order_num, |
| | | d.leader, |
| | | d.status as dept_status, |
| | | r.role_id, |
| | | r.role_name, |
| | | r.role_key, |
| | | r.data_scope, |
| | | r.status as role_status, |
| | | u.role_type as roleType, |
| | | u.objectId AS objectId |
| | | from sys_user u |
| | | left join sys_dept d on u.dept_id = d.dept_id |
| | | left join sys_user_role ur on u.user_id = ur.user_id |
| | | left join sys_role r on r.role_id = ur.role_id |
| | | </sql> |
| | | |
| | | <select id="selectUserList" parameterType="com.ruoyi.system.api.domain.SysUser" resultMap="SysUserResult"> |
| | | select u.user_id, u.dept_id, u.nick_name, u.user_name, u.email, u.avatar, u.phonenumber, u.sex, u.status, |
| | | u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, d.dept_name, d.leader from sys_user |
| | | u |
| | | left join sys_dept d on u.dept_id = d.dept_id |
| | | where u.del_flag = '0' |
| | | <if test="phonenumber != null and phonenumber != ''"> |
| | |
| | | </select> |
| | | |
| | | <select id="selectAllocatedList" parameterType="com.ruoyi.system.api.domain.SysUser" resultMap="SysUserResult"> |
| | | select distinct u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.phonenumber, u.status, u.create_time |
| | | from sys_user u |
| | | left join sys_dept d on u.dept_id = d.dept_id |
| | | left join sys_user_role ur on u.user_id = ur.user_id |
| | | left join sys_role r on r.role_id = ur.role_id |
| | | where u.del_flag = '0' and r.role_id = #{roleId} |
| | | <if test="userName != null and userName != ''"> |
| | | select distinct u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.phonenumber, u.status, u.create_time |
| | | from sys_user u |
| | | left join sys_dept d on u.dept_id = d.dept_id |
| | | left join sys_user_role ur on u.user_id = ur.user_id |
| | | left join sys_role r on r.role_id = ur.role_id |
| | | where u.del_flag = '0' and r.role_id = #{roleId} |
| | | <if test="userName != null and userName != ''"> |
| | | AND u.user_name like concat('%', #{userName}, '%') |
| | | </if> |
| | | <if test="phonenumber != null and phonenumber != ''"> |
| | |
| | | </select> |
| | | |
| | | <select id="selectUnallocatedList" parameterType="com.ruoyi.system.api.domain.SysUser" resultMap="SysUserResult"> |
| | | select distinct u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.phonenumber, u.status, u.create_time |
| | | from sys_user u |
| | | left join sys_dept d on u.dept_id = d.dept_id |
| | | left join sys_user_role ur on u.user_id = ur.user_id |
| | | left join sys_role r on r.role_id = ur.role_id |
| | | where u.del_flag = '0' and (r.role_id != #{roleId} or r.role_id IS NULL) |
| | | and u.user_id not in (select u.user_id from sys_user u inner join sys_user_role ur on u.user_id = ur.user_id and ur.role_id = #{roleId}) |
| | | <if test="userName != null and userName != ''"> |
| | | select distinct u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.phonenumber, u.status, u.create_time |
| | | from sys_user u |
| | | left join sys_dept d on u.dept_id = d.dept_id |
| | | left join sys_user_role ur on u.user_id = ur.user_id |
| | | left join sys_role r on r.role_id = ur.role_id |
| | | where u.del_flag = '0' and (r.role_id != #{roleId} or r.role_id IS NULL) |
| | | and u.user_id not in (select u.user_id from sys_user u inner join sys_user_role ur on u.user_id = ur.user_id and |
| | | ur.role_id = #{roleId}) |
| | | <if test="userName != null and userName != ''"> |
| | | AND u.user_name like concat('%', #{userName}, '%') |
| | | </if> |
| | | <if test="phonenumber != null and phonenumber != ''"> |
| | |
| | | </select> |
| | | |
| | | <select id="selectUserByUserName" parameterType="String" resultMap="SysUserResult"> |
| | | <include refid="selectUserVo"/> |
| | | <include refid="selectUserVo"/> |
| | | where u.user_name = #{userName} and u.del_flag = '0' |
| | | and u.role_type = 1 |
| | | </select> |
| | | <select id="selectUserShopByUserName" parameterType="String" resultMap="SysUserResult"> |
| | | <include refid="selectUserVo"/> |
| | | <include refid="selectUserVo"/> |
| | | where u.user_name = #{userName} and u.del_flag = '0' |
| | | and u.role_type = 2 |
| | | </select> |
| | |
| | | </select> |
| | | |
| | | <select id="checkEmailUnique" parameterType="String" resultMap="SysUserResult"> |
| | | select user_id, email from sys_user where email = #{email} and del_flag = '0' limit 1 |
| | | select user_id, email |
| | | from sys_user |
| | | where email = #{email} |
| | | and del_flag = '0' limit 1 |
| | | </select> |
| | | <select id="getList" resultMap="SysUserResult"> |
| | | select * from sys_user where del_flag = '0' and status = '0' |
| | | <select id="getList" resultMap="SysUserResult"> |
| | | select * from sys_user where del_flag = '0' |
| | | <if test="null != req.phonenumber and '' != req.phonenumber"> |
| | | and phonenumber like CONCAT('%', #{req.phonenumber}, '%') |
| | | </if> |
| | | <choose> |
| | | <when test="null != req.objectId"> |
| | | and user_id in (select user_id from t_user_shop where shop_id = #{req.objectId} |
| | | <if test="null != req.deptId"> |
| | | and dept_id = #{req.deptId} |
| | | </if> |
| | | <if test="req.search !=null and req.search !=''"> |
| | | and nick_name like concat("%", #{req.search},"%") |
| | | </if> |
| | | ) |
| | | </when> |
| | | <otherwise> |
| | | and role_type = 1 |
| | | <if test="null != req.deptId"> |
| | | and dept_id = #{req.deptId} |
| | | </if> |
| | | <if test="req.search !=null and req.search !=''"> |
| | | and nick_name like concat("%", #{req.search},"%") |
| | | </if> |
| | | </otherwise> |
| | | </choose> |
| | | <if test="null != req.deptId"> |
| | | and dept_id = #{req.deptId} |
| | | </if> |
| | | <if test="null != req.roleId"> |
| | | and user_id in (select user_id from sys_user_role where role_id = #{req.roleId}) |
| | | </if> |
| | | <if test="req.search !=null and req.search !=''"> |
| | | and nick_name like concat("%", #{req.search},"%") |
| | | </if> |
| | | <if test="req.status !=null and req.status !=''"> |
| | | and status = #{req.status} |
| | | </if> |
| | | order by create_time desc |
| | | </select> |
| | | <select id="getAllList" resultType="com.ruoyi.system.api.domain.SysUser"> |
| | | select *,user_id userId,nick_name userName ,create_time createTime ,login_date loginDate from sys_user where role_type=3 and user_id in |
| | | |
| | | <foreach collection="ids" separator="," open="(" item="id" index="index" close=")" > |
| | | select *,user_id userId,nick_name userName ,create_time createTime ,login_date loginDate from sys_user where |
| | | role_type=3 and user_id in |
| | | |
| | | <foreach collection="ids" separator="," open="(" item="id" index="index" close=")"> |
| | | #{id} |
| | | </foreach> |
| | | order by create_time desc |
| | | </select> |
| | | <select id="getSysUserFromPhone" resultType="java.lang.Long"> |
| | | select user_id from sys_user where phonenumber =#{phoneNumber} |
| | | select user_id |
| | | from sys_user |
| | | where phonenumber = #{phoneNumber} |
| | | </select> |
| | | <select id="getChangeUserList" resultType="com.ruoyi.system.api.domain.SysUser"> |
| | | <select id="getChangeUserList" resultType="com.ruoyi.system.api.domain.SysUser"> |
| | | select |
| | | user_id AS userId, |
| | | nick_name AS nickName, |
| | | user_name AS userName, |
| | | create_time AS createTime, |
| | | remark AS remark |
| | | user_id AS userId, |
| | | nick_name AS nickName, |
| | | user_name AS userName, |
| | | create_time AS createTime, |
| | | remark AS remark |
| | | from sys_user |
| | | <where> |
| | | <if test="query.nickName != null and query.nickName != ''"> |
| | |
| | | </where> |
| | | ORDER BY create_time DESC |
| | | </select> |
| | | |
| | | <insert id="insertUser" parameterType="com.ruoyi.system.api.domain.SysUser" useGeneratedKeys="true" keyProperty="userId"> |
| | | insert into sys_user( |
| | | <if test="userId != null and userId != 0">user_id,</if> |
| | | <if test="deptId != null and deptId != 0">dept_id,</if> |
| | | <if test="userName != null and userName != ''">user_name,</if> |
| | | <if test="nickName != null and nickName != ''">nick_name,</if> |
| | | <if test="email != null and email != ''">email,</if> |
| | | <if test="avatar != null and avatar != ''">avatar,</if> |
| | | <if test="phonenumber != null and phonenumber != ''">phonenumber,</if> |
| | | <if test="sex != null and sex != ''">sex,</if> |
| | | <if test="password != null and password != ''">password,</if> |
| | | <if test="status != null and status != ''">status,</if> |
| | | <if test="createBy != null and createBy != ''">create_by,</if> |
| | | <if test="roleType != null and roleType != ''">role_type,</if> |
| | | <if test="remark != null and remark != ''">remark,</if> |
| | | <if test="objectId != null and objectId != ''">objectId,</if> |
| | | <if test="appUserId != null and appUserId != ''">app_user_id,</if> |
| | | create_time |
| | | )values( |
| | | <if test="userId != null and userId != ''">#{userId},</if> |
| | | <if test="deptId != null and deptId != ''">#{deptId},</if> |
| | | <if test="userName != null and userName != ''">#{userName},</if> |
| | | <if test="nickName != null and nickName != ''">#{nickName},</if> |
| | | <if test="email != null and email != ''">#{email},</if> |
| | | <if test="avatar != null and avatar != ''">#{avatar},</if> |
| | | <if test="phonenumber != null and phonenumber != ''">#{phonenumber},</if> |
| | | <if test="sex != null and sex != ''">#{sex},</if> |
| | | <if test="password != null and password != ''">#{password},</if> |
| | | <if test="status != null and status != ''">#{status},</if> |
| | | <if test="createBy != null and createBy != ''">#{createBy},</if> |
| | | <if test="roleType != null and roleType != ''">#{roleType},</if> |
| | | <if test="remark != null and remark != ''">#{remark},</if> |
| | | <if test="objectId != null and objectId != ''">#{objectId},</if> |
| | | <if test="appUserId != null and appUserId != ''">#{appUserId},</if> |
| | | sysdate() |
| | | ) |
| | | |
| | | <insert id="insertUser" parameterType="com.ruoyi.system.api.domain.SysUser" useGeneratedKeys="true" |
| | | keyProperty="userId"> |
| | | insert into sys_user( |
| | | <if test="userId != null and userId != 0">user_id,</if> |
| | | <if test="deptId != null and deptId != 0">dept_id,</if> |
| | | <if test="userName != null and userName != ''">user_name,</if> |
| | | <if test="nickName != null and nickName != ''">nick_name,</if> |
| | | <if test="email != null and email != ''">email,</if> |
| | | <if test="avatar != null and avatar != ''">avatar,</if> |
| | | <if test="phonenumber != null and phonenumber != ''">phonenumber,</if> |
| | | <if test="sex != null and sex != ''">sex,</if> |
| | | <if test="password != null and password != ''">password,</if> |
| | | <if test="status != null and status != ''">status,</if> |
| | | <if test="createBy != null and createBy != ''">create_by,</if> |
| | | <if test="roleType != null and roleType != ''">role_type,</if> |
| | | <if test="remark != null and remark != ''">remark,</if> |
| | | <if test="objectId != null and objectId != ''">objectId,</if> |
| | | <if test="appUserId != null and appUserId != ''">app_user_id,</if> |
| | | create_time |
| | | )values( |
| | | <if test="userId != null and userId != ''">#{userId},</if> |
| | | <if test="deptId != null and deptId != ''">#{deptId},</if> |
| | | <if test="userName != null and userName != ''">#{userName},</if> |
| | | <if test="nickName != null and nickName != ''">#{nickName},</if> |
| | | <if test="email != null and email != ''">#{email},</if> |
| | | <if test="avatar != null and avatar != ''">#{avatar},</if> |
| | | <if test="phonenumber != null and phonenumber != ''">#{phonenumber},</if> |
| | | <if test="sex != null and sex != ''">#{sex},</if> |
| | | <if test="password != null and password != ''">#{password},</if> |
| | | <if test="status != null and status != ''">#{status},</if> |
| | | <if test="createBy != null and createBy != ''">#{createBy},</if> |
| | | <if test="roleType != null and roleType != ''">#{roleType},</if> |
| | | <if test="remark != null and remark != ''">#{remark},</if> |
| | | <if test="objectId != null and objectId != ''">#{objectId},</if> |
| | | <if test="appUserId != null and appUserId != ''">#{appUserId},</if> |
| | | sysdate() |
| | | ) |
| | | </insert> |
| | | |
| | | <update id="updateUser" parameterType="com.ruoyi.system.api.domain.SysUser"> |
| | | update sys_user |
| | | <set> |
| | | <if test="deptId != null and deptId != 0">dept_id = #{deptId},</if> |
| | | <if test="userName != null and userName != ''">user_name = #{userName},</if> |
| | | <if test="nickName != null and nickName != ''">nick_name = #{nickName},</if> |
| | | <if test="email != null ">email = #{email},</if> |
| | | <if test="phonenumber != null ">phonenumber = #{phonenumber},</if> |
| | | <if test="sex != null and sex != ''">sex = #{sex},</if> |
| | | <if test="avatar != null and avatar != ''">avatar = #{avatar},</if> |
| | | <if test="password != null and password != ''">password = #{password},</if> |
| | | <if test="status != null and status != ''">status = #{status},</if> |
| | | <if test="loginIp != null and loginIp != ''">login_ip = #{loginIp},</if> |
| | | <if test="loginDate != null">login_date = #{loginDate},</if> |
| | | <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if> |
| | | <if test="remark != null">remark = #{remark},</if> |
| | | update sys_user |
| | | <set> |
| | | <if test="deptId != null and deptId != 0">dept_id = #{deptId},</if> |
| | | <if test="userName != null and userName != ''">user_name = #{userName},</if> |
| | | <if test="nickName != null and nickName != ''">nick_name = #{nickName},</if> |
| | | <if test="email != null ">email = #{email},</if> |
| | | <if test="phonenumber != null ">phonenumber = #{phonenumber},</if> |
| | | <if test="sex != null and sex != ''">sex = #{sex},</if> |
| | | <if test="avatar != null and avatar != ''">avatar = #{avatar},</if> |
| | | <if test="password != null and password != ''">password = #{password},</if> |
| | | <if test="status != null and status != ''">status = #{status},</if> |
| | | <if test="loginIp != null and loginIp != ''">login_ip = #{loginIp},</if> |
| | | <if test="loginDate != null">login_date = #{loginDate},</if> |
| | | <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if> |
| | | <if test="remark != null">remark = #{remark},</if> |
| | | <if test="forbiddenRemark != null">forbidden_remark = #{forbiddenRemark},</if> |
| | | <if test="roleType != null">role_type = #{roleType},</if> |
| | | <if test="objectId != null">objectId = #{objectId},</if> |
| | | update_time = sysdate() |
| | | </set> |
| | | where user_id = #{userId} |
| | | update_time = sysdate() |
| | | </set> |
| | | where user_id = #{userId} |
| | | </update> |
| | | |
| | | <update id="updateUserStatus" parameterType="com.ruoyi.system.api.domain.SysUser"> |
| | | update sys_user set status = #{status} where user_id = #{userId} |
| | | update sys_user |
| | | set status = #{status} |
| | | where user_id = #{userId} |
| | | </update> |
| | | |
| | | <update id="updateUserAvatar" parameterType="com.ruoyi.system.api.domain.SysUser"> |
| | | update sys_user set avatar = #{avatar} where user_name = #{userName} |
| | | update sys_user |
| | | set avatar = #{avatar} |
| | | where user_name = #{userName} |
| | | </update> |
| | | |
| | | <update id="resetUserPwd" parameterType="com.ruoyi.system.api.domain.SysUser"> |
| | | update sys_user set password = #{password} where user_name = #{userName} and role_type =1 |
| | | update sys_user |
| | | set password = #{password} |
| | | where user_name = #{userName} |
| | | and role_type = 1 |
| | | </update> |
| | | <update id="resetUserShopPwd" parameterType="com.ruoyi.system.api.domain.SysUser"> |
| | | update sys_user set password = #{password} where user_name = #{userName} and role_type =2 |
| | | update sys_user |
| | | set password = #{password} |
| | | where user_name = #{userName} |
| | | and role_type = 2 |
| | | </update> |
| | | |
| | | <update id="deleteUserById" parameterType="Long"> |
| | | update sys_user set del_flag = '2' where user_id = #{userId} |
| | | </update> |
| | | |
| | | <update id="deleteUserByIds" parameterType="Long"> |
| | | update sys_user set del_flag = '2' where user_id in |
| | | <foreach collection="array" item="userId" open="(" separator="," close=")"> |
| | | #{userId} |
| | | </foreach> |
| | | </update> |
| | | update sys_user |
| | | set del_flag = '2' |
| | | where user_id = #{userId} |
| | | </update> |
| | | |
| | | <update id="deleteUserByIds" parameterType="Long"> |
| | | update sys_user set del_flag = '2' where user_id in |
| | | <foreach collection="array" item="userId" open="(" separator="," close=")"> |
| | | #{userId} |
| | | </foreach> |
| | | </update> |
| | | <delete id="deleteSysUser"> |
| | | delete from sys_user where user_id in |
| | | <foreach collection="userIds" separator="," open="(" item="id" close=")" > |
| | | <foreach collection="userIds" separator="," open="(" item="id" close=")"> |
| | | #{id} |
| | | </foreach> |
| | | </delete> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8" ?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.ruoyi.system.mapper.WarnMapper"> |
| | | |
| | | |
| | | <select id="getCarWarnList" resultType="com.ruoyi.system.query.CarWarnListResp"> |
| | | select b.vehicle_name as carName, |
| | | b.vehicle_number as vehicleNumber, |
| | | a.keep_warn as keepWarn, |
| | | c.`name` as driverName, |
| | | d.`name` as enterpriseName, |
| | | a.terminal_number as terminalNumber, |
| | | a.start_time as startTime, |
| | | a.end_time as endTime, |
| | | a.keep_time as keepTime, |
| | | a.keep_distance as keepDistance, |
| | | a.warn_type as warnType, |
| | | a.warn_number as warnNumber, |
| | | a.treatment_state as treatmentState, |
| | | a.treatment_user as treatmentUser, |
| | | a.treatment_time as treatmentTime, |
| | | a.treatment_remark as treatmentRemark |
| | | from t_warn a |
| | | left join t_car b on (a.car_id = b.id) |
| | | left join t_driver c on (a.driver_id = c.id) |
| | | left join t_enterprise d on (a.enterprise_id = d.id) |
| | | <where> |
| | | <if test="null != item.warnType and '' != item.warnType"> |
| | | and a.warn_type = #{item.warnType} |
| | | </if> |
| | | <if test="null != item.vehicleNumber and '' != item.vehicleNumber"> |
| | | and b.vehicle_number like CONCAT('%', #{item.vehicleNumber}, '%') |
| | | </if> |
| | | <if test="null != item.driverName and '' != item.driverName"> |
| | | and c.`name` like CONCAT('%', #{item.driverName}, '%') |
| | | </if> |
| | | <if test="null != item.enterpriseName and '' != item.enterpriseName"> |
| | | and d.`name` like CONCAT('%', #{item.enterpriseName}, '%') |
| | | </if> |
| | | <if test="null != item.startTime and '' != item.startTime"> |
| | | and a.start_time >= #{item.startTime} |
| | | </if> |
| | | <if test="null != item.endTime and '' != item.endTime"> |
| | | and a.end_time <= #{item.endTime} |
| | | </if> |
| | | <if test="null != item.treatmentState and '' != item.treatmentState"> |
| | | and a.treatment_state = #{item.treatmentState} |
| | | </if> |
| | | </where> |
| | | order by a.create_time desc |
| | | </select> |
| | | |
| | | |
| | | <select id="getWarnGroupCount" resultType="map"> |
| | | |
| | | </select> |
| | | </mapper> |
| | |
| | | package com.ruoyi.dataInterchange.controller; |
| | | |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.utils.bean.BeanUtils; |
| | | import com.ruoyi.dataInterchange.api.vo.GnssDataVo; |
| | | import com.ruoyi.dataInterchange.api.vo.OrderTravelVo; |
| | | import com.ruoyi.dataInterchange.dao.UPExgMsgRealLocationDao; |
| | | import com.ruoyi.dataInterchange.model.GnssData; |
| | |
| | | |
| | | /** |
| | | * 获取订单行程轨迹 |
| | | * |
| | | * @param vehicleNo |
| | | * @param start |
| | | * @param end |
| | |
| | | */ |
| | | @PostMapping("/getOrderTravel") |
| | | public R<List<OrderTravelVo>> getOrderTravel(@RequestParam("vehicleNo") String vehicleNo, @RequestParam("start") Long start, |
| | | @RequestParam("end") Long end){ |
| | | @RequestParam("end") Long end) { |
| | | List<UPExgMsgRealLocation> list = upExgMsgRealLocationDao.findByVehicleNoAndCreateTimeBetween(vehicleNo, start, end); |
| | | List<OrderTravelVo> orderTravelVos = new ArrayList<>(); |
| | | for (UPExgMsgRealLocation upExgMsgRealLocation : list) { |
| | |
| | | return R.ok(orderTravelVos); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取司机的最新行驶速度 |
| | | * |
| | | * @param vehicleNo |
| | | * @return |
| | | */ |
| | | @PostMapping("/getVehicleSpeed") |
| | | public R<GnssDataVo> getVehicleSpeed(@RequestParam("vehicleNo") String vehicleNo) { |
| | | UPExgMsgRealLocation upExgMsgRealLocation = upExgMsgRealLocationDao.findByVehicleNoOrderByCreateTimeDesc(vehicleNo); |
| | | if (null == upExgMsgRealLocation) { |
| | | return R.ok(); |
| | | } |
| | | GnssData gnssData = upExgMsgRealLocation.getGnssData(); |
| | | GnssDataVo vo = new GnssDataVo(); |
| | | BeanUtils.copyProperties(gnssData, vo); |
| | | return R.ok(vo); |
| | | } |
| | | |
| | | } |
| | |
| | | |
| | | /** |
| | | * 查询有效时间段车辆的定位数据 |
| | | * |
| | | * @param vehicleNo |
| | | * @param start |
| | | * @param end |
| | | * @return |
| | | */ |
| | | List<UPExgMsgRealLocation> findByVehicleNoAndCreateTimeBetween(String vehicleNo, Long start, Long end); |
| | | |
| | | /** |
| | | * 获取车辆的最新定位 |
| | | * |
| | | * @param vehicleNo |
| | | * @return |
| | | */ |
| | | UPExgMsgRealLocation findByVehicleNoOrderByCreateTimeDesc(String vehicleNo); |
| | | } |