|
|
|
@ -3,23 +3,28 @@ package com.leaper.web.controller;
|
|
|
|
import com.github.pagehelper.PageInfo;
|
|
|
|
import com.github.pagehelper.PageInfo;
|
|
|
|
import com.leaper.common.util.ValidatorUtil;
|
|
|
|
import com.leaper.common.util.ValidatorUtil;
|
|
|
|
import com.leaper.web.entity.CheckLog;
|
|
|
|
import com.leaper.web.entity.CheckLog;
|
|
|
|
|
|
|
|
import com.leaper.web.entity.DeviceReq;
|
|
|
|
import com.leaper.web.pojo.stock.CheckLogSearch;
|
|
|
|
import com.leaper.web.pojo.stock.CheckLogSearch;
|
|
|
|
import com.leaper.web.service.CheckLogService;
|
|
|
|
import com.leaper.web.service.CheckLogService;
|
|
|
|
|
|
|
|
import com.leaper.web.service.PlcService;
|
|
|
|
import com.zhehekeji.core.pojo.Result;
|
|
|
|
import com.zhehekeji.core.pojo.Result;
|
|
|
|
import io.swagger.annotations.Api;
|
|
|
|
import io.swagger.annotations.Api;
|
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
|
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Api(tags = "设备相关")
|
|
|
|
@Api(tags = "盘点历史")
|
|
|
|
|
|
|
|
@RequestMapping("/device")
|
|
|
|
@RequestMapping("/device")
|
|
|
|
@RestController
|
|
|
|
@RestController
|
|
|
|
|
|
|
|
@Slf4j
|
|
|
|
public class DeviceController {
|
|
|
|
public class DeviceController {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -28,11 +33,27 @@ public class DeviceController {
|
|
|
|
@Resource
|
|
|
|
@Resource
|
|
|
|
private ValidatorUtil validatorUtil;
|
|
|
|
private ValidatorUtil validatorUtil;
|
|
|
|
|
|
|
|
|
|
|
|
@ApiOperation("盘点历史")
|
|
|
|
@Resource
|
|
|
|
@PostMapping("")
|
|
|
|
PlcService plcService;
|
|
|
|
public Result<PageInfo<CheckLog>> list(@RequestBody CheckLogSearch checkLogSearch){
|
|
|
|
|
|
|
|
return Result.success(checkLogService.list(checkLogSearch));
|
|
|
|
@ApiOperation("设备报警")
|
|
|
|
|
|
|
|
@PostMapping("warn")
|
|
|
|
|
|
|
|
public Result<Map<String, List<String>>> warn(@RequestBody DeviceReq deviceReq) {
|
|
|
|
|
|
|
|
log.info("{}设备报警", deviceReq.getDeviceCode());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
plcService.warnStart(deviceReq);
|
|
|
|
|
|
|
|
Map<String, List<String>> map =
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return Result.success(checkLogService.list());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ApiOperation("设备报警")
|
|
|
|
|
|
|
|
@PostMapping("巡检")
|
|
|
|
|
|
|
|
public Result<Map<String, List<String>>> inspection(@RequestBody DeviceReq deviceReq) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return Result.success(checkLogService.list());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|