| @@ -30,7 +30,6 @@ public class InvestBaseController extends BaseController { | |||||
| registerEnumEditor(dataBinder, EnumCustomerRatingType.class, "customerRatingType") ; | registerEnumEditor(dataBinder, EnumCustomerRatingType.class, "customerRatingType") ; | ||||
| registerEnumEditor(dataBinder, EnumTaskStatus.class, "taskStatus") ; | registerEnumEditor(dataBinder, EnumTaskStatus.class, "taskStatus") ; | ||||
| registerEnumEditor(dataBinder, EnumFollowType.class, "type") ; | registerEnumEditor(dataBinder, EnumFollowType.class, "type") ; | ||||
| registerEnumEditor(dataBinder, EnumRemindDateType.class, "dateType") ; | |||||
| } | } | ||||
| public <R, T> InvestResultData<R> execute(T params, Function<T, R> function) { | public <R, T> InvestResultData<R> execute(T params, Function<T, R> function) { | ||||
| @@ -100,16 +100,20 @@ public class TableOperateAspect { | |||||
| Map<String, Object> afterMap = getFeildMap(arg); | Map<String, Object> afterMap = getFeildMap(arg); | ||||
| List content = getContent(beforeMap, afterMap); | List content = getContent(beforeMap, afterMap); | ||||
| log.debug("operate content: {}", JSON.toJSONString(content)); | log.debug("operate content: {}", JSON.toJSONString(content)); | ||||
| InvestOperateRecordEntity recordEntity = new InvestOperateRecordEntity(); | |||||
| if (CollectionUtils.isEmpty(content)) { | if (CollectionUtils.isEmpty(content)) { | ||||
| return; | return; | ||||
| } | } | ||||
| recordEntity.setContent(JSON.toJSONString(content)); | |||||
| recordEntity.setOperateType(operateType); | |||||
| recordEntity.setTbl(getTbl(signature)); | |||||
| recordEntity.setTid(tid); | |||||
| operateRecordService.save(recordEntity); | |||||
| log.debug("saveRecord: {}", JSON.toJSONString(recordEntity)); | |||||
| List<InvestOperateRecordEntity> toSaveRecord = new ArrayList<>() ; | |||||
| for (Object o : content) { | |||||
| InvestOperateRecordEntity recordEntity = new InvestOperateRecordEntity(); | |||||
| recordEntity.setContent(JSON.toJSONString(o)); | |||||
| recordEntity.setOperateType(operateType); | |||||
| recordEntity.setTbl(getTbl(signature)); | |||||
| recordEntity.setTid(tid); | |||||
| toSaveRecord.add(recordEntity) ; | |||||
| } | |||||
| operateRecordService.saveBatch(toSaveRecord); | |||||
| log.debug("saveRecord: {}", JSON.toJSONString(content)); | |||||
| } | } | ||||
| private String getTbl(MethodSignature signature) { | private String getTbl(MethodSignature signature) { | ||||
| @@ -92,7 +92,8 @@ public class InvestSchedule { | |||||
| //查询跟踪列表 | //查询跟踪列表 | ||||
| List<InvestFollowRecordEntity> follows = followRecordService.listByTime(EnumFollowType.DEMAND, start.getTime()); | List<InvestFollowRecordEntity> follows = followRecordService.listByTime(EnumFollowType.DEMAND, start.getTime()); | ||||
| List<InvestCustomerVo> demands = customerService.listByIds(InvestHelper.getIds(follows, InvestFollowRecordEntity::getFollowId), Arrays.asList(EnumCustomerType.INTENTIONAL, EnumCustomerType.POTENTIAL)); | |||||
| List<InvestCustomerVo> demands = customerService.listByIds(InvestHelper.getIds(follows, InvestFollowRecordEntity::getFollowId), | |||||
| Arrays.asList(EnumCustomerType.INTENTIONAL.getCode(), EnumCustomerType.POTENTIAL.getCode())); | |||||
| /** | /** | ||||
| * 已经已经提醒过的用户 | * 已经已经提醒过的用户 | ||||
| @@ -18,7 +18,7 @@ import java.util.List; | |||||
| * @date 2019-09-23 18:40:43 | * @date 2019-09-23 18:40:43 | ||||
| */ | */ | ||||
| @Mapper | @Mapper | ||||
| public interface InvestCustomerDao extends BaseMapper<InvestCustomerEntity> { | |||||
| public interface InvestCustomerMapper extends BaseMapper<InvestCustomerEntity> { | |||||
| List<InvestCustomerVo> listByIds(Collection<? extends Serializable> ids, List<EnumCustomerType> type) ; | List<InvestCustomerVo> listByIds(Collection<? extends Serializable> ids, List<EnumCustomerType> type) ; | ||||
| } | } | ||||
| @@ -12,6 +12,6 @@ import org.apache.ibatis.annotations.Mapper; | |||||
| * @date 2019-09-23 18:40:42 | * @date 2019-09-23 18:40:42 | ||||
| */ | */ | ||||
| @Mapper | @Mapper | ||||
| public interface InvestDemandDao extends BaseMapper<InvestDemandEntity> { | |||||
| public interface InvestDemandMapper extends BaseMapper<InvestDemandEntity> { | |||||
| } | } | ||||
| @@ -12,6 +12,6 @@ import org.apache.ibatis.annotations.Mapper; | |||||
| * @date 2019-09-23 18:40:43 | * @date 2019-09-23 18:40:43 | ||||
| */ | */ | ||||
| @Mapper | @Mapper | ||||
| public interface InvestFollowRecordDao extends BaseMapper<InvestFollowRecordEntity> { | |||||
| public interface InvestFollowRecordMapper extends BaseMapper<InvestFollowRecordEntity> { | |||||
| } | } | ||||
| @@ -12,6 +12,6 @@ import org.apache.ibatis.annotations.Mapper; | |||||
| * @date 2019-09-23 18:40:43 | * @date 2019-09-23 18:40:43 | ||||
| */ | */ | ||||
| @Mapper | @Mapper | ||||
| public interface InvestMessageDao extends BaseMapper<InvestMessageEntity> { | |||||
| public interface InvestMessageMapper extends BaseMapper<InvestMessageEntity> { | |||||
| } | } | ||||
| @@ -1,17 +0,0 @@ | |||||
| package com.iformall.mapper; | |||||
| import com.baomidou.mybatisplus.core.mapper.BaseMapper; | |||||
| import com.iformall.domain.po.invest.InvestOperateRecordEntity; | |||||
| import org.apache.ibatis.annotations.Mapper; | |||||
| /** | |||||
| * 操作记录 | |||||
| * | |||||
| * @author | |||||
| * @date 2019-09-23 18:40:43 | |||||
| */ | |||||
| @Mapper | |||||
| public interface InvestOperateRecordDao extends BaseMapper<InvestOperateRecordEntity> { | |||||
| } | |||||
| @@ -0,0 +1,22 @@ | |||||
| package com.iformall.mapper; | |||||
| import com.baomidou.mybatisplus.core.conditions.Wrapper; | |||||
| import com.baomidou.mybatisplus.core.mapper.BaseMapper; | |||||
| import com.iformall.domain.po.invest.InvestOperateRecordEntity; | |||||
| import org.apache.ibatis.annotations.Mapper; | |||||
| import java.util.List; | |||||
| /** | |||||
| * 操作记录 | |||||
| * | |||||
| * @author | |||||
| * @date 2019-09-23 18:40:43 | |||||
| */ | |||||
| @Mapper | |||||
| public interface InvestOperateRecordMapper extends BaseMapper<InvestOperateRecordEntity> { | |||||
| long selectCustomerPageCount(Long tid) ; | |||||
| List<InvestOperateRecordEntity> selectCustomerPageByTid(Long tid, Integer limitStart, Integer limitSize); | |||||
| } | |||||
| @@ -12,6 +12,6 @@ import org.apache.ibatis.annotations.Mapper; | |||||
| * @date 2019-09-23 18:40:43 | * @date 2019-09-23 18:40:43 | ||||
| */ | */ | ||||
| @Mapper | @Mapper | ||||
| public interface InvestRemindDao extends BaseMapper<InvestRemindEntity> { | |||||
| public interface InvestRemindMapper extends BaseMapper<InvestRemindEntity> { | |||||
| } | } | ||||
| @@ -12,6 +12,6 @@ import org.apache.ibatis.annotations.Mapper; | |||||
| * @date 2019-09-23 18:40:43 | * @date 2019-09-23 18:40:43 | ||||
| */ | */ | ||||
| @Mapper | @Mapper | ||||
| public interface InvestTaskDao extends BaseMapper<InvestTaskEntity> { | |||||
| public interface InvestTaskMapper extends BaseMapper<InvestTaskEntity> { | |||||
| } | } | ||||
| @@ -2,9 +2,12 @@ package com.iformall.service.invest; | |||||
| import com.baomidou.mybatisplus.extension.service.IService; | import com.baomidou.mybatisplus.extension.service.IService; | ||||
| import com.iformall.domain.po.invest.InvestOperateRecordEntity; | import com.iformall.domain.po.invest.InvestOperateRecordEntity; | ||||
| import com.iformall.domain.vo.invest.InvestOperateRecordQuery; | |||||
| import com.iformall.domain.vo.invest.InvestPageQuery; | import com.iformall.domain.vo.invest.InvestPageQuery; | ||||
| import com.iformall.domain.vo.invest.InvestPageResult; | import com.iformall.domain.vo.invest.InvestPageResult; | ||||
| import java.util.List; | |||||
| /** | /** | ||||
| * 操作记录 | * 操作记录 | ||||
| * | * | ||||
| @@ -15,5 +18,7 @@ import com.iformall.domain.vo.invest.InvestPageResult; | |||||
| public interface InvestOperateRecordService extends IService<InvestOperateRecordEntity>,InvestBaseService<InvestOperateRecordEntity> { | public interface InvestOperateRecordService extends IService<InvestOperateRecordEntity>,InvestBaseService<InvestOperateRecordEntity> { | ||||
| InvestPageResult<InvestOperateRecordEntity> queryPage(InvestPageQuery<InvestOperateRecordEntity> params); | InvestPageResult<InvestOperateRecordEntity> queryPage(InvestPageQuery<InvestOperateRecordEntity> params); | ||||
| InvestPageResult<InvestOperateRecordEntity> selectPageByTid(InvestOperateRecordQuery recordQuery); | |||||
| } | } | ||||
| @@ -306,7 +306,7 @@ public class InvestBizServiceImpl implements InvestBizService { | |||||
| remindPageQuery.setQueryData(remindQuery); | remindPageQuery.setQueryData(remindQuery); | ||||
| LambdaQueryWrapper<InvestRemindEntity> queryWrapper = new LambdaQueryWrapper<>(); | LambdaQueryWrapper<InvestRemindEntity> queryWrapper = new LambdaQueryWrapper<>(); | ||||
| queryWrapper.ge(Objects.nonNull(params.getRemindDate()), InvestRemindEntity::getBeginDate, getDayStart(params.getRemindDate())); | queryWrapper.ge(Objects.nonNull(params.getRemindDate()), InvestRemindEntity::getBeginDate, getDayStart(params.getRemindDate())); | ||||
| //queryWrapper.le(Objects.nonNull(params.getRemindDate()), InvestRemindEntity::getEndDate, getDayEnd(params.getRemindDate())); | |||||
| queryWrapper.ge(Objects.nonNull(params.getRemindDate()), InvestRemindEntity::getEndDate, getDayEnd(params.getRemindDate())); | |||||
| queryWrapper.orderByDesc(InvestRemindEntity::getCreateDate); | queryWrapper.orderByDesc(InvestRemindEntity::getCreateDate); | ||||
| InvestPageResult<InvestRemindEntity> recordPage = remindService.queryPage(remindPageQuery, queryWrapper); | InvestPageResult<InvestRemindEntity> recordPage = remindService.queryPage(remindPageQuery, queryWrapper); | ||||
| if (CollectionUtils.isEmpty(recordPage.getRecords())) { | if (CollectionUtils.isEmpty(recordPage.getRecords())) { | ||||
| @@ -522,43 +522,28 @@ public class InvestBizServiceImpl implements InvestBizService { | |||||
| public InvestPageResult<InvestOperateRecordVo> findOperateListById(InvestOperateRecordQuery params) { | public InvestPageResult<InvestOperateRecordVo> findOperateListById(InvestOperateRecordQuery params) { | ||||
| InvestHelper.notNull(params, params.getRecordType(), params.getTid()); | InvestHelper.notNull(params, params.getRecordType(), params.getTid()); | ||||
| InvestPageResult<InvestOperateRecordVo> investPage = new InvestPageResult<>(); | InvestPageResult<InvestOperateRecordVo> investPage = new InvestPageResult<>(); | ||||
| LambdaQueryWrapper<InvestOperateRecordEntity> recordQueryWrapper = new LambdaQueryWrapper<>(); | |||||
| InvestDemandEntity demandEntity; | |||||
| List<InvestOperateRecordEntity> demandRecord = new ArrayList<>(); | |||||
| if (Objects.equals(params.getRecordType(), EnumFollowType.DEMAND)) { | |||||
| InvestCustomerEntity customerEntity = customerService.getByIdNotNull(params.getTid()); | |||||
| demandEntity = demandService.getOne(new LambdaQueryWrapper<InvestDemandEntity>().eq(InvestDemandEntity::getCustomerId, customerEntity.getId())); | |||||
| buildQueryWrapper(recordQueryWrapper, InvestOperateRecordEntity.TLB_CUSTOMER, customerEntity.getId()); | |||||
| if (Objects.nonNull(demandEntity)) { | |||||
| LambdaQueryWrapper<InvestOperateRecordEntity> demandQueryWrapper = new LambdaQueryWrapper<>(); | |||||
| buildQueryWrapper(demandQueryWrapper, InvestOperateRecordEntity.TLB_DEMAND, demandEntity.getId()); | |||||
| demandRecord.addAll(operateRecordService.list(demandQueryWrapper)); | |||||
| } | |||||
| } else if (Objects.equals(params.getRecordType(), EnumFollowType.TASK)) { | |||||
| buildQueryWrapper(recordQueryWrapper, InvestOperateRecordEntity.TLB_TASK, params.getTid()); | |||||
| } | |||||
| Collection<InvestOperateRecordVo> resultList = new ArrayList<>(); | |||||
| List<InvestOperateRecordEntity> recordPage = operateRecordService.list(recordQueryWrapper); | |||||
| recordPage.addAll(demandRecord); | |||||
| if (CollectionUtils.isEmpty(recordPage)) { | |||||
| InvestPageResult<InvestOperateRecordEntity> entityPageList = operateRecordService.selectPageByTid(params); | |||||
| if (entityPageList.getSize() == 0) { | |||||
| return investPage; | return investPage; | ||||
| } | } | ||||
| List<InvestOperateRecordEntity> mixRecordPage = recordPage.parallelStream().sorted((o1, o2) -> { | |||||
| if (Objects.equals(o1.getCreateDate(), o2.getCreateDate())) { | |||||
| return 0; | |||||
| } else if (o1.getCreateDate().after(o2.getCreateDate())) { | |||||
| return 1; | |||||
| } else { | |||||
| return -1; | |||||
| } | |||||
| }).collect(Collectors.toList()); | |||||
| Map<Long, MallUserInfo> usersMap = getMap(userInfoService.getByIds(getIds(mixRecordPage, InvestOperateRecordEntity::getOperator)), MallUserInfo::getId); | |||||
| for (InvestOperateRecordEntity recordEntity : mixRecordPage) { | |||||
| List<TableTriple> record = JSONArray.parseArray(recordEntity.getContent(), TableTriple.class); | |||||
| resultList.addAll(getRecordList(recordEntity, record, usersMap.get(recordEntity.getOperator()))); | |||||
| Collection<InvestOperateRecordEntity> recordList = entityPageList.getRecords(); | |||||
| Map<Long, MallUserInfo> usersMap = getMap(userInfoService.getByIds(getIds(recordList, InvestOperateRecordEntity::getOperator)), MallUserInfo::getId); | |||||
| List<InvestOperateRecordVo> resultList = new ArrayList<>(); | |||||
| for (InvestOperateRecordEntity recordEntity : recordList) { | |||||
| InvestOperateRecordVo itemVo = new InvestOperateRecordVo(); | |||||
| BeanUtils.copyProperties(recordEntity, itemVo); | |||||
| MallUserInfo userInfo = usersMap.get(recordEntity.getOperator()); | |||||
| if (Objects.nonNull(userInfo)) { | |||||
| itemVo.setOperatorName(userInfo.getName()); | |||||
| } | |||||
| TableTriple content = JSON.parseObject(recordEntity.getContent(), TableTriple.class); | |||||
| itemVo.setRecord(content); | |||||
| resultList.add(itemVo); | |||||
| } | } | ||||
| BeanUtils.copyProperties(entityPageList, investPage); | |||||
| investPage.setRecords(resultList); | |||||
| return investPage; | return investPage; | ||||
| } | } | ||||
| @@ -6,7 +6,7 @@ import com.iformall.common.TableLog; | |||||
| import com.iformall.domain.po.invest.InvestCustomerEntity; | import com.iformall.domain.po.invest.InvestCustomerEntity; | ||||
| import com.iformall.domain.vo.invest.InvestCustomerVo; | import com.iformall.domain.vo.invest.InvestCustomerVo; | ||||
| import com.iformall.enums.EnumCustomerType; | import com.iformall.enums.EnumCustomerType; | ||||
| import com.iformall.mapper.InvestCustomerDao; | |||||
| import com.iformall.mapper.InvestCustomerMapper; | |||||
| import com.iformall.service.WxBrandService; | import com.iformall.service.WxBrandService; | ||||
| import com.iformall.service.WxBusinessService; | import com.iformall.service.WxBusinessService; | ||||
| import com.iformall.service.invest.InvestCustomerService; | import com.iformall.service.invest.InvestCustomerService; | ||||
| @@ -21,7 +21,7 @@ import java.util.Objects; | |||||
| import static com.iformall.service.invest.InvestHelper.isTrue; | import static com.iformall.service.invest.InvestHelper.isTrue; | ||||
| @Service | @Service | ||||
| public class InvestCustomerServiceImpl extends InvestBaseServiceImpl<InvestCustomerDao, InvestCustomerEntity> implements InvestCustomerService { | |||||
| public class InvestCustomerServiceImpl extends InvestBaseServiceImpl<InvestCustomerMapper, InvestCustomerEntity> implements InvestCustomerService { | |||||
| @Autowired | @Autowired | ||||
| private WxBrandService brandService; | private WxBrandService brandService; | ||||
| @@ -77,6 +77,6 @@ public class InvestCustomerServiceImpl extends InvestBaseServiceImpl<InvestCusto | |||||
| @Override | @Override | ||||
| public List<InvestCustomerVo> listByIds(Collection<? extends Serializable> idList, List<EnumCustomerType> type) { | public List<InvestCustomerVo> listByIds(Collection<? extends Serializable> idList, List<EnumCustomerType> type) { | ||||
| return getBaseMapper().listByIds(idList, type); | |||||
| return super.baseMapper.listByIds(idList,type); | |||||
| } | } | ||||
| } | } | ||||
| @@ -4,11 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.Wrapper; | |||||
| import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; | ||||
| import com.iformall.common.TableLog; | import com.iformall.common.TableLog; | ||||
| import com.iformall.domain.po.invest.InvestDemandEntity; | import com.iformall.domain.po.invest.InvestDemandEntity; | ||||
| import com.iformall.enums.EnumCustomerType; | |||||
| import com.iformall.enums.EnumFollowType; | |||||
| import com.iformall.enums.EnumInvestMessageTag; | |||||
| import com.iformall.enums.EnumInvestMessageType; | |||||
| import com.iformall.mapper.InvestDemandDao; | |||||
| import com.iformall.mapper.InvestDemandMapper; | |||||
| import com.iformall.service.MallUserInfoService; | import com.iformall.service.MallUserInfoService; | ||||
| import com.iformall.service.WxShopService; | import com.iformall.service.WxShopService; | ||||
| import com.iformall.service.invest.InvestCustomerService; | import com.iformall.service.invest.InvestCustomerService; | ||||
| @@ -16,12 +12,11 @@ import com.iformall.service.invest.InvestDemandService; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.springframework.stereotype.Service; | import org.springframework.stereotype.Service; | ||||
| import java.io.Serializable; | |||||
| import java.util.*; | import java.util.*; | ||||
| @Service | @Service | ||||
| public class InvestDemandServiceImpl extends InvestBaseServiceImpl<InvestDemandDao, InvestDemandEntity> implements InvestDemandService { | |||||
| public class InvestDemandServiceImpl extends InvestBaseServiceImpl<InvestDemandMapper, InvestDemandEntity> implements InvestDemandService { | |||||
| @Autowired | @Autowired | ||||
| private WxShopService shopService; | private WxShopService shopService; | ||||
| @@ -4,12 +4,11 @@ import com.baomidou.mybatisplus.core.conditions.Wrapper; | |||||
| import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; | ||||
| import com.iformall.common.ErrorCode; | import com.iformall.common.ErrorCode; | ||||
| import com.iformall.domain.po.invest.InvestFollowRecordEntity; | import com.iformall.domain.po.invest.InvestFollowRecordEntity; | ||||
| import com.iformall.domain.po.invest.InvestTaskEntity; | |||||
| import com.iformall.domain.vo.invest.InvestPageQuery; | import com.iformall.domain.vo.invest.InvestPageQuery; | ||||
| import com.iformall.domain.vo.invest.InvestPageResult; | import com.iformall.domain.vo.invest.InvestPageResult; | ||||
| import com.iformall.domain.vo.invest.InvestUserContext; | import com.iformall.domain.vo.invest.InvestUserContext; | ||||
| import com.iformall.enums.EnumFollowType; | import com.iformall.enums.EnumFollowType; | ||||
| import com.iformall.mapper.InvestFollowRecordDao; | |||||
| import com.iformall.mapper.InvestFollowRecordMapper; | |||||
| import com.iformall.service.invest.InvestDemandService; | import com.iformall.service.invest.InvestDemandService; | ||||
| import com.iformall.service.invest.InvestFollowRecordService; | import com.iformall.service.invest.InvestFollowRecordService; | ||||
| import com.iformall.service.invest.InvestHelper; | import com.iformall.service.invest.InvestHelper; | ||||
| @@ -22,7 +21,7 @@ import java.util.List; | |||||
| import java.util.Objects; | import java.util.Objects; | ||||
| @Service | @Service | ||||
| public class InvestFollowRecordServiceImpl extends InvestBaseServiceImpl<InvestFollowRecordDao, InvestFollowRecordEntity> implements InvestFollowRecordService { | |||||
| public class InvestFollowRecordServiceImpl extends InvestBaseServiceImpl<InvestFollowRecordMapper, InvestFollowRecordEntity> implements InvestFollowRecordService { | |||||
| @Autowired | @Autowired | ||||
| private InvestDemandService demandService ; | private InvestDemandService demandService ; | ||||
| @@ -7,7 +7,7 @@ import com.iformall.domain.po.invest.InvestMessageEntity; | |||||
| import com.iformall.domain.vo.invest.InvestUserContext; | import com.iformall.domain.vo.invest.InvestUserContext; | ||||
| import com.iformall.enums.EnumFollowType; | import com.iformall.enums.EnumFollowType; | ||||
| import com.iformall.enums.EnumInvestMessageTag; | import com.iformall.enums.EnumInvestMessageTag; | ||||
| import com.iformall.mapper.InvestMessageDao; | |||||
| import com.iformall.mapper.InvestMessageMapper; | |||||
| import com.iformall.service.invest.InvestHelper; | import com.iformall.service.invest.InvestHelper; | ||||
| import com.iformall.service.invest.InvestMessageService; | import com.iformall.service.invest.InvestMessageService; | ||||
| import org.springframework.stereotype.Service; | import org.springframework.stereotype.Service; | ||||
| @@ -16,7 +16,7 @@ import java.util.List; | |||||
| @Service | @Service | ||||
| public class InvestMessageServiceImpl extends InvestBaseServiceImpl<InvestMessageDao, InvestMessageEntity> implements InvestMessageService { | |||||
| public class InvestMessageServiceImpl extends InvestBaseServiceImpl<InvestMessageMapper, InvestMessageEntity> implements InvestMessageService { | |||||
| @Override | @Override | ||||
| public boolean save(InvestMessageEntity entity) { | public boolean save(InvestMessageEntity entity) { | ||||
| @@ -2,15 +2,23 @@ package com.iformall.service.invest.impl; | |||||
| import com.baomidou.mybatisplus.core.conditions.Wrapper; | import com.baomidou.mybatisplus.core.conditions.Wrapper; | ||||
| import com.iformall.domain.po.invest.InvestOperateRecordEntity; | import com.iformall.domain.po.invest.InvestOperateRecordEntity; | ||||
| import com.iformall.domain.vo.invest.InvestOperateRecordQuery; | |||||
| import com.iformall.domain.vo.invest.InvestPageQuery; | |||||
| import com.iformall.domain.vo.invest.InvestPageResult; | |||||
| import com.iformall.domain.vo.invest.InvestUserContext; | import com.iformall.domain.vo.invest.InvestUserContext; | ||||
| import com.iformall.mapper.InvestOperateRecordDao; | |||||
| import com.iformall.enums.EnumFollowType; | |||||
| import com.iformall.mapper.InvestOperateRecordMapper; | |||||
| import com.iformall.service.invest.InvestHelper; | import com.iformall.service.invest.InvestHelper; | ||||
| import com.iformall.service.invest.InvestOperateRecordService; | import com.iformall.service.invest.InvestOperateRecordService; | ||||
| import org.springframework.beans.BeanUtils; | |||||
| import org.springframework.stereotype.Service; | import org.springframework.stereotype.Service; | ||||
| import java.util.List; | |||||
| import java.util.Objects; | |||||
| @Service | @Service | ||||
| public class InvestOperateRecordServiceImpl extends InvestBaseServiceImpl<InvestOperateRecordDao, InvestOperateRecordEntity> implements InvestOperateRecordService { | |||||
| public class InvestOperateRecordServiceImpl extends InvestBaseServiceImpl<InvestOperateRecordMapper, InvestOperateRecordEntity> implements InvestOperateRecordService { | |||||
| @Override | @Override | ||||
| public boolean save(InvestOperateRecordEntity entity) { | public boolean save(InvestOperateRecordEntity entity) { | ||||
| @@ -44,4 +52,29 @@ public class InvestOperateRecordServiceImpl extends InvestBaseServiceImpl<Invest | |||||
| return false; | return false; | ||||
| } | } | ||||
| @Override | |||||
| public InvestPageResult<InvestOperateRecordEntity> selectPageByTid(InvestOperateRecordQuery recordQuery) { | |||||
| if (Objects.equals(recordQuery.getRecordType(), EnumFollowType.DEMAND)) { | |||||
| InvestPageResult<InvestOperateRecordEntity> pageResult = new InvestPageResult<>(); | |||||
| long count = super.baseMapper.selectCustomerPageCount(recordQuery.getTid()); | |||||
| if (count == 0) { | |||||
| return pageResult; | |||||
| } | |||||
| pageResult.setTotal(count); | |||||
| pageResult.setSize(recordQuery.getPageSize()); | |||||
| pageResult.setCurrent(recordQuery.getPageNum()); | |||||
| Integer limitStart = (recordQuery.getPageNum() - 1) * recordQuery.getPageSize(); | |||||
| Integer limitSize = recordQuery.getPageSize(); | |||||
| List data = super.baseMapper.selectCustomerPageByTid(recordQuery.getTid(), limitStart, limitSize); | |||||
| pageResult.setRecords(data); | |||||
| return pageResult; | |||||
| } else { | |||||
| InvestOperateRecordEntity params = new InvestOperateRecordEntity(); | |||||
| params.setTid(recordQuery.getTid()); | |||||
| params.setTbl(InvestOperateRecordEntity.TLB_TASK); | |||||
| InvestPageQuery<InvestOperateRecordEntity> pageQuery = new InvestPageQuery<>(params); | |||||
| BeanUtils.copyProperties(recordQuery, pageQuery); | |||||
| return this.queryPage(pageQuery); | |||||
| } | |||||
| } | |||||
| } | } | ||||
| @@ -2,10 +2,9 @@ package com.iformall.service.invest.impl; | |||||
| import com.baomidou.mybatisplus.core.conditions.Wrapper; | import com.baomidou.mybatisplus.core.conditions.Wrapper; | ||||
| import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; | ||||
| import com.baomidou.mybatisplus.extension.service.additional.query.impl.LambdaQueryChainWrapper; | |||||
| import com.iformall.domain.po.invest.InvestRemindEntity; | import com.iformall.domain.po.invest.InvestRemindEntity; | ||||
| import com.iformall.domain.vo.invest.InvestUserContext; | import com.iformall.domain.vo.invest.InvestUserContext; | ||||
| import com.iformall.mapper.InvestRemindDao; | |||||
| import com.iformall.mapper.InvestRemindMapper; | |||||
| import com.iformall.service.invest.InvestRemindService; | import com.iformall.service.invest.InvestRemindService; | ||||
| import org.springframework.stereotype.Service; | import org.springframework.stereotype.Service; | ||||
| @@ -13,7 +12,7 @@ import java.util.Objects; | |||||
| @Service | @Service | ||||
| public class InvestRemindServiceImpl extends InvestBaseServiceImpl<InvestRemindDao, InvestRemindEntity> implements InvestRemindService { | |||||
| public class InvestRemindServiceImpl extends InvestBaseServiceImpl<InvestRemindMapper, InvestRemindEntity> implements InvestRemindService { | |||||
| @Override | @Override | ||||
| public boolean save(InvestRemindEntity entity) { | public boolean save(InvestRemindEntity entity) { | ||||
| @@ -9,7 +9,7 @@ import com.iformall.enums.EnumFollowType; | |||||
| import com.iformall.enums.EnumInvestMessageTag; | import com.iformall.enums.EnumInvestMessageTag; | ||||
| import com.iformall.enums.EnumInvestMessageType; | import com.iformall.enums.EnumInvestMessageType; | ||||
| import com.iformall.enums.EnumTaskStatus; | import com.iformall.enums.EnumTaskStatus; | ||||
| import com.iformall.mapper.InvestTaskDao; | |||||
| import com.iformall.mapper.InvestTaskMapper; | |||||
| import com.iformall.service.MallUserInfoService; | import com.iformall.service.MallUserInfoService; | ||||
| import com.iformall.service.WxShopService; | import com.iformall.service.WxShopService; | ||||
| import com.iformall.service.invest.InvestTaskService; | import com.iformall.service.invest.InvestTaskService; | ||||
| @@ -21,7 +21,7 @@ import java.util.*; | |||||
| @Service | @Service | ||||
| public class InvestTaskServiceImpl extends InvestBaseServiceImpl<InvestTaskDao, InvestTaskEntity> implements InvestTaskService { | |||||
| public class InvestTaskServiceImpl extends InvestBaseServiceImpl<InvestTaskMapper, InvestTaskEntity> implements InvestTaskService { | |||||
| @Autowired | @Autowired | ||||
| private WxShopService shopService; | private WxShopService shopService; | ||||
| @@ -1,7 +1,7 @@ | |||||
| <?xml version="1.0" encoding="UTF-8"?> | <?xml version="1.0" encoding="UTF-8"?> | ||||
| <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | ||||
| <mapper namespace="com.iformall.mapper.InvestCustomerDao"> | |||||
| <mapper namespace="com.iformall.mapper.InvestCustomerMapper"> | |||||
| <!-- 可根据自己的需求,是否要使用 --> | <!-- 可根据自己的需求,是否要使用 --> | ||||
| <resultMap type="com.iformall.domain.po.invest.InvestCustomerEntity" id="investCustomerMap"> | <resultMap type="com.iformall.domain.po.invest.InvestCustomerEntity" id="investCustomerMap"> | ||||
| @@ -18,7 +18,7 @@ | |||||
| <result property="updateDate" column="update_date"/> | <result property="updateDate" column="update_date"/> | ||||
| </resultMap> | </resultMap> | ||||
| <select id="listByIds" parameterType="long" resultType="com.iformall.domain.vo.invest.InvestCustomerVo"> | |||||
| <select id="listByIds" resultType="com.iformall.domain.vo.invest.InvestCustomerVo"> | |||||
| select c.*,d.`id` as demandId,d.`owner` as demandOwner | select c.*,d.`id` as demandId,d.`owner` as demandOwner | ||||
| from `invest_follow_record` f | from `invest_follow_record` f | ||||
| LEFT JOIN `invest_demand` d ON d.id = f.`follow_id` | LEFT JOIN `invest_demand` d ON d.id = f.`follow_id` | ||||
| @@ -1,7 +1,7 @@ | |||||
| <?xml version="1.0" encoding="UTF-8"?> | <?xml version="1.0" encoding="UTF-8"?> | ||||
| <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | ||||
| <mapper namespace="com.iformall.mapper.InvestDemandDao"> | |||||
| <mapper namespace="com.iformall.mapper.InvestDemandMapper"> | |||||
| <!-- 可根据自己的需求,是否要使用 --> | <!-- 可根据自己的需求,是否要使用 --> | ||||
| <resultMap type="com.iformall.domain.po.invest.InvestDemandEntity" id="investDemandMap"> | <resultMap type="com.iformall.domain.po.invest.InvestDemandEntity" id="investDemandMap"> | ||||
| @@ -1,7 +1,7 @@ | |||||
| <?xml version="1.0" encoding="UTF-8"?> | <?xml version="1.0" encoding="UTF-8"?> | ||||
| <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | ||||
| <mapper namespace="com.iformall.mapper.InvestFollowRecordDao"> | |||||
| <mapper namespace="com.iformall.mapper.InvestFollowRecordMapper"> | |||||
| <!-- 可根据自己的需求,是否要使用 --> | <!-- 可根据自己的需求,是否要使用 --> | ||||
| <resultMap type="com.iformall.domain.po.invest.InvestFollowRecordEntity" id="investFollowRecordMap"> | <resultMap type="com.iformall.domain.po.invest.InvestFollowRecordEntity" id="investFollowRecordMap"> | ||||
| @@ -1,7 +1,7 @@ | |||||
| <?xml version="1.0" encoding="UTF-8"?> | <?xml version="1.0" encoding="UTF-8"?> | ||||
| <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | ||||
| <mapper namespace="com.iformall.mapper.InvestMessageDao"> | |||||
| <mapper namespace="com.iformall.mapper.InvestMessageMapper"> | |||||
| <!-- 可根据自己的需求,是否要使用 --> | <!-- 可根据自己的需求,是否要使用 --> | ||||
| <resultMap type="com.iformall.domain.po.invest.InvestMessageEntity" id="investMessageMap"> | <resultMap type="com.iformall.domain.po.invest.InvestMessageEntity" id="investMessageMap"> | ||||
| @@ -1,19 +0,0 @@ | |||||
| <?xml version="1.0" encoding="UTF-8"?> | |||||
| <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | |||||
| <mapper namespace="com.iformall.mapper.InvestOperateRecordDao"> | |||||
| <!-- 可根据自己的需求,是否要使用 --> | |||||
| <resultMap type="com.iformall.domain.po.invest.InvestOperateRecordEntity" id="investOperateRecordMap"> | |||||
| <result property="id" column="id"/> | |||||
| <result property="tenantId" column="tenant_id"/> | |||||
| <result property="tbl" column="tbl"/> | |||||
| <result property="tid" column="tid"/> | |||||
| <result property="operator" column="operator"/> | |||||
| <result property="operateType" column="operate_type"/> | |||||
| <result property="content" column="content"/> | |||||
| <result property="createDate" column="create_date"/> | |||||
| </resultMap> | |||||
| </mapper> | |||||
| @@ -0,0 +1,74 @@ | |||||
| <?xml version="1.0" encoding="UTF-8"?> | |||||
| <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | |||||
| <mapper namespace="com.iformall.mapper.InvestOperateRecordMapper"> | |||||
| <!-- 可根据自己的需求,是否要使用 --> | |||||
| <resultMap type="com.iformall.domain.po.invest.InvestOperateRecordEntity" id="investOperateRecordMap"> | |||||
| <result property="id" column="id"/> | |||||
| <result property="tenantId" column="tenant_id"/> | |||||
| <result property="tbl" column="tbl"/> | |||||
| <result property="tid" column="tid"/> | |||||
| <result property="operator" column="operator"/> | |||||
| <result property="operateType" column="operate_type"/> | |||||
| <result property="content" column="content"/> | |||||
| <result property="createDate" column="create_date"/> | |||||
| </resultMap> | |||||
| <select id="selectCustomerPageCount" resultType="long"> | |||||
| SELECT count(*) | |||||
| FROM (SELECT o.`id`, | |||||
| o.`tbl`, | |||||
| d.`customer_id` AS tid, | |||||
| o.`operator`, | |||||
| o.`operate_type`, | |||||
| o.`content`, | |||||
| o.`tenant_id`, | |||||
| o.`create_date` | |||||
| FROM `invest_operate_record` o | |||||
| LEFT JOIN `invest_demand` d ON d.`id` = o.`tid` | |||||
| WHERE tbl = 'invest_demand' | |||||
| UNION ALL | |||||
| SELECT `id`, | |||||
| `tbl`, | |||||
| `tid`, | |||||
| `operator`, | |||||
| `operate_type`, | |||||
| `content`, | |||||
| `tenant_id`, | |||||
| `create_date` | |||||
| FROM `invest_operate_record` o | |||||
| WHERE o.tbl = 'invest_customer') t | |||||
| WHERE t.`tid` = #{tid} | |||||
| </select> | |||||
| <select id="selectCustomerPageByTid" resultMap="investOperateRecordMap"> | |||||
| SELECT t.* | |||||
| FROM (SELECT o.`id`, | |||||
| o.`tbl`, | |||||
| d.`customer_id` AS tid, | |||||
| o.`operator`, | |||||
| o.`operate_type`, | |||||
| o.`content`, | |||||
| o.`tenant_id`, | |||||
| o.`create_date` | |||||
| FROM `invest_operate_record` o | |||||
| LEFT JOIN `invest_demand` d ON d.`id` = o.`tid` | |||||
| WHERE tbl = 'invest_demand' | |||||
| UNION ALL | |||||
| SELECT `id`, | |||||
| `tbl`, | |||||
| `tid`, | |||||
| `operator`, | |||||
| `operate_type`, | |||||
| `content`, | |||||
| `tenant_id`, | |||||
| `create_date` | |||||
| FROM `invest_operate_record` o | |||||
| WHERE o.tbl = 'invest_customer') t | |||||
| WHERE t.`tid` = #{tid} | |||||
| ORDER BY t.`create_date` DESC | |||||
| LIMIT #{limitStart},#{limitSize} | |||||
| </select> | |||||
| </mapper> | |||||
| @@ -1,7 +1,7 @@ | |||||
| <?xml version="1.0" encoding="UTF-8"?> | <?xml version="1.0" encoding="UTF-8"?> | ||||
| <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | ||||
| <mapper namespace="com.iformall.mapper.InvestRemindDao"> | |||||
| <mapper namespace="com.iformall.mapper.InvestRemindMapper"> | |||||
| <!-- 可根据自己的需求,是否要使用 --> | <!-- 可根据自己的需求,是否要使用 --> | ||||
| <resultMap type="com.iformall.domain.po.invest.InvestRemindEntity" id="investRemindMap"> | <resultMap type="com.iformall.domain.po.invest.InvestRemindEntity" id="investRemindMap"> | ||||
| @@ -1,7 +1,7 @@ | |||||
| <?xml version="1.0" encoding="UTF-8"?> | <?xml version="1.0" encoding="UTF-8"?> | ||||
| <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | ||||
| <mapper namespace="com.iformall.mapper.InvestTaskDao"> | |||||
| <mapper namespace="com.iformall.mapper.InvestTaskMapper"> | |||||
| <!-- 可根据自己的需求,是否要使用 --> | <!-- 可根据自己的需求,是否要使用 --> | ||||
| <resultMap type="com.iformall.domain.po.invest.InvestTaskEntity" id="investTaskMap"> | <resultMap type="com.iformall.domain.po.invest.InvestTaskEntity" id="investTaskMap"> | ||||