人员管理证书bug修复
This commit is contained in:
parent
f2e534d7bc
commit
a3ce537251
|
|
@ -40,14 +40,14 @@ public class GtVo
|
|||
|
||||
/** 经度 */
|
||||
@NotBlank(message = "经度不能为空", groups = {GtVo.Query.class})
|
||||
@Length(max = 32, message = "经度长度不能超过32", groups = {GtVo.Query.class})
|
||||
@Pattern(regexp = "^-?((\\d{1,2}|1[0-7]\\d|180)(\\.\\d{1,6})?)$", message = "经度格式不正确", groups = {GtVo.Query.class})
|
||||
@Length(max = 20, message = "经度长度不能超过32", groups = {GtVo.Query.class})
|
||||
@Pattern(regexp = "^-?((\\d{1,2}|1[0-7]\\d|180)(\\.\\d{1,6})?)$", message = "经度范围不正确,或者小数点后尾数超过6位", groups = {GtVo.Query.class})
|
||||
private String lon;
|
||||
|
||||
/** 纬度 */
|
||||
@NotBlank(message = "纬度不能为空", groups = {GtVo.Query.class})
|
||||
@Length(max = 32, message = "纬度长度不能超过32", groups = {GtVo.Query.class})
|
||||
@Pattern(regexp = "^-?([0-8]?\\d(\\.\\d{1,6})?|90(\\.0{1,6})?)$", message = "纬度格式不正确", groups = {GtVo.Query.class})
|
||||
@Length(max = 20, message = "纬度长度不能超过32", groups = {GtVo.Query.class})
|
||||
@Pattern(regexp = "^-?([0-8]?\\d(\\.\\d{1,6})?|90(\\.0{1,6})?)$", message = "纬度范围不正确,或者小数点后尾数超过6位", groups = {GtVo.Query.class})
|
||||
private String lat;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -104,7 +104,7 @@ public class PersonVo implements Serializable {
|
|||
/**
|
||||
* 证书数量
|
||||
*/
|
||||
private Integer certificateNum;
|
||||
private int certificateNum;
|
||||
|
||||
/**
|
||||
* 资源类型
|
||||
|
|
|
|||
|
|
@ -124,38 +124,44 @@ public class PersonMgeController extends BaseController {
|
|||
for (int i = 0; i < delhighfile.length; i++) {
|
||||
String high = String.valueOf(delhighfile[i]);
|
||||
Integer certicificateId = mapper.getHighId(high);
|
||||
if(certicificateId==null){
|
||||
return AjaxResult.error("被删除的高出作业证图片资源无法找到");
|
||||
}
|
||||
// if(certicificateId==null){
|
||||
// return AjaxResult.error("被删除的高出作业证图片资源无法找到");
|
||||
// }
|
||||
if(certicificateId!=null) {
|
||||
mapper.delHigh(certicificateId);
|
||||
mapper.delHighFile(high, certicificateId);
|
||||
remoteFileService.delFile(high, SecurityConstants.INNER);
|
||||
}
|
||||
}
|
||||
}
|
||||
if(delelectfile != null) {
|
||||
for (int i = 0; i < delelectfile.length; i++) {
|
||||
String elect = String.valueOf(delelectfile[i]);
|
||||
Integer certicificateId = mapper.getElectId(elect);
|
||||
if(certicificateId==null){
|
||||
return AjaxResult.error("被删除的电工作业证作业证图片资源无法找到");
|
||||
}
|
||||
// if(certicificateId==null){
|
||||
// return AjaxResult.error("被删除的电工作业证作业证图片资源无法找到");
|
||||
// }
|
||||
if(certicificateId!=null) {
|
||||
mapper.delElect(certicificateId);
|
||||
mapper.delElectFile(elect,certicificateId);
|
||||
remoteFileService.delFile(elect,SecurityConstants.INNER);
|
||||
mapper.delElectFile(elect, certicificateId);
|
||||
remoteFileService.delFile(elect, SecurityConstants.INNER);
|
||||
}
|
||||
}
|
||||
}
|
||||
if(delelsefile != null){
|
||||
for (int i = 0; i < delelsefile.length; i++) {
|
||||
String elseFile = String.valueOf(delelsefile[i]);
|
||||
Integer certicificateId = mapper.getElseId(elseFile);
|
||||
if(certicificateId==null){
|
||||
return AjaxResult.error("被删除的其他作业证作业证图片资源无法找到");
|
||||
}
|
||||
// if(certicificateId==null){
|
||||
// return AjaxResult.error("被删除的其他作业证作业证图片资源无法找到");
|
||||
// }
|
||||
if(certicificateId!=null){
|
||||
mapper.delElse(certicificateId);
|
||||
mapper.delElseFile(elseFile,certicificateId);
|
||||
remoteFileService.delFile(elseFile,SecurityConstants.INNER);
|
||||
}
|
||||
}
|
||||
}
|
||||
return service.updateCertificate(highfile,electfile,elsefile,id);
|
||||
|
||||
}catch (Exception e){
|
||||
|
|
|
|||
|
|
@ -97,6 +97,13 @@ public interface PersonMgeMapper {
|
|||
*/
|
||||
List<PersonVo> getPersonLists(BraceletParamsDto dto);
|
||||
|
||||
/**
|
||||
* 获取人员证书数量
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
int getCertificateNum(Long id);
|
||||
|
||||
/**
|
||||
* 查询导出人员数据
|
||||
* @param dto
|
||||
|
|
|
|||
|
|
@ -84,10 +84,13 @@ public class PersonMgeServiceImpl implements IPersonMgeService {
|
|||
public List<PersonVo> getPersonLists(BraceletParamsDto dto) {
|
||||
dto.setSourceType(BusinessConstants.RESOURCE_TYPE_USER);
|
||||
List<PersonVo> list = new ArrayList<>();
|
||||
int num = 0;
|
||||
try {
|
||||
list = mapper.getPersonLists(dto);
|
||||
for (PersonVo vo : list) {
|
||||
vo = handleData(vo);
|
||||
num = mapper.getCertificateNum(vo.getId());
|
||||
vo.setCertificateNum(num);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("查询人员列表", e);
|
||||
|
|
|
|||
|
|
@ -85,8 +85,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
sfs.file_path AS filePath,
|
||||
sfs.id AS fileId,
|
||||
sdd.dict_label AS post,
|
||||
IFNULL(tp.is_push,0) AS isPush,
|
||||
count(tpc.id) as certificateNum
|
||||
IFNULL(tp.is_push,0) AS isPush
|
||||
FROM tb_people tp
|
||||
LEFT JOIN sys_dict_data sdd ON tp.post = sdd.dict_value AND sdd.dict_type = 'post_type' AND sdd.status = '0'
|
||||
LEFT JOIN sys_file_source sfs ON tp.id = sfs.source_id AND sfs.source_type = #{sourceType} AND sfs.del_flag = 0
|
||||
|
|
@ -98,9 +97,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="sex != null">
|
||||
AND tp.sex = #{sex}
|
||||
</if>
|
||||
GROUP BY tp.id,sfs.id,sfs.file_path
|
||||
Group by tp.id,sfs.file_path,sfs.id,sdd.dict_label
|
||||
ORDER BY tp.create_time DESC
|
||||
</select>
|
||||
|
||||
<!--获取人员证书数量-->
|
||||
<select id="getCertificateNum" resultType="java.lang.Integer">
|
||||
SELECT
|
||||
count(tpc.id) as certificateNum
|
||||
FROM tb_people_certificate tpc
|
||||
WHERE tpc.people_id = #{id}
|
||||
</select>
|
||||
|
||||
<!--验证安全帽编号是否重复、马甲编号是否重复-->
|
||||
<select id="codeIsExist" resultType="java.lang.Integer">
|
||||
<if test="type == 1">
|
||||
|
|
|
|||
Loading…
Reference in New Issue