Commit d315935c authored by gaoyingwei's avatar gaoyingwei

修改 定时

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