Bläddra i källkod

录入数据功能修改

shilin 1 år sedan
förälder
incheckning
806e98bd16

+ 3 - 0
web/runeconomy-xk/src/main/java/com/gyee/runeconomy/controller/update/TargetEnterController.java

@@ -22,11 +22,14 @@ public class TargetEnterController {
     @Resource
     private TargetEnterService targetEnterService;
 
+
     @PostMapping(value = "/enter")
     @ApiOperation(value = "登录", notes = "登录")
     public R login(@RequestBody ProBasicUser user
                                     ) {
         ProBasicUser proBasicUser = targetEnterService.login(user);
+
+
         if (StringUtils.isNotNull(proBasicUser)) {
             return R.data(ResultMsg.ok(proBasicUser));
         } else {

+ 33 - 5
web/runeconomy-xk/src/main/java/com/gyee/runeconomy/service/update/TargetEnterService.java

@@ -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;
     }
 }

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 5 - 1
web/runeconomy-xk/src/main/resources/application-jn.yml