檀树岗水情情数据同步修复
parent
524a49f177
commit
f9b5d33247
|
|
@ -0,0 +1,64 @@
|
||||||
|
package com.gunshi.project.xyt.controller;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.gunshi.core.result.R;
|
||||||
|
import com.gunshi.project.xyt.model.StRiverR;
|
||||||
|
import com.gunshi.project.xyt.service.StRiverRService;
|
||||||
|
import com.gunshi.project.xyt.validate.markers.Insert;
|
||||||
|
import com.gunshi.project.xyt.validate.markers.Update;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.List;
|
||||||
|
/**
|
||||||
|
* 描述:
|
||||||
|
* author: cxw
|
||||||
|
* date: 2024-09-24 14:01:07
|
||||||
|
*/
|
||||||
|
@Tag(name = "")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping(value="/stRiverR")
|
||||||
|
public class StRiverRController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private StRiverRService service;
|
||||||
|
|
||||||
|
|
||||||
|
@Operation(summary = "新增")
|
||||||
|
@PostMapping("/insert")
|
||||||
|
public R<StRiverR> insert(@Validated(Insert.class) @RequestBody StRiverR dto) {
|
||||||
|
boolean result = service.save(dto);
|
||||||
|
return R.ok(result ? dto : null);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "修改")
|
||||||
|
@PostMapping("/update")
|
||||||
|
public R<StRiverR> update(@Validated(Update.class) @RequestBody StRiverR dto) {
|
||||||
|
boolean result = service.updateById(dto);
|
||||||
|
return R.ok(result ? dto : null);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "删除")
|
||||||
|
@GetMapping("/del/{id}")
|
||||||
|
public R<Boolean> del(@Schema(name = "id") @PathVariable("id") Serializable id) {
|
||||||
|
return R.ok(service.removeById(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "列表")
|
||||||
|
@PostMapping("/list")
|
||||||
|
public R<List<StRiverR>> list() {
|
||||||
|
return R.ok(service.lambdaQuery().list());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "分页")
|
||||||
|
@PostMapping("/page")
|
||||||
|
public R<Page<StRiverR>> page() {
|
||||||
|
return R.ok(service.page(null,null));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,64 @@
|
||||||
|
package com.gunshi.project.xyt.controller;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.gunshi.core.result.R;
|
||||||
|
import com.gunshi.project.xyt.model.StRiverRReal;
|
||||||
|
import com.gunshi.project.xyt.service.StRiverRRealService;
|
||||||
|
import com.gunshi.project.xyt.validate.markers.Insert;
|
||||||
|
import com.gunshi.project.xyt.validate.markers.Update;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.List;
|
||||||
|
/**
|
||||||
|
* 描述:
|
||||||
|
* author: cxw
|
||||||
|
* date: 2024-09-24 14:01:07
|
||||||
|
*/
|
||||||
|
@Tag(name = "")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping(value="/stRiverRReal")
|
||||||
|
public class StRiverRRealController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private StRiverRRealService service;
|
||||||
|
|
||||||
|
|
||||||
|
@Operation(summary = "新增")
|
||||||
|
@PostMapping("/insert")
|
||||||
|
public R<StRiverRReal> insert(@Validated(Insert.class) @RequestBody StRiverRReal dto) {
|
||||||
|
boolean result = service.save(dto);
|
||||||
|
return R.ok(result ? dto : null);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "修改")
|
||||||
|
@PostMapping("/update")
|
||||||
|
public R<StRiverRReal> update(@Validated(Update.class) @RequestBody StRiverRReal dto) {
|
||||||
|
boolean result = service.updateById(dto);
|
||||||
|
return R.ok(result ? dto : null);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "删除")
|
||||||
|
@GetMapping("/del/{id}")
|
||||||
|
public R<Boolean> del(@Schema(name = "id") @PathVariable("id") Serializable id) {
|
||||||
|
return R.ok(service.removeById(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "列表")
|
||||||
|
@PostMapping("/list")
|
||||||
|
public R<List<StRiverRReal>> list() {
|
||||||
|
return R.ok(service.lambdaQuery().list());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "分页")
|
||||||
|
@PostMapping("/page")
|
||||||
|
public R<Page<StRiverRReal>> page() {
|
||||||
|
return R.ok(service.page(null,null));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,15 @@
|
||||||
|
package com.gunshi.project.xyt.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.gunshi.project.xyt.model.StRiverR;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 描述:
|
||||||
|
* author: cxw
|
||||||
|
* date: 2024-09-24 14:01:07
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface StRiverRMapper extends BaseMapper<StRiverR> {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,15 @@
|
||||||
|
package com.gunshi.project.xyt.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.gunshi.project.xyt.model.StRiverRReal;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 描述:
|
||||||
|
* author: cxw
|
||||||
|
* date: 2024-09-24 14:01:07
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface StRiverRRealMapper extends BaseMapper<StRiverRReal> {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,158 @@
|
||||||
|
package com.gunshi.project.xyt.model;
|
||||||
|
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
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 jakarta.validation.constraints.NotBlank;
|
||||||
|
import jakarta.validation.constraints.NotNull;
|
||||||
|
import jakarta.validation.constraints.Size;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 描述:
|
||||||
|
* author: cxw
|
||||||
|
* date: 2024-09-24 14:01:07
|
||||||
|
*/
|
||||||
|
@Schema(description="")
|
||||||
|
@Data
|
||||||
|
@TableName("public.st_river_r")
|
||||||
|
public class StRiverR implements Serializable {
|
||||||
|
|
||||||
|
public final static String thisTableName = "StRiverR";
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* stcd
|
||||||
|
*/
|
||||||
|
@TableId(value="stcd", type= IdType.AUTO)
|
||||||
|
@Schema(description="stcd")
|
||||||
|
@Size(max = 20,message = "stcd最大长度要小于 20")
|
||||||
|
@NotBlank(message = "stcd不能为空")
|
||||||
|
@NotNull(message = "stcd不能为空")
|
||||||
|
private String stcd;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* tm
|
||||||
|
*/
|
||||||
|
@TableField(value="tm")
|
||||||
|
@Schema(description="tm")
|
||||||
|
@JsonFormat(pattern = DateFormatString.YYYY_MM_DD_HH_MM_SS, timezone = "GMT+8")
|
||||||
|
private Date tm;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* z
|
||||||
|
*/
|
||||||
|
@TableField(value="z")
|
||||||
|
@Schema(description="z")
|
||||||
|
private BigDecimal z;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* q
|
||||||
|
*/
|
||||||
|
@TableField(value="q")
|
||||||
|
@Schema(description="q")
|
||||||
|
private BigDecimal q;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* xsa
|
||||||
|
*/
|
||||||
|
@TableField(value="xsa")
|
||||||
|
@Schema(description="xsa")
|
||||||
|
private BigDecimal xsa;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* xsavv
|
||||||
|
*/
|
||||||
|
@TableField(value="xsavv")
|
||||||
|
@Schema(description="xsavv")
|
||||||
|
private BigDecimal xsavv;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* xsmxv
|
||||||
|
*/
|
||||||
|
@TableField(value="xsmxv")
|
||||||
|
@Schema(description="xsmxv")
|
||||||
|
private BigDecimal xsmxv;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* flwchrcd
|
||||||
|
*/
|
||||||
|
@TableField(value="flwchrcd")
|
||||||
|
@Schema(description="flwchrcd")
|
||||||
|
@Size(max = 4,message = "flwchrcd最大长度要小于 4")
|
||||||
|
private String flwchrcd;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* wptn
|
||||||
|
*/
|
||||||
|
@TableField(value="wptn")
|
||||||
|
@Schema(description="wptn")
|
||||||
|
@Size(max = 4,message = "wptn最大长度要小于 4")
|
||||||
|
private String wptn;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* msqmt
|
||||||
|
*/
|
||||||
|
@TableField(value="msqmt")
|
||||||
|
@Schema(description="msqmt")
|
||||||
|
@Size(max = 4,message = "msqmt最大长度要小于 4")
|
||||||
|
private String msqmt;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* msamt
|
||||||
|
*/
|
||||||
|
@TableField(value="msamt")
|
||||||
|
@Schema(description="msamt")
|
||||||
|
@Size(max = 4,message = "msamt最大长度要小于 4")
|
||||||
|
private String msamt;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* msvmt
|
||||||
|
*/
|
||||||
|
@TableField(value="msvmt")
|
||||||
|
@Schema(description="msvmt")
|
||||||
|
@Size(max = 4,message = "msvmt最大长度要小于 4")
|
||||||
|
private String msvmt;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* chtm
|
||||||
|
*/
|
||||||
|
@TableField(value="chtm")
|
||||||
|
@Schema(description="chtm")
|
||||||
|
@JsonFormat(pattern = DateFormatString.YYYY_MM_DD_HH_MM_SS, timezone = "GMT+8")
|
||||||
|
private Date chtm;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* sendtm
|
||||||
|
*/
|
||||||
|
@TableField(value="sendtm")
|
||||||
|
@Schema(description="sendtm")
|
||||||
|
@JsonFormat(pattern = DateFormatString.YYYY_MM_DD_HH_MM_SS, timezone = "GMT+8")
|
||||||
|
private Date sendtm;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* receivetm
|
||||||
|
*/
|
||||||
|
@TableField(value="receivetm")
|
||||||
|
@Schema(description="receivetm")
|
||||||
|
@JsonFormat(pattern = DateFormatString.YYYY_MM_DD_HH_MM_SS, timezone = "GMT+8")
|
||||||
|
private Date receivetm;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* source_int
|
||||||
|
*/
|
||||||
|
@TableField(value="source_int")
|
||||||
|
@Schema(description="source_int")
|
||||||
|
private Integer sourceInt;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,164 @@
|
||||||
|
package com.gunshi.project.xyt.model;
|
||||||
|
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
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 jakarta.validation.constraints.NotBlank;
|
||||||
|
import jakarta.validation.constraints.NotNull;
|
||||||
|
import jakarta.validation.constraints.Size;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 描述:
|
||||||
|
* author: cxw
|
||||||
|
* date: 2024-09-24 14:01:07
|
||||||
|
*/
|
||||||
|
@Schema(description="")
|
||||||
|
@Data
|
||||||
|
@TableName("public.st_river_r_real")
|
||||||
|
public class StRiverRReal implements Serializable {
|
||||||
|
|
||||||
|
public final static String thisTableName = "StRiverRReal";
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* stcd
|
||||||
|
*/
|
||||||
|
@TableId(value="stcd", type= IdType.AUTO)
|
||||||
|
@Schema(description="stcd")
|
||||||
|
@Size(max = 20,message = "stcd最大长度要小于 20")
|
||||||
|
@NotBlank(message = "stcd不能为空")
|
||||||
|
@NotNull(message = "stcd不能为空")
|
||||||
|
private String stcd;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* tm
|
||||||
|
*/
|
||||||
|
@TableField(value="tm")
|
||||||
|
@Schema(description="tm")
|
||||||
|
@JsonFormat(pattern = DateFormatString.YYYY_MM_DD_HH_MM_SS, timezone = "GMT+8")
|
||||||
|
private Date tm;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* z
|
||||||
|
*/
|
||||||
|
@TableField(value="z")
|
||||||
|
@Schema(description="z")
|
||||||
|
private BigDecimal z;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* q
|
||||||
|
*/
|
||||||
|
@TableField(value="q")
|
||||||
|
@Schema(description="q")
|
||||||
|
private BigDecimal q;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* xsa
|
||||||
|
*/
|
||||||
|
@TableField(value="xsa")
|
||||||
|
@Schema(description="xsa")
|
||||||
|
private BigDecimal xsa;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* xsavv
|
||||||
|
*/
|
||||||
|
@TableField(value="xsavv")
|
||||||
|
@Schema(description="xsavv")
|
||||||
|
private BigDecimal xsavv;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* xsmxv
|
||||||
|
*/
|
||||||
|
@TableField(value="xsmxv")
|
||||||
|
@Schema(description="xsmxv")
|
||||||
|
private BigDecimal xsmxv;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* flwchrcdf
|
||||||
|
*/
|
||||||
|
@TableField(value="flwchrcdf")
|
||||||
|
@Schema(description="flwchrcdf")
|
||||||
|
@Size(max = 1,message = "flwchrcdf最大长度要小于 1")
|
||||||
|
private String flwchrcdf;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* wptn
|
||||||
|
*/
|
||||||
|
@TableField(value="wptn")
|
||||||
|
@Schema(description="wptn")
|
||||||
|
@Size(max = 1,message = "wptn最大长度要小于 1")
|
||||||
|
private String wptn;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* maxz
|
||||||
|
*/
|
||||||
|
@TableField(value="maxz")
|
||||||
|
@Schema(description="maxz")
|
||||||
|
private BigDecimal maxz;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* maxtm
|
||||||
|
*/
|
||||||
|
@TableField(value="maxtm")
|
||||||
|
@Schema(description="maxtm")
|
||||||
|
@JsonFormat(pattern = DateFormatString.YYYY_MM_DD_HH_MM_SS, timezone = "GMT+8")
|
||||||
|
private Date maxtm;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* msqmt
|
||||||
|
*/
|
||||||
|
@TableField(value="msqmt")
|
||||||
|
@Schema(description="msqmt")
|
||||||
|
@Size(max = 1,message = "msqmt最大长度要小于 1")
|
||||||
|
private String msqmt;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* msamt
|
||||||
|
*/
|
||||||
|
@TableField(value="msamt")
|
||||||
|
@Schema(description="msamt")
|
||||||
|
@Size(max = 1,message = "msamt最大长度要小于 1")
|
||||||
|
private String msamt;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* msvmt
|
||||||
|
*/
|
||||||
|
@TableField(value="msvmt")
|
||||||
|
@Schema(description="msvmt")
|
||||||
|
@Size(max = 1,message = "msvmt最大长度要小于 1")
|
||||||
|
private String msvmt;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* chtm
|
||||||
|
*/
|
||||||
|
@TableField(value="chtm")
|
||||||
|
@Schema(description="chtm")
|
||||||
|
@JsonFormat(pattern = DateFormatString.YYYY_MM_DD_HH_MM_SS, timezone = "GMT+8")
|
||||||
|
private Date chtm;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* warning
|
||||||
|
*/
|
||||||
|
@TableField(value="warning")
|
||||||
|
@Schema(description="warning")
|
||||||
|
private Integer warning;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* status
|
||||||
|
*/
|
||||||
|
@TableField(value="status")
|
||||||
|
@Schema(description="status")
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,25 @@
|
||||||
|
package com.gunshi.project.xyt.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.gunshi.project.xyt.mapper.StRiverRRealMapper;
|
||||||
|
import com.gunshi.project.xyt.model.StRiverRReal;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 描述:
|
||||||
|
* author: cxw
|
||||||
|
* date: 2024-09-24 14:01:07
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@Slf4j
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public class StRiverRRealService extends ServiceImpl<StRiverRRealMapper, StRiverRReal>
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,23 @@
|
||||||
|
package com.gunshi.project.xyt.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.gunshi.project.xyt.mapper.StRiverRMapper;
|
||||||
|
import com.gunshi.project.xyt.model.StRiverR;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 描述:
|
||||||
|
* author: cxw
|
||||||
|
* date: 2024-09-24 14:01:07
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@Slf4j
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public class StRiverRService extends ServiceImpl<StRiverRMapper, StRiverR>
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -9,16 +9,19 @@ import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
|
||||||
import com.gunshi.project.xyt.model.StPptnR;
|
import com.gunshi.project.xyt.model.StPptnR;
|
||||||
import com.gunshi.project.xyt.model.StPptnRD;
|
import com.gunshi.project.xyt.model.StPptnRD;
|
||||||
import com.gunshi.project.xyt.model.StPptnRH;
|
import com.gunshi.project.xyt.model.StPptnRH;
|
||||||
|
import com.gunshi.project.xyt.model.StRiverR;
|
||||||
|
import com.gunshi.project.xyt.model.StRiverRReal;
|
||||||
import com.gunshi.project.xyt.model.StRsvrR;
|
import com.gunshi.project.xyt.model.StRsvrR;
|
||||||
import com.gunshi.project.xyt.model.StRsvrRReal;
|
import com.gunshi.project.xyt.model.StRsvrRReal;
|
||||||
import com.gunshi.project.xyt.service.StPptnRDService;
|
import com.gunshi.project.xyt.service.StPptnRDService;
|
||||||
import com.gunshi.project.xyt.service.StPptnRHService;
|
import com.gunshi.project.xyt.service.StPptnRHService;
|
||||||
import com.gunshi.project.xyt.service.StPptnRRealService;
|
import com.gunshi.project.xyt.service.StPptnRRealService;
|
||||||
import com.gunshi.project.xyt.service.StPptnRService;
|
import com.gunshi.project.xyt.service.StPptnRService;
|
||||||
|
import com.gunshi.project.xyt.service.StRiverRRealService;
|
||||||
|
import com.gunshi.project.xyt.service.StRiverRService;
|
||||||
import com.gunshi.project.xyt.service.StRsvrRRealService;
|
import com.gunshi.project.xyt.service.StRsvrRRealService;
|
||||||
import com.gunshi.project.xyt.service.StRsvrRService;
|
import com.gunshi.project.xyt.service.StRsvrRService;
|
||||||
import com.gunshi.project.xyt.util.OkHttpUtil;
|
import com.gunshi.project.xyt.util.OkHttpUtil;
|
||||||
import com.ruoyi.common.utils.StringUtils;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import okhttp3.FormBody;
|
import okhttp3.FormBody;
|
||||||
import okhttp3.OkHttpClient;
|
import okhttp3.OkHttpClient;
|
||||||
|
|
@ -75,7 +78,7 @@ public class DataTaskTSG {
|
||||||
public static String jcskPathPptnRoute = "/pptn/";// 雨情接口,需拼接源(sh、sw、qx)
|
public static String jcskPathPptnRoute = "/pptn/";// 雨情接口,需拼接源(sh、sw、qx)
|
||||||
|
|
||||||
public static String jcskPathRrRiverRoute = "/rsvr/";// RR水库水位接口
|
public static String jcskPathRrRiverRoute = "/rsvr/";// RR水库水位接口
|
||||||
public static String jcskPathZzRiverRoute = "/river/";// ZZ河道水位接口
|
public static String jcskPathZzRsvrRoute = "/river/";// ZZ河道水位接口
|
||||||
|
|
||||||
// 实时雨情
|
// 实时雨情
|
||||||
@Autowired
|
@Autowired
|
||||||
|
|
@ -101,6 +104,13 @@ public class DataTaskTSG {
|
||||||
@Autowired
|
@Autowired
|
||||||
private StRsvrRService stRsvrRService;
|
private StRsvrRService stRsvrRService;
|
||||||
|
|
||||||
|
// 实时水情
|
||||||
|
@Autowired
|
||||||
|
private StRiverRRealService stRiverRRealService;
|
||||||
|
|
||||||
|
// 历史水情
|
||||||
|
@Autowired
|
||||||
|
private StRiverRService stRiverRService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param
|
* @param
|
||||||
|
|
@ -264,7 +274,7 @@ public class DataTaskTSG {
|
||||||
if ("rr".equals(sttp)) {
|
if ("rr".equals(sttp)) {
|
||||||
url += jcskPathRrRiverRoute + source;
|
url += jcskPathRrRiverRoute + source;
|
||||||
} else if ("zz".equals(sttp)) {
|
} else if ("zz".equals(sttp)) {
|
||||||
url += jcskPathZzRiverRoute + source;
|
url += jcskPathZzRsvrRoute + source;
|
||||||
} else {
|
} else {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
@ -283,12 +293,19 @@ public class DataTaskTSG {
|
||||||
}
|
}
|
||||||
JSONArray data = jsonObject.getJSONArray("data");
|
JSONArray data = jsonObject.getJSONArray("data");
|
||||||
if (CollectionUtils.isNotEmpty(data)) {
|
if (CollectionUtils.isNotEmpty(data)) {
|
||||||
|
if ("zz".equals(sttp)) {
|
||||||
|
List<StRiverR> rlist = data.toJavaList(StRiverR.class);
|
||||||
|
stRiverRService.saveBatch(rlist);
|
||||||
|
// 更新实时表数据
|
||||||
|
StRiverR stRiverRLast = rlist.get(rlist.size() - 1);
|
||||||
|
StRiverRReal stRiverRReal = new StRiverRReal();
|
||||||
|
UpdateWrapper<StRiverRReal> updateWrapper = new UpdateWrapper<>();
|
||||||
|
updateWrapper.eq("stcd", stRiverRLast.getStcd()).eq("tm", stRiverRLast.getTm());
|
||||||
|
BeanUtils.copyProperties(stRiverRLast, stRiverRReal);
|
||||||
|
stRiverRReal.setChtm(new Date());
|
||||||
|
stRiverRRealService.saveOrUpdate(stRiverRReal, updateWrapper);
|
||||||
|
} else if ("rr".equals(sttp)) {
|
||||||
List<StRsvrR> rlist = data.toJavaList(StRsvrR.class);
|
List<StRsvrR> rlist = data.toJavaList(StRsvrR.class);
|
||||||
for (StRsvrR rsvrR : rlist) {
|
|
||||||
if (StringUtils.isEmpty(rsvrR.getRz()) && StringUtils.isNotEmpty(rsvrR.getZ())) {
|
|
||||||
rsvrR.setRz(rsvrR.getZ());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
stRsvrRService.saveBatch(rlist);
|
stRsvrRService.saveBatch(rlist);
|
||||||
// 更新实时表数据
|
// 更新实时表数据
|
||||||
StRsvrR stRsvrRLast = rlist.get(rlist.size() - 1);
|
StRsvrR stRsvrRLast = rlist.get(rlist.size() - 1);
|
||||||
|
|
@ -301,6 +318,7 @@ public class DataTaskTSG {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
log.error("水情历史定时任务错误:", e.getMessage());
|
log.error("水情历史定时任务错误:", e.getMessage());
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,5 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.gunshi.project.xyt.mapper.StRiverRMapper">
|
||||||
|
|
||||||
|
</mapper>
|
||||||
|
|
@ -0,0 +1,5 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.gunshi.project.xyt.mapper.StRiverRRealMapper">
|
||||||
|
|
||||||
|
</mapper>
|
||||||
|
|
@ -4,13 +4,16 @@
|
||||||
|
|
||||||
<select id="getStcdLastRsvrData" resultType="com.gunshi.project.xyt.model.StRsvrR">
|
<select id="getStcdLastRsvrData" resultType="com.gunshi.project.xyt.model.StRsvrR">
|
||||||
SELECT stb.stcd,
|
SELECT stb.stcd,
|
||||||
r.tm stm,
|
case UPPER(stb.sttp) when 'RR' then r2.tm when 'ZZ' then r.tm end stm,
|
||||||
stb.source,
|
stb.source,
|
||||||
stb.sttp
|
stb.sttp
|
||||||
FROM public.st_stbprp_b stb
|
FROM public.st_stbprp_b stb
|
||||||
LEFT JOIN (SELECT *
|
LEFT JOIN (SELECT *
|
||||||
FROM (SELECT *, ROW_NUMBER() OVER ( PARTITION BY stcd ORDER BY tm DESC ) AS rn FROM public.st_rsvr_r) subquery
|
FROM (SELECT *, ROW_NUMBER() OVER ( PARTITION BY stcd ORDER BY tm DESC ) AS rn FROM public.st_rsvr_r) subquery
|
||||||
WHERE subquery.rn = 1) r ON stb.stcd = r.stcd
|
WHERE subquery.rn = 1) r ON stb.stcd = r.stcd
|
||||||
WHERE stb.source in ('QX', 'SW', 'SH')
|
LEFT JOIN (SELECT *
|
||||||
|
FROM (SELECT *, ROW_NUMBER() OVER ( PARTITION BY stcd ORDER BY tm DESC ) AS rn FROM public.st_river_r) subquery2
|
||||||
|
WHERE subquery2.rn = 1) r2 ON stb.stcd = r.stcd
|
||||||
|
WHERE stb.source in ('SW', 'SH')
|
||||||
</select>
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue