|
@@ -17,6 +17,8 @@ import com.simuwang.base.pojo.dto.query.FundDeletionPageQuery;
|
|
|
import com.simuwang.base.pojo.vo.*;
|
|
|
import com.simuwang.manage.service.DeletionService;
|
|
|
import com.simuwang.shiro.utils.UserUtils;
|
|
|
+import org.slf4j.Logger;
|
|
|
+import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.scheduling.annotation.Async;
|
|
|
import org.springframework.stereotype.Service;
|
|
@@ -34,6 +36,7 @@ import java.util.stream.Collectors;
|
|
|
@Service
|
|
|
public class DeletionServiceImpl implements DeletionService {
|
|
|
|
|
|
+ private static final Logger log = LoggerFactory.getLogger(DeletionServiceImpl.class);
|
|
|
@Autowired
|
|
|
private DeletionInfoMapper deletionInfoMapper;
|
|
|
|
|
@@ -176,30 +179,32 @@ public class DeletionServiceImpl implements DeletionService {
|
|
|
|
|
|
@Override
|
|
|
public void computeDeletionTypeNum(List<FundDeletionTypeDO> fundDeletionTypeList) {
|
|
|
+ //清空deletion_type_statistics
|
|
|
+ deletionTypeStatisticsMapper.truncateTable();
|
|
|
List<DeletionTypeStatisticsDO> deletionTypeStatisticsDOList = new ArrayList<>();
|
|
|
for (FundDeletionTypeDO fundDeletionType : fundDeletionTypeList) {
|
|
|
- String fundId = fundDeletionType.getFundId();
|
|
|
- Integer deletionType = fundDeletionType.getDeletionType();
|
|
|
- Integer deletionNum = deletionInfoMapper.countFundDeletion(fundId,deletionType,1);
|
|
|
- Integer processedNum = deletionInfoMapper.countFundDeletion(fundId,deletionType,0);
|
|
|
- String lastDeletionDate = deletionInfoMapper.getLastDeletionDate(fundId,deletionType);
|
|
|
- DeletionTypeStatisticsDO deletionTypeStatisticsDO = new DeletionTypeStatisticsDO();
|
|
|
- deletionTypeStatisticsDO.setFundId(fundId);
|
|
|
- deletionTypeStatisticsDO.setIsvalid(1);
|
|
|
- deletionTypeStatisticsDO.setCreateTime(new Date());
|
|
|
- deletionTypeStatisticsDO.setCreatorId(999999);
|
|
|
- deletionTypeStatisticsDO.setUpdaterId(999999);
|
|
|
- deletionTypeStatisticsDO.setUpdateTime(new Date());
|
|
|
- deletionTypeStatisticsDO.setLastDeletionDate(lastDeletionDate);
|
|
|
- deletionTypeStatisticsDO.setDeletionType(Integer.valueOf(deletionType));
|
|
|
- deletionTypeStatisticsDO.setDeletionNum(deletionNum);
|
|
|
- deletionTypeStatisticsDO.setProcessedNum(processedNum);
|
|
|
- DeletionTypeStatisticsDO oldDeletionTypeStatisticsDO = deletionTypeStatisticsMapper.getDeletionTypeStatistics(fundId,deletionType);
|
|
|
- if(oldDeletionTypeStatisticsDO != null){
|
|
|
- deletionTypeStatisticsDO.setId(oldDeletionTypeStatisticsDO.getId());
|
|
|
+ try{
|
|
|
+ String fundId = fundDeletionType.getFundId();
|
|
|
+ Integer deletionType = fundDeletionType.getDeletionType();
|
|
|
+ Integer deletionNum = deletionInfoMapper.countFundDeletion(fundId,deletionType,1);
|
|
|
+ Integer processedNum = deletionInfoMapper.countFundDeletion(fundId,deletionType,0);
|
|
|
+ String lastDeletionDate = deletionInfoMapper.getLastDeletionDate(fundId,deletionType);
|
|
|
+ DeletionTypeStatisticsDO deletionTypeStatisticsDO = new DeletionTypeStatisticsDO();
|
|
|
+ deletionTypeStatisticsDO.setFundId(fundId);
|
|
|
+ deletionTypeStatisticsDO.setIsvalid(1);
|
|
|
+ deletionTypeStatisticsDO.setCreateTime(new Date());
|
|
|
+ deletionTypeStatisticsDO.setCreatorId(999999);
|
|
|
+ deletionTypeStatisticsDO.setUpdaterId(999999);
|
|
|
deletionTypeStatisticsDO.setUpdateTime(new Date());
|
|
|
+ deletionTypeStatisticsDO.setLastDeletionDate(lastDeletionDate);
|
|
|
+ deletionTypeStatisticsDO.setDeletionType(deletionType);
|
|
|
+ deletionTypeStatisticsDO.setDeletionNum(deletionNum);
|
|
|
+ deletionTypeStatisticsDO.setProcessedNum(processedNum);
|
|
|
+ deletionTypeStatisticsMapper.insertOrUpdate(deletionTypeStatisticsDO);
|
|
|
+ }catch (Exception e){
|
|
|
+ log.error(e.getMessage(),e);
|
|
|
}
|
|
|
- deletionTypeStatisticsMapper.insertOrUpdate(deletionTypeStatisticsDO);
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
|