8 changed files with 677 additions and 0 deletions
@ -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; |
|||
|
|||
} |
@ -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<IcMoveInRecordDTO> get(@PathVariable("id") String id){ |
|||
IcMoveInRecordDTO data = icMoveInRecordService.get(id); |
|||
return new Result<IcMoveInRecordDTO>().ok(data); |
|||
} |
|||
|
|||
@RequestMapping("list") |
|||
public Result<PageData<IcMoveInRecordDTO>> page(@RequestParam Map<String, Object> params){ |
|||
PageData<IcMoveInRecordDTO> page = icMoveInRecordService.page(params); |
|||
return new Result<PageData<IcMoveInRecordDTO>>().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<String, Object> params, HttpServletResponse response) throws Exception { |
|||
List<IcMoveInRecordDTO> list = icMoveInRecordService.list(params); |
|||
ExcelUtils.exportExcelToTarget(response, null, list, IcMoveInRecordExcel.class); |
|||
} |
|||
|
|||
|
|||
|
|||
} |
@ -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<IcMoveInRecordEntity> { |
|||
|
|||
} |
@ -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; |
|||
|
|||
} |
@ -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; |
|||
|
|||
|
|||
} |
@ -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<IcMoveInRecordEntity> { |
|||
|
|||
/** |
|||
* 默认分页 |
|||
* |
|||
* @param params |
|||
* @return PageData<IcMoveInRecordDTO> |
|||
* @author generator |
|||
* @date 2022-05-09 |
|||
*/ |
|||
PageData<IcMoveInRecordDTO> page(Map<String, Object> params); |
|||
|
|||
/** |
|||
* 默认查询 |
|||
* |
|||
* @param params |
|||
* @return java.util.List<IcMoveInRecordDTO> |
|||
* @author generator |
|||
* @date 2022-05-09 |
|||
*/ |
|||
List<IcMoveInRecordDTO> list(Map<String, Object> 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); |
|||
} |
@ -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<IcMoveInRecordDao, IcMoveInRecordEntity> implements IcMoveInRecordService { |
|||
|
|||
|
|||
@Override |
|||
public PageData<IcMoveInRecordDTO> page(Map<String, Object> params) { |
|||
IPage<IcMoveInRecordEntity> page = baseDao.selectPage( |
|||
getPage(params, FieldConstant.CREATED_TIME, false), |
|||
getWrapper(params) |
|||
); |
|||
return getPageData(page, IcMoveInRecordDTO.class); |
|||
} |
|||
|
|||
@Override |
|||
public List<IcMoveInRecordDTO> list(Map<String, Object> params) { |
|||
List<IcMoveInRecordEntity> entityList = baseDao.selectList(getWrapper(params)); |
|||
|
|||
return ConvertUtils.sourceToTarget(entityList, IcMoveInRecordDTO.class); |
|||
} |
|||
|
|||
private QueryWrapper<IcMoveInRecordEntity> getWrapper(Map<String, Object> params){ |
|||
String id = (String)params.get(FieldConstant.ID_HUMP); |
|||
|
|||
QueryWrapper<IcMoveInRecordEntity> 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)); |
|||
} |
|||
|
|||
} |
@ -0,0 +1,8 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
|||
|
|||
<mapper namespace="com.epmet.dao.IcMoveInRecordDao"> |
|||
|
|||
|
|||
|
|||
</mapper> |
Loading…
Reference in new issue