Browse Source

Merge branch 'dev_contract' into develop

test
zhangyuan 3 years ago
parent
commit
daa60d4925
  1. 11
      epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/change/ChangeDeathDTO.java
  2. 11
      epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/change/ChangeRelocationDTO.java
  3. 20
      epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/change/CheckWelfareByIdCardDTO.java
  4. 33
      epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/controller/ChangeWelfareController.java
  5. 23
      epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/dao/ChangeWelfareDao.java
  6. 33
      epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/service/ChangeWelfareService.java
  7. 21
      epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/service/impl/ChangeDeathServiceImpl.java
  8. 26
      epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/service/impl/ChangeRelocationServiceImpl.java
  9. 88
      epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/service/impl/ChangeWelfareServiceImpl.java
  10. 14
      epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/change/ChangeWelfareDao.xml

11
epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/change/ChangeDeathDTO.java

@ -1,10 +1,10 @@
package com.epmet.plugin.power.dto.change; package com.epmet.plugin.power.dto.change;
import java.io.Serializable;
import java.util.Date;
import lombok.Data; import lombok.Data;
import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.util.Date;
/** /**
@ -119,4 +119,9 @@ public class ChangeDeathDTO implements Serializable {
*/ */
private String customerId; private String customerId;
} /**
* 是否保存为福利人员
*/
private Boolean welfareFlag;
}

11
epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/change/ChangeRelocationDTO.java

@ -1,7 +1,8 @@
package com.epmet.plugin.power.dto.change; package com.epmet.plugin.power.dto.change;
import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data; import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable; import java.io.Serializable;
import java.util.Date; import java.util.Date;
@ -176,7 +177,8 @@ public class ChangeRelocationDTO implements Serializable {
/** /**
* 迁出时间 * 迁出时间
*/ */
@DateTimeFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
@JSONField(format = "yyyy-MM-dd")
private Date outOfTime; private Date outOfTime;
/** /**
@ -194,4 +196,9 @@ public class ChangeRelocationDTO implements Serializable {
*/ */
private String icUserId; private String icUserId;
/**
* 是否保存为福利人员
*/
private Boolean welfareFlag;
} }

20
epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/change/CheckWelfareByIdCardDTO.java

@ -0,0 +1,20 @@
package com.epmet.plugin.power.dto.change;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* @program: epmet-plugins
* @description:
* @author: wangtong
* @create: 2022-05-09 13:52
**/
@Data
public class CheckWelfareByIdCardDTO implements Serializable {
@NotBlank(message = "身份证不能为空")
private String idCard;
}

33
epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/controller/ChangeWelfareController.java

@ -7,9 +7,10 @@ import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.AssertUtils; import com.epmet.commons.tools.validator.AssertUtils;
import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.commons.tools.validator.group.AddGroup; import com.epmet.commons.tools.validator.group.AddGroup;
import com.epmet.commons.tools.validator.group.UpdateGroup;
import com.epmet.commons.tools.validator.group.DefaultGroup; import com.epmet.commons.tools.validator.group.DefaultGroup;
import com.epmet.commons.tools.validator.group.UpdateGroup;
import com.epmet.plugin.power.dto.change.ChangeWelfareDTO; import com.epmet.plugin.power.dto.change.ChangeWelfareDTO;
import com.epmet.plugin.power.dto.change.CheckWelfareByIdCardDTO;
import com.epmet.plugin.power.modules.change.excel.ChangeWelfareExcel; import com.epmet.plugin.power.modules.change.excel.ChangeWelfareExcel;
import com.epmet.plugin.power.modules.change.service.ChangeWelfareService; import com.epmet.plugin.power.modules.change.service.ChangeWelfareService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -50,8 +51,7 @@ public class ChangeWelfareController {
public Result save(@RequestBody ChangeWelfareDTO dto){ public Result save(@RequestBody ChangeWelfareDTO dto){
//效验数据 //效验数据
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
changeWelfareService.save(dto); return changeWelfareService.save(dto);
return new Result();
} }
@NoRepeatSubmit @NoRepeatSubmit
@ -77,6 +77,33 @@ public class ChangeWelfareController {
ExcelUtils.exportExcelToTarget(response, null, list, ChangeWelfareExcel.class); ExcelUtils.exportExcelToTarget(response, null, list, ChangeWelfareExcel.class);
} }
/**
* @describe: 移除福利人员
* @author wangtong
* @date 2022/5/9 11:11
* @params [dto]
* @return com.epmet.commons.tools.utils.Result
*/
@NoRepeatSubmit
@PostMapping("removeWelfare")
public Result removeWelfare(@RequestBody ChangeWelfareDTO dto){
return changeWelfareService.removeWelfare(dto);
}
/**
* @describe: 通过身份证号查询是否属于福利人员-true-false
* @author wangtong
* @date 2022/5/9 13:52
* @params [dto]
* @return com.epmet.commons.tools.utils.Result
*/
@NoRepeatSubmit
@GetMapping("checkWelfareByIdCard")
public Boolean checkWelfareByIdCard(CheckWelfareByIdCardDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
return changeWelfareService.checkWelfareByIdCard(dto);
}
} }

