Sfoglia il codice sorgente

Merge branch 'feature-wcz' of lift-manager/lift-server into develop

wucizhong 5 anni fa
parent
commit
af2ad14e46
21 ha cambiato i file con 234 aggiunte e 95 eliminazioni
  1. 1 0
      lift-business-service/src/main/java/cn/com/ty/lift/business/common/Values.java
  2. 17 3
      lift-business-service/src/main/java/cn/com/ty/lift/business/emergency/controller/EmergencyRepairController.java
  3. 6 0
      lift-business-service/src/main/java/cn/com/ty/lift/business/emergency/dto/RepairRequest.java
  4. 14 0
      lift-business-service/src/main/java/cn/com/ty/lift/business/emergency/dto/RepairResponse.java
  5. 24 0
      lift-business-service/src/main/java/cn/com/ty/lift/business/emergency/service/EmergencyRepairService.java
  6. 2 1
      lift-business-service/src/main/java/cn/com/ty/lift/business/emergency/service/LiftFaultService.java
  7. 17 11
      lift-business-service/src/main/java/cn/com/ty/lift/business/library/controller/LiftImportController.java
  8. 19 0
      lift-business-service/src/main/java/cn/com/ty/lift/business/library/dao/entity/model/request/LiftImportRequest.java
  9. 25 22
      lift-business-service/src/main/java/cn/com/ty/lift/business/library/service/LiftService.java
  10. 12 11
      lift-business-service/src/main/java/cn/com/ty/lift/business/project/controller/ProjectImportController.java
  11. 17 0
      lift-business-service/src/main/java/cn/com/ty/lift/business/project/dao/entity/model/request/ProjectImportRequest.java
  12. 4 4
      lift-business-service/src/main/resources/application-dev.yml
  13. 19 0
      lift-business-service/src/main/resources/application-local.yml
  14. 1 1
      lift-business-service/src/main/resources/application.yml
  15. 26 15
      lift-business-service/src/main/resources/mapper/emergency/EmergencyRepairMapper.xml
  16. 3 3
      lift-enterprise-service/src/main/resources/application-dev.yml
  17. 6 0
      lift-enterprise-service/src/main/resources/application-local.yml
  18. 0 6
      lift-enterprise-service/src/main/resources/application-test.yml
  19. 1 0
      lift-business-service/src/main/resources/application-test.yml
  20. 20 0
      lift-system-service/src/main/resources/application-local.yml
  21. 0 18
      lift-system-service/src/main/resources/application.yml

+ 1 - 0
lift-business-service/src/main/java/cn/com/ty/lift/business/common/Values.java

@@ -314,6 +314,7 @@ public interface Values {
     String erMissingSign = "请签名";
     String erMustFinish = "急修完成后才能操作";
     String erHadEvaluate = "急修已经评价了";
+    String erMissingImage = "缺少急修图片";
 
     //==============================================================================
 

+ 17 - 3
lift-business-service/src/main/java/cn/com/ty/lift/business/emergency/controller/EmergencyRepairController.java

@@ -21,6 +21,7 @@ import cn.com.ty.lift.business.evaluation.dao.entity.model.EvaluationRequest;
 import cn.com.ty.lift.business.evaluation.service.EvaluationService;
 import cn.com.xwy.boot.web.dto.RestResponse;
 import cn.hutool.core.bean.BeanUtil;
+import cn.hutool.core.collection.IterUtil;
 import cn.hutool.core.util.ObjectUtil;
 import cn.hutool.core.util.StrUtil;
 import com.baomidou.mybatisplus.core.metadata.IPage;
@@ -103,7 +104,10 @@ public class EmergencyRepairController {
             List<Long> dutyIds = Arrays.asList(faultPart.split(",")).stream().map(s -> Long.parseLong(s.trim())).collect(Collectors.toList());
             result.setFaultDuties(liftFaultService.listByIds(dutyIds));
         }
+        //评价
         result.setEvaluation(evaluationService.findByRecord(id));
+        //急修图片
+        result.setErRecordImgs(erRecordImgService.listByErRecordId(id));
         return RestResponse.success(result);
     }
 
