Commit 4878a1a0 by songyinghui

Merge remote-tracking branch 'origin/master' into feature-202309-数据组队列迁移

# Conflicts:
#	haoban-manage3-service/pom.xml
parents f3dfcc13 d76f867d
......@@ -80,6 +80,8 @@ public enum NoticeMessageTypeEnum {
MATERIAL_REPORT_NOTIFY_MONTH(6004, "素材月报通知", NoticeMessageCategoryTypeEnum.MATERIAL.getType(), "material_month_notify", "/pages/route/index?pageType=", "hbapp_mate_report", "materialMonth", "clerkMaterialsReport"),
CLERK_COMMISSION_NOTIFY(6005, "客户下单通知", NoticeMessageCategoryTypeEnum.CUSTOMER.getType(), "clerk_commission_notify", "/pages/route/index?pageType=", "hbapp_withdraw_list", "clerkCommissionNotify", "haobanNotice"),
MATERIAL_AUDIT_NOTIFY(6006, "素材审核通知", NoticeMessageCategoryTypeEnum.MATERIAL.getType(), "material_audit_notify", "/pages/route/index?pageType=", "hbapp_create_center", "materialAuditNotify", "haobanNotice"),
CASH_APPLY_REFUSE_NOTIFY(7001,"提现通知", NoticeMessageCategoryTypeEnum.OTHER.getType(),"cash_apply_refuse_notify","/pages/route/index?pageType=","hbapp_withdraw_list","cashApplyRefuseNotify","haobanNotice"),
CASH_APPLY_FAIL_NOTIFY(7002,"提现通知", NoticeMessageCategoryTypeEnum.OTHER.getType(),"cash_apply_fail_notify","/pages/route/index?pageType=","hbapp_withdraw_list","cashApplyFailNotify","haobanNotice"),
......
......@@ -56,6 +56,13 @@ public class InteractRecordInfoDTO implements Serializable {
*/
private String bizId;
/**
* 业务类型
* @see com.gic.haoban.manage.api.enums.content.ShareBizType
*/
private Integer bizType;
/**
* 浏览的商品数量
*/
......@@ -158,4 +165,12 @@ public class InteractRecordInfoDTO implements Serializable {
public void setOrderGoodsNum(Integer orderGoodsNum) {
this.orderGoodsNum = orderGoodsNum;
}
public Integer getBizType() {
return bizType;
}
public void setBizType(Integer bizType) {
this.bizType = bizType;
}
}
......@@ -9,9 +9,10 @@ package com.gic.haoban.manage.api.enums.content;
**/
public enum MaterialInteractRecordEventType {
VISIT_MATERIAL(1, "浏览了你分享的素材"),
VISIT_PRODUCT(2, "浏览了你分享的素材,并查看了关联商品"),
ORDER(3, "浏览了你分享的素材,并购买了商品");
VISIT_MATERIAL(1, "浏览了你分享的%s"),
VISIT_PRODUCT(2, "浏览了你分享的%s,并查看了关联商品"),
ORDER(3, "浏览了你分享的%s,并购买了商品"),
ADD_SHOPPING_CART(4, "浏览你分享的%s,并加入了购物车");
MaterialInteractRecordEventType(Integer code, String desc) {
this.code = code;
......@@ -48,4 +49,5 @@ public enum MaterialInteractRecordEventType {
public void setDesc(String desc) {
this.desc = desc;
}
}
......@@ -9,7 +9,8 @@ package com.gic.haoban.manage.api.enums.content;
**/
public enum ShareBizType {
MATERIAL(1, "素材");
MATERIAL(1, "素材"),
GOODS(2, "商品");
ShareBizType(Integer code, String desc) {
this.code = code;
this.desc = desc;
......@@ -24,4 +25,13 @@ public enum ShareBizType {
public String getDesc() {
return desc;
}
public static String getDescWithCode(Integer code) {
for (ShareBizType value : values()) {
if (value.code.equals(code)) {
return value.desc;
}
}
return "";
}
}
......@@ -6,8 +6,10 @@ import com.gic.haoban.manage.api.dto.PreDealLogInfoDTO;
import com.gic.haoban.manage.api.dto.SyncCheckDTO;
import com.gic.haoban.manage.api.dto.SyncSingleDealDTO;
import com.gic.haoban.manage.api.dto.SyncTaskDTO;
import com.gic.haoban.manage.api.enums.SyncTaskStatusEnum;
import java.util.List;
import java.util.Set;
/**
* Created 2020/4/9.
......@@ -209,7 +211,11 @@ public interface DealSyncOperationApiService {
* @param taskId
*/
void dealTagTask(String wxEnterpriseId, String enterpriseId, List<String> tagIds, String taskId);
// 同步好友状态定时
void taskStatusTimer(String params) ;
void staffTaskStatusTimer(String params) ;
// 同步通讯录状态定时
void taskSyncStaffTimer(String params) ;
void sendToMq(String taskId, Set<String> dealList, SyncTaskStatusEnum syncTaskStatusEnum , String mqName) ;
}
......@@ -4,6 +4,7 @@ import java.util.List;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.haoban.manage.api.dto.QywxCallBackDTO;
import com.gic.haoban.manage.api.dto.WxEnterpriseQwDTO;
import com.gic.haoban.manage.api.enums.NoticeMessageTypeEnum;
import java.util.List;
......@@ -64,4 +65,19 @@ public interface MessageApiService {
ServiceResponse<Void> sendOrderMessage(String enterpriseId, NoticeMessageTypeEnum noticeType, String relationId,
String refundStoreId , String clerkId, String memberId, List<String> valueList);
/**
* 通过通讯录-鸿星尔克
* @param wxEnterpriseId
* @param staffName
* @param qwDTO
* @param qwUserId
* @param mainDeptId
* @param position
* @param gender
* @param mobile
* @param nationcode
*/
public void updateForSyncStaff(String wxEnterpriseId, String staffName , WxEnterpriseQwDTO qwDTO , String qwUserId , String mainDeptId , String position ,
Integer gender, String mobile , String nationcode) ;
}
......@@ -358,4 +358,5 @@ public interface StaffApiService {
com.gic.api.base.commons.ServiceResponse<StaffActiveAllocationDTO> staffActiveAllocation(String wxEnterpriseId,String staffIds);
void updateStaffHead(String wxEnterpriseId ,String staffId, String headUrl);
}
......@@ -82,4 +82,12 @@ public interface HaobanRoleApiService {
* @return
*/
ServiceResponse<Void> contentMaterialRoleInit(ContentMaterialROleInitQDTO contentMaterialROleInitQDTO);
/**
* 刷新企业权限 单次
* @param params
* @return
*/
@Deprecated
ServiceResponse<Void> flushRightOneTime(String params);
}
......@@ -266,12 +266,14 @@ public class TestController extends WebBaseController {
}
@RequestMapping("/get-cache")
@ResponseBody
public Object getCache(String key) {
Object o = RedisUtil.getCache(key) ;
return o ;
}
@RequestMapping("/del-cache")
@ResponseBody
public Object delCache(String key) {
Object o = RedisUtil.getCache(key) ;
if(null != o) {
......
......@@ -213,6 +213,11 @@
<artifactId>holo-client</artifactId>
<version>2.2.10</version>
</dependency>
<dependency>
<groupId>com.gic</groupId>
<artifactId>gic-content-api</artifactId>
<version>${gic-content-api}</version>
</dependency>
</dependencies>
<build>
......
......@@ -57,16 +57,6 @@ public interface PreDealLogMapper {
, @Param("status") int status, @Param("dataType") int dataType);
/**
* 获取单条数据
*
* @param taskId
* @param pDataId
* @return
*/
List<TabHaobanPreDealLog> listReByPDataId(@Param("taskId") String taskId, @Param("dataId") String pDataId
, @Param("dataType") int dataType);
/**
* 更新状态
*
* @param taskId
......
......@@ -15,6 +15,8 @@ public interface StaffMapper {
TabHaobanStaff selectByPrimaryKey(String staffId);
TabHaobanStaff selectByPrimaryKeyNoStatus(String staffId);
int updateByPrimaryKeySelective(TabHaobanStaff record);
TabHaobanStaff selectByNationcodeAndPhoneNumber(@Param("wxEnterpriseId") String wxEnterpriseId, @Param("nationCode") String nationcode, @Param("phoneNumber") String phoneNumber);
......@@ -190,5 +192,6 @@ public interface StaffMapper {
TabHaobanStaff getNumByActiveCode(@Param("wxEnterpriseId") String wxEnterpriseId,@Param("activeCode")String activeCode);
void updateOccupyFlagByStaffId(@Param("staffId") String staffId);
void updateStaffHead(@Param("staffId")String staffId, @Param("headUrl")String headUrl);
}
\ No newline at end of file
......@@ -159,6 +159,9 @@ public interface TabHaobanExternalClerkRelatedMapper {
*/
TabHaobanExternalClerkRelated getLastByExTernalUseridAndWxUserIdNoStatus(@Param("wxEnterpriseId") String wxEnterpriseId, @Param("externalUserid") String externalUserid, @Param("staffId") String staffId);
TabHaobanExternalClerkRelated getLastByExTernalUseridAndWxUserIdNoStatusSelf(@Param("wxEnterpriseId") String wxEnterpriseId, @Param("externalUserid") String externalUserid, @Param("staffId") String staffId);
/**
* 根据id 查询列表
*
......
......@@ -10,6 +10,8 @@ public interface WxEnterpriseRelatedMapper {
int deleteByEnterpriseId(String enterpriseId) ;
int deleteById(String id) ;
int insertSelective(TabHaobanWxEnterpriseRelated record);
TabHaobanWxEnterpriseRelated selectByPrimaryKey(String wxEnterpriseRelatedId);
......
......@@ -9,6 +9,7 @@ import com.gic.haoban.manage.service.pojo.bo.content.message.InteractRecordMessa
import lombok.AllArgsConstructor;
import lombok.Data;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.math.NumberUtils;
import org.springframework.beans.BeanUtils;
import java.util.Date;
......@@ -39,6 +40,30 @@ public class InteractRecordMessageContext {
*/
private Boolean hasDeal;
/**
* 业务类型
* @return
*/
public Integer getBizType() {
// 素材id不为空 且 素材id是数字类型
if (StringUtils.isNotBlank(interactRecordMessageBO.getMaterialId())
&& NumberUtils.isDigits(interactRecordMessageBO.getMaterialId())) {
return ShareBizType.MATERIAL.getCode();
}
return ShareBizType.GOODS.getCode();
}
public String getBizId() {
Integer bizType = this.getBizType();
if (ShareBizType.MATERIAL.getCode().equals(bizType)) {
return interactRecordMessageBO.getMaterialId();
}
if (ShareBizType.GOODS.getCode().equals(bizType)) {
return interactRecordMessageBO.getGoodsId();
}
return StringUtils.EMPTY;
}
public static InteractRecordMessageContext create(InteractRecordMessageBO interactRecordMessageBO) {
InteractRecordMessageContext context = new InteractRecordMessageContext();
context.setInteractRecordMessageBO(interactRecordMessageBO);
......@@ -51,8 +76,8 @@ public class InteractRecordMessageContext {
* @return
*/
public String buildRecordKey() {
String customerId = StringUtils.isNotBlank(interactRecordMessageBO.getMemberId()) ? interactRecordMessageBO.getMemberId() : interactRecordMessageBO.getUnionId();
String key = interactRecordMessageBO.getBusinessUUId() + interactRecordMessageBO.getClerkId() + interactRecordMessageBO.getMaterialId() + customerId;
String key = interactRecordMessageBO.getBusinessUUId() + interactRecordMessageBO.getClerkId()
+ this.getBizId() + this.getCustomerId();
return MD5.create().digestHex(key);
}
......@@ -94,8 +119,8 @@ public class InteractRecordMessageContext {
temp.setEventType(this.interactRecordMessageBO.getEventType());
Integer durationTime = Optional.ofNullable(this.interactRecordMessageBO.getDurationTime()).orElse(0);
temp.setDurationTime(durationTime / 1000);
temp.setBizType(ShareBizType.MATERIAL.getCode());
temp.setBizId(this.interactRecordMessageBO.getMaterialId() + "");
temp.setBizType(this.getBizType());
temp.setBizId(this.getBizId());
temp.setTimes(this.times);
temp.setTraceId(this.buildRecordKey());
temp.setDeleteFlag(0);
......
......@@ -45,7 +45,7 @@ public class InteractRecordMessageBO implements Serializable {
*/
private Integer channelSource;
/**
* 事件类型 1浏览素材;2查看商品; 3购买商品
* 事件类型 1浏览素材;2查看商品; 3购买商品 4 加入购物车
*/
private Integer eventType;
/**
......@@ -80,4 +80,10 @@ public class InteractRecordMessageBO implements Serializable {
* 消息消费次数
*/
private Integer times;
/**
* 业务类型
* @see com.gic.haoban.manage.api.enums.content.ShareBizType
*/
private Integer bizType;
}
......@@ -120,5 +120,7 @@ public interface HandoverService {
* @return
*/
public List<HandoverStaffFriendCountDTO> listFriendCountByWxStaffIds(String wxEnterpriseId, List<String> staffIds);
TabHandoverStaff getHandoverStaff(String wxEnterpriseId, String wxUserId);
Boolean filterHandoverStaff(String wxEnterpriseId, String wxUserId);
public void delHandoverStaff(String wxEnterpriseId, List<String> wxUserIds) ;
}
......@@ -40,15 +40,6 @@ public interface PreDealService {
public List<TabHaobanPreDealLog> listByPDataId(String taskId, String pDataId, int status);
/**
* 根据父数据id 获取子节点
*
* @param pDataId
* @param status
* @return
*/
public List<TabHaobanPreDealLog> listReByPDataId(String taskId, String pDataId);
/**
* 更新单条数据状态
*
* @param dataId
......@@ -201,5 +192,6 @@ public interface PreDealService {
public void addTaskStatusCache(String taskId) ;
public void addTaskStaffStatusCache(String taskId,String staffId , int type) ;
public void addTaskDepartStatusCache(String taskId,int type) ;
}
......@@ -154,4 +154,6 @@ public interface StaffService {
* @return
*/
List<String> queryStaffIdsWithEnterpriseId(List<String> wxEnterpriseIds);
void updateStaffHead(String wxEnterpriseId ,String staffId, String headUrl);
}
......@@ -68,10 +68,10 @@ public interface InteractRecordService {
/**
* 查询最新的一条互动记录
* @param clerkId
* @param materialId
* @param bizId
* @param memberId
* @return
*/
InteractRecordBO queryLeastRecord(String enterpriseId, String clerkId, String materialId, String memberId);
InteractRecordBO queryLeastRecord(String enterpriseId, String clerkId, String bizId, String memberId);
}
package com.gic.haoban.manage.service.service.content.adaptor;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.store.goods.dto.goods.GoodsSpuInfoDTO;
import com.gic.store.goods.service.GoodsCenterApiService;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.function.Function;
import java.util.stream.Collectors;
/**
* @Author MUSI
* @Date 2023/8/15 9:28 AM
* @Description
* @Version
**/
@Component
public class GoodsInfoAdaptor {
@Autowired
private GoodsCenterApiService goodsCenterApiService;
public Map<String, GoodsSpuInfoDTO> queryGoodsMinPrice(String enterpriseId, List<String> goodsIds) {
ServiceResponse<List<GoodsSpuInfoDTO>> response = goodsCenterApiService.queryGoodsMinPrice(enterpriseId, goodsIds);
if (!response.isSuccess() || CollectionUtils.isEmpty(response.getResult())) {
return Collections.emptyMap();
}
return response.getResult()
.stream()
.collect(Collectors.toMap(GoodsSpuInfoDTO::getGoodsId, Function.identity(), (v1, v2) -> v1));
}
}
......@@ -2,18 +2,18 @@ package com.gic.haoban.manage.service.service.content.adaptor;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.TypeReference;
import com.gic.api.base.commons.Page;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.haoban.manage.api.enums.content.MaterialInteractRecordEventType;
import com.gic.haoban.manage.api.enums.content.ShareBizType;
import com.gic.haoban.manage.api.enums.content.TriggerCustomerChannelType;
import com.gic.haoban.manage.service.entity.content.TabHaobanInteractRecord;
import com.gic.haoban.manage.service.pojo.bo.content.InteractRecordBO;
import com.gic.haoban.manage.service.pojo.bo.content.InteractRecordExtendInfoBO;
import com.gic.haoban.manage.service.pojo.bo.content.PotentialCustomerBO;
import com.gic.haoban.manage.service.pojo.bo.content.context.InteractRecordMessageContext;
import com.gic.store.goods.dto.goods.GoodsInfoSimpleDTO;
import com.gic.store.goods.dto.goods.GoodsSpuInfoDTO;
import com.gic.store.goods.dto.qdto.GoodsListQDTO;
import com.gic.store.goods.service.GoodsCenterApiService;
import com.gic.store.goods.service.GoodsInfoOutApiService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
......@@ -25,6 +25,7 @@ import java.util.Arrays;
import java.util.Collections;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
......@@ -36,10 +37,13 @@ import java.util.stream.Collectors;
@Slf4j
@Component
public class InteractRecordBuilder {
@Autowired
private GoodsCenterApiService goodsCenterApiService;
@Autowired
private InteractRecordMessageBuilder interactRecordMessageBuilder;
@Autowired
private GoodsInfoOutApiService goodsInfoOutApiService;
@Autowired
private GoodsInfoAdaptor goodsInfoAdaptor;
/**
* 互动记录描述
......@@ -48,7 +52,7 @@ public class InteractRecordBuilder {
* @return
*/
public String buildDesc(TabHaobanInteractRecord interactRecord) {
return this.buildDesc(interactRecord.getChannelSource(), interactRecord.getEventType());
return this.buildDesc(interactRecord.getChannelSource(), interactRecord.getEventType(), interactRecord.getBizType());
}
/**
......@@ -58,7 +62,7 @@ public class InteractRecordBuilder {
* @param eventType
* @return
*/
public String buildDesc(Integer channelSource, Integer eventType) {
public String buildDesc(Integer channelSource, Integer eventType, Integer bizType) {
StringBuilder stringBuilder = new StringBuilder();
if (TriggerCustomerChannelType.showDescChannel().contains(channelSource)) {
TriggerCustomerChannelType channelType = TriggerCustomerChannelType.getInstance(channelSource);
......@@ -68,7 +72,11 @@ public class InteractRecordBuilder {
}
MaterialInteractRecordEventType instance = MaterialInteractRecordEventType.getInstance(eventType);
if (instance != null) {
stringBuilder.append(instance.getDesc());
String text = String.format(instance.getDesc(), ShareBizType.getDescWithCode(bizType));
if (MaterialInteractRecordEventType.VISIT_PRODUCT.getCode().equals(eventType) && ShareBizType.GOODS.getCode().equals(bizType)) {
text = "浏览了你分享的商品";
}
stringBuilder.append(text);
}
return stringBuilder.toString();
}
......@@ -96,12 +104,14 @@ public class InteractRecordBuilder {
}
InteractRecordExtendInfoBO extendInfo = JSON.parseObject(interactRecord.getExtendInfo(), new TypeReference<InteractRecordExtendInfoBO>() {
});
if (MaterialInteractRecordEventType.VISIT_PRODUCT.getCode().equals(interactRecord.getEventType())) {
if (MaterialInteractRecordEventType.VISIT_PRODUCT.getCode().equals(interactRecord.getEventType())
|| MaterialInteractRecordEventType.ADD_SHOPPING_CART.getCode().equals(interactRecord.getEventType())
|| MaterialInteractRecordEventType.ORDER.getCode().equals(interactRecord.getEventType())) {
// 浏览商品事件
List<String> visitGoodsIds = extendInfo.getGoodsIds();
if (CollectionUtils.isEmpty(visitGoodsIds)) {
log.info("组装浏览商品信息, 商品信息不存在 {}", interactRecord.getExtendInfo());
return null;
return extendInfo;
}
// 拼接商品信息
List<InteractRecordExtendInfoBO.ExtendGoodsInfo> extendGoodsInfos =
......@@ -110,6 +120,19 @@ public class InteractRecordBuilder {
extendInfo.setInvalidGoodsNum(visitGoodsIds.size() - extendGoodsInfos.size());
return extendInfo;
}
// if (MaterialInteractRecordEventType.ORDER.getCode().equals(interactRecord.getEventType())
// && ShareBizType.GOODS.getCode().equals(interactRecord.getBizType())) {
// InteractRecordExtendInfoBO.ExtendGoodsInfo extendGoodsInfo = new InteractRecordExtendInfoBO.ExtendGoodsInfo();
// extendGoodsInfo.setGoodsName();
// extendGoodsInfo.setGoodsCode(item.getGoodsCode());
// extendGoodsInfo.setGoodsImageUrl(item.getGoodsImageUrl());
// extendGoodsInfo.setSalePrice(item.getSalePrice());
// extendGoodsInfo.setSourceType(item.getSourceType());
// GoodsSpuInfoDTO goodsSpuInfoDTO = goodsMinPriceMap.get(item.getGoodsId());
// if (goodsSpuInfoDTO != null && goodsSpuInfoDTO.getMinPrice() != null) {
// extendGoodsInfo.setSalePrice(goodsSpuInfoDTO.getMinPrice());
// }
// }
return extendInfo;
}
......@@ -117,33 +140,32 @@ public class InteractRecordBuilder {
if (CollectionUtils.isEmpty(visitGoodsIds)) {
return Collections.emptyList();
}
GoodsListQDTO goodsListQDTO = new GoodsListQDTO();
goodsListQDTO.setEnterpriseId(enterpriseId);
goodsListQDTO.setIncludeGoodsIds(visitGoodsIds);
goodsListQDTO.setPageSize(visitGoodsIds.size() + 1);
ServiceResponse<Page<GoodsSpuInfoDTO>> serviceResponse =
goodsCenterApiService.queryStoreGoodsList(goodsListQDTO);
ServiceResponse<List<GoodsInfoSimpleDTO>> serviceResponse = goodsInfoOutApiService.queryGoodsSimpleInfo(visitGoodsIds);
// 1:已上线,2:未上线,3:回收站
if (!serviceResponse.isSuccess()) {
log.info("查询商品异常 {}", JSON.toJSONString(serviceResponse));
return Collections.emptyList();
}
if (CollectionUtils.isEmpty(serviceResponse.getResult().getResult())) {
if (CollectionUtils.isEmpty(serviceResponse.getResult())) {
log.info("查询商品为空 {}", JSON.toJSONString(serviceResponse));
return Collections.emptyList();
}
Map<String, GoodsSpuInfoDTO> goodsMinPriceMap = goodsInfoAdaptor.queryGoodsMinPrice(enterpriseId, visitGoodsIds);
List<Integer> excludeStatus = Arrays.asList(0, 3);
return serviceResponse.getResult()
.getResult()
.stream()
.filter(item -> !excludeStatus.contains(item.getStatus()))
.map(item -> {
InteractRecordExtendInfoBO.ExtendGoodsInfo extendGoodsInfo = new InteractRecordExtendInfoBO.ExtendGoodsInfo();
extendGoodsInfo.setGoodsName(item.getGoodsName());
extendGoodsInfo.setGoodsCode(item.getGoodsCode());
extendGoodsInfo.setGoodsImageUrl(item.getImageUrl());
extendGoodsInfo.setGoodsImageUrl(item.getGoodsImageUrl());
extendGoodsInfo.setSalePrice(item.getSalePrice());
extendGoodsInfo.setSourceType(item.getSourceType());
GoodsSpuInfoDTO goodsSpuInfoDTO = goodsMinPriceMap.get(item.getGoodsId());
if (goodsSpuInfoDTO != null && goodsSpuInfoDTO.getMinPrice() != null) {
extendGoodsInfo.setSalePrice(goodsSpuInfoDTO.getMinPrice());
}
return extendGoodsInfo;
})
.collect(Collectors.toList());
......
......@@ -74,7 +74,7 @@ public class InteractRecordMessageBuilder {
searchQo.setUnionId(context.getInteractRecordMessageBO().getUnionId());
}
searchQo.setPageSize(1);
searchQo.setBizId(context.getInteractRecordMessageBO().getMaterialId());
searchQo.setBizId(context.getBizId());
Integer count = interactRecordService.countInteractRecord(searchQo);
context.setTimes(count + 1);
}
......@@ -190,7 +190,7 @@ public class InteractRecordMessageBuilder {
.map(ListOrderItemDTO::getMallProId)
.distinct()
.collect(Collectors.toList());
Map<String, Integer> goodsSourceTypeMap = queryGoodsSimpleInfo(enterpriseId, goodsIds);
Map<String, Integer> goodsSourceTypeMap = this.queryGoodsSimpleInfo(enterpriseId, goodsIds);
OrderOutInfoDTO orderOutInfoDTO = serviceResponse.getResult();
InteractRecordExtendInfoBO.ExtendOrderInfo extendOrderInfo = new InteractRecordExtendInfoBO.ExtendOrderInfo();
......
......@@ -232,16 +232,16 @@ public class InteractRecordServiceImpl implements InteractRecordService {
* 查询最新的一条互动记录
*
* @param clerkId
* @param materialId
* @param bizId
* @param memberId
* @return
*/
@Override
public InteractRecordBO queryLeastRecord(String enterpriseId, String clerkId, String materialId, String memberId) {
public InteractRecordBO queryLeastRecord(String enterpriseId, String clerkId, String bizId, String memberId) {
InteractRecordQO interactRecordQO = new InteractRecordQO();
interactRecordQO.setEnterpriseId(enterpriseId);
interactRecordQO.setClerkId(clerkId);
interactRecordQO.setBizId(materialId);
interactRecordQO.setBizId(bizId);
interactRecordQO.setMemberId(memberId);
PageHelper.startPage(1, 1);
com.github.pagehelper.Page<TabHaobanInteractRecord> pageResult =
......
package com.gic.haoban.manage.service.service.content.message;
import com.alibaba.fastjson.JSON;
import com.gic.dubbo.entity.ProviderLocalTag;
import com.gic.haoban.manage.api.enums.content.MaterialInteractRecordEventType;
import com.gic.haoban.manage.service.pojo.bo.content.message.InteractRecordMessageBO;
import com.gic.haoban.manage.service.service.content.adaptor.MessageConvertHelper;
......@@ -12,6 +13,7 @@ import org.springframework.kafka.listener.MessageListener;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
/**
* @Author MUSI
......@@ -32,12 +34,14 @@ public class InteractRecordMessageListener implements MessageListener<String, St
static {
dealEventType.add(MaterialInteractRecordEventType.VISIT_PRODUCT.getCode());
dealEventType.add(MaterialInteractRecordEventType.VISIT_MATERIAL.getCode());
dealEventType.add(MaterialInteractRecordEventType.ADD_SHOPPING_CART.getCode());
}
@Override
public void onMessage(ConsumerRecord<String, String> consumerRecord) {
ProviderLocalTag providerLocalTag = ProviderLocalTag.tag.get();
providerLocalTag.traceId = UUID.randomUUID().toString();
String value = consumerRecord.value();
log.info("【InteractRecordMessageListener】处理埋点事件 {}", value);
InteractRecordMessageBO recordMessageBO = messageConvertHelper.convertMessageBo(value);
......@@ -46,7 +50,7 @@ public class InteractRecordMessageListener implements MessageListener<String, St
return;
}
if (recordMessageBO.getEventType() == null || !dealEventType.contains(recordMessageBO.getEventType())) {
log.info("素材埋点事件类型非素材相关类型 {}", recordMessageBO.getEventType());
log.info("埋点事件类型非相关类型 {}", recordMessageBO.getEventType());
return;
}
dataConvert(recordMessageBO);
......
......@@ -92,6 +92,9 @@ public class InteractRecordMessageService {
if (interactRecordBO.getEventType() < interactRecordMessageBO.getEventType()) {
interactRecordBO.setEventType(interactRecordMessageBO.getEventType());
}
if (MaterialInteractRecordEventType.ORDER.getCode().equals(interactRecordMessageBO.getEventType())) {
interactRecordBO.setEventType(interactRecordMessageBO.getEventType());
}
}
// 更新互动记录的最新访问时间
if (interactRecordBO.getLastAccessTime().before(new Date(interactRecordMessageBO.getLastAccessTime()))) {
......@@ -100,15 +103,19 @@ public class InteractRecordMessageService {
if (!MaterialInteractRecordEventType.VISIT_MATERIAL.getCode().equals(interactRecordMessageBO.getEventType())
&& null == interactRecordBO.getExtendInfo()) {
log.info("非素材浏览时间,初始化扩展字段");
log.info("非素材浏览事件,初始化扩展字段");
interactRecordBO.setExtendInfo(InteractRecordExtendInfoBO.empty());
}
// 组装扩展信息
if (MaterialInteractRecordEventType.VISIT_PRODUCT.getCode().equals(interactRecordMessageBO.getEventType())) {
if (MaterialInteractRecordEventType.VISIT_PRODUCT.getCode()
.equals(interactRecordMessageBO.getEventType())
|| MaterialInteractRecordEventType.ADD_SHOPPING_CART.getCode().equals(interactRecordBO.getEventType())) {
// 浏览商品
if (StringUtils.isNotBlank(interactRecordMessageBO.getGoodsId())
&& !interactRecordBO.getExtendInfo().getGoodsIds().contains(interactRecordMessageBO.getGoodsId())) {
interactRecordBO.getExtendInfo().getGoodsIds().add(interactRecordMessageBO.getGoodsId());
&& !interactRecordBO.getExtendInfo()
.getGoodsIds().contains(interactRecordMessageBO.getGoodsId())) {
interactRecordBO.getExtendInfo().getGoodsIds()
.add(interactRecordMessageBO.getGoodsId());
}
}
......@@ -139,9 +146,9 @@ public class InteractRecordMessageService {
potentialCustomerBO.setSeeFlag(0);
potentialCustomerBO.setStoreId(interactRecordBO.getStoreId());
potentialCustomerBO.setBizId(interactRecordBO.getBizId());
potentialCustomerBO.setBizType(interactRecordBO.getBizType());
potentialCustomerBO.setEventType(interactRecordBO.getEventType());
potentialCustomerBO.setChannelSource(interactRecordBO.getChannelSource());
potentialCustomerBO.setEventType(interactRecordBO.getEventType());
potentialCustomerBO.setDurationTime(interactRecordBO.getDurationTime());
potentialCustomerBO.setTimes(interactRecordBO.getTimes());
potentialCustomerService.saveOrUpdatePotentialCustomer(potentialCustomerBO);
......@@ -157,9 +164,14 @@ public class InteractRecordMessageService {
* @return
*/
public InteractRecordBO getInteractRecordBOWithOrderType(InteractRecordMessageBO interactRecordMessageBO) {
InteractRecordBO interactRecordBO;
InteractRecordBO interactRecordBO = null;
String bizId = interactRecordMessageBO.getMaterialId();
if (StringUtils.isBlank(bizId)) {
bizId = interactRecordMessageBO.getGoodsId();
}
interactRecordBO = interactRecordService.queryLeastRecord(interactRecordMessageBO.getEnterpriseId(), interactRecordMessageBO.getClerkId(),
interactRecordMessageBO.getMaterialId(), interactRecordMessageBO.getMemberId());
bizId, interactRecordMessageBO.getMemberId());
return interactRecordBO;
}
}
......@@ -9,6 +9,7 @@ import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;
import com.gic.haoban.manage.api.service.DealSyncOperationApiService;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
......@@ -74,6 +75,8 @@ public class HmClerkRelationServiceImpl implements HmClerkRelationService {
private SyncTaskService syncTaskService;
@Autowired
private PreDealService preDealService;
@Autowired
private DealSyncOperationApiService dealSyncOperationApiService ;
@Override
......@@ -284,30 +287,12 @@ public class HmClerkRelationServiceImpl implements HmClerkRelationService {
return dealLog;
}).collect(Collectors.toList());
this.preDealService.insert(dealLogList);
this.sendToMq(taskId, dealLogList.stream().map(o->o.getDataId()).collect(Collectors.toSet()), SyncTaskStatusEnum.modify_hm);
this.dealSyncOperationApiService.sendToMq(taskId, dealLogList.stream().map(o->o.getDataId()).collect(Collectors.toSet()), SyncTaskStatusEnum.modify_hm,"departmentSyncDealMq2");
ServiceResponse resp = ServiceResponse.success() ;
resp.setMessage(taskId);
return resp ;
}
private void sendToMq(String taskId, Set<String> dealList, SyncTaskStatusEnum syncTaskStatusEnum) {
//预处理分组任务
syncTaskService.updateTaskStatus(taskId, syncTaskStatusEnum.getVal());
List<String> listRet = dealList.stream().map(relationId -> {
DealParamMqDTO dealParamMqDTO = new DealParamMqDTO();
dealParamMqDTO.setTaskId(taskId);
dealParamMqDTO.setData(relationId);
dealParamMqDTO.setType(syncTaskStatusEnum.getVal());
return JSONObject.toJSONString(dealParamMqDTO);
}).collect(Collectors.toList());
GicMQClient clientInstance = GICMQClientUtil.getClientInstance();
try {
clientInstance.sendBatchMessages("departmentSyncDealMq", listRet, 1);
} catch (Exception e) {
e.printStackTrace();
}
}
public String createModifyHmTask(String wxEnterpriseId, String taskName, String staffId, String staffName, int syncTaskType) {
TabHaobanSyncTask tabHaobanSyncTask = new TabHaobanSyncTask();
......
......@@ -85,7 +85,6 @@ public class HandoverServiceImpl implements HandoverService {
WxEnterpriseQwDTO qwDTO = this.wxEnterpriseService.getQwInfo(wxEnterpriseId) ;
if (CollectionUtils.isEmpty(infoList)) {
logger.info("没有要保存的数据,删除所有需要删除逇");
delHandoverStaff(wxEnterpriseId, null);
return false;
}
SecretSettingDTO secretSetting = secretSettingService.getSecretSetting(qwDTO.getWxEnterpriseId(), SecretTypeEnum.CUSTOMIZED_APP.getVal());
......@@ -106,7 +105,7 @@ public class HandoverServiceImpl implements HandoverService {
return;
}
List<TabHandoverExternal> externalList = list.stream().map(dto -> {
TabHandoverExternal mid = getHandExternal(dto, qwDTO.getWxEnterpriseId(), handoverStaff);
TabHandoverExternal mid = getHandExternal(dto, qwDTO.getWxEnterpriseId(), handoverStaff,qwDTO.isSelf());
mid.setStaffId(handoverStaff.getStaffId());
handoverStaff.setDimissionTime(dto.getDimissionTimeDate());
mid.setStatusFlag(mid.getStatusFlag() != null ? mid.getStatusFlag() : 1);
......@@ -127,20 +126,6 @@ public class HandoverServiceImpl implements HandoverService {
handoverExternalMapper.insertBatch(needAdd);
}
});
//删除不需要的staff数据
List<TabHandoverStaff> handoverStaffList = handoverStaffMapper.listByWxEnterpriseId(wxEnterpriseId);
if (CollectionUtils.isEmpty(handoverStaffList)) {
logger.info("没有新数据,无需删除");
return true;
}
Set<String> hasWxUserIds = handoverStaffList.stream().map(dto -> dto.getHandoverUserId()).collect(Collectors.toSet());
Sets.SetView<String> needDelUserIds = Sets.difference(hasWxUserIds, handoverUserMap.keySet());
if (CollectionUtils.isEmpty(needDelUserIds)) {
logger.info("没有新数据,无需删除2");
return true;
}
logger.info("删除数据");
delHandoverStaff(wxEnterpriseId, new ArrayList<>(needDelUserIds));
return false;
}
......@@ -158,7 +143,7 @@ public class HandoverServiceImpl implements HandoverService {
* @param wxEnterpriseId
* @param wxUserIds
*/
private void delHandoverStaff(String wxEnterpriseId, List<String> wxUserIds) {
public void delHandoverStaff(String wxEnterpriseId, List<String> wxUserIds) {
handoverStaffMapper.delByUserIds(wxEnterpriseId, wxUserIds);
handoverExternalMapper.delNoTransferExternal(wxUserIds, wxEnterpriseId);
}
......@@ -176,7 +161,6 @@ public class HandoverServiceImpl implements HandoverService {
staffClerkRelationService.cleanStaffClerk(handoverStaff.getWxEnterpriseId(), staffIds);
}
}
@Override
public TabHandoverStaff getHandoverStaff(String wxEnterpriseId, String wxUserId) {
TabHaobanStaff haobanStaff = staffMapper.getNoStatusByWxUserIds(wxEnterpriseId, wxUserId);
if (null == haobanStaff) {
......@@ -215,7 +199,7 @@ public class HandoverServiceImpl implements HandoverService {
* @param infoDTO
* @return
*/
private TabHandoverExternal getHandExternal(QywxUnassignedInfoDTO infoDTO, String wxEnterpriseId, TabHandoverStaff handoverStaff) {
private TabHandoverExternal getHandExternal(QywxUnassignedInfoDTO infoDTO, String wxEnterpriseId, TabHandoverStaff handoverStaff,boolean selfFlag) {
TabHandoverExternal handoverExternal = handoverExternalMapper.getByExternalUserIdAndStaffId(wxEnterpriseId, handoverStaff.getStaffId(), infoDTO.getExternalUserid());
if (null != handoverExternal) {
return handoverExternal;
......@@ -224,7 +208,12 @@ public class HandoverServiceImpl implements HandoverService {
mid.setExternalUserId(infoDTO.getExternalUserid());
mid.setWxEnterpriseId(wxEnterpriseId);
mid.setHaobanFriendFlag(0);
TabHaobanExternalClerkRelated externalClerkRelated = externalClerkRelatedMapper.getLastByExTernalUseridAndWxUserIdNoStatus(wxEnterpriseId, infoDTO.getExternalUserid(), handoverStaff.getStaffId());
TabHaobanExternalClerkRelated externalClerkRelated = null ;
if(selfFlag) {
externalClerkRelated = externalClerkRelatedMapper.getLastByExTernalUseridAndWxUserIdNoStatusSelf(wxEnterpriseId, infoDTO.getExternalUserid(), handoverStaff.getStaffId());
}else {
externalClerkRelated = externalClerkRelatedMapper.getLastByExTernalUseridAndWxUserIdNoStatus(wxEnterpriseId, infoDTO.getExternalUserid(), handoverStaff.getStaffId());
}
if (null == externalClerkRelated) {
mid.setExternalUserName("企业微信客户");
mid.setRelationId("-1");
......@@ -340,4 +329,25 @@ public class HandoverServiceImpl implements HandoverService {
List<HandoverStaffFriendCountDTO> ret = handoverExternalMapper.listPreCountByStaffIds(wxEnterpriseId, staffIds);
return ret;
}
@Override
public Boolean filterHandoverStaff(String wxEnterpriseId, String wxUserId) {
TabHaobanStaff haobanStaff = staffMapper.getNoStatusByWxUserIds(wxEnterpriseId, wxUserId);
if (null == haobanStaff) {
logger.info("对应的staff不存在:{}", wxUserId);
return false;
}
TabHandoverStaff handoverStaff = handoverStaffMapper.getByStaffId(wxEnterpriseId, haobanStaff.getStaffId());
if (null != handoverStaff) {
logger.info("对应的handoverStaff已存在:{}", haobanStaff.getStaffId());
return false;
}
TabHaobanClerkMainStoreRelated clerkMainStoreRelated = clerkMainStoreRelatedMapper.getLastNoStatusByStaffId(wxEnterpriseId, haobanStaff.getStaffId());
if (null == clerkMainStoreRelated) {
logger.info("没有主门店:{}", haobanStaff.getStaffId());
// 需要过滤 没有主门店的人 不需要执行
return false;
}
return true;
}
}
......@@ -33,6 +33,7 @@ public class PreDealServiceImpl implements PreDealService {
public static final String HAOBAN_TASK_ID_SET_CACHE = "haobanTaskSyncIdSetCache" ;
public static final String HAOBAN_TASK_STAFF_ID_SET_CACHE = "haobanTaskStaffSyncIdSetCache" ;
public static final String HAOBAN_TASK_DEPART_SET_CACHE = "haobanTaskDepartSyncIdSetCache" ;
@Autowired
private PreDealLogMapper preDealLogMapper;
......@@ -53,7 +54,7 @@ public class PreDealServiceImpl implements PreDealService {
}
int i = 0;
while (i < pre) {
logger.info("这是第{}次,进入", i);
logger.info("分批保存第{}次", i);
i++;
int fromIndex = (i - 1) * pageSize;
int toIndex = (count - fromIndex) > pageSize ? (fromIndex + pageSize) : count;
......@@ -78,10 +79,6 @@ public class PreDealServiceImpl implements PreDealService {
return preDealLogMapper.listByPDataId(taskId, pDataId, status, PreDealTypeEnum.dept.getVal());
}
@Override
public List<TabHaobanPreDealLog> listReByPDataId(String taskId, String pDataId) {
return preDealLogMapper.listReByPDataId(taskId, pDataId, PreDealTypeEnum.dept.getVal());
}
@Override
public boolean updateStatusByDataId(String taskId, String dataId, int status, String reason) {
......@@ -200,4 +197,11 @@ public class PreDealServiceImpl implements PreDealService {
RSet<String> set = RedisUtil.getRedisClient().getSet(HAOBAN_TASK_STAFF_ID_SET_CACHE);
set.add(key) ;
}
@Override
public void addTaskDepartStatusCache(String taskId, int type) {
String key = taskId+"#"+type ;
RSet<String> set = RedisUtil.getRedisClient().getSet(HAOBAN_TASK_DEPART_SET_CACHE);
set.add(key) ;
}
}
......@@ -6,10 +6,13 @@ import com.alibaba.fastjson.JSON;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.commons.util.EntityUtil;
import com.gic.commons.util.UniqueIdUtils;
import com.gic.content.api.service.ContentProducerApiService;
import com.gic.haoban.common.utils.StringUtil;
import com.gic.haoban.manage.api.dto.StaffClerkRelationDTO;
import com.gic.haoban.manage.api.dto.StaffDTO;
import com.gic.haoban.manage.service.config.Config;
import com.gic.haoban.manage.service.dao.mapper.StaffMapper;
import com.gic.haoban.manage.service.dao.mapper.TabHaobanStaffClerkRelationMapper;
import com.gic.haoban.manage.service.dao.mapper.WxEnterpriseMapper;
import com.gic.haoban.manage.service.entity.TabHaobanStaff;
import com.gic.haoban.manage.service.entity.TabHaobanWxEnterprise;
......@@ -30,9 +33,8 @@ import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Collections;
import java.util.Date;
import java.util.List;
import java.util.*;
import java.util.stream.Collectors;
@Service
public class StaffServiceImpl implements StaffService {
......@@ -50,6 +52,10 @@ public class StaffServiceImpl implements StaffService {
private HaobanQywxFeeAccountStaffService haobanQywxFeeAccountStaffService;
@Autowired
private QywxUserApiService qywxUserApiService ;
@Autowired
private TabHaobanStaffClerkRelationMapper staffClerkRelationMapper ;
@Autowired
private ContentProducerApiService contentProducerApiService ;
@Override
public TabHaobanStaff selectById(String id) {
......@@ -296,4 +302,20 @@ public class StaffServiceImpl implements StaffService {
}
return this.mapper.queryStaffIdsWithEnterpriseId(wxEnterpriseIds);
}
@Override
public void updateStaffHead(String wxEnterpriseId , String staffId, String headUrl) {
this.mapper.updateStaffHead(staffId,headUrl) ;
List<StaffClerkRelationDTO> list = this.staffClerkRelationMapper.lisByStaffId(wxEnterpriseId,staffId,null) ;
if(CollectionUtils.isNotEmpty(list)) {
Map<String,List<StaffClerkRelationDTO>> map = list.stream().collect(Collectors.groupingBy(StaffClerkRelationDTO::getEnterpriseId)) ;
Set<String> set = map.keySet() ;
Iterator<String> it = set.iterator() ;
while(it.hasNext()) {
String enterpriseId = it.next() ;
List<String> clerkIdList = map.get(enterpriseId).stream().map(o->o.getClerkId()).collect(Collectors.toList());
this.contentProducerApiService.updateClerkProducer(enterpriseId,clerkIdList,headUrl) ;
}
}
}
}
......@@ -10,6 +10,8 @@ import com.gic.haoban.manage.api.dto.*;
import com.gic.haoban.manage.api.service.HandoverOperationApiService;
import com.gic.haoban.manage.api.service.WxEnterpriseApiService;
import com.gic.haoban.manage.service.config.Config;
import com.gic.haoban.manage.service.dao.mapper.HandoverStaffMapper;
import com.gic.haoban.manage.service.dao.mapper.StaffMapper;
import com.gic.haoban.manage.service.entity.TabHandoverExternal;
import com.gic.haoban.manage.service.entity.TabHandoverStaff;
import com.gic.haoban.manage.service.entity.TabHandoverTransfer;
......@@ -23,6 +25,7 @@ import com.gic.wechat.api.dto.qywx.QywxUnassignedInfoDTO;
import com.gic.wechat.api.dto.qywx.response.QywxGetUnassignedListDTO;
import com.gic.wechat.api.dto.qywx.response.QywxTransferCustomerDTO;
import com.gic.wechat.api.service.qywx.QywxUserApiService;
import com.google.common.collect.Sets;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.time.DateFormatUtils;
......@@ -53,11 +56,13 @@ public class HandoverOperationApiServiceImpl implements HandoverOperationApiServ
@Autowired
private WxEnterpriseService wxEnterpriseService;
@Autowired
private Config config;
private HandoverStaffMapper handoverStaffMapper;
@Autowired
private WxEnterpriseApiService wxEnterpriseApiService;
@Autowired
private StaffService staffService;
@Autowired
private StaffMapper staffMapper ;
@Override
......@@ -100,9 +105,11 @@ public class HandoverOperationApiServiceImpl implements HandoverOperationApiServ
private List<QywxUnassignedInfoDTO> getAllQywxUnassigned(String wxEnterpriseId) {
WxEnterpriseQwDTO qwDTO = this.wxEnterpriseService.getQwInfo(wxEnterpriseId);
//这里改成LinkedList,避免使用ArrayList导致频繁扩容,从而减少内存的浪费
List<QywxUnassignedInfoDTO> ret = new LinkedList<>();
List<QywxUnassignedInfoDTO> retList = new LinkedList<>();
QywxGetUnassignedListDTO unassignedListDTO = null;
String cursor = null;
Map<String,Boolean> map = new HashMap<>() ;
Set<String> leaveStaffSet = new HashSet<>() ;
do {
//离职成员客户列表
unassignedListDTO = qywxUserApiService.getUnassignedList(qwDTO.getThirdCorpid(), qwDTO.getSelf3thSecret(), cursor , qwDTO.isSelf(),qwDTO.getUrlHost());
......@@ -110,23 +117,39 @@ public class HandoverOperationApiServiceImpl implements HandoverOperationApiServ
List<QywxUnassignedInfoDTO> infoList = unassignedListDTO.getInfo();
if (CollectionUtils.isNotEmpty(infoList)) {
//这里过滤staff成员id,避免ret数组过大
ret.addAll(infoList);
//根据handoverUserid去重
/*List<QywxUnassignedInfoDTO> collect = infoList.stream().collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(QywxUnassignedInfoDTO::getHandoverUserid))), ArrayList::new));
for (QywxUnassignedInfoDTO dto : collect){
for (QywxUnassignedInfoDTO dto : infoList) {
String handoverUserid = dto.getHandoverUserid();
TabHandoverStaff handoverStaff = handoverService.getHandoverStaff(wxEnterpriseId, handoverUserid);
if (null == handoverStaff) {
ret = ret.stream().filter(d -> !d.getHandoverUserid().equals(handoverUserid)).collect(Collectors.toList());
Boolean flag = map.get(handoverUserid) ;
if(null == flag) {
leaveStaffSet.add(handoverUserid) ;
flag = handoverService.filterHandoverStaff(wxEnterpriseId, handoverUserid) ;
map.put(handoverUserid,flag) ;
}
if (flag) {
retList.add(dto);
}
}*/
}
}
} while (StringUtils.isNotBlank(cursor) && unassignedListDTO.getErrcode() == 0);
if (CollectionUtils.isEmpty(ret)) {
return ret;
//删除不需要的staff数据
List<TabHandoverStaff> handoverStaffList = handoverStaffMapper.listByWxEnterpriseId(wxEnterpriseId);
if (CollectionUtils.isNotEmpty(handoverStaffList) && CollectionUtils.isNotEmpty(leaveStaffSet)) {
Set<String> hasWxUserIds = handoverStaffList.stream().map(dto -> dto.getHandoverUserId()).collect(Collectors.toSet());
Sets.SetView<String> needDelUserIds = Sets.difference(hasWxUserIds, leaveStaffSet);
if (CollectionUtils.isNotEmpty(needDelUserIds)) {
logger.info("需要删除的离职人={}",needDelUserIds);
this.handoverService.delHandoverStaff(wxEnterpriseId, new ArrayList<>(needDelUserIds));
}
}
if (CollectionUtils.isEmpty(retList)) {
logger.info("无待处理的离职继承数");
return retList;
}
logger.info("无待处理的离职继承数={}",retList.size());
//去重
return ret.stream().collect(
return retList.stream().collect(
Collectors.collectingAndThen(
Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(dto -> {
return dto.getExternalUserid() + dto.getHandoverUserid();
......@@ -147,7 +170,7 @@ public class HandoverOperationApiServiceImpl implements HandoverOperationApiServ
}
transfers.forEach(dto -> {
try {
TabHaobanStaff handover = staffService.selectById(dto.getHandoverStaffId());
TabHaobanStaff handover = staffMapper.selectByPrimaryKeyNoStatus(dto.getHandoverStaffId());
TabHaobanStaff takeover = staffService.selectById(dto.getTakeoverStaffId());
if(null == handover) {
logger.info("handover is null={}",dto.getHandoverStaffId());
......
......@@ -206,9 +206,9 @@ public class MessageApiServiceImpl implements MessageApiService {
// 鸿星尔克
"e034e2bd5d0b44d3bf553c9f8204094c",
// 润臣测试环境
"ca66a01b79474c40b3e7c7f93daf1a3b",
"b18ffdc9d0644912865a248859914d80",
// 尊兴
"c0c2186a947440aa8c0afbdd869ec043",
"fb40256db41142a196b21ccf03e58507",
// 金华悦行
"ac451a350eed4a96958dd5c7377f8bd9");
return wxSet.contains(wxEnterpriseId);
......@@ -222,11 +222,12 @@ public class MessageApiServiceImpl implements MessageApiService {
* @param secret
*/
private void dealClerkUser(QywxCallBackDTO dto, String enterpriseId, String secret, String staffName , WxEnterpriseQwDTO qwDTO) {
log.info("鸿星尔克={}",JSONObject.toJSONString(dto));
ClerkQwDTO clerkQwDTO = new ClerkQwDTO();
clerkQwDTO.setEnterpriseId(enterpriseId);
String mainDeptId = dto.getMainDepartment();
List<com.gic.wechat.api.dto.qywx.DepartmentDTO> departments = qywxDepartmentApiService
.listSelfDepartment(dto.getAuthCorpId(), secret, Integer.valueOf(mainDeptId),qwDTO.getUrlHost());
.listSelfDepartment(qwDTO.getDkCorpid(), secret, Integer.valueOf(mainDeptId),qwDTO.getUrlHost());
if (CollectionUtils.isEmpty(departments)) {
log.info("通过主部门查询部门列表为空 mainDeptId:{}", mainDeptId);
return;
......@@ -515,6 +516,22 @@ public class MessageApiServiceImpl implements MessageApiService {
log.info("处理部门end:{}", JSON.toJSONString(qywxCallBackDTO));
}
public void updateForSyncStaff(String wxEnterpriseId, String staffName , WxEnterpriseQwDTO qwDTO , String qwUserId , String mainDeptId , String position ,
Integer gender, String mobile , String nationcode ) {
boolean suitWxEnterpriseIid = checkSuitEnterpriseId(wxEnterpriseId);
if (suitWxEnterpriseIid) {
QywxCallBackDTO qwUser = new QywxCallBackDTO() ;
qwUser.setUserid(qwUserId);
qwUser.setChangeType("create_user");
qwUser.setMainDepartment(mainDeptId);
qwUser.setPosition(position);
qwUser.setGender(gender);
qwUser.setMobile(mobile);
qwUser.setTelephone(nationcode);
// 鸿星尔克定制
dealErKe(qwUser, wxEnterpriseId, staffName,qwDTO);
}
}
/**
* 处理鸿星尔克定制需求
*
......
......@@ -32,6 +32,7 @@ import com.gic.haoban.manage.api.enums.ChannelCodeEnum;
import com.gic.haoban.manage.api.enums.SecretTypeEnum;
import com.gic.haoban.manage.api.enums.SyncTaskTypeEnum;
import com.gic.haoban.manage.api.service.DealSyncOperationApiService;
import com.gic.haoban.manage.api.service.MessageApiService;
import com.gic.haoban.manage.api.service.StaffApiService;
import com.gic.haoban.manage.service.config.Config;
import com.gic.haoban.manage.service.dao.mapper.StaffDepartmentRelatedMapper;
......@@ -131,6 +132,8 @@ public class StaffApiServiceImpl implements StaffApiService {
private HaobanQywxFeeOrderAccountService haobanQywxFeeOrderAccountService;
@Autowired
private HaobanQywxFeeOrderService haobanQywxFeeOrderService;
@Autowired
private MessageApiService messageApiService ;
@Override
public StaffDTO selectById(String staffId) {
......@@ -355,6 +358,8 @@ public class StaffApiServiceImpl implements StaffApiService {
staff.setActiveFlag(0);
staff.setCreateTime(new Date());
staffService.add(staff);
this.messageApiService.updateForSyncStaff(wxEnterpriseId,staff.getStaffName(),qwDTO,staff.getWxUserId(),
user.getMain_department(),user.getPosition(),staff.getSex(),user.getMobile(), staff.getNationCode());
} else {
staffService.updateByPrimaryKey(staff);
}
......@@ -1388,4 +1393,9 @@ public class StaffApiServiceImpl implements StaffApiService {
}
return com.gic.api.base.commons.ServiceResponse.failure("-9999","成员不存在");
}
@Override
public void updateStaffHead(String wxEnterpriseId ,String staffId, String headUrl) {
this.staffService.updateStaffHead(wxEnterpriseId,staffId,headUrl) ;
}
}
......@@ -22,6 +22,7 @@ import com.gic.haoban.common.utils.UuidUtil;
import com.gic.haoban.manage.api.dto.*;
import com.gic.haoban.manage.api.enums.ChannelCodeEnum;
import com.gic.haoban.manage.api.service.WxEnterpriseRelatedApiService;
import com.gic.haoban.manage.service.dao.mapper.WxEnterpriseMapper;
import com.gic.haoban.manage.service.dao.mapper.WxEnterpriseRelatedMapper;
import com.gic.haoban.manage.service.entity.*;
import com.gic.haoban.manage.service.service.DepartmentService;
......@@ -54,6 +55,8 @@ public class WxEnterpriseRelatedApiServiceImpl implements WxEnterpriseRelatedApi
@Autowired
private WxEnterpriseRelatedMapper wxEnterpriseRelatedMapper;
@Autowired
private WxEnterpriseMapper wxEnterpriseMapper ;
@Autowired
private WxEnterpriseRelatedService wxEnterpriseRelatedService;
@Autowired
private StoreGroupService storeGroupService;
......@@ -191,12 +194,26 @@ public class WxEnterpriseRelatedApiServiceImpl implements WxEnterpriseRelatedApi
return details;
}
// @Override
// public List<EnterpriseDetailDTO> queryBindGicEnterpriseByTime(String seqTime) {
// List<TabHaobanWxEnterpriseRelated> list = wxEnterpriseRelatedMapper.listEnterpriseByTime(seqTime);
// List<EnterpriseDetailDTO> details = EntityUtil.changeEntityListByJSON(EnterpriseDetailDTO.class, list);
// return details;
// }
private String isBindMany(String enterpriseId , String wxEnterpriseId) {
List<TabHaobanWxEnterpriseRelated> list = this.wxEnterpriseRelatedMapper.listByEnterpriseId(enterpriseId) ;
List<String> bindNameList = new ArrayList<>() ;
if(CollectionUtils.isNotEmpty(list)) {
for(TabHaobanWxEnterpriseRelated item : list) {
TabHaobanWxEnterprise wxEnterprise = this.wxEnterpriseMapper.selectByPrimaryKey(item.getWxEnterpriseId()) ;
if(null == wxEnterprise || 0 == wxEnterprise.getStatusFlag()) {
this.wxEnterpriseRelatedMapper.deleteById(item.getWxEnterpriseRelatedId()) ;
} else {
if(!item.getWxEnterpriseId().equals(wxEnterpriseId)) {
bindNameList.add(wxEnterprise.getCorpName()) ;
}
}
}
if(CollectionUtils.isNotEmpty(bindNameList)) {
return bindNameList.stream().collect(Collectors.joining("、"));
}
}
return null ;
}
@Transactional(rollbackFor = Exception.class)
@Override
......@@ -220,6 +237,13 @@ public class WxEnterpriseRelatedApiServiceImpl implements WxEnterpriseRelatedApi
String wxEnterpriseId = detailDTO.getWxEnterpriseId();
//校验关联已经企业绑定
TabHaobanWxEnterpriseRelated tab = wxEnterpriseRelatedMapper.findOneByEIdAndWxEid(enterpriseId, wxEnterpriseId);
String bindMany = this.isBindMany(enterpriseId , wxEnterpriseId) ;
if(StringUtils.isNotBlank(bindMany)) {
logger.info("一GIC商户绑不能绑定多个");
resp.setCode(2);
resp.setMessage("商户不能绑多个企微("+bindMany+")");
return resp;
}
if (tab != null && (!tab.getWxEnterpriseRelatedId().equals(detailDTO.getWxEnterpriseRelatedId()))) {
logger.info("该企业已经被绑定过");
resp.setCode(2);
......
......@@ -76,13 +76,21 @@ public class MallOrderStatusChangeApiServiceImpl implements MallOrderStatusChang
JSONObject jsonObject = JSON.parseObject(extendJson, JSONObject.class);
String clerkId = jsonObject.getString("clerkId");
String contentMaterialId = jsonObject.getString("contentMaterialId");
String goodsId = jsonObject.getString("proId");
String memberId = orderEventMqBO.getMemberId();
InteractRecordMessageBO interactRecordMessageBO = new InteractRecordMessageBO();
interactRecordMessageBO.setEnterpriseId(orderEventMqBO.getEnterpriseId());
interactRecordMessageBO.setMemberId(memberId);
interactRecordMessageBO.setClerkId(clerkId);
interactRecordMessageBO.setMaterialId(contentMaterialId);
if (StringUtils.isNotBlank(contentMaterialId) && StringUtils.isNumeric(contentMaterialId)) {
interactRecordMessageBO.setMaterialId(contentMaterialId);
}else if (StringUtils.isNotBlank(goodsId) && !StringUtils.isNumeric(goodsId)) {
interactRecordMessageBO.setGoodsId(goodsId);
}else {
log.info("订单扩展信息中无要处理的数据 {}", extendJson);
return ServiceResponse.success();
}
interactRecordMessageBO.setEventType(MaterialInteractRecordEventType.ORDER.getCode());
interactRecordMessageBO.setDurationTime(0);
interactRecordMessageBO.setLastAccessTime(orderInfo.getCreateTime().getTime());
......
......@@ -56,7 +56,7 @@ public class PotentialCustomerApiServiceImpl implements PotentialCustomerApiServ
PotentialCustomerDTO temp = new PotentialCustomerDTO();
BeanUtils.copyProperties(item, temp);
temp.setPotentialCustomerId(item.getId());
temp.setDesc(interactRecordBuilder.buildDesc(item.getChannelSource(), item.getEventType()));
temp.setDesc(interactRecordBuilder.buildDesc(item.getChannelSource(), item.getEventType(), item.getBizType()));
return temp;
})
.collect(Collectors.toList());
......
......@@ -888,6 +888,13 @@ public class HmQrcodeApiServiceImpl implements HmQrcodeApiService {
hmQrcodeQDTO.setStoreId(staffClerkRelationDTO.getStoreId());
hmQrcodeQDTO.setClerkIdList(Collections.singletonList(staffClerkRelationDTO.getClerkId()));
add(hmQrcodeQDTO);
HmQrcodeBO hmQrcodeBO = hmQrcodeService.queryByClerkId(staffClerkRelationDTO.getClerkId(), staffClerkRelationDTO.getWxEnterpriseId());
if (hmQrcodeBO != null && hmQrcodeBO.getStatusFlag()==3) {
logger.info("导购活码待生效状态变更,clerkId:{}",staffClerkRelationDTO.getClerkId());
hmQrcodeService.updateStatusById(hmQrcodeBO.getHmId(), 1);
}
}
List<StaffClerkRelationDTO> relationDTOS = staffClerkRelationService.listIdsByNotInWxUserIds(wxUserIdsList, wxEnterpriseId, enterpriseId);
......
......@@ -26,6 +26,7 @@ import com.gic.haoban.manage.service.pojo.bo.role.HaobanMenuBO;
import com.gic.haoban.manage.service.pojo.bo.role.HaobanRoleBO;
import com.gic.haoban.manage.service.service.TemplateEnterpriseRelatedService;
import com.gic.haoban.manage.service.service.WxEnterpriseRelatedService;
import com.gic.haoban.manage.service.service.content.adaptor.MaterialEnterpriseAdaptor;
import com.gic.haoban.manage.service.service.role.HaobanMenuService;
import com.gic.haoban.manage.service.service.role.HaobanRoleMenuService;
import com.gic.haoban.manage.service.service.role.HaobanRoleService;
......@@ -68,6 +69,8 @@ public class HaobanRoleApiServiceImpl implements HaobanRoleApiService {
private TabHaobanTemplateApplicationRelatedMapper tabHaobanTemplateApplicationRelatedMapper;
@Autowired
private TemplateEnterpriseRelatedService templateEnterpriseRelatedService;
@Autowired
private MaterialEnterpriseAdaptor materialEnterpriseAdaptor;
@Override
@Transactional(rollbackFor = Exception.class)
......@@ -575,16 +578,103 @@ public class HaobanRoleApiServiceImpl implements HaobanRoleApiService {
static {
// 导购
menuCodeMap.put("0" + ContentMaterialROleInitQDTO.Version.LOW.getCode(), Arrays.asList("materialMain", "commodityCenter", "commodityCenterTab", "materialCenterTab", "goodsDetail_material", "goodsCenter_Count", "salesClue", "customerDetail_interact"));
menuCodeMap.put("0" + ContentMaterialROleInitQDTO.Version.HIGH.getCode(), Arrays.asList("materialMain","commodityCenter", "commodityCenterTab", "materialCenterTab", "goodsDetail_material", "goodsCenter_Count", "salesClue", "customerDetail_interact"));
menuCodeMap.put("0" + ContentMaterialROleInitQDTO.Version.LOW.getCode(), Arrays.asList("materialMain", "commodityCenter", "commodityCenterTab", "materialCenterTab",
"goodsDetail_material", "goodsCenter_Count", "salesClue", "customerDetail_interact"));
menuCodeMap.put("0" + ContentMaterialROleInitQDTO.Version.HIGH.getCode(), Arrays.asList("materialMain","commodityCenter", "commodityCenterTab", "materialCenterTab",
"goodsDetail_material", "goodsCenter_Count", "salesClue", "customerDetail_interact", "publishMaterial", "userCenter_createCenter"));
// 店长
menuCodeMap.put("1" + ContentMaterialROleInitQDTO.Version.LOW.getCode(), Arrays.asList("materialMain", "commodityCenter", "commodityCenterTab", "materialCenterTab", "goodsDetail_material", "goodsCenter_Count", "materialManage", "salesClue", "customerDetail_interact"));
menuCodeMap.put("1" + ContentMaterialROleInitQDTO.Version.HIGH.getCode(), Arrays.asList("materialMain", "commodityCenter", "commodityCenterTab", "materialCenterTab", "goodsDetail_material", "goodsCenter_Count", "materialManage", "salesClue", "customerDetail_interact"));
menuCodeMap.put("1" + ContentMaterialROleInitQDTO.Version.HIGH.getCode(), Arrays.asList("materialMain", "commodityCenter", "commodityCenterTab", "materialCenterTab",
"goodsDetail_material", "goodsCenter_Count", "materialManage", "salesClue", "customerDetail_interact", "publishMaterial", "userCenter_createCenter"));
// 区经
menuCodeMap.put("2" + ContentMaterialROleInitQDTO.Version.LOW.getCode(), Arrays.asList("materialMain", "commodityCenter", "commodityCenterTab", "materialCenterTab", "goodsDetail_material", "goodsCenter_Count", "materialManage"));
menuCodeMap.put("2" + ContentMaterialROleInitQDTO.Version.HIGH.getCode(), Arrays.asList("materialMain", "commodityCenter", "commodityCenterTab", "materialCenterTab", "goodsDetail_material", "goodsCenter_Count", "materialManage"));
menuCodeMap.put("2" + ContentMaterialROleInitQDTO.Version.HIGH.getCode(), Arrays.asList("materialMain", "commodityCenter", "commodityCenterTab", "materialCenterTab",
"goodsDetail_material", "goodsCenter_Count", "materialManage", "publishMaterial", "userCenter_createCenter"));
}
/**
* 刷新企业权限
*
* @param params
* @return
*/
@Override
public ServiceResponse<Void> flushRightOneTime(String params) {
logger.info("flushRightOneTime 刷新企业内容权限:{}", params);
// 获取所有开通内容高级版的企业
List<String> enterpriseIds = materialEnterpriseAdaptor.queryHasRightEnterpriseIds(MaterialEnterpriseAdaptor.MaterialLevel.HIGH.getCode());
// 执行刷新权限
String enterpriseId = "";
if (StringUtils.isNotBlank(params) && !StringUtils.equals("-1", params)) {
enterpriseId = params;
}
List<String> menuCodes = new ArrayList<>();
menuCodes.add("publishMaterial");
menuCodes.add("userCenter_createCenter");
for (String tempId : enterpriseIds) {
if (StringUtils.isNotBlank(enterpriseId) && !StringUtils.equalsIgnoreCase(enterpriseId, tempId)) {
logger.info("【flushRightOneTime】当前企业:{} 不是目标企业:{}, 忽略", tempId, enterpriseId);
continue;
}
ContentMaterialROleInitQDTO contentMaterialROleInitQDTO = new ContentMaterialROleInitQDTO();
contentMaterialROleInitQDTO.setEnterpriseId(tempId);
contentMaterialROleInitQDTO.setVersion(MaterialEnterpriseAdaptor.MaterialLevel.HIGH.getCode());
logger.info("【flushRightOneTime】添加企业素材纬度权限: {}", JSON.toJSONString(contentMaterialROleInitQDTO));
// 查询企业下所有的微信企业id
List<TabHaobanWxEnterprise> tabHaobanWxEnterprises = wxEnterpriseRelatedService.listByEnterpriseId(contentMaterialROleInitQDTO.getEnterpriseId());
if (CollectionUtils.isEmpty(tabHaobanWxEnterprises)) {
logger.info("【flushRightOneTime】企业 {} 未关联企微 ", contentMaterialROleInitQDTO.getEnterpriseId());
continue;
}
for (TabHaobanWxEnterprise wxEnterpris : tabHaobanWxEnterprises) {
// 查询企微下 导购、店长、区经 的role_id
String wxEnterpriseId = wxEnterpris.getWxEnterpriseId();
// 处理商户权限
// 运维 + 好办后台
List<HaobanRoleBO> haobanRoleBOS = haobanRoleService.getListByWxEnterpriseId(wxEnterpriseId, null);
if (CollectionUtils.isEmpty(haobanRoleBOS)) {
logger.info("【flushRightOneTime】企业{} 企微 {} 下没有角色 ", contentMaterialROleInitQDTO.getEnterpriseId(), wxEnterpriseId);
continue;
}
logger.info("【flushRightOneTime】企业 {} 企微 {} 下角色个数: {}", enterpriseId, wxEnterpriseId, haobanRoleBOS.size());
// 为role 添加菜单
List<TabHaobanRoleMenu> haobanRoleMenus = new ArrayList<>();
for (HaobanRoleBO haobanRoleBO : haobanRoleBOS) {
logger.info("本次对应的menuCode:{}", JSON.toJSONString(menuCodes));
List<String> hasExistMenuCodes = haobanRoleMenuService.getByWxEnterpriseIdAndRoleId(wxEnterpriseId, haobanRoleBO.getRoleId());
if (CollectionUtils.isEmpty(hasExistMenuCodes)) {
hasExistMenuCodes = new ArrayList<>();
}
List<String> excludeMenuCodes = hasExistMenuCodes;
List<TabHaobanRoleMenu> tabHaobanRoleMenus = menuCodes.stream()
.filter(item -> !excludeMenuCodes.contains(item))
.map(item -> {
TabHaobanRoleMenu temp = new TabHaobanRoleMenu();
temp.setRoleMenuId(UniqueIdUtils.uniqueLong());
temp.setRoleId(haobanRoleBO.getRoleId());
temp.setWxEnterpriseId(wxEnterpriseId);
temp.setStatusFlag(1);
temp.setMenuCode(item);
temp.setCreateTime(new Date());
temp.setUpdateTime(new Date());
return temp;
})
.collect(Collectors.toList());
logger.info("【flushRightOneTime】企微:{} roleId:{} 新增权限code: {}", wxEnterpriseId, haobanRoleBO.getRoleId(), JSON.toJSONString(tabHaobanRoleMenus));
haobanRoleMenus.addAll(tabHaobanRoleMenus);
}
logger.info("【flushRightOneTime】企微:{} 新增权限code: {}", wxEnterpriseId, JSON.toJSONString(haobanRoleMenus));
if (CollectionUtils.isNotEmpty(haobanRoleMenus)) {
haobanRoleMenuService.insertBatch(haobanRoleMenus);
}
}
}
return ServiceResponse.success();
}
}
......@@ -59,11 +59,14 @@ public class QywxStaffSyncOperation implements BaseSyncOperation {
String reason = "";
//处理clerk
try {
ServiceResponse response = staffApiService.getWxSaveNew(dealParamMqDTO.getData(), dataPre.getWxEnterpriseId());
String taskId = dataPre.getTaskId() ;
String wxUserId = dealParamMqDTO.getData() ;
ServiceResponse response = staffApiService.getWxSaveNew(wxUserId, dataPre.getWxEnterpriseId());
if (response.getCode() != 1) {
dealFlag = false;
reason = response.getMessage();
}
this.preDealService.addTaskDepartStatusCache(taskId,2);
} catch (Exception e) {
logger.info("企微通讯录成员同步失败:{}", e.getMessage(), e);
reason = "同步异常:";
......@@ -80,51 +83,17 @@ public class QywxStaffSyncOperation implements BaseSyncOperation {
@Override
public void dealException(String taskId, String dataId, String enterpriseId, String reason) {
logger.info("企微通讯录成员处理失败:t:{},d:{}", taskId, dataId);
boolean b = preDealService.updateStatusByDataId(taskId, dataId, PreDealTypeEnum.clerk.getVal(), PreDealStatusEnum.exception.getVal(), reason);
if (!b) {
logger.info("企微通讯录成员处理异常:t:{}, d:{}", taskId, dataId);
return;
}
checkDepartmentTask(taskId);
this.preDealService.updateStatusByDataId(taskId, dataId, PreDealTypeEnum.clerk.getVal(), PreDealStatusEnum.exception.getVal(), reason);
}
@Override
public void dealSuccess(String taskId, String dataId, String enterpriseId, String wxEnterpriseId) {
logger.info("企微通讯录成员处理成功:t:{},d:{}", taskId, dataId);
boolean b = preDealService.updateStatusByDataId(taskId, dataId, PreDealTypeEnum.clerk.getVal(), PreDealStatusEnum.computed.getVal(), "成功");
if (!b) {
logger.info("企微通讯录成员成功修改错误!{}", dataId);
return;
}
checkDepartmentTask(taskId);
this.preDealService.updateStatusByDataId(taskId, dataId, PreDealTypeEnum.clerk.getVal(), PreDealStatusEnum.computed.getVal(), "成功");
}
@Override
public void checkDepartmentTask(String taskId) {
boolean b = preDealService.checkTask(taskId, PreDealTypeEnum.clerk.getVal());
if (!b) {
return;
}
logger.info("企微通讯录成员成功:{}", taskId);
String key = "haoban_sync_clerk_task_" + taskId;
RedisUtil.lock(key, 3L);
TabHaobanSyncTask syncTask = syncTaskService.getSyncTask(taskId);
String wxEnterpriseId = syncTask.getWxEnterpriseId();
//同步成功 进入门店处理
if (syncTask.getStatusFlag().equals(SyncTaskStatusEnum.clerk_sync.getVal())) {
int errCount = preDealService.countByTaskId(taskId, -1, PreDealStatusEnum.exception.getVal());
if (errCount > 0) {
syncTaskService.updateTaskStatus(taskId, SyncTaskStatusEnum.exception_compute.getVal());
dealSyncOperationApiService.unlockTask(wxEnterpriseId);
} else {
syncTaskService.updateTaskStatus(taskId, SyncTaskStatusEnum.compute.getVal());
dealSyncOperationApiService.unlockTask(wxEnterpriseId);
dealSyncOperationApiService.cleanDiffrence(wxEnterpriseId, taskId);
logger.info("同步通讯录完成");
}
}
RedisUtil.unlock(key);
}
}
......@@ -232,5 +232,6 @@
<dubbo:service interface="com.gic.haoban.manage.api.service.content.task.CommissionTaskApiService"
ref="commissionTaskApiService" timeout="10000" />
<dubbo:reference id="memberOrderReadApiService" interface="com.gic.order.api.service.member.MemberOrderReadApiService" timeout="10000" retries="0" check="false" />
<dubbo:reference id="contentProducerApiService" interface="com.gic.content.api.service.ContentProducerApiService" timeout="10000" retries="0" check="false" />
</beans>
\ No newline at end of file
......@@ -195,14 +195,6 @@
</if>
</select>
<select id="listReByPDataId" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from tab_haoban_pre_deal_log
where task_id = #{taskId} and p_data_id=#{dataId} and data_type=#{dataType}
and status_flag in(0,1,3)
</select>
<update id="updateStatusByDataId">
update tab_haoban_pre_deal_log
<set>
......
......@@ -45,6 +45,13 @@
where staff_id = #{staffId,jdbcType=VARCHAR} and status_flag = 1
</select>
<select id="selectByPrimaryKeyNoStatus" resultMap="BaseResultMap" parameterType="java.lang.String">
select
<include refid="Base_Column_List"/>
from tab_haoban_staff
where staff_id = #{staffId,jdbcType=VARCHAR}
</select>
<update id="delOtherStaffByWxUserId">
update tab_haoban_staff
......@@ -664,4 +671,9 @@
where staff_id= #{staffId}
</update>
<update id="updateStaffHead">
update tab_haoban_staff set head_img = #{headUrl}, update_time= now()
where staff_id= #{staffId}
</update>
</mapper>
\ No newline at end of file
......@@ -500,6 +500,18 @@
and external_user_id = #{externalUserid}
order by create_time desc limit 1
</select>
<select id="getLastByExTernalUseridAndWxUserIdNoStatusSelf" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from tab_haoban_external_clerk_related
where wx_enterprise_id = #{wxEnterpriseId}
and staff_id = #{staffId}
and self_external_userid = #{externalUserid}
order by create_time desc limit 1
</select>
<select id="listByIds" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
......@@ -865,7 +877,11 @@
<select id="getMemberIdByExternalId" resultType="java.lang.String">
select member_id
from tab_haoban_external_clerk_related where wx_enterprise_id = #{wxEnterpriseId}
and (external_user_id = #{externalUserId} or self_external_userid = #{externalUserId}) and status_flag =1
and external_user_id = #{externalUserId} and status_flag =1
UNION all
select member_id
from tab_haoban_external_clerk_related where wx_enterprise_id = #{wxEnterpriseId}
and self_external_userid = #{externalUserId} and status_flag =1
limit 1
</select>
......
......@@ -31,7 +31,10 @@
<update id="deleteByEnterpriseId">
update tab_haoban_wx_enterprise_related set status_flag = 0 , update_time=now() where enterprise_id=#{enterpriseId} and status_flag=1
</update>
<update id="deleteById">
update tab_haoban_wx_enterprise_related set status_flag = 0 , update_time=now() where wx_enterprise_related_id=#{id} and status_flag=1
</update>
<insert id="insertSelective" parameterType="com.gic.haoban.manage.service.entity.TabHaobanWxEnterpriseRelated">
insert into tab_haoban_wx_enterprise_related
......
......@@ -323,6 +323,7 @@
update tab_haoban_interact_record
set member_id = #{memberId}
where union_id = #{unionId} and delete_flag = 0
and (member_id is null or member_id = '')
</update>
</mapper>
......
......@@ -5,7 +5,9 @@ import com.gic.haoban.manage.api.dto.chat.GroupChatPlanDTO;
import com.gic.haoban.manage.api.dto.notify.qdto.NoticeMessageQDTO;
import com.gic.haoban.manage.api.dto.notify.qdto.NotifyMessageBatchQDTO;
import com.gic.haoban.manage.api.enums.NoticeMessageTypeEnum;
import com.gic.haoban.manage.api.service.HandoverOperationApiService;
import com.gic.haoban.manage.api.service.QywxTagApiService;
import com.gic.haoban.manage.api.service.StaffApiService;
import com.gic.haoban.manage.api.service.notify.NoticeMessageApiService;
import com.gic.haoban.manage.service.config.Config;
import com.gic.haoban.manage.service.service.WxEnterpriseService;
......@@ -33,19 +35,14 @@ public class ChatTest {
private static Logger logger = LoggerFactory.getLogger(ChatTest.class);
@Autowired
private GroupChatPlanService groupChatPlanService;
private HandoverOperationApiService handoverOperationApiService;
@Autowired
private StaffApiService staffApiService ;
@Test
public void test() {
String str = "{\"name\":\"测试\",\"remark\":\"测试\",\"expireDays\":\"2\",\"sendType\":1,\"sendTime\":\"\",\"chatContent\":\"[{\\\"img\\\":\\\"https://platform-1251519181.cos.ap-shanghai.myqcloud.com/image/jhdm/marketing_common-edc68cbf153846928c0ac28e2b2aa92f.jpg\\\",\\\"relation_id\\\":\\\"510923843246776342\\\",\\\"type\\\":2},{\\\"img\\\":\\\"https://platform-1251519181.cos.ap-shanghai.myqcloud.com/image/jhdm/marketing_common-3acc9bc9bbe8416e8aefe459b23eea5e.jpg\\\",\\\"relation_id\\\":\\\"510923843246776342\\\",\\\"type\\\":2},{\\\"content\\\":\\\"莎啦啦啦🐮\\\",\\\"relation_id\\\":\\\"510923843246776342\\\",\\\"type\\\":1}]\",\"staffIdList\":\"36067cdee7ba4ff6adc7551b34cc2005\",\"requestProject\":\"haoban-manage-web\"}";
GroupChatPlanDTO groupChatPlanDTO = JSONObject.parseObject(str, GroupChatPlanDTO.class);
groupChatPlanDTO.setWxEnterpriseId("ca66a01b79474c40b3e7c7f93daf1a3b");
groupChatPlanDTO.setEnterpriseId("ff8080815dacd3a2015dacd3ef5c0000");
groupChatPlanDTO.setCreatorId("fefd1c81641711e69d0818c58a146fd2");
groupChatPlanDTO.setCreatorName("达摩管理员");
groupChatPlanDTO.setMaterialFrom(2);
groupChatPlanService.save(groupChatPlanDTO);
this.staffApiService.updateStaffHead("ca66a01b79474c40b3e7c7f93daf1a3b","d7c29cb654b543d1966181c2ec2186ea","https://pic01-10001430.image.myqcloud.com/04564abc-5e82-4ba7-9ef3-39803438bb2c") ;
// this.handoverOperationApiService.dealQywxEnterpriseHandoverMq("ca66a01b79474c40b3e7c7f93daf1a3b") ;
}
@Test
......
import com.alibaba.fastjson.JSONObject;
import com.gic.api.base.commons.Page;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.haoban.manage.api.dto.content.PotentialCustomerDTO;
import com.gic.haoban.manage.api.dto.qdto.content.PotentialCustomerQDTO;
import com.gic.haoban.manage.api.service.content.MallOrderStatusChangeApiService;
import com.gic.haoban.manage.api.service.content.PotentialCustomerApiService;
import com.gic.haoban.manage.service.pojo.bo.content.OrderEventMqBO;
import com.gic.haoban.manage.service.pojo.bo.content.message.InteractRecordMessageBO;
import com.gic.haoban.manage.service.service.content.PotentialCustomerService;
import com.gic.haoban.manage.service.service.content.message.InteractRecordMessageService;
import com.gic.haoban.manage.service.service.out.impl.content.MallOrderStatusChangeApiServiceImpl;
import com.sun.org.apache.bcel.internal.generic.DADD;
import org.junit.Test;
import org.junit.runner.RunWith;
......@@ -26,6 +35,8 @@ public class InteractRecordMessageServiceTest {
InteractRecordMessageService interactRecordMessageService;
@Autowired
MallOrderStatusChangeApiService mallOrderStatusChangeApiService;
@Autowired
private PotentialCustomerApiService potentialCustomerApiService;
String eid = "ff8080815dacd3a2015dacd3ef5c0000";
String wxEid = "ca66a01b79474c40b3e7c7f93daf1a3b";
......@@ -60,4 +71,34 @@ public class InteractRecordMessageServiceTest {
String params ="{\"orderNumber\":\"6230408781099580\",\"toStatus\":2,\"fromStatus\":1,\"orderId\":\"c08691af8297480db3d25ef5ef19e863\",\"enterpriseId\":\"ff8080815dacd3a2015dacd3ef5c0000\",\"mqTraceId\":\"244806167-1-1680932807.425-/gic-thirdparty/wxmall_payment_result_notice\",\"memberId\":\"ff8080818147efc8018148d1759903c8\"}";
mallOrderStatusChangeApiService.mallOrderStatusChange(params);
}
@Test
public void dealGoodsRecord(){
String json = "{\"businessUUId\":\"IcB5ZMEvmzir1uvjgc6ohJFMmexraBak\",\"durationTime\":21990,\"enterpriseId\":\"ff8080815dacd3a2015dacd3ef5c0000\",\"eventType\":2,\"goodsId\":\"ff808081890a1b4201890a54b479001d\",\"lastAccessTime\":1692580759467,\"memberId\":\"ff80808189fd5ba6018a01ea3e070673\",\"refUrl\":\"pages/authorize/authorize\",\"unionId\":\"orXl9tyHOI4qP1QxwVcA7A3sB7zg\"}";
InteractRecordMessageBO interactRecordMessageBO = JSONObject.parseObject(json, InteractRecordMessageBO.class);
interactRecordMessageBO.setChannelSource(3);
interactRecordMessageBO.setClerkId("415b123576674913b365005b81037551");
interactRecordMessageService.dealRecord(interactRecordMessageBO);
}
@Test
public void queryPotentialCustomer() {
PotentialCustomerQDTO potentialCustomerQDTO = new PotentialCustomerQDTO();
potentialCustomerQDTO.setEnterpriseId("ff8080815dacd3a2015dacd3ef5c0000");
potentialCustomerQDTO.setClerkId("415b123576674913b365005b81037551");
potentialCustomerQDTO.setWxEnterpriseId("ca66a01b79474c40b3e7c7f93daf1a3b");
ServiceResponse<Page<PotentialCustomerDTO>> pageServiceResponse = potentialCustomerApiService.queryPotentialCustomer(potentialCustomerQDTO);
System.out.println(JSONObject.toJSONString(pageServiceResponse));
}
@Autowired
private MallOrderStatusChangeApiServiceImpl mallOrderStatusChangeApiServiceImpl;
@Test
public void orderTest() {
String json = "{\"orderNumber\":\"0230823781099580\",\"toStatus\":2,\"fromStatus\":1,\"orderId\":\"0a84ff17893046e49839fa3c3542bffa\",\"deliveryChannel\":1,\"eventTime\":1692794627733,\"enterpriseId\":\"8a809083802bbf5201804af08b0d0095\",\"businessType\":1,\"mqTraceId\":\"60157-1-1692794627.506-/gic-thirdparty/wxmall_payment_result_notice\",\"memberId\":\"8a808d838995476c0189b55f0ab807f7\"}";
mallOrderStatusChangeApiServiceImpl.sendDelayMessage(JSONObject.parseObject(json, OrderEventMqBO.class));
}
}
......@@ -639,7 +639,7 @@ public class StaffController extends WebBaseController {
if (enterpriseDTO != null) {
String taskId = dealSyncOperationApiService.createQywxTask(wxEnterpriseId, "后门同步企业微信架构", login.getClerkId(), "后门同步企业微信架构");
if (StringUtils.isBlank(taskId)) {
return resultResponse(HaoBanErrCode.ERR_0, false);
return this.fail("通讯录正在同步中") ; //resultResponse(HaoBanErrCode.ERR_0, false);
}
String ret = dealSyncOperationApiService.dealQywxDepartment(taskId, wxEnterpriseId);
if (null != ret) {
......
......@@ -3,6 +3,7 @@ package com.gic.haoban.manage.web.controller;
import com.alibaba.fastjson.JSON;
import com.gic.commons.webapi.reponse.RestResponse;
import com.gic.haoban.common.anno.IgnoreLogin;
import com.gic.haoban.manage.web.qo.logrecord.ErrorLogReportQO;
import com.gic.log.record.bean.WebErrorLogReport;
import com.gic.log.record.util.LogWebErrorLogReportUtil;
import org.apache.logging.log4j.LogManager;
......@@ -27,9 +28,13 @@ public class TabHaobanAppLogController {
@ResponseBody
@IgnoreLogin
@com.gic.web.common.ano.IgnoreLogin
public RestResponse<Boolean> insertLog(@RequestBody WebErrorLogReport qo) {
public RestResponse<Boolean> insertLog(@RequestBody ErrorLogReportQO qo) {
logger.info("插入日志的参数:{}", JSON.toJSONString(qo));
qo.setCreateTime(new Date());
if (qo.getType() != null && qo.getType() == 1) {
logger.info("TabHaobanAppLogController 日志内容:{}", JSON.toJSONString(qo));
return RestResponse.successResult();
}
LogWebErrorLogReportUtil.pushWebErrorLogReport(qo);
return RestResponse.successResult();
}
......
package com.gic.haoban.manage.web.qo.logrecord;
import com.gic.log.record.bean.WebErrorLogReport;
/**
* @Author MUSI
* @Date 2023/8/15 2:27 PM
* @Description
* @Version
**/
public class ErrorLogReportQO extends WebErrorLogReport {
private static final long serialVersionUID = -2657084366633675726L;
/**
* 0 获取null 正常记录
* 1 只记录log日志,不记录到ES
*/
private Integer type;
public Integer getType() {
return type;
}
public void setType(Integer type) {
this.type = type;
}
}
......@@ -243,6 +243,9 @@ public class WxStaffController extends WebBaseController {
vo.setClerkId(dto.getClerkId());
vo.setClerkType(dto.getClerkType());
vo.setClerkImg(dto.getImageUrl());
if (StringUtils.isBlank(vo.getClerkImg())) {
vo.setClerkImg(dto.getHeadImgUrl());
}
vo.setClerkName(dto.getClerkName());
StaffClerkRelationDTO related = bindCodeMap.get(dto.getClerkId());
if (related != null) {
......@@ -251,6 +254,8 @@ public class WxStaffController extends WebBaseController {
} else {
vo.setBindFlag(0);
}
long memberCount = customerApiService.countMember(enterpriseId, storeId, dto.getClerkId());
vo.setMemberCount(Convert.toInt(memberCount, 0));
resultList.add(vo);
}
Page<StoreClerkVO> page = new Page();
......@@ -1904,6 +1909,16 @@ public class WxStaffController extends WebBaseController {
}else {
vo.setStatus(2);
}
vo.setModuleVersion(dto.getModuleVersion());
return RestResponse.successResult(vo);
}
@RequestMapping("update-staff-head")
public RestResponse<Object> updateStaffHead(String wxEnterpriseId , String staffId , String headUrl){
if(StrUtil.isBlank(headUrl)){
return RestResponse.failure("-1", "参数不能为空!!!");
}
this.staffApiService.updateStaffHead(wxEnterpriseId,staffId,headUrl) ;
return RestResponse.successResult() ;
}
}
package com.gic.haoban.manage.web.controller.content;
import com.gic.commons.webapi.reponse.RestResponse;
import com.gic.enterprise.api.dto.EnterpriseDTO;
import com.gic.enterprise.api.service.AccountService;
import com.gic.enterprise.api.service.EnterpriseService;
import com.gic.thirdparty.cloudfile.CloudFileUtil;
import com.gic.thirdparty.cloudfile.enums.CloudFileBusinessOptEnum;
import com.gic.thirdparty.cloudfile.enums.CloudFileTypeEnum;
import com.gic.thirdparty.cloudfile.pojo.CloudFileInfo;
import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import org.springframework.web.multipart.commons.CommonsMultipartFile;
import javax.servlet.http.HttpServletRequest;
import java.io.File;
/**
* 好办-通用
*/
@Controller
@RequestMapping("/content")
public class ContentImageController {
private static Logger logger = LogManager.getLogger(ContentImageController.class);
@Autowired
private AccountService accountService;
@Autowired
private EnterpriseService enterpriseService;
/**
* 获取桶名称
* @param fileType 文件后缀 mp4
* @return
*/
@RequestMapping("get-bucket")
@ResponseBody
public RestResponse<CloudFileInfo> getBucket(String fileType,String enterpriseId) {
//存储空间余额校验
if (!accountService.storageFeeCheck(enterpriseId)){
return RestResponse.failure("-1", "存储余额不足,暂不支持图片/视频上传,请充值");
}
EnterpriseDTO enterpriseDTO = enterpriseService.getEnterpriseById(enterpriseId);
CloudFileInfo cloudFileInfo = CloudFileUtil.getPreUploadFileInfo(fileType, CloudFileTypeEnum.VIDEO, enterpriseDTO.getFactoryCode(), CloudFileBusinessOptEnum.MATERIAL_CONTENT);
if (cloudFileInfo == null){
return RestResponse.failure("-1", "获取桶名称失败");
}
return RestResponse.successResult(cloudFileInfo);
}
/**
* 图片上传
*
* @param request
* @param videoPicFileId 上传视频首针图片时使用
* @param fileFlag = 1-普通图片 2-视频截取首针图片(需要与视频建立关联关系)
* @param bucketName 存储桶名称
* @return
*/
@RequestMapping("upload-image")
@ResponseBody
public RestResponse<CloudFileInfo> uploadCloudImage(HttpServletRequest request,
String enterpriseId,
Integer fileFlag,
String videoPicFileId,
String bucketName) {
//存储空间余额校验
if (!accountService.storageFeeCheck(enterpriseId)){
return RestResponse.failure("-1", "存储余额不足,暂不支持图片/视频上传,请充值");
}
if (fileFlag == null){
fileFlag = 1;
}
if (fileFlag == 2 && StringUtils.isBlank(videoPicFileId) || fileFlag ==2 && StringUtils.isBlank(bucketName)){
return RestResponse.failure("-1", "必传参数不能为空");
}
EnterpriseDTO enterpriseDTO = enterpriseService.getEnterpriseById(enterpriseId);
try {
MultipartHttpServletRequest multiRequest = (MultipartHttpServletRequest) request;
String fileName = multiRequest.getFileNames().next();
CommonsMultipartFile multiFile = (CommonsMultipartFile) multiRequest.getMultiFileMap().get(fileName).get(0);
long fileSize = multiFile.getSize();
Boolean compressFlag = false;
//大于10M压缩
if (fileSize / 1024 / 1024 > 10) {
compressFlag = true;
}
String originalFilename = multiFile.getOriginalFilename();
String fileType = originalFilename.substring(originalFilename.lastIndexOf(".")+1).toLowerCase();
logger.info("文件名称 originalFilename = {}", originalFilename);
logger.info("文件类型 fileType = {}", fileType);
if (!"JPG".equals(fileType) && !"jpg".equals(fileType) && !"PNG".equals(fileType) && !"png".equals(fileType) && !"JPEG".equals(fileType) && !"jpeg".equals(fileType)
&& !"blob".equals(fileType)) {//blob为了解决 前端截取的视频首针是blob,兼容
return RestResponse.failure("-1", "图片格式错误");
}
String prefix = ".jpg";
if (!"blob".equals(fileType)){
prefix = originalFilename.substring(originalFilename.lastIndexOf("."));
}else {
fileType = "png";
}
File file = File.createTempFile(fileName, prefix);
multiFile.transferTo(file);
if (fileFlag == 1) {
CloudFileInfo cloudFileInfo = CloudFileUtil.uploadFileNoRelation(file, fileType, CloudFileTypeEnum.IMAGE, enterpriseDTO.getFactoryCode(), CloudFileBusinessOptEnum.MATERIAL_CONTENT,compressFlag);
return RestResponse.successResult(cloudFileInfo);
}else if (fileFlag == 2){
// 若是前端截取的视频首针图片,则调用新接口
CloudFileUtil.uploadPreFileByFieldKey(file, bucketName, videoPicFileId);
}
return RestResponse.successResult();
} catch (Exception e) {
logger.warn("图片上传异常", e);
return RestResponse.failure("-1", "图片上传异常");
}
}
}
......@@ -6,21 +6,22 @@ import com.gic.api.base.commons.Page;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.commons.webapi.reponse.RestResponse;
import com.gic.content.api.dto.column.ContentColumnListDTO;
import com.gic.content.api.dto.material.ContentMaterialFrontDTO;
import com.gic.content.api.dto.material.ContentMaterialDTO;
import com.gic.content.api.dto.material.ContentMaterialShareInfoDTO;
import com.gic.content.api.enums.ColumnEnum;
import com.gic.content.api.enums.MaterialSearchSceneEnum;
import com.gic.content.api.qdto.column.ContentColumnClerkQDTO;
import com.gic.content.api.qdto.material.ContentMaterialPageFrontQDTO;
import com.gic.content.api.qdto.material.ContentMaterialPageQDTO;
import com.gic.content.api.qdto.material.ContentMaterialShareQDTO;
import com.gic.content.api.service.ContentColumnApiService;
import com.gic.content.api.service.ContentMaterialApiService;
import com.gic.content.api.service.ContentMaterialShareApiService;
import com.gic.haoban.common.utils.EntityUtil;
import com.gic.haoban.manage.api.service.StaffApiService;
import com.gic.haoban.manage.web.controller.commission.CommissionManager;
import com.gic.haoban.manage.web.controller.content.adaptor.ClerkStoreAdaptor;
import com.gic.haoban.manage.web.controller.goods.GoodsInfoAdaptor;
import com.gic.haoban.manage.web.qo.content.ContentColumnClerkViewQO;
import com.gic.haoban.manage.web.qo.content.ContentMaterialListQO;
import com.gic.haoban.manage.web.qo.content.ContentMaterialQO;
import com.gic.haoban.manage.web.qo.content.ContentMaterialShareQO;
import com.gic.haoban.manage.web.vo.content.ContentColumnInfoVO;
......@@ -35,14 +36,11 @@ import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.*;
import java.util.stream.Collectors;
/**
......@@ -105,44 +103,45 @@ public class ContentMaterialController {
return RestResponse.failure("-777", "参数异常");
}
List<Integer> goodsShowStatus = goodsInfoAdaptor.getGoodsShowStatus(contentMaterialQO.getEnterpriseId());
ContentMaterialPageFrontQDTO contentMaterialPageFrontQDTO = new ContentMaterialPageFrontQDTO();
contentMaterialPageFrontQDTO.setEnterpriseId(contentMaterialQO.getEnterpriseId());
contentMaterialPageFrontQDTO.setKeyWord(contentMaterialQO.getSearch());
contentMaterialPageFrontQDTO.setContentColumnId(contentMaterialQO.getContentColumnId());
contentMaterialPageFrontQDTO.setMaterialType(contentMaterialQO.getMaterialType());
ContentMaterialPageQDTO pageQDTO = new ContentMaterialPageQDTO();
pageQDTO.setQueryScene(MaterialSearchSceneEnum.HAOBAN_MARKETING.value);
pageQDTO.setEnterpriseId(contentMaterialQO.getEnterpriseId());
pageQDTO.setSearch(contentMaterialQO.getSearch());
pageQDTO.setContentColumnId(contentMaterialQO.getContentColumnId());
pageQDTO.setMaterialType(contentMaterialQO.getMaterialType());
if (contentMaterialQO.getSortType() != null) {
if (contentMaterialQO.getSortType() == 2) {
contentMaterialPageFrontQDTO.setHotFlag(1);
pageQDTO.setHotFlag(1);
}
}
if (StringUtils.isBlank(contentMaterialQO.getStoreId())) {
// 区经 获取管辖的权限
List<String> storeIds = this.clerkStoreAdaptor.queryClerkStoreIds(contentMaterialQO.getClerkId(), contentMaterialQO.getWxEnterpriseId());
contentMaterialPageFrontQDTO.setStoreIdList(storeIds);
pageQDTO.setStoreIdList(storeIds);
} else {
contentMaterialPageFrontQDTO.setStoreIdList(Collections.singletonList(contentMaterialQO.getStoreId()));
pageQDTO.setStoreIdList(Collections.singletonList(contentMaterialQO.getStoreId()));
}
if (contentMaterialQO.getSearchType() != null && contentMaterialQO.getSearchType().equals(1)) {
if (StringUtils.isNotBlank(contentMaterialQO.getSearch())) {
// 搜索条件需要置为空
contentMaterialPageFrontQDTO.setKeyWord(null);
pageQDTO.setSearch(null);
List<String> goodsIds = goodsInfoAdaptor.queryGoodsIdWithSearch(contentMaterialQO.getEnterpriseId(), contentMaterialQO.getSearch());
if (CollectionUtils.isEmpty(goodsIds)) {
log.info("搜索商品不存在 {}", contentMaterialQO.getSearch());
return RestResponse.successResult(new Page<>());
}
contentMaterialPageFrontQDTO.setGoodsIdList(goodsIds);
pageQDTO.setGoodsIdList(goodsIds);
}
}
BasePageInfo pageInfo = new BasePageInfo();
pageInfo.setPageNum(contentMaterialQO.getPageNum());
pageInfo.setPageSize(contentMaterialQO.getPageSize());
ServiceResponse<Page<ContentMaterialFrontDTO>> serviceResponse = contentMaterialApiService.pageMaterialFront(contentMaterialPageFrontQDTO, pageInfo);
ServiceResponse<Page<ContentMaterialDTO>> serviceResponse = contentMaterialApiService.pageMaterial(pageQDTO, pageInfo);
if (!serviceResponse.isSuccess() || CollectionUtils.isEmpty(serviceResponse.getResult().getResult())) {
return RestResponse.successResult(new Page<>());
}
Page<ContentMaterialFrontDTO> responseResult = serviceResponse.getResult();
Page<ContentMaterialDTO> responseResult = serviceResponse.getResult();
Page<ContentMaterialInfoVO> result = new Page<>();
result.setTotalCount(responseResult.getTotalCount());
List<String> goodsIds = responseResult.getResult()
......@@ -168,7 +167,7 @@ public class ContentMaterialController {
* @param item
* @return
*/
private ContentMaterialInfoVO getContentMaterialInfoVO(List<Integer> goodsShowStatus, ContentMaterialFrontDTO item, Map<String, BigDecimal> commissionMap) {
private ContentMaterialInfoVO getContentMaterialInfoVO(List<Integer> goodsShowStatus, ContentMaterialDTO item, Map<String, BigDecimal> commissionMap) {
ContentMaterialInfoVO contentMaterialInfoVO = new ContentMaterialInfoVO();
BeanUtils.copyProperties(item, contentMaterialInfoVO);
if (CollectionUtils.isNotEmpty(item.getContentGoodsList())) {
......@@ -247,4 +246,19 @@ public class ContentMaterialController {
return RestResponse.successResult();
}
/**
* 素材数量查询
* @param search search
* @return
*/
@ResponseBody
@RequestMapping("/count-material")
public RestResponse<Long> countMaterial(@RequestBody ContentMaterialListQO search) {
ContentMaterialPageQDTO pageQDTO = EntityUtil.changeEntityByOrika(ContentMaterialPageQDTO.class, search);
ServiceResponse<Long> response = contentMaterialApiService.countMaterialBySearch(pageQDTO);
if (!response.isSuccess()) {
return RestResponse.failure(response.getCode(), response.getMessage());
}
return RestResponse.successResult(response.getResult());
}
}
......@@ -9,6 +9,7 @@ import com.gic.content.api.dto.material.ContentMaterialBaseDTO;
import com.gic.haoban.manage.api.dto.qdto.content.InteractRecordQDTO;
import com.gic.haoban.manage.api.enums.content.InteractRecordExtendInfoDTO;
import com.gic.haoban.manage.api.enums.content.InteractRecordInfoDTO;
import com.gic.haoban.manage.api.enums.content.ShareBizType;
import com.gic.haoban.manage.api.service.content.InteractRecordApiService;
import com.gic.haoban.manage.web.controller.content.adaptor.ContentMaterialAdaptor;
import com.gic.haoban.manage.web.qo.content.InteractRecordQO;
......@@ -59,6 +60,7 @@ public class InteractRecordController {
List<Long> materialIds = serviceResponse.getResult()
.getResult()
.stream()
.filter(item -> ShareBizType.MATERIAL.getCode().equals(item.getBizType()))
.map(item -> Long.parseLong(item.getBizId()))
.distinct()
.collect(Collectors.toList());
......@@ -74,17 +76,19 @@ public class InteractRecordController {
InteractRecordExtendInfoVO extendInfoVO = EntityUtil.changeEntityByJSON(InteractRecordExtendInfoVO.class, item.getExtendInfo());
interactRecordVO.setExtendInfo(extendInfoVO);
}
ContentMaterialBaseDTO materialBaseInfo = materialBaseMap.get(Long.parseLong(item.getBizId()));
if (materialBaseInfo != null) {
ContentMaterialInfoVO temp = new ContentMaterialInfoVO();
BeanUtils.copyProperties(materialBaseInfo, temp);
if (StringUtils.isNotBlank(materialBaseInfo.getMaterialThumbnailImageUrls())) {
temp.setMaterialThumbnailImageUrls(StrSpliter.split(materialBaseInfo.getMaterialThumbnailImageUrls(), ",", true, true));
if (ShareBizType.MATERIAL.getCode().equals(item.getBizType())) {
ContentMaterialBaseDTO materialBaseInfo = materialBaseMap.get(Long.parseLong(item.getBizId()));
if (materialBaseInfo != null) {
ContentMaterialInfoVO temp = new ContentMaterialInfoVO();
BeanUtils.copyProperties(materialBaseInfo, temp);
if (StringUtils.isNotBlank(materialBaseInfo.getMaterialThumbnailImageUrls())) {
temp.setMaterialThumbnailImageUrls(StrSpliter.split(materialBaseInfo.getMaterialThumbnailImageUrls(), ",", true, true));
}
if (StringUtils.isNotBlank(materialBaseInfo.getMaterialImageUrls())) {
temp.setMaterialImageUrls(StrSpliter.split(materialBaseInfo.getMaterialImageUrls(), ",", true, true));
}
interactRecordVO.setContentMaterialInfoVO(temp);
}
if (StringUtils.isNotBlank(materialBaseInfo.getMaterialImageUrls())) {
temp.setMaterialImageUrls(StrSpliter.split(materialBaseInfo.getMaterialImageUrls(), ",", true, true));
}
interactRecordVO.setContentMaterialInfoVO(temp);
}
return interactRecordVO;
})
......
......@@ -8,8 +8,11 @@ import com.gic.api.base.commons.ServiceResponse;
import com.gic.clerk.api.dto.ClerkDTO;
import com.gic.clerk.api.service.ClerkService;
import com.gic.commons.webapi.reponse.RestResponse;
import com.gic.content.api.dto.material.ContentMaterialDTO;
import com.gic.content.api.dto.material.ContentMaterialFrontDTO;
import com.gic.content.api.enums.MaterialSearchSceneEnum;
import com.gic.content.api.qdto.material.ContentMaterialPageFrontQDTO;
import com.gic.content.api.qdto.material.ContentMaterialPageQDTO;
import com.gic.content.api.service.ContentMaterialApiService;
import com.gic.enterprise.api.dto.StoreDTO;
import com.gic.enterprise.api.service.StoreService;
......@@ -71,7 +74,8 @@ public class MaterialDataStaticsController {
@RequestMapping(path = "/content/material/index/data")
public RestResponse<MaterialIndexDataVO> queryMaterialIndexData(@RequestBody ContentMaterialBaseQO contentMaterialBaseQO) {
ContentMaterialPageFrontQDTO search = new ContentMaterialPageFrontQDTO();
ContentMaterialPageQDTO search = new ContentMaterialPageQDTO();
search.setQueryScene(MaterialSearchSceneEnum.HAOBAN_MARKETING.value);
search.setEnterpriseId(contentMaterialBaseQO.getEnterpriseId());
search.setPublishBeginStartTime(DateUtil.beginOfDay(new Date()));
search.setPublishBeginEndTime(DateUtil.endOfDay(new Date()));
......@@ -88,7 +92,7 @@ public class MaterialDataStaticsController {
pageInfo.setPageNum(1);
pageInfo.setPageSize(1);
int totalMaterialNum = 0;
ServiceResponse<Page<ContentMaterialFrontDTO>> serviceResponse = this.contentMaterialApiService.pageMaterialFront(search, pageInfo);
ServiceResponse<Page<ContentMaterialDTO>> serviceResponse = this.contentMaterialApiService.pageMaterial(search, pageInfo);
if (serviceResponse.isSuccess() && serviceResponse.getResult() != null) {
totalMaterialNum = serviceResponse.getResult().getTotalCount();
}
......
......@@ -12,10 +12,14 @@ import com.gic.haoban.manage.api.enums.content.ShareBizType;
import com.gic.haoban.manage.api.service.content.PotentialCustomerApiService;
import com.gic.haoban.manage.web.controller.content.adaptor.ContentMaterialAdaptor;
import com.gic.haoban.manage.web.controller.content.adaptor.MaterialDataAdaptor;
import com.gic.haoban.manage.web.controller.goods.GoodsInfoAdaptor;
import com.gic.haoban.manage.web.qo.content.potential.PotentialCustomerMarkRecordVO;
import com.gic.haoban.manage.web.qo.content.potential.PotentialCustomerQO;
import com.gic.haoban.manage.web.vo.content.ContentMaterialInfoVO;
import com.gic.haoban.manage.web.vo.content.SimpleGoodsInfoVO;
import com.gic.haoban.manage.web.vo.content.potential.PotentialCustomerVO;
import com.gic.store.goods.dto.goods.GoodsInfoSimpleDTO;
import com.gic.store.goods.dto.goods.GoodsSpuInfoDTO;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
......@@ -45,6 +49,8 @@ public class PotentialCustomerController {
ContentMaterialAdaptor contentMaterialAdaptor;
@Autowired
MaterialDataAdaptor materialDataAdaptor;
@Autowired
private GoodsInfoAdaptor goodsInfoAdaptor;
/**
......@@ -69,6 +75,18 @@ public class PotentialCustomerController {
return RestResponse.successResult();
}
List<PotentialCustomerDTO> customerDTOS = serviceResponse.getResult().getResult();
List<PotentialCustomerVO> customerVOS = this.buildContentInfo(potentialCustomerQO, customerDTOS);
this.buildGoodsInfo(searchQDTO.getEnterpriseId(), customerVOS);
Page<PotentialCustomerVO> result = new Page<>();
result.setTotalCount(serviceResponse.getResult().getTotalCount());
result.setResult(customerVOS);
result.setCurrentPage(potentialCustomerQO.getPageNum());
result.setPageSize(potentialCustomerQO.getPageSize());
return RestResponse.successResult(result);
}
private List<PotentialCustomerVO> buildContentInfo(PotentialCustomerQO potentialCustomerQO, List<PotentialCustomerDTO> customerDTOS) {
// 素材信息
List<Long> materialIds = customerDTOS
.stream()
.filter(item -> ShareBizType.MATERIAL.getCode().equals(item.getBizType()))
......@@ -76,6 +94,7 @@ public class PotentialCustomerController {
.collect(Collectors.toList());
Map<Long, ContentMaterialBaseDTO> materialInfoMap = contentMaterialAdaptor.queryMaterialInfoMap(potentialCustomerQO.getEnterpriseId(), materialIds);
// 会员最近30天访问
List<String> memberIds = customerDTOS
.stream()
.filter(item -> ShareBizType.MATERIAL.getCode().equals(item.getBizType()))
......@@ -89,33 +108,63 @@ public class PotentialCustomerController {
PotentialCustomerVO temp = new PotentialCustomerVO();
BeanUtils.copyProperties(item, temp);
temp.setPotentialCustomerId(item.getPotentialCustomerId());
ContentMaterialBaseDTO contentMaterialBaseDTO = materialInfoMap.get(Long.parseLong(item.getBizId()));
if (contentMaterialBaseDTO != null) {
ContentMaterialInfoVO contentMaterialInfoVO = new ContentMaterialInfoVO();
BeanUtils.copyProperties(contentMaterialBaseDTO, contentMaterialInfoVO);
if (StringUtils.isNotBlank(contentMaterialBaseDTO.getMaterialImageUrls())) {
String[] split = StringUtils.split(contentMaterialBaseDTO.getMaterialImageUrls(), ",");
List<String> imageUrls = Arrays.stream(split).collect(Collectors.toList());
contentMaterialInfoVO.setMaterialImageUrls(imageUrls);
if (ShareBizType.MATERIAL.getCode().equals(item.getBizType())) {
ContentMaterialBaseDTO contentMaterialBaseDTO = materialInfoMap.get(Long.parseLong(item.getBizId()));
if (contentMaterialBaseDTO != null) {
ContentMaterialInfoVO contentMaterialInfoVO = new ContentMaterialInfoVO();
BeanUtils.copyProperties(contentMaterialBaseDTO, contentMaterialInfoVO);
if (StringUtils.isNotBlank(contentMaterialBaseDTO.getMaterialImageUrls())) {
String[] split = StringUtils.split(contentMaterialBaseDTO.getMaterialImageUrls(), ",");
List<String> imageUrls = Arrays.stream(split).collect(Collectors.toList());
contentMaterialInfoVO.setMaterialImageUrls(imageUrls);
}
if (StringUtils.isNotBlank(contentMaterialBaseDTO.getMaterialThumbnailImageUrls())) {
String[] split = StringUtils.split(contentMaterialBaseDTO.getMaterialThumbnailImageUrls(), ",");
List<String> imageUrls = Arrays.stream(split).collect(Collectors.toList());
contentMaterialInfoVO.setMaterialThumbnailImageUrls(imageUrls);
}
temp.setContentMaterialInfoVO(contentMaterialInfoVO);
}
if (StringUtils.isNotBlank(contentMaterialBaseDTO.getMaterialThumbnailImageUrls())) {
String[] split = StringUtils.split(contentMaterialBaseDTO.getMaterialThumbnailImageUrls(), ",");
List<String> imageUrls = Arrays.stream(split).collect(Collectors.toList());
contentMaterialInfoVO.setMaterialThumbnailImageUrls(imageUrls);
}
temp.setContentMaterialInfoVO(contentMaterialInfoVO);
Integer visitNum = memberVisitMap.get(item.getMemberId());
temp.setVisitNum(Optional.ofNullable(visitNum).orElse(0));
}
Integer visitNum = memberVisitMap.get(item.getMemberId());
temp.setVisitNum(Optional.ofNullable(visitNum).orElse(0));
return temp;
})
.collect(Collectors.toList());
Page<PotentialCustomerVO> result = new Page<>();
result.setTotalCount(serviceResponse.getResult().getTotalCount());
result.setResult(customerVOS);
result.setCurrentPage(potentialCustomerQO.getPageNum());
result.setPageSize(potentialCustomerQO.getPageSize());
return RestResponse.successResult(result);
return customerVOS;
}
private void buildGoodsInfo(String enterpriseId, List<PotentialCustomerVO> customerVos) {
if (CollectionUtils.isEmpty(customerVos)) {
return;
}
List<String> goodsIds = customerVos
.stream()
.filter(item -> ShareBizType.GOODS.getCode().equals(item.getBizType()))
.map(PotentialCustomerVO::getBizId)
.distinct()
.collect(Collectors.toList());
Map<String, GoodsInfoSimpleDTO> goodsInfoMap = goodsInfoAdaptor.queryGoodsInfo(enterpriseId, goodsIds);
Map<String, GoodsSpuInfoDTO> goodsSpuInfoMap = goodsInfoAdaptor.queryGoodsMinPrice(enterpriseId, goodsIds);
for (PotentialCustomerVO customerVo : customerVos) {
GoodsInfoSimpleDTO goodsInfoSimpleDTO = goodsInfoMap.get(customerVo.getBizId());
if (goodsInfoSimpleDTO == null) {
continue;
}
SimpleGoodsInfoVO simpleGoodsInfoVO = new SimpleGoodsInfoVO();
simpleGoodsInfoVO.setGoodsId(customerVo.getBizId());
simpleGoodsInfoVO.setGoodsCode(goodsInfoSimpleDTO.getGoodsCode());
simpleGoodsInfoVO.setGoodsName(goodsInfoSimpleDTO.getGoodsName());
simpleGoodsInfoVO.setSourceType(goodsInfoSimpleDTO.getSourceType());
simpleGoodsInfoVO.setGoodsImg(goodsInfoSimpleDTO.getGoodsImageUrl());
simpleGoodsInfoVO.setSalePrice(goodsInfoSimpleDTO.getSalePrice());
GoodsSpuInfoDTO goodsSpuInfoDTO = goodsSpuInfoMap.get(customerVo.getBizId());
if (goodsSpuInfoDTO != null && goodsSpuInfoDTO.getMinPrice() != null) {
simpleGoodsInfoVO.setSalePrice(goodsSpuInfoDTO.getMinPrice());
}
customerVo.setSimpleGoodsInfoVO(simpleGoodsInfoVO);
}
}
......
package com.gic.haoban.manage.web.controller.content.adaptor;
import com.gic.haoban.manage.api.dto.StaffClerkRelationDTO;
import com.gic.haoban.manage.api.dto.StaffDTO;
import com.gic.haoban.manage.api.dto.role.StoreRoleDTO;
import com.gic.haoban.manage.api.service.StaffApiService;
import com.gic.haoban.manage.api.service.StaffClerkRelationApiService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
......@@ -23,6 +26,8 @@ public class ClerkStoreAdaptor {
@Autowired
private StaffApiService staffApiService;
@Autowired
private StaffClerkRelationApiService staffClerkRelationApiService;
/**
* 查询区经角色下管辖的门店权限
......@@ -59,4 +64,13 @@ public class ClerkStoreAdaptor {
return storeRole.getStoreCount();
}
public StaffDTO queryStaff(String clerkId) {
StaffClerkRelationDTO clerkRelationDTO = staffClerkRelationApiService.getByClerkId(clerkId);
if (clerkRelationDTO != null) {
StaffDTO staffDTO = staffApiService.selectById(clerkRelationDTO.getStaffId());
return staffDTO;
}
return null;
}
}
......@@ -35,6 +35,9 @@ public class ContentMaterialAdaptor {
* @return
*/
public Map<Long, ContentMaterialBaseDTO> queryMaterialInfoMap(String enterpriseId, List<Long> materialIds) {
if (CollectionUtils.isEmpty(materialIds)) {
return Collections.emptyMap();
}
ServiceResponse<List<ContentMaterialBaseDTO>> serviceResponse = contentMaterialApiService.listMaterialIdByMaterialIdList(enterpriseId, materialIds, null);
if (!serviceResponse.isSuccess()) {
return Collections.emptyMap();
......
......@@ -5,9 +5,9 @@ import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.gic.api.base.commons.BasePageInfo;
import com.gic.api.base.commons.Page;
import com.gic.commons.util.DataApiUtils;
import com.gic.commons.webapi.reponse.RestResponse;
import com.gic.enterprise.api.dto.EnterpriseDTO;
import com.gic.enterprise.api.service.EnterpriseService;
import com.gic.haoban.manage.api.enums.content.MaterialReportType;
......@@ -15,7 +15,7 @@ import com.gic.haoban.manage.web.qo.content.statistics.MaterialAnalyzeDataQO;
import com.gic.haoban.manage.web.qo.content.statistics.MaterialReportQO;
import com.gic.haoban.manage.web.qo.content.statistics.MaterialStoreAnalyzeDataQO;
import com.gic.haoban.manage.web.qo.content.statistics.MaterialStoreReportQO;
import com.gic.haoban.manage.web.utils.target.DataTargetHttpUtils;
import com.gic.haoban.manage.web.vo.content.creative.ContentMaterialConvsVO;
import com.gic.haoban.manage.web.vo.content.statistics.MaterialAreaUsedDataVO;
import com.gic.haoban.manage.web.vo.content.statistics.MaterialClerkUsedDataVO;
import com.gic.haoban.manage.web.vo.content.statistics.MaterialDataOverviewVO;
......@@ -95,6 +95,17 @@ public class MaterialDataAdaptor {
*/
private static final String MEMBER_RECENTLY_30_DAY_VISIT = "data_matl_haoban_user_30day_stats_real";
/**
* 创作中心素材审核转化数据
*/
private static final String MATERIAL_CREATIVE_CONVS_DATA = "data_cms_matl_examine_convs_list";
/**
* 创作中心转化数据汇总
*/
private static final String MATERIAL_CREATIVE_CONVS_TOTAL_DATA = "data_cms_matl_examine_convs_total";
@Autowired
private EnterpriseService enterpriseService;
......@@ -411,20 +422,103 @@ public class MaterialDataAdaptor {
*/
public Map<String, Integer> queryMemberVisitMap(String enterpriseId, String storeId, String clerkId, List<String> memberIds) {
try {
Map<String, Object> inlineParams = new HashMap<>();
if (StringUtils.isNotBlank(clerkId)) {
inlineParams.put("clerkId", clerkId);
}
inlineParams.put("enterpriseId", enterpriseId);
inlineParams.put("customerId", StringUtils.join(memberIds, ","));
Map<String, Object> result = DataApiUtils.http(JSON.toJSONString(inlineParams), MEMBER_RECENTLY_30_DAY_VISIT);
List<MemberVisitMaterialBO> memberVisitMaterialBos = DataApiUtils.parseDataList(result, MemberVisitMaterialBO.class);
if (CollectionUtils.isEmpty(memberVisitMaterialBos)) {
return Collections.emptyMap();
}
return memberVisitMaterialBos
.stream()
.collect(Collectors.toMap(MemberVisitMaterialBO::getCustomerId, item -> Optional.ofNullable(item.getMatlNum30Day())
.map(Integer::new).orElse(0), (v1, v2) -> v1));
}catch (Exception ex){
log.info("查询会员素材异常", ex);
}
return Collections.emptyMap();
}
/**
* 创作中心获取素材转化数
* @param enterpriseId 企业id
* @param materialIdList 素材id
* @param pageInfo 分页
* @return
*/
public Page<ContentMaterialConvsVO> queryCreativeConvs(String enterpriseId, List<Long> materialIdList, BasePageInfo pageInfo) {
Map<String, Object> inlineParams = new HashMap<>();
if (StringUtils.isNotBlank(clerkId)) {
inlineParams.put("clerkId", clerkId);
if (CollectionUtils.isEmpty(materialIdList)) {
return new Page();
}
inlineParams.put("enterpriseId", enterpriseId);
inlineParams.put("contentMaterialId", StringUtils.join(materialIdList, ","));
inlineParams.put("pageNum", pageInfo.getPageNum());
inlineParams.put("pageSize", pageInfo.getPageSize());
Map<String, Object> result = null;
try {
result = DataApiUtils.http(JSON.toJSONString(inlineParams), MATERIAL_CREATIVE_CONVS_DATA);
} catch (Exception e) {
log.error("创作中心获取素材转化数异常",e);
return new Page();
}
Page<ContentMaterialConvsVO> page = DataApiUtils.getPageData(result, ContentMaterialConvsVO.class);
return page;
}
/**
* 创作中心获取素材转化数组装成map
* @param enterpriseId 企业id
* @param materialIdList 素材id
* @param pageInfo 分页
* @return
*/
public Map<Long,ContentMaterialConvsVO> queryCreativeConvsMap(String enterpriseId, List<Long> materialIdList, BasePageInfo pageInfo) {
if (pageInfo == null) {
pageInfo = new BasePageInfo();
pageInfo.setPageNum(1);
pageInfo.setPageSize(1);
}
Page<ContentMaterialConvsVO> page = queryCreativeConvs(enterpriseId, materialIdList, pageInfo);
if (page != null && CollectionUtils.isNotEmpty(page.getResult())) {
List<ContentMaterialConvsVO> result = page.getResult();
Map<Long, ContentMaterialConvsVO> map = result.stream().collect(Collectors.toMap(ContentMaterialConvsVO::getContentMaterialId, t -> t));
return map;
}
return new HashMap<>();
}
/**
* 创作中心获取素材转化数总和(30天)
* @param enterpriseId 企业id
* @param materialIdList 素材id列表
* @return
*/
public ContentMaterialConvsVO queryCreativeConvsOverview(String enterpriseId, List<Long> materialIdList) {
Map<String, Object> inlineParams = new HashMap<>();
if (CollectionUtils.isEmpty(materialIdList)) {
return new ContentMaterialConvsVO();
}
inlineParams.put("enterpriseId", enterpriseId);
inlineParams.put("customerId", StringUtils.join(memberIds, ","));
Map<String, Object> result = DataApiUtils.http(JSON.toJSONString(inlineParams), MEMBER_RECENTLY_30_DAY_VISIT);
List<MemberVisitMaterialBO> memberVisitMaterialBos = DataApiUtils.parseDataList(result, MemberVisitMaterialBO.class);
if (CollectionUtils.isEmpty(memberVisitMaterialBos)) {
return Collections.emptyMap();
inlineParams.put("contentMaterialId", StringUtils.join(materialIdList, ","));
Map<String, Object> result = null;
try {
result = DataApiUtils.http(JSON.toJSONString(inlineParams), MATERIAL_CREATIVE_CONVS_TOTAL_DATA);
} catch (Exception e) {
log.error("创作中心获取素材转化数总和异常",e);
return new ContentMaterialConvsVO();
}
List<ContentMaterialConvsVO> list = DataApiUtils.parseDataList(result, ContentMaterialConvsVO.class);
if (CollectionUtils.isNotEmpty(list)) {
return list.get(0);
}
return memberVisitMaterialBos
.stream()
.collect(Collectors.toMap(MemberVisitMaterialBO::getCustomerId, item -> Optional.ofNullable(item.getMatlNum30Day())
.map(Integer::new).orElse(0), (v1, v2) -> v1));
return new ContentMaterialConvsVO();
}
}
......@@ -5,6 +5,7 @@ import com.gic.api.base.commons.Page;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.haoban.app.aggregation.api.dto.GoodsSettingDTO;
import com.gic.haoban.app.aggregation.api.service.SettingApiService;
import com.gic.store.goods.dto.goods.GoodsInfoSimpleDTO;
import com.gic.store.goods.dto.goods.GoodsSpuInfoDTO;
import com.gic.store.goods.dto.qdto.GoodsListQDTO;
import com.gic.store.goods.service.GoodsCenterApiService;
......@@ -125,4 +126,17 @@ public class GoodsInfoAdaptor {
.stream()
.collect(Collectors.toMap(GoodsSpuInfoDTO::getGoodsId, Function.identity()));
}
public Map<String, GoodsInfoSimpleDTO> queryGoodsInfo(String enterpriseId, List<String> goodsIds) {
if (CollectionUtils.isEmpty(goodsIds)) {
return Collections.emptyMap();
}
ServiceResponse<List<GoodsInfoSimpleDTO>> serviceResponse = goodsInfoOutApiService.queryGoodsSimpleInfo(goodsIds);
if (!serviceResponse.isSuccess() || CollectionUtils.isEmpty(serviceResponse.getResult())) {
return Collections.emptyMap();
}
return serviceResponse.getResult()
.stream()
.collect(Collectors.toMap(GoodsInfoSimpleDTO::getGoodsId, Function.identity()));
}
}
package com.gic.haoban.manage.web.qo.content;
public class ContentAuditMaterialDataQO {
/**
* 企业id
*/
private String enterpriseId;
/**
* 门店id
*/
private String storeId;
/**
* 导购id
*/
private String clerkId;
/**
* 是否仅查创建数
*/
private Integer createFlag;
public String getEnterpriseId() {
return enterpriseId;
}
public void setEnterpriseId(String enterpriseId) {
this.enterpriseId = enterpriseId;
}
public String getStoreId() {
return storeId;
}
public void setStoreId(String storeId) {
this.storeId = storeId;
}
public String getClerkId() {
return clerkId;
}
public void setClerkId(String clerkId) {
this.clerkId = clerkId;
}
public Integer getCreateFlag() {
return createFlag;
}
public void setCreateFlag(Integer createFlag) {
this.createFlag = createFlag;
}
}
package com.gic.haoban.manage.web.qo.content;
import com.gic.commons.web.qo.PageQo;
public class ContentAuditMaterialQO extends PageQo {
/**
* 企业id
*/
private String enterpriseId;
/**
* 门店id
*/
private String storeId;
/**
* 导购id
*/
private String clerkId;
/**
* 是否有转化 1是0否
*/
private Integer convsFlag;
public String getEnterpriseId() {
return enterpriseId;
}
public void setEnterpriseId(String enterpriseId) {
this.enterpriseId = enterpriseId;
}
public String getStoreId() {
return storeId;
}
public void setStoreId(String storeId) {
this.storeId = storeId;
}
public String getClerkId() {
return clerkId;
}
public void setClerkId(String clerkId) {
this.clerkId = clerkId;
}
public Integer getConvsFlag() {
return convsFlag;
}
public void setConvsFlag(Integer convsFlag) {
this.convsFlag = convsFlag;
}
}
package com.gic.haoban.manage.web.qo.content;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.gic.commons.web.qo.PageQo;
import com.gic.content.api.enums.MaterialSearchSceneEnum;
import java.util.List;
@JsonSerialize(using= ToStringSerializer.class)
public class ContentMaterialListQO extends PageQo {
/**
* 查询场景 1:gic后台营销素材 2:好办营销素材 3:gic后台社区素材 4:gic后台审核素材 5:好办审核素材 6:小程序社区素材
* @see MaterialSearchSceneEnum
*/
private Integer queryScene;
/**
* 栏目id
*/
private Long contentColumnId;
/**
* 搜索名称
*/
private String search;
/**
* 商品搜索
*/
private String goodsSearch;
/**
* 素材搜索
*/
private String materialSearch;
/**
* 素材类型1图文2纯文字3纯图片4视频
*/
private Integer materialType;
/**
* 企业ID
*/
private String enterpriseId;
/**
* 会员id
*/
private String memberId;
/**
* 排序字段
* createTime:创建时间
* publishBeginTime:发布时间
* topTime:置顶时间
* @see com.gic.content.api.enums.MaterialOrderFieldEnum
*/
private String orderField;
/**
* 排序 desc降序 asc升序
*/
private String order;
/**
* 商品id
*/
private List<String> goodsIdList;
public Integer getQueryScene() {
return queryScene;
}
public void setQueryScene(Integer queryScene) {
this.queryScene = queryScene;
}
public Long getContentColumnId() {
return contentColumnId;
}
public void setContentColumnId(Long contentColumnId) {
this.contentColumnId = contentColumnId;
}
public String getSearch() {
return search;
}
public void setSearch(String search) {
this.search = search;
}
public String getGoodsSearch() {
return goodsSearch;
}
public void setGoodsSearch(String goodsSearch) {
this.goodsSearch = goodsSearch;
}
public String getMaterialSearch() {
return materialSearch;
}
public void setMaterialSearch(String materialSearch) {
this.materialSearch = materialSearch;
}
public Integer getMaterialType() {
return materialType;
}
public void setMaterialType(Integer materialType) {
this.materialType = materialType;
}
public String getEnterpriseId() {
return enterpriseId;
}
public void setEnterpriseId(String enterpriseId) {
this.enterpriseId = enterpriseId;
}
public String getMemberId() {
return memberId;
}
public void setMemberId(String memberId) {
this.memberId = memberId;
}
public String getOrderField() {
return orderField;
}
public void setOrderField(String orderField) {
this.orderField = orderField;
}
public String getOrder() {
return order;
}
public void setOrder(String order) {
this.order = order;
}
public List<String> getGoodsIdList() {
return goodsIdList;
}
public void setGoodsIdList(List<String> goodsIdList) {
this.goodsIdList = goodsIdList;
}
}
package com.gic.haoban.manage.web.qo.content;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.Date;
import java.util.List;
@JsonSerialize(using= ToStringSerializer.class)
public class ContentMaterialSaveQO {
/**
* 素材id
*/
private Long contentMaterialId;
/**
* 门店id
*/
private String storeId;
/**
* 导购id
*/
private String clerkId;
/**
* 素材名称
*/
private String materialTitle;
/**
* 素材类型1图文4视频
*/
@NotNull(message = "素材类型不能为空")
private Integer materialType;
/**
* 上架状态0未上架1已上架(默认1)
*/
private Integer shelfStatus = 1;
/**
* 素材内容
*/
private String materialContent;
/**
* 素材图片url列表
*/
private String materialImageUrls;
/**
* 素材压缩后的图片url列表
*/
private String materialThumbnailImageUrls;
/**
* 素材图片信息列表{width:px,height:px,size:Bytes}
*/
private String materialImageInfos;
/**
* 素材视频url
*/
private String materialVideoUrl;
/**
* 视频信息{width:px,height:px,size:Bytes}
*/
private String materialVideoInfo;
/**
* 素材视频封面url
*/
private String materialVideoImageUrl;
/**
* 视频封面信息{width:px,height:px,size:Bytes}
*/
private String materialVideoImageInfo;
/**
* 素材视频第一帧url
*/
private String materialVideoFirstImageUrl;
/**
* 视频第一帧信息{width:px,height:px,size:Bytes}
*/
private String materialVideoFirstImageInfo;
/**
* 视频时长
*/
private Integer duration;
/**
* 企业ID
*/
private String enterpriseId;
/**
* 企微id
*/
private String wxEnterpriseId;
/**
* 关联商品id列表
*/
private List<String> contentGoodsIdList;
public Long getContentMaterialId() {
return contentMaterialId;
}
public void setContentMaterialId(Long contentMaterialId) {
this.contentMaterialId = contentMaterialId;
}
public String getStoreId() {
return storeId;
}
public void setStoreId(String storeId) {
this.storeId = storeId;
}
public String getClerkId() {
return clerkId;
}
public void setClerkId(String clerkId) {
this.clerkId = clerkId;
}
public String getMaterialTitle() {
return materialTitle;
}
public void setMaterialTitle(String materialTitle) {
this.materialTitle = materialTitle;
}
public Integer getMaterialType() {
return materialType;
}
public void setMaterialType(Integer materialType) {
this.materialType = materialType;
}
public Integer getShelfStatus() {
return shelfStatus;
}
public void setShelfStatus(Integer shelfStatus) {
this.shelfStatus = shelfStatus;
}
public String getMaterialContent() {
return materialContent;
}
public void setMaterialContent(String materialContent) {
this.materialContent = materialContent;
}
public String getMaterialImageUrls() {
return materialImageUrls;
}
public void setMaterialImageUrls(String materialImageUrls) {
this.materialImageUrls = materialImageUrls;
}
public String getMaterialThumbnailImageUrls() {
return materialThumbnailImageUrls;
}
public void setMaterialThumbnailImageUrls(String materialThumbnailImageUrls) {
this.materialThumbnailImageUrls = materialThumbnailImageUrls;
}
public String getMaterialImageInfos() {
return materialImageInfos;
}
public void setMaterialImageInfos(String materialImageInfos) {
this.materialImageInfos = materialImageInfos;
}
public String getMaterialVideoUrl() {
return materialVideoUrl;
}
public void setMaterialVideoUrl(String materialVideoUrl) {
this.materialVideoUrl = materialVideoUrl;
}
public String getMaterialVideoInfo() {
return materialVideoInfo;
}
public void setMaterialVideoInfo(String materialVideoInfo) {
this.materialVideoInfo = materialVideoInfo;
}
public String getMaterialVideoImageUrl() {
return materialVideoImageUrl;
}
public void setMaterialVideoImageUrl(String materialVideoImageUrl) {
this.materialVideoImageUrl = materialVideoImageUrl;
}
public String getMaterialVideoImageInfo() {
return materialVideoImageInfo;
}
public void setMaterialVideoImageInfo(String materialVideoImageInfo) {
this.materialVideoImageInfo = materialVideoImageInfo;
}
public String getMaterialVideoFirstImageUrl() {
return materialVideoFirstImageUrl;
}
public void setMaterialVideoFirstImageUrl(String materialVideoFirstImageUrl) {
this.materialVideoFirstImageUrl = materialVideoFirstImageUrl;
}
public String getMaterialVideoFirstImageInfo() {
return materialVideoFirstImageInfo;
}
public void setMaterialVideoFirstImageInfo(String materialVideoFirstImageInfo) {
this.materialVideoFirstImageInfo = materialVideoFirstImageInfo;
}
public Integer getDuration() {
return duration;
}
public void setDuration(Integer duration) {
this.duration = duration;
}
public String getEnterpriseId() {
return enterpriseId;
}
public void setEnterpriseId(String enterpriseId) {
this.enterpriseId = enterpriseId;
}
public String getWxEnterpriseId() {
return wxEnterpriseId;
}
public void setWxEnterpriseId(String wxEnterpriseId) {
this.wxEnterpriseId = wxEnterpriseId;
}
public List<String> getContentGoodsIdList() {
return contentGoodsIdList;
}
public void setContentGoodsIdList(List<String> contentGoodsIdList) {
this.contentGoodsIdList = contentGoodsIdList;
}
}
......@@ -12,6 +12,11 @@ public class RightVO implements Serializable{
// 0未购买 1正常 2已过期
private int status ;
/**
* 版本 1基础版2高级版
*/
private Integer moduleVersion;
public int getStatus() {
return status;
}
......@@ -19,4 +24,12 @@ public class RightVO implements Serializable{
public void setStatus(int status) {
this.status = status;
}
public Integer getModuleVersion() {
return moduleVersion;
}
public void setModuleVersion(Integer moduleVersion) {
this.moduleVersion = moduleVersion;
}
}
......@@ -18,6 +18,8 @@ public class StoreClerkVO implements Serializable {
private String clerkImg;
private String clerkName;
private Integer memberCount;
public String getClerkName() {
return clerkName;
}
......@@ -60,7 +62,12 @@ public class StoreClerkVO implements Serializable {
public void setBindFlag(int bindFlag) {
this.bindFlag = bindFlag;
}
public Integer getMemberCount() {
return memberCount;
}
public void setMemberCount(Integer memberCount) {
this.memberCount = memberCount;
}
}
......@@ -53,21 +53,37 @@ public class ContentMaterialInfoVO implements Serializable {
private List<String> materialThumbnailImageUrls;
/**
* 素材视频链接
* 素材图片信息列表{width:px,height:px,size:Bytes}
*/
private String materialImageInfos;
/**
* 素材视频url
*/
private String materialVideoUrl;
/**
* 素材视频封面链接
* 视频信息{width:px,height:px,size:Bytes}
*/
private String materialVideoInfo;
/**
* 素材视频封面url
*/
private String materialVideoImageUrl;
/**
* 视频封面信息{width:px,height:px,size:Bytes}
*/
private String materialVideoImageInfo;
/**
* 素材视频第一帧url
*/
private String materialVideoFirstImageUrl;
/**
* 视频第一帧信息{width:px,height:px,size:Bytes}
*/
private String materialVideoFirstImageInfo;
/**
* 分享次数
*/
private Long shareCount;
......@@ -241,4 +257,36 @@ public class ContentMaterialInfoVO implements Serializable {
public void setSourceType(Integer sourceType) {
this.sourceType = sourceType;
}
public String getMaterialImageInfos() {
return materialImageInfos;
}
public void setMaterialImageInfos(String materialImageInfos) {
this.materialImageInfos = materialImageInfos;
}
public String getMaterialVideoInfo() {
return materialVideoInfo;
}
public void setMaterialVideoInfo(String materialVideoInfo) {
this.materialVideoInfo = materialVideoInfo;
}
public String getMaterialVideoImageInfo() {
return materialVideoImageInfo;
}
public void setMaterialVideoImageInfo(String materialVideoImageInfo) {
this.materialVideoImageInfo = materialVideoImageInfo;
}
public String getMaterialVideoFirstImageInfo() {
return materialVideoFirstImageInfo;
}
public void setMaterialVideoFirstImageInfo(String materialVideoFirstImageInfo) {
this.materialVideoFirstImageInfo = materialVideoFirstImageInfo;
}
}
......@@ -19,12 +19,12 @@ public class InteractRecordExtendInfoVO implements Serializable {
private static final long serialVersionUID = 799914036029100258L;
/**
* 素材关联的商品信息商品信息
* 商品信息
*/
private List<ExtendGoodsInfo> extendGoodsInfos;
/**
* 素材关联的订单信息
* 订单信息
*/
private List<ExtendOrderInfo> extendOrderInfos;
......
package com.gic.haoban.manage.web.vo.content;
import com.gic.haoban.manage.api.enums.content.MaterialInteractRecordEventType;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
/**
* @Author MUSI
......@@ -49,12 +49,19 @@ public class InteractRecordVO implements Serializable {
/**
* 记录事件类型
* 1浏览素材;2 查看商品; 3 购买商品
* 1浏览素材;2 查看商品; 3 购买商品; 4 加入购物车
* 通过此类型区分 弹窗提示
* @see MaterialInteractRecordEventType
*/
private Integer eventType;
/**
* 业务类型
* @see com.gic.haoban.manage.api.enums.content.ShareBizType
*/
private Integer bizType;
/**
* 浏览的商品数量
*/
private Integer visitGoodsNum;
......
package com.gic.haoban.manage.web.vo.content.creative;
import java.io.Serializable;
import java.util.Date;
public class ContentAuditorVO implements Serializable {
/**
* 审核人id
*/
private String auditorId;
/**
* 审核人名称
*/
private String auditorName;
/**
* 审核时间
*/
private Date auditorTime;
/**
* 审核备注
*/
private String remark;
public String getAuditorId() {
return auditorId;
}
public void setAuditorId(String auditorId) {
this.auditorId = auditorId;
}
public String getAuditorName() {
return auditorName;
}
public void setAuditorName(String auditorName) {
this.auditorName = auditorName;
}
public Date getAuditorTime() {
return auditorTime;
}
public void setAuditorTime(Date auditorTime) {
this.auditorTime = auditorTime;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
}
package com.gic.haoban.manage.web.vo.content.creative;
import java.math.BigDecimal;
/**
* 内容分类表(TabContentCategory)表实体类
*
* @author makejava
* @since 2022-10-27 17:20:20
*/
@SuppressWarnings("serial")
public class ContentGoodsVO {
/**
* 商品id
*/
private String goodsId;
/**
* 商品Code
*/
private String goodsCode;
/**
* 商品名称
*/
private String goodsName;
/**
* 商品主图
*/
private String goodsImageUrl;
/**
* spu库存
*/
private Integer spuStock;
/**
* 商品状态
* @see com.gic.store.goods.enums.GoodsStatusEnum
*/
private Integer status;
/**
* 是否已完善1是0否
*/
private Integer isComplete;
/**
* 吊牌价 / 划线价
*/
private BigDecimal tagPrice;
/**
* 最小sku价格/一口价
*/
private BigDecimal minPrice;
public String getGoodsId() {
return goodsId;
}
public void setGoodsId(String goodsId) {
this.goodsId = goodsId;
}
public String getGoodsCode() {
return goodsCode;
}
public void setGoodsCode(String goodsCode) {
this.goodsCode = goodsCode;
}
public String getGoodsName() {
return goodsName;
}
public void setGoodsName(String goodsName) {
this.goodsName = goodsName;
}
public String getGoodsImageUrl() {
return goodsImageUrl;
}
public void setGoodsImageUrl(String goodsImageUrl) {
this.goodsImageUrl = goodsImageUrl;
}
public Integer getSpuStock() {
return spuStock;
}
public void setSpuStock(Integer spuStock) {
this.spuStock = spuStock;
}
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
public Integer getIsComplete() {
return isComplete;
}
public void setIsComplete(Integer isComplete) {
this.isComplete = isComplete;
}
public BigDecimal getTagPrice() {
return tagPrice;
}
public void setTagPrice(BigDecimal tagPrice) {
this.tagPrice = tagPrice;
}
public BigDecimal getMinPrice() {
return minPrice;
}
public void setMinPrice(BigDecimal minPrice) {
this.minPrice = minPrice;
}
}
package com.gic.haoban.manage.web.vo.content.creative;
import java.io.Serializable;
public class ContentMaterialConvsVO implements Serializable {
/**
* 素材id
*/
private Long contentMaterialId;
/**
* 转化人数
*/
private Integer convsNum = 0;
/**
* 转化金额
*/
private Double convsAmt = 0.0;
public Long getContentMaterialId() {
return contentMaterialId;
}
public void setContentMaterialId(Long contentMaterialId) {
this.contentMaterialId = contentMaterialId;
}
public Integer getConvsNum() {
return convsNum;
}
public void setConvsNum(Integer convsNum) {
this.convsNum = convsNum;
}
public Double getConvsAmt() {
return convsAmt;
}
public void setConvsAmt(Double convsAmt) {
this.convsAmt = convsAmt;
}
public void setConvs(ContentMaterialConvsVO convs) {
if (convs == null) {
this.setConvsNum(0);
this.setConvsAmt(0.0);
return;
}
this.setConvsNum(convs.getConvsNum());
this.setConvsAmt(convs.getConvsAmt());
}
}
package com.gic.haoban.manage.web.vo.content.creative;
import java.io.Serializable;
import java.util.Date;
public class ContentMaterialDataVO extends ContentMaterialConvsVO implements Serializable {
/**
* 创建数
*/
private Long createCount;
/**
* 待审核数
*/
private Long auditCount;
public Long getCreateCount() {
return createCount;
}
public void setCreateCount(Long createCount) {
this.createCount = createCount;
}
public Long getAuditCount() {
return auditCount;
}
public void setAuditCount(Long auditCount) {
this.auditCount = auditCount;
}
}
package com.gic.haoban.manage.web.vo.content.creative;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import java.util.Date;
import java.util.List;
public class ContentMaterialVO extends ContentMaterialConvsVO{
/**
* 素材id
*/
@JsonSerialize(using = ToStringSerializer.class)
private Long contentMaterialId;
/**
* 素材用途0无(未审核)1营销2社区
*/
private Integer materialPurpose;
/**
* 素材名称
*/
private String materialTitle;
/**
* 素材类型1图文4视频
*/
private Integer materialType;
/**
* 1企业/品牌方2导购
*/
private Integer materialSource;
/**
* 上架状态0未上架1已上架
*/
private Integer shelfStatus;
/**
* 素材内容
*/
private String materialContent;
/**
* 素材图片url列表
*/
private String materialImageUrls;
/**
* 素材压缩后的图片url列表
*/
private String materialThumbnailImageUrls;
/**
* 素材图片信息列表{width:px,height:px,size:Bytes}
*/
private String materialImageInfos;
/**
* 素材视频url
*/
private String materialVideoUrl;
/**
* 视频信息{width:px,height:px,size:Bytes}
*/
private String materialVideoInfo;
/**
* 素材视频封面url
*/
private String materialVideoImageUrl;
/**
* 视频封面信息{width:px,height:px,size:Bytes}
*/
private String materialVideoImageInfo;
/**
* 素材视频第一帧url
*/
private String materialVideoFirstImageUrl;
/**
* 视频第一帧信息{width:px,height:px,size:Bytes}
*/
private String materialVideoFirstImageInfo;
/**
* 视频时长
*/
private Integer duration;
/**
* 企业id
*/
private String enterpriseId;
/**
* 创建时间
*/
private Date createTime;
/**
* 更新时间
*/
private Date updateTime;
/**
* 关联商品列表
*/
private List<ContentGoodsVO> contentGoodsList;
/**
* 审核状态0待审核1未通过2已通过
*/
private Integer auditStatus;
/**
* 审核信息
*/
private ContentAuditorVO auditor;
public Long getContentMaterialId() {
return contentMaterialId;
}
public void setContentMaterialId(Long contentMaterialId) {
this.contentMaterialId = contentMaterialId;
}
public Integer getMaterialPurpose() {
return materialPurpose;
}
public void setMaterialPurpose(Integer materialPurpose) {
this.materialPurpose = materialPurpose;
}
public String getMaterialTitle() {
return materialTitle;
}
public void setMaterialTitle(String materialTitle) {
this.materialTitle = materialTitle;
}
public Integer getMaterialType() {
return materialType;
}
public void setMaterialType(Integer materialType) {
this.materialType = materialType;
}
public Integer getMaterialSource() {
return materialSource;
}
public void setMaterialSource(Integer materialSource) {
this.materialSource = materialSource;
}
public Integer getShelfStatus() {
return shelfStatus;
}
public void setShelfStatus(Integer shelfStatus) {
this.shelfStatus = shelfStatus;
}
public String getMaterialContent() {
return materialContent;
}
public void setMaterialContent(String materialContent) {
this.materialContent = materialContent;
}
public String getMaterialImageUrls() {
return materialImageUrls;
}
public void setMaterialImageUrls(String materialImageUrls) {
this.materialImageUrls = materialImageUrls;
}
public String getMaterialThumbnailImageUrls() {
return materialThumbnailImageUrls;
}
public void setMaterialThumbnailImageUrls(String materialThumbnailImageUrls) {
this.materialThumbnailImageUrls = materialThumbnailImageUrls;
}
public String getMaterialImageInfos() {
return materialImageInfos;
}
public void setMaterialImageInfos(String materialImageInfos) {
this.materialImageInfos = materialImageInfos;
}
public String getMaterialVideoUrl() {
return materialVideoUrl;
}
public void setMaterialVideoUrl(String materialVideoUrl) {
this.materialVideoUrl = materialVideoUrl;
}
public String getMaterialVideoInfo() {
return materialVideoInfo;
}
public void setMaterialVideoInfo(String materialVideoInfo) {
this.materialVideoInfo = materialVideoInfo;
}
public String getMaterialVideoImageUrl() {
return materialVideoImageUrl;
}
public void setMaterialVideoImageUrl(String materialVideoImageUrl) {
this.materialVideoImageUrl = materialVideoImageUrl;
}
public String getMaterialVideoImageInfo() {
return materialVideoImageInfo;
}
public void setMaterialVideoImageInfo(String materialVideoImageInfo) {
this.materialVideoImageInfo = materialVideoImageInfo;
}
public String getMaterialVideoFirstImageUrl() {
return materialVideoFirstImageUrl;
}
public void setMaterialVideoFirstImageUrl(String materialVideoFirstImageUrl) {
this.materialVideoFirstImageUrl = materialVideoFirstImageUrl;
}
public String getMaterialVideoFirstImageInfo() {
return materialVideoFirstImageInfo;
}
public void setMaterialVideoFirstImageInfo(String materialVideoFirstImageInfo) {
this.materialVideoFirstImageInfo = materialVideoFirstImageInfo;
}
public Integer getDuration() {
return duration;
}
public void setDuration(Integer duration) {
this.duration = duration;
}
public String getEnterpriseId() {
return enterpriseId;
}
public void setEnterpriseId(String enterpriseId) {
this.enterpriseId = enterpriseId;
}
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 List<ContentGoodsVO> getContentGoodsList() {
return contentGoodsList;
}
public void setContentGoodsList(List<ContentGoodsVO> contentGoodsList) {
this.contentGoodsList = contentGoodsList;
}
public Integer getAuditStatus() {
return auditStatus;
}
public void setAuditStatus(Integer auditStatus) {
this.auditStatus = auditStatus;
}
public ContentAuditorVO getAuditor() {
return auditor;
}
public void setAuditor(ContentAuditorVO auditor) {
this.auditor = auditor;
}
}
......@@ -3,6 +3,7 @@ package com.gic.haoban.manage.web.vo.content.potential;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.gic.haoban.manage.web.vo.content.ContentMaterialInfoVO;
import com.gic.haoban.manage.web.vo.content.SimpleGoodsInfoVO;
import lombok.Data;
import java.io.Serializable;
......@@ -90,11 +91,16 @@ public class PotentialCustomerVO implements Serializable {
private Integer dealRecord;
/**
* 素材信息
* 素材信息 bizType == 1 读取
*/
private ContentMaterialInfoVO contentMaterialInfoVO;
/**
* 商品信息 bizType == 2 时
*/
private SimpleGoodsInfoVO simpleGoodsInfoVO;
/**
* 第几次访问
*/
private Integer times;
......@@ -103,4 +109,15 @@ public class PotentialCustomerVO implements Serializable {
* 停留时长 单位秒
*/
private Integer durationTime;
/**
* 业务类型
* @see com.gic.haoban.manage.api.enums.content.ShareBizType
*/
private Integer bizType;
/**
* 业务id
*/
private String bizId;
}
......@@ -51,6 +51,17 @@ public class ContentMaterialLandingPageVO implements Serializable {
*/
private Integer shoppingCartNum;
/**
* 跳转穿搭社区开关
* 1 开启; 0关闭
*/
private Integer communityJumpFlag;
/**
* 同款搭配数量
*/
private Integer collocationNum;
public ContentMaterialInfoVO getContentMaterialInfo() {
return contentMaterialInfo;
......@@ -99,4 +110,20 @@ public class ContentMaterialLandingPageVO implements Serializable {
public void setShoppingCartNum(Integer shoppingCartNum) {
this.shoppingCartNum = shoppingCartNum;
}
public Integer getCollocationNum() {
return collocationNum;
}
public void setCollocationNum(Integer collocationNum) {
this.collocationNum = collocationNum;
}
public Integer getCommunityJumpFlag() {
return communityJumpFlag;
}
public void setCommunityJumpFlag(Integer communityJumpFlag) {
this.communityJumpFlag = communityJumpFlag;
}
}
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