Commit 4f33e906 authored by gaoyingwei's avatar gaoyingwei

修改 阳性人员下载模板

parent 30eaf855
...@@ -113,7 +113,7 @@ public class YxryController extends BaseController ...@@ -113,7 +113,7 @@ public class YxryController extends BaseController
} }
@PostMapping("/importTemplate") @PostMapping("/importTemplate")
@PreAuthorize("@ss.hasPermi('system:yxry:add')") @PreAuthorize("@ss.hasPermi('system:yxry:import')")
@Log(title = "下载阳性人员模板", businessType = BusinessType.IMPORT) @Log(title = "下载阳性人员模板", businessType = BusinessType.IMPORT)
public void importTemplate(HttpServletResponse response) throws Exception { public void importTemplate(HttpServletResponse response) throws Exception {
ExcelUtil<Yxry> util = new ExcelUtil<Yxry>(Yxry.class); ExcelUtil<Yxry> util = new ExcelUtil<Yxry>(Yxry.class);
...@@ -143,7 +143,7 @@ public class YxryController extends BaseController ...@@ -143,7 +143,7 @@ public class YxryController extends BaseController
} }
@Log(title = "导入阳性人员", businessType = BusinessType.IMPORT) @Log(title = "导入阳性人员", businessType = BusinessType.IMPORT)
@PreAuthorize("@ss.hasPermi('system:yxry:add')") @PreAuthorize("@ss.hasPermi('system:yxry:import')")
@PostMapping("/importData") @PostMapping("/importData")
public void importData(MultipartFile file, HttpServletResponse response) throws Exception public void importData(MultipartFile file, HttpServletResponse response) throws Exception
{ {
......
...@@ -2,6 +2,8 @@ package com.ruoyi.system.mapper; ...@@ -2,6 +2,8 @@ package com.ruoyi.system.mapper;
import java.util.List; import java.util.List;
import com.ruoyi.system.domain.Yxry; import com.ruoyi.system.domain.Yxry;
import com.ruoyi.system.domain.Zlqk;
import org.apache.ibatis.annotations.Param;
/** /**
* 阳性人员Mapper接口 * 阳性人员Mapper接口
...@@ -58,4 +60,8 @@ public interface YxryMapper ...@@ -58,4 +60,8 @@ public interface YxryMapper
* @return 结果 * @return 结果
*/ */
public int deleteYxryByIds(Long[] ids); public int deleteYxryByIds(Long[] ids);
List<Yxry> selectYxryByCard(String cardNo);
int insertBatchYxry(@Param("list")List<Yxry> list);
} }
...@@ -123,39 +123,43 @@ public class YxryServiceImpl implements IYxryService ...@@ -123,39 +123,43 @@ public class YxryServiceImpl implements IYxryService
List<Yxry> trueList = new ArrayList<>(); List<Yxry> trueList = new ArrayList<>();
List<Yxry> failureList = new ArrayList<>(); List<Yxry> failureList = new ArrayList<>();
for (Yxry zlqk : list) { for (Yxry zlqk : list) {
// if (StringUtils.isNotEmpty(zlqk.getCardNo()) && StringUtils.isNotEmpty(zlqk.getUserName()) if (StringUtils.isNotEmpty(zlqk.getCardNo()) && StringUtils.isNotEmpty(zlqk.getUserName())
// &&StringUtils.isNotEmpty(zlqk.getPhone()) && zlqk.getSbDate() != null &&StringUtils.isNotEmpty(zlqk.getPhone())
// &&StringUtils.isNotEmpty(zlqk.getRemark()) && StringUtils.isNotEmpty(zlqk.getMedication())){ &&StringUtils.isNotEmpty(zlqk.getIsYin()) && StringUtils.isNotEmpty(zlqk.getGlPlace())){
// //校验身份证是否重复 //校验身份证是否重复
// List<Zlqk> zlqks = zlqkMapper.selectZlqkByCard(zlqk.getCardNo()); List<Yxry> zlqks = yxryMapper.selectYxryByCard(zlqk.getCardNo());
// if (!zlqks.isEmpty()) if (!zlqks.isEmpty())
// failureList.add(zlqk); failureList.add(zlqk);
// else { else {
// zlqks = list.stream().filter(l -> zlqk.getCardNo().equals(l.getCardNo())).collect(Collectors.toList()); zlqks = list.stream().filter(l -> zlqk.getCardNo().equals(l.getCardNo())).collect(Collectors.toList());
// if (zlqks.size()>1) if (zlqks.size()>1)
// failureList.add(zlqk); failureList.add(zlqk);
// else { else {
// if (CheckUtils.checkCard(zlqk.getCardNo())) if (!CheckUtils.checkPhone(zlqk.getPhone())) {
// zlqk.setCheckCard("正确"); failureList.add(zlqk);
// else } else {
// zlqk.setCheckCard("不正确"); if (CheckUtils.checkCard(zlqk.getCardNo()))
// trueList.add(zlqk); zlqk.setCheckCard("正确");
// } else
// } zlqk.setCheckCard("不正确");
// } else if (StringUtils.isEmpty(zlqk.getCardNo()) || StringUtils.isEmpty(zlqk.getUserName()) trueList.add(zlqk);
// &&StringUtils.isEmpty(zlqk.getPhone()) || zlqk.getSbDate() == null }
// &&StringUtils.isEmpty(zlqk.getRemark()) || StringUtils.isEmpty(zlqk.getMedication())) { }
// continue; }
// } else { } else if (StringUtils.isEmpty(zlqk.getCardNo()) && StringUtils.isEmpty(zlqk.getUserName())
// failureList.add(zlqk); &&StringUtils.isEmpty(zlqk.getPhone())
// } &&StringUtils.isEmpty(zlqk.getIsYin()) && StringUtils.isEmpty(zlqk.getGlPlace())) {
continue;
} else {
failureList.add(zlqk);
}
} }
if (!trueList.isEmpty()){ if (!trueList.isEmpty()){
for (Yxry zlqk : trueList) { for (Yxry zlqk : trueList) {
zlqk.setCreateBy(String.valueOf(SecurityUtils.getUserId())); zlqk.setCreateBy(String.valueOf(SecurityUtils.getUserId()));
zlqk.setCreateTime(DateUtils.getNowDate()); zlqk.setCreateTime(DateUtils.getNowDate());
} }
// zlqkMapper.insertBatchZlqk(trueList); yxryMapper.insertBatchYxry(trueList);
} }
if (!failureList.isEmpty()) { if (!failureList.isEmpty()) {
ExcelUtil<Yxry> util = new ExcelUtil<Yxry>(Yxry.class); ExcelUtil<Yxry> util = new ExcelUtil<Yxry>(Yxry.class);
......
...@@ -30,17 +30,27 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -30,17 +30,27 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="remark" column="remark" /> <result property="remark" column="remark" />
<result property="address" column="address" /> <result property="address" column="address" />
<result property="isYz" column="is_yz" /> <result property="isYz" column="is_yz" />
<result property="isYin" column="is_yin" />
<result property="fcName" column="fc_name" />
<result property="glName" column="gl_name" />
<result property="checkCard" column="check_card" />
<result property="zyTime" column="zy_time" />
<result property="userType" column="user_type" />
<result property="riskSource" column="risk_source" />
<result property="isHome" column="is_home" />
</resultMap> </resultMap>
<sql id="selectYxryVo"> <sql id="selectYxryVo">
select id, sb_date, ldry, user_name, card_no, phone, area, street, isolation_status, is_control, community, unit,house,building, select id, sb_date, ldry, user_name, card_no, phone, area, street, isolation_status, is_control, community, unit,house,building,
has_acid, gl_place, status, del_flag, create_by, create_time, update_by, update_time, remark, address, is_yz from yxry has_acid, gl_place, status, del_flag, create_by, create_time, update_by, update_time, remark, address, is_yz,is_yin,
is_home,risk_source,user_type,zy_time,check_card,gl_name,fc_name from yxry
</sql> </sql>
<select id="selectYxryList" parameterType="Yxry" resultMap="YxryResult"> <select id="selectYxryList" parameterType="Yxry" resultMap="YxryResult">
select a.id, a.sb_date, a.ldry, a.user_name, a.card_no, a.phone, a.area, a.street, a.isolation_status, select a.id, a.sb_date, a.ldry, a.user_name, a.card_no, a.phone, a.area, a.street, a.isolation_status,
a.is_control, a.community, a.unit, a.has_acid, a.status, a.del_flag, a.create_by, a.house, a.building, a.is_control, a.community, a.unit, a.has_acid, a.status, a.del_flag, a.create_by, a.house, a.building,
a.create_time, a.update_by, a.update_time, a.remark ,CONCAT(f.fc_place,f.room) gl_place, a.address,a.is_yz a.create_time, a.update_by, a.update_time, a.remark ,CONCAT(f.fc_place,f.room) gl_place, a.address,a.is_yz,a.is_yin,
a.is_home,a.risk_source,a.user_type,a.zy_time,a.check_card,a.gl_name,a.fc_name
from yxry a from yxry a
left join sys_user u on u.user_id = a.create_by left join sys_user u on u.user_id = a.create_by
left join sys_dept d on u.dept_id = d.dept_id left join sys_dept d on u.dept_id = d.dept_id
...@@ -72,6 +82,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -72,6 +82,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where id = #{id} where id = #{id}
</select> </select>
<select id="selectYxryByCard" resultType="com.ruoyi.system.domain.Yxry" parameterType="java.lang.String">
<include refid="selectYxryVo"/>
where del_flag = '0' and card_no = #{cardNo}
</select>
<insert id="insertYxry" parameterType="Yxry" useGeneratedKeys="true" keyProperty="id"> <insert id="insertYxry" parameterType="Yxry" useGeneratedKeys="true" keyProperty="id">
insert into yxry insert into yxry
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
...@@ -98,6 +113,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -98,6 +113,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="updateTime != null">update_time,</if> <if test="updateTime != null">update_time,</if>
<if test="remark != null">remark,</if> <if test="remark != null">remark,</if>
<if test="isYz != null">is_yz,</if> <if test="isYz != null">is_yz,</if>
<if test="isYin != null">is_yin,</if>
<if test="isHome != null">is_home,</if>
<if test="riskSource != null">risk_source,</if>
<if test="userType != null">user_type,</if>
<if test="zyTime != null">zy_time,</if>
<if test="checkCard != null">check_card,</if>
<if test="glName != null">gl_name,</if>
<if test="fcName != null">fc_name,</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="sbDate != null">#{sbDate},</if> <if test="sbDate != null">#{sbDate},</if>
...@@ -123,9 +146,29 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -123,9 +146,29 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="updateTime != null">#{updateTime},</if> <if test="updateTime != null">#{updateTime},</if>
<if test="remark != null">#{remark},</if> <if test="remark != null">#{remark},</if>
<if test="isYz != null">#{isYz},</if> <if test="isYz != null">#{isYz},</if>
<if test="isYin != null">#{isYin},</if>
<if test="isHome != null">#{isHome},</if>
<if test="riskSource != null">#{riskSource},</if>
<if test="userType != null">#{userType},</if>
<if test="zyTime != null">#{zyTime},</if>
<if test="checkCard != null">#{checkCard},</if>
<if test="glName != null">#{glName},</if>
<if test="fcName != null">#{fcName},</if>
</trim> </trim>
</insert> </insert>
<insert id="insertBatchYxry" parameterType="com.ruoyi.system.domain.Yxry">
insert into yxry (sb_date,ldry,user_name,card_no,phone,area,street,isolation_status,is_control,community,unit,building,
house,has_acid,gl_place,create_by,create_time,remark,is_yz,is_yin,is_home,
risk_source,user_type,zy_time,check_card,gl_name,fc_name) values
<foreach item="item" index="index" collection="list" separator=",">
(#{item.sbDate},#{item.ldry},#{item.userName},#{item.cardNo},#{item.phone},#{item.area},#{item.street},
#{item.isolationStatus},#{item.isControl},#{item.community},#{item.unit},#{item.building},#{item.house},
#{item.hasAcid},#{item.glPlace},#{item.createBy},#{item.createTime},#{item.remark},#{item.isYz},#{item.isYin},
#{item.isHome},#{item.riskSource},#{item.userType},#{item.zyTime},#{item.checkCard},#{item.glName},#{item.fcName})
</foreach>
</insert>
<update id="updateYxry" parameterType="Yxry"> <update id="updateYxry" parameterType="Yxry">
update yxry update yxry
<trim prefix="SET" suffixOverrides=","> <trim prefix="SET" suffixOverrides=",">
...@@ -152,6 +195,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -152,6 +195,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="updateTime != null">update_time = #{updateTime},</if> <if test="updateTime != null">update_time = #{updateTime},</if>
<if test="remark != null">remark = #{remark},</if> <if test="remark != null">remark = #{remark},</if>
<if test="isYz != null">is_yz = #{isYz},</if> <if test="isYz != null">is_yz = #{isYz},</if>
<if test="isYin != null">is_yin = #{isYin},</if>
<if test="isHome != null">is_home = #{isHome},</if>
<if test="riskSource != null">risk_source = #{riskSource},</if>
<if test="userType != null">user_type = #{userType},</if>
<if test="zyTime != null">zy_time = #{zyTime},</if>
<if test="checkCard != null">check_card = #{checkCard},</if>
<if test="glName != null">gl_name = #{glName},</if>
<if test="fcName != null">fc_name = #{fcName},</if>
</trim> </trim>
where id = #{id} where id = #{id}
</update> </update>
......
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