|
@@ -38,7 +38,7 @@ public class AttentionPoolServiceImpl implements AttentionPoolService {
|
|
|
|
|
|
@Override
|
|
|
public PageInfo<List<AttentionPoolBo>> searchList(WorkTableSearchVo workVo, String userId) {
|
|
|
- PageHelper.startPage(workVo.getPageNum(),workVo.getPageSize(),true);
|
|
|
+ PageHelper.startPage(workVo.getPageNum(), workVo.getPageSize(), true);
|
|
|
List<AttentionPool> pools = attentionPoolDao.searchByMulti(workVo.getText(), userId);
|
|
|
List<AttentionPoolBo> bos = new ArrayList<>();
|
|
|
pools.forEach(pool -> bos.add(new AttentionPoolBo(pool)));
|
|
@@ -48,7 +48,7 @@ public class AttentionPoolServiceImpl implements AttentionPoolService {
|
|
|
@Override
|
|
|
public int cancelAttention(String attentionId, String userId) {
|
|
|
BusinessOpportunitiesClue clue = businessOpportunitiesDao.searchByClueIdOrAttentionIdAndUserId(null, attentionId, userId);
|
|
|
- if (clue != null){ // 协同删除
|
|
|
+ if (clue != null) { // 协同删除
|
|
|
List<FollowUpRecord> followUpRecords = followUpDao.searchAllByClueIdAndUserId(clue.getClueId(), userId);
|
|
|
if (!followUpRecords.isEmpty())
|
|
|
followUpDao.deleteByClueIdAndUserId(clue.getClueId(), userId);
|
|
@@ -66,31 +66,23 @@ public class AttentionPoolServiceImpl implements AttentionPoolService {
|
|
|
if (businessOpportunitiesClue != null)
|
|
|
return 2;
|
|
|
|
|
|
- BusinessOpportunitiesClue clue = new BusinessOpportunitiesClue();
|
|
|
- clue.setClueId(UUID.randomUUID().toString().replace("-",""));
|
|
|
- clue.setAttentionId(turnVo.getAttentionId());
|
|
|
- clue.setContact(turnVo.getContact());
|
|
|
- clue.setTelephone(turnVo.getTelephone());
|
|
|
- clue.setFollowUpCount(0);
|
|
|
- clue.setUserId(userId);
|
|
|
- clue.setCreateTime(DateUtil.date());
|
|
|
- return businessOpportunitiesDao.insert(clue);
|
|
|
+ return businessOpportunitiesDao.insert(new BusinessOpportunitiesClue(turnVo, pool, userId));
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public int attentionBrand(String brandId, String userId) {
|
|
|
- AttentionPool attentionPool = attentionPoolDao.searchByBrandIdOrWdIdAndUserId(brandId,null, userId);
|
|
|
+ AttentionPool attentionPool = attentionPoolDao.searchByBrandIdOrWdIdAndUserId(brandId, null, userId);
|
|
|
if (attentionPool != null) // 判断是否已经关注
|
|
|
return 2;
|
|
|
|
|
|
QueryWrapper<Brand> brandQueryWrapper = new QueryWrapper<>();
|
|
|
- brandQueryWrapper.eq("brand_id",brandId)
|
|
|
- .eq("show_delete",0);
|
|
|
+ brandQueryWrapper.eq("brand_id", brandId)
|
|
|
+ .eq("show_delete", 0);
|
|
|
Brand brand = brandMapper.selectOne(brandQueryWrapper);
|
|
|
if (brand == null) // 判断是否有该品牌
|
|
|
return 3;
|
|
|
AttentionPool pool = new AttentionPool();
|
|
|
- pool.setAttentionId(UUID.randomUUID().toString().replace("-",""));
|
|
|
+ pool.setAttentionId(UUID.randomUUID().toString().replace("-", ""));
|
|
|
pool.setContact(brand.getContact());
|
|
|
if (brand.getContact() == null)
|
|
|
pool.setContact("");
|
|
@@ -113,13 +105,13 @@ public class AttentionPoolServiceImpl implements AttentionPoolService {
|
|
|
if (attentionPool == null)
|
|
|
return 1;
|
|
|
BusinessOpportunitiesClue clue = businessOpportunitiesDao.searchByClueIdOrAttentionIdAndUserId(null, attentionPool.getAttentionId(), userId);
|
|
|
- if (clue != null){ // 协同删除
|
|
|
+ if (clue != null) { // 协同删除
|
|
|
if (followUpDao.deleteByClueIdAndUserId(clue.getClueId(), userId) == 0)
|
|
|
return 0;
|
|
|
- if (businessOpportunitiesDao.deleteByAttentionIdAndUserId(attentionPool.getAttentionId(),userId) == 0)
|
|
|
+ if (businessOpportunitiesDao.deleteByAttentionIdAndUserId(attentionPool.getAttentionId(), userId) == 0)
|
|
|
return 0;
|
|
|
}
|
|
|
- return attentionPoolDao.deleteByBrandIdOrWdIdAndUserId(brnadId,null,userId);
|
|
|
+ return attentionPoolDao.deleteByBrandIdOrWdIdAndUserId(brnadId, null, userId);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
@@ -131,35 +123,35 @@ public class AttentionPoolServiceImpl implements AttentionPoolService {
|
|
|
if (wdInfo == null) // 判断是否有该网点
|
|
|
return 3;
|
|
|
AttentionPool pool = new AttentionPool();
|
|
|
- pool.setAttentionId(UUID.randomUUID().toString().replace("-",""));
|
|
|
+ pool.setAttentionId(UUID.randomUUID().toString().replace("-", ""));
|
|
|
pool.setWdId(wdInfo.getWdId());
|
|
|
pool.setWdName(wdInfo.getWdName());
|
|
|
pool.setWdAddrInfo(wdInfo.getAddrInfo());
|
|
|
// 补齐信息
|
|
|
StoreWd storeWd = storeWdDao.selectById(wdId);
|
|
|
- if (storeWd != null){
|
|
|
+ if (storeWd != null) {
|
|
|
pool.setContact(storeWd.getContact());
|
|
|
if (storeWd.getContact() == null)
|
|
|
pool.setContact("");
|
|
|
pool.setTelephone(storeWd.getTelephone());
|
|
|
if (storeWd.getTelephone() == null)
|
|
|
pool.setTelephone("");
|
|
|
- if (storeWd.getBrandId() != null){
|
|
|
- if (!storeWd.getBrandId().equals("")){
|
|
|
+ if (storeWd.getBrandId() != null) {
|
|
|
+ if (!storeWd.getBrandId().equals("")) {
|
|
|
QueryWrapper<Brand> brandQueryWrapper = new QueryWrapper<>();
|
|
|
- brandQueryWrapper.eq("brand_id",storeWd.getBrandId())
|
|
|
- .eq("show_delete",0);
|
|
|
+ brandQueryWrapper.eq("brand_id", storeWd.getBrandId())
|
|
|
+ .eq("show_delete", 0);
|
|
|
Brand brand = brandMapper.selectOne(brandQueryWrapper);
|
|
|
- if (brand != null){
|
|
|
+ if (brand != null) {
|
|
|
pool.setBrandId(brand.getBrandId());
|
|
|
pool.setBrandName(brand.getBrandName());
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
pool.setBrandId("");
|
|
|
pool.setBrandName("");
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
pool.setContact("");
|
|
|
pool.setTelephone("");
|
|
|
pool.setBrandId("");
|
|
@@ -176,12 +168,12 @@ public class AttentionPoolServiceImpl implements AttentionPoolService {
|
|
|
if (attentionPool == null)
|
|
|
return 1;
|
|
|
BusinessOpportunitiesClue clue = businessOpportunitiesDao.searchByClueIdOrAttentionIdAndUserId(null, attentionPool.getAttentionId(), userId);
|
|
|
- if (clue != null){ // 协同删除
|
|
|
+ if (clue != null) { // 协同删除
|
|
|
if (followUpDao.deleteByClueIdAndUserId(clue.getClueId(), userId) == 0)
|
|
|
return 0;
|
|
|
- if (businessOpportunitiesDao.deleteByAttentionIdAndUserId(attentionPool.getAttentionId(),userId) == 0)
|
|
|
+ if (businessOpportunitiesDao.deleteByAttentionIdAndUserId(attentionPool.getAttentionId(), userId) == 0)
|
|
|
return 0;
|
|
|
}
|
|
|
- return attentionPoolDao.deleteByBrandIdOrWdIdAndUserId(null,wdId,userId);
|
|
|
+ return attentionPoolDao.deleteByBrandIdOrWdIdAndUserId(null, wdId, userId);
|
|
|
}
|
|
|
}
|