Procházet zdrojové kódy

Merge branch 'develop' of gitadmin/tuoheng_freeway into release

tags/V1.3.3^2
suqin před 11 měsíci
rodič
revize
b80e9a1675
2 změnil soubory, kde provedl 21 přidání a 11 odebrání
  1. +20
    -10
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/iotequipment/edit/EditIotEquipmentService.java
  2. +1
    -1
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/utils/GaodeUtil.java

+ 20
- 10
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/iotequipment/edit/EditIotEquipmentService.java Zobrazit soubor

if (ObjectUtil.isEmpty(iotEquipment)) { if (ObjectUtil.isEmpty(iotEquipment)) {
throw new ServiceException("该设备不存在"); throw new ServiceException("该设备不存在");
} }
iotEquipment = iotEquipmentMapper.selectOne(new LambdaQueryWrapper<IotEquipment>()
.eq(IotEquipment::getTenantId, tenantId)
.eq(IotEquipment::getDeptId, request.getDeptId())
.eq(IotEquipment::getCode, request.getCode())
.eq(IotEquipment::getMark, MarkEnum.VALID.getCode()));
if (ObjectUtil.isNotEmpty(iotEquipment)) {
throw new ServiceException("该部门下已存在该编号设备");

String code = iotEquipment.getCode();
if (!StringUtils.isEmpty(code)) {
if (!request.getCode().equals(code)) { //不相等 说明这次用户要修改设备编码
//在修改前判断 用户传来的设备编号在数据库中是否已经存在
IotEquipment equipment = iotEquipmentMapper.selectOne(new LambdaQueryWrapper<IotEquipment>()
.eq(IotEquipment::getTenantId, tenantId)
.eq(IotEquipment::getDeptId, request.getDeptId())
.eq(IotEquipment::getCode, request.getCode())
.eq(IotEquipment::getMark, MarkEnum.VALID.getCode()));
if (ObjectUtil.isNotEmpty(equipment)) {
throw new ServiceException("该部门下已存在该编号设备");
}
}
} }

return JsonResult.success(); return JsonResult.success();
} }


/** /**
* 启用、禁用 * 启用、禁用
*
* @param id * @param id
* @param status * @param status
* @return * @return


/** /**
* 检查启用/禁用参数 * 检查启用/禁用参数
*
* @param id * @param id
* @param status * @param status
* @return * @return
*/ */
private JsonResult check1(String id,int status) {
private JsonResult check1(String id, int status) {
if (StringUtils.isEmpty(id)) { if (StringUtils.isEmpty(id)) {
throw new ServiceException("设备Id码为空"); throw new ServiceException("设备Id码为空");
} }
if(String.valueOf(status).equals("")){
if (String.valueOf(status).equals("")) {
throw new ServiceException("设备状态为空"); throw new ServiceException("设备状态为空");
} }


if(1 != status && 0 != status){
if (1 != status && 0 != status) {
throw new ServiceException("无法修改状态,状态只有启用或者禁用两种!"); throw new ServiceException("无法修改状态,状态只有启用或者禁用两种!");
} }



+ 1
- 1
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/utils/GaodeUtil.java Zobrazit soubor

import java.util.Map; import java.util.Map;


@Slf4j @Slf4j
public class GaodeUtil {
public class GaodeUtil {


/** /**
* 逆地理编码 * 逆地理编码

Načítá se…
Zrušit
Uložit