@@ -3,9 +3,10 @@ package cn.com.taiji.core.entity.dict; | |||
import cn.com.taiji.common.model.KeyValue; | |||
import cn.com.taiji.core.entity.dict.issue.ProductAfterType; | |||
import cn.com.taiji.core.entity.dict.issue.ShippingStatus; | |||
import cn.com.taiji.core.entity.dict.issue.ProcessingFeeType; | |||
import cn.com.taiji.core.entity.dict.issue.UseFeeType; | |||
import lombok.AllArgsConstructor; | |||
import lombok.Getter; | |||
import java.util.ArrayList; | |||
import java.util.List; | |||
@@ -21,8 +22,15 @@ import java.util.List; | |||
public enum AllEnum { | |||
// ALL_ENUM(AllEnum.keyValues(),"全部枚举"), | |||
//==============================issue=========================================== | |||
SHIPPINGS_TATUS(ShippingStatus.keyValues(),"邮寄状态"), | |||
PRODUCT_AFTER_TYPE(ProductAfterType.keyValues(), "产品售后收费类型"), | |||
PROCESSING_FEETYPE(ProcessingFeeType.keyValues(),"产品办理收费类型"), | |||
USEFEE_TYPE(UseFeeType.keyValues(),"产品使用收费类型"), | |||
//==============================issue=========================================== | |||
BUCKET_FILEBUS(BucketFileBus.keyValues(), "文件业务类型"), | |||
; | |||
private List<KeyValue> keyValues; |
@@ -1,5 +1,6 @@ | |||
package cn.com.taiji.core.entity.dict.issue; | |||
import cn.com.taiji.common.model.KeyValue; | |||
import cn.com.taiji.common.model.StringKeyValue; | |||
import lombok.AllArgsConstructor; | |||
import lombok.Getter; | |||
@@ -12,19 +13,17 @@ import java.util.List; | |||
public enum ProcessingFeeType { | |||
/*** 办理费类型枚举 */ | |||
HANDLE(1, "权益金"), | |||
MARGIN(2, "保证金"), | |||
PRESTORE(3, "预存金"), | |||
HANDLE("权益金"), | |||
MARGIN( "保证金"), | |||
PRESTORE("预存金"), | |||
; | |||
private final Integer code; | |||
private final String value; | |||
private final String name; | |||
public List<StringKeyValue> assType() { | |||
List<StringKeyValue> stringKeyValues = new ArrayList<>(); | |||
public static List<KeyValue> keyValues() { | |||
List<KeyValue> stringKeyValues = new ArrayList<>(); | |||
for (ProcessingFeeType value : values()) { | |||
StringKeyValue stringKeyValue = new StringKeyValue(value.name(), value.getName()); | |||
StringKeyValue stringKeyValue = new StringKeyValue(value.name(), value.value); | |||
stringKeyValues.add(stringKeyValue); | |||
} | |||
return stringKeyValues; |
@@ -0,0 +1,33 @@ | |||
package cn.com.taiji.core.entity.dict.issue; | |||
import cn.com.taiji.common.model.KeyValue; | |||
import cn.com.taiji.common.model.StringKeyValue; | |||
import lombok.AllArgsConstructor; | |||
import lombok.Getter; | |||
import java.util.ArrayList; | |||
import java.util.List; | |||
/** | |||
* @Author:ChenChao | |||
* @Date:2025/5/29 16:09 | |||
* @Filename:UseFeeType | |||
* @description: 产品使用费类型 | |||
*/ | |||
@AllArgsConstructor | |||
@Getter | |||
public enum UseFeeType { | |||
SERVICE("服务费"), | |||
MARGIN("综合服务费"), | |||
; | |||
private String value; | |||
public static List<KeyValue> keyValues() { | |||
List<KeyValue> stringKeyValues = new ArrayList<>(); | |||
for (UseFeeType value : values()) { | |||
StringKeyValue stringKeyValue = new StringKeyValue(value.name(), value.value); | |||
stringKeyValues.add(stringKeyValue); | |||
} | |||
return stringKeyValues; | |||
} | |||
} |
@@ -36,7 +36,7 @@ public class IssueCouponDetail extends StringPropertyUUIDEntity { | |||
private LocalDateTime validStartTime;//卡券生效时间 | |||
@NotNull | |||
@Column(name = "VALID_EDN_TIME") | |||
private LocalDateTime validEdnTime;//卡券截止时间 | |||
private LocalDateTime validEndTime;//卡券截止时间 | |||
@NotNull | |||
@Column(name = "CODE_CREATE_TIME") | |||
private LocalDateTime codeCreateTime;//兑换码生成时间 |
@@ -36,7 +36,7 @@ public class IssueProductPay extends StringPropertyUUIDEntity { | |||
@NotBlank | |||
@Size(max = 20) | |||
@Column(name = "FEE_TYPE") | |||
private String feeType;//费用类型 办理费的收费类型从ProcessingFeeType枚举获取 ;使用费的收费类型从字典获取 | |||
private String feeType;//费用类型 | |||
@NotNull | |||
@Column(name = "CHARGE_METHOD") | |||
@Enumerated(EnumType.STRING) |
@@ -52,7 +52,7 @@ public class IssueProductPromotion extends StringPropertyUUIDEntity { | |||
@Column(name = "OPERATE_USER_NAME") | |||
private String operateUserName;//操作人姓名 | |||
@Column(name = "EXAMINE") | |||
private Integer examine;//审核通过状态 0-通过 1-不通过 2-待审核 | |||
private Integer examine = 2;//审核通过状态 0-通过 1-不通过 2-待审核 | |||
@Size(max = 300) | |||
@Column(name = "EXAMINE_DES") | |||
private String examineDes;//审核原因 | |||
@@ -62,7 +62,7 @@ public class IssueProductPromotion extends StringPropertyUUIDEntity { | |||
@NotNull | |||
@Column(name = "STATUS") | |||
@Enumerated(EnumType.STRING) | |||
private EnableStatus status;//状态 | |||
private EnableStatus status = EnableStatus.DISABLE;//状态 | |||
@NotNull | |||
@Column(name = "INSERT_TIME") | |||
private LocalDateTime insertTime = LocalDateTime.now();//创建时间 |
@@ -8,6 +8,7 @@ import javax.validation.constraints.NotNull; | |||
import javax.validation.constraints.Size; | |||
import cn.com.taiji.common.entity.StringPropertyUUIDEntity; | |||
import cn.com.taiji.core.entity.dict.issue.UseFeeType; | |||
import lombok.Getter; | |||
import lombok.Setter; | |||
@@ -28,8 +29,9 @@ public class IssueProductUseFee extends StringPropertyUUIDEntity { | |||
private String releaseId;//产品编号 | |||
@NotBlank | |||
@Size(max = 20) | |||
@Enumerated(EnumType.STRING) | |||
@Column(name = "USE_FEE_TYPE") | |||
private String useFeeType;//使用费类型 | |||
private UseFeeType useFeeType;//使用费类型 | |||
@NotNull | |||
@Column(name = "BILLING_MODE") | |||
private Integer billingMode;//计费方式 0次数,1按月,2按年 |
@@ -8,6 +8,8 @@ import com.alibaba.excel.context.AnalysisContext; | |||
import com.alibaba.excel.read.listener.ReadListener; | |||
import com.alibaba.excel.util.ListUtils; | |||
import com.alibaba.fastjson2.JSON; | |||
import lombok.Data; | |||
import lombok.Getter; | |||
import org.slf4j.Logger; | |||
import org.slf4j.LoggerFactory; | |||
import org.springframework.util.CollectionUtils; | |||
@@ -22,6 +24,7 @@ import java.util.List; | |||
* @Date 2023/4/4 14:57 | |||
* @Email 13079168756@163.com | |||
*/ | |||
@Getter | |||
public abstract class AbstractListener<T> implements ReadListener<T> { | |||
protected Logger logger = LoggerFactory.getLogger(this.getClass()); | |||
@@ -33,7 +36,7 @@ public abstract class AbstractListener<T> implements ReadListener<T> { | |||
/** | |||
* 缓存的数据 | |||
*/ | |||
private List<T> cachedDataList = ListUtils.newArrayListWithExpectedSize(BATCH_COUNT); | |||
public List<T> cachedDataList = ListUtils.newArrayListWithExpectedSize(BATCH_COUNT); | |||
/** | |||
* 当前处理excel的第几行数 | |||
@@ -96,14 +99,21 @@ public abstract class AbstractListener<T> implements ReadListener<T> { | |||
logger.error(e.getMessage()); | |||
throw new RuntimeException(e.getMessage()); | |||
} | |||
logger.info("所有数据解析入库完成!"); | |||
// logger.info("所有数据解析入库完成!"); | |||
} | |||
} | |||
/*** | |||
* 将扫excel数据入库的行为抽象出来 | |||
// /*** | |||
// * 将扫excel数据入库的行为抽象出来 | |||
// */ | |||
// protected abstract void saveData(List<T> dataList) throws ServiceHandleException; | |||
/** | |||
* 将扫excel数据入库的行为提取出来 | |||
* @param dataList | |||
* @throws ServiceHandleException | |||
*/ | |||
protected abstract void saveData(List<T> dataList) throws ServiceHandleException; | |||
protected void saveData(List<T> dataList) throws ServiceHandleException {} | |||
//字段非空校验 |
@@ -0,0 +1,71 @@ | |||
package cn.com.taiji.core.manager.tools.excel; | |||
import com.alibaba.excel.converters.Converter; | |||
import com.alibaba.excel.converters.ReadConverterContext; | |||
import com.alibaba.excel.enums.CellDataTypeEnum; | |||
import java.time.LocalDateTime; | |||
/** | |||
* 时间转换器 | |||
* | |||
* @Author weicailin | |||
* @Date 2023/08/28 028 14:11 | |||
*/ | |||
public class LocalDateTimeConverter implements Converter<LocalDateTime> { | |||
@Override | |||
public Class<?> supportJavaTypeKey() { | |||
return String.class; | |||
} | |||
@Override | |||
public CellDataTypeEnum supportExcelTypeKey() { | |||
return CellDataTypeEnum.STRING; | |||
} | |||
/** | |||
* 这里读取excel行时会调用 | |||
*/ | |||
@Override | |||
public LocalDateTime convertToJavaData(ReadConverterContext<?> context) { | |||
String value = context.getReadCellData().getStringValue(); | |||
value = value.trim(); | |||
//判断是否有斜线/,有则替换为横杆-,避免转换异常 | |||
if (value.contains("/")) { | |||
value = value.replaceAll("/", "-"); | |||
} | |||
//判断是否有T,没有则补充,避免转换失败 | |||
if (10 == value.indexOf(" ")) { | |||
value = value.replaceAll(" ", "T"); | |||
} | |||
LocalDateTime localDateTime = null; | |||
try { | |||
localDateTime = LocalDateTime.parse(value); | |||
} catch (Exception e) { | |||
e.printStackTrace(); | |||
throw new RuntimeException("时间格式转换异常"); | |||
} | |||
return localDateTime; | |||
} | |||
public static void main(String[] args) { | |||
String value = "2023-03-04 11:39:33"; | |||
if (value.contains("/")) { | |||
value = value.replaceAll("/", "-"); | |||
} | |||
if (10 == value.indexOf(" ")) { | |||
value = value.replaceAll(" ", "T"); | |||
} | |||
LocalDateTime localDateTime = LocalDateTime.parse(value); | |||
System.out.println(localDateTime); | |||
} | |||
} |
@@ -2,7 +2,13 @@ package cn.com.taiji.core.repo.jpa.comm; | |||
import cn.com.taiji.common.repo.jpa.AbstractJpaRepo; | |||
import cn.com.taiji.core.entity.comm.CommonPayConfig; | |||
import cn.com.taiji.core.entity.dict.pay.PayChannelType; | |||
import java.util.List; | |||
public interface CommonPayConfigRepo extends AbstractJpaRepo<CommonPayConfig, String>{ | |||
//通过支付渠道查询 | |||
List<CommonPayConfig> findByPayChannelType(PayChannelType payChannelType); | |||
} |
@@ -2,7 +2,15 @@ package cn.com.taiji.core.repo.jpa.issue; | |||
import cn.com.taiji.common.repo.jpa.AbstractJpaRepo; | |||
import cn.com.taiji.core.entity.issue.IssueMultipleEquity; | |||
import org.springframework.data.jpa.repository.Query; | |||
import java.util.List; | |||
public interface IssueMultipleEquityRepo extends AbstractJpaRepo<IssueMultipleEquity, String>{ | |||
@Query("from IssueMultipleEquity where singleIds like ?1") | |||
List<IssueMultipleEquity> findBySingleLike(String singleId); | |||
} |
@@ -24,6 +24,14 @@ public interface IssueProductPayRepo extends AbstractJpaRepo<IssueProductPay, St | |||
@Query("delete from IssueProductPay where feeCategory=?1 and feeType = ?2 and releaseId = ?3") | |||
int deleteByffr(FeeCategory feeCategory,String feeType,String releaseId); | |||
//通过推广产品ID删除 | |||
@Transactional | |||
@Modifying | |||
@Query("delete from IssueProductPay where proId = ?1") | |||
int deleteByProId(String proId); | |||
List<IssueProductPay> findByFeeCategoryAndReleaseId(FeeCategory feeCategory,String releaseId); | |||
List<IssueProductPay> findByReleaseId(String releaseId); | |||
} |
@@ -1,10 +1,22 @@ | |||
package cn.com.taiji.core.repo.jpa.issue; | |||
import cn.com.taiji.common.repo.jpa.AbstractJpaRepo; | |||
import cn.com.taiji.core.entity.dict.EnableStatus; | |||
import cn.com.taiji.core.entity.issue.IssueProductPromotion; | |||
import org.springframework.data.jpa.repository.Modifying; | |||
import org.springframework.data.jpa.repository.Query; | |||
import org.springframework.transaction.annotation.Transactional; | |||
import java.time.LocalDateTime; | |||
public interface IssueProductPromotionRepo extends AbstractJpaRepo<IssueProductPromotion, String>{ | |||
IssueProductPromotion findByReleaseId(String releaseId); | |||
//更改状态 | |||
@Modifying | |||
@Transactional | |||
@Query("update IssueProductPromotion set status =?1 ,updateTime = ?2 where id = ?3") | |||
int updateState(EnableStatus status, LocalDateTime time, String id); | |||
} |
@@ -1,8 +1,19 @@ | |||
package cn.com.taiji.core.repo.jpa.issue; | |||
import cn.com.taiji.common.repo.jpa.AbstractJpaRepo; | |||
import cn.com.taiji.core.entity.dict.EnableStatus; | |||
import cn.com.taiji.core.entity.issue.IssueSingleEquity; | |||
import org.springframework.data.jpa.repository.Query; | |||
import java.util.List; | |||
public interface IssueSingleEquityRepo extends AbstractJpaRepo<IssueSingleEquity, String>{ | |||
@Query("select max(singleEquityId) from IssueSingleEquity where singleEquityId like ?1 ") | |||
String findSeqCodeByDate(String date); | |||
List<IssueSingleEquity> findByStatus(EnableStatus status); | |||
IssueSingleEquity findByEquityName(String equityName); | |||
} |