Commit a61d88c1 authored by gaoyingwei's avatar gaoyingwei

修改 定时

parent 2b71587e
...@@ -211,8 +211,8 @@ public class FcryController extends BaseController ...@@ -211,8 +211,8 @@ public class FcryController extends BaseController
.map(SysDictData::getDictLabel).collect(Collectors.toList()); .map(SysDictData::getDictLabel).collect(Collectors.toList());
String[] fc = labels.toArray(new String[]{}); String[] fc = labels.toArray(new String[]{});
ExcelUtil.setClassExcelAttribute(clazz,"fcPlace","combo",fc); ExcelUtil.setClassExcelAttribute(clazz,"fcPlace","combo",fc);
String[] isPositive = {"是","否"}; // String[] isPositive = {"阳","未阳"};
ExcelUtil.setClassExcelAttribute( clazz,"isPositive","combo",isPositive); // ExcelUtil.setClassExcelAttribute( clazz,"isPositive","combo",isPositive);
String[] positiveOnly = {"是","否"}; String[] positiveOnly = {"是","否"};
ExcelUtil.setClassExcelAttribute( clazz,"positiveOnly","combo",positiveOnly); ExcelUtil.setClassExcelAttribute( clazz,"positiveOnly","combo",positiveOnly);
// List<String> streetList = fkqkService.selectStreet(); // List<String> streetList = fkqkService.selectStreet();
......
...@@ -121,9 +121,9 @@ public class GldryController extends BaseController ...@@ -121,9 +121,9 @@ public class GldryController extends BaseController
// 设置 是否阳性 下拉框 // 设置 是否阳性 下拉框
List<SysDictData> isYxs = DictUtils.getDictCache("is_yx"); // List<SysDictData> isYxs = DictUtils.getDictCache("is_yx");
String[] isYx=isYxs.stream().map(SysDictData::getDictLabel).toArray(String[]::new); // String[] isYx=isYxs.stream().map(SysDictData::getDictLabel).toArray(String[]::new);
ExcelUtil.setClassExcelAttribute( clazz,"isYx","combo",isYx); // ExcelUtil.setClassExcelAttribute( clazz,"isYx","combo",isYx);
// // 设置 居住所在地 下拉框 // // 设置 居住所在地 下拉框
// List<SysDictData> dictResidentialArea = sysDictDataMapper.selectDictDataByType("residential_area"); // List<SysDictData> dictResidentialArea = sysDictDataMapper.selectDictDataByType("residential_area");
......
package com.ruoyi.quartz.task; package com.ruoyi.quartz.task;
import com.ruoyi.common.utils.StringUtils; import com.ruoyi.system.domain.Fcry;
import com.ruoyi.system.domain.Gldry;
import com.ruoyi.system.domain.Jcglry; import com.ruoyi.system.domain.Jcglry;
import com.ruoyi.system.domain.Yxry; import com.ruoyi.system.domain.Yxry;
import com.ruoyi.system.mapper.FcryMapper;
import com.ruoyi.system.mapper.GldryMapper;
import com.ruoyi.system.mapper.JcglryMapper; import com.ruoyi.system.mapper.JcglryMapper;
import com.ruoyi.system.mapper.YxryMapper; import com.ruoyi.system.mapper.YxryMapper;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -24,6 +27,10 @@ public class JcglTask ...@@ -24,6 +27,10 @@ public class JcglTask
private JcglryMapper jcglryMapper; private JcglryMapper jcglryMapper;
@Autowired @Autowired
private YxryMapper yxryMapper; private YxryMapper yxryMapper;
@Autowired
private GldryMapper gldryMapper;
@Autowired
private FcryMapper fcryMapper;
public void updateAddress() public void updateAddress()
{ {
System.out.println("定时执行同步隔离人员"); System.out.println("定时执行同步隔离人员");
...@@ -46,12 +53,39 @@ public class JcglTask ...@@ -46,12 +53,39 @@ public class JcglTask
yxrys.addAll(yxries); yxrys.addAll(yxries);
} }
} }
//更新解除隔离人员地址
if (!jcglries.isEmpty()){ if (!jcglries.isEmpty()){
jcglryMapper.updateBatch(jcglries); jcglryMapper.updateBatch(jcglries);
} }
//更新阳性是否解除隔离
if (!jcglries.isEmpty()){ if (!jcglries.isEmpty()){
yxryMapper.updateBatch(yxrys); 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()){
// fcry.setIsPositive("1");
fcries.add(fcry);
}
}
if (!fcries.isEmpty()){
fcryMapper.updateBatch(fcries);
}
//更新隔离点人员是否阳性
List<Gldry> gldries = new ArrayList<>();
List<Gldry> gldryList = gldryMapper.selectAll();
for (Gldry gldry : gldryList) {
List<Yxry> yxries = yxryMapper.selectYxryByCard(gldry.getCardNo());
if (!yxries.isEmpty()){
// gldry.setIsYx("1");
gldries.add(gldry);
}
}
if (!gldries.isEmpty()){
gldryMapper.updateBatch(gldries);
}
} }
} }
...@@ -43,7 +43,7 @@ public class FcryDTO extends BaseEntity ...@@ -43,7 +43,7 @@ public class FcryDTO extends BaseEntity
@Excel(name = "人员类别") @Excel(name = "人员类别")
private String peopleType; private String peopleType;
/** 是否疾控判定阳性 */ /** 是否疾控判定阳性 */
@Excel(name = "是否疾控判定阳性",dictType = "is_positive",combo = "") @Excel(name = "是否阳性",dictType = "is_yx",type = Excel.Type.EXPORT)
private String isPositive; private String isPositive;
/** 仅抗原阳性 */ /** 仅抗原阳性 */
@Excel(name = "仅抗原阳性",dictType = "positive_only",combo = "") @Excel(name = "仅抗原阳性",dictType = "positive_only",combo = "")
......
...@@ -47,7 +47,7 @@ public class Gldry extends BaseEntity ...@@ -47,7 +47,7 @@ public class Gldry extends BaseEntity
/** 是否阳性(阳,未阳) */ /** 是否阳性(阳,未阳) */
// 新增字段 // 新增字段
@Excel(name = "是否阳性",dictType = "is_yx") @Excel(name = "是否阳性",dictType = "is_yx",type = Excel.Type.EXPORT)
private String isYx; private String isYx;
/** 居住地所在区 */ /** 居住地所在区 */
......
...@@ -73,4 +73,8 @@ public interface FcryMapper ...@@ -73,4 +73,8 @@ public interface FcryMapper
int selectToday(@Param("date") LocalDate date); int selectToday(@Param("date") LocalDate date);
int selectCurrent(); int selectCurrent();
List<Fcry> selectAll();
int updateBatch(@Param("list") List<Fcry> list);
} }
...@@ -72,4 +72,8 @@ public interface GldryMapper ...@@ -72,4 +72,8 @@ public interface GldryMapper
int selectToday(@Param("date") LocalDate date); int selectToday(@Param("date") LocalDate date);
int selectCurrent(); int selectCurrent();
List<Gldry> selectAll();
int updateBatch(@Param("list") List<Gldry> list);
} }
...@@ -297,9 +297,9 @@ public class HscjServiceImpl implements IHscjService { ...@@ -297,9 +297,9 @@ public class HscjServiceImpl implements IHscjService {
} }
if (!trueList.isEmpty()) { if (!trueList.isEmpty()) {
// 循环批量添加数据 // 循环批量添加数据
int toIndex = 400; int toIndex = 500;
for (int i = 0; i < trueList.size(); i += 400) { for (int i = 0; i < trueList.size(); i += 500) {
if (i + 400 > trueList.size()) { if (i + 500 > trueList.size()) {
toIndex = trueList.size() - i; toIndex = trueList.size() - i;
} }
List<Hscj> list1 = trueList.subList(i, i + toIndex); List<Hscj> list1 = trueList.subList(i, i + toIndex);
......
...@@ -103,6 +103,12 @@ ...@@ -103,6 +103,12 @@
<include refid="selectFcryVo"/> <include refid="selectFcryVo"/>
where id = #{id} where id = #{id}
</select> </select>
<select id="selectAll" resultMap="FcryResult">
<include refid="selectFcryVo"/>
where del_flag = '0'
</select>
<select id="selectFcryByCard" resultMap="FcryResult"> <select id="selectFcryByCard" resultMap="FcryResult">
select a.id, select a.id,
a.fc_place, a.fc_place,
...@@ -265,6 +271,14 @@ ...@@ -265,6 +271,14 @@
</trim> </trim>
where id = #{id} where id = #{id}
</update> </update>
<update id="updateBatch" parameterType="com.ruoyi.system.domain.Fcry">
<foreach item="item" index="index" collection="list" separator=";">
update fcry set is_positive = '1'
where id = #{item.id}
</foreach>
</update>
<insert id="updateBatchFcry" parameterType="com.ruoyi.system.domain.Fcry"> <insert id="updateBatchFcry" parameterType="com.ruoyi.system.domain.Fcry">
<foreach item="item" index="index" collection="list" separator=";"> <foreach item="item" index="index" collection="list" separator=";">
update fcry update fcry
......
...@@ -71,6 +71,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -71,6 +71,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where id = #{id} where id = #{id}
</select> </select>
<select id="selectAll" resultMap="GldryResult">
<include refid="selectGldryVo"/>
where del_flag = '0'
</select>
<select id="selectGldryByCard" resultType="com.ruoyi.system.domain.Gldry"> <select id="selectGldryByCard" resultType="com.ruoyi.system.domain.Gldry">
<include refid="selectGldryVo"/> <include refid="selectGldryVo"/>
where card_no = #{cardNo} and del_flag = '0' where card_no = #{cardNo} and del_flag = '0'
...@@ -183,6 +188,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -183,6 +188,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where id = #{id} where id = #{id}
</update> </update>
<update id="updateBatch" parameterType="com.ruoyi.system.domain.Gldry">
<foreach item="item" index="index" collection="list" separator=";">
update gldry set is_yx = '1'
where id = #{item.id}
</foreach>
</update>
<delete id="deleteGldryById" parameterType="Long"> <delete id="deleteGldryById" parameterType="Long">
delete from gldry where id = #{id} delete from gldry where id = #{id}
</delete> </delete>
......
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