From 33b4ed2bbf28ec16b66e552680f56a691a4e908d Mon Sep 17 00:00:00 2001 From: admin <weikou2014> Date: 星期三, 13 三月 2019 12:32:00 +0800 Subject: [PATCH] 清除HongBaoMapper --- fanli/src/main/java/com/yeshi/fanli/service/impl/user/ForbiddenUserIdentifyCodeServiceImpl.java | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 46 insertions(+), 0 deletions(-) diff --git a/fanli/src/main/java/com/yeshi/fanli/service/impl/user/ForbiddenUserIdentifyCodeServiceImpl.java b/fanli/src/main/java/com/yeshi/fanli/service/impl/user/ForbiddenUserIdentifyCodeServiceImpl.java index 4441c3a..e990ed6 100644 --- a/fanli/src/main/java/com/yeshi/fanli/service/impl/user/ForbiddenUserIdentifyCodeServiceImpl.java +++ b/fanli/src/main/java/com/yeshi/fanli/service/impl/user/ForbiddenUserIdentifyCodeServiceImpl.java @@ -62,4 +62,50 @@ forbiddenUserIdentifyCodeMapper.deleteByPrimaryKey(identifyCode.getId()); } + + @Override + public void saveForbiddenInfo(String identifyCode, Integer type) throws ForbiddenUserIdentifyCodeException{ + + ForbiddenUserIdentifyCodeTypeEnum typeEnum = null; + + switch(type) { + case 1: // 寰俊璐﹀彿 + typeEnum = ForbiddenUserIdentifyCodeTypeEnum.wxUnionId; + break; + case 2: // 娣樺疂璐﹀彿 + typeEnum = ForbiddenUserIdentifyCodeTypeEnum.taobaoUid; + break; + case 3: // 鐢佃瘽鍙风爜 + typeEnum = ForbiddenUserIdentifyCodeTypeEnum.phone; + break; + case 4: // 鏀粯瀹濊处鍙� + typeEnum = ForbiddenUserIdentifyCodeTypeEnum.alipayAccount; + break; + default: + break; + } + + if (typeEnum == null) { + throw new ForbiddenUserIdentifyCodeException(1, "绫诲瀷涓嶅尮閰�"); + } + + ForbiddenUserIdentifyCode codeObject = listByTypeAndIdentifyCode(typeEnum ,identifyCode); + if (codeObject == null) { + // 灏佺 + codeObject = new ForbiddenUserIdentifyCode(); + codeObject.setType(typeEnum); + codeObject.setIdentifyCode(identifyCode); + codeObject.setEffective(true); + codeObject.setCreateTime(new Date()); + codeObject.setUpdateTime(new Date()); + + forbiddenUserIdentifyCodeMapper.insertSelective(codeObject); + } else { + // 瑙e皝 + codeObject.setEffective(false); + codeObject.setUpdateTime(new Date()); + forbiddenUserIdentifyCodeMapper.updateByPrimaryKeySelective(codeObject); + } + } + } -- Gitblit v1.8.0