23
epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/dao/ChangeWelfareDao.java

@ -1,8 +1,10 @@
package com.epmet.plugin.power.modules.change.dao; package com.epmet.plugin.power.modules.change.dao;
import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.plugin.power.dto.change.ChangeWelfareDTO;
import com.epmet.plugin.power.modules.change.entity.ChangeWelfareEntity; import com.epmet.plugin.power.modules.change.entity.ChangeWelfareEntity;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/** /**
* 福利表 * 福利表
@ -12,5 +14,22 @@ import org.apache.ibatis.annotations.Mapper;
*/ */
@Mapper @Mapper
public interface ChangeWelfareDao extends BaseDao<ChangeWelfareEntity> { public interface ChangeWelfareDao extends BaseDao<ChangeWelfareEntity> {
} /**
* @describe: 通过身份证号查询福利人员
* @author wangtong
* @date 2022/5/9 13:59
* @params [idCard]
* @return com.epmet.plugin.power.modules.change.entity.ChangeWelfareEntity
*/
ChangeWelfareEntity selectByIdCard(@Param("idCard") String idCard);
/**
* @describe: 移除福利人员
* @author wangtong
* @date 2022/5/9 14:36
* @params [dto]
* @return com.epmet.commons.tools.utils.Result
*/
void removeWelfare(ChangeWelfareDTO dto);
}

33
epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/service/ChangeWelfareService.java

@ -2,7 +2,9 @@ package com.epmet.plugin.power.modules.change.service;
import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.Result;
import com.epmet.plugin.power.dto.change.ChangeWelfareDTO; import com.epmet.plugin.power.dto.change.ChangeWelfareDTO;
import com.epmet.plugin.power.dto.change.CheckWelfareByIdCardDTO;
import com.epmet.plugin.power.modules.change.entity.ChangeWelfareEntity; import com.epmet.plugin.power.modules.change.entity.ChangeWelfareEntity;
import java.util.List; import java.util.List;
@ -54,7 +56,7 @@ public interface ChangeWelfareService extends BaseService<ChangeWelfareEntity> {
* @author generator * @author generator
* @date 2022-05-09 * @date 2022-05-09
*/ */
void save(ChangeWelfareDTO dto); Result save(ChangeWelfareDTO dto);
/** /**
* 默认更新 * 默认更新
@ -75,4 +77,31 @@ public interface ChangeWelfareService extends BaseService<ChangeWelfareEntity> {
* @date 2022-05-09 * @date 2022-05-09
*/ */
void delete(String[] ids); void delete(String[] ids);
}
/**
* @describe: 移除福利人员
* @author wangtong
* @date 2022/5/9 11:11
* @params [dto]
* @return com.epmet.commons.tools.utils.Result
*/
Result removeWelfare(ChangeWelfareDTO dto);
/**
* @describe: 通过身份证号查询是否属于福利人员-true-false
* @author wangtong
* @date 2022/5/9 13:54
* @params [dto]
* @return java.lang.Boolean
*/
Boolean checkWelfareByIdCard(CheckWelfareByIdCardDTO dto);
/**
* @describe: 保存福利人员
* @author wangtong
* @date 2022/5/9 14:10
* @params []
* @return com.epmet.commons.tools.utils.Result
*/
Result saveWelfareInfo(ChangeWelfareDTO dto);
}

