Authored by chenchao

add cached

fix nullpoint
1 package com.yohoufo.dal.order.model; 1 package com.yohoufo.dal.order.model;
2 2
  3 +import lombok.ToString;
  4 +
  5 +@ToString
3 public class MetaConfig { 6 public class MetaConfig {
4 private Integer id; 7 private Integer id;
5 8
1 package com.yohoufo.dal.order.model; 1 package com.yohoufo.dal.order.model;
2 2
  3 +import lombok.Data;
  4 +
  5 +@Data
3 public class SellerEnterApply { 6 public class SellerEnterApply {
4 private Integer id; 7 private Integer id;
5 8
@@ -17,67 +20,4 @@ public class SellerEnterApply { @@ -17,67 +20,4 @@ public class SellerEnterApply {
17 20
18 private Short status; 21 private Short status;
19 22
20 - public Integer getId() {  
21 - return id;  
22 - }  
23 -  
24 - public void setId(Integer id) {  
25 - this.id = id;  
26 - }  
27 -  
28 - public Integer getUid() {  
29 - return uid;  
30 - }  
31 -  
32 - public void setUid(Integer uid) {  
33 - this.uid = uid;  
34 - }  
35 -  
36 - public Long getOrderCode() {  
37 - return orderCode;  
38 - }  
39 -  
40 - public void setOrderCode(Long orderCode) {  
41 - this.orderCode = orderCode;  
42 - }  
43 -  
44 - public Integer getPreEnterType() {  
45 - return preEnterType;  
46 - }  
47 -  
48 - public void setPreEnterType(Integer preEnterType) {  
49 - this.preEnterType = preEnterType;  
50 - }  
51 -  
52 - public Integer getEnterType() {  
53 - return enterType;  
54 - }  
55 -  
56 - public void setEnterType(Integer enterType) {  
57 - this.enterType = enterType;  
58 - }  
59 -  
60 - public Integer getCreateTime() {  
61 - return createTime;  
62 - }  
63 -  
64 - public void setCreateTime(Integer createTime) {  
65 - this.createTime = createTime;  
66 - }  
67 -  
68 - public Integer getUpdateTime() {  
69 - return updateTime;  
70 - }  
71 -  
72 - public void setUpdateTime(Integer updateTime) {  
73 - this.updateTime = updateTime;  
74 - }  
75 -  
76 - public Short getStatus() {  
77 - return status;  
78 - }  
79 -  
80 - public void setStatus(Short status) {  
81 - this.status = status;  
82 - }  
83 } 23 }
1 package com.yohoufo.dal.order.model; 1 package com.yohoufo.dal.order.model;
2 2
  3 +import lombok.Data;
  4 +
  5 +@Data
3 public class SellerFunc { 6 public class SellerFunc {
4 private Integer id; 7 private Integer id;
5 8
@@ -9,35 +12,4 @@ public class SellerFunc { @@ -9,35 +12,4 @@ public class SellerFunc {
9 12
10 private Integer code; 13 private Integer code;
11 14
12 - public Integer getId() {  
13 - return id;  
14 - }  
15 -  
16 - public void setId(Integer id) {  
17 - this.id = id;  
18 - }  
19 -  
20 - public String getCnName() {  
21 - return cnName;  
22 - }  
23 -  
24 - public void setCnName(String cnName) {  
25 - this.cnName = cnName == null ? null : cnName.trim();  
26 - }  
27 -  
28 - public String getEnName() {  
29 - return enName;  
30 - }  
31 -  
32 - public void setEnName(String enName) {  
33 - this.enName = enName == null ? null : enName.trim();  
34 - }  
35 -  
36 - public Integer getCode() {  
37 - return code;  
38 - }  
39 -  
40 - public void setCode(Integer code) {  
41 - this.code = code;  
42 - }  
43 } 15 }
1 package com.yohoufo.dal.order.model; 1 package com.yohoufo.dal.order.model;
2 2
  3 +import lombok.Data;
  4 +
  5 +@Data
3 public class SellerLevelFunc { 6 public class SellerLevelFunc {
4 private Integer id; 7 private Integer id;
5 8
@@ -9,35 +12,4 @@ public class SellerLevelFunc { @@ -9,35 +12,4 @@ public class SellerLevelFunc {
9 12
10 private String funcList; 13 private String funcList;
11 14
12 - public Integer getId() {  
13 - return id;  
14 - }  
15 -  
16 - public void setId(Integer id) {  
17 - this.id = id;  
18 - }  
19 -  
20 - public Integer getEnterType() {  
21 - return enterType;  
22 - }  
23 -  
24 - public void setEnterType(Integer enterType) {  
25 - this.enterType = enterType;  
26 - }  
27 -  
28 - public Integer getLevel() {  
29 - return level;  
30 - }  
31 -  
32 - public void setLevel(Integer level) {  
33 - this.level = level;  
34 - }  
35 -  
36 - public String getFuncList() {  
37 - return funcList;  
38 - }  
39 -  
40 - public void setFuncList(String funcList) {  
41 - this.funcList = funcList == null ? null : funcList.trim();  
42 - }  
43 } 15 }
@@ -88,6 +88,7 @@ public class SellerFuncService { @@ -88,6 +88,7 @@ public class SellerFuncService {
88 SellerLevelFuncBo defaultSLFB = new SellerLevelFuncBo(); 88 SellerLevelFuncBo defaultSLFB = new SellerLevelFuncBo();
89 defaultSLFB.setLevel(SellerConfig.ENTER_TYPE_DEFAULT_LEVEL); 89 defaultSLFB.setLevel(SellerConfig.ENTER_TYPE_DEFAULT_LEVEL);
90 defaultSLFB.setFuncList(SellerConfig.ENTER_TYPE_DEFAULT_FUNCS); 90 defaultSLFB.setFuncList(SellerConfig.ENTER_TYPE_DEFAULT_FUNCS);
  91 + defaultSLFB.setFuncIdList(new ArrayList<>(1));
91 return defaultSLFB; 92 return defaultSLFB;
92 } 93 }
93 94
@@ -8,6 +8,7 @@ import com.yohoufo.common.exception.UfoServiceException; @@ -8,6 +8,7 @@ import com.yohoufo.common.exception.UfoServiceException;
8 import com.yohoufo.order.service.impl.SellerService; 8 import com.yohoufo.order.service.impl.SellerService;
9 import com.yohoufo.order.utils.LoggerUtils; 9 import com.yohoufo.order.utils.LoggerUtils;
10 import com.yohoufo.order.utils.SellerHelper; 10 import com.yohoufo.order.utils.SellerHelper;
  11 +import org.apache.commons.collections.CollectionUtils;
11 import org.slf4j.Logger; 12 import org.slf4j.Logger;
12 import org.springframework.beans.factory.annotation.Autowired; 13 import org.springframework.beans.factory.annotation.Autowired;
13 import org.springframework.stereotype.Service; 14 import org.springframework.stereotype.Service;
@@ -38,7 +39,8 @@ public class SellerAuthCheckService { @@ -38,7 +39,8 @@ public class SellerAuthCheckService {
38 case BATCH_PUBLISH: 39 case BATCH_PUBLISH:
39 case BATCH_OFFSHELVE: 40 case BATCH_OFFSHELVE:
40 case BATCH_CHANGEPRICE: 41 case BATCH_CHANGEPRICE:
41 - if (!funcIdList.contains(sellerFunc.getCode())){ 42 + if (CollectionUtils.isEmpty(funcIdList)
  43 + ||!funcIdList.contains(sellerFunc.getCode())){
42 logger.warn("in checkAuth fail uid {} est {} level {}", uid, est, level); 44 logger.warn("in checkAuth fail uid {} est {} level {}", uid, est, level);
43 throw new UfoServiceException(511, "您已经被降级"); 45 throw new UfoServiceException(511, "您已经被降级");
44 } 46 }