26 changed files with 924 additions and 1 deletions
@ -0,0 +1,103 @@ |
|||
package com.qs.serve.modules.bms.controller; |
|||
|
|||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|||
import com.qs.serve.common.model.annotation.SysLog; |
|||
import com.qs.serve.common.model.dto.PageVo; |
|||
import com.qs.serve.common.model.dto.R; |
|||
import com.qs.serve.common.model.enums.BizType; |
|||
import com.qs.serve.common.model.enums.SystemModule; |
|||
import com.qs.serve.common.util.PageUtil; |
|||
import lombok.AllArgsConstructor; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.springframework.security.access.prepost.PreAuthorize; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
import com.qs.serve.modules.bms.entity.BmsSupplierAddress; |
|||
import com.qs.serve.modules.bms.service.BmsSupplierAddressService; |
|||
|
|||
import javax.validation.Valid; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 基础档案 供应商地址 后台接口 |
|||
* @author YenHex |
|||
* @since 2022-10-12 |
|||
*/ |
|||
@Slf4j |
|||
@AllArgsConstructor |
|||
@RestController |
|||
@RequestMapping("bms/supplierAddress") |
|||
public class BmsSupplierAddressController { |
|||
|
|||
private BmsSupplierAddressService bmsSupplierAddressService; |
|||
|
|||
/** |
|||
* 翻页查询 |
|||
* @param param |
|||
* @return |
|||
*/ |
|||
@GetMapping("/page") |
|||
@PreAuthorize("hasRole('bms:supplierAddress:query')") |
|||
public R<PageVo<BmsSupplierAddress>> getPage(BmsSupplierAddress param){ |
|||
PageUtil.startPage(); |
|||
LambdaQueryWrapper<BmsSupplierAddress> supplierAddressWrapper = new LambdaQueryWrapper<>(param); |
|||
List<BmsSupplierAddress> list = bmsSupplierAddressService.list(supplierAddressWrapper); |
|||
return R.byPageHelperList(list); |
|||
} |
|||
|
|||
/** |
|||
* 根据ID查询 |
|||
* @param id |
|||
* @return |
|||
*/ |
|||
@GetMapping("/getById/{id}") |
|||
@SysLog(module = SystemModule.BASE, title = "供应商地址", biz = BizType.QUERY) |
|||
@PreAuthorize("hasRole('bms:supplierAddress:query')") |
|||
public R<BmsSupplierAddress> getById(@PathVariable("id") String id){ |
|||
BmsSupplierAddress bmsSupplierAddress = bmsSupplierAddressService.getById(id); |
|||
return R.ok(bmsSupplierAddress); |
|||
} |
|||
|
|||
|
|||
|
|||
/** |
|||
* 根据ID更新 |
|||
* @param param |
|||
* @return |
|||
*/ |
|||
@PostMapping("/updateById") |
|||
@SysLog(module = SystemModule.BASE, title = "供应商地址", biz = BizType.UPDATE) |
|||
@PreAuthorize("hasRole('bms:supplierAddress:update')") |
|||
public R<?> updateById(@RequestBody @Valid BmsSupplierAddress param){ |
|||
boolean result = bmsSupplierAddressService.updateById(param); |
|||
return R.isTrue(result); |
|||
} |
|||
|
|||
/** |
|||
* 新增供应商地址 |
|||
* @param param |
|||
* @return |
|||
*/ |
|||
@PostMapping("/save") |
|||
@SysLog(module = SystemModule.BASE, title = "供应商地址", biz = BizType.INSERT) |
|||
@PreAuthorize("hasRole('bms:supplierAddress:insert')") |
|||
public R<?> save(@RequestBody @Valid BmsSupplierAddress param){ |
|||
boolean result = bmsSupplierAddressService.save(param); |
|||
return R.isTrue(result); |
|||
} |
|||
|
|||
/** |
|||
* 删除供应商地址 |
|||
* @param id |
|||
* @return |
|||
*/ |
|||
@DeleteMapping("/deleteById/{id}") |
|||
@SysLog(module = SystemModule.BASE, title = "供应商地址", biz = BizType.DELETE) |
|||
@PreAuthorize("hasRole('bms:supplierAddress:delete')") |
|||
public R<?> deleteById(@PathVariable("id") String id){ |
|||
boolean result = bmsSupplierAddressService.removeById(id); |
|||
return R.isTrue(result); |
|||
} |
|||
|
|||
} |
|||
|
@ -0,0 +1,103 @@ |
|||
package com.qs.serve.modules.bms.controller; |
|||
|
|||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|||
import com.qs.serve.common.model.annotation.SysLog; |
|||
import com.qs.serve.common.model.dto.PageVo; |
|||
import com.qs.serve.common.model.dto.R; |
|||
import com.qs.serve.common.model.enums.BizType; |
|||
import com.qs.serve.common.model.enums.SystemModule; |
|||
import com.qs.serve.common.util.PageUtil; |
|||
import lombok.AllArgsConstructor; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.springframework.security.access.prepost.PreAuthorize; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
import com.qs.serve.modules.bms.entity.BmsSupplierBand; |
|||
import com.qs.serve.modules.bms.service.BmsSupplierBandService; |
|||
|
|||
import javax.validation.Valid; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 基础档案 供应商地址 后台接口 |
|||
* @author YenHex |
|||
* @since 2022-10-12 |
|||
*/ |
|||
@Slf4j |
|||
@AllArgsConstructor |
|||
@RestController |
|||
@RequestMapping("bms/supplierBand") |
|||
public class BmsSupplierBandController { |
|||
|
|||
private BmsSupplierBandService bmsSupplierBandService; |
|||
|
|||
/** |
|||
* 翻页查询 |
|||
* @param param |
|||
* @return |
|||
*/ |
|||
@GetMapping("/page") |
|||
@PreAuthorize("hasRole('bms:supplierBand:query')") |
|||
public R<PageVo<BmsSupplierBand>> getPage(BmsSupplierBand param){ |
|||
PageUtil.startPage(); |
|||
LambdaQueryWrapper<BmsSupplierBand> supplierBandWrapper = new LambdaQueryWrapper<>(param); |
|||
List<BmsSupplierBand> list = bmsSupplierBandService.list(supplierBandWrapper); |
|||
return R.byPageHelperList(list); |
|||
} |
|||
|
|||
/** |
|||
* 根据ID查询 |
|||
* @param id |
|||
* @return |
|||
*/ |
|||
@GetMapping("/getById/{id}") |
|||
@SysLog(module = SystemModule.BASE, title = "供应商地址", biz = BizType.QUERY) |
|||
@PreAuthorize("hasRole('bms:supplierBand:query')") |
|||
public R<BmsSupplierBand> getById(@PathVariable("id") String id){ |
|||
BmsSupplierBand bmsSupplierBand = bmsSupplierBandService.getById(id); |
|||
return R.ok(bmsSupplierBand); |
|||
} |
|||
|
|||
|
|||
|
|||
/** |
|||
* 根据ID更新 |
|||
* @param param |
|||
* @return |
|||
*/ |
|||
@PostMapping("/updateById") |
|||
@SysLog(module = SystemModule.BASE, title = "供应商地址", biz = BizType.UPDATE) |
|||
@PreAuthorize("hasRole('bms:supplierBand:update')") |
|||
public R<?> updateById(@RequestBody @Valid BmsSupplierBand param){ |
|||
boolean result = bmsSupplierBandService.updateById(param); |
|||
return R.isTrue(result); |
|||
} |
|||
|
|||
/** |
|||
* 新增供应商地址 |
|||
* @param param |
|||
* @return |
|||
*/ |
|||
@PostMapping("/save") |
|||
@SysLog(module = SystemModule.BASE, title = "供应商地址", biz = BizType.INSERT) |
|||
@PreAuthorize("hasRole('bms:supplierBand:insert')") |
|||
public R<?> save(@RequestBody @Valid BmsSupplierBand param){ |
|||
boolean result = bmsSupplierBandService.save(param); |
|||
return R.isTrue(result); |
|||
} |
|||
|
|||
/** |
|||
* 删除供应商地址 |
|||
* @param id |
|||
* @return |
|||
*/ |
|||
@DeleteMapping("/deleteById/{id}") |
|||
@SysLog(module = SystemModule.BASE, title = "供应商地址", biz = BizType.DELETE) |
|||
@PreAuthorize("hasRole('bms:supplierBand:delete')") |
|||
public R<?> deleteById(@PathVariable("id") String id){ |
|||
boolean result = bmsSupplierBandService.removeById(id); |
|||
return R.isTrue(result); |
|||
} |
|||
|
|||
} |
|||
|
@ -0,0 +1,95 @@ |
|||
package com.qs.serve.modules.bms.entity; |
|||
|
|||
import java.time.LocalDateTime; |
|||
import java.io.Serializable; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.*; |
|||
import com.fasterxml.jackson.annotation.JsonFormat; |
|||
import com.fasterxml.jackson.annotation.JsonIgnore; |
|||
import com.fasterxml.jackson.annotation.JsonProperty; |
|||
import lombok.Data; |
|||
import org.hibernate.validator.constraints.Length; |
|||
import org.springframework.format.annotation.DateTimeFormat; |
|||
|
|||
import javax.validation.constraints.NotNull; |
|||
import javax.validation.constraints.NotBlank; |
|||
|
|||
/** |
|||
* 供应商地址 实体类 |
|||
* @author YenHex |
|||
* @since 2022-10-12 |
|||
*/ |
|||
@Data |
|||
@TableName("bms_supplier_address") |
|||
public class BmsSupplierAddress implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** id */ |
|||
@TableId(type = IdType.AUTO) |
|||
private Long id; |
|||
|
|||
/** 供应商id */ |
|||
@NotNull(message = "供应商id不能为空") |
|||
private Long supplierId; |
|||
|
|||
/** 是否默认 */ |
|||
@NotNull(message = "是否默认不能为空") |
|||
private Integer defaultFlag; |
|||
|
|||
/** 省 */ |
|||
@NotBlank(message = "省不能为空") |
|||
@Length(max = 12,message = "省长度不能超过12字") |
|||
private String province; |
|||
|
|||
/** 市 */ |
|||
@NotBlank(message = "市不能为空") |
|||
@Length(max = 20,message = "市长度不能超过20字") |
|||
private String city; |
|||
|
|||
/** 区 */ |
|||
@NotBlank(message = "区不能为空") |
|||
@Length(max = 20,message = "区长度不能超过20字") |
|||
private String area; |
|||
|
|||
/** 详细地址 */ |
|||
@NotBlank(message = "详细地址不能为空") |
|||
@Length(max = 255,message = "详细地址长度不能超过255字") |
|||
private String detail; |
|||
|
|||
/** 备注 */ |
|||
@Length(max = 255,message = "备注长度不能超过255字") |
|||
private String remark; |
|||
|
|||
/** 创建时间 */ |
|||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
|||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") |
|||
@TableField(fill = FieldFill.INSERT) |
|||
private LocalDateTime createTime; |
|||
|
|||
/** 最后更新时间 */ |
|||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
|||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") |
|||
@TableField(fill = FieldFill.UPDATE) |
|||
private LocalDateTime updateTime; |
|||
|
|||
/** 所属租户 */ |
|||
@JsonIgnore |
|||
@JsonProperty |
|||
private String tenantId; |
|||
|
|||
/** 逻辑删除标记(0:显示;1:隐藏) */ |
|||
@JsonIgnore |
|||
@JsonProperty |
|||
private String delFlag; |
|||
|
|||
/** 创建人 */ |
|||
@TableField(fill = FieldFill.INSERT) |
|||
private String createBy; |
|||
|
|||
/** 更新人 */ |
|||
@TableField(fill = FieldFill.UPDATE) |
|||
private String updateBy; |
|||
|
|||
} |
|||
|
@ -0,0 +1,86 @@ |
|||
package com.qs.serve.modules.bms.entity; |
|||
|
|||
import java.time.LocalDateTime; |
|||
import java.io.Serializable; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.*; |
|||
import com.fasterxml.jackson.annotation.JsonFormat; |
|||
import com.fasterxml.jackson.annotation.JsonIgnore; |
|||
import com.fasterxml.jackson.annotation.JsonProperty; |
|||
import lombok.Data; |
|||
import org.hibernate.validator.constraints.Length; |
|||
import org.springframework.format.annotation.DateTimeFormat; |
|||
|
|||
import javax.validation.constraints.NotNull; |
|||
import javax.validation.constraints.NotBlank; |
|||
|
|||
/** |
|||
* 供应商地址 实体类 |
|||
* @author YenHex |
|||
* @since 2022-10-12 |
|||
*/ |
|||
@Data |
|||
@TableName("bms_supplier_band") |
|||
public class BmsSupplierBand implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** id */ |
|||
@TableId(type = IdType.AUTO) |
|||
private Long id; |
|||
|
|||
/** 供应商id */ |
|||
@NotNull(message = "供应商id不能为空") |
|||
private Long supplierId; |
|||
|
|||
/** 开户银行 */ |
|||
@NotBlank(message = "开户银行不能为空") |
|||
@Length(max = 20,message = "开户银行长度不能超过20字") |
|||
private String cardBank; |
|||
|
|||
/** 银行卡号 */ |
|||
@NotBlank(message = "银行卡号不能为空") |
|||
@Length(max = 30,message = "银行卡号长度不能超过30字") |
|||
private String cardNum; |
|||
|
|||
/** 持卡人 */ |
|||
@NotBlank(message = "持卡人不能为空") |
|||
@Length(max = 20,message = "持卡人长度不能超过20字") |
|||
private String cardUser; |
|||
|
|||
/** 备注 */ |
|||
@Length(max = 255,message = "备注长度不能超过255字") |
|||
private String remark; |
|||
|
|||
/** 创建时间 */ |
|||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
|||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") |
|||
@TableField(fill = FieldFill.INSERT) |
|||
private LocalDateTime createTime; |
|||
|
|||
/** 最后更新时间 */ |
|||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
|||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") |
|||
@TableField(fill = FieldFill.UPDATE) |
|||
private LocalDateTime updateTime; |
|||
|
|||
/** 所属租户 */ |
|||
@JsonIgnore |
|||
@JsonProperty |
|||
private String tenantId; |
|||
|
|||
/** 逻辑删除标记(0:显示;1:隐藏) */ |
|||
@JsonIgnore |
|||
@JsonProperty |
|||
private String delFlag; |
|||
|
|||
/** 创建人 */ |
|||
@TableField(fill = FieldFill.INSERT) |
|||
private String createBy; |
|||
|
|||
/** 更新人 */ |
|||
@TableField(fill = FieldFill.UPDATE) |
|||
private String updateBy; |
|||
|
|||
} |
|||
|
@ -0,0 +1,41 @@ |
|||
package com.qs.serve.modules.bms.entity.vo; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.IdType; |
|||
import com.baomidou.mybatisplus.annotation.TableId; |
|||
import com.qs.serve.common.model.dto.TreeNode; |
|||
import org.hibernate.validator.constraints.Length; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
|
|||
/** |
|||
* @author YenHex |
|||
* @since 2022/10/12 |
|||
*/ |
|||
public class BmsSupplierTreeVo extends TreeNode { |
|||
|
|||
/** id */ |
|||
@TableId(type = IdType.AUTO) |
|||
private String id; |
|||
|
|||
/** 一级区域ID */ |
|||
private String regionFirst; |
|||
|
|||
/** 二级区域ID */ |
|||
private String regionSecond; |
|||
|
|||
/** 三级区域ID */ |
|||
private String regionThird; |
|||
|
|||
/** 详细地址 */ |
|||
private String address; |
|||
|
|||
/** 名称 */ |
|||
private String name; |
|||
|
|||
/** 客户编码 */ |
|||
private String code; |
|||
|
|||
/** 父级id */ |
|||
private String pid; |
|||
|
|||
} |
@ -0,0 +1,14 @@ |
|||
package com.qs.serve.modules.bms.mapper; |
|||
|
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
|||
import com.qs.serve.modules.bms.entity.BmsSupplierAddress; |
|||
|
|||
/** |
|||
* 供应商地址 Mapper |
|||
* @author YenHex |
|||
* @date 2022-10-12 |
|||
*/ |
|||
public interface BmsSupplierAddressMapper extends BaseMapper<BmsSupplierAddress> { |
|||
|
|||
} |
|||
|
@ -0,0 +1,14 @@ |
|||
package com.qs.serve.modules.bms.mapper; |
|||
|
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
|||
import com.qs.serve.modules.bms.entity.BmsSupplierBand; |
|||
|
|||
/** |
|||
* 供应商地址 Mapper |
|||
* @author YenHex |
|||
* @date 2022-10-12 |
|||
*/ |
|||
public interface BmsSupplierBandMapper extends BaseMapper<BmsSupplierBand> { |
|||
|
|||
} |
|||
|
@ -0,0 +1,14 @@ |
|||
package com.qs.serve.modules.bms.service; |
|||
|
|||
import com.baomidou.mybatisplus.extension.service.IService; |
|||
import com.qs.serve.modules.bms.entity.BmsSupplierAddress; |
|||
|
|||
/** |
|||
* 供应商地址 服务接口 |
|||
* @author YenHex |
|||
* @date 2022-10-12 |
|||
*/ |
|||
public interface BmsSupplierAddressService extends IService<BmsSupplierAddress> { |
|||
|
|||
} |
|||
|
@ -0,0 +1,14 @@ |
|||
package com.qs.serve.modules.bms.service; |
|||
|
|||
import com.baomidou.mybatisplus.extension.service.IService; |
|||
import com.qs.serve.modules.bms.entity.BmsSupplierBand; |
|||
|
|||
/** |
|||
* 供应商地址 服务接口 |
|||
* @author YenHex |
|||
* @date 2022-10-12 |
|||
*/ |
|||
public interface BmsSupplierBandService extends IService<BmsSupplierBand> { |
|||
|
|||
} |
|||
|
@ -0,0 +1,22 @@ |
|||
package com.qs.serve.modules.bms.service.impl; |
|||
|
|||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
|||
import lombok.AllArgsConstructor; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.springframework.stereotype.Service; |
|||
import com.qs.serve.modules.bms.entity.BmsSupplierAddress; |
|||
import com.qs.serve.modules.bms.service.BmsSupplierAddressService; |
|||
import com.qs.serve.modules.bms.mapper.BmsSupplierAddressMapper; |
|||
|
|||
/** |
|||
* 供应商地址 服务实现类 |
|||
* @author YenHex |
|||
* @since 2022-10-12 |
|||
*/ |
|||
@Slf4j |
|||
@Service |
|||
@AllArgsConstructor |
|||
public class BmsSupplierAddressServiceImpl extends ServiceImpl<BmsSupplierAddressMapper,BmsSupplierAddress> implements BmsSupplierAddressService { |
|||
|
|||
} |
|||
|
@ -0,0 +1,22 @@ |
|||
package com.qs.serve.modules.bms.service.impl; |
|||
|
|||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
|||
import lombok.AllArgsConstructor; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.springframework.stereotype.Service; |
|||
import com.qs.serve.modules.bms.entity.BmsSupplierBand; |
|||
import com.qs.serve.modules.bms.service.BmsSupplierBandService; |
|||
import com.qs.serve.modules.bms.mapper.BmsSupplierBandMapper; |
|||
|
|||
/** |
|||
* 供应商地址 服务实现类 |
|||
* @author YenHex |
|||
* @since 2022-10-12 |
|||
*/ |
|||
@Slf4j |
|||
@Service |
|||
@AllArgsConstructor |
|||
public class BmsSupplierBandServiceImpl extends ServiceImpl<BmsSupplierBandMapper,BmsSupplierBand> implements BmsSupplierBandService { |
|||
|
|||
} |
|||
|
@ -0,0 +1,119 @@ |
|||
package com.qs.serve.modules.sys.entity; |
|||
|
|||
import java.time.LocalDateTime; |
|||
import java.io.Serializable; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.*; |
|||
import com.fasterxml.jackson.annotation.JsonFormat; |
|||
import com.fasterxml.jackson.annotation.JsonIgnore; |
|||
import com.fasterxml.jackson.annotation.JsonProperty; |
|||
import lombok.Data; |
|||
import org.hibernate.validator.constraints.Length; |
|||
import org.springframework.format.annotation.DateTimeFormat; |
|||
|
|||
import javax.validation.constraints.NotNull; |
|||
import javax.validation.constraints.NotBlank; |
|||
|
|||
/** |
|||
* 实体类 |
|||
* @author YenHex |
|||
* @since 2022-10-12 |
|||
*/ |
|||
@Data |
|||
@TableName("sys_user_sales") |
|||
public class SysUserSales implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** 用户id */ |
|||
@Length(max = 32,message = "用户id长度不能超过32字") |
|||
@TableId(type = IdType.ASSIGN_UUID) |
|||
private String userId; |
|||
|
|||
/** 父级id */ |
|||
@Length(max = 32,message = "父级id长度不能超过32字") |
|||
private String pid; |
|||
|
|||
/** 创建时间 */ |
|||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
|||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") |
|||
@TableField(fill = FieldFill.INSERT) |
|||
private LocalDateTime createTime; |
|||
|
|||
/** 创建人 */ |
|||
@TableField(fill = FieldFill.INSERT) |
|||
private String createBy; |
|||
|
|||
/** 更新时间 */ |
|||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
|||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") |
|||
@TableField(fill = FieldFill.UPDATE) |
|||
private LocalDateTime updateTime; |
|||
|
|||
/** 更新人 */ |
|||
@TableField(fill = FieldFill.UPDATE) |
|||
private String updateBy; |
|||
|
|||
/** 租户id */ |
|||
@JsonIgnore |
|||
@JsonProperty |
|||
private String tenantId; |
|||
|
|||
/** 删除标识 */ |
|||
@JsonIgnore |
|||
@JsonProperty |
|||
private Boolean delFlag; |
|||
|
|||
@TableField(exist = false) |
|||
private String id; |
|||
|
|||
/** 手机号 */ |
|||
@TableField(exist = false) |
|||
private String mobile; |
|||
|
|||
/** 账号 */ |
|||
@TableField(exist = false) |
|||
private String account; |
|||
|
|||
/** 昵称 */ |
|||
@TableField(exist = false) |
|||
private String name; |
|||
|
|||
/** 编号/工号 */ |
|||
@TableField(exist = false) |
|||
private String code; |
|||
|
|||
/** 头像 */ |
|||
@TableField(exist = false) |
|||
private String icon; |
|||
|
|||
/** 部门ID */ |
|||
@TableField(exist = false) |
|||
private String deptId; |
|||
|
|||
/** 职位ID */ |
|||
@TableField(exist = false) |
|||
private String positionId; |
|||
|
|||
/** 系统登录权限【0->停用;1->启用】 */ |
|||
@TableField(exist = false) |
|||
private Integer loginEnable; |
|||
|
|||
/** 在职状态【0->离职;1->在职】 */ |
|||
@TableField(exist = false) |
|||
private Integer servingState; |
|||
|
|||
/** 是否销售人员 */ |
|||
@TableField(exist = false) |
|||
private Integer salesFlag; |
|||
|
|||
/** 身份证号码 */ |
|||
@TableField(exist = false) |
|||
private String identityNo; |
|||
|
|||
/** 备注 */ |
|||
@TableField(exist = false) |
|||
private String remark; |
|||
|
|||
} |
|||
|
@ -0,0 +1,77 @@ |
|||
package com.qs.serve.modules.sys.entity.dto; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.FieldFill; |
|||
import com.baomidou.mybatisplus.annotation.TableField; |
|||
import com.fasterxml.jackson.annotation.JsonFormat; |
|||
import com.fasterxml.jackson.annotation.JsonIgnore; |
|||
import com.fasterxml.jackson.annotation.JsonProperty; |
|||
import com.qs.serve.common.model.dto.TreeNode; |
|||
import org.hibernate.validator.constraints.Length; |
|||
import org.springframework.format.annotation.DateTimeFormat; |
|||
|
|||
import java.time.LocalDateTime; |
|||
|
|||
/** |
|||
* @author YenHex |
|||
* @since 2022/10/12 |
|||
*/ |
|||
public class SysUserSalesTreeVo extends TreeNode { |
|||
|
|||
private String userId; |
|||
|
|||
/** 父级id */ |
|||
@Length(max = 32,message = "父级id长度不能超过32字") |
|||
private String pid; |
|||
|
|||
@TableField(exist = false) |
|||
private String id; |
|||
|
|||
/** 手机号 */ |
|||
@TableField(exist = false) |
|||
private String mobile; |
|||
|
|||
/** 账号 */ |
|||
@TableField(exist = false) |
|||
private String account; |
|||
|
|||
/** 昵称 */ |
|||
@TableField(exist = false) |
|||
private String name; |
|||
|
|||
/** 编号/工号 */ |
|||
@TableField(exist = false) |
|||
private String code; |
|||
|
|||
/** 头像 */ |
|||
@TableField(exist = false) |
|||
private String icon; |
|||
|
|||
/** 部门ID */ |
|||
@TableField(exist = false) |
|||
private String deptId; |
|||
|
|||
/** 职位ID */ |
|||
@TableField(exist = false) |
|||
private String positionId; |
|||
|
|||
/** 系统登录权限【0->停用;1->启用】 */ |
|||
@TableField(exist = false) |
|||
private Integer loginEnable; |
|||
|
|||
/** 在职状态【0->离职;1->在职】 */ |
|||
@TableField(exist = false) |
|||
private Integer servingState; |
|||
|
|||
/** 是否销售人员 */ |
|||
@TableField(exist = false) |
|||
private Integer salesFlag; |
|||
|
|||
/** 身份证号码 */ |
|||
@TableField(exist = false) |
|||
private String identityNo; |
|||
|
|||
/** 备注 */ |
|||
@TableField(exist = false) |
|||
private String remark; |
|||
|
|||
} |
@ -0,0 +1,20 @@ |
|||
package com.qs.serve.modules.sys.mapper; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.InterceptorIgnore; |
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
|||
import com.qs.serve.modules.sys.entity.SysUserSales; |
|||
import org.apache.ibatis.annotations.Param; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* Mapper |
|||
* @author YenHex |
|||
* @date 2022-10-12 |
|||
*/ |
|||
public interface SysUserSalesMapper extends BaseMapper<SysUserSales> { |
|||
|
|||
@InterceptorIgnore(tenantLine = "1") |
|||
List<SysUserSales> selectSysUserSalesList(@Param("query") SysUserSales userSales); |
|||
|
|||
} |
|||
|
@ -0,0 +1,24 @@ |
|||
package com.qs.serve.modules.sys.service; |
|||
|
|||
import com.baomidou.mybatisplus.extension.service.IService; |
|||
import com.qs.serve.modules.sys.entity.SysUserSales; |
|||
import org.apache.ibatis.annotations.Param; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 服务接口 |
|||
* @author YenHex |
|||
* @date 2022-10-12 |
|||
*/ |
|||
public interface SysUserSalesService extends IService<SysUserSales> { |
|||
|
|||
/** |
|||
* 加载所有销售人员 |
|||
* @param userSales |
|||
* @return |
|||
*/ |
|||
List<SysUserSales> selectSysUserSalesList(SysUserSales userSales); |
|||
|
|||
} |
|||
|
@ -0,0 +1,29 @@ |
|||
package com.qs.serve.modules.sys.service.impl; |
|||
|
|||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
|||
import lombok.AllArgsConstructor; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.springframework.stereotype.Service; |
|||
import com.qs.serve.modules.sys.entity.SysUserSales; |
|||
import com.qs.serve.modules.sys.service.SysUserSalesService; |
|||
import com.qs.serve.modules.sys.mapper.SysUserSalesMapper; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 服务实现类 |
|||
* @author YenHex |
|||
* @since 2022-10-12 |
|||
*/ |
|||
@Slf4j |
|||
@Service |
|||
@AllArgsConstructor |
|||
public class SysUserSalesServiceImpl extends ServiceImpl<SysUserSalesMapper,SysUserSales> implements SysUserSalesService { |
|||
|
|||
@Override |
|||
public List<SysUserSales> selectSysUserSalesList(SysUserSales userSales) { |
|||
return baseMapper.selectSysUserSalesList(userSales); |
|||
} |
|||
|
|||
} |
|||
|
@ -0,0 +1,58 @@ |
|||
<?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.qs.serve.modules.sys.mapper.SysUserSalesMapper"> |
|||
|
|||
<resultMap id="sysUserSalesMap" type="com.qs.serve.modules.sys.entity.SysUserSales" > |
|||
<result property="userId" column="user_id"/> |
|||
<result property="pid" column="pid"/> |
|||
<result property="id" column="id"/> |
|||
<result property="mobile" column="mobile"/> |
|||
<result property="account" column="account"/> |
|||
<result property="name" column="name"/> |
|||
<result property="code" column="code"/> |
|||
<result property="icon" column="icon"/> |
|||
<result property="deptId" column="dept_id"/> |
|||
<result property="positionId" column="position_id"/> |
|||
<result property="loginEnable" column="login_enable"/> |
|||
<result property="servingState" column="serving_state"/> |
|||
<result property="salesFlag" column="sales_flag"/> |
|||
<result property="identityNo" column="identity_no"/> |
|||
<result property="remark" column="remark"/> |
|||
</resultMap> |
|||
|
|||
|
|||
<sql id="sysUserSalesSql"> |
|||
sys_user.id, |
|||
sys_user.mobile, |
|||
sys_user.account, |
|||
sys_user.name, |
|||
sys_user.code, |
|||
sys_user.icon, |
|||
sys_user.dept_id, |
|||
sys_user.position_id, |
|||
sys_user.super_flag, |
|||
sys_user.login_enable, |
|||
sys_user.serving_state, |
|||
sys_user.sales_flag, |
|||
sys_user.identity_no, |
|||
sys_user.remark, |
|||
sys_user_sales.`user_id`, |
|||
sys_user_sales.`pid`</sql> |
|||
|
|||
<select id="selectSysUserSalesList" parameterType="com.qs.serve.modules.sys.entity.SysUserSales" resultMap="sysUserSalesMap"> |
|||
SELECT <include refid="sysUserSalesSql"/> FROM `sys_user_sales` `sys_user_sales` |
|||
LEFT JOIN `sys_user` ON `sys_user_sales`.`user_id` = `sys_user`.`id` |
|||
<where> |
|||
and `sys_user`.`sales_flag` = '1' |
|||
and `sys_user`.`del_flag` = '0' |
|||
and `sys_user`.`serving_state` = '1' |
|||
and `sys_user_sales`.`del_flag` = '0' |
|||
<if test="query.userId != null and query.userId != ''"> and `sys_user_sales`.`user_id` = #{query.userId}</if> |
|||
<if test="query.pid != null and query.pid != ''"> and `sys_user_sales`.`pid` = #{query.pid}</if> |
|||
<if test="query.tenantId != null and query.tenantId != ''"> and sys_user_sales.tenant_id = #{query.tenantId}</if> |
|||
</where> |
|||
</select> |
|||
|
|||
</mapper> |
Loading…
Reference in new issue