|
@@ -288,6 +288,62 @@ public class ZwywLrJbxxServiceImpl implements IZwywLrJbxxService {
|
|
|
return zwywLrJbxxMapper.insert(zwywLrJbxx);
|
|
|
}
|
|
|
|
|
|
+ @Transactional
|
|
|
+ @Override
|
|
|
+ public int insertZwywLrJbxxSb(InLnstLrxx zwywLrJbxx) {
|
|
|
+ // 微信端自主申报专用新增
|
|
|
+ // 重复性检测 老人信息表/本系统老人用户表/银联系统会员表
|
|
|
+ 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("该证件号码账号已存在");
|
|
|
+ }
|
|
|
+ // 自主申报待审核
|
|
|
+ zwywLrJbxx.setLzzt("8");
|
|
|
+ // 调用银联会员注册接口,将返回值放到 银联code 和 银联会员卡code 中
|
|
|
+ JSONObject ylRes = ylServer.ylQuery(zwywLrJbxx);
|
|
|
+ System.out.println("银联查询 ====》 " + ylRes);
|
|
|
+ if (ObjectUtils.isNotEmpty(ylRes) && ylRes.containsKey("respCode") && StringUtils.equals(ylRes.getString("respCode"), "0000")) {
|
|
|
+ throw new ServiceException("该证件号码账号已存在");
|
|
|
+ }
|
|
|
+ // 老人加密证件号码
|
|
|
+ zwywLrJbxx.setLrJmzjhm(DigestUtils.md5Hex(zwywLrJbxx.getLrZjhm()));
|
|
|
+ // 本系统的老人注册
|
|
|
+ String userId = insertUser(zwywLrJbxx);
|
|
|
+ if (StringUtils.isEmpty(userId)) {
|
|
|
+ throw new ServiceException("用户已经存在");
|
|
|
+ }
|
|
|
+ // 主键直接使用该userId
|
|
|
+ zwywLrJbxx.setId(userId);
|
|
|
+ // 生成登记编号
|
|
|
+ zwywLrJbxx.setDjbh(String.valueOf(Long.parseLong(zwywLrJbxxMapper.selectMaxBh(zwywLrJbxx.getLrHjdz().substring(0, 6))) + 1));
|
|
|
+ // 用餐状态禁用
|
|
|
+ zwywLrJbxx.setState("0");
|
|
|
+ // 插入出生日期和性别
|
|
|
+ try {
|
|
|
+ if (StringUtils.isEmpty(zwywLrJbxx.getLrCsrq())) {
|
|
|
+ zwywLrJbxx.setLrCsrq(zwywLrJbxx.getLrZjhm().substring(6, 14));
|
|
|
+ }
|
|
|
+ if (StringUtils.isEmpty(zwywLrJbxx.getLrXb())) {
|
|
|
+ String xb = Integer.parseInt(zwywLrJbxx.getLrZjhm().substring(17, 18)) % 2 == 0 ? "2" : "1";
|
|
|
+ zwywLrJbxx.setLrXb(xb);
|
|
|
+ }
|
|
|
+ } catch (Exception ignored) {}
|
|
|
+ int res = zwywLrJbxxMapper.insert(zwywLrJbxx);
|
|
|
+ InLnstShxx shxx = new InLnstShxx();
|
|
|
+ BeanUtil.copyProperties(zwywLrJbxx, shxx, new CopyOptions().ignoreNullValue());
|
|
|
+ // 拒绝后修改必须审核
|
|
|
+ shxx.setSqyy("老人自主申报");
|
|
|
+ shxx.setId(IdUtils.simpleUUID());
|
|
|
+ shxx.setLrId(zwywLrJbxx.getId());
|
|
|
+ shxx.setSqsj(DateUtils.dateTimeNow());
|
|
|
+ shxx.setLzzt(zwywLrJbxx.getLzzt());
|
|
|
+ insertShxx(shxx);
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+
|
|
|
@Transactional
|
|
|
@Override
|
|
|
public int insertZwywLrJbxxWeb(InLnstLrxx zwywLrJbxx) {
|
|
@@ -651,16 +707,52 @@ public class ZwywLrJbxxServiceImpl implements IZwywLrJbxxService {
|
|
|
up.setId(shxx.getLrId());
|
|
|
up.setLrSp(shxx.getSpjg());
|
|
|
up.setLrSpyj(shxx.getSpyj());
|
|
|
- if (StringUtils.equals(shxx.getSpjg(), ExamineStatus.SYES.getCode())) {
|
|
|
- up.setLzzt("3");
|
|
|
- up.setLrTx(shxx.getLrTx());
|
|
|
- up.setLrZjz(shxx.getLrZjz());
|
|
|
- up.setState("1");
|
|
|
- // 通过的情况把银联那边的账号启用
|
|
|
- ylServer.ylEnabled(lr.getYlcode(), lr.getMchnt());
|
|
|
+ if (StringUtils.equals(lr.getLzzt(), "8")) {
|
|
|
+ // 老人自主申报专用审核
|
|
|
+ if (StringUtils.equals(shxx.getSpjg(), ExamineStatus.SYES.getCode())) {
|
|
|
+ EncryptionUtils.decryptForPlaintext(lr);
|
|
|
+ up.setLzzt("0");
|
|
|
+ // 插入园区码
|
|
|
+ up.setMchnt(getMchntCode(lr.getLrHjdz()));
|
|
|
+ // 调用银联会员注册接口,将返回值放到 银联code 和 银联会员卡code 中
|
|
|
+ JSONObject ylRes = ylServer.ylQuery(lr);
|
|
|
+ System.out.println("银联查询 ====》 " + ylRes);
|
|
|
+ if (ObjectUtils.isNotEmpty(ylRes) && ylRes.containsKey("respCode") && StringUtils.equals(ylRes.getString("respCode"), "0000")) {
|
|
|
+// throw new ServiceException("银联系统中该证件号码账号已存在");
|
|
|
+ up.setYlcode(ylRes.getJSONObject("member").getString("memberCode"));
|
|
|
+ up.setYlcard(ylRes.getJSONObject("member").getString("cardCode"));
|
|
|
+ System.out.println("---测试版本银联账号复用");
|
|
|
+ } else {
|
|
|
+ // 调用银联会员注册接口,将返回值放到 银联code 和 银联会员卡code 中
|
|
|
+ InLnstLrxx inYl = new InLnstLrxx();
|
|
|
+ inYl.setLrXm(lr.getLrXm());
|
|
|
+ inYl.setLrZjhm(lr.getLrZjhm());
|
|
|
+ inYl.setLrHjdz(lr.getLrHjdz());
|
|
|
+ inYl.setLrHjbcxx(lr.getLrHjbcxx());
|
|
|
+ JSONObject yl = ylServer.ylRegister(inYl);
|
|
|
+ if (ObjectUtils.isNotEmpty(yl) && yl.containsKey("respCode") && StringUtils.equals(yl.getString("respCode"), "0000")) {
|
|
|
+ up.setYlcode(yl.getString("memberCode"));
|
|
|
+ up.setYlcard(yl.getString("cardCode"));
|
|
|
+ } else {
|
|
|
+ throw new ServiceException("银联账号注册失败 ===》 " + yl);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ up.setLzzt("9");
|
|
|
+ }
|
|
|
} else {
|
|
|
- up.setState("0");
|
|
|
- up.setLzzt("4");
|
|
|
+ // 其他审核
|
|
|
+ if (StringUtils.equals(shxx.getSpjg(), ExamineStatus.SYES.getCode())) {
|
|
|
+ up.setLzzt("3");
|
|
|
+ up.setLrTx(shxx.getLrTx());
|
|
|
+ up.setLrZjz(shxx.getLrZjz());
|
|
|
+ up.setState("1");
|
|
|
+ // 通过的情况把银联那边的账号启用
|
|
|
+ ylServer.ylEnabled(lr.getYlcode(), lr.getMchnt());
|
|
|
+ } else {
|
|
|
+ up.setState("0");
|
|
|
+ up.setLzzt("4");
|
|
|
+ }
|
|
|
}
|
|
|
shxx.setState("99");
|
|
|
shxx.setSpsj(DateUtils.dateTimeNow());
|