Merge remote-tracking branch 'origin/master'
# Conflicts: # muyu-modules/muyu-business/muyu-business-common/src/main/java/com/muyu/business/domain/FaultCodeInfo.java # muyu-modules/muyu-business/muyu-business-common/src/main/java/com/muyu/business/domain/req/FaultCodeReq.java # muyu-modules/muyu-business/muyu-business-common/src/main/java/com/muyu/business/domain/req/FaultCodesAddReq.java # muyu-modules/muyu-business/muyu-business-common/src/main/java/com/muyu/business/domain/req/FaultCodesUpdReq.java # muyu-modules/muyu-business/muyu-business-common/src/main/java/com/muyu/business/domain/res/FaultCodeResponse.javavehicle-yinyuyang
commit
b4840a9245
|
@ -1,5 +1,7 @@
|
|||
package com.muyu.system.common.domain;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.muyu.common.core.web.domain.BaseEntity;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
@ -26,7 +28,7 @@ public class CarInfo {
|
|||
/**
|
||||
* 车辆表vin
|
||||
*/
|
||||
private String carVin;
|
||||
private String vin;
|
||||
/**
|
||||
* 开启时间
|
||||
*/
|
||||
|
|
|
@ -1,164 +0,0 @@
|
|||
package com.muyu.system.common.domain;
|
||||
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.muyu.common.core.annotation.Excel;
|
||||
import com.muyu.common.core.web.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 企业管理对象 enterprise_info
|
||||
*
|
||||
* @author huangdaju
|
||||
* @date 2024-03-28
|
||||
*/
|
||||
public class EnterpriseInfo extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** $column.columnComment */
|
||||
private Long enterpriseId;
|
||||
|
||||
/** 企业名称 */
|
||||
@Excel(name = "企业名称")
|
||||
private String enterpriseName;
|
||||
|
||||
/** 联系人邮箱 */
|
||||
@Excel(name = "联系人邮箱")
|
||||
private String email;
|
||||
|
||||
/** 企业地址 */
|
||||
@Excel(name = "企业地址")
|
||||
private String enterpriseAddress;
|
||||
|
||||
/** 企业联系电话 */
|
||||
@Excel(name = "企业联系电话")
|
||||
private String phoneNumber;
|
||||
|
||||
/** 行业类型 */
|
||||
@Excel(name = "行业类型")
|
||||
private String industry;
|
||||
|
||||
/** 企业状态 */
|
||||
@Excel(name = "企业状态")
|
||||
private String status;
|
||||
|
||||
/** 企业标识 */
|
||||
@Excel(name = "企业标识")
|
||||
private String deptId;
|
||||
|
||||
/** 删除标志(0代表存在 2代表删除) */
|
||||
private String delFlag;
|
||||
|
||||
/** 负责人 */
|
||||
@Excel(name = "负责人")
|
||||
private String leader;
|
||||
|
||||
public void setEnterpriseId(Long enterpriseId)
|
||||
{
|
||||
this.enterpriseId = enterpriseId;
|
||||
}
|
||||
|
||||
public Long getEnterpriseId()
|
||||
{
|
||||
return enterpriseId;
|
||||
}
|
||||
public void setEnterpriseName(String enterpriseName)
|
||||
{
|
||||
this.enterpriseName = enterpriseName;
|
||||
}
|
||||
|
||||
public String getEnterpriseName()
|
||||
{
|
||||
return enterpriseName;
|
||||
}
|
||||
public void setEmail(String email)
|
||||
{
|
||||
this.email = email;
|
||||
}
|
||||
|
||||
public String getEmail()
|
||||
{
|
||||
return email;
|
||||
}
|
||||
public void setEnterpriseAddress(String enterpriseAddress)
|
||||
{
|
||||
this.enterpriseAddress = enterpriseAddress;
|
||||
}
|
||||
|
||||
public String getEnterpriseAddress()
|
||||
{
|
||||
return enterpriseAddress;
|
||||
}
|
||||
public void setPhoneNumber(String phoneNumber)
|
||||
{
|
||||
this.phoneNumber = phoneNumber;
|
||||
}
|
||||
|
||||
public String getPhoneNumber()
|
||||
{
|
||||
return phoneNumber;
|
||||
}
|
||||
public void setIndustry(String industry)
|
||||
{
|
||||
this.industry = industry;
|
||||
}
|
||||
|
||||
public String getIndustry()
|
||||
{
|
||||
return industry;
|
||||
}
|
||||
public void setStatus(String status)
|
||||
{
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getStatus()
|
||||
{
|
||||
return status;
|
||||
}
|
||||
public void setDeptId(String deptId)
|
||||
{
|
||||
this.deptId = deptId;
|
||||
}
|
||||
|
||||
public String getDeptId()
|
||||
{
|
||||
return deptId;
|
||||
}
|
||||
public void setDelFlag(String delFlag)
|
||||
{
|
||||
this.delFlag = delFlag;
|
||||
}
|
||||
|
||||
public String getDelFlag()
|
||||
{
|
||||
return delFlag;
|
||||
}
|
||||
public void setLeader(String leader)
|
||||
{
|
||||
this.leader = leader;
|
||||
}
|
||||
|
||||
public String getLeader()
|
||||
{
|
||||
return leader;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("enterpriseId", getEnterpriseId())
|
||||
.append("enterpriseName", getEnterpriseName())
|
||||
.append("email", getEmail())
|
||||
.append("enterpriseAddress", getEnterpriseAddress())
|
||||
.append("phoneNumber", getPhoneNumber())
|
||||
.append("industry", getIndustry())
|
||||
.append("status", getStatus())
|
||||
.append("deptId", getDeptId())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("delFlag", getDelFlag())
|
||||
.append("leader", getLeader())
|
||||
.toString();
|
||||
}
|
||||
}
|
|
@ -1,12 +1,11 @@
|
|||
package com.muyu.system.common.domain;
|
||||
|
||||
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.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
package com.muyu.system.common.domain;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.muyu.common.core.annotation.Excel;
|
||||
import com.muyu.common.core.annotation.Excel.ColumnType;
|
||||
import com.muyu.common.core.web.domain.BaseEntity;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
package com.muyu.system.common.domain;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.muyu.common.core.annotation.Excel;
|
||||
import com.muyu.common.core.annotation.Excel.ColumnType;
|
||||
import com.muyu.common.core.web.domain.BaseEntity;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
|
|
|
@ -3,13 +3,12 @@ package com.muyu.system.common.domain.req;
|
|||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Pattern;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* 车辆表添加
|
||||
|
|
|
@ -26,7 +26,7 @@ public class CarInfoAddReq {
|
|||
* 车辆表vin
|
||||
*/
|
||||
@ApiModelProperty(value = "车辆vin")
|
||||
private String carVin;
|
||||
private String vin;
|
||||
/**
|
||||
* 开启时间
|
||||
*/
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package com.muyu.system.common.domain.req;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
|
|
|
@ -3,10 +3,12 @@ package com.muyu.system.common.domain.req;
|
|||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
|
||||
import javax.validation.constraints.Min;
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Pattern;
|
||||
|
|
|
@ -0,0 +1,215 @@
|
|||
package com.muyu.system.common.domain;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 实时运行轨迹
|
||||
* @ProjectName: cloud-vehicles
|
||||
* @PackageName: com.muyu.system.common.domain
|
||||
* @Description TODO
|
||||
* @Author XiaoFan
|
||||
* @Date 2024/4/4 10:07
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class track {
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
private Integer trackId;
|
||||
/**
|
||||
* VIN车辆编码
|
||||
*/
|
||||
private String vin;
|
||||
/**
|
||||
* 报文创建时间
|
||||
*/
|
||||
private Date createTime;
|
||||
/**
|
||||
* 经度
|
||||
*/
|
||||
private String longitude;
|
||||
/**
|
||||
* 纬度
|
||||
*/
|
||||
private String latitude;
|
||||
/**
|
||||
* 速度
|
||||
*/
|
||||
private String speed;
|
||||
/**
|
||||
* 里程
|
||||
*/
|
||||
private BigDecimal mileage;
|
||||
/**
|
||||
* 总电压
|
||||
*/
|
||||
private String voltage;
|
||||
/**
|
||||
* 总电流
|
||||
*/
|
||||
private String current;
|
||||
/**
|
||||
* 绝缘电阻
|
||||
*/
|
||||
private String resistance;
|
||||
/**
|
||||
* 档位P档位D运行
|
||||
*/
|
||||
private String gear;
|
||||
/**
|
||||
* 加速踏板行驶值
|
||||
*/
|
||||
private String accelerationPedel;
|
||||
/**
|
||||
* 制动踏板行驶值
|
||||
*/
|
||||
private String brakePedel;
|
||||
/**
|
||||
* 燃料消耗率
|
||||
*/
|
||||
private String fuelConsumptionRate;
|
||||
/**
|
||||
* 电机控制器温度
|
||||
*/
|
||||
private String motorControllerTemperature;
|
||||
/**
|
||||
* 电机转速
|
||||
*/
|
||||
private String motorSpeed;
|
||||
/**
|
||||
* 电机转矩
|
||||
*/
|
||||
private String motorTorque;
|
||||
/**
|
||||
* 电机温度
|
||||
*/
|
||||
private String motorTemperature;
|
||||
/**
|
||||
* 电机电压
|
||||
*/
|
||||
private String motorVoltage;
|
||||
/**
|
||||
* 电机电流
|
||||
*/
|
||||
private String motorCurrent;
|
||||
/**
|
||||
* 动力电池剩余电量SOC
|
||||
*/
|
||||
private BigDecimal remainingBattery;
|
||||
/**
|
||||
* 当前状态允许的最大反馈功率
|
||||
*/
|
||||
private String maximumFeedbackPower;
|
||||
/**
|
||||
* 当前状态允许的最大放电功率
|
||||
*/
|
||||
private String maximumDischargePower;
|
||||
/**
|
||||
* BMS自检计数器
|
||||
*/
|
||||
private String selfCheckCounter;
|
||||
/**
|
||||
* 动力电池充放电电流
|
||||
*/
|
||||
private String totalBatteryCurrent;
|
||||
/**
|
||||
* 动力电池负载端电压V3
|
||||
*/
|
||||
private String totalBatteryVoltage;
|
||||
/**
|
||||
* 单体电池最高电压
|
||||
*/
|
||||
private String singleBatteryMaxVoltage;
|
||||
/**
|
||||
* 单体电池最低电压·
|
||||
*/
|
||||
private String singleBatteryMinVoltage;
|
||||
/**
|
||||
* 单体电池最高温度
|
||||
*/
|
||||
private String singleBatteryMaxTemperature;
|
||||
/**
|
||||
* 单体电池最低温度
|
||||
*/
|
||||
private String singleBatteryMinTemperature;
|
||||
/**
|
||||
* 动力电池可用容量
|
||||
*/
|
||||
private String availableBatteryCapacity;
|
||||
/**
|
||||
* 车辆状态 1:正常 0:故障
|
||||
*/
|
||||
private Integer vehicleStatus;
|
||||
/**
|
||||
* 充电状态 1:正常 0:故障
|
||||
*/
|
||||
private Integer chargingStatus;
|
||||
/**
|
||||
* 运行状态 1:正常 0:故障
|
||||
*/
|
||||
private Integer operatingStatus;
|
||||
/**
|
||||
* SOC 状态 1:正常 0:故障
|
||||
*/
|
||||
private Integer socStatus;
|
||||
/**
|
||||
* 可充电储能装置工作状态 1:正常 0:故障
|
||||
*/
|
||||
private Integer chargingEnergyStorageStatus;
|
||||
/**
|
||||
* 驱动电机状态 1:正常 0:故障
|
||||
*/
|
||||
private Integer driveMotorStatus;
|
||||
/**
|
||||
* 定位是否有效 1:有效 0:无效
|
||||
*/
|
||||
private Integer positionStatus;
|
||||
/**
|
||||
* EAS(汽车防盗系统)状态 1:正常 0:故障
|
||||
*/
|
||||
private Integer easStatus;
|
||||
/**
|
||||
* PTC(电动加热器)状态 1:正常 0:故障
|
||||
*/
|
||||
private Integer ptcStatus;
|
||||
/**
|
||||
* EPS(电动助力系统)状态 1:正常 0:故障
|
||||
*/
|
||||
private Integer epsStatus;
|
||||
/**
|
||||
* ABS(防抱死)状态 1:正常 0:故障
|
||||
*/
|
||||
private Integer absStatus;
|
||||
/**
|
||||
* MCU(电机/逆变器)状态 1:正常 0:故障
|
||||
*/
|
||||
private Integer mcuStatus;
|
||||
/**
|
||||
* 动力电池加热状态 1:正常 0:故障
|
||||
*/
|
||||
private Integer heatingStatus;
|
||||
/**
|
||||
* 动力电池当前状态 1:正常 0:故障
|
||||
*/
|
||||
private Integer batteryStatus;
|
||||
/**
|
||||
* 动力电池保温状态 1:正常 0:故障
|
||||
*/
|
||||
private Integer batteryinsulationStatus;
|
||||
/**
|
||||
* DCDC(电力交换系统) 状态 1:正常 0:故障
|
||||
*/
|
||||
private Integer dcdcStatus;
|
||||
/**
|
||||
* CHG(充电机)状态 1:正常 0:故障
|
||||
*/
|
||||
private Integer chgStatus;
|
||||
|
||||
}
|
|
@ -0,0 +1,110 @@
|
|||
package com.muyu.system.common.domain;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 车辆报文数据
|
||||
* @ProjectName: cloud-vehicles
|
||||
* @PackageName: com.muyu.system.common.domain
|
||||
* @Description TODO
|
||||
* @Author XiaoFan
|
||||
* @Date 2024/4/4 15:21
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class vehicleData {
|
||||
|
||||
/**
|
||||
* 报文ID
|
||||
*/
|
||||
private Integer id;
|
||||
/**
|
||||
* VIN
|
||||
*/
|
||||
private String vin;
|
||||
/**
|
||||
* 时间毫秒值
|
||||
*/
|
||||
private String date_time;
|
||||
/**
|
||||
* 车速
|
||||
*/
|
||||
private String speed;
|
||||
/**
|
||||
* 经度
|
||||
*/
|
||||
private String longitude;
|
||||
/**
|
||||
* 纬度
|
||||
*/
|
||||
private String latitude;
|
||||
/**
|
||||
* 单体电池最低电压
|
||||
*/
|
||||
private String single_battery_min_voltage;
|
||||
/**
|
||||
* 电机电压
|
||||
*/
|
||||
private String motor_voltage;
|
||||
/**
|
||||
* 电机转速
|
||||
*/
|
||||
private String motor_speed;
|
||||
/**
|
||||
* BMS自检计数器
|
||||
*/
|
||||
private String self_check_counter;
|
||||
/**
|
||||
* 总电压
|
||||
*/
|
||||
private String voltage;
|
||||
/**
|
||||
* 档位
|
||||
*/
|
||||
private String gear;
|
||||
/**
|
||||
* 电池剩余电量
|
||||
*/
|
||||
private String remaining_battery;
|
||||
/**
|
||||
* 电机电流
|
||||
*/
|
||||
private String motor_current;
|
||||
/**
|
||||
* 制动踏板行程值
|
||||
*/
|
||||
private String brake_pedal;
|
||||
/**
|
||||
* 总电流
|
||||
*/
|
||||
private String current;
|
||||
/**
|
||||
* 单次最大电压
|
||||
*/
|
||||
private String single_battery_max_voltage;
|
||||
/**
|
||||
* 燃料消耗率
|
||||
*/
|
||||
private String fuel_consumption_rate;
|
||||
/**
|
||||
* 绝缘电阻
|
||||
*/
|
||||
private String resistance;
|
||||
/**
|
||||
* 最大反馈功率
|
||||
*/
|
||||
private String maximum_feedback_power;
|
||||
/**
|
||||
* 单体电池最高温度
|
||||
*/
|
||||
private String single_battery_max_temperature;
|
||||
/**
|
||||
* 记录ID
|
||||
*/
|
||||
private Integer records_id;
|
||||
|
||||
}
|
|
@ -4,8 +4,12 @@ import com.muyu.system.common.domain.req.CarRequest;
|
|||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
|
||||
/**
|
||||
* 列表条件查询参数
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
package com.muyu.system.common.domain.vo;
|
||||
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.muyu.system.common.domain.SysDept;
|
||||
import com.muyu.system.common.domain.SysMenu;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
|
|
@ -1,92 +0,0 @@
|
|||
package com.muyu.system.common.vo;
|
||||
|
||||
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 com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @ProjectName: cloud-vehicles
|
||||
* @PackageName: com.muyu.system.common.vo
|
||||
* @Description TODO
|
||||
* @Author HuangDaJu
|
||||
* @Date 2024/3/29 18:18
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Data
|
||||
@SuperBuilder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@TableName("sys_dept")
|
||||
public class BusinessVo {
|
||||
|
||||
/** 部门ID */
|
||||
@TableId(type = IdType.AUTO)
|
||||
private Long deptId;
|
||||
|
||||
/** 父部门ID 默认查询100*/
|
||||
private Long parentId;
|
||||
|
||||
|
||||
private String logoType;
|
||||
|
||||
/** 祖级列表 */
|
||||
private String ancestors;
|
||||
|
||||
/** 部门名称 */
|
||||
private String deptName;
|
||||
|
||||
/** 显示顺序 */
|
||||
private Integer orderNum;
|
||||
|
||||
/** 负责人 */
|
||||
private String leader;
|
||||
|
||||
/** 联系电话 */
|
||||
private String phone;
|
||||
|
||||
/** 邮箱 */
|
||||
private String email;
|
||||
|
||||
/** 部门状态:0正常,1停用 */
|
||||
private String status;
|
||||
|
||||
/** 删除标志(0代表存在 2代表删除) */
|
||||
private String delFlag;
|
||||
|
||||
/**
|
||||
* 当前页
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private Integer pageNum;
|
||||
|
||||
/**
|
||||
* 每页大小
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private Integer pageSize;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date updateTime;
|
||||
|
||||
|
||||
}
|
|
@ -92,6 +92,12 @@
|
|||
<groupId>com.muyu</groupId>
|
||||
<artifactId>muyu-file-remote</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.paho</groupId>
|
||||
<artifactId>org.eclipse.paho.client.mqttv3</artifactId>
|
||||
<version>1.2.5</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
</dependencies>
|
||||
|
||||
|
|
|
@ -6,6 +6,8 @@ import com.muyu.common.swagger.annotation.EnableCustomSwagger2;
|
|||
import org.mybatis.spring.annotation.MapperScan;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.cloud.openfeign.EnableFeignClients;
|
||||
import springfox.documentation.swagger2.annotations.EnableSwagger2;
|
||||
|
||||
/**
|
||||
* 系统模块
|
||||
|
@ -14,10 +16,12 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
|
|||
*/
|
||||
@EnableCustomConfig
|
||||
@EnableCustomSwagger2
|
||||
@EnableSwagger2
|
||||
@EnableRyFeignClients
|
||||
@SpringBootApplication
|
||||
@MapperScan("com.muyu.system.mapper")
|
||||
public class MuYuSystemApplication{
|
||||
public class MuYuSystemApplication
|
||||
{
|
||||
public static void main(String[] args)
|
||||
{
|
||||
SpringApplication.run(MuYuSystemApplication.class, args);
|
||||
|
|
|
@ -1,11 +1,7 @@
|
|||
package com.muyu.system.controller;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import com.muyu.common.core.domain.PageResult;
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.common.core.utils.poi.ExcelUtil;
|
||||
import com.muyu.common.core.web.controller.BaseController;
|
||||
import com.muyu.common.log.annotation.Log;
|
||||
import com.muyu.common.log.enums.BusinessType;
|
||||
import com.muyu.common.security.annotation.RequiresPermissions;
|
||||
import com.muyu.system.common.domain.Car;
|
||||
import com.muyu.system.common.domain.Fence;
|
||||
|
@ -16,10 +12,13 @@ import com.muyu.system.remote.VehicleProviderService;
|
|||
import com.muyu.system.service.CarService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import com.muyu.common.log.annotation.Log;
|
||||
import com.muyu.common.log.enums.BusinessType;
|
||||
import com.muyu.common.core.web.controller.BaseController;
|
||||
import com.muyu.common.core.utils.poi.ExcelUtil;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
|
@ -73,7 +72,7 @@ public class CarController extends BaseController
|
|||
* 新增车辆信息
|
||||
*/
|
||||
@PostMapping("/add")
|
||||
// @RequiresPermissions("system:car:add")
|
||||
@RequiresPermissions("system:car:add")
|
||||
@Log(title = "车辆管理",businessType = BusinessType.INSERT)
|
||||
public Result add(@RequestBody @Validated CarAddReq carAddReq){
|
||||
Result result=Result.success(carAddReq);
|
||||
|
@ -111,35 +110,16 @@ public class CarController extends BaseController
|
|||
List<Fence> list=carService.selectFence();
|
||||
return Result.success(list);
|
||||
}
|
||||
/**
|
||||
* 关闭车辆
|
||||
*/
|
||||
@PostMapping("/updateStateClose/{carId}")
|
||||
@RequiresPermissions("system:car:edit")
|
||||
@Log(title = "车辆管理")
|
||||
public Result updateStateClose(@PathVariable Integer carId){
|
||||
int i=carService.updateStateClose(carId);
|
||||
return Result.success(i);
|
||||
}
|
||||
/**
|
||||
* 开启车辆
|
||||
*/
|
||||
@PostMapping("/updateStateOpen/{carId}")
|
||||
@RequiresPermissions("system:car:edit")
|
||||
@Log(title = "车辆管理")
|
||||
public Result updateStateOpen(@PathVariable Integer carId){
|
||||
int i=carService.updateStateOpen(carId);
|
||||
return Result.success(i);
|
||||
}
|
||||
|
||||
/**
|
||||
* 车辆上线(连接车联模拟数据)
|
||||
* @param carVin
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/open")
|
||||
@PostMapping("/open/{carVin}")
|
||||
@RequiresPermissions("system:car:edit")
|
||||
@Log(title = "车辆管理")
|
||||
public Result<String> open(@RequestParam String carVin){
|
||||
public Result<String> open(@PathVariable String carVin){
|
||||
Result<String> result=carService.callVehicleClientInit(carVin);
|
||||
return result;
|
||||
}
|
||||
|
@ -149,9 +129,10 @@ public class CarController extends BaseController
|
|||
* @param carVin
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/close")
|
||||
@PostMapping("/close/{carVin}")
|
||||
@RequiresPermissions("system:car:edit")
|
||||
@Log(title = "车辆管理")
|
||||
public Result<String> close(@RequestParam String carVin){
|
||||
public Result<String> close(@PathVariable String carVin){
|
||||
Result<String> result=carService.callVehicleClientClose(carVin);
|
||||
return result;
|
||||
}
|
||||
|
|
|
@ -1,13 +1,15 @@
|
|||
package com.muyu.system.controller;
|
||||
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.common.core.utils.ip.IpUtils;
|
||||
import lombok.extern.log4j.Log4j2;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.redis.connection.ReactiveSubscription;
|
||||
import org.springframework.data.redis.core.RedisTemplate;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.data.redis.core.SetOperations;
|
||||
import org.springframework.data.redis.core.ValueOperations;
|
||||
import org.springframework.data.redis.core.ZSetOperations;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.HashSet;
|
||||
|
|
|
@ -1,114 +0,0 @@
|
|||
package com.muyu.system.controller;
|
||||
|
||||
import java.util.List;
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.common.core.utils.poi.ExcelUtil;
|
||||
import com.muyu.common.core.web.page.TableDataInfo;
|
||||
import com.muyu.system.common.domain.EnterpriseInfo;
|
||||
import com.muyu.system.common.domain.SysDept;
|
||||
|
||||
import com.muyu.system.common.vo.BusinessVo;
|
||||
import com.muyu.system.service.ISysDeptService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.muyu.common.log.annotation.Log;
|
||||
import com.muyu.common.log.enums.BusinessType;
|
||||
import com.muyu.common.security.annotation.RequiresPermissions;
|
||||
|
||||
import com.muyu.system.service.IEnterpriseInfoService;
|
||||
import com.muyu.common.core.web.controller.BaseController;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
|
||||
/**
|
||||
* 企业管理Controller
|
||||
*
|
||||
* @author huangdaju
|
||||
* @Date 2024-03-28
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/info")
|
||||
public class EnterpriseInfoController extends BaseController{
|
||||
/**
|
||||
* 通过@Autowired注解自动注入IEnterpriseInfoService接口的实现,用于处理企业信息的服务。
|
||||
*/
|
||||
@Autowired
|
||||
private IEnterpriseInfoService enterpriseInfoService;
|
||||
@Autowired
|
||||
private ISysDeptService iSysDeptService;
|
||||
|
||||
/**
|
||||
* 查询企业管理列表
|
||||
*/
|
||||
@RequiresPermissions("system:info:list")
|
||||
@GetMapping("/list")
|
||||
public Result<TableDataInfo> list(BusinessVo businessVo) {
|
||||
startPage();
|
||||
List<BusinessVo> list = enterpriseInfoService.selectList(businessVo);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出企业管理列表
|
||||
*/
|
||||
@RequiresPermissions("system:info:export")
|
||||
@Log(title = "企业管理", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, SysDept sysDept) {
|
||||
List<SysDept> list = iSysDeptService.selectDeptList(sysDept);
|
||||
list.forEach(System.out::println);
|
||||
ExcelUtil<SysDept> util = new ExcelUtil<SysDept>(SysDept.class);
|
||||
util.exportExcel(response, list, "企业管理数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取企业管理详细信息 为外边提供接口
|
||||
*/
|
||||
@RequiresPermissions("system:info:query")
|
||||
@GetMapping(value = "/{deptId}")
|
||||
public Result getInfo(@PathVariable("deptId") Long deptId) {
|
||||
return success(enterpriseInfoService.selectEnterpriseInfoByEnterpriseId(deptId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改企业管理
|
||||
*/
|
||||
@RequiresPermissions("system:info:edit")
|
||||
@Log(title = "企业管理", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public Result edit(@RequestBody BusinessVo BusinessVo) {
|
||||
return toAjax(enterpriseInfoService.updateEnterpriseInfo(BusinessVo));
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增企业管理
|
||||
*/
|
||||
@RequiresPermissions("system:info:add")
|
||||
@Log(title = "企业管理", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public Result add(@RequestBody BusinessVo businessVo)
|
||||
{
|
||||
return toAjax(enterpriseInfoService.insertEnterpriseInfo(businessVo));
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除企业管理
|
||||
*/
|
||||
@RequiresPermissions("system:info:remove")
|
||||
@Log(title = "企业管理", businessType = BusinessType.DELETE)
|
||||
@PostMapping("/{deptId}")
|
||||
public Result remove(@PathVariable Long[] deptId) {
|
||||
|
||||
return toAjax(enterpriseInfoService.deleteEnterpriseInfoByDateIds(deptId));
|
||||
}
|
||||
}
|
|
@ -1,9 +1,13 @@
|
|||
package com.muyu.system.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.muyu.common.core.domain.PageResult;
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.system.common.domain.Car;
|
||||
import com.muyu.system.common.domain.CarInfo;
|
||||
import com.muyu.system.common.domain.Fence;
|
||||
import com.muyu.system.common.domain.req.CarInfoAddReq;
|
||||
import com.muyu.system.common.domain.vo.CarVo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
@ -16,8 +20,6 @@ import java.util.List;
|
|||
*/
|
||||
public interface CarMapper extends BaseMapper<Car>
|
||||
{
|
||||
|
||||
|
||||
/**
|
||||
* 查询车辆信息列表
|
||||
*
|
||||
|
@ -32,27 +34,28 @@ public interface CarMapper extends BaseMapper<Car>
|
|||
*/
|
||||
List<Fence> selectFence();
|
||||
|
||||
/**
|
||||
* 关闭车辆
|
||||
* @param carId
|
||||
* @return
|
||||
*/
|
||||
int updateStateClose(Integer carId);
|
||||
|
||||
/**
|
||||
* 开启车辆
|
||||
* @param carId
|
||||
* @return
|
||||
*/
|
||||
int updateStateOpen(Integer carId);
|
||||
|
||||
/**
|
||||
* 添加车辆日志表
|
||||
* @param carInfoAddReq
|
||||
*/
|
||||
void insertCarInfo(CarInfoAddReq carInfoAddReq);
|
||||
|
||||
/**
|
||||
* 车辆上线
|
||||
* @param carVin
|
||||
*/
|
||||
void updateVinOpen(String carVin);
|
||||
|
||||
/**
|
||||
* 车辆下线
|
||||
* @param carVin
|
||||
*/
|
||||
void updateVinClose(String carVin);
|
||||
|
||||
|
||||
/**
|
||||
* 根据VIN查询车辆
|
||||
* @param carVin
|
||||
* @return
|
||||
*/
|
||||
Car selectByVin(String carVin);
|
||||
}
|
||||
|
|
|
@ -1,26 +0,0 @@
|
|||
package com.muyu.system.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.muyu.system.common.domain.EnterpriseInfo;
|
||||
import com.muyu.system.common.domain.SysDept;
|
||||
import com.muyu.system.common.vo.BusinessVo;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 企业管理Mapper接口
|
||||
*
|
||||
* @author huangdaju
|
||||
* @date 2024-03-28
|
||||
*/
|
||||
public interface EnterpriseInfoMapper extends BaseMapper<BusinessVo>{
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -117,9 +117,4 @@ public interface SysDeptMapper
|
|||
* @return 结果
|
||||
*/
|
||||
public int deleteDeptById(Long deptId);
|
||||
|
||||
|
||||
String selectDept(Long deptId);
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,81 @@
|
|||
package com.muyu.system.mqtt;
|
||||
|
||||
import org.eclipse.paho.client.mqttv3.MqttException;
|
||||
import org.eclipse.paho.client.mqttv3.*;
|
||||
import org.eclipse.paho.client.mqttv3.persist.MemoryPersistence;
|
||||
|
||||
/**
|
||||
* 接收车联模拟数据
|
||||
* @ProjectName: cloud-vehicles
|
||||
* @PackageName: com.muyu.system.mqtt
|
||||
* @Description TODO
|
||||
* @Author XiaoFan
|
||||
* @Date 2024/3/31 19:49
|
||||
* @Version 1.0
|
||||
*/
|
||||
public class MqttSubscriber {
|
||||
public static void main(String[] args) {
|
||||
//MQTT服务器地址
|
||||
String broker="tcp://10.10.26.4:1883";
|
||||
//客户端ID,可根据实际情况自定义
|
||||
String clientId="mqttx_58b6074f";
|
||||
//订阅的主题
|
||||
String topic="test1";
|
||||
//消息服务质量
|
||||
int qos=2;
|
||||
//消息持久化方式,这里选择内存持久化
|
||||
MemoryPersistence persistence=new MemoryPersistence();
|
||||
|
||||
try {
|
||||
//创建MQTT客户端实例
|
||||
MqttClient sampleClient = new MqttClient(broker, clientId, persistence);
|
||||
//设置连接选项
|
||||
MqttConnectOptions connOpts = new MqttConnectOptions();
|
||||
connOpts.setCleanSession(true);
|
||||
//打印连接信息
|
||||
System.out.println("Connecting to broker:" +broker);
|
||||
//连接到MQTT代理
|
||||
sampleClient.connect(connOpts);
|
||||
//打印连接成功信息
|
||||
System.out.println("Connected");
|
||||
//打印订阅信息
|
||||
System.out.println("Subscribing to topic:" +topic);
|
||||
//订阅指定主题
|
||||
sampleClient.subscribe(topic,qos);
|
||||
|
||||
//设置消息到打的回调函数
|
||||
sampleClient.setCallback(new MqttCallback() {
|
||||
@Override
|
||||
public void connectionLost(Throwable throwable) {
|
||||
//连接丢失时的处理逻辑
|
||||
System.out.println("Connection lost!");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void messageArrived(String topic, MqttMessage message) throws Exception {
|
||||
//接收到消息时的处理逻辑
|
||||
System.out.println("Message received:"+new String(message.getPayload()));
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deliveryComplete(IMqttDeliveryToken iMqttDeliveryToken) {
|
||||
//消息发送完成后的处理逻辑
|
||||
}
|
||||
});
|
||||
|
||||
//循环等待接收消息
|
||||
while (true){
|
||||
Thread.sleep(1000);
|
||||
//每隔一秒检查一次是否有新消息
|
||||
}
|
||||
}catch (MqttException | InterruptedException me){
|
||||
// System.out.println("reason"+me.getReasonCode());
|
||||
System.out.println("msg"+me.getMessage());
|
||||
System.out.println("loc"+me.getLocalizedMessage());
|
||||
System.out.println("cause"+me.getCause());
|
||||
System.out.println("excep"+me);
|
||||
me.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -53,15 +53,18 @@ public interface CarService extends IService<Car>
|
|||
List<Fence> selectFence();
|
||||
|
||||
/**
|
||||
* 关闭车辆
|
||||
* 车辆上线
|
||||
* @param carVin
|
||||
* @return
|
||||
*/
|
||||
int updateStateClose(Integer carId);
|
||||
/**
|
||||
* 开启车辆
|
||||
*/
|
||||
int updateStateOpen(Integer carId);
|
||||
|
||||
Result<String> callVehicleClientInit(String carVin);
|
||||
|
||||
/**
|
||||
* 下线
|
||||
* @param carVin
|
||||
* @return
|
||||
*/
|
||||
Result<String> callVehicleClientClose(String carVin);
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -1,74 +0,0 @@
|
|||
package com.muyu.system.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.muyu.system.common.domain.EnterpriseInfo;
|
||||
import com.muyu.system.common.domain.SysDept;
|
||||
import com.muyu.system.common.vo.BusinessVo;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 企业管理Service接口
|
||||
*
|
||||
* @author huangdaju
|
||||
* @Date 2024-03-28
|
||||
*/
|
||||
public interface IEnterpriseInfoService extends IService<BusinessVo>
|
||||
{
|
||||
/**
|
||||
* 查询企业管理
|
||||
*
|
||||
* @param enterpriseId 企业管理主键
|
||||
* @return 企业管理
|
||||
*/
|
||||
public BusinessVo selectEnterpriseInfoByEnterpriseId(Long enterpriseId);
|
||||
|
||||
/**
|
||||
* 查询企业管理列表
|
||||
*
|
||||
* @param enterpriseInfo 企业管理
|
||||
* @return 企业管理集合
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* 新增企业管理
|
||||
*
|
||||
* @param businessVo 企业管理
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertEnterpriseInfo(BusinessVo businessVo);
|
||||
|
||||
/**
|
||||
* 修改企业管理
|
||||
*
|
||||
* @param businessVo 企业管理
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateEnterpriseInfo(BusinessVo businessVo);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 批量删除企业管理
|
||||
*
|
||||
* @param deptId 需要删除的企业管理主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteEnterpriseInfoByDateIds(Long[] deptId);
|
||||
|
||||
|
||||
/**
|
||||
* 根据传入的业务对象查询相关信息列表。
|
||||
* @param businessVo 业务对象,包含查询条件。
|
||||
* @return 返回业务信息列表。
|
||||
*/
|
||||
List<BusinessVo> selectList(BusinessVo businessVo);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -1,5 +1,8 @@
|
|||
package com.muyu.system.service.impl;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
|
@ -16,14 +19,11 @@ import com.muyu.system.common.domain.Fence;
|
|||
import com.muyu.system.common.domain.req.CarInfoAddReq;
|
||||
import com.muyu.system.common.domain.vo.CarVo;
|
||||
import com.muyu.system.mapper.CarMapper;
|
||||
import com.muyu.system.service.CarService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.web.client.RestTemplate;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import com.muyu.system.service.CarService;
|
||||
import org.springframework.web.client.RestTemplate;
|
||||
|
||||
/**
|
||||
* 车辆信息Service业务层处理
|
||||
|
@ -104,7 +104,6 @@ public class CarServiceImpl extends ServiceImpl<CarMapper,Car> implements CarSer
|
|||
car.setCreateTime(DateUtils.getNowDate());
|
||||
car.setState(1);
|
||||
car.setCarVin("vin"+ IdUtils.generateShortUUID());
|
||||
|
||||
//创建请求对象
|
||||
VehicleCreateAddReq vehicleCreateAddReq = new VehicleCreateAddReq();
|
||||
vehicleCreateAddReq.setVinStr(car.getCarVin());
|
||||
|
@ -158,49 +157,43 @@ public class CarServiceImpl extends ServiceImpl<CarMapper,Car> implements CarSer
|
|||
return carMapper.selectFence();
|
||||
}
|
||||
|
||||
/**
|
||||
* 关闭车辆
|
||||
* @param carId
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public int updateStateClose(Integer carId) {
|
||||
Car car = carMapper.selectById(carId);
|
||||
CarInfoAddReq carInfoAddReq = new CarInfoAddReq();
|
||||
carInfoAddReq.setCarVin(car.getCarVin());
|
||||
carInfoAddReq.setInfoCloseDate(new Date());
|
||||
carMapper.insertCarInfo(carInfoAddReq);
|
||||
return carMapper.updateStateClose(carId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 开启车辆
|
||||
* @param carId
|
||||
* 车辆上线
|
||||
* @param carVin
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public int updateStateOpen(Integer carId) {
|
||||
Car car = carMapper.selectById(carId);
|
||||
CarInfoAddReq carInfoAddReq = new CarInfoAddReq();
|
||||
carInfoAddReq.setCarVin(car.getCarVin());
|
||||
carInfoAddReq.setInfoOpenDate(new Date());
|
||||
carMapper.insertCarInfo(carInfoAddReq);
|
||||
return carMapper.updateStateOpen(carId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result<String> callVehicleClientInit(String carVin) {
|
||||
String url="http://127.0.0.1:81/vehicle/instance/client/init/"+carVin;
|
||||
Result<String> result=restTemplate.postForObject(url,null,Result.class);
|
||||
carMapper.updateVinOpen(carVin);
|
||||
Car car = carMapper.selectByVin(carVin);
|
||||
CarInfoAddReq carInfoAddReq = new CarInfoAddReq();
|
||||
carInfoAddReq.setVin(car.getCarVin());
|
||||
carInfoAddReq.setInfoOpenDate(new Date());
|
||||
carMapper.insertCarInfo(carInfoAddReq);
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 车辆下线
|
||||
* @param carVin
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Result<String> callVehicleClientClose(String carVin) {
|
||||
String url="http://127.0.0.1:81/vehicle/instance/client/close/" +carVin;
|
||||
Result<String> result=restTemplate.postForObject(url,null,Result.class);
|
||||
carMapper.updateVinClose(carVin);
|
||||
Car car = carMapper.selectByVin(carVin);
|
||||
CarInfoAddReq carInfoAddReq = new CarInfoAddReq();
|
||||
carInfoAddReq.setVin(car.getCarVin());
|
||||
carInfoAddReq.setInfoCloseDate(new Date());
|
||||
carMapper.insertCarInfo(carInfoAddReq);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -1,131 +0,0 @@
|
|||
package com.muyu.system.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.muyu.common.core.utils.DateUtils;
|
||||
import com.muyu.common.core.utils.StringUtils;
|
||||
import com.muyu.common.security.utils.SecurityUtils;
|
||||
import com.muyu.system.common.domain.EnterpriseInfo;
|
||||
import com.muyu.system.common.domain.SysDept;
|
||||
import com.muyu.system.common.vo.BusinessVo;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.muyu.system.mapper.EnterpriseInfoMapper;
|
||||
|
||||
import com.muyu.system.service.IEnterpriseInfoService;
|
||||
|
||||
/**
|
||||
* 企业管理Service业务层处理
|
||||
*
|
||||
* @author huangdaju
|
||||
* @date 2024-03-28
|
||||
*/
|
||||
@Service
|
||||
public class EnterpriseInfoServiceImpl extends ServiceImpl<EnterpriseInfoMapper, BusinessVo> implements IEnterpriseInfoService {
|
||||
|
||||
/**
|
||||
* 注入EnterpriseInfoMapper,用于操作企业信息的数据访问层。
|
||||
*/
|
||||
@Autowired
|
||||
private EnterpriseInfoMapper enterpriseInfoMapper;
|
||||
|
||||
|
||||
/**
|
||||
* 查询企业管理
|
||||
*
|
||||
* @param deptId 企业管理主键
|
||||
* @return 企业管理
|
||||
*/
|
||||
@Override
|
||||
public BusinessVo selectEnterpriseInfoByEnterpriseId(Long deptId){
|
||||
return enterpriseInfoMapper.selectById(deptId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询企业管理
|
||||
*
|
||||
* @param businessVo 企业管理列表
|
||||
* @return 企业管理列表
|
||||
*/
|
||||
@Override
|
||||
public List<BusinessVo> selectList(BusinessVo businessVo) {
|
||||
/**
|
||||
* 100L为 部门表公司数据
|
||||
*/
|
||||
businessVo.setParentId(100L);
|
||||
LambdaQueryWrapper<BusinessVo> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.like(StringUtils.isNotEmpty(businessVo.getDeptName()),BusinessVo::getDeptName,businessVo.getDeptName());
|
||||
queryWrapper.like(StringUtils.isNotEmpty(businessVo.getLeader()),BusinessVo::getLeader,businessVo.getLeader());
|
||||
queryWrapper.like(StringUtils.isNotEmpty(businessVo.getStatus()),BusinessVo::getStatus,businessVo.getStatus());
|
||||
queryWrapper.eq(StringUtils.isNotNull(businessVo.getParentId()),BusinessVo::getParentId,businessVo.getParentId());
|
||||
queryWrapper.eq(BusinessVo::getDelFlag,"0");
|
||||
return enterpriseInfoMapper.selectList(queryWrapper);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 新增企业管理
|
||||
*
|
||||
* @param businessVo 企业管理
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertEnterpriseInfo(BusinessVo businessVo)
|
||||
{
|
||||
// 添加条件
|
||||
// "logoType": "hdj",
|
||||
// "deptName": "黄大举有限公司",
|
||||
// "leader": "黄大举",
|
||||
// "phone": "15358324552",
|
||||
// "email": "87755"
|
||||
|
||||
//和公司同级别的权限
|
||||
businessVo.setAncestors("0,100");
|
||||
businessVo.setParentId(100L);
|
||||
|
||||
businessVo.setOrderNum(0);
|
||||
businessVo.setDelFlag("0");
|
||||
businessVo.setStatus("0");
|
||||
businessVo.setCreateTime(DateUtils.getNowDate());
|
||||
return enterpriseInfoMapper.insert(businessVo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改企业管理
|
||||
*
|
||||
* @param businessVo 企业管理
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateEnterpriseInfo(BusinessVo businessVo){
|
||||
businessVo.setUpdateTime(DateUtils.getNowDate());
|
||||
return enterpriseInfoMapper.updateById(businessVo);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 批量删除企业管理
|
||||
*
|
||||
* @param deptIds 需要删除的企业管理主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteEnterpriseInfoByDateIds(Long[] deptIds){
|
||||
|
||||
UpdateWrapper<BusinessVo> updateWrapper = new UpdateWrapper<>();
|
||||
updateWrapper.in("dept_id", deptIds);
|
||||
BusinessVo updateEntity = new BusinessVo();
|
||||
updateEntity.setDelFlag("2");
|
||||
return enterpriseInfoMapper.update(updateEntity, updateWrapper);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -46,18 +46,7 @@ public class SysDeptServiceImpl implements ISysDeptService
|
|||
@DataScope(deptAlias = "d")
|
||||
public List<SysDept> selectDeptList(SysDept dept)
|
||||
{
|
||||
//获取登录人信息
|
||||
Long deptId = SecurityUtils.getLoginUser().getSysUser().getDeptId();
|
||||
String logoType= deptMapper.selectDept(deptId);
|
||||
|
||||
if (!logoType.equals("ry")) {
|
||||
// dept.setLogoType(logoType);
|
||||
return deptMapper.selectDeptList(dept);
|
||||
}
|
||||
|
||||
List<SysDept> deptList = deptMapper.selectDeptList(dept);
|
||||
deptList.forEach(System.out::println);
|
||||
return deptList;
|
||||
return deptMapper.selectDeptList(dept);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -66,14 +66,8 @@ public class SysUserServiceImpl implements ISysUserService
|
|||
public List<SysUser> selectUserList(SysUser user)
|
||||
{
|
||||
//获取登录人信息
|
||||
SysUser sysUser = SecurityUtils.getLoginUser().getSysUser();
|
||||
Long userId = sysUser.getUserId();
|
||||
//判断用户是不是管理员
|
||||
log.info("userId:{}",userId);
|
||||
if (userId!=null && userId!=1){
|
||||
user.setDeptId(sysUser.getDeptId());
|
||||
return userMapper.selectUserList(user);
|
||||
}
|
||||
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||
|
||||
|
||||
return userMapper.selectUserList(user);
|
||||
}
|
||||
|
|
|
@ -24,11 +24,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
#{infoCloseDate}
|
||||
)
|
||||
</insert>
|
||||
<update id="updateStateClose">
|
||||
update car set state=1 where car_id=#{carId}
|
||||
<update id="updateVinOpen">
|
||||
update car set state=0 where car_vin=#{carVin}
|
||||
</update>
|
||||
<update id="updateStateOpen">
|
||||
update car set state=0 where car_id=#{carId}
|
||||
<update id="updateVinClose">
|
||||
update car set state=1 where car_vin=#{carVin}
|
||||
</update>
|
||||
<select id="selectCarList" resultType="com.muyu.system.common.domain.Car">
|
||||
<include refid="list"></include>
|
||||
|
@ -36,4 +36,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<select id="selectFence" resultType="com.muyu.system.common.domain.Fence">
|
||||
select fence_id,fence_name from fence
|
||||
</select>
|
||||
<select id="selectByVin" resultType="com.muyu.system.common.domain.Car">
|
||||
<include refid="list"></include>
|
||||
<where>
|
||||
car_vin=#{carVin}
|
||||
</where>
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
@ -1,101 +0,0 @@
|
|||
<?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.muyu.business.mapper.EnterpriseInfoMapper">
|
||||
|
||||
<resultMap type="EnterpriseInfo" id="EnterpriseInfoResult">
|
||||
<result property="enterpriseId" column="enterprise_id" />
|
||||
<result property="enterpriseName" column="enterprise_name" />
|
||||
<result property="contactPerson" column="contact_person" />
|
||||
<result property="contactEmail" column="contact_email" />
|
||||
<result property="userId" column="user_id" />
|
||||
<result property="enterpriseAddress" column="enterprise_address" />
|
||||
<result property="phoneNumber" column="phone_number" />
|
||||
<result property="industry" column="industry" />
|
||||
<result property="employeeCount" column="employee_count" />
|
||||
<result property="status" column="status" />
|
||||
<result property="identifier" column="identifier" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectEnterpriseInfoVo">
|
||||
select enterprise_id, enterprise_name, contact_person, contact_email, user_id, enterprise_address, phone_number, industry, employee_count, status, identifier from enterprise_info
|
||||
</sql>
|
||||
|
||||
<select id="selectEnterpriseInfoList" parameterType="EnterpriseInfo" resultMap="EnterpriseInfoResult">
|
||||
<include refid="selectEnterpriseInfoVo"/>
|
||||
<where>
|
||||
<if test="enterpriseName != null and enterpriseName != ''"> and enterprise_name like concat('%', #{enterpriseName}, '%')</if>
|
||||
<if test="contactPerson != null and contactPerson != ''"> and contact_person = #{contactPerson}</if>
|
||||
<if test="contactEmail != null and contactEmail != ''"> and contact_email = #{contactEmail}</if>
|
||||
<if test="userId != null "> and user_id = #{userId}</if>
|
||||
<if test="enterpriseAddress != null and enterpriseAddress != ''"> and enterprise_address = #{enterpriseAddress}</if>
|
||||
<if test="phoneNumber != null and phoneNumber != ''"> and phone_number = #{phoneNumber}</if>
|
||||
<if test="industry != null and industry != ''"> and industry = #{industry}</if>
|
||||
<if test="employeeCount != null "> and employee_count = #{employeeCount}</if>
|
||||
<if test="status != null and status != ''"> and status = #{status}</if>
|
||||
<if test="identifier != null and identifier != ''"> and identifier = #{identifier}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectEnterpriseInfoByEnterpriseId" parameterType="Long" resultMap="EnterpriseInfoResult">
|
||||
<include refid="selectEnterpriseInfoVo"/>
|
||||
where enterprise_id = #{enterpriseId}
|
||||
</select>
|
||||
|
||||
<insert id="insertEnterpriseInfo" parameterType="EnterpriseInfo" useGeneratedKeys="true" keyProperty="enterpriseId">
|
||||
insert into enterprise_info
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="enterpriseName != null">enterprise_name,</if>
|
||||
<if test="contactPerson != null">contact_person,</if>
|
||||
<if test="contactEmail != null">contact_email,</if>
|
||||
<if test="userId != null">user_id,</if>
|
||||
<if test="enterpriseAddress != null">enterprise_address,</if>
|
||||
<if test="phoneNumber != null">phone_number,</if>
|
||||
<if test="industry != null">industry,</if>
|
||||
<if test="employeeCount != null">employee_count,</if>
|
||||
<if test="status != null">status,</if>
|
||||
<if test="identifier != null">identifier,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="enterpriseName != null">#{enterpriseName},</if>
|
||||
<if test="contactPerson != null">#{contactPerson},</if>
|
||||
<if test="contactEmail != null">#{contactEmail},</if>
|
||||
<if test="userId != null">#{userId},</if>
|
||||
<if test="enterpriseAddress != null">#{enterpriseAddress},</if>
|
||||
<if test="phoneNumber != null">#{phoneNumber},</if>
|
||||
<if test="industry != null">#{industry},</if>
|
||||
<if test="employeeCount != null">#{employeeCount},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
<if test="identifier != null">#{identifier},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateEnterpriseInfo" parameterType="EnterpriseInfo">
|
||||
update enterprise_info
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="enterpriseName != null">enterprise_name = #{enterpriseName},</if>
|
||||
<if test="contactPerson != null">contact_person = #{contactPerson},</if>
|
||||
<if test="contactEmail != null">contact_email = #{contactEmail},</if>
|
||||
<if test="userId != null">user_id = #{userId},</if>
|
||||
<if test="enterpriseAddress != null">enterprise_address = #{enterpriseAddress},</if>
|
||||
<if test="phoneNumber != null">phone_number = #{phoneNumber},</if>
|
||||
<if test="industry != null">industry = #{industry},</if>
|
||||
<if test="employeeCount != null">employee_count = #{employeeCount},</if>
|
||||
<if test="status != null">status = #{status},</if>
|
||||
<if test="identifier != null">identifier = #{identifier},</if>
|
||||
</trim>
|
||||
where enterprise_id = #{enterpriseId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteEnterpriseInfoByEnterpriseId" parameterType="Long">
|
||||
delete from enterprise_info where enterprise_id = #{enterpriseId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteEnterpriseInfoByEnterpriseIds" parameterType="String">
|
||||
delete from enterprise_info where enterprise_id in
|
||||
<foreach item="enterpriseId" collection="array" open="(" separator="," close=")">
|
||||
#{enterpriseId}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
|
@ -33,12 +33,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</where>
|
||||
</sql>
|
||||
|
||||
<select id="selectConfig" parameterType="SysConfig" resultMap="SysConfigResult">
|
||||
<select id="selectConfig" parameterType="com.muyu.system.common.domain.SysConfig" resultMap="SysConfigResult">
|
||||
<include refid="selectConfigVo"/>
|
||||
<include refid="sqlwhereSearch"/>
|
||||
</select>
|
||||
|
||||
<select id="selectConfigList" parameterType="SysConfig" resultMap="SysConfigResult">
|
||||
<select id="selectConfigList" parameterType="com.muyu.system.common.domain.SysConfig" resultMap="SysConfigResult">
|
||||
<include refid="selectConfigVo"/>
|
||||
<where>
|
||||
<if test="configName != null and configName != ''">
|
||||
|
@ -69,7 +69,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
where config_key = #{configKey} limit 1
|
||||
</select>
|
||||
|
||||
<insert id="insertConfig" parameterType="SysConfig">
|
||||
<insert id="insertConfig" parameterType="com.muyu.system.common.domain.SysConfig">
|
||||
insert into sys_config (
|
||||
<if test="configName != null and configName != '' ">config_name,</if>
|
||||
<if test="configKey != null and configKey != '' ">config_key,</if>
|
||||
|
@ -89,7 +89,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
)
|
||||
</insert>
|
||||
|
||||
<update id="updateConfig" parameterType="SysConfig">
|
||||
<update id="updateConfig" parameterType="com.muyu.system.common.domain.SysConfig">
|
||||
update sys_config
|
||||
<set>
|
||||
<if test="configName != null and configName != ''">config_name = #{configName},</if>
|
||||
|
|
|
@ -4,7 +4,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.muyu.system.mapper.SysDeptMapper">
|
||||
|
||||
<resultMap type="SysDept" id="SysDeptResult">
|
||||
<resultMap type="com.muyu.system.common.domain.SysDept" id="SysDeptResult">
|
||||
<id property="deptId" column="dept_id" />
|
||||
<result property="parentId" column="parent_id" />
|
||||
<result property="ancestors" column="ancestors" />
|
||||
|
@ -27,7 +27,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
from sys_dept d
|
||||
</sql>
|
||||
|
||||
<select id="selectDeptList" parameterType="SysDept" resultMap="SysDeptResult">
|
||||
<select id="selectDeptList" parameterType="com.muyu.system.common.domain.SysDept" resultMap="SysDeptResult">
|
||||
<include refid="selectDeptVo"/>
|
||||
where d.del_flag = '0'
|
||||
<if test="deptId != null and deptId != 0">
|
||||
|
@ -42,12 +42,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="status != null and status != ''">
|
||||
AND status = #{status}
|
||||
</if>
|
||||
<if test="logoType != null and logoType != ''">
|
||||
AND logo_type = #{logoType}
|
||||
</if>
|
||||
<!-- 数据范围过滤 -->
|
||||
${params.dataScope}
|
||||
|
||||
order by d.parent_id, d.order_num
|
||||
</select>
|
||||
|
||||
|
@ -88,12 +84,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<include refid="selectDeptVo"/>
|
||||
where dept_name=#{deptName} and parent_id = #{parentId} and del_flag = '0' limit 1
|
||||
</select>
|
||||
<select id="selectDept" resultType="java.lang.String">
|
||||
select logo_type from sys_dept where dept_id = #{deptId}
|
||||
</select>
|
||||
|
||||
|
||||
<insert id="insertDept" parameterType="SysDept">
|
||||
<insert id="insertDept" parameterType="com.muyu.system.common.domain.SysDept">
|
||||
insert into sys_dept(
|
||||
<if test="deptId != null and deptId != 0">dept_id,</if>
|
||||
<if test="parentId != null and parentId != 0">parent_id,</if>
|
||||
|
@ -121,7 +113,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
)
|
||||
</insert>
|
||||
|
||||
<update id="updateDept" parameterType="SysDept">
|
||||
<update id="updateDept" parameterType="com.muyu.system.common.domain.SysDept">
|
||||
update sys_dept
|
||||
<set>
|
||||
<if test="parentId != null and parentId != 0">parent_id = #{parentId},</if>
|
||||
|
|
|
@ -25,7 +25,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
from sys_dict_data
|
||||
</sql>
|
||||
|
||||
<select id="selectDictDataList" parameterType="SysDictData" resultMap="SysDictDataResult">
|
||||
<select id="selectDictDataList" parameterType="com.muyu.system.common.domain.SysDictData" resultMap="SysDictDataResult">
|
||||
<include refid="selectDictDataVo"/>
|
||||
<where>
|
||||
<if test="dictType != null and dictType != ''">
|
||||
|
@ -41,7 +41,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
order by dict_sort asc
|
||||
</select>
|
||||
|
||||
<select id="selectDictDataByType" parameterType="SysDictData" resultMap="SysDictDataResult">
|
||||
<select id="selectDictDataByType" parameterType="com.muyu.system.common.domain.SysDictData" resultMap="SysDictDataResult">
|
||||
<include refid="selectDictDataVo"/>
|
||||
where status = '0' and dict_type = #{dictType} order by dict_sort asc
|
||||
</select>
|
||||
|
@ -71,7 +71,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</foreach>
|
||||
</delete>
|
||||
|
||||
<update id="updateDictData" parameterType="SysDictData">
|
||||
<update id="updateDictData" parameterType="com.muyu.system.common.domain.SysDictData">
|
||||
update sys_dict_data
|
||||
<set>
|
||||
<if test="dictSort != null">dict_sort = #{dictSort},</if>
|
||||
|
@ -93,7 +93,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
update sys_dict_data set dict_type = #{newDictType} where dict_type = #{oldDictType}
|
||||
</update>
|
||||
|
||||
<insert id="insertDictData" parameterType="SysDictData">
|
||||
<insert id="insertDictData" parameterType="com.muyu.system.common.domain.SysDictData">
|
||||
insert into sys_dict_data(
|
||||
<if test="dictSort != null">dict_sort,</if>
|
||||
<if test="dictLabel != null and dictLabel != ''">dict_label,</if>
|
||||
|
|
|
@ -20,7 +20,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
from sys_dict_type
|
||||
</sql>
|
||||
|
||||
<select id="selectDictTypeList" parameterType="SysDictType" resultMap="SysDictTypeResult">
|
||||
<select id="selectDictTypeList" parameterType="com.muyu.system.common.domain.SysDictType" resultMap="SysDictTypeResult">
|
||||
<include refid="selectDictTypeVo"/>
|
||||
<where>
|
||||
<if test="dictName != null and dictName != ''">
|
||||
|
@ -71,7 +71,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</foreach>
|
||||
</delete>
|
||||
|
||||
<update id="updateDictType" parameterType="SysDictType">
|
||||
<update id="updateDictType" parameterType="com.muyu.system.common.domain.SysDictType">
|
||||
update sys_dict_type
|
||||
<set>
|
||||
<if test="dictName != null and dictName != ''">dict_name = #{dictName},</if>
|
||||
|
@ -84,7 +84,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
where dict_id = #{dictId}
|
||||
</update>
|
||||
|
||||
<insert id="insertDictType" parameterType="SysDictType">
|
||||
<insert id="insertDictType" parameterType="com.muyu.system.common.domain.SysDictType">
|
||||
insert into sys_dict_type(
|
||||
<if test="dictName != null and dictName != ''">dict_name,</if>
|
||||
<if test="dictType != null and dictType != ''">dict_type,</if>
|
||||
|
|
|
@ -13,12 +13,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<result property="accessTime" column="access_time" />
|
||||
</resultMap>
|
||||
|
||||
<insert id="insertLogininfor" parameterType="SysLogininfor">
|
||||
<insert id="insertLogininfor" parameterType="com.muyu.system.common.domain.SysLogininfor">
|
||||
insert into sys_logininfor (user_name, status, ipaddr, msg, access_time)
|
||||
values (#{userName}, #{status}, #{ipaddr}, #{msg}, sysdate())
|
||||
</insert>
|
||||
|
||||
<select id="selectLogininforList" parameterType="SysLogininfor" resultMap="SysLogininforResult">
|
||||
<select id="selectLogininforList" parameterType="com.muyu.system.common.domain.SysLogininfor" resultMap="SysLogininforResult">
|
||||
select info_id, user_name, ipaddr, status, msg, access_time from sys_logininfor
|
||||
<where>
|
||||
<if test="ipaddr != null and ipaddr != ''">
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
from sys_menu
|
||||
</sql>
|
||||
|
||||
<select id="selectMenuList" parameterType="SysMenu" resultMap="SysMenuResult">
|
||||
<select id="selectMenuList" parameterType="com.muyu.system.common.domain.SysMenu" resultMap="SysMenuResult">
|
||||
<include refid="selectMenuVo"/>
|
||||
<where>
|
||||
<if test="menuName != null and menuName != ''">
|
||||
|
@ -54,7 +54,7 @@
|
|||
order by m.parent_id, m.order_num
|
||||
</select>
|
||||
|
||||
<select id="selectMenuListByUserId" parameterType="SysMenu" resultMap="SysMenuResult">
|
||||
<select id="selectMenuListByUserId" parameterType="com.muyu.system.common.domain.SysMenu" resultMap="SysMenuResult">
|
||||
select distinct m.menu_id, m.parent_id, m.menu_name, m.path, m.component, m.`query`, m.visible, m.status, ifnull(m.perms,'') as perms, m.is_frame, m.is_cache, m.menu_type, m.icon, m.order_num, m.create_time
|
||||
from sys_menu m
|
||||
left join sys_role_menu rm on m.menu_id = rm.menu_id
|
||||
|
@ -127,12 +127,12 @@
|
|||
select count(1) from sys_menu where parent_id = #{menuId}
|
||||
</select>
|
||||
|
||||
<select id="checkMenuNameUnique" parameterType="SysMenu" resultMap="SysMenuResult">
|
||||
<select id="checkMenuNameUnique" parameterType="com.muyu.system.common.domain.SysMenu" resultMap="SysMenuResult">
|
||||
<include refid="selectMenuVo"/>
|
||||
where menu_name=#{menuName} and parent_id = #{parentId} limit 1
|
||||
</select>
|
||||
|
||||
<update id="updateMenu" parameterType="SysMenu">
|
||||
<update id="updateMenu" parameterType="com.muyu.system.common.domain.SysMenu">
|
||||
update sys_menu
|
||||
<set>
|
||||
<if test="menuName != null and menuName != ''">menu_name = #{menuName},</if>
|
||||
|
@ -155,7 +155,7 @@
|
|||
where menu_id = #{menuId}
|
||||
</update>
|
||||
|
||||
<insert id="insertMenu" parameterType="SysMenu">
|
||||
<insert id="insertMenu" parameterType="com.muyu.system.common.domain.SysMenu">
|
||||
insert into sys_menu(
|
||||
<if test="menuId != null and menuId != 0">menu_id,</if>
|
||||
<if test="parentId != null and parentId != 0">parent_id,</if>
|
||||
|
|
|
@ -27,7 +27,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
where notice_id = #{noticeId}
|
||||
</select>
|
||||
|
||||
<select id="selectNoticeList" parameterType="SysNotice" resultMap="SysNoticeResult">
|
||||
<select id="selectNoticeList" parameterType="com.muyu.system.common.domain.SysNotice" resultMap="SysNoticeResult">
|
||||
<include refid="selectNoticeVo"/>
|
||||
<where>
|
||||
<if test="noticeTitle != null and noticeTitle != ''">
|
||||
|
@ -42,7 +42,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</where>
|
||||
</select>
|
||||
|
||||
<insert id="insertNotice" parameterType="SysNotice">
|
||||
<insert id="insertNotice" parameterType="com.muyu.system.common.domain.SysNotice">
|
||||
insert into sys_notice (
|
||||
<if test="noticeTitle != null and noticeTitle != '' ">notice_title, </if>
|
||||
<if test="noticeType != null and noticeType != '' ">notice_type, </if>
|
||||
|
@ -62,7 +62,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
)
|
||||
</insert>
|
||||
|
||||
<update id="updateNotice" parameterType="SysNotice">
|
||||
<update id="updateNotice" parameterType="com.muyu.system.common.domain.SysNotice">
|
||||
update sys_notice
|
||||
<set>
|
||||
<if test="noticeTitle != null and noticeTitle != ''">notice_title = #{noticeTitle}, </if>
|
||||
|
|
|
@ -28,12 +28,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
from sys_oper_log
|
||||
</sql>
|
||||
|
||||
<insert id="insertOperlog" parameterType="SysOperLog">
|
||||
<insert id="insertOperlog" parameterType="com.muyu.system.common.domain.SysOperLog">
|
||||
insert into sys_oper_log(title, business_type, method, request_method, operator_type, oper_name, dept_name, oper_url, oper_ip, oper_param, json_result, status, error_msg, cost_time, oper_time)
|
||||
values (#{title}, #{businessType}, #{method}, #{requestMethod}, #{operatorType}, #{operName}, #{deptName}, #{operUrl}, #{operIp}, #{operParam}, #{jsonResult}, #{status}, #{errorMsg}, #{costTime}, sysdate())
|
||||
</insert>
|
||||
|
||||
<select id="selectOperLogList" parameterType="SysOperLog" resultMap="SysOperLogResult">
|
||||
<select id="selectOperLogList" parameterType="com.muyu.system.common.domain.SysOperLog" resultMap="SysOperLogResult">
|
||||
<include refid="selectOperLogVo"/>
|
||||
<where>
|
||||
<if test="operIp != null and operIp != ''">
|
||||
|
|
|
@ -22,7 +22,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
from sys_post
|
||||
</sql>
|
||||
|
||||
<select id="selectPostList" parameterType="SysPost" resultMap="SysPostResult">
|
||||
<select id="selectPostList" parameterType="com.muyu.system.common.domain.SysPost" resultMap="SysPostResult">
|
||||
<include refid="selectPostVo"/>
|
||||
<where>
|
||||
<if test="postCode != null and postCode != ''">
|
||||
|
@ -72,7 +72,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
where post_code=#{postCode} limit 1
|
||||
</select>
|
||||
|
||||
<update id="updatePost" parameterType="SysPost">
|
||||
<update id="updatePost" parameterType="com.muyu.system.common.domain.SysPost">
|
||||
update sys_post
|
||||
<set>
|
||||
<if test="postCode != null and postCode != ''">post_code = #{postCode},</if>
|
||||
|
@ -86,7 +86,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
where post_id = #{postId}
|
||||
</update>
|
||||
|
||||
<insert id="insertPost" parameterType="SysPost" useGeneratedKeys="true" keyProperty="postId">
|
||||
<insert id="insertPost" parameterType="com.muyu.system.common.domain.SysPost" useGeneratedKeys="true" keyProperty="postId">
|
||||
insert into sys_post(
|
||||
<if test="postId != null and postId != 0">post_id,</if>
|
||||
<if test="postCode != null and postCode != ''">post_code,</if>
|
||||
|
|
|
@ -30,7 +30,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
left join sys_dept d on u.dept_id = d.dept_id
|
||||
</sql>
|
||||
|
||||
<select id="selectRoleList" parameterType="SysRole" resultMap="SysRoleResult">
|
||||
<select id="selectRoleList" parameterType="com.muyu.system.common.domain.SysRole" resultMap="SysRoleResult">
|
||||
<include refid="selectRoleVo"/>
|
||||
where r.del_flag = '0'
|
||||
<if test="roleId != null and roleId != 0">
|
||||
|
@ -93,7 +93,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
where r.role_key=#{roleKey} and r.del_flag = '0' limit 1
|
||||
</select>
|
||||
|
||||
<insert id="insertRole" parameterType="SysRole" useGeneratedKeys="true" keyProperty="roleId">
|
||||
<insert id="insertRole" parameterType="com.muyu.system.common.domain.SysRole" useGeneratedKeys="true" keyProperty="roleId">
|
||||
insert into sys_role(
|
||||
<if test="roleId != null and roleId != 0">role_id,</if>
|
||||
<if test="roleName != null and roleName != ''">role_name,</if>
|
||||
|
@ -121,7 +121,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
)
|
||||
</insert>
|
||||
|
||||
<update id="updateRole" parameterType="SysRole">
|
||||
<update id="updateRole" parameterType="com.muyu.system.common.domain.SysRole">
|
||||
update sys_role
|
||||
<set>
|
||||
<if test="roleName != null and roleName != ''">role_name = #{roleName},</if>
|
||||
|
|
|
@ -56,11 +56,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
left join sys_role r on r.role_id = ur.role_id
|
||||
</sql>
|
||||
|
||||
<select id="selectUserList" parameterType="SysUser" resultMap="SysUserResult">
|
||||
<select id="selectUserList" parameterType="com.muyu.system.common.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="userId != null and userId != 0">
|
||||
AND u.user_id = #{userId}
|
||||
</if>
|
||||
<if test="userName != null and userName != ''">
|
||||
AND u.user_name like concat('%', #{userName}, '%')
|
||||
</if>
|
||||
|
@ -83,13 +85,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
${params.dataScope}
|
||||
</select>
|
||||
|
||||
<select id="selectAllocatedList" parameterType="SysUser" resultMap="SysUserResult">
|
||||
<select id="selectAllocatedList" parameterType="com.muyu.system.common.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} and
|
||||
where u.del_flag = '0' and r.role_id = #{roleId}
|
||||
<if test="userName != null and userName != ''">
|
||||
AND u.user_name like concat('%', #{userName}, '%')
|
||||
</if>
|
||||
|
@ -100,7 +102,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
${params.dataScope}
|
||||
</select>
|
||||
|
||||
<select id="selectUnallocatedList" parameterType="SysUser" resultMap="SysUserResult">
|
||||
<select id="selectUnallocatedList" parameterType="com.muyu.system.common.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
|
||||
|
@ -140,7 +142,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
select user_id, email from sys_user where email = #{email} and del_flag = '0' limit 1
|
||||
</select>
|
||||
|
||||
<insert id="insertUser" parameterType="SysUser" useGeneratedKeys="true" keyProperty="userId">
|
||||
<insert id="insertUser" parameterType="com.muyu.system.common.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>
|
||||
|
@ -172,7 +174,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
)
|
||||
</insert>
|
||||
|
||||
<update id="updateUser" parameterType="SysUser">
|
||||
<update id="updateUser" parameterType="com.muyu.system.common.domain.SysUser">
|
||||
update sys_user
|
||||
<set>
|
||||
<if test="deptId != null and deptId != 0">dept_id = #{deptId},</if>
|
||||
|
@ -193,15 +195,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
where user_id = #{userId}
|
||||
</update>
|
||||
|
||||
<update id="updateUserStatus" parameterType="SysUser">
|
||||
<update id="updateUserStatus" parameterType="com.muyu.system.common.domain.SysUser">
|
||||
update sys_user set status = #{status} where user_id = #{userId}
|
||||
</update>
|
||||
|
||||
<update id="updateUserAvatar" parameterType="SysUser">
|
||||
<update id="updateUserAvatar" parameterType="com.muyu.system.common.domain.SysUser">
|
||||
update sys_user set avatar = #{avatar} where user_name = #{userName}
|
||||
</update>
|
||||
|
||||
<update id="resetUserPwd" parameterType="SysUser">
|
||||
<update id="resetUserPwd" parameterType="com.muyu.system.common.domain.SysUser">
|
||||
update sys_user set password = #{password} where user_name = #{userName}
|
||||
</update>
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</foreach>
|
||||
</insert>
|
||||
|
||||
<delete id="deleteUserRoleInfo" parameterType="SysUserRole">
|
||||
<delete id="deleteUserRoleInfo" parameterType="com.muyu.system.common.domain.SysUserRole">
|
||||
delete from sys_user_role where user_id=#{userId} and role_id=#{roleId}
|
||||
</delete>
|
||||
|
||||
|
|
Loading…
Reference in New Issue