Commit 30e5d514 by qwmqiuwenmin

Merge branch 'developer' into 'master'

Developer

See merge request !73
parents bf32d279 46dc4f58
......@@ -48,8 +48,18 @@ public class AuditDTO implements Serializable {
private String relatedId;
private String auditStaffId;
private static final long serialVersionUID = 1L;
public String getAuditStaffId() {
return auditStaffId;
}
public void setAuditStaffId(String auditStaffId) {
this.auditStaffId = auditStaffId;
}
public String getRelatedId() {
return relatedId;
}
......
package com.gic.haoban.manage.api.dto;
import java.io.Serializable;
import java.util.Date;
public class ExternalClerkRelatedDTO implements Serializable {
private String externalClerkRelatedId;
private String wxEnterpriseId;
private String enterpriseId;
private String storeId;
private String memberId;
private String unionid;
private String externalUserId;
private String externalName;
private String addCreateTime;
private String memberUnionidRelatedId;
private String clerkId;
private String staffId;
private String wxUserId;
private Integer statusFlag;
private Date createTime;
private Date updateTime;
private static final long serialVersionUID = 1L;
public String getExternalClerkRelatedId() {
return externalClerkRelatedId;
}
public void setExternalClerkRelatedId(String externalClerkRelatedId) {
this.externalClerkRelatedId = externalClerkRelatedId == null ? null : externalClerkRelatedId.trim();
}
public String getWxEnterpriseId() {
return wxEnterpriseId;
}
public void setWxEnterpriseId(String wxEnterpriseId) {
this.wxEnterpriseId = wxEnterpriseId == null ? null : wxEnterpriseId.trim();
}
public String getEnterpriseId() {
return enterpriseId;
}
public void setEnterpriseId(String enterpriseId) {
this.enterpriseId = enterpriseId == null ? null : enterpriseId.trim();
}
public String getStoreId() {
return storeId;
}
public void setStoreId(String storeId) {
this.storeId = storeId == null ? null : storeId.trim();
}
public String getMemberId() {
return memberId;
}
public void setMemberId(String memberId) {
this.memberId = memberId == null ? null : memberId.trim();
}
public String getUnionid() {
return unionid;
}
public void setUnionid(String unionid) {
this.unionid = unionid == null ? null : unionid.trim();
}
public String getExternalName() {
return externalName;
}
public void setExternalName(String externalName) {
this.externalName = externalName == null ? null : externalName.trim();
}
public String getAddCreateTime() {
return addCreateTime;
}
public void setAddCreateTime(String addCreateTime) {
this.addCreateTime = addCreateTime == null ? null : addCreateTime.trim();
}
public String getMemberUnionidRelatedId() {
return memberUnionidRelatedId;
}
public void setMemberUnionidRelatedId(String memberUnionidRelatedId) {
this.memberUnionidRelatedId = memberUnionidRelatedId == null ? null : memberUnionidRelatedId.trim();
}
public String getClerkId() {
return clerkId;
}
public void setClerkId(String clerkId) {
this.clerkId = clerkId == null ? null : clerkId.trim();
}
public String getStaffId() {
return staffId;
}
public void setStaffId(String staffId) {
this.staffId = staffId == null ? null : staffId.trim();
}
public String getWxUserId() {
return wxUserId;
}
public void setWxUserId(String wxUserId) {
this.wxUserId = wxUserId == null ? null : wxUserId.trim();
}
public Integer getStatusFlag() {
return statusFlag;
}
public void setStatusFlag(Integer statusFlag) {
this.statusFlag = statusFlag;
}
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 getExternalUserId() {
return externalUserId;
}
public void setExternalUserId(String externalUserId) {
this.externalUserId = externalUserId;
}
}
\ No newline at end of file
......@@ -30,10 +30,12 @@ public class MemberUnionidRelatedDTO implements Serializable{
private String externalName;
private String addCreateTime;
private Date createTime;
private Date updateTime;
private String avatar;
private static final long serialVersionUID = 1L;
......@@ -157,5 +159,13 @@ public class MemberUnionidRelatedDTO implements Serializable{
this.enterpriseId = enterpriseId;
}
public String getAvatar() {
return avatar;
}
public void setAvatar(String avatar) {
this.avatar = avatar;
}
}
package com.gic.haoban.manage.api.dto;
import java.io.Serializable;
import java.util.Date;
/**
* Created By MBG-GUI-EXTENSION https://github.com/spawpaw/mybatis-generator-gui-extension
* Description:
* staff与clerk绑定日志
* @author fdh
*/
public class StaffClerkBindLogDetailDTO implements Serializable {
/**
*
*/
private Integer logId;
/**
* 被操作staff
*
*/
private String staffId;
/**
* 备操作userId
*/
private String wxUserId;
/**
* staff名称
*/
private String staffName;
/**
* 企业微信id
*
*/
private String wxEnterpriseId;
/**
* 操作人staffId
*
*/
private String optStaffId;
/**
* 操作名称
*/
private String optStaffName;
/**
* 操作类型 0 绑定 1解绑
*
*/
private Integer optType;
/**
* 渠道编码 1001=后台管理员绑定 1002=好办客户端绑定 1003=审核绑定 1004=同步绑定 2001=后台管理员解绑 2002=好办客户端解绑 1003=同步解绑
*
*/
private Integer channelCode;
/**
* gic enterpriseId
*
*/
private String enterpriseId;
/**
* gicClerkid
*
*/
private String clerkId;
/**
* 导购名称
*/
private String clerkName;
/**
* 导购手机号
*/
private String clerkPhoneNumber;
/**
* clerkcode
*
*/
private String clerkCode;
private String clerkPhone;
/**
* 关联id
*/
private String relationId;
/**
* 创建时间
*
*/
private Date createTime;
/**
* 更新时间
*
*/
private Date updateTime;
/**
*/
private static final long serialVersionUID = 1L;
public String getClerkPhone() {
return clerkPhone;
}
public void setClerkPhone(String clerkPhone) {
this.clerkPhone = clerkPhone;
}
public Integer getLogId() {
return logId;
}
public void setLogId(Integer logId) {
this.logId = logId;
}
public String getStaffId() {
return staffId;
}
public void setStaffId(String staffId) {
this.staffId = staffId;
}
public String getWxUserId() {
return wxUserId;
}
public void setWxUserId(String wxUserId) {
this.wxUserId = wxUserId;
}
public String getStaffName() {
return staffName;
}
public void setStaffName(String staffName) {
this.staffName = staffName;
}
public String getWxEnterpriseId() {
return wxEnterpriseId;
}
public void setWxEnterpriseId(String wxEnterpriseId) {
this.wxEnterpriseId = wxEnterpriseId;
}
public String getOptStaffId() {
return optStaffId;
}
public void setOptStaffId(String optStaffId) {
this.optStaffId = optStaffId;
}
public String getOptStaffName() {
return optStaffName;
}
public void setOptStaffName(String optStaffName) {
this.optStaffName = optStaffName;
}
public Integer getOptType() {
return optType;
}
public void setOptType(Integer optType) {
this.optType = optType;
}
public Integer getChannelCode() {
return channelCode;
}
public void setChannelCode(Integer channelCode) {
this.channelCode = channelCode;
}
public String getEnterpriseId() {
return enterpriseId;
}
public void setEnterpriseId(String enterpriseId) {
this.enterpriseId = enterpriseId;
}
public String getClerkId() {
return clerkId;
}
public void setClerkId(String clerkId) {
this.clerkId = clerkId;
}
public String getClerkName() {
return clerkName;
}
public void setClerkName(String clerkName) {
this.clerkName = clerkName;
}
public String getClerkPhoneNumber() {
return clerkPhoneNumber;
}
public void setClerkPhoneNumber(String clerkPhoneNumber) {
this.clerkPhoneNumber = clerkPhoneNumber;
}
public String getClerkCode() {
return clerkCode;
}
public void setClerkCode(String clerkCode) {
this.clerkCode = clerkCode;
}
public String getRelationId() {
return relationId;
}
public void setRelationId(String relationId) {
this.relationId = relationId;
}
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;
}
}
\ No newline at end of file
package com.gic.haoban.manage.api.dto;
import java.io.Serializable;
import java.util.Date;
/**
* Created By MBG-GUI-EXTENSION https://github.com/spawpaw/mybatis-generator-gui-extension
* Description:
* staff与clerk绑定日志
* @author fdh
*/
public class StaffClerkBindLogInfoDTO implements Serializable {
/**
* 操作人staffId
*
*/
private String optStaffId;
/**
* 操作类型 0 绑定 1解绑
*
*/
private Integer optType;
/**
* 渠道编码 1001=后台管理员绑定 1002=好办客户端绑定 1003=审核绑定 1004=同步绑定 2001=后台管理员解绑 2002=好办客户端解绑 1003=同步解绑
*
*/
private Integer channelCode;
/**
* 绑定关联id staffclerkId
*/
private String relationId;
/**
*/
private static final long serialVersionUID = 1L;
public String getOptStaffId() {
return optStaffId;
}
public void setOptStaffId(String optStaffId) {
this.optStaffId = optStaffId;
}
public Integer getOptType() {
return optType;
}
public void setOptType(Integer optType) {
this.optType = optType;
}
public Integer getChannelCode() {
return channelCode;
}
public void setChannelCode(Integer channelCode) {
this.channelCode = channelCode;
}
public String getRelationId() {
return relationId;
}
public void setRelationId(String relationId) {
this.relationId = relationId;
}
}
\ No newline at end of file
package com.gic.haoban.manage.api.enums;
/**
* Created by hua on 2020/6/24.
*/
public enum BindTypeEnum {
BIND(0),
UNBIND(1);
private int val;
BindTypeEnum(int val) {
this.val = val;
}
public int getVal() {
return val;
}
public void setVal(int val) {
this.val = val;
}
}
package com.gic.haoban.manage.api.enums;
/**
* Created by hua on 2020/6/24.
*/
public enum ChannelCodeEnum {
ADMIN_BIND(1001,"后台管理员绑定"),
SELF_BIND(1002,"好办客户端绑定"),
AUDIT_BIND(1003,"审核绑定"),
SYNC_BIND(1004,"GIC同步绑定"),
ADMIN_UNBIND(2001,"后台管理员解绑"),
SELF_UNBIND(2002,"好办客户端解绑"),
SYNC_UNBIND(2003,"GIC同步解绑"),
WEIXIN_DEL(2004,"微信删除解绑"),
AUDIT_UNBIND(2005,"审核解绑"),
;
private int code;
private String name;
ChannelCodeEnum(int code, String name) {
this.code = code;
this.name = name;
}
public int getCode() {
return code;
}
public void setCode(int code) {
this.code = code;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}
......@@ -15,9 +15,9 @@ public interface AuditApiService {
Page<AuditDTO> page(Integer auditType, String search,String wxEnterpriseId,String enterpriseId,Integer auditStatus,Integer auditFlag,BasePageInfo pageInfo);
String audit(String batchId,String auditId,String aduitName);
String audit(String batchId,String auditId,String aduitName,String optStaffId);
void refuse(String auditId,String auditReason,String aduitName);
void refuse(String auditId,String auditReason,String aduitStaffId,String aduitName);
int save(Integer auditType,String wxEnterpriseId,String enterpriseId,String commitStaffId,String commitStoreId,String changeField,String oldValue,String newValue);
......
package com.gic.haoban.manage.api.service;
import java.util.Date;
import java.util.List;
import com.gic.api.base.commons.Page;
import com.gic.haoban.base.api.common.BasePageInfo;
import com.gic.haoban.manage.api.dto.AuditDTO;
import com.gic.haoban.manage.api.dto.BatchAuditLogDTO;
import com.gic.haoban.manage.api.dto.ExternalClerkRelatedDTO;
import com.gic.haoban.manage.api.dto.MemberUnionidRelatedDTO;
/**
* Created by tgs on 2020/2/9.
*/
public interface ExternalClerkRelatedApiService {
List<ExternalClerkRelatedDTO> listByEnterpriseIdAndDate(String enterpriseId,Date date);
Page<ExternalClerkRelatedDTO> pageMemberUnionByParams(List<String> userIdList, List<String> sendMemberIds,
String enterpriseId, BasePageInfo pageInfo);
List<ExternalClerkRelatedDTO> listByWxEnterpriseIdAndWxUserId(String wxUserId, String wxEnterpriseId);
List<ExternalClerkRelatedDTO> listByWxEnterpriseIdAndWxUserIds(List<String> userIdList, String wxEnterpriseId);
}
......@@ -25,9 +25,9 @@ public interface MemberUnionidRelatedApiService {
List<MemberStoreDTO> listByExTernalUseridAndWxUserId(String externalUserid, String wxUserId);
String add(String wxEnterpriseId, String selfExternalUserId, String userId1);
String add(String wxEnterpriseId, String selfExternalUserId, String userId1,String storeId);
void freshWxFrend(String wxEnterpriseId, String wxUserId);
void freshWxFrend(String wxEnterpriseId, String wxUserId,String storeId);
public void cleanByCid(String cid);
......@@ -40,4 +40,8 @@ public interface MemberUnionidRelatedApiService {
List<MemberUnionidRelatedDTO> getByWxUserIdListAndWxEnterpriseId(List<String> userIdList, String wxEnterpriseId);
String addMemberUnionidRelatedNew(MemberUnionidRelatedDTO dto);
void mqFreshWxFrend(String res);
}
......@@ -3,11 +3,19 @@ package com.gic.haoban.manage.api.service;
import java.util.List;
import java.util.Set;
import com.gic.api.base.commons.Page;
import com.gic.haoban.base.api.common.BasePageInfo;
import com.gic.haoban.base.api.common.ServiceResponse;
import com.gic.haoban.manage.api.dto.StaffClerkBindLogDetailDTO;
import com.gic.haoban.manage.api.dto.StaffClerkInfoDTO;
import com.gic.haoban.manage.api.dto.StaffClerkRelationDTO;
public interface StaffClerkRelationApiService {
/**
* 绑定日志
* @param params
*/
public void bindLogMq(String params);
List<StaffClerkRelationDTO> listBindCode(String enterpriseId, Set<String> clerkCodeList);
......@@ -24,16 +32,14 @@ public interface StaffClerkRelationApiService {
* 绑定
* @return
*/
public ServiceResponse bindStaffClerk(StaffClerkRelationDTO staffClerkRelationDTO);
public ServiceResponse bindStaffClerk(StaffClerkRelationDTO staffClerkRelationDTO,String optStaffId,int chanelCode);
StaffClerkRelationDTO getByCodeAndEnterpriseId(String clerkCode, String enterpriseId);
String insert(StaffClerkRelationDTO staffClerkRelation);
void insertOrUpdate(StaffClerkRelationDTO staffClerkRelation);
void delAndInsert(StaffClerkRelationDTO staffClerkRelation);
void delAndInsert(StaffClerkRelationDTO staffClerkRelation,String optStaffId,int chanelCode);
/**
* 解绑
* @param storeId
......@@ -56,7 +62,7 @@ public interface StaffClerkRelationApiService {
/**
* 解绑
* @param staffId
* @param staffId 操作人
* @param clerkId
* @return
*/
......@@ -88,4 +94,24 @@ public interface StaffClerkRelationApiService {
*/
void delByClerkId(String clerkId);
/**
* 搜索查询列表
* @param wxEnterpriseId
* @param search
* @param enterpriseId
* @param optType
* @return
*/
public Page<StaffClerkBindLogDetailDTO> pageStaffClerkBindLog(String wxEnterpriseId, String search, String enterpriseId, int optType, BasePageInfo pageInfo);
/**
* 追加到绑定日志
* @param staffId
* @param optStaffId
* @param optType
* @param channelCode
* @param relationId
*/
public void pushToBindLog(String staffId,String optStaffId,int optType,int channelCode,String relationId);
}
......@@ -34,7 +34,7 @@ public interface MemberUnionidRelatedMapper {
List<MemberUnionidRelated> listByEnterpriseIdAndDate(@Param("enterpriseId")String enterpriseId,@Param("date")Date date);
MemberUnionidRelated getByParams(@Param("wxUserId")String wxUserId, @Param("enterpriseId")String enterpriseId,
MemberUnionidRelated getByParams(@Param("wxUserId")String wxUserId, @Param("wxEnterpriseId")String wxEnterpriseId,
@Param("externalName")String name, @Param("addCreateTime")String createTime);
List<MemberUnionidRelated> listByExTernalUseridAndWxUserId(@Param("externalUserid")String externalUserid, @Param("wxUserId")String wxUserId);
......@@ -43,4 +43,6 @@ public interface MemberUnionidRelatedMapper {
@Param("enterpriseId")String enterpriseId);
List<MemberUnionidRelated> getByWxUserIdListAndWxEnterpriseId(@Param("userIdList")List<String> userIdList, @Param("wxEnterpriseId")String wxEnterpriseId);
void cleanStaffRelated(@Param("wxEnterpriseId")String wxEnterpriseId, @Param("staffIds")List<String> staffIds);
}
\ No newline at end of file
package com.gic.haoban.manage.service.dao.mapper;
import com.gic.haoban.manage.service.entity.TabHaobanStaffClerkBindLog;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import retrofit2.http.PATCH;
import java.util.List;
@Mapper
public interface StaffClerkBindLogMapper {
/**
*/
int deleteByPrimaryKey(Integer logId);
/**
*/
int insert(TabHaobanStaffClerkBindLog record);
/**
*/
int insertSelective(TabHaobanStaffClerkBindLog record);
/**
*/
TabHaobanStaffClerkBindLog selectByPrimaryKey(Integer logId);
/**
*/
int updateByPrimaryKeySelective(TabHaobanStaffClerkBindLog record);
/**
*/
int updateByPrimaryKey(TabHaobanStaffClerkBindLog record);
/**
* 列表
* @param clerkIds
* @param staffIds
* @param enterpriseIds
* @param optType
* @return
*/
public List<TabHaobanStaffClerkBindLog> listStaffClerkBindLog(@Param("wxEnterpriseId") String wxEnterpriseId, @Param("clerkIds") List<String> clerkIds
, @Param("staffIds") List<String> staffIds, @Param("enterpriseIds") List<String> enterpriseIds, @Param("optType") int optType,@Param("search") String search);
}
\ No newline at end of file
......@@ -42,4 +42,6 @@ public interface StaffMapper {
public int cleanStaff(@Param("wxEnterpriseId")String wxEnterpriseId,@Param("staffIds")List<String> staffIds);
TabHaobanStaff getWxStaffByOne(@Param("wxEnterpriseId")String wxEnterpriseId);
public List<String> listUserStaffId(@Param("wxEnterpriseId") String wxEnterpriseId, @Param("staffIds") List<String> staffIds);
}
\ No newline at end of file
package com.gic.haoban.manage.service.dao.mapper;
import java.util.Date;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.gic.haoban.manage.service.entity.TabHaobanExternalClerkRelated;
import com.github.pagehelper.Page;
public interface TabHaobanExternalClerkRelatedMapper {
int deleteByPrimaryKey(String externalClerkRelatedId);
int insert(TabHaobanExternalClerkRelated record);
int insertSelective(TabHaobanExternalClerkRelated record);
TabHaobanExternalClerkRelated selectByPrimaryKey(String externalClerkRelatedId);
int updateByPrimaryKeySelective(TabHaobanExternalClerkRelated record);
int updateByPrimaryKey(TabHaobanExternalClerkRelated record);
TabHaobanExternalClerkRelated selectByClerkIdAndExternalUserId(@Param("clerkId")String clerkId, @Param("externalUserId")String externalUserId);
void delByUserIdAndExternalUserId(TabHaobanExternalClerkRelated record);
void delByClerkIdAndStaffId(@Param("clerkId")String clerkId, @Param("staffId")String staffId);
void cleanStaffRelated(@Param("wxEnterpriseId")String wxEnterpriseId, @Param("staffIds")List<String> staffIds);
TabHaobanExternalClerkRelated getByParams(@Param("userId")String userId, @Param("wxEnterpriseId")String wxEnterpriseId, @Param("name")String name, @Param("createTime")String createTime);
List<TabHaobanExternalClerkRelated> listByExTernalUseridAndWxUserId(@Param("externalUserid")String externalUserid, @Param("userId")String wxUserId);
List<TabHaobanExternalClerkRelated> listByEnterpriseIdAndDate(@Param("enterpriseId")String enterpriseId,@Param("date")Date date);
Page<TabHaobanExternalClerkRelated> pageMemberUnionByParams(@Param("userIdList")List<String> userIdList, @Param("sendMemberIds")List<String> sendMemberIds,
@Param("enterpriseId")String enterpriseId);
List<TabHaobanExternalClerkRelated> listByWxEnterpriseIdAndWxUserId(@Param("wxUserId")String wxUserId, @Param("wxEnterpriseId")String wxEnterpriseId);
List<TabHaobanExternalClerkRelated> listByWxEnterpriseIdAndWxUserIds(@Param("userIdList")List<String> userIdList, @Param("wxEnterpriseId")String wxEnterpriseId);
}
\ No newline at end of file
......@@ -79,4 +79,8 @@ public interface TabHaobanStaffClerkRelationMapper {
void delByClerkId(@Param("clerkId")String clerkId);
List<TabHaobanStaffClerkRelation>listByEnterpriseIdAndWxUserId(@Param("enterpriseId")String enterpriseId,@Param("wxUserId")String wxUserId);
List<TabHaobanStaffClerkRelation> lisByStaffId(@Param("wxEnterpriseId")String wxEnterpriseId, @Param("staffId")String staffId);
TabHaobanStaffClerkRelation getByCodeAndStoreId(@Param("clerkCode")String clerkCode, @Param("storeId")String storeId);
}
\ No newline at end of file
......@@ -29,7 +29,7 @@ public class MemberUnionidRelated implements Serializable {
private String externalName;
private String addCreateTime;
private static final long serialVersionUID = 1L;
public String getMemberUnionidRelatedId() {
......@@ -137,5 +137,4 @@ public class MemberUnionidRelated implements Serializable {
}
}
\ No newline at end of file
......@@ -44,9 +44,19 @@ public class TabHaobanAudit implements Serializable {
private String relatedId;
private String auditStaffId;
private static final long serialVersionUID = 1L;
public String getRelatedId() {
public String getAuditStaffId() {
return auditStaffId;
}
public void setAuditStaffId(String auditStaffId) {
this.auditStaffId = auditStaffId;
}
public String getRelatedId() {
return relatedId;
}
......
package com.gic.haoban.manage.service.entity;
import java.io.Serializable;
import java.util.Date;
public class TabHaobanExternalClerkRelated implements Serializable {
private String externalClerkRelatedId;
private String wxEnterpriseId;
private String enterpriseId;
private String storeId;
private String memberId;
private String unionid;
private String externalUserId;
private String externalName;
private String addCreateTime;
private String memberUnionidRelatedId;
private String clerkId;
private String staffId;
private String wxUserId;
private Integer statusFlag;
private Date createTime;
private Date updateTime;
private static final long serialVersionUID = 1L;
public String getExternalClerkRelatedId() {
return externalClerkRelatedId;
}
public void setExternalClerkRelatedId(String externalClerkRelatedId) {
this.externalClerkRelatedId = externalClerkRelatedId == null ? null : externalClerkRelatedId.trim();
}
public String getWxEnterpriseId() {
return wxEnterpriseId;
}
public void setWxEnterpriseId(String wxEnterpriseId) {
this.wxEnterpriseId = wxEnterpriseId == null ? null : wxEnterpriseId.trim();
}
public String getEnterpriseId() {
return enterpriseId;
}
public void setEnterpriseId(String enterpriseId) {
this.enterpriseId = enterpriseId == null ? null : enterpriseId.trim();
}
public String getStoreId() {
return storeId;
}
public void setStoreId(String storeId) {
this.storeId = storeId == null ? null : storeId.trim();
}
public String getMemberId() {
return memberId;
}
public void setMemberId(String memberId) {
this.memberId = memberId == null ? null : memberId.trim();
}
public String getUnionid() {
return unionid;
}
public void setUnionid(String unionid) {
this.unionid = unionid == null ? null : unionid.trim();
}
public String getExternalName() {
return externalName;
}
public void setExternalName(String externalName) {
this.externalName = externalName == null ? null : externalName.trim();
}
public String getAddCreateTime() {
return addCreateTime;
}
public void setAddCreateTime(String addCreateTime) {
this.addCreateTime = addCreateTime == null ? null : addCreateTime.trim();
}
public String getMemberUnionidRelatedId() {
return memberUnionidRelatedId;
}
public void setMemberUnionidRelatedId(String memberUnionidRelatedId) {
this.memberUnionidRelatedId = memberUnionidRelatedId == null ? null : memberUnionidRelatedId.trim();
}
public String getClerkId() {
return clerkId;
}
public void setClerkId(String clerkId) {
this.clerkId = clerkId == null ? null : clerkId.trim();
}
public String getStaffId() {
return staffId;
}
public void setStaffId(String staffId) {
this.staffId = staffId == null ? null : staffId.trim();
}
public String getWxUserId() {
return wxUserId;
}
public void setWxUserId(String wxUserId) {
this.wxUserId = wxUserId == null ? null : wxUserId.trim();
}
public Integer getStatusFlag() {
return statusFlag;
}
public void setStatusFlag(Integer statusFlag) {
this.statusFlag = statusFlag;
}
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 getExternalUserId() {
return externalUserId;
}
public void setExternalUserId(String externalUserId) {
this.externalUserId = externalUserId;
}
}
\ No newline at end of file
package com.gic.haoban.manage.service.entity;
import java.io.Serializable;
import java.util.Date;
/**
* Created By MBG-GUI-EXTENSION https://github.com/spawpaw/mybatis-generator-gui-extension
* Description:
* staff与clerk绑定日志
* @author fdh
*/
public class TabHaobanStaffClerkBindLog implements Serializable {
/**
*
*/
private Integer logId;
/**
* 被操作staff
*
*/
private String staffId;
/**
* 企业微信id
*
*/
private String wxEnterpriseId;
/**
* 操作人staffId
*
*/
private String optStaffId;
/**
* 操作类型 0 绑定 1解绑
*
*/
private Integer optType;
/**
* 渠道编码 1001=后台管理员绑定 1002=好办客户端绑定 1003=审核绑定 1004=同步绑定 2001=后台管理员解绑 2002=好办客户端解绑 1003=同步解绑
*
*/
private Integer channelCode;
/**
* gic enterpriseId
*
*/
private String enterpriseId;
/**
* gicClerkid
*
*/
private String clerkId;
/**
* clerkcode
*
*/
private String clerkCode;
private String clerkPhone;
/**
* 关联id
*/
private String relationId;
/**
* 0 删除 1正常
*
*/
private Integer statusFlag;
/**
* 创建时间
*
*/
private Date createTime;
/**
* 更新时间
*
*/
private Date updateTime;
/**
*/
private static final long serialVersionUID = 1L;
public String getClerkPhone() {
return clerkPhone;
}
public void setClerkPhone(String clerkPhone) {
this.clerkPhone = clerkPhone;
}
public String getRelationId() {
return relationId;
}
public void setRelationId(String relationId) {
this.relationId = relationId;
}
/**
* This method returns the value of the database column tab_haoban_staff_clerk_bind_log.log_id
*
* @return the value of tab_haoban_staff_clerk_bind_log.log_id
*/
public Integer getLogId() {
return logId;
}
/**
* This method sets the value of the database column tab_haoban_staff_clerk_bind_log.log_id
*
* @param logId the value for tab_haoban_staff_clerk_bind_log.log_id
*/
public void setLogId(Integer logId) {
this.logId = logId;
}
/**
* This method returns the value of the database column tab_haoban_staff_clerk_bind_log.staff_id
*
* @return the value of tab_haoban_staff_clerk_bind_log.staff_id
*/
public String getStaffId() {
return staffId;
}
/**
* This method sets the value of the database column tab_haoban_staff_clerk_bind_log.staff_id
*
* @param staffId the value for tab_haoban_staff_clerk_bind_log.staff_id
*/
public void setStaffId(String staffId) {
this.staffId = staffId;
}
/**
* This method returns the value of the database column tab_haoban_staff_clerk_bind_log.wx_enterprise_id
*
* @return the value of tab_haoban_staff_clerk_bind_log.wx_enterprise_id
*/
public String getWxEnterpriseId() {
return wxEnterpriseId;
}
/**
* This method sets the value of the database column tab_haoban_staff_clerk_bind_log.wx_enterprise_id
*
* @param wxEnterpriseId the value for tab_haoban_staff_clerk_bind_log.wx_enterprise_id
*/
public void setWxEnterpriseId(String wxEnterpriseId) {
this.wxEnterpriseId = wxEnterpriseId;
}
/**
* This method returns the value of the database column tab_haoban_staff_clerk_bind_log.opt_staff_id
*
* @return the value of tab_haoban_staff_clerk_bind_log.opt_staff_id
*/
public String getOptStaffId() {
return optStaffId;
}
/**
* This method sets the value of the database column tab_haoban_staff_clerk_bind_log.opt_staff_id
*
* @param optStaffId the value for tab_haoban_staff_clerk_bind_log.opt_staff_id
*/
public void setOptStaffId(String optStaffId) {
this.optStaffId = optStaffId;
}
/**
* This method returns the value of the database column tab_haoban_staff_clerk_bind_log.opt_type
*
* @return the value of tab_haoban_staff_clerk_bind_log.opt_type
*/
public Integer getOptType() {
return optType;
}
/**
* This method sets the value of the database column tab_haoban_staff_clerk_bind_log.opt_type
*
* @param optType the value for tab_haoban_staff_clerk_bind_log.opt_type
*/
public void setOptType(Integer optType) {
this.optType = optType;
}
/**
* This method returns the value of the database column tab_haoban_staff_clerk_bind_log.channel_code
*
* @return the value of tab_haoban_staff_clerk_bind_log.channel_code
*/
public Integer getChannelCode() {
return channelCode;
}
/**
* This method sets the value of the database column tab_haoban_staff_clerk_bind_log.channel_code
*
* @param channelCode the value for tab_haoban_staff_clerk_bind_log.channel_code
*/
public void setChannelCode(Integer channelCode) {
this.channelCode = channelCode;
}
/**
* This method returns the value of the database column tab_haoban_staff_clerk_bind_log.enterprise_id
*
* @return the value of tab_haoban_staff_clerk_bind_log.enterprise_id
*/
public String getEnterpriseId() {
return enterpriseId;
}
/**
* This method sets the value of the database column tab_haoban_staff_clerk_bind_log.enterprise_id
*
* @param enterpriseId the value for tab_haoban_staff_clerk_bind_log.enterprise_id
*/
public void setEnterpriseId(String enterpriseId) {
this.enterpriseId = enterpriseId;
}
/**
* This method returns the value of the database column tab_haoban_staff_clerk_bind_log.clerk_id
*
* @return the value of tab_haoban_staff_clerk_bind_log.clerk_id
*/
public String getClerkId() {
return clerkId;
}
/**
* This method sets the value of the database column tab_haoban_staff_clerk_bind_log.clerk_id
*
* @param clerkId the value for tab_haoban_staff_clerk_bind_log.clerk_id
*/
public void setClerkId(String clerkId) {
this.clerkId = clerkId;
}
/**
* This method returns the value of the database column tab_haoban_staff_clerk_bind_log.clerk_code
*
* @return the value of tab_haoban_staff_clerk_bind_log.clerk_code
*/
public String getClerkCode() {
return clerkCode;
}
/**
* This method sets the value of the database column tab_haoban_staff_clerk_bind_log.clerk_code
*
* @param clerkCode the value for tab_haoban_staff_clerk_bind_log.clerk_code
*/
public void setClerkCode(String clerkCode) {
this.clerkCode = clerkCode;
}
/**
* This method returns the value of the database column tab_haoban_staff_clerk_bind_log.status_flag
*
* @return the value of tab_haoban_staff_clerk_bind_log.status_flag
*/
public Integer getStatusFlag() {
return statusFlag;
}
/**
* This method sets the value of the database column tab_haoban_staff_clerk_bind_log.status_flag
*
* @param statusFlag the value for tab_haoban_staff_clerk_bind_log.status_flag
*/
public void setStatusFlag(Integer statusFlag) {
this.statusFlag = statusFlag;
}
/**
* This method returns the value of the database column tab_haoban_staff_clerk_bind_log.create_time
*
* @return the value of tab_haoban_staff_clerk_bind_log.create_time
*/
public Date getCreateTime() {
return createTime;
}
/**
* This method sets the value of the database column tab_haoban_staff_clerk_bind_log.create_time
*
* @param createTime the value for tab_haoban_staff_clerk_bind_log.create_time
*/
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
/**
* This method returns the value of the database column tab_haoban_staff_clerk_bind_log.update_time
*
* @return the value of tab_haoban_staff_clerk_bind_log.update_time
*/
public Date getUpdateTime() {
return updateTime;
}
/**
* This method sets the value of the database column tab_haoban_staff_clerk_bind_log.update_time
*
* @param updateTime the value for tab_haoban_staff_clerk_bind_log.update_time
*/
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
}
\ No newline at end of file
package com.gic.haoban.manage.service.pojo;
import java.io.Serializable;
public class ExternalUserPojo implements Serializable{
private String wxEnterpriseId;
private String name;
private String unionId;
private String avatar;
private String addCreateTime;
public String getWxEnterpriseId() {
return wxEnterpriseId;
}
public void setWxEnterpriseId(String wxEnterpriseId) {
this.wxEnterpriseId = wxEnterpriseId;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getUnionId() {
return unionId;
}
public void setUnionId(String unionId) {
this.unionId = unionId;
}
public String getAvatar() {
return avatar;
}
public void setAvatar(String avatar) {
this.avatar = avatar;
}
public String getAddCreateTime() {
return addCreateTime;
}
public void setAddCreateTime(String addCreateTime) {
this.addCreateTime = addCreateTime;
}
}
package com.gic.haoban.manage.service.service;
import java.util.List;
import com.gic.haoban.manage.api.dto.MemberUnionidRelatedDTO;
import com.gic.haoban.manage.service.entity.TabHaobanExternalClerkRelated;
public interface ExternalClerkRelatedService {
void insert(TabHaobanExternalClerkRelated related);
void delByUserIdAndExternalUserId(MemberUnionidRelatedDTO dto);
void delByClerkIdAndStaffId(String clerkId, String staffId);
void cleanStaffRelated(String wxEnterpriseId, List<String> staffIds);
void update(TabHaobanExternalClerkRelated exsitDTO);
TabHaobanExternalClerkRelated getByParams(String userId, String wxEnterpriseId, String name, String createTime);
List<TabHaobanExternalClerkRelated> listByExTernalUseridAndWxUserId(String externalUserid, String wxUserId);
}
......@@ -25,4 +25,6 @@ public interface MemberUnionRelatedService {
com.github.pagehelper.Page<MemberUnionidRelated> pageMemberUnionByParams(List<String> userIdList, List<String> sendMemberIds,
String enterpriseId);
void cleanStaffRelated(String wxEnterpriseId, List<String> staffIds);
}
package com.gic.haoban.manage.service.service;
import com.gic.api.base.commons.Page;
import com.gic.haoban.base.api.common.BasePageInfo;
import com.gic.haoban.manage.api.dto.StaffClerkBindLogDetailDTO;
import com.gic.haoban.manage.service.entity.TabHaobanStaffClerkBindLog;
import java.util.List;
/**
* Created 2020/6/24.
*
* @author hua
*/
public interface StaffClerkBindLogService {
/**
* 绑定日志
* @param bindLog
*/
public void insert(TabHaobanStaffClerkBindLog bindLog);
/**
* 插入日志到mq
* @param staffId
* @param optStaffId
* @param optType
* @param channelCode
* @param relationId
*/
public void pushToMq(String staffId,String optStaffId,int optType,int channelCode,String relationId);
/**
*
* @return
*/
public Page<StaffClerkBindLogDetailDTO> pageBindLog(String wxEnterpriseId,List<String> clerkIds, List<String> staffIds,List<String> enterpriseIds,int optType,String search, BasePageInfo pageInfo);
}
......@@ -17,14 +17,14 @@ public interface StaffClerkRelationService {
* @param clerkId
* @return
*/
public boolean delBind(String clerkId);
public boolean delBind(String clerkId,String optStaffId,int chanelCode);
/**
* 绑定
* @param dto
* @return
*/
public boolean bind(StaffClerkRelationDTO dto);
public String bind(StaffClerkRelationDTO dto,String optStaffId,int chanelCode);
/**
* 根据clerkId 更新数据
......@@ -55,4 +55,6 @@ public interface StaffClerkRelationService {
List<StaffClerkRelationDTO> listByClerkIds(List<String> clerkList);
List<StaffClerkRelationDTO> lisByStaffId(String wxEnterpriseId, String staffId);
}
......@@ -35,4 +35,12 @@ public interface StaffService {
TabHaobanStaff getWxStaffByOne( String wxEnterpriseId);
/**
* 获取需要删除的staff列表
* @param wxEnterpriseId
* @param staffIds
* @return
*/
public List<String> listDelUserStaffId(String wxEnterpriseId,List<String> staffIds);
}
package com.gic.haoban.manage.service.service.impl;
import java.util.Date;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import com.alibaba.dubbo.config.annotation.Service;
import com.gic.haoban.common.utils.EntityUtil;
import com.gic.haoban.common.utils.StringUtil;
import com.gic.haoban.manage.api.dto.MemberUnionidRelatedDTO;
import com.gic.haoban.manage.service.dao.mapper.TabHaobanExternalClerkRelatedMapper;
import com.gic.haoban.manage.service.entity.TabHaobanExternalClerkRelated;
import com.gic.haoban.manage.service.service.ExternalClerkRelatedService;
@Service
public class ExternalClerkRelatedServiceImpl implements ExternalClerkRelatedService {
@Autowired
private TabHaobanExternalClerkRelatedMapper mapper;
@Override
public void insert(TabHaobanExternalClerkRelated related) {
String clerkId = related.getClerkId();
String externalUserId = related.getExternalUserId();
TabHaobanExternalClerkRelated tab = mapper.selectByClerkIdAndExternalUserId(clerkId,externalUserId);
if(tab == null){
String uuId = StringUtil.randomUUID();
related.setStatusFlag(1);
related.setExternalClerkRelatedId(uuId);
related.setCreateTime(new Date());
related.setUpdateTime(new Date());
mapper.insertSelective(related);
}
}
@Override
public void delByUserIdAndExternalUserId(MemberUnionidRelatedDTO dto) {
mapper.delByUserIdAndExternalUserId(EntityUtil.changeEntityByJSON(TabHaobanExternalClerkRelated.class, dto));
}
@Override
public void delByClerkIdAndStaffId(String clerkId, String staffId) {
mapper.delByClerkIdAndStaffId(clerkId,staffId);
}
@Override
public void cleanStaffRelated(String wxEnterpriseId, List<String> staffIds) {
if(staffIds != null && !staffIds.isEmpty()){
mapper.cleanStaffRelated(wxEnterpriseId,staffIds);
}
}
@Override
public void update(TabHaobanExternalClerkRelated exsitDTO) {
exsitDTO.setUpdateTime(new Date());
mapper.updateByPrimaryKeySelective(exsitDTO);
}
@Override
public TabHaobanExternalClerkRelated getByParams(String userId, String wxEnterpriseId, String name,
String createTime) {
return mapper.getByParams(userId, wxEnterpriseId,name,createTime);
}
@Override
public List<TabHaobanExternalClerkRelated> listByExTernalUseridAndWxUserId(String externalUserid, String wxUserId) {
return mapper.listByExTernalUseridAndWxUserId(externalUserid,wxUserId);
}
}
......@@ -50,8 +50,8 @@ public class MemberUnionRelatedServiceImpl implements MemberUnionRelatedService
}
@Override
public MemberUnionidRelatedDTO getByParams(String wxUserId, String enterpriseId, String name, String createTime) {
return EntityUtil.changeEntityByJSON(MemberUnionidRelatedDTO.class,mapper.getByParams(wxUserId,enterpriseId,name,createTime));
public MemberUnionidRelatedDTO getByParams(String wxUserId, String wxEnterpriseId, String name, String createTime) {
return EntityUtil.changeEntityByJSON(MemberUnionidRelatedDTO.class,mapper.getByParams(wxUserId,wxEnterpriseId,name,createTime));
}
@Override
......@@ -70,4 +70,12 @@ public class MemberUnionRelatedServiceImpl implements MemberUnionRelatedService
String enterpriseId) {
return mapper.pageMemberUnionByParams(userIdList,sendMemberIds,enterpriseId);
}
@Override
public void cleanStaffRelated(String wxEnterpriseId, List<String> staffIds) {
if(staffIds == null || staffIds.isEmpty()){
return;
}
mapper.cleanStaffRelated(wxEnterpriseId,staffIds);
}
}
package com.gic.haoban.manage.service.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.gic.api.base.commons.Page;
import com.gic.commons.util.GICMQClientUtil;
import com.gic.haoban.base.api.common.BasePageInfo;
import com.gic.haoban.common.utils.PageUtil;
import com.gic.haoban.manage.api.dto.StaffClerkBindLogDetailDTO;
import com.gic.haoban.manage.api.dto.StaffClerkBindLogInfoDTO;
import com.gic.haoban.manage.service.dao.mapper.StaffClerkBindLogMapper;
import com.gic.haoban.manage.service.entity.TabHaobanStaffClerkBindLog;
import com.gic.haoban.manage.service.service.StaffClerkBindLogService;
import com.gic.mq.sdk.GicMQClient;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.List;
/**
* Created 2020/6/24.
*
* @author hua
*/
@Service
public class StaffClerkBindLogServiceImpl implements StaffClerkBindLogService {
private static final Logger logger= LoggerFactory.getLogger(StaffClerkBindLogServiceImpl.class);
@Autowired
private StaffClerkBindLogMapper staffClerkBindLogMapper;
private static final String STAFF_LOG_MQ="haobanStaffClerkBindLogMq";
@Override
public void insert(TabHaobanStaffClerkBindLog bindLog) {
bindLog.setCreateTime(new Date());
staffClerkBindLogMapper.insertSelective(bindLog);
}
@Override
public void pushToMq(String staffId, String optStaffId, int optType, int channelCode, String relationId) {
StaffClerkBindLogInfoDTO infoDTO = new StaffClerkBindLogInfoDTO();
infoDTO.setChannelCode(channelCode);
infoDTO.setOptStaffId(optStaffId);
infoDTO.setOptType(optType);
infoDTO.setRelationId(relationId);
GicMQClient clientInstance = GICMQClientUtil.getClientInstance();
try {
String ret = JSONObject.toJSONString(infoDTO);
logger.info("绑定的mq日志:{}",ret);
clientInstance.sendMessage(STAFF_LOG_MQ, ret);
} catch (Exception e) {
e.printStackTrace();
}
}
@Override
public Page<StaffClerkBindLogDetailDTO> pageBindLog(String wxEnterpriseId,List<String> clerkIds, List<String> staffIds, List<String> enterpriseIds, int optType,String search, BasePageInfo pageInfo) {
PageHelper.startPage(pageInfo);
List<TabHaobanStaffClerkBindLog> clerkBindLogList = staffClerkBindLogMapper.listStaffClerkBindLog(wxEnterpriseId, clerkIds, staffIds, enterpriseIds, optType,search);
Page<StaffClerkBindLogDetailDTO> retPage = PageUtil.changePageHelperToCurrentPage(new PageInfo<>(clerkBindLogList), StaffClerkBindLogDetailDTO.class);
return retPage;
}
}
......@@ -7,10 +7,17 @@ import java.util.Set;
import com.alibaba.fastjson.JSONObject;
import com.gic.commons.util.ToolUtil;
import com.gic.haoban.manage.api.enums.BindTypeEnum;
import com.gic.haoban.manage.api.enums.ChannelCodeEnum;
import com.gic.haoban.manage.service.entity.TabHaobanClerkMainStoreRelated;
import com.gic.haoban.manage.service.entity.TabHaobanStaffClerkRelation;
import com.gic.haoban.manage.service.service.ClerkMainStoreRelatedService;
import com.gic.haoban.manage.service.service.ExternalClerkRelatedService;
import com.gic.haoban.manage.service.service.StaffClerkBindLogService;
import com.gic.haoban.manage.service.service.StaffService;
import javafx.scene.control.Tab;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
......@@ -30,6 +37,22 @@ public class StaffClerkRelationServiceImpl implements StaffClerkRelationService
@Autowired
private TabHaobanStaffClerkRelationMapper mapper;
@Autowired
private StaffClerkBindLogService staffClerkBindLogService;
@Autowired
private ExternalClerkRelatedService externalClerkRelatedService;
@Autowired
private StaffService staffService;
@Autowired
private TabHaobanStaffClerkRelationMapper tabHaobanStaffClerkRelationMapper;
@Autowired
private ClerkMainStoreRelatedService clerkMainStoreRelatedService;
@Override
public List<StaffClerkRelationDTO> listBindCode(String enterpriseId, Set<String> clerkCodeList) {
return EntityUtil.changeEntityListByJSON(StaffClerkRelationDTO.class, mapper.listBindCode(enterpriseId,clerkCodeList));
......@@ -40,20 +63,68 @@ public class StaffClerkRelationServiceImpl implements StaffClerkRelationService
}
@Override
public boolean delBind(String clerkId) {
public boolean delBind(String clerkId,String optStaffId,int chanelCode) {
TabHaobanStaffClerkRelation clerkRelation = mapper.getByClerkId(clerkId);
if (null == clerkRelation) {
logger.info("已经不存在:{},{}",clerkId,optStaffId);
return true;
}
TabHaobanStaffClerkRelation staffClerkRelation = tabHaobanStaffClerkRelationMapper.getOneByClerkId(clerkId);
int i = mapper.changeStatusByClerkId(clerkId, 0);
return i>=0;
delSetMainStore(staffClerkRelation);
boolean b = i >= 0;
if (b) {
//推入日志
staffClerkBindLogService.pushToMq(clerkRelation.getStaffId(),optStaffId, BindTypeEnum.UNBIND.getVal(),chanelCode,clerkRelation.getStaffClerkRelationId());
}
return b;
}
private void delSetMainStore(TabHaobanStaffClerkRelation staffClerkRelation){
if(staffClerkRelation == null){
logger.info("staffClerkRelation为空");
return;
}
String staffId = staffClerkRelation.getStaffId();
String wxEnterpriseId = staffClerkRelation.getWxEnterpriseId();
TabHaobanClerkMainStoreRelated r = clerkMainStoreRelatedService.selectByWxEnterpriseIdAndStoreId(staffId, wxEnterpriseId);
r.setStatusFlag(0);
clerkMainStoreRelatedService.update(r);
externalClerkRelatedService.delByClerkIdAndStaffId(staffClerkRelation.getClerkId(), staffId);
List<StaffClerkRelationDTO> list = this.lisByStaffId(wxEnterpriseId, staffId);
if(list != null && list.size() >= 1){
clerkMainStoreRelatedService.setMainStore(staffId, list.get(list.size()-1).getStoreId(), wxEnterpriseId);
}
}
private void setMainStore(StaffClerkRelationDTO staffClerkRelation){
if(staffClerkRelation == null){
logger.info("staffClerkRelation为空");
return;
}
String staffId = staffClerkRelation.getStaffId();
String wxEnterpriseId = staffClerkRelation.getWxEnterpriseId();
List<StaffClerkRelationDTO> list = this.lisByStaffId(wxEnterpriseId, staffId);
if(list != null && list.size() == 1){
clerkMainStoreRelatedService.setMainStore(staffId, staffClerkRelation.getStoreId(), wxEnterpriseId);
}
}
@Override
public boolean bind(StaffClerkRelationDTO dto) {
public String bind(StaffClerkRelationDTO dto,String optStaffId,int chanelCode) {
dto.setStaffClerkRelationId(ToolUtil.randomUUID());
dto.setStatusFlag(1);
dto.setCreateTime(new Date());
dto.setUpdateTime(new Date());
int insert = mapper.insert(EntityUtil.changeEntityByJSON(TabHaobanStaffClerkRelation.class, dto));
return insert>0;
setMainStore(dto);
String s = insert > 0 ? dto.getStaffClerkRelationId() : null;
if (null != s) {
//推入日志
staffClerkBindLogService.pushToMq(dto.getStaffId(),optStaffId, BindTypeEnum.BIND.getVal(),chanelCode,dto.getStaffClerkRelationId());
}
return s;
}
@Override
......@@ -65,6 +136,8 @@ public class StaffClerkRelationServiceImpl implements StaffClerkRelationService
int i = mapper.updateByClerkId(EntityUtil.changeEntityByJSON(TabHaobanStaffClerkRelation.class, dto));
return i>=0;
}
@Override
public StaffClerkRelationDTO getBindByClerkId(String clerkId, String wxEnterpriseId) {
......@@ -88,8 +161,18 @@ public class StaffClerkRelationServiceImpl implements StaffClerkRelationService
return uuid;
}
@Override
public int cleanStaffClerk(String wxEnterpriseId, List<String> staffIds) {
return mapper.cleanStaffDepart(wxEnterpriseId,staffIds);
public int cleanStaffClerk(String wxEnterpriseId, List<String> delStaffIds) {
delStaffIds.forEach(staffId->{
List<StaffClerkRelationDTO> relationDTOS = listBindCodeByStaffId(null, staffId);
if (CollectionUtils.isNotEmpty(relationDTOS)) {
relationDTOS.forEach(mid->{
staffClerkBindLogService.pushToMq(mid.getStaffId(),"-1",BindTypeEnum.UNBIND.getVal(), ChannelCodeEnum.WEIXIN_DEL.getCode(),mid.getStaffClerkRelationId());
});
}
});
int ret = mapper.cleanStaffDepart(wxEnterpriseId, delStaffIds);
externalClerkRelatedService.cleanStaffRelated(wxEnterpriseId,delStaffIds);
return ret;
}
@Override
......@@ -112,4 +195,8 @@ public class StaffClerkRelationServiceImpl implements StaffClerkRelationService
}
return EntityUtil.changeEntityListByJSON(StaffClerkRelationDTO.class,mapper.listByClerkIds(clerkList));
}
@Override
public List<StaffClerkRelationDTO> lisByStaffId(String wxEnterpriseId, String staffId) {
return EntityUtil.changeEntityListByJSON(StaffClerkRelationDTO.class, mapper.lisByStaffId(wxEnterpriseId, staffId));
}
}
......@@ -13,6 +13,7 @@ import com.gic.haoban.common.utils.StringUtil;
import com.gic.haoban.manage.api.dto.StaffDTO;
import com.gic.haoban.manage.service.dao.mapper.StaffMapper;
import com.gic.haoban.manage.service.entity.TabHaobanStaff;
import com.gic.haoban.manage.service.service.MemberUnionRelatedService;
import com.gic.haoban.manage.service.service.StaffService;
import com.github.pagehelper.Page;
......@@ -21,6 +22,9 @@ public class StaffServiceImpl implements StaffService {
@Autowired
StaffMapper mapper;
@Autowired
private MemberUnionRelatedService memberUnionRelatedService;
@Override
public TabHaobanStaff selectById(String id) {
......@@ -85,6 +89,7 @@ public class StaffServiceImpl implements StaffService {
@Override
public int cleanStaff(String wxEnterpriseId, List<String> staffIds) {
memberUnionRelatedService.cleanStaffRelated(wxEnterpriseId,staffIds);
return mapper.cleanStaff(wxEnterpriseId,staffIds);
}
......@@ -92,4 +97,9 @@ public class StaffServiceImpl implements StaffService {
public TabHaobanStaff getWxStaffByOne(String wxEnterpriseId) {
return mapper.getWxStaffByOne(wxEnterpriseId);
}
@Override
public List<String> listDelUserStaffId(String wxEnterpriseId, List<String> staffIds) {
return mapper.listUserStaffId(wxEnterpriseId,staffIds);
}
}
......@@ -8,6 +8,7 @@ import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import com.gic.haoban.manage.api.enums.*;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
......@@ -39,10 +40,6 @@ import com.gic.haoban.manage.api.dto.EnterpriseDetailDTO;
import com.gic.haoban.manage.api.dto.StaffClerkRelationDTO;
import com.gic.haoban.manage.api.dto.StaffDepartmentRelatedDTO;
import com.gic.haoban.manage.api.dto.StoreAddressDTO;
import com.gic.haoban.manage.api.enums.AppPageType;
import com.gic.haoban.manage.api.enums.AuditRsultType;
import com.gic.haoban.manage.api.enums.AuditType;
import com.gic.haoban.manage.api.enums.StoreFieldEnum;
import com.gic.haoban.manage.api.service.AuditApiService;
import com.gic.haoban.manage.api.service.StaffClerkRelationApiService;
import com.gic.haoban.manage.api.service.StaffDepartmentRelatedApiService;
......@@ -160,7 +157,7 @@ public class AuditApiServiceImpl implements AuditApiService{
}
@Transactional
@Override
public String audit(String batchId,String auditId,String auditName) {
public String audit(String batchId,String auditId,String auditName,String optStaffId) {
TabHaobanAudit tab = auditMapper.selectByPrimaryKey(auditId);
if(tab==null){
return "审核项目不存在";
......@@ -169,6 +166,7 @@ public class AuditApiServiceImpl implements AuditApiService{
tab.setAuditId(auditId);
tab.setUpdateTime(new Date());
tab.setAuditName(auditName);
tab.setAuditStaffId(optStaffId);
if(auditType == AuditType.STORE_CHANGE.getCode()){
//门店信息变更
String storeId = tab.getCommitStoreId();
......@@ -225,7 +223,8 @@ public class AuditApiServiceImpl implements AuditApiService{
staffClerkRelation.setWxEnterpriseId(tab.getWxEnterpriseId());
staffClerkRelation.setWxUserId(obj.getWxUserId());
staffClerkRelation.setStaffId(obj.getStaffId());
staffClerkRelationApiService.delAndInsert(staffClerkRelation); }
staffClerkRelationApiService.delAndInsert(staffClerkRelation,optStaffId, ChannelCodeEnum.AUDIT_BIND.getCode());
}
if(org.apache.commons.lang.StringUtils.isNotBlank(batchId)){
insertBatchLog( batchId,AuditRsultType.success.getCode(), tab);
}
......@@ -261,8 +260,12 @@ public class AuditApiServiceImpl implements AuditApiService{
if(org.apache.commons.lang.StringUtils.isNotBlank(batchId)){
insertBatchLog( batchId,AuditRsultType.success.getCode(),tab);
}
//解绑日志
StaffClerkRelationDTO relationDTO = staffClerkRelationApiService.getByClerkId(obj.getClerkId());
if (null != relationDTO) {
staffClerkRelationApiService.pushToBindLog(relationDTO.getStaffId(),optStaffId,BindTypeEnum.UNBIND.getVal(),ChannelCodeEnum.SELF_UNBIND.getCode(),relationDTO.getStaffClerkRelationId());
}
staffClerkRelationApiService.delByClerkId(obj.getClerkId());
staffDepartmentRelatedApiService.sendClerkDel(obj.getClerkName(), obj.getClerkCode(),tab.getCommitStoreId(), 1, "");
}else if(auditType == AuditType.CLERK_UNBIND.getCode()){
//解绑申请,无需审核,直接通过
......@@ -272,13 +275,14 @@ public class AuditApiServiceImpl implements AuditApiService{
return "";
}
@Override
public void refuse(String auditId, String auditReason,String auditName) {
public void refuse(String auditId, String auditReason,String auditStaffId,String auditName) {
TabHaobanAudit tab = new TabHaobanAudit();
tab.setAuditId(auditId);
tab.setAuditStatus(2);
tab.setUpdateTime(new Date());
tab.setAuditReason(auditReason);
tab.setAuditName(auditName);
tab.setAuditStaffId(auditStaffId);
auditMapper.updateByPrimaryKeySelective(tab);
TabHaobanAudit tab2 = auditMapper.selectByPrimaryKey(auditId);
int auditType = tab2.getAuditType();
......
......@@ -574,9 +574,14 @@ public class DealSyncOperationApiServiceImpl implements DealSyncOperationApiServ
List<StaffDTO> retLists = staffService.listByUserIdsAndWxEnterpriseId(clerkIds, wxEnterpriseId);
List<String> staffIds = retLists.stream().map(StaffDTO::getStaffId).collect(Collectors.toList());
if (CollectionUtils.isNotEmpty(staffIds)) {
staffClerkRelationService.cleanStaffClerk(wxEnterpriseId, staffIds);
staffService.cleanStaff(wxEnterpriseId, staffIds);
staffDepartmentRelatedService.cleanStaffDepartment(wxEnterpriseId,staffIds);
List<String> delStaffIds = staffService.listDelUserStaffId(wxEnterpriseId, staffIds);
if (CollectionUtils.isEmpty(delStaffIds)) {
logger.info("没有要删除的用户:{}--{}",wxEnterpriseId,taskId);
}else {
staffClerkRelationService.cleanStaffClerk(wxEnterpriseId, delStaffIds);
staffService.cleanStaff(wxEnterpriseId, delStaffIds);
staffDepartmentRelatedService.cleanStaffDepartment(wxEnterpriseId, delStaffIds);
}
}
}
......
package com.gic.haoban.manage.service.service.out.impl;
import com.gic.haoban.base.api.common.BasePageInfo;
import com.gic.haoban.common.utils.PageUtil;
import com.gic.haoban.manage.api.dto.*;
import java.util.Collections;
import java.util.Date;
import java.util.List;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.gic.api.base.commons.Page;
import com.gic.commons.util.EntityUtil;
import com.gic.haoban.manage.api.service.ExternalClerkRelatedApiService;
import com.gic.haoban.manage.service.dao.mapper.TabHaobanExternalClerkRelatedMapper;
import com.gic.haoban.manage.service.entity.TabHaobanExternalClerkRelated;
import com.github.pagehelper.PageHelper;
@Service
public class ExternalClerkRelatedApiServiceImpl implements ExternalClerkRelatedApiService{
private static final Logger log = LogManager.getLogger(ExternalClerkRelatedApiServiceImpl.class);
@Autowired
private TabHaobanExternalClerkRelatedMapper tabHaobanExternalClerkRelatedMapper;
@Override
public List<ExternalClerkRelatedDTO> listByEnterpriseIdAndDate(
String enterpriseId, Date date) {
List<TabHaobanExternalClerkRelated> list = tabHaobanExternalClerkRelatedMapper.listByEnterpriseIdAndDate(enterpriseId,date);
return EntityUtil.changeEntityListByJSON(ExternalClerkRelatedDTO.class,list);
}
@Override
public Page<ExternalClerkRelatedDTO> pageMemberUnionByParams(List<String> userIdList, List<String> sendMemberIds,
String enterpriseId, BasePageInfo pageInfo) {
PageHelper.startPage(pageInfo.getPageNum(), pageInfo.getPageSize());
return PageUtil.changePageHelperToCurrentPage(tabHaobanExternalClerkRelatedMapper.pageMemberUnionByParams(userIdList,sendMemberIds,enterpriseId),ExternalClerkRelatedDTO.class);
}
@Override
public List<ExternalClerkRelatedDTO> listByWxEnterpriseIdAndWxUserId(String wxUserId, String wxEnterpriseId) {
return EntityUtil.changeEntityListByJSON(ExternalClerkRelatedDTO.class, tabHaobanExternalClerkRelatedMapper.listByWxEnterpriseIdAndWxUserId(wxUserId,wxEnterpriseId));
}
@Override
public List<ExternalClerkRelatedDTO> listByWxEnterpriseIdAndWxUserIds(List<String> userIdList,
String wxEnterpriseId) {
if(userIdList == null || userIdList.isEmpty()){
return Collections.EMPTY_LIST;
}
return EntityUtil.changeEntityListByJSON(ExternalClerkRelatedDTO.class, tabHaobanExternalClerkRelatedMapper.listByWxEnterpriseIdAndWxUserIds(userIdList,wxEnterpriseId));
}
}
......@@ -9,6 +9,7 @@ import java.util.stream.Collectors;
import com.alibaba.fastjson.JSONObject;
import com.gic.commons.util.GlobalInfo;
import com.gic.commons.util.GlobalVar;
import com.gic.commons.util.ImageUtil;
import com.gic.haoban.manage.api.dto.*;
import com.gic.haoban.manage.api.enums.SecretTypeEnum;
import com.gic.haoban.manage.api.service.DepartmentApiService;
......@@ -453,7 +454,7 @@ public class StaffApiServiceImpl implements StaffApiService {
Set<String> newDepartIds = departmentDTOList.stream().map(DepartmentDTO::getDepartmentId).collect(Collectors.toSet());
Set<String> hasDepartIds = hasRelationMap.keySet();
Sets.SetView<String> delDepartIds = Sets.difference(hasDepartIds, newDepartIds);
Sets.SetView<String> updateDepartIds = Sets.difference(newDepartIds,hasDepartIds );
Sets.SetView<String> updateDepartIds = Sets.intersection(newDepartIds,hasDepartIds );//交集
logger.info("删除部门:{}",JSONObject.toJSONString(delDepartIds));
if (!delDepartIds.isEmpty()) {
delDepartIds.forEach(delDepartId->{
......@@ -483,6 +484,7 @@ public class StaffApiServiceImpl implements StaffApiService {
@Override
public void wxGetAdd(String userId,String wxEnterpriseId){
RedisUtil.lock("haoban_add_user" + wxEnterpriseId + userId, 2l);
ServiceResponse wxSaveNew = getWxSaveNew(userId, wxEnterpriseId);
logger.info("信息:{}",JSONObject.toJSONString(wxSaveNew));
}
......@@ -1339,9 +1341,10 @@ public class StaffApiServiceImpl implements StaffApiService {
private String changeHeaderImageUrl(String headImgUrl) {
// InputStream in = new URL(headImgUrl).openStream();
try {
InputStream in = new URL(headImgUrl).openStream();
byte[] data = IOUtils.toByteArray(in);
byte[] data = ImageUtil.getImgbyte(headImgUrl);
// byte[] data = IOUtils.toByteArray(in);
PicUploadResDTO uploadPic = qqCloudPicService.uploadPic(GlobalVar.ctxPropertiesMap.get(GlobalInfo.QQPIC_KEY_ENTERPRISE), data);
logger.info("腾讯云万象优图返回" + JSON.toJSONString(uploadPic));
return uploadPic.downloadUrl;
......
......@@ -6,10 +6,15 @@ import com.gic.binlog.base.entity.GicRecord;
import com.gic.binlog.base.entity.enums.GicRecordType;
import com.gic.commons.util.EntityUtil;
import com.gic.dubbo.entity.ProviderLocalTag;
import com.gic.haoban.base.api.common.ServiceResponse;
import com.gic.haoban.contacts.manage.api.enums.StatusEnum;
import com.gic.haoban.manage.api.dto.StaffClerkBindLogInfoDTO;
import com.gic.haoban.manage.api.dto.StaffClerkRelationDTO;
import com.gic.haoban.manage.api.enums.ChannelCodeEnum;
import com.gic.haoban.manage.api.service.StaffClerkRelationApiService;
import com.gic.haoban.manage.service.pojo.BinlogBasePojo;
import com.gic.haoban.manage.service.pojo.ClerkSyncPojo;
import com.gic.haoban.manage.service.service.StaffClerkBindLogService;
import com.gic.haoban.manage.service.service.StaffClerkRelationService;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.time.DateUtils;
......@@ -37,6 +42,13 @@ public class KafkaMessageServiceImpl implements MessageListener<String, GicRecor
@Autowired
private StaffClerkRelationService staffClerkRelationService;
@Autowired
private StaffClerkBindLogService staffClerkBindLogService;
@Autowired
private StaffClerkRelationApiService staffClerkRelationApiService;
@Override
public void onMessage(ConsumerRecord<String, GicRecord> record) {
......@@ -59,7 +71,7 @@ public class KafkaMessageServiceImpl implements MessageListener<String, GicRecor
private void dealClerk(ClerkSyncPojo syncPojo) {
GicRecordType gicRecordType = GicRecordType.valueOf(syncPojo.getRecordType());
if(gicRecordType.equals(GicRecordType.DELETE)){
staffClerkRelationService.delBind(syncPojo.getClerkId());
staffClerkRelationService.delBind(syncPojo.getClerkId(),"-1", ChannelCodeEnum.SYNC_UNBIND.getCode());
}else if (gicRecordType.equals(GicRecordType.INSERT)) {
StaffClerkRelationDTO relationDTO = staffClerkRelationService.getOneBindCodeNoStatus(syncPojo.getEnterpriseId(), syncPojo.getClerkCode());
moveOrAddClerk(syncPojo,relationDTO);
......@@ -71,14 +83,13 @@ public class KafkaMessageServiceImpl implements MessageListener<String, GicRecor
//非正常状态 删除
if (!syncPojo.getStatus().equals(1)) {
logger.info("删除操作:{}",syncPojo.getClerkId());
staffClerkRelationService.delBind(syncPojo.getClerkId());
staffClerkRelationService.delBind(syncPojo.getClerkId(),"-1", ChannelCodeEnum.SYNC_UNBIND.getCode());
}else {
List<String> clerkIds=new ArrayList<>();
clerkIds.add(syncPojo.getClerkId());
StaffClerkRelationDTO clerkRelationDTO = staffClerkRelationService.getByClerkId(syncPojo.getClerkId());
if (clerkRelationDTO != null) {
logger.info("更新关联信息1:{}",syncPojo.getClerkId());
staffClerkRelationService.updateByClerkId(relationDTO);
return;
......@@ -86,10 +97,8 @@ public class KafkaMessageServiceImpl implements MessageListener<String, GicRecor
StaffClerkRelationDTO bindRelationDTO = staffClerkRelationService.getOneBindCodeNoStatus(syncPojo.getEnterpriseId(), syncPojo.getClerkCode());
if (null == bindRelationDTO) {
logger.info("没有关联导购,不需要操作:{}", syncPojo.getClerkId());
return;
}
logger.info("走新增逻辑:{}",syncPojo.getClerkId());
//走新增逻辑
moveOrAddClerk(syncPojo,bindRelationDTO);
......@@ -104,17 +113,19 @@ public class KafkaMessageServiceImpl implements MessageListener<String, GicRecor
}
//正常的时候
if (relationDTO.getStatusFlag() != StatusEnum.DEL.getValue()) {
staffClerkRelationService.delBind(relationDTO.getClerkId());
staffClerkRelationService.delBind(relationDTO.getClerkId(),"-1", ChannelCodeEnum.SYNC_UNBIND.getCode());
relationDTO.setClerkId(syncPojo.getClerkId());
relationDTO.setStoreId(syncPojo.getStoreId());
staffClerkRelationService.bind(relationDTO);
ServiceResponse response = staffClerkRelationApiService.bindStaffClerk(relationDTO, "-1", ChannelCodeEnum.SYNC_BIND.getCode());
logger.info("绑定结果正常:{},{}",JSONObject.toJSONString(response),relationDTO.getClerkId());
}else {//删除状态 需要判断是否近段时间有操作删除 2分组内有更新 判断是转移操作
Date timeDiff = DateUtils.addMinutes(new Date(), -2);
if(relationDTO.getUpdateTime().after(timeDiff)){
staffClerkRelationService.delBind(relationDTO.getClerkId());
staffClerkRelationService.delBind(relationDTO.getClerkId(),"-1", ChannelCodeEnum.SYNC_UNBIND.getCode());
relationDTO.setClerkId(syncPojo.getClerkId());
relationDTO.setStoreId(syncPojo.getStoreId());
staffClerkRelationService.bind(relationDTO);
ServiceResponse response = staffClerkRelationApiService.bindStaffClerk(relationDTO, "-1", ChannelCodeEnum.SYNC_BIND.getCode());
logger.info("绑定结果:{},{}",JSONObject.toJSONString(response),relationDTO.getClerkId());
}
}
}
......
......@@ -44,6 +44,7 @@
<dubbo:service interface="com.gic.haoban.manage.api.service.MaterialApiService" ref="materialApiServiceImpl" timeout="10000"/>
<dubbo:service interface="com.gic.haoban.manage.api.service.ApplicationTemplateApiService" ref="applicationTemplateApiServiceImpl" timeout="10000"/>
<dubbo:service interface="com.gic.haoban.manage.api.service.ExternalClerkRelatedApiService" ref="externalClerkRelatedApiServiceImpl" timeout="10000"/>
<dubbo:service interface="com.gic.haoban.manage.api.service.StaffClerkRelationApiService" ref="staffClerkRelationApiServiceImpl" timeout="10000"/>
<dubbo:service interface="com.gic.haoban.manage.api.service.DealSyncOperationApiService"
......@@ -57,6 +58,7 @@
<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.ClerkNewService" id="clerkNewService"/>
<dubbo:reference interface="com.gic.member.api.service.MemberService" id="memberService"/>
......
......@@ -256,7 +256,7 @@
from tab_haoban_member_unionid_related
where wx_user_id = #{wxUserId}
and status_flag = 1
and enterprise_id = #{enterpriseId}
and wx_enterprise_id = #{wxEnterpriseId}
and external_name = #{externalName}
and add_create_time = #{addCreateTime}
</select>
......@@ -290,4 +290,18 @@
#{wxUserId, jdbcType=CHAR}
</foreach>
</select>
<update id="cleanStaffRelated" parameterType="com.gic.haoban.manage.service.entity.MemberUnionidRelated" >
update tab_haoban_member_unionid_related
set status_flag = 0,
update_time = now()
where wx_enterprise_id = #{wxEnterpriseId,jdbcType=VARCHAR}
and wx_user_id in
(select wx_user_id from tab_haoban_staff where staff_id in
<foreach collection="staffIds" item="id" index="index" open="(" close=")" separator=",">
#{id,jdbcType=VARCHAR}
</foreach>
)
and status_flag = 1
</update>
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.gic.haoban.manage.service.dao.mapper.StaffClerkBindLogMapper">
<resultMap id="BaseResultMap" type="com.gic.haoban.manage.service.entity.TabHaobanStaffClerkBindLog">
<id column="log_id" jdbcType="INTEGER" property="logId" />
<result column="staff_id" jdbcType="VARCHAR" property="staffId" />
<result column="wx_enterprise_id" jdbcType="VARCHAR" property="wxEnterpriseId" />
<result column="opt_staff_id" jdbcType="VARCHAR" property="optStaffId" />
<result column="opt_type" jdbcType="INTEGER" property="optType" />
<result column="channel_code" jdbcType="INTEGER" property="channelCode" />
<result column="enterprise_id" jdbcType="VARCHAR" property="enterpriseId" />
<result column="clerk_id" jdbcType="VARCHAR" property="clerkId" />
<result column="clerk_code" jdbcType="VARCHAR" property="clerkCode" />
<result column="clerk_phone" jdbcType="VARCHAR" property="clerkPhone" />
<result column="status_flag" jdbcType="INTEGER" property="statusFlag" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
</resultMap>
<sql id="Base_Column_List">
log_id, staff_id, wx_enterprise_id, opt_staff_id, opt_type, channel_code, enterprise_id,
clerk_id, clerk_code,clerk_phone, status_flag, create_time, update_time
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from tab_haoban_staff_clerk_bind_log
where log_id = #{logId,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from tab_haoban_staff_clerk_bind_log
where log_id = #{logId,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.gic.haoban.manage.service.entity.TabHaobanStaffClerkBindLog">
insert into tab_haoban_staff_clerk_bind_log (staff_id, wx_enterprise_id,
opt_staff_id, opt_type, channel_code,
enterprise_id, clerk_id, clerk_code, clerk_phone,
status_flag, create_time, update_time
)
values ( #{staffId,jdbcType=VARCHAR}, #{wxEnterpriseId,jdbcType=VARCHAR},
#{optStaffId,jdbcType=VARCHAR}, #{optType,jdbcType=INTEGER}, #{channelCode,jdbcType=INTEGER},
#{enterpriseId,jdbcType=VARCHAR}, #{clerkId,jdbcType=VARCHAR}, #{clerkCode,jdbcType=VARCHAR},#{clerk_phone,jdbcType=VARCHAR},
#{statusFlag,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}
)
</insert>
<insert id="insertSelective" parameterType="com.gic.haoban.manage.service.entity.TabHaobanStaffClerkBindLog">
insert into tab_haoban_staff_clerk_bind_log
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="logId != null">
log_id,
</if>
<if test="staffId != null">
staff_id,
</if>
<if test="wxEnterpriseId != null">
wx_enterprise_id,
</if>
<if test="optStaffId != null">
opt_staff_id,
</if>
<if test="optType != null">
opt_type,
</if>
<if test="channelCode != null">
channel_code,
</if>
<if test="enterpriseId != null">
enterprise_id,
</if>
<if test="clerkId != null">
clerk_id,
</if>
<if test="clerkCode != null">
clerk_code,
</if>
<if test="clerkPhone != null">
clerk_phone,
</if>
<if test="statusFlag != null">
status_flag,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateTime != null">
update_time,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="logId != null">
#{logId,jdbcType=INTEGER},
</if>
<if test="staffId != null">
#{staffId,jdbcType=VARCHAR},
</if>
<if test="wxEnterpriseId != null">
#{wxEnterpriseId,jdbcType=VARCHAR},
</if>
<if test="optStaffId != null">
#{optStaffId,jdbcType=VARCHAR},
</if>
<if test="optType != null">
#{optType,jdbcType=INTEGER},
</if>
<if test="channelCode != null">
#{channelCode,jdbcType=INTEGER},
</if>
<if test="enterpriseId != null">
#{enterpriseId,jdbcType=VARCHAR},
</if>
<if test="clerkId != null">
#{clerkId,jdbcType=VARCHAR},
</if>
<if test="clerkCode != null">
#{clerkCode,jdbcType=VARCHAR},
</if>
<if test="clerkPhone != null">
#{clerkPhone,jdbcType=VARCHAR},
</if>
<if test="statusFlag != null">
#{statusFlag,jdbcType=INTEGER},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=TIMESTAMP},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.gic.haoban.manage.service.entity.TabHaobanStaffClerkBindLog">
update tab_haoban_staff_clerk_bind_log
<set>
<if test="staffId != null">
staff_id = #{staffId,jdbcType=VARCHAR},
</if>
<if test="wxEnterpriseId != null">
wx_enterprise_id = #{wxEnterpriseId,jdbcType=VARCHAR},
</if>
<if test="optStaffId != null">
opt_staff_id = #{optStaffId,jdbcType=VARCHAR},
</if>
<if test="optType != null">
opt_type = #{optType,jdbcType=INTEGER},
</if>
<if test="channelCode != null">
channel_code = #{channelCode,jdbcType=INTEGER},
</if>
<if test="enterpriseId != null">
enterprise_id = #{enterpriseId,jdbcType=VARCHAR},
</if>
<if test="clerkId != null">
clerk_id = #{clerkId,jdbcType=VARCHAR},
</if>
<if test="clerkCode != null">
clerk_code = #{clerkCode,jdbcType=VARCHAR},
</if>
<if test="statusFlag != null">
status_flag = #{statusFlag,jdbcType=INTEGER},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
</set>
where log_id = #{logId,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.gic.haoban.manage.service.entity.TabHaobanStaffClerkBindLog">
update tab_haoban_staff_clerk_bind_log
set staff_id = #{staffId,jdbcType=VARCHAR},
wx_enterprise_id = #{wxEnterpriseId,jdbcType=VARCHAR},
opt_staff_id = #{optStaffId,jdbcType=VARCHAR},
opt_type = #{optType,jdbcType=INTEGER},
channel_code = #{channelCode,jdbcType=INTEGER},
enterprise_id = #{enterpriseId,jdbcType=VARCHAR},
clerk_id = #{clerkId,jdbcType=VARCHAR},
clerk_code = #{clerkCode,jdbcType=VARCHAR},
status_flag = #{statusFlag,jdbcType=INTEGER},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP}
where log_id = #{logId,jdbcType=INTEGER}
</update>
<select id="listStaffClerkBindLog" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from tab_haoban_staff_clerk_bind_log
where wx_enterprise_id=#{wxEnterpriseId}
<if test="clerkIds!=null and clerkIds.size()>0">
and clerk_id in
<foreach collection="clerkIds" item="item" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
<if test="staffIds!=null and staffIds.size()>0">
and staff_id in
<foreach collection="staffIds" item="item" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
<if test="enterpriseIds!=null and enterpriseIds.size()>0">
and enterprise_id in
<foreach collection="enterpriseIds" item="item" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
<if test="optType!=-1">
and opt_type=#{optType}
</if>
<if test="search!=null and search.length()>0">
and (clerk_code = #{search} or clerk_phone = #{search})
</if>
order by create_time desc
</select>
</mapper>
\ No newline at end of file
......@@ -328,10 +328,11 @@
<update id="cleanStaffDepartment" >
update tab_haoban_staff_department_related
set
status_flag = 0
status_flag = 0,
update_time = now()
where wx_enterprise_id = #{wxEnterpriseId}
and status_flag = 1
and staff_id not in
and staff_id in
<foreach collection="staffIds" item="item" open="(" separator="," close=")">
#{item}
</foreach>
......
......@@ -347,8 +347,8 @@
status_flag = 0,
update_time = now()
where wx_enterprise_id = #{wxEnterpriseId,jdbcType=VARCHAR} and status_flag = 1 and super_manager_flag!=1
and staff_id not in
where wx_enterprise_id = #{wxEnterpriseId,jdbcType=VARCHAR} and status_flag = 1
and staff_id in
<foreach collection="staffIds" item="item" open="(" separator="," close=")">
#{item}
</foreach>
......@@ -363,4 +363,14 @@
and wx_user_id is not null and wx_user_id!=''
limit 1
</select>
<select id="listUserStaffId" resultType="string">
select staff_id FROM tab_haoban_staff
WHERE
wx_enterprise_id = #{wxEnterpriseId,jdbcType=VARCHAR} and status_flag = 1 and super_manager_flag is null
and staff_id not in
<foreach collection="staffIds" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</select>
</mapper>
\ No newline at end of file
......@@ -22,11 +22,12 @@
<result column="status_flag" property="statusFlag" jdbcType="INTEGER" />
<result column="wx_enterprise_id" property="wxEnterpriseId" jdbcType="VARCHAR" />
<result column="related_id" property="relatedId" jdbcType="VARCHAR" />
<result column="audit_staff_id" property="auditStaffId" jdbcType="VARCHAR" />
</resultMap>
<sql id="Base_Column_List" >
audit_id, audit_type, commit_name, commit_staff_id, commit_staff_name, commit_staff_img,
commit_store_id, change_field, old_value, new_value, commit_time, enterprise_id,
audit_name, audit_status, audit_reason, create_time, update_time, status_flag, wx_enterprise_id,related_id
audit_name, audit_status, audit_reason, create_time, update_time, status_flag, wx_enterprise_id,related_id,audit_staff_id
</sql>
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
select
......@@ -45,14 +46,14 @@
new_value, commit_time, enterprise_id,
audit_name, audit_status, audit_reason,
create_time, update_time, status_flag,
wx_enterprise_id,related_id)
wx_enterprise_id,related_id,audit_staff_id)
values (#{auditId,jdbcType=VARCHAR}, #{auditType,jdbcType=INTEGER}, #{commitName,jdbcType=VARCHAR},
#{commitStaffId,jdbcType=VARCHAR}, #{commitStaffName,jdbcType=VARCHAR}, #{commitStaffImg,jdbcType=VARCHAR},
#{commitStoreId,jdbcType=VARCHAR}, #{changeField,jdbcType=VARCHAR}, #{oldValue,jdbcType=VARCHAR},
#{newValue,jdbcType=VARCHAR}, #{commitTime,jdbcType=TIMESTAMP}, #{enterpriseId,jdbcType=VARCHAR},
#{auditName,jdbcType=VARCHAR}, #{auditStatus,jdbcType=INTEGER}, #{auditReason,jdbcType=VARCHAR},
#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, #{statusFlag,jdbcType=INTEGER},
#{wxEnterpriseId,jdbcType=VARCHAR},#{relatedId,jdbcType=VARCHAR})
#{wxEnterpriseId,jdbcType=VARCHAR},#{relatedId,jdbcType=VARCHAR},#{auditStaffId,jdbcType=VARCHAR})
</insert>
<insert id="insertSelective" parameterType="com.gic.haoban.manage.service.entity.TabHaobanAudit" >
insert into tab_haoban_audit
......@@ -117,6 +118,9 @@
<if test="relatedId != null" >
related_id,
</if>
<if test="auditStaffId != null" >
audit_staff_id,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides="," >
<if test="auditId != null" >
......@@ -179,6 +183,9 @@
<if test="relatedId != null" >
#{relatedId,jdbcType=VARCHAR},
</if>
<if test="auditStaffId != null" >
#{auditStaffId,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.gic.haoban.manage.service.entity.TabHaobanAudit" >
......@@ -241,6 +248,9 @@
<if test="relatedId != null" >
related_id = #{relatedId,jdbcType=VARCHAR},
</if>
<if test="auditStaffId != null" >
audit_staff_id = #{auditStaffId,jdbcType=VARCHAR},
</if>
</set>
where audit_id = #{auditId,jdbcType=VARCHAR}
</update>
......@@ -264,7 +274,8 @@
update_time = #{updateTime,jdbcType=TIMESTAMP},
status_flag = #{statusFlag,jdbcType=INTEGER},
wx_enterprise_id = #{wxEnterpriseId,jdbcType=VARCHAR},
related_id = #{relatedId,jdbcType=VARCHAR}
related_id = #{relatedId,jdbcType=VARCHAR},
audit_staff_id = #{auditStaffId,jdbcType=VARCHAR}
where audit_id = #{auditId,jdbcType=VARCHAR}
</update>
<sql id="storeSql">
......@@ -355,6 +366,7 @@
where 1=1
and commit_store_id = #{storeId,jdbcType=VARCHAR}
and audit_status = 0
and audit_type = 1
</select>
<select id="findByStoreIdAndChangeField" resultMap="BaseResultMap" >
select
......
......@@ -277,7 +277,7 @@
status_flag = 0,
update_time = now()
where wx_enterprise_id = #{wxEnterpriseId} and status_flag = 1 and
staff_id not in
staff_id in
<foreach collection="staffIds" item="item" open="(" separator="," close=")">
#{item}
</foreach>
......@@ -338,4 +338,25 @@
and wx_user_id = #{wxUserId}
</select>
<select id="lisByStaffId" resultMap="BaseResultMap" parameterType="java.lang.String" >
select
<include refid="Base_Column_List" />
from tab_haoban_staff_clerk_relation
where
wx_enterprise_id = #{wxEnterpriseId,jdbcType=VARCHAR}
and staff_id = #{staffId}
and status_flag = 1
order by create_time desc
</select>
<select id="getByCodeAndStoreId" resultMap="BaseResultMap" parameterType="java.lang.String" >
select
<include refid="Base_Column_List" />
from tab_haoban_staff_clerk_relation
where
clerk_code = #{clerkCode}
and store_id = #{storeId}
and status_flag = 1
</select>
</mapper>
\ No newline at end of file
......@@ -176,7 +176,7 @@
<include refid="Base_Column_List" />
from tab_haoban_wx_enterprise_related
where status_flag = 1
AND AND DATE_FORMAT(update_time,'%Y-%m-%d') = #{time}
AND DATE_FORMAT(update_time,'%Y-%m-%d') = #{time}
</select>
</mapper>
\ No newline at end of file
......@@ -16,7 +16,9 @@ import com.gic.haoban.manage.api.service.AuditApiService;
import com.gic.haoban.manage.api.service.AuditSettingApiService;
import com.gic.haoban.manage.api.service.StaffApiService;
import com.gic.haoban.manage.web.anno.HttpLimit;
import com.gic.haoban.manage.web.auth.AuthRequestUtil;
import com.gic.haoban.manage.web.vo.BatchApproveVO;
import com.gic.haoban.manage.web.vo.LoginVO;
import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
......@@ -161,12 +163,16 @@ public class AuditController extends WebBaseController{
if(StringUtils.isAnyBlank(auditIds,auditName)){
return resultResponse(HaoBanErrCode.ERR_2);
}
LoginVO login = (LoginVO) AuthRequestUtil.getLoginUser();
String staffId = login.getStaffDTO().getStaffId();
String staffName = login.getStaffDTO().getStaffName();
String[] s = auditIds.split(",");
int successCount = 0;
int failCount = 0;
String batchId = UuidUtil.randomUUID();
for(String auditId : s){
String result = auditApiService.audit(batchId,auditId,auditName);
String result = auditApiService.audit(batchId,auditId,staffName,staffId);
// String result = auditApiService.audit(batchId,auditId,auditName,loginStaffDTO.getStaffId());
if(StringUtils.isEmpty(result)){
successCount = successCount+1;
}else{
......@@ -187,17 +193,27 @@ public class AuditController extends WebBaseController{
if(StringUtils.isAnyBlank(auditId,auditReason,auditName)){
return resultResponse(HaoBanErrCode.ERR_2);
}
auditApiService.refuse(auditId, auditReason,auditName);
LoginVO login = (LoginVO) AuthRequestUtil.getLoginUser();
String staffId = login.getStaffDTO().getStaffId();
String staffName = login.getStaffDTO().getStaffName();
auditApiService.refuse(auditId, auditReason,staffName,staffId);
return resultResponse(HaoBanErrCode.ERR_1);
}
//审核同意
@HttpLimit
@RequestMapping("audit")
public HaobanResponse audit(String auditId,String auditName ) {
LoginVO login = (LoginVO) AuthRequestUtil.getLoginUser();
StaffDTO loginStaffDTO = login.getStaffDTO();
if (null == login) {
return resultResponse(HaoBanErrCode.ERR_4);
}
String staffId = login.getStaffDTO().getStaffId();
String staffName = login.getStaffDTO().getStaffName();
if(StringUtils.isAnyBlank(auditId)){
return resultResponse(HaoBanErrCode.ERR_2);
}
String result = auditApiService.audit("",auditId,auditName);
String result = auditApiService.audit("",auditId,staffName,staffId);
if(StringUtils.isEmpty(result)){
return resultResponse(HaoBanErrCode.ERR_1);
}else{
......
......@@ -15,6 +15,8 @@ import com.gic.haoban.base.api.common.ServiceResponse;
import com.gic.haoban.common.utils.EntityUtil;
import com.gic.haoban.common.utils.HaobanResponse;
import com.gic.haoban.manage.api.dto.*;
import com.gic.haoban.manage.api.enums.BindTypeEnum;
import com.gic.haoban.manage.api.enums.ChannelCodeEnum;
import com.gic.haoban.manage.api.service.*;
import com.gic.haoban.manage.web.auth.AuthRequestUtil;
import com.gic.haoban.manage.web.errCode.HaoBanErrCode;
......@@ -29,6 +31,7 @@ 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.ArrayList;
......@@ -285,11 +288,17 @@ public class StaffController extends WebBaseController{
*/
@RequestMapping("del-clerk-relation")
public HaobanResponse delStaffClerkList(String staffId,String clerkId){
LoginVO login = (LoginVO) AuthRequestUtil.getLoginUser();
StaffDTO staffDTO = login.getStaffDTO();
if (staffDTO==null) {
logger.info("登录异常");
return resultResponse(HaoBanErrCode.ERR_4);
}
StaffDTO staff = staffApiService.selectById(staffId);
if(staff == null) {
return resultResponse(HaoBanErrCode.ERR_10007);
}
boolean b = staffClerkRelationApiService.unbindByStaffAndClerkId(staffId, clerkId);
boolean b = staffClerkRelationApiService.unbindByStaffAndClerkId(staffDTO.getStaffId(), clerkId);
return resultResponse(HaoBanErrCode.ERR_1,b);
}
......@@ -348,6 +357,11 @@ public class StaffController extends WebBaseController{
*/
@RequestMapping("add-clerk-relation")
public HaobanResponse staffClerkSearch(String staffId,String clerkId){
LoginVO login = (LoginVO) AuthRequestUtil.getLoginUser();
StaffDTO loginStaffDTO = login.getStaffDTO();
if (null == loginStaffDTO) {
return resultResponse(HaoBanErrCode.ERR_4);
}
if (StringUtils.isAnyBlank(staffId,clerkId)) {
return resultResponse(HaoBanErrCode.ERR_2);
}
......@@ -369,7 +383,7 @@ public class StaffController extends WebBaseController{
relationDTO.setWxUserId(staffDTO.getWxUserId());
ServiceResponse response = staffClerkRelationApiService.bindStaffClerk(relationDTO);
ServiceResponse response = staffClerkRelationApiService.bindStaffClerk(relationDTO,loginStaffDTO.getStaffId(),ChannelCodeEnum.ADMIN_BIND.getCode());
logger.info("返回信息:{}", JSONObject.toJSONString(response));
if (response.getCode()==1) {
return resultResponse(HaoBanErrCode.ERR_1);
......@@ -379,5 +393,21 @@ public class StaffController extends WebBaseController{
return resultResponse(errDefine);
}
}
/**
* 绑定日志
* @return
*/
@RequestMapping("staff-clerk-bind-log")
public HaobanResponse bindLogs(String search,String enterpriseId,@RequestParam(defaultValue = "-1") Integer optType,BasePageInfo qo){
LoginVO login = (LoginVO) AuthRequestUtil.getLoginUser();
StaffDTO loginStaffDTO = login.getStaffDTO();
if (null == loginStaffDTO) {
return resultResponse(HaoBanErrCode.ERR_4);
}
Page<StaffClerkBindLogDetailDTO> page = staffClerkRelationApiService.pageStaffClerkBindLog(loginStaffDTO.getWxEnterpriseId(), search, enterpriseId, optType, qo);
return resultResponse(HaoBanErrCode.ERR_1,page);
}
}
......@@ -4,6 +4,7 @@ package com.gic.haoban.manage.web.controller;
import java.util.ArrayList;
import java.util.List;
import com.gic.haoban.manage.api.enums.ChannelCodeEnum;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
......@@ -236,7 +237,7 @@ public class AuditController extends WebBaseController{
staffClerkRelation.setWxEnterpriseId(wxEnterpriseId);
staffClerkRelation.setWxUserId(wxUserId);
staffClerkRelation.setStaffId(auditStaffId);
staffClerkRelationApiService.delAndInsert(staffClerkRelation);
staffClerkRelationApiService.delAndInsert(staffClerkRelation,staffId, ChannelCodeEnum.AUDIT_BIND.getCode());
audit.setAuditStatus(1);
//发送消息
staffDepartmentRelatedApiService.sendClerkBind(auditStaffId, clerkCode,storeId, auditStatus, auditReason);
......
......@@ -8,6 +8,7 @@ import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;
import com.gic.haoban.manage.api.enums.*;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
......@@ -26,6 +27,7 @@ import com.gic.clerk.api.service.ClerkNewService;
import com.gic.clerk.api.service.ClerkService;
import com.gic.commons.util.DateUtil;
import com.gic.commons.util.EntityUtil;
import com.gic.commons.util.GICMQClientUtil;
import com.gic.enterprise.api.dto.EnterpriseDTO;
import com.gic.enterprise.api.dto.StoreDTO;
import com.gic.enterprise.api.service.EnterpriseService;
......@@ -45,9 +47,6 @@ import com.gic.haoban.manage.api.dto.StaffClerkRelationDTO;
import com.gic.haoban.manage.api.dto.StaffDTO;
import com.gic.haoban.manage.api.dto.StaffDepartmentRelatedDTO;
import com.gic.haoban.manage.api.dto.WxEnterpriseDTO;
import com.gic.haoban.manage.api.enums.AppPageType;
import com.gic.haoban.manage.api.enums.AuditStatus;
import com.gic.haoban.manage.api.enums.AuditType;
import com.gic.haoban.manage.api.service.AuditApiService;
import com.gic.haoban.manage.api.service.AuditSettingApiService;
import com.gic.haoban.manage.api.service.BindApiService;
......@@ -62,6 +61,7 @@ import com.gic.haoban.manage.api.service.WxEnterpriseRelatedApiService;
import com.gic.haoban.manage.web.anno.HttpLimit;
import com.gic.haoban.manage.web.errCode.HaoBanErrCode;
import com.gic.haoban.manage.web.interceptor.WebInterceptor;
import com.gic.haoban.manage.web.utils.RouterConstant;
import com.gic.haoban.manage.web.vo.BindClerkVO;
import com.gic.haoban.manage.web.vo.ClerkStoreVO;
import com.gic.haoban.manage.web.vo.ClerkVo;
......@@ -425,7 +425,18 @@ public class ClerkController extends WebBaseController{
Integer count = RedisUtil.getCache(key) == null ? 0 : (Integer)RedisUtil.getCache(key);
if(count == null || count < 4){
RedisUtil.setCache(key,count + 1,31 * 24 * 60 * 60l);
memberUnionidRelatedApiService.freshWxFrend(wxEnterpriseId, staff.getWxUserId());
JSONObject json = new JSONObject();
json.put("wxUserId", staff.getWxUserId());
json.put("wxEnterpriseId", wxEnterpriseId);
json.put("storeId", storeId);
logger.info("【刷下微信好友】{},{},{}",RouterConstant.FRESH_WX_FRIEND_SERVICENAME,RouterConstant.INIT_FRESH_WX_FRIEND_METHODNAME,json.toJSONString());
try {
GICMQClientUtil.getClientInstance().sendCommonMessage(RouterConstant.ROUTERTYPE, json.toJSONString(),
RouterConstant.FRESH_WX_FRIEND_SERVICENAME, RouterConstant.INIT_FRESH_WX_FRIEND_METHODNAME);
} catch (Exception e) {
logger.info(e.getMessage(),e);
}
// memberUnionidRelatedApiService.freshWxFrend(wxEnterpriseId, staff.getWxUserId(),storeId);
}else{
return resultResponse(HaoBanErrCode.ERR_10011);
......@@ -528,8 +539,8 @@ public class ClerkController extends WebBaseController{
staffClerkRelation.setWxUserId(wxUserId);
staffClerkRelation.setStaffId(staffId);
staffClerkRelationApiService.insertOrUpdate(staffClerkRelation);
staffClerkRelationApiService.delAndInsert(staffClerkRelation,staffId,ChannelCodeEnum.SELF_BIND.getCode());
//无需审核
AuditDTO audit = new AuditDTO();
audit.setCommitStaffName(staff.getStaffName());
......@@ -650,6 +661,8 @@ public class ClerkController extends WebBaseController{
// auditApiService.insert(audit);
staffClerkRelationApiService.delByStoreIdAndCode(storeId, clerkCode);
//加入日志
staffClerkRelationApiService.pushToBindLog(staffClerkRelation.getStaffId(),staffId, BindTypeEnum.UNBIND.getVal(), ChannelCodeEnum.SELF_UNBIND.getCode(),staffClerkRelation.getStaffClerkRelationId());
return resultResponse(HaoBanErrCode.ERR_1);
}
......
......@@ -8,10 +8,8 @@ import com.gic.clerk.api.service.ClerkService;
import com.gic.dict.api.dto.DictDTO;
import com.gic.dict.api.service.ManagerDictService;
import com.gic.enterprise.api.dto.StoreDTO;
import com.gic.enterprise.api.dto.StorePhotoDTO;
import com.gic.haoban.app.customer.dto.StaffOpenRelatedDTO;
import com.gic.haoban.app.customer.service.api.service.StaffMemberRelationApiService;
import com.gic.haoban.base.api.common.ServiceResponse;
import com.gic.haoban.common.utils.EntityUtil;
import com.gic.haoban.common.utils.HaobanResponse;
import com.gic.haoban.manage.api.dto.*;
......@@ -24,7 +22,6 @@ import com.gic.haoban.manage.web.qo.MemberLoginQo;
import com.gic.haoban.manage.web.vo.AppStaffVo;
import com.gic.haoban.manage.web.vo.InfoVo;
import com.gic.haoban.manage.web.vo.StoreMemberVO;
import com.gic.haoban.manage.web.vo.StoreVO;
import com.gic.wechat.api.dto.qywx.UserDTO;
import com.gic.wechat.api.service.qywx.QywxCorpApiService;
import com.gic.wechat.api.service.qywx.QywxUserApiService;
......@@ -36,7 +33,10 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.*;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;
@RestController
......@@ -172,6 +172,13 @@ public class InfoController extends WebBaseController{
}
@RequestMapping("get-gyt-info-by-code")
public HaobanResponse getGytCode(String code) {
String userDTOJson = qywxUserApiService.getUserByCode("ww9ede832a84b7ae5f", "lHHKe1X683yWYAdwWATdzRTdVWo8uTnPH3nj5Gkt4og", code);
logger.info(userDTOJson);
return resultResponse(HaoBanErrCode.ERR_1,userDTOJson);
}
@RequestMapping("get-user-by-member-code")
public HaobanResponse getInfoByMemberCode(GetUserByMemberCodeQo qo) {
EnterpriseDetailDTO enterpriseDetailDTO = wxEnterpriseRelatedApiService.getByEnterpriseId(qo.getGicEnterpriseId());
......
package com.gic.haoban.manage.web.utils;
public class RouterConstant {
public static final String FRESH_WX_FRIEND_SERVICENAME = "com.gic.haoban.manage.api.service.MemberUnionidRelatedApiService";
public static final String INIT_FRESH_WX_FRIEND_METHODNAME = "mqFreshWxFrend";
public static final String ROUTERTYPE = "commonRouter";
}
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