代码提交
This commit is contained in:
@@ -18,5 +18,5 @@ public interface IMqttUserService extends IService<MqttUser> {
|
||||
* @param password
|
||||
*/
|
||||
void insertMqttUser(String password);
|
||||
|
||||
void deleteUser(String ndid);
|
||||
}
|
||||
|
||||
@@ -67,6 +67,7 @@ public class CsDeviceUserPOServiceImpl extends ServiceImpl<CsDeviceUserPOMapper,
|
||||
private final UserFeignClient userFeignClient;
|
||||
|
||||
private final FeedBackFeignClient feedBackFeignClient;
|
||||
private final IMqttUserService mqttUserService;
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@@ -267,7 +268,7 @@ public class CsDeviceUserPOServiceImpl extends ServiceImpl<CsDeviceUserPOMapper,
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = {Exception.class})
|
||||
// @Transactional(rollbackFor = {Exception.class})
|
||||
public Boolean delete(String eid) {
|
||||
String userIndex = RequestUtil.getUserIndex();
|
||||
List<CsDeviceUserPO> list = this.lambdaQuery().eq(CsDeviceUserPO::getDeviceId, eid).eq(CsDeviceUserPO::getStatus, "1").eq(CsDeviceUserPO::getPrimaryUserId, userIndex).list();
|
||||
@@ -278,8 +279,12 @@ public class CsDeviceUserPOServiceImpl extends ServiceImpl<CsDeviceUserPOMapper,
|
||||
CsEquipmentDeliveryPO csEquipmentDeliveryPO =new CsEquipmentDeliveryPO();
|
||||
csEquipmentDeliveryPO.setId(eid);
|
||||
csEquipmentDeliveryPO.setRunStatus(0);
|
||||
|
||||
csEquipmentDeliveryMapper.updateById(csEquipmentDeliveryPO);
|
||||
this.lambdaUpdate().eq(CsDeviceUserPO::getDeviceId, eid).set(CsDeviceUserPO::getStatus,"0").update();
|
||||
|
||||
CsEquipmentDeliveryPO temp = csEquipmentDeliveryMapper.selectById(eid);
|
||||
mqttUserService.deleteUser(temp.getNdid());
|
||||
List<CsLedger> list1 = iCsLedgerService.lambdaQuery().eq(CsLedger::getPid, eid).list();
|
||||
if(!com.alibaba.nacos.client.naming.utils.CollectionUtils.isEmpty(list1)){
|
||||
List<String> collect = list1.stream().map(CsLedger::getId).collect(Collectors.toList());
|
||||
|
||||
@@ -42,6 +42,7 @@ import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.poi.ss.usermodel.Workbook;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Propagation;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
@@ -91,6 +92,7 @@ public class CsEquipmentDeliveryServiceImpl extends ServiceImpl<CsEquipmentDeliv
|
||||
private final DictTreeFeignClient dictTreeFeignClient;
|
||||
|
||||
private final CsEquipmentProcessPOService csEquipmentProcessPOService;
|
||||
private final IMqttUserService mqttUserService;
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = {Exception.class})
|
||||
@@ -120,7 +122,7 @@ public class CsEquipmentDeliveryServiceImpl extends ServiceImpl<CsEquipmentDeliv
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = {Exception.class})
|
||||
// @Transactional(rollbackFor = {Exception.class}, propagation = Propagation.REQUIRED)
|
||||
public Boolean AuditEquipmentDelivery(String id) {
|
||||
UpdateWrapper<CsEquipmentDeliveryPO> wrapper = new UpdateWrapper();
|
||||
wrapper.eq ("id", id);
|
||||
@@ -140,6 +142,10 @@ public class CsEquipmentDeliveryServiceImpl extends ServiceImpl<CsEquipmentDeliv
|
||||
queryWrap.eq("device_id",id);
|
||||
csTouristDataPOService.getBaseMapper().delete(queryWrap);
|
||||
|
||||
CsEquipmentDeliveryPO csEquipmentDeliveryPO = this.getBaseMapper().selectById(id);
|
||||
mqttUserService.deleteUser(csEquipmentDeliveryPO.getNdid());
|
||||
|
||||
|
||||
csDevModelRelationService.lambdaUpdate().eq(CsDevModelRelationPO::getDevId,id).set(CsDevModelRelationPO::getStatus,0).update();
|
||||
return update;
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.njcn.csdevice.service.impl;
|
||||
|
||||
import cn.hutool.crypto.digest.DigestUtil;
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njcn.csdevice.mapper.MqttUserMapper;
|
||||
import com.njcn.csdevice.pojo.po.MqttUser;
|
||||
@@ -33,4 +34,13 @@ public class MqttUserServiceImpl extends ServiceImpl<MqttUserMapper, MqttUser> i
|
||||
mqttUser.setPassword(DigestUtil.sha256Hex(password + mqttUser.getSalt()));
|
||||
this.save(mqttUser);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteUser(String ndid) {
|
||||
QueryWrapper<MqttUser> queryWrap = new QueryWrapper<>();
|
||||
queryWrap.eq("username",ndid);
|
||||
this.getBaseMapper().delete(queryWrap);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user