Browse Source

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

wucizhong 5 years ago
parent
commit
291bbb9eeb
15 changed files with 162 additions and 175 deletions
  1. 22 33
      lift-business-service/src/main/java/cn/com/ty/lift/business/annualinspection/controller/AnnualInspectionController.java
  2. 55 58
      lift-business-service/src/main/java/cn/com/ty/lift/business/emergency/controller/EmergencyRepairController.java
  3. 15 3
      lift-business-service/src/main/java/cn/com/ty/lift/business/emergency/dto/RepairRequest.java
  4. 0 5
      lift-business-service/src/main/java/cn/com/ty/lift/business/emergency/dto/RepairResponse.java
  5. 21 1
      lift-business-service/src/main/java/cn/com/ty/lift/business/emergency/entity/EmergencyRepair.java
  6. 4 4
      lift-business-service/src/main/java/cn/com/ty/lift/business/emergency/entity/ErCostItem.java
  7. 12 18
      lift-business-service/src/main/java/cn/com/ty/lift/business/emergency/service/EmergencyRepairService.java
  8. 5 0
      lift-business-service/src/main/java/cn/com/ty/lift/business/evaluation/dao/entity/model/EvaluationRequest.java
  9. 1 0
      lift-business-service/src/main/java/cn/com/ty/lift/business/evaluation/service/EvaluationService.java
  10. 1 1
      lift-business-service/src/main/java/cn/com/ty/lift/business/library/dao/entity/LiftHistory.java
  11. 7 4
      lift-business-service/src/main/resources/mapper/emergency/EmergencyRepairMapper.xml
  12. 7 2
      lift-common/src/main/java/cn.com.ty.lift.common/utils/AliyunOSSUtil.java
  13. 3 13
      lift-enterprise-service/src/main/java/cn/com/ty/lift/enterprise/oa/controller/AnnouncementController.java
  14. 5 17
      lift-enterprise-service/src/main/java/cn/com/ty/lift/enterprise/oa/controller/AttendanceController.java
  15. 4 16
      lift-enterprise-service/src/main/java/cn/com/ty/lift/enterprise/oa/controller/LiftCertificateController.java

+ 22 - 33
lift-business-service/src/main/java/cn/com/ty/lift/business/annualinspection/controller/AnnualInspectionController.java

