57 changed files with 3643 additions and 189 deletions
@ -0,0 +1,42 @@ |
|||||
|
package com.epmet.commons.tools.enums; |
||||
|
|
||||
|
/** |
||||
|
* 组织级别枚举类 |
||||
|
* dev|test|prod |
||||
|
* |
||||
|
* @author jianjun liu |
||||
|
* @date 2020-07-03 11:14 |
||||
|
**/ |
||||
|
public enum HomeMemberOperationEnum { |
||||
|
|
||||
|
|
||||
|
ADD("add", "新增"), |
||||
|
UPDATE("update", "修改"), |
||||
|
DELETE("delele", "删除"); |
||||
|
|
||||
|
|
||||
|
private String code; |
||||
|
private String name; |
||||
|
|
||||
|
|
||||
|
HomeMemberOperationEnum(String code, String name) { |
||||
|
this.code = code; |
||||
|
this.name = name; |
||||
|
} |
||||
|
|
||||
|
public String getCode() { |
||||
|
return code; |
||||
|
} |
||||
|
|
||||
|
public void setCode(String code) { |
||||
|
this.code = code; |
||||
|
} |
||||
|
|
||||
|
public String getName() { |
||||
|
return name; |
||||
|
} |
||||
|
|
||||
|
public void setName(String name) { |
||||
|
this.name = name; |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,40 @@ |
|||||
|
package com.epmet.commons.tools.enums; |
||||
|
|
||||
|
/** |
||||
|
* @describe: 一户一档二维码信息 |
||||
|
* @author wangtong |
||||
|
* @date 2022/6/1 13:34 |
||||
|
* @params |
||||
|
* @return |
||||
|
*/ |
||||
|
public enum HouseQrcodeEnum { |
||||
|
|
||||
|
SUFFIX(".png", "二维码格式的后缀"); |
||||
|
// PREFIX("https://epmet-dev.elinkservice.cn/cqrcode-ty/", "二维码地址的前缀");
|
||||
|
|
||||
|
|
||||
|
private String code; |
||||
|
private String name; |
||||
|
|
||||
|
|
||||
|
HouseQrcodeEnum(String code, String name) { |
||||
|
this.code = code; |
||||
|
this.name = name; |
||||
|
} |
||||
|
|
||||
|
public String getCode() { |
||||
|
return code; |
||||
|
} |
||||
|
|
||||
|
public void setCode(String code) { |
||||
|
this.code = code; |
||||
|
} |
||||
|
|
||||
|
public String getName() { |
||||
|
return name; |
||||
|
} |
||||
|
|
||||
|
public void setName(String name) { |
||||
|
this.name = name; |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,171 @@ |
|||||
|
package com.epmet.commons.tools.utils; |
||||
|
|
||||
|
|
||||
|
import com.google.zxing.BarcodeFormat; |
||||
|
import com.google.zxing.EncodeHintType; |
||||
|
import com.google.zxing.MultiFormatWriter; |
||||
|
import com.google.zxing.WriterException; |
||||
|
import com.google.zxing.client.j2se.MatrixToImageConfig; |
||||
|
import com.google.zxing.client.j2se.MatrixToImageWriter; |
||||
|
import com.google.zxing.common.BitMatrix; |
||||
|
import com.google.zxing.common.CharacterSetECI; |
||||
|
import com.google.zxing.qrcode.decoder.ErrorCorrectionLevel; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
|
||||
|
import javax.imageio.ImageIO; |
||||
|
import java.awt.*; |
||||
|
import java.awt.image.BufferedImage; |
||||
|
import java.io.ByteArrayOutputStream; |
||||
|
import java.io.File; |
||||
|
import java.io.IOException; |
||||
|
import java.util.HashMap; |
||||
|
|
||||
|
/** |
||||
|
* Date: 2022/06/7 10:01 |
||||
|
* Description:房屋一户一码生成工具类 |
||||
|
*/ |
||||
|
@Slf4j |
||||
|
public class HouseQRcodeUtils { |
||||
|
/** |
||||
|
* 二维码颜色 默认是黑色 |
||||
|
*/ |
||||
|
private static final Color QRCOLOR = Color.black; |
||||
|
/** |
||||
|
* 背景颜色 |
||||
|
*/ |
||||
|
private static final Color BGWHITE = Color.white; |
||||
|
public static final int WIDTH = 800; |
||||
|
public static final int HEIGHT = 800; |
||||
|
public static final int MARGIN = 10; |
||||
|
public static final int FONTSIZE = 40; |
||||
|
|
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 房屋一户一码生成-指定像素 |
||||
|
* |
||||
|
* @param contents 说明 |
||||
|
* @return BufferedImage |
||||
|
* @throws Exception |
||||
|
*/ |
||||
|
public static BufferedImage drawHouseQRImage(String pressText, String contents) throws Exception { |
||||
|
BufferedImage qRImage = null; |
||||
|
if (contents == null || "".equals(contents)) { |
||||
|
throw new Exception("content说明不能为空"); |
||||
|
} |
||||
|
// 二维码参数设置
|
||||
|
HashMap<EncodeHintType, Object> hints = new HashMap<>(); |
||||
|
hints.put(EncodeHintType.CHARACTER_SET, CharacterSetECI.UTF8); // 编码设置
|
||||
|
hints.put(EncodeHintType.ERROR_CORRECTION, ErrorCorrectionLevel.H); // 安全等级,最高h
|
||||
|
hints.put(EncodeHintType.MARGIN, MARGIN); // 设置margin=0-10
|
||||
|
|
||||
|
// 二维码图片的生成
|
||||
|
BarcodeFormat format = BarcodeFormat.QR_CODE; |
||||
|
// 创建矩阵容器
|
||||
|
BitMatrix matrix = null; |
||||
|
try { |
||||
|
matrix = new MultiFormatWriter().encode(contents, format, WIDTH, HEIGHT, hints); |
||||
|
} catch (WriterException e) { |
||||
|
log.error("method exception", e); |
||||
|
} |
||||
|
|
||||
|
// 设置矩阵转为图片的参数
|
||||
|
MatrixToImageConfig toImageConfig = new MatrixToImageConfig(QRCOLOR.getRGB(), BGWHITE.getRGB()); |
||||
|
|
||||
|
// 矩阵转换图像
|
||||
|
qRImage = MatrixToImageWriter.toBufferedImage(matrix, toImageConfig); |
||||
|
return pressHouseText(pressText, qRImage); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @param pressText 二维码下方插入文字 |
||||
|
* @param image 需要添加文字的图片 |
||||
|
* @为图片添加文字 |
||||
|
*/ |
||||
|
private static BufferedImage pressHouseText(String pressText, BufferedImage image) throws Exception { |
||||
|
|
||||
|
BufferedImage outImage = new BufferedImage(WIDTH, HEIGHT, BufferedImage.TYPE_INT_RGB); |
||||
|
//计算文字开始的位置
|
||||
|
//x开始的位置:(图片宽度-字体大小*字的个数)/2
|
||||
|
int startX = (WIDTH - (FONTSIZE * pressText.length())) / 2; |
||||
|
//y开始的位置:图片高度-(图片高度-图片宽度)/2
|
||||
|
// int startY = HEIGHT - (HEIGHT - WIDTH) / 2 + FONTSIZE;
|
||||
|
int startY = 740; |
||||
|
|
||||
|
int imageW = outImage.getWidth(); |
||||
|
int imageH = outImage.getHeight(); |
||||
|
Graphics2D g = outImage.createGraphics(); |
||||
|
g.drawImage(image, 0, 0, imageW, imageH, null); |
||||
|
g.setColor(QRCOLOR); |
||||
|
g.setFont(new Font("Noto Sans SC Light", Font.BOLD, FONTSIZE)); |
||||
|
g.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON); |
||||
|
g.setBackground(Color.white); |
||||
|
// 获取文字数量 按照字节展示
|
||||
|
int size = pressText.getBytes("GBK").length; |
||||
|
// 获取一行最多能容纳多少文字 按照文字字节展示
|
||||
|
int maxSize = (WIDTH / FONTSIZE - 2) * 2; |
||||
|
if (size > maxSize) { |
||||
|
int v = size % maxSize; |
||||
|
for (int a = 0; a < (size / maxSize); a++) { |
||||
|
String s = outStringByByte(pressText, maxSize); |
||||
|
g.drawString(s, (WIDTH - (FONTSIZE * (WIDTH / FONTSIZE - 2))) / 2, startY); |
||||
|
pressText = pressText.substring(s.length(), pressText.length()); |
||||
|
startY = startY + 35; |
||||
|
} |
||||
|
if (v != 0) { |
||||
|
g.drawString(pressText, (WIDTH - (FONTSIZE * v)) / 2, startY); |
||||
|
} |
||||
|
} else { |
||||
|
g.drawString(pressText, (WIDTH - ((pressText.getBytes("GBK").length) / 2) * FONTSIZE) / 2, startY); |
||||
|
} |
||||
|
|
||||
|
g.dispose(); |
||||
|
return outImage; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 保存二维码图片到本地 |
||||
|
* |
||||
|
* @param contents |
||||
|
* @throws Exception |
||||
|
*/ |
||||
|
public static void createImg(String pressText, String contents, String filename, String filePath) throws Exception { |
||||
|
BufferedImage qRImageWithLogo = drawHouseQRImage(pressText, contents); |
||||
|
// 写入返回
|
||||
|
ByteArrayOutputStream baos = new ByteArrayOutputStream(); |
||||
|
ImageIO.write(qRImageWithLogo, "jpg", baos); |
||||
|
//图片类型
|
||||
|
String imageType = "jpg"; |
||||
|
//生成二维码存放文件
|
||||
|
File file = new File(filePath + filename + ".jpg"); |
||||
|
if (!file.exists()) { |
||||
|
file.mkdirs(); |
||||
|
} |
||||
|
ImageIO.write(qRImageWithLogo, imageType, file); |
||||
|
baos.close(); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
private static String outStringByByte(String str, int len) throws IOException { |
||||
|
byte[] btf = str.getBytes("GBK"); |
||||
|
int count = 0; |
||||
|
|
||||
|
for (int j = len - 1; j >= 0; j--) { |
||||
|
if (btf[j] < 0) { |
||||
|
count++; |
||||
|
} else { |
||||
|
break; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
if (count % 2 == 0) { |
||||
|
return new String(btf, 0, len, "GBK"); |
||||
|
} else { |
||||
|
return new String(btf, 0, len - 1, "GBK"); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
|
||||
@ -0,0 +1,39 @@ |
|||||
|
package com.epmet.dto; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2022-06-01 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class IcHouseCodeInfoDTO implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** |
||||
|
* 客户id |
||||
|
*/ |
||||
|
private String customerId; |
||||
|
|
||||
|
/** |
||||
|
* 所属楼栋id |
||||
|
*/ |
||||
|
private String buildingId; |
||||
|
|
||||
|
/** |
||||
|
* 最大的楼栋编码序列号 |
||||
|
*/ |
||||
|
private String buildingMaxNum; |
||||
|
|
||||
|
/** |
||||
|
* 该楼栋下最大的房屋编码序列号 |
||||
|
*/ |
||||
|
private String houseMaxNum; |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,19 @@ |
|||||
|
package com.epmet.dto.form; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import javax.validation.constraints.NotNull; |
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
/** |
||||
|
* @program: epmet-cloud |
||||
|
* @description: |
||||
|
* @author: wangtong |
||||
|
* @create: 2022-06-01 13:44 |
||||
|
**/ |
||||
|
@Data |
||||
|
public class HouseQrcodeFormDTO implements Serializable { |
||||
|
|
||||
|
@NotNull(message = "id不可为空") |
||||
|
private String id; |
||||
|
} |
||||
@ -0,0 +1,26 @@ |
|||||
|
package com.epmet.dto.form; |
||||
|
|
||||
|
import com.epmet.commons.tools.dto.form.PageFormDTO; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import javax.validation.constraints.NotNull; |
||||
|
|
||||
|
/** |
||||
|
* @describe: 根据房屋编码获取房屋信息 |
||||
|
* @author wangtong |
||||
|
* @date 2022/6/1 18:17 |
||||
|
* @params |
||||
|
* @return |
||||
|
*/ |
||||
|
@Data |
||||
|
public class IcHouseInfoFormDTO extends PageFormDTO { |
||||
|
|
||||
|
private static final long serialVersionUID = -1L; |
||||
|
|
||||
|
|
||||
|
@NotNull(message = "房屋编码不可为空") |
||||
|
private String houseCode; |
||||
|
|
||||
|
private String customerId; |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,28 @@ |
|||||
|
package com.epmet.dto.form; |
||||
|
|
||||
|
import com.epmet.commons.tools.dto.form.PageFormDTO; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import javax.validation.constraints.NotNull; |
||||
|
|
||||
|
/** |
||||
|
* @describe: 根据房屋编码获取房屋信息 |
||||
|
* @author wangtong |
||||
|
* @date 2022/6/1 18:17 |
||||
|
* @params |
||||
|
* @return |
||||
|
*/ |
||||
|
@Data |
||||
|
public class TestFormDTO extends PageFormDTO { |
||||
|
|
||||
|
private static final long serialVersionUID = -1L; |
||||
|
|
||||
|
private String buildingId; |
||||
|
|
||||
|
private String customerId; |
||||
|
|
||||
|
private String areaCode; |
||||
|
|
||||
|
private String houseId; |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,37 @@ |
|||||
|
package com.epmet.dto.result; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
/** |
||||
|
* @program: epmet-cloud |
||||
|
* @description: |
||||
|
* @author: wangtong |
||||
|
* @create: 2022-06-06 15:08 |
||||
|
**/ |
||||
|
@Data |
||||
|
public class CreateHouseCodeAndUrlDTO implements Serializable { |
||||
|
|
||||
|
/** |
||||
|
* 房屋id |
||||
|
*/ |
||||
|
private String houseId; |
||||
|
|
||||
|
/** |
||||
|
* 客户id |
||||
|
*/ |
||||
|
private String customerId; |
||||
|
|
||||
|
/** |
||||
|
* 楼栋id |
||||
|
*/ |
||||
|
private String buildingId; |
||||
|
|
||||
|
/** |
||||
|
* 区划代码 |
||||
|
*/ |
||||
|
private String areaCode; |
||||
|
|
||||
|
|
||||
|
} |
||||
@ -0,0 +1,65 @@ |
|||||
|
|
||||
|
package com.epmet.dto.result; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
/** |
||||
|
* desc:房屋列表结果类 |
||||
|
* |
||||
|
* @author liujianjun |
||||
|
*/ |
||||
|
@Data |
||||
|
public class IcHouseInfoResultDTO implements Serializable { |
||||
|
|
||||
|
|
||||
|
private static final long serialVersionUID = 4963952996288796744L; |
||||
|
|
||||
|
/** |
||||
|
* 所属网格 |
||||
|
*/ |
||||
|
private String gridName; |
||||
|
private String gridId; |
||||
|
|
||||
|
/** |
||||
|
* 所属小区 |
||||
|
*/ |
||||
|
private String neighborHoodId; |
||||
|
private String neighborHoodName; |
||||
|
|
||||
|
/** |
||||
|
* 所属楼栋 |
||||
|
*/ |
||||
|
private String buildingId; |
||||
|
private String buildingName; |
||||
|
|
||||
|
/** |
||||
|
* 所属单元id |
||||
|
*/ |
||||
|
private String buildingUnitId; |
||||
|
private String unitName; |
||||
|
|
||||
|
/** |
||||
|
* 房间名称 |
||||
|
*/ |
||||
|
private String houseName; |
||||
|
|
||||
|
/** |
||||
|
* 门牌号 |
||||
|
*/ |
||||
|
private String doorName; |
||||
|
|
||||
|
/** |
||||
|
* 房屋id |
||||
|
*/ |
||||
|
private String houseId; |
||||
|
|
||||
|
/** |
||||
|
* 客户id |
||||
|
*/ |
||||
|
private String customerId; |
||||
|
|
||||
|
|
||||
|
|
||||
|
} |
||||
@ -0,0 +1,82 @@ |
|||||
|
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.UpdateGroup; |
||||
|
import com.epmet.commons.tools.validator.group.DefaultGroup; |
||||
|
import com.epmet.dto.IcHouseCodeInfoDTO; |
||||
|
import com.epmet.excel.IcHouseCodeInfoExcel; |
||||
|
import com.epmet.service.IcHouseCodeInfoService; |
||||
|
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-06-01 |
||||
|
*/ |
||||
|
@RestController |
||||
|
@RequestMapping("icHouseCodeInfo") |
||||
|
public class IcHouseCodeInfoController { |
||||
|
|
||||
|
@Autowired |
||||
|
private IcHouseCodeInfoService icHouseCodeInfoService; |
||||
|
|
||||
|
@RequestMapping("page") |
||||
|
public Result<PageData<IcHouseCodeInfoDTO>> page(@RequestParam Map<String, Object> params){ |
||||
|
PageData<IcHouseCodeInfoDTO> page = icHouseCodeInfoService.page(params); |
||||
|
return new Result<PageData<IcHouseCodeInfoDTO>>().ok(page); |
||||
|
} |
||||
|
|
||||
|
@RequestMapping(value = "{id}",method = {RequestMethod.POST,RequestMethod.GET}) |
||||
|
public Result<IcHouseCodeInfoDTO> get(@PathVariable("id") String id){ |
||||
|
IcHouseCodeInfoDTO data = icHouseCodeInfoService.get(id); |
||||
|
return new Result<IcHouseCodeInfoDTO>().ok(data); |
||||
|
} |
||||
|
|
||||
|
@NoRepeatSubmit |
||||
|
@PostMapping("save") |
||||
|
public Result save(@RequestBody IcHouseCodeInfoDTO dto){ |
||||
|
//效验数据
|
||||
|
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); |
||||
|
icHouseCodeInfoService.save(dto); |
||||
|
return new Result(); |
||||
|
} |
||||
|
|
||||
|
@NoRepeatSubmit |
||||
|
@PostMapping("update") |
||||
|
public Result update(@RequestBody IcHouseCodeInfoDTO dto){ |
||||
|
//效验数据
|
||||
|
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); |
||||
|
icHouseCodeInfoService.update(dto); |
||||
|
return new Result(); |
||||
|
} |
||||
|
|
||||
|
@PostMapping("delete") |
||||
|
public Result delete(@RequestBody String[] ids){ |
||||
|
//效验数据
|
||||
|
AssertUtils.isArrayEmpty(ids, "id"); |
||||
|
icHouseCodeInfoService.delete(ids); |
||||
|
return new Result(); |
||||
|
} |
||||
|
|
||||
|
@GetMapping("export") |
||||
|
public void export(@RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception { |
||||
|
List<IcHouseCodeInfoDTO> list = icHouseCodeInfoService.list(params); |
||||
|
ExcelUtils.exportExcelToTarget(response, null, list, IcHouseCodeInfoExcel.class); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
} |
||||
@ -0,0 +1,43 @@ |
|||||
|
package com.epmet.dao; |
||||
|
|
||||
|
import com.epmet.commons.mybatis.dao.BaseDao; |
||||
|
import com.epmet.entity.IcHouseCodeInfoEntity; |
||||
|
import org.apache.ibatis.annotations.Mapper; |
||||
|
import org.apache.ibatis.annotations.Param; |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2022-06-01 |
||||
|
*/ |
||||
|
@Mapper |
||||
|
public interface IcHouseCodeInfoDao extends BaseDao<IcHouseCodeInfoEntity> { |
||||
|
|
||||
|
/** |
||||
|
* @describe: 通过客户id和楼栋id查询 |
||||
|
* @author wangtong |
||||
|
* @date 2022/6/1 17:01 |
||||
|
* @params [customerId, buildingId] |
||||
|
* @return com.epmet.entity.IcHouseCodeInfoEntity |
||||
|
*/ |
||||
|
IcHouseCodeInfoEntity selectByCuIdAndBuilId(@Param("customerId") String customerId,@Param("buildingId") String buildingId); |
||||
|
|
||||
|
/** |
||||
|
* @describe: 查询数据库里最大的楼栋编号 |
||||
|
* @author wangtong |
||||
|
* @date 2022/6/1 17:15 |
||||
|
* @params [] |
||||
|
* @return com.epmet.entity.IcHouseCodeInfoEntity |
||||
|
*/ |
||||
|
IcHouseCodeInfoEntity selectMaxHouseMaxNum(); |
||||
|
|
||||
|
/** |
||||
|
* @describe: 根据客户id和楼栋id更新房屋最大编码 |
||||
|
* @author wangtong |
||||
|
* @date 2022/6/2 9:37 |
||||
|
* @params [codeEntity] |
||||
|
* @return void |
||||
|
*/ |
||||
|
void updateByCuIdAndBuId(IcHouseCodeInfoEntity codeEntity); |
||||
|
} |
||||
@ -0,0 +1,40 @@ |
|||||
|
package com.epmet.entity; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||
|
import lombok.Data; |
||||
|
import lombok.EqualsAndHashCode; |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2022-06-01 |
||||
|
*/ |
||||
|
@Data |
||||
|
@EqualsAndHashCode(callSuper=false) |
||||
|
@TableName("ic_house_code_info") |
||||
|
public class IcHouseCodeInfoEntity { |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** |
||||
|
* 客户id |
||||
|
*/ |
||||
|
private String customerId; |
||||
|
|
||||
|
/** |
||||
|
* 所属楼栋id |
||||
|
*/ |
||||
|
private String buildingId; |
||||
|
|
||||
|
/** |
||||
|
* 最大的楼栋编码序列号 |
||||
|
*/ |
||||
|
private String buildingMaxNum; |
||||
|
|
||||
|
/** |
||||
|
* 该楼栋下最大的房屋编码序列号 |
||||
|
*/ |
||||
|
private String houseMaxNum; |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,30 @@ |
|||||
|
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-06-01 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class IcHouseCodeInfoExcel { |
||||
|
|
||||
|
@Excel(name = "客户id") |
||||
|
private String customerId; |
||||
|
|
||||
|
@Excel(name = "所属楼栋id") |
||||
|
private String buildingId; |
||||
|
|
||||
|
@Excel(name = "最大的楼栋编码序列号") |
||||
|
private Integer buildingMaxNum; |
||||
|
|
||||
|
@Excel(name = "该楼栋下最大的房屋编码序列号") |
||||
|
private Integer houseMaxNum; |
||||
|
|
||||
|
|
||||
|
} |
||||
@ -0,0 +1,30 @@ |
|||||
|
package com.epmet.redis; |
||||
|
|
||||
|
import com.epmet.commons.tools.redis.RedisUtils; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.stereotype.Component; |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2022-06-01 |
||||
|
*/ |
||||
|
@Component |
||||
|
public class IcHouseCodeInfoRedis { |
||||
|
@Autowired |
||||
|
private RedisUtils redisUtils; |
||||
|
|
||||
|
public void delete(Object[] ids) { |
||||
|
|
||||
|
} |
||||
|
|
||||
|
public void set(){ |
||||
|
|
||||
|
} |
||||
|
|
||||
|
public String get(String id){ |
||||
|
return null; |
||||
|
} |
||||
|
|
||||
|
} |
||||
@ -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.IcHouseCodeInfoDTO; |
||||
|
import com.epmet.entity.IcHouseCodeInfoEntity; |
||||
|
|
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2022-06-01 |
||||
|
*/ |
||||
|
public interface IcHouseCodeInfoService extends BaseService<IcHouseCodeInfoEntity> { |
||||
|
|
||||
|
/** |
||||
|
* 默认分页 |
||||
|
* |
||||
|
* @param params |
||||
|
* @return PageData<IcHouseCodeInfoDTO> |
||||
|
* @author generator |
||||
|
* @date 2022-06-01 |
||||
|
*/ |
||||
|
PageData<IcHouseCodeInfoDTO> page(Map<String, Object> params); |
||||
|
|
||||
|
/** |
||||
|
* 默认查询 |
||||
|
* |
||||
|
* @param params |
||||
|
* @return java.util.List<IcHouseCodeInfoDTO> |
||||
|
* @author generator |
||||
|
* @date 2022-06-01 |
||||
|
*/ |
||||
|
List<IcHouseCodeInfoDTO> list(Map<String, Object> params); |
||||
|
|
||||
|
/** |
||||
|
* 单条查询 |
||||
|
* |
||||
|
* @param id |
||||
|
* @return IcHouseCodeInfoDTO |
||||
|
* @author generator |
||||
|
* @date 2022-06-01 |
||||
|
*/ |
||||
|
IcHouseCodeInfoDTO get(String id); |
||||
|
|
||||
|
/** |
||||
|
* 默认保存 |
||||
|
* |
||||
|
* @param dto |
||||
|
* @return void |
||||
|
* @author generator |
||||
|
* @date 2022-06-01 |
||||
|
*/ |
||||
|
void save(IcHouseCodeInfoDTO dto); |
||||
|
|
||||
|
/** |
||||
|
* 默认更新 |
||||
|
* |
||||
|
* @param dto |
||||
|
* @return void |
||||
|
* @author generator |
||||
|
* @date 2022-06-01 |
||||
|
*/ |
||||
|
void update(IcHouseCodeInfoDTO dto); |
||||
|
|
||||
|
/** |
||||
|
* 批量删除 |
||||
|
* |
||||
|
* @param ids |
||||
|
* @return void |
||||
|
* @author generator |
||||
|
* @date 2022-06-01 |
||||
|
*/ |
||||
|
void delete(String[] ids); |
||||
|
} |
||||
@ -0,0 +1,87 @@ |
|||||
|
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.IcHouseCodeInfoDao; |
||||
|
import com.epmet.dto.IcHouseCodeInfoDTO; |
||||
|
import com.epmet.entity.IcHouseCodeInfoEntity; |
||||
|
import com.epmet.redis.IcHouseCodeInfoRedis; |
||||
|
import com.epmet.service.IcHouseCodeInfoService; |
||||
|
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-06-01 |
||||
|
*/ |
||||
|
@Service |
||||
|
public class IcHouseCodeInfoServiceImpl extends BaseServiceImpl<IcHouseCodeInfoDao, IcHouseCodeInfoEntity> implements IcHouseCodeInfoService { |
||||
|
|
||||
|
@Autowired |
||||
|
private IcHouseCodeInfoRedis icHouseCodeInfoRedis; |
||||
|
|
||||
|
@Override |
||||
|
public PageData<IcHouseCodeInfoDTO> page(Map<String, Object> params) { |
||||
|
IPage<IcHouseCodeInfoEntity> page = baseDao.selectPage( |
||||
|
getPage(params, FieldConstant.CREATED_TIME, false), |
||||
|
getWrapper(params) |
||||
|
); |
||||
|
return getPageData(page, IcHouseCodeInfoDTO.class); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public List<IcHouseCodeInfoDTO> list(Map<String, Object> params) { |
||||
|
List<IcHouseCodeInfoEntity> entityList = baseDao.selectList(getWrapper(params)); |
||||
|
|
||||
|
return ConvertUtils.sourceToTarget(entityList, IcHouseCodeInfoDTO.class); |
||||
|
} |
||||
|
|
||||
|
private QueryWrapper<IcHouseCodeInfoEntity> getWrapper(Map<String, Object> params){ |
||||
|
String id = (String)params.get(FieldConstant.ID_HUMP); |
||||
|
|
||||
|
QueryWrapper<IcHouseCodeInfoEntity> wrapper = new QueryWrapper<>(); |
||||
|
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); |
||||
|
|
||||
|
return wrapper; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public IcHouseCodeInfoDTO get(String id) { |
||||
|
IcHouseCodeInfoEntity entity = baseDao.selectById(id); |
||||
|
return ConvertUtils.sourceToTarget(entity, IcHouseCodeInfoDTO.class); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
public void save(IcHouseCodeInfoDTO dto) { |
||||
|
IcHouseCodeInfoEntity entity = ConvertUtils.sourceToTarget(dto, IcHouseCodeInfoEntity.class); |
||||
|
insert(entity); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
public void update(IcHouseCodeInfoDTO dto) { |
||||
|
IcHouseCodeInfoEntity entity = ConvertUtils.sourceToTarget(dto, IcHouseCodeInfoEntity.class); |
||||
|
updateById(entity); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
public void delete(String[] ids) { |
||||
|
// 逻辑删除(@TableLogic 注解)
|
||||
|
baseDao.deleteBatchIds(Arrays.asList(ids)); |
||||
|
} |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,64 @@ |
|||||
|
package com.epmet.util; |
||||
|
|
||||
|
import org.springframework.web.multipart.MultipartFile; |
||||
|
|
||||
|
import java.io.*; |
||||
|
|
||||
|
public class ConvertToMultipartFile implements MultipartFile { |
||||
|
private byte[] fileBytes; |
||||
|
String name; |
||||
|
String originalFilename; |
||||
|
String contentType; |
||||
|
boolean isEmpty; |
||||
|
long size; |
||||
|
|
||||
|
public ConvertToMultipartFile(byte[] fileBytes, String name, String originalFilename, String contentType, |
||||
|
long size) { |
||||
|
this.fileBytes = fileBytes; |
||||
|
this.name = name; |
||||
|
this.originalFilename = originalFilename; |
||||
|
this.contentType = contentType; |
||||
|
this.size = size; |
||||
|
this.isEmpty = false; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public String getName() { |
||||
|
return name; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public String getOriginalFilename() { |
||||
|
return originalFilename; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public String getContentType() { |
||||
|
return contentType; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public boolean isEmpty() { |
||||
|
return isEmpty; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public long getSize() { |
||||
|
return size; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public byte[] getBytes() throws IOException { |
||||
|
return fileBytes; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public InputStream getInputStream() throws IOException { |
||||
|
return new ByteArrayInputStream(fileBytes); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public void transferTo(File dest) throws IOException, IllegalStateException { |
||||
|
new FileOutputStream(dest).write(fileBytes); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,10 @@ |
|||||
|
alter table ic_house add COLUMN `HOUSE_CODE` varchar(32) DEFAULT NULL COMMENT '房屋编码'; |
||||
|
alter table ic_house add COLUMN `HOUSE_QRCODE_URL` varchar(255) DEFAULT NULL COMMENT '一户一码的二维码地址'; |
||||
|
|
||||
|
|
||||
|
CREATE TABLE `ic_house_code_info` ( |
||||
|
`CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户id', |
||||
|
`BUILDING_ID` varchar(64) NOT NULL COMMENT '所属楼栋id', |
||||
|
`BUILDING_MAX_NUM` varchar(10) NOT NULL COMMENT '最大的楼栋编码序列号', |
||||
|
`HOUSE_MAX_NUM` varchar(10) NOT NULL COMMENT '该楼栋下最大的房屋编码序列号' |
||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='房屋编码辅助表'; |
||||
@ -0,0 +1,30 @@ |
|||||
|
<?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.IcHouseCodeInfoDao"> |
||||
|
|
||||
|
<resultMap type="com.epmet.entity.IcHouseCodeInfoEntity" id="icHouseCodeInfoMap"> |
||||
|
<result property="customerId" column="CUSTOMER_ID"/> |
||||
|
<result property="buildingId" column="BUILDING_ID"/> |
||||
|
<result property="buildingMaxNum" column="BUILDING_MAX_NUM"/> |
||||
|
<result property="houseMaxNum" column="HOUSE_MAX_NUM"/> |
||||
|
</resultMap> |
||||
|
<select id="selectByCuIdAndBuilId" resultType="com.epmet.entity.IcHouseCodeInfoEntity"> |
||||
|
select * from ic_house_code_info |
||||
|
where CUSTOMER_ID=#{customerId} |
||||
|
and BUILDING_ID=#{buildingId} |
||||
|
</select> |
||||
|
<select id="selectMaxHouseMaxNum" resultType="com.epmet.entity.IcHouseCodeInfoEntity"> |
||||
|
select * from ic_house_code_info |
||||
|
order by BUILDING_MAX_NUM desc |
||||
|
limit 1 |
||||
|
</select> |
||||
|
<update id="updateByCuIdAndBuId"> |
||||
|
update ic_house_code_info |
||||
|
set HOUSE_MAX_NUM=#{houseMaxNum} |
||||
|
where CUSTOMER_ID = #{customerId} |
||||
|
and BUILDING_ID = #{buildingId} |
||||
|
</update> |
||||
|
|
||||
|
|
||||
|
</mapper> |
||||
@ -0,0 +1,190 @@ |
|||||
|
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-06-01 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class IcResiUserConfirmDTO 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; |
||||
|
|
||||
|
/** |
||||
|
* 姓 |
||||
|
*/ |
||||
|
private String surname; |
||||
|
|
||||
|
/** |
||||
|
* 名 |
||||
|
*/ |
||||
|
private String name; |
||||
|
|
||||
|
/** |
||||
|
* 手机号 |
||||
|
*/ |
||||
|
private String mobile; |
||||
|
|
||||
|
/** |
||||
|
* 性别 |
||||
|
*/ |
||||
|
private String gender; |
||||
|
|
||||
|
/** |
||||
|
* 身份证号 |
||||
|
*/ |
||||
|
private String idCard; |
||||
|
|
||||
|
/** |
||||
|
* 出生日期 |
||||
|
*/ |
||||
|
private String birthday; |
||||
|
|
||||
|
/** |
||||
|
* 户籍所在地 |
||||
|
*/ |
||||
|
private String hjszd; |
||||
|
|
||||
|
/** |
||||
|
* 户籍所在地地区码 |
||||
|
*/ |
||||
|
private String hjszdCode; |
||||
|
|
||||
|
/** |
||||
|
* 户籍所在地层级编码 |
||||
|
*/ |
||||
|
private String hjszdPathCode; |
||||
|
|
||||
|
/** |
||||
|
* 现居住地 |
||||
|
*/ |
||||
|
private String xjzd; |
||||
|
|
||||
|
/** |
||||
|
* 现居住地地区码 |
||||
|
*/ |
||||
|
private String xjzdCode; |
||||
|
|
||||
|
/** |
||||
|
* 现居住地层级编码 |
||||
|
*/ |
||||
|
private String xjzdPathCode; |
||||
|
|
||||
|
/** |
||||
|
* 详细地址 |
||||
|
*/ |
||||
|
private String xxdz; |
||||
|
|
||||
|
/** |
||||
|
* 民族【字典表】 |
||||
|
*/ |
||||
|
private String mz; |
||||
|
|
||||
|
/** |
||||
|
* 名族名称 |
||||
|
*/ |
||||
|
private String mzName; |
||||
|
|
||||
|
/** |
||||
|
* 与户主关系 |
||||
|
*/ |
||||
|
private String yhzgx; |
||||
|
|
||||
|
/** |
||||
|
* 与户主关系名称 |
||||
|
*/ |
||||
|
private String yhzgxName; |
||||
|
|
||||
|
/** |
||||
|
* 审核状态0未审核,1审核通过,2审核不通过 |
||||
|
*/ |
||||
|
private String confirmResult; |
||||
|
|
||||
|
/** |
||||
|
* 审核不通过的原因 |
||||
|
*/ |
||||
|
private String reason; |
||||
|
|
||||
|
/** |
||||
|
* 删除标识 0.未删除 1.已删除 |
||||
|
*/ |
||||
|
private Integer delFlag; |
||||
|
|
||||
|
/** |
||||
|
* 乐观锁 |
||||
|
*/ |
||||
|
private Integer revision; |
||||
|
|
||||
|
/** |
||||
|
* 创建人 |
||||
|
*/ |
||||
|
private String createdBy; |
||||
|
|
||||
|
/** |
||||
|
* 创建时间 |
||||
|
*/ |
||||
|
private Date createdTime; |
||||
|
|
||||
|
/** |
||||
|
* 更新人 |
||||
|
*/ |
||||
|
private String updatedBy; |
||||
|
|
||||
|
/** |
||||
|
* 更新时间 |
||||
|
*/ |
||||
|
private Date updatedTime; |
||||
|
|
||||
|
/** |
||||
|
* ic_resi_user表id |
||||
|
*/ |
||||
|
private String icResiUserId; |
||||
|
|
||||
|
/** |
||||
|
* 操作类型:新增add 修改 update 删除 delete |
||||
|
*/ |
||||
|
private String submitType; |
||||
|
|
||||
|
/** |
||||
|
* 删除原因 |
||||
|
*/ |
||||
|
private String deleteReason; |
||||
|
|
||||
|
/** |
||||
|
* 操作说明 |
||||
|
*/ |
||||
|
private String operationDescribe; |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,25 @@ |
|||||
|
package com.epmet.dto.form; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
import java.util.Date; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 查询家庭成员信息 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2022-06-01 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class IcResiUserConfirmGetDTO implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** |
||||
|
* ic_resi_user表id |
||||
|
*/ |
||||
|
private String icResiUserId; |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,210 @@ |
|||||
|
package com.epmet.dto.form; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
import java.util.Date; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 居民信息审核表 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2022-06-01 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class IcResiUserConfirmSubmitDTO 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 surname; |
||||
|
|
||||
|
/** |
||||
|
* 姓名 |
||||
|
*/ |
||||
|
private String name; |
||||
|
|
||||
|
/** |
||||
|
* 手机号 |
||||
|
*/ |
||||
|
private String mobile; |
||||
|
|
||||
|
/** |
||||
|
* 性别 |
||||
|
*/ |
||||
|
private String gender; |
||||
|
|
||||
|
/** |
||||
|
* 身份证号 |
||||
|
*/ |
||||
|
private String idCard; |
||||
|
|
||||
|
/** |
||||
|
* 出生日期 |
||||
|
*/ |
||||
|
private String birthday; |
||||
|
|
||||
|
/** |
||||
|
* 户籍所在地 |
||||
|
*/ |
||||
|
private String hjszd; |
||||
|
|
||||
|
/** |
||||
|
* 户籍所在地地区码 |
||||
|
*/ |
||||
|
private String hjszdCode; |
||||
|
|
||||
|
/** |
||||
|
* 户籍所在地层级编码 |
||||
|
*/ |
||||
|
private String hjszdPathCode; |
||||
|
|
||||
|
/** |
||||
|
* 现居住地 |
||||
|
*/ |
||||
|
private String xjzd; |
||||
|
|
||||
|
/** |
||||
|
* 现居住地地区码 |
||||
|
*/ |
||||
|
private String xjzdCode; |
||||
|
|
||||
|
/** |
||||
|
* 现居住地层级编码 |
||||
|
*/ |
||||
|
private String xjzdPathCode; |
||||
|
|
||||
|
/** |
||||
|
* 详细地址 |
||||
|
*/ |
||||
|
private String xxdz; |
||||
|
|
||||
|
/** |
||||
|
* 民族【字典表】 |
||||
|
*/ |
||||
|
private String mz; |
||||
|
|
||||
|
/** |
||||
|
* 名族名称 |
||||
|
*/ |
||||
|
private String mzName; |
||||
|
|
||||
|
/** |
||||
|
* 与户主关系 |
||||
|
*/ |
||||
|
private String yhzgx; |
||||
|
|
||||
|
/** |
||||
|
* 与户主关系名称 |
||||
|
*/ |
||||
|
private String yhzgxName; |
||||
|
|
||||
|
/** |
||||
|
* 审核状态0未审核,1审核通过,2审核不通过 |
||||
|
*/ |
||||
|
private String confirmResult; |
||||
|
|
||||
|
/** |
||||
|
* 审核不通过的原因 |
||||
|
*/ |
||||
|
private String reason; |
||||
|
|
||||
|
/** |
||||
|
* 删除标识 0.未删除 1.已删除 |
||||
|
*/ |
||||
|
private Integer delFlag; |
||||
|
|
||||
|
/** |
||||
|
* 乐观锁 |
||||
|
*/ |
||||
|
private Integer revision; |
||||
|
|
||||
|
/** |
||||
|
* 创建人 |
||||
|
*/ |
||||
|
private String createdBy; |
||||
|
|
||||
|
/** |
||||
|
* 创建时间 |
||||
|
*/ |
||||
|
private Date createdTime; |
||||
|
|
||||
|
/** |
||||
|
* 更新人 |
||||
|
*/ |
||||
|
private String updatedBy; |
||||
|
|
||||
|
/** |
||||
|
* 更新时间 |
||||
|
*/ |
||||
|
private Date updatedTime; |
||||
|
|
||||
|
/** |
||||
|
* ic_resi_user表id |
||||
|
*/ |
||||
|
private String icResiUserId; |
||||
|
|
||||
|
/** |
||||
|
* 操作类型:新增add 修改 update 删除 delete |
||||
|
*/ |
||||
|
private String submitType; |
||||
|
|
||||
|
/** |
||||
|
* 删除原因 |
||||
|
*/ |
||||
|
private String deleteReason; |
||||
|
|
||||
|
/** |
||||
|
* 操作说明 |
||||
|
*/ |
||||
|
private String operationDescribe; |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,70 @@ |
|||||
|
package com.epmet.dto.form; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
import lombok.NoArgsConstructor; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
/** |
||||
|
* @Description |
||||
|
* @Author zhaoqifeng |
||||
|
* @Date 2022/6/1 9:39 |
||||
|
*/ |
||||
|
@NoArgsConstructor |
||||
|
@Data |
||||
|
public class RegisterAndBindFormDTO implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = 7068763631425911170L; |
||||
|
private String customerId; |
||||
|
private String userId; |
||||
|
/** |
||||
|
* 姓 |
||||
|
*/ |
||||
|
private String surname; |
||||
|
/** |
||||
|
* 名 |
||||
|
*/ |
||||
|
private String name; |
||||
|
/** |
||||
|
* 昵称 |
||||
|
*/ |
||||
|
private String nickname; |
||||
|
/** |
||||
|
* 头像 |
||||
|
*/ |
||||
|
private String headImgUrl; |
||||
|
/** |
||||
|
* 身份证 |
||||
|
*/ |
||||
|
private String idCard; |
||||
|
/** |
||||
|
* 手机号 |
||||
|
*/ |
||||
|
private String mobile; |
||||
|
/** |
||||
|
* 网格 |
||||
|
*/ |
||||
|
private String gridId; |
||||
|
/** |
||||
|
* 小区 |
||||
|
*/ |
||||
|
private String villageId; |
||||
|
/** |
||||
|
* 楼栋 |
||||
|
*/ |
||||
|
private String buildId; |
||||
|
/** |
||||
|
* 单元 |
||||
|
*/ |
||||
|
private String unitId; |
||||
|
/** |
||||
|
* 房屋 |
||||
|
*/ |
||||
|
private String homeId; |
||||
|
/** |
||||
|
* 路牌号 |
||||
|
*/ |
||||
|
private String address; |
||||
|
|
||||
|
private String visitId; |
||||
|
} |
||||
@ -0,0 +1,22 @@ |
|||||
|
package com.epmet.dto.result; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
import lombok.NoArgsConstructor; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
/** |
||||
|
* @Description |
||||
|
* @Author zhaoqifeng |
||||
|
* @Date 2022/6/1 16:49 |
||||
|
*/ |
||||
|
@NoArgsConstructor |
||||
|
@Data |
||||
|
public class HomeInfoResultDTO implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = -6109420020924607393L; |
||||
|
private String icResiUserId; |
||||
|
private String houseName; |
||||
|
private String houseCode; |
||||
|
private String qrCodeUrl; |
||||
|
} |
||||
@ -0,0 +1,95 @@ |
|||||
|
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.IcResiUserConfirmDTO; |
||||
|
import com.epmet.excel.IcResiUserConfirmExcel; |
||||
|
import com.epmet.service.IcResiUserConfirmService; |
||||
|
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-06-01 |
||||
|
*/ |
||||
|
@RestController |
||||
|
@RequestMapping("icResiUserConfirm") |
||||
|
public class IcResiUserConfirmController { |
||||
|
|
||||
|
@Autowired |
||||
|
private IcResiUserConfirmService icResiUserConfirmService; |
||||
|
|
||||
|
@RequestMapping("page") |
||||
|
public Result<PageData<IcResiUserConfirmDTO>> page(@RequestParam Map<String, Object> params){ |
||||
|
PageData<IcResiUserConfirmDTO> page = icResiUserConfirmService.page(params); |
||||
|
return new Result<PageData<IcResiUserConfirmDTO>>().ok(page); |
||||
|
} |
||||
|
|
||||
|
@RequestMapping(value = "{id}",method = {RequestMethod.POST,RequestMethod.GET}) |
||||
|
public Result<IcResiUserConfirmDTO> get(@PathVariable("id") String id){ |
||||
|
IcResiUserConfirmDTO data = icResiUserConfirmService.get(id); |
||||
|
return new Result<IcResiUserConfirmDTO>().ok(data); |
||||
|
} |
||||
|
|
||||
|
@NoRepeatSubmit |
||||
|
@PostMapping("save") |
||||
|
public Result save(@RequestBody IcResiUserConfirmDTO dto){ |
||||
|
//效验数据
|
||||
|
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); |
||||
|
icResiUserConfirmService.save(dto); |
||||
|
return new Result(); |
||||
|
} |
||||
|
|
||||
|
@NoRepeatSubmit |
||||
|
@PostMapping("update") |
||||
|
public Result update(@RequestBody IcResiUserConfirmDTO dto){ |
||||
|
//效验数据
|
||||
|
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); |
||||
|
icResiUserConfirmService.update(dto); |
||||
|
return new Result(); |
||||
|
} |
||||
|
|
||||
|
@PostMapping("delete") |
||||
|
public Result delete(@RequestBody String[] ids){ |
||||
|
//效验数据
|
||||
|
AssertUtils.isArrayEmpty(ids, "id"); |
||||
|
icResiUserConfirmService.delete(ids); |
||||
|
return new Result(); |
||||
|
} |
||||
|
|
||||
|
@GetMapping("export") |
||||
|
public void export(@RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception { |
||||
|
List<IcResiUserConfirmDTO> list = icResiUserConfirmService.list(params); |
||||
|
ExcelUtils.exportExcelToTarget(response, null, list, IcResiUserConfirmExcel.class); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 审核 |
||||
|
* |
||||
|
* @Param tokenDto |
||||
|
* @Return {@link Result} |
||||
|
* @Author zhaoqifeng |
||||
|
* @Date 2022/6/1 17:26 |
||||
|
*/ |
||||
|
@PostMapping("confirm") |
||||
|
public Result confirm(@RequestBody IcResiUserConfirmDTO dto) { |
||||
|
icResiUserConfirmService.confirm(dto); |
||||
|
return new Result(); |
||||
|
} |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,162 @@ |
|||||
|
package com.epmet.controller; |
||||
|
|
||||
|
import com.epmet.commons.tools.annotation.LoginUser; |
||||
|
import com.epmet.commons.tools.enums.HomeMemberOperationEnum; |
||||
|
import com.epmet.commons.tools.security.dto.TokenDto; |
||||
|
import com.epmet.commons.tools.utils.Result; |
||||
|
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.dto.IcResiUserConfirmDTO; |
||||
|
import com.epmet.dto.form.IcResiUserConfirmGetDTO; |
||||
|
import com.epmet.dto.form.IcResiUserConfirmSubmitDTO; |
||||
|
import com.epmet.dto.form.RegisterAndBindFormDTO; |
||||
|
import com.epmet.dto.result.HomeInfoResultDTO; |
||||
|
import com.epmet.dto.result.HomeUserBriefResultDTO; |
||||
|
import com.epmet.service.IcResiUserConfirmService; |
||||
|
import com.epmet.service.IcResiUserService; |
||||
|
import com.epmet.service.MyHomeService; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.web.bind.annotation.*; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* @Description |
||||
|
* @Author zhaoqifeng |
||||
|
* @Date 2022/5/31 16:20 |
||||
|
*/ |
||||
|
@Slf4j |
||||
|
@RestController |
||||
|
@RequestMapping("myHome") |
||||
|
public class MyHomeController { |
||||
|
|
||||
|
@Autowired |
||||
|
private MyHomeService myHomeService; |
||||
|
|
||||
|
@Autowired |
||||
|
private IcResiUserConfirmService icResiUserConfirmService; |
||||
|
|
||||
|
@Autowired |
||||
|
private IcResiUserService icResiUserService; |
||||
|
|
||||
|
|
||||
|
@PostMapping("memberList/{houseCode}") |
||||
|
public Result<List<HomeUserBriefResultDTO>> selectListHomeMember(@PathVariable("houseCode") String houseCode, @LoginUser TokenDto tokenDto) { |
||||
|
return new Result().ok(myHomeService.selectListHomeMember(houseCode, tokenDto.getCustomerId())); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
// /**
|
||||
|
// * @describe: 新增家庭成员
|
||||
|
// * @author wangtong
|
||||
|
// * @date 2022/6/1 15:50
|
||||
|
// * @params [dto]
|
||||
|
// * @return com.epmet.commons.tools.utils.Result
|
||||
|
// */
|
||||
|
// @PostMapping("addMember")
|
||||
|
// public Result addMember(@RequestBody IcResiUserConfirmSubmitDTO dto){
|
||||
|
// //效验数据
|
||||
|
// ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
|
||||
|
// dto.setSubmitType(HomeMemberOperationEnum.ADD.getCode());
|
||||
|
// return icResiUserConfirmService.addMember(dto);
|
||||
|
// }
|
||||
|
//
|
||||
|
// /**
|
||||
|
// * @describe: 修改家庭成员
|
||||
|
// * @author wangtong
|
||||
|
// * @date 2022/6/1 15:27
|
||||
|
// * @params [dto]
|
||||
|
// * @return com.epmet.commons.tools.utils.Result
|
||||
|
// */
|
||||
|
// @PostMapping("editMember")
|
||||
|
// public Result save(@RequestBody IcResiUserConfirmSubmitDTO dto){
|
||||
|
// //效验数据
|
||||
|
// ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
|
||||
|
// dto.setSubmitType(HomeMemberOperationEnum.UPDATE.getCode());
|
||||
|
// return icResiUserConfirmService.editMember(dto);
|
||||
|
// }
|
||||
|
//
|
||||
|
/** |
||||
|
* @describe: 删除家庭成员 |
||||
|
* @author wangtong |
||||
|
* @date 2022/6/1 16:10 |
||||
|
* @params [dto] |
||||
|
* @return com.epmet.commons.tools.utils.Result |
||||
|
*/ |
||||
|
@PostMapping("delMember") |
||||
|
public Result delMember(@RequestBody IcResiUserConfirmSubmitDTO dto){ |
||||
|
//效验数据
|
||||
|
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); |
||||
|
dto.setSubmitType(HomeMemberOperationEnum.DELETE.getCode()); |
||||
|
return icResiUserConfirmService.delMember(dto); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @describe: 新增家庭成员 |
||||
|
* @author wangtong |
||||
|
* @date 2022/6/1 15:50 |
||||
|
* @params [dto] |
||||
|
* @return com.epmet.commons.tools.utils.Result |
||||
|
*/ |
||||
|
@PostMapping("addMember") |
||||
|
public Result addMember(@RequestBody IcResiUserConfirmSubmitDTO dto){ |
||||
|
//效验数据
|
||||
|
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); |
||||
|
return icResiUserService.addMember(dto); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @describe: 修改家庭成员 |
||||
|
* @author wangtong |
||||
|
* @date 2022/6/1 15:27 |
||||
|
* @params [dto] |
||||
|
* @return com.epmet.commons.tools.utils.Result |
||||
|
*/ |
||||
|
@PostMapping("editMember") |
||||
|
public Result editMember(@RequestBody IcResiUserConfirmSubmitDTO dto){ |
||||
|
//效验数据
|
||||
|
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); |
||||
|
return icResiUserService.editMember(dto); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* @describe: 查询家庭成员信息 |
||||
|
* @author wangtong |
||||
|
* @date 2022/6/1 16:14 |
||||
|
* @params [dto] |
||||
|
* @return com.epmet.commons.tools.utils.Result |
||||
|
*/ |
||||
|
@PostMapping("getMemberDetail") |
||||
|
public Result<IcResiUserConfirmDTO> getMemberDetail(@RequestBody IcResiUserConfirmGetDTO dto){ |
||||
|
//效验数据
|
||||
|
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); |
||||
|
return icResiUserConfirmService.getMemberDetail(dto); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 注册绑定家庭信息 |
||||
|
* |
||||
|
* @Param tokenDto |
||||
|
* @Param formDTO |
||||
|
* @Return {@link Result} |
||||
|
* @Author zhaoqifeng |
||||
|
* @Date 2022/6/1 10:26 |
||||
|
*/ |
||||
|
@PostMapping("registerAndBind") |
||||
|
public Result registerAndBind(@LoginUser TokenDto tokenDto, @RequestBody RegisterAndBindFormDTO formDTO) { |
||||
|
formDTO.setCustomerId(tokenDto.getCustomerId()); |
||||
|
formDTO.setUserId(tokenDto.getUserId()); |
||||
|
myHomeService.registerAndBind(formDTO); |
||||
|
return new Result(); |
||||
|
} |
||||
|
|
||||
|
@PostMapping("homeInfo") |
||||
|
public Result<HomeInfoResultDTO> getHomeInfo(@LoginUser TokenDto tokenDto) { |
||||
|
HomeInfoResultDTO result = myHomeService.getHomeInfo(tokenDto); |
||||
|
return new Result<HomeInfoResultDTO>().ok(result); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,25 @@ |
|||||
|
package com.epmet.dao; |
||||
|
|
||||
|
import com.epmet.commons.mybatis.dao.BaseDao; |
||||
|
import com.epmet.entity.IcResiUserConfirmEntity; |
||||
|
import org.apache.ibatis.annotations.Mapper; |
||||
|
import org.apache.ibatis.annotations.Param; |
||||
|
|
||||
|
/** |
||||
|
* 居民信息审核表 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2022-06-01 |
||||
|
*/ |
||||
|
@Mapper |
||||
|
public interface IcResiUserConfirmDao extends BaseDao<IcResiUserConfirmEntity> { |
||||
|
|
||||
|
/** |
||||
|
* @describe: 根据icResiUserId查询 |
||||
|
* @author wangtong |
||||
|
* @date 2022/6/1 16:01 |
||||
|
* @params [icResiUserId] |
||||
|
* @return com.epmet.entity.IcResiUserConfirmEntity |
||||
|
*/ |
||||
|
IcResiUserConfirmEntity selectByIcResiUserId(@Param("icResiUserId") String icResiUserId); |
||||
|
} |
||||
@ -0,0 +1,157 @@ |
|||||
|
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-06-01 |
||||
|
*/ |
||||
|
@Data |
||||
|
@EqualsAndHashCode(callSuper=false) |
||||
|
@TableName("ic_resi_user_confirm") |
||||
|
public class IcResiUserConfirmEntity 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; |
||||
|
|
||||
|
/** |
||||
|
* 姓 |
||||
|
*/ |
||||
|
private String surname; |
||||
|
|
||||
|
/** |
||||
|
* 名 |
||||
|
*/ |
||||
|
private String name; |
||||
|
|
||||
|
/** |
||||
|
* 手机号 |
||||
|
*/ |
||||
|
private String mobile; |
||||
|
|
||||
|
/** |
||||
|
* 性别 |
||||
|
*/ |
||||
|
private String gender; |
||||
|
|
||||
|
/** |
||||
|
* 身份证号 |
||||
|
*/ |
||||
|
private String idCard; |
||||
|
|
||||
|
/** |
||||
|
* 出生日期 |
||||
|
*/ |
||||
|
private String birthday; |
||||
|
|
||||
|
/** |
||||
|
* 户籍所在地 |
||||
|
*/ |
||||
|
private String hjszd; |
||||
|
|
||||
|
/** |
||||
|
* 户籍所在地地区码 |
||||
|
*/ |
||||
|
private String hjszdCode; |
||||
|
|
||||
|
/** |
||||
|
* 户籍所在地层级编码 |
||||
|
*/ |
||||
|
private String hjszdPathCode; |
||||
|
|
||||
|
/** |
||||
|
* 现居住地 |
||||
|
*/ |
||||
|
private String xjzd; |
||||
|
|
||||
|
/** |
||||
|
* 现居住地地区码 |
||||
|
*/ |
||||
|
private String xjzdCode; |
||||
|
|
||||
|
/** |
||||
|
* 现居住地层级编码 |
||||
|
*/ |
||||
|
private String xjzdPathCode; |
||||
|
|
||||
|
/** |
||||
|
* 详细地址 |
||||
|
*/ |
||||
|
private String xxdz; |
||||
|
|
||||
|
/** |
||||
|
* 民族【字典表】 |
||||
|
*/ |
||||
|
private String mz; |
||||
|
|
||||
|
/** |
||||
|
* 名族名称 |
||||
|
*/ |
||||
|
private String mzName; |
||||
|
|
||||
|
/** |
||||
|
* 与户主关系 |
||||
|
*/ |
||||
|
private String yhzgx; |
||||
|
|
||||
|
/** |
||||
|
* 与户主关系名称 |
||||
|
*/ |
||||
|
private String yhzgxName; |
||||
|
|
||||
|
/** |
||||
|
* 审核状态0未审核,1审核通过,2审核不通过 |
||||
|
*/ |
||||
|
private String confirmResult; |
||||
|
|
||||
|
/** |
||||
|
* 审核不通过的原因 |
||||
|
*/ |
||||
|
private String reason; |
||||
|
|
||||
|
/** |
||||
|
* ic_resi_user表id |
||||
|
*/ |
||||
|
private String icResiUserId; |
||||
|
|
||||
|
/** |
||||
|
* 操作类型:新增add 修改 update 删除 delete |
||||
|
*/ |
||||
|
private String submitType; |
||||
|
|
||||
|
/** |
||||
|
* 删除原因 |
||||
|
*/ |
||||
|
private String deleteReason; |
||||
|
|
||||
|
/** |
||||
|
* 操作说明 |
||||
|
*/ |
||||
|
private String operationDescribe; |
||||
|
|
||||
|
} |
||||
|
|
||||
@ -0,0 +1,105 @@ |
|||||
|
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-06-01 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class IcResiUserConfirmExcel { |
||||
|
|
||||
|
@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 = "姓") |
||||
|
private String surname; |
||||
|
|
||||
|
@Excel(name = "名") |
||||
|
private String name; |
||||
|
|
||||
|
@Excel(name = "手机号") |
||||
|
private String mobile; |
||||
|
|
||||
|
@Excel(name = "性别") |
||||
|
private String gender; |
||||
|
|
||||
|
@Excel(name = "身份证号") |
||||
|
private String idCard; |
||||
|
|
||||
|
@Excel(name = "出生日期") |
||||
|
private String birthday; |
||||
|
|
||||
|
@Excel(name = "户籍所在地地区码") |
||||
|
private String hjszdCode; |
||||
|
|
||||
|
@Excel(name = "户籍所在地") |
||||
|
private String hjszd; |
||||
|
|
||||
|
@Excel(name = "现居住地地区码") |
||||
|
private String xjzdCode; |
||||
|
|
||||
|
@Excel(name = "现居住地") |
||||
|
private String xjzd; |
||||
|
|
||||
|
@Excel(name = "民族【字典表】") |
||||
|
private String mz; |
||||
|
|
||||
|
@Excel(name = "与户主关系") |
||||
|
private String yhzgx; |
||||
|
|
||||
|
@Excel(name = "审核状态0未审核,1审核通过,2审核不通过") |
||||
|
private String confirmResult; |
||||
|
|
||||
|
@Excel(name = "审核不通过的原因") |
||||
|
private String reason; |
||||
|
|
||||
|
@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; |
||||
|
|
||||
|
@Excel(name = "ic_resi_user表id") |
||||
|
private String icUserId; |
||||
|
|
||||
|
@Excel(name = "操作类型:新增add 修改 update 删除 delete") |
||||
|
private String submitType; |
||||
|
|
||||
|
@Excel(name = "删除原因") |
||||
|
private String deleteReason; |
||||
|
|
||||
|
@Excel(name = "操作说明") |
||||
|
private String operationDescribe; |
||||
|
|
||||
|
|
||||
|
} |
||||
@ -0,0 +1,30 @@ |
|||||
|
package com.epmet.redis; |
||||
|
|
||||
|
import com.epmet.commons.tools.redis.RedisUtils; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.stereotype.Component; |
||||
|
|
||||
|
/** |
||||
|
* 居民信息审核表 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2022-06-01 |
||||
|
*/ |
||||
|
@Component |
||||
|
public class IcResiUserConfirmRedis { |
||||
|
@Autowired |
||||
|
private RedisUtils redisUtils; |
||||
|
|
||||
|
public void delete(Object[] ids) { |
||||
|
|
||||
|
} |
||||
|
|
||||
|
public void set(){ |
||||
|
|
||||
|
} |
||||
|
|
||||
|
public String get(String id){ |
||||
|
return null; |
||||
|
} |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,127 @@ |
|||||
|
package com.epmet.service; |
||||
|
|
||||
|
import com.epmet.commons.mybatis.service.BaseService; |
||||
|
import com.epmet.commons.tools.page.PageData; |
||||
|
import com.epmet.commons.tools.utils.Result; |
||||
|
import com.epmet.dto.IcResiUserConfirmDTO; |
||||
|
import com.epmet.dto.form.IcResiUserConfirmGetDTO; |
||||
|
import com.epmet.dto.form.IcResiUserConfirmSubmitDTO; |
||||
|
import com.epmet.entity.IcResiUserConfirmEntity; |
||||
|
|
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
/** |
||||
|
* 居民信息审核表 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2022-06-01 |
||||
|
*/ |
||||
|
public interface IcResiUserConfirmService extends BaseService<IcResiUserConfirmEntity> { |
||||
|
|
||||
|
/** |
||||
|
* 默认分页 |
||||
|
* |
||||
|
* @param params |
||||
|
* @return PageData<IcResiUserConfirmDTO> |
||||
|
* @author generator |
||||
|
* @date 2022-06-01 |
||||
|
*/ |
||||
|
PageData<IcResiUserConfirmDTO> page(Map<String, Object> params); |
||||
|
|
||||
|
/** |
||||
|
* 默认查询 |
||||
|
* |
||||
|
* @param params |
||||
|
* @return java.util.List<IcResiUserConfirmDTO> |
||||
|
* @author generator |
||||
|
* @date 2022-06-01 |
||||
|
*/ |
||||
|
List<IcResiUserConfirmDTO> list(Map<String, Object> params); |
||||
|
|
||||
|
/** |
||||
|
* 单条查询 |
||||
|
* |
||||
|
* @param id |
||||
|
* @return IcResiUserConfirmDTO |
||||
|
* @author generator |
||||
|
* @date 2022-06-01 |
||||
|
*/ |
||||
|
IcResiUserConfirmDTO get(String id); |
||||
|
|
||||
|
/** |
||||
|
* 默认保存 |
||||
|
* |
||||
|
* @param dto |
||||
|
* @return void |
||||
|
* @author generator |
||||
|
* @date 2022-06-01 |
||||
|
*/ |
||||
|
void save(IcResiUserConfirmDTO dto); |
||||
|
|
||||
|
/** |
||||
|
* 默认更新 |
||||
|
* |
||||
|
* @param dto |
||||
|
* @return void |
||||
|
* @author generator |
||||
|
* @date 2022-06-01 |
||||
|
*/ |
||||
|
void update(IcResiUserConfirmDTO dto); |
||||
|
|
||||
|
/** |
||||
|
* 批量删除 |
||||
|
* |
||||
|
* @param ids |
||||
|
* @return void |
||||
|
* @author generator |
||||
|
* @date 2022-06-01 |
||||
|
*/ |
||||
|
void delete(String[] ids); |
||||
|
|
||||
|
/** |
||||
|
* @describe: 新增家庭成员 |
||||
|
* @author wangtong |
||||
|
* @date 2022/6/1 15:30 |
||||
|
* @params [dto] |
||||
|
* @return com.epmet.commons.tools.utils.Result |
||||
|
*/ |
||||
|
Result editMember(IcResiUserConfirmSubmitDTO dto); |
||||
|
|
||||
|
/** |
||||
|
* @describe: 新增家庭成员 |
||||
|
* @author wangtong |
||||
|
* @date 2022/6/1 15:50 |
||||
|
* @params [dto] |
||||
|
* @return com.epmet.commons.tools.utils.Result |
||||
|
*/ |
||||
|
Result addMember(IcResiUserConfirmSubmitDTO dto); |
||||
|
|
||||
|
/** |
||||
|
* @describe: 删除家庭成员 |
||||
|
* @author wangtong |
||||
|
* @date 2022/6/1 16:11 |
||||
|
* @params [dto] |
||||
|
* @return com.epmet.commons.tools.utils.Result |
||||
|
*/ |
||||
|
Result delMember(IcResiUserConfirmSubmitDTO dto); |
||||
|
|
||||
|
/** |
||||
|
* @describe: 查询家庭成员信息 |
||||
|
* @author wangtong |
||||
|
* @date 2022/6/1 16:15 |
||||
|
* @params [dto] |
||||
|
* @return com.epmet.commons.tools.utils.Result |
||||
|
*/ |
||||
|
Result<IcResiUserConfirmDTO> getMemberDetail(IcResiUserConfirmGetDTO dto); |
||||
|
|
||||
|
/** |
||||
|
* 审核 |
||||
|
* |
||||
|
* @Param dto |
||||
|
* @Return |
||||
|
* @Author zhaoqifeng |
||||
|
* @Date 2022/6/1 17:27 |
||||
|
*/ |
||||
|
void confirm(IcResiUserConfirmDTO dto); |
||||
|
} |
||||
@ -0,0 +1,46 @@ |
|||||
|
package com.epmet.service; |
||||
|
|
||||
|
import com.epmet.commons.tools.security.dto.TokenDto; |
||||
|
import com.epmet.dto.form.RegisterAndBindFormDTO; |
||||
|
import com.epmet.dto.result.HomeInfoResultDTO; |
||||
|
import com.epmet.dto.result.HomeUserBriefResultDTO; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* @Description |
||||
|
* @Author zhaoqifeng |
||||
|
* @Date 2022/5/31 16:21 |
||||
|
*/ |
||||
|
public interface MyHomeService { |
||||
|
/** |
||||
|
* 注册绑定房屋信息 |
||||
|
* |
||||
|
* @Param formDTO |
||||
|
* @Return |
||||
|
* @Author zhaoqifeng |
||||
|
* @Date 2022/6/1 16:33 |
||||
|
*/ |
||||
|
void registerAndBind(RegisterAndBindFormDTO formDTO); |
||||
|
|
||||
|
/** |
||||
|
* 获取用户绑定的房屋信息 |
||||
|
* |
||||
|
* @Param tokenDto |
||||
|
* @Return {@link HomeInfoResultDTO} |
||||
|
* @Author zhaoqifeng |
||||
|
* @Date 2022/6/1 16:52 |
||||
|
*/ |
||||
|
HomeInfoResultDTO getHomeInfo(TokenDto tokenDto); |
||||
|
|
||||
|
/** |
||||
|
* 查询家庭成员 |
||||
|
* |
||||
|
* @param houseCode 房屋编码 |
||||
|
* @param customerId |
||||
|
* @return java.util.List<com.epmet.dto.result.HomeUserBriefResultDTO> |
||||
|
* @author work@yujt.net.cn |
||||
|
* @date 2022/6/1/0001 16:12 |
||||
|
*/ |
||||
|
List<HomeUserBriefResultDTO> selectListHomeMember(String houseCode, String customerId); |
||||
|
} |
||||
@ -0,0 +1,175 @@ |
|||||
|
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.constant.NumConstant; |
||||
|
import com.epmet.commons.tools.page.PageData; |
||||
|
import com.epmet.commons.tools.utils.ConvertUtils; |
||||
|
import com.epmet.commons.tools.utils.Result; |
||||
|
import com.epmet.dao.IcResiUserConfirmDao; |
||||
|
import com.epmet.dao.IcResiUserDao; |
||||
|
import com.epmet.dto.IcResiUserConfirmDTO; |
||||
|
import com.epmet.dto.form.IcResiUserConfirmGetDTO; |
||||
|
import com.epmet.dto.form.IcResiUserConfirmSubmitDTO; |
||||
|
import com.epmet.entity.IcResiUserConfirmEntity; |
||||
|
import com.epmet.entity.IcResiUserEntity; |
||||
|
import com.epmet.redis.IcResiUserConfirmRedis; |
||||
|
import com.epmet.service.IcResiUserConfirmService; |
||||
|
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-06-01 |
||||
|
*/ |
||||
|
@Service |
||||
|
public class IcResiUserConfirmServiceImpl extends BaseServiceImpl<IcResiUserConfirmDao, IcResiUserConfirmEntity> implements IcResiUserConfirmService { |
||||
|
|
||||
|
@Autowired |
||||
|
private IcResiUserConfirmRedis icResiUserConfirmRedis; |
||||
|
|
||||
|
@Autowired |
||||
|
private IcResiUserDao icResiUserDao; |
||||
|
|
||||
|
@Override |
||||
|
public PageData<IcResiUserConfirmDTO> page(Map<String, Object> params) { |
||||
|
IPage<IcResiUserConfirmEntity> page = baseDao.selectPage( |
||||
|
getPage(params, FieldConstant.CREATED_TIME, false), |
||||
|
getWrapper(params) |
||||
|
); |
||||
|
return getPageData(page, IcResiUserConfirmDTO.class); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public List<IcResiUserConfirmDTO> list(Map<String, Object> params) { |
||||
|
List<IcResiUserConfirmEntity> entityList = baseDao.selectList(getWrapper(params)); |
||||
|
|
||||
|
return ConvertUtils.sourceToTarget(entityList, IcResiUserConfirmDTO.class); |
||||
|
} |
||||
|
|
||||
|
private QueryWrapper<IcResiUserConfirmEntity> getWrapper(Map<String, Object> params){ |
||||
|
String id = (String)params.get(FieldConstant.ID_HUMP); |
||||
|
|
||||
|
QueryWrapper<IcResiUserConfirmEntity> wrapper = new QueryWrapper<>(); |
||||
|
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); |
||||
|
|
||||
|
return wrapper; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public IcResiUserConfirmDTO get(String id) { |
||||
|
IcResiUserConfirmEntity entity = baseDao.selectById(id); |
||||
|
return ConvertUtils.sourceToTarget(entity, IcResiUserConfirmDTO.class); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
public void save(IcResiUserConfirmDTO dto) { |
||||
|
IcResiUserConfirmEntity entity = ConvertUtils.sourceToTarget(dto, IcResiUserConfirmEntity.class); |
||||
|
insert(entity); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
public void update(IcResiUserConfirmDTO dto) { |
||||
|
IcResiUserConfirmEntity entity = ConvertUtils.sourceToTarget(dto, IcResiUserConfirmEntity.class); |
||||
|
updateById(entity); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
public void delete(String[] ids) { |
||||
|
// 逻辑删除(@TableLogic 注解)
|
||||
|
baseDao.deleteBatchIds(Arrays.asList(ids)); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public Result editMember(IcResiUserConfirmSubmitDTO dto) { |
||||
|
IcResiUserConfirmEntity oldEntity = baseDao.selectByIcResiUserId(dto.getIcResiUserId()); |
||||
|
if(null != oldEntity){ |
||||
|
dto.setId(oldEntity.getId()); |
||||
|
IcResiUserConfirmEntity entity = ConvertUtils.sourceToTarget(dto, IcResiUserConfirmEntity.class); |
||||
|
updateById(entity); |
||||
|
}else{ |
||||
|
addMember(dto); |
||||
|
} |
||||
|
return new Result().ok("修改成功"); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public Result addMember(IcResiUserConfirmSubmitDTO dto) { |
||||
|
IcResiUserEntity user = icResiUserDao.selectById(dto.getIcResiUserId()); |
||||
|
dto.setCustomerId(user.getCustomerId()); |
||||
|
dto.setAgencyId(user.getAgencyId()); |
||||
|
dto.setPids(user.getPids()); |
||||
|
dto.setGridId(user.getGridId()); |
||||
|
|
||||
|
IcResiUserConfirmEntity entity = ConvertUtils.sourceToTarget(dto, IcResiUserConfirmEntity.class); |
||||
|
entity.setIcResiUserId(null); |
||||
|
insert(entity); |
||||
|
|
||||
|
return new Result().ok("新增成功"); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public Result delMember(IcResiUserConfirmSubmitDTO dto) { |
||||
|
IcResiUserConfirmEntity oldEntity = baseDao.selectByIcResiUserId(dto.getIcResiUserId()); |
||||
|
if(null != oldEntity){ |
||||
|
dto.setId(oldEntity.getId()); |
||||
|
IcResiUserConfirmEntity entity = ConvertUtils.sourceToTarget(dto, IcResiUserConfirmEntity.class); |
||||
|
updateById(entity); |
||||
|
}else{ |
||||
|
addMember(dto); |
||||
|
} |
||||
|
return new Result().ok("删除成功"); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public Result<IcResiUserConfirmDTO> getMemberDetail(IcResiUserConfirmGetDTO dto) { |
||||
|
IcResiUserConfirmDTO result = icResiUserDao.selectMemberDetail(dto.getIcResiUserId()); |
||||
|
return new Result().ok(result); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 审核 |
||||
|
* |
||||
|
* @param dto |
||||
|
* @Param dto |
||||
|
* @Return |
||||
|
* @Author zhaoqifeng |
||||
|
* @Date 2022/6/1 17:27 |
||||
|
*/ |
||||
|
@Override |
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
public void confirm(IcResiUserConfirmDTO dto) { |
||||
|
baseDao.updateById(ConvertUtils.sourceToTarget(dto, IcResiUserConfirmEntity.class)); |
||||
|
if (NumConstant.ONE_STR.equals(dto.getConfirmResult())) { |
||||
|
//审核通过,修改居民信息
|
||||
|
IcResiUserConfirmEntity confirmEntity = baseDao.selectById(dto.getId()); |
||||
|
if ("edit".equals(confirmEntity.getSubmitType())) { |
||||
|
IcResiUserEntity entity = ConvertUtils.sourceToTarget(confirmEntity, IcResiUserEntity.class); |
||||
|
entity.setName(confirmEntity.getSurname() + confirmEntity.getName()); |
||||
|
entity.setId(confirmEntity.getIcResiUserId()); |
||||
|
icResiUserDao.updateById(entity); |
||||
|
} else if ("delete".equals(confirmEntity.getSubmitType())){ |
||||
|
IcResiUserEntity entity = new IcResiUserEntity(); |
||||
|
entity.setId(confirmEntity.getIcResiUserId()); |
||||
|
entity.setStatus(confirmEntity.getDeleteReason()); |
||||
|
icResiUserDao.updateById(entity); |
||||
|
} |
||||
|
} else { |
||||
|
//TODO 发送消息
|
||||
|
} |
||||
|
} |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,210 @@ |
|||||
|
package com.epmet.service.impl; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
||||
|
import com.epmet.commons.tools.exception.EpmetErrorCode; |
||||
|
import com.epmet.commons.tools.exception.EpmetException; |
||||
|
import com.epmet.commons.tools.redis.common.CustomerIcHouseRedis; |
||||
|
import com.epmet.commons.tools.redis.common.CustomerOrgRedis; |
||||
|
import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache; |
||||
|
import com.epmet.commons.tools.redis.common.bean.HouseInfoCache; |
||||
|
import com.epmet.commons.tools.security.dto.TokenDto; |
||||
|
import com.epmet.commons.tools.utils.ConvertUtils; |
||||
|
import com.epmet.commons.tools.utils.Result; |
||||
|
import com.epmet.dao.*; |
||||
|
import com.epmet.dto.IcHouseDTO; |
||||
|
import com.epmet.dto.UserResiInfoDTO; |
||||
|
import com.epmet.dto.form.EnterGridFormDTO; |
||||
|
import com.epmet.dto.form.GetRoleKeyListFormDTO; |
||||
|
import com.epmet.dto.form.RegisterAndBindFormDTO; |
||||
|
import com.epmet.dto.result.HomeInfoResultDTO; |
||||
|
import com.epmet.dto.result.HomeUserBriefResultDTO; |
||||
|
import com.epmet.dto.result.ResiUserBaseInfoResultDTO; |
||||
|
import com.epmet.entity.IcResiUserEntity; |
||||
|
import com.epmet.entity.UserBaseInfoEntity; |
||||
|
import com.epmet.entity.UserResiInfoEntity; |
||||
|
import com.epmet.entity.UserResiRegisterVisitEntity; |
||||
|
import com.epmet.feign.GovOrgOpenFeignClient; |
||||
|
import com.epmet.service.*; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.apache.commons.collections4.CollectionUtils; |
||||
|
import org.apache.commons.compress.utils.Lists; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
import org.springframework.transaction.annotation.Transactional; |
||||
|
|
||||
|
import javax.annotation.Resource; |
||||
|
import java.util.Date; |
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* @Description |
||||
|
* @Author zhaoqifeng |
||||
|
* @Date 2022/5/31 16:22 |
||||
|
*/ |
||||
|
@Service |
||||
|
@Slf4j |
||||
|
public class MyHomeServiceImpl implements MyHomeService { |
||||
|
|
||||
|
@Autowired |
||||
|
private GovOrgOpenFeignClient govOrgOpenFeignClient; |
||||
|
@Autowired |
||||
|
private IcResiUserService icResiUserService; |
||||
|
@Resource |
||||
|
private UserRoleDao userRoleDao; |
||||
|
@Resource |
||||
|
private UserResiInfoService userResiInfoService; |
||||
|
@Resource |
||||
|
private UserResiInfoDao userResiInfoDao; |
||||
|
@Resource |
||||
|
private UserBaseInfoService userBaseInfoService; |
||||
|
@Resource |
||||
|
private UserBaseInfoDao userBaseInfoDao; |
||||
|
@Resource |
||||
|
private IcResiUserDao icResiUserDao; |
||||
|
@Resource |
||||
|
private RegisterRelationService registerRelationService; |
||||
|
@Resource |
||||
|
private UserResiRegisterVisitDao userResiRegisterVisitDao; |
||||
|
|
||||
|
@Override |
||||
|
public List<HomeUserBriefResultDTO> selectListHomeMember(String houseCode, String customerId) { |
||||
|
|
||||
|
Result<IcHouseDTO> byHouseCode = govOrgOpenFeignClient.getByHouseCode(houseCode); |
||||
|
|
||||
|
if (byHouseCode.success() && null != byHouseCode.getData()) { |
||||
|
return icResiUserService.listHomeUserBrief(byHouseCode.getData().getId(), customerId); |
||||
|
} |
||||
|
|
||||
|
return Lists.newArrayList(); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 注册绑定房屋信息 |
||||
|
* |
||||
|
* @Param formDTO |
||||
|
* @Return |
||||
|
* @Author zhaoqifeng |
||||
|
* @Date 2022/6/1 16:33 |
||||
|
*/ |
||||
|
@Override |
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
public void registerAndBind(RegisterAndBindFormDTO formDTO) { |
||||
|
|
||||
|
LambdaQueryWrapper<IcResiUserEntity> userWrapper = new LambdaQueryWrapper<>(); |
||||
|
userWrapper.eq(IcResiUserEntity::getCustomerId, formDTO.getCustomerId()); |
||||
|
userWrapper.eq(IcResiUserEntity::getIdCard, formDTO.getIdCard()); |
||||
|
IcResiUserEntity icUser = icResiUserDao.selectOne(userWrapper); |
||||
|
|
||||
|
if (null != icUser && !icUser.getHomeId().equals(formDTO.getHomeId())) { |
||||
|
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "已绑定其他房屋", "已绑定其他房屋"); |
||||
|
} |
||||
|
|
||||
|
//进入网格(entergrid)流程
|
||||
|
EnterGridFormDTO userInfoParams = new EnterGridFormDTO(); |
||||
|
userInfoParams.setUserId(formDTO.getUserId()); |
||||
|
userInfoParams.setCustomerId(formDTO.getCustomerId()); |
||||
|
userInfoParams.setGridId(formDTO.getGridId()); |
||||
|
registerRelationService.getUserInfoAndRoles(userInfoParams); |
||||
|
|
||||
|
//1.判断是否是居民,如果不是则注册居民,如果是则更新居民信息
|
||||
|
GetRoleKeyListFormDTO getRoleKeyListFormDTO = new GetRoleKeyListFormDTO(); |
||||
|
getRoleKeyListFormDTO.setUserId(formDTO.getUserId()); |
||||
|
getRoleKeyListFormDTO.setGridId(formDTO.getGridId()); |
||||
|
List<String> roleList = userRoleDao.selectUserRoleKeyList(getRoleKeyListFormDTO); |
||||
|
|
||||
|
if (CollectionUtils.isNotEmpty(roleList) && roleList.contains("registered_resi")) { |
||||
|
//更新user_resi_info和user_base_info的信息
|
||||
|
UserResiInfoEntity userResiInfo = new UserResiInfoEntity(); |
||||
|
userResiInfo.setUserId(formDTO.getUserId()); |
||||
|
userResiInfo.setSurname(formDTO.getSurname()); |
||||
|
userResiInfo.setName(formDTO.getName()); |
||||
|
userResiInfo.setIdNum(formDTO.getIdCard()); |
||||
|
userResiInfo.setRegMobile(formDTO.getMobile()); |
||||
|
userResiInfo.setResiVisitId(formDTO.getVisitId()); |
||||
|
userResiInfo.setStreet(formDTO.getAddress()); |
||||
|
|
||||
|
LambdaQueryWrapper<UserResiInfoEntity> wrapper = new LambdaQueryWrapper<>(); |
||||
|
wrapper.eq(UserResiInfoEntity::getCustomerId, formDTO.getCustomerId()); |
||||
|
wrapper.eq(UserResiInfoEntity::getUserId, formDTO.getUserId()); |
||||
|
userResiInfoDao.update(userResiInfo, wrapper); |
||||
|
|
||||
|
UserBaseInfoEntity userBaseInfoEntity = ConvertUtils.sourceToTarget(userResiInfo, UserBaseInfoEntity.class); |
||||
|
userBaseInfoService.insertOrUpdate(userBaseInfoEntity); |
||||
|
} else { |
||||
|
//visit表添加数据
|
||||
|
UserResiRegisterVisitEntity visit = new UserResiRegisterVisitEntity(); |
||||
|
visit.setCustomerId(formDTO.getCustomerId()); |
||||
|
visit.setGridId(formDTO.getGridId()); |
||||
|
visit.setUserId(formDTO.getUserId()); |
||||
|
visit.setVisitFrom("register_and_bind"); |
||||
|
visit.setLastOperateVisit("success"); |
||||
|
visit.setVisitTime(new Date()); |
||||
|
userResiRegisterVisitDao.insert(visit); |
||||
|
//注册居民
|
||||
|
UserResiInfoDTO userResiInfoDTO = ConvertUtils.sourceToTarget(formDTO, UserResiInfoDTO.class); |
||||
|
userResiInfoDTO.setUserId(formDTO.getUserId()); |
||||
|
userResiInfoDTO.setIdNum(formDTO.getIdCard()); |
||||
|
userResiInfoDTO.setRegMobile(formDTO.getMobile()); |
||||
|
userResiInfoDTO.setResiVisitId(visit.getId()); |
||||
|
userResiInfoDTO.setStreet(formDTO.getAddress()); |
||||
|
userResiInfoDTO.setCustomerId(formDTO.getCustomerId()); |
||||
|
userResiInfoDTO.setApp("resi"); |
||||
|
userResiInfoService.saveResiInfo(userResiInfoDTO); |
||||
|
} |
||||
|
//2.添加ic_resi_user信息
|
||||
|
HouseInfoCache houseInfo = CustomerIcHouseRedis.getHouseInfo(formDTO.getCustomerId(), formDTO.getHomeId()); |
||||
|
if (null == houseInfo) { |
||||
|
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "获取房屋信息失败", "获取房屋信息失败"); |
||||
|
} |
||||
|
AgencyInfoCache agencyInfo = CustomerOrgRedis.getAgencyInfo(houseInfo.getAgencyId()); |
||||
|
if (null == agencyInfo) { |
||||
|
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "获取组织信息失败", "获取组织信息失败"); |
||||
|
} |
||||
|
IcResiUserEntity icUserEntity = ConvertUtils.sourceToTarget(formDTO, IcResiUserEntity.class); |
||||
|
icUserEntity.setName(formDTO.getSurname() + formDTO.getName()); |
||||
|
icUserEntity.setAgencyId(houseInfo.getAgencyId()); |
||||
|
icUserEntity.setPids(agencyInfo.getPids()); |
||||
|
if (null != icUser) { |
||||
|
icUserEntity.setId(icUser.getId()); |
||||
|
icResiUserDao.updateById(icUserEntity); |
||||
|
} else { |
||||
|
icResiUserDao.insert(icUserEntity); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 获取用户绑定的房屋信息 |
||||
|
* |
||||
|
* @param tokenDto |
||||
|
* @Param tokenDto |
||||
|
* @Return {@link HomeInfoResultDTO} |
||||
|
* @Author zhaoqifeng |
||||
|
* @Date 2022/6/1 16:52 |
||||
|
*/ |
||||
|
@Override |
||||
|
public HomeInfoResultDTO getHomeInfo(TokenDto tokenDto) { |
||||
|
HomeInfoResultDTO resultDto = new HomeInfoResultDTO(); |
||||
|
ResiUserBaseInfoResultDTO baseInfo = userBaseInfoDao.selecUserBaseInfoByUserId(tokenDto.getUserId()); |
||||
|
if (null == baseInfo) { |
||||
|
return resultDto; |
||||
|
} |
||||
|
|
||||
|
LambdaQueryWrapper<IcResiUserEntity> wrapper = new LambdaQueryWrapper<>(); |
||||
|
wrapper.eq(IcResiUserEntity::getCustomerId, tokenDto.getCustomerId()); |
||||
|
wrapper.eq(IcResiUserEntity::getIdCard, baseInfo.getIdNum()); |
||||
|
IcResiUserEntity icUser = icResiUserDao.selectOne(wrapper); |
||||
|
|
||||
|
if (null == icUser) { |
||||
|
return resultDto; |
||||
|
} |
||||
|
resultDto.setIcResiUserId(icUser.getId()); |
||||
|
HouseInfoCache houseInfo = CustomerIcHouseRedis.getHouseInfo(tokenDto.getCustomerId(), icUser.getHomeId()); |
||||
|
if (null == houseInfo) { |
||||
|
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "获取房屋信息失败", "获取房屋信息失败"); |
||||
|
} |
||||
|
resultDto.setHouseName(houseInfo.getAllName()); |
||||
|
resultDto.setHouseCode(houseInfo.getHouseCode()); |
||||
|
resultDto.setQrCodeUrl(houseInfo.getHouseQrcodeUrl()); |
||||
|
return resultDto; |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,39 @@ |
|||||
|
CREATE TABLE `ic_resi_user_confirm` |
||||
|
( |
||||
|
`ID` varchar(64) NOT NULL COMMENT '主键', |
||||
|
`CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户Id customer.id', |
||||
|
`AGENCY_ID` varchar(64) NOT NULL COMMENT '组织Id', |
||||
|
`PIDS` varchar(255) NOT NULL COMMENT '组织的pids', |
||||
|
`GRID_ID` varchar(64) NOT NULL COMMENT '网格ID', |
||||
|
`SURNAME` varchar(64) COMMENT '姓', |
||||
|
`NAME` varchar(64) COMMENT '名', |
||||
|
`MOBILE` varchar(15) DEFAULT NULL COMMENT '手机号', |
||||
|
`GENDER` char(2) DEFAULT NULL COMMENT '性别', |
||||
|
`ID_CARD` varchar(18) NOT NULL COMMENT '身份证号', |
||||
|
`BIRTHDAY` varchar(64) DEFAULT NULL COMMENT '出生日期', |
||||
|
`HJSZD` varchar(256) DEFAULT NULL COMMENT '户籍所在地', |
||||
|
`HJSZD_CODE` varchar(256) DEFAULT NULL COMMENT '户籍所在地地区码', |
||||
|
`HJSZD_PATH_CODE` varchar(255) DEFAULT NULL COMMENT '户籍所在地层级编码', |
||||
|
`XJZD` varchar(256) DEFAULT NULL COMMENT '现居住地', |
||||
|
`XJZD_CODE` varchar(256) DEFAULT NULL COMMENT '现居住地地区码', |
||||
|
`XJZD_PATH_CODE` varchar(255) DEFAULT NULL COMMENT '现居住地层级编码', |
||||
|
`XXDZ` varchar(255) DEFAULT NULL COMMENT '详细地址', |
||||
|
`MZ` varchar(64) DEFAULT NULL COMMENT '民族【字典表】', |
||||
|
`MZ_NAME` varchar(255) DEFAULT NULL COMMENT '名族名称', |
||||
|
`YHZGX` varchar(64) DEFAULT NULL COMMENT '与户主关系', |
||||
|
`YHZGX_NAME` varchar(255) DEFAULT NULL COMMENT '与户主关系名称', |
||||
|
`CONFIRM_RESULT` varchar(64) DEFAULT '0' COMMENT '审核状态0未审核,1审核通过,2审核不通过', |
||||
|
`REASON` varchar(64) DEFAULT NULL COMMENT '审核不通过的原因', |
||||
|
`DEL_FLAG` int(11) NOT NULL DEFAULT '0' COMMENT '删除标识 0.未删除 1.已删除', |
||||
|
`REVISION` int(11) NOT NULL COMMENT '乐观锁', |
||||
|
`CREATED_BY` varchar(64) NOT NULL COMMENT '创建人', |
||||
|
`CREATED_TIME` datetime NOT NULL COMMENT '创建时间', |
||||
|
`UPDATED_BY` varchar(64) NOT NULL COMMENT '更新人', |
||||
|
`UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', |
||||
|
`IC_RESI_USER_ID` varchar(64) DEFAULT NULL COMMENT 'ic_resi_user表id', |
||||
|
`SUBMIT_TYPE` varchar(255) DEFAULT NULL COMMENT '操作类型:新增add 修改 update 删除 delete', |
||||
|
`DELETE_REASON` varchar(255) DEFAULT NULL COMMENT '删除原因', |
||||
|
`OPERATION_DESCRIBE` varchar(255) DEFAULT NULL COMMENT '操作说明', |
||||
|
PRIMARY KEY (`ID`) |
||||
|
) ENGINE = InnoDB |
||||
|
DEFAULT CHARSET = utf8mb4 COMMENT ='居民信息审核表'; |
||||
@ -0,0 +1,44 @@ |
|||||
|
<?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.IcResiUserConfirmDao"> |
||||
|
|
||||
|
<resultMap type="com.epmet.entity.IcResiUserConfirmEntity" id="icResiUserConfirmMap"> |
||||
|
<result property="id" column="ID"/> |
||||
|
<result property="customerId" column="CUSTOMER_ID"/> |
||||
|
<result property="agencyId" column="AGENCY_ID"/> |
||||
|
<result property="pids" column="PIDS"/> |
||||
|
<result property="gridId" column="GRID_ID"/> |
||||
|
<result property="surname" column="SURNAME"/> |
||||
|
<result property="name" column="NAME"/> |
||||
|
<result property="mobile" column="MOBILE"/> |
||||
|
<result property="gender" column="GENDER"/> |
||||
|
<result property="idCard" column="ID_CARD"/> |
||||
|
<result property="birthday" column="BIRTHDAY"/> |
||||
|
<result property="hjszdCode" column="HJSZD_CODE"/> |
||||
|
<result property="hjszd" column="HJSZD"/> |
||||
|
<result property="xjzdCode" column="XJZD_CODE"/> |
||||
|
<result property="xjzd" column="XJZD"/> |
||||
|
<result property="mz" column="MZ"/> |
||||
|
<result property="yhzgx" column="YHZGX"/> |
||||
|
<result property="confirmResult" column="CONFIRM_RESULT"/> |
||||
|
<result property="reason" column="REASON"/> |
||||
|
<result property="delFlag" column="DEL_FLAG"/> |
||||
|
<result property="revision" column="REVISION"/> |
||||
|
<result property="createdBy" column="CREATED_BY"/> |
||||
|
<result property="createdTime" column="CREATED_TIME"/> |
||||
|
<result property="updatedBy" column="UPDATED_BY"/> |
||||
|
<result property="updatedTime" column="UPDATED_TIME"/> |
||||
|
<result property="icResiUserId" column="IC_RESI_USER_ID"/> |
||||
|
<result property="submitType" column="SUBMIT_TYPE"/> |
||||
|
<result property="deleteReason" column="DELETE_REASON"/> |
||||
|
<result property="operationDescribe" column="OPERATION_DESCRIBE"/> |
||||
|
</resultMap> |
||||
|
<select id="selectByIcResiUserId" resultType="com.epmet.entity.IcResiUserConfirmEntity"> |
||||
|
select * from ic_resi_user_confirm |
||||
|
where IC_RESI_USER_ID=#{icResiUserId} |
||||
|
and del_flag='0' |
||||
|
</select> |
||||
|
|
||||
|
|
||||
|
</mapper> |
||||
Loading…
Reference in new issue