修改现有问题

This commit is contained in:
张博 2024-11-06 10:12:15 +08:00
parent eccf6f1406
commit bada89d4c6
12 changed files with 155 additions and 90 deletions

View File

@ -14,7 +14,7 @@ ADD target/shapelight-admin.jar app.jar
EXPOSE 8018
# 定义环境变量
ENV JAVA_OPTS=""
ENV JAVA_OPTS="-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8095"
# 在容器启动时运行jar包
ENTRYPOINT exec java $JAVA_OPTS -Djava.security.egd=file:/dev/./cell -jar /app.jar

View File

@ -83,7 +83,7 @@ public class FaceEngineAutoRun extends AbstractController implements Application
// }
List<TenCellEntity> cellList = tenCellService.list(new QueryWrapper<TenCellEntity>()
/*List<TenCellEntity> cellList = tenCellService.list(new QueryWrapper<TenCellEntity>()
.eq("tenant_id","1298283126102949890")
.eq("delete_flag",0));
for(TenCellEntity cellEntity: cellList){
@ -112,6 +112,6 @@ public class FaceEngineAutoRun extends AbstractController implements Application
}
}
log.debug(cellEntity.getName()+":初始化人脸库完成,共 "+faceCount+"");
}
}*/
}
}

View File

@ -50,7 +50,7 @@ public class PersonProcessTask implements ITask {
//修改人员表
tenPersonService.updateStatusById(guest);
//特征保存到内存
UserRamGroup.removeUser(guest.getPersonId()+"",guest.getCellId()+"");
//UserRamGroup.removeUser(guest.getPersonId()+"",guest.getCellId()+"");
// UserRamCache.removeUser(guest.getPersonId()+"");
log.debug("内存删除人员:"+guest.getPersonId()+" 姓名:"+guest.getName());
//修改同步表

View File

@ -215,7 +215,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserDao, SysUserEntity> i
userScopeEntity.setUserId(user.getUserId());
//小区管理员
/* //小区管理员
if (user.getRoleIdList().get(0).longValue() == Constant.ROLE_TEN_CELL) {
TenCellEntity cell = tenCellService.getById(user.getCellId());
userScopeEntity.setAreaId(cell.getAreaId());
@ -251,7 +251,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserDao, SysUserEntity> i
appUser.setCurrentScopeId(appScope.getUserScopeId());
appUserService.updateById(appUser);
}
}*/
}
@Override

View File

@ -84,7 +84,7 @@ public class TenParentController {
appUserService.removeById(tenParent.getUserId());
appUserScopeService.remove(new LambdaQueryWrapper<AppUserScopeEntity>()
.eq(AppUserScopeEntity::getUserId,tenParent.getUserId()));
relationService.remove(new LambdaQueryWrapper<TenRelation>().eq(TenRelation::getParentId,item.get("id")));
relationService.remove(new LambdaQueryWrapper<TenRelation>().eq(TenRelation::getParentId,tenParent.getUserId()));
});
opParams.put("dataInfo",dataInfo);
JSONObject jsonObject = opFeignClient.submitData(opParams);

View File

