Forráskód Böngészése

Merge branch 'develop' of http://132.232.206.88:3000/lift-manager/lift-server into feature-wcz

wcz 5 éve
szülő
commit
5d24954a9f

+ 4 - 5
lift-enterprise-service/src/main/java/cn/com/ty/lift/enterprise/custom/controller/PropertyCompanyController.java

@@ -8,12 +8,10 @@ import cn.com.xwy.boot.web.dto.RestResponse;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import lombok.AllArgsConstructor;
 import org.springframework.web.bind.annotation.*;
-import org.springframework.web.client.RestTemplate;
 
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 
 @RestController
 @RequestMapping("/property-company")
@@ -26,8 +24,6 @@ import java.util.Map;
  */
 public class PropertyCompanyController {
     private final PropertyCompanyServiceImpl propertyCompanyService;
-    private final PropertyContactServiceImpl propertyContactService;
-    private final RestTemplate restTemplate;
 
     @GetMapping("/{id}")
     /**
@@ -64,7 +60,10 @@ public class PropertyCompanyController {
      */
     public RestResponse add(@RequestBody PropertyCompany propertyCompany) {
         //service层判断了是否有相同名称的name//如果数据库客户名不重复,就删除里面判断name是否重复的逻辑
-        return propertyCompanyService.savePropertyCompany(propertyCompany);
+        if (propertyCompanyService.save(propertyCompany)) {
+            return RestResponse.ok(null,"1","新增成功");
+        }
+        return RestResponse.ok(null,"0","新增失败");
     }
 
     @PostMapping("/update")

+ 0 - 11
lift-enterprise-service/src/main/java/cn/com/ty/lift/enterprise/custom/service/impl/PropertyCompanyServiceImpl.java

@@ -31,17 +31,6 @@ import java.util.Map;
 public class PropertyCompanyServiceImpl extends ServiceImpl<PropertyCompanyMapper, PropertyCompany> implements PropertyCompanyService {
     private final PropertyContactMapper contactMapper;
 
-    public RestResponse savePropertyCompany(PropertyCompany propertyCompany) {
-        if (null != this.getOne(new QueryWrapper<PropertyCompany>().eq("name", propertyCompany.getName()))) {
-            return RestResponse.ok(null, "0", "客户已存在");
-        }
-        if (this.save(propertyCompany)) {
-            return RestResponse.ok(propertyCompany.getId().toString(), "1", "新增客户成功");
-        } else {
-            return RestResponse.ok(null, "0", "新增客户失败");
-        }
-    }
-
     public RestResponse delete(Long id) {
         //维保电梯大于0
         if (this.getMaintenanceLiftNum(1L) > 0) {

+ 1 - 1
lift-enterprise-service/src/main/java/cn/com/ty/lift/enterprise/settings/controller/MaintenanceCompanyController.java

@@ -10,7 +10,7 @@ import org.springframework.web.bind.annotation.RestController;
  * 维保公司 前端控制器
  * </p>
  *
- * @author wang-hai-cheng
+ * @author huangy
  * @since 2019-12-09
  */
 @RestController

+ 19 - 0
lift-system-service/pom.xml

@@ -39,4 +39,23 @@
 
     </dependencies>
 
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.springframework.boot</groupId>
+                <artifactId>spring-boot-maven-plugin</artifactId>
+                <configuration>
+                    <mainClass>cn.com.ty.lift.system.SystemApplication</mainClass>
+                </configuration>
+                <executions>
+                    <execution>
+                        <goals>
+                            <goal>repackage</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
+
 </project>