修改
This commit is contained in:
@ -0,0 +1,37 @@
|
||||
package cn.iocoder.yudao.module.system.controller.app.deviceinfo;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.deviceinfo.vo.DeviceInfoSaveReqVO;
|
||||
import cn.iocoder.yudao.module.system.service.deviceinfo.DeviceInfoService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.validation.Valid;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
|
||||
@Tag(name = "管理后台 - 设备信息关联门店")
|
||||
@RestController
|
||||
@RequestMapping("/t/device-info")
|
||||
@Validated
|
||||
public class AppDeviceInfoController {
|
||||
|
||||
@Resource
|
||||
private DeviceInfoService deviceInfoService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建设备信息关联门店")
|
||||
@PreAuthorize("@ss.hasPermission('t:device-info:create')")
|
||||
public CommonResult<Long> createDeviceInfo(@Valid @RequestBody DeviceInfoSaveReqVO createReqVO) {
|
||||
return success(deviceInfoService.createDeviceInfo(createReqVO));
|
||||
}
|
||||
|
||||
}
|
@ -2,12 +2,7 @@ package cn.iocoder.yudao.module.system.controller.app.facedeviceinfo;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.facedeviceinfo.vo.FaceDeviceInfoPageReqVO;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.facedeviceinfo.vo.FaceDeviceInfoRespVO;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.facedeviceinfo.vo.FaceDeviceInfoSaveReqVO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.facedeviceinfo.FaceDeviceInfoDO;
|
||||
@ -17,19 +12,18 @@ import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.data.redis.core.StringRedisTemplate;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.annotation.security.PermitAll;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.Valid;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.EXPORT;
|
||||
|
||||
|
||||
|
||||
@ -66,5 +60,10 @@ public class AppFaceDeviceInfoController {
|
||||
return success(bean);
|
||||
}
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建人脸设备信息关联门店")
|
||||
public CommonResult<Long> createFaceDeviceInfo(@Valid @RequestBody FaceDeviceInfoSaveReqVO createReqVO) {
|
||||
return success(faceDeviceInfoService.createFaceDeviceInfo(createReqVO));
|
||||
}
|
||||
|
||||
}
|
@ -1,25 +1,19 @@
|
||||
package cn.iocoder.yudao.module.system.service.facedeviceinfo;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.facedeviceinfo.vo.FaceDeviceInfoPageReqVO;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.facedeviceinfo.vo.FaceDeviceInfoSaveReqVO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.facedeviceinfo.FaceDeviceInfoDO;
|
||||
import cn.iocoder.yudao.module.system.dal.mysql.carteen.CarteenMapper;
|
||||
import cn.iocoder.yudao.module.system.dal.mysql.facedeviceinfo.FaceDeviceInfoMapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.module.system.enums.ErrorCodeConstants.FACE_DEVICE_INFO_NOT_EXISTS;
|
||||
@ -94,7 +88,9 @@ public class FaceDeviceInfoServiceImpl implements FaceDeviceInfoService {
|
||||
LambdaQueryWrapper<FaceDeviceInfoDO> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(FaceDeviceInfoDO::getMac, mac);
|
||||
FaceDeviceInfoDO faceDeviceInfoDO = faceDeviceInfoMapper.selectOne(wrapper);
|
||||
faceDeviceInfoDO.setCarteenName(carteenMapper.selectById(faceDeviceInfoDO.getCarteenId()).getStoresName());
|
||||
if(faceDeviceInfoDO.getCarteenId() != null){
|
||||
faceDeviceInfoDO.setCarteenName(carteenMapper.selectById(faceDeviceInfoDO.getCarteenId()).getStoresName());
|
||||
}
|
||||
return faceDeviceInfoDO;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user