@@ -344,7 +348,7 @@ public class EmergencyRepairController {
     @PostMapping("fault/list")
     public RestResponse faultList(@RequestBody RepairRequest request){
         Integer liftCategory = request.getLiftCategory();
-        if(null == liftCategory || liftCategory < 0){
+        if(null == liftCategory || liftCategory <= 0){
             return RestResponse.success(liftFaultService.list());
         }
         List<LiftFault> lists = liftFaultService.listByLiftCategory(liftCategory);
@@ -359,7 +363,7 @@ public class EmergencyRepairController {
     @PostMapping("fault/tree")
     public RestResponse faultTree(@RequestBody RepairRequest request) {
         Integer liftCategory = request.getLiftCategory();
-        if(null == liftCategory || liftCategory < 0){
+        if(null == liftCategory || liftCategory <= 0){
             List<LiftFault> liftFaults = liftFaultService.list();
             return assemble(liftFaults);
         }else{
@@ -440,6 +444,16 @@ public class EmergencyRepairController {
         Judge.notTrue(StrUtil.hasEmpty(mainSign,secondSign),Values.erMissingSign);
         EmergencyRepair entity = emergencyRepairService.getById(id);
         Judge.notNull(entity);
+        List<String> erRecordImg = request.getErRecordImg();
+        Judge.notTrue(IterUtil.isNotEmpty(erRecordImg),Values.erMissingImage);
+        List<ErRecordImg> erRecordImgs = new ArrayList<>();
+        erRecordImg.forEach(img -> {
+            ErRecordImg item = new ErRecordImg();
+            item.setErRecordId(id);
+            item.setImgUrl(img);
+            erRecordImgs.add(item);
+        });
+        entity.setFieldDescription(request.getFieldDescription());
         entity.setFaultPart(request.getFaultPart());
         entity.setFaultReason(request.getFaultReason());
         entity.setFaultHandle(request.getFaultHandle());
@@ -449,7 +463,7 @@ public class EmergencyRepairController {
 
         //修改状态已完成
         entity.setStatus(Values.ER_STATUS_FINISH);
-        boolean result = emergencyRepairService.updateById(entity);
+        boolean result = emergencyRepairService.repairOrder(entity,erRecordImgs);
         return Judge.result(result);
     }
 

+ 6 - 0
lift-business-service/src/main/java/cn/com/ty/lift/business/emergency/dto/RepairRequest.java

@@ -156,4 +156,10 @@ public class RepairRequest extends BaseRequestModel{
      */
     private String customerSign;
 
+    /**
+     * 现场描述
+     */
+    private String fieldDescription;
+
+    private List<String> erRecordImg;
 }

+ 14 - 0
lift-business-service/src/main/java/cn/com/ty/lift/business/emergency/dto/RepairResponse.java

@@ -2,6 +2,7 @@ package cn.com.ty.lift.business.emergency.dto;
 
 import cn.com.ty.lift.business.emergency.entity.EmergencyRepair;
 import cn.com.ty.lift.business.emergency.entity.ErCostItem;
+import cn.com.ty.lift.business.emergency.entity.ErRecordImg;
 import cn.com.ty.lift.business.emergency.entity.LiftFault;
 import cn.com.ty.lift.business.evaluation.dao.entity.Evaluation;
 import cn.hutool.core.date.BetweenFormater;
@@ -46,6 +47,14 @@ public class RepairResponse extends EmergencyRepair{
      */
     private String devicePosition;
 
+    /**
+     * 电梯类别
+     */
+    private Integer liftCategory;
+    /**
+     * 电梯编号
+     */
+    private String liftCode;
     /**
      * 维修工
      */
@@ -104,4 +113,9 @@ public class RepairResponse extends EmergencyRepair{
      * 急修评价
      */
     private Evaluation evaluation;
+
+    /**
+     * 急修图片
+     */
+    private List<ErRecordImg> erRecordImgs;
 }

+ 24 - 0
lift-business-service/src/main/java/cn/com/ty/lift/business/emergency/service/EmergencyRepairService.java

@@ -1,9 +1,11 @@
 package cn.com.ty.lift.business.emergency.service;
 
+import cn.com.ty.lift.business.common.Judge;
 import cn.com.ty.lift.business.common.Values;
 import cn.com.ty.lift.business.emergency.dto.RepairRequest;
 import cn.com.ty.lift.business.emergency.dto.RepairResponse;
 import cn.com.ty.lift.business.emergency.entity.EmergencyRepair;
+import cn.com.ty.lift.business.emergency.entity.ErRecordImg;
 import cn.com.ty.lift.business.emergency.mapper.EmergencyRepairMapper;
 import cn.com.ty.lift.business.library.dao.entity.PlatformCompanyLiftRelevance;
 import cn.com.ty.lift.business.library.service.PlatformCompanyLiftRelevanceService;
@@ -19,6 +21,7 @@ import org.springframework.transaction.annotation.Transactional;
 import org.springframework.transaction.interceptor.TransactionAspectSupport;
 
 import java.util.Arrays;
+import java.util.List;
 
 /**
  * <p>
@@ -34,6 +37,9 @@ public class EmergencyRepairService extends ServiceImpl<EmergencyRepairMapper, E
     @Autowired
     private PlatformCompanyLiftRelevanceService platformCompanyLiftRelevanceService;
 
+    @Autowired
+    private ErRecordImgService erRecordImgService;
+
     /**
      * 分页查询急修中的急修记录
      * @param request
@@ -213,4 +219,22 @@ public class EmergencyRepairService extends ServiceImpl<EmergencyRepairMapper, E
         }
         return true;
     }
+
+    @Transactional
+    public boolean repairOrder(EmergencyRepair repair, List<ErRecordImg> erRecordImgs){
+        Judge.notNull(repair);
+        Judge.notNull(erRecordImgs);
+        boolean re = saveOrUpdate(repair);
+        if(re){
+            boolean im = erRecordImgService.saveBatch(erRecordImgs);
+            if(im){
+                return true;
+            }else{
+                //强制手动事务回滚
+                TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
+                return false;
+            }
+        }
+        return false;
+    }
 }

+ 2 - 1
lift-business-service/src/main/java/cn/com/ty/lift/business/emergency/service/LiftFaultService.java

@@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import org.springframework.stereotype.Service;
 
+import java.util.Arrays;
 import java.util.List;
 
 /**
@@ -30,7 +31,7 @@ public class LiftFaultService extends ServiceImpl<LiftFaultMapper, LiftFault> {
     public List<LiftFault> listByLiftCategory(Integer liftCategory) {
         QueryWrapper<LiftFault> queryWrapper = new QueryWrapper<>();
         LambdaQueryWrapper<LiftFault> lambdaQueryWrapper = queryWrapper.lambda();
-        lambdaQueryWrapper.eq(LiftFault::getLiftCategory,liftCategory);
+        lambdaQueryWrapper.in(LiftFault::getLiftCategory,Arrays.asList(0,liftCategory));
         return list(lambdaQueryWrapper);
     }
 }

+ 17 - 11
lift-business-service/src/main/java/cn/com/ty/lift/business/library/controller/LiftImportController.java

@@ -1,17 +1,16 @@
 package cn.com.ty.lift.business.library.controller;
 
+import cn.com.ty.lift.business.common.Judge;
 import cn.com.ty.lift.business.common.Multipart;
 import cn.com.ty.lift.business.library.dao.entity.model.LiftImportModel;
+import cn.com.ty.lift.business.library.dao.entity.model.request.LiftImportRequest;
 import cn.com.ty.lift.business.library.service.LiftService;
 import cn.com.xwy.boot.web.dto.RestResponse;
 import cn.hutool.core.util.StrUtil;
 import cn.hutool.poi.excel.ExcelReader;
 import cn.hutool.poi.excel.ExcelUtil;
 import lombok.AllArgsConstructor;
-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 org.springframework.web.multipart.MultipartFile;
 
 import java.io.File;
@@ -31,18 +30,19 @@ public class LiftImportController {
 
 
     @PostMapping("import")
-    public RestResponse importData(@RequestBody MultipartFile file, Long mtCompanyId, Long projectId) throws Exception{
-        if(null == file || null == mtCompanyId || mtCompanyId <= 0){
-            return RestResponse.failParam();
-        }
+    public RestResponse importData(@RequestBody LiftImportRequest request) throws Exception{
+        MultipartFile file = request.getFile();
+        Long mtCompanyId = request.getMtCompanyId();
+        Judge.notNull(file,"没有解析到文件数据");
+        Judge.id(mtCompanyId);
+        Long projectId = request.getProjectId();
         // 1 检查文件有效性
         // 获取文件名,带后缀
         String originalFilename = file.getOriginalFilename();
         // 获取文件的后缀格式
         String fileSuffix = originalFilename.substring(originalFilename.lastIndexOf(".") + 1).toLowerCase();
-        if(!StrUtil.equalsAny(fileSuffix,"xls","xlsx")){
-            return RestResponse.fail("文件格式不支持,暂时只支持xls,xlsx");
-        }
+        Judge.notTrue(!StrUtil.equalsAny(fileSuffix,"xls","xlsx"),"文件格式不支持,暂时只支持xls,xlsx");
+
         // 2 解析文件,转换成bean
         File excel = Multipart.multipartFileToFile(file);
         ExcelReader reader = ExcelUtil.getReader(excel);
@@ -59,4 +59,10 @@ public class LiftImportController {
 
         return liftService.assemble(liftImportModels,1l,1l);
     }
+
+    @PostMapping("cleanData")
+    public RestResponse cleanData(){
+        //1 获取
+        return RestResponse.success();
+    }
 }

+ 19 - 0
lift-business-service/src/main/java/cn/com/ty/lift/business/library/dao/entity/model/request/LiftImportRequest.java

@@ -0,0 +1,19 @@
+package cn.com.ty.lift.business.library.dao.entity.model.request;
+
+import lombok.Data;
+import org.springframework.web.multipart.MultipartFile;
+
+/**
+ * @author wcz
+ * @Description: 电梯上传请求参数
+ * @date 2020/1/11 10:49
+ */
+@Data
+public class LiftImportRequest {
+
+    private MultipartFile file;
+
+    private Long mtCompanyId;
+
+    private Long projectId;
+}

+ 25 - 22
lift-business-service/src/main/java/cn/com/ty/lift/business/library/service/LiftService.java

@@ -45,7 +45,7 @@ import java.util.*;
  */
 @Slf4j
 @Service
-public class LiftService extends ServiceImpl<LiftMapper,Lift> {
+public class LiftService extends ServiceImpl<LiftMapper, Lift> {
 
     @Resource
     private LiftMapper liftMapper;
@@ -109,7 +109,7 @@ public class LiftService extends ServiceImpl<LiftMapper,Lift> {
 
 
     /**
-     * @param mtCompanyId 公司id
+     * @param mtCompanyId      公司id
      * @param registrationCode 注册代码
      * @return RestResponse 判断结果
      * @description 新增电梯前置判断条件
@@ -131,7 +131,7 @@ public class LiftService extends ServiceImpl<LiftMapper,Lift> {
                 LiftExtendResponse detail = detail(liftId);
                 return RestResponse.success(detail, MessageUtils.get("msg.lift.company.exist"));
             }
-        }  else {
+        } else {
             return RestResponse.success(null, MessageUtils.get("msg.pre.judge"));
         }
     }
@@ -257,14 +257,15 @@ public class LiftService extends ServiceImpl<LiftMapper,Lift> {
 
     /**
      * 解析excel导入电梯
+     *
      * @param liftImportModels
      * @param mtCompanyId
      * @param projectId
      * @return
      */
     @Transactional
-    public RestResponse assemble(List<LiftImportModel> liftImportModels,Long mtCompanyId, Long projectId){
-        Judge.notNull(liftImportModels,"没有数据");
+    public RestResponse assemble(List<LiftImportModel> liftImportModels, Long mtCompanyId, Long projectId) {
+        Judge.notNull(liftImportModels, "没有数据");
         //存放新建的lift
         List<Lift> lifts = new ArrayList<>();
         //存放新建的project-lift关联信息
@@ -273,28 +274,30 @@ public class LiftService extends ServiceImpl<LiftMapper,Lift> {
         List<PlatformCompanyLiftRelevance> platformCompanyLiftRelevances = new ArrayList<>();
 
         //根据维保公司和项目id查询
-        List<LiftProjectModel> liftProjectModelList = liftMapper.listByCompanyAndProject(mtCompanyId,projectId);
+        List<LiftProjectModel> liftProjectModelList = liftMapper.listByCompanyAndProject(mtCompanyId, projectId);
         //根据维保公司和项目查询
+
         List<ProjectLiftRelevance> projectLiftRelevanceList = projectRelevanceService.findLiftList(mtCompanyId,projectId);
+
         //根据维保公司
         List<PlatformCompanyLiftRelevance> platformCompanyLiftRelevanceList = platformService.listByCompany(mtCompanyId);
 
-        for(int i = 0; i< liftImportModels.size();i++){
+        for (int i = 0; i < liftImportModels.size(); i++) {
             LiftImportModel item = liftImportModels.get(i);
             Lift lift = new Lift();
             //复制解析model中的值到lift中
-            BeanUtil.copyProperties(item,lift,true);
-            log.info("复制电梯属性后:{}",lift);
+            BeanUtil.copyProperties(item, lift, true);
+            log.info("复制电梯属性后:{}", lift);
 
             String registrationCode = item.getRegistrationCode();
             LiftProjectModel liftProjectModel = liftProjectModelList.stream().filter(lpm -> (
                     StrUtil.equals(registrationCode, lpm.getRegistrationCode())
             )).distinct().limit(1).findFirst().get();
 
-            if(null != liftProjectModel){
+            if (null != liftProjectModel) {
                 //如果已经存在lift,取出id赋值
                 lift.setId(liftProjectModel.getLiftId());
-            }else{
+            } else {
                 //如果不存在,新建id赋值
                 lift.setId(IdWorker.getId());
                 //加入list中批量插入
@@ -303,8 +306,8 @@ public class LiftService extends ServiceImpl<LiftMapper,Lift> {
 
             PlatformCompanyLiftRelevance platformCompanyLiftRelevance = platformCompanyLiftRelevanceList.stream().filter(pclr -> (
                     pclr.getLiftId() == lift.getId()
-                    )).distinct().limit(1).findFirst().get();
-            if(null == platformCompanyLiftRelevance){
+            )).distinct().limit(1).findFirst().get();
+            if (null == platformCompanyLiftRelevance) {
                 //如果不存在就新建
                 platformCompanyLiftRelevance = new PlatformCompanyLiftRelevance();
                 Long relevanceId = IdWorker.getId();
@@ -313,7 +316,7 @@ public class LiftService extends ServiceImpl<LiftMapper,Lift> {
                 platformCompanyLiftRelevance.setMtCompanyId(mtCompanyId);
                 platformCompanyLiftRelevance.setLiftId(lift.getId());
                 platformCompanyLiftRelevance.setLiftCompanyStatus(CommonEnum.LiftStatus.NORMAL.getCode());
-                log.info("新建PlatformCompanyLiftRelevance:{}",platformCompanyLiftRelevance);
+                log.info("新建PlatformCompanyLiftRelevance:{}", platformCompanyLiftRelevance);
                 //加入到新建list中批量插入
                 platformCompanyLiftRelevances.add(platformCompanyLiftRelevance);
             }
@@ -322,39 +325,39 @@ public class LiftService extends ServiceImpl<LiftMapper,Lift> {
             ProjectLiftRelevance projectLiftRelevance = projectLiftRelevanceList.stream().filter(plr -> (
                     plr.getLiftId() == lift.getId()
             )).distinct().limit(1).findFirst().get();
-            if(null == projectLiftRelevance){
+            if (null == projectLiftRelevance) {
                 projectLiftRelevance = new ProjectLiftRelevance();
                 projectLiftRelevance.setMtCompanyId(mtCompanyId);
                 projectLiftRelevance.setLiftId(lift.getId());
                 projectLiftRelevance.setProjectId(projectId);
                 projectLiftRelevance.setRelevanceId(platformCompanyLiftRelevance.getId());
-                log.info("新建ProjectLiftRelevance:{}",projectLiftRelevance);
+                log.info("新建ProjectLiftRelevance:{}", projectLiftRelevance);
                 projectLiftRelevances.add(projectLiftRelevance);
             }
         }
 
         //批量插入platform-company-lift关联数据
-        if(!platformCompanyLiftRelevances.isEmpty()){
+        if (!platformCompanyLiftRelevances.isEmpty()) {
             boolean plat = platformService.saveOrUpdateBatch(platformCompanyLiftRelevances);
-            if(!plat){
+            if (!plat) {
                 //强制手动事务回滚
                 TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
                 return RestResponse.fail();
             }
         }
         //批量插入project-lift关联数据
-        if(!projectLiftRelevances.isEmpty()){
+        if (!projectLiftRelevances.isEmpty()) {
             boolean proj = projectRelevanceService.saveOrUpdateBatch(projectLiftRelevances);
-            if(!proj){
+            if (!proj) {
                 //强制手动事务回滚
                 TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
                 return RestResponse.fail();
             }
         }
         //批量插入lift数据
-        if(!lifts.isEmpty()){
+        if (!lifts.isEmpty()) {
             boolean lift = saveOrUpdateBatch(lifts);
-            if(!lift){
+            if (!lift) {
                 //强制手动事务回滚
                 TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
                 return RestResponse.fail();

+ 12 - 11
lift-business-service/src/main/java/cn/com/ty/lift/business/project/controller/ProjectImportController.java

@@ -1,7 +1,9 @@
 package cn.com.ty.lift.business.project.controller;
 
+import cn.com.ty.lift.business.common.Judge;
 import cn.com.ty.lift.business.common.Multipart;
 import cn.com.ty.lift.business.project.dao.entity.model.ProjectImportModel;
+import cn.com.ty.lift.business.project.dao.entity.model.request.ProjectImportRequest;
 import cn.com.ty.lift.business.project.service.ProjectService;
 import cn.com.xwy.boot.web.dto.RestResponse;
 import cn.hutool.core.util.ObjectUtil;
@@ -11,6 +13,7 @@ import cn.hutool.poi.excel.ExcelUtil;
 import lombok.AllArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
 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.multipart.MultipartFile;
@@ -33,30 +36,28 @@ public class ProjectImportController {
 
     /**
      * excel导入项目记录
-     * @param file
+     * @param request
      * @return
      */
     @PostMapping("import")
-    public RestResponse importData(MultipartFile file, Long mtCompanyId) throws Exception {
-        if(null == file || null == mtCompanyId || mtCompanyId <= 0){
-            return RestResponse.failParam();
-        }
+    public RestResponse importData(@RequestBody ProjectImportRequest request) throws Exception {
+        MultipartFile file = request.getFile();
+        Long mtCompanyId = request.getMtCompanyId();
+        Judge.notNull(file,"没有解析到文件数据");
+        Judge.id(mtCompanyId);
         // 1 检查文件有效性
         // 获取文件名,带后缀
         String originalFilename = file.getOriginalFilename();
         // 获取文件的后缀格式
         String fileSuffix = originalFilename.substring(originalFilename.lastIndexOf(".") + 1).toLowerCase();
-        if(!StrUtil.equalsAny(fileSuffix,"xls","xlsx")){
-            return RestResponse.fail("文件格式不支持,暂时只支持xls,xlsx");
-        }
+
+        Judge.notTrue(!StrUtil.equalsAny(fileSuffix,"xls","xlsx"),"文件格式不支持,暂时只支持xls,xlsx");
         // 2 解析文件,转换成bean
         File excel = Multipart.multipartFileToFile(file);
 
         ExcelReader reader = ExcelUtil.getReader(excel);
         List<ProjectImportModel> projectImportModels = reader.read(0,2,reader.getRowCount(),ProjectImportModel.class);
-        if(null == projectImportModels || projectImportModels.size() < 2){
-            return RestResponse.fail("未解析到有效数据");
-        }
+        Judge.notTrue(null == projectImportModels || projectImportModels.size() < 2,"未解析到有效数据");
         // 3 循环遍历,插入数据
         return projectService.assemble(projectImportModels,mtCompanyId);
     }

+ 17 - 0
lift-business-service/src/main/java/cn/com/ty/lift/business/project/dao/entity/model/request/ProjectImportRequest.java

@@ -0,0 +1,17 @@
+package cn.com.ty.lift.business.project.dao.entity.model.request;
+
+import lombok.Data;
+import org.springframework.web.multipart.MultipartFile;
+
+/**
+ * @author wcz
+ * @Description: 项目导入
+ * @date 2020/1/11 10:55
+ */
+@Data
+public class ProjectImportRequest {
+
+    private MultipartFile file;
+
+    private Long mtCompanyId;
+}

+ 4 - 4
lift-business-service/src/main/resources/application-dev.yml

@@ -1,16 +1,16 @@
 spring:
   datasource:
-    url: jdbc:mysql://132.232.206.88:3306/rdsliftmanager?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
+    url: jdbc:mysql://192.168.1.46:3306/rdsliftmanager?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
     username: root
-    password: ms.c88pocY/
+    password: Tyty-2020
     driver-class-name: com.mysql.cj.jdbc.Driver
 
   #redis缓存配置
   redis:
     database: 0 #数据库索引,默认为0
-    host: 132.232.206.88 #服务器地址
+    host: 192.168.1.46 #服务器地址
     port: 6379 #端口
-    password: mdx12358 #验证密码
+    password: newtyty #验证密码
     jedis:
       pool:
         max-active: 8 #最大连接数

+ 19 - 0
lift-business-service/src/main/resources/application-local.yml

@@ -0,0 +1,19 @@
+spring:
+  datasource:
+    url: jdbc:mysql://132.232.206.88:3306/rdsliftmanager?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
+    username: root
+    password: ms.c88pocY/
+    driver-class-name: com.mysql.cj.jdbc.Driver
+
+  #redis缓存配置
+  redis:
+    database: 0 #数据库索引,默认为0
+    host: 132.232.206.88 #服务器地址
+    port: 6379 #端口
+    password: mdx12358 #验证密码
+    jedis:
+      pool:
+        max-active: 8 #最大连接数
+        max-idle: 8 #最大空闲链接
+        max-wait: 20000ms
+        min-idle: 0

+ 1 - 1
lift-business-service/src/main/resources/application.yml

@@ -5,7 +5,7 @@ spring:
   application:
     name: lift-business-service
   profiles:
-    active: test
+    active: dev
 
 mybatis-plus:
   mapper-locations: classpath*:/mapper/**/**Mapper.xml

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

@@ -36,7 +36,7 @@
 		<result column="wl_fault_handle" property="wlFaultHandle" jdbcType="VARCHAR" />
 		<result column="wl_run_direction" property="wlRunDirection" jdbcType="TINYINT" />
 		<result column="cost_total" property="costTotal" jdbcType="DECIMAL" />
-		<result column="project_id" property="projectId" jdbcType="INTEGER" />
+		<result column="project_id" property="projectId" jdbcType="BIGINT" />
 		<result column="caller_fault_description" property="callerFaultDescription" jdbcType="LONGVARCHAR" />
 		<result column="sparepart" property="sparepart" jdbcType="LONGVARCHAR" />
 		<result column="worker_fault_description" property="workerFaultDescription" jdbcType="LONGVARCHAR" />
@@ -51,6 +51,8 @@
         <result column="project_code" property="projectCode" jdbcType="VARCHAR" />
         <result column="area_name" property="areaName" jdbcType="VARCHAR" />
 		<result column="registration_code" property="registrationCode" jdbcType="VARCHAR" />
+		<result column="lift_category" property="liftCategory" jdbcType="INTEGER" />
+        <result column="lift_code" property="liftCode" jdbcType="VARCHAR" />
 		<result column="device_position" property="devicePosition" jdbcType="VARCHAR" />
 		<result column="create_name" property="createName" jdbcType="VARCHAR" />
 		<result column="worker_name" property="workerName" jdbcType="VARCHAR" />
@@ -68,6 +70,8 @@
 				er.*,
 				ui.`name` AS create_name,
 				li.registration_code,
+                li.lift_type AS lift_category,
+                li.lift_code,
 				li.device_position,
 				pr.project_name,
 				pclr.lift_company_status
@@ -111,6 +115,8 @@
             er.*,
 			li.registration_code AS registration_code,
 			li.device_position AS device_position,
+            li.lift_type AS lift_category,
+            li.lift_code,
             pr.project_name,
             re.area_name,
 			ui.name AS worker_name,
@@ -158,6 +164,8 @@
             er.*,
             li.registration_code AS registration_code,
 			li.device_position AS device_position,
+            li.lift_type AS lift_category,
+            li.lift_code,
             pr.project_name,
             pr.project_code,
             re.area_name,
@@ -176,23 +184,26 @@
         SELECT
             er.*,
             pr.project_name,
+            li.lift_type AS lift_category,
+            li.lift_code,
             re.area_name
         FROM
 	        project_user pu
-	LEFT JOIN project pr ON pu.project_id = pr.id
-	LEFT JOIN emergency_repair er ON er.project_id = pr.id
-	LEFT JOIN region re ON re.id = pr.region_id
-	<where>
-        <if test="cond.mtCompanyId != null and cond.mtCompanyId > 0">
-            AND er.mt_company_id = #{cond.mtCompanyId}
-        </if>
-        <if test="cond.userId != null and cond.userId > 0">
-            AND pu.user_id = #{cond.userId}
-        </if>
-		<if test="cond.status != null">
-			AND er.status = #{cond.status}
-		</if>
-    </where>
+        LEFT JOIN project pr ON pu.project_id = pr.id
+        LEFT JOIN emergency_repair er ON er.project_id = pr.id
+        LEFT JOIN lift li ON er.lift_id = li.id
+        LEFT JOIN region re ON re.id = pr.region_id
+        <where>
+            <if test="cond.mtCompanyId != null and cond.mtCompanyId > 0">
+                AND er.mt_company_id = #{cond.mtCompanyId}
+            </if>
+            <if test="cond.userId != null and cond.userId > 0">
+                AND pu.user_id = #{cond.userId}
+            </if>
+            <if test="cond.status != null">
+                AND er.status = #{cond.status}
+            </if>
+        </where>
 
 	</select>
 </mapper>

+ 3 - 3
lift-enterprise-service/src/main/resources/application-dev.yml

@@ -1,6 +1,6 @@
 spring:
   datasource:
-    url: jdbc:mysql://132.232.206.88:3306/rdsliftmanager?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
+    url: jdbc:mysql://192.168.1.46:3306/rdsliftmanager?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
     username: root
-    password: ms.c88pocY/
-    driver-class-name: com.mysql.cj.jdbc.Driver
+    password: Tyty-2020
+    driver-class-name: com.mysql.cj.jdbc.Driver

+ 6 - 0
lift-enterprise-service/src/main/resources/application-local.yml

@@ -0,0 +1,6 @@
+spring:
+  datasource:
+    url: jdbc:mysql://132.232.206.88:3306/rdsliftmanager?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
+    username: root
+    password: ms.c88pocY/
+    driver-class-name: com.mysql.cj.jdbc.Driver

+ 0 - 6
lift-enterprise-service/src/main/resources/application-test.yml

@@ -1,6 +0,0 @@
-spring:
-  datasource:
-    url: jdbc:mysql://192.168.1.46:3306/rdsliftmanager?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
-    username: root
-    password: Tyty-2020
-    driver-class-name: com.mysql.cj.jdbc.Driver

+ 1 - 0
lift-business-service/src/main/resources/application-test.yml

@@ -5,6 +5,7 @@ spring:
     password: Tyty-2020
     driver-class-name: com.mysql.cj.jdbc.Driver
 
+
   #redis缓存配置
   redis:
     database: 0 #数据库索引,默认为0

+ 20 - 0
lift-system-service/src/main/resources/application-local.yml

@@ -0,0 +1,20 @@
+spring:
+  datasource:
+    url: jdbc:mysql://132.232.206.88:3306/rdsliftmanager?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
+    username: root
+    password: ms.c88pocY/
+    driver-class-name: com.mysql.cj.jdbc.Driver
+
+
+  #redis缓存配置
+  redis:
+    database: 0 #数据库索引,默认为0
+    host: 132.232.206.88 #服务器地址
+    port: 6379 #端口
+    password: mdx12358 #验证密码
+    jedis:
+      pool:
+        max-active: 8 #最大连接数
+        max-idle: 8 #最大空闲链接
+        max-wait: 20000ms
+        min-idle: 0

+ 0 - 18
lift-system-service/src/main/resources/application.yml

@@ -14,24 +14,6 @@ spring:
     name: lift-system-service
   profiles:
     active: dev
-  datasource:
-    url: jdbc:mysql://192.168.1.46/rdsliftmanager?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
-    username: root
-    password: Tyty-2020
-
-
-  #redis缓存配置
-  redis:
-    database: 0 #数据库索引,默认为0
-    host: 192.168.1.46    #服务器地址
-    port: 6379 #端口
-    password: newtyty    #验证密码
-    jedis:
-      pool:
-        max-active: 8 #最大连接数
-        max-idle: 8 #最大空闲链接
-        max-wait: 20000ms
-        min-idle: 0
 
 #自动添加createTime、isDelete 等字段
 xwy: