在PingController提供文件上传的示例
parent
f6700554d5
commit
9b3f08be66
|
|
@ -1,8 +1,11 @@
|
|||
package com.gunshi.project.xyt.controller;
|
||||
|
||||
import com.gunshi.core.GunShiCoreProperties;
|
||||
import com.gunshi.file.controller.BaseLoginFileController;
|
||||
import com.gunshi.logging.access.annotation.LoginLogging;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
|
@ -17,7 +20,10 @@ import org.springframework.web.bind.annotation.RestController;
|
|||
@RestController
|
||||
@Tag(name = "Ping")
|
||||
@RequestMapping("/ping")
|
||||
public class PingController {
|
||||
public class PingController extends BaseLoginFileController {
|
||||
@Autowired
|
||||
private GunShiCoreProperties properties;
|
||||
|
||||
@Operation(summary = "测试接口")
|
||||
@LoginLogging
|
||||
@GetMapping("")
|
||||
|
|
|
|||
|
|
@ -0,0 +1,63 @@
|
|||
package com.gunshi.project.xyt.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.gunshi.core.result.R;
|
||||
import com.gunshi.project.xyt.model.StPptnR;
|
||||
import com.gunshi.project.xyt.model.StPptnRAutoDao;
|
||||
import com.gunshi.project.xyt.model.StStbprpB;
|
||||
import com.gunshi.project.xyt.model.StStbprpBAutoMapper;
|
||||
import com.gunshi.project.xyt.so.RtuDataSo;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
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 java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 雨量数据接口
|
||||
*
|
||||
* @author lyf
|
||||
* @version 1.0.0
|
||||
* @since 2024-01-26
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/rcv/logupr")
|
||||
@Tag(name = "统一接收-雨量数据")
|
||||
public class RcvLogUpRController {
|
||||
|
||||
@Autowired
|
||||
private StPptnRAutoDao dao;
|
||||
|
||||
@Autowired
|
||||
private StStbprpBAutoMapper stbprpDao;
|
||||
|
||||
@Operation(summary = "分页查询")
|
||||
@PostMapping("/page")
|
||||
public R<Page<StPptnR>> page(@RequestBody RtuDataSo so) {
|
||||
List<String> stcds = new ArrayList<>();
|
||||
if (StringUtils.isNotEmpty(so.getStcd())) {
|
||||
stcds.add(so.getStcd());
|
||||
} else if (StringUtils.isNotEmpty(so.getStnm())) {
|
||||
stcds.addAll(stbprpDao.selectList(
|
||||
new LambdaQueryWrapper<StStbprpB>().like(StStbprpB::getStnm, so.getStnm())
|
||||
).stream().map(StStbprpB::getStcd).toList());
|
||||
}
|
||||
|
||||
Page<StPptnR> page;
|
||||
if (!stcds.isEmpty()) {
|
||||
LambdaQueryWrapper<StPptnR> query = new LambdaQueryWrapper<StPptnR>().in(StPptnR::getStcd, stcds);
|
||||
page = dao.page(so.getPageSo().toPage(), query);
|
||||
} else {
|
||||
page = dao.page(so.getPageSo().toPage());
|
||||
}
|
||||
|
||||
return R.ok(page);
|
||||
}
|
||||
}
|
||||
|
|
@ -3,6 +3,8 @@ package com.gunshi.project.xyt.model;
|
|||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.gunshi.core.dateformat.DateFormatString;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
|
|
@ -31,6 +33,7 @@ public class RcvLogUpR {
|
|||
|
||||
@TableField("RECEIVE_TM")
|
||||
@Schema(description = "接收时间")
|
||||
@JsonFormat(pattern = DateFormatString.YYYY_MM_DD_HH_MM_SS, timezone = "GMT+8")
|
||||
private Date receiveTm;
|
||||
|
||||
@TableField("DECODED")
|
||||
|
|
@ -39,6 +42,7 @@ public class RcvLogUpR {
|
|||
|
||||
@TableField("DECODED_TM")
|
||||
@Schema(description = "解码时间")
|
||||
@JsonFormat(pattern = DateFormatString.YYYY_MM_DD_HH_MM_SS, timezone = "GMT+8")
|
||||
private Date decodedTm;
|
||||
|
||||
@TableField("STCD")
|
||||
|
|
@ -51,6 +55,7 @@ public class RcvLogUpR {
|
|||
|
||||
@TableField("OBSERVE_TM")
|
||||
@Schema(description = "采集时间")
|
||||
@JsonFormat(pattern = DateFormatString.YYYY_MM_DD_HH_MM_SS, timezone = "GMT+8")
|
||||
private Date observeTm;
|
||||
|
||||
@TableField("PARTIAL_SIZE")
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@ spring:
|
|||
gunshi:
|
||||
core:
|
||||
appName: project-xyt
|
||||
appCode: project-xyt
|
||||
file:
|
||||
key: test.by_lyf.tmp
|
||||
secret: xPXPAb63FphkGkPU0ZZkNIXmDzjDVeF3PBH6ZEKw
|
||||
|
|
|
|||
Loading…
Reference in New Issue