提交 215018f5 authored 作者: LJJ's avatar LJJ

合并分支 'feature-screen' 到 'dev'

Feature screen 查看合并请求 !99
......@@ -6,6 +6,8 @@ import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.List;
/**
* 大屏自核查地图展示VO
*
......@@ -24,6 +26,8 @@ public class MapCheckVO {
@ApiModelProperty(value = "区域名称")
private String areaName;
@ApiModelProperty(value = "预警信息")
private List<CheckUnitInfoList> data;
}
......@@ -352,9 +352,18 @@ public class DeviceCheckController {
log.info("[核查] 刷新在库/不在库,bill id :{}", id);
refreshDetail(id);
}
CheckDetailVo detailVoList = detailRepo.findById(id)
.map(transUtil::CheckDetailDo2Vo)
.orElse(null);
DeviceCheckDetail byId = detailRepo.findById(id).orElse(new DeviceCheckDetail());
Integer filter = byId.getFilter();
if (filter == null) {
filter = 0;
}
CheckDetailVo detailVoList = transUtil.CheckDetailDo2Vo(byId);
// byId
// .map(transUtil::CheckDetailDo2Vo)
// .orElse(null);
List<DeviceInLibVo> mapTemp = confirmCheckTask.hisInLib.get(id);
......
......@@ -267,9 +267,9 @@ public class ExamController {
cityStatTask = taskService.start(cityStatTask);
// 获取所有在库装备 ls == 2 or ls == 14
Map<String, List<DeviceLibrary>> devInLib = dcService.getAllDeviceLibraryList().stream()
.filter(d -> d.getLifeStatus() == 2 || d.getLifeStatus() == 14)
.collect(groupingBy(DeviceLibrary::getOwnUnit));
Stream<DeviceLibrary> deviceLibraryStream1 = dcService.getAllDeviceLibraryList().stream()
.filter(d -> d.getLifeStatus() == 2 || d.getLifeStatus() == 14);
Map<String, List<DeviceLibrary>> devInLib = new HashMap<>();
// 非在库装备 ls !=2 and ls !=14
Stream<DeviceLibrary> deviceLibraryStream = dcService.getAllDeviceLibraryList().stream()
......@@ -279,13 +279,16 @@ public class ExamController {
switch (filter) {
case 1:
// 维修状态 4
devInLib = deviceLibraryStream1.filter(d -> d.getLifeStatus() != 4).collect(groupingBy(DeviceLibrary::getOwnUnit));
devNotInLib = deviceLibraryStream.filter(d -> d.getLifeStatus() != 4).collect(groupingBy(DeviceLibrary::getOwnUnit));
break;
case 2:
// 过滤退役中 16
devInLib = deviceLibraryStream1.filter(d -> d.getLifeStatus() != 16).collect(groupingBy(DeviceLibrary::getOwnUnit));
devNotInLib = deviceLibraryStream.filter(d -> d.getLifeStatus() != 16).collect(groupingBy(DeviceLibrary::getOwnUnit));
break;
case 3:
devInLib = deviceLibraryStream1.filter(d -> d.getLifeStatus() != 16).filter(d -> d.getLifeStatus() != 4).collect(groupingBy(DeviceLibrary::getOwnUnit));
devNotInLib = deviceLibraryStream.filter(d -> d.getLifeStatus() != 16).filter(d -> d.getLifeStatus() != 4).collect(groupingBy(DeviceLibrary::getOwnUnit));
break;
default:
......
package com.tykj.dev.device.confirmcheck.service;
import com.tykj.dev.config.domin.CheckUnitInfo;
import java.util.List;
/**
* 装备大屏-核查相关service
*
......@@ -8,5 +12,6 @@ package com.tykj.dev.device.confirmcheck.service;
**/
public interface CheckScreenService {
List<CheckUnitInfo> statMapData();
}
......@@ -36,7 +36,7 @@ public class CheckScreenServiceImpl implements CheckScreenService {
@Autowired
private DeviceCheckStatDao statDao;
public void statMapData() {
public List<CheckUnitInfo> statMapData() {
PredicateBuilder<DeviceCheckStat> and = Specifications.and();
......@@ -71,6 +71,7 @@ public class CheckScreenServiceImpl implements CheckScreenService {
}
}
return rs;
}
......
......@@ -356,6 +356,27 @@ public class ObjTransUtil {
.orElseThrow(() -> new ApiException(
ResponseEntity.badRequest().body(String.format("检查到装备序号为%d的装备不在资料库中,请先执行入库操作!", deviceId)))).setConfigName();
Integer filter = detailDo.getFilter();
if (filter == null) {
filter = 0;
}
switch (filter) {
case 1:
if (device.getLifeStatus() == 4 ) {
continue;
}
case 2:
if (device.getLifeStatus() == 16 ) {
continue;
}
case 3:
if (device.getLifeStatus() == 4 || device.getLifeStatus() == 16 ) {
continue;
}
default:
}
// DeviceLibrary device = deviceRepo.findById(deviceId).orElseThrow(
// () -> new ApiException(ResponseEntity.badRequest().body(String.format("检查到装备序号为%d的装备不在资料库中,请先执行入库操作!", deviceId)))).setConfigName();
//依据proofResult的个位数 判断是否是在库装备
......
<?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">
<parent>
<artifactId>equip</artifactId>
<groupId>com.tykj</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>dev-screen</artifactId>
<properties>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
</properties>
<dependencies>
<dependency>
<groupId>com.tykj</groupId>
<artifactId>dev-user</artifactId>
</dependency>
<dependency>
<groupId>com.tykj.dev</groupId>
<artifactId>config</artifactId>
</dependency>
<dependency>
<groupId>com.tykj</groupId>
<artifactId>dev-confirmcheck</artifactId>
</dependency>
<dependency>
<groupId>com.tykj</groupId>
<artifactId>dev-user</artifactId>
</dependency>
<dependency>
<groupId>com.tykj.dev</groupId>
<artifactId>misc</artifactId>
</dependency>
<dependency>
<groupId>com.tykj.dev</groupId>
<artifactId>config</artifactId>
</dependency>
</dependencies>
</project>
\ No newline at end of file
package com.tykj.dev.device.screen;
import org.springframework.boot.autoconfigure.SpringBootApplication;
/**
* @author ozoz
* @date 2022/11/22
**/
@SpringBootApplication(scanBasePackages = {
"com.tykj.dev.device.*"
})
public class ScreenApp {
public static void main(String[] args) {
}
}
package com.tykj.dev.device.screen.subject.service;
import com.tykj.dev.config.domin.CheckUnitInfo;
import com.tykj.dev.device.confirmcheck.service.CheckScreenService;
import com.tykj.dev.device.selfcheck.service.SelfCheckBillService;
import com.tykj.dev.device.user.subject.dao.RegionDataDao;
import com.tykj.dev.device.user.subject.dao.UnitsDao;
import com.tykj.dev.device.user.subject.entity.RegionData;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* @author ozoz
* @date 2022/11/22
**/
@Component
@Slf4j
public class CheckMapTask {
private final static String ZJ_ID = "8017d86d-cf3c-1fe3-90ea-f8a8333a2254";
Map<Integer, List<CheckUnitInfo>> collect = new HashMap<>();
@Autowired
private UnitsDao unitsDao;
@Autowired
private RegionDataDao regionDataDao;
@Autowired
private CheckScreenService checkScreenService;
@Autowired
private SelfCheckBillService selfCheckBillService;
public void initArea() {
// 查到了所有市的信息
List<RegionData> shis = regionDataDao.findAllByParentId(ZJ_ID);
shis.forEach(o -> o.setRegionDatas(regionDataDao.findAllByParentId(o.getRegionId())));
}
public Map<Integer, List<CheckUnitInfo>> init() {
List<CheckUnitInfo> checkUnitInfos = checkScreenService.statMapData();
List<CheckUnitInfo> selfExamination = selfCheckBillService.selectNoFinSh2Weeks();
checkUnitInfos.addAll(selfExamination);
Map<Integer, List<CheckUnitInfo>> collect = checkUnitInfos.stream().collect(Collectors.groupingBy(CheckUnitInfo::getUnitId));
return collect;
}
}
# port
server.port=8088
server.port=8087
spring.application.name=equipment
spring.profiles.active=@activatedProperties@
logging.file=/opt/eqlog/equip.log
......
......@@ -75,4 +75,6 @@ public interface UnitsDao extends JpaRepository<Units, Integer>, JpaSpecificatio
List<Units> findByTypeAndEscrow(int type, int escrow);
List<Units> findAllByNameLike(String unitName);
}
......@@ -8,6 +8,8 @@ import lombok.NoArgsConstructor;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.util.List;
@Table(name = "region_data")
......@@ -44,5 +46,8 @@ public class RegionData {
*/
private String parentId;
@Transient
private List<RegionData> regionDatas;
}
package com.tykj.dev.device.user.util;
import com.tykj.dev.device.user.subject.dao.RegionDataDao;
import com.tykj.dev.device.user.subject.dao.UnitsDao;
import com.tykj.dev.device.user.subject.entity.RegionData;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.List;
/**
* @author ozoz
* @date 2022/11/21
......@@ -17,10 +21,18 @@ public class RegionUtil {
private final static String ZJ_ID = "8017d86d-cf3c-1fe3-90ea-f8a8333a2254";
@Autowired
private UnitsDao unitsDao;
@Autowired
private RegionDataDao regionDataDao;
public void initRegion() {
// regionDataDao.find
// 查到了所有市的信息
List<RegionData> shis = regionDataDao.findAllByParentId(ZJ_ID);
shis.forEach(o -> o.setRegionDatas(regionDataDao.findAllByParentId(o.getRegionId())));
}
}
......@@ -51,6 +51,7 @@
<module>dev-questionbank</module>
<module>dev-zxing</module>
<module>dev-readmachine</module>
<module>dev-screen</module>
</modules>
<properties>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论