12 changed files with 520 additions and 30 deletions
@ -0,0 +1,66 @@ |
|||
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 com.qs.serve.common.util.StringUtils; |
|||
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.so.TbsCostUnItemSo; |
|||
import com.qs.serve.modules.tbs.entity.TbsCostUnItem; |
|||
import com.qs.serve.modules.tbs.service.TbsCostUnItemService; |
|||
|
|||
import javax.validation.Valid; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 预算 无预算的费用明细 |
|||
* @author YenHex |
|||
* @since 2023-02-02 |
|||
*/ |
|||
@Slf4j |
|||
@AllArgsConstructor |
|||
@RestController |
|||
@RequestMapping("tbs/noBudgetCost") |
|||
public class TbsCostUnItemController { |
|||
|
|||
private TbsCostUnItemService tbsCostUnItemService; |
|||
|
|||
/** |
|||
* 翻页 |
|||
* @param param |
|||
* @return |
|||
*/ |
|||
@GetMapping("/page") |
|||
@PreAuthorize("hasRole('tbs:costUnItem:query')") |
|||
public R<PageVo<TbsCostUnItem>> getPage(TbsCostUnItemSo param){ |
|||
TbsCostUnItem entity = CopierUtil.copy(param,new TbsCostUnItem()); |
|||
LambdaQueryWrapper<TbsCostUnItem> lqw = new LambdaQueryWrapper<>(entity); |
|||
PageUtil.startPage(); |
|||
List<TbsCostUnItem> list = tbsCostUnItemService.list(lqw); |
|||
return R.byPageHelperList(list); |
|||
} |
|||
|
|||
/** |
|||
* ID查询 |
|||
* @param id |
|||
* @return |
|||
*/ |
|||
@GetMapping("/getById/{id}") |
|||
@SysLog(module = SystemModule.Budget, title = "无预算的费用明细", biz = BizType.QUERY) |
|||
@PreAuthorize("hasRole('tbs:costUnItem:query')") |
|||
public R<TbsCostUnItem> getById(@PathVariable("id") String id){ |
|||
TbsCostUnItem tbsCostUnItem = tbsCostUnItemService.getById(id); |
|||
return R.ok(tbsCostUnItem); |
|||
} |
|||
|
|||
} |
|||
|
@ -0,0 +1,205 @@ |
|||
package com.qs.serve.modules.tbs.entity; |
|||
|
|||
import java.time.LocalDate; |
|||
import java.io.Serializable; |
|||
import java.math.BigDecimal; |
|||
import java.time.LocalDateTime; |
|||
|
|||
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 2023-02-02 |
|||
*/ |
|||
@Data |
|||
@TableName("tbs_cost_un_item") |
|||
public class TbsCostUnItem implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** id */ |
|||
@TableId(type = IdType.AUTO) |
|||
private Long id; |
|||
|
|||
/** 成本明细编码 */ |
|||
@Length(max = 30,message = "成本明细编码长度不能超过30字") |
|||
private String centerGoodsCode; |
|||
|
|||
/** 费用申请id */ |
|||
@NotNull(message = "费用申请id不能为空") |
|||
private Long costApplyId; |
|||
|
|||
/** 活动id */ |
|||
@NotNull(message = "活动id不能为空") |
|||
private Long activityId; |
|||
|
|||
/** 活动编码 */ |
|||
@Length(max = 30,message = "活动编码长度不能超过30字") |
|||
private String activityCode; |
|||
|
|||
/** 科目id */ |
|||
@NotNull(message = "科目id不能为空") |
|||
private Long subjectId; |
|||
|
|||
/** 科目编码 */ |
|||
@NotBlank(message = "科目编码不能为空") |
|||
@Length(max = 50,message = "科目编码长度不能超过50字") |
|||
private String subjectCode; |
|||
|
|||
/** 科目名称 */ |
|||
@NotBlank(message = "科目名称不能为空") |
|||
@Length(max = 50,message = "科目名称长度不能超过50字") |
|||
private String subjectName; |
|||
|
|||
/** 成本中心类型 */ |
|||
@NotBlank(message = "成本中心类型不能为空") |
|||
@Length(max = 50,message = "成本中心类型长度不能超过50字") |
|||
private String centerType; |
|||
|
|||
/** 成本中心id */ |
|||
@NotBlank(message = "成本中心id不能为空") |
|||
@Length(max = 32,message = "成本中心id长度不能超过32字") |
|||
private String centerId; |
|||
|
|||
/** 成本中心编码 */ |
|||
@NotBlank(message = "成本中心编码不能为空") |
|||
@Length(max = 50,message = "成本中心编码长度不能超过50字") |
|||
private String centerCode; |
|||
|
|||
/** 成本中心名称 */ |
|||
@NotBlank(message = "成本中心名称不能为空") |
|||
@Length(max = 50,message = "成本中心名称长度不能超过50字") |
|||
private String centerName; |
|||
|
|||
/** 成本中心金额 */ |
|||
@NotNull(message = "成本中心金额不能为空") |
|||
private BigDecimal centerAmount; |
|||
|
|||
/** 成本中心占比 */ |
|||
@NotNull(message = "成本中心占比不能为空") |
|||
private BigDecimal centerRate; |
|||
|
|||
/** 费用额度 */ |
|||
@NotNull(message = "费用额度不能为空") |
|||
private BigDecimal centerGoodsAmount; |
|||
|
|||
/** 费用占比 */ |
|||
@NotNull(message = "费用占比不能为空") |
|||
private BigDecimal centerGoodsRate; |
|||
|
|||
/** 目标类型(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; |
|||
|
|||
/** 目标等级路径 */ |
|||
@Length(max = 600,message = "目标等级路径长度不能超过600字") |
|||
private String targetLevelPathIds; |
|||
|
|||
/** 目标等级路径 */ |
|||
@Length(max = 600,message = "目标等级路径长度不能超过600字") |
|||
private String targetLevelPathNames; |
|||
|
|||
/** 备注 */ |
|||
@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; |
|||
|
|||
/** 创建人 */ |
|||
@TableField(fill = FieldFill.INSERT) |
|||
private String createBy; |
|||
|
|||
/** 更新人 */ |
|||
@TableField(fill = FieldFill.UPDATE) |
|||
private String updateBy; |
|||
|
|||
/** 逻辑删除标记(0:显示;1:隐藏) */ |
|||
@JsonIgnore |
|||
@JsonProperty |
|||
private String delFlag; |
|||
|
|||
/** 活动开始时间 */ |
|||
@NotNull(message = "活动开始时间不能为空") |
|||
@DateTimeFormat(pattern = "yyyy-MM-dd") |
|||
@JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8") |
|||
private LocalDate actStartDate; |
|||
|
|||
/** 活动结束时间 */ |
|||
@NotNull(message = "活动结束时间不能为空") |
|||
@DateTimeFormat(pattern = "yyyy-MM-dd") |
|||
@JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8") |
|||
private LocalDate actEndDate; |
|||
|
|||
/** 预算开始时间 */ |
|||
@NotNull(message = "预算开始时间不能为空") |
|||
@DateTimeFormat(pattern = "yyyy-MM-dd") |
|||
@JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8") |
|||
private LocalDate preStartDate; |
|||
|
|||
/** 预算结束时间 */ |
|||
@NotNull(message = "预算结束时间不能为空") |
|||
@DateTimeFormat(pattern = "yyyy-MM-dd") |
|||
@JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8") |
|||
private LocalDate preEndDate; |
|||
|
|||
/** 预计核销时间 */ |
|||
@DateTimeFormat(pattern = "yyyy-MM-dd") |
|||
@JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8") |
|||
private LocalDate preCheckDate; |
|||
|
|||
/** 客户id */ |
|||
@NotNull(message = "客户id不能为空") |
|||
private Long supplierId; |
|||
|
|||
/** 客户编码 */ |
|||
@NotBlank(message = "客户编码不能为空") |
|||
@Length(max = 30,message = "客户编码长度不能超过30字") |
|||
private String supplierCode; |
|||
|
|||
/** 客户名称 */ |
|||
@NotBlank(message = "客户名称不能为空") |
|||
@Length(max = 30,message = "客户名称长度不能超过30字") |
|||
private String supplierName; |
|||
|
|||
} |
|||
|
@ -0,0 +1,151 @@ |
|||
package com.qs.serve.modules.tbs.entity.so; |
|||
|
|||
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; |
|||
|
|||
/** |
|||
* 无预算的费用明细 查询参数 |
|||
* @author YenHex |
|||
* @since 2023-02-02 |
|||
*/ |
|||
@Data |
|||
public class TbsCostUnItemSo implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** id */ |
|||
private Long id; |
|||
|
|||
/** 成本明细编码 */ |
|||
private String centerGoodsCode; |
|||
|
|||
/** 费用申请id */ |
|||
private Long costApplyId; |
|||
|
|||
/** 活动id */ |
|||
private Long activityId; |
|||
|
|||
/** 活动编码 */ |
|||
private String activityCode; |
|||
|
|||
/** 科目id */ |
|||
private Long subjectId; |
|||
|
|||
/** 科目编码 */ |
|||
private String subjectCode; |
|||
|
|||
/** 科目名称 */ |
|||
private String subjectName; |
|||
|
|||
/** 成本中心类型 */ |
|||
private String centerType; |
|||
|
|||
/** 成本中心id */ |
|||
private String centerId; |
|||
|
|||
/** 成本中心编码 */ |
|||
private String centerCode; |
|||
|
|||
/** 成本中心名称 */ |
|||
private String centerName; |
|||
|
|||
/** 成本中心金额 */ |
|||
private BigDecimal centerAmount; |
|||
|
|||
/** 成本中心占比 */ |
|||
private BigDecimal centerRate; |
|||
|
|||
/** 费用额度 */ |
|||
private BigDecimal centerGoodsAmount; |
|||
|
|||
/** 费用占比 */ |
|||
private BigDecimal centerGoodsRate; |
|||
|
|||
/** 目标类型(brand、category、series、spu、sku) */ |
|||
private String targetType; |
|||
|
|||
/** 目标id */ |
|||
private Long targetId; |
|||
|
|||
/** 目标编码 */ |
|||
private String targetCode; |
|||
|
|||
/** 目标名称 */ |
|||
private String targetName; |
|||
|
|||
/** 目标等级路径 */ |
|||
private String targetLevelPathIds; |
|||
|
|||
/** 目标等级路径 */ |
|||
private String targetLevelPathNames; |
|||
|
|||
/** 备注 */ |
|||
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; |
|||
|
|||
/** 活动开始时间 */ |
|||
@DateTimeFormat(pattern = "yyyy-MM-dd") |
|||
private LocalDate actStartDate; |
|||
|
|||
/** 活动结束时间 */ |
|||
@DateTimeFormat(pattern = "yyyy-MM-dd") |
|||
private LocalDate actEndDate; |
|||
|
|||
/** 预算开始时间 */ |
|||
@DateTimeFormat(pattern = "yyyy-MM-dd") |
|||
private LocalDate preStartDate; |
|||
|
|||
/** 预算结束时间 */ |
|||
@DateTimeFormat(pattern = "yyyy-MM-dd") |
|||
private LocalDate preEndDate; |
|||
|
|||
/** 预计核销时间 */ |
|||
@DateTimeFormat(pattern = "yyyy-MM-dd") |
|||
private LocalDate preCheckDate; |
|||
|
|||
/** 客户id */ |
|||
private Long supplierId; |
|||
|
|||
/** 客户编码 */ |
|||
private String supplierCode; |
|||
|
|||
/** 客户名称 */ |
|||
private String supplierName; |
|||
|
|||
} |
|||
|
@ -0,0 +1,14 @@ |
|||
package com.qs.serve.modules.tbs.mapper; |
|||
|
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
|||
import com.qs.serve.modules.tbs.entity.TbsCostUnItem; |
|||
|
|||
/** |
|||
* 无预算的费用明细 Mapper |
|||
* @author YenHex |
|||
* @date 2023-02-02 |
|||
*/ |
|||
public interface TbsCostUnItemMapper extends BaseMapper<TbsCostUnItem> { |
|||
|
|||
} |
|||
|
@ -0,0 +1,14 @@ |
|||
package com.qs.serve.modules.tbs.service; |
|||
|
|||
import com.baomidou.mybatisplus.extension.service.IService; |
|||
import com.qs.serve.modules.tbs.entity.TbsCostUnItem; |
|||
|
|||
/** |
|||
* 无预算的费用明细 服务接口 |
|||
* @author YenHex |
|||
* @date 2023-02-02 |
|||
*/ |
|||
public interface TbsCostUnItemService extends IService<TbsCostUnItem> { |
|||
|
|||
} |
|||
|
@ -0,0 +1,22 @@ |
|||
package com.qs.serve.modules.tbs.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.tbs.entity.TbsCostUnItem; |
|||
import com.qs.serve.modules.tbs.service.TbsCostUnItemService; |
|||
import com.qs.serve.modules.tbs.mapper.TbsCostUnItemMapper; |
|||
|
|||
/** |
|||
* 无预算的费用明细 服务实现类 |
|||
* @author YenHex |
|||
* @since 2023-02-02 |
|||
*/ |
|||
@Slf4j |
|||
@Service |
|||
@AllArgsConstructor |
|||
public class TbsCostUnItemServiceImpl extends ServiceImpl<TbsCostUnItemMapper,TbsCostUnItem> implements TbsCostUnItemService { |
|||
|
|||
} |
|||
|
Loading…
Reference in new issue