|
|
|
@ -8,6 +8,7 @@ import javax.annotation.Resource;
|
|
|
|
|
|
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
|
|
import org.apache.commons.lang3.time.DateFormatUtils;
|
|
|
|
|
import org.joda.time.DateTime;
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
import org.springframework.util.CollectionUtils;
|
|
|
|
@ -90,6 +91,7 @@ public class CustomerImpressionImpl implements CustomerImpression {
|
|
|
|
|
client_customer.put("client_id", order.getIntValue("client_id"));
|
|
|
|
|
client_customer.put("customer_id", order.getString("customer_id"));
|
|
|
|
|
client_customer.put("channel", order.getString("channel"));
|
|
|
|
|
client_customer.put("tag","不活跃用户");
|
|
|
|
|
if (order.getString("alipay_headimg") == null) {
|
|
|
|
|
client_customer.put("headimg", order.getString("wechat_headimg"));
|
|
|
|
|
client_customer.put("nick_name", order.getString("wechat_nickname"));
|
|
|
|
@ -118,10 +120,39 @@ public class CustomerImpressionImpl implements CustomerImpression {
|
|
|
|
|
clientCustomerInfo.put("nick_name", order.getString("alipay_nickname"));
|
|
|
|
|
}
|
|
|
|
|
clientCustomerInfo.put("channel", order.getString("channel"));
|
|
|
|
|
clientCustomerInfo.put("tag","不活跃用户");
|
|
|
|
|
clientCustomerInfo.put("update_time",now);
|
|
|
|
|
clientCustomersMapper.update(clientCustomerInfo);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
generateTag(client_id);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void generateTag(int client_id){
|
|
|
|
|
JSONObject params = new JSONObject();
|
|
|
|
|
DateTime dt = new DateTime();
|
|
|
|
|
dt = dt.minusMonths(5);
|
|
|
|
|
params.put("confirm_time",dt.toDate());
|
|
|
|
|
params.put("client_id",client_id);
|
|
|
|
|
List<JSONObject> orders = orderMapper.listAnalysisClientCustomer(params);
|
|
|
|
|
for (JSONObject order : orders) {
|
|
|
|
|
int payment_times = order.getInteger("payment_times");
|
|
|
|
|
JSONObject updateRecord = new JSONObject();
|
|
|
|
|
updateRecord.put("client_id",order.getIntValue("client_id"));
|
|
|
|
|
updateRecord.put("customer_id",order.getString("customer_id"));
|
|
|
|
|
if(payment_times<2){
|
|
|
|
|
updateRecord.put("tag","不活跃用户");
|
|
|
|
|
}
|
|
|
|
|
if(payment_times>=2 && payment_times<10){
|
|
|
|
|
updateRecord.put("tag","潜力用户");
|
|
|
|
|
}
|
|
|
|
|
if(payment_times>=10){
|
|
|
|
|
updateRecord.put("tag","忠实用户");
|
|
|
|
|
}
|
|
|
|
|
clientCustomersMapper.update(updateRecord);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|