Sfoglia il codice sorgente

Merge branch 'develop' into wanghaicheng

wanghaicheng 5 anni fa
parent
commit
7eb1660d71
18 ha cambiato i file con 547 aggiunte e 71 eliminazioni
  1. 64 1
      lift-business-service/src/main/java/cn/com/ty/lift/business/contract/controller/ContractController.java
  2. 109 0
      lift-business-service/src/main/java/cn/com/ty/lift/business/contract/dao/entity/Contracts.java
  3. 38 0
      lift-business-service/src/main/java/cn/com/ty/lift/business/contract/dao/entity/model/ContractRequest.java
  4. 60 0
      lift-business-service/src/main/java/cn/com/ty/lift/business/contract/dao/entity/model/ContractResponse.java
  5. 21 0
      lift-business-service/src/main/java/cn/com/ty/lift/business/contract/dao/mapper/ContractsMapper.java
  6. 80 0
      lift-business-service/src/main/java/cn/com/ty/lift/business/contract/service/ContractService.java
  7. 21 14
      lift-business-service/src/main/java/cn/com/ty/lift/business/library/controller/LibraryController.java
  8. 6 1
      lift-business-service/src/main/java/cn/com/ty/lift/business/library/dao/entity/model/BatchUpdateLiftRequest.java
  9. 20 13
      lift-business-service/src/main/java/cn/com/ty/lift/business/library/service/LibraryService.java
  10. 1 1
      lift-business-service/src/main/java/cn/com/ty/lift/business/library/service/PlatformCompanyLiftRelevanceService.java
  11. 27 20
      lift-business-service/src/main/java/cn/com/ty/lift/business/library/service/ProjectLiftRelevanceService.java
  12. 20 14
      lift-business-service/src/main/java/cn/com/ty/lift/business/project/controller/ProjectController.java
  13. 19 6
      lift-business-service/src/main/java/cn/com/ty/lift/business/project/service/ProjectService.java
  14. 1 0
      lift-business-service/src/main/resources/locale/response.properties
  15. 59 0
      lift-business-service/src/main/resources/mapper/contract/ContractsMapper.xml
  16. 1 1
      lift-business-service/src/main/resources/mapper/emergency/EmergencyRepairMapper.xml
  17. 0 0
      lift-business-service/src/main/resources/mapper/lift/LiftExtensionMapper.xml
  18. 0 0
      lift-business-service/src/main/resources/mapper/lift/LiftMapper.xml

+ 64 - 1
lift-business-service/src/main/java/cn/com/ty/lift/business/contract/controller/ContractController.java

@@ -1,7 +1,70 @@
 package cn.com.ty.lift.business.contract.controller;
 
-import org.springframework.web.bind.annotation.RestController;
+import cn.com.ty.lift.business.contract.dao.entity.Contracts;
+import cn.com.ty.lift.business.contract.dao.entity.model.ContractRequest;
+import cn.com.ty.lift.business.contract.service.ContractService;
+import cn.com.xwy.boot.web.dto.RestResponse;
+import org.springframework.web.bind.annotation.*;
 
+import javax.annotation.Resource;
+
+/**
+ * @author bieao
+ * @date 2019/12/07
+ * @description 合同管理控制层
+ */
 @RestController
+@RequestMapping("contract")
 public class ContractController {
+
+    @Resource
+    private ContractService contractService;
+
+
+    /**
+     * @param request 合同列表查询条件
+     * @return RestResponse 合同分页列表结果
+     * @description 查询合同列表
+     * @date 2019/12/7 11:53 AM
+     */
+    @PostMapping("list")
+    public RestResponse list(@RequestBody ContractRequest request) {
+        return contractService.list(request);
+    }
+
+
+    /**
+     * @param contracts 新增合同数据项
+     * @return 1.成功, 0.失败, 消息描述
+     * @description 新增合同
+     * @date 2019/12/7 3:31 PM
+     */
+    @PostMapping("add")
+    public RestResponse add(@RequestBody Contracts contracts) {
+        return contractService.add(contracts);
+    }
+
+
+    /**
+     * @param contracts 修改合同数据项
+     * @return 1.成功, 0.失败, 消息描述
+     * @description 合同变更
+     * @date 2019/12/7 3:31 PM
+     */
+    @PostMapping("modify")
+    public RestResponse modify(@RequestBody Contracts contracts) {
+        return contractService.modify(contracts);
+    }
+
+    /**
+     * @param id 合同id
+     * @return RestResponse 合同详情
+     * @description 查询合同详情
+     * @date 2019/12/6 4:46 PM
+     */
+    @PostMapping("detail/{id}")
+    public RestResponse detail(@PathVariable(name = "id") Long id) {
+        return contractService.detail(id);
+    }
+
 }

