25 changed files with 1473 additions and 79 deletions
@ -0,0 +1,16 @@ |
|||||
|
package com.qs.serve.modules.tzc.common; |
||||
|
|
||||
|
/** |
||||
|
* @author YenHex |
||||
|
* @since 2023/2/20 |
||||
|
*/ |
||||
|
public interface TzcPolicyStatus { |
||||
|
|
||||
|
int Status_0_UnCommit = 0; |
||||
|
int Status_1_Checking = 1; |
||||
|
int Status_2_PassSuccess = 2; |
||||
|
int Status_3_Refuse = 3; |
||||
|
int Status_4_RollBack = 4; |
||||
|
int Status_5_Finished = 5; |
||||
|
|
||||
|
} |
@ -0,0 +1,114 @@ |
|||||
|
package com.qs.serve.modules.tzc.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 com.qs.serve.modules.tzc.entity.TzcPolicyItem; |
||||
|
import com.qs.serve.modules.tzc.service.TzcPolicyItemService; |
||||
|
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.tzc.entity.bo.TzcPolicyBo; |
||||
|
import com.qs.serve.modules.tzc.entity.TzcPolicy; |
||||
|
import com.qs.serve.modules.tzc.service.TzcPolicyService; |
||||
|
|
||||
|
import javax.validation.Valid; |
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* 政策 政策 |
||||
|
* @author YenHex |
||||
|
* @since 2023-02-20 |
||||
|
*/ |
||||
|
@Slf4j |
||||
|
@AllArgsConstructor |
||||
|
@RestController |
||||
|
@RequestMapping("tzc/policy") |
||||
|
public class TzcPolicyController { |
||||
|
|
||||
|
private TzcPolicyService tzcPolicyService; |
||||
|
private TzcPolicyItemService tzcPolicyItemService; |
||||
|
|
||||
|
/** |
||||
|
* 翻页 |
||||
|
* @param param |
||||
|
* @return |
||||
|
*/ |
||||
|
@GetMapping("/page") |
||||
|
@PreAuthorize("hasRole('tzc:policy:query')") |
||||
|
public R<PageVo<TzcPolicy>> getPage(TzcPolicy param){ |
||||
|
LambdaQueryWrapper<TzcPolicy> lqw = new LambdaQueryWrapper<>(param); |
||||
|
PageUtil.startPage(); |
||||
|
List<TzcPolicy> list = tzcPolicyService.list(lqw); |
||||
|
return R.byPageHelperList(list); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* ID查询 |
||||
|
* @param id |
||||
|
* @return |
||||
|
*/ |
||||
|
@GetMapping("/getById/{id}") |
||||
|
@SysLog(module = SystemModule.Policy, title = "政策", biz = BizType.QUERY) |
||||
|
@PreAuthorize("hasRole('tzc:policy:query')") |
||||
|
public R<TzcPolicy> getById(@PathVariable("id") String id){ |
||||
|
TzcPolicy tzcPolicy = tzcPolicyService.getById(id); |
||||
|
List<TzcPolicyItem> policyItemList = tzcPolicyItemService.listByPolicyId(tzcPolicy.getId()); |
||||
|
tzcPolicy.setPolicyItemList(policyItemList); |
||||
|
return R.ok(tzcPolicy); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 更新 |
||||
|
* @param param |
||||
|
* @return |
||||
|
*/ |
||||
|
@PostMapping("/updateById") |
||||
|
@SysLog(module = SystemModule.Policy, title = "政策", biz = BizType.UPDATE) |
||||
|
@PreAuthorize("hasRole('tzc:policy:update')") |
||||
|
public R<?> updateById(@RequestBody @Valid TzcPolicyBo param){ |
||||
|
if(param.getId()==null){ |
||||
|
return R.error(); |
||||
|
} |
||||
|
return tzcPolicyService.modify(param); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 新增 |
||||
|
* @param param |
||||
|
* @return |
||||
|
*/ |
||||
|
@PostMapping("/save") |
||||
|
@SysLog(module = SystemModule.Policy, title = "政策", biz = BizType.INSERT) |
||||
|
@PreAuthorize("hasRole('tzc:policy:insert')") |
||||
|
public R<?> save(@RequestBody @Valid TzcPolicyBo param){ |
||||
|
param.setId(null); |
||||
|
return tzcPolicyService.modify(param); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 删除 |
||||
|
* @param ids |
||||
|
* @return |
||||
|
*/ |
||||
|
@DeleteMapping("/deleteById/{ids}") |
||||
|
@SysLog(module = SystemModule.Policy, title = "政策", biz = BizType.DELETE) |
||||
|
@PreAuthorize("hasRole('tzc:policy:delete')") |
||||
|
public R<?> deleteById(@PathVariable("ids") String ids){ |
||||
|
List<Long> idsLong = StringUtils.splitIdLong(ids); |
||||
|
boolean result = tzcPolicyService.removeByIds(idsLong); |
||||
|
return R.isTrue(result); |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
|
@ -0,0 +1,119 @@ |
|||||
|
package com.qs.serve.modules.tzc.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.tzc.entity.bo.TzcPolicyGoodsBo; |
||||
|
import com.qs.serve.modules.tzc.entity.TzcPolicyGoods; |
||||
|
import com.qs.serve.modules.tzc.service.TzcPolicyGoodsService; |
||||
|
|
||||
|
import javax.validation.Valid; |
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* 政策 政策商品 |
||||
|
* @author YenHex |
||||
|
* @since 2023-02-20 |
||||
|
*/ |
||||
|
@Slf4j |
||||
|
@AllArgsConstructor |
||||
|
@RestController |
||||
|
@RequestMapping("tzc/policyGoods") |
||||
|
public class TzcPolicyGoodsController { |
||||
|
|
||||
|
private TzcPolicyGoodsService tzcPolicyGoodsService; |
||||
|
|
||||
|
/** |
||||
|
* 列表 |
||||
|
* @param param |
||||
|
* @return |
||||
|
*/ |
||||
|
@GetMapping("/list") |
||||
|
public R<List<TzcPolicyGoods>> getList(TzcPolicyGoods param){ |
||||
|
LambdaQueryWrapper<TzcPolicyGoods> lqw = new LambdaQueryWrapper<>(param); |
||||
|
List<TzcPolicyGoods> list = tzcPolicyGoodsService.list(lqw); |
||||
|
return R.ok(list); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 翻页 |
||||
|
* @param param |
||||
|
* @return |
||||
|
*/ |
||||
|
@GetMapping("/page") |
||||
|
public R<PageVo<TzcPolicyGoods>> getPage(TzcPolicyGoods param){ |
||||
|
LambdaQueryWrapper<TzcPolicyGoods> lqw = new LambdaQueryWrapper<>(param); |
||||
|
PageUtil.startPage(); |
||||
|
List<TzcPolicyGoods> list = tzcPolicyGoodsService.list(lqw); |
||||
|
return R.byPageHelperList(list); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* ID查询 |
||||
|
* @param id |
||||
|
* @return |
||||
|
*/ |
||||
|
@GetMapping("/getById/{id}") |
||||
|
@SysLog(module = SystemModule.Policy, title = "政策商品", biz = BizType.QUERY) |
||||
|
public R<TzcPolicyGoods> getById(@PathVariable("id") String id){ |
||||
|
TzcPolicyGoods tzcPolicyGoods = tzcPolicyGoodsService.getById(id); |
||||
|
return R.ok(tzcPolicyGoods); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 更新 |
||||
|
* @param param |
||||
|
* @return |
||||
|
*/ |
||||
|
@PostMapping("/updateById") |
||||
|
@SysLog(module = SystemModule.Policy, title = "政策商品", biz = BizType.UPDATE) |
||||
|
@PreAuthorize("hasRole('tzc:policy:insert')") |
||||
|
public R<?> updateById(@RequestBody @Valid TzcPolicyGoodsBo param){ |
||||
|
TzcPolicyGoods entity = CopierUtil.copy(param,new TzcPolicyGoods()); |
||||
|
boolean result = tzcPolicyGoodsService.updateById(entity); |
||||
|
return R.isTrue(result); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 新增 |
||||
|
* @param param |
||||
|
* @return |
||||
|
*/ |
||||
|
@PostMapping("/save") |
||||
|
@SysLog(module = SystemModule.Policy, title = "政策商品", biz = BizType.INSERT) |
||||
|
@PreAuthorize("hasRole('tzc:policy:insert')") |
||||
|
public R<?> save(@RequestBody @Valid TzcPolicyGoodsBo param){ |
||||
|
TzcPolicyGoods entity = CopierUtil.copy(param,new TzcPolicyGoods()); |
||||
|
boolean result = tzcPolicyGoodsService.save(entity); |
||||
|
return R.isTrue(result); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 删除 |
||||
|
* @param ids |
||||
|
* @return |
||||
|
*/ |
||||
|
@DeleteMapping("/deleteById/{ids}") |
||||
|
@SysLog(module = SystemModule.Policy, title = "政策商品", biz = BizType.DELETE) |
||||
|
@PreAuthorize("hasRole('tzc:policy:insert')") |
||||
|
public R<?> deleteById(@PathVariable("ids") String ids){ |
||||
|
List<Long> idsLong = StringUtils.splitIdLong(ids); |
||||
|
boolean result = tzcPolicyGoodsService.removeByIds(idsLong); |
||||
|
return R.isTrue(result); |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
|
@ -0,0 +1,121 @@ |
|||||
|
package com.qs.serve.modules.tzc.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 com.qs.serve.modules.tzc.entity.TzcPolicy; |
||||
|
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.tzc.entity.bo.TzcPolicyItemBo; |
||||
|
import com.qs.serve.modules.tzc.entity.TzcPolicyItem; |
||||
|
import com.qs.serve.modules.tzc.service.TzcPolicyItemService; |
||||
|
|
||||
|
import javax.validation.Valid; |
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* 政策 政策项 |
||||
|
* @author YenHex |
||||
|
* @since 2023-02-20 |
||||
|
*/ |
||||
|
@Slf4j |
||||
|
@AllArgsConstructor |
||||
|
@RestController |
||||
|
@RequestMapping("tzc/policyItem") |
||||
|
public class TzcPolicyItemController { |
||||
|
|
||||
|
private TzcPolicyItemService tzcPolicyItemService; |
||||
|
|
||||
|
/** |
||||
|
* 列表 |
||||
|
* @param param |
||||
|
* @return |
||||
|
*/ |
||||
|
@GetMapping("/list") |
||||
|
public R<List<TzcPolicyItem>> getList(TzcPolicyItem param){ |
||||
|
LambdaQueryWrapper<TzcPolicyItem> lqw = new LambdaQueryWrapper<>(param); |
||||
|
PageUtil.startPage(); |
||||
|
List<TzcPolicyItem> list = tzcPolicyItemService.list(lqw); |
||||
|
return R.ok(list); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 翻页 |
||||
|
* @param param |
||||
|
* @return |
||||
|
*/ |
||||
|
@GetMapping("/page") |
||||
|
public R<PageVo<TzcPolicyItem>> getPage(TzcPolicyItem param){ |
||||
|
LambdaQueryWrapper<TzcPolicyItem> lqw = new LambdaQueryWrapper<>(param); |
||||
|
PageUtil.startPage(); |
||||
|
List<TzcPolicyItem> list = tzcPolicyItemService.list(lqw); |
||||
|
return R.byPageHelperList(list); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* ID查询 |
||||
|
* @param id |
||||
|
* @return |
||||
|
*/ |
||||
|
//@GetMapping("/getById/{id}")
|
||||
|
@SysLog(module = SystemModule.Policy, title = "政策项", biz = BizType.QUERY) |
||||
|
public R<TzcPolicyItem> getById(@PathVariable("id") String id){ |
||||
|
TzcPolicyItem tzcPolicyItem = tzcPolicyItemService.getById(id); |
||||
|
return R.ok(tzcPolicyItem); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 更新 |
||||
|
* @param param |
||||
|
* @return |
||||
|
*/ |
||||
|
@PostMapping("/updateById") |
||||
|
@SysLog(module = SystemModule.Policy, title = "政策项", biz = BizType.UPDATE) |
||||
|
@PreAuthorize("hasRole('tzc:policy:insert')") |
||||
|
public R<?> updateById(@RequestBody @Valid TzcPolicyItemBo param){ |
||||
|
TzcPolicyItem entity = CopierUtil.copy(param,new TzcPolicyItem()); |
||||
|
boolean result = tzcPolicyItemService.updateById(entity); |
||||
|
return R.isTrue(result); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 新增 |
||||
|
* @param param |
||||
|
* @return |
||||
|
*/ |
||||
|
@PostMapping("/save") |
||||
|
@SysLog(module = SystemModule.Policy, title = "政策项", biz = BizType.INSERT) |
||||
|
@PreAuthorize("hasRole('tzc:policyItem:insert')") |
||||
|
public R<?> save(@RequestBody @Valid TzcPolicyItemBo param){ |
||||
|
TzcPolicyItem entity = CopierUtil.copy(param,new TzcPolicyItem()); |
||||
|
boolean result = tzcPolicyItemService.save(entity); |
||||
|
return R.isTrue(result); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 删除 |
||||
|
* @param ids |
||||
|
* @return |
||||
|
*/ |
||||
|
@DeleteMapping("/deleteById/{ids}") |
||||
|
@SysLog(module = SystemModule.Policy, title = "政策项", biz = BizType.DELETE) |
||||
|
@PreAuthorize("hasRole('tzc:policy:insert')") |
||||
|
public R<?> deleteById(@PathVariable("ids") String ids){ |
||||
|
List<Long> idsLong = StringUtils.splitIdLong(ids); |
||||
|
boolean result = tzcPolicyItemService.removeByIds(idsLong); |
||||
|
return R.isTrue(result); |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
|
@ -0,0 +1,156 @@ |
|||||
|
package com.qs.serve.modules.tzc.entity; |
||||
|
|
||||
|
import java.time.LocalDate; |
||||
|
import java.io.Serializable; |
||||
|
import java.math.BigDecimal; |
||||
|
import java.time.LocalDateTime; |
||||
|
import java.util.List; |
||||
|
|
||||
|
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-20 |
||||
|
*/ |
||||
|
@Data |
||||
|
@TableName("tzc_policy") |
||||
|
public class TzcPolicy implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** id */ |
||||
|
@TableId(type = IdType.AUTO) |
||||
|
private Long id; |
||||
|
|
||||
|
/** 主题 */ |
||||
|
@NotBlank(message = "主题不能为空") |
||||
|
@Length(max = 60,message = "主题长度不能超过60字") |
||||
|
private String title; |
||||
|
|
||||
|
/** 政策编码 */ |
||||
|
@NotBlank(message = "政策编码不能为空") |
||||
|
@Length(max = 50,message = "政策编码长度不能超过50字") |
||||
|
private String policyCode; |
||||
|
|
||||
|
/** 通过状态(0-未提交;1-审核中;2-已通过待执行;3-拒绝;4-被驳回;5-结束) */ |
||||
|
@NotNull(message = "通过状态不能为空") |
||||
|
private Integer policyStatus; |
||||
|
|
||||
|
/** 通过时间 */ |
||||
|
@Length(max = 0,message = "通过时间长度不能超过0字") |
||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") |
||||
|
private LocalDateTime passTime; |
||||
|
|
||||
|
/** 客户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; |
||||
|
|
||||
|
/** 申请人 */ |
||||
|
@NotBlank(message = "申请人不能为空") |
||||
|
@Length(max = 32,message = "申请人长度不能超过32字") |
||||
|
private String userId; |
||||
|
|
||||
|
/** 申请人 */ |
||||
|
@NotBlank(message = "申请人不能为空") |
||||
|
@Length(max = 32,message = "申请人长度不能超过32字") |
||||
|
private String userCode; |
||||
|
|
||||
|
/** 申请人 */ |
||||
|
@NotBlank(message = "申请人不能为空") |
||||
|
@Length(max = 32,message = "申请人长度不能超过32字") |
||||
|
private String userName; |
||||
|
|
||||
|
/** 成本中心类型 */ |
||||
|
@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; |
||||
|
|
||||
|
/** 科目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; |
||||
|
|
||||
|
/** 备注 */ |
||||
|
@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; |
||||
|
|
||||
|
@TableField(exist = false) |
||||
|
List<?> policyItemList; |
||||
|
|
||||
|
} |
||||
|
|
@ -0,0 +1,109 @@ |
|||||
|
package com.qs.serve.modules.tzc.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-20 |
||||
|
*/ |
||||
|
@Data |
||||
|
@TableName("tzc_policy_goods") |
||||
|
public class TzcPolicyGoods implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** id */ |
||||
|
@TableId(type = IdType.AUTO) |
||||
|
private Long id; |
||||
|
|
||||
|
/** 政策id */ |
||||
|
@NotNull(message = "政策id不能为空") |
||||
|
private Long policyId; |
||||
|
|
||||
|
/** 政策项id */ |
||||
|
@NotNull(message = "政策项id不能为空") |
||||
|
private Long policyItemId; |
||||
|
|
||||
|
/** 政策编码 */ |
||||
|
@NotBlank(message = "政策编码不能为空") |
||||
|
@Length(max = 50,message = "政策编码长度不能超过50字") |
||||
|
private String policyItemCode; |
||||
|
|
||||
|
/** 目标类型(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; |
||||
|
|
||||
|
} |
||||
|
|
@ -0,0 +1,174 @@ |
|||||
|
package com.qs.serve.modules.tzc.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-20 |
||||
|
*/ |
||||
|
@Data |
||||
|
@TableName("tzc_policy_item") |
||||
|
public class TzcPolicyItem implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** id */ |
||||
|
@TableId(type = IdType.AUTO) |
||||
|
private Long id; |
||||
|
|
||||
|
/** 主题 */ |
||||
|
@NotBlank(message = "主题不能为空") |
||||
|
@Length(max = 60,message = "主题长度不能超过60字") |
||||
|
private String title; |
||||
|
|
||||
|
/** 政策id */ |
||||
|
@NotNull(message = "政策id不能为空") |
||||
|
private Long policyId; |
||||
|
|
||||
|
/** 政策编码 */ |
||||
|
@NotBlank(message = "政策编码不能为空") |
||||
|
@Length(max = 50,message = "政策编码长度不能超过50字") |
||||
|
private String policyItemCode; |
||||
|
|
||||
|
/** 开始时间 */ |
||||
|
@NotNull(message = "开始时间不能为空") |
||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd") |
||||
|
@JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8") |
||||
|
private LocalDate policyStartDate; |
||||
|
|
||||
|
/** 结束时间 */ |
||||
|
@NotNull(message = "结束时间不能为空") |
||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd") |
||||
|
@JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8") |
||||
|
private LocalDate policyEndDate; |
||||
|
|
||||
|
/** 状态:0-未使用;1-已使用;2-已用完 */ |
||||
|
@NotNull(message = "状态:0-未使用;1-已使用;2-已用完不能为空") |
||||
|
private Integer policyItemStatus; |
||||
|
|
||||
|
/** 满减金额 */ |
||||
|
@NotNull(message = "满减金额不能为空") |
||||
|
private BigDecimal discountAmount; |
||||
|
|
||||
|
/** 返点百分比 */ |
||||
|
@NotNull(message = "返点百分比不能为空") |
||||
|
private BigDecimal discountRate; |
||||
|
|
||||
|
/** 已用金额 */ |
||||
|
@NotNull(message = "已用金额不能为空") |
||||
|
private BigDecimal usedAmount; |
||||
|
|
||||
|
/** 客户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; |
||||
|
|
||||
|
/** 申请人 */ |
||||
|
@NotBlank(message = "申请人不能为空") |
||||
|
@Length(max = 32,message = "申请人长度不能超过32字") |
||||
|
private String userId; |
||||
|
|
||||
|
/** 申请人 */ |
||||
|
@NotBlank(message = "申请人不能为空") |
||||
|
@Length(max = 32,message = "申请人长度不能超过32字") |
||||
|
private String userCode; |
||||
|
|
||||
|
/** 申请人 */ |
||||
|
@NotBlank(message = "申请人不能为空") |
||||
|
@Length(max = 32,message = "申请人长度不能超过32字") |
||||
|
private String userName; |
||||
|
|
||||
|
/** 成本中心类型 */ |
||||
|
@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; |
||||
|
|
||||
|
/** 科目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; |
||||
|
|
||||
|
/** 备注 */ |
||||
|
@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; |
||||
|
|
||||
|
} |
||||
|
|
@ -0,0 +1,69 @@ |
|||||
|
package com.qs.serve.modules.tzc.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; |
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* 政策 Bo |
||||
|
* @author YenHex |
||||
|
* @since 2023-02-20 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class TzcPolicyBo implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** id */ |
||||
|
private Long id; |
||||
|
|
||||
|
/** 主题 */ |
||||
|
@NotBlank(message = "主题不能为空") |
||||
|
@Length(max = 60,message = "主题长度不能超过60字") |
||||
|
private String title; |
||||
|
|
||||
|
/** 政策编码 */ |
||||
|
@NotBlank(message = "政策编码不能为空") |
||||
|
@Length(max = 50,message = "政策编码长度不能超过50字") |
||||
|
private String policyCode; |
||||
|
|
||||
|
|
||||
|
/** 客户id */ |
||||
|
@NotNull(message = "客户id不能为空") |
||||
|
private Long supplierId; |
||||
|
|
||||
|
/** 成本中心类型 */ |
||||
|
@NotBlank(message = "成本中心类型不能为空") |
||||
|
@Length(max = 50,message = "成本中心类型长度不能超过50字") |
||||
|
private String centerType; |
||||
|
|
||||
|
/** 成本中心id */ |
||||
|
@NotBlank(message = "成本中心id不能为空") |
||||
|
@Length(max = 32,message = "成本中心id长度不能超过32字") |
||||
|
private String centerId; |
||||
|
|
||||
|
/** 科目id */ |
||||
|
@NotNull(message = "科目id不能为空") |
||||
|
private Long subjectId; |
||||
|
|
||||
|
/** 备注 */ |
||||
|
@Length(max = 255,message = "备注长度不能超过255字") |
||||
|
private String remark; |
||||
|
|
||||
|
/** 备注 */ |
||||
|
private List<TzcPolicyItemBo> policyItemList; |
||||
|
|
||||
|
} |
||||
|
|
@ -0,0 +1,100 @@ |
|||||
|
package com.qs.serve.modules.tzc.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 2023-02-20 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class TzcPolicyGoodsBo implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** id */ |
||||
|
private Long id; |
||||
|
|
||||
|
/** 政策id */ |
||||
|
@NotNull(message = "政策id不能为空") |
||||
|
private Long policyId; |
||||
|
|
||||
|
/** 政策项id */ |
||||
|
@NotNull(message = "政策项id不能为空") |
||||
|
private Long policyItemId; |
||||
|
|
||||
|
/** 政策编码 */ |
||||
|
@NotBlank(message = "政策编码不能为空") |
||||
|
@Length(max = 50,message = "政策编码长度不能超过50字") |
||||
|
private String policyItemCode; |
||||
|
|
||||
|
/** 目标类型(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") |
||||
|
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; |
||||
|
|
||||
|
} |
||||
|
|
@ -0,0 +1,163 @@ |
|||||
|
package com.qs.serve.modules.tzc.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 2023-02-20 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class TzcPolicyItemBo implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** id */ |
||||
|
private Long id; |
||||
|
|
||||
|
/** 主题 */ |
||||
|
@NotBlank(message = "主题不能为空") |
||||
|
@Length(max = 60,message = "主题长度不能超过60字") |
||||
|
private String title; |
||||
|
|
||||
|
/** 政策id */ |
||||
|
@NotNull(message = "政策id不能为空") |
||||
|
private Long policyId; |
||||
|
|
||||
|
/** 政策编码 */ |
||||
|
@NotBlank(message = "政策编码不能为空") |
||||
|
@Length(max = 50,message = "政策编码长度不能超过50字") |
||||
|
private String policyItemCode; |
||||
|
|
||||
|
/** 开始时间 */ |
||||
|
@NotNull(message = "开始时间不能为空") |
||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd") |
||||
|
private LocalDate policyStartDate; |
||||
|
|
||||
|
/** 结束时间 */ |
||||
|
@NotNull(message = "结束时间不能为空") |
||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd") |
||||
|
private LocalDate policyEndDate; |
||||
|
|
||||
|
/** 状态:0-未使用;1-已使用;2-已用完 */ |
||||
|
@NotNull(message = "状态:0-未使用;1-已使用;2-已用完不能为空") |
||||
|
private Integer policyItemStatus; |
||||
|
|
||||
|
/** 满减金额 */ |
||||
|
@NotNull(message = "满减金额不能为空") |
||||
|
private BigDecimal discountAmount; |
||||
|
|
||||
|
/** 返点百分比 */ |
||||
|
@NotNull(message = "返点百分比不能为空") |
||||
|
private BigDecimal discountRate; |
||||
|
|
||||
|
/** 已用金额 */ |
||||
|
@NotNull(message = "已用金额不能为空") |
||||
|
private BigDecimal usedAmount; |
||||
|
|
||||
|
/** 客户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; |
||||
|
|
||||
|
/** 申请人 */ |
||||
|
@NotBlank(message = "申请人不能为空") |
||||
|
@Length(max = 32,message = "申请人长度不能超过32字") |
||||
|
private String userId; |
||||
|
|
||||
|
/** 申请人 */ |
||||
|
@NotBlank(message = "申请人不能为空") |
||||
|
@Length(max = 32,message = "申请人长度不能超过32字") |
||||
|
private String userCode; |
||||
|
|
||||
|
/** 申请人 */ |
||||
|
@NotBlank(message = "申请人不能为空") |
||||
|
@Length(max = 32,message = "申请人长度不能超过32字") |
||||
|
private String userName; |
||||
|
|
||||
|
/** 成本中心类型 */ |
||||
|
@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; |
||||
|
|
||||
|
/** 科目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; |
||||
|
|
||||
|
/** 备注 */ |
||||
|
@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; |
||||
|
|
||||
|
} |
||||
|
|
@ -0,0 +1,14 @@ |
|||||
|
package com.qs.serve.modules.tzc.mapper; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
|
import com.qs.serve.modules.tzc.entity.TzcPolicyGoods; |
||||
|
|
||||
|
/** |
||||
|
* 政策商品 Mapper |
||||
|
* @author YenHex |
||||
|
* @date 2023-02-20 |
||||
|
*/ |
||||
|
public interface TzcPolicyGoodsMapper extends BaseMapper<TzcPolicyGoods> { |
||||
|
|
||||
|
} |
||||
|
|
@ -0,0 +1,14 @@ |
|||||
|
package com.qs.serve.modules.tzc.mapper; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
|
import com.qs.serve.modules.tzc.entity.TzcPolicyItem; |
||||
|
|
||||
|
/** |
||||
|
* 政策项 Mapper |
||||
|
* @author YenHex |
||||
|
* @date 2023-02-20 |
||||
|
*/ |
||||
|
public interface TzcPolicyItemMapper extends BaseMapper<TzcPolicyItem> { |
||||
|
|
||||
|
} |
||||
|
|
@ -0,0 +1,14 @@ |
|||||
|
package com.qs.serve.modules.tzc.mapper; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
|
import com.qs.serve.modules.tzc.entity.TzcPolicy; |
||||
|
|
||||
|
/** |
||||
|
* 政策 Mapper |
||||
|
* @author YenHex |
||||
|
* @date 2023-02-20 |
||||
|
*/ |
||||
|
public interface TzcPolicyMapper extends BaseMapper<TzcPolicy> { |
||||
|
|
||||
|
} |
||||
|
|
@ -0,0 +1,14 @@ |
|||||
|
package com.qs.serve.modules.tzc.service; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.extension.service.IService; |
||||
|
import com.qs.serve.modules.tzc.entity.TzcPolicyGoods; |
||||
|
|
||||
|
/** |
||||
|
* 政策商品 服务接口 |
||||
|
* @author YenHex |
||||
|
* @date 2023-02-20 |
||||
|
*/ |
||||
|
public interface TzcPolicyGoodsService extends IService<TzcPolicyGoods> { |
||||
|
|
||||
|
} |
||||
|
|
@ -0,0 +1,17 @@ |
|||||
|
package com.qs.serve.modules.tzc.service; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.extension.service.IService; |
||||
|
import com.qs.serve.modules.tzc.entity.TzcPolicyItem; |
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* 政策项 服务接口 |
||||
|
* @author YenHex |
||||
|
* @date 2023-02-20 |
||||
|
*/ |
||||
|
public interface TzcPolicyItemService extends IService<TzcPolicyItem> { |
||||
|
|
||||
|
List<TzcPolicyItem> listByPolicyId(Long id); |
||||
|
|
||||
|
} |
||||
|
|
@ -0,0 +1,18 @@ |
|||||
|
package com.qs.serve.modules.tzc.service; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.extension.service.IService; |
||||
|
import com.qs.serve.common.model.dto.R; |
||||
|
import com.qs.serve.modules.tzc.entity.TzcPolicy; |
||||
|
import com.qs.serve.modules.tzc.entity.bo.TzcPolicyBo; |
||||
|
|
||||
|
/** |
||||
|
* 政策 服务接口 |
||||
|
* @author YenHex |
||||
|
* @date 2023-02-20 |
||||
|
*/ |
||||
|
public interface TzcPolicyService extends IService<TzcPolicy> { |
||||
|
|
||||
|
R<?> modify(TzcPolicyBo policyParam); |
||||
|
|
||||
|
} |
||||
|
|
@ -0,0 +1,22 @@ |
|||||
|
package com.qs.serve.modules.tzc.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.tzc.entity.TzcPolicyGoods; |
||||
|
import com.qs.serve.modules.tzc.service.TzcPolicyGoodsService; |
||||
|
import com.qs.serve.modules.tzc.mapper.TzcPolicyGoodsMapper; |
||||
|
|
||||
|
/** |
||||
|
* 政策商品 服务实现类 |
||||
|
* @author YenHex |
||||
|
* @since 2023-02-20 |
||||
|
*/ |
||||
|
@Slf4j |
||||
|
@Service |
||||
|
@AllArgsConstructor |
||||
|
public class TzcPolicyGoodsServiceImpl extends ServiceImpl<TzcPolicyGoodsMapper,TzcPolicyGoods> implements TzcPolicyGoodsService { |
||||
|
|
||||
|
} |
||||
|
|
@ -0,0 +1,32 @@ |
|||||
|
package com.qs.serve.modules.tzc.service.impl; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
||||
|
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.tzc.entity.TzcPolicyItem; |
||||
|
import com.qs.serve.modules.tzc.service.TzcPolicyItemService; |
||||
|
import com.qs.serve.modules.tzc.mapper.TzcPolicyItemMapper; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* 政策项 服务实现类 |
||||
|
* @author YenHex |
||||
|
* @since 2023-02-20 |
||||
|
*/ |
||||
|
@Slf4j |
||||
|
@Service |
||||
|
@AllArgsConstructor |
||||
|
public class TzcPolicyItemServiceImpl extends ServiceImpl<TzcPolicyItemMapper,TzcPolicyItem> implements TzcPolicyItemService { |
||||
|
|
||||
|
@Override |
||||
|
public List<TzcPolicyItem> listByPolicyId(Long id) { |
||||
|
LambdaQueryWrapper<TzcPolicyItem> lqw = new LambdaQueryWrapper<>(); |
||||
|
lqw.eq(TzcPolicyItem::getPolicyId,id); |
||||
|
List<TzcPolicyItem> policyItemList = this.list(lqw); |
||||
|
return policyItemList; |
||||
|
} |
||||
|
} |
||||
|
|
@ -0,0 +1,92 @@ |
|||||
|
package com.qs.serve.modules.tzc.service.impl; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
||||
|
import com.qs.serve.common.model.dto.R; |
||||
|
import com.qs.serve.common.util.AuthContextUtils; |
||||
|
import com.qs.serve.common.util.CopierUtil; |
||||
|
import com.qs.serve.common.util.IdUtil; |
||||
|
import com.qs.serve.modules.bms.entity.BmsSubject; |
||||
|
import com.qs.serve.modules.bms.entity.BmsSupplier; |
||||
|
import com.qs.serve.modules.bms.service.BmsSubjectService; |
||||
|
import com.qs.serve.modules.bms.service.BmsSupplierService; |
||||
|
import com.qs.serve.modules.goods.entity.dto.TbsCenterDto; |
||||
|
import com.qs.serve.modules.sys.entity.SysUser; |
||||
|
import com.qs.serve.modules.sys.service.SysUserService; |
||||
|
import com.qs.serve.modules.tbs.service.TbsCenterDtoService; |
||||
|
import com.qs.serve.modules.tzc.common.TzcPolicyStatus; |
||||
|
import com.qs.serve.modules.tzc.entity.TzcPolicyItem; |
||||
|
import com.qs.serve.modules.tzc.entity.bo.TzcPolicyBo; |
||||
|
import com.qs.serve.modules.tzc.service.TzcPolicyItemService; |
||||
|
import lombok.AllArgsConstructor; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
import com.qs.serve.modules.tzc.entity.TzcPolicy; |
||||
|
import com.qs.serve.modules.tzc.service.TzcPolicyService; |
||||
|
import com.qs.serve.modules.tzc.mapper.TzcPolicyMapper; |
||||
|
import org.springframework.transaction.annotation.Transactional; |
||||
|
|
||||
|
/** |
||||
|
* 政策 服务实现类 |
||||
|
* @author YenHex |
||||
|
* @since 2023-02-20 |
||||
|
*/ |
||||
|
@Slf4j |
||||
|
@Service |
||||
|
@AllArgsConstructor |
||||
|
public class TzcPolicyServiceImpl extends ServiceImpl<TzcPolicyMapper,TzcPolicy> implements TzcPolicyService { |
||||
|
|
||||
|
private BmsSupplierService bmsSupplierService; |
||||
|
private BmsSubjectService bmsSubjectService; |
||||
|
private SysUserService sysUserService; |
||||
|
private TbsCenterDtoService tbsCenterDtoService; |
||||
|
private TzcPolicyItemService tzcPolicyItemService; |
||||
|
|
||||
|
@Override |
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
public R<?> modify(TzcPolicyBo policyParam) { |
||||
|
Long policyId = policyParam.getId(); |
||||
|
TzcPolicy tzcPolicy; |
||||
|
if(policyId!=null){ |
||||
|
tzcPolicy = this.getById(policyId); |
||||
|
if(tzcPolicy.getPolicyStatus().equals(TzcPolicyStatus.Status_0_UnCommit) |
||||
|
&& tzcPolicy.getPolicyStatus().equals(TzcPolicyStatus.Status_4_RollBack)){ |
||||
|
return R.error("当前状态不支持编辑"); |
||||
|
} |
||||
|
}else { |
||||
|
tzcPolicy = new TzcPolicy(); |
||||
|
} |
||||
|
TbsCenterDto centerDto = tbsCenterDtoService.getCenterDto(policyParam.getCenterType(),policyParam.getCenterId()); |
||||
|
BmsSupplier supplier = bmsSupplierService.getById(policyParam.getSupplierId()); |
||||
|
SysUser sysUser = sysUserService.getById(AuthContextUtils.getSysUserId()); |
||||
|
BmsSubject bmsSubject = bmsSubjectService.getById(policyParam.getSubjectId()); |
||||
|
tzcPolicy.setTitle(policyParam.getTitle()); |
||||
|
tzcPolicy.setPolicyCode(IdUtil.getSnowflake()+""); |
||||
|
tzcPolicy.setSupplierId(policyParam.getSupplierId()); |
||||
|
tzcPolicy.setSubjectCode(supplier.getCode()); |
||||
|
tzcPolicy.setSupplierName(supplier.getName()); |
||||
|
tzcPolicy.setUserId(sysUser.getId()); |
||||
|
tzcPolicy.setUserCode(sysUser.getCode()); |
||||
|
tzcPolicy.setUserName(sysUser.getName()); |
||||
|
tzcPolicy.setCenterType(centerDto.getCenterType()); |
||||
|
tzcPolicy.setCenterId(centerDto.getId()); |
||||
|
tzcPolicy.setCenterCode(centerDto.getCenterCode()); |
||||
|
tzcPolicy.setCenterName(centerDto.getCenterName()); |
||||
|
tzcPolicy.setSubjectId(bmsSubject.getId()); |
||||
|
tzcPolicy.setSubjectCode(bmsSubject.getSubjectCode()); |
||||
|
tzcPolicy.setSubjectName(bmsSubject.getSubjectName()); |
||||
|
tzcPolicy.setRemark(policyParam.getRemark()); |
||||
|
//更新
|
||||
|
if(policyId!=null){ |
||||
|
LambdaQueryWrapper<TzcPolicyItem> lqw = new LambdaQueryWrapper<>(); |
||||
|
lqw.eq(TzcPolicyItem::getPolicyId,policyId); |
||||
|
TzcPolicyItem policyItem = CopierUtil.copy(tzcPolicy,new TzcPolicyItem()); |
||||
|
policyItem.setRemark(null); |
||||
|
tzcPolicyItemService.update(policyItem,lqw); |
||||
|
} |
||||
|
this.saveOrUpdate(tzcPolicy); |
||||
|
return R.ok(tzcPolicy); |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
|
Loading…
Reference in new issue