Commit 678dc9dd by 墨竹

feat:增加检查员工开启联系我接口

parent 0f8d40bd
...@@ -97,4 +97,24 @@ public interface HmQrcodeApiService { ...@@ -97,4 +97,24 @@ public interface HmQrcodeApiService {
*/ */
void resetAddNumAndOverFlag(String param); void resetAddNumAndOverFlag(String param);
/**
* 检查员工开启联系我
* 定时任务
* @param param 参数
* @author mozhu
* @date 2022-07-07 14:25:54
*/
void checkStaffOpenContact(String param);
/**
* 检查员工开放联系mq
*
* @param param 参数
* @author mozhu
* @date 2022-07-07 14:34:56
*/
void checkStaffOpenContactMq(String param);
} }
...@@ -200,4 +200,15 @@ public interface TabHaobanStaffClerkRelationMapper { ...@@ -200,4 +200,15 @@ public interface TabHaobanStaffClerkRelationMapper {
*/ */
List<String> listWxUserIdByClerkIds(@Param("clerkIds") List<String> clerkIds); List<String> listWxUserIdByClerkIds(@Param("clerkIds") List<String> clerkIds);
/**
* 通过userId 查询id
*
* @param wxOpenUserIds wx开放用户id
* @return {@link List }<{@link String }>
* @author mozhu
* @date 2022-07-07 15:08:57
*/
List<String> listIdsByWxOpenUserIds(@Param("wxOpenUserIds") List<String> wxOpenUserIds);
} }
\ No newline at end of file
...@@ -142,4 +142,7 @@ public interface StaffService { ...@@ -142,4 +142,7 @@ public interface StaffService {
* @date 2022-06-30 15:54:34 * @date 2022-06-30 15:54:34
*/ */
int updateUserIdByUserId(String wxEnterpriseId, String newWxUserId, String oldWxUserId); int updateUserIdByUserId(String wxEnterpriseId, String newWxUserId, String oldWxUserId);
} }
...@@ -17,9 +17,11 @@ import com.gic.haoban.manage.api.dto.qdto.hm.HmQrcodeListQDTO; ...@@ -17,9 +17,11 @@ import com.gic.haoban.manage.api.dto.qdto.hm.HmQrcodeListQDTO;
import com.gic.haoban.manage.api.dto.qdto.hm.HmQrcodeQDTO; import com.gic.haoban.manage.api.dto.qdto.hm.HmQrcodeQDTO;
import com.gic.haoban.manage.api.service.hm.HmQrcodeApiService; import com.gic.haoban.manage.api.service.hm.HmQrcodeApiService;
import com.gic.haoban.manage.service.config.Config; import com.gic.haoban.manage.service.config.Config;
import com.gic.haoban.manage.service.entity.TabHaobanWxEnterprise;
import com.gic.haoban.manage.service.pojo.bo.hm.HmClerkRelationBO; import com.gic.haoban.manage.service.pojo.bo.hm.HmClerkRelationBO;
import com.gic.haoban.manage.service.pojo.bo.hm.HmQrcodeBO; import com.gic.haoban.manage.service.pojo.bo.hm.HmQrcodeBO;
import com.gic.haoban.manage.service.service.StaffClerkRelationService; import com.gic.haoban.manage.service.service.StaffClerkRelationService;
import com.gic.haoban.manage.service.service.StaffService;
import com.gic.haoban.manage.service.service.WxEnterpriseService; import com.gic.haoban.manage.service.service.WxEnterpriseService;
import com.gic.haoban.manage.service.service.hm.HmClerkRelationService; import com.gic.haoban.manage.service.service.hm.HmClerkRelationService;
import com.gic.haoban.manage.service.service.hm.HmQrcodeService; import com.gic.haoban.manage.service.service.hm.HmQrcodeService;
...@@ -35,6 +37,7 @@ import org.springframework.stereotype.Service; ...@@ -35,6 +37,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays;
import java.util.List; import java.util.List;
/** /**
...@@ -62,6 +65,8 @@ public class HmQrcodeApiServiceImpl implements HmQrcodeApiService { ...@@ -62,6 +65,8 @@ public class HmQrcodeApiServiceImpl implements HmQrcodeApiService {
private ClerkService clerkService; private ClerkService clerkService;
@Autowired @Autowired
private StoreService storeService; private StoreService storeService;
@Autowired
private StaffService staffService;
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
...@@ -270,7 +275,31 @@ public class HmQrcodeApiServiceImpl implements HmQrcodeApiService { ...@@ -270,7 +275,31 @@ public class HmQrcodeApiServiceImpl implements HmQrcodeApiService {
@Override @Override
public void resetAddNumAndOverFlag(String param) { public void resetAddNumAndOverFlag(String param) {
logger.info("重置上限时间定时任务 start");
hmQrcodeService.resetAddNumAndOverFlag(); hmQrcodeService.resetAddNumAndOverFlag();
hmClerkRelationService.resetAddNumAndOverFlag(); hmClerkRelationService.resetAddNumAndOverFlag();
logger.info("重置上限时间定时任务 end");
}
@Override
public void checkStaffOpenContact(String param) {
logger.info("检查员工是否开启联系我,定时任务,start");
List<TabHaobanWxEnterprise> tabHaobanWxEnterprises = wxEnterpriseService.listAll();
for (TabHaobanWxEnterprise tabHaobanWxEnterpris : tabHaobanWxEnterprises) {
//查询出所有正常的导购
String wxEnterpriseId = tabHaobanWxEnterpris.getWxEnterpriseId();
String wxUserIds = qywxUserApiService.listCorpExternalUser(tabHaobanWxEnterpris.getCorpid(), config.getWxSuiteid());
String[] split = wxUserIds.split(",");
List<String> wxUserIdsList = Arrays.asList(split);
}
logger.info("检查员工是否开启联系我,定时任务,end");
}
@Override
public void checkStaffOpenContactMq(String param) {
} }
} }
...@@ -371,7 +371,8 @@ ...@@ -371,7 +371,8 @@
a.wx_user_id wxUserId, a.wx_user_id wxUserId,
a.staff_id staffId, a.staff_id staffId,
a.clerk_id clerkId, a.clerk_id clerkId,
b.staff_name staffName b.staff_name staffName,
b.wx_open_user_id wxOpenUserId
FROM tab_haoban_staff_clerk_relation a FROM tab_haoban_staff_clerk_relation a
LEFT JOIN tab_haoban_staff b ON b.staff_id = a.staff_id LEFT JOIN tab_haoban_staff b ON b.staff_id = a.staff_id
WHERE a.status_flag = 1 WHERE a.status_flag = 1
...@@ -455,7 +456,7 @@ ...@@ -455,7 +456,7 @@
a.wx_user_id wxUserId a.wx_user_id wxUserId
from tab_haoban_staff_clerk_relation a from tab_haoban_staff_clerk_relation a
left join tab_haoban_staff b on b.staff_id = a.staff_id left join tab_haoban_staff b on b.staff_id = a.staff_id
where a.status_flag=1 where a.status_flag=1 and b.status_flag = 1
and a.clerk_id in and a.clerk_id in
<foreach collection="clerkIds" item="id" index="index" open="(" close=")" separator=","> <foreach collection="clerkIds" item="id" index="index" open="(" close=")" separator=",">
#{id,jdbcType=VARCHAR} #{id,jdbcType=VARCHAR}
...@@ -463,4 +464,18 @@ ...@@ -463,4 +464,18 @@
group by a.staff_clerk_relation_id group by a.staff_clerk_relation_id
</select> </select>
<select id="listIdsByWxOpenUserIds" resultType="string" parameterType="java.lang.String">
select
a.staff_clerk_relation_id
from tab_haoban_staff_clerk_relation a
left join tab_haoban_staff b on b.staff_id = a.staff_id
where a.status_flag=1 and b.status_flag = 1
and b.wx_open_user_id in
<foreach collection="wxOpenUserIds" item="id" index="index" open="(" close=")" separator=",">
#{id,jdbcType=VARCHAR}
</foreach>
group by a.staff_clerk_relation_id
</select>
</mapper> </mapper>
\ No newline at end of file
...@@ -157,7 +157,7 @@ ...@@ -157,7 +157,7 @@
and default_welcome_flag = #{defaultWelcomeFlag,jdbcType=INTEGER} and default_welcome_flag = #{defaultWelcomeFlag,jdbcType=INTEGER}
</if> </if>
<if test="type != null"> <if test="type != null">
type = #{type} and type = #{type}
</if> </if>
</where> </where>
order by update_time desc order by update_time desc
......
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