+ 109 - 0
lift-business-service/src/main/java/cn/com/ty/lift/business/contract/dao/entity/Contracts.java

@@ -0,0 +1,109 @@
+package cn.com.ty.lift.business.contract.dao.entity;
+
+import java.math.BigDecimal;
+import java.util.Date;
+
+import lombok.Data;
+
+/**
+ * 实体类 - 表:contracts
+ *
+ * @since 2019-12-06 16:35:47
+ */
+@Data
+public class Contracts {
+    /**
+     * 主键ID
+     */
+    private Long id;
+
+    /**
+     * 项目ID
+     */
+    private Long projectId;
+
+    /**
+     * 公司ID
+     */
+    private Long mtCompanyId;
+
+    /**
+     * 合同自定义编号
+     */
+    private String code;
+
+    /**
+     * 合同来源(1 : 商保新增 ;2 : 免保转签;3 : 续签;4 : 免保)
+     */
+    private Integer source;
+
+    /**
+     * 付款说明
+     */
+    private String payMode;
+
+    /**
+     * 台量
+     */
+    private Integer liftNum;
+
+    /**
+     * 金额
+     */
+    private BigDecimal moneys;
+
+    /**
+     * 合同类型(1 : 半包;2:大包;3:清包;4:全包;5:大修)
+     */
+    private Integer type;
+
+    /**
+     * 合同状态(1 未开始;2 执行中;3 已结束;4 款未结清)
+     */
+    private Integer status;
+
+    /**
+     * 签约时间
+     */
+    private Date givenDate;
+
+    /**
+     * 签约人
+     */
+    private String givenUser;
+
+    /**
+     * 开始时间
+     */
+    private Date starDate;
+
+    /**
+     * 结束时间
+     */
+    private Date endDate;
+
+    /**
+     * 创建时间
+     */
+    private Date createDate;
+
+    /**
+     * 签约合同编号
+     */
+    private Long nextId;
+
+    /**
+     * 合同附件
+     */
+    private String accessoryUrl;
+
+    /**
+     * 提前结束原因
+     */
+    private String endReason;
+
+    /**
+     * 备注
+     */
+    private String remarks;
+}

+ 38 - 0
lift-business-service/src/main/java/cn/com/ty/lift/business/contract/dao/entity/model/ContractRequest.java

@@ -0,0 +1,38 @@
+package cn.com.ty.lift.business.contract.dao.entity.model;
+
+import lombok.Data;
+
+/**
+ * @author bieao
+ * @date 2019/12/7
+ * @description 合同列表请求体
+ */
+@Data
+public class ContractRequest {
+    /**
+     * 项目id
+     */
+    private Long projectId;
+    /**
+     * 合同id
+     */
+    private Long contractId;
+    /**
+     * 合同类型
+     */
+    private String contractType;
+    /**
+     * 合同状态
+     */
+    private String contractStatus;
+
+    /**
+     * 当前页码
+     */
+    private int pageNum;
+
+    /**
+     * 每页条数
+     */
+    private int pageSize;
+}

+ 60 - 0
lift-business-service/src/main/java/cn/com/ty/lift/business/contract/dao/entity/model/ContractResponse.java

@@ -0,0 +1,60 @@
+package cn.com.ty.lift.business.contract.dao.entity.model;
+
+import lombok.Data;
+
+/**
+ * @author bieao
+ * @date 2019/12/7
+ * @description 合同列表返回体
+ */
+@Data
+public class ContractResponse {
+    /**
+     * 合同编号
+     */
+    private String contractId;
+    /**
+     * 合同来源
+     */
+    private String contractSource;
+    /**
+     * 合同类型
+     */
+    private String contractType;
+    /**
+     * 开始时间
+     */
+    private String starDate;
+    /**
+     * 结束时间
+     */
+    private String endDate;
+    /**
+     * 台量
+     */
+    private String liftNum;
+    /**
+     * 金额
+     */
+    private String moneys;
+    /**
+     * 签约时间
+     */
+    private String givenDate;
+    /**
+     * 签订人
+     */
+    private String givenUser;
+    /**
+     * 合同附件
+     */
+    private String accessoryUrl;
+    /**
+     * 备注
+     */
+    private String remarks;
+    /**
+     * 合同状态
+     */
+    private String contractStatus;
+}

+ 21 - 0
lift-business-service/src/main/java/cn/com/ty/lift/business/contract/dao/mapper/ContractsMapper.java

