Commit 61398363 authored by 沈鑫's avatar 沈鑫

清洗修改

parent 3982af6a
...@@ -2,8 +2,10 @@ package com.mortals.xhx.modules.implementlist.service; ...@@ -2,8 +2,10 @@ package com.mortals.xhx.modules.implementlist.service;
import com.mortals.xhx.modules.implementlist.model.RybMatterListEntry; import com.mortals.xhx.modules.implementlist.model.RybMatterListEntry;
import java.util.Map;
public interface RybMatterListService { public interface RybMatterListService {
RybMatterListEntry getThImplement(String event_code); RybMatterListEntry getThImplement(Map<String, RybMatterListEntry> map, String event_code);
} }
\ No newline at end of file
...@@ -10,6 +10,8 @@ import org.springframework.stereotype.Service; ...@@ -10,6 +10,8 @@ import org.springframework.stereotype.Service;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.List; import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
@Service @Service
@RequiredArgsConstructor(onConstructor = @__(@Autowired)) @RequiredArgsConstructor(onConstructor = @__(@Autowired))
...@@ -18,12 +20,9 @@ public class RybMatterListServiceImpl implements RybMatterListService { ...@@ -18,12 +20,9 @@ public class RybMatterListServiceImpl implements RybMatterListService {
@Resource @Resource
private RybMatterDao rybMatterDao; private RybMatterDao rybMatterDao;
private final Cache<String, Object> caffeineCache;
@Override @Override
public RybMatterListEntry getThImplement(String event_code) { public RybMatterListEntry getThImplement(Map<String, RybMatterListEntry> map, String event_code) {
caffeineCache.getIfPresent(event_code); RybMatterListEntry thImplementList = map.get(event_code);
RybMatterListEntry thImplementList = (RybMatterListEntry) caffeineCache.asMap().get(event_code);
if (thImplementList != null) { if (thImplementList != null) {
return thImplementList; return thImplementList;
} }
...@@ -32,7 +31,7 @@ public class RybMatterListServiceImpl implements RybMatterListService { ...@@ -32,7 +31,7 @@ public class RybMatterListServiceImpl implements RybMatterListService {
if (rybMatterListEntries.size() > 0) { if (rybMatterListEntries.size() > 0) {
for (RybMatterListEntry entity : rybMatterListEntries) { for (RybMatterListEntry entity : rybMatterListEntries) {
thImplementList=entity; thImplementList=entity;
caffeineCache.put(event_code, entity); map.put(event_code, entity);
} }
} }
return thImplementList; return thImplementList;
......
...@@ -34,6 +34,8 @@ import java.text.SimpleDateFormat; ...@@ -34,6 +34,8 @@ import java.text.SimpleDateFormat;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
...@@ -63,6 +65,8 @@ public class SupplementTaskImpl implements ITaskExcuteService { ...@@ -63,6 +65,8 @@ public class SupplementTaskImpl implements ITaskExcuteService {
@Autowired @Autowired
private ArameterService arameterService; private ArameterService arameterService;
private final Map<String, RybMatterListEntry> map = new ConcurrentHashMap<>();
@Override @Override
public void excuteTask(ITask task) throws AppException { public void excuteTask(ITask task) throws AppException {
//1.查询上月的表是否存在未清洗的数据 //蓉易办 //1.查询上月的表是否存在未清洗的数据 //蓉易办
...@@ -91,7 +95,7 @@ public class SupplementTaskImpl implements ITaskExcuteService { ...@@ -91,7 +95,7 @@ public class SupplementTaskImpl implements ITaskExcuteService {
if (!supplementEntities.isEmpty()) { if (!supplementEntities.isEmpty()) {
List<SupplementEntity> collect = supplementEntities.parallelStream().map(e -> { List<SupplementEntity> collect = supplementEntities.parallelStream().map(e -> {
//TODO:查询实施清单信息,通过事项编码查询有问题(但因数据库存储的事项数据是条件过滤后的,故暂时不改动查询),后期改动 //TODO:查询实施清单信息,通过事项编码查询有问题(但因数据库存储的事项数据是条件过滤后的,故暂时不改动查询),后期改动
RybMatterListEntry thImplement = rybMatterListService.getThImplement(e.getImplCode()); RybMatterListEntry thImplement = rybMatterListService.getThImplement(map, e.getImplCode());
try { try {
InformationEntity informationQuery = new InformationEntity(); InformationEntity informationQuery = new InformationEntity();
//组装第一次业务数据(清洗后的) //组装第一次业务数据(清洗后的)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment