diff --git a/mallinkAdmin/src/main/java/com/iformall/controller/invest/InvestDemandController.java b/mallinkAdmin/src/main/java/com/iformall/controller/invest/InvestDemandController.java index 6b9f26e15..110a79bcd 100755 --- a/mallinkAdmin/src/main/java/com/iformall/controller/invest/InvestDemandController.java +++ b/mallinkAdmin/src/main/java/com/iformall/controller/invest/InvestDemandController.java @@ -2,8 +2,7 @@ package com.iformall.controller.invest; import com.iformall.annotation.SystemServiceLog; import com.iformall.common.InvestResultData; -import com.iformall.domain.dto.InvestDemandDto; -import com.iformall.domain.po.invest.InvestDemandEntity; +import com.iformall.domain.dto.InvestCustomerDto; import com.iformall.domain.vo.invest.InvestDemandVo; import com.iformall.domain.vo.invest.InvestPageQuery; import com.iformall.domain.vo.invest.InvestPageResult; @@ -43,7 +42,7 @@ public class InvestDemandController extends InvestBaseController { @SystemServiceLog @ApiOperation(value = "分页列表接口") @GetMapping("/list") - public InvestResultData> list(InvestPageQuery params) { + public InvestResultData> list(InvestPageQuery params) { return execute(params, p -> investBizService.queryPageDemand(p)); } @@ -62,7 +61,7 @@ public class InvestDemandController extends InvestBaseController { */ @SystemServiceLog @PostMapping("/save") - public InvestResultData save(@RequestBody InvestDemandDto investDemand) { + public InvestResultData save(@RequestBody InvestCustomerDto investDemand) { return execute(investDemand, p -> investBizService.saveCustomerAndDemand(p)); } @@ -71,7 +70,7 @@ public class InvestDemandController extends InvestBaseController { */ @SystemServiceLog @PostMapping("/update") - public InvestResultData update(@RequestBody InvestDemandDto investDemand) { + public InvestResultData update(@RequestBody InvestCustomerDto investDemand) { return execute(investDemand, p -> investBizService.updateCustomerAndDemand(p)); } diff --git a/mallinkAdmin/src/main/java/com/iformall/controller/invest/InvestRemindController.java b/mallinkAdmin/src/main/java/com/iformall/controller/invest/InvestRemindController.java index ddaf3eced..50cd857f7 100755 --- a/mallinkAdmin/src/main/java/com/iformall/controller/invest/InvestRemindController.java +++ b/mallinkAdmin/src/main/java/com/iformall/controller/invest/InvestRemindController.java @@ -53,7 +53,7 @@ public class InvestRemindController extends InvestBaseController { /** * 保存 */ - @RequiresPermissions("investFollowRecordEdit") + //@RequiresPermissions("investFollowRecordEdit") @PostMapping("/save") public InvestResultData save(@RequestBody InvestRemindEntity investRemind) { return execute(investRemind, p -> investRemindService.save(p)); diff --git a/mallinkAdmin/src/main/java/com/iformall/controller/invest/InvestTaskController.java b/mallinkAdmin/src/main/java/com/iformall/controller/invest/InvestTaskController.java index 8eeb765a4..a937b5574 100755 --- a/mallinkAdmin/src/main/java/com/iformall/controller/invest/InvestTaskController.java +++ b/mallinkAdmin/src/main/java/com/iformall/controller/invest/InvestTaskController.java @@ -45,7 +45,6 @@ public class InvestTaskController extends InvestBaseController { return execute(params, p -> bizService.queryPageTask(p)); } - /** * 信息 */ @@ -58,7 +57,7 @@ public class InvestTaskController extends InvestBaseController { /** * 保存 */ - @RequiresPermissions("investTaskEdit") + //@RequiresPermissions("investTaskEdit") @SystemServiceLog @PostMapping("/save") public InvestResultData save(@RequestBody InvestTaskEntity investTask) { diff --git a/mallinkService/src/main/java/com/iformall/domain/dto/InvestCustomerDto.java b/mallinkService/src/main/java/com/iformall/domain/dto/InvestCustomerDto.java new file mode 100644 index 000000000..2dd24b051 --- /dev/null +++ b/mallinkService/src/main/java/com/iformall/domain/dto/InvestCustomerDto.java @@ -0,0 +1,18 @@ +package com.iformall.domain.dto; + +import com.iformall.common.LogColumn; +import com.iformall.domain.po.invest.InvestCustomerEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +@Data +@EqualsAndHashCode(callSuper = true) +public class InvestCustomerDto extends InvestCustomerEntity { + + /** + * 负责人 + */ + @io.swagger.annotations.ApiModelProperty(value = "招商负责人", name = "owner") + @LogColumn + private Long owner; +} diff --git a/mallinkService/src/main/java/com/iformall/domain/dto/InvestDemandDto.java b/mallinkService/src/main/java/com/iformall/domain/dto/InvestDemandDto.java deleted file mode 100644 index aac8b5589..000000000 --- a/mallinkService/src/main/java/com/iformall/domain/dto/InvestDemandDto.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.iformall.domain.dto; - -import com.iformall.domain.po.invest.InvestCustomerEntity; -import com.iformall.domain.po.invest.InvestDemandEntity; -import lombok.Data; -import lombok.EqualsAndHashCode; - -@Data -@EqualsAndHashCode(callSuper = true) -public class InvestDemandDto extends InvestDemandEntity { - - @io.swagger.annotations.ApiModelProperty(value = "customer", name = "customer",required = true) - private InvestCustomerEntity customer; -} diff --git a/mallinkService/src/main/java/com/iformall/enums/EnumCustomerRatingType.java b/mallinkService/src/main/java/com/iformall/enums/EnumCustomerRatingType.java index 1a638d05c..144e5b95b 100644 --- a/mallinkService/src/main/java/com/iformall/enums/EnumCustomerRatingType.java +++ b/mallinkService/src/main/java/com/iformall/enums/EnumCustomerRatingType.java @@ -7,7 +7,7 @@ import com.fasterxml.jackson.annotation.JsonValue; * 客户预评级:0-无;1-主力店;2-次主力店;3-甲;4-乙;5-丙 */ public enum EnumCustomerRatingType { - NULL(0, ""), + NONE(0, ""), MAIN(1, "主力店"), SECONDARY(2, "次主力店"), THIRD(3, "甲"), diff --git a/mallinkService/src/main/java/com/iformall/service/invest/InvestBizService.java b/mallinkService/src/main/java/com/iformall/service/invest/InvestBizService.java index 7783347dd..1d01c9274 100644 --- a/mallinkService/src/main/java/com/iformall/service/invest/InvestBizService.java +++ b/mallinkService/src/main/java/com/iformall/service/invest/InvestBizService.java @@ -1,7 +1,6 @@ package com.iformall.service.invest; -import com.iformall.domain.dto.InvestDemandDto; -import com.iformall.domain.po.invest.InvestDemandEntity; +import com.iformall.domain.dto.InvestCustomerDto; import com.iformall.domain.po.invest.InvestFollowRecordEntity; import com.iformall.domain.po.invest.InvestTaskEntity; import com.iformall.domain.po.MallUserInfo; @@ -11,7 +10,7 @@ import java.util.List; public interface InvestBizService { - InvestPageResult queryPageDemand(InvestPageQuery params); + InvestPageResult queryPageDemand(InvestPageQuery params); InvestPageResult queryPageTask(InvestPageQuery params); @@ -19,9 +18,9 @@ public interface InvestBizService { List queryUserList() ; - boolean saveCustomerAndDemand(InvestDemandDto customerDemandDto) ; + boolean saveCustomerAndDemand(InvestCustomerDto customerDemandDto) ; - boolean updateCustomerAndDemand(InvestDemandDto demandDto) ; + boolean updateCustomerAndDemand(InvestCustomerDto demandDto) ; InvestDemandVo findDemandById(Long id) ; diff --git a/mallinkService/src/main/java/com/iformall/service/invest/impl/InvestBizServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/invest/impl/InvestBizServiceImpl.java index fb07f7d49..8dcc9b7c1 100644 --- a/mallinkService/src/main/java/com/iformall/service/invest/impl/InvestBizServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/invest/impl/InvestBizServiceImpl.java @@ -4,7 +4,7 @@ import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONArray; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.iformall.domain.dto.InvestDemandDto; +import com.iformall.domain.dto.InvestCustomerDto; import com.iformall.domain.po.*; import com.iformall.domain.po.invest.InvestCustomerEntity; import com.iformall.domain.po.invest.InvestDemandEntity; @@ -47,14 +47,19 @@ public class InvestBizServiceImpl implements InvestBizService { private MallUserInfoService userInfoService; @Override - public InvestPageResult queryPageDemand(InvestPageQuery params) { - InvestDemandDto queryDemand = params.getQueryData(); + public InvestPageResult queryPageDemand(InvestPageQuery params) { + InvestCustomerDto queryParams = params.getQueryData(); + InvestDemandEntity queryDemand = null; + if (Objects.nonNull(queryParams)) { + queryDemand = new InvestDemandEntity(); + queryDemand.setOwner(queryParams.getOwner()); + } InvestPageResult demandPage = demandService.queryPage(new InvestPageQuery<>(queryDemand)); InvestPageResult investPage = new InvestPageResult<>(); if (CollectionUtils.isEmpty(demandPage.getRecords())) { return investPage; } - List resultList = getTargeInfoList(demandPage, queryDemand.getCustomer()); + List resultList = getTargeInfoList(demandPage, queryParams); BeanUtils.copyProperties(demandPage, investPage); investPage.setRecords(resultList); return investPage; @@ -139,10 +144,10 @@ public class InvestBizServiceImpl implements InvestBizService { @Transactional(rollbackFor = Exception.class) @Override - public boolean saveCustomerAndDemand(InvestDemandDto demandDto) { + public boolean saveCustomerAndDemand(InvestCustomerDto demandDto) { InvestHelper.notNull(demandDto); - InvestCustomerEntity customerEntity = demandDto.getCustomer(); - InvestCustomerEntity customerEntityDB = customerService.getById(demandDto.getCustomerId()); + InvestCustomerEntity customerEntity = demandDto; + InvestCustomerEntity customerEntityDB = customerService.getById(demandDto.getId()); if (Objects.nonNull(customerEntity)) { if (Objects.isNull(customerEntityDB)) { customerService.save(customerEntity); @@ -158,9 +163,9 @@ public class InvestBizServiceImpl implements InvestBizService { @Transactional(rollbackFor = Exception.class) @Override - public boolean updateCustomerAndDemand(InvestDemandDto demandDto) { - InvestHelper.notNull(demandDto, demandDto.getCustomerId()); - InvestCustomerEntity customerEntity = demandDto.getCustomer(); + public boolean updateCustomerAndDemand(InvestCustomerDto demandDto) { + InvestHelper.notNull(demandDto, demandDto.getId()); + InvestCustomerEntity customerEntity = demandDto; InvestHelper.notNull(customerEntity); customerService.updateById(customerEntity); InvestDemandEntity demandEntity = new InvestDemandEntity(); @@ -192,8 +197,7 @@ public class InvestBizServiceImpl implements InvestBizService { InvestFollowRecordEntity followRecordEntity = followRecordService.getByIdNotNull(id); InvestCustomerEntity customerEntity = customerService.getByIdNotNull(followRecordEntity.getCustomerId()); WxBrand brand = brandService.getById(customerEntity.getBrandId()); - InvestFollowRecordVo followRecordVo = buildFollowRecordItem(usersMap, followRecordEntity, customerEntity, brand); - return followRecordVo; + return buildFollowRecordItem(usersMap, followRecordEntity, customerEntity, brand); } private InvestFollowRecordVo buildFollowRecordItem(Map usersMap, InvestFollowRecordEntity item, InvestCustomerEntity customerEntity, WxBrand brand) {