问题修改

This commit is contained in:
cwchen 2024-09-29 11:04:43 +08:00
parent 1fd63a2a9c
commit b9ab775fab
6 changed files with 47 additions and 30 deletions

View File

@ -161,7 +161,11 @@
<artifactId>dom4j</artifactId>
<version>1.6.1</version>
</dependency>
<!--<dependency>
<groupId>org.redisson</groupId>
<artifactId>redisson-spring-boot-starter</artifactId>
<version>3.10.6</version>
</dependency>-->
</dependencies>
</project>

View File

@ -29,6 +29,8 @@ public class BusinessConstants {
public static final int TYPE2 = 2;
public static final int TYPE3 = 0;
public static final Long PARENT_ID = 0L;
public static final String PARENT_ID_STR = "0";
public static final String PARENT_ID_STR2 = "-1";
public static final Integer LEVEL = 4;
public static final Integer LEVEL1 = 1;
public static final Integer LEVEL2 = 2;

View File

@ -15,7 +15,7 @@ import java.util.List;
@Data
public class TeamPeopleTreeVo {
/**id*/
private Long id;
private String id;
/**名称*/
private String label;
/**手环编号*/
@ -23,7 +23,7 @@ public class TeamPeopleTreeVo {
/**手环级联编号*/
private String devCode;
/**父ID*/
private Long parentId;
private String parentId;
/**人员类型*/
private Integer userType;
private List<TeamPeopleTreeVo> children = new ArrayList<>();

View File

@ -333,8 +333,8 @@ public class ConsControlServiceImpl implements IConsControlService {
List<TeamPeopleTreeVo> list = new ArrayList<>();
list = mapper.getTeamPersonByTower(dto);
for (TeamPeopleTreeVo vo : list) {
//忽略工程数据
if (Objects.equals(vo.getParentId(), BusinessConstants.PARENT_ID) || Objects.equals(vo.getId(), BusinessConstants.PARENT_ID)) {
//忽略第一层级和第二层级 只保留人员层级
if (Objects.equals(vo.getParentId(), BusinessConstants.PARENT_ID_STR) || Objects.equals(vo.getParentId(), BusinessConstants.PARENT_ID_STR2)) {
continue;
}
String[] valArr = vo.getLabel().split("-");
@ -370,13 +370,34 @@ public class ConsControlServiceImpl implements IConsControlService {
return AjaxResult.error("手环编码不能为空");
}
}
// 批量下发手环人脸验证指令-未对接
StringBuilder sb = new StringBuilder();
List<BraceletParamsDto.SpotCheckInfo> spotCheckList = dto.getSpotCheckList();
for (BraceletParamsDto.SpotCheckInfo spotCheckInfo : spotCheckList) {
if(StringUtils.isNotBlank(spotCheckInfo.getShCode())){
sb.append(spotCheckInfo.getShCode()).append("@");
}
}
if(StringUtils.isNotBlank(sb) && (sb.lastIndexOf("@") == sb.length() - 1)){
sb.delete(sb.lastIndexOf("@"),sb.length());
}
// 批量下发手环人脸验证指令
} catch (Exception e) {
log.error(e.toString(), e);
}
return AjaxResult.success("已下达手环人脸验证抽检指令");
}
public static void main(String[] args) {
StringBuilder sb = new StringBuilder();
sb.append("str").append("@").append("bstr").append("@");
System.out.println(sb.lastIndexOf("@"));
System.out.println(sb.length() - 1);
if(sb.lastIndexOf("@") == sb.length() - 1){
sb.delete(sb.lastIndexOf("@"),sb.length());
}
System.err.println(sb.toString());
}
@Override
@Transactional(rollbackFor = Exception.class)
public AjaxResult checkConfig(CheckConfigVo vo) {

View File

@ -253,10 +253,17 @@ public class PersonMgeServiceImpl implements IPersonMgeService {
vo.setPhone(Sm4Utils.encode(vo.getPhone()));
mapper.editPerson(vo);
delFileId = uploadFile(file, vo);
if (StringUtils.isNotEmpty(vo.getDelFiles())) {
String personImgBase64 = getPersonImgBase64(vo.getDelFiles());
// 删除人脸库添加人脸照片至人脸库
AjaxResult delAjax = delFaceToLibrary(personImgBase64, FaceCodeUtil.DEL, "bz-" + vo.getId());
if (file!=null) {
if(StringUtils.isNotBlank(vo.getDelFiles())){
String personImgBase64 = getPersonImgBase64(vo.getDelFiles());
// 删除人脸库添加人脸照片至人脸库
AjaxResult delAjax = delFaceToLibrary(personImgBase64, FaceCodeUtil.DEL, "bz-" + vo.getId());
String[] delFiles = vo.getDelFiles().split(",");
for (String fileId : delFiles) {
resourceFileMapper.delResourceFile(vo.getFileId());
remoteFileService.delFile(fileId, SecurityConstants.INNER);
}
}
AjaxResult ajaxResult = addFaceToLibrary(BytesToMultipartFileUtil.multipartFileToBase64(file), FaceCodeUtil.ADD, "bz-" + vo.getId());
JSONObject data = JSONObject.parseObject(JSONObject.toJSONString(ajaxResult.get("data")));
Integer code = data.getInteger("code");
@ -267,11 +274,6 @@ public class PersonMgeServiceImpl implements IPersonMgeService {
}else{
mapper.updatePeoplePushStatus(vo.getId(),0);
}
String[] delFiles = vo.getDelFiles().split(",");
for (String fileId : delFiles) {
resourceFileMapper.delResourceFile(vo.getFileId());
remoteFileService.delFile(fileId, SecurityConstants.INNER);
}
}
} catch (Exception e) {
log.error("修改人员", e);
@ -472,18 +474,6 @@ public class PersonMgeServiceImpl implements IPersonMgeService {
if(StringUtils.isNotBlank(errorInfo)){
return AjaxResult.error(errorInfo);
}
/*if (StringUtils.isNotBlank(existData)) {
return AjaxResult.error(existData);
}
if (StringUtils.isNotBlank(existData2)) {
return AjaxResult.error(existData2);
}
if (StringUtils.isNotBlank(existData3)) {
return AjaxResult.error(existData3);
}
if (StringUtils.isNotBlank(existData4)) {
return AjaxResult.error(existData4);
}*/
// 校验库中数据的身份证号手机号安全帽编号马甲编号是否重复
List<Map<String, String>> personIsExist = mapper.personIsExist(new PersonVo());
List<Map<String, String>> aqmCodes = mapper.aqmCodeIsExist();

View File

@ -331,7 +331,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
null AS devCode,
null AS userType
UNION ALL
SELECT twt.team_id AS id,
SELECT DISTINCT CONCAT('team-',twt.team_id) AS id,
twt.team_name AS label,
0 AS parentId,
null AS shCode,
@ -343,7 +343,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
UNION ALL
SELECT tpe.id,
CONCAT(tpe.name,'-',tpe.phone) AS label,
tpe.team_id AS parentId,
CONCAT('team-',tpe.team_id) AS parentId,
tb.sh_code AS shCode,
IFNULL(tb.dev_code,'') AS devCode,
0 AS userType
@ -354,7 +354,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
UNION ALL
SELECT tlu.id,
CONCAT(tlu.name,'-',tlu.phone) AS label,
tlu.team_id AS parentId,
CONCAT('team-',tlu.team_id) AS parentId,
tb.sh_code AS shCode,
IFNULL(tb.dev_code,'') AS devCode,
1 AS userType