|
@@ -6,18 +6,17 @@ package com.gyee.runeconomy.service.update;/*
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.gyee.common.util.CommonUtils;
|
|
|
import com.gyee.common.util.MD5Utils;
|
|
|
-import com.gyee.runeconomy.init.CacheContext;
|
|
|
import com.gyee.runeconomy.model.auto.ProBasicPowerstation;
|
|
|
import com.gyee.runeconomy.model.auto.ProBasicUser;
|
|
|
import com.gyee.runeconomy.model.auto.ProEconTargetdata;
|
|
|
import com.gyee.runeconomy.service.auto.IProBasicUserService;
|
|
|
import com.gyee.runeconomy.service.auto.IProEconTargetdataService;
|
|
|
import com.gyee.runeconomy.util.DateUtils;
|
|
|
+import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
import java.util.*;
|
|
|
-import java.util.stream.Collectors;
|
|
|
|
|
|
@Service
|
|
|
public class TargetEnterService {
|
|
@@ -26,6 +25,9 @@ public class TargetEnterService {
|
|
|
@Resource
|
|
|
private IProEconTargetdataService proEconTargetdataService;
|
|
|
|
|
|
+ @Value("#{${appendSation.appendSationMap}}")
|
|
|
+ private Map<String,String> appendSationMap;
|
|
|
+
|
|
|
public ProBasicUser login(ProBasicUser user) {
|
|
|
|
|
|
String md5Str = MD5Utils.getMD5Str(user.getPassword());
|
|
@@ -68,11 +70,37 @@ public class TargetEnterService {
|
|
|
}
|
|
|
|
|
|
public List<ProBasicPowerstation> wpls(String wpid) {
|
|
|
- List<ProBasicPowerstation> wpls = CacheContext.wpls;
|
|
|
+ List<ProBasicPowerstation> wpls =new ArrayList<>();
|
|
|
+// if (!wpid.equals("0")){
|
|
|
+// return wpls.stream().filter(wp->wp.getId().equals(wpid)).collect(Collectors.toList());
|
|
|
+// }else {
|
|
|
+// return wpls;
|
|
|
+// }
|
|
|
+
|
|
|
if (!wpid.equals("0")){
|
|
|
- return wpls.stream().filter(wp->wp.getId().equals(wpid)).collect(Collectors.toList());
|
|
|
+ if(appendSationMap.containsKey(wpid))
|
|
|
+ {
|
|
|
+ ProBasicPowerstation wp=new ProBasicPowerstation();
|
|
|
+ wp.setNemCode(wpid);
|
|
|
+ wp.setName(appendSationMap.get(wpid));
|
|
|
+ wpls.add(wp);
|
|
|
+ }else
|
|
|
+ {
|
|
|
+ ProBasicPowerstation wp=new ProBasicPowerstation();
|
|
|
+ wp.setNemCode(wpid);
|
|
|
+ wp.setName("");
|
|
|
+ wpls.add(wp);
|
|
|
+ }
|
|
|
}else {
|
|
|
- return wpls;
|
|
|
+ for (Map.Entry<String, String> entry : appendSationMap.entrySet()) {
|
|
|
+
|
|
|
+ ProBasicPowerstation wp = new ProBasicPowerstation();
|
|
|
+ wp.setNemCode(entry.getKey());
|
|
|
+ wp.setName(entry.getValue());
|
|
|
+ wpls.add(wp);
|
|
|
+
|
|
|
+ }
|
|
|
}
|
|
|
+ return wpls;
|
|
|
}
|
|
|
}
|