Commit c75decb2 by 徐高华

Merge branch 'feature/获取用户敏感信息' into 'master'

Feature/获取用户敏感信息

See merge request !911
parents 6886e2ee 7b088c3a
...@@ -99,5 +99,16 @@ public interface HaobanTimerApiService { ...@@ -99,5 +99,16 @@ public interface HaobanTimerApiService {
* @throws * @throws
*/ */
public ServiceResponse<Void> ownerDimission(String params); public ServiceResponse<Void> ownerDimission(String params);
/**
*
* @Title: activedAccountTimer
* @Description: 获取激活账号
* @author xgh331
* @param params
* @return
* @throws
*/
public ServiceResponse<Void> activedAccountTimer(String params);
} }
...@@ -185,6 +185,13 @@ public interface StaffApiService { ...@@ -185,6 +185,13 @@ public interface StaffApiService {
int updateOpenIdByStaffId(String staffId, String openId); int updateOpenIdByStaffId(String staffId, String openId);
/** /**
* 判断成员是否授权获取敏感信息,0否 1是
* @param staffId
* @return
*/
int getSensitiveStatus(String staffId);
/**
* 更新二维码通过员工id * 更新二维码通过员工id
* *
* @param staffId 员工id * @param staffId 员工id
...@@ -193,6 +200,14 @@ public interface StaffApiService { ...@@ -193,6 +200,14 @@ public interface StaffApiService {
*/ */
int updateQrCodeByStaffId(String staffId, String qrCode); int updateQrCodeByStaffId(String staffId, String qrCode);
/**
* 通过userID更新员工二维码
* @param userId
* @param qrCode
* @return
*/
int updateQrCodeByUserId(String userId, String qrCode);
/** /**
* 获取职员id二维码 * 获取职员id二维码
......
This source diff could not be displayed because it is too large. You can view the blob instead.
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>token</title>
<link href="css/bootstrap.min.css" rel="stylesheet">
<script src="js/jquery.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<script type="text/javascript">
Date.prototype.format = function (fmt) {
var o = {
"M+": this.getMonth() + 1, //月份
"d+": this.getDate(), //日
"h+": this.getHours(), //小时
"m+": this.getMinutes(), //分
"s+": this.getSeconds(), //秒
"q+": Math.floor((this.getMonth() + 3) / 3), //季度
"S": this.getMilliseconds() //毫秒
};
if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
for (var k in o)
if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
return fmt;
}
var map = {
"wwb3ef71aa8c6d9c06":"好办小程序",
"wwe93faef4ade602f3":"好办小程序",
"wwb6d087b222b00c2b":"好办小程序",
"dkfe6f9c300b71ad72":"好办助手",
"dk2d2f5784ad473bbc":"好办助手",
"dk6467c452ecf5de90":"好办助手",
"dkf217f8ce8f4a57a7":"会员工具1",
"dk695e5faedeb5f0fe":"会员工具2",
"dkee8e7a1bd2a0f891":"会员工具",
"dk2c6d3af12ca5e23c":"会员工具1",
"dkd83fb7d63e4be90a":"会员工具2",
"dkf3279730ec018a30":"会员工具3",
"dk86053fba94689927":"会员工具4",
"dke7166a8a3ce18170":"会员工具5",
"dkfa2218da968c7433":"会员工具6",
"dkf85ba8bb7cefe901":"会员工具7",
"dkdf2a983a28faf860":"会员工具8"
}
var host = "" ;
function referData(retData , tokenType) {
$("#tb_teletext").html("");
var htm = "" ;
if(!retData.result || retData.result.length==0) {
alert("无数据")
return ;
}
for(var i=0;i<retData.result.length;i++) {
var item = retData.result[i] ;
var corpid = item.corpid ;
var suiteId = item.suiteId ;
var id = "" ;
var name = "" ;
var accessToken = "" ;
var time1 = 0 ;
var secret = "" ;
if(tokenType==1) {
id = item.corpid ;
name = "服务商" ;
accessToken = item.accessToken ;
time = item.updateTokenTimestamp ;
}
if(tokenType==2) {
id = item.suiteId ;
if(id=='selfSuiteId' || id=='contactSuiteId') {
continue ;
}
name = "应用" ;
if(map[id]) {
name = map[id] ;
}
accessToken = item.suiteAccessToken ;
time = item.updateAccessTokenTimestamp ;
}
if(tokenType==3) {
id = item.suiteId ;
name = item.corpName+"<br/>"+map[id] ;
accessToken = item.accessToken ;
time = item.updateAccessTokenTimestamp ;
if(item.isCustomizedApp==1) {
secret = item.permanentCode ;
}
}
var timeX = '--' ;
if(time) {
timeX = new Date(parseInt(time)).format("yyyy-MM-dd hh:mm:ss");
}
var btn1 = "<button data-secret='"+secret+"' data-corpid='"+corpid+"' data-suiteid='"+suiteId+"' onclick='reflushToken("+tokenType+",this)'>刷新</button>"
var btn2 = "<button data-secret='"+secret+"' data-corpid='"+corpid+"' data-suiteid='"+suiteId+"' onclick='getCacheToken("+tokenType+",this)'>查询cache</button>"
var btns = btn1 + btn2 ;
htm+='<tr class="info"><td>'+id+'</td><td>'+name+'</td><td title="'+accessToken+'" style="white-space:nowrap;overflow: hidden;text-overflow:ellipsis">'+accessToken+'</td><td>'+timeX+'</td><td>'+btns+'</td></tr>';
}
$("#tb_teletext").html(htm);
}
function reflushToken(tokenType , o) {
var corpid = $(o).attr("data-corpid") ;
var suiteid = $(o).attr("data-suiteid") ;
var url = host+'/gic/weixin3th/qywx-token/reflush-token?tokenType='+tokenType+'&corpid='+corpid ;
if(tokenType==2) {
url = host+'/gic/weixin3th/qywx-token/reflush-token?tokenType='+tokenType+'&suiteId='+suiteid
}
if(tokenType==3) {
url = host+'/gic/weixin3th/qywx-token/reflush-token?tokenType='+tokenType+'&suiteId='+suiteid+'&corpid='+corpid;
}
$.ajax({
type:"post",
url: url,
success:function(retData) {
alert("刷新成功") ;
}
});
}
function getCacheToken(tokenType , o) {
var corpid = $(o).attr("data-corpid") ;
var suiteid = $(o).attr("data-suiteid") ;
var secret = $(o).attr("data-secret") ;
var url = host+'/gic/weixin3th/qywx-token/get-cache-token?tokenType='+tokenType+'&corpid='+corpid ;
if(tokenType==2) {
url = host+'/gic/weixin3th/qywx-token/get-cache-token?tokenType='+tokenType+'&suiteId='+suiteid
}
if(tokenType==3) {
url = host+'/gic/weixin3th/qywx-token/get-cache-token?tokenType='+tokenType+'&suiteId='+suiteid+'&corpid='+corpid+'&secret='+secret;
}
$.ajax({
type:"post",
url: url,
success:function(retData) {
alert(retData.result) ;
}
});
}
function corpidToken() {
var corpids = $("#corpids").val() ;
if(!corpids) {
alert("请输入corpid") ;
return ;
}
$.ajax({
type:"post",
url: host+'/gic/weixin3th/qywx-token/list-token?corpids='+corpids,
success:function(retData) {
referData(retData,3) ;
}
});
}
function suiteToken() {
$.ajax({
type:"post",
url: host+'/gic/weixin3th/qywx-token/list-suite',
success:function(retData) {
referData(retData,2) ;
}
});
}
function provideToken() {
$.ajax({
type:"post",
url: host+'/gic/weixin3th/qywx-token/list-provider',
success:function(retData) {
referData(retData,1) ;
}
});
}
</script>
</head>
<body>
<div class="container" id="couponDiv">
<div class="tab-pane" id="tab2" style="padding:5px">
<button onclick="corpidToken()">企业应用token(access-token)</button>
<button onclick="suiteToken()">好办应用token(suite-access-token)</button>
<button onclick="provideToken()">服务商token</button>
<br/>
<div style="padding:2px 2px">corpid,多个","号分割:<input id="corpids" style="width:600px">
<br/>
</div>
<table class="table table-bordered" style="table-layout: fixed;">
<thead><tr><th>ID</th><th>名称</th><th>access_token</th><th>最新更新时间</th><th>操作</th></tr></thead>
<tbody id="tb_teletext">
</tbody>
</table>
</div>
</div>
</body>
</html>
\ No newline at end of file
...@@ -5,8 +5,8 @@ import com.gic.haoban.manage.service.entity.TabHaobanStaff; ...@@ -5,8 +5,8 @@ import com.gic.haoban.manage.service.entity.TabHaobanStaff;
import com.github.pagehelper.Page; import com.github.pagehelper.Page;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Set;
public interface StaffMapper { public interface StaffMapper {
...@@ -22,6 +22,8 @@ public interface StaffMapper { ...@@ -22,6 +22,8 @@ public interface StaffMapper {
TabHaobanStaff selectByUserIdAndEnterpriseId(@Param("userId") String userId, @Param("wxEnterpriseId") String wxEnterpriseId); TabHaobanStaff selectByUserIdAndEnterpriseId(@Param("userId") String userId, @Param("wxEnterpriseId") String wxEnterpriseId);
TabHaobanStaff getDeleteUser(@Param("userId") String userId, @Param("wxEnterpriseId") String wxEnterpriseId) ;
List<TabHaobanStaff> listByUserIdsAndWxEnterpriseId(@Param("userIds") List<String> userIds, @Param("wxEnterpriseId") String wxEnterpriseId); List<TabHaobanStaff> listByUserIdsAndWxEnterpriseId(@Param("userIds") List<String> userIds, @Param("wxEnterpriseId") String wxEnterpriseId);
...@@ -69,6 +71,13 @@ public interface StaffMapper { ...@@ -69,6 +71,13 @@ public interface StaffMapper {
int updateOpenIdByStaffId(@Param("staffId") String staffId, @Param("openId") String openId); int updateOpenIdByStaffId(@Param("staffId") String staffId, @Param("openId") String openId);
/** /**
* 根据员工id获取二维码
* @param staffId
* @return
*/
String getQrCodeByStaffId(@Param("staffId") String staffId);
/**
* 更新二维码通过员工id * 更新二维码通过员工id
* *
* @param staffId 员工id * @param staffId 员工id
...@@ -78,6 +87,14 @@ public interface StaffMapper { ...@@ -78,6 +87,14 @@ public interface StaffMapper {
int updateQrCodeByStaffId(@Param("staffId") String staffId, @Param("qrCode") String qrCode); int updateQrCodeByStaffId(@Param("staffId") String staffId, @Param("qrCode") String qrCode);
/** /**
* 通过userID更新员工二维码
* @param userId
* @param qrCode
* @return
*/
int updateQrCodeByUserId(@Param("userId") String userId, @Param("qrCode") String qrCode);
/**
* 选择电话号码和企业标识 * 选择电话号码和企业标识
*/ */
TabHaobanStaff selectByPhoneNumberAndEnterpriseId(@Param("phoneNumber") String phoneNumber, TabHaobanStaff selectByPhoneNumberAndEnterpriseId(@Param("phoneNumber") String phoneNumber,
...@@ -118,14 +135,13 @@ public interface StaffMapper { ...@@ -118,14 +135,13 @@ public interface StaffMapper {
/** /**
* 更新是否激活 * 更新是否激活
*
* @param activeStatus 活跃状态
* @param staffId 员工id
* @return int
* @author mozhu
* @date 2022-08-03 17:36:52
*/ */
int updateActiveStatusById(@Param("activeStatus")Integer activeStatus,@Param("staffId") String staffId); int updateActiveStatusById(@Param("staffId")String staffId, @Param("activeTime")Date activeTime,
@Param("expireTime")Date expireTime,
@Param("activeCode")String activeCode, @Param("activeStatus")Integer activeStatus);
// 初始化激活码信息,先删除
void deleteActivieInfo(@Param("wxEnterpriseId") String wxEnterpriseId) ;
/** /**
* 重置添加num * 重置添加num
......
...@@ -56,14 +56,6 @@ public interface TabHaobanQywxFeeAccountInterceptLogMapper { ...@@ -56,14 +56,6 @@ public interface TabHaobanQywxFeeAccountInterceptLogMapper {
int update(TabHaobanQywxFeeAccountInterceptLog tabHaobanQywxFeeAccountInterceptLog); int update(TabHaobanQywxFeeAccountInterceptLog tabHaobanQywxFeeAccountInterceptLog);
/** /**
* 通过主键删除数据
*
* @param feeAccountInterceptId 主键
* @return 影响行数
*/
int deleteById(Long feeAccountInterceptId);
/**
* 查询天气企业服务id * 查询天气企业服务id
* *
* @param wxEnterpriseId wx企业标识 * @param wxEnterpriseId wx企业标识
......
...@@ -21,7 +21,7 @@ public interface TabHaobanQywxFeeAccountStaffMapper { ...@@ -21,7 +21,7 @@ public interface TabHaobanQywxFeeAccountStaffMapper {
* @param feeAccountId 主键 * @param feeAccountId 主键
* @return 实例对象 * @return 实例对象
*/ */
TabHaobanQywxFeeAccountStaff queryById(Long feeAccountId); TabHaobanQywxFeeAccountStaff selectByActiveCode(@Param("wxEnterpriseId")String wxEnterpriseId , @Param("activeCode")String activeCode);
/** /**
* 新增数据 * 新增数据
...@@ -32,14 +32,6 @@ public interface TabHaobanQywxFeeAccountStaffMapper { ...@@ -32,14 +32,6 @@ public interface TabHaobanQywxFeeAccountStaffMapper {
int insert(TabHaobanQywxFeeAccountStaff tabHaobanQywxFeeAccountStaff); int insert(TabHaobanQywxFeeAccountStaff tabHaobanQywxFeeAccountStaff);
/** /**
* 批量新增数据(MyBatis原生foreach方法)
*
* @param entities List<TabHaobanQywxFeeAccountStaff> 实例对象列表
* @return 影响行数
*/
int insertBatch(@Param("entities") List<TabHaobanQywxFeeAccountStaff> entities);
/**
* 修改数据 * 修改数据
* *
* @param tabHaobanQywxFeeAccountStaff 实例对象 * @param tabHaobanQywxFeeAccountStaff 实例对象
...@@ -48,14 +40,6 @@ public interface TabHaobanQywxFeeAccountStaffMapper { ...@@ -48,14 +40,6 @@ public interface TabHaobanQywxFeeAccountStaffMapper {
int update(TabHaobanQywxFeeAccountStaff tabHaobanQywxFeeAccountStaff); int update(TabHaobanQywxFeeAccountStaff tabHaobanQywxFeeAccountStaff);
/** /**
* 通过主键删除数据
*
* @param feeAccountId 主键
* @return 影响行数
*/
int deleteById(Long feeAccountId);
/**
* 详情 * 详情
* *
* @param wxEnterpriseId wx企业标识 * @param wxEnterpriseId wx企业标识
...@@ -82,5 +66,7 @@ public interface TabHaobanQywxFeeAccountStaffMapper { ...@@ -82,5 +66,7 @@ public interface TabHaobanQywxFeeAccountStaffMapper {
* @date 2022-08-08 15:53:32 * @date 2022-08-08 15:53:32
*/ */
int lastFeeInterceptCount(@Param("wxEnterpriseId") String wxEnterpriseId); int lastFeeInterceptCount(@Param("wxEnterpriseId") String wxEnterpriseId);
void deleteAll(@Param("wxEnterpriseId") String wxEnterpriseId);
} }
package com.gic.haoban.manage.service.dao.mapper.fee; package com.gic.haoban.manage.service.dao.mapper.fee;
import com.gic.haoban.manage.service.entity.fee.TabHaobanQywxFeeOrderAccount;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.springframework.data.domain.Pageable;
import java.util.List; import com.gic.haoban.manage.service.entity.fee.TabHaobanQywxFeeOrderAccount;
/** /**
* 企业微信收费订单账号(激活码)(TabHaobanQywxFeeOrderAccount)表数据库访问层 * 企业微信收费订单账号(激活码)(TabHaobanQywxFeeOrderAccount)表数据库访问层
...@@ -20,16 +18,7 @@ public interface TabHaobanQywxFeeOrderAccountMapper { ...@@ -20,16 +18,7 @@ public interface TabHaobanQywxFeeOrderAccountMapper {
* @param feeAccountId 主键 * @param feeAccountId 主键
* @return 实例对象 * @return 实例对象
*/ */
TabHaobanQywxFeeOrderAccount queryById(Long feeAccountId); TabHaobanQywxFeeOrderAccount selectByOrderIdAndCode( @Param("wxEnterpriseId")String wxEnterpriseId , @Param("orderId")String orderId, @Param("activeCode")String activeCode);
/**
* 查询指定行数据
*
* @param tabHaobanQywxFeeOrderAccount 查询条件
* @param pageable 分页对象
* @return 对象列表
*/
List<TabHaobanQywxFeeOrderAccount> queryAllByLimit(TabHaobanQywxFeeOrderAccount tabHaobanQywxFeeOrderAccount, @Param("pageable") Pageable pageable);
/** /**
* 新增数据 * 新增数据
...@@ -40,14 +29,6 @@ public interface TabHaobanQywxFeeOrderAccountMapper { ...@@ -40,14 +29,6 @@ public interface TabHaobanQywxFeeOrderAccountMapper {
int insert(TabHaobanQywxFeeOrderAccount tabHaobanQywxFeeOrderAccount); int insert(TabHaobanQywxFeeOrderAccount tabHaobanQywxFeeOrderAccount);
/** /**
* 批量新增数据(MyBatis原生foreach方法)
*
* @param entities List<TabHaobanQywxFeeOrderAccount> 实例对象列表
* @return 影响行数
*/
int insertBatch(@Param("entities") List<TabHaobanQywxFeeOrderAccount> entities);
/**
* 修改数据 * 修改数据
* *
* @param tabHaobanQywxFeeOrderAccount 实例对象 * @param tabHaobanQywxFeeOrderAccount 实例对象
...@@ -56,14 +37,6 @@ public interface TabHaobanQywxFeeOrderAccountMapper { ...@@ -56,14 +37,6 @@ public interface TabHaobanQywxFeeOrderAccountMapper {
int update(TabHaobanQywxFeeOrderAccount tabHaobanQywxFeeOrderAccount); int update(TabHaobanQywxFeeOrderAccount tabHaobanQywxFeeOrderAccount);
/** /**
* 通过主键删除数据
*
* @param feeAccountId 主键
* @return 影响行数
*/
int deleteById(Long feeAccountId);
/**
* 根据状态查询用户数 * 根据状态查询用户数
* *
* @param status * @param status
......
package com.gic.haoban.manage.service.dao.mapper.fee; package com.gic.haoban.manage.service.dao.mapper.fee;
import com.gic.haoban.manage.service.entity.fee.TabHaobanQywxFeeOrder;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.springframework.data.domain.Pageable;
import java.util.List; import com.gic.haoban.manage.service.entity.fee.TabHaobanQywxFeeOrder;
/** /**
* 企业微信收费订单(TabHaobanQywxFeeOrder)表数据库访问层 * 企业微信收费订单(TabHaobanQywxFeeOrder)表数据库访问层
...@@ -20,16 +18,8 @@ public interface TabHaobanQywxFeeOrderMapper { ...@@ -20,16 +18,8 @@ public interface TabHaobanQywxFeeOrderMapper {
* @param feeOrderId 主键 * @param feeOrderId 主键
* @return 实例对象 * @return 实例对象
*/ */
TabHaobanQywxFeeOrder queryById(Long feeOrderId); TabHaobanQywxFeeOrder selectByOrderId(@Param("wxEnterpriseId")String wxEnterpriseId , @Param("orderId")String orderId) ;
/**
* 查询指定行数据
*
* @param tabHaobanQywxFeeOrder 查询条件
* @param pageable 分页对象
* @return 对象列表
*/
List<TabHaobanQywxFeeOrder> queryAllByLimit(TabHaobanQywxFeeOrder tabHaobanQywxFeeOrder, @Param("pageable") Pageable pageable);
/** /**
* 新增数据 * 新增数据
...@@ -40,30 +30,6 @@ public interface TabHaobanQywxFeeOrderMapper { ...@@ -40,30 +30,6 @@ public interface TabHaobanQywxFeeOrderMapper {
int insert(TabHaobanQywxFeeOrder tabHaobanQywxFeeOrder); int insert(TabHaobanQywxFeeOrder tabHaobanQywxFeeOrder);
/** /**
* 批量新增数据(MyBatis原生foreach方法)
*
* @param entities List<TabHaobanQywxFeeOrder> 实例对象列表
* @return 影响行数
*/
int insertBatch(@Param("entities") List<TabHaobanQywxFeeOrder> entities);
/**
* 修改数据
*
* @param tabHaobanQywxFeeOrder 实例对象
* @return 影响行数
*/
int update(TabHaobanQywxFeeOrder tabHaobanQywxFeeOrder);
/**
* 通过主键删除数据
*
* @param feeOrderId 主键
* @return 影响行数
*/
int deleteById(Long feeOrderId);
/**
* 购买许可总数 * 购买许可总数
* *
* @param wxEnterpriseId wx企业标识 * @param wxEnterpriseId wx企业标识
......
...@@ -14,15 +14,13 @@ public class TabHaobanQywxFeeAccountStaff implements Serializable { ...@@ -14,15 +14,13 @@ public class TabHaobanQywxFeeAccountStaff implements Serializable {
private Long feeAccountStaffId; private Long feeAccountStaffId;
private String orderId;
private String corpId; private String corpId;
private String wxEnterpriseId; private String wxEnterpriseId;
/** /**
* 员工id * 员工id
*/ */
private String staffId; private String wxUserId;
/** /**
* 帐号码 * 帐号码
*/ */
...@@ -49,14 +47,6 @@ public class TabHaobanQywxFeeAccountStaff implements Serializable { ...@@ -49,14 +47,6 @@ public class TabHaobanQywxFeeAccountStaff implements Serializable {
this.feeAccountStaffId = feeAccountStaffId; this.feeAccountStaffId = feeAccountStaffId;
} }
public String getOrderId() {
return orderId;
}
public void setOrderId(String orderId) {
this.orderId = orderId;
}
public String getCorpId() { public String getCorpId() {
return corpId; return corpId;
} }
...@@ -72,13 +62,13 @@ public class TabHaobanQywxFeeAccountStaff implements Serializable { ...@@ -72,13 +62,13 @@ public class TabHaobanQywxFeeAccountStaff implements Serializable {
public void setWxEnterpriseId(String wxEnterpriseId) { public void setWxEnterpriseId(String wxEnterpriseId) {
this.wxEnterpriseId = wxEnterpriseId; this.wxEnterpriseId = wxEnterpriseId;
} }
public String getStaffId() { public String getWxUserId() {
return staffId; return wxUserId;
} }
public void setStaffId(String staffId) { public void setWxUserId(String wxUserId) {
this.staffId = staffId; this.wxUserId = wxUserId;
} }
public String getActiveCode() { public String getActiveCode() {
......
package com.gic.haoban.manage.service.service; package com.gic.haoban.manage.service.service;
import java.util.Date;
import java.util.List;
import com.gic.haoban.base.api.common.BasePageInfo; import com.gic.haoban.base.api.common.BasePageInfo;
import com.gic.haoban.manage.api.dto.StaffDTO; import com.gic.haoban.manage.api.dto.StaffDTO;
import com.gic.haoban.manage.service.entity.TabHaobanStaff; import com.gic.haoban.manage.service.entity.TabHaobanStaff;
import com.github.pagehelper.Page; import com.github.pagehelper.Page;
import java.util.List;
import java.util.Set;
public interface StaffService { public interface StaffService {
TabHaobanStaff selectById(String staffId); TabHaobanStaff selectById(String staffId);
...@@ -131,17 +131,25 @@ public interface StaffService { ...@@ -131,17 +131,25 @@ public interface StaffService {
* @date 2022-07-25 16:36:53 * @date 2022-07-25 16:36:53
*/ */
int resetAddNum(); int resetAddNum();
/** /**
* 更新是否激活 *
* * @Title: updateActiveStatusById
* @param activeStatus 活跃状态 * @Description: 更新激活账号
* @param staffId 员工id * @return
* @return int * @throws
* @author mozhu
* @date 2022-08-04 15:39:54
*/ */
int updateActiveStatusById(Integer activeStatus,String staffId); int updateActiveStatusById(String staffId, Date activeTime, Date expireTime ,String activeCode ,Integer activeStatus);
void updateOpenConcatFlag(List<String> wxUserIdList,int mixFlag); void updateOpenConcatFlag(List<String> wxUserIdList,int mixFlag);
/**
*
* @Title: activedAccountTimer
* @Description: 更新激活账号
* @author xgh331
* @throws
*/
void activedAccountTimer(String wxEid);
} }
...@@ -14,37 +14,12 @@ import java.util.List; ...@@ -14,37 +14,12 @@ import java.util.List;
public interface HaobanQywxFeeAccountStaffService { public interface HaobanQywxFeeAccountStaffService {
/** /**
* 通过ID查询单条数据
*
* @param feeAccountId 主键
* @return 实例对象
*/
TabHaobanQywxFeeAccountStaff queryById(Long feeAccountId);
/**
* 新增数据 * 新增数据
* *
* @param tabHaobanQywxFeeAccountStaff 实例对象 * @param tabHaobanQywxFeeAccountStaff 实例对象
* @return 实例对象 * @return 实例对象
*/ */
TabHaobanQywxFeeAccountStaff insert(TabHaobanQywxFeeAccountStaff tabHaobanQywxFeeAccountStaff); TabHaobanQywxFeeAccountStaff save(TabHaobanQywxFeeAccountStaff tabHaobanQywxFeeAccountStaff);
/**
* 修改数据
*
* @param tabHaobanQywxFeeAccountStaff 实例对象
* @return 实例对象
*/
TabHaobanQywxFeeAccountStaff update(TabHaobanQywxFeeAccountStaff tabHaobanQywxFeeAccountStaff);
/**
* 通过主键删除数据
*
* @param feeAccountId 主键
* @return 是否成功
*/
boolean deleteById(Long feeAccountId);
/** /**
* 详情 * 详情
...@@ -78,4 +53,6 @@ public interface HaobanQywxFeeAccountStaffService { ...@@ -78,4 +53,6 @@ public interface HaobanQywxFeeAccountStaffService {
*/ */
int monthWillInterceptNum(String wxEnterpriseId); int monthWillInterceptNum(String wxEnterpriseId);
void deleteAll(String wxEnterpriseId);
} }
...@@ -11,36 +11,12 @@ import com.gic.haoban.manage.service.entity.fee.TabHaobanQywxFeeOrderAccount; ...@@ -11,36 +11,12 @@ import com.gic.haoban.manage.service.entity.fee.TabHaobanQywxFeeOrderAccount;
public interface HaobanQywxFeeOrderAccountService { public interface HaobanQywxFeeOrderAccountService {
/** /**
* 通过ID查询单条数据
*
* @param feeAccountId 主键
* @return 实例对象
*/
TabHaobanQywxFeeOrderAccount queryById(Long feeAccountId);
/**
* 新增数据 * 新增数据
* *
* @param tabHaobanQywxFeeOrderAccount 实例对象 * @param tabHaobanQywxFeeOrderAccount 实例对象
* @return 实例对象 * @return 实例对象
*/ */
TabHaobanQywxFeeOrderAccount insert(TabHaobanQywxFeeOrderAccount tabHaobanQywxFeeOrderAccount); TabHaobanQywxFeeOrderAccount save(TabHaobanQywxFeeOrderAccount activeAccount);
/**
* 修改数据
*
* @param tabHaobanQywxFeeOrderAccount 实例对象
* @return 实例对象
*/
TabHaobanQywxFeeOrderAccount update(TabHaobanQywxFeeOrderAccount tabHaobanQywxFeeOrderAccount);
/**
* 通过主键删除数据
*
* @param feeAccountId 主键
* @return 是否成功
*/
boolean deleteById(Long feeAccountId);
/** /**
* 未激活用户数 * 未激活用户数
......
...@@ -11,14 +11,6 @@ import com.gic.haoban.manage.service.entity.fee.TabHaobanQywxFeeOrder; ...@@ -11,14 +11,6 @@ import com.gic.haoban.manage.service.entity.fee.TabHaobanQywxFeeOrder;
public interface HaobanQywxFeeOrderService { public interface HaobanQywxFeeOrderService {
/** /**
* 通过ID查询单条数据
*
* @param feeOrderId 主键
* @return 实例对象
*/
TabHaobanQywxFeeOrder queryById(Long feeOrderId);
/**
* 新增数据 * 新增数据
* *
* @param tabHaobanQywxFeeOrder 实例对象 * @param tabHaobanQywxFeeOrder 实例对象
...@@ -27,22 +19,6 @@ public interface HaobanQywxFeeOrderService { ...@@ -27,22 +19,6 @@ public interface HaobanQywxFeeOrderService {
TabHaobanQywxFeeOrder insert(TabHaobanQywxFeeOrder tabHaobanQywxFeeOrder); TabHaobanQywxFeeOrder insert(TabHaobanQywxFeeOrder tabHaobanQywxFeeOrder);
/** /**
* 修改数据
*
* @param tabHaobanQywxFeeOrder 实例对象
* @return 实例对象
*/
TabHaobanQywxFeeOrder update(TabHaobanQywxFeeOrder tabHaobanQywxFeeOrder);
/**
* 通过主键删除数据
*
* @param feeOrderId 主键
* @return 是否成功
*/
boolean deleteById(Long feeOrderId);
/**
* 购买许可总数 * 购买许可总数
* *
* @param wxEnterpriseId wx企业标识 * @param wxEnterpriseId wx企业标识
......
...@@ -21,50 +21,20 @@ public class HaobanQywxFeeAccountStaffServiceImpl implements HaobanQywxFeeAccoun ...@@ -21,50 +21,20 @@ public class HaobanQywxFeeAccountStaffServiceImpl implements HaobanQywxFeeAccoun
private TabHaobanQywxFeeAccountStaffMapper tabHaobanQywxFeeAccountStaffMapper; private TabHaobanQywxFeeAccountStaffMapper tabHaobanQywxFeeAccountStaffMapper;
/** /**
* 通过ID查询单条数据
*
* @param feeAccountId 主键
* @return 实例对象
*/
@Override
public TabHaobanQywxFeeAccountStaff queryById(Long feeAccountId) {
return this.tabHaobanQywxFeeAccountStaffMapper.queryById(feeAccountId);
}
/**
* 新增数据 * 新增数据
* *
* @param tabHaobanQywxFeeAccountStaff 实例对象 * @param tabHaobanQywxFeeAccountStaff 实例对象
* @return 实例对象 * @return 实例对象
*/ */
@Override @Override
public TabHaobanQywxFeeAccountStaff insert(TabHaobanQywxFeeAccountStaff tabHaobanQywxFeeAccountStaff) { public TabHaobanQywxFeeAccountStaff save(TabHaobanQywxFeeAccountStaff account) {
this.tabHaobanQywxFeeAccountStaffMapper.insert(tabHaobanQywxFeeAccountStaff); this.tabHaobanQywxFeeAccountStaffMapper.insert(account);
return tabHaobanQywxFeeAccountStaff; return account ;
}
/**
* 修改数据
*
* @param tabHaobanQywxFeeAccountStaff 实例对象
* @return 实例对象
*/
@Override
public TabHaobanQywxFeeAccountStaff update(TabHaobanQywxFeeAccountStaff tabHaobanQywxFeeAccountStaff) {
this.tabHaobanQywxFeeAccountStaffMapper.update(tabHaobanQywxFeeAccountStaff);
return this.queryById(tabHaobanQywxFeeAccountStaff.getFeeAccountStaffId());
} }
/**
* 通过主键删除数据
*
* @param feeAccountId 主键
* @return 是否成功
*/
@Override @Override
public boolean deleteById(Long feeAccountId) { public void deleteAll(String wxEnterpriseId) {
return this.tabHaobanQywxFeeAccountStaffMapper.deleteById(feeAccountId) > 0; this.tabHaobanQywxFeeAccountStaffMapper.deleteAll(wxEnterpriseId);
} }
@Override @Override
......
package com.gic.haoban.manage.service.service.fee.impl; package com.gic.haoban.manage.service.service.fee.impl;
import com.gic.commons.util.UniqueIdUtils;
import com.gic.haoban.manage.service.dao.mapper.fee.TabHaobanQywxFeeOrderAccountMapper; import com.gic.haoban.manage.service.dao.mapper.fee.TabHaobanQywxFeeOrderAccountMapper;
import com.gic.haoban.manage.service.entity.fee.TabHaobanQywxFeeOrderAccount; import com.gic.haoban.manage.service.entity.fee.TabHaobanQywxFeeOrderAccount;
import com.gic.haoban.manage.service.service.fee.HaobanQywxFeeOrderAccountService; import com.gic.haoban.manage.service.service.fee.HaobanQywxFeeOrderAccountService;
...@@ -18,50 +19,25 @@ public class HaobanQywxFeeOrderAccountServiceImpl implements HaobanQywxFeeOrderA ...@@ -18,50 +19,25 @@ public class HaobanQywxFeeOrderAccountServiceImpl implements HaobanQywxFeeOrderA
private TabHaobanQywxFeeOrderAccountMapper tabHaobanQywxFeeOrderAccountMapper; private TabHaobanQywxFeeOrderAccountMapper tabHaobanQywxFeeOrderAccountMapper;
/** /**
* 通过ID查询单条数据
*
* @param feeAccountId 主键
* @return 实例对象
*/
@Override
public TabHaobanQywxFeeOrderAccount queryById(Long feeAccountId) {
return this.tabHaobanQywxFeeOrderAccountMapper.queryById(feeAccountId);
}
/**
* 新增数据 * 新增数据
* *
* @param tabHaobanQywxFeeOrderAccount 实例对象 * @param tabHaobanQywxFeeOrderAccount 实例对象
* @return 实例对象 * @return 实例对象
*/ */
@Override @Override
public TabHaobanQywxFeeOrderAccount insert(TabHaobanQywxFeeOrderAccount tabHaobanQywxFeeOrderAccount) { public TabHaobanQywxFeeOrderAccount save(TabHaobanQywxFeeOrderAccount activeAccount) {
this.tabHaobanQywxFeeOrderAccountMapper.insert(tabHaobanQywxFeeOrderAccount); String wxEnterpriseId = activeAccount.getWxEnterpriseId() ;
return tabHaobanQywxFeeOrderAccount; String orderId = activeAccount.getOrderId() ;
} String activeCode = activeAccount.getActiveCode() ;
TabHaobanQywxFeeOrderAccount tab = this.tabHaobanQywxFeeOrderAccountMapper.selectByOrderIdAndCode(wxEnterpriseId, orderId, activeCode) ;
/** if(tab==null) {
* 修改数据 activeAccount.setFeeAccountId(UniqueIdUtils.uniqueLong());
* this.tabHaobanQywxFeeOrderAccountMapper.insert(activeAccount);
* @param tabHaobanQywxFeeOrderAccount 实例对象 }else {
* @return 实例对象 activeAccount.setFeeAccountId(tab.getFeeAccountId());
*/ this.tabHaobanQywxFeeOrderAccountMapper.update(activeAccount);
@Override }
public TabHaobanQywxFeeOrderAccount update(TabHaobanQywxFeeOrderAccount tabHaobanQywxFeeOrderAccount) { return activeAccount;
this.tabHaobanQywxFeeOrderAccountMapper.update(tabHaobanQywxFeeOrderAccount);
return this.queryById(tabHaobanQywxFeeOrderAccount.getFeeAccountId());
}
/**
* 通过主键删除数据
*
* @param feeAccountId 主键
* @return 是否成功
*/
@Override
public boolean deleteById(Long feeAccountId) {
return this.tabHaobanQywxFeeOrderAccountMapper.deleteById(feeAccountId) > 0;
} }
@Override @Override
......
package com.gic.haoban.manage.service.service.fee.impl; package com.gic.haoban.manage.service.service.fee.impl;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.gic.haoban.manage.service.dao.mapper.fee.TabHaobanQywxFeeOrderMapper; import com.gic.haoban.manage.service.dao.mapper.fee.TabHaobanQywxFeeOrderMapper;
import com.gic.haoban.manage.service.entity.fee.TabHaobanQywxFeeOrder; import com.gic.haoban.manage.service.entity.fee.TabHaobanQywxFeeOrder;
import com.gic.haoban.manage.service.service.fee.HaobanQywxFeeOrderService; import com.gic.haoban.manage.service.service.fee.HaobanQywxFeeOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/** /**
* 企业微信收费订单(TabHaobanQywxFeeOrder)表服务实现类 * 企业微信收费订单(TabHaobanQywxFeeOrder)表服务实现类
...@@ -14,22 +17,15 @@ import org.springframework.stereotype.Service; ...@@ -14,22 +17,15 @@ import org.springframework.stereotype.Service;
*/ */
@Service @Service
public class HaobanQywxFeeOrderServiceImpl implements HaobanQywxFeeOrderService { public class HaobanQywxFeeOrderServiceImpl implements HaobanQywxFeeOrderService {
private static Logger logger = LogManager.getLogger(HaobanQywxFeeOrderService.class);
@Autowired @Autowired
private TabHaobanQywxFeeOrderMapper tabHaobanQywxFeeOrderMapper; private TabHaobanQywxFeeOrderMapper tabHaobanQywxFeeOrderMapper;
/** /**
* 通过ID查询单条数据
*
* @param feeOrderId 主键
* @return 实例对象
*/
@Override
public TabHaobanQywxFeeOrder queryById(Long feeOrderId) {
return this.tabHaobanQywxFeeOrderMapper.queryById(feeOrderId);
}
/**
* 新增数据 * 新增数据
* *
* @param tabHaobanQywxFeeOrder 实例对象 * @param tabHaobanQywxFeeOrder 实例对象
...@@ -37,33 +33,17 @@ public class HaobanQywxFeeOrderServiceImpl implements HaobanQywxFeeOrderService ...@@ -37,33 +33,17 @@ public class HaobanQywxFeeOrderServiceImpl implements HaobanQywxFeeOrderService
*/ */
@Override @Override
public TabHaobanQywxFeeOrder insert(TabHaobanQywxFeeOrder tabHaobanQywxFeeOrder) { public TabHaobanQywxFeeOrder insert(TabHaobanQywxFeeOrder tabHaobanQywxFeeOrder) {
String wxEnterpriseId = tabHaobanQywxFeeOrder.getWxEnterpriseId() ;
String orderId = tabHaobanQywxFeeOrder.getOrderId() ;
TabHaobanQywxFeeOrder tab = this.tabHaobanQywxFeeOrderMapper.selectByOrderId(wxEnterpriseId, orderId) ;
if(null != tab) {
logger.info("订单记录已经存在,orderId={}",orderId);
return tab ;
}
this.tabHaobanQywxFeeOrderMapper.insert(tabHaobanQywxFeeOrder); this.tabHaobanQywxFeeOrderMapper.insert(tabHaobanQywxFeeOrder);
return tabHaobanQywxFeeOrder; return tabHaobanQywxFeeOrder;
} }
/**
* 修改数据
*
* @param tabHaobanQywxFeeOrder 实例对象
* @return 实例对象
*/
@Override
public TabHaobanQywxFeeOrder update(TabHaobanQywxFeeOrder tabHaobanQywxFeeOrder) {
this.tabHaobanQywxFeeOrderMapper.update(tabHaobanQywxFeeOrder);
return this.queryById(tabHaobanQywxFeeOrder.getFeeOrderId());
}
/**
* 通过主键删除数据
*
* @param feeOrderId 主键
* @return 是否成功
*/
@Override
public boolean deleteById(Long feeOrderId) {
return this.tabHaobanQywxFeeOrderMapper.deleteById(feeOrderId) > 0;
}
@Override @Override
public int countExternalContactCount(String wxEnterpriseId) { public int countExternalContactCount(String wxEnterpriseId) {
return tabHaobanQywxFeeOrderMapper.countExternalContactCount(wxEnterpriseId); return tabHaobanQywxFeeOrderMapper.countExternalContactCount(wxEnterpriseId);
......
...@@ -72,12 +72,12 @@ public class StaffClerkRelationServiceImpl implements StaffClerkRelationService ...@@ -72,12 +72,12 @@ public class StaffClerkRelationServiceImpl implements StaffClerkRelationService
@Override @Override
public List<StaffClerkRelationDTO> listBindCode(String wxEnterpriseId, String enterpriseId, Set<String> clerkCodeList) { public List<StaffClerkRelationDTO> listBindCode(String wxEnterpriseId, String enterpriseId, Set<String> clerkCodeList) {
return mapper.listBindCode(wxEnterpriseId, enterpriseId, clerkCodeList); return this.filterDelClerkList(mapper.listBindCode(wxEnterpriseId, enterpriseId, clerkCodeList));
} }
@Override @Override
public List<StaffClerkRelationDTO> listBindCodeByStaffId(List<String> enterpriseIdList, String staffId) { public List<StaffClerkRelationDTO> listBindCodeByStaffId(List<String> enterpriseIdList, String staffId) {
return mapper.listBindCodeByStaffId(enterpriseIdList, staffId); return this.filterDelClerkList(mapper.listBindCodeByStaffId(enterpriseIdList, staffId));
} }
@Override @Override
...@@ -218,7 +218,7 @@ public class StaffClerkRelationServiceImpl implements StaffClerkRelationService ...@@ -218,7 +218,7 @@ public class StaffClerkRelationServiceImpl implements StaffClerkRelationService
@Override @Override
public StaffClerkRelationDTO getBindByClerkId(String clerkId, String wxEnterpriseId) { public StaffClerkRelationDTO getBindByClerkId(String clerkId, String wxEnterpriseId) {
return mapper.getOneByClerkId(clerkId, wxEnterpriseId); return this.filterDelClerk(mapper.getOneByClerkId(clerkId, wxEnterpriseId));
} }
@Override @Override
...@@ -259,12 +259,13 @@ public class StaffClerkRelationServiceImpl implements StaffClerkRelationService ...@@ -259,12 +259,13 @@ public class StaffClerkRelationServiceImpl implements StaffClerkRelationService
@Override @Override
public StaffClerkRelationDTO getOneBindByStoreId(String staffId, String storeId) { public StaffClerkRelationDTO getOneBindByStoreId(String staffId, String storeId) {
return mapper.getOneByStoreIdAndStaffId(storeId,staffId); StaffClerkRelationDTO dto = this.filterDelClerk(mapper.getOneByStoreIdAndStaffId(storeId,staffId));
return dto ;
} }
@Override @Override
public StaffClerkRelationDTO getByClerkId(String clerkId) { public StaffClerkRelationDTO getByClerkId(String clerkId) {
return mapper.getOneByClerkId(clerkId, null); return this.filterDelClerk(mapper.getOneByClerkId(clerkId, null));
} }
@Override @Override
...@@ -390,6 +391,36 @@ public class StaffClerkRelationServiceImpl implements StaffClerkRelationService ...@@ -390,6 +391,36 @@ public class StaffClerkRelationServiceImpl implements StaffClerkRelationService
@Override @Override
public List<StaffClerkRelationDTO> listManageBindByStaffId(String staffId) { public List<StaffClerkRelationDTO> listManageBindByStaffId(String staffId) {
return mapper.listManageBindByStaffId(staffId); return this.filterDelClerkList(mapper.listManageBindByStaffId(staffId));
}
private List<StaffClerkRelationDTO> filterDelClerkList(List<StaffClerkRelationDTO> list) {
if(CollectionUtils.isEmpty(list)) {
return list ;
}
List<StaffClerkRelationDTO> retList = new ArrayList<>() ;
for(StaffClerkRelationDTO item : list) {
String clerkId = item.getClerkId() ;
ClerkDTO clerk = this.clerkService.getclerkById(clerkId) ;
if(null != clerk && clerk.getStatus() == 1) {
retList.add(item) ;
}else {
this.mapper.delByClerkId(clerkId);
}
}
return retList ;
}
private StaffClerkRelationDTO filterDelClerk(StaffClerkRelationDTO dto) {
if(null == dto) {
return dto ;
}
String clerkId = dto.getClerkId() ;
ClerkDTO clerk = this.clerkService.getclerkById(clerkId) ;
if(null == clerk || clerk.getStatus() != 1) {
this.mapper.delByClerkId(clerkId);
dto = null ;
}
return dto ;
} }
} }
package com.gic.haoban.manage.service.service.impl; package com.gic.haoban.manage.service.service.impl;
import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Set;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
...@@ -10,24 +10,50 @@ import org.apache.logging.log4j.Logger; ...@@ -10,24 +10,50 @@ 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 com.alibaba.fastjson.JSON;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.commons.util.EntityUtil; import com.gic.commons.util.EntityUtil;
import com.gic.commons.util.UniqueIdUtils;
import com.gic.haoban.base.api.common.BasePageInfo; import com.gic.haoban.base.api.common.BasePageInfo;
import com.gic.haoban.common.utils.PageUtil; import com.gic.haoban.common.utils.PageUtil;
import com.gic.haoban.common.utils.StringUtil; import com.gic.haoban.common.utils.StringUtil;
import com.gic.haoban.manage.api.dto.StaffDTO; import com.gic.haoban.manage.api.dto.StaffDTO;
import com.gic.haoban.manage.service.config.Config;
import com.gic.haoban.manage.service.dao.mapper.StaffMapper; import com.gic.haoban.manage.service.dao.mapper.StaffMapper;
import com.gic.haoban.manage.service.dao.mapper.WxEnterpriseMapper;
import com.gic.haoban.manage.service.entity.TabHaobanStaff; import com.gic.haoban.manage.service.entity.TabHaobanStaff;
import com.gic.haoban.manage.service.entity.TabHaobanWxEnterprise;
import com.gic.haoban.manage.service.entity.fee.TabHaobanQywxFeeAccountStaff;
import com.gic.haoban.manage.service.service.StaffService; import com.gic.haoban.manage.service.service.StaffService;
import com.gic.haoban.manage.service.service.fee.HaobanQywxFeeAccountStaffService;
import com.gic.wechat.api.dto.qywx.fee.AccountListDTO;
import com.gic.wechat.api.dto.qywx.fee.AccountListResponseDTO;
import com.gic.wechat.api.dto.qywx.fee.ActiveInfoUserResponseDTO;
import com.gic.wechat.api.service.qywx.QywxOrderApiService;
import com.gic.wechat.api.service.qywx.QywxUserApiService;
import com.github.pagehelper.Page; import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import cn.hutool.core.date.DateUtil;
@Service @Service
public class StaffServiceImpl implements StaffService { public class StaffServiceImpl implements StaffService {
private static final Logger log = LogManager.getLogger(StaffServiceImpl.class); private static final Logger log = LogManager.getLogger(StaffServiceImpl.class);
@Autowired @Autowired
private StaffMapper mapper; private StaffMapper mapper;
@Autowired
private QywxOrderApiService qywxOrderApiService ;
@Autowired
private WxEnterpriseMapper wxEnterpriseMapper ;
@Autowired
private Config config ;
@Autowired
private HaobanQywxFeeAccountStaffService haobanQywxFeeAccountStaffService;
@Autowired
private QywxUserApiService qywxUserApiService ;
@Override @Override
public TabHaobanStaff selectById(String id) { public TabHaobanStaff selectById(String id) {
if (StringUtils.isBlank(id)) { if (StringUtils.isBlank(id)) {
...@@ -146,10 +172,11 @@ public class StaffServiceImpl implements StaffService { ...@@ -146,10 +172,11 @@ public class StaffServiceImpl implements StaffService {
public int resetAddNum() { public int resetAddNum() {
return mapper.resetAddNum(); return mapper.resetAddNum();
} }
@Override @Override
public int updateActiveStatusById(Integer activeStatus, String staffId) { public int updateActiveStatusById(String staffId, Date activeTime, Date expireTime,
return mapper.updateActiveStatusById(activeStatus,staffId); String activeCode, Integer activeStatus) {
return mapper.updateActiveStatusById(staffId, activeTime, expireTime, activeCode , activeStatus) ;
} }
@Override @Override
...@@ -159,4 +186,89 @@ public class StaffServiceImpl implements StaffService { ...@@ -159,4 +186,89 @@ public class StaffServiceImpl implements StaffService {
} }
this.mapper.updateOpenConcatFlag(wxUserIdList,mixFlag); this.mapper.updateOpenConcatFlag(wxUserIdList,mixFlag);
} }
@Override
public void activedAccountTimer(String wxEid) {
log.info("开始查询激活账号,wxEid={}", wxEid);
List<TabHaobanWxEnterprise> list = new ArrayList<>() ;
if("-1".equals(wxEid)) {
list = this.wxEnterpriseMapper.listAll() ;
}else {
TabHaobanWxEnterprise en = this.wxEnterpriseMapper.selectByPrimaryKey(wxEid) ;
if(null != en) {
list.add(en) ;
}
}
if(CollectionUtils.isNotEmpty(list)) {
for(TabHaobanWxEnterprise item : list) {
if(item.getWxSecurityType()>0 && StringUtils.isNotEmpty(item.getOpenCorpid()) && item.getStatusFlag()==1) {
this.haobanQywxFeeAccountStaffService.deleteAll(item.getWxEnterpriseId()) ;
this.mapper.deleteActivieInfo(item.getWxEnterpriseId());
this.listAccount(item, 500, null);
}
}
}
}
private void listAccount(TabHaobanWxEnterprise wxEnterprise , int limit , String cursor) {
String wxEnterpriseId = wxEnterprise.getWxEnterpriseId() ;
String openCorpid = wxEnterprise.getOpenCorpid() ;
ServiceResponse<AccountListResponseDTO> resp = this.qywxOrderApiService.listActivedAccount(config.getCorpid(), openCorpid, limit, cursor) ;
log.info("查询激活账号,wxEid={},返回={}",wxEnterpriseId,JSON.toJSONString(resp));
if(resp.isSuccess()) {
AccountListResponseDTO dto = resp.getResult() ;
List<AccountListDTO> list = dto.getAccountList() ;
log.info("查询激活账号,size={},wxeid={}",list.size(),wxEnterpriseId);
this.updateAccount(wxEnterpriseId,openCorpid, list);
cursor = dto.getNextCursor() ;
Integer hasMore = dto.getHasMore() ;
// 从企微拉取下一批数据
if (StringUtils.isNotBlank(cursor) && null !=hasMore && hasMore==1) {
this.listAccount(wxEnterprise, limit , cursor);
}
}
}
private void updateAccount(String wxEnterpriseId , String openCorpid ,List<AccountListDTO> list) {
for(AccountListDTO item : list) {
String userId = item.getUserid() ;
ActiveInfoUserResponseDTO activeInfoUserResponseDTO = qywxUserApiService.getActiveInfoByUser(openCorpid, config.getCorpid(), userId);
log.info("查询用户激活详情={},{}",JSON.toJSONString(activeInfoUserResponseDTO),userId);
String activeCode = null ;
if (activeInfoUserResponseDTO.getErrcode() == 0) {
for(AccountListDTO dto : activeInfoUserResponseDTO.getActiveInfoList()) {
if(dto.getType()==2) {
activeCode = dto.getActiveCode() ;
}
}
}
if(StringUtils.isEmpty(activeCode)){
log.info("无互通激活码={}",userId);
continue ;
}
Date start = new Date(item.getActiveTime()*1000L) ;
Date end = new Date(item.getExpireTime()*1000L) ;
log.info("更新staff表,userId={}",userId);
TabHaobanStaff staff = this.mapper.selectByUserIdAndEnterpriseId(userId, wxEnterpriseId) ;
if(null == staff && end.getTime()>System.currentTimeMillis()) {
staff = this.mapper.getDeleteUser(userId, wxEnterpriseId) ;
}
if(null != staff) {
this.updateActiveStatusById(staff.getStaffId(), start, end, activeCode, 1) ;
}else {
log.info("查询激活账号,用户不存在,userid={}",userId);
}
TabHaobanQywxFeeAccountStaff accountStaff = new TabHaobanQywxFeeAccountStaff();
accountStaff.setFeeAccountStaffId(UniqueIdUtils.uniqueLong());
accountStaff.setWxEnterpriseId(wxEnterpriseId);
accountStaff.setCorpId(openCorpid);
accountStaff.setActiveCode(activeCode);
accountStaff.setWxUserId(userId);
accountStaff.setAccountType(item.getType());
accountStaff.setExpireTime(DateUtil.date(item.getExpireTime() * 1000));
accountStaff.setActiveTime(DateUtil.date(item.getActiveTime() * 1000));
this.haobanQywxFeeAccountStaffService.save(accountStaff);
}
}
} }
...@@ -7,6 +7,7 @@ import com.gic.api.base.commons.ServiceResponse; ...@@ -7,6 +7,7 @@ import com.gic.api.base.commons.ServiceResponse;
import com.gic.haoban.manage.api.service.HaobanTimerApiService; import com.gic.haoban.manage.api.service.HaobanTimerApiService;
import com.gic.haoban.manage.service.service.ExternalClerkRelatedService; import com.gic.haoban.manage.service.service.ExternalClerkRelatedService;
import com.gic.haoban.manage.service.service.StaffDepartmentRelatedService; import com.gic.haoban.manage.service.service.StaffDepartmentRelatedService;
import com.gic.haoban.manage.service.service.StaffService;
import com.gic.haoban.manage.service.service.chat.GroupChatService; import com.gic.haoban.manage.service.service.chat.GroupChatService;
import com.gic.haoban.manage.service.service.hm.HmQrcodeTempService; import com.gic.haoban.manage.service.service.hm.HmQrcodeTempService;
...@@ -21,6 +22,8 @@ public class HaobanTimerApiServiceImpl implements HaobanTimerApiService { ...@@ -21,6 +22,8 @@ public class HaobanTimerApiServiceImpl implements HaobanTimerApiService {
private StaffDepartmentRelatedService staffDepartmentRelatedService; private StaffDepartmentRelatedService staffDepartmentRelatedService;
@Autowired @Autowired
private GroupChatService groupChatService; private GroupChatService groupChatService;
@Autowired
private StaffService staffService ;
@Override @Override
public ServiceResponse<Void> deleteTempWxHm(String params) { public ServiceResponse<Void> deleteTempWxHm(String params) {
...@@ -69,4 +72,10 @@ public class HaobanTimerApiServiceImpl implements HaobanTimerApiService { ...@@ -69,4 +72,10 @@ public class HaobanTimerApiServiceImpl implements HaobanTimerApiService {
this.groupChatService.ownerDimission(); this.groupChatService.ownerDimission();
return ServiceResponse.success(); return ServiceResponse.success();
} }
@Override
public ServiceResponse<Void> activedAccountTimer(String params) {
this.staffService.activedAccountTimer(params) ;
return ServiceResponse.success();
}
} }
...@@ -35,7 +35,6 @@ import com.gic.haoban.manage.service.entity.TabHaobanSyncErrorLog; ...@@ -35,7 +35,6 @@ import com.gic.haoban.manage.service.entity.TabHaobanSyncErrorLog;
import com.gic.haoban.manage.service.service.*; import com.gic.haoban.manage.service.service.*;
import com.gic.haoban.manage.service.util.EmojiFilterUtil; import com.gic.haoban.manage.service.util.EmojiFilterUtil;
import com.gic.redis.data.util.RedisUtil; import com.gic.redis.data.util.RedisUtil;
import com.gic.thirdparty.api.service.QQCloudPicService;
import com.gic.thirdparty.cloudfile.CloudFileUtil; import com.gic.thirdparty.cloudfile.CloudFileUtil;
import com.gic.thirdparty.cloudfile.enums.CloudFileBusinessOptEnum; import com.gic.thirdparty.cloudfile.enums.CloudFileBusinessOptEnum;
import com.gic.thirdparty.cloudfile.enums.CloudFileTypeEnum; import com.gic.thirdparty.cloudfile.enums.CloudFileTypeEnum;
...@@ -83,8 +82,6 @@ public class StaffApiServiceImpl implements StaffApiService { ...@@ -83,8 +82,6 @@ public class StaffApiServiceImpl implements StaffApiService {
@Autowired @Autowired
private SyncErrorLogService syncErrorLogService; private SyncErrorLogService syncErrorLogService;
@Autowired @Autowired
private QQCloudPicService qqCloudPicService;
@Autowired
private StaffClerkRelationService staffClerkRelationService; private StaffClerkRelationService staffClerkRelationService;
@Autowired @Autowired
private SecretSettingService secretSettingService; private SecretSettingService secretSettingService;
...@@ -584,30 +581,9 @@ public class StaffApiServiceImpl implements StaffApiService { ...@@ -584,30 +581,9 @@ public class StaffApiServiceImpl implements StaffApiService {
logger.info("成员没有关联:{}", clerkCode); logger.info("成员没有关联:{}", clerkCode);
return null; return null;
} }
String key = "qrcode-" + relationDTO.getStaffId(); String staffId = relationDTO.getStaffId();
Object url = RedisUtil.getCache(key);
if (null != url) {
resp.setResult((String) url);
return resp;
}
WxEnterpriseQwDTO qwDTO = this.wxEnterpriseService.getQwInfo(relationDTO.getWxEnterpriseId());
SecretSettingDTO secretSetting = secretSettingService.getSecretSetting(qwDTO.getWxEnterpriseId(), SecretTypeEnum.CUSTOMIZED_APP.getVal());
if (null == secretSetting || secretSetting.getCheckFlag() == 0) {
logger.info("没有配置secret:{}", qwDTO.getWxEnterpriseId());
return null;
}
String staffId = relationDTO.getStaffId() ;
TabHaobanStaff staff = this.staffMapper.selectByPrimaryKey(staffId) ; TabHaobanStaff staff = this.staffMapper.selectByPrimaryKey(staffId) ;
String wxUserId = staff.getWxUserId() ; resp.setResult(staff.getQrCode());
if (qwDTO.needOpenUserIdDk()) {
wxUserId = staff.getWxOpenUseId() ;
}
UserDTO user = qywxUserApiService.getSelfWorkWxUser(qwDTO.getDkCorpid(), secretSetting.getSecretVal(), wxUserId);
if (user != null) {
RedisUtil.setCache(key, user.getQr_code(), 2L, TimeUnit.DAYS);
resp.setResult(user.getQr_code());
return resp;
}
return resp; return resp;
} }
...@@ -742,11 +718,24 @@ public class StaffApiServiceImpl implements StaffApiService { ...@@ -742,11 +718,24 @@ public class StaffApiServiceImpl implements StaffApiService {
} }
@Override @Override
public int getSensitiveStatus(String staffId) {
String qrCode = staffMapper.getQrCodeByStaffId(staffId);
if(StringUtils.isNotBlank(qrCode))
return 1;
return 0;
}
@Override
public int updateQrCodeByStaffId(String staffId, String qrCode) { public int updateQrCodeByStaffId(String staffId, String qrCode) {
return staffMapper.updateQrCodeByStaffId(staffId, qrCode); return staffMapper.updateQrCodeByStaffId(staffId, qrCode);
} }
@Override @Override
public int updateQrCodeByUserId(String userId, String qrCode) {
return staffMapper.updateQrCodeByUserId(userId,qrCode);
}
@Override
public StaffQrCodeDTO getQrCodeByClerkId(String clerkId) { public StaffQrCodeDTO getQrCodeByClerkId(String clerkId) {
StaffClerkRelationDTO staffClerkRelationDTO = staffClerkRelationService.getByClerkId(clerkId); StaffClerkRelationDTO staffClerkRelationDTO = staffClerkRelationService.getByClerkId(clerkId);
if (staffClerkRelationDTO == null) { if (staffClerkRelationDTO == null) {
......
...@@ -201,6 +201,6 @@ ...@@ -201,6 +201,6 @@
<dubbo:reference interface="com.gic.wechat.api.service.qywx.QywxChatApiService" id="qywxChatApiService" timeout="10000" retries="0"/> <dubbo:reference interface="com.gic.wechat.api.service.qywx.QywxChatApiService" id="qywxChatApiService" timeout="10000" retries="0"/>
<dubbo:reference interface="com.gic.member.tag.api.service.MemberTagGroupApiService" id="memberTagGroupApiService" timeout="10000" retries="0"/> <dubbo:reference interface="com.gic.member.tag.api.service.MemberTagGroupApiService" id="memberTagGroupApiService" timeout="10000" retries="0"/>
<dubbo:reference interface="com.gic.enterprise.api.service.ScreeningDetailService" id="screeningDetailService" timeout="10000" retries="0"/> <dubbo:reference interface="com.gic.enterprise.api.service.ScreeningDetailService" id="screeningDetailService" timeout="10000" retries="0"/>
<dubbo:reference interface="com.gic.wechat.api.service.qywx.QywxOrderApiService" id="qywxOrderApiService" timeout="10000" retries="0"/>
</beans> </beans>
\ No newline at end of file
...@@ -349,6 +349,16 @@ ...@@ -349,6 +349,16 @@
and wx_enterprise_id = #{wxEnterpriseId} and wx_enterprise_id = #{wxEnterpriseId}
and status_flag = 1 limit 1 and status_flag = 1 limit 1
</select> </select>
<select id="getDeleteUser" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from tab_haoban_staff
where (wx_user_id = #{userId,jdbcType=VARCHAR} or wx_open_user_id = #{userId,jdbcType=VARCHAR})
and wx_enterprise_id = #{wxEnterpriseId}
and status_flag = 0 order by create_time desc limit 1
</select>
<select id="listByUserIdsAndWxEnterpriseId" resultMap="BaseResultMap"> <select id="listByUserIdsAndWxEnterpriseId" resultMap="BaseResultMap">
select select
...@@ -435,6 +445,10 @@ ...@@ -435,6 +445,10 @@
and wx_user_id = #{wxUserId} and wx_user_id = #{wxUserId}
</update> </update>
<select id="getQrCodeByStaffId" resultType="string">
select qr_code from tab_haoban_staff where staff_id = #{staffId} and status_flag = 1
</select>
<update id="updateOpenIdByStaffId" parameterType="com.gic.haoban.manage.service.entity.TabHaobanStaff"> <update id="updateOpenIdByStaffId" parameterType="com.gic.haoban.manage.service.entity.TabHaobanStaff">
update tab_haoban_staff update tab_haoban_staff
set wx_open_id = #{openId}, set wx_open_id = #{openId},
...@@ -449,6 +463,13 @@ ...@@ -449,6 +463,13 @@
where staff_id = #{staffId} where staff_id = #{staffId}
</update> </update>
<update id="updateQrCodeByUserId" parameterType="com.gic.haoban.manage.service.entity.TabHaobanStaff">
update tab_haoban_staff
set qr_code = #{qrCode},
update_time = now()
where wx_user_id = #{userId} or wx_open_user_id = #{userId}
</update>
<select id="selectByPhoneNumberAndEnterpriseId" resultMap="BaseResultMap" parameterType="java.lang.String"> <select id="selectByPhoneNumberAndEnterpriseId" resultMap="BaseResultMap" parameterType="java.lang.String">
select select
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
...@@ -479,9 +500,22 @@ ...@@ -479,9 +500,22 @@
<update id="updateActiveStatusById"> <update id="updateActiveStatusById">
update tab_haoban_staff update tab_haoban_staff
set active_status = #{activeStatus}, set active_status = #{activeStatus},
`active_time` = #{activeTime},
`expire_time` = #{expireTime},
`active_code` = #{activeCode},
update_time = now() update_time = now()
where staff_id = #{staffId} where staff_id = #{staffId}
</update> </update>
<update id="deleteActivieInfo">
update tab_haoban_staff
set active_status = 0,
`active_time` = null,
`expire_time` = null ,
active_code = null ,
update_time = now()
where wx_enterprise_id = #{wxEnterpriseId} and active_code is not null
</update>
<update id="resetAddNum"> <update id="resetAddNum">
......
...@@ -4,10 +4,9 @@ ...@@ -4,10 +4,9 @@
<resultMap type="com.gic.haoban.manage.service.entity.fee.TabHaobanQywxFeeAccountStaff" id="TabHaobanQywxFeeAccountStaffMap"> <resultMap type="com.gic.haoban.manage.service.entity.fee.TabHaobanQywxFeeAccountStaff" id="TabHaobanQywxFeeAccountStaffMap">
<result property="feeAccountStaffId" column="fee_account_staff_id" jdbcType="INTEGER"/> <result property="feeAccountStaffId" column="fee_account_staff_id" jdbcType="INTEGER"/>
<result property="orderId" column="order_id" jdbcType="VARCHAR"/>
<result property="corpId" column="corp_id" jdbcType="VARCHAR"/> <result property="corpId" column="corp_id" jdbcType="VARCHAR"/>
<result property="wxEnterpriseId" column="wx_enterprise_id" jdbcType="VARCHAR"/> <result property="wxEnterpriseId" column="wx_enterprise_id" jdbcType="VARCHAR"/>
<result property="staffId" column="staff_id" jdbcType="VARCHAR"/> <result property="wxUserId" column="wx_user_id" jdbcType="VARCHAR"/>
<result property="activeCode" column="active_code" jdbcType="VARCHAR"/> <result property="activeCode" column="active_code" jdbcType="VARCHAR"/>
<result property="accountType" column="account_type" jdbcType="INTEGER"/> <result property="accountType" column="account_type" jdbcType="INTEGER"/>
<result property="expireTime" column="expire_time" jdbcType="TIMESTAMP"/> <result property="expireTime" column="expire_time" jdbcType="TIMESTAMP"/>
...@@ -16,93 +15,35 @@ ...@@ -16,93 +15,35 @@
<sql id="Base_Column_List"> <sql id="Base_Column_List">
fee_account_staff_id fee_account_staff_id
, order_id, corp_id, wx_enterprise_id, staff_id, active_code, account_type, expire_time, active_time , corp_id, wx_enterprise_id, wx_user_id, active_code, account_type, expire_time, active_time
</sql> </sql>
<!--查询单个--> <!--查询单个-->
<select id="queryById" resultMap="TabHaobanQywxFeeAccountStaffMap"> <select id="selectByActiveCode" resultMap="TabHaobanQywxFeeAccountStaffMap">
select select
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
from tab_haoban_qywx_fee_account_staff from tab_haoban_qywx_fee_account_staff
where fee_account_id = #{feeAccountId} where wx_enterprise_id = #{wxEnterpriseId} and active_code = #{activeCode}
</select> </select>
<!--查询指定行数据-->
<select id="queryAllByLimit" resultMap="TabHaobanQywxFeeAccountStaffMap">
select
<include refid="Base_Column_List"/>
from tab_haoban_qywx_fee_account_staff
<where>
<if test="feeAccountId != null">
and fee_account_id = #{feeAccountId}
</if>
<if test="orderId != null and orderId != ''">
and order_id = #{orderId}
</if>
<if test="corpId != null and corpId != ''">
and corp_id = #{corpId}
</if>
<if test="wxEnterpriseId != null and wxEnterpriseId != ''">
and wx_enterprise_id = #{wxEnterpriseId}
</if>
<if test="wxUserId != null and wxUserId != ''">
and wx_user_id = #{wxUserId}
</if>
<if test="staffId != null and staffId != ''">
and staff_id = #{staffId}
</if>
<if test="activeCode != null and activeCode != ''">
and active_code = #{activeCode}
</if>
<if test="accountType != null">
and account_type = #{accountType}
</if>
<if test="expireTime != null">
and expire_time = #{expireTime}
</if>
<if test="activeTime != null">
and active_time = #{activeTime}
</if>
</where>
limit #{pageable.offset}, #{pageable.pageSize}
</select>
<!--新增所有列--> <!--新增所有列-->
<insert id="insert" keyProperty="feeAccountId" useGeneratedKeys="true"> <insert id="insert">
insert into tab_haoban_qywx_fee_account_staff(fee_account_staff_id, order_id, corp_id, wx_enterprise_id, insert into tab_haoban_qywx_fee_account_staff(fee_account_staff_id, corp_id, wx_enterprise_id,
staff_id, active_code, account_type, expire_time, active_time) wx_user_id, active_code, account_type, expire_time, active_time)
values (#{feeAccountStaffId}, #{orderId}, #{corpId}, #{wxEnterpriseId}, #{staffId}, #{activeCode}, values (#{feeAccountStaffId}, #{corpId}, #{wxEnterpriseId}, #{wxUserId}, #{activeCode},
#{accountType}, #{expireTime}, #{activeTime}) #{accountType}, #{expireTime}, #{activeTime})
</insert> </insert>
<insert id="insertBatch" keyProperty="feeAccountId" useGeneratedKeys="true">
insert into tab_haoban_qywx_fee_account_staff(fee_account_staff_id, order_id, corp_id, wx_enterprise_id,
staff_id, active_code, account_type, expire_time, active_time)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.feeAccountStaffId}, #{entity.orderId}, #{entity.corpId}, #{entity.wxEnterpriseId},
#{entity.staffId}, #{entity.activeCode}, #{entity.accountType}, #{entity.expireTime}, #{entity.activeTime})
</foreach>
</insert>
<!--通过主键修改数据--> <!--通过主键修改数据-->
<update id="update"> <update id="update">
update tab_haoban_qywx_fee_account_staff update tab_haoban_qywx_fee_account_staff
<set> <set>
<if test="orderId != null and orderId != ''">
order_id = #{orderId},
</if>
<if test="corpId != null and corpId != ''"> <if test="corpId != null and corpId != ''">
corp_id = #{corpId}, corp_id = #{corpId},
</if> </if>
<if test="wxEnterpriseId != null and wxEnterpriseId != ''"> <if test="wxEnterpriseId != null and wxEnterpriseId != ''">
wx_enterprise_id = #{wxEnterpriseId}, wx_enterprise_id = #{wxEnterpriseId},
</if> </if>
<if test="staffId != null and staffId != ''">
staff_id = #{staffId},
</if>
<if test="activeCode != null and activeCode != ''"> <if test="activeCode != null and activeCode != ''">
active_code = #{activeCode}, active_code = #{activeCode},
</if> </if>
...@@ -116,20 +57,12 @@ ...@@ -116,20 +57,12 @@
active_time = #{activeTime}, active_time = #{activeTime},
</if> </if>
</set> </set>
where fee_account_id = #{feeAccountStaffId} where fee_account_staff_id = #{feeAccountStaffId}
</update> </update>
<!--通过主键删除-->
<delete id="deleteById">
delete
from tab_haoban_qywx_fee_account_staff
where fee_account_staff_id = #{feeAccountId}
</delete>
<select id="feeDetail" resultType="com.gic.haoban.manage.api.dto.fee.HaobanQywxFeeDetailDTO"> <select id="feeDetail" resultType="com.gic.haoban.manage.api.dto.fee.HaobanQywxFeeDetailDTO">
select select
count(distinct staff_id) interceptUserNum, count(distinct wx_user_id) interceptUserNum,
DATE_FORMAT( expire_time, '%Y-%m-%d' ) interceptTime DATE_FORMAT( expire_time, '%Y-%m-%d' ) interceptTime
from tab_haoban_qywx_fee_account_staff from tab_haoban_qywx_fee_account_staff
where wx_enterprise_id = #{wxEnterpriseId} where wx_enterprise_id = #{wxEnterpriseId}
...@@ -144,15 +77,19 @@ ...@@ -144,15 +77,19 @@
from tab_haoban_qywx_fee_account_staff from tab_haoban_qywx_fee_account_staff
where wx_enterprise_id = #{wxEnterpriseId} where wx_enterprise_id = #{wxEnterpriseId}
and expire_time between DATE(CURDATE()) and DATE_add(CURDATE(), INTERVAL 30 DAY) and expire_time between DATE(CURDATE()) and DATE_add(CURDATE(), INTERVAL 30 DAY)
order by expire_time desc limit 1 order by expire_time asc limit 1
</select> </select>
<select id="lastFeeInterceptCount" resultType="java.lang.Integer"> <select id="lastFeeInterceptCount" resultType="java.lang.Integer">
select select
count(distinct staff_id) count(distinct wx_user_id)
from tab_haoban_qywx_fee_account_staff from tab_haoban_qywx_fee_account_staff
where wx_enterprise_id = #{wxEnterpriseId} where wx_enterprise_id = #{wxEnterpriseId}
and expire_time between DATE(CURDATE()) and DATE_add(CURDATE(), INTERVAL 30 DAY) and expire_time between DATE(CURDATE()) and DATE_add(CURDATE(), INTERVAL 30 DAY)
</select> </select>
<delete id="deleteAll">
delete from tab_haoban_qywx_fee_account_staff where wx_enterprise_id = #{wxEnterpriseId}
</delete>
</mapper> </mapper>
...@@ -38,6 +38,9 @@ ...@@ -38,6 +38,9 @@
<!--查询指定行数据--> <!--查询指定行数据-->
<select id="listPage" resultMap="TabHaobanQywxFeeMap"> <select id="listPage" resultMap="TabHaobanQywxFeeMap">
<if test="interceptFlag != null and interceptFlag == 0">
select <include refid="Base_Column_List"/> from (
</if>
select select
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
from tab_haoban_qywx_fee from tab_haoban_qywx_fee
...@@ -60,8 +63,8 @@ ...@@ -60,8 +63,8 @@
<choose> <choose>
<when test="interceptFlag != null and interceptFlag == 0"> <when test="interceptFlag != null and interceptFlag == 0">
and intercept_time between DATE(CURDATE()) and DATE_add(CURDATE(), INTERVAL 30 DAY) and intercept_time between DATE(CURDATE()) and DATE_add(CURDATE(), INTERVAL 30 DAY)
order by intercept_time asc ) t
GROUP BY wx_enterprise_id GROUP BY wx_enterprise_id
order by intercept_time asc
</when> </when>
<otherwise> <otherwise>
order by intercept_time desc order by intercept_time desc
......
...@@ -21,73 +21,21 @@ ...@@ -21,73 +21,21 @@
</sql> </sql>
<!--查询单个--> <!--查询单个-->
<select id="queryById" resultMap="TabHaobanQywxFeeOrderAccountMap"> <select id="selectByOrderIdAndCode" resultMap="TabHaobanQywxFeeOrderAccountMap">
select select
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
from tab_haoban_qywx_fee_order_account from tab_haoban_qywx_fee_order_account
where fee_account_id = #{feeAccountId} where order_id = #{orderId} and active_code = #{activeCode} and wx_enterprise_id = #{wxEnterpriseId}
</select>
<!--查询指定行数据-->
<select id="queryAllByLimit" resultMap="TabHaobanQywxFeeOrderAccountMap">
select
<include refid="Base_Column_List"/>
from tab_haoban_qywx_fee_order_account
<where>
<if test="feeAccountId != null">
and fee_account_id = #{feeAccountId}
</if>
<if test="orderId != null and orderId != ''">
and order_id = #{orderId}
</if>
<if test="corpId != null and corpId != ''">
and corp_id = #{corpId}
</if>
<if test="wxEnterpriseId != null and wxEnterpriseId != ''">
and wx_enterprise_id = #{wxEnterpriseId}
</if>
<if test="wxUserId != null and wxUserId != ''">
and wx_user_id = #{wxUserId}
</if>
<if test="activeCode != null and activeCode != ''">
and active_code = #{activeCode}
</if>
<if test="accountType != null">
and account_type = #{accountType}
</if>
<if test="status != null">
and status = #{status}
</if>
<if test="expireTime != null">
and expire_time = #{expireTime}
</if>
<if test="activeTime != null">
and active_time = #{activeTime}
</if>
</where>
limit #{pageable.offset}, #{pageable.pageSize}
</select> </select>
<!--新增所有列--> <!--新增所有列-->
<insert id="insert" keyProperty="feeAccountId" useGeneratedKeys="true"> <insert id="insert">
insert into tab_haoban_qywx_fee_order_account(fee_account_id, order_id, corp_id, wx_enterprise_id, wx_user_id, insert into tab_haoban_qywx_fee_order_account(fee_account_id, order_id, corp_id, wx_enterprise_id, wx_user_id,
active_code, account_type, status, expire_time, active_time) active_code, account_type, status, expire_time, active_time)
values (#{feeAccountId}, #{orderId}, #{corpId}, #{wxEnterpriseId}, #{wxUserId}, #{activeCode}, #{accountType}, values (#{feeAccountId}, #{orderId}, #{corpId}, #{wxEnterpriseId}, #{wxUserId}, #{activeCode}, #{accountType},
#{status}, #{expireTime}, #{activeTime}) #{status}, #{expireTime}, #{activeTime})
</insert> </insert>
<insert id="insertBatch" keyProperty="feeAccountId" useGeneratedKeys="true">
insert into tab_haoban_qywx_fee_order_account(fee_account_id, order_id, corp_id, wx_enterprise_id, wx_user_id,
active_code, account_type, status, expire_time, active_time)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.feeAccountId}, #{entity.orderId}, #{entity.corpId}, #{entity.wxEnterpriseId}, #{entity.wxUserId},
#{entity.activeCode}, #{entity.accountType}, #{entity.status}, #{entity.expireTime}, #{entity.activeTime})
</foreach>
</insert>
<!--通过主键修改数据--> <!--通过主键修改数据-->
<update id="update"> <update id="update">
update tab_haoban_qywx_fee_order_account update tab_haoban_qywx_fee_order_account
...@@ -123,14 +71,6 @@ ...@@ -123,14 +71,6 @@
where fee_account_id = #{feeAccountId} where fee_account_id = #{feeAccountId}
</update> </update>
<!--通过主键删除-->
<delete id="deleteById">
delete
from tab_haoban_qywx_fee_order_account
where fee_account_id = #{feeAccountId}
</delete>
<select id="countOrderAccountStatus" resultType="java.lang.Integer"> <select id="countOrderAccountStatus" resultType="java.lang.Integer">
select select
count(*) count(*)
......
...@@ -23,60 +23,13 @@ ...@@ -23,60 +23,13 @@
</sql> </sql>
<!--查询单个--> <!--查询单个-->
<select id="queryById" resultMap="TabHaobanQywxFeeOrderMap"> <select id="selectByOrderId" resultMap="TabHaobanQywxFeeOrderMap">
select select
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
from tab_haoban_qywx_fee_order from tab_haoban_qywx_fee_order
where fee_order_id = #{feeOrderId} where wx_enterprise_id = #{wxEnterpriseId} and order_id = #{orderId}
</select> </select>
<!--查询指定行数据-->
<select id="queryAllByLimit" resultMap="TabHaobanQywxFeeOrderMap">
select
<include refid="Base_Column_List"/>
from tab_haoban_qywx_fee_order
<where>
<if test="feeOrderId != null">
and fee_order_id = #{feeOrderId}
</if>
<if test="orderId != null and orderId != ''">
and order_id = #{orderId}
</if>
<if test="corpId != null and corpId != ''">
and corp_id = #{corpId}
</if>
<if test="wxEnterpriseId != null and wxEnterpriseId != ''">
and wx_enterprise_id = #{wxEnterpriseId}
</if>
<if test="orderType != null">
and order_type = #{orderType}
</if>
<if test="orderStatus != null">
and order_status = #{orderStatus}
</if>
<if test="price != null">
and price = #{price}
</if>
<if test="baseCount != null">
and base_count = #{baseCount}
</if>
<if test="externalContactCount != null">
and external_contact_count = #{externalContactCount}
</if>
<if test="months != null">
and months = #{months}
</if>
<if test="createTime != null">
and create_time = #{createTime}
</if>
<if test="payTime != null">
and pay_time = #{payTime}
</if>
</where>
limit #{pageable.offset}, #{pageable.pageSize}
</select>
<!--新增所有列--> <!--新增所有列-->
<insert id="insert" keyProperty="feeOrderId" useGeneratedKeys="true"> <insert id="insert" keyProperty="feeOrderId" useGeneratedKeys="true">
insert into tab_haoban_qywx_fee_order(fee_order_id, order_id, corp_id, wx_enterprise_id, order_type, insert into tab_haoban_qywx_fee_order(fee_order_id, order_id, corp_id, wx_enterprise_id, order_type,
...@@ -86,66 +39,6 @@ ...@@ -86,66 +39,6 @@
#{baseCount}, #{externalContactCount}, #{months}, #{createTime}, #{payTime}) #{baseCount}, #{externalContactCount}, #{months}, #{createTime}, #{payTime})
</insert> </insert>
<insert id="insertBatch" keyProperty="feeOrderId" useGeneratedKeys="true">
insert into tab_haoban_qywx_fee_order(fee_order_id, order_id, corp_id, wx_enterprise_id, order_type,
order_status, price, base_count, external_contact_count, months, create_time, pay_time)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.feeOrderId}, #{entity.orderId}, #{entity.corpId}, #{entity.wxEnterpriseId}, #{entity.orderType},
#{entity.orderStatus}, #{entity.price}, #{entity.baseCount}, #{entity.externalContactCount},
#{entity.months}, #{entity.createTime}, #{entity.payTime})
</foreach>
</insert>
<!--通过主键修改数据-->
<update id="update">
update tab_haoban_qywx_fee_order
<set>
<if test="orderId != null and orderId != ''">
order_id = #{orderId},
</if>
<if test="corpId != null and corpId != ''">
corp_id = #{corpId},
</if>
<if test="wxEnterpriseId != null and wxEnterpriseId != ''">
wx_enterprise_id = #{wxEnterpriseId},
</if>
<if test="orderType != null">
order_type = #{orderType},
</if>
<if test="orderStatus != null">
order_status = #{orderStatus},
</if>
<if test="price != null">
price = #{price},
</if>
<if test="baseCount != null">
base_count = #{baseCount},
</if>
<if test="externalContactCount != null">
external_contact_count = #{externalContactCount},
</if>
<if test="months != null">
months = #{months},
</if>
<if test="createTime != null">
create_time = #{createTime},
</if>
<if test="payTime != null">
pay_time = #{payTime},
</if>
</set>
where fee_order_id = #{feeOrderId}
</update>
<!--通过主键删除-->
<delete id="deleteById">
delete
from tab_haoban_qywx_fee_order
where fee_order_id = #{feeOrderId}
</delete>
<select id="countExternalContactCount" resultType="java.lang.Integer"> <select id="countExternalContactCount" resultType="java.lang.Integer">
select sum(external_contact_count) select sum(external_contact_count)
from tab_haoban_qywx_fee_order from tab_haoban_qywx_fee_order
......
...@@ -45,6 +45,9 @@ public class ServiceTest { ...@@ -45,6 +45,9 @@ public class ServiceTest {
@Autowired @Autowired
private Config config; private Config config;
@Autowired
private StaffApiService staffApiService;
@Test @Test
public void test() { public void test() {
...@@ -69,4 +72,9 @@ public class ServiceTest { ...@@ -69,4 +72,9 @@ public class ServiceTest {
String autoActiveStatus = qywxUserApiService.getAutoActiveStatus("wp59NLDQAAJL6DsM6YwOGqJlhCBykkeA", config.getCorpid()); String autoActiveStatus = qywxUserApiService.getAutoActiveStatus("wp59NLDQAAJL6DsM6YwOGqJlhCBykkeA", config.getCorpid());
System.out.println(autoActiveStatus); System.out.println(autoActiveStatus);
} }
@Test
public void test5(){
int qrCodeByStaffId = staffApiService.getQrCodeByStaffId("00af1fe7e75644a7accdcb84e126e50c");
System.out.println("111111111111111111111111111111111"+qrCodeByStaffId);
}
} }
...@@ -79,6 +79,11 @@ public class TestController extends WebBaseController { ...@@ -79,6 +79,11 @@ public class TestController extends WebBaseController {
private QwFriendApiService qwFriendApiService ; private QwFriendApiService qwFriendApiService ;
@RequestMapping("/qwcode")
public HaobanResponse qwcode(String enterpriseId, String unionid,String openid,String wxaUnionid ,String code) {
return this.resultResponse(HaoBanErrCode.ERR_0,code);
}
@RequestMapping("/pending-check") @RequestMapping("/pending-check")
public HaobanResponse pendingChec(String enterpriseId, String unionid,String openid,String wxaUnionid ,String wxaOpenid) { public HaobanResponse pendingChec(String enterpriseId, String unionid,String openid,String wxaUnionid ,String wxaOpenid) {
return this.resultResponse(HaoBanErrCode.ERR_0,this.qwFriendApiService.pendingIdCheck(enterpriseId, unionid, openid, wxaUnionid,wxaOpenid)); return this.resultResponse(HaoBanErrCode.ERR_0,this.qwFriendApiService.pendingIdCheck(enterpriseId, unionid, openid, wxaUnionid,wxaOpenid));
...@@ -384,6 +389,19 @@ public class TestController extends WebBaseController { ...@@ -384,6 +389,19 @@ public class TestController extends WebBaseController {
return resultResponse(HaoBanErrCode.ERR_0, map) ; return resultResponse(HaoBanErrCode.ERR_0, map) ;
} }
@RequestMapping("test-qw-post-suite")
public HaobanResponse testQwPostSuite(String url , String corpid , String json) {
if(isProd()) {
return null ;
}
String token = qywxCorpApiService.getSuiteAccessToken(config.getWxSuiteid()) ;
logger.info("toekn={},corpId={} , url={} , json={}",token, corpid ,(url + token) , json);
Map<String, Object> map = HttpClient.getWinxinResByJson(url + token ,json);
return resultResponse(HaoBanErrCode.ERR_0, map) ;
}
@RequestMapping("test-qw-token") @RequestMapping("test-qw-token")
public HaobanResponse testQwPost3(String corpid , String secret) { public HaobanResponse testQwPost3(String corpid , String secret) {
if(StringUtils.isBlank(secret)) { if(StringUtils.isBlank(secret)) {
...@@ -406,6 +424,18 @@ public class TestController extends WebBaseController { ...@@ -406,6 +424,18 @@ public class TestController extends WebBaseController {
return resultResponse(HaoBanErrCode.ERR_0, map) ; return resultResponse(HaoBanErrCode.ERR_0, map) ;
} }
@RequestMapping("test-qw-get-suite")
public HaobanResponse testQwGetSuite(String url , String corpid) {
if(isProd()) {
return null ;
}
String token = qywxCorpApiService.getSuiteAccessToken(config.getWxSuiteid()) ;
logger.info("toekn={},appid={} , url={} , json={}",token,corpid ,(url + token));
Map<String, Object> map = HttpClient.getHttpByGet(url + token);
return resultResponse(HaoBanErrCode.ERR_0, map) ;
}
@RequestMapping("test-qw-post-dk") @RequestMapping("test-qw-post-dk")
public HaobanResponse testQwPostdk(String url , String corpid , String secret, String json) { public HaobanResponse testQwPostdk(String url , String corpid , String secret, String json) {
if(isProd()) { if(isProd()) {
......
...@@ -643,7 +643,11 @@ public class WxEnterpriseInfoController extends WebBaseController { ...@@ -643,7 +643,11 @@ public class WxEnterpriseInfoController extends WebBaseController {
memberSendMessageVo.setSelfExteralUserId(externalUserid); memberSendMessageVo.setSelfExteralUserId(externalUserid);
memberSendMessageVo.setTitle(settingDTO.getTitle()); memberSendMessageVo.setTitle(settingDTO.getTitle());
memberSendMessageVo.setWxaHandUrl(enterpriseDTO.getMallMiniprogramLogoUrl()); memberSendMessageVo.setWxaHandUrl(enterpriseDTO.getMallMiniprogramLogoUrl());
memberSendMessageVo.setBindFlag(clerkRelatedDTO.getStatusFlag() == 1 ? 1 : 0); int bindFlag = 0 ;
if(clerkRelatedDTO.getStatusFlag()==1 && StringUtils.isNotBlank(clerkRelatedDTO.getMemberId())) {
bindFlag = 1 ;
}
memberSendMessageVo.setBindFlag(bindFlag);
memberSendMessageVo.setWxaName(settingDTO.getMiniprogramName()); memberSendMessageVo.setWxaName(settingDTO.getMiniprogramName());
return resultResponse(HaoBanErrCode.ERR_1, memberSendMessageVo); return resultResponse(HaoBanErrCode.ERR_1, memberSendMessageVo);
} }
......
package com.gic.haoban.manage.web.controller; package com.gic.haoban.manage.web.controller;
import java.util.ArrayList; import cn.hutool.core.collection.CollectionUtil;
import java.util.Arrays; import cn.hutool.core.convert.Convert;
import java.util.Collections;
import java.util.Comparator;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
import java.util.TreeSet;
import java.util.stream.Collectors;
import javax.validation.Valid;
import org.apache.commons.collections.CollectionUtils;
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.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.gic.api.base.commons.Page; import com.gic.api.base.commons.Page;
...@@ -53,59 +29,32 @@ import com.gic.haoban.common.anno.IgnoreLogin; ...@@ -53,59 +29,32 @@ import com.gic.haoban.common.anno.IgnoreLogin;
import com.gic.haoban.common.utils.GooglePhoneNumberUtil; import com.gic.haoban.common.utils.GooglePhoneNumberUtil;
import com.gic.haoban.common.utils.HaobanResponse; import com.gic.haoban.common.utils.HaobanResponse;
import com.gic.haoban.common.utils.PageUtil; import com.gic.haoban.common.utils.PageUtil;
import com.gic.haoban.manage.api.dto.AuditDTO; import com.gic.haoban.manage.api.dto.*;
import com.gic.haoban.manage.api.dto.AuditSettingDTO;
import com.gic.haoban.manage.api.dto.ClerkMainStoreRelatedDTO;
import com.gic.haoban.manage.api.dto.EnterpriseDetailDTO;
import com.gic.haoban.manage.api.dto.ExternalClerkRelatedDTO;
import com.gic.haoban.manage.api.dto.StaffClerkInfoDTO;
import com.gic.haoban.manage.api.dto.StaffClerkRelationDTO;
import com.gic.haoban.manage.api.dto.StaffDTO;
import com.gic.haoban.manage.api.dto.WxEnterpriseDTO;
import com.gic.haoban.manage.api.dto.WxEnterpriseQwDTO;
import com.gic.haoban.manage.api.dto.WxEnterpriseRelationDetailDTO;
import com.gic.haoban.manage.api.dto.role.HaobanRoleDTO; import com.gic.haoban.manage.api.dto.role.HaobanRoleDTO;
import com.gic.haoban.manage.api.dto.role.StoreRoleDTO; import com.gic.haoban.manage.api.dto.role.StoreRoleDTO;
import com.gic.haoban.manage.api.enums.AuditStatus; import com.gic.haoban.manage.api.enums.*;
import com.gic.haoban.manage.api.enums.AuditType;
import com.gic.haoban.manage.api.enums.ChannelCodeEnum;
import com.gic.haoban.manage.api.enums.NoticeMessageTypeEnum;
import com.gic.haoban.manage.api.enums.SyncTaskTypeEnum;
import com.gic.haoban.manage.api.enums.role.RoleClerkTypeEnum; import com.gic.haoban.manage.api.enums.role.RoleClerkTypeEnum;
import com.gic.haoban.manage.api.service.AuditApiService; import com.gic.haoban.manage.api.service.*;
import com.gic.haoban.manage.api.service.AuditSettingApiService;
import com.gic.haoban.manage.api.service.ClerkMainStoreRelatedApiService;
import com.gic.haoban.manage.api.service.DealSyncOperationApiService;
import com.gic.haoban.manage.api.service.ExternalClerkRelatedApiService;
import com.gic.haoban.manage.api.service.StaffApiService;
import com.gic.haoban.manage.api.service.StaffClerkRelationApiService;
import com.gic.haoban.manage.api.service.StaffDepartmentRelatedApiService;
import com.gic.haoban.manage.api.service.SyncHaobanToGicApiService;
import com.gic.haoban.manage.api.service.WxEnterpriseApiService;
import com.gic.haoban.manage.api.service.WxEnterpriseRelatedApiService;
import com.gic.haoban.manage.api.service.role.HaobanRoleApiService; import com.gic.haoban.manage.api.service.role.HaobanRoleApiService;
import com.gic.haoban.manage.api.util.notify.NoticeMessageUtil; import com.gic.haoban.manage.api.util.notify.NoticeMessageUtil;
import com.gic.haoban.manage.web.config.Config; import com.gic.haoban.manage.web.config.Config;
import com.gic.haoban.manage.web.errCode.HaoBanErrCode; import com.gic.haoban.manage.web.errCode.HaoBanErrCode;
import com.gic.haoban.manage.web.qo.CommonQO; import com.gic.haoban.manage.web.qo.CommonQO;
import com.gic.haoban.manage.web.vo.AuditSettingVO; import com.gic.haoban.manage.web.vo.*;
import com.gic.haoban.manage.web.vo.BindClerkVO;
import com.gic.haoban.manage.web.vo.ClerkDetailVo;
import com.gic.haoban.manage.web.vo.ClerkEditInfoVO;
import com.gic.haoban.manage.web.vo.ClerkListVO;
import com.gic.haoban.manage.web.vo.ClerkStoreVO;
import com.gic.haoban.manage.web.vo.OperationSettingVO;
import com.gic.haoban.manage.web.vo.StaffStoreVO;
import com.gic.haoban.manage.web.vo.StaffVO;
import com.gic.haoban.manage.web.vo.StoreClerkVO;
import com.gic.haoban.manage.web.vo.StoreListVO;
import com.gic.haoban.manage.web.vo.StoreRoleVO;
import com.gic.haoban.manage.web.vo.notify.CustomerFriendMemberVO; import com.gic.haoban.manage.web.vo.notify.CustomerFriendMemberVO;
import com.gic.redis.data.util.RedisUtil; import com.gic.redis.data.util.RedisUtil;
import com.gic.wechat.api.service.qywx.QywxCorpApiService;
import com.gic.wechat.api.service.qywx.QywxUserApiService; import com.gic.wechat.api.service.qywx.QywxUserApiService;
import org.apache.commons.collections.CollectionUtils;
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.bind.annotation.*;
import cn.hutool.core.collection.CollectionUtil; import javax.validation.Valid;
import cn.hutool.core.convert.Convert; import java.util.*;
import java.util.stream.Collectors;
@RestController @RestController
public class WxStaffController extends WebBaseController { public class WxStaffController extends WebBaseController {
...@@ -1786,4 +1735,20 @@ public class WxStaffController extends WebBaseController { ...@@ -1786,4 +1735,20 @@ public class WxStaffController extends WebBaseController {
retPage.setResult(resultList); retPage.setResult(resultList);
return RestResponse.successResult(retPage); return RestResponse.successResult(retPage);
} }
/**
* 判断成员是否授权获取敏感信息
*/
@RequestMapping("get-sensitive-status")
public RestResponse<Object> getSensitiveStatus(String staffId){
int result = staffApiService.getSensitiveStatus(staffId);
return RestResponse.successResult(result) ;
}
@RequestMapping("update-qr-code")
public RestResponse<Object> updateQrCode(String staffId , String qrCode){
this.staffApiService.updateQrCodeByStaffId(staffId, qrCode) ;
return RestResponse.successResult() ;
}
} }
<!DOCTYPE html>
<html>
<meta charset="UTF-8">
<title></title>
<script type="text/javascript" src="js/jquery-1.12.3.min.js"></script>
<script type="text/javascript" src="js/jweixin-1.3.2.js"></script>
<script type="text/javascript">
//授权页面跳转
$(function(){
var returnUlr = "/pages/workbench/workbench";
console.log(returnUlr)
return wx.miniProgram.switchTab({
url : returnUlr
});
}) ;
</script>
</body>
</html>
\ No newline at end of file
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