|
@@ -2,13 +2,13 @@ package cn.com.ty.lift.business.library.service;
|
|
|
|
|
|
import cn.com.ty.lift.business.framework.util.MessageUtils;
|
|
|
import cn.com.ty.lift.business.library.dao.entity.PlatformCompanyLiftRelevance;
|
|
|
+import cn.com.ty.lift.business.library.dao.entity.model.request.PlatformCompanyBatchRequest;
|
|
|
import cn.com.ty.lift.business.library.dao.entity.model.request.SelectBatchPlatformCompanyRequest;
|
|
|
import cn.com.ty.lift.business.library.dao.entity.model.request.PlatformCompanyRequest;
|
|
|
import cn.com.ty.lift.business.library.dao.mapper.PlatformCompanyLiftRelevanceMapper;
|
|
|
import cn.com.ty.lift.business.maintenance.service.MaintenancePlanService;
|
|
|
import cn.com.ty.lift.business.project.dao.entity.Project;
|
|
|
import cn.com.ty.lift.business.project.dao.mapper.ProjectMapper;
|
|
|
-import cn.com.ty.lift.common.constants.ApiConstants;
|
|
|
import cn.com.ty.lift.common.constants.CommonEnum;
|
|
|
import cn.com.xwy.boot.web.dto.RestResponse;
|
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
@@ -43,7 +43,7 @@ public class PlatformCompanyLiftRelevanceService extends ServiceImpl<PlatformCom
|
|
|
private MaintenancePlanService maintenancePlanService;
|
|
|
|
|
|
/**
|
|
|
- * @param id 电梯id
|
|
|
+ * @param id 电梯id
|
|
|
* @param mtCompanyId 公司id
|
|
|
* @return PlatformCompanyLiftRelevance
|
|
|
* @description 新增平台电梯、企业电梯关联表数据
|
|
@@ -66,7 +66,7 @@ public class PlatformCompanyLiftRelevanceService extends ServiceImpl<PlatformCom
|
|
|
* @description 查询该公司下是否有此电梯
|
|
|
* @date 2019/12/20 11:39 AM
|
|
|
*/
|
|
|
- public boolean findCompanyLiftExist(Map<String,Object> paramMap) {
|
|
|
+ public boolean findCompanyLiftExist(Map<String, Object> paramMap) {
|
|
|
return mapper.findCompanyLiftExist(paramMap) > 0;
|
|
|
}
|
|
|
|
|
@@ -136,7 +136,7 @@ public class PlatformCompanyLiftRelevanceService extends ServiceImpl<PlatformCom
|
|
|
default:
|
|
|
break;
|
|
|
}
|
|
|
- return RestResponse.success(null, ApiConstants.RESULT_SUCCESS, MessageUtils.get("msg.add.success"));
|
|
|
+ return RestResponse.success(null, MessageUtils.get("msg.add.success"));
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -144,13 +144,13 @@ public class PlatformCompanyLiftRelevanceService extends ServiceImpl<PlatformCom
|
|
|
* @param request companyId 公司id
|
|
|
* @param request liftId 电梯id
|
|
|
* @return 1.成功, 0.失败, 消息描述
|
|
|
- * @description 更新电梯状态为停保,并清除维保计划
|
|
|
+ * @description 更新电梯状态为停保, 并清除维保计划
|
|
|
* @date 2019/12/5 5:24 PM
|
|
|
*/
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
public RestResponse stopInsurance(PlatformCompanyRequest request) {
|
|
|
PlatformCompanyLiftRelevance entry = new PlatformCompanyLiftRelevance();
|
|
|
- entry.setId(request.getPlatformCompanyId());
|
|
|
+ entry.setId(request.getRelevanceId());
|
|
|
entry.setLiftCompanyStatus(CommonEnum.LiftStatus.STOP_INSURANCE.getCode());
|
|
|
boolean result = updateById(entry);
|
|
|
if (!result) {
|
|
@@ -161,7 +161,7 @@ public class PlatformCompanyLiftRelevanceService extends ServiceImpl<PlatformCom
|
|
|
if (!ret) {
|
|
|
return RestResponse.fail(MessageUtils.get("msg.modify.batch.fail"));
|
|
|
}
|
|
|
- return RestResponse.success(null, ApiConstants.RESULT_SUCCESS, MessageUtils.get("msg.modify.batch.success"));
|
|
|
+ return RestResponse.success(null, MessageUtils.get("msg.modify.batch.success"));
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -169,11 +169,11 @@ public class PlatformCompanyLiftRelevanceService extends ServiceImpl<PlatformCom
|
|
|
* @param request companyId 公司id
|
|
|
* @param request idList 电梯id列表
|
|
|
* @return 1.成功, 0.失败, 消息描述
|
|
|
- * @description 批量更新电梯状态为停保,并清除维保计划
|
|
|
+ * @description 批量更新电梯状态为停保, 并清除维保计划
|
|
|
* @date 2019/12/31 9:54 AM
|
|
|
*/
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
- public RestResponse batchStopInsurance(PlatformCompanyRequest request){
|
|
|
+ public RestResponse batchStopInsurance(PlatformCompanyBatchRequest request) {
|
|
|
//公司电梯关联表主键id列表
|
|
|
List<Long> companyIdList = request.getPlatformCompanyIdList();
|
|
|
//批量查询公司下电梯数据
|
|
@@ -188,17 +188,17 @@ public class PlatformCompanyLiftRelevanceService extends ServiceImpl<PlatformCom
|
|
|
return RestResponse.fail(MessageUtils.get("msg.modify.batch.fail"));
|
|
|
}
|
|
|
//批量清除维保计划
|
|
|
- boolean ret = maintenancePlanService.removeMaintenancePlan(request.getCompanyId(),request.getIdList());
|
|
|
+ boolean ret = maintenancePlanService.removeMaintenancePlan(request.getMtCompanyId(), request.getIdList());
|
|
|
if (!ret) {
|
|
|
return RestResponse.fail(MessageUtils.get("msg.modify.batch.fail"));
|
|
|
}
|
|
|
- return RestResponse.success(null, ApiConstants.RESULT_SUCCESS, MessageUtils.get("msg.modify.batch.success"));
|
|
|
+ return RestResponse.success(null, MessageUtils.get("msg.modify.batch.success"));
|
|
|
}
|
|
|
|
|
|
- public List<PlatformCompanyLiftRelevance> listByCompany(Long companyId){
|
|
|
+ public List<PlatformCompanyLiftRelevance> listByCompany(Long companyId) {
|
|
|
QueryWrapper<PlatformCompanyLiftRelevance> queryWrapper = new QueryWrapper<>();
|
|
|
LambdaQueryWrapper<PlatformCompanyLiftRelevance> lambdaQueryWrapper = queryWrapper.lambda();
|
|
|
- lambdaQueryWrapper.eq(PlatformCompanyLiftRelevance::getMtCompanyId,companyId);
|
|
|
+ lambdaQueryWrapper.eq(PlatformCompanyLiftRelevance::getMtCompanyId, companyId);
|
|
|
return list(lambdaQueryWrapper);
|
|
|
}
|
|
|
}
|