|
|
@@ -748,7 +748,7 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
|
|
|
@Transactional
|
|
|
public int addFollow(FollowBusinessBo fbb,String ufid,Integer mainStatus) throws BusinessException {
|
|
|
// 更新跟进记录表
|
|
|
- SimpleDateFormat format = new SimpleDateFormat(AFTConstants.YYYYMMDDHHMMSS);
|
|
|
+ Date followTime=DateUtils.StringToDate(fbb.getFollowTime(),AFTConstants.YYYYMMDDHHMMSS);
|
|
|
UserFollow userFollow = new UserFollow();
|
|
|
String followId = ufid==null?UUID.randomUUID().toString():ufid;
|
|
|
userFollow.setId(followId);
|
|
|
@@ -759,11 +759,7 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
|
|
|
userFollow.setFollowDep(a.getDepartmentName());
|
|
|
userFollow.setContactType(Integer.parseInt(fbb.getContactType()));
|
|
|
userFollow.setEffective(DeleteStatus.UNDELETE.getCode());
|
|
|
- try {
|
|
|
- userFollow.setCreateTime(format.parse(fbb.getFollowTime()));
|
|
|
- } catch (ParseException e) {
|
|
|
- e.printStackTrace();
|
|
|
- }
|
|
|
+ userFollow.setCreateTime(followTime);
|
|
|
userFollow.setOcbId(fbb.getOcbId());
|
|
|
userFollow.setResult(fbb.getResult());
|
|
|
userFollow.setUid(fbb.getUid());
|
|
|
@@ -838,11 +834,7 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
|
|
|
userBusiness.setFollowSituation(ub.getFollowSituation());
|
|
|
userBusiness.setRemarks(ub.getRemarks());
|
|
|
userBusiness.setUid(fbb.getUid());
|
|
|
- try {
|
|
|
- userBusiness.setUpdateTime(format.parse(fbb.getFollowTime()));
|
|
|
- } catch (ParseException e) {
|
|
|
- e.printStackTrace();
|
|
|
- }
|
|
|
+ userBusiness.setUpdateTime(followTime);
|
|
|
userBusiness.setAid(TokenManager.getAdminId());
|
|
|
userBusinessMapper.updateByPrimaryKeySelective(userBusiness);
|
|
|
// 更新业务中间表
|
|
|
@@ -884,12 +876,8 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
|
|
|
// 更新业务表
|
|
|
userBusiness.setId(ubId);
|
|
|
userBusiness.setBusinessProjectId(ub.getBusinessProjectId());
|
|
|
- try {
|
|
|
- userBusiness.setCreateTime(format.parse(fbb.getFollowTime()));
|
|
|
- userBusiness.setUpdateTime(format.parse(fbb.getFollowTime()));
|
|
|
- } catch (ParseException e) {
|
|
|
- e.printStackTrace();
|
|
|
- }
|
|
|
+ userBusiness.setCreateTime(followTime);
|
|
|
+ userBusiness.setUpdateTime(followTime);
|
|
|
userBusiness.setCustomerStatus(ub.getCustomerStatus());
|
|
|
userBusiness.setFollowSituation(ub.getFollowSituation());
|
|
|
userBusiness.setUid(fbb.getUid());
|
|
|
@@ -912,9 +900,47 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
|
|
|
if (mainStatus==1){
|
|
|
followProject(fbb.getUid());
|
|
|
}
|
|
|
+ updateADminUserCountFollow(aid,followTime);
|
|
|
return 1;
|
|
|
}
|
|
|
|
|
|
+ private void updateADminUserCountFollow(String aid, Date transferTime) {
|
|
|
+ {
|
|
|
+ String startTime= DateUtils.formatDate(transferTime,AFTConstants.YYYYMMDD);
|
|
|
+ String endTime=startTime+" 23:59:59";
|
|
|
+ AdminUserCount adminUserCount = adminUserCountMapper.selectByaidAndDate(aid, startTime);
|
|
|
+ int count = userFollowMapper.selectByaidAndDate(aid, startTime, endTime);
|
|
|
+ if (adminUserCount==null){
|
|
|
+ AdminUserCount selectAUC=userMapper.selectByaidAndDate(aid,startTime,endTime);
|
|
|
+ if (selectAUC==null)selectAUC=new AdminUserCount();
|
|
|
+ selectAUC.setFollowCount(count);
|
|
|
+ selectAUC.setAid(aid);
|
|
|
+ selectAUC.setDateTime(transferTime);
|
|
|
+ adminUserCountMapper.insertSelective(selectAUC);
|
|
|
+ }else {
|
|
|
+ AdminUserCount selectAUC=userMapper.selectByaidAndDate(aid,startTime,endTime);
|
|
|
+ AdminUserCount newAUC=new AdminUserCount();
|
|
|
+ newAUC.setId(adminUserCount.getId());
|
|
|
+ newAUC.setFollowCount(count);
|
|
|
+ if (selectAUC==null){
|
|
|
+ newAUC.setPrivateCount(0);
|
|
|
+ newAUC.setChannelCount(0);
|
|
|
+ newAUC.setSignCount(0);
|
|
|
+ }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());
|
|
|
+ }
|
|
|
+
|
|
|
+ adminUserCountMapper.updateByPrimaryKeySelective(newAUC);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 跟进更新用户中间表
|
|
|
*
|