会员回调数据,修改会员总数接口。

master
kevin jiang 6 years ago
parent 836ec6fe90
commit 0a7781860a

@ -38,6 +38,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.concurrent.atomic.AtomicInteger;
@ -161,7 +162,6 @@ public class CustomerService {
* @param turnBackDTOS
* @return
*/
@Transactional(rollbackFor = Exception.class)
public void turnBack(TurnBackDTO turnBackDTOS) throws Exception {
if (turnBackDTOS.getWxData().getUnionId() == null || turnBackDTOS.getUserId() == null) {
return;
@ -189,6 +189,13 @@ public class CustomerService {
}
//做插入使用 --如果没有客户信息就先创建客户信息如果有就判断是否有客户导购得关系,如果没有就添加有就不管
vipDataUpdate(turnBackDTOS, shop, opCustomer, poiStoreStaff, poiStore);
//todo 发送websocket放开
// WebSocketController.sendInfo(new Gson().toJson(insertCustomer));
}
@Transactional(rollbackFor = Exception.class)
public void vipDataUpdate(TurnBackDTO turnBackDTOS, PoiStore shop, OpCustomer opCustomer, PoiStoreStaff poiStoreStaff, PrivilageCpUserStoreDO poiStore) throws Exception {
OpCustomer insertCustomer = new OpCustomer();
insertCustomer.setWechatUniId(turnBackDTOS.getWxData().getUnionId());
insertCustomer.setName(turnBackDTOS.getName());
@ -258,8 +265,6 @@ public class CustomerService {
//有vip数据就不需要重新请求bsd的vip接口
vipCheck(turnBackDTOS);
}
//todo 发送websocket放开
// WebSocketController.sendInfo(new Gson().toJson(insertCustomer));
}
/**

@ -22,4 +22,7 @@ public interface OpVipDOMapper extends BaseMapper<OpVip> {
*
*/
Long selectVipCount(@Param("shopIds") List<Long> shopIds, @Param("startDate") Date startDate, @Param("endDate") Date endDate);
Long selectVipCountNew();
}

@ -113,7 +113,9 @@ public class CustomerViewService {
.filter(contactDO -> contactDO.getNegativeFeedbackCnt() != null)
.map(PoiCustomerContactDataStat::getNegativeFeedbackCnt).mapToLong(a -> a).sum();
//会员总数
Long vipCount = opVipDOMapper.selectVipCount(shopIds, null, null);
//todo 会员数据暂时不能根据店铺查询
// Long vipCount = opVipDOMapper.selectVipCount(shopIds, null, null);
Long vipCount = opVipDOMapper.selectVipCountNew();
List<OpCustomer> newCustimerList = customerList.stream().filter(customerDO -> filterCustomerByRegisterTime(customerDO, selectStartTime, selectEndTime)).collect(Collectors.toList());
//零售公司店均新增

@ -24,20 +24,28 @@
<!--会员总数-->
<select id="selectVipCount" resultType="Long">
select count(t1.id)
from op_vip t1,op_vip_attr t2
where t1.id = t2.vip_id
<if test="shopIds != null and shopIds.size > 0">
and t2.register_store_id in
<foreach collection="shopIds" separator="," item="item" index="index" close=")" open="(">
#{item}
</foreach>
</if>
<if test="startDate != null">
and t1.register_time <![CDATA[ >= ]]> #{startDate}
</if>
<if test="endDate != null">
and t1.register_time <![CDATA[ <= ]]> #{endDate}
</if>
from op_vip t1,op_customer t2
<where>
<if test="shopIds != null and shopIds.size > 0">
and t2.register_store_id in
<foreach collection="shopIds" separator="," item="item" index="index" close=")" open="(">
#{item}
</foreach>
</if>
<if test="startDate != null">
and t1.register_time <![CDATA[ >= ]]> #{startDate}
</if>
<if test="endDate != null">
and t1.register_time <![CDATA[ <= ]]> #{endDate}
</if>
</where>
</select>
<select id="selectVipCountNew" resultType="Long">
select count(t1.id)
from op_vip t1
</select>
</mapper>

Loading…
Cancel
Save