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

Merge tag 'jenkins-back-end-3150' into release

develop
release_toaliyun_real
Burce 6 лет назад
Родитель
Сommit
065904a3d6
4 измененных файлов: 40 добавлений и 24 удалений
  1. +0
    -2
      mallinkAdmin/src/main/java/com/iformall/controller/invest/InvestFollowRecordController.java
  2. +3
    -1
      mallinkService/src/main/java/com/iformall/domain/vo/invest/InvestDemandQuery.java
  3. +36
    -20
      mallinkService/src/main/java/com/iformall/service/invest/impl/InvestBizServiceImpl.java
  4. +1
    -1
      mallinkService/src/main/resources/mapper/InvestCustomerMapper.xml

+ 0
- 2
mallinkAdmin/src/main/java/com/iformall/controller/invest/InvestFollowRecordController.java Просмотреть файл

@@ -17,7 +17,6 @@ import org.springframework.web.bind.annotation.*;
import java.util.Arrays; import java.util.Arrays;





/** /**
* 招商模块-跟踪记录 * 招商模块-跟踪记录
* *
@@ -45,7 +44,6 @@ public class InvestFollowRecordController extends InvestBaseController {
return execute(params, p -> bizService.queryPageFollowRecord(p)); return execute(params, p -> bizService.queryPageFollowRecord(p));
} }



/** /**
* 信息 * 信息
*/ */


+ 3
- 1
mallinkService/src/main/java/com/iformall/domain/vo/invest/InvestDemandQuery.java Просмотреть файл

@@ -4,6 +4,8 @@ import com.iformall.enums.EnumCustomerType;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;


import java.util.List;

