Commit d1adb4e2 by songyinghui

Merge remote-tracking branch 'origin/master' into feature-content3

# Conflicts:
#	haoban-manage3-wx/src/main/webapp/WEB-INF/dubbo-haoban-manage-wx.xml
parents 27107935 2c475469
...@@ -69,6 +69,30 @@ public class SecretSettingDTO implements Serializable { ...@@ -69,6 +69,30 @@ public class SecretSettingDTO implements Serializable {
* *
*/ */
private Date updateTime; private Date updateTime;
/**
* 应用id
*/
private String agentId;
/**
* 应用名称
*/
private String agentName;
public String getAgentId() {
return agentId;
}
public void setAgentId(String agentId) {
this.agentId = agentId;
}
public String getAgentName() {
return agentName;
}
public void setAgentName(String agentName) {
this.agentName = agentName;
}
public String getSecretId() { public String getSecretId() {
return secretId; return secretId;
......
...@@ -46,6 +46,30 @@ public class StaffActiveDataDTO implements Serializable { ...@@ -46,6 +46,30 @@ public class StaffActiveDataDTO implements Serializable {
* 其他占用许可总数 * 其他占用许可总数
*/ */
private Integer occupy; private Integer occupy;
/**
* 已合并许可总数
*/
private Integer merged;
/**
* 即将过期的许可总数
*/
private Integer expiring;
public Integer getExpiring() {
return expiring;
}
public void setExpiring(Integer expiring) {
this.expiring = expiring;
}
public Integer getMerged() {
return merged;
}
public void setMerged(Integer merged) {
this.merged = merged;
}
public String getId() { public String getId() {
return id; return id;
......
...@@ -60,6 +60,30 @@ public class StaffListDTO implements Serializable { ...@@ -60,6 +60,30 @@ public class StaffListDTO implements Serializable {
* 部门id数组 * 部门id数组
*/ */
private List<String> departmentIds; private List<String> departmentIds;
/**
* 许可到期时间区间查询
*/
private String startTime;
/**
* 许可到期时间区间查询
*/
private String endTime;
public String getStartTime() {
return startTime;
}
public void setStartTime(String startTime) {
this.startTime = startTime;
}
public String getEndTime() {
return endTime;
}
public void setEndTime(String endTime) {
this.endTime = endTime;
}
public List<String> getDepartmentIds() { public List<String> getDepartmentIds() {
return departmentIds; return departmentIds;
......
...@@ -110,6 +110,66 @@ public class WxEnterpriseDTO implements Serializable { ...@@ -110,6 +110,66 @@ public class WxEnterpriseDTO implements Serializable {
private String openCorpid ; private String openCorpid ;
private String wxaAppid ; private String wxaAppid ;
private String urlHost ; private String urlHost ;
/**
* 应用类型,0第三方 1自建
*/
private Integer appType;
/**
* 应用id
*/
private String agentId;
/**
* 应用名称
*/
private String agentName;
/**
* secret
*/
private String secretVal;
/**
* 自建应用是否支持配置回调地址 0 不支持 1支持
*/
private Integer callbackFlag;
public Integer getCallbackFlag() {
return callbackFlag;
}
public void setCallbackFlag(Integer callbackFlag) {
this.callbackFlag = callbackFlag;
}
public String getAgentId() {
return agentId;
}
public void setAgentId(String agentId) {
this.agentId = agentId;
}
public String getAgentName() {
return agentName;
}
public void setAgentName(String agentName) {
this.agentName = agentName;
}
public String getSecretVal() {
return secretVal;
}
public void setSecretVal(String secretVal) {
this.secretVal = secretVal;
}
public Integer getAppType() {
return appType;
}
public void setAppType(Integer appType) {
this.appType = appType;
}
public String getUrlHost() { public String getUrlHost() {
return urlHost; return urlHost;
......
...@@ -41,6 +41,59 @@ public class YwWxEnterpriseDTO implements Serializable { ...@@ -41,6 +41,59 @@ public class YwWxEnterpriseDTO implements Serializable {
* 是否开启历史好友关联 true 开启 false 关闭 * 是否开启历史好友关联 true 开启 false 关闭
*/ */
private Boolean openMassFlag; private Boolean openMassFlag;
/**
* 企微加密类型1待开发+第三方(都是明文),2待开发+第三方(都是密文),3待开发(明文)+第三方v密文),4待开发(密文)+第三方(明文),5自建应用
*/
private Integer wxSecurityType;
/**
* 应用类型,0第三方 1自建
*/
private Integer appType;
/**
* 明文corpid
*/
private String wxCorpid ;
/**
* 加密corpid
*/
private String openCorpid ;
public String getWxCorpid() {
return wxCorpid;
}
public void setWxCorpid(String wxCorpid) {
this.wxCorpid = wxCorpid;
}
public String getOpenCorpid() {
return openCorpid;
}
public void setOpenCorpid(String openCorpid) {
this.openCorpid = openCorpid;
}
public Integer getWxSecurityType() {
return wxSecurityType;
}
public void setWxSecurityType(Integer wxSecurityType) {
this.wxSecurityType = wxSecurityType;
}
public Integer getAppType() {
if (null != this.wxSecurityType && this.wxSecurityType == 5){
this.appType = 1;
}else {
this.appType = 0;
}
return appType;
}
public void setAppType(Integer appType) {
this.appType = appType;
}
private List<EnterpriseDetailDTO> enList ; private List<EnterpriseDetailDTO> enList ;
......
package com.gic.haoban.manage.api.dto.licence;
import java.io.Serializable;
import java.util.Date;
/**
* <p>
*
* </p>
*
* @author jx
* @since 2023-03-09
*/
public class AppOrderCheckDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 弹窗类型 0 正常 1新购 2 续期
*/
private Integer type;
/**
* 已购买人数
*/
private Integer userNum;
/**
* 购买生效期的开始时间
*/
private Date beginTime;
/**
* 购买生效期的结束时间
*/
private Date endTime;
/**
* 合同到期天数
*/
private Integer contractDay;
/**
* 当前时间
*/
private Date now;
public Integer getType() {
return type;
}
public void setType(Integer type) {
this.type = type;
}
public Integer getUserNum() {
return userNum;
}
public void setUserNum(Integer userNum) {
this.userNum = userNum;
}
public Date getBeginTime() {
return beginTime;
}
public void setBeginTime(Date beginTime) {
this.beginTime = beginTime;
}
public Date getEndTime() {
return endTime;
}
public void setEndTime(Date endTime) {
this.endTime = endTime;
}
public Integer getContractDay() {
return contractDay;
}
public void setContractDay(Integer contractDay) {
this.contractDay = contractDay;
}
public Date getNow() {
return now;
}
public void setNow(Date now) {
this.now = now;
}
}
package com.gic.haoban.manage.api.dto.licence;
import java.io.Serializable;
import java.util.Date;
/**
* <p>
*
* </p>
*
* @author jx
* @since 2023-03-09
*/
public class AppOrderNoticeDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 弹窗类型 0 无需弹窗 1 未购买付费应用弹窗 2付费应用已过期弹窗 3 查询购买许可账号是否存在未支付订单
*/
private Integer type;
/**
* 是否支付 0否 1是
*/
private Integer payFlag;
/**
* 未支付订单id
*/
private String orderId;
/**
* 支付的url
*/
private String orderUrl;
/**
* 到期时间
*/
private Date endTime;
public Integer getType() {
return type;
}
public void setType(Integer type) {
this.type = type;
}
public Integer getPayFlag() {
return payFlag;
}
public void setPayFlag(Integer payFlag) {
this.payFlag = payFlag;
}
public String getOrderId() {
return orderId;
}
public void setOrderId(String orderId) {
this.orderId = orderId;
}
public String getOrderUrl() {
return orderUrl;
}
public void setOrderUrl(String orderUrl) {
this.orderUrl = orderUrl;
}
public Date getEndTime() {
return endTime;
}
public void setEndTime(Date endTime) {
this.endTime = endTime;
}
}
package com.gic.haoban.manage.api.dto.licence;
import java.io.Serializable;
import java.util.Date;
/**
* <p>
*
* </p>
*
* @author jx
* @since 2023-03-09
*/
public class AppOrderPageDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键id
*/
private Long id;
/**
* wx企业Id
*/
private String wxEnterpriseId;
/**
* 企业微信订单id
*/
private String orderId;
/**
* 订单状态1 - 待支付2 - 已支付3 - 订单取消4 - 支付过期5 - 退款申请中6 - 已退款7 - 交易完成8 - 待企业确认9 - 已部分退款
*/
private Integer orderStatus;
/**
* 订单类型 0 新购、1 扩容、2 续期
*/
private Integer orderType;
/**
* 购买人数
*/
private Integer userNum;
/**
* 购买时长
*/
private Integer duration;
/**
* 购买生效期的开始时间
*/
private Date beginTime;
/**
* 购买生效期的结束时间
*/
private Date endTime;
/**
* 支付时间
*/
private Date payTime;
/**
* 原价,单位分
*/
private Integer originPrice;
/**
* 折后价,单位分
*/
private Integer paidPrice;
/**
* 收款订单链接
*/
private String orderUrl;
/**
* 创建时间
*/
private Date createTime;
/**
* 更新时间
*/
private Date updateTime;
/**
* 创建人
*/
private String creatorId;
/**
* 创建人名称
*/
private String creatorName;
/**
* 订单支付到期时间
*/
private Date expireTime;
/**
* 有效状态 0 -- 1待生效 2生效中 3已失效
*/
private Integer effectiveState;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getWxEnterpriseId() {
return wxEnterpriseId;
}
public void setWxEnterpriseId(String wxEnterpriseId) {
this.wxEnterpriseId = wxEnterpriseId;
}
public String getOrderId() {
return orderId;
}
public void setOrderId(String orderId) {
this.orderId = orderId;
}
public Integer getOrderStatus() {
return orderStatus;
}
public void setOrderStatus(Integer orderStatus) {
this.orderStatus = orderStatus;
}
public Integer getOrderType() {
return orderType;
}
public void setOrderType(Integer orderType) {
this.orderType = orderType;
}
public Integer getUserNum() {
return userNum;
}
public void setUserNum(Integer userNum) {
this.userNum = userNum;
}
public Integer getDuration() {
return duration;
}
public void setDuration(Integer duration) {
this.duration = duration;
}
public Date getBeginTime() {
return beginTime;
}
public void setBeginTime(Date beginTime) {
this.beginTime = beginTime;
}
public Date getEndTime() {
return endTime;
}
public void setEndTime(Date endTime) {
this.endTime = endTime;
}
public Date getPayTime() {
return payTime;
}
public void setPayTime(Date payTime) {
this.payTime = payTime;
}
public Integer getOriginPrice() {
return originPrice;
}
public void setOriginPrice(Integer originPrice) {
this.originPrice = originPrice;
}
public Integer getPaidPrice() {
return paidPrice;
}
public void setPaidPrice(Integer paidPrice) {
this.paidPrice = paidPrice;
}
public String getOrderUrl() {
return orderUrl;
}
public void setOrderUrl(String orderUrl) {
this.orderUrl = orderUrl;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
public String getCreatorId() {
return creatorId;
}
public void setCreatorId(String creatorId) {
this.creatorId = creatorId;
}
public String getCreatorName() {
return creatorName;
}
public void setCreatorName(String creatorName) {
this.creatorName = creatorName;
}
public Date getExpireTime() {
return expireTime;
}
public void setExpireTime(Date expireTime) {
this.expireTime = expireTime;
}
public Integer getEffectiveState() {
return effectiveState;
}
public void setEffectiveState(Integer effectiveState) {
this.effectiveState = effectiveState;
}
}
package com.gic.haoban.manage.api.dto.licence;
import java.io.Serializable;
/**
* @description:
* @Author: wenhua
* @Date: 2023/6/12 15:25
*/
public class InvalidUserInfoDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 微信userId
*/
private String wxUserId;
/**
* 电话
*/
private String phone;
/**
* 名称
*/
private String name;
/**
* 不合法错误码
*/
private String invalidCode;
/**
* 不合法错误描述
*/
private String invalidMsg;
public String getWxUserId() {
return wxUserId;
}
public void setWxUserId(String wxUserId) {
this.wxUserId = wxUserId;
}
public String getPhone() {
return phone;
}
public void setPhone(String phone) {
this.phone = phone;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getInvalidCode() {
return invalidCode;
}
public void setInvalidCode(String invalidCode) {
this.invalidCode = invalidCode;
}
public String getInvalidMsg() {
return invalidMsg;
}
public void setInvalidMsg(String invalidMsg) {
this.invalidMsg = invalidMsg;
}
}
package com.gic.haoban.manage.api.dto.licence;
import java.io.Serializable;
/**
* @description:
* @Author: wenhua
* @Date: 2023/6/12 17:10
*/
public class RenewalUserDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* id
*/
private Long renewalId;
/**
* 电话
*/
private String phone;
/**
* 名称
*/
private String name;
/**
* 职位
*/
private String postion;
public Long getRenewalId() {
return renewalId;
}
public void setRenewalId(Long renewalId) {
this.renewalId = renewalId;
}
public String getPhone() {
return phone;
}
public void setPhone(String phone) {
this.phone = phone;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getPostion() {
return postion;
}
public void setPostion(String postion) {
this.postion = postion;
}
}
package com.gic.haoban.manage.api.dto.qdto.licence;
import com.gic.api.base.commons.BasePageInfo;
import java.io.Serializable;
/**
* <p>
*
* </p>
*
* @author jx
* @since 2023-03-09
*/
public class AppOrderPageQDTO extends BasePageInfo implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 订单状态1 - 待支付2 - 已支付3 - 订单取消4 - 支付过期5 - 退款申请中6 - 已退款7 - 交易完成8 - 待企业确认9 - 已部分退款
*/
private Integer orderStatus;
/**
* 企业微信订单id
*/
private String orderId;
/**
* wx企业Id
*/
private String wxEnterpriseId;
public Integer getOrderStatus() {
return orderStatus;
}
public void setOrderStatus(Integer orderStatus) {
this.orderStatus = orderStatus;
}
public String getOrderId() {
return orderId;
}
public void setOrderId(String orderId) {
this.orderId = orderId;
}
public String getWxEnterpriseId() {
return wxEnterpriseId;
}
public void setWxEnterpriseId(String wxEnterpriseId) {
this.wxEnterpriseId = wxEnterpriseId;
}
}
package com.gic.haoban.manage.api.dto.qdto.licence;
import java.io.Serializable;
import java.util.Date;
/**
* <p>
*
* </p>
*
* @author jx
* @since 2023-03-09
*/
public class AppOrderQDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 订单类型 0 新购、1 扩容、2 续期
*/
private Integer orderType;
/**
* 购买人数
*/
private Integer userNum;
/**
* 购买时长
*/
private Integer duration;
/**
* 购买生效期的开始时间
*/
private Date beginTime;
/**
* 购买生效期的结束时间
*/
private Date endTime;
/**
* wx企业Id
*/
private String wxEnterpriseId;
/**
* 创建人
*/
private String creatorId;
/**
* 创建人名称
*/
private String creatorName;
public Integer getOrderType() {
return orderType;
}
public void setOrderType(Integer orderType) {
this.orderType = orderType;
}
public Integer getUserNum() {
return userNum;
}
public void setUserNum(Integer userNum) {
this.userNum = userNum;
}
public Integer getDuration() {
return duration;
}
public void setDuration(Integer duration) {
this.duration = duration;
}
public Date getBeginTime() {
return beginTime;
}
public void setBeginTime(Date beginTime) {
this.beginTime = beginTime;
}
public Date getEndTime() {
return endTime;
}
public void setEndTime(Date endTime) {
this.endTime = endTime;
}
public String getWxEnterpriseId() {
return wxEnterpriseId;
}
public void setWxEnterpriseId(String wxEnterpriseId) {
this.wxEnterpriseId = wxEnterpriseId;
}
public String getCreatorId() {
return creatorId;
}
public void setCreatorId(String creatorId) {
this.creatorId = creatorId;
}
public String getCreatorName() {
return creatorName;
}
public void setCreatorName(String creatorName) {
this.creatorName = creatorName;
}
}
...@@ -74,6 +74,18 @@ public class LicenceOrderPageQDTO extends BasePageInfo implements Serializable ...@@ -74,6 +74,18 @@ public class LicenceOrderPageQDTO extends BasePageInfo implements Serializable
* 1 好办后台 0 运维后台 * 1 好办后台 0 运维后台
*/ */
private Integer type; private Integer type;
/**
* 订单类型,1:购买帐号,2:续期帐号
*/
private Integer orderType;
public Integer getOrderType() {
return orderType;
}
public void setOrderType(Integer orderType) {
this.orderType = orderType;
}
public Integer getType() { public Integer getType() {
return type; return type;
......
...@@ -2,6 +2,7 @@ package com.gic.haoban.manage.api.dto.qdto.licence; ...@@ -2,6 +2,7 @@ package com.gic.haoban.manage.api.dto.qdto.licence;
import java.io.Serializable; import java.io.Serializable;
import java.util.Date; import java.util.Date;
import java.util.List;
/** /**
* <p> * <p>
...@@ -51,7 +52,7 @@ public class LicenceOrderQDTO implements Serializable { ...@@ -51,7 +52,7 @@ public class LicenceOrderQDTO implements Serializable {
private Integer price; private Integer price;
/** /**
* 购买时间类型 1:按月购买,2:按天购买 * 购买时间类型 1:按月购买,2:按天购买,3:指定到期时间(仅续期订单有此类型)
*/ */
private Integer timeType; private Integer timeType;
...@@ -105,6 +106,18 @@ public class LicenceOrderQDTO implements Serializable { ...@@ -105,6 +106,18 @@ public class LicenceOrderQDTO implements Serializable {
* 企业微信订单id * 企业微信订单id
*/ */
private String qywxOrderId; private String qywxOrderId;
/**
* 续期成员staffIdList
*/
private List<String> staffIdList;
public List<String> getStaffIdList() {
return staffIdList;
}
public void setStaffIdList(List<String> staffIdList) {
this.staffIdList = staffIdList;
}
public String getQywxOrderId() { public String getQywxOrderId() {
return qywxOrderId; return qywxOrderId;
......
package com.gic.haoban.manage.api.dto.qdto.licence;
import com.gic.api.base.commons.BasePageInfo;
import java.io.Serializable;
/**
* @description:
* @Author: wenhua
* @Date: 2023/6/12 17:08
*/
public class RenewalUserQDTO extends BasePageInfo implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 员工姓名或手机号查询
*/
private String searchParam;
/**
* wx企业Id
*/
private String wxEnterpriseId;
/**
* 订单id
*/
private Long orderId;
public Long getOrderId() {
return orderId;
}
public void setOrderId(Long orderId) {
this.orderId = orderId;
}
public String getSearchParam() {
return searchParam;
}
public void setSearchParam(String searchParam) {
this.searchParam = searchParam;
}
public String getWxEnterpriseId() {
return wxEnterpriseId;
}
public void setWxEnterpriseId(String wxEnterpriseId) {
this.wxEnterpriseId = wxEnterpriseId;
}
}
...@@ -23,6 +23,14 @@ public interface DealSyncOperationApiService { ...@@ -23,6 +23,14 @@ public interface DealSyncOperationApiService {
* @param params * @param params
*/ */
void departmentDealMq(String params); void departmentDealMq(String params);
/**
* mq拆分
* 部门同步处理
* "routerName": "departmentSyncDealMq2"
*
* @param params
*/
void departmentDealMq2(String params);
/** /**
* 处理前端数据 * 处理前端数据
......
...@@ -146,6 +146,8 @@ public interface ExternalClerkRelatedApiService { ...@@ -146,6 +146,8 @@ public interface ExternalClerkRelatedApiService {
*/ */
List<String> listStoreIdByMemberId(String memberId); List<String> listStoreIdByMemberId(String memberId);
List<String> listStoreIdByMemberId(String memberId , Date endTime);
/** /**
* 获取该企业会员下的关联关系列表 * 获取该企业会员下的关联关系列表
* *
......
...@@ -342,4 +342,18 @@ public interface StaffApiService { ...@@ -342,4 +342,18 @@ public interface StaffApiService {
* @return * @return
*/ */
com.gic.api.base.commons.ServiceResponse<List<WxEnterpriseRelatedDTO>> getWxEnterpriseRelatedList(String wxEnterpriseId); com.gic.api.base.commons.ServiceResponse<List<WxEnterpriseRelatedDTO>> getWxEnterpriseRelatedList(String wxEnterpriseId);
/**
* 定时任务
* 刷新企业成员外部联系人
* @param params 企业微信id,多个按”,“隔开
*/
com.gic.api.base.commons.ServiceResponse<Boolean> updateExternalUserId(String params);
/**
* 定时任务
* 同步企业微信通讯录列表
* @param params 回调参数
* @return
*/
com.gic.api.base.commons.ServiceResponse<Boolean> syncQywxStaffList(String params) ;
} }
...@@ -18,6 +18,13 @@ public interface StaffClerkRelationApiService { ...@@ -18,6 +18,13 @@ public interface StaffClerkRelationApiService {
*/ */
void bindLogMq(String params); void bindLogMq(String params);
/**
*
* @param wxEnterpriseId
* @param enterpriseId
* @param clerkCodeList 改为传导购idList
* @return
*/
List<StaffClerkRelationDTO> listBindCode(String wxEnterpriseId,String enterpriseId, Set<String> clerkCodeList); List<StaffClerkRelationDTO> listBindCode(String wxEnterpriseId,String enterpriseId, Set<String> clerkCodeList);
List<StaffClerkRelationDTO> listBindCodeByStaffId(List<String> enterpriseIdList, String staffId); List<StaffClerkRelationDTO> listBindCodeByStaffId(List<String> enterpriseIdList, String staffId);
......
...@@ -26,6 +26,7 @@ public interface WxEnterpriseApiService { ...@@ -26,6 +26,7 @@ public interface WxEnterpriseApiService {
* @param version 版本 * @param version 版本
* @param enterpriseIdsNotIn 企业不存在列表 * @param enterpriseIdsNotIn 企业不存在列表
* @param loginUserId 登录用户id * @param loginUserId 登录用户id
* @param appType 应用类型,0第三方 1自建
* @return : {@link Page< YwWxEnterpriseDTO>} * @return : {@link Page< YwWxEnterpriseDTO>}
* @author : YongEn * @author : YongEn
* @date : 2022/2/15 * @date : 2022/2/15
...@@ -36,7 +37,8 @@ public interface WxEnterpriseApiService { ...@@ -36,7 +37,8 @@ public interface WxEnterpriseApiService {
Integer gicContactFlag, Integer gicContactFlag,
String version, String version,
List<String> enterpriseIdsNotIn, List<String> enterpriseIdsNotIn,
String loginUserId); String loginUserId,
Integer appType);
/** /**
* 获取一个 * 获取一个
...@@ -232,4 +234,29 @@ public interface WxEnterpriseApiService { ...@@ -232,4 +234,29 @@ public interface WxEnterpriseApiService {
public String getEndDate(String enterpriseId) ; public String getEndDate(String enterpriseId) ;
/**
* 新增或者修改企业微信配置信息
* @param enterpriseDTO
* @return
*/
ServiceResponse<Boolean> saveOrUpdate(WxEnterpriseDTO enterpriseDTO);
/**
* 过滤已经存在的自建应用appid
* @param wxAppidList 好办自建应用appidList
* @return 过滤的好办自建应用appidList
*/
ServiceResponse<List<String>> filterWxAppidList(List<String> wxAppidList);
/**
* 定时任务,同步自建应用信息
*/
ServiceResponse<Boolean> syncWxEnterpriseInfo(String params);
/**
* 删除自建应用wxaAppid
* @param wxEnterpriseId 企业微信id
* @return
*/
ServiceResponse<Boolean> deleteByWxEnterpriseId(String wxEnterpriseId);
} }
package com.gic.haoban.manage.api.service.licence;
import com.gic.api.base.commons.Page;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.haoban.manage.api.dto.licence.AppOrderCheckDTO;
import com.gic.haoban.manage.api.dto.licence.AppOrderNoticeDTO;
import com.gic.haoban.manage.api.dto.licence.AppOrderPageDTO;
import com.gic.haoban.manage.api.dto.qdto.licence.AppOrderPageQDTO;
import com.gic.haoban.manage.api.dto.qdto.licence.AppOrderQDTO;
/**
* @description: 订单应用购买
* @Author: wenhua
* @Date: 2023/6/25 15:43
*/
public interface AppOrderApiService {
/**
* 分页查询企业付费应用
*
* @param qdto
* @return
*/
ServiceResponse<Page<AppOrderPageDTO>> getAppOrderPage(AppOrderPageQDTO qdto);
/**
* 新增订单
* @param qdto
* @return
*/
ServiceResponse<Boolean> saveAppOrder(AppOrderQDTO qdto);
/**
* 取消订单
* @param orderId 应用订单主键id
* @return
*/
ServiceResponse<Boolean> cancelAppOrder(Long orderId);
/**
* 购买弹窗校验
* @param wxEnterpriseId
* @return
*/
ServiceResponse<AppOrderCheckDTO> checkAppOrder(String wxEnterpriseId);
/**
* 登录好办弹窗校验
* @param wxEnterpriseId
* @return
*/
ServiceResponse<AppOrderNoticeDTO> noticeAppOrder(String wxEnterpriseId);
/**
* 企业微信通知回调
* @param param 回调参数
* @return
*/
ServiceResponse<Boolean> qywxCallBack(String param);
/**
* 定时获取好办付费应用订单列表
* @param param {"start_time" : 1542091572,"end_time" : 1542177972,"test_mode" : 1}
* @return
*/
ServiceResponse<Boolean> getAppOrderList(String param);
}
...@@ -4,8 +4,10 @@ import com.gic.api.base.commons.Page; ...@@ -4,8 +4,10 @@ import com.gic.api.base.commons.Page;
import com.gic.api.base.commons.ServiceResponse; import com.gic.api.base.commons.ServiceResponse;
import com.gic.haoban.manage.api.dto.licence.LicenceOrderDTO; import com.gic.haoban.manage.api.dto.licence.LicenceOrderDTO;
import com.gic.haoban.manage.api.dto.licence.LicenceOrderPageDTO; import com.gic.haoban.manage.api.dto.licence.LicenceOrderPageDTO;
import com.gic.haoban.manage.api.dto.licence.RenewalUserDTO;
import com.gic.haoban.manage.api.dto.qdto.licence.LicenceOrderPageQDTO; import com.gic.haoban.manage.api.dto.qdto.licence.LicenceOrderPageQDTO;
import com.gic.haoban.manage.api.dto.qdto.licence.LicenceOrderQDTO; import com.gic.haoban.manage.api.dto.qdto.licence.LicenceOrderQDTO;
import com.gic.haoban.manage.api.dto.qdto.licence.RenewalUserQDTO;
import java.util.Date; import java.util.Date;
import java.util.HashMap; import java.util.HashMap;
...@@ -113,7 +115,7 @@ public interface LicenceOrderApiService { ...@@ -113,7 +115,7 @@ public interface LicenceOrderApiService {
* 查询订单编号id * 查询订单编号id
* *
* @param param 查询参数 * @param param 查询参数
* @param type 0 订单编号 1 企业微信订单编号 2微信订单编号 * @param type 0 订单编号 1 企业微信订单编号 2微信订单编号 3付费应用企业微信订单编号
* @param wxEnterpriseId * @param wxEnterpriseId
* @return * @return
*/ */
...@@ -157,5 +159,7 @@ public interface LicenceOrderApiService { ...@@ -157,5 +159,7 @@ public interface LicenceOrderApiService {
*/ */
ServiceResponse<Boolean> checkQywxOrderStatus(Long orderId); ServiceResponse<Boolean> checkQywxOrderStatus(Long orderId);
ServiceResponse<Page<RenewalUserDTO>> getRenewalUserPage(RenewalUserQDTO qdto);
} }
...@@ -190,6 +190,17 @@ ...@@ -190,6 +190,17 @@
<artifactId>gic-authcenter-commons</artifactId> <artifactId>gic-authcenter-commons</artifactId>
<version>${gic-authcenter-commons}</version> <version>${gic-authcenter-commons}</version>
</dependency> </dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>3.9</version>
<exclusions>
<exclusion>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies> </dependencies>
<build> <build>
......
package com.gic.haoban.manage.web.controller; package com.gic.haoban.manage.web.controller;
import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.gic.api.base.commons.Page; import com.gic.api.base.commons.Page;
import com.gic.authcenter.commons.dto.AuthcenterUserDetails; import com.gic.authcenter.commons.dto.AuthcenterUserDetails;
...@@ -9,6 +8,7 @@ import com.gic.authcenter.commons.util.SessionContextUtil; ...@@ -9,6 +8,7 @@ import com.gic.authcenter.commons.util.SessionContextUtil;
import com.gic.clerk.api.dto.ClerkDTO; import com.gic.clerk.api.dto.ClerkDTO;
import com.gic.clerk.api.service.ClerkService; import com.gic.clerk.api.service.ClerkService;
import com.gic.commons.util.GlobalVar; import com.gic.commons.util.GlobalVar;
import com.gic.commons.webapi.reponse.RestResponse;
import com.gic.enterprise.api.dto.EnterpriseAndUserDTO; import com.gic.enterprise.api.dto.EnterpriseAndUserDTO;
import com.gic.enterprise.api.dto.EnterpriseDTO; import com.gic.enterprise.api.dto.EnterpriseDTO;
import com.gic.enterprise.api.dto.PowerStoreGroupDTO; import com.gic.enterprise.api.dto.PowerStoreGroupDTO;
...@@ -31,6 +31,7 @@ import com.gic.haoban.manage.api.service.WxEnterpriseApiService; ...@@ -31,6 +31,7 @@ import com.gic.haoban.manage.api.service.WxEnterpriseApiService;
import com.gic.haoban.manage.api.service.WxEnterpriseRelatedApiService; import com.gic.haoban.manage.api.service.WxEnterpriseRelatedApiService;
import com.gic.haoban.manage.web.errCode.HaoBanErrCode; import com.gic.haoban.manage.web.errCode.HaoBanErrCode;
import com.gic.haoban.manage.web.qo.WxEnterpriseBindQo; import com.gic.haoban.manage.web.qo.WxEnterpriseBindQo;
import com.gic.haoban.manage.web.qo.WxEnterpriseQO;
import com.gic.haoban.manage.web.vo.EnterpriseDetailVo; import com.gic.haoban.manage.web.vo.EnterpriseDetailVo;
import com.gic.haoban.manage.web.vo.EnterpriseSearchVO; import com.gic.haoban.manage.web.vo.EnterpriseSearchVO;
import com.gic.haoban.manage.web.vo.StoreGroupVo; import com.gic.haoban.manage.web.vo.StoreGroupVo;
...@@ -109,6 +110,7 @@ public class EnterpriseController extends WebBaseController { ...@@ -109,6 +110,7 @@ public class EnterpriseController extends WebBaseController {
* @param gicContactHelper 是否开启通讯录应用1是0否 * @param gicContactHelper 是否开启通讯录应用1是0否
* @param loginUserId 登录用户id * @param loginUserId 登录用户id
* @param version 版本 * @param version 版本
* @param appType 应用类型,0第三方 1自建 null全部
* @return res * @return res
*/ */
@RequestMapping("wx-enterprise-list") @RequestMapping("wx-enterprise-list")
...@@ -118,7 +120,8 @@ public class EnterpriseController extends WebBaseController { ...@@ -118,7 +120,8 @@ public class EnterpriseController extends WebBaseController {
String gicEnterpriseName, String gicEnterpriseName,
Integer gicContactHelper, Integer gicContactHelper,
String loginUserId, String loginUserId,
String version) { String version,
Integer appType) {
List<String> wxEnterpriseIdInList = Lists.newArrayList(); List<String> wxEnterpriseIdInList = Lists.newArrayList();
...@@ -140,15 +143,15 @@ public class EnterpriseController extends WebBaseController { ...@@ -140,15 +143,15 @@ public class EnterpriseController extends WebBaseController {
Page<YwWxEnterpriseDTO> page = new Page<>(); Page<YwWxEnterpriseDTO> page = new Page<>();
if (Objects.nonNull(openTagFlag) && ALL == openTagFlag) { if (Objects.nonNull(openTagFlag) && ALL == openTagFlag) {
page = queryAll(pageInfo, keyword, gicContactHelper, version, wxEnterpriseIdInList, wxEnterpriseIdSetInCache, loginUserId); page = queryAll(pageInfo, keyword, gicContactHelper, version, wxEnterpriseIdInList, wxEnterpriseIdSetInCache, loginUserId,appType);
} }
if (Objects.nonNull(openTagFlag) && OPEN == openTagFlag) { if (Objects.nonNull(openTagFlag) && OPEN == openTagFlag) {
page = queryOpen(pageInfo, keyword, gicEnterpriseName, gicContactHelper, version, wxEnterpriseIdInList, wxEnterpriseIdSetInCache, loginUserId); page = queryOpen(pageInfo, keyword, gicEnterpriseName, gicContactHelper, version, wxEnterpriseIdInList, wxEnterpriseIdSetInCache, loginUserId,appType);
} }
if (Objects.nonNull(openTagFlag) && CLOSE == openTagFlag) { if (Objects.nonNull(openTagFlag) && CLOSE == openTagFlag) {
page = queryClose(pageInfo, keyword, gicContactHelper, version, wxEnterpriseIdInList, wxEnterpriseIdSetInCache, loginUserId); page = queryClose(pageInfo, keyword, gicContactHelper, version, wxEnterpriseIdInList, wxEnterpriseIdSetInCache, loginUserId,appType);
} }
doProcessOpenSendMass(page.getResult()); doProcessOpenSendMass(page.getResult());
...@@ -221,9 +224,10 @@ public class EnterpriseController extends WebBaseController { ...@@ -221,9 +224,10 @@ public class EnterpriseController extends WebBaseController {
String version, String version,
List<String> wxEnterpriseIdInList, List<String> wxEnterpriseIdInList,
Set<String> wxEnterpriseIdSetInCache, Set<String> wxEnterpriseIdSetInCache,
String loginUserId) { String loginUserId,
Integer appType) {
// 查询所有状态 // 查询所有状态
Page<YwWxEnterpriseDTO> page = wxEnterpriseApiService.list(pageInfo, keyword, wxEnterpriseIdInList, gicContactHelper, version, null, loginUserId); Page<YwWxEnterpriseDTO> page = wxEnterpriseApiService.list(pageInfo, keyword, wxEnterpriseIdInList, gicContactHelper, version, null, loginUserId,appType);
if (CollectionUtil.isEmpty(page.getResult())) { if (CollectionUtil.isEmpty(page.getResult())) {
return page; return page;
} }
...@@ -249,14 +253,15 @@ public class EnterpriseController extends WebBaseController { ...@@ -249,14 +253,15 @@ public class EnterpriseController extends WebBaseController {
String version, String version,
List<String> wxEnterpriseIdInList, List<String> wxEnterpriseIdInList,
Set<String> wxEnterpriseIdSetInCache, Set<String> wxEnterpriseIdSetInCache,
String loginUserId) { String loginUserId,
Integer appType) {
// 查询开启状态 // 查询开启状态
if (haveCondition(gicEnterpriseName)) { if (haveCondition(gicEnterpriseName)) {
// 有条件-取交集 // 有条件-取交集
wxEnterpriseIdSetInCache.retainAll(wxEnterpriseIdInList); wxEnterpriseIdSetInCache.retainAll(wxEnterpriseIdInList);
} }
List<String> queryList = new ArrayList<>(wxEnterpriseIdSetInCache); List<String> queryList = new ArrayList<>(wxEnterpriseIdSetInCache);
Page<YwWxEnterpriseDTO> page = wxEnterpriseApiService.list(pageInfo, keyword, queryList, gicContactHelper, version, null, loginUserId); Page<YwWxEnterpriseDTO> page = wxEnterpriseApiService.list(pageInfo, keyword, queryList, gicContactHelper, version, null, loginUserId,appType);
if (CollectionUtil.isEmpty(page.getResult())) { if (CollectionUtil.isEmpty(page.getResult())) {
return page; return page;
} }
...@@ -278,9 +283,10 @@ public class EnterpriseController extends WebBaseController { ...@@ -278,9 +283,10 @@ public class EnterpriseController extends WebBaseController {
String version, String version,
List<String> wxEnterpriseIdInList, List<String> wxEnterpriseIdInList,
Set<String> wxEnterpriseIdSetInCache, Set<String> wxEnterpriseIdSetInCache,
String loginUserId) { String loginUserId,
Integer appType) {
// 查询关闭状态 // 查询关闭状态
Page<YwWxEnterpriseDTO> page = wxEnterpriseApiService.list(pageInfo, keyword, wxEnterpriseIdInList, gicContactHelper, version, new ArrayList<>(wxEnterpriseIdSetInCache), loginUserId); Page<YwWxEnterpriseDTO> page = wxEnterpriseApiService.list(pageInfo, keyword, wxEnterpriseIdInList, gicContactHelper, version, new ArrayList<>(wxEnterpriseIdSetInCache), loginUserId,appType);
if (CollectionUtil.isEmpty(page.getResult())) { if (CollectionUtil.isEmpty(page.getResult())) {
return page; return page;
} }
...@@ -629,4 +635,19 @@ public class EnterpriseController extends WebBaseController { ...@@ -629,4 +635,19 @@ public class EnterpriseController extends WebBaseController {
WxEnterpriseRelationDetailDTO bindInfo = wxEnterpriseRelatedApiService.getEnterpriseBindInfo(wxEnterpriseId, enterpriseId); WxEnterpriseRelationDetailDTO bindInfo = wxEnterpriseRelatedApiService.getEnterpriseBindInfo(wxEnterpriseId, enterpriseId);
return resultResponse(HaoBanErrCode.ERR_1, bindInfo); return resultResponse(HaoBanErrCode.ERR_1, bindInfo);
} }
/**
* 新增或者修改企业微信自建应用信息
* @return
*/
@RequestMapping("saveOrUpdate-WxEnterprise-detail")
public RestResponse<Boolean> saveOrUpdateEnterpriseDetail(@RequestBody WxEnterpriseQO qo){
WxEnterpriseDTO wxEnterpriseDTO = EntityUtil.changeEntityByJSON(WxEnterpriseDTO.class, qo);
com.gic.api.base.commons.ServiceResponse<Boolean> response = wxEnterpriseApiService.saveOrUpdate(wxEnterpriseDTO);
if (response.isSuccess()){
return RestResponse.successResult(true);
}
return RestResponse.failure(response.getCode(),response.getMessage());
}
} }
...@@ -154,7 +154,7 @@ public class LicenceOrderController { ...@@ -154,7 +154,7 @@ public class LicenceOrderController {
* 订单编号和企业微信订单编号模糊搜索 * 订单编号和企业微信订单编号模糊搜索
* *
* @param param 模糊查询 * @param param 模糊查询
* @param type 0 订单编号 1 企业微信订单编号 2微信订单编号 * @param type 0 订单编号 1 企业微信订单编号 2微信订单编号 3付费应用企业微信订单编号
* @return * @return
*/ */
@RequestMapping("get-order-id-list") @RequestMapping("get-order-id-list")
......
package com.gic.haoban.manage.web.controller;
import cn.hutool.crypto.SecureUtil;
import com.alibaba.fastjson.JSONObject;
import com.gic.commons.util.DateUtil;
import com.gic.commons.webapi.reponse.RestResponse;
import com.gic.haoban.common.utils.HaobanResponse;
import com.gic.haoban.common.utils.UploadUtils;
import com.gic.haoban.manage.web.errCode.HaoBanErrCode;
import com.gic.thirdparty.cloudfile.CloudFileUtil;
import com.gic.thirdparty.cloudfile.enums.CloudFileBusinessOptEnum;
import com.gic.thirdparty.cloudfile.enums.CloudFileTypeEnum;
import com.gic.thirdparty.cloudfile.pojo.CloudFileInfo;
import org.apache.commons.io.FileUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import java.io.File;
import java.io.FileInputStream;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
@RestController
public class UploadController extends WebBaseController {
private static Logger logger = LoggerFactory.getLogger(UploadController.class);
@RequestMapping("/upload-file")
@ResponseBody
public RestResponse upload(@RequestParam MultipartFile file) throws Exception {
if (file == null || file.isEmpty()) {
return RestResponse.failure("-9999","上传的文件不能为空!");
}
String name = file.getOriginalFilename();
// 未加密前文件名称
String mediaName = file.getOriginalFilename();
mediaName = mediaName.substring(0, mediaName.lastIndexOf("."));
if (mediaName.length() > 20) {
mediaName = mediaName.substring(0, 20);
}
String suffix = name.substring(name.lastIndexOf(".") + 1);
name = SecureUtil.md5(name) + "." + suffix;
String location = System.getProperty("user.dir") + "/data/tmp/";
long len = file.getSize();
File templateFile = new File(location + name);
FileUtils.copyInputStreamToFile(file.getInputStream(), templateFile);
// 2.上传腾讯云
String dayFilePath = LocalDateTime.now().format(DateTimeFormatter.ofPattern(DateUtil.FORMAT_DATETIME_14));
String nameUpload = mediaName + "." + suffix;
String key = "haoban/" + dayFilePath + "/" + nameUpload;
try {
//替换新的上传接口
CloudFileTypeEnum cloudFileTypeEnum = CloudFileTypeEnum.OTHER;
if (UploadUtils.isPicture(suffix)) {
cloudFileTypeEnum = CloudFileTypeEnum.IMAGE;
} else if (UploadUtils.isOffice(suffix)) {
cloudFileTypeEnum = CloudFileTypeEnum.FILE;
} else if (UploadUtils.isMusic(suffix)) {
cloudFileTypeEnum = CloudFileTypeEnum.AUDIO;
} else if (UploadUtils.isVedio(suffix)) {
cloudFileTypeEnum = CloudFileTypeEnum.VIDEO;
}
CloudFileInfo cloudFileInfo = CloudFileUtil.uploadFile(new FileInputStream(templateFile), suffix, cloudFileTypeEnum, "gic_inner", CloudFileBusinessOptEnum.HAOBAN_COMMON);
if (templateFile != null) {
templateFile.delete();
}
JSONObject res = new JSONObject();
res.put("name", name);
res.put("mediaName", mediaName);
res.put("ext", suffix);
res.put("size", len);
res.put("key", key);
res.put("url", cloudFileInfo.getOrgFileUrl());
return RestResponse.successResult(res);
} catch (Exception e) {
logger.info("异常:{}", e.getMessage(), e);
return RestResponse.failure("-9999","操作失败");
}
}
}
package com.gic.haoban.manage.web.qo;
import java.io.Serializable;
public class WxEnterpriseQO implements Serializable {
private static final long serialVersionUID = 1L;
private String wxEnterpriseId;
/**
* 企业名称
*/
private String corpName;
/**
* 企业头像
*/
private String corpSquareLogoUrl;
/**
* 应用id
*/
private String agentId;
/**
* 应用名称
*/
private String agentName;
/**
* secret
*/
private String secretVal;
/**
* 明文corpid
*/
private String wxCorpid;
/**
* 自建小程序appid
*/
private String wxaAppid;
/**
* 自建请求url
*/
private String urlHost;
/**
* 应用类型,0第三方 1自建
*/
private Integer appType;
/**
* 自建应用是否支持配置回调地址 0 不支持 1支持
*/
private Integer callbackFlag;
public Integer getCallbackFlag() {
return callbackFlag;
}
public void setCallbackFlag(Integer callbackFlag) {
this.callbackFlag = callbackFlag;
}
public String getWxEnterpriseId() {
return wxEnterpriseId;
}
public void setWxEnterpriseId(String wxEnterpriseId) {
this.wxEnterpriseId = wxEnterpriseId;
}
public String getCorpName() {
return corpName;
}
public void setCorpName(String corpName) {
this.corpName = corpName;
}
public String getCorpSquareLogoUrl() {
return corpSquareLogoUrl;
}
public void setCorpSquareLogoUrl(String corpSquareLogoUrl) {
this.corpSquareLogoUrl = corpSquareLogoUrl;
}
public String getWxCorpid() {
return wxCorpid;
}
public void setWxCorpid(String wxCorpid) {
this.wxCorpid = wxCorpid;
}
public String getWxaAppid() {
return wxaAppid;
}
public void setWxaAppid(String wxaAppid) {
this.wxaAppid = wxaAppid;
}
public String getUrlHost() {
return urlHost;
}
public void setUrlHost(String urlHost) {
this.urlHost = urlHost;
}
public Integer getAppType() {
return appType;
}
public void setAppType(Integer appType) {
this.appType = appType;
}
public String getAgentId() {
return agentId;
}
public void setAgentId(String agentId) {
this.agentId = agentId;
}
public String getAgentName() {
return agentName;
}
public void setAgentName(String agentName) {
this.agentName = agentName;
}
public String getSecretVal() {
return secretVal;
}
public void setSecretVal(String secretVal) {
this.secretVal = secretVal;
}
}
...@@ -60,5 +60,9 @@ public class LicenceOrderPageQO extends BasePageInfo implements Serializable { ...@@ -60,5 +60,9 @@ public class LicenceOrderPageQO extends BasePageInfo implements Serializable {
* 微信订单id * 微信订单id
*/ */
private String wxOrderId; private String wxOrderId;
/**
* 订单类型,1:购买帐号,2:续期帐号
*/
private Integer orderType;
} }
...@@ -202,6 +202,11 @@ ...@@ -202,6 +202,11 @@
<artifactId>gic-message-center-api</artifactId> <artifactId>gic-message-center-api</artifactId>
<version>${gic-message-center-api}</version> <version>${gic-message-center-api}</version>
</dependency> </dependency>
<dependency>
<groupId>com.gic.operating</groupId>
<artifactId>gic-operating-api</artifactId>
<version>${gic-operating-api}</version>
</dependency>
</dependencies> </dependencies>
<build> <build>
......
...@@ -44,6 +44,50 @@ public class Config { ...@@ -44,6 +44,50 @@ public class Config {
@Value("${dingUrl}") @Value("${dingUrl}")
private String dingUrl; private String dingUrl;
/**
* 企业微信付费应用购买信息
*/
@Value("${qywxCashierSecret}")
private String qywxCashierSecret;
@Value("${promotionCaseId}")
private String promotionCaseId;
@Value("${promotionCaseName}")
private String promotionCaseName;
@Value("${buySuiteId}")
private String buySuiteId;
public String getBuySuiteId() {
return buySuiteId;
}
public void setBuySuiteId(String buySuiteId) {
this.buySuiteId = buySuiteId;
}
public String getQywxCashierSecret() {
return qywxCashierSecret;
}
public void setQywxCashierSecret(String qywxCashierSecret) {
this.qywxCashierSecret = qywxCashierSecret;
}
public String getPromotionCaseId() {
return promotionCaseId;
}
public void setPromotionCaseId(String promotionCaseId) {
this.promotionCaseId = promotionCaseId;
}
public String getPromotionCaseName() {
return promotionCaseName;
}
public void setPromotionCaseName(String promotionCaseName) {
this.promotionCaseName = promotionCaseName;
}
public String getDingUrl() { public String getDingUrl() {
return dingUrl; return dingUrl;
} }
......
...@@ -167,6 +167,13 @@ public interface StaffMapper { ...@@ -167,6 +167,13 @@ public interface StaffMapper {
Integer getOccupyNum(@Param("wxEnterpriseId") String wxEnterpriseId); Integer getOccupyNum(@Param("wxEnterpriseId") String wxEnterpriseId);
/** /**
* 查询即将过期的许可总数
* @param wxEnterpriseId
* @return
*/
Integer getExpiringNum(@Param("wxEnterpriseId") String wxEnterpriseId);
/**
* 通过wxOpenUserId更新企业成员许可信息 * 通过wxOpenUserId更新企业成员许可信息
*/ */
void updateStaffInfoByStaffId(@Param("staffId") String staffId, void updateStaffInfoByStaffId(@Param("staffId") String staffId,
......
package com.gic.haoban.manage.service.dao.mapper;
import com.gic.haoban.manage.api.dto.qdto.licence.AppOrderPageQDTO;
import com.gic.haoban.manage.service.entity.TabHaobanAppOrder;
import org.apache.ibatis.annotations.Param;
import org.springframework.data.domain.Pageable;
import java.util.List;
/**
* (TabHaobanAppOrder)表数据库访问层
*
* @author makejava
* @since 2023-06-21 17:24:20
*/
public interface TabHaobanAppOrderMapper {
/**
* 通过ID查询单条数据
*
* @param id 主键
* @return 实例对象
*/
TabHaobanAppOrder queryById(Long id);
/**
* 查询指定行数据
*
* @param tabHaobanAppOrder 查询条件
* @param pageable 分页对象
* @return 对象列表
*/
List<TabHaobanAppOrder> queryAllByLimit(TabHaobanAppOrder tabHaobanAppOrder, @Param("pageable") Pageable pageable);
/**
* 统计总行数
*
* @param tabHaobanAppOrder 查询条件
* @return 总行数
*/
long count(TabHaobanAppOrder tabHaobanAppOrder);
/**
* 新增数据
*
* @param tabHaobanAppOrder 实例对象
* @return 影响行数
*/
int insert(TabHaobanAppOrder tabHaobanAppOrder);
/**
* 批量新增数据(MyBatis原生foreach方法)
*
* @param entities List<TabHaobanAppOrder> 实例对象列表
* @return 影响行数
*/
int insertBatch(@Param("entities") List<TabHaobanAppOrder> entities);
/**
* 修改数据
*
* @param tabHaobanAppOrder 实例对象
* @return 影响行数
*/
int update(TabHaobanAppOrder tabHaobanAppOrder);
/**
* 通过主键删除数据
*
* @param id 主键
* @return 影响行数
*/
int deleteById(Long id);
/**
* 查询企业微信订单id
* @param qywxOrderId
* @param wxEnterpriseId
* @return
*/
List<String> getQywxOrderId(@Param("qywxOrderId") String qywxOrderId, @Param("wxEnterpriseId") String wxEnterpriseId);
List<TabHaobanAppOrder> getAppOrderPage(AppOrderPageQDTO qdto);
/**
* @param orderId 企业微信订单id
* @return 实例对象
*/
TabHaobanAppOrder queryByOrderId(@Param("orderId")String orderId);
}
...@@ -121,6 +121,11 @@ public interface TabHaobanExternalClerkRelatedMapper { ...@@ -121,6 +121,11 @@ public interface TabHaobanExternalClerkRelatedMapper {
@Param("enterpriseId") String enterpriseId, @Param("enterpriseId") String enterpriseId,
@Param("externalUserId") String externalUserId); @Param("externalUserId") String externalUserId);
TabHaobanExternalClerkRelated getExternalClerkByWxUserIdAncExternalUserIdSelf(@Param("wxEnterpriseId") String wxEnterpriseId,
@Param("staffId") String staffId,
@Param("enterpriseId") String enterpriseId,
@Param("externalUserId") String externalUserId);
/** /**
* 查询会员在企业下的好友关系 * 查询会员在企业下的好友关系
* *
...@@ -202,7 +207,7 @@ public interface TabHaobanExternalClerkRelatedMapper { ...@@ -202,7 +207,7 @@ public interface TabHaobanExternalClerkRelatedMapper {
* @author mozhu * @author mozhu
* @date 2022-07-06 14:40:15 * @date 2022-07-06 14:40:15
*/ */
List<String> listStoreIdByMemberId(@Param("memberId") String memberId); List<String> listStoreIdByMemberId(@Param("memberId") String memberId , @Param("addCreateTime") String addCreateTime);
/** /**
* 查询会员在企业下的好友关系 根据会员id * 查询会员在企业下的好友关系 根据会员id
...@@ -400,4 +405,19 @@ public interface TabHaobanExternalClerkRelatedMapper { ...@@ -400,4 +405,19 @@ public interface TabHaobanExternalClerkRelatedMapper {
*/ */
List<TabHaobanExternalClerkRelated> queryClerkMemberRelations(@Param("staffId") String staffId, @Param("memberIds") List<String> memberIds); List<TabHaobanExternalClerkRelated> queryClerkMemberRelations(@Param("staffId") String staffId, @Param("memberIds") List<String> memberIds);
/**
* 查询企业微信下面 外部联系人是null的所有成员
* @param wxEnterpriseId
* @param enterpriseIdList
* @return
*/
List<String> listByWxEnterpriseId(@Param("wxEnterpriseId")String wxEnterpriseId, @Param("enterpriseIdList") List<String> enterpriseIdList);
/**
* 删除企业微信下面,所有外部联系人是null的成员
* @param wxEnterpriseId
* @param enterpriseIdList
*/
void deleteByWxEnterpriseId(@Param("wxEnterpriseId")String wxEnterpriseId, @Param("enterpriseIdList") List<String> enterpriseIdList);
} }
\ No newline at end of file
package com.gic.haoban.manage.service.dao.mapper;
import com.gic.haoban.manage.api.dto.qdto.licence.RenewalUserQDTO;
import com.gic.haoban.manage.service.entity.TabHaobanRenewalUser;
import org.apache.ibatis.annotations.Param;
import org.springframework.data.domain.Pageable;
import java.util.List;
/**
* (TabHaobanRenewalUser)表数据库访问层
*
* @author makejava
* @since 2023-06-08 15:11:49
*/
public interface TabHaobanRenewalUserMapper {
/**
* 通过ID查询单条数据
*
* @param renewalId 主键
* @return 实例对象
*/
TabHaobanRenewalUser queryById(Long renewalId);
/**
* 查询指定行数据
*
* @param tabHaobanRenewalUser 查询条件
* @param pageable 分页对象
* @return 对象列表
*/
List<TabHaobanRenewalUser> queryAllByLimit(TabHaobanRenewalUser tabHaobanRenewalUser, @Param("pageable") Pageable pageable);
/**
* 统计总行数
*
* @param tabHaobanRenewalUser 查询条件
* @return 总行数
*/
long count(TabHaobanRenewalUser tabHaobanRenewalUser);
/**
* 新增数据
*
* @param tabHaobanRenewalUser 实例对象
* @return 影响行数
*/
int insert(TabHaobanRenewalUser tabHaobanRenewalUser);
/**
* 批量新增数据(MyBatis原生foreach方法)
*
* @param entities List<TabHaobanRenewalUser> 实例对象列表
* @return 影响行数
*/
int insertBatch(@Param("entities") List<TabHaobanRenewalUser> entities);
/**
* 批量新增或按主键更新数据(MyBatis原生foreach方法)
*
* @param entities List<TabHaobanRenewalUser> 实例对象列表
* @return 影响行数
* @throws org.springframework.jdbc.BadSqlGrammarException 入参是空List的时候会抛SQL语句错误的异常,请自行校验入参
*/
int insertOrUpdateBatch(@Param("entities") List<TabHaobanRenewalUser> entities);
/**
* 修改数据
*
* @param tabHaobanRenewalUser 实例对象
* @return 影响行数
*/
int update(TabHaobanRenewalUser tabHaobanRenewalUser);
/**
* 通过主键删除数据
*
* @param renewalId 主键
* @return 影响行数
*/
int deleteById(Long renewalId);
/**
* 分页查询续期成员列表
*
* @param qdto
* @return
*/
List<TabHaobanRenewalUser> getRenewalUserPage(RenewalUserQDTO qdto);
}
...@@ -31,10 +31,8 @@ public interface TabHaobanStaffClerkRelationMapper { ...@@ -31,10 +31,8 @@ public interface TabHaobanStaffClerkRelationMapper {
int changeStatusByClerkId(@Param("clerkId") String clerkId, @Param("status") Integer status); int changeStatusByClerkId(@Param("clerkId") String clerkId, @Param("status") Integer status);
/** //无效接口删除
* 解绑 // void delByStoreIdAndCode(@Param("storeId") String storeId, @Param("clerkCode") String clerkCode);
*/
void delByStoreIdAndCode(@Param("storeId") String storeId, @Param("clerkCode") String clerkCode);
/** /**
* 解绑 * 解绑
...@@ -49,7 +47,8 @@ public interface TabHaobanStaffClerkRelationMapper { ...@@ -49,7 +47,8 @@ public interface TabHaobanStaffClerkRelationMapper {
List<StaffClerkRelationDTO> lisByStaffId(@Param("wxEnterpriseId") String wxEnterpriseId, @Param("staffId") String staffId, @Param("storeIdList") List<String> storeIdList); List<StaffClerkRelationDTO> lisByStaffId(@Param("wxEnterpriseId") String wxEnterpriseId, @Param("staffId") String staffId, @Param("storeIdList") List<String> storeIdList);
StaffClerkRelationDTO getByCodeAndStoreId(@Param("clerkCode") String clerkCode, @Param("storeId") String storeId); //无效接口删除
// StaffClerkRelationDTO getByCodeAndStoreId(@Param("clerkCode") String clerkCode, @Param("storeId") String storeId);
List<String> listByWxEnterpriseId(@Param("wxEnterpriseId") String wxEnterpriseId); List<String> listByWxEnterpriseId(@Param("wxEnterpriseId") String wxEnterpriseId);
......
...@@ -22,7 +22,8 @@ public interface WxEnterpriseMapper { ...@@ -22,7 +22,8 @@ public interface WxEnterpriseMapper {
@Param("enterpriseIds") List<String> enterpriseIds, @Param("enterpriseIds") List<String> enterpriseIds,
@Param("gicContactFlag") Integer gicContactFlag, @Param("gicContactFlag") Integer gicContactFlag,
@Param("version") String version, @Param("version") String version,
@Param("enterpriseIdsNotIn") List<String> enterpriseIdsNotIn); @Param("enterpriseIdsNotIn") List<String> enterpriseIdsNotIn,
@Param("appType") Integer appType);
List<TabHaobanWxEnterprise> listAll(); List<TabHaobanWxEnterprise> listAll();
...@@ -77,4 +78,20 @@ public interface WxEnterpriseMapper { ...@@ -77,4 +78,20 @@ public interface WxEnterpriseMapper {
* @return * @return
*/ */
List<String> queryWxEnterpriseByEnterpriseId(@Param("enterpriseId") String enterpriseId); List<String> queryWxEnterpriseByEnterpriseId(@Param("enterpriseId") String enterpriseId);
/**
* 根据appidList查询appidList
*/
List<String> getWxAppidListByList(@Param("wxAppidList")List<String> wxAppidList);
/**
* 根据好办app类型所有企业微信
*
* @return
*/
List<TabHaobanWxEnterprise> listAllByWxSecurityType(@Param("wxSecurityType") Integer wxSecurityType);
void updateWxaAppid(@Param("wxEnterpriseId") String wxEnterpriseId,@Param("wxaAppid")String wxaAppid);
/**
* 根据是否配置回调地址查询所有企业微信
* @return
*/
List<String> listWxEnterpriseByCallbackFlag(@Param("callbackFlag")Integer callbackFlag);
} }
\ No newline at end of file
package com.gic.haoban.manage.service.entity;
import java.util.Date;
import java.io.Serializable;
/**
* (TabHaobanAppOrder)实体类
*
* @author makejava
* @since 2023-06-21 17:24:20
*/
public class TabHaobanAppOrder implements Serializable {
private static final long serialVersionUID = 863180181579186870L;
/**
* 主键id
*/
private Long id;
/**
* wx企业Id
*/
private String wxEnterpriseId;
/**
* 企业微信订单id
*/
private String orderId;
/**
* 订单状态1 - 待支付2 - 已支付3 - 订单取消4 - 支付过期5 - 退款申请中6 - 已退款7 - 交易完成8 - 待企业确认9 - 已部分退款
*/
private Integer orderStatus;
/**
* 订单类型 0 新购、1 扩容、2 续期
*/
private Integer orderType;
/**
* 购买人数
*/
private Integer userNum;
/**
* 购买时长
*/
private Integer duration;
/**
* 购买生效期的开始时间
*/
private Date beginTime;
/**
* 购买生效期的结束时间
*/
private Date endTime;
/**
* 支付时间
*/
private Date payTime;
/**
* 原价,单位分
*/
private Integer originPrice;
/**
* 折后价,单位分
*/
private Integer paidPrice;
/**
* 收款订单链接
*/
private String orderUrl;
/**
* 逻辑删除,0未删除,1删除
*/
private Integer deleteFlag;
/**
* 创建时间
*/
private Date createTime;
/**
* 更新时间
*/
private Date updateTime;
/**
* 创建人
*/
private String creatorId;
/**
* 创建人名称
*/
private String creatorName;
/**
* 订单支付到期时间
*/
private Date expireTime;
public Date getExpireTime() {
return expireTime;
}
public void setExpireTime(Date expireTime) {
this.expireTime = expireTime;
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getWxEnterpriseId() {
return wxEnterpriseId;
}
public void setWxEnterpriseId(String wxEnterpriseId) {
this.wxEnterpriseId = wxEnterpriseId;
}
public String getOrderId() {
return orderId;
}
public void setOrderId(String orderId) {
this.orderId = orderId;
}
public Integer getOrderStatus() {
return orderStatus;
}
public void setOrderStatus(Integer orderStatus) {
this.orderStatus = orderStatus;
}
public Integer getOrderType() {
return orderType;
}
public void setOrderType(Integer orderType) {
this.orderType = orderType;
}
public Integer getUserNum() {
return userNum;
}
public void setUserNum(Integer userNum) {
this.userNum = userNum;
}
public Integer getDuration() {
return duration;
}
public void setDuration(Integer duration) {
this.duration = duration;
}
public Date getBeginTime() {
return beginTime;
}
public void setBeginTime(Date beginTime) {
this.beginTime = beginTime;
}
public Date getEndTime() {
return endTime;
}
public void setEndTime(Date endTime) {
this.endTime = endTime;
}
public Date getPayTime() {
return payTime;
}
public void setPayTime(Date payTime) {
this.payTime = payTime;
}
public Integer getOriginPrice() {
return originPrice;
}
public void setOriginPrice(Integer originPrice) {
this.originPrice = originPrice;
}
public Integer getPaidPrice() {
return paidPrice;
}
public void setPaidPrice(Integer paidPrice) {
this.paidPrice = paidPrice;
}
public String getOrderUrl() {
return orderUrl;
}
public void setOrderUrl(String orderUrl) {
this.orderUrl = orderUrl;
}
public Integer getDeleteFlag() {
return deleteFlag;
}
public void setDeleteFlag(Integer deleteFlag) {
this.deleteFlag = deleteFlag;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
public String getCreatorId() {
return creatorId;
}
public void setCreatorId(String creatorId) {
this.creatorId = creatorId;
}
public String getCreatorName() {
return creatorName;
}
public void setCreatorName(String creatorName) {
this.creatorName = creatorName;
}
}
package com.gic.haoban.manage.service.entity;
import java.util.Date;
import java.io.Serializable;
/**
* (TabHaobanRenewalUser)实体类
*
* @author makejava
* @since 2023-06-08 15:11:49
*/
public class TabHaobanRenewalUser implements Serializable {
private static final long serialVersionUID = -16922328852683963L;
/**
* id
*/
private Long renewalId;
/**
* wx企业Id
*/
private String wxEnterpriseId;
/**
* 微信userId
*/
private String wxUserId;
/**
* 订单id
*/
private Long orderId;
/**
* 电话
*/
private String phone;
/**
* 名称
*/
private String name;
/**
* 职位
*/
private String postion;
/**
* 续期是否合法 0 否 1是
*/
private Integer invalidFlag;
/**
* 不合法错误码
*/
private String invalidCode;
/**
* 不合法错误描述
*/
private String invalidMsg;
/**
* 更新时间
*/
private Date updateTime;
/**
* 创建时间
*/
private Date createTime;
/**
* 逻辑删除,0未删除,1删除
*/
private Integer deleteFlag;
public Long getRenewalId() {
return renewalId;
}
public void setRenewalId(Long renewalId) {
this.renewalId = renewalId;
}
public String getWxEnterpriseId() {
return wxEnterpriseId;
}
public void setWxEnterpriseId(String wxEnterpriseId) {
this.wxEnterpriseId = wxEnterpriseId;
}
public String getWxUserId() {
return wxUserId;
}
public void setWxUserId(String wxUserId) {
this.wxUserId = wxUserId;
}
public Long getOrderId() {
return orderId;
}
public void setOrderId(Long orderId) {
this.orderId = orderId;
}
public String getPhone() {
return phone;
}
public void setPhone(String phone) {
this.phone = phone;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getPostion() {
return postion;
}
public void setPostion(String postion) {
this.postion = postion;
}
public Integer getInvalidFlag() {
return invalidFlag;
}
public void setInvalidFlag(Integer invalidFlag) {
this.invalidFlag = invalidFlag;
}
public String getInvalidCode() {
return invalidCode;
}
public void setInvalidCode(String invalidCode) {
this.invalidCode = invalidCode;
}
public String getInvalidMsg() {
return invalidMsg;
}
public void setInvalidMsg(String invalidMsg) {
this.invalidMsg = invalidMsg;
}
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Integer getDeleteFlag() {
return deleteFlag;
}
public void setDeleteFlag(Integer deleteFlag) {
this.deleteFlag = deleteFlag;
}
}
...@@ -93,6 +93,30 @@ public class TabHaobanWxEnterprise implements Serializable { ...@@ -93,6 +93,30 @@ public class TabHaobanWxEnterprise implements Serializable {
private String openCorpid ; private String openCorpid ;
private String wxaAppid ; private String wxaAppid ;
private String urlHost ; private String urlHost ;
/**
* 应用类型,0第三方 1自建
*/
private Integer appType;
/**
* 自建应用是否支持配置回调地址 0 不支持 1支持
*/
private Integer callbackFlag;
public Integer getCallbackFlag() {
return callbackFlag;
}
public void setCallbackFlag(Integer callbackFlag) {
this.callbackFlag = callbackFlag;
}
public Integer getAppType() {
return appType;
}
public void setAppType(Integer appType) {
this.appType = appType;
}
public String getUrlHost() { public String getUrlHost() {
return urlHost; return urlHost;
......
...@@ -49,6 +49,18 @@ public class TabHaobanWxEnterpriseActiveData implements Serializable { ...@@ -49,6 +49,18 @@ public class TabHaobanWxEnterpriseActiveData implements Serializable {
private Date updateTime; private Date updateTime;
private Integer deleteFlag; private Integer deleteFlag;
/**
* 已合并许可总数
*/
private Integer merged;
public Integer getMerged() {
return merged;
}
public void setMerged(Integer merged) {
this.merged = merged;
}
public Long getId() { public Long getId() {
return id; return id;
......
...@@ -64,6 +64,30 @@ public class StaffListBO implements Serializable { ...@@ -64,6 +64,30 @@ public class StaffListBO implements Serializable {
* 关联成员id数组 * 关联成员id数组
*/ */
private List<String> staffIds; private List<String> staffIds;
/**
* 许可到期时间区间查询
*/
private String startTime;
/**
* 许可到期时间区间查询
*/
private String endTime;
public String getStartTime() {
return startTime;
}
public void setStartTime(String startTime) {
this.startTime = startTime;
}
public String getEndTime() {
return endTime;
}
public void setEndTime(String endTime) {
this.endTime = endTime;
}
public List<String> getStaffIds() { public List<String> getStaffIds() {
return staffIds; return staffIds;
......
...@@ -98,4 +98,19 @@ public interface ExternalClerkRelatedService { ...@@ -98,4 +98,19 @@ public interface ExternalClerkRelatedService {
*/ */
List<TabHaobanExternalClerkRelated> queryClerkMemberRelations(String staffId, List<String> memberIds); List<TabHaobanExternalClerkRelated> queryClerkMemberRelations(String staffId, List<String> memberIds);
/**
* 查询企业微信下面,所有外部联系人是null的成员
* @param wxEnterpriseId
* @param enterpriseIdList
* @return
*/
List<String> listByWxEnterpriseId(String wxEnterpriseId,List<String> enterpriseIdList);
/**
* 删除企业微信下面,所有外部联系人是null的成员
* @param wxEnterpriseId
* @param enterpriseIdList
*/
void deleteByWxEnterpriseId(String wxEnterpriseId,List<String> enterpriseIdList);
} }
...@@ -134,6 +134,11 @@ public interface StaffService { ...@@ -134,6 +134,11 @@ public interface StaffService {
*/ */
Integer getOccupyNum(String wxEnterpriseId); Integer getOccupyNum(String wxEnterpriseId);
/**
* 查询即将过期的许可总数
*/
Integer getExpiringNum(String wxEnterpriseId);
/** /**
* 查询成员列表 * 查询成员列表
......
package com.gic.haoban.manage.service.service;
import com.gic.api.base.commons.Page;
import com.gic.haoban.manage.api.dto.licence.AppOrderPageDTO;
import com.gic.haoban.manage.api.dto.qdto.licence.AppOrderPageQDTO;
import com.gic.haoban.manage.service.entity.TabHaobanAppOrder;
import java.util.List;
/**
* (TabHaobanAppOrder)表服务接口
*
* @author makejava
* @since 2023-06-21 17:24:20
*/
public interface TabHaobanAppOrderService {
/**
* 通过ID查询单条数据
*
* @param id 主键
* @return 实例对象
*/
TabHaobanAppOrder queryById(Long id);
/**
* 新增数据
*
* @param tabHaobanAppOrder 实例对象
* @return 实例对象
*/
TabHaobanAppOrder insert(TabHaobanAppOrder tabHaobanAppOrder);
/**
* 批量新增数据
* @param entities
*/
void insertBatch(List<TabHaobanAppOrder> entities);
/**
* 修改数据
*
* @param tabHaobanAppOrder 实例对象
* @return 实例对象
*/
TabHaobanAppOrder update(TabHaobanAppOrder tabHaobanAppOrder);
/**
* 通过主键删除数据
*
* @param id 主键
* @return 是否成功
*/
boolean deleteById(Long id);
Page<AppOrderPageDTO> getAppOrderPage(AppOrderPageQDTO qdto);
/**
* 根据企业微信订单id查询
* @param orderId
* @return
*/
TabHaobanAppOrder queryByOrderId(String orderId);
}
package com.gic.haoban.manage.service.service;
import com.gic.api.base.commons.Page;
import com.gic.haoban.manage.api.dto.licence.RenewalUserDTO;
import com.gic.haoban.manage.api.dto.qdto.licence.RenewalUserQDTO;
import com.gic.haoban.manage.service.entity.TabHaobanRenewalUser;
import java.util.List;
/**
* (TabHaobanRenewalUser)表服务接口
*
* @author makejava
* @since 2023-06-08 15:11:49
*/
public interface TabHaobanRenewalUserService {
/**
* 通过ID查询单条数据
*
* @param renewalId 主键
* @return 实例对象
*/
TabHaobanRenewalUser queryById(Long renewalId);
/**
* 新增数据
*
* @param tabHaobanRenewalUser 实例对象
* @return 实例对象
*/
TabHaobanRenewalUser insert(TabHaobanRenewalUser tabHaobanRenewalUser);
void insertBatch(List<TabHaobanRenewalUser> tabHaobanRenewalUserList);
/**
* 修改数据
*
* @param tabHaobanRenewalUser 实例对象
* @return 实例对象
*/
TabHaobanRenewalUser update(TabHaobanRenewalUser tabHaobanRenewalUser);
/**
* 通过主键删除数据
*
* @param renewalId 主键
* @return 是否成功
*/
boolean deleteById(Long renewalId);
/**
* 分页查询续期成员列表
*
* @param qdto
* @return
*/
Page<RenewalUserDTO> getRenewalUserPage(RenewalUserQDTO qdto);
}
package com.gic.haoban.manage.service.service; package com.gic.haoban.manage.service.service;
import com.gic.haoban.manage.api.dto.StaffActiveDataDTO; import com.gic.haoban.manage.api.dto.StaffActiveDataDTO;
import com.gic.haoban.manage.service.entity.TabHaobanWxEnterpriseActiveData;
/** /**
* @description: 通讯录数据总览内部service * @description: 通讯录数据总览内部service
...@@ -17,4 +18,8 @@ public interface WxEnterpriseActiveDataService { ...@@ -17,4 +18,8 @@ public interface WxEnterpriseActiveDataService {
Integer saveOrUpdate(String wxEnterpriseId); Integer saveOrUpdate(String wxEnterpriseId);
StaffActiveDataDTO getWxEnterpriseActiveDataByWxEnterpriseId(String wxEnterpriseId); StaffActiveDataDTO getWxEnterpriseActiveDataByWxEnterpriseId(String wxEnterpriseId);
void updateByStaffActiveDataDTO(StaffActiveDataDTO dto);
void insert(TabHaobanWxEnterpriseActiveData data);
} }
...@@ -75,5 +75,28 @@ public interface WxEnterpriseService { ...@@ -75,5 +75,28 @@ public interface WxEnterpriseService {
* @return * @return
*/ */
List<String> queryWxEnterpriseWithEnterpriseId(String enterpriseId); List<String> queryWxEnterpriseWithEnterpriseId(String enterpriseId);
/**
* 根据appidList查询appidList
*/
List<String> getWxAppidListByList(List<String> wxAppidList);
/**
* 根据好办app类型所有企业微信
*
* @return
*/
List<TabHaobanWxEnterprise> listAllByWxSecurityType(Integer wxSecurityType);
/**
* 删除
* @param wxEnterpriseId
*/
void deleteByWxEnterpriseId(String wxEnterpriseId,String wxaAppid) ;
/**
* 根据是否配置回调地址查询所有企业微信
* @return
*/
List<String> listWxEnterpriseByCallbackFlag(Integer callbackFlag);
} }
...@@ -130,6 +130,14 @@ public class GroupChatHmServiceImpl implements GroupChatHmService { ...@@ -130,6 +130,14 @@ public class GroupChatHmServiceImpl implements GroupChatHmService {
return null; return null;
} }
this.updateLinkCount(hm.getWxEnterpriseId(), Arrays.asList(hmId)); this.updateLinkCount(hm.getWxEnterpriseId(), Arrays.asList(hmId));
String wxEnterpriseId = hm.getWxEnterpriseId(); ;
SecretSettingDTO secretSetting = secretSettingService.getSecretSetting(wxEnterpriseId, SecretTypeEnum.CUSTOMIZED_APP.getVal());
if (null != secretSetting && hm.getAutoCreateRoom() == 1) {
List<TabGroupChatHmRelation> chatRelation = this.groupChatHmRelationMapper.listByChatHmId(hmId);
if(CollectionUtils.isNotEmpty(chatRelation)) {
this.handleAutoCreateRoom(wxEnterpriseId, secretSetting.getSecretVal(), hm, chatRelation, null);
}
}
GroupChatHmBO bo = EntityUtil.changeEntityByJSON(GroupChatHmBO.class, hm); GroupChatHmBO bo = EntityUtil.changeEntityByJSON(GroupChatHmBO.class, hm);
return bo; return bo;
} }
...@@ -192,14 +200,16 @@ public class GroupChatHmServiceImpl implements GroupChatHmService { ...@@ -192,14 +200,16 @@ public class GroupChatHmServiceImpl implements GroupChatHmService {
String configId = hm.getWxConfigId(); String configId = hm.getWxConfigId();
ServiceResponse<AddJoinWayDTO> joinResp = this.qywxChatApiService.getJoinWay(qwDTO.getDkCorpid(), secret, ServiceResponse<AddJoinWayDTO> joinResp = this.qywxChatApiService.getJoinWay(qwDTO.getDkCorpid(), secret,
configId,qwDTO.getUrlHost()); configId,qwDTO.getUrlHost());
logger.info("查询群活码={}", JSON.toJSON(joinResp)); logger.info("处理群活码满-查询群活码={}", JSON.toJSON(joinResp));
if (joinResp.isSuccess()) { if (joinResp.isSuccess()) {
AddJoinWayDTO join = joinResp.getResult(); AddJoinWayDTO join = joinResp.getResult();
List<String> qwChatIdList = join.getChat_id_list(); List<String> qwChatIdList = join.getChat_id_list();
if (CollectionUtils.isNotEmpty(qwChatIdList)) { if (CollectionUtils.isNotEmpty(qwChatIdList)) {
if (qwChatIdList.size() == 1) { if (qwChatIdList.size() == 1) {
logger.info("只有1个群"); logger.info("只有1个群");
if(null != thisGroupChatId) {
this.saveChatFullNotice(wxEnterpriseId, thisGroupChatId); this.saveChatFullNotice(wxEnterpriseId, thisGroupChatId);
}
return; return;
} }
List<Long> chatIdList = chatRelation.stream().map(dto -> dto.getGroupChatId()) List<Long> chatIdList = chatRelation.stream().map(dto -> dto.getGroupChatId())
...@@ -211,7 +221,9 @@ public class GroupChatHmServiceImpl implements GroupChatHmService { ...@@ -211,7 +221,9 @@ public class GroupChatHmServiceImpl implements GroupChatHmService {
List<String> qwList = RolesListUtils.differenceList(qwChatIdList, hbIdList); List<String> qwList = RolesListUtils.differenceList(qwChatIdList, hbIdList);
if (qwChatIdList.size() == hbIdList.size() && CollectionUtils.isEmpty(qwList)) { if (qwChatIdList.size() == hbIdList.size() && CollectionUtils.isEmpty(qwList)) {
logger.info("群未变化"); logger.info("群未变化");
if(null != thisGroupChatId) {
this.saveChatFullNotice(wxEnterpriseId, thisGroupChatId); this.saveChatFullNotice(wxEnterpriseId, thisGroupChatId);
}
return; return;
} }
// 处理要踢的 // 处理要踢的
...@@ -255,7 +267,9 @@ public class GroupChatHmServiceImpl implements GroupChatHmService { ...@@ -255,7 +267,9 @@ public class GroupChatHmServiceImpl implements GroupChatHmService {
List<TabGroupChat> list = this.groupChatMapper.listByWxWxChatIdListDk(wxEnterpriseId, List<TabGroupChat> list = this.groupChatMapper.listByWxWxChatIdListDk(wxEnterpriseId,
qwChatIdList); qwChatIdList);
if (CollectionUtils.isEmpty(list) || list.size() != qwChatIdList.size()) { if (CollectionUtils.isEmpty(list) || list.size() != qwChatIdList.size()) {
if(null != thisGroupChatId) {
this.saveChatFullNotice(wxEnterpriseId, thisGroupChatId); this.saveChatFullNotice(wxEnterpriseId, thisGroupChatId);
}
logger.info("查询群列表空,或数量不一致,dkList={}", qwChatIdList); logger.info("查询群列表空,或数量不一致,dkList={}", qwChatIdList);
return; return;
} }
......
...@@ -189,6 +189,8 @@ public class GroupChatServiceImpl implements GroupChatService { ...@@ -189,6 +189,8 @@ public class GroupChatServiceImpl implements GroupChatService {
TabGroupChat groupChat = this.groupChatMapper.selectByWxChatId(wxEnterpriseId, wxChatId); TabGroupChat groupChat = this.groupChatMapper.selectByWxChatId(wxEnterpriseId, wxChatId);
if (null == groupChat) { if (null == groupChat) {
logger.info("群不存在"); logger.info("群不存在");
// 创建群
this.createChat(corpid, wxChatId);
return; return;
} }
TabChatNotice entity = new TabChatNotice(); TabChatNotice entity = new TabChatNotice();
...@@ -308,8 +310,8 @@ public class GroupChatServiceImpl implements GroupChatService { ...@@ -308,8 +310,8 @@ public class GroupChatServiceImpl implements GroupChatService {
this.updateGroupChatDetail(qwDTO, groupChatId, false); this.updateGroupChatDetail(qwDTO, groupChatId, false);
} }
if (type == 2) { if (type == 2) {
this.updateChatStatus(qwDTO, groupChatId);
this.updateGroupChatDetail(qwDTO, groupChatId, false); this.updateGroupChatDetail(qwDTO, groupChatId, false);
this.updateChatStatus(qwDTO, groupChatId);
} }
if (type == 3) { if (type == 3) {
this.updateGroupChatDetail(qwDTO, groupChatId, true); this.updateGroupChatDetail(qwDTO, groupChatId, true);
...@@ -1098,7 +1100,7 @@ public class GroupChatServiceImpl implements GroupChatService { ...@@ -1098,7 +1100,7 @@ public class GroupChatServiceImpl implements GroupChatService {
List<String> wxChatIdList = list.stream().map(dto -> dto.getWxChatId()).collect(Collectors.toList()); List<String> wxChatIdList = list.stream().map(dto -> dto.getWxChatId()).collect(Collectors.toList());
ServiceResponse<List<FailChatListDTO>> resp = this.qywxChatApiService.transfer(qwDTO.getThirdCorpid(), ServiceResponse<List<FailChatListDTO>> resp = this.qywxChatApiService.transfer(qwDTO.getThirdCorpid(),
qwDTO.getSelf3thSecret(), wxChatIdList, userid,qwDTO.isSelf(),qwDTO.getUrlHost()); qwDTO.getSelf3thSecret(), wxChatIdList, userid,qwDTO.isSelf(),qwDTO.getUrlHost());
logger.info("群继承,继承人={}", JSON.toJSONString(resp), userid); logger.info("群继承,继承人={},{}", JSON.toJSONString(resp), userid);
if (!resp.isSuccess()) { if (!resp.isSuccess()) {
return ServiceResponse.failure("9999", resp.getMessage()); return ServiceResponse.failure("9999", resp.getMessage());
} else { } else {
...@@ -1142,7 +1144,7 @@ public class GroupChatServiceImpl implements GroupChatService { ...@@ -1142,7 +1144,7 @@ public class GroupChatServiceImpl implements GroupChatService {
if (null == chat || chat.getTotalCount() < offNum) { if (null == chat || chat.getTotalCount() < offNum) {
continue; continue;
} }
if (chat.getOffTime().getTime() + 1000 * 60 * 60 * 8 < new Date().getTime()) { if (chat.getOffTime().getTime() + 1000 * 60 * 60 * 24 * 30 < new Date().getTime()) {
logger.info("超过8小时不重试groupChatId={}", groupChatId); logger.info("超过8小时不重试groupChatId={}", groupChatId);
continue; continue;
} }
......
...@@ -63,7 +63,12 @@ public class WxUserAddLogServiceImpl implements WxUserAddLogService { ...@@ -63,7 +63,12 @@ public class WxUserAddLogServiceImpl implements WxUserAddLogService {
entity.setAddChannel(0); entity.setAddChannel(0);
entity.setStatusFlag(1); entity.setStatusFlag(1);
entity.setStaffId(qdto.getStaffId()); entity.setStaffId(qdto.getStaffId());
entity.setStaffName(qdto.getStaffName()); //截取成员name
String staffName = qdto.getStaffName();
if (null != staffName && staffName.length()>32){
staffName = staffName.substring(0, 32);
}
entity.setStaffName(staffName);
entity.setAllDelFlag(0); entity.setAllDelFlag(0);
if (qdto.isDelFlag()) { if (qdto.isDelFlag()) {
TabWxUserAddLog logUser = this.wxUserAddLogMapper.selectNewLog(externalUserid, qdto.getStaffId()); TabWxUserAddLog logUser = this.wxUserAddLogMapper.selectNewLog(externalUserid, qdto.getStaffId());
......
...@@ -520,4 +520,14 @@ public class ExternalClerkRelatedServiceImpl implements ExternalClerkRelatedServ ...@@ -520,4 +520,14 @@ public class ExternalClerkRelatedServiceImpl implements ExternalClerkRelatedServ
} }
return this.mapper.queryClerkMemberRelations(staffId, memberIds); return this.mapper.queryClerkMemberRelations(staffId, memberIds);
} }
@Override
public List<String> listByWxEnterpriseId(String wxEnterpriseId, List<String> enterpriseIdList) {
return this.mapper.listByWxEnterpriseId(wxEnterpriseId,enterpriseIdList);
}
@Override
public void deleteByWxEnterpriseId(String wxEnterpriseId, List<String> enterpriseIdList) {
this.mapper.deleteByWxEnterpriseId(wxEnterpriseId,enterpriseIdList);
}
} }
package com.gic.haoban.manage.service.service.impl; package com.gic.haoban.manage.service.service.impl;
import java.util.Collection;
import java.util.Collections;
import java.util.Date;
import java.util.List;
import com.gic.haoban.manage.service.pojo.bo.StaffListBO;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
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 cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.gic.api.base.commons.ServiceResponse; 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.commons.util.UniqueIdUtils;
import com.gic.haoban.base.api.common.BasePageInfo;
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.config.Config;
...@@ -26,6 +14,7 @@ import com.gic.haoban.manage.service.dao.mapper.WxEnterpriseMapper; ...@@ -26,6 +14,7 @@ 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.TabHaobanWxEnterprise;
import com.gic.haoban.manage.service.entity.fee.TabHaobanQywxFeeAccountStaff; import com.gic.haoban.manage.service.entity.fee.TabHaobanQywxFeeAccountStaff;
import com.gic.haoban.manage.service.pojo.bo.StaffListBO;
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.haoban.manage.service.service.fee.HaobanQywxFeeAccountStaffService;
import com.gic.wechat.api.dto.qywx.fee.AccountListDTO; import com.gic.wechat.api.dto.qywx.fee.AccountListDTO;
...@@ -34,10 +23,16 @@ import com.gic.wechat.api.dto.qywx.fee.ActiveInfoUserResponseDTO; ...@@ -34,10 +23,16 @@ import com.gic.wechat.api.dto.qywx.fee.ActiveInfoUserResponseDTO;
import com.gic.wechat.api.service.qywx.QywxOrderApiService; import com.gic.wechat.api.service.qywx.QywxOrderApiService;
import com.gic.wechat.api.service.qywx.QywxUserApiService; import com.gic.wechat.api.service.qywx.QywxUserApiService;
import com.github.pagehelper.Page; import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper; import org.apache.commons.collections.CollectionUtils;
import com.github.pagehelper.PageInfo; import org.apache.commons.lang3.StringUtils;
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 cn.hutool.core.date.DateUtil; import java.util.Collections;
import java.util.Date;
import java.util.List;
@Service @Service
public class StaffServiceImpl implements StaffService { public class StaffServiceImpl implements StaffService {
...@@ -98,6 +93,13 @@ public class StaffServiceImpl implements StaffService { ...@@ -98,6 +93,13 @@ public class StaffServiceImpl implements StaffService {
String s = "ISNULL("+sortField+"),"+sortField; String s = "ISNULL("+sortField+"),"+sortField;
staffListBO.setSortField(s); staffListBO.setSortField(s);
} }
//时间处理
if (StrUtil.isNotBlank(staffListBO.getStartTime())) {
staffListBO.setStartTime(staffListBO.getStartTime() + " 00:00:00");
}
if (StrUtil.isNotBlank(staffListBO.getEndTime())) {
staffListBO.setEndTime(staffListBO.getEndTime() + " 23:59:59");
}
return mapper.pageStaff(staffListBO); return mapper.pageStaff(staffListBO);
} }
...@@ -200,6 +202,11 @@ public class StaffServiceImpl implements StaffService { ...@@ -200,6 +202,11 @@ public class StaffServiceImpl implements StaffService {
return mapper.getOccupyNum(wxEnterpriseId); return mapper.getOccupyNum(wxEnterpriseId);
} }
@Override
public Integer getExpiringNum(String wxEnterpriseId) {
return mapper.getExpiringNum(wxEnterpriseId);
}
private void listAccount(TabHaobanWxEnterprise wxEnterprise , int limit , String cursor) { private void listAccount(TabHaobanWxEnterprise wxEnterprise , int limit , String cursor) {
String wxEnterpriseId = wxEnterprise.getWxEnterpriseId() ; String wxEnterpriseId = wxEnterprise.getWxEnterpriseId() ;
String openCorpid = wxEnterprise.getOpenCorpid() ; String openCorpid = wxEnterprise.getOpenCorpid() ;
......
package com.gic.haoban.manage.service.service.impl;
import com.gic.api.base.commons.Page;
import com.gic.commons.util.PageHelperUtils;
import com.gic.haoban.manage.api.dto.licence.AppOrderPageDTO;
import com.gic.haoban.manage.api.dto.licence.RenewalUserDTO;
import com.gic.haoban.manage.api.dto.qdto.licence.AppOrderPageQDTO;
import com.gic.haoban.manage.service.entity.TabHaobanAppOrder;
import com.gic.haoban.manage.service.dao.mapper.TabHaobanAppOrderMapper;
import com.gic.haoban.manage.service.entity.TabHaobanRenewalUser;
import com.gic.haoban.manage.service.service.TabHaobanAppOrderService;
import com.github.pagehelper.PageHelper;
import org.springframework.stereotype.Service;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.PageRequest;
import javax.annotation.Resource;
import java.util.List;
/**
* (TabHaobanAppOrder)表服务实现类
*
* @author makejava
* @since 2023-06-21 17:24:20
*/
@Service("tabHaobanAppOrderService")
public class TabHaobanAppOrderServiceImpl implements TabHaobanAppOrderService {
@Resource
private TabHaobanAppOrderMapper tabHaobanAppOrderMapper;
/**
* 通过ID查询单条数据
*
* @param id 主键
* @return 实例对象
*/
@Override
public TabHaobanAppOrder queryById(Long id) {
return this.tabHaobanAppOrderMapper.queryById(id);
}
/**
* 新增数据
*
* @param tabHaobanAppOrder 实例对象
* @return 实例对象
*/
@Override
public TabHaobanAppOrder insert(TabHaobanAppOrder tabHaobanAppOrder) {
this.tabHaobanAppOrderMapper.insert(tabHaobanAppOrder);
return tabHaobanAppOrder;
}
@Override
public void insertBatch(List<TabHaobanAppOrder> entities) {
this.tabHaobanAppOrderMapper.insertBatch(entities);
}
/**
* 修改数据
*
* @param tabHaobanAppOrder 实例对象
* @return 实例对象
*/
@Override
public TabHaobanAppOrder update(TabHaobanAppOrder tabHaobanAppOrder) {
this.tabHaobanAppOrderMapper.update(tabHaobanAppOrder);
return this.queryById(tabHaobanAppOrder.getId());
}
/**
* 通过主键删除数据
*
* @param id 主键
* @return 是否成功
*/
@Override
public boolean deleteById(Long id) {
return this.tabHaobanAppOrderMapper.deleteById(id) > 0;
}
@Override
public Page<AppOrderPageDTO> getAppOrderPage(AppOrderPageQDTO qdto) {
if (qdto == null){
return null;
}
PageHelper.startPage(qdto);
List<TabHaobanAppOrder> page = tabHaobanAppOrderMapper.getAppOrderPage(qdto);
return PageHelperUtils.changePageHelperToCurrentPage(page, AppOrderPageDTO.class);
}
@Override
public TabHaobanAppOrder queryByOrderId(String orderId) {
return tabHaobanAppOrderMapper.queryByOrderId(orderId);
}
}
package com.gic.haoban.manage.service.service.impl;
import cn.hutool.core.collection.CollUtil;
import com.gic.api.base.commons.Page;
import com.gic.commons.util.PageHelperUtils;
import com.gic.haoban.manage.api.dto.licence.RenewalUserDTO;
import com.gic.haoban.manage.api.dto.qdto.licence.RenewalUserQDTO;
import com.gic.haoban.manage.service.dao.mapper.TabHaobanRenewalUserMapper;
import com.gic.haoban.manage.service.entity.TabHaobanRenewalUser;
import com.gic.haoban.manage.service.service.TabHaobanRenewalUserService;
import com.github.pagehelper.PageHelper;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
/**
* (TabHaobanRenewalUser)表服务实现类
*
* @author makejava
* @since 2023-06-08 15:11:49
*/
@Service("tabHaobanRenewalUserService")
public class TabHaobanRenewalUserServiceImpl implements TabHaobanRenewalUserService {
@Resource
private TabHaobanRenewalUserMapper tabHaobanRenewalUserMapper;
/**
* 通过ID查询单条数据
*
* @param renewalId 主键
* @return 实例对象
*/
@Override
public TabHaobanRenewalUser queryById(Long renewalId) {
return this.tabHaobanRenewalUserMapper.queryById(renewalId);
}
/**
* 新增数据
*
* @param tabHaobanRenewalUser 实例对象
* @return 实例对象
*/
@Override
public TabHaobanRenewalUser insert(TabHaobanRenewalUser tabHaobanRenewalUser) {
this.tabHaobanRenewalUserMapper.insert(tabHaobanRenewalUser);
return tabHaobanRenewalUser;
}
@Override
public void insertBatch(List<TabHaobanRenewalUser> tabHaobanRenewalUserList) {
if (CollUtil.isEmpty(tabHaobanRenewalUserList)) {
return;
}
this.tabHaobanRenewalUserMapper.insertBatch(tabHaobanRenewalUserList);
}
/**
* 修改数据
*
* @param tabHaobanRenewalUser 实例对象
* @return 实例对象
*/
@Override
public TabHaobanRenewalUser update(TabHaobanRenewalUser tabHaobanRenewalUser) {
this.tabHaobanRenewalUserMapper.update(tabHaobanRenewalUser);
return this.queryById(tabHaobanRenewalUser.getRenewalId());
}
/**
* 通过主键删除数据
*
* @param renewalId 主键
* @return 是否成功
*/
@Override
public boolean deleteById(Long renewalId) {
return this.tabHaobanRenewalUserMapper.deleteById(renewalId) > 0;
}
@Override
public Page<RenewalUserDTO> getRenewalUserPage(RenewalUserQDTO qdto) {
PageHelper.startPage(qdto);
List<TabHaobanRenewalUser> page = tabHaobanRenewalUserMapper.getRenewalUserPage(qdto);
return PageHelperUtils.changePageHelperToCurrentPage(page, RenewalUserDTO.class);
}
}
...@@ -158,7 +158,9 @@ public class WelcomeSendServiceImpl implements WelcomeSendService { ...@@ -158,7 +158,9 @@ public class WelcomeSendServiceImpl implements WelcomeSendService {
String content = welcomeBO.getWelcomeContent(); String content = welcomeBO.getWelcomeContent();
if (content.contains("<微信昵称>")) { if (content.contains("<微信昵称>")) {
String nickName = this.getExternalUserName(qwDTO, externalUserId); String nickName = this.getExternalUserName(qwDTO, externalUserId);
nickName = nickName.replaceAll("\\$","RDS_CHAR_DOLLAR");// encode replacement;
content = content.replaceAll("<微信昵称>", nickName); content = content.replaceAll("<微信昵称>", nickName);
content = content.replaceAll("RDS_CHAR_DOLLAR","\\$");// decode replacement;
} }
QywxWelcomeMsgDTO qywxWelcomeMsgDTO = new QywxWelcomeMsgDTO(); QywxWelcomeMsgDTO qywxWelcomeMsgDTO = new QywxWelcomeMsgDTO();
// 欢迎语内容 // 欢迎语内容
......
...@@ -49,7 +49,7 @@ public class WxEnterpriseActiveDataServiceImpl implements WxEnterpriseActiveData ...@@ -49,7 +49,7 @@ public class WxEnterpriseActiveDataServiceImpl implements WxEnterpriseActiveData
return 0; return 0;
} }
//初始化各状态 //初始化各状态
Integer purchased = 0, used = 0, inactive = 0, transfer = 0, activated = 0, expired = 0; Integer purchased = 0, used = 0, inactive = 0, transfer = 0, activated = 0, expired = 0,merged = 0;
for (HashMap<String, Integer> map : feeOrderAccountMapList) { for (HashMap<String, Integer> map : feeOrderAccountMapList) {
switch (map.get("status")) { switch (map.get("status")) {
case 1: case 1:
...@@ -70,7 +70,9 @@ public class WxEnterpriseActiveDataServiceImpl implements WxEnterpriseActiveData ...@@ -70,7 +70,9 @@ public class WxEnterpriseActiveDataServiceImpl implements WxEnterpriseActiveData
transfer += Integer.valueOf(String.valueOf(map.get("num"))); transfer += Integer.valueOf(String.valueOf(map.get("num")));
break; break;
case 5: case 5:
//已合并的激活码
purchased += Integer.valueOf(String.valueOf(map.get("num"))); purchased += Integer.valueOf(String.valueOf(map.get("num")));
merged += Integer.valueOf(String.valueOf(map.get("num")));
break; break;
default: default:
break; break;
...@@ -87,6 +89,7 @@ public class WxEnterpriseActiveDataServiceImpl implements WxEnterpriseActiveData ...@@ -87,6 +89,7 @@ public class WxEnterpriseActiveDataServiceImpl implements WxEnterpriseActiveData
tabHaobanWxEnterpriseActiveData.setUsed(used); tabHaobanWxEnterpriseActiveData.setUsed(used);
tabHaobanWxEnterpriseActiveData.setTransfer(transfer); tabHaobanWxEnterpriseActiveData.setTransfer(transfer);
tabHaobanWxEnterpriseActiveData.setExpired(expired); tabHaobanWxEnterpriseActiveData.setExpired(expired);
tabHaobanWxEnterpriseActiveData.setMerged(merged);
return tabHaobanWxEnterpriseActiveDataMapper.updateActiveDataByWxEnterpriseId(tabHaobanWxEnterpriseActiveData); return tabHaobanWxEnterpriseActiveDataMapper.updateActiveDataByWxEnterpriseId(tabHaobanWxEnterpriseActiveData);
} else { } else {
//新增 //新增
...@@ -99,6 +102,7 @@ public class WxEnterpriseActiveDataServiceImpl implements WxEnterpriseActiveData ...@@ -99,6 +102,7 @@ public class WxEnterpriseActiveDataServiceImpl implements WxEnterpriseActiveData
tabHaobanWxEnterpriseActiveData.setUsed(used); tabHaobanWxEnterpriseActiveData.setUsed(used);
tabHaobanWxEnterpriseActiveData.setExpired(expired); tabHaobanWxEnterpriseActiveData.setExpired(expired);
tabHaobanWxEnterpriseActiveData.setTransfer(transfer); tabHaobanWxEnterpriseActiveData.setTransfer(transfer);
tabHaobanWxEnterpriseActiveData.setMerged(merged);
return tabHaobanWxEnterpriseActiveDataMapper.insert(tabHaobanWxEnterpriseActiveData); return tabHaobanWxEnterpriseActiveDataMapper.insert(tabHaobanWxEnterpriseActiveData);
} }
} }
...@@ -115,6 +119,28 @@ public class WxEnterpriseActiveDataServiceImpl implements WxEnterpriseActiveData ...@@ -115,6 +119,28 @@ public class WxEnterpriseActiveDataServiceImpl implements WxEnterpriseActiveData
Integer occupy=0; Integer occupy=0;
occupy=staffService.getOccupyNum(wxEnterpriseId); occupy=staffService.getOccupyNum(wxEnterpriseId);
staffActiveDataDTO.setOccupy(occupy); staffActiveDataDTO.setOccupy(occupy);
//查询即将过期的许可总数
Integer expiringNum = 0;
expiringNum = staffService.getExpiringNum(wxEnterpriseId);
staffActiveDataDTO.setExpiring(expiringNum);
return staffActiveDataDTO; return staffActiveDataDTO;
} }
@Override
public void updateByStaffActiveDataDTO(StaffActiveDataDTO dto) {
if (null == dto){
return;
}
TabHaobanWxEnterpriseActiveData tabHaobanWxEnterpriseActiveData = EntityUtil.changeEntityByJSON(TabHaobanWxEnterpriseActiveData.class, dto);
tabHaobanWxEnterpriseActiveDataMapper.updateActiveDataByWxEnterpriseId(tabHaobanWxEnterpriseActiveData);
}
@Override
public void insert(TabHaobanWxEnterpriseActiveData data) {
if(null == data){
log.info("新增许可账号统计参数不能为空!");
return;
}
tabHaobanWxEnterpriseActiveDataMapper.insert(data);
}
} }
...@@ -7,6 +7,7 @@ import java.util.HashMap; ...@@ -7,6 +7,7 @@ import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import cn.hutool.core.collection.CollUtil;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.LogManager;
...@@ -292,4 +293,27 @@ public class WxEnterpriseServiceImpl implements WxEnterpriseService { ...@@ -292,4 +293,27 @@ public class WxEnterpriseServiceImpl implements WxEnterpriseService {
} }
return this.mapper.queryWxEnterpriseByEnterpriseId(enterpriseId); return this.mapper.queryWxEnterpriseByEnterpriseId(enterpriseId);
} }
@Override
public List<String> getWxAppidListByList(List<String> wxAppidList) {
if (CollUtil.isEmpty(wxAppidList)){
return Collections.emptyList();
}
return this.mapper.getWxAppidListByList(wxAppidList);
}
@Override
public List<TabHaobanWxEnterprise> listAllByWxSecurityType(Integer wxSecurityType) {
return this.mapper.listAllByWxSecurityType(wxSecurityType);
}
@Override
public void deleteByWxEnterpriseId(String wxEnterpriseId,String wxaAppid) {
this.mapper.updateWxaAppid(wxEnterpriseId,wxaAppid);
}
@Override
public List<String> listWxEnterpriseByCallbackFlag(Integer callbackFlag) {
return this.mapper.listWxEnterpriseByCallbackFlag(callbackFlag);
}
} }
...@@ -117,7 +117,7 @@ public interface LicenceOrderService { ...@@ -117,7 +117,7 @@ public interface LicenceOrderService {
/** /**
* 查询订单编号id * 查询订单编号id
* @param param 查询参数 * @param param 查询参数
* @param type 0 微信订单编号 1 企业微信订单编号 * @param type 0 订单编号 1 企业微信订单编号 2微信订单编号 3付费应用企业微信订单编号
* @param wxEnterpriseId * @param wxEnterpriseId
* @return * @return
*/ */
......
...@@ -19,6 +19,7 @@ import com.gic.haoban.manage.api.dto.qdto.licence.LicenceOrderPageQDTO; ...@@ -19,6 +19,7 @@ import com.gic.haoban.manage.api.dto.qdto.licence.LicenceOrderPageQDTO;
import com.gic.haoban.manage.api.dto.qdto.licence.LicenceOrderQDTO; import com.gic.haoban.manage.api.dto.qdto.licence.LicenceOrderQDTO;
import com.gic.haoban.manage.api.service.WxEnterpriseApiService; import com.gic.haoban.manage.api.service.WxEnterpriseApiService;
import com.gic.haoban.manage.service.config.Config; import com.gic.haoban.manage.service.config.Config;
import com.gic.haoban.manage.service.dao.mapper.TabHaobanAppOrderMapper;
import com.gic.haoban.manage.service.dao.mapper.licence.TabHaobanLicenceOrderMapper; import com.gic.haoban.manage.service.dao.mapper.licence.TabHaobanLicenceOrderMapper;
import com.gic.haoban.manage.service.dao.mapper.licence.TabHaobanLicenceOrderProgressMapper; import com.gic.haoban.manage.service.dao.mapper.licence.TabHaobanLicenceOrderProgressMapper;
import com.gic.haoban.manage.service.entity.licence.TabHaobanLicenceOrder; import com.gic.haoban.manage.service.entity.licence.TabHaobanLicenceOrder;
...@@ -61,6 +62,8 @@ public class LicenceOrderServiceImpl implements LicenceOrderService { ...@@ -61,6 +62,8 @@ public class LicenceOrderServiceImpl implements LicenceOrderService {
private ClerkService clerkService; private ClerkService clerkService;
@Autowired @Autowired
private Config config; private Config config;
@Autowired
private TabHaobanAppOrderMapper tabHaobanAppOrderMapper;
@Override @Override
public TabHaobanLicenceOrder getLicenceOrderDetail(Long orderId) { public TabHaobanLicenceOrder getLicenceOrderDetail(Long orderId) {
...@@ -258,8 +261,11 @@ public class LicenceOrderServiceImpl implements LicenceOrderService { ...@@ -258,8 +261,11 @@ public class LicenceOrderServiceImpl implements LicenceOrderService {
result = tabHaobanLicenceOrderMapper.getTransactionIdList(param,wxEnterpriseId); result = tabHaobanLicenceOrderMapper.getTransactionIdList(param,wxEnterpriseId);
}else if(type == 1){ }else if(type == 1){
result = tabHaobanLicenceOrderMapper.getQywxOrderId(param,wxEnterpriseId); result = tabHaobanLicenceOrderMapper.getQywxOrderId(param,wxEnterpriseId);
}else { }else if (type == 2){
result = tabHaobanLicenceOrderMapper.getWxOrderId(param,wxEnterpriseId); result = tabHaobanLicenceOrderMapper.getWxOrderId(param,wxEnterpriseId);
}else if (type == 3){
//查询付费应用企业微信订单id
result = tabHaobanAppOrderMapper.getQywxOrderId(param, wxEnterpriseId);
} }
return result; return result;
} }
......
...@@ -132,7 +132,8 @@ public class AuditApiServiceImpl implements AuditApiService { ...@@ -132,7 +132,8 @@ public class AuditApiServiceImpl implements AuditApiService {
//门店导购绑定 //门店导购绑定
String oldValue = tab.getOldValue(); String oldValue = tab.getOldValue();
AuditStaffDTO obj = JSONObject.parseObject(oldValue, AuditStaffDTO.class); AuditStaffDTO obj = JSONObject.parseObject(oldValue, AuditStaffDTO.class);
StaffClerkRelationDTO staffClerkRelation = staffClerkRelationApiService.getByCodeAndEnterpriseId(obj.getClerkCode(), tab.getEnterpriseId()); //统一替换导购code
StaffClerkRelationDTO staffClerkRelation = staffClerkRelationApiService.getByCodeAndEnterpriseId(obj.getClerkId(), tab.getEnterpriseId());
String staffId = obj.getStaffId(); String staffId = obj.getStaffId();
String storeId = tab.getCommitStoreId(); String storeId = tab.getCommitStoreId();
String clerkId = obj.getClerkId(); String clerkId = obj.getClerkId();
......
...@@ -133,6 +133,45 @@ public class DealSyncOperationApiServiceImpl implements DealSyncOperationApiServ ...@@ -133,6 +133,45 @@ public class DealSyncOperationApiServiceImpl implements DealSyncOperationApiServ
} }
} }
@Override
public void departmentDealMq2(String params) {
DealParamMqDTO dealParamMqDTO = JSONObject.parseObject(params, DealParamMqDTO.class);
TabHaobanPreDealLog dataPre = preDealService.getByDataId(dealParamMqDTO.getTaskId(), dealParamMqDTO.getData(), dealParamMqDTO.getType() - 1, PreDealStatusEnum.all.getVal());
logger.info("好办同步处理mq处理开始:{},dataPre={}", params,JSON.toJSONString(dataPre));
if (dataPre == null) {
return;
}
Integer dataType = dataPre.getDataType();
logger.info("同步类型,dataType:{}",dataType);
if (dataType.equals(PreDealTypeEnum.dept.getVal())) {
logger.info("0 部门处理:{}", params);
operationMap.get("qywxDeptSyncOperation").dealSingleByMq(dealParamMqDTO, dataPre);
} else if (dataType.equals(PreDealTypeEnum.clerk.getVal())) {
logger.info("2 成员处理:{}", params);
operationMap.get("qywxStaffSyncOperation").dealSingleByMq(dealParamMqDTO, dataPre);
} else if (dataType.equals(PreDealTypeEnum.friend_clerk.getVal())) {
logger.info("6 好友导购处理:{}", params);
operationMap.get("friendClerkSyncNewOperation").dealSingleByMq(dealParamMqDTO, dataPre);
} else if (dataType.equals(PreDealTypeEnum.friend.getVal())) {
logger.info("8 第三方好友处理:{}", params);
operationMap.get("friendSyncNewOperation").dealSingleByMq(dealParamMqDTO, dataPre);
} else if (dataType.equals(PreDealTypeEnum.self_friend.getVal())) {
logger.info("7 自建好友处理:{}", params);
operationMap.get("selfFriendSyncNewOperation").dealSingleByMq(dealParamMqDTO, dataPre);
} else if (dataType.equals(PreDealTypeEnum.tag.getVal())) {
logger.info("10 会员标签处理:{}", params);
operationMap.get("friendTagSyncOperation").dealSingleByMq(dealParamMqDTO, dataPre);
} else if (dataType.equals(PreDealTypeEnum.tag_member.getVal())) {
logger.info("11 会员标签处理标签项:{}", params);
operationMap.get("friendMemberTagSyncOperation").dealSingleByMq(dealParamMqDTO, dataPre);
} else if(dataType.equals(PreDealTypeEnum.modify_hm.getVal())) {
logger.info("20 活码批量修改");
operationMap.get("qwHmOperation").dealSingleByMq(dealParamMqDTO, dataPre);
}else {
logger.info("不是正常数据类型:{}", params);
}
}
@Override @Override
public void dealDepartment(String taskId, String wxEnterpriseId public void dealDepartment(String taskId, String wxEnterpriseId
......
...@@ -329,6 +329,9 @@ public class ExternalClerkRelatedApiServiceImpl implements ExternalClerkRelatedA ...@@ -329,6 +329,9 @@ public class ExternalClerkRelatedApiServiceImpl implements ExternalClerkRelatedA
@Override @Override
public ExternalClerkRelatedDTO getExternalClerkByWxUserIdAncExternalUserId(String wxEnterpriseId, String staffId, String enterpriseId, String externalUserId) { public ExternalClerkRelatedDTO getExternalClerkByWxUserIdAncExternalUserId(String wxEnterpriseId, String staffId, String enterpriseId, String externalUserId) {
TabHaobanExternalClerkRelated externalClerkRelated = tabHaobanExternalClerkRelatedMapper.getExternalClerkByWxUserIdAncExternalUserId(wxEnterpriseId, staffId, enterpriseId, externalUserId); TabHaobanExternalClerkRelated externalClerkRelated = tabHaobanExternalClerkRelatedMapper.getExternalClerkByWxUserIdAncExternalUserId(wxEnterpriseId, staffId, enterpriseId, externalUserId);
if(null == externalClerkRelated) {
externalClerkRelated = this.tabHaobanExternalClerkRelatedMapper.getExternalClerkByWxUserIdAncExternalUserIdSelf(wxEnterpriseId, staffId, enterpriseId, externalUserId) ;
}
return EntityUtil.changeEntityNew(ExternalClerkRelatedDTO.class, externalClerkRelated); return EntityUtil.changeEntityNew(ExternalClerkRelatedDTO.class, externalClerkRelated);
} }
...@@ -380,7 +383,19 @@ public class ExternalClerkRelatedApiServiceImpl implements ExternalClerkRelatedA ...@@ -380,7 +383,19 @@ public class ExternalClerkRelatedApiServiceImpl implements ExternalClerkRelatedA
if (StringUtils.isBlank(memberId)) { if (StringUtils.isBlank(memberId)) {
return null; return null;
} }
return tabHaobanExternalClerkRelatedMapper.listStoreIdByMemberId(memberId); return tabHaobanExternalClerkRelatedMapper.listStoreIdByMemberId(memberId , null);
}
@Override
public List<String> listStoreIdByMemberId(String memberId, Date endTime) {
if (StringUtils.isBlank(memberId)) {
return null;
}
if(null == endTime) {
return this.listStoreIdByMemberId(memberId) ;
}
String addCreateTime = String.valueOf(endTime.getTime()/1000) ;
return tabHaobanExternalClerkRelatedMapper.listStoreIdByMemberId(memberId , addCreateTime);
} }
@Override @Override
......
...@@ -779,6 +779,10 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA ...@@ -779,6 +779,10 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA
TabHaobanExternalClerkRelated exsitDTO = externalList.get(0); TabHaobanExternalClerkRelated exsitDTO = externalList.get(0);
log.info("更新好友表,{},{}",exsitDTO.getExternalUserId(),exsitDTO.getStatusFlag()); log.info("更新好友表,{},{}",exsitDTO.getExternalUserId(),exsitDTO.getStatusFlag());
if(exsitDTO.getStatusFlag()==1) { if(exsitDTO.getStatusFlag()==1) {
if(StringUtils.isEmpty(exsitDTO.getSelfExternalUserid())) {
exsitDTO.setSelfExternalUserid(dto.getSelfExternalUserid());
this.externalClerkRelatedService.update(exsitDTO);
}
return ; return ;
} }
exsitDTO.setMemberUnionidRelatedId(memberUnionidRelatedId); exsitDTO.setMemberUnionidRelatedId(memberUnionidRelatedId);
...@@ -789,6 +793,9 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA ...@@ -789,6 +793,9 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA
exsitDTO.setStoreId(storeId); exsitDTO.setStoreId(storeId);
exsitDTO.setClerkId(clerkId); exsitDTO.setClerkId(clerkId);
exsitDTO.setEnterpriseId(enterpriseId); exsitDTO.setEnterpriseId(enterpriseId);
if(StringUtils.isNotEmpty(dto.getSelfExternalUserid())) {
exsitDTO.setSelfExternalUserid(dto.getSelfExternalUserid());
}
if(StringUtils.isNotBlank(exsitDTO.getMemberId()) && exsitDTO.getStatusFlag() != 1) { if(StringUtils.isNotBlank(exsitDTO.getMemberId()) && exsitDTO.getStatusFlag() != 1) {
exsitDTO.setStatusFlag(1); exsitDTO.setStatusFlag(1);
} }
......
...@@ -170,12 +170,19 @@ public class StaffClerkRelationApiServiceImpl implements StaffClerkRelationApiSe ...@@ -170,12 +170,19 @@ public class StaffClerkRelationApiServiceImpl implements StaffClerkRelationApiSe
@Override @Override
public ServiceResponse bindStaffClerk(StaffClerkRelationDTO staffClerkRelationDTO, String optStaffId, int channelCode) { public ServiceResponse bindStaffClerk(StaffClerkRelationDTO staffClerkRelationDTO, String optStaffId, int channelCode) {
//加锁防止并发问题
String clerkId = staffClerkRelationDTO.getClerkId();
String storeId = staffClerkRelationDTO.getStoreId();
String key = "haoban_bind_staff:" + clerkId+":"+storeId;
RedisUtil.lock(key, 6L);
ServiceResponse resp = this.bindCheck(staffClerkRelationDTO, optStaffId, channelCode); ServiceResponse resp = this.bindCheck(staffClerkRelationDTO, optStaffId, channelCode);
if (resp != null && !resp.isSuccess()) { if (resp != null && !resp.isSuccess()) {
logger.error("不允许绑定:{}", resp.getMessage()); logger.error("不允许绑定:{}", resp.getMessage());
RedisUtil.unlock(key);
return resp; return resp;
} }
String relationId = staffClerkRelationService.bind(staffClerkRelationDTO, optStaffId, channelCode); String relationId = staffClerkRelationService.bind(staffClerkRelationDTO, optStaffId, channelCode);
RedisUtil.unlock(key);
return ServiceResponse.success(relationId); return ServiceResponse.success(relationId);
} }
...@@ -500,9 +507,10 @@ public class StaffClerkRelationApiServiceImpl implements StaffClerkRelationApiSe ...@@ -500,9 +507,10 @@ public class StaffClerkRelationApiServiceImpl implements StaffClerkRelationApiSe
} }
} else if (type == 2) { } else if (type == 2) {
logger.info("导购门店转移,新的导购和门店,clerkId={},storeId={}", clerkId, clerkSyncQDTO.getStoreId()); logger.info("导购门店转移,新的导购和门店,clerkId={},storeId={}", clerkId, clerkSyncQDTO.getStoreId());
StaffClerkRelationDTO oldRelationDTO = staffClerkRelationService.getStaffClerkRelationDTO(clerkCode, enterpriseId); //统一处理:导购code替换为导购id
StaffClerkRelationDTO oldRelationDTO = staffClerkRelationService.getStaffClerkRelationDTO(oldClerkId, enterpriseId);
if (null == oldRelationDTO) { if (null == oldRelationDTO) {
logger.info("导购未关联成员,clerkCode={}", clerkCode); logger.info("导购未关联成员,oldClerkId={}", oldClerkId);
return; return;
} }
/* StaffClerkRelationDTO oldRelationDTO = staffClerkRelationService.getByClerkId(oldClerkId); /* StaffClerkRelationDTO oldRelationDTO = staffClerkRelationService.getByClerkId(oldClerkId);
......
package com.gic.haoban.manage.service.service.out.impl; package com.gic.haoban.manage.service.service.out.impl;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.gic.api.base.commons.ServiceResponse; import com.gic.api.base.commons.ServiceResponse;
import com.gic.commons.util.DateUtil; import com.gic.commons.util.DateUtil;
...@@ -21,6 +23,8 @@ import com.gic.haoban.manage.service.dao.mapper.WxEnterpriseRelatedMapper; ...@@ -21,6 +23,8 @@ import com.gic.haoban.manage.service.dao.mapper.WxEnterpriseRelatedMapper;
import com.gic.haoban.manage.service.entity.*; import com.gic.haoban.manage.service.entity.*;
import com.gic.haoban.manage.service.pojo.bo.StaffPrivacyUseLogBO; import com.gic.haoban.manage.service.pojo.bo.StaffPrivacyUseLogBO;
import com.gic.haoban.manage.service.service.*; import com.gic.haoban.manage.service.service.*;
import com.gic.operating.api.dto.HaobanWxEnterpriseDTO;
import com.gic.operating.api.service.HaobanWxEnterpriseApiService;
import com.gic.wechat.api.service.qywx.QywxUserApiService; 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;
...@@ -63,6 +67,8 @@ public class WxEnterpriseApiServiceImpl implements WxEnterpriseApiService { ...@@ -63,6 +67,8 @@ public class WxEnterpriseApiServiceImpl implements WxEnterpriseApiService {
private HaobanCommonMQApiService haobanCommonMQApiService ; private HaobanCommonMQApiService haobanCommonMQApiService ;
@Autowired @Autowired
private HaobanRoleApiService haobanRoleApiService; private HaobanRoleApiService haobanRoleApiService;
@Autowired
private HaobanWxEnterpriseApiService haobanWxEnterpriseApiService;
@Override @Override
...@@ -192,10 +198,11 @@ public class WxEnterpriseApiServiceImpl implements WxEnterpriseApiService { ...@@ -192,10 +198,11 @@ public class WxEnterpriseApiServiceImpl implements WxEnterpriseApiService {
@Override @Override
public com.gic.api.base.commons.Page<YwWxEnterpriseDTO> list(BasePageInfo pageInfo, String keyword, public com.gic.api.base.commons.Page<YwWxEnterpriseDTO> list(BasePageInfo pageInfo, String keyword,
List<String> enterpriseIds, Integer gicContactFlag, String version, List<String> enterpriseIdsNotIn, List<String> enterpriseIds, Integer gicContactFlag, String version, List<String> enterpriseIdsNotIn,
String loginUserId) { String loginUserId,Integer appType) {
PageHelper.startPage(pageInfo.getPageNum(), pageInfo.getPageSize()); PageHelper.startPage(pageInfo.getPageNum(), pageInfo.getPageSize());
Page<TabHaobanWxEnterprise> page = wxEnterpriseMapper.list(keyword, enterpriseIds, gicContactFlag, version, Page<TabHaobanWxEnterprise> page = wxEnterpriseMapper.list(keyword, enterpriseIds, gicContactFlag, version,
enterpriseIdsNotIn); enterpriseIdsNotIn,appType);
log.info("微信企业信息列表查询数据:{}",JSON.toJSONString(page));
// 数据转换+白名单过滤 // 数据转换+白名单过滤
if (Objects.isNull(page) || CollectionUtils.isEmpty(page.getResult())) { if (Objects.isNull(page) || CollectionUtils.isEmpty(page.getResult())) {
com.gic.api.base.commons.Page<Object> objectPage = new com.gic.api.base.commons.Page<>(); com.gic.api.base.commons.Page<Object> objectPage = new com.gic.api.base.commons.Page<>();
...@@ -206,6 +213,7 @@ public class WxEnterpriseApiServiceImpl implements WxEnterpriseApiService { ...@@ -206,6 +213,7 @@ public class WxEnterpriseApiServiceImpl implements WxEnterpriseApiService {
} }
com.gic.api.base.commons.Page<YwWxEnterpriseDTO> resPage = PageUtil.changePageHelperToCurrentPage(page, com.gic.api.base.commons.Page<YwWxEnterpriseDTO> resPage = PageUtil.changePageHelperToCurrentPage(page,
YwWxEnterpriseDTO.class); YwWxEnterpriseDTO.class);
log.info("微信企业信息列表查询数据:{}",JSON.toJSONString(resPage));
boolean matchOperId = matchOperId(loginUserId); boolean matchOperId = matchOperId(loginUserId);
resPage.getResult().forEach(one -> { resPage.getResult().forEach(one -> {
if (matchOperId) { if (matchOperId) {
...@@ -247,6 +255,13 @@ public class WxEnterpriseApiServiceImpl implements WxEnterpriseApiService { ...@@ -247,6 +255,13 @@ public class WxEnterpriseApiServiceImpl implements WxEnterpriseApiService {
public WxEnterpriseDTO getOne(String wxEnterpriseId) { public WxEnterpriseDTO getOne(String wxEnterpriseId) {
TabHaobanWxEnterprise tab = wxEnterpriseMapper.selectByPrimaryKey(wxEnterpriseId); TabHaobanWxEnterprise tab = wxEnterpriseMapper.selectByPrimaryKey(wxEnterpriseId);
WxEnterpriseDTO wxDTO = EntityUtil.changeEntityByJSON(WxEnterpriseDTO.class, tab); WxEnterpriseDTO wxDTO = EntityUtil.changeEntityByJSON(WxEnterpriseDTO.class, tab);
//查询secret表信息
SecretSettingDTO secretSetting = secretSettingService.getSecretSetting(wxEnterpriseId, SecretTypeEnum.SELF_APP.getVal());
if (null != secretSetting){
wxDTO.setAgentId(secretSetting.getAgentId());
wxDTO.setAgentName(secretSetting.getAgentName());
wxDTO.setSecretVal(secretSetting.getSecretVal());
}
return wxDTO; return wxDTO;
} }
...@@ -513,4 +528,88 @@ public class WxEnterpriseApiServiceImpl implements WxEnterpriseApiService { ...@@ -513,4 +528,88 @@ public class WxEnterpriseApiServiceImpl implements WxEnterpriseApiService {
} }
return "好办服务已到期" ; return "好办服务已到期" ;
} }
@Override
public ServiceResponse<Boolean> saveOrUpdate(WxEnterpriseDTO enterpriseDTO) {
if (null == enterpriseDTO){
return ServiceResponse.failure("-9999","参数不能为空!");
}
//wxAppid是唯一的,不能重复
String wxaAppid = enterpriseDTO.getWxaAppid();
WxEnterpriseDTO wxEnterpriseDTO = this.selectByWxaAppid(wxaAppid);
if (StrUtil.isBlank(enterpriseDTO.getWxEnterpriseId())){
if (null != wxEnterpriseDTO){
return ServiceResponse.failure("-9999","自建小程序的appid存在重复!");
}
//默认是自建应用
enterpriseDTO.setWxSecurityType(5);
String wxEnterpriseId = wxEnterpriseService.add(enterpriseDTO);
//同步新增
Date now = new Date();
haobanWxEnterpriseApiService.saveOrUpdate(wxEnterpriseId,enterpriseDTO.getCorpName(),enterpriseDTO.getCorpSquareLogoUrl(),1,now,now);
//新增secret表
SecretSettingDTO dto = new SecretSettingDTO();
dto.setWxEnterpriseId(wxEnterpriseId);
dto.setEnterpriseId("-1");
dto.setSecretName("好办自建应用");
dto.setSecretType(1);
dto.setSecretVal(enterpriseDTO.getSecretVal());
dto.setAgentId(enterpriseDTO.getAgentId());
dto.setAgentName(enterpriseDTO.getAgentName());
secretSettingService.saveSecretSetting(dto);
//好办权限初始化
log.info("插入好办小程序权限:{}",wxEnterpriseId);
haobanRoleApiService.addHaobanRole(wxEnterpriseId);
}else {
if(null != wxEnterpriseDTO && (!enterpriseDTO.getWxEnterpriseId().equals(wxEnterpriseDTO.getWxEnterpriseId()))){
return ServiceResponse.failure("-9999","自建小程序的appid存在重复!");
}
wxEnterpriseService.update(enterpriseDTO);
String wxEnterpriseId = enterpriseDTO.getWxEnterpriseId();
SecretSettingDTO secretSetting = secretSettingService.getSecretSetting(wxEnterpriseId, SecretTypeEnum.SELF_APP.getVal());
if (null != secretSetting){
//更新secret表
if (null != enterpriseDTO.getAgentId()){
secretSetting.setAgentId(enterpriseDTO.getAgentId());
}
if (null != enterpriseDTO.getAgentName()){
secretSetting.setAgentName(enterpriseDTO.getAgentName());
}
secretSettingService.saveSecretSetting(secretSetting);
}
}
return ServiceResponse.success(true);
}
@Override
public ServiceResponse<List<String>> filterWxAppidList(List<String> wxAppidList) {
log.info("查询的wxAppidList:{}",JSON.toJSONString(wxAppidList));
if (CollUtil.isEmpty(wxAppidList)){
return ServiceResponse.failure("-9999","参数为空");
}
List<String> list = wxEnterpriseService.getWxAppidListByList(wxAppidList);
log.info("需要过滤的wxAppidList:{}",JSON.toJSONString(list));
//过滤
wxAppidList.removeAll(list);
return ServiceResponse.success(wxAppidList);
}
@Override
public ServiceResponse<Boolean> syncWxEnterpriseInfo(String params) {
log.info("定时同步自建应用信息");
List<TabHaobanWxEnterprise> list = wxEnterpriseService.listAllByWxSecurityType(5);
if (CollUtil.isNotEmpty(list)){
log.info("查询需要同步的信息:{}",JSON.toJSONString(list));
List<HaobanWxEnterpriseDTO> list1 = EntityUtil.changeEntityListByJSON(HaobanWxEnterpriseDTO.class, list);
haobanWxEnterpriseApiService.batchSaveOrUpdate(list1);
}
return null;
}
@Override
public ServiceResponse<Boolean> deleteByWxEnterpriseId(String wxEnterpriseId) {
log.info("删除的企业微信id:{}",wxEnterpriseId);
wxEnterpriseService.deleteByWxEnterpriseId(wxEnterpriseId,null);
return ServiceResponse.success(true);
}
} }
...@@ -260,7 +260,7 @@ public class QywxDeptSyncOperation implements BaseSyncOperation { ...@@ -260,7 +260,7 @@ public class QywxDeptSyncOperation implements BaseSyncOperation {
dealParamMqDTO.setType(syncTaskStatusEnum.getVal()); dealParamMqDTO.setType(syncTaskStatusEnum.getVal());
GicMQClient clientInstance = GICMQClientUtil.getClientInstance(); GicMQClient clientInstance = GICMQClientUtil.getClientInstance();
try { try {
clientInstance.sendMessage("departmentSyncDealMq", JSONObject.toJSONString(dealParamMqDTO)); clientInstance.sendMessage("departmentSyncDealMq2", JSONObject.toJSONString(dealParamMqDTO));
} catch (Exception e) { } catch (Exception e) {
logger.info("发送失败:{},{}", taskId, relationId); logger.info("发送失败:{},{}", taskId, relationId);
e.printStackTrace(); e.printStackTrace();
......
...@@ -213,7 +213,7 @@ public class SelfFriendSyncNewOperation implements BaseSyncOperation { ...@@ -213,7 +213,7 @@ public class SelfFriendSyncNewOperation implements BaseSyncOperation {
GicMQClient clientInstance = GICMQClientUtil.getClientInstance(); GicMQClient clientInstance = GICMQClientUtil.getClientInstance();
try { try {
Log.info("发送队列SelfFriendSyncNewOperation={}",JSON.toJSONString(ret)); Log.info("发送队列SelfFriendSyncNewOperation={}",JSON.toJSONString(ret));
clientInstance.sendBatchMessages("departmentSyncDealMq", ret); clientInstance.sendBatchMessages("departmentSyncDealMq2", ret);
} catch (Exception e) { } catch (Exception e) {
logger.info("发送失败:{},{}", taskId); logger.info("发送失败:{},{}", taskId);
e.printStackTrace(); e.printStackTrace();
......
package com.gic.haoban.manage.service.util;
import com.alibaba.fastjson.JSONObject;
import javax.crypto.Mac;
import javax.crypto.spec.SecretKeySpec;
import java.nio.charset.StandardCharsets;
import java.security.SecureRandom;
import java.util.*;
public class SignatureGetterUtil {
private String secret;
public SignatureGetterUtil(String secret) {
this.secret = secret;
}
public String get(String jsonStr) throws Exception {
Map<String, Object> jsonDict = new HashMap<>();
jsonDict = JSONObject.parseObject(jsonStr, jsonDict.getClass());
List<String> paramList = new ArrayList<>();
json2List(jsonDict, paramList);
Collections.sort(paramList);
return hmacSha256(list2String(paramList));
}
private String list2String(List<String> paramList) {
String str = "";
for (String param : paramList) {
if (param.startsWith("sig=")) {
continue; // ignore sig self
}
str += param + "&";
}
return str.substring(0, str.length() - 1);
}
private String hmacSha256(String data) throws Exception {
Mac mac = Mac.getInstance("HmacSHA256");
SecretKeySpec secretKeySpec = new SecretKeySpec(secret.getBytes("UTF-8"), "HmacSHA256");
mac.init(secretKeySpec);
byte[] signature = mac.doFinal(data.getBytes("UTF-8"));
return Base64.getEncoder().encodeToString(signature);
}
private void json2List(Map<String, Object> jsonDict, List<String> paramList) {
for (Map.Entry<String, Object> entry : jsonDict.entrySet()) {
String k = entry.getKey();
Object v = entry.getValue();
if (v instanceof List) {
for (Object item : (List<?>) v) {
json2List((Map<String, Object>) item, paramList);
}
} else if (v instanceof Map){
json2List((Map)v,paramList);
}else {
paramList.add(k + "=" + v);
}
}
}
/**
* 模拟生成随机 nonce 字符串
*
* @return 随机字符串
*/
private static final String CHARACTERS = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
public static String generateRandomString(int length) {
SecureRandom random = new SecureRandom();
StringBuilder sb = new StringBuilder(length);
for (int i = 0; i < length; i++) {
int randomIndex = random.nextInt(CHARACTERS.length());
char randomChar = CHARACTERS.charAt(randomIndex);
sb.append(randomChar);
}
return sb.toString();
}
}
...@@ -133,6 +133,7 @@ ...@@ -133,6 +133,7 @@
<dubbo:service interface="com.gic.haoban.manage.api.service.ValidationCodeApiService" ref="validationCodeApiServiceImpl"/> <dubbo:service interface="com.gic.haoban.manage.api.service.ValidationCodeApiService" ref="validationCodeApiServiceImpl"/>
<dubbo:service interface="com.gic.haoban.manage.api.service.licence.LicenceOrderApiService" ref="licenceOrderApiServiceImpl"/> <dubbo:service interface="com.gic.haoban.manage.api.service.licence.LicenceOrderApiService" ref="licenceOrderApiServiceImpl"/>
<dubbo:service interface="com.gic.haoban.manage.api.service.licence.AppOrderApiService" ref="appOrderApiServiceImpl"/>
<dubbo:reference interface="com.gic.enterprise.api.service.EnterpriseUseForbidService" id="enterpriseUseForbidService"/> <dubbo:reference interface="com.gic.enterprise.api.service.EnterpriseUseForbidService" id="enterpriseUseForbidService"/>
<dubbo:service interface="com.gic.haoban.manage.api.service.role.HaobanMenuApiService" ref="haobanMenuApiServiceImpl"/> <dubbo:service interface="com.gic.haoban.manage.api.service.role.HaobanMenuApiService" ref="haobanMenuApiServiceImpl"/>
...@@ -142,7 +143,7 @@ ...@@ -142,7 +143,7 @@
<dubbo:reference interface="com.gic.wechat.api.service.qywx.QywxDepartmentApiService" <dubbo:reference interface="com.gic.wechat.api.service.qywx.QywxDepartmentApiService"
id="qywxDepartmentApiService"/> id="qywxDepartmentApiService"/>
<dubbo:reference interface="com.gic.wechat.api.service.qywx.QywxSuiteApiService" id="qywxSuiteApiService" timeout="20000"/> <dubbo:reference interface="com.gic.wechat.api.service.qywx.QywxSuiteApiService" id="qywxSuiteApiService" timeout="20000"/>
<dubbo:reference interface="com.gic.wechat.api.service.qywx.QywxUserApiService" id="qywxUserApiService"/> <dubbo:reference interface="com.gic.wechat.api.service.qywx.QywxUserApiService" id="qywxUserApiService" timeout="20000"/>
<dubbo:reference interface="com.gic.enterprise.api.service.StoreGroupService" id="storeGroupService"/> <dubbo:reference interface="com.gic.enterprise.api.service.StoreGroupService" id="storeGroupService"/>
<dubbo:reference interface="com.gic.clerk.api.service.ClerkService" id="clerkService"/> <dubbo:reference interface="com.gic.clerk.api.service.ClerkService" id="clerkService"/>
...@@ -224,6 +225,7 @@ ...@@ -224,6 +225,7 @@
<dubbo:reference interface="com.gic.orderecommerce.api.service.EcommerceOrderOutputApiService" id="ecommerceOrderOutputApiService" timeout="10000" retries="0" check="false"/> <dubbo:reference interface="com.gic.orderecommerce.api.service.EcommerceOrderOutputApiService" id="ecommerceOrderOutputApiService" timeout="10000" retries="0" check="false"/>
<dubbo:reference interface="com.gic.order.api.service.sharding.OrderApiService" id="orderApiService" timeout="10000" retries="0" check="false"/> <dubbo:reference interface="com.gic.order.api.service.sharding.OrderApiService" id="orderApiService" timeout="10000" retries="0" check="false"/>
<dubbo:reference interface="com.gic.member.api.service.MemberOutApiService" id="memberOutApiService" timeout="10000" retries="0" check="false"/> <dubbo:reference interface="com.gic.member.api.service.MemberOutApiService" id="memberOutApiService" timeout="10000" retries="0" check="false"/>
<dubbo:reference interface="com.gic.operating.api.service.HaobanWxEnterpriseApiService" id="haobanWxEnterpriseApiService" timeout="10000" retries="0" check="false"/>
<dubbo:service interface="com.gic.haoban.manage.api.service.content.task.CommissionTaskApiService" <dubbo:service interface="com.gic.haoban.manage.api.service.content.task.CommissionTaskApiService"
ref="commissionTaskApiService" timeout="10000" /> ref="commissionTaskApiService" timeout="10000" />
......
...@@ -329,7 +329,7 @@ ...@@ -329,7 +329,7 @@
<if test="occupy != null and 2==occupy"> <if test="occupy != null and 2==occupy">
and ( a.expire_time is null or a.expire_time <![CDATA[<]]> now() ) and ( a.expire_time is null or a.expire_time <![CDATA[<]]> now() )
</if> </if>
<!-- 许可状态 0 未激活,1 正常有效,2 即将过期,3 已过期,可多传,按‘,’隔开 --> <!-- 许可状态 0 未激活,1 正常有效,2 即将过期,3 已过期,4 查询可以续期的成员(即状态是1、2、3的成员) -->
<if test="null != permitState and '' != permitState"> <if test="null != permitState and '' != permitState">
<if test="permitState==0"> <if test="permitState==0">
and a.expire_time is null and a.expire_time is null
...@@ -345,8 +345,16 @@ ...@@ -345,8 +345,16 @@
<if test="permitState==3"> <if test="permitState==3">
and a.expire_time <![CDATA[<]]> now() and a.expire_time <![CDATA[<]]> now()
</if> </if>
<if test="permitState==4">
and a.expire_time is not null
</if>
</if>
<if test="null != startTime and startTime !='' ">
and a.expire_time <![CDATA[>=]]> #{startTime}
</if>
<if test="null != endTime and endTime !='' ">
and a.expire_time <![CDATA[<=]]> #{endTime}
</if> </if>
<if test="departmentIds != null and departmentIds.size() > 0"> <if test="departmentIds != null and departmentIds.size() > 0">
and b.department_id IN and b.department_id IN
<foreach collection="departmentIds" item="id" index="index" open="(" close=")" separator=","> <foreach collection="departmentIds" item="id" index="index" open="(" close=")" separator=",">
...@@ -616,6 +624,10 @@ ...@@ -616,6 +624,10 @@
SELECT count(*) FROM tab_haoban_staff WHERE status_flag = 0 and del_time >= DATE_FORMAT(NOW(),'%Y-%m-%d') and expire_time >= DATE_FORMAT(NOW(),'%Y-%m-%d') and wx_enterprise_id = #{wxEnterpriseId} SELECT count(*) FROM tab_haoban_staff WHERE status_flag = 0 and del_time >= DATE_FORMAT(NOW(),'%Y-%m-%d') and expire_time >= DATE_FORMAT(NOW(),'%Y-%m-%d') and wx_enterprise_id = #{wxEnterpriseId}
</select> </select>
<select id="getExpiringNum" resultType="java.lang.Integer">
SELECT count(*) FROM tab_haoban_staff WHERE status_flag = 1 and expire_time > now() and expire_time <![CDATA[<=]]> DATE_ADD(DATE_FORMAT(NOW(),'%Y-%m-%d'),INTERVAL 30 DAY) and wx_enterprise_id = #{wxEnterpriseId}
</select>
<update id="updateStaffInfoByStaffId"> <update id="updateStaffInfoByStaffId">
update tab_haoban_staff set update tab_haoban_staff set
......
...@@ -144,7 +144,7 @@ ...@@ -144,7 +144,7 @@
select select
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
from tab_haoban_audit from tab_haoban_audit
where wx_enterprise_id=#{wxEnterpriseId} and enterprise_id = #{enterpriseId,jdbcType=VARCHAR} where wx_enterprise_id=#{wxEnterpriseId} and enterprise_id = #{enterpriseId,jdbcType=VARCHAR} and status_flag = 1
<if test="auditType != null"> <if test="auditType != null">
and audit_type = #{auditType,jdbcType=INTEGER} and audit_type = #{auditType,jdbcType=INTEGER}
</if> </if>
......
...@@ -19,12 +19,13 @@ ...@@ -19,12 +19,13 @@
<result column="status_flag" property="statusFlag" jdbcType="INTEGER"/> <result column="status_flag" property="statusFlag" jdbcType="INTEGER"/>
<result column="create_time" property="createTime" jdbcType="TIMESTAMP"/> <result column="create_time" property="createTime" jdbcType="TIMESTAMP"/>
<result column="update_time" property="updateTime" jdbcType="TIMESTAMP"/> <result column="update_time" property="updateTime" jdbcType="TIMESTAMP"/>
<result column="self_external_userid" property="selfExternalUserid"/>
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
external_clerk_related_id, wx_enterprise_id, enterprise_id, store_id, member_id, external_clerk_related_id, wx_enterprise_id, enterprise_id, store_id, member_id,
unionid, head_url,external_name, add_create_time, member_unionid_related_id, clerk_id, staff_id, unionid, head_url,external_name, add_create_time, member_unionid_related_id, clerk_id, staff_id,
relation_key, status_flag, create_time, update_time,external_user_id relation_key, status_flag, create_time, update_time,external_user_id ,self_external_userid
</sql> </sql>
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String"> <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String">
...@@ -183,6 +184,9 @@ ...@@ -183,6 +184,9 @@
<if test="externalUserId != null"> <if test="externalUserId != null">
external_user_id = #{externalUserId,jdbcType=VARCHAR}, external_user_id = #{externalUserId,jdbcType=VARCHAR},
</if> </if>
<if test="selfExternalUserid != null">
self_external_userid = #{selfExternalUserid} ,
</if>
<if test="addCreateTime != null"> <if test="addCreateTime != null">
add_create_time = #{addCreateTime,jdbcType=VARCHAR}, add_create_time = #{addCreateTime,jdbcType=VARCHAR},
</if> </if>
...@@ -439,6 +443,18 @@ ...@@ -439,6 +443,18 @@
order by update_time desc limit 1 order by update_time desc limit 1
</select> </select>
<select id="getExternalClerkByWxUserIdAncExternalUserIdSelf" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from tab_haoban_external_clerk_related
where staff_id = #{staffId,jdbcType=VARCHAR}
and wx_enterprise_id = #{wxEnterpriseId}
and enterprise_id = #{enterpriseId}
and self_external_userid = #{externalUserId}
and status_flag in(1,3,4)
order by update_time desc limit 1
</select>
<select id="listByMemberIdAndWxEnterpriseId" resultMap="BaseResultMap"> <select id="listByMemberIdAndWxEnterpriseId" resultMap="BaseResultMap">
select select
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
...@@ -521,6 +537,9 @@ ...@@ -521,6 +537,9 @@
store_id store_id
from tab_haoban_external_clerk_related from tab_haoban_external_clerk_related
where member_id = #{memberId} where member_id = #{memberId}
<if test="null != addCreateTime">
and add_create_time <![CDATA[ <= ]]> #{addCreateTime}
</if>
and status_flag = 1 and status_flag = 1
</select> </select>
...@@ -795,4 +814,30 @@ ...@@ -795,4 +814,30 @@
AND status_flag = 1 AND status_flag = 1
</select> </select>
<select id="listByWxEnterpriseId" resultType="java.lang.String">
select staff_id
from tab_haoban_external_clerk_related
WHERE
wx_enterprise_id = #{wxEnterpriseId}
AND enterprise_id IN
<foreach collection="enterpriseIdList" item="item" separator="," open="(" close=")">
#{item}
</foreach>
AND status_flag = 1
AND external_user_id IS NULL
</select>
<update id="deleteByWxEnterpriseId" >
update tab_haoban_external_clerk_related
set status_flag = 2,update_time = now()
WHERE
wx_enterprise_id = #{wxEnterpriseId}
AND enterprise_id IN
<foreach collection="enterpriseIdList" item="item" separator="," open="(" close=")">
#{item}
</foreach>
AND status_flag = 1
AND external_user_id IS NULL
</update>
</mapper> </mapper>
\ No newline at end of file
...@@ -57,7 +57,7 @@ ...@@ -57,7 +57,7 @@
<include refid="leftJoinStaffSQL"/> <include refid="leftJoinStaffSQL"/>
where a.enterprise_id = #{enterpriseId} where a.enterprise_id = #{enterpriseId}
and a.wx_enterprise_id = #{wxEnterpriseId} and a.status_flag = 1 and b.status_flag = 1 and a.wx_enterprise_id = #{wxEnterpriseId} and a.status_flag = 1 and b.status_flag = 1
and a.clerk_code in and a.clerk_id in
<foreach collection="clerkCodeList" item="id" index="index" open="(" close=")" separator=","> <foreach collection="clerkCodeList" item="id" index="index" open="(" close=")" separator=",">
#{id,jdbcType=VARCHAR} #{id,jdbcType=VARCHAR}
</foreach> </foreach>
...@@ -87,7 +87,7 @@ ...@@ -87,7 +87,7 @@
<include refid="leftJoinStaffSQL"/> <include refid="leftJoinStaffSQL"/>
where a.status_flag = 1 and b.status_flag = 1 where a.status_flag = 1 and b.status_flag = 1
and a.enterprise_id = #{enterpriseId} and a.enterprise_id = #{enterpriseId}
and a.clerk_code = #{clerkCode} order by a.create_time desc limit 1 and a.clerk_id = #{clerkCode} order by a.create_time desc limit 1
</select> </select>
<select id="getStaffClerkRelationDTO" resultType="com.gic.haoban.manage.api.dto.StaffClerkRelationDTO"> <select id="getStaffClerkRelationDTO" resultType="com.gic.haoban.manage.api.dto.StaffClerkRelationDTO">
...@@ -95,7 +95,7 @@ ...@@ -95,7 +95,7 @@
where a.status_flag = 1 and b.status_flag = 1 where a.status_flag = 1 and b.status_flag = 1
and a.manage_flag = 0 and a.manage_flag = 0
and a.enterprise_id = #{enterpriseId} and a.enterprise_id = #{enterpriseId}
and a.clerk_code = #{clerkCode} order by a.create_time desc limit 1 and a.clerk_id = #{clerkCode} order by a.create_time desc limit 1
</select> </select>
...@@ -107,14 +107,6 @@ ...@@ -107,14 +107,6 @@
and status_flag != #{status} and status_flag != #{status}
</update> </update>
<update id="delByStoreIdAndCode">
update tab_haoban_staff_clerk_relation
set status_flag = 0,
update_time = now()
where clerk_code = #{clerkCode,jdbcType=VARCHAR}
and store_id = #{storeId,jdbcType=VARCHAR}
and status_flag = 1
</update>
<select id="listByClerkIds" resultType="com.gic.haoban.manage.api.dto.StaffClerkRelationDTO"> <select id="listByClerkIds" resultType="com.gic.haoban.manage.api.dto.StaffClerkRelationDTO">
<include refid="leftJoinStaffSQL"/> <include refid="leftJoinStaffSQL"/>
...@@ -173,12 +165,6 @@ ...@@ -173,12 +165,6 @@
and a.staff_id = #{staffId} and a.status_flag=1 and b.status_flag=1 and a.staff_id = #{staffId} and a.status_flag=1 and b.status_flag=1
</select> </select>
<select id="getByCodeAndStoreId" resultType="com.gic.haoban.manage.api.dto.StaffClerkRelationDTO">
<include refid="leftJoinStaffSQL" />
where a.clerk_code = #{clerkCode}
and a.store_id = #{storeId}
and a.status_flag = 1 and b.status_flag=1
</select>
<select id="listByWxEnterpriseId" resultType="String"> <select id="listByWxEnterpriseId" resultType="String">
select a.staff_id select a.staff_id
......
...@@ -10,15 +10,16 @@ ...@@ -10,15 +10,16 @@
<result column="transfer" jdbcType="INTEGER" property="transfer"/> <result column="transfer" jdbcType="INTEGER" property="transfer"/>
<result column="activated" jdbcType="INTEGER" property="activated"/> <result column="activated" jdbcType="INTEGER" property="activated"/>
<result column="expired" jdbcType="INTEGER" property="expired"/> <result column="expired" jdbcType="INTEGER" property="expired"/>
<result column="merged" jdbcType="INTEGER" property="merged"/>
<result column="create_time" jdbcType="TIMESTAMP" property="createTime"/> <result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/> <result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
<result column="delete_flag" jdbcType="INTEGER" property="deleteFlag"/> <result column="delete_flag" jdbcType="INTEGER" property="deleteFlag"/>
</resultMap> </resultMap>
<insert id="insert" parameterType="com.gic.haoban.manage.service.entity.TabHaobanWxEnterpriseActiveData"> <insert id="insert" parameterType="com.gic.haoban.manage.service.entity.TabHaobanWxEnterpriseActiveData">
insert into tab_haoban_wx_enterprise_active_data (id, wx_enterprise_id, purchased,used, insert into tab_haoban_wx_enterprise_active_data (id, wx_enterprise_id, purchased,used,
inactive, transfer, activated,expired,create_time,update_time,delete_flag) inactive, transfer, activated,expired,create_time,update_time,delete_flag,merged)
values (#{id,jdbcType=BIGINT}, #{wxEnterpriseId,jdbcType=VARCHAR}, #{purchased,jdbcType=INTEGER},#{used,jdbcType=INTEGER},#{inactive,jdbcType=INTEGER}, values (#{id,jdbcType=BIGINT}, #{wxEnterpriseId,jdbcType=VARCHAR}, #{purchased,jdbcType=INTEGER},#{used,jdbcType=INTEGER},#{inactive,jdbcType=INTEGER},
#{transfer,jdbcType=INTEGER},#{activated,jdbcType=INTEGER},#{expired,jdbcType=INTEGER},now(),now(),0) #{transfer,jdbcType=INTEGER},#{activated,jdbcType=INTEGER},#{expired,jdbcType=INTEGER},now(),now(),0,#{merged,jdbcType=INTEGER})
</insert> </insert>
<select id="getWxEnterpriseActiveDataByWxEnterpriseId" resultMap="BaseResultMap"> <select id="getWxEnterpriseActiveDataByWxEnterpriseId" resultMap="BaseResultMap">
...@@ -46,6 +47,9 @@ ...@@ -46,6 +47,9 @@
<if test="expired != null" > <if test="expired != null" >
expired = #{expired,jdbcType=INTEGER}, expired = #{expired,jdbcType=INTEGER},
</if> </if>
<if test="merged != null" >
merged = #{merged,jdbcType=INTEGER},
</if>
update_time = now() update_time = now()
</set> </set>
where wx_enterprise_id=#{wxEnterpriseId} where wx_enterprise_id=#{wxEnterpriseId}
......
...@@ -45,6 +45,7 @@ ...@@ -45,6 +45,7 @@
<result column="open_corpid" property="openCorpid"/> <result column="open_corpid" property="openCorpid"/>
<result column="wxa_appid" property="wxaAppid" /> <result column="wxa_appid" property="wxaAppid" />
<result column="url_host" property="urlHost"/> <result column="url_host" property="urlHost"/>
<result column="callback_flag" property="callbackFlag"/>
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
...@@ -52,7 +53,7 @@ ...@@ -52,7 +53,7 @@
corp_user_max, corp_full_name, subject_type, verified_end_time, corp_wxqrcode, corp_scale, 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, 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 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 , wx_corpid , open_corpid , auto_active_flag , wxa_appid , url_host ,member_secret,contact_secret,agree_external_userid_flag,agree_external_userid_time,external_flag,userid_flag ,wx_security_type , wx_corpid , open_corpid , auto_active_flag , wxa_appid , url_host,callback_flag
</sql> </sql>
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String"> <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String">
select select
...@@ -176,6 +177,18 @@ ...@@ -176,6 +177,18 @@
<if test="null != openCorpid"> <if test="null != openCorpid">
open_corpid , open_corpid ,
</if> </if>
<if test="null != wxaAppid">
wxa_appid ,
</if>
<if test="null != urlHost">
url_host ,
</if>
<if test="null != wxSecurityType">
wx_security_type ,
</if>
<if test="null != callbackFlag">
callback_flag ,
</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="wxEnterpriseId != null"> <if test="wxEnterpriseId != null">
...@@ -283,6 +296,18 @@ ...@@ -283,6 +296,18 @@
<if test="null != openCorpid"> <if test="null != openCorpid">
#{openCorpid} , #{openCorpid} ,
</if> </if>
<if test="null != wxaAppid">
#{wxaAppid} ,
</if>
<if test="null != urlHost">
#{urlHost} ,
</if>
<if test="null != wxSecurityType">
#{wxSecurityType} ,
</if>
<if test="null != callbackFlag">
#{callbackFlag} ,
</if>
</trim> </trim>
</insert> </insert>
...@@ -395,13 +420,22 @@ ...@@ -395,13 +420,22 @@
external_flag = #{externalFlag,jdbcType=INTEGER}, external_flag = #{externalFlag,jdbcType=INTEGER},
</if> </if>
<if test="useridFlag != null"> <if test="useridFlag != null">
userid_flag = #{useridFlag} userid_flag = #{useridFlag},
</if> </if>
<if test="null != wxCorpid"> <if test="null != wxCorpid">
wx_corpid = #{wxCorpid} wx_corpid = #{wxCorpid},
</if> </if>
<if test="null != openCorpid"> <if test="null != openCorpid">
open_corpid = #{openCorpid} open_corpid = #{openCorpid},
</if>
<if test="null != wxaAppid">
wxa_appid = #{wxaAppid},
</if>
<if test="null != urlHost">
url_host = #{urlHost},
</if>
<if test="null != callbackFlag">
callback_flag = #{callbackFlag}
</if> </if>
</set> </set>
where wx_enterprise_id = #{wxEnterpriseId,jdbcType=VARCHAR} where wx_enterprise_id = #{wxEnterpriseId,jdbcType=VARCHAR}
...@@ -415,6 +449,12 @@ ...@@ -415,6 +449,12 @@
<if test="gicContactFlag != null"> <if test="gicContactFlag != null">
and contact_flag = #{gicContactFlag,jdbcType=INTEGER} and contact_flag = #{gicContactFlag,jdbcType=INTEGER}
</if> </if>
<if test=" appType != null and appType == 1">
and wx_security_type = 5
</if>
<if test=" appType != null and appType == 0">
and wx_security_type != 5
</if>
<if test="version != null and version == 2"> <if test="version != null and version == 2">
<if test="keyword != null and keyword != '' and enterpriseIds != null and enterpriseIds.size() > 0"> <if test="keyword != null and keyword != '' and enterpriseIds != null and enterpriseIds.size() > 0">
and (corp_name like CONCAT('%',#{keyword},'%') and (corp_name like CONCAT('%',#{keyword},'%')
...@@ -523,4 +563,44 @@ ...@@ -523,4 +563,44 @@
and a.enterprise_id = #{enterpriseId} and a.enterprise_id = #{enterpriseId}
</select> </select>
<select id="getWxAppidListByList" resultType="java.lang.String">
select
wxa_appid
from tab_haoban_wx_enterprise
where
status_flag = 1
and wx_security_type = 5
<if test="wxAppidList != null and wxAppidList.size() > 0">
and wxa_appid IN
<foreach collection="wxAppidList" item="id" index="index" open="(" close=")" separator=",">
#{id,jdbcType=VARCHAR}
</foreach>
</if>
</select>
<select id="listAllByWxSecurityType" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from tab_haoban_wx_enterprise
where
status_flag = 1
and wx_security_type = #{wxSecurityType}
</select>
<update id="updateWxaAppid">
update tab_haoban_wx_enterprise
set wxa_appid = #{wxaAppid},
update_time = now()
where wx_enterprise_id = #{wxEnterpriseId}
</update>
<select id="listWxEnterpriseByCallbackFlag" resultType="java.lang.String" >
select
wx_enterprise_id
from tab_haoban_wx_enterprise
where
status_flag = 1
and callback_flag = #{callbackFlag}
</select>
</mapper> </mapper>
\ No newline at end of file
...@@ -250,6 +250,9 @@ ...@@ -250,6 +250,9 @@
<if test="type != null and type ==1 "> <if test="type != null and type ==1 ">
and wx_enterprise_id = #{wxEnterpriseId} and wx_enterprise_id = #{wxEnterpriseId}
</if> </if>
<if test="orderType != null">
and order_type = #{orderType}
</if>
order by create_time desc order by create_time desc
</select> </select>
......
...@@ -227,7 +227,7 @@ public class AuditController extends WebBaseController { ...@@ -227,7 +227,7 @@ public class AuditController extends WebBaseController {
AuditDTO audit = auditApiService.findById(auditId); AuditDTO audit = auditApiService.findById(auditId);
if (audit == null || audit.getAuditStatus() != 0) { if (audit == null || audit.getAuditStatus() != 0) {
RedisUtil.unlock(key); RedisUtil.unlock(key);
return resultResponse(HaoBanErrCode.ERR_10017); return resultResponse(HaoBanErrCode.ERR_100035);
} }
String result = auditApiService.audit("", auditId, staffName, staffId); String result = auditApiService.audit("", auditId, staffName, staffId);
RedisUtil.unlock(key); RedisUtil.unlock(key);
......
package com.gic.haoban.manage.web.controller; package com.gic.haoban.manage.web.controller;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import com.google.common.collect.Lists;
import org.apache.commons.lang.StringUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.gic.api.base.commons.ServiceResponse; import com.gic.api.base.commons.ServiceResponse;
import com.gic.clerk.api.dto.right.RightMenuDTO; import com.gic.clerk.api.dto.right.RightMenuDTO;
...@@ -22,6 +8,15 @@ import com.gic.haoban.base.api.common.pojo.dto.WebLoginDTO; ...@@ -22,6 +8,15 @@ import com.gic.haoban.base.api.common.pojo.dto.WebLoginDTO;
import com.gic.haoban.common.utils.AuthWebRequestUtil; import com.gic.haoban.common.utils.AuthWebRequestUtil;
import com.gic.haoban.common.utils.HaobanResponse; import com.gic.haoban.common.utils.HaobanResponse;
import com.gic.haoban.manage.web.errCode.HaoBanErrCode; import com.gic.haoban.manage.web.errCode.HaoBanErrCode;
import org.apache.commons.lang.StringUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
import java.util.*;
/** /**
* *
......
...@@ -136,6 +136,13 @@ public class StaffController extends WebBaseController { ...@@ -136,6 +136,13 @@ public class StaffController extends WebBaseController {
StaffListDTO dto = EntityUtil.changeEntityByJSON(StaffListDTO.class, qo); StaffListDTO dto = EntityUtil.changeEntityByJSON(StaffListDTO.class, qo);
dto.setWxEnterpriseId(wxEnterpriseId); dto.setWxEnterpriseId(wxEnterpriseId);
dto.setDepartmentIds(departmentIds); dto.setDepartmentIds(departmentIds);
if (qo.getGetAllFlag() == 1){
//续期订单需要查询所有数据
BasePageInfo basePageInfo = new BasePageInfo();
basePageInfo.setPageNum(1);
basePageInfo.setPageSize(Integer.MAX_VALUE);
dto.setPageInfo(basePageInfo);
}
Page<StaffDTO> page = staffApiService.pageStaff(dto); Page<StaffDTO> page = staffApiService.pageStaff(dto);
logger.info("pages={},totalPage={}", page.getCurrentPage(), page.getTotalPage()); logger.info("pages={},totalPage={}", page.getCurrentPage(), page.getTotalPage());
...@@ -465,7 +472,7 @@ public class StaffController extends WebBaseController { ...@@ -465,7 +472,7 @@ public class StaffController extends WebBaseController {
@RequestMapping("staff-export") @RequestMapping("staff-export")
public HaobanResponse staffExport(HttpServletRequest request, HttpServletResponse response,String departmentId, Integer activeFlag, Integer relationFlag, public HaobanResponse staffExport(HttpServletRequest request, HttpServletResponse response,String departmentId, Integer activeFlag, Integer relationFlag,
String keyWord, String permitState,BasePageInfo pageInfo,@RequestParam(defaultValue = "create_time") String sortField, String keyWord, String permitState,BasePageInfo pageInfo,@RequestParam(defaultValue = "create_time") String sortField,
@RequestParam(defaultValue = "desc") String sortType,String enterpriseIdParam) { @RequestParam(defaultValue = "desc") String sortType,String enterpriseIdParam,String startTime,String endTime) {
WebLoginDTO login = AuthWebRequestUtil.getLoginUser(); WebLoginDTO login = AuthWebRequestUtil.getLoginUser();
String wxEnterpriseId = login.getWxEnterpriseId(); String wxEnterpriseId = login.getWxEnterpriseId();
if(StringUtils.isBlank(departmentId)){ if(StringUtils.isBlank(departmentId)){
...@@ -490,6 +497,8 @@ public class StaffController extends WebBaseController { ...@@ -490,6 +497,8 @@ public class StaffController extends WebBaseController {
dto.setSortField(sortField); dto.setSortField(sortField);
dto.setSortType(sortType); dto.setSortType(sortType);
dto.setEnterpriseIdParam(enterpriseIdParam); dto.setEnterpriseIdParam(enterpriseIdParam);
dto.setStartTime(startTime);
dto.setEndTime(endTime);
pageInfo.setPageSize(Integer.MAX_VALUE); pageInfo.setPageSize(Integer.MAX_VALUE);
int pageNum = 1; int pageNum = 1;
while (true) { while (true) {
...@@ -518,6 +527,11 @@ public class StaffController extends WebBaseController { ...@@ -518,6 +527,11 @@ public class StaffController extends WebBaseController {
vo.setPosition(staffDTO.getPostion()); vo.setPosition(staffDTO.getPostion());
vo.setDepartmentName(departmentMap.get(staffDTO.getDepartmentIds()) == null ? null : departmentMap.get(staffDTO.getDepartmentIds()).getDepartmentName()); vo.setDepartmentName(departmentMap.get(staffDTO.getDepartmentIds()) == null ? null : departmentMap.get(staffDTO.getDepartmentIds()).getDepartmentName());
vo.setRelationFlag((Objects.isNull(staffDTO.getRelationFlag()) || staffDTO.getRelationFlag() == 0) ? "未关联" : "已关联"); vo.setRelationFlag((Objects.isNull(staffDTO.getRelationFlag()) || staffDTO.getRelationFlag() == 0) ? "未关联" : "已关联");
vo.setWxUserId(staffDTO.getWxUserId());
vo.setWxOpenUseId(staffDTO.getWxOpenUseId());
vo.setActiveTime(staffDTO.getActiveTime() == null ? null : DateUtil.dateToStr(staffDTO.getActiveTime(),DateUtil.FORMAT_DATETIME_19));
vo.setExpireTime(staffDTO.getExpireTime() == null ? null : DateUtil.dateToStr(staffDTO.getExpireTime(),DateUtil.FORMAT_DATETIME_19));
vo.setPermitState(staffDTO.getPermitState());
if (flag){ if (flag){
List<String> enterpriseNameList = staffDTO.getEnterpriseNameList(); List<String> enterpriseNameList = staffDTO.getEnterpriseNameList();
if (CollUtil.isNotEmpty(enterpriseNameList)){ if (CollUtil.isNotEmpty(enterpriseNameList)){
...@@ -537,14 +551,24 @@ public class StaffController extends WebBaseController { ...@@ -537,14 +551,24 @@ public class StaffController extends WebBaseController {
} }
mergeClerkInfo(voList, wxEnterpriseId); mergeClerkInfo(voList, wxEnterpriseId);
String fileName = wxEnterpriseName + "通讯录" + DateUtil.dateToStr(new Date(), DateUtil.FORMAT_DATE_8); String fileName = wxEnterpriseName + "通讯录" + DateUtil.dateToStr(new Date(), DateUtil.FORMAT_DATE_8);
List<String> titleList =new ArrayList<>(); List<String> titleList =Lists.newArrayList("姓名", "职务", "部门", "手机号", "关联状态", "关联导购");
List<String> fileList = new ArrayList<>(); List<String> fileList = Lists.newArrayList("staffName", "position", "departmentName", "phoneNumber", "relationFlag", "clerkName");
if (flag){ if (flag){
titleList = Arrays.asList("姓名", "职务", "部门", "手机号", "关联状态", "关联导购","所属商户"); titleList.add("所属商户");
fileList = Arrays.asList("staffName", "position", "departmentName", "phoneNumber", "relationFlag", "clerkName","enterpriseName"); fileList.add("enterpriseName");
}else { }
titleList = Arrays.asList("姓名", "职务", "部门", "手机号", "关联状态", "关联导购"); //针对未升级好办独立应用的企业,导出表格增加导出字段:成员明文userid、成员加密userid、许可状态、许可激活时间、许可到期时间
fileList = Arrays.asList("staffName", "position", "departmentName", "phoneNumber", "relationFlag", "clerkName"); if(enterprise != null && enterprise.getWxSecurityType() != 5){
titleList.add("成员明文userid");
titleList.add("成员加密userid");
titleList.add("许可状态");
titleList.add("许可激活时间");
titleList.add("许可到期时间");
fileList.add("wxUserId");
fileList.add("wxOpenUseId");
fileList.add("status");
fileList.add("activeTime");
fileList.add("expireTime");
} }
try { try {
ExcelUtils.xls(response, request, fileName, voList, fileList, titleList); ExcelUtils.xls(response, request, fileName, voList, fileList, titleList);
......
package com.gic.haoban.manage.web.controller; package com.gic.haoban.manage.web.controller;
import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.UnsupportedEncodingException;
import java.net.ConnectException;
import java.net.URL;
import java.net.URLConnection;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.redisson.api.RRateLimiter;
import org.redisson.api.RateIntervalUnit;
import org.redisson.api.RateType;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
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.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.ctrip.framework.apollo.ConfigService; import com.ctrip.framework.apollo.ConfigService;
import com.gic.api.base.commons.Page; import com.gic.api.base.commons.Page;
import com.gic.commons.util.HttpClient; import com.gic.commons.util.HttpClient;
import com.gic.haoban.base.api.common.BasePageInfo; import com.gic.haoban.base.api.common.BasePageInfo;
import com.gic.haoban.common.utils.EntityUtil;
import com.gic.haoban.common.utils.HaobanResponse; import com.gic.haoban.common.utils.HaobanResponse;
import com.gic.haoban.manage.api.dto.*; import com.gic.haoban.manage.api.dto.MaidianLogDTO;
import com.gic.haoban.manage.api.service.*; import com.gic.haoban.manage.api.dto.QywxCorpInfoSimpleDTO;
import com.gic.haoban.manage.api.dto.SecretSettingDTO;
import com.gic.haoban.manage.api.dto.StaffDTO;
import com.gic.haoban.manage.api.dto.WxApplicationDTO;
import com.gic.haoban.manage.api.dto.WxEnterpriseDTO;
import com.gic.haoban.manage.api.dto.WxEnterpriseQwDTO;
import com.gic.haoban.manage.api.enums.SecretTypeEnum;
import com.gic.haoban.manage.api.service.MaidianLogApiService;
import com.gic.haoban.manage.api.service.QwFriendApiService;
import com.gic.haoban.manage.api.service.StaffApiService;
import com.gic.haoban.manage.api.service.TestApiService;
import com.gic.haoban.manage.api.service.WxApplicationApiService;
import com.gic.haoban.manage.api.service.WxEnterpriseApiService;
import com.gic.haoban.manage.api.service.WxEnterpriseRelatedApiService;
import com.gic.haoban.manage.api.service.hm.HmQrcodeApiService; import com.gic.haoban.manage.api.service.hm.HmQrcodeApiService;
import com.gic.haoban.manage.api.service.out.SecretSettingApiService;
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.QywxXcxSendMessageQo;
import com.gic.redis.data.util.GicRateLimiter; import com.gic.redis.data.util.GicRateLimiter;
import com.gic.redis.data.util.RedisUtil; import com.gic.redis.data.util.RedisUtil;
import com.gic.wechat.api.dto.qywx.QywxNewUseridDTO; import com.gic.wechat.api.dto.qywx.QywxNewUseridDTO;
import com.gic.wechat.api.dto.qywx.QywxXcxSendMessageDTO;
import com.gic.wechat.api.service.qywx.QywxCorpApiService; import com.gic.wechat.api.service.qywx.QywxCorpApiService;
import com.gic.wechat.api.service.qywx.QywxSuiteApiService;
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.redisson.api.RRateLimiter;
import org.redisson.api.RateIntervalUnit;
import org.redisson.api.RateType;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.*;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
/** /**
* Created 2020/4/9. * Created 2020/4/9.
...@@ -54,7 +80,7 @@ public class TestController extends WebBaseController { ...@@ -54,7 +80,7 @@ public class TestController extends WebBaseController {
private final ExecutorService pools = Executors.newFixedThreadPool(500); private final ExecutorService pools = Executors.newFixedThreadPool(500);
@Autowired @Autowired
private QywxSuiteApiService qywxSuiteApiService; private SecretSettingApiService secretSettingApiService;
@Autowired @Autowired
private TestApiService testApiService; private TestApiService testApiService;
@Autowired @Autowired
...@@ -485,4 +511,105 @@ public class TestController extends WebBaseController { ...@@ -485,4 +511,105 @@ public class TestController extends WebBaseController {
return Arrays.asList(wxEnterpriseDTO.getThirdCorpid()+"(第三方)",wxEnterpriseDTO.getDkCorpid()+"(代开发)").stream().filter(str -> StringUtils.isNotBlank(str)).collect(Collectors.joining(" / ")) + desc; return Arrays.asList(wxEnterpriseDTO.getThirdCorpid()+"(第三方)",wxEnterpriseDTO.getDkCorpid()+"(代开发)").stream().filter(str -> StringUtils.isNotBlank(str)).collect(Collectors.joining(" / ")) + desc;
} }
@RequestMapping("test-bq")
public Object bq(String wxEnterpriseId) throws UnsupportedEncodingException {
WxEnterpriseDTO dto = this.wxEnterpriseApiService.getOne(wxEnterpriseId) ;
if(null == dto) {
return "wu" ;
}
List<String> list = new ArrayList<>();
String url = dto.getUrlHost() ;
String cop = dto.getWxCorpid() ;
SecretSettingDTO s = this.secretSettingApiService.getSecretSetting(wxEnterpriseId, SecretTypeEnum.SELF_APP.getVal()) ;
String token = this.qywxCorpApiService.getToken(cop, s.getSecretVal()) ;
String ip = url.replace("http://", "").replace(":8960","") ;
String selfUrl = "https://qyapi.weixin.qq.com/cgi-bin/externalcontact/get_corp_tag_list?access_token=" + token;
url = url+"/api-qywx-self/qywx/self-post?ip=" + ip + "&url="
+ URLEncoder.encode(selfUrl, "utf-8");
Map<String, Object> map1 = httpsRequest(url, "GET", null);
System.out.println(JSONObject.toJSONString(map1));
String errcode = map1.get("errcode").toString();
if (!"0".equals(errcode)) {
return map1;
}
JSONArray arr = JSONArray.parseArray(map1.get("tag_group").toString()) ;
for(int i=0;i<arr.size();i++) {
JSONObject obj = arr.getJSONObject(i) ;
// System.out.println(obj.toJSONString());
String groupName = obj.getString("group_name") ;
String groupId = obj.getString("group_id") ;
String where = " where qywx_group_name ='"+groupName+"' and wx_enterprise_id='"+wxEnterpriseId+"' and status_flag = 1 ; " ;
//System.out.println("select * from tab_haoban_qywx_tag " + where );
String str = ("update tab_haoban_qywx_tag set qywx_group_key = '"+groupId+"'" + where );
list.add(str) ;
}
list.add("-- ****************************************************** ");
list.add("UPDATE `tab_haoban_qywx_tag_item` a LEFT JOIN `tab_haoban_qywx_tag` b ON a.qywx_tag_id = b.`qywx_tag_id` SET a.qywx_group_key = b.`qywx_group_key` WHERE a.status_flag = 1 and a.wx_enterprise_id = '"+wxEnterpriseId+"' ; ");
list.add("-- ****************************************************** ");
for(int i=0;i<arr.size();i++) {
JSONObject obj = arr.getJSONObject(i) ;
String groupId = obj.getString("group_id") ;
JSONArray tagArr = obj.getJSONArray("tag") ;
for(int j=0;j<tagArr.size();j++) {
JSONObject tagObj = tagArr.getJSONObject(j) ;
String tagName = tagObj.getString("name") ;
String tagId = tagObj.getString("id") ;
String tagWhere = " where qywx_group_key = '"+groupId+"' and qywx_tag_name ='"+tagName+"' and wx_enterprise_id='"+wxEnterpriseId+"' and status_flag = 1 ; " ;
//System.out.println("select * from tab_haoban_qywx_tag_item " + tagWhere );
list.add("update tab_haoban_qywx_tag_item set qywx_tag_key = '"+tagId+"'" + tagWhere );
}
}
return list ;
}
public static Map<String, Object> httpsRequest(String requestUrl, String requestMethod, String outputStr) {
try {
URL url = new URL(requestUrl);
URLConnection conn = url.openConnection();
conn.setDoOutput(true);
conn.setDoInput(true);
conn.setUseCaches(false);
// 设置请求方式(GET/POST)
// conn.setRequestMethod(requestMethod);
// 当outputStr不为null时向输出流写数据
if (null != outputStr) {
OutputStream outputStream = conn.getOutputStream();
// 注意编码格式
outputStream.write(outputStr.getBytes("UTF-8"));
outputStream.close();
}
// 从输入流读取返回内容
InputStream inputStream = conn.getInputStream();
InputStreamReader inputStreamReader = new InputStreamReader(inputStream, "utf-8");
BufferedReader bufferedReader = new BufferedReader(inputStreamReader);
String str = null;
StringBuffer buffer = new StringBuffer();
while ((str = bufferedReader.readLine()) != null) {
buffer.append(str);
}
// 释放资源
bufferedReader.close();
inputStreamReader.close();
inputStream.close();
inputStream = null;
// conn.disconnect();
String retStr = buffer.toString();
Map<String, Object> map = (Map<String, Object>) com.alibaba.fastjson.JSON.parse(retStr);
logger.info(JSON.toJSONString(map));
return map;
} catch (ConnectException ce) {
System.out.println(ce);
} catch (Exception e) {
System.out.println(e);
}
return null;
}
} }
...@@ -487,7 +487,7 @@ public class GroupChatHmController { ...@@ -487,7 +487,7 @@ public class GroupChatHmController {
DownloadReportDTO downloadReportDTO = new DownloadReportDTO(); DownloadReportDTO downloadReportDTO = new DownloadReportDTO();
downloadReportDTO.setDownloadUrl(cloudFileInfo.getOrgFileUrl()); downloadReportDTO.setDownloadUrl(cloudFileInfo.getOrgFileUrl());
downloadReportService.updateDownloadReport(reportId, downloadReportDTO); downloadReportService.updateDownloadReport(reportId, downloadReportDTO);
tempFile.deleteOnExit(); tempFile.delete();
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
......
package com.gic.haoban.manage.web.controller.licence;
import cn.hutool.core.convert.Convert;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.gic.api.base.commons.Page;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.commons.util.PageHelperUtils;
import com.gic.commons.webapi.reponse.RestResponse;
import com.gic.haoban.base.api.common.pojo.dto.WebLoginDTO;
import com.gic.haoban.common.utils.AuthWebRequestUtil;
import com.gic.haoban.manage.api.dto.licence.AppOrderCheckDTO;
import com.gic.haoban.manage.api.dto.licence.AppOrderNoticeDTO;
import com.gic.haoban.manage.api.dto.licence.AppOrderPageDTO;
import com.gic.haoban.manage.api.dto.qdto.licence.AppOrderPageQDTO;
import com.gic.haoban.manage.api.dto.qdto.licence.AppOrderQDTO;
import com.gic.haoban.manage.api.service.licence.AppOrderApiService;
import com.gic.haoban.manage.web.errCode.HaoBanErrCode;
import com.gic.haoban.manage.web.qo.licence.AppOrderPageQO;
import com.gic.haoban.manage.web.qo.licence.AppOrderQO;
import com.gic.haoban.manage.web.vo.licence.AppOrderCheckVO;
import com.gic.haoban.manage.web.vo.licence.AppOrderNoticeVO;
import com.gic.haoban.manage.web.vo.licence.AppOrderPageVO;
import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
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.RequestParam;
import org.springframework.web.bind.annotation.RestController;
/**
* @description:
* @Author: wenhua
* @Date: 2023/6/25 15:54
*/
@RestController
@RequestMapping("/app-order")
public class AppOrderController {
private static Logger logger = LogManager.getLogger(AppOrderController.class);
@Autowired
private AppOrderApiService appOrderApiService;
/**
* 分页查询应用订单列表
*/
@RequestMapping("app-order-page")
public RestResponse<Page<AppOrderPageVO>> getAppOrderPage(@RequestBody AppOrderPageQO qo) {
WebLoginDTO loginUser = AuthWebRequestUtil.getLoginUser();
if (loginUser == null || StringUtils.isBlank(loginUser.getEnterpriseId())) {
return RestResponse.failure(Convert.toStr(HaoBanErrCode.ERR_4.getCode()), HaoBanErrCode.ERR_4.getMsg());
}
AppOrderPageQDTO qdto = JSONObject.parseObject(JSONObject.toJSONString(qo), AppOrderPageQDTO.class);
qdto.setWxEnterpriseId(loginUser.getWxEnterpriseId());
Page<AppOrderPageDTO> page = appOrderApiService.getAppOrderPage(qdto).getResult();
Page<AppOrderPageVO> result = PageHelperUtils.changePageToCurrentPage(page, AppOrderPageVO.class);
return RestResponse.successResult(result);
}
/**
* 新增订单
*/
@RequestMapping("app-order-save")
public RestResponse<Boolean> saveAppOrder(@RequestBody AppOrderQO qo) {
WebLoginDTO loginUser = AuthWebRequestUtil.getLoginUser();
if (loginUser == null || StringUtils.isBlank(loginUser.getEnterpriseId())) {
return RestResponse.failure(Convert.toStr(HaoBanErrCode.ERR_4.getCode()), HaoBanErrCode.ERR_4.getMsg());
}
String wxEnterpriseId = loginUser.getWxEnterpriseId();
String clerkName = loginUser.getClerkName();
String clerkId = loginUser.getClerkId();
AppOrderQDTO qdto = JSONObject.parseObject(JSONObject.toJSONString(qo), AppOrderQDTO.class);
qdto.setWxEnterpriseId(wxEnterpriseId);
qdto.setCreatorName(clerkName);
qdto.setCreatorId(clerkId);
ServiceResponse<Boolean> response = appOrderApiService.saveAppOrder(qdto);
if (response.isSuccess()) {
return RestResponse.successResult(true);
}
return RestResponse.failure(response.getCode(), response.getMessage());
}
/**
* 取消订单
*/
@RequestMapping("app-order-cancel")
public RestResponse<Boolean> cancelAppOrder(@RequestParam Long orderId) {
WebLoginDTO loginUser = AuthWebRequestUtil.getLoginUser();
if (loginUser == null || StringUtils.isBlank(loginUser.getEnterpriseId())) {
return RestResponse.failure(Convert.toStr(HaoBanErrCode.ERR_4.getCode()), HaoBanErrCode.ERR_4.getMsg());
}
ServiceResponse<Boolean> response = appOrderApiService.cancelAppOrder(orderId);
if (response.isSuccess()) {
return RestResponse.successResult(true);
}
return RestResponse.failure(response.getCode(), response.getMessage());
}
/**
* 购买弹窗校验
*/
@RequestMapping("app-order-check")
public RestResponse<AppOrderCheckVO> checkAppOrder() {
WebLoginDTO loginUser = AuthWebRequestUtil.getLoginUser();
if (loginUser == null || StringUtils.isBlank(loginUser.getEnterpriseId())) {
return RestResponse.failure(Convert.toStr(HaoBanErrCode.ERR_4.getCode()), HaoBanErrCode.ERR_4.getMsg());
}
ServiceResponse<AppOrderCheckDTO> response = appOrderApiService.checkAppOrder(loginUser.getWxEnterpriseId());
AppOrderCheckVO vo = JSONObject.parseObject(JSONObject.toJSONString(response.getResult()), AppOrderCheckVO.class);
return RestResponse.successResult(vo);
}
/**
* 登录好办弹窗校验
*/
@RequestMapping("app-order-notice")
public RestResponse<AppOrderNoticeVO> noticeAppOrder() {
WebLoginDTO loginUser = AuthWebRequestUtil.getLoginUser();
if (loginUser == null || StringUtils.isBlank(loginUser.getEnterpriseId())) {
return RestResponse.failure(Convert.toStr(HaoBanErrCode.ERR_4.getCode()), HaoBanErrCode.ERR_4.getMsg());
}
ServiceResponse<AppOrderNoticeDTO> response = appOrderApiService.noticeAppOrder(loginUser.getWxEnterpriseId());
AppOrderNoticeVO vo = JSONObject.parseObject(JSONObject.toJSONString(response.getResult()), AppOrderNoticeVO.class);
return RestResponse.successResult(vo);
}
@RequestMapping("app-order-test")
public RestResponse<Boolean> test(String param) {
WebLoginDTO loginUser = AuthWebRequestUtil.getLoginUser();
if (loginUser == null || StringUtils.isBlank(loginUser.getEnterpriseId())) {
return RestResponse.failure(Convert.toStr(HaoBanErrCode.ERR_4.getCode()), HaoBanErrCode.ERR_4.getMsg());
}
ServiceResponse<Boolean> response = appOrderApiService.getAppOrderList(param);
if (response.isSuccess()){
logger.info("定时数据返回结果测试");
return RestResponse.successResult(true);
}
return RestResponse.failure(response.getCode(),response.getMessage());
}
}
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