提交 51ca6132 authored 作者: renjianyu's avatar renjianyu

--no commit message

上级 6ea8f0bd
......@@ -152,16 +152,16 @@ public class FgResourceLibraryController {
if (StringUtils.isNotBlank(ch[0])) {
// 所在地域
fqSq.append(" || province : *" + ch[1] + "* ");
fqSq.append(" || city : *" + ch[1] + "* ");
fqSq.append(" || county : *" + ch[1] + "* ");
fqSq.append(" || province : *" + ch[0] + "* ");
fqSq.append(" || city : *" + ch[0] + "* ");
fqSq.append(" || county : *" + ch[0] + "* ");
// 标准企业查询时赋值申请人地址
if (form.getReserve2().equals("1")) {
fqSq.append(" || applicantAddress : *" + ch[1] + "* ");
fqSq.append(" || applicantAddress : *" + ch[0] + "* ");
}
// 核准企业查询时赋值地址
if (form.getReserve2().equals("2")) {
fqSq.append(" || address : *" + ch[1] + "* ");
fqSq.append(" || address : *" + ch[0] + "* ");
}
}
......@@ -171,7 +171,7 @@ public class FgResourceLibraryController {
if (ch.length >= 2) {
if (StringUtils.isNotBlank(ch[1])) {
// 产品名称
fqSq.append(" && productName : *" + ch[0] + "* ");
fqSq.append(" && productName : *" + ch[1] + "* ");
}
}
......
......@@ -343,7 +343,55 @@ public class GeographysignServiceImpl extends BaseServiceImpl<Geographysign, Str
public List<ProvinceVo> provincecount(GeographyForm form) {
if (StringUtils.isNotBlank(form.getProvince())) {
return mapper.provincecounty(form);
List<ProvinceVo> list = mapper.provincecounty(form);
// 最后的list
List<ProvinceVo> haveList = new ArrayList<ProvinceVo>();
// 拆分出来的list
List<ProvinceVo> chaList = new ArrayList<ProvinceVo>();
ProvinceVo vo = null;
for (int i = list.size() - 1; i >= 0; i--) {
ProvinceVo s = list.get(i);
if (StringUtils.isNotBlank(s.getName())) {
System.out.println(s.getName());
String[] countys = s.getName().split("、");
if (countys.length <= 1) {
haveList.add(list.get(i));
continue;
}
for (String county : countys) {
vo = new ProvinceVo();
vo.setName(county);
vo.setValue(list.get(i).getValue());
chaList.add(vo);
}
}
}
// 重复数据合并
for (int i = 0; i < chaList.size() - 1; i++) {
for (int j = chaList.size() - 1; j > i; j--) {
if (chaList.get(j).getName().equals(chaList.get(i).getName())) {
chaList.get(i).setValue(chaList.get(i).getValue() + chaList.get(j).getValue());
chaList.remove(j);
}
}
}
//数据合并
for (int i = 0; i < haveList.size() - 1; i++) {
for (int j = chaList.size() - 1; j >= 0; j--) {
System.out.println(chaList.get(j).getName());
System.out.println(haveList.get(i).getName());
System.out.println(chaList.get(j).getName().equals(haveList.get(i).getName()));
if (chaList.get(j).getName().equals(haveList.get(i).getName())) {
System.out.println();
haveList.get(i).setValue(haveList.get(i).getValue() + chaList.get(j).getValue());
chaList.remove(j);
}
}
}
return haveList;
} else {
return mapper.provincecount(form);
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论