Commit d315935c authored by gaoyingwei's avatar gaoyingwei

修改 定时

parent d32ef2fd
......@@ -13,6 +13,7 @@ import org.springframework.stereotype.Component;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
/**
* 定时任务调度
......@@ -35,11 +36,12 @@ public class JcglTask
{
System.out.println("定时执行同步隔离人员");
List<Jcglry> list = jcglryMapper.selectAllJcglry();
List<Yxry> yxries = yxryMapper.selectAll();
List<Jcglry> jcglries = new ArrayList<>();
List<Yxry> yxrys = new ArrayList<>();
for (Jcglry jcglry : list) {
List<Yxry> yxries = yxryMapper.selectYxryByCard(jcglry.getCardNo());
if (!yxries.isEmpty()){
List<Yxry> yxrieList = yxries.stream().filter(l->l.getCardNo().equals(jcglry.getCardNo())).collect(Collectors.toList());
if (!yxrieList.isEmpty()){
jcglry.setStreet(yxries.get(0).getStreet());
jcglry.setCommittee(yxries.get(0).getCommittee());
jcglry.setCommunity(yxries.get(0).getCommunity());
......@@ -50,7 +52,7 @@ public class JcglTask
jcglry.setIsArea("0");
}
jcglries.add(jcglry);
yxrys.addAll(yxries);
// yxrys.addAll(yxries);
}
}
//更新解除隔离人员地址
......@@ -58,18 +60,26 @@ public class JcglTask
jcglryMapper.updateBatch(jcglries);
}
//更新阳性是否解除隔离
if (!yxrys.isEmpty()){
for (Yxry yxry : yxries) {
List<Jcglry> jcglryList = list.stream().filter(l->l.getCardNo().equals(yxry.getCardNo())).collect(Collectors.toList());
if (!jcglryList.isEmpty())
yxry.setIsDeisolation("1");
else
yxry.setIsDeisolation("0");
}
if (!yxries.isEmpty()){
yxryMapper.updateBatch(yxrys);
}
//更新方舱人员会否阳性
List<Fcry> fcries = new ArrayList<>();
List<Fcry> fcryList = fcryMapper.selectAll();
for (Fcry fcry : fcryList) {
List<Yxry> yxries = yxryMapper.selectYxryByCard(fcry.getCardNo());
if (!yxries.isEmpty()){
List<Yxry> yxrieList = yxries.stream().filter(l->l.getCardNo().equals(fcry.getCardNo())).collect(Collectors.toList());
if (!yxrieList.isEmpty())
fcry.setIsPositive("1");
fcries.add(fcry);
}
else
fcry.setIsPositive("0");
fcries.add(fcry);
}
if (!fcries.isEmpty()){
fcryMapper.updateBatch(fcries);
......@@ -78,11 +88,12 @@ public class JcglTask
List<Gldry> gldries = new ArrayList<>();
List<Gldry> gldryList = gldryMapper.selectAll();
for (Gldry gldry : gldryList) {
List<Yxry> yxries = yxryMapper.selectYxryByCard(gldry.getCardNo());
if (!yxries.isEmpty()){
List<Yxry> yxrieList = yxries.stream().filter(l->l.getCardNo().equals(gldry.getCardNo())).collect(Collectors.toList());
if (!yxrieList.isEmpty())
gldry.setIsYx("1");
gldries.add(gldry);
}
else
gldry.setIsYx("0");
gldries.add(gldry);
}
if (!gldries.isEmpty()){
gldryMapper.updateBatch(gldries);
......
......@@ -72,4 +72,6 @@ public interface YxryMapper
int selectNum(Yxry userType);
int updateBatch(@Param("list")List<Yxry> list);
List<Yxry> selectAll();
}
......@@ -199,7 +199,7 @@
<if test="floor != null">floor,</if>
<if test="committee != null">committee,</if>
<if test="positiveOnly != null">positive_only,</if>
<if test="isPositive != null">is_positive,</if>
is_positive,
<if test="checkCard != null">check_card,</if>
<if test="peopleType != null">people_type,</if>
<if test="otherFcTime != null">other_fc_time,</if>
......@@ -229,7 +229,7 @@
<if test="floor != null">#{floor},</if>
<if test="committee != null">#{committee},</if>
<if test="positiveOnly != null">#{positiveOnly},</if>
<if test="isPositive != null">#{isPositive},</if>
null,
<if test="checkCard != null">#{checkCard},</if>
<if test="peopleType != null">#{peopleType},</if>
<if test="otherFcTime != null">#{otherFcTime},</if>
......@@ -243,7 +243,7 @@
<foreach item="item" index="index" collection="list" separator=",">
(#{item.fcPlace},#{item.room},#{item.jzName},#{item.cardNo},#{item.phone},#{item.area},#{item.street},#{item.community},#{item.floor},#{item.committee},
#{item.unit},#{item.doorplate},#{item.zrTime},#{item.zcTime},#{item.glPlace},#{item.createBy},
#{item.createTime},#{item.remark},#{item.checkCard},#{item.isPositive},#{item.positiveOnly},#{item.peopleType},#{item.otherFcTime},#{item.otherGldTime})
#{item.createTime},#{item.remark},#{item.checkCard},null,#{item.positiveOnly},#{item.peopleType},#{item.otherFcTime},#{item.otherGldTime})
</foreach>
</insert>
......@@ -284,7 +284,7 @@
<update id="updateBatch" parameterType="com.ruoyi.system.domain.Fcry">
<foreach item="item" index="index" collection="list" separator=";">
update fcry set is_positive = '1'
update fcry set is_positive = #{item.isPositive}
where id = #{item.id}
</foreach>
</update>
......
......@@ -115,7 +115,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="jzName != null">jz_name,</if>
<if test="cardNo != null">card_no,</if>
<if test="phone != null">phone,</if>
<if test="isYx != null">is_yx,</if>
is_yx,
<if test="area != null">area,</if>
<if test="street != null">street,</if>
<if test="community != null">community,</if>
......@@ -142,7 +142,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="jzName != null">#{jzName},</if>
<if test="cardNo != null">#{cardNo},</if>
<if test="phone != null">#{phone},</if>
<if test="isYx != null">#{isYx},</if>
null,
<if test="area != null">#{area},</if>
<if test="street != null">#{street},</if>
<if test="community != null">#{community},</if>
......@@ -200,7 +200,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<update id="updateBatch" parameterType="com.ruoyi.system.domain.Gldry">
<foreach item="item" index="index" collection="list" separator=";">
update gldry set is_yx = '1'
update gldry set is_yx = #{item.isYx}
where id = #{item.id}
</foreach>
</update>
......
......@@ -356,8 +356,13 @@
<update id="updateBatch" parameterType="com.ruoyi.system.domain.Yxry">
<foreach item="item" index="index" collection="list" separator=";">
update yxry set is_deisolation = '1'
update yxry set is_deisolation = #{item.isDeisolation}
where id = #{item.id}
</foreach>
</update>
<select id="selectAll" resultMap="YxryResult">
<include refid="selectYxryVo"/>
where del_flag = '0'
</select>
</mapper>
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