Commit 3ddb24c3 by 徐高华

企微托管账号

parent 6be92b62
package com.gic.haoban.manage.service.dao.mapper; package com.gic.haoban.manage.service.dao.mapper;
import com.gic.haoban.manage.api.dto.OpenStaffDTO;
import com.gic.haoban.manage.api.qdto.OpenStaffPageQDTO;
import com.gic.haoban.manage.service.entity.TabOpenStaff; import com.gic.haoban.manage.service.entity.TabOpenStaff;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface OpenStaffMapper { public interface OpenStaffMapper {
/** /**
...@@ -31,4 +35,6 @@ public interface OpenStaffMapper { ...@@ -31,4 +35,6 @@ public interface OpenStaffMapper {
void update2Qrcode(@Param("id") Long id , @Param("qrcode")String qrcode , @Param("key")String key) ; void update2Qrcode(@Param("id") Long id , @Param("qrcode")String qrcode , @Param("key")String key) ;
void updateLoginStep(@Param("id")Long openStaffId, @Param("step")int step); void updateLoginStep(@Param("id")Long openStaffId, @Param("step")int step);
List<OpenStaffDTO> list(OpenStaffPageQDTO qdto);
} }
\ No newline at end of file
package com.gic.haoban.manage.service.service; package com.gic.haoban.manage.service.service;
import com.gic.api.base.commons.BasePageInfo;
import com.gic.api.base.commons.Page;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.haoban.manage.api.dto.OpenStaffDTO;
import com.gic.haoban.manage.api.qdto.OpenStaffPageQDTO;
import com.gic.haoban.manage.service.entity.TabOpenStaff; import com.gic.haoban.manage.service.entity.TabOpenStaff;
public interface OpenStaffService { public interface OpenStaffService {
...@@ -10,4 +15,5 @@ public interface OpenStaffService { ...@@ -10,4 +15,5 @@ public interface OpenStaffService {
public void logout(String uuid) ; public void logout(String uuid) ;
ServiceResponse<Page<OpenStaffDTO>> page(OpenStaffPageQDTO qdto, BasePageInfo basePageInfo);
} }
package com.gic.haoban.manage.service.service.impl; package com.gic.haoban.manage.service.service.impl;
import com.gic.api.base.commons.BasePageInfo;
import com.gic.api.base.commons.Page;
import com.gic.api.base.commons.ServiceResponse; import com.gic.api.base.commons.ServiceResponse;
import com.gic.commons.util.PageHelperUtils;
import com.gic.commons.util.UniqueIdUtils; import com.gic.commons.util.UniqueIdUtils;
import com.gic.haoban.manage.api.dto.OpenStaffDTO;
import com.gic.haoban.manage.api.dto.chat.GroupChatDTO;
import com.gic.haoban.manage.api.qdto.OpenStaffPageQDTO;
import com.gic.haoban.manage.api.service.OpenStaffApiService; import com.gic.haoban.manage.api.service.OpenStaffApiService;
import com.gic.haoban.manage.service.dao.mapper.OpenStaffMapper; import com.gic.haoban.manage.service.dao.mapper.OpenStaffMapper;
import com.gic.haoban.manage.service.entity.TabOpenStaff; import com.gic.haoban.manage.service.entity.TabOpenStaff;
import com.gic.haoban.manage.service.service.OpenStaffService; import com.gic.haoban.manage.service.service.OpenStaffService;
import com.gic.haoban.manage.service.util.OpenUtils; import com.gic.haoban.manage.service.util.OpenUtils;
import com.github.pagehelper.PageHelper;
import org.apache.commons.lang.StringUtils;
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.Date; import java.util.Date;
import java.util.List;
@Service("openStaffService") @Service("openStaffService")
public class OpenStaffServiceImpl implements OpenStaffService { public class OpenStaffServiceImpl implements OpenStaffService {
...@@ -64,4 +73,12 @@ public class OpenStaffServiceImpl implements OpenStaffService { ...@@ -64,4 +73,12 @@ public class OpenStaffServiceImpl implements OpenStaffService {
openStaff.setUuid(null); openStaff.setUuid(null);
this.openStaffMapper.update(openStaff) ; this.openStaffMapper.update(openStaff) ;
} }
@Override
public ServiceResponse<Page<OpenStaffDTO>> page(OpenStaffPageQDTO qdto, BasePageInfo basePageInfo) {
PageHelper.startPage(basePageInfo);
List<OpenStaffDTO> list = this.openStaffMapper.list(qdto);
Page<OpenStaffDTO> retPage = PageHelperUtils.changePageHelperToCurrentPage(list, OpenStaffDTO.class);
return ServiceResponse.success(retPage);
}
} }
...@@ -200,6 +200,6 @@ public class OpenStaffApiServiceImpl implements OpenStaffApiService { ...@@ -200,6 +200,6 @@ public class OpenStaffApiServiceImpl implements OpenStaffApiService {
@Override @Override
public ServiceResponse<Page<OpenStaffDTO>> page(OpenStaffPageQDTO qdto, BasePageInfo basePageInfo) { public ServiceResponse<Page<OpenStaffDTO>> page(OpenStaffPageQDTO qdto, BasePageInfo basePageInfo) {
return null; return this.openStaffService.page(qdto,basePageInfo);
} }
} }
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<resultMap id="BaseResultMap" type="com.gic.haoban.manage.service.entity.TabOpenStaff"> <resultMap id="BaseResultMap" type="com.gic.haoban.manage.service.entity.TabOpenStaff">
<id column="open_staff_id" javaType="long" jdbcType="BIGINT" property="openStaffId"/> <id column="open_staff_id" javaType="long" jdbcType="BIGINT" property="openStaffId"/>
<result column="wx_enterprise_id" javaType="String" jdbcType="CHAR" property="wxEnterpriseId"/> <result column="wx_enterprise_id" javaType="String" jdbcType="CHAR" property="wxEnterpriseId"/>
<result column="enterprise_id" property="enterpriseId" /> <result column="enterprise_id" property="enterpriseId"/>
<result column="staff_id" javaType="String" jdbcType="CHAR" property="staffId"/> <result column="staff_id" javaType="String" jdbcType="CHAR" property="staffId"/>
<result column="create_time" javaType="java.util.Date" jdbcType="TIMESTAMP" property="createTime"/> <result column="create_time" javaType="java.util.Date" jdbcType="TIMESTAMP" property="createTime"/>
<result column="update_time" javaType="java.util.Date" jdbcType="TIMESTAMP" property="updateTime"/> <result column="update_time" javaType="java.util.Date" jdbcType="TIMESTAMP" property="updateTime"/>
...@@ -21,27 +21,32 @@ ...@@ -21,27 +21,32 @@
<result column="valid_flag" javaType="int" jdbcType="INTEGER" property="validFlag"/> <result column="valid_flag" javaType="int" jdbcType="INTEGER" property="validFlag"/>
<result column="auth_time" javaType="java.util.Date" jdbcType="TIMESTAMP" property="authTime"/> <result column="auth_time" javaType="java.util.Date" jdbcType="TIMESTAMP" property="authTime"/>
<result column="first_auth_time" javaType="java.util.Date" jdbcType="TIMESTAMP" property="firstAuthTime"/> <result column="first_auth_time" javaType="java.util.Date" jdbcType="TIMESTAMP" property="firstAuthTime"/>
<result column="valid_qrcode_flag" property="validQrcodeFlag" /> <result column="valid_qrcode_flag" property="validQrcodeFlag"/>
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
open_staff_id, wx_enterprise_id,enterprise_id, staff_id, create_time, update_time, uuid, delete_flag,status_flag, step, qw_user_id, wx_corp_id, qr_code_1, key_1, open_staff_id
, wx_enterprise_id,enterprise_id, staff_id, create_time, update_time, uuid, delete_flag,status_flag, step, qw_user_id, wx_corp_id, qr_code_1, key_1,
qr_code_2, key_2, valid_flag, auth_time,first_auth_time , valid_qrcode_flag qr_code_2, key_2, valid_flag, auth_time,first_auth_time , valid_qrcode_flag
</sql> </sql>
<insert id="insert" parameterType="com.gic.haoban.manage.service.dao.mapper.OpenStaffMapper"> <insert id="insert" parameterType="com.gic.haoban.manage.service.dao.mapper.OpenStaffMapper">
<![CDATA[ <![CDATA[
INSERT INTO tab_haoban_open_staff( INSERT INTO tab_haoban_open_staff(open_staff_id, wx_enterprise_id, staff_id, create_time, update_time, uuid,
open_staff_id, wx_enterprise_id, staff_id, create_time, update_time, uuid, delete_flag, status_flag, step, qw_user_id, wx_corp_id, qr_code_1, key_1, delete_flag, status_flag, step, qw_user_id, wx_corp_id, qr_code_1, key_1,
qr_code_2, key_2,valid_flag, auth_time, first_auth_time , enterprise_id , valid_qrcode_flag qr_code_2, key_2, valid_flag, auth_time, first_auth_time, enterprise_id,
)VALUES( valid_qrcode_flag)
#{openStaffId,jdbcType=BIGINT}, #{wxEnterpriseId,jdbcType=CHAR}, #{staffId,jdbcType=CHAR}, #{createTime,jdbcType=TIMESTAMP}, VALUES (#{openStaffId,jdbcType=BIGINT}, #{wxEnterpriseId,jdbcType=CHAR}, #{staffId,jdbcType=CHAR},
#{updateTime,jdbcType=TIMESTAMP}, #{uuid,jdbcType=VARCHAR}, #{deleteFlag,jdbcType=INTEGER}, #{statusFlag,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP},
#{step,jdbcType=INTEGER}, #{qwUserId,jdbcType=BIGINT}, #{wxCorpId,jdbcType=BIGINT}, #{qrCode1,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP}, #{uuid,jdbcType=VARCHAR}, #{deleteFlag,jdbcType=INTEGER},
#{key1,jdbcType=VARCHAR}, #{qrCode2,jdbcType=VARCHAR}, #{key2,jdbcType=VARCHAR}, #{validFlag,jdbcType=INTEGER}, #{statusFlag,jdbcType=INTEGER},
#{authTime,jdbcType=TIMESTAMP}, #{firstAuthTime,jdbcType=TIMESTAMP} , #{enterpriseId} , #{validQrcodeFlag} #{step,jdbcType=INTEGER}, #{qwUserId,jdbcType=BIGINT}, #{wxCorpId,jdbcType=BIGINT},
) #{qrCode1,jdbcType=VARCHAR},
]]> #{key1,jdbcType=VARCHAR}, #{qrCode2,jdbcType=VARCHAR}, #{key2,jdbcType=VARCHAR},
#{validFlag,jdbcType=INTEGER},
#{authTime,jdbcType=TIMESTAMP}, #{firstAuthTime,jdbcType=TIMESTAMP}, #{enterpriseId},
#{validQrcodeFlag})
]]>
</insert> </insert>
<update id="update" parameterType="com.gic.haoban.manage.service.entity.TabOpenStaff"> <update id="update" parameterType="com.gic.haoban.manage.service.entity.TabOpenStaff">
...@@ -65,35 +70,57 @@ ...@@ -65,35 +70,57 @@
</update> </update>
<update id="updateValiFlag"> <update id="updateValiFlag">
update tab_haoban_open_staff set valid_flag = 1 where uuid = #{uuid} update tab_haoban_open_staff
set valid_flag = 1
where uuid = #{uuid}
</update> </update>
<update id="update2QrcodeFlag"> <update id="update2QrcodeFlag">
update tab_haoban_open_staff set valid_qrcode_flag = 1 where id = #{id} update tab_haoban_open_staff
set valid_qrcode_flag = 1
where id = #{id}
</update> </update>
<update id="update2Qrcode"> <update id="update2Qrcode">
update tab_haoban_open_staff set qr_code_2 = #{qrCode} , key_2 = #{key} where id = #{id} update tab_haoban_open_staff
set qr_code_2 = #{qrCode},
key_2 = #{key}
where id = #{id}
</update> </update>
<update id="updateLoginStep"> <update id="updateLoginStep">
update tab_haoban_open_staff set step = #{step} where open_staff_id = #{id} update tab_haoban_open_staff
set step = #{step}
where open_staff_id = #{id}
</update> </update>
<delete id="deleteByPrimaryKey"> <delete id="deleteByPrimaryKey">
update tab_haoban_open_staff set delete_flag = 1 , update_time =now() where open_staff_id = #{id} update tab_haoban_open_staff
set delete_flag = 1,
update_time =now()
where open_staff_id = #{id}
</delete> </delete>
<select id="getByStaffId" resultMap="BaseResultMap"> <select id="getByStaffId" resultMap="BaseResultMap">
select <include refid="Base_Column_List" /> from tab_haoban_open_staff where staff_id = #{staffId} and delete_flag = 0 select
<include refid="Base_Column_List"/>
from tab_haoban_open_staff where staff_id = #{staffId} and delete_flag = 0
</select> </select>
<select id="getById" resultMap="BaseResultMap"> <select id="getById" resultMap="BaseResultMap">
select <include refid="Base_Column_List"/> from tab_haoban_open_staff where open_staff_id = #{id} and delete_flag = 0 select
<include refid="Base_Column_List"/>
from tab_haoban_open_staff where open_staff_id = #{id} and delete_flag = 0
</select> </select>
<select id="getByUUID" resultMap="BaseResultMap"> <select id="getByUUID" resultMap="BaseResultMap">
select <include refid="Base_Column_List"/> from tab_haoban_open_staff where uuid = #{uuid} and delete_flag = 0 select
<include refid="Base_Column_List"/>
from tab_haoban_open_staff where uuid = #{uuid} and delete_flag = 0
</select>
<select id="list" resultMap="BaseResultMap" parameterType="com.gic.haoban.manage.api.qdto.OpenStaffPageQDTO">
select * from tab_haoban_open_staff
</select> </select>
</mapper> </mapper>
\ No newline at end of file
...@@ -3,6 +3,7 @@ package com.gic.haoban.manage.web.controller.open; ...@@ -3,6 +3,7 @@ package com.gic.haoban.manage.web.controller.open;
import com.gic.api.base.commons.BasePageInfo; import com.gic.api.base.commons.BasePageInfo;
import com.gic.api.base.commons.Page; import com.gic.api.base.commons.Page;
import com.gic.api.base.commons.ServiceResponse; import com.gic.api.base.commons.ServiceResponse;
import com.gic.commons.util.PageHelperUtils;
import com.gic.commons.webapi.reponse.RestResponse; import com.gic.commons.webapi.reponse.RestResponse;
import com.gic.haoban.base.api.common.pojo.dto.WebLoginDTO; import com.gic.haoban.base.api.common.pojo.dto.WebLoginDTO;
import com.gic.haoban.common.utils.AuthWebRequestUtil; import com.gic.haoban.common.utils.AuthWebRequestUtil;
...@@ -11,12 +12,14 @@ import com.gic.haoban.manage.api.dto.OpenStaffDTO; ...@@ -11,12 +12,14 @@ import com.gic.haoban.manage.api.dto.OpenStaffDTO;
import com.gic.haoban.manage.api.dto.OpenStaffLicenseDTO; import com.gic.haoban.manage.api.dto.OpenStaffLicenseDTO;
import com.gic.haoban.manage.api.dto.StaffClerkRelationDTO; import com.gic.haoban.manage.api.dto.StaffClerkRelationDTO;
import com.gic.haoban.manage.api.dto.StaffDTO; import com.gic.haoban.manage.api.dto.StaffDTO;
import com.gic.haoban.manage.api.dto.chat.GroupChatHmDTO;
import com.gic.haoban.manage.api.qdto.OpenStaffInitQDTO; import com.gic.haoban.manage.api.qdto.OpenStaffInitQDTO;
import com.gic.haoban.manage.api.qdto.OpenStaffPageQDTO; import com.gic.haoban.manage.api.qdto.OpenStaffPageQDTO;
import com.gic.haoban.manage.api.service.OpenStaffApiService; import com.gic.haoban.manage.api.service.OpenStaffApiService;
import com.gic.haoban.manage.api.service.StaffApiService; import com.gic.haoban.manage.api.service.StaffApiService;
import com.gic.haoban.manage.api.service.StaffClerkRelationApiService; import com.gic.haoban.manage.api.service.StaffClerkRelationApiService;
import com.gic.haoban.manage.web.qo.open.OpenStaffQO; import com.gic.haoban.manage.web.qo.open.OpenStaffQO;
import com.gic.haoban.manage.web.vo.chat.GroupChatHmVO;
import com.gic.haoban.manage.web.vo.open.OpenStaffVO; import com.gic.haoban.manage.web.vo.open.OpenStaffVO;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
...@@ -48,14 +51,16 @@ public class QywxOpenController { ...@@ -48,14 +51,16 @@ public class QywxOpenController {
* @param qo * @param qo
* @return * @return
*/ */
@RequestMapping("open-staff-list") @RequestMapping("open-staff-page")
public RestResponse<Page<OpenStaffVO>> page(@RequestBody OpenStaffQO qo,BasePageInfo basePageInfo) { public RestResponse<Page<OpenStaffVO>> page(@RequestBody OpenStaffQO qo,BasePageInfo basePageInfo) {
WebLoginDTO loginUser = AuthWebRequestUtil.getLoginUser(); WebLoginDTO loginUser = AuthWebRequestUtil.getLoginUser();
OpenStaffPageQDTO qdto = EntityUtil.changeEntityByJSON(OpenStaffPageQDTO.class,qo) ; OpenStaffPageQDTO qdto = EntityUtil.changeEntityByJSON(OpenStaffPageQDTO.class,qo) ;
qdto.setWxEnterpriseId(loginUser.getWxEnterpriseId()); qdto.setWxEnterpriseId(loginUser.getWxEnterpriseId());
qdto.setEnterpriseId(loginUser.getEnterpriseId()); qdto.setEnterpriseId(loginUser.getEnterpriseId());
ServiceResponse<Page<OpenStaffDTO>> page = this.openStaffApiService.page(qdto, basePageInfo); ServiceResponse<Page<OpenStaffDTO>> pageResp = this.openStaffApiService.page(qdto, basePageInfo);
return RestResponse.successResult(null); Page<OpenStaffDTO> page = pageResp.getResult();
Page<OpenStaffVO> retPage = PageHelperUtils.changePageToCurrentPage(page, OpenStaffVO.class);
return RestResponse.successResult(retPage);
} }
/** /**
......
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