21
epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/service/impl/ChangeDeathServiceImpl.java

@ -16,10 +16,12 @@ import com.epmet.dto.form.RentTenantDataFormDTO;
import com.epmet.dto.result.RentTenantDataResultDTO; import com.epmet.dto.result.RentTenantDataResultDTO;
import com.epmet.feign.EpmetUserOpenFeignClient; import com.epmet.feign.EpmetUserOpenFeignClient;
import com.epmet.plugin.power.dto.change.ChangeDeathDTO; import com.epmet.plugin.power.dto.change.ChangeDeathDTO;
import com.epmet.plugin.power.dto.change.ChangeWelfareDTO;
import com.epmet.plugin.power.modules.change.dao.ChangeDeathDao; import com.epmet.plugin.power.modules.change.dao.ChangeDeathDao;
import com.epmet.plugin.power.modules.change.entity.ChangeDeathEntity; import com.epmet.plugin.power.modules.change.entity.ChangeDeathEntity;
import com.epmet.plugin.power.modules.change.redis.ChangeDeathRedis; import com.epmet.plugin.power.modules.change.redis.ChangeDeathRedis;
import com.epmet.plugin.power.modules.change.service.ChangeDeathService; import com.epmet.plugin.power.modules.change.service.ChangeDeathService;
import com.epmet.plugin.power.modules.change.service.ChangeWelfareService;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -45,6 +47,9 @@ public class ChangeDeathServiceImpl extends BaseServiceImpl<ChangeDeathDao, Chan
@Autowired @Autowired
LoginUserUtil loginUserUtil; LoginUserUtil loginUserUtil;
@Autowired
private ChangeWelfareService changeWelfareService;
@Override @Override
public PageData<ChangeDeathDTO> page(Map<String, Object> params) { public PageData<ChangeDeathDTO> page(Map<String, Object> params) {
IPage<ChangeDeathEntity> page = baseDao.selectPage( IPage<ChangeDeathEntity> page = baseDao.selectPage(
@ -108,6 +113,20 @@ public class ChangeDeathServiceImpl extends BaseServiceImpl<ChangeDeathDao, Chan
ChangeDeathEntity entity = ConvertUtils.sourceToTarget(dto, ChangeDeathEntity.class); ChangeDeathEntity entity = ConvertUtils.sourceToTarget(dto, ChangeDeathEntity.class);
entity.setCustomerId(loginUserUtil.getLoginUserCustomerId()); entity.setCustomerId(loginUserUtil.getLoginUserCustomerId());
insert(entity); insert(entity);
if(dto.getWelfareFlag() != null && dto.getWelfareFlag()){
ChangeWelfareDTO formDto = new ChangeWelfareDTO();
formDto.setUserId(dto.getUserId());
formDto.setName(dto.getName());
formDto.setIdCard(result.getData().getIdCard());
formDto.setMobile(result.getData().getMobile());
formDto.setGridId(result.getData().getGridId());
formDto.setGender(dto.getGender());
formDto.setJoinReason("迁入死亡人口选定");
formDto.setCustomerId(dto.getCustomerId());
formDto.setCustomerId(formDTO.getCustomerId());
changeWelfareService.saveWelfareInfo(formDto);
}
return new Result(); return new Result();
} }
@ -125,4 +144,4 @@ public class ChangeDeathServiceImpl extends BaseServiceImpl<ChangeDeathDao, Chan
baseDao.deleteBatchIds(Arrays.asList(ids)); baseDao.deleteBatchIds(Arrays.asList(ids));
} }
} }

