diff --git a/mallinkService/src/main/java/com/iformall/domain/po/invest/InvestFollowRecordEntity.java b/mallinkService/src/main/java/com/iformall/domain/po/invest/InvestFollowRecordEntity.java index e0ea49805..f0ce0abda 100755 --- a/mallinkService/src/main/java/com/iformall/domain/po/invest/InvestFollowRecordEntity.java +++ b/mallinkService/src/main/java/com/iformall/domain/po/invest/InvestFollowRecordEntity.java @@ -19,7 +19,7 @@ import lombok.EqualsAndHashCode; @TableName("invest_follow_record") @EqualsAndHashCode(callSuper = true) public class InvestFollowRecordEntity extends InvestBaseEntity { - + public static final String KEY_MEMBER = "member" ; /** * 主谈人 */ diff --git a/mallinkService/src/main/java/com/iformall/domain/po/invest/InvestTaskEntity.java b/mallinkService/src/main/java/com/iformall/domain/po/invest/InvestTaskEntity.java index 8928f25ad..c44ebda48 100755 --- a/mallinkService/src/main/java/com/iformall/domain/po/invest/InvestTaskEntity.java +++ b/mallinkService/src/main/java/com/iformall/domain/po/invest/InvestTaskEntity.java @@ -24,6 +24,8 @@ import java.util.Date; @EqualsAndHashCode(callSuper = true) public class InvestTaskEntity extends InvestBaseEntity { + public static final String KEY_CONTRACTID = "contractId" ; + /** * 负责人 */ diff --git a/mallinkService/src/main/java/com/iformall/service/invest/event/InvestListener.java b/mallinkService/src/main/java/com/iformall/service/invest/event/InvestListener.java index cefb35fb8..131fea438 100644 --- a/mallinkService/src/main/java/com/iformall/service/invest/event/InvestListener.java +++ b/mallinkService/src/main/java/com/iformall/service/invest/event/InvestListener.java @@ -7,7 +7,9 @@ import com.iformall.domain.vo.RentEventInfo; import com.iformall.enums.EnumInvestType; import com.iformall.enums.EnumRentContractStatus; import com.iformall.enums.EnumTaskStatus; +import com.iformall.service.invest.InvestHelper; import com.iformall.service.invest.InvestTaskService; +import com.iformall.utils.JsonUtil; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections.CollectionUtils; import org.springframework.beans.factory.annotation.Autowired; @@ -15,6 +17,7 @@ import org.springframework.context.ApplicationListener; import org.springframework.stereotype.Component; import java.util.List; +import java.util.Map; import java.util.Objects; @Slf4j @@ -50,6 +53,10 @@ public class InvestListener implements ApplicationListener { for (InvestTaskEntity task : tasks) { 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); } diff --git a/mallinkService/src/main/java/com/iformall/service/invest/impl/InvestBizServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/invest/impl/InvestBizServiceImpl.java index e45d3993e..5c9685253 100644 --- a/mallinkService/src/main/java/com/iformall/service/invest/impl/InvestBizServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/invest/impl/InvestBizServiceImpl.java @@ -13,6 +13,7 @@ import com.iformall.service.WxBrandService; import com.iformall.service.WxShopService; import com.iformall.service.invest.*; import org.apache.commons.collections.CollectionUtils; +import org.apache.commons.collections.MapUtils; import org.apache.commons.compress.utils.Lists; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; @@ -106,9 +107,7 @@ public class InvestBizServiceImpl implements InvestBizService { for (InvestFollowRecordEntity item : recordList) { InvestCustomerEntity customerEntity = customerMap.get(item.getCustomerId()); WxBrand brand = brandMap.get(customerEntity.getBrandId()); - Map followContent = (Map) JSON.parseObject(item.getContent(), Map.class); - String followMember = (String) followContent.get("member"); - List ownerInfo = getMallUserInfos(followMember, usersMap); + List ownerInfo = getMallUserInfos(usersMap, item); InvestFollowRecordVo followRecordVo = new InvestFollowRecordVo(); followRecordVo.setCustomer(customerEntity); followRecordVo.setMemberInfo(ownerInfo); @@ -124,6 +123,16 @@ public class InvestBizServiceImpl implements InvestBizService { return investPage; } + private List getMallUserInfos(Map usersMap, InvestFollowRecordEntity item) { + List 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 public List queryUserList() { MallUserInfo query = new MallUserInfo(); diff --git a/mallinkService/src/main/java/com/iformall/service/invest/impl/InvestOperateRecordServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/invest/impl/InvestOperateRecordServiceImpl.java index d68827dbe..8eaadda81 100755 --- a/mallinkService/src/main/java/com/iformall/service/invest/impl/InvestOperateRecordServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/invest/impl/InvestOperateRecordServiceImpl.java @@ -18,8 +18,8 @@ public class InvestOperateRecordServiceImpl extends InvestBaseServiceImpl