package com.panzhihua.serviceapi.api;
|
|
import com.panzhihua.common.controller.BaseController;
|
import com.panzhihua.common.model.dtos.api.EventFile;
|
import com.panzhihua.common.model.dtos.api.EventInfo;
|
import com.panzhihua.common.model.vos.R;
|
import com.panzhihua.serviceapi.biz.LcApiService;
|
import com.panzhihua.serviceapi.model.dto.LcGridData;
|
import io.swagger.annotations.Api;
|
import io.swagger.annotations.ApiOperation;
|
import lombok.extern.slf4j.Slf4j;
|
import org.springframework.web.bind.annotation.*;
|
|
import javax.annotation.Resource;
|
import java.util.Collections;
|
import java.util.List;
|
|
/**
|
* program 攀枝花智慧社区项目
|
* description 浪潮事件管理API
|
*
|
* @author manailin
|
* Date 2021-01-22 15:30
|
**/
|
@Slf4j
|
@Api(tags = {"浪潮事件管理API"})
|
@RestController
|
@RequestMapping("/")
|
public class LcEventApi extends BaseController {
|
|
@Resource
|
private LcApiService lcApiService;
|
|
|
/**
|
* description 向浪潮服务器提交网格事件登记
|
*
|
* @param eventInfo 事件信息对象
|
* @author manailin
|
* @date 2021/6/10 17:00
|
*/
|
@ApiOperation(value = "向浪潮服务器提交网格事件登记")
|
@PostMapping("lc/event/upload")
|
public void automationUpload(@RequestBody EventInfo eventInfo) {
|
try {
|
lcApiService.submitEventRegister(eventInfo);
|
} catch (Exception e) {
|
log.error("向浪潮服务器提交网格事件登记出现错误:{}", e.getMessage());
|
}
|
}
|
|
/**
|
* description 提交事件登记关联的文件或者图片信息
|
*
|
* @param eventFile 文件对象
|
* @author manailin
|
* @date 2021/6/10 17:00
|
*/
|
@ApiOperation(value = "提交事件登记关联的文件或者图片信息")
|
@PostMapping("lc/event/upload/file")
|
public R automationUploadFile(@RequestBody EventFile eventFile) {
|
return lcApiService.submitEventRelationFile(eventFile);
|
}
|
|
/**
|
* description 提交事件登记关联的文件或者图片信息
|
*
|
* @author manailin
|
* @date 2021/6/10 17:00
|
*/
|
@ApiOperation(value = "提交事件登记关联的文件或者图片信息")
|
@PostMapping("lc/event/upload/event_and_file")
|
public void automationUploadEventAndFile() {
|
try {
|
lcApiService.automationUploadEventAndFile();
|
} catch (Exception e) {
|
log.error("提交事件登记关联的文件或者图片信息出现错误:{}", e.getMessage());
|
}
|
}
|
|
/**
|
* description 获取指定事件信息
|
*
|
* @param eventId 事件ID
|
* @return String 事件信息
|
* @author manailin
|
* @date 2021/6/10 17:00
|
*/
|
@ApiOperation(value = "获取指定事件信息")
|
@GetMapping("lc/event/getEventInfoById")
|
public String getEventInfoById(String eventId) {
|
try {
|
return lcApiService.getEventInfoById(eventId);
|
} catch (Exception e) {
|
log.error("获取指定事件信息出现错误:{}", e.getMessage());
|
}
|
return eventId;
|
}
|
|
/**
|
* description 获取所有或者根据姓名和工号查询,分页
|
*
|
* @param eventId 事件ID
|
* @return String 事件信息
|
* @author manailin
|
* @date 2021/6/10 17:00
|
*/
|
@ApiOperation(value = "获取所有或者根据姓名和工号查询,分页")
|
@GetMapping("lc/event/getGridMemberListByAreaIdOrName")
|
public String getGridMemberListByAreaIdOrName(String eventId) {
|
try {
|
return lcApiService.getGridMemberListByAreaIdOrName(eventId);
|
} catch (Exception e) {
|
log.error("获取所有或者根据姓名和工号查询,分页出现错误:{}", e.getMessage());
|
}
|
return eventId;
|
}
|
|
/**
|
* description 获取指定区域网格列表
|
*
|
* @param areaId 区域ID
|
* @return String 事件信息
|
* @author manailin
|
* @date 2021/6/10 17:00
|
*/
|
@ApiOperation(value = "获取指定区域网格列表")
|
@GetMapping("lc/grid/list")
|
public List<LcGridData> getGridListByAreaId(String areaId) {
|
try {
|
return lcApiService.getGridListByAreaId(areaId);
|
} catch (Exception e) {
|
log.error("获取指定区域网格列表出现错误:{}", e.getMessage());
|
}
|
return Collections.emptyList();
|
}
|
|
}
|