| @@ -1,5 +1,6 @@ | |||
| package com.iformall.config; | |||
| import com.baomidou.mybatisplus.extension.plugins.OptimisticLockerInterceptor; | |||
| import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor; | |||
| import com.iformall.plugin.MultiTenancy; | |||
| import org.springframework.context.annotation.Bean; | |||
| @@ -30,4 +31,9 @@ public class MyBatisConfiguration { | |||
| page.setDialectType("mysql"); | |||
| return page; | |||
| } | |||
| @Bean | |||
| public OptimisticLockerInterceptor optimisticLockerInterceptor() { | |||
| return new OptimisticLockerInterceptor(); | |||
| } | |||
| } | |||
| @@ -19,7 +19,6 @@ import io.swagger.annotations.Api; | |||
| import io.swagger.annotations.ApiOperation; | |||
| /** | |||
| * 需求管理 | |||
| * | |||
| @@ -32,70 +31,70 @@ import io.swagger.annotations.ApiOperation; | |||
| @RequestMapping("invest/demand") | |||
| @Api(tags = "需求管理") | |||
| public class InvestDemandController { | |||
| @Autowired | |||
| private InvestDemandService investDemandService; | |||
| /** | |||
| * 分页列表 | |||
| */ | |||
| @SystemServiceLog | |||
| @ApiOperation(value = "分页列表接口") | |||
| @GetMapping("/list") | |||
| public InvestResultData<InvestPageResult<InvestDemandVo>> list(InvestPageQuery<InvestDemandEntity> params) { | |||
| try { | |||
| InvestPageResult<InvestDemandVo> page = investDemandService.queryPage(params); | |||
| return new InvestResultData(page); | |||
| } catch (MallinkException e) { | |||
| log.error("list error", e); | |||
| return new InvestResultData(e.getErrorCode(), e.getMessage()); | |||
| } catch (Exception e) { | |||
| log.error("list error", e); | |||
| return new InvestResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); | |||
| } | |||
| } | |||
| /** | |||
| * 信息 | |||
| */ | |||
| @SystemServiceLog | |||
| @GetMapping("/info/{id}") | |||
| public InvestResultData<InvestDemandVo> info(@PathVariable("id") Long id){ | |||
| InvestDemandVo investDemand = investDemandService.findById(id); | |||
| return new InvestResultData(investDemand); | |||
| } | |||
| /** | |||
| * 保存 | |||
| */ | |||
| @SystemServiceLog | |||
| @PostMapping("/save") | |||
| public ResultData save(InvestDemandVo investDemand) { | |||
| investDemandService.saveCustomerAndDemand(investDemand); | |||
| return new ResultData(); | |||
| } | |||
| /** | |||
| * 修改 | |||
| */ | |||
| @SystemServiceLog | |||
| @PostMapping("/update") | |||
| public ResultData update(InvestDemandVo investDemand) { | |||
| investDemandService.updateCustomerAndDemand(investDemand); | |||
| return new ResultData(); | |||
| } | |||
| /** | |||
| * 删除 | |||
| */ | |||
| //@GetMapping("/delete") | |||
| public ResultData delete(Long[] ids) { | |||
| @Autowired | |||
| private InvestDemandService investDemandService; | |||
| /** | |||
| * 分页列表 | |||
| */ | |||
| @SystemServiceLog | |||
| @ApiOperation(value = "分页列表接口") | |||
| @GetMapping("/list") | |||
| public InvestResultData<InvestPageResult<InvestDemandVo>> list(InvestPageQuery<InvestDemandEntity> params) { | |||
| try { | |||
| InvestPageResult<InvestDemandVo> page = investDemandService.queryPage(params); | |||
| return new InvestResultData(page); | |||
| } catch (MallinkException e) { | |||
| log.error("list error", e); | |||
| return new InvestResultData(e.getErrorCode(), e.getMessage()); | |||
| } catch (Exception e) { | |||
| log.error("list error", e); | |||
| return new InvestResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); | |||
| } | |||
| } | |||
| /** | |||
| * 信息 | |||
| */ | |||
| @SystemServiceLog | |||
| @GetMapping("/info/{id}") | |||
| public InvestResultData<InvestDemandVo> info(@PathVariable("id") Long id) { | |||
| InvestDemandVo investDemand = investDemandService.findById(id); | |||
| return new InvestResultData(investDemand); | |||
| } | |||
| /** | |||
| * 保存 | |||
| */ | |||
| @SystemServiceLog | |||
| @PostMapping("/save") | |||
| public ResultData save(InvestDemandVo investDemand) { | |||
| investDemandService.saveCustomerAndDemand(investDemand); | |||
| return new ResultData(); | |||
| } | |||
| /** | |||
| * 修改 | |||
| */ | |||
| @SystemServiceLog | |||
| @PostMapping("/update") | |||
| public ResultData update(InvestDemandVo investDemand) { | |||
| investDemandService.updateCustomerAndDemand(investDemand); | |||
| return new ResultData(); | |||
| } | |||
| /** | |||
| * 删除 | |||
| */ | |||
| //@GetMapping("/delete") | |||
| public ResultData delete(Long[] ids) { | |||
| investDemandService.removeByIds(Arrays.asList(ids)); | |||
| return new ResultData(); | |||
| } | |||
| return new ResultData(); | |||
| } | |||
| } | |||
| @@ -6,10 +6,12 @@ import java.util.List; | |||
| import com.iformall.common.ErrorCode; | |||
| import com.iformall.common.InvestResultData; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.controller.base.BaseController; | |||
| import com.iformall.domain.po.InvestOperateRecordEntity; | |||
| import com.iformall.domain.po.InvestRemindEntity; | |||
| import com.iformall.domain.vo.invest.InvestPageQuery; | |||
| import com.iformall.domain.vo.invest.InvestPageResult; | |||
| import com.iformall.domain.vo.invest.InvestUserContext; | |||
| import com.iformall.exception.MallinkException; | |||
| import com.iformall.service.invest.InvestRemindService; | |||
| import lombok.extern.slf4j.Slf4j; | |||
| @@ -32,7 +34,7 @@ import io.swagger.annotations.ApiOperation; | |||
| @RestController | |||
| @RequestMapping("invest/remind") | |||
| @Api(tags = "招商提醒") | |||
| public class InvestRemindController { | |||
| public class InvestRemindController extends BaseController { | |||
| @Autowired | |||
| private InvestRemindService investRemindService; | |||
| @@ -43,6 +45,7 @@ public class InvestRemindController { | |||
| @GetMapping("/list") | |||
| public InvestResultData<InvestPageResult<InvestRemindEntity>> list(InvestPageQuery<InvestRemindEntity> params) { | |||
| try { | |||
| InvestUserContext.setUser(getUser()); | |||
| InvestPageResult<InvestRemindEntity> page = investRemindService.queryPage(params); | |||
| return new InvestResultData(page); | |||
| } catch (MallinkException e) { | |||
| @@ -51,6 +54,8 @@ public class InvestRemindController { | |||
| } catch (Exception e) { | |||
| log.error("list error", e); | |||
| return new InvestResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); | |||
| } finally { | |||
| InvestUserContext.remove(); | |||
| } | |||
| } | |||
| @@ -3,11 +3,16 @@ package com.iformall.domain.po; | |||
| import com.baomidou.mybatisplus.annotation.TableName; | |||
| import com.baomidou.mybatisplus.annotation.Version; | |||
| import com.fasterxml.jackson.annotation.JsonFormat; | |||
| import com.fasterxml.jackson.annotation.JsonProperty; | |||
| import com.iformall.enums.EnumCustomerRatingType; | |||
| import com.iformall.enums.EnumCustomerType; | |||
| import com.iformall.enums.EnumInvestChannel; | |||
| import lombok.Data; | |||
| import java.util.Date; | |||
| /** | |||
| * 客户列表 | |||
| * | |||
| @@ -56,4 +61,13 @@ public class InvestCustomerEntity extends InvestBaseEntity { | |||
| @io.swagger.annotations.ApiModelProperty(value = "招商渠道:0-无;1-电视;2-广播;3-报纸;4-刊物;5-物联网;6-招商活动;7-中介机构;8-自定义渠道", name = "investChannel") | |||
| private EnumInvestChannel investChannel; | |||
| /** | |||
| * 更新时间 | |||
| */ | |||
| @io.swagger.annotations.ApiModelProperty(value = "更新时间", name = "updateDate", example = "2018-10-01 12:18:48",readOnly = true) | |||
| @JsonProperty(access = JsonProperty.Access.READ_ONLY) | |||
| @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") | |||
| @Version | |||
| private Date updateDate; | |||
| } | |||
| @@ -3,10 +3,14 @@ package com.iformall.domain.po; | |||
| import com.baomidou.mybatisplus.annotation.TableName; | |||
| import com.fasterxml.jackson.annotation.JsonIgnore; | |||
| import com.baomidou.mybatisplus.annotation.Version; | |||
| import com.fasterxml.jackson.annotation.JsonFormat; | |||
| import com.fasterxml.jackson.annotation.JsonProperty; | |||
| import com.iformall.enums.EnumInvestType; | |||
| import lombok.Data; | |||
| import java.util.Date; | |||
| /** | |||
| * 客户需求 | |||
| * | |||
| @@ -38,7 +42,6 @@ public class InvestDemandEntity extends InvestBaseEntity { | |||
| * 目标类型:0-商铺招租;1-其他 | |||
| */ | |||
| @io.swagger.annotations.ApiModelProperty(value = "目标类型:0-商铺招租;1-其他", name = "targetType") | |||
| @JsonIgnore | |||
| private EnumInvestType targetType; | |||
| /** | |||
| * 目标ID | |||
| @@ -46,4 +49,13 @@ public class InvestDemandEntity extends InvestBaseEntity { | |||
| @io.swagger.annotations.ApiModelProperty(value = "目标ID", name = "targetId") | |||
| private Long targetId; | |||
| /** | |||
| * 更新时间 | |||
| */ | |||
| @io.swagger.annotations.ApiModelProperty(value = "更新时间", name = "updateDate", example = "2018-10-01 12:18:48",readOnly = true) | |||
| @JsonProperty(access = JsonProperty.Access.READ_ONLY) | |||
| @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") | |||
| @Version | |||
| private Date updateDate; | |||
| } | |||
| @@ -2,10 +2,15 @@ package com.iformall.domain.po; | |||
| import com.baomidou.mybatisplus.annotation.TableName; | |||
| import com.baomidou.mybatisplus.annotation.Version; | |||
| import com.fasterxml.jackson.annotation.JsonFormat; | |||
| import com.fasterxml.jackson.annotation.JsonProperty; | |||
| import com.iformall.enums.EnumInvestType; | |||
| import com.iformall.enums.EnumTaskStatus; | |||
| import lombok.Data; | |||
| import java.util.Date; | |||
| /** | |||
| * 招商任务 | |||
| * | |||
| @@ -43,4 +48,13 @@ public class InvestTaskEntity extends InvestBaseEntity { | |||
| @io.swagger.annotations.ApiModelProperty(value = "任务设定条件", name = "content") | |||
| private String content; | |||
| /** | |||
| * 更新时间 | |||
| */ | |||
| @io.swagger.annotations.ApiModelProperty(value = "更新时间", name = "updateDate", example = "2018-10-01 12:18:48",readOnly = true) | |||
| @JsonProperty(access = JsonProperty.Access.READ_ONLY) | |||
| @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") | |||
| @Version | |||
| private Date updateDate; | |||
| } | |||
| @@ -114,4 +114,9 @@ public class InvestHelper { | |||
| page.setSearchCount(true); | |||
| return page; | |||
| } | |||
| public static void notSupport() { | |||
| throw new MallinkException(ErrorCode.SYS_METHOD_NOT_SUPPORT); | |||
| } | |||
| } | |||
| @@ -13,6 +13,7 @@ import com.iformall.mapper.InvestCustomerDao; | |||
| import com.iformall.service.WxBrandService; | |||
| import com.iformall.service.WxBusinessService; | |||
| import com.iformall.service.invest.InvestCustomerService; | |||
| import com.iformall.service.invest.InvestHelper; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.stereotype.Service; | |||
| @@ -50,13 +51,15 @@ public class InvestCustomerServiceImpl extends ServiceImpl<InvestCustomerDao, In | |||
| return super.update(entity, updateWrapper); | |||
| } | |||
| @TableLog | |||
| @Deprecated | |||
| @Override | |||
| public boolean saveOrUpdate(InvestCustomerEntity entity) { | |||
| checkBusiness(entity); | |||
| checkBrand(entity); | |||
| checkType(entity); | |||
| return super.saveOrUpdate(entity); | |||
| //checkBusiness(entity); | |||
| //checkBrand(entity); | |||
| //checkType(entity); | |||
| //return super.saveOrUpdate(entity); | |||
| InvestHelper.notSupport(); | |||
| return false ; | |||
| } | |||
| @TableLog | |||
| @@ -4,8 +4,12 @@ import com.baomidou.mybatisplus.core.conditions.Wrapper; | |||
| import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | |||
| import com.baomidou.mybatisplus.core.metadata.IPage; | |||
| import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | |||
| import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | |||
| import com.iformall.common.TableLog; | |||
| import com.iformall.domain.po.*; | |||
| import com.iformall.domain.po.InvestCustomerEntity; | |||
| import com.iformall.domain.po.InvestDemandEntity; | |||
| import com.iformall.domain.po.WxBrand; | |||
| import com.iformall.domain.po.WxShop; | |||
| import com.iformall.domain.vo.invest.InvestDemandVo; | |||
| import com.iformall.domain.vo.invest.InvestPageQuery; | |||
| import com.iformall.domain.vo.invest.InvestPageResult; | |||
| @@ -21,8 +25,6 @@ import org.springframework.beans.BeanUtils; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.stereotype.Service; | |||
| import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | |||
| import java.util.*; | |||
| import java.util.stream.Collectors; | |||
| @@ -142,11 +144,13 @@ public class InvestDemandServiceImpl extends ServiceImpl<InvestDemandDao, Invest | |||
| return super.update(entity, updateWrapper); | |||
| } | |||
| @TableLog | |||
| @Deprecated | |||
| @Override | |||
| public boolean saveOrUpdate(InvestDemandEntity entity) { | |||
| checkBeforeSaveOrUpdate(entity); | |||
| return super.saveOrUpdate(entity); | |||
| //checkBeforeSaveOrUpdate(entity); | |||
| //return super.saveOrUpdate(entity); | |||
| InvestHelper.notSupport(); | |||
| return false ; | |||
| } | |||
| @TableLog | |||
| @@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.Wrapper; | |||
| import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | |||
| import com.baomidou.mybatisplus.core.metadata.IPage; | |||
| import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | |||
| import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | |||
| import com.iformall.common.ErrorCode; | |||
| import com.iformall.common.TableLog; | |||
| import com.iformall.domain.po.InvestBaseEntity; | |||
| @@ -23,8 +24,6 @@ import org.springframework.beans.BeanUtils; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.stereotype.Service; | |||
| import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | |||
| import java.util.Objects; | |||
| @Service | |||
| @@ -65,7 +64,7 @@ public class InvestFollowRecordServiceImpl extends ServiceImpl<InvestFollowRecor | |||
| public boolean update(InvestFollowRecordEntity entity, Wrapper<InvestFollowRecordEntity> updateWrapper) { | |||
| //checkBeforeSaveOrUpdate(entity); | |||
| //return super.update(entity, updateWrapper); | |||
| notSupport(); | |||
| InvestHelper.notSupport(); | |||
| return false; | |||
| } | |||
| @@ -74,7 +73,7 @@ public class InvestFollowRecordServiceImpl extends ServiceImpl<InvestFollowRecor | |||
| public boolean saveOrUpdate(InvestFollowRecordEntity entity) { | |||
| //checkBeforeSaveOrUpdate(entity); | |||
| //return super.saveOrUpdate(entity); | |||
| notSupport(); | |||
| InvestHelper.notSupport(); | |||
| return false; | |||
| } | |||
| @@ -83,7 +82,7 @@ public class InvestFollowRecordServiceImpl extends ServiceImpl<InvestFollowRecor | |||
| public boolean updateById(InvestFollowRecordEntity entity) { | |||
| //checkBeforeSaveOrUpdate(entity); | |||
| //return super.updateById(entity); | |||
| notSupport(); | |||
| InvestHelper.notSupport(); | |||
| return false; | |||
| } | |||
| @@ -101,8 +100,4 @@ public class InvestFollowRecordServiceImpl extends ServiceImpl<InvestFollowRecor | |||
| InvestHelper.checkUserExit(userInfoService, entity.getOwner()); | |||
| } | |||
| private void notSupport() { | |||
| throw new MallinkException(ErrorCode.SYS_METHOD_NOT_SUPPORT); | |||
| } | |||
| } | |||
| @@ -8,6 +8,7 @@ import com.iformall.common.TableLog; | |||
| import com.iformall.domain.po.InvestRemindEntity; | |||
| import com.iformall.domain.vo.invest.InvestPageQuery; | |||
| import com.iformall.domain.vo.invest.InvestPageResult; | |||
| import com.iformall.domain.vo.invest.InvestUserContext; | |||
| import com.iformall.mapper.InvestRemindDao; | |||
| import com.iformall.service.MallUserInfoService; | |||
| import com.iformall.service.invest.InvestHelper; | |||
| @@ -32,7 +33,7 @@ public class InvestRemindServiceImpl extends ServiceImpl<InvestRemindDao, Invest | |||
| Page queryPage = InvestHelper.buildQueryPage(params); | |||
| //2、查询数据 | |||
| InvestRemindEntity queryParams = params.getQueryData(); | |||
| InvestHelper.checkUserExit(userInfoService, queryParams.getOwner()); | |||
| InvestHelper.checkUserExit(userInfoService, InvestUserContext.getUserId()); | |||
| LambdaQueryWrapper<InvestRemindEntity> queryWrapper = new LambdaQueryWrapper<>(queryParams); | |||
| IPage<InvestRemindEntity> taskPage = this.page(queryPage, queryWrapper); | |||
| @@ -4,8 +4,10 @@ import com.baomidou.mybatisplus.core.conditions.Wrapper; | |||
| import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | |||
| import com.baomidou.mybatisplus.core.metadata.IPage; | |||
| import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | |||
| import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | |||
| import com.iformall.common.TableLog; | |||
| import com.iformall.domain.po.*; | |||
| import com.iformall.domain.po.InvestTaskEntity; | |||
| import com.iformall.domain.po.WxShop; | |||
| import com.iformall.domain.vo.invest.InvestPageQuery; | |||
| import com.iformall.domain.vo.invest.InvestPageResult; | |||
| import com.iformall.domain.vo.invest.InvestTaskVo; | |||
| @@ -19,11 +21,12 @@ import org.springframework.beans.BeanUtils; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.stereotype.Service; | |||
| import java.util.*; | |||
| import java.util.ArrayList; | |||
| import java.util.Collection; | |||
| import java.util.List; | |||
| import java.util.Map; | |||
| import java.util.stream.Collectors; | |||
| import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | |||
| @Service | |||
| public class InvestTaskServiceImpl extends ServiceImpl<InvestTaskDao, InvestTaskEntity> implements InvestTaskService { | |||
| @@ -88,11 +91,13 @@ public class InvestTaskServiceImpl extends ServiceImpl<InvestTaskDao, InvestTask | |||
| return super.update(entity, updateWrapper); | |||
| } | |||
| @TableLog | |||
| @Deprecated | |||
| @Override | |||
| public boolean saveOrUpdate(InvestTaskEntity entity) { | |||
| checkBeforeSaveOrUpdate(entity); | |||
| return super.saveOrUpdate(entity); | |||
| //checkBeforeSaveOrUpdate(entity); | |||
| //return super.saveOrUpdate(entity); | |||
| InvestHelper.notSupport(); | |||
| return false ; | |||
| } | |||
| @TableLog | |||