|
|
|
@@ -105,10 +105,10 @@ public class InvestBizServiceImpl implements InvestBizService { |
|
|
|
Map<String, Object> followContent = (Map<String, Object>) JSON.parseObject(item.getContent(), Map.class); |
|
|
|
String followMember = (String) followContent.get("member"); |
|
|
|
List<MallUserInfo> ownerInfo = getMallUserInfos(followMember, usersMap); |
|
|
|
InvestFollowRecordVo followRecordVo = InvestFollowRecordVo.builder() |
|
|
|
.customer(customerEntity) |
|
|
|
.memberInfo(ownerInfo) |
|
|
|
.brand(brand).build(); |
|
|
|
InvestFollowRecordVo followRecordVo = new InvestFollowRecordVo(); |
|
|
|
followRecordVo.setCustomer(customerEntity); |
|
|
|
followRecordVo.setMemberInfo(ownerInfo); |
|
|
|
followRecordVo.setBrand(brand); |
|
|
|
followRecordVo.setOwnerInfo(usersMap.get(item.getOwner())); |
|
|
|
BeanUtils.copyProperties(item, followRecordVo); |
|
|
|
resultList.add(followRecordVo); |
|
|
|
@@ -130,7 +130,7 @@ public class InvestBizServiceImpl implements InvestBizService { |
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
@Override |
|
|
|
public boolean saveCustomerAndDemand(InvestDemandDto demandDto) { |
|
|
|
InvestHelper.allNotNull(demandDto); |
|
|
|
InvestHelper.notNull(demandDto); |
|
|
|
InvestCustomerEntity customerEntity = demandDto.getCustomer(); |
|
|
|
InvestCustomerEntity customerEntityDB = customerService.getById(demandDto.getCustomerId()); |
|
|
|
if (Objects.nonNull(customerEntity)) { |
|
|
|
@@ -142,15 +142,16 @@ public class InvestBizServiceImpl implements InvestBizService { |
|
|
|
} |
|
|
|
InvestDemandEntity demandEntity = new InvestDemandEntity(); |
|
|
|
BeanUtils.copyProperties(demandDto, demandEntity); |
|
|
|
demandEntity.setCustomerId(customerEntity.getId()); |
|
|
|
return demandService.save(demandEntity); |
|
|
|
} |
|
|
|
|
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
@Override |
|
|
|
public boolean updateCustomerAndDemand(InvestDemandDto demandDto) { |
|
|
|
InvestHelper.allNotNull(demandDto, demandDto.getCustomerId()); |
|
|
|
InvestHelper.notNull(demandDto, demandDto.getCustomerId()); |
|
|
|
InvestCustomerEntity customerEntity = demandDto.getCustomer(); |
|
|
|
InvestHelper.allNotNull(customerEntity); |
|
|
|
InvestHelper.notNull(customerEntity); |
|
|
|
customerService.updateById(customerEntity); |
|
|
|
InvestDemandEntity demandEntity = new InvestDemandEntity(); |
|
|
|
BeanUtils.copyProperties(demandDto, demandEntity); |
|
|
|
@@ -176,12 +177,11 @@ public class InvestBizServiceImpl implements InvestBizService { |
|
|
|
} |
|
|
|
|
|
|
|
private InvestDemandVo buildDemindItem(InvestDemandEntity item, InvestCustomerEntity customer, WxBrand brand, WxShop shop, Map<Long, MallUserInfo> usersMap) { |
|
|
|
InvestDemandVo resultItemVo = InvestDemandVo.builder() |
|
|
|
.brand(brand) |
|
|
|
.customer(customer) |
|
|
|
.targetInfo(shop) |
|
|
|
.ownerInfo(usersMap.get(item.getOwner())) |
|
|
|
.build(); |
|
|
|
InvestDemandVo resultItemVo = new InvestDemandVo(); |
|
|
|
resultItemVo.setBrand(brand); |
|
|
|
resultItemVo.setCustomer(customer); |
|
|
|
resultItemVo.setTargetInfo(shop); |
|
|
|
resultItemVo.setOwnerInfo(usersMap.get(item.getOwner())); |
|
|
|
BeanUtils.copyProperties(item, resultItemVo); |
|
|
|
return resultItemVo; |
|
|
|
} |
|
|
|
@@ -193,10 +193,9 @@ public class InvestBizServiceImpl implements InvestBizService { |
|
|
|
|
|
|
|
private InvestTaskVo buildTaskItem(InvestTaskEntity item, WxShop shop, Map<Long, MallUserInfo> usersMap) { |
|
|
|
List<MallUserInfo> ownerInfo = getMallUserInfos(item.getOwner(), usersMap); |
|
|
|
InvestTaskVo resultItemVo = InvestTaskVo.builder() |
|
|
|
.targetInfo(shop) |
|
|
|
.ownerInfo(ownerInfo) |
|
|
|
.build(); |
|
|
|
InvestTaskVo resultItemVo = new InvestTaskVo(); |
|
|
|
resultItemVo.setTargetInfo(shop); |
|
|
|
resultItemVo.setOwnerInfo(ownerInfo); |
|
|
|
BeanUtils.copyProperties(item, resultItemVo); |
|
|
|
return resultItemVo; |
|
|
|
} |
|
|
|
|