长庆项目10.30

This commit is contained in:
ovo 2024-10-30 15:42:36 +08:00
parent 2f2203d7ee
commit 139718fc34
13 changed files with 313 additions and 96 deletions

View File

@ -127,6 +127,7 @@ public class ShiroConfig {
filterMap.put("/swagger-ui.html", "anon");
filterMap.put("/swagger-resources/**", "anon");
filterMap.put("/captcha.jpg", "anon");
filterMap.put("/cq/demo/**", "anon");
// filterMap.put("/aaa.txt", "anon");
filterMap.put("/**", "oauth2");

View File

@ -2,10 +2,7 @@ package net.shapelight.modules.face.rtsp;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.json.JSONObject;
import com.arcsoft.face.FaceEngine;
import com.arcsoft.face.FaceFeature;
import com.arcsoft.face.FaceInfo;
import com.arcsoft.face.FaceSimilar;
import com.arcsoft.face.enums.ExtractType;
import com.arcsoft.face.toolkit.ImageFactory;
import com.arcsoft.face.toolkit.ImageInfo;
@ -14,19 +11,13 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import io.minio.MinioClient;
import io.minio.PutObjectOptions;
import io.minio.errors.*;
import lombok.extern.slf4j.Slf4j;
import net.shapelight.common.config.GlobalValue;
import net.shapelight.common.config.MinioConfig;
import net.shapelight.common.utils.Constant;
import net.shapelight.common.utils.UUIDUtil;
import net.shapelight.modules.face.dto.FaceRecognitionResDTO;
import net.shapelight.modules.face.entity.UserCompareInfo;
import net.shapelight.modules.face.enums.ErrorCodeEnum;
import net.shapelight.modules.face.face.FacePreviewInfo;
import net.shapelight.modules.face.rpc.BusinessException;
import net.shapelight.modules.face.service.FaceEngineService;
import net.shapelight.modules.face.service.impl.FaceEngineServiceImpl;
import net.shapelight.modules.face.util.UserInfo;
import net.shapelight.modules.face.util.UserRamGroup;
import net.shapelight.modules.feignClient.CxFeignClient;
@ -36,23 +27,27 @@ import net.shapelight.modules.ten.entity.TenCellEntity;
import net.shapelight.modules.ten.entity.TenPersonEntity;
import net.shapelight.modules.ten.service.TenPersonService;
import net.shapelight.modules.ten.service.impl.TenPersonServiceImpl;
import org.apache.commons.pool2.impl.GenericObjectPool;
import org.bytedeco.javacpp.avutil;
import org.bytedeco.javacv.*;
import org.bytedeco.javacv.FFmpegFrameGrabber;
import org.bytedeco.javacv.Frame;
import org.bytedeco.javacv.FrameGrabber;
import org.bytedeco.javacv.Java2DFrameConverter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.multipart.MultipartFile;
import javax.imageio.ImageIO;
import java.awt.image.BufferedImage;
import java.io.*;
import java.nio.charset.StandardCharsets;
import java.security.InvalidKeyException;
import java.security.NoSuchAlgorithmException;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import static org.bytedeco.javacpp.avutil.AV_LOG_ERROR;
@ -253,17 +248,6 @@ public class RtspFrameGrabber {
List<FaceInfo> faceInfoList = faceEngineService.detectFaces(imageInfo);
/* for (FaceInfo faceInfo : faceInfoList) {
System.out.println(faceInfo.getFace3DAngle());
//Yaw上下 Pitch左右
if (faceInfo.getFace3DAngle().getYaw() > 20 || faceInfo.getFace3DAngle().getYaw() < -20) {
System.out.println("没在好好看!!!");
// faceInfoList.remove(faceInfo);
}
if (faceInfo.getFace3DAngle().getPitch() > 20 || faceInfo.getFace3DAngle().getPitch() < -20) {
System.out.println("没在好好看!!!");
}
}*/
if (CollectionUtil.isNotEmpty(faceInfoList)) {
@ -282,6 +266,11 @@ public class RtspFrameGrabber {
for (UserCompareInfo userCompareInfo : userCompareInfoList) {
FaceVideoVo faceVideoVo = new FaceVideoVo();
//System.out.println("faceInfo = " + faceInfo.getRect());
faceVideoVo.setRect(faceInfo.getRect());
if (faceInfo.getFace3DAngle().getYaw() > 20 || faceInfo.getFace3DAngle().getYaw() < -20) {
faceVideoVo.setIsHeadOnView(0);
}else if (faceInfo.getFace3DAngle().getPitch() > 20 || faceInfo.getFace3DAngle().getPitch() < -20) {
@ -322,10 +311,9 @@ public class RtspFrameGrabber {
faceVideoVo.setImageUrl(frameFileName);
temp.add(faceVideoVo);
}
if (!userCompareInfoList.isEmpty()) {
for (UserCompareInfo userCompareInfo : userCompareInfoList) {
TenPersonEntity tenPerson = personService.getOne(new LambdaQueryWrapper<TenPersonEntity>()
.eq(TenPersonEntity::getPersonId, userCompareInfo.getFaceId()));
Map<Integer, String> personnelTypeMap = new HashMap<>();
@ -338,7 +326,7 @@ public class RtspFrameGrabber {
Map<String, Object> params = new HashMap<>();
params.put("pmWatchVideoRecordId", "");
params.put("orgId", tenPerson.getOrgId());
params.put("orgName", tenCellDao.selectOne(new QueryWrapper<TenCellEntity>().eq("cell_id", tenPerson.getCellId())));
params.put("orgName", tenCellDao.selectOne(new QueryWrapper<TenCellEntity>().eq("cell_id", tenPerson.getCellId())).getName());
params.put("personnelName", tenPerson.getName());
params.put("personnelId", tenPerson.getOpenId());
params.put("personnelCardId", tenPerson.getIdCard());
@ -346,11 +334,16 @@ public class RtspFrameGrabber {
params.put("dictSex", tenPerson.getGender() == 0 ? "" : "");
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
params.put("watchVideoTime", sdf.format(System.currentTimeMillis()));
tenPerson.setIsWatchSafeVideo(1);
tenPerson.setIsWatchSafeVideo(faceVideoVo.getIsHeadOnView() == 0 ? 2 : 1);
tenPersonService.updateById(tenPerson);
System.out.println("params = " + params);
if(faceVideoVo.getIsHeadOnView() == 1){
/* JSONObject jsonObject = feignClient.savePmWatchVideoRecord(params);
if (jsonObject.getBool("success") != null && jsonObject.getBool("success")) {
personService.update(new LambdaUpdateWrapper<TenPersonEntity>()
@ -358,9 +351,8 @@ public class RtspFrameGrabber {
.eq(TenPersonEntity::getPersonId, userCompareInfo.getFaceId()));
}*/
}
}
} else {
log.error("图片不合格,未检测到人脸");
}

View File

@ -890,7 +890,7 @@ public class HttpApiController {
System.out.println("params = " + params);
/*cn.hutool.json.JSONObject jsonObject = cxFeignClient.savePmEntryExitRecord(params);
/* cn.hutool.json.JSONObject jsonObject = cxFeignClient.savePmEntryExitRecord(params);
if(jsonObject.getBool("success")!=null && jsonObject.getBool("success")){
log.debug("同步进出场记录成功");
}else {

View File

@ -1,10 +1,15 @@
package net.shapelight.modules.iCq.controller;
import cn.hutool.json.JSONObject;
import com.arcsoft.face.ActiveDeviceInfo;
import com.arcsoft.face.FaceEngine;
import com.arcsoft.face.enums.ErrorInfo;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import io.minio.MinioClient;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import net.shapelight.common.config.GlobalValue;
import net.shapelight.common.utils.R;
import net.shapelight.modules.iCq.dal.mysql.enter.CqEnterConfigCellMapper;
import net.shapelight.modules.iCq.dal.mysql.enter.CqEnterConfigMapper;
@ -16,6 +21,9 @@ import net.shapelight.modules.ten.entity.TenCellEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import net.shapelight.modules.face.factory.FaceEngineFactory;
import java.util.regex.Pattern;
@RestController
@RequestMapping("cq/demo")
@ -32,8 +40,11 @@ public class DemoController {
@Autowired
private TenCellDao tenCellDao;
@Autowired
private GlobalValue globalValue;
@GetMapping("/save1")
public void saveSupplier(){
public void saveSupplier(String type){
/* System.out.println("测试开始");
TenCellEntity tenCellEntity = tenCellDao.selectOne(new QueryWrapper<TenCellEntity>().eq("cell_id", "1255898969448382468"));
@ -75,9 +86,98 @@ public class DemoController {
task.save(jsonObject, tenCellEntity);*/
task.getPmInternalPersonnelList2();
task.getPmInternalPersonnelList2(type);
}
@GetMapping("/offline")
public R activeOffline() {
FaceEngine faceEngine;
String USER_HOME = System.getProperty("user.home");
System.out.println(USER_HOME);
String jvmName = System.getProperty("java.vm.name", "").toLowerCase();
String osName = System.getProperty("os.name", "").toLowerCase();
String osArch = System.getProperty("os.arch", "").toLowerCase();
String abiType = System.getProperty("sun.arch.abi", "").toLowerCase();
String libPath = System.getProperty("sun.boot.library.path", "").toLowerCase();
USER_HOME = System.getProperty("user.home");
if (jvmName.startsWith("dalvik") && osName.startsWith("linux")) {
osName = "android";
} else if (jvmName.startsWith("robovm") && osName.startsWith("darwin")) {
osName = "ios";
osArch = "arm";
} else if (osName.startsWith("mac os x") || osName.startsWith("darwin")) {
osName = "macosx";
} else {
int spaceIndex = osName.indexOf(' ');
if (spaceIndex > 0) {
osName = osName.substring(0, spaceIndex);
}
}
if (osArch.equals("i386") || osArch.equals("i486") || osArch.equals("i586") || osArch.equals("i686")) {
osArch = "x86";
} else if (osArch.equals("amd64") || osArch.equals("x86-64") || osArch.equals("x64")) {
osArch = "x86_64";
} else if (osArch.startsWith("aarch64") || osArch.startsWith("armv8") || osArch.startsWith("arm64")) {
osArch = "arm64";
} else if ((osArch.startsWith("arm")) && ((abiType.equals("gnueabihf")) || (libPath.contains("openjdk-armhf")))) {
osArch = "armhf";
} else if (osArch.startsWith("arm")) {
osArch = "arm";
}
String PLATFORM = osName + "-" + osArch;
System.out.println("PLATFORM = " + PLATFORM);
String CACHE_LIB_FOLDER = USER_HOME + "/.arcface/cache/" + "4.1" + "/" + PLATFORM + "/";
System.out.println("CACHE_LIB_FOLDER = " + CACHE_LIB_FOLDER);
if (Pattern.matches("windows.*", osName)) {
System.out.println("osName = " + osName);
faceEngine = new FaceEngine(CACHE_LIB_FOLDER);
}else{
// faceEngine = new FaceEngine("D:\\00_桌面\\ArcSoft_ArcFacePro_windows_x64_java_V4.1\\libs\\WIN64");
faceEngine = new FaceEngine(CACHE_LIB_FOLDER);
}
ActiveDeviceInfo activeDeviceInfo = new ActiveDeviceInfo();
int code = faceEngine.getActiveDeviceInfo(activeDeviceInfo);
// System.out.println("\n设备信息" + activeDeviceInfo.toString() + "\n"); // 这个com.arcsoft.face.model.ActiveDeviceInfo@4ad9b7b并不是设备信息
System.out.println("设备信息:" + activeDeviceInfo.getDeviceInfo() + "\n"); // 这个的结果才是设备信息
return R.ok().put("data", activeDeviceInfo.getDeviceInfo());
}
@PostMapping("/changeBucketPolicy")
public R changeBucketPolicy() {
String info;
try {
MinioClient minioClient = new MinioClient(
globalValue.getMinioEndpoint(), // MinIO 服务器的 URL
globalValue.getMinioAccessKey(), // 访问密钥
globalValue.getMinioSecretKey() // 密钥
);
String bucketName = "cell"; // 替换为你的桶名
String policy = "{ \"Version\": \"2012-10-17\", \"Statement\": [ { \"Effect\": \"Allow\", \"Principal\": { \"AWS\": [ \"*\" ] }, \"Action\": [ \"s3:GetObject\", \"s3:ListBucket\" ], \"Resource\": [ \"arn:aws:s3:::" + bucketName + "\", \"arn:aws:s3:::" + bucketName + "/*\" ] } ] }";
// 设置桶策略
minioClient.setBucketPolicy(bucketName, policy);
info = "Bucket policy set successfully";
} catch (Exception e) {
info = "Error occurred";
}
return R.ok().put("data", info);
}
}

View File

@ -4,13 +4,17 @@ import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import net.shapelight.common.utils.R;
import net.shapelight.modules.iCq.controller.enter.dto.ChangeTypeStatesDto;
import net.shapelight.modules.iCq.dal.mysql.enter.CqEnterConfigCellMapper;
import net.shapelight.modules.iCq.dal.mysql.enter.CqEnterConfigMapper;
import net.shapelight.modules.iCq.dal.mysql.enter.CqEnterConfigTypeMapper;
import net.shapelight.modules.iCq.service.enter.CqEnterServiceImpl;
import net.shapelight.modules.job.task.PersonSynchronousTask;
import oracle.jdbc.proxy.annotation.Post;
import org.springframework.web.bind.annotation.*;
import java.util.Map;
@RestController
@RequestMapping("cq/enterConfig")
@ -45,10 +49,10 @@ public class CqEnterController {
return R.ok().put("data", cqEnterService.rulesByType(typeId, cellId));
}
@PutMapping("/changeState/{ruleId}")
@PostMapping("/changeState")
@ApiOperation(value = "改变配置状态")
public R changeState(@PathVariable int ruleId){
if (cqEnterService.changeState(ruleId)){
public R changeState(@RequestBody ChangeTypeStatesDto data){
if (cqEnterService.changeState(data.getRuleId(), data.getCellId(), data.getTypeId())){
return R.ok();
}else {
return R.error();

View File

@ -0,0 +1,16 @@
package net.shapelight.modules.iCq.controller.enter.dto;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
@Data
@AllArgsConstructor
@NoArgsConstructor
@Accessors(chain = true)
public class ChangeTypeStatesDto {
private Integer ruleId;
private String cellId;
private Integer typeId;
}

View File

@ -86,7 +86,11 @@ public class CqSafeVideoController {
@PutMapping("/update")
@ApiOperation(value = "更新视频接口")
public R update(@RequestBody UpdateVideoDto updateVideoDto) {
public R update(@RequestBody UpdateVideoDto updateVideoDto,
@RequestHeader(value = "X-HTTP-Method-Override", required = false) String methodOverride) {
System.out.println("methodOverride = " + methodOverride);
if (cqSafeVideoService.update(updateVideoDto) == 1) {
return R.ok();
} else {

View File

@ -1,6 +1,7 @@
package net.shapelight.modules.iCq.controller.video.vo;
import com.arcsoft.face.Rect;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@ -30,6 +31,11 @@ public class FaceVideoVo {
*/
private String imageUrl;
/**
* 人员头像坐标
*/
private Rect rect;
}

View File

@ -113,33 +113,20 @@ public class CqEnterServiceImpl {
* @return
*/
@Transactional
public boolean changeState(int ruleId) {
TenEnterConfigCell id = cqEnterConfigCellMapper
.selectOne(new QueryWrapper<TenEnterConfigCell>().eq("id", ruleId));
System.out.println(id);
//多传递一个cellId
/* if(cellId == '1'){
ruleId = ruleId % 6 + 1;
}else{
ruleId = ruleId % 6 + 7;
}*/
public boolean changeState(int ruleId, String cellId, int typeId) {
return cqEnterConfigCellMapper.update(
null,
new UpdateWrapper<TenEnterConfigCell>()
.eq("enter_config_id", cqEnterConfigCellMapper
.selectOne(new QueryWrapper<TenEnterConfigCell>().eq("id", (ruleId % 6) + 1))
.getEnterConfigId())
.eq("cell_id", cqEnterConfigCellMapper
.selectOne(new QueryWrapper<TenEnterConfigCell>().eq("id", (ruleId % 6) + 1)).getCellId())
.eq("enter_config_id", ruleId)
.eq("cell_id", cellId)
.set("operate_time", new Date())) > 0
&& cqEnterConfigTypeMapper.update(
null,
new UpdateWrapper<TenEnterConfigType>()
.eq("id", ruleId)
.eq("enter_config_id", ruleId)
.eq("type_id", typeId)
.eq("cell_id", cellId)
.setSql("state = 1 - state")) > 0;
}

View File

@ -3,6 +3,7 @@ package net.shapelight.modules.job.task;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.json.JSONArray;
import cn.hutool.json.JSONObject;
import com.arcsoft.face.FaceEngine;
import com.arcsoft.face.FaceInfo;
import com.arcsoft.face.enums.ExtractType;
import com.arcsoft.face.toolkit.ImageFactory;
@ -39,6 +40,7 @@ import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.logging.SimpleFormatter;
import java.util.regex.Pattern;
@Component("personSynchronousTask")
@Slf4j
@ -149,8 +151,16 @@ public class PersonSynchronousTask extends AbstractController implements ITask {
System.out.println("cssssssssssssssssssssss" + data);
JSONArray dataList = data.getJSONArray("list");
List<JSONObject> list1 = dataList.toList(JSONObject.class);
String filePath = "C:\\zhihuiyuanqu\\firePerson.txt";
String osName = System.getProperty("os.name", "").toLowerCase();
// 创建一个File对象
String filePath;
if (Pattern.matches("windows.*", osName)) {
filePath = "C:\\zhihuiyuanqu\\firePerson.txt";
}else{
filePath = "zhihuiyuanqu/firePerson.txt";
}
File file = new File(filePath);
// 确保父目录存在
if (file.getParentFile() != null) {
@ -159,7 +169,7 @@ public class PersonSynchronousTask extends AbstractController implements ITask {
try (FileWriter writer = new FileWriter(file)) {
// 写入数据
list1.forEach(person -> {
String msg = save(person, item);
String msg = save(person, item, type);
System.out.println("msg = " + msg);
if (!msg.isEmpty()) {
try {
@ -186,7 +196,7 @@ public class PersonSynchronousTask extends AbstractController implements ITask {
public void getPmInternalPersonnelList2() {
public void getPmInternalPersonnelList2(String type) {
List<TenCellEntity> list = tenCellService.list();
list.forEach(item -> {
int pageIndex = 1;
@ -262,7 +272,7 @@ public class PersonSynchronousTask extends AbstractController implements ITask {
"}\n";*/
String jsonString = "{\n" +
/*String jsonString = "{\n" +
" \"data\": {\n" +
" \"list\": [\n" +
" {\n" +
@ -289,7 +299,74 @@ public class PersonSynchronousTask extends AbstractController implements ITask {
" \"errCode\": \"0\",\n" +
" \"resCode\": 1,\n" +
" \"timestamp\": 1729497503\n" +
"}";
"}";*/
String jsonString = "{\n" +
" \"success\": true,\n" +
" \"message\": null,\n" +
" \"errCode\": \"0\",\n" +
" \"resCode\": 1,\n" +
" \"apiVersion\": \"1\",\n" +
" \"timestamp\": 1726651433,\n" +
" \"data\": {\n" +
" \"apiVersion\": null,\n" +
" \"list\": [\n" +
" {\n" +
" \"pmContractorId\": \"73e92ad1ec104074a791540f65db99af\", \n" +
" \"orgId\": \"ORGACQ100008461\", \n" +
" \"orgName\": \"第二采油厂\\\\城壕采油作业区\", \n" +
" \"contractorName\": \"赵刚\", \n" +
" \"contractorCardId\": \"610501198910191210\", \n" +
" \"dictSex\": \"0\", \n" +
" \"dictSexName\": \"\", \n" +
" \"validPeriodSta\": \"2024-09-03 00:00:00\",\n" +
" \"validPeriodEnd\": \"2024-10-31 00:00:00\",\n" +
" \"dictNation\": \"01\", \n" +
" \"dicPolitical\": \"1\",\n" +
" \"dictNationName\": \"汉族\",\n" +
" \"dicPoliticalName\": \"中共党员\",\n" +
" \"mobile\": \"13772488873\", \n" +
" \"belongContractor\": \"21C0E54714D20F1DE06344A44E0ADD89\", \n" +
" \"belongTeam\": \"十多个的防火防盗\",\n" +
" \"certificateType\": \"特种作业人员\",\n" +
" \"isEnterSulfurArea\": \"\", \n" +
" \"isProtectDevice\": \"\",\n" +
" \"isBlacklistPersonnel\": \"\",\n" +
" \"isWatchSafeVideo\": \"未观看\",\n" +
" \"belongContractorName\": \"测试承包商\", \n" +
" \"attachment\": null, \n" +
" \"pmContractorCertDatas\": [ \n" +
" {\n" +
" \"pmContractorId\": \"73e92ad1ec104074a791540f65db99af\",\n" +
" \"pmContractorCertId\":\"c4316aba1e9c49cca03d7cd95832bf6a\",\n" +
" \t\t\t\t\t \"category\": null, \n" +
" \"certName\": \"333\", \n" +
" \"issueUnit\": \"3333\",\n" +
" \"certObtainDate\": \"2024-09-03\",\n" +
" \"effectiveDate\": \"2024-09-27\",\n" +
" \"certType\": \"特种作业人员\" ,\n" +
"\"attachment\": null \n" +
" }\n" +
" ],\n" +
" \"pmContractorTrainDatas\": [ \n" +
" {\n" +
" \"pmContractorId\": \"73e92ad1ec104074a791540f65db99af\",\n" +
" \"pmContractorTrainId\": \"75b9b3e6d16944ff8297e5fa04890c39\",\n" +
" \"trainContent\": \"问题而光伏发电\", \n" +
" \"trainStartDate\": \"2024-09-03\",\n" +
"\"trainEndDate\": \"2024-09-30\",\n" +
"\"theoreticalScore\": \"null\",\n" +
"\"practiceScore\": \"null\",\n" +
" \"personnelType\": \"特种作业人员\",\n" +
" \"isQualified\": \"\" \n" +
" }\n" +
" ]\n" +
" }\n" +
" ],\n" +
" \"total\": 1\n" +
" }\n" +
"}\n";
JSONObject jsonOne = new JSONObject(jsonString);
@ -328,7 +405,7 @@ public class PersonSynchronousTask extends AbstractController implements ITask {
// 写入数据
list1.forEach(person -> {
System.out.println("开始保存");
String msg = save(person, item);
String msg = save(person, item, type);
if (!msg.isEmpty()) {
try {
writer.write(msg);
@ -354,7 +431,7 @@ public class PersonSynchronousTask extends AbstractController implements ITask {
public String save(JSONObject person, TenCellEntity cellEntity) {
public String save(JSONObject person, TenCellEntity cellEntity, String type) {
/*System.out.println("personcscscs= " + person);*/
@ -371,6 +448,16 @@ public class PersonSynchronousTask extends AbstractController implements ITask {
tenPerson.setCreateTime(now);
tenPerson.setLastUpdateTime(now);
//type
if (type.equals("Person")) {
tenPerson.setPersonType(5000);
} else if (type.equals("Contractor")) {//承包商
tenPerson.setPersonType(5001);
} else {
tenPerson.setPersonType(5002);
}
//tenPerson.setCellId(person.getStr("orgId") != null ? Long.parseLong(UserRamGroup.getOrgCellMap(person.getStr("orgId"))) : null);
/* tenPerson.setCellId(person.getStr("orgId") != null ?
tenCellService.getOne(new QueryWrapper<TenCellEntity>().eq("org_id", person.getStr("orgId"))).getCellId() : null);*/
@ -381,7 +468,6 @@ public class PersonSynchronousTask extends AbstractController implements ITask {
tenPerson.setCellId(1L);
/* System.out.println("id = " + id);*/
tenPerson.setOrgId(cellEntity.getOrgId());
@ -393,9 +479,6 @@ public class PersonSynchronousTask extends AbstractController implements ITask {
}
if (person.getStr("personnelName") != null){
/* if(person.getStr("personnelName").equals("邢严")){
System.out.println("person水水水水水水水水水水水水水水水水水" + person);
}*/
tenPerson.setName(person.getStr("personnelName"));
}
@ -721,8 +804,9 @@ public class PersonSynchronousTask extends AbstractController implements ITask {
if(tenPersonService.getOne(new QueryWrapper<TenPersonEntity>()
.eq("open_id", tenPerson.getOpenId())) != null) {
//MyBatis-Plus会优先使用 personId 作为主键因为它更具体地定义了主键的生成策略
tenPersonService.removeById(tenPersonService.getOne(new QueryWrapper<TenPersonEntity>()
.eq("open_id", tenPerson.getOpenId())).getMemberId());
.eq("open_id", tenPerson.getOpenId())).getPersonId());
}
tenPersonService.saveTenPerson(tenPerson);
System.out.println("新增成功" + tenPerson);

View File

@ -50,6 +50,7 @@ import net.shapelight.modules.ten.service.*;
import net.shapelight.modules.ten.vo.PersonExcelModel;
import net.shapelight.modules.vo.TenDeviceVo;
import net.shapelight.modules.vo.TenPersonOperationVo;
import net.shapelight.modules.vo.TenPersonVo;
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.FilenameUtils;
import org.apache.poi.ss.usermodel.HorizontalAlignment;
@ -346,6 +347,10 @@ public class TenPersonController extends AbstractController {
}
params.put("isBlacklistPersonnel", 1);
PageUtils page = tenPersonService.queryPage(params);
return R.ok().put("data", page);
}
@ -581,7 +586,7 @@ public class TenPersonController extends AbstractController {
params.put("attachment", "data:image/jpeg;base64," + base64);
System.out.println("params = " + params);
//cxFeignClient.savePmVisitorPersonnel(params);
// cxFeignClient.savePmVisitorPersonnel(params);
}
return R.ok();
}

View File

@ -113,6 +113,10 @@ public class TenPersonServiceImpl extends ServiceImpl<TenPersonDao,TenPersonEnti
@Override
public PageUtils queryPage(Map<String, Object> params) {
System.out.println("params = " + params);
List<Long> cellIds = new ArrayList<>();
// cellIds.add(709832651506188289L);
@ -369,6 +373,8 @@ public class TenPersonServiceImpl extends ServiceImpl<TenPersonDao,TenPersonEnti
@CacheEvict(value = "TenPerson", allEntries = true)
public int saveTenPerson(TenPersonEntity entity) {
String userFileUrl = globalValue.getImagesDir() + "/org/";
System.out.println("userFileUrl = " + userFileUrl);
try {
//保存原始图片
String tempOrgImageFile = entity.getOrgImageTemp();
@ -398,9 +404,11 @@ public class TenPersonServiceImpl extends ServiceImpl<TenPersonDao,TenPersonEnti
byte[] bytes = outputStream.toByteArray();
outputStream.close();
tempInputStream.close();
System.out.println("测试打印");
//-------------------------------------------------------------------------
ImageInfo rgbData = ImageFactory.getRGBData(bytes);
List<FaceInfo> faceInfoList = faceEngineService.detectFaces(rgbData);
System.out.println("--测试打印--");
if (CollectionUtil.isNotEmpty(faceInfoList)) {
FaceInfo faceInfo = faceInfoList.get(0);
FaceRecognitionResDTO faceRecognitionResDTO = new FaceRecognitionResDTO();

View File

@ -335,6 +335,10 @@
is_check_cert,
</if>
<if test="belongContractorName != null">
belong_contractor_name,
</if>
</trim>
@ -527,6 +531,9 @@
<if test=" isCheckCert != null">
#{isCheckCert},
</if>
<if test="belongContractorName != null">
#{belongContractorName},
</if>
</trim>
</insert>
@ -902,6 +909,9 @@
<if test="params.liveEnd != null and params.liveEnd!=''">
and p.live_end &lt; #{params.liveEnd}
</if>
<if test="params.isBlacklistPersonnel != null and params.isBlacklistPersonnel!=''">
and p.is_blacklist_personnel = #{params.isBlacklistPersonnel}
</if>
order by p.create_time desc