diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcVolunteerPolyCategoryDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcVolunteerPolyCategoryDTO.java new file mode 100644 index 0000000000..4b4737d46e --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcVolunteerPolyCategoryDTO.java @@ -0,0 +1,80 @@ +package com.epmet.dto; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 志愿者信息聚合,志愿者类别表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-19 + */ +@Data +public class IcVolunteerPolyCategoryDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户Id customer.id + */ + private String customerId; + + /** + * 身份证号 + */ + private String idCard; + + /** + * 类别【字典表】 + */ + private String volunteerCategory; + + /** + * 经度 + */ + private String longitude; + + /** + * 纬度 + */ + private String latitude; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 删除标识 0.未删除 1.已删除 + */ + private Integer delFlag; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcVolunteerPolyDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcVolunteerPolyDTO.java new file mode 100644 index 0000000000..3a237f0856 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcVolunteerPolyDTO.java @@ -0,0 +1,99 @@ +package com.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 志愿者信息聚合 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-19 + */ +@Data +public class IcVolunteerPolyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户Id customer.id + */ + private String customerId; + + /** + * 行政组织 机关ID + */ + private String agencyId; + + /** + * 行政组织 机关ID + */ + private String agencyPids; + + /** + * 居住成员1姓名 + */ + private String name; + + /** + * 身份证号 + */ + private String idCard; + + /** + * 手机号 + */ + private String mobile; + + /** + * 性别 + */ + private String gender; + + /** + * 经度 + */ + private String longitude; + + /** + * 纬度 + */ + private String latitude; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 删除标识 0.未删除 1.已删除 + */ + private Integer delFlag; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcVolunteerPolyController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcVolunteerPolyController.java new file mode 100644 index 0000000000..193c4ba6f0 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcVolunteerPolyController.java @@ -0,0 +1,71 @@ +package com.epmet.controller; + +import com.epmet.commons.tools.aop.NoRepeatSubmit; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.dto.IcVolunteerPolyDTO; +import com.epmet.service.IcVolunteerPolyService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.Map; + + +/** + * 志愿者信息聚合 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-19 + */ +@RestController +@RequestMapping("icVolunteerPoly") +public class IcVolunteerPolyController { + + @Autowired + private IcVolunteerPolyService icVolunteerPolyService; + + @RequestMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = icVolunteerPolyService.page(params); + return new Result>().ok(page); + } + + @RequestMapping(value = "{id}",method = {RequestMethod.POST,RequestMethod.GET}) + public Result get(@PathVariable("id") String id){ + IcVolunteerPolyDTO data = icVolunteerPolyService.get(id); + return new Result().ok(data); + } + + @NoRepeatSubmit + @PostMapping("save") + public Result save(@RequestBody IcVolunteerPolyDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + icVolunteerPolyService.save(dto); + return new Result(); + } + + @NoRepeatSubmit + @PostMapping("update") + public Result update(@RequestBody IcVolunteerPolyDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + icVolunteerPolyService.update(dto); + return new Result(); + } + + @PostMapping("delete") + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + icVolunteerPolyService.delete(ids); + return new Result(); + } + + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcVolunteerPolyCategoryDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcVolunteerPolyCategoryDao.java new file mode 100644 index 0000000000..d585715290 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcVolunteerPolyCategoryDao.java @@ -0,0 +1,16 @@ +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.IcVolunteerPolyCategoryEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 志愿者信息聚合,志愿者类别表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-19 + */ +@Mapper +public interface IcVolunteerPolyCategoryDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcVolunteerPolyDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcVolunteerPolyDao.java new file mode 100644 index 0000000000..f963d33513 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcVolunteerPolyDao.java @@ -0,0 +1,16 @@ +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.IcVolunteerPolyEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 志愿者信息聚合 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-19 + */ +@Mapper +public interface IcVolunteerPolyDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcVolunteerPolyCategoryEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcVolunteerPolyCategoryEntity.java new file mode 100644 index 0000000000..fa15bdc41e --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcVolunteerPolyCategoryEntity.java @@ -0,0 +1,46 @@ +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 志愿者信息聚合,志愿者类别表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-19 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ic_volunteer_poly_category") +public class IcVolunteerPolyCategoryEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id customer.id + */ + private String customerId; + + /** + * 身份证号 + */ + private String idCard; + + /** + * 类别【字典表】 + */ + private String volunteerCategory; + + /** + * 经度 + */ + private String longitude; + + /** + * 纬度 + */ + private String latitude; + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcVolunteerPolyEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcVolunteerPolyEntity.java new file mode 100644 index 0000000000..7db2e18595 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcVolunteerPolyEntity.java @@ -0,0 +1,69 @@ +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 志愿者信息聚合 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-19 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ic_volunteer_poly") +public class IcVolunteerPolyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id customer.id + */ + private String customerId; + + /** + * 行政组织 机关ID + */ + private String agencyId; + + /** + * 行政组织 机关ID + */ + private String agencyPids; + + /** + * 居住成员1姓名 + */ + private String name; + + /** + * 身份证号 + */ + private String idCard; + + /** + * 手机号 + */ + private String mobile; + + /** + * 性别 + */ + private String gender; + + /** + * 经度 + */ + private String longitude; + + /** + * 纬度 + */ + private String latitude; + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcVolunteerPolyCategoryService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcVolunteerPolyCategoryService.java new file mode 100644 index 0000000000..0dd4cfa523 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcVolunteerPolyCategoryService.java @@ -0,0 +1,78 @@ +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.IcVolunteerPolyCategoryDTO; +import com.epmet.entity.IcVolunteerPolyCategoryEntity; + +import java.util.List; +import java.util.Map; + +/** + * 志愿者信息聚合,志愿者类别表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-19 + */ +public interface IcVolunteerPolyCategoryService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2022-05-19 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2022-05-19 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return IcVolunteerPolyCategoryDTO + * @author generator + * @date 2022-05-19 + */ + IcVolunteerPolyCategoryDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2022-05-19 + */ + void save(IcVolunteerPolyCategoryDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2022-05-19 + */ + void update(IcVolunteerPolyCategoryDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2022-05-19 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcVolunteerPolyService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcVolunteerPolyService.java new file mode 100644 index 0000000000..180bae7924 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcVolunteerPolyService.java @@ -0,0 +1,78 @@ +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.IcVolunteerPolyDTO; +import com.epmet.entity.IcVolunteerPolyEntity; + +import java.util.List; +import java.util.Map; + +/** + * 志愿者信息聚合 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-19 + */ +public interface IcVolunteerPolyService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2022-05-19 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2022-05-19 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return IcVolunteerPolyDTO + * @author generator + * @date 2022-05-19 + */ + IcVolunteerPolyDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2022-05-19 + */ + void save(IcVolunteerPolyDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2022-05-19 + */ + void update(IcVolunteerPolyDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2022-05-19 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcVolunteerPolyCategoryServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcVolunteerPolyCategoryServiceImpl.java new file mode 100644 index 0000000000..ff4aaa59d0 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcVolunteerPolyCategoryServiceImpl.java @@ -0,0 +1,83 @@ +package com.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +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.utils.ConvertUtils; +import com.epmet.dao.IcVolunteerPolyCategoryDao; +import com.epmet.dto.IcVolunteerPolyCategoryDTO; +import com.epmet.entity.IcVolunteerPolyCategoryEntity; +import com.epmet.service.IcVolunteerPolyCategoryService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 志愿者信息聚合,志愿者类别表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-19 + */ +@Service +public class IcVolunteerPolyCategoryServiceImpl extends BaseServiceImpl implements IcVolunteerPolyCategoryService { + + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, IcVolunteerPolyCategoryDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, IcVolunteerPolyCategoryDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public IcVolunteerPolyCategoryDTO get(String id) { + IcVolunteerPolyCategoryEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, IcVolunteerPolyCategoryDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(IcVolunteerPolyCategoryDTO dto) { + IcVolunteerPolyCategoryEntity entity = ConvertUtils.sourceToTarget(dto, IcVolunteerPolyCategoryEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(IcVolunteerPolyCategoryDTO dto) { + IcVolunteerPolyCategoryEntity entity = ConvertUtils.sourceToTarget(dto, IcVolunteerPolyCategoryEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcVolunteerPolyServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcVolunteerPolyServiceImpl.java new file mode 100644 index 0000000000..a3e4d4d806 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcVolunteerPolyServiceImpl.java @@ -0,0 +1,84 @@ +package com.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.dao.IcVolunteerPolyDao; +import com.epmet.dto.IcVolunteerPolyDTO; +import com.epmet.entity.IcVolunteerPolyEntity; +import com.epmet.service.IcVolunteerPolyService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 志愿者信息聚合 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-19 + */ +@Service +public class IcVolunteerPolyServiceImpl extends BaseServiceImpl implements IcVolunteerPolyService { + + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, IcVolunteerPolyDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, IcVolunteerPolyDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public IcVolunteerPolyDTO get(String id) { + IcVolunteerPolyEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, IcVolunteerPolyDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(IcVolunteerPolyDTO dto) { + IcVolunteerPolyEntity entity = ConvertUtils.sourceToTarget(dto, IcVolunteerPolyEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(IcVolunteerPolyDTO dto) { + IcVolunteerPolyEntity entity = ConvertUtils.sourceToTarget(dto, IcVolunteerPolyEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/IcVolunteerPolyCategoryDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/IcVolunteerPolyCategoryDao.xml new file mode 100644 index 0000000000..0029247482 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/IcVolunteerPolyCategoryDao.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/IcVolunteerPolyDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/IcVolunteerPolyDao.xml new file mode 100644 index 0000000000..130d275705 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/IcVolunteerPolyDao.xml @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file