|
@@ -17,6 +17,7 @@ import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
import java.math.BigDecimal;
|
|
|
import java.time.LocalDate;
|
|
import java.time.LocalDate;
|
|
|
|
|
+import java.time.LocalDateTime;
|
|
|
import java.util.Arrays;
|
|
import java.util.Arrays;
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
import java.util.Map;
|
|
@@ -47,10 +48,20 @@ public class KxsUserAmountLogServiceImpl extends ServiceImpl<KxsUserAmountLogMap
|
|
|
KxsUserAmountLog userAmountLog = new KxsUserAmountLog();
|
|
KxsUserAmountLog userAmountLog = new KxsUserAmountLog();
|
|
|
userAmountLog.setId(id);
|
|
userAmountLog.setId(id);
|
|
|
|
|
|
|
|
|
|
+ String tradeMonth;
|
|
|
|
|
+ if(fieldDataMap.get("CreateDate") != null){
|
|
|
|
|
+ LocalDateTime createTime = LocalDateTimeUtil.parse(fieldDataMap.get("CreateDate").toString(), DatePattern.NORM_DATETIME_PATTERN);
|
|
|
|
|
+ tradeMonth = LocalDateTimeUtil.format(createTime, DatePattern.SIMPLE_MONTH_PATTERN);
|
|
|
|
|
+ }else{
|
|
|
|
|
+ tradeMonth = MonthTableNameHandler.getThisMoth();
|
|
|
|
|
+ }
|
|
|
|
|
+ //每个请求线程维护一个month数据,避免多线程数据冲突
|
|
|
|
|
+ MonthTableNameHandler.setData(tradeMonth);
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
//操作类型
|
|
//操作类型
|
|
|
OperationType operation = dmlData.getOperation();
|
|
OperationType operation = dmlData.getOperation();
|
|
|
if (operation.equals(OperationType.DELETE)) {
|
|
if (operation.equals(OperationType.DELETE)) {
|
|
|
- MonthTableNameHandler.setData(MonthTableNameHandler.getThisMoth());
|
|
|
|
|
// 删除数据
|
|
// 删除数据
|
|
|
baseMapper.deleteById(id);
|
|
baseMapper.deleteById(id);
|
|
|
//删除线程,避免线程污染
|
|
//删除线程,避免线程污染
|
|
@@ -102,8 +113,6 @@ public class KxsUserAmountLogServiceImpl extends ServiceImpl<KxsUserAmountLogMap
|
|
|
break;
|
|
break;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- //分表月份
|
|
|
|
|
- MonthTableNameHandler.setData(MonthTableNameHandler.getThisMoth());
|
|
|
|
|
if (operation.equals(OperationType.UPDATE)) {
|
|
if (operation.equals(OperationType.UPDATE)) {
|
|
|
// 更新数据
|
|
// 更新数据
|
|
|
baseMapper.updateById(userAmountLog);
|
|
baseMapper.updateById(userAmountLog);
|