Commit a636dada authored by 盖献康's avatar 盖献康

Merge remote-tracking branch 'origin/dev' into dev

parents caa2f764 70e531cc
package org.rcisoft.integration.aep.Controller;
import com.alibaba.fastjson.JSONObject;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.rcisoft.core.anno.CyOpeLogAnno;
import org.rcisoft.core.operlog.enums.CyLogTypeEnum;
import org.rcisoft.integration.jieLink.dto.JieLinkResultDto;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@Slf4j
@RestController
@RequestMapping("/aep")
public class AepPushController {
/**
* 门磁推送数据接口
* @param data
* @return
*/
@ApiOperation(value="AEP平台集成", notes="门磁数据订阅")
@PostMapping(value = "/pushData")
public JieLinkResultDto pushData(@RequestBody JSONObject data) {
JieLinkResultDto result = new JieLinkResultDto();
log.info(data.toJSONString());
return result;
}
}
......@@ -65,5 +65,10 @@ public interface SysUserRepositorys extends CyBaseMapper<SysUser> {
List<UserDto> selectByOpenid(String wxOpenid);
List<UserDto> selectByPhone(String phone);
//微信根据手机号查询用户
List<UserDto> selectByPhoneWx(String phone);
//微信根据openid查询用户
List<UserDto> selectByOpenidWx(String wxOpenid);
}
......@@ -119,7 +119,7 @@ public class CyWxMiniServiceImpl implements CyWxMiniService {
}
// 2. 未登录
//2.1.1 根据 open_id 数据库数据查询
List<UserDto> sysUsers = repositorys.selectByOpenid(wxOpenid);
List<UserDto> sysUsers = repositorys.selectByOpenidWx(wxOpenid);
if (CollectionUtils.isNotEmpty(sysUsers)){
if(!sysUsers.get(0).getUserType().equals(userType)){
String errMsg = sysUsers.get(0).getUserType().equals("0")? "该手机号未内部员工账号" : "该手机号为外部访客账号";
......@@ -156,7 +156,7 @@ public class CyWxMiniServiceImpl implements CyWxMiniService {
}
String phone = res.get(CyWxMiniCons.PHONE_STR).toString();
log.error("phone---------------------" + phone);
List<UserDto> sysUsers = repositorys.selectByPhone(phone);
List<UserDto> sysUsers = repositorys.selectByPhoneWx(phone);
//2.1 手机号已存在
if (CollectionUtils.isNotEmpty(sysUsers))
......
......@@ -71,6 +71,40 @@
<result column="update_date" jdbcType="TIMESTAMP" property="updateDate"/>
<result column="create_date" jdbcType="TIMESTAMP" property="createDate"/>
</resultMap>
<!-- wx小程序查询使用-->
<resultMap id="UserDtoMap" type="org.rcisoft.tencent.dto.UserDto">
<id column="business_id" jdbcType="INTEGER" property="businessId"/>
<result column="position" jdbcType="VARCHAR" property="position"/>
<result column="position_label" jdbcType="VARCHAR" property="positionLabel"/>
<result column="username" jdbcType="VARCHAR" property="username"/>
<result column="password" jdbcType="VARCHAR" property="password"/>
<result column="nick_name" jdbcType="VARCHAR" property="nickName"/>
<result column="user_type" jdbcType="VARCHAR" property="userType"/>
<result column="name" jdbcType="VARCHAR" property="name"/>
<result column="email" jdbcType="VARCHAR" property="email"/>
<result column="phone" jdbcType="VARCHAR" property="phone"/>
<result column="sex" jdbcType="VARCHAR" property="sex"/>
<result column="id_number" jdbcType="VARCHAR" property="idNumber"/>
<result column="avatar" jdbcType="VARCHAR" property="avatar"/>
<result column="loginIp" jdbcType="VARCHAR" property="loginIp"/>
<result column="loginDate" jdbcType="TIMESTAMP" property="loginDate"/>
<result column="dept_id" jdbcType="VARCHAR" property="deptId"/>
<result column="dept_name" jdbcType="VARCHAR" property="deptName"/>
<result column="identity" jdbcType="VARCHAR" property="identity"/>
<result column="wx_openid" jdbcType="VARCHAR" property="wxOpenid"/>
<result column="wx_address" jdbcType="VARCHAR" property="wxAddress"/>
<result column="wx_head" jdbcType="VARCHAR" property="wxHead"/>
<result column="wx_sex" jdbcType="VARCHAR" property="wxSex"/>
<result column="wx_nick_name" jdbcType="VARCHAR" property="wxNickName"/>
<result column="remarks" jdbcType="VARCHAR" property="remarks"/>
<result column="del_flag" jdbcType="VARCHAR" property="delFlag"/>
<result column="flag" jdbcType="VARCHAR" property="flag"/>
<result column="create_by" jdbcType="VARCHAR" property="createBy"/>
<result column="update_by" jdbcType="VARCHAR" property="updateBy"/>
<result column="update_date" jdbcType="TIMESTAMP" property="updateDate"/>
<result column="create_date" jdbcType="TIMESTAMP" property="createDate"/>
</resultMap>
<!--<cache type="${corePackag!}.util.RedisCache"/>-->
<select id="querySysUsers" resultMap="BaseResultMap">
select *
......@@ -101,7 +135,7 @@
and su.position in(${entity.position})
</if>
<if test="entity.blacklistFlag == 1 || entity.blacklistFlag == 0">
and blacklist_flag = #{entity.blacklistFlag}
and su.blacklist_flag = #{entity.blacklistFlag}
</if>
<if test="entity.deptId !=null and entity.deptId != '' ">
and su.dept_id in(${entity.deptId})
......@@ -109,10 +143,10 @@
<if test="entity.phone !=null and entity.phone != '' ">
and su.phone like concat ("%",#{entity.phone},"%")
</if>
<if test="entity.beginTime != null"><!-- 开始时间检索 -->
<if test="entity.beginTime != null and entity.beginTime !='' "><!-- 开始时间检索 -->
and date_format(su.create_date,'%Y-%m-%d') &gt;= date_format(#{entity.beginTime},'%Y-%m-%d')
</if>
<if test="entity.endTime != null"><!-- 结束时间检索 -->
<if test="entity.endTime != null and entity.endTime !='' "><!-- 结束时间检索 -->
and date_format(su.create_date,'%Y-%m-%d') &lt;= date_format(#{entity.endTime},'%Y-%m-%d')
</if>
......@@ -366,10 +400,26 @@
where wx_openid = #{openid}
and del_flag = 0
</select>
<select id="selectByOpenidWx" resultMap="UserDtoMap">
select su.* ,sd.dept_name dept_name
from sys_user su
left join sys_dept sd on su.dept_id = sd.business_id
where su.wx_openid = #{openid}
and su.del_flag = 0
</select>
<select id="selectByPhone" resultMap="DtoMap">
select *
from sys_user
where phone = #{phone}
and del_flag = 0
</select>
<select id="selectByPhoneWx" resultMap="UserDtoMap">
select su.* ,sd.dept_name dept_name
from sys_user su
left join sys_dept sd on su.dept_id = sd.business_id
where su.phone = #{phone}
and su.del_flag = 0
</select>
</mapper>
......@@ -112,7 +112,7 @@
and su.position in(${entity.position})
</if>
<if test="entity.blacklistFlag == 1 || entity.blacklistFlag == 0">
and blacklist_flag = #{entity.blacklistFlag}
and su.blacklist_flag = #{entity.blacklistFlag}
</if>
<if test="entity.deptId !=null and entity.deptId != '' ">
and su.dept_id in(${entity.deptId})
......@@ -142,7 +142,8 @@
order BY su.first_date desc
</if>
<if test="entity.sort == '2'.toString() "><!-- 排序-->
order BY su.name desc
-- order BY su.name desc
order BY F_GET_PYJM(su.name)
</if>
<if test="entity.sort == '3'.toString() "><!-- 排序-->
order BY su.last_date desc
......
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