diff --git a/mallinkAdmin/src/main/java/com/iformall/controller/basic/WxShopController.java b/mallinkAdmin/src/main/java/com/iformall/controller/basic/WxShopController.java index 2e3762806..5fa1df207 100644 --- a/mallinkAdmin/src/main/java/com/iformall/controller/basic/WxShopController.java +++ b/mallinkAdmin/src/main/java/com/iformall/controller/basic/WxShopController.java @@ -9,8 +9,16 @@ import com.iformall.common.Result; import com.iformall.common.ResultData; import com.iformall.controller.base.BaseController; import com.iformall.domain.po.WxShop; +import com.iformall.domain.po.WxShopUsers; +import com.iformall.domain.po.WxShopUsersPerson; import com.iformall.domain.po.WxUserDataRule; import com.iformall.domain.po.base.BaseEntity; +import com.iformall.enums.EnumBillAllType; +import com.iformall.enums.EnumCUserBaseInfoSex; +import com.iformall.enums.EnumShopUsersPersonRelax; +import com.iformall.enums.EnumShopUsersPrincipalType; +import com.iformall.enums.EnumShopUsersStatus; +import com.iformall.enums.EnumShopUsersType; import com.iformall.exception.MallinkException; import com.iformall.service.WxShopService; import io.swagger.annotations.ApiImplicitParam; @@ -29,6 +37,9 @@ import java.io.BufferedInputStream; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; import java.util.Map; import java.util.concurrent.TimeUnit; @@ -279,4 +290,146 @@ public class WxShopController extends BaseController { final PageInfo> page = wxShopService.notRentListMapAsPage(wxShop, pageNum, pageSize); return new ResultData(page); } + + + @GetMapping("shopUsersTypes") + public ResultData shopUsersTypes() { + List list = new ArrayList(); + for (EnumShopUsersType t : EnumShopUsersType.values()) { + Map m = new HashMap(); + m.put("id", t.getCode()); + m.put("name", t.getMessage()); + list.add(m); + } + return new ResultData(list); + } + + @GetMapping("shopUsersPrincipalTypes") + public ResultData shopUsersPrincipalTypes() { + List list = new ArrayList(); + for (EnumShopUsersPrincipalType t : EnumShopUsersPrincipalType.values()) { + Map m = new HashMap(); + m.put("id", t.getCode()); + m.put("name", t.getMessage()); + list.add(m); + } + return new ResultData(list); + } + + @GetMapping("shopUsersSex") + public ResultData shopUsersSex() { + List list = new ArrayList(); + for (EnumCUserBaseInfoSex t : EnumCUserBaseInfoSex.values()) { + Map m = new HashMap(); + m.put("id", t.getCode()); + m.put("name", t.getMessage()); + list.add(m); + } + return new ResultData(list); + } + + @ApiOperation("查询店铺当前的用户信息") + @GetMapping("currentShopUsers") + public ResultData currentShopUsers(@ModelAttribute WxShopUsers wxShopUsers) { + if (null == wxShopUsers){ + wxShopUsers = new WxShopUsers(); + } + if (null == wxShopUsers.getShopId()) { + return new ResultData(Result.ERROR,"shopId参数不能为空"); + } + if (null == wxShopUsers.getType()) { + return new ResultData(Result.ERROR,"type参数不能为空"); + } + wxShopUsers.updateTenantInfo(getTenantInfo()); + wxShopUsers.setStatus(EnumShopUsersStatus.LIVE.getCode()); + return new ResultData(wxShopService.getOneShopUsers(wxShopUsers)); + } + + @ApiOperation("更新店铺用户") + @PostMapping("saveShopUsers") + public ResultData saveShopUsers(@RequestBody WxShopUsers wxShopUsers) { + wxShopUsers.updateTenantInfo(getTenantInfo()); + wxShopService.saveOrUpdateShopUsers(wxShopUsers); + return new ResultData(); + } + + @ApiOperation("更新店铺用户") + @PostMapping("changeShopUsers") + public ResultData changeShopUsers(@RequestBody WxShopUsers wxShopUsers) { + wxShopUsers.updateTenantInfo(getTenantInfo()); + wxShopUsers.setStatus(EnumShopUsersStatus.OLD.getCode()); + wxShopService.saveOrUpdateShopUsers(wxShopUsers); + return new ResultData(); + } + + @ApiOperation("删除店铺用户") + @PostMapping("deleteShopUsers") + public ResultData deleteShopUsers(@RequestBody WxShopUsers wxShopUsers) { + wxShopUsers.updateTenantInfo(getTenantInfo()); + wxShopUsers.setStatus(EnumShopUsersStatus.OLD.getCode()); + wxShopService.saveOrUpdateShopUsers(wxShopUsers); + return new ResultData(); + } + + @ApiOperation("未出租商铺分页列表接口") + @GetMapping("shopUsersList") + @ApiImplicitParams({ + @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), + @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) + public ResultData shopUsersList(@ModelAttribute WxShopUsers wxShopUsers, Integer pageNum, Integer pageSize) { + if (null == wxShopUsers){ + wxShopUsers = new WxShopUsers(); + } + wxShopUsers.updateTenantInfo(getTenantInfo()); + wxShopUsers.setSortColumns(BaseEntity.SortField.CreateDate_DESC); + final PageInfo page = wxShopService.shopUsersListAsPage(wxShopUsers, pageNum, pageSize); + return new ResultData(page); + } + + @GetMapping("shopUsersPersonRelax") + public ResultData shopUsersPersonRelax() { + List list = new ArrayList(); + for (EnumShopUsersPersonRelax t : EnumShopUsersPersonRelax.values()) { + if (t.isOwner()) { + Map m = new HashMap(); + m.put("id", t.getCode()); + m.put("name", t.getMessage()); + list.add(m); + } + } + return new ResultData(list); + } + + + @ApiOperation("未出租商铺分页列表接口") + @GetMapping("shopUsersPersonList") + @ApiImplicitParams({ + @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), + @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) + public ResultData shopUsersPersonList(@ModelAttribute WxShopUsersPerson wxShopUsersPerson, Integer pageNum, Integer pageSize) { + if (null == wxShopUsersPerson){ + wxShopUsersPerson = new WxShopUsersPerson(); + } + wxShopUsersPerson.updateTenantInfo(getTenantInfo()); + wxShopUsersPerson.setSortColumns(BaseEntity.SortField.CreateDate_DESC); + final PageInfo page = wxShopService.shopUsersPersonListAsPage(wxShopUsersPerson, pageNum, pageSize); + return new ResultData(page); + } + + @ApiOperation("更新店铺用户") + @PostMapping("saveShopUsersPerson") + public ResultData saveShopUsersPerson(@RequestBody WxShopUsersPerson wxShopUsersPerson) { + wxShopUsersPerson.updateTenantInfo(getTenantInfo()); + wxShopService.saveOrUpdateShopUsersPerson(wxShopUsersPerson); + return new ResultData(); + } + + @ApiOperation("删除店铺用户") + @PostMapping("deleteShopUsersPerson") + public ResultData deleteShopUsersPerson(@RequestBody WxShopUsersPerson wxShopUsersPerson) { + wxShopUsersPerson.updateTenantInfo(getTenantInfo()); + wxShopService.deleteShopUsersPerson(wxShopUsersPerson); + return new ResultData(); + } + } diff --git a/mallinkAdmin/src/main/resources/db/migration/V202409000000001.sql b/mallinkAdmin/src/main/resources/db/migration/V202409000000001.sql index b6f0cf62b..0fe88117c 100644 --- a/mallinkAdmin/src/main/resources/db/migration/V202409000000001.sql +++ b/mallinkAdmin/src/main/resources/db/migration/V202409000000001.sql @@ -225,6 +225,50 @@ ALTER TABLE wx_property_contract DROP COLUMN rent_shop_type; ALTER TABLE wx_property_contract DROP COLUMN contract_type; UPDATE mall_permission SET available = 'N' WHERE id = 222; -UPDATE mall_permission SET NAME = '楼栋商户管理' WHERE id = 221; +UPDATE mall_permission SET NAME = '品牌商户管理' WHERE id = 221; UPDATE mall_permission SET sort = 222 WHERE id = 221; UPDATE mall_permission SET available = 'N' WHERE id = 300; +UPDATE mall_permission SET NAME = '品牌商户录入' WHERE id = 228; + +CREATE TABLE `wx_shop_users` ( + `id` bigint(20) NOT NULL COMMENT '主键ID', + `tenant_id` varchar(5) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '租户ID', + `parent_tenant_id` varchar(5) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '父租户ID', + `shop_id` bigint(20) NOT NULL COMMENT '店铺编号', + `type` int(1) NOT NULL COMMENT '类型', + `principal_type` int(20) NOT NULL COMMENT '主体类型', + `name` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '名称', + `phone` varchar(30) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '电话', + `legal_person` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '法人', + `id_number` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '身份证号', + `sex` int(1) NOT NULL COMMENT '性别', + `link_person` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '联系人', + `begin_date` datetime DEFAULT NULL COMMENT '入住日期', + `end_date` datetime DEFAULT NULL COMMENT '离开日期', + `create_date` datetime NOT NULL COMMENT '创建时间', + `update_date` datetime NOT NULL COMMENT '更新时间', + `status` int(1) NOT NULL DEFAULT '0' COMMENT '状态', + PRIMARY KEY (`id`), + UNIQUE KEY `id_UNIQUE` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC COMMENT='商铺'; + +CREATE TABLE `wx_shop_users_person` ( + `id` bigint(20) NOT NULL COMMENT '主键ID', + `tenant_id` varchar(5) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '租户ID', + `parent_tenant_id` varchar(5) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '父租户ID', + `shop_user_id` bigint(20) NOT NULL COMMENT '店铺人员编号', + `type` int(1) NOT NULL COMMENT '类型', + `name` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '名称', + `phone` varchar(30) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '电话', + `id_number` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '身份证号', + `sex` int(1) NOT NULL COMMENT '性别', + `create_date` datetime NOT NULL COMMENT '创建时间', + `update_date` datetime NOT NULL COMMENT '更新时间', + `releax` int(1) NOT NULL COMMENT '关系', + PRIMARY KEY (`id`), + UNIQUE KEY `id_UNIQUE` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC COMMENT='商铺'; + + + + diff --git a/mallinkService/src/main/java/com/iformall/domain/po/WxShopUsers.java b/mallinkService/src/main/java/com/iformall/domain/po/WxShopUsers.java new file mode 100644 index 000000000..b32a8ed33 --- /dev/null +++ b/mallinkService/src/main/java/com/iformall/domain/po/WxShopUsers.java @@ -0,0 +1,104 @@ +package com.iformall.domain.po; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.iformall.common.SortColumn; +import com.iformall.domain.po.base.TenantEntity; +import com.iformall.enums.EnumCUserBaseInfoSex; +import com.iformall.enums.EnumRentShopType; +import com.iformall.enums.EnumShopUsersPrincipalType; +import com.iformall.enums.EnumShopUsersStatus; +import com.iformall.enums.EnumShopUsersType; + +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.ToString; + +import java.math.BigDecimal; +import java.util.Date; +import java.util.List; + +@TableName(value = "wx_shop_users") +@Data +@ToString(callSuper = true) +@EqualsAndHashCode(callSuper = true) +public class WxShopUsers extends TenantEntity { + + private Long id; + + @io.swagger.annotations.ApiModelProperty(value = "店铺编号", name = "shopId") + private Long shopId; + + @io.swagger.annotations.ApiModelProperty(value = "类型EnumShopUsersType", name = "type") + private Integer type; + @TableField(exist = false) + private String typeName; + public String getTypeName() { + if (null != type) { + return EnumShopUsersType.getEnum(type).getMessage(); + } + return null; + } + + @io.swagger.annotations.ApiModelProperty(value = "主体类型EnumShopUsersPrincipalType", name = "type") + private Integer principalType; + @TableField(exist = false) + private String principalTypeName; + public String getPrincipalTypeName() { + if (null != principalType) { + return EnumShopUsersPrincipalType.getEnum(principalType).getMessage(); + } + return null; + } + + @io.swagger.annotations.ApiModelProperty(value="名称",name="name") + private String name; + + @io.swagger.annotations.ApiModelProperty(value="手机号",name="phone") + private String phone; + + @io.swagger.annotations.ApiModelProperty(value="法人",name="legalPerson") + private String legalPerson; + + @io.swagger.annotations.ApiModelProperty(value="身份证号码",name="idNumber") + private String idNumber; + + @io.swagger.annotations.ApiModelProperty(value="性别EnumCUserBaseInfoSex",name="sex") + private Integer sex; + @TableField(exist = false) + private String sexName; + public String getSexName() { + if (null != sex) { + return EnumCUserBaseInfoSex.getEnum(sex).getMessage(); + } + return null; + } + + @io.swagger.annotations.ApiModelProperty(value="联系人",name="linkPerson") + private String linkPerson; + + @io.swagger.annotations.ApiModelProperty(value="入住日期",name="beginDate") + private Date beginDate; + + @io.swagger.annotations.ApiModelProperty(value="离开日期",name="endDate") + private Date endDate; + + @io.swagger.annotations.ApiModelProperty(value="创建时间",name="createDate") + private Date createDate; + + @io.swagger.annotations.ApiModelProperty(value="更新时间",name="updateDate") + private Date updateDate; + + @Excel(name="状态",width = 20,orderNum = "7",replace = {"未出租_0","已出租_1"}) + @io.swagger.annotations.ApiModelProperty(value="状态(0:未出租, 1:已出租)EnumShopUsersStatus",name="status") + private Integer status; + @TableField(exist = false) + private String statusName; + public String getStatusName() { + if (null != status) { + return EnumShopUsersStatus.getEnum(status).getMessage(); + } + return null; + } +} diff --git a/mallinkService/src/main/java/com/iformall/domain/po/WxShopUsersPerson.java b/mallinkService/src/main/java/com/iformall/domain/po/WxShopUsersPerson.java new file mode 100644 index 000000000..d34258d78 --- /dev/null +++ b/mallinkService/src/main/java/com/iformall/domain/po/WxShopUsersPerson.java @@ -0,0 +1,82 @@ +package com.iformall.domain.po; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.iformall.common.SortColumn; +import com.iformall.domain.po.base.TenantEntity; +import com.iformall.enums.EnumCUserBaseInfoSex; +import com.iformall.enums.EnumRentShopType; +import com.iformall.enums.EnumShopUsersPersonRelax; +import com.iformall.enums.EnumShopUsersPrincipalType; +import com.iformall.enums.EnumShopUsersStatus; +import com.iformall.enums.EnumShopUsersType; + +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.ToString; + +import java.math.BigDecimal; +import java.util.Date; +import java.util.List; + +@TableName(value = "wx_shop_users_person") +@Data +@ToString(callSuper = true) +@EqualsAndHashCode(callSuper = true) +public class WxShopUsersPerson extends TenantEntity { + + private Long id; + + @io.swagger.annotations.ApiModelProperty(value = "店铺人员编号", name = "shopUserId") + private Long shopUserId; + + @io.swagger.annotations.ApiModelProperty(value = "类型EnumShopUsersType", name = "type") + private Integer type; + @TableField(exist = false) + private String typeName; + public String getTypeName() { + if (null != type) { + return EnumShopUsersType.getEnum(type).getMessage(); + } + return null; + } + + @io.swagger.annotations.ApiModelProperty(value="名称",name="name") + private String name; + + @io.swagger.annotations.ApiModelProperty(value="手机号",name="phone") + private String phone; + + @io.swagger.annotations.ApiModelProperty(value="身份证号码",name="idNumber") + private String idNumber; + + @io.swagger.annotations.ApiModelProperty(value="性别EnumCUserBaseInfoSex",name="sex") + private Integer sex; + @TableField(exist = false) + private String sexName; + public String getSexName() { + if (null != sex) { + return EnumCUserBaseInfoSex.getEnum(sex).getMessage(); + } + return null; + } + + @io.swagger.annotations.ApiModelProperty(value="创建时间",name="createDate") + private Date createDate; + + @io.swagger.annotations.ApiModelProperty(value="更新时间",name="updateDate") + private Date updateDate; + + @Excel(name="关系",width = 20,orderNum = "7",replace = {"未出租_0","已出租_1"}) + @io.swagger.annotations.ApiModelProperty(value="关系(0:未出租, 1:已出租)EnumShopUsersPersonRelax",name="releax") + private Integer releax; + @TableField(exist = false) + private String releaxName; + public String getReleaxName() { + if (null != releax) { + return EnumShopUsersPersonRelax.getEnum(releax).getMessage(); + } + return null; + } +} diff --git a/mallinkService/src/main/java/com/iformall/enums/EnumCUserBaseInfoSex.java b/mallinkService/src/main/java/com/iformall/enums/EnumCUserBaseInfoSex.java index 7648a0c23..c77a0c2ff 100644 --- a/mallinkService/src/main/java/com/iformall/enums/EnumCUserBaseInfoSex.java +++ b/mallinkService/src/main/java/com/iformall/enums/EnumCUserBaseInfoSex.java @@ -15,7 +15,14 @@ public enum EnumCUserBaseInfoSex { private Integer code; private String message; - + public static EnumCUserBaseInfoSex getEnum(Integer code) { + for (EnumCUserBaseInfoSex value : values()) { + if (value.getCode().equals(code)) { + return value; + } + } + return null; + } public String getMessage() { return message; diff --git a/mallinkService/src/main/java/com/iformall/enums/EnumShopStatus.java b/mallinkService/src/main/java/com/iformall/enums/EnumShopStatus.java index 361974303..b42b83aff 100644 --- a/mallinkService/src/main/java/com/iformall/enums/EnumShopStatus.java +++ b/mallinkService/src/main/java/com/iformall/enums/EnumShopStatus.java @@ -1,7 +1,6 @@ package com.iformall.enums; /** - * Created by Stormeye on 2018/08/09. */ public enum EnumShopStatus { diff --git a/mallinkService/src/main/java/com/iformall/enums/EnumShopUsersPersonRelax.java b/mallinkService/src/main/java/com/iformall/enums/EnumShopUsersPersonRelax.java new file mode 100644 index 000000000..859427190 --- /dev/null +++ b/mallinkService/src/main/java/com/iformall/enums/EnumShopUsersPersonRelax.java @@ -0,0 +1,46 @@ +package com.iformall.enums; + +/** + */ +public enum EnumShopUsersPersonRelax { + + FRIENDS(1, "亲友",true), + SPOUSE(2, "夫妻",true), + PARENTS(3, "父母",true), + WORKERS(4, "同事",true), + CHILDREN(5, "子女",true), + RENT(6, "租户",false), + ; + + public static EnumShopUsersPersonRelax getEnum(Integer code) { + for (EnumShopUsersPersonRelax value : values()) { + if (value.getCode().equals(code)) { + return value; + } + } + return null; + } + + private Integer code; + private String message; + private boolean isOwner; + + EnumShopUsersPersonRelax(Integer code, String message,boolean isOwner) { + this.code = code; + this.message = message; + this.isOwner = isOwner; + } + + public Integer getCode() { + return code; + } + + public String getMessage() { + return message; + } + + public boolean isOwner() { + return isOwner; + } + +} diff --git a/mallinkService/src/main/java/com/iformall/enums/EnumShopUsersPrincipalType.java b/mallinkService/src/main/java/com/iformall/enums/EnumShopUsersPrincipalType.java new file mode 100644 index 000000000..f0f00a6d2 --- /dev/null +++ b/mallinkService/src/main/java/com/iformall/enums/EnumShopUsersPrincipalType.java @@ -0,0 +1,36 @@ +package com.iformall.enums; + + +/** + */ + +public enum EnumShopUsersPrincipalType { + + PERSON(1, "个人"), + COMPANY(2, "公司"); + + public static EnumShopUsersPrincipalType getEnum(Integer code) { + for (EnumShopUsersPrincipalType value : values()) { + if (value.getCode().equals(code)) { + return value; + } + } + return null; + } + + private Integer code; + private String message; + + EnumShopUsersPrincipalType(Integer code, String message) { + this.code = code; + this.message = message; + } + + public Integer getCode() { + return code; + } + + public String getMessage() { + return message; + } +} diff --git a/mallinkService/src/main/java/com/iformall/enums/EnumShopUsersStatus.java b/mallinkService/src/main/java/com/iformall/enums/EnumShopUsersStatus.java new file mode 100644 index 000000000..b1bbec6a4 --- /dev/null +++ b/mallinkService/src/main/java/com/iformall/enums/EnumShopUsersStatus.java @@ -0,0 +1,35 @@ +package com.iformall.enums; + +/** + */ +public enum EnumShopUsersStatus { + + LIVE(0, "当前"), + OLD(1, "往任"), + ; + + public static EnumShopUsersStatus getEnum(Integer code) { + for (EnumShopUsersStatus value : values()) { + if (value.getCode().equals(code)) { + return value; + } + } + return null; + } + + private Integer code; + private String message; + + EnumShopUsersStatus(Integer code, String message) { + this.code = code; + this.message = message; + } + + public Integer getCode() { + return code; + } + + public String getMessage() { + return message; + } +} diff --git a/mallinkService/src/main/java/com/iformall/enums/EnumShopUsersType.java b/mallinkService/src/main/java/com/iformall/enums/EnumShopUsersType.java new file mode 100644 index 000000000..4d864d545 --- /dev/null +++ b/mallinkService/src/main/java/com/iformall/enums/EnumShopUsersType.java @@ -0,0 +1,36 @@ +package com.iformall.enums; + + +/** + */ + +public enum EnumShopUsersType { + + OWNNER(1, "业主"), + RENTER(2, "租户"); + + public static EnumShopUsersType getEnum(Integer code) { + for (EnumShopUsersType value : values()) { + if (value.getCode().equals(code)) { + return value; + } + } + return null; + } + + private Integer code; + private String message; + + EnumShopUsersType(Integer code, String message) { + this.code = code; + this.message = message; + } + + public Integer getCode() { + return code; + } + + public String getMessage() { + return message; + } +} diff --git a/mallinkService/src/main/java/com/iformall/mapper/WxShopUsersMapper.java b/mallinkService/src/main/java/com/iformall/mapper/WxShopUsersMapper.java new file mode 100644 index 000000000..b6f466b1b --- /dev/null +++ b/mallinkService/src/main/java/com/iformall/mapper/WxShopUsersMapper.java @@ -0,0 +1,12 @@ +package com.iformall.mapper; + +import com.iformall.common.CommonMapper; +import com.iformall.domain.po.WxShopUsers; +import java.util.List; + +/** + */ +public interface WxShopUsersMapper extends CommonMapper { + + List findList(WxShopUsers wxShop); +} diff --git a/mallinkService/src/main/java/com/iformall/mapper/WxShopUsersPersonMapper.java b/mallinkService/src/main/java/com/iformall/mapper/WxShopUsersPersonMapper.java new file mode 100644 index 000000000..3e455571e --- /dev/null +++ b/mallinkService/src/main/java/com/iformall/mapper/WxShopUsersPersonMapper.java @@ -0,0 +1,13 @@ +package com.iformall.mapper; + +import com.iformall.common.CommonMapper; +import com.iformall.domain.po.WxShopUsersPerson; + +import java.util.List; + +/** + */ +public interface WxShopUsersPersonMapper extends CommonMapper { + + List findList(WxShopUsersPerson wxShop); +} diff --git a/mallinkService/src/main/java/com/iformall/service/WxShopService.java b/mallinkService/src/main/java/com/iformall/service/WxShopService.java index 4e38857a2..1721a6627 100644 --- a/mallinkService/src/main/java/com/iformall/service/WxShopService.java +++ b/mallinkService/src/main/java/com/iformall/service/WxShopService.java @@ -5,6 +5,8 @@ import com.github.pagehelper.PageInfo; import com.iformall.common.ResultData; import com.iformall.domain.po.WxMerchant; import com.iformall.domain.po.WxShop; +import com.iformall.domain.po.WxShopUsers; +import com.iformall.domain.po.WxShopUsersPerson; import com.iformall.domain.po.base.TenantEntity; import com.iformall.domain.vo.WxShopVo; @@ -122,5 +124,19 @@ public interface WxShopService { List getMerchantIds(WxShop wxShop); List getShopNumberList(WxShop wxShop); + + WxShopUsers getOneShopUsers(WxShopUsers wxShopUsers); + + void saveOrUpdateShopUsers(WxShopUsers wxShopUsers); + + void deleteShopUsers(WxShopUsers wxShopUsers); + + PageInfo shopUsersListAsPage(WxShopUsers record,Integer pageIndex,Integer pageSize); + + PageInfo shopUsersPersonListAsPage(WxShopUsersPerson record,Integer pageIndex,Integer pageSize); + + void saveOrUpdateShopUsersPerson(WxShopUsersPerson wxShopUsers); + + void deleteShopUsersPerson(WxShopUsersPerson wxShopUsers); } diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxShopServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxShopServiceImpl.java index f9da91e48..364727d18 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxShopServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxShopServiceImpl.java @@ -22,6 +22,8 @@ import com.iformall.mapper.WxMerchantShopMapper; import com.iformall.mapper.WxPropertyContractMapper; import com.iformall.mapper.WxRentContractMapper; import com.iformall.mapper.WxShopMapper; +import com.iformall.mapper.WxShopUsersMapper; +import com.iformall.mapper.WxShopUsersPersonMapper; import com.iformall.service.*; import cn.afterturn.easypoi.excel.ExcelImportUtil; @@ -64,6 +66,12 @@ public class WxShopServiceImpl implements WxShopService { @Autowired WxMerchantShopMapper wxMerchantShopMapper; + + @Autowired + WxShopUsersMapper wxShopUsersMapper; + + @Autowired + WxShopUsersPersonMapper wxShopUsersPersonMapper; @Autowired ExcelService excelService; @@ -939,4 +947,68 @@ public class WxShopServiceImpl implements WxShopService { public List getShopNumberList(WxShop wxShop) { return wxShopMapper.findShopNumberList(wxShop); } + + @Override + public WxShopUsers getOneShopUsers(WxShopUsers wxShopUsers) { + List list = wxShopUsersMapper.findList(wxShopUsers); + if (null != list && list.size() > 0) { + return list.get(0); + } + return null; + } + + @Override + public void saveOrUpdateShopUsers(WxShopUsers record) { + if (record.getId() == null) { + final IdWorker idWorker = IdWorker.get(); + record.setId(idWorker.nextId()); + record.setStatus(EnumShopUsersStatus.LIVE.getCode()); + Date date = new Date(); + record.setUpdateDate(date); + record.setCreateDate(date); + wxShopUsersMapper.insert(record); + }else { + record.setUpdateDate(new Date()); + wxShopUsersMapper.updateById(record); + } + } + + @Override + public void deleteShopUsers(WxShopUsers wxShopUsers) { + wxShopUsersMapper.deleteById(wxShopUsers.getId()); + } + + @Override + public PageInfo shopUsersListAsPage(WxShopUsers record, Integer pageIndex, Integer pageSize) { + return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxShopUsersMapper.findList(record)); + } + + @Override + public PageInfo shopUsersPersonListAsPage(WxShopUsersPerson record, Integer pageIndex, + Integer pageSize) { + return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxShopUsersPersonMapper.findList(record)); + } + + @Override + public void saveOrUpdateShopUsersPerson(WxShopUsersPerson record) { + if (record.getType() == EnumShopUsersType.RENTER.getCode()) { + record.setReleax(EnumShopUsersPersonRelax.RENT.getCode()); + } + if (record.getId() == null) { + final IdWorker idWorker = IdWorker.get(); + record.setId(idWorker.nextId()); + Date date = new Date(); + record.setUpdateDate(date); + record.setCreateDate(date); + wxShopUsersPersonMapper.insert(record); + }else { + record.setUpdateDate(new Date()); + wxShopUsersPersonMapper.updateById(record); + } + } + + @Override + public void deleteShopUsersPerson(WxShopUsersPerson record) { + wxShopUsersPersonMapper.deleteById(record.getId()); + } } diff --git a/mallinkService/src/main/resources/mapper/WxShopUsersMapper.xml b/mallinkService/src/main/resources/mapper/WxShopUsersMapper.xml new file mode 100644 index 000000000..5b6965b73 --- /dev/null +++ b/mallinkService/src/main/resources/mapper/WxShopUsersMapper.xml @@ -0,0 +1,82 @@ + + + + + + + + + + + + + + + + + + + + + + + + + `id`,`tenant_id`,`parent_tenant_id`,`shop_id`,`type`,`principal_type`,`name`,`phone`,`legal_person`,`id_number`,`sex`, + `link_person`,`begin_date`,`end_date`,`create_date`,`update_date`,`status` + + + + where 1=1 + + + and `id` = #{id} + + + + and `tenant_id` = #{tenantId} + + + and `parent_tenant_id` = #{parentTenantId} + + + + and `shop_id` = #{shopId} + + + + and `type` = #{type} + + + + and `principal_type` = #{principalType} + + + + and `name` like concat('%', #{name},'%') + + + + and `phone` like concat('%', #{phone},'%') + + + + and `status` = #{status} + + + + and id in + + #{idItem} + + + order by ${sortColumns} + + + + diff --git a/mallinkService/src/main/resources/mapper/WxShopUsersPersonMapper.xml b/mallinkService/src/main/resources/mapper/WxShopUsersPersonMapper.xml new file mode 100644 index 000000000..97fb25d4e --- /dev/null +++ b/mallinkService/src/main/resources/mapper/WxShopUsersPersonMapper.xml @@ -0,0 +1,76 @@ + + + + + + + + + + + + + + + + + + + + `id`,`tenant_id`,`parent_tenant_id`,`shop_user_id`,`type`,`name`,`phone`,`id_number`,`sex`,`create_date`,`update_date`,`releax` + + + + where 1=1 + + + and `id` = #{id} + + + + and `tenant_id` = #{tenantId} + + + and `parent_tenant_id` = #{parentTenantId} + + + + and `shop_user_id` = #{shopUserId} + + + + and `type` = #{type} + + + + and `sex` = #{sex} + + + + and `name` like concat('%', #{name},'%') + + + + and `phone` like concat('%', #{phone},'%') + + + + and `releax` = #{releax} + + + + and id in + + #{idItem} + + + order by ${sortColumns} + + + +