Commit b9e8fdb1 by 墨竹

feat:企微收费

parent ff2dc2dd
......@@ -99,6 +99,7 @@ public class StaffDTO implements Serializable {
private String clerkName;
private String defaultGicEid;
private Integer addNum;
private Integer activeStatus;
public String getDefaultGicEid() {
return defaultGicEid;
......@@ -373,4 +374,12 @@ public class StaffDTO implements Serializable {
public void setAddNum(Integer addNum) {
this.addNum = addNum;
}
public Integer getActiveStatus() {
return activeStatus;
}
public void setActiveStatus(Integer activeStatus) {
this.activeStatus = activeStatus;
}
}
......@@ -104,6 +104,7 @@ public class WxEnterpriseDTO implements Serializable {
* 转换wx_userid状态:0:未转换;1:转换成功;2:转换中;3:转换失败
*/
private Integer useridFlag;
private Integer autoActiveFlag;
public String getMemberSecret() {
return memberSecret;
......@@ -448,4 +449,12 @@ public class WxEnterpriseDTO implements Serializable {
public void setUseridFlag(Integer useridFlag) {
this.useridFlag = useridFlag;
}
public Integer getAutoActiveFlag() {
return autoActiveFlag;
}
public void setAutoActiveFlag(Integer autoActiveFlag) {
this.autoActiveFlag = autoActiveFlag;
}
}
......@@ -8,5 +8,14 @@ package com.gic.haoban.manage.api.service.fee;
*/
public interface HaobanQywxFeeApiService {
/**
* 插入
* 定时任务
*
* @param param 参数
* @author mozhu
* @date 2022-08-03 17:28:56
*/
void insert(String param);
}
......@@ -198,6 +198,17 @@ public interface StaffMapper {
int updateAddNumById(@Param("staffId") String staffId);
/**
* 更新是否激活
*
* @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);
/**
* 重置添加num
*
* @return int
......
......@@ -72,4 +72,15 @@ public interface WxEnterpriseMapper {
int updateUseridFlagById(@Param("useridFlag") Integer useridFlag,
@Param("corpid") String corpid,
@Param("wxEnterpriseId") String wxEnterpriseId);
/**
* 更新是否开启自动激活
*
* @param autoActiveFlag
* @param wxEnterpriseId wx企业标识
* @return int
* @author mozhu
* @date 2022-08-03 17:27:13
*/
int updateAutoActiveFlagById(@Param("autoActiveFlag") Integer autoActiveFlag, @Param("wxEnterpriseId") String wxEnterpriseId);
}
\ No newline at end of file
......@@ -49,6 +49,7 @@ public class TabHaobanStaff implements Serializable {
private String wxOpenId;
private String qrCode;
private Integer addNum;
private Integer activeStatus;
@Transient
private String departmentIds;
......@@ -236,4 +237,12 @@ public class TabHaobanStaff implements Serializable {
public void setAddNum(Integer addNum) {
this.addNum = addNum;
}
public Integer getActiveStatus() {
return activeStatus;
}
public void setActiveStatus(Integer activeStatus) {
this.activeStatus = activeStatus;
}
}
\ No newline at end of file
......@@ -56,13 +56,13 @@ public class TabHaobanWxEnterprise implements Serializable {
private Integer bindFlag;
private Integer statusFlag;
private Integer contactFlag;
private String wxSecretKey;
private String memberSecret;
private String contactSecret;
private Date wxSecretKeyLastTime;
......@@ -87,7 +87,9 @@ public class TabHaobanWxEnterprise implements Serializable {
*/
private Integer externalFlag;
private Integer useridFlag;
private Integer wxSecurityType ;
private Integer wxSecurityType;
private Integer autoActiveFlag;
public Integer getWxSecurityType() {
return wxSecurityType;
......@@ -321,44 +323,44 @@ public class TabHaobanWxEnterprise implements Serializable {
this.updateTime = updateTime;
}
public Integer getContactFlag() {
return contactFlag;
}
public Integer getContactFlag() {
return contactFlag;
}
public void setContactFlag(Integer contactFlag) {
this.contactFlag = contactFlag;
}
public void setContactFlag(Integer contactFlag) {
this.contactFlag = contactFlag;
}
public String getWxSecretKey() {
return wxSecretKey;
}
public String getWxSecretKey() {
return wxSecretKey;
}
public void setWxSecretKey(String wxSecretKey) {
this.wxSecretKey = wxSecretKey;
}
public void setWxSecretKey(String wxSecretKey) {
this.wxSecretKey = wxSecretKey;
}
public String getContactSecret() {
return contactSecret;
}
public String getContactSecret() {
return contactSecret;
}
public void setContactSecret(String contactSecret) {
this.contactSecret = contactSecret;
}
public void setContactSecret(String contactSecret) {
this.contactSecret = contactSecret;
}
public Date getWxSecretKeyLastTime() {
return wxSecretKeyLastTime;
}
public Date getWxSecretKeyLastTime() {
return wxSecretKeyLastTime;
}
public void setWxSecretKeyLastTime(Date wxSecretKeyLastTime) {
this.wxSecretKeyLastTime = wxSecretKeyLastTime;
}
public void setWxSecretKeyLastTime(Date wxSecretKeyLastTime) {
this.wxSecretKeyLastTime = wxSecretKeyLastTime;
}
public Date getContactSecretLastTime() {
return contactSecretLastTime;
}
public Date getContactSecretLastTime() {
return contactSecretLastTime;
}
public void setContactSecretLastTime(Date contactSecretLastTime) {
this.contactSecretLastTime = contactSecretLastTime;
public void setContactSecretLastTime(Date contactSecretLastTime) {
this.contactSecretLastTime = contactSecretLastTime;
}
public Date getMemberSecretLastTime() {
......@@ -400,4 +402,12 @@ public class TabHaobanWxEnterprise implements Serializable {
public void setUseridFlag(Integer useridFlag) {
this.useridFlag = useridFlag;
}
public Integer getAutoActiveFlag() {
return autoActiveFlag;
}
public void setAutoActiveFlag(Integer autoActiveFlag) {
this.autoActiveFlag = autoActiveFlag;
}
}
\ No newline at end of file
package com.gic.haoban.manage.service.service;
import java.util.List;
import com.gic.haoban.manage.api.dto.WxEnterpriseDTO;
import com.gic.haoban.manage.api.dto.WxEnterpriseQwDTO;
import com.gic.haoban.manage.service.entity.TabHaobanWxEnterprise;
import java.util.List;
public interface WxEnterpriseService {
String add(WxEnterpriseDTO wxDTO);
......@@ -68,7 +68,18 @@ public interface WxEnterpriseService {
* @date 2022-06-30 18:49:31
*/
int updateUseridFlagById(Integer useridFlag, String corpid, String wxEnterpriseId);
/**
* 更新是否开启自动激活
*
* @param autoActiveFlag
* @param wxEnterpriseId wx企业标识
* @return int
* @author mozhu
* @date 2022-08-03 17:28:01
*/
int updateAutoActiveFlagById(Integer autoActiveFlag, String wxEnterpriseId);
void stopHaoban(String enterpriseId);
}
package com.gic.haoban.manage.service.service.impl;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.LogManager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.alibaba.fastjson.JSON;
import com.gic.commons.util.EntityUtil;
import com.gic.haoban.common.utils.DingUtils;
......@@ -25,6 +13,13 @@ import com.gic.haoban.manage.service.entity.TabHaobanWxApplication;
import com.gic.haoban.manage.service.entity.TabHaobanWxEnterprise;
import com.gic.haoban.manage.service.entity.TabHaobanWxEnterpriseRelated;
import com.gic.haoban.manage.service.service.WxEnterpriseService;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.LogManager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.*;
@Service
public class WxEnterpriseServiceImpl implements WxEnterpriseService {
......@@ -173,7 +168,12 @@ public class WxEnterpriseServiceImpl implements WxEnterpriseService {
}
}
}
@Override
public int updateAutoActiveFlagById(Integer autoActiveFlag, String wxEnterpriseId) {
return mapper.updateAutoActiveFlagById(autoActiveFlag,wxEnterpriseId);
}
private void alert(String title, Map<String, Object> map) {
String msg = title + JSON.toJSONString(map);
String dingUrl = "https://oapi.dingtalk.com/robot/send?access_token=c38fdc53d26e9a019640755bdada1ce07ebd44a2555d1c8acc299de7a7b5b857";
......
package com.gic.haoban.manage.service.service.out.impl.fee;
import com.gic.haoban.manage.api.service.fee.HaobanQywxFeeApiService;
import com.gic.haoban.manage.service.config.Config;
import com.gic.haoban.manage.service.entity.TabHaobanWxEnterprise;
import com.gic.haoban.manage.service.service.WxEnterpriseService;
import com.gic.haoban.manage.service.service.fee.HaobanQywxFeeAccountStaffService;
import com.gic.haoban.manage.service.service.fee.HaobanQywxFeeOrderAccountService;
import com.gic.haoban.manage.service.service.fee.HaobanQywxFeeOrderService;
import com.gic.haoban.manage.service.service.fee.HaobanQywxFeeService;
import com.gic.wechat.api.service.qywx.QywxUserApiService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service
import java.util.List;
@Service("haobanQywxFeeApiService")
public class HaobanQywxFeeApiServiceImpl implements HaobanQywxFeeApiService {
private static Logger logger = LoggerFactory.getLogger(HaobanQywxFeeApiServiceImpl.class);
@Autowired
private HaobanQywxFeeService haobanQywxFeeService;
@Autowired
private HaobanQywxFeeOrderService haobanQywxFeeOrderService;
@Autowired
private HaobanQywxFeeOrderAccountService haobanQywxFeeOrderAccountService;
@Autowired
private HaobanQywxFeeAccountStaffService haobanQywxFeeAccountStaffService;
@Autowired
private QywxUserApiService qywxUserApiService;
@Autowired
private Config config;
@Autowired
private WxEnterpriseService wxEnterpriseService;
@Override
public void insert(String param) {
List<TabHaobanWxEnterprise> tabHaobanWxEnterprises = wxEnterpriseService.listAll();
String serviceCorpid = config.getCorpid();
for (TabHaobanWxEnterprise tabHaobanWxEnterpris : tabHaobanWxEnterprises) {
String corpid = tabHaobanWxEnterpris.getCorpid();
String wxEnterpriseId = tabHaobanWxEnterpris.getWxEnterpriseId();
String autoActiveStatus = qywxUserApiService.getAutoActiveStatus(corpid, serviceCorpid);
if (!"1".equals(autoActiveStatus)) {
logger.info("未开启自动激活:{}",corpid);
wxEnterpriseService.updateAutoActiveFlagById(0,wxEnterpriseId);
continue;
}
wxEnterpriseService.updateAutoActiveFlagById(1,wxEnterpriseId);
}
}
}
......@@ -24,12 +24,13 @@
<result column="wx_open_id" property="wxOpenId" jdbcType="VARCHAR"/>
<result column="qr_code" property="qrCode" jdbcType="VARCHAR"/>
<result column="add_num" property="addNum" jdbcType="INTEGER"/>
<result column="active_status" property="activeStatus" jdbcType="INTEGER"/>
</resultMap>
<sql id="Base_Column_List">
staff_id, wx_user_id, phone_number, staff_name, nation_code, nick_name, sex, postion,
active_flag, extend_postion, status_flag, create_time, update_time,wx_enterprise_id,head_img,
sort,sync_postion_flag,super_manager_flag,wx_open_user_id,wx_open_id,qr_code,add_num
sort,sync_postion_flag,super_manager_flag,wx_open_user_id,wx_open_id,qr_code,add_num,active_status
</sql>
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String">
select
......@@ -526,6 +527,14 @@
</update>
<update id="updateActiveStatusById" >
update tab_haoban_staff
set active_status = #{activeStatus}
update_time = now()
where staff_id = #{staffId}
</update>
<update id="resetAddNum">
update tab_haoban_staff
<set>
......
......@@ -40,7 +40,8 @@
<result column="agree_external_userid_time" property="agreeExternalUseridTime" jdbcType="TIMESTAMP"/>
<result column="external_flag" property="externalFlag" jdbcType="INTEGER"/>
<result column="userid_flag" property="useridFlag" jdbcType="INTEGER"/>
<result column="wx_security_type" property="wxSecurityType"/>
<result column="wx_security_type" property="wxSecurityType" jdbcType="INTEGER"/>
<result column="auto_active_flag" property="autoActiveFlag" jdbcType="INTEGER"/>
</resultMap>
<sql id="Base_Column_List">
......@@ -48,7 +49,7 @@
corp_user_max, corp_full_name, subject_type, verified_end_time, corp_wxqrcode, corp_scale,
corp_industry, corp_sub_industry, location, auth_info, agent, agentid, appid, name,
square_logo_url, round_logo_url, level, bind_flag, status_flag, create_time, update_time,contact_flag,wx_secret_key,wx_secret_key_last_time,member_secret_last_time,contact_secret_last_time
,member_secret,contact_secret,agree_external_userid_flag,agree_external_userid_time,external_flag,userid_flag ,wx_security_type
,member_secret,contact_secret,agree_external_userid_flag,agree_external_userid_time,external_flag,userid_flag ,wx_security_type,auto_active_flag
</sql>
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String">
select
......@@ -433,13 +434,6 @@
order by create_time desc
</select>
<select id="listDelBycorpId" resultMap="BaseResultMap" parameterType="java.lang.String">
select
<include refid="Base_Column_List"/>
from tab_haoban_wx_enterprise
where status_flag = 0 and corpid= #{corpId}
</select>
<select id="listAll" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
......@@ -497,4 +491,12 @@
where wx_enterprise_id = #{wxEnterpriseId}
</update>
<update id="updateAutoActiveFlagById">
update tab_haoban_wx_enterprise
set auto_active_flag = #{autoActiveFlag},
update_time = now()
where wx_enterprise_id = #{wxEnterpriseId}
</update>
</mapper>
\ 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