@@ -0,0 +1,21 @@
+package cn.com.ty.lift.business.contract.dao.mapper;
+
+import cn.com.ty.lift.business.contract.dao.entity.Contracts;
+import cn.com.ty.lift.business.contract.dao.entity.model.ContractRequest;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * MyBatis Mapper 接口 - 表:contracts
+ *
+ * @since 2019-12-06 16:35:47
+ */
+public interface ContractsMapper extends BaseMapper<Contracts> {
+
+    List<Contracts> findByCondition(IPage page, @Param("request") ContractRequest request);
+
+
+}

+ 80 - 0
lift-business-service/src/main/java/cn/com/ty/lift/business/contract/service/ContractService.java

@@ -1,7 +1,87 @@
 package cn.com.ty.lift.business.contract.service;
 
+import cn.com.ty.lift.business.contract.dao.entity.Contracts;
+import cn.com.ty.lift.business.contract.dao.entity.model.ContractRequest;
+import cn.com.ty.lift.business.contract.dao.mapper.ContractsMapper;
+import cn.com.ty.lift.business.framework.util.MessageUtils;
+import cn.com.ty.lift.common.constants.ApiConstants;
+import cn.com.xwy.boot.web.dto.RestResponse;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import org.springframework.stereotype.Service;
 
+import javax.annotation.Resource;
+import java.util.List;
+
+/**
+ * @author bieao
+ * @date 2019/12/07
+ * @description 合同管理业务层
+ */
 @Service
 public class ContractService {
+
+    @Resource
+    private ContractsMapper contractsMapper;
+
+    /**
+     * @param request 合同列表查询条件
+     * @return RestResponse 合同分页列表结果
+     * @description 查询合同列表
+     * @date 2019/12/7 11:53 AM
+     */
+    public RestResponse list(ContractRequest request) {
+        IPage<Contracts> page = new Page<>(request.getPageNum(), request.getPageSize());
+        List<Contracts> contractsList = contractsMapper.findByCondition(page, request);
+        if (contractsList.isEmpty()) {
+            return RestResponse.ok(null, ApiConstants.RESULT_NO_DATA, MessageUtils.get("msg.data.empty"));
+        }
+        page.setRecords(contractsList);
+        return RestResponse.ok(page, ApiConstants.RESULT_SUCCESS, MessageUtils.get("msg.query.success"));
+    }
+
+    /**
+     * @param contracts 新增合同数据项
+     * @return 1.成功, 0.失败, 消息描述
+     * @description 新增合同
+     * @date 2019/12/7 3:31 PM
+     */
+    public RestResponse add(Contracts contracts) {
+        if (contracts.getNextId() == null) {
+            //TODO 按日期自动生成合同编号
+        }
+        int result = contractsMapper.insert(contracts);
+        if (result > 0) {
+            return RestResponse.ok(result, ApiConstants.RESULT_SUCCESS, MessageUtils.get("msg.add.success"));
+        }
+        return RestResponse.error(ApiConstants.RESULT_ERROR, MessageUtils.get("msg.add.fail"));
+    }
+
+    /**
+     * @param contracts 修改合同数据项
+     * @return 1.成功, 0.失败, 消息描述
+     * @description 合同变更
+     * @date 2019/12/7 3:31 PM
+     */
+    public RestResponse modify(Contracts contracts) {
+        int result = contractsMapper.updateById(contracts);
+        if (result > 0) {
+            return RestResponse.ok(result, ApiConstants.RESULT_SUCCESS, MessageUtils.get("msg.modify.success"));
+        }
+        return RestResponse.error(ApiConstants.RESULT_ERROR, MessageUtils.get("msg.modify.fail"));
+    }
+
+    /**
+     * @param id 主键id
+     * @return RestResponse 合同详情
+     * @description 查看合同详情
+     * @date 2019/12/7 11:50 AM
+     */
+    public RestResponse detail(Long id) {
+        Contracts contracts = contractsMapper.selectById(id);
+        if (contracts == null) {
+            return RestResponse.ok(null, ApiConstants.RESULT_NO_DATA, MessageUtils.get("msg.data.empty"));
+        }
+        return RestResponse.ok(contracts, ApiConstants.RESULT_SUCCESS, MessageUtils.get("msg.query.detail.success"));
+    }
 }

+ 21 - 14
lift-business-service/src/main/java/cn/com/ty/lift/business/library/controller/LibraryController.java

@@ -11,11 +11,7 @@ import cn.com.ty.lift.business.library.service.PlatformCompanyLiftRelevanceServi
 import cn.com.ty.lift.business.library.service.ProjectLiftRelevanceService;
 import cn.com.ty.lift.common.base.ExportRequest;
 import cn.com.xwy.boot.web.dto.RestResponse;
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
 
 import javax.annotation.Resource;
 
