Commit 5284bab4 by 徐高华

企微托管账号

parent 64f9d592
...@@ -104,10 +104,23 @@ public class OpenStaffDTO implements Serializable { ...@@ -104,10 +104,23 @@ public class OpenStaffDTO implements Serializable {
private Integer validQrcodeFlag ; private Integer validQrcodeFlag ;
/** /**
* 登录错误信息
*/
private String loginRemark ;
/**
* tab_haoban_open_staff * tab_haoban_open_staff
*/ */
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
public String getLoginRemark() {
return loginRemark;
}
public void setLoginRemark(String loginRemark) {
this.loginRemark = loginRemark;
}
public String getEnterpriseId() { public String getEnterpriseId() {
return enterpriseId; return enterpriseId;
} }
......
...@@ -84,16 +84,16 @@ public class QywxCallbackController extends WebBaseController { ...@@ -84,16 +84,16 @@ public class QywxCallbackController extends WebBaseController {
private void chat(String uuid, JSONObject json) { private void chat(String uuid, JSONObject json) {
logger.info("消息"); logger.info("消息");
int msgtype = json.getIntValue("msgtype") ; int msgtype = json.getIntValue("msgtype") ;
// 1导购发 2好友发
int sendType = 1 ;
if(msgtype==2) { if(msgtype==2) {
msgtype = 2 ; sendType = 2 ;
}else {
msgtype = 1 ;
} }
int isRoom = 0 ; int isRoom = 0 ;
if(json.getIntValue("is_room") == 1) { if(json.getIntValue("is_room") == 1) {
}else { }else {
this.openQwApiService.saveChatLog(uuid,json.getLong("sender"),json.getLong("receiver"),json.getString("content"),msgtype) ; this.openQwApiService.saveChatLog(uuid,json.getLong("sender"),json.getLong("receiver"),json.getString("content"),sendType) ;
} }
} }
......
...@@ -101,6 +101,16 @@ public class TabOpenStaff implements Serializable { ...@@ -101,6 +101,16 @@ public class TabOpenStaff implements Serializable {
private Integer validQrcodeFlag ; private Integer validQrcodeFlag ;
private String loginRemark ;
public String getLoginRemark() {
return loginRemark;
}
public void setLoginRemark(String loginRemark) {
this.loginRemark = loginRemark;
}
/** /**
* tab_haoban_open_staff * tab_haoban_open_staff
*/ */
......
...@@ -15,7 +15,7 @@ public interface OpenStaffService { ...@@ -15,7 +15,7 @@ public interface OpenStaffService {
public TabOpenStaff getByUUID(String uuid) ; public TabOpenStaff getByUUID(String uuid) ;
public void logout(String uuid) ; public void logout(String uuid, String loginRemark) ;
ServiceResponse<Page<OpenStaffDTO>> page(OpenStaffPageQDTO qdto, BasePageInfo basePageInfo); ServiceResponse<Page<OpenStaffDTO>> page(OpenStaffPageQDTO qdto, BasePageInfo basePageInfo);
......
...@@ -56,7 +56,7 @@ public class OpenStaffServiceImpl implements OpenStaffService { ...@@ -56,7 +56,7 @@ public class OpenStaffServiceImpl implements OpenStaffService {
} }
@Override @Override
public void logout(String uuid) { public void logout(String uuid , String loginRemark) {
TabOpenStaff openStaff = this.getByUUID(uuid) ; TabOpenStaff openStaff = this.getByUUID(uuid) ;
if(null == openStaff) { if(null == openStaff) {
return ; return ;
...@@ -71,6 +71,7 @@ public class OpenStaffServiceImpl implements OpenStaffService { ...@@ -71,6 +71,7 @@ public class OpenStaffServiceImpl implements OpenStaffService {
openStaff.setKey1(null); openStaff.setKey1(null);
openStaff.setKey2(null); openStaff.setKey2(null);
openStaff.setUuid(null); openStaff.setUuid(null);
openStaff.setLoginRemark(loginRemark);
this.openStaffMapper.update(openStaff) ; this.openStaffMapper.update(openStaff) ;
} }
......
...@@ -92,7 +92,7 @@ public class OpenStaffApiServiceImpl implements OpenStaffApiService { ...@@ -92,7 +92,7 @@ public class OpenStaffApiServiceImpl implements OpenStaffApiService {
} }
this.openStaffMapper.updateLoginStep(openStaff.getOpenStaffId(),step) ; this.openStaffMapper.updateLoginStep(openStaff.getOpenStaffId(),step) ;
if(QwOpenStepEnum.isFail(step)) { if(QwOpenStepEnum.isFail(step)) {
this.openStaffService.logout(uuid); this.openStaffService.logout(uuid,"企微返回退出/登录超时");
} }
return ServiceResponse.success(); return ServiceResponse.success();
} }
...@@ -106,13 +106,13 @@ public class OpenStaffApiServiceImpl implements OpenStaffApiService { ...@@ -106,13 +106,13 @@ public class OpenStaffApiServiceImpl implements OpenStaffApiService {
String wxEnterpriseId = openStaff.getWxEnterpriseId() ; String wxEnterpriseId = openStaff.getWxEnterpriseId() ;
List<String> backWxEnterpriseIdList = this.wxEnterpriseService.getWxEnterpriseIdByName(corpName) ; List<String> backWxEnterpriseIdList = this.wxEnterpriseService.getWxEnterpriseIdByName(corpName) ;
if(CollectionUtils.isEmpty(backWxEnterpriseIdList) || backWxEnterpriseIdList.size()>1 || !backWxEnterpriseIdList.get(0).equals(wxEnterpriseId)) { if(CollectionUtils.isEmpty(backWxEnterpriseIdList) || backWxEnterpriseIdList.size()>1 || !backWxEnterpriseIdList.get(0).equals(wxEnterpriseId)) {
this.openStaffService.logout(uuid); this.openStaffService.logout(uuid,"授权登录账号与当前账号不一致");
log.info("登录的企业不对={},{}",uuid,corpName); log.info("登录的企业不对={},{}",uuid,corpName);
return ServiceResponse.failure("9999","登录错误") ; return ServiceResponse.failure("9999","登录错误") ;
} }
TabOpenStaff staff = this.openStaffMapper.getByQwUserId(qwUserId) ; TabOpenStaff staff = this.openStaffMapper.getByQwUserId(qwUserId) ;
if(null != staff && staff.getWxEnterpriseId().equals(wxEnterpriseId)) { if(null != staff && staff.getWxEnterpriseId().equals(wxEnterpriseId)) {
this.openStaffService.logout(uuid); this.openStaffService.logout(uuid,"只能托管一个企微企业");
log.info("只能托管一个企业={},{}",uuid,corpName); log.info("只能托管一个企业={},{}",uuid,corpName);
return ServiceResponse.failure("9999","只能托管一个企业") ; return ServiceResponse.failure("9999","只能托管一个企业") ;
} }
...@@ -129,7 +129,7 @@ public class OpenStaffApiServiceImpl implements OpenStaffApiService { ...@@ -129,7 +129,7 @@ public class OpenStaffApiServiceImpl implements OpenStaffApiService {
@Override @Override
public ServiceResponse<Void> logout(String uuid) { public ServiceResponse<Void> logout(String uuid) {
this.openStaffService.logout(uuid); this.openStaffService.logout(uuid,null);
return ServiceResponse.success(); return ServiceResponse.success();
} }
...@@ -180,7 +180,7 @@ public class OpenStaffApiServiceImpl implements OpenStaffApiService { ...@@ -180,7 +180,7 @@ public class OpenStaffApiServiceImpl implements OpenStaffApiService {
} }
qwUserId = openStaff.getQwUserId() ; qwUserId = openStaff.getQwUserId() ;
log.info("重新初始化,退出登录"); log.info("重新初始化,退出登录");
this.openStaffService.logout(openStaff.getUuid()); this.openStaffService.logout(openStaff.getUuid(),"重新初始化,退出登录");
} }
if(null == openStaff) { if(null == openStaff) {
openStaff = new TabOpenStaff() ; openStaff = new TabOpenStaff() ;
......
...@@ -204,10 +204,10 @@ public class StaffApiServiceImpl implements StaffApiService { ...@@ -204,10 +204,10 @@ public class StaffApiServiceImpl implements StaffApiService {
if(staffListDTO.getQwOpenFlag()==1) { if(staffListDTO.getQwOpenFlag()==1) {
List<String> list = this.openStaffService.listAllStaffId(wxEnterpriseId) ; List<String> list = this.openStaffService.listAllStaffId(wxEnterpriseId) ;
staffIds = staffIds.stream().filter(o->!list.contains(o)).collect(Collectors.toList()); staffIds = staffIds.stream().filter(o->!list.contains(o)).collect(Collectors.toList());
}
if (CollectionUtils.isEmpty(staffIds)){ if (CollectionUtils.isEmpty(staffIds)){
return new Page<>(); return new Page<>();
} }
}
StaffListBO staffListBO = EntityUtil.changeEntityByJSON(StaffListBO.class, staffListDTO); StaffListBO staffListBO = EntityUtil.changeEntityByJSON(StaffListBO.class, staffListDTO);
staffListBO.setStaffIds(staffIds); staffListBO.setStaffIds(staffIds);
staffListBO.setRelationFlag(relationFlag); staffListBO.setRelationFlag(relationFlag);
......
...@@ -22,12 +22,13 @@ ...@@ -22,12 +22,13 @@
<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"/>
<result column="login_remark" property="loginRemark" />
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
open_staff_id 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, , 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 , login_remark
</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">
...@@ -65,6 +66,9 @@ ...@@ -65,6 +66,9 @@
<if test="null != firstAuthTime"> <if test="null != firstAuthTime">
first_auth_time=#{firstAuthTime} , first_auth_time=#{firstAuthTime} ,
</if> </if>
<if test="null != loginRemark">
login_remark = #{loginRemark}
</if>
update_time=now() update_time=now()
where open_staff_id = #{openStaffId} where open_staff_id = #{openStaffId}
</update> </update>
......
...@@ -12,14 +12,12 @@ import com.gic.haoban.manage.api.dto.OpenStaffDTO; ...@@ -12,14 +12,12 @@ 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;
......
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