|
@@ -3,8 +3,10 @@ package com.huimv.cattle.service.impl;
|
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.huimv.cattle.mapper.SysRegionCounTownVillMapper;
|
|
|
+import com.huimv.cattle.pojo.DataSource;
|
|
|
import com.huimv.cattle.pojo.Supervise;
|
|
|
import com.huimv.cattle.mapper.SuperviseMapper;
|
|
|
+import com.huimv.cattle.service.DataSourceService;
|
|
|
import com.huimv.cattle.service.SuperviseService;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.huimv.common.utils.Result;
|
|
@@ -31,6 +33,8 @@ public class SuperviseServiceImpl extends ServiceImpl<SuperviseMapper, Supervise
|
|
|
private SuperviseMapper superviseMapper;
|
|
|
@Autowired
|
|
|
private SysRegionCounTownVillMapper sysRegionCounTownVillMapper;
|
|
|
+ @Autowired
|
|
|
+ private DataSourceService dataSourceService;
|
|
|
@Override
|
|
|
public Result getSupervise(String farmCode) {
|
|
|
Map map = new HashMap();
|
|
@@ -51,10 +55,14 @@ public class SuperviseServiceImpl extends ServiceImpl<SuperviseMapper, Supervise
|
|
|
|
|
|
@Override
|
|
|
public Result getSuperviseScreen(String farmCode) {
|
|
|
-// String s = superviseVillageGatValue(farmCode);
|
|
|
-// System.out.println(s);
|
|
|
-// return new Result(ResultCode.SUCCESS,s);
|
|
|
- return null;
|
|
|
+ DataSource dataSource = dataSourceService.getDataSourceStatus();
|
|
|
+ Result supervise = null;
|
|
|
+ if (dataSource.getDsStatus() == 1 && dataSource.getViewType() ==2){
|
|
|
+ supervise = getSupervise(farmCode);
|
|
|
+ }else if (dataSource.getDsStatus() == 1 && dataSource.getViewType() == 3){
|
|
|
+ supervise = getSupervise(sysRegionCounTownVillMapper.listSub(farmCode));
|
|
|
+ }
|
|
|
+ return supervise;
|
|
|
}
|
|
|
|
|
|
private String superviseGatValue(String farmCode,String key) {
|
|
@@ -75,15 +83,4 @@ public class SuperviseServiceImpl extends ServiceImpl<SuperviseMapper, Supervise
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- private String superviseVillageGatValue(String farmCode) {
|
|
|
-// String[] city = sysRegionCounTownVillMapper.listSub(farmCode).split(",");
|
|
|
-// SuperviseVo supervise = superviseMapper.superviseVillageGatValue(city);
|
|
|
-// if (ObjectUtil.isEmpty(supervise)){
|
|
|
-// return "0";
|
|
|
-// }else {
|
|
|
-// return supervise.getData();
|
|
|
-// }
|
|
|
- return null;
|
|
|
- }
|
|
|
-
|
|
|
}
|