Commit 042f76f6 by 杨林龙

新E盾 1.30 版本开发 修改试驾车辆统计方法

1 parent 2bb49cca
......@@ -59,6 +59,16 @@ public final class ConstantsDevice {
public static final int TRIAL_DEVICE_TYPE = 1;
/**
* 历史试驾类型 0:曾经不是试驾设备
*/
public static final int HIS_NOT_TRIAL_DEVICE_TYPE = 0;
/**
* 历史试驾类型 1:曾经是试驾设备
*/
public static final int HIS_TRIAL_DEVICE_TYPE = 1;
/**
* 删除标记 0=正常 -1=删除
*/
public static final int NOT_DEL_FLAG = 0;
......
......@@ -34,4 +34,10 @@ public class VehicleDevice extends BaseEntity {
*/
@Column(name = "trial_type")
private Integer trialType;
/**
* 历史试驾类型 0:曾经不是试驾设备; 1:曾经是试驾设备
*/
@Column(name = "his_type")
private Integer hisType;
}
\ No newline at end of file
......@@ -1445,6 +1445,8 @@ public class VehicleService {
if (vehicleDevice != null) {
log.info("修改设备为试驾设备===" + testVehicleBo.getSn());
vehicleDevice.setTrialType(ConstantsDevice.TRIAL_DEVICE_TYPE);
// 存入历史试驾设备类型 20201121
vehicleDevice.setHisType(ConstantsDevice.HIS_TRIAL_DEVICE_TYPE);
vehicleDevice.setUpdatedDate(new Date());
vehicleDevice.setUpdatedBy(ShieldContextHolder.getUserId());
vehicleDeviceService.updateByPrimaryKey(vehicleDevice);
......@@ -1615,10 +1617,9 @@ public class VehicleService {
trialDriveVehicleMapper.logicDeleteByVehicleId(vehicleDevice.getVehicleId());
}
// 保留设备删除之前的设备试驾和绑定关系
vehicleDevice.setUpdatedDate(new Date());
vehicleDevice.setUpdatedBy(ShieldContextHolder.getUserId());
vehicleDevice.setBindStatus(ConstantsDevice.UN_BIND_VEHICLE_STATUS);
vehicleDevice.setTrialType(ConstantsDevice.NOT_TRIAL_DEVICE_TYPE);
vehicleDevice.setDelFlag(Constants.DELETE_FLAG);
vehicleDeviceService.updateByPrimaryKey(vehicleDevice);
......
......@@ -43,16 +43,12 @@
GROUP_CONCAT(td.sn) as sn,
tv.created_by as createdBy
FROM t_vehicle tv
inner join t_trial_drive_vehicle ttdv on ttdv.vehicle_id = tv.id
LEFT JOIN t_vehicle_device tvd on tvd.vehicle_id = tv.id
LEFT JOIN t_device td on td.sn = tvd.sn
LEFT JOIN t_user tu ON tu.id = tv.created_by
WHERE tu.del_flag = 0
AND tv.del_flag = 0
AND ttdv.del_flag = 0
AND tvd.bind_status = 1
AND tvd.trial_type = 1
AND tvd.del_flag = 0
AND tvd.his_type = 1
AND td.del_flag = 0
<if test="keywords != null and keywords!='' ">
and (
......
......@@ -42,16 +42,12 @@
GROUP_CONCAT(td.sn) as sn,
tv.created_by as createdBy
FROM t_vehicle tv
inner join t_trial_drive_vehicle ttdv on ttdv.vehicle_id = tv.id
LEFT JOIN t_vehicle_device tvd on tvd.vehicle_id = tv.id
LEFT JOIN t_device td on td.sn = tvd.sn
LEFT JOIN t_user tu ON tu.id = tv.created_by
WHERE tu.del_flag = 0
AND tv.del_flag = 0
AND ttdv.del_flag = 0
AND tvd.bind_status = 1
AND tvd.trial_type = 1
AND tvd.del_flag = 0
AND tvd.his_type = 1
AND td.del_flag = 0
<if test="keywords != null and keywords!='' ">
and (
......
......@@ -35,16 +35,12 @@
GROUP_CONCAT(td.sn) as sn,
tv.created_by as createdBy
FROM t_vehicle tv
inner join t_trial_drive_vehicle ttdv on ttdv.vehicle_id = tv.id
LEFT JOIN t_vehicle_device tvd on tvd.vehicle_id = tv.id
LEFT JOIN t_device td on td.sn = tvd.sn
LEFT JOIN t_user tu ON tu.id = tv.created_by
WHERE tu.del_flag = 0
AND tv.del_flag = 0
AND ttdv.del_flag = 0
AND tvd.bind_status = 1
AND tvd.trial_type = 1
AND tvd.del_flag = 0
AND tvd.his_type = 1
AND td.del_flag = 0
<if test="keywords != null and keywords!='' ">
and (
......
......@@ -11,6 +11,7 @@
<result column="bind_status" jdbcType="TINYINT" property="bindStatus"/>
<result column="del_flag" jdbcType="TINYINT" property="delFlag"/>
<result column="trial_type" jdbcType="TINYINT" property="trialType"/>
<result column="his_type" jdbcType="TINYINT" property="hisType"/>
<result column="created_date" jdbcType="TIMESTAMP" property="createdDate"/>
<result column="created_by" jdbcType="INTEGER" property="createdBy"/>
<result column="updated_date" jdbcType="TIMESTAMP" property="updatedDate"/>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!