Commit 3bb1ea75 by 王祖波

冗余金字塔分层

parent c999f0e1
......@@ -88,6 +88,10 @@ public class TabContactOrder implements Serializable {
*/
private Integer potentialScore;
/**
* 金字塔分层信息
*/
private String groupInfo;
/**
* 来源类型 1潜客(0001)2机会人群(0010)
*/
private Integer sourceType;
......@@ -265,6 +269,14 @@ public class TabContactOrder implements Serializable {
this.potentialScore = potentialScore;
}
public String getGroupInfo() {
return groupInfo;
}
public void setGroupInfo(String groupInfo) {
this.groupInfo = groupInfo;
}
public Integer getSourceType() {
return sourceType;
}
......
......@@ -23,6 +23,9 @@ import com.gic.haoban.manage.service.service.ESMemberInfoService;
import com.gic.haoban.manage.service.service.contact.ContactLogService;
import com.gic.haoban.manage.service.service.contact.ContactOrderService;
import com.gic.member.api.dto.es.MemberDataDTO;
import com.gic.member.tag.api.dto.MemberTagGroupDetailDTO;
import com.gic.member.tag.api.dto.MemberTagGroupSimpleDTO;
import com.gic.member.tag.api.service.MemberTagGroupApiService;
import com.gic.order.api.dto.resp.OrderInfoResp;
import com.gic.order.api.dto.resp.OrderItemResp;
import com.github.pagehelper.PageHelper;
......@@ -49,6 +52,8 @@ public class ContactOrderServiceImpl implements ContactOrderService {
@Autowired
private ESMemberInfoService esMemberInfoService;
@Autowired
private MemberTagGroupApiService memberTagGroupApiService;
@Autowired
private StoreService storeService;
@Autowired
private ClerkService clerkService;
......@@ -136,11 +141,34 @@ public class ContactOrderServiceImpl implements ContactOrderService {
if (jsonObject != null && jsonObject.getInteger("potentialScore") != null) {
contactOrder.setPotentialScore(jsonObject.getInteger("potentialScore"));
}
String groupInfo = convertGroupInfo(enterpriseId, memberId);
contactOrder.setGroupInfo(groupInfo);
contactOrderMapper.insert(contactOrder);
}
return true;
}
private String convertGroupInfo(String enterpriseId, String memberId) {
JSONObject jo = new JSONObject();
try {
MemberTagGroupDetailDTO memberTagGroupDetail = memberTagGroupApiService.getMemberTagGroupDetail(enterpriseId, memberId, "1");
if (memberTagGroupDetail == null) {
return jo.toJSONString();
}
MemberTagGroupSimpleDTO allChannelMemberGradeGroup = memberTagGroupDetail.getAllChannelMemberGradeGroup();
if (allChannelMemberGradeGroup != null) {
jo.put("allChannelMemberGradeGroup", allChannelMemberGradeGroup.getGroupName());
}
MemberTagGroupSimpleDTO memberGradeGroup = memberTagGroupDetail.getMemberGradeGroup();
if (memberGradeGroup != null) {
jo.put("memberGradeGroup", memberGradeGroup.getGroupName());
}
} catch (Exception e) {
logger.info("获取金字塔分层信息异常",e);
}
return jo.toJSONString();
}
@Override
public Page<ContactOrderDetailDTO> pageContactOrder(String enterpriseId, ContactOrderSearchQDTO searchQDTO, BasePageInfo pageInfo) {
PageHelper.startPage(pageInfo);
......
......@@ -24,6 +24,7 @@
<result column="contact_time" property="contactTime" />
<result column="potential_time" property="potentialTime" />
<result column="potential_score" property="potentialScore" />
<result column="group_info" property="groupInfo" />
<result column="source_type" property="sourceType" />
<result column="biz_type" property="bizType" />
<result column="delete_flag" property="deleteFlag" />
......@@ -33,7 +34,7 @@
</resultMap>
<sql id="Base_Column_List">
id, order_id, member_id, order_number, paid_amount, product_count, goods_info, pay_time, receipts_date, channel_code, channel_type, clerk_id, clerk_code,clerk_name, store_id, contact_log_id, contact_time, potential_time, potential_score,source_type,biz_type, delete_flag, enterprise_id, create_time, update_time
id, order_id, member_id, order_number, paid_amount, product_count, goods_info, pay_time, receipts_date, channel_code, channel_type, clerk_id, clerk_code,clerk_name, store_id, contact_log_id, contact_time, potential_time, potential_score,group_info,source_type,biz_type, delete_flag, enterprise_id, create_time, update_time
</sql>
<select id="queryById" resultMap="BaseResultMap">
......@@ -114,8 +115,8 @@
</select>
<insert id="insert" useGeneratedKeys="true" keyProperty="id">
INSERT INTO tab_contact_order (order_id, member_id, order_number, paid_amount, product_count, goods_info, pay_time, receipts_date, channel_code, channel_type, clerk_id, clerk_code,clerk_name, store_id, contact_log_id, contact_time, potential_time,potential_score, source_type,biz_type,enterprise_id)
VALUES (#{orderId}, #{memberId}, #{orderNumber}, #{paidAmount}, #{productCount}, #{goodsInfo}, #{payTime}, #{receiptsDate}, #{channelCode}, #{channelType}, #{clerkId}, #{clerkCode},#{clerkName}, #{storeId}, #{contactLogId}, #{contactTime}, #{potentialTime}, #{potentialScore}, #{sourceType},#{bizType},#{enterpriseId})
INSERT INTO tab_contact_order (order_id, member_id, order_number, paid_amount, product_count, goods_info, pay_time, receipts_date, channel_code, channel_type, clerk_id, clerk_code,clerk_name, store_id, contact_log_id, contact_time, potential_time,potential_score,group_info, source_type,biz_type,enterprise_id)
VALUES (#{orderId}, #{memberId}, #{orderNumber}, #{paidAmount}, #{productCount}, #{goodsInfo}, #{payTime}, #{receiptsDate}, #{channelCode}, #{channelType}, #{clerkId}, #{clerkCode},#{clerkName}, #{storeId}, #{contactLogId}, #{contactTime}, #{potentialTime}, #{potentialScore},#{groupInfo}, #{sourceType},#{bizType},#{enterpriseId})
</insert>
<update id="update">
......@@ -138,6 +139,7 @@
<if test="contactTime != null">contact_time = #{contactTime},</if>
<if test="potentialTime != null">potential_time = #{potentialTime},</if>
<if test="potentialScore != null">potential_score = #{potentialScore},</if>
<if test="groupInfo != null">group_info = #{groupInfo},</if>
<if test="bizType != null">biz_type = #{bizType},</if>
<if test="source_type != null">source_type = #{sourceType},</if>
<if test="deleteFlag != null">delete_flag = #{deleteFlag},</if>
......
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