@@ -54,16 +54,12 @@ public class AnnualInspectionController {
     @PostMapping("findOne")
     public RestResponse findOne(@RequestBody InspectionRequest request){
         Long id = request.getId();
-
         if(null == id || id <= 0){
             return RestResponse.failParam();
         }
 
         InspectionResponse entity = annualInspectionService.selectByIdWithInfo(request);
-        if(null == entity){
-            return RestResponse.fail();
-        }
-        return RestResponse.success(entity);
+        return ObjectUtil.isNull(entity) ? RestResponse.fail() : RestResponse.success(entity);
     }
 
     /**
@@ -91,6 +87,20 @@ public class AnnualInspectionController {
         return RestResponse.success(countPage);
     }
 
+    /**
+     * @description 根据条件查询年检记录
+     * @date 2019/12/11 17:15
+     * @param
+     * @return
+     */
+    @PostMapping("pageWorker")
+    public RestResponse pageWorker(@RequestBody InspectionRequest request){
+        if(request.getWorkerId() == null || request.getWorkerId() <= 0){
+            return RestResponse.failParam();
+        }
+        IPage<InspectionResponse> pages = annualInspectionService.pageByCondition(request);
+        return null != pages ? RestResponse.success(pages) : RestResponse.fail();
+    }
     /**
      * @description 修改年检信息
      *
@@ -260,10 +270,7 @@ public class AnnualInspectionController {
         entity.setStepName(stepName);
 
         boolean result = annualInspectionService.finish(entity);
-        if(result){
-            return RestResponse.success(result);
-        }
-        return RestResponse.fail();
+        return result ? RestResponse.success(result) : RestResponse.fail();
     }
 
     @GetMapping("show")
@@ -275,10 +282,7 @@ public class AnnualInspectionController {
         log.info("fileurl: " + fileurl);
         File file = new File("download/" + filename);
         File down = aliyunOSSUtil.getFile(systemConfiguration.bucketName,filename,file);
-        if(null == down){
-            return null;
-        }
-        return ImageIO.read(new FileInputStream(file));
+        return null == down ? null : ImageIO.read(new FileInputStream(file));
     }
     /**
      * 其他角色获取自己关联的项目的年检任务
@@ -288,10 +292,7 @@ public class AnnualInspectionController {
     @PostMapping("pageByUser")
     public RestResponse pageByUser(@RequestBody InspectionRequest request){
         IPage<InspectionResponse> pages = annualInspectionService.pageByUser(request);
-        if(null == pages){
-            return RestResponse.fail();
-        }
-        return RestResponse.success(pages);
+        return null == pages ? RestResponse.fail() : RestResponse.success(pages);
     }
 
     /**
@@ -312,10 +313,7 @@ public class AnnualInspectionController {
         entity.setStepStatus(Values.AI_STATUS_COMFIRM);
         entity.setStepName(Values.AI_STEP_ONE);
         boolean result = annualInspectionService.updateById(entity);
-        if(result){
-            return RestResponse.success(result);
-        }
-        return RestResponse.fail();
+        return result ? RestResponse.success(result) : RestResponse.fail();
     }
 
     /**
@@ -342,10 +340,7 @@ public class AnnualInspectionController {
         entity.setStepStatus(Values.AI_STATUS_SELFCHECK);
         entity.setStepName(Values.AI_STEP_ONE);
         boolean result = annualInspectionService.updateById(entity);
-        if(result){
-            return RestResponse.success(result);
-        }
-        return RestResponse.fail();
+        return result ? RestResponse.success(result) : RestResponse.fail();
     }
 
     /**
@@ -373,10 +368,7 @@ public class AnnualInspectionController {
         entity.setStepStatus(Values.AI_STATUS_CHECK_UPLOAD);
         entity.setStepName(Values.AI_STEP_THREE);
         boolean result = annualInspectionService.updateById(entity);
-        if(result){
-            return RestResponse.success(result);
-        }
-        return RestResponse.fail();
+        return result ? RestResponse.success(result) : RestResponse.fail();
     }
 
     /**
@@ -407,9 +399,6 @@ public class AnnualInspectionController {
         entity.setStepStatus(Values.AI_STATUS_CERTIFICATE_REPORT_UPLOAD);
         entity.setStepName(Values.AI_STEP_FOUR);
         boolean result = annualInspectionService.updateById(entity);
-        if(result){
-            return RestResponse.success(result);
-        }
-        return RestResponse.fail();
+        return result ? RestResponse.success(result) : RestResponse.fail();
     }
 }

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

@@ -28,6 +28,7 @@ import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
+import java.math.BigDecimal;
 import java.time.LocalDateTime;
 import java.util.ArrayList;
 import java.util.Arrays;
@@ -124,10 +125,7 @@ public class EmergencyRepairController {
         entity.setAssignTime(LocalDateTime.now());
         entity.setStatus(Values.ER_STATUS_TO_REPAIRED);
         boolean result = emergencyRepairService.save(entity);
-        if(result){
-            return RestResponse.success(result);
-        }
-        return RestResponse.fail();
+        return result ? RestResponse.success(result) : RestResponse.fail();
     }
 
     /**
@@ -164,6 +162,21 @@ public class EmergencyRepairController {
         return RestResponse.success(countPage);
     }
 
+    /**
+     * @description 根据条件分页查询
+     * @date 2019/12/9 9:39
+     * @param
+     * @return
+     */
+    @PostMapping("pageWorker")
+    public RestResponse pageWorker(@RequestBody RepairRequest request){
+        if(request.getWorkerId() == null || request.getWorkerId() <= 0){
+            return RestResponse.failParam();
+        }
+        IPage<RepairResponse> pages = emergencyRepairService.pageByCondition(request);
+        return null != pages ? RestResponse.success(pages) : RestResponse.fail();
+    }
+
     /**
      * @description 急修转派
      * @date 2019/12/11 9:25
@@ -181,13 +194,14 @@ public class EmergencyRepairController {
         if(null == entity){
             return RestResponse.failParam();
         }
+        //如果已经接单,在急修中了不能被转派
+        if (entity.getStatus() == Values.ER_STATUS_REPAIRING) {
+            return RestResponse.fail("急修已经接单,不能转派");
+        }
         //本急修单的负责维保工
         entity.setWorkerId1(workerId);
         boolean result = emergencyRepairService.saveOrUpdate(entity);
-        if(result){
-            return RestResponse.success(result);
-        }
-        return RestResponse.fail();
+        return result ? RestResponse.success(result) : RestResponse.fail();
     }
 
     /**
@@ -214,10 +228,7 @@ public class EmergencyRepairController {
         //新状态(-1 暂停中,0 待修理;1 修理中;2 已完成 3 已关闭)
         entity.setStatus(Values.ER_STATUS_CLOSE);
         boolean result = emergencyRepairService.saveOrUpdate(entity);
-        if(result){
-            return RestResponse.success(result);
-        }
-        return RestResponse.fail();
+        return result ? RestResponse.success(result) : RestResponse.fail();
     }
 
     /**
@@ -228,10 +239,7 @@ public class EmergencyRepairController {
     @PostMapping("pageByUser")
     public RestResponse pageByUser(@RequestBody RepairRequest request){
         IPage<RepairResponse> pages = emergencyRepairService.pageByUser(request);
-        if(null == pages){
-            return RestResponse.fail();
-        }
-        return RestResponse.success(pages);
+        return null != pages ? RestResponse.success(pages) : RestResponse.fail();
     }
 
     /**
@@ -252,13 +260,10 @@ public class EmergencyRepairController {
             return RestResponse.failParam();
         }
         entity.setTakingTime(takingTime);
-        //状态改成修理中
+        //状态改成修理中 todo:修改电梯的业务状态为急修中,如果存在维保中,要修改
         entity.setStatus(Values.ER_STATUS_REPAIRING);
-        boolean result = emergencyRepairService.updateById(entity);
-        if(result){
-            return RestResponse.success(result);
-        }
-        return RestResponse.fail();
+        boolean result = emergencyRepairService.taking(entity);
+        return result ? RestResponse.success(result) : RestResponse.fail();
     }
 
     /**
@@ -286,10 +291,7 @@ public class EmergencyRepairController {
         }
         entity.setArriveTime(arriveTime);
         boolean result = emergencyRepairService.updateById(entity);
-        if(result){
-            return RestResponse.success(result);
-        }
-        return RestResponse.fail();
+        return result ? RestResponse.success(result) : RestResponse.fail();
     }
 
     /**
@@ -318,11 +320,8 @@ public class EmergencyRepairController {
         }
         entity.setStopDate(stopDate);
         entity.setSafetyConfirm(safetyConfirm);
-        boolean result = emergencyRepairService.stopLift(entity);
-        if(result){
-            return RestResponse.success(result);
-        }
-        return RestResponse.fail();
+        boolean result = emergencyRepairService.updateById(entity);
+        return result ? RestResponse.success(result) : RestResponse.fail();
     }
 
     /**
@@ -338,14 +337,12 @@ public class EmergencyRepairController {
         if(id == null || null == erCostItems || erCostItems.isEmpty()){
             return RestResponse.failParam();
         }
-        for (ErCostItem item: erCostItems){
-            item.setErRecordId(id);
-        }
+        BigDecimal costTotal = new BigDecimal(0);
+        erCostItems.forEach(item -> {
+            costTotal.add(item.getCostMoney());
+        });
         boolean result = erCostItemService.saveBatch(erCostItems);
-        if(result){
-            return RestResponse.success(result);
-        }
-        return RestResponse.fail();
+        return result ? RestResponse.success(result) : RestResponse.fail();
     }
 
     /**
@@ -360,10 +357,7 @@ public class EmergencyRepairController {
             return RestResponse.failParam();
         }
         boolean result = erCostItemService.removeById(erCostItemId);
-        if(result){
-            return RestResponse.success(result);
-        }
-        return RestResponse.fail();
+        return result ? RestResponse.success(result) : RestResponse.fail();
     }
 
     /**
@@ -378,10 +372,7 @@ public class EmergencyRepairController {
             return RestResponse.failParam();
         }
         boolean result = erCostItemService.updateBatchById(erCostItems);
-        if(result){
-            return RestResponse.success(result);
-        }
-        return RestResponse.fail();
+        return result ? RestResponse.success(result) : RestResponse.fail();
     }
 
     /**
@@ -396,8 +387,7 @@ public class EmergencyRepairController {
             return RestResponse.success(liftFaultService.list());
         }
         List<LiftFault> lists = liftFaultService.listByLiftCategory(liftCategory);
-
-        return RestResponse.success(lists);
+        return null != lists ? RestResponse.success(lists) : RestResponse.fail();
     }
 
     /**
@@ -465,26 +455,31 @@ public class EmergencyRepairController {
         if(null == recordId || recordId <= 0){
             return RestResponse.failParam();
         }
+        String customerSign = request.getCustomerSign();
+        if(StrUtil.isEmpty(customerSign)){
+            return RestResponse.fail("请签名");
+        }
         EmergencyRepair repair = emergencyRepairService.getById(recordId);
         if(null == repair){
             return RestResponse.failParam();
         }
         if(repair.getStatus() != Values.ER_STATUS_FINISH){
-            return RestResponse.fail("急修未完成不能评价");
+            return RestResponse.fail("该急修未完成不能评价");
+        }
+        Evaluation old = evaluationService.findByRecord(recordId);
+        if (null != old) {
+            return RestResponse.fail("该急修已经存在评价");
         }
         Evaluation evaluation = new Evaluation();
         //复制属性到评价bean
         BeanUtil.copyProperties(request,evaluation);
         evaluation.setPostDate(LocalDateTime.now());
         boolean result = evaluationService.save(evaluation);
-        if(result){
-            return RestResponse.success(result);
-        }
-        return RestResponse.fail();
+        return result ? RestResponse.success(result) : RestResponse.fail();
     }
 
     /**
-     * 生成急修单
+     * 生成急修单,添加主要,次要急修人签名
      * @param request
      * @return
      */
@@ -498,6 +493,11 @@ public class EmergencyRepairController {
         if(null == recoveryDate){
             return RestResponse.fail("请填写恢复时间");
         }
+        String mainSign = request.getMainSign();
+        String secondSign = request.getSecondSign();
+        if(StrUtil.hasEmpty(mainSign,secondSign)){
+            return RestResponse.fail("请签名");
+        }
         EmergencyRepair entity = emergencyRepairService.getById(id);
         if(null == entity){
             return RestResponse.failParam();
@@ -512,9 +512,6 @@ public class EmergencyRepairController {
         //修改状态已完成
         entity.setStatus(Values.ER_STATUS_FINISH);
         boolean result = emergencyRepairService.updateById(entity);
-        if(result){
-            return RestResponse.success(result);
-        }
-        return RestResponse.fail();
+        return result ? RestResponse.success(result) : RestResponse.fail();
     }
 }

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

@@ -6,7 +6,6 @@ import lombok.Data;
 import lombok.EqualsAndHashCode;
 
 import java.time.LocalDateTime;
-import java.util.Date;
 import java.util.List;
 
 /**
@@ -45,12 +44,12 @@ public class RepairRequest extends BaseRequestModel{
     /**
      * 报修开始时间
      */
-    private Date repairBegin;
+    private LocalDateTime repairBegin;
 
     /**
      * 报修结束时间
      */
-    private Date repairEnd;
+    private LocalDateTime repairEnd;
 
     /**
      * 急修单状态
@@ -144,4 +143,17 @@ public class RepairRequest extends BaseRequestModel{
      */
     private LocalDateTime recoveryDate;
 
+    /**
+     * 主要急修人签名 完成急修单添加
+     */
+    private String mainSign;
+    /**
+     * 次要急修人签名
+     */
+    private String secondSign;
+    /**
+     * 客户签名, 评价中添加
+     */
+    private String customerSign;
+
 }

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

@@ -46,11 +46,6 @@ public class RepairResponse extends EmergencyRepair{
      */
     private String devicePosition;
 
-    /**
-     * 报修人姓名
-     */
-    private String callName;
-
     /**
      * 维修工
      */

+ 21 - 1
lift-business-service/src/main/java/cn/com/ty/lift/business/emergency/entity/EmergencyRepair.java

@@ -71,11 +71,16 @@ public class EmergencyRepair implements Serializable {
     private Integer source;
 
     /**
-     * 报修人ID
+     * 报修人ID ,2.0 报修人是指派人
      */
     @TableField("caller_id")
     private Long callerId;
 
+    /**
+     * 报修人名
+     */
+    @TableField("caller_name")
+    private String callerName;
     /**
      * 报修人电话
      */
@@ -287,4 +292,19 @@ public class EmergencyRepair implements Serializable {
      */
     @TableField("fault_duty")
     private String faultDuty;
+    /**
+     * 主要急修人签名 完成急修单添加
+     */
+    @TableField("main_sign")
+    private String mainSign;
+    /**
+     * 次要急修人签名
+     */
+    @TableField("second_sign")
+    private String secondSign;
+    /**
+     * 客户签名, 评价中添加
+     */
+    @TableField("customer_sign")
+    private String customerSign;
 }

+ 4 - 4
lift-business-service/src/main/java/cn/com/ty/lift/business/emergency/entity/ErCostItem.java

@@ -8,7 +8,7 @@ import lombok.experimental.Accessors;
 
 import java.io.Serializable;
 import java.math.BigDecimal;
-import java.time.LocalDateTime;
+import java.time.LocalDate;
 
 /**
  * <p>
@@ -53,7 +53,7 @@ public class ErCostItem implements Serializable {
      * 应收日期
      */
     @TableField("cost_date")
-    private LocalDateTime costDate;
+    private LocalDate costDate;
 
     /**
      * 费用描述
@@ -71,7 +71,7 @@ public class ErCostItem implements Serializable {
      * 实收日期
      */
     @TableField("pay_date")
-    private LocalDateTime payDate;
+    private LocalDate payDate;
 
     /**
      * 开票金额
@@ -83,7 +83,7 @@ public class ErCostItem implements Serializable {
      * 开票日期
      */
     @TableField("invoice_date")
-    private LocalDateTime invoiceDate;
+    private LocalDate invoiceDate;
 
     /**
      * 开票附件

+ 12 - 18
lift-business-service/src/main/java/cn/com/ty/lift/business/emergency/service/EmergencyRepairService.java

@@ -5,7 +5,6 @@ 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.mapper.EmergencyRepairMapper;
-import cn.com.ty.lift.business.evaluation.service.EvaluationService;
 import cn.com.ty.lift.business.library.dao.entity.PlatformCompanyLiftRelevance;
 import cn.com.ty.lift.business.library.service.PlatformCompanyLiftRelevanceService;
 import cn.com.ty.lift.common.constants.CommonEnum;
@@ -33,8 +32,6 @@ public class EmergencyRepairService extends ServiceImpl<EmergencyRepairMapper, E
     @Autowired
     private PlatformCompanyLiftRelevanceService platformCompanyLiftRelevanceService;
 
-    @Autowired
-    private EvaluationService evaluationService;
     /**
      * 分页查询急修中的急修记录
      * @param request
@@ -85,33 +82,30 @@ public class EmergencyRepairService extends ServiceImpl<EmergencyRepairMapper, E
     }
 
     /**
-     * app-停梯时间+安全确认,保存停梯时间+安全确认项到急修表中
-     * 修改电梯的业务状态为急修中
+     * 急修接单,修改急修为修理中,修改电梯的业务状态为急修中
      * @param entity
      * @return
      */
     @Transactional
-    public boolean stopLift(EmergencyRepair entity){
+    public boolean taking(EmergencyRepair entity) {
         boolean er = updateById(entity);
-        if(!er){
-            return false;
-        }
-        //todo:修改电梯的业务状态为急修中
-        PlatformCompanyLiftRelevance relevance = platformCompanyLiftRelevanceService.findByMtCompanyAndLift(entity.getMtCompanyId(),entity.getLiftId());
-        if(null == relevance){
-            return false;
+        boolean re = false;
+        if (er) {
+            PlatformCompanyLiftRelevance relevance = platformCompanyLiftRelevanceService.findByMtCompanyAndLift(entity.getMtCompanyId(), entity.getLiftId());
+            if (null != relevance) {
+                //电梯业务状态改成急修中
+                relevance.setLiftCompanyStatus(CommonEnum.LiftStatus.EMERGENCY_REPAIR.getCode());
+                re = platformCompanyLiftRelevanceService.updateById(relevance);
+            }
         }
-        relevance.setLiftCompanyStatus(CommonEnum.LiftStatus.EMERGENCY_REPAIR.getCode());
-        boolean re = platformCompanyLiftRelevanceService.updateById(relevance);
-        if(re){
+        if (er && re) {
             return true;
-        }else{
+        } else {
             //强制手动事务回滚
             TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
             return false;
         }
     }
-
     /**
      * 根据维保公司和电梯id查找急修
      * @param mtCompany

+ 5 - 0
lift-business-service/src/main/java/cn/com/ty/lift/business/evaluation/dao/entity/model/EvaluationRequest.java

@@ -15,5 +15,10 @@ public class EvaluationRequest extends Evaluation {
      * 维保公司id
      */
     private Long mtCompanyId;
+
+    /**
+     * 客户签名
+     */
+    private String customerSign;
     
 }

+ 1 - 0
lift-business-service/src/main/java/cn/com/ty/lift/business/evaluation/service/EvaluationService.java

@@ -34,6 +34,7 @@ public class EvaluationService extends ServiceImpl<EvaluationMapper, Evaluation>
         QueryWrapper<Evaluation> queryWrapper = new QueryWrapper<>();
         LambdaQueryWrapper<Evaluation> lambdaQueryWrapper = queryWrapper.lambda();
         lambdaQueryWrapper.eq(Evaluation::getRecordId,recordId);
+        lambdaQueryWrapper.last("LIMIT 1");
         return getOne(lambdaQueryWrapper);
     }
 }

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

@@ -76,7 +76,7 @@ public class LiftHistory implements Serializable {
      * 自增ID
      */
     @TableId("pid")
-    private Integer pid;
+    private Long pid;
 
 
 }

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

@@ -9,6 +9,7 @@
 		<result column="is_critical" property="isCritical" jdbcType="TINYINT" />
 		<result column="source" property="source" jdbcType="TINYINT" />
 		<result column="caller_id" property="callerId" jdbcType="BIGINT" />
+		<result column="caller_name" property="callerName" jdbcType="VARCHAR" />
 		<result column="caller_tel" property="callerTel" jdbcType="CHAR" />
 		<result column="caller_date" property="callerDate" jdbcType="TIMESTAMP" />
 		<result column="stop_date" property="stopDate" jdbcType="TIMESTAMP" />
@@ -42,13 +43,15 @@
 		<result column="field_description" property="fieldDescription" jdbcType="LONGVARCHAR" />
 		<result column="repair_procedure" property="repairProcedure" jdbcType="LONGVARCHAR" />
 		<result column="close_reason" property="closeReason" jdbcType="VARCHAR" />
+		<result column="main_sign" property="mainSign" jdbcType="VARCHAR" />
+		<result column="second_sign" property="secondSign" jdbcType="VARCHAR" />
+		<result column="customer_sign" property="customerSign" jdbcType="VARCHAR" />
 
 		<result column="project_name" property="projectName" jdbcType="VARCHAR" />
         <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="device_position" property="devicePosition" jdbcType="VARCHAR" />
-		<result column="call_name" property="callName" jdbcType="VARCHAR" />
 		<result column="create_name" property="createName" jdbcType="VARCHAR" />
 		<result column="worker_name" property="workerName" jdbcType="VARCHAR" />
 		<result column="lift_company_status" property="liftCompanyStatus" jdbcType="VARCHAR" />
@@ -70,12 +73,12 @@
 				pclr.lift_company_status
 			FROM
 				emergency_repair er
-				LEFT JOIN user_info ui ON ui.user_id = er.caller_id
+				LEFT JOIN user_info ui ON ui.user_id = er.creator_id
 				LEFT JOIN lift li ON li.id = er.lift_id
 				LEFT JOIN project pr ON pr.id = er.project_id
-				LEFT JOIN platform_company_lift_relevance pclr ON pclr.lift_id = li.id
+				LEFT JOIN platform_company_lift_relevance pclr ON pclr.lift_id = er.lift_id AND pclr.mt_company_id = er.mt_company_id
 			WHERE
-			  er.`status` = 2
+			  er.`status` IN (0,1)
 			<if test="cond.mtCompanyId != null and cond.mtCompanyId > 0">
 				AND er.mt_company_id = #{cond.mtCompanyId}
 			</if>

+ 7 - 2
lift-common/src/main/java/cn.com.ty.lift.common/utils/AliyunOSSUtil.java

@@ -100,6 +100,7 @@ public class AliyunOSSUtil {
             return false;
         }
         try {
+            init();
             ossClient.createBucket(bucketName);
             return true;
         }catch (Exception e){
@@ -120,6 +121,7 @@ public class AliyunOSSUtil {
 
     public boolean putObject(String bucketName,byte[] content,String objectName) {
         try {
+            init();
             // 上传内容到指定的存储空间(bucketName)并保存为指定的文件名称(objectName)。
             ossClient.putObject(bucketName, objectName, new ByteArrayInputStream(content));
             return true;
@@ -164,7 +166,7 @@ public class AliyunOSSUtil {
             content.close();
         }
         // 关闭OSSClient。
-        ossClient.shutdown();
+        destroy();
     }
 
     /**
@@ -185,7 +187,7 @@ public class AliyunOSSUtil {
         }
 
         // 关闭OSSClient。
-        ossClient.shutdown();
+        destroy();
     }
 
     /**
@@ -197,6 +199,7 @@ public class AliyunOSSUtil {
     public boolean deleteObject(String bucketName,String objectName){
         // <yourObjectName>表示删除OSS文件时需要指定包含文件后缀在内的完整路径,例如abc/efg/123.jpg。
         try {
+            init();
             // 删除文件。
             ossClient.deleteObject(bucketName, objectName);
             return true;
@@ -216,6 +219,7 @@ public class AliyunOSSUtil {
 
     public boolean putFile(String bucketName,String objectName,File file){
         try {
+            init();
             // 创建PutObjectRequest对象。
             PutObjectRequest putObjectRequest = new PutObjectRequest(bucketName, objectName, file);
             // 如果需要上传时设置存储类型与访问权限,请参考以下示例代码。
@@ -245,6 +249,7 @@ public class AliyunOSSUtil {
 
     public File getFile(String bucketName,String objectName,File file){
         try {
+            init();
             // 下载OSS文件到本地文件。如果指定的本地文件存在会覆盖,不存在则新建。
             ossClient.getObject(new GetObjectRequest(bucketName, objectName), file);
             return file;

+ 3 - 13
lift-enterprise-service/src/main/java/cn/com/ty/lift/enterprise/oa/controller/AnnouncementController.java

@@ -9,7 +9,6 @@ import cn.com.xwy.boot.web.dto.RestResponse;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import lombok.AllArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
@@ -46,10 +45,7 @@ public class AnnouncementController {
             return RestResponse.failParam();
         }
         Announcement entity = announcementService.getById(id);
-        if(null == entity){
-            return RestResponse.fail();
-        }
-        return RestResponse.success(entity);
+        return null != entity ? RestResponse.success(entity) : RestResponse.fail();
     }
 
     /**
@@ -81,10 +77,7 @@ public class AnnouncementController {
             return RestResponse.failParam();
         }
         boolean result = announcementService.save(entity);
-        if(result){
-            return RestResponse.success(result);
-        }
-        return RestResponse.fail();
+        return result ? RestResponse.success(result) : RestResponse.fail();
     }
 
     /**
@@ -100,10 +93,7 @@ public class AnnouncementController {
             return RestResponse.failParam();
         }
         boolean result = announcementService.removeById(id);
-        if(result){
-            return RestResponse.success(result);
-        }
-        return RestResponse.fail();
+        return result ? RestResponse.success(result) : RestResponse.fail();
 
     }
 }

+ 5 - 17
lift-enterprise-service/src/main/java/cn/com/ty/lift/enterprise/oa/controller/AttendanceController.java

@@ -50,10 +50,7 @@ public class AttendanceController {
             return RestResponse.failParam();
         }
         Attendance entity = attendanceService.getById(id);
-        if(null == entity){
-            return RestResponse.fail();
-        }
-        return RestResponse.success(entity);
+        return null != entity ? RestResponse.success(entity) : RestResponse.fail();
     }
 
     /**
@@ -122,10 +119,7 @@ public class AttendanceController {
         entity.setTopTimeOt(topTimeOt);
         entity.setDownTimeOt(downTimeOt);
         boolean result = maintenanceCompanyService.saveOrUpdate(entity);
-        if(result){
-            return RestResponse.success(result);
-        }
-        return RestResponse.fail();
+        return result ? RestResponse.success(result) : RestResponse.fail();
     }
 
     /**
@@ -225,11 +219,8 @@ public class AttendanceController {
         if (null == mtCompanyId || mtCompanyId <= 0) {
             return RestResponse.failParam();
         }
-        MaintenanceCompany maintenanceCompany = maintenanceCompanyService.getById(mtCompanyId);
-        if (null == maintenanceCompany) {
-            return RestResponse.failParam();
-        }
-        return RestResponse.success(maintenanceCompany);
+        MaintenanceCompany entity = maintenanceCompanyService.getById(mtCompanyId);
+        return null != entity ? RestResponse.success(entity) : RestResponse.fail();
     }
 
     /**
@@ -245,9 +236,6 @@ public class AttendanceController {
             return RestResponse.failParam();
         }
         IPage<AttendanceResponse> pages = attendanceService.pageByUser(request);
-        if(null == pages){
-            return RestResponse.fail();
-        }
-        return RestResponse.success(pages);
+        return null != pages ? RestResponse.success(pages) : RestResponse.fail();
     }
 }

+ 4 - 16
lift-enterprise-service/src/main/java/cn/com/ty/lift/enterprise/oa/controller/LiftCertificateController.java

@@ -45,10 +45,7 @@ public class LiftCertificateController {
             return RestResponse.failParam();
         }
         LiftCertificate entity = liftCertificateService.getById(id);
-        if(null == entity){
-            return RestResponse.fail();
-        }
-        return RestResponse.success(entity);
+        return null != entity ? RestResponse.success(entity) : RestResponse.fail();
     }
 
     /**
@@ -86,10 +83,7 @@ public class LiftCertificateController {
             return RestResponse.failParam();
         }
         boolean result = liftCertificateService.updateById(entity);
-        if (result) {
-            return RestResponse.success(result);
-        }
-        return RestResponse.fail();
+        return result ? RestResponse.success(result) : RestResponse.fail();
     }
 
     /**
@@ -112,10 +106,7 @@ public class LiftCertificateController {
         int status = request.isPass() ? 3 : 2;
         liftCertificate.setStatus(status);
         boolean result = liftCertificateService.saveOrUpdate(liftCertificate);
-        if(result){
-            return RestResponse.success(result);
-        }
-        return RestResponse.fail();
+        return result ? RestResponse.success(result) : RestResponse.fail();
     }
 
     /**
@@ -133,10 +124,7 @@ public class LiftCertificateController {
             return RestResponse.fail("请上传操作证图片");
         }
         boolean result = liftCertificateService.save(entity);
-        if(result){
-            return RestResponse.success(result);
-        }
-        return RestResponse.fail();
+        return result ? RestResponse.success(result) : RestResponse.fail();
 
     }
 }