Commit cc0157f5 by songyinghui

feat: stash

parent a58a4b62
package com.gic.haoban.manage.api.enums;
/**
* @Author MUSI
* @Date 2023/3/24 5:17 PM
* @Description
* @Version
* 0:店员,1:店长,2:区经
**/
public enum HaobanClerkTypeEnum {
;
HaobanClerkTypeEnum(Integer type, String desc){
this.code = type;
this.desc = desc;
}
private int code;
private String desc;
public int getCode() {
return code;
}
public void setCode(int code) {
this.code = code;
}
public String getDesc() {
return desc;
}
public void setDesc(String desc) {
this.desc = desc;
}
}
...@@ -26,4 +26,19 @@ public interface QywxGroupMsgTaskApiService { ...@@ -26,4 +26,19 @@ public interface QywxGroupMsgTaskApiService {
* @return * @return
*/ */
ServiceResponse<Void> handlerTriggerCustomerDetailLog(String params); ServiceResponse<Void> handlerTriggerCustomerDetailLog(String params);
/**
* 素材周报
* @param params
* @return
*/
ServiceResponse<Void> handlerMaterialWeekReport(String params);
/**
* 素材月报
* @param params
* @return
*/
ServiceResponse<Void> handlerMaterialMonthReport(String params);
} }
...@@ -119,4 +119,6 @@ public interface TabHaobanStaffClerkRelationMapper { ...@@ -119,4 +119,6 @@ public interface TabHaobanStaffClerkRelationMapper {
List<StaffClerkRelationDTO> listManageBindByStaffId(@Param("staffId") String staffId); List<StaffClerkRelationDTO> listManageBindByStaffId(@Param("staffId") String staffId);
List<StaffClerkRelationDTO> listByStoreIds(@Param("wxEnterpriseId") String wxEnterpriseId,@Param("storeIds") List<String> storeIds); List<StaffClerkRelationDTO> listByStoreIds(@Param("wxEnterpriseId") String wxEnterpriseId,@Param("storeIds") List<String> storeIds);
List<StaffClerkRelationDTO> listAllRelationDtosByEnterpriseId(@Param("enterpriseId") String enterpriseId);
} }
\ No newline at end of file
...@@ -68,4 +68,11 @@ public interface WxEnterpriseMapper { ...@@ -68,4 +68,11 @@ public interface WxEnterpriseMapper {
* *
*/ */
List<WxEnterpriseDTO> listAllEnterprise(); List<WxEnterpriseDTO> listAllEnterprise();
/**
* 查询GIC企业下关联的所有企微
* @param enterpriseId
* @return
*/
List<String> queryWxEnterpriseByEnterpriseId(@Param("enterpriseId") String enterpriseId);
} }
\ No newline at end of file
package com.gic.haoban.manage.service.pojo.bo.content.context;
import java.util.List;
/**
* @Author MUSI
* @Date 2023/3/24 4:08 PM
* @Description
* @Version
* 好办 周报/月报 上下文
**/
public class MaterialReportContext {
private String enterpriseId;
private List<String>
}
...@@ -170,4 +170,11 @@ public interface StaffClerkRelationService { ...@@ -170,4 +170,11 @@ public interface StaffClerkRelationService {
boolean getBindByStaffIdAndEnterpriseId(String enterpriseId, String staffId); boolean getBindByStaffIdAndEnterpriseId(String enterpriseId, String staffId);
List<StaffClerkRelationDTO> listManageBindByStaffId(String staffId); List<StaffClerkRelationDTO> listManageBindByStaffId(String staffId);
/**
* 获取企业下所有关联关系
* @param enterpriseId
* @return
*/
List<StaffClerkRelationDTO> listAllRelationDtosByEnterpriseId(String enterpriseId);
} }
...@@ -69,4 +69,11 @@ public interface WxEnterpriseService { ...@@ -69,4 +69,11 @@ public interface WxEnterpriseService {
void stopHaoban(String enterpriseId); void stopHaoban(String enterpriseId);
/**
* 查询企业下关联的微信企业id
* @param enterpriseId
* @return
*/
List<String> queryWxEnterpriseWithEnterpriseId(String enterpriseId);
} }
...@@ -2,6 +2,8 @@ package com.gic.haoban.manage.service.service.content; ...@@ -2,6 +2,8 @@ package com.gic.haoban.manage.service.service.content;
import com.gic.haoban.manage.service.pojo.bo.content.GroupMessageInfoBo; import com.gic.haoban.manage.service.pojo.bo.content.GroupMessageInfoBo;
import java.util.List;
/** /**
* @Author MUSI * @Author MUSI
* @Date 2023/3/19 9:46 PM * @Date 2023/3/19 9:46 PM
...@@ -16,4 +18,7 @@ public interface GroupMessageService { ...@@ -16,4 +18,7 @@ public interface GroupMessageService {
* @param groupMessageInfoBo * @param groupMessageInfoBo
*/ */
void handlerGroupMessage(GroupMessageInfoBo groupMessageInfoBo); void handlerGroupMessage(GroupMessageInfoBo groupMessageInfoBo);
List<String> hasMaterialRightEnterprise();
} }
package com.gic.haoban.manage.service.service.content;
/**
* @Author MUSI
* @Date 2023/3/24 3:58 PM
* @Description
* @Version
* 素材报告 周报/日报
**/
public interface MaterialReportService {
/**
* 素材周报
* @param enterpriseId
*/
void handlerMaterialWeekReport(String enterpriseId);
}
package com.gic.haoban.manage.service.service.content.adaptor;
import org.springframework.stereotype.Component;
/**
* @Author MUSI
* @Date 2023/3/24 4:11 PM
* @Description
* @Version
* 素材周报/月报组装
**/
@Component
public class MaterialReportBuilder {
}
...@@ -489,4 +489,13 @@ public class GroupMessageServiceImpl implements GroupMessageService { ...@@ -489,4 +489,13 @@ public class GroupMessageServiceImpl implements GroupMessageService {
temp.setDeleteFlag(0); temp.setDeleteFlag(0);
return temp; return temp;
} }
/**
* 获取当前时间 有素材权限的商户
* @return
*/
@Override
public List<String> hasMaterialRightEnterprise() {
return Collections.emptyList();
}
} }
package com.gic.haoban.manage.service.service.content.impl;
import com.gic.api.base.commons.Page;
import com.gic.haoban.manage.api.dto.StaffClerkRelationDTO;
import com.gic.haoban.manage.api.dto.StaffDTO;
import com.gic.haoban.manage.api.service.StaffApiService;
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.content.MaterialReportService;
import com.gic.haoban.manage.service.service.notify.NoticeMessageService;
import org.apache.commons.collections.CollectionUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* @Author MUSI
* @Date 2023/3/24 3:59 PM
* @Description
* @Version
**/
@Component
public class MaterialReportServiceImpl implements MaterialReportService {
private static final Logger log = LoggerFactory.getLogger(MaterialReportServiceImpl.class);
@Autowired
private NoticeMessageService noticeMessageService;
@Autowired
private StaffClerkRelationService staffClerkRelationService;
private static final Integer MAX_SIZE = 1000;
/**
* 素材周报
*
* @param enterpriseId
*/
@Override
public void handlerMaterialWeekReport(String enterpriseId) {
// 获取企业有绑定关系成员 (分页)
List<StaffClerkRelationDTO> staffClerkRelations = staffClerkRelationService.listAllRelationDtosByEnterpriseId(enterpriseId);
if (CollectionUtils.isEmpty(staffClerkRelations)) {
return;
}
// 获取成员与导购所有的绑定关系
Map<String, List<StaffClerkRelationDTO>> staffClerkRelationMap = staffClerkRelations
.stream()
.collect(Collectors.groupingBy(StaffClerkRelationDTO::getStaffId));
// 获取成员 主门店信息 没有就是区经
for (Map.Entry<String, List<StaffClerkRelationDTO>> entry : staffClerkRelationMap.entrySet()) {
String staffId = entry.getKey();
List<StaffClerkRelationDTO> clerkRelations = entry.getValue();
}
// 获取成员周报/月报数据
// 保存好办小程序内消息
// 群发企微应用消息
}
}
...@@ -413,4 +413,15 @@ public class StaffClerkRelationServiceImpl implements StaffClerkRelationService ...@@ -413,4 +413,15 @@ public class StaffClerkRelationServiceImpl implements StaffClerkRelationService
} }
return dto ; return dto ;
} }
/**
* 获取企业下所有关联关系
*
* @param enterpriseId
* @return
*/
@Override
public List<StaffClerkRelationDTO> listAllRelationDtosByEnterpriseId(String enterpriseId) {
return this.mapper.listAllRelationDtosByEnterpriseId(enterpriseId);
}
} }
...@@ -254,7 +254,6 @@ public class StaffServiceImpl implements StaffService { ...@@ -254,7 +254,6 @@ public class StaffServiceImpl implements StaffService {
/** /**
* 查询成员列表 * 查询成员列表
* *
* @param wxEnterpriseId
* @param staffIds * @param staffIds
* @return * @return
*/ */
......
package com.gic.haoban.manage.service.service.impl; package com.gic.haoban.manage.service.service.impl;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.Date; import java.util.Date;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
...@@ -234,4 +236,18 @@ public class WxEnterpriseServiceImpl implements WxEnterpriseService { ...@@ -234,4 +236,18 @@ public class WxEnterpriseServiceImpl implements WxEnterpriseService {
String dingUrl = "https://oapi.dingtalk.com/robot/send?access_token=c38fdc53d26e9a019640755bdada1ce07ebd44a2555d1c8acc299de7a7b5b857"; String dingUrl = "https://oapi.dingtalk.com/robot/send?access_token=c38fdc53d26e9a019640755bdada1ce07ebd44a2555d1c8acc299de7a7b5b857";
DingUtils.send(msg, dingUrl, false); DingUtils.send(msg, dingUrl, false);
} }
/**
* 查询企业下关联的微信企业id
*
* @param enterpriseId
* @return
*/
@Override
public List<String> queryWxEnterpriseWithEnterpriseId(String enterpriseId) {
if (StringUtils.isBlank(enterpriseId)) {
return Collections.emptyList();
}
return this.mapper.queryWxEnterpriseByEnterpriseId(enterpriseId);
}
} }
...@@ -8,6 +8,7 @@ import com.gic.haoban.manage.api.enums.content.TriggerCustomerChannelType; ...@@ -8,6 +8,7 @@ import com.gic.haoban.manage.api.enums.content.TriggerCustomerChannelType;
import com.gic.haoban.manage.api.service.content.task.QywxGroupMsgTaskApiService; import com.gic.haoban.manage.api.service.content.task.QywxGroupMsgTaskApiService;
import com.gic.haoban.manage.service.pojo.bo.content.GroupMessageInfoBo; import com.gic.haoban.manage.service.pojo.bo.content.GroupMessageInfoBo;
import com.gic.haoban.manage.service.service.content.GroupMessageService; import com.gic.haoban.manage.service.service.content.GroupMessageService;
import org.apache.commons.collections.CollectionUtils;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -33,7 +34,7 @@ public class QywxGroupMsgTaskApiServiceImpl implements QywxGroupMsgTaskApiServic ...@@ -33,7 +34,7 @@ public class QywxGroupMsgTaskApiServiceImpl implements QywxGroupMsgTaskApiServic
@Override @Override
public ServiceResponse<Void> groupMsgTaskJob(String params) { public ServiceResponse<Void> groupMsgTaskJob(String params) {
// 获取开启【内容】权限的企业id // 获取开启【内容】权限的企业id
List<String> enterpriseIds = new ArrayList<>(); List<String> enterpriseIds = groupMessageService.hasMaterialRightEnterprise();
// 获取企业 (当前时间 - 30分钟, 当前时间)范围内的 导购分享记录。按创建时间排序 // 获取企业 (当前时间 - 30分钟, 当前时间)范围内的 导购分享记录。按创建时间排序
Date currentTime = new Date(); Date currentTime = new Date();
for (String enterpriseId : enterpriseIds) { for (String enterpriseId : enterpriseIds) {
...@@ -74,4 +75,32 @@ public class QywxGroupMsgTaskApiServiceImpl implements QywxGroupMsgTaskApiServic ...@@ -74,4 +75,32 @@ public class QywxGroupMsgTaskApiServiceImpl implements QywxGroupMsgTaskApiServic
groupMessageService.handlerGroupMessage(groupMessageInfoBo); groupMessageService.handlerGroupMessage(groupMessageInfoBo);
return ServiceResponse.success(); return ServiceResponse.success();
} }
/**
* 素材周报
*
* @param params
* @return
*/
@Override
public ServiceResponse<Void> handlerMaterialWeekReport(String params) {
List<String> enterpriseIds = groupMessageService.hasMaterialRightEnterprise();
if (CollectionUtils.isEmpty(enterpriseIds)) {
return ServiceResponse.success();
}
return null;
}
/**
* 素材月报
*
* @param params
* @return
*/
@Override
public ServiceResponse<Void> handlerMaterialMonthReport(String params) {
return null;
}
} }
...@@ -22,6 +22,9 @@ public class DrawImageUtils { ...@@ -22,6 +22,9 @@ public class DrawImageUtils {
private static final Logger log = LoggerFactory.getLogger(DrawImageUtils.class); private static final Logger log = LoggerFactory.getLogger(DrawImageUtils.class);
private final
/** /**
* 绘画素材月报海报图 * 绘画素材月报海报图
* @param fileName * @param fileName
......
...@@ -447,4 +447,9 @@ ...@@ -447,4 +447,9 @@
</if> </if>
</select> </select>
<select id="listAllRelationDtosByEnterpriseId" resultType="com.gic.haoban.manage.api.dto.StaffClerkRelationDTO">
<include refid="leftJoinStaffSQL"/>
where a.enterprise_id = #{wxEnterpriseId} and a.status_flag=1 and b.status_flag = 1
</select>
</mapper> </mapper>
\ No newline at end of file
...@@ -506,4 +506,13 @@ ...@@ -506,4 +506,13 @@
group by a.enterprise_id group by a.enterprise_id
</select> </select>
<select id="queryWxEnterpriseByEnterpriseId" resultType="java.lang.String">
select
a.enterprise_id enterpriseId
from tab_haoban_wx_enterprise_related a
inner join tab_haoban_wx_enterprise b on a.wx_enterprise_id = b.wx_enterprise_id
where a.status_flag = 1 and b.status_flag = 1
and a.enterprise_id = #{enterprise_id}
</select>
</mapper> </mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment