Просмотр исходного кода

营销首页统计暂停规则修改

anderx лет назад: 2
Родитель
Сommit
fdef3556c6

+ 21 - 0
src/main/java/com/goafanti/common/utils/AsyncUtils.java

@@ -660,4 +660,25 @@ public class AsyncUtils {
 		updateFinanceExamine( id);
 		tOrderMidMapper.updateFinanceId(id,financeId);
 	}
+
+	public void updateAdminUserOrderCount(List<AdminUserCount> tramsferList) {
+		for (AdminUserCount e : tramsferList) {
+			String startTime=DateUtils.formatDate(e.getDateTime(),AFTConstants.YYYYMMDD);
+			AdminUserCount selectAUC = adminUserCountMapper.selectByaidAndDate(e.getAid(), startTime);
+			if (selectAUC==null){
+				adminUserCountMapper.insertSelective(e);
+			}else {
+				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);
+				if (e.getOrderCount()==null)selectAUC.setOrderCount(0);
+				newAUC.setPrivateCount(e.getPrivateCount());
+				newAUC.setChannelCount(e.getChannelCount());
+				newAUC.setSignCount(e.getSignCount());
+				adminUserCountMapper.updateByPrimaryKeySelective(newAUC);
+			}
+		}
+	}
 }

+ 4 - 0
src/main/java/com/goafanti/permission/service/impl/NewRoleServiceImpl.java

@@ -19,6 +19,7 @@ import org.springframework.stereotype.Service;
 
 import java.text.SimpleDateFormat;
 import java.util.*;
+
 @Service
 public class NewRoleServiceImpl extends BaseMybatisDao<RoleMapper> implements NewRoleService {
 	@Autowired
@@ -186,6 +187,8 @@ public class NewRoleServiceImpl extends BaseMybatisDao<RoleMapper> implements Ne
 				tOrderLogMapper.insertOrderLog(aid,TokenManager.getAdminId(),date,str.toString());
 				tOrderNewMapper.updateSalesmanId(aid, transferId);
 				tOrderMidMapper.updateSalesmanId(aid, transferId);
+				List<AdminUserCount> tramsferList =adminMapper.selectAdminOrder(transferId);
+				asyncUtils.updateAdminUserOrderCount(tramsferList);
 			}else if (s == roleResources.XMRW.getCode()) {
 				// 获取被转角色判断修改对应任务角色
 				asyncUtils.pushTechTransfer(admin,tadmin,date);
@@ -199,6 +202,7 @@ public class NewRoleServiceImpl extends BaseMybatisDao<RoleMapper> implements Ne
 
 
 
+
 	/**
 	 *
 	 * @param aid 离职id