winter 1 год назад
Родитель
Сommit
ee6d630b26
16 измененных файлов: 816 добавлений и 3 удалений
  1. +153
    -0
      mallinkAdmin/src/main/java/com/iformall/controller/basic/WxShopController.java
  2. +45
    -1
      mallinkAdmin/src/main/resources/db/migration/V202409000000001.sql
  3. +104
    -0
      mallinkService/src/main/java/com/iformall/domain/po/WxShopUsers.java
  4. +82
    -0
      mallinkService/src/main/java/com/iformall/domain/po/WxShopUsersPerson.java
  5. +8
    -1
      mallinkService/src/main/java/com/iformall/enums/EnumCUserBaseInfoSex.java
  6. +0
    -1
      mallinkService/src/main/java/com/iformall/enums/EnumShopStatus.java
  7. +46
    -0
      mallinkService/src/main/java/com/iformall/enums/EnumShopUsersPersonRelax.java
  8. +36
    -0
      mallinkService/src/main/java/com/iformall/enums/EnumShopUsersPrincipalType.java
  9. +35
    -0
      mallinkService/src/main/java/com/iformall/enums/EnumShopUsersStatus.java
  10. +36
    -0
      mallinkService/src/main/java/com/iformall/enums/EnumShopUsersType.java
  11. +12
    -0
      mallinkService/src/main/java/com/iformall/mapper/WxShopUsersMapper.java
  12. +13
    -0
      mallinkService/src/main/java/com/iformall/mapper/WxShopUsersPersonMapper.java
  13. +16
    -0
      mallinkService/src/main/java/com/iformall/service/WxShopService.java
  14. +72
    -0
      mallinkService/src/main/java/com/iformall/service/impl/WxShopServiceImpl.java
  15. +82
    -0
      mallinkService/src/main/resources/mapper/WxShopUsersMapper.xml
  16. +76
    -0
      mallinkService/src/main/resources/mapper/WxShopUsersPersonMapper.xml

+ 153
- 0
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<Map<String, Object>> page = wxShopService.notRentListMapAsPage(wxShop, pageNum, pageSize);
return new ResultData(page);
}
@GetMapping("shopUsersTypes")
public ResultData shopUsersTypes() {
List<Map> list = new ArrayList<Map>();
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<Map> list = new ArrayList<Map>();
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<Map> list = new ArrayList<Map>();
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<WxShopUsers> page = wxShopService.shopUsersListAsPage(wxShopUsers, pageNum, pageSize);
return new ResultData(page);
}
@GetMapping("shopUsersPersonRelax")
public ResultData shopUsersPersonRelax() {
List<Map> list = new ArrayList<Map>();
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<WxShopUsersPerson> 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();
}
}

+ 45
- 1
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='商铺';





+ 104
- 0
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;
}
}

+ 82
- 0
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;
}
}

+ 8
- 1
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;


+ 0
- 1
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 {



+ 46
- 0
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;
}
}

+ 36
- 0
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;
}
}

+ 35
- 0
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;
}
}

+ 36
- 0
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;
}
}

+ 12
- 0
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<WxShopUsers, String> {

List<WxShopUsers> findList(WxShopUsers wxShop);
}

+ 13
- 0
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<WxShopUsersPerson, String> {

List<WxShopUsersPerson> findList(WxShopUsersPerson wxShop);
}

+ 16
- 0
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<Long> getMerchantIds(WxShop wxShop);
List<String> getShopNumberList(WxShop wxShop);
WxShopUsers getOneShopUsers(WxShopUsers wxShopUsers);
void saveOrUpdateShopUsers(WxShopUsers wxShopUsers);
void deleteShopUsers(WxShopUsers wxShopUsers);
PageInfo<WxShopUsers> shopUsersListAsPage(WxShopUsers record,Integer pageIndex,Integer pageSize);
PageInfo<WxShopUsersPerson> shopUsersPersonListAsPage(WxShopUsersPerson record,Integer pageIndex,Integer pageSize);
void saveOrUpdateShopUsersPerson(WxShopUsersPerson wxShopUsers);
void deleteShopUsersPerson(WxShopUsersPerson wxShopUsers);

}

+ 72
- 0
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<String> getShopNumberList(WxShop wxShop) {
return wxShopMapper.findShopNumberList(wxShop);
}

@Override
public WxShopUsers getOneShopUsers(WxShopUsers wxShopUsers) {
List<WxShopUsers> 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<WxShopUsers> shopUsersListAsPage(WxShopUsers record, Integer pageIndex, Integer pageSize) {
return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxShopUsersMapper.findList(record));
}

@Override
public PageInfo<WxShopUsersPerson> 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());
}
}

+ 82
- 0
mallinkService/src/main/resources/mapper/WxShopUsersMapper.xml Просмотреть файл

