Browse Source

维保项修改平台成10086

wanghaicheng 5 years ago
parent
commit
670a15f947

+ 14 - 14
lift-enterprise-service/src/main/java/cn/com/ty/lift/enterprise/option/controller/MaintenanceOptionController.java

@@ -41,10 +41,10 @@ public class MaintenanceOptionController {
     public RestResponse list(@RequestBody OptionReq req) {
         IPage<MaintenanceOption> page = optionService.page(
                 new Page<>(req.getPageNum(), req.getPageSize()), new QueryWrapper<MaintenanceOption>()
-                        //0L是固定数据的公司id
-                        .in("mt_company_id", 0L, req.getMtCompanyId())
+                        //10086L是固定数据的公司id
+                        .in("mt_company_id", 10086L, req.getMtCompanyId())
                         .in(req.getType() != null, "type", type(req))
-                        .eq(req.getLiftType() != null, "lift_type", req.getLiftType())
+                        .eq(req.getLiftCategory() != null, "lift_category", req.getLiftCategory())
                         .orderByDesc("mt_company_id")
         );
         if (page.getRecords().isEmpty()) {
@@ -61,17 +61,18 @@ public class MaintenanceOptionController {
      */
     @PostMapping("/options")
     public RestResponse options(@RequestBody OptionReq req) {
-        Integer liftType = req.getLiftType();
+        Integer liftType = req.getLiftCategory();
         String sort = null;
         if (liftType.equals(3)) {
             sort = "-1,1";
         }
         List<MaintenanceOption> options = optionService.list(
                 new QueryWrapper<MaintenanceOption>()
-                        //0L是固定数据的公司id
-                        .in("mt_company_id", 0L, req.getMtCompanyId())
+                        //10086L是固定数据的公司id
+                        .in("mt_company_id", 10086L, req.getMtCompanyId())
                         .in(req.getType() != null, "type", type(req))
-                        .eq(req.getLiftType() != null, "lift_type", req.getLiftType())
+                        .eq(req.getLiftCategory() != null, "lift_category", req.getLiftCategory())
+                        .eq(req.getStatus() != null, "status", req.getStatus())
                         .in(sort != null, "sort", sort)
         );
         if (options.isEmpty()) {
@@ -81,10 +82,10 @@ public class MaintenanceOptionController {
     }
 
     /**
+     * 新增维保项
+     *
      * @param option 维保项信息
      * @return RestResponse
-     * @description 新增维保项
-     * @date 2019/12/19 9:20
      */
     @PostMapping("/add")
     public RestResponse add(@RequestBody MaintenanceOption option) {
@@ -102,8 +103,8 @@ public class MaintenanceOptionController {
      */
     @PostMapping("/modify")
     public RestResponse modify(@RequestBody MaintenanceOption option) {
-        //0L是固定数据的公司id
-        if (option.getMtCompanyId().equals(0L)) {
+        //10086L是固定数据的公司id
+        if (option.getMtCompanyId().equals(10086L)) {
             return RestResponse.fail("默认维保项无法编辑");
         }
         if (optionService.updateById(option)) {
@@ -116,12 +117,11 @@ public class MaintenanceOptionController {
      * @param option 维保项id
      * @return RestResponse
      * @description 判断是否是默认维保项,不是默认的维保项才可以删除
-     * @date 2019/12/19 9:20
      */
     @PostMapping("/delete")
     public RestResponse delete(@RequestBody MaintenanceOption option) {
-        //10086是平台的团队id
-        if (option.getMtCompanyId().equals(0L)) {
+        //10086L是平台的团队id
+        if (option.getMtCompanyId().equals(10086L)) {
             return RestResponse.fail("默认维保项无法删除");
         }
         if (optionService.removeById(option.getId())) {

+ 3 - 2
lift-enterprise-service/src/main/java/cn/com/ty/lift/enterprise/option/dao/entity/MaintenanceOption.java

@@ -56,9 +56,10 @@ public class MaintenanceOption implements Serializable {
 
     /**
      * 电梯类型  '(1乘客梯/载货电梯 2液压梯 3扶梯/人行道 4杂物梯)'
+     * '电梯类别(1:曳引梯;2:液压梯;3:杂物梯;4:自动扶梯;5:自动人行道)'
      */
-    @TableField("lift_type")
-    private Integer liftType;
+    @TableField("lift_category")
+    private Integer liftCategory;
 
     /**
      * 分类(1机房 2轿顶 3轿厢 4层门 5底坑井道)

+ 1 - 1
lift-quan-service/src/main/java/cn/com/ty/lift/quan/news/controller/QuanNewsController.java

@@ -52,7 +52,7 @@ public class QuanNewsController {
      * @return 新闻信息
      */
     @PostMapping
-    public RestResponse appNews(@RequestBody QuanNewsReq quanNews) {
+    public RestResponse News(@RequestBody QuanNewsReq quanNews) {
         return quanNewsService.getNews(quanNews);
     }
 

+ 1 - 0
lift-quan-service/src/main/java/cn/com/ty/lift/quan/news/service/impl/QuanNewsServiceImpl.java

@@ -160,6 +160,7 @@ public class QuanNewsServiceImpl extends ServiceImpl<QuanNewsMapper, QuanNews> i
             isLike = users != null && users.contains(userId.toString());
         }
         byId.setLookNum(lookNum);
+        byId.setLikeNum(users != null ? users.size() : 0L);
         byId.setIsLike(isLike);
         return RestResponse.success(byId, "成功");
     }