Commit c38e6885 by 墨竹

feat:welcome修改

parent 1630a44f
......@@ -11,6 +11,9 @@ import java.util.Date;
* @author fdh
*/
public class WelcomeDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
*
*/
......@@ -30,6 +33,12 @@ public class WelcomeDTO implements Serializable {
* 内容
*/
private String welcomeContent;
/**
* 图片
*/
private String welcomeImg;
/**
* 0删除 1正常
*/
......@@ -49,140 +58,74 @@ public class WelcomeDTO implements Serializable {
*/
private Date updateTime;
/**
*/
private static final long serialVersionUID = 1L;
public Integer getOpenFlag() {
return openFlag;
}
public void setOpenFlag(Integer openFlag) {
this.openFlag = openFlag;
}
/**
* This method returns the value of the database column tab_haoban_welcome.welcome_id
*
* @return the value of tab_haoban_welcome.welcome_id
*/
public String getWelcomeId() {
return welcomeId;
}
/**
* This method sets the value of the database column tab_haoban_welcome.welcome_id
*
* @param welcomeId the value for tab_haoban_welcome.welcome_id
*/
public void setWelcomeId(String welcomeId) {
this.welcomeId = welcomeId;
}
/**
* This method returns the value of the database column tab_haoban_welcome.wx_enterprise_id
*
* @return the value of tab_haoban_welcome.wx_enterprise_id
*/
public String getWxEnterpriseId() {
return wxEnterpriseId;
}
/**
* This method sets the value of the database column tab_haoban_welcome.wx_enterprise_id
*
* @param wxEnterpriseId the value for tab_haoban_welcome.wx_enterprise_id
*/
public void setWxEnterpriseId(String wxEnterpriseId) {
this.wxEnterpriseId = wxEnterpriseId;
}
/**
* This method returns the value of the database column tab_haoban_welcome.title
*
* @return the value of tab_haoban_welcome.title
*/
public String getTitle() {
return title;
}
/**
* This method sets the value of the database column tab_haoban_welcome.title
*
* @param title the value for tab_haoban_welcome.title
*/
public void setTitle(String title) {
this.title = title;
}
/**
* This method returns the value of the database column tab_haoban_welcome.welcome_content
*
* @return the value of tab_haoban_welcome.welcome_content
*/
public String getWelcomeContent() {
return welcomeContent;
}
/**
* This method sets the value of the database column tab_haoban_welcome.welcome_content
*
* @param welcomeContent the value for tab_haoban_welcome.welcome_content
*/
public void setWelcomeContent(String welcomeContent) {
this.welcomeContent = welcomeContent;
}
/**
* This method returns the value of the database column tab_haoban_welcome.status_flag
*
* @return the value of tab_haoban_welcome.status_flag
*/
public String getWelcomeImg() {
return welcomeImg;
}
public void setWelcomeImg(String welcomeImg) {
this.welcomeImg = welcomeImg;
}
public Integer getOpenFlag() {
return openFlag;
}
public void setOpenFlag(Integer openFlag) {
this.openFlag = openFlag;
}
public Integer getStatusFlag() {
return statusFlag;
}
/**
* This method sets the value of the database column tab_haoban_welcome.status_flag
*
* @param statusFlag the value for tab_haoban_welcome.status_flag
*/
public void setStatusFlag(Integer statusFlag) {
this.statusFlag = statusFlag;
}
/**
* This method returns the value of the database column tab_haoban_welcome.create_time
*
* @return the value of tab_haoban_welcome.create_time
*/
public Date getCreateTime() {
return createTime;
}
/**
* This method sets the value of the database column tab_haoban_welcome.create_time
*
* @param createTime the value for tab_haoban_welcome.create_time
*/
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
/**
* This method returns the value of the database column tab_haoban_welcome.update_time
*
* @return the value of tab_haoban_welcome.update_time
*/
public Date getUpdateTime() {
return updateTime;
}
/**
* This method sets the value of the database column tab_haoban_welcome.update_time
*
* @param updateTime the value for tab_haoban_welcome.update_time
*/
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
......
......@@ -137,7 +137,7 @@ public interface WxEnterpriseApiService {
boolean setWelcome(String wxEnterpriseId, Integer openFlag);
/**
* 获取欢迎语
* 删除欢迎语
*
* @param wxEnterpriseId
* @return
......
......@@ -15,10 +15,6 @@ public interface TabHaobanWelcomeMapper {
/**
*/
int insertSelective(TabWelcome record);
/**
*/
TabWelcome selectByPrimaryKey(String welcomeId);
/**
......@@ -27,9 +23,5 @@ public interface TabHaobanWelcomeMapper {
/**
*/
int updateByPrimaryKey(TabWelcome record);
/**
*/
TabWelcome selectByWxEnterpriseId(String wxEnterpriseId);
}
\ No newline at end of file
......@@ -11,6 +11,8 @@ import java.util.Date;
* @author fdh
*/
public class TabWelcome implements Serializable {
private static final long serialVersionUID = 1L;
/**
*
*/
......@@ -32,6 +34,11 @@ public class TabWelcome implements Serializable {
private String welcomeContent;
/**
* 图片
*/
private String welcomeImg;
/**
* 0删除 1正常
*/
private Integer openFlag;
......@@ -51,141 +58,74 @@ public class TabWelcome implements Serializable {
*/
private Date updateTime;
/**
*/
private static final long serialVersionUID = 1L;
public Integer getOpenFlag() {
return openFlag;
}
public void setOpenFlag(Integer openFlag) {
this.openFlag = openFlag;
}
/**
* This method returns the value of the database column tab_haoban_welcome.welcome_id
*
* @return the value of tab_haoban_welcome.welcome_id
*/
public String getWelcomeId() {
return welcomeId;
}
/**
* This method sets the value of the database column tab_haoban_welcome.welcome_id
*
* @param welcomeId the value for tab_haoban_welcome.welcome_id
*/
public void setWelcomeId(String welcomeId) {
this.welcomeId = welcomeId;
}
/**
* This method returns the value of the database column tab_haoban_welcome.wx_enterprise_id
*
* @return the value of tab_haoban_welcome.wx_enterprise_id
*/
public String getWxEnterpriseId() {
return wxEnterpriseId;
}
/**
* This method sets the value of the database column tab_haoban_welcome.wx_enterprise_id
*
* @param wxEnterpriseId the value for tab_haoban_welcome.wx_enterprise_id
*/
public void setWxEnterpriseId(String wxEnterpriseId) {
this.wxEnterpriseId = wxEnterpriseId;
}
/**
* This method returns the value of the database column tab_haoban_welcome.title
*
* @return the value of tab_haoban_welcome.title
*/
public String getTitle() {
return title;
}
/**
* This method sets the value of the database column tab_haoban_welcome.title
*
* @param title the value for tab_haoban_welcome.title
*/
public void setTitle(String title) {
this.title = title;
}
/**
* This method returns the value of the database column tab_haoban_welcome.welcome_content
*
* @return the value of tab_haoban_welcome.welcome_content
*/
public String getWelcomeContent() {
return welcomeContent;
}
/**
* This method sets the value of the database column tab_haoban_welcome.welcome_content
*
* @param welcomeContent the value for tab_haoban_welcome.welcome_content
*/
public void setWelcomeContent(String welcomeContent) {
this.welcomeContent = welcomeContent;
}
/**
* This method returns the value of the database column tab_haoban_welcome.status_flag
*
* @return the value of tab_haoban_welcome.status_flag
*/
public String getWelcomeImg() {
return welcomeImg;
}
public void setWelcomeImg(String welcomeImg) {
this.welcomeImg = welcomeImg;
}
public Integer getOpenFlag() {
return openFlag;
}
public void setOpenFlag(Integer openFlag) {
this.openFlag = openFlag;
}
public Integer getStatusFlag() {
return statusFlag;
}
/**
* This method sets the value of the database column tab_haoban_welcome.status_flag
*
* @param statusFlag the value for tab_haoban_welcome.status_flag
*/
public void setStatusFlag(Integer statusFlag) {
this.statusFlag = statusFlag;
}
/**
* This method returns the value of the database column tab_haoban_welcome.create_time
*
* @return the value of tab_haoban_welcome.create_time
*/
public Date getCreateTime() {
return createTime;
}
/**
* This method sets the value of the database column tab_haoban_welcome.create_time
*
* @param createTime the value for tab_haoban_welcome.create_time
*/
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
/**
* This method returns the value of the database column tab_haoban_welcome.update_time
*
* @return the value of tab_haoban_welcome.update_time
*/
public Date getUpdateTime() {
return updateTime;
}
/**
* This method sets the value of the database column tab_haoban_welcome.update_time
*
* @param updateTime the value for tab_haoban_welcome.update_time
*/
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
......
......@@ -264,7 +264,7 @@ public class WxEnterpriseApiServiceImpl implements WxEnterpriseApiService {
}
tabWelcome.setOpenFlag(openFlag);
tabWelcome.setUpdateTime(new Date());
welcomeMapper.updateByPrimaryKey(tabWelcome);
welcomeMapper.updateByPrimaryKeySelective(tabWelcome);
return true;
}
......@@ -276,7 +276,7 @@ public class WxEnterpriseApiServiceImpl implements WxEnterpriseApiService {
}
tabWelcome.setStatusFlag(0);
tabWelcome.setUpdateTime(new Date());
welcomeMapper.updateByPrimaryKey(tabWelcome);
welcomeMapper.updateByPrimaryKeySelective(tabWelcome);
return true;
}
......
......@@ -240,6 +240,7 @@
and external_user_id = #{externalUserId}
and status_flag = 1
</select>
<update id="delByUserIdAndExternalUserId"
parameterType="com.gic.haoban.manage.service.entity.TabHaobanExternalClerkRelated">
update tab_haoban_external_clerk_related
......
......@@ -6,81 +6,40 @@
<result column="wx_enterprise_id" jdbcType="VARCHAR" property="wxEnterpriseId"/>
<result column="title" jdbcType="VARCHAR" property="title"/>
<result column="welcome_content" jdbcType="VARCHAR" property="welcomeContent"/>
<result column="welcome_img" jdbcType="VARCHAR" property="welcomeImg"/>
<result column="status_flag" jdbcType="INTEGER" property="statusFlag"/>
<result column="open_flag" jdbcType="INTEGER" property="openFlag"/>
<result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
</resultMap>
<sql id="Base_Column_List">
welcome_id, wx_enterprise_id, title, welcome_content,open_flag, status_flag, create_time, update_time
</sql>
welcome_id, wx_enterprise_id, title, welcome_content,welcome_img,open_flag, status_flag, create_time, update_time
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from tab_haoban_welcome
where welcome_id = #{welcomeId,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
delete from tab_haoban_welcome
where welcome_id = #{welcomeId,jdbcType=VARCHAR}
</delete>
delete
from tab_haoban_welcome
where welcome_id = #{welcomeId,jdbcType=VARCHAR}
</delete>
<insert id="insert" parameterType="com.gic.haoban.manage.service.entity.TabWelcome">
insert into tab_haoban_welcome (welcome_id, wx_enterprise_id, title,
welcome_content,open_flag, status_flag, create_time,
update_time)
values (#{welcomeId,jdbcType=VARCHAR}, #{wxEnterpriseId,jdbcType=VARCHAR}, #{title,jdbcType=VARCHAR},
#{welcomeContent,jdbcType=VARCHAR},#{openFlag}, #{statusFlag,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP},
#{updateTime,jdbcType=TIMESTAMP})
</insert>
<insert id="insertSelective" parameterType="com.gic.haoban.manage.service.entity.TabWelcome">
insert into tab_haoban_welcome
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="welcomeId != null">
welcome_id,
</if>
<if test="wxEnterpriseId != null">
wx_enterprise_id,
</if>
<if test="title != null">
title,
</if>
<if test="welcomeContent != null">
welcome_content,
</if>
<if test="statusFlag != null">
status_flag,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateTime != null">
update_time,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="welcomeId != null">
#{welcomeId,jdbcType=VARCHAR},
</if>
<if test="wxEnterpriseId != null">
#{wxEnterpriseId,jdbcType=VARCHAR},
</if>
<if test="title != null">
#{title,jdbcType=VARCHAR},
</if>
<if test="welcomeContent != null">
#{welcomeContent,jdbcType=VARCHAR},
</if>
<if test="statusFlag != null">
#{statusFlag,jdbcType=INTEGER},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=TIMESTAMP},
</if>
</trim>
insert into tab_haoban_welcome (welcome_id, wx_enterprise_id, title,
welcome_content, welcome_img, open_flag, status_flag, create_time,
update_time)
values (#{welcomeId,jdbcType=VARCHAR}, #{wxEnterpriseId,jdbcType=VARCHAR}, #{title,jdbcType=VARCHAR},
#{welcomeContent,jdbcType=VARCHAR}, #{welcomeImg,jdbcType=VARCHAR}, #{openFlag},
#{statusFlag,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP},
#{updateTime,jdbcType=TIMESTAMP})
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.gic.haoban.manage.service.entity.TabWelcome">
update tab_haoban_welcome
<set>
......@@ -93,6 +52,9 @@
<if test="welcomeContent != null">
welcome_content = #{welcomeContent,jdbcType=VARCHAR},
</if>
<if test="welcomeImg != null">
welcome_img = #{welcomeImg,jdbcType=VARCHAR},
</if>
<if test="openFlag != null">
open_flag = #{openFlag,jdbcType=INTEGER},
</if>
......@@ -108,17 +70,6 @@
</set>
where welcome_id = #{welcomeId,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="com.gic.haoban.manage.service.entity.TabWelcome">
update tab_haoban_welcome
set wx_enterprise_id = #{wxEnterpriseId,jdbcType=VARCHAR},
title = #{title,jdbcType=VARCHAR},
welcome_content = #{welcomeContent,jdbcType=VARCHAR},
open_flag = #{openFlag,jdbcType=INTEGER},
status_flag = #{statusFlag,jdbcType=INTEGER},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP}
where welcome_id = #{welcomeId,jdbcType=VARCHAR}
</update>
<select id="selectByWxEnterpriseId" parameterType="java.lang.String" resultMap="BaseResultMap">
select
......
......@@ -73,11 +73,13 @@ public class LoginController extends WebBaseController {
private Config config;
@RequestMapping("login")
@Deprecated
public void login(String auth_code, HttpServletResponse response) {
String userJson = qywxCorpApiService.getLoginUserInfo(config.getCorpid(), auth_code);
if (StringUtils.isBlank(userJson)) {
return;
}
UserDTO user = JSON.parseObject(userJson, UserDTO.class);
String corpId = user.getCorpid();
logger.info("【企业微信登录】userId={},auth_code={},corpId={}", user.getUserid(), auth_code, corpId);
......@@ -117,10 +119,10 @@ public class LoginController extends WebBaseController {
} catch (IOException e) {
logger.warn("异常", e);
}
}
@RequestMapping("login_local")
@Deprecated
public HaobanResponse login() {
LoginDTO loginVO = new LoginDTO();
......@@ -141,6 +143,7 @@ public class LoginController extends WebBaseController {
* @return res
*/
@RequestMapping("get-login-info")
@Deprecated
public HaobanResponse getLoginInfo() {
LoginDTO loginVO = (LoginDTO) AuthRequestUtil.getLoginUser();
return resultResponse(HaoBanErrCode.ERR_1, loginVO);
......@@ -151,9 +154,7 @@ public class LoginController extends WebBaseController {
String corpid = config.getCorpid();
String redirectUri = config.getHost() + "login";
String url = "https://open.work.weixin.qq.com/wwopen/sso/3rd_qrConnect?appid=" + corpid + "&redirect_uri=" + URLEncoder.encode(redirectUri, "UTF-8") + "&state=web_login@gyoss9&usertype=admin";
//String url = qywxCorpApiService.getGrantAuthorizationUrl(siteId, redirectUri);
return resultResponse(HaoBanErrCode.ERR_1, URL.decode(url));
}
/**
......@@ -196,7 +197,6 @@ public class LoginController extends WebBaseController {
e.printStackTrace();
}
return resultResponse(HaoBanErrCode.ERR_1);
}
/**
......@@ -290,7 +290,6 @@ public class LoginController extends WebBaseController {
e.printStackTrace();
}
return null;
}
@RequestMapping("login-wx-enterprise-list")
......
package com.gic.haoban.manage.web.interceptor;
import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSONObject;
import com.gic.haoban.auth.api.anno.MenuCheck;
import com.gic.haoban.auth.api.dto.UserRightDetailDTO;
import com.gic.haoban.auth.api.enums.RoleCodeEnum;
import com.gic.haoban.auth.api.service.ClerkRightManageService;
import com.gic.haoban.common.utils.AuthRequestUtil;
import com.gic.haoban.common.utils.HaobanResponse;
import com.gic.haoban.manage.web.anno.IgnoreLogin;
import com.gic.haoban.manage.web.errCode.HaoBanErrCode;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.method.HandlerMethod;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Map;
/**
......@@ -33,7 +23,7 @@ import java.util.Map;
*/
public class WebInterceptor extends HandlerInterceptorAdapter {
private static Logger logger= LoggerFactory.getLogger(WebInterceptor.class);
private static final Logger logger = LoggerFactory.getLogger(WebInterceptor.class);
private void errorResult(HttpServletResponse httpServletResponse, HaoBanErrCode errCode) {
......@@ -56,28 +46,11 @@ public class WebInterceptor extends HandlerInterceptorAdapter {
logger.info("post-url:{}", requestURI);
Map<String, String[]> parameterMap = httpServletRequest.getParameterMap();
logger.info("post-params:{}", JSONObject.toJSONString(parameterMap));
//TODO 登陆信息拦截
Object appLoginUser = AuthRequestUtil.getAppLoginUser();
if (ObjectUtil.isNotNull(appLoginUser)) {
}
return true;
// UserRightDetailDTO loginUser = (UserRightDetailDTO) AuthRequestUtil.getSessionUser();
//
// if (loginUser == null) {
// this.errorResult(httpServletResponse, HaoBanErrCode.ERR_4);
// logger.info("用户不存在!");
// return false;
// }
// HandlerMethod method = null;
// if (o instanceof HandlerMethod) {
// method = (HandlerMethod) (o);
// }
// if (method == null) {
// return true;
// }
// return true;
}
@Override
......
......@@ -17,5 +17,11 @@ public class ClerkLoginQO implements Serializable {
*/
private String phoneNumber;
public String getPhoneNumber() {
return phoneNumber;
}
public void setPhoneNumber(String phoneNumber) {
this.phoneNumber = phoneNumber;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment