Commit d546a816 by 徐高华

解绑日志

parent de68a6c0
...@@ -3,7 +3,6 @@ package com.gic.haoban.manage.service.dao.mapper; ...@@ -3,7 +3,6 @@ package com.gic.haoban.manage.service.dao.mapper;
import com.gic.haoban.manage.service.entity.TabHaobanStaffClerkBindLog; import com.gic.haoban.manage.service.entity.TabHaobanStaffClerkBindLog;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import retrofit2.http.PATCH;
import java.util.List; import java.util.List;
...@@ -12,34 +11,14 @@ public interface StaffClerkBindLogMapper { ...@@ -12,34 +11,14 @@ public interface StaffClerkBindLogMapper {
/** /**
* *
*/ */
int deleteByPrimaryKey(Integer logId);
/**
*
*/
int insert(TabHaobanStaffClerkBindLog record); int insert(TabHaobanStaffClerkBindLog record);
/** /**
* *
*/ */
int insertSelective(TabHaobanStaffClerkBindLog record);
/**
*
*/
TabHaobanStaffClerkBindLog selectByPrimaryKey(Integer logId); TabHaobanStaffClerkBindLog selectByPrimaryKey(Integer logId);
/** /**
*
*/
int updateByPrimaryKeySelective(TabHaobanStaffClerkBindLog record);
/**
*
*/
int updateByPrimaryKey(TabHaobanStaffClerkBindLog record);
/**
* 列表 * 列表
* *
* @param clerkIds * @param clerkIds
...@@ -49,7 +28,7 @@ public interface StaffClerkBindLogMapper { ...@@ -49,7 +28,7 @@ public interface StaffClerkBindLogMapper {
* @return * @return
*/ */
public List<TabHaobanStaffClerkBindLog> listStaffClerkBindLog(@Param("wxEnterpriseId") String wxEnterpriseId, @Param("clerkIds") List<String> clerkIds 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); , @Param("staffIds") List<String> staffIds, @Param("enterpriseId") String enterpriseId, @Param("optType") int optType, @Param("search") String search);
public List<TabHaobanStaffClerkBindLog> staffClerkUnBindLog(@Param("wxEnterpriseId") String wxEnterpriseId, @Param("clerkId") String clerkIds public List<TabHaobanStaffClerkBindLog> staffClerkUnBindLog(@Param("wxEnterpriseId") String wxEnterpriseId, @Param("clerkId") String clerkIds
, @Param("enterpriseId") String enterpriseIds, @Param("optType") int optType); , @Param("enterpriseId") String enterpriseIds, @Param("optType") int optType);
......
...@@ -88,6 +88,26 @@ public class TabHaobanStaffClerkBindLog implements Serializable { ...@@ -88,6 +88,26 @@ public class TabHaobanStaffClerkBindLog implements Serializable {
*/ */
private Date updateTime; private Date updateTime;
private String operName ;
private String clerkName ;
public String getOperName() {
return operName;
}
public String getClerkName() {
return clerkName;
}
public void setOperName(String operName) {
this.operName = operName;
}
public void setClerkName(String clerkName) {
this.clerkName = clerkName;
}
/** /**
*/ */
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
......
...@@ -44,7 +44,7 @@ public interface StaffClerkBindLogService { ...@@ -44,7 +44,7 @@ public interface StaffClerkBindLogService {
/** /**
* @return * @return
*/ */
public Page<StaffClerkBindLogDetailDTO> pageBindLog(String wxEnterpriseId, List<String> clerkIds, List<String> staffIds, List<String> enterpriseIds, int optType, String search, BasePageInfo pageInfo); public Page<StaffClerkBindLogDetailDTO> pageBindLog(String wxEnterpriseId, List<String> clerkIds, List<String> staffIds, String enterpriseId, int optType, String search, BasePageInfo pageInfo);
public Page<StaffClerkBindLogDetailDTO> pageUnBindLog(String wxEnterpriseId, String clerkId, String enterpriseId, int optType, BasePageInfo pageInfo); public Page<StaffClerkBindLogDetailDTO> pageUnBindLog(String wxEnterpriseId, String clerkId, String enterpriseId, int optType, BasePageInfo pageInfo);
} }
...@@ -40,7 +40,7 @@ public class StaffClerkBindLogServiceImpl implements StaffClerkBindLogService { ...@@ -40,7 +40,7 @@ public class StaffClerkBindLogServiceImpl implements StaffClerkBindLogService {
@Override @Override
public void insert(TabHaobanStaffClerkBindLog bindLog) { public void insert(TabHaobanStaffClerkBindLog bindLog) {
bindLog.setCreateTime(new Date()); bindLog.setCreateTime(new Date());
staffClerkBindLogMapper.insertSelective(bindLog); staffClerkBindLogMapper.insert(bindLog);
} }
@Override @Override
...@@ -85,9 +85,9 @@ public class StaffClerkBindLogServiceImpl implements StaffClerkBindLogService { ...@@ -85,9 +85,9 @@ public class StaffClerkBindLogServiceImpl implements StaffClerkBindLogService {
} }
@Override @Override
public Page<StaffClerkBindLogDetailDTO> pageBindLog(String wxEnterpriseId, List<String> clerkIds, List<String> staffIds, List<String> enterpriseIds, int optType, String search, BasePageInfo pageInfo) { public Page<StaffClerkBindLogDetailDTO> pageBindLog(String wxEnterpriseId, List<String> clerkIds, List<String> staffIds, String enterpriseId, int optType, String search, BasePageInfo pageInfo) {
PageHelper.startPage(pageInfo); PageHelper.startPage(pageInfo);
List<TabHaobanStaffClerkBindLog> clerkBindLogList = staffClerkBindLogMapper.listStaffClerkBindLog(wxEnterpriseId, clerkIds, staffIds, enterpriseIds, optType, search); List<TabHaobanStaffClerkBindLog> clerkBindLogList = staffClerkBindLogMapper.listStaffClerkBindLog(wxEnterpriseId, clerkIds, staffIds, enterpriseId, optType, search);
Page<StaffClerkBindLogDetailDTO> retPage = PageUtil.changePageHelperToCurrentPage(new PageInfo<>(clerkBindLogList), StaffClerkBindLogDetailDTO.class); Page<StaffClerkBindLogDetailDTO> retPage = PageUtil.changePageHelperToCurrentPage(new PageInfo<>(clerkBindLogList), StaffClerkBindLogDetailDTO.class);
return retPage; return retPage;
} }
......
...@@ -9,7 +9,6 @@ import org.springframework.beans.factory.annotation.Autowired; ...@@ -9,7 +9,6 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.gic.haoban.common.utils.StringUtil; import com.gic.haoban.common.utils.StringUtil;
import com.gic.haoban.manage.api.dto.MemberUnionidRelatedDTO;
import com.gic.haoban.manage.service.dao.mapper.TabHaobanTemplateApplicationRelatedMapper; import com.gic.haoban.manage.service.dao.mapper.TabHaobanTemplateApplicationRelatedMapper;
import com.gic.haoban.manage.service.entity.TabHaobanTemplateApplicationRelated; import com.gic.haoban.manage.service.entity.TabHaobanTemplateApplicationRelated;
import com.gic.haoban.manage.service.service.TemplateApplicationRelatedService; import com.gic.haoban.manage.service.service.TemplateApplicationRelatedService;
......
...@@ -41,42 +41,28 @@ public class StaffClerkRelationApiServiceImpl implements StaffClerkRelationApiSe ...@@ -41,42 +41,28 @@ public class StaffClerkRelationApiServiceImpl implements StaffClerkRelationApiSe
@Autowired @Autowired
private StaffClerkRelationService staffClerkRelatinService; private StaffClerkRelationService staffClerkRelatinService;
@Autowired @Autowired
private EnterpriseService enterpriseService; private EnterpriseService enterpriseService;
@Autowired @Autowired
private ClerkService clerkService; private ClerkService clerkService;
@Autowired @Autowired
private StoreService storeService; private StoreService storeService;
@Autowired @Autowired
private TabHaobanStaffClerkRelationMapper tabHaobanStaffClerkRelationMapper; private TabHaobanStaffClerkRelationMapper tabHaobanStaffClerkRelationMapper;
@Autowired @Autowired
private AuditApiService auditApiService; private AuditApiService auditApiService;
@Autowired @Autowired
private ClerkMainStoreRelatedService clerkMainStoreRelatedService; private ClerkMainStoreRelatedService clerkMainStoreRelatedService;
@Autowired @Autowired
private StaffClerkBindLogService staffClerkBindLogService; private StaffClerkBindLogService staffClerkBindLogService;
@Autowired
private WxEnterpriseRelatedService wxEnterpriseRelatedService;
@Autowired @Autowired
private StaffService staffService; private StaffService staffService;
@Autowired @Autowired
private ExternalClerkRelatedService externalClerkRelatedService; private ExternalClerkRelatedService externalClerkRelatedService;
@Autowired @Autowired
private QywxUserApiService qywxUserApiService; private QywxUserApiService qywxUserApiService;
@Autowired @Autowired
private SecretSettingService secretSettingService; private SecretSettingService secretSettingService;
@Autowired @Autowired
private WxEnterpriseService wxEnterpriseService; private WxEnterpriseService wxEnterpriseService;
...@@ -95,26 +81,34 @@ public class StaffClerkRelationApiServiceImpl implements StaffClerkRelationApiSe ...@@ -95,26 +81,34 @@ public class StaffClerkRelationApiServiceImpl implements StaffClerkRelationApiSe
} }
ClerkDTO clerkDTO = clerkService.getClerkByClerkIdNoStatus(clerkRelation.getClerkId()); ClerkDTO clerkDTO = clerkService.getClerkByClerkIdNoStatus(clerkRelation.getClerkId());
String phoneNumber = ""; String phoneNumber = "";
String clerkName = null;
if (null != clerkDTO) { if (null != clerkDTO) {
phoneNumber = clerkDTO.getPhoneNumber(); phoneNumber = clerkDTO.getPhoneNumber();
clerkName = clerkDTO.getClerkName() ;
} }
TabHaobanStaffClerkBindLog staffClerkRelation = new TabHaobanStaffClerkBindLog(); String operClerkId = infoDTO.getOptStaffId() ;
staffClerkRelation.setClerkId(clerkRelation.getClerkId()); clerkDTO = clerkService.getClerkByClerkIdNoStatus(clerkRelation.getClerkId());
staffClerkRelation.setChannelCode(infoDTO.getChannelCode()); String operName = null ;
staffClerkRelation.setClerkCode(clerkRelation.getClerkCode()); if (null != clerkDTO) {
staffClerkRelation.setCreateTime(new Date()); operName = clerkDTO.getClerkName() ;
staffClerkRelation.setEnterpriseId(clerkRelation.getEnterpriseId()); }
staffClerkRelation.setOptStaffId(infoDTO.getOptStaffId()); TabHaobanStaffClerkBindLog enity = new TabHaobanStaffClerkBindLog();
staffClerkRelation.setOptType(infoDTO.getOptType()); enity.setClerkId(clerkRelation.getClerkId());
staffClerkRelation.setStatusFlag(1); enity.setChannelCode(infoDTO.getChannelCode());
staffClerkRelation.setStaffId(clerkRelation.getStaffId()); enity.setClerkCode(clerkRelation.getClerkCode());
staffClerkRelation.setWxEnterpriseId(clerkRelation.getWxEnterpriseId()); enity.setCreateTime(new Date());
staffClerkRelation.setRelationId(infoDTO.getRelationId()); enity.setEnterpriseId(clerkRelation.getEnterpriseId());
staffClerkRelation.setClerkPhone(phoneNumber); enity.setOptStaffId(operClerkId);
staffClerkRelation.setUpdateTime(new Date()); enity.setOperName(operName);
enity.setOptType(infoDTO.getOptType());
staffClerkBindLogService.insert(staffClerkRelation); enity.setStatusFlag(1);
enity.setStaffId(clerkRelation.getStaffId());
enity.setWxEnterpriseId(clerkRelation.getWxEnterpriseId());
enity.setRelationId(infoDTO.getRelationId());
enity.setClerkPhone(phoneNumber);
enity.setUpdateTime(new Date());
enity.setClerkName(clerkName);
staffClerkBindLogService.insert(enity);
} }
@Override @Override
...@@ -307,25 +301,7 @@ public class StaffClerkRelationApiServiceImpl implements StaffClerkRelationApiSe ...@@ -307,25 +301,7 @@ public class StaffClerkRelationApiServiceImpl implements StaffClerkRelationApiSe
@Override @Override
public Page<StaffClerkBindLogDetailDTO> pageStaffClerkBindLog(String wxEnterpriseId, String search, String enterpriseId, int optType, BasePageInfo pageInfo) { public Page<StaffClerkBindLogDetailDTO> pageStaffClerkBindLog(String wxEnterpriseId, String search, String enterpriseId, int optType, BasePageInfo pageInfo) {
List<TabHaobanWxEnterpriseRelated> wxEnterpriseRelateds = wxEnterpriseRelatedService.getByWxEnterpriseId(wxEnterpriseId); Page<StaffClerkBindLogDetailDTO> retList = staffClerkBindLogService.pageBindLog(wxEnterpriseId, null, null, enterpriseId, optType, search, pageInfo);
if (CollectionUtils.isEmpty(wxEnterpriseRelateds)) {
logger.info("没有关联企业");
return null;
}
List<String> enterpriseList = wxEnterpriseRelateds.stream().map(TabHaobanWxEnterpriseRelated::getEnterpriseId)
.filter(eid -> {
if (StringUtils.isBlank(enterpriseId)) {
return true;
} else {
return enterpriseId.equals(eid);
}
}).collect(Collectors.toList());
if (CollectionUtils.isEmpty(enterpriseList)) {
logger.info("没有有效的企业");
return null;
}
List<String> clerkIds = null;
Page<StaffClerkBindLogDetailDTO> retList = staffClerkBindLogService.pageBindLog(wxEnterpriseId, clerkIds, null, enterpriseList, optType, search, pageInfo);
if (CollectionUtils.isNotEmpty(retList.getResult())) { if (CollectionUtils.isNotEmpty(retList.getResult())) {
retList.getResult().forEach(staffClerkBindLogDetailDTO -> { retList.getResult().forEach(staffClerkBindLogDetailDTO -> {
TabHaobanStaff haobanStaff = staffService.selectById(staffClerkBindLogDetailDTO.getStaffId()); TabHaobanStaff haobanStaff = staffService.selectById(staffClerkBindLogDetailDTO.getStaffId());
...@@ -364,30 +340,14 @@ public class StaffClerkRelationApiServiceImpl implements StaffClerkRelationApiSe ...@@ -364,30 +340,14 @@ public class StaffClerkRelationApiServiceImpl implements StaffClerkRelationApiSe
} }
Page<StaffClerkBindLogDetailDTO> retList = staffClerkBindLogService.pageUnBindLog(wxEnterpriseId, clerkId, enterpriseId, optType, pageInfo); Page<StaffClerkBindLogDetailDTO> retList = staffClerkBindLogService.pageUnBindLog(wxEnterpriseId, clerkId, enterpriseId, optType, pageInfo);
if (CollectionUtils.isNotEmpty(retList.getResult())) { if (CollectionUtils.isNotEmpty(retList.getResult())) {
retList.getResult().forEach(staffClerkBindLogDetailDTO -> { retList.getResult().forEach(item -> {
TabHaobanStaff haobanStaff = staffService.selectById(staffClerkBindLogDetailDTO.getStaffId()); if ("-1".equals(item.getOptStaffId())) {
if (null != haobanStaff) { item.setOptStaffName("系统");
staffClerkBindLogDetailDTO.setStaffName(haobanStaff.getStaffName());
staffClerkBindLogDetailDTO.setWxUserId(haobanStaff.getWxUserId());
} else {
staffClerkBindLogDetailDTO.setStaffName("未知成员");
}
if ("-1".equals(staffClerkBindLogDetailDTO.getOptStaffId())) {
staffClerkBindLogDetailDTO.setOptStaffName("系统");
} else {
haobanStaff = staffService.selectById(staffClerkBindLogDetailDTO.getOptStaffId());
if (null != haobanStaff) {
staffClerkBindLogDetailDTO.setOptStaffName(haobanStaff.getStaffName());
} else {
staffClerkBindLogDetailDTO.setOptStaffName("未知成员");
} }
if(StringUtils.isBlank(item.getOptStaffName())) {
item.setOptStaffName("未知成员");
} }
item.setClerkPhoneNumber(item.getClerkPhone());
ClerkDTO clerkDTO = clerkService.getClerkByClerkIdNoStatus(staffClerkBindLogDetailDTO.getClerkId());
if (null != clerkDTO) {
staffClerkBindLogDetailDTO.setClerkName(clerkDTO.getClerkName());
}
staffClerkBindLogDetailDTO.setClerkPhoneNumber(staffClerkBindLogDetailDTO.getClerkPhone());
}); });
} }
return retList; return retList;
...@@ -398,19 +358,6 @@ public class StaffClerkRelationApiServiceImpl implements StaffClerkRelationApiSe ...@@ -398,19 +358,6 @@ public class StaffClerkRelationApiServiceImpl implements StaffClerkRelationApiSe
staffClerkBindLogService.pushToMq(staffId, optStaffId, optType, channelCode, relationId); staffClerkBindLogService.pushToMq(staffId, optStaffId, optType, channelCode, relationId);
} }
private void setMainStore(StaffClerkRelationDTO staffClerkRelation) {
if (staffClerkRelation == null) {
logger.info("staffClerkRelation为空");
return;
}
String staffId = staffClerkRelation.getStaffId();
String wxEnterpriseId = staffClerkRelation.getWxEnterpriseId();
List<StaffClerkRelationDTO> list = staffClerkRelatinService.listByStaffId(wxEnterpriseId, staffId);
if (list != null && list.size() == 1) {
clerkMainStoreRelatedService.setMainStore(staffId, staffClerkRelation.getStoreId(), wxEnterpriseId);
}
}
private void delSetMainStore(TabHaobanStaffClerkRelation staffClerkRelation) { private void delSetMainStore(TabHaobanStaffClerkRelation staffClerkRelation) {
if (staffClerkRelation == null) { if (staffClerkRelation == null) {
logger.info("staffClerkRelation为空"); logger.info("staffClerkRelation为空");
......
...@@ -15,11 +15,13 @@ ...@@ -15,11 +15,13 @@
<result column="status_flag" jdbcType="INTEGER" property="statusFlag"/> <result column="status_flag" jdbcType="INTEGER" property="statusFlag"/>
<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="oper_name" property="operName"/>
<result column="clerk_name" property="clerkName"/>
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
log_id log_id, staff_id, wx_enterprise_id, opt_staff_id, opt_type, channel_code, enterprise_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 , oper_name , clerk_name
clerk_id, clerk_code,clerk_phone, status_flag, create_time, update_time
</sql> </sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap"> <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select select
...@@ -27,168 +29,24 @@ ...@@ -27,168 +29,24 @@
from tab_haoban_staff_clerk_bind_log from tab_haoban_staff_clerk_bind_log
where log_id = #{logId,jdbcType=INTEGER} where log_id = #{logId,jdbcType=INTEGER}
</select> </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 id="insert" parameterType="com.gic.haoban.manage.service.entity.TabHaobanStaffClerkBindLog">
insert into tab_haoban_staff_clerk_bind_log (staff_id, wx_enterprise_id, insert into tab_haoban_staff_clerk_bind_log (staff_id, wx_enterprise_id,
opt_staff_id, opt_type, channel_code, opt_staff_id, opt_type, channel_code,
enterprise_id, clerk_id, clerk_code, clerk_phone, enterprise_id, clerk_id, clerk_code, clerk_phone,
status_flag, create_time, update_time) status_flag, create_time, update_time , oper_name,clerk_name)
values (#{staffId,jdbcType=VARCHAR}, #{wxEnterpriseId,jdbcType=VARCHAR}, values (#{staffId,jdbcType=VARCHAR}, #{wxEnterpriseId,jdbcType=VARCHAR},
#{optStaffId,jdbcType=VARCHAR}, #{optType,jdbcType=INTEGER}, #{channelCode,jdbcType=INTEGER}, #{optStaffId,jdbcType=VARCHAR}, #{optType,jdbcType=INTEGER}, #{channelCode,jdbcType=INTEGER},
#{enterpriseId,jdbcType=VARCHAR}, #{clerkId,jdbcType=VARCHAR}, #{clerkCode,jdbcType=VARCHAR}, #{enterpriseId,jdbcType=VARCHAR}, #{clerkId,jdbcType=VARCHAR}, #{clerkCode,jdbcType=VARCHAR},
#{clerk_phone,jdbcType=VARCHAR}, #{clerk_phone,jdbcType=VARCHAR},
#{statusFlag,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}) #{statusFlag,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP} , #{operName} , #{clerkName})
</insert> </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 id="listStaffClerkBindLog" resultMap="BaseResultMap">
select select
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
from tab_haoban_staff_clerk_bind_log from tab_haoban_staff_clerk_bind_log
where wx_enterprise_id=#{wxEnterpriseId} where wx_enterprise_id=#{wxEnterpriseId} and enterprise_id = #{enterpriseId}
<if test="clerkIds!=null and clerkIds.size()>0"> <if test="clerkIds!=null and clerkIds.size()>0">
and clerk_id in and clerk_id in
<foreach collection="clerkIds" item="item" open="(" close=")" separator=","> <foreach collection="clerkIds" item="item" open="(" close=")" separator=",">
...@@ -201,12 +59,7 @@ ...@@ -201,12 +59,7 @@
#{item} #{item}
</foreach> </foreach>
</if> </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"> <if test="optType!=-1">
and opt_type=#{optType} and opt_type=#{optType}
</if> </if>
......
...@@ -46,7 +46,6 @@ import com.gic.haoban.manage.web.config.Config; ...@@ -46,7 +46,6 @@ 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.vo.ApplicationVO; import com.gic.haoban.manage.web.vo.ApplicationVO;
import com.gic.haoban.manage.web.vo.ClerkEditInfoVO; import com.gic.haoban.manage.web.vo.ClerkEditInfoVO;
import com.gic.redis.data.util.RedisUtil;
import com.gic.wechat.api.service.qywx.QywxSuiteApiService; import com.gic.wechat.api.service.qywx.QywxSuiteApiService;
import com.gic.wechat.api.service.qywx.QywxUserApiService; import com.gic.wechat.api.service.qywx.QywxUserApiService;
...@@ -96,9 +95,6 @@ public class ApplicationController extends WebBaseController { ...@@ -96,9 +95,6 @@ public class ApplicationController extends WebBaseController {
} }
Map<String, Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
List<ApplicationDTO> list = applicationApiService.listApplicationByWxEnterpriseId(wxEnterpriseId); List<ApplicationDTO> list = applicationApiService.listApplicationByWxEnterpriseId(wxEnterpriseId);
Object o = RedisUtil.getCache("haobanWxEnterpriseIdAppOpen");
String wxEnterpriseIds = o == null ? "" : o.toString();
if (!wxEnterpriseIds.contains(wxEnterpriseId)) {
Iterator<ApplicationDTO> it = list.iterator(); Iterator<ApplicationDTO> it = list.iterator();
// 判断模板 // 判断模板
List<String> tempIdList = null ; List<String> tempIdList = null ;
...@@ -121,7 +117,6 @@ public class ApplicationController extends WebBaseController { ...@@ -121,7 +117,6 @@ public class ApplicationController extends WebBaseController {
} }
} }
} }
}
//开启 //开启
List<String> applicationIds = list.stream().map(s -> s.getApplicationId()).collect(Collectors.toList()); List<String> applicationIds = list.stream().map(s -> s.getApplicationId()).collect(Collectors.toList());
List<ApplicationSettingDTO> openList = applicationSettingApiService.listOpenByWxEnterpriseIdAndApplicationIds(wxEnterpriseId, applicationIds); List<ApplicationSettingDTO> openList = applicationSettingApiService.listOpenByWxEnterpriseIdAndApplicationIds(wxEnterpriseId, applicationIds);
......
...@@ -339,12 +339,9 @@ public class StaffController extends WebBaseController { ...@@ -339,12 +339,9 @@ public class StaffController extends WebBaseController {
* @return * @return
*/ */
@RequestMapping("del-clerk-relation") @RequestMapping("del-clerk-relation")
public HaobanResponse delStaffClerkList(String staffId, String clerkId) { public HaobanResponse delStaffClerkList(String clerkId) {
StaffDTO staff = staffApiService.selectById(staffId); WebLoginDTO login = AuthWebRequestUtil.getLoginUser();
if (staff == null) { boolean b = staffClerkRelationApiService.unbindByStaffAndClerkId(login.getClerkId(), clerkId);
return resultResponse(HaoBanErrCode.ERR_10007);
}
boolean b = staffClerkRelationApiService.unbindByStaffAndClerkId(staffId, clerkId);
return resultResponse(HaoBanErrCode.ERR_1, b); return resultResponse(HaoBanErrCode.ERR_1, b);
} }
...@@ -433,7 +430,7 @@ public class StaffController extends WebBaseController { ...@@ -433,7 +430,7 @@ public class StaffController extends WebBaseController {
relationDTO.setWxUserId(staffDTO.getWxUserId()); relationDTO.setWxUserId(staffDTO.getWxUserId());
ServiceResponse response = staffClerkRelationApiService.bindStaffClerk(relationDTO, login.getStaffId(), ChannelCodeEnum.ADMIN_BIND.getCode()); ServiceResponse response = staffClerkRelationApiService.bindStaffClerk(relationDTO, login.getClerkId(), ChannelCodeEnum.ADMIN_BIND.getCode());
logger.info("返回信息:{}", JSONObject.toJSONString(response)); logger.info("返回信息:{}", JSONObject.toJSONString(response));
if (response.getCode() == 1) { if (response.getCode() == 1) {
return resultResponse(HaoBanErrCode.ERR_1); return resultResponse(HaoBanErrCode.ERR_1);
......
...@@ -947,7 +947,7 @@ public class ClerkController extends WebBaseController { ...@@ -947,7 +947,7 @@ public class ClerkController extends WebBaseController {
staffClerkRelationApiService.delByStoreIdAndCode(storeId, clerkCode); staffClerkRelationApiService.delByStoreIdAndCode(storeId, clerkCode);
//加入日志 //加入日志
staffClerkRelationApiService.pushToBindLog(staffClerkRelation.getStaffId(), staffId, BindTypeEnum.UNBIND.getVal(), ChannelCodeEnum.SELF_UNBIND.getCode(), staffClerkRelation.getStaffClerkRelationId()); staffClerkRelationApiService.pushToBindLog(staffClerkRelation.getStaffId(), clerkId, BindTypeEnum.UNBIND.getVal(), ChannelCodeEnum.SELF_UNBIND.getCode(), staffClerkRelation.getStaffClerkRelationId());
return resultResponse(HaoBanErrCode.ERR_1); return resultResponse(HaoBanErrCode.ERR_1);
} }
......
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