|  |  |  | 
|---|
|  |  |  | import com.core.common.SpringUtils; | 
|---|
|  |  |  | import com.zy.system.entity.Config; | 
|---|
|  |  |  | import com.zy.system.service.ConfigService; | 
|---|
|  |  |  | import lombok.Data; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import java.util.HashMap; | 
|---|
|  |  |  | import java.util.List; | 
|---|
|  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 基础配置中心。可通过刷新指定接口刷新相关配置 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @Data | 
|---|
|  |  |  | public class Parameter { | 
|---|
|  |  |  |  | 
|---|
|  |  |  | private volatile static Parameter instance = null; | 
|---|
|  |  |  | // 验证码开关 | 
|---|
|  |  |  | private String codeSwitch; | 
|---|
|  |  |  | private String ledDefaultMsg; | 
|---|
|  |  |  | // 库位初始化口令 | 
|---|
|  |  |  | private String locMastInitPwd; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | private Parameter(){ | 
|---|
|  |  |  | private Parameter() { | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public static Parameter get(){ | 
|---|
|  |  |  | if (instance == null){ | 
|---|
|  |  |  | synchronized (Parameter.class){ | 
|---|
|  |  |  | public static Parameter get() { | 
|---|
|  |  |  | if (instance == null) { | 
|---|
|  |  |  | synchronized (Parameter.class) { | 
|---|
|  |  |  | instance = reset(); | 
|---|
|  |  |  | return instance; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | return instance; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 重置 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | public static Parameter reset() { | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 重置 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | public static Parameter reset() { | 
|---|
|  |  |  | ConfigService configService = SpringUtils.getBean(ConfigService.class); | 
|---|
|  |  |  | List<Config> configs = configService.selectList(new EntityWrapper<Config>().eq("status", "1")); | 
|---|
|  |  |  | Map<String, Object> data = new HashMap<>(); | 
|---|
|  |  |  | 
|---|
|  |  |  | return instance; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // 验证码开关 | 
|---|
|  |  |  | private String codeSwitch; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public String getCodeSwitch() { | 
|---|
|  |  |  | return codeSwitch; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public void setCodeSwitch(String codeSwitch) { | 
|---|
|  |  |  | this.codeSwitch = codeSwitch; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | private String ledDefaultMsg; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public String getLedDefaultMsg() { | 
|---|
|  |  |  | return ledDefaultMsg; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public void setLedDefaultMsg(String ledDefaultMsg) { | 
|---|
|  |  |  | this.ledDefaultMsg = ledDefaultMsg; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|