|
@@ -81,6 +81,10 @@ public class PersonInfoController {
|
|
MessageResult<PersonInfo> msgResult = new MessageResult<>();
|
|
MessageResult<PersonInfo> msgResult = new MessageResult<>();
|
|
|
|
|
|
try {
|
|
try {
|
|
|
|
+ personInfo.setName(personInfo.getName().replace(" ",""));
|
|
|
|
+ personInfo.setPhone(personInfo.getPhone().replace(" ",""));
|
|
|
|
+ personInfo.setIdCard(personInfo.getIdCard().replace(" ",""));
|
|
|
|
+
|
|
Map<String, Object> searchParams = new HashMap<>();
|
|
Map<String, Object> searchParams = new HashMap<>();
|
|
searchParams.put("companyId", personInfo.getCompanyId());
|
|
searchParams.put("companyId", personInfo.getCompanyId());
|
|
searchParams.put("name", personInfo.getName());
|
|
searchParams.put("name", personInfo.getName());
|
|
@@ -675,9 +679,9 @@ public class PersonInfoController {
|
|
|
|
|
|
for(int rowIndex=1 ; rowIndex<=sheet1.getLastRowNum(); rowIndex++){
|
|
for(int rowIndex=1 ; rowIndex<=sheet1.getLastRowNum(); rowIndex++){
|
|
try {
|
|
try {
|
|
- String name = (String)poiUtils.getCellValue(sheetIndex,rowIndex,1);
|
|
|
|
- String idCard = (String)poiUtils.getCellValue(sheetIndex,rowIndex,2);
|
|
|
|
- String phone = (String)poiUtils.getCellValue(sheetIndex,rowIndex,3);
|
|
|
|
|
|
+ String name = (String)poiUtils.getCellValue(sheetIndex,rowIndex,1).toString().replace(" ","");
|
|
|
|
+ String idCard = (String)poiUtils.getCellValue(sheetIndex,rowIndex,2).toString().replace(" ","");
|
|
|
|
+ String phone = (String)poiUtils.getCellValue(sheetIndex,rowIndex,3).toString().replace(" ","");
|
|
String position1 = (String)poiUtils.getCellValue(sheetIndex,rowIndex,4);
|
|
String position1 = (String)poiUtils.getCellValue(sheetIndex,rowIndex,4);
|
|
String position2 = (String)poiUtils.getCellValue(sheetIndex,rowIndex,5);
|
|
String position2 = (String)poiUtils.getCellValue(sheetIndex,rowIndex,5);
|
|
String position3 = (String)poiUtils.getCellValue(sheetIndex,rowIndex,6);
|
|
String position3 = (String)poiUtils.getCellValue(sheetIndex,rowIndex,6);
|
|
@@ -1052,4 +1056,43 @@ public class PersonInfoController {
|
|
|
|
|
|
return msgResult;
|
|
return msgResult;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ @ApiOperation(value="添加设备人员图片")
|
|
|
|
+ private MessageResult addDevicePerson(Long personId){
|
|
|
|
+ MessageResult msgResult = new MessageResult();
|
|
|
|
+ boolean success = true;
|
|
|
|
+
|
|
|
|
+ try {
|
|
|
|
+ PersonInfo personInfo = personInfoService.get(personId);
|
|
|
|
+
|
|
|
|
+ StringBuilder sb = new StringBuilder();
|
|
|
|
+ List<LapiMsgResult> msgResultList = lapiService.addPerson(personId);
|
|
|
|
+ for (int i = 0; i < msgResultList.size(); i++) {
|
|
|
|
+ LapiMsgResult lapiMsgResult = msgResultList.get(i);
|
|
|
|
+
|
|
|
|
+ if (lapiMsgResult.isSuccess()) {
|
|
|
|
+ sb.append("【" + personInfo.getName() + "】" + lapiMsgResult.getAliasName() + "解绑人脸信息成功!");
|
|
|
|
+ } else {
|
|
|
|
+ sb.append("【" + personInfo.getName() + "】" + lapiMsgResult.getAliasName() + "解绑人脸信息失败!" + lapiMsgResult.getMsg());
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (i != msgResultList.size() - 1) {
|
|
|
|
+ sb.append(",");
|
|
|
|
+ } else {
|
|
|
|
+ sb.append("。");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ success &= lapiMsgResult.isSuccess();
|
|
|
|
+
|
|
|
|
+ msgResult.setResult(true);
|
|
|
|
+ msgResult.setMessage(sb.toString());
|
|
|
|
+ }
|
|
|
|
+ }catch(Exception ex) {
|
|
|
|
+ logger.error(ex.getMessage(), ex);
|
|
|
|
+ msgResult.setResult(false);
|
|
|
|
+ msgResult.setMessage(ex.getMessage());
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return msgResult;
|
|
|
|
+ }
|
|
}
|
|
}
|