fix:十二分制-积分流水
This commit is contained in:
@@ -44,4 +44,13 @@ public enum JoinModeEnum {
|
||||
public static boolean isFranchise(Integer code) {
|
||||
return code == FRANCHISE_DEPARTMENT.code || code == AFFILIATES.code;
|
||||
}
|
||||
|
||||
public static String getDescByCode(Integer code) {
|
||||
for (JoinModeEnum e : JoinModeEnum.values()) {
|
||||
if (e.getCode() == code) {
|
||||
return e.desc;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
package com.cool.store.enums.master;
|
||||
|
||||
/**
|
||||
* @Author suzhuhong
|
||||
* @Date 2025/8/6 16:49
|
||||
* @Version 1.0
|
||||
*/
|
||||
public enum BrandTypeEnum {
|
||||
|
||||
JP(1, "正新鸡排"),
|
||||
SMZ(2, "正新三明治"),
|
||||
ZSJ(3, "正烧记"),
|
||||
MX(4, "大鼓米线"),
|
||||
CXM(5, "串小妹"),
|
||||
MZG(6, "茂掌柜");
|
||||
|
||||
;
|
||||
private Integer code;
|
||||
|
||||
private String desc;
|
||||
|
||||
BrandTypeEnum(Integer code, String desc) {
|
||||
this.code = code;
|
||||
this.desc = desc;
|
||||
}
|
||||
|
||||
public Integer getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public String getDesc() {
|
||||
return desc;
|
||||
}
|
||||
|
||||
public static Integer getCodeByDesc(String desc) {
|
||||
for (BrandTypeEnum value : values()) {
|
||||
if (value.getDesc().equals(desc)) {
|
||||
return value.getCode();
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static String getDescByCode(Integer code) {
|
||||
for (BrandTypeEnum value : values()) {
|
||||
if (value.getCode().equals(code)) {
|
||||
return value.getDesc();
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -15,16 +15,18 @@ import lombok.Getter;
|
||||
@AllArgsConstructor
|
||||
public enum TpFormTypeEnum {
|
||||
|
||||
REWARD(0, "加分申请单"),
|
||||
WARNING(1, "警告书"),
|
||||
PENALTY(2, "处罚书"),
|
||||
APPEAL(3, "复议申请单"),
|
||||
REWARD(0, "加分申请单", "加分申请单"),
|
||||
WARNING(1, "警告书", "惩处申请单"),
|
||||
PENALTY(2, "处罚书", "惩处申请单"),
|
||||
APPEAL(3, "复议申请单", "复议申请单"),
|
||||
;
|
||||
|
||||
private final Integer type;
|
||||
|
||||
private final String msg;
|
||||
|
||||
private final String alias;
|
||||
|
||||
public static String getMsgByType(Integer type) {
|
||||
for (TpFormTypeEnum value : values()) {
|
||||
if (value.type.equals(type)) {
|
||||
|
||||
@@ -2,8 +2,14 @@ package com.cool.store.dao.tp;
|
||||
|
||||
import com.cool.store.entity.tp.TpScoreJournalDO;
|
||||
import com.cool.store.mapper.tp.TpScoreJournalMapper;
|
||||
import com.cool.store.request.tp.TpScoreJournalQueryRequest;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Repository;
|
||||
import tk.mybatis.mapper.entity.Example;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -24,4 +30,38 @@ public class TpScoreJournalDAO {
|
||||
public void insertSelective(TpScoreJournalDO record) {
|
||||
tpScoreJournalMapper.insertSelective(record);
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*/
|
||||
public List<TpScoreJournalDO> getList(TpScoreJournalQueryRequest request) {
|
||||
Example example = new Example(TpScoreJournalDO.class);
|
||||
Example.Criteria criteria = example.createCriteria();
|
||||
if (StringUtils.isNotBlank(request.getStoreNameOrNum())) {
|
||||
criteria.andCondition("store_num LIKE '%" + request.getStoreNameOrNum() + "%' OR store_name LIKE '%" + request.getStoreNameOrNum() + "%'");
|
||||
}
|
||||
if (Objects.nonNull(request.getJoinBrand())) {
|
||||
criteria.andEqualTo("joinBrand", request.getJoinBrand());
|
||||
}
|
||||
if (Objects.nonNull(request.getJoinModel())) {
|
||||
criteria.andEqualTo("joinModel", request.getJoinModel());
|
||||
}
|
||||
if (Objects.nonNull(request.getStoreType())) {
|
||||
criteria.andEqualTo("storeType", request.getStoreType());
|
||||
}
|
||||
if (Objects.nonNull(request.getStartDate())) {
|
||||
criteria.andGreaterThanOrEqualTo("occurDate", request.getStartDate());
|
||||
}
|
||||
if (Objects.nonNull(request.getEndDate())) {
|
||||
criteria.andLessThanOrEqualTo("occurDate", request.getEndDate());
|
||||
}
|
||||
if (Objects.nonNull(request.getApplyType())) {
|
||||
criteria.andEqualTo("applyType", request.getApplyType());
|
||||
}
|
||||
if (StringUtils.isNotBlank(request.getApplyNo())) {
|
||||
criteria.andLike("applyNo", "%" + request.getApplyNo() + "%");
|
||||
}
|
||||
example.setOrderByClause("createTime DESC");
|
||||
return tpScoreJournalMapper.selectByExample(example);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,10 +20,6 @@ public class TpAppealApplyRequest {
|
||||
@ApiModelProperty("id")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty("门店id")
|
||||
@NotBlank(message = "门店id不能为空")
|
||||
private String storeId;
|
||||
|
||||
@ApiModelProperty("是否为草稿 0否 1是")
|
||||
@NotNull(message = "是否为草稿不能为空")
|
||||
private Integer isDraft;
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
package com.cool.store.request.tp;
|
||||
|
||||
import com.cool.store.common.PageBasicInfo;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 积分流水查询Request
|
||||
* </p>
|
||||
*
|
||||
* @author wangff
|
||||
* @since 2025/11/10
|
||||
*/
|
||||
@Data
|
||||
public class TpScoreJournalQueryRequest extends PageBasicInfo {
|
||||
@ApiModelProperty("门店名称或编码")
|
||||
private String storeNameOrNum;
|
||||
|
||||
@ApiModelProperty("加盟品牌")
|
||||
private Integer joinBrand;
|
||||
|
||||
@ApiModelProperty("加盟模式")
|
||||
private Integer joinModel;
|
||||
|
||||
@ApiModelProperty("门店类型")
|
||||
private Integer storeType;
|
||||
|
||||
@ApiModelProperty("开始发生日期")
|
||||
private Date startDate;
|
||||
|
||||
@ApiModelProperty("结束发生日期")
|
||||
private Date endDate;
|
||||
|
||||
@ApiModelProperty("来源单据,0加分申请单 2处罚申请单")
|
||||
private Integer applyType;
|
||||
|
||||
@ApiModelProperty("来源单号")
|
||||
private String applyNo;
|
||||
}
|
||||
@@ -0,0 +1,100 @@
|
||||
package com.cool.store.vo.tp;
|
||||
|
||||
import com.cool.store.enums.JoinModeEnum;
|
||||
import com.cool.store.enums.StoreTypeEnum;
|
||||
import com.cool.store.enums.master.BrandTypeEnum;
|
||||
import com.cool.store.enums.tp.TpFormTypeEnum;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 积分流水VO
|
||||
* </p>
|
||||
*
|
||||
* @author wangff
|
||||
* @since 2025/11/10
|
||||
*/
|
||||
@Data
|
||||
public class TpScoreJournalVO {
|
||||
@ApiModelProperty("流水号")
|
||||
private String journalNo;
|
||||
|
||||
@ApiModelProperty("门店编码")
|
||||
private String storeNum;
|
||||
|
||||
@ApiModelProperty("加盟品牌")
|
||||
private Integer joinBrand;
|
||||
|
||||
@ApiModelProperty("加盟品牌名称")
|
||||
private String joinBrandName;
|
||||
|
||||
@ApiModelProperty("加盟模式")
|
||||
private Integer joinModel;
|
||||
|
||||
@ApiModelProperty("加盟模式名称")
|
||||
private String joinModelName;
|
||||
|
||||
@ApiModelProperty("门店类型")
|
||||
private Integer storeType;
|
||||
|
||||
@ApiModelProperty("门店类型名称")
|
||||
private String storeTypeName;
|
||||
|
||||
@ApiModelProperty("门店名称")
|
||||
private String storeName;
|
||||
|
||||
@ApiModelProperty("发生分值")
|
||||
private String occurScore;
|
||||
|
||||
@ApiModelProperty("发生日期")
|
||||
private Date occurDate;
|
||||
|
||||
@ApiModelProperty("发生前分值")
|
||||
private BigDecimal occurBeforeScore;
|
||||
|
||||
@ApiModelProperty("发生后分值")
|
||||
private BigDecimal occurAfterScore;
|
||||
|
||||
@ApiModelProperty("单据类型")
|
||||
private Integer applyType;
|
||||
|
||||
@ApiModelProperty("单据类型名称")
|
||||
private String applyTypeName;
|
||||
|
||||
@ApiModelProperty("来源单号")
|
||||
private String applyNo;
|
||||
|
||||
@ApiModelProperty("项目大类")
|
||||
private String projectCategory;
|
||||
|
||||
@ApiModelProperty("项目名称")
|
||||
private String projectName;
|
||||
|
||||
@ApiModelProperty("规则编码")
|
||||
private String ruleNo;
|
||||
|
||||
@ApiModelProperty("创建时间")
|
||||
private Date createTime;
|
||||
|
||||
public String getJoinBrandName() {
|
||||
return BrandTypeEnum.getDescByCode(this.joinBrand);
|
||||
}
|
||||
|
||||
public String getJoinModelNam() {
|
||||
return JoinModeEnum.getDescByCode(this.joinModel);
|
||||
}
|
||||
|
||||
public String getStoreTypeName() {
|
||||
return StoreTypeEnum.getMessage(this.storeType);
|
||||
}
|
||||
|
||||
public String getApplyTypeName() {
|
||||
TpFormTypeEnum type = TpFormTypeEnum.getByType(this.applyType);
|
||||
return Objects.nonNull(type) ? type.getAlias() : null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.cool.store.service.tp;
|
||||
|
||||
import com.cool.store.request.tp.TpScoreJournalQueryRequest;
|
||||
import com.cool.store.vo.tp.TpScoreJournalVO;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 十二分制-积分流水 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author wangff
|
||||
* @since 2025/11/10
|
||||
*/
|
||||
public interface TpScoreJournalService {
|
||||
|
||||
/**
|
||||
* 积分流水分页查询
|
||||
* @param request 积分流水查询Request
|
||||
* @return 积分流水VO列表
|
||||
*/
|
||||
PageInfo<TpScoreJournalVO> getPage(TpScoreJournalQueryRequest request);
|
||||
}
|
||||
@@ -211,6 +211,7 @@ public class TpApplyServiceImpl implements TpApplyService {
|
||||
formDO.setApplyNo(isInsert ? TpHelper.generateAppealNo() : null);
|
||||
formDO.setRuleId(punishFormDO.getRuleId());
|
||||
formDO.setType(TpFormTypeEnum.APPEAL.getType());
|
||||
formDO.setStoreId(punishFormDO.getStoreId());
|
||||
fillRuleFields(formDO);
|
||||
tpApplyFormDAO.insertOrUpdate(formDO);
|
||||
// 第一次提交后添加审批记录
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
package com.cool.store.service.tp.impl;
|
||||
|
||||
import com.cool.store.dao.tp.TpScoreJournalDAO;
|
||||
import com.cool.store.entity.tp.TpScoreJournalDO;
|
||||
import com.cool.store.request.tp.TpScoreJournalQueryRequest;
|
||||
import com.cool.store.service.tp.TpScoreJournalService;
|
||||
import com.cool.store.utils.BeanUtil;
|
||||
import com.cool.store.vo.tp.TpScoreJournalVO;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 十二分制-积分流水 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author wangff
|
||||
* @since 2025/11/10
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class TpScoreJournalServiceImpl implements TpScoreJournalService {
|
||||
private final TpScoreJournalDAO tpScoreJournalDAO;
|
||||
|
||||
@Override
|
||||
public PageInfo<TpScoreJournalVO> getPage(TpScoreJournalQueryRequest request) {
|
||||
PageHelper.startPage(request.getPageNum(), request.getPageSize());
|
||||
List<TpScoreJournalDO> list = tpScoreJournalDAO.getList(request);
|
||||
PageInfo<TpScoreJournalDO> page = new PageInfo<>(list);
|
||||
return BeanUtil.toPage(page, TpScoreJournalVO.class);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
package com.cool.store.controller.webb;
|
||||
|
||||
import com.cool.store.request.tp.TpScoreJournalQueryRequest;
|
||||
import com.cool.store.response.ResponseResult;
|
||||
import com.cool.store.service.tp.TpScoreJournalService;
|
||||
import com.cool.store.vo.tp.TpScoreJournalVO;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 十二分制-积分流水 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author wangff
|
||||
* @since 2025/11/10
|
||||
*/
|
||||
@Api(tags = "十二分制-积分流水")
|
||||
@RestController
|
||||
@RequestMapping("/pc/tp/journal")
|
||||
@RequiredArgsConstructor
|
||||
public class TpScoreJournalController {
|
||||
private final TpScoreJournalService tpScoreJournalService;
|
||||
|
||||
@ApiOperation("积分流水分页查询")
|
||||
@GetMapping("/page")
|
||||
public ResponseResult<PageInfo<TpScoreJournalVO>> getPage(TpScoreJournalQueryRequest request) {
|
||||
return ResponseResult.success(tpScoreJournalService.getPage(request));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user