Commit cea4f206 authored by 沈鑫's avatar 沈鑫

清洗修改

parent 61398363
...@@ -2,10 +2,8 @@ package com.mortals.xhx.modules.implementlist.service; ...@@ -2,10 +2,8 @@ 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(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; ...@@ -6,23 +6,24 @@ import com.mortals.xhx.modules.implementlist.model.RybMatterListEntry;
import com.mortals.xhx.modules.implementlist.service.RybMatterListService; import com.mortals.xhx.modules.implementlist.service.RybMatterListService;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Component;
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 @Component("rybMatterListService")
@RequiredArgsConstructor(onConstructor = @__(@Autowired)) @RequiredArgsConstructor(onConstructor = @__(@Autowired))
public class RybMatterListServiceImpl implements RybMatterListService { public class RybMatterListServiceImpl implements RybMatterListService {
@Resource @Resource
private RybMatterDao rybMatterDao; private RybMatterDao rybMatterDao;
private final Cache<String, Object> caffeineCache;
@Override @Override
public RybMatterListEntry getThImplement(Map<String, RybMatterListEntry> map, String event_code) { public RybMatterListEntry getThImplement(String event_code) {
RybMatterListEntry thImplementList = map.get(event_code); caffeineCache.getIfPresent(event_code);
RybMatterListEntry thImplementList = (RybMatterListEntry) caffeineCache.asMap().get(event_code);
if (thImplementList != null) { if (thImplementList != null) {
return thImplementList; return thImplementList;
} }
...@@ -31,7 +32,7 @@ public class RybMatterListServiceImpl implements RybMatterListService { ...@@ -31,7 +32,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;
map.put(event_code, entity); caffeineCache.put(event_code, entity);
} }
} }
return thImplementList; return thImplementList;
......
...@@ -34,8 +34,6 @@ import java.text.SimpleDateFormat; ...@@ -34,8 +34,6 @@ 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;
/** /**
...@@ -65,8 +63,6 @@ public class SupplementTaskImpl implements ITaskExcuteService { ...@@ -65,8 +63,6 @@ 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.查询上月的表是否存在未清洗的数据 //蓉易办
...@@ -95,7 +91,7 @@ public class SupplementTaskImpl implements ITaskExcuteService { ...@@ -95,7 +91,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(map, e.getImplCode()); RybMatterListEntry thImplement = rybMatterListService.getThImplement(e.getImplCode());
try { try {
InformationEntity informationQuery = new InformationEntity(); InformationEntity informationQuery = new InformationEntity();
//组装第一次业务数据(清洗后的) //组装第一次业务数据(清洗后的)
...@@ -313,7 +309,7 @@ public class SupplementTaskImpl implements ITaskExcuteService { ...@@ -313,7 +309,7 @@ public class SupplementTaskImpl implements ITaskExcuteService {
//获取当前时间 //获取当前时间
supplementQuery.setCreateDateEnd( supplementQuery.setCreateDateEnd(
DateUtils.convertTime2Str(new Date().getTime(), DateUtils.P_yyyy_MM_dd_HH_mm_ss)); 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 @@ ...@@ -5,7 +5,7 @@
<!-- 字段和属性映射 --> <!-- 字段和属性映射 -->
<resultMap type="SupplementEntity" id="SupplementEntity-Map"> <resultMap type="SupplementEntity" id="SupplementEntity-Map">
<id property="id" column="id" /> <id property="id" column="id" />
<result property="implName" column="impl_name" /> <result property="implName" column="implName" />
<result property="implCode" column="impl_code" /> <result property="implCode" column="impl_code" />
<result property="applicationType" column="application_type" /> <result property="applicationType" column="application_type" />
<result property="applicationCardType" column="application_card_type" /> <result property="applicationCardType" column="application_card_type" />
...@@ -427,7 +427,7 @@ ...@@ -427,7 +427,7 @@
</foreach> </foreach>
</update> </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"/> select <include refid="_columns"/>
from ${tableName} as a from ${tableName} as a
where a.id=#{condition.id} where a.id=#{condition.id}
...@@ -454,7 +454,7 @@ ...@@ -454,7 +454,7 @@
</trim> </trim>
</delete> </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"/> select <include refid="_columns"/>
from ${tableName} as a from ${tableName} as a
<trim suffixOverrides="where" suffix=""> <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