From 34e65d72e73acab040b68d01ef6b4764b4408624 Mon Sep 17 00:00:00 2001
From: admin <weikou2014>
Date: 星期一, 05 八月 2019 10:07:38 +0800
Subject: [PATCH] 修改推荐记录点击详情跳转方式不对的bug
---
fanli/src/main/java/com/yeshi/fanli/service/impl/user/ForbiddenUserIdentifyCodeServiceImpl.java | 59 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++---
1 files changed, 56 insertions(+), 3 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..44ffd34 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
@@ -21,15 +21,16 @@
private ForbiddenUserIdentifyCodeMapper forbiddenUserIdentifyCodeMapper;
@Override
- public void addIdentifyCode(ForbiddenUserIdentifyCode identifyCode) throws ForbiddenUserIdentifyCodeException {
+ public void forbiddenIdentifyCode(ForbiddenUserIdentifyCode identifyCode) throws ForbiddenUserIdentifyCodeException {
if (identifyCode == null || identifyCode.getType() == null
|| StringUtil.isNullOrEmpty(identifyCode.getIdentifyCode()))
throw new ForbiddenUserIdentifyCodeException(1, "淇℃伅涓嶅畬鏁�");
ForbiddenUserIdentifyCode old = listByTypeAndIdentifyCode(identifyCode.getType(),
identifyCode.getIdentifyCode());
- if (old != null)
- throw new ForbiddenUserIdentifyCodeException(2, "淇℃伅宸插瓨鍦�");
+ if (old != null) {
+ identifyCode.setId(old.getId());
+ }
identifyCode.setCreateTime(new Date());
identifyCode.setEffective(true);
@@ -62,4 +63,56 @@
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:
+ 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 {
+
+ Boolean effective = codeObject.getEffective();
+ if (effective) {
+ // 瑙e皝
+ codeObject.setEffective(false);
+ } else {
+ // 灏佺
+ codeObject.setEffective(true);
+ }
+
+
+ codeObject.setUpdateTime(new Date());
+ forbiddenUserIdentifyCodeMapper.updateByPrimaryKeySelective(codeObject);
+ }
+ }
+
}
--
Gitblit v1.8.0