Commit cea4f206 authored by 沈鑫's avatar 沈鑫

清洗修改

parent 61398363
......@@ -2,10 +2,8 @@ package com.mortals.xhx.modules.implementlist.service;
import com.mortals.xhx.modules.implementlist.model.RybMatterListEntry;
import java.util.Map;
public interface RybMatterListService {
RybMatterListEntry getThImplement(Map<String, RybMatterListEntry> map, String event_code);
RybMatterListEntry getThImplement(String event_code);
}
\ No newline at end of file
......@@ -6,23 +6,24 @@ import com.mortals.xhx.modules.implementlist.model.RybMatterListEntry;
import com.mortals.xhx.modules.implementlist.service.RybMatterListService;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
@Service
@Component("rybMatterListService")
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
public class RybMatterListServiceImpl implements RybMatterListService {
@Resource
private RybMatterDao rybMatterDao;
private final Cache<String, Object> caffeineCache;
@Override
public RybMatterListEntry getThImplement(Map<String, RybMatterListEntry> map, String event_code) {
RybMatterListEntry thImplementList = map.get(event_code);
public RybMatterListEntry getThImplement(String event_code) {
caffeineCache.getIfPresent(event_code);
RybMatterListEntry thImplementList = (RybMatterListEntry) caffeineCache.asMap().get(event_code);
if (thImplementList != null) {
return thImplementList;
}
......@@ -31,7 +32,7 @@ public class RybMatterListServiceImpl implements RybMatterListService {
if (rybMatterListEntries.size() > 0) {
for (RybMatterListEntry entity : rybMatterListEntries) {
thImplementList=entity;
map.put(event_code, entity);
caffeineCache.put(event_code, entity);
}
}
return thImplementList;
......
......@@ -34,8 +34,6 @@ import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.stream.Collectors;
/**
......@@ -65,8 +63,6 @@ public class SupplementTaskImpl implements ITaskExcuteService {
@Autowired
private ArameterService arameterService;
private final Map<String, RybMatterListEntry> map = new ConcurrentHashMap<>();
@Override
public void excuteTask(ITask task) throws AppException {
//1.查询上月的表是否存在未清洗的数据 //蓉易办
......@@ -95,7 +91,7 @@ public class SupplementTaskImpl implements ITaskExcuteService {
if (!supplementEntities.isEmpty()) {
List<SupplementEntity> collect = supplementEntities.parallelStream().map(e -> {
//TODO:查询实施清单信息,通过事项编码查询有问题(但因数据库存储的事项数据是条件过滤后的,故暂时不改动查询),后期改动
RybMatterListEntry thImplement = rybMatterListService.getThImplement(map, e.getImplCode());
RybMatterListEntry thImplement = rybMatterListService.getThImplement(e.getImplCode());
try {
InformationEntity informationQuery = new InformationEntity();
//组装第一次业务数据(清洗后的)
......@@ -313,7 +309,7 @@ public class SupplementTaskImpl implements ITaskExcuteService {
//获取当前时间
supplementQuery.setCreateDateEnd(
DateUtils.convertTime2Str(new Date().getTime(), DateUtils.P_yyyy_MM_dd_HH_mm_ss));
return supplementService.find(supplementQuery, pageInfo,null).getList();
return supplementService.find(supplementQuery, pageInfo, null).getList();
}
}
......@@ -5,7 +5,7 @@
<!-- 字段和属性映射 -->
<resultMap type="SupplementEntity" id="SupplementEntity-Map">
<id property="id" column="id" />
<result property="implName" column="impl_name" />
<result property="implName" column="implName" />
<result property="implCode" column="impl_code" />
<result property="applicationType" column="application_type" />
<result property="applicationCardType" column="application_card_type" />
......@@ -427,7 +427,7 @@
</foreach>
</update>
<!-- 根据主健查询 -->
<select id="getByKey" parameterType="paramDto" resultMap="SupplementEntity-Map">
<select id="getByKey" parameterType="paramDto" resultType="com.mortals.xhx.modules.supplement.model.SupplementEntity">
select <include refid="_columns"/>
from ${tableName} as a
where a.id=#{condition.id}
......@@ -454,7 +454,7 @@
</trim>
</delete>
<!-- 获取列表 -->
<select id="getList" parameterType="paramDto" resultMap="SupplementEntity-Map">
<select id="getList" parameterType="paramDto" resultType="com.mortals.xhx.modules.supplement.model.SupplementEntity">
select <include refid="_columns"/>
from ${tableName} as a
<trim suffixOverrides="where" suffix="">
......
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