Browse Source

2019.11.30-12:27

wanghaicheng 5 years ago
parent
commit
2b64e52bdc

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

@@ -24,11 +24,11 @@ public class PropertyCompanyController {
     /**
      * @description id顺序+分页客户列表
      * @date 2019/11/27 11:33
-     * @param [pageNum, pageSize]
+     * @param [mtCompanyId, pageNum, pageSize]
      * @return cn.com.xwy.boot.web.dto.RestResponse
      */
     public RestResponse propertyCompanies(@RequestParam Long mtCompanyId,@RequestParam Integer pageNum, @RequestParam Integer pageSize) {
-        return propertyCompanyService.propertyCompanyListResponse(mtCompanyId,pageNum, pageSize);
+        return RestResponse.ok(propertyCompanyService.propertyCompanyListResponse(mtCompanyId, pageNum, pageSize), "查询成功");
     }
 
     @GetMapping("/{id}")
@@ -38,10 +38,10 @@ public class PropertyCompanyController {
      * @param [id]
      * @return cn.com.xwy.boot.web.dto.RestResponse
      */
-    public RestResponse propertyCompany(@PathVariable int id) {
+    public RestResponse propertyCompany(@PathVariable Long id) {
         PropertyCompany byId = propertyCompanyService.getById(id);
         if (byId != null) {
-            return RestResponse.ok(byId, "查询成功");
+            return RestResponse.ok(byId,"查询成功");
         } else {
             return RestResponse.ok(null, "无数据");
         }
@@ -115,7 +115,7 @@ public class PropertyCompanyController {
      * @param [id]
      * @return cn.com.xwy.boot.web.dto.RestResponse
      */
-    public RestResponse delete(@PathVariable int id) {
+    public RestResponse delete(@PathVariable Long id) {
 
         //判断维保电梯台数是否为0
         //判断维保电梯台数是否为0

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

@@ -12,7 +12,6 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import lombok.AllArgsConstructor;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
-import org.springframework.web.bind.annotation.PathVariable;
 import org.springframework.web.bind.annotation.RequestBody;
 
 import java.util.List;
@@ -44,7 +43,7 @@ public class PropertyCompanyServiceImpl extends ServiceImpl<PropertyCompanyMappe
         }
     }
 
-    public String delete(@PathVariable int id) {
+    public String delete(Long id) {
         //维保电梯大于0
         if (this.getMaintenanceLiftNum() > 0) {
             //就不删除
@@ -60,7 +59,7 @@ public class PropertyCompanyServiceImpl extends ServiceImpl<PropertyCompanyMappe
         }
     }
 
-    public int deleteForContact(int id) {
+    public int deleteForContact(Long id) {
         return contactMapper.delete(new QueryWrapper<PropertyContact>().eq("pp_company_id", id));
     }
 
@@ -81,7 +80,7 @@ public class PropertyCompanyServiceImpl extends ServiceImpl<PropertyCompanyMappe
         return 888;
     }
 
-    public RestResponse propertyCompanyListResponse(Long mtCompanyId,Integer pageNum, Integer pageSize) {
+    public List<Map<String, Object>> propertyCompanyListResponse(Long mtCompanyId, Integer pageNum, Integer pageSize) {
         Page<PropertyCompany> page = new Page<>(pageNum, pageSize);
         List<Map<String, Object>> records = this.pageMaps(page, new QueryWrapper<PropertyCompany>()
                 .select("id", "code", "name", "address", "telephone")
@@ -89,7 +88,7 @@ public class PropertyCompanyServiceImpl extends ServiceImpl<PropertyCompanyMappe
         records.forEach(record -> {
             record.put("maintenanceLiftNum", this.getMaintenanceLiftNum());
         });
-        return RestResponse.ok(records, "查询成功");
+        return records;
     }