| @@ -99,7 +99,7 @@ public class InvestSchedule { | |||||
| private void addTaskMessage(InvestTaskEntity task, List<Long> ownerArray) { | private void addTaskMessage(InvestTaskEntity task, List<Long> ownerArray) { | ||||
| String message = String.format(EnumInvestMessageType.TASK_REMIND.getInfo(), task.getId(), DateUtils.format(task.getLastTime())); | String message = String.format(EnumInvestMessageType.TASK_REMIND.getInfo(), task.getId(), DateUtils.format(task.getLastTime())); | ||||
| messageService.saveBatchMessage(ownerArray, message, EnumInvestMessageTag.TASK_MONTH, EnumFollowType.TASK, task.getId()); | |||||
| messageService.saveBatchMessage(ownerArray, message, EnumInvestMessageTag.TASK_MONTH, EnumFollowType.TASK, task.getId(),task.getTenantId()); | |||||
| log.info("{}:taskID:{} 为用户{}创建消息提醒", PREFIX, task.getId(), task.getOwner()); | log.info("{}:taskID:{} 为用户{}创建消息提醒", PREFIX, task.getId(), task.getOwner()); | ||||
| } | } | ||||
| @@ -155,7 +155,7 @@ public class InvestSchedule { | |||||
| private void addCustomerMessage(InvestCustomerVo customerVo, Long owner) { | private void addCustomerMessage(InvestCustomerVo customerVo, Long owner) { | ||||
| String message = String.format(EnumInvestMessageType.COSTOMER_REMIND.getInfo(), customerVo.getId()); | String message = String.format(EnumInvestMessageType.COSTOMER_REMIND.getInfo(), customerVo.getId()); | ||||
| messageService.saveBatchMessage(Arrays.asList(owner), message, EnumInvestMessageTag.CUSTOMER_WEEK, EnumFollowType.DEMAND, customerVo.getId()); | |||||
| messageService.saveBatchMessage(Arrays.asList(owner), message, EnumInvestMessageTag.CUSTOMER_WEEK, EnumFollowType.DEMAND, customerVo.getId(),customerVo.getTenantId()); | |||||
| log.info("{}:customerID:{} 为用户{}创建消息提醒", PREFIX, customerVo.getId(), customerVo.getDemandOwner()); | log.info("{}:customerID:{} 为用户{}创建消息提醒", PREFIX, customerVo.getId(), customerVo.getDemandOwner()); | ||||
| } | } | ||||
| } | } | ||||
| @@ -33,7 +33,7 @@ public interface InvestBaseService<T> { | |||||
| * @param tid | * @param tid | ||||
| * @return | * @return | ||||
| */ | */ | ||||
| default boolean saveBatchMessage(List<Long> ownerArray, String message, EnumInvestMessageTag tag, EnumFollowType type, Long tid) { | |||||
| default boolean saveBatchMessage(List<Long> ownerArray, String message, EnumInvestMessageTag tag, EnumFollowType type, Long tid,String tenantId) { | |||||
| return false; | return false; | ||||
| } | } | ||||
| } | } | ||||
| @@ -104,7 +104,7 @@ public class InvestBaseServiceImpl<M extends BaseMapper<T>, T> extends ServiceIm | |||||
| } | } | ||||
| @Override | @Override | ||||
| public boolean saveBatchMessage(List<Long> ownerArray, String message, EnumInvestMessageTag tag, EnumFollowType type, Long tid) { | |||||
| public boolean saveBatchMessage(List<Long> ownerArray, String message, EnumInvestMessageTag tag, EnumFollowType type, Long tid,String tenantId) { | |||||
| if (CollectionUtils.isEmpty(ownerArray)) { | if (CollectionUtils.isEmpty(ownerArray)) { | ||||
| return false; | return false; | ||||
| } | } | ||||
| @@ -124,7 +124,7 @@ public class InvestBaseServiceImpl<M extends BaseMapper<T>, T> extends ServiceIm | |||||
| messageEntity.setOwner(aLong); | messageEntity.setOwner(aLong); | ||||
| messageEntity.setTid(tid); | messageEntity.setTid(tid); | ||||
| messageEntity.setType(type); | messageEntity.setType(type); | ||||
| messageEntity.setTenantId(InvestUserContext.getUser().getTenantId()); | |||||
| messageEntity.setTenantId(tenantId); | |||||
| messageEntity.setMessage(message); | messageEntity.setMessage(message); | ||||
| messageEntity.setTag(tag); | messageEntity.setTag(tag); | ||||
| messageEntityList.add(messageEntity); | messageEntityList.add(messageEntity); | ||||
| @@ -758,7 +758,8 @@ public class InvestBizServiceImpl implements InvestBizService { | |||||
| Long owner = demandEntity.getOwner(); | Long owner = demandEntity.getOwner(); | ||||
| if (Objects.nonNull(owner) && !Objects.equals(owner, 0L)) { | if (Objects.nonNull(owner) && !Objects.equals(owner, 0L)) { | ||||
| List<Long> ownerArray = Collections.singletonList(owner); | List<Long> ownerArray = Collections.singletonList(owner); | ||||
| demandService.saveBatchMessage(ownerArray, EnumInvestMessageType.CUSTOMER_CREATE.getInfo(), EnumInvestMessageTag.CUSTOMER_CREATE, EnumFollowType.DEMAND, customerEntity.getId()); | |||||
| demandService.saveBatchMessage(ownerArray, EnumInvestMessageType.CUSTOMER_CREATE.getInfo(), | |||||
| EnumInvestMessageTag.CUSTOMER_CREATE, EnumFollowType.DEMAND, customerEntity.getId(),customerEntity.getTenantId()); | |||||
| } | } | ||||
| } | } | ||||
| @@ -948,28 +949,29 @@ public class InvestBizServiceImpl implements InvestBizService { | |||||
| } | } | ||||
| private void syncTargetStatus(InvestTaskEntity investTaskEntity) { | private void syncTargetStatus(InvestTaskEntity investTaskEntity) { | ||||
| if (!Objects.equals(investTaskEntity.getTargetType(), EnumInvestType.RENT)) { | |||||
| return; | |||||
| } | |||||
| WxShop shop = shopService.getById(investTaskEntity.getTargetId()); | |||||
| Map<Long, WxRentContract> shopContractMap = getWxRentContractMap(shop); | |||||
| WxRentContract contract = shopContractMap.get(shop.getId()); | |||||
| if (Objects.nonNull(contract)) { | |||||
| InvestHelper.addContractId(investTaskEntity.getContent(), contract.getId(), null); | |||||
| } else { | |||||
| WxRentContract contractQuery = new WxRentContract(); | |||||
| contractQuery.setTenantId(InvestUserContext.getUser().getTenantId()); | |||||
| contractQuery.setShopId(investTaskEntity.getTargetId()); | |||||
| contractQuery.setStatus(EnumRentContractStatus.INTENTION.getCode()); | |||||
| //获取意向合同 | |||||
| int count = rentContractService.selectContractCountByShopId(contractQuery); | |||||
| if (count > 0) { | |||||
| investTaskEntity.setStatus(EnumTaskStatus.INTENTION); | |||||
| } | |||||
| } | |||||
| //if (!Objects.equals(investTaskEntity.getTargetType(), EnumInvestType.RENT)) { | |||||
| // return; | |||||
| //} | |||||
| if (StringUtils.isNotBlank(investTaskEntity.getOwner()) && Objects.equals(EnumTaskStatus.CREATED, investTaskEntity.getStatus())) { | |||||
| if (StringUtils.isNotBlank(investTaskEntity.getOwner())) { | |||||
| investTaskEntity.setStatus(EnumTaskStatus.NEGOTIATING); | investTaskEntity.setStatus(EnumTaskStatus.NEGOTIATING); | ||||
| } else { | |||||
| WxShop shop = shopService.getById(investTaskEntity.getTargetId()); | |||||
| Map<Long, WxRentContract> shopContractMap = getWxRentContractMap(shop); | |||||
| WxRentContract contract = shopContractMap.get(shop.getId()); | |||||
| if (Objects.nonNull(contract)) { | |||||
| InvestHelper.addContractId(investTaskEntity.getContent(), contract.getId(), null); | |||||
| } else { | |||||
| WxRentContract contractQuery = new WxRentContract(); | |||||
| contractQuery.setTenantId(InvestUserContext.getUser().getTenantId()); | |||||
| contractQuery.setShopId(investTaskEntity.getTargetId()); | |||||
| contractQuery.setStatus(EnumRentContractStatus.INTENTION.getCode()); | |||||
| //获取意向合同 | |||||
| int count = rentContractService.selectContractCountByShopId(contractQuery); | |||||
| if (count > 0) { | |||||
| investTaskEntity.setStatus(EnumTaskStatus.INTENTION); | |||||
| } | |||||
| } | |||||
| } | } | ||||
| } | } | ||||
| @@ -3,7 +3,6 @@ package com.iformall.service.invest.impl; | |||||
| import com.alibaba.fastjson.JSONArray; | import com.alibaba.fastjson.JSONArray; | ||||
| import com.baomidou.mybatisplus.core.conditions.Wrapper; | import com.baomidou.mybatisplus.core.conditions.Wrapper; | ||||
| import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | ||||
| import com.iformall.common.TableLog; | |||||
| import com.iformall.domain.po.invest.InvestTaskEntity; | import com.iformall.domain.po.invest.InvestTaskEntity; | ||||
| import com.iformall.enums.EnumFollowType; | import com.iformall.enums.EnumFollowType; | ||||
| import com.iformall.enums.EnumInvestMessageTag; | import com.iformall.enums.EnumInvestMessageTag; | ||||
| @@ -56,7 +55,8 @@ public class InvestTaskServiceImpl extends InvestBaseServiceImpl<InvestTaskMappe | |||||
| String owner = entity.getOwner(); | String owner = entity.getOwner(); | ||||
| if (StringUtils.isNotBlank(owner)) { | if (StringUtils.isNotBlank(owner)) { | ||||
| List<Long> ownerArray = JSONArray.parseArray(owner, Long.class); | List<Long> ownerArray = JSONArray.parseArray(owner, Long.class); | ||||
| this.saveBatchMessage(ownerArray, EnumInvestMessageType.TASK_CREATE.getInfo(), EnumInvestMessageTag.TASK_CREATE, EnumFollowType.TASK, entity.getId()); | |||||
| this.saveBatchMessage(ownerArray, EnumInvestMessageType.TASK_CREATE.getInfo(), | |||||
| EnumInvestMessageTag.TASK_CREATE, EnumFollowType.TASK, entity.getId(),entity.getTenantId()); | |||||
| } | } | ||||
| } | } | ||||
| @@ -25,13 +25,13 @@ | |||||
| LEFT JOIN `invest_demand` d ON d.id = f.`follow_id` | LEFT JOIN `invest_demand` d ON d.id = f.`follow_id` | ||||
| LEFT JOIN invest_customer c ON d.`customer_id` = c.id | LEFT JOIN invest_customer c ON d.`customer_id` = c.id | ||||
| where 1=1 | where 1=1 | ||||
| <if test=" null != type "> | |||||
| <if test=" null != type and type.size()>0"> | |||||
| AND c.type in | AND c.type in | ||||
| <foreach collection="type" index="index" item="idItem" open="(" separator="," close=")"> | <foreach collection="type" index="index" item="idItem" open="(" separator="," close=")"> | ||||
| #{idItem} | #{idItem} | ||||
| </foreach> | </foreach> | ||||
| </if> | </if> | ||||
| <if test=" null != ids "> | |||||
| <if test=" null != ids and ids.size()>0"> | |||||
| AND d.id in | AND d.id in | ||||
| <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | ||||
| #{idItem} | #{idItem} | ||||