人员管理证书bug修复
This commit is contained in:
parent
f2e534d7bc
commit
a3ce537251
|
|
@ -40,14 +40,14 @@ public class GtVo
|
||||||
|
|
||||||
/** 经度 */
|
/** 经度 */
|
||||||
@NotBlank(message = "经度不能为空", groups = {GtVo.Query.class})
|
@NotBlank(message = "经度不能为空", groups = {GtVo.Query.class})
|
||||||
@Length(max = 32, message = "经度长度不能超过32", 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 = "经度格式不正确", 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;
|
private String lon;
|
||||||
|
|
||||||
/** 纬度 */
|
/** 纬度 */
|
||||||
@NotBlank(message = "纬度不能为空", groups = {GtVo.Query.class})
|
@NotBlank(message = "纬度不能为空", groups = {GtVo.Query.class})
|
||||||
@Length(max = 32, message = "纬度长度不能超过32", 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 = "纬度格式不正确", 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;
|
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++) {
|
for (int i = 0; i < delhighfile.length; i++) {
|
||||||
String high = String.valueOf(delhighfile[i]);
|
String high = String.valueOf(delhighfile[i]);
|
||||||
Integer certicificateId = mapper.getHighId(high);
|
Integer certicificateId = mapper.getHighId(high);
|
||||||
if(certicificateId==null){
|
// if(certicificateId==null){
|
||||||
return AjaxResult.error("被删除的高出作业证图片资源无法找到");
|
// return AjaxResult.error("被删除的高出作业证图片资源无法找到");
|
||||||
}
|
// }
|
||||||
|
if(certicificateId!=null) {
|
||||||
mapper.delHigh(certicificateId);
|
mapper.delHigh(certicificateId);
|
||||||
mapper.delHighFile(high, certicificateId);
|
mapper.delHighFile(high, certicificateId);
|
||||||
remoteFileService.delFile(high, SecurityConstants.INNER);
|
remoteFileService.delFile(high, SecurityConstants.INNER);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if(delelectfile != null) {
|
if(delelectfile != null) {
|
||||||
for (int i = 0; i < delelectfile.length; i++) {
|
for (int i = 0; i < delelectfile.length; i++) {
|
||||||
String elect = String.valueOf(delelectfile[i]);
|
String elect = String.valueOf(delelectfile[i]);
|
||||||
Integer certicificateId = mapper.getElectId(elect);
|
Integer certicificateId = mapper.getElectId(elect);
|
||||||
if(certicificateId==null){
|
// if(certicificateId==null){
|
||||||
return AjaxResult.error("被删除的电工作业证作业证图片资源无法找到");
|
// return AjaxResult.error("被删除的电工作业证作业证图片资源无法找到");
|
||||||
}
|
// }
|
||||||
|
if(certicificateId!=null) {
|
||||||
mapper.delElect(certicificateId);
|
mapper.delElect(certicificateId);
|
||||||
mapper.delElectFile(elect, certicificateId);
|
mapper.delElectFile(elect, certicificateId);
|
||||||
remoteFileService.delFile(elect, SecurityConstants.INNER);
|
remoteFileService.delFile(elect, SecurityConstants.INNER);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if(delelsefile != null){
|
if(delelsefile != null){
|
||||||
for (int i = 0; i < delelsefile.length; i++) {
|
for (int i = 0; i < delelsefile.length; i++) {
|
||||||
String elseFile = String.valueOf(delelsefile[i]);
|
String elseFile = String.valueOf(delelsefile[i]);
|
||||||
Integer certicificateId = mapper.getElseId(elseFile);
|
Integer certicificateId = mapper.getElseId(elseFile);
|
||||||
if(certicificateId==null){
|
// if(certicificateId==null){
|
||||||
return AjaxResult.error("被删除的其他作业证作业证图片资源无法找到");
|
// return AjaxResult.error("被删除的其他作业证作业证图片资源无法找到");
|
||||||
}
|
// }
|
||||||
|
if(certicificateId!=null){
|
||||||
mapper.delElse(certicificateId);
|
mapper.delElse(certicificateId);
|
||||||
mapper.delElseFile(elseFile,certicificateId);
|
mapper.delElseFile(elseFile,certicificateId);
|
||||||
remoteFileService.delFile(elseFile,SecurityConstants.INNER);
|
remoteFileService.delFile(elseFile,SecurityConstants.INNER);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return service.updateCertificate(highfile,electfile,elsefile,id);
|
return service.updateCertificate(highfile,electfile,elsefile,id);
|
||||||
|
|
||||||
}catch (Exception e){
|
}catch (Exception e){
|
||||||
|
|
|
||||||
|
|
@ -97,6 +97,13 @@ public interface PersonMgeMapper {
|
||||||
*/
|
*/
|
||||||
List<PersonVo> getPersonLists(BraceletParamsDto dto);
|
List<PersonVo> getPersonLists(BraceletParamsDto dto);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取人员证书数量
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
int getCertificateNum(Long id);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询导出人员数据
|
* 查询导出人员数据
|
||||||
* @param dto
|
* @param dto
|
||||||
|
|
|
||||||
|
|
@ -84,10 +84,13 @@ public class PersonMgeServiceImpl implements IPersonMgeService {
|
||||||
public List<PersonVo> getPersonLists(BraceletParamsDto dto) {
|
public List<PersonVo> getPersonLists(BraceletParamsDto dto) {
|
||||||
dto.setSourceType(BusinessConstants.RESOURCE_TYPE_USER);
|
dto.setSourceType(BusinessConstants.RESOURCE_TYPE_USER);
|
||||||
List<PersonVo> list = new ArrayList<>();
|
List<PersonVo> list = new ArrayList<>();
|
||||||
|
int num = 0;
|
||||||
try {
|
try {
|
||||||
list = mapper.getPersonLists(dto);
|
list = mapper.getPersonLists(dto);
|
||||||
for (PersonVo vo : list) {
|
for (PersonVo vo : list) {
|
||||||
vo = handleData(vo);
|
vo = handleData(vo);
|
||||||
|
num = mapper.getCertificateNum(vo.getId());
|
||||||
|
vo.setCertificateNum(num);
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("查询人员列表", e);
|
log.error("查询人员列表", e);
|
||||||
|
|
|
||||||
|
|
@ -85,8 +85,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
sfs.file_path AS filePath,
|
sfs.file_path AS filePath,
|
||||||
sfs.id AS fileId,
|
sfs.id AS fileId,
|
||||||
sdd.dict_label AS post,
|
sdd.dict_label AS post,
|
||||||
IFNULL(tp.is_push,0) AS isPush,
|
IFNULL(tp.is_push,0) AS isPush
|
||||||
count(tpc.id) as certificateNum
|
|
||||||
FROM tb_people tp
|
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_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
|
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">
|
<if test="sex != null">
|
||||||
AND tp.sex = #{sex}
|
AND tp.sex = #{sex}
|
||||||
</if>
|
</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
|
ORDER BY tp.create_time DESC
|
||||||
</select>
|
</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">
|
<select id="codeIsExist" resultType="java.lang.Integer">
|
||||||
<if test="type == 1">
|
<if test="type == 1">
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue