|
@ -1,6 +1,7 @@ |
|
|
package com.epmet.service.impl; |
|
|
package com.epmet.service.impl; |
|
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
|
|
import com.epmet.commons.tools.exception.EpmetErrorCode; |
|
|
import com.epmet.commons.tools.exception.EpmetErrorCode; |
|
|
import com.epmet.commons.tools.exception.EpmetException; |
|
|
import com.epmet.commons.tools.exception.EpmetException; |
|
|
import com.epmet.commons.tools.page.PageData; |
|
|
import com.epmet.commons.tools.page.PageData; |
|
@ -22,6 +23,7 @@ import org.springframework.transaction.annotation.Transactional; |
|
|
|
|
|
|
|
|
import javax.annotation.Resource; |
|
|
import javax.annotation.Resource; |
|
|
import java.util.ArrayList; |
|
|
import java.util.ArrayList; |
|
|
|
|
|
import java.util.Date; |
|
|
import java.util.List; |
|
|
import java.util.List; |
|
|
|
|
|
|
|
|
@Slf4j |
|
|
@Slf4j |
|
@ -73,6 +75,10 @@ public class PropertyManagementServiceImpl implements PropertyManagementService |
|
|
return icPropertyManagementEntity.getId(); |
|
|
return icPropertyManagementEntity.getId(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 物业管理-修改 |
|
|
|
|
|
* @param formDTO |
|
|
|
|
|
*/ |
|
|
@Override |
|
|
@Override |
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
public void update(IcPropertyManagementFormDTO formDTO) { |
|
|
public void update(IcPropertyManagementFormDTO formDTO) { |
|
@ -80,8 +86,14 @@ public class PropertyManagementServiceImpl implements PropertyManagementService |
|
|
if (null != entity) { |
|
|
if (null != entity) { |
|
|
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"物业名称已存在","物业名称已存在"); |
|
|
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"物业名称已存在","物业名称已存在"); |
|
|
} |
|
|
} |
|
|
IcPropertyManagementEntity icPropertyManagementEntity = ConvertUtils.sourceToTarget(formDTO, IcPropertyManagementEntity.class); |
|
|
LambdaUpdateWrapper<IcPropertyManagementEntity> updateWrapper=new LambdaUpdateWrapper<>(); |
|
|
icPropertyManagementDao.updateById(icPropertyManagementEntity); |
|
|
updateWrapper.eq(IcPropertyManagementEntity::getId,formDTO.getId()) |
|
|
|
|
|
.set(IcPropertyManagementEntity::getName,formDTO.getName()) |
|
|
|
|
|
.set(IcPropertyManagementEntity::getContactName,formDTO.getContactName()) |
|
|
|
|
|
.set(IcPropertyManagementEntity::getContactMobile,formDTO.getContactMobile()) |
|
|
|
|
|
.set(IcPropertyManagementEntity::getUpdatedTime,new Date()) |
|
|
|
|
|
.set(IcPropertyManagementEntity::getUpdatedBy,EpmetRequestHolder.getLoginUserId()); |
|
|
|
|
|
icPropertyManagementDao.update(null,updateWrapper); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
@ -99,11 +111,18 @@ public class PropertyManagementServiceImpl implements PropertyManagementService |
|
|
icPropertyManagementDao.deleteById(formDTO.getId()); |
|
|
icPropertyManagementDao.deleteById(formDTO.getId()); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 物业管理-列表查询 |
|
|
|
|
|
* @param pageNo |
|
|
|
|
|
* @param pageSize |
|
|
|
|
|
* @param name |
|
|
|
|
|
* @return |
|
|
|
|
|
*/ |
|
|
@Override |
|
|
@Override |
|
|
public PageData<IcPropertyManagementDTO> page(Integer pageNo, Integer pageSize, String name) { |
|
|
public PageData<IcPropertyManagementDTO> page(Integer pageNo, Integer pageSize, String name) { |
|
|
PageHelper.startPage(pageNo,pageSize); |
|
|
PageHelper.startPage(pageNo,pageSize); |
|
|
List<IcPropertyManagementDTO> list=icPropertyManagementDao.queryList(EpmetRequestHolder.getLoginUserCustomerId(),name); |
|
|
List<IcPropertyManagementDTO> list=icPropertyManagementDao.queryList(EpmetRequestHolder.getLoginUserCustomerId(),name); |
|
|
PageInfo<IcPropertyManagementDTO> pageInfo = new PageInfo<>(list); |
|
|
PageInfo<IcPropertyManagementDTO> pageInfo = new PageInfo<>(list); |
|
|
return new PageData<>(list, pageInfo.getTotal()); |
|
|
return new PageData<>(list, pageInfo.getTotal(),pageSize); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|