@@ -32,22 +28,33 @@ public class LibraryController {
     private LibraryService libraryService;
 
     @Resource
-    private ProjectLiftRelevanceService projectLiftRelevanceService;
+    private ProjectLiftRelevanceService projectRelevanceService;
 
     @Resource
-    private PlatformCompanyLiftRelevanceService platformCompanyLiftRelevanceService;
+    private PlatformCompanyLiftRelevanceService platformService;
 
     /**
      * @param request 电梯列表查询条件
-     * @return RestResponse<IPage<Lift>> 电梯分页列表结果
+     * @return RestResponse 电梯分页列表结果
      * @description 查询电梯列表
      * @date 2019/11/27 10:03 AM
      */
     @PostMapping("list")
-    public RestResponse<IPage<Lift>> list(@RequestBody LiftRequest request) {
+    public RestResponse list(@RequestBody LiftRequest request) {
         return libraryService.list(request);
     }
 
+    /**
+     * @param id 电梯id
+     * @return RestResponse 电梯详情
+     * @description 查询电梯详情
+     * @date 2019/12/6 10:51 AM
+     */
+    @PostMapping("detail/{id}")
+    public RestResponse detail(@PathVariable(name = "id") Long id) {
+        return libraryService.detail(id);
+    }
+
     /**
      * @param lift 新增电梯数据项
      * @return 1.成功, 0.失败, 消息描述
@@ -78,7 +85,7 @@ public class LibraryController {
      */
     @PostMapping("lockOrUnlock")
     public RestResponse lockOrUnlock(@RequestBody BatchUpdateLiftRequest request) {
-        return projectLiftRelevanceService.lockOrUnlock(request);
+        return projectRelevanceService.lockOrUnlock(request);
     }
 
     /**
@@ -89,7 +96,7 @@ public class LibraryController {
      */
     @PostMapping("logicDelete")
     public RestResponse logicDelete(@RequestBody ProjectLiftRelevance projectLiftRelevance) {
-        return projectLiftRelevanceService.logicDelete(projectLiftRelevance.getId());
+        return projectRelevanceService.logicDelete(projectLiftRelevance.getId());
     }
 
     /**
@@ -100,18 +107,18 @@ public class LibraryController {
      */
     @PostMapping("selectBatchByIds")
     public RestResponse selectBatchByIds(@RequestBody SelectBatchPlatformCompanyRequest request) {
-        return platformCompanyLiftRelevanceService.selectBatch(request);
+        return platformService.selectBatch(request);
     }
 
     /**
      * @param request companyLiftRelevanceList 公司电梯更新列表
      * @return 1.成功, 0.失败, 消息描述
-     * @description 批量更新电梯状态
+     * @description 批量更新电梯状态为停保
      * @date 2019/12/5 5:24 PM
      */
     @PostMapping("updateBatchByIds")
     public RestResponse updateBatchByIds(@RequestBody UpdateBatchPlatformCompanyRequest request) {
-        return platformCompanyLiftRelevanceService.updateBatch(request);
+        return platformService.updateBatch(request);
     }
 
     /**

+ 6 - 1
lift-business-service/src/main/java/cn/com/ty/lift/business/library/dao/entity/model/BatchUpdateLiftRequest.java

@@ -13,8 +13,13 @@ import java.util.List;
 @Data
 public class BatchUpdateLiftRequest {
     /**
-     * 项目id列表
+     * 电梯id列表
      */
     private List<ProjectLiftRelevance> updateLiftList;
 
+    /**
+     * 来源:0:锁定电梯 1:锁定项目
+     */
+    private String operate;
+
 }

+ 20 - 13
lift-business-service/src/main/java/cn/com/ty/lift/business/library/service/LibraryService.java

@@ -7,7 +7,6 @@ import cn.com.ty.lift.business.library.dao.entity.PlatformCompanyLiftRelevance;
 import cn.com.ty.lift.business.library.dao.entity.model.LiftRequest;
 import cn.com.ty.lift.business.library.dao.mapper.LiftExtensionMapper;
 import cn.com.ty.lift.business.library.dao.mapper.LiftMapper;
-import cn.com.ty.lift.business.library.dao.mapper.PlatformCompanyLiftRelevanceMapper;
 import cn.com.ty.lift.common.base.ExportRequest;
 import cn.com.ty.lift.common.constants.ApiConstants;
 import cn.com.ty.lift.common.export.ExportUtils;
@@ -38,13 +37,10 @@ public class LibraryService {
     private LiftExtensionMapper liftExtensionMapper;
 
     @Resource
-    private PlatformCompanyLiftRelevanceMapper platformCompanyLiftRelevanceMapper;
+    private PlatformCompanyLiftRelevanceService platformService;
 
     @Resource
-    private PlatformCompanyLiftRelevanceService platformCompanyLiftRelevanceService;
-
-    @Resource
-    private ProjectLiftRelevanceService projectLiftRelevanceService;
+    private ProjectLiftRelevanceService projectRelevanceService;
 
     private Map<String, String> paramMap = new HashMap<String, String>() {{
         put("liftCode", "电梯号");
@@ -60,7 +56,7 @@ public class LibraryService {
      * @description 条件查询电梯档案列表
      * @date 2019/11/27 2:10 PM
      */
-    public RestResponse<IPage<Lift>> list(LiftRequest request) {
+    public RestResponse list(LiftRequest request) {
         IPage<Lift> page = new Page<>(request.getPageNum(), request.getPageSize());
         List<Lift> lifts = liftMapper.findByCondition(page, request);
         if (lifts.isEmpty()) {
@@ -71,6 +67,20 @@ public class LibraryService {
         return RestResponse.ok(page, ApiConstants.RESULT_SUCCESS, MessageUtils.get("msg.query.success"));
     }
 
+    /**
+     * @param id 电梯id
+     * @return RestResponse 电梯详情
+     * @description 查询电梯详情
+     * @date 2019/12/6 10:51 AM
+     */
+    public RestResponse detail(Long id) {
+        Lift lift = liftMapper.selectById(id);
+        if (lift == null) {
+            return RestResponse.ok(null, ApiConstants.RESULT_NO_DATA, MessageUtils.get("msg.data.empty"));
+        }
+        return RestResponse.ok(lift, ApiConstants.RESULT_SUCCESS, MessageUtils.get("msg.query.success"));
+    }
+
     /**
      * @param lift 电梯
      * @return 电梯扩展实体
@@ -111,7 +121,7 @@ public class LibraryService {
             //电梯管理入口
             case "0":
                 //新增平台企业电梯关联表
-                PlatformCompanyLiftRelevance ret = platformCompanyLiftRelevanceService.save(extension);
+                PlatformCompanyLiftRelevance ret = platformService.save(extension);
                 if (ret == null) {
                     return RestResponse.error(ApiConstants.RESULT_ERROR, MessageUtils.get("msg.add.fail"));
                 }
@@ -119,15 +129,12 @@ public class LibraryService {
             //项目管理入口
             case "1":
                 //新增平台企业电梯关联表
-                PlatformCompanyLiftRelevance companyLiftEntry = platformCompanyLiftRelevanceService.save(extension);
+                PlatformCompanyLiftRelevance companyLiftEntry = platformService.save(extension);
                 if (companyLiftEntry == null) {
                     return RestResponse.error(ApiConstants.RESULT_ERROR, MessageUtils.get("msg.add.fail"));
                 }
-                if (platformCompanyLiftRelevanceMapper.insert(companyLiftEntry) == 0) {
-                    return RestResponse.error(ApiConstants.RESULT_ERROR, MessageUtils.get("msg.add.fail"));
-                }
                 //新增项目电梯关联表
-                boolean result = projectLiftRelevanceService.save(extension, companyLiftEntry.getId(), lift.getWorkerId());
+                boolean result = projectRelevanceService.save(extension, companyLiftEntry.getId(), lift.getWorkerId());
                 if (!result) {
                     return RestResponse.error(ApiConstants.RESULT_ERROR, MessageUtils.get("msg.add.fail"));
                 }

+ 1 - 1
lift-business-service/src/main/java/cn/com/ty/lift/business/library/service/PlatformCompanyLiftRelevanceService.java

@@ -58,7 +58,7 @@ public class PlatformCompanyLiftRelevanceService extends ServiceImpl<PlatformCom
     /**
      * @param request companyLiftRelevanceList 公司电梯更新列表
      * @return 1.成功, 0.失败, 消息描述
-     * @description 批量更新电梯状态
+     * @description 批量更新电梯状态为停保 TODO 清除维保计划
      * @date 2019/12/5 5:24 PM
      */
     public RestResponse updateBatch(UpdateBatchPlatformCompanyRequest request) {

+ 27 - 20
lift-business-service/src/main/java/cn/com/ty/lift/business/library/service/ProjectLiftRelevanceService.java

@@ -9,6 +9,7 @@ import cn.com.ty.lift.common.constants.ApiConstants;
 import cn.com.xwy.boot.web.dto.RestResponse;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
 
 /**
  * @author bieao
@@ -18,20 +19,6 @@ import org.springframework.stereotype.Service;
 @Service
 public class ProjectLiftRelevanceService extends ServiceImpl<ProjectLiftRelevanceMapper, ProjectLiftRelevance> {
 
-    /**
-     * @param request updateLiftList 批量更新列表
-     * @return RestResponse 状态码和返回消息
-     * @description 电梯批量锁定、解锁
-     * @date 2019/12/5 11:00 AM
-     */
-    public RestResponse lockOrUnlock(BatchUpdateLiftRequest request) {
-        boolean result = updateBatchById(request.getUpdateLiftList());
-        if (!result) {
-            return RestResponse.error(ApiConstants.RESULT_ERROR, MessageUtils.get("msg.modify.batch.fail"));
-        }
-        return RestResponse.ok(ApiConstants.RESULT_SUCCESS, MessageUtils.get("msg.modify.batch.success"));
-    }
-
     /**
      * @param id 主键id
      * @return RestResponse 状态码和返回消息
@@ -65,15 +52,35 @@ public class ProjectLiftRelevanceService extends ServiceImpl<ProjectLiftRelevanc
     }
 
     /**
-     * @param relevance
+     * @param request
      * @return RestResponse 状态码和返回消息
-     * @description 项目锁定、解锁
+     * @description 项目锁定、解锁,锁定该项目下的电梯
      * @date 2019/12/5 11:00 AM
      */
-    public RestResponse lockOrUnlock(ProjectLiftRelevance relevance) {
-        boolean result = updateById(relevance);
-        if (!result) {
-            return RestResponse.error(ApiConstants.RESULT_ERROR, MessageUtils.get("msg.modify.fail"));
+    @Transactional
+    public RestResponse lockOrUnlock(BatchUpdateLiftRequest request) {
+        String source = request.getOperate();
+        switch (source) {
+            //锁定电梯
+            case "0":
+                boolean result = updateBatchById(request.getUpdateLiftList());
+                if (!result) {
+                    return RestResponse.error(ApiConstants.RESULT_ERROR, MessageUtils.get("msg.modify.fail"));
+                }
+                break;
+            //锁定项目
+            case "1":
+                boolean ret = updateById(request.getUpdateLiftList().get(0));
+                if (!ret){
+                    return RestResponse.error(ApiConstants.RESULT_ERROR, MessageUtils.get("msg.modify.fail"));
+                }
+                boolean response = updateBatchById(request.getUpdateLiftList());
+                if (!response){
+                    return RestResponse.error(ApiConstants.RESULT_ERROR, MessageUtils.get("msg.modify.fail"));
+                }
+                break;
+            default:
+                break;
         }
         return RestResponse.ok(ApiConstants.RESULT_SUCCESS, MessageUtils.get("msg.modify.success"));
     }

+ 20 - 14
lift-business-service/src/main/java/cn/com/ty/lift/business/project/controller/ProjectController.java

@@ -1,20 +1,15 @@
 package cn.com.ty.lift.business.project.controller;
 
-import cn.com.ty.lift.business.library.dao.entity.ProjectLiftRelevance;
+import cn.com.ty.lift.business.library.dao.entity.model.BatchUpdateLiftRequest;
 import cn.com.ty.lift.business.library.service.ProjectLiftRelevanceService;
 import cn.com.ty.lift.business.project.dao.entity.Project;
-import cn.com.ty.lift.business.project.dao.entity.ProjectHistory;
 import cn.com.ty.lift.business.project.dao.entity.ProjectUser;
 import cn.com.ty.lift.business.project.dao.entity.model.ProjectHistoryRequest;
 import cn.com.ty.lift.business.project.dao.entity.model.ProjectRequest;
 import cn.com.ty.lift.business.project.service.ProjectService;
 import cn.com.ty.lift.common.base.ExportRequest;
 import cn.com.xwy.boot.web.dto.RestResponse;
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
 
 import javax.annotation.Resource;
 
@@ -35,26 +30,37 @@ public class ProjectController {
 
     /**
      * @param request 项目列表查询条件
-     * @return RestResponse<IPage<Project>> 项目分页列表结果
+     * @return RestResponse 项目分页列表结果
      * @description 查询项目列表
      * @date 2019/11/28 4:18 PM
      */
     @PostMapping("list")
-    public RestResponse<IPage<Project>> list(@RequestBody ProjectRequest request) {
+    public RestResponse list(@RequestBody ProjectRequest request) {
         return projectService.list(request);
     }
 
     /**
      * @param request 项目操作记录查询条件
-     * @return RestResponse<IPage<ProjectHistory>> 项目操作记录分页列表结果
+     * @return RestResponse 项目操作记录分页列表结果
      * @description 查询项目操作记录列表
      * @date 2019/12/2 11:41 AM
      */
     @PostMapping("history/list")
-    public RestResponse<IPage<ProjectHistory>> list(@RequestBody ProjectHistoryRequest request) {
+    public RestResponse list(@RequestBody ProjectHistoryRequest request) {
         return projectService.list(request);
     }
 
+    /**
+     * @param id 项目id
+     * @return RestResponse 项目详情
+     * @description 查询项目详情
+     * @date 2019/12/6 10:51 AM
+     */
+    @PostMapping("detail/{id}")
+    public RestResponse detail(@PathVariable(name = "id") Long id){
+        return projectService.detail(id);
+    }
+
     /**
      * @return RestResponse 省、市、区树形结构列表
      * @description 查询省、市、区树形结构列表
@@ -99,14 +105,14 @@ public class ProjectController {
     }
 
     /**
-     * @param relevance
+     * @param request
      * @return 1.成功, 0.失败, 消息描述
      * @description 项目锁定、解锁
      * @date 2019/12/5 4:16 PM
      */
     @PostMapping("lockOrUnlock")
-    public RestResponse lockOrUnlock(@RequestBody ProjectLiftRelevance relevance) {
-        return projectLiftRelevanceService.lockOrUnlock(relevance);
+    public RestResponse lockOrUnlock(@RequestBody BatchUpdateLiftRequest request) {
+        return projectLiftRelevanceService.lockOrUnlock(request);
     }
 
     /**

+ 19 - 6
lift-business-service/src/main/java/cn/com/ty/lift/business/project/service/ProjectService.java

@@ -63,14 +63,14 @@ public class ProjectService {
      * @description 条件查询项目管理列表
      * @date 2019/11/27 2:10 PM
      */
-    public RestResponse<IPage<Project>> list(ProjectRequest request) {
+    public RestResponse list(ProjectRequest request) {
         IPage<Project> page = new Page<>(request.getPageNum(), request.getPageSize());
-        List<Project> lifts = projectMapper.findByCondition(page, request);
-        if (lifts.isEmpty()) {
+        List<Project> projectList = projectMapper.findByCondition(page, request);
+        if (projectList.isEmpty()) {
             page.setRecords(new ArrayList<>());
             return RestResponse.ok(null, ApiConstants.RESULT_NO_DATA, MessageUtils.get("msg.data.empty"));
         }
-        page.setRecords(lifts);
+        page.setRecords(projectList);
         return RestResponse.ok(page, ApiConstants.RESULT_SUCCESS, MessageUtils.get("msg.query.success"));
     }
 
@@ -80,17 +80,30 @@ public class ProjectService {
      * @description 查询项目操作记录列表
      * @date 2019/11/27 2:10 PM
      */
-    public RestResponse<IPage<ProjectHistory>> list(ProjectHistoryRequest request) {
+    public RestResponse list(ProjectHistoryRequest request) {
         IPage<ProjectHistory> page = new Page<>(request.getPageNum(), request.getPageSize());
         List<ProjectHistory> historyList = projectHistoryMapper.findByCondition(page, request);
         if (historyList.isEmpty()) {
-            page.setRecords(new ArrayList<>());
             return RestResponse.ok(null, ApiConstants.RESULT_NO_DATA, MessageUtils.get("msg.data.empty"));
         }
         page.setRecords(historyList);
         return RestResponse.ok(page, ApiConstants.RESULT_SUCCESS, MessageUtils.get("msg.query.success"));
     }
 
+    /**
+     * @param id 项目id
+     * @return RestResponse 项目详情
+     * @description 查询项目详情
+     * @date 2019/12/6 10:51 AM
+     */
+    public RestResponse detail(Long id) {
+        Project project = projectMapper.selectById(id);
+        if (project == null) {
+            return RestResponse.ok(null, ApiConstants.RESULT_NO_DATA, MessageUtils.get("msg.data.empty"));
+        }
+        return RestResponse.ok(project, ApiConstants.RESULT_SUCCESS, MessageUtils.get("msg.query.detail.success"));
+    }
+
     /**
      * @return RestResponse 省、市、区树形结构列表
      * @description 查询省、市、区树形结构列表

+ 1 - 0
lift-business-service/src/main/resources/locale/response.properties

@@ -1,5 +1,6 @@
 msg.data.empty=\u6682\u65E0\u6570\u636E
 msg.query.success=\u67E5\u8BE2\u5217\u8868\u6210\u529F
+msg.query.detail.success=\u67E5\u8BE2\u8BE6\u60C5\u6210\u529F
 msg.add.success=\u65B0\u589E\u6210\u529F
 msg.add.fail=\u65B0\u589E\u5931\u8D25
 msg.modify.success=\u4FEE\u6539\u6210\u529F

+ 59 - 0
lift-business-service/src/main/resources/mapper/contract/ContractsMapper.xml

@@ -0,0 +1,59 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
+<mapper namespace="cn.com.ty.lift.business.contract.dao.mapper.ContractsMapper" >
+    <resultMap id="BaseResultMap" type="cn.com.ty.lift.business.contract.dao.entity.Contracts" >
+        <id column="id" property="id" jdbcType="BIGINT" />
+        <result column="project_id" property="projectId" jdbcType="BIGINT" />
+        <result column="mt_company_id" property="mtCompanyId" jdbcType="BIGINT" />
+        <result column="code" property="code" jdbcType="VARCHAR" />
+        <result column="source" property="source" jdbcType="INTEGER" />
+        <result column="pay_mode" property="payMode" jdbcType="VARCHAR" />
+        <result column="lift_num" property="liftNum" jdbcType="INTEGER" />
+        <result column="moneys" property="moneys" jdbcType="DECIMAL" />
+        <result column="type" property="type" jdbcType="INTEGER" />
+        <result column="status" property="status" jdbcType="INTEGER" />
+        <result column="given_date" property="givenDate" jdbcType="TIMESTAMP" />
+        <result column="given_user" property="givenUser" jdbcType="VARCHAR" />
+        <result column="star_date" property="starDate" jdbcType="TIMESTAMP" />
+        <result column="end_date" property="endDate" jdbcType="TIMESTAMP" />
+        <result column="create_date" property="createDate" jdbcType="TIMESTAMP" />
+        <result column="next_id" property="nextId" jdbcType="BIGINT" />
+        <result column="accessory_url" property="accessoryUrl" jdbcType="LONGVARCHAR" />
+        <result column="end_reason" property="endReason" jdbcType="LONGVARCHAR" />
+        <result column="remarks" property="remarks" jdbcType="LONGVARCHAR" />
+    </resultMap>
+
+    <sql id="Base_Column_List" >
+		id, project_id, mt_company_id, code, source, pay_mode, lift_num, moneys, type, status,
+		given_date, given_user, star_date, end_date, create_date, next_id, accessory_url, end_reason, remarks
+	</sql>
+
+    <!-- 根据项目、合同号、合同类型、合同状态查询合同管理列表-->
+    <select id="findByCondition" resultType="cn.com.ty.lift.business.contract.dao.entity.model.ContractResponse" parameterType="cn.com.ty.lift.business.contract.dao.entity.model.ContractRequest" >
+        SELECT
+        id            as contractId,
+        source        as source,
+        type          as type,
+        star_date     as starDate,
+        end_date      as endDate,
+        lift_num      as liftNum,
+        moneys        as moneys,
+        given_date    as givenDate,
+        given_user    as givenUser,
+        accessory_url as accessoryUrl,
+        remarks       as remarks,
+        status        as status
+        from contracts
+        WHERE 1=1
+        <if test="request.contractId!=null and request.contractId!=''">
+            and id= #{request.contractId,jdbcType=VARCHAR}
+        </if>
+        <if test="request.contractType!=null and request.contractType!=''">
+            and type = #{request.contractType,jdbcType=VARCHAR}
+        </if>
+        <if test="request.contractStatus!=null and request.contractStatus!=''">
+            and status = #{request.contractStatus,jdbcType=VARCHAR}
+        </if>
+    </select>
+
+</mapper>

+ 1 - 1
lift-business-service/src/main/resources/mapper/emergency/EmergencyRepairMapper.xml

@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8" ?>
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
 <mapper namespace="cn.com.ty.lift.business.emergency.mapper.EmergencyRepairMapper" >
-	<resultMap id="BaseResultMap" type="EmergencyRepair" >
+	<resultMap id="BaseResultMap" type="cn.com.ty.lift.business.emergency.entity.EmergencyRepair" >
 		<id column="id" property="id" jdbcType="BIGINT" />
 		<result column="mt_company_id" property="mtCompanyId" jdbcType="BIGINT" />
 		<result column="lift_id" property="liftId" jdbcType="BIGINT" />

lift-business-service/src/main/resources/mapper/LiftExtensionMapper.xml → lift-business-service/src/main/resources/mapper/lift/LiftExtensionMapper.xml


lift-business-service/src/main/resources/mapper/LiftMapper.xml → lift-business-service/src/main/resources/mapper/lift/LiftMapper.xml