人员导出

This commit is contained in:
cwchen 2024-08-09 09:16:00 +08:00
parent 62fdcdce89
commit 35497fd30b
5 changed files with 53 additions and 2 deletions

View File

@ -90,7 +90,7 @@ public class ExportFileController {
public void exportPerson(HttpServletRequest request, HttpServletResponse response, BraceletParamsDto dto) {
try {
List<PersonExportVo> personExportVoList = new ArrayList<>();
List<PersonVo> personLists = iPersonMgeService.getPersonLists(dto);
List<PersonVo> personLists = iPersonMgeService.getExportPersonLists(dto);
for (int i = 0; i < personLists.size(); i++) {
PersonExportVo exportVo = new PersonExportVo();
PersonVo vo = personLists.get(i);

View File

@ -97,6 +97,15 @@ public interface PersonMgeMapper {
*/
List<PersonVo> getPersonLists(BraceletParamsDto dto);
/**
* 查询导出人员数据
* @param dto
* @return List<PersonVo>
* @author cwchen
* @date 2024/8/9 8:54
*/
List<PersonVo> getExportPersonLists(BraceletParamsDto dto);
/**
* 验证安全帽编号马甲编码是否存在
*

View File

@ -91,4 +91,13 @@ public interface IPersonMgeService {
public AjaxResult updateCertificate(@RequestPart(value = "highfile") MultipartFile[] highfile, @RequestPart(value = "electfile") MultipartFile[] electfile,
@RequestPart(value = "elsefile") MultipartFile[] elsefile, @RequestBody Long id);
/**
* 获取人员导出数据
* @param dto
* @return List<PersonVo>
* @author cwchen
* @date 2024/8/9 8:51
*/
List<PersonVo> getExportPersonLists(BraceletParamsDto dto);
}

View File

@ -88,6 +88,20 @@ public class PersonMgeServiceImpl implements IPersonMgeService {
return list;
}
@Override
public List<PersonVo> getExportPersonLists(BraceletParamsDto dto) {
List<PersonVo> list = new ArrayList<>();
try {
list = mapper.getExportPersonLists(dto);
for (PersonVo vo : list) {
vo = handleData(vo);
}
} catch (Exception e) {
log.error(e.toString(), e);
}
return list;
}
@Override
@Transactional(rollbackFor = Exception.class)
public AjaxResult addPerson(MultipartFile file, String params) {

View File

@ -100,7 +100,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</if>
GROUP BY tp.id,sfs.id,sfs.file_path
ORDER BY tp.id
ORDER BY tp.update_time DESC
</select>
<!--验证安全帽编号是否重复、马甲编号是否重复-->
<select id="codeIsExist" resultType="java.lang.Integer">
@ -221,6 +221,25 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
from tb_people_certificate
where people_id = #{id}
</select>
<!--查询导出人员数据-->
<select id="getExportPersonLists" resultType="com.bonus.common.entity.bracelet.vo.PersonVo">
SELECT tp.id,
tp.name,
tp.sex,
tp.id_card AS idCard,
tp.phone,
tp.aqm_code AS aqmCode,
tp.mj_code AS mjCode
FROM tb_people tp
WHERE tp.del_flag = 0
<if test="name != null and name!=''">
AND INSTR(tp.name,#{name}) > 0
</if>
<if test="sex != null">
AND tp.sex = #{sex}
</if>
ORDER BY tp.update_time DESC
</select>
<!--删除资源文件-->
<update id="delCertificateResourceFile">