diff --git a/eride-admin/src/main/java/com/ruoyi/web/controller/app/AppVerifyController.java b/eride-admin/src/main/java/com/ruoyi/web/controller/app/AppVerifyController.java index 440f16b..7d4633c 100644 --- a/eride-admin/src/main/java/com/ruoyi/web/controller/app/AppVerifyController.java +++ b/eride-admin/src/main/java/com/ruoyi/web/controller/app/AppVerifyController.java @@ -54,6 +54,7 @@ import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; import java.math.BigDecimal; +import java.util.ArrayList; import java.util.List; import static com.ruoyi.common.constant.ServiceConstants.USER_TYPE_INDIVIDUAL; @@ -741,6 +742,15 @@ public class AppVerifyController extends BaseController return toAjax(shareKeyService.insertEShareKey(eShareKey)); } + /** + * 获取共享钥匙详细信息 + */ + @GetMapping(value = "/key/{keyId}") + public AjaxResult getKeyInfo(@PathVariable("keyId") Long keyId) + { + return success(shareKeyService.selectEShareKeyByKeyId(keyId)); + } + private boolean assign(EShareKey eShareKey) { EUserVO eUserVO = userService.selectUserByUserName(eShareKey.getSharePhone()); if(eUserVO == null){ @@ -829,9 +839,22 @@ public class AppVerifyController extends BaseController deviceQuery.setUserId(getUserId()); deviceQuery.setKeywords(keywords); List list = deviceService.selectEDeviceListWithIsolate(deviceQuery); + // 拼接分享的车辆 + if(list.isEmpty()){ + list = new ArrayList<>(); + } + assembleShareDevice(list,userVO); return success(list); } + private void assembleShareDevice(List list,EUserVO userVO) { + List sns = shareKeyService.selectEShareSnListByShareUserId(userVO.getUserId()); + if(!sns.isEmpty()){ + List devices = deviceService.selectBySns(sns); + list.addAll(devices); + } + } + /** * 管理员提现 */ diff --git a/eride-admin/src/main/java/com/ruoyi/web/controller/system/EDeviceController.java b/eride-admin/src/main/java/com/ruoyi/web/controller/system/EDeviceController.java index 9cf53bf..326d1d3 100644 --- a/eride-admin/src/main/java/com/ruoyi/web/controller/system/EDeviceController.java +++ b/eride-admin/src/main/java/com/ruoyi/web/controller/system/EDeviceController.java @@ -168,16 +168,16 @@ public class EDeviceController extends BaseController // return toAjax(eDeviceService.oneClickWarehousing(deviceIds)); // } // -// /** -// * 更新设备 -// */ -// @PreAuthorize("@ss.hasPermi('system:device:refresh')") -// @Log(title = "更新设备", businessType = BusinessType.REFRESH) -// @PostMapping("/refreshDevice/{deviceIds}") -// public AjaxResult refreshDevice(@PathVariable Long[] deviceIds) -// { -// return toAjax(eDeviceService.refreshDevice(deviceIds)); -// } + /** + * 更新设备 + */ + @PreAuthorize("@ss.hasPermi('system:device:refresh')") + @Log(title = "更新设备", businessType = BusinessType.REFRESH) + @PostMapping("/refreshDevice/{deviceIds}") + public AjaxResult refreshDevice(@PathVariable Long[] deviceIds) + { + return toAjax(eDeviceService.refreshDevice(deviceIds)); + } /** * 响铃寻车 diff --git a/eride-common/src/main/java/com/ruoyi/common/utils/onenet/LocationVo.java b/eride-common/src/main/java/com/ruoyi/common/utils/onenet/LocationVo.java new file mode 100644 index 0000000..91d3d40 --- /dev/null +++ b/eride-common/src/main/java/com/ruoyi/common/utils/onenet/LocationVo.java @@ -0,0 +1,21 @@ +package com.ruoyi.common.utils.onenet; + +import lombok.Data; + +@Data +public class LocationVo { + + private String lon;//经度 + + private String lat;//纬度 + + private Integer status;//电动车状态 0断电,1上电运行 2轮动抱死 3超出区域断电(远程下发了qlose) 解析参数 + + private Integer bat;//电池电压 "bat":571 ==> 57.1V + + private Integer csq;//信号强度 + + private Integer s;//卫星数量 + + private Integer q;//质量 +} diff --git a/eride-system/src/main/java/com/ruoyi/system/domain/EShareKey.java b/eride-system/src/main/java/com/ruoyi/system/domain/EShareKey.java index af611fc..f3be24e 100644 --- a/eride-system/src/main/java/com/ruoyi/system/domain/EShareKey.java +++ b/eride-system/src/main/java/com/ruoyi/system/domain/EShareKey.java @@ -61,9 +61,12 @@ public class EShareKey extends BaseEntity /** 有效时间 */ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - @Excel(name = "有效时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") private Date expirationTime; + /** 创建时间 */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date createTime; + /** 删除标志(0代表存在 2代表删除) */ private String delFlag; diff --git a/eride-system/src/main/java/com/ruoyi/system/mapper/EDeviceMapper.java b/eride-system/src/main/java/com/ruoyi/system/mapper/EDeviceMapper.java index 6ea3e6b..7222f70 100644 --- a/eride-system/src/main/java/com/ruoyi/system/mapper/EDeviceMapper.java +++ b/eride-system/src/main/java/com/ruoyi/system/mapper/EDeviceMapper.java @@ -193,4 +193,9 @@ public interface EDeviceMapper extends BaseMapper * 根据店铺id查询所有车辆数 */ Integer selectAllDeviceCountByStoreId(Long storeId); + + /** + * 根据sn数组查询车辆数 + */ + List selectBySns(@Param("sns") List sns); } diff --git a/eride-system/src/main/java/com/ruoyi/system/mapper/EShareKeyMapper.java b/eride-system/src/main/java/com/ruoyi/system/mapper/EShareKeyMapper.java index 31511fc..8f65e60 100644 --- a/eride-system/src/main/java/com/ruoyi/system/mapper/EShareKeyMapper.java +++ b/eride-system/src/main/java/com/ruoyi/system/mapper/EShareKeyMapper.java @@ -85,4 +85,14 @@ public interface EShareKeyMapper * @return 共享钥匙集合 */ List selectEShareKeyListByShareUserId(Long shareUserId); + + /** + * 根据分享用户id查询未过期车辆sn + */ + List selectEShareSnListByShareUserId(Long shareUserId); + + /** + * 查询已过期但改变状态的共享钥匙列表 + */ + List selectExpiredShareKeyList(); } diff --git a/eride-system/src/main/java/com/ruoyi/system/mapper/EUserWithdrawMapper.java b/eride-system/src/main/java/com/ruoyi/system/mapper/EUserWithdrawMapper.java index 6857aff..eec263d 100644 --- a/eride-system/src/main/java/com/ruoyi/system/mapper/EUserWithdrawMapper.java +++ b/eride-system/src/main/java/com/ruoyi/system/mapper/EUserWithdrawMapper.java @@ -67,4 +67,12 @@ public interface EUserWithdrawMapper * @return 用户提现渠道集合 */ List selectRlUserWithdrawListByUserId(Long userId); + + /** + * 根据userId删除用户提现渠道信息 + * + * @param userId 用户id + * @return 结果 + */ + int deleteRlUserWithdrawByUserId(Long userId); } diff --git a/eride-system/src/main/java/com/ruoyi/system/service/IEDeviceService.java b/eride-system/src/main/java/com/ruoyi/system/service/IEDeviceService.java index bdccf45..1da8e2c 100644 --- a/eride-system/src/main/java/com/ruoyi/system/service/IEDeviceService.java +++ b/eride-system/src/main/java/com/ruoyi/system/service/IEDeviceService.java @@ -166,6 +166,11 @@ public interface IEDeviceService extends IService * @return 结果 */ int refreshDevice(Long[] deviceIds); + + /** + * 更新最新的位置信息 + */ + boolean updateLatestLocation(String sn); // // /** // * 删除设备信息 @@ -417,4 +422,9 @@ public interface IEDeviceService extends IService * 根据店铺id查询所有车辆数 */ Integer selectAllDeviceCountByStoreId(Long storeId); + + /** + * 根据sn数组查询车辆数 + */ + List selectBySns(List sns); } diff --git a/eride-system/src/main/java/com/ruoyi/system/service/IEShareKeyService.java b/eride-system/src/main/java/com/ruoyi/system/service/IEShareKeyService.java index d9fbe0c..c4d097d 100644 --- a/eride-system/src/main/java/com/ruoyi/system/service/IEShareKeyService.java +++ b/eride-system/src/main/java/com/ruoyi/system/service/IEShareKeyService.java @@ -35,6 +35,14 @@ public interface IEShareKeyService */ public List selectEShareKeyListByOwnerId(Long ownerId); + /** + * 根据归属用户id查询未过期车辆sn + * + * @param ownerId 归属用户id + * @return 共享钥匙集合 + */ + public List selectEShareSnListByShareUserId(Long ownerId); + /** * 根据归属用户id查询共享钥匙列表(已失效) * @@ -82,4 +90,9 @@ public interface IEShareKeyService * @return 结果 */ public int deleteEShareKeyByKeyId(Long keyId); + + /** + * 查询已过期但改变状态的共享钥匙列表 + */ + public List selectExpiredShareKeyList(); } diff --git a/eride-system/src/main/java/com/ruoyi/system/service/IEUserWithdrawService.java b/eride-system/src/main/java/com/ruoyi/system/service/IEUserWithdrawService.java index dd8513c..3075045 100644 --- a/eride-system/src/main/java/com/ruoyi/system/service/IEUserWithdrawService.java +++ b/eride-system/src/main/java/com/ruoyi/system/service/IEUserWithdrawService.java @@ -67,4 +67,12 @@ public interface IEUserWithdrawService * @return 结果 */ public int deleteRlUserWithdrawByUserChannelId(Long userChannelId); + + /** + * 根据userId删除用户提现渠道信息 + * + * @param userId 用户id + * @return 结果 + */ + public int deleteRlUserWithdrawByUserId(Long userId); } diff --git a/eride-system/src/main/java/com/ruoyi/system/service/impl/EDeviceServiceImpl.java b/eride-system/src/main/java/com/ruoyi/system/service/impl/EDeviceServiceImpl.java index 0c61481..eb3d089 100644 --- a/eride-system/src/main/java/com/ruoyi/system/service/impl/EDeviceServiceImpl.java +++ b/eride-system/src/main/java/com/ruoyi/system/service/impl/EDeviceServiceImpl.java @@ -25,6 +25,7 @@ import com.ruoyi.system.domain.device.EDevice; import com.ruoyi.system.domain.EOnlineLog; import com.ruoyi.system.domain.device.EDeviceQuery; import com.ruoyi.system.domain.device.EDeviceVO; +import com.ruoyi.system.domain.model.EModel; import com.ruoyi.system.domain.model.EModelVO; import com.ruoyi.e.order.domain.order.EOrder; import com.ruoyi.e.order.domain.order.EOrderQuery; @@ -44,6 +45,7 @@ import javax.annotation.Resource; import java.math.BigDecimal; import java.math.RoundingMode; import java.util.ArrayList; +import java.util.Collections; import java.util.Date; import java.util.List; import java.util.concurrent.ScheduledExecutorService; @@ -489,19 +491,136 @@ public class EDeviceServiceImpl extends ServiceImpl impl EDevice device = deviceMapper.selectEDeviceByDeviceId(deviceId); //设备是否在线 if(isOnline(device.getSn())){ - log.info("设备【"+device.getSn()+"】在线"); + log.info("设备【{}】在线", device.getSn()); }else{ - log.info("设备【"+device.getSn()+"】不在线"); + log.info("设备【{}】不在线", device.getSn()); } if(updateVersion(device.getSn())){ - log.info("设备【"+device.getSn()+"】更新版本成功"); + log.info("设备【{}】更新版本成功", device.getSn()); }else{ - log.info("设备【"+device.getSn()+"】更新版本失败"); + log.info("设备【{}】更新版本失败", device.getSn()); + } + // 最新位置信息 + if(updateLatestLocation(device.getSn())){ + log.info("设备【{}】更新位置成功", device.getSn()); + }else{ + log.info("设备【{}】更新位置失败", device.getSn()); } } return 1; } + /** + * 更新最新的位置信息 + */ + @Override + @SneakyThrows + public boolean updateLatestLocation(String sn) { + EDevice device = deviceMapper.selectEDeviceBySn(sn); + if(device!=null){ + String token = Token.getToken(); + DataPointRes datapoints = historyDatapoints(device.getMac(), token); + if(datapoints.getCode() == 0){ + Data data = datapoints.getData(); + List datastreams = data.getDevices(); + for (Datastream datastream: datastreams) { + List datapointList = datastream.getDatastreams(); + if(ObjectUtil.isNotNull(datapointList)){ + for (Datapoint datapoint:datapointList) { + if(datapoint.getId().equals(IotConstants.ONENET_LOCATION)){ + String string = JSON.toJSONString(datapoint.getValue()); + String at = datapoint.getAt(); + if(StrUtil.isNotBlank(string)){ + LocationVo locationVo = JSONObject.parseObject(string, LocationVo.class); + log.info("【手动更新】: locationVo---【{}】" , JSON.toJSONString(locationVo)); + double[] doubles = CommonUtil.coordinateConvert(locationVo.getLon(), locationVo.getLat()); + BigDecimal lat = BigDecimal.valueOf(doubles[0]).setScale(8, RoundingMode.HALF_UP); + BigDecimal lon = BigDecimal.valueOf(doubles[1]).setScale(8, RoundingMode.HALF_UP); + log.info("转换后的GCJ02经纬度:{}---{}", lon, lat); + if(BigDecimal.ZERO.compareTo(lon) != 0 && BigDecimal.ZERO.compareTo(lat) != 0){ + /** 计算电量和里程后更新设备*/ + int i = updateDevice(at,locationVo, device, lon, lat); + if(i > 0){ + log.info("【手动更新】===>更新设备成功"); + return true; + }else{ + log.info("【手动更新】===>更新设备失败"); + return false; + } + }else{ + noLocationUpdateDevice(at,locationVo,device); + } + } + } + } + } + } + } + } + return false; + } + + /** 无定位更新设备 */ + private void noLocationUpdateDevice(String at,LocationVo locationVo, EDevice device) { + BigDecimal bat = new BigDecimal(locationVo.getBat()); + if(bat.compareTo(new BigDecimal(100)) > 0){ + bat = bat.divide(new BigDecimal(10)); + } + log.info("保存电压:{}", bat); + device.setVoltage(bat.toString());//电压 + EModel model = modelService.selectEModelByModelId(device.getModelId()); + // 根据电压计算续航里程 + if(ObjectUtil.isNotNull(model)){ + Integer remainingMileage = 0; + if(StrUtil.isNotBlank(device.getVoltage())){ + remainingMileage = CommonUtil.getRemainingMileage(device.getVoltage(), model.getFullVoltage(), model.getLowVoltage(), model.getFullEndurance()); + } + Integer electricQuantity = CommonUtil.getElectricQuantity(device.getVoltage(), model.getFullVoltage(), model.getLowVoltage());//电量百分百 + device.setRemainingMileage(remainingMileage); + device.setRemainingPower(electricQuantity.toString()); + } + device.setLastTime(DateUtils.parseDate(at)); + device.setGps("0"); + device.setSignalStrength(locationVo.getCsq()); + device.setSatellites(0); + device.setQuality(locationVo.getQ()); + int i = updateLocation(device); + if(i>0){ + log.info("未获取到定位===============保存电压等数值成功===========>{}", device.getSn()); + } + } + + /** 计算电量和里程后更新设备*/ + public int updateDevice(String at,LocationVo locationVo, EDevice device, BigDecimal lon, BigDecimal lat) { + device.setLatitude(lat.toString()); + device.setLongitude(lon.toString()); + BigDecimal bat = new BigDecimal(locationVo.getBat()); + if(bat.compareTo(new BigDecimal(100)) > 0){ + bat = bat.divide(new BigDecimal(10)); + } + log.info("保存电压:{}", bat); + device.setVoltage(bat.toString());//电压 + // 根据电压计算续航里程 + EModel model = modelService.selectEModelByModelId(device.getModelId()); + if(ObjectUtil.isNotNull(model)){ + Integer remainingMileage = 0; + if(StrUtil.isNotBlank(device.getVoltage())){ + remainingMileage = CommonUtil.getRemainingMileage(device.getVoltage(), model.getFullVoltage(), model.getLowVoltage(), model.getFullEndurance()); + } + Integer electricQuantity = CommonUtil.getElectricQuantity(device.getVoltage(), model.getFullVoltage(), model.getLowVoltage());//电量百分百 + device.setRemainingMileage(remainingMileage); + device.setRemainingPower(electricQuantity.toString()); + } + device.setLastTime(DateUtils.parseDate(at)); + device.setLastLocationTime(DateUtils.parseDate(at)); + device.setGps("1"); + // 信号强度 + device.setSignalStrength(locationVo.getCsq()); + device.setSatellites(locationVo.getS()); + device.setQuality(locationVo.getQ()); + return updateLocation(device); + } + // /** // * 删除设备信息 // * @@ -1365,6 +1484,14 @@ public class EDeviceServiceImpl extends ServiceImpl impl public Integer selectAllDeviceCountByStoreId(Long storeId) { return deviceMapper.selectAllDeviceCountByStoreId(storeId); } + + /** + * 根据sn数组查询车辆数 + */ + @Override + public List selectBySns(List sns) { + return deviceMapper.selectBySns(sns); + } // /** // * 判断是否在运营时间内 // */ diff --git a/eride-system/src/main/java/com/ruoyi/system/service/impl/EShareKeyServiceImpl.java b/eride-system/src/main/java/com/ruoyi/system/service/impl/EShareKeyServiceImpl.java index b7a8382..a5fe3e3 100644 --- a/eride-system/src/main/java/com/ruoyi/system/service/impl/EShareKeyServiceImpl.java +++ b/eride-system/src/main/java/com/ruoyi/system/service/impl/EShareKeyServiceImpl.java @@ -62,6 +62,17 @@ public class EShareKeyServiceImpl implements IEShareKeyService return eShareKeyMapper.selectEShareKeyListByOwnerId(ownerId); } + /** + * 根据归属用户id查询未过期车辆sn + * + * @param shareUserId 分享用户id + * @return 共享钥匙集合 + */ + @Override + public List selectEShareSnListByShareUserId(Long shareUserId){ + return eShareKeyMapper.selectEShareSnListByShareUserId(shareUserId); + } + /** * 根据归属用户id查询共享钥匙列表 * @@ -135,4 +146,12 @@ public class EShareKeyServiceImpl implements IEShareKeyService { return eShareKeyMapper.deleteEShareKeyByKeyId(keyId); } + + /** + * 查询已过期但改变状态的共享钥匙列表 + */ + @Override + public List selectExpiredShareKeyList() { + return eShareKeyMapper.selectExpiredShareKeyList(); + } } diff --git a/eride-system/src/main/java/com/ruoyi/system/service/impl/EUserServiceImpl.java b/eride-system/src/main/java/com/ruoyi/system/service/impl/EUserServiceImpl.java index 2793818..44f3bab 100644 --- a/eride-system/src/main/java/com/ruoyi/system/service/impl/EUserServiceImpl.java +++ b/eride-system/src/main/java/com/ruoyi/system/service/impl/EUserServiceImpl.java @@ -387,6 +387,7 @@ public class EUserServiceImpl implements IEUserService{ public int updateUser(EUser user) { if (!ObjectUtil.isNull(user.getUserType()) && user.getUserType().equals(ServiceConstants.USER_TYPE_MERCHANT)) { + userWithdrawalChannel(user.getUserId()); } // 删除用户与角色关联 @@ -400,6 +401,11 @@ public class EUserServiceImpl implements IEUserService{ private void userWithdrawalChannel(Long userId) { List channelWithdrawVOS = channelWithdrawService.selectAllChannelWithdrawList(); + int i1 = userWithdrawService.deleteRlUserWithdrawByUserId(userId); + createUserWithdrawal(userId, channelWithdrawVOS); + } + + private void createUserWithdrawal(Long userId, List channelWithdrawVOS) { for (ChannelWithdrawVO channelWithdrawVO : channelWithdrawVOS) { EUserWithdraw rlUserWithdraw = new EUserWithdraw(); rlUserWithdraw.setHandlingChargeType(channelWithdrawVO.getHandlingChargeType()); @@ -413,9 +419,7 @@ public class EUserServiceImpl implements IEUserService{ rlUserWithdraw.setPicture(channelWithdrawVO.getPicture()); rlUserWithdraw.setIsNeedCode(channelWithdrawVO.getIsNeedCode()); int i = userWithdrawService.insertRlUserWithdraw(rlUserWithdraw); - if(i>0){ - log.info("【微信登录/wxlogin】用户【{}】创建用户提现渠道【{}】", userId, JSON.toJSON(rlUserWithdraw)); - } + ServiceUtil.assertion(i==0,"创建用户提现渠道失败:userId:"+ userId); } } diff --git a/eride-system/src/main/java/com/ruoyi/system/service/impl/EUserWithdrawServiceImpl.java b/eride-system/src/main/java/com/ruoyi/system/service/impl/EUserWithdrawServiceImpl.java index 737b57e..1320973 100644 --- a/eride-system/src/main/java/com/ruoyi/system/service/impl/EUserWithdrawServiceImpl.java +++ b/eride-system/src/main/java/com/ruoyi/system/service/impl/EUserWithdrawServiceImpl.java @@ -104,4 +104,15 @@ public class EUserWithdrawServiceImpl implements IEUserWithdrawService { return rlUserWithdrawMapper.deleteRlUserWithdrawByUserChannelId(userChannelId); } + + /** + * 根据userId删除用户提现渠道信息 + * + * @param userId 用户id + * @return 结果 + */ + @Override + public int deleteRlUserWithdrawByUserId(Long userId) { + return rlUserWithdrawMapper.deleteRlUserWithdrawByUserId(userId); + } } diff --git a/eride-system/src/main/java/com/ruoyi/system/task/RlTask.java b/eride-system/src/main/java/com/ruoyi/system/task/RlTask.java index d8bc1ea..ea7d049 100644 --- a/eride-system/src/main/java/com/ruoyi/system/task/RlTask.java +++ b/eride-system/src/main/java/com/ruoyi/system/task/RlTask.java @@ -8,7 +8,9 @@ import com.ruoyi.e.order.domain.order.EOrder; import com.ruoyi.e.order.domain.order.EOrderQuery; import com.ruoyi.e.order.domain.order.EOrderVO; import com.ruoyi.e.order.service.IEOrderService; +import com.ruoyi.system.domain.EShareKey; import com.ruoyi.system.service.IEOrderOperService; +import com.ruoyi.system.service.IEShareKeyService; import com.ruoyi.system.service.ISysConfigService; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; @@ -39,6 +41,9 @@ public class RlTask { @Autowired private ISysConfigService configService; + @Autowired + private IEShareKeyService shareKeyService; + /** @@ -124,4 +129,19 @@ public class RlTask { log.info("-------------------【定时任务】超时标记---结束----------------"); } + /** + * 分享key过期状态处理 + */ + public void expiredKeyHandler(){ + log.info("-------------------【定时任务】分享key过期状态处理---开始----------------"); + List eShareKeys = shareKeyService.selectExpiredShareKeyList(); + for (EShareKey eShareKey:eShareKeys) { + EShareKey updateKey = new EShareKey(); + updateKey.setKeyId(eShareKey.getKeyId()); + updateKey.setStatus(ServiceConstants.KEY_STATUS_EXPIRED); + int i = shareKeyService.updateEShareKey(updateKey); + } + log.info("-------------------【定时任务】分享key过期状态处理---结束----------------"); + } + } diff --git a/eride-system/src/main/resources/mapper/system/EDeviceMapper.xml b/eride-system/src/main/resources/mapper/system/EDeviceMapper.xml index e26c7d1..d4b3bbc 100644 --- a/eride-system/src/main/resources/mapper/system/EDeviceMapper.xml +++ b/eride-system/src/main/resources/mapper/system/EDeviceMapper.xml @@ -430,4 +430,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" order by create_time desc limit 1 + + diff --git a/eride-system/src/main/resources/mapper/system/EShareKeyMapper.xml b/eride-system/src/main/resources/mapper/system/EShareKeyMapper.xml index 17f1663..98c6a8e 100644 --- a/eride-system/src/main/resources/mapper/system/EShareKeyMapper.xml +++ b/eride-system/src/main/resources/mapper/system/EShareKeyMapper.xml @@ -16,15 +16,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + - select k.key_id, k.key_name, k.share_id,k.share_phone, k.share_user_name, k.owner_id, k.owner_name, k.owner_phone, k.sn, k.status, k.expiration_time from e_share_key k + select k.key_id, k.key_name, k.share_id,k.share_phone, k.share_user_name, k.owner_id, k.owner_name, k.owner_phone, k.sn, k.status, k.expiration_time, k.create_time from e_share_key k - where key_id = #{keyId} + where key_id = #{keyId} and k.del_flag = '0' + + + + @@ -73,6 +98,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" sn, status, expiration_time, + create_time, #{keyName}, @@ -85,6 +111,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{sn}, #{status}, #{expirationTime}, + #{createTime}, @@ -102,6 +129,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" status = #{status}, del_flag = #{delFlag}, expiration_time = #{expirationTime}, + create_time = #{createTime}, where key_id = #{keyId} diff --git a/eride-system/src/main/resources/mapper/system/EUserWithdrawMapper.xml b/eride-system/src/main/resources/mapper/system/EUserWithdrawMapper.xml index b25009a..08494bf 100644 --- a/eride-system/src/main/resources/mapper/system/EUserWithdrawMapper.xml +++ b/eride-system/src/main/resources/mapper/system/EUserWithdrawMapper.xml @@ -99,4 +99,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{userChannelId} + + + delete from e_user_withdraw where user_id = #{userId} +