段飞宇
1 year ago
40 changed files with 1923 additions and 0 deletions
@ -0,0 +1,20 @@ |
|||||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0" |
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
||||||
|
<modelVersion>4.0.0</modelVersion> |
||||||
|
<parent> |
||||||
|
<groupId>com.hnac.hzims</groupId> |
||||||
|
<artifactId>hzims-service-api</artifactId> |
||||||
|
<version>4.0.0-SNAPSHOT</version> |
||||||
|
</parent> |
||||||
|
|
||||||
|
<artifactId>water-quality-api</artifactId> |
||||||
|
|
||||||
|
<properties> |
||||||
|
<maven.compiler.source>8</maven.compiler.source> |
||||||
|
<maven.compiler.target>8</maven.compiler.target> |
||||||
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> |
||||||
|
</properties> |
||||||
|
|
||||||
|
</project> |
@ -0,0 +1,24 @@ |
|||||||
|
package com.hnac.hzims.waterquality.entity; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType; |
||||||
|
import com.baomidou.mybatisplus.annotation.TableId; |
||||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||||
|
import io.swagger.annotations.ApiModelProperty; |
||||||
|
import lombok.Data; |
||||||
|
|
||||||
|
import java.io.Serializable; |
||||||
|
|
||||||
|
/** |
||||||
|
*水质监测指标配置 |
||||||
|
*/ |
||||||
|
@Data |
||||||
|
@TableName("wq_config_d") |
||||||
|
public class WqConfigD implements Serializable { |
||||||
|
@ApiModelProperty("测站编码") |
||||||
|
@TableId(type=IdType.INPUT) |
||||||
|
private String stcd; |
||||||
|
@ApiModelProperty("指标类型") |
||||||
|
private String type; |
||||||
|
@ApiModelProperty("指标值") |
||||||
|
private String value; |
||||||
|
} |
@ -0,0 +1,54 @@ |
|||||||
|
package com.hnac.hzims.waterquality.entity; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||||
|
import io.swagger.annotations.ApiModelProperty; |
||||||
|
import lombok.Data; |
||||||
|
import lombok.EqualsAndHashCode; |
||||||
|
import org.springblade.core.mp.base.BaseEntity; |
||||||
|
|
||||||
|
|
||||||
|
/** |
||||||
|
*水功能区基本信息 |
||||||
|
*/ |
||||||
|
@Data |
||||||
|
@TableName("wq_wfrinf_b") |
||||||
|
@EqualsAndHashCode(callSuper = true) |
||||||
|
public class WqWfrinfB extends BaseEntity { |
||||||
|
@ApiModelProperty("水功能区代码") |
||||||
|
private String wfrcd; |
||||||
|
@ApiModelProperty("水功能区名称") |
||||||
|
private String wfrnm; |
||||||
|
@ApiModelProperty("流域名称") |
||||||
|
private String bsnm; |
||||||
|
@ApiModelProperty("水系名称") |
||||||
|
private String hnnm; |
||||||
|
@ApiModelProperty("河流名称") |
||||||
|
private String rvnm; |
||||||
|
@ApiModelProperty("水功能区起始断面名称") |
||||||
|
private String wfrscsnm; |
||||||
|
@ApiModelProperty("水功能区起始断面经度") |
||||||
|
private Double wfrscslgtd; |
||||||
|
@ApiModelProperty("水功能区起始断面纬度") |
||||||
|
private Double wfrscslttd; |
||||||
|
@ApiModelProperty("水功能区终止断面名称") |
||||||
|
private String wfrecsnm; |
||||||
|
@ApiModelProperty("水功能区终止断面经度") |
||||||
|
private Double wfrecslgtd; |
||||||
|
@ApiModelProperty("水功能区终止断面纬度") |
||||||
|
private Double wfrecslttd; |
||||||
|
|
||||||
|
@ApiModelProperty("行政区划码") |
||||||
|
private String addvcd; |
||||||
|
@ApiModelProperty("水功能区长度") |
||||||
|
private Double wfrln; |
||||||
|
@ApiModelProperty("水功能区库容") |
||||||
|
private Double wfrrc; |
||||||
|
@ApiModelProperty("水功能区面积") |
||||||
|
private Double wfrar; |
||||||
|
@ApiModelProperty("水功能区水质目标") |
||||||
|
private String wfrwqt; |
||||||
|
@ApiModelProperty("水功能区功能排序") |
||||||
|
private String wfrwfo; |
||||||
|
@ApiModelProperty("备注") |
||||||
|
private String nt; |
||||||
|
} |
@ -0,0 +1,59 @@ |
|||||||
|
package com.hnac.hzims.waterquality.entity; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat; |
||||||
|
import io.swagger.annotations.ApiModelProperty; |
||||||
|
import lombok.Data; |
||||||
|
import lombok.EqualsAndHashCode; |
||||||
|
import org.springblade.core.mp.base.BaseEntity; |
||||||
|
|
||||||
|
import java.util.Date; |
||||||
|
|
||||||
|
/** |
||||||
|
*水质监测站 |
||||||
|
*/ |
||||||
|
@Data |
||||||
|
@TableName("wq_wqsinf_b") |
||||||
|
@EqualsAndHashCode(callSuper = true) |
||||||
|
public class WqWqsinfB extends BaseEntity { |
||||||
|
@ApiModelProperty("测站编码") |
||||||
|
private String stcd; |
||||||
|
@ApiModelProperty("测站名称") |
||||||
|
private String stnm; |
||||||
|
@ApiModelProperty("测站等级") |
||||||
|
private String stgrd; |
||||||
|
@ApiModelProperty("流域名称") |
||||||
|
private String bsnm; |
||||||
|
@ApiModelProperty("水系名称") |
||||||
|
private String hnnm; |
||||||
|
@ApiModelProperty("河流名称") |
||||||
|
private String rvnm; |
||||||
|
@ApiModelProperty("经度") |
||||||
|
private Double lgtd; |
||||||
|
@ApiModelProperty("纬度") |
||||||
|
private Double lttd; |
||||||
|
@ApiModelProperty("站址") |
||||||
|
private String stlc; |
||||||
|
@ApiModelProperty("行政区划码") |
||||||
|
private String addvcd; |
||||||
|
@ApiModelProperty("水资源分区码") |
||||||
|
private String wrrcd; |
||||||
|
@ApiModelProperty("水功能区划码") |
||||||
|
private String wfrcd; |
||||||
|
@ApiModelProperty("管理单位") |
||||||
|
private String adag; |
||||||
|
@ApiModelProperty("监测单位") |
||||||
|
private String mnag; |
||||||
|
@ApiModelProperty("监测频次") |
||||||
|
private Integer mnfrq; |
||||||
|
@ApiModelProperty("自动监测") |
||||||
|
private Integer atmn; |
||||||
|
@ApiModelProperty("建站年月") |
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd") |
||||||
|
private Date esstym; |
||||||
|
@ApiModelProperty("撤站年月") |
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd") |
||||||
|
private Date wdstym; |
||||||
|
@ApiModelProperty("备注") |
||||||
|
private String nt; |
||||||
|
} |
@ -0,0 +1,22 @@ |
|||||||
|
package com.hnac.hzims.waterquality.entity; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||||
|
import io.swagger.annotations.ApiModelProperty; |
||||||
|
import lombok.Data; |
||||||
|
import org.springblade.core.mp.base.BaseEntity; |
||||||
|
|
||||||
|
|
||||||
|
/** |
||||||
|
* 水资源分区基本信息 |
||||||
|
*/ |
||||||
|
@Data |
||||||
|
@TableName("wq_wrrinf_b") |
||||||
|
public class WqWrrinfB extends BaseEntity { |
||||||
|
@ApiModelProperty("水资源分区码") |
||||||
|
private String wrrcd; |
||||||
|
@ApiModelProperty("水资源分区名称") |
||||||
|
private String wrrnm; |
||||||
|
@ApiModelProperty("水资源分区面积") |
||||||
|
private Double wrr5r; |
||||||
|
|
||||||
|
} |
@ -0,0 +1,50 @@ |
|||||||
|
/* |
||||||
|
* Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
||||||
|
* |
||||||
|
* Redistribution and use in source and binary forms, with or without |
||||||
|
* modification, are permitted provided that the following conditions are met: |
||||||
|
* |
||||||
|
* Redistributions of source code must retain the above copyright Example, |
||||||
|
* this list of conditions and the following disclaimer. |
||||||
|
* Redistributions in binary form must reproduce the above copyright |
||||||
|
* Example, this list of conditions and the following disclaimer in the |
||||||
|
* documentation and/or other materials provided with the distribution. |
||||||
|
* Neither the name of the dreamlu.net developer nor the names of its |
||||||
|
* contributors may be used to endorse or promote products derived from |
||||||
|
* this software without specific prior written permission. |
||||||
|
* Author: Chill 庄骞 (smallchill@163.com) |
||||||
|
*/ |
||||||
|
package com.hnac.hzims.waterquality.feign; |
||||||
|
|
||||||
|
import com.hnac.hzims.waterquality.vo.WqWqsinfBVo; |
||||||
|
import org.springblade.core.launch.constant.AppConstant; |
||||||
|
import org.springblade.core.tool.api.R; |
||||||
|
import org.springframework.cloud.openfeign.FeignClient; |
||||||
|
import org.springframework.web.bind.annotation.GetMapping; |
||||||
|
import org.springframework.web.bind.annotation.RequestParam; |
||||||
|
|
||||||
|
import java.util.List; |
||||||
|
|
||||||
|
/** |
||||||
|
* Example Feign接口类 |
||||||
|
* |
||||||
|
* @author Chill |
||||||
|
*/ |
||||||
|
@FeignClient( |
||||||
|
value = AppConstant.APPLICATION_DESK_NAME |
||||||
|
) |
||||||
|
public interface IWqWqsinfBClient { |
||||||
|
|
||||||
|
String API_PREFIX = "/wqWqsinfBClient"; |
||||||
|
String LIST = API_PREFIX + "/list"; |
||||||
|
|
||||||
|
/** |
||||||
|
* 获取Example列表 |
||||||
|
* |
||||||
|
* @param number |
||||||
|
* @return |
||||||
|
*/ |
||||||
|
@GetMapping(LIST) |
||||||
|
R<List<WqWqsinfBVo>> list(@RequestParam("number") Integer number); |
||||||
|
|
||||||
|
} |
@ -0,0 +1,7 @@ |
|||||||
|
package com.hnac.hzims.waterquality.vo; |
||||||
|
|
||||||
|
|
||||||
|
import com.hnac.hzims.waterquality.entity.WqWqsinfB; |
||||||
|
|
||||||
|
public class WqWqsinfBVo extends WqWqsinfB { |
||||||
|
} |
@ -0,0 +1,68 @@ |
|||||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0" |
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
||||||
|
<modelVersion>4.0.0</modelVersion> |
||||||
|
<parent> |
||||||
|
<groupId>com.hnac.hzims</groupId> |
||||||
|
<artifactId>hzims-service</artifactId> |
||||||
|
<version>4.0.0-SNAPSHOT</version> |
||||||
|
</parent> |
||||||
|
|
||||||
|
<artifactId>water-quality</artifactId> |
||||||
|
|
||||||
|
<properties> |
||||||
|
<maven.compiler.source>8</maven.compiler.source> |
||||||
|
<maven.compiler.target>8</maven.compiler.target> |
||||||
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> |
||||||
|
</properties> |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<dependencies> |
||||||
|
<dependency> |
||||||
|
<groupId>org.springblade</groupId> |
||||||
|
<artifactId>blade-core-boot</artifactId> |
||||||
|
</dependency> |
||||||
|
<dependency> |
||||||
|
<groupId>org.springblade</groupId> |
||||||
|
<artifactId>blade-starter-swagger</artifactId> |
||||||
|
</dependency> |
||||||
|
<dependency> |
||||||
|
<groupId>org.springblade</groupId> |
||||||
|
<artifactId>blade-starter-oss-all</artifactId> |
||||||
|
</dependency> |
||||||
|
<dependency> |
||||||
|
<groupId>com.baomidou</groupId> |
||||||
|
<artifactId>dynamic-datasource-spring-boot-starter</artifactId> |
||||||
|
</dependency> |
||||||
|
<dependency> |
||||||
|
<groupId>org.springblade</groupId> |
||||||
|
<artifactId>blade-core-test</artifactId> |
||||||
|
<scope>test</scope> |
||||||
|
</dependency> |
||||||
|
<dependency> |
||||||
|
<groupId>org.springblade</groupId> |
||||||
|
<artifactId>blade-core-auto</artifactId> |
||||||
|
<scope>compile</scope> |
||||||
|
</dependency> |
||||||
|
<dependency> |
||||||
|
<groupId>com.hnac.hzims</groupId> |
||||||
|
<artifactId>water-quality-api</artifactId> |
||||||
|
<version>${hzims.project.version}</version> |
||||||
|
<scope>compile</scope> |
||||||
|
</dependency> |
||||||
|
<dependency> |
||||||
|
<groupId>org.springblade</groupId> |
||||||
|
<artifactId>blade-common</artifactId> |
||||||
|
</dependency> |
||||||
|
<dependency> |
||||||
|
<groupId>com.hnac.hzinfo.data</groupId> |
||||||
|
<artifactId>hzinfo-data-sdk</artifactId> |
||||||
|
</dependency> |
||||||
|
<dependency> |
||||||
|
<groupId>com.hnac.hzims</groupId> |
||||||
|
<artifactId>common-api</artifactId> |
||||||
|
</dependency> |
||||||
|
</dependencies> |
||||||
|
</project> |
@ -0,0 +1,51 @@ |
|||||||
|
/* |
||||||
|
* Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
||||||
|
* |
||||||
|
* Redistribution and use in source and binary forms, with or without |
||||||
|
* modification, are permitted provided that the following conditions are met: |
||||||
|
* |
||||||
|
* Redistributions of source code must retain the above copyright Example, |
||||||
|
* this list of conditions and the following disclaimer. |
||||||
|
* Redistributions in binary form must reproduce the above copyright |
||||||
|
* Example, this list of conditions and the following disclaimer in the |
||||||
|
* documentation and/or other materials provided with the distribution. |
||||||
|
* Neither the name of the dreamlu.net developer nor the names of its |
||||||
|
* contributors may be used to endorse or promote products derived from |
||||||
|
* this software without specific prior written permission. |
||||||
|
* Author: Chill 庄骞 (smallchill@163.com) |
||||||
|
*/ |
||||||
|
package com.hnac.hzims.waterquality; |
||||||
|
|
||||||
|
import org.mybatis.spring.annotation.MapperScan; |
||||||
|
import org.springblade.core.cloud.feign.EnableBladeFeign; |
||||||
|
import org.springblade.core.launch.BladeApplication; |
||||||
|
import org.springframework.boot.builder.SpringApplicationBuilder; |
||||||
|
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; |
||||||
|
import org.springframework.cloud.client.SpringCloudApplication; |
||||||
|
import org.springframework.context.annotation.ComponentScan; |
||||||
|
import org.springframework.scheduling.annotation.EnableScheduling; |
||||||
|
|
||||||
|
/** |
||||||
|
* Demo启动器 |
||||||
|
* |
||||||
|
* @author Chill |
||||||
|
*/ |
||||||
|
@EnableBladeFeign(basePackages = {"org.springblade","com.hnac"}) |
||||||
|
@SpringCloudApplication |
||||||
|
@MapperScan("com.hnac.hzims.**.mapper.**") |
||||||
|
@EnableScheduling |
||||||
|
@ComponentScan(basePackages = {"com.hnac.hzims.*"}) |
||||||
|
public class WaterQualityApplication extends SpringBootServletInitializer { |
||||||
|
|
||||||
|
static String APPLICATION_NAME="water-quality"; |
||||||
|
|
||||||
|
public static void main(String[] args) { |
||||||
|
BladeApplication.run(APPLICATION_NAME, WaterQualityApplication.class, args); |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) { |
||||||
|
return BladeApplication.createSpringApplicationBuilder(builder, APPLICATION_NAME, WaterQualityApplication.class); |
||||||
|
} |
||||||
|
} |
||||||
|
|
@ -0,0 +1,125 @@ |
|||||||
|
package com.hnac.hzims.waterquality.controller; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||||
|
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
||||||
|
import com.hnac.hzims.waterquality.entity.WqConfigD; |
||||||
|
import com.hnac.hzims.waterquality.service.IWqConfigDService; |
||||||
|
import com.hnac.hzims.waterquality.util.ParamUtil; |
||||||
|
import io.swagger.annotations.*; |
||||||
|
import lombok.AllArgsConstructor; |
||||||
|
import org.apache.commons.lang3.StringUtils; |
||||||
|
import org.springblade.common.cache.CacheNames; |
||||||
|
import org.springblade.core.boot.ctrl.BladeController; |
||||||
|
import org.springblade.core.mp.support.Condition; |
||||||
|
import org.springblade.core.mp.support.Query; |
||||||
|
import org.springblade.core.tool.api.R; |
||||||
|
import org.springblade.core.tool.utils.Func; |
||||||
|
import org.springframework.web.bind.annotation.*; |
||||||
|
import springfox.documentation.annotations.ApiIgnore; |
||||||
|
|
||||||
|
import java.util.ArrayList; |
||||||
|
import java.util.List; |
||||||
|
import java.util.Map; |
||||||
|
|
||||||
|
@RestController |
||||||
|
@RequestMapping("/waterQuality/wqConfigD") |
||||||
|
@AllArgsConstructor |
||||||
|
@Api(value = "水质监测指标配置", tags = "水质监测指标配置接口") |
||||||
|
public class WqConfigDController extends BladeController implements CacheNames { |
||||||
|
|
||||||
|
private final IWqConfigDService wqConfigDService; |
||||||
|
|
||||||
|
|
||||||
|
/** |
||||||
|
* 分页 |
||||||
|
*/ |
||||||
|
|
||||||
|
@GetMapping("/pageList") |
||||||
|
@ApiImplicitParams({ |
||||||
|
@ApiImplicitParam(name = "stcd", value = "测站编码", paramType = "query", dataType = "string") |
||||||
|
}) |
||||||
|
@ApiOperationSupport(order = 1) |
||||||
|
@ApiOperation(value = "分页", notes = "传入wqConfigD") |
||||||
|
public R<IPage<WqConfigD>> pageList(@ApiIgnore @RequestParam Map<String, Object> param, Query query) { |
||||||
|
LambdaQueryWrapper<WqConfigD> wrapper= ParamUtil.conditionWqConfigD(param); |
||||||
|
IPage<WqConfigD> pages = wqConfigDService.page(Condition.getPage(query), wrapper); |
||||||
|
return R.data(pages); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 列表 |
||||||
|
*/ |
||||||
|
|
||||||
|
@GetMapping("/list") |
||||||
|
@ApiImplicitParams({ |
||||||
|
@ApiImplicitParam(name = "stcd", value = "测站编码", paramType = "query", dataType = "string") |
||||||
|
}) |
||||||
|
@ApiOperationSupport(order = 2) |
||||||
|
@ApiOperation(value = "列表", notes = "传入wqConfigD") |
||||||
|
public R<List<WqConfigD>> list(@ApiIgnore @RequestParam Map<String, Object> param) { |
||||||
|
LambdaQueryWrapper<WqConfigD> wrapper=ParamUtil.conditionWqConfigD(param); |
||||||
|
List<WqConfigD> list = wqConfigDService.list(wrapper); |
||||||
|
return R.data(list); |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
/** |
||||||
|
* 详情 |
||||||
|
*/ |
||||||
|
|
||||||
|
@GetMapping("/detail") |
||||||
|
@ApiOperationSupport(order = 3) |
||||||
|
@ApiOperation(value = "详情", notes = "传入wqConfigD") |
||||||
|
public R<WqConfigD> detail(WqConfigD wqConfigD) { |
||||||
|
WqConfigD detail = wqConfigDService.getOne(Condition.getQueryWrapper(wqConfigD)); |
||||||
|
return R.data(detail); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 新增 |
||||||
|
*/ |
||||||
|
|
||||||
|
@PostMapping("/save") |
||||||
|
@ApiOperationSupport(order = 4) |
||||||
|
@ApiOperation(value = "新增", notes = "传入wqConfigD") |
||||||
|
public R save(@RequestBody Map<String,Object> param) { |
||||||
|
String stcd=String.valueOf(param.get("stcd")); |
||||||
|
if(StringUtils.isBlank(stcd)){ |
||||||
|
return R.fail("未传递测站编码"); |
||||||
|
} |
||||||
|
List<Map<String,Object>> list=(List<Map<String,Object>>)param.get("list"); |
||||||
|
List<WqConfigD> wqConfigDs=new ArrayList<>(); |
||||||
|
for(Map<String,Object> data:list){ |
||||||
|
WqConfigD wqConfigD=new WqConfigD(); |
||||||
|
wqConfigD.setStcd(stcd); |
||||||
|
wqConfigD.setType(String.valueOf(data.get("type"))); |
||||||
|
wqConfigD.setValue(String.valueOf(data.get("value"))); |
||||||
|
wqConfigDs.add(wqConfigD); |
||||||
|
} |
||||||
|
if(wqConfigDs==null || wqConfigDs.isEmpty()){ |
||||||
|
return R.fail("未传递配置参数"); |
||||||
|
} |
||||||
|
|
||||||
|
LambdaQueryWrapper<WqConfigD> wrapper=new LambdaQueryWrapper(); |
||||||
|
wrapper.eq(WqConfigD::getStcd,stcd); |
||||||
|
return R.status(wqConfigDService.batchSave(wqConfigDs,wrapper)); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 删除 |
||||||
|
*/ |
||||||
|
|
||||||
|
@PostMapping("/remove") |
||||||
|
@ApiOperationSupport(order = 6) |
||||||
|
@ApiOperation(value = "逻辑删除", notes = "stcd") |
||||||
|
public R remove(@ApiParam(value = "测站编码集合") @RequestParam String stcd) { |
||||||
|
List<String> list=Func.toStrList(stcd); |
||||||
|
LambdaQueryWrapper<WqConfigD> wrapper=new LambdaQueryWrapper(); |
||||||
|
wrapper.in(WqConfigD::getStcd,list); |
||||||
|
boolean temp = wqConfigDService.delete(wrapper); |
||||||
|
return R.status(temp); |
||||||
|
} |
||||||
|
|
||||||
|
} |
||||||
|
|
@ -0,0 +1,179 @@ |
|||||||
|
package com.hnac.hzims.waterquality.controller; |
||||||
|
|
||||||
|
import com.hnac.hzims.entity.Report; |
||||||
|
import com.hnac.hzims.entity.ReportData; |
||||||
|
import com.hnac.hzims.enums.QueryDateTypeEnum; |
||||||
|
import com.hnac.hzims.util.CommonUtil; |
||||||
|
import com.hnac.hzims.waterquality.service.IWqDealDataService; |
||||||
|
import com.hnac.hzinfo.datasearch.analyse.domain.FieldsData; |
||||||
|
import com.hnac.hzinfo.datasearch.analyse.vo.AnalyzeInstanceFieldVO; |
||||||
|
import io.swagger.annotations.Api; |
||||||
|
import io.swagger.annotations.ApiOperation; |
||||||
|
import lombok.AllArgsConstructor; |
||||||
|
import org.springblade.common.cache.CacheNames; |
||||||
|
import org.springblade.core.boot.ctrl.BladeController; |
||||||
|
import org.springblade.core.tool.api.R; |
||||||
|
import org.springframework.web.bind.annotation.RequestMapping; |
||||||
|
import org.springframework.web.bind.annotation.RequestMethod; |
||||||
|
import org.springframework.web.bind.annotation.RestController; |
||||||
|
|
||||||
|
import java.util.Date; |
||||||
|
import java.util.List; |
||||||
|
import java.util.Map; |
||||||
|
|
||||||
|
@RestController |
||||||
|
@RequestMapping("/waterQuality/wqData") |
||||||
|
@AllArgsConstructor |
||||||
|
@Api(value = "水质数据查询接口", tags = "水质数据查询接口") |
||||||
|
public class WqDealDataController extends BladeController implements CacheNames { |
||||||
|
|
||||||
|
private final IWqDealDataService wqDealDataService; |
||||||
|
|
||||||
|
// DeviceClient deviceClient;
|
||||||
|
|
||||||
|
/** |
||||||
|
* |
||||||
|
* @param stcd |
||||||
|
* @param beginSpt |
||||||
|
* @param endSpt |
||||||
|
* @param type hour month year |
||||||
|
* @param accessRules 取数规则0=整点值、1=最大值、2=最小值、3=平均值、4=(累计值/和值)、5=(变化值/差值) 6=最新值 |
||||||
|
* @return |
||||||
|
*/ |
||||||
|
|
||||||
|
@ApiOperation("基础数据报表,数据查询和统计分析使用接口") |
||||||
|
@RequestMapping(value = "/getReportData", method = RequestMethod.GET) |
||||||
|
public R getReportData(String stcd, String beginSpt, String endSpt,String type,Integer accessRules) { |
||||||
|
Map<String,Date> res= CommonUtil.getStartEnd(beginSpt,endSpt); |
||||||
|
if(res == null){ |
||||||
|
return R.data(500,false, "日期格式错误"); |
||||||
|
} |
||||||
|
|
||||||
|
// R<Boolean> flag=deviceClient.isDeviceCodeExist(stcd);
|
||||||
|
// if(flag!=null && (!flag.isSuccess() || !flag.getData())){
|
||||||
|
// return R.data(500,false, "设备实例不存在,请联系管理员");
|
||||||
|
// }
|
||||||
|
|
||||||
|
//查询基础数据
|
||||||
|
Report report = wqDealDataService.getReportData(stcd,type,accessRules, res.get("begin"), res.get("end")); |
||||||
|
return R.data(report,"查询成功"); |
||||||
|
} |
||||||
|
|
||||||
|
//同期比较
|
||||||
|
|
||||||
|
@ApiOperation("同期比较") |
||||||
|
@RequestMapping(value = "/getCompare", method = RequestMethod.GET) |
||||||
|
public R getCompare(String stcd, String beginSpt, String endSpt,Integer accessRules,String col) { |
||||||
|
Map<String,Date> res=CommonUtil.getStartEnd(beginSpt,endSpt); |
||||||
|
if(res == null){ |
||||||
|
return R.data(500,false, "日期格式错误"); |
||||||
|
} |
||||||
|
|
||||||
|
// R<Boolean> flag=deviceClient.isDeviceCodeExist(stcd);
|
||||||
|
// if(flag!=null && (!flag.isSuccess() || !flag.getData())){
|
||||||
|
// return R.data(500,false, "设备实例不存在,请联系管理员");
|
||||||
|
// }
|
||||||
|
|
||||||
|
//查询基础数据
|
||||||
|
Report report = wqDealDataService.getCompare(stcd, QueryDateTypeEnum.DAY.getQueryDateType(),accessRules, res.get("begin"), res.get("end"), col); |
||||||
|
return R.data(report,"查询成功"); |
||||||
|
} |
||||||
|
|
||||||
|
//环比
|
||||||
|
|
||||||
|
@ApiOperation("同一时刻的环比") |
||||||
|
@RequestMapping(value = "/getRingCompare", method = RequestMethod.GET) |
||||||
|
public R getRingCompare(String stcd, String beginSpt, String endSpt, Integer hour) { |
||||||
|
Map<String,Date> res=CommonUtil.getStartEnd(beginSpt,endSpt); |
||||||
|
if(res == null){ |
||||||
|
return R.data(500,false, "日期格式错误"); |
||||||
|
} |
||||||
|
|
||||||
|
// R<Boolean> flag=deviceClient.isDeviceCodeExist(stcd);
|
||||||
|
// if(flag!=null && (!flag.isSuccess() || !flag.getData())){
|
||||||
|
// return R.data(500,false, "设备实例不存在,请联系管理员");
|
||||||
|
// }
|
||||||
|
|
||||||
|
//查询基础数据
|
||||||
|
Report report = wqDealDataService.getRingCompare(stcd, res.get("begin"), res.get("end"),hour); |
||||||
|
return R.data(report,"查询成功"); |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ApiOperation("水质评价数据") |
||||||
|
@RequestMapping(value = "/getEvaluate", method = RequestMethod.GET) |
||||||
|
public R getEvaluate(String stcd, String type,String date) {//type 0实时 1历史
|
||||||
|
|
||||||
|
// R<Boolean> flag=deviceClient.isDeviceCodeExist(stcd);
|
||||||
|
// if(flag!=null && (!flag.isSuccess() || !flag.getData())){
|
||||||
|
// return R.data(500,false, "设备实例不存在,请联系管理员");
|
||||||
|
// }
|
||||||
|
|
||||||
|
List<FieldsData> report = null; |
||||||
|
if("1".equals(type)) { |
||||||
|
Map<String,Date> res=CommonUtil.getStartEnd(date + " 00:00:00",date + " 23:59:59"); |
||||||
|
if(res == null){ |
||||||
|
return R.data(500,false, "日期格式错误"); |
||||||
|
} |
||||||
|
//查询基础数据
|
||||||
|
report = wqDealDataService.getHistoryData(stcd,res.get("begin"), res.get("end")); |
||||||
|
}else{ |
||||||
|
report = wqDealDataService.getRealData(stcd); |
||||||
|
} |
||||||
|
return R.data(report,"查询成功"); |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
//同期比较
|
||||||
|
|
||||||
|
@ApiOperation("获取某一项的历史数据") |
||||||
|
@RequestMapping(value = "/getHistoryDataByCol", method = RequestMethod.GET) |
||||||
|
public R getHistoryDataByCol(String stcd, String beginSpt, String endSpt,Integer accessRules,String col) { |
||||||
|
Map<String,Date> res=CommonUtil.getStartEnd(beginSpt,endSpt); |
||||||
|
if(res == null){ |
||||||
|
return R.data(500,false, "日期格式错误"); |
||||||
|
} |
||||||
|
|
||||||
|
// R<Boolean> flag=deviceClient.isDeviceCodeExist(stcd);
|
||||||
|
// if(flag!=null && (!flag.isSuccess() || !flag.getData())){
|
||||||
|
// return R.data(500,false, "设备实例不存在,请联系管理员");
|
||||||
|
// }
|
||||||
|
|
||||||
|
//查询基础数据
|
||||||
|
List<ReportData> report = wqDealDataService.getDataByCol(stcd,QueryDateTypeEnum.DAY.getQueryDateType(),accessRules, res.get("begin"), res.get("end"), col); |
||||||
|
return R.data(report,"查询成功"); |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
@ApiOperation("表头列") |
||||||
|
@RequestMapping(value = "/getTableHead", method = RequestMethod.GET) |
||||||
|
public R getTableHead(String stcd) { |
||||||
|
|
||||||
|
// R<Boolean> flag=deviceClient.isDeviceCodeExist(stcd);
|
||||||
|
// if(flag!=null && (!flag.isSuccess() || !flag.getData())){
|
||||||
|
// return R.data(500,false, "设备实例不存在,请联系管理员");
|
||||||
|
// }
|
||||||
|
|
||||||
|
//查询基础数据
|
||||||
|
List<AnalyzeInstanceFieldVO> report = wqDealDataService.getSignages(stcd); |
||||||
|
return R.data(report,"查询成功"); |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
//实时数据
|
||||||
|
|
||||||
|
@ApiOperation("实时数据接口") |
||||||
|
@RequestMapping(value = "/getRealData", method = RequestMethod.GET) |
||||||
|
public R getRealData(String stcd) { |
||||||
|
|
||||||
|
// R<Boolean> flag=deviceClient.isDeviceCodeExist(stcd);
|
||||||
|
// if(flag!=null && (!flag.isSuccess() || !flag.getData())){
|
||||||
|
// return R.data(500,false, "设备实例不存在,请联系管理员");
|
||||||
|
// }
|
||||||
|
|
||||||
|
List<FieldsData> report = wqDealDataService.getRealData(stcd); |
||||||
|
return R.data(report,"查询成功"); |
||||||
|
} |
||||||
|
|
||||||
|
} |
@ -0,0 +1,128 @@ |
|||||||
|
package com.hnac.hzims.waterquality.controller; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||||
|
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
||||||
|
import com.hnac.hzims.waterquality.entity.WqWfrinfB; |
||||||
|
import com.hnac.hzims.waterquality.service.IWqWfrinfBService; |
||||||
|
import com.hnac.hzims.waterquality.util.ParamUtil; |
||||||
|
import io.swagger.annotations.*; |
||||||
|
import lombok.AllArgsConstructor; |
||||||
|
import org.springblade.common.cache.CacheNames; |
||||||
|
import org.springblade.core.boot.ctrl.BladeController; |
||||||
|
import org.springblade.core.mp.support.Condition; |
||||||
|
import org.springblade.core.mp.support.Query; |
||||||
|
import org.springblade.core.tool.api.R; |
||||||
|
import org.springblade.core.tool.utils.Func; |
||||||
|
|
||||||
|
import org.springframework.web.bind.annotation.*; |
||||||
|
import springfox.documentation.annotations.ApiIgnore; |
||||||
|
|
||||||
|
import java.util.List; |
||||||
|
import java.util.Map; |
||||||
|
|
||||||
|
@RestController |
||||||
|
@RequestMapping("/waterQuality/WqWfrinfB") |
||||||
|
@AllArgsConstructor |
||||||
|
@Api(value = "水功能区基本信息", tags = "水功能区基本信息接口") |
||||||
|
public class WqWfrinfBController extends BladeController implements CacheNames { |
||||||
|
|
||||||
|
private final IWqWfrinfBService wqWfrinfBService; |
||||||
|
|
||||||
|
|
||||||
|
/** |
||||||
|
* 分页 |
||||||
|
*/ |
||||||
|
|
||||||
|
@GetMapping("/pageList") |
||||||
|
@ApiImplicitParams({ |
||||||
|
@ApiImplicitParam(name = "wfrcd", value = "水功能区划码", paramType = "query", dataType = "string"), |
||||||
|
@ApiImplicitParam(name = "wfrnm", value = "水功能区名称", paramType = "query", dataType = "string") |
||||||
|
}) |
||||||
|
@ApiOperationSupport(order = 1) |
||||||
|
@ApiOperation(value = "分页", notes = "传入wqWfrinfB") |
||||||
|
public R<IPage<WqWfrinfB>> pageList(@ApiIgnore @RequestParam Map<String, Object> param, Query query) { |
||||||
|
LambdaQueryWrapper<WqWfrinfB> wrapper= ParamUtil.conditionWqWfrinfB(param); |
||||||
|
IPage<WqWfrinfB> pages = wqWfrinfBService.page(Condition.getPage(query), wrapper); |
||||||
|
return R.data(pages); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 列表 |
||||||
|
*/ |
||||||
|
|
||||||
|
@GetMapping("/list") |
||||||
|
@ApiImplicitParams({ |
||||||
|
@ApiImplicitParam(name = "wfrcd", value = "水功能区划码", paramType = "query", dataType = "string"), |
||||||
|
@ApiImplicitParam(name = "wfrnm", value = "水功能区名称", paramType = "query", dataType = "string") |
||||||
|
}) |
||||||
|
@ApiOperationSupport(order = 2) |
||||||
|
@ApiOperation(value = "列表", notes = "传入wqWfrinfB") |
||||||
|
public R<List<WqWfrinfB>> list(@ApiIgnore @RequestParam Map<String, Object> param) { |
||||||
|
LambdaQueryWrapper<WqWfrinfB> wrapper=ParamUtil.conditionWqWfrinfB(param); |
||||||
|
List<WqWfrinfB> list = wqWfrinfBService.list(wrapper); |
||||||
|
return R.data(list); |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
/** |
||||||
|
* 详情 |
||||||
|
*/ |
||||||
|
|
||||||
|
@GetMapping("/detail") |
||||||
|
@ApiOperationSupport(order = 3) |
||||||
|
@ApiOperation(value = "详情", notes = "传入wqWfrinfB") |
||||||
|
public R<WqWfrinfB> detail(WqWfrinfB wqWfrinfB) { |
||||||
|
WqWfrinfB detail = wqWfrinfBService.getOne(Condition.getQueryWrapper(wqWfrinfB)); |
||||||
|
return R.data(detail); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 新增 |
||||||
|
*/ |
||||||
|
|
||||||
|
@PostMapping("/save") |
||||||
|
@ApiOperationSupport(order = 4) |
||||||
|
@ApiOperation(value = "新增", notes = "传入wqWfrinfB") |
||||||
|
public R save(@RequestBody WqWfrinfB wqWfrinfB) { |
||||||
|
LambdaQueryWrapper<WqWfrinfB> wrapper=new LambdaQueryWrapper<>(); |
||||||
|
wrapper.eq(WqWfrinfB::getWfrcd,wqWfrinfB.getWfrcd()); |
||||||
|
List<WqWfrinfB> list = wqWfrinfBService.list(wrapper); |
||||||
|
if(list!=null && !list.isEmpty()){ |
||||||
|
return R.fail("水功能区代码已存在"); |
||||||
|
} |
||||||
|
|
||||||
|
wrapper=new LambdaQueryWrapper<>(); |
||||||
|
wrapper.eq(WqWfrinfB::getWfrnm,wqWfrinfB.getWfrnm()); |
||||||
|
list = wqWfrinfBService.list(wrapper); |
||||||
|
if(list!=null && !list.isEmpty()){ |
||||||
|
return R.fail("水功能区名称已存在"); |
||||||
|
} |
||||||
|
|
||||||
|
return R.status(wqWfrinfBService.save(wqWfrinfB)); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 修改 |
||||||
|
*/ |
||||||
|
|
||||||
|
@PostMapping("/update") |
||||||
|
@ApiOperationSupport(order = 5) |
||||||
|
@ApiOperation(value = "修改", notes = "传入wqWfrinfB") |
||||||
|
public R update(@RequestBody WqWfrinfB wqWfrinfB) { |
||||||
|
return R.status(wqWfrinfBService.updateById(wqWfrinfB)); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 删除 |
||||||
|
*/ |
||||||
|
|
||||||
|
@PostMapping("/remove") |
||||||
|
@ApiOperationSupport(order = 6) |
||||||
|
@ApiOperation(value = "逻辑删除", notes = "ids") |
||||||
|
public R remove(@ApiParam(value = "主键集合") @RequestParam String ids) { |
||||||
|
boolean temp = wqWfrinfBService.deleteLogic(Func.toLongList(ids)); |
||||||
|
return R.status(temp); |
||||||
|
} |
||||||
|
|
||||||
|
} |
@ -0,0 +1,151 @@ |
|||||||
|
/* |
||||||
|
* Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
||||||
|
* |
||||||
|
* Redistribution and use in source and binary forms, with or without |
||||||
|
* modification, are permitted provided that the following conditions are met: |
||||||
|
* |
||||||
|
* Redistributions of source code must retain the above copyright wqWqsinfB, |
||||||
|
* this list of conditions and the following disclaimer. |
||||||
|
* Redistributions in binary form must reproduce the above copyright |
||||||
|
* wqWqsinfB, this list of conditions and the following disclaimer in the |
||||||
|
* documentation and/or other materials provided with the distribution. |
||||||
|
* Neither the name of the dreamlu.net developer nor the names of its |
||||||
|
* contributors may be used to endorse or promote products derived from |
||||||
|
* this software without specific prior written permission. |
||||||
|
* Author: Chill 庄骞 (smallchill@163.com) |
||||||
|
*/ |
||||||
|
package com.hnac.hzims.waterquality.controller; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||||
|
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
||||||
|
import com.hnac.hzims.waterquality.entity.WqWqsinfB; |
||||||
|
import com.hnac.hzims.waterquality.service.IWqWqsinfBService; |
||||||
|
import com.hnac.hzims.waterquality.util.ParamUtil; |
||||||
|
import com.hnac.hzims.waterquality.vo.WqWqsinfBVo; |
||||||
|
import com.hnac.hzims.waterquality.wrapper.WqWqsinfBWrapper; |
||||||
|
import io.swagger.annotations.*; |
||||||
|
import lombok.AllArgsConstructor; |
||||||
|
import org.springblade.common.cache.CacheNames; |
||||||
|
import org.springblade.core.boot.ctrl.BladeController; |
||||||
|
import org.springblade.core.mp.support.Condition; |
||||||
|
import org.springblade.core.mp.support.Query; |
||||||
|
import org.springblade.core.tool.api.R; |
||||||
|
import org.springblade.core.tool.utils.Func; |
||||||
|
|
||||||
|
import org.springframework.web.bind.annotation.*; |
||||||
|
import springfox.documentation.annotations.ApiIgnore; |
||||||
|
|
||||||
|
import java.util.List; |
||||||
|
import java.util.Map; |
||||||
|
|
||||||
|
/** |
||||||
|
* 水质监测站控制器 |
||||||
|
* |
||||||
|
* @author Chill |
||||||
|
*/ |
||||||
|
@RestController |
||||||
|
@RequestMapping("/waterQuality/wqWqsinfB") |
||||||
|
@AllArgsConstructor |
||||||
|
@Api(value = "水质监测站", tags = "水质监测站接口") |
||||||
|
public class WqWqsinfBController extends BladeController implements CacheNames { |
||||||
|
|
||||||
|
private final IWqWqsinfBService wqWqsinfBService; |
||||||
|
|
||||||
|
|
||||||
|
/** |
||||||
|
* 分页 |
||||||
|
*/ |
||||||
|
|
||||||
|
@GetMapping("/pageList") |
||||||
|
@ApiImplicitParams({ |
||||||
|
@ApiImplicitParam(name = "stcd", value = "测站编码", paramType = "query", dataType = "string"), |
||||||
|
@ApiImplicitParam(name = "stnm", value = "测站名称", paramType = "query", dataType = "string") |
||||||
|
}) |
||||||
|
@ApiOperationSupport(order = 1) |
||||||
|
@ApiOperation(value = "分页", notes = "传入wqWqsinfB") |
||||||
|
public R<IPage<WqWqsinfBVo>> pageList(@ApiIgnore @RequestParam Map<String, Object> param, Query query) { |
||||||
|
LambdaQueryWrapper<WqWqsinfB> wrapper= ParamUtil.conditionWqWqsinfB(param); |
||||||
|
IPage<WqWqsinfB> pages = wqWqsinfBService.page(Condition.getPage(query), wrapper); |
||||||
|
return R.data(WqWqsinfBWrapper.build().pageVO(pages)); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 列表 |
||||||
|
*/ |
||||||
|
|
||||||
|
@GetMapping("/list") |
||||||
|
@ApiImplicitParams({ |
||||||
|
@ApiImplicitParam(name = "stcd", value = "测站编码", paramType = "query", dataType = "string"), |
||||||
|
@ApiImplicitParam(name = "stnm", value = "测站名称", paramType = "query", dataType = "string") |
||||||
|
}) |
||||||
|
@ApiOperationSupport(order = 2) |
||||||
|
@ApiOperation(value = "列表", notes = "传入wqWqsinfB") |
||||||
|
public R<List<WqWqsinfBVo>> list(@ApiIgnore @RequestParam Map<String, Object> param) { |
||||||
|
LambdaQueryWrapper<WqWqsinfB> wrapper=ParamUtil.conditionWqWqsinfB(param); |
||||||
|
List<WqWqsinfB> list = wqWqsinfBService.list(wrapper); |
||||||
|
return R.data(WqWqsinfBWrapper.build().listVO(list)); |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
/** |
||||||
|
* 详情 |
||||||
|
*/ |
||||||
|
|
||||||
|
@GetMapping("/detail") |
||||||
|
@ApiOperationSupport(order = 3) |
||||||
|
@ApiOperation(value = "详情", notes = "传入wqWqsinfB") |
||||||
|
public R<WqWqsinfBVo> detail(WqWqsinfB wqWqsinfB) { |
||||||
|
WqWqsinfB detail = wqWqsinfBService.getOne(Condition.getQueryWrapper(wqWqsinfB)); |
||||||
|
return R.data(WqWqsinfBWrapper.build().entityVO(detail)); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 新增 |
||||||
|
*/ |
||||||
|
|
||||||
|
@PostMapping("/save") |
||||||
|
@ApiOperationSupport(order = 4) |
||||||
|
@ApiOperation(value = "新增", notes = "传入wqWqsinfB") |
||||||
|
public R save(@RequestBody WqWqsinfB wqWqsinfB) { |
||||||
|
LambdaQueryWrapper<WqWqsinfB> wrapper=new LambdaQueryWrapper<>(); |
||||||
|
wrapper.eq(WqWqsinfB::getStcd,wqWqsinfB.getStcd()); |
||||||
|
List<WqWqsinfB> list = wqWqsinfBService.list(wrapper); |
||||||
|
if(list!=null && !list.isEmpty()){ |
||||||
|
return R.fail("测站编码已存在"); |
||||||
|
} |
||||||
|
|
||||||
|
wrapper=new LambdaQueryWrapper<>(); |
||||||
|
wrapper.eq(WqWqsinfB::getStnm,wqWqsinfB.getStnm()); |
||||||
|
list = wqWqsinfBService.list(wrapper); |
||||||
|
if(list!=null && !list.isEmpty()){ |
||||||
|
return R.fail("测站名称已存在"); |
||||||
|
} |
||||||
|
|
||||||
|
return R.status(wqWqsinfBService.save(wqWqsinfB)); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 修改 |
||||||
|
*/ |
||||||
|
|
||||||
|
@PostMapping("/update") |
||||||
|
@ApiOperationSupport(order = 5) |
||||||
|
@ApiOperation(value = "修改", notes = "传入wqWqsinfB") |
||||||
|
public R update(@RequestBody WqWqsinfB wqWqsinfB) { |
||||||
|
return R.status(wqWqsinfBService.updateById(wqWqsinfB)); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 删除 |
||||||
|
*/ |
||||||
|
|
||||||
|
@PostMapping("/remove") |
||||||
|
@ApiOperationSupport(order = 6) |
||||||
|
@ApiOperation(value = "逻辑删除", notes = "ids") |
||||||
|
public R remove(@ApiParam(value = "主键集合") @RequestParam String ids) { |
||||||
|
boolean temp = wqWqsinfBService.deleteLogic(Func.toLongList(ids)); |
||||||
|
return R.status(temp); |
||||||
|
} |
||||||
|
|
||||||
|
} |
@ -0,0 +1,128 @@ |
|||||||
|
package com.hnac.hzims.waterquality.controller; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||||
|
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
||||||
|
import com.hnac.hzims.waterquality.entity.WqWrrinfB; |
||||||
|
import com.hnac.hzims.waterquality.service.IWqWrrinfBService; |
||||||
|
import com.hnac.hzims.waterquality.util.ParamUtil; |
||||||
|
import io.swagger.annotations.*; |
||||||
|
import lombok.AllArgsConstructor; |
||||||
|
import org.springblade.common.cache.CacheNames; |
||||||
|
import org.springblade.core.boot.ctrl.BladeController; |
||||||
|
import org.springblade.core.mp.support.Condition; |
||||||
|
import org.springblade.core.mp.support.Query; |
||||||
|
import org.springblade.core.tool.api.R; |
||||||
|
import org.springblade.core.tool.utils.Func; |
||||||
|
|
||||||
|
import org.springframework.web.bind.annotation.*; |
||||||
|
import springfox.documentation.annotations.ApiIgnore; |
||||||
|
|
||||||
|
import java.util.List; |
||||||
|
import java.util.Map; |
||||||
|
|
||||||
|
@RestController |
||||||
|
@RequestMapping("/waterQuality/wqWrrinfB") |
||||||
|
@AllArgsConstructor |
||||||
|
@Api(value = "水资源分区基本信息", tags = "水资源分区基本信息接口") |
||||||
|
public class WqWrrinfBController extends BladeController implements CacheNames { |
||||||
|
|
||||||
|
private final IWqWrrinfBService wqWrrinfBService; |
||||||
|
|
||||||
|
/** |
||||||
|
* 分页 |
||||||
|
*/ |
||||||
|
|
||||||
|
@GetMapping("/pageList") |
||||||
|
@ApiImplicitParams({ |
||||||
|
@ApiImplicitParam(name = "wrrcd", value = "水资源分区码", paramType = "query", dataType = "string"), |
||||||
|
@ApiImplicitParam(name = "wrrnm", value = "水资源分区名称", paramType = "query", dataType = "string") |
||||||
|
}) |
||||||
|
@ApiOperationSupport(order = 1) |
||||||
|
@ApiOperation(value = "分页", notes = "传入wqWrrinfB") |
||||||
|
public R<IPage<WqWrrinfB>> pageList(@ApiIgnore @RequestParam Map<String, Object> param, Query query) { |
||||||
|
LambdaQueryWrapper<WqWrrinfB> wrapper= ParamUtil.conditionWqWrrinfB(param); |
||||||
|
IPage<WqWrrinfB> pages = wqWrrinfBService.page(Condition.getPage(query), wrapper); |
||||||
|
return R.data(pages); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 列表 |
||||||
|
*/ |
||||||
|
|
||||||
|
@GetMapping("/list") |
||||||
|
@ApiImplicitParams({ |
||||||
|
@ApiImplicitParam(name = "wrrcd", value = "水资源分区码", paramType = "query", dataType = "string"), |
||||||
|
@ApiImplicitParam(name = "wrrnm", value = "水资源分区名称", paramType = "query", dataType = "string") |
||||||
|
}) |
||||||
|
@ApiOperationSupport(order = 2) |
||||||
|
@ApiOperation(value = "列表", notes = "传入wqWrrinfB") |
||||||
|
public R<List<WqWrrinfB>> list(@ApiIgnore @RequestParam Map<String, Object> param) { |
||||||
|
LambdaQueryWrapper<WqWrrinfB> wrapper=ParamUtil.conditionWqWrrinfB(param); |
||||||
|
List<WqWrrinfB> list = wqWrrinfBService.list(wrapper); |
||||||
|
return R.data(list); |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
/** |
||||||
|
* 详情 |
||||||
|
*/ |
||||||
|
|
||||||
|
@GetMapping("/detail") |
||||||
|
@ApiOperationSupport(order = 3) |
||||||
|
@ApiOperation(value = "详情", notes = "传入wqWrrinfB") |
||||||
|
public R<WqWrrinfB> detail(WqWrrinfB wqWrrinfB) { |
||||||
|
WqWrrinfB detail = wqWrrinfBService.getOne(Condition.getQueryWrapper(wqWrrinfB)); |
||||||
|
return R.data(detail); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 新增 |
||||||
|
*/ |
||||||
|
|
||||||
|
@PostMapping("/save") |
||||||
|
@ApiOperationSupport(order = 4) |
||||||
|
@ApiOperation(value = "新增", notes = "传入wqWrrinfB") |
||||||
|
public R save(@RequestBody WqWrrinfB wqWrrinfB) { |
||||||
|
LambdaQueryWrapper<WqWrrinfB> wrapper=new LambdaQueryWrapper<>(); |
||||||
|
wrapper.eq(WqWrrinfB::getWrrcd,wqWrrinfB.getWrrcd()); |
||||||
|
List<WqWrrinfB> list = wqWrrinfBService.list(wrapper); |
||||||
|
if(list!=null && !list.isEmpty()){ |
||||||
|
return R.fail("水资源分区码已存在"); |
||||||
|
} |
||||||
|
|
||||||
|
wrapper=new LambdaQueryWrapper<>(); |
||||||
|
wrapper.eq(WqWrrinfB::getWrrnm,wqWrrinfB.getWrrnm()); |
||||||
|
list = wqWrrinfBService.list(wrapper); |
||||||
|
if(list!=null && !list.isEmpty()){ |
||||||
|
return R.fail("水资源分区名称已存在"); |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
return R.status(wqWrrinfBService.save(wqWrrinfB)); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 修改 |
||||||
|
*/ |
||||||
|
|
||||||
|
@PostMapping("/update") |
||||||
|
@ApiOperationSupport(order = 5) |
||||||
|
@ApiOperation(value = "修改", notes = "传入wqWrrinfB") |
||||||
|
public R update(@RequestBody WqWrrinfB wqWrrinfB) { |
||||||
|
return R.status(wqWrrinfBService.updateById(wqWrrinfB)); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 删除 |
||||||
|
*/ |
||||||
|
|
||||||
|
@PostMapping("/remove") |
||||||
|
@ApiOperationSupport(order = 6) |
||||||
|
@ApiOperation(value = "逻辑删除", notes = "ids") |
||||||
|
public R remove(@ApiParam(value = "主键集合") @RequestParam String ids) { |
||||||
|
boolean temp = wqWrrinfBService.deleteLogic(Func.toLongList(ids)); |
||||||
|
return R.status(temp); |
||||||
|
} |
||||||
|
|
||||||
|
} |
@ -0,0 +1,12 @@ |
|||||||
|
package com.hnac.hzims.waterquality.mapper; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||||
|
import com.hnac.hzims.waterquality.entity.WqConfigD; |
||||||
|
import org.apache.ibatis.annotations.Param; |
||||||
|
|
||||||
|
|
||||||
|
import java.util.List; |
||||||
|
|
||||||
|
public interface WqConfigDMapper extends BaseMapper<WqConfigD> { |
||||||
|
int batchSave(@Param("list") List<WqConfigD> list); |
||||||
|
} |
@ -0,0 +1,10 @@ |
|||||||
|
<?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.hnac.hzims.waterquality.mapper.WqConfigDMapper"> |
||||||
|
<insert id="batchSave"> |
||||||
|
insert into wq_config_d(STCD,TYPE,VALUE) values |
||||||
|
<foreach collection="list" separator="," item="item"> |
||||||
|
(#{item.stcd},#{item.type},#{item.value}) |
||||||
|
</foreach> |
||||||
|
</insert> |
||||||
|
</mapper> |
@ -0,0 +1,8 @@ |
|||||||
|
package com.hnac.hzims.waterquality.mapper; |
||||||
|
|
||||||
|
import com.hnac.hzims.waterquality.entity.WqWfrinfB; |
||||||
|
import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper; |
||||||
|
|
||||||
|
|
||||||
|
public interface WqWfrinfBMapper extends UserDataScopeBaseMapper<WqWfrinfB> { |
||||||
|
} |
@ -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.hnac.hzims.waterquality.mapper.WqWfrinfBMapper"> |
||||||
|
|
||||||
|
</mapper> |
@ -0,0 +1,30 @@ |
|||||||
|
/* |
||||||
|
* Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
||||||
|
* |
||||||
|
* Redistribution and use in source and binary forms, with or without |
||||||
|
* modification, are permitted provided that the following conditions are met: |
||||||
|
* |
||||||
|
* Redistributions of source code must retain the above copyright Example, |
||||||
|
* this list of conditions and the following disclaimer. |
||||||
|
* Redistributions in binary form must reproduce the above copyright |
||||||
|
* Example, this list of conditions and the following disclaimer in the |
||||||
|
* documentation and/or other materials provided with the distribution. |
||||||
|
* Neither the name of the dreamlu.net developer nor the names of its |
||||||
|
* contributors may be used to endorse or promote products derived from |
||||||
|
* this software without specific prior written permission. |
||||||
|
* Author: Chill 庄骞 (smallchill@163.com) |
||||||
|
*/ |
||||||
|
package com.hnac.hzims.waterquality.mapper; |
||||||
|
|
||||||
|
import com.hnac.hzims.waterquality.entity.WqWqsinfB; |
||||||
|
import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper; |
||||||
|
|
||||||
|
|
||||||
|
/** |
||||||
|
* Mapper 接口 |
||||||
|
* |
||||||
|
* @author Chill |
||||||
|
*/ |
||||||
|
public interface WqWqsinfBMapper extends UserDataScopeBaseMapper<WqWqsinfB> { |
||||||
|
|
||||||
|
} |
@ -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.hnac.hzims.waterquality.mapper.WqWqsinfBMapper"> |
||||||
|
|
||||||
|
</mapper> |
@ -0,0 +1,8 @@ |
|||||||
|
package com.hnac.hzims.waterquality.mapper; |
||||||
|
|
||||||
|
import com.hnac.hzims.waterquality.entity.WqWrrinfB; |
||||||
|
import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper; |
||||||
|
|
||||||
|
|
||||||
|
public interface WqWrrinfBMapper extends UserDataScopeBaseMapper<WqWrrinfB> { |
||||||
|
} |
@ -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.hnac.hzims.waterquality.mapper.WqWrrinfBMapper"> |
||||||
|
|
||||||
|
</mapper> |
@ -0,0 +1,21 @@ |
|||||||
|
package com.hnac.hzims.waterquality.service; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||||
|
import com.hnac.hzims.waterquality.entity.WqConfigD; |
||||||
|
|
||||||
|
|
||||||
|
import java.util.List; |
||||||
|
|
||||||
|
public interface IWqConfigDService { |
||||||
|
IPage<WqConfigD> page(IPage<WqConfigD> page, LambdaQueryWrapper<WqConfigD> wrapper); |
||||||
|
|
||||||
|
List<WqConfigD> list(LambdaQueryWrapper<WqConfigD> wrapper); |
||||||
|
|
||||||
|
WqConfigD getOne(QueryWrapper<WqConfigD> wrapper); |
||||||
|
|
||||||
|
boolean batchSave(List<WqConfigD> list,LambdaQueryWrapper<WqConfigD> wrapper); |
||||||
|
|
||||||
|
boolean delete(LambdaQueryWrapper<WqConfigD> wrapper); |
||||||
|
} |
@ -0,0 +1,20 @@ |
|||||||
|
package com.hnac.hzims.waterquality.service; |
||||||
|
|
||||||
|
import com.hnac.hzims.entity.Report; |
||||||
|
import com.hnac.hzims.entity.ReportData; |
||||||
|
import com.hnac.hzinfo.datasearch.analyse.domain.FieldsData; |
||||||
|
import com.hnac.hzinfo.datasearch.analyse.vo.AnalyzeInstanceFieldVO; |
||||||
|
|
||||||
|
|
||||||
|
import java.util.Date; |
||||||
|
import java.util.List; |
||||||
|
|
||||||
|
public interface IWqDealDataService { |
||||||
|
Report getReportData(String stcd, String type, Integer accessRules, Date start, Date end); |
||||||
|
Report getCompare(String stcd,String type,Integer accessRules,Date start,Date end,String col); |
||||||
|
Report getRingCompare(String stcd,Date start,Date end,int hour); |
||||||
|
List<ReportData> getDataByCol(String stcd, String type, Integer accessRules, Date start, Date end, String col); |
||||||
|
List<FieldsData> getRealData(String stcd); |
||||||
|
List<AnalyzeInstanceFieldVO> getSignages(String stcd); |
||||||
|
List<FieldsData> getHistoryData(String stcd, Date start, Date end); |
||||||
|
} |
@ -0,0 +1,9 @@ |
|||||||
|
package com.hnac.hzims.waterquality.service; |
||||||
|
|
||||||
|
import com.hnac.hzims.waterquality.entity.WqWfrinfB; |
||||||
|
import org.springblade.core.mp.base.BaseService; |
||||||
|
|
||||||
|
|
||||||
|
public interface IWqWfrinfBService extends BaseService<WqWfrinfB> { |
||||||
|
|
||||||
|
} |
@ -0,0 +1,30 @@ |
|||||||
|
/* |
||||||
|
* Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
||||||
|
* |
||||||
|
* Redistribution and use in source and binary forms, with or without |
||||||
|
* modification, are permitted provided that the following conditions are met: |
||||||
|
* |
||||||
|
* Redistributions of source code must retain the above copyright Example, |
||||||
|
* this list of conditions and the following disclaimer. |
||||||
|
* Redistributions in binary form must reproduce the above copyright |
||||||
|
* Example, this list of conditions and the following disclaimer in the |
||||||
|
* documentation and/or other materials provided with the distribution. |
||||||
|
* Neither the name of the dreamlu.net developer nor the names of its |
||||||
|
* contributors may be used to endorse or promote products derived from |
||||||
|
* this software without specific prior written permission. |
||||||
|
* Author: Chill 庄骞 (smallchill@163.com) |
||||||
|
*/ |
||||||
|
package com.hnac.hzims.waterquality.service; |
||||||
|
|
||||||
|
import com.hnac.hzims.waterquality.entity.WqWqsinfB; |
||||||
|
import org.springblade.core.mp.base.BaseService; |
||||||
|
|
||||||
|
|
||||||
|
/** |
||||||
|
* 服务类 |
||||||
|
* |
||||||
|
* @author Chill |
||||||
|
*/ |
||||||
|
public interface IWqWqsinfBService extends BaseService<WqWqsinfB> { |
||||||
|
|
||||||
|
} |
@ -0,0 +1,8 @@ |
|||||||
|
package com.hnac.hzims.waterquality.service; |
||||||
|
|
||||||
|
import com.hnac.hzims.waterquality.entity.WqWrrinfB; |
||||||
|
import org.springblade.core.mp.base.BaseService; |
||||||
|
|
||||||
|
|
||||||
|
public interface IWqWrrinfBService extends BaseService<WqWrrinfB> { |
||||||
|
} |
@ -0,0 +1,48 @@ |
|||||||
|
package com.hnac.hzims.waterquality.service.impl; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||||
|
|
||||||
|
import com.hnac.hzims.waterquality.entity.WqConfigD; |
||||||
|
import com.hnac.hzims.waterquality.mapper.WqConfigDMapper; |
||||||
|
import com.hnac.hzims.waterquality.service.IWqConfigDService; |
||||||
|
import org.springframework.stereotype.Service; |
||||||
|
|
||||||
|
import javax.annotation.Resource; |
||||||
|
import java.util.List; |
||||||
|
|
||||||
|
@Service |
||||||
|
public class WqConfigDServiceImpl implements IWqConfigDService { |
||||||
|
@Resource |
||||||
|
WqConfigDMapper wqConfigDMapper; |
||||||
|
|
||||||
|
@Override |
||||||
|
public IPage<WqConfigD> page(IPage<WqConfigD> page, LambdaQueryWrapper<WqConfigD> wrapper) { |
||||||
|
return wqConfigDMapper.selectPage(page,wrapper); |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public List<WqConfigD> list(LambdaQueryWrapper<WqConfigD> wrapper) { |
||||||
|
return wqConfigDMapper.selectList(wrapper); |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public WqConfigD getOne(QueryWrapper<WqConfigD> wrapper) { |
||||||
|
return wqConfigDMapper.selectOne(wrapper); |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public boolean batchSave(List<WqConfigD> list,LambdaQueryWrapper<WqConfigD> wrapper) { |
||||||
|
delete(wrapper); |
||||||
|
wqConfigDMapper.batchSave(list); |
||||||
|
|
||||||
|
return true; |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public boolean delete(LambdaQueryWrapper<WqConfigD> wrapper) { |
||||||
|
int count=wqConfigDMapper.delete(wrapper); |
||||||
|
return count>0; |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,397 @@ |
|||||||
|
package com.hnac.hzims.waterquality.service.impl; |
||||||
|
|
||||||
|
import com.hnac.hzims.entity.Report; |
||||||
|
import com.hnac.hzims.entity.ReportData; |
||||||
|
import com.hnac.hzims.enums.QueryDateTypeEnum; |
||||||
|
import com.hnac.hzims.util.CommonUtil; |
||||||
|
import com.hnac.hzims.waterquality.service.IWqDealDataService; |
||||||
|
import com.hnac.hzinfo.datasearch.analyse.domain.FieldsData; |
||||||
|
import com.hnac.hzinfo.datasearch.analyse.po.AnalyseCodeByAnalyseDataPO; |
||||||
|
import com.hnac.hzinfo.datasearch.analyse.po.AnalyzeDataConditionPO; |
||||||
|
import com.hnac.hzinfo.datasearch.analyse.vo.AnalyseDataTaosVO; |
||||||
|
import com.hnac.hzinfo.datasearch.analyse.vo.AnalyzeDataConditionVO; |
||||||
|
import com.hnac.hzinfo.datasearch.analyse.vo.AnalyzeInstanceFieldVO; |
||||||
|
import com.hnac.hzinfo.datasearch.real.po.RealDataSearchPO; |
||||||
|
import com.hnac.hzinfo.sdk.analyse.AnalyseDataSearchClient; |
||||||
|
import com.hnac.hzinfo.sdk.core.response.Result; |
||||||
|
import com.hnac.hzinfo.sdk.real.RealDataSearchClient; |
||||||
|
import org.springblade.core.tool.utils.StringUtil; |
||||||
|
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||||
|
import org.springframework.stereotype.Service; |
||||||
|
|
||||||
|
import java.time.LocalDateTime; |
||||||
|
import java.time.ZoneId; |
||||||
|
import java.util.ArrayList; |
||||||
|
import java.util.Calendar; |
||||||
|
import java.util.Date; |
||||||
|
import java.util.List; |
||||||
|
|
||||||
|
@Service |
||||||
|
public class WqDealDataServiceImpl implements IWqDealDataService { |
||||||
|
|
||||||
|
@Autowired |
||||||
|
AnalyseDataSearchClient analyseDataSearchClient; |
||||||
|
|
||||||
|
@Autowired |
||||||
|
RealDataSearchClient realDataSearchClient; |
||||||
|
|
||||||
|
|
||||||
|
@Override |
||||||
|
public List<FieldsData> getRealData(String stcd){ |
||||||
|
RealDataSearchPO po=new RealDataSearchPO(); |
||||||
|
po.setAnalyzeCode(stcd); |
||||||
|
List<AnalyzeInstanceFieldVO> list=getSignages(stcd); |
||||||
|
if(list==null || list.isEmpty()){ |
||||||
|
return null; |
||||||
|
} |
||||||
|
List<String> signages=new ArrayList<>(); |
||||||
|
for(AnalyzeInstanceFieldVO vo:list){ |
||||||
|
signages.add(vo.getSignage()); |
||||||
|
} |
||||||
|
po.setSignages(signages); |
||||||
|
Result<List<FieldsData>> result=realDataSearchClient.getRealDataByDeviceCode(po); |
||||||
|
if(result==null || !result.isSuccess()){ |
||||||
|
return null; |
||||||
|
} |
||||||
|
return result.getData(); |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
@Override |
||||||
|
public List<AnalyzeInstanceFieldVO> getSignages(String stcd){ |
||||||
|
//查询列
|
||||||
|
Result<List<AnalyzeInstanceFieldVO>> result=analyseDataSearchClient.getInstanceFieldByAnalyseCode(stcd,1,""); |
||||||
|
if(result==null || !result.isSuccess()){ |
||||||
|
return null; |
||||||
|
} |
||||||
|
List<AnalyzeInstanceFieldVO> analyzeInstanceFieldVOS=result.getData(); |
||||||
|
|
||||||
|
return analyzeInstanceFieldVOS; |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public List<FieldsData> getHistoryData(String stcd, Date start, Date end) { |
||||||
|
List<FieldsData> result=new ArrayList<>(); |
||||||
|
List<AnalyzeInstanceFieldVO> signages=getSignages(stcd); |
||||||
|
if(signages==null || signages.isEmpty()){ |
||||||
|
return null; |
||||||
|
} |
||||||
|
List<ReportData> list=listDataReport(start, end, QueryDateTypeEnum.DAY,stcd,6,signages); |
||||||
|
if(list==null || list.isEmpty()){ |
||||||
|
return null; |
||||||
|
} |
||||||
|
for(ReportData data:list){ |
||||||
|
FieldsData dd=new FieldsData(); |
||||||
|
if(StringUtil.isNotBlank(data.getName())) { |
||||||
|
dd.setFieldName(data.getName()); |
||||||
|
}else{ |
||||||
|
dd.setFieldName(getNameBySignage(data.getStcd(),signages)); |
||||||
|
} |
||||||
|
dd.setSignage(data.getStcd());//测站 换成 属性
|
||||||
|
dd.setValue(data.getVal()); |
||||||
|
dd.setTime(data.getKeyStr()); |
||||||
|
dd.setQ(0); |
||||||
|
result.add(dd); |
||||||
|
} |
||||||
|
return result; |
||||||
|
} |
||||||
|
|
||||||
|
String getNameBySignage(String signage,List<AnalyzeInstanceFieldVO> signages){ |
||||||
|
for(AnalyzeInstanceFieldVO vo:signages){ |
||||||
|
if(vo.getSignage().equals(signage)){ |
||||||
|
return vo.getFieldName(); |
||||||
|
} |
||||||
|
} |
||||||
|
return ""; |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public Report getReportData(String stcd, String type, Integer accessRules, Date start, Date end){ |
||||||
|
//检查数据是否正常并转化
|
||||||
|
final QueryDateTypeEnum dtEnum = CommonUtil.checkType(type); |
||||||
|
if(stcd==null || "".equals(stcd)){ |
||||||
|
return null; |
||||||
|
} |
||||||
|
|
||||||
|
if(dtEnum ==null){ |
||||||
|
return null; |
||||||
|
} |
||||||
|
|
||||||
|
//设置基础数据
|
||||||
|
List<AnalyzeInstanceFieldVO> signages=getSignages(stcd); |
||||||
|
if(signages==null || signages.isEmpty()){ |
||||||
|
return null; |
||||||
|
} |
||||||
|
//初始化报表
|
||||||
|
Report report = new Report(); |
||||||
|
report.initBaseReport(signages.size(), start, end, dtEnum); |
||||||
|
|
||||||
|
//获取数据库某个站点不同时间要求的数据
|
||||||
|
List<ReportData> timeDataList = listDataReport(start, end,dtEnum,stcd,accessRules,signages); |
||||||
|
if(timeDataList==null || timeDataList.isEmpty()){ |
||||||
|
return null; |
||||||
|
} |
||||||
|
for(int i=0;i<signages.size();i++) { |
||||||
|
String signage=signages.get(i).getSignage(); |
||||||
|
List<ReportData> tmpList=CommonUtil.getReportDataBySignage(timeDataList,signage); |
||||||
|
for (ReportData reportData : tmpList) { |
||||||
|
String value = reportData.getVal(); |
||||||
|
// if (value != null && !"-".equals(value) && !"".equals(value.trim())) {
|
||||||
|
// value = new BigDecimal(value).setScale(3, BigDecimal.ROUND_DOWN).toString();
|
||||||
|
// }
|
||||||
|
|
||||||
|
if(value == null){ |
||||||
|
value = "-"; |
||||||
|
} |
||||||
|
|
||||||
|
report.setBaseCell(reportData.getKeyStr(), i, value); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
return report; |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public Report getCompare(String stcd, String type, Integer accessRules, Date start, Date end, String col) { |
||||||
|
//检查数据是否正常并转化
|
||||||
|
final QueryDateTypeEnum dtEnum = CommonUtil.checkType(type); |
||||||
|
if(stcd==null || "".equals(stcd)){ |
||||||
|
return null; |
||||||
|
} |
||||||
|
|
||||||
|
if(dtEnum ==null){ |
||||||
|
return null; |
||||||
|
} |
||||||
|
//初始化报表
|
||||||
|
Report report = new Report(); |
||||||
|
report.initCompareBaseReport(2, start, end, dtEnum); |
||||||
|
|
||||||
|
for(int i=0;i<2;i++){ |
||||||
|
//当前日期范围
|
||||||
|
List<ReportData> list=listDataReportByCol(subYear(start,i),subYear(end,i),dtEnum,stcd,accessRules,col,true); |
||||||
|
if(list==null || list.isEmpty()){ |
||||||
|
continue; |
||||||
|
} |
||||||
|
for (ReportData reportData : list) { |
||||||
|
String value = reportData.getVal(); |
||||||
|
// if (value != null && !"-".equals(value) && !"".equals(value.trim())) {
|
||||||
|
// value = new BigDecimal(value).setScale(3, BigDecimal.ROUND_DOWN).toString();
|
||||||
|
// }
|
||||||
|
|
||||||
|
if(value == null){ |
||||||
|
value = "-"; |
||||||
|
} |
||||||
|
|
||||||
|
report.setBaseCell(reportData.getKeyStr(), i, value); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
return report; |
||||||
|
} |
||||||
|
|
||||||
|
private Date subYear(Date date,int year){ |
||||||
|
Calendar calendar= Calendar.getInstance(); |
||||||
|
calendar.setTime(date); |
||||||
|
calendar.add(Calendar.YEAR,-year); |
||||||
|
return calendar.getTime(); |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public Report getRingCompare(String stcd, Date start, Date end,int hour) { |
||||||
|
//检查数据是否正常并转化
|
||||||
|
final QueryDateTypeEnum dtEnum = QueryDateTypeEnum.DAY; |
||||||
|
//设置基础数据
|
||||||
|
List<AnalyzeInstanceFieldVO> signages=getSignages(stcd); |
||||||
|
if(signages==null || signages.isEmpty()){ |
||||||
|
return null; |
||||||
|
} |
||||||
|
//初始化报表
|
||||||
|
Report report = new Report(); |
||||||
|
report.initBaseRingReport(signages.size(), start, end, dtEnum); |
||||||
|
|
||||||
|
List<ReportData> reportDataList=listDataReport(start,end,QueryDateTypeEnum.HOUR,stcd,0,signages); |
||||||
|
if(reportDataList==null || reportDataList.isEmpty()){ |
||||||
|
return null; |
||||||
|
} |
||||||
|
String hourStr=hour>9? ""+hour : "0"+hour; |
||||||
|
String keyStr=" "+hourStr; |
||||||
|
|
||||||
|
for(int i=0;i<signages.size();i++) { |
||||||
|
String signage=signages.get(i).getSignage(); |
||||||
|
List<ReportData> tmpList=CommonUtil.getReportDataBySignage(reportDataList,signage); |
||||||
|
for (int j=0;j<tmpList.size();j++) { |
||||||
|
ReportData reportData=tmpList.get(j); |
||||||
|
|
||||||
|
if(reportData.getKeyStr().indexOf(keyStr)>-1) { |
||||||
|
String value = reportData.getVal(); |
||||||
|
// if (value != null && !"-".equals(value) && !"".equals(value.trim())) {
|
||||||
|
// value = new BigDecimal(value).setScale(3, BigDecimal.ROUND_DOWN).toString();
|
||||||
|
// }
|
||||||
|
|
||||||
|
if (value == null) { |
||||||
|
value = "-"; |
||||||
|
} |
||||||
|
|
||||||
|
report.setBaseCell(reportData.getKeyStr(), i, value); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
return report; |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public List<ReportData> getDataByCol(String stcd, String type, Integer accessRules, Date start, Date end, String col) { |
||||||
|
//检查数据是否正常并转化
|
||||||
|
final QueryDateTypeEnum dtEnum = CommonUtil.checkType(type); |
||||||
|
if(stcd==null || "".equals(stcd)){ |
||||||
|
return null; |
||||||
|
} |
||||||
|
|
||||||
|
if(dtEnum ==null){ |
||||||
|
return null; |
||||||
|
} |
||||||
|
//获取数据库某个站点不同时间要求的数据
|
||||||
|
List<ReportData> timeDataList =listDataReportByCol(start, end,dtEnum,stcd,accessRules,col,false); |
||||||
|
if(timeDataList==null || timeDataList.isEmpty()){ |
||||||
|
return null; |
||||||
|
} |
||||||
|
return timeDataList; |
||||||
|
} |
||||||
|
|
||||||
|
private List<ReportData> listDataReport(Date begin,Date endSt, QueryDateTypeEnum dtEnum, String deviceCode, Integer accessRules, List<AnalyzeInstanceFieldVO> signages) { |
||||||
|
//周期类型: 0-> s(秒) 1->、m(分)、2->h(小时)3->、d(天)4->、w(周)5->、n(自然月)、6->y(自然年)
|
||||||
|
Integer saveTimeType=2; |
||||||
|
if(QueryDateTypeEnum.DAY.equals(dtEnum)){ |
||||||
|
saveTimeType = 3; |
||||||
|
} |
||||||
|
if(QueryDateTypeEnum.MONTH.equals(dtEnum)){ |
||||||
|
saveTimeType = 5; |
||||||
|
} |
||||||
|
if(QueryDateTypeEnum.YEAR.equals(dtEnum)){ |
||||||
|
saveTimeType = 6; |
||||||
|
} |
||||||
|
|
||||||
|
LocalDateTime start = LocalDateTime.ofInstant(begin.toInstant(), ZoneId.systemDefault()); |
||||||
|
LocalDateTime end = LocalDateTime.ofInstant(endSt.toInstant(), ZoneId.systemDefault()); |
||||||
|
|
||||||
|
return getDataByDeviceCode(deviceCode,accessRules,saveTimeType,start,end,signages); |
||||||
|
} |
||||||
|
|
||||||
|
private List<ReportData> listDataReportByCol(Date begin,Date endSt, QueryDateTypeEnum dtEnum, String deviceCode, |
||||||
|
Integer accessRules, String col,boolean isCompare) { |
||||||
|
//周期类型: 0-> s(秒) 1->、m(分)、2->h(小时)3->、d(天)4->、w(周)5->、n(自然月)、6->y(自然年)
|
||||||
|
Integer saveTimeType=2; |
||||||
|
if(QueryDateTypeEnum.DAY.equals(dtEnum)){ |
||||||
|
saveTimeType = 3; |
||||||
|
} |
||||||
|
if(QueryDateTypeEnum.MONTH.equals(dtEnum)){ |
||||||
|
saveTimeType = 5; |
||||||
|
} |
||||||
|
if(QueryDateTypeEnum.YEAR.equals(dtEnum)){ |
||||||
|
saveTimeType = 6; |
||||||
|
} |
||||||
|
|
||||||
|
LocalDateTime start = LocalDateTime.ofInstant(begin.toInstant(), ZoneId.systemDefault()); |
||||||
|
LocalDateTime end = LocalDateTime.ofInstant(endSt.toInstant(), ZoneId.systemDefault()); |
||||||
|
|
||||||
|
return getDataByDeviceCodeByCol(deviceCode,accessRules,saveTimeType,start,end,col,isCompare); |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
List<ReportData> getDataByDeviceCodeByCol(String deviceCode,Integer accessRules,Integer saveTimeType, |
||||||
|
LocalDateTime start,LocalDateTime end,String col,boolean isCompare){ |
||||||
|
List<ReportData> reportData=new ArrayList<>(); |
||||||
|
AnalyseCodeByAnalyseDataPO po=new AnalyseCodeByAnalyseDataPO(); |
||||||
|
po.setDeviceCode(deviceCode); |
||||||
|
|
||||||
|
List<AnalyzeDataConditionPO> signboardConditions=new ArrayList<>(); |
||||||
|
|
||||||
|
AnalyzeDataConditionPO conditionPO = new AnalyzeDataConditionPO(); |
||||||
|
conditionPO.setBeginTime(start); |
||||||
|
conditionPO.setEndTime(end); |
||||||
|
conditionPO.setSignages(col); |
||||||
|
// conditionPO.setKeepFigures(3);
|
||||||
|
conditionPO.setAccessRules(accessRules); |
||||||
|
conditionPO.setSaveTimeType(saveTimeType); |
||||||
|
conditionPO.setTimeInterval(1); |
||||||
|
conditionPO.setFull(1); |
||||||
|
signboardConditions.add(conditionPO); |
||||||
|
|
||||||
|
|
||||||
|
po.setSignboardConditions(signboardConditions); |
||||||
|
|
||||||
|
Result<List<AnalyzeDataConditionVO>> result=analyseDataSearchClient.getAnalyzeDataByAnalyzeCodeAndSignages(po); |
||||||
|
if(result==null || !result.isSuccess()){ |
||||||
|
return reportData; |
||||||
|
} |
||||||
|
List<AnalyzeDataConditionVO> datas=result.getData(); |
||||||
|
if(datas==null || datas.isEmpty()){ |
||||||
|
return reportData; |
||||||
|
} |
||||||
|
for(AnalyzeDataConditionVO vo:datas){ |
||||||
|
List<AnalyseDataTaosVO> dataTaosVOs=vo.getList(); |
||||||
|
for(AnalyseDataTaosVO vv:dataTaosVOs) { |
||||||
|
ReportData data=new ReportData(); |
||||||
|
if(isCompare) { |
||||||
|
data.setKeyStr(CommonUtil.getKey(vv.getTs())); |
||||||
|
}else{ |
||||||
|
data.setKeyStr(CommonUtil.getKeyBySaveTimeType(vv.getTs(),saveTimeType)); |
||||||
|
} |
||||||
|
data.setStcd(deviceCode);//测站
|
||||||
|
data.setVal(vv.getVal()); |
||||||
|
data.setName(vo.getName()); |
||||||
|
reportData.add(data); |
||||||
|
} |
||||||
|
} |
||||||
|
return reportData; |
||||||
|
} |
||||||
|
|
||||||
|
List<ReportData> getDataByDeviceCode(String deviceCode,Integer accessRules,Integer saveTimeType, |
||||||
|
LocalDateTime start,LocalDateTime end,List<AnalyzeInstanceFieldVO> signages){ |
||||||
|
List<ReportData> reportData=new ArrayList<>(); |
||||||
|
AnalyseCodeByAnalyseDataPO po=new AnalyseCodeByAnalyseDataPO(); |
||||||
|
po.setDeviceCode(deviceCode); |
||||||
|
|
||||||
|
List<AnalyzeDataConditionPO> signboardConditions=new ArrayList<>(); |
||||||
|
|
||||||
|
for(AnalyzeInstanceFieldVO vo:signages) { |
||||||
|
AnalyzeDataConditionPO conditionPO = new AnalyzeDataConditionPO(); |
||||||
|
conditionPO.setBeginTime(start); |
||||||
|
conditionPO.setEndTime(end); |
||||||
|
conditionPO.setSignages(vo.getSignage()); |
||||||
|
// conditionPO.setKeepFigures(3);
|
||||||
|
conditionPO.setAccessRules(accessRules); |
||||||
|
conditionPO.setSaveTimeType(saveTimeType); |
||||||
|
conditionPO.setTimeInterval(1); |
||||||
|
conditionPO.setFull(1); |
||||||
|
signboardConditions.add(conditionPO); |
||||||
|
} |
||||||
|
|
||||||
|
po.setSignboardConditions(signboardConditions); |
||||||
|
|
||||||
|
Result<List<AnalyzeDataConditionVO>> result=analyseDataSearchClient.getAnalyzeDataByAnalyzeCodeAndSignages(po); |
||||||
|
|
||||||
|
if(result==null || !result.isSuccess()){ |
||||||
|
return reportData; |
||||||
|
} |
||||||
|
List<AnalyzeDataConditionVO> datas=result.getData(); |
||||||
|
if(datas==null || datas.isEmpty()){ |
||||||
|
return reportData; |
||||||
|
} |
||||||
|
|
||||||
|
for(AnalyzeDataConditionVO vo:datas){ |
||||||
|
List<AnalyseDataTaosVO> dataTaosVOs=vo.getList(); |
||||||
|
for(AnalyseDataTaosVO vv:dataTaosVOs) { |
||||||
|
ReportData data=new ReportData(); |
||||||
|
data.setKeyStr(CommonUtil.getKeyBySaveTimeType(vv.getTs(),saveTimeType)); |
||||||
|
data.setStcd(vo.getSignage());//测站变成属性值
|
||||||
|
data.setVal(vv.getVal()); |
||||||
|
data.setName(vo.getName()); |
||||||
|
reportData.add(data); |
||||||
|
} |
||||||
|
} |
||||||
|
return reportData; |
||||||
|
} |
||||||
|
|
||||||
|
} |
@ -0,0 +1,13 @@ |
|||||||
|
package com.hnac.hzims.waterquality.service.impl; |
||||||
|
|
||||||
|
import com.hnac.hzims.waterquality.entity.WqWfrinfB; |
||||||
|
import com.hnac.hzims.waterquality.mapper.WqWfrinfBMapper; |
||||||
|
import com.hnac.hzims.waterquality.service.IWqWfrinfBService; |
||||||
|
import org.springblade.core.mp.base.BaseServiceImpl; |
||||||
|
|
||||||
|
import org.springframework.stereotype.Service; |
||||||
|
|
||||||
|
@Service |
||||||
|
public class WqWfrinfBServiceImpl extends BaseServiceImpl<WqWfrinfBMapper, WqWfrinfB> implements IWqWfrinfBService { |
||||||
|
|
||||||
|
} |
@ -0,0 +1,34 @@ |
|||||||
|
/* |
||||||
|
* Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
||||||
|
* |
||||||
|
* Redistribution and use in source and binary forms, with or without |
||||||
|
* modification, are permitted provided that the following conditions are met: |
||||||
|
* |
||||||
|
* Redistributions of source code must retain the above copyright Example, |
||||||
|
* this list of conditions and the following disclaimer. |
||||||
|
* Redistributions in binary form must reproduce the above copyright |
||||||
|
* Example, this list of conditions and the following disclaimer in the |
||||||
|
* documentation and/or other materials provided with the distribution. |
||||||
|
* Neither the name of the dreamlu.net developer nor the names of its |
||||||
|
* contributors may be used to endorse or promote products derived from |
||||||
|
* this software without specific prior written permission. |
||||||
|
* Author: Chill 庄骞 (smallchill@163.com) |
||||||
|
*/ |
||||||
|
package com.hnac.hzims.waterquality.service.impl; |
||||||
|
|
||||||
|
import com.hnac.hzims.waterquality.entity.WqWqsinfB; |
||||||
|
import com.hnac.hzims.waterquality.mapper.WqWqsinfBMapper; |
||||||
|
import com.hnac.hzims.waterquality.service.IWqWqsinfBService; |
||||||
|
import org.springblade.core.mp.base.BaseServiceImpl; |
||||||
|
|
||||||
|
import org.springframework.stereotype.Service; |
||||||
|
|
||||||
|
/** |
||||||
|
* 服务实现类 |
||||||
|
* |
||||||
|
* @author Chill |
||||||
|
*/ |
||||||
|
@Service |
||||||
|
public class WqWqsinfBServiceServiceImpl extends BaseServiceImpl<WqWqsinfBMapper, WqWqsinfB> implements IWqWqsinfBService { |
||||||
|
|
||||||
|
} |
@ -0,0 +1,13 @@ |
|||||||
|
package com.hnac.hzims.waterquality.service.impl; |
||||||
|
|
||||||
|
import com.hnac.hzims.waterquality.entity.WqWrrinfB; |
||||||
|
import com.hnac.hzims.waterquality.mapper.WqWrrinfBMapper; |
||||||
|
import com.hnac.hzims.waterquality.service.IWqWrrinfBService; |
||||||
|
import org.springblade.core.mp.base.BaseServiceImpl; |
||||||
|
|
||||||
|
import org.springframework.stereotype.Service; |
||||||
|
|
||||||
|
@Service |
||||||
|
public class WqWrrinfBServiceImpl extends BaseServiceImpl<WqWrrinfBMapper, WqWrrinfB> implements IWqWrrinfBService { |
||||||
|
|
||||||
|
} |
@ -0,0 +1,54 @@ |
|||||||
|
package com.hnac.hzims.waterquality.util; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
||||||
|
import com.hnac.hzims.waterquality.entity.WqConfigD; |
||||||
|
import com.hnac.hzims.waterquality.entity.WqWfrinfB; |
||||||
|
import com.hnac.hzims.waterquality.entity.WqWqsinfB; |
||||||
|
import com.hnac.hzims.waterquality.entity.WqWrrinfB; |
||||||
|
|
||||||
|
|
||||||
|
import java.util.Map; |
||||||
|
|
||||||
|
public class ParamUtil { |
||||||
|
public static LambdaQueryWrapper<WqWqsinfB> conditionWqWqsinfB(Map<String, Object> param){ |
||||||
|
LambdaQueryWrapper<WqWqsinfB> wrapper=new LambdaQueryWrapper(); |
||||||
|
if(param.get("stcd")!=null) { |
||||||
|
wrapper.like(WqWqsinfB::getStcd,param.get("stcd")); |
||||||
|
} |
||||||
|
if(param.get("stnm")!=null) { |
||||||
|
wrapper.like(WqWqsinfB::getStnm,param.get("stnm")); |
||||||
|
} |
||||||
|
return wrapper; |
||||||
|
} |
||||||
|
|
||||||
|
public static LambdaQueryWrapper<WqConfigD> conditionWqConfigD(Map<String, Object> param){ |
||||||
|
LambdaQueryWrapper<WqConfigD> wrapper=new LambdaQueryWrapper(); |
||||||
|
if(param.get("stcd")!=null) { |
||||||
|
wrapper.like(WqConfigD::getStcd,param.get("stcd")); |
||||||
|
} |
||||||
|
return wrapper; |
||||||
|
} |
||||||
|
|
||||||
|
public static LambdaQueryWrapper<WqWfrinfB> conditionWqWfrinfB(Map<String, Object> param){ |
||||||
|
LambdaQueryWrapper<WqWfrinfB> wrapper=new LambdaQueryWrapper(); |
||||||
|
if(param.get("wfrcd")!=null) { |
||||||
|
wrapper.like(WqWfrinfB::getWfrcd,param.get("wfrcd")); |
||||||
|
} |
||||||
|
if(param.get("wfrnm")!=null) { |
||||||
|
wrapper.like(WqWfrinfB::getWfrnm,param.get("wfrnm")); |
||||||
|
} |
||||||
|
return wrapper; |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
public static LambdaQueryWrapper<WqWrrinfB> conditionWqWrrinfB(Map<String, Object> param){ |
||||||
|
LambdaQueryWrapper<WqWrrinfB> wrapper=new LambdaQueryWrapper(); |
||||||
|
if(param.get("wrrcd")!=null) { |
||||||
|
wrapper.like(WqWrrinfB::getWrrcd,param.get("wrrcd")); |
||||||
|
} |
||||||
|
if(param.get("wrrnm")!=null) { |
||||||
|
wrapper.like(WqWrrinfB::getWrrnm,param.get("wrrnm")); |
||||||
|
} |
||||||
|
return wrapper; |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,26 @@ |
|||||||
|
package com.hnac.hzims.waterquality.wrapper; |
||||||
|
|
||||||
|
import com.hnac.hzims.waterquality.entity.WqWqsinfB; |
||||||
|
import com.hnac.hzims.waterquality.vo.WqWqsinfBVo; |
||||||
|
import org.springblade.core.mp.support.BaseEntityWrapper; |
||||||
|
import org.springblade.core.tool.utils.BeanUtil; |
||||||
|
|
||||||
|
|
||||||
|
import java.util.Objects; |
||||||
|
|
||||||
|
public class WqWqsinfBWrapper extends BaseEntityWrapper<WqWqsinfB, WqWqsinfBVo> { |
||||||
|
public WqWqsinfBWrapper() { |
||||||
|
} |
||||||
|
|
||||||
|
public static WqWqsinfBWrapper build() { |
||||||
|
return new WqWqsinfBWrapper(); |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public WqWqsinfBVo entityVO(WqWqsinfB entity) { |
||||||
|
WqWqsinfBVo wqWqsinfBVo = Objects.requireNonNull(BeanUtil.copy(entity, WqWqsinfBVo.class)); |
||||||
|
|
||||||
|
return wqWqsinfBVo; |
||||||
|
} |
||||||
|
} |
||||||
|
|
@ -0,0 +1,30 @@ |
|||||||
|
#服务器端口 |
||||||
|
server: |
||||||
|
port: 8200 |
||||||
|
|
||||||
|
#数据源配置 |
||||||
|
#spring: |
||||||
|
# datasource: |
||||||
|
# url: ${blade.datasource.dev.url} |
||||||
|
# username: ${blade.datasource.dev.username} |
||||||
|
# password: ${blade.datasource.dev.password} |
||||||
|
|
||||||
|
spring: |
||||||
|
#排除DruidDataSourceAutoConfigure |
||||||
|
autoconfigure: |
||||||
|
exclude: com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure |
||||||
|
datasource: |
||||||
|
dynamic: |
||||||
|
#设置默认的数据源或者数据源组,默认值即为master |
||||||
|
primary: master |
||||||
|
datasource: |
||||||
|
master: |
||||||
|
url: jdbc:mysql://127.0.0.1:3306/equipment?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&tinyInt1isBit=false&allowMultiQueries=true&serverTimezone=GMT%2B8&allowPublicKeyRetrieval=true |
||||||
|
username: root |
||||||
|
password: 123456 |
||||||
|
slave: |
||||||
|
url: jdbc:mysql://127.0.0.1:3306/equipment?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&tinyInt1isBit=false&allowMultiQueries=true&serverTimezone=GMT%2B8&allowPublicKeyRetrieval=true |
||||||
|
username: root |
||||||
|
password: 123456 |
||||||
|
demo: |
||||||
|
name: aaa |
@ -0,0 +1,28 @@ |
|||||||
|
#服务器端口 |
||||||
|
server: |
||||||
|
port: 8200 |
||||||
|
|
||||||
|
#数据源配置 |
||||||
|
#spring: |
||||||
|
# datasource: |
||||||
|
# url: ${blade.datasource.prod.url} |
||||||
|
# username: ${blade.datasource.prod.username} |
||||||
|
# password: ${blade.datasource.prod.password} |
||||||
|
|
||||||
|
spring: |
||||||
|
#排除DruidDataSourceAutoConfigure |
||||||
|
autoconfigure: |
||||||
|
exclude: com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure |
||||||
|
datasource: |
||||||
|
dynamic: |
||||||
|
#设置默认的数据源或者数据源组,默认值即为master |
||||||
|
primary: master |
||||||
|
datasource: |
||||||
|
master: |
||||||
|
url: ${blade.datasource.demo.master.url} |
||||||
|
username: ${blade.datasource.demo.master.username} |
||||||
|
password: ${blade.datasource.demo.master.password} |
||||||
|
slave: |
||||||
|
url: ${blade.datasource.demo.slave.url} |
||||||
|
username: ${blade.datasource.demo.slave.username} |
||||||
|
password: ${blade.datasource.demo.slave.password} |
@ -0,0 +1,28 @@ |
|||||||
|
#服务器端口 |
||||||
|
server: |
||||||
|
port: 8200 |
||||||
|
|
||||||
|
#数据源配置 |
||||||
|
#spring: |
||||||
|
# datasource: |
||||||
|
# url: ${blade.datasource.test.url} |
||||||
|
# username: ${blade.datasource.test.username} |
||||||
|
# password: ${blade.datasource.test.password} |
||||||
|
|
||||||
|
spring: |
||||||
|
#排除DruidDataSourceAutoConfigure |
||||||
|
autoconfigure: |
||||||
|
exclude: com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure |
||||||
|
datasource: |
||||||
|
dynamic: |
||||||
|
#设置默认的数据源或者数据源组,默认值即为master |
||||||
|
primary: master |
||||||
|
datasource: |
||||||
|
master: |
||||||
|
url: ${blade.datasource.demo.master.url} |
||||||
|
username: ${blade.datasource.demo.master.username} |
||||||
|
password: ${blade.datasource.demo.master.password} |
||||||
|
slave: |
||||||
|
url: ${blade.datasource.demo.slave.url} |
||||||
|
username: ${blade.datasource.demo.slave.username} |
||||||
|
password: ${blade.datasource.demo.slave.password} |
@ -0,0 +1,13 @@ |
|||||||
|
#mybatis-plus配置 |
||||||
|
mybatis-plus: |
||||||
|
mapper-locations: classpath:com/hnac/hzims/**/mapper/*Mapper.xml |
||||||
|
#实体扫描,多个package用逗号或者分号分隔 |
||||||
|
typeAliasesPackage: com.hnac.hzims.**.entity |
||||||
|
|
||||||
|
#swagger扫描路径配置 |
||||||
|
swagger: |
||||||
|
base-packages: |
||||||
|
- org.springbalde |
||||||
|
- com.hnac |
||||||
|
|
||||||
|
|
Loading…
Reference in new issue