|
@@ -4,13 +4,16 @@ import com.caimei365.tools.mapper.CmOrganValueSystemMapper;
|
|
import com.caimei365.tools.model.po.CmOrganValueSystemPo;
|
|
import com.caimei365.tools.model.po.CmOrganValueSystemPo;
|
|
import com.caimei365.tools.model.po.CmUserPo;
|
|
import com.caimei365.tools.model.po.CmUserPo;
|
|
import com.caimei365.tools.model.po.UserOrganPo;
|
|
import com.caimei365.tools.model.po.UserOrganPo;
|
|
|
|
+import com.caimei365.tools.model.po.cmOrganActiveSystemPo;
|
|
import com.caimei365.tools.service.CmOrganValueSystemService;
|
|
import com.caimei365.tools.service.CmOrganValueSystemService;
|
|
import lombok.extern.java.Log;
|
|
import lombok.extern.java.Log;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
import javax.annotation.Resource;
|
|
|
|
+import java.text.SimpleDateFormat;
|
|
import java.util.ArrayList;
|
|
import java.util.ArrayList;
|
|
|
|
+import java.util.Date;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
import java.util.stream.Collectors;
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
@@ -32,10 +35,6 @@ public class CmOrganValueSystemServiceImpl implements CmOrganValueSystemService
|
|
*/
|
|
*/
|
|
@Override
|
|
@Override
|
|
public void insertOrgan() {
|
|
public void insertOrgan() {
|
|
-
|
|
|
|
-
|
|
|
|
- // 已添加用户活跃的的机构
|
|
|
|
- List<CmOrganValueSystemPo> organList = cmOrganValueSystemMapper.getOrganUserId();
|
|
|
|
// 用户信息
|
|
// 用户信息
|
|
List<CmUserPo> userList = cmOrganValueSystemMapper.getClubUserId();
|
|
List<CmUserPo> userList = cmOrganValueSystemMapper.getClubUserId();
|
|
// 用户的登录时间
|
|
// 用户的登录时间
|
|
@@ -45,10 +44,10 @@ public class CmOrganValueSystemServiceImpl implements CmOrganValueSystemService
|
|
// 机构半年内子订单数
|
|
// 机构半年内子订单数
|
|
List<UserOrganPo> clubShopOrder = cmOrganValueSystemMapper.getClubShopOrder();
|
|
List<UserOrganPo> clubShopOrder = cmOrganValueSystemMapper.getClubShopOrder();
|
|
|
|
|
|
|
|
+ // 修改用户活跃 -- 前一天设置不可用,历史数据
|
|
|
|
+ cmOrganValueSystemMapper.updateOrganActive();
|
|
log.info("用户活跃状态--------------------------------》");
|
|
log.info("用户活跃状态--------------------------------》");
|
|
for (CmUserPo user : userList) {
|
|
for (CmUserPo user : userList) {
|
|
- // 用户上一次数据
|
|
|
|
- List<CmOrganValueSystemPo> organValueList = organList.stream().filter(organ -> organ.getUserId().equals(user.getUserID())).collect(Collectors.toList());
|
|
|
|
// 登录时间
|
|
// 登录时间
|
|
List<UserOrganPo> loginTime = clubLoginTime.stream().filter(login -> login.getUserId().equals(user.getUserID())).collect(Collectors.toList());
|
|
List<UserOrganPo> loginTime = clubLoginTime.stream().filter(login -> login.getUserId().equals(user.getUserID())).collect(Collectors.toList());
|
|
// 咨询记录
|
|
// 咨询记录
|
|
@@ -56,7 +55,7 @@ public class CmOrganValueSystemServiceImpl implements CmOrganValueSystemService
|
|
// 子订单数
|
|
// 子订单数
|
|
List<UserOrganPo> shopOrder = clubShopOrder.stream().filter(shop -> shop.getUserId().equals(user.getUserID())).collect(Collectors.toList());
|
|
List<UserOrganPo> shopOrder = clubShopOrder.stream().filter(shop -> shop.getUserId().equals(user.getUserID())).collect(Collectors.toList());
|
|
|
|
|
|
- CmOrganValueSystemPo systemPo = new CmOrganValueSystemPo();
|
|
|
|
|
|
+ cmOrganActiveSystemPo systemPo = new cmOrganActiveSystemPo();
|
|
systemPo.setStage(0);
|
|
systemPo.setStage(0);
|
|
systemPo.setDelType(1);
|
|
systemPo.setDelType(1);
|
|
if ((null != loginTime && loginTime.size() > 0)|| (null != shopOrder && shopOrder.size() > 0)) {
|
|
if ((null != loginTime && loginTime.size() > 0)|| (null != shopOrder && shopOrder.size() > 0)) {
|
|
@@ -77,15 +76,9 @@ public class CmOrganValueSystemServiceImpl implements CmOrganValueSystemService
|
|
systemPo.setActiveState("不活跃用户");
|
|
systemPo.setActiveState("不活跃用户");
|
|
systemPo.setActiveStatus(1);
|
|
systemPo.setActiveStatus(1);
|
|
}
|
|
}
|
|
- if (null != organValueList && organValueList.size() > 0) {
|
|
|
|
- // 修改
|
|
|
|
- systemPo.setOrganId(organValueList.get(0).getOrganId());
|
|
|
|
- cmOrganValueSystemMapper.updateOrganBatch(systemPo);
|
|
|
|
- } else {
|
|
|
|
- // 添加
|
|
|
|
- systemPo.setUserId(user.getUserID());
|
|
|
|
- cmOrganValueSystemMapper.organBatch(systemPo);
|
|
|
|
- }
|
|
|
|
|
|
+ // 添加
|
|
|
|
+ systemPo.setUserId(user.getUserID());
|
|
|
|
+ cmOrganValueSystemMapper.insertOrganActive(systemPo);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -95,13 +88,12 @@ public class CmOrganValueSystemServiceImpl implements CmOrganValueSystemService
|
|
@Override
|
|
@Override
|
|
public void insertcustomer() {
|
|
public void insertcustomer() {
|
|
log.info("用户价值--------------------------------》");
|
|
log.info("用户价值--------------------------------》");
|
|
- // 已添加用户活跃的的机构
|
|
|
|
- List<CmOrganValueSystemPo> organList = cmOrganValueSystemMapper.getOrganUserId();
|
|
|
|
|
|
+ // 修改上阶段数据
|
|
|
|
+ cmOrganValueSystemMapper.updateOrgan();
|
|
// 用户信息
|
|
// 用户信息
|
|
List<CmUserPo> userList = cmOrganValueSystemMapper.getClubUserId();
|
|
List<CmUserPo> userList = cmOrganValueSystemMapper.getClubUserId();
|
|
for (CmUserPo user : userList) {
|
|
for (CmUserPo user : userList) {
|
|
- // 用户上一次数据
|
|
|
|
- List<CmOrganValueSystemPo> organValueList = organList.stream().filter(organ -> organ.getUserId().equals(user.getUserID())).collect(Collectors.toList());
|
|
|
|
|
|
+
|
|
// 用户应支付金额
|
|
// 用户应支付金额
|
|
UserOrganPo userAmount = cmOrganValueSystemMapper.getUserAmount(user.getUserID());
|
|
UserOrganPo userAmount = cmOrganValueSystemMapper.getUserAmount(user.getUserID());
|
|
// 用户访问数据
|
|
// 用户访问数据
|
|
@@ -131,15 +123,9 @@ public class CmOrganValueSystemServiceImpl implements CmOrganValueSystemService
|
|
systemPo.setCustomerValue("低价值客户");
|
|
systemPo.setCustomerValue("低价值客户");
|
|
systemPo.setCustomerStatus(3);
|
|
systemPo.setCustomerStatus(3);
|
|
}
|
|
}
|
|
- if (null != organValueList && organValueList.size() > 0) {
|
|
|
|
- // 修改
|
|
|
|
- systemPo.setOrganId(organValueList.get(0).getOrganId());
|
|
|
|
- cmOrganValueSystemMapper.updateOrganBatch(systemPo);
|
|
|
|
- } else {
|
|
|
|
- // 添加
|
|
|
|
- systemPo.setUserId(user.getUserID());
|
|
|
|
- cmOrganValueSystemMapper.organBatch(systemPo);
|
|
|
|
- }
|
|
|
|
|
|
+ // 添加
|
|
|
|
+ systemPo.setUserId(user.getUserID());
|
|
|
|
+ cmOrganValueSystemMapper.organBatch(systemPo);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|