From 1e85988c54ed0ede2b68a809d6adf7f9eba5c834 Mon Sep 17 00:00:00 2001 From: xhxu Date: Fri, 15 Jan 2021 09:40:06 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=86=E4=BA=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/mem/WxCUserFromController.java | 55 +++++++++ .../migration/V202101400001__memberImport.sql | 15 +++ .../com/iformall/domain/po/WxCUserFrom.java | 27 +++++ .../iformall/mapper/WxCUserFromMapper.java | 1 + .../iformall/service/WxCUserFromService.java | 3 + .../service/impl/WxCUserFromServiceImpl.java | 5 + .../resources/mapper/WxCUserFromMapper.xml | 106 +++++++++++++++--- 7 files changed, 197 insertions(+), 15 deletions(-) create mode 100644 mallinkAdmin/src/main/java/com/iformall/controller/mem/WxCUserFromController.java create mode 100644 mallinkAdmin/src/main/resources/db/migration/V202101400001__memberImport.sql diff --git a/mallinkAdmin/src/main/java/com/iformall/controller/mem/WxCUserFromController.java b/mallinkAdmin/src/main/java/com/iformall/controller/mem/WxCUserFromController.java new file mode 100644 index 000000000..2026cc142 --- /dev/null +++ b/mallinkAdmin/src/main/java/com/iformall/controller/mem/WxCUserFromController.java @@ -0,0 +1,55 @@ +package com.iformall.controller.mem; + +import com.github.pagehelper.PageInfo; +import com.iformall.annotation.SystemControllerLog; +import com.iformall.common.Result; +import com.iformall.common.ResultData; +import com.iformall.controller.base.BaseController; +import com.iformall.domain.po.WxCUserCar; +import com.iformall.domain.po.WxCUserFrom; +import com.iformall.service.WxCUserCarService; +import com.iformall.service.WxCUserFromService; +import io.swagger.annotations.ApiImplicitParam; +import io.swagger.annotations.ApiImplicitParams; +import io.swagger.annotations.ApiOperation; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +@RestController +@RequestMapping("wxCUserFrom") +public class WxCUserFromController extends BaseController { + private final Logger logger = LoggerFactory.getLogger(this.getClass()); + + @Autowired + private WxCUserFromService wxCUserFromService; + + @ApiOperation("分页列表接口") + @GetMapping("list") + @ApiImplicitParams({ + @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), + @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) + @SystemControllerLog(description = "停车-列表") + public ResultData list(@ModelAttribute WxCUserFrom wxCUserFrom, Integer pageNum, Integer pageSize) { + logger.debug("[" + getIpAddr() + "] WxCUserCarController::list"); + if (null == wxCUserFrom) wxCUserFrom = new WxCUserFrom(); + wxCUserFrom.updateTenantInfo(getTenantInfo()); + final PageInfo page = wxCUserFromService.listAsPage(wxCUserFrom, pageNum, pageSize); + return new ResultData(page); + } + + @ApiOperation("根据id查询接口") + @GetMapping("/visits") + @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) + @SystemControllerLog(description = "停车-查询") + public ResultData visits(@ModelAttribute WxCUserFrom wxCUserFrom,Integer pageNum, Integer pageSize) { + logger.debug("[" + getIpAddr() + "] WxCUserCarController::findById"); + if (null == wxCUserFrom) wxCUserFrom = new WxCUserFrom(); + wxCUserFrom.updateTenantInfo(getTenantInfo()); + final PageInfo page = wxCUserFromService.listAsVisitsPage(wxCUserFrom, pageNum, pageSize); + return new ResultData(page); + } + + +} diff --git a/mallinkAdmin/src/main/resources/db/migration/V202101400001__memberImport.sql b/mallinkAdmin/src/main/resources/db/migration/V202101400001__memberImport.sql new file mode 100644 index 000000000..6cb3a8b32 --- /dev/null +++ b/mallinkAdmin/src/main/resources/db/migration/V202101400001__memberImport.sql @@ -0,0 +1,15 @@ +--加预购菜单 +INSERT INTO `mall_permission`(`id`, `name`, `parent_id`, `available`, `permission`, `resource_type`, `module_color`, `module_color_num`, `url`, `icon`, `version_type`, `sort`) VALUES (514, '推广数据', 5, 'Y', NULL, 1, NULL, NULL, 'memberImport', 'icon-tuiguang', 0, 503); + +--销售类型加权限 +update mall_sale_type set menus = '[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 50, 101, 102, 103, 104, 105, 106, 107, 108, 201, 202, 203, 204, 205, 206, 209, 211, 212, 221, 222, 251, 299, 300, 301, 302, 303, 304, 305, 306, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 501, 502, 503, 504, 505, 506, 507, 508, 509, 511, 512, 513, 514, 521, 522, 523, 531, 532, 533, 591, 592, 595, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 621, 622, 623, 624, 625, 626, 627, 641, 642, 643, 644, 645, 646, 651, 661, 662, 663, 664, 671, 672, 673, 674, 675, 681, 682, 683, 684, 685, 686, 691, 692, 693, 694, 695, 701, 702, 703, 704, 711, 712, 713, 901, 902, 903, 904, 905, 931, 932, 951, 952, 961, 962, 963, 965, 966, 967, 968, 1001, 1002, 1003, 1004]' where id=1; +update mall_sale_type set menus = '[1, 2, 4, 5, 6, 7, 8, 9, 10, 50, 101, 102, 103, 104, 105, 106, 107, 201, 202, 203, 204, 205, 209, 211, 212, 221, 222, 251, 409, 410, 411, 416, 418, 501, 502, 503, 504, 505, 506, 507, 508, 509, 511, 512, 513, 514, 521, 522, 523, 531, 532, 533, 591, 592, 595, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 621, 622, 623, 624, 625, 626, 627, 641, 642, 643, 644, 645, 646, 651, 661, 662, 663, 664, 671, 672, 673, 674, 675, 681, 682, 683, 684, 685, 686, 691, 692, 693, 694, 695, 701, 702, 703, 704, 711, 712, 713, 901, 902, 903, 904, 905, 931, 932, 951, 961]' where id=2; +update mall_sale_type set menus = '[2, 4, 5, 6, 7, 10, 50, 201, 202, 205, 211, 212, 221, 222, 251, 409, 410, 411, 416, 418, 501, 502, 503, 504, 505, 506, 507, 508, 511, 512, 513, 514, 521, 522, 523, 531, 532, 533, 591, 592, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 621, 622, 623, 624, 625, 626, 641, 642, 643, 644, 645, 646, 651, 661, 662, 663, 664, 671, 672, 673, 674, 675, 681, 682, 683, 684, 685, 686, 691, 692, 693, 694, 695, 701, 702, 703, 704, 711, 712, 713, 901, 902, 903, 904, 905, 931, 932]' where id=3; +update mall_sale_type set menus = '[2, 4, 5, 6, 7, 10, 50, 201, 202, 205, 211, 212, 221, 222, 251, 409, 410, 411, 416, 418, 501, 502, 503, 504, 505, 506, 507, 508, 511, 512, 513, 514, 521, 522, 523, 531, 532, 591, 601, 602, 604, 605, 606, 607, 608, 610, 611, 612, 622, 623, 624, 625, 626, 641, 642, 643, 644, 661, 662, 663, 664, 671, 672, 674, 675, 681, 682, 684, 685, 686, 691, 692, 693, 694, 695, 711, 901, 902, 904, 905, 931, 932]' where id=4; + +--所有广场管理员角色加权限 +INSERT INTO `mall_role_permission`(`id`, `tenant_id`, `parent_tenant_id`, `permission_id`, `role_id`) + select CEILING(RAND()*90000000000+10000000000) ,mui.tenant_id,mui.parent_tenant_id, 514,mur.role_id +from mall_user_info mui +left join mall_user_role mur on mui.id = mur.uid +where mui.is_admin = 1 and mur.role_id is not null GROUP BY mur.role_id; diff --git a/mallinkService/src/main/java/com/iformall/domain/po/WxCUserFrom.java b/mallinkService/src/main/java/com/iformall/domain/po/WxCUserFrom.java index cbb56e073..233831a40 100644 --- a/mallinkService/src/main/java/com/iformall/domain/po/WxCUserFrom.java +++ b/mallinkService/src/main/java/com/iformall/domain/po/WxCUserFrom.java @@ -27,6 +27,9 @@ public class WxCUserFrom extends TenantEntity { @TableField(exist = false) @io.swagger.annotations.ApiModelProperty(value="cUserNickName",name="cUserNickName") protected String cUserNickName; + @TableField(exist = false) + @io.swagger.annotations.ApiModelProperty(value="cUserPhone",name="cUserPhone") + protected String cUserPhone; @io.swagger.annotations.ApiModelProperty(value="二维码来源,小程序",name="scene") private String scene; @@ -57,6 +60,9 @@ public class WxCUserFrom extends TenantEntity { @TableField(exist = false) @io.swagger.annotations.ApiModelProperty(value="来源Name",name="fromName") protected String fromName; + @TableField(exist = false) + @io.swagger.annotations.ApiModelProperty(value="来源phone",name="fromPhone") + protected String fromPhone; @io.swagger.annotations.ApiModelProperty(value="是否新用户(0:否1:是)EnumYesOrNo",name="isNewUser") private Integer isNewUser; @@ -97,6 +103,27 @@ public class WxCUserFrom extends TenantEntity { @io.swagger.annotations.ApiModelProperty(value="创建时间",name="createDate") private Date createDate; + + @TableField(exist = false) + @io.swagger.annotations.ApiModelProperty(value="推广人次",name="visits") + private Integer visits; + @TableField(exist = false) + @io.swagger.annotations.ApiModelProperty(value="触达用户",name="reachUser") + private Integer reachUser; + @TableField(exist = false) + @io.swagger.annotations.ApiModelProperty(value="触达新用户",name="newUser") + private Integer newUser; + @TableField(exist = false) + @io.swagger.annotations.ApiModelProperty(value="触达老用户",name="oldUser") + private Integer oldUser; + public Integer getOldUser(){ + if(this.getReachUser() != null && this.getNewUser() != null){ + oldUser = this.getReachUser() - this.getNewUser(); + } + return oldUser; + } + + @TableField(exist = false) protected Date startDate; diff --git a/mallinkService/src/main/java/com/iformall/mapper/WxCUserFromMapper.java b/mallinkService/src/main/java/com/iformall/mapper/WxCUserFromMapper.java index 4605ef943..3ec71ea7d 100644 --- a/mallinkService/src/main/java/com/iformall/mapper/WxCUserFromMapper.java +++ b/mallinkService/src/main/java/com/iformall/mapper/WxCUserFromMapper.java @@ -9,4 +9,5 @@ public interface WxCUserFromMapper extends CommonMapper{ List findList(WxCUserFrom record); + List visits(WxCUserFrom record); } diff --git a/mallinkService/src/main/java/com/iformall/service/WxCUserFromService.java b/mallinkService/src/main/java/com/iformall/service/WxCUserFromService.java index a76053505..ce9c4bd02 100644 --- a/mallinkService/src/main/java/com/iformall/service/WxCUserFromService.java +++ b/mallinkService/src/main/java/com/iformall/service/WxCUserFromService.java @@ -15,6 +15,9 @@ public interface WxCUserFromService { */ PageInfo listAsPage(WxCUserFrom record, Integer pageIndex, Integer pageSize); + PageInfo listAsVisitsPage(WxCUserFrom record, Integer pageIndex, Integer pageSize); void save(WxCUserFrom wxCUserFrom); + + } diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxCUserFromServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxCUserFromServiceImpl.java index b796a887b..2204df1c5 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxCUserFromServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxCUserFromServiceImpl.java @@ -29,6 +29,11 @@ public class WxCUserFromServiceImpl implements WxCUserFromService { return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxCUserFromMapper.findList(record)); } + @Override + public PageInfo listAsVisitsPage(WxCUserFrom record, Integer pageIndex, Integer pageSize) { + return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxCUserFromMapper.visits(record)); + } + @Override public void save(WxCUserFrom wxCUserFrom) { final IdWorker idWorker = IdWorker.get(); diff --git a/mallinkService/src/main/resources/mapper/WxCUserFromMapper.xml b/mallinkService/src/main/resources/mapper/WxCUserFromMapper.xml index 0cb8d9cea..10ba82041 100644 --- a/mallinkService/src/main/resources/mapper/WxCUserFromMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxCUserFromMapper.xml @@ -8,6 +8,7 @@ + @@ -87,23 +88,98 @@ + +