Merge branch 'cc_2021104_twelve_points' into 'master'
Cc 2021104 twelve points See merge request hangzhou/java/custom_zxjp!201
This commit is contained in:
@@ -0,0 +1,15 @@
|
|||||||
|
package com.cool.store.annotation;
|
||||||
|
|
||||||
|
import java.lang.annotation.ElementType;
|
||||||
|
import java.lang.annotation.Retention;
|
||||||
|
import java.lang.annotation.RetentionPolicy;
|
||||||
|
import java.lang.annotation.Target;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 字典表填充字段
|
||||||
|
*/
|
||||||
|
@Target(ElementType.FIELD)
|
||||||
|
@Retention(RetentionPolicy.RUNTIME)
|
||||||
|
public @interface DictField {
|
||||||
|
String sourceField() default "";
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
package com.cool.store.common;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 新增分组
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author wangff
|
||||||
|
* @since 2025/11/4
|
||||||
|
*/
|
||||||
|
public interface InsertGroup {
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
package com.cool.store.common;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 更新分组
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author wangff
|
||||||
|
* @since 2025/11/4
|
||||||
|
*/
|
||||||
|
public interface UpdateGroup {
|
||||||
|
}
|
||||||
@@ -324,9 +324,24 @@ public enum ErrorCodeEnum {
|
|||||||
WALLET_OPEN_ACCOUNT_FAIL(1620001,"钱包开通失败",null),
|
WALLET_OPEN_ACCOUNT_FAIL(1620001,"钱包开通失败",null),
|
||||||
WALLET_WITH_DRAWER_FAIL(1620002,"提现失败",null),
|
WALLET_WITH_DRAWER_FAIL(1620002,"提现失败",null),
|
||||||
WALLET_API_ERROR(1620003,"{0}",null),
|
WALLET_API_ERROR(1620003,"{0}",null),
|
||||||
|
|
||||||
CURRENT_BRAND_SORT_NUMBER_EXIST(16100007,"当前品牌已存在该排序数字!",null),
|
CURRENT_BRAND_SORT_NUMBER_EXIST(16100007,"当前品牌已存在该排序数字!",null),
|
||||||
CONTRACT_CONFIG_NOT_EXIST(16100008,"合同配置不存在!",null);
|
CONTRACT_CONFIG_NOT_EXIST(16100008,"合同配置不存在!",null),
|
||||||
|
/**
|
||||||
|
* 181 十二分制
|
||||||
|
*/
|
||||||
|
TP_NOT_EXIST_RULE(1810000, "不存在该规则", null),
|
||||||
|
TP_MONTH_EXIST_APPLY(1810001, "该门店一个月内存在相同项目的加分申请", null),
|
||||||
|
TP_SCORE_EQUAL_TWELVE(1810002, "该门店已满12分,无法申请加分", null),
|
||||||
|
TP_NOT_EXIST_PENDING_AUDIT(1810003, "申请单不存在待审批记录", null),
|
||||||
|
TP_NOT_EXIST_APPLY_FORM(1810004, "不存在申请单", null),
|
||||||
|
TP_APPLY_AUDIT_COMPLETED(1810005, "该申请单已审批", null),
|
||||||
|
TP_EXISTS_PENDING_APPLY(1810006, "存在待审批的申请单", null),
|
||||||
|
TP_PENALTY_APPLY_APPEAL_COMPLETED(1810007, "该处罚单已完成复议", null),
|
||||||
|
TP_PENALTY_APPLY_EFFECTIVE(1810008, "该处罚单已生效", null),
|
||||||
|
TP_PENALTY_APPLY_UNABLE_ACCEPT(1810009, "该处罚单无法认缴", null),
|
||||||
|
TP_PENALTY_APPLY_INEFFECTIVE(1810010, "该处罚单未生效无法完成缴费", null),
|
||||||
|
TP_PENALTY_APPLY_NO_NEED_PAY(1810011, "该处罚单无需缴费", null),
|
||||||
|
|
||||||
;
|
;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -53,4 +53,13 @@ public enum JoinModeEnum {
|
|||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
package com.cool.store.enums.tp;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 十二分制-单据状态 枚举类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author wangff
|
||||||
|
* @since 2025/11/5
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@AllArgsConstructor
|
||||||
|
public enum TpFormStatusEnum {
|
||||||
|
|
||||||
|
PENDING("pending", "审批中"),
|
||||||
|
PASS("pass", "审批通过"),
|
||||||
|
REJECT("reject", "审批拒绝"),
|
||||||
|
|
||||||
|
EFFECTIVE("effective", "已生效"),
|
||||||
|
CANCEL("cancel", "已作废"),
|
||||||
|
;
|
||||||
|
|
||||||
|
private final String status;
|
||||||
|
|
||||||
|
private final String msg;
|
||||||
|
|
||||||
|
public static String getMsgByStatus(String status) {
|
||||||
|
for (TpFormStatusEnum value : values()) {
|
||||||
|
if (value.status.equals(status)) {
|
||||||
|
return value.msg;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,54 @@
|
|||||||
|
package com.cool.store.enums.tp;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 十二分制-单据类型 枚举类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author wangff
|
||||||
|
* @since 2025/11/6
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@AllArgsConstructor
|
||||||
|
public enum TpFormTypeEnum {
|
||||||
|
|
||||||
|
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)) {
|
||||||
|
return value.msg;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static TpFormTypeEnum getByType(Integer type) {
|
||||||
|
for (TpFormTypeEnum value : values()) {
|
||||||
|
if (value.type.equals(type)) {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是惩处单
|
||||||
|
*/
|
||||||
|
public static boolean isPenalty(Integer type) {
|
||||||
|
return PENALTY.getType().equals(type) || WARNING.getType().equals(type);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
package com.cool.store.enums.tp;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 十二分制-缴费状态 枚举类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author wangff
|
||||||
|
* @since 2025/11/5
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@AllArgsConstructor
|
||||||
|
public enum TpPayStatusEnum {
|
||||||
|
|
||||||
|
UNPAID(0, "未缴费"),
|
||||||
|
NO_NEED_PAY(1, "无需缴费"),
|
||||||
|
PAID(2, "已缴费")
|
||||||
|
;
|
||||||
|
|
||||||
|
private final Integer status;
|
||||||
|
|
||||||
|
private final String msg;
|
||||||
|
|
||||||
|
public static String getMsgByStatus(Integer status) {
|
||||||
|
for (TpPayStatusEnum value : values()) {
|
||||||
|
if (value.status.equals(status)) {
|
||||||
|
return value.msg;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -184,4 +184,9 @@ public class CoolDateUtils {
|
|||||||
Duration duration = Duration.between(start, end);
|
Duration duration = Duration.between(start, end);
|
||||||
return duration.toMinutes();
|
return duration.toMinutes();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static Date localDate2Date(LocalDate localDate) {
|
||||||
|
ZonedDateTime zonedDateTime = localDate.atStartOfDay(ZoneId.systemDefault());
|
||||||
|
return Date.from(zonedDateTime.toInstant());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,58 @@
|
|||||||
|
package com.cool.store.utils;
|
||||||
|
|
||||||
|
import com.cool.store.enums.tp.TpFormTypeEnum;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.time.format.DateTimeFormatter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 十二分制 辅助工具类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author wangff
|
||||||
|
* @since 2025/11/4
|
||||||
|
*/
|
||||||
|
public class TpHelper {
|
||||||
|
private final static DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyMMddHHmmssSSS");
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生成奖惩规则编码
|
||||||
|
* @param isReward 是否为加分规则
|
||||||
|
* @return 规则编码
|
||||||
|
*/
|
||||||
|
public static String generateRuleNo(boolean isReward) {
|
||||||
|
return (isReward ? "JR" : "CR") + generateCode();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生成积分流水号
|
||||||
|
*/
|
||||||
|
public static String generateScoreJournalNo() {
|
||||||
|
return "LS" + generateCode();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生成申请单号
|
||||||
|
* @param applyType 单据类型
|
||||||
|
* @return 申请单号
|
||||||
|
*/
|
||||||
|
public static String generateApplyNo(Integer applyType) {
|
||||||
|
TpFormTypeEnum type = TpFormTypeEnum.getByType(applyType);
|
||||||
|
if (type == null) return null;
|
||||||
|
return (TpFormTypeEnum.REWARD.equals(type) ? "JF" : TpFormTypeEnum.PENALTY.equals(type) ? "CF" : "JG") + generateCode();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生成复议申请单号
|
||||||
|
*/
|
||||||
|
public static String generateAppealNo() {
|
||||||
|
return "FY" + generateCode();
|
||||||
|
}
|
||||||
|
|
||||||
|
private static String generateCode() {
|
||||||
|
return LocalDateTime.now().format(dtf) + ((int) (Math.random() * 900) + 100);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.cool.store.dao;
|
package com.cool.store.dao;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollStreamUtil;
|
||||||
import com.cool.store.dto.store.StoreOrderTimeDTO;
|
import com.cool.store.dto.store.StoreOrderTimeDTO;
|
||||||
import com.cool.store.entity.StoreDO;
|
import com.cool.store.entity.StoreDO;
|
||||||
import com.cool.store.mapper.StoreMapper;
|
import com.cool.store.mapper.StoreMapper;
|
||||||
@@ -7,11 +8,12 @@ import com.cool.store.response.MiniShopsResponse;
|
|||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
import org.apache.commons.collections4.CollectionUtils;
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
import org.springframework.stereotype.Repository;
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.util.ArrayList;
|
import java.math.BigDecimal;
|
||||||
import java.util.List;
|
import java.util.*;
|
||||||
|
|
||||||
@Repository
|
@Repository
|
||||||
public class StoreDao {
|
public class StoreDao {
|
||||||
@@ -30,6 +32,13 @@ public class StoreDao {
|
|||||||
return storeMapper.getByStoreId(storeId);
|
return storeMapper.getByStoreId(storeId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public StoreDO getEffectiveByStoreId(String storeId) {
|
||||||
|
if(StringUtils.isBlank(storeId)) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return storeMapper.getEffectiveByStoreId(storeId);
|
||||||
|
}
|
||||||
|
|
||||||
public List<StoreDO> getEffectiveStoreByStoreIds(List<String> storeIdList) {
|
public List<StoreDO> getEffectiveStoreByStoreIds(List<String> storeIdList) {
|
||||||
if(CollectionUtils.isEmpty(storeIdList)) {
|
if(CollectionUtils.isEmpty(storeIdList)) {
|
||||||
return Lists.newArrayList();
|
return Lists.newArrayList();
|
||||||
@@ -102,4 +111,39 @@ public class StoreDao {
|
|||||||
public List<StoreDO> getAllStoreIdAndNum(List<String> storeStatus) {
|
public List<StoreDO> getAllStoreIdAndNum(List<String> storeStatus) {
|
||||||
return storeMapper.getAllStoreIdAndNum(storeStatus);
|
return storeMapper.getAllStoreIdAndNum(storeStatus);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询门店积分
|
||||||
|
* @param storeId 门店id
|
||||||
|
* @return 积分
|
||||||
|
*/
|
||||||
|
public BigDecimal getStoreScore(@Param("storeId") String storeId) {
|
||||||
|
BigDecimal score = storeMapper.getStoreScore(storeId);
|
||||||
|
if (Objects.isNull(score)) {
|
||||||
|
return BigDecimal.valueOf(12.0);
|
||||||
|
}
|
||||||
|
return score;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据门店id查询门店映射
|
||||||
|
* @param storeIds 门店id列表
|
||||||
|
* @return 门店id->门店
|
||||||
|
*/
|
||||||
|
public Map<String, StoreDO> getStoreMapByStoreIds(List<String> storeIds) {
|
||||||
|
if (CollectionUtils.isEmpty(storeIds)) {
|
||||||
|
return Collections.emptyMap();
|
||||||
|
}
|
||||||
|
List<StoreDO> storeList = storeMapper.getStoreByStoreIds(storeIds);
|
||||||
|
return CollStreamUtil.toMap(storeList, StoreDO::getStoreId, v -> v);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新门店积分
|
||||||
|
* @param storeId 门店id
|
||||||
|
* @param score 积分
|
||||||
|
*/
|
||||||
|
public boolean updateStoreScore(String storeId, BigDecimal score) {
|
||||||
|
return storeMapper.updateStoreScore(storeId, score) > 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,163 @@
|
|||||||
|
package com.cool.store.dao.dict;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollStreamUtil;
|
||||||
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
|
import com.alibaba.excel.util.CollectionUtils;
|
||||||
|
import com.cool.store.entity.dict.SysDictColumnDO;
|
||||||
|
import com.cool.store.entity.dict.SysDictTableDO;
|
||||||
|
import com.cool.store.mapper.dict.SysDictColumnMapper;
|
||||||
|
import com.cool.store.request.dict.DictColumnQueryRequest;
|
||||||
|
import com.cool.store.utils.BeanUtil;
|
||||||
|
import com.cool.store.vo.dict.DictColumnSimpleVO;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.apache.commons.collections4.MapUtils;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 字典项DAO
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author wangff
|
||||||
|
* @since 2025/9/26
|
||||||
|
*/
|
||||||
|
@Repository
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class SysDictColumnDAO {
|
||||||
|
private final SysDictColumnMapper sysDictColumnMapper;
|
||||||
|
private final SysDictTableDAO sysDictTableDAO;
|
||||||
|
|
||||||
|
|
||||||
|
public List<SysDictColumnDO> getList(DictColumnQueryRequest dto) {
|
||||||
|
return sysDictColumnMapper.selectList(dto);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据id查询
|
||||||
|
*
|
||||||
|
* @param id id
|
||||||
|
* @return 字典项信息表
|
||||||
|
*/
|
||||||
|
public SysDictColumnDO getById(Long id) {
|
||||||
|
return sysDictColumnMapper.selectById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据字典表id查询字典项数量
|
||||||
|
*
|
||||||
|
* @param tableIds 字典表id列表
|
||||||
|
* @return <字典表id, 字典项数量>
|
||||||
|
*/
|
||||||
|
public Map<Long, Integer> getColumnNumMapByTableIds(List<Long> tableIds) {
|
||||||
|
if (CollectionUtil.isEmpty(tableIds)) {
|
||||||
|
return Collections.emptyMap();
|
||||||
|
}
|
||||||
|
List<Map<String, Object>> mapList = sysDictColumnMapper.selectColumnNumByTableIds(tableIds);
|
||||||
|
return CollStreamUtil.toMap(mapList, v -> MapUtils.getLong(v, "dict_table_id"), v -> MapUtils.getInteger(v, "num"));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 过滤存在启用字典项的字典分组id
|
||||||
|
* @param groupIds 字典分组id列表
|
||||||
|
* @return 字典分组id列表
|
||||||
|
*/
|
||||||
|
public Set<Long> filterEnableColumnByGroupIds(List<Long> groupIds) {
|
||||||
|
if (CollectionUtil.isEmpty(groupIds)) {
|
||||||
|
return Collections.emptySet();
|
||||||
|
}
|
||||||
|
List<Map<String, Object>> list = sysDictColumnMapper.filterEnableColumnByGroupIds(groupIds);
|
||||||
|
return CollStreamUtil.toSet(list, v -> MapUtils.getLong(v, "dict_group_id"));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 过滤存在启用字典项的字典表id
|
||||||
|
* @param tableIds 字典表id列表
|
||||||
|
* @return 字典表id列表
|
||||||
|
*/
|
||||||
|
public Set<Long> filterEnableColumnByTableIds(List<Long> tableIds) {
|
||||||
|
if (CollectionUtil.isEmpty(tableIds)) {
|
||||||
|
return Collections.emptySet();
|
||||||
|
}
|
||||||
|
List<Map<String, Object>> list = sysDictColumnMapper.filterEnableColumnByTableIds(tableIds);
|
||||||
|
return CollStreamUtil.toSet(list, v -> MapUtils.getLong(v, "dict_table_id"));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据分组id删除
|
||||||
|
* @param groupIds 分组id列表
|
||||||
|
*/
|
||||||
|
public void deleteByGroupIds(List<Long> groupIds) {
|
||||||
|
if (CollectionUtil.isEmpty(groupIds)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
sysDictColumnMapper.deleteByGroupIds(groupIds);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据字典表id删除
|
||||||
|
* @param tableIds 字典表id列表
|
||||||
|
*/
|
||||||
|
public void deleteByTableIds(List<Long> tableIds) {
|
||||||
|
if (CollectionUtil.isEmpty(tableIds)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
sysDictColumnMapper.deleteByTableIds(tableIds);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据字典列编码查询已启用字典项信息
|
||||||
|
* @param columnCode 字典列编码
|
||||||
|
* @return 字典项信息
|
||||||
|
*/
|
||||||
|
public SysDictColumnDO getOpenColumnByCode(String columnCode) {
|
||||||
|
return sysDictColumnMapper.selectOpenColumnByCode(columnCode);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据字典列编码查询已启用字典名
|
||||||
|
* @param columnCode 字典列编码
|
||||||
|
* @return 字典名
|
||||||
|
*/
|
||||||
|
public String getNameByCode(String columnCode) {
|
||||||
|
SysDictColumnDO sysDictColumnDO = sysDictColumnMapper.selectOpenColumnByCode(columnCode);
|
||||||
|
if (Objects.nonNull(sysDictColumnDO)) {
|
||||||
|
return sysDictColumnDO.getColumnName();
|
||||||
|
}
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据字典列编码查询已启用字典项名称映射
|
||||||
|
* @param columnCodes 字典列编码列表
|
||||||
|
* @return <字典列编码, 字典项名称>
|
||||||
|
*/
|
||||||
|
public Map<String, String> getNameMapByCodes(List<String> columnCodes) {
|
||||||
|
if (CollectionUtils.isEmpty(columnCodes)) {
|
||||||
|
return Collections.emptyMap();
|
||||||
|
}
|
||||||
|
List<SysDictColumnDO> list = sysDictColumnMapper.selectOpenColumnByCodes(columnCodes);
|
||||||
|
return CollStreamUtil.toMap(list, SysDictColumnDO::getColumnCode, SysDictColumnDO::getColumnName);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据字典表编码查询启用状态的字典项
|
||||||
|
* @param tableCodes 字典表编码列表
|
||||||
|
* @return 字典项列表
|
||||||
|
*/
|
||||||
|
public List<DictColumnSimpleVO> getOpenColumnListByTableCode(List<String> tableCodes) {
|
||||||
|
List<SysDictTableDO> tableList = sysDictTableDAO.getOpenTableListByTableCodes(tableCodes);
|
||||||
|
if (CollectionUtils.isEmpty(tableList)) {
|
||||||
|
return Collections.emptyList();
|
||||||
|
}
|
||||||
|
List<Long> tableIds = CollStreamUtil.toList(tableList, SysDictTableDO::getId);
|
||||||
|
List<SysDictColumnDO> columnList = sysDictColumnMapper.selectOpenColumnListByTableIds(tableIds);
|
||||||
|
Map<Long, String> tableCodeMap = CollStreamUtil.toMap(tableList, SysDictTableDO::getId, SysDictTableDO::getTableCode);
|
||||||
|
return CollStreamUtil.toList(columnList, v -> {
|
||||||
|
DictColumnSimpleVO vo = BeanUtil.toBean(v, DictColumnSimpleVO.class);
|
||||||
|
vo.setTableCode(tableCodeMap.get(v.getDictTableId()));
|
||||||
|
return vo;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,41 @@
|
|||||||
|
package com.cool.store.dao.dict;
|
||||||
|
|
||||||
|
import com.cool.store.entity.dict.SysDictGroupDO;
|
||||||
|
import com.cool.store.mapper.dict.SysDictGroupMapper;
|
||||||
|
import com.cool.store.request.dict.DictGroupQueryRequest;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 字典分组DAO
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author wangff
|
||||||
|
* @since 2025/9/26
|
||||||
|
*/
|
||||||
|
@Repository
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class SysDictGroupDAO {
|
||||||
|
private final SysDictGroupMapper sysDictGroupMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据id查询
|
||||||
|
* @param id id
|
||||||
|
* @return 字典分组表
|
||||||
|
*/
|
||||||
|
public SysDictGroupDO getById(Long id) {
|
||||||
|
return sysDictGroupMapper.selectById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询列表
|
||||||
|
* @param dto 字典分组查询DTO
|
||||||
|
* @return 字典分组表列表
|
||||||
|
*/
|
||||||
|
public List<SysDictGroupDO> getList(DictGroupQueryRequest dto) {
|
||||||
|
return sysDictGroupMapper.selectList(dto);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,129 @@
|
|||||||
|
package com.cool.store.dao.dict;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollStreamUtil;
|
||||||
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
|
import com.alibaba.excel.util.CollectionUtils;
|
||||||
|
import com.cool.store.entity.dict.SysDictTableDO;
|
||||||
|
import com.cool.store.mapper.dict.SysDictTableMapper;
|
||||||
|
import com.cool.store.request.dict.DictTableQueryRequest;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.apache.commons.collections4.MapUtils;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 字典表DAO
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author wangff
|
||||||
|
* @since 2025/9/25
|
||||||
|
*/
|
||||||
|
@Repository
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class SysDictTableDAO {
|
||||||
|
|
||||||
|
private final SysDictTableMapper dictTableMapper;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 列表查询
|
||||||
|
* @param dto 字典表查询DTO
|
||||||
|
* @return 字典表信息表列表
|
||||||
|
*/
|
||||||
|
public List<SysDictTableDO> getList(DictTableQueryRequest dto) {
|
||||||
|
return dictTableMapper.selectList(dto);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据id查询
|
||||||
|
* @param id id
|
||||||
|
* @return 字典表信息表
|
||||||
|
*/
|
||||||
|
public SysDictTableDO getById(Long id) {
|
||||||
|
return dictTableMapper.selectById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据id查询
|
||||||
|
* @param ids id列表
|
||||||
|
* @return 字典表列表
|
||||||
|
*/
|
||||||
|
public List<SysDictTableDO> getByIds(List<Long> ids) {
|
||||||
|
if (CollectionUtils.isEmpty(ids)) {
|
||||||
|
return Collections.emptyList();
|
||||||
|
}
|
||||||
|
return dictTableMapper.selectByIds(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据字典表id查询所属字典分组id
|
||||||
|
* @param dictTableId 字典表id
|
||||||
|
* @return 字典分组id
|
||||||
|
*/
|
||||||
|
public Long getGroupIdByTableId(Long dictTableId) {
|
||||||
|
SysDictTableDO tableInfoDO = getById(dictTableId);
|
||||||
|
if (Objects.nonNull(tableInfoDO)) {
|
||||||
|
return tableInfoDO.getDictGroupId();
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据分组id查询字典表
|
||||||
|
* @param groupIds 字典分组id列表
|
||||||
|
* @return 字典表VO对象列表
|
||||||
|
*/
|
||||||
|
public List<SysDictTableDO> getListByGroupIds(List<Long> groupIds, Integer openStatus) {
|
||||||
|
if (CollectionUtil.isEmpty(groupIds)) {
|
||||||
|
return Collections.emptyList();
|
||||||
|
}
|
||||||
|
return dictTableMapper.selectByGroupIds(groupIds, openStatus);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 过滤存在启用字典表的字典分组id
|
||||||
|
* @param groupIds 字典分组id
|
||||||
|
* @return 字典分组id列表
|
||||||
|
*/
|
||||||
|
public Set<Long> filterEnableTableByGroupIds(List<Long> groupIds) {
|
||||||
|
if (CollectionUtil.isEmpty(groupIds)) {
|
||||||
|
return Collections.emptySet();
|
||||||
|
}
|
||||||
|
List<Map<String, Object>> maps = dictTableMapper.filterEnableTableByGroupIds(groupIds);
|
||||||
|
return CollStreamUtil.toSet(maps, v -> MapUtils.getLong(v, "dict_group_id"));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据分组id删除
|
||||||
|
* @param groupIds 分组id列表
|
||||||
|
*/
|
||||||
|
public void deleteByGroupIds(List<Long> groupIds) {
|
||||||
|
if (CollectionUtil.isEmpty(groupIds)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
dictTableMapper.deleteByGroupIds(groupIds);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据字典表编码查询
|
||||||
|
* @param tableCode 字典表编码
|
||||||
|
* @return 字典表
|
||||||
|
*/
|
||||||
|
public SysDictTableDO getByTableCode(String tableCode) {
|
||||||
|
return dictTableMapper.selectByTableCode(tableCode);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据字典表编码查询启用状态的字典表
|
||||||
|
* @param tableCodes 字典表编码
|
||||||
|
* @return 字典表列表
|
||||||
|
*/
|
||||||
|
public List<SysDictTableDO> getOpenTableListByTableCodes(List<String> tableCodes) {
|
||||||
|
if (CollectionUtils.isEmpty(tableCodes)) {
|
||||||
|
return Collections.emptyList();
|
||||||
|
}
|
||||||
|
return dictTableMapper.selectOpenTableListByTableCodes(tableCodes);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,223 @@
|
|||||||
|
package com.cool.store.dao.tp;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollStreamUtil;
|
||||||
|
import com.cool.store.entity.tp.TpApplyFormDO;
|
||||||
|
import com.cool.store.enums.tp.TpFormStatusEnum;
|
||||||
|
import com.cool.store.enums.tp.TpFormTypeEnum;
|
||||||
|
import com.cool.store.enums.tp.TpPayStatusEnum;
|
||||||
|
import com.cool.store.mapper.tp.TpApplyFormMapper;
|
||||||
|
import com.cool.store.request.tp.TpApplyQueryRequest;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
import tk.mybatis.mapper.entity.Example;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 十二分制-申请单DAO
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author wangff
|
||||||
|
* @since 2025/11/5
|
||||||
|
*/
|
||||||
|
@Repository
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class TpApplyFormDAO {
|
||||||
|
private final TpApplyFormMapper tpApplyFormMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增
|
||||||
|
*/
|
||||||
|
public boolean insertSelective(TpApplyFormDO tpApplyFormDO) {
|
||||||
|
return tpApplyFormMapper.insertSelective(tpApplyFormDO) > 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 编辑
|
||||||
|
*/
|
||||||
|
public boolean updateSelective(TpApplyFormDO tpApplyFormDO) {
|
||||||
|
return tpApplyFormMapper.updateByPrimaryKeySelective(tpApplyFormDO) > 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean insertOrUpdate(TpApplyFormDO tpApplyFormDO) {
|
||||||
|
if (Objects.isNull(tpApplyFormDO.getId())) {
|
||||||
|
return tpApplyFormMapper.insertSelective(tpApplyFormDO) > 0;
|
||||||
|
} else {
|
||||||
|
return tpApplyFormMapper.updateByPrimaryKeySelective(tpApplyFormDO) > 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 一个月内是否存在相同加分申请
|
||||||
|
* @param storeId 门店id
|
||||||
|
* @param ruleId 规则id
|
||||||
|
* @return 是否存在
|
||||||
|
*/
|
||||||
|
public boolean existPassRewardForm(String storeId, Long ruleId) {
|
||||||
|
Example example = new Example(TpApplyFormDO.class);
|
||||||
|
example.createCriteria()
|
||||||
|
.andEqualTo("type", 0)
|
||||||
|
.andEqualTo("storeId", storeId)
|
||||||
|
.andEqualTo("ruleId", ruleId)
|
||||||
|
.andEqualTo("status", TpFormStatusEnum.PASS.getStatus())
|
||||||
|
.andGreaterThan("approveTime", LocalDate.now().minusMonths(1));
|
||||||
|
return tpApplyFormMapper.selectCountByExample(example) > 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据id查询
|
||||||
|
*/
|
||||||
|
public TpApplyFormDO getById(Long id) {
|
||||||
|
return tpApplyFormMapper.selectByPrimaryKey(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据id查询有效申请单
|
||||||
|
*/
|
||||||
|
public TpApplyFormDO getEffectiveById(Long id) {
|
||||||
|
return tpApplyFormMapper.selectOne(TpApplyFormDO.builder().id(id).deleted(0).build());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询有效记录列表
|
||||||
|
* @param request 申请单查询Request
|
||||||
|
* @return 申请单列表
|
||||||
|
*/
|
||||||
|
public List<TpApplyFormDO> getEffectiveList(TpApplyQueryRequest request) {
|
||||||
|
return tpApplyFormMapper.getEffectiveList(request);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询门店相同规则的惩处单数量
|
||||||
|
* @param storeId 门店id
|
||||||
|
* @param ruleId 规则id
|
||||||
|
* @return 数量
|
||||||
|
*/
|
||||||
|
public int getPenaltyCount(String storeId, Long ruleId) {
|
||||||
|
Example example = new Example(TpApplyFormDO.class);
|
||||||
|
example.createCriteria()
|
||||||
|
.andEqualTo("storeId", storeId)
|
||||||
|
.andEqualTo("ruleId", ruleId)
|
||||||
|
.andNotEqualTo("status", TpFormStatusEnum.CANCEL.getStatus())
|
||||||
|
.andIn("type", Arrays.asList(TpFormTypeEnum.WARNING.getType(), TpFormTypeEnum.PENALTY.getType()))
|
||||||
|
.andEqualTo("deleted", 0);
|
||||||
|
return tpApplyFormMapper.selectCountByExample(example);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否存在待审批的申请单
|
||||||
|
* @param storeId 门店id
|
||||||
|
* @param ruleId 规则id
|
||||||
|
* @param types 单据类型
|
||||||
|
* @return 是否存在
|
||||||
|
*/
|
||||||
|
public boolean existsPendingApply(String storeId, Long ruleId, List<Integer> types) {
|
||||||
|
Example example = new Example(TpApplyFormDO.class);
|
||||||
|
Example.Criteria criteria = example.createCriteria()
|
||||||
|
.andEqualTo("storeId", storeId)
|
||||||
|
.andEqualTo("ruleId", ruleId)
|
||||||
|
.andEqualTo("status", TpFormStatusEnum.PENDING.getStatus())
|
||||||
|
.andEqualTo("isDraft", 0)
|
||||||
|
.andEqualTo("deleted", 0);
|
||||||
|
if (CollectionUtils.isNotEmpty(types)) {
|
||||||
|
criteria.andIn("type", types);
|
||||||
|
}
|
||||||
|
return tpApplyFormMapper.selectCountByExample(example) > 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据处罚单id查询复议申请单
|
||||||
|
* @param penaltyId 处罚单id
|
||||||
|
* @return 申请单
|
||||||
|
*/
|
||||||
|
public TpApplyFormDO getAppealByPenaltyId(Long penaltyId) {
|
||||||
|
return tpApplyFormMapper.selectOne(TpApplyFormDO.builder().penaltyId(penaltyId).deleted(0).build());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据处罚单id列表查询申请单
|
||||||
|
* @param penaltyIds 处罚单id列表
|
||||||
|
* @return 申请单列表
|
||||||
|
*/
|
||||||
|
public List<TpApplyFormDO> getByPenaltyIds(List<Long> penaltyIds) {
|
||||||
|
if (CollectionUtils.isEmpty(penaltyIds)) {
|
||||||
|
return Collections.emptyList();
|
||||||
|
}
|
||||||
|
Example example = new Example(TpApplyFormDO.class);
|
||||||
|
example.createCriteria().andIn("penaltyId", penaltyIds).andEqualTo("deleted", 0);
|
||||||
|
return tpApplyFormMapper.selectByExample(example);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 过滤存在正在复议的申请单
|
||||||
|
* @param penaltyIds 处罚单id列表
|
||||||
|
* @return 存在复议的处罚单id列表
|
||||||
|
*/
|
||||||
|
public Set<Long> filterExistAppeal(List<Long> penaltyIds) {
|
||||||
|
if (CollectionUtils.isEmpty(penaltyIds)) {
|
||||||
|
return Collections.emptySet();
|
||||||
|
}
|
||||||
|
Example example = new Example(TpApplyFormDO.class);
|
||||||
|
example.createCriteria().andIn("penaltyId", penaltyIds)
|
||||||
|
.andEqualTo("type", TpFormTypeEnum.APPEAL.getType())
|
||||||
|
.andEqualTo("status", TpFormStatusEnum.PENDING.getStatus())
|
||||||
|
.andEqualTo("deleted", 0);
|
||||||
|
example.selectProperties("penaltyId");
|
||||||
|
List<TpApplyFormDO> list = tpApplyFormMapper.selectByExample(example);
|
||||||
|
return CollStreamUtil.toSet(list, TpApplyFormDO::getPenaltyId);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据id列表查询
|
||||||
|
*/
|
||||||
|
public List<TpApplyFormDO> getByIds(List<Long> ids) {
|
||||||
|
if (CollectionUtils.isEmpty(ids)) {
|
||||||
|
return Collections.emptyList();
|
||||||
|
}
|
||||||
|
Example example = new Example(TpApplyFormDO.class);
|
||||||
|
example.createCriteria().andIn("id", ids);
|
||||||
|
return tpApplyFormMapper.selectByExample(example);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改申请单状态
|
||||||
|
*/
|
||||||
|
public void updateStatus(Long applyId, TpFormStatusEnum status) {
|
||||||
|
Example example = new Example(TpApplyFormDO.class);
|
||||||
|
example.createCriteria().andEqualTo("id", applyId).andEqualTo("deleted", 0);
|
||||||
|
tpApplyFormMapper.updateByExampleSelective(TpApplyFormDO.builder().status(status.getStatus()).build(), example);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void updateStatusBatch(List<Long> applyIds, TpFormStatusEnum status) {
|
||||||
|
if (CollectionUtils.isEmpty(applyIds)) {
|
||||||
|
return ;
|
||||||
|
}
|
||||||
|
Example example = new Example(TpApplyFormDO.class);
|
||||||
|
example.createCriteria().andIn("id", applyIds).andEqualTo("deleted", 0);
|
||||||
|
tpApplyFormMapper.updateByExampleSelective(TpApplyFormDO.builder().status(status.getStatus()).build(), example);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改缴费状态
|
||||||
|
*/
|
||||||
|
public void updatePayStatus(Long applyId, TpPayStatusEnum payStatus) {
|
||||||
|
Example example = new Example(TpApplyFormDO.class);
|
||||||
|
example.createCriteria().andEqualTo("id", applyId).andEqualTo("deleted", 0);
|
||||||
|
tpApplyFormMapper.updateByExampleSelective(TpApplyFormDO.builder().payStatus(payStatus.getStatus()).build(), example);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据id删除
|
||||||
|
*/
|
||||||
|
public void deleteByIds(List<Long> ids) {
|
||||||
|
if (CollectionUtils.isEmpty(ids)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
Example example = new Example(TpApplyFormDO.class);
|
||||||
|
example.createCriteria().andIn("id", ids).andEqualTo("deleted", 0);
|
||||||
|
tpApplyFormMapper.updateByExampleSelective(TpApplyFormDO.builder().deleted(1).build(), example);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,195 @@
|
|||||||
|
package com.cool.store.dao.tp;
|
||||||
|
|
||||||
|
import com.alibaba.excel.util.CollectionUtils;
|
||||||
|
import com.cool.store.constants.CommonConstants;
|
||||||
|
import com.cool.store.entity.tp.TpAuditRecordDO;
|
||||||
|
import com.cool.store.enums.ErrorCodeEnum;
|
||||||
|
import com.cool.store.enums.OperationLogAuditEnum;
|
||||||
|
import com.cool.store.exception.ServiceException;
|
||||||
|
import com.cool.store.mapper.tp.TpAuditRecordMapper;
|
||||||
|
import com.cool.store.response.AuditInfoResponse;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
import tk.mybatis.mapper.entity.Example;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 十二分制-审批记录DAO
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author wangff
|
||||||
|
* @since 2025/11/6
|
||||||
|
*/
|
||||||
|
@Repository
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class TpAuditRecordDAO {
|
||||||
|
private final TpAuditRecordMapper tpAuditRecordMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增提交记录
|
||||||
|
*
|
||||||
|
* @param applyId 申请单id
|
||||||
|
* @param applyType 单据类型,0加分单 1警告书 2处罚书
|
||||||
|
* @param userId 申请人id
|
||||||
|
* @param userName 申请人名称
|
||||||
|
*/
|
||||||
|
public void addSubmitRecord(Long applyId, Integer applyType, String userId, String userName) {
|
||||||
|
Date now = new Date();
|
||||||
|
TpAuditRecordDO recordDO = TpAuditRecordDO.builder()
|
||||||
|
.applyType(applyType)
|
||||||
|
.applyId(applyId)
|
||||||
|
.recordType(1)
|
||||||
|
.auditStatus(1)
|
||||||
|
.handlerUserId(userId)
|
||||||
|
.handlerUserName(userName)
|
||||||
|
.receiveTaskTime(now)
|
||||||
|
.finishTaskTime(now)
|
||||||
|
.build();
|
||||||
|
tpAuditRecordMapper.insertSelective(recordDO);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增审批记录
|
||||||
|
*
|
||||||
|
* @param applyId 申请单id
|
||||||
|
* @param applyType 单据类型,0加分单 1警告书 2处罚书
|
||||||
|
*/
|
||||||
|
public void addApproveRecord(Long applyId, Integer applyType) {
|
||||||
|
Date now = new Date();
|
||||||
|
TpAuditRecordDO recordDO = TpAuditRecordDO.builder()
|
||||||
|
.applyType(applyType)
|
||||||
|
.applyId(applyId)
|
||||||
|
.recordType(2)
|
||||||
|
.auditStatus(0)
|
||||||
|
.receiveTaskTime(now)
|
||||||
|
.finishTaskTime(now)
|
||||||
|
.build();
|
||||||
|
tpAuditRecordMapper.insertSelective(recordDO);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 首次发起流程
|
||||||
|
*
|
||||||
|
* @param applyId 申请单id
|
||||||
|
* @param applyType 单据类型,0加分单 1警告书 2处罚书
|
||||||
|
* @param userId 申请人id
|
||||||
|
* @param userName 申请人名称
|
||||||
|
*/
|
||||||
|
public void firstAddRecord(Long applyId, Integer applyType, String userId, String userName) {
|
||||||
|
TpAuditRecordDO auditRecordDO = getPendingRecordByApplyId(applyId, applyType);
|
||||||
|
if (Objects.isNull(auditRecordDO)) {
|
||||||
|
addSubmitRecord(applyId, applyType, userId, userName);
|
||||||
|
addApproveRecord(applyId, applyType);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据申请单id查询待审批记录
|
||||||
|
*
|
||||||
|
* @param applyId 申请单id
|
||||||
|
* @param applyType 单据类型,0加分单 1警告书 2处罚书
|
||||||
|
* @return 审批记录
|
||||||
|
*/
|
||||||
|
public TpAuditRecordDO getPendingRecordByApplyId(Long applyId, Integer applyType) {
|
||||||
|
TpAuditRecordDO recordDO = TpAuditRecordDO.builder()
|
||||||
|
.applyId(applyId)
|
||||||
|
.applyType(applyType)
|
||||||
|
.auditStatus(0)
|
||||||
|
.build();
|
||||||
|
return tpAuditRecordMapper.selectOne(recordDO);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据申请单id审批待处理的审批记录
|
||||||
|
*
|
||||||
|
* @param applyId 申请单id
|
||||||
|
* @param applyType 单据类型,0加分单 1警告书 2处罚书
|
||||||
|
* @param userId 审批人id
|
||||||
|
* @param userName 审批人名称
|
||||||
|
* @param auditStatus 审批状态
|
||||||
|
* @param remark 备注
|
||||||
|
* @param auditTime 审批时间
|
||||||
|
*/
|
||||||
|
public void auditPendingRecordByApplyId(Long applyId, Integer applyType, String userId, String userName, Integer auditStatus, String remark, Date auditTime) {
|
||||||
|
TpAuditRecordDO auditRecordDO = getPendingRecordByApplyId(applyId, applyType);
|
||||||
|
if (Objects.isNull(auditRecordDO)) {
|
||||||
|
throw new ServiceException(ErrorCodeEnum.TP_NOT_EXIST_PENDING_AUDIT);
|
||||||
|
}
|
||||||
|
auditRecordDO.setAuditStatus(auditStatus);
|
||||||
|
auditRecordDO.setRemark(remark);
|
||||||
|
auditRecordDO.setHandlerUserId(userId);
|
||||||
|
auditRecordDO.setHandlerUserName(userName);
|
||||||
|
auditRecordDO.setFinishTaskTime(auditTime);
|
||||||
|
updateKeySelective(auditRecordDO);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 编辑
|
||||||
|
*/
|
||||||
|
public void updateKeySelective(TpAuditRecordDO recordDO) {
|
||||||
|
tpAuditRecordMapper.updateByPrimaryKeySelective(recordDO);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 审批记录
|
||||||
|
* @param applyId 申请单id
|
||||||
|
* @return 审批记录列表
|
||||||
|
*/
|
||||||
|
public List<AuditInfoResponse> getAuditRecordList(Long applyId) {
|
||||||
|
Example example = new Example(TpAuditRecordDO.class);
|
||||||
|
example.createCriteria()
|
||||||
|
.andEqualTo("applyId", applyId)
|
||||||
|
.andNotEqualTo("auditStatus", 0)
|
||||||
|
.andEqualTo("deleted", 0);
|
||||||
|
example.setOrderByClause("create_time ASC");
|
||||||
|
List<TpAuditRecordDO> recordList = tpAuditRecordMapper.selectByExample(example);
|
||||||
|
List<AuditInfoResponse> result = new ArrayList<>();
|
||||||
|
for (TpAuditRecordDO auditRecordDO : recordList) {
|
||||||
|
AuditInfoResponse response = AuditInfoResponse.builder()
|
||||||
|
.type(getAuditInfoType(auditRecordDO))
|
||||||
|
.execute(auditRecordDO.getRecordType() - 1)
|
||||||
|
.status(CommonConstants.INDEX_ZERO.equals(auditRecordDO.getAuditStatus()) ? 0 : 1)
|
||||||
|
.createTime(auditRecordDO.getReceiveTaskTime())
|
||||||
|
.remark(auditRecordDO.getRemark())
|
||||||
|
.actualUserId(auditRecordDO.getHandlerUserId())
|
||||||
|
.build();
|
||||||
|
List<AuditInfoResponse.AuditUserInfoVO> auditUserList = Collections.singletonList(
|
||||||
|
new AuditInfoResponse.AuditUserInfoVO(auditRecordDO.getHandlerUserId(), auditRecordDO.getHandlerUserName(), null)
|
||||||
|
);
|
||||||
|
response.setList(auditUserList);
|
||||||
|
result.add(response);
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
private Integer getAuditInfoType(TpAuditRecordDO auditRecordDO) {
|
||||||
|
if (CommonConstants.INDEX_ONE.equals(auditRecordDO.getRecordType())) {
|
||||||
|
return OperationLogAuditEnum.SUBMIT_AUDIT.getCode();
|
||||||
|
} else {
|
||||||
|
switch (auditRecordDO.getAuditStatus()) {
|
||||||
|
case 0:
|
||||||
|
return OperationLogAuditEnum.WAIT_AUDIT.getCode();
|
||||||
|
case 1:
|
||||||
|
return OperationLogAuditEnum.PASS.getCode();
|
||||||
|
case 2:
|
||||||
|
return OperationLogAuditEnum.REFUSE.getCode();
|
||||||
|
default:
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据申请单id删除
|
||||||
|
*/
|
||||||
|
public void deleteByApplyIds(List<Long> applyIds) {
|
||||||
|
if (CollectionUtils.isEmpty(applyIds)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
Example example = new Example(TpAuditRecordDO.class);
|
||||||
|
example.createCriteria().andIn("applyId", applyIds).andEqualTo("deleted", 0);
|
||||||
|
tpAuditRecordMapper.updateByExampleSelective(TpAuditRecordDO.builder().deleted(1).build(), example);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,102 @@
|
|||||||
|
package com.cool.store.dao.tp;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollStreamUtil;
|
||||||
|
import com.cool.store.entity.tp.TpRuleDO;
|
||||||
|
import com.cool.store.mapper.tp.TpRuleMapper;
|
||||||
|
import com.cool.store.request.tp.TpRuleQueryRequest;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
import tk.mybatis.mapper.entity.Example;
|
||||||
|
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 十二分制-奖惩规则DAO
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author wangff
|
||||||
|
* @since 2025/11/4
|
||||||
|
*/
|
||||||
|
@Repository
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class TpRuleDAO {
|
||||||
|
private final TpRuleMapper tpRuleMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增
|
||||||
|
*/
|
||||||
|
public boolean insertSelective(TpRuleDO tpRuleDO) {
|
||||||
|
return tpRuleMapper.insertSelective(tpRuleDO) > 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 编辑
|
||||||
|
*/
|
||||||
|
public boolean updateSelective(TpRuleDO tpRuleDO) {
|
||||||
|
return tpRuleMapper.updateByPrimaryKeySelective(tpRuleDO) > 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除
|
||||||
|
*/
|
||||||
|
public boolean deleteByIds(List<Long> ids) {
|
||||||
|
if (CollectionUtils.isEmpty(ids)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
Example example = new Example(TpRuleDO.class);
|
||||||
|
example.createCriteria().andIn("id", ids);
|
||||||
|
return tpRuleMapper.updateByExampleSelective(TpRuleDO.builder().deleted(1).build(), example) > 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据id查询
|
||||||
|
*/
|
||||||
|
public TpRuleDO getById(Long id) {
|
||||||
|
return tpRuleMapper.selectByPrimaryKey(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<TpRuleDO> getEffectiveList(TpRuleQueryRequest request) {
|
||||||
|
Example example = new Example(TpRuleDO.class);
|
||||||
|
Example.Criteria criteria = example.createCriteria();
|
||||||
|
if (StringUtils.isNotBlank(request.getProblemClassification())) {
|
||||||
|
criteria.andEqualTo("problemClassification", request.getProblemClassification());
|
||||||
|
}
|
||||||
|
if (StringUtils.isNotBlank(request.getProjectCategory())) {
|
||||||
|
criteria.andEqualTo("projectCategory", request.getProjectCategory());
|
||||||
|
}
|
||||||
|
if (StringUtils.isNotBlank(request.getProjectName())) {
|
||||||
|
criteria.andLike("projectName", "%" + request.getProjectName() + "%");
|
||||||
|
}
|
||||||
|
if (Objects.nonNull(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");
|
||||||
|
return tpRuleMapper.selectByExample(example);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改启用状态
|
||||||
|
* @param ids id列表
|
||||||
|
* @param status 启用状态
|
||||||
|
* @return boolean
|
||||||
|
*/
|
||||||
|
public boolean updateStatus(List<Long> ids, Integer status) {
|
||||||
|
if (CollectionUtils.isEmpty(ids)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
Example example = new Example(TpRuleDO.class);
|
||||||
|
example.createCriteria()
|
||||||
|
.andIn("id", ids);
|
||||||
|
return tpRuleMapper.updateByExampleSelective(TpRuleDO.builder().status(status).build(), example) > 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,67 @@
|
|||||||
|
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>
|
||||||
|
* 十二分制-积分流水DAO
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author wangff
|
||||||
|
* @since 2025/11/6
|
||||||
|
*/
|
||||||
|
@Repository
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class TpScoreJournalDAO {
|
||||||
|
private final TpScoreJournalMapper tpScoreJournalMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增
|
||||||
|
*/
|
||||||
|
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("create_time DESC");
|
||||||
|
return tpScoreJournalMapper.selectByExample(example);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -7,6 +7,7 @@ import com.cool.store.response.MiniShopsResponse;
|
|||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@Mapper
|
@Mapper
|
||||||
@@ -14,7 +15,11 @@ public interface StoreMapper {
|
|||||||
|
|
||||||
StoreDO getByStoreId(@Param("storeId") String storeId);
|
StoreDO getByStoreId(@Param("storeId") String storeId);
|
||||||
|
|
||||||
|
StoreDO getEffectiveByStoreId(@Param("storeId") String storeId);
|
||||||
|
|
||||||
List<StoreDO> getEffectiveStoreByStoreIds(@Param("storeIds") List<String> storeIds);
|
List<StoreDO> getEffectiveStoreByStoreIds(@Param("storeIds") List<String> storeIds);
|
||||||
|
|
||||||
|
List<StoreDO> getStoreByStoreIds(@Param("storeIds") List<String> storeIds);
|
||||||
/**
|
/**
|
||||||
* 根据区域Id查询所有门店(包含所有区域子节点)
|
* 根据区域Id查询所有门店(包含所有区域子节点)
|
||||||
* @param regionId
|
* @param regionId
|
||||||
@@ -59,4 +64,18 @@ public interface StoreMapper {
|
|||||||
* 查询所有门店id和门店编码
|
* 查询所有门店id和门店编码
|
||||||
*/
|
*/
|
||||||
List<StoreDO> getAllStoreIdAndNum(@Param("storeStatus") List<String> storeStatus);
|
List<StoreDO> getAllStoreIdAndNum(@Param("storeStatus") List<String> storeStatus);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询门店积分
|
||||||
|
* @param storeId 门店id
|
||||||
|
* @return 积分
|
||||||
|
*/
|
||||||
|
BigDecimal getStoreScore(@Param("storeId") String storeId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新门店积分
|
||||||
|
* @param storeId 门店id
|
||||||
|
* @param score 积分
|
||||||
|
*/
|
||||||
|
int updateStoreScore(String storeId, BigDecimal score);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,111 @@
|
|||||||
|
package com.cool.store.mapper.dict;
|
||||||
|
|
||||||
|
import com.cool.store.entity.dict.SysDictColumnDO;
|
||||||
|
import com.cool.store.request.dict.DictColumnQueryRequest;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author zhangchenbiao
|
||||||
|
* @date 2025-09-25 06:34
|
||||||
|
*/
|
||||||
|
public interface SysDictColumnMapper {
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* 默认插入方法,只会给有值的字段赋值
|
||||||
|
* 会对传进来的字段做判空处理,如果字段为空,则使用数据库默认字段或者null
|
||||||
|
* dateTime:2025-09-25 06:34
|
||||||
|
*/
|
||||||
|
int insertSelective(@Param("record") SysDictColumnDO record);
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* 默认更新方法,根据主键更新,不会把null值更新到数据库,避免覆盖之前有值的
|
||||||
|
* dateTime:2025-09-25 06:34
|
||||||
|
*/
|
||||||
|
int updateByPrimaryKeySelective(@Param("record") SysDictColumnDO record);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询已存在的字典项
|
||||||
|
* @param columnCode 字典项编码
|
||||||
|
* @return com.coolcollege.intelligent.model.dict.SysDictColumnDO
|
||||||
|
*/
|
||||||
|
SysDictColumnDO selectExistColumn(@Param("id") Long id,
|
||||||
|
@Param("columnCode") String columnCode);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据id批量删除
|
||||||
|
* @param ids id列表
|
||||||
|
* @return int
|
||||||
|
*/
|
||||||
|
int deleteByIds(@Param("ids") List<Long> ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 列表查询
|
||||||
|
* @param dto 查询DTO
|
||||||
|
* @return 字典项列表
|
||||||
|
*/
|
||||||
|
List<SysDictColumnDO> selectList(@Param("dto") DictColumnQueryRequest dto);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据id查询
|
||||||
|
* @param id id
|
||||||
|
* @return 字典项
|
||||||
|
*/
|
||||||
|
SysDictColumnDO selectById(@Param("id") Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据字典表id查询字典项数量
|
||||||
|
* @param tableIds 字典表id列表
|
||||||
|
*/
|
||||||
|
List<Map<String, Object>> selectColumnNumByTableIds(@Param("tableIds") List<Long> tableIds);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 过滤存在已启用字典项的字典表分组id
|
||||||
|
* @param groupIds 分组id列表
|
||||||
|
*/
|
||||||
|
List<Map<String, Object>> filterEnableColumnByGroupIds(@Param("groupIds") List<Long> groupIds);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 过滤存在已启用字典项的字典表id
|
||||||
|
* @param tableIds 字典表id列表
|
||||||
|
*/
|
||||||
|
List<Map<String, Object>> filterEnableColumnByTableIds(@Param("tableIds") List<Long> tableIds);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据分组id删除字典项
|
||||||
|
* @param groupIds 分组id列表
|
||||||
|
* @return int
|
||||||
|
*/
|
||||||
|
int deleteByGroupIds(@Param("groupIds") List<Long> groupIds);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据字典表id删除字典项
|
||||||
|
* @param tableIds 字典表id列表
|
||||||
|
* @return int
|
||||||
|
*/
|
||||||
|
int deleteByTableIds(@Param("tableIds") List<Long> tableIds);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据字典项编码查询字典项
|
||||||
|
* @param columnCode 字典项编码
|
||||||
|
* @return 字典项
|
||||||
|
*/
|
||||||
|
SysDictColumnDO selectOpenColumnByCode(@Param("columnCode") String columnCode);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据字典项编码查询字典项映射
|
||||||
|
* @param columnCodes 字典项编码列表
|
||||||
|
* @return 字典项列表
|
||||||
|
*/
|
||||||
|
List<SysDictColumnDO> selectOpenColumnByCodes(@Param("columnCodes") List<String> columnCodes);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据字典表id查询
|
||||||
|
* @param tableIds 字典表id列表
|
||||||
|
* @return 字典项列表
|
||||||
|
*/
|
||||||
|
List<SysDictColumnDO> selectOpenColumnListByTableIds(@Param("tableIds") List<Long> tableIds);
|
||||||
|
}
|
||||||
@@ -0,0 +1,50 @@
|
|||||||
|
package com.cool.store.mapper.dict;
|
||||||
|
|
||||||
|
import com.cool.store.entity.dict.SysDictGroupDO;
|
||||||
|
import com.cool.store.request.dict.DictGroupQueryRequest;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author zhangchenbiao
|
||||||
|
* @date 2025-09-25 06:35
|
||||||
|
*/
|
||||||
|
public interface SysDictGroupMapper {
|
||||||
|
/**
|
||||||
|
* 默认插入方法,只会给有值的字段赋值
|
||||||
|
* 会对传进来的字段做判空处理,如果字段为空,则使用数据库默认字段或者null
|
||||||
|
* dateTime:2025-09-25 06:35
|
||||||
|
*/
|
||||||
|
int insertSelective(@Param("record") SysDictGroupDO record);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 默认更新方法,根据主键更新,不会把null值更新到数据库,避免覆盖之前有值的
|
||||||
|
* dateTime:2025-09-25 06:35
|
||||||
|
*/
|
||||||
|
int updateByPrimaryKeySelective(@Param("record") SysDictGroupDO record);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据id批量删除
|
||||||
|
*
|
||||||
|
* @param ids id列表
|
||||||
|
* @return int
|
||||||
|
*/
|
||||||
|
int deleteByIds(@Param("ids") List<Long> ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据id查询
|
||||||
|
*
|
||||||
|
* @param id id
|
||||||
|
* @return 字典分组
|
||||||
|
*/
|
||||||
|
SysDictGroupDO selectById(@Param("id") Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 列表查询
|
||||||
|
*
|
||||||
|
* @param dto 查询DTO
|
||||||
|
* @return 字典分组列表
|
||||||
|
*/
|
||||||
|
List<SysDictGroupDO> selectList(@Param("dto") DictGroupQueryRequest dto);
|
||||||
|
}
|
||||||
@@ -0,0 +1,109 @@
|
|||||||
|
package com.cool.store.mapper.dict;
|
||||||
|
|
||||||
|
import com.cool.store.entity.dict.SysDictTableDO;
|
||||||
|
import com.cool.store.request.dict.DictTableQueryRequest;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author zhangchenbiao
|
||||||
|
* @date 2025-09-25 06:30
|
||||||
|
*/
|
||||||
|
public interface SysDictTableMapper {
|
||||||
|
/**
|
||||||
|
* 默认插入方法,只会给有值的字段赋值
|
||||||
|
* 会对传进来的字段做判空处理,如果字段为空,则使用数据库默认字段或者null
|
||||||
|
* dateTime:2025-09-25 06:30
|
||||||
|
*/
|
||||||
|
int insertSelective(@Param("record") SysDictTableDO record, @Param("enterpriseId") String enterpriseId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 默认更新方法,根据主键更新,不会把null值更新到数据库,避免覆盖之前有值的
|
||||||
|
* dateTime:2025-09-25 06:30
|
||||||
|
*/
|
||||||
|
int updateByPrimaryKeySelective(@Param("record") SysDictTableDO record, @Param("enterpriseId") String enterpriseId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询重复的字典表
|
||||||
|
*
|
||||||
|
* @param id id
|
||||||
|
* @param tableCode 字典表code
|
||||||
|
* @return 字典表
|
||||||
|
*/
|
||||||
|
SysDictTableDO selectExistTable(@Param("id") Long id,
|
||||||
|
@Param("tableCode") String tableCode);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据id删除
|
||||||
|
*
|
||||||
|
* @param ids id列表
|
||||||
|
*/
|
||||||
|
int deleteByIds(@Param("ids") List<Long> ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 列表查询
|
||||||
|
*
|
||||||
|
* @param dto 查询DTO
|
||||||
|
* @return 字典表列表
|
||||||
|
*/
|
||||||
|
List<SysDictTableDO> selectList(@Param("dto") DictTableQueryRequest dto);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据id查询
|
||||||
|
*
|
||||||
|
* @param id id
|
||||||
|
* @return 字典表
|
||||||
|
*/
|
||||||
|
SysDictTableDO selectById(@Param("id") Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据id查询
|
||||||
|
*
|
||||||
|
* @param ids id列表
|
||||||
|
* @return 字典表列表
|
||||||
|
*/
|
||||||
|
List<SysDictTableDO> selectByIds(@Param("ids") List<Long> ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据分组id查询
|
||||||
|
*
|
||||||
|
* @param groupIds 分组id列表
|
||||||
|
* @param openStatus 启用状态
|
||||||
|
* @return 字典表列表
|
||||||
|
*/
|
||||||
|
List<SysDictTableDO> selectByGroupIds(@Param("groupIds") List<Long> groupIds,
|
||||||
|
@Param("openStatus") Integer openStatus);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据分组id查询已启用的字典表
|
||||||
|
*
|
||||||
|
* @param groupIds 分组id列表
|
||||||
|
*/
|
||||||
|
List<Map<String, Object>> filterEnableTableByGroupIds(@Param("groupIds") List<Long> groupIds);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据分组id删除
|
||||||
|
*
|
||||||
|
* @param groupIds 分组id列表
|
||||||
|
* @return int
|
||||||
|
*/
|
||||||
|
int deleteByGroupIds(@Param("groupIds") List<Long> groupIds);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据字典表编码查询
|
||||||
|
*
|
||||||
|
* @param tableCode 字典表编码
|
||||||
|
* @return 字典表
|
||||||
|
*/
|
||||||
|
SysDictTableDO selectByTableCode(@Param("tableCode") String tableCode);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据字典表编码查询启用状态的字典表
|
||||||
|
*
|
||||||
|
* @param tableCodes 字典表编码
|
||||||
|
* @return 字典表列表
|
||||||
|
*/
|
||||||
|
List<SysDictTableDO> selectOpenTableListByTableCodes(@Param("tableCodes") List<String> tableCodes);
|
||||||
|
}
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
package com.cool.store.mapper.tp;
|
||||||
|
|
||||||
|
import com.cool.store.entity.tp.TpApplyFormDO;
|
||||||
|
import com.cool.store.request.tp.TpApplyQueryRequest;
|
||||||
|
import tk.mybatis.mapper.common.Mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public interface TpApplyFormMapper extends Mapper<TpApplyFormDO> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询有效记录列表
|
||||||
|
* @param request 申请单查询Request
|
||||||
|
* @return 申请单列表
|
||||||
|
*/
|
||||||
|
List<TpApplyFormDO> getEffectiveList(TpApplyQueryRequest request);
|
||||||
|
}
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
package com.cool.store.mapper.tp;
|
||||||
|
|
||||||
|
import com.cool.store.entity.tp.TpAuditRecordDO;
|
||||||
|
import tk.mybatis.mapper.common.Mapper;
|
||||||
|
|
||||||
|
public interface TpAuditRecordMapper extends Mapper<TpAuditRecordDO> {
|
||||||
|
}
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
package com.cool.store.mapper.tp;
|
||||||
|
|
||||||
|
import com.cool.store.entity.tp.TpRuleDO;
|
||||||
|
import tk.mybatis.mapper.common.Mapper;
|
||||||
|
|
||||||
|
public interface TpRuleMapper extends Mapper<TpRuleDO> {
|
||||||
|
}
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
package com.cool.store.mapper.tp;
|
||||||
|
|
||||||
|
import com.cool.store.entity.tp.TpScoreJournalDO;
|
||||||
|
import tk.mybatis.mapper.common.Mapper;
|
||||||
|
|
||||||
|
public interface TpScoreJournalMapper extends Mapper<TpScoreJournalDO> {
|
||||||
|
}
|
||||||
@@ -58,6 +58,12 @@
|
|||||||
where store_id = #{storeId}
|
where store_id = #{storeId}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="getEffectiveByStoreId" resultMap="BaseResultMap">
|
||||||
|
select *
|
||||||
|
from store_${enterpriseId}
|
||||||
|
where store_id = #{storeId} AND is_delete = 'effective'
|
||||||
|
</select>
|
||||||
|
|
||||||
<select id="getEffectiveStoreByStoreIds" resultMap="BaseResultMap">
|
<select id="getEffectiveStoreByStoreIds" resultMap="BaseResultMap">
|
||||||
select *
|
select *
|
||||||
from store_${enterpriseId}
|
from store_${enterpriseId}
|
||||||
@@ -69,6 +75,18 @@
|
|||||||
</if>
|
</if>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="getStoreByStoreIds" resultMap="BaseResultMap">
|
||||||
|
select *
|
||||||
|
from store_${enterpriseId}
|
||||||
|
<where>
|
||||||
|
<if test="storeIds != null">
|
||||||
|
<foreach collection="storeIds" item="item" separator="," open="and store_id in (" close=")">
|
||||||
|
#{item}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
<select id="listStoreByRegionId" resultMap="BaseResultMap">
|
<select id="listStoreByRegionId" resultMap="BaseResultMap">
|
||||||
select *
|
select *
|
||||||
from store_${enterpriseId}
|
from store_${enterpriseId}
|
||||||
@@ -255,4 +273,15 @@
|
|||||||
</foreach>
|
</foreach>
|
||||||
</if>
|
</if>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="getStoreScore" resultType="java.math.BigDecimal">
|
||||||
|
SELECT score FROM store_extend_info_${enterpriseId}
|
||||||
|
WHERE store_id = #{storeId}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="updateStoreScore">
|
||||||
|
INSERT INTO store_extend_info_${enterpriseId} (store_id, score) VALUES (#{storeId}, #{score})
|
||||||
|
ON DUPLICATE KEY UPDATE
|
||||||
|
score = values(score)
|
||||||
|
</insert>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
@@ -0,0 +1,269 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.cool.store.mapper.dict.SysDictColumnMapper">
|
||||||
|
<resultMap id="BaseResultMap" type="com.cool.store.entity.dict.SysDictColumnDO">
|
||||||
|
<id column="id" jdbcType="BIGINT" property="id" />
|
||||||
|
<result column="dict_group_id" jdbcType="BIGINT" property="dictGroupId" />
|
||||||
|
<result column="dict_table_id" jdbcType="BIGINT" property="dictTableId" />
|
||||||
|
<result column="column_name" jdbcType="VARCHAR" property="columnName" />
|
||||||
|
<result column="column_code" jdbcType="VARCHAR" property="columnCode" />
|
||||||
|
<result column="open_status" jdbcType="TINYINT" property="openStatus" />
|
||||||
|
<result column="remark" jdbcType="VARCHAR" property="remark" />
|
||||||
|
<result column="deleted" jdbcType="BIT" property="deleted" />
|
||||||
|
<result column="create_user_id" jdbcType="VARCHAR" property="createUserId" />
|
||||||
|
<result column="update_user_id" jdbcType="VARCHAR" property="updateUserId" />
|
||||||
|
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
||||||
|
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
|
||||||
|
</resultMap>
|
||||||
|
<sql id="Base_Column_List">
|
||||||
|
id, dict_group_id, dict_table_id, column_name, column_code, open_status, remark,
|
||||||
|
deleted, create_user_id, update_user_id, create_time, update_time
|
||||||
|
</sql>
|
||||||
|
<insert id="insertSelective" keyColumn="id" keyProperty="record.id" useGeneratedKeys="true">
|
||||||
|
insert into sys_dict_column_${enterpriseId}
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="record.dictGroupId != null">
|
||||||
|
dict_group_id,
|
||||||
|
</if>
|
||||||
|
<if test="record.dictTableId != null">
|
||||||
|
dict_table_id,
|
||||||
|
</if>
|
||||||
|
<if test="record.columnName != null">
|
||||||
|
column_name,
|
||||||
|
</if>
|
||||||
|
<if test="record.columnCode != null">
|
||||||
|
column_code,
|
||||||
|
</if>
|
||||||
|
<if test="record.openStatus != null">
|
||||||
|
open_status,
|
||||||
|
</if>
|
||||||
|
<if test="record.remark != null">
|
||||||
|
remark,
|
||||||
|
</if>
|
||||||
|
<if test="record.deleted != null">
|
||||||
|
deleted,
|
||||||
|
</if>
|
||||||
|
<if test="record.createUserId != null">
|
||||||
|
create_user_id,
|
||||||
|
</if>
|
||||||
|
<if test="record.updateUserId != null">
|
||||||
|
update_user_id,
|
||||||
|
</if>
|
||||||
|
<if test="record.createTime != null">
|
||||||
|
create_time,
|
||||||
|
</if>
|
||||||
|
<if test="record.updateTime != null">
|
||||||
|
update_time,
|
||||||
|
</if>
|
||||||
|
</trim>
|
||||||
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="record.dictGroupId != null">
|
||||||
|
#{record.dictGroupId},
|
||||||
|
</if>
|
||||||
|
<if test="record.dictTableId != null">
|
||||||
|
#{record.dictTableId},
|
||||||
|
</if>
|
||||||
|
<if test="record.columnName != null">
|
||||||
|
#{record.columnName},
|
||||||
|
</if>
|
||||||
|
<if test="record.columnCode != null">
|
||||||
|
#{record.columnCode},
|
||||||
|
</if>
|
||||||
|
<if test="record.openStatus != null">
|
||||||
|
#{record.openStatus},
|
||||||
|
</if>
|
||||||
|
<if test="record.remark != null">
|
||||||
|
#{record.remark},
|
||||||
|
</if>
|
||||||
|
<if test="record.deleted != null">
|
||||||
|
#{record.deleted},
|
||||||
|
</if>
|
||||||
|
<if test="record.createUserId != null">
|
||||||
|
#{record.createUserId},
|
||||||
|
</if>
|
||||||
|
<if test="record.updateUserId != null">
|
||||||
|
#{record.updateUserId},
|
||||||
|
</if>
|
||||||
|
<if test="record.createTime != null">
|
||||||
|
#{record.createTime},
|
||||||
|
</if>
|
||||||
|
<if test="record.updateTime != null">
|
||||||
|
#{record.updateTime},
|
||||||
|
</if>
|
||||||
|
</trim>
|
||||||
|
</insert>
|
||||||
|
<update id="updateByPrimaryKeySelective">
|
||||||
|
update sys_dict_column_${enterpriseId}
|
||||||
|
<set>
|
||||||
|
<if test="record.dictGroupId != null">
|
||||||
|
dict_group_id = #{record.dictGroupId},
|
||||||
|
</if>
|
||||||
|
<if test="record.dictTableId != null">
|
||||||
|
dict_table_id = #{record.dictTableId},
|
||||||
|
</if>
|
||||||
|
<if test="record.columnName != null">
|
||||||
|
column_name = #{record.columnName},
|
||||||
|
</if>
|
||||||
|
<if test="record.columnCode != null">
|
||||||
|
column_code = #{record.columnCode},
|
||||||
|
</if>
|
||||||
|
<if test="record.openStatus != null">
|
||||||
|
open_status = #{record.openStatus},
|
||||||
|
</if>
|
||||||
|
<if test="record.remark != null">
|
||||||
|
remark = #{record.remark},
|
||||||
|
</if>
|
||||||
|
<if test="record.deleted != null">
|
||||||
|
deleted = #{record.deleted},
|
||||||
|
</if>
|
||||||
|
<if test="record.createUserId != null">
|
||||||
|
create_user_id = #{record.createUserId},
|
||||||
|
</if>
|
||||||
|
<if test="record.updateUserId != null">
|
||||||
|
update_user_id = #{record.updateUserId},
|
||||||
|
</if>
|
||||||
|
<if test="record.createTime != null">
|
||||||
|
create_time = #{record.createTime},
|
||||||
|
</if>
|
||||||
|
<if test="record.updateTime != null">
|
||||||
|
update_time = #{record.updateTime},
|
||||||
|
</if>
|
||||||
|
</set>
|
||||||
|
where id = #{record.id}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<select id="selectExistColumn" resultMap="BaseResultMap">
|
||||||
|
SELECT <include refid="Base_Column_List"/>
|
||||||
|
FROM sys_dict_column_${enterpriseId}
|
||||||
|
<where>
|
||||||
|
<if test="id != null">
|
||||||
|
AND id != #{id}
|
||||||
|
</if>
|
||||||
|
AND column_code = #{columnCode}
|
||||||
|
AND deleted = 0
|
||||||
|
LIMIT 1
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<update id="deleteByIds">
|
||||||
|
UPDATE sys_dict_column_${enterpriseId}
|
||||||
|
SET deleted = 1
|
||||||
|
WHERE id IN
|
||||||
|
<foreach item="id" collection="ids" separator="," open="(" close=")">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
|
AND deleted = 0
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<select id="selectList" resultMap="BaseResultMap">
|
||||||
|
SELECT <include refid="Base_Column_List"/>
|
||||||
|
FROM sys_dict_column_${enterpriseId}
|
||||||
|
<where>
|
||||||
|
deleted = 0
|
||||||
|
<if test="dto.dictGroupId != null">
|
||||||
|
AND dict_group_id = #{dto.dictGroupId}
|
||||||
|
</if>
|
||||||
|
<if test="dto.dictTableId != null">
|
||||||
|
AND dict_table_id = #{dto.dictTableId}
|
||||||
|
</if>
|
||||||
|
<if test="dto.columnName != null and dto.columnName != ''">
|
||||||
|
AND column_name LIKE CONCAT('%', #{dto.columnName}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="dto.columnCode != null and dto.columnCode != ''">
|
||||||
|
AND column_code = #{dto.columnCode}
|
||||||
|
</if>
|
||||||
|
<if test="dto.openStatus != null">
|
||||||
|
AND open_status = #{dto.openStatus}
|
||||||
|
</if>
|
||||||
|
<if test="dto.remark != null and dto.remark != ''">
|
||||||
|
AND remark LIKE CONCAT('%', #{dto.remark}, '%')
|
||||||
|
</if>
|
||||||
|
ORDER BY create_time ASC
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectById" resultMap="BaseResultMap">
|
||||||
|
SELECT <include refid="Base_Column_List"/>
|
||||||
|
FROM sys_dict_column_${enterpriseId}
|
||||||
|
WHERE id = #{id} AND deleted = 0 LIMIT 1
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectColumnNumByTableIds" resultType="java.util.Map">
|
||||||
|
SELECT COUNT(*) num, dict_table_id
|
||||||
|
FROM sys_dict_column_${enterpriseId}
|
||||||
|
WHERE dict_table_id IN
|
||||||
|
<foreach collection="tableIds" item="tableId" separator="," open="(" close=")">
|
||||||
|
#{tableId}
|
||||||
|
</foreach>
|
||||||
|
AND deleted = 0
|
||||||
|
GROUP BY dict_table_id
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="filterEnableColumnByGroupIds" resultType="java.util.Map">
|
||||||
|
SELECT DISTINCT dict_group_id
|
||||||
|
FROM sys_dict_column_${enterpriseId}
|
||||||
|
WHERE dict_group_id IN
|
||||||
|
<foreach collection="groupIds" item="groupId" open="(" separator="," close=")">
|
||||||
|
#{groupId}
|
||||||
|
</foreach>
|
||||||
|
AND open_status = 1
|
||||||
|
AND deleted = 0
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="filterEnableColumnByTableIds" resultType="java.util.Map">
|
||||||
|
SELECT DISTINCT dict_table_id
|
||||||
|
FROM sys_dict_column_${enterpriseId}
|
||||||
|
WHERE dict_table_id IN
|
||||||
|
<foreach collection="tableIds" item="tableId" open="(" separator="," close=")">
|
||||||
|
#{tableId}
|
||||||
|
</foreach>
|
||||||
|
AND open_status = 1
|
||||||
|
AND deleted = 0
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<update id="deleteByGroupIds">
|
||||||
|
UPDATE sys_dict_column_${enterpriseId}
|
||||||
|
SET deleted = 1
|
||||||
|
WHERE dict_group_id IN
|
||||||
|
<foreach item="groupId" collection="groupIds" separator="," open="(" close=")">
|
||||||
|
#{groupId}
|
||||||
|
</foreach>
|
||||||
|
AND deleted = 0
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<update id="deleteByTableIds">
|
||||||
|
UPDATE sys_dict_column_${enterpriseId}
|
||||||
|
SET deleted = 1
|
||||||
|
WHERE dict_table_id IN
|
||||||
|
<foreach item="tableId" collection="tableIds" separator="," open="(" close=")">
|
||||||
|
#{tableId}
|
||||||
|
</foreach>
|
||||||
|
AND deleted = 0
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<select id="selectOpenColumnByCode" resultMap="BaseResultMap">
|
||||||
|
SELECT <include refid="Base_Column_List"/>
|
||||||
|
FROM sys_dict_column_${enterpriseId}
|
||||||
|
WHERE column_code = #{columnCode} AND deleted = 0 AND open_status = 1 LIMIT 1
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectOpenColumnByCodes" resultMap="BaseResultMap">
|
||||||
|
SELECT <include refid="Base_Column_List"/>
|
||||||
|
FROM sys_dict_column_${enterpriseId}
|
||||||
|
WHERE column_code IN
|
||||||
|
<foreach collection="columnCodes" item="item" separator="," open="(" close=")">
|
||||||
|
#{item}
|
||||||
|
</foreach>
|
||||||
|
AND deleted = 0 AND open_status = 1
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectOpenColumnListByTableIds" resultMap="BaseResultMap">
|
||||||
|
SELECT <include refid="Base_Column_List"/>
|
||||||
|
FROM sys_dict_column_${enterpriseId}
|
||||||
|
WHERE dict_table_id IN
|
||||||
|
<foreach item="tableId" collection="tableIds" separator="," open="(" close=")">
|
||||||
|
#{tableId}
|
||||||
|
</foreach>
|
||||||
|
AND deleted = 0 AND open_status = 1
|
||||||
|
</select>
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,122 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.cool.store.mapper.dict.SysDictGroupMapper">
|
||||||
|
<resultMap id="BaseResultMap" type="com.cool.store.entity.dict.SysDictGroupDO">
|
||||||
|
<id column="id" jdbcType="BIGINT" property="id" />
|
||||||
|
<result column="group_name" jdbcType="VARCHAR" property="groupName" />
|
||||||
|
<result column="remark" jdbcType="VARCHAR" property="remark" />
|
||||||
|
<result column="deleted" jdbcType="BIT" property="deleted" />
|
||||||
|
<result column="create_user_id" jdbcType="VARCHAR" property="createUserId" />
|
||||||
|
<result column="update_user_id" jdbcType="VARCHAR" property="updateUserId" />
|
||||||
|
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
||||||
|
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
|
||||||
|
</resultMap>
|
||||||
|
<sql id="Base_Column_List">
|
||||||
|
id, group_name, remark, deleted, create_user_id, update_user_id, create_time, update_time
|
||||||
|
</sql>
|
||||||
|
<insert id="insertSelective" keyColumn="id" keyProperty="record.id" useGeneratedKeys="true">
|
||||||
|
insert into sys_dict_group_${enterpriseId}
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="record.groupName != null">
|
||||||
|
group_name,
|
||||||
|
</if>
|
||||||
|
<if test="record.remark != null">
|
||||||
|
remark,
|
||||||
|
</if>
|
||||||
|
<if test="record.deleted != null">
|
||||||
|
deleted,
|
||||||
|
</if>
|
||||||
|
<if test="record.createUserId != null">
|
||||||
|
create_user_id,
|
||||||
|
</if>
|
||||||
|
<if test="record.updateUserId != null">
|
||||||
|
update_user_id,
|
||||||
|
</if>
|
||||||
|
<if test="record.createTime != null">
|
||||||
|
create_time,
|
||||||
|
</if>
|
||||||
|
<if test="record.updateTime != null">
|
||||||
|
update_time,
|
||||||
|
</if>
|
||||||
|
</trim>
|
||||||
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="record.groupName != null">
|
||||||
|
#{record.groupName},
|
||||||
|
</if>
|
||||||
|
<if test="record.remark != null">
|
||||||
|
#{record.remark},
|
||||||
|
</if>
|
||||||
|
<if test="record.deleted != null">
|
||||||
|
#{record.deleted},
|
||||||
|
</if>
|
||||||
|
<if test="record.createUserId != null">
|
||||||
|
#{record.createUserId},
|
||||||
|
</if>
|
||||||
|
<if test="record.updateUserId != null">
|
||||||
|
#{record.updateUserId},
|
||||||
|
</if>
|
||||||
|
<if test="record.createTime != null">
|
||||||
|
#{record.createTime},
|
||||||
|
</if>
|
||||||
|
<if test="record.updateTime != null">
|
||||||
|
#{record.updateTime},
|
||||||
|
</if>
|
||||||
|
</trim>
|
||||||
|
</insert>
|
||||||
|
<update id="updateByPrimaryKeySelective">
|
||||||
|
update sys_dict_group_${enterpriseId}
|
||||||
|
<set>
|
||||||
|
<if test="record.groupName != null">
|
||||||
|
group_name = #{record.groupName},
|
||||||
|
</if>
|
||||||
|
<if test="record.remark != null">
|
||||||
|
remark = #{record.remark},
|
||||||
|
</if>
|
||||||
|
<if test="record.deleted != null">
|
||||||
|
deleted = #{record.deleted},
|
||||||
|
</if>
|
||||||
|
<if test="record.createUserId != null">
|
||||||
|
create_user_id = #{record.createUserId},
|
||||||
|
</if>
|
||||||
|
<if test="record.updateUserId != null">
|
||||||
|
update_user_id = #{record.updateUserId},
|
||||||
|
</if>
|
||||||
|
<if test="record.createTime != null">
|
||||||
|
create_time = #{record.createTime},
|
||||||
|
</if>
|
||||||
|
<if test="record.updateTime != null">
|
||||||
|
update_time = #{record.updateTime},
|
||||||
|
</if>
|
||||||
|
</set>
|
||||||
|
where id = #{record.id}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<update id="deleteByIds">
|
||||||
|
UPDATE sys_dict_group_${enterpriseId}
|
||||||
|
SET deleted = 1
|
||||||
|
WHERE id IN
|
||||||
|
<foreach item="id" collection="ids" separator="," open="(" close=")">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
|
AND deleted = 0
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<select id="selectById" resultMap="BaseResultMap">
|
||||||
|
SELECT <include refid="Base_Column_List" />
|
||||||
|
FROM sys_dict_group_${enterpriseId}
|
||||||
|
WHERE id = #{id} AND deleted = 0 LIMIT 1
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectList" resultMap="BaseResultMap">
|
||||||
|
SELECT <include refid="Base_Column_List"/>
|
||||||
|
FROM sys_dict_group_${enterpriseId}
|
||||||
|
WHERE deleted = 0
|
||||||
|
<if test="dto.groupName != null and dto.groupName != ''">
|
||||||
|
AND group_name LIKE CONCAT('%', #{dto.groupName}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="dto.remark != null and dto.remark != ''">
|
||||||
|
AND remark LIKE CONCAT('%', #{dto.remark}, '%')
|
||||||
|
</if>
|
||||||
|
ORDER BY create_time ASC
|
||||||
|
</select>
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,237 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.cool.store.mapper.dict.SysDictTableMapper">
|
||||||
|
<resultMap id="BaseResultMap" type="com.cool.store.entity.dict.SysDictTableDO">
|
||||||
|
<id column="id" jdbcType="BIGINT" property="id" />
|
||||||
|
<result column="dict_group_id" jdbcType="BIGINT" property="dictGroupId" />
|
||||||
|
<result column="table_name" jdbcType="VARCHAR" property="tableName" />
|
||||||
|
<result column="table_code" jdbcType="VARCHAR" property="tableCode" />
|
||||||
|
<result column="open_status" jdbcType="TINYINT" property="openStatus" />
|
||||||
|
<result column="remark" jdbcType="VARCHAR" property="remark" />
|
||||||
|
<result column="deleted" jdbcType="BIT" property="deleted" />
|
||||||
|
<result column="create_user_id" jdbcType="VARCHAR" property="createUserId" />
|
||||||
|
<result column="update_user_id" jdbcType="VARCHAR" property="updateUserId" />
|
||||||
|
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
||||||
|
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
|
||||||
|
</resultMap>
|
||||||
|
<sql id="Base_Column_List">
|
||||||
|
id, dict_group_id, table_name, table_code, open_status, remark, deleted, create_user_id,
|
||||||
|
update_user_id, create_time, update_time
|
||||||
|
</sql>
|
||||||
|
<insert id="insertSelective" keyColumn="id" keyProperty="record.id" useGeneratedKeys="true">
|
||||||
|
insert into sys_dict_table_${enterpriseId}
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="record.dictGroupId != null">
|
||||||
|
dict_group_id,
|
||||||
|
</if>
|
||||||
|
<if test="record.tableName != null">
|
||||||
|
table_name,
|
||||||
|
</if>
|
||||||
|
<if test="record.tableCode != null">
|
||||||
|
table_code,
|
||||||
|
</if>
|
||||||
|
<if test="record.openStatus != null">
|
||||||
|
open_status,
|
||||||
|
</if>
|
||||||
|
<if test="record.remark != null">
|
||||||
|
remark,
|
||||||
|
</if>
|
||||||
|
<if test="record.deleted != null">
|
||||||
|
deleted,
|
||||||
|
</if>
|
||||||
|
<if test="record.createUserId != null">
|
||||||
|
create_user_id,
|
||||||
|
</if>
|
||||||
|
<if test="record.updateUserId != null">
|
||||||
|
update_user_id,
|
||||||
|
</if>
|
||||||
|
<if test="record.createTime != null">
|
||||||
|
create_time,
|
||||||
|
</if>
|
||||||
|
<if test="record.updateTime != null">
|
||||||
|
update_time,
|
||||||
|
</if>
|
||||||
|
</trim>
|
||||||
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="record.dictGroupId != null">
|
||||||
|
#{record.dictGroupId},
|
||||||
|
</if>
|
||||||
|
<if test="record.tableName != null">
|
||||||
|
#{record.tableName},
|
||||||
|
</if>
|
||||||
|
<if test="record.tableCode != null">
|
||||||
|
#{record.tableCode},
|
||||||
|
</if>
|
||||||
|
<if test="record.openStatus != null">
|
||||||
|
#{record.openStatus},
|
||||||
|
</if>
|
||||||
|
<if test="record.remark != null">
|
||||||
|
#{record.remark},
|
||||||
|
</if>
|
||||||
|
<if test="record.deleted != null">
|
||||||
|
#{record.deleted},
|
||||||
|
</if>
|
||||||
|
<if test="record.createUserId != null">
|
||||||
|
#{record.createUserId},
|
||||||
|
</if>
|
||||||
|
<if test="record.updateUserId != null">
|
||||||
|
#{record.updateUserId},
|
||||||
|
</if>
|
||||||
|
<if test="record.createTime != null">
|
||||||
|
#{record.createTime},
|
||||||
|
</if>
|
||||||
|
<if test="record.updateTime != null">
|
||||||
|
#{record.updateTime},
|
||||||
|
</if>
|
||||||
|
</trim>
|
||||||
|
</insert>
|
||||||
|
<update id="updateByPrimaryKeySelective">
|
||||||
|
update sys_dict_table_${enterpriseId}
|
||||||
|
<set>
|
||||||
|
<if test="record.dictGroupId != null">
|
||||||
|
dict_group_id = #{record.dictGroupId},
|
||||||
|
</if>
|
||||||
|
<if test="record.tableName != null">
|
||||||
|
table_name = #{record.tableName},
|
||||||
|
</if>
|
||||||
|
<if test="record.tableCode != null">
|
||||||
|
table_code = #{record.tableCode},
|
||||||
|
</if>
|
||||||
|
<if test="record.openStatus != null">
|
||||||
|
open_status = #{record.openStatus},
|
||||||
|
</if>
|
||||||
|
<if test="record.remark != null">
|
||||||
|
remark = #{record.remark},
|
||||||
|
</if>
|
||||||
|
<if test="record.deleted != null">
|
||||||
|
deleted = #{record.deleted},
|
||||||
|
</if>
|
||||||
|
<if test="record.createUserId != null">
|
||||||
|
create_user_id = #{record.createUserId},
|
||||||
|
</if>
|
||||||
|
<if test="record.updateUserId != null">
|
||||||
|
update_user_id = #{record.updateUserId},
|
||||||
|
</if>
|
||||||
|
<if test="record.createTime != null">
|
||||||
|
create_time = #{record.createTime},
|
||||||
|
</if>
|
||||||
|
<if test="record.updateTime != null">
|
||||||
|
update_time = #{record.updateTime},
|
||||||
|
</if>
|
||||||
|
</set>
|
||||||
|
where id = #{record.id}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<select id="selectExistTable" resultMap="BaseResultMap">
|
||||||
|
SELECT <include refid="Base_Column_List"/>
|
||||||
|
FROM sys_dict_table_${enterpriseId}
|
||||||
|
<where>
|
||||||
|
<if test="id != null">
|
||||||
|
AND id != #{id}
|
||||||
|
</if>
|
||||||
|
AND table_code = #{tableCode}
|
||||||
|
AND deleted = 0
|
||||||
|
LIMIT 1
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<update id="deleteByIds">
|
||||||
|
UPDATE sys_dict_table_${enterpriseId}
|
||||||
|
SET deleted = 1
|
||||||
|
WHERE id IN
|
||||||
|
<foreach item="id" collection="ids" open="(" separator="," close=")">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
|
AND deleted = 0
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<select id="selectList" resultMap="BaseResultMap">
|
||||||
|
SELECT <include refid="Base_Column_List"/>
|
||||||
|
FROM sys_dict_table_${enterpriseId}
|
||||||
|
WHERE deleted = 0
|
||||||
|
<if test="dto.dictGroupId != null">
|
||||||
|
AND dict_group_id = #{dto.dictGroupId}
|
||||||
|
</if>
|
||||||
|
<if test="dto.tableName != null and dto.tableName != ''">
|
||||||
|
AND table_name LIKE CONCAT('%', #{dto.tableName}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="dto.tableCode != null and dto.tableCode != ''">
|
||||||
|
AND table_code = #{dto.tableCode}
|
||||||
|
</if>
|
||||||
|
<if test="dto.openStatus != null">
|
||||||
|
AND open_status = #{dto.openStatus}
|
||||||
|
</if>
|
||||||
|
<if test="dto.remark != null and dto.remark != ''">
|
||||||
|
AND remark LIKE CONCAT('%', #{dto.remark}, '%')
|
||||||
|
</if>
|
||||||
|
ORDER BY create_time ASC
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectById" resultMap="BaseResultMap">
|
||||||
|
SELECT <include refid="Base_Column_List"/>
|
||||||
|
FROM sys_dict_table_${enterpriseId}
|
||||||
|
WHERE id = #{id} AND deleted = 0 LIMIT 1
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectByIds" resultMap="BaseResultMap">
|
||||||
|
SELECT <include refid="Base_Column_List"/>
|
||||||
|
FROM sys_dict_table_${enterpriseId}
|
||||||
|
WHERE id IN
|
||||||
|
<foreach collection="ids" item="id" open="(" separator="," close=")">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
|
AND deleted = 0
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectByGroupIds" resultMap="BaseResultMap">
|
||||||
|
SELECT <include refid="Base_Column_List"/>
|
||||||
|
FROM sys_dict_table_${enterpriseId}
|
||||||
|
<where>
|
||||||
|
dict_group_id IN
|
||||||
|
<foreach item="groupId" collection="groupIds" open="(" separator="," close=")">
|
||||||
|
#{groupId}
|
||||||
|
</foreach>
|
||||||
|
<if test="openStatus != null">
|
||||||
|
AND open_status = #{openStatus}
|
||||||
|
</if>
|
||||||
|
AND deleted = 0
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="filterEnableTableByGroupIds" resultType="java.util.Map">
|
||||||
|
SELECT DISTINCT dict_group_id
|
||||||
|
FROM sys_dict_table_${enterpriseId}
|
||||||
|
WHERE dict_group_id IN
|
||||||
|
<foreach collection="groupIds" item="groupId" open="(" separator="," close=")">
|
||||||
|
#{groupId}
|
||||||
|
</foreach>
|
||||||
|
AND open_status = 1
|
||||||
|
AND deleted = 0
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<update id="deleteByGroupIds">
|
||||||
|
UPDATE sys_dict_table_${enterpriseId}
|
||||||
|
SET deleted = 1
|
||||||
|
WHERE dict_group_id IN
|
||||||
|
<foreach item="groupId" collection="groupIds" open="(" separator="," close=")">
|
||||||
|
#{groupId}
|
||||||
|
</foreach>
|
||||||
|
AND deleted = 0
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<select id="selectByTableCode" resultMap="BaseResultMap">
|
||||||
|
SELECT <include refid="Base_Column_List"/>
|
||||||
|
FROM sys_dict_table_${enterpriseId}
|
||||||
|
WHERE table_code = #{tableCode} AND deleted = 0 LIMIT 1
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectOpenTableListByTableCodes" resultMap="BaseResultMap">
|
||||||
|
SELECT <include refid="Base_Column_List"/>
|
||||||
|
FROM sys_dict_table_${enterpriseId}
|
||||||
|
WHERE table_code IN
|
||||||
|
<foreach item="tableCode" collection="tableCodes" open="(" separator="," close=")">
|
||||||
|
#{tableCode}
|
||||||
|
</foreach>
|
||||||
|
AND deleted = 0 AND open_status = 1
|
||||||
|
</select>
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,100 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.cool.store.mapper.tp.TpApplyFormMapper">
|
||||||
|
<resultMap id="BaseResultMap" type="com.cool.store.entity.tp.TpApplyFormDO">
|
||||||
|
<!--
|
||||||
|
WARNING - @mbg.generated
|
||||||
|
-->
|
||||||
|
<id column="id" jdbcType="BIGINT" property="id" />
|
||||||
|
<result column="type" jdbcType="BIT" property="type" />
|
||||||
|
<result column="apply_no" jdbcType="VARCHAR" property="applyNo" />
|
||||||
|
<result column="store_id" jdbcType="VARCHAR" property="storeId" />
|
||||||
|
<result column="rule_id" jdbcType="BIGINT" property="ruleId" />
|
||||||
|
<result column="rule_no" jdbcType="VARCHAR" property="ruleNo" />
|
||||||
|
<result column="problem_classification" jdbcType="VARCHAR" property="problemClassification" />
|
||||||
|
<result column="project_category" jdbcType="VARCHAR" property="projectCategory" />
|
||||||
|
<result column="project_name" jdbcType="VARCHAR" property="projectName" />
|
||||||
|
<result column="is_full" jdbcType="BIT" property="isFull" />
|
||||||
|
<result column="score" jdbcType="DECIMAL" property="score" />
|
||||||
|
<result column="remark" jdbcType="VARCHAR" property="remark" />
|
||||||
|
<result column="amount" jdbcType="DECIMAL" property="amount" />
|
||||||
|
<result column="appeal_end_date" jdbcType="DATE" property="appealEndDate" />
|
||||||
|
<result column="status" jdbcType="VARCHAR" property="status" />
|
||||||
|
<result column="pay_status" jdbcType="BIT" property="payStatus" />
|
||||||
|
<result column="is_draft" jdbcType="BIT" property="isDraft" />
|
||||||
|
<result column="source" jdbcType="TINYINT" property="source" />
|
||||||
|
<result column="apply_user_id" jdbcType="VARCHAR" property="applyUserId" />
|
||||||
|
<result column="apply_user_name" jdbcType="VARCHAR" property="applyUserName" />
|
||||||
|
<result column="approve_user_id" jdbcType="VARCHAR" property="approveUserId" />
|
||||||
|
<result column="approve_time" jdbcType="TIMESTAMP" property="approveTime" />
|
||||||
|
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
||||||
|
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
|
||||||
|
<result column="deleted" jdbcType="BIT" property="deleted" />
|
||||||
|
<result column="proof_urls" jdbcType="LONGVARCHAR" property="proofUrls" />
|
||||||
|
<result column="penalty_id" jdbcType="BIGINT" property="penaltyId" />
|
||||||
|
<result column="applicant_name" jdbcType="VARCHAR" property="applicantName" />
|
||||||
|
<result column="phone" jdbcType="VARCHAR" property="phone" />
|
||||||
|
<result column="appeal_reason" jdbcType="VARCHAR" property="appealReason" />
|
||||||
|
<result column="appeal_detail_reason" jdbcType="VARCHAR" property="appealDetailReason" />
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<sql id="Base_Column_List">
|
||||||
|
id, type, apply_no, store_id, rule_id, rule_no, problem_classification, project_category, project_name,
|
||||||
|
is_full, score, remark, amount, appeal_end_date, status, pay_status, is_draft, source, apply_user_id,
|
||||||
|
apply_user_name, approve_user_id, approve_time, create_time, update_time, deleted, proof_urls,
|
||||||
|
penalty_id, applicant_name, phone, appeal_reason, appeal_detail_reason
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<select id="getEffectiveList" parameterType="com.cool.store.request.tp.TpApplyQueryRequest" resultMap="BaseResultMap">
|
||||||
|
SELECT <include refid="Base_Column_List" />
|
||||||
|
FROM zxjp_tp_apply_form a
|
||||||
|
<if test="storeNameOrNum != null and storeNameOrNum != ''">
|
||||||
|
INNER JOIN store_${enterpriseId} b ON a.store_id = b.store_id AND b.is_delete = 'effective'
|
||||||
|
</if>
|
||||||
|
<where>
|
||||||
|
deleted = 0
|
||||||
|
<if test="applyNo != null and applyNo != ''">
|
||||||
|
AND a.apply_no LIKE CONCAT('%', #{applyNo}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="projectCategory != null and projectCategory != ''">
|
||||||
|
AND a.project_category = #{projectCategory}
|
||||||
|
</if>
|
||||||
|
<if test="ruleId != null and ruleId != ''">
|
||||||
|
AND a.rule_id = #{ruleId}
|
||||||
|
</if>
|
||||||
|
<if test="statusList != null and !statusList.isEmpty()">
|
||||||
|
AND a.status IN
|
||||||
|
<foreach collection="statusList" item="status" separator="," open="(" close=")">
|
||||||
|
#{status}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
|
<if test="type != null">
|
||||||
|
AND a.type = #{type}
|
||||||
|
</if>
|
||||||
|
<if test="payStatus != null">
|
||||||
|
AND a.pay_status = #{payStatus}
|
||||||
|
</if>
|
||||||
|
<if test="score != null">
|
||||||
|
AND a.score = #{score}
|
||||||
|
</if>
|
||||||
|
<if test="isPenalty != null and isPenalty">
|
||||||
|
AND (a.type = 1 OR a.type = 2)
|
||||||
|
</if>
|
||||||
|
<if test="storeNameOrNum != null and storeNameOrNum != ''">
|
||||||
|
AND (b.store_name LIKE CONCAT('%', #{storeNameOrNum}, '%')
|
||||||
|
OR b.store_num LIKE CONCAT('%', #{storeNameOrNum}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="appealReason != null and appealReason != ''">
|
||||||
|
AND a.appeal_reason LIKE CONCAT('%', #{appealReason}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="isDraft != null">
|
||||||
|
AND a.is_draft = #{isDraft}
|
||||||
|
</if>
|
||||||
|
<if test="overdue != null and overdue">
|
||||||
|
AND a.appeal_end_date < CURRENT_DATE
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
ORDER BY a.create_time DESC
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.cool.store.mapper.tp.TpAuditRecordMapper">
|
||||||
|
<resultMap id="BaseResultMap" type="com.cool.store.entity.tp.TpAuditRecordDO">
|
||||||
|
<!--
|
||||||
|
WARNING - @mbg.generated
|
||||||
|
-->
|
||||||
|
<id column="id" jdbcType="BIGINT" property="id" />
|
||||||
|
<result column="apply_type" jdbcType="BIT" property="applyType" />
|
||||||
|
<result column="apply_id" jdbcType="BIGINT" property="applyId" />
|
||||||
|
<result column="record_type" jdbcType="BIT" property="recordType" />
|
||||||
|
<result column="audit_status" jdbcType="BIT" property="auditStatus" />
|
||||||
|
<result column="remark" jdbcType="VARCHAR" property="remark" />
|
||||||
|
<result column="handler_user_id" jdbcType="VARCHAR" property="handlerUserId" />
|
||||||
|
<result column="handler_user_name" jdbcType="VARCHAR" property="handlerUserName" />
|
||||||
|
<result column="receive_task_time" jdbcType="TIMESTAMP" property="receiveTaskTime" />
|
||||||
|
<result column="finish_task_time" jdbcType="TIMESTAMP" property="finishTaskTime" />
|
||||||
|
<result column="deleted" jdbcType="BIT" property="deleted" />
|
||||||
|
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
||||||
|
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
|
||||||
|
</resultMap>
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.cool.store.mapper.tp.TpRuleMapper">
|
||||||
|
<resultMap id="BaseResultMap" type="com.cool.store.entity.tp.TpRuleDO">
|
||||||
|
<!--
|
||||||
|
WARNING - @mbg.generated
|
||||||
|
-->
|
||||||
|
<id column="id" jdbcType="BIGINT" property="id" />
|
||||||
|
<result column="rule_no" jdbcType="VARCHAR" property="ruleNo" />
|
||||||
|
<result column="type" jdbcType="BIT" property="type" />
|
||||||
|
<result column="problem_classification" jdbcType="VARCHAR" property="problemClassification" />
|
||||||
|
<result column="project_category" jdbcType="VARCHAR" property="projectCategory" />
|
||||||
|
<result column="project_name" jdbcType="VARCHAR" property="projectName" />
|
||||||
|
<result column="warning_limit" jdbcType="INTEGER" property="warningLimit" />
|
||||||
|
<result column="score" jdbcType="DECIMAL" property="score" />
|
||||||
|
<result column="amount" jdbcType="DECIMAL" property="amount" />
|
||||||
|
<result column="appeal_deadline" jdbcType="INTEGER" property="appealDeadline" />
|
||||||
|
<result column="status" jdbcType="BIT" property="status" />
|
||||||
|
<result column="remark" jdbcType="VARCHAR" property="remark" />
|
||||||
|
<result column="is_full" jdbcType="BIT" property="isFull" />
|
||||||
|
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
||||||
|
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
|
||||||
|
<result column="deleted" jdbcType="BIT" property="deleted" />
|
||||||
|
</resultMap>
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.cool.store.mapper.tp.TpScoreJournalMapper">
|
||||||
|
<resultMap id="BaseResultMap" type="com.cool.store.entity.tp.TpScoreJournalDO">
|
||||||
|
<!--
|
||||||
|
WARNING - @mbg.generated
|
||||||
|
-->
|
||||||
|
<id column="id" jdbcType="BIGINT" property="id" />
|
||||||
|
<result column="journal_no" jdbcType="VARCHAR" property="journalNo" />
|
||||||
|
<result column="store_id" jdbcType="VARCHAR" property="storeId" />
|
||||||
|
<result column="store_num" jdbcType="VARCHAR" property="storeNum" />
|
||||||
|
<result column="join_brand" jdbcType="BIT" property="joinBrand" />
|
||||||
|
<result column="join_model" jdbcType="BIT" property="joinModel" />
|
||||||
|
<result column="store_type" jdbcType="BIT" property="storeType" />
|
||||||
|
<result column="store_name" jdbcType="VARCHAR" property="storeName" />
|
||||||
|
<result column="occur_score" jdbcType="VARCHAR" property="occurScore" />
|
||||||
|
<result column="occur_date" jdbcType="DATE" property="occurDate" />
|
||||||
|
<result column="occur_before_score" jdbcType="DECIMAL" property="occurBeforeScore" />
|
||||||
|
<result column="occur_after_score" jdbcType="DECIMAL" property="occurAfterScore" />
|
||||||
|
<result column="apply_type" jdbcType="BIT" property="applyType" />
|
||||||
|
<result column="apply_no" jdbcType="VARCHAR" property="applyNo" />
|
||||||
|
<result column="project_category" jdbcType="VARCHAR" property="projectCategory" />
|
||||||
|
<result column="project_name" jdbcType="VARCHAR" property="projectName" />
|
||||||
|
<result column="rule_id" jdbcType="BIGINT" property="ruleId" />
|
||||||
|
<result column="rule_no" jdbcType="VARCHAR" property="ruleNo" />
|
||||||
|
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
||||||
|
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
|
||||||
|
</resultMap>
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,57 @@
|
|||||||
|
package com.cool.store.entity.dict;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 字典项
|
||||||
|
* @author wangff
|
||||||
|
* @date 2025-09-25 06:34
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class SysDictColumnDO implements Serializable {
|
||||||
|
@ApiModelProperty("")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@ApiModelProperty("merchant_dict_group.id 字典表分组id")
|
||||||
|
private Long dictGroupId;
|
||||||
|
|
||||||
|
@ApiModelProperty("merchant_dict_table_info.id 字典表信息表id")
|
||||||
|
private Long dictTableId;
|
||||||
|
|
||||||
|
@ApiModelProperty("字典项名称")
|
||||||
|
private String columnName;
|
||||||
|
|
||||||
|
@ApiModelProperty("字典项编码")
|
||||||
|
private String columnCode;
|
||||||
|
|
||||||
|
@ApiModelProperty("启用状态 0:不启用 1:启用")
|
||||||
|
private Integer openStatus;
|
||||||
|
|
||||||
|
@ApiModelProperty("备注")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
@ApiModelProperty("删除标识")
|
||||||
|
private Boolean deleted;
|
||||||
|
|
||||||
|
@ApiModelProperty("创建人")
|
||||||
|
private String createUserId;
|
||||||
|
|
||||||
|
@ApiModelProperty("更新人")
|
||||||
|
private String updateUserId;
|
||||||
|
|
||||||
|
@ApiModelProperty("创建时间")
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
@ApiModelProperty("更新时间")
|
||||||
|
private Date updateTime;
|
||||||
|
}
|
||||||
@@ -0,0 +1,45 @@
|
|||||||
|
package com.cool.store.entity.dict;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 字典分组
|
||||||
|
* @author wangff
|
||||||
|
* @date 2025-09-25 06:35
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class SysDictGroupDO implements Serializable {
|
||||||
|
@ApiModelProperty("")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@ApiModelProperty("分组名称")
|
||||||
|
private String groupName;
|
||||||
|
|
||||||
|
@ApiModelProperty("备注")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
@ApiModelProperty("删除标识")
|
||||||
|
private Boolean deleted;
|
||||||
|
|
||||||
|
@ApiModelProperty("创建人")
|
||||||
|
private String createUserId;
|
||||||
|
|
||||||
|
@ApiModelProperty("更新人")
|
||||||
|
private String updateUserId;
|
||||||
|
|
||||||
|
@ApiModelProperty("创建时间")
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
@ApiModelProperty("更新时间")
|
||||||
|
private Date updateTime;
|
||||||
|
}
|
||||||
@@ -0,0 +1,54 @@
|
|||||||
|
package com.cool.store.entity.dict;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 字典表
|
||||||
|
* @author wangff
|
||||||
|
* @date 2025-09-25 06:30
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class SysDictTableDO implements Serializable {
|
||||||
|
@ApiModelProperty("")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@ApiModelProperty("merchant_dict_group.id 字典表分组id")
|
||||||
|
private Long dictGroupId;
|
||||||
|
|
||||||
|
@ApiModelProperty("字典表名称")
|
||||||
|
private String tableName;
|
||||||
|
|
||||||
|
@ApiModelProperty("字典表编码")
|
||||||
|
private String tableCode;
|
||||||
|
|
||||||
|
@ApiModelProperty("启用状态 0:不启用 1:启用")
|
||||||
|
private Integer openStatus;
|
||||||
|
|
||||||
|
@ApiModelProperty("备注")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
@ApiModelProperty("删除标识")
|
||||||
|
private Boolean deleted;
|
||||||
|
|
||||||
|
@ApiModelProperty("创建人")
|
||||||
|
private String createUserId;
|
||||||
|
|
||||||
|
@ApiModelProperty("更新人")
|
||||||
|
private String updateUserId;
|
||||||
|
|
||||||
|
@ApiModelProperty("创建时间")
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
@ApiModelProperty("更新时间")
|
||||||
|
private Date updateTime;
|
||||||
|
}
|
||||||
@@ -0,0 +1,207 @@
|
|||||||
|
package com.cool.store.entity.tp;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.util.Date;
|
||||||
|
import javax.persistence.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 十二分制-申请单
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author wangff
|
||||||
|
* @since 2025/11/4
|
||||||
|
*/
|
||||||
|
@Table(name = "zxjp_tp_apply_form")
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Builder
|
||||||
|
public class TpApplyFormDO {
|
||||||
|
/**
|
||||||
|
* id
|
||||||
|
*/
|
||||||
|
@Id
|
||||||
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 单据类型,0加分单 1警告书 2处罚书
|
||||||
|
*/
|
||||||
|
private Integer type;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 申请单号
|
||||||
|
*/
|
||||||
|
@Column(name = "apply_no")
|
||||||
|
private String applyNo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 门店id
|
||||||
|
*/
|
||||||
|
@Column(name = "store_id")
|
||||||
|
private String storeId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 规则id(项目类型)
|
||||||
|
*/
|
||||||
|
@Column(name = "rule_id")
|
||||||
|
private Long ruleId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 规则编码
|
||||||
|
*/
|
||||||
|
@Column(name = "rule_no")
|
||||||
|
private String ruleNo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 问题分类
|
||||||
|
*/
|
||||||
|
@Column(name = "problem_classification")
|
||||||
|
private String problemClassification;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 项目大类
|
||||||
|
*/
|
||||||
|
@Column(name = "project_category")
|
||||||
|
private String projectCategory;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 项目名称
|
||||||
|
*/
|
||||||
|
@Column(name = "project_name")
|
||||||
|
private String projectName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否加满
|
||||||
|
*/
|
||||||
|
@Column(name = "is_full")
|
||||||
|
private Integer isFull;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分值
|
||||||
|
*/
|
||||||
|
private BigDecimal score;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 金额
|
||||||
|
*/
|
||||||
|
private BigDecimal amount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 申请复议截止日期
|
||||||
|
*/
|
||||||
|
@Column(name = "appeal_end_date")
|
||||||
|
private Date appealEndDate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 状态
|
||||||
|
*/
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 缴费状态,0未缴费 1无需缴费 2已缴费
|
||||||
|
*/
|
||||||
|
@Column(name = "pay_status")
|
||||||
|
private Integer payStatus;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否为草稿 0否 1是
|
||||||
|
*/
|
||||||
|
@Column(name = "is_draft")
|
||||||
|
private Integer isDraft;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 来源,0非小程序 1小程序
|
||||||
|
*/
|
||||||
|
@Column(name = "source")
|
||||||
|
private Integer source;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 申请人(创建人)id
|
||||||
|
*/
|
||||||
|
@Column(name = "apply_user_id")
|
||||||
|
private String applyUserId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 申请人(创建人)名称
|
||||||
|
*/
|
||||||
|
@Column(name = "apply_user_name")
|
||||||
|
private String applyUserName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 审批人id
|
||||||
|
*/
|
||||||
|
@Column(name = "approve_user_id")
|
||||||
|
private String approveUserId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 审批时间
|
||||||
|
*/
|
||||||
|
@Column(name = "approve_time")
|
||||||
|
private Date approveTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建时间
|
||||||
|
*/
|
||||||
|
@Column(name = "create_time")
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新时间
|
||||||
|
*/
|
||||||
|
@Column(name = "update_time")
|
||||||
|
private Date updateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否删除 0否1是
|
||||||
|
*/
|
||||||
|
private Integer deleted;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 证明图片列表
|
||||||
|
*/
|
||||||
|
@Column(name = "proof_urls")
|
||||||
|
private String proofUrls;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 处罚单id
|
||||||
|
*/
|
||||||
|
@Column(name = "penalty_id")
|
||||||
|
private Long penaltyId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 申请人姓名(复议申请单)
|
||||||
|
*/
|
||||||
|
@Column(name = "applicant_name")
|
||||||
|
private String applicantName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 联系电话
|
||||||
|
*/
|
||||||
|
@Column(name = "phone")
|
||||||
|
private String phone;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 复议理由
|
||||||
|
*/
|
||||||
|
@Column(name = "appeal_reason")
|
||||||
|
private String appealReason;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 复议详细理由
|
||||||
|
*/
|
||||||
|
@Column(name = "appeal_detail_reason")
|
||||||
|
private String appealDetailReason;
|
||||||
|
}
|
||||||
@@ -0,0 +1,101 @@
|
|||||||
|
package com.cool.store.entity.tp;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import javax.persistence.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 十二分制-审批记录
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author wangff
|
||||||
|
* @since 2025/11/4
|
||||||
|
*/
|
||||||
|
@Table(name = "zxjp_tp_audit_record")
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Builder
|
||||||
|
public class TpAuditRecordDO {
|
||||||
|
/**
|
||||||
|
* id
|
||||||
|
*/
|
||||||
|
@Id
|
||||||
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 单据类型,0加分单 1警告书 2处罚书
|
||||||
|
*/
|
||||||
|
@Column(name = "apply_type")
|
||||||
|
private Integer applyType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 申请单id
|
||||||
|
*/
|
||||||
|
@Column(name = "apply_id")
|
||||||
|
private Long applyId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 记录类型,1申请提交 2审批操作
|
||||||
|
*/
|
||||||
|
@Column(name = "record_type")
|
||||||
|
private Integer recordType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 审批状态,0待处理 1通过 2拒绝
|
||||||
|
*/
|
||||||
|
@Column(name = "audit_status")
|
||||||
|
private Integer auditStatus;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 处理人
|
||||||
|
*/
|
||||||
|
@Column(name = "handler_user_id")
|
||||||
|
private String handlerUserId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 处理人名称
|
||||||
|
*/
|
||||||
|
@Column(name = "handler_user_name")
|
||||||
|
private String handlerUserName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 收到任务时间
|
||||||
|
*/
|
||||||
|
@Column(name = "receive_task_time")
|
||||||
|
private Date receiveTaskTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 完成任务时间
|
||||||
|
*/
|
||||||
|
@Column(name = "finish_task_time")
|
||||||
|
private Date finishTaskTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否删除,0否1是
|
||||||
|
*/
|
||||||
|
private Integer deleted;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建时间
|
||||||
|
*/
|
||||||
|
@Column(name = "create_time")
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新时间
|
||||||
|
*/
|
||||||
|
@Column(name = "update_time")
|
||||||
|
private Date updateTime;
|
||||||
|
}
|
||||||
@@ -0,0 +1,113 @@
|
|||||||
|
package com.cool.store.entity.tp;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
import javax.persistence.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 十二分制-奖惩规则
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author wangff
|
||||||
|
* @since 2025/11/4
|
||||||
|
*/
|
||||||
|
@Table(name = "zxjp_tp_rule")
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Builder
|
||||||
|
public class TpRuleDO {
|
||||||
|
@Id
|
||||||
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 规则编码
|
||||||
|
*/
|
||||||
|
@Column(name = "rule_no")
|
||||||
|
private String ruleNo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 规则类型,0扣分 1加分
|
||||||
|
*/
|
||||||
|
private Integer type;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 问题分类
|
||||||
|
*/
|
||||||
|
@Column(name = "problem_classification")
|
||||||
|
private String problemClassification;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 项目大类
|
||||||
|
*/
|
||||||
|
@Column(name = "project_category")
|
||||||
|
private String projectCategory;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 惩处项目名称
|
||||||
|
*/
|
||||||
|
@Column(name = "project_name")
|
||||||
|
private String projectName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 警告上限次数
|
||||||
|
*/
|
||||||
|
@Column(name = "warning_limit")
|
||||||
|
private Integer warningLimit;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分值
|
||||||
|
*/
|
||||||
|
private BigDecimal score;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 罚款金额
|
||||||
|
*/
|
||||||
|
private BigDecimal amount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 复议申请时效
|
||||||
|
*/
|
||||||
|
@Column(name = "appeal_deadline")
|
||||||
|
private Integer appealDeadline;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 启用状态,0未启用 1启用
|
||||||
|
*/
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 项目描述
|
||||||
|
*/
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否加满
|
||||||
|
*/
|
||||||
|
@Column(name = "is_full")
|
||||||
|
private Integer isFull;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建时间
|
||||||
|
*/
|
||||||
|
@Column(name = "create_time")
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新时间
|
||||||
|
*/
|
||||||
|
@Column(name = "update_time")
|
||||||
|
private Date updateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否删除 0否1是
|
||||||
|
*/
|
||||||
|
private Integer deleted;
|
||||||
|
}
|
||||||
@@ -0,0 +1,166 @@
|
|||||||
|
package com.cool.store.entity.tp;
|
||||||
|
|
||||||
|
import com.cool.store.entity.StoreDO;
|
||||||
|
import com.cool.store.utils.TpHelper;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
import javax.persistence.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 十二分制-积分流水
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author wangff
|
||||||
|
* @since 2025/11/4
|
||||||
|
*/
|
||||||
|
@Table(name = "zxjp_tp_score_journal")
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class TpScoreJournalDO {
|
||||||
|
/**
|
||||||
|
* id
|
||||||
|
*/
|
||||||
|
@Id
|
||||||
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 流水号
|
||||||
|
*/
|
||||||
|
@Column(name = "journal_no")
|
||||||
|
private String journalNo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 门店id
|
||||||
|
*/
|
||||||
|
@Column(name = "store_id")
|
||||||
|
private String storeId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 门店编码
|
||||||
|
*/
|
||||||
|
@Column(name = "store_num")
|
||||||
|
private String storeNum;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 加盟品牌
|
||||||
|
*/
|
||||||
|
@Column(name = "join_brand")
|
||||||
|
private Integer joinBrand;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 加盟模式
|
||||||
|
*/
|
||||||
|
@Column(name = "join_model")
|
||||||
|
private Integer joinModel;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 门店类型
|
||||||
|
*/
|
||||||
|
@Column(name = "store_type")
|
||||||
|
private Integer storeType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 门店名称
|
||||||
|
*/
|
||||||
|
@Column(name = "store_name")
|
||||||
|
private String storeName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 发生分值
|
||||||
|
*/
|
||||||
|
@Column(name = "occur_score")
|
||||||
|
private String occurScore;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 发生日期
|
||||||
|
*/
|
||||||
|
@Column(name = "occur_date")
|
||||||
|
private Date occurDate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 发生前分值
|
||||||
|
*/
|
||||||
|
@Column(name = "occur_before_score")
|
||||||
|
private BigDecimal occurBeforeScore;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 发生后分值
|
||||||
|
*/
|
||||||
|
@Column(name = "occur_after_score")
|
||||||
|
private BigDecimal occurAfterScore;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 单据类型,0加分单 1警告书 2处罚书
|
||||||
|
*/
|
||||||
|
@Column(name = "apply_type")
|
||||||
|
private Integer applyType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 来源单号
|
||||||
|
*/
|
||||||
|
@Column(name = "apply_no")
|
||||||
|
private String applyNo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 项目大类
|
||||||
|
*/
|
||||||
|
@Column(name = "project_category")
|
||||||
|
private String projectCategory;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 项目名称
|
||||||
|
*/
|
||||||
|
@Column(name = "project_name")
|
||||||
|
private String projectName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 规则id
|
||||||
|
*/
|
||||||
|
@Column(name = "rule_id")
|
||||||
|
private Long ruleId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 规则编码
|
||||||
|
*/
|
||||||
|
@Column(name = "rule_no")
|
||||||
|
private String ruleNo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建时间
|
||||||
|
*/
|
||||||
|
@Column(name = "create_time")
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新时间
|
||||||
|
*/
|
||||||
|
@Column(name = "update_time")
|
||||||
|
private Date updateTime;
|
||||||
|
|
||||||
|
public TpScoreJournalDO(StoreDO storeDO, TpApplyFormDO formDO, String occurScore, BigDecimal occurBeforeScore, BigDecimal occurAfterScore) {
|
||||||
|
this.journalNo = TpHelper.generateScoreJournalNo();
|
||||||
|
this.storeId = storeDO.getStoreId();
|
||||||
|
this.storeNum = storeDO.getStoreNum();
|
||||||
|
this.joinBrand = storeDO.getJoinBrand();
|
||||||
|
this.joinModel = storeDO.getJoinModel();
|
||||||
|
this.storeType = storeDO.getStoreType();
|
||||||
|
this.storeName = storeDO.getStoreName();
|
||||||
|
this.occurScore = occurScore;
|
||||||
|
this.occurDate = new Date();
|
||||||
|
this.occurBeforeScore = occurBeforeScore;
|
||||||
|
this.occurAfterScore = occurAfterScore;
|
||||||
|
this.applyType = formDO.getType();
|
||||||
|
this.applyNo = formDO.getApplyNo();
|
||||||
|
this.projectCategory = formDO.getProjectCategory();
|
||||||
|
this.projectName = formDO.getProjectName();
|
||||||
|
this.ruleId = formDO.getRuleId();
|
||||||
|
this.ruleNo = formDO.getRuleNo();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,41 @@
|
|||||||
|
package com.cool.store.request.dict;
|
||||||
|
|
||||||
|
import com.cool.store.common.PageBasicInfo;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 字典项查询DTO
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author wangff
|
||||||
|
* @since 2025/2/20
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Builder
|
||||||
|
public class DictColumnQueryRequest extends PageBasicInfo {
|
||||||
|
|
||||||
|
@ApiModelProperty("字典表分组id")
|
||||||
|
private Long dictGroupId;
|
||||||
|
|
||||||
|
@ApiModelProperty("字典表id")
|
||||||
|
private Long dictTableId;
|
||||||
|
|
||||||
|
@ApiModelProperty("字典项名称")
|
||||||
|
private String columnName;
|
||||||
|
|
||||||
|
@ApiModelProperty("字典项编码")
|
||||||
|
private String columnCode;
|
||||||
|
|
||||||
|
@ApiModelProperty("启用状态 0:不启用 1:启用")
|
||||||
|
private Integer openStatus;
|
||||||
|
|
||||||
|
@ApiModelProperty("备注")
|
||||||
|
private String remark;
|
||||||
|
}
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
package com.cool.store.request.dict;
|
||||||
|
|
||||||
|
import com.cool.store.common.PageBasicInfo;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 字典分组查询DTO
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author wangff
|
||||||
|
* @since 2025/2/20
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class DictGroupQueryRequest extends PageBasicInfo {
|
||||||
|
@ApiModelProperty("字典分组名称")
|
||||||
|
private String groupName;
|
||||||
|
|
||||||
|
@ApiModelProperty("备注")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
@ApiModelProperty("字典表启用状态")
|
||||||
|
private Integer dictTableOpenStatus;
|
||||||
|
}
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
package com.cool.store.request.dict;
|
||||||
|
|
||||||
|
import com.cool.store.common.PageBasicInfo;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 字典表查询DTO
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author wangff
|
||||||
|
* @since 2025/2/20
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class DictTableQueryRequest extends PageBasicInfo {
|
||||||
|
@ApiModelProperty("字典分组id")
|
||||||
|
private Long dictGroupId;
|
||||||
|
|
||||||
|
@ApiModelProperty("字典表名称")
|
||||||
|
private String tableName;
|
||||||
|
|
||||||
|
@ApiModelProperty("字典表编码")
|
||||||
|
private String tableCode;
|
||||||
|
|
||||||
|
@ApiModelProperty("启用状态 0:不启用 1:启用")
|
||||||
|
private Integer openStatus;
|
||||||
|
|
||||||
|
@ApiModelProperty("备注")
|
||||||
|
private String remark;
|
||||||
|
}
|
||||||
@@ -0,0 +1,59 @@
|
|||||||
|
package com.cool.store.request.tp;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
import javax.validation.constraints.NotEmpty;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 复议申请Request
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author wangff
|
||||||
|
* @since 2025/11/10
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class TpAppealApplyRequest {
|
||||||
|
@ApiModelProperty("id")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@ApiModelProperty("是否为草稿 0否 1是")
|
||||||
|
@NotNull(message = "是否为草稿不能为空")
|
||||||
|
private Integer isDraft;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "来源,0非小程序 1小程序", hidden = true)
|
||||||
|
private Integer source;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "申请人(创建人)id", hidden = true)
|
||||||
|
private String applyUserId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "申请人(创建人)名称", hidden = true)
|
||||||
|
private String applyUserName;
|
||||||
|
|
||||||
|
@ApiModelProperty("证明图片列表")
|
||||||
|
@NotEmpty(message = "证明图片列表不能为空")
|
||||||
|
private String proofUrls;
|
||||||
|
|
||||||
|
@ApiModelProperty("处罚单id")
|
||||||
|
@NotNull(message = "处罚单id不能为空")
|
||||||
|
private Long penaltyId;
|
||||||
|
|
||||||
|
@ApiModelProperty("申请人姓名")
|
||||||
|
@NotBlank(message = "申请人姓名不能为空")
|
||||||
|
private String applicantName;
|
||||||
|
|
||||||
|
@ApiModelProperty("联系电话")
|
||||||
|
@NotBlank(message = "联系电话不能为空")
|
||||||
|
private String phone;
|
||||||
|
|
||||||
|
@ApiModelProperty("复议理由")
|
||||||
|
@NotBlank(message = "复议理由不能为空")
|
||||||
|
private String appealReason;
|
||||||
|
|
||||||
|
@ApiModelProperty("复议详细理由")
|
||||||
|
@NotBlank(message = "复议详细理由不能为空")
|
||||||
|
private String appealDetailReason;
|
||||||
|
}
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
package com.cool.store.request.tp;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 申请单审批Request
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author wangff
|
||||||
|
* @since 2025/11/6
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class TpApplyAuditRequest {
|
||||||
|
@ApiModelProperty("申请单id")
|
||||||
|
@NotNull(message = "申请单id不能为空")
|
||||||
|
private Long applyId;
|
||||||
|
|
||||||
|
@ApiModelProperty("审批状态 1通过 2拒绝")
|
||||||
|
@NotNull(message = "审批状态不能为空")
|
||||||
|
private Integer auditStatus;
|
||||||
|
|
||||||
|
@ApiModelProperty("备注")
|
||||||
|
private String remark;
|
||||||
|
}
|
||||||
@@ -0,0 +1,59 @@
|
|||||||
|
package com.cool.store.request.tp;
|
||||||
|
|
||||||
|
import com.cool.store.common.PageBasicInfo;
|
||||||
|
import com.cool.store.constants.CommonConstants;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 申请单查询Request
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author wangff
|
||||||
|
* @since 2025/11/6
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class TpApplyQueryRequest extends PageBasicInfo {
|
||||||
|
@ApiModelProperty("申请单号")
|
||||||
|
private String applyNo;
|
||||||
|
|
||||||
|
@ApiModelProperty("门店名称或编码")
|
||||||
|
private String storeNameOrNum;
|
||||||
|
|
||||||
|
@ApiModelProperty("项目大类")
|
||||||
|
private String projectCategory;
|
||||||
|
|
||||||
|
@ApiModelProperty("规则id")
|
||||||
|
private String ruleId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "状态列表")
|
||||||
|
private List<String> statusList;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "单据类型,0加分单 1警告书 2处罚书")
|
||||||
|
private Integer type;
|
||||||
|
|
||||||
|
@ApiModelProperty("缴款状态,0未缴费 1无需缴费 2已缴费")
|
||||||
|
private Integer payStatus;
|
||||||
|
|
||||||
|
@ApiModelProperty("分值")
|
||||||
|
private BigDecimal score;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "是惩处单", hidden = true)
|
||||||
|
private Boolean isPenalty;
|
||||||
|
|
||||||
|
@ApiModelProperty("复议理由,字典表")
|
||||||
|
private String appealReason;
|
||||||
|
|
||||||
|
@ApiModelProperty("是否为草稿")
|
||||||
|
private Integer isDraft;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "是否已逾期", hidden = true)
|
||||||
|
private Boolean overdue;
|
||||||
|
}
|
||||||
@@ -0,0 +1,60 @@
|
|||||||
|
package com.cool.store.request.tp;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 奖惩申请Request
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author wangff
|
||||||
|
* @since 2025/11/5
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class TpApplyRequest {
|
||||||
|
@ApiModelProperty("id")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@ApiModelProperty("门店id")
|
||||||
|
@NotNull(message = "门店id不能为空")
|
||||||
|
private String storeId;
|
||||||
|
|
||||||
|
@ApiModelProperty("规则id")
|
||||||
|
@NotNull(message = "规则id不能为空")
|
||||||
|
private Long ruleId;
|
||||||
|
|
||||||
|
@ApiModelProperty("备注")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
@ApiModelProperty("是否为草稿 0否 1是")
|
||||||
|
@NotNull(message = "是否为草稿不能为空")
|
||||||
|
private Integer isDraft;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "来源,0非小程序 1小程序", hidden = true)
|
||||||
|
private Integer source;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "申请人(创建人)id", hidden = true)
|
||||||
|
private String applyUserId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "申请人(创建人)名称", hidden = true)
|
||||||
|
private String applyUserName;
|
||||||
|
|
||||||
|
@ApiModelProperty("证明图片列表,逗号隔开")
|
||||||
|
@NotBlank(message = "证明图片列表不能为空")
|
||||||
|
private String proofUrls;
|
||||||
|
|
||||||
|
@ApiModelProperty("分值")
|
||||||
|
private BigDecimal score;
|
||||||
|
|
||||||
|
@ApiModelProperty("金额")
|
||||||
|
private BigDecimal amount;
|
||||||
|
|
||||||
|
@ApiModelProperty("申请复议截止日期,yyyy-MM-dd")
|
||||||
|
private Date appealEndDate;
|
||||||
|
}
|
||||||
@@ -0,0 +1,62 @@
|
|||||||
|
package com.cool.store.request.tp;
|
||||||
|
|
||||||
|
import com.cool.store.common.InsertGroup;
|
||||||
|
import com.cool.store.common.UpdateGroup;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 惩处规则更新Request
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author wangff
|
||||||
|
* @since 2025/11/4
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class TpPenaltyRuleUpdateRequest {
|
||||||
|
|
||||||
|
@ApiModelProperty("id")
|
||||||
|
@NotNull(message = "id不能为空", groups = {UpdateGroup.class})
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@ApiModelProperty("问题分类")
|
||||||
|
@NotBlank(message = "问题分类不能为空", groups = {InsertGroup.class, UpdateGroup.class})
|
||||||
|
private String problemClassification;
|
||||||
|
|
||||||
|
@ApiModelProperty("项目大类")
|
||||||
|
@NotBlank(message = "项目大类不能为空", groups = {InsertGroup.class, UpdateGroup.class})
|
||||||
|
private String projectCategory;
|
||||||
|
|
||||||
|
@ApiModelProperty("惩处项目名称")
|
||||||
|
@NotBlank(message = "惩处项目名称不能为空", groups = {InsertGroup.class, UpdateGroup.class})
|
||||||
|
private String projectName;
|
||||||
|
|
||||||
|
@ApiModelProperty("警告上限次数")
|
||||||
|
@NotNull(message = "警告上限次数不能为空", groups = {InsertGroup.class, UpdateGroup.class})
|
||||||
|
private Integer warningLimit;
|
||||||
|
|
||||||
|
@ApiModelProperty("扣分值")
|
||||||
|
@NotNull(message = "扣分值不能为空", groups = {InsertGroup.class, UpdateGroup.class})
|
||||||
|
private BigDecimal score;
|
||||||
|
|
||||||
|
@ApiModelProperty("罚款金额")
|
||||||
|
@NotNull(message = "罚款金额不能为空", groups = {InsertGroup.class, UpdateGroup.class})
|
||||||
|
private BigDecimal amount;
|
||||||
|
|
||||||
|
@ApiModelProperty("复议申请时效")
|
||||||
|
@NotNull(message = "复议申请时效不能为空", groups = {InsertGroup.class, UpdateGroup.class})
|
||||||
|
private Integer appealDeadline;
|
||||||
|
|
||||||
|
@ApiModelProperty("启用状态,0未启用 1启用")
|
||||||
|
@NotNull(message = "启用状态不能为空", groups = {InsertGroup.class, UpdateGroup.class})
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
@ApiModelProperty("惩处项目描述")
|
||||||
|
@NotBlank(message = "惩处项目描述不能为空", groups = {InsertGroup.class, UpdateGroup.class})
|
||||||
|
private String remark;
|
||||||
|
}
|
||||||
@@ -0,0 +1,49 @@
|
|||||||
|
package com.cool.store.request.tp;
|
||||||
|
|
||||||
|
import com.cool.store.common.InsertGroup;
|
||||||
|
import com.cool.store.common.UpdateGroup;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 加分规则更新Request
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author wangff
|
||||||
|
* @since 2025/11/4
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class TpRewardRuleUpdateRequest {
|
||||||
|
|
||||||
|
@ApiModelProperty("id")
|
||||||
|
@NotNull(message = "id不能为空", groups = {UpdateGroup.class})
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@ApiModelProperty("项目大类")
|
||||||
|
@NotBlank(message = "项目大类不能为空", groups = {InsertGroup.class, UpdateGroup.class})
|
||||||
|
private String projectCategory;
|
||||||
|
|
||||||
|
@ApiModelProperty("加分项目名称")
|
||||||
|
@NotBlank(message = "加分项目名称不能为空", groups = {InsertGroup.class, UpdateGroup.class})
|
||||||
|
private String projectName;
|
||||||
|
|
||||||
|
@ApiModelProperty("是否加满,0否 1是")
|
||||||
|
@NotNull(message = "是否加满不能为空", groups = {InsertGroup.class, UpdateGroup.class})
|
||||||
|
private Integer isFull;
|
||||||
|
|
||||||
|
@ApiModelProperty("加分值")
|
||||||
|
private BigDecimal score;
|
||||||
|
|
||||||
|
@ApiModelProperty("启用状态,0未启用 1启用")
|
||||||
|
@NotNull(message = "启用状态不能为空", groups = {InsertGroup.class, UpdateGroup.class})
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
@ApiModelProperty("加分项目描述")
|
||||||
|
@NotBlank(message = "加分项目描述不能为空", groups = {InsertGroup.class, UpdateGroup.class})
|
||||||
|
private String remark;
|
||||||
|
}
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
package com.cool.store.request.tp;
|
||||||
|
|
||||||
|
import com.cool.store.common.PageBasicInfo;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 规则查询Request
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author wangff
|
||||||
|
* @since 2025/11/4
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class TpRuleQueryRequest extends PageBasicInfo {
|
||||||
|
@ApiModelProperty("问题分类")
|
||||||
|
private String problemClassification;
|
||||||
|
|
||||||
|
@ApiModelProperty("项目大类")
|
||||||
|
private String projectCategory;
|
||||||
|
|
||||||
|
@ApiModelProperty("项目名称")
|
||||||
|
private String projectName;
|
||||||
|
|
||||||
|
@ApiModelProperty("启用状态,0未启用 1启用")
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "规则类型,0扣分 1加分", hidden = true)
|
||||||
|
private Integer type;
|
||||||
|
}
|
||||||
@@ -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;
|
||||||
|
}
|
||||||
@@ -17,6 +17,9 @@ import java.util.List;
|
|||||||
* @注释:
|
* @注释:
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Builder
|
||||||
public class AuditInfoResponse {
|
public class AuditInfoResponse {
|
||||||
|
|
||||||
@ApiModelProperty("操作人集合")
|
@ApiModelProperty("操作人集合")
|
||||||
|
|||||||
@@ -0,0 +1,24 @@
|
|||||||
|
package com.cool.store.vo.dict;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 字典项简单信息VO
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author wangff
|
||||||
|
* @since 2025/9/26
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class DictColumnSimpleVO {
|
||||||
|
@ApiModelProperty("字典项名称")
|
||||||
|
private String columnName;
|
||||||
|
|
||||||
|
@ApiModelProperty("字典项编码")
|
||||||
|
private String columnCode;
|
||||||
|
|
||||||
|
@ApiModelProperty("字典表编码")
|
||||||
|
private String tableCode;
|
||||||
|
}
|
||||||
@@ -0,0 +1,56 @@
|
|||||||
|
package com.cool.store.vo.dict;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 字典项VO
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author wangff
|
||||||
|
* @since 2025/2/20
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class DictColumnVO {
|
||||||
|
@ApiModelProperty("id")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@ApiModelProperty("字典表分组id")
|
||||||
|
private Long dictGroupId;
|
||||||
|
|
||||||
|
@ApiModelProperty("字典表id")
|
||||||
|
private Long dictTableId;
|
||||||
|
|
||||||
|
@ApiModelProperty("字典项名称")
|
||||||
|
private String columnName;
|
||||||
|
|
||||||
|
@ApiModelProperty("字典项编码")
|
||||||
|
private String columnCode;
|
||||||
|
|
||||||
|
@ApiModelProperty("启用状态 0:不启用 1:启用")
|
||||||
|
private Integer openStatus;
|
||||||
|
|
||||||
|
@ApiModelProperty("备注")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
@ApiModelProperty("创建人")
|
||||||
|
private String createUserId;
|
||||||
|
|
||||||
|
@ApiModelProperty("创建人姓名")
|
||||||
|
private String createUserName;
|
||||||
|
|
||||||
|
@ApiModelProperty("更新人")
|
||||||
|
private String updateUserId;
|
||||||
|
|
||||||
|
@ApiModelProperty("更新人姓名")
|
||||||
|
private String updateUserName;
|
||||||
|
|
||||||
|
@ApiModelProperty("创建时间")
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
@ApiModelProperty("更新时间")
|
||||||
|
private Date updateTime;
|
||||||
|
}
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
package com.cool.store.vo.dict;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 字典分组VO
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author wangff
|
||||||
|
* @since 2025/2/19
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class DictGroupVO {
|
||||||
|
@ApiModelProperty("id")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@ApiModelProperty("分组名称")
|
||||||
|
private String groupName;
|
||||||
|
|
||||||
|
@ApiModelProperty("备注")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
@ApiModelProperty("字典表列表")
|
||||||
|
private List<DictTableVO> tableList;
|
||||||
|
}
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
package com.cool.store.vo.dict;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 字典表信息表VO
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author wangff
|
||||||
|
* @since 2025/2/19
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class DictTableVO {
|
||||||
|
@ApiModelProperty("id")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@ApiModelProperty("字典表分组id")
|
||||||
|
private Long dictGroupId;
|
||||||
|
|
||||||
|
@ApiModelProperty("字典表名称")
|
||||||
|
private String tableName;
|
||||||
|
|
||||||
|
@ApiModelProperty("字典表编码")
|
||||||
|
private String tableCode;
|
||||||
|
|
||||||
|
@ApiModelProperty("启用状态 0:不启用 1:启用")
|
||||||
|
private Integer openStatus;
|
||||||
|
|
||||||
|
@ApiModelProperty("备注")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
@ApiModelProperty("字典数量")
|
||||||
|
private Integer columnNum;
|
||||||
|
}
|
||||||
@@ -0,0 +1,59 @@
|
|||||||
|
package com.cool.store.vo.tp;
|
||||||
|
|
||||||
|
import com.cool.store.annotation.DictField;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 复议申请单详情VO
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author wangff
|
||||||
|
* @since 2025/11/10
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class TpAppealFormDetailVO {
|
||||||
|
@ApiModelProperty("id")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@ApiModelProperty("门店id")
|
||||||
|
private String storeId;
|
||||||
|
|
||||||
|
@ApiModelProperty("门店编码")
|
||||||
|
private String storeNum;
|
||||||
|
|
||||||
|
@ApiModelProperty("门店名称")
|
||||||
|
private String storeName;
|
||||||
|
|
||||||
|
@ApiModelProperty("是否为草稿 0否 1是")
|
||||||
|
private Integer isDraft;
|
||||||
|
|
||||||
|
@ApiModelProperty("处罚单id")
|
||||||
|
private Long penaltyId;
|
||||||
|
|
||||||
|
@ApiModelProperty("处罚单号")
|
||||||
|
private Long penaltyNo;
|
||||||
|
|
||||||
|
@ApiModelProperty("证明图片列表")
|
||||||
|
private String proofUrls;
|
||||||
|
|
||||||
|
@ApiModelProperty("申请人姓名")
|
||||||
|
private String applicantName;
|
||||||
|
|
||||||
|
@ApiModelProperty("联系电话")
|
||||||
|
private String phone;
|
||||||
|
|
||||||
|
@ApiModelProperty("复议理由")
|
||||||
|
private String appealReason;
|
||||||
|
|
||||||
|
@ApiModelProperty("复议理由名称")
|
||||||
|
@DictField
|
||||||
|
private String appealReasonName;
|
||||||
|
|
||||||
|
@ApiModelProperty("复议详细理由")
|
||||||
|
private String appealDetailReason;
|
||||||
|
|
||||||
|
@ApiModelProperty("处罚单")
|
||||||
|
private TpPenaltyApplyDetailVO penaltyDetail;
|
||||||
|
}
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
package com.cool.store.vo.tp;
|
||||||
|
|
||||||
|
import com.cool.store.annotation.DictField;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 复审列表VO
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author wangff
|
||||||
|
* @since 2025/11/10
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class TpAppealListVO extends TpApplyListBaseVO {
|
||||||
|
@ApiModelProperty("处罚单id")
|
||||||
|
private Long penaltyId;
|
||||||
|
|
||||||
|
@ApiModelProperty("处罚单号")
|
||||||
|
private String penaltyNo;
|
||||||
|
|
||||||
|
@ApiModelProperty("申请人姓名")
|
||||||
|
private String applicantName;
|
||||||
|
|
||||||
|
@ApiModelProperty("联系电话")
|
||||||
|
private String phone;
|
||||||
|
|
||||||
|
@ApiModelProperty("复议理由")
|
||||||
|
private String appealReason;
|
||||||
|
|
||||||
|
@ApiModelProperty("复议理由名称")
|
||||||
|
@DictField
|
||||||
|
private String appealReasonName;
|
||||||
|
|
||||||
|
@ApiModelProperty("复议详细理由")
|
||||||
|
private String appealDetailReason;
|
||||||
|
}
|
||||||
@@ -0,0 +1,86 @@
|
|||||||
|
package com.cool.store.vo.tp;
|
||||||
|
|
||||||
|
import com.cool.store.annotation.DictField;
|
||||||
|
import com.cool.store.enums.tp.TpFormStatusEnum;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 申请表单列表基础VO
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author wangff
|
||||||
|
* @since 2025/11/6
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class TpApplyListBaseVO {
|
||||||
|
@ApiModelProperty("id")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@ApiModelProperty("申请单号")
|
||||||
|
private String applyNo;
|
||||||
|
|
||||||
|
@ApiModelProperty("规则id(项目类型)")
|
||||||
|
private Long ruleId;
|
||||||
|
|
||||||
|
@ApiModelProperty("规则编码")
|
||||||
|
private String ruleNo;
|
||||||
|
|
||||||
|
@ApiModelProperty("项目大类")
|
||||||
|
private String projectCategory;
|
||||||
|
|
||||||
|
@ApiModelProperty("项目大类名称")
|
||||||
|
@DictField
|
||||||
|
private String projectCategoryName;
|
||||||
|
|
||||||
|
@ApiModelProperty("分值")
|
||||||
|
private BigDecimal score;
|
||||||
|
|
||||||
|
@ApiModelProperty("项目名称")
|
||||||
|
private String projectName;
|
||||||
|
|
||||||
|
@ApiModelProperty("门店id")
|
||||||
|
private String storeId;
|
||||||
|
|
||||||
|
@ApiModelProperty("门店编码")
|
||||||
|
private String storeNum;
|
||||||
|
|
||||||
|
@ApiModelProperty("门店名称")
|
||||||
|
private String storeName;
|
||||||
|
|
||||||
|
@ApiModelProperty("审批人")
|
||||||
|
private String approveUserId;
|
||||||
|
|
||||||
|
@ApiModelProperty("审批人名称")
|
||||||
|
private String approveUserName;
|
||||||
|
|
||||||
|
@ApiModelProperty("状态")
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
@ApiModelProperty("状态名称")
|
||||||
|
private String statusName;
|
||||||
|
|
||||||
|
@ApiModelProperty("备注")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
@ApiModelProperty("申请人(创建人)名称")
|
||||||
|
private String applyUserName;
|
||||||
|
|
||||||
|
@ApiModelProperty("申请时间")
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
@ApiModelProperty("审核时间")
|
||||||
|
private Date approveTime;
|
||||||
|
|
||||||
|
@ApiModelProperty("是否为草稿 0否 1是")
|
||||||
|
private Integer isDraft;
|
||||||
|
|
||||||
|
public String getStatusName() {
|
||||||
|
return TpFormStatusEnum.getMsgByStatus(this.status);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,79 @@
|
|||||||
|
package com.cool.store.vo.tp;
|
||||||
|
|
||||||
|
import com.cool.store.annotation.DictField;
|
||||||
|
import com.cool.store.enums.tp.TpFormTypeEnum;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 惩处申请详情VO
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author wangff
|
||||||
|
* @since 2025/11/6
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class TpPenaltyApplyDetailVO {
|
||||||
|
@ApiModelProperty("id")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@ApiModelProperty("申请单号")
|
||||||
|
private String applyNo;
|
||||||
|
|
||||||
|
@ApiModelProperty("门店id")
|
||||||
|
private String storeId;
|
||||||
|
|
||||||
|
@ApiModelProperty("门店编码")
|
||||||
|
private String storeNum;
|
||||||
|
|
||||||
|
@ApiModelProperty("门店名称")
|
||||||
|
private String storeName;
|
||||||
|
|
||||||
|
@ApiModelProperty("单据类型")
|
||||||
|
private Integer type;
|
||||||
|
|
||||||
|
@ApiModelProperty("单据类型名称")
|
||||||
|
private String typeName;
|
||||||
|
|
||||||
|
@ApiModelProperty("规则id(项目类型)")
|
||||||
|
private Long ruleId;
|
||||||
|
|
||||||
|
@ApiModelProperty("项目大类")
|
||||||
|
private String projectCategory;
|
||||||
|
|
||||||
|
@ApiModelProperty("项目大类名称")
|
||||||
|
@DictField
|
||||||
|
private String projectCategoryName;
|
||||||
|
|
||||||
|
@ApiModelProperty("项目名称")
|
||||||
|
private String projectName;
|
||||||
|
|
||||||
|
@ApiModelProperty("分值")
|
||||||
|
private BigDecimal score;
|
||||||
|
|
||||||
|
@ApiModelProperty("金额")
|
||||||
|
private BigDecimal amount;
|
||||||
|
|
||||||
|
@ApiModelProperty("申请复议截止日期")
|
||||||
|
private Date appealEndDate;
|
||||||
|
|
||||||
|
@ApiModelProperty("备注")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
@ApiModelProperty("是否为草稿 0否 1是")
|
||||||
|
private Integer isDraft;
|
||||||
|
|
||||||
|
@ApiModelProperty("证明图片列表")
|
||||||
|
private String proofUrls;
|
||||||
|
|
||||||
|
@ApiModelProperty("状态")
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
public String getTypeName() {
|
||||||
|
return TpFormTypeEnum.getMsgByType(this.type);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,47 @@
|
|||||||
|
package com.cool.store.vo.tp;
|
||||||
|
|
||||||
|
import com.cool.store.enums.tp.TpFormTypeEnum;
|
||||||
|
import com.cool.store.enums.tp.TpPayStatusEnum;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 惩处申请单列表VO
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author wangff
|
||||||
|
* @since 2025/11/6
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class TpPenaltyApplyListVO extends TpApplyListBaseVO {
|
||||||
|
|
||||||
|
@ApiModelProperty("单据类型")
|
||||||
|
private Integer type;
|
||||||
|
|
||||||
|
@ApiModelProperty("单据类型名称")
|
||||||
|
private String typeName;
|
||||||
|
|
||||||
|
@ApiModelProperty("金额")
|
||||||
|
private BigDecimal amount;
|
||||||
|
|
||||||
|
@ApiModelProperty("申请复议截止日期")
|
||||||
|
private Date appealEndDate;
|
||||||
|
|
||||||
|
@ApiModelProperty("缴费状态")
|
||||||
|
private Integer payStatus;
|
||||||
|
|
||||||
|
@ApiModelProperty("缴费状态名称")
|
||||||
|
private String payStatusName;
|
||||||
|
|
||||||
|
public String getTypeName() {
|
||||||
|
return TpFormTypeEnum.getMsgByType(this.type);
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPayStatusName() {
|
||||||
|
return TpPayStatusEnum.getMsgByStatus(this.payStatus);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,59 @@
|
|||||||
|
package com.cool.store.vo.tp;
|
||||||
|
|
||||||
|
import com.cool.store.annotation.DictField;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 惩处规则详情VO
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author wangff
|
||||||
|
* @since 2025/11/4
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class TpPenaltyRuleDetailVO {
|
||||||
|
@ApiModelProperty("id")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@ApiModelProperty("规则编码")
|
||||||
|
private String ruleNo;
|
||||||
|
|
||||||
|
@ApiModelProperty("问题分类")
|
||||||
|
private String problemClassification;
|
||||||
|
|
||||||
|
@ApiModelProperty("问题分类名称")
|
||||||
|
@DictField
|
||||||
|
private String problemClassificationName;
|
||||||
|
|
||||||
|
@ApiModelProperty("项目大类")
|
||||||
|
private String projectCategory;
|
||||||
|
|
||||||
|
@ApiModelProperty("项目大类名称")
|
||||||
|
@DictField
|
||||||
|
private String projectCategoryName;
|
||||||
|
|
||||||
|
@ApiModelProperty("惩处项目名称")
|
||||||
|
private String projectName;
|
||||||
|
|
||||||
|
@ApiModelProperty("警告上限次数")
|
||||||
|
private Integer warningLimit;
|
||||||
|
|
||||||
|
@ApiModelProperty("扣分值")
|
||||||
|
private BigDecimal score;
|
||||||
|
|
||||||
|
@ApiModelProperty("罚款金额")
|
||||||
|
private BigDecimal amount;
|
||||||
|
|
||||||
|
@ApiModelProperty("复议申请时效")
|
||||||
|
private Integer appealDeadline;
|
||||||
|
|
||||||
|
@ApiModelProperty("启用状态,0未启用 1启用")
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
@ApiModelProperty("惩处项目描述")
|
||||||
|
private String remark;
|
||||||
|
}
|
||||||
@@ -0,0 +1,53 @@
|
|||||||
|
package com.cool.store.vo.tp;
|
||||||
|
|
||||||
|
import com.cool.store.annotation.DictField;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 惩处规则列表VO
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author wangff
|
||||||
|
* @since 2025/11/4
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class TpPenaltyRuleListVO {
|
||||||
|
@ApiModelProperty("id")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@ApiModelProperty("规则编码")
|
||||||
|
private String ruleNo;
|
||||||
|
|
||||||
|
@ApiModelProperty("问题分类")
|
||||||
|
private String problemClassification;
|
||||||
|
|
||||||
|
@ApiModelProperty("问题分类名称")
|
||||||
|
@DictField
|
||||||
|
private String problemClassificationName;
|
||||||
|
|
||||||
|
@ApiModelProperty("项目大类")
|
||||||
|
private String projectCategory;
|
||||||
|
|
||||||
|
@ApiModelProperty("项目大类名称")
|
||||||
|
@DictField
|
||||||
|
private String projectCategoryName;
|
||||||
|
|
||||||
|
@ApiModelProperty("惩处项目名称")
|
||||||
|
private String projectName;
|
||||||
|
|
||||||
|
@ApiModelProperty("警告上限次数")
|
||||||
|
private Integer warningLimit;
|
||||||
|
|
||||||
|
@ApiModelProperty("扣分值")
|
||||||
|
private BigDecimal score;
|
||||||
|
|
||||||
|
@ApiModelProperty("罚款金额")
|
||||||
|
private BigDecimal amount;
|
||||||
|
|
||||||
|
@ApiModelProperty("启用状态,0未启用 1启用")
|
||||||
|
private Integer status;
|
||||||
|
}
|
||||||
@@ -0,0 +1,64 @@
|
|||||||
|
package com.cool.store.vo.tp;
|
||||||
|
|
||||||
|
import com.cool.store.annotation.DictField;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 加分申请详情VO
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author wangff
|
||||||
|
* @since 2025/11/6
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class TpRewardApplyDetailVO {
|
||||||
|
@ApiModelProperty("id")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@ApiModelProperty("申请单号")
|
||||||
|
private String applyNo;
|
||||||
|
|
||||||
|
@ApiModelProperty("门店id")
|
||||||
|
private String storeId;
|
||||||
|
|
||||||
|
@ApiModelProperty("门店编码")
|
||||||
|
private String storeNum;
|
||||||
|
|
||||||
|
@ApiModelProperty("门店名称")
|
||||||
|
private String storeName;
|
||||||
|
|
||||||
|
@ApiModelProperty("规则id(项目类型)")
|
||||||
|
private Long ruleId;
|
||||||
|
|
||||||
|
@ApiModelProperty("项目大类")
|
||||||
|
private String projectCategory;
|
||||||
|
|
||||||
|
@ApiModelProperty("项目大类名称")
|
||||||
|
@DictField
|
||||||
|
private String projectCategoryName;
|
||||||
|
|
||||||
|
@ApiModelProperty("项目名称")
|
||||||
|
private String projectName;
|
||||||
|
|
||||||
|
@ApiModelProperty("是否加满")
|
||||||
|
private Integer isFull;
|
||||||
|
|
||||||
|
@ApiModelProperty("分值")
|
||||||
|
private BigDecimal score;
|
||||||
|
|
||||||
|
@ApiModelProperty("备注")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
@ApiModelProperty("是否为草稿 0否 1是")
|
||||||
|
private Integer isDraft;
|
||||||
|
|
||||||
|
@ApiModelProperty("证明图片列表")
|
||||||
|
private String proofUrls;
|
||||||
|
|
||||||
|
@ApiModelProperty("状态")
|
||||||
|
private String status;
|
||||||
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
package com.cool.store.vo.tp;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 加分申请单列表VO
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author wangff
|
||||||
|
* @since 2025/11/6
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class TpRewardApplyListVO extends TpApplyListBaseVO {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,46 @@
|
|||||||
|
package com.cool.store.vo.tp;
|
||||||
|
|
||||||
|
import com.cool.store.annotation.DictField;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 加分规则详情VO
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author wangff
|
||||||
|
* @since 2025/11/4
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class TpRewardRuleDetailVO {
|
||||||
|
@ApiModelProperty("id")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@ApiModelProperty("规则编码")
|
||||||
|
private String ruleNo;
|
||||||
|
|
||||||
|
@ApiModelProperty("项目大类")
|
||||||
|
private String projectCategory;
|
||||||
|
|
||||||
|
@ApiModelProperty("项目大类名称")
|
||||||
|
@DictField
|
||||||
|
private String projectCategoryName;
|
||||||
|
|
||||||
|
@ApiModelProperty("加分项目名称")
|
||||||
|
private String projectName;
|
||||||
|
|
||||||
|
@ApiModelProperty("是否加满,0否 1是")
|
||||||
|
private Integer isFull;
|
||||||
|
|
||||||
|
@ApiModelProperty("加分值")
|
||||||
|
private BigDecimal score;
|
||||||
|
|
||||||
|
@ApiModelProperty("启用状态,0未启用 1启用")
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
@ApiModelProperty("加分项目描述")
|
||||||
|
private String remark;
|
||||||
|
}
|
||||||
@@ -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,38 @@
|
|||||||
|
package com.cool.store.vo.tp.mini;
|
||||||
|
|
||||||
|
import com.cool.store.annotation.DictField;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* Mini复议信息VO
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author wangff
|
||||||
|
* @since 2025/11/10
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class MiniTpAppealVO {
|
||||||
|
@ApiModelProperty("id")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@ApiModelProperty("申请人姓名")
|
||||||
|
private String applicantName;
|
||||||
|
|
||||||
|
@ApiModelProperty("联系电话")
|
||||||
|
private String phone;
|
||||||
|
|
||||||
|
@ApiModelProperty("复议理由")
|
||||||
|
private String appealReason;
|
||||||
|
|
||||||
|
@ApiModelProperty("复议理由名称")
|
||||||
|
@DictField
|
||||||
|
private String appealReasonName;
|
||||||
|
|
||||||
|
@ApiModelProperty("复议详细理由")
|
||||||
|
private String appealDetailReason;
|
||||||
|
|
||||||
|
@ApiModelProperty("证明材料")
|
||||||
|
private String proofUrls;
|
||||||
|
}
|
||||||
@@ -0,0 +1,61 @@
|
|||||||
|
package com.cool.store.vo.tp.mini;
|
||||||
|
|
||||||
|
import com.cool.store.enums.tp.TpFormStatusEnum;
|
||||||
|
import com.cool.store.enums.tp.TpFormTypeEnum;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* Mini申请单列表VO
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author wangff
|
||||||
|
* @since 2025/11/10
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class MiniTpApplyListVO {
|
||||||
|
@ApiModelProperty("id")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@ApiModelProperty("单据类型,0加分单 1警告书 2处罚书")
|
||||||
|
private Integer type;
|
||||||
|
|
||||||
|
@ApiModelProperty("单据类型名称")
|
||||||
|
private String typeName;
|
||||||
|
|
||||||
|
@ApiModelProperty("项目名称")
|
||||||
|
private String projectName;
|
||||||
|
|
||||||
|
@ApiModelProperty("创建时间")
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
@ApiModelProperty("分值")
|
||||||
|
private BigDecimal score;
|
||||||
|
|
||||||
|
@ApiModelProperty("金额")
|
||||||
|
private BigDecimal amount;
|
||||||
|
|
||||||
|
@ApiModelProperty("状态")
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
@ApiModelProperty("状态名称")
|
||||||
|
private String statusName;
|
||||||
|
|
||||||
|
@ApiModelProperty("是否为草稿")
|
||||||
|
private Integer isDraft;
|
||||||
|
|
||||||
|
@ApiModelProperty("是否复议中")
|
||||||
|
private Integer isAppeal;
|
||||||
|
|
||||||
|
public String getTypeName() {
|
||||||
|
return TpFormTypeEnum.getMsgByType(this.type);
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getStatusName() {
|
||||||
|
return TpFormStatusEnum.getMsgByStatus(this.status);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,76 @@
|
|||||||
|
package com.cool.store.vo.tp.mini;
|
||||||
|
|
||||||
|
import com.cool.store.annotation.DictField;
|
||||||
|
import com.cool.store.enums.tp.TpFormStatusEnum;
|
||||||
|
import com.cool.store.enums.tp.TpPayStatusEnum;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* Mini惩处申请单详情VO
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author wangff
|
||||||
|
* @since 2025/11/10
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class MiniTpPenaltyApplyVO {
|
||||||
|
@ApiModelProperty("id")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@ApiModelProperty("申请单号")
|
||||||
|
private String applyNo;
|
||||||
|
|
||||||
|
@ApiModelProperty("项目名称")
|
||||||
|
private String projectName;
|
||||||
|
|
||||||
|
@ApiModelProperty("项目大类")
|
||||||
|
private String projectCategory;
|
||||||
|
|
||||||
|
@ApiModelProperty("项目大类名称")
|
||||||
|
@DictField
|
||||||
|
private String projectCategoryName;
|
||||||
|
|
||||||
|
@ApiModelProperty("创建时间")
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
@ApiModelProperty("申请人名称")
|
||||||
|
private String applyUserName;
|
||||||
|
|
||||||
|
@ApiModelProperty("状态")
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
@ApiModelProperty("缴费状态")
|
||||||
|
private Integer payStatus;
|
||||||
|
|
||||||
|
@ApiModelProperty("缴费状态名称")
|
||||||
|
private String payStatusName;
|
||||||
|
|
||||||
|
@ApiModelProperty("状态名称")
|
||||||
|
private String statusName;
|
||||||
|
|
||||||
|
@ApiModelProperty("分值")
|
||||||
|
private BigDecimal score;
|
||||||
|
|
||||||
|
@ApiModelProperty("复议截止日期")
|
||||||
|
private Date appealEndDate;
|
||||||
|
|
||||||
|
@ApiModelProperty("证明图片列表")
|
||||||
|
private String proofUrls;
|
||||||
|
|
||||||
|
@ApiModelProperty("复议申请")
|
||||||
|
private MiniTpAppealVO appeal;
|
||||||
|
|
||||||
|
public String getStatusName() {
|
||||||
|
return TpFormStatusEnum.getMsgByStatus(this.status);
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPayStatusName() {
|
||||||
|
return TpPayStatusEnum.getMsgByStatus(this.payStatus);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,55 @@
|
|||||||
|
package com.cool.store.vo.tp.mini;
|
||||||
|
|
||||||
|
import com.cool.store.annotation.DictField;
|
||||||
|
import com.cool.store.enums.tp.TpFormStatusEnum;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* Mini加分申请单详情VO
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author wangff
|
||||||
|
* @since 2025/11/10
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class MiniTpRewardApplyVO {
|
||||||
|
@ApiModelProperty("id")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@ApiModelProperty("申请单号")
|
||||||
|
private String applyNo;
|
||||||
|
|
||||||
|
@ApiModelProperty("项目名称")
|
||||||
|
private String projectName;
|
||||||
|
|
||||||
|
@ApiModelProperty("项目大类")
|
||||||
|
private String projectCategory;
|
||||||
|
|
||||||
|
@ApiModelProperty("项目大类名称")
|
||||||
|
@DictField
|
||||||
|
private String projectCategoryName;
|
||||||
|
|
||||||
|
@ApiModelProperty("创建时间")
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
@ApiModelProperty("状态")
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
@ApiModelProperty("状态名称")
|
||||||
|
private String statusName;
|
||||||
|
|
||||||
|
@ApiModelProperty("分值")
|
||||||
|
private BigDecimal score;
|
||||||
|
|
||||||
|
@ApiModelProperty("证明图片列表")
|
||||||
|
private String proofUrls;
|
||||||
|
|
||||||
|
public String getStatusName() {
|
||||||
|
return TpFormStatusEnum.getMsgByStatus(this.status);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,53 @@
|
|||||||
|
package com.cool.store.vo.tp.mini;
|
||||||
|
|
||||||
|
import com.cool.store.annotation.DictField;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* Mini奖惩规则列表VO
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author wangff
|
||||||
|
* @since 2025/11/11
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class MiniTpRuleListVO {
|
||||||
|
@ApiModelProperty("id")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@ApiModelProperty("问题分类")
|
||||||
|
private String problemClassification;
|
||||||
|
|
||||||
|
@ApiModelProperty("问题分类名称")
|
||||||
|
@DictField
|
||||||
|
private String problemClassificationName;
|
||||||
|
|
||||||
|
@ApiModelProperty("项目大类")
|
||||||
|
private String projectCategory;
|
||||||
|
|
||||||
|
@ApiModelProperty("项目大类名称")
|
||||||
|
@DictField
|
||||||
|
private String projectCategoryName;
|
||||||
|
|
||||||
|
@ApiModelProperty("项目名称")
|
||||||
|
private String projectName;
|
||||||
|
|
||||||
|
@ApiModelProperty("警告上限次数")
|
||||||
|
private Integer warningLimit;
|
||||||
|
|
||||||
|
@ApiModelProperty("分值")
|
||||||
|
private BigDecimal score;
|
||||||
|
|
||||||
|
@ApiModelProperty("是否加满,0否 1是")
|
||||||
|
private Integer isFull;
|
||||||
|
|
||||||
|
@ApiModelProperty("金额")
|
||||||
|
private BigDecimal amount;
|
||||||
|
|
||||||
|
@ApiModelProperty("项目描述")
|
||||||
|
private String remark;
|
||||||
|
}
|
||||||
@@ -0,0 +1,48 @@
|
|||||||
|
package com.cool.store.service.dict;
|
||||||
|
|
||||||
|
import com.cool.store.request.dict.DictColumnQueryRequest;
|
||||||
|
import com.cool.store.vo.dict.DictColumnSimpleVO;
|
||||||
|
import com.cool.store.vo.dict.DictColumnVO;
|
||||||
|
import com.github.pagehelper.PageInfo;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 字典项
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author wangff
|
||||||
|
* @since 2025/2/20
|
||||||
|
*/
|
||||||
|
public interface DictColumnService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据id查询
|
||||||
|
* @param id id
|
||||||
|
* @return 字典项VO
|
||||||
|
*/
|
||||||
|
DictColumnVO getById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询
|
||||||
|
* @param dto 字典项查询DTO
|
||||||
|
* @return 字典项VO分页对象
|
||||||
|
*/
|
||||||
|
PageInfo<DictColumnVO> getPage(DictColumnQueryRequest dto);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据编码查询已启用的字典项
|
||||||
|
* @param columnCode 字典项编码
|
||||||
|
* @return 字典项简单信息VO
|
||||||
|
*/
|
||||||
|
DictColumnSimpleVO getColumnByColumnCode(String columnCode);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据表编码查询字典项
|
||||||
|
* @param tableCodes 字典表编码列表
|
||||||
|
* @return 字典项简单信息映射
|
||||||
|
*/
|
||||||
|
Map<String, List<DictColumnSimpleVO>> getMapListByTableCode(List<String> tableCodes);
|
||||||
|
}
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
package com.cool.store.service.dict;
|
||||||
|
|
||||||
|
import com.cool.store.request.dict.DictGroupQueryRequest;
|
||||||
|
import com.cool.store.vo.dict.DictGroupVO;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 字典分组
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author wangff
|
||||||
|
* @since 2025/2/20
|
||||||
|
*/
|
||||||
|
public interface DictGroupService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据id查询
|
||||||
|
* @param id id
|
||||||
|
* @return 字典分组VO
|
||||||
|
*/
|
||||||
|
DictGroupVO getById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询列表
|
||||||
|
* @param queryDTO 字典分组查询DTO
|
||||||
|
* @return 字典分组实体列表
|
||||||
|
*/
|
||||||
|
List<DictGroupVO> getList(DictGroupQueryRequest queryDTO);
|
||||||
|
}
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
package com.cool.store.service.dict;
|
||||||
|
|
||||||
|
import com.cool.store.request.dict.DictTableQueryRequest;
|
||||||
|
import com.cool.store.vo.dict.DictTableVO;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 字典表
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author wangff
|
||||||
|
* @since 2025/2/20
|
||||||
|
*/
|
||||||
|
public interface DictTableInfoService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据id查询
|
||||||
|
* @param id id
|
||||||
|
* @return 字典表信息表VO
|
||||||
|
*/
|
||||||
|
DictTableVO getById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* VO列表查询
|
||||||
|
* @param dto 字典表查询DTO
|
||||||
|
* @return 字典表信息表VO列表
|
||||||
|
*/
|
||||||
|
List<DictTableVO> getList(DictTableQueryRequest dto);
|
||||||
|
}
|
||||||
@@ -0,0 +1,83 @@
|
|||||||
|
package com.cool.store.service.dict.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollStreamUtil;
|
||||||
|
import com.cool.store.dao.EnterpriseUserDAO;
|
||||||
|
import com.cool.store.dao.dict.SysDictColumnDAO;
|
||||||
|
import com.cool.store.dao.dict.SysDictTableDAO;
|
||||||
|
import com.cool.store.entity.dict.SysDictColumnDO;
|
||||||
|
import com.cool.store.entity.dict.SysDictTableDO;
|
||||||
|
import com.cool.store.request.dict.DictColumnQueryRequest;
|
||||||
|
import com.cool.store.service.dict.DictColumnService;
|
||||||
|
import com.cool.store.utils.BeanUtil;
|
||||||
|
import com.cool.store.vo.dict.DictColumnSimpleVO;
|
||||||
|
import com.cool.store.vo.dict.DictColumnVO;
|
||||||
|
import com.github.pagehelper.PageHelper;
|
||||||
|
import com.github.pagehelper.PageInfo;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 字典项 实现类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author wangff
|
||||||
|
* @since 2025/2/20
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class DictColumnServiceImpl implements DictColumnService {
|
||||||
|
private final SysDictColumnDAO columnDAO;
|
||||||
|
private final SysDictTableDAO tableDAO;
|
||||||
|
private final EnterpriseUserDAO userDAO;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public DictColumnVO getById(Long id) {
|
||||||
|
SysDictColumnDO column = columnDAO.getById(id);
|
||||||
|
return BeanUtil.toBean(column, DictColumnVO.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageInfo<DictColumnVO> getPage(DictColumnQueryRequest dto) {
|
||||||
|
PageHelper.startPage(dto.getPageNum(), dto.getPageSize());
|
||||||
|
List<SysDictColumnDO> list = columnDAO.getList(dto);
|
||||||
|
PageInfo<SysDictColumnDO> page = new PageInfo<>(list);
|
||||||
|
PageInfo<DictColumnVO> result = BeanUtil.toPage(page, DictColumnVO.class);
|
||||||
|
Set<String> userIds = new HashSet<>();
|
||||||
|
result.getList().forEach(item -> {
|
||||||
|
userIds.add(item.getCreateUserId());
|
||||||
|
userIds.add(item.getUpdateUserId());
|
||||||
|
});
|
||||||
|
if (CollectionUtils.isNotEmpty(userIds)) {
|
||||||
|
Map<String, String> userNameMap = userDAO.getUserNameMap(new ArrayList<>(userIds));
|
||||||
|
result.getList().forEach(v -> {
|
||||||
|
v.setCreateUserName(userNameMap.get(v.getCreateUserId()));
|
||||||
|
v.setUpdateUserName(userNameMap.get(v.getUpdateUserId()));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public DictColumnSimpleVO getColumnByColumnCode(String columnCode) {
|
||||||
|
SysDictColumnDO column = columnDAO.getOpenColumnByCode(columnCode);
|
||||||
|
SysDictTableDO table = tableDAO.getById(column.getDictTableId());
|
||||||
|
DictColumnSimpleVO vo = BeanUtil.toBean(column, DictColumnSimpleVO.class);
|
||||||
|
if (Objects.nonNull(table)) {
|
||||||
|
vo.setTableCode(table.getTableCode());
|
||||||
|
}
|
||||||
|
return vo;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map<String, List<DictColumnSimpleVO>> getMapListByTableCode(List<String> tableCodes) {
|
||||||
|
if (CollectionUtils.isEmpty(tableCodes)) {
|
||||||
|
return Collections.emptyMap();
|
||||||
|
}
|
||||||
|
List<DictColumnSimpleVO> list = columnDAO.getOpenColumnListByTableCode(tableCodes);
|
||||||
|
return CollStreamUtil.groupByKey(list, DictColumnSimpleVO::getTableCode);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,61 @@
|
|||||||
|
package com.cool.store.service.dict.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollStreamUtil;
|
||||||
|
import com.cool.store.dao.dict.SysDictColumnDAO;
|
||||||
|
import com.cool.store.dao.dict.SysDictGroupDAO;
|
||||||
|
import com.cool.store.dao.dict.SysDictTableDAO;
|
||||||
|
import com.cool.store.entity.dict.SysDictGroupDO;
|
||||||
|
import com.cool.store.entity.dict.SysDictTableDO;
|
||||||
|
import com.cool.store.request.dict.DictGroupQueryRequest;
|
||||||
|
import com.cool.store.service.dict.DictGroupService;
|
||||||
|
import com.cool.store.utils.BeanUtil;
|
||||||
|
import com.cool.store.vo.dict.DictGroupVO;
|
||||||
|
import com.cool.store.vo.dict.DictTableVO;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 字典分组 实现类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author wangff
|
||||||
|
* @since 2025/2/20
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class DictGroupServiceImpl implements DictGroupService {
|
||||||
|
private final SysDictGroupDAO groupDAO;
|
||||||
|
private final SysDictTableDAO tableDAO;
|
||||||
|
private final SysDictColumnDAO columnDAO;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public DictGroupVO getById(Long id) {
|
||||||
|
SysDictGroupDO group = groupDAO.getById(id);
|
||||||
|
return BeanUtil.toBean(group, DictGroupVO.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<DictGroupVO> getList(DictGroupQueryRequest queryDTO) {
|
||||||
|
List<SysDictGroupDO> list = groupDAO.getList(queryDTO);
|
||||||
|
List<DictGroupVO> result = BeanUtil.toList(list, DictGroupVO.class);
|
||||||
|
// 查询字典表
|
||||||
|
List<Long> groupIds = CollStreamUtil.toList(result, DictGroupVO::getId);
|
||||||
|
List<SysDictTableDO> tableList = tableDAO.getListByGroupIds(groupIds, queryDTO.getDictTableOpenStatus());
|
||||||
|
List<DictTableVO> tableVOList = BeanUtil.toList(tableList, DictTableVO.class);
|
||||||
|
// 查询字典项数量
|
||||||
|
List<Long> tableIds = CollStreamUtil.toList(tableVOList, DictTableVO::getId);
|
||||||
|
Map<Long, Integer> columnNumMap = columnDAO.getColumnNumMapByTableIds(tableIds);
|
||||||
|
|
||||||
|
tableVOList.forEach(v -> v.setColumnNum(columnNumMap.getOrDefault(v.getId(), 0)));
|
||||||
|
|
||||||
|
Map<Long, List<DictTableVO>> tableMap = CollStreamUtil.groupByKey(tableVOList, DictTableVO::getDictGroupId);
|
||||||
|
result.forEach(v -> v.setTableList(tableMap.getOrDefault(v.getId(), Collections.emptyList())));
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,174 @@
|
|||||||
|
package com.cool.store.service.dict.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollStreamUtil;
|
||||||
|
import com.cool.store.annotation.DictField;
|
||||||
|
import com.cool.store.dao.dict.SysDictColumnDAO;
|
||||||
|
import javafx.util.Pair;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.lang.reflect.Field;
|
||||||
|
import java.util.*;
|
||||||
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 字典服务类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author wangff
|
||||||
|
* @since 2025/11/4
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@Slf4j
|
||||||
|
public class DictService {
|
||||||
|
private final SysDictColumnDAO columnDAO;
|
||||||
|
private final Map<Class<?>, List<Pair<Field, Field>>> dictFieldCache = new ConcurrentHashMap<>();
|
||||||
|
private final Map<Class<?>, Field[]> fieldCache = new ConcurrentHashMap<>();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 填充字典字段
|
||||||
|
*/
|
||||||
|
public <T> void fillDictField(T obj) {
|
||||||
|
fillDictField(Collections.singletonList(obj));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 填充字典字段
|
||||||
|
*/
|
||||||
|
public <T> void fillDictField(List<T> objs) {
|
||||||
|
if (CollectionUtils.isEmpty(objs)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
Class<?> clazz = objs.get(0).getClass();
|
||||||
|
fillDictField(objs, clazz, new HashSet<>());
|
||||||
|
}
|
||||||
|
|
||||||
|
private <T> void fillDictField(List<T> objs, Class<?> clazz, Set<Object> processedObjects) {
|
||||||
|
List<Pair<Field, Field>> dictFields = getDictField(clazz);
|
||||||
|
if (CollectionUtils.isEmpty(dictFields)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
Set<String> columnCodes = new HashSet<>();
|
||||||
|
List<T> validObjs = new ArrayList<>();
|
||||||
|
for (T obj : objs) {
|
||||||
|
if (obj == null || processedObjects.contains(obj)) continue;
|
||||||
|
processedObjects.add(obj);
|
||||||
|
validObjs.add(obj);
|
||||||
|
for (Pair<Field, Field> dictField : dictFields) {
|
||||||
|
try {
|
||||||
|
Object value = dictField.getValue().get(obj);
|
||||||
|
if (value != null) {
|
||||||
|
columnCodes.add((String) value);
|
||||||
|
}
|
||||||
|
} catch (IllegalAccessException e) {
|
||||||
|
log.info("字典字段值获取失败", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!columnCodes.isEmpty()) {
|
||||||
|
Map<String, String> nameMap = columnDAO.getNameMapByCodes(new ArrayList<>(columnCodes));
|
||||||
|
for (T obj : objs) {
|
||||||
|
for (Pair<Field, Field> dictField : dictFields) {
|
||||||
|
try {
|
||||||
|
dictField.getKey().set(obj, nameMap.get((String) dictField.getValue().get(obj)));
|
||||||
|
} catch (IllegalAccessException e) {
|
||||||
|
log.info("字典字段值填充失败", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
processNestedObjects(validObjs, clazz, processedObjects);
|
||||||
|
}
|
||||||
|
|
||||||
|
private <T> void processNestedObjects(List<T> objs, Class<?> clazz, Set<Object> processedObjects) {
|
||||||
|
Field[] fields = getFieldCache(clazz);
|
||||||
|
for (Field field : fields) {
|
||||||
|
if (isComplexObjectField(field)) {
|
||||||
|
field.setAccessible(true);
|
||||||
|
|
||||||
|
for (T obj : objs) {
|
||||||
|
if (obj == null) continue;
|
||||||
|
|
||||||
|
try {
|
||||||
|
Object fieldValue = field.get(obj);
|
||||||
|
if (fieldValue != null) {
|
||||||
|
if (fieldValue instanceof Collection) {
|
||||||
|
// 处理集合类型字段
|
||||||
|
Collection<?> collection = (Collection<?>) fieldValue;
|
||||||
|
List<Object> nestedObjs = new ArrayList<>();
|
||||||
|
for (Object item : collection) {
|
||||||
|
if (item != null && isComplexObject(item.getClass())) {
|
||||||
|
nestedObjs.add(item);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!nestedObjs.isEmpty()) {
|
||||||
|
fillDictField(nestedObjs, nestedObjs.get(0).getClass(), new HashSet<>(processedObjects));
|
||||||
|
}
|
||||||
|
} else if (isComplexObject(fieldValue.getClass())) {
|
||||||
|
// 处理单一对象类型字段
|
||||||
|
fillDictField(Collections.singletonList(fieldValue), fieldValue.getClass(), processedObjects);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (IllegalAccessException e) {
|
||||||
|
log.info("嵌套对象字段获取失败", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean isComplexObjectField(Field field) {
|
||||||
|
Class<?> fieldType = field.getType();
|
||||||
|
return isComplexObject(fieldType);
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean isComplexObject(Class<?> clazz) {
|
||||||
|
return !clazz.isPrimitive() &&
|
||||||
|
!clazz.getName().startsWith("java") &&
|
||||||
|
!clazz.equals(String.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
private Field[] getFieldCache(Class<?> clazz) {
|
||||||
|
return fieldCache.computeIfAbsent(clazz, this::getAllFields);
|
||||||
|
}
|
||||||
|
|
||||||
|
private Field[] getAllFields(Class<?> clazz) {
|
||||||
|
List<Field> fields = new ArrayList<>();
|
||||||
|
while (clazz != null && !clazz.equals(Object.class)) {
|
||||||
|
Collections.addAll(fields, clazz.getDeclaredFields());
|
||||||
|
clazz = clazz.getSuperclass();
|
||||||
|
}
|
||||||
|
return fields.toArray(new Field[0]);
|
||||||
|
}
|
||||||
|
|
||||||
|
private <T> List<Pair<Field, Field>> getDictField(Class<T> clazz) {
|
||||||
|
return dictFieldCache.computeIfAbsent(clazz, this::computeDictFields);
|
||||||
|
}
|
||||||
|
|
||||||
|
private <T> List<Pair<Field, Field>> computeDictFields(Class<T> clazz) {
|
||||||
|
Field[] fields = getFieldCache(clazz);
|
||||||
|
Map<String, Field> fieldMap = CollStreamUtil.toMap(Arrays.asList(fields), Field::getName, v -> v);
|
||||||
|
List<Pair<Field, Field>> dictFields = new ArrayList<>();
|
||||||
|
for (Field field : fields) {
|
||||||
|
DictField dictField = field.getAnnotation(DictField.class);
|
||||||
|
if (Objects.nonNull(dictField)) {
|
||||||
|
field.setAccessible(true);
|
||||||
|
String fieldName = field.getName();
|
||||||
|
String sourceFieldName = StringUtils.isBlank(dictField.sourceField()) && fieldName.endsWith("Name")
|
||||||
|
? fieldName.substring(0, fieldName.length() - 4)
|
||||||
|
: dictField.sourceField();
|
||||||
|
if (StringUtils.isNotBlank(sourceFieldName) && fieldMap.containsKey(sourceFieldName)) {
|
||||||
|
Field sourceField = fieldMap.get(sourceFieldName);
|
||||||
|
sourceField.setAccessible(true);
|
||||||
|
dictFields.add(new Pair<>(field, sourceField));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return dictFields;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,41 @@
|
|||||||
|
package com.cool.store.service.dict.impl;
|
||||||
|
|
||||||
|
import com.cool.store.dao.dict.SysDictColumnDAO;
|
||||||
|
import com.cool.store.dao.dict.SysDictTableDAO;
|
||||||
|
import com.cool.store.entity.dict.SysDictTableDO;
|
||||||
|
import com.cool.store.request.dict.DictTableQueryRequest;
|
||||||
|
import com.cool.store.service.dict.DictTableInfoService;
|
||||||
|
import com.cool.store.utils.BeanUtil;
|
||||||
|
import com.cool.store.vo.dict.DictTableVO;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 字典表 实现类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author wangff
|
||||||
|
* @since 2025/2/20
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class DictTableInfoServiceImpl implements DictTableInfoService {
|
||||||
|
private final SysDictTableDAO dictTableInfoDAO;
|
||||||
|
private final SysDictColumnDAO columnInfoDAO;
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public DictTableVO getById(Long id) {
|
||||||
|
SysDictTableDO table = dictTableInfoDAO.getById(id);
|
||||||
|
return BeanUtil.toBean(table, DictTableVO.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<DictTableVO> getList(DictTableQueryRequest dto) {
|
||||||
|
List<SysDictTableDO> list = dictTableInfoDAO.getList(dto);
|
||||||
|
return BeanUtil.toList(list, DictTableVO.class);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,170 @@
|
|||||||
|
package com.cool.store.service.tp;
|
||||||
|
|
||||||
|
import com.cool.store.entity.tp.TpApplyFormDO;
|
||||||
|
import com.cool.store.request.tp.*;
|
||||||
|
import com.cool.store.response.AuditInfoResponse;
|
||||||
|
import com.cool.store.vo.tp.*;
|
||||||
|
import com.cool.store.vo.tp.mini.MiniTpApplyListVO;
|
||||||
|
import com.cool.store.vo.tp.mini.MiniTpPenaltyApplyVO;
|
||||||
|
import com.cool.store.vo.tp.mini.MiniTpRewardApplyVO;
|
||||||
|
import com.cool.store.vo.tp.mini.MiniTpRuleListVO;
|
||||||
|
import com.github.pagehelper.PageInfo;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 十二分制-申请单 服务类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author wangff
|
||||||
|
* @since 2025/11/5
|
||||||
|
*/
|
||||||
|
public interface TpApplyService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 加分申请提交
|
||||||
|
* @param request 奖惩申请Request
|
||||||
|
* @return 是否成功
|
||||||
|
*/
|
||||||
|
Boolean rewardApplySubmit(TpApplyRequest request);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 加分申请单详情
|
||||||
|
* @param applyId 申请单id
|
||||||
|
* @return 加分申请详情VO
|
||||||
|
*/
|
||||||
|
TpRewardApplyDetailVO rewardDetail(Long applyId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 加分申请单分页查询
|
||||||
|
* @param request 申请单查询Request
|
||||||
|
* @return 加分申请单VO列表
|
||||||
|
*/
|
||||||
|
PageInfo<TpRewardApplyListVO> rewardPage(TpApplyQueryRequest request);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 扣分申请提交
|
||||||
|
* @param request 奖惩申请Request
|
||||||
|
* @return 是否成功
|
||||||
|
*/
|
||||||
|
Boolean penaltyApplySubmit(TpApplyRequest request);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 惩处申请单详情
|
||||||
|
* @param applyId 申请单id
|
||||||
|
* @return 惩处申请详情VO
|
||||||
|
*/
|
||||||
|
TpPenaltyApplyDetailVO penaltyDetail(Long applyId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 惩处申请单分页查询
|
||||||
|
* @param request 申请单查询Request
|
||||||
|
* @return 惩处申请单列表VO列表
|
||||||
|
*/
|
||||||
|
PageInfo<TpPenaltyApplyListVO> penaltyPage(TpApplyQueryRequest request);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 加分申请审批
|
||||||
|
* @param request 申请单审批Request
|
||||||
|
* @return 是否成功
|
||||||
|
*/
|
||||||
|
Boolean rewardAudit(TpApplyAuditRequest request);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 惩处申请审批
|
||||||
|
* @param request 申请单审批Request
|
||||||
|
* @return 是否成功
|
||||||
|
*/
|
||||||
|
Boolean penaltyAudit(TpApplyAuditRequest request);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 复议申请提交
|
||||||
|
* @param request 复议申请Request
|
||||||
|
* @return 是否成功
|
||||||
|
*/
|
||||||
|
Boolean appealApplySubmit(TpAppealApplyRequest request);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 复议申请单详情
|
||||||
|
* @param applyId 复议申请单id
|
||||||
|
* @return 复议申请单详情VO
|
||||||
|
*/
|
||||||
|
TpAppealFormDetailVO appealDetail(Long applyId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 复议申请单分页查询
|
||||||
|
* @param request 申请单查询Request
|
||||||
|
* @return 复审列表VO列表
|
||||||
|
*/
|
||||||
|
PageInfo<TpAppealListVO> appealPage(TpApplyQueryRequest request);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 复议申请审批
|
||||||
|
* @param request 申请单审批Request
|
||||||
|
* @return 是否成功
|
||||||
|
*/
|
||||||
|
Boolean appealAudit(TpApplyAuditRequest request);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除申请单
|
||||||
|
* @param applyIds 申请单id列表
|
||||||
|
* @return 是否成功
|
||||||
|
*/
|
||||||
|
Boolean deleteBatch(List<Long> applyIds);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取审批列表
|
||||||
|
* @param applyId 申请单id
|
||||||
|
* @return 审批记录列表
|
||||||
|
*/
|
||||||
|
List<AuditInfoResponse> getAuditRecordList(Long applyId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Mini获取申请单列表
|
||||||
|
* @param request 申请单查询Request
|
||||||
|
* @return Mini申请单列表VO列表
|
||||||
|
*/
|
||||||
|
PageInfo<MiniTpApplyListVO> getMiniApplyList(TpApplyQueryRequest request);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Mini获取加分申请单详情
|
||||||
|
* @param applyId 申请单id
|
||||||
|
* @return Mini加分申请单详情VO
|
||||||
|
*/
|
||||||
|
MiniTpRewardApplyVO getMiniRewardApplyDetail(Long applyId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Mini获取惩处申请单详情
|
||||||
|
* @param applyId 申请单id
|
||||||
|
* @return Mini惩处申请单详情VO
|
||||||
|
*/
|
||||||
|
MiniTpPenaltyApplyVO getMiniPenaltyApplyDetail(Long applyId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Mini规则分页查询
|
||||||
|
* @param request 规则查询Request
|
||||||
|
* @return Mini奖惩规则列表VO列表
|
||||||
|
*/
|
||||||
|
PageInfo<MiniTpRuleListVO> getMiniRulePage(TpRuleQueryRequest request);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 认罚缴款
|
||||||
|
* @param applyId 惩处申请单id
|
||||||
|
* @return java.lang.Boolean
|
||||||
|
*/
|
||||||
|
Boolean acceptPenalty(Long applyId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 完成缴费
|
||||||
|
* @param applyId 惩处申请单id
|
||||||
|
* @return 是否成功
|
||||||
|
*/
|
||||||
|
Boolean completePayment(Long applyId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 积分变动
|
||||||
|
* @param formDO 申请单DO
|
||||||
|
*/
|
||||||
|
void scoreChange(TpApplyFormDO formDO);
|
||||||
|
}
|
||||||
@@ -0,0 +1,93 @@
|
|||||||
|
package com.cool.store.service.tp;
|
||||||
|
|
||||||
|
import com.cool.store.request.tp.TpPenaltyRuleUpdateRequest;
|
||||||
|
import com.cool.store.request.tp.TpRewardRuleUpdateRequest;
|
||||||
|
import com.cool.store.request.tp.TpRuleQueryRequest;
|
||||||
|
import com.cool.store.vo.tp.TpPenaltyRuleDetailVO;
|
||||||
|
import com.cool.store.vo.tp.TpPenaltyRuleListVO;
|
||||||
|
import com.cool.store.vo.tp.TpRewardRuleDetailVO;
|
||||||
|
import com.github.pagehelper.PageInfo;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 十二分制-奖惩规则
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author wangff
|
||||||
|
* @since 2025/11/4
|
||||||
|
*/
|
||||||
|
public interface TpRuleService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增惩处规则
|
||||||
|
* @param request 惩处规则更新Request
|
||||||
|
* @return 是否成功
|
||||||
|
*/
|
||||||
|
Boolean insertPenaltyRule(TpPenaltyRuleUpdateRequest request);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改惩处规则
|
||||||
|
* @param request 惩处规则更新Request
|
||||||
|
* @return 是否成功
|
||||||
|
*/
|
||||||
|
Boolean updatePenaltyRule(TpPenaltyRuleUpdateRequest request);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 惩处规则详情
|
||||||
|
* @param ruleId 规则id
|
||||||
|
* @return 惩处规则详情VO
|
||||||
|
*/
|
||||||
|
TpPenaltyRuleDetailVO penaltyRuleDetail(Long ruleId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 惩处规则分页查询
|
||||||
|
* @param request 规则查询Request
|
||||||
|
* @return 惩处规则列表
|
||||||
|
*/
|
||||||
|
PageInfo<TpPenaltyRuleListVO> penaltyRulePage(TpRuleQueryRequest request);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增加分规则
|
||||||
|
* @param request 加分规则更新Request
|
||||||
|
* @return 是否成功
|
||||||
|
*/
|
||||||
|
Boolean insertRewardRule(TpRewardRuleUpdateRequest request);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改加分规则
|
||||||
|
* @param request 加分规则更新Request
|
||||||
|
* @return 是否成功
|
||||||
|
*/
|
||||||
|
Boolean updateRewardRule(TpRewardRuleUpdateRequest request);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 加分规则详情
|
||||||
|
* @param ruleId 规则id
|
||||||
|
* @return 加分规则详情VO
|
||||||
|
*/
|
||||||
|
TpRewardRuleDetailVO rewardRuleDetail(Long ruleId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 加分规则分页查询
|
||||||
|
* @param request 规则查询Request
|
||||||
|
* @return 加分规则详情列表
|
||||||
|
*/
|
||||||
|
PageInfo<TpRewardRuleDetailVO> rewardRulePage(TpRuleQueryRequest request);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除
|
||||||
|
* @param ruleIds 规则id列表
|
||||||
|
* @return 是否成功
|
||||||
|
*/
|
||||||
|
Boolean deleteRuleByIds(List<Long> ruleIds);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量启用
|
||||||
|
* @param ruleIds 规则id列表
|
||||||
|
* @param enable 启用状态,0未启用 1启用
|
||||||
|
* @return 是否成功
|
||||||
|
*/
|
||||||
|
Boolean enableRuleByIds(List<Long> ruleIds, Integer enable);
|
||||||
|
}
|
||||||
@@ -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);
|
||||||
|
}
|
||||||
@@ -0,0 +1,493 @@
|
|||||||
|
package com.cool.store.service.tp.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollStreamUtil;
|
||||||
|
import com.cool.store.constants.CommonConstants;
|
||||||
|
import com.cool.store.context.CurrentUserHolder;
|
||||||
|
import com.cool.store.context.LoginUserInfo;
|
||||||
|
import com.cool.store.dao.EnterpriseUserDAO;
|
||||||
|
import com.cool.store.dao.StoreDao;
|
||||||
|
import com.cool.store.dao.tp.*;
|
||||||
|
import com.cool.store.entity.StoreDO;
|
||||||
|
import com.cool.store.entity.tp.TpApplyFormDO;
|
||||||
|
import com.cool.store.entity.tp.TpRuleDO;
|
||||||
|
import com.cool.store.entity.tp.TpScoreJournalDO;
|
||||||
|
import com.cool.store.enums.ErrorCodeEnum;
|
||||||
|
import com.cool.store.enums.tp.TpFormStatusEnum;
|
||||||
|
import com.cool.store.enums.tp.TpFormTypeEnum;
|
||||||
|
import com.cool.store.enums.tp.TpPayStatusEnum;
|
||||||
|
import com.cool.store.exception.ServiceException;
|
||||||
|
import com.cool.store.request.tp.*;
|
||||||
|
import com.cool.store.response.AuditInfoResponse;
|
||||||
|
import com.cool.store.service.dict.impl.DictService;
|
||||||
|
import com.cool.store.service.tp.TpApplyService;
|
||||||
|
import com.cool.store.utils.BeanUtil;
|
||||||
|
import com.cool.store.utils.CoolDateUtils;
|
||||||
|
import com.cool.store.utils.TpHelper;
|
||||||
|
import com.cool.store.vo.tp.*;
|
||||||
|
import com.cool.store.vo.tp.mini.*;
|
||||||
|
import com.github.pagehelper.PageHelper;
|
||||||
|
import com.github.pagehelper.PageInfo;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.math.RoundingMode;
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 十二分制-申请单 服务实现类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author wangff
|
||||||
|
* @since 2025/11/5
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@Slf4j
|
||||||
|
public class TpApplyServiceImpl implements TpApplyService {
|
||||||
|
|
||||||
|
private final TpRuleDAO tpRuleDAO;
|
||||||
|
private final TpApplyFormDAO tpApplyFormDAO;
|
||||||
|
private final StoreDao storeDao;
|
||||||
|
private final TpAuditRecordDAO tpAuditRecordDAO;
|
||||||
|
private final DictService dictService;
|
||||||
|
private final TpScoreJournalDAO tpScoreJournalDAO;
|
||||||
|
private final EnterpriseUserDAO enterpriseUserDAO;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional
|
||||||
|
public Boolean rewardApplySubmit(TpApplyRequest request) {
|
||||||
|
// 1.每个门店一个月内相同加分项仅能申请一次
|
||||||
|
// 2.门店分值=12时,所有加分项不允许申请
|
||||||
|
boolean isDraft = CommonConstants.INDEX_ONE.equals(request.getIsDraft());
|
||||||
|
if (!isDraft && tpApplyFormDAO.existPassRewardForm(request.getStoreId(), request.getRuleId())) {
|
||||||
|
throw new ServiceException(ErrorCodeEnum.TP_MONTH_EXIST_APPLY);
|
||||||
|
}
|
||||||
|
if (!isDraft && tpApplyFormDAO.existsPendingApply(request.getStoreId(), request.getRuleId(), Collections.singletonList(TpFormTypeEnum.REWARD.getType()))) {
|
||||||
|
throw new ServiceException(ErrorCodeEnum.TP_EXISTS_PENDING_APPLY);
|
||||||
|
}
|
||||||
|
BigDecimal score = storeDao.getStoreScore(request.getStoreId());
|
||||||
|
if (!isDraft && BigDecimal.valueOf(12.0).compareTo(score.setScale(1, RoundingMode.DOWN)) == 0) {
|
||||||
|
throw new ServiceException(ErrorCodeEnum.TP_SCORE_EQUAL_TWELVE);
|
||||||
|
}
|
||||||
|
TpApplyFormDO formDO = BeanUtil.toBean(request, TpApplyFormDO.class);
|
||||||
|
if (Objects.isNull(request.getId())) {
|
||||||
|
formDO.setApplyNo(TpHelper.generateApplyNo(TpFormTypeEnum.REWARD.getType()));
|
||||||
|
formDO.setType(TpFormTypeEnum.REWARD.getType());
|
||||||
|
formDO.setPayStatus(TpPayStatusEnum.NO_NEED_PAY.getStatus());
|
||||||
|
}
|
||||||
|
fillRuleFields(formDO);
|
||||||
|
tpApplyFormDAO.insertOrUpdate(formDO);
|
||||||
|
// 第一次提交后添加审批记录
|
||||||
|
if (!isDraft) {
|
||||||
|
tpAuditRecordDAO.firstAddRecord(formDO.getId(), formDO.getType(), request.getApplyUserId(), request.getApplyUserName());
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public TpRewardApplyDetailVO rewardDetail(Long applyId) {
|
||||||
|
TpApplyFormDO formDO = tpApplyFormDAO.getEffectiveById(applyId);
|
||||||
|
if (Objects.nonNull(formDO)) {
|
||||||
|
TpRewardApplyDetailVO vo = BeanUtil.toBean(formDO, TpRewardApplyDetailVO.class);
|
||||||
|
dictService.fillDictField(vo);
|
||||||
|
StoreDO storeDO = storeDao.getByStoreId(vo.getStoreId());
|
||||||
|
if (Objects.nonNull(storeDO)) {
|
||||||
|
vo.setStoreNum(storeDO.getStoreNum());
|
||||||
|
vo.setStoreName(storeDO.getStoreName());
|
||||||
|
}
|
||||||
|
return vo;
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageInfo<TpRewardApplyListVO> rewardPage(TpApplyQueryRequest request) {
|
||||||
|
PageHelper.startPage(request.getPageNum(), request.getPageSize());
|
||||||
|
List<TpApplyFormDO> list = tpApplyFormDAO.getEffectiveList(request);
|
||||||
|
PageInfo<TpApplyFormDO> page = new PageInfo<>(list);
|
||||||
|
PageInfo<TpRewardApplyListVO> newPage = BeanUtil.toPage(page, TpRewardApplyListVO.class);
|
||||||
|
fillListFields(newPage.getList());
|
||||||
|
return newPage;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional
|
||||||
|
public Boolean penaltyApplySubmit(TpApplyRequest request) {
|
||||||
|
TpApplyFormDO formDO = BeanUtil.toBean(request, TpApplyFormDO.class);
|
||||||
|
// 如果存在审批中的申请,则不允许再次提交
|
||||||
|
boolean isDraft = CommonConstants.INDEX_ONE.equals(request.getIsDraft());
|
||||||
|
if (!isDraft && tpApplyFormDAO.existsPendingApply(request.getStoreId(), request.getRuleId(), Arrays.asList(TpFormTypeEnum.PENALTY.getType(), TpFormTypeEnum.WARNING.getType()))) {
|
||||||
|
throw new ServiceException(ErrorCodeEnum.TP_EXISTS_PENDING_APPLY);
|
||||||
|
}
|
||||||
|
fillRuleFields(formDO);
|
||||||
|
formDO.setApplyNo(Objects.isNull(request.getId()) ? TpHelper.generateApplyNo(formDO.getType()) : null);
|
||||||
|
tpApplyFormDAO.insertOrUpdate(formDO);
|
||||||
|
// 第一次提交后添加审批记录
|
||||||
|
if (!isDraft) {
|
||||||
|
tpAuditRecordDAO.firstAddRecord(formDO.getId(), formDO.getType(), request.getApplyUserId(), request.getApplyUserName());
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public TpPenaltyApplyDetailVO penaltyDetail(Long applyId) {
|
||||||
|
TpApplyFormDO formDO = tpApplyFormDAO.getEffectiveById(applyId);
|
||||||
|
if (Objects.nonNull(formDO)) {
|
||||||
|
TpPenaltyApplyDetailVO vo = BeanUtil.toBean(formDO, TpPenaltyApplyDetailVO.class);
|
||||||
|
dictService.fillDictField(vo);
|
||||||
|
StoreDO storeDO = storeDao.getByStoreId(vo.getStoreId());
|
||||||
|
if (Objects.nonNull(storeDO)) {
|
||||||
|
vo.setStoreNum(storeDO.getStoreNum());
|
||||||
|
vo.setStoreName(storeDO.getStoreName());
|
||||||
|
}
|
||||||
|
return vo;
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageInfo<TpPenaltyApplyListVO> penaltyPage(TpApplyQueryRequest request) {
|
||||||
|
PageHelper.startPage(request.getPageNum(), request.getPageSize());
|
||||||
|
List<TpApplyFormDO> list = tpApplyFormDAO.getEffectiveList(request);
|
||||||
|
PageInfo<TpApplyFormDO> page = new PageInfo<>(list);
|
||||||
|
PageInfo<TpPenaltyApplyListVO> newPage = BeanUtil.toPage(page, TpPenaltyApplyListVO.class);
|
||||||
|
fillListFields(newPage.getList());
|
||||||
|
return newPage;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional
|
||||||
|
public Boolean rewardAudit(TpApplyAuditRequest request) {
|
||||||
|
TpApplyFormDO formDO = tpApplyFormDAO.getEffectiveById(request.getApplyId());
|
||||||
|
if (Objects.isNull(formDO) || !TpFormTypeEnum.REWARD.getType().equals(formDO.getType())) {
|
||||||
|
throw new ServiceException(ErrorCodeEnum.TP_NOT_EXIST_APPLY_FORM);
|
||||||
|
}
|
||||||
|
if (!TpFormStatusEnum.PENDING.getStatus().equals(formDO.getStatus())) {
|
||||||
|
throw new ServiceException(ErrorCodeEnum.TP_APPLY_AUDIT_COMPLETED);
|
||||||
|
}
|
||||||
|
if (tpApplyFormDAO.existPassRewardForm(formDO.getStoreId(), formDO.getRuleId())) {
|
||||||
|
throw new ServiceException(ErrorCodeEnum.TP_MONTH_EXIST_APPLY);
|
||||||
|
}
|
||||||
|
auditCommon(request, formDO);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional
|
||||||
|
public Boolean penaltyAudit(TpApplyAuditRequest request) {
|
||||||
|
TpApplyFormDO formDO = tpApplyFormDAO.getEffectiveById(request.getApplyId());
|
||||||
|
if (Objects.isNull(formDO) || !TpFormTypeEnum.isPenalty(formDO.getType())) {
|
||||||
|
throw new ServiceException(ErrorCodeEnum.TP_NOT_EXIST_APPLY_FORM);
|
||||||
|
}
|
||||||
|
if (!TpFormStatusEnum.PENDING.getStatus().equals(formDO.getStatus())) {
|
||||||
|
throw new ServiceException(ErrorCodeEnum.TP_APPLY_AUDIT_COMPLETED);
|
||||||
|
}
|
||||||
|
auditCommon(request, formDO);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Boolean appealApplySubmit(TpAppealApplyRequest request) {
|
||||||
|
TpApplyFormDO formDO = BeanUtil.toBean(request, TpApplyFormDO.class);
|
||||||
|
boolean isDraft = CommonConstants.INDEX_ONE.equals(request.getIsDraft());
|
||||||
|
TpApplyFormDO penaltyFormDO = tpApplyFormDAO.getEffectiveById(request.getPenaltyId());
|
||||||
|
if (Objects.isNull(penaltyFormDO)) {
|
||||||
|
throw new ServiceException(ErrorCodeEnum.TP_NOT_EXIST_APPLY_FORM);
|
||||||
|
}
|
||||||
|
if (!isDraft) {
|
||||||
|
TpApplyFormDO appealFormDO = tpApplyFormDAO.getAppealByPenaltyId(request.getPenaltyId());
|
||||||
|
// 存在待审批或已审批的复议申请单
|
||||||
|
if (Objects.nonNull(appealFormDO)) {
|
||||||
|
if (TpFormStatusEnum.PENDING.getStatus().equals(appealFormDO.getStatus())) {
|
||||||
|
throw new ServiceException(ErrorCodeEnum.TP_EXISTS_PENDING_APPLY);
|
||||||
|
}
|
||||||
|
if (TpFormStatusEnum.PASS.getStatus().equals(appealFormDO.getStatus())) {
|
||||||
|
throw new ServiceException(ErrorCodeEnum.TP_PENALTY_APPLY_APPEAL_COMPLETED);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 已生效的无法复议
|
||||||
|
if (TpFormStatusEnum.EFFECTIVE.getStatus().equals(penaltyFormDO.getStatus())) {
|
||||||
|
throw new ServiceException(ErrorCodeEnum.TP_PENALTY_APPLY_EFFECTIVE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
formDO.setApplyNo(Objects.isNull(request.getId()) ? TpHelper.generateAppealNo() : null);
|
||||||
|
formDO.setRuleId(penaltyFormDO.getRuleId());
|
||||||
|
formDO.setType(TpFormTypeEnum.APPEAL.getType());
|
||||||
|
formDO.setStoreId(penaltyFormDO.getStoreId());
|
||||||
|
fillRuleFields(formDO);
|
||||||
|
tpApplyFormDAO.insertOrUpdate(formDO);
|
||||||
|
// 第一次提交后添加审批记录
|
||||||
|
if (!isDraft) {
|
||||||
|
tpAuditRecordDAO.firstAddRecord(formDO.getId(), formDO.getType(), request.getApplyUserId(), request.getApplyUserName());
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public TpAppealFormDetailVO appealDetail(Long applyId) {
|
||||||
|
TpApplyFormDO formDO = tpApplyFormDAO.getEffectiveById(applyId);
|
||||||
|
if (Objects.nonNull(formDO)) {
|
||||||
|
TpAppealFormDetailVO vo = BeanUtil.toBean(formDO, TpAppealFormDetailVO.class);
|
||||||
|
dictService.fillDictField(vo);
|
||||||
|
StoreDO storeDO = storeDao.getByStoreId(vo.getStoreId());
|
||||||
|
if (Objects.nonNull(storeDO)) {
|
||||||
|
vo.setStoreNum(storeDO.getStoreNum());
|
||||||
|
vo.setStoreName(storeDO.getStoreName());
|
||||||
|
}
|
||||||
|
vo.setPenaltyDetail(penaltyDetail(vo.getPenaltyId()));
|
||||||
|
return vo;
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageInfo<TpAppealListVO> appealPage(TpApplyQueryRequest request) {
|
||||||
|
PageHelper.startPage(request.getPageNum(), request.getPageSize());
|
||||||
|
List<TpApplyFormDO> list = tpApplyFormDAO.getEffectiveList(request);
|
||||||
|
PageInfo<TpApplyFormDO> page = new PageInfo<>(list);
|
||||||
|
PageInfo<TpAppealListVO> newPage = BeanUtil.toPage(page, TpAppealListVO.class);
|
||||||
|
List<Long> penaltyIds = CollStreamUtil.toList(newPage.getList(), TpAppealListVO::getPenaltyId);
|
||||||
|
List<TpApplyFormDO> penaltyList = tpApplyFormDAO.getByIds(penaltyIds);
|
||||||
|
Map<Long, String> penaltyNoMap = CollStreamUtil.toMap(penaltyList, TpApplyFormDO::getId, TpApplyFormDO::getApplyNo);
|
||||||
|
newPage.getList().forEach(vo -> {
|
||||||
|
vo.setPenaltyNo(penaltyNoMap.get(vo.getPenaltyId()));
|
||||||
|
});
|
||||||
|
fillListFields(newPage.getList());
|
||||||
|
return newPage;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Boolean appealAudit(TpApplyAuditRequest request) {
|
||||||
|
TpApplyFormDO formDO = tpApplyFormDAO.getEffectiveById(request.getApplyId());
|
||||||
|
if (Objects.isNull(formDO) || !TpFormTypeEnum.APPEAL.getType().equals(formDO.getType())) {
|
||||||
|
throw new ServiceException(ErrorCodeEnum.TP_NOT_EXIST_APPLY_FORM);
|
||||||
|
}
|
||||||
|
if (!TpFormStatusEnum.PENDING.getStatus().equals(formDO.getStatus())) {
|
||||||
|
throw new ServiceException(ErrorCodeEnum.TP_APPLY_AUDIT_COMPLETED);
|
||||||
|
}
|
||||||
|
auditCommon(request, formDO);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional
|
||||||
|
public Boolean deleteBatch(List<Long> applyIds) {
|
||||||
|
tpApplyFormDAO.deleteByIds(applyIds);
|
||||||
|
// 删除审批记录
|
||||||
|
tpAuditRecordDAO.deleteByApplyIds(applyIds);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<AuditInfoResponse> getAuditRecordList(Long applyId) {
|
||||||
|
return tpAuditRecordDAO.getAuditRecordList(applyId);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageInfo<MiniTpApplyListVO> getMiniApplyList(TpApplyQueryRequest request) {
|
||||||
|
PageHelper.startPage(request.getPageNum(), request.getPageSize());
|
||||||
|
List<TpApplyFormDO> list = tpApplyFormDAO.getEffectiveList(request);
|
||||||
|
PageInfo<TpApplyFormDO> page = new PageInfo<>(list);
|
||||||
|
PageInfo<MiniTpApplyListVO> newPage = BeanUtil.toPage(page, MiniTpApplyListVO.class);
|
||||||
|
List<MiniTpApplyListVO> applyList = newPage.getList();
|
||||||
|
if (Boolean.TRUE.equals(request.getIsPenalty()) && CollectionUtils.isNotEmpty(applyList)) {
|
||||||
|
List<Long> applyIds = CollStreamUtil.toList(applyList, MiniTpApplyListVO::getId);
|
||||||
|
Set<Long> existAppealSet = tpApplyFormDAO.filterExistAppeal(applyIds);
|
||||||
|
applyList.forEach(v -> v.setIsAppeal(existAppealSet.contains(v.getId()) ? 1 : 0));
|
||||||
|
}
|
||||||
|
return newPage;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public MiniTpRewardApplyVO getMiniRewardApplyDetail(Long applyId) {
|
||||||
|
TpApplyFormDO formDO = tpApplyFormDAO.getEffectiveById(applyId);
|
||||||
|
return BeanUtil.toBean(formDO, MiniTpRewardApplyVO.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public MiniTpPenaltyApplyVO getMiniPenaltyApplyDetail(Long applyId) {
|
||||||
|
TpApplyFormDO formDO = tpApplyFormDAO.getEffectiveById(applyId);
|
||||||
|
if (Objects.nonNull(formDO)) {
|
||||||
|
MiniTpPenaltyApplyVO vo = BeanUtil.toBean(formDO, MiniTpPenaltyApplyVO.class);
|
||||||
|
TpApplyFormDO appealForm = tpApplyFormDAO.getAppealByPenaltyId(formDO.getPenaltyId());
|
||||||
|
vo.setAppeal(BeanUtil.toBean(appealForm, MiniTpAppealVO.class));
|
||||||
|
dictService.fillDictField(vo);
|
||||||
|
return vo;
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageInfo<MiniTpRuleListVO> getMiniRulePage(TpRuleQueryRequest request) {
|
||||||
|
PageHelper.startPage(request.getPageNum(), request.getPageSize());
|
||||||
|
List<TpRuleDO> list = tpRuleDAO.getEffectiveList(request);
|
||||||
|
PageInfo<TpRuleDO> page = new PageInfo<>(list);
|
||||||
|
PageInfo<MiniTpRuleListVO> newPage = BeanUtil.toPage(page, MiniTpRuleListVO.class);
|
||||||
|
dictService.fillDictField(newPage.getList());
|
||||||
|
return newPage;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional
|
||||||
|
public Boolean acceptPenalty(Long applyId) {
|
||||||
|
// 校验申请单状态是否为审批通过
|
||||||
|
TpApplyFormDO formDO = tpApplyFormDAO.getEffectiveById(applyId);
|
||||||
|
if (Objects.isNull(formDO)) {
|
||||||
|
throw new ServiceException(ErrorCodeEnum.TP_NOT_EXIST_APPLY_FORM);
|
||||||
|
}
|
||||||
|
if (!TpFormStatusEnum.PASS.getStatus().equals(formDO.getStatus())) {
|
||||||
|
log.info("非审批通过状态无法认缴");
|
||||||
|
throw new ServiceException(ErrorCodeEnum.TP_PENALTY_APPLY_UNABLE_ACCEPT);
|
||||||
|
}
|
||||||
|
tpApplyFormDAO.updateStatus(applyId, TpFormStatusEnum.EFFECTIVE);
|
||||||
|
scoreChange(formDO);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Boolean completePayment(Long applyId) {
|
||||||
|
TpApplyFormDO formDO = tpApplyFormDAO.getEffectiveById(applyId);
|
||||||
|
if (Objects.isNull(formDO)) {
|
||||||
|
throw new ServiceException(ErrorCodeEnum.TP_NOT_EXIST_APPLY_FORM);
|
||||||
|
}
|
||||||
|
if (!TpFormStatusEnum.EFFECTIVE.getStatus().equals(formDO.getStatus())) {
|
||||||
|
throw new ServiceException(ErrorCodeEnum.TP_PENALTY_APPLY_INEFFECTIVE);
|
||||||
|
}
|
||||||
|
if (TpPayStatusEnum.NO_NEED_PAY.getStatus().equals(formDO.getPayStatus())) {
|
||||||
|
throw new ServiceException(ErrorCodeEnum.TP_PENALTY_APPLY_NO_NEED_PAY);
|
||||||
|
}
|
||||||
|
tpApplyFormDAO.updatePayStatus(applyId, TpPayStatusEnum.PAID);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 审批通用方法
|
||||||
|
*/
|
||||||
|
private void auditCommon(TpApplyAuditRequest request, TpApplyFormDO formDO) {
|
||||||
|
Date now = new Date();
|
||||||
|
// 修改申请单审批数据
|
||||||
|
formDO.setStatus(CommonConstants.INDEX_ONE.equals(request.getAuditStatus()) ? TpFormStatusEnum.PASS.getStatus() : TpFormStatusEnum.REJECT.getStatus());
|
||||||
|
formDO.setApproveTime(now);
|
||||||
|
tpApplyFormDAO.updateSelective(formDO);
|
||||||
|
LoginUserInfo user = CurrentUserHolder.getUser();
|
||||||
|
// 处理审批记录
|
||||||
|
tpAuditRecordDAO.auditPendingRecordByApplyId(request.getApplyId(), formDO.getType(), user.getUserId(), user.getName(), request.getAuditStatus(), request.getRemark(), now);
|
||||||
|
if (TpFormTypeEnum.APPEAL.getType().equals(formDO.getType())) {
|
||||||
|
appealPassResolve(formDO);
|
||||||
|
} else if (TpFormTypeEnum.REWARD.getType().equals(formDO.getType())) {
|
||||||
|
// 加分审批通过后门店积分变动
|
||||||
|
scoreChange(formDO);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 复议申请通过时处罚单作废
|
||||||
|
*/
|
||||||
|
private void appealPassResolve(TpApplyFormDO formDO) {
|
||||||
|
if (TpFormStatusEnum.PASS.getStatus().equals(formDO.getStatus())) {
|
||||||
|
// 申诉通过后,处罚单失效
|
||||||
|
tpApplyFormDAO.updateStatus(formDO.getPenaltyId(), TpFormStatusEnum.CANCEL);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 门店积分变动
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void scoreChange(TpApplyFormDO formDO) {
|
||||||
|
if (TpFormStatusEnum.PASS.getStatus().equals(formDO.getStatus())) {
|
||||||
|
BigDecimal occurBeforeScore = storeDao.getStoreScore(formDO.getStoreId());
|
||||||
|
BigDecimal occurAfterScore = null;
|
||||||
|
String occurScore = "";
|
||||||
|
if (TpFormTypeEnum.REWARD.getType().equals(formDO.getType())) {
|
||||||
|
// 加分
|
||||||
|
if (CommonConstants.INDEX_ONE.equals(formDO.getIsFull())) {
|
||||||
|
occurAfterScore = BigDecimal.valueOf(12.0);
|
||||||
|
occurScore = "加满";
|
||||||
|
} else {
|
||||||
|
occurAfterScore = occurBeforeScore.add(formDO.getScore());
|
||||||
|
occurScore = "+" + formDO.getScore().toString();
|
||||||
|
}
|
||||||
|
} else if (TpFormTypeEnum.PENALTY.getType().equals(formDO.getType())) {
|
||||||
|
occurAfterScore = occurBeforeScore.subtract(formDO.getScore());
|
||||||
|
occurScore = "-" + formDO.getScore().toString();
|
||||||
|
}
|
||||||
|
// 修改门店积分
|
||||||
|
if (Objects.nonNull(occurAfterScore)) {
|
||||||
|
storeDao.updateStoreScore(formDO.getStoreId(), occurAfterScore);
|
||||||
|
StoreDO storeDO = storeDao.getEffectiveByStoreId(formDO.getStoreId());
|
||||||
|
if (Objects.isNull(storeDO)) {
|
||||||
|
throw new ServiceException(ErrorCodeEnum.STORE_NOT_FIND);
|
||||||
|
}
|
||||||
|
// 添加积分流水
|
||||||
|
tpScoreJournalDAO.insertSelective(new TpScoreJournalDO(storeDO, formDO, occurScore, occurBeforeScore, occurAfterScore));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 填充规则相关字段
|
||||||
|
*/
|
||||||
|
private void fillRuleFields(TpApplyFormDO formDO) {
|
||||||
|
TpRuleDO ruleDO = tpRuleDAO.getById(formDO.getRuleId());
|
||||||
|
if (Objects.isNull(ruleDO)) {
|
||||||
|
throw new ServiceException(ErrorCodeEnum.TP_NOT_EXIST_RULE);
|
||||||
|
}
|
||||||
|
formDO.setRuleNo(ruleDO.getRuleNo());
|
||||||
|
formDO.setProblemClassification(ruleDO.getProblemClassification());
|
||||||
|
formDO.setProjectCategory(ruleDO.getProjectCategory());
|
||||||
|
formDO.setProjectName(ruleDO.getProjectName());
|
||||||
|
formDO.setIsFull(ruleDO.getIsFull());
|
||||||
|
if (Objects.isNull(formDO.getScore())) {
|
||||||
|
formDO.setScore(ruleDO.getScore());
|
||||||
|
}
|
||||||
|
if (Objects.isNull(formDO.getAmount())) {
|
||||||
|
formDO.setAmount(ruleDO.getAmount());
|
||||||
|
}
|
||||||
|
// 扣分
|
||||||
|
if (CommonConstants.INDEX_ZERO.equals(ruleDO.getType())) {
|
||||||
|
if (Objects.isNull(formDO.getAppealEndDate())) {
|
||||||
|
formDO.setAppealEndDate(CoolDateUtils.localDate2Date(LocalDate.now().plusDays(ruleDO.getAppealDeadline())));
|
||||||
|
}
|
||||||
|
if (Objects.isNull(formDO.getType())) {
|
||||||
|
// 超过警告次数的为处罚单,否则警告单
|
||||||
|
int penaltyCount = tpApplyFormDAO.getPenaltyCount(formDO.getStoreId(), formDO.getRuleId());
|
||||||
|
Integer type = ruleDO.getWarningLimit().compareTo(penaltyCount) <= 0 ? TpFormTypeEnum.PENALTY.getType() : TpFormTypeEnum.WARNING.getType();
|
||||||
|
formDO.setType(type);
|
||||||
|
if (TpFormTypeEnum.WARNING.getType().equals(type)) {
|
||||||
|
formDO.setAmount(null);
|
||||||
|
formDO.setScore(null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 是否缴费
|
||||||
|
formDO.setPayStatus(Objects.nonNull(ruleDO.getAmount()) && BigDecimal.ZERO.compareTo(ruleDO.getAmount()) < 0 ? TpPayStatusEnum.UNPAID.getStatus() : TpPayStatusEnum.NO_NEED_PAY.getStatus());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 填充列表相关字段
|
||||||
|
*/
|
||||||
|
private void fillListFields(List<? extends TpApplyListBaseVO> list) {
|
||||||
|
if (CollectionUtils.isEmpty(list)) return;
|
||||||
|
dictService.fillDictField(list);
|
||||||
|
Set<String> storeIds = CollStreamUtil.toSet(list, TpApplyListBaseVO::getStoreId);
|
||||||
|
Set<String> approveUserIds = CollStreamUtil.toSet(list, TpApplyListBaseVO::getApproveUserId);
|
||||||
|
Map<String, StoreDO> storeMap = storeDao.getStoreMapByStoreIds(new ArrayList<>(storeIds));
|
||||||
|
Map<String, String> userNameMap = enterpriseUserDAO.getUserNameMap(new ArrayList<>(approveUserIds));
|
||||||
|
for (TpApplyListBaseVO vo : list) {
|
||||||
|
StoreDO storeDO = storeMap.get(vo.getStoreId());
|
||||||
|
if (Objects.nonNull(storeDO)) {
|
||||||
|
vo.setStoreName(storeDO.getStoreName());
|
||||||
|
vo.setStoreNum(storeDO.getStoreNum());
|
||||||
|
}
|
||||||
|
vo.setApproveUserName(userNameMap.get(vo.getApproveUserId()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,116 @@
|
|||||||
|
package com.cool.store.service.tp.impl;
|
||||||
|
|
||||||
|
import com.cool.store.dao.tp.TpRuleDAO;
|
||||||
|
import com.cool.store.entity.tp.TpRuleDO;
|
||||||
|
import com.cool.store.request.tp.TpPenaltyRuleUpdateRequest;
|
||||||
|
import com.cool.store.request.tp.TpRewardRuleUpdateRequest;
|
||||||
|
import com.cool.store.request.tp.TpRuleQueryRequest;
|
||||||
|
import com.cool.store.service.dict.impl.DictService;
|
||||||
|
import com.cool.store.service.tp.TpRuleService;
|
||||||
|
import com.cool.store.utils.BeanUtil;
|
||||||
|
import com.cool.store.utils.TpHelper;
|
||||||
|
import com.cool.store.vo.tp.TpPenaltyRuleDetailVO;
|
||||||
|
import com.cool.store.vo.tp.TpPenaltyRuleListVO;
|
||||||
|
import com.cool.store.vo.tp.TpRewardRuleDetailVO;
|
||||||
|
import com.github.pagehelper.PageHelper;
|
||||||
|
import com.github.pagehelper.PageInfo;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 十二分制-奖惩规则 服务实现类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author wangff
|
||||||
|
* @since 2025/11/4
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class TpRuleServiceImpl implements TpRuleService {
|
||||||
|
private final TpRuleDAO tpRuleDAO;
|
||||||
|
private final DictService dictService;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Boolean insertPenaltyRule(TpPenaltyRuleUpdateRequest request) {
|
||||||
|
TpRuleDO tpRuleDO = BeanUtil.toBean(request, TpRuleDO.class);
|
||||||
|
tpRuleDO.setRuleNo(TpHelper.generateRuleNo(false));
|
||||||
|
tpRuleDO.setType(0);
|
||||||
|
return tpRuleDAO.insertSelective(tpRuleDO);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Boolean updatePenaltyRule(TpPenaltyRuleUpdateRequest request) {
|
||||||
|
TpRuleDO tpRuleDO = BeanUtil.toBean(request, TpRuleDO.class);
|
||||||
|
return tpRuleDAO.updateSelective(tpRuleDO);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public TpPenaltyRuleDetailVO penaltyRuleDetail(Long ruleId) {
|
||||||
|
TpRuleDO tpRuleDO = tpRuleDAO.getById(ruleId);
|
||||||
|
if (Objects.nonNull(tpRuleDO)) {
|
||||||
|
TpPenaltyRuleDetailVO vo = BeanUtil.toBean(tpRuleDO, TpPenaltyRuleDetailVO.class);
|
||||||
|
dictService.fillDictField(vo);
|
||||||
|
return vo;
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageInfo<TpPenaltyRuleListVO> penaltyRulePage(TpRuleQueryRequest request) {
|
||||||
|
PageHelper.startPage(request.getPageNum(), request.getPageSize());
|
||||||
|
List<TpRuleDO> list = tpRuleDAO.getEffectiveList(request);
|
||||||
|
PageInfo<TpRuleDO> page = new PageInfo<>(list);
|
||||||
|
PageInfo<TpPenaltyRuleListVO> newPage = BeanUtil.toPage(page, TpPenaltyRuleListVO.class);
|
||||||
|
dictService.fillDictField(newPage.getList());
|
||||||
|
return newPage;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Boolean insertRewardRule(TpRewardRuleUpdateRequest request) {
|
||||||
|
TpRuleDO tpRuleDO = BeanUtil.toBean(request, TpRuleDO.class);
|
||||||
|
tpRuleDO.setRuleNo(TpHelper.generateRuleNo(true));
|
||||||
|
tpRuleDO.setType(1);
|
||||||
|
return tpRuleDAO.insertSelective(tpRuleDO);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Boolean updateRewardRule(TpRewardRuleUpdateRequest request) {
|
||||||
|
TpRuleDO tpRuleDO = BeanUtil.toBean(request, TpRuleDO.class);
|
||||||
|
return tpRuleDAO.updateSelective(tpRuleDO);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public TpRewardRuleDetailVO rewardRuleDetail(Long ruleId) {
|
||||||
|
TpRuleDO tpRuleDO = tpRuleDAO.getById(ruleId);
|
||||||
|
if (Objects.nonNull(tpRuleDO)) {
|
||||||
|
TpRewardRuleDetailVO vo = BeanUtil.toBean(tpRuleDO, TpRewardRuleDetailVO.class);
|
||||||
|
dictService.fillDictField(vo);
|
||||||
|
return vo;
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageInfo<TpRewardRuleDetailVO> rewardRulePage(TpRuleQueryRequest request) {
|
||||||
|
PageHelper.startPage(request.getPageNum(), request.getPageSize());
|
||||||
|
List<TpRuleDO> list = tpRuleDAO.getEffectiveList(request);
|
||||||
|
PageInfo<TpRuleDO> page = new PageInfo<>(list);
|
||||||
|
PageInfo<TpRewardRuleDetailVO> newPage = BeanUtil.toPage(page, TpRewardRuleDetailVO.class);
|
||||||
|
dictService.fillDictField(newPage.getList());
|
||||||
|
return newPage;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Boolean deleteRuleByIds(List<Long> ruleIds) {
|
||||||
|
return tpRuleDAO.deleteByIds(ruleIds);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Boolean enableRuleByIds(List<Long> ruleIds, Integer enable) {
|
||||||
|
return tpRuleDAO.updateStatus(ruleIds, enable);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -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,88 @@
|
|||||||
|
package com.cool.store.controller.webb;
|
||||||
|
|
||||||
|
import com.cool.store.request.dict.DictColumnQueryRequest;
|
||||||
|
import com.cool.store.request.dict.DictGroupQueryRequest;
|
||||||
|
import com.cool.store.request.dict.DictTableQueryRequest;
|
||||||
|
import com.cool.store.response.ResponseResult;
|
||||||
|
import com.cool.store.service.dict.DictColumnService;
|
||||||
|
import com.cool.store.service.dict.DictGroupService;
|
||||||
|
import com.cool.store.service.dict.DictTableInfoService;
|
||||||
|
import com.cool.store.vo.dict.DictColumnSimpleVO;
|
||||||
|
import com.cool.store.vo.dict.DictColumnVO;
|
||||||
|
import com.cool.store.vo.dict.DictGroupVO;
|
||||||
|
import com.cool.store.vo.dict.DictTableVO;
|
||||||
|
import com.github.pagehelper.PageInfo;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 字典管理 前端控制器
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author wangff
|
||||||
|
* @since 2025/2/20
|
||||||
|
*/
|
||||||
|
@Api(tags = "字典管理")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("pc/sys/dict")
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class DictManagerController {
|
||||||
|
private final DictGroupService groupService;
|
||||||
|
private final DictTableInfoService tableService;
|
||||||
|
private final DictColumnService columnService;
|
||||||
|
|
||||||
|
@ApiOperation("字典分组-查询")
|
||||||
|
@GetMapping("/group/{groupId}")
|
||||||
|
public ResponseResult<DictGroupVO> groupGet(@PathVariable("groupId") Long groupId) {
|
||||||
|
return ResponseResult.success(groupService.getById(groupId));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("字典分组-列表")
|
||||||
|
@GetMapping("/group/list")
|
||||||
|
public ResponseResult<List<DictGroupVO>> groupList(DictGroupQueryRequest dto) {
|
||||||
|
return ResponseResult.success(groupService.getList(dto));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("字典表-查询")
|
||||||
|
@GetMapping("/table/{tableId}")
|
||||||
|
public ResponseResult<DictTableVO> tableGet(@PathVariable("tableId") Long tableId) {
|
||||||
|
return ResponseResult.success(tableService.getById(tableId));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("字典表-列表")
|
||||||
|
@GetMapping("/table/list")
|
||||||
|
public ResponseResult<List<DictTableVO>> tableList(DictTableQueryRequest dto) {
|
||||||
|
return ResponseResult.success(tableService.getList(dto));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("字典项-分页查询")
|
||||||
|
@GetMapping("/column/page")
|
||||||
|
public ResponseResult<PageInfo<DictColumnVO>> columnPage(DictColumnQueryRequest dto) {
|
||||||
|
return ResponseResult.success(columnService.getPage(dto));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("字典项-查询")
|
||||||
|
@GetMapping("/column/{columnId}")
|
||||||
|
public ResponseResult<DictColumnVO> columnGet(@PathVariable("columnId") Long columnId) {
|
||||||
|
return ResponseResult.success(columnService.getById(columnId));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("字典项-根据字典项code查询已启用的字典项")
|
||||||
|
@GetMapping("/column/getByColumnCode")
|
||||||
|
public ResponseResult<DictColumnSimpleVO> getColumnByColumnCode(@NotBlank(message = "字典项编码不能为空") String columnCode) {
|
||||||
|
return ResponseResult.success(columnService.getColumnByColumnCode(columnCode));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("字典项-根据字典表code查询已启用的字典项列表")
|
||||||
|
@PostMapping("/column/getMapByTableCodes")
|
||||||
|
public ResponseResult<Map<String, List<DictColumnSimpleVO>>> getColumnByTableCode(@RequestBody List<String> tableCodes) {
|
||||||
|
return ResponseResult.success(columnService.getMapListByTableCode(tableCodes));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,149 @@
|
|||||||
|
package com.cool.store.controller.webb;
|
||||||
|
|
||||||
|
import com.cool.store.context.CurrentUserHolder;
|
||||||
|
import com.cool.store.context.LoginUserInfo;
|
||||||
|
import com.cool.store.enums.tp.TpFormTypeEnum;
|
||||||
|
import com.cool.store.request.tp.TpAppealApplyRequest;
|
||||||
|
import com.cool.store.request.tp.TpApplyAuditRequest;
|
||||||
|
import com.cool.store.request.tp.TpApplyQueryRequest;
|
||||||
|
import com.cool.store.request.tp.TpApplyRequest;
|
||||||
|
import com.cool.store.response.AuditInfoResponse;
|
||||||
|
import com.cool.store.response.ResponseResult;
|
||||||
|
import com.cool.store.service.tp.TpApplyService;
|
||||||
|
import com.cool.store.vo.tp.*;
|
||||||
|
import com.github.pagehelper.PageInfo;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiImplicitParam;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 十二分制-申请单 前端控制器
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author wangff
|
||||||
|
* @since 2025/11/6
|
||||||
|
*/
|
||||||
|
@Api(tags = "十二分制-申请单")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/pc/tp/apply")
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class TpApplyController {
|
||||||
|
private final TpApplyService tpApplyService;
|
||||||
|
|
||||||
|
@ApiOperation("加分申请提交or保存")
|
||||||
|
@PostMapping("/rewardApplySubmit")
|
||||||
|
public ResponseResult<Boolean> rewardApplySubmit(@RequestBody @Validated TpApplyRequest request) {
|
||||||
|
LoginUserInfo user = CurrentUserHolder.getUser();
|
||||||
|
request.setSource(0);
|
||||||
|
request.setApplyUserId(user.getUserId());
|
||||||
|
request.setApplyUserName(user.getName());
|
||||||
|
return ResponseResult.success(tpApplyService.rewardApplySubmit(request));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("加分申请单详情")
|
||||||
|
@GetMapping("/rewardDetail")
|
||||||
|
@ApiImplicitParam(name = "applyId", value = "加分申请单id", required = true, dataType = "Long", paramType = "query")
|
||||||
|
public ResponseResult<TpRewardApplyDetailVO> rewardDetail(@NotNull(message = "加分申请单id不能为空") Long applyId) {
|
||||||
|
return ResponseResult.success(tpApplyService.rewardDetail(applyId));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("加分申请单分页查询")
|
||||||
|
@PostMapping("/rewardPage")
|
||||||
|
public ResponseResult<PageInfo<TpRewardApplyListVO> > rewardPage(@RequestBody TpApplyQueryRequest request) {
|
||||||
|
request.setType(TpFormTypeEnum.REWARD.getType());
|
||||||
|
return ResponseResult.success(tpApplyService.rewardPage(request));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("加分申请审批")
|
||||||
|
@PostMapping("/rewardAudit")
|
||||||
|
public ResponseResult<Boolean> rewardAudit(@RequestBody @Validated TpApplyAuditRequest request) {
|
||||||
|
return ResponseResult.success(tpApplyService.rewardAudit(request));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("惩处申请提交or保存")
|
||||||
|
@PostMapping("/penaltyApplySubmit")
|
||||||
|
public ResponseResult<Boolean> penaltyApplySubmit(@RequestBody @Validated TpApplyRequest request) {
|
||||||
|
LoginUserInfo user = CurrentUserHolder.getUser();
|
||||||
|
request.setSource(0);
|
||||||
|
request.setApplyUserId(user.getUserId());
|
||||||
|
request.setApplyUserName(user.getName());
|
||||||
|
return ResponseResult.success(tpApplyService.penaltyApplySubmit(request));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("惩处申请单详情")
|
||||||
|
@GetMapping("/penaltyDetail")
|
||||||
|
@ApiImplicitParam(name = "applyId", value = "惩处申请单id", required = true, dataType = "Long", paramType = "query")
|
||||||
|
public ResponseResult<TpPenaltyApplyDetailVO> penaltyDetail(@NotNull(message = "惩处申请单id不能为空") Long applyId) {
|
||||||
|
return ResponseResult.success(tpApplyService.penaltyDetail(applyId));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("惩处申请单分页查询")
|
||||||
|
@PostMapping("/penaltyPage")
|
||||||
|
public ResponseResult<PageInfo<TpPenaltyApplyListVO> > penaltyPage(@RequestBody TpApplyQueryRequest request) {
|
||||||
|
request.setIsPenalty(true);
|
||||||
|
return ResponseResult.success(tpApplyService.penaltyPage(request));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("惩处申请审批")
|
||||||
|
@PostMapping("/penaltyAudit")
|
||||||
|
public ResponseResult<Boolean> penaltyAudit(@RequestBody @Validated TpApplyAuditRequest request) {
|
||||||
|
return ResponseResult.success(tpApplyService.penaltyAudit(request));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("复议申请提交or保存")
|
||||||
|
@PostMapping("/appealApplySubmit")
|
||||||
|
public ResponseResult<Boolean> appealApplySubmit(@RequestBody @Validated TpAppealApplyRequest request) {
|
||||||
|
LoginUserInfo user = CurrentUserHolder.getUser();
|
||||||
|
request.setSource(0);
|
||||||
|
request.setApplyUserId(user.getUserId());
|
||||||
|
request.setApplyUserName(user.getName());
|
||||||
|
return ResponseResult.success(tpApplyService.appealApplySubmit(request));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("复议申请单详情")
|
||||||
|
@GetMapping("/appealDetail")
|
||||||
|
@ApiImplicitParam(name = "applyId", value = "复议申请单id", required = true, dataType = "Long", paramType = "query")
|
||||||
|
public ResponseResult<TpAppealFormDetailVO> appealDetail(@NotNull(message = "复议申请单id不能为空") Long applyId) {
|
||||||
|
return ResponseResult.success(tpApplyService.appealDetail(applyId));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("复议申请单分页查询")
|
||||||
|
@PostMapping("/appealPage")
|
||||||
|
public ResponseResult<PageInfo<TpAppealListVO> > appealPage(@RequestBody TpApplyQueryRequest request) {
|
||||||
|
request.setType(TpFormTypeEnum.APPEAL.getType());
|
||||||
|
return ResponseResult.success(tpApplyService.appealPage(request));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("复议申请审批")
|
||||||
|
@PostMapping("/appealAudit")
|
||||||
|
public ResponseResult<Boolean> appealAudit(@RequestBody @Validated TpApplyAuditRequest request) {
|
||||||
|
return ResponseResult.success(tpApplyService.appealAudit(request));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("根据申请单id批量删除")
|
||||||
|
@PostMapping("/deleteBatch")
|
||||||
|
public ResponseResult<Boolean> deleteBatch(@RequestBody List<Long> applyIds) {
|
||||||
|
return ResponseResult.success(tpApplyService.deleteBatch(applyIds));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("审批记录列表")
|
||||||
|
@GetMapping("/auditRecords")
|
||||||
|
@ApiImplicitParam(name = "applyId", value = "申请单id", required = true, dataType = "Long", paramType = "query")
|
||||||
|
public ResponseResult<List<AuditInfoResponse>> auditRecords(@NotNull(message = "申请单id不能为空") Long applyId) {
|
||||||
|
return ResponseResult.success(tpApplyService.getAuditRecordList(applyId));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("完成缴费")
|
||||||
|
@PostMapping("/completePayment")
|
||||||
|
@ApiImplicitParam(name = "applyId", value = "申请单id", required = true, dataType = "Long", paramType = "query")
|
||||||
|
public ResponseResult<Boolean> completePayment(@NotNull(message = "申请单id不能为空") Long applyId) {
|
||||||
|
return ResponseResult.success(tpApplyService.completePayment(applyId));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,108 @@
|
|||||||
|
package com.cool.store.controller.webb;
|
||||||
|
|
||||||
|
import com.cool.store.common.InsertGroup;
|
||||||
|
import com.cool.store.common.UpdateGroup;
|
||||||
|
import com.cool.store.request.tp.TpPenaltyRuleUpdateRequest;
|
||||||
|
import com.cool.store.request.tp.TpRewardRuleUpdateRequest;
|
||||||
|
import com.cool.store.request.tp.TpRuleQueryRequest;
|
||||||
|
import com.cool.store.response.ResponseResult;
|
||||||
|
import com.cool.store.service.tp.TpRuleService;
|
||||||
|
import com.cool.store.vo.tp.TpPenaltyRuleDetailVO;
|
||||||
|
import com.cool.store.vo.tp.TpPenaltyRuleListVO;
|
||||||
|
import com.cool.store.vo.tp.TpRewardRuleDetailVO;
|
||||||
|
import com.github.pagehelper.PageInfo;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiImplicitParam;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 十二分制-奖惩规则 前端控制器
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author wangff
|
||||||
|
* @since 2025/11/4
|
||||||
|
*/
|
||||||
|
@Api(tags = "十二分制-奖惩规则")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/pc/tp/rule")
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class TpRuleController {
|
||||||
|
private final TpRuleService tpRuleService;
|
||||||
|
|
||||||
|
@ApiOperation("新增惩处规则")
|
||||||
|
@PostMapping("/insertPenalty")
|
||||||
|
public ResponseResult<Boolean> insertPenaltyRule(@RequestBody @Validated(InsertGroup.class) TpPenaltyRuleUpdateRequest request) {
|
||||||
|
return ResponseResult.success(tpRuleService.insertPenaltyRule(request));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("修改惩处规则")
|
||||||
|
@PostMapping("/updatePenalty")
|
||||||
|
public ResponseResult<Boolean> updatePenaltyRule(@RequestBody @Validated(UpdateGroup.class) TpPenaltyRuleUpdateRequest request) {
|
||||||
|
return ResponseResult.success(tpRuleService.updatePenaltyRule(request));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("惩处规则详情")
|
||||||
|
@GetMapping("/penaltyDetail")
|
||||||
|
@ApiImplicitParam(name = "ruleId", value = "规则id", required = true, dataType = "Long", paramType = "query")
|
||||||
|
public ResponseResult<TpPenaltyRuleDetailVO> penaltyRuleDetail(@NotNull(message = "规则id不能为空") Long ruleId) {
|
||||||
|
return ResponseResult.success(tpRuleService.penaltyRuleDetail(ruleId));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("惩处规则分页查询")
|
||||||
|
@PostMapping("/penaltyPage")
|
||||||
|
public ResponseResult<PageInfo<TpPenaltyRuleListVO>> penaltyRulePage(@RequestBody TpRuleQueryRequest request) {
|
||||||
|
request.setType(0);
|
||||||
|
return ResponseResult.success(tpRuleService.penaltyRulePage(request));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("新增加分规则")
|
||||||
|
@PostMapping("/insertReward")
|
||||||
|
public ResponseResult<Boolean> insertRewardRule(@RequestBody @Validated(InsertGroup.class) TpRewardRuleUpdateRequest request) {
|
||||||
|
return ResponseResult.success(tpRuleService.insertRewardRule(request));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("修改加分规则")
|
||||||
|
@PostMapping("/updateReward")
|
||||||
|
public ResponseResult<Boolean> updateRewardRule(@RequestBody @Validated(UpdateGroup.class) TpRewardRuleUpdateRequest request) {
|
||||||
|
return ResponseResult.success(tpRuleService.updateRewardRule(request));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("加分规则详情")
|
||||||
|
@GetMapping("/rewardDetail")
|
||||||
|
@ApiImplicitParam(name = "ruleId", value = "规则id", required = true, dataType = "Long", paramType = "query")
|
||||||
|
public ResponseResult<TpRewardRuleDetailVO> rewardRuleDetail(@NotNull(message = "规则id不能为空") Long ruleId) {
|
||||||
|
return ResponseResult.success(tpRuleService.rewardRuleDetail(ruleId));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("加分规则分页查询")
|
||||||
|
@PostMapping("/rewardPage")
|
||||||
|
public ResponseResult<PageInfo<TpRewardRuleDetailVO>> rewardRulePage(@RequestBody TpRuleQueryRequest request) {
|
||||||
|
request.setType(1);
|
||||||
|
return ResponseResult.success(tpRuleService.rewardRulePage(request));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("批量删除规则")
|
||||||
|
@PostMapping("/delete")
|
||||||
|
public ResponseResult<Boolean> deleteRuleByIds(@RequestBody List<Long> ruleIds) {
|
||||||
|
return ResponseResult.success(tpRuleService.deleteRuleByIds(ruleIds));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("启用规则")
|
||||||
|
@PostMapping("/enable")
|
||||||
|
public ResponseResult<Boolean> enableRuleByIds(@RequestBody List<Long> ruleIds) {
|
||||||
|
return ResponseResult.success(tpRuleService.enableRuleByIds(ruleIds, 1));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("禁用规则")
|
||||||
|
@PostMapping("/disable")
|
||||||
|
public ResponseResult<Boolean> disableRuleByIds(@RequestBody List<Long> ruleIds) {
|
||||||
|
return ResponseResult.success(tpRuleService.enableRuleByIds(ruleIds, 0));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
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.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 十二分制-积分流水 前端控制器
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author wangff
|
||||||
|
* @since 2025/11/10
|
||||||
|
*/
|
||||||
|
@Api(tags = "十二分制-积分流水")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/pc/tp/journal")
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class TpScoreJournalController {
|
||||||
|
private final TpScoreJournalService tpScoreJournalService;
|
||||||
|
|
||||||
|
@ApiOperation("积分流水分页查询")
|
||||||
|
@PostMapping("/page")
|
||||||
|
public ResponseResult<PageInfo<TpScoreJournalVO>> getPage(@RequestBody TpScoreJournalQueryRequest request) {
|
||||||
|
return ResponseResult.success(tpScoreJournalService.getPage(request));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,115 @@
|
|||||||
|
package com.cool.store.controller.webc;
|
||||||
|
|
||||||
|
import com.cool.store.context.PartnerUserHolder;
|
||||||
|
import com.cool.store.enums.tp.TpFormTypeEnum;
|
||||||
|
import com.cool.store.request.tp.TpAppealApplyRequest;
|
||||||
|
import com.cool.store.request.tp.TpApplyQueryRequest;
|
||||||
|
import com.cool.store.request.tp.TpApplyRequest;
|
||||||
|
import com.cool.store.request.tp.TpRuleQueryRequest;
|
||||||
|
import com.cool.store.response.AuditInfoResponse;
|
||||||
|
import com.cool.store.response.ResponseResult;
|
||||||
|
import com.cool.store.service.tp.TpApplyService;
|
||||||
|
import com.cool.store.vo.PartnerUserInfoVO;
|
||||||
|
import com.cool.store.vo.tp.mini.MiniTpApplyListVO;
|
||||||
|
import com.cool.store.vo.tp.mini.MiniTpPenaltyApplyVO;
|
||||||
|
import com.cool.store.vo.tp.mini.MiniTpRewardApplyVO;
|
||||||
|
import com.cool.store.vo.tp.mini.MiniTpRuleListVO;
|
||||||
|
import com.github.pagehelper.PageInfo;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiImplicitParam;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 十二分制-申请单 前端控制器
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author wangff
|
||||||
|
* @since 2025/11/10
|
||||||
|
*/
|
||||||
|
@Api(tags = "Mini十二分制-申请单")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/mini/tp/apply")
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class MiniTpApplyController {
|
||||||
|
private final TpApplyService tpApplyService;
|
||||||
|
|
||||||
|
@ApiOperation("加分申请提交or保存")
|
||||||
|
@PostMapping("/rewardApplySubmit")
|
||||||
|
public ResponseResult<Boolean> rewardApplySubmit(@RequestBody @Validated TpApplyRequest request) {
|
||||||
|
PartnerUserInfoVO user = PartnerUserHolder.getUser();
|
||||||
|
request.setSource(1);
|
||||||
|
request.setApplyUserId(user.getPartnerId());
|
||||||
|
request.setApplyUserName(user.getUsername());
|
||||||
|
return ResponseResult.success(tpApplyService.rewardApplySubmit(request));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("加分申请单详情")
|
||||||
|
@GetMapping("/rewardDetail")
|
||||||
|
@ApiImplicitParam(name = "applyId", value = "加分申请单id", required = true, dataType = "Long", paramType = "query")
|
||||||
|
public ResponseResult<MiniTpRewardApplyVO> rewardDetail(@NotNull(message = "加分申请单id不能为空") Long applyId) {
|
||||||
|
return ResponseResult.success(tpApplyService.getMiniRewardApplyDetail(applyId));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("加分申请单分页查询")
|
||||||
|
@PostMapping("/rewardPage")
|
||||||
|
public ResponseResult<PageInfo<MiniTpApplyListVO>> rewardPage(@RequestBody TpApplyQueryRequest request) {
|
||||||
|
request.setType(TpFormTypeEnum.REWARD.getType());
|
||||||
|
return ResponseResult.success(tpApplyService.getMiniApplyList(request));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("惩处申请单详情")
|
||||||
|
@GetMapping("/penaltyDetail")
|
||||||
|
@ApiImplicitParam(name = "applyId", value = "惩处申请单id", required = true, dataType = "Long", paramType = "query")
|
||||||
|
public ResponseResult<MiniTpPenaltyApplyVO> penaltyDetail(@NotNull(message = "惩处申请单id不能为空") Long applyId) {
|
||||||
|
return ResponseResult.success(tpApplyService.getMiniPenaltyApplyDetail(applyId));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("惩处申请单分页查询")
|
||||||
|
@PostMapping("/penaltyPage")
|
||||||
|
public ResponseResult<PageInfo<MiniTpApplyListVO>> penaltyPage(@RequestBody TpApplyQueryRequest request) {
|
||||||
|
request.setIsPenalty(true);
|
||||||
|
request.setIsDraft(0);
|
||||||
|
return ResponseResult.success(tpApplyService.getMiniApplyList(request));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("复议申请提交or保存")
|
||||||
|
@PostMapping("/appealApplySubmit")
|
||||||
|
public ResponseResult<Boolean> appealApplySubmit(@RequestBody @Validated TpAppealApplyRequest request) {
|
||||||
|
PartnerUserInfoVO user = PartnerUserHolder.getUser();
|
||||||
|
request.setSource(1);
|
||||||
|
request.setApplyUserId(user.getPartnerId());
|
||||||
|
request.setApplyUserName(user.getUsername());
|
||||||
|
return ResponseResult.success(tpApplyService.appealApplySubmit(request));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("审批记录列表")
|
||||||
|
@GetMapping("/auditRecords")
|
||||||
|
@ApiImplicitParam(name = "applyId", value = "申请单id", required = true, dataType = "Long", paramType = "query")
|
||||||
|
public ResponseResult<List<AuditInfoResponse>> auditRecords(@NotNull(message = "申请单id不能为空") Long applyId) {
|
||||||
|
return ResponseResult.success(tpApplyService.getAuditRecordList(applyId));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("规则分页查询")
|
||||||
|
@GetMapping("/rulePage")
|
||||||
|
@ApiImplicitParam(name = "type", value = "规则类型,0惩处 1加分", required = true, dataType = "Integer", paramType = "query")
|
||||||
|
public ResponseResult<PageInfo<MiniTpRuleListVO>> rewardRulePage(@NotNull(message = "规则类型不能为空") Integer type) {
|
||||||
|
TpRuleQueryRequest request = new TpRuleQueryRequest();
|
||||||
|
request.setType(type);
|
||||||
|
request.setStatus(1);
|
||||||
|
return ResponseResult.success(tpApplyService.getMiniRulePage(request));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("认罚缴款")
|
||||||
|
@PostMapping("/acceptPenalty")
|
||||||
|
@ApiImplicitParam(name = "applyId", value = "惩处申请单id", required = true, dataType = "Long", paramType = "query")
|
||||||
|
public ResponseResult<Boolean> acceptPenalty(@NotNull(message = "惩处申请单id不能为空") Long applyId) {
|
||||||
|
return ResponseResult.success(tpApplyService.acceptPenalty(applyId));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,20 +1,16 @@
|
|||||||
package com.cool.store.job;
|
package com.cool.store.job;
|
||||||
|
|
||||||
import cn.hutool.core.collection.CollStreamUtil;
|
import cn.hutool.core.collection.CollStreamUtil;
|
||||||
import cn.hutool.core.date.DateUtil;
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.cool.store.constants.CommonConstants;
|
import com.cool.store.constants.CommonConstants;
|
||||||
import com.cool.store.dao.*;
|
import com.cool.store.dao.*;
|
||||||
|
import com.cool.store.dao.tp.TpApplyFormDAO;
|
||||||
import com.cool.store.dto.*;
|
import com.cool.store.dto.*;
|
||||||
import com.cool.store.dto.decoration.ConstructionScheduleDTO;
|
|
||||||
import com.cool.store.dto.openPreparation.OpenPlanShopInfoDTO;
|
|
||||||
import com.cool.store.dto.store.StoreOrderTimeDTO;
|
import com.cool.store.dto.store.StoreOrderTimeDTO;
|
||||||
import com.cool.store.entity.*;
|
import com.cool.store.entity.*;
|
||||||
|
import com.cool.store.entity.tp.TpApplyFormDO;
|
||||||
import com.cool.store.enums.*;
|
import com.cool.store.enums.*;
|
||||||
import com.cool.store.enums.point.ShopStatusEnum;
|
import com.cool.store.enums.tp.TpFormStatusEnum;
|
||||||
import com.cool.store.enums.point.ShopSubStageEnum;
|
|
||||||
import com.cool.store.enums.point.ShopSubStageStatusEnum;
|
|
||||||
import com.cool.store.exception.ServiceException;
|
|
||||||
import com.cool.store.mapper.ApplyLicenseMapper;
|
import com.cool.store.mapper.ApplyLicenseMapper;
|
||||||
import com.cool.store.mapper.LineInfoMapper;
|
import com.cool.store.mapper.LineInfoMapper;
|
||||||
import com.cool.store.mapper.TrainingExperienceMapper;
|
import com.cool.store.mapper.TrainingExperienceMapper;
|
||||||
@@ -22,39 +18,28 @@ import com.cool.store.mq.producer.SimpleMessageService;
|
|||||||
import com.cool.store.mq.util.HttpRestTemplateService;
|
import com.cool.store.mq.util.HttpRestTemplateService;
|
||||||
import com.cool.store.request.ZxjpApiRequest;
|
import com.cool.store.request.ZxjpApiRequest;
|
||||||
import com.cool.store.request.bigdata.LatestOrderDateRequest;
|
import com.cool.store.request.bigdata.LatestOrderDateRequest;
|
||||||
import com.cool.store.request.xfsgFirstOrderListRequest;
|
import com.cool.store.request.tp.TpApplyQueryRequest;
|
||||||
import com.cool.store.response.bigdata.LatestOrderDateResponse;
|
import com.cool.store.response.bigdata.LatestOrderDateResponse;
|
||||||
import com.cool.store.response.xfsgFirstOderListResponse;
|
|
||||||
import com.cool.store.service.*;
|
import com.cool.store.service.*;
|
||||||
import com.cool.store.service.impl.CommonService;
|
import com.cool.store.service.impl.CommonService;
|
||||||
import com.cool.store.utils.CoolDateUtils;
|
import com.cool.store.service.tp.TpApplyService;
|
||||||
import com.cool.store.utils.MDCUtils;
|
import com.cool.store.utils.MDCUtils;
|
||||||
import com.cool.store.utils.NumberConverter;
|
|
||||||
import com.cool.store.utils.poi.DateUtils;
|
import com.cool.store.utils.poi.DateUtils;
|
||||||
import com.cool.store.utils.poi.StringUtils;
|
import com.cool.store.utils.poi.StringUtils;
|
||||||
import com.cool.store.utils.poi.constant.Constants;
|
|
||||||
import com.github.pagehelper.Page;
|
|
||||||
import com.github.pagehelper.PageHelper;
|
import com.github.pagehelper.PageHelper;
|
||||||
import com.xxl.job.core.context.XxlJobHelper;
|
import com.xxl.job.core.context.XxlJobHelper;
|
||||||
import com.xxl.job.core.handler.annotation.XxlJob;
|
import com.xxl.job.core.handler.annotation.XxlJob;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.collections4.CollectionUtils;
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
import org.jetbrains.annotations.NotNull;
|
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.text.DateFormat;
|
import java.text.DateFormat;
|
||||||
import java.text.ParseException;
|
import java.text.ParseException;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.time.Instant;
|
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
import java.time.LocalDateTime;
|
|
||||||
import java.time.ZoneId;
|
|
||||||
import java.time.format.DateTimeFormatter;
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.function.Function;
|
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@@ -121,6 +106,10 @@ public class XxlJobHandler {
|
|||||||
StoreDao storeDao;
|
StoreDao storeDao;
|
||||||
@Resource
|
@Resource
|
||||||
ThirdBigDataService thirdBigDataService;
|
ThirdBigDataService thirdBigDataService;
|
||||||
|
@Resource
|
||||||
|
TpApplyFormDAO tpApplyFormDAO;
|
||||||
|
@Resource
|
||||||
|
TpApplyService tpApplyService;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -457,4 +446,45 @@ public class XxlJobHandler {
|
|||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 十二分制惩处申请单复议逾期
|
||||||
|
*/
|
||||||
|
@XxlJob("tpPenaltyAppealOverdue")
|
||||||
|
public void tpPenaltyAppealOverdue() {
|
||||||
|
MDCUtils.put(CommonConstants.REQUEST_ID, UUID.randomUUID().toString());
|
||||||
|
log.info("------start tpPenaltyAppealOverdue------");
|
||||||
|
boolean hasNext = true;
|
||||||
|
int pageNum = 1;
|
||||||
|
int pageSize = CommonConstants.BATCH_SIZE;
|
||||||
|
TpApplyQueryRequest request = new TpApplyQueryRequest();
|
||||||
|
request.setStatusList(Collections.singletonList(TpFormStatusEnum.PASS.getStatus()));
|
||||||
|
request.setIsPenalty(true);
|
||||||
|
request.setIsDraft(0);
|
||||||
|
request.setOverdue(true);
|
||||||
|
while (hasNext) {
|
||||||
|
PageHelper.startPage(pageNum, pageSize);
|
||||||
|
List<TpApplyFormDO> list = tpApplyFormDAO.getEffectiveList(request);
|
||||||
|
if (CollectionUtils.isEmpty(list)) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
hasNext = list.size() >= pageSize;
|
||||||
|
List<Long> applyIds = CollStreamUtil.toList(list, TpApplyFormDO::getId);
|
||||||
|
try {
|
||||||
|
tpApplyFormDAO.updateStatusBatch(applyIds, TpFormStatusEnum.EFFECTIVE);
|
||||||
|
list.forEach(form -> {
|
||||||
|
try {
|
||||||
|
tpApplyService.scoreChange(form);
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.info("积分变动失败,formId:{}, storeId:{}", form.getId(), form.getStoreId());
|
||||||
|
log.info("积分变动失败", e);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("超过申诉期,更新申请单状态失败", e);
|
||||||
|
}
|
||||||
|
pageNum++;
|
||||||
|
}
|
||||||
|
log.info("------end tpPenaltyAppealOverdue------");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user