XMTT лет назад: 8
Родитель
Сommit
be6c2a10cf
1 измененных файлов с 21 добавлено и 25 удалено
  1. 21 25
      src/main/java/com/ekexiu/console/system/service/DictService.java

+ 21 - 25
src/main/java/com/ekexiu/console/system/service/DictService.java

@ -1,26 +1,13 @@
1 1
package com.ekexiu.console.system.service;
2 2

3
import java.lang.reflect.Type;
4
import java.sql.Connection;
5
import java.sql.SQLException;
6
import java.util.ArrayList;
7
import java.util.Collection;
8
import java.util.Collections;
9
import java.util.Comparator;
10
import java.util.HashMap;
11
import java.util.LinkedList;
12
import java.util.List;
13
import java.util.ListIterator;
14
import java.util.Map;
15
import java.util.concurrent.atomic.AtomicBoolean;
16
import java.util.concurrent.atomic.AtomicReference;
17

18
import javax.sql.DataSource;
19

3
import com.ekexiu.console.system.dao.DictDao;
4
import com.ekexiu.console.system.po.Dict;
5
import com.ekexiu.console.system.vo.DictInfo;
6
import com.ekexiu.console.system.vo.DictItem;
7
import com.ekexiu.console.system.vo.EditDictItem;
20 8
import org.jfw.apt.annotation.Autowrie;
21 9
import org.jfw.apt.annotation.DefaultValue;
22 10
import org.jfw.apt.annotation.Nullable;
23
import org.jfw.apt.web.annotation.LoginUser;
24 11
import org.jfw.apt.web.annotation.Path;
25 12
import org.jfw.apt.web.annotation.operate.Get;
26 13
import org.jfw.apt.web.annotation.operate.Post;
@ -36,12 +23,13 @@ import org.jfw.util.jdbc.JdbcUtil;
36 23
import org.jfw.util.json.JsonService;
37 24
import org.jfw.util.reflect.TypeReference;
38 25

39
import com.ekexiu.console.system.dao.DictDao;
40
import com.ekexiu.console.system.po.Dict;
41
import com.ekexiu.console.system.vo.ConsoleAuthUser;
42
import com.ekexiu.console.system.vo.DictInfo;
43
import com.ekexiu.console.system.vo.DictItem;
44
import com.ekexiu.console.system.vo.EditDictItem;
26
import javax.sql.DataSource;
27
import java.lang.reflect.Type;
28
import java.sql.Connection;
29
import java.sql.SQLException;
30
import java.util.*;
31
import java.util.concurrent.atomic.AtomicBoolean;
32
import java.util.concurrent.atomic.AtomicReference;
45 33

46 34
@Path("/sys/dict")
47 35
public class DictService {
@ -178,7 +166,15 @@ public class DictService {
178 166
			}
179 167
		});
180 168
		if (ab.get()) {
181
			this.items.get(code).set(ret);
169
			AtomicReference<LinkedList<DictItem>>  ref = this.items.get(code);
170
			if(ref ==null){
171
				ref = new AtomicReference<LinkedList<DictItem>>();
172
				ref.set(ret);
173
				this.items.put(code,ref);
174

175
			}else{
176
				ref.set(ret);
177
			}
182 178
		}
183 179
	}
184 180