Browse Source

Merge remote-tracking branch 'origin/yantai_zhengwu_master' into dev

master
yinzuomei 2 years ago
parent
commit
a544dcf96e
  1. 10
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcPropertyManagementDTO.java
  2. 12
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcPropertyManagementFormDTO.java
  3. 15
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/PropertyManagementController.java
  4. 9
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcPropertyManagementEntity.java
  5. 25
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/PropertyManagementServiceImpl.java

10
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcPropertyManagementDTO.java

@ -48,6 +48,16 @@ public class IcPropertyManagementDTO implements Serializable {
*/ */
private String customerId; private String customerId;
/**
* 烟台需求物业联系人姓名
*/
private String contactName;
/**
* 烟台需求物业联系人电话
*/
private String contactMobile;
/** /**
* 删除标识 0未删除1已删除 * 删除标识 0未删除1已删除
*/ */

12
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcPropertyManagementFormDTO.java

@ -52,6 +52,18 @@ public class IcPropertyManagementFormDTO implements Serializable {
@Length(max = 50, message = "物业名称不能超过50个字", groups = {AddShowGroup.class}) @Length(max = 50, message = "物业名称不能超过50个字", groups = {AddShowGroup.class})
private String name; private String name;
/**
* 烟台需求物业联系人姓名
*/
@Length(max = 30, message = "物业联系人不能超过30个字", groups = {AddShowGroup.class, UpdateShowGroup.class})
private String contactName;
/**
* 烟台需求物业联系人电话
*/
@Length(max = 30, message = "联系电话不能超过30个字",groups = {AddShowGroup.class, UpdateShowGroup.class})
private String contactMobile;
private String customerId; private String customerId;
@NotNull(message = "pageNo不能为空", groups = PageGroup.class) @NotNull(message = "pageNo不能为空", groups = PageGroup.class)

15
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/PropertyManagementController.java

@ -49,8 +49,9 @@ public class PropertyManagementController {
@Autowired @Autowired
private PropertyManagementService propertyManagementService; private PropertyManagementService propertyManagementService;
/** /**
* 分页查询物业列表 * 物业管理-分页查询物业列表
*/ */
@PostMapping("page") @PostMapping("page")
public Result<PageData<IcPropertyManagementDTO>> page(@RequestBody IcPropertyManagementFormDTO formDTO){ public Result<PageData<IcPropertyManagementDTO>> page(@RequestBody IcPropertyManagementFormDTO formDTO){
@ -68,7 +69,7 @@ public class PropertyManagementController {
} }
/** /**
* 新增物业 * 物业管理-新增物业
* 新增小区页面添加小区也调用此接口 * 新增小区页面添加小区也调用此接口
* @param tokenDTO * @param tokenDTO
* @param formDTO * @param formDTO
@ -84,6 +85,11 @@ public class PropertyManagementController {
return new Result().ok(map); return new Result().ok(map);
} }
/**
* 物业管理-修改
* @param formDTO
* @return
*/
@PostMapping("update") @PostMapping("update")
public Result update(@RequestBody IcPropertyManagementFormDTO formDTO){ public Result update(@RequestBody IcPropertyManagementFormDTO formDTO){
//效验数据 //效验数据
@ -92,6 +98,11 @@ public class PropertyManagementController {
return new Result(); return new Result();
} }
/**
* 物业管理-删除
* @param formDTO
* @return
*/
@PostMapping("delete") @PostMapping("delete")
public Result delete(@RequestBody IcPropertyManagementFormDTO formDTO){ public Result delete(@RequestBody IcPropertyManagementFormDTO formDTO){
//效验数据 //效验数据

9
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcPropertyManagementEntity.java

@ -40,4 +40,13 @@ public class IcPropertyManagementEntity extends BaseEpmetEntity {
*/ */
private String name; private String name;
private String customerId; private String customerId;
/**
* 烟台需求物业联系人姓名
*/
private String contactName;
/**
* 烟台需求物业联系人电话
*/
private String contactMobile;
} }

25
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/PropertyManagementServiceImpl.java

@ -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);
} }
} }

Loading…
Cancel
Save