Parcourir la source

线路表更新

wangb il y a 2 ans
Parent
commit
db08d59a5f

+ 13 - 0
web/backmanagerconfig/src/main/java/com/gyee/backconfig/controller/LineController.java

@@ -4,6 +4,7 @@ package com.gyee.backconfig.controller;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.gyee.backconfig.config.R;
 import com.gyee.backconfig.model.auto.Line;
+import com.gyee.backconfig.model.auto.Projectplan;
 import com.gyee.backconfig.service.BackConfigService;
 import com.gyee.backconfig.vo.Linevo;
 import com.gyee.common.model.StringUtils;
@@ -77,4 +78,16 @@ public class LineController {
         vo.setVersion(version);
 
     }
+
+    //新增或者更新
+    @PostMapping("/add-Linevo")
+    @CrossOrigin(origins = "*", maxAge = 3600)
+    public R addModifyProjectPlan(@RequestBody Line Line){
+        boolean saveOrUpdate = backConfigService.saveOrUpdate(Line);
+        if (saveOrUpdate) {
+            return R.ok().data("保存或更新成功");
+        }else{
+            return R.error().message("保存失败");
+        }
+    }
 }

+ 13 - 11
web/backmanagerconfig/src/main/java/com/gyee/backconfig/service/BackConfigService.java

@@ -106,7 +106,7 @@ public class BackConfigService {
         return page1;
     }
 
-
+//期次新增
     public boolean saveOrUpdate(Projectplan Projectplan) {
         return ProjectplanService.saveOrUpdate(Projectplan);
     }
@@ -334,36 +334,38 @@ public class BackConfigService {
         Integer quantity = vo.getQuantity();
 
         if (StringUtils.isNotNull(id) && !id.equals("")) {
-            queryWrapper.eq("id", id);
+            queryWrapper.like("id", id);
         }
         if (StringUtils.isNotNull(code) && !code.equals("")) {
-            queryWrapper.eq("code", code);
+            queryWrapper.like("code", code);
         }
         if (StringUtils.isNotNull(aname) && !aname.equals("")) {
-            queryWrapper.eq("aname", aname);
+            queryWrapper.like("aname", aname);
         }
         if (StringUtils.isNotNull(name) && !name.equals("")) {
-            queryWrapper.eq("name", name);
+            queryWrapper.like("name", name);
         }
         if (StringUtils.isNotNull(capacityunit) && !capacityunit.equals("")) {
-            queryWrapper.eq("capacityunit", capacityunit);
+            queryWrapper.like("capacityunit", capacityunit);
         }
         if (StringUtils.isNotNull(capacity) && !capacity.equals("")) {
-            queryWrapper.eq("capacity", capacity);
+            queryWrapper.like("capacity", capacity);
         }
         if (StringUtils.isNotNull(projectid) && !projectid.equals("")) {
-            queryWrapper.eq("projectid", projectid);
+            queryWrapper.like("projectid", projectid);
         }
         if (StringUtils.isNotNull(ordernum) && !ordernum.equals("")) {
-            queryWrapper.eq("ordernum", ordernum);
+            queryWrapper.like("ordernum", ordernum);
         }
         if (StringUtils.isNotNull(quantity) && !quantity.equals("")) {
-            queryWrapper.eq("quantity", quantity);
+            queryWrapper.like("quantity", quantity);
         }
         Page<Line> page1 = lineService.page(page, queryWrapper);
         return page1;
     }
-
+    public boolean saveOrUpdate(Line Line) {
+        return lineService.saveOrUpdate(Line);
+    }
     //Companys
     public Page<Companys> CompanysBypage(Companysvo vo) {
         Page<Companys> page = new Page<Companys>(vo.getCurrent(), vo.getPageSize());