提交 f639093e authored 作者: 邓砥奕's avatar 邓砥奕

[统计分析]实现装备统计、自查统计service层,添加统计分析模块启动类

上级 e7b35eae
...@@ -46,7 +46,7 @@ public class SelfCheckSchedulerTask { ...@@ -46,7 +46,7 @@ public class SelfCheckSchedulerTask {
/** /**
* 季度 * 季度
*/ */
private String cron2 = "0 0 0 1 3,6,9,12 ? "; private String cron2 = "0 0 0 1 1,4,7,10 ? ";
/** /**
* 年度 * 年度
*/ */
......
...@@ -104,7 +104,7 @@ public class SelfCheckController { ...@@ -104,7 +104,7 @@ public class SelfCheckController {
/** /**
* 季度 * 季度
*/ */
private String cron2 = "0 0 0 1 3,6,9,12 ? "; private String cron2 = "0 0 0 1 1,4,7,10 ? ";
/** /**
* 年度 * 年度
*/ */
......
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" <project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent> <parent>
<artifactId>equip</artifactId> <artifactId>equip</artifactId>
...@@ -24,6 +24,14 @@ ...@@ -24,6 +24,14 @@
<groupId>com.tykj.dev</groupId> <groupId>com.tykj.dev</groupId>
<artifactId>config</artifactId> <artifactId>config</artifactId>
</dependency> </dependency>
<dependency>
<groupId>com.tykj</groupId>
<artifactId>dev-library</artifactId>
</dependency>
<dependency>
<groupId>com.tykj</groupId>
<artifactId>dev-selfcheck</artifactId>
</dependency>
</dependencies> </dependencies>
</project> </project>
\ No newline at end of file
...@@ -9,8 +9,16 @@ package com.tykj.dev.statistical.controller; ...@@ -9,8 +9,16 @@ package com.tykj.dev.statistical.controller;
*/ */
import com.tykj.dev.config.swagger.AutoDocument; import com.tykj.dev.config.swagger.AutoDocument;
import com.tykj.dev.device.library.repository.DeviceLibraryDao;
import com.tykj.dev.device.library.subject.domin.DeviceLibrary;
import com.tykj.dev.device.user.subject.dao.AreaDao;
import com.tykj.dev.device.user.subject.dao.UnitsDao;
import com.tykj.dev.device.user.subject.entity.Area;
import com.tykj.dev.device.user.subject.entity.Units;
import com.tykj.dev.statistical.service.StatisticalService;
import com.tykj.dev.statistical.vo.*; import com.tykj.dev.statistical.vo.*;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.RequestEntity; import org.springframework.http.RequestEntity;
import org.springframework.http.ResponseEntity; import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
...@@ -20,6 +28,7 @@ import org.springframework.web.bind.annotation.RestController; ...@@ -20,6 +28,7 @@ import org.springframework.web.bind.annotation.RestController;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.stream.Collectors;
@RestController @RestController
@Api(tags = "统计业务模块", description = "统计相关接口") @Api(tags = "统计业务模块", description = "统计相关接口")
...@@ -27,6 +36,8 @@ import java.util.List; ...@@ -27,6 +36,8 @@ import java.util.List;
@RequestMapping("/statistical") @RequestMapping("/statistical")
public class StatisticalController { public class StatisticalController {
@Autowired
private StatisticalService statisticalService;
/** /**
* 查询各市的装备数量 * 查询各市的装备数量
...@@ -34,35 +45,41 @@ public class StatisticalController { ...@@ -34,35 +45,41 @@ public class StatisticalController {
*/ */
@GetMapping("/devNum") @GetMapping("/devNum")
public ResponseEntity selectDevNum(){ public ResponseEntity selectDevNum(){
List<DevNum> nums=new ArrayList<>(); return ResponseEntity.ok(statisticalService.getDeviceNum());
return ResponseEntity.ok(nums);
} }
/** /**
* 查询各市装备生命状态数量 * 查询全省或各市装备生命状态数量
* @return 各市装备生命状态对象集合 * @return 全省或各市装备生命状态对象集合
*/ */
@GetMapping("/StateofLife") @GetMapping("/StateofLife/{type}")
public ResponseEntity selectStateofLife(){ public ResponseEntity selectStateofLife(@PathVariable Integer type){
List<DevLifeSector> nums=new ArrayList<>(); return ResponseEntity.ok(statisticalService.getLifeStatus(type));
return ResponseEntity.ok(nums);
} }
/** /**
* 查询各市自查情况数量 * 查询当前季度各市自查情况
* @return 各市装备生命状态对象集合 * @return 各市自查状态对象集合
*/ */
@GetMapping("/selfInspection/{type}") @GetMapping("/selfInspection")
public ResponseEntity selectSelfInspection(@PathVariable Integer type){ public ResponseEntity selectSelfInspection(){
List<SelfInspection> nums=new ArrayList<>(); return ResponseEntity.ok(statisticalService.getSelfCheck());
return ResponseEntity.ok(nums); }
/**
* 查询年度各季度各市自查情况
* @return 各市自查状态对象集合
*/
@GetMapping("/selfInspection/year")
public ResponseEntity selectYearSelfInspection(){
return ResponseEntity.ok(statisticalService.getYearSelfCheck());
} }
/** /**
* 查询各市核查情况数量 * 查询各市核查情况数量
* @return 各市装备生命状态对象集合 * @return 各市核查状态对象集合
*/ */
@GetMapping("/selfInspection/{type}") @GetMapping("/confirmInspection/{type}")
public ResponseEntity selectVerification(@PathVariable Integer type){ public ResponseEntity selectVerification(@PathVariable Integer type){
List<Verification> nums=new ArrayList<>(); List<Verification> nums=new ArrayList<>();
return ResponseEntity.ok(nums); return ResponseEntity.ok(nums);
......
package com.tykj.dev.statistical.service;
import com.tykj.dev.statistical.vo.DevLifeSector;
import com.tykj.dev.statistical.vo.DevNum;
import com.tykj.dev.statistical.vo.SelfInspection;
import com.tykj.dev.statistical.vo.YearSelfInspection;
import java.util.List;
/**
* @author dengdiyi
*/
public interface StatisticalService {
/**
* 获取装备统计信息
*/
List<DevNum> getDeviceNum();
/**
* @param type 类型(1:省,2:市)
* 获取装备生命状态统计信息
*/
List<DevLifeSector> getLifeStatus(Integer type);
/**
* 获取季度自查统计信息
*/
List<SelfInspection> getSelfCheck();
/**
* 获取年度自查统计信息
*/
List<YearSelfInspection> getYearSelfCheck();
}
package com.tykj.dev.statistical;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
/**
* @author zjm
* @version 1.0.0
* @ClassName userApp.java
* @Description TODO
* @createTime 2020年09月01日 14:32:00
*/
@SpringBootApplication(scanBasePackages = {
"com.tykj.dev.*",
}
)
public class statisticalApp {
public static void main(String[] args) {
SpringApplication.run(statisticalApp.class, args);
}
}
package com.tykj.dev.statistical.vo; package com.tykj.dev.statistical.vo;
import lombok.Data;
/** /**
* @author zjm * @author zjm
* @version 1.0.0 * @version 1.0.0
...@@ -7,6 +9,7 @@ package com.tykj.dev.statistical.vo; ...@@ -7,6 +9,7 @@ package com.tykj.dev.statistical.vo;
* @Description 各市扇形生命状态统计 * @Description 各市扇形生命状态统计
* @createTime 2020年10月16日 09:55:00 * @createTime 2020年10月16日 09:55:00
*/ */
@Data
public class DevLifeSector { public class DevLifeSector {
/** /**
* 市名称 * 市名称
...@@ -21,7 +24,7 @@ public class DevLifeSector { ...@@ -21,7 +24,7 @@ public class DevLifeSector {
/** /**
* 维修数量 * 维修数量
*/ */
private Integer maintenanceConut; private Integer maintenanceCount;
/** /**
* 报废数量 * 报废数量
......
package com.tykj.dev.statistical.vo; package com.tykj.dev.statistical.vo;
import lombok.Data;
/** /**
* @author zjm * @author zjm
* @version 1.0.0 * @version 1.0.0
...@@ -7,6 +9,7 @@ package com.tykj.dev.statistical.vo; ...@@ -7,6 +9,7 @@ package com.tykj.dev.statistical.vo;
* @Description 统计分析 市级 本市装备数量 * @Description 统计分析 市级 本市装备数量
* @createTime 2020年10月15日 10:35:00 * @createTime 2020年10月15日 10:35:00
*/ */
@Data
public class DevNum { public class DevNum {
/** /**
* 区域名称 * 区域名称
...@@ -16,6 +19,6 @@ public class DevNum { ...@@ -16,6 +19,6 @@ public class DevNum {
/** /**
* 区域装备总数 * 区域装备总数
*/ */
private Integer conut; private Integer count;
} }
package com.tykj.dev.statistical.vo;
import lombok.Data;
import java.util.List;
/**
* @author dengdiyi
* 年度中每季度自查统计
*/
@Data
public class PerQuarter {
/**
* 完成数量
*/
private Integer completeCount;
/**
* 未完成数量
*/
private Integer noCompleteCount;
/**
* 未完成单位
*/
private List<String> noCompleteUnits;
}
package com.tykj.dev.statistical.vo; package com.tykj.dev.statistical.vo;
import lombok.Data;
/** /**
* @author zjm * @author zjm
* @version 1.0.0 * @version 1.0.0
...@@ -7,6 +9,7 @@ package com.tykj.dev.statistical.vo; ...@@ -7,6 +9,7 @@ package com.tykj.dev.statistical.vo;
* @Description 自查各市完成情况 * @Description 自查各市完成情况
* @createTime 2020年10月16日 10:30:00 * @createTime 2020年10月16日 10:30:00
*/ */
@Data
public class SelfInspection { public class SelfInspection {
/** /**
* 市 名称 * 市 名称
......
package com.tykj.dev.statistical.vo;
import lombok.Data;
/**
* @author dengdiyi
* 年度自查统计详情vo
*/
@Data
public class YearSelfInspection {
/**
* 市 名称
*/
private String areaName;
/**
* 第一季度统计
*/
private PerQuarter firstQuarter;
/**
* 第二季度统计
*/
private PerQuarter secondQuarter;
/**
* 第三季度统计
*/
private PerQuarter thirdQuarter;
/**
* 第四季度统计
*/
private PerQuarter fourthQuarter;
}
...@@ -358,6 +358,17 @@ ...@@ -358,6 +358,17 @@
</exclusion> </exclusion>
</exclusions> </exclusions>
</dependency> </dependency>
<dependency>
<groupId>com.tykj</groupId>
<artifactId>dev-statistical</artifactId>
<version>1.0-SNAPSHOT</version>
<exclusions>
<exclusion>
<groupId>com.tykj.dev</groupId>
<artifactId>union</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- Spring Security Test --> <!-- Spring Security Test -->
<dependency> <dependency>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论