| @@ -50,7 +50,7 @@ public class InvestDemandController { | |||||
| return new InvestResultData(e.getErrorCode(), e.getMessage()); | return new InvestResultData(e.getErrorCode(), e.getMessage()); | ||||
| } catch (Exception e) { | } catch (Exception e) { | ||||
| log.error("list error", e); | log.error("list error", e); | ||||
| return new InvestResultData(ErrorCode.SYS_BEAN_EMPTY_PROPERTY_ERROR); | |||||
| return new InvestResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); | |||||
| } | } | ||||
| } | } | ||||
| @@ -47,7 +47,7 @@ public class InvestFollowRecordController { | |||||
| return new InvestResultData(e.getErrorCode(), e.getMessage()); | return new InvestResultData(e.getErrorCode(), e.getMessage()); | ||||
| } catch (Exception e) { | } catch (Exception e) { | ||||
| log.error("list error", e); | log.error("list error", e); | ||||
| return new InvestResultData(ErrorCode.SYS_BEAN_EMPTY_PROPERTY_ERROR); | |||||
| return new InvestResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); | |||||
| } | } | ||||
| } | } | ||||
| @@ -45,7 +45,7 @@ public class InvestOperateRecordController { | |||||
| /** | /** | ||||
| * 信息 | * 信息 | ||||
| */ | */ | ||||
| @GetMapping("/info/{id}") | |||||
| //@GetMapping("/info/{id}") | |||||
| public ResultData info(@PathVariable("id") Long id){ | public ResultData info(@PathVariable("id") Long id){ | ||||
| InvestOperateRecordEntity investOperateRecord = investOperateRecordService.getById(id); | InvestOperateRecordEntity investOperateRecord = investOperateRecordService.getById(id); | ||||
| @@ -55,7 +55,7 @@ public class InvestOperateRecordController { | |||||
| /** | /** | ||||
| * 保存 | * 保存 | ||||
| */ | */ | ||||
| @PostMapping("/save") | |||||
| //@PostMapping("/save") | |||||
| public ResultData save(@RequestBody InvestOperateRecordEntity investOperateRecord){ | public ResultData save(@RequestBody InvestOperateRecordEntity investOperateRecord){ | ||||
| investOperateRecordService.save(investOperateRecord); | investOperateRecordService.save(investOperateRecord); | ||||
| @@ -65,7 +65,7 @@ public class InvestOperateRecordController { | |||||
| /** | /** | ||||
| * 修改 | * 修改 | ||||
| */ | */ | ||||
| @PostMapping("/update") | |||||
| //@PostMapping("/update") | |||||
| public ResultData update(@RequestBody InvestOperateRecordEntity investOperateRecord){ | public ResultData update(@RequestBody InvestOperateRecordEntity investOperateRecord){ | ||||
| investOperateRecordService.updateById(investOperateRecord); | investOperateRecordService.updateById(investOperateRecord); | ||||
| @@ -75,7 +75,7 @@ public class InvestOperateRecordController { | |||||
| /** | /** | ||||
| * 删除 | * 删除 | ||||
| */ | */ | ||||
| @GetMapping("/delete") | |||||
| //@GetMapping("/delete") | |||||
| public ResultData delete(@RequestBody Long[] ids){ | public ResultData delete(@RequestBody Long[] ids){ | ||||
| investOperateRecordService.removeByIds(Arrays.asList(ids)); | investOperateRecordService.removeByIds(Arrays.asList(ids)); | ||||
| @@ -6,6 +6,7 @@ import com.iformall.annotation.SystemServiceLog; | |||||
| import com.iformall.common.ErrorCode; | import com.iformall.common.ErrorCode; | ||||
| import com.iformall.common.InvestResultData; | import com.iformall.common.InvestResultData; | ||||
| import com.iformall.common.ResultData; | import com.iformall.common.ResultData; | ||||
| import com.iformall.controller.base.BaseController; | |||||
| import com.iformall.domain.po.InvestTaskEntity; | import com.iformall.domain.po.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; | ||||
| @@ -31,7 +32,7 @@ import io.swagger.annotations.ApiOperation; | |||||
| @RestController | @RestController | ||||
| @RequestMapping("invest/task") | @RequestMapping("invest/task") | ||||
| @Api(tags = "招商任务") | @Api(tags = "招商任务") | ||||
| public class InvestTaskController { | |||||
| public class InvestTaskController extends BaseController { | |||||
| @Autowired | @Autowired | ||||
| private InvestTaskService investTaskService; | private InvestTaskService investTaskService; | ||||
| @@ -50,7 +51,7 @@ public class InvestTaskController { | |||||
| return new InvestResultData(e.getErrorCode(), e.getMessage()); | return new InvestResultData(e.getErrorCode(), e.getMessage()); | ||||
| } catch (Exception e) { | } catch (Exception e) { | ||||
| log.error("list error", e); | log.error("list error", e); | ||||
| return new InvestResultData(ErrorCode.SYS_BEAN_EMPTY_PROPERTY_ERROR); | |||||
| return new InvestResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); | |||||
| } | } | ||||
| } | } | ||||
| @@ -21,7 +21,7 @@ import java.util.*; | |||||
| @JsonIgnoreType() | @JsonIgnoreType() | ||||
| @Data | @Data | ||||
| @Slf4j | @Slf4j | ||||
| public class BaseInvestEntity implements Serializable { | |||||
| public class InvestBaseEntity implements Serializable { | |||||
| private static final long serialVersionUID = 1L; | private static final long serialVersionUID = 1L; | ||||
| @@ -17,7 +17,7 @@ import lombok.Data; | |||||
| */ | */ | ||||
| @Data | @Data | ||||
| @TableName("invest_customer") | @TableName("invest_customer") | ||||
| public class InvestCustomerEntity extends BaseInvestEntity { | |||||
| public class InvestCustomerEntity extends InvestBaseEntity { | |||||
| /** | /** | ||||
| * 客户名称 | * 客户名称 | ||||
| @@ -16,7 +16,7 @@ import lombok.Data; | |||||
| */ | */ | ||||
| @Data | @Data | ||||
| @TableName("invest_demand") | @TableName("invest_demand") | ||||
| public class InvestDemandEntity extends BaseInvestEntity { | |||||
| public class InvestDemandEntity extends InvestBaseEntity { | |||||
| /** | /** | ||||
| * 负责人 | * 负责人 | ||||
| @@ -3,7 +3,6 @@ package com.iformall.domain.po; | |||||
| import com.baomidou.mybatisplus.annotation.TableName; | import com.baomidou.mybatisplus.annotation.TableName; | ||||
| import com.fasterxml.jackson.annotation.JsonIgnore; | |||||
| import com.iformall.enums.EnumFollowType; | import com.iformall.enums.EnumFollowType; | ||||
| import lombok.Data; | import lombok.Data; | ||||
| @@ -16,7 +15,7 @@ import lombok.Data; | |||||
| */ | */ | ||||
| @Data | @Data | ||||
| @TableName("invest_follow_record") | @TableName("invest_follow_record") | ||||
| public class InvestFollowRecordEntity extends BaseInvestEntity { | |||||
| public class InvestFollowRecordEntity extends InvestBaseEntity { | |||||
| /** | /** | ||||
| * 主谈人 | * 主谈人 | ||||
| @@ -37,7 +36,12 @@ public class InvestFollowRecordEntity extends BaseInvestEntity { | |||||
| * 跟踪类型:0-招商任务;1-客户需求 | * 跟踪类型:0-招商任务;1-客户需求 | ||||
| */ | */ | ||||
| @io.swagger.annotations.ApiModelProperty(value = "跟踪类型:0-招商任务;1-客户需求", name = "type") | @io.swagger.annotations.ApiModelProperty(value = "跟踪类型:0-招商任务;1-客户需求", name = "type") | ||||
| @JsonIgnore | |||||
| private EnumFollowType type; | private EnumFollowType type; | ||||
| /** | |||||
| * 跟踪类型的主键ID | |||||
| */ | |||||
| @io.swagger.annotations.ApiModelProperty(value = "跟踪类型的主键ID", name = "followId") | |||||
| private Long followId; | |||||
| } | } | ||||
| @@ -19,7 +19,7 @@ import com.fasterxml.jackson.annotation.JsonFormat; | |||||
| */ | */ | ||||
| @Data | @Data | ||||
| @TableName("invest_operate_record") | @TableName("invest_operate_record") | ||||
| public class InvestOperateRecordEntity extends BaseInvestEntity { | |||||
| public class InvestOperateRecordEntity extends InvestBaseEntity { | |||||
| /** | /** | ||||
| * 表名称 | * 表名称 | ||||
| @@ -1,10 +1,7 @@ | |||||
| package com.iformall.domain.po; | package com.iformall.domain.po; | ||||
| import com.baomidou.mybatisplus.annotation.IdType; | |||||
| import com.baomidou.mybatisplus.annotation.TableId; | |||||
| import com.baomidou.mybatisplus.annotation.TableName; | import com.baomidou.mybatisplus.annotation.TableName; | ||||
| import java.io.Serializable; | |||||
| import java.util.Date; | import java.util.Date; | ||||
| import lombok.Data; | import lombok.Data; | ||||
| @@ -19,7 +16,7 @@ import com.fasterxml.jackson.annotation.JsonFormat; | |||||
| */ | */ | ||||
| @Data | @Data | ||||
| @TableName("invest_remind") | @TableName("invest_remind") | ||||
| public class InvestRemindEntity extends BaseInvestEntity { | |||||
| public class InvestRemindEntity extends InvestBaseEntity { | |||||
| /** | /** | ||||
| * 提醒用户 | * 提醒用户 | ||||
| @@ -2,7 +2,6 @@ package com.iformall.domain.po; | |||||
| import com.baomidou.mybatisplus.annotation.TableName; | import com.baomidou.mybatisplus.annotation.TableName; | ||||
| import com.fasterxml.jackson.annotation.JsonIgnore; | |||||
| import com.iformall.enums.EnumInvestType; | import com.iformall.enums.EnumInvestType; | ||||
| import com.iformall.enums.EnumTaskStatus; | import com.iformall.enums.EnumTaskStatus; | ||||
| import lombok.Data; | import lombok.Data; | ||||
| @@ -16,7 +15,7 @@ import lombok.Data; | |||||
| */ | */ | ||||
| @Data | @Data | ||||
| @TableName("invest_task") | @TableName("invest_task") | ||||
| public class InvestTaskEntity extends BaseInvestEntity { | |||||
| public class InvestTaskEntity extends InvestBaseEntity { | |||||
| /** | /** | ||||
| * 负责人 | * 负责人 | ||||
| @@ -25,7 +25,7 @@ public class InvestHelper { | |||||
| * @param shopService | * @param shopService | ||||
| * @param inputEntity | * @param inputEntity | ||||
| */ | */ | ||||
| public static void checkShop(WxShopService shopService, BaseInvestEntity inputEntity) { | |||||
| public static void checkShop(WxShopService shopService, InvestBaseEntity inputEntity) { | |||||
| Long targetId = null; | Long targetId = null; | ||||
| EnumInvestType investType = null; | EnumInvestType investType = null; | ||||
| if (inputEntity instanceof InvestDemandEntity) { | if (inputEntity instanceof InvestDemandEntity) { | ||||
| @@ -6,13 +6,14 @@ import com.baomidou.mybatisplus.core.metadata.IPage; | |||||
| import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | ||||
| import com.iformall.common.ErrorCode; | import com.iformall.common.ErrorCode; | ||||
| import com.iformall.common.TableLog; | import com.iformall.common.TableLog; | ||||
| import com.iformall.domain.po.InvestBaseEntity; | |||||
| import com.iformall.domain.po.InvestFollowRecordEntity; | import com.iformall.domain.po.InvestFollowRecordEntity; | ||||
| import com.iformall.domain.po.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.enums.EnumFollowType; | import com.iformall.enums.EnumFollowType; | ||||
| import com.iformall.exception.MallinkException; | import com.iformall.exception.MallinkException; | ||||
| import com.iformall.mapper.InvestFollowRecordDao; | import com.iformall.mapper.InvestFollowRecordDao; | ||||
| import com.iformall.service.MallUserInfoService; | |||||
| 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; | ||||
| @@ -32,6 +33,8 @@ public class InvestFollowRecordServiceImpl extends ServiceImpl<InvestFollowRecor | |||||
| private InvestDemandService demandService ; | private InvestDemandService demandService ; | ||||
| @Autowired | @Autowired | ||||
| private InvestTaskService taskService ; | private InvestTaskService taskService ; | ||||
| @Autowired | |||||
| private MallUserInfoService userInfoService; | |||||
| @Override | @Override | ||||
| public InvestPageResult<InvestFollowRecordEntity> queryPage(InvestPageQuery<InvestFollowRecordEntity> params) { | public InvestPageResult<InvestFollowRecordEntity> queryPage(InvestPageQuery<InvestFollowRecordEntity> params) { | ||||
| @@ -48,35 +51,43 @@ public class InvestFollowRecordServiceImpl extends ServiceImpl<InvestFollowRecor | |||||
| @TableLog | @TableLog | ||||
| @Override | @Override | ||||
| public boolean save(InvestFollowRecordEntity entity) { | public boolean save(InvestFollowRecordEntity entity) { | ||||
| checkBeforeSaveOrUpdate(entity); | |||||
| return super.save(entity); | return super.save(entity); | ||||
| } | } | ||||
| @TableLog | @TableLog | ||||
| @Override | @Override | ||||
| public boolean update(InvestFollowRecordEntity entity, Wrapper<InvestFollowRecordEntity> updateWrapper) { | public boolean update(InvestFollowRecordEntity entity, Wrapper<InvestFollowRecordEntity> updateWrapper) { | ||||
| checkBeforeSaveOrUpdate(entity); | |||||
| return super.update(entity, updateWrapper); | return super.update(entity, updateWrapper); | ||||
| } | } | ||||
| @TableLog | @TableLog | ||||
| @Override | @Override | ||||
| public boolean saveOrUpdate(InvestFollowRecordEntity entity) { | public boolean saveOrUpdate(InvestFollowRecordEntity entity) { | ||||
| checkBeforeSaveOrUpdate(entity); | |||||
| return super.saveOrUpdate(entity); | return super.saveOrUpdate(entity); | ||||
| } | } | ||||
| @TableLog | @TableLog | ||||
| @Override | @Override | ||||
| public boolean updateById(InvestFollowRecordEntity entity) { | public boolean updateById(InvestFollowRecordEntity entity) { | ||||
| checkBeforeSaveOrUpdate(entity); | |||||
| return super.updateById(entity); | return super.updateById(entity); | ||||
| } | } | ||||
| private void checkBeforeSaveOrUpdate(InvestFollowRecordEntity entity) { | private void checkBeforeSaveOrUpdate(InvestFollowRecordEntity entity) { | ||||
| InvestHelper.checkAllNotNull(entity); | InvestHelper.checkAllNotNull(entity); | ||||
| InvestBaseEntity baseInvestEntity; | |||||
| if(Objects.equals(entity.getType(), EnumFollowType.DEMAND)) { | if(Objects.equals(entity.getType(), EnumFollowType.DEMAND)) { | ||||
| baseInvestEntity = demandService.getById(entity.getFollowId()); | |||||
| } else if(Objects.equals(entity.getType(), EnumFollowType.TASK)) { | } else if(Objects.equals(entity.getType(), EnumFollowType.TASK)) { | ||||
| baseInvestEntity = taskService.getById(entity.getFollowId()); | |||||
| } else { | } else { | ||||
| throw new MallinkException(ErrorCode.SYS_PARAMETER_NOT_NULL) ; | throw new MallinkException(ErrorCode.SYS_PARAMETER_NOT_NULL) ; | ||||
| } | } | ||||
| InvestHelper.checkAllNotNull(baseInvestEntity); | |||||
| InvestHelper.checkUserExit(userInfoService, entity.getOwner()); | |||||
| } | } | ||||
| } | } | ||||