| @@ -41,7 +41,6 @@ public class InvestDemandController extends InvestBaseController { | |||||
| /** | /** | ||||
| * 分页列表 | * 分页列表 | ||||
| */ | */ | ||||
| @RequiresPermissions("investTaskEdit") | |||||
| @SystemServiceLog | @SystemServiceLog | ||||
| @ApiOperation(value = "分页列表接口") | @ApiOperation(value = "分页列表接口") | ||||
| @GetMapping("/list") | @GetMapping("/list") | ||||
| @@ -73,7 +72,7 @@ public class InvestDemandController extends InvestBaseController { | |||||
| */ | */ | ||||
| @SystemServiceLog | @SystemServiceLog | ||||
| @PostMapping("/update") | @PostMapping("/update") | ||||
| public InvestResultData update(@RequestBody InvestDemandVo investDemand) { | |||||
| public InvestResultData update(@RequestBody InvestDemandDto investDemand) { | |||||
| return execute(investDemand, p -> investBizService.updateCustomerAndDemand(p)); | return execute(investDemand, p -> investBizService.updateCustomerAndDemand(p)); | ||||
| } | } | ||||
| @@ -29,6 +29,7 @@ public enum ErrorCode{ | |||||
| SYS_REPEAT_SUBMIT_EXCEPTION(1013, "请勿重复操作"), | SYS_REPEAT_SUBMIT_EXCEPTION(1013, "请勿重复操作"), | ||||
| REPORT_TYPE_UNKNOWN(1014, "不支持的报表类型"), | REPORT_TYPE_UNKNOWN(1014, "不支持的报表类型"), | ||||
| SYS_MCH_NOT_FOUND(1015, "微信商户号未找到"), | SYS_MCH_NOT_FOUND(1015, "微信商户号未找到"), | ||||
| SYS_AUTH_ERROR(1016, "该用户没有权限访问"), | |||||
| /** | /** | ||||
| * 菜单 | * 菜单 | ||||
| @@ -3,6 +3,7 @@ package com.iformall.common; | |||||
| import com.iformall.exception.MallinkException; | import com.iformall.exception.MallinkException; | ||||
| import com.iformall.service.MailService; | import com.iformall.service.MailService; | ||||
| import org.apache.shiro.authz.AuthorizationException; | |||||
| import org.slf4j.Logger; | import org.slf4j.Logger; | ||||
| import org.slf4j.LoggerFactory; | import org.slf4j.LoggerFactory; | ||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
| @@ -63,7 +64,9 @@ public class GlobalDefultExceptionHandler { | |||||
| if(checkExceptionType(e)) { | if(checkExceptionType(e)) { | ||||
| MallinkException me = (MallinkException)e; | MallinkException me = (MallinkException)e; | ||||
| return new ResultData(me.getErrorCode(),me.getMessage()); | return new ResultData(me.getErrorCode(),me.getMessage()); | ||||
| }else { | |||||
| } else if(checkAuthException(e)) { | |||||
| return new ResultData(ErrorCode.SYS_AUTH_ERROR); | |||||
| } else { | |||||
| return new ResultData(Result.ERROR, e.getMessage()); | return new ResultData(Result.ERROR, e.getMessage()); | ||||
| } | } | ||||
| } | } | ||||
| @@ -106,4 +109,8 @@ public class GlobalDefultExceptionHandler { | |||||
| } | } | ||||
| return false; | return false; | ||||
| } | } | ||||
| private boolean checkAuthException(Exception e) { | |||||
| return e instanceof AuthorizationException; | |||||
| } | |||||
| } | } | ||||
| @@ -10,6 +10,7 @@ import com.iformall.enums.EnumCustomerRatingType; | |||||
| import com.iformall.enums.EnumCustomerType; | import com.iformall.enums.EnumCustomerType; | ||||
| import com.iformall.enums.EnumInvestChannel; | import com.iformall.enums.EnumInvestChannel; | ||||
| import lombok.Data; | import lombok.Data; | ||||
| import lombok.EqualsAndHashCode; | |||||
| import java.util.Date; | import java.util.Date; | ||||
| @@ -22,6 +23,7 @@ import java.util.Date; | |||||
| */ | */ | ||||
| @Data | @Data | ||||
| @TableName("invest_customer") | @TableName("invest_customer") | ||||
| @EqualsAndHashCode(callSuper = true) | |||||
| public class InvestCustomerEntity extends InvestBaseEntity { | public class InvestCustomerEntity extends InvestBaseEntity { | ||||
| /** | /** | ||||
| @@ -8,6 +8,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; | |||||
| import com.iformall.common.LogColumn; | import com.iformall.common.LogColumn; | ||||
| import com.iformall.enums.EnumInvestType; | import com.iformall.enums.EnumInvestType; | ||||
| import lombok.Data; | import lombok.Data; | ||||
| import lombok.EqualsAndHashCode; | |||||
| import java.util.Date; | import java.util.Date; | ||||
| @@ -20,6 +21,7 @@ import java.util.Date; | |||||
| */ | */ | ||||
| @Data | @Data | ||||
| @TableName("invest_demand") | @TableName("invest_demand") | ||||
| @EqualsAndHashCode(callSuper = true) | |||||
| public class InvestDemandEntity extends InvestBaseEntity { | public class InvestDemandEntity extends InvestBaseEntity { | ||||
| /** | /** | ||||
| @@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.annotation.TableName; | |||||
| import com.iformall.enums.EnumFollowType; | import com.iformall.enums.EnumFollowType; | ||||
| import lombok.Data; | import lombok.Data; | ||||
| import lombok.EqualsAndHashCode; | |||||
| /** | /** | ||||
| * 跟踪记录 | * 跟踪记录 | ||||
| @@ -15,6 +16,7 @@ import lombok.Data; | |||||
| */ | */ | ||||
| @Data | @Data | ||||
| @TableName("invest_follow_record") | @TableName("invest_follow_record") | ||||
| @EqualsAndHashCode(callSuper = true) | |||||
| public class InvestFollowRecordEntity extends InvestBaseEntity { | public class InvestFollowRecordEntity extends InvestBaseEntity { | ||||
| /** | /** | ||||
| @@ -9,6 +9,7 @@ import com.fasterxml.jackson.annotation.JsonFormat; | |||||
| import com.fasterxml.jackson.annotation.JsonIgnore; | import com.fasterxml.jackson.annotation.JsonIgnore; | ||||
| import com.iformall.enums.EnumTableOperateType; | import com.iformall.enums.EnumTableOperateType; | ||||
| import lombok.Data; | import lombok.Data; | ||||
| import lombok.EqualsAndHashCode; | |||||
| /** | /** | ||||
| * 操作记录 | * 操作记录 | ||||
| @@ -19,6 +20,7 @@ import lombok.Data; | |||||
| */ | */ | ||||
| @Data | @Data | ||||
| @TableName("invest_operate_record") | @TableName("invest_operate_record") | ||||
| @EqualsAndHashCode(callSuper = true) | |||||
| public class InvestOperateRecordEntity extends InvestBaseEntity { | public class InvestOperateRecordEntity extends InvestBaseEntity { | ||||
| /** | /** | ||||
| @@ -6,6 +6,7 @@ import java.util.Date; | |||||
| import lombok.Data; | import lombok.Data; | ||||
| import com.fasterxml.jackson.annotation.JsonFormat; | import com.fasterxml.jackson.annotation.JsonFormat; | ||||
| import lombok.EqualsAndHashCode; | |||||
| /** | /** | ||||
| * 招商提醒 | * 招商提醒 | ||||
| @@ -16,6 +17,7 @@ import com.fasterxml.jackson.annotation.JsonFormat; | |||||
| */ | */ | ||||
| @Data | @Data | ||||
| @TableName("invest_remind") | @TableName("invest_remind") | ||||
| @EqualsAndHashCode(callSuper = true) | |||||
| public class InvestRemindEntity extends InvestBaseEntity { | public class InvestRemindEntity extends InvestBaseEntity { | ||||
| /** | /** | ||||
| @@ -8,6 +8,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; | |||||
| 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; | ||||
| import lombok.EqualsAndHashCode; | |||||
| import java.util.Date; | import java.util.Date; | ||||
| @@ -20,6 +21,7 @@ import java.util.Date; | |||||
| */ | */ | ||||
| @Data | @Data | ||||
| @TableName("invest_task") | @TableName("invest_task") | ||||
| @EqualsAndHashCode(callSuper = true) | |||||
| public class InvestTaskEntity extends InvestBaseEntity { | public class InvestTaskEntity extends InvestBaseEntity { | ||||
| /** | /** | ||||
| @@ -4,11 +4,13 @@ import com.iformall.domain.po.InvestTaskEntity; | |||||
| import com.iformall.domain.po.MallUserInfo; | import com.iformall.domain.po.MallUserInfo; | ||||
| import lombok.Builder; | import lombok.Builder; | ||||
| import lombok.Data; | import lombok.Data; | ||||
| import lombok.EqualsAndHashCode; | |||||
| import java.util.List; | import java.util.List; | ||||
| @Data | @Data | ||||
| @Builder | @Builder | ||||
| @EqualsAndHashCode(callSuper = true) | |||||
| public class InvestTaskVo<T> extends InvestTaskEntity { | public class InvestTaskVo<T> extends InvestTaskEntity { | ||||
| /** | /** | ||||
| @@ -21,7 +21,7 @@ public interface InvestBizService { | |||||
| boolean saveCustomerAndDemand(InvestDemandDto customerDemandDto) ; | boolean saveCustomerAndDemand(InvestDemandDto customerDemandDto) ; | ||||
| boolean updateCustomerAndDemand(InvestDemandVo customerDemandVo) ; | |||||
| boolean updateCustomerAndDemand(InvestDemandDto demandDto) ; | |||||
| InvestDemandVo findDemandById(Long id) ; | InvestDemandVo findDemandById(Long id) ; | ||||
| @@ -129,10 +129,10 @@ public class InvestBizServiceImpl implements InvestBizService { | |||||
| @Transactional(rollbackFor = Exception.class) | @Transactional(rollbackFor = Exception.class) | ||||
| @Override | @Override | ||||
| public boolean saveCustomerAndDemand(InvestDemandDto customerDemandDto) { | |||||
| InvestHelper.allNotNull(customerDemandDto, customerDemandDto.getCustomerId()); | |||||
| InvestCustomerEntity customerEntity = customerDemandDto.getCustomer(); | |||||
| InvestCustomerEntity customerEntityDB = customerService.getById(customerDemandDto.getCustomerId()); | |||||
| public boolean saveCustomerAndDemand(InvestDemandDto demandDto) { | |||||
| InvestHelper.allNotNull(demandDto, demandDto.getCustomerId()); | |||||
| InvestCustomerEntity customerEntity = demandDto.getCustomer(); | |||||
| InvestCustomerEntity customerEntityDB = customerService.getById(demandDto.getCustomerId()); | |||||
| if (Objects.nonNull(customerEntity)) { | if (Objects.nonNull(customerEntity)) { | ||||
| if (Objects.isNull(customerEntityDB)) { | if (Objects.isNull(customerEntityDB)) { | ||||
| customerService.save(customerEntity); | customerService.save(customerEntity); | ||||
| @@ -141,19 +141,19 @@ public class InvestBizServiceImpl implements InvestBizService { | |||||
| } | } | ||||
| } | } | ||||
| InvestDemandEntity demandEntity = new InvestDemandEntity(); | InvestDemandEntity demandEntity = new InvestDemandEntity(); | ||||
| BeanUtils.copyProperties(customerDemandDto, demandEntity); | |||||
| BeanUtils.copyProperties(demandDto, demandEntity); | |||||
| return demandService.save(demandEntity); | return demandService.save(demandEntity); | ||||
| } | } | ||||
| @Transactional(rollbackFor = Exception.class) | @Transactional(rollbackFor = Exception.class) | ||||
| @Override | @Override | ||||
| public boolean updateCustomerAndDemand(InvestDemandVo customerDemandVo) { | |||||
| InvestHelper.allNotNull(customerDemandVo); | |||||
| InvestHelper.allNotNull(customerDemandVo.getBrand(), customerDemandVo.getCustomer()); | |||||
| InvestCustomerEntity customerEntity = customerDemandVo.getCustomer(); | |||||
| public boolean updateCustomerAndDemand(InvestDemandDto demandDto) { | |||||
| InvestHelper.allNotNull(demandDto, demandDto.getCustomerId()); | |||||
| InvestCustomerEntity customerEntity = demandDto.getCustomer(); | |||||
| InvestHelper.allNotNull(customerEntity); | |||||
| customerService.updateById(customerEntity); | customerService.updateById(customerEntity); | ||||
| InvestDemandEntity demandEntity = new InvestDemandEntity(); | InvestDemandEntity demandEntity = new InvestDemandEntity(); | ||||
| BeanUtils.copyProperties(customerDemandVo, demandEntity); | |||||
| BeanUtils.copyProperties(demandDto, demandEntity); | |||||
| return demandService.updateById(demandEntity); | return demandService.updateById(demandEntity); | ||||
| } | } | ||||