26
epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/service/impl/ChangeRelocationServiceImpl.java

@ -15,10 +15,12 @@ import com.epmet.dto.form.RentTenantDataFormDTO;
import com.epmet.dto.result.RentTenantDataResultDTO; import com.epmet.dto.result.RentTenantDataResultDTO;
import com.epmet.feign.EpmetUserOpenFeignClient; import com.epmet.feign.EpmetUserOpenFeignClient;
import com.epmet.plugin.power.dto.change.ChangeRelocationDTO; import com.epmet.plugin.power.dto.change.ChangeRelocationDTO;
import com.epmet.plugin.power.dto.change.ChangeWelfareDTO;
import com.epmet.plugin.power.modules.change.dao.ChangeRelocationDao; import com.epmet.plugin.power.modules.change.dao.ChangeRelocationDao;
import com.epmet.plugin.power.modules.change.entity.ChangeRelocationEntity; import com.epmet.plugin.power.modules.change.entity.ChangeRelocationEntity;
import com.epmet.plugin.power.modules.change.redis.ChangeRelocationRedis; import com.epmet.plugin.power.modules.change.redis.ChangeRelocationRedis;
import com.epmet.plugin.power.modules.change.service.ChangeRelocationService; import com.epmet.plugin.power.modules.change.service.ChangeRelocationService;
import com.epmet.plugin.power.modules.change.service.ChangeWelfareService;
import com.epmet.plugin.power.utils.IdentityNoUtils; import com.epmet.plugin.power.utils.IdentityNoUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -47,6 +49,9 @@ public class ChangeRelocationServiceImpl extends BaseServiceImpl<ChangeRelocatio
@Autowired @Autowired
private EpmetUserOpenFeignClient epmetUserOpenFeignClient; private EpmetUserOpenFeignClient epmetUserOpenFeignClient;
@Autowired
private ChangeWelfareService changeWelfareService;
@Override @Override
public PageData<ChangeRelocationDTO> page(Map<String, Object> params) { public PageData<ChangeRelocationDTO> page(Map<String, Object> params) {
IPage<ChangeRelocationEntity> page = baseDao.selectPage( IPage<ChangeRelocationEntity> page = baseDao.selectPage(
@ -124,7 +129,6 @@ public class ChangeRelocationServiceImpl extends BaseServiceImpl<ChangeRelocatio
@Override @Override
public Result saveOutOfInfo(ChangeRelocationDTO dto) { public Result saveOutOfInfo(ChangeRelocationDTO dto) {
RentTenantDataFormDTO formDTO = new RentTenantDataFormDTO(); RentTenantDataFormDTO formDTO = new RentTenantDataFormDTO();
formDTO.setUserId(dto.getIcUserId()); formDTO.setUserId(dto.getIcUserId());
formDTO.setCustomerId(loginUserUtil.getLoginUserCustomerId()); formDTO.setCustomerId(loginUserUtil.getLoginUserCustomerId());
@ -141,6 +145,26 @@ public class ChangeRelocationServiceImpl extends BaseServiceImpl<ChangeRelocatio
entity.setAge(IdentityNoUtils.getAge(result.getData().getIdCard()).toString()); entity.setAge(IdentityNoUtils.getAge(result.getData().getIdCard()).toString());
entity.setAddress(dto.getVillageName()+dto.getBuildName()+dto.getUnitName()+dto.getHomeName()); entity.setAddress(dto.getVillageName()+dto.getBuildName()+dto.getUnitName()+dto.getHomeName());
insert(entity); insert(entity);
if(dto.getWelfareFlag() != null && dto.getWelfareFlag()){
ChangeWelfareDTO formDto = new ChangeWelfareDTO();
formDto.setUserId(dto.getIcUserId());
formDto.setName(dto.getName());
formDto.setIdCard(result.getData().getIdCard());
formDto.setMobile(result.getData().getMobile());
formDto.setGridId(result.getData().getGridId());
if(StringUtils.isNotBlank(dto.getGender())){
if("女".equals(dto.getGender())){
formDto.setGender("0");
}else if("男".equals(dto.getGender())){
formDto.setGender("1");
}
}
formDto.setJoinReason("迁出人员选定");
formDto.setCustomerId(dto.getCustomerId());
formDto.setCustomerId(formDTO.getCustomerId());
changeWelfareService.saveWelfareInfo(formDto);
}
return new Result(); return new Result();
} }

88
epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/change/service/impl/ChangeWelfareServiceImpl.java

@ -3,11 +3,21 @@ package com.epmet.plugin.power.modules.change.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.user.LoginUserUtil;
import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.plugin.power.modules.change.dao.ChangeWelfareDao; import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.commons.tools.validator.group.DefaultGroup;
import com.epmet.commons.tools.validator.group.UpdateGroup;
import com.epmet.dto.form.RentTenantDataFormDTO;
import com.epmet.dto.result.RentTenantDataResultDTO;
import com.epmet.feign.EpmetUserOpenFeignClient;
import com.epmet.plugin.power.dto.change.ChangeWelfareDTO; import com.epmet.plugin.power.dto.change.ChangeWelfareDTO;
import com.epmet.plugin.power.dto.change.CheckWelfareByIdCardDTO;
import com.epmet.plugin.power.modules.change.dao.ChangeWelfareDao;
import com.epmet.plugin.power.modules.change.entity.ChangeWelfareEntity; import com.epmet.plugin.power.modules.change.entity.ChangeWelfareEntity;
import com.epmet.plugin.power.modules.change.redis.ChangeWelfareRedis; import com.epmet.plugin.power.modules.change.redis.ChangeWelfareRedis;
import com.epmet.plugin.power.modules.change.service.ChangeWelfareService; import com.epmet.plugin.power.modules.change.service.ChangeWelfareService;
@ -16,9 +26,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import java.util.Arrays; import java.util.*;
import java.util.List;
import java.util.Map;
/** /**
* 福利表 * 福利表
@ -32,6 +40,12 @@ public class ChangeWelfareServiceImpl extends BaseServiceImpl<ChangeWelfareDao,
@Autowired @Autowired
private ChangeWelfareRedis changeWelfareRedis; private ChangeWelfareRedis changeWelfareRedis;
@Autowired
LoginUserUtil loginUserUtil;
@Autowired
private EpmetUserOpenFeignClient epmetUserOpenFeignClient;
@Override @Override
public PageData<ChangeWelfareDTO> page(Map<String, Object> params) { public PageData<ChangeWelfareDTO> page(Map<String, Object> params) {
IPage<ChangeWelfareEntity> page = baseDao.selectPage( IPage<ChangeWelfareEntity> page = baseDao.selectPage(
@ -49,10 +63,20 @@ public class ChangeWelfareServiceImpl extends BaseServiceImpl<ChangeWelfareDao,
} }
private QueryWrapper<ChangeWelfareEntity> getWrapper(Map<String, Object> params){ private QueryWrapper<ChangeWelfareEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get(FieldConstant.ID_HUMP); String id = (String) params.get(FieldConstant.ID_HUMP);
String name = (String) params.get("name");
String idCard = (String) params.get("idCard");
String mobile = (String) params.get("mobile");
String startTime = (String) params.get("startTime");
String endTime = (String) params.get("endTime");
QueryWrapper<ChangeWelfareEntity> wrapper = new QueryWrapper<>(); QueryWrapper<ChangeWelfareEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
wrapper.eq(StringUtils.isNotBlank(name), "NAME", name);
wrapper.eq(StringUtils.isNotBlank(idCard), "ID_CARD", idCard);
wrapper.eq(StringUtils.isNotBlank(mobile), "MOBILE", mobile);
wrapper.ge(StringUtils.isNotBlank(startTime), "JOIN_DATE", startTime);
wrapper.le(StringUtils.isNotBlank(endTime), "JOIN_DATE", endTime);
return wrapper; return wrapper;
} }
@ -65,9 +89,28 @@ public class ChangeWelfareServiceImpl extends BaseServiceImpl<ChangeWelfareDao,
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public void save(ChangeWelfareDTO dto) { public Result save(ChangeWelfareDTO dto) {
RentTenantDataFormDTO formDTO = new RentTenantDataFormDTO();
formDTO.setUserId(dto.getUserId());
formDTO.setCustomerId(loginUserUtil.getLoginUserCustomerId());
ValidatorUtils.validateEntity(formDTO, UpdateGroup.class, DefaultGroup.class);
Result<RentTenantDataResultDTO> result = epmetUserOpenFeignClient.getRentResiUserInfo(formDTO);
dto.setIdCard(result.getData().getIdCard());
dto.setMobile(result.getData().getMobile());
dto.setGridId(result.getData().getGridId());
Map<String, Object> params = new HashMap<>(4);
params.put("idCard", dto.getIdCard());
if (!list(params).isEmpty()) {
return new Result().error("该人员已经迁入福利人口");
}
dto.setJoinDate(DateUtils.format(new Date()));
ChangeWelfareEntity entity = ConvertUtils.sourceToTarget(dto, ChangeWelfareEntity.class); ChangeWelfareEntity entity = ConvertUtils.sourceToTarget(dto, ChangeWelfareEntity.class);
entity.setCustomerId(loginUserUtil.getLoginUserCustomerId());
insert(entity); insert(entity);
return new Result();
} }
@Override @Override
@ -84,4 +127,33 @@ public class ChangeWelfareServiceImpl extends BaseServiceImpl<ChangeWelfareDao,
baseDao.deleteBatchIds(Arrays.asList(ids)); baseDao.deleteBatchIds(Arrays.asList(ids));
} }
} @Override
public Result removeWelfare(ChangeWelfareDTO dto) {
if(StringUtils.isBlank(dto.getId())){
return new Result().error("id不可为空");
}
dto.setRemoveDate(DateUtils.format(new Date()));
baseDao.removeWelfare(dto);
return new Result().ok("移除成功");
}
@Override
public Boolean checkWelfareByIdCard(CheckWelfareByIdCardDTO dto) {
ChangeWelfareEntity entity = baseDao.selectByIdCard(dto.getIdCard());
return entity == null? false: true;
}
@Override
public Result saveWelfareInfo(ChangeWelfareDTO dto) {
Map<String, Object> params = new HashMap<>(4);
params.put("idCard", dto.getIdCard());
if (!list(params).isEmpty()) {
return new Result().error("该人员已经迁入福利人口");
}
dto.setJoinDate(DateUtils.format(new Date()));
ChangeWelfareEntity entity = ConvertUtils.sourceToTarget(dto, ChangeWelfareEntity.class);
insert(entity);
return new Result();
}
}

14
epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/change/ChangeWelfareDao.xml

@ -24,6 +24,18 @@
<result property="updatedTime" column="UPDATED_TIME"/> <result property="updatedTime" column="UPDATED_TIME"/>
<result property="customerId" column="CUSTOMER_ID"/> <result property="customerId" column="CUSTOMER_ID"/>
</resultMap> </resultMap>
<select id="selectByIdCard" resultType="com.epmet.plugin.power.modules.change.entity.ChangeWelfareEntity">
select * from pli_change_welfare
where ID_CARD=#{idCard}
and del_flag='0'
</select>
<update id="removeWelfare">
update pli_change_welfare
set REMOVE_DATE=#{removeDate},
REMOVE_REASON=#{removeReason},
del_flag='1'
where id=#{id}
</update>
</mapper> </mapper>

Loading…
Cancel
Save