43 changed files with 1283 additions and 83 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.BmsChannel; |
|||
import com.qs.serve.modules.bms.service.BmsChannelService; |
|||
|
|||
import javax.validation.Valid; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 基础档案 渠道 |
|||
* @author YenHex |
|||
* @since 2022-11-03 |
|||
*/ |
|||
@Slf4j |
|||
@AllArgsConstructor |
|||
@RestController |
|||
@RequestMapping("bms/channel") |
|||
public class BmsChannelController { |
|||
|
|||
private BmsChannelService bmsChannelService; |
|||
|
|||
/** |
|||
* 翻页 |
|||
* @param param |
|||
* @return |
|||
*/ |
|||
@GetMapping("/page") |
|||
@PreAuthorize("hasRole('bms:channel:query')") |
|||
public R<PageVo<BmsChannel>> getPage(BmsChannel param){ |
|||
PageUtil.startPage(); |
|||
LambdaQueryWrapper<BmsChannel> channelWrapper = new LambdaQueryWrapper<>(param); |
|||
List<BmsChannel> list = bmsChannelService.list(channelWrapper); |
|||
return R.byPageHelperList(list); |
|||
} |
|||
|
|||
/** |
|||
* ID查询 |
|||
* @param id |
|||
* @return |
|||
*/ |
|||
@GetMapping("/getById/{id}") |
|||
@SysLog(module = SystemModule.BASE, title = "渠道", biz = BizType.QUERY) |
|||
@PreAuthorize("hasRole('bms:channel:query')") |
|||
public R<BmsChannel> getById(@PathVariable("id") String id){ |
|||
BmsChannel bmsChannel = bmsChannelService.getById(id); |
|||
return R.ok(bmsChannel); |
|||
} |
|||
|
|||
|
|||
|
|||
/** |
|||
* 更新 |
|||
* @param param |
|||
* @return |
|||
*/ |
|||
@PostMapping("/updateById") |
|||
@SysLog(module = SystemModule.BASE, title = "渠道", biz = BizType.UPDATE) |
|||
@PreAuthorize("hasRole('bms:channel:update')") |
|||
public R<?> updateById(@RequestBody @Valid BmsChannel param){ |
|||
boolean result = bmsChannelService.updateById(param); |
|||
return R.isTrue(result); |
|||
} |
|||
|
|||
/** |
|||
* 新增 |
|||
* @param param |
|||
* @return |
|||
*/ |
|||
@PostMapping("/save") |
|||
@SysLog(module = SystemModule.BASE, title = "渠道", biz = BizType.INSERT) |
|||
@PreAuthorize("hasRole('bms:channel:insert')") |
|||
public R<?> save(@RequestBody @Valid BmsChannel param){ |
|||
boolean result = bmsChannelService.save(param); |
|||
return R.isTrue(result); |
|||
} |
|||
|
|||
/** |
|||
* 删除 |
|||
* @param id |
|||
* @return |
|||
*/ |
|||
@DeleteMapping("/deleteById/{id}") |
|||
@SysLog(module = SystemModule.BASE, title = "渠道", biz = BizType.DELETE) |
|||
@PreAuthorize("hasRole('bms:channel:delete')") |
|||
public R<?> deleteById(@PathVariable("id") Long id){ |
|||
boolean result = bmsChannelService.removeById(id); |
|||
return R.isTrue(result); |
|||
} |
|||
|
|||
} |
|||
|
@ -0,0 +1,119 @@ |
|||
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 com.qs.serve.modules.bms.entity.BmsChannel; |
|||
import com.qs.serve.modules.bms.service.BmsChannelService; |
|||
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.BmsChannelPoint; |
|||
import com.qs.serve.modules.bms.service.BmsChannelPointService; |
|||
|
|||
import javax.validation.Valid; |
|||
import java.util.List; |
|||
import java.util.stream.Collectors; |
|||
|
|||
/** |
|||
* 基础档案 渠道站点 |
|||
* @author YenHex |
|||
* @since 2022-11-03 |
|||
*/ |
|||
@Slf4j |
|||
@AllArgsConstructor |
|||
@RestController |
|||
@RequestMapping("bms/channelPoint") |
|||
public class BmsChannelPointController { |
|||
|
|||
private BmsChannelPointService bmsChannelPointService; |
|||
private BmsChannelService bmsChannelService; |
|||
|
|||
/** |
|||
* 翻页 |
|||
* @param param |
|||
* @return |
|||
*/ |
|||
@GetMapping("/page") |
|||
@PreAuthorize("hasRole('bms:channelPoint:query')") |
|||
public R<PageVo<BmsChannelPoint>> getPage(BmsChannelPoint param){ |
|||
PageUtil.startPage(); |
|||
LambdaQueryWrapper<BmsChannelPoint> channelPointWrapper = new LambdaQueryWrapper<>(param); |
|||
List<BmsChannelPoint> list = bmsChannelPointService.list(channelPointWrapper); |
|||
if(list.size()>0){ |
|||
List<Long> channelIds = list.stream().map(BmsChannelPoint::getChannelId).distinct().collect(Collectors.toList()); |
|||
List<BmsChannel> channels = bmsChannelService.listByIds(channelIds); |
|||
for (BmsChannelPoint channelPoint : list) { |
|||
for (BmsChannel channel : channels) { |
|||
if(channelPoint.getChannelId().equals(channel.getId())){ |
|||
channelPoint.setChannelName(channel.getChannelName()); |
|||
break; |
|||
} |
|||
} |
|||
} |
|||
} |
|||
return R.byPageHelperList(list); |
|||
} |
|||
|
|||
/** |
|||
* ID查询 |
|||
* @param id |
|||
* @return |
|||
*/ |
|||
@GetMapping("/getById/{id}") |
|||
@SysLog(module = SystemModule.BASE, title = "渠道站点", biz = BizType.QUERY) |
|||
@PreAuthorize("hasRole('bms:channelPoint:query')") |
|||
public R<BmsChannelPoint> getById(@PathVariable("id") String id){ |
|||
BmsChannelPoint bmsChannelPoint = bmsChannelPointService.getById(id); |
|||
BmsChannel channel = bmsChannelService.getById(bmsChannelPoint.getChannelId()); |
|||
bmsChannelPoint.setChannelName(channel.getChannelName()); |
|||
return R.ok(bmsChannelPoint); |
|||
} |
|||
|
|||
/** |
|||
* 更新 |
|||
* @param param |
|||
* @return |
|||
*/ |
|||
@PostMapping("/updateById") |
|||
@SysLog(module = SystemModule.BASE, title = "渠道站点", biz = BizType.UPDATE) |
|||
@PreAuthorize("hasRole('bms:channelPoint:update')") |
|||
public R<?> updateById(@RequestBody @Valid BmsChannelPoint param){ |
|||
boolean result = bmsChannelPointService.updateById(param); |
|||
return R.isTrue(result); |
|||
} |
|||
|
|||
/** |
|||
* 新增 |
|||
* @param param |
|||
* @return |
|||
*/ |
|||
@PostMapping("/save") |
|||
@SysLog(module = SystemModule.BASE, title = "渠道站点", biz = BizType.INSERT) |
|||
@PreAuthorize("hasRole('bms:channelPoint:insert')") |
|||
public R<?> save(@RequestBody @Valid BmsChannelPoint param){ |
|||
boolean result = bmsChannelPointService.save(param); |
|||
return R.isTrue(result); |
|||
} |
|||
|
|||
/** |
|||
* 删除 |
|||
* @param id |
|||
* @return |
|||
*/ |
|||
@DeleteMapping("/deleteById/{id}") |
|||
@SysLog(module = SystemModule.BASE, title = "渠道站点", biz = BizType.DELETE) |
|||
@PreAuthorize("hasRole('bms:channelPoint:delete')") |
|||
public R<?> deleteById(@PathVariable("id") Long id){ |
|||
boolean result = bmsChannelPointService.removeById(id); |
|||
return R.isTrue(result); |
|||
} |
|||
|
|||
} |
|||
|
@ -0,0 +1,113 @@ |
|||
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 com.qs.serve.modules.bms.entity.BmsChannel; |
|||
import com.qs.serve.modules.bms.entity.BmsSupplier; |
|||
import com.qs.serve.modules.bms.service.BmsChannelService; |
|||
import com.qs.serve.modules.bms.service.BmsSupplierService; |
|||
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.BmsSupplierChannel; |
|||
import com.qs.serve.modules.bms.service.BmsSupplierChannelService; |
|||
|
|||
import javax.validation.Valid; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 基础档案 客户渠道关系 |
|||
* @author YenHex |
|||
* @since 2022-11-03 |
|||
*/ |
|||
@Slf4j |
|||
@AllArgsConstructor |
|||
@RestController |
|||
@RequestMapping("bms/supplierChannel") |
|||
public class BmsSupplierChannelController { |
|||
|
|||
private BmsSupplierChannelService bmsSupplierChannelService; |
|||
private BmsChannelService bmsChannelService; |
|||
private BmsSupplierService bmsSupplierService; |
|||
|
|||
/** |
|||
* 翻页 |
|||
* @param param |
|||
* @return |
|||
*/ |
|||
@GetMapping("/page") |
|||
@PreAuthorize("hasRole('bms:supplierChannel:query')") |
|||
public R<PageVo<BmsSupplierChannel>> getPage(BmsSupplierChannel param){ |
|||
PageUtil.startPage(); |
|||
List<BmsSupplierChannel> list = bmsSupplierChannelService.selectSupplierChannelList(param); |
|||
return R.byPageHelperList(list); |
|||
} |
|||
|
|||
/** |
|||
* ID查询 |
|||
* @param id |
|||
* @return |
|||
*/ |
|||
@GetMapping("/getById/{id}") |
|||
@SysLog(module = SystemModule.BASE, title = "客户渠道关系", biz = BizType.QUERY) |
|||
@PreAuthorize("hasRole('bms:supplierChannel:query')") |
|||
public R<BmsSupplierChannel> getById(@PathVariable("id") String id){ |
|||
BmsSupplierChannel bmsSupplierChannel = bmsSupplierChannelService.getById(id); |
|||
BmsChannel channel = bmsChannelService.getById(bmsSupplierChannel.getChannelId()); |
|||
bmsSupplierChannel.setChannelName(channel.getChannelName()); |
|||
BmsSupplier supplier = bmsSupplierService.getById(bmsSupplierChannel.getSupplierId().toString()); |
|||
bmsSupplierChannel.setSupplierCode(supplier.getCode()); |
|||
bmsSupplierChannel.setSupplierName(supplier.getName()); |
|||
return R.ok(bmsSupplierChannel); |
|||
} |
|||
|
|||
|
|||
|
|||
/** |
|||
* 更新 |
|||
* @param param |
|||
* @return |
|||
*/ |
|||
@PostMapping("/updateById") |
|||
@SysLog(module = SystemModule.BASE, title = "客户渠道关系", biz = BizType.UPDATE) |
|||
@PreAuthorize("hasRole('bms:supplierChannel:update')") |
|||
public R<?> updateById(@RequestBody @Valid BmsSupplierChannel param){ |
|||
boolean result = bmsSupplierChannelService.updateById(param); |
|||
return R.isTrue(result); |
|||
} |
|||
|
|||
/** |
|||
* 新增 |
|||
* @param param |
|||
* @return |
|||
*/ |
|||
@PostMapping("/save") |
|||
@SysLog(module = SystemModule.BASE, title = "客户渠道关系", biz = BizType.INSERT) |
|||
@PreAuthorize("hasRole('bms:supplierChannel:insert')") |
|||
public R<?> save(@RequestBody @Valid BmsSupplierChannel param){ |
|||
boolean result = bmsSupplierChannelService.save(param); |
|||
return R.isTrue(result); |
|||
} |
|||
|
|||
/** |
|||
* 删除 |
|||
* @param id |
|||
* @return |
|||
*/ |
|||
@DeleteMapping("/deleteById/{id}") |
|||
@SysLog(module = SystemModule.BASE, title = "客户渠道关系", biz = BizType.DELETE) |
|||
@PreAuthorize("hasRole('bms:supplierChannel:delete')") |
|||
public R<?> deleteById(@PathVariable("id") Long id){ |
|||
boolean result = bmsSupplierChannelService.removeById(id); |
|||
return R.isTrue(result); |
|||
} |
|||
|
|||
} |
|||
|
@ -0,0 +1,72 @@ |
|||
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-11-03 |
|||
*/ |
|||
@Data |
|||
@TableName("bms_channel") |
|||
public class BmsChannel implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** id */ |
|||
@TableId(type = IdType.AUTO) |
|||
private Long id; |
|||
|
|||
/** 渠道名称 */ |
|||
@NotBlank(message = "渠道名称不能为空") |
|||
@Length(max = 30,message = "渠道名称长度不能超过30字") |
|||
private String channelName; |
|||
|
|||
/** 备注 */ |
|||
@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,80 @@ |
|||
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-11-03 |
|||
*/ |
|||
@Data |
|||
@TableName("bms_channel_point") |
|||
public class BmsChannelPoint implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** id */ |
|||
@TableId(type = IdType.AUTO) |
|||
private Long id; |
|||
|
|||
/** 渠道名称 */ |
|||
@NotNull(message = "渠道名称不能为空") |
|||
private Long channelId; |
|||
|
|||
/** 站点名称 */ |
|||
@NotBlank(message = "站点名称不能为空") |
|||
@Length(max = 30,message = "站点名称长度不能超过30字") |
|||
private String pointName; |
|||
|
|||
/** 备注 */ |
|||
@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; |
|||
|
|||
/** 渠道名称 */ |
|||
@TableField(exist = false) |
|||
private String channelName; |
|||
|
|||
} |
|||
|
@ -0,0 +1,83 @@ |
|||
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-11-03 |
|||
*/ |
|||
@Data |
|||
@TableName("bms_supplier_channel") |
|||
public class BmsSupplierChannel implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** id */ |
|||
@TableId(type = IdType.AUTO) |
|||
private Long id; |
|||
|
|||
/** 渠道id */ |
|||
@NotNull(message = "渠道id不能为空") |
|||
private Long channelId; |
|||
|
|||
/** 客户id */ |
|||
@NotNull(message = "客户id不能为空") |
|||
private Long supplierId; |
|||
|
|||
/** 创建时间 */ |
|||
@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; |
|||
|
|||
/** 渠道名称 */ |
|||
@TableField(exist = false) |
|||
private String channelName; |
|||
|
|||
/** 客户名称 */ |
|||
@TableField(exist = false) |
|||
private String supplierName; |
|||
|
|||
/** 客户编码 */ |
|||
@TableField(exist = false) |
|||
private String supplierCode; |
|||
|
|||
} |
|||
|
@ -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.BmsChannel; |
|||
|
|||
/** |
|||
* 渠道 Mapper |
|||
* @author YenHex |
|||
* @date 2022-11-03 |
|||
*/ |
|||
public interface BmsChannelMapper extends BaseMapper<BmsChannel> { |
|||
|
|||
} |
|||
|
@ -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.BmsChannelPoint; |
|||
|
|||
/** |
|||
* 渠道站点 Mapper |
|||
* @author YenHex |
|||
* @date 2022-11-03 |
|||
*/ |
|||
public interface BmsChannelPointMapper extends BaseMapper<BmsChannelPoint> { |
|||
|
|||
} |
|||
|
@ -0,0 +1,17 @@ |
|||
package com.qs.serve.modules.bms.mapper; |
|||
|
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
|||
import com.qs.serve.modules.bms.entity.BmsSupplierChannel; |
|||
import org.apache.ibatis.annotations.Param; |
|||
import java.util.List; |
|||
/** |
|||
* 客户渠道关系 Mapper |
|||
* @author YenHex |
|||
* @date 2022-11-03 |
|||
*/ |
|||
public interface BmsSupplierChannelMapper extends BaseMapper<BmsSupplierChannel> { |
|||
|
|||
List<BmsSupplierChannel> selectSupplierChannelList(@Param("query") BmsSupplierChannel supplierChannel); |
|||
|
|||
} |
|||
|
@ -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.BmsChannelPoint; |
|||
|
|||
/** |
|||
* 渠道站点 服务接口 |
|||
* @author YenHex |
|||
* @date 2022-11-03 |
|||
*/ |
|||
public interface BmsChannelPointService extends IService<BmsChannelPoint> { |
|||
|
|||
} |
|||
|
@ -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.BmsChannel; |
|||
|
|||
/** |
|||
* 渠道 服务接口 |
|||
* @author YenHex |
|||
* @date 2022-11-03 |
|||
*/ |
|||
public interface BmsChannelService extends IService<BmsChannel> { |
|||
|
|||
} |
|||
|
@ -0,0 +1,19 @@ |
|||
package com.qs.serve.modules.bms.service; |
|||
|
|||
import com.baomidou.mybatisplus.extension.service.IService; |
|||
import com.qs.serve.modules.bms.entity.BmsSupplierChannel; |
|||
import org.apache.ibatis.annotations.Param; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 客户渠道关系 服务接口 |
|||
* @author YenHex |
|||
* @date 2022-11-03 |
|||
*/ |
|||
public interface BmsSupplierChannelService extends IService<BmsSupplierChannel> { |
|||
|
|||
List<BmsSupplierChannel> selectSupplierChannelList(BmsSupplierChannel supplierChannel); |
|||
|
|||
} |
|||
|
@ -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.BmsChannelPoint; |
|||
import com.qs.serve.modules.bms.service.BmsChannelPointService; |
|||
import com.qs.serve.modules.bms.mapper.BmsChannelPointMapper; |
|||
|
|||
/** |
|||
* 渠道站点 服务实现类 |
|||
* @author YenHex |
|||
* @since 2022-11-03 |
|||
*/ |
|||
@Slf4j |
|||
@Service |
|||
@AllArgsConstructor |
|||
public class BmsChannelPointServiceImpl extends ServiceImpl<BmsChannelPointMapper,BmsChannelPoint> implements BmsChannelPointService { |
|||
|
|||
} |
|||
|
@ -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.BmsChannel; |
|||
import com.qs.serve.modules.bms.service.BmsChannelService; |
|||
import com.qs.serve.modules.bms.mapper.BmsChannelMapper; |
|||
|
|||
/** |
|||
* 渠道 服务实现类 |
|||
* @author YenHex |
|||
* @since 2022-11-03 |
|||
*/ |
|||
@Slf4j |
|||
@Service |
|||
@AllArgsConstructor |
|||
public class BmsChannelServiceImpl extends ServiceImpl<BmsChannelMapper,BmsChannel> implements BmsChannelService { |
|||
|
|||
} |
|||
|
@ -0,0 +1,28 @@ |
|||
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.BmsSupplierChannel; |
|||
import com.qs.serve.modules.bms.service.BmsSupplierChannelService; |
|||
import com.qs.serve.modules.bms.mapper.BmsSupplierChannelMapper; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 客户渠道关系 服务实现类 |
|||
* @author YenHex |
|||
* @since 2022-11-03 |
|||
*/ |
|||
@Slf4j |
|||
@Service |
|||
@AllArgsConstructor |
|||
public class BmsSupplierChannelServiceImpl extends ServiceImpl<BmsSupplierChannelMapper,BmsSupplierChannel> implements BmsSupplierChannelService { |
|||
|
|||
@Override |
|||
public List<BmsSupplierChannel> selectSupplierChannelList(BmsSupplierChannel supplierChannel) { |
|||
return baseMapper.selectSupplierChannelList(supplierChannel); |
|||
} |
|||
} |
|||
|
@ -0,0 +1,36 @@ |
|||
package com.qs.serve.modules.goods.entity.bo; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.IdType; |
|||
import com.baomidou.mybatisplus.annotation.TableId; |
|||
import lombok.Data; |
|||
import org.hibernate.validator.constraints.Length; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
|
|||
/** |
|||
* @author YenHex |
|||
* @since 2022/11/3 |
|||
*/ |
|||
@Data |
|||
public class GoodsCategoryBo { |
|||
|
|||
/** PK */ |
|||
@TableId(type = IdType.AUTO) |
|||
private Long id; |
|||
|
|||
/** 名称 */ |
|||
@Length(max = 16,message = "名称长度不能超过16字") |
|||
private String name; |
|||
|
|||
/** 描述 */ |
|||
@Length(max = 255,message = "描述长度不能超过255字") |
|||
private String description; |
|||
|
|||
/** 图片 */ |
|||
@Length(max = 255,message = "图片长度不能超过255字") |
|||
private String picUrl; |
|||
|
|||
/** 排序 */ |
|||
private Integer sort; |
|||
|
|||
} |
@ -0,0 +1,33 @@ |
|||
package com.qs.serve.modules.goods.entity.bo; |
|||
|
|||
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.NotBlank; |
|||
import java.io.Serializable; |
|||
import java.time.LocalDateTime; |
|||
|
|||
/** |
|||
* 分类 实体类 |
|||
* @author YenHex |
|||
* @since 2022-10-09 |
|||
*/ |
|||
@Data |
|||
public class GoodsCategoryLevelBo implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** PK */ |
|||
@TableId(type = IdType.AUTO) |
|||
private Long id; |
|||
|
|||
/** 父分类编号 */ |
|||
private Long parentId; |
|||
|
|||
} |
|||
|
@ -0,0 +1,63 @@ |
|||
package com.qs.serve.modules.goods.entity.bo; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.IdType; |
|||
import com.baomidou.mybatisplus.annotation.TableField; |
|||
import com.baomidou.mybatisplus.annotation.TableId; |
|||
import com.qs.serve.common.framework.mybatis.handler.meta.SplitStringTypeHandler; |
|||
import lombok.Data; |
|||
import org.apache.ibatis.type.JdbcType; |
|||
import org.hibernate.validator.constraints.Length; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
import javax.validation.constraints.NotNull; |
|||
import java.math.BigDecimal; |
|||
|
|||
/** |
|||
* 口味品类 |
|||
* @author YenHex |
|||
* @since 2022/10/10 |
|||
*/ |
|||
@Data |
|||
public class GoodsSpuBo { |
|||
|
|||
/** PK */ |
|||
@TableId(type = IdType.AUTO) |
|||
private Long id; |
|||
|
|||
/** 商品编码 */ |
|||
private String spuCode; |
|||
|
|||
/** 商品名字 */ |
|||
private String name; |
|||
|
|||
/** 品牌id */ |
|||
private Long brandId; |
|||
|
|||
/** 系列id */ |
|||
private Long seriesId; |
|||
|
|||
/** 最后一级分类 */ |
|||
private String categoryId; |
|||
|
|||
/** 商品图片 */ |
|||
@TableField(typeHandler = SplitStringTypeHandler.class,jdbcType= JdbcType.VARCHAR) |
|||
private String[] picUrls; |
|||
|
|||
/** 是否上架(1是 0否) */ |
|||
//private Integer shelf;
|
|||
|
|||
/** 排序字段 */ |
|||
@NotNull(message = "排序字段不能为空") |
|||
private Integer sort; |
|||
|
|||
/** 销量 */ |
|||
//private Integer saleNum;
|
|||
|
|||
/** 0统一规格;1多规格 */ |
|||
//@Length(max = 2,message = "0统一规格;1多规格长度不能超过2字")
|
|||
//private String specType;
|
|||
|
|||
/** 产品口味(非sku规格值) */ |
|||
private String tasteValue; |
|||
|
|||
} |
@ -0,0 +1,61 @@ |
|||
<?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.bms.mapper.BmsSupplierChannelMapper"> |
|||
|
|||
<resultMap id="bmsSupplierChannelMap" type="com.qs.serve.modules.bms.entity.BmsSupplierChannel" > |
|||
<result property="id" column="id"/> |
|||
<result property="channelId" column="channel_id"/> |
|||
<result property="supplierId" column="supplier_id"/> |
|||
<result property="createTime" column="create_time"/> |
|||
<result property="updateTime" column="update_time"/> |
|||
<result property="tenantId" column="tenant_id"/> |
|||
<result property="delFlag" column="del_flag"/> |
|||
<result property="createBy" column="create_by"/> |
|||
<result property="updateBy" column="update_by"/> |
|||
<result property="channelName" column="channel_name"/> |
|||
<result property="supplierName" column="supplier_name"/> |
|||
<result property="supplierCode" column="supplier_code"/> |
|||
</resultMap> |
|||
|
|||
<sql id="bmsSupplierChannelSql"> |
|||
bms_supplier_channel.`id`, |
|||
bms_supplier_channel.`channel_id`, |
|||
bms_supplier_channel.`supplier_id`, |
|||
bms_supplier_channel.`create_time`, |
|||
bms_supplier_channel.`update_time`, |
|||
bms_supplier_channel.`tenant_id`, |
|||
bms_supplier_channel.`del_flag`, |
|||
bms_supplier_channel.`create_by`, |
|||
bms_supplier_channel.`update_by` </sql> |
|||
|
|||
<select id="selectSupplierChannelList" parameterType="com.qs.serve.modules.bms.entity.BmsSupplierChannel" resultMap="bmsSupplierChannelMap"> |
|||
SELECT |
|||
`bms_channel`.`channel_name`, |
|||
`bms_supplier`.`name` as `supplier_name`, |
|||
`bms_supplier`.`code` as `supplier_code`, |
|||
<include refid="bmsSupplierChannelSql"/> |
|||
FROM `bms_supplier_channel` `bms_supplier_channel` |
|||
LEFT JOIN `bms_channel` ON `bms_supplier_channel`.`channel_id` = `bms_channel`.`id` |
|||
LEFT JOIN `bms_supplier` ON `bms_supplier_channel`.`supplier_id` = `bms_supplier`.id |
|||
<where> |
|||
<if test="query.id != null"> and `bms_supplier_channel`.`id` = #{query.id}</if> |
|||
<if test="query.channelId != null"> and `bms_supplier_channel`.`channel_id` = #{query.channelId}</if> |
|||
<if test="query.supplierId != null"> and `bms_supplier_channel`.`supplier_id` = #{query.supplierId}</if> |
|||
<if test="query.createTime != null"> and `bms_supplier_channel`.`create_time` = #{query.createTime}</if> |
|||
<if test="query.updateTime != null"> and `bms_supplier_channel`.`update_time` = #{query.updateTime}</if> |
|||
<if test="query.tenantId != null and query.tenantId != ''"> and `bms_supplier_channel`.`tenant_id` = #{query.tenantId}</if> |
|||
<if test="query.delFlag != null and query.delFlag != ''"> and `bms_supplier_channel`.`del_flag` = #{query.delFlag}</if> |
|||
<if test="query.createBy != null and query.createBy != ''"> and `bms_supplier_channel`.`create_by` = #{query.createBy}</if> |
|||
<if test="query.updateBy != null and query.updateBy != ''"> and `bms_supplier_channel`.`update_by` = #{query.updateBy}</if> |
|||
|
|||
<if test="query.channelName != null and query.channelName != ''"> and `bms_channel`.`channel_name` LIKE CONCAT('%',#{query.channelName},'%') </if> |
|||
|
|||
<if test="query.supplierName != null and query.supplierName != ''"> and `bms_supplier`.`name` LIKE CONCAT('%',#{query.supplierName},'%') </if> |
|||
<if test="query.supplierCode != null and query.supplierCode != ''"> and `bms_supplier`.`code` LIKE CONCAT('%',#{query.supplierCode},'%')</if> |
|||
|
|||
</where> |
|||
</select> |
|||
|
|||
</mapper> |
@ -0,0 +1,85 @@ |
|||
<?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.goods.mapper.GoodsSpuMapper"> |
|||
|
|||
<resultMap id="goodsSpuMap" type="com.qs.serve.modules.goods.entity.GoodsSpu" > |
|||
<result property="id" column="id"/> |
|||
<result property="spuCode" column="spu_code"/> |
|||
<result property="name" column="name"/> |
|||
<result property="brandId" column="brand_id"/> |
|||
<result property="seriesId" column="series_id"/> |
|||
<result property="categoryFirst" column="category_first"/> |
|||
<result property="categorySecond" column="category_second"/> |
|||
<result property="categoryThird" column="category_third"/> |
|||
<result property="categoryLast" column="category_last"/> |
|||
<result property="picUrls" column="pic_urls" typeHandler="com.qs.serve.common.framework.mybatis.handler.meta.SplitStringTypeHandler" /> |
|||
<result property="shelf" column="shelf"/> |
|||
<result property="sort" column="sort"/> |
|||
<result property="saleNum" column="sale_num"/> |
|||
<result property="tasteValue" column="taste_value"/> |
|||
<result property="createTime" column="create_time"/> |
|||
<result property="updateTime" column="update_time"/> |
|||
<result property="createBy" column="create_by"/> |
|||
<result property="updateBy" column="update_by"/> |
|||
<result property="tenantId" column="tenant_id"/> |
|||
<result property="delFlag" column="del_flag"/> |
|||
|
|||
</resultMap> |
|||
|
|||
<sql id="goodsSpuSql"> |
|||
goods_spu.`id`, |
|||
goods_spu.`spu_code`, |
|||
goods_spu.`name`, |
|||
goods_spu.`brand_id`, |
|||
goods_spu.`series_id`, |
|||
goods_spu.`category_first`, |
|||
goods_spu.`category_second`, |
|||
goods_spu.`category_third`, |
|||
goods_spu.`category_last`, |
|||
goods_spu.`pic_urls`, |
|||
goods_spu.`shelf`, |
|||
goods_spu.`sort`, |
|||
goods_spu.`sale_num`, |
|||
goods_spu.`spec_type`, |
|||
goods_spu.`taste_value`, |
|||
goods_spu.`create_time`, |
|||
goods_spu.`update_time`, |
|||
goods_spu.`create_by`, |
|||
goods_spu.`update_by`, |
|||
goods_spu.`tenant_id`, |
|||
goods_spu.`del_flag` </sql> |
|||
|
|||
<select id="selectGoodsSpuList" parameterType="com.qs.serve.modules.goods.entity.GoodsSpu" resultMap="goodsSpuMap"> |
|||
SELECT |
|||
`goods_brand`.`name` AS `brand_name`, |
|||
`goods_series`.`name` AS `series_name`, |
|||
<include refid="goodsSpuSql"/> |
|||
FROM `goods_spu` `goods_spu` |
|||
|
|||
<where> |
|||
<if test="query.id != null"> and `goods_spu`.`id` = #{query.id}</if> |
|||
<if test="query.spuCode != null and query.spuCode != ''"> and `goods_spu`.`spu_code` = #{query.spuCode}</if> |
|||
<if test="query.name != null and query.name != ''"> and `goods_spu`.`name` = #{query.name}</if> |
|||
<if test="query.brandId != null"> and `goods_spu`.`brand_id` = #{query.brandId}</if> |
|||
<if test="query.seriesId != null"> and `goods_spu`.`series_id` = #{query.seriesId}</if> |
|||
<if test="query.categoryFirst != null"> and `goods_spu`.`category_first` = #{query.categoryFirst}</if> |
|||
<if test="query.categorySecond != null"> and `goods_spu`.`category_second` = #{query.categorySecond}</if> |
|||
<if test="query.categoryThird != null"> and `goods_spu`.`category_third` = #{query.categoryThird}</if> |
|||
<if test="query.categoryLast != null"> and `goods_spu`.`category_last` = #{query.categoryLast}</if> |
|||
<if test="query.shelf != null and query.shelf != ''"> and `goods_spu`.`shelf` = #{query.shelf}</if> |
|||
<if test="query.sort != null"> and `goods_spu`.`sort` = #{query.sort}</if> |
|||
<if test="query.saleNum != null"> and `goods_spu`.`sale_num` = #{query.saleNum}</if> |
|||
<if test="query.specType != null and query.specType != ''"> and `goods_spu`.`spec_type` = #{query.specType}</if> |
|||
<if test="query.tasteValue != null and query.tasteValue != ''"> and `goods_spu`.`taste_value` = #{query.tasteValue}</if> |
|||
<if test="query.createTime != null"> and `goods_spu`.`create_time` = #{query.createTime}</if> |
|||
<if test="query.updateTime != null"> and `goods_spu`.`update_time` = #{query.updateTime}</if> |
|||
<if test="query.createBy != null and query.createBy != ''"> and `goods_spu`.`create_by` = #{query.createBy}</if> |
|||
<if test="query.updateBy != null and query.updateBy != ''"> and `goods_spu`.`update_by` = #{query.updateBy}</if> |
|||
<if test="query.tenantId != null and query.tenantId != ''"> and `goods_spu`.`tenant_id` = #{query.tenantId}</if> |
|||
<if test="query.delFlag != null and query.delFlag != ''"> and `goods_spu`.`del_flag` = #{query.delFlag}</if> |
|||
</where> |
|||
</select> |
|||
|
|||
</mapper> |
Loading…
Reference in new issue