@Data @Data
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
public class InvestDemandQuery extends InvestPageQuery { public class InvestDemandQuery extends InvestPageQuery {
@@ -18,7 +20,7 @@ public class InvestDemandQuery extends InvestPageQuery {
* 客户分类:0-潜在客户;1-意向客户;2-合作客户;3-谈判失败 * 客户分类:0-潜在客户;1-意向客户;2-合作客户;3-谈判失败
*/ */
@io.swagger.annotations.ApiModelProperty(value = "客户分类:0-潜在客户;1-意向客户;2-合作客户;3-谈判失败", name = "customerType") @io.swagger.annotations.ApiModelProperty(value = "客户分类:0-潜在客户;1-意向客户;2-合作客户;3-谈判失败", name = "customerType")
private EnumCustomerType customerType;
private List<EnumCustomerType> customerType;


/** /**
* 经营业态 * 经营业态


+ 36
- 20
mallinkService/src/main/java/com/iformall/service/invest/impl/InvestBizServiceImpl.java Просмотреть файл

@@ -105,6 +105,9 @@ public class InvestBizServiceImpl implements InvestBizService {
queryWrapperCustomer.in(CollectionUtils.isNotEmpty(demandList), InvestCustomerEntity::getId, getIds(demandList, InvestDemandEntity::getCustomerId)); queryWrapperCustomer.in(CollectionUtils.isNotEmpty(demandList), InvestCustomerEntity::getId, getIds(demandList, InvestDemandEntity::getCustomerId));
} }
} }
if(CollectionUtils.isNotEmpty(params.getCustomerType())) {
queryWrapperCustomer.in(InvestCustomerEntity::getType,params.getCustomerType()) ;
}


queryWrapperCustomer.orderByDesc(InvestCustomerEntity::getCreateDate); queryWrapperCustomer.orderByDesc(InvestCustomerEntity::getCreateDate);
InvestPageResult<InvestCustomerEntity> customers = customerService.queryPage(buildPageQuery(params, null), queryWrapperCustomer); InvestPageResult<InvestCustomerEntity> customers = customerService.queryPage(buildPageQuery(params, null), queryWrapperCustomer);
@@ -345,33 +348,33 @@ public class InvestBizServiceImpl implements InvestBizService {
try { try {
successList.forEach(customer -> { successList.forEach(customer -> {
if (StringUtils.isBlank(customer.getPhone())) { if (StringUtils.isBlank(customer.getPhone())) {
stringRedisTemplate.opsForHash().increment(importKey, "processCount", 1);
redisKeyIncrement(importKey, "processCount", "failCount");
log.error("负责人电话为空", customer.toString()); log.error("负责人电话为空", customer.toString());
return; return;
} }
if (StringUtils.isBlank(customer.getShopNumber())) { if (StringUtils.isBlank(customer.getShopNumber())) {
stringRedisTemplate.opsForHash().increment(importKey, "processCount", 1);
redisKeyIncrement(importKey, "processCount", "failCount");
log.error("意向铺位为空", customer.toString()); log.error("意向铺位为空", customer.toString());
return; return;
} }
if (StringUtils.isBlank(customer.getBrandName())) { if (StringUtils.isBlank(customer.getBrandName())) {
stringRedisTemplate.opsForHash().increment(importKey, "processCount", 1);
redisKeyIncrement(importKey, "processCount", "failCount");
log.error("品牌为空", customer.toString()); log.error("品牌为空", customer.toString());
return; return;
} }
if (StringUtils.isBlank(customer.getName())) {
stringRedisTemplate.opsForHash().increment(importKey, "processCount", 1);
log.error("品牌负责人为空", customer.toString());
return;
}
//if (StringUtils.isBlank(customer.getName())) {
// redisKeyIncrement(importKey, "processCount","failCount") ;
// log.error("品牌负责人为空", customer.toString());
// return;
//}
if (StringUtils.isBlank(customer.getBusiness())) { if (StringUtils.isBlank(customer.getBusiness())) {
stringRedisTemplate.opsForHash().increment(importKey, "processCount", 1);
redisKeyIncrement(importKey, "processCount", "failCount");
log.error("经营业态为空", customer.toString()); log.error("经营业态为空", customer.toString());
return; return;
} }
InvestDemandDto toImportCustomer = convetCustomer(importKey, customer, brandMap, businesseMap, shopMap, customerMap.get(customer.getPhone()), demandMap); InvestDemandDto toImportCustomer = convetCustomer(importKey, customer, brandMap, businesseMap, shopMap, customerMap.get(customer.getPhone()), demandMap);
if (toImportCustomer == null) { if (toImportCustomer == null) {
stringRedisTemplate.opsForHash().increment(importKey, "processCount", 1);
redisKeyIncrement(importKey, "processCount", "failCount");
log.error("customerBase null"); log.error("customerBase null");
return; return;
} }
@@ -382,7 +385,7 @@ public class InvestBizServiceImpl implements InvestBizService {
updateCustomerAndDemand(toImportCustomer); updateCustomerAndDemand(toImportCustomer);
} }
//记数 //记数
stringRedisTemplate.opsForHash().increment(importKey, "processCount", 1);
redisKeyIncrement(importKey, "processCount");
stringRedisTemplate.expire(importKey, 10, TimeUnit.SECONDS); stringRedisTemplate.expire(importKey, 10, TimeUnit.SECONDS);
}); });
} catch (Exception e) { } catch (Exception e) {
@@ -414,10 +417,10 @@ public class InvestBizServiceImpl implements InvestBizService {
if (Objects.isNull(demandEntity)) { if (Objects.isNull(demandEntity)) {
demandEntity = new InvestDemandEntity(); demandEntity = new InvestDemandEntity();
} }
if (Objects.isNull(brandMap.get(importCustomerVo.getBrandName()))) {
log.warn("品牌:{} 不存在", importCustomerVo.getBrandName());
return null;
}
//if (Objects.isNull(brandMap.get(importCustomerVo.getBrandName()))) {
// log.warn("品牌:{} 不存在", importCustomerVo.getBrandName());
// return null;
//}
customerEntity.setBrandId(brandMap.get(importCustomerVo.getBrandName()).getId()); customerEntity.setBrandId(brandMap.get(importCustomerVo.getBrandName()).getId());


if (Objects.isNull(businesseMap.get(importCustomerVo.getBusiness()))) { if (Objects.isNull(businesseMap.get(importCustomerVo.getBusiness()))) {
@@ -478,6 +481,12 @@ public class InvestBizServiceImpl implements InvestBizService {
log.error(e.getMessage()); log.error(e.getMessage());
} }


private void redisKeyIncrement(String key, String... hashKey) {
for (String s : hashKey) {
stringRedisTemplate.opsForHash().increment(key, s, 1);
}
}

@Override @Override
public List<InvestDemandVo> queryCustomer() { public List<InvestDemandVo> queryCustomer() {
List<InvestCustomerEntity> customerEntities = customerService.list(); List<InvestCustomerEntity> customerEntities = customerService.list();
@@ -486,9 +495,9 @@ public class InvestBizServiceImpl implements InvestBizService {


private InvestDemandDto doConvertDemand(InvestDemandQuery params) { private InvestDemandDto doConvertDemand(InvestDemandQuery params) {
InvestCustomerEntity customerEntity = null; InvestCustomerEntity customerEntity = null;
if (ObjectUtils.anyNotNull(params.getCustomerType(), params.getBusinessId())) {
if (ObjectUtils.anyNotNull(params.getBusinessId())) {
customerEntity = new InvestCustomerEntity(); customerEntity = new InvestCustomerEntity();
customerEntity.setType(params.getCustomerType());
//customerEntity.setType(params.getCustomerType());
customerEntity.setBusinessId(params.getBusinessId()); customerEntity.setBusinessId(params.getBusinessId());
} }


@@ -909,7 +918,7 @@ public class InvestBizServiceImpl implements InvestBizService {
if (Objects.isNull(shop)) { if (Objects.isNull(shop)) {
return new HashMap<>(); return new HashMap<>();
} }
return rentContractService.selectRentContractByShopIds(Arrays.asList(shop.getId()), StringUtils.join(shop.getId(), ""),
return rentContractService.selectRentContractByShopIds(Collections.singletonList(shop.getId()), StringUtils.join(shop.getId(), ""),
InvestUserContext.getUser().getTenantId()); InvestUserContext.getUser().getTenantId());
} }


@@ -921,9 +930,16 @@ public class InvestBizServiceImpl implements InvestBizService {
InvestCustomerEntity customerEntity = customerService.getByIdNotNull(remindVo.getCustomerId()); InvestCustomerEntity customerEntity = customerService.getByIdNotNull(remindVo.getCustomerId());
if (Objects.nonNull(customerEntity)) { if (Objects.nonNull(customerEntity)) {
remindVo.setCustomer(customerEntity); remindVo.setCustomer(customerEntity);
remindVo.setBrand(brandService.getById(customerEntity.getBrandId()));
WxBrand brand = brandService.getById(customerEntity.getBrandId());
if (Objects.nonNull(brand)) {
remindVo.setBrand(brand);
}
}

MallUserInfo userInfo = userInfoService.getById(remindEntity.getOwner());
if (Objects.nonNull(userInfo)) {
remindVo.setOwnerInfo(userInfo);
} }
remindVo.setOwnerInfo(userInfoService.getById(remindEntity.getOwner()));
return remindVo; return remindVo;
} }




+ 1
- 1
mallinkService/src/main/resources/mapper/InvestCustomerMapper.xml Просмотреть файл

@@ -42,7 +42,7 @@
SELECT count(1) SELECT count(1)
FROM `invest_customer` c FROM `invest_customer` c
INNER JOIN `invest_demand` d ON d.`customer_id` = c.id INNER JOIN `invest_demand` d ON d.`customer_id` = c.id
WHERE d.`owner` = 0
WHERE d.`owner` = 0 AND c.type in (0,1,3)
AND c.`tenant_id` = #{tenantId}; AND c.`tenant_id` = #{tenantId};
</select> </select>



Загрузка…
Отмена
Сохранить