Commit 0728cad8 authored by 18310373984@163.com's avatar 18310373984@163.com

20240904沟通修改内容修改提交

parent c386785e
...@@ -193,10 +193,11 @@ public class DisableController { ...@@ -193,10 +193,11 @@ public class DisableController {
String organId, String districtProvincial, String organId, String districtProvincial,
String districtCity, String districtArea, String districtCity, String districtArea,
String realName, String certiCode, String dataFrom, String realName, String certiCode, String dataFrom,
String srvOrganName) { String srvOrganName,String hasAcptSrvAddress) {
Page<DisableVO> page = new Page<>(pageNum, pageSize); Page<DisableVO> page = new Page<>(pageNum, pageSize);
page = disableService.disableList(page, organId, districtProvincial, page = disableService.disableList(page, organId, districtProvincial,
districtCity, districtArea, realName, certiCode, dataFrom, srvOrganName, 1); districtCity, districtArea, realName, certiCode, dataFrom, srvOrganName, 1,
hasAcptSrvAddress);
return Result.success(page); return Result.success(page);
} }
...@@ -223,7 +224,7 @@ public class DisableController { ...@@ -223,7 +224,7 @@ public class DisableController {
String srvOrganName) { String srvOrganName) {
Page<DisableVO> page = new Page<>(pageNum, pageSize); Page<DisableVO> page = new Page<>(pageNum, pageSize);
page = disableService.disableList(page, organId, districtProvincial, page = disableService.disableList(page, organId, districtProvincial,
districtCity, districtArea, realName, certiCode, dataFrom, srvOrganName, 2); districtCity, districtArea, realName, certiCode, dataFrom, srvOrganName, 2,null);
return Result.success(page); return Result.success(page);
} }
...@@ -261,8 +262,8 @@ public class DisableController { ...@@ -261,8 +262,8 @@ public class DisableController {
* @return 失能信息详情 * @return 失能信息详情
*/ */
@RequestMapping("/disableExamineInfo") @RequestMapping("/disableExamineInfo")
public Result<DisableExamineInfoVO> disableExamineInfo(String applyId) { public Result<DisableExamineInfoVO> disableExamineInfo(String applyId,String from) {
DisableExamineInfoVO disableExamineInfoVO = disableService.disableExamineInfo(applyId); DisableExamineInfoVO disableExamineInfoVO = disableService.disableExamineInfo(applyId,from);
return Result.success(disableExamineInfoVO); return Result.success(disableExamineInfoVO);
} }
...@@ -315,9 +316,10 @@ public class DisableController { ...@@ -315,9 +316,10 @@ public class DisableController {
if (StringUtils.isBlank(chDisableApply.getAcptProvincial()) || StringUtils.isBlank(chDisableApply.getAcptCity()) || StringUtils.isBlank(chDisableApply.getAcptArea()) || StringUtils.isBlank(chDisableApply.getAcptAddress())) { if (StringUtils.isBlank(chDisableApply.getAcptProvincial()) || StringUtils.isBlank(chDisableApply.getAcptCity()) || StringUtils.isBlank(chDisableApply.getAcptArea()) || StringUtils.isBlank(chDisableApply.getAcptAddress())) {
return Result.failed("接受评定地址不能为空!"); return Result.failed("接受评定地址不能为空!");
} }
if (StringUtils.isBlank(chDisableApply.getAcptSrvProvincial()) || StringUtils.isBlank(chDisableApply.getAcptSrvCity()) || StringUtils.isBlank(chDisableApply.getAcptSrvArea()) || StringUtils.isBlank(chDisableApply.getAcptSrvAddress())) { //修改为不是必填项,根据该字段判断是否精准定位
/* if (StringUtils.isBlank(chDisableApply.getAcptSrvProvincial()) || StringUtils.isBlank(chDisableApply.getAcptSrvCity()) || StringUtils.isBlank(chDisableApply.getAcptSrvArea()) || StringUtils.isBlank(chDisableApply.getAcptSrvAddress())) {
return Result.failed("接受服务地址不能为空!"); return Result.failed("接受服务地址不能为空!");
} }*/
if (StringUtils.isBlank(chDisableApply.getAdressDistrictProvincial()) || StringUtils.isBlank(chDisableApply.getAdressDistrictCity()) || StringUtils.isBlank(chDisableApply.getAdressDistrictCode()) || StringUtils.isBlank(chDisableApply.getAdressDetail())) { if (StringUtils.isBlank(chDisableApply.getAdressDistrictProvincial()) || StringUtils.isBlank(chDisableApply.getAdressDistrictCity()) || StringUtils.isBlank(chDisableApply.getAdressDistrictCode()) || StringUtils.isBlank(chDisableApply.getAdressDetail())) {
return Result.failed("现住址不能为空!"); return Result.failed("现住址不能为空!");
} }
...@@ -373,9 +375,12 @@ public class DisableController { ...@@ -373,9 +375,12 @@ public class DisableController {
return Result.failed("接受评定地址不能为空!"); return Result.failed("接受评定地址不能为空!");
} }
//|| StringUtils.isBlank(chDisableApply.getAcptSrvStreet()) //|| StringUtils.isBlank(chDisableApply.getAcptSrvStreet())
if (StringUtils.isBlank(chDisableApply.getAcptSrvProvincial()) || StringUtils.isBlank(chDisableApply.getAcptSrvCity()) || StringUtils.isBlank(chDisableApply.getAcptSrvArea()) || StringUtils.isBlank(chDisableApply.getAcptSrvAddress())) {
//修改为不是必填项,根据该字段判断是否精准定位
/* if (StringUtils.isBlank(chDisableApply.getAcptSrvProvincial()) || StringUtils.isBlank(chDisableApply.getAcptSrvCity()) || StringUtils.isBlank(chDisableApply.getAcptSrvArea()) || StringUtils.isBlank(chDisableApply.getAcptSrvAddress())) {
return Result.failed("接受服务地址不能为空!"); return Result.failed("接受服务地址不能为空!");
} }*/
//|| StringUtils.isBlank(chDisableApply.getStreet()) //|| StringUtils.isBlank(chDisableApply.getStreet())
if (StringUtils.isBlank(chDisableApply.getAdressDistrictProvincial()) || StringUtils.isBlank(chDisableApply.getAdressDistrictCity()) || StringUtils.isBlank(chDisableApply.getAdressDistrictCode()) || StringUtils.isBlank(chDisableApply.getAdressDetail())) { if (StringUtils.isBlank(chDisableApply.getAdressDistrictProvincial()) || StringUtils.isBlank(chDisableApply.getAdressDistrictCity()) || StringUtils.isBlank(chDisableApply.getAdressDistrictCode()) || StringUtils.isBlank(chDisableApply.getAdressDetail())) {
return Result.failed("现住址不能为空!"); return Result.failed("现住址不能为空!");
......
...@@ -247,7 +247,7 @@ public class SrvOrganController { ...@@ -247,7 +247,7 @@ public class SrvOrganController {
* @return 返回操作结果 * @return 返回操作结果
*/ */
@PostMapping("/srvOrganEmp") @PostMapping("/srvOrganEmp")
public Result saveOrUpdateSrvOrganEmp(SrvOrganEmpVo srvOrganEmpVo) { public Result saveOrUpdateSrvOrganEmp(@RequestHeader("Authorization") String token,SrvOrganEmpVo srvOrganEmpVo) {
if (null == srvOrganEmpVo.getOrganId() if (null == srvOrganEmpVo.getOrganId()
|| null == srvOrganEmpVo.getSrvOrganId() || null == srvOrganEmpVo.getSrvOrganId()
|| StrUtil.isBlank(srvOrganEmpVo.getEmpName()) || StrUtil.isBlank(srvOrganEmpVo.getEmpName())
...@@ -262,7 +262,25 @@ public class SrvOrganController { ...@@ -262,7 +262,25 @@ public class SrvOrganController {
return Result.failed(ResultCode.REQUEST_PARAM_ERROR); return Result.failed(ResultCode.REQUEST_PARAM_ERROR);
} }
try { try {
return srvOrganEmpService.saveOrUpdateSrvOrganEmp(srvOrganEmpVo); Integer userId = TokenParsingUtil.TokenParsing(token, "userId");
return srvOrganEmpService.saveOrUpdateSrvOrganEmp(srvOrganEmpVo,userId);
} catch (RuntimeException e) {
return Result.failed(e.getMessage());
}
}
@PostMapping("/saveEmpFace")
public Result saveEmpFace(@RequestHeader("Authorization") String token,SrvOrganEmpVo srvOrganEmpVo) {//参数传faceId,certiNum,
if (null == srvOrganEmpVo.getEmpId()
|| StrUtil.isBlank(srvOrganEmpVo.getCertifNum())
|| null == srvOrganEmpVo.getPhotoList()
|| null==srvOrganEmpVo.getEmpName()
|| null==srvOrganEmpVo.getGender()) {
return Result.failed(ResultCode.REQUEST_PARAM_ERROR);
}
try {
Integer userId = TokenParsingUtil.TokenParsing(token, "userId");
return srvOrganEmpService.saveEmpFace(srvOrganEmpVo,userId);
} catch (RuntimeException e) { } catch (RuntimeException e) {
return Result.failed(e.getMessage()); return Result.failed(e.getMessage());
} }
......
package com.hungraim.ltc.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hungraim.ltc.pojo.entity.disable.CallFaceInterfaceLog;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;
/**
* 腾讯云调用接口记录Mapper
*
* @author czz
*/
@Mapper
@Repository
public interface CallFaceInterfaceLogMapper extends BaseMapper<CallFaceInterfaceLog> {
}
...@@ -33,11 +33,14 @@ public interface DisableApplyMapper extends BaseMapper<ChDisableApply> { ...@@ -33,11 +33,14 @@ public interface DisableApplyMapper extends BaseMapper<ChDisableApply> {
*/ */
Page<DisableVO> disableList(Page<DisableVO> page, @Param("organIds") List<String> organIds, @Param("provincial")String provincial, Page<DisableVO> disableList(Page<DisableVO> page, @Param("organIds") List<String> organIds, @Param("provincial")String provincial,
@Param("city")String city, @Param("area")String area, @Param("name")String name, @Param("certiCode")String certiCode, @Param("city")String city, @Param("area")String area, @Param("name")String name, @Param("certiCode")String certiCode,
@Param("dataFrom")String dataFrom, @Param("srvOrganName")String srvOrganName, @Param("applyMethod")Integer applyMethod); @Param("dataFrom")String dataFrom, @Param("srvOrganName")String srvOrganName,
@Param("applyMethod")Integer applyMethod, @Param("hasAcptSrvAddress")String hasAcptSrvAddress);
DisableExamineInfoVO selectDisableExamineInfoByApplyId(String applyId); DisableExamineInfoVO selectDisableExamineInfoByApplyId(String applyId);
DisableExamineInfoVO selectDisableExamineInfoByApplyIdNew(String applyId);
List<ExamineRecord> listExamineRecordByApplyId(String applyId); List<ExamineRecord> listExamineRecordByApplyId(String applyId);
DisableInfoVO getDisableInfo(String disableInfoId); DisableInfoVO getDisableInfo(String disableInfoId);
......
package com.hungraim.ltc.facelocation.util; package com.hungraim.ltc.facelocation.util;
import com.alibaba.fastjson.JSON;
import com.hungraim.ltc.dao.CallFaceInterfaceLogMapper;
import com.hungraim.ltc.pojo.entity.disable.CallFaceInterfaceLog;
import com.hungraim.ltc.pojo.entity.serviceManage.ChSrvOrganEmp; import com.hungraim.ltc.pojo.entity.serviceManage.ChSrvOrganEmp;
import com.tencentcloudapi.common.AbstractModel; import com.tencentcloudapi.common.AbstractModel;
import com.tencentcloudapi.common.Credential; import com.tencentcloudapi.common.Credential;
...@@ -15,6 +18,9 @@ import java.io.File; ...@@ -15,6 +18,9 @@ import java.io.File;
import java.io.FileInputStream; import java.io.FileInputStream;
import java.io.IOException; import java.io.IOException;
import java.util.Base64; import java.util.Base64;
import java.util.HashMap;
import java.util.Map;
import com.hungraim.ltc.util.Result; import com.hungraim.ltc.util.Result;
/** /**
* <pre> * <pre>
...@@ -28,7 +34,10 @@ public class FaceAuthUtil { ...@@ -28,7 +34,10 @@ public class FaceAuthUtil {
@Autowired @Autowired
private FaceAuthProperties faceAuthProperties; private FaceAuthProperties faceAuthProperties;
public Result<String> addFace(ChSrvOrganEmp faceAuthParam,String filePath){ @Autowired
private CallFaceInterfaceLogMapper callFaceInterfaceLogMapper;
public Result<String> addFace(ChSrvOrganEmp faceAuthParam,String filePath,Integer userId){
try { try {
//设置文件路径 //设置文件路径
...@@ -59,8 +68,23 @@ public class FaceAuthUtil { ...@@ -59,8 +68,23 @@ public class FaceAuthUtil {
log.info("gender:::::"+req.getGender()); log.info("gender:::::"+req.getGender());
log.info("照片base:::::"+imageToBase64(filePath)); log.info("照片base:::::"+imageToBase64(filePath));
req.setImage(imageToBase64(filePath)); req.setImage(imageToBase64(filePath));
Map map=new HashMap();//记录调用接口传的参数
map.put("groupId",faceAuthProperties.getGroupId());
map.put("personName",req.getPersonName());
map.put("personId",req.getPersonId());
map.put("gender",req.getGender());
CreatePersonResponse resp = client.CreatePerson(req); CreatePersonResponse resp = client.CreatePerson(req);
log.info("腾讯云返回:"+AbstractModel.toJsonString(resp)); log.info("腾讯云返回:"+AbstractModel.toJsonString(resp));
try {
//增加接口调用记录
addCallFaceInterfaceLog(userId, JSON.toJSONString(map), "CreatePerson", "创建人员",
AbstractModel.toJsonString(resp), resp.getFaceId(), null, null);
}catch(Exception e){
log.error("增加CreatePerson接口调用记录失败:"+e.toString());
}
return Result.success(resp.getFaceId()); return Result.success(resp.getFaceId());
} catch ( } catch (
Exception e) { Exception e) {
...@@ -71,6 +95,10 @@ public class FaceAuthUtil { ...@@ -71,6 +95,10 @@ public class FaceAuthUtil {
public String imageToBase64(String imagePath) { public String imageToBase64(String imagePath) {
String base64String = ""; String base64String = "";
//如果上传报错,本地测试将这两行打开
//同时将FileUtils类uploadFile方法注释打开
// File filePath=new File("D:/");
// File file = new File(filePath,imagePath);
File file = new File(imagePath); File file = new File(imagePath);
try (FileInputStream fileInputStream = new FileInputStream(file)) { try (FileInputStream fileInputStream = new FileInputStream(file)) {
byte[] bytes = new byte[(int) file.length()]; byte[] bytes = new byte[(int) file.length()];
...@@ -84,7 +112,7 @@ public class FaceAuthUtil { ...@@ -84,7 +112,7 @@ public class FaceAuthUtil {
public Result<String> deleteFace(ChSrvOrganEmp faceAuthParam){ public Result<String> deleteFace(ChSrvOrganEmp faceAuthParam,Integer userId){
try { try {
// 实例化一个认证对象,入参需要传入腾讯云账户 SecretId 和 SecretKey // 实例化一个认证对象,入参需要传入腾讯云账户 SecretId 和 SecretKey
...@@ -109,7 +137,13 @@ public class FaceAuthUtil { ...@@ -109,7 +137,13 @@ public class FaceAuthUtil {
DeleteFaceResponse resp = client.DeleteFace(req); DeleteFaceResponse resp = client.DeleteFace(req);
// 输出json格式的字符串回包 // 输出json格式的字符串回包
System.out.println(AbstractModel.toJsonString(resp)); System.out.println(AbstractModel.toJsonString(resp));
try{
//增加接口调用记录
addCallFaceInterfaceLog(userId, JSON.toJSONString(req.getFaceIds()),"DeleteFace","删除人脸",
AbstractModel.toJsonString(resp),null,null,null);
}catch(Exception e){
log.error("增加DeleteFace接口调用记录失败:"+e.toString());
}
// 输出json格式的字符串回包 // 输出json格式的字符串回包
return Result.success(resp.getRequestId()); return Result.success(resp.getRequestId());
...@@ -118,4 +152,20 @@ public class FaceAuthUtil { ...@@ -118,4 +152,20 @@ public class FaceAuthUtil {
return Result.failed(e.getMessage()); return Result.failed(e.getMessage());
} }
} }
//记录调用日志
private void addCallFaceInterfaceLog(Integer userId,String callParam,String interfaceMethod,
String interfaceName,String callResult,
String faceId,String isMatch,String score){
CallFaceInterfaceLog callFaceInterfaceLog=new CallFaceInterfaceLog();
callFaceInterfaceLog.setPcUserId(userId);
callFaceInterfaceLog.setCallParam(callParam);
callFaceInterfaceLog.setInterfaceMethod(interfaceMethod);
callFaceInterfaceLog.setInterfaceName(interfaceName);
callFaceInterfaceLog.setCallResult(callResult);
callFaceInterfaceLog.setFaceId(faceId);
callFaceInterfaceLog.setIsMatch(isMatch);
callFaceInterfaceLog.setScore(score);
callFaceInterfaceLogMapper.insert(callFaceInterfaceLog);
}
} }
...@@ -23,7 +23,7 @@ public interface DisableService { ...@@ -23,7 +23,7 @@ public interface DisableService {
Page<DisableVO> disableList(Page<DisableVO> page, String organId, String districtProvincial, String districtCity, Page<DisableVO> disableList(Page<DisableVO> page, String organId, String districtProvincial, String districtCity,
String districtArea, String realName, String certiCode, String dataFrom, String districtArea, String realName, String certiCode, String dataFrom,
String srvOrganName, Integer applyMethod); String srvOrganName, Integer applyMethod,String hasAcptSrvAddress);
/** /**
* 失能审核信息详情 * 失能审核信息详情
...@@ -31,7 +31,7 @@ public interface DisableService { ...@@ -31,7 +31,7 @@ public interface DisableService {
* @param applyId 失能人员id * @param applyId 失能人员id
* @return 失能审核信息详情 * @return 失能审核信息详情
*/ */
DisableExamineInfoVO disableExamineInfo(String applyId); DisableExamineInfoVO disableExamineInfo(String applyId,String from);
/** /**
* 失能人员信息详情(失能人员信息修改申请详情页面) * 失能人员信息详情(失能人员信息修改申请详情页面)
......
...@@ -65,7 +65,7 @@ public interface SrvOrganEmpService { ...@@ -65,7 +65,7 @@ public interface SrvOrganEmpService {
* eduId: "", // 文化水平 * eduId: "", // 文化水平
* fileDataList: [], // 对应数据库中的文件数据列表 * fileDataList: [], // 对应数据库中的文件数据列表
*/ */
Result saveOrUpdateSrvOrganEmp(SrvOrganEmpVo srvOrganEmpVo); Result saveOrUpdateSrvOrganEmp(SrvOrganEmpVo srvOrganEmpVo,Integer userId );
Workbook srvOrganExport(Long organId,Long srvOrganId, Boolean isInvolveChild, String empName, String srvOrganName, String certifNum, Workbook srvOrganExport(Long organId,Long srvOrganId, Boolean isInvolveChild, String empName, String srvOrganName, String certifNum,
Short isLock, Short empType); Short isLock, Short empType);
...@@ -77,4 +77,6 @@ public interface SrvOrganEmpService { ...@@ -77,4 +77,6 @@ public interface SrvOrganEmpService {
Result selectEmpBySrvOrganId(String srvOrganId); Result selectEmpBySrvOrganId(String srvOrganId);
Workbook chSrvTaskDetailExport(Long empId, String empName,String status,String sevrTime); Workbook chSrvTaskDetailExport(Long empId, String empName,String status,String sevrTime);
Result saveEmpFace(SrvOrganEmpVo srvOrganEmpVo, Integer userId) ;
} }
...@@ -113,14 +113,14 @@ public class DisableServiceImpl implements DisableService { ...@@ -113,14 +113,14 @@ public class DisableServiceImpl implements DisableService {
@Override @Override
public Page<DisableVO> disableList(Page<DisableVO> page, String organId, String districtProvincial, String districtCity, public Page<DisableVO> disableList(Page<DisableVO> page, String organId, String districtProvincial, String districtCity,
String districtArea, String realName, String certiCode, String dataFrom, String districtArea, String realName, String certiCode, String dataFrom,
String srvOrganName, Integer applyMethod) { String srvOrganName, Integer applyMethod,String hasAcptSrvAddress) {
// 没有organId参数的时候,这个集合就为null // 没有organId参数的时候,这个集合就为null
List<String> organIds = null; List<String> organIds = null;
if (StrUtil.isNotBlank(organId)) { if (StrUtil.isNotBlank(organId)) {
organIds = Arrays.asList(organId.split(",")); organIds = Arrays.asList(organId.split(","));
} }
Page<DisableVO> disableVOPage = disableApplyMapper.disableList(page, organIds, districtProvincial, Page<DisableVO> disableVOPage = disableApplyMapper.disableList(page, organIds, districtProvincial,
districtCity, districtArea, realName, certiCode, dataFrom, srvOrganName, applyMethod); districtCity, districtArea, realName, certiCode, dataFrom, srvOrganName, applyMethod,hasAcptSrvAddress);
List<DisableVO> records = disableVOPage.getRecords(); List<DisableVO> records = disableVOPage.getRecords();
for (DisableVO record : records) { for (DisableVO record : records) {
String birthday = record.getBirthday(); String birthday = record.getBirthday();
...@@ -140,8 +140,13 @@ public class DisableServiceImpl implements DisableService { ...@@ -140,8 +140,13 @@ public class DisableServiceImpl implements DisableService {
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
@Override @Override
public DisableExamineInfoVO disableExamineInfo(String applyId) { public DisableExamineInfoVO disableExamineInfo(String applyId,String from) {
//如果from字段不为空,则代表从失能申请页面调用,需要支持失能人员显示最新修改信息
DisableExamineInfoVO disableExamineInfoVO = disableApplyMapper.selectDisableExamineInfoByApplyId(applyId); DisableExamineInfoVO disableExamineInfoVO = disableApplyMapper.selectDisableExamineInfoByApplyId(applyId);
if(StringUtils.isNotEmpty(from)){ //修改逻辑:待审核记录查申请表(待审核记录,还未写到正式表),审核通过记录查正式表ch_disable_info
disableExamineInfoVO= disableApplyMapper.selectDisableExamineInfoByApplyIdNew(applyId);
}
List<ExamineRecord> examineRecords = disableApplyMapper.listExamineRecordByApplyId(applyId); List<ExamineRecord> examineRecords = disableApplyMapper.listExamineRecordByApplyId(applyId);
disableExamineInfoVO.setExamineRecords(examineRecords); disableExamineInfoVO.setExamineRecords(examineRecords);
try { try {
......
...@@ -6,6 +6,7 @@ import cn.afterturn.easypoi.excel.entity.enmus.ExcelType; ...@@ -6,6 +6,7 @@ import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hungraim.ltc.api.AttachFeignService; import com.hungraim.ltc.api.AttachFeignService;
import com.hungraim.ltc.dao.*; import com.hungraim.ltc.dao.*;
...@@ -31,6 +32,7 @@ import com.hungraim.ltc.util.Result; ...@@ -31,6 +32,7 @@ import com.hungraim.ltc.util.Result;
import com.hungraim.ltc.util.ResultCode; import com.hungraim.ltc.util.ResultCode;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import oracle.sql.DATE;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
import org.apache.poi.ss.usermodel.Workbook; import org.apache.poi.ss.usermodel.Workbook;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
...@@ -135,7 +137,7 @@ public class SrvOrganEmpServiceImpl implements SrvOrganEmpService { ...@@ -135,7 +137,7 @@ public class SrvOrganEmpServiceImpl implements SrvOrganEmpService {
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
@Override @Override
public Result saveOrUpdateSrvOrganEmp(SrvOrganEmpVo srvOrganEmpVo) { public Result saveOrUpdateSrvOrganEmp(SrvOrganEmpVo srvOrganEmpVo,Integer userId) {
Long empId = srvOrganEmpVo.getEmpId(); Long empId = srvOrganEmpVo.getEmpId();
ChSrvOrganEmp chSrvOrganEmp = new ChSrvOrganEmp(); ChSrvOrganEmp chSrvOrganEmp = new ChSrvOrganEmp();
BeanUtils.copyProperties(srvOrganEmpVo, chSrvOrganEmp); BeanUtils.copyProperties(srvOrganEmpVo, chSrvOrganEmp);
...@@ -164,7 +166,7 @@ public class SrvOrganEmpServiceImpl implements SrvOrganEmpService { ...@@ -164,7 +166,7 @@ public class SrvOrganEmpServiceImpl implements SrvOrganEmpService {
chSrvempRiskLevel.setFcd(new Date()); chSrvempRiskLevel.setFcd(new Date());
chSrvempRiskLevelMapper.insert(chSrvempRiskLevel); chSrvempRiskLevelMapper.insert(chSrvempRiskLevel);
Result<String > faceReult=updatePhotoAttachs(srvOrganEmpVo,chSrvOrganEmp);//上传标准照 Result<String > faceReult=updatePhotoAttachs(srvOrganEmpVo,userId);//上传标准照
if (StrUtil.equals(faceReult.getCode(), ResultCode.SUCCESS.getCode())) { if (StrUtil.equals(faceReult.getCode(), ResultCode.SUCCESS.getCode())) {
chSrvOrganEmp.setFaceId(faceReult.getData());//腾讯云人脸库Id chSrvOrganEmp.setFaceId(faceReult.getData());//腾讯云人脸库Id
chSrvOrganEmpMapper.updateById(chSrvOrganEmp);//更新护理人员信息 chSrvOrganEmpMapper.updateById(chSrvOrganEmp);//更新护理人员信息
...@@ -176,14 +178,6 @@ public class SrvOrganEmpServiceImpl implements SrvOrganEmpService { ...@@ -176,14 +178,6 @@ public class SrvOrganEmpServiceImpl implements SrvOrganEmpService {
chSrvOrganEmpMapper.updateById(chSrvOrganEmp); chSrvOrganEmpMapper.updateById(chSrvOrganEmp);
updateAttachs(srvOrganEmpVo, empId); updateAttachs(srvOrganEmpVo, empId);
//上传标准照保存到人脸库
Result<String > faceReult=updatePhotoAttachs(srvOrganEmpVo,chSrvOrganEmp);
String faceId = faceReult.getData();//上传标准照
chSrvOrganEmp.setFaceId(faceId);
chSrvOrganEmpMapper.updateById(chSrvOrganEmp);
if (!StrUtil.equals(faceReult.getCode(), ResultCode.SUCCESS.getCode())) {
throw new RuntimeException(faceReult.getMsg());//人脸库上传失败,页面显示错误信息
}
} }
return Result.success(); return Result.success();
} }
...@@ -198,14 +192,33 @@ public class SrvOrganEmpServiceImpl implements SrvOrganEmpService { ...@@ -198,14 +192,33 @@ public class SrvOrganEmpServiceImpl implements SrvOrganEmpService {
} }
@Transactional(rollbackFor = Exception.class)
@Override
public Result saveEmpFace(SrvOrganEmpVo srvOrganEmpVo,Integer userId) {//修改护理人员需要将修改基本信息和标准照片保存分开
//上传标准照保存到人脸库
Result<String > faceReult=updatePhotoAttachs(srvOrganEmpVo,userId);
if (!StrUtil.equals(faceReult.getCode(), ResultCode.SUCCESS.getCode())) {
throw new RuntimeException(faceReult.getMsg());//人脸库上传失败,页面显示错误信息
}else{
String faceId = faceReult.getData();//上传标准照
UpdateWrapper updateWrapper = new UpdateWrapper();
updateWrapper.eq("emp_Id", srvOrganEmpVo.getEmpId());
updateWrapper.set("face_id", faceId);
updateWrapper.set("LCD", new DATE());
chSrvOrganEmpMapper.update(null,updateWrapper);
}
return Result.success();
}
//保存到本地及人脸库 //保存到本地及人脸库
private Result<String> updatePhotoAttachs(SrvOrganEmpVo srvOrganEmpVo, ChSrvOrganEmp chSrvOrganEmp) { private Result<String> updatePhotoAttachs(SrvOrganEmpVo srvOrganEmpVo,Integer userId) {
if(srvOrganEmpVo.getPhotoList()!=null&&srvOrganEmpVo.getPhotoList().size()>0) {//标准照必传 if(srvOrganEmpVo.getPhotoList()!=null&&srvOrganEmpVo.getPhotoList().size()>0) {//标准照必传
//修改标准照 //修改标准照
AttachUpdateVo attachPhotoUpdateVo = new AttachUpdateVo(); AttachUpdateVo attachPhotoUpdateVo = new AttachUpdateVo();
attachPhotoUpdateVo.setChFndAttachs(srvOrganEmpVo.getPhotoList()); attachPhotoUpdateVo.setChFndAttachs(srvOrganEmpVo.getPhotoList());
attachPhotoUpdateVo.setCtrlId(chSrvOrganEmp.getEmpId()); attachPhotoUpdateVo.setCtrlId(srvOrganEmpVo.getEmpId());
attachPhotoUpdateVo.setAttachType(AttachType.SRV_EMP_Photo.getUploadType()); attachPhotoUpdateVo.setAttachType(AttachType.SRV_EMP_Photo.getUploadType());
attachFeignService.updateAttachs(attachPhotoUpdateVo); attachFeignService.updateAttachs(attachPhotoUpdateVo);
...@@ -216,17 +229,17 @@ public class SrvOrganEmpServiceImpl implements SrvOrganEmpService { ...@@ -216,17 +229,17 @@ public class SrvOrganEmpServiceImpl implements SrvOrganEmpService {
chFndAttach=attachFeignService.selectAttachById(chFndAttach.getAttachId()).getData(); chFndAttach=attachFeignService.selectAttachById(chFndAttach.getAttachId()).getData();
} }
log.info("filePath2:"+chFndAttach.getFilePath()); log.info("filePath2:"+chFndAttach.getFilePath());
if(StringUtils.isNotEmpty(chSrvOrganEmp.getFaceId())) { if(StringUtils.isNotEmpty(srvOrganEmpVo.getFaceId())) {
//先删除人员信息 //先删除人员信息
Result<String> delresult = faceAuthUtil.deleteFace(chSrvOrganEmp); Result<String> delresult = faceAuthUtil.deleteFace(srvOrganEmpVo,userId);
log.info("删除人脸信息:" + delresult); log.info("删除人脸信息:" + delresult);
Result addResult=faceAuthUtil.addFace(srvOrganEmpVo, chFndAttach.getFilePath()); Result addResult=faceAuthUtil.addFace(srvOrganEmpVo, chFndAttach.getFilePath(),userId);
log.info("新增人脸信息:" + addResult); log.info("新增人脸信息:" + addResult);
return addResult; return addResult;
}else{ }else{
//在新增人员信息 //在新增人员信息
Result addResult=faceAuthUtil.addFace(srvOrganEmpVo, chFndAttach.getFilePath()); Result addResult=faceAuthUtil.addFace(srvOrganEmpVo, chFndAttach.getFilePath(),userId);
log.info("新增人脸信息:"+addResult); log.info("新增人脸信息:"+addResult);
return addResult; return addResult;
} }
......
...@@ -395,6 +395,9 @@ public class ChDisableInfoHis implements Serializable { ...@@ -395,6 +395,9 @@ public class ChDisableInfoHis implements Serializable {
* 待遇类型(1失能、0失智) * 待遇类型(1失能、0失智)
*/ */
private Integer treatmentType; private Integer treatmentType;
private Integer positioningDistance;//定位距离
} }
package com.hungraim.ltc.pojo.entity.disable;
import com.baomidou.mybatisplus.annotation.*;
import com.hungraim.ltc.pojo.entity.PageInfo;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* 失能人员申请
*/
@Data
@TableName("ch_call_face_interface_log")
@KeySequence(value = "s_ch_call_face_interface_log")
public class CallFaceInterfaceLog extends PageInfo implements Serializable {
/**
* 失能申请id
*/
@TableId(value = "call_log_id", type = IdType.INPUT)
private Long callLogId;
//pc端登录用户Id
private Integer pcUserId;
//app端登录用户ID
private Integer appUserId;
//app端人脸识别身份证号
private String certifNum;
//调用参数
private String callParam;
//接口方法:CreatePerson 创建人员接口 DeletePerson删除创建人员接口 DetectLiveFaceAccurate 静态活检高精度版接口 VerifyPerson 人员验证接口
private String interfaceMethod;
//接口名称
private String interfaceName;
//腾讯云接口返回信息
private String callResult;
//创建人员接口返回的face_id
private String faceId;
//静态活检接口返回的活体打分和人员验证接口返回的相似度评分
private String score;
//人员验证接口返回的is_match=true为同一人,is_match=false不是同一人
private String isMatch;
//调用时间
private Date callTime;
private static final long serialVersionUID = 1L;
}
...@@ -651,5 +651,8 @@ public class ChDisableApply extends PageInfo implements Serializable { ...@@ -651,5 +651,8 @@ public class ChDisableApply extends PageInfo implements Serializable {
@TableField(exist = false) @TableField(exist = false)
private List<ChFndAttach> fileDataList; private List<ChFndAttach> fileDataList;
private Integer positioningDistance;//定位距离
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
} }
...@@ -604,6 +604,8 @@ public class ChDisableApplyHis implements Serializable { ...@@ -604,6 +604,8 @@ public class ChDisableApplyHis implements Serializable {
*/ */
private Short treatmentType; private Short treatmentType;
private Integer positioningDistance;//定位距离
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
public Long getApplyHisId() { public Long getApplyHisId() {
......
...@@ -143,4 +143,5 @@ public class ChDisableInfo extends PageInfo implements Serializable { ...@@ -143,4 +143,5 @@ public class ChDisableInfo extends PageInfo implements Serializable {
private Integer exitSrvOrganId; private Integer exitSrvOrganId;
private java.util.Date exitTime; private java.util.Date exitTime;
private Integer positioningDistance;//定位距离
} }
...@@ -471,7 +471,7 @@ public class ChDisableInfoChange { ...@@ -471,7 +471,7 @@ public class ChDisableInfoChange {
*/ */
private Long reviewFrequency; private Long reviewFrequency;
private Integer positioningDistance;//定位距离
......
...@@ -181,7 +181,12 @@ public class ChSrvOrganEmp implements Serializable { ...@@ -181,7 +181,12 @@ public class ChSrvOrganEmp implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
//是否人脸识别,Y=是,N等于否
private String isFace;
//腾讯云人脸库faceId //腾讯云人脸库faceId
private String faceId; private String faceId;
} }
\ No newline at end of file
...@@ -134,4 +134,7 @@ public class DisableExamineInfoVO { ...@@ -134,4 +134,7 @@ public class DisableExamineInfoVO {
private String applyTime; private String applyTime;
private List<ChFndAttach> fileDataList; private List<ChFndAttach> fileDataList;
//定位距离
private Integer positioningDistance;//定位距离
} }
...@@ -157,4 +157,6 @@ public class DisableUpdateDetailVO { ...@@ -157,4 +157,6 @@ public class DisableUpdateDetailVO {
*/ */
private Long reviewFrequency; private Long reviewFrequency;
private Integer positioningDistance;//定位距离
} }
...@@ -60,4 +60,6 @@ public class DisableVO implements Serializable { ...@@ -60,4 +60,6 @@ public class DisableVO implements Serializable {
private Integer applyMethod; private Integer applyMethod;
private String applyTime; private String applyTime;
private String hasAcptSrvAddress;//接受服务地址是否已维护,Y是,N否
} }
...@@ -28,7 +28,7 @@ public class FileUtils { ...@@ -28,7 +28,7 @@ public class FileUtils {
* @param path 存放文件的根路径 * @param path 存放文件的根路径
* @return 返回文件具体保存的路径,包含文件名称 * @return 返回文件具体保存的路径,包含文件名称
*/ */
public static String uploadFile(MultipartFile uploadFile, String path) { public static String uploadFile(MultipartFile uploadFile, String path) throws IOException {
log.info("开始进行文件上传"); log.info("开始进行文件上传");
try { try {
//获取到文件名 //获取到文件名
...@@ -50,13 +50,21 @@ public class FileUtils { ...@@ -50,13 +50,21 @@ public class FileUtils {
//文件上传 //文件上传
String realFilePath = realDirPath + "/" + realName; String realFilePath = realDirPath + "/" + realName;
log.info("文件上传路径以及名称:{}", realFilePath); log.info("文件上传路径以及名称:{}", realFilePath);
/*
//如果上传报错,本地测试将块注释代码打开
//同时将FaceAuthUtil,imageToBase64方法注释打开
File filePath=new File("D:/");
if(!filePath.exists()){
filePath.mkdirs();
}
File file = new File(filePath,realFilePath);**/
File file = new File(realFilePath); File file = new File(realFilePath);
uploadFile.transferTo(file); uploadFile.transferTo(file);
return realFilePath; return realFilePath;
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); log.info("上传失败:"+e.getMessage());
throw new IOException("上传文件失败:"+e.getMessage());
} }
return null;
} }
......
...@@ -38,24 +38,28 @@ public class FileUploadController { ...@@ -38,24 +38,28 @@ public class FileUploadController {
*/ */
@PostMapping("/uploadFile") @PostMapping("/uploadFile")
public Result uploadFile(MultipartFile file, Short uploadType) { public Result uploadFile(MultipartFile file, Short uploadType) {
if (null == uploadType || null == file) { try{
return Result.failed(ResultCode.REQUEST_PARAM_ERROR); if (null == uploadType || null == file) {
} return Result.failed(ResultCode.REQUEST_PARAM_ERROR);
//过滤上传资料类型 }
String originalFilename = file.getOriginalFilename(); //过滤上传资料类型
//文件类型 String originalFilename = file.getOriginalFilename();
String fileType = originalFilename.substring(file.getOriginalFilename().lastIndexOf(".")); //文件类型
List<String> fileTypes = fileUploadConfig.getType(); String fileType = originalFilename.substring(file.getOriginalFilename().lastIndexOf("."));
log.info("支持图片类型:" + fileTypes+",上传的图片类型:"+fileType); List<String> fileTypes = fileUploadConfig.getType();
if(!fileTypes.stream().anyMatch(e->e.equalsIgnoreCase(fileType))){ log.info("支持图片类型:" + fileTypes+",上传的图片类型:"+fileType);
log.info("上传文件错误"); if(!fileTypes.stream().anyMatch(e->e.equalsIgnoreCase(fileType))){
return Result.failed(ResultCode.FILE_TYPE_ERROR); log.info("上传文件错误");
return Result.failed(ResultCode.FILE_TYPE_ERROR);
}
String realPath = FileUtils.uploadFile(file, fileUploadConfig.getPath());
log.info("文件上传成功:{}", realPath);
Long attachId = attachService.saveFileInfo(originalFilename, realPath, uploadType);
log.info("保存成功,文件id:{}", attachId);
return Result.success(attachId);
}catch(Exception e){
return Result.failed(e.getMessage());
} }
String realPath = FileUtils.uploadFile(file, fileUploadConfig.getPath());
log.info("文件上传成功:{}", realPath);
Long attachId = attachService.saveFileInfo(originalFilename, realPath, uploadType);
log.info("保存成功,文件id:{}", attachId);
return Result.success(attachId);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment