|
@@ -4,6 +4,7 @@ import cn.hutool.core.util.ObjectUtil;
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
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.IndustryOutput;
|
|
|
import com.huimv.cattle.mapper.IndustryOutputMapper;
|
|
@@ -40,6 +41,8 @@ public class IndustryOutputServiceImpl extends ServiceImpl<IndustryOutputMapper,
|
|
|
private DataSourceService dataSourceService;
|
|
|
@Autowired
|
|
|
private DateUtil dateUtil;
|
|
|
+ @Autowired
|
|
|
+ private SysRegionCounTownVillMapper sysRegionCounTownVillMapper;
|
|
|
|
|
|
@Override
|
|
|
public Result getIndustryOutput(HttpServletRequest request, Map<String, String> paramsMap) {
|
|
@@ -98,16 +101,34 @@ public class IndustryOutputServiceImpl extends ServiceImpl<IndustryOutputMapper,
|
|
|
|
|
|
@Override
|
|
|
public Result getIndustryOutputScreen(HttpServletRequest request, Map<String, String> paramsMap) {
|
|
|
+ String farmCode = paramsMap.get("farmCode");
|
|
|
+ if (StringUtils.isBlank(farmCode)) {
|
|
|
+ farmCode = TokenSign.getFarmCode(request);
|
|
|
+ }
|
|
|
DataSource dataSource = dataSourceService.getDataSourceStatus();
|
|
|
+ String cityCode;
|
|
|
+ String[] city;
|
|
|
+ List<String> subCityList = new ArrayList<>();
|
|
|
if (dataSource.getDsStatus() == 1 && dataSource.getViewType() ==2) {
|
|
|
- List<IndustryOutput> industryOutputs = industryOutputMapper.getIndustryOutputScreen();
|
|
|
+ cityCode = sysRegionCounTownVillMapper.listSub(farmCode);
|
|
|
+ city = cityCode.split(",");
|
|
|
+ List<IndustryOutput> industryOutputs = industryOutputMapper.getIndustryOutputScreen(city);
|
|
|
+ return new Result(ResultCode.SUCCESS,industryOutputs);
|
|
|
+ }else if (dataSource.getDsStatus() == 1 && dataSource.getViewType() ==3){
|
|
|
+ cityCode = sysRegionCounTownVillMapper.listSub(farmCode);
|
|
|
+ city = cityCode.split(",");
|
|
|
+ for (String s : city) {
|
|
|
+ String subCityCode = sysRegionCounTownVillMapper.listSub(s);
|
|
|
+ String[] strings = subCityCode.split(",");
|
|
|
+ for (String string : strings) {
|
|
|
+ subCityList.add(string);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ String[] subCity = subCityList.toArray(new String[subCityList.size()]);
|
|
|
+ List<IndustryOutput> industryOutputs = industryOutputMapper.getIndustryOutputScreen(subCity);
|
|
|
return new Result(ResultCode.SUCCESS,industryOutputs);
|
|
|
}
|
|
|
|
|
|
- String farmCode = paramsMap.get("farmCode");
|
|
|
- if (StringUtils.isBlank(farmCode)) {
|
|
|
- farmCode = TokenSign.getFarmCode(request);
|
|
|
- }
|
|
|
String yearNum = paramsMap.get("yearNum");
|
|
|
// if (StringUtils.isBlank(yearNum)){
|
|
|
// yearNum = "0";
|