|
|
@@ -61,28 +61,34 @@ public class AsyncUtils {
|
|
|
@Autowired
|
|
|
private AdminUserCountMapper adminUserCountMapper;
|
|
|
|
|
|
+ /**
|
|
|
+ * 处理离职意见转交客户
|
|
|
+ * 转出去则全部为0,转入则判定当天有没有,有则修改没有新增
|
|
|
+ * @param aid
|
|
|
+ * @param transferId
|
|
|
+ */
|
|
|
public void updateAdminUserCount(String aid, String transferId) {
|
|
|
- List<AdminUserCount> list1 = userMapper.selectListByaidAndDate(aid);
|
|
|
- List<AdminUserCount> list2 = userMapper.selectListByaidAndDate(transferId);
|
|
|
- pushAdminUserCount(list1);
|
|
|
- pushAdminUserCount(list2);
|
|
|
+ adminUserCountMapper.updateUserCountResetting(aid);
|
|
|
+ List<AdminUserCount> list = userMapper.selectListByaidAndDate(transferId);
|
|
|
+ pushAdminUserCount(list);
|
|
|
}
|
|
|
|
|
|
private void pushAdminUserCount(List<AdminUserCount> list) {
|
|
|
for (AdminUserCount e : list) {
|
|
|
String startTime=DateUtils.formatDate(e.getDateTime(),AFTConstants.YYYYMMDD);
|
|
|
AdminUserCount selectAUC = adminUserCountMapper.selectByaidAndDate(e.getAid(), startTime);
|
|
|
- AdminUserCount newAUC=new AdminUserCount();
|
|
|
- newAUC.setId(e.getId());
|
|
|
+
|
|
|
if (selectAUC==null){
|
|
|
adminUserCountMapper.insertSelective(e);
|
|
|
}else {
|
|
|
- if (selectAUC.getPrivateCount()==null)selectAUC.setPrivateCount(0);
|
|
|
- if (selectAUC.getChannelCount()==null)selectAUC.setChannelCount(0);
|
|
|
- if (selectAUC.getSignCount()==null)selectAUC.setSignCount(0);
|
|
|
- newAUC.setPrivateCount(selectAUC.getPrivateCount());
|
|
|
- newAUC.setChannelCount(selectAUC.getChannelCount());
|
|
|
- newAUC.setSignCount(selectAUC.getSignCount());
|
|
|
+ AdminUserCount newAUC=new AdminUserCount();
|
|
|
+ newAUC.setId(selectAUC.getId());
|
|
|
+ if (e.getPrivateCount()==null)selectAUC.setPrivateCount(0);
|
|
|
+ if (e.getChannelCount()==null)selectAUC.setChannelCount(0);
|
|
|
+ if (e.getSignCount()==null)selectAUC.setSignCount(0);
|
|
|
+ newAUC.setPrivateCount(e.getPrivateCount());
|
|
|
+ newAUC.setChannelCount(e.getChannelCount());
|
|
|
+ newAUC.setSignCount(e.getSignCount());
|
|
|
adminUserCountMapper.updateByPrimaryKeySelective(newAUC);
|
|
|
}
|
|
|
}
|