Преглед изворни кода

[招商]adjust

release_toaliyun_real
Burce пре 6 година
родитељ
комит
bec8c5e7d5
4 измењених фајлова са 23 додато и 28 уклоњено
  1. +1
    -1
      mallinkAdmin/src/main/java/com/iformall/controller/invest/InvestBaseController.java
  2. +1
    -1
      mallinkService/src/main/java/com/iformall/domain/vo/invest/InvestTaskQuery.java
  3. +5
    -1
      mallinkService/src/main/java/com/iformall/service/invest/InvestHelper.java
  4. +16
    -25
      mallinkService/src/main/java/com/iformall/service/invest/impl/InvestBizServiceImpl.java

+ 1
- 1
mallinkAdmin/src/main/java/com/iformall/controller/invest/InvestBaseController.java Прегледај датотеку

@@ -62,7 +62,7 @@ public class InvestBaseController extends BaseController {
@Override
public void setAsText(String text) {
try {
setValue(InvestHelper.codeOf(clz, Integer.parseInt(text)));
setValue(InvestHelper.codeOf(clz, text));
} catch (Exception NumberFormatException) {
setValue(InvestHelper.valueOf(clz, text));
}


+ 1
- 1
mallinkService/src/main/java/com/iformall/domain/vo/invest/InvestTaskQuery.java Прегледај датотеку

@@ -20,7 +20,7 @@ public class InvestTaskQuery extends InvestPageQuery {
/**
* 负责人
*/
@io.swagger.annotations.ApiModelProperty(value = "负责人", name = "taskOwner")
@io.swagger.annotations.ApiModelProperty(value = "负责人", name = "taskOwner" ,example = "id")
private String taskOwner;

/**


+ 5
- 1
mallinkService/src/main/java/com/iformall/service/invest/InvestHelper.java Прегледај датотеку

@@ -118,7 +118,11 @@ public class InvestHelper {
}

@SuppressWarnings("unchecked")
public static <T extends Enum<T>> T codeOf(Class<T> enumType, int code) {
public static <T extends Enum<T>> T codeOf(Class<T> enumType, String value) {
if (StringUtils.isEmpty(value)) {
return null;
}
int code = Integer.parseInt(value);
try {
Method method = enumType.getDeclaredMethod("getEnum", Integer.class);
Object rs = method.invoke(null, code);


+ 16
- 25
mallinkService/src/main/java/com/iformall/service/invest/impl/InvestBizServiceImpl.java Прегледај датотеку

@@ -61,21 +61,17 @@ public class InvestBizServiceImpl implements InvestBizService {
InvestPageResult<InvestDemandVo> investPage = new InvestPageResult<>();

LambdaQueryWrapper<InvestDemandEntity> queryWrapperDemand = null;
if (Objects.nonNull(customerParams)) {
Collection<InvestCustomerEntity> customers = customerService.list(new QueryWrapper<>(customerParams));
if (CollectionUtils.isEmpty(customers)) {
return investPage;
}
queryWrapperDemand = new LambdaQueryWrapper<>();
queryWrapperDemand.in(InvestDemandEntity::getCustomerId, getIds(customers, InvestCustomerEntity::getId));
}

InvestPageResult<InvestDemandEntity> demandPage = demandService.queryPage(buildPageQuery(params, demandParams), queryWrapperDemand);
if (CollectionUtils.isEmpty(demandPage.getRecords())) {
InvestPageResult<InvestCustomerEntity> customers = customerService.queryPage(buildPageQuery(params, customerParams));
if (CollectionUtils.isEmpty(customers.getRecords())) {
return investPage;
}
List<InvestDemandVo> resultList = getTargeInfoList(demandPage);
BeanUtils.copyProperties(demandPage, investPage);
queryWrapperDemand = new LambdaQueryWrapper<>(demandParams);
queryWrapperDemand.in(InvestDemandEntity::getCustomerId, getIds(customers.getRecords(), InvestCustomerEntity::getId));

List<InvestDemandEntity> demandList = demandService.list(queryWrapperDemand);

List<InvestDemandVo> resultList = getTargeInfoList(demandList, customers.getRecords());
BeanUtils.copyProperties(customers, investPage);
investPage.setRecords(resultList);
return investPage;
}
@@ -395,10 +391,8 @@ public class InvestBizServiceImpl implements InvestBizService {
return ownerInfo;
}

private List<InvestDemandVo> getTargeInfoList(InvestPageResult<InvestDemandEntity> demandPage) {
Collection<InvestDemandEntity> demandList = demandPage.getRecords();
Collection<InvestCustomerEntity> customers = customerService.listByIds(getIds(demandList, InvestDemandEntity::getCustomerId));
Map<Long, InvestCustomerEntity> customersMap = getMap(customers, InvestCustomerEntity::getId);
private List<InvestDemandVo> getTargeInfoList(List<InvestDemandEntity> demandList, Collection<InvestCustomerEntity> customers) {
Map<Long, InvestDemandEntity> demindsMap = getMap(demandList, InvestDemandEntity::getCustomerId);

//3、目标信息
Collection<WxShop> shops = shopService.getByIds(getIds(demandList, InvestDemandEntity::getTargetId));
@@ -410,14 +404,11 @@ public class InvestBizServiceImpl implements InvestBizService {
Map<Long, MallUserInfo> usersMap = getMap(userInfoService.findList(null), MallUserInfo::getId);

List<InvestDemandVo> resultList = new ArrayList<>();
for (InvestDemandEntity item : demandList) {
InvestCustomerEntity customer = customersMap.get(item.getCustomerId());
WxShop shop = shopsMap.get(item.getTargetId());
WxBrand brand = null;
if (Objects.nonNull(customer)) {
brand = brandMap.get(customer.getBrandId());
}
resultList.add(buildDemindItem(item, customer, brand, shop, usersMap));
for (InvestCustomerEntity item : customers) {
InvestDemandEntity demandItem = demindsMap.get(item.getId());
WxShop shop = shopsMap.get(demandItem.getTargetId());
WxBrand brand = brandMap.get(item.getBrandId());
resultList.add(buildDemindItem(demandItem, item, brand, shop, usersMap));
}
return resultList;
}


Loading…
Откажи
Сачувај