|
@@ -246,39 +246,39 @@ public class OrgInfoServiceImpl implements OrgInfoService {
|
|
|
|
|
|
@Override
|
|
|
public Map<String, Object> getFrontListPage(Map<String, Object> param) {
|
|
|
- List<Integer> classifications = Convert.toList(Integer.class, param.get("classification"));
|
|
|
- Integer type = Convert.toInt(param.get("type"));
|
|
|
- if (Blank.isNotEmpty(classifications)){
|
|
|
- List<Map<String, Object>> list = orgInfoMapper.getClassQueryNum(classifications);
|
|
|
- if (Blank.isNotEmpty(list)) {
|
|
|
- for (int i = 0; i < classifications.size(); i++) {
|
|
|
- Integer item = classifications.get(i);
|
|
|
- boolean hasEqual = true;
|
|
|
- for (int j = 0; j < list.size(); j++) {
|
|
|
- Map<String, Object> map = list.get(j);
|
|
|
- Integer classId = Convert.toInt(map.get("classId"));
|
|
|
- Integer num = Convert.toInt(map.get("num"));
|
|
|
- Integer id = Convert.toInt(map.get("id"));
|
|
|
- if (item.equals(classId)){
|
|
|
- // 更新
|
|
|
- orgInfoMapper.updateQueryClassNum(id, num + 1);
|
|
|
- break;
|
|
|
- } else if (j == list.size() - 1){
|
|
|
- hasEqual = false;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- // 没有相等则插入
|
|
|
- if (!hasEqual) {
|
|
|
- // 插入
|
|
|
- orgInfoMapper.saveQueryClassNum(item, type);
|
|
|
- }
|
|
|
- }
|
|
|
- } else {
|
|
|
- // 批量插入
|
|
|
- orgInfoMapper.batchSaveQueryClassNum(classifications, type);
|
|
|
- }
|
|
|
- }
|
|
|
+// List<Integer> classifications = Convert.toList(Integer.class, param.get("classification"));
|
|
|
+// Integer type = Convert.toInt(param.get("type"));
|
|
|
+// if (Blank.isNotEmpty(classifications)){
|
|
|
+// List<Map<String, Object>> list = orgInfoMapper.getClassQueryNum(classifications);
|
|
|
+// if (Blank.isNotEmpty(list)) {
|
|
|
+// for (int i = 0; i < classifications.size(); i++) {
|
|
|
+// Integer item = classifications.get(i);
|
|
|
+// boolean hasEqual = true;
|
|
|
+// for (int j = 0; j < list.size(); j++) {
|
|
|
+// Map<String, Object> map = list.get(j);
|
|
|
+// Integer classId = Convert.toInt(map.get("classId"));
|
|
|
+// Integer num = Convert.toInt(map.get("num"));
|
|
|
+// Integer id = Convert.toInt(map.get("id"));
|
|
|
+// if (item.equals(classId)){
|
|
|
+// // 更新
|
|
|
+// orgInfoMapper.updateQueryClassNum(id, num + 1);
|
|
|
+// break;
|
|
|
+// } else if (j == list.size() - 1){
|
|
|
+// hasEqual = false;
|
|
|
+// }
|
|
|
+// }
|
|
|
+//
|
|
|
+// // 没有相等则插入
|
|
|
+// if (!hasEqual) {
|
|
|
+// // 插入
|
|
|
+// orgInfoMapper.saveQueryClassNum(item, type);
|
|
|
+// }
|
|
|
+// }
|
|
|
+// } else {
|
|
|
+// // 批量插入
|
|
|
+// orgInfoMapper.batchSaveQueryClassNum(classifications, type);
|
|
|
+// }
|
|
|
+// }
|
|
|
|
|
|
return SendUtil.send(true, "", orgInfoMapper.getFrontListPage(param));
|
|
|
}
|