10 changed files with 71 additions and 388 deletions
@ -1,124 +0,0 @@ |
|||||
package com.qs.serve.modules.tbs.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.common.util.CopierUtil; |
|
||||
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.tbs.entity.vo.TbsBudgetConditionVo; |
|
||||
import com.qs.serve.modules.tbs.entity.bo.TbsBudgetConditionBo; |
|
||||
import com.qs.serve.modules.tbs.entity.TbsBudgetCondition; |
|
||||
import com.qs.serve.modules.tbs.service.TbsBudgetConditionService; |
|
||||
|
|
||||
import javax.validation.Valid; |
|
||||
import java.util.List; |
|
||||
|
|
||||
/** |
|
||||
* 预算 预算条件 |
|
||||
* @author YenHex |
|
||||
* @since 2022-11-08 |
|
||||
*/ |
|
||||
@Slf4j |
|
||||
@AllArgsConstructor |
|
||||
@RestController |
|
||||
@RequestMapping("tbs/budgetCondition") |
|
||||
public class TbsBudgetConditionController { |
|
||||
|
|
||||
private TbsBudgetConditionService tbsBudgetConditionService; |
|
||||
|
|
||||
/** |
|
||||
* 列表 |
|
||||
* @param param |
|
||||
* @return |
|
||||
*/ |
|
||||
@GetMapping("/list") |
|
||||
@PreAuthorize("hasRole('tbs:budgetCondition:query')") |
|
||||
public R<List<TbsBudgetCondition>> getList(TbsBudgetConditionVo param){ |
|
||||
TbsBudgetCondition entity = CopierUtil.copy(param,new TbsBudgetCondition()); |
|
||||
LambdaQueryWrapper<TbsBudgetCondition> lqw = new LambdaQueryWrapper<>(entity); |
|
||||
PageUtil.startPage(); |
|
||||
List<TbsBudgetCondition> list = tbsBudgetConditionService.list(lqw); |
|
||||
return R.ok(list); |
|
||||
} |
|
||||
|
|
||||
/** |
|
||||
* 翻页 |
|
||||
* @param param |
|
||||
* @return |
|
||||
*/ |
|
||||
@GetMapping("/page") |
|
||||
@PreAuthorize("hasRole('tbs:budgetCondition:query')") |
|
||||
public R<PageVo<TbsBudgetCondition>> getPage(TbsBudgetConditionVo param){ |
|
||||
TbsBudgetCondition entity = CopierUtil.copy(param,new TbsBudgetCondition()); |
|
||||
LambdaQueryWrapper<TbsBudgetCondition> lqw = new LambdaQueryWrapper<>(entity); |
|
||||
PageUtil.startPage(); |
|
||||
List<TbsBudgetCondition> list = tbsBudgetConditionService.list(lqw); |
|
||||
return R.byPageHelperList(list); |
|
||||
} |
|
||||
|
|
||||
/** |
|
||||
* ID查询 |
|
||||
* @param id |
|
||||
* @return |
|
||||
*/ |
|
||||
@GetMapping("/getById/{id}") |
|
||||
@SysLog(module = SystemModule.Budget, title = "预算条件", biz = BizType.QUERY) |
|
||||
@PreAuthorize("hasRole('tbs:budgetCondition:query')") |
|
||||
public R<TbsBudgetCondition> getById(@PathVariable("id") String id){ |
|
||||
TbsBudgetCondition tbsBudgetCondition = tbsBudgetConditionService.getById(id); |
|
||||
return R.ok(tbsBudgetCondition); |
|
||||
} |
|
||||
|
|
||||
|
|
||||
|
|
||||
/** |
|
||||
* 更新 |
|
||||
* @param param |
|
||||
* @return |
|
||||
*/ |
|
||||
@PostMapping("/updateById") |
|
||||
@SysLog(module = SystemModule.Budget, title = "预算条件", biz = BizType.UPDATE) |
|
||||
@PreAuthorize("hasRole('tbs:budgetCondition:update')") |
|
||||
public R<?> updateById(@RequestBody @Valid TbsBudgetConditionBo param){ |
|
||||
TbsBudgetCondition entity = CopierUtil.copy(param,new TbsBudgetCondition()); |
|
||||
boolean result = tbsBudgetConditionService.updateById(entity); |
|
||||
return R.isTrue(result); |
|
||||
} |
|
||||
|
|
||||
/** |
|
||||
* 新增 |
|
||||
* @param param |
|
||||
* @return |
|
||||
*/ |
|
||||
@PostMapping("/save") |
|
||||
@SysLog(module = SystemModule.Budget, title = "预算条件", biz = BizType.INSERT) |
|
||||
@PreAuthorize("hasRole('tbs:budgetCondition:insert')") |
|
||||
public R<?> save(@RequestBody @Valid TbsBudgetCondition param){ |
|
||||
TbsBudgetCondition entity = CopierUtil.copy(param,new TbsBudgetCondition()); |
|
||||
boolean result = tbsBudgetConditionService.save(entity); |
|
||||
return R.isTrue(result); |
|
||||
} |
|
||||
|
|
||||
/** |
|
||||
* 删除 |
|
||||
* @param id |
|
||||
* @return |
|
||||
*/ |
|
||||
@DeleteMapping("/deleteById/{id}") |
|
||||
@SysLog(module = SystemModule.Budget, title = "预算条件", biz = BizType.DELETE) |
|
||||
@PreAuthorize("hasRole('tbs:budgetCondition:delete')") |
|
||||
public R<?> deleteById(@PathVariable("id") Long id){ |
|
||||
boolean result = tbsBudgetConditionService.removeById(id); |
|
||||
return R.isTrue(result); |
|
||||
} |
|
||||
|
|
||||
} |
|
||||
|
|
@ -1,98 +0,0 @@ |
|||||
package com.qs.serve.modules.tbs.entity.bo; |
|
||||
|
|
||||
import java.time.LocalDate; |
|
||||
import java.io.Serializable; |
|
||||
import java.math.BigDecimal; |
|
||||
import java.time.LocalDateTime; |
|
||||
|
|
||||
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; |
|
||||
|
|
||||
/** |
|
||||
* 预算条件 Bo |
|
||||
* @author YenHex |
|
||||
* @since 2022-11-09 |
|
||||
*/ |
|
||||
@Data |
|
||||
public class TbsBudgetConditionBo implements Serializable { |
|
||||
|
|
||||
private static final long serialVersionUID = 1L; |
|
||||
|
|
||||
/** id */ |
|
||||
private Long id; |
|
||||
|
|
||||
/** 预算id */ |
|
||||
@NotNull(message = "预算id不能为空") |
|
||||
private Long budgtId; |
|
||||
|
|
||||
/** 目标类型(brand、category、series、spu、sku) */ |
|
||||
@NotBlank(message = "目标类型(brand、category、series、spu、sku)不能为空") |
|
||||
@Length(max = 30,message = "目标类型(brand、category、series、spu、sku)长度不能超过30字") |
|
||||
private String targetType; |
|
||||
|
|
||||
/** 目标id */ |
|
||||
@NotNull(message = "目标id不能为空") |
|
||||
private Long targetId; |
|
||||
|
|
||||
/** 目标编码 */ |
|
||||
@NotBlank(message = "目标编码不能为空") |
|
||||
@Length(max = 30,message = "目标编码长度不能超过30字") |
|
||||
private String targetCode; |
|
||||
|
|
||||
/** 目标名称 */ |
|
||||
@NotBlank(message = "目标名称不能为空") |
|
||||
@Length(max = 30,message = "目标名称长度不能超过30字") |
|
||||
private String targetName; |
|
||||
|
|
||||
/** 目标父级id */ |
|
||||
private Long targetParentId; |
|
||||
|
|
||||
/** 目标父级编码 */ |
|
||||
@Length(max = 30,message = "目标父级编码长度不能超过30字") |
|
||||
private String targetParentCode; |
|
||||
|
|
||||
/** 目标父级名称 */ |
|
||||
@Length(max = 20,message = "目标父级名称长度不能超过20字") |
|
||||
private String targetParentName; |
|
||||
|
|
||||
/** 目标等级路径 */ |
|
||||
@Length(max = 600,message = "目标等级路径长度不能超过600字") |
|
||||
private String targetLevelPath; |
|
||||
|
|
||||
/** 备注 */ |
|
||||
@Length(max = 255,message = "备注长度不能超过255字") |
|
||||
private String remark; |
|
||||
|
|
||||
/** 创建时间 */ |
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
|
||||
private LocalDateTime createTime; |
|
||||
|
|
||||
/** 最后更新时间 */ |
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
|
||||
private LocalDateTime updateTime; |
|
||||
|
|
||||
/** 所属租户 */ |
|
||||
@JsonIgnore |
|
||||
@JsonProperty |
|
||||
private String tenantId; |
|
||||
|
|
||||
/** 创建人 */ |
|
||||
private String createBy; |
|
||||
|
|
||||
/** 更新人 */ |
|
||||
private String updateBy; |
|
||||
|
|
||||
/** 逻辑删除标记(0:显示;1:隐藏) */ |
|
||||
@JsonIgnore |
|
||||
@JsonProperty |
|
||||
private String delFlag; |
|
||||
|
|
||||
} |
|
||||
|
|
@ -1,86 +0,0 @@ |
|||||
package com.qs.serve.modules.tbs.entity.vo; |
|
||||
|
|
||||
import java.time.LocalDate; |
|
||||
import java.io.Serializable; |
|
||||
import java.math.BigDecimal; |
|
||||
import java.time.LocalDateTime; |
|
||||
|
|
||||
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; |
|
||||
|
|
||||
/** |
|
||||
* 预算条件 VO |
|
||||
* @author YenHex |
|
||||
* @since 2022-11-09 |
|
||||
*/ |
|
||||
@Data |
|
||||
public class TbsBudgetConditionVo implements Serializable { |
|
||||
|
|
||||
private static final long serialVersionUID = 1L; |
|
||||
|
|
||||
/** id */ |
|
||||
private Long id; |
|
||||
|
|
||||
/** 预算id */ |
|
||||
private Long budgtId; |
|
||||
|
|
||||
/** 目标类型(brand、category、series、spu、sku) */ |
|
||||
private String targetType; |
|
||||
|
|
||||
/** 目标id */ |
|
||||
private Long targetId; |
|
||||
|
|
||||
/** 目标编码 */ |
|
||||
private String targetCode; |
|
||||
|
|
||||
/** 目标名称 */ |
|
||||
private String targetName; |
|
||||
|
|
||||
/** 目标父级id */ |
|
||||
private Long targetParentId; |
|
||||
|
|
||||
/** 目标父级编码 */ |
|
||||
private String targetParentCode; |
|
||||
|
|
||||
/** 目标父级名称 */ |
|
||||
private String targetParentName; |
|
||||
|
|
||||
/** 目标等级路径 */ |
|
||||
private String targetLevelPath; |
|
||||
|
|
||||
/** 备注 */ |
|
||||
private String remark; |
|
||||
|
|
||||
/** 创建时间 */ |
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
|
||||
private LocalDateTime createTime; |
|
||||
|
|
||||
/** 最后更新时间 */ |
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
|
||||
private LocalDateTime updateTime; |
|
||||
|
|
||||
/** 所属租户 */ |
|
||||
@JsonIgnore |
|
||||
@JsonProperty |
|
||||
private String tenantId; |
|
||||
|
|
||||
/** 创建人 */ |
|
||||
private String createBy; |
|
||||
|
|
||||
/** 更新人 */ |
|
||||
private String updateBy; |
|
||||
|
|
||||
/** 逻辑删除标记(0:显示;1:隐藏) */ |
|
||||
@JsonIgnore |
|
||||
@JsonProperty |
|
||||
private String delFlag; |
|
||||
|
|
||||
} |
|
||||
|
|
Loading…
Reference in new issue