@@ -0,0 +1,82 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.iformall.mapper.WxShopUsersMapper">
<resultMap id="BaseResultMap" type="com.iformall.domain.po.WxShopUsers">
<id column="id" jdbcType="BIGINT" property="id"/>
<result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/>
<result column="parent_tenant_id" jdbcType="VARCHAR" property="parentTenantId"/>
<result column="shop_id" jdbcType="BIGINT" property="shopId"/>
<result column="type" jdbcType="INTEGER" property="type"/>
<result column="principal_type" jdbcType="INTEGER" property="principalType"/>
<result column="name" jdbcType="VARCHAR" property="name"/>
<result column="phone" jdbcType="VARCHAR" property="phone"/>
<result column="legal_person" jdbcType="VARCHAR" property="legalPerson"/>
<result column="id_number" jdbcType="VARCHAR" property="idNumber"/>
<result column="sex" jdbcType="INTEGER" property="sex"/>
<result column="link_person" jdbcType="VARCHAR" property="linkPerson"/>
<result column="begin_date" jdbcType="TIMESTAMP" property="beginDate"/>
<result column="end_date" jdbcType="TIMESTAMP" property="endDate"/>
<result column="create_date" jdbcType="TIMESTAMP" property="createDate"/>
<result column="update_date" jdbcType="TIMESTAMP" property="updateDate"/>
<result column="status" jdbcType="INTEGER" property="status"/>
</resultMap>

<sql id="allColumns">
`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`
</sql>

<sql id="dynamicWhereConditions">
where 1=1

<if test=" null != id ">
and `id` = #{id}
</if>

<if test=" null != tenantId and '' != tenantId">
and `tenant_id` = #{tenantId}
</if>
<if test=" null != parentTenantId and '' != parentTenantId">
and `parent_tenant_id` = #{parentTenantId}
</if>

<if test=" null != shopId">
and `shop_id` = #{shopId}
</if>
<if test=" null != type">
and `type` = #{type}
</if>
<if test=" null != principalType">
and `principal_type` = #{principalType}
</if>
<if test=" null != name and name != '' ">
and `name` like concat('%', #{name},'%')
</if>
<if test=" null != phone and phone != '' ">
and `phone` like concat('%', #{phone},'%')
</if>
<if test=" null != status">
and `status` = #{status}
</if>

<if test=" null != ids ">
and id in
<foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
#{idItem}
</foreach>
</if>
<if test=" null != sortColumns">order by ${sortColumns}</if>
</sql>

<select id="findList" parameterType="com.iformall.domain.po.WxShopUsers" resultMap="BaseResultMap">
select
<include refid="allColumns"/>
from wx_shop_users
<include refid="dynamicWhereConditions"/>
</select>
</mapper>

+ 76
- 0
mallinkService/src/main/resources/mapper/WxShopUsersPersonMapper.xml Просмотреть файл

@@ -0,0 +1,76 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.iformall.mapper.WxShopUsersPersonMapper">
<resultMap id="BaseResultMap" type="com.iformall.domain.po.WxShopUsersPerson">
<id column="id" jdbcType="BIGINT" property="id"/>
<result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/>
<result column="parent_tenant_id" jdbcType="VARCHAR" property="parentTenantId"/>
<result column="shop_user_id" jdbcType="BIGINT" property="shopUserId"/>
<result column="type" jdbcType="INTEGER" property="type"/>
<result column="name" jdbcType="VARCHAR" property="name"/>
<result column="phone" jdbcType="VARCHAR" property="phone"/>
<result column="id_number" jdbcType="VARCHAR" property="idNumber"/>
<result column="sex" jdbcType="INTEGER" property="sex"/>
<result column="create_date" jdbcType="TIMESTAMP" property="createDate"/>
<result column="update_date" jdbcType="TIMESTAMP" property="updateDate"/>
<result column="releax" jdbcType="INTEGER" property="releax"/>
</resultMap>

<sql id="allColumns">
`id`,`tenant_id`,`parent_tenant_id`,`shop_user_id`,`type`,`name`,`phone`,`id_number`,`sex`,`create_date`,`update_date`,`releax`
</sql>

<sql id="dynamicWhereConditions">
where 1=1

<if test=" null != id ">
and `id` = #{id}
</if>

<if test=" null != tenantId and '' != tenantId">
and `tenant_id` = #{tenantId}
</if>
<if test=" null != parentTenantId and '' != parentTenantId">
and `parent_tenant_id` = #{parentTenantId}
</if>

<if test=" null != shopUserId">
and `shop_user_id` = #{shopUserId}
</if>
<if test=" null != type">
and `type` = #{type}
</if>
<if test=" null != sex">
and `sex` = #{sex}
</if>
<if test=" null != name and name != '' ">
and `name` like concat('%', #{name},'%')
</if>
<if test=" null != phone and phone != '' ">
and `phone` like concat('%', #{phone},'%')
</if>
<if test=" null != releax">
and `releax` = #{releax}
</if>

<if test=" null != ids ">
and id in
<foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
#{idItem}
</foreach>
</if>
<if test=" null != sortColumns">order by ${sortColumns}</if>
</sql>

<select id="findList" parameterType="com.iformall.domain.po.WxShopUsers" resultMap="BaseResultMap">
select
<include refid="allColumns"/>
from wx_shop_users_person
<include refid="dynamicWhereConditions"/>
</select>
</mapper>

Загрузка…
Отмена
Сохранить