Browse Source

徽章

dev_shibei_match
zxc 5 years ago
parent
commit
8b605530df
  1. 4
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeServiceImpl.java
  2. 2
      epmet-user/epmet-user-server/src/main/resources/mapper/BadgeDao.xml
  3. 15
      epmet-user/epmet-user-server/src/main/resources/mapper/UserBadgeDao.xml

4
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeServiceImpl.java

@ -20,7 +20,6 @@ import com.epmet.service.UserBadgeService;
import com.epmet.service.UserBaseInfoService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -28,8 +27,6 @@ import org.springframework.util.CollectionUtils;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* @Author zxc
@ -251,6 +248,7 @@ public class UserBadgeServiceImpl implements UserBadgeService {
}
userBadgeRedis.setCustomerBadge(resultUserBadge, customerId);
}
userBadgeRedis.setCustomerBadge(userBadgeListResultDTOS, customerId);
}
}

2
epmet-user/epmet-user-server/src/main/resources/mapper/BadgeDao.xml

@ -42,7 +42,7 @@
WHERE CUSTOMER_ID = #{customerId} AND DEL_FLAG = '0'
UNION ALL
SELECT * FROM badge a
WHERE CUSTOMER_ID = 'default' AND a.DEL_FLAG = '0'
WHERE CUSTOMER_ID = 'default' AND a.DEL_FLAG = '0' AND BADGE_STATUS = 'online'
AND NOT EXISTS
( SELECT ID FROM badge b WHERE CUSTOMER_ID = #{customerId} AND a.ID = b.ID)) t
ORDER BY

15
epmet-user/epmet-user-server/src/main/resources/mapper/UserBadgeDao.xml

@ -47,11 +47,16 @@
BADGE_NAME,
BADGE_ICON,
FIXATION_BADGE_TYPE AS badgeType
FROM badge
WHERE
DEL_FLAG = '0'
AND (CUSTOMER_ID = 'default' OR CUSTOMER_ID = #{customerId})
AND BADGE_STATUS = 'online'
FROM (
SELECT * FROM badge
WHERE CUSTOMER_ID = #{customerId} AND DEL_FLAG = '0'
UNION ALL
SELECT * FROM badge a
WHERE CUSTOMER_ID = 'default' AND a.DEL_FLAG = '0' AND BADGE_STATUS = 'online'
AND NOT EXISTS
( SELECT ID FROM badge b WHERE CUSTOMER_ID = #{customerId} AND a.ID = b.ID)) t
ORDER BY
CREATED_TIME DESC
</select>
<!-- 查询徽章认证记录 -->

Loading…
Cancel
Save