| @@ -19,7 +19,7 @@ import lombok.EqualsAndHashCode; | |||||
| @TableName("invest_follow_record") | @TableName("invest_follow_record") | ||||
| @EqualsAndHashCode(callSuper = true) | @EqualsAndHashCode(callSuper = true) | ||||
| public class InvestFollowRecordEntity extends InvestBaseEntity { | public class InvestFollowRecordEntity extends InvestBaseEntity { | ||||
| public static final String KEY_MEMBER = "member" ; | |||||
| /** | /** | ||||
| * 主谈人 | * 主谈人 | ||||
| */ | */ | ||||
| @@ -24,6 +24,8 @@ import java.util.Date; | |||||
| @EqualsAndHashCode(callSuper = true) | @EqualsAndHashCode(callSuper = true) | ||||
| public class InvestTaskEntity extends InvestBaseEntity { | public class InvestTaskEntity extends InvestBaseEntity { | ||||
| public static final String KEY_CONTRACTID = "contractId" ; | |||||
| /** | /** | ||||
| * 负责人 | * 负责人 | ||||
| */ | */ | ||||
| @@ -7,7 +7,9 @@ import com.iformall.domain.vo.RentEventInfo; | |||||
| import com.iformall.enums.EnumInvestType; | import com.iformall.enums.EnumInvestType; | ||||
| import com.iformall.enums.EnumRentContractStatus; | import com.iformall.enums.EnumRentContractStatus; | ||||
| import com.iformall.enums.EnumTaskStatus; | import com.iformall.enums.EnumTaskStatus; | ||||
| import com.iformall.service.invest.InvestHelper; | |||||
| import com.iformall.service.invest.InvestTaskService; | import com.iformall.service.invest.InvestTaskService; | ||||
| import com.iformall.utils.JsonUtil; | |||||
| import lombok.extern.slf4j.Slf4j; | import lombok.extern.slf4j.Slf4j; | ||||
| import org.apache.commons.collections.CollectionUtils; | import org.apache.commons.collections.CollectionUtils; | ||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
| @@ -15,6 +17,7 @@ import org.springframework.context.ApplicationListener; | |||||
| import org.springframework.stereotype.Component; | import org.springframework.stereotype.Component; | ||||
| import java.util.List; | import java.util.List; | ||||
| import java.util.Map; | |||||
| import java.util.Objects; | import java.util.Objects; | ||||
| @Slf4j | @Slf4j | ||||
| @@ -50,6 +53,10 @@ public class InvestListener implements ApplicationListener<InvestEvent> { | |||||
| for (InvestTaskEntity task : tasks) { | for (InvestTaskEntity task : tasks) { | ||||
| task.setStatus(status); | task.setStatus(status); | ||||
| String content = task.getContent(); | |||||
| Map contentMap = JSON.parseObject(content, Map.class); | |||||
| contentMap.put(InvestTaskEntity.KEY_CONTRACTID, rentEventInfo.getRentId()); | |||||
| task.setContent(JsonUtil.obj2Json(contentMap)); | |||||
| } | } | ||||
| taskService.updateBatchById(tasks); | taskService.updateBatchById(tasks); | ||||
| } | } | ||||
| @@ -13,6 +13,7 @@ import com.iformall.service.WxBrandService; | |||||
| import com.iformall.service.WxShopService; | import com.iformall.service.WxShopService; | ||||
| import com.iformall.service.invest.*; | import com.iformall.service.invest.*; | ||||
| import org.apache.commons.collections.CollectionUtils; | import org.apache.commons.collections.CollectionUtils; | ||||
| import org.apache.commons.collections.MapUtils; | |||||
| import org.apache.commons.compress.utils.Lists; | import org.apache.commons.compress.utils.Lists; | ||||
| import org.springframework.beans.BeanUtils; | import org.springframework.beans.BeanUtils; | ||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
| @@ -106,9 +107,7 @@ public class InvestBizServiceImpl implements InvestBizService { | |||||
| for (InvestFollowRecordEntity item : recordList) { | for (InvestFollowRecordEntity item : recordList) { | ||||
| InvestCustomerEntity customerEntity = customerMap.get(item.getCustomerId()); | InvestCustomerEntity customerEntity = customerMap.get(item.getCustomerId()); | ||||
| WxBrand brand = brandMap.get(customerEntity.getBrandId()); | WxBrand brand = brandMap.get(customerEntity.getBrandId()); | ||||
| 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); | |||||
| List<MallUserInfo> ownerInfo = getMallUserInfos(usersMap, item); | |||||
| InvestFollowRecordVo followRecordVo = new InvestFollowRecordVo(); | InvestFollowRecordVo followRecordVo = new InvestFollowRecordVo(); | ||||
| followRecordVo.setCustomer(customerEntity); | followRecordVo.setCustomer(customerEntity); | ||||
| followRecordVo.setMemberInfo(ownerInfo); | followRecordVo.setMemberInfo(ownerInfo); | ||||
| @@ -124,6 +123,16 @@ public class InvestBizServiceImpl implements InvestBizService { | |||||
| return investPage; | return investPage; | ||||
| } | } | ||||
| private List<MallUserInfo> getMallUserInfos(Map<Long, MallUserInfo> usersMap, InvestFollowRecordEntity item) { | |||||
| List<MallUserInfo> ownerInfo = null ; | |||||
| Map contentMap = JSON.parseObject(item.getContent(),Map.class); | |||||
| if (MapUtils.isNotEmpty(contentMap)) { | |||||
| String followMember = (String) contentMap.get(InvestFollowRecordEntity.KEY_MEMBER); | |||||
| ownerInfo = getMallUserInfos(followMember, usersMap); | |||||
| } | |||||
| return ownerInfo; | |||||
| } | |||||
| @Override | @Override | ||||
| public List<MallUserInfo> queryUserList() { | public List<MallUserInfo> queryUserList() { | ||||
| MallUserInfo query = new MallUserInfo(); | MallUserInfo query = new MallUserInfo(); | ||||
| @@ -18,8 +18,8 @@ public class InvestOperateRecordServiceImpl extends InvestBaseServiceImpl<Invest | |||||
| } | } | ||||
| void checkBeforeSaveOrUpdate(InvestOperateRecordEntity entity) { | void checkBeforeSaveOrUpdate(InvestOperateRecordEntity entity) { | ||||
| InvestHelper.notNull(entity.getTbl(), ""); | |||||
| InvestHelper.notNull(entity.getTid(), ""); | |||||
| InvestHelper.notNull(entity.getTbl()); | |||||
| InvestHelper.notNull(entity.getTid()); | |||||
| entity.setOperator(InvestUserContext.getUserId()); | entity.setOperator(InvestUserContext.getUserId()); | ||||
| } | } | ||||