@ -397,22 +397,23 @@ public class TenPersonController extends AbstractController {
}
TenPersonEntity tenPersonEntity = tenPersonService.findByName(tenPerson.getName(),
tenPerson.getRoomId(),tenPerson.getCellId());
if(tenPersonEntity!=null){
return R.error("当前学生已存在");
/*TenPersonEntity tenPersonEntity = tenPersonService.findByName(tenPerson.getName(),
tenPerson.getRoomId(),tenPerson.getCellId());*/
Integer count = tenPersonService.findByRyId(tenPerson.getRyid());
if(count!=null&&count>=1){
return R.error("当前学号已存在");
}
if(tenPerson.getIdCard()!=null){
// TenPersonEntity tenPersonIdcard = tenPersonService.findByIdCard(tenPerson.getIdCard(),
// tenPerson.getRoomId(),tenPerson.getCellId());
// if(tenPersonIdcard!=null){
// return R.error("身份证在此房间已存在");
// }
/* TenPersonEntity tenPersonIdcard = tenPersonService.findByIdCard(tenPerson.getIdCard(),
tenPerson.getRoomId(),tenPerson.getCellId());
if(tenPersonIdcard!=null){
return R.error("身份证在此班级已存在");
}*/
List<TenPersonEntity> list = tenPersonService.findByIdCardAndDept(tenPerson.getIdCard(),tenPerson.getDeptId());
if(list.size()>0){
return R.error("身份证在此组织已存在");
return R.error("身份证已存在");
}
}
@ -449,6 +450,10 @@ public class TenPersonController extends AbstractController {
tenPerson.setLastUpdateBy(getUser().getUsername());
tenPerson.setLastUpdateTime(new Date());
tenPerson.setFaceFailure(Constant.FACE_FAILURE_OK);
Integer count = tenPersonService.findByRyId(tenPerson.getRyid());
if(count!=null&&count>=2){
return R.error("当前学号已存在");
}
if(tenPerson.getIdCard()!=null){
if(tenPerson.getIdCard().length() == 15){
@ -690,8 +695,21 @@ public class TenPersonController extends AbstractController {
if(params.size()>20){
return R.error("最多选择20条数据");
}
List<Map<String, String>> list = new ArrayList<>();
//params.stream().filter(item -> !relationService.list(new LambdaQueryWrapper<TenRelation>().eq(TenRelation::getStudentId,item.get("personId"))).isEmpty()).collect(Collectors.toList());
Iterator<Map<String,String>> iterator = params.iterator();
while (iterator.hasNext()) {
Map<String,String> item = iterator.next();
List<TenRelation> tenRelations = relationService.list(new LambdaQueryWrapper<TenRelation>().eq(TenRelation::getStudentId,item.get("personId")).ne(TenRelation::getStatus,0));
if(!tenRelations.isEmpty()) {
iterator.remove();
list.add(item);
}
}
if (!params.isEmpty()) {
tenPersonService.removeByIdList(params);
return R.ok();
}
return R.ok().put("data",list);
}
// public R delete(@RequestBody Map<String, String> params){
// //tenRoomService.removeByIds(Arrays.asList(roomIds));

View File

@ -64,6 +64,7 @@ public class TenRelationController extends AbstractController {
tenRelation.setApprovalTime(new Date());
tenRelation.setApproval(getUser().getRealName());
AppUserEntity appUser = appUserService.getById(tenRelation.getParentId());
if(tenRelation.getStatus().equals(1)) {
Map<String,Object> opParams = new HashMap<>();
opParams.put("operation","editUserContactData");
opParams.put("accountNumber",globalValue.accountNumber);
@ -83,9 +84,18 @@ public class TenRelationController extends AbstractController {
if(jsonObject.getJSONArray("errInfo").isEmpty()) {
relationService.updateById(tenRelation);
}
}else {
errMsg.add(item.get("id").toString());
}
} else {
relationService.updateById(tenRelation);
}
});
if (errMsg.isEmpty()) {
return R.ok();
} else {
return R.error(errMsg.toString()+"不存在");
}
}
}

View File

@ -122,6 +122,8 @@ public interface TenPersonDao {
TenPersonEntity findByRyId(@Param("ryId")String ryId, @Param("cellId")Long cellId,@Param("idCard") String idCard);
Integer getCountByRyId(String ryId);
IPage<TenPersonEntity> getByPersonIds(Page page,@Param("personIds")List<Long> personIds, @Param("cellId")Long cellId);
List<TenPersonEntity> listPage(@Param("start")int start, @Param("count")int count, @Param("cellId")String cellId);

View File

@ -156,5 +156,7 @@ public interface TenPersonService {
List<TenPersonEntity> listPage(int start, int count, String cellId);
Integer findByRyId(String ryId);
}

View File

@ -9,6 +9,7 @@ import com.arcsoft.face.FaceInfo;
import com.arcsoft.face.enums.ExtractType;
import com.arcsoft.face.toolkit.ImageFactory;
import com.arcsoft.face.toolkit.ImageInfo;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.minio.MinioClient;
import io.minio.PutObjectOptions;
@ -32,6 +33,7 @@ import net.shapelight.modules.job.entity.KeysEntity;
import net.shapelight.modules.nettyapi.service.ServerApiService;
import net.shapelight.modules.sys.entity.SysDictEntity;
import net.shapelight.modules.sys.service.impl.SysDictServiceImpl;
import net.shapelight.modules.ten.dao.TenRelationMapper;
import net.shapelight.modules.ten.entity.*;
import net.shapelight.modules.ten.service.*;
import net.shapelight.modules.tripartitePlatform.operatorPlatform.OpFeignClient;
@ -115,6 +117,8 @@ public class TenPersonServiceImpl implements TenPersonService {
private String bucketName;
@Autowired
private FaceEngineService faceEngineService;
@Autowired
private TenRelationMapper tenRelationMapper;
@Override
@ -474,7 +478,7 @@ public class TenPersonServiceImpl implements TenPersonService {
appUserService.updateById(appUser);
}
/*//发送设备通知
//发送设备通知
List<TenDeviceVo> devList = tenDeviceService.findByCellId(entity.getCellId());
//状态是0正常发送推送
if (entity.getStatus().intValue() == Constant.PESON_SUATUS_NOMOR) {
@ -489,17 +493,17 @@ public class TenPersonServiceImpl implements TenPersonService {
syncEntity.setLastUpdateTime(entity.getLastUpdateTime());
tenPersonSyncService.insert(syncEntity);
//下发通知
/* //下发通知
List<TenPersonOperationVo> list = new ArrayList<>();
TenPersonOperationVo vo = new TenPersonOperationVo();
vo.setUid(syncEntity.getPersonId());
vo.setOperation(1);
vo.setLast_update_stamp(syncEntity.getLastUpdateTime());
list.add(vo);
serverApiService.personOperation(dev.getSn(), list);
serverApiService.personOperation(dev.getSn(), list);*/
}
}*/
if(entity.getPersonType()!=Constant.PERSON_TYPE_GUEST) {
}
if(entity.getPersonType()==Constant.PERSON_TYPE_OWNER) {
List<SysDictEntity> dictList = sysDictService.queryByType("optype");
Map<String,Object> optypeMap = new HashMap<>();
dictList.forEach(dict -> {
@ -527,10 +531,12 @@ public class TenPersonServiceImpl implements TenPersonService {
JSONObject jsonObject = opFeignClient.submitData(personParams);
if(!jsonObject.getString("shrgStatus").equals("S")) {
log.error(jsonObject.toJSONString());
new SyncFailedException(entity.getPersonId()+","+entity.getName()+"青桔同步失败");
return jsonObject.getString("shrgMsg");
}
if(!jsonObject.getJSONArray("errInfo").isEmpty()) {
log.error(jsonObject.toJSONString());
new SyncFailedException(entity.getPersonId()+","+entity.getName()+"青桔同步失败");
return jsonObject.getJSONArray("errInfo").toJSONString();
}
}
@ -820,14 +826,14 @@ public class TenPersonServiceImpl implements TenPersonService {
syncEntity.setLastUpdateTime(entity.getLastUpdateTime());
tenPersonSyncService.insert(syncEntity);
//下发通知
/* //下发通知
List<TenPersonOperationVo> list = new ArrayList<>();
TenPersonOperationVo vo = new TenPersonOperationVo();
vo.setUid(syncEntity.getPersonId());
vo.setOperation(1);
vo.setLast_update_stamp(syncEntity.getLastUpdateTime());
list.add(vo);
serverApiService.personOperation(dev.getSn(), list);
serverApiService.personOperation(dev.getSn(), list);*/
}
}
return true;
@ -887,11 +893,29 @@ public class TenPersonServiceImpl implements TenPersonService {
//删除人员
tenPersonDao.logicDeleteById(personId, cellId);
//记录所有人员id
Map<String,Object> personParams = new HashMap<>();
personParams.put("operation","delUserData");
personParams.put("accountNumber",globalValue.accountNumber);
personParams.put("passKey", KeysEntity.passKey);
personParams.put("empowerText",KeysEntity.empowerText);
JSONArray jsonArray = new JSONArray();
Map<String,Object> student = new HashMap<>();
student.put("objectUuid",String.valueOf(entity.getPersonId()));
jsonArray.add(student);
personParams.put("dataInfo",jsonArray);
JSONObject jsonObject = opFeignClient.submitData(personParams);
if(jsonObject.getString("shrgStatus").equals("S")) {
if(jsonObject.getJSONArray("errInfo").isEmpty()) {
tenPersonDao.logicDeleteById(personId, cellId);
tenRelationMapper.delete(new LambdaQueryWrapper<TenRelation>().eq(TenRelation::getStudentId,personId));
personIds.add(personId);
}
}
}
//配置同步信息并推送
@ -914,7 +938,7 @@ public class TenPersonServiceImpl implements TenPersonService {
syncEntity.setState(Constant.PERSON_SYNC_DELETE);
tenPersonSyncService.updateById(syncEntity);
}
//下发通知
/*//下发通知
List<TenPersonSyncEntity> allDelete = tenPersonSyncService.findDeviceAllDeletePersons(deviceEntity.getDeviceId(), deviceEntity.getTenantId());
for (TenPersonSyncEntity syncEntity : allDelete) {
TenPersonOperationVo vo = new TenPersonOperationVo();
@ -922,14 +946,13 @@ public class TenPersonServiceImpl implements TenPersonService {
vo.setOperation(Constant.PERSON_SYNC_DELETE);
vo.setLast_update_stamp(syncEntity.getLastUpdateTime());
list.add(vo);
}
}*/
//int flag = serverApiService.personOperation(sn, list);
int flag = serverApiService.personOperation(sn, list);
if (flag == 0) {
//下发成功删除状态为删除的同步人员
tenPersonSyncService.removeAllDeletePersons(deviceEntity.getDeviceId(), tenantId);
}
}
return true;
}
@ -1440,6 +1463,7 @@ public class TenPersonServiceImpl implements TenPersonService {
// for (TenDeviceVo dev : devList) {
// CmdProcess.publishPersonChange(dev.getSn());
// }
if(entity.getPersonType() == Constant.PERSON_TYPE_OWNER) {
List<SysDictEntity> dictList = sysDictService.queryByType("optype");
Map<String,Object> optypeMap = new HashMap<>();
dictList.forEach(dict -> {
@ -1456,23 +1480,22 @@ public class TenPersonServiceImpl implements TenPersonService {
student.put("userCode",entity.getRyid());
student.put("userName",entity.getName());
student.put("userType",optypeMap.get(entity.getLabelName()));
student.put("studentType","0"+entity.getPersonType());
student.put("studentType","0"+entity.getLabelId());
student.put("gender",entity.getGender()==0?"WOMAN":"MAN");
student.put("cardNumber","");
student.put("idCard",entity.getIdCard());
student.put("fileUrl",imagBaseUrl+"/"+bucketName+"/"+entity.getOrgImage());
student.put("fileName",entity.getOrgImage().substring(entity.getOrgImage().lastIndexOf("//")));
student.put("fileName",entity.getOrgImage().substring(entity.getOrgImage().lastIndexOf("/")+1));
jsonArray.add(student);
personParams.put("dataInfo",jsonArray);
JSONObject jsonObject = opFeignClient.submitData(personParams);
if(!jsonObject.getString("shrgStatus").equals("S")) {
new SyncFailedException(entity.getPersonId()+","+entity.getName()+"青桔同步失败");
throw new SyncFailedException(entity.getPersonId()+","+entity.getName()+"青桔同步失败");
}
if(jsonObject.getJSONArray("errInfo")!=null && !jsonObject.getJSONArray("errInfo").isEmpty()) {
new SyncFailedException(entity.getPersonId()+","+entity.getName()+"青桔同步失败");
throw new SyncFailedException(entity.getPersonId()+","+entity.getName()+"青桔同步失败");
}
}
return "OK";
}
@ -2543,4 +2566,9 @@ public class TenPersonServiceImpl implements TenPersonService {
public List<TenPersonEntity> listPage(int start, int count, String cellId) {
return tenPersonDao.listPage(start, count, cellId);
}
@Override
public Integer findByRyId(String ryId) {
return tenPersonDao.getCountByRyId(ryId);
}
}

View File

@ -6,9 +6,9 @@ spring:
# url: jdbc:mysql://localhost:3306/site_db_1.3?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai
# username: rootuser
# password: zy_db@C501
url: jdbc:mysql://localhost:3306/cell_db?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai
username: user
password: user@server001
url: jdbc:mysql://192.168.10.62:3306/smartschool?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai
username: smartschool
password: jaGXddQFnsxcTJSd
initial-size: 10
max-active: 100
min-idle: 10

View File

@ -1321,7 +1321,12 @@
<select id="findByRyId" resultType="net.shapelight.modules.ten.entity.TenPersonEntity">
select * from ten_person
where ryid = #{ryId} and id_card = #{idCard}
where ryid = #{ryId} and id_card = #{idCard} and delete_flag = 0
</select>
<select id="getCountByRyId" resultType="int">
select count(1) from ten_person
where ryid = #{ryId} and delete_flag = 0
</select>