fix:十二分制-奖惩规则
This commit is contained in:
@@ -28,7 +28,7 @@ public class TpHelper {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static String generateCode() {
|
private static String generateCode() {
|
||||||
return LocalDateTime.now().format(dtf) + (int) (Math.random() * 900) + 100;
|
return LocalDateTime.now().format(dtf) + ((int) (Math.random() * 900) + 100);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ public class TpRuleDAO {
|
|||||||
return tpRuleMapper.selectByPrimaryKey(id);
|
return tpRuleMapper.selectByPrimaryKey(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<TpRuleDO> getList(TpRuleQueryRequest request) {
|
public List<TpRuleDO> getEffectiveList(TpRuleQueryRequest request) {
|
||||||
Example example = new Example(TpRuleDO.class);
|
Example example = new Example(TpRuleDO.class);
|
||||||
Example.Criteria criteria = example.createCriteria();
|
Example.Criteria criteria = example.createCriteria();
|
||||||
if (StringUtils.isNotBlank(request.getProblemClassification())) {
|
if (StringUtils.isNotBlank(request.getProblemClassification())) {
|
||||||
@@ -68,11 +68,15 @@ public class TpRuleDAO {
|
|||||||
criteria.andEqualTo("projectCategory", request.getProjectCategory());
|
criteria.andEqualTo("projectCategory", request.getProjectCategory());
|
||||||
}
|
}
|
||||||
if (StringUtils.isNotBlank(request.getProjectName())) {
|
if (StringUtils.isNotBlank(request.getProjectName())) {
|
||||||
criteria.andLike("projectName", request.getProjectName());
|
criteria.andLike("projectName", "%" + request.getProjectName() + "%");
|
||||||
}
|
}
|
||||||
if (Objects.nonNull(request.getStatus())) {
|
if (Objects.nonNull(request.getStatus())) {
|
||||||
criteria.andEqualTo("status", request.getStatus());
|
criteria.andEqualTo("status", request.getStatus());
|
||||||
}
|
}
|
||||||
|
if (Objects.nonNull(request.getType())) {
|
||||||
|
criteria.andEqualTo("type", request.getType());
|
||||||
|
}
|
||||||
|
criteria.andEqualTo("deleted", 0);
|
||||||
example.setOrderByClause("create_time DESC");
|
example.setOrderByClause("create_time DESC");
|
||||||
return tpRuleMapper.selectByExample(example);
|
return tpRuleMapper.selectByExample(example);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
<result column="warning_limit" jdbcType="INTEGER" property="warningLimit" />
|
<result column="warning_limit" jdbcType="INTEGER" property="warningLimit" />
|
||||||
<result column="point" jdbcType="DECIMAL" property="point" />
|
<result column="point" jdbcType="DECIMAL" property="point" />
|
||||||
<result column="amount" jdbcType="DECIMAL" property="amount" />
|
<result column="amount" jdbcType="DECIMAL" property="amount" />
|
||||||
<result column="review_deadline" jdbcType="INTEGER" property="reviewDeadline" />
|
<result column="appeal_deadline" jdbcType="INTEGER" property="appealDeadline" />
|
||||||
<result column="status" jdbcType="BIT" property="status" />
|
<result column="status" jdbcType="BIT" property="status" />
|
||||||
<result column="remark" jdbcType="VARCHAR" property="remark" />
|
<result column="remark" jdbcType="VARCHAR" property="remark" />
|
||||||
<result column="is_full" jdbcType="BIT" property="isFull" />
|
<result column="is_full" jdbcType="BIT" property="isFull" />
|
||||||
|
|||||||
@@ -75,8 +75,8 @@ public class TpRuleDO {
|
|||||||
/**
|
/**
|
||||||
* 复议申请时效
|
* 复议申请时效
|
||||||
*/
|
*/
|
||||||
@Column(name = "review_deadline")
|
@Column(name = "appeal_deadline")
|
||||||
private Integer reviewDeadline;
|
private Integer appealDeadline;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 启用状态,0未启用 1启用
|
* 启用状态,0未启用 1启用
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ public class TpPenaltyRuleUpdateRequest {
|
|||||||
|
|
||||||
@ApiModelProperty("复议申请时效")
|
@ApiModelProperty("复议申请时效")
|
||||||
@NotNull(message = "复议申请时效不能为空", groups = {InsertGroup.class, UpdateGroup.class})
|
@NotNull(message = "复议申请时效不能为空", groups = {InsertGroup.class, UpdateGroup.class})
|
||||||
private Integer reviewDeadline;
|
private Integer appealDeadline;
|
||||||
|
|
||||||
@ApiModelProperty("启用状态,0未启用 1启用")
|
@ApiModelProperty("启用状态,0未启用 1启用")
|
||||||
@NotNull(message = "启用状态不能为空", groups = {InsertGroup.class, UpdateGroup.class})
|
@NotNull(message = "启用状态不能为空", groups = {InsertGroup.class, UpdateGroup.class})
|
||||||
|
|||||||
@@ -25,4 +25,7 @@ public class TpRuleQueryRequest extends PageBasicInfo {
|
|||||||
|
|
||||||
@ApiModelProperty("启用状态,0未启用 1启用")
|
@ApiModelProperty("启用状态,0未启用 1启用")
|
||||||
private Integer status;
|
private Integer status;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "规则类型,0扣分 1加分", hidden = true)
|
||||||
|
private Integer type;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ public class TpPenaltyRuleDetailVO {
|
|||||||
private BigDecimal amount;
|
private BigDecimal amount;
|
||||||
|
|
||||||
@ApiModelProperty("复议申请时效")
|
@ApiModelProperty("复议申请时效")
|
||||||
private Integer reviewDeadline;
|
private Integer appealDeadline;
|
||||||
|
|
||||||
@ApiModelProperty("启用状态,0未启用 1启用")
|
@ApiModelProperty("启用状态,0未启用 1启用")
|
||||||
private Integer status;
|
private Integer status;
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.cool.store.vo.tp;
|
package com.cool.store.vo.tp;
|
||||||
|
|
||||||
|
import com.cool.store.annotation.DictField;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
@@ -24,9 +25,17 @@ public class TpPenaltyRuleListVO {
|
|||||||
@ApiModelProperty("问题分类")
|
@ApiModelProperty("问题分类")
|
||||||
private String problemClassification;
|
private String problemClassification;
|
||||||
|
|
||||||
|
@ApiModelProperty("问题分类名称")
|
||||||
|
@DictField
|
||||||
|
private String problemClassificationName;
|
||||||
|
|
||||||
@ApiModelProperty("项目大类")
|
@ApiModelProperty("项目大类")
|
||||||
private String projectCategory;
|
private String projectCategory;
|
||||||
|
|
||||||
|
@ApiModelProperty("项目大类名称")
|
||||||
|
@DictField
|
||||||
|
private String projectCategoryName;
|
||||||
|
|
||||||
@ApiModelProperty("惩处项目名称")
|
@ApiModelProperty("惩处项目名称")
|
||||||
private String projectName;
|
private String projectName;
|
||||||
|
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ public class TpRuleServiceImpl implements TpRuleService {
|
|||||||
@Override
|
@Override
|
||||||
public PageInfo<TpPenaltyRuleListVO> penaltyRulePage(TpRuleQueryRequest request) {
|
public PageInfo<TpPenaltyRuleListVO> penaltyRulePage(TpRuleQueryRequest request) {
|
||||||
PageHelper.startPage(request.getPageNum(), request.getPageSize());
|
PageHelper.startPage(request.getPageNum(), request.getPageSize());
|
||||||
List<TpRuleDO> list = tpRuleDAO.getList(request);
|
List<TpRuleDO> list = tpRuleDAO.getEffectiveList(request);
|
||||||
PageInfo<TpRuleDO> page = new PageInfo<>(list);
|
PageInfo<TpRuleDO> page = new PageInfo<>(list);
|
||||||
PageInfo<TpPenaltyRuleListVO> newPage = BeanUtil.toPage(page, TpPenaltyRuleListVO.class);
|
PageInfo<TpPenaltyRuleListVO> newPage = BeanUtil.toPage(page, TpPenaltyRuleListVO.class);
|
||||||
dictService.fillDictField(newPage.getList());
|
dictService.fillDictField(newPage.getList());
|
||||||
@@ -97,7 +97,7 @@ public class TpRuleServiceImpl implements TpRuleService {
|
|||||||
@Override
|
@Override
|
||||||
public PageInfo<TpRewardRuleDetailVO> rewardRulePage(TpRuleQueryRequest request) {
|
public PageInfo<TpRewardRuleDetailVO> rewardRulePage(TpRuleQueryRequest request) {
|
||||||
PageHelper.startPage(request.getPageNum(), request.getPageSize());
|
PageHelper.startPage(request.getPageNum(), request.getPageSize());
|
||||||
List<TpRuleDO> list = tpRuleDAO.getList(request);
|
List<TpRuleDO> list = tpRuleDAO.getEffectiveList(request);
|
||||||
PageInfo<TpRuleDO> page = new PageInfo<>(list);
|
PageInfo<TpRuleDO> page = new PageInfo<>(list);
|
||||||
PageInfo<TpRewardRuleDetailVO> newPage = BeanUtil.toPage(page, TpRewardRuleDetailVO.class);
|
PageInfo<TpRewardRuleDetailVO> newPage = BeanUtil.toPage(page, TpRewardRuleDetailVO.class);
|
||||||
dictService.fillDictField(newPage.getList());
|
dictService.fillDictField(newPage.getList());
|
||||||
|
|||||||
@@ -58,6 +58,7 @@ public class TpRuleController {
|
|||||||
@ApiOperation("惩处规则分页查询")
|
@ApiOperation("惩处规则分页查询")
|
||||||
@GetMapping("/penaltyPage")
|
@GetMapping("/penaltyPage")
|
||||||
public ResponseResult<PageInfo<TpPenaltyRuleListVO>> penaltyRulePage(TpRuleQueryRequest request) {
|
public ResponseResult<PageInfo<TpPenaltyRuleListVO>> penaltyRulePage(TpRuleQueryRequest request) {
|
||||||
|
request.setType(0);
|
||||||
return ResponseResult.success(tpRuleService.penaltyRulePage(request));
|
return ResponseResult.success(tpRuleService.penaltyRulePage(request));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -83,6 +84,7 @@ public class TpRuleController {
|
|||||||
@ApiOperation("加分规则分页查询")
|
@ApiOperation("加分规则分页查询")
|
||||||
@GetMapping("/rewardPage")
|
@GetMapping("/rewardPage")
|
||||||
public ResponseResult<PageInfo<TpRewardRuleDetailVO>> rewardRulePage(TpRuleQueryRequest request) {
|
public ResponseResult<PageInfo<TpRewardRuleDetailVO>> rewardRulePage(TpRuleQueryRequest request) {
|
||||||
|
request.setType(1);
|
||||||
return ResponseResult.success(tpRuleService.rewardRulePage(request));
|
return ResponseResult.success(tpRuleService.rewardRulePage(request));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user