|
@@ -189,14 +189,6 @@ public class ZwywLrJbxxServiceImpl implements IZwywLrJbxxService {
|
|
|
return res;
|
|
|
}
|
|
|
|
|
|
- @Override
|
|
|
- public InLnstLrxx getLrByZjhm(InLnstLrxx zwywLrJbxx) {
|
|
|
- if (StringUtils.isEmpty(zwywLrJbxx.getLrJmzjhm())) {
|
|
|
- throw new ServiceException("缺失必要参数");
|
|
|
- }
|
|
|
- return zwywLrJbxxMapper.selectOne(new LambdaQueryWrapper<>(zwywLrJbxx));
|
|
|
- }
|
|
|
-
|
|
|
/**
|
|
|
* 新增老人基本信息
|
|
|
*
|
|
@@ -206,35 +198,41 @@ public class ZwywLrJbxxServiceImpl implements IZwywLrJbxxService {
|
|
|
@Transactional
|
|
|
@Override
|
|
|
public int insertZwywLrJbxx(InLnstLrxx zwywLrJbxx) {
|
|
|
- // 插用户
|
|
|
- LoginUser loginUser = userService.getUserInfo(zwywLrJbxx.getLrZjhm(), SecurityConstants.INNER).getData();
|
|
|
+ // 微信端专用新增
|
|
|
+ // 重复性检测 老人信息表/本系统老人用户表/银联系统会员表
|
|
|
+ LoginUser loginUser = userService.getLrUserInfo(zwywLrJbxx.getLrZjhm(), SecurityConstants.INNER).getData();
|
|
|
InLnstLrxx query = new InLnstLrxx();
|
|
|
query.setLrZjhm(zwywLrJbxx.getLrZjhm());
|
|
|
InLnstLrxx check = zwywLrJbxxMapper.selectOne(new LambdaQueryWrapper<>(query));
|
|
|
if (ObjectUtils.isNotEmpty(loginUser) || ObjectUtils.isNotEmpty(check)) {
|
|
|
throw new ServiceException("该证件号码账号已存在");
|
|
|
}
|
|
|
+ // 前端未传流转状态
|
|
|
+ // 草稿
|
|
|
if (StringUtils.isEmpty(zwywLrJbxx.getLzzt())) {
|
|
|
- if (StringUtils.isNotEmpty(zwywLrJbxx.getLrTx()) && StringUtils.isNotEmpty(zwywLrJbxx.getLrZjz())) {
|
|
|
- // 通过
|
|
|
- zwywLrJbxx.setLzzt("3");
|
|
|
- } else {
|
|
|
- // 草稿
|
|
|
- zwywLrJbxx.setLzzt("0");
|
|
|
- }
|
|
|
+ zwywLrJbxx.setLzzt("0");
|
|
|
}
|
|
|
+ // 调用银联会员注册接口,将返回值放到 银联code 和 银联会员卡code 中
|
|
|
+ zwywLrJbxx.setYlcode("1100302099");
|
|
|
+ zwywLrJbxx.setYlcard("1100302099");
|
|
|
+ // 老人加密证件号码
|
|
|
+ zwywLrJbxx.setLrJmzjhm(DigestUtils.md5Hex(zwywLrJbxx.getLrZjhm()));
|
|
|
+ // 本系统的老人注册
|
|
|
String userId = insertUser(zwywLrJbxx);
|
|
|
if (StringUtils.isEmpty(userId)) {
|
|
|
throw new ServiceException("用户已经存在");
|
|
|
}
|
|
|
- zwywLrJbxx.setYlcode("1100302099");
|
|
|
+ // 主键直接使用该userId
|
|
|
zwywLrJbxx.setId(userId);
|
|
|
- zwywLrJbxx.setLrJmzjhm(DigestUtils.md5Hex(zwywLrJbxx.getLrZjhm()));
|
|
|
+ // 生成登记编号
|
|
|
zwywLrJbxx.setDjbh(String.valueOf(Long.parseLong(zwywLrJbxxMapper.selectMaxBh(zwywLrJbxx.getLrHjdz().substring(0, 6))) + 1));
|
|
|
+ // 审核信息实例化并将当前新增的老人数据复制一份
|
|
|
InLnstShxx shxx = new InLnstShxx();
|
|
|
BeanUtil.copyProperties(zwywLrJbxx, shxx, new CopyOptions().ignoreNullValue());
|
|
|
+ // 判断老人注册的户籍地址是否是强制注册的区划
|
|
|
LnstDeptExamine examine = lnstDeptExamineMapper.selectList(new LambdaQueryWrapper<LnstDeptExamine>()
|
|
|
- .eq(LnstDeptExamine::getCode, zwywLrJbxx.getLrHjdz())).stream().findFirst().orElse(null);
|
|
|
+ .eq(LnstDeptExamine::getCode, zwywLrJbxx.getLrHjdz().substring(0, 6) + "000000")).stream().findFirst().orElse(null);
|
|
|
+ // 需要审核的情况
|
|
|
if (StringUtils.equals(zwywLrJbxx.getLzzt(), "1") || StringUtils.equals(zwywLrJbxx.getLzzt(), "2")
|
|
|
|| ObjectUtils.isNotEmpty(examine) || StringUtils.equals(zwywLrJbxx.getLzzt(), "5")
|
|
|
|| !StringUtils.isAllEmpty(zwywLrJbxx.getTkzm(), zwywLrJbxx.getDbzm(), zwywLrJbxx.getZczm())) {
|
|
@@ -251,6 +249,7 @@ public class ZwywLrJbxxServiceImpl implements IZwywLrJbxxService {
|
|
|
shxx.setSqyy("老人待审核");
|
|
|
}
|
|
|
}
|
|
|
+ // 插入出生日期和性别
|
|
|
try {
|
|
|
if (StringUtils.isEmpty(zwywLrJbxx.getLrCsrq())) {
|
|
|
zwywLrJbxx.setLrCsrq(zwywLrJbxx.getLrZjhm().substring(7, 15));
|
|
@@ -260,7 +259,9 @@ public class ZwywLrJbxxServiceImpl implements IZwywLrJbxxService {
|
|
|
zwywLrJbxx.setLrXb(xb);
|
|
|
}
|
|
|
} catch (Exception ignored) {}
|
|
|
+ // 插入该条老人数据
|
|
|
int res = zwywLrJbxxMapper.insert(zwywLrJbxx);
|
|
|
+ // 当前需要审核的情况插入审核数据
|
|
|
if (StringUtils.equals(zwywLrJbxx.getLzzt(), "1") || StringUtils.equals(zwywLrJbxx.getLzzt(), "2")
|
|
|
|| StringUtils.equals(zwywLrJbxx.getLzzt(), "5") || StringUtils.equals(zwywLrJbxx.getLzzt(), "7")) {
|
|
|
shxx.setId(IdUtils.simpleUUID());
|
|
@@ -269,36 +270,60 @@ public class ZwywLrJbxxServiceImpl implements IZwywLrJbxxService {
|
|
|
shxx.setLzzt(zwywLrJbxx.getLzzt());
|
|
|
zwywJclrShxxMapper.insert(shxx);
|
|
|
}
|
|
|
+ // 插入一条空的活体数据
|
|
|
LnstYlht ht = new LnstYlht();
|
|
|
ht.setId(IdUtils.simpleUUID());
|
|
|
ht.setYlcode(zwywLrJbxx.getYlcode());
|
|
|
ht.setYlid(zwywLrJbxx.getId());
|
|
|
lnstYlhtMapper.insert(ht);
|
|
|
-// if (StringUtils.equals(zwywLrJbxx.getLzzt(), "3") && StringUtils.equals(zwywLrJbxx.getSource(), "0")) {
|
|
|
-// uploadBaidu(zwywLrJbxx);
|
|
|
-// }
|
|
|
return res;
|
|
|
}
|
|
|
|
|
|
@Transactional
|
|
|
@Override
|
|
|
public int insertZwywLrJbxxWeb(InLnstLrxx zwywLrJbxx) {
|
|
|
+ // web端专用新增
|
|
|
int res = 0;
|
|
|
- LoginUser loginUser = userService.getUserInfo(zwywLrJbxx.getLrZjhm(), SecurityConstants.INNER).getData();
|
|
|
+ // 重复性检测 老人信息表/本系统老人用户表/银联系统会员表
|
|
|
+ LoginUser loginUser = userService.getLrUserInfo(zwywLrJbxx.getLrZjhm(), SecurityConstants.INNER).getData();
|
|
|
InLnstLrxx query = new InLnstLrxx();
|
|
|
query.setLrZjhm(zwywLrJbxx.getLrZjhm());
|
|
|
InLnstLrxx check = zwywLrJbxxMapper.selectOne(new LambdaQueryWrapper<>(query));
|
|
|
+
|
|
|
if (ObjectUtils.isNotEmpty(loginUser) || ObjectUtils.isNotEmpty(check)) {
|
|
|
throw new ServiceException("该证件号码账号已存在");
|
|
|
}
|
|
|
+ // insert默认草稿属性,活体检测后才确定流转状态
|
|
|
zwywLrJbxx.setLzzt("0");
|
|
|
+ // 调用银联会员注册接口,将返回值放到 银联code 和 银联会员卡code 中
|
|
|
zwywLrJbxx.setYlcode("1100302099");
|
|
|
+ zwywLrJbxx.setYlcard("1100302099");
|
|
|
+ // 老人加密证件号码
|
|
|
zwywLrJbxx.setLrJmzjhm(DigestUtils.md5Hex(zwywLrJbxx.getLrZjhm()));
|
|
|
+ // web端户籍地址直接使用当前账号的行政区划
|
|
|
zwywLrJbxx.setLrHjdz(SecurityUtils.getAreaCode());
|
|
|
+ // 生成登记编号
|
|
|
zwywLrJbxx.setDjbh(String.valueOf(Long.parseLong(zwywLrJbxxMapper.selectMaxBh(zwywLrJbxx.getLrHjdz().substring(0, 6))) + 1));
|
|
|
+ // 本系统的老人注册
|
|
|
String userId = insertUser(zwywLrJbxx);
|
|
|
+ if (StringUtils.isEmpty(userId)) {
|
|
|
+ throw new ServiceException("用户已经存在");
|
|
|
+ }
|
|
|
+ // 主键直接使用该userId
|
|
|
zwywLrJbxx.setId(userId);
|
|
|
+ // 插入出生日期和性别
|
|
|
+ try {
|
|
|
+ if (StringUtils.isEmpty(zwywLrJbxx.getLrCsrq())) {
|
|
|
+ zwywLrJbxx.setLrCsrq(zwywLrJbxx.getLrZjhm().substring(7, 15));
|
|
|
+ }
|
|
|
+ if (StringUtils.isEmpty(zwywLrJbxx.getLrXb())) {
|
|
|
+ String xb = Integer.parseInt(zwywLrJbxx.getLrZjhm().substring(17, 18)) % 2 == 0 ? "2" : "1";
|
|
|
+ zwywLrJbxx.setLrXb(xb);
|
|
|
+ }
|
|
|
+ } catch (Exception ignored) {}
|
|
|
+ // 插入本条老人数据
|
|
|
res = zwywLrJbxxMapper.insert(zwywLrJbxx);
|
|
|
+ // 直接插入一条空的活体数据
|
|
|
LnstYlht ht = new LnstYlht();
|
|
|
ht.setId(IdUtils.simpleUUID());
|
|
|
ht.setYlcode(zwywLrJbxx.getYlcode());
|
|
@@ -307,6 +332,54 @@ public class ZwywLrJbxxServiceImpl implements IZwywLrJbxxService {
|
|
|
return res;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 修改老人基本信息
|
|
|
+ *
|
|
|
+ * @param zwywLrJbxx 老人基本信息
|
|
|
+ * @return 结果
|
|
|
+ */
|
|
|
+ @Transactional
|
|
|
+ @Override
|
|
|
+ public int updateZwywLrJbxx(InLnstLrxx zwywLrJbxx) {
|
|
|
+ // 检测是否存在老人户籍地址
|
|
|
+ if (StringUtils.isEmpty(zwywLrJbxx.getLrHjdz())) {
|
|
|
+ InLnstLrxx old = zwywLrJbxxMapper.selectById(zwywLrJbxx.getId());
|
|
|
+ if (ObjectUtils.isNotEmpty(old)) {
|
|
|
+ zwywLrJbxx.setLrHjdz(old.getLrHjdz());
|
|
|
+ } else {
|
|
|
+ throw new ServiceException("该老人已被删除");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // 判断老人更新的户籍地址是否是强制注册的区划
|
|
|
+ LnstDeptExamine examine = lnstDeptExamineMapper.selectList(new LambdaQueryWrapper<LnstDeptExamine>()
|
|
|
+ .eq(LnstDeptExamine::getCode, zwywLrJbxx.getLrHjdz().substring(0, 6) + "000000")).stream().findFirst().orElse(null);
|
|
|
+ // 当前需要审核的情况
|
|
|
+ if (StringUtils.equals(zwywLrJbxx.getLzzt(), "1") || StringUtils.equals(zwywLrJbxx.getLzzt(), "2")
|
|
|
+ || StringUtils.equals(zwywLrJbxx.getLzzt(), "5") || ObjectUtils.isNotEmpty(examine)
|
|
|
+ || !StringUtils.isAllEmpty(zwywLrJbxx.getTkzm(), zwywLrJbxx.getDbzm(), zwywLrJbxx.getZczm())) {
|
|
|
+ InLnstShxx shxx = new InLnstShxx();
|
|
|
+ BeanUtil.copyProperties(zwywLrJbxx, shxx, new CopyOptions().ignoreNullValue());
|
|
|
+ if (StringUtils.equals(zwywLrJbxx.getLzzt(), "1")) {
|
|
|
+ shxx.setSqyy("老人照片与证件照匹配度过低");
|
|
|
+ } else if (StringUtils.equals(zwywLrJbxx.getLzzt(), "2")) {
|
|
|
+ shxx.setSqyy("存在相似老人照片");
|
|
|
+ } else if (StringUtils.equals(zwywLrJbxx.getLzzt(), "5")
|
|
|
+ || !StringUtils.isAllEmpty(zwywLrJbxx.getTkzm(), zwywLrJbxx.getDbzm(), zwywLrJbxx.getZczm())) {
|
|
|
+ zwywLrJbxx.setLzzt("5");
|
|
|
+ shxx.setSqyy("特殊材料待审");
|
|
|
+ } else {
|
|
|
+ zwywLrJbxx.setLzzt("7");
|
|
|
+ shxx.setSqyy("老人待审核");
|
|
|
+ }
|
|
|
+ shxx.setId(IdUtils.simpleUUID());
|
|
|
+ shxx.setLrId(zwywLrJbxx.getId());
|
|
|
+ shxx.setSqsj(DateUtils.dateTimeNow());
|
|
|
+ shxx.setLzzt(zwywLrJbxx.getLzzt());
|
|
|
+ zwywJclrShxxMapper.insert(shxx);
|
|
|
+ }
|
|
|
+ return zwywLrJbxxMapper.updateById(zwywLrJbxx);
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
public int sh(InLnstShxx shxx) {
|
|
|
int res = 0;
|
|
@@ -338,6 +411,14 @@ public class ZwywLrJbxxServiceImpl implements IZwywLrJbxxService {
|
|
|
return zwywLrJbxxMapper.updateById(lrxx);
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public InLnstLrxx getLrByZjhm(InLnstLrxx zwywLrJbxx) {
|
|
|
+ if (StringUtils.isEmpty(zwywLrJbxx.getLrJmzjhm())) {
|
|
|
+ throw new ServiceException("缺失必要参数");
|
|
|
+ }
|
|
|
+ return zwywLrJbxxMapper.selectOne(new LambdaQueryWrapper<>(zwywLrJbxx));
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
public Map<String, String> match(InLnstLrxx zwywLrJbxx) {
|
|
|
Map<String, String> res = new LinkedHashMap<>();
|
|
@@ -659,52 +740,6 @@ public class ZwywLrJbxxServiceImpl implements IZwywLrJbxxService {
|
|
|
return res;
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * 修改老人基本信息
|
|
|
- *
|
|
|
- * @param zwywLrJbxx 老人基本信息
|
|
|
- * @return 结果
|
|
|
- */
|
|
|
- @Transactional
|
|
|
- @Override
|
|
|
- public int updateZwywLrJbxx(InLnstLrxx zwywLrJbxx)
|
|
|
- {
|
|
|
- if (StringUtils.isEmpty(zwywLrJbxx.getLrHjdz())) {
|
|
|
- InLnstLrxx old = zwywLrJbxxMapper.selectById(zwywLrJbxx.getId());
|
|
|
- if (ObjectUtils.isNotEmpty(old)) {
|
|
|
- zwywLrJbxx.setLrHjdz(old.getLrHjdz());
|
|
|
- } else {
|
|
|
- throw new ServiceException("该老人已被删除");
|
|
|
- }
|
|
|
- }
|
|
|
- LnstDeptExamine examine = lnstDeptExamineMapper.selectList(new LambdaQueryWrapper<LnstDeptExamine>()
|
|
|
- .eq(LnstDeptExamine::getCode, zwywLrJbxx.getLrHjdz())).stream().findFirst().orElse(null);
|
|
|
- if (StringUtils.equals(zwywLrJbxx.getLzzt(), "1") || StringUtils.equals(zwywLrJbxx.getLzzt(), "2")
|
|
|
- || StringUtils.equals(zwywLrJbxx.getLzzt(), "5") || ObjectUtils.isNotEmpty(examine)
|
|
|
- || !StringUtils.isAllEmpty(zwywLrJbxx.getTkzm(), zwywLrJbxx.getDbzm(), zwywLrJbxx.getZczm())) {
|
|
|
- InLnstShxx shxx = new InLnstShxx();
|
|
|
- BeanUtil.copyProperties(zwywLrJbxx, shxx, new CopyOptions().ignoreNullValue());
|
|
|
- if (StringUtils.equals(zwywLrJbxx.getLzzt(), "1")) {
|
|
|
- shxx.setSqyy("老人照片与证件照匹配度过低");
|
|
|
- } else if (StringUtils.equals(zwywLrJbxx.getLzzt(), "2")) {
|
|
|
- shxx.setSqyy("存在相似老人照片");
|
|
|
- } else if (StringUtils.equals(zwywLrJbxx.getLzzt(), "5")
|
|
|
- || !StringUtils.isAllEmpty(zwywLrJbxx.getTkzm(), zwywLrJbxx.getDbzm(), zwywLrJbxx.getZczm())) {
|
|
|
- zwywLrJbxx.setLzzt("5");
|
|
|
- shxx.setSqyy("特殊材料待审");
|
|
|
- } else {
|
|
|
- zwywLrJbxx.setLzzt("7");
|
|
|
- shxx.setSqyy("老人待审核");
|
|
|
- }
|
|
|
- shxx.setId(IdUtils.simpleUUID());
|
|
|
- shxx.setLrId(zwywLrJbxx.getId());
|
|
|
- shxx.setSqsj(DateUtils.dateTimeNow());
|
|
|
- shxx.setLzzt(zwywLrJbxx.getLzzt());
|
|
|
- zwywJclrShxxMapper.insert(shxx);
|
|
|
- }
|
|
|
- return zwywLrJbxxMapper.updateById(zwywLrJbxx);
|
|
|
- }
|
|
|
-
|
|
|
/**
|
|
|
* 批量删除老人基本信息
|
|
|
*
|