提交 e05332d1 authored 作者: zhoushaopan's avatar zhoushaopan

feat(区域模块,统计模块): 新增根据类型查询区域

新增根据类型查询区域
上级 7436cebe
......@@ -29,6 +29,7 @@ import com.tykj.dev.device.user.subject.dao.UserDao;
import com.tykj.dev.device.user.subject.entity.Area;
import com.tykj.dev.device.user.subject.entity.Units;
import com.tykj.dev.device.user.subject.entity.User;
import com.tykj.dev.device.user.subject.service.AreaService;
import com.tykj.dev.device.user.subject.service.UnitsService;
import com.tykj.dev.device.user.util.UserUtils;
import com.tykj.dev.misc.exception.ApiException;
......@@ -506,6 +507,9 @@ public class StatisticalServiceImpl implements StatisticalService {
/**
* 获取工作台统计
*/
@Autowired
private AreaService areaService;
@Override
public WorkBench getWorkBenchStat() {
Integer unit = userUtils.getCurrentUnitId();
......@@ -514,6 +518,7 @@ public class StatisticalServiceImpl implements StatisticalService {
DeviceLibrarySelectVo deviceLibrarySelectVo = new DeviceLibrarySelectVo();
// deviceLibrarySelectVo.setAreaId(areaCache.findByName("浙江省").getId());
deviceLibrarySelectVo.setAreaId(areaCache.findByName("浙江省").getId());
deviceLibrarySelectVo.setAreaId(areaService.findByType(1).getId());
workBench.setPackingNum(packingLibraryDao.findAllByIsRootAndPackingStatus(0,2).size());
List<DeviceLibrary> deviceLibraries = deviceLibraryService.getCoreDevicePage(deviceLibrarySelectVo);
workBench.setAllDeviceNum(deviceLibraries.size());
......
......@@ -27,4 +27,6 @@ public interface AreaDao extends JpaRepository<Area, Integer>, JpaSpecificationE
String findNameById(int id);
List<Area> findAllByTypeInOrderByTypeAsc(List<Integer> types);
Area findByType(Integer type);
}
......@@ -36,4 +36,11 @@ public interface AreaService extends PublicService<Area> {
Area findByIdTosuperiorArea(Integer areaId);
/**
* 根据类型查询区域
* @param type 1是省
* @return 区域对象
*/
Area findByType(Integer type);
}
......@@ -136,6 +136,11 @@ public class AreaServiceImpl implements AreaService {
return area;
}
@Override
public Area findByType(Integer type) {
return areaDao.findByType(type);
}
private List<Integer> areaId(List<Integer> ids,Integer areaId){
List<Area> areas= areaDao.findAllByFatherId(areaId);
ids.add(areaId);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论