提交 823beac9 authored 作者: zhoushaopan's avatar zhoushaopan

feat(自查模块): 自查自查两周后未完成的自查任务

自查自查两周后未完成的自查任务
上级 5fe3ecc1
package com.tykj.dev.device.selfcheck.service; package com.tykj.dev.device.selfcheck.service;
import com.tykj.dev.config.domin.CheckUnitInfo;
import com.tykj.dev.device.file.entity.FileRet; import com.tykj.dev.device.file.entity.FileRet;
import com.tykj.dev.device.library.subject.domin.DeviceLibrary; import com.tykj.dev.device.library.subject.domin.DeviceLibrary;
import com.tykj.dev.device.selfcheck.subject.domin.SelfCheckBill; import com.tykj.dev.device.selfcheck.subject.domin.SelfCheckBill;
...@@ -62,4 +63,9 @@ public interface SelfCheckBillService { ...@@ -62,4 +63,9 @@ public interface SelfCheckBillService {
List<DeviceLibrary> parseQrCode(List<String> strings); List<DeviceLibrary> parseQrCode(List<String> strings);
// Map<String,Object> selectDetail(Integer billId); // Map<String,Object> selectDetail(Integer billId);
/**
* 只要2周后未完成
*/
List<CheckUnitInfo> selectNoFinSh2Weeks();
} }
package com.tykj.dev.device.selfcheck.service.impl; package com.tykj.dev.device.selfcheck.service.impl;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.core.type.TypeReference;
import com.github.wenhao.jpa.PredicateBuilder; import com.github.wenhao.jpa.PredicateBuilder;
import com.github.wenhao.jpa.Specifications; import com.github.wenhao.jpa.Specifications;
...@@ -7,6 +8,7 @@ import com.tykj.dev.blockcha.subject.entity.BcHash; ...@@ -7,6 +8,7 @@ import com.tykj.dev.blockcha.subject.entity.BcHash;
import com.tykj.dev.blockcha.subject.service.BlockChainUtil; import com.tykj.dev.blockcha.subject.service.BlockChainUtil;
import com.tykj.dev.config.TaskBeanConfig; import com.tykj.dev.config.TaskBeanConfig;
import com.tykj.dev.config.base.FileName; import com.tykj.dev.config.base.FileName;
import com.tykj.dev.config.domin.CheckUnitInfo;
import com.tykj.dev.device.file.entity.FileRet; import com.tykj.dev.device.file.entity.FileRet;
import com.tykj.dev.device.file.service.FilesUtil; import com.tykj.dev.device.file.service.FilesUtil;
import com.tykj.dev.device.library.service.DeviceLibraryCacheService; import com.tykj.dev.device.library.service.DeviceLibraryCacheService;
...@@ -27,20 +29,25 @@ import com.tykj.dev.misc.exception.ApiException; ...@@ -27,20 +29,25 @@ import com.tykj.dev.misc.exception.ApiException;
import com.tykj.dev.misc.qrcode.*; import com.tykj.dev.misc.qrcode.*;
import com.tykj.dev.misc.qrcode.vo.DeviceCodeVO; import com.tykj.dev.misc.qrcode.vo.DeviceCodeVO;
import com.tykj.dev.misc.qrcode.vo.TaskData; import com.tykj.dev.misc.qrcode.vo.TaskData;
import com.tykj.dev.misc.utils.DateUtil;
import com.tykj.dev.misc.utils.JacksonUtil; import com.tykj.dev.misc.utils.JacksonUtil;
import com.tykj.dev.misc.utils.ResultUtil; import com.tykj.dev.misc.utils.ResultUtil;
import io.swagger.annotations.ApiModelProperty;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.domain.Page; import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.domain.Specification; import org.springframework.data.jpa.domain.Specification;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.scheduling.annotation.Async; import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.persistence.Transient; import javax.persistence.Transient;
import java.lang.reflect.Field; import java.lang.reflect.Field;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.*; import java.util.*;
import java.util.concurrent.CompletableFuture; import java.util.concurrent.CompletableFuture;
import java.util.function.Function; import java.util.function.Function;
...@@ -260,6 +267,38 @@ public class SelfCheckBillServiceImpl implements SelfCheckBillService { ...@@ -260,6 +267,38 @@ public class SelfCheckBillServiceImpl implements SelfCheckBillService {
return deviceLibraries; return deviceLibraries;
} }
@Override
public List<CheckUnitInfo> selectNoFinSh2Weeks() {
List<Integer> statusList = new ArrayList<>(Arrays.asList(0,3));
List<SelfCheckBill> checkBillList = selfExaminationBillDao.findAll().stream()
.filter(selfCheckBill -> statusList.contains(selfCheckBill.getCheckStatus()))
.filter(selfCheckBill -> LocalDateTime.now().isEqual(DateUtil.getLocalDateTime(selfCheckBill.getCheckTime()).plusWeeks(2)))
.collect(Collectors.toList());
List<CheckUnitInfo> checkUnitInfoList = new ArrayList<>();
if (checkBillList.size() > 0){
checkBillList.forEach(selfCheckBill -> {
CheckUnitInfo checkUnitInfo = new CheckUnitInfo();
checkUnitInfo.setStartTime(DateUtil.getLocalDateTime(selfCheckBill.getCheckTime()));
checkUnitInfo.setUnitId(selfCheckBill.getCheckUnitId());
checkUnitInfo.setType(3);
checkUnitInfo.setBillId(selfCheckBill.getId());
if (selfCheckBill.getCheckStatus() == 0){
checkUnitInfo.setCheckOneInfo(0);
checkUnitInfo.setCheckTwoInfo(0);
checkUnitInfo.setCheckThreeInfo(-1);
}
if (selfCheckBill.getCheckStatus() == 3){
checkUnitInfo.setCheckOneInfo(1);
checkUnitInfo.setCheckTwoInfo(0);
checkUnitInfo.setCheckThreeInfo(-1);
}
checkUnitInfoList.add(checkUnitInfo);
});
}
return checkUnitInfoList;
}
// @Override // @Override
// public Map<String, Object> selectDetail(Integer billId) { // public Map<String, Object> selectDetail(Integer billId) {
// Map<Integer, DeviceLibrary> deviceLibraryMap = // Map<Integer, DeviceLibrary> deviceLibraryMap =
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论