|
@@ -10,6 +10,8 @@ import com.jpsoft.smart.modules.common.dto.Sort;
|
|
import com.jpsoft.smart.modules.common.dto.MessageResult;
|
|
import com.jpsoft.smart.modules.common.dto.MessageResult;
|
|
import com.jpsoft.smart.modules.base.entity.PersonInfo;
|
|
import com.jpsoft.smart.modules.base.entity.PersonInfo;
|
|
import com.jpsoft.smart.modules.base.service.PersonInfoService;
|
|
import com.jpsoft.smart.modules.base.service.PersonInfoService;
|
|
|
|
+import com.jpsoft.smart.modules.lapi.service.ILapiService;
|
|
|
|
+import com.jpsoft.smart.modules.lapi.vo.LapiMsgResult;
|
|
import com.jpsoft.smart.modules.sys.entity.User;
|
|
import com.jpsoft.smart.modules.sys.entity.User;
|
|
import com.jpsoft.smart.modules.sys.service.UserService;
|
|
import com.jpsoft.smart.modules.sys.service.UserService;
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.Api;
|
|
@@ -40,6 +42,8 @@ import java.util.*;
|
|
public class PersonInfoController {
|
|
public class PersonInfoController {
|
|
private Logger logger = LoggerFactory.getLogger(getClass());
|
|
private Logger logger = LoggerFactory.getLogger(getClass());
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
+ private ILapiService lapiService;
|
|
@Autowired
|
|
@Autowired
|
|
private OSSConfig ossConfig;
|
|
private OSSConfig ossConfig;
|
|
@Autowired
|
|
@Autowired
|
|
@@ -822,7 +826,39 @@ public class PersonInfoController {
|
|
|
|
|
|
try {
|
|
try {
|
|
for(String id : ids){
|
|
for(String id : ids){
|
|
|
|
+ PersonInfo personInfo = personInfoService.get(Long.getLong(id));
|
|
|
|
+
|
|
|
|
+ if (personInfo==null){
|
|
|
|
+ throw new Exception("人员信息不存在!");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //todo 同步终端
|
|
|
|
+ boolean success = true;
|
|
|
|
+ StringBuilder sb = new StringBuilder();
|
|
|
|
+ List<LapiMsgResult> msgResultList = lapiService.addPerson(Long.getLong(id));
|
|
|
|
+ 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();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ personInfo.setFaceBound(success);
|
|
|
|
+ personInfo.setUpdateTime(new Date());
|
|
|
|
+ personInfoService.update(personInfo);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
catch(Exception ex){
|
|
catch(Exception ex){
|