Commit 04b59381 authored by liuxinben's avatar liuxinben

修改组号的压缩方法

parent 39790f8f
...@@ -420,23 +420,23 @@ public class ReceiptServiceImpl implements ReceiptService { ...@@ -420,23 +420,23 @@ public class ReceiptServiceImpl implements ReceiptService {
if (countyMapList.size() == 1) { if (countyMapList.size() == 1) {
countyMapGroup.put("groupNum", countyMapList.get(0).get("QR_CODE")); countyMapGroup.put("groupNum", countyMapList.get(0).get("QR_CODE"));
} else { } else {
List<Integer> c = new ArrayList<>(); List<String> c = new ArrayList<>();
List<Integer> nsList = new ArrayList<>(); List<String> nsList = new ArrayList<>();
for (int i = 0; i < countyMapList.size(); i++) { for (int i = 0; i < countyMapList.size(); i++) {
/** /**
* 判断组号中时候含有历史回迁组 * 判断组号中时候含有历史回迁组
*/ */
if ((((countyMapList.get(i)).get("QR_CODE")) + "").contains("L")) { if ((((countyMapList.get(i)).get("QR_CODE")) + "").contains("L")) {
if ((((countyMapList.get(i)).get("QR_CODE")) + "").length() == 8) { if ((((countyMapList.get(i)).get("QR_CODE")) + "").length() == 8) {
nsList.add(Integer.parseInt((((countyMapList.get(i)).get("QR_CODE")) + "").substring(1, (((countyMapList.get(i)).get("QR_CODE")) + "").length()))); nsList.add((((countyMapList.get(i)).get("QR_CODE")) + "").substring(1, (((countyMapList.get(i)).get("QR_CODE")) + "").length()));
} }
} else { } else {
if ((((countyMapList.get(i)).get("QR_CODE")) + "").length() == 8) { if ((((countyMapList.get(i)).get("QR_CODE")) + "").length() == 8) {
nsList.add(Integer.parseInt((((countyMapList.get(i)).get("QR_CODE")) + "").substring(1, (((countyMapList.get(i)).get("QR_CODE")) + "").length()))); nsList.add((((countyMapList.get(i)).get("QR_CODE")) + "").substring(1, (((countyMapList.get(i)).get("QR_CODE")) + "").length()));
} }
} }
} }
countyMapGroup.put("groupNum", createGroupNo(c, nsList)); countyMapGroup.put("groupNum", createGroupNoMiss(c, nsList));
} }
countyMapGroup.put("countyCode", countyCode); countyMapGroup.put("countyCode", countyCode);
countyMapGroup.put("policeList", countyMapList); countyMapGroup.put("policeList", countyMapList);
...@@ -454,12 +454,16 @@ public class ReceiptServiceImpl implements ReceiptService { ...@@ -454,12 +454,16 @@ public class ReceiptServiceImpl implements ReceiptService {
return typeList; return typeList;
} }
private String createGroupNo(List<Integer> c, List<Integer> nsList) { private String createGroupNoMiss(List<String> c, List<String> nsList) {
try { try {
String groupNo = ""; String groupNo = "";
c.add(nsList.get(0)); c.add(nsList.get(0));
for (int i = 0; i < nsList.size() - 1; ++i) { for (int i = 0; i < nsList.size() - 1; ++i) {
if (nsList.get(i) + 1 == nsList.get(i + 1)) { String t = nsList.get(i);
String n = nsList.get(i + 1);
String l = String.valueOf(Integer.parseInt(t.substring(1,8))+1);
String m = n.substring(1,8);
if (l.equals(m)) {
c.add(nsList.get(i + 1)); c.add(nsList.get(i + 1));
} else { } else {
if (c.size() >= 1) { if (c.size() >= 1) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment