diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcMoveInRecordDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcMoveInRecordDTO.java new file mode 100644 index 0000000000..f68c93d372 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcMoveInRecordDTO.java @@ -0,0 +1,169 @@ +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-09 + */ +@Data +public class IcMoveInRecordDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 唯一标识 + */ + private String id; + + /** + * 客户Id customer.id + */ + private String customerId; + + /** + * 组织Id + */ + private String agencyId; + + /** + * 组织的pids + */ + private String pids; + + /** + * 网格ID + */ + private String gridId; + + /** + * 所属小区ID + */ + private String villageId; + + /** + * 所属楼宇Id + */ + private String buildId; + + /** + * 单元id + */ + private String unitId; + + /** + * 所属家庭Id + */ + private String homeId; + + /** + * 姓名 + */ + private String name; + + /** + * 是否享受福利【否:0 是:1】 + */ + private String isWeifare; + + /** + * 手机号 + */ + private String mobile; + + /** + * 身份证号 + */ + private String idCard; + + /** + * 性别(1男2女0未知) + */ + private String gender; + + /** + * 年龄 + */ + private Integer age; + + /** + * 迁入时间 + */ + private Date inTime; + + /** + * 迁入原因 + */ + private String inReason; + + /** + * 来源地区编码 + */ + private String sourceAddressCode; + + /** + * 来源地区编码全路径 + */ + private String sourceAddressPathCode; + + /** + * 来源地区地址 + */ + private String sourceAddress; + + /** + * 详细地址 + */ + private String address; + + /** + * 迁移证号码 + */ + private String moveNumber; + + /** + * 户主姓名 + */ + private String householderName; + + /** + * 与户主关系[字典表] + */ + private String householderRelation; + + /** + * 删除标识 0.未删除 1.已删除 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcMoveInRecordController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcMoveInRecordController.java new file mode 100644 index 0000000000..bc30dc17ba --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcMoveInRecordController.java @@ -0,0 +1,83 @@ +package com.epmet.controller; + +import com.epmet.commons.tools.aop.NoRepeatSubmit; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ExcelUtils; +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.IcMoveInRecordDTO; +import com.epmet.excel.IcMoveInRecordExcel; +import com.epmet.service.IcMoveInRecordService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + + +/** + * 迁入管理记录 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-09 + */ +@RestController +@RequestMapping("icMoveIn") +public class IcMoveInRecordController { + + @Autowired + private IcMoveInRecordService icMoveInRecordService; + + + @RequestMapping(value = "{id}",method = {RequestMethod.POST,RequestMethod.GET}) + public Result get(@PathVariable("id") String id){ + IcMoveInRecordDTO data = icMoveInRecordService.get(id); + return new Result().ok(data); + } + + @RequestMapping("list") + public Result> page(@RequestParam Map params){ + PageData page = icMoveInRecordService.page(params); + return new Result>().ok(page); + } + + @NoRepeatSubmit + @PostMapping("add") + public Result save(@RequestBody IcMoveInRecordDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + icMoveInRecordService.save(dto); + return new Result(); + } + + @NoRepeatSubmit + @PostMapping("edit") + public Result update(@RequestBody IcMoveInRecordDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + icMoveInRecordService.update(dto); + return new Result(); + } + + @PostMapping("delete") + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + icMoveInRecordService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = icMoveInRecordService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, IcMoveInRecordExcel.class); + } + + + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcMoveInRecordDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcMoveInRecordDao.java new file mode 100644 index 0000000000..4910ea8882 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcMoveInRecordDao.java @@ -0,0 +1,16 @@ +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.IcMoveInRecordEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 迁入管理记录 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-09 + */ +@Mapper +public interface IcMoveInRecordDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcMoveInRecordEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcMoveInRecordEntity.java new file mode 100644 index 0000000000..9ee125a348 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcMoveInRecordEntity.java @@ -0,0 +1,138 @@ +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-09 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ic_move_in_record") +public class IcMoveInRecordEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id customer.id + */ + private String customerId; + + /** + * 组织Id + */ + private String agencyId; + + /** + * 组织的pids + */ + private String pids; + + /** + * 网格ID + */ + private String gridId; + + /** + * 所属小区ID + */ + private String villageId; + + /** + * 所属楼宇Id + */ + private String buildId; + + /** + * 单元id + */ + private String unitId; + + /** + * 所属家庭Id + */ + private String homeId; + + /** + * 姓名 + */ + private String name; + + /** + * 是否享受福利【否:0 是:1】 + */ + private String isWeifare; + + /** + * 手机号 + */ + private String mobile; + + /** + * 身份证号 + */ + private String idCard; + + /** + * 性别(1男2女0未知) + */ + private String gender; + + /** + * 年龄 + */ + private Integer age; + + /** + * 迁入时间 + */ + private Date inTime; + + /** + * 迁入原因 + */ + private String inReason; + + /** + * 来源地区编码 + */ + private String sourceAddressCode; + + /** + * 来源地区编码全路径 + */ + private String sourceAddressPathCode; + + /** + * 来源地区地址 + */ + private String sourceAddress; + + /** + * 详细地址 + */ + private String address; + + /** + * 迁移证号码 + */ + private String moveNumber; + + /** + * 户主姓名 + */ + private String householderName; + + /** + * 与户主关系[字典表] + */ + private String householderRelation; + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/IcMoveInRecordExcel.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/IcMoveInRecordExcel.java new file mode 100644 index 0000000000..d1ec627c17 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/IcMoveInRecordExcel.java @@ -0,0 +1,102 @@ +package com.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 迁入管理记录 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-09 + */ +@Data +public class IcMoveInRecordExcel { + + @Excel(name = "唯一标识") + private String id; + + @Excel(name = "客户Id customer.id") + private String customerId; + + @Excel(name = "组织Id") + private String agencyId; + + @Excel(name = "组织的pids") + private String pids; + + @Excel(name = "网格ID") + private String gridId; + + @Excel(name = "所属小区ID") + private String villageId; + + @Excel(name = "所属楼宇Id") + private String buildId; + + @Excel(name = "单元id") + private String unitId; + + @Excel(name = "所属家庭Id") + private String homeId; + + @Excel(name = "姓名") + private String name; + + @Excel(name = "是否享受福利【否:0 是:1】") + private String isWeifare; + + @Excel(name = "手机号") + private String mobile; + + @Excel(name = "身份证号") + private String idCard; + + @Excel(name = "性别(1男2女0未知)") + private String gender; + + @Excel(name = "年龄") + private Integer age; + + @Excel(name = "迁入时间") + private Date inTime; + + @Excel(name = "迁入原因") + private String inReason; + + @Excel(name = "来源地") + private String source; + + @Excel(name = "详细地址") + private String address; + + @Excel(name = "迁移证号码") + private String moveNumber; + + @Excel(name = "户主姓名") + private String houseName; + + @Excel(name = "与户主关系[字典表]") + private String houseRelation; + + @Excel(name = "删除标识 0.未删除 1.已删除") + private Integer delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcMoveInRecordService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcMoveInRecordService.java new file mode 100644 index 0000000000..3df4e7a2fd --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcMoveInRecordService.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.IcMoveInRecordDTO; +import com.epmet.entity.IcMoveInRecordEntity; + +import java.util.List; +import java.util.Map; + +/** + * 迁入管理记录 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-09 + */ +public interface IcMoveInRecordService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2022-05-09 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2022-05-09 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return IcMoveInRecordDTO + * @author generator + * @date 2022-05-09 + */ + IcMoveInRecordDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2022-05-09 + */ + void save(IcMoveInRecordDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2022-05-09 + */ + void update(IcMoveInRecordDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2022-05-09 + */ + 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/IcMoveInRecordServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcMoveInRecordServiceImpl.java new file mode 100644 index 0000000000..c2501bfed0 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcMoveInRecordServiceImpl.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.IcMoveInRecordDao; +import com.epmet.dto.IcMoveInRecordDTO; +import com.epmet.entity.IcMoveInRecordEntity; +import com.epmet.service.IcMoveInRecordService; +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-09 + */ +@Service +public class IcMoveInRecordServiceImpl extends BaseServiceImpl implements IcMoveInRecordService { + + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, IcMoveInRecordDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, IcMoveInRecordDTO.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 IcMoveInRecordDTO get(String id) { + IcMoveInRecordEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, IcMoveInRecordDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(IcMoveInRecordDTO dto) { + IcMoveInRecordEntity entity = ConvertUtils.sourceToTarget(dto, IcMoveInRecordEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(IcMoveInRecordDTO dto) { + IcMoveInRecordEntity entity = ConvertUtils.sourceToTarget(dto, IcMoveInRecordEntity.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/IcMoveInRecordDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/IcMoveInRecordDao.xml new file mode 100644 index 0000000000..9e8c575fdd --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/IcMoveInRecordDao.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file