提交 21efa0c5 authored 作者: zjm's avatar zjm

feat(统计模块): 添加了查询浙江省本级清退zb

添加了查询浙江省本级清退zb
上级 ec14ceef
......@@ -18,10 +18,12 @@ import com.tykj.dev.device.screen.subject.service.ScreeService;
import com.tykj.dev.device.screen.subject.vo.LeftOneVO;
import com.tykj.dev.device.selfcheck.repository.SelfCheckBillDao;
import com.tykj.dev.device.sendback.repository.DeviceRepelDao;
import com.tykj.dev.device.sendback.service.RepelQueryService;
import com.tykj.dev.device.storage.repository.StorageBillDao;
import com.tykj.dev.device.task.repository.TaskDao;
import com.tykj.dev.device.task.subject.domin.Task;
import com.tykj.dev.device.user.cache.UnitsCache;
import com.tykj.dev.device.user.cache.UserCache;
import com.tykj.dev.device.user.subject.dao.UnitsDao;
import com.tykj.dev.device.user.subject.entity.Units;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -53,6 +55,9 @@ public class ScreeServiceImpl implements ScreeService {
@Resource
private AllotBillDao allotBillDao;
@Resource
private UserCache userCache;
@Resource
private SelfCheckBillDao selfCheckBillDao;
......@@ -95,6 +100,9 @@ public class ScreeServiceImpl implements ScreeService {
@Resource
private InitUnitScree initUnitScree;
@Autowired
RepelQueryService repelQueryService;
@Override
public Map<String, Object> getScreeAroundData() {
......@@ -104,11 +112,15 @@ public class ScreeServiceImpl implements ScreeService {
//入库数量
leftOneVO.setStorageCount(storageBillDao.getStorageCount());
//清退数量 todo --zjm
leftOneVO.setSendBackCount(repelQueryService.queryCountSameLevel());
//库存总数量
leftOneVO.setTotalDevicesCount(deviceLibraryDao.getInLibraryCount());
map.put("leftOneVO", leftOneVO);
//todo --zjm 人员管理
long count = userCache.findAll().stream().filter(user -> user.getPosition() != 2).count();
//左边第三个(ZB库存)
// List<Map<String, Object>> leftThree = deviceLibraryDao.getInCountByUnit();
......
......@@ -20,4 +20,6 @@ public interface DeviceRepelDetailDao extends JpaRepository<DeviceRepelDetail, I
@Modifying
@Query(value = "update DeviceRepelDetail d set d.deleteTag = ?1 where d.id in ?2")
int updateDeviceRepelDetailIsDelByIds(Integer deleteTag, List<Integer> ids);
List<DeviceRepelDetail> findAllByRepelType(Integer repelType);
}
......@@ -49,4 +49,6 @@ public interface DeviceRepelDetailService {
int updateDeviceRepelDetailByIds(Integer deleteTag, List<Integer> ids);
List<DeviceRepelDetail> queryRepelTypeThree();
}
......@@ -136,4 +136,9 @@ public interface RepelQueryService {
* 根据taskId查询相关文件接口(设备日志使用)
*/
Map<String, List<FileRet>> findByTaskIdToFileMapList(Integer taskId);
/**
* 查询省本级清退数量
*/
Integer queryCountSameLevel();
}
......@@ -140,6 +140,11 @@ public class DeviceRepelDetailServiceImpl implements DeviceRepelDetailService {
return deviceRepelDetailDao.updateDeviceRepelDetailIsDelByIds(deleteTag,ids);
}
@Override
public List<DeviceRepelDetail> queryRepelTypeThree() {
return deviceRepelDetailDao.findAllByRepelType(3);
}
private Specification<DeviceRepelDetail> getFindRetiredSpecification(RepelDetailSelectVo repelDetailSelectVo) {
PredicateBuilder<DeviceRepelDetail> predicateBuilder = Specifications.and();
......
......@@ -33,6 +33,7 @@ import javax.persistence.Transient;
import java.lang.reflect.Field;
import java.util.*;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicReference;
import java.util.stream.Collectors;
/**
......@@ -631,6 +632,21 @@ public class RepelQueryServiceImpl implements RepelQueryService {
return repelDetailService.findByIdToFileMapList(taskBto.getBillId());
}
@Override
public Integer queryCountSameLevel() {
List<DeviceRepelDetail> deviceRepelDetails = repelDetailService.queryRepelTypeThree();
AtomicReference<Integer> count= new AtomicReference<>(0);
deviceRepelDetails.forEach(deviceRepelDetail -> {
if (deviceRepelDetail.getScriptJson()!=null&&!"".equals(deviceRepelDetail.getScriptJson())) {
Integer collect = JacksonUtil.readValue(deviceRepelDetail.getScriptJson(), new TypeReference<List<ScriptSaveVo>>() {
}).stream().mapToInt(ScriptSaveVo::getNum).sum();
count.getAndSet(count.get() + collect);
}
});
return count.get();
}
private Specification<DeviceLibrary> getRepelDeviceSpecificationIn(RepelManagementVo repelManagementVo) {
PredicateBuilder<DeviceLibrary> predicateBuilder = getPredicateBuilder(repelManagementVo);
//unitId为空,默认查询当前单位
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论