|
@@ -1,6 +1,7 @@
|
|
|
package com.dgtly.wxportal.service.impl;
|
|
|
|
|
|
import com.dgtly.common.constant.UserConstants;
|
|
|
+import com.dgtly.common.core.controller.ApiBaseController;
|
|
|
import com.dgtly.common.core.domain.Ztree;
|
|
|
import com.dgtly.common.utils.StringUtils;
|
|
|
import com.dgtly.system.domain.SysRole;
|
|
@@ -10,6 +11,8 @@ import com.dgtly.wxportal.domain.RoleMagnet;
|
|
|
import com.dgtly.wxportal.domain.WxMagnet;
|
|
|
import com.dgtly.wxportal.mapper.WxMagnetMapper;
|
|
|
import com.dgtly.wxportal.service.IWxMagnetService;
|
|
|
+import org.slf4j.Logger;
|
|
|
+import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
@@ -31,6 +34,8 @@ public class WxMagnetServiceImpl implements IWxMagnetService
|
|
|
@Autowired
|
|
|
private SysRoleMenuMapper roleMenuMapper;
|
|
|
|
|
|
+ protected final Logger logger = LoggerFactory.getLogger(WxMagnetServiceImpl.class);
|
|
|
+
|
|
|
|
|
|
/**
|
|
|
* 查询H5磁贴列表
|
|
@@ -195,10 +200,39 @@ public class WxMagnetServiceImpl implements IWxMagnetService
|
|
|
*/
|
|
|
@Override
|
|
|
public List<WxMagnet> selectMagnetByUserId(String userId) {
|
|
|
- return wxMagnetMapper.selectMagnetByUserId(userId);
|
|
|
+
|
|
|
+ List<WxMagnet> list = wxMagnetMapper.selectMagnetByUserId(userId);
|
|
|
+ if(list!=null && list.size()>0){
|
|
|
+ for(WxMagnet wxMagnet: list){
|
|
|
+ logger.info("isEncry::::"+wxMagnet.getIsEncry());
|
|
|
+ if("1".equals(wxMagnet.getIsEncry())){
|
|
|
+ String sapEmploeeId = this.wxMagnetMapper.selectSapEmploeeIdByUserId(userId);
|
|
|
+ logger.info("sapEmploeeId::::"+sapEmploeeId);
|
|
|
+ if(StringUtils.isNotEmpty(sapEmploeeId)){
|
|
|
+ String encry = KL(sapEmploeeId);
|
|
|
+ wxMagnet.setUrl(wxMagnet.getUrl()+"?empCode="+encry);
|
|
|
+ logger.info("url::::"+wxMagnet.getUrl());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return list;
|
|
|
}
|
|
|
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+ public static String KL(String inStr) {
|
|
|
+ char[] a = inStr.toCharArray();
|
|
|
+ for (int i = 0; i < a.length; i++) {
|
|
|
+ a[i] = (char) (a[i] ^ 't');
|
|
|
+ }
|
|
|
+ String s = new String(a);
|
|
|
+ return s;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
/**
|
|
|
* 对象转磁贴